sdl2_frt/include
Sam Lantinga 9fff05f8d6 Fixed bug 3352 - Adding alpha mask support to SDL_SaveBMP_RW
Simon Hug

The current SDL_SaveBMP_RW function that saves surfaces to a BMP uses an old bitmap header which doesn't officially support alpha channels. Applications just ignore the byte where the alpha is stored. This can easily be extended by using a newer header version and setting the alpha mask.

The attached patch has these changes:

- Extending the description of the function in the SDL_surface.h header with the supported formats.
- Refining when surfaces get stored to a 32-bit BMP. (Must have bit depth of 8 or higher and must have an alpha mask or colorkey.)
- Fixing a small bug that saves 24-bit BGR surfaces with a colorkey in a 24-bit BMP.
- Adding code that switches to the bitmap header version 4 if the surface has an alpha mask or colorkey. (I chose version 4 because Microsoft didn't lose its documentation behind a file cabinet like they did with version 3.)
- Adding a hint that can disable the use of the version 4 header. This is for people that need the legacy header or like the old behavior better. (I'm not sure about the hint name, though. May need changing if there are any rules to that.)
2016-10-01 11:29:13 -07:00
..
begin_code.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
close_code.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_assert.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_atomic.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_audio.h audio: Implemented buffer queueing for capture devices (SDL_DequeueAudio()). 2016-08-06 02:47:27 -04:00
SDL_bits.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_blendmode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_clipboard.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_android.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_iphoneos.h Enable SDL_LoadObject on iOS 8+ and tvOS. 2016-09-25 15:02:06 -03:00
SDL_config_macosx.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_minimal.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_pandora.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_psp.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_windows.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_winrt.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config_wiz.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h.cmake Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_config.h.in Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_copying.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_cpuinfo.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_egl.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_endian.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_error.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_events.h Added SDL_DROPBEGIN and SDL_DROPCOMPLETE events, plus window IDs for drops. 2016-01-05 01:42:00 -05:00
SDL_filesystem.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_gamecontroller.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_gesture.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_haptic.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_hints.h Fixed bug 3352 - Adding alpha mask support to SDL_SaveBMP_RW 2016-10-01 11:29:13 -07:00
SDL_joystick.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_keyboard.h Fixed two old identifiers in header comments. 2016-08-03 22:39:44 +02:00
SDL_keycode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_loadso.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_log.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_main.h Android: Updated name of README file. 2016-04-25 22:17:38 +02:00
SDL_messagebox.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_mouse.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00
SDL_mutex.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_name.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_opengl_glext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengl.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_opengles2_gl2.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2ext.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_gl2platform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2_khrplatform.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_opengles2.h Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
SDL_opengles.h Fixed including OpenGL ES on iOS without any other SDL headers 2016-09-14 08:20:24 -07:00
SDL_pixels.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_platform.h Initial Apple TV / tvOS support. 2016-09-13 22:18:06 -03:00
SDL_power.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_quit.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_rect.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_render.h SDL_RenderSetIntegerScale 2016-01-05 16:39:18 -05:00
SDL_revision.h Fixed crash if initialization of EGL failed but was tried again later. 2015-06-21 17:33:46 +02:00
SDL_rwops.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_scancode.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_shape.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_stdinc.h Fixed bug 3336 - Failure to build with MinGW-w64 2016-10-01 10:28:00 -07:00
SDL_surface.h Fixed bug 3352 - Adding alpha mask support to SDL_SaveBMP_RW 2016-10-01 11:29:13 -07:00
SDL_system.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_syswm.h Expose the EGL display and window for Vivante SDL windows 2016-01-16 21:58:49 -08:00
SDL_test_assert.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_common.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_compare.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_crc32.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_font.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_fuzzer.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_harness.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_images.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_log.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_md5.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test_random.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_test.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_thread.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_timer.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_touch.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_types.h Updated copyright to 2016 2016-01-02 10:10:34 -08:00
SDL_version.h Updated version to 2.0.5 in preparation for release 2016-09-28 22:24:01 -07:00
SDL_video.h Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
SDL.h Added brackets to function names in header comments so that doxygen links them. 2016-08-03 22:30:31 +02:00