From 740850d3ceeb0a01a9ac3e6e394c1adb3804fa80 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Jun 2024 13:05:44 +0100 Subject: [PATCH 001/431] testevdev: Add a field for the USB device version For some devices, such as the Steam Deck's built-in Steam Controller, the version number reported via evdev and the version number reported via USB are different. We don't currently use this information anyway, but in case we want to use it in the future, let's include it in our test data. Signed-off-by: Simon McVittie --- test/testevdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testevdev.c b/test/testevdev.c index af91b3df277ff..b62e29c842621 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -81,6 +81,7 @@ typedef struct uint16_t vendor_id; uint16_t product_id; uint16_t version; + uint16_t usb_device_version; uint8_t ev[(EV_MAX + 1) / 8]; uint8_t keys[(KEY_MAX + 1) / 8]; uint8_t abs[(ABS_MAX + 1) / 8]; From f471392e7348d568a8c91fec9a1cc7267d5e0fc8 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Jun 2024 13:18:11 +0100 Subject: [PATCH 002/431] testevdev: Add test data from Steam Deck built-in devices Thanks: Robert Beckett Signed-off-by: Simon McVittie --- test/testevdev.c | 189 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 186 insertions(+), 3 deletions(-) diff --git a/test/testevdev.c b/test/testevdev.c index b62e29c842621..d30635edea517 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -198,6 +198,55 @@ static unsigned char ps3_hid_report_descriptor[] = }; SDL_COMPILE_TIME_ASSERT (ps3, sizeof (ps3_hid_report_descriptor) == 149); +/* Same for Steam Deck LCD (jupiter) and OLED (galileo) */ +static unsigned char steam_deck_mouse_hid_report_descriptor[] = +{ + 0x05, 0x01, 0x09, 0x02, 0xa1, 0x01, 0x09, 0x01, + 0xa1, 0x00, 0x05, 0x09, 0x19, 0x01, 0x29, 0x02, + 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x02, + 0x81, 0x02, 0x75, 0x06, 0x95, 0x01, 0x81, 0x01, + 0x05, 0x01, 0x09, 0x30, 0x09, 0x31, 0x15, 0x81, + 0x25, 0x7f, 0x75, 0x08, 0x95, 0x02, 0x81, 0x06, + 0x95, 0x01, 0x09, 0x38, 0x81, 0x06, 0x05, 0x0c, + 0x0a, 0x38, 0x02, 0x95, 0x01, 0x81, 0x06, 0xc0, + 0xc0, +}; +SDL_COMPILE_TIME_ASSERT (steam_deck_mouse, + sizeof (steam_deck_mouse_hid_report_descriptor) == 65); + +/* Same for Steam Deck LCD (jupiter) and OLED (galileo) */ +static unsigned char steam_deck_kb_hid_report_descriptor[] = +{ + 0x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, + 0x19, 0xe0, 0x29, 0xe7, 0x15, 0x00, 0x25, 0x01, + 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x81, 0x01, + 0x19, 0x00, 0x29, 0x65, 0x15, 0x00, 0x25, 0x65, + 0x75, 0x08, 0x95, 0x06, 0x81, 0x00, 0xc0, +}; +SDL_COMPILE_TIME_ASSERT (steam_deck_oled_kb, + sizeof (steam_deck_kb_hid_report_descriptor) == 39); + +static unsigned char steam_deck_lcd_js_hid_report_descriptor[] = +{ + 0x06, 0xff, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x15, + 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x40, + 0x09, 0x01, 0x81, 0x02, 0x09, 0x01, 0xb1, 0x02, + 0xc0, +}; +SDL_COMPILE_TIME_ASSERT (steam_deck_lcd_js, + sizeof (steam_deck_lcd_js_hid_report_descriptor) == 25); + +static unsigned char steam_deck_oled_js_hid_report_descriptor[] = +{ + 0x06, 0xff, 0xff, 0x09, 0x01, 0xa1, 0x01, 0x09, + 0x02, 0x09, 0x03, 0x15, 0x00, 0x26, 0xff, 0x00, + 0x75, 0x08, 0x95, 0x40, 0x81, 0x02, 0x09, 0x06, + 0x09, 0x07, 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, + 0x08, 0x95, 0x40, 0xb1, 0x02, 0xc0, +}; +SDL_COMPILE_TIME_ASSERT (steam_deck_oled_js, + sizeof (steam_deck_oled_js_hid_report_descriptor) == 38); + #if 0 /* unused for now */ static unsigned char vrs_pedals_hid_report_descriptor[] = { @@ -672,6 +721,135 @@ static const GuessTest guess_tests[] = /* 0x100 */ 0x00, 0x00, 0x1f, 0x00, ZEROx4, }, }, + { + .name = "Steam Deck - mouse", + /* This is the LCD model (jupiter). + * Steam Deck OLED (galileo, possibly pre-production) has + * .eviocgname = "Valve Software Steam Controller" + * .version = 0x0110 + * .usb_device_version = 0x0300 + * but is otherwise equivalent. + */ + .eviocgname = "Valve Software Steam Deck Controller", + .usb_vendor_name = "Valve Software", + .usb_product_name = "Steam Deck Controller", + .bus_type = 0x0003, + .vendor_id = 0x28de, + .product_id = 0x1205, + .version = 0x011, + .usb_device_version = 0x0200, + /* SYN, KEY, REL, MSC */ + .ev = { 0x17 }, + /* X, Y, mouse wheel v/h, high-res mouse wheel v/h */ + .rel = { 0x43, 0x19 }, + .keys = { + /* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8, + /* left/right mouse button */ + /* 0x100 */ 0x00, 0x00, 0x03, 0x00, ZEROx4, + }, + .expected = SDL_UDEV_DEVICE_MOUSE, + .hid_report_descriptor_length = sizeof (steam_deck_mouse_hid_report_descriptor), + .hid_report_descriptor = &steam_deck_mouse_hid_report_descriptor[0], + }, + { + .name = "Steam Deck - keyboard", + /* This is the LCD model (jupiter). + * Steam Deck OLED (galileo, possibly pre-production) has + * .eviocgname = "Valve Software Steam Controller" + * .version = 0x0110 + * .usb_device_version = 0x0300 + * but is otherwise equivalent. + */ + .eviocgname = "Valve Software Steam Deck Controller", + .usb_vendor_name = "Valve Software", + .usb_product_name = "Steam Deck Controller", + .bus_type = 0x0003, + .vendor_id = 0x28de, + .product_id = 0x1205, + .version = 0x0110, + .usb_device_version = 0x0300, + /* SYN, KEY, MSC, REP */ + .ev = { 0x13, 0x00, 0x10 }, + .keys = { + /* 0x00 */ 0xfe, 0xff, 0xff, 0xff, FFx4, + /* 0x40 */ 0xff, 0xff, 0xcf, 0x01, 0xdf, 0xff, 0x80, 0xe0, + }, + .expected = SDL_UDEV_DEVICE_KEYBOARD | SDL_UDEV_DEVICE_HAS_KEYS, + .hid_report_descriptor_length = sizeof (steam_deck_kb_hid_report_descriptor), + .hid_report_descriptor = &steam_deck_kb_hid_report_descriptor[0], + }, + { + .name = "Steam Deck LCD - gamepad", + .eviocgname = "Valve Software Steam Deck Controller", + .usb_vendor_name = "Valve Software", + .usb_product_name = "Steam Deck Controller", + .bus_type = 0x0003, + .vendor_id = 0x28de, + .product_id = 0x1205, + .version = 0x0111, + .usb_device_version = 0x0200, + .expected = SDL_UDEV_DEVICE_JOYSTICK, + /* TODO: The data I have for Steam Deck LCD didn't seem to have + * an evdev device available, so this is extrapolated from + * kernel source code as being the same as the OLED model + * (the kernel driver doesn't distinguish). */ + /* SYN, KEY, ABS */ + .ev = { 0x0b }, + /* X, Y, RX, RY, hat 0-2 x/y */ + .abs = { 0x1b, 0x00, 0x3f }, + .keys = { + /* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8, + /* 0x120 0x46: joystick THUMB, THUMB2, BASE */ + /* 0x130 0xdb: gamepad ABXY, TL/TR */ + /* 0x138 0x7f: gamepad TL2/TR2, SELECT/START, MODE, THUMBL/R */ + /* 0x100 */ ZEROx4, 0x46, 0x00, 0xdb, 0x7f, + /* 0x140 */ ZEROx8, + /* 0x180 */ ZEROx8, + /* 0x1c0 */ ZEROx8, + /* 0x220 0x0f: dpad up/down/left/right */ + /* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00, + /* 0x240 */ ZEROx8, + /* 0x280 */ ZEROx8, + /* 0x2c0 0x0f: joystick TRIGGER_HAPPY1..TRIGGER_HAPPY4 */ + /* 0x2c0 */ 0x0f, + }, + .hid_report_descriptor_length = sizeof (steam_deck_lcd_js_hid_report_descriptor), + .hid_report_descriptor = &steam_deck_lcd_js_hid_report_descriptor[0], + }, + { + .name = "Steam Deck OLED - gamepad", + .eviocgname = "Valve Software Steam Controller", + .usb_vendor_name = "Valve Software", + .usb_product_name = "Steam Controller", + .bus_type = 0x0003, + .vendor_id = 0x28de, + .product_id = 0x1205, + .version = 0x0110, + .usb_device_version = 0x0300, + /* SYN, KEY, ABS */ + .ev = { 0x0b }, + /* X, Y, RX, RY, hat 0-2 x/y */ + .abs = { 0x1b, 0x00, 0x3f }, + .keys = { + /* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8, + /* 0x120 0x46: joystick THUMB, THUMB2, BASE */ + /* 0x130 0xdb: gamepad ABXY, TL/TR */ + /* 0x138 0x7f: gamepad TL2/TR2, SELECT/START, MODE, THUMBL/R */ + /* 0x100 */ ZEROx4, 0x46, 0x00, 0xdb, 0x7f, + /* 0x140 */ ZEROx8, + /* 0x180 */ ZEROx8, + /* 0x1c0 */ ZEROx8, + /* 0x220 0x0f: dpad up/down/left/right */ + /* 0x200 */ ZEROx4, 0x0f, 0x00, 0x00, 0x00, + /* 0x240 */ ZEROx8, + /* 0x280 */ ZEROx8, + /* 0x2c0 0x0f: joystick TRIGGER_HAPPY1..TRIGGER_HAPPY4 */ + /* 0x2c0 */ 0x0f, + }, + .expected = SDL_UDEV_DEVICE_JOYSTICK, + .hid_report_descriptor_length = sizeof (steam_deck_oled_js_hid_report_descriptor), + .hid_report_descriptor = &steam_deck_oled_js_hid_report_descriptor[0], + }, { .name = "Guitar Hero for PS3", /* SWITCH CO.,LTD. Controller (Dinput) off-brand N64-style USB controller @@ -1545,6 +1723,8 @@ static const GuessTest guess_tests[] = { /* Assumed to be a reasonably typical i8042 (PC AT) keyboard */ .name = "Thinkpad T520 and X280 keyboards", + /* Steam Deck LCD/OLED keyboard interface is version 0xab83 but + * otherwise equivalent */ .eviocgname = "AT Translated Set 2 keyboard", .bus_type = 0x0011, /* BUS_I8042 */ .vendor_id = 0x0001, @@ -1578,7 +1758,8 @@ static const GuessTest guess_tests[] = }, }, { - .name = "Thinkpad X280 lid switch", + /* As seen on Thinkpad X280, Steam Deck LCD, Steam Deck OLED */ + .name = "ACPI lid switch", .eviocgname = "Lid Switch", .bus_type = 0x0019, /* BUS_HOST */ .vendor_id = 0x0000, @@ -1589,7 +1770,8 @@ static const GuessTest guess_tests[] = .ev = { 0x21 }, }, { - .name = "Thinkpad X280 power button", + /* As seen on Thinkpad X280, Steam Deck LCD, Steam Deck OLED */ + .name = "ACPI power button", .eviocgname = "Power Button", .bus_type = 0x0019, /* BUS_HOST */ .vendor_id = 0x0000, @@ -1605,7 +1787,8 @@ static const GuessTest guess_tests[] = }, }, { - .name = "Thinkpad X280 video bus", + /* As seen on Thinkpad X280, Steam Deck LCD, Steam Deck OLED */ + .name = "ACPI video bus", .eviocgname = "Video Bus", .bus_type = 0x0019, /* BUS_HOST */ .vendor_id = 0x0000, From c244eb937b7fb31202580f2a28f2e81e706f861e Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Jun 2024 14:23:30 +0100 Subject: [PATCH 003/431] testevdev: Add the virtual X360 controller created by Steam Input Thanks: Robert Beckett Signed-off-by: Simon McVittie --- test/testevdev.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/testevdev.c b/test/testevdev.c index d30635edea517..a7d507d850dd8 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -850,6 +850,25 @@ static const GuessTest guess_tests[] = .hid_report_descriptor_length = sizeof (steam_deck_oled_js_hid_report_descriptor), .hid_report_descriptor = &steam_deck_oled_js_hid_report_descriptor[0], }, + { + .name = "Steam Input virtual controller", + .eviocgname = "Microsoft X-Box 360 pad 0", + .bus_type = 0x0003, + .vendor_id = 0x28de, + .product_id = 0x11ff, + .version = 0x0001, + .expected = SDL_UDEV_DEVICE_JOYSTICK, + /* SYN, KEY, ABS, FF */ + .ev = { 0x0b, 0x00, 0x20 }, + /* XYZ, RXYZ, hat 0 */ + .abs = { 0x3f, 0x00, 0x03 }, + .keys = { + /* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8, + /* 0x130 0xdb: gamepad ABXY, TL/TR */ + /* 0x138 0x7f: gamepad SELECT/START, MODE, THUMBL/R */ + /* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c, + }, + }, { .name = "Guitar Hero for PS3", /* SWITCH CO.,LTD. Controller (Dinput) off-brand N64-style USB controller From 2804f92eff4c207c4ce71e050b3d13a16b2f2d4d Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Jun 2024 11:37:28 +0100 Subject: [PATCH 004/431] testevdev: Add missing device ID for Wiimote Classic Controller Thanks: Jeremy Whiting Signed-off-by: Simon McVittie --- test/testevdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testevdev.c b/test/testevdev.c index a7d507d850dd8..5cdb9d26f6865 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -1537,6 +1537,10 @@ static const GuessTest guess_tests[] = { .name = "Wiimote - Classic Controller", .eviocgname = "Nintendo Wii Remote Classic Controller", + .bus_type = 0x0005, + .vendor_id = 0x057e, + .product_id = 0x0306, + .version = 0x0600, /* TODO: Should this be JOYSTICK, or maybe JOYSTICK|HAS_KEYS? * It's unusual in the same ways as the Wiimote */ .expected = SDL_UDEV_DEVICE_HAS_KEYS, From 53eff7f9038b28e8eba9052a1804c7b3d659dd28 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 21 Jun 2024 14:12:08 +0100 Subject: [PATCH 005/431] testevdev: Add X-Box One S controller via xpadneo 0.9.x This is an out-of-tree driver providing an alternative interface to X-Box gamepads. Compared with the in-kernel driver, it adds four pseudo-buttons used to indicate which profile is active, and an optional "misc" axis that combines the two triggers into a rudder. Partially addresses libsdl-org/SDL#7823 Thanks: @kakra Signed-off-by: Simon McVittie --- test/testevdev.c | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/test/testevdev.c b/test/testevdev.c index 5cdb9d26f6865..6e5300d9feb32 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -340,6 +340,47 @@ static unsigned char fanatec_handbrake_hid_report_descriptor[] = }; SDL_COMPILE_TIME_ASSERT (fanatec_handbrake, sizeof (fanatec_handbrake_hid_report_descriptor) == 046); +static unsigned char xpadneo09_xb1s_hid_report_descriptor[] = +{ + 0x05, 0x01, 0x09, 0x05, 0xa1, 0x01, 0x85, 0x01, + 0x09, 0x01, 0xa1, 0x00, 0x09, 0x30, 0x09, 0x31, + 0x15, 0x00, 0x27, 0xff, 0xff, 0x00, 0x00, 0x95, + 0x02, 0x75, 0x10, 0x81, 0x02, 0xc0, 0x09, 0x01, + 0xa1, 0x00, 0x09, 0x33, 0x09, 0x34, 0x15, 0x00, + 0x27, 0xff, 0xff, 0x00, 0x00, 0x95, 0x02, 0x75, + 0x10, 0x81, 0x02, 0xc0, 0x05, 0x01, 0x09, 0x32, + 0x15, 0x00, 0x26, 0xff, 0x03, 0x95, 0x01, 0x75, + 0x0a, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75, + 0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01, 0x09, + 0x35, 0x15, 0x00, 0x26, 0xff, 0x03, 0x95, 0x01, + 0x75, 0x0a, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, + 0x75, 0x06, 0x95, 0x01, 0x81, 0x03, 0x05, 0x01, + 0x09, 0x39, 0x15, 0x01, 0x25, 0x08, 0x35, 0x00, + 0x46, 0x3b, 0x01, 0x66, 0x14, 0x00, 0x75, 0x04, + 0x95, 0x01, 0x81, 0x42, 0x75, 0x04, 0x95, 0x01, + 0x15, 0x00, 0x25, 0x00, 0x35, 0x00, 0x45, 0x00, + 0x65, 0x00, 0x81, 0x03, 0x05, 0x09, 0x19, 0x01, + 0x29, 0x0c, 0x15, 0x00, 0x25, 0x01, 0x75, 0x01, + 0x95, 0x0c, 0x81, 0x02, 0x15, 0x00, 0x25, 0x00, + 0x75, 0x01, 0x95, 0x04, 0x81, 0x03, 0x05, 0x0c, + 0x0a, 0xb2, 0x00, 0x15, 0x00, 0x25, 0x01, 0x95, + 0x01, 0x75, 0x01, 0x81, 0x02, 0x15, 0x00, 0x25, + 0x00, 0x75, 0x07, 0x95, 0x01, 0x81, 0x03, 0x05, + 0x0f, 0x09, 0x21, 0x85, 0x03, 0xa1, 0x02, 0x09, + 0x97, 0x15, 0x00, 0x25, 0x01, 0x75, 0x04, 0x95, + 0x01, 0x91, 0x02, 0x15, 0x00, 0x25, 0x00, 0x75, + 0x04, 0x95, 0x01, 0x91, 0x03, 0x09, 0x70, 0x15, + 0x00, 0x25, 0x64, 0x75, 0x08, 0x95, 0x04, 0x91, + 0x02, 0x09, 0x50, 0x66, 0x01, 0x10, 0x55, 0x0e, + 0x15, 0x00, 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, + 0x01, 0x91, 0x02, 0x09, 0xa7, 0x15, 0x00, 0x26, + 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, 0x02, + 0x65, 0x00, 0x55, 0x00, 0x09, 0x7c, 0x15, 0x00, + 0x26, 0xff, 0x00, 0x75, 0x08, 0x95, 0x01, 0x91, + 0x02, 0xc0, 0xc0, +}; +SDL_COMPILE_TIME_ASSERT (xpadneo09_xb1s, sizeof (xpadneo09_xb1s_hid_report_descriptor) == 283); + /* Test-cases derived from real devices or from Linux kernel source */ /* *INDENT-OFF* */ /* clang-format off */ static const GuessTest guess_tests[] = @@ -475,6 +516,37 @@ static const GuessTest guess_tests[] = /* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c, }, }, + { + .name = "X-Box One S via xpadneo 0.9.x", + /* Reference: https://github.com/libsdl-org/SDL/issues/7823 */ + .eviocgname = "Xbox Wireless Controller", + .bus_type = 0x0005, + .vendor_id = 0x045e, + .product_id = 0x028e, + .version = 0x1130, + .expected = SDL_UDEV_DEVICE_JOYSTICK, + /* SYN, KEY, ABS, MSC, FF */ + .ev = { 0x1b }, + /* X, Y, Z, RX, RY, RZ, HAT0X, HAT0Y + * plus MISC as a deprecated axis reporting (rz - z) */ + .abs = { 0x3f, 0x00, 0x03, 0x00, 0x00, 0x01 }, + .keys = { + /* 0x00-0xff */ ZEROx8, ZEROx8, ZEROx8, ZEROx8, + /* A, B, X, Y, TL, TR, SELECT, START, MODE, THUMBL, THUMBR */ + /* 0x100 */ ZEROx4, 0x00, 0x00, 0xdb, 0x7c, + /* 0x140 */ ZEROx8, + /* 0x180 */ ZEROx8, + /* 0x1c0 */ ZEROx8, + /* 0x200 */ ZEROx8, + /* 0x240 */ ZEROx8, + /* 0x280 */ ZEROx8, + /* BTN_TRIGGER_HAPPY33 up to BTN_TRIGGER_HAPPY36 inclusive: + * used to represent the current profile */ + /* 0x2c0 */ ZEROx4, 0xf0, + }, + .hid_report_descriptor_length = sizeof (xpadneo09_xb1s_hid_report_descriptor), + .hid_report_descriptor = &xpadneo09_xb1s_hid_report_descriptor[0], + }, { .name = "DualSense (PS5) - gamepad", .bus_type = 0x0003, From cf267e49855c435743b25d649ea2dcbefe0d30db Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 21 Jun 2024 17:38:38 +0200 Subject: [PATCH 006/431] Fix -Wunused-variable warning in src/video/x11/SDL_x11events.c --- src/video/x11/SDL_x11events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 7530c309221b8..5f7bf97c35bd7 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -884,11 +884,13 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_ text[0] = '\0'; if (SDL_TextInputActive()) { +#if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX) /* Save the original keycode for dead keys, which are filtered out by the XFilterEvent() call below. */ int orig_event_type = xevent->type; KeyCode orig_keycode = xevent->xkey.keycode; +#endif /* filter events catches XIM events and sends them to the correct handler */ if (X11_XFilterEvent(xevent, None)) { From fa5367d3791fdccaa0fe95318d280a2f5a690f8f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 21 Jun 2024 12:06:53 -0700 Subject: [PATCH 007/431] Enable virtual joystick support for Emscripten --- include/build_config/SDL_build_config_emscripten.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/build_config/SDL_build_config_emscripten.h b/include/build_config/SDL_build_config_emscripten.h index a5b019e6eeccd..c994d2540a221 100644 --- a/include/build_config/SDL_build_config_emscripten.h +++ b/include/build_config/SDL_build_config_emscripten.h @@ -163,6 +163,7 @@ /* Enable various input drivers */ #define SDL_JOYSTICK_EMSCRIPTEN 1 +#define SDL_JOYSTICK_VIRTUAL 1 /* Enable various sensor drivers */ #define SDL_SENSOR_DUMMY 1 From 306c4164bc5e9c8976ad54c747885fbc645d9084 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Jun 2024 13:50:18 -0700 Subject: [PATCH 008/431] Added SDL_AllocateEventString() --- include/SDL3/SDL_events.h | 11 +++++------ src/events/SDL_dropevents.c | 10 +++++----- src/events/SDL_events.c | 8 ++++++++ src/events/SDL_events_c.h | 2 ++ src/events/SDL_keyboard.c | 12 ++---------- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 2cdcedae2ec57..d578cdd93fdf7 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -327,7 +327,7 @@ typedef struct SDL_TextEditingEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with keyboard focus, if any */ - char *text; /**< The editing text */ + const char *text; /**< The editing text */ Sint32 start; /**< The start cursor of selected editing text */ Sint32 length; /**< The length of selected editing text */ } SDL_TextEditingEvent; @@ -352,7 +352,7 @@ typedef struct SDL_TextInputEvent Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with keyboard focus, if any */ - char *text; /**< The input text, UTF-8 encoded */ + const char *text; /**< The input text, UTF-8 encoded */ } SDL_TextInputEvent; /** @@ -733,8 +733,7 @@ typedef struct SDL_PenButtonEvent * An event used to drop text or request a file open by the system * (event.drop.*) * - * The `data` is owned by SDL and should be copied if the application wants to - * hold onto it beyond the scope of handling this event. Do not free it! + * The `source` and `data` are owned by SDL and should be copied if the application wants to hold onto them beyond the scope of handling this event. * * \since This struct is available since SDL 3.0.0. */ @@ -746,8 +745,8 @@ typedef struct SDL_DropEvent SDL_WindowID windowID; /**< The window that was dropped on, if any */ float x; /**< X coordinate, relative to window (not on begin) */ float y; /**< Y coordinate, relative to window (not on begin) */ - char *source; /**< The source app that sent this drop event, or NULL if that isn't available */ - char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ + const char *source; /**< The source app that sent this drop event, or NULL if that isn't available */ + const char *data; /**< The text for SDL_EVENT_DROP_TEXT and the file name for SDL_EVENT_DROP_FILE, NULL for other events */ } SDL_DropEvent; /** diff --git a/src/events/SDL_dropevents.c b/src/events/SDL_dropevents.c index 610652c256187..3af2356745a27 100644 --- a/src/events/SDL_dropevents.c +++ b/src/events/SDL_dropevents.c @@ -59,16 +59,16 @@ static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const ch event.type = evtype; event.common.timestamp = 0; if (source) { - event.drop.source = SDL_strdup(source); + event.drop.source = SDL_AllocateEventString(source); + if (!event.drop.source) { + return 0; + } } if (data) { - size_t size = SDL_strlen(data) + 1; - event.drop.data = (char *)SDL_AllocateEventMemory(size); + event.drop.data = SDL_AllocateEventString(data); if (!event.drop.data) { - SDL_free(event.drop.source); return 0; } - SDL_memcpy(event.drop.data, data, size); } event.drop.windowID = window ? window->id : 0; diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 7dd7ff7521ca0..63f140d1345bb 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -135,6 +135,14 @@ void *SDL_AllocateEventMemory(size_t size) return SDL_FreeLater(SDL_malloc(size)); } +const char *SDL_AllocateEventString(const char *string) +{ + if (string) { + return SDL_FreeLater(SDL_strdup(string)); + } + return NULL; +} + static void SDL_FlushEventMemory(Uint32 eventID) { SDL_LockMutex(SDL_event_memory_lock); diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index 181583d71d07f..778af32cadbf0 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -40,6 +40,8 @@ extern int SDL_StartEventLoop(void); extern void SDL_StopEventLoop(void); extern void SDL_QuitInterrupt(void); +extern const char *SDL_AllocateEventString(const char *string); + extern int SDL_SendAppEvent(SDL_EventType eventType); extern int SDL_SendKeymapChangedEvent(void); extern int SDL_SendLocaleChangedEvent(void); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 16571952a2f7f..e59844b144917 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -1205,14 +1205,10 @@ int SDL_SendKeyboardText(const char *text) event.type = SDL_EVENT_TEXT_INPUT; event.common.timestamp = 0; event.text.windowID = keyboard->focus ? keyboard->focus->id : 0; - - size_t size = SDL_strlen(text) + 1; - event.text.text = (char *)SDL_AllocateEventMemory(size); + event.text.text = SDL_AllocateEventString(text); if (!event.text.text) { return 0; } - SDL_memcpy(event.text.text, text, size); - posted = (SDL_PushEvent(&event) > 0); } return posted; @@ -1241,14 +1237,10 @@ int SDL_SendEditingText(const char *text, int start, int length) event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; event.edit.start = start; event.edit.length = length; - - size_t size = SDL_strlen(text) + 1; - event.edit.text = (char *)SDL_AllocateEventMemory(size); + event.edit.text = SDL_AllocateEventString(text); if (!event.edit.text) { return 0; } - SDL_memcpy(event.edit.text, text, size); - posted = (SDL_PushEvent(&event) > 0); } return posted; From 00ab4a8eba0cba4706f602af012a0a7a8edb0e86 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Jun 2024 07:14:19 -0700 Subject: [PATCH 009/431] Added missing Windows scancodes Based on the scancode list at https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_code_values, which is correct for all other scancodes --- src/events/scancodes_windows.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/events/scancodes_windows.h b/src/events/scancodes_windows.h index 75635e6d76a42..60fc842f65658 100644 --- a/src/events/scancodes_windows.h +++ b/src/events/scancodes_windows.h @@ -164,7 +164,7 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe007*/ SDL_SCANCODE_UNKNOWN, /*0xe008*/ SDL_SCANCODE_UNKNOWN, /*0xe009*/ SDL_SCANCODE_UNKNOWN, - /*0xe00a*/ SDL_SCANCODE_UNKNOWN, + /*0xe00a*/ SDL_SCANCODE_PASTE, /*0xe00b*/ SDL_SCANCODE_UNKNOWN, /*0xe00c*/ SDL_SCANCODE_UNKNOWN, /*0xe00d*/ SDL_SCANCODE_UNKNOWN, @@ -177,8 +177,8 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe014*/ SDL_SCANCODE_UNKNOWN, /*0xe015*/ SDL_SCANCODE_UNKNOWN, /*0xe016*/ SDL_SCANCODE_UNKNOWN, - /*0xe017*/ SDL_SCANCODE_UNKNOWN, - /*0xe018*/ SDL_SCANCODE_UNKNOWN, + /*0xe017*/ SDL_SCANCODE_CUT, + /*0xe018*/ SDL_SCANCODE_COPY, /*0xe019*/ SDL_SCANCODE_AUDIONEXT, /*0xe01a*/ SDL_SCANCODE_UNKNOWN, /*0xe01b*/ SDL_SCANCODE_UNKNOWN, @@ -198,7 +198,7 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe029*/ SDL_SCANCODE_UNKNOWN, /*0xe02a*/ SDL_SCANCODE_UNKNOWN, /*0xe02b*/ SDL_SCANCODE_UNKNOWN, - /*0xe02c*/ SDL_SCANCODE_UNKNOWN, + /*0xe02c*/ SDL_SCANCODE_EJECT, /*0xe02d*/ SDL_SCANCODE_UNKNOWN, /*0xe02e*/ SDL_SCANCODE_VOLUMEDOWN, /*0xe02f*/ SDL_SCANCODE_UNKNOWN, @@ -213,7 +213,7 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe038*/ SDL_SCANCODE_RALT, /*0xe039*/ SDL_SCANCODE_UNKNOWN, /*0xe03a*/ SDL_SCANCODE_UNKNOWN, - /*0xe03b*/ SDL_SCANCODE_UNKNOWN, + /*0xe03b*/ SDL_SCANCODE_HELP, /*0xe03c*/ SDL_SCANCODE_UNKNOWN, /*0xe03d*/ SDL_SCANCODE_UNKNOWN, /*0xe03e*/ SDL_SCANCODE_UNKNOWN, From 9d816c72ef7309331819bbac98fc55b0cbb27037 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Jun 2024 07:22:39 -0700 Subject: [PATCH 010/431] Updated SDL3 scancode list This adds more app editing and audio control keys and removes keys that launch applications Work in progress on https://github.com/libsdl-org/SDL/issues/6390 --- build-scripts/SDL_migration.cocci | 72 ++++++++++++ docs/README-migration.md | 49 +++++++++ include/SDL3/SDL_keycode.h | 44 ++++---- include/SDL3/SDL_oldnames.h | 40 +++++++ include/SDL3/SDL_scancode.h | 83 ++++++-------- src/events/SDL_keyboard.c | 116 ++++++++++---------- src/events/scancodes_linux.h | 66 +++++------ src/events/scancodes_windows.h | 18 +-- src/events/scancodes_xfree86.h | 58 +++++----- src/video/android/SDL_androidkeyboard.c | 36 +++--- src/video/emscripten/SDL_emscriptenevents.c | 64 +++++++---- test/testautomation_keyboard.c | 8 +- 12 files changed, 412 insertions(+), 242 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index e1629916db979..328b359e07b7d 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3312,3 +3312,75 @@ typedef SDL_Colour, SDL_Color; - SDL_SwapBE64 + SDL_Swap64BE (...) +@@ +@@ +- SDL_SCANCODE_AUDIOMUTE ++ SDL_SCANCODE_MUTE +@@ +@@ +- SDLK_AUDIOMUTE ++ SDLK_MUTE +@@ +@@ +- SDL_SCANCODE_EJECT ++ SDL_SCANCODE_MEDIA_EJECT +@@ +@@ +- SDLK_EJECT ++ SDLK_MEDIA_EJECT +@@ +@@ +- SDL_SCANCODE_AUDIONEXT ++ SDL_SCANCODE_MEDIA_NEXT_TRACK +@@ +@@ +- SDLK_AUDIONEXT ++ SDLK_MEDIA_NEXT_TRACK +@@ +@@ +- SDL_SCANCODE_AUDIOPREV ++ SDL_SCANCODE_MEDIA_PREVIOUS_TRACK +@@ +@@ +- SDLK_AUDIOPREV ++ SDLK_MEDIA_PREVIOUS_TRACK +@@ +@@ +- SDL_SCANCODE_AUDIOSTOP ++ SDL_SCANCODE_MEDIA_STOP +@@ +@@ +- SDLK_AUDIOSTOP ++ SDLK_MEDIA_STOP +@@ +@@ +- SDL_SCANCODE_AUDIOPLAY ++ SDL_SCANCODE_MEDIA_PLAY +@@ +@@ +- SDLK_AUDIOPLAY ++ SDLK_MEDIA_PLAY +@@ +@@ +- SDL_SCANCODE_AUDIOREWIND ++ SDL_SCANCODE_MEDIA_REWIND +@@ +@@ +- SDLK_AUDIOREWIND ++ SDLK_MEDIA_REWIND +@@ +@@ +- SDL_SCANCODE_AUDIOFASTFORWARD ++ SDL_SCANCODE_MEDIA_FAST_FORWARD +@@ +@@ +- SDLK_AUDIOFASTFORWARD ++ SDLK_MEDIA_FAST_FORWARD +@@ +@@ +- SDL_SCANCODE_MEDIASELECT ++ SDL_SCANCODE_MEDIA_SELECT +@@ +@@ +- SDLK_MEDIASELECT ++ SDLK_MEDIA_SELECT diff --git a/docs/README-migration.md b/docs/README-migration.md index 90d1d040c3cd2..a2ca542d15f4a 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -904,6 +904,19 @@ SDL_Keycode is now Uint32 and the SDLK_* constants are now defines instead of an The following symbols have been removed: * KMOD_RESERVED - No replacement. A bit named "RESERVED" probably shouldn't be used in an app, but if you need it, this was equivalent to KMOD_SCROLL (0x8000) in SDL2. +* SDLK_WWW +* SDLK_MAIL +* SDLK_CALCULATOR +* SDLK_COMPUTER +* SDLK_BRIGHTNESSDOWN +* SDLK_BRIGHTNESSUP +* SDLK_DISPLAYSWITCH +* SDLK_KBDILLUMTOGGLE +* SDLK_KBDILLUMDOWN +* SDLK_KBDILLUMUP +* SDLK_APP1 +* SDLK_APP2 + The following symbols have been renamed: * KMOD_ALT => SDL_KMOD_ALT @@ -923,7 +936,16 @@ The following symbols have been renamed: * KMOD_RSHIFT => SDL_KMOD_RSHIFT * KMOD_SCROLL => SDL_KMOD_SCROLL * KMOD_SHIFT => SDL_KMOD_SHIFT +* SDLK_AUDIOFASTFORWARD => SDLK_MEDIA_FAST_FORWARD +* SDLK_AUDIOMUTE => SDLK_MUTE +* SDLK_AUDIONEXT => SDLK_MEDIA_NEXT_TRACK +* SDLK_AUDIOPLAY => SDLK_MEDIA_PLAY +* SDLK_AUDIOPREV => SDLK_MEDIA_PREVIOUS_TRACK +* SDLK_AUDIOREWIND => SDLK_MEDIA_REWIND +* SDLK_AUDIOSTOP => SDLK_MEDIA_STOP * SDLK_BACKQUOTE => SDLK_GRAVE +* SDLK_EJECT => SDLK_MEDIA_EJECT +* SDLK_MEDIASELECT => SDLK_MEDIA_SELECT * SDLK_QUOTE => SDLK_APOSTROPHE * SDLK_QUOTEDBL => SDLK_DBLAPOSTROPHE @@ -1415,6 +1437,33 @@ The following functions have been renamed: The following structures have been renamed: * SDL_RWops => SDL_IOStream +## SDL_scancode.h + +The following symbols have been removed: +* SDL_SCANCODE_WWW +* SDL_SCANCODE_MAIL +* SDL_SCANCODE_CALCULATOR +* SDL_SCANCODE_COMPUTER +* SDL_SCANCODE_BRIGHTNESSDOWN +* SDL_SCANCODE_BRIGHTNESSUP +* SDL_SCANCODE_DISPLAYSWITCH +* SDL_SCANCODE_KBDILLUMTOGGLE +* SDL_SCANCODE_KBDILLUMDOWN +* SDL_SCANCODE_KBDILLUMUP +* SDL_SCANCODE_APP1 +* SDL_SCANCODE_APP2 + +The following symbols have been renamed: +* SDL_SCANCODE_AUDIOFASTFORWARD => SDL_SCANCODE_MEDIA_FAST_FORWARD +* SDL_SCANCODE_AUDIOMUTE => SDL_SCANCODE_MUTE +* SDL_SCANCODE_AUDIONEXT => SDL_SCANCODE_MEDIA_NEXT_TRACK +* SDL_SCANCODE_AUDIOPLAY => SDL_SCANCODE_MEDIA_PLAY +* SDL_SCANCODE_AUDIOPREV => SDL_SCANCODE_MEDIA_PREVIOUS_TRACK +* SDL_SCANCODE_AUDIOREWIND => SDL_SCANCODE_MEDIA_REWIND +* SDL_SCANCODE_AUDIOSTOP => SDL_SCANCODE_MEDIA_STOP +* SDL_SCANCODE_EJECT => SDL_SCANCODE_MEDIA_EJECT +* SDL_SCANCODE_MEDIASELECT => SDL_SCANCODE_MEDIA_SELECT + ## SDL_sensor.h SDL_SensorID has changed from Sint32 to Uint32, with an invalid ID being 0. diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index 6ceb4cff99359..26c03da20c8d5 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -261,16 +261,28 @@ typedef Uint32 SDL_Keycode; #define SDLK_RALT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT) #define SDLK_RGUI SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI) #define SDLK_MODE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE) -#define SDLK_AUDIONEXT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIONEXT) -#define SDLK_AUDIOPREV SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPREV) -#define SDLK_AUDIOSTOP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOSTOP) -#define SDLK_AUDIOPLAY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOPLAY) -#define SDLK_AUDIOMUTE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOMUTE) -#define SDLK_MEDIASELECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIASELECT) -#define SDLK_WWW SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WWW) -#define SDLK_MAIL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MAIL) -#define SDLK_CALCULATOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALCULATOR) -#define SDLK_COMPUTER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COMPUTER) +#define SDLK_SLEEP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) +#define SDLK_WAKE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WAKE) +#define SDLK_CHANNEL_INCREMENT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_INCREMENT) +#define SDLK_CHANNEL_DECREMENT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_DECREMENT) +#define SDLK_MEDIA_PLAY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY) +#define SDLK_MEDIA_PAUSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PAUSE) +#define SDLK_MEDIA_RECORD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_RECORD) +#define SDLK_MEDIA_FAST_FORWARD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_FAST_FORWARD) +#define SDLK_MEDIA_REWIND SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_REWIND) +#define SDLK_MEDIA_NEXT_TRACK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_NEXT_TRACK) +#define SDLK_MEDIA_PREVIOUS_TRACK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PREVIOUS_TRACK) +#define SDLK_MEDIA_STOP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_STOP) +#define SDLK_MEDIA_EJECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_EJECT) +#define SDLK_MEDIA_PLAY_PAUSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY_PAUSE) +#define SDLK_MEDIA_SELECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_SELECT) +#define SDLK_AC_NEW SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_NEW) +#define SDLK_AC_OPEN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_OPEN) +#define SDLK_AC_CLOSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_CLOSE) +#define SDLK_AC_EXIT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_EXIT) +#define SDLK_AC_SAVE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SAVE) +#define SDLK_AC_PRINT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PRINT) +#define SDLK_AC_PROPERTIES SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PROPERTIES) #define SDLK_AC_SEARCH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH) #define SDLK_AC_HOME SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME) #define SDLK_AC_BACK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK) @@ -278,18 +290,6 @@ typedef Uint32 SDL_Keycode; #define SDLK_AC_STOP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP) #define SDLK_AC_REFRESH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH) #define SDLK_AC_BOOKMARKS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS) -#define SDLK_BRIGHTNESSDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSDOWN) -#define SDLK_BRIGHTNESSUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_BRIGHTNESSUP) -#define SDLK_DISPLAYSWITCH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DISPLAYSWITCH) -#define SDLK_KBDILLUMTOGGLE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMTOGGLE) -#define SDLK_KBDILLUMDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMDOWN) -#define SDLK_KBDILLUMUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KBDILLUMUP) -#define SDLK_EJECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EJECT) -#define SDLK_SLEEP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) -#define SDLK_APP1 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP1) -#define SDLK_APP2 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APP2) -#define SDLK_AUDIOREWIND SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOREWIND) -#define SDLK_AUDIOFASTFORWARD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AUDIOFASTFORWARD) #define SDLK_SOFTLEFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT) #define SDLK_SOFTRIGHT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) #define SDLK_CALL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index cfa4ef1d89402..68c8f4a58e090 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -366,7 +366,16 @@ #define KMOD_RSHIFT SDL_KMOD_RSHIFT #define KMOD_SCROLL SDL_KMOD_SCROLL #define KMOD_SHIFT SDL_KMOD_SHIFT +#define SDLK_AUDIOFASTFORWARD SDLK_MEDIA_FAST_FORWARD +#define SDLK_AUDIOMUTE SDLK_MUTE +#define SDLK_AUDIONEXT SDLK_MEDIA_NEXT_TRACK +#define SDLK_AUDIOPLAY SDLK_MEDIA_PLAY +#define SDLK_AUDIOPREV SDLK_MEDIA_PREVIOUS_TRACK +#define SDLK_AUDIOREWIND SDLK_MEDIA_REWIND +#define SDLK_AUDIOSTOP SDLK_MEDIA_STOP #define SDLK_BACKQUOTE SDLK_GRAVE +#define SDLK_EJECT SDLK_MEDIA_EJECT +#define SDLK_MEDIASELECT SDLK_MEDIA_SELECT #define SDLK_QUOTE SDLK_APOSTROPHE #define SDLK_QUOTEDBL SDLK_DBLAPOSTROPHE @@ -517,6 +526,17 @@ #define SDL_WriteLE32 SDL_WriteU32LE #define SDL_WriteLE64 SDL_WriteU64LE +/* ##SDL_scancode.h */ +#define SDL_SCANCODE_AUDIOFASTFORWARD SDL_SCANCODE_MEDIA_FAST_FORWARD +#define SDL_SCANCODE_AUDIOMUTE SDL_SCANCODE_MUTE +#define SDL_SCANCODE_AUDIONEXT SDL_SCANCODE_MEDIA_NEXT_TRACK +#define SDL_SCANCODE_AUDIOPLAY SDL_SCANCODE_MEDIA_PLAY +#define SDL_SCANCODE_AUDIOPREV SDL_SCANCODE_MEDIA_PREVIOUS_TRACK +#define SDL_SCANCODE_AUDIOREWIND SDL_SCANCODE_MEDIA_REWIND +#define SDL_SCANCODE_AUDIOSTOP SDL_SCANCODE_MEDIA_STOP +#define SDL_SCANCODE_EJECT SDL_SCANCODE_MEDIA_EJECT +#define SDL_SCANCODE_MEDIASELECT SDL_SCANCODE_MEDIA_SELECT + /* ##SDL_sensor.h */ #define SDL_SensorClose SDL_CloseSensor #define SDL_SensorFromInstanceID SDL_GetSensorFromInstanceID @@ -915,7 +935,16 @@ #define KMOD_RSHIFT KMOD_RSHIFT_renamed_SDL_KMOD_RSHIFT #define KMOD_SCROLL KMOD_SCROLL_renamed_SDL_KMOD_SCROLL #define KMOD_SHIFT KMOD_SHIFT_renamed_SDL_KMOD_SHIFT +#define SDLK_AUDIOFASTFORWARD SDLK_AUDIOFASTFORWARD_renamed_SDLK_MEDIA_FAST_FORWARD +#define SDLK_AUDIOMUTE SDLK_AUDIOMUTE_renamed_SDLK_MUTE +#define SDLK_AUDIONEXT SDLK_AUDIONEXT_renamed_SDLK_MEDIA_NEXT_TRACK +#define SDLK_AUDIOPLAY SDLK_AUDIOPLAY_renamed_SDLK_MEDIA_PLAY +#define SDLK_AUDIOPREV SDLK_AUDIOPREV_renamed_SDLK_MEDIA_PREVIOUS_TRACK +#define SDLK_AUDIOREWIND SDLK_AUDIOREWIND_renamed_SDLK_MEDIA_REWIND +#define SDLK_AUDIOSTOP SDLK_AUDIOSTOP_renamed_SDLK_MEDIA_STOP #define SDLK_BACKQUOTE SDLK_BACKQUOTE_renamed_SDLK_GRAVE +#define SDLK_EJECT SDLK_EJECT_renamed_SDLK_MEDIA_EJECT +#define SDLK_MEDIASELECT SDLK_MEDIASELECT_renamed_SDLK_MEDIA_SELECT #define SDLK_QUOTE SDLK_QUOTE_renamed_SDLK_APOSTROPHE #define SDLK_QUOTEDBL SDLK_QUOTEDBL_renamed_SDLK_DBLAPOSTROPHE @@ -1066,6 +1095,17 @@ #define SDL_WriteLE32 SDL_WriteLE32_renamed_SDL_WriteU32LE #define SDL_WriteLE64 SDL_WriteLE64_renamed_SDL_WriteU64LE +/* ##SDL_scancode.h */ +#define SDL_SCANCODE_AUDIOFASTFORWARD SDL_SCANCODE_AUDIOFASTFORWARD_renamed_SDL_SCANCODE_MEDIA_FAST_FORWARD +#define SDL_SCANCODE_AUDIOMUTE SDL_SCANCODE_AUDIOMUTE_renamed_SDL_SCANCODE_MUTE +#define SDL_SCANCODE_AUDIONEXT SDL_SCANCODE_AUDIONEXT_renamed_SDL_SCANCODE_MEDIA_NEXT_TRACK +#define SDL_SCANCODE_AUDIOPLAY SDL_SCANCODE_AUDIOPLAY_renamed_SDL_SCANCODE_MEDIA_PLAY +#define SDL_SCANCODE_AUDIOPREV SDL_SCANCODE_AUDIOPREV_renamed_SDL_SCANCODE_MEDIA_PREVIOUS_TRACK +#define SDL_SCANCODE_AUDIOREWIND SDL_SCANCODE_AUDIOREWIND_renamed_SDL_SCANCODE_MEDIA_REWIND +#define SDL_SCANCODE_AUDIOSTOP SDL_SCANCODE_AUDIOSTOP_renamed_SDL_SCANCODE_MEDIA_STOP +#define SDL_SCANCODE_EJECT SDL_SCANCODE_EJECT_renamed_SDL_SCANCODE_MEDIA_EJECT +#define SDL_SCANCODE_MEDIASELECT SDL_SCANCODE_MEDIASELECT_renamed_SDL_SCANCODE_MEDIA_SELECT + /* ##SDL_sensor.h */ #define SDL_SensorClose SDL_SensorClose_renamed_SDL_CloseSensor #define SDL_SensorFromInstanceID SDL_SensorFromInstanceID_renamed_SDL_GetSensorFromInstanceID diff --git a/include/SDL3/SDL_scancode.h b/include/SDL3/SDL_scancode.h index 1adeff5f2297e..95317332e8179 100644 --- a/include/SDL3/SDL_scancode.h +++ b/include/SDL3/SDL_scancode.h @@ -356,59 +356,42 @@ typedef enum SDL_Scancode */ /* @{ */ - SDL_SCANCODE_AUDIONEXT = 258, - SDL_SCANCODE_AUDIOPREV = 259, - SDL_SCANCODE_AUDIOSTOP = 260, - SDL_SCANCODE_AUDIOPLAY = 261, - SDL_SCANCODE_AUDIOMUTE = 262, - SDL_SCANCODE_MEDIASELECT = 263, - SDL_SCANCODE_WWW = 264, /**< AL Internet Browser */ - SDL_SCANCODE_MAIL = 265, - SDL_SCANCODE_CALCULATOR = 266, /**< AL Calculator */ - SDL_SCANCODE_COMPUTER = 267, - SDL_SCANCODE_AC_SEARCH = 268, /**< AC Search */ - SDL_SCANCODE_AC_HOME = 269, /**< AC Home */ - SDL_SCANCODE_AC_BACK = 270, /**< AC Back */ - SDL_SCANCODE_AC_FORWARD = 271, /**< AC Forward */ - SDL_SCANCODE_AC_STOP = 272, /**< AC Stop */ - SDL_SCANCODE_AC_REFRESH = 273, /**< AC Refresh */ - SDL_SCANCODE_AC_BOOKMARKS = 274, /**< AC Bookmarks */ + SDL_SCANCODE_SLEEP = 258, /**< Sleep */ + SDL_SCANCODE_WAKE = 259, /**< Wake */ + + SDL_SCANCODE_CHANNEL_INCREMENT = 260, /**< Channel Increment */ + SDL_SCANCODE_CHANNEL_DECREMENT = 261, /**< Channel Decrement */ + + SDL_SCANCODE_MEDIA_PLAY = 262, /**< Play */ + SDL_SCANCODE_MEDIA_PAUSE = 263, /**< Pause */ + SDL_SCANCODE_MEDIA_RECORD = 264, /**< Record */ + SDL_SCANCODE_MEDIA_FAST_FORWARD = 265, /**< Fast Forward */ + SDL_SCANCODE_MEDIA_REWIND = 266, /**< Rewind */ + SDL_SCANCODE_MEDIA_NEXT_TRACK = 267, /**< Next Track */ + SDL_SCANCODE_MEDIA_PREVIOUS_TRACK = 268, /**< Previous Track */ + SDL_SCANCODE_MEDIA_STOP = 269, /**< Stop */ + SDL_SCANCODE_MEDIA_EJECT = 270, /**< Eject */ + SDL_SCANCODE_MEDIA_PLAY_PAUSE = 271, /**< Play / Pause */ + SDL_SCANCODE_MEDIA_SELECT = 272, /* Media Select */ + + SDL_SCANCODE_AC_NEW = 273, /**< AC New */ + SDL_SCANCODE_AC_OPEN = 274, /**< AC Open */ + SDL_SCANCODE_AC_CLOSE = 275, /**< AC Close */ + SDL_SCANCODE_AC_EXIT = 276, /**< AC Exit */ + SDL_SCANCODE_AC_SAVE = 277, /**< AC Save */ + SDL_SCANCODE_AC_PRINT = 278, /**< AC Print */ + SDL_SCANCODE_AC_PROPERTIES = 279, /**< AC Properties */ + + SDL_SCANCODE_AC_SEARCH = 280, /**< AC Search */ + SDL_SCANCODE_AC_HOME = 281, /**< AC Home */ + SDL_SCANCODE_AC_BACK = 282, /**< AC Back */ + SDL_SCANCODE_AC_FORWARD = 283, /**< AC Forward */ + SDL_SCANCODE_AC_STOP = 284, /**< AC Stop */ + SDL_SCANCODE_AC_REFRESH = 285, /**< AC Refresh */ + SDL_SCANCODE_AC_BOOKMARKS = 286, /**< AC Bookmarks */ /* @} *//* Usage page 0x0C */ - /** - * \name Walther keys - * - * These are values that Christian Walther added (for mac keyboard?). - */ - /* @{ */ - - SDL_SCANCODE_BRIGHTNESSDOWN = 275, - SDL_SCANCODE_BRIGHTNESSUP = 276, - SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display - switch, video mode switch */ - SDL_SCANCODE_KBDILLUMTOGGLE = 278, - SDL_SCANCODE_KBDILLUMDOWN = 279, - SDL_SCANCODE_KBDILLUMUP = 280, - SDL_SCANCODE_EJECT = 281, - SDL_SCANCODE_SLEEP = 282, /**< SC System Sleep */ - - SDL_SCANCODE_APP1 = 283, - SDL_SCANCODE_APP2 = 284, - - /* @} *//* Walther keys */ - - /** - * \name Usage page 0x0C (additional media keys) - * - * These values are mapped from usage page 0x0C (USB consumer page). - */ - /* @{ */ - - SDL_SCANCODE_AUDIOREWIND = 285, - SDL_SCANCODE_AUDIOFASTFORWARD = 286, - - /* @} *//* Usage page 0x0C (additional media keys) */ /** * \name Mobile keys diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index e59844b144917..c96058710d306 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -321,35 +321,35 @@ static const SDL_Keycode SDL_default_keymap[SDL_NUM_SCANCODES] = { /* 255 */ SDLK_UNKNOWN, /* 256 */ SDLK_UNKNOWN, /* 257 */ SDLK_MODE, - /* 258 */ SDLK_AUDIONEXT, - /* 259 */ SDLK_AUDIOPREV, - /* 260 */ SDLK_AUDIOSTOP, - /* 261 */ SDLK_AUDIOPLAY, - /* 262 */ SDLK_AUDIOMUTE, - /* 263 */ SDLK_MEDIASELECT, - /* 264 */ SDLK_WWW, - /* 265 */ SDLK_MAIL, - /* 266 */ SDLK_CALCULATOR, - /* 267 */ SDLK_COMPUTER, - /* 268 */ SDLK_AC_SEARCH, - /* 269 */ SDLK_AC_HOME, - /* 270 */ SDLK_AC_BACK, - /* 271 */ SDLK_AC_FORWARD, - /* 272 */ SDLK_AC_STOP, - /* 273 */ SDLK_AC_REFRESH, - /* 274 */ SDLK_AC_BOOKMARKS, - /* 275 */ SDLK_BRIGHTNESSDOWN, - /* 276 */ SDLK_BRIGHTNESSUP, - /* 277 */ SDLK_DISPLAYSWITCH, - /* 278 */ SDLK_KBDILLUMTOGGLE, - /* 279 */ SDLK_KBDILLUMDOWN, - /* 280 */ SDLK_KBDILLUMUP, - /* 281 */ SDLK_EJECT, - /* 282 */ SDLK_SLEEP, - /* 283 */ SDLK_APP1, - /* 284 */ SDLK_APP2, - /* 285 */ SDLK_AUDIOREWIND, - /* 286 */ SDLK_AUDIOFASTFORWARD, + /* 258 */ SDLK_SLEEP, + /* 258 */ SDLK_WAKE, + /* 260 */ SDLK_CHANNEL_INCREMENT, + /* 261 */ SDLK_CHANNEL_DECREMENT, + /* 262 */ SDLK_MEDIA_PLAY, + /* 263 */ SDLK_MEDIA_PAUSE, + /* 264 */ SDLK_MEDIA_RECORD, + /* 265 */ SDLK_MEDIA_FAST_FORWARD, + /* 266 */ SDLK_MEDIA_REWIND, + /* 267 */ SDLK_MEDIA_NEXT_TRACK, + /* 268 */ SDLK_MEDIA_PREVIOUS_TRACK, + /* 269 */ SDLK_MEDIA_STOP, + /* 270 */ SDLK_MEDIA_EJECT, + /* 271 */ SDLK_MEDIA_PLAY_PAUSE, + /* 272 */ SDLK_MEDIA_SELECT, + /* 273 */ SDLK_AC_NEW, + /* 274 */ SDLK_AC_OPEN, + /* 275 */ SDLK_AC_CLOSE, + /* 276 */ SDLK_AC_EXIT, + /* 277 */ SDLK_AC_SAVE, + /* 278 */ SDLK_AC_PRINT, + /* 279 */ SDLK_AC_PROPERTIES, + /* 280 */ SDLK_AC_SEARCH, + /* 281 */ SDLK_AC_HOME, + /* 282 */ SDLK_AC_BACK, + /* 283 */ SDLK_AC_FORWARD, + /* 284 */ SDLK_AC_STOP, + /* 285 */ SDLK_AC_REFRESH, + /* 286 */ SDLK_AC_BOOKMARKS, /* 287 */ SDLK_SOFTLEFT, /* 288 */ SDLK_SOFTRIGHT, /* 289 */ SDLK_CALL, @@ -615,35 +615,35 @@ static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = { /* 255 */ NULL, /* 256 */ NULL, /* 257 */ "ModeSwitch", - /* 258 */ "AudioNext", - /* 259 */ "AudioPrev", - /* 260 */ "AudioStop", - /* 261 */ "AudioPlay", - /* 262 */ "AudioMute", - /* 263 */ "MediaSelect", - /* 264 */ "WWW", - /* 265 */ "Mail", - /* 266 */ "Calculator", - /* 267 */ "Computer", - /* 268 */ "AC Search", - /* 269 */ "AC Home", - /* 270 */ "AC Back", - /* 271 */ "AC Forward", - /* 272 */ "AC Stop", - /* 273 */ "AC Refresh", - /* 274 */ "AC Bookmarks", - /* 275 */ "BrightnessDown", - /* 276 */ "BrightnessUp", - /* 277 */ "DisplaySwitch", - /* 278 */ "KBDIllumToggle", - /* 279 */ "KBDIllumDown", - /* 280 */ "KBDIllumUp", - /* 281 */ "Eject", - /* 282 */ "Sleep", - /* 283 */ "App1", - /* 284 */ "App2", - /* 285 */ "AudioRewind", - /* 286 */ "AudioFastForward", + /* 258 */ "Sleep", + /* 259 */ "Wake", + /* 260 */ "ChannelUp", + /* 261 */ "ChannelDown", + /* 262 */ "MediaPlay", + /* 263 */ "MediaPause", + /* 264 */ "MediaRecord", + /* 265 */ "MediaFastForward", + /* 266 */ "MediaRewind", + /* 267 */ "MediaTrackNext", + /* 268 */ "MediaTrackPrevious", + /* 269 */ "MediaStop", + /* 270 */ "Eject", + /* 271 */ "MediaPlayPause", + /* 272 */ "MediaSelect", + /* 273 */ "AC New", + /* 274 */ "AC Open", + /* 275 */ "AC Close", + /* 276 */ "AC Exit", + /* 277 */ "AC Save", + /* 278 */ "AC Print", + /* 279 */ "AC Properties", + /* 280 */ "AC Search", + /* 281 */ "AC Home", + /* 282 */ "AC Back", + /* 283 */ "AC Forward", + /* 284 */ "AC Stop", + /* 285 */ "AC Refresh", + /* 286 */ "AC Bookmarks", /* 287 */ "SoftLeft", /* 288 */ "SoftRight", /* 289 */ "Call", diff --git a/src/events/scancodes_linux.h b/src/events/scancodes_linux.h index a9869a8d009b1..9c8e2063ade90 100644 --- a/src/events/scancodes_linux.h +++ b/src/events/scancodes_linux.h @@ -156,17 +156,17 @@ static SDL_Scancode const linux_scancode_table[] = { /* 127, 0x07f */ SDL_SCANCODE_APPLICATION, /* KEY_COMPOSE */ /* 128, 0x080 */ SDL_SCANCODE_STOP, /* KEY_STOP */ /* 129, 0x081 */ SDL_SCANCODE_AGAIN, /* KEY_AGAIN */ - /* 130, 0x082 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROPS */ + /* 130, 0x082 */ SDL_SCANCODE_AC_PROPERTIES, /* KEY_PROPS */ /* 131, 0x083 */ SDL_SCANCODE_UNDO, /* KEY_UNDO */ /* 132, 0x084 */ SDL_SCANCODE_UNKNOWN, /* KEY_FRONT */ /* 133, 0x085 */ SDL_SCANCODE_COPY, /* KEY_COPY */ - /* 134, 0x086 */ SDL_SCANCODE_UNKNOWN, /* KEY_OPEN */ + /* 134, 0x086 */ SDL_SCANCODE_AC_OPEN, /* KEY_OPEN */ /* 135, 0x087 */ SDL_SCANCODE_PASTE, /* KEY_PASTE */ /* 136, 0x088 */ SDL_SCANCODE_FIND, /* KEY_FIND */ /* 137, 0x089 */ SDL_SCANCODE_CUT, /* KEY_CUT */ /* 138, 0x08a */ SDL_SCANCODE_HELP, /* KEY_HELP */ /* 139, 0x08b */ SDL_SCANCODE_MENU, /* KEY_MENU */ - /* 140, 0x08c */ SDL_SCANCODE_CALCULATOR, /* KEY_CALC */ + /* 140, 0x08c */ SDL_SCANCODE_UNKNOWN, /* KEY_CALC */ /* 141, 0x08d */ SDL_SCANCODE_UNKNOWN, /* KEY_SETUP */ /* 142, 0x08e */ SDL_SCANCODE_SLEEP, /* KEY_SLEEP */ /* 143, 0x08f */ SDL_SCANCODE_UNKNOWN, /* KEY_WAKEUP */ @@ -174,40 +174,40 @@ static SDL_Scancode const linux_scancode_table[] = { /* 145, 0x091 */ SDL_SCANCODE_UNKNOWN, /* KEY_SENDFILE */ /* 146, 0x092 */ SDL_SCANCODE_UNKNOWN, /* KEY_DELETEFILE */ /* 147, 0x093 */ SDL_SCANCODE_UNKNOWN, /* KEY_XFER */ - /* 148, 0x094 */ SDL_SCANCODE_APP1, /* KEY_PROG1 */ - /* 149, 0x095 */ SDL_SCANCODE_APP2, /* KEY_PROG2 */ - /* 150, 0x096 */ SDL_SCANCODE_WWW, /* KEY_WWW */ + /* 148, 0x094 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG1 */ + /* 149, 0x095 */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG2 */ + /* 150, 0x096 */ SDL_SCANCODE_UNKNOWN, /* KEY_WWW */ /* 151, 0x097 */ SDL_SCANCODE_UNKNOWN, /* KEY_MSDOS */ /* 152, 0x098 */ SDL_SCANCODE_UNKNOWN, /* KEY_COFFEE */ /* 153, 0x099 */ SDL_SCANCODE_UNKNOWN, /* KEY_ROTATE_DISPLAY */ /* 154, 0x09a */ SDL_SCANCODE_UNKNOWN, /* KEY_CYCLEWINDOWS */ - /* 155, 0x09b */ SDL_SCANCODE_MAIL, /* KEY_MAIL */ + /* 155, 0x09b */ SDL_SCANCODE_UNKNOWN, /* KEY_MAIL */ /* 156, 0x09c */ SDL_SCANCODE_AC_BOOKMARKS, /* KEY_BOOKMARKS */ - /* 157, 0x09d */ SDL_SCANCODE_COMPUTER, /* KEY_COMPUTER */ + /* 157, 0x09d */ SDL_SCANCODE_UNKNOWN, /* KEY_COMPUTER */ /* 158, 0x09e */ SDL_SCANCODE_AC_BACK, /* KEY_BACK */ /* 159, 0x09f */ SDL_SCANCODE_AC_FORWARD, /* KEY_FORWARD */ /* 160, 0x0a0 */ SDL_SCANCODE_UNKNOWN, /* KEY_CLOSECD */ - /* 161, 0x0a1 */ SDL_SCANCODE_EJECT, /* KEY_EJECTCD */ - /* 162, 0x0a2 */ SDL_SCANCODE_EJECT, /* KEY_EJECTCLOSECD */ - /* 163, 0x0a3 */ SDL_SCANCODE_AUDIONEXT, /* KEY_NEXTSONG */ - /* 164, 0x0a4 */ SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYPAUSE */ - /* 165, 0x0a5 */ SDL_SCANCODE_AUDIOPREV, /* KEY_PREVIOUSSONG */ - /* 166, 0x0a6 */ SDL_SCANCODE_AUDIOSTOP, /* KEY_STOPCD */ - /* 167, 0x0a7 */ SDL_SCANCODE_UNKNOWN, /* KEY_RECORD */ - /* 168, 0x0a8 */ SDL_SCANCODE_AUDIOREWIND, /* KEY_REWIND */ + /* 161, 0x0a1 */ SDL_SCANCODE_MEDIA_EJECT, /* KEY_EJECTCD */ + /* 162, 0x0a2 */ SDL_SCANCODE_MEDIA_EJECT, /* KEY_EJECTCLOSECD */ + /* 163, 0x0a3 */ SDL_SCANCODE_MEDIA_NEXT_TRACK, /* KEY_NEXTSONG */ + /* 164, 0x0a4 */ SDL_SCANCODE_MEDIA_PLAY_PAUSE, /* KEY_PLAYPAUSE */ + /* 165, 0x0a5 */ SDL_SCANCODE_MEDIA_PREVIOUS_TRACK, /* KEY_PREVIOUSSONG */ + /* 166, 0x0a6 */ SDL_SCANCODE_MEDIA_STOP, /* KEY_STOPCD */ + /* 167, 0x0a7 */ SDL_SCANCODE_MEDIA_RECORD, /* KEY_RECORD */ + /* 168, 0x0a8 */ SDL_SCANCODE_MEDIA_REWIND, /* KEY_REWIND */ /* 169, 0x0a9 */ SDL_SCANCODE_UNKNOWN, /* KEY_PHONE */ /* 170, 0x0aa */ SDL_SCANCODE_UNKNOWN, /* KEY_ISO */ /* 171, 0x0ab */ SDL_SCANCODE_UNKNOWN, /* KEY_CONFIG */ /* 172, 0x0ac */ SDL_SCANCODE_AC_HOME, /* KEY_HOMEPAGE */ /* 173, 0x0ad */ SDL_SCANCODE_AC_REFRESH, /* KEY_REFRESH */ - /* 174, 0x0ae */ SDL_SCANCODE_UNKNOWN, /* KEY_EXIT */ + /* 174, 0x0ae */ SDL_SCANCODE_AC_EXIT, /* KEY_EXIT */ /* 175, 0x0af */ SDL_SCANCODE_UNKNOWN, /* KEY_MOVE */ /* 176, 0x0b0 */ SDL_SCANCODE_UNKNOWN, /* KEY_EDIT */ /* 177, 0x0b1 */ SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLUP */ /* 178, 0x0b2 */ SDL_SCANCODE_UNKNOWN, /* KEY_SCROLLDOWN */ /* 179, 0x0b3 */ SDL_SCANCODE_KP_LEFTPAREN, /* KEY_KPLEFTPAREN */ /* 180, 0x0b4 */ SDL_SCANCODE_KP_RIGHTPAREN, /* KEY_KPRIGHTPAREN */ - /* 181, 0x0b5 */ SDL_SCANCODE_UNKNOWN, /* KEY_NEW */ + /* 181, 0x0b5 */ SDL_SCANCODE_AC_NEW, /* KEY_NEW */ /* 182, 0x0b6 */ SDL_SCANCODE_AGAIN, /* KEY_REDO */ /* 183, 0x0b7 */ SDL_SCANCODE_F13, /* KEY_F13 */ /* 184, 0x0b8 */ SDL_SCANCODE_F14, /* KEY_F14 */ @@ -226,22 +226,22 @@ static SDL_Scancode const linux_scancode_table[] = { /* 197, 0x0c5 */ SDL_SCANCODE_UNKNOWN, /* 198, 0x0c6 */ SDL_SCANCODE_UNKNOWN, /* 199, 0x0c7 */ SDL_SCANCODE_UNKNOWN, - /* 200, 0x0c8 */ SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAYCD */ - /* 201, 0x0c9 */ SDL_SCANCODE_UNKNOWN, /* KEY_PAUSECD */ + /* 200, 0x0c8 */ SDL_SCANCODE_MEDIA_PLAY, /* KEY_PLAYCD */ + /* 201, 0x0c9 */ SDL_SCANCODE_MEDIA_PAUSE, /* KEY_PAUSECD */ /* 202, 0x0ca */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG3 */ /* 203, 0x0cb */ SDL_SCANCODE_UNKNOWN, /* KEY_PROG4 */ /* 204, 0x0cc */ SDL_SCANCODE_UNKNOWN, /* KEY_ALL_APPLICATIONS */ /* 205, 0x0cd */ SDL_SCANCODE_UNKNOWN, /* KEY_SUSPEND */ - /* 206, 0x0ce */ SDL_SCANCODE_UNKNOWN, /* KEY_CLOSE */ - /* 207, 0x0cf */ SDL_SCANCODE_AUDIOPLAY, /* KEY_PLAY */ - /* 208, 0x0d0 */ SDL_SCANCODE_AUDIOFASTFORWARD, /* KEY_FASTFORWARD */ + /* 206, 0x0ce */ SDL_SCANCODE_AC_CLOSE, /* KEY_CLOSE */ + /* 207, 0x0cf */ SDL_SCANCODE_MEDIA_PLAY, /* KEY_PLAY */ + /* 208, 0x0d0 */ SDL_SCANCODE_MEDIA_FAST_FORWARD, /* KEY_FASTFORWARD */ /* 209, 0x0d1 */ SDL_SCANCODE_UNKNOWN, /* KEY_BASSBOOST */ /* 210, 0x0d2 */ SDL_SCANCODE_PRINTSCREEN, /* KEY_PRINT */ /* 211, 0x0d3 */ SDL_SCANCODE_UNKNOWN, /* KEY_HP */ /* 212, 0x0d4 */ SDL_SCANCODE_UNKNOWN, /* KEY_CAMERA */ /* 213, 0x0d5 */ SDL_SCANCODE_UNKNOWN, /* KEY_SOUND */ /* 214, 0x0d6 */ SDL_SCANCODE_UNKNOWN, /* KEY_QUESTION */ - /* 215, 0x0d7 */ SDL_SCANCODE_MAIL, /* KEY_EMAIL */ + /* 215, 0x0d7 */ SDL_SCANCODE_UNKNOWN, /* KEY_EMAIL */ /* 216, 0x0d8 */ SDL_SCANCODE_UNKNOWN, /* KEY_CHAT */ /* 217, 0x0d9 */ SDL_SCANCODE_AC_SEARCH, /* KEY_SEARCH */ /* 218, 0x0da */ SDL_SCANCODE_UNKNOWN, /* KEY_CONNECT */ @@ -250,17 +250,17 @@ static SDL_Scancode const linux_scancode_table[] = { /* 221, 0x0dd */ SDL_SCANCODE_UNKNOWN, /* KEY_SHOP */ /* 222, 0x0de */ SDL_SCANCODE_ALTERASE, /* KEY_ALTERASE */ /* 223, 0x0df */ SDL_SCANCODE_CANCEL, /* KEY_CANCEL */ - /* 224, 0x0e0 */ SDL_SCANCODE_BRIGHTNESSDOWN, /* KEY_BRIGHTNESSDOWN */ - /* 225, 0x0e1 */ SDL_SCANCODE_BRIGHTNESSUP, /* KEY_BRIGHTNESSUP */ - /* 226, 0x0e2 */ SDL_SCANCODE_MEDIASELECT, /* KEY_MEDIA */ - /* 227, 0x0e3 */ SDL_SCANCODE_DISPLAYSWITCH, /* KEY_SWITCHVIDEOMODE */ - /* 228, 0x0e4 */ SDL_SCANCODE_KBDILLUMTOGGLE, /* KEY_KBDILLUMTOGGLE */ - /* 229, 0x0e5 */ SDL_SCANCODE_KBDILLUMDOWN, /* KEY_KBDILLUMDOWN */ - /* 230, 0x0e6 */ SDL_SCANCODE_KBDILLUMUP, /* KEY_KBDILLUMUP */ + /* 224, 0x0e0 */ SDL_SCANCODE_UNKNOWN, /* KEY_BRIGHTNESSDOWN */ + /* 225, 0x0e1 */ SDL_SCANCODE_UNKNOWN, /* KEY_BRIGHTNESSUP */ + /* 226, 0x0e2 */ SDL_SCANCODE_MEDIA_SELECT, /* KEY_MEDIA */ + /* 227, 0x0e3 */ SDL_SCANCODE_UNKNOWN, /* KEY_SWITCHVIDEOMODE */ + /* 228, 0x0e4 */ SDL_SCANCODE_UNKNOWN, /* KEY_KBDILLUMTOGGLE */ + /* 229, 0x0e5 */ SDL_SCANCODE_UNKNOWN, /* KEY_KBDILLUMDOWN */ + /* 230, 0x0e6 */ SDL_SCANCODE_UNKNOWN, /* KEY_KBDILLUMUP */ /* 231, 0x0e7 */ SDL_SCANCODE_UNKNOWN, /* KEY_SEND */ /* 232, 0x0e8 */ SDL_SCANCODE_UNKNOWN, /* KEY_REPLY */ /* 233, 0x0e9 */ SDL_SCANCODE_UNKNOWN, /* KEY_FORWARDMAIL */ - /* 234, 0x0ea */ SDL_SCANCODE_UNKNOWN, /* KEY_SAVE */ + /* 234, 0x0ea */ SDL_SCANCODE_AC_SAVE, /* KEY_SAVE */ /* 235, 0x0eb */ SDL_SCANCODE_UNKNOWN, /* KEY_DOCUMENTS */ /* 236, 0x0ec */ SDL_SCANCODE_UNKNOWN, /* KEY_BATTERY */ /* 237, 0x0ed */ SDL_SCANCODE_UNKNOWN, /* KEY_BLUETOOTH */ @@ -829,7 +829,7 @@ done #!/bin/bash function get_comment -{ +{ name=$(echo "$1" | awk '{print $7}') if [ "$name" != "" ]; then grep -E "$name\s" /usr/include/linux/input-event-codes.h | grep -F "/*" | sed 's,[^/]*/,/,' diff --git a/src/events/scancodes_windows.h b/src/events/scancodes_windows.h index 60fc842f65658..92157b33a8f81 100644 --- a/src/events/scancodes_windows.h +++ b/src/events/scancodes_windows.h @@ -170,7 +170,7 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe00d*/ SDL_SCANCODE_UNKNOWN, /*0xe00e*/ SDL_SCANCODE_UNKNOWN, /*0xe00f*/ SDL_SCANCODE_UNKNOWN, - /*0xe010*/ SDL_SCANCODE_AUDIOPREV, + /*0xe010*/ SDL_SCANCODE_MEDIA_PREVIOUS_TRACK, /*0xe011*/ SDL_SCANCODE_UNKNOWN, /*0xe012*/ SDL_SCANCODE_UNKNOWN, /*0xe013*/ SDL_SCANCODE_UNKNOWN, @@ -179,7 +179,7 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe016*/ SDL_SCANCODE_UNKNOWN, /*0xe017*/ SDL_SCANCODE_CUT, /*0xe018*/ SDL_SCANCODE_COPY, - /*0xe019*/ SDL_SCANCODE_AUDIONEXT, + /*0xe019*/ SDL_SCANCODE_MEDIA_NEXT_TRACK, /*0xe01a*/ SDL_SCANCODE_UNKNOWN, /*0xe01b*/ SDL_SCANCODE_UNKNOWN, /*0xe01c*/ SDL_SCANCODE_KP_ENTER, @@ -187,10 +187,10 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe01e*/ SDL_SCANCODE_UNKNOWN, /*0xe01f*/ SDL_SCANCODE_UNKNOWN, /*0xe020*/ SDL_SCANCODE_MUTE, - /*0xe021*/ SDL_SCANCODE_CALCULATOR, - /*0xe022*/ SDL_SCANCODE_AUDIOPLAY, + /*0xe021*/ SDL_SCANCODE_UNKNOWN, /* LaunchApp2 */ + /*0xe022*/ SDL_SCANCODE_MEDIA_PLAY_PAUSE, /*0xe023*/ SDL_SCANCODE_UNKNOWN, - /*0xe024*/ SDL_SCANCODE_AUDIOSTOP, + /*0xe024*/ SDL_SCANCODE_MEDIA_STOP, /*0xe025*/ SDL_SCANCODE_UNKNOWN, /*0xe026*/ SDL_SCANCODE_UNKNOWN, /*0xe027*/ SDL_SCANCODE_UNKNOWN, @@ -198,7 +198,7 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe029*/ SDL_SCANCODE_UNKNOWN, /*0xe02a*/ SDL_SCANCODE_UNKNOWN, /*0xe02b*/ SDL_SCANCODE_UNKNOWN, - /*0xe02c*/ SDL_SCANCODE_EJECT, + /*0xe02c*/ SDL_SCANCODE_MEDIA_EJECT, /*0xe02d*/ SDL_SCANCODE_UNKNOWN, /*0xe02e*/ SDL_SCANCODE_VOLUMEDOWN, /*0xe02f*/ SDL_SCANCODE_UNKNOWN, @@ -261,9 +261,9 @@ static const SDL_Scancode windows_scancode_table[] = { /*0xe068*/ SDL_SCANCODE_AC_STOP, /*0xe069*/ SDL_SCANCODE_AC_FORWARD, /*0xe06a*/ SDL_SCANCODE_AC_BACK, - /*0xe06b*/ SDL_SCANCODE_COMPUTER, - /*0xe06c*/ SDL_SCANCODE_MAIL, - /*0xe06d*/ SDL_SCANCODE_MEDIASELECT, + /*0xe06b*/ SDL_SCANCODE_UNKNOWN, /* LaunchApp1 */ + /*0xe06c*/ SDL_SCANCODE_UNKNOWN, /* LaunchMail */ + /*0xe06d*/ SDL_SCANCODE_MEDIA_SELECT, /*0xe06e*/ SDL_SCANCODE_UNKNOWN, /*0xe06f*/ SDL_SCANCODE_UNKNOWN, /*0xe070*/ SDL_SCANCODE_UNKNOWN, diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h index f3001d8325bcf..2083dc613ac4f 100644 --- a/src/events/scancodes_xfree86.h +++ b/src/events/scancodes_xfree86.h @@ -122,7 +122,7 @@ static const SDL_Scancode xfree86_scancode_table[] = { /* 90 */ SDL_SCANCODE_UP, /* 91 */ SDL_SCANCODE_PAGEUP, /* 92 */ SDL_SCANCODE_LEFT, - /* 93 */ SDL_SCANCODE_BRIGHTNESSDOWN, /* on PowerBook G4 / KEY_Begin */ + /* 93 */ SDL_SCANCODE_UNKNOWN, /* on PowerBook G4 / KEY_Begin */ /* 94 */ SDL_SCANCODE_RIGHT, /* 95 */ SDL_SCANCODE_END, /* 96 */ SDL_SCANCODE_DOWN, @@ -320,7 +320,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 137, 0x089 */ SDL_SCANCODE_CUT, /* XF86Cut */ /* 138, 0x08a */ SDL_SCANCODE_HELP, /* Help */ /* 139, 0x08b */ SDL_SCANCODE_MENU, /* XF86MenuKB */ - /* 140, 0x08c */ SDL_SCANCODE_CALCULATOR, /* XF86Calculator */ + /* 140, 0x08c */ SDL_SCANCODE_UNKNOWN, /* XF86Calculator */ /* 141, 0x08d */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 142, 0x08e */ SDL_SCANCODE_SLEEP, /* XF86Sleep */ /* 143, 0x08f */ SDL_SCANCODE_UNKNOWN, /* XF86WakeUp */ @@ -328,27 +328,27 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 145, 0x091 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ /* 146, 0x092 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 147, 0x093 */ SDL_SCANCODE_UNKNOWN, /* XF86Xfer */ - /* 148, 0x094 */ SDL_SCANCODE_APP1, /* XF86Launch1 */ - /* 149, 0x095 */ SDL_SCANCODE_APP2, /* XF86Launch2 */ - /* 150, 0x096 */ SDL_SCANCODE_WWW, /* XF86WWW */ + /* 148, 0x094 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch1 */ + /* 149, 0x095 */ SDL_SCANCODE_UNKNOWN, /* XF86Launch2 */ + /* 150, 0x096 */ SDL_SCANCODE_UNKNOWN, /* XF86WWW */ /* 151, 0x097 */ SDL_SCANCODE_UNKNOWN, /* XF86DOS */ /* 152, 0x098 */ SDL_SCANCODE_UNKNOWN, /* XF86ScreenSaver */ /* 153, 0x099 */ SDL_SCANCODE_UNKNOWN, /* XF86RotateWindows */ /* 154, 0x09a */ SDL_SCANCODE_UNKNOWN, /* XF86TaskPane */ - /* 155, 0x09b */ SDL_SCANCODE_MAIL, /* XF86Mail */ + /* 155, 0x09b */ SDL_SCANCODE_UNKNOWN, /* XF86Mail */ /* 156, 0x09c */ SDL_SCANCODE_AC_BOOKMARKS, /* XF86Favorites */ - /* 157, 0x09d */ SDL_SCANCODE_COMPUTER, /* XF86MyComputer */ + /* 157, 0x09d */ SDL_SCANCODE_UNKNOWN, /* XF86MyComputer */ /* 158, 0x09e */ SDL_SCANCODE_AC_BACK, /* XF86Back */ /* 159, 0x09f */ SDL_SCANCODE_AC_FORWARD, /* XF86Forward */ /* 160, 0x0a0 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ - /* 161, 0x0a1 */ SDL_SCANCODE_EJECT, /* XF86Eject */ - /* 162, 0x0a2 */ SDL_SCANCODE_EJECT, /* XF86Eject */ - /* 163, 0x0a3 */ SDL_SCANCODE_AUDIONEXT, /* XF86AudioNext */ - /* 164, 0x0a4 */ SDL_SCANCODE_AUDIOPLAY, /* XF86AudioPlay */ - /* 165, 0x0a5 */ SDL_SCANCODE_AUDIOPREV, /* XF86AudioPrev */ - /* 166, 0x0a6 */ SDL_SCANCODE_AUDIOSTOP, /* XF86AudioStop */ - /* 167, 0x0a7 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioRecord */ - /* 168, 0x0a8 */ SDL_SCANCODE_AUDIOREWIND, /* XF86AudioRewind */ + /* 161, 0x0a1 */ SDL_SCANCODE_MEDIA_EJECT, /* XF86Eject */ + /* 162, 0x0a2 */ SDL_SCANCODE_MEDIA_EJECT, /* XF86Eject */ + /* 163, 0x0a3 */ SDL_SCANCODE_MEDIA_NEXT_TRACK, /* XF86AudioNext */ + /* 164, 0x0a4 */ SDL_SCANCODE_MEDIA_PLAY_PAUSE, /* XF86AudioPlay */ + /* 165, 0x0a5 */ SDL_SCANCODE_MEDIA_PREVIOUS_TRACK, /* XF86AudioPrev */ + /* 166, 0x0a6 */ SDL_SCANCODE_MEDIA_STOP, /* XF86AudioStop */ + /* 167, 0x0a7 */ SDL_SCANCODE_MEDIA_RECORD, /* XF86AudioRecord */ + /* 168, 0x0a8 */ SDL_SCANCODE_MEDIA_REWIND, /* XF86AudioRewind */ /* 169, 0x0a9 */ SDL_SCANCODE_UNKNOWN, /* XF86Phone */ /* 170, 0x0aa */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 171, 0x0ab */ SDL_SCANCODE_F13, /* XF86Tools */ @@ -361,7 +361,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 178, 0x0b2 */ SDL_SCANCODE_UNKNOWN, /* XF86ScrollDown */ /* 179, 0x0b3 */ SDL_SCANCODE_KP_LEFTPAREN, /* parenleft */ /* 180, 0x0b4 */ SDL_SCANCODE_KP_RIGHTPAREN, /* parenright */ - /* 181, 0x0b5 */ SDL_SCANCODE_UNKNOWN, /* XF86New */ + /* 181, 0x0b5 */ SDL_SCANCODE_AC_NEW, /* XF86New */ /* 182, 0x0b6 */ SDL_SCANCODE_AGAIN, /* Redo */ /* 183, 0x0b7 */ SDL_SCANCODE_F13, /* XF86Tools */ /* 184, 0x0b8 */ SDL_SCANCODE_F14, /* XF86Launch5 */ @@ -380,22 +380,22 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 197, 0x0c5 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 198, 0x0c6 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 199, 0x0c7 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ - /* 200, 0x0c8 */ SDL_SCANCODE_AUDIOPLAY, /* XF86AudioPlay */ - /* 201, 0x0c9 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioPause */ + /* 200, 0x0c8 */ SDL_SCANCODE_MEDIA_PLAY, /* XF86AudioPlay */ + /* 201, 0x0c9 */ SDL_SCANCODE_MEDIA_PAUSE, /* XF86AudioPause */ /* 202, 0x0ca */ SDL_SCANCODE_UNKNOWN, /* XF86Launch3 */ /* 203, 0x0cb */ SDL_SCANCODE_UNKNOWN, /* XF86Launch4 */ /* 204, 0x0cc */ SDL_SCANCODE_UNKNOWN, /* XF86LaunchB */ /* 205, 0x0cd */ SDL_SCANCODE_UNKNOWN, /* XF86Suspend */ - /* 206, 0x0ce */ SDL_SCANCODE_UNKNOWN, /* XF86Close */ - /* 207, 0x0cf */ SDL_SCANCODE_AUDIOPLAY, /* XF86AudioPlay */ - /* 208, 0x0d0 */ SDL_SCANCODE_AUDIOFASTFORWARD, /* XF86AudioForward */ + /* 206, 0x0ce */ SDL_SCANCODE_AC_CLOSE, /* XF86Close */ + /* 207, 0x0cf */ SDL_SCANCODE_MEDIA_PLAY, /* XF86AudioPlay */ + /* 208, 0x0d0 */ SDL_SCANCODE_MEDIA_FAST_FORWARD, /* XF86AudioForward */ /* 209, 0x0d1 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 210, 0x0d2 */ SDL_SCANCODE_PRINTSCREEN, /* Print */ /* 211, 0x0d3 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 212, 0x0d4 */ SDL_SCANCODE_UNKNOWN, /* XF86WebCam */ /* 213, 0x0d5 */ SDL_SCANCODE_UNKNOWN, /* XF86AudioPreset */ /* 214, 0x0d6 */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ - /* 215, 0x0d7 */ SDL_SCANCODE_MAIL, /* XF86Mail */ + /* 215, 0x0d7 */ SDL_SCANCODE_UNKNOWN, /* XF86Mail */ /* 216, 0x0d8 */ SDL_SCANCODE_UNKNOWN, /* XF86Messenger */ /* 217, 0x0d9 */ SDL_SCANCODE_AC_SEARCH, /* XF86Search */ /* 218, 0x0da */ SDL_SCANCODE_UNKNOWN, /* XF86Go */ @@ -404,13 +404,13 @@ static const SDL_Scancode xfree86_scancode_table2[] = { /* 221, 0x0dd */ SDL_SCANCODE_UNKNOWN, /* XF86Shop */ /* 222, 0x0de */ SDL_SCANCODE_UNKNOWN, /* NoSymbol */ /* 223, 0x0df */ SDL_SCANCODE_CANCEL, /* Cancel */ - /* 224, 0x0e0 */ SDL_SCANCODE_BRIGHTNESSDOWN, /* XF86MonBrightnessDown */ - /* 225, 0x0e1 */ SDL_SCANCODE_BRIGHTNESSUP, /* XF86MonBrightnessUp */ - /* 226, 0x0e2 */ SDL_SCANCODE_MEDIASELECT, /* XF86AudioMedia */ - /* 227, 0x0e3 */ SDL_SCANCODE_DISPLAYSWITCH, /* XF86Display */ - /* 228, 0x0e4 */ SDL_SCANCODE_KBDILLUMTOGGLE, /* XF86KbdLightOnOff */ - /* 229, 0x0e5 */ SDL_SCANCODE_KBDILLUMDOWN, /* XF86KbdBrightnessDown */ - /* 230, 0x0e6 */ SDL_SCANCODE_KBDILLUMUP, /* XF86KbdBrightnessUp */ + /* 224, 0x0e0 */ SDL_SCANCODE_UNKNOWN, /* XF86MonBrightnessDown */ + /* 225, 0x0e1 */ SDL_SCANCODE_UNKNOWN, /* XF86MonBrightnessUp */ + /* 226, 0x0e2 */ SDL_SCANCODE_MEDIA_SELECT, /* XF86AudioMedia */ + /* 227, 0x0e3 */ SDL_SCANCODE_UNKNOWN, /* XF86Display */ + /* 228, 0x0e4 */ SDL_SCANCODE_UNKNOWN, /* XF86KbdLightOnOff */ + /* 229, 0x0e5 */ SDL_SCANCODE_UNKNOWN, /* XF86KbdBrightnessDown */ + /* 230, 0x0e6 */ SDL_SCANCODE_UNKNOWN, /* XF86KbdBrightnessUp */ /* 231, 0x0e7 */ SDL_SCANCODE_UNKNOWN, /* XF86Send */ /* 232, 0x0e8 */ SDL_SCANCODE_UNKNOWN, /* XF86Reply */ /* 233, 0x0e9 */ SDL_SCANCODE_UNKNOWN, /* XF86MailForward */ diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index 1422622a8e30d..4c86c22b4bc86 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -95,8 +95,8 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_TAB, /* AKEYCODE_TAB */ SDL_SCANCODE_SPACE, /* AKEYCODE_SPACE */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_SYM */ - SDL_SCANCODE_WWW, /* AKEYCODE_EXPLORER */ - SDL_SCANCODE_MAIL, /* AKEYCODE_ENVELOPE */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EXPLORER */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ENVELOPE */ SDL_SCANCODE_RETURN, /* AKEYCODE_ENTER */ SDL_SCANCODE_BACKSPACE, /* AKEYCODE_DEL */ SDL_SCANCODE_GRAVE, /* AKEYCODE_GRAVE */ @@ -116,12 +116,12 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_MENU, /* AKEYCODE_MENU */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NOTIFICATION */ SDL_SCANCODE_AC_SEARCH, /* AKEYCODE_SEARCH */ - SDL_SCANCODE_AUDIOPLAY, /* AKEYCODE_MEDIA_PLAY_PAUSE */ - SDL_SCANCODE_AUDIOSTOP, /* AKEYCODE_MEDIA_STOP */ - SDL_SCANCODE_AUDIONEXT, /* AKEYCODE_MEDIA_NEXT */ - SDL_SCANCODE_AUDIOPREV, /* AKEYCODE_MEDIA_PREVIOUS */ - SDL_SCANCODE_AUDIOREWIND, /* AKEYCODE_MEDIA_REWIND */ - SDL_SCANCODE_AUDIOFASTFORWARD, /* AKEYCODE_MEDIA_FAST_FORWARD */ + SDL_SCANCODE_MEDIA_PLAY_PAUSE, /* AKEYCODE_MEDIA_PLAY_PAUSE */ + SDL_SCANCODE_MEDIA_STOP, /* AKEYCODE_MEDIA_STOP */ + SDL_SCANCODE_MEDIA_NEXT_TRACK, /* AKEYCODE_MEDIA_NEXT */ + SDL_SCANCODE_MEDIA_PREVIOUS_TRACK, /* AKEYCODE_MEDIA_PREVIOUS */ + SDL_SCANCODE_MEDIA_REWIND, /* AKEYCODE_MEDIA_REWIND */ + SDL_SCANCODE_MEDIA_FAST_FORWARD, /* AKEYCODE_MEDIA_FAST_FORWARD */ SDL_SCANCODE_MUTE, /* AKEYCODE_MUTE */ SDL_SCANCODE_PAGEUP, /* AKEYCODE_PAGE_UP */ SDL_SCANCODE_PAGEDOWN, /* AKEYCODE_PAGE_DOWN */ @@ -157,11 +157,11 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_END, /* AKEYCODE_MOVE_END */ SDL_SCANCODE_INSERT, /* AKEYCODE_INSERT */ SDL_SCANCODE_AC_FORWARD, /* AKEYCODE_FORWARD */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PLAY */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_PAUSE */ + SDL_SCANCODE_MEDIA_PLAY, /* AKEYCODE_MEDIA_PLAY */ + SDL_SCANCODE_MEDIA_PAUSE, /* AKEYCODE_MEDIA_PAUSE */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_CLOSE */ - SDL_SCANCODE_EJECT, /* AKEYCODE_MEDIA_EJECT */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_RECORD */ + SDL_SCANCODE_MEDIA_EJECT, /* AKEYCODE_MEDIA_EJECT */ + SDL_SCANCODE_MEDIA_RECORD, /* AKEYCODE_MEDIA_RECORD */ SDL_SCANCODE_F1, /* AKEYCODE_F1 */ SDL_SCANCODE_F2, /* AKEYCODE_F2 */ SDL_SCANCODE_F3, /* AKEYCODE_F3 */ @@ -174,7 +174,7 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_F10, /* AKEYCODE_F10 */ SDL_SCANCODE_F11, /* AKEYCODE_F11 */ SDL_SCANCODE_F12, /* AKEYCODE_F12 */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_NUM_LOCK */ + SDL_SCANCODE_NUMLOCKCLEAR, /* AKEYCODE_NUM_LOCK */ SDL_SCANCODE_KP_0, /* AKEYCODE_NUMPAD_0 */ SDL_SCANCODE_KP_1, /* AKEYCODE_NUMPAD_1 */ SDL_SCANCODE_KP_2, /* AKEYCODE_NUMPAD_2 */ @@ -197,8 +197,8 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_KP_RIGHTPAREN, /* AKEYCODE_NUMPAD_RIGHT_PAREN */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_VOLUME_MUTE */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_INFO */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_UP */ - SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CHANNEL_DOWN */ + SDL_SCANCODE_CHANNEL_INCREMENT, /* AKEYCODE_CHANNEL_UP */ + SDL_SCANCODE_CHANNEL_INCREMENT, /* AKEYCODE_CHANNEL_DOWN */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_IN */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ZOOM_OUT */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_TV */ @@ -241,7 +241,7 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CONTACTS */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALENDAR */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MUSIC */ - SDL_SCANCODE_CALCULATOR, /* AKEYCODE_CALCULATOR */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_CALCULATOR */ SDL_SCANCODE_LANG5, /* AKEYCODE_ZENKAKU_HANKAKU */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_EISU */ SDL_SCANCODE_INTERNATIONAL5, /* AKEYCODE_MUHENKAN */ @@ -251,8 +251,8 @@ static SDL_Scancode Android_Keycodes[] = { SDL_SCANCODE_UNKNOWN, /* AKEYCODE_RO */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_KANA */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_ASSIST */ - SDL_SCANCODE_BRIGHTNESSDOWN, /* AKEYCODE_BRIGHTNESS_DOWN */ - SDL_SCANCODE_BRIGHTNESSUP, /* AKEYCODE_BRIGHTNESS_UP */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BRIGHTNESS_DOWN */ + SDL_SCANCODE_UNKNOWN, /* AKEYCODE_BRIGHTNESS_UP */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_MEDIA_AUDIO_TRACK */ SDL_SCANCODE_SLEEP, /* AKEYCODE_SLEEP */ SDL_SCANCODE_UNKNOWN, /* AKEYCODE_WAKEUP */ diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index bbb6eeeaf0370..d5edfe9b2811b 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -215,12 +215,12 @@ static const SDL_Keycode emscripten_keycode_table[] = { /* 173 */ SDLK_MINUS, /*FX*/ /* 174 */ SDLK_VOLUMEDOWN, /*IE, Chrome*/ /* 175 */ SDLK_VOLUMEUP, /*IE, Chrome*/ - /* 176 */ SDLK_AUDIONEXT, /*IE, Chrome*/ - /* 177 */ SDLK_AUDIOPREV, /*IE, Chrome*/ + /* 176 */ SDLK_MEDIA_NEXT_TRACK, /*IE, Chrome*/ + /* 177 */ SDLK_MEDIA_PREVIOUS_TRACK, /*IE, Chrome*/ /* 178 */ SDLK_UNKNOWN, - /* 179 */ SDLK_AUDIOPLAY, /*IE, Chrome*/ + /* 179 */ SDLK_MEDIA_PLAY, /*IE, Chrome*/ /* 180 */ SDLK_UNKNOWN, - /* 181 */ SDLK_AUDIOMUTE, /*FX*/ + /* 181 */ SDLK_UNKNOWN, /* 182 */ SDLK_VOLUMEDOWN, /*FX*/ /* 183 */ SDLK_VOLUMEUP, /*FX*/ /* 184 */ SDLK_UNKNOWN, @@ -410,27 +410,25 @@ static SDL_Scancode Emscripten_MapScanCode(const char *code) case DOM_PK_PASTE: return SDL_SCANCODE_PASTE; case DOM_PK_MEDIA_TRACK_PREVIOUS: - return SDL_SCANCODE_AUDIOPREV; + return SDL_SCANCODE_MEDIA_PREVIOUS_TRACK; case DOM_PK_CUT: return SDL_SCANCODE_CUT; case DOM_PK_COPY: return SDL_SCANCODE_COPY; case DOM_PK_MEDIA_TRACK_NEXT: - return SDL_SCANCODE_AUDIONEXT; + return SDL_SCANCODE_MEDIA_NEXT_TRACK; case DOM_PK_NUMPAD_ENTER: return SDL_SCANCODE_KP_ENTER; case DOM_PK_CONTROL_RIGHT: return SDL_SCANCODE_RCTRL; case DOM_PK_AUDIO_VOLUME_MUTE: - return SDL_SCANCODE_AUDIOMUTE; - case DOM_PK_LAUNCH_APP_2: - return SDL_SCANCODE_CALCULATOR; + return SDL_SCANCODE_MUTE; case DOM_PK_MEDIA_PLAY_PAUSE: - return SDL_SCANCODE_AUDIOPLAY; + return SDL_SCANCODE_MEDIA_PLAY_PAUSE; case DOM_PK_MEDIA_STOP: - return SDL_SCANCODE_AUDIOSTOP; + return SDL_SCANCODE_MEDIA_STOP; case DOM_PK_EJECT: - return SDL_SCANCODE_EJECT; + return SDL_SCANCODE_MEDIA_EJECT; case DOM_PK_AUDIO_VOLUME_DOWN: return SDL_SCANCODE_VOLUMEDOWN; case DOM_PK_AUDIO_VOLUME_UP: @@ -485,12 +483,8 @@ static SDL_Scancode Emscripten_MapScanCode(const char *code) return SDL_SCANCODE_AC_FORWARD; case DOM_PK_BROWSER_BACK: return SDL_SCANCODE_AC_BACK; - case DOM_PK_LAUNCH_APP_1: - return SDL_SCANCODE_COMPUTER; - case DOM_PK_LAUNCH_MAIL: - return SDL_SCANCODE_MAIL; case DOM_PK_MEDIA_SELECT: - return SDL_SCANCODE_MEDIASELECT; + return SDL_SCANCODE_MEDIA_SELECT; } return SDL_SCANCODE_UNKNOWN; @@ -801,11 +795,43 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent SDL_bool prevent_default = SDL_TRUE; SDL_bool is_nav_key = SDL_FALSE; + if (scancode == SDL_SCANCODE_UNKNOWN) { + if (SDL_strcmp(keyEvent->key, "Sleep") == 0) { + scancode = SDL_SCANCODE_SLEEP; + } else if (SDL_strcmp(keyEvent->key, "ChannelUp") == 0) { + scancode = SDL_SCANCODE_CHANNEL_INCREMENT; + } else if (SDL_strcmp(keyEvent->key, "ChannelDown") == 0) { + scancode = SDL_SCANCODE_CHANNEL_DECREMENT; + } else if (SDL_strcmp(keyEvent->key, "MediaPlay") == 0) { + scancode = SDL_SCANCODE_MEDIA_PLAY; + } else if (SDL_strcmp(keyEvent->key, "MediaPause") == 0) { + scancode = SDL_SCANCODE_MEDIA_PAUSE; + } else if (SDL_strcmp(keyEvent->key, "MediaRecord") == 0) { + scancode = SDL_SCANCODE_MEDIA_RECORD; + } else if (SDL_strcmp(keyEvent->key, "MediaFastForward") == 0) { + scancode = SDL_SCANCODE_MEDIA_FAST_FORWARD; + } else if (SDL_strcmp(keyEvent->key, "MediaRewind") == 0) { + scancode = SDL_SCANCODE_MEDIA_REWIND; + } else if (SDL_strcmp(keyEvent->key, "Close") == 0) { + scancode = SDL_SCANCODE_AC_CLOSE; + } else if (SDL_strcmp(keyEvent->key, "New") == 0) { + scancode = SDL_SCANCODE_AC_NEW; + } else if (SDL_strcmp(keyEvent->key, "Open") == 0) { + scancode = SDL_SCANCODE_AC_OPEN; + } else if (SDL_strcmp(keyEvent->key, "Print") == 0) { + scancode = SDL_SCANCODE_AC_PRINT; + } else if (SDL_strcmp(keyEvent->key, "Save") == 0) { + scancode = SDL_SCANCODE_AC_SAVE; + } else if (SDL_strcmp(keyEvent->key, "Props") == 0) { + scancode = SDL_SCANCODE_AC_PROPERTIES; + } + } + if (scancode == SDL_SCANCODE_UNKNOWN) { /* KaiOS Left Soft Key and Right Soft Key, they act as OK/Next/Menu and Cancel/Back/Clear */ - if (SDL_strncmp(keyEvent->key, "SoftLeft", 9) == 0) { + if (SDL_strcmp(keyEvent->key, "SoftLeft") == 0) { scancode = SDL_SCANCODE_AC_FORWARD; - } else if (SDL_strncmp(keyEvent->key, "SoftRight", 10) == 0) { + } else if (SDL_strcmp(keyEvent->key, "SoftRight") == 0) { scancode = SDL_SCANCODE_AC_BACK; } } diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index 863e92b2bbbe6..207115ad7a190 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -79,9 +79,9 @@ static int keyboard_getKeyFromName(void *arg) SDLTest_AssertCheck(result == SDLK_FIND, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_FIND, result); /* Case where Key is known, multiple character input */ - result = SDL_GetKeyFromName("AudioStop"); + result = SDL_GetKeyFromName("MediaStop"); SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/multi)"); - SDLTest_AssertCheck(result == SDLK_AUDIOSTOP, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_AUDIOSTOP, result); + SDLTest_AssertCheck(result == SDLK_MEDIA_STOP, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_MEDIA_STOP, result); /* Case where Key is unknown */ result = SDL_GetKeyFromName("NotThere"); @@ -191,8 +191,8 @@ static int keyboard_getKeyName(void *arg) SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); /* Case where key has a N character name */ - expected = "BrightnessUp"; - result = SDL_GetKeyName(SDLK_BRIGHTNESSUP); + expected = "MediaPlay"; + result = SDL_GetKeyName(SDLK_MEDIA_PLAY); SDLTest_AssertPass("Call to SDL_GetKeyName()"); SDLTest_AssertCheck(result != NULL, "Verify result from call is not NULL"); SDLTest_AssertCheck(SDL_strcmp(result, expected) == 0, "Verify result from call is valid, expected: %s, got: %s", expected, result); From ef9bd8b609e08fbf7138da0d2a177d6b809767e0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 18 Jun 2024 18:34:55 -0700 Subject: [PATCH 011/431] Add the raw platform specific key code to SDL_Keysym This allows applications to handle keys that SDL doesn't recognize, in a platform dependent way. Fixes https://github.com/libsdl-org/SDL/issues/6390 --- include/SDL3/SDL_keyboard.h | 2 +- src/core/haiku/SDL_BApp.h | 2 +- src/core/linux/SDL_evdev.c | 10 ++- src/core/openbsd/SDL_wscons_kbd.c | 12 ++-- src/core/winrt/SDL_winrtapp_direct3d.cpp | 4 +- src/events/SDL_keyboard.c | 75 +++++++++++---------- src/events/SDL_keyboard_c.h | 6 +- src/joystick/android/SDL_sysjoystick.c | 4 +- src/video/android/SDL_androidkeyboard.c | 4 +- src/video/cocoa/SDL_cocoakeyboard.m | 8 +-- src/video/cocoa/SDL_cocoawindow.m | 4 +- src/video/emscripten/SDL_emscriptenevents.c | 4 +- src/video/ngage/SDL_ngageevents.cpp | 4 +- src/video/psp/SDL_pspevents.c | 4 +- src/video/qnx/SDL_qnxkeyboard.c | 4 +- src/video/riscos/SDL_riscosevents.c | 4 +- src/video/uikit/SDL_uikitevents.m | 2 +- src/video/uikit/SDL_uikitview.m | 6 +- src/video/vita/SDL_vitakeyboard.c | 56 +++++++-------- src/video/wayland/SDL_waylandevents.c | 6 +- src/video/windows/SDL_windowsevents.c | 51 +++++++++----- src/video/winrt/SDL_winrtkeyboard.cpp | 8 ++- src/video/x11/SDL_x11events.c | 12 ++-- test/checkkeys.c | 10 +-- 24 files changed, 163 insertions(+), 139 deletions(-) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index c84eb78388cf8..ffa15949504c6 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -68,7 +68,7 @@ typedef struct SDL_Keysym SDL_Scancode scancode; /**< SDL physical key code - see SDL_Scancode for details */ SDL_Keycode sym; /**< SDL virtual key code - see SDL_Keycode for details */ SDL_Keymod mod; /**< current key modifiers */ - Uint16 unused; + Uint16 raw; /**< The platform dependent scancode for this event */ } SDL_Keysym; /* Function prototypes */ diff --git a/src/core/haiku/SDL_BApp.h b/src/core/haiku/SDL_BApp.h index 8af12eec502c0..37384fdb699d0 100644 --- a/src/core/haiku/SDL_BApp.h +++ b/src/core/haiku/SDL_BApp.h @@ -304,7 +304,7 @@ class SDL_BLooper : public BLooper return; } HAIKU_SetKeyState(scancode, state); - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, state, HAIKU_GetScancodeFromBeKey(scancode)); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, scancode, HAIKU_GetScancodeFromBeKey(scancode), state); if (state == SDL_PRESSED && SDL_TextInputActive()) { const int8 *keyUtf8; diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index 1ed054ff4d0dd..f0f31b395afd1 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -373,12 +373,10 @@ void SDL_EVDEV_Poll(void) /* Probably keyboard */ scan_code = SDL_EVDEV_translate_keycode(event->code); - if (scan_code != SDL_SCANCODE_UNKNOWN) { - if (event->value == 0) { - SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, SDL_RELEASED, scan_code); - } else if (event->value == 1 || event->value == 2 /* key repeated */) { - SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, SDL_PRESSED, scan_code); - } + if (event->value == 0) { + SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scan_code, SDL_RELEASED); + } else if (event->value == 1 || event->value == 2 /* key repeated */) { + SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scan_code, SDL_PRESSED); } SDL_EVDEV_kbd_keycode(_this->kbd, event->code, event->value); break; diff --git a/src/core/openbsd/SDL_wscons_kbd.c b/src/core/openbsd/SDL_wscons_kbd.c index 81f94448cdaa4..b00e25ec8c4d1 100644 --- a/src/core/openbsd/SDL_wscons_kbd.c +++ b/src/core/openbsd/SDL_wscons_kbd.c @@ -560,22 +560,22 @@ static void Translate_to_keycode(SDL_WSCONS_input_data *input, int type, keysym_ switch (keyDesc.command) { case KS_Cmd_ScrollBack: { - SDL_SendKeyboardKey(0, input->keyboardID, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, SDL_SCANCODE_PAGEUP); + SDL_SendKeyboardKey(0, input->keyboardID, 0, SDL_SCANCODE_PAGEUP, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED); return; } case KS_Cmd_ScrollFwd: { - SDL_SendKeyboardKey(0, input->keyboardID, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, SDL_SCANCODE_PAGEDOWN); + SDL_SendKeyboardKey(0, input->keyboardID, 0, SDL_SCANCODE_PAGEDOWN, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED); return; } } for (i = 0; i < sizeof(conversion_table) / sizeof(struct wscons_keycode_to_SDL); i++) { if (conversion_table[i].sourcekey == group[0]) { - SDL_SendKeyboardKey(0, input->keyboardID, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, conversion_table[i].targetKey); + SDL_SendKeyboardKey(0, input->keyboardID, group[0], conversion_table[i].targetKey, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED); return; } } - SDL_SendKeyboardKey(0, input->keyboardID, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, SDL_SCANCODE_UNKNOWN); + SDL_SendKeyboardKey(0, input->keyboardID, group[0], SDL_SCANCODE_UNKNOWN, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED); } static void updateKeyboard(SDL_WSCONS_input_data *input) @@ -809,13 +809,13 @@ static void updateKeyboard(SDL_WSCONS_input_data *input) } break; case WSCONS_EVENT_ALL_KEYS_UP: for (i = 0; i < SDL_NUM_SCANCODES; i++) { - SDL_SendKeyboardKey(0, input->keyboardID, SDL_RELEASED, i); + SDL_SendKeyboardKey(0, input->keyboardID, 0, (SDL_Scancode)i, SDL_RELEASED); } break; } if (input->type == WSKBD_TYPE_USB && events[i].value <= 0xE7) - SDL_SendKeyboardKey(0, input->keyboardID, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)events[i].value); + SDL_SendKeyboardKey(0, input->keyboardID, 0, (SDL_Scancode)events[i].value, type == WSCONS_EVENT_KEY_DOWN ? SDL_PRESSED : SDL_RELEASED); else Translate_to_keycode(input, type, events[i].value); diff --git a/src/core/winrt/SDL_winrtapp_direct3d.cpp b/src/core/winrt/SDL_winrtapp_direct3d.cpp index 3562794254643..38cbb08648a6e 100644 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp @@ -724,8 +724,8 @@ void SDL_WinRTApp::OnCharacterReceived(Windows::UI::Core::CoreWindow ^ sender, W template static void WINRT_OnBackButtonPressed(BackButtonEventArgs ^ args) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, SDL_SCANCODE_AC_BACK); - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_AC_BACK); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_AC_BACK, SDL_PRESSED); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_AC_BACK, SDL_RELEASED); if (SDL_GetHintBoolean(SDL_HINT_WINRT_HANDLE_BACK_BUTTON, SDL_FALSE)) { args->Handled = true; diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index c96058710d306..3492adc8c7b14 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -806,7 +806,7 @@ void SDL_ResetKeyboard(void) #endif for (scancode = (SDL_Scancode)0; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keystate[scancode] == SDL_PRESSED) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, scancode); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); } } } @@ -944,7 +944,7 @@ int SDL_SetKeyboardFocus(SDL_Window *window) return 0; } -static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode) +static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, Uint8 state) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; @@ -953,10 +953,6 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo Uint8 repeat = SDL_FALSE; const Uint8 source = flags & KEYBOARD_SOURCE_MASK; - if (scancode == SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { - return 0; - } - #ifdef DEBUG_KEYBOARD printf("The '%s' key has been %s\n", SDL_GetScancodeName(scancode), state == SDL_PRESSED ? "pressed" : "released"); @@ -975,28 +971,34 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo return 0; } - /* Drop events that don't change state */ - if (state) { - if (keyboard->keystate[scancode]) { - if (!(keyboard->keysource[scancode] & source)) { - keyboard->keysource[scancode] |= source; + if (scancode != SDL_SCANCODE_UNKNOWN && scancode < SDL_NUM_SCANCODES) { + /* Drop events that don't change state */ + if (state) { + if (keyboard->keystate[scancode]) { + if (!(keyboard->keysource[scancode] & source)) { + keyboard->keysource[scancode] |= source; + return 0; + } + repeat = SDL_TRUE; + } + keyboard->keysource[scancode] |= source; + } else { + if (!keyboard->keystate[scancode]) { return 0; } - repeat = SDL_TRUE; - } - keyboard->keysource[scancode] |= source; - } else { - if (!keyboard->keystate[scancode]) { - return 0; + keyboard->keysource[scancode] = 0; } - keyboard->keysource[scancode] = 0; - } - /* Update internal keyboard state */ - keyboard->keystate[scancode] = state; + /* Update internal keyboard state */ + keyboard->keystate[scancode] = state; - if (keycode == SDLK_UNKNOWN) { - keycode = keyboard->keymap[scancode]; + if (keycode == SDLK_UNKNOWN) { + keycode = keyboard->keymap[scancode]; + } + + } else if (keycode == SDLK_UNKNOWN && rawcode == 0) { + /* Nothing to do! */ + return 0; } if (source == KEYBOARD_HARDWARE) { @@ -1070,6 +1072,7 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo event.key.keysym.scancode = scancode; event.key.keysym.sym = keycode; event.key.keysym.mod = keyboard->modstate; + event.key.keysym.raw = (Uint16)rawcode; event.key.windowID = keyboard->focus ? keyboard->focus->id : 0; event.key.which = keyboardID; posted = (SDL_PushEvent(&event) > 0); @@ -1105,43 +1108,43 @@ int SDL_SendKeyboardUnicodeKey(Uint64 timestamp, Uint32 ch) if (mod & SDL_KMOD_SHIFT) { /* If the character uses shift, press shift down */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN, SDL_PRESSED); } /* Send a keydown and keyup for the character */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, code, SDLK_UNKNOWN); - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, code, SDLK_UNKNOWN); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, code, SDLK_UNKNOWN, SDL_PRESSED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, code, SDLK_UNKNOWN, SDL_RELEASED); if (mod & SDL_KMOD_SHIFT) { /* If the character uses shift, release shift */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN, SDL_RELEASED); } return 0; } int SDL_SendVirtualKeyboardKey(Uint64 timestamp, Uint8 state, SDL_Scancode scancode) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, state, scancode, SDLK_UNKNOWN); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDLK_UNKNOWN, state); } -int SDL_SendKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode) +int SDL_SendKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, state, scancode, SDLK_UNKNOWN); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, rawcode, scancode, SDLK_UNKNOWN, state); } -int SDL_SendKeyboardKeyAndKeycode(Uint64 timestamp, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode) +int SDL_SendKeyboardKeyAndKeycode(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, Uint8 state) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, state, scancode, keycode); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, rawcode, scancode, keycode, state); } int SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, scancode, SDLK_UNKNOWN); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDLK_UNKNOWN, SDL_PRESSED); } -int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode) +int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE | KEYBOARD_IGNOREMODIFIERS, keyboardID, state, scancode, SDLK_UNKNOWN); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE | KEYBOARD_IGNOREMODIFIERS, keyboardID, rawcode, scancode, SDLK_UNKNOWN, state); } void SDL_ReleaseAutoReleaseKeys(void) @@ -1152,7 +1155,7 @@ void SDL_ReleaseAutoReleaseKeys(void) if (keyboard->autorelease_pending) { for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keysource[scancode] == KEYBOARD_AUTORELEASE) { - SDL_SendKeyboardKeyInternal(0, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, scancode, SDLK_UNKNOWN); + SDL_SendKeyboardKeyInternal(0, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDLK_UNKNOWN, SDL_RELEASED); } } keyboard->autorelease_pending = SDL_FALSE; diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 14b8dea124d76..3233b1b33a45e 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -68,13 +68,13 @@ extern int SDL_SendKeyboardUnicodeKey(Uint64 timestamp, Uint32 ch); extern int SDL_SendVirtualKeyboardKey(Uint64 timestamp, Uint8 state, SDL_Scancode scancode); /* Send a keyboard key event */ -extern int SDL_SendKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode); +extern int SDL_SendKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state); extern int SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode); -extern int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode); +extern int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state); /* This is for platforms that don't know the keymap but can report scancode and keycode directly. Most platforms should prefer to optionally call SDL_SetKeymap and then use SDL_SendKeyboardKey. */ -extern int SDL_SendKeyboardKeyAndKeycode(Uint64 timestamp, SDL_KeyboardID keyboardID, Uint8 state, SDL_Scancode scancode, SDL_Keycode keycode); +extern int SDL_SendKeyboardKeyAndKeycode(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, Uint8 state); /* Release all the autorelease keys */ extern void SDL_ReleaseAutoReleaseKeys(void); diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c index 62bac58fadec2..d2c063deeb70f 100644 --- a/src/joystick/android/SDL_sysjoystick.c +++ b/src/joystick/android/SDL_sysjoystick.c @@ -205,7 +205,7 @@ int Android_OnPadDown(int device_id, int keycode) if (item && item->joystick) { SDL_SendJoystickButton(timestamp, item->joystick, button, SDL_PRESSED); } else { - SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, button_to_scancode(button)); + SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, keycode, button_to_scancode(button), SDL_PRESSED); } SDL_UnlockJoysticks(); return 0; @@ -225,7 +225,7 @@ int Android_OnPadUp(int device_id, int keycode) if (item && item->joystick) { SDL_SendJoystickButton(timestamp, item->joystick, button, SDL_RELEASED); } else { - SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, button_to_scancode(button)); + SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, keycode, button_to_scancode(button), SDL_RELEASED); } SDL_UnlockJoysticks(); return 0; diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index 4c86c22b4bc86..45bf4021aa564 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -330,12 +330,12 @@ static SDL_Scancode TranslateKeycode(int keycode) int Android_OnKeyDown(int keycode) { - return SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_PRESSED, TranslateKeycode(keycode)); + return SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, keycode, TranslateKeycode(keycode), SDL_PRESSED); } int Android_OnKeyUp(int keycode) { - return SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_RELEASED, TranslateKeycode(keycode)); + return SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, keycode, TranslateKeycode(keycode), SDL_RELEASED); } SDL_bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this) diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 61866a413799f..5da5db1277ac5 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -231,9 +231,9 @@ static void HandleModifiers(SDL_VideoDevice *_this, SDL_Scancode code, unsigned } if (pressed) { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_PRESSED, code); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, code, SDL_PRESSED); } else { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_RELEASED, code); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, code, SDL_RELEASED); } } @@ -414,7 +414,7 @@ void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event) UpdateKeymap(data, SDL_TRUE); } - SDL_SendKeyboardKey(Cocoa_GetEventTimestamp([event timestamp]), SDL_DEFAULT_KEYBOARD_ID, SDL_PRESSED, code); + SDL_SendKeyboardKey(Cocoa_GetEventTimestamp([event timestamp]), SDL_DEFAULT_KEYBOARD_ID, scancode, code, SDL_PRESSED); #ifdef DEBUG_SCANCODES if (code == SDL_SCANCODE_UNKNOWN) { SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL forums/mailing list or to Christian Walther . Mac virtual key code is %d.\n", scancode); @@ -433,7 +433,7 @@ void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event) } break; case NSEventTypeKeyUp: - SDL_SendKeyboardKey(Cocoa_GetEventTimestamp([event timestamp]), SDL_DEFAULT_KEYBOARD_ID, SDL_RELEASED, code); + SDL_SendKeyboardKey(Cocoa_GetEventTimestamp([event timestamp]), SDL_DEFAULT_KEYBOARD_ID, scancode, code, SDL_RELEASED); break; case NSEventTypeFlagsChanged: { // see if the new modifierFlags mean any existing keys should be pressed/released... diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 452c6c4763a4b..f3a17b47686ac 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1408,8 +1408,8 @@ - (void)flagsChanged:(NSEvent *)theEvent const SDL_bool osenabled = ([theEvent modifierFlags] & NSEventModifierFlagCapsLock) ? SDL_TRUE : SDL_FALSE; const SDL_bool sdlenabled = (SDL_GetModState() & SDL_KMOD_CAPS) ? SDL_TRUE : SDL_FALSE; if (osenabled ^ sdlenabled) { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, SDL_SCANCODE_CAPSLOCK, SDL_PRESSED); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, SDL_SCANCODE_CAPSLOCK, SDL_RELEASED); } } - (void)keyDown:(NSEvent *)theEvent diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index d5edfe9b2811b..99ed3efbb738f 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -836,9 +836,7 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent } } - if (scancode != SDL_SCANCODE_UNKNOWN) { - SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED, scancode, keycode); - } + SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); /* if TEXTINPUT events are enabled we can't prevent keydown or we won't get keypress * we need to ALWAYS prevent backspace and tab otherwise chrome takes action and does bad navigation UX diff --git a/src/video/ngage/SDL_ngageevents.cpp b/src/video/ngage/SDL_ngageevents.cpp index 86deba4757404..cd82b6b4a4611 100644 --- a/src/video/ngage/SDL_ngageevents.cpp +++ b/src/video/ngage/SDL_ngageevents.cpp @@ -154,10 +154,10 @@ int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent) switch (aWsEvent.Type()) { case EEventKeyDown: /* Key events */ - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, ConvertScancode(_this, aWsEvent.Key()->iScanCode)); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, aWsEvent.Key()->iScanCode, ConvertScancode(_this, aWsEvent.Key()->iScanCode), SDL_PRESSED); break; case EEventKeyUp: /* Key events */ - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, ConvertScancode(_this, aWsEvent.Key()->iScanCode)); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, aWsEvent.Key()->iScanCode, ConvertScancode(_this, aWsEvent.Key()->iScanCode), SDL_RELEASED); break; case EEventFocusGained: /* SDL window got focus */ data->NGAGE_IsWindowFocused = ETrue; diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index 80ec27b017f95..ecc441c1ff1e3 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -90,7 +90,7 @@ void PSP_PumpEvents(SDL_VideoDevice *_this) if (changed) { for (i = 0; i < sizeof(keymap_psp) / sizeof(keymap_psp[0]); i++) { if (changed & keymap_psp[i].id) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap_psp[i].sym)); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, keymap_psp[i].id, SDL_GetScancodeFromKey(keymap_psp[i].sym), (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED); } } } @@ -113,7 +113,7 @@ void PSP_PumpEvents(SDL_VideoDevice *_this) sym.sym = keymap[raw]; /* not tested */ /* SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */ - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED, SDL_GetScancodeFromKey(keymap[raw])); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, raw, SDL_GetScancodeFromKey(keymap[raw]), (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED); } } } diff --git a/src/video/qnx/SDL_qnxkeyboard.c b/src/video/qnx/SDL_qnxkeyboard.c index 706b1fff9b05f..6b9bbf561bc7d 100644 --- a/src/video/qnx/SDL_qnxkeyboard.c +++ b/src/video/qnx/SDL_qnxkeyboard.c @@ -125,8 +125,8 @@ void handleKeyboardEvent(screen_event_t event) // FIXME: // Need to handle more key states (such as key combinations). if (val & KEY_DOWN) { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_PRESSED, scancode); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, val, scancode, SDL_PRESSED); } else { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_RELEASED, scancode); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, val, scancode, SDL_RELEASED); } } diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c index 3771fe5912b67..be05989a6720b 100644 --- a/src/video/riscos/SDL_riscosevents.c +++ b/src/video/riscos/SDL_riscosevents.c @@ -58,7 +58,7 @@ void RISCOS_PollKeyboard(SDL_VideoDevice *_this) for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) { if (driverdata->key_pressed[i] != 255) { if ((_kernel_osbyte(129, driverdata->key_pressed[i] ^ 0xff, 0xff) & 0xff) != 255) { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_RELEASED, SDL_RISCOS_translate_keycode(driverdata->key_pressed[i])); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, driverdata->key_pressed[i], SDL_RISCOS_translate_keycode(driverdata->key_pressed[i]), SDL_RELEASED); driverdata->key_pressed[i] = 255; } } @@ -81,7 +81,7 @@ void RISCOS_PollKeyboard(SDL_VideoDevice *_this) break; default: - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, SDL_PRESSED, SDL_RISCOS_translate_keycode(key)); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, key, SDL_RISCOS_translate_keycode(key), SDL_PRESSED); /* Record the press so we can detect release later. */ for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) { diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index 5ce8e6d030d1d..97a1887cb7ee9 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -181,7 +181,7 @@ static void OnGCKeyboardConnected(GCKeyboard *keyboard) API_AVAILABLE(macos(11.0 SDL_AddKeyboard(keyboardID, NULL, SDL_TRUE); keyboard.keyboardInput.keyChangedHandler = ^(GCKeyboardInput *kbrd, GCControllerButtonInput *key, GCKeyCode keyCode, BOOL pressed) { - SDL_SendKeyboardKey(0, keyboardID, pressed ? SDL_PRESSED : SDL_RELEASED, (SDL_Scancode)keyCode); + SDL_SendKeyboardKey(0, keyboardID, 0, (SDL_Scancode)keyCode, pressed ? SDL_PRESSED : SDL_RELEASED); }; dispatch_queue_t queue = dispatch_queue_create("org.libsdl.input.keyboard", DISPATCH_QUEUE_SERIAL); diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 0db9d3be4fedb..92d3dd3461bcc 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -414,7 +414,7 @@ - (void)pressesBegan:(NSSet *)presses withEvent:(UIPressesEvent *)eve if (!SDL_HasKeyboard()) { for (UIPress *press in presses) { SDL_Scancode scancode = [self scancodeFromPress:press]; - SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, scancode); + SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_PRESSED); } } if (SDL_TextInputActive()) { @@ -427,7 +427,7 @@ - (void)pressesEnded:(NSSet *)presses withEvent:(UIPressesEvent *)eve if (!SDL_HasKeyboard()) { for (UIPress *press in presses) { SDL_Scancode scancode = [self scancodeFromPress:press]; - SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, scancode); + SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); } } if (SDL_TextInputActive()) { @@ -440,7 +440,7 @@ - (void)pressesCancelled:(NSSet *)presses withEvent:(UIPressesEvent * if (!SDL_HasKeyboard()) { for (UIPress *press in presses) { SDL_Scancode scancode = [self scancodeFromPress:press]; - SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, scancode); + SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); } } if (SDL_TextInputActive()) { diff --git a/src/video/vita/SDL_vitakeyboard.c b/src/video/vita/SDL_vitakeyboard.c index 93dffc8f24979..4c5a4bea6feb8 100644 --- a/src/video/vita/SDL_vitakeyboard.c +++ b/src/video/vita/SDL_vitakeyboard.c @@ -67,40 +67,40 @@ void VITA_PollKeyboard(void) // The k_report only reports the state of the LED if (k_reports[numReports - 1].modifiers[1] & 0x1) { if (!(locks & 0x1)) { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_NUMLOCKCLEAR, SDL_PRESSED); locks |= 0x1; } } else { if (locks & 0x1) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_NUMLOCKCLEAR); - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_NUMLOCKCLEAR); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_NUMLOCKCLEAR, SDL_RELEASED); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_NUMLOCKCLEAR, SDL_PRESSED); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_NUMLOCKCLEAR, SDL_RELEASED); locks &= ~0x1; } } if (k_reports[numReports - 1].modifiers[1] & 0x2) { if (!(locks & 0x2)) { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_CAPSLOCK, SDL_PRESSED); locks |= 0x2; } } else { if (locks & 0x2) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_CAPSLOCK); - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_CAPSLOCK); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_CAPSLOCK, SDL_RELEASED); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_CAPSLOCK, SDL_PRESSED); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_CAPSLOCK, SDL_RELEASED); locks &= ~0x2; } } if (k_reports[numReports - 1].modifiers[1] & 0x4) { if (!(locks & 0x4)) { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_SCROLLLOCK); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_SCROLLLOCK, SDL_PRESSED); locks |= 0x4; } } else { if (locks & 0x4) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_SCROLLLOCK); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_SCROLLLOCK, SDL_RELEASED); locks &= ~0x4; } } @@ -110,58 +110,58 @@ void VITA_PollKeyboard(void) if (changed_modifiers & 0x01) { if (prev_modifiers & 0x01) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_LCTRL); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LCTRL, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_LCTRL); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LCTRL, SDL_PRESSED); } } if (changed_modifiers & 0x02) { if (prev_modifiers & 0x02) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LSHIFT, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LSHIFT, SDL_PRESSED); } } if (changed_modifiers & 0x04) { if (prev_modifiers & 0x04) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_LALT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LALT, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_LALT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LALT, SDL_PRESSED); } } if (changed_modifiers & 0x08) { if (prev_modifiers & 0x08) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_LGUI); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LGUI, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_LGUI); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_LGUI, SDL_PRESSED); } } if (changed_modifiers & 0x10) { if (prev_modifiers & 0x10) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_RCTRL); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RCTRL, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_RCTRL); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RCTRL, SDL_PRESSED); } } if (changed_modifiers & 0x20) { if (prev_modifiers & 0x20) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_RSHIFT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RSHIFT, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_RSHIFT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RSHIFT, SDL_PRESSED); } } if (changed_modifiers & 0x40) { if (prev_modifiers & 0x40) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_RALT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RALT, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_RALT); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RALT, SDL_PRESSED); } } if (changed_modifiers & 0x80) { if (prev_modifiers & 0x80) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, SDL_SCANCODE_RGUI); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RGUI, SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, SDL_SCANCODE_RGUI); + SDL_SendKeyboardKey(0, keyboardID, 0, SDL_SCANCODE_RGUI, SDL_PRESSED); } } } @@ -175,10 +175,10 @@ void VITA_PollKeyboard(void) if (keyCode != prev_keys[i]) { if (prev_keys[i]) { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, prev_keys[i]); + SDL_SendKeyboardKey(0, keyboardID, 0, prev_keys[i], SDL_RELEASED); } if (keyCode) { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, keyCode); + SDL_SendKeyboardKey(0, keyboardID, 0, keyCode, SDL_PRESSED); } prev_keys[i] = keyCode; } diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 378ab269cbb3f..b7f52154c83a1 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -267,7 +267,7 @@ static SDL_bool keyboard_repeat_handle(SDL_WaylandKeyboardRepeat *repeat_info, U while (elapsed >= repeat_info->next_repeat_ns) { if (repeat_info->scancode != SDL_SCANCODE_UNKNOWN) { const Uint64 timestamp = repeat_info->wl_press_time_ns + repeat_info->next_repeat_ns; - SDL_SendKeyboardKeyIgnoreModifiers(Wayland_GetEventTimestamp(timestamp), repeat_info->keyboard_id, SDL_PRESSED, repeat_info->scancode); + SDL_SendKeyboardKeyIgnoreModifiers(Wayland_GetEventTimestamp(timestamp), repeat_info->keyboard_id, repeat_info->key, repeat_info->scancode, SDL_PRESSED); } if (repeat_info->text[0]) { SDL_SendKeyboardText(repeat_info->text); @@ -1488,7 +1488,7 @@ static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, case SDLK_RGUI: case SDLK_MODE: Wayland_HandleModifierKeys(input, scancode, SDL_TRUE); - SDL_SendKeyboardKeyIgnoreModifiers(0, input->keyboard_id, SDL_PRESSED, scancode); + SDL_SendKeyboardKeyIgnoreModifiers(0, input->keyboard_id, *key, scancode, SDL_PRESSED); break; default: break; @@ -1624,7 +1624,7 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, scancode = Wayland_get_scancode_from_key(input, key + 8); Wayland_HandleModifierKeys(input, scancode, state == WL_KEYBOARD_KEY_STATE_PRESSED); - SDL_SendKeyboardKeyIgnoreModifiers(Wayland_GetKeyboardTimestamp(input, time), input->keyboard_id, state == WL_KEYBOARD_KEY_STATE_PRESSED ? SDL_PRESSED : SDL_RELEASED, scancode); + SDL_SendKeyboardKeyIgnoreModifiers(Wayland_GetKeyboardTimestamp(input, time), input->keyboard_id, key, scancode, state == WL_KEYBOARD_KEY_STATE_PRESSED ? SDL_PRESSED : SDL_RELEASED); if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { if (has_text && !(SDL_GetModState() & SDL_KMOD_CTRL)) { diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 6715178292e3b..b372e245ebf10 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -155,7 +155,7 @@ static Uint64 WIN_GetEventTimestamp() return timestamp; } -static SDL_Scancode WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam, SDL_bool *virtual_key) +static SDL_Scancode WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam, Uint16 *rawcode, SDL_bool *virtual_key) { SDL_Scancode code; Uint8 index; @@ -194,6 +194,7 @@ static SDL_Scancode WindowsScanCodeToSDLScanCode(LPARAM lParam, WPARAM wParam, S /* Pack scan code into one byte to make the index. */ index = LOBYTE(scanCode) | (HIBYTE(scanCode) ? 0x80 : 0x00); code = windows_scancode_table[index]; + *rawcode = scanCode; return code; } @@ -487,11 +488,11 @@ WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) if (wParam == WM_KEYDOWN || wParam == WM_SYSKEYDOWN) { if (!data->raw_keyboard_enabled) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, scanCode); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, hookData->scanCode, scanCode, SDL_PRESSED); } } else { if (!data->raw_keyboard_enabled) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, scanCode); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, hookData->scanCode, scanCode, SDL_RELEASED); } /* If the key was down prior to our hook being installed, allow the @@ -687,9 +688,25 @@ static void WIN_HandleRawKeyboardInput(Uint64 timestamp, SDL_VideoData *data, HA return; } + if ((rawkeyboard->Flags & RI_KEY_E0) && rawkeyboard->MakeCode == 0x2A) { + // 0xE02A make code prefix, ignored + return; + } + +#if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) + if (!rawkeyboard->MakeCode) { + rawkeyboard->MakeCode = LOWORD(MapVirtualKey(rawkeyboard->VKey, WIN_IsWindowsXP() ? MAPVK_VK_TO_VSC : MAPVK_VK_TO_VSC_EX)); + } +#endif + if (!rawkeyboard->MakeCode) { + return; + } + Uint8 state = (rawkeyboard->Flags & RI_KEY_BREAK) ? SDL_RELEASED : SDL_PRESSED; SDL_Scancode code; + USHORT rawcode = rawkeyboard->MakeCode; if (data->pending_E1_key_sequence) { + rawcode |= 0xE100; if (rawkeyboard->MakeCode == 0x45) { // Ctrl+NumLock == Pause code = SDL_SCANCODE_PAUSE; @@ -702,6 +719,7 @@ static void WIN_HandleRawKeyboardInput(Uint64 timestamp, SDL_VideoData *data, HA // The code is in the lower 7 bits, the high bit is set for the E0 prefix Uint8 index = (Uint8)rawkeyboard->MakeCode; if (rawkeyboard->Flags & RI_KEY_E0) { + rawcode |= 0xE000; index |= 0x80; } code = windows_scancode_table[index]; @@ -709,7 +727,8 @@ static void WIN_HandleRawKeyboardInput(Uint64 timestamp, SDL_VideoData *data, HA if (state && !SDL_GetKeyboardFocus()) { return; } - SDL_SendKeyboardKey(timestamp, keyboardID, state, code); + + SDL_SendKeyboardKey(timestamp, keyboardID, rawcode, code, state); } void WIN_PollRawInput(SDL_VideoDevice *_this) @@ -1213,7 +1232,8 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } SDL_bool virtual_key = SDL_FALSE; - SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &virtual_key); + Uint16 rawcode = 0; + SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &rawcode, &virtual_key); const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); /* Detect relevant keyboard shortcuts */ @@ -1224,8 +1244,8 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } } - if ((virtual_key || !data->videodata->raw_keyboard_enabled) && code != SDL_SCANCODE_UNKNOWN) { - SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, code); + if (virtual_key || !data->videodata->raw_keyboard_enabled) { + SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, rawcode, code, SDL_PRESSED); } } @@ -1241,15 +1261,16 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } SDL_bool virtual_key = SDL_FALSE; - SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &virtual_key); + Uint16 rawcode = 0; + SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &rawcode, &virtual_key); const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); - if ((virtual_key || !data->videodata->raw_keyboard_enabled) && code != SDL_SCANCODE_UNKNOWN) { + if (virtual_key || !data->videodata->raw_keyboard_enabled) { if (code == SDL_SCANCODE_PRINTSCREEN && keyboardState[code] == SDL_RELEASED) { - SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, code); + SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, rawcode, code, SDL_PRESSED); } - SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, code); + SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, rawcode, code, SDL_RELEASED); } } returnCode = 0; @@ -2251,10 +2272,10 @@ void WIN_PumpEvents(SDL_VideoDevice *_this) and if we think a key is pressed when Windows doesn't, unstick it in SDL's state. */ keystate = SDL_GetKeyboardState(NULL); if ((keystate[SDL_SCANCODE_LSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_LSHIFT) & 0x8000)) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_LSHIFT); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDL_RELEASED); } if ((keystate[SDL_SCANCODE_RSHIFT] == SDL_PRESSED) && !(GetKeyState(VK_RSHIFT) & 0x8000)) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_RSHIFT); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_RSHIFT, SDL_RELEASED); } /* The Windows key state gets lost when using Windows+Space or Windows+G shortcuts and @@ -2263,10 +2284,10 @@ void WIN_PumpEvents(SDL_VideoDevice *_this) focusWindow = SDL_GetKeyboardFocus(); if (!focusWindow || !(focusWindow->flags & SDL_WINDOW_KEYBOARD_GRABBED)) { if ((keystate[SDL_SCANCODE_LGUI] == SDL_PRESSED) && !(GetKeyState(VK_LWIN) & 0x8000)) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_LGUI); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LGUI, SDL_RELEASED); } if ((keystate[SDL_SCANCODE_RGUI] == SDL_PRESSED) && !(GetKeyState(VK_RWIN) & 0x8000)) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, SDL_SCANCODE_RGUI); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_RGUI, SDL_RELEASED); } } diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp index 28013413a1b32..d5f9a6e832b7d 100644 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/src/video/winrt/SDL_winrtkeyboard.cpp @@ -36,7 +36,7 @@ extern "C" { #include "SDL_winrtvideo_cpp.h" -static SDL_Scancode WINRT_TranslateKeycode(Windows::System::VirtualKey virtualKey, const Windows::UI::Core::CorePhysicalKeyStatus& keyStatus) +static SDL_Scancode WINRT_TranslateKeycode(Windows::System::VirtualKey virtualKey, const Windows::UI::Core::CorePhysicalKeyStatus& keyStatus, Uint16 *rawcode) { SDL_Scancode code; Uint8 index; @@ -52,6 +52,7 @@ static SDL_Scancode WINRT_TranslateKeycode(Windows::System::VirtualKey virtualKe /* Pack scan code into one byte to make the index. */ index = LOBYTE(scanCode) | (HIBYTE(scanCode) ? 0x80 : 0x00); code = windows_scancode_table[index]; + *rawcode = scanCode; return code; } @@ -62,6 +63,7 @@ void WINRT_ProcessAcceleratorKeyActivated(Windows::UI::Core::AcceleratorKeyEvent Uint8 state; SDL_Scancode code; + Uint16 rawcode = 0; switch (args->EventType) { case CoreAcceleratorKeyEventType::SystemKeyDown: @@ -76,8 +78,8 @@ void WINRT_ProcessAcceleratorKeyActivated(Windows::UI::Core::AcceleratorKeyEvent return; } - code = WINRT_TranslateKeycode(args->VirtualKey, args->KeyStatus); - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, state, code); + code = WINRT_TranslateKeycode(args->VirtualKey, args->KeyStatus, &rawcode); + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, rawcode, code, state); } void WINRT_ProcessCharacterReceivedEvent(SDL_Window *window, Windows::UI::Core::CharacterReceivedEventArgs ^ args) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 5f7bf97c35bd7..8f2f66e84236d 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -438,13 +438,13 @@ void X11_ReconcileKeyboardState(SDL_VideoDevice *_this) case SDLK_LGUI: case SDLK_RGUI: case SDLK_MODE: - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, scancode); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, keycode, scancode, SDL_PRESSED); break; default: break; } } else if (!x11KeyPressed && sdlKeyPressed) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, scancode); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, keycode, scancode, SDL_RELEASED); } } } @@ -907,9 +907,9 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_ videodata->filter_time = xevent->xkey.time; if (orig_event_type == KeyPress) { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, scancode); + SDL_SendKeyboardKey(0, keyboardID, orig_keycode, scancode, SDL_PRESSED); } else { - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, scancode); + SDL_SendKeyboardKey(0, keyboardID, orig_keycode, scancode, SDL_RELEASED); } #endif return; @@ -935,7 +935,7 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_ if (xevent->type == KeyPress) { /* Don't send the key if it looks like a duplicate of a filtered key sent by an IME */ if (xevent->xkey.keycode != videodata->filter_code || xevent->xkey.time != videodata->filter_time) { - SDL_SendKeyboardKey(0, keyboardID, SDL_PRESSED, videodata->key_layout[keycode]); + SDL_SendKeyboardKey(0, keyboardID, keycode, videodata->key_layout[keycode], SDL_PRESSED); } if (*text) { text[text_length] = '\0'; @@ -946,7 +946,7 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_ /* We're about to get a repeated key down, ignore the key up */ return; } - SDL_SendKeyboardKey(0, keyboardID, SDL_RELEASED, videodata->key_layout[keycode]); + SDL_SendKeyboardKey(0, keyboardID, keycode, videodata->key_layout[keycode], SDL_RELEASED); } } diff --git a/test/checkkeys.c b/test/checkkeys.c index 278365bb4ae5e..f89a91c86cfcc 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -121,16 +121,18 @@ PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) /* Print the keycode, name and state */ if (sym->sym) { print_string(&spot, &left, - "Key %s: scancode %d = %s, keycode 0x%08X = %s ", + "Key %s: raw 0x%.2x, scancode %d = %s, keycode 0x%08X = %s ", pressed ? "pressed " : "released", + sym->raw, sym->scancode, - SDL_GetScancodeName(sym->scancode), + sym->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(sym->scancode), sym->sym, SDL_GetKeyName(sym->sym)); } else { print_string(&spot, &left, - "Unknown Key (scancode %d = %s) %s ", + "Unknown Key (raw 0x%.2x, scancode %d = %s) %s ", + sym->raw, sym->scancode, - SDL_GetScancodeName(sym->scancode), + sym->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(sym->scancode), pressed ? "pressed " : "released"); } print_modifiers(&spot, &left); From 679e4471ed0d766bffff3645e87ac69fe399d4ae Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 19 Jun 2024 15:00:12 -0700 Subject: [PATCH 012/431] Added the ability to query the keymap for keycodes based on modifier state --- VisualC-GDK/SDL/SDL.vcxproj | 2 + VisualC-GDK/SDL/SDL.vcxproj.filters | 2 + VisualC-WinRT/SDL-UWP.vcxproj | 2 + VisualC-WinRT/SDL-UWP.vcxproj.filters | 6 + VisualC/SDL/SDL.vcxproj | 2 + VisualC/SDL/SDL.vcxproj.filters | 6 + Xcode/SDL/SDL.xcodeproj/project.pbxproj | 8 + docs/README-migration.md | 2 + include/SDL3/SDL_events.h | 8 +- include/SDL3/SDL_keyboard.h | 48 +- include/SDL3/SDL_keycode.h | 32 +- src/SDL_hashtable.c | 9 +- src/SDL_hashtable.h | 1 + src/SDL_utils.c | 25 + src/SDL_utils_c.h | 2 + src/dynapi/SDL_dynapi.sym | 2 + src/dynapi/SDL_dynapi_overrides.h | 2 + src/dynapi/SDL_dynapi_procs.h | 8 +- src/events/SDL_keyboard.c | 867 +----------------------- src/events/SDL_keyboard_c.h | 19 +- src/events/SDL_keymap.c | 716 +++++++++++++++++++ src/events/SDL_keymap_c.h | 37 + src/events/scancodes_ascii.h | 165 ----- src/video/cocoa/SDL_cocoakeyboard.m | 61 +- src/video/haiku/SDL_bkeyboard.cc | 217 +++--- src/video/ngage/SDL_ngageevents.cpp | 50 +- src/video/psp/SDL_pspevents.c | 226 +++--- src/video/vita/SDL_vitavideo.c | 6 +- src/video/wayland/SDL_waylandevents.c | 14 +- src/video/windows/SDL_windowskeyboard.c | 98 ++- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11keyboard.c | 31 +- test/checkkeys.c | 126 +++- test/testautomation_keyboard.c | 19 +- 34 files changed, 1400 insertions(+), 1421 deletions(-) create mode 100644 src/events/SDL_keymap.c create mode 100644 src/events/SDL_keymap_c.h delete mode 100644 src/events/scancodes_ascii.h diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 057cb1c331ae9..82a5aaae01495 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -414,6 +414,7 @@ + @@ -634,6 +635,7 @@ + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 9ac9cd48fe5e4..91684485f4fa2 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -47,6 +47,7 @@ + @@ -326,6 +327,7 @@ + diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index ac172fb96456a..0231e2dd03a3a 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -119,6 +119,7 @@ + @@ -320,6 +321,7 @@ + diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index 8447d95db2bc3..7112f2f9cc378 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -273,6 +273,9 @@ Source Files + + Source Files + Source Files @@ -585,6 +588,9 @@ Source Files + + Source Files + Source Files diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 0164338ee5ba3..a9849a3a53957 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -338,6 +338,7 @@ + @@ -524,6 +525,7 @@ + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 17838de16a1dd..448bf3e4e49a5 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -507,6 +507,9 @@ events + + events + events @@ -1000,6 +1003,9 @@ events + + events + events diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 40e6effe10725..43ebab04d0429 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -386,6 +386,8 @@ F310138D2C1F2CB700FBE946 /* SDL_getenv_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F310138A2C1F2CB700FBE946 /* SDL_getenv_c.h */; }; F310138E2C1F2CB700FBE946 /* SDL_random.c in Sources */ = {isa = PBXBuildFile; fileRef = F310138B2C1F2CB700FBE946 /* SDL_random.c */; }; F310138F2C1F2CB700FBE946 /* SDL_sysstdlib.h in Headers */ = {isa = PBXBuildFile; fileRef = F310138C2C1F2CB700FBE946 /* SDL_sysstdlib.h */; }; + F31013C72C24E98200FBE946 /* SDL_keymap.c in Sources */ = {isa = PBXBuildFile; fileRef = F31013C52C24E98200FBE946 /* SDL_keymap.c */; }; + F31013C82C24E98200FBE946 /* SDL_keymap_c.h in Headers */ = {isa = PBXBuildFile; fileRef = F31013C62C24E98200FBE946 /* SDL_keymap_c.h */; }; F316ABD82B5C3185002EF551 /* SDL_memset.c in Sources */ = {isa = PBXBuildFile; fileRef = F316ABD62B5C3185002EF551 /* SDL_memset.c */; }; F316ABD92B5C3185002EF551 /* SDL_memcpy.c in Sources */ = {isa = PBXBuildFile; fileRef = F316ABD72B5C3185002EF551 /* SDL_memcpy.c */; }; F316ABDB2B5CA721002EF551 /* SDL_memmove.c in Sources */ = {isa = PBXBuildFile; fileRef = F316ABDA2B5CA721002EF551 /* SDL_memmove.c */; }; @@ -915,6 +917,8 @@ F310138A2C1F2CB700FBE946 /* SDL_getenv_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_getenv_c.h; sourceTree = ""; }; F310138B2C1F2CB700FBE946 /* SDL_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_random.c; sourceTree = ""; }; F310138C2C1F2CB700FBE946 /* SDL_sysstdlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_sysstdlib.h; sourceTree = ""; }; + F31013C52C24E98200FBE946 /* SDL_keymap.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_keymap.c; sourceTree = ""; }; + F31013C62C24E98200FBE946 /* SDL_keymap_c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_keymap_c.h; sourceTree = ""; }; F316ABD62B5C3185002EF551 /* SDL_memset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_memset.c; sourceTree = ""; }; F316ABD72B5C3185002EF551 /* SDL_memcpy.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_memcpy.c; sourceTree = ""; }; F316ABDA2B5CA721002EF551 /* SDL_memmove.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_memmove.c; sourceTree = ""; }; @@ -2183,6 +2187,8 @@ A7D8A93523E2514000DCD162 /* SDL_events.c */, A7D8A93D23E2514000DCD162 /* SDL_keyboard_c.h */, A7D8A93823E2514000DCD162 /* SDL_keyboard.c */, + F31013C62C24E98200FBE946 /* SDL_keymap_c.h */, + F31013C52C24E98200FBE946 /* SDL_keymap.c */, A7D8A92B23E2514000DCD162 /* SDL_mouse_c.h */, A7D8A92A23E2514000DCD162 /* SDL_mouse.c */, 63134A232A7902FD0021E9A6 /* SDL_pen_c.h */, @@ -2422,6 +2428,7 @@ F3F7D9392933074E00816151 /* SDL_opengles2_gl2ext.h in Headers */, F3F7D9692933074E00816151 /* SDL_opengles2_gl2platform.h in Headers */, F3F7D9092933074E00816151 /* SDL_opengles2_khrplatform.h in Headers */, + F31013C82C24E98200FBE946 /* SDL_keymap_c.h in Headers */, 63134A222A7902CF0021E9A6 /* SDL_pen.h in Headers */, 63134A252A7902FD0021E9A6 /* SDL_pen_c.h in Headers */, F36C34312C0F876500991150 /* SDL_offscreenvulkan.h in Headers */, @@ -2675,6 +2682,7 @@ A7D8BAC723E2514500DCD162 /* e_pow.c in Sources */, A7D8B41C23E2514300DCD162 /* SDL_systls.c in Sources */, 9846B07C287A9020000C35C8 /* SDL_hidapi_shield.c in Sources */, + F31013C72C24E98200FBE946 /* SDL_keymap.c in Sources */, A7D8BBD923E2574800DCD162 /* SDL_uikitmessagebox.m in Sources */, F32DDAD42AB795A30041EAA5 /* SDL_audioresample.c in Sources */, F3FA5A212B59ACE000FEAD97 /* yuv_rgb_std.c in Sources */, diff --git a/docs/README-migration.md b/docs/README-migration.md index a2ca542d15f4a..6420dacd6cc18 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -890,6 +890,8 @@ The following symbols have been removed: Text input is no longer automatically enabled when initializing video, you should call SDL_StartTextInput() when you want to receive text input and call SDL_StopTextInput() when you are done. Starting text input may shown an input method editor (IME) and cause key up/down events to be skipped, so should only be enabled when the application wants text input. +SDL_GetDefaultKeyFromScancode(), SDL_GetKeyFromScancode(), and SDL_GetScancodeFromKey() take an SDL_Keymod parameter and use that to provide the correct result based on keyboard modifier state. + The following functions have been renamed: * SDL_IsScreenKeyboardShown() => SDL_ScreenKeyboardShown() * SDL_IsTextInputActive() => SDL_TextInputActive() diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index d578cdd93fdf7..6fe1c77ec27be 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -316,8 +316,7 @@ typedef struct SDL_KeyboardEvent /** * Keyboard text editing event structure (event.edit.*) * - * The `text` is owned by SDL and should be copied if the application wants to - * hold onto it beyond the scope of handling this event. + * The text string follows the SDL_GetStringRule. * * \since This struct is available since SDL 3.0.0. */ @@ -335,8 +334,7 @@ typedef struct SDL_TextEditingEvent /** * Keyboard text input event structure (event.text.*) * - * The `text` is owned by SDL and should be copied if the application wants to - * hold onto it beyond the scope of handling this event. + * The text string follows the SDL_GetStringRule. * * This event will never be delivered unless text input is enabled by calling * SDL_StartTextInput(). Text input is disabled by default! @@ -733,7 +731,7 @@ typedef struct SDL_PenButtonEvent * An event used to drop text or request a file open by the system * (event.drop.*) * - * The `source` and `data` are owned by SDL and should be copied if the application wants to hold onto them beyond the scope of handling this event. + * The source and data strings follow the SDL_GetStringRule. * * \since This struct is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index ffa15949504c6..9e17a5d175f3f 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -211,6 +211,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); * See SDL_Keycode for details. * * \param scancode the desired SDL_Scancode to query. + * \param modstate the modifier state to use when translating the scancode to a keycode. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. @@ -218,7 +219,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); /** * Get the key code corresponding to the given scancode according to the @@ -227,35 +228,67 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scanco * See SDL_Keycode for details. * * \param scancode the desired SDL_Scancode to query. + * \param modstate the modifier state to use when translating the scancode to a keycode. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetDefaultKeyFromScancode * \sa SDL_GetKeyName * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode); +extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); + +/** + * Get the scancode corresponding to the given key code according to a default en_US keyboard layout. + * + * Note that there may be multiple scancode+modifier states that can generate this keycode, this will just return the first one found. + * + * \param key the desired SDL_Keycode to query. + * \param modstate a pointer to the modifier state that would be used when the scancode generates this key, may be NULL. + * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetScancodeFromKey + * \sa SDL_GetScancodeName + */ +extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); /** * Get the scancode corresponding to the given key code according to the * current keyboard layout. * - * See SDL_Scancode for details. + * Note that there may be multiple scancode+modifier states that can generate this keycode, this will just return the first one found. * * \param key the desired SDL_Keycode to query. + * \param modstate a pointer to the modifier state that would be used when the scancode generates this key, may be NULL. * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. * * \since This function is available since SDL 3.0.0. * + * \sa SDL_GetDefaultScancodeFromKey * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeName */ -extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key); +extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate); /** - * Get a human-readable name for a scancode. + * Set a human-readable name for a scancode. + * + * \param scancode the desired SDL_Scancode. + * \param name the name to use for the scancode, encoded as UTF-8. The string is not copied, so the pointer given to this function must stay valid while SDL is being used. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. * - * See SDL_Scancode for details. + * \sa SDL_GetScancodeName + */ +extern SDL_DECLSPEC int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const char *name); + +/** + * Get a human-readable name for a scancode. * * The returned string follows the SDL_GetStringRule. * @@ -276,6 +309,7 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key) * * \sa SDL_GetScancodeFromKey * \sa SDL_GetScancodeFromName + * \sa SDL_SetScancodeName */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); @@ -297,8 +331,6 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * See SDL_Scancode and SDL_Keycode for details. - * * The returned string follows the SDL_GetStringRule. * * \param key the desired SDL_Keycode to query. diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index 26c03da20c8d5..257b36e5bd96d 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -88,6 +88,32 @@ typedef Uint32 SDL_Keycode; #define SDLK_GREATER '>' #define SDLK_QUESTION '?' #define SDLK_AT '@' +#define SDLK_A 'A' +#define SDLK_B 'B' +#define SDLK_C 'C' +#define SDLK_D 'D' +#define SDLK_E 'E' +#define SDLK_F 'F' +#define SDLK_G 'G' +#define SDLK_H 'H' +#define SDLK_I 'I' +#define SDLK_J 'J' +#define SDLK_K 'K' +#define SDLK_L 'L' +#define SDLK_M 'M' +#define SDLK_N 'N' +#define SDLK_O 'O' +#define SDLK_P 'P' +#define SDLK_Q 'Q' +#define SDLK_R 'R' +#define SDLK_S 'S' +#define SDLK_T 'T' +#define SDLK_U 'U' +#define SDLK_V 'V' +#define SDLK_W 'W' +#define SDLK_X 'X' +#define SDLK_Y 'Y' +#define SDLK_Z 'Z' #define SDLK_LEFTBRACKET '[' #define SDLK_BACKSLASH '\\' #define SDLK_RIGHTBRACKET ']' @@ -120,6 +146,11 @@ typedef Uint32 SDL_Keycode; #define SDLK_x 'x' #define SDLK_y 'y' #define SDLK_z 'z' +#define SDLK_LEFTBRACE '{' +#define SDLK_PIPE '|' +#define SDLK_RIGHTBRACE '}' +#define SDLK_TILDE '~' +#define SDLK_DELETE '\x7F' #define SDLK_CAPSLOCK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK) #define SDLK_F1 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1) #define SDLK_F2 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2) @@ -139,7 +170,6 @@ typedef Uint32 SDL_Keycode; #define SDLK_INSERT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT) #define SDLK_HOME SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME) #define SDLK_PAGEUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP) -#define SDLK_DELETE '\x7F' #define SDLK_END SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END) #define SDLK_PAGEDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN) #define SDLK_RIGHT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT) diff --git a/src/SDL_hashtable.c b/src/SDL_hashtable.c index 60488ed18be97..fc7a44791c9a4 100644 --- a/src/SDL_hashtable.c +++ b/src/SDL_hashtable.c @@ -241,7 +241,7 @@ SDL_bool SDL_HashTableEmpty(SDL_HashTable *table) return SDL_TRUE; } -void SDL_DestroyHashTable(SDL_HashTable *table) +void SDL_EmptyHashTable(SDL_HashTable *table) { if (table) { void *data = table->data; @@ -257,8 +257,15 @@ void SDL_DestroyHashTable(SDL_HashTable *table) SDL_free(item); item = next; } + table->table[i] = NULL; } + } +} +void SDL_DestroyHashTable(SDL_HashTable *table) +{ + if (table) { + SDL_EmptyHashTable(table); SDL_free(table->table); SDL_free(table); } diff --git a/src/SDL_hashtable.h b/src/SDL_hashtable.h index 96614bc17d7bd..ef0945ee0c47b 100644 --- a/src/SDL_hashtable.h +++ b/src/SDL_hashtable.h @@ -36,6 +36,7 @@ SDL_HashTable *SDL_CreateHashTable(void *data, const SDL_HashTable_NukeFn nukefn, const SDL_bool stackable); +void SDL_EmptyHashTable(SDL_HashTable *table); void SDL_DestroyHashTable(SDL_HashTable *table); SDL_bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const void *value); SDL_bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key); diff --git a/src/SDL_utils.c b/src/SDL_utils.c index 222cf49a3ed13..0aaa3dc391bc3 100644 --- a/src/SDL_utils.c +++ b/src/SDL_utils.c @@ -101,6 +101,31 @@ SDL_bool SDL_endswith(const char *string, const char *suffix) return SDL_FALSE; } +char *SDL_UCS4ToUTF8(Uint32 ch, char *dst) +{ + Uint8 *p = (Uint8 *)dst; + if (ch <= 0x7F) { + *p = (Uint8)ch; + ++dst; + } else if (ch <= 0x7FF) { + p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F); + p[1] = 0x80 | (Uint8)(ch & 0x3F); + dst += 2; + } else if (ch <= 0xFFFF) { + p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F); + p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F); + p[2] = 0x80 | (Uint8)(ch & 0x3F); + dst += 3; + } else { + 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; + } + return dst; +} + /* Assume we can wrap SDL_AtomicInt values and cast to Uint32 */ SDL_COMPILE_TIME_ASSERT(sizeof_object_id, sizeof(int) == sizeof(Uint32)); diff --git a/src/SDL_utils_c.h b/src/SDL_utils_c.h index 35d8543e8a04f..fb83c30be9ef8 100644 --- a/src/SDL_utils_c.h +++ b/src/SDL_utils_c.h @@ -32,6 +32,8 @@ extern void SDL_CalculateFraction(float x, int *numerator, int *denominator); extern SDL_bool SDL_endswith(const char *string, const char *suffix); +extern char *SDL_UCS4ToUTF8(Uint32 ch, char *dst); + typedef enum { SDL_OBJECT_TYPE_UNKNOWN, diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 56a0041d4bdab..070835992ebca 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -210,6 +210,7 @@ SDL3_0.0.0 { SDL_GetDefaultAssertionHandler; SDL_GetDefaultCursor; SDL_GetDefaultKeyFromScancode; + SDL_GetDefaultScancodeFromKey; SDL_GetDesktopDisplayMode; SDL_GetDisplayBounds; SDL_GetDisplayContentScale; @@ -732,6 +733,7 @@ SDL3_0.0.0 { SDL_SetRenderTarget; SDL_SetRenderVSync; SDL_SetRenderViewport; + SDL_SetScancodeName; SDL_SetStringProperty; SDL_SetSurfaceAlphaMod; SDL_SetSurfaceBlendMode; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 3c8b756f64c81..9b3d0aed2e383 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -235,6 +235,7 @@ #define SDL_GetDefaultAssertionHandler SDL_GetDefaultAssertionHandler_REAL #define SDL_GetDefaultCursor SDL_GetDefaultCursor_REAL #define SDL_GetDefaultKeyFromScancode SDL_GetDefaultKeyFromScancode_REAL +#define SDL_GetDefaultScancodeFromKey SDL_GetDefaultScancodeFromKey_REAL #define SDL_GetDesktopDisplayMode SDL_GetDesktopDisplayMode_REAL #define SDL_GetDisplayBounds SDL_GetDisplayBounds_REAL #define SDL_GetDisplayContentScale SDL_GetDisplayContentScale_REAL @@ -757,6 +758,7 @@ #define SDL_SetRenderTarget SDL_SetRenderTarget_REAL #define SDL_SetRenderVSync SDL_SetRenderVSync_REAL #define SDL_SetRenderViewport SDL_SetRenderViewport_REAL +#define SDL_SetScancodeName SDL_SetScancodeName_REAL #define SDL_SetStringProperty SDL_SetStringProperty_REAL #define SDL_SetSurfaceAlphaMod SDL_SetSurfaceAlphaMod_REAL #define SDL_SetSurfaceBlendMode SDL_SetSurfaceBlendMode_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index dd042001c461e..09cc85694a0ce 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -254,7 +254,8 @@ SDL_DYNAPI_PROC(int,SDL_GetDayOfYear,(int a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetDaysInMonth,(int a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetDefaultAssertionHandler,(void),(),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetDefaultCursor,(void),(),return) -SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetDefaultKeyFromScancode,(SDL_Scancode a),(a),return) +SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetDefaultKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) +SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetDefaultScancodeFromKey,(SDL_Keycode a, SDL_Keymod *b),(a,b),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetDesktopDisplayMode,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetDisplayBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetDisplayContentScale,(SDL_DisplayID a),(a),return) @@ -364,7 +365,7 @@ SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickType,(SDL_Joystick *a),(a),retur SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetJoysticks,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a),(a),return) +SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyName,(SDL_Keycode a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardInstanceName,(SDL_KeyboardID a),(a),return) @@ -451,7 +452,7 @@ SDL_DYNAPI_PROC(const char *,SDL_GetRendererName,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetRendererProperties,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetRevision,(void),(),return) SDL_DYNAPI_PROC(size_t,SDL_GetSIMDAlignment,(void),(),return) -SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromKey,(SDL_Keycode a),(a),return) +SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromKey,(SDL_Keycode a, SDL_Keymod *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetScancodeName,(SDL_Scancode a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetSemaphoreValue,(SDL_Semaphore *a),(a),return) @@ -767,6 +768,7 @@ SDL_DYNAPI_PROC(int,SDL_SetRenderScale,(SDL_Renderer *a, float b, float c),(a,b, SDL_DYNAPI_PROC(int,SDL_SetRenderTarget,(SDL_Renderer *a, SDL_Texture *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetRenderVSync,(SDL_Renderer *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetRenderViewport,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_SetScancodeName,(SDL_Scancode a, const char *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetStringProperty,(SDL_PropertiesID a, const char *b, const char *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceAlphaMod,(SDL_Surface *a, Uint8 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode b),(a,b),return) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 3492adc8c7b14..2bfc2cda7e10e 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -23,8 +23,8 @@ /* General keyboard handling code for SDL */ #include "SDL_events_c.h" +#include "SDL_keymap_c.h" #include "../video/SDL_sysvideo.h" -#include "scancodes_ascii.h" /* #define DEBUG_KEYBOARD */ @@ -53,7 +53,7 @@ typedef struct SDL_Keyboard SDL_Keymod modstate; Uint8 keysource[SDL_NUM_SCANCODES]; Uint8 keystate[SDL_NUM_SCANCODES]; - SDL_Keycode keymap[SDL_NUM_SCANCODES]; + SDL_Keymap *keymap; SDL_bool autorelease_pending; Uint64 hardware_timestamp; } SDL_Keyboard; @@ -62,625 +62,9 @@ static SDL_Keyboard SDL_keyboard; static int SDL_keyboard_count; static SDL_KeyboardInstance *SDL_keyboards; -static const SDL_Keycode SDL_default_keymap[SDL_NUM_SCANCODES] = { - /* 0 */ SDLK_UNKNOWN, - /* 1 */ SDLK_UNKNOWN, - /* 2 */ SDLK_UNKNOWN, - /* 3 */ SDLK_UNKNOWN, - /* 4 */ 'a', - /* 5 */ 'b', - /* 6 */ 'c', - /* 7 */ 'd', - /* 8 */ 'e', - /* 9 */ 'f', - /* 10 */ 'g', - /* 11 */ 'h', - /* 12 */ 'i', - /* 13 */ 'j', - /* 14 */ 'k', - /* 15 */ 'l', - /* 16 */ 'm', - /* 17 */ 'n', - /* 18 */ 'o', - /* 19 */ 'p', - /* 20 */ 'q', - /* 21 */ 'r', - /* 22 */ 's', - /* 23 */ 't', - /* 24 */ 'u', - /* 25 */ 'v', - /* 26 */ 'w', - /* 27 */ 'x', - /* 28 */ 'y', - /* 29 */ 'z', - /* 30 */ '1', - /* 31 */ '2', - /* 32 */ '3', - /* 33 */ '4', - /* 34 */ '5', - /* 35 */ '6', - /* 36 */ '7', - /* 37 */ '8', - /* 38 */ '9', - /* 39 */ '0', - /* 40 */ SDLK_RETURN, - /* 41 */ SDLK_ESCAPE, - /* 42 */ SDLK_BACKSPACE, - /* 43 */ SDLK_TAB, - /* 44 */ SDLK_SPACE, - /* 45 */ '-', - /* 46 */ '=', - /* 47 */ '[', - /* 48 */ ']', - /* 49 */ '\\', - /* 50 */ '#', - /* 51 */ ';', - /* 52 */ '\'', - /* 53 */ '`', - /* 54 */ ',', - /* 55 */ '.', - /* 56 */ '/', - /* 57 */ SDLK_CAPSLOCK, - /* 58 */ SDLK_F1, - /* 59 */ SDLK_F2, - /* 60 */ SDLK_F3, - /* 61 */ SDLK_F4, - /* 62 */ SDLK_F5, - /* 63 */ SDLK_F6, - /* 64 */ SDLK_F7, - /* 65 */ SDLK_F8, - /* 66 */ SDLK_F9, - /* 67 */ SDLK_F10, - /* 68 */ SDLK_F11, - /* 69 */ SDLK_F12, - /* 70 */ SDLK_PRINTSCREEN, - /* 71 */ SDLK_SCROLLLOCK, - /* 72 */ SDLK_PAUSE, - /* 73 */ SDLK_INSERT, - /* 74 */ SDLK_HOME, - /* 75 */ SDLK_PAGEUP, - /* 76 */ SDLK_DELETE, - /* 77 */ SDLK_END, - /* 78 */ SDLK_PAGEDOWN, - /* 79 */ SDLK_RIGHT, - /* 80 */ SDLK_LEFT, - /* 81 */ SDLK_DOWN, - /* 82 */ SDLK_UP, - /* 83 */ SDLK_NUMLOCKCLEAR, - /* 84 */ SDLK_KP_DIVIDE, - /* 85 */ SDLK_KP_MULTIPLY, - /* 86 */ SDLK_KP_MINUS, - /* 87 */ SDLK_KP_PLUS, - /* 88 */ SDLK_KP_ENTER, - /* 89 */ SDLK_KP_1, - /* 90 */ SDLK_KP_2, - /* 91 */ SDLK_KP_3, - /* 92 */ SDLK_KP_4, - /* 93 */ SDLK_KP_5, - /* 94 */ SDLK_KP_6, - /* 95 */ SDLK_KP_7, - /* 96 */ SDLK_KP_8, - /* 97 */ SDLK_KP_9, - /* 98 */ SDLK_KP_0, - /* 99 */ SDLK_KP_PERIOD, - /* 100 */ SDLK_UNKNOWN, - /* 101 */ SDLK_APPLICATION, - /* 102 */ SDLK_POWER, - /* 103 */ SDLK_KP_EQUALS, - /* 104 */ SDLK_F13, - /* 105 */ SDLK_F14, - /* 106 */ SDLK_F15, - /* 107 */ SDLK_F16, - /* 108 */ SDLK_F17, - /* 109 */ SDLK_F18, - /* 110 */ SDLK_F19, - /* 111 */ SDLK_F20, - /* 112 */ SDLK_F21, - /* 113 */ SDLK_F22, - /* 114 */ SDLK_F23, - /* 115 */ SDLK_F24, - /* 116 */ SDLK_EXECUTE, - /* 117 */ SDLK_HELP, - /* 118 */ SDLK_MENU, - /* 119 */ SDLK_SELECT, - /* 120 */ SDLK_STOP, - /* 121 */ SDLK_AGAIN, - /* 122 */ SDLK_UNDO, - /* 123 */ SDLK_CUT, - /* 124 */ SDLK_COPY, - /* 125 */ SDLK_PASTE, - /* 126 */ SDLK_FIND, - /* 127 */ SDLK_MUTE, - /* 128 */ SDLK_VOLUMEUP, - /* 129 */ SDLK_VOLUMEDOWN, - /* 130 */ SDLK_UNKNOWN, - /* 131 */ SDLK_UNKNOWN, - /* 132 */ SDLK_UNKNOWN, - /* 133 */ SDLK_KP_COMMA, - /* 134 */ SDLK_KP_EQUALSAS400, - /* 135 */ SDLK_UNKNOWN, - /* 136 */ SDLK_UNKNOWN, - /* 137 */ SDLK_UNKNOWN, - /* 138 */ SDLK_UNKNOWN, - /* 139 */ SDLK_UNKNOWN, - /* 140 */ SDLK_UNKNOWN, - /* 141 */ SDLK_UNKNOWN, - /* 142 */ SDLK_UNKNOWN, - /* 143 */ SDLK_UNKNOWN, - /* 144 */ SDLK_UNKNOWN, - /* 145 */ SDLK_UNKNOWN, - /* 146 */ SDLK_UNKNOWN, - /* 147 */ SDLK_UNKNOWN, - /* 148 */ SDLK_UNKNOWN, - /* 149 */ SDLK_UNKNOWN, - /* 150 */ SDLK_UNKNOWN, - /* 151 */ SDLK_UNKNOWN, - /* 152 */ SDLK_UNKNOWN, - /* 153 */ SDLK_ALTERASE, - /* 154 */ SDLK_SYSREQ, - /* 155 */ SDLK_CANCEL, - /* 156 */ SDLK_CLEAR, - /* 157 */ SDLK_PRIOR, - /* 158 */ SDLK_RETURN2, - /* 159 */ SDLK_SEPARATOR, - /* 160 */ SDLK_OUT, - /* 161 */ SDLK_OPER, - /* 162 */ SDLK_CLEARAGAIN, - /* 163 */ SDLK_CRSEL, - /* 164 */ SDLK_EXSEL, - /* 165 */ SDLK_UNKNOWN, - /* 166 */ SDLK_UNKNOWN, - /* 167 */ SDLK_UNKNOWN, - /* 168 */ SDLK_UNKNOWN, - /* 169 */ SDLK_UNKNOWN, - /* 170 */ SDLK_UNKNOWN, - /* 171 */ SDLK_UNKNOWN, - /* 172 */ SDLK_UNKNOWN, - /* 173 */ SDLK_UNKNOWN, - /* 174 */ SDLK_UNKNOWN, - /* 175 */ SDLK_UNKNOWN, - /* 176 */ SDLK_KP_00, - /* 177 */ SDLK_KP_000, - /* 178 */ SDLK_THOUSANDSSEPARATOR, - /* 179 */ SDLK_DECIMALSEPARATOR, - /* 180 */ SDLK_CURRENCYUNIT, - /* 181 */ SDLK_CURRENCYSUBUNIT, - /* 182 */ SDLK_KP_LEFTPAREN, - /* 183 */ SDLK_KP_RIGHTPAREN, - /* 184 */ SDLK_KP_LEFTBRACE, - /* 185 */ SDLK_KP_RIGHTBRACE, - /* 186 */ SDLK_KP_TAB, - /* 187 */ SDLK_KP_BACKSPACE, - /* 188 */ SDLK_KP_A, - /* 189 */ SDLK_KP_B, - /* 190 */ SDLK_KP_C, - /* 191 */ SDLK_KP_D, - /* 192 */ SDLK_KP_E, - /* 193 */ SDLK_KP_F, - /* 194 */ SDLK_KP_XOR, - /* 195 */ SDLK_KP_POWER, - /* 196 */ SDLK_KP_PERCENT, - /* 197 */ SDLK_KP_LESS, - /* 198 */ SDLK_KP_GREATER, - /* 199 */ SDLK_KP_AMPERSAND, - /* 200 */ SDLK_KP_DBLAMPERSAND, - /* 201 */ SDLK_KP_VERTICALBAR, - /* 202 */ SDLK_KP_DBLVERTICALBAR, - /* 203 */ SDLK_KP_COLON, - /* 204 */ SDLK_KP_HASH, - /* 205 */ SDLK_KP_SPACE, - /* 206 */ SDLK_KP_AT, - /* 207 */ SDLK_KP_EXCLAM, - /* 208 */ SDLK_KP_MEMSTORE, - /* 209 */ SDLK_KP_MEMRECALL, - /* 210 */ SDLK_KP_MEMCLEAR, - /* 211 */ SDLK_KP_MEMADD, - /* 212 */ SDLK_KP_MEMSUBTRACT, - /* 213 */ SDLK_KP_MEMMULTIPLY, - /* 214 */ SDLK_KP_MEMDIVIDE, - /* 215 */ SDLK_KP_PLUSMINUS, - /* 216 */ SDLK_KP_CLEAR, - /* 217 */ SDLK_KP_CLEARENTRY, - /* 218 */ SDLK_KP_BINARY, - /* 219 */ SDLK_KP_OCTAL, - /* 220 */ SDLK_KP_DECIMAL, - /* 221 */ SDLK_KP_HEXADECIMAL, - /* 222 */ SDLK_UNKNOWN, - /* 223 */ SDLK_UNKNOWN, - /* 224 */ SDLK_LCTRL, - /* 225 */ SDLK_LSHIFT, - /* 226 */ SDLK_LALT, - /* 227 */ SDLK_LGUI, - /* 228 */ SDLK_RCTRL, - /* 229 */ SDLK_RSHIFT, - /* 230 */ SDLK_RALT, - /* 231 */ SDLK_RGUI, - /* 232 */ SDLK_UNKNOWN, - /* 233 */ SDLK_UNKNOWN, - /* 234 */ SDLK_UNKNOWN, - /* 235 */ SDLK_UNKNOWN, - /* 236 */ SDLK_UNKNOWN, - /* 237 */ SDLK_UNKNOWN, - /* 238 */ SDLK_UNKNOWN, - /* 239 */ SDLK_UNKNOWN, - /* 240 */ SDLK_UNKNOWN, - /* 241 */ SDLK_UNKNOWN, - /* 242 */ SDLK_UNKNOWN, - /* 243 */ SDLK_UNKNOWN, - /* 244 */ SDLK_UNKNOWN, - /* 245 */ SDLK_UNKNOWN, - /* 246 */ SDLK_UNKNOWN, - /* 247 */ SDLK_UNKNOWN, - /* 248 */ SDLK_UNKNOWN, - /* 249 */ SDLK_UNKNOWN, - /* 250 */ SDLK_UNKNOWN, - /* 251 */ SDLK_UNKNOWN, - /* 252 */ SDLK_UNKNOWN, - /* 253 */ SDLK_UNKNOWN, - /* 254 */ SDLK_UNKNOWN, - /* 255 */ SDLK_UNKNOWN, - /* 256 */ SDLK_UNKNOWN, - /* 257 */ SDLK_MODE, - /* 258 */ SDLK_SLEEP, - /* 258 */ SDLK_WAKE, - /* 260 */ SDLK_CHANNEL_INCREMENT, - /* 261 */ SDLK_CHANNEL_DECREMENT, - /* 262 */ SDLK_MEDIA_PLAY, - /* 263 */ SDLK_MEDIA_PAUSE, - /* 264 */ SDLK_MEDIA_RECORD, - /* 265 */ SDLK_MEDIA_FAST_FORWARD, - /* 266 */ SDLK_MEDIA_REWIND, - /* 267 */ SDLK_MEDIA_NEXT_TRACK, - /* 268 */ SDLK_MEDIA_PREVIOUS_TRACK, - /* 269 */ SDLK_MEDIA_STOP, - /* 270 */ SDLK_MEDIA_EJECT, - /* 271 */ SDLK_MEDIA_PLAY_PAUSE, - /* 272 */ SDLK_MEDIA_SELECT, - /* 273 */ SDLK_AC_NEW, - /* 274 */ SDLK_AC_OPEN, - /* 275 */ SDLK_AC_CLOSE, - /* 276 */ SDLK_AC_EXIT, - /* 277 */ SDLK_AC_SAVE, - /* 278 */ SDLK_AC_PRINT, - /* 279 */ SDLK_AC_PROPERTIES, - /* 280 */ SDLK_AC_SEARCH, - /* 281 */ SDLK_AC_HOME, - /* 282 */ SDLK_AC_BACK, - /* 283 */ SDLK_AC_FORWARD, - /* 284 */ SDLK_AC_STOP, - /* 285 */ SDLK_AC_REFRESH, - /* 286 */ SDLK_AC_BOOKMARKS, - /* 287 */ SDLK_SOFTLEFT, - /* 288 */ SDLK_SOFTRIGHT, - /* 289 */ SDLK_CALL, - /* 290 */ SDLK_ENDCALL, -}; - -static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = { - /* 0 */ NULL, - /* 1 */ NULL, - /* 2 */ NULL, - /* 3 */ NULL, - /* 4 */ "A", - /* 5 */ "B", - /* 6 */ "C", - /* 7 */ "D", - /* 8 */ "E", - /* 9 */ "F", - /* 10 */ "G", - /* 11 */ "H", - /* 12 */ "I", - /* 13 */ "J", - /* 14 */ "K", - /* 15 */ "L", - /* 16 */ "M", - /* 17 */ "N", - /* 18 */ "O", - /* 19 */ "P", - /* 20 */ "Q", - /* 21 */ "R", - /* 22 */ "S", - /* 23 */ "T", - /* 24 */ "U", - /* 25 */ "V", - /* 26 */ "W", - /* 27 */ "X", - /* 28 */ "Y", - /* 29 */ "Z", - /* 30 */ "1", - /* 31 */ "2", - /* 32 */ "3", - /* 33 */ "4", - /* 34 */ "5", - /* 35 */ "6", - /* 36 */ "7", - /* 37 */ "8", - /* 38 */ "9", - /* 39 */ "0", - /* 40 */ "Return", - /* 41 */ "Escape", - /* 42 */ "Backspace", - /* 43 */ "Tab", - /* 44 */ "Space", - /* 45 */ "-", - /* 46 */ "=", - /* 47 */ "[", - /* 48 */ "]", - /* 49 */ "\\", - /* 50 */ "#", - /* 51 */ ";", - /* 52 */ "'", - /* 53 */ "`", - /* 54 */ ",", - /* 55 */ ".", - /* 56 */ "/", - /* 57 */ "CapsLock", - /* 58 */ "F1", - /* 59 */ "F2", - /* 60 */ "F3", - /* 61 */ "F4", - /* 62 */ "F5", - /* 63 */ "F6", - /* 64 */ "F7", - /* 65 */ "F8", - /* 66 */ "F9", - /* 67 */ "F10", - /* 68 */ "F11", - /* 69 */ "F12", - /* 70 */ "PrintScreen", - /* 71 */ "ScrollLock", - /* 72 */ "Pause", - /* 73 */ "Insert", - /* 74 */ "Home", - /* 75 */ "PageUp", - /* 76 */ "Delete", - /* 77 */ "End", - /* 78 */ "PageDown", - /* 79 */ "Right", - /* 80 */ "Left", - /* 81 */ "Down", - /* 82 */ "Up", - /* 83 */ "Numlock", - /* 84 */ "Keypad /", - /* 85 */ "Keypad *", - /* 86 */ "Keypad -", - /* 87 */ "Keypad +", - /* 88 */ "Keypad Enter", - /* 89 */ "Keypad 1", - /* 90 */ "Keypad 2", - /* 91 */ "Keypad 3", - /* 92 */ "Keypad 4", - /* 93 */ "Keypad 5", - /* 94 */ "Keypad 6", - /* 95 */ "Keypad 7", - /* 96 */ "Keypad 8", - /* 97 */ "Keypad 9", - /* 98 */ "Keypad 0", - /* 99 */ "Keypad .", - /* 100 */ NULL, - /* 101 */ "Application", - /* 102 */ "Power", - /* 103 */ "Keypad =", - /* 104 */ "F13", - /* 105 */ "F14", - /* 106 */ "F15", - /* 107 */ "F16", - /* 108 */ "F17", - /* 109 */ "F18", - /* 110 */ "F19", - /* 111 */ "F20", - /* 112 */ "F21", - /* 113 */ "F22", - /* 114 */ "F23", - /* 115 */ "F24", - /* 116 */ "Execute", - /* 117 */ "Help", - /* 118 */ "Menu", - /* 119 */ "Select", - /* 120 */ "Stop", - /* 121 */ "Again", - /* 122 */ "Undo", - /* 123 */ "Cut", - /* 124 */ "Copy", - /* 125 */ "Paste", - /* 126 */ "Find", - /* 127 */ "Mute", - /* 128 */ "VolumeUp", - /* 129 */ "VolumeDown", - /* 130 */ NULL, - /* 131 */ NULL, - /* 132 */ NULL, - /* 133 */ "Keypad ,", - /* 134 */ "Keypad = (AS400)", - /* 135 */ NULL, - /* 136 */ NULL, - /* 137 */ NULL, - /* 138 */ NULL, - /* 139 */ NULL, - /* 140 */ NULL, - /* 141 */ NULL, - /* 142 */ NULL, - /* 143 */ NULL, - /* 144 */ NULL, - /* 145 */ NULL, - /* 146 */ NULL, - /* 147 */ NULL, - /* 148 */ NULL, - /* 149 */ NULL, - /* 150 */ NULL, - /* 151 */ NULL, - /* 152 */ NULL, - /* 153 */ "AltErase", - /* 154 */ "SysReq", - /* 155 */ "Cancel", - /* 156 */ "Clear", - /* 157 */ "Prior", - /* 158 */ "Return", - /* 159 */ "Separator", - /* 160 */ "Out", - /* 161 */ "Oper", - /* 162 */ "Clear / Again", - /* 163 */ "CrSel", - /* 164 */ "ExSel", - /* 165 */ NULL, - /* 166 */ NULL, - /* 167 */ NULL, - /* 168 */ NULL, - /* 169 */ NULL, - /* 170 */ NULL, - /* 171 */ NULL, - /* 172 */ NULL, - /* 173 */ NULL, - /* 174 */ NULL, - /* 175 */ NULL, - /* 176 */ "Keypad 00", - /* 177 */ "Keypad 000", - /* 178 */ "ThousandsSeparator", - /* 179 */ "DecimalSeparator", - /* 180 */ "CurrencyUnit", - /* 181 */ "CurrencySubUnit", - /* 182 */ "Keypad (", - /* 183 */ "Keypad )", - /* 184 */ "Keypad {", - /* 185 */ "Keypad }", - /* 186 */ "Keypad Tab", - /* 187 */ "Keypad Backspace", - /* 188 */ "Keypad A", - /* 189 */ "Keypad B", - /* 190 */ "Keypad C", - /* 191 */ "Keypad D", - /* 192 */ "Keypad E", - /* 193 */ "Keypad F", - /* 194 */ "Keypad XOR", - /* 195 */ "Keypad ^", - /* 196 */ "Keypad %", - /* 197 */ "Keypad <", - /* 198 */ "Keypad >", - /* 199 */ "Keypad &", - /* 200 */ "Keypad &&", - /* 201 */ "Keypad |", - /* 202 */ "Keypad ||", - /* 203 */ "Keypad :", - /* 204 */ "Keypad #", - /* 205 */ "Keypad Space", - /* 206 */ "Keypad @", - /* 207 */ "Keypad !", - /* 208 */ "Keypad MemStore", - /* 209 */ "Keypad MemRecall", - /* 210 */ "Keypad MemClear", - /* 211 */ "Keypad MemAdd", - /* 212 */ "Keypad MemSubtract", - /* 213 */ "Keypad MemMultiply", - /* 214 */ "Keypad MemDivide", - /* 215 */ "Keypad +/-", - /* 216 */ "Keypad Clear", - /* 217 */ "Keypad ClearEntry", - /* 218 */ "Keypad Binary", - /* 219 */ "Keypad Octal", - /* 220 */ "Keypad Decimal", - /* 221 */ "Keypad Hexadecimal", - /* 222 */ NULL, - /* 223 */ NULL, - /* 224 */ "Left Ctrl", - /* 225 */ "Left Shift", - /* 226 */ "Left Alt", - /* 227 */ "Left GUI", - /* 228 */ "Right Ctrl", - /* 229 */ "Right Shift", - /* 230 */ "Right Alt", - /* 231 */ "Right GUI", - /* 232 */ NULL, - /* 233 */ NULL, - /* 234 */ NULL, - /* 235 */ NULL, - /* 236 */ NULL, - /* 237 */ NULL, - /* 238 */ NULL, - /* 239 */ NULL, - /* 240 */ NULL, - /* 241 */ NULL, - /* 242 */ NULL, - /* 243 */ NULL, - /* 244 */ NULL, - /* 245 */ NULL, - /* 246 */ NULL, - /* 247 */ NULL, - /* 248 */ NULL, - /* 249 */ NULL, - /* 250 */ NULL, - /* 251 */ NULL, - /* 252 */ NULL, - /* 253 */ NULL, - /* 254 */ NULL, - /* 255 */ NULL, - /* 256 */ NULL, - /* 257 */ "ModeSwitch", - /* 258 */ "Sleep", - /* 259 */ "Wake", - /* 260 */ "ChannelUp", - /* 261 */ "ChannelDown", - /* 262 */ "MediaPlay", - /* 263 */ "MediaPause", - /* 264 */ "MediaRecord", - /* 265 */ "MediaFastForward", - /* 266 */ "MediaRewind", - /* 267 */ "MediaTrackNext", - /* 268 */ "MediaTrackPrevious", - /* 269 */ "MediaStop", - /* 270 */ "Eject", - /* 271 */ "MediaPlayPause", - /* 272 */ "MediaSelect", - /* 273 */ "AC New", - /* 274 */ "AC Open", - /* 275 */ "AC Close", - /* 276 */ "AC Exit", - /* 277 */ "AC Save", - /* 278 */ "AC Print", - /* 279 */ "AC Properties", - /* 280 */ "AC Search", - /* 281 */ "AC Home", - /* 282 */ "AC Back", - /* 283 */ "AC Forward", - /* 284 */ "AC Stop", - /* 285 */ "AC Refresh", - /* 286 */ "AC Bookmarks", - /* 287 */ "SoftLeft", - /* 288 */ "SoftRight", - /* 289 */ "Call", - /* 290 */ "EndCall", -}; - -/* Taken from SDL_iconv() */ -char *SDL_UCS4ToUTF8(Uint32 ch, char *dst) -{ - Uint8 *p = (Uint8 *)dst; - if (ch <= 0x7F) { - *p = (Uint8)ch; - ++dst; - } else if (ch <= 0x7FF) { - p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F); - p[1] = 0x80 | (Uint8)(ch & 0x3F); - dst += 2; - } else if (ch <= 0xFFFF) { - p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F); - p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F); - p[2] = 0x80 | (Uint8)(ch & 0x3F); - dst += 3; - } else { - 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; - } - return dst; -} - /* Public functions */ int SDL_InitKeyboard(void) { - /* Set the default keymap */ - SDL_SetKeymap(0, SDL_default_keymap, SDL_NUM_SCANCODES, SDL_FALSE); return 0; } @@ -811,73 +195,21 @@ void SDL_ResetKeyboard(void) } } -void SDL_GetDefaultKeymap(SDL_Keycode *keymap) -{ - SDL_memcpy(keymap, SDL_default_keymap, sizeof(SDL_default_keymap)); -} - -void SDL_SetKeymap(int start, const SDL_Keycode *keys, int length, SDL_bool send_event) +void SDL_SetKeymap(SDL_Keymap *keymap, SDL_bool send_event) { SDL_Keyboard *keyboard = &SDL_keyboard; - SDL_Scancode scancode; - SDL_Keycode normalized_keymap[SDL_NUM_SCANCODES]; - SDL_bool is_azerty = SDL_FALSE; - - if (start < 0 || start + length > SDL_NUM_SCANCODES) { - return; - } - if (start > 0) { - SDL_memcpy(&normalized_keymap[0], &keyboard->keymap[0], sizeof(*keys) * start); + if (keyboard->keymap) { + SDL_DestroyKeymap(keyboard->keymap); } - SDL_memcpy(&normalized_keymap[start], keys, sizeof(*keys) * length); - - if (start + length < SDL_NUM_SCANCODES) { - int offset = start + length; - SDL_memcpy(&normalized_keymap[offset], &keyboard->keymap[offset], sizeof(*keys) * (SDL_NUM_SCANCODES - offset)); - } - - /* On AZERTY layouts the number keys are technically symbols, but users (and games) - * always think of them and view them in UI as number keys, so remap them here. - */ - if (normalized_keymap[SDL_SCANCODE_0] < SDLK_0 || normalized_keymap[SDL_SCANCODE_0] > SDLK_9) { - is_azerty = SDL_TRUE; - for (scancode = SDL_SCANCODE_1; scancode <= SDL_SCANCODE_9; ++scancode) { - if (normalized_keymap[scancode] >= SDLK_0 && normalized_keymap[scancode] <= SDLK_9) { - /* There's a number on this row, it's not AZERTY */ - is_azerty = SDL_FALSE; - break; - } - } - } - if (is_azerty) { - normalized_keymap[SDL_SCANCODE_0] = SDLK_0; - for (scancode = SDL_SCANCODE_1; scancode <= SDL_SCANCODE_9; ++scancode) { - normalized_keymap[scancode] = SDLK_1 + (scancode - SDL_SCANCODE_1); - } - } - - /* If the mapping didn't really change, we're done here */ - if (!SDL_memcmp(&keyboard->keymap[start], &normalized_keymap[start], sizeof(*keys) * length)) { - return; - } - - SDL_memcpy(&keyboard->keymap[start], &normalized_keymap[start], sizeof(*keys) * length); + keyboard->keymap = keymap; if (send_event) { SDL_SendKeymapChangedEvent(); } } -void SDL_SetScancodeName(SDL_Scancode scancode, const char *name) -{ - if (scancode >= SDL_NUM_SCANCODES) { - return; - } - SDL_scancode_names[scancode] = name; -} - SDL_Window *SDL_GetKeyboardFocus(void) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -993,7 +325,7 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo keyboard->keystate[scancode] = state; if (keycode == SDLK_UNKNOWN) { - keycode = keyboard->keymap[scancode]; + keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); } } else if (keycode == SDLK_UNKNOWN && rawcode == 0) { @@ -1098,26 +430,22 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo int SDL_SendKeyboardUnicodeKey(Uint64 timestamp, Uint32 ch) { - SDL_Scancode code = SDL_SCANCODE_UNKNOWN; - uint16_t mod = 0; + SDL_Keymod modstate = SDL_KMOD_NONE; + SDL_Scancode scancode = SDL_GetDefaultScancodeFromKey(ch, &modstate); - if (ch < SDL_arraysize(SDL_ASCIIKeyInfoTable)) { - code = SDL_ASCIIKeyInfoTable[ch].code; - mod = SDL_ASCIIKeyInfoTable[ch].mod; - } - if (mod & SDL_KMOD_SHIFT) { + if (modstate & SDL_KMOD_SHIFT) { /* If the character uses shift, press shift down */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN, SDL_PRESSED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_LSHIFT, SDL_PRESSED); } /* Send a keydown and keyup for the character */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, code, SDLK_UNKNOWN, SDL_PRESSED); - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, code, SDLK_UNKNOWN, SDL_RELEASED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, ch, SDL_PRESSED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, ch, SDL_RELEASED); - if (mod & SDL_KMOD_SHIFT) { + if (modstate & SDL_KMOD_SHIFT) { /* If the character uses shift, release shift */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_UNKNOWN, SDL_RELEASED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_LSHIFT, SDL_RELEASED); } return 0; } @@ -1256,6 +584,11 @@ void SDL_QuitKeyboard(void) } SDL_free(SDL_keyboards); SDL_keyboards = NULL; + + if (SDL_keyboard.keymap) { + SDL_DestroyKeymap(SDL_keyboard.keymap); + SDL_keyboard.keymap = NULL; + } } const Uint8 *SDL_GetKeyboardState(int *numkeys) @@ -1293,165 +626,13 @@ void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle) } } -SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode) -{ - SDL_Keyboard *keyboard = &SDL_keyboard; - - if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { - SDL_InvalidParamError("scancode"); - return 0; - } - - return keyboard->keymap[scancode]; -} - -SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode) -{ - if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { - SDL_InvalidParamError("scancode"); - return 0; - } - - return SDL_default_keymap[scancode]; -} - -SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key) +SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate) { - SDL_Keyboard *keyboard = &SDL_keyboard; - SDL_Scancode scancode; - - for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; - ++scancode) { - if (keyboard->keymap[scancode] == key) { - return scancode; - } - } - return SDL_SCANCODE_UNKNOWN; + return SDL_GetKeymapKeycode(SDL_keyboard.keymap, scancode, modstate); } -// these are static memory, so we don't use SDL_FreeLater on them. -const char *SDL_GetScancodeName(SDL_Scancode scancode) +SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate) { - const char *name; - if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { - SDL_InvalidParamError("scancode"); - return ""; - } - - name = SDL_scancode_names[scancode]; - if (name) { - return name; - } - - return ""; + return SDL_GetKeymapScancode(SDL_keyboard.keymap, key, modstate); } -SDL_Scancode SDL_GetScancodeFromName(const char *name) -{ - int i; - - if (!name || !*name) { - SDL_InvalidParamError("name"); - return SDL_SCANCODE_UNKNOWN; - } - - for (i = 0; i < SDL_arraysize(SDL_scancode_names); ++i) { - if (!SDL_scancode_names[i]) { - continue; - } - if (SDL_strcasecmp(name, SDL_scancode_names[i]) == 0) { - return (SDL_Scancode)i; - } - } - - SDL_InvalidParamError("name"); - return SDL_SCANCODE_UNKNOWN; -} - -const char *SDL_GetKeyName(SDL_Keycode key) -{ - char name[8]; - char *end; - - if (key & SDLK_SCANCODE_MASK) { - return SDL_GetScancodeName((SDL_Scancode)(key & ~SDLK_SCANCODE_MASK)); - } - - switch (key) { - case SDLK_RETURN: - return SDL_GetScancodeName(SDL_SCANCODE_RETURN); - case SDLK_ESCAPE: - return SDL_GetScancodeName(SDL_SCANCODE_ESCAPE); - case SDLK_BACKSPACE: - return SDL_GetScancodeName(SDL_SCANCODE_BACKSPACE); - case SDLK_TAB: - return SDL_GetScancodeName(SDL_SCANCODE_TAB); - case SDLK_SPACE: - return SDL_GetScancodeName(SDL_SCANCODE_SPACE); - case SDLK_DELETE: - return SDL_GetScancodeName(SDL_SCANCODE_DELETE); - default: - /* Unaccented letter keys on latin keyboards are normally - labeled in upper case (and probably on others like Greek or - Cyrillic too, so if you happen to know for sure, please - adapt this). */ - if (key >= 'a' && key <= 'z') { - key -= 32; - } - - end = SDL_UCS4ToUTF8((Uint32)key, name); - *end = '\0'; - return SDL_FreeLater(SDL_strdup(name)); - } -} - -SDL_Keycode SDL_GetKeyFromName(const char *name) -{ - SDL_Keycode key; - - /* Check input */ - if (!name) { - return SDLK_UNKNOWN; - } - - /* If it's a single UTF-8 character, then that's the keycode itself */ - key = *(const unsigned char *)name; - if (key >= 0xF0) { - if (SDL_strlen(name) == 4) { - int i = 0; - key = (Uint16)(name[i] & 0x07) << 18; - key |= (Uint16)(name[++i] & 0x3F) << 12; - key |= (Uint16)(name[++i] & 0x3F) << 6; - key |= (Uint16)(name[++i] & 0x3F); - return key; - } - return SDLK_UNKNOWN; - } else if (key >= 0xE0) { - if (SDL_strlen(name) == 3) { - int i = 0; - key = (Uint16)(name[i] & 0x0F) << 12; - key |= (Uint16)(name[++i] & 0x3F) << 6; - key |= (Uint16)(name[++i] & 0x3F); - return key; - } - return SDLK_UNKNOWN; - } else if (key >= 0xC0) { - if (SDL_strlen(name) == 2) { - int i = 0; - key = (Uint16)(name[i] & 0x1F) << 6; - key |= (Uint16)(name[++i] & 0x3F); - return key; - } - return SDLK_UNKNOWN; - } else { - if (SDL_strlen(name) == 1) { - if (key >= 'A' && key <= 'Z') { - key += 32; - } - return key; - } - - /* Get the scancode for this name, and the associated keycode */ - return SDL_default_keymap[SDL_GetScancodeFromName(name)]; - } -} diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index 3233b1b33a45e..df43168329f4f 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -23,6 +23,8 @@ #ifndef SDL_keyboard_c_h_ #define SDL_keyboard_c_h_ +#include "SDL_keymap_c.h" + /* Keyboard events not associated with a specific input device */ #define SDL_GLOBAL_KEYBOARD_ID 0 @@ -41,20 +43,8 @@ extern void SDL_AddKeyboard(SDL_KeyboardID keyboardID, const char *name, SDL_boo /* A keyboard has been removed from the system */ extern void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, SDL_bool send_event); -/* Get the default keymap */ -extern void SDL_GetDefaultKeymap(SDL_Keycode *keymap); - -/* Get the default key code for a scancode */ -extern SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode); - /* Set the mapping of scancode to key codes */ -extern void SDL_SetKeymap(int start, const SDL_Keycode *keys, int length, SDL_bool send_event); - -/* Set a platform-dependent key name, overriding the default platform-agnostic - name. Encoded as UTF-8. The string is not copied, thus the pointer given to - this function must stay valid forever (or at least until the call to - VideoQuit()). */ -extern void SDL_SetScancodeName(SDL_Scancode scancode, const char *name); +extern void SDL_SetKeymap(SDL_Keymap *keymap, SDL_bool send_event); /* Set the keyboard focus window */ extern int SDL_SetKeyboardFocus(SDL_Window *window); @@ -91,9 +81,6 @@ extern int SDL_SendEditingText(const char *text, int start, int length); /* Shutdown the keyboard subsystem */ extern void SDL_QuitKeyboard(void); -/* Convert to UTF-8 */ -extern char *SDL_UCS4ToUTF8(Uint32 ch, char *dst); - /* Toggle on or off pieces of the keyboard mod state. */ extern void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle); diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c new file mode 100644 index 0000000000000..60120270ecd85 --- /dev/null +++ b/src/events/SDL_keymap.c @@ -0,0 +1,716 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +#include "SDL_keymap_c.h" +#include "../SDL_hashtable.h" + +struct SDL_Keymap +{ + SDL_HashTable *scancode_to_keycode; + SDL_HashTable *keycode_to_scancode; +}; + +SDL_Keymap *SDL_CreateKeymap(void) +{ + SDL_Keymap *keymap = (SDL_Keymap *)SDL_malloc(sizeof(*keymap)); + if (!keymap) { + return NULL; + } + + keymap->scancode_to_keycode = SDL_CreateHashTable(NULL, 64, SDL_HashID, SDL_KeyMatchID, NULL, SDL_FALSE); + keymap->keycode_to_scancode = SDL_CreateHashTable(NULL, 64, SDL_HashID, SDL_KeyMatchID, NULL, SDL_FALSE); + if (!keymap->scancode_to_keycode || !keymap->keycode_to_scancode) { + SDL_DestroyKeymap(keymap); + return NULL; + } + return keymap; +} + +static SDL_Keymod NormalizeModifierStateForKeymap(SDL_Keymod modstate) +{ + // The modifiers that affect the keymap are: SHIFT, CAPS, ALT, and MODE + modstate &= (SDL_KMOD_SHIFT | SDL_KMOD_CAPS | SDL_KMOD_ALT | SDL_KMOD_MODE); + + // If either right or left Shift are set, set both in the output + if (modstate & SDL_KMOD_SHIFT) { + modstate |= SDL_KMOD_SHIFT; + } + + // If either right or left Alt are set, set both in the output + if (modstate & SDL_KMOD_ALT) { + modstate |= SDL_KMOD_ALT; + } + + return modstate; +} + +void SDL_SetKeymapEntry(SDL_Keymap *keymap, SDL_Scancode scancode, SDL_Keymod modstate, SDL_Keycode keycode) +{ + if (!keymap) { + return; + } + + if (keycode == SDL_GetDefaultKeyFromScancode(scancode, modstate)) { + return; + } + + Uint32 key = ((Uint32)NormalizeModifierStateForKeymap(modstate) << 16) | scancode; + SDL_InsertIntoHashTable(keymap->scancode_to_keycode, (void *)(uintptr_t)key, (void *)(uintptr_t)keycode); + SDL_InsertIntoHashTable(keymap->keycode_to_scancode, (void *)(uintptr_t)keycode, (void *)(uintptr_t)key); +} + +SDL_Keycode SDL_GetKeymapKeycode(SDL_Keymap *keymap, SDL_Scancode scancode, SDL_Keymod modstate) +{ + SDL_Keycode keycode; + + Uint32 key = ((Uint32)NormalizeModifierStateForKeymap(modstate) << 16) | scancode; + const void *value; + if (keymap && SDL_FindInHashTable(keymap->scancode_to_keycode, (void *)(uintptr_t)key, &value)) { + keycode = (SDL_Keycode)(uintptr_t)value; + } else { + keycode = SDL_GetDefaultKeyFromScancode(scancode, modstate); + } + return keycode; +} + +SDL_Scancode SDL_GetKeymapScancode(SDL_Keymap *keymap, SDL_Keycode keycode, SDL_Keymod *modstate) +{ + SDL_Scancode scancode; + + const void *value; + if (keymap && SDL_FindInHashTable(keymap->keycode_to_scancode, (void *)(uintptr_t)keycode, &value)) { + scancode = (SDL_Scancode)((uintptr_t)value & 0xFFFF); + if (modstate) { + *modstate = (SDL_Keymod)((uintptr_t)value >> 16); + } + } else { + scancode = SDL_GetDefaultScancodeFromKey(keycode, modstate); + } + return scancode; +} + +void SDL_ResetKeymap(SDL_Keymap *keymap) +{ + if (keymap) { + SDL_EmptyHashTable(keymap->scancode_to_keycode); + SDL_EmptyHashTable(keymap->keycode_to_scancode); + } +} + +void SDL_DestroyKeymap(SDL_Keymap *keymap) +{ + if (keymap) { + SDL_DestroyHashTable(keymap->scancode_to_keycode); + SDL_DestroyHashTable(keymap->keycode_to_scancode); + SDL_free(keymap); + } +} + +static const SDL_Keycode normal_default_symbols[] = { + SDLK_1, + SDLK_2, + SDLK_3, + SDLK_4, + SDLK_5, + SDLK_6, + SDLK_7, + SDLK_8, + SDLK_9, + SDLK_0, + SDLK_RETURN, + SDLK_ESCAPE, + SDLK_BACKSPACE, + SDLK_TAB, + SDLK_SPACE, + SDLK_MINUS, + SDLK_EQUALS, + SDLK_LEFTBRACKET, + SDLK_RIGHTBRACKET, + SDLK_BACKSLASH, + SDLK_HASH, + SDLK_SEMICOLON, + SDLK_APOSTROPHE, + SDLK_GRAVE, + SDLK_COMMA, + SDLK_PERIOD, + SDLK_SLASH, +}; + +static const SDL_Keycode shifted_default_symbols[] = { + SDLK_EXCLAIM, + SDLK_AT, + SDLK_HASH, + SDLK_DOLLAR, + SDLK_PERCENT, + SDLK_CARET, + SDLK_AMPERSAND, + SDLK_ASTERISK, + SDLK_LEFTPAREN, + SDLK_RIGHTPAREN, + SDLK_RETURN, + SDLK_ESCAPE, + SDLK_BACKSPACE, + SDLK_TAB, + SDLK_SPACE, + SDLK_UNDERSCORE, + SDLK_PLUS, + SDLK_LEFTBRACE, + SDLK_RIGHTBRACE, + SDLK_PIPE, + SDLK_HASH, + SDLK_COLON, + SDLK_DBLAPOSTROPHE, + SDLK_TILDE, + SDLK_LESS, + SDLK_GREATER, + SDLK_QUESTION +}; + +SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate) +{ + if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { + SDL_InvalidParamError("scancode"); + return SDLK_UNKNOWN; + } + + if (modstate & SDL_KMOD_MODE) { + return SDLK_UNKNOWN; + } + + if (scancode < SDL_SCANCODE_A) { + return SDLK_UNKNOWN; + } + + if (scancode < SDL_SCANCODE_1) { + SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) ? SDL_TRUE : SDL_FALSE; +#ifdef SDL_PLATFORM_APPLE + // Apple maps to upper case for either shift or capslock inclusive + if (modstate & SDL_KMOD_CAPS) { + shifted = SDL_TRUE; + } +#else + if (modstate & SDL_KMOD_CAPS) { + shifted = !shifted; + } +#endif + if (!shifted) { + return (SDL_Keycode)('a' + scancode - SDL_SCANCODE_A); + } else { + return (SDL_Keycode)('A' + scancode - SDL_SCANCODE_A); + } + } + + if (scancode < SDL_SCANCODE_CAPSLOCK) { + SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) ? SDL_TRUE : SDL_FALSE; + + if (!shifted) { + return normal_default_symbols[scancode - SDL_SCANCODE_1]; + } else { + return shifted_default_symbols[scancode - SDL_SCANCODE_1]; + } + } + + if (scancode == SDL_SCANCODE_DELETE) { + return SDLK_DELETE; + } + + return SDL_SCANCODE_TO_KEYCODE(scancode); +} + +SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate) +{ + if (modstate) { + *modstate = SDL_KMOD_NONE; + } + + if (key == SDLK_UNKNOWN) { + return SDL_SCANCODE_UNKNOWN; + } + + if (key & SDLK_SCANCODE_MASK) { + return (SDL_Scancode)(key & ~SDLK_SCANCODE_MASK); + } + + if (key >= SDLK_a && key <= SDLK_z) { + return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_a); + } + + if (key >= SDLK_Z && key <= SDLK_Z) { + if (modstate) { + *modstate = SDL_KMOD_SHIFT; + } + return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_Z); + } + + for (int i = 0; i < SDL_arraysize(normal_default_symbols); ++i) { + if (key == normal_default_symbols[i]) { + return(SDL_Scancode)(SDL_SCANCODE_1 + i); + } + } + + for (int i = 0; i < SDL_arraysize(shifted_default_symbols); ++i) { + if (key == shifted_default_symbols[i]) { + if (modstate) { + *modstate = SDL_KMOD_SHIFT; + } + return(SDL_Scancode)(SDL_SCANCODE_1 + i); + } + } + + if (key == SDLK_DELETE) { + return SDL_SCANCODE_DELETE; + } + + return SDL_SCANCODE_UNKNOWN; +} + +static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = +{ + /* 0 */ NULL, + /* 1 */ NULL, + /* 2 */ NULL, + /* 3 */ NULL, + /* 4 */ "A", + /* 5 */ "B", + /* 6 */ "C", + /* 7 */ "D", + /* 8 */ "E", + /* 9 */ "F", + /* 10 */ "G", + /* 11 */ "H", + /* 12 */ "I", + /* 13 */ "J", + /* 14 */ "K", + /* 15 */ "L", + /* 16 */ "M", + /* 17 */ "N", + /* 18 */ "O", + /* 19 */ "P", + /* 20 */ "Q", + /* 21 */ "R", + /* 22 */ "S", + /* 23 */ "T", + /* 24 */ "U", + /* 25 */ "V", + /* 26 */ "W", + /* 27 */ "X", + /* 28 */ "Y", + /* 29 */ "Z", + /* 30 */ "1", + /* 31 */ "2", + /* 32 */ "3", + /* 33 */ "4", + /* 34 */ "5", + /* 35 */ "6", + /* 36 */ "7", + /* 37 */ "8", + /* 38 */ "9", + /* 39 */ "0", + /* 40 */ "Return", + /* 41 */ "Escape", + /* 42 */ "Backspace", + /* 43 */ "Tab", + /* 44 */ "Space", + /* 45 */ "-", + /* 46 */ "=", + /* 47 */ "[", + /* 48 */ "]", + /* 49 */ "\\", + /* 50 */ "#", + /* 51 */ ";", + /* 52 */ "'", + /* 53 */ "`", + /* 54 */ ",", + /* 55 */ ".", + /* 56 */ "/", + /* 57 */ "CapsLock", + /* 58 */ "F1", + /* 59 */ "F2", + /* 60 */ "F3", + /* 61 */ "F4", + /* 62 */ "F5", + /* 63 */ "F6", + /* 64 */ "F7", + /* 65 */ "F8", + /* 66 */ "F9", + /* 67 */ "F10", + /* 68 */ "F11", + /* 69 */ "F12", + /* 70 */ "PrintScreen", + /* 71 */ "ScrollLock", + /* 72 */ "Pause", + /* 73 */ "Insert", + /* 74 */ "Home", + /* 75 */ "PageUp", + /* 76 */ "Delete", + /* 77 */ "End", + /* 78 */ "PageDown", + /* 79 */ "Right", + /* 80 */ "Left", + /* 81 */ "Down", + /* 82 */ "Up", + /* 83 */ "Numlock", + /* 84 */ "Keypad /", + /* 85 */ "Keypad *", + /* 86 */ "Keypad -", + /* 87 */ "Keypad +", + /* 88 */ "Keypad Enter", + /* 89 */ "Keypad 1", + /* 90 */ "Keypad 2", + /* 91 */ "Keypad 3", + /* 92 */ "Keypad 4", + /* 93 */ "Keypad 5", + /* 94 */ "Keypad 6", + /* 95 */ "Keypad 7", + /* 96 */ "Keypad 8", + /* 97 */ "Keypad 9", + /* 98 */ "Keypad 0", + /* 99 */ "Keypad .", + /* 100 */ NULL, + /* 101 */ "Application", + /* 102 */ "Power", + /* 103 */ "Keypad =", + /* 104 */ "F13", + /* 105 */ "F14", + /* 106 */ "F15", + /* 107 */ "F16", + /* 108 */ "F17", + /* 109 */ "F18", + /* 110 */ "F19", + /* 111 */ "F20", + /* 112 */ "F21", + /* 113 */ "F22", + /* 114 */ "F23", + /* 115 */ "F24", + /* 116 */ "Execute", + /* 117 */ "Help", + /* 118 */ "Menu", + /* 119 */ "Select", + /* 120 */ "Stop", + /* 121 */ "Again", + /* 122 */ "Undo", + /* 123 */ "Cut", + /* 124 */ "Copy", + /* 125 */ "Paste", + /* 126 */ "Find", + /* 127 */ "Mute", + /* 128 */ "VolumeUp", + /* 129 */ "VolumeDown", + /* 130 */ NULL, + /* 131 */ NULL, + /* 132 */ NULL, + /* 133 */ "Keypad ,", + /* 134 */ "Keypad = (AS400)", + /* 135 */ NULL, + /* 136 */ NULL, + /* 137 */ NULL, + /* 138 */ NULL, + /* 139 */ NULL, + /* 140 */ NULL, + /* 141 */ NULL, + /* 142 */ NULL, + /* 143 */ NULL, + /* 144 */ NULL, + /* 145 */ NULL, + /* 146 */ NULL, + /* 147 */ NULL, + /* 148 */ NULL, + /* 149 */ NULL, + /* 150 */ NULL, + /* 151 */ NULL, + /* 152 */ NULL, + /* 153 */ "AltErase", + /* 154 */ "SysReq", + /* 155 */ "Cancel", + /* 156 */ "Clear", + /* 157 */ "Prior", + /* 158 */ "Return", + /* 159 */ "Separator", + /* 160 */ "Out", + /* 161 */ "Oper", + /* 162 */ "Clear / Again", + /* 163 */ "CrSel", + /* 164 */ "ExSel", + /* 165 */ NULL, + /* 166 */ NULL, + /* 167 */ NULL, + /* 168 */ NULL, + /* 169 */ NULL, + /* 170 */ NULL, + /* 171 */ NULL, + /* 172 */ NULL, + /* 173 */ NULL, + /* 174 */ NULL, + /* 175 */ NULL, + /* 176 */ "Keypad 00", + /* 177 */ "Keypad 000", + /* 178 */ "ThousandsSeparator", + /* 179 */ "DecimalSeparator", + /* 180 */ "CurrencyUnit", + /* 181 */ "CurrencySubUnit", + /* 182 */ "Keypad (", + /* 183 */ "Keypad )", + /* 184 */ "Keypad {", + /* 185 */ "Keypad }", + /* 186 */ "Keypad Tab", + /* 187 */ "Keypad Backspace", + /* 188 */ "Keypad A", + /* 189 */ "Keypad B", + /* 190 */ "Keypad C", + /* 191 */ "Keypad D", + /* 192 */ "Keypad E", + /* 193 */ "Keypad F", + /* 194 */ "Keypad XOR", + /* 195 */ "Keypad ^", + /* 196 */ "Keypad %", + /* 197 */ "Keypad <", + /* 198 */ "Keypad >", + /* 199 */ "Keypad &", + /* 200 */ "Keypad &&", + /* 201 */ "Keypad |", + /* 202 */ "Keypad ||", + /* 203 */ "Keypad :", + /* 204 */ "Keypad #", + /* 205 */ "Keypad Space", + /* 206 */ "Keypad @", + /* 207 */ "Keypad !", + /* 208 */ "Keypad MemStore", + /* 209 */ "Keypad MemRecall", + /* 210 */ "Keypad MemClear", + /* 211 */ "Keypad MemAdd", + /* 212 */ "Keypad MemSubtract", + /* 213 */ "Keypad MemMultiply", + /* 214 */ "Keypad MemDivide", + /* 215 */ "Keypad +/-", + /* 216 */ "Keypad Clear", + /* 217 */ "Keypad ClearEntry", + /* 218 */ "Keypad Binary", + /* 219 */ "Keypad Octal", + /* 220 */ "Keypad Decimal", + /* 221 */ "Keypad Hexadecimal", + /* 222 */ NULL, + /* 223 */ NULL, + /* 224 */ "Left Ctrl", + /* 225 */ "Left Shift", + /* 226 */ "Left Alt", + /* 227 */ "Left GUI", + /* 228 */ "Right Ctrl", + /* 229 */ "Right Shift", + /* 230 */ "Right Alt", + /* 231 */ "Right GUI", + /* 232 */ NULL, + /* 233 */ NULL, + /* 234 */ NULL, + /* 235 */ NULL, + /* 236 */ NULL, + /* 237 */ NULL, + /* 238 */ NULL, + /* 239 */ NULL, + /* 240 */ NULL, + /* 241 */ NULL, + /* 242 */ NULL, + /* 243 */ NULL, + /* 244 */ NULL, + /* 245 */ NULL, + /* 246 */ NULL, + /* 247 */ NULL, + /* 248 */ NULL, + /* 249 */ NULL, + /* 250 */ NULL, + /* 251 */ NULL, + /* 252 */ NULL, + /* 253 */ NULL, + /* 254 */ NULL, + /* 255 */ NULL, + /* 256 */ NULL, + /* 257 */ "ModeSwitch", + /* 258 */ "Sleep", + /* 259 */ "Wake", + /* 260 */ "ChannelUp", + /* 261 */ "ChannelDown", + /* 262 */ "MediaPlay", + /* 263 */ "MediaPause", + /* 264 */ "MediaRecord", + /* 265 */ "MediaFastForward", + /* 266 */ "MediaRewind", + /* 267 */ "MediaTrackNext", + /* 268 */ "MediaTrackPrevious", + /* 269 */ "MediaStop", + /* 270 */ "Eject", + /* 271 */ "MediaPlayPause", + /* 272 */ "MediaSelect", + /* 273 */ "AC New", + /* 274 */ "AC Open", + /* 275 */ "AC Close", + /* 276 */ "AC Exit", + /* 277 */ "AC Save", + /* 278 */ "AC Print", + /* 279 */ "AC Properties", + /* 280 */ "AC Search", + /* 281 */ "AC Home", + /* 282 */ "AC Back", + /* 283 */ "AC Forward", + /* 284 */ "AC Stop", + /* 285 */ "AC Refresh", + /* 286 */ "AC Bookmarks", + /* 287 */ "SoftLeft", + /* 288 */ "SoftRight", + /* 289 */ "Call", + /* 290 */ "EndCall", +}; + +int SDL_SetScancodeName(SDL_Scancode scancode, const char *name) +{ + if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { + return SDL_InvalidParamError("scancode"); + } + + SDL_scancode_names[scancode] = name; + return 0; +} + +// these are static memory, so we don't use SDL_FreeLater on them. +const char *SDL_GetScancodeName(SDL_Scancode scancode) +{ + const char *name; + if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) { + SDL_InvalidParamError("scancode"); + return ""; + } + + name = SDL_scancode_names[scancode]; + if (name) { + return name; + } + + return ""; +} + +SDL_Scancode SDL_GetScancodeFromName(const char *name) +{ + int i; + + if (!name || !*name) { + SDL_InvalidParamError("name"); + return SDL_SCANCODE_UNKNOWN; + } + + for (i = 0; i < SDL_arraysize(SDL_scancode_names); ++i) { + if (!SDL_scancode_names[i]) { + continue; + } + if (SDL_strcasecmp(name, SDL_scancode_names[i]) == 0) { + return (SDL_Scancode)i; + } + } + + SDL_InvalidParamError("name"); + return SDL_SCANCODE_UNKNOWN; +} + +const char *SDL_GetKeyName(SDL_Keycode key) +{ + char name[8]; + char *end; + + if (key & SDLK_SCANCODE_MASK) { + return SDL_GetScancodeName((SDL_Scancode)(key & ~SDLK_SCANCODE_MASK)); + } + + switch (key) { + case SDLK_RETURN: + return SDL_GetScancodeName(SDL_SCANCODE_RETURN); + case SDLK_ESCAPE: + return SDL_GetScancodeName(SDL_SCANCODE_ESCAPE); + case SDLK_BACKSPACE: + return SDL_GetScancodeName(SDL_SCANCODE_BACKSPACE); + case SDLK_TAB: + return SDL_GetScancodeName(SDL_SCANCODE_TAB); + case SDLK_SPACE: + return SDL_GetScancodeName(SDL_SCANCODE_SPACE); + case SDLK_DELETE: + return SDL_GetScancodeName(SDL_SCANCODE_DELETE); + default: + /* Unaccented letter keys on latin keyboards are normally + labeled in upper case (and probably on others like Greek or + Cyrillic too, so if you happen to know for sure, please + adapt this). */ + if (key >= 'a' && key <= 'z') { + key -= 32; + } + + end = SDL_UCS4ToUTF8(key, name); + *end = '\0'; + return SDL_FreeLater(SDL_strdup(name)); + } +} + +SDL_Keycode SDL_GetKeyFromName(const char *name) +{ + SDL_Keycode key; + + /* Check input */ + if (!name) { + return SDLK_UNKNOWN; + } + + /* If it's a single UTF-8 character, then that's the keycode itself */ + key = *(const unsigned char *)name; + if (key >= 0xF0) { + if (SDL_strlen(name) == 4) { + int i = 0; + key = (Uint16)(name[i] & 0x07) << 18; + key |= (Uint16)(name[++i] & 0x3F) << 12; + key |= (Uint16)(name[++i] & 0x3F) << 6; + key |= (Uint16)(name[++i] & 0x3F); + return key; + } + return SDLK_UNKNOWN; + } else if (key >= 0xE0) { + if (SDL_strlen(name) == 3) { + int i = 0; + key = (Uint16)(name[i] & 0x0F) << 12; + key |= (Uint16)(name[++i] & 0x3F) << 6; + key |= (Uint16)(name[++i] & 0x3F); + return key; + } + return SDLK_UNKNOWN; + } else if (key >= 0xC0) { + if (SDL_strlen(name) == 2) { + int i = 0; + key = (Uint16)(name[i] & 0x1F) << 6; + key |= (Uint16)(name[++i] & 0x3F); + return key; + } + return SDLK_UNKNOWN; + } else { + if (SDL_strlen(name) == 1) { + if (key >= 'A' && key <= 'Z') { + key += 32; + } + return key; + } + + /* Get the scancode for this name, and the associated keycode */ + return SDL_GetKeyFromScancode(SDL_GetScancodeFromName(name), SDL_KMOD_NONE); + } +} diff --git a/src/events/SDL_keymap_c.h b/src/events/SDL_keymap_c.h new file mode 100644 index 0000000000000..93128a6300c23 --- /dev/null +++ b/src/events/SDL_keymap_c.h @@ -0,0 +1,37 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +#ifndef SDL_keymap_c_h_ +#define SDL_keymap_c_h_ + +#include "../SDL_hashtable.h" + +typedef struct SDL_Keymap SDL_Keymap; + +SDL_Keymap *SDL_CreateKeymap(void); +void SDL_SetKeymapEntry(SDL_Keymap *keymap, SDL_Scancode scancode, SDL_Keymod modstate, SDL_Keycode keycode); +SDL_Keycode SDL_GetKeymapKeycode(SDL_Keymap *keymap, SDL_Scancode scancode, SDL_Keymod modstate); +SDL_Scancode SDL_GetKeymapScancode(SDL_Keymap *keymap, SDL_Keycode keycode, SDL_Keymod *modstate); +void SDL_ResetKeymap(SDL_Keymap *keymap); +void SDL_DestroyKeymap(SDL_Keymap *keymap); + +#endif /* SDL_keymap_c_h_ */ diff --git a/src/events/scancodes_ascii.h b/src/events/scancodes_ascii.h deleted file mode 100644 index ee49ab8813532..0000000000000 --- a/src/events/scancodes_ascii.h +++ /dev/null @@ -1,165 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* - This file is used to convert between characters passed in from an ASCII - virtual keyboard in US layout and tuples of SDL_Scancode and SDL_keymods. - - For example ASCIIKeyInfoTable['a'] would give you the scan code and keymod - for lower case a. -*/ - -typedef struct -{ - SDL_Scancode code; - uint16_t mod; -} ASCIIKeyInfo; - -static ASCIIKeyInfo SDL_ASCIIKeyInfoTable[] = { - /* 0 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 1 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 2 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 3 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 4 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 5 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 6 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 7 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 8 */ { SDL_SCANCODE_BACKSPACE, 0 }, - /* 9 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 10 */ { SDL_SCANCODE_RETURN, 0 }, - /* 11 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 12 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 13 */ { SDL_SCANCODE_RETURN, 0 }, - /* 14 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 15 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 16 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 17 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 18 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 19 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 20 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 21 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 22 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 23 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 24 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 25 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 26 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 27 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 28 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 29 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 30 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 31 */ { SDL_SCANCODE_UNKNOWN, 0 }, - /* 32 */ { SDL_SCANCODE_SPACE, 0 }, - /* 33 */ { SDL_SCANCODE_1, SDL_KMOD_SHIFT }, /* plus shift modifier '!' */ - /* 34 */ { SDL_SCANCODE_APOSTROPHE, SDL_KMOD_SHIFT }, /* plus shift modifier '"' */ - /* 35 */ { SDL_SCANCODE_3, SDL_KMOD_SHIFT }, /* plus shift modifier '#' */ - /* 36 */ { SDL_SCANCODE_4, SDL_KMOD_SHIFT }, /* plus shift modifier '$' */ - /* 37 */ { SDL_SCANCODE_5, SDL_KMOD_SHIFT }, /* plus shift modifier '%' */ - /* 38 */ { SDL_SCANCODE_7, SDL_KMOD_SHIFT }, /* plus shift modifier '&' */ - /* 39 */ { SDL_SCANCODE_APOSTROPHE, 0 }, /* ''' */ - /* 40 */ { SDL_SCANCODE_9, SDL_KMOD_SHIFT }, /* plus shift modifier '(' */ - /* 41 */ { SDL_SCANCODE_0, SDL_KMOD_SHIFT }, /* plus shift modifier ')' */ - /* 42 */ { SDL_SCANCODE_8, SDL_KMOD_SHIFT }, /* '*' */ - /* 43 */ { SDL_SCANCODE_EQUALS, SDL_KMOD_SHIFT }, /* plus shift modifier '+' */ - /* 44 */ { SDL_SCANCODE_COMMA, 0 }, /* ',' */ - /* 45 */ { SDL_SCANCODE_MINUS, 0 }, /* '-' */ - /* 46 */ { SDL_SCANCODE_PERIOD, 0 }, /* '.' */ - /* 47 */ { SDL_SCANCODE_SLASH, 0 }, /* '/' */ - /* 48 */ { SDL_SCANCODE_0, 0 }, - /* 49 */ { SDL_SCANCODE_1, 0 }, - /* 50 */ { SDL_SCANCODE_2, 0 }, - /* 51 */ { SDL_SCANCODE_3, 0 }, - /* 52 */ { SDL_SCANCODE_4, 0 }, - /* 53 */ { SDL_SCANCODE_5, 0 }, - /* 54 */ { SDL_SCANCODE_6, 0 }, - /* 55 */ { SDL_SCANCODE_7, 0 }, - /* 56 */ { SDL_SCANCODE_8, 0 }, - /* 57 */ { SDL_SCANCODE_9, 0 }, - /* 58 */ { SDL_SCANCODE_SEMICOLON, SDL_KMOD_SHIFT }, /* plus shift modifier ';' */ - /* 59 */ { SDL_SCANCODE_SEMICOLON, 0 }, - /* 60 */ { SDL_SCANCODE_COMMA, SDL_KMOD_SHIFT }, /* plus shift modifier '<' */ - /* 61 */ { SDL_SCANCODE_EQUALS, 0 }, - /* 62 */ { SDL_SCANCODE_PERIOD, SDL_KMOD_SHIFT }, /* plus shift modifier '>' */ - /* 63 */ { SDL_SCANCODE_SLASH, SDL_KMOD_SHIFT }, /* plus shift modifier '?' */ - /* 64 */ { SDL_SCANCODE_2, SDL_KMOD_SHIFT }, /* plus shift modifier '@' */ - /* 65 */ { SDL_SCANCODE_A, SDL_KMOD_SHIFT }, /* all the following need shift modifiers */ - /* 66 */ { SDL_SCANCODE_B, SDL_KMOD_SHIFT }, - /* 67 */ { SDL_SCANCODE_C, SDL_KMOD_SHIFT }, - /* 68 */ { SDL_SCANCODE_D, SDL_KMOD_SHIFT }, - /* 69 */ { SDL_SCANCODE_E, SDL_KMOD_SHIFT }, - /* 70 */ { SDL_SCANCODE_F, SDL_KMOD_SHIFT }, - /* 71 */ { SDL_SCANCODE_G, SDL_KMOD_SHIFT }, - /* 72 */ { SDL_SCANCODE_H, SDL_KMOD_SHIFT }, - /* 73 */ { SDL_SCANCODE_I, SDL_KMOD_SHIFT }, - /* 74 */ { SDL_SCANCODE_J, SDL_KMOD_SHIFT }, - /* 75 */ { SDL_SCANCODE_K, SDL_KMOD_SHIFT }, - /* 76 */ { SDL_SCANCODE_L, SDL_KMOD_SHIFT }, - /* 77 */ { SDL_SCANCODE_M, SDL_KMOD_SHIFT }, - /* 78 */ { SDL_SCANCODE_N, SDL_KMOD_SHIFT }, - /* 79 */ { SDL_SCANCODE_O, SDL_KMOD_SHIFT }, - /* 80 */ { SDL_SCANCODE_P, SDL_KMOD_SHIFT }, - /* 81 */ { SDL_SCANCODE_Q, SDL_KMOD_SHIFT }, - /* 82 */ { SDL_SCANCODE_R, SDL_KMOD_SHIFT }, - /* 83 */ { SDL_SCANCODE_S, SDL_KMOD_SHIFT }, - /* 84 */ { SDL_SCANCODE_T, SDL_KMOD_SHIFT }, - /* 85 */ { SDL_SCANCODE_U, SDL_KMOD_SHIFT }, - /* 86 */ { SDL_SCANCODE_V, SDL_KMOD_SHIFT }, - /* 87 */ { SDL_SCANCODE_W, SDL_KMOD_SHIFT }, - /* 88 */ { SDL_SCANCODE_X, SDL_KMOD_SHIFT }, - /* 89 */ { SDL_SCANCODE_Y, SDL_KMOD_SHIFT }, - /* 90 */ { SDL_SCANCODE_Z, SDL_KMOD_SHIFT }, - /* 91 */ { SDL_SCANCODE_LEFTBRACKET, 0 }, - /* 92 */ { SDL_SCANCODE_BACKSLASH, 0 }, - /* 93 */ { SDL_SCANCODE_RIGHTBRACKET, 0 }, - /* 94 */ { SDL_SCANCODE_6, SDL_KMOD_SHIFT }, /* plus shift modifier '^' */ - /* 95 */ { SDL_SCANCODE_MINUS, SDL_KMOD_SHIFT }, /* plus shift modifier '_' */ - /* 96 */ { SDL_SCANCODE_GRAVE, SDL_KMOD_SHIFT }, /* '`' */ - /* 97 */ { SDL_SCANCODE_A, 0 }, - /* 98 */ { SDL_SCANCODE_B, 0 }, - /* 99 */ { SDL_SCANCODE_C, 0 }, - /* 100 */ { SDL_SCANCODE_D, 0 }, - /* 101 */ { SDL_SCANCODE_E, 0 }, - /* 102 */ { SDL_SCANCODE_F, 0 }, - /* 103 */ { SDL_SCANCODE_G, 0 }, - /* 104 */ { SDL_SCANCODE_H, 0 }, - /* 105 */ { SDL_SCANCODE_I, 0 }, - /* 106 */ { SDL_SCANCODE_J, 0 }, - /* 107 */ { SDL_SCANCODE_K, 0 }, - /* 108 */ { SDL_SCANCODE_L, 0 }, - /* 109 */ { SDL_SCANCODE_M, 0 }, - /* 110 */ { SDL_SCANCODE_N, 0 }, - /* 111 */ { SDL_SCANCODE_O, 0 }, - /* 112 */ { SDL_SCANCODE_P, 0 }, - /* 113 */ { SDL_SCANCODE_Q, 0 }, - /* 114 */ { SDL_SCANCODE_R, 0 }, - /* 115 */ { SDL_SCANCODE_S, 0 }, - /* 116 */ { SDL_SCANCODE_T, 0 }, - /* 117 */ { SDL_SCANCODE_U, 0 }, - /* 118 */ { SDL_SCANCODE_V, 0 }, - /* 119 */ { SDL_SCANCODE_W, 0 }, - /* 120 */ { SDL_SCANCODE_X, 0 }, - /* 121 */ { SDL_SCANCODE_Y, 0 }, - /* 122 */ { SDL_SCANCODE_Z, 0 }, - /* 123 */ { SDL_SCANCODE_LEFTBRACKET, SDL_KMOD_SHIFT }, /* plus shift modifier '{' */ - /* 124 */ { SDL_SCANCODE_BACKSLASH, SDL_KMOD_SHIFT }, /* plus shift modifier '|' */ - /* 125 */ { SDL_SCANCODE_RIGHTBRACKET, SDL_KMOD_SHIFT }, /* plus shift modifier '}' */ - /* 126 */ { SDL_SCANCODE_GRAVE, SDL_KMOD_SHIFT }, /* plus shift modifier '~' */ - /* 127 */ { SDL_SCANCODE_BACKSPACE, SDL_KMOD_SHIFT } -}; diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 5da5db1277ac5..f6ef52bf3ad57 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -240,10 +240,7 @@ static void HandleModifiers(SDL_VideoDevice *_this, SDL_Scancode code, unsigned static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) { TISInputSourceRef key_layout; - const void *chr_data; - int i; - SDL_Scancode scancode; - SDL_Keycode keymap[SDL_NUM_SCANCODES]; + UCKeyboardLayout *keyLayoutPtr = NULL; CFDataRef uchrDataRef; /* See if the keymap needs to be updated */ @@ -253,29 +250,45 @@ static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) } data.key_layout = key_layout; - SDL_GetDefaultKeymap(keymap); - /* Try Unicode data first */ uchrDataRef = TISGetInputSourceProperty(key_layout, kTISPropertyUnicodeKeyLayoutData); if (uchrDataRef) { - chr_data = CFDataGetBytePtr(uchrDataRef); - } else { - goto cleanup; + keyLayoutPtr = (UCKeyboardLayout *)CFDataGetBytePtr(uchrDataRef); } - if (chr_data) { - UInt32 keyboard_type = LMGetKbdType(); - OSStatus err; + if (!keyLayoutPtr) { + CFRelease(key_layout); + return; + } - for (i = 0; i < SDL_arraysize(darwin_scancode_table); i++) { + static struct { + int flags; + SDL_Keymod modstate; + } mods[] = { + { 0, SDL_KMOD_NONE }, + { shiftKey, SDL_KMOD_SHIFT }, + { alphaLock, SDL_KMOD_CAPS }, + { (shiftKey | alphaLock), (SDL_KMOD_SHIFT | SDL_KMOD_CAPS) }, + { optionKey, SDL_KMOD_ALT }, + { (optionKey | shiftKey), (SDL_KMOD_ALT | SDL_KMOD_SHIFT) }, + { (optionKey | alphaLock), (SDL_KMOD_ALT | SDL_KMOD_CAPS) }, + { (optionKey | shiftKey | alphaLock), (SDL_KMOD_ALT | SDL_KMOD_SHIFT | SDL_KMOD_CAPS) } + }; + + UInt32 keyboard_type = LMGetKbdType(); + + SDL_Keymap *keymap = SDL_CreateKeymap(); + for (int m = 0; m < SDL_arraysize(mods); ++m) { + for (int i = 0; i < SDL_arraysize(darwin_scancode_table); i++) { + OSStatus err; UniChar s[8]; UniCharCount len; UInt32 dead_key_state; /* Make sure this scancode is a valid character scancode */ - scancode = darwin_scancode_table[i]; + SDL_Scancode scancode = darwin_scancode_table[i]; if (scancode == SDL_SCANCODE_UNKNOWN || - (keymap[scancode] & SDLK_SCANCODE_MASK)) { + (SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) { continue; } @@ -291,9 +304,8 @@ static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) } dead_key_state = 0; - err = UCKeyTranslate((UCKeyboardLayout *)chr_data, - i, kUCKeyActionDown, - 0, keyboard_type, + err = UCKeyTranslate(keyLayoutPtr, i, kUCKeyActionDown, + ((mods[m].flags >> 8) & 0xFF), keyboard_type, kUCKeyTranslateNoDeadKeysMask, &dead_key_state, 8, &len, s); if (err != noErr) { @@ -301,15 +313,16 @@ static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) } if (len > 0 && s[0] != 0x10) { - keymap[scancode] = s[0]; + SDL_SetKeymapEntry(keymap, scancode, mods[m].modstate, s[0]); + } else { + // The default keymap doesn't have any SDL_KMOD_ALT entries, so we don't need to override them + if (!(mods[m].modstate & SDL_KMOD_ALT)) { + SDL_SetKeymapEntry(keymap, scancode, mods[m].modstate, SDLK_UNKNOWN); + } } } - SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); - return; } - -cleanup: - CFRelease(key_layout); + SDL_SetKeymap(keymap, send_event); } void Cocoa_InitKeyboard(SDL_VideoDevice *_this) diff --git a/src/video/haiku/SDL_bkeyboard.cc b/src/video/haiku/SDL_bkeyboard.cc index 10af7ad763ff6..5f3fbaf17a2af 100644 --- a/src/video/haiku/SDL_bkeyboard.cc +++ b/src/video/haiku/SDL_bkeyboard.cc @@ -39,7 +39,8 @@ extern "C" { static SDL_Scancode keymap[KEYMAP_SIZE]; static int8 keystate[KEYMAP_SIZE]; -void HAIKU_InitOSKeymap(void) { +void HAIKU_InitOSKeymap(void) +{ for ( uint i = 0; i < SDL_arraysize(keymap); ++i ) { keymap[i] = SDL_SCANCODE_UNKNOWN; } @@ -48,113 +49,113 @@ void HAIKU_InitOSKeymap(void) { keystate[i] = SDL_RELEASED; } - keymap[0x01] = SDL_GetScancodeFromKey(SDLK_ESCAPE); - keymap[B_F1_KEY] = SDL_GetScancodeFromKey(SDLK_F1); - keymap[B_F2_KEY] = SDL_GetScancodeFromKey(SDLK_F2); - keymap[B_F3_KEY] = SDL_GetScancodeFromKey(SDLK_F3); - keymap[B_F4_KEY] = SDL_GetScancodeFromKey(SDLK_F4); - keymap[B_F5_KEY] = SDL_GetScancodeFromKey(SDLK_F5); - keymap[B_F6_KEY] = SDL_GetScancodeFromKey(SDLK_F6); - keymap[B_F7_KEY] = SDL_GetScancodeFromKey(SDLK_F7); - keymap[B_F8_KEY] = SDL_GetScancodeFromKey(SDLK_F8); - keymap[B_F9_KEY] = SDL_GetScancodeFromKey(SDLK_F9); - keymap[B_F10_KEY] = SDL_GetScancodeFromKey(SDLK_F10); - keymap[B_F11_KEY] = SDL_GetScancodeFromKey(SDLK_F11); - keymap[B_F12_KEY] = SDL_GetScancodeFromKey(SDLK_F12); - keymap[B_PRINT_KEY] = SDL_GetScancodeFromKey(SDLK_PRINTSCREEN); - keymap[B_SCROLL_KEY] = SDL_GetScancodeFromKey(SDLK_SCROLLLOCK); - keymap[B_PAUSE_KEY] = SDL_GetScancodeFromKey(SDLK_PAUSE); - keymap[0x11] = SDL_GetScancodeFromKey(SDLK_GRAVE); - keymap[0x12] = SDL_GetScancodeFromKey(SDLK_1); - keymap[0x13] = SDL_GetScancodeFromKey(SDLK_2); - keymap[0x14] = SDL_GetScancodeFromKey(SDLK_3); - keymap[0x15] = SDL_GetScancodeFromKey(SDLK_4); - keymap[0x16] = SDL_GetScancodeFromKey(SDLK_5); - keymap[0x17] = SDL_GetScancodeFromKey(SDLK_6); - keymap[0x18] = SDL_GetScancodeFromKey(SDLK_7); - keymap[0x19] = SDL_GetScancodeFromKey(SDLK_8); - keymap[0x1a] = SDL_GetScancodeFromKey(SDLK_9); - keymap[0x1b] = SDL_GetScancodeFromKey(SDLK_0); - keymap[0x1c] = SDL_GetScancodeFromKey(SDLK_MINUS); - keymap[0x1d] = SDL_GetScancodeFromKey(SDLK_EQUALS); - keymap[0x1e] = SDL_GetScancodeFromKey(SDLK_BACKSPACE); - keymap[0x1f] = SDL_GetScancodeFromKey(SDLK_INSERT); - keymap[0x20] = SDL_GetScancodeFromKey(SDLK_HOME); - keymap[0x21] = SDL_GetScancodeFromKey(SDLK_PAGEUP); - keymap[0x22] = SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR); - keymap[0x23] = SDL_GetScancodeFromKey(SDLK_KP_DIVIDE); - keymap[0x24] = SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY); - keymap[0x25] = SDL_GetScancodeFromKey(SDLK_KP_MINUS); - keymap[0x26] = SDL_GetScancodeFromKey(SDLK_TAB); - keymap[0x27] = SDL_GetScancodeFromKey(SDLK_q); - keymap[0x28] = SDL_GetScancodeFromKey(SDLK_w); - keymap[0x29] = SDL_GetScancodeFromKey(SDLK_e); - keymap[0x2a] = SDL_GetScancodeFromKey(SDLK_r); - keymap[0x2b] = SDL_GetScancodeFromKey(SDLK_t); - keymap[0x2c] = SDL_GetScancodeFromKey(SDLK_y); - keymap[0x2d] = SDL_GetScancodeFromKey(SDLK_u); - keymap[0x2e] = SDL_GetScancodeFromKey(SDLK_i); - keymap[0x2f] = SDL_GetScancodeFromKey(SDLK_o); - keymap[0x30] = SDL_GetScancodeFromKey(SDLK_p); - keymap[0x31] = SDL_GetScancodeFromKey(SDLK_LEFTBRACKET); - keymap[0x32] = SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET); - keymap[0x33] = SDL_GetScancodeFromKey(SDLK_BACKSLASH); - keymap[0x34] = SDL_GetScancodeFromKey(SDLK_DELETE); - keymap[0x35] = SDL_GetScancodeFromKey(SDLK_END); - keymap[0x36] = SDL_GetScancodeFromKey(SDLK_PAGEDOWN); - keymap[0x37] = SDL_GetScancodeFromKey(SDLK_KP_7); - keymap[0x38] = SDL_GetScancodeFromKey(SDLK_KP_8); - keymap[0x39] = SDL_GetScancodeFromKey(SDLK_KP_9); - keymap[0x3a] = SDL_GetScancodeFromKey(SDLK_KP_PLUS); - keymap[0x3b] = SDL_GetScancodeFromKey(SDLK_CAPSLOCK); - keymap[0x3c] = SDL_GetScancodeFromKey(SDLK_a); - keymap[0x3d] = SDL_GetScancodeFromKey(SDLK_s); - keymap[0x3e] = SDL_GetScancodeFromKey(SDLK_d); - keymap[0x3f] = SDL_GetScancodeFromKey(SDLK_f); - keymap[0x40] = SDL_GetScancodeFromKey(SDLK_g); - keymap[0x41] = SDL_GetScancodeFromKey(SDLK_h); - keymap[0x42] = SDL_GetScancodeFromKey(SDLK_j); - keymap[0x43] = SDL_GetScancodeFromKey(SDLK_k); - keymap[0x44] = SDL_GetScancodeFromKey(SDLK_l); - keymap[0x45] = SDL_GetScancodeFromKey(SDLK_SEMICOLON); - keymap[0x46] = SDL_GetScancodeFromKey(SDLK_APOSTROPHE); - keymap[0x47] = SDL_GetScancodeFromKey(SDLK_RETURN); - keymap[0x48] = SDL_GetScancodeFromKey(SDLK_KP_4); - keymap[0x49] = SDL_GetScancodeFromKey(SDLK_KP_5); - keymap[0x4a] = SDL_GetScancodeFromKey(SDLK_KP_6); - keymap[0x4b] = SDL_GetScancodeFromKey(SDLK_LSHIFT); - keymap[0x4c] = SDL_GetScancodeFromKey(SDLK_z); - keymap[0x4d] = SDL_GetScancodeFromKey(SDLK_x); - keymap[0x4e] = SDL_GetScancodeFromKey(SDLK_c); - keymap[0x4f] = SDL_GetScancodeFromKey(SDLK_v); - keymap[0x50] = SDL_GetScancodeFromKey(SDLK_b); - keymap[0x51] = SDL_GetScancodeFromKey(SDLK_n); - keymap[0x52] = SDL_GetScancodeFromKey(SDLK_m); - keymap[0x53] = SDL_GetScancodeFromKey(SDLK_COMMA); - keymap[0x54] = SDL_GetScancodeFromKey(SDLK_PERIOD); - keymap[0x55] = SDL_GetScancodeFromKey(SDLK_SLASH); - keymap[0x56] = SDL_GetScancodeFromKey(SDLK_RSHIFT); - keymap[0x57] = SDL_GetScancodeFromKey(SDLK_UP); - keymap[0x58] = SDL_GetScancodeFromKey(SDLK_KP_1); - keymap[0x59] = SDL_GetScancodeFromKey(SDLK_KP_2); - keymap[0x5a] = SDL_GetScancodeFromKey(SDLK_KP_3); - keymap[0x5b] = SDL_GetScancodeFromKey(SDLK_KP_ENTER); - keymap[0x5c] = SDL_GetScancodeFromKey(SDLK_LCTRL); - keymap[0x5d] = SDL_GetScancodeFromKey(SDLK_LALT); - keymap[0x5e] = SDL_GetScancodeFromKey(SDLK_SPACE); - keymap[0x5f] = SDL_GetScancodeFromKey(SDLK_RALT); - keymap[0x60] = SDL_GetScancodeFromKey(SDLK_RCTRL); - keymap[0x61] = SDL_GetScancodeFromKey(SDLK_LEFT); - keymap[0x62] = SDL_GetScancodeFromKey(SDLK_DOWN); - keymap[0x63] = SDL_GetScancodeFromKey(SDLK_RIGHT); - keymap[0x64] = SDL_GetScancodeFromKey(SDLK_KP_0); - keymap[0x65] = SDL_GetScancodeFromKey(SDLK_KP_PERIOD); - keymap[0x66] = SDL_GetScancodeFromKey(SDLK_LGUI); - keymap[0x67] = SDL_GetScancodeFromKey(SDLK_RGUI); - keymap[0x68] = SDL_GetScancodeFromKey(SDLK_MENU); - keymap[0x69] = SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */ - keymap[0x6a] = SDL_GetScancodeFromKey(SDLK_KP_EQUALS); - keymap[0x6b] = SDL_GetScancodeFromKey(SDLK_POWER); + keymap[0x01] = SDL_SCANCODE_ESCAPE; + keymap[B_F1_KEY] = SDL_SCANCODE_F1; + keymap[B_F2_KEY] = SDL_SCANCODE_F2; + keymap[B_F3_KEY] = SDL_SCANCODE_F3; + keymap[B_F4_KEY] = SDL_SCANCODE_F4; + keymap[B_F5_KEY] = SDL_SCANCODE_F5; + keymap[B_F6_KEY] = SDL_SCANCODE_F6; + keymap[B_F7_KEY] = SDL_SCANCODE_F7; + keymap[B_F8_KEY] = SDL_SCANCODE_F8; + keymap[B_F9_KEY] = SDL_SCANCODE_F9; + keymap[B_F10_KEY] = SDL_SCANCODE_F10; + keymap[B_F11_KEY] = SDL_SCANCODE_F11; + keymap[B_F12_KEY] = SDL_SCANCODE_F12; + keymap[B_PRINT_KEY] = SDL_SCANCODE_PRINTSCREEN; + keymap[B_SCROLL_KEY]= SDL_SCANCODE_SCROLLLOCK; + keymap[B_PAUSE_KEY] = SDL_SCANCODE_PAUSE; + keymap[0x11] = SDL_SCANCODE_GRAVE; + keymap[0x12] = SDL_SCANCODE_1; + keymap[0x13] = SDL_SCANCODE_2; + keymap[0x14] = SDL_SCANCODE_3; + keymap[0x15] = SDL_SCANCODE_4; + keymap[0x16] = SDL_SCANCODE_5; + keymap[0x17] = SDL_SCANCODE_6; + keymap[0x18] = SDL_SCANCODE_7; + keymap[0x19] = SDL_SCANCODE_8; + keymap[0x1a] = SDL_SCANCODE_9; + keymap[0x1b] = SDL_SCANCODE_0; + keymap[0x1c] = SDL_SCANCODE_MINUS; + keymap[0x1d] = SDL_SCANCODE_EQUALS; + keymap[0x1e] = SDL_SCANCODE_BACKSPACE; + keymap[0x1f] = SDL_SCANCODE_INSERT; + keymap[0x20] = SDL_SCANCODE_HOME; + keymap[0x21] = SDL_SCANCODE_PAGEUP; + keymap[0x22] = SDL_SCANCODE_NUMLOCKCLEAR; + keymap[0x23] = SDL_SCANCODE_KP_DIVIDE; + keymap[0x24] = SDL_SCANCODE_KP_MULTIPLY; + keymap[0x25] = SDL_SCANCODE_KP_MINUS; + keymap[0x26] = SDL_SCANCODE_TAB; + keymap[0x27] = SDL_SCANCODE_Q; + keymap[0x28] = SDL_SCANCODE_W; + keymap[0x29] = SDL_SCANCODE_E; + keymap[0x2a] = SDL_SCANCODE_R; + keymap[0x2b] = SDL_SCANCODE_T; + keymap[0x2c] = SDL_SCANCODE_Y; + keymap[0x2d] = SDL_SCANCODE_U; + keymap[0x2e] = SDL_SCANCODE_I; + keymap[0x2f] = SDL_SCANCODE_O; + keymap[0x30] = SDL_SCANCODE_P; + keymap[0x31] = SDL_SCANCODE_LEFTBRACKET; + keymap[0x32] = SDL_SCANCODE_RIGHTBRACKET; + keymap[0x33] = SDL_SCANCODE_BACKSLASH; + keymap[0x34] = SDL_SCANCODE_DELETE; + keymap[0x35] = SDL_SCANCODE_END; + keymap[0x36] = SDL_SCANCODE_PAGEDOWN; + keymap[0x37] = SDL_SCANCODE_KP_7; + keymap[0x38] = SDL_SCANCODE_KP_8; + keymap[0x39] = SDL_SCANCODE_KP_9; + keymap[0x3a] = SDL_SCANCODE_KP_PLUS; + keymap[0x3b] = SDL_SCANCODE_CAPSLOCK; + keymap[0x3c] = SDL_SCANCODE_A; + keymap[0x3d] = SDL_SCANCODE_S; + keymap[0x3e] = SDL_SCANCODE_D; + keymap[0x3f] = SDL_SCANCODE_F; + keymap[0x40] = SDL_SCANCODE_G; + keymap[0x41] = SDL_SCANCODE_H; + keymap[0x42] = SDL_SCANCODE_J; + keymap[0x43] = SDL_SCANCODE_K; + keymap[0x44] = SDL_SCANCODE_L; + keymap[0x45] = SDL_SCANCODE_SEMICOLON; + keymap[0x46] = SDL_SCANCODE_APOSTROPHE; + keymap[0x47] = SDL_SCANCODE_RETURN; + keymap[0x48] = SDL_SCANCODE_KP_4; + keymap[0x49] = SDL_SCANCODE_KP_5; + keymap[0x4a] = SDL_SCANCODE_KP_6; + keymap[0x4b] = SDL_SCANCODE_LSHIFT; + keymap[0x4c] = SDL_SCANCODE_Z; + keymap[0x4d] = SDL_SCANCODE_X; + keymap[0x4e] = SDL_SCANCODE_C; + keymap[0x4f] = SDL_SCANCODE_V; + keymap[0x50] = SDL_SCANCODE_B; + keymap[0x51] = SDL_SCANCODE_N; + keymap[0x52] = SDL_SCANCODE_M; + keymap[0x53] = SDL_SCANCODE_COMMA; + keymap[0x54] = SDL_SCANCODE_PERIOD; + keymap[0x55] = SDL_SCANCODE_SLASH; + keymap[0x56] = SDL_SCANCODE_RSHIFT; + keymap[0x57] = SDL_SCANCODE_UP; + keymap[0x58] = SDL_SCANCODE_KP_1; + keymap[0x59] = SDL_SCANCODE_KP_2; + keymap[0x5a] = SDL_SCANCODE_KP_3; + keymap[0x5b] = SDL_SCANCODE_KP_ENTER; + keymap[0x5c] = SDL_SCANCODE_LCTRL; + keymap[0x5d] = SDL_SCANCODE_LALT; + keymap[0x5e] = SDL_SCANCODE_SPACE; + keymap[0x5f] = SDL_SCANCODE_RALT; + keymap[0x60] = SDL_SCANCODE_RCTRL; + keymap[0x61] = SDL_SCANCODE_LEFT; + keymap[0x62] = SDL_SCANCODE_DOWN; + keymap[0x63] = SDL_SCANCODE_RIGHT; + keymap[0x64] = SDL_SCANCODE_KP_0; + keymap[0x65] = SDL_SCANCODE_KP_PERIOD; + keymap[0x66] = SDL_SCANCODE_LGUI; + keymap[0x67] = SDL_SCANCODE_RGUI; + keymap[0x68] = SDL_SCANCODE_MENU; + keymap[0x69] = SDL_SCANCODE_2; /* SDLK_EURO */ + keymap[0x6a] = SDL_SCANCODE_KP_EQUALS; + keymap[0x6b] = SDL_SCANCODE_POWER; } SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) { diff --git a/src/video/ngage/SDL_ngageevents.cpp b/src/video/ngage/SDL_ngageevents.cpp index cd82b6b4a4611..59a524a8f76dd 100644 --- a/src/video/ngage/SDL_ngageevents.cpp +++ b/src/video/ngage/SDL_ngageevents.cpp @@ -70,81 +70,81 @@ TBool isCursorVisible = EFalse; static SDL_Scancode ConvertScancode(SDL_VideoDevice *_this, int key) { - SDL_Keycode keycode; + SDL_Keycode scancode; switch (key) { case EStdKeyBackspace: // Clear key - keycode = SDLK_BACKSPACE; + scancode = SDL_SCANCODE_BACKSPACE; break; case 0x31: // 1 - keycode = SDLK_1; + scancode = SDL_SCANCODE_1; break; case 0x32: // 2 - keycode = SDLK_2; + scancode = SDL_SCANCODE_2; break; case 0x33: // 3 - keycode = SDLK_3; + scancode = SDL_SCANCODE_3; break; case 0x34: // 4 - keycode = SDLK_4; + scancode = SDL_SCANCODE_4; break; case 0x35: // 5 - keycode = SDLK_5; + scancode = SDL_SCANCODE_5; break; case 0x36: // 6 - keycode = SDLK_6; + scancode = SDL_SCANCODE_6; break; case 0x37: // 7 - keycode = SDLK_7; + scancode = SDL_SCANCODE_7; break; case 0x38: // 8 - keycode = SDLK_8; + scancode = SDL_SCANCODE_8; break; case 0x39: // 9 - keycode = SDLK_9; + scancode = SDL_SCANCODE_9; break; case 0x30: // 0 - keycode = SDLK_0; + scancode = SDL_SCANCODE_0; break; case 0x2a: // Asterisk - keycode = SDLK_ASTERISK; + scancode = SDL_SCANCODE_ASTERISK; break; case EStdKeyHash: // Hash - keycode = SDLK_HASH; + scancode = SDL_SCANCODE_HASH; break; case EStdKeyDevice0: // Left softkey - keycode = SDLK_SOFTLEFT; + scancode = SDL_SCANCODE_SOFTLEFT; break; case EStdKeyDevice1: // Right softkey - keycode = SDLK_SOFTRIGHT; + scancode = SDL_SCANCODE_SOFTRIGHT; break; case EStdKeyApplication0: // Call softkey - keycode = SDLK_CALL; + scancode = SDL_SCANCODE_CALL; break; case EStdKeyApplication1: // End call softkey - keycode = SDLK_ENDCALL; + scancode = SDL_SCANCODE_ENDCALL; break; case EStdKeyDevice3: // Middle softkey - keycode = SDLK_SELECT; + scancode = SDL_SCANCODE_SELECT; break; case EStdKeyUpArrow: // Up arrow - keycode = SDLK_UP; + scancode = SDL_SCANCODE_UP; break; case EStdKeyDownArrow: // Down arrow - keycode = SDLK_DOWN; + scancode = SDL_SCANCODE_DOWN; break; case EStdKeyLeftArrow: // Left arrow - keycode = SDLK_LEFT; + scancode = SDL_SCANCODE_LEFT; break; case EStdKeyRightArrow: // Right arrow - keycode = SDLK_RIGHT; + scancode = SDL_SCANCODE_RIGHT; break; default: - keycode = SDLK_UNKNOWN; + scancode = SDL_SCANCODE_UNKNOWN; break; } - return SDL_GetScancodeFromKey(keycode); + return scancode; } int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent) diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index ecc441c1ff1e3..1876b3f067473 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -41,7 +41,7 @@ #define IRKBD_CONFIG_FILE NULL /* this will take ms0:/seplugins/pspirkeyb.ini */ static int irkbd_ready = 0; -static SDL_Keycode keymap[256]; +static SDL_Scancode keymap[256]; #endif static enum PspHprmKeys hprm = 0; @@ -51,14 +51,14 @@ static int running = 0; static struct { enum PspHprmKeys id; - SDL_Keycode sym; + SDL_Scancode scancode; } keymap_psp[] = { - { PSP_HPRM_PLAYPAUSE, SDLK_F10 }, - { PSP_HPRM_FORWARD, SDLK_F11 }, - { PSP_HPRM_BACK, SDLK_F12 }, - { PSP_HPRM_VOL_UP, SDLK_F13 }, - { PSP_HPRM_VOL_DOWN, SDLK_F14 }, - { PSP_HPRM_HOLD, SDLK_F15 } + { PSP_HPRM_PLAYPAUSE, SDL_SCANCODE_F10 }, + { PSP_HPRM_FORWARD, SDL_SCANCODE_F11 }, + { PSP_HPRM_BACK, SDL_SCANCODE_F12 }, + { PSP_HPRM_VOL_UP, SDL_SCANCODE_F13 }, + { PSP_HPRM_VOL_DOWN, SDL_SCANCODE_F14 }, + { PSP_HPRM_HOLD, SDL_SCANCODE_F15 } }; int EventUpdate(void *data) @@ -90,7 +90,7 @@ void PSP_PumpEvents(SDL_VideoDevice *_this) if (changed) { for (i = 0; i < sizeof(keymap_psp) / sizeof(keymap_psp[0]); i++) { if (changed & keymap_psp[i].id) { - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, keymap_psp[i].id, SDL_GetScancodeFromKey(keymap_psp[i].sym), (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, keymap_psp[i].id, keymap_psp[i].scancode, (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED); } } } @@ -109,11 +109,7 @@ void PSP_PumpEvents(SDL_VideoDevice *_this) scanData = (SIrKeybScanCodeData *)buffer + i; raw = scanData->raw; pressed = scanData->pressed; - sym.scancode = raw; - sym.sym = keymap[raw]; - /* not tested */ - /* SDL_PrivateKeyboard(pressed?SDL_PRESSED:SDL_RELEASED, &sym); */ - SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, raw, SDL_GetScancodeFromKey(keymap[raw]), (keys & keymap_psp[i].id) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, raw, keymap[raw], pressed ? SDL_PRESSED : SDL_RELEASED); } } } @@ -129,109 +125,109 @@ void PSP_InitOSKeymap(SDL_VideoDevice *_this) #ifdef PSPIRKEYB int i; for (i = 0; i < SDL_arraysize(keymap); ++i) { - keymap[i] = SDLK_UNKNOWN; + keymap[i] = SDL_SCANCODE_UNKNOWN; } - keymap[KEY_ESC] = SDLK_ESCAPE; - - keymap[KEY_F1] = SDLK_F1; - keymap[KEY_F2] = SDLK_F2; - keymap[KEY_F3] = SDLK_F3; - keymap[KEY_F4] = SDLK_F4; - keymap[KEY_F5] = SDLK_F5; - keymap[KEY_F6] = SDLK_F6; - keymap[KEY_F7] = SDLK_F7; - keymap[KEY_F8] = SDLK_F8; - keymap[KEY_F9] = SDLK_F9; - keymap[KEY_F10] = SDLK_F10; - keymap[KEY_F11] = SDLK_F11; - keymap[KEY_F12] = SDLK_F12; - keymap[KEY_F13] = SDLK_PRINT; - keymap[KEY_F14] = SDLK_PAUSE; - - keymap[KEY_GRAVE] = SDLK_GRAVE; - keymap[KEY_1] = SDLK_1; - keymap[KEY_2] = SDLK_2; - keymap[KEY_3] = SDLK_3; - keymap[KEY_4] = SDLK_4; - keymap[KEY_5] = SDLK_5; - keymap[KEY_6] = SDLK_6; - keymap[KEY_7] = SDLK_7; - keymap[KEY_8] = SDLK_8; - keymap[KEY_9] = SDLK_9; - keymap[KEY_0] = SDLK_0; - keymap[KEY_MINUS] = SDLK_MINUS; - keymap[KEY_EQUAL] = SDLK_EQUALS; - keymap[KEY_BACKSPACE] = SDLK_BACKSPACE; - - keymap[KEY_TAB] = SDLK_TAB; - keymap[KEY_Q] = SDLK_q; - keymap[KEY_W] = SDLK_w; - keymap[KEY_E] = SDLK_e; - keymap[KEY_R] = SDLK_r; - keymap[KEY_T] = SDLK_t; - keymap[KEY_Y] = SDLK_y; - keymap[KEY_U] = SDLK_u; - keymap[KEY_I] = SDLK_i; - keymap[KEY_O] = SDLK_o; - keymap[KEY_P] = SDLK_p; - keymap[KEY_LEFTBRACE] = SDLK_LEFTBRACKET; - keymap[KEY_RIGHTBRACE] = SDLK_RIGHTBRACKET; - keymap[KEY_ENTER] = SDLK_RETURN; - - keymap[KEY_CAPSLOCK] = SDLK_CAPSLOCK; - keymap[KEY_A] = SDLK_a; - keymap[KEY_S] = SDLK_s; - keymap[KEY_D] = SDLK_d; - keymap[KEY_F] = SDLK_f; - keymap[KEY_G] = SDLK_g; - keymap[KEY_H] = SDLK_h; - keymap[KEY_J] = SDLK_j; - keymap[KEY_K] = SDLK_k; - keymap[KEY_L] = SDLK_l; - keymap[KEY_SEMICOLON] = SDLK_SEMICOLON; - keymap[KEY_APOSTROPHE] = SDLK_APOSTROPHE; - keymap[KEY_BACKSLASH] = SDLK_BACKSLASH; - - keymap[KEY_Z] = SDLK_z; - keymap[KEY_X] = SDLK_x; - keymap[KEY_C] = SDLK_c; - keymap[KEY_V] = SDLK_v; - keymap[KEY_B] = SDLK_b; - keymap[KEY_N] = SDLK_n; - keymap[KEY_M] = SDLK_m; - keymap[KEY_COMMA] = SDLK_COMMA; - keymap[KEY_DOT] = SDLK_PERIOD; - keymap[KEY_SLASH] = SDLK_SLASH; - - keymap[KEY_SPACE] = SDLK_SPACE; - - keymap[KEY_UP] = SDLK_UP; - keymap[KEY_DOWN] = SDLK_DOWN; - keymap[KEY_LEFT] = SDLK_LEFT; - keymap[KEY_RIGHT] = SDLK_RIGHT; - - keymap[KEY_HOME] = SDLK_HOME; - keymap[KEY_END] = SDLK_END; - keymap[KEY_INSERT] = SDLK_INSERT; - keymap[KEY_DELETE] = SDLK_DELETE; - - keymap[KEY_NUMLOCK] = SDLK_NUMLOCK; - keymap[KEY_LEFTMETA] = SDLK_LSUPER; - - keymap[KEY_KPSLASH] = SDLK_KP_DIVIDE; - keymap[KEY_KPASTERISK] = SDLK_KP_MULTIPLY; - keymap[KEY_KPMINUS] = SDLK_KP_MINUS; - keymap[KEY_KPPLUS] = SDLK_KP_PLUS; - keymap[KEY_KPDOT] = SDLK_KP_PERIOD; - keymap[KEY_KPEQUAL] = SDLK_KP_EQUALS; - - keymap[KEY_LEFTCTRL] = SDLK_LCTRL; - keymap[KEY_RIGHTCTRL] = SDLK_RCTRL; - keymap[KEY_LEFTALT] = SDLK_LALT; - keymap[KEY_RIGHTALT] = SDLK_RALT; - keymap[KEY_LEFTSHIFT] = SDLK_LSHIFT; - keymap[KEY_RIGHTSHIFT] = SDLK_RSHIFT; + keymap[KEY_ESC] = SDL_SCANCODE_ESCAPE; + + keymap[KEY_F1] = SDL_SCANCODE_F1; + keymap[KEY_F2] = SDL_SCANCODE_F2; + keymap[KEY_F3] = SDL_SCANCODE_F3; + keymap[KEY_F4] = SDL_SCANCODE_F4; + keymap[KEY_F5] = SDL_SCANCODE_F5; + keymap[KEY_F6] = SDL_SCANCODE_F6; + keymap[KEY_F7] = SDL_SCANCODE_F7; + keymap[KEY_F8] = SDL_SCANCODE_F8; + keymap[KEY_F9] = SDL_SCANCODE_F9; + keymap[KEY_F10] = SDL_SCANCODE_F10; + keymap[KEY_F11] = SDL_SCANCODE_F11; + keymap[KEY_F12] = SDL_SCANCODE_F12; + keymap[KEY_F13] = SDL_SCANCODE_PRINT; + keymap[KEY_F14] = SDL_SCANCODE_PAUSE; + + keymap[KEY_GRAVE] = SDL_SCANCODE_GRAVE; + keymap[KEY_1] = SDL_SCANCODE_1; + keymap[KEY_2] = SDL_SCANCODE_2; + keymap[KEY_3] = SDL_SCANCODE_3; + keymap[KEY_4] = SDL_SCANCODE_4; + keymap[KEY_5] = SDL_SCANCODE_5; + keymap[KEY_6] = SDL_SCANCODE_6; + keymap[KEY_7] = SDL_SCANCODE_7; + keymap[KEY_8] = SDL_SCANCODE_8; + keymap[KEY_9] = SDL_SCANCODE_9; + keymap[KEY_0] = SDL_SCANCODE_0; + keymap[KEY_MINUS] = SDL_SCANCODE_MINUS; + keymap[KEY_EQUAL] = SDL_SCANCODE_EQUALS; + keymap[KEY_BACKSPACE] = SDL_SCANCODE_BACKSPACE; + + keymap[KEY_TAB] = SDL_SCANCODE_TAB; + keymap[KEY_Q] = SDL_SCANCODE_q; + keymap[KEY_W] = SDL_SCANCODE_w; + keymap[KEY_E] = SDL_SCANCODE_e; + keymap[KEY_R] = SDL_SCANCODE_r; + keymap[KEY_T] = SDL_SCANCODE_t; + keymap[KEY_Y] = SDL_SCANCODE_y; + keymap[KEY_U] = SDL_SCANCODE_u; + keymap[KEY_I] = SDL_SCANCODE_i; + keymap[KEY_O] = SDL_SCANCODE_o; + keymap[KEY_P] = SDL_SCANCODE_p; + keymap[KEY_LEFTBRACE] = SDL_SCANCODE_LEFTBRACKET; + keymap[KEY_RIGHTBRACE] = SDL_SCANCODE_RIGHTBRACKET; + keymap[KEY_ENTER] = SDL_SCANCODE_RETURN; + + keymap[KEY_CAPSLOCK] = SDL_SCANCODE_CAPSLOCK; + keymap[KEY_A] = SDL_SCANCODE_a; + keymap[KEY_S] = SDL_SCANCODE_s; + keymap[KEY_D] = SDL_SCANCODE_d; + keymap[KEY_F] = SDL_SCANCODE_f; + keymap[KEY_G] = SDL_SCANCODE_g; + keymap[KEY_H] = SDL_SCANCODE_h; + keymap[KEY_J] = SDL_SCANCODE_j; + keymap[KEY_K] = SDL_SCANCODE_k; + keymap[KEY_L] = SDL_SCANCODE_l; + keymap[KEY_SEMICOLON] = SDL_SCANCODE_SEMICOLON; + keymap[KEY_APOSTROPHE] = SDL_SCANCODE_APOSTROPHE; + keymap[KEY_BACKSLASH] = SDL_SCANCODE_BACKSLASH; + + keymap[KEY_Z] = SDL_SCANCODE_z; + keymap[KEY_X] = SDL_SCANCODE_x; + keymap[KEY_C] = SDL_SCANCODE_c; + keymap[KEY_V] = SDL_SCANCODE_v; + keymap[KEY_B] = SDL_SCANCODE_b; + keymap[KEY_N] = SDL_SCANCODE_n; + keymap[KEY_M] = SDL_SCANCODE_m; + keymap[KEY_COMMA] = SDL_SCANCODE_COMMA; + keymap[KEY_DOT] = SDL_SCANCODE_PERIOD; + keymap[KEY_SLASH] = SDL_SCANCODE_SLASH; + + keymap[KEY_SPACE] = SDL_SCANCODE_SPACE; + + keymap[KEY_UP] = SDL_SCANCODE_UP; + keymap[KEY_DOWN] = SDL_SCANCODE_DOWN; + keymap[KEY_LEFT] = SDL_SCANCODE_LEFT; + keymap[KEY_RIGHT] = SDL_SCANCODE_RIGHT; + + keymap[KEY_HOME] = SDL_SCANCODE_HOME; + keymap[KEY_END] = SDL_SCANCODE_END; + keymap[KEY_INSERT] = SDL_SCANCODE_INSERT; + keymap[KEY_DELETE] = SDL_SCANCODE_DELETE; + + keymap[KEY_NUMLOCK] = SDL_SCANCODE_NUMLOCK; + keymap[KEY_LEFTMETA] = SDL_SCANCODE_LSUPER; + + keymap[KEY_KPSLASH] = SDL_SCANCODE_KP_DIVIDE; + keymap[KEY_KPASTERISK] = SDL_SCANCODE_KP_MULTIPLY; + keymap[KEY_KPMINUS] = SDL_SCANCODE_KP_MINUS; + keymap[KEY_KPPLUS] = SDL_SCANCODE_KP_PLUS; + keymap[KEY_KPDOT] = SDL_SCANCODE_KP_PERIOD; + keymap[KEY_KPEQUAL] = SDL_SCANCODE_KP_EQUALS; + + keymap[KEY_LEFTCTRL] = SDL_SCANCODE_LCTRL; + keymap[KEY_RIGHTCTRL] = SDL_SCANCODE_RCTRL; + keymap[KEY_LEFTALT] = SDL_SCANCODE_LALT; + keymap[KEY_RIGHTALT] = SDL_SCANCODE_RALT; + keymap[KEY_LEFTSHIFT] = SDL_SCANCODE_LSHIFT; + keymap[KEY_RIGHTSHIFT] = SDL_SCANCODE_RSHIFT; #endif } diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c index 480ffd88ad34e..8a3d669f5838d 100644 --- a/src/video/vita/SDL_vitavideo.c +++ b/src/video/vita/SDL_vitavideo.c @@ -380,7 +380,6 @@ SceImeCaret caret_rev; void VITA_ImeEventHandler(void *arg, const SceImeEventData *e) { SDL_VideoData *videodata = (SDL_VideoData *)arg; - SDL_Scancode scancode; uint8_t utf8_buffer[SCE_IME_MAX_TEXT_LENGTH]; switch (e->id) { case SCE_IME_EVENT_UPDATE_TEXT: @@ -388,11 +387,10 @@ void VITA_ImeEventHandler(void *arg, const SceImeEventData *e) SDL_SendKeyboardKeyAutoRelease(0, SDL_SCANCODE_BACKSPACE); sceImeSetText((SceWChar16 *)libime_initval, 4); } else { - scancode = SDL_GetScancodeFromKey(*(SceWChar16 *)&libime_out[1]); - if (scancode == SDL_SCANCODE_SPACE) { + utf16_to_utf8((SceWChar16 *)&libime_out[1], utf8_buffer); + if (utf8_buffer[0] == ' ') { SDL_SendKeyboardKeyAutoRelease(0, SDL_SCANCODE_SPACE); } else { - utf16_to_utf8((SceWChar16 *)&libime_out[1], utf8_buffer); SDL_SendKeyboardText((const char *)utf8_buffer); } SDL_memset(&caret_rev, 0, sizeof(SceImeCaret)); diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index b7f52154c83a1..72c16ef6b8a62 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1107,7 +1107,7 @@ static void Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, vo /* Note: The default SDL keymap always sets this to right alt instead of AltGr/Mode, so handle it separately. */ if (syms[0] != XKB_KEY_ISO_Level3_Shift) { - keycode = SDL_GetDefaultKeyFromScancode(sc); + keycode = SDL_GetDefaultKeyFromScancode(sc, SDL_KMOD_NONE); } else { keycode = SDLK_MODE; } @@ -1218,13 +1218,13 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, if (input->xkb.current_group != XKB_GROUP_INVALID) { Wayland_Keymap keymap; keymap.layout = input->xkb.current_group; - SDL_GetDefaultKeymap(keymap.keymap); + //SDL_GetDefaultKeymap(keymap.keymap); if (!input->keyboard_is_virtual) { WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, Wayland_keymap_iter, &keymap); } - SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); + //SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); } /* @@ -1398,7 +1398,7 @@ static void Wayland_ReconcileModifiers(struct SDL_WaylandInput *input) static void Wayland_HandleModifierKeys(struct SDL_WaylandInput *input, SDL_Scancode scancode, SDL_bool pressed) { - const SDL_Keycode keycode = SDL_GetKeyFromScancode(scancode); + const SDL_Keycode keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); SDL_Keymod mod; switch (keycode) { @@ -1475,7 +1475,7 @@ static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, wl_array_for_each (key, keys) { const SDL_Scancode scancode = Wayland_get_scancode_from_key(input, *key + 8); - const SDL_Keycode keycode = SDL_GetKeyFromScancode(scancode); + const SDL_Keycode keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); switch (keycode) { case SDLK_LSHIFT: @@ -1677,13 +1677,13 @@ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, /* The layout changed, remap and fire an event. Virtual keyboards use the default keymap. */ input->xkb.current_group = group; keymap.layout = group; - SDL_GetDefaultKeymap(keymap.keymap); + //SDL_GetDefaultKeymap(keymap.keymap); if (!input->keyboard_is_virtual) { WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, Wayland_keymap_iter, &keymap); } - SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); + //SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index feac17db30d99..a2206ea5a8eb9 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -111,57 +111,81 @@ void WIN_InitKeyboard(SDL_VideoDevice *_this) void WIN_UpdateKeymap(SDL_bool send_event) { - int i; SDL_Scancode scancode; - SDL_Keycode keymap[SDL_NUM_SCANCODES]; + SDL_Keymap *keymap; BYTE keyboardState[256] = { 0 }; WCHAR buffer[16]; + SDL_Keymod mods[] = { + SDL_KMOD_NONE, + SDL_KMOD_SHIFT, + SDL_KMOD_CAPS, + (SDL_KMOD_SHIFT | SDL_KMOD_CAPS), + SDL_KMOD_MODE, + (SDL_KMOD_MODE | SDL_KMOD_SHIFT), + (SDL_KMOD_MODE | SDL_KMOD_CAPS), + (SDL_KMOD_MODE | SDL_KMOD_SHIFT | SDL_KMOD_CAPS) + }; - SDL_GetDefaultKeymap(keymap); WIN_ResetDeadKeys(); - for (i = 0; i < SDL_arraysize(windows_scancode_table); i++) { - int vk, sc, result; - Uint32 *ch = 0; + keymap = SDL_CreateKeymap(); - /* Make sure this scancode is a valid character scancode */ - scancode = windows_scancode_table[i]; - if (scancode == SDL_SCANCODE_UNKNOWN) { - continue; - } + for (int m = 0; m < SDL_arraysize(mods); ++m) { + for (int i = 0; i < SDL_arraysize(windows_scancode_table); i++) { + int vk, sc, result; + Uint32 *ch = 0; - /* If this key is one of the non-mappable keys, ignore it */ - /* Uncomment the third part to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */ - if ((keymap[scancode] & SDLK_SCANCODE_MASK) || scancode == SDL_SCANCODE_DELETE /*|| scancode == SDL_SCANCODE_GRAVE*/) { - continue; - } + /* Make sure this scancode is a valid character scancode */ + scancode = windows_scancode_table[i]; + if (scancode == SDL_SCANCODE_UNKNOWN || + (SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) { + continue; + } - /* Unpack the single byte index to make the scan code. */ - sc = MAKEWORD(i & 0x7f, (i & 0x80) ? 0xe0 : 0x00); - vk = LOBYTE(MapVirtualKey(sc, MAPVK_VSC_TO_VK)); - if (!vk) { - continue; - } + /* If this key is one of the non-mappable keys, ignore it */ + /* Uncomment the second part to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */ + if (scancode == SDL_SCANCODE_DELETE /*|| scancode == SDL_SCANCODE_GRAVE*/) { + continue; + } - result = ToUnicode(vk, sc, keyboardState, buffer, 16, 0); - buffer[SDL_abs(result)] = 0; - - /* Convert UTF-16 to UTF-32 code points */ - ch = (Uint32 *)SDL_iconv_string("UTF-32LE", "UTF-16LE", (const char *)buffer, (SDL_abs(result) + 1) * sizeof(WCHAR)); - if (ch) { - /* Windows keyboard layouts can emit several UTF-32 code points on a single key press. - * Use since we cannot fit into single SDL_Keycode value in SDL keymap. - * See https://kbdlayout.info/features/ligatures for a list of such keys. */ - keymap[scancode] = ch[1] == 0 ? ch[0] : 0xfffd; - SDL_free(ch); - } + /* Unpack the single byte index to make the scan code. */ + sc = MAKEWORD(i & 0x7f, (i & 0x80) ? 0xe0 : 0x00); + vk = LOBYTE(MapVirtualKey(sc, MAPVK_VSC_TO_VK)); + if (!vk) { + continue; + } + + // Update the keyboard state for the modifiers + keyboardState[VK_SHIFT] = (mods[m] & SDL_KMOD_SHIFT) ? 0x80 : 0x00; + keyboardState[VK_CAPITAL] = (mods[m] & SDL_KMOD_CAPS) ? 0x01 : 0x00; + keyboardState[VK_CONTROL] = (mods[m] & SDL_KMOD_MODE) ? 0x80 : 0x00; + keyboardState[VK_MENU] = (mods[m] & SDL_KMOD_MODE) ? 0x80 : 0x00; + + result = ToUnicode(vk, sc, keyboardState, buffer, 16, 0); + buffer[SDL_abs(result)] = 0; + + /* Convert UTF-16 to UTF-32 code points */ + ch = (Uint32 *)SDL_iconv_string("UTF-32LE", "UTF-16LE", (const char *)buffer, (SDL_abs(result) + 1) * sizeof(WCHAR)); + if (ch) { + /* Windows keyboard layouts can emit several UTF-32 code points on a single key press. + * Use since we cannot fit into single SDL_Keycode value in SDL keymap. + * See https://kbdlayout.info/features/ligatures for a list of such keys. */ + SDL_SetKeymapEntry(keymap, scancode, mods[m], ch[1] == 0 ? ch[0] : 0xfffd); + SDL_free(ch); + } else { + // The default keymap doesn't have any SDL_KMOD_MODE entries, so we don't need to override them + if (!(mods[m] & SDL_KMOD_MODE)) { + SDL_SetKeymapEntry(keymap, scancode, mods[m], SDLK_UNKNOWN); + } + } - if (result < 0) { - WIN_ResetDeadKeys(); + if (result < 0) { + WIN_ResetDeadKeys(); + } } } - SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); + SDL_SetKeymap(keymap, send_event); } void WIN_QuitKeyboard(SDL_VideoDevice *_this) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 8f2f66e84236d..08dddeb33e0e1 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -428,7 +428,7 @@ void X11_ReconcileKeyboardState(SDL_VideoDevice *_this) if (x11KeyPressed && !sdlKeyPressed) { /* Only update modifier state for keys that are pressed in another application */ - switch (SDL_GetKeyFromScancode(scancode)) { + switch (SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE)) { case SDLK_LCTRL: case SDLK_RCTRL: case SDLK_LSHIFT: diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 6f4851f568b10..b4d8d88a8a1fe 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -257,7 +257,6 @@ int X11_InitKeyboard(SDL_VideoDevice *_this) } } if (best_index >= 0 && best_distance <= 2) { - SDL_Keycode default_keymap[SDL_NUM_SCANCODES]; int table_size; const SDL_Scancode *table = SDL_GetScancodeTable(scancode_set[best_index], &table_size); @@ -274,8 +273,6 @@ int X11_InitKeyboard(SDL_VideoDevice *_this) However, there are a number of extended scancodes that have no standard location, so use the X11 mapping for all non-character keys. */ - SDL_GetDefaultKeymap(default_keymap); - for (i = min_keycode; i <= max_keycode; ++i) { SDL_Scancode scancode = X11_KeyCodeToSDLScancode(_this, i); #ifdef DEBUG_KEYBOARD @@ -289,7 +286,7 @@ int X11_InitKeyboard(SDL_VideoDevice *_this) if (scancode == data->key_layout[i]) { continue; } - if (default_keymap[scancode] >= SDLK_SCANCODE_MASK && X11_ScancodeIsRemappable(scancode)) { + if ((SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK) && X11_ScancodeIsRemappable(scancode)) { /* Not a character key and the scancode is safe to remap */ #ifdef DEBUG_KEYBOARD SDL_Log("Changing scancode, was %d (%s), now %d (%s)\n", data->key_layout[i], SDL_GetScancodeName(data->key_layout[i]), scancode, SDL_GetScancodeName(scancode)); @@ -340,10 +337,10 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) SDL_VideoData *data = _this->driverdata; int i; SDL_Scancode scancode; - SDL_Keycode keymap[SDL_NUM_SCANCODES]; + SDL_Keymap *keymap; unsigned char group = 0; - SDL_GetDefaultKeymap(keymap); + keymap = SDL_CreateKeymap(); #ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM if (data->xkb) { @@ -356,8 +353,10 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) } #endif + // FIXME: Need to get the mapping for all modifiers, not just the first one for (i = 0; i < SDL_arraysize(data->key_layout); i++) { Uint32 key; + SDL_Keycode keycode; /* Make sure this is a valid scancode */ scancode = data->key_layout[i]; @@ -368,33 +367,37 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) /* See if there is a UCS keycode for this scancode */ key = X11_KeyCodeToUcs4(_this, (KeyCode)i, group); if (key) { - keymap[scancode] = key; + keycode = (SDL_Keycode)key; } else { SDL_Scancode keyScancode = X11_KeyCodeToSDLScancode(_this, (KeyCode)i); switch (keyScancode) { + case SDL_SCANCODE_UNKNOWN: + keycode = SDLK_UNKNOWN; + break; case SDL_SCANCODE_RETURN: - keymap[scancode] = SDLK_RETURN; + keycode = SDLK_RETURN; break; case SDL_SCANCODE_ESCAPE: - keymap[scancode] = SDLK_ESCAPE; + keycode = SDLK_ESCAPE; break; case SDL_SCANCODE_BACKSPACE: - keymap[scancode] = SDLK_BACKSPACE; + keycode = SDLK_BACKSPACE; break; case SDL_SCANCODE_TAB: - keymap[scancode] = SDLK_TAB; + keycode = SDLK_TAB; break; case SDL_SCANCODE_DELETE: - keymap[scancode] = SDLK_DELETE; + keycode = SDLK_DELETE; break; default: - keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(keyScancode); + keycode = SDL_SCANCODE_TO_KEYCODE(keyScancode); break; } } + SDL_SetKeymapEntry(keymap, scancode, SDL_KMOD_NONE, keycode); } - SDL_SetKeymap(0, keymap, SDL_NUM_SCANCODES, send_event); + SDL_SetKeymap(keymap, send_event); } void X11_QuitKeyboard(SDL_VideoDevice *_this) diff --git a/test/checkkeys.c b/test/checkkeys.c index f89a91c86cfcc..bf29a71b7bd31 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -27,8 +27,7 @@ static SDLTest_CommonState *state; static SDLTest_TextWindow *textwin; static int done; -static void -print_string(char **text, size_t *maxlen, const char *fmt, ...) +static void print_string(char **text, size_t *maxlen, const char *fmt, ...) { int len; va_list ap; @@ -46,39 +45,52 @@ print_string(char **text, size_t *maxlen, const char *fmt, ...) va_end(ap); } -static void -print_modifiers(char **text, size_t *maxlen) +static void print_modifiers(char **text, size_t *maxlen, SDL_Keymod mod) { - int mod; print_string(text, maxlen, " modifiers:"); - mod = SDL_GetModState(); - if (!mod) { + if (mod == SDL_KMOD_NONE) { print_string(text, maxlen, " (none)"); return; } - if (mod & SDL_KMOD_LSHIFT) { - print_string(text, maxlen, " LSHIFT"); - } - if (mod & SDL_KMOD_RSHIFT) { - print_string(text, maxlen, " RSHIFT"); - } - if (mod & SDL_KMOD_LCTRL) { - print_string(text, maxlen, " LCTRL"); - } - if (mod & SDL_KMOD_RCTRL) { - print_string(text, maxlen, " RCTRL"); - } - if (mod & SDL_KMOD_LALT) { - print_string(text, maxlen, " LALT"); + if ((mod & SDL_KMOD_SHIFT) == SDL_KMOD_SHIFT) { + print_string(text, maxlen, " SHIFT"); + } else { + if (mod & SDL_KMOD_LSHIFT) { + print_string(text, maxlen, " LSHIFT"); + } + if (mod & SDL_KMOD_RSHIFT) { + print_string(text, maxlen, " RSHIFT"); + } } - if (mod & SDL_KMOD_RALT) { - print_string(text, maxlen, " RALT"); + if ((mod & SDL_KMOD_CTRL) == SDL_KMOD_CTRL) { + print_string(text, maxlen, " CTRL"); + } else { + if (mod & SDL_KMOD_LCTRL) { + print_string(text, maxlen, " LCTRL"); + } + if (mod & SDL_KMOD_RCTRL) { + print_string(text, maxlen, " RCTRL"); + } } - if (mod & SDL_KMOD_LGUI) { - print_string(text, maxlen, " LGUI"); + if ((mod & SDL_KMOD_ALT) == SDL_KMOD_ALT) { + print_string(text, maxlen, " ALT"); + } else { + if (mod & SDL_KMOD_LALT) { + print_string(text, maxlen, " LALT"); + } + if (mod & SDL_KMOD_RALT) { + print_string(text, maxlen, " RALT"); + } } - if (mod & SDL_KMOD_RGUI) { - print_string(text, maxlen, " RGUI"); + if ((mod & SDL_KMOD_GUI) == SDL_KMOD_GUI) { + print_string(text, maxlen, " GUI"); + } else { + if (mod & SDL_KMOD_LGUI) { + print_string(text, maxlen, " LGUI"); + } + if (mod & SDL_KMOD_RGUI) { + print_string(text, maxlen, " RGUI"); + } } if (mod & SDL_KMOD_NUM) { print_string(text, maxlen, " NUM"); @@ -94,8 +106,47 @@ print_modifiers(char **text, size_t *maxlen) } } -static void -PrintModifierState(void) +static void PrintKeymap(void) +{ + SDL_Keymod mods[] = { + SDL_KMOD_NONE, + SDL_KMOD_SHIFT, + SDL_KMOD_CAPS, + (SDL_KMOD_SHIFT | SDL_KMOD_CAPS), + SDL_KMOD_ALT, + (SDL_KMOD_ALT | SDL_KMOD_SHIFT), + (SDL_KMOD_ALT | SDL_KMOD_CAPS), + (SDL_KMOD_ALT | SDL_KMOD_SHIFT | SDL_KMOD_CAPS), + SDL_KMOD_MODE, + (SDL_KMOD_MODE | SDL_KMOD_SHIFT), + (SDL_KMOD_MODE | SDL_KMOD_CAPS), + (SDL_KMOD_MODE | SDL_KMOD_SHIFT | SDL_KMOD_CAPS) + }; + int i, m; + + SDL_Log("Differences from the default keymap:\n"); + for (m = 0; m < SDL_arraysize(mods); ++m) { + for (i = 0; i < SDL_NUM_SCANCODES; ++i) { + SDL_Keycode key = SDL_GetKeyFromScancode((SDL_Scancode)i, mods[m]); + SDL_Keycode default_key = SDL_GetDefaultKeyFromScancode((SDL_Scancode)i, mods[m]); + if (key != default_key) { + char message[512]; + char *spot; + size_t left; + + spot = message; + left = sizeof(message); + + print_string(&spot, &left, "Scancode %s", SDL_GetScancodeName((SDL_Scancode)i)); + print_modifiers(&spot, &left, mods[m]); + print_string(&spot, &left, ": %s 0x%x (default: %s 0x%x)", SDL_GetKeyName(key), key, SDL_GetKeyName(default_key), default_key); + SDL_Log("%s", message); + } + } + } +} + +static void PrintModifierState(void) { char message[512]; char *spot; @@ -104,12 +155,11 @@ PrintModifierState(void) spot = message; left = sizeof(message); - print_modifiers(&spot, &left); + print_modifiers(&spot, &left, SDL_GetModState()); SDL_Log("Initial state:%s\n", message); } -static void -PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) +static void PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) { char message[512]; char *spot; @@ -135,15 +185,14 @@ PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) sym->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(sym->scancode), pressed ? "pressed " : "released"); } - print_modifiers(&spot, &left); + print_modifiers(&spot, &left, sym->mod); if (repeat) { print_string(&spot, &left, " (repeat)"); } SDL_Log("%s\n", message); } -static void -PrintText(const char *eventtype, const char *text) +static void PrintText(const char *eventtype, const char *text) { const char *spot; char expanded[1024]; @@ -225,6 +274,10 @@ static void loop(void) } } break; + case SDL_EVENT_KEYMAP_CHANGED: + SDL_Log("Keymap changed!\n"); + PrintKeymap(); + break; case SDL_EVENT_QUIT: done = 1; break; @@ -296,8 +349,9 @@ int main(int argc, char *argv[]) SDL_StartTextInput(); - /* Print initial modifier state */ + /* Print initial state */ SDL_PumpEvents(); + PrintKeymap(); PrintModifierState(); /* Watch keystrokes */ diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index 207115ad7a190..d825db40755e4 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -124,12 +124,12 @@ static int keyboard_getKeyFromScancode(void *arg) SDL_Keycode result; /* Case where input is valid */ - result = SDL_GetKeyFromScancode(SDL_SCANCODE_A); + result = SDL_GetKeyFromScancode(SDL_SCANCODE_A, SDL_KMOD_NONE); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)"); SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_a, result); /* Case where input is zero */ - result = SDL_GetKeyFromScancode(0); + result = SDL_GetKeyFromScancode(SDL_SCANCODE_UNKNOWN, SDL_KMOD_NONE); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(0)"); SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %d, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); @@ -138,13 +138,13 @@ static int keyboard_getKeyFromScancode(void *arg) SDLTest_AssertPass("Call to SDL_ClearError()"); /* Case where input is invalid (too small) */ - result = SDL_GetKeyFromScancode(-999); + result = SDL_GetKeyFromScancode((SDL_Scancode)-999, SDL_KMOD_NONE); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(-999)"); SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %d, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); checkInvalidScancodeError(); /* Case where input is invalid (too big) */ - result = SDL_GetKeyFromScancode(999); + result = SDL_GetKeyFromScancode((SDL_Scancode)999, SDL_KMOD_NONE); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(999)"); SDLTest_AssertCheck(result == SDLK_UNKNOWN, "Verify result from call is UNKNOWN, expected: %d, got: %" SDL_PRIs32, SDLK_UNKNOWN, result); checkInvalidScancodeError(); @@ -499,16 +499,19 @@ static int keyboard_setTextInputRectNegative(void *arg) static int keyboard_getScancodeFromKey(void *arg) { SDL_Scancode scancode; + SDL_Keymod modstate; /* Regular key */ - scancode = SDL_GetScancodeFromKey(SDLK_4); + scancode = SDL_GetDefaultScancodeFromKey(SDLK_4, &modstate); SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_4)"); - SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetScancodeFromKey, expected: %d, got: %d", SDL_SCANCODE_4, scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_4, "Validate return value from SDL_GetDefaultScancodeFromKey, expected: %d, got: %d", SDL_SCANCODE_4, scancode); + SDLTest_AssertCheck(modstate == SDL_KMOD_NONE, "Validate modstate from SDL_GetDefaultScancodeFromKey, expected: %d, got: %d", SDL_KMOD_NONE, modstate); /* Virtual key */ - scancode = SDL_GetScancodeFromKey(SDLK_PLUS); + scancode = SDL_GetDefaultScancodeFromKey(SDLK_PLUS, &modstate); SDLTest_AssertPass("Call to SDL_GetScancodeFromKey(SDLK_PLUS)"); - SDLTest_AssertCheck(scancode == 0, "Validate return value from SDL_GetScancodeFromKey, expected: 0, got: %d", scancode); + SDLTest_AssertCheck(scancode == SDL_SCANCODE_EQUALS, "Validate return value from SDL_GetDefaultScancodeFromKey, expected: %d, got: %d", SDL_SCANCODE_EQUALS, scancode); + SDLTest_AssertCheck(modstate == SDL_KMOD_SHIFT, "Validate modstate from SDL_GetDefaultScancodeFromKey, expected: %d, got: %d", SDL_KMOD_SHIFT, modstate); return TEST_COMPLETED; } From 0dd579d40d0a2940ad1c3e2e846c99c1c5bb4587 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 21 Jun 2024 19:50:10 -0700 Subject: [PATCH 013/431] Removed SDL_Keysym --- docs/README-migration.md | 18 ++++++++++++++++ include/SDL3/SDL_events.h | 19 +++++++++-------- include/SDL3/SDL_keyboard.h | 19 ----------------- src/events/SDL_events.c | 16 +++++++------- src/events/SDL_keyboard.c | 8 +++---- src/test/SDL_test_common.c | 28 ++++++++++++------------- test/checkkeys.c | 30 +++++++++++++-------------- test/checkkeysthreads.c | 26 +++++++++++------------ test/testaudio.c | 4 ++-- test/testaudiohotplug.c | 2 +- test/testaudiorecording.c | 2 +- test/testaudiostreamdynamicresample.c | 6 +++--- test/testcamera.c | 2 +- test/testcolorspace.c | 2 +- test/testcontroller.c | 26 +++++++++++------------ test/testdrawchessboard.c | 2 +- test/testffmpeg.c | 2 +- test/testgeometry.c | 8 +++---- test/testgl.c | 4 ++-- test/testgles2_sdf.c | 2 +- test/testhittesting.c | 4 ++-- test/testime.c | 10 ++++----- test/testintersections.c | 6 +++--- test/testmanymouse.c | 2 +- test/testmodal.c | 12 +++++------ test/testmouse.c | 6 +++--- test/testoverlay.c | 4 ++-- test/testpopup.c | 2 +- test/testshader.c | 4 ++-- test/testshape.c | 2 +- test/teststreaming.c | 2 +- test/testtime.c | 2 +- test/testwaylandcustom.c | 6 +++--- test/testwm.c | 6 +++--- test/testyuv.c | 6 +++--- 35 files changed, 150 insertions(+), 150 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 6420dacd6cc18..58e14fd546bb5 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -347,6 +347,21 @@ The SDL_EVENT_WINDOW_RESIZED event is always sent, even in response to SDL_SetWi The SDL_EVENT_WINDOW_SIZE_CHANGED event has been removed, and you can use SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED to detect window backbuffer size changes. +The keysym field of key events has been removed to remove one level of indirection, and `sym` has been renamed `key`. + +Code that looked like this: +```c + SDL_Event event; + SDL_Keycode key = event.key.keysym.sym; + SDL_Keymod mod = event.key.keysym.mod; +``` +now looks like this: +```c + SDL_Event event; + SDL_Keycode key = event.key.key; + SDL_Keymod mod = event.key.mod; +``` + The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor. The mouseX and mouseY fields of SDL_MouseWheelEvent have been renamed mouse_x and mouse_y. @@ -899,6 +914,9 @@ The following functions have been renamed: The following functions have been removed: * SDL_IsTextInputShown() +The following structures have been removed: +* SDL_Keysym + ## SDL_keycode.h SDL_Keycode is now Uint32 and the SDLK_* constants are now defines instead of an enum, to more clearly reflect that they are a subset of the possible values of an SDL_Keycode. diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 6fe1c77ec27be..fdde915a0e68a 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -301,16 +301,17 @@ typedef struct SDL_KeyboardDeviceEvent */ typedef struct SDL_KeyboardEvent { - SDL_EventType type; /**< SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP */ + SDL_EventType type; /**< SDL_EVENT_KEY_DOWN or SDL_EVENT_KEY_UP */ Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with keyboard focus, if any */ - SDL_KeyboardID which; /**< The keyboard instance id, or 0 if unknown or virtual */ - Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ - Uint8 repeat; /**< Non-zero if this is a key repeat */ - Uint8 padding2; - Uint8 padding3; - SDL_Keysym keysym; /**< The key that was pressed or released */ + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with keyboard focus, if any */ + SDL_KeyboardID which; /**< The keyboard instance id, or 0 if unknown or virtual */ + SDL_Scancode scancode; /**< SDL physical key code */ + SDL_Keycode key; /**< SDL virtual key code */ + SDL_Keymod mod; /**< current key modifiers */ + Uint16 raw; /**< The platform dependent scancode for this event */ + Uint8 state; /**< SDL_PRESSED or SDL_RELEASED */ + Uint8 repeat; /**< Non-zero if this is a key repeat */ } SDL_KeyboardEvent; /** diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 9e17a5d175f3f..971706f38b032 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -52,25 +52,6 @@ extern "C" { */ typedef Uint32 SDL_KeyboardID; -/** - * The SDL keysym structure, used in key events. - * - * If you are looking for translated character input, see the - * SDL_EVENT_TEXT_INPUT event. - * - * \since This struct is available since SDL 3.0.0. - * - * \sa SDL_Scancode - * \sa SDL_Keycode - */ -typedef struct SDL_Keysym -{ - SDL_Scancode scancode; /**< SDL physical key code - see SDL_Scancode for details */ - SDL_Keycode sym; /**< SDL virtual key code - see SDL_Keycode for details */ - SDL_Keymod mod; /**< current key modifiers */ - Uint16 raw; /**< The platform dependent scancode for this event */ -} SDL_Keysym; - /* Function prototypes */ /** diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 63f140d1345bb..9b28b87a8d633 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -338,14 +338,14 @@ static void SDL_LogEvent(const SDL_Event *event) break; #undef PRINT_KEYDEV_EVENT -#define PRINT_KEY_EVENT(event) \ - (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u which=%u state=%s repeat=%s scancode=%u keycode=%u mod=%u)", \ - (uint)event->key.timestamp, (uint)event->key.windowID, (uint)event->key.which, \ - event->key.state == SDL_PRESSED ? "pressed" : "released", \ - event->key.repeat ? "true" : "false", \ - (uint)event->key.keysym.scancode, \ - (uint)event->key.keysym.sym, \ - (uint)event->key.keysym.mod) +#define PRINT_KEY_EVENT(event) \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u which=%u state=%s repeat=%s scancode=%u keycode=%u mod=0x%x)", \ + (uint)event->key.timestamp, (uint)event->key.windowID, (uint)event->key.which, \ + event->key.state == SDL_PRESSED ? "pressed" : "released", \ + event->key.repeat ? "true" : "false", \ + (uint)event->key.scancode, \ + (uint)event->key.key, \ + (uint)event->key.mod) SDL_EVENT_CASE(SDL_EVENT_KEY_DOWN) PRINT_KEY_EVENT(event); break; diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 2bfc2cda7e10e..ecbfaa107a935 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -399,12 +399,12 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo SDL_Event event; event.type = type; event.common.timestamp = timestamp; + event.key.scancode = scancode; + event.key.key = keycode; + event.key.mod = keyboard->modstate; + event.key.raw = (Uint16)rawcode; event.key.state = state; event.key.repeat = repeat; - event.key.keysym.scancode = scancode; - event.key.keysym.sym = keycode; - event.key.keysym.mod = keyboard->modstate; - event.key.keysym.raw = (Uint16)rawcode; event.key.windowID = keyboard->focus ? keyboard->focus->id : 0; event.key.which = keyboardID; posted = (SDL_PushEvent(&event) > 0); diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index e3b44258aaf1b..e37b5d8f10176 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1676,9 +1676,9 @@ static void SDLTest_PrintEvent(const SDL_Event *event) case SDL_EVENT_KEY_DOWN: case SDL_EVENT_KEY_UP: { char modstr[64]; - if (event->key.keysym.mod) { + if (event->key.mod) { modstr[0] = '\0'; - SDLTest_PrintModState(modstr, sizeof (modstr), event->key.keysym.mod); + SDLTest_PrintModState(modstr, sizeof (modstr), event->key.mod); } else { SDL_strlcpy(modstr, "NONE", sizeof (modstr)); } @@ -1686,9 +1686,9 @@ static void SDLTest_PrintEvent(const SDL_Event *event) SDL_Log("SDL EVENT: Keyboard: key %s in window %" SDL_PRIu32 ": scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s, mods = %s", (event->type == SDL_EVENT_KEY_DOWN) ? "pressed" : "released", event->key.windowID, - event->key.keysym.scancode, - SDL_GetScancodeName(event->key.keysym.scancode), - event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym), + event->key.scancode, + SDL_GetScancodeName(event->key.scancode), + event->key.key, SDL_GetKeyName(event->key.key), modstr); break; } @@ -2097,11 +2097,11 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event break; case SDL_EVENT_KEY_DOWN: { - SDL_bool withControl = !!(event->key.keysym.mod & SDL_KMOD_CTRL); - SDL_bool withShift = !!(event->key.keysym.mod & SDL_KMOD_SHIFT); - SDL_bool withAlt = !!(event->key.keysym.mod & SDL_KMOD_ALT); + SDL_bool withControl = !!(event->key.mod & SDL_KMOD_CTRL); + SDL_bool withShift = !!(event->key.mod & SDL_KMOD_SHIFT); + SDL_bool withAlt = !!(event->key.mod & SDL_KMOD_ALT); - switch (event->key.keysym.sym) { + switch (event->key.key) { /* Add hotkeys here */ case SDLK_PRINTSCREEN: { @@ -2158,7 +2158,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } if (current_index >= 0) { SDL_DisplayID dest; - if (event->key.keysym.sym == SDLK_UP || event->key.keysym.sym == SDLK_LEFT) { + if (event->key.key == SDLK_UP || event->key.key == SDLK_LEFT) { dest = displays[(current_index + num_displays - 1) % num_displays]; } else { dest = displays[(current_index + num_displays + 1) % num_displays]; @@ -2180,16 +2180,16 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event int x, y; SDL_GetWindowPosition(window, &x, &y); - if (event->key.keysym.sym == SDLK_UP) { + if (event->key.key == SDLK_UP) { y -= delta; } - if (event->key.keysym.sym == SDLK_DOWN) { + if (event->key.key == SDLK_DOWN) { y += delta; } - if (event->key.keysym.sym == SDLK_LEFT) { + if (event->key.key == SDLK_LEFT) { x -= delta; } - if (event->key.keysym.sym == SDLK_RIGHT) { + if (event->key.key == SDLK_RIGHT) { x += delta; } diff --git a/test/checkkeys.c b/test/checkkeys.c index bf29a71b7bd31..d5e3ec229e3d7 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -159,7 +159,7 @@ static void PrintModifierState(void) SDL_Log("Initial state:%s\n", message); } -static void PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) +static void PrintKey(SDL_KeyboardEvent *event) { char message[512]; char *spot; @@ -169,24 +169,24 @@ static void PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) left = sizeof(message); /* Print the keycode, name and state */ - if (sym->sym) { + if (event->key) { print_string(&spot, &left, "Key %s: raw 0x%.2x, scancode %d = %s, keycode 0x%08X = %s ", - pressed ? "pressed " : "released", - sym->raw, - sym->scancode, - sym->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(sym->scancode), - sym->sym, SDL_GetKeyName(sym->sym)); + event->state ? "pressed " : "released", + event->raw, + event->scancode, + event->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(event->scancode), + event->key, SDL_GetKeyName(event->key)); } else { print_string(&spot, &left, "Unknown Key (raw 0x%.2x, scancode %d = %s) %s ", - sym->raw, - sym->scancode, - sym->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(sym->scancode), - pressed ? "pressed " : "released"); + event->raw, + event->scancode, + event->scancode == SDL_SCANCODE_UNKNOWN ? "UNKNOWN" : SDL_GetScancodeName(event->scancode), + event->state ? "pressed " : "released"); } - print_modifiers(&spot, &left, sym->mod); - if (repeat) { + print_modifiers(&spot, &left, event->mod); + if (event->repeat) { print_string(&spot, &left, " (repeat)"); } SDL_Log("%s\n", message); @@ -229,9 +229,9 @@ static void loop(void) switch (event.type) { case SDL_EVENT_KEY_DOWN: case SDL_EVENT_KEY_UP: - PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED), (event.key.repeat > 0)); + PrintKey(&event.key); if (event.type == SDL_EVENT_KEY_DOWN) { - switch (event.key.keysym.sym) { + switch (event.key.key) { case SDLK_BACKSPACE: SDLTest_TextWindowAddText(textwin, "\b"); break; diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c index db17f9d9e7134..a596bdd0bba36 100644 --- a/test/checkkeysthreads.c +++ b/test/checkkeysthreads.c @@ -120,7 +120,7 @@ PrintModifierState(void) } static void -PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) +PrintKey(SDL_KeyboardEvent *event) { char message[512]; char *spot; @@ -130,22 +130,22 @@ PrintKey(SDL_Keysym *sym, SDL_bool pressed, SDL_bool repeat) left = sizeof(message); /* Print the keycode, name and state */ - if (sym->sym) { + if (event->key) { print_string(&spot, &left, "Key %s: scancode %d = %s, keycode 0x%08X = %s ", - pressed ? "pressed " : "released", - sym->scancode, - SDL_GetScancodeName(sym->scancode), - sym->sym, SDL_GetKeyName(sym->sym)); + event->state ? "pressed " : "released", + event->scancode, + SDL_GetScancodeName(event->scancode), + event->key, SDL_GetKeyName(event->key)); } else { print_string(&spot, &left, "Unknown Key (scancode %d = %s) %s ", - sym->scancode, - SDL_GetScancodeName(sym->scancode), - pressed ? "pressed " : "released"); + event->scancode, + SDL_GetScancodeName(event->scancode), + event->state ? "pressed " : "released"); } print_modifiers(&spot, &left); - if (repeat) { + if (event->repeat) { print_string(&spot, &left, " (repeat)"); } SDL_Log("%s\n", message); @@ -177,7 +177,7 @@ static void loop(void) switch (event.type) { case SDL_EVENT_KEY_DOWN: case SDL_EVENT_KEY_UP: - PrintKey(&event.key.keysym, (event.key.state == SDL_PRESSED), (event.key.repeat > 0)); + PrintKey(&event.key); break; case SDL_EVENT_TEXT_EDITING: PrintText("EDIT", event.text.text); @@ -221,11 +221,11 @@ static int SDLCALL ping_thread(void *ptr) { int cnt; SDL_Event sdlevent; - SDL_memset(&sdlevent, 0, sizeof(SDL_Event)); + SDL_zero(sdlevent); for (cnt = 0; cnt < 10; ++cnt) { SDL_Log("sending event (%d/%d) from thread.\n", cnt + 1, 10); sdlevent.type = SDL_EVENT_KEY_DOWN; - sdlevent.key.keysym.sym = SDLK_1; + sdlevent.key.key = SDLK_1; SDL_PushEvent(&sdlevent); SDL_Delay(1000 + SDL_rand_n(1000)); } diff --git a/test/testaudio.c b/test/testaudio.c index 7b80b2fba1bcc..c2951acafc518 100644 --- a/test/testaudio.c +++ b/test/testaudio.c @@ -1185,8 +1185,8 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event) case SDL_EVENT_KEY_DOWN: case SDL_EVENT_KEY_UP: - ctrl_held = ((event->key.keysym.mod & SDL_KMOD_CTRL) != 0); - alt_held = ((event->key.keysym.mod & SDL_KMOD_ALT) != 0); + ctrl_held = ((event->key.mod & SDL_KMOD_CTRL) != 0); + alt_held = ((event->key.mod & SDL_KMOD_ALT) != 0); break; case SDL_EVENT_DROP_FILE: diff --git a/test/testaudiohotplug.c b/test/testaudiohotplug.c index 6c445529ac595..4e9b437dac68f 100644 --- a/test/testaudiohotplug.c +++ b/test/testaudiohotplug.c @@ -65,7 +65,7 @@ static void iteration(void) if (e.type == SDL_EVENT_QUIT) { done = 1; } else if (e.type == SDL_EVENT_KEY_UP) { - if (e.key.keysym.sym == SDLK_ESCAPE) { + if (e.key.key == SDLK_ESCAPE) { done = 1; } } else if (e.type == SDL_EVENT_AUDIO_DEVICE_ADDED) { diff --git a/test/testaudiorecording.c b/test/testaudiorecording.c index 33ddd264d18d7..da7f3736d86ce 100644 --- a/test/testaudiorecording.c +++ b/test/testaudiorecording.c @@ -149,7 +149,7 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event) if (event->type == SDL_EVENT_QUIT) { return SDL_APP_SUCCESS; } else if (event->type == SDL_EVENT_KEY_DOWN) { - if (event->key.keysym.sym == SDLK_ESCAPE) { + if (event->key.key == SDLK_ESCAPE) { return SDL_APP_SUCCESS; } } else if (event->type == SDL_EVENT_MOUSE_BUTTON_DOWN) { diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index 5a83bea76e7cb..c011e6712511d 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -218,7 +218,7 @@ static void loop(void) } #endif if (e.type == SDL_EVENT_KEY_DOWN) { - SDL_Keycode sym = e.key.keysym.sym; + SDL_Keycode sym = e.key.key; if (sym == SDLK_q) { if (SDL_AudioDevicePaused(state->audio_id)) { SDL_ResumeAudioDevice(state->audio_id); @@ -236,8 +236,8 @@ static void loop(void) queue_audio(); } else if (sym == SDLK_d) { float amount = 1.0f; - amount *= (e.key.keysym.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f; - amount *= (e.key.keysym.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f; + amount *= (e.key.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f; + amount *= (e.key.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f; skip_audio(amount); } } diff --git a/test/testcamera.c b/test/testcamera.c index 9e661064ae53b..e0b99925292d2 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -198,7 +198,7 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event) { switch (event->type) { case SDL_EVENT_KEY_DOWN: { - const SDL_Keycode sym = event->key.keysym.sym; + const SDL_Keycode sym = event->key.key; if (sym == SDLK_ESCAPE || sym == SDLK_AC_BACK) { SDL_Log("Key : Escape!"); return SDL_APP_SUCCESS; diff --git a/test/testcolorspace.c b/test/testcolorspace.c index 9b080b3144663..577b7d70d9a92 100644 --- a/test/testcolorspace.c +++ b/test/testcolorspace.c @@ -503,7 +503,7 @@ static void loop(void) /* Check for events */ while (SDL_PollEvent(&event)) { if (event.type == SDL_EVENT_KEY_DOWN) { - switch (event.key.keysym.sym) { + switch (event.key.key) { case SDLK_ESCAPE: done = 1; break; diff --git a/test/testcontroller.c b/test/testcontroller.c index 69a92940e6560..3b7f0c95276ae 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -1846,37 +1846,37 @@ static void loop(void *arg) case SDL_EVENT_KEY_DOWN: if (display_mode == CONTROLLER_MODE_TESTING) { - if (event.key.keysym.sym >= SDLK_0 && event.key.keysym.sym <= SDLK_9) { + if (event.key.key >= SDLK_0 && event.key.key <= SDLK_9) { if (controller && controller->gamepad) { - int player_index = (event.key.keysym.sym - SDLK_0); + int player_index = (event.key.key - SDLK_0); SDL_SetGamepadPlayerIndex(controller->gamepad, player_index); } break; - } else if (event.key.keysym.sym == SDLK_a) { + } else if (event.key.key == SDLK_a) { OpenVirtualGamepad(); - } else if (event.key.keysym.sym == SDLK_d) { + } else if (event.key.key == SDLK_d) { CloseVirtualGamepad(); - } else if (event.key.keysym.sym == SDLK_r && (event.key.keysym.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_r && (event.key.mod & SDL_KMOD_CTRL)) { SDL_ReloadGamepadMappings(); - } else if (event.key.keysym.sym == SDLK_ESCAPE) { + } else if (event.key.key == SDLK_ESCAPE) { done = SDL_TRUE; } } else if (display_mode == CONTROLLER_MODE_BINDING) { - if (event.key.keysym.sym == SDLK_c && (event.key.keysym.mod & SDL_KMOD_CTRL)) { + if (event.key.key == SDLK_c && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { CopyControllerName(); } else { CopyMapping(); } - } else if (event.key.keysym.sym == SDLK_v && (event.key.keysym.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_v && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { ClearControllerName(); PasteControllerName(); } else { PasteMapping(); } - } else if (event.key.keysym.sym == SDLK_x && (event.key.keysym.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_x && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { CopyControllerName(); ClearControllerName(); @@ -1884,19 +1884,19 @@ static void loop(void *arg) CopyMapping(); ClearMapping(); } - } else if (event.key.keysym.sym == SDLK_SPACE) { + } else if (event.key.key == SDLK_SPACE) { if (binding_element != SDL_GAMEPAD_ELEMENT_NAME) { ClearBinding(); } - } else if (event.key.keysym.sym == SDLK_BACKSPACE) { + } else if (event.key.key == SDLK_BACKSPACE) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { BackspaceControllerName(); } - } else if (event.key.keysym.sym == SDLK_RETURN) { + } else if (event.key.key == SDLK_RETURN) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { StopBinding(); } - } else if (event.key.keysym.sym == SDLK_ESCAPE) { + } else if (event.key.key == SDLK_ESCAPE) { if (binding_element != SDL_GAMEPAD_ELEMENT_INVALID) { StopBinding(); } else { diff --git a/test/testdrawchessboard.c b/test/testdrawchessboard.c index 45f37a468ff03..52c1ec23d19c0 100644 --- a/test/testdrawchessboard.c +++ b/test/testdrawchessboard.c @@ -85,7 +85,7 @@ static void loop(void) return; } - if ((e.type == SDL_EVENT_KEY_DOWN) && (e.key.keysym.sym == SDLK_ESCAPE)) { + if ((e.type == SDL_EVENT_KEY_DOWN) && (e.key.key == SDLK_ESCAPE)) { done = 1; #ifdef SDL_PLATFORM_EMSCRIPTEN emscripten_cancel_main_loop(); diff --git a/test/testffmpeg.c b/test/testffmpeg.c index 6bb30186b9d89..1f717d1b77704 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -1509,7 +1509,7 @@ int main(int argc, char *argv[]) /* Check for events */ while (SDL_PollEvent(&event)) { if (event.type == SDL_EVENT_QUIT || - (event.type == SDL_EVENT_KEY_DOWN && event.key.keysym.sym == SDLK_ESCAPE)) { + (event.type == SDL_EVENT_KEY_DOWN && event.key.key == SDLK_ESCAPE)) { done = 1; } } diff --git a/test/testgeometry.c b/test/testgeometry.c index 231f1e0045c73..cd2083ef3208c 100644 --- a/test/testgeometry.c +++ b/test/testgeometry.c @@ -95,13 +95,13 @@ static void loop(void) } } } else if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.keysym.sym == SDLK_LEFT) { + if (event.key.key == SDLK_LEFT) { translate_cx -= 1; - } else if (event.key.keysym.sym == SDLK_RIGHT) { + } else if (event.key.key == SDLK_RIGHT) { translate_cx += 1; - } else if (event.key.keysym.sym == SDLK_UP) { + } else if (event.key.key == SDLK_UP) { translate_cy -= 1; - } else if (event.key.keysym.sym == SDLK_DOWN) { + } else if (event.key.key == SDLK_DOWN) { translate_cy += 1; } else { SDLTest_CommonEvent(state, &event, &done); diff --git a/test/testgl.c b/test/testgl.c index e4482dc728d90..b79cd2aca6fb9 100644 --- a/test/testgl.c +++ b/test/testgl.c @@ -391,10 +391,10 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.keysym.sym == SDLK_o) { + if (event.key.key == SDLK_o) { swap_interval--; update_swap_interval = SDL_TRUE; - } else if (event.key.keysym.sym == SDLK_p) { + } else if (event.key.key == SDLK_p) { swap_interval++; update_swap_interval = SDL_TRUE; } diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index a8b27055f8376..af36324367573 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -337,7 +337,7 @@ static void loop(void) switch (event.type) { case SDL_EVENT_KEY_DOWN: { - const int sym = event.key.keysym.sym; + const int sym = event.key.key; if (sym == SDLK_TAB) { SDL_Log("Tab"); diff --git a/test/testhittesting.c b/test/testhittesting.c index 3fc8b1c23192d..6c5c26bcf840c 100644 --- a/test/testhittesting.c +++ b/test/testhittesting.c @@ -137,9 +137,9 @@ int main(int argc, char **argv) break; case SDL_EVENT_KEY_DOWN: - if (e.key.keysym.sym == SDLK_ESCAPE) { + if (e.key.key == SDLK_ESCAPE) { done = 1; - } else if (e.key.keysym.sym == SDLK_x) { + } else if (e.key.key == SDLK_x) { if (!areas) { areas = drag_areas; numareas = SDL_arraysize(drag_areas); diff --git a/test/testime.c b/test/testime.c index 767f9be63619e..dcf38ba00d32b 100644 --- a/test/testime.c +++ b/test/testime.c @@ -699,7 +699,7 @@ int main(int argc, char *argv[]) SDLTest_CommonEvent(state, &event, &done); switch (event.type) { case SDL_EVENT_KEY_DOWN: - switch (event.key.keysym.sym) { + switch (event.key.key) { case SDLK_RETURN: text[0] = 0x00; Redraw(); @@ -742,10 +742,10 @@ int main(int argc, char *argv[]) } SDL_Log("Keyboard: scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s\n", - event.key.keysym.scancode, - SDL_GetScancodeName(event.key.keysym.scancode), - SDL_static_cast(Uint32, event.key.keysym.sym), - SDL_GetKeyName(event.key.keysym.sym)); + event.key.scancode, + SDL_GetScancodeName(event.key.scancode), + SDL_static_cast(Uint32, event.key.key), + SDL_GetKeyName(event.key.key)); break; case SDL_EVENT_TEXT_INPUT: diff --git a/test/testintersections.c b/test/testintersections.c index 0a5faf6ac04ed..1f233b0ea75c2 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -225,9 +225,9 @@ static void loop(void *arg) } break; case SDL_EVENT_KEY_DOWN: - switch (event.key.keysym.sym) { + switch (event.key.key) { case 'l': - if (event.key.keysym.mod & SDL_KMOD_SHIFT) { + if (event.key.mod & SDL_KMOD_SHIFT) { num_lines = 0; } else { add_line( @@ -238,7 +238,7 @@ static void loop(void *arg) } break; case 'r': - if (event.key.keysym.mod & SDL_KMOD_SHIFT) { + if (event.key.mod & SDL_KMOD_SHIFT) { num_rects = 0; } else { add_rect( diff --git a/test/testmanymouse.c b/test/testmanymouse.c index e1c5a037216d5..250e128a5cc43 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -391,7 +391,7 @@ static void HandleKeyboardKeyDown(SDL_KeyboardEvent *event) continue; } if (event->which == keyboard_state->instance_id) { - switch (event->keysym.sym) { + switch (event->key) { case SDLK_LEFT: keyboard_state->position.x -= CURSOR_SIZE; if (keyboard_state->position.x < 0.0f) { diff --git a/test/testmodal.c b/test/testmodal.c index 2b2a2b54508a6..9851551f49eee 100644 --- a/test/testmodal.c +++ b/test/testmodal.c @@ -91,25 +91,25 @@ int main(int argc, char *argv[]) w1 = NULL; } } else if (e.type == SDL_EVENT_KEY_DOWN) { - if ((e.key.keysym.sym == SDLK_m || e.key.keysym.sym == SDLK_n) && !w2) { + if ((e.key.key == SDLK_m || e.key.key == SDLK_n) && !w2) { if (SDL_CreateWindowAndRenderer("Non-Modal Window", 320, 200, SDL_WINDOW_HIDDEN, &w2, &r2) < 0) { SDL_Log("Failed to create modal window and/or renderer: %s\n", SDL_GetError()); exit_code = 1; goto sdl_quit; } - if (e.key.keysym.sym == SDLK_m) { + if (e.key.key == SDLK_m) { if (!SDL_SetWindowModalFor(w2, w1)) { SDL_SetWindowTitle(w2, "Modal Window"); } } SDL_ShowWindow(w2); - } else if (e.key.keysym.sym == SDLK_ESCAPE && w2) { + } else if (e.key.key == SDLK_ESCAPE && w2) { SDL_DestroyWindow(w2); r2 = NULL; w2 = NULL; - } else if (e.key.keysym.sym == SDLK_h) { - if (e.key.keysym.mod & SDL_KMOD_CTRL) { + } else if (e.key.key == SDLK_h) { + if (e.key.mod & SDL_KMOD_CTRL) { /* Hide the parent, which should hide the modal too. */ show_deadline = SDL_GetTicksNS() + SDL_SECONDS_TO_NS(3); SDL_HideWindow(w1); @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) SDL_HideWindow(w2); } } - } else if (e.key.keysym.sym == SDLK_p && w2) { + } else if (e.key.key == SDLK_p && w2) { if (SDL_GetWindowFlags(w2) & SDL_WINDOW_MODAL) { /* Unparent the window */ if (!SDL_SetWindowModalFor(w2, NULL)) { diff --git a/test/testmouse.c b/test/testmouse.c index 1aa40cc340d71..38e42ca4c5c24 100644 --- a/test/testmouse.c +++ b/test/testmouse.c @@ -211,14 +211,14 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: - if (event.key.keysym.sym == SDLK_c) { + if (event.key.key == SDLK_c) { int x, y, w, h; SDL_GetWindowPosition(window, &x, &y); SDL_GetWindowSize(window, &w, &h); w /= 2; h /= 2; - if (event.key.keysym.mod & SDL_KMOD_ALT) { + if (event.key.mod & SDL_KMOD_ALT) { SDL_WarpMouseGlobal((float)(x + w), (float)(y + h)); } else { SDL_WarpMouseInWindow(window, (float)w, (float)h); @@ -226,7 +226,7 @@ static void loop(void *arg) } SDL_FALLTHROUGH; case SDL_EVENT_KEY_UP: - switch (event.key.keysym.sym) { + switch (event.key.key) { case SDLK_LSHIFT: isRect = (event.key.state == SDL_PRESSED); if (active) { diff --git a/test/testoverlay.c b/test/testoverlay.c index 81a73b5d0213d..d87c292b68bb9 100644 --- a/test/testoverlay.c +++ b/test/testoverlay.c @@ -275,11 +275,11 @@ static void loop(void) } break; case SDL_EVENT_KEY_DOWN: - if (event.key.keysym.sym == SDLK_SPACE) { + if (event.key.key == SDLK_SPACE) { paused = !paused; break; } - if (event.key.keysym.sym != SDLK_ESCAPE) { + if (event.key.key != SDLK_ESCAPE) { break; } break; diff --git a/test/testpopup.c b/test/testpopup.c index ec136284faccc..8084bad63ca7c 100644 --- a/test/testpopup.c +++ b/test/testpopup.c @@ -171,7 +171,7 @@ static void loop(void) } } } else if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.keysym.sym == SDLK_SPACE) { + if (event.key.key == SDLK_SPACE) { for (i = 0; i < num_menus; ++i) { if (SDL_GetWindowFlags(menus[i].win) & SDL_WINDOW_HIDDEN) { SDL_ShowWindow(menus[i].win); diff --git a/test/testshader.c b/test/testshader.c index 9e7f812e109e3..aa299077abd38 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -532,10 +532,10 @@ int main(int argc, char **argv) done = 1; } if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.keysym.sym == SDLK_SPACE) { + if (event.key.key == SDLK_SPACE) { current_shader = (current_shader + 1) % NUM_SHADERS; } - if (event.key.keysym.sym == SDLK_ESCAPE) { + if (event.key.key == SDLK_ESCAPE) { done = 1; } } diff --git a/test/testshape.c b/test/testshape.c index bf2a2a26847e1..2f226c83b0d92 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_EVENT_KEY_DOWN: - if (event.key.keysym.sym == SDLK_ESCAPE) { + if (event.key.key == SDLK_ESCAPE) { done = SDL_TRUE; } break; diff --git a/test/teststreaming.c b/test/teststreaming.c index 6f424bc0a9e84..3a511d8a04000 100644 --- a/test/teststreaming.c +++ b/test/teststreaming.c @@ -107,7 +107,7 @@ static void loop(void) while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_EVENT_KEY_DOWN: - if (event.key.keysym.sym == SDLK_ESCAPE) { + if (event.key.key == SDLK_ESCAPE) { done = SDL_TRUE; } break; diff --git a/test/testtime.c b/test/testtime.c index ab2fcef9d9782..505c05ebcb5dd 100644 --- a/test/testtime.c +++ b/test/testtime.c @@ -176,7 +176,7 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); if (event.type == SDL_EVENT_KEY_DOWN) { - switch (event.key.keysym.sym) { + switch (event.key.key) { case SDLK_UP: if (++cal_month > 12) { cal_month = 1; diff --git a/test/testwaylandcustom.c b/test/testwaylandcustom.c index 65b932bef6b1f..2703b5faecd5e 100644 --- a/test/testwaylandcustom.c +++ b/test/testwaylandcustom.c @@ -260,13 +260,13 @@ int main(int argc, char **argv) SDL_Event event; while (SDL_PollEvent(&event)) { if (event.type == SDL_EVENT_KEY_DOWN) { - switch (event.key.keysym.sym) { + switch (event.key.key) { case SDLK_ESCAPE: done = 1; break; case SDLK_EQUALS: /* Ctrl+ enlarges the window */ - if (event.key.keysym.mod & SDL_KMOD_CTRL) { + if (event.key.mod & SDL_KMOD_CTRL) { int w, h; SDL_GetWindowSize(window, &w, &h); SDL_SetWindowSize(window, w * 2, h * 2); @@ -274,7 +274,7 @@ int main(int argc, char **argv) break; case SDLK_MINUS: /* Ctrl- shrinks the window */ - if (event.key.keysym.mod & SDL_KMOD_CTRL) { + if (event.key.mod & SDL_KMOD_CTRL) { int w, h; SDL_GetWindowSize(window, &w, &h); SDL_SetWindowSize(window, w / 2, h / 2); diff --git a/test/testwm.c b/test/testwm.c index 4dd9ec1698bcf..0d454ccc5525b 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -189,15 +189,15 @@ static void loop(void) if (event.type == SDL_EVENT_KEY_UP) { SDL_bool updateCursor = SDL_FALSE; - if (event.key.keysym.sym == SDLK_a) { + if (event.key.key == SDLK_a) { SDL_assert(!"Keyboard generated assert"); - } else if (event.key.keysym.sym == SDLK_LEFT) { + } else if (event.key.key == SDLK_LEFT) { --system_cursor; if (system_cursor < 0) { system_cursor = SDL_NUM_SYSTEM_CURSORS - 1; } updateCursor = SDL_TRUE; - } else if (event.key.keysym.sym == SDLK_RIGHT) { + } else if (event.key.key == SDLK_RIGHT) { ++system_cursor; if (system_cursor >= SDL_NUM_SYSTEM_CURSORS) { system_cursor = 0; diff --git a/test/testyuv.c b/test/testyuv.c index cabffdaee109d..523e82d8c0b6a 100644 --- a/test/testyuv.c +++ b/test/testyuv.c @@ -507,11 +507,11 @@ int main(int argc, char **argv) done = 1; } if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.keysym.sym == SDLK_ESCAPE) { + if (event.key.key == SDLK_ESCAPE) { done = 1; - } else if (event.key.keysym.sym == SDLK_LEFT) { + } else if (event.key.key == SDLK_LEFT) { --current; - } else if (event.key.keysym.sym == SDLK_RIGHT) { + } else if (event.key.key == SDLK_RIGHT) { ++current; } } From c9cfa4688ebbce108604793f7673f9b81d0cb61a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 21 Jun 2024 20:40:26 -0700 Subject: [PATCH 014/431] Use unsigned constants for SDL_Keycode values Fixes https://github.com/libsdl-org/SDL/issues/10020 Closes https://github.com/libsdl-org/SDL/pull/10070 --- include/SDL3/SDL_keycode.h | 550 ++++++++++++++++++------------------- 1 file changed, 275 insertions(+), 275 deletions(-) diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index 257b36e5bd96d..97a04357454d5 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -48,282 +48,282 @@ */ typedef Uint32 SDL_Keycode; -#define SDLK_SCANCODE_MASK (1u<<30) +#define SDLK_SCANCODE_MASK (1u<<30) #define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK) -#define SDLK_UNKNOWN 0 -#define SDLK_RETURN '\r' -#define SDLK_ESCAPE '\x1B' -#define SDLK_BACKSPACE '\b' -#define SDLK_TAB '\t' -#define SDLK_SPACE ' ' -#define SDLK_EXCLAIM '!' -#define SDLK_DBLAPOSTROPHE '"' -#define SDLK_HASH '#' -#define SDLK_PERCENT '%' -#define SDLK_DOLLAR '$' -#define SDLK_AMPERSAND '&' -#define SDLK_APOSTROPHE '\'' -#define SDLK_LEFTPAREN '(' -#define SDLK_RIGHTPAREN ')' -#define SDLK_ASTERISK '*' -#define SDLK_PLUS '+' -#define SDLK_COMMA ',' -#define SDLK_MINUS '-' -#define SDLK_PERIOD '.' -#define SDLK_SLASH '/' -#define SDLK_0 '0' -#define SDLK_1 '1' -#define SDLK_2 '2' -#define SDLK_3 '3' -#define SDLK_4 '4' -#define SDLK_5 '5' -#define SDLK_6 '6' -#define SDLK_7 '7' -#define SDLK_8 '8' -#define SDLK_9 '9' -#define SDLK_COLON ':' -#define SDLK_SEMICOLON ';' -#define SDLK_LESS '<' -#define SDLK_EQUALS '=' -#define SDLK_GREATER '>' -#define SDLK_QUESTION '?' -#define SDLK_AT '@' -#define SDLK_A 'A' -#define SDLK_B 'B' -#define SDLK_C 'C' -#define SDLK_D 'D' -#define SDLK_E 'E' -#define SDLK_F 'F' -#define SDLK_G 'G' -#define SDLK_H 'H' -#define SDLK_I 'I' -#define SDLK_J 'J' -#define SDLK_K 'K' -#define SDLK_L 'L' -#define SDLK_M 'M' -#define SDLK_N 'N' -#define SDLK_O 'O' -#define SDLK_P 'P' -#define SDLK_Q 'Q' -#define SDLK_R 'R' -#define SDLK_S 'S' -#define SDLK_T 'T' -#define SDLK_U 'U' -#define SDLK_V 'V' -#define SDLK_W 'W' -#define SDLK_X 'X' -#define SDLK_Y 'Y' -#define SDLK_Z 'Z' -#define SDLK_LEFTBRACKET '[' -#define SDLK_BACKSLASH '\\' -#define SDLK_RIGHTBRACKET ']' -#define SDLK_CARET '^' -#define SDLK_UNDERSCORE '_' -#define SDLK_GRAVE '`' -#define SDLK_a 'a' -#define SDLK_b 'b' -#define SDLK_c 'c' -#define SDLK_d 'd' -#define SDLK_e 'e' -#define SDLK_f 'f' -#define SDLK_g 'g' -#define SDLK_h 'h' -#define SDLK_i 'i' -#define SDLK_j 'j' -#define SDLK_k 'k' -#define SDLK_l 'l' -#define SDLK_m 'm' -#define SDLK_n 'n' -#define SDLK_o 'o' -#define SDLK_p 'p' -#define SDLK_q 'q' -#define SDLK_r 'r' -#define SDLK_s 's' -#define SDLK_t 't' -#define SDLK_u 'u' -#define SDLK_v 'v' -#define SDLK_w 'w' -#define SDLK_x 'x' -#define SDLK_y 'y' -#define SDLK_z 'z' -#define SDLK_LEFTBRACE '{' -#define SDLK_PIPE '|' -#define SDLK_RIGHTBRACE '}' -#define SDLK_TILDE '~' -#define SDLK_DELETE '\x7F' -#define SDLK_CAPSLOCK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK) -#define SDLK_F1 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1) -#define SDLK_F2 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2) -#define SDLK_F3 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3) -#define SDLK_F4 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4) -#define SDLK_F5 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5) -#define SDLK_F6 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6) -#define SDLK_F7 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7) -#define SDLK_F8 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8) -#define SDLK_F9 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9) -#define SDLK_F10 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10) -#define SDLK_F11 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11) -#define SDLK_F12 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12) -#define SDLK_PRINTSCREEN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN) -#define SDLK_SCROLLLOCK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK) -#define SDLK_PAUSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE) -#define SDLK_INSERT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT) -#define SDLK_HOME SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME) -#define SDLK_PAGEUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP) -#define SDLK_END SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END) -#define SDLK_PAGEDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN) -#define SDLK_RIGHT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT) -#define SDLK_LEFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT) -#define SDLK_DOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN) -#define SDLK_UP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP) -#define SDLK_NUMLOCKCLEAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR) -#define SDLK_KP_DIVIDE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE) -#define SDLK_KP_MULTIPLY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY) -#define SDLK_KP_MINUS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS) -#define SDLK_KP_PLUS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS) -#define SDLK_KP_ENTER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER) -#define SDLK_KP_1 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1) -#define SDLK_KP_2 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2) -#define SDLK_KP_3 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3) -#define SDLK_KP_4 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4) -#define SDLK_KP_5 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5) -#define SDLK_KP_6 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6) -#define SDLK_KP_7 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7) -#define SDLK_KP_8 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8) -#define SDLK_KP_9 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9) -#define SDLK_KP_0 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0) -#define SDLK_KP_PERIOD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD) -#define SDLK_APPLICATION SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION) -#define SDLK_POWER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER) -#define SDLK_KP_EQUALS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS) -#define SDLK_F13 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13) -#define SDLK_F14 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14) -#define SDLK_F15 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15) -#define SDLK_F16 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16) -#define SDLK_F17 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17) -#define SDLK_F18 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18) -#define SDLK_F19 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19) -#define SDLK_F20 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20) -#define SDLK_F21 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21) -#define SDLK_F22 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22) -#define SDLK_F23 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23) -#define SDLK_F24 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24) -#define SDLK_EXECUTE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE) -#define SDLK_HELP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP) -#define SDLK_MENU SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU) -#define SDLK_SELECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT) -#define SDLK_STOP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP) -#define SDLK_AGAIN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN) -#define SDLK_UNDO SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO) -#define SDLK_CUT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT) -#define SDLK_COPY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY) -#define SDLK_PASTE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE) -#define SDLK_FIND SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND) -#define SDLK_MUTE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE) -#define SDLK_VOLUMEUP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP) -#define SDLK_VOLUMEDOWN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN) -#define SDLK_KP_COMMA SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA) -#define SDLK_KP_EQUALSAS400 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400) -#define SDLK_ALTERASE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE) -#define SDLK_SYSREQ SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ) -#define SDLK_CANCEL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL) -#define SDLK_CLEAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR) -#define SDLK_PRIOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR) -#define SDLK_RETURN2 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2) -#define SDLK_SEPARATOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR) -#define SDLK_OUT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT) -#define SDLK_OPER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER) -#define SDLK_CLEARAGAIN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN) -#define SDLK_CRSEL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL) -#define SDLK_EXSEL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL) -#define SDLK_KP_00 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00) -#define SDLK_KP_000 SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000) -#define SDLK_THOUSANDSSEPARATOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR) -#define SDLK_DECIMALSEPARATOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR) -#define SDLK_CURRENCYUNIT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT) -#define SDLK_CURRENCYSUBUNIT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT) -#define SDLK_KP_LEFTPAREN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN) -#define SDLK_KP_RIGHTPAREN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN) -#define SDLK_KP_LEFTBRACE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE) -#define SDLK_KP_RIGHTBRACE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE) -#define SDLK_KP_TAB SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB) -#define SDLK_KP_BACKSPACE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE) -#define SDLK_KP_A SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A) -#define SDLK_KP_B SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B) -#define SDLK_KP_C SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C) -#define SDLK_KP_D SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D) -#define SDLK_KP_E SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E) -#define SDLK_KP_F SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F) -#define SDLK_KP_XOR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR) -#define SDLK_KP_POWER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER) -#define SDLK_KP_PERCENT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT) -#define SDLK_KP_LESS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS) -#define SDLK_KP_GREATER SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER) -#define SDLK_KP_AMPERSAND SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND) -#define SDLK_KP_DBLAMPERSAND SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND) -#define SDLK_KP_VERTICALBAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR) -#define SDLK_KP_DBLVERTICALBAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR) -#define SDLK_KP_COLON SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON) -#define SDLK_KP_HASH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH) -#define SDLK_KP_SPACE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE) -#define SDLK_KP_AT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT) -#define SDLK_KP_EXCLAM SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM) -#define SDLK_KP_MEMSTORE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE) -#define SDLK_KP_MEMRECALL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL) -#define SDLK_KP_MEMCLEAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR) -#define SDLK_KP_MEMADD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD) -#define SDLK_KP_MEMSUBTRACT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT) -#define SDLK_KP_MEMMULTIPLY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY) -#define SDLK_KP_MEMDIVIDE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE) -#define SDLK_KP_PLUSMINUS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS) -#define SDLK_KP_CLEAR SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR) -#define SDLK_KP_CLEARENTRY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY) -#define SDLK_KP_BINARY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY) -#define SDLK_KP_OCTAL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL) -#define SDLK_KP_DECIMAL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL) -#define SDLK_KP_HEXADECIMAL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL) -#define SDLK_LCTRL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL) -#define SDLK_LSHIFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT) -#define SDLK_LALT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT) -#define SDLK_LGUI SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI) -#define SDLK_RCTRL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL) -#define SDLK_RSHIFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT) -#define SDLK_RALT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT) -#define SDLK_RGUI SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI) -#define SDLK_MODE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE) -#define SDLK_SLEEP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) -#define SDLK_WAKE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WAKE) -#define SDLK_CHANNEL_INCREMENT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_INCREMENT) -#define SDLK_CHANNEL_DECREMENT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_DECREMENT) -#define SDLK_MEDIA_PLAY SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY) -#define SDLK_MEDIA_PAUSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PAUSE) -#define SDLK_MEDIA_RECORD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_RECORD) -#define SDLK_MEDIA_FAST_FORWARD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_FAST_FORWARD) -#define SDLK_MEDIA_REWIND SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_REWIND) -#define SDLK_MEDIA_NEXT_TRACK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_NEXT_TRACK) -#define SDLK_MEDIA_PREVIOUS_TRACK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PREVIOUS_TRACK) -#define SDLK_MEDIA_STOP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_STOP) -#define SDLK_MEDIA_EJECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_EJECT) -#define SDLK_MEDIA_PLAY_PAUSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY_PAUSE) -#define SDLK_MEDIA_SELECT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_SELECT) -#define SDLK_AC_NEW SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_NEW) -#define SDLK_AC_OPEN SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_OPEN) -#define SDLK_AC_CLOSE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_CLOSE) -#define SDLK_AC_EXIT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_EXIT) -#define SDLK_AC_SAVE SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SAVE) -#define SDLK_AC_PRINT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PRINT) -#define SDLK_AC_PROPERTIES SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PROPERTIES) -#define SDLK_AC_SEARCH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH) -#define SDLK_AC_HOME SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME) -#define SDLK_AC_BACK SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK) -#define SDLK_AC_FORWARD SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD) -#define SDLK_AC_STOP SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP) -#define SDLK_AC_REFRESH SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH) -#define SDLK_AC_BOOKMARKS SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS) -#define SDLK_SOFTLEFT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT) -#define SDLK_SOFTRIGHT SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) -#define SDLK_CALL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) -#define SDLK_ENDCALL SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) +#define SDLK_UNKNOWN 0x00000000u /* 0 */ +#define SDLK_RETURN 0x0000000du /* '\r' */ +#define SDLK_ESCAPE 0x0000001bu /* '\x1B' */ +#define SDLK_BACKSPACE 0x00000008u /* '\b' */ +#define SDLK_TAB 0x00000009u /* '\t' */ +#define SDLK_SPACE 0x00000020u /* ' ' */ +#define SDLK_EXCLAIM 0x00000021u /* '!' */ +#define SDLK_DBLAPOSTROPHE 0x00000022u /* '"' */ +#define SDLK_HASH 0x00000023u /* '#' */ +#define SDLK_PERCENT 0x00000025u /* '%' */ +#define SDLK_DOLLAR 0x00000024u /* '$' */ +#define SDLK_AMPERSAND 0x00000026u /* '&' */ +#define SDLK_APOSTROPHE 0x00000027u /* '\'' */ +#define SDLK_LEFTPAREN 0x00000028u /* '(' */ +#define SDLK_RIGHTPAREN 0x00000029u /* ')' */ +#define SDLK_ASTERISK 0x0000002au /* '*' */ +#define SDLK_PLUS 0x0000002bu /* '+' */ +#define SDLK_COMMA 0x0000002cu /* ',' */ +#define SDLK_MINUS 0x0000002du /* '-' */ +#define SDLK_PERIOD 0x0000002eu /* '.' */ +#define SDLK_SLASH 0x0000002fu /* '/' */ +#define SDLK_0 0x00000030u /* '0' */ +#define SDLK_1 0x00000031u /* '1' */ +#define SDLK_2 0x00000032u /* '2' */ +#define SDLK_3 0x00000033u /* '3' */ +#define SDLK_4 0x00000034u /* '4' */ +#define SDLK_5 0x00000035u /* '5' */ +#define SDLK_6 0x00000036u /* '6' */ +#define SDLK_7 0x00000037u /* '7' */ +#define SDLK_8 0x00000038u /* '8' */ +#define SDLK_9 0x00000039u /* '9' */ +#define SDLK_COLON 0x0000003au /* ':' */ +#define SDLK_SEMICOLON 0x0000003bu /* ';' */ +#define SDLK_LESS 0x0000003cu /* '<' */ +#define SDLK_EQUALS 0x0000003du /* '=' */ +#define SDLK_GREATER 0x0000003eu /* '>' */ +#define SDLK_QUESTION 0x0000003fu /* '?' */ +#define SDLK_AT 0x00000040u /* '@' */ +#define SDLK_A 0x00000041u /* 'A' */ +#define SDLK_B 0x00000042u /* 'B' */ +#define SDLK_C 0x00000043u /* 'C' */ +#define SDLK_D 0x00000044u /* 'D' */ +#define SDLK_E 0x00000045u /* 'E' */ +#define SDLK_F 0x00000046u /* 'F' */ +#define SDLK_G 0x00000047u /* 'G' */ +#define SDLK_H 0x00000048u /* 'H' */ +#define SDLK_I 0x00000049u /* 'I' */ +#define SDLK_J 0x0000004au /* 'J' */ +#define SDLK_K 0x0000004bu /* 'K' */ +#define SDLK_L 0x0000004cu /* 'L' */ +#define SDLK_M 0x0000004du /* 'M' */ +#define SDLK_N 0x0000004eu /* 'N' */ +#define SDLK_O 0x0000004fu /* 'O' */ +#define SDLK_P 0x00000050u /* 'P' */ +#define SDLK_Q 0x00000051u /* 'Q' */ +#define SDLK_R 0x00000052u /* 'R' */ +#define SDLK_S 0x00000053u /* 'S' */ +#define SDLK_T 0x00000054u /* 'T' */ +#define SDLK_U 0x00000055u /* 'U' */ +#define SDLK_V 0x00000056u /* 'V' */ +#define SDLK_W 0x00000057u /* 'W' */ +#define SDLK_X 0x00000058u /* 'X' */ +#define SDLK_Y 0x00000059u /* 'Y' */ +#define SDLK_Z 0x0000005au /* 'Z' */ +#define SDLK_LEFTBRACKET 0x0000005bu /* '[' */ +#define SDLK_BACKSLASH 0x0000005cu /* '\\' */ +#define SDLK_RIGHTBRACKET 0x0000005du /* ']' */ +#define SDLK_CARET 0x0000005eu /* '^' */ +#define SDLK_UNDERSCORE 0x0000005fu /* '_' */ +#define SDLK_GRAVE 0x00000060u /* '`' */ +#define SDLK_a 0x00000061u /* 'a' */ +#define SDLK_b 0x00000062u /* 'b' */ +#define SDLK_c 0x00000063u /* 'c' */ +#define SDLK_d 0x00000064u /* 'd' */ +#define SDLK_e 0x00000065u /* 'e' */ +#define SDLK_f 0x00000066u /* 'f' */ +#define SDLK_g 0x00000067u /* 'g' */ +#define SDLK_h 0x00000068u /* 'h' */ +#define SDLK_i 0x00000069u /* 'i' */ +#define SDLK_j 0x0000006au /* 'j' */ +#define SDLK_k 0x0000006bu /* 'k' */ +#define SDLK_l 0x0000006cu /* 'l' */ +#define SDLK_m 0x0000006du /* 'm' */ +#define SDLK_n 0x0000006eu /* 'n' */ +#define SDLK_o 0x0000006fu /* 'o' */ +#define SDLK_p 0x00000070u /* 'p' */ +#define SDLK_q 0x00000071u /* 'q' */ +#define SDLK_r 0x00000072u /* 'r' */ +#define SDLK_s 0x00000073u /* 's' */ +#define SDLK_t 0x00000074u /* 't' */ +#define SDLK_u 0x00000075u /* 'u' */ +#define SDLK_v 0x00000076u /* 'v' */ +#define SDLK_w 0x00000077u /* 'w' */ +#define SDLK_x 0x00000078u /* 'x' */ +#define SDLK_y 0x00000079u /* 'y' */ +#define SDLK_z 0x0000007au /* 'z' */ +#define SDLK_LEFTBRACE 0x0000007bu /* '{' */ +#define SDLK_PIPE 0x0000007cu /* '|' */ +#define SDLK_RIGHTBRACE 0x0000007du /* '}' */ +#define SDLK_TILDE 0x0000007eu /* '~' */ +#define SDLK_DELETE 0x0000007fu /* '\x7F' */ +#define SDLK_CAPSLOCK 0x40000039u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK) */ +#define SDLK_F1 0x4000003au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1) */ +#define SDLK_F2 0x4000003bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2) */ +#define SDLK_F3 0x4000003cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F3) */ +#define SDLK_F4 0x4000003du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F4) */ +#define SDLK_F5 0x4000003eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F5) */ +#define SDLK_F6 0x4000003fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F6) */ +#define SDLK_F7 0x40000040u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F7) */ +#define SDLK_F8 0x40000041u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F8) */ +#define SDLK_F9 0x40000042u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F9) */ +#define SDLK_F10 0x40000043u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F10) */ +#define SDLK_F11 0x40000044u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F11) */ +#define SDLK_F12 0x40000045u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F12) */ +#define SDLK_PRINTSCREEN 0x40000046u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRINTSCREEN) */ +#define SDLK_SCROLLLOCK 0x40000047u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SCROLLLOCK) */ +#define SDLK_PAUSE 0x40000048u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAUSE) */ +#define SDLK_INSERT 0x40000049u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_INSERT) */ +#define SDLK_HOME 0x4000004au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HOME) */ +#define SDLK_PAGEUP 0x4000004bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEUP) */ +#define SDLK_END 0x4000004du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_END) */ +#define SDLK_PAGEDOWN 0x4000004eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PAGEDOWN) */ +#define SDLK_RIGHT 0x4000004fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RIGHT) */ +#define SDLK_LEFT 0x40000050u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LEFT) */ +#define SDLK_DOWN 0x40000051u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN) */ +#define SDLK_UP 0x40000052u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP) */ +#define SDLK_NUMLOCKCLEAR 0x40000053u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR) */ +#define SDLK_KP_DIVIDE 0x40000054u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE) */ +#define SDLK_KP_MULTIPLY 0x40000055u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY) */ +#define SDLK_KP_MINUS 0x40000056u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS) */ +#define SDLK_KP_PLUS 0x40000057u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS) */ +#define SDLK_KP_ENTER 0x40000058u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER) */ +#define SDLK_KP_1 0x40000059u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1) */ +#define SDLK_KP_2 0x4000005au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2) */ +#define SDLK_KP_3 0x4000005bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3) */ +#define SDLK_KP_4 0x4000005cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4) */ +#define SDLK_KP_5 0x4000005du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5) */ +#define SDLK_KP_6 0x4000005eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6) */ +#define SDLK_KP_7 0x4000005fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7) */ +#define SDLK_KP_8 0x40000060u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8) */ +#define SDLK_KP_9 0x40000061u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9) */ +#define SDLK_KP_0 0x40000062u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0) */ +#define SDLK_KP_PERIOD 0x40000063u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD) */ +#define SDLK_APPLICATION 0x40000065u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION) */ +#define SDLK_POWER 0x40000066u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER) */ +#define SDLK_KP_EQUALS 0x40000067u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS) */ +#define SDLK_F13 0x40000068u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13) */ +#define SDLK_F14 0x40000069u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14) */ +#define SDLK_F15 0x4000006au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15) */ +#define SDLK_F16 0x4000006bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F16) */ +#define SDLK_F17 0x4000006cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F17) */ +#define SDLK_F18 0x4000006du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F18) */ +#define SDLK_F19 0x4000006eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F19) */ +#define SDLK_F20 0x4000006fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F20) */ +#define SDLK_F21 0x40000070u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F21) */ +#define SDLK_F22 0x40000071u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F22) */ +#define SDLK_F23 0x40000072u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F23) */ +#define SDLK_F24 0x40000073u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F24) */ +#define SDLK_EXECUTE 0x40000074u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXECUTE) */ +#define SDLK_HELP 0x40000075u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_HELP) */ +#define SDLK_MENU 0x40000076u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MENU) */ +#define SDLK_SELECT 0x40000077u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SELECT) */ +#define SDLK_STOP 0x40000078u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_STOP) */ +#define SDLK_AGAIN 0x40000079u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AGAIN) */ +#define SDLK_UNDO 0x4000007au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UNDO) */ +#define SDLK_CUT 0x4000007bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CUT) */ +#define SDLK_COPY 0x4000007cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_COPY) */ +#define SDLK_PASTE 0x4000007du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PASTE) */ +#define SDLK_FIND 0x4000007eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_FIND) */ +#define SDLK_MUTE 0x4000007fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE) */ +#define SDLK_VOLUMEUP 0x40000080u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP) */ +#define SDLK_VOLUMEDOWN 0x40000081u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN) */ +#define SDLK_KP_COMMA 0x40000085u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA) */ +#define SDLK_KP_EQUALSAS400 0x40000086u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400) */ +#define SDLK_ALTERASE 0x40000099u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE) */ +#define SDLK_SYSREQ 0x4000009au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ) */ +#define SDLK_CANCEL 0x4000009bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL) */ +#define SDLK_CLEAR 0x4000009cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEAR) */ +#define SDLK_PRIOR 0x4000009du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_PRIOR) */ +#define SDLK_RETURN2 0x4000009eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RETURN2) */ +#define SDLK_SEPARATOR 0x4000009fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SEPARATOR) */ +#define SDLK_OUT 0x400000a0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OUT) */ +#define SDLK_OPER 0x400000a1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_OPER) */ +#define SDLK_CLEARAGAIN 0x400000a2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CLEARAGAIN) */ +#define SDLK_CRSEL 0x400000a3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CRSEL) */ +#define SDLK_EXSEL 0x400000a4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_EXSEL) */ +#define SDLK_KP_00 0x400000b0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_00) */ +#define SDLK_KP_000 0x400000b1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_000) */ +#define SDLK_THOUSANDSSEPARATOR 0x400000b2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_THOUSANDSSEPARATOR) */ +#define SDLK_DECIMALSEPARATOR 0x400000b3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR) */ +#define SDLK_CURRENCYUNIT 0x400000b4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT) */ +#define SDLK_CURRENCYSUBUNIT 0x400000b5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT) */ +#define SDLK_KP_LEFTPAREN 0x400000b6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN) */ +#define SDLK_KP_RIGHTPAREN 0x400000b7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN) */ +#define SDLK_KP_LEFTBRACE 0x400000b8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE) */ +#define SDLK_KP_RIGHTBRACE 0x400000b9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE) */ +#define SDLK_KP_TAB 0x400000bau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB) */ +#define SDLK_KP_BACKSPACE 0x400000bbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE) */ +#define SDLK_KP_A 0x400000bcu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A) */ +#define SDLK_KP_B 0x400000bdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B) */ +#define SDLK_KP_C 0x400000beu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C) */ +#define SDLK_KP_D 0x400000bfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D) */ +#define SDLK_KP_E 0x400000c0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E) */ +#define SDLK_KP_F 0x400000c1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F) */ +#define SDLK_KP_XOR 0x400000c2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR) */ +#define SDLK_KP_POWER 0x400000c3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER) */ +#define SDLK_KP_PERCENT 0x400000c4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT) */ +#define SDLK_KP_LESS 0x400000c5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS) */ +#define SDLK_KP_GREATER 0x400000c6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER) */ +#define SDLK_KP_AMPERSAND 0x400000c7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND) */ +#define SDLK_KP_DBLAMPERSAND 0x400000c8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND) */ +#define SDLK_KP_VERTICALBAR 0x400000c9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR) */ +#define SDLK_KP_DBLVERTICALBAR 0x400000cau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR) */ +#define SDLK_KP_COLON 0x400000cbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON) */ +#define SDLK_KP_HASH 0x400000ccu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH) */ +#define SDLK_KP_SPACE 0x400000cdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE) */ +#define SDLK_KP_AT 0x400000ceu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT) */ +#define SDLK_KP_EXCLAM 0x400000cfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM) */ +#define SDLK_KP_MEMSTORE 0x400000d0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE) */ +#define SDLK_KP_MEMRECALL 0x400000d1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL) */ +#define SDLK_KP_MEMCLEAR 0x400000d2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR) */ +#define SDLK_KP_MEMADD 0x400000d3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMADD) */ +#define SDLK_KP_MEMSUBTRACT 0x400000d4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT) */ +#define SDLK_KP_MEMMULTIPLY 0x400000d5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY) */ +#define SDLK_KP_MEMDIVIDE 0x400000d6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE) */ +#define SDLK_KP_PLUSMINUS 0x400000d7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS) */ +#define SDLK_KP_CLEAR 0x400000d8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR) */ +#define SDLK_KP_CLEARENTRY 0x400000d9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY) */ +#define SDLK_KP_BINARY 0x400000dau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY) */ +#define SDLK_KP_OCTAL 0x400000dbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_OCTAL) */ +#define SDLK_KP_DECIMAL 0x400000dcu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DECIMAL) */ +#define SDLK_KP_HEXADECIMAL 0x400000ddu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HEXADECIMAL) */ +#define SDLK_LCTRL 0x400000e0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LCTRL) */ +#define SDLK_LSHIFT 0x400000e1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LSHIFT) */ +#define SDLK_LALT 0x400000e2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LALT) */ +#define SDLK_LGUI 0x400000e3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_LGUI) */ +#define SDLK_RCTRL 0x400000e4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RCTRL) */ +#define SDLK_RSHIFT 0x400000e5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RSHIFT) */ +#define SDLK_RALT 0x400000e6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RALT) */ +#define SDLK_RGUI 0x400000e7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_RGUI) */ +#define SDLK_MODE 0x40000101u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MODE) */ +#define SDLK_SLEEP 0x40000102u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SLEEP) */ +#define SDLK_WAKE 0x40000103u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_WAKE) */ +#define SDLK_CHANNEL_INCREMENT 0x40000104u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_INCREMENT) */ +#define SDLK_CHANNEL_DECREMENT 0x40000105u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CHANNEL_DECREMENT) */ +#define SDLK_MEDIA_PLAY 0x40000106u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY) */ +#define SDLK_MEDIA_PAUSE 0x40000107u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PAUSE) */ +#define SDLK_MEDIA_RECORD 0x40000108u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_RECORD) */ +#define SDLK_MEDIA_FAST_FORWARD 0x40000109u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_FAST_FORWARD) */ +#define SDLK_MEDIA_REWIND 0x4000010au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_REWIND) */ +#define SDLK_MEDIA_NEXT_TRACK 0x4000010bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_NEXT_TRACK) */ +#define SDLK_MEDIA_PREVIOUS_TRACK 0x4000010cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PREVIOUS_TRACK) */ +#define SDLK_MEDIA_STOP 0x4000010du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_STOP) */ +#define SDLK_MEDIA_EJECT 0x4000010eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_EJECT) */ +#define SDLK_MEDIA_PLAY_PAUSE 0x4000010fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_PLAY_PAUSE) */ +#define SDLK_MEDIA_SELECT 0x40000110u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MEDIA_SELECT) */ +#define SDLK_AC_NEW 0x40000111u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_NEW) */ +#define SDLK_AC_OPEN 0x40000112u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_OPEN) */ +#define SDLK_AC_CLOSE 0x40000113u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_CLOSE) */ +#define SDLK_AC_EXIT 0x40000114u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_EXIT) */ +#define SDLK_AC_SAVE 0x40000115u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SAVE) */ +#define SDLK_AC_PRINT 0x40000116u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PRINT) */ +#define SDLK_AC_PROPERTIES 0x40000117u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_PROPERTIES) */ +#define SDLK_AC_SEARCH 0x40000118u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_SEARCH) */ +#define SDLK_AC_HOME 0x40000119u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_HOME) */ +#define SDLK_AC_BACK 0x4000011au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BACK) */ +#define SDLK_AC_FORWARD 0x4000011bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_FORWARD) */ +#define SDLK_AC_STOP 0x4000011cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_STOP) */ +#define SDLK_AC_REFRESH 0x4000011du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_REFRESH) */ +#define SDLK_AC_BOOKMARKS 0x4000011eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_AC_BOOKMARKS) */ +#define SDLK_SOFTLEFT 0x4000011fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTLEFT) */ +#define SDLK_SOFTRIGHT 0x40000120u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT) */ +#define SDLK_CALL 0x40000121u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL) */ +#define SDLK_ENDCALL 0x40000122u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL) */ /** * Valid key modifiers (possibly OR'd together). From 1e81424b3d0f09d9b39856b5921fe1afa174f7d7 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 22 Jun 2024 05:06:38 +0000 Subject: [PATCH 015/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_keyboard.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 971706f38b032..83576e208f307 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -192,7 +192,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate); * See SDL_Keycode for details. * * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to a keycode. + * \param modstate the modifier state to use when translating the scancode to + * a keycode. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. @@ -209,7 +210,8 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scanco * See SDL_Keycode for details. * * \param scancode the desired SDL_Scancode to query. - * \param modstate the modifier state to use when translating the scancode to a keycode. + * \param modstate the modifier state to use when translating the scancode to + * a keycode. * \returns the SDL_Keycode that corresponds to the given SDL_Scancode. * * \since This function is available since SDL 3.0.0. @@ -221,12 +223,15 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetDefaultKeyFromScancode(SDL_Scanco extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate); /** - * Get the scancode corresponding to the given key code according to a default en_US keyboard layout. + * Get the scancode corresponding to the given key code according to a default + * en_US keyboard layout. * - * Note that there may be multiple scancode+modifier states that can generate this keycode, this will just return the first one found. + * Note that there may be multiple scancode+modifier states that can generate + * this keycode, this will just return the first one found. * * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the scancode generates this key, may be NULL. + * \param modstate a pointer to the modifier state that would be used when the + * scancode generates this key, may be NULL. * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. * * \since This function is available since SDL 3.0.0. @@ -240,10 +245,12 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetDefaultScancodeFromKey(SDL_Keyco * Get the scancode corresponding to the given key code according to the * current keyboard layout. * - * Note that there may be multiple scancode+modifier states that can generate this keycode, this will just return the first one found. + * Note that there may be multiple scancode+modifier states that can generate + * this keycode, this will just return the first one found. * * \param key the desired SDL_Keycode to query. - * \param modstate a pointer to the modifier state that would be used when the scancode generates this key, may be NULL. + * \param modstate a pointer to the modifier state that would be used when the + * scancode generates this key, may be NULL. * \returns the SDL_Scancode that corresponds to the given SDL_Keycode. * * \since This function is available since SDL 3.0.0. @@ -258,7 +265,9 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key, * Set a human-readable name for a scancode. * * \param scancode the desired SDL_Scancode. - * \param name the name to use for the scancode, encoded as UTF-8. The string is not copied, so the pointer given to this function must stay valid while SDL is being used. + * \param name the name to use for the scancode, encoded as UTF-8. The string + * is not copied, so the pointer given to this function must stay + * valid while SDL is being used. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * From 90034b16dcacc7c0642a9bc94d393b2a12bc108d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 22 Jun 2024 00:04:33 -0700 Subject: [PATCH 016/431] The keycode in key events is affected by modifiers by default. This behavior can be customized with SDL_HINT_KEYCODE_OPTIONS. --- docs/README-migration.md | 2 + include/SDL3/SDL_hints.h | 22 ++++++ src/events/SDL_keyboard.c | 101 ++++++++++++++++++++++++-- src/test/SDL_test_common.c | 13 ++++ test/testaudiostreamdynamicresample.c | 2 +- test/testintersections.c | 38 +++++----- 6 files changed, 149 insertions(+), 29 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 58e14fd546bb5..496feceee15a0 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -362,6 +362,8 @@ now looks like this: SDL_Keymod mod = event.key.mod; ``` +The keycode in key events is affected by modifiers by default. e.g. pressing the A key would generate the keycode `SDLK_a`, or 'a', and pressing it while holding the shift key would generate the keycode `SDLK_A`, or 'A'. This behavior can be customized with `SDL_HINT_KEYCODE_OPTIONS`. + The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor. The mouseX and mouseY fields of SDL_MouseWheelEvent have been renamed mouse_x and mouse_y. diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 0fffe295600ca..28895af38cae0 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2003,6 +2003,28 @@ extern "C" { */ #define SDL_HINT_JOYSTICK_ZERO_CENTERED_DEVICES "SDL_JOYSTICK_ZERO_CENTERED_DEVICES" +/** + * A variable that controls keycode representation in keyboard events. + * + * This variable is a comma separated set of options for translating keycodes in events: + * + * - "unmodified": The keycode is the symbol generated by pressing the key without any modifiers applied. e.g. Shift+A would yield the keycode SDLK_a, or 'a'. + * - "modified": The keycode is the symbol generated by pressing the key with modifiers applied. e.g. Shift+A would yield the keycode SDLK_A, or 'A'. + * - "french_numbers": The number row on French keyboards is inverted, so pressing the 1 key would yield the keycode SDLK_1, or '1', instead of SDLK_AMPERSAND, or '&' + * - "latin_letters": For keyboards using non-Latin letters, such as Russian or Thai, the letter keys generate keycodes as though it had an en_US layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian keyboard would yield 'a' instead of 'Ñ„'. + * + * The default value for this hint is equivalent to "modified,french_numbers" + * + * Some platforms like Emscripten only provide modified keycodes and the options are not used. + * + * These options do not affect the return value of SDL_GetKeyFromScancode() or SDL_GetScancodeFromKey(), they just apply to the keycode included in key events. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. + */ +#define SDL_HINT_KEYCODE_OPTIONS "SDL_KEYCODE_OPTIONS" + /** * A variable that controls what KMSDRM device to use. * diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index ecbfaa107a935..befa6353856e8 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -30,16 +30,18 @@ /* Global keyboard information */ -typedef enum -{ - KEYBOARD_HARDWARE = 0x01, - KEYBOARD_VIRTUAL = 0x02, - KEYBOARD_AUTORELEASE = 0x04, - KEYBOARD_IGNOREMODIFIERS = 0x08 -} SDL_KeyboardFlags; +#define KEYBOARD_HARDWARE 0x01 +#define KEYBOARD_VIRTUAL 0x02 +#define KEYBOARD_AUTORELEASE 0x04 +#define KEYBOARD_IGNOREMODIFIERS 0x0 #define KEYBOARD_SOURCE_MASK (KEYBOARD_HARDWARE | KEYBOARD_AUTORELEASE) +#define KEYCODE_OPTION_APPLY_MODIFIERS 0x01 +#define KEYCODE_OPTION_FRENCH_NUMBERS 0x02 +#define KEYCODE_OPTION_LATIN_LETTERS 0x04 +#define DEFAULT_KEYCODE_OPTIONS (KEYCODE_OPTION_APPLY_MODIFIERS | KEYCODE_OPTION_FRENCH_NUMBERS) + typedef struct SDL_KeyboardInstance { SDL_KeyboardID instance_id; @@ -54,6 +56,9 @@ typedef struct SDL_Keyboard Uint8 keysource[SDL_NUM_SCANCODES]; Uint8 keystate[SDL_NUM_SCANCODES]; SDL_Keymap *keymap; + SDL_bool french_numbers; + SDL_bool non_latin_letters; + Uint32 keycode_options; SDL_bool autorelease_pending; Uint64 hardware_timestamp; } SDL_Keyboard; @@ -62,9 +67,33 @@ static SDL_Keyboard SDL_keyboard; static int SDL_keyboard_count; static SDL_KeyboardInstance *SDL_keyboards; +static void SDLCALL SDL_KeycodeOptionsChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + SDL_Keyboard *keyboard = (SDL_Keyboard *)userdata; + + if (hint && *hint) { + keyboard->keycode_options = 0; + if (SDL_strstr(hint, "unmodified")) { + keyboard->keycode_options &= ~KEYCODE_OPTION_APPLY_MODIFIERS; + } else if (SDL_strstr(hint, "modified")) { + keyboard->keycode_options |= KEYCODE_OPTION_APPLY_MODIFIERS; + } + if (SDL_strstr(hint, "french_numbers")) { + keyboard->keycode_options |= KEYCODE_OPTION_FRENCH_NUMBERS; + } + if (SDL_strstr(hint, "latin_letters")) { + keyboard->keycode_options |= KEYCODE_OPTION_LATIN_LETTERS; + } + } else { + keyboard->keycode_options = DEFAULT_KEYCODE_OPTIONS; + } +} + /* Public functions */ int SDL_InitKeyboard(void) { + SDL_AddHintCallback(SDL_HINT_KEYCODE_OPTIONS, + SDL_KeycodeOptionsChanged, &SDL_keyboard); return 0; } @@ -205,6 +234,25 @@ void SDL_SetKeymap(SDL_Keymap *keymap, SDL_bool send_event) keyboard->keymap = keymap; + // Detect French number row (all symbols) + keyboard->french_numbers = SDL_TRUE; + for (int i = SDL_SCANCODE_1; i <= SDL_SCANCODE_0; ++i) { + if (SDL_isdigit(SDL_GetKeymapKeycode(keymap, (SDL_Scancode)i, SDL_KMOD_NONE)) || + !SDL_isdigit(SDL_GetKeymapKeycode(keymap, (SDL_Scancode)i, SDL_KMOD_SHIFT))) { + keyboard->french_numbers = SDL_FALSE; + break; + } + } + + // Detect non-Latin keymap + keyboard->non_latin_letters = SDL_TRUE; + for (int i = SDL_SCANCODE_A; i <= SDL_SCANCODE_D; ++i) { + if (SDL_GetKeymapKeycode(keymap, (SDL_Scancode)i, SDL_KMOD_NONE) <= 0xFF) { + keyboard->non_latin_letters = SDL_FALSE; + break; + } + } + if (send_event) { SDL_SendKeymapChangedEvent(); } @@ -276,6 +324,40 @@ int SDL_SetKeyboardFocus(SDL_Window *window) return 0; } +static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scancode, SDL_Keymod modstate) +{ + SDL_Keycode keycode; + + if (scancode >= SDL_SCANCODE_A && scancode <= SDL_SCANCODE_Z) { + if (keyboard->non_latin_letters && (keyboard->keycode_options & KEYCODE_OPTION_LATIN_LETTERS)) { + if (keyboard->keycode_options & KEYCODE_OPTION_APPLY_MODIFIERS) { + keycode = SDL_GetDefaultKeyFromScancode(scancode, modstate); + } else { + keycode = SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE); + } + return keycode; + } + } + + if (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) { + if (keyboard->french_numbers && (keyboard->keycode_options & KEYCODE_OPTION_FRENCH_NUMBERS)) { + // Invert the shift state to generate the correct keycode + if (modstate & SDL_KMOD_SHIFT) { + modstate &= ~SDL_KMOD_SHIFT; + } else { + modstate |= SDL_KMOD_SHIFT; + } + } + } + + if (keyboard->keycode_options & KEYCODE_OPTION_APPLY_MODIFIERS) { + keycode = SDL_GetKeyFromScancode(scancode, modstate); + } else { + keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); + } + return keycode; +} + static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, Uint8 state) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -325,7 +407,7 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo keyboard->keystate[scancode] = state; if (keycode == SDLK_UNKNOWN) { - keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); + keycode = SDL_GetEventKeycode(keyboard, scancode, keyboard->modstate); } } else if (keycode == SDLK_UNKNOWN && rawcode == 0) { @@ -589,6 +671,9 @@ void SDL_QuitKeyboard(void) SDL_DestroyKeymap(SDL_keyboard.keymap); SDL_keyboard.keymap = NULL; } + + SDL_DelHintCallback(SDL_HINT_KEYCODE_OPTIONS, + SDL_KeycodeOptionsChanged, &SDL_keyboard); } const Uint8 *SDL_GetKeyboardState(int *numkeys) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index e37b5d8f10176..84f2a1c6cae48 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2198,6 +2198,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_O: case SDLK_o: if (withControl) { /* Ctrl-O (or Ctrl-Shift-O) changes window opacity. */ @@ -2215,6 +2216,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_H: case SDLK_h: if (withControl) { /* Ctrl-H changes cursor visibility. */ @@ -2225,6 +2227,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_C: case SDLK_c: if (withAlt) { /* Alt-C copy awesome text to the primary selection! */ @@ -2250,6 +2253,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event break; } break; + case SDLK_V: case SDLK_v: if (withAlt) { /* Alt-V paste awesome text from the primary selection! */ @@ -2277,6 +2281,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_F: case SDLK_f: if (withControl) { /* Ctrl-F flash the window */ @@ -2286,6 +2291,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_G: case SDLK_g: if (withControl) { /* Ctrl-G toggle mouse grab */ @@ -2295,6 +2301,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_K: case SDLK_k: if (withControl) { /* Ctrl-K toggle keyboard grab */ @@ -2304,6 +2311,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_M: case SDLK_m: if (withControl) { /* Ctrl-M maximize */ @@ -2326,12 +2334,14 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_R: case SDLK_r: if (withControl) { /* Ctrl-R toggle mouse relative mode */ SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode()); } break; + case SDLK_T: case SDLK_t: if (withControl) { /* Ctrl-T toggle topmost mode */ @@ -2346,6 +2356,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_Z: case SDLK_z: if (withControl) { /* Ctrl-Z minimize */ @@ -2385,6 +2396,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } break; + case SDLK_B: case SDLK_b: if (withControl) { /* Ctrl-B toggle window border */ @@ -2396,6 +2408,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDLK_A: case SDLK_a: if (withControl) { /* Ctrl-A toggle aspect ratio */ diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index c011e6712511d..4bea5ac68b220 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -234,7 +234,7 @@ static void loop(void) SDL_Log("Cleared audio stream"); } else if (sym == SDLK_s) { queue_audio(); - } else if (sym == SDLK_d) { + } else if (sym == SDLK_d || sym == SDLK_D) { float amount = 1.0f; amount *= (e.key.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f; amount *= (e.key.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f; diff --git a/test/testintersections.c b/test/testintersections.c index 1f233b0ea75c2..28c1d0d7a5602 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -226,27 +226,25 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: switch (event.key.key) { - case 'l': - if (event.key.mod & SDL_KMOD_SHIFT) { - num_lines = 0; - } else { - add_line( - (float)SDL_rand_n(640), - (float)SDL_rand_n(480), - (float)SDL_rand_n(640), - (float)SDL_rand_n(480)); - } + case SDLK_L: + num_lines = 0; break; - case 'r': - if (event.key.mod & SDL_KMOD_SHIFT) { - num_rects = 0; - } else { - add_rect( - (float)SDL_rand_n(640), - (float)SDL_rand_n(480), - (float)SDL_rand_n(640), - (float)SDL_rand_n(480)); - } + case SDLK_l: + add_line( + (float)SDL_rand_n(640), + (float)SDL_rand_n(480), + (float)SDL_rand_n(640), + (float)SDL_rand_n(480)); + break; + case SDLK_R: + num_rects = 0; + break; + case SDLK_r: + add_rect( + (float)SDL_rand_n(640), + (float)SDL_rand_n(480), + (float)SDL_rand_n(640), + (float)SDL_rand_n(480)); break; default: break; From ba188e7555b873cbb57c9c5ee7ae6dc5a7bd872e Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 22 Jun 2024 07:20:00 +0000 Subject: [PATCH 017/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 28895af38cae0..79fa09151439f 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2006,18 +2006,30 @@ extern "C" { /** * A variable that controls keycode representation in keyboard events. * - * This variable is a comma separated set of options for translating keycodes in events: - * - * - "unmodified": The keycode is the symbol generated by pressing the key without any modifiers applied. e.g. Shift+A would yield the keycode SDLK_a, or 'a'. - * - "modified": The keycode is the symbol generated by pressing the key with modifiers applied. e.g. Shift+A would yield the keycode SDLK_A, or 'A'. - * - "french_numbers": The number row on French keyboards is inverted, so pressing the 1 key would yield the keycode SDLK_1, or '1', instead of SDLK_AMPERSAND, or '&' - * - "latin_letters": For keyboards using non-Latin letters, such as Russian or Thai, the letter keys generate keycodes as though it had an en_US layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian keyboard would yield 'a' instead of 'Ñ„'. + * This variable is a comma separated set of options for translating keycodes + * in events: + * + * - "unmodified": The keycode is the symbol generated by pressing the key + * without any modifiers applied. e.g. Shift+A would yield the keycode + * SDLK_a, or 'a'. + * - "modified": The keycode is the symbol generated by pressing the key with + * modifiers applied. e.g. Shift+A would yield the keycode SDLK_A, or 'A'. + * - "french_numbers": The number row on French keyboards is inverted, so + * pressing the 1 key would yield the keycode SDLK_1, or '1', instead of + * SDLK_AMPERSAND, or '&' + * - "latin_letters": For keyboards using non-Latin letters, such as Russian + * or Thai, the letter keys generate keycodes as though it had an en_US + * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian + * keyboard would yield 'a' instead of 'Ñ„'. * * The default value for this hint is equivalent to "modified,french_numbers" * - * Some platforms like Emscripten only provide modified keycodes and the options are not used. + * Some platforms like Emscripten only provide modified keycodes and the + * options are not used. * - * These options do not affect the return value of SDL_GetKeyFromScancode() or SDL_GetScancodeFromKey(), they just apply to the keycode included in key events. + * These options do not affect the return value of SDL_GetKeyFromScancode() or + * SDL_GetScancodeFromKey(), they just apply to the keycode included in key + * events. * * This hint can be set anytime. * From 99d28ca485f76a5ad60a1f3497e1b6cf14932f59 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 22 Jun 2024 14:43:06 +0200 Subject: [PATCH 018/431] testmanymouse: fix argument parsing --- test/testmanymouse.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testmanymouse.c b/test/testmanymouse.c index 250e128a5cc43..60a34b15bc4e5 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -521,6 +521,7 @@ int main(int argc, char *argv[]) SDLTest_CommonQuit(state); return 1; } + i += consumed; } if (!SDLTest_CommonInit(state)) { From f8ad4abe4e3490c68380c507c9f3ee1c22a88639 Mon Sep 17 00:00:00 2001 From: Ganael Laplanche Date: Sat, 22 Jun 2024 15:55:17 +0200 Subject: [PATCH 019/431] Fix joystick (/dev/input/xxx) support on FreeBSD When switching to CMake, src/joystick/linux/SDL_sysjoystick.c file got excluded from FreeBSD builds, losing support for /dev/input/xxx devices. See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279907 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a31ed54f1bae..7ddb476c841ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1732,7 +1732,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU) if(FREEBSD OR NETBSD OR OPENBSD OR BSDI) CheckUSBHID() endif() - if(LINUX AND HAVE_LINUX_INPUT_H AND NOT ANDROID) + if((LINUX OR FREEBSD) AND HAVE_LINUX_INPUT_H AND NOT ANDROID) set(SDL_JOYSTICK_LINUX 1) sdl_glob_sources( "${SDL3_SOURCE_DIR}/src/joystick/linux/*.c" From 2018882bf23034ab2097c69c3337cca68c88494b Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 22 Jun 2024 20:14:15 +0200 Subject: [PATCH 020/431] testmanymouse: enable raw keyboard events on Windows --- test/testmanymouse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/testmanymouse.c b/test/testmanymouse.c index 60a34b15bc4e5..8c7180f7125c9 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -507,6 +507,9 @@ int main(int argc, char *argv[]) /* Log all events, including mouse motion */ SDL_SetHint(SDL_HINT_EVENT_LOGGING, "2"); + /* Support for multiple keyboards requires raw keyboard events on Windows */ + SDL_SetHint(SDL_HINT_WINDOWS_RAW_KEYBOARD, "1"); + /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, SDL_INIT_VIDEO); if (!state) { From 0280d8249ad1c8ae8f699b047984880a084812e5 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sat, 22 Jun 2024 15:56:50 -0400 Subject: [PATCH 021/431] keyboard: Fix typo --- src/events/SDL_keyboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index befa6353856e8..d490facae4536 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -30,10 +30,10 @@ /* Global keyboard information */ -#define KEYBOARD_HARDWARE 0x01 -#define KEYBOARD_VIRTUAL 0x02 -#define KEYBOARD_AUTORELEASE 0x04 -#define KEYBOARD_IGNOREMODIFIERS 0x0 +#define KEYBOARD_HARDWARE 0x01 +#define KEYBOARD_VIRTUAL 0x02 +#define KEYBOARD_AUTORELEASE 0x04 +#define KEYBOARD_IGNOREMODIFIERS 0x08 #define KEYBOARD_SOURCE_MASK (KEYBOARD_HARDWARE | KEYBOARD_AUTORELEASE) From 3b504c4a891d5f9a9d0ea97118f7956560c458fc Mon Sep 17 00:00:00 2001 From: expikr <77922942+expikr@users.noreply.github.com> Date: Sun, 23 Jun 2024 00:09:59 -0700 Subject: [PATCH 022/431] Add SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL (#10085) --- include/SDL3/SDL_hints.h | 13 +++++++++++++ src/events/SDL_mouse.c | 17 +++++++++++++++++ src/events/SDL_mouse_c.h | 1 + src/video/windows/SDL_windowsevents.c | 4 ++-- 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 79fa09151439f..98ce50fef0848 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2337,6 +2337,19 @@ extern "C" { */ #define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" +/** + * Controls how often SDL issues cursor confinement commands to the operating + * system while relative mode is active, in case the desired confinement state + * became out-of-sync due to interference from other running programs. + * + * The variable can be integers representing miliseconds between each refresh. + * A value of zero means SDL will not automatically refresh the confinement. + * The default value varies depending on the operating system, this variable + * might not have any effects on inapplicable platforms such as those without + * a cursor. + */ +#define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" + /** * A variable controlling whether mouse events should generate synthetic touch * events. diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 8de492058bd64..13ef1e9a93b7b 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -64,6 +64,17 @@ static void SDLCALL SDL_MouseDoubleClickTimeChanged(void *userdata, const char * } } +static void SDLCALL SDL_MouseRelativeClipIntervalChanged(void *userdata, const char *name, const char *oldValue, const char *hint) +{ + SDL_Mouse *mouse = (SDL_Mouse *)userdata; + + if (hint && *hint) { + mouse->relative_mode_clip_interval = SDL_atoi(hint); + } else { + mouse->relative_mode_clip_interval = 3000; + } +} + static void SDLCALL SDL_MouseDoubleClickRadiusChanged(void *userdata, const char *name, const char *oldValue, const char *hint) { SDL_Mouse *mouse = (SDL_Mouse *)userdata; @@ -220,6 +231,9 @@ int SDL_PreInitMouse(void) SDL_AddHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE, SDL_MouseRelativeCursorVisibleChanged, mouse); + SDL_AddHintCallback(SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL, + SDL_MouseRelativeClipIntervalChanged, mouse); + mouse->was_touch_mouse_events = SDL_FALSE; /* no touch to mouse movement event pending */ mouse->cursor_shown = SDL_TRUE; @@ -1133,6 +1147,9 @@ void SDL_QuitMouse(void) SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE, SDL_MouseRelativeCursorVisibleChanged, mouse); + SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL, + SDL_MouseRelativeClipIntervalChanged, mouse); + for (int i = SDL_mouse_count; i--; ) { SDL_RemoveMouse(SDL_mice[i].instance_id, SDL_FALSE); } diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 6d120ec3ecb03..2641107638ee1 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -92,6 +92,7 @@ typedef struct SDL_bool relative_mode_warp; SDL_bool relative_mode_warp_motion; SDL_bool relative_mode_cursor_visible; + int relative_mode_clip_interval; SDL_bool enable_normal_speed_scale; float normal_speed_scale; SDL_bool enable_relative_speed_scale; diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index b372e245ebf10..9cc060ac7c998 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -2093,7 +2093,7 @@ static void WIN_UpdateClipCursorForWindows() SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *window; Uint64 now = SDL_GetTicks(); - const int CLIPCURSOR_UPDATE_INTERVAL_MS = 3000; + const int CLIPCURSOR_UPDATE_INTERVAL_MS = SDL_GetMouse()->relative_mode_clip_interval; if (_this) { for (window = _this->windows; window; window = window->next) { @@ -2102,7 +2102,7 @@ static void WIN_UpdateClipCursorForWindows() if (data->skip_update_clipcursor) { data->skip_update_clipcursor = SDL_FALSE; WIN_UpdateClipCursor(window); - } else if (now >= (data->last_updated_clipcursor + CLIPCURSOR_UPDATE_INTERVAL_MS)) { + } else if (CLIPCURSOR_UPDATE_INTERVAL_MS > 0 && now >= (data->last_updated_clipcursor + CLIPCURSOR_UPDATE_INTERVAL_MS)) { WIN_UpdateClipCursor(window); } } From 398391b01eb80b9981505fd156a9acc02c7e6b85 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 23 Jun 2024 07:11:23 +0000 Subject: [PATCH 023/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 98ce50fef0848..3795f7447af59 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2339,7 +2339,7 @@ extern "C" { /** * Controls how often SDL issues cursor confinement commands to the operating - * system while relative mode is active, in case the desired confinement state + * system while relative mode is active, in case the desired confinement state * became out-of-sync due to interference from other running programs. * * The variable can be integers representing miliseconds between each refresh. From fd3143f4455324dae2c08bd1a48b5eb5a7218375 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 23 Jun 2024 00:11:30 -0700 Subject: [PATCH 024/431] Added more documentation for SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE and SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL --- include/SDL3/SDL_hints.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 3795f7447af59..c28fc5df5b1ab 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2334,6 +2334,10 @@ extern "C" { * Note that for systems without raw hardware inputs, relative mode is * implemented using warping, so the hardware cursor will visibly warp between * frames if this is enabled on those systems. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. */ #define SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE "SDL_MOUSE_RELATIVE_CURSOR_VISIBLE" @@ -2347,6 +2351,10 @@ extern "C" { * The default value varies depending on the operating system, this variable * might not have any effects on inapplicable platforms such as those without * a cursor. + * + * This hint can be set anytime. + * + * \since This hint is available since SDL 3.0.0. */ #define SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL "SDL_MOUSE_RELATIVE_CLIP_INTERVAL" From ab3c8552c2733e03c47253c5840bed7a27716244 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 23 Jun 2024 00:41:19 -0700 Subject: [PATCH 025/431] Clean up renderers at shutdown Fixes https://github.com/libsdl-org/SDL/issues/10082 --- src/SDL.c | 2 ++ src/render/SDL_render.c | 27 +++++++++++++++++++++++++++ src/render/SDL_sysrender.h | 5 +++++ 3 files changed, 34 insertions(+) diff --git a/src/SDL.c b/src/SDL.c index d1bf69ff1d85b..7814ad2062467 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -47,6 +47,7 @@ #include "haptic/SDL_haptic_c.h" #include "joystick/SDL_gamepad_c.h" #include "joystick/SDL_joystick_c.h" +#include "render/SDL_sysrender.h" #include "sensor/SDL_sensor_c.h" #include "stdlib/SDL_getenv_c.h" #include "video/SDL_video_c.h" @@ -474,6 +475,7 @@ void SDL_QuitSubSystem(Uint32 flags) #ifndef SDL_VIDEO_DISABLED if (flags & SDL_INIT_VIDEO) { if (SDL_ShouldQuitSubsystem(SDL_INIT_VIDEO)) { + SDL_QuitRender(); SDL_VideoQuit(); /* video implies events */ SDL_QuitSubSystem(SDL_INIT_EVENTS); diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index c5e126d6c1e6b..83f63028995cd 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -133,6 +133,14 @@ static const SDL_RenderDriver *render_drivers[] = { }; #endif /* !SDL_RENDER_DISABLED */ +static SDL_Renderer *SDL_renderers; + +void SDL_QuitRender(void) +{ + while (SDL_renderers) { + SDL_DestroyRenderer(SDL_renderers); + } +} int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum format) { @@ -1105,6 +1113,9 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props) SDL_LogInfo(SDL_LOG_CATEGORY_RENDER, "Created renderer: %s", renderer->name); + renderer->next = SDL_renderers; + SDL_renderers = renderer; + #ifdef SDL_PLATFORM_ANDROID Android_ActivityMutex_Unlock(); #endif @@ -4619,6 +4630,22 @@ void SDL_DestroyRenderer(SDL_Renderer *renderer) if (!renderer->destroyed) { SDL_DestroyRendererWithoutFreeing(renderer); } + + SDL_Renderer *curr = SDL_renderers; + SDL_Renderer *prev = NULL; + while (curr) { + if (curr == renderer) { + if (prev) { + prev->next = renderer->next; + } else { + SDL_renderers = renderer->next; + } + break; + } + prev = curr; + curr = curr->next; + } + SDL_SetObjectValid(renderer, SDL_OBJECT_TYPE_RENDERER, SDL_FALSE); // It's no longer magical... SDL_free(renderer->texture_formats); diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index 22dd0e714022d..8d7cb758e3674 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -291,6 +291,8 @@ struct SDL_Renderer SDL_bool destroyed; // already destroyed by SDL_DestroyWindow; just free this struct in SDL_DestroyRenderer. void *driverdata; + + SDL_Renderer *next; }; /* Define the SDL render driver structure */ @@ -314,6 +316,9 @@ extern SDL_RenderDriver PSP_RenderDriver; extern SDL_RenderDriver SW_RenderDriver; extern SDL_RenderDriver VITA_GXM_RenderDriver; +/* Clean up any renderers at shutdown */ +extern void SDL_QuitRender(void); + /* Add a supported texture format to a renderer */ extern int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum format); From c874a78ffb32cac6224df8a9babcb37eed5eb373 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sat, 22 Jun 2024 15:55:07 -0400 Subject: [PATCH 026/431] wayland: Add keymap support --- src/video/wayland/SDL_waylandevents.c | 101 +++++++++++++++++--------- 1 file changed, 68 insertions(+), 33 deletions(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 72c16ef6b8a62..309f3e41308a6 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1084,14 +1084,15 @@ static const struct wl_touch_listener touch_listener = { typedef struct Wayland_Keymap { - xkb_layout_index_t layout; - SDL_Keycode keymap[SDL_NUM_SCANCODES]; + SDL_Keymap *keymap; + struct xkb_state *state; + SDL_Keymod modstate; } Wayland_Keymap; static void Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, void *data) { - const xkb_keysym_t *syms; Wayland_Keymap *sdlKeymap = (Wayland_Keymap *)data; + const xkb_keysym_t *syms; SDL_Scancode scancode; scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, (key - 8)); @@ -1099,13 +1100,13 @@ static void Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, vo return; } - if (WAYLAND_xkb_keymap_key_get_syms_by_level(keymap, key, sdlKeymap->layout, 0, &syms) > 0) { + if (WAYLAND_xkb_state_key_get_syms(sdlKeymap->state, key, &syms) > 0) { uint32_t keycode = SDL_KeySymToUcs4(syms[0]); if (!keycode) { const SDL_Scancode sc = SDL_GetScancodeFromKeySym(syms[0], key); - /* Note: The default SDL keymap always sets this to right alt instead of AltGr/Mode, so handle it separately. */ + /* Note: The default SDL scancode table sets this to right alt instead of AltGr/Mode, so handle it separately. */ if (syms[0] != XKB_KEY_ISO_Level3_Shift) { keycode = SDL_GetDefaultKeyFromScancode(sc, SDL_KMOD_NONE); } else { @@ -1113,30 +1114,80 @@ static void Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, vo } } - if (keycode) { - sdlKeymap->keymap[scancode] = keycode; - } else { + if (!keycode) { switch (scancode) { case SDL_SCANCODE_RETURN: - sdlKeymap->keymap[scancode] = SDLK_RETURN; + keycode = SDLK_RETURN; break; case SDL_SCANCODE_ESCAPE: - sdlKeymap->keymap[scancode] = SDLK_ESCAPE; + keycode = SDLK_ESCAPE; break; case SDL_SCANCODE_BACKSPACE: - sdlKeymap->keymap[scancode] = SDLK_BACKSPACE; + keycode = SDLK_BACKSPACE; break; case SDL_SCANCODE_TAB: - sdlKeymap->keymap[scancode] = SDLK_TAB; + keycode = SDLK_TAB; break; case SDL_SCANCODE_DELETE: - sdlKeymap->keymap[scancode] = SDLK_DELETE; + keycode = SDLK_DELETE; break; default: - sdlKeymap->keymap[scancode] = SDL_SCANCODE_TO_KEYCODE(scancode); + keycode = SDL_SCANCODE_TO_KEYCODE(scancode); break; } } + + SDL_SetKeymapEntry(sdlKeymap->keymap, scancode, sdlKeymap->modstate, keycode); + } +} + +static void Wayland_UpdateKeymap(struct SDL_WaylandInput *input) +{ + struct Keymod_masks + { + SDL_Keymod sdl_mask; + xkb_mod_mask_t xkb_mask; + } const keymod_masks[] = { + { SDL_KMOD_NONE, 0 }, + { SDL_KMOD_SHIFT, input->xkb.idx_shift }, + { SDL_KMOD_CAPS, input->xkb.idx_caps }, + { SDL_KMOD_SHIFT | SDL_KMOD_CAPS, input->xkb.idx_shift | input->xkb.idx_caps }, + { SDL_KMOD_MODE, input->xkb.idx_mode }, + { SDL_KMOD_MODE | SDL_KMOD_SHIFT, input->xkb.idx_mode | input->xkb.idx_shift }, + { SDL_KMOD_MODE | SDL_KMOD_CAPS, input->xkb.idx_mode | input->xkb.idx_caps }, + { SDL_KMOD_MODE | SDL_KMOD_SHIFT | SDL_KMOD_CAPS, input->xkb.idx_mode | input->xkb.idx_shift | input->xkb.idx_caps } + }; + + if (!input->keyboard_is_virtual) { + Wayland_Keymap keymap; + + keymap.keymap = SDL_CreateKeymap(); + if (!keymap.keymap) { + return; + } + + keymap.state = WAYLAND_xkb_state_new(input->xkb.keymap); + if (!keymap.state) { + SDL_SetError("failed to create XKB state"); + SDL_DestroyKeymap(keymap.keymap); + return; + } + + for (int i = 0; i < SDL_arraysize(keymod_masks); ++i) { + keymap.modstate = keymod_masks[i].sdl_mask; + WAYLAND_xkb_state_update_mask(keymap.state, + keymod_masks[i].xkb_mask & (input->xkb.idx_shift | input->xkb.idx_mode), 0, keymod_masks[i].xkb_mask & input->xkb.idx_caps, + 0, 0, input->xkb.current_group); + WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, + Wayland_keymap_iter, + &keymap); + } + + WAYLAND_xkb_state_unref(keymap.state); + SDL_SetKeymap(keymap.keymap, SDL_TRUE); + } else { + /* Virtual keyboards use the default keymap. */ + SDL_SetKeymap(NULL, SDL_TRUE); } } @@ -1214,17 +1265,9 @@ static void keyboard_handle_keymap(void *data, struct wl_keyboard *keyboard, */ input->keyboard_is_virtual = WAYLAND_xkb_keymap_layout_get_name(input->xkb.keymap, 0) == NULL; - /* Update the keymap if changed. Virtual keyboards use the default keymap. */ + /* Update the keymap if changed. */ if (input->xkb.current_group != XKB_GROUP_INVALID) { - Wayland_Keymap keymap; - keymap.layout = input->xkb.current_group; - //SDL_GetDefaultKeymap(keymap.keymap); - if (!input->keyboard_is_virtual) { - WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, - Wayland_keymap_iter, - &keymap); - } - //SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); + Wayland_UpdateKeymap(input); } /* @@ -1644,7 +1687,6 @@ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, uint32_t group) { struct SDL_WaylandInput *input = data; - Wayland_Keymap keymap; if (input->xkb.state == NULL) { /* if we get a modifier notification before the keymap, there's nothing we can do with the information @@ -1676,14 +1718,7 @@ static void keyboard_handle_modifiers(void *data, struct wl_keyboard *keyboard, /* The layout changed, remap and fire an event. Virtual keyboards use the default keymap. */ input->xkb.current_group = group; - keymap.layout = group; - //SDL_GetDefaultKeymap(keymap.keymap); - if (!input->keyboard_is_virtual) { - WAYLAND_xkb_keymap_key_for_each(input->xkb.keymap, - Wayland_keymap_iter, - &keymap); - } - //SDL_SetKeymap(0, keymap.keymap, SDL_NUM_SCANCODES, SDL_TRUE); + Wayland_UpdateKeymap(input); } static void keyboard_handle_repeat_info(void *data, struct wl_keyboard *wl_keyboard, From 974bbea20b7a87f792f7c10c26b011c0907a05fa Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sat, 22 Jun 2024 19:09:50 -0400 Subject: [PATCH 027/431] x11: Add keymap support XkbKeycodeToKeySym is replaced with XkbLookupKeySym, which can take the modifier states. The associated cmake check has been renamed for consistency. Only the XKB path is currently handled. The deprecated XKeycodeToKeysym path is TODO. --- cmake/sdlchecks.cmake | 2 +- include/build_config/SDL_build_config.h.cmake | 2 +- include/build_config/SDL_build_config_macos.h | 2 +- src/video/x11/SDL_x11dyn.h | 2 +- src/video/x11/SDL_x11events.c | 1 + src/video/x11/SDL_x11keyboard.c | 138 ++++++++++-------- src/video/x11/SDL_x11keyboard.h | 2 +- src/video/x11/SDL_x11sym.h | 6 +- src/video/x11/SDL_x11video.h | 2 +- 9 files changed, 86 insertions(+), 71 deletions(-) diff --git a/cmake/sdlchecks.cmake b/cmake/sdlchecks.cmake index 85816a2c52f0f..aecb98fe5394e 100644 --- a/cmake/sdlchecks.cmake +++ b/cmake/sdlchecks.cmake @@ -371,7 +371,7 @@ macro(CheckX11) set(SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS 1) endif() - check_symbol_exists(XkbKeycodeToKeysym "X11/Xlib.h;X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM) + check_symbol_exists(XkbLookupKeySym "X11/Xlib.h;X11/XKBlib.h" SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM) if(SDL_X11_XCURSOR AND HAVE_XCURSOR_H AND XCURSOR_LIB) set(HAVE_X11_XCURSOR TRUE) diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake index 348856a211ccf..e12b96b36df6c 100644 --- a/include/build_config/SDL_build_config.h.cmake +++ b/include/build_config/SDL_build_config.h.cmake @@ -400,7 +400,7 @@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2 @SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT2@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR@ #cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS @SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS@ -#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM@ +#cmakedefine SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM @SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM@ #cmakedefine SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS @SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS@ #cmakedefine SDL_VIDEO_DRIVER_X11_XCURSOR @SDL_VIDEO_DRIVER_X11_XCURSOR@ #cmakedefine SDL_VIDEO_DRIVER_X11_XDBE @SDL_VIDEO_DRIVER_X11_XDBE@ diff --git a/include/build_config/SDL_build_config_macos.h b/include/build_config/SDL_build_config_macos.h index 02cd3ae4c3292..597cf8874579a 100644 --- a/include/build_config/SDL_build_config_macos.h +++ b/include/build_config/SDL_build_config_macos.h @@ -194,7 +194,7 @@ #define SDL_VIDEO_DRIVER_X11_XRANDR 1 #define SDL_VIDEO_DRIVER_X11_XSCRNSAVER 1 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1 -#define SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM 1 +#define SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM 1 #ifdef MAC_OS_X_VERSION_10_8 /* diff --git a/src/video/x11/SDL_x11dyn.h b/src/video/x11/SDL_x11dyn.h index 73d8953e8fa36..b045d12cbc2ef 100644 --- a/src/video/x11/SDL_x11dyn.h +++ b/src/video/x11/SDL_x11dyn.h @@ -28,7 +28,7 @@ #include #include -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM #include #endif diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 08dddeb33e0e1..043db8de53a34 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1131,6 +1131,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) printf("window %p: KeymapNotify!\n", data); #endif if (SDL_GetKeyboardFocus() != NULL) { + X11_UpdateKeymap(_this, SDL_TRUE); X11_ReconcileKeyboardState(_this); } } else if (xevent->type == MappingNotify) { diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index b4d8d88a8a1fe..543c36e4a866b 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -72,7 +72,7 @@ static SDL_bool X11_ScancodeIsRemappable(SDL_Scancode scancode) /* This function only correctly maps letters and numbers for keyboards in US QWERTY layout */ static SDL_Scancode X11_KeyCodeToSDLScancode(SDL_VideoDevice *_this, KeyCode keycode) { - const KeySym keysym = X11_KeyCodeToSym(_this, keycode, 0); + const KeySym keysym = X11_KeyCodeToSym(_this, keycode, 0, 0); if (keysym == NoSymbol) { return SDL_SCANCODE_UNKNOWN; @@ -81,24 +81,15 @@ static SDL_Scancode X11_KeyCodeToSDLScancode(SDL_VideoDevice *_this, KeyCode key return SDL_GetScancodeFromKeySym(keysym, keycode); } -static Uint32 X11_KeyCodeToUcs4(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group) -{ - KeySym keysym = X11_KeyCodeToSym(_this, keycode, group); - - if (keysym == NoSymbol) { - return 0; - } - - return SDL_KeySymToUcs4(keysym); -} - -KeySym -X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group) +KeySym X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group, unsigned int mod_mask) { SDL_VideoData *data = _this->driverdata; KeySym keysym; + unsigned int mods_ret[16]; -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM + SDL_zero(mods_ret); + +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM if (data->xkb) { int num_groups = XkbKeyNumGroups(data->xkb, keycode); unsigned char info = XkbKeyGroupInfo(data->xkb, keycode); @@ -118,13 +109,16 @@ X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group) group %= num_groups; } } - keysym = X11_XkbKeycodeToKeysym(data->display, keycode, group, 0); - } else { + + if (X11_XkbLookupKeySym(data->display, keycode, XkbBuildCoreState(mod_mask, group), mods_ret, &keysym) == NoSymbol) { + keysym = NoSymbol; + } + } else +#endif + { + /* TODO: Handle groups and modifiers on the legacy path. */ keysym = X11_XKeycodeToKeysym(data->display, keycode, 0); } -#else - keysym = X11_XKeycodeToKeysym(data->display, keycode, 0); -#endif return keysym; } @@ -153,7 +147,7 @@ int X11_InitKeyboard(SDL_VideoDevice *_this) int distance; Bool xkb_repeat = 0; -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM { int xkb_major = XkbMajorVersion; int xkb_minor = XkbMinorVersion; @@ -334,6 +328,21 @@ int X11_InitKeyboard(SDL_VideoDevice *_this) void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) { + struct Keymod_masks + { + SDL_Keymod sdl_mask; + unsigned int xkb_mask; + } const keymod_masks[] = { + { SDL_KMOD_NONE, 0 }, + { SDL_KMOD_SHIFT, ShiftMask }, + { SDL_KMOD_CAPS, LockMask }, + { SDL_KMOD_SHIFT | SDL_KMOD_CAPS, ShiftMask | LockMask }, + { SDL_KMOD_MODE, Mod5Mask }, + { SDL_KMOD_MODE | SDL_KMOD_SHIFT, Mod5Mask | ShiftMask }, + { SDL_KMOD_MODE | SDL_KMOD_CAPS, Mod5Mask | LockMask }, + { SDL_KMOD_MODE | SDL_KMOD_SHIFT | SDL_KMOD_CAPS, Mod5Mask | ShiftMask | LockMask } + }; + SDL_VideoData *data = _this->driverdata; int i; SDL_Scancode scancode; @@ -342,7 +351,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) keymap = SDL_CreateKeymap(); -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM if (data->xkb) { XkbStateRec state; X11_XkbGetUpdatedMap(data->display, XkbAllClientInfoMask, data->xkb); @@ -353,49 +362,54 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) } #endif - // FIXME: Need to get the mapping for all modifiers, not just the first one - for (i = 0; i < SDL_arraysize(data->key_layout); i++) { - Uint32 key; - SDL_Keycode keycode; + for (int m = 0; m < SDL_arraysize(keymod_masks); ++m) { + for (i = 0; i < SDL_arraysize(data->key_layout); i++) { + SDL_Keycode keycode; - /* Make sure this is a valid scancode */ - scancode = data->key_layout[i]; - if (scancode == SDL_SCANCODE_UNKNOWN) { - continue; - } + /* Make sure this is a valid scancode */ + scancode = data->key_layout[i]; + if (scancode == SDL_SCANCODE_UNKNOWN) { + continue; + } + + KeySym keysym = X11_KeyCodeToSym(_this, i, group, keymod_masks[m].xkb_mask); + + /* Note: The default SDL scancode table sets this to right alt instead of AltGr/Mode, so handle it separately. */ + if (keysym != XK_ISO_Level3_Shift) { + keycode = SDL_KeySymToUcs4(keysym); + } else { + keycode = SDLK_MODE; + } + + if (!keycode) { + SDL_Scancode keyScancode = SDL_GetScancodeFromKeySym(keysym, (KeyCode)i); - /* See if there is a UCS keycode for this scancode */ - key = X11_KeyCodeToUcs4(_this, (KeyCode)i, group); - if (key) { - keycode = (SDL_Keycode)key; - } else { - SDL_Scancode keyScancode = X11_KeyCodeToSDLScancode(_this, (KeyCode)i); - - switch (keyScancode) { - case SDL_SCANCODE_UNKNOWN: - keycode = SDLK_UNKNOWN; - break; - case SDL_SCANCODE_RETURN: - keycode = SDLK_RETURN; - break; - case SDL_SCANCODE_ESCAPE: - keycode = SDLK_ESCAPE; - break; - case SDL_SCANCODE_BACKSPACE: - keycode = SDLK_BACKSPACE; - break; - case SDL_SCANCODE_TAB: - keycode = SDLK_TAB; - break; - case SDL_SCANCODE_DELETE: - keycode = SDLK_DELETE; - break; - default: - keycode = SDL_SCANCODE_TO_KEYCODE(keyScancode); - break; + switch (keyScancode) { + case SDL_SCANCODE_UNKNOWN: + keycode = SDLK_UNKNOWN; + break; + case SDL_SCANCODE_RETURN: + keycode = SDLK_RETURN; + break; + case SDL_SCANCODE_ESCAPE: + keycode = SDLK_ESCAPE; + break; + case SDL_SCANCODE_BACKSPACE: + keycode = SDLK_BACKSPACE; + break; + case SDL_SCANCODE_TAB: + keycode = SDLK_TAB; + break; + case SDL_SCANCODE_DELETE: + keycode = SDLK_DELETE; + break; + default: + keycode = SDL_SCANCODE_TO_KEYCODE(keyScancode); + break; + } } + SDL_SetKeymapEntry(keymap, scancode, keymod_masks[m].sdl_mask, keycode); } - SDL_SetKeymapEntry(keymap, scancode, SDL_KMOD_NONE, keycode); } SDL_SetKeymap(keymap, send_event); } @@ -404,7 +418,7 @@ void X11_QuitKeyboard(SDL_VideoDevice *_this) { SDL_VideoData *data = _this->driverdata; -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM if (data->xkb) { X11_XkbFreeKeyboard(data->xkb, 0, True); data->xkb = NULL; diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h index 9164e04ec0918..5e0ed2803efb6 100644 --- a/src/video/x11/SDL_x11keyboard.h +++ b/src/video/x11/SDL_x11keyboard.h @@ -33,6 +33,6 @@ extern SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this); extern void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); extern void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -extern KeySym X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode, unsigned char group); +extern KeySym X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode, unsigned char group, unsigned int mod_mask); #endif /* SDL_x11keyboard_h_ */ diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index aa1ea9991d02c..b21c8e7a5b91f 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -178,12 +178,12 @@ SDL_X11_SYM(Bool,XGetEventData,(Display* a,XGenericEventCookie* b),(a,b),return) SDL_X11_SYM(void,XFreeEventData,(Display* a,XGenericEventCookie* b),(a,b),) #endif -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM SDL_X11_SYM(Bool,XkbQueryExtension,(Display* a,int * b,int * c,int * d,int * e, int *f),(a,b,c,d,e,f),return) #if NeedWidePrototypes -SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,unsigned int b,int c,int d),(a,b,c,d),return) +SDL_X11_SYM(Bool,XkbLookupKeySym,(Display* a, unsigned int b, unsigned int c, unsigned int* d, KeySym* e),(a,b,c,d,e),return) #else -SDL_X11_SYM(KeySym,XkbKeycodeToKeysym,(Display* a,KeyCode b,int c,int d),(a,b,c,d),return) +SDL_X11_SYM(Bool,XkbLookupKeySym,(Display* a, KeyCode b, unsigned int c, unsigned int* d, KeySym* e),(a,b,c,d,e),return) #endif SDL_X11_SYM(Status,XkbGetState,(Display* a,unsigned int b,XkbStatePtr c),(a,b,c),return) SDL_X11_SYM(Status,XkbGetUpdatedMap,(Display* a,unsigned int b,XkbDescPtr c),(a,b,c),return) diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index dbe1a6d53e50e..80b5c47997923 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -121,7 +121,7 @@ struct SDL_VideoData int xrandr_event_base; -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBKEYCODETOKEYSYM +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM XkbDescPtr xkb; #endif int xkb_event; From 5217c040be96a5b2f046590fc76934d1bcd7b365 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 23 Jun 2024 22:52:17 +0200 Subject: [PATCH 028/431] Sort possible SDL_KeyCode values (swap SDLK_PERCENT and SDLK_DOLLAR) --- include/SDL3/SDL_keycode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index 97a04357454d5..e2a14951e6c29 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -59,8 +59,8 @@ typedef Uint32 SDL_Keycode; #define SDLK_EXCLAIM 0x00000021u /* '!' */ #define SDLK_DBLAPOSTROPHE 0x00000022u /* '"' */ #define SDLK_HASH 0x00000023u /* '#' */ -#define SDLK_PERCENT 0x00000025u /* '%' */ #define SDLK_DOLLAR 0x00000024u /* '$' */ +#define SDLK_PERCENT 0x00000025u /* '%' */ #define SDLK_AMPERSAND 0x00000026u /* '&' */ #define SDLK_APOSTROPHE 0x00000027u /* '\'' */ #define SDLK_LEFTPAREN 0x00000028u /* '(' */ From 3d42412650119a8e13a016e289e5860c034dde19 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sun, 23 Jun 2024 17:52:21 -0400 Subject: [PATCH 029/431] x11: Avoid excess keymap reconstruction KeymapNotify events happen on focus events, as well as when the key group changes. Query the current group and don't rebuild the keymap if it hasn't changed. --- src/video/x11/SDL_x11events.c | 15 ++++++++++++++- src/video/x11/SDL_x11keyboard.c | 5 ++--- src/video/x11/SDL_x11video.h | 1 + 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 043db8de53a34..1eef65fe5a13b 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1131,7 +1131,20 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) printf("window %p: KeymapNotify!\n", data); #endif if (SDL_GetKeyboardFocus() != NULL) { - X11_UpdateKeymap(_this, SDL_TRUE); +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM + if (videodata->xkb) { + XkbStateRec state; + X11_XkbGetUpdatedMap(videodata->display, XkbAllClientInfoMask, videodata->xkb); + + if (X11_XkbGetState(videodata->display, XkbUseCoreKbd, &state) == Success) { + unsigned int group = state.group; + if (group != videodata->xkb_group) { + /* Only rebuild the keymap if the layout has changed. */ + X11_UpdateKeymap(_this, SDL_TRUE); + } + } + } +#endif X11_ReconcileKeyboardState(_this); } } else if (xevent->type == MappingNotify) { diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 543c36e4a866b..9a5d25c9a9832 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -347,7 +347,6 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) int i; SDL_Scancode scancode; SDL_Keymap *keymap; - unsigned char group = 0; keymap = SDL_CreateKeymap(); @@ -357,7 +356,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) X11_XkbGetUpdatedMap(data->display, XkbAllClientInfoMask, data->xkb); if (X11_XkbGetState(data->display, XkbUseCoreKbd, &state) == Success) { - group = state.group; + data->xkb_group = state.group; } } #endif @@ -372,7 +371,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) continue; } - KeySym keysym = X11_KeyCodeToSym(_this, i, group, keymod_masks[m].xkb_mask); + KeySym keysym = X11_KeyCodeToSym(_this, i, data->xkb_group, keymod_masks[m].xkb_mask); /* Note: The default SDL scancode table sets this to right alt instead of AltGr/Mode, so handle it separately. */ if (keysym != XK_ISO_Level3_Shift) { diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 80b5c47997923..f8e567c777cc2 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -125,6 +125,7 @@ struct SDL_VideoData XkbDescPtr xkb; #endif int xkb_event; + unsigned int xkb_group; KeyCode filter_code; Time filter_time; From a4ceb3a31c4ba992d3c01cba59c091bd25c4da6a Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sun, 23 Jun 2024 22:19:46 -0400 Subject: [PATCH 030/431] Revert "x11: Avoid excess keymap reconstruction" Switching between layouts with the same group number (e.g. US to Japanese) were incorrectly filtered out with this change, as it doesn't trigger a MappingNotify event. This reverts commit 3d42412650119a8e13a016e289e5860c034dde19. --- src/video/x11/SDL_x11events.c | 15 +-------------- src/video/x11/SDL_x11keyboard.c | 5 +++-- src/video/x11/SDL_x11video.h | 1 - 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 1eef65fe5a13b..043db8de53a34 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1131,20 +1131,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) printf("window %p: KeymapNotify!\n", data); #endif if (SDL_GetKeyboardFocus() != NULL) { -#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM - if (videodata->xkb) { - XkbStateRec state; - X11_XkbGetUpdatedMap(videodata->display, XkbAllClientInfoMask, videodata->xkb); - - if (X11_XkbGetState(videodata->display, XkbUseCoreKbd, &state) == Success) { - unsigned int group = state.group; - if (group != videodata->xkb_group) { - /* Only rebuild the keymap if the layout has changed. */ - X11_UpdateKeymap(_this, SDL_TRUE); - } - } - } -#endif + X11_UpdateKeymap(_this, SDL_TRUE); X11_ReconcileKeyboardState(_this); } } else if (xevent->type == MappingNotify) { diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 9a5d25c9a9832..543c36e4a866b 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -347,6 +347,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) int i; SDL_Scancode scancode; SDL_Keymap *keymap; + unsigned char group = 0; keymap = SDL_CreateKeymap(); @@ -356,7 +357,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) X11_XkbGetUpdatedMap(data->display, XkbAllClientInfoMask, data->xkb); if (X11_XkbGetState(data->display, XkbUseCoreKbd, &state) == Success) { - data->xkb_group = state.group; + group = state.group; } } #endif @@ -371,7 +372,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) continue; } - KeySym keysym = X11_KeyCodeToSym(_this, i, data->xkb_group, keymod_masks[m].xkb_mask); + KeySym keysym = X11_KeyCodeToSym(_this, i, group, keymod_masks[m].xkb_mask); /* Note: The default SDL scancode table sets this to right alt instead of AltGr/Mode, so handle it separately. */ if (keysym != XK_ISO_Level3_Shift) { diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index f8e567c777cc2..80b5c47997923 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -125,7 +125,6 @@ struct SDL_VideoData XkbDescPtr xkb; #endif int xkb_event; - unsigned int xkb_group; KeyCode filter_code; Time filter_time; From 3150fdc75e52e7f6699d8196b5f3f51d5e18001c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 24 Jun 2024 11:49:56 +0100 Subject: [PATCH 031/431] Revert "testevdev.c: comment out two unused data to fix build." This reverts commit e4f53e6b214cf476c9ad4b035ead97fb62da81c0. We'll use these in the next commit. Signed-off-by: Simon McVittie --- test/testevdev.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/testevdev.c b/test/testevdev.c index 6e5300d9feb32..c94b19bbf0447 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -247,7 +247,6 @@ static unsigned char steam_deck_oled_js_hid_report_descriptor[] = SDL_COMPILE_TIME_ASSERT (steam_deck_oled_js, sizeof (steam_deck_oled_js_hid_report_descriptor) == 38); -#if 0 /* unused for now */ static unsigned char vrs_pedals_hid_report_descriptor[] = { /* Generic Desktop / Joystick */ @@ -265,7 +264,6 @@ static unsigned char vrs_pedals_hid_report_descriptor[] = 0x09, 0x01, 0x81, 0x02, 0xc0, 0xc0, }; SDL_COMPILE_TIME_ASSERT (vrs_pedals, sizeof (vrs_pedals_hid_report_descriptor) == 0136); -#endif static unsigned char thinkpad_usb_keyboard_hid_report_descriptor[] = { @@ -313,7 +311,6 @@ static unsigned char thinkpad_usb_trackpoint_hid_report_descriptor[] = }; SDL_COMPILE_TIME_ASSERT (thinkpad_usb_trackpoint, sizeof (thinkpad_usb_trackpoint_hid_report_descriptor) == 185); -#if 0 /* unused for now */ static unsigned char heusinkveld_pedals_hid_report_descriptor[] = { /* Generic Desktop / Joystick */ @@ -327,7 +324,6 @@ static unsigned char heusinkveld_pedals_hid_report_descriptor[] = 0x01, 0xc0, }; SDL_COMPILE_TIME_ASSERT (heusinkveld_pedals, sizeof (heusinkveld_pedals_hid_report_descriptor) == 072); -#endif static unsigned char fanatec_handbrake_hid_report_descriptor[] = { From 2cfeff15056d7c57c7701a2a6b6dc25c91c93e0f Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 24 Jun 2024 11:50:58 +0100 Subject: [PATCH 032/431] testevdev: Associate HID reports for pedals with their other test data This is how these globals were intended to have been used, similar to what we already did for the Fanatec device. Fixes: 3772d6cc "testevdev: Add raw HID report descriptors where available" Signed-off-by: Simon McVittie --- test/testevdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testevdev.c b/test/testevdev.c index c94b19bbf0447..daa0a6a9434e5 100644 --- a/test/testevdev.c +++ b/test/testevdev.c @@ -2003,6 +2003,8 @@ static const GuessTest guess_tests[] = .ev = { 0x09 }, /* X, Y, Z */ .abs = { 0x07 }, + .hid_report_descriptor_length = sizeof (vrs_pedals_hid_report_descriptor), + .hid_report_descriptor = &vrs_pedals_hid_report_descriptor[0], }, { /* https://github.com/ValveSoftware/Proton/issues/5126 */ .name = "Heusinkveld Heusinkveld Sim Pedals Ultimate", @@ -2019,6 +2021,8 @@ static const GuessTest guess_tests[] = .ev = { 0x09 }, /* RX, RY, RZ */ .abs = { 0x38 }, + .hid_report_descriptor_length = sizeof (heusinkveld_pedals_hid_report_descriptor), + .hid_report_descriptor = &heusinkveld_pedals_hid_report_descriptor[0], }, { /* https://github.com/ValveSoftware/Proton/issues/5126 */ .name = "Vitaly [mega_mozg] Naidentsev ODDOR-handbrake", From 258ee056556c1a5eba60cdcb0dbda0693006780a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 22 Jun 2024 06:15:51 -0700 Subject: [PATCH 033/431] checkkeys: enable showing IME candidates --- test/checkkeys.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/checkkeys.c b/test/checkkeys.c index d5e3ec229e3d7..4dae90ae43154 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -128,7 +128,7 @@ static void PrintKeymap(void) for (m = 0; m < SDL_arraysize(mods); ++m) { for (i = 0; i < SDL_NUM_SCANCODES; ++i) { SDL_Keycode key = SDL_GetKeyFromScancode((SDL_Scancode)i, mods[m]); - SDL_Keycode default_key = SDL_GetDefaultKeyFromScancode((SDL_Scancode)i, mods[m]); + SDL_Keycode default_key = SDL_GetDefaultKeyFromScancode((SDL_Scancode)i, mods[m]); if (key != default_key) { char message[512]; char *spot; @@ -307,6 +307,7 @@ static void loop(void) int main(int argc, char *argv[]) { int w, h; + SDL_Rect input_rect; SDL_SetHint(SDL_HINT_WINDOWS_RAW_KEYBOARD, "1"); @@ -347,6 +348,16 @@ int main(int argc, char *argv[]) } #endif + /* Enable showing IME candidates */ + SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1"); + + /* Set an input rectangle in the center of the window */ + input_rect.x = w / 4; + input_rect.y = h / 4; + input_rect.w = w / 2; + input_rect.h = h / 2; + SDL_SetTextInputRect(&input_rect); + SDL_StartTextInput(); /* Print initial state */ From 76631a09787a7f43d2151b496e7e23d03de9f3d7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 22 Jun 2024 06:16:19 -0700 Subject: [PATCH 034/431] The text input state has been changed to be window-specific. SDL_StartTextInput(), SDL_StopTextInput(), SDL_TextInputActive(), SDL_ClearComposition(), and SDL_SetTextInputRect() all now take a window parameter. This change also fixes IME candidate positioning when SDL_SetTextInputRect() is called before SDL_StartTextInput(), as is recommended in the documentation. --- docs/README-migration.md | 2 + include/SDL3/SDL_keyboard.h | 42 ++++--- src/core/android/SDL_android.c | 4 +- src/core/haiku/SDL_BApp.h | 6 +- src/core/linux/SDL_fcitx.c | 22 ++-- src/core/linux/SDL_fcitx.h | 2 +- src/core/linux/SDL_ibus.c | 30 ++--- src/core/linux/SDL_ibus.h | 2 +- src/core/linux/SDL_ime.c | 6 +- src/core/linux/SDL_ime.h | 2 +- src/dynapi/SDL_dynapi_procs.h | 10 +- src/events/SDL_keyboard.c | 12 +- src/video/SDL_sysvideo.h | 12 +- src/video/SDL_video.c | 71 +++++++----- src/video/android/SDL_androidkeyboard.c | 10 +- src/video/android/SDL_androidkeyboard.h | 1 - src/video/android/SDL_androidvideo.c | 3 - src/video/android/SDL_androidvideo.h | 1 - src/video/cocoa/SDL_cocoakeyboard.h | 6 +- src/video/cocoa/SDL_cocoakeyboard.m | 25 ++-- src/video/cocoa/SDL_cocoavideo.m | 2 +- src/video/emscripten/SDL_emscriptenevents.c | 7 +- src/video/gdk/SDL_gdktextinput.cpp | 11 +- src/video/gdk/SDL_gdktextinput.h | 8 +- src/video/haiku/SDL_bvideo.cc | 14 --- src/video/n3ds/SDL_n3dsswkb.c | 7 +- src/video/n3ds/SDL_n3dsswkb.h | 4 +- src/video/uikit/SDL_uikitvideo.m | 2 +- src/video/uikit/SDL_uikitview.m | 8 +- src/video/uikit/SDL_uikitviewcontroller.h | 2 +- src/video/uikit/SDL_uikitviewcontroller.m | 16 +-- src/video/wayland/SDL_waylandevents.c | 6 +- src/video/wayland/SDL_waylandkeyboard.c | 23 ++-- src/video/wayland/SDL_waylandkeyboard.h | 6 +- src/video/wayland/SDL_waylandvideo.c | 2 +- src/video/windows/SDL_windowsevents.c | 22 ++-- src/video/windows/SDL_windowskeyboard.c | 121 ++++++++++---------- src/video/windows/SDL_windowskeyboard.h | 8 +- src/video/windows/SDL_windowsvideo.c | 2 +- src/video/winrt/SDL_winrtkeyboard.cpp | 2 +- src/video/x11/SDL_x11events.c | 8 +- src/video/x11/SDL_x11keyboard.c | 35 +++--- src/video/x11/SDL_x11keyboard.h | 6 +- src/video/x11/SDL_x11video.c | 2 +- test/checkkeys.c | 22 ++-- test/checkkeysthreads.c | 12 +- test/testautomation_keyboard.c | 41 ++++--- test/testime.c | 10 +- 48 files changed, 350 insertions(+), 328 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 496feceee15a0..3790bc49b563a 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -907,6 +907,8 @@ The following symbols have been removed: Text input is no longer automatically enabled when initializing video, you should call SDL_StartTextInput() when you want to receive text input and call SDL_StopTextInput() when you are done. Starting text input may shown an input method editor (IME) and cause key up/down events to be skipped, so should only be enabled when the application wants text input. +The text input state hase been changed to be window-specific. SDL_StartTextInput(), SDL_StopTextInput(), SDL_TextInputActive(), and SDL_ClearComposition() all now take a window parameter. + SDL_GetDefaultKeyFromScancode(), SDL_GetKeyFromScancode(), and SDL_GetScancodeFromKey() take an SDL_Keymod parameter and use that to provide the correct result based on keyboard modifier state. The following functions have been renamed: diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 83576e208f307..7452461344588 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -353,59 +353,72 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); /** - * Start accepting Unicode text input events. + * Start accepting Unicode text input events in a window. * - * This function will start accepting Unicode text input events in the focused - * SDL window, and start emitting SDL_TextInputEvent (SDL_EVENT_TEXT_INPUT) - * and SDL_TextEditingEvent (SDL_EVENT_TEXT_EDITING) events. Please use this - * function in pair with SDL_StopTextInput(). + * This function will enable text input (SDL_EVENT_TEXT_INPUT and SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this function paired with SDL_StopTextInput(). * * Text input events are not received by default. * - * On some platforms using this function activates the screen keyboard. + * On some platforms using this function shows the screen keyboard. + * + * \param window the window to enable text input. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextInputRect * \sa SDL_StopTextInput + * \sa SDL_TextInputActive */ -extern SDL_DECLSPEC void SDLCALL SDL_StartTextInput(void); +extern SDL_DECLSPEC int SDLCALL SDL_StartTextInput(SDL_Window *window); /** - * Check whether or not Unicode text input events are enabled. + * Check whether or not Unicode text input events are enabled for a window. * + * \param window the window to check. * \returns SDL_TRUE if text input events are enabled else SDL_FALSE. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StartTextInput */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(void); +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window); /** - * Stop receiving any text input events. + * Stop receiving any text input events in a window. * - * Text input events are not received by default. + * If SDL_StartTextInput() showed the screen keyboard, this function will hide it. + * + * \param window the window to disable text input. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_StartTextInput */ -extern SDL_DECLSPEC void SDLCALL SDL_StopTextInput(void); +extern SDL_DECLSPEC int SDLCALL SDL_StopTextInput(SDL_Window *window); /** * Dismiss the composition window/IME without disabling the subsystem. * + * \param window the window to affect. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_StartTextInput * \sa SDL_StopTextInput */ -extern SDL_DECLSPEC void SDLCALL SDL_ClearComposition(void); +extern SDL_DECLSPEC int SDLCALL SDL_ClearComposition(SDL_Window *window); /** * Set the rectangle used to type Unicode text inputs. * + * This is often set to the extents of a text field within the window. + * * Native input methods will place a window with word suggestions near it, * without covering the text being inputted. * @@ -417,6 +430,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ClearComposition(void); * **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you * any feedback. * + * \param window the window for which to set the text input rectangle. * \param rect the SDL_Rect structure representing the rectangle to receive * text (ignored if NULL). * \returns 0 on success or a negative error code on failure; call @@ -426,7 +440,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ClearComposition(void); * * \sa SDL_StartTextInput */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputRect(const SDL_Rect *rect); +extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputRect(SDL_Window *window, const SDL_Rect *rect); /** * Check whether the platform has screen keyboard support. diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index b33d420a1e2d5..a426506010612 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1252,7 +1252,7 @@ JNIEXPORT jboolean JNICALL SDL_JAVA_INTERFACE(onNativeSoftReturnKey)( JNIEnv *env, jclass jcls) { if (SDL_GetHintBoolean(SDL_HINT_RETURN_KEY_HIDES_IME, SDL_FALSE)) { - SDL_StopTextInput(); + SDL_StopTextInput(Android_Window); return JNI_TRUE; } return JNI_FALSE; @@ -1263,7 +1263,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeKeyboardFocusLost)( JNIEnv *env, jclass jcls) { /* Calling SDL_StopTextInput will take care of hiding the keyboard and cleaning up the DummyText widget */ - SDL_StopTextInput(); + SDL_StopTextInput(Android_Window); } /* Touch */ diff --git a/src/core/haiku/SDL_BApp.h b/src/core/haiku/SDL_BApp.h index 37384fdb699d0..e4f3b8dcce427 100644 --- a/src/core/haiku/SDL_BApp.h +++ b/src/core/haiku/SDL_BApp.h @@ -292,8 +292,11 @@ class SDL_BLooper : public BLooper void _HandleKey(BMessage *msg) { + SDL_Window *win; + int32 winID; int32 scancode, state; /* scancode, pressed/released */ if ( + !_GetWinID(msg, &winID) || msg->FindInt32("key-state", &state) != B_OK || msg->FindInt32("key-scancode", &scancode) != B_OK) { return; @@ -306,7 +309,8 @@ class SDL_BLooper : public BLooper HAIKU_SetKeyState(scancode, state); SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, scancode, HAIKU_GetScancodeFromBeKey(scancode), state); - if (state == SDL_PRESSED && SDL_TextInputActive()) { + win = GetSDLWindow(winID); + if (state == SDL_PRESSED && SDL_TextInputActive(win)) { const int8 *keyUtf8; ssize_t count; if (msg->FindData("key-utf8", B_INT8_TYPE, (const void **)&keyUtf8, &count) == B_OK) { diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 808054a05b255..bd0a8fb7b2dc3 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -211,7 +211,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m SDL_SendEditingText("", 0, 0); } - SDL_Fcitx_UpdateTextRect(NULL); + SDL_Fcitx_UpdateTextRect(SDL_GetKeyboardFocus()); return DBUS_HANDLER_RESULT_HANDLED; } @@ -390,7 +390,7 @@ SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mod_state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID, DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) { if (handled) { - SDL_Fcitx_UpdateTextRect(NULL); + SDL_Fcitx_UpdateTextRect(SDL_GetKeyboardFocus()); return SDL_TRUE; } } @@ -398,26 +398,22 @@ SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) return SDL_FALSE; } -void SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) +void SDL_Fcitx_UpdateTextRect(SDL_Window *window) { - SDL_Window *focused_win = NULL; int x = 0, y = 0; SDL_Rect *cursor = &fcitx_client.cursor_rect; - if (rect) { - SDL_copyp(cursor, rect); - } - - focused_win = SDL_GetKeyboardFocus(); - if (!focused_win) { + if (!window) { return; } - SDL_GetWindowPosition(focused_win, &x, &y); + SDL_copyp(cursor, &window->text_input_rect); + + SDL_GetWindowPosition(window, &x, &y); #ifdef SDL_VIDEO_DRIVER_X11 { - SDL_PropertiesID props = SDL_GetWindowProperties(focused_win); + SDL_PropertiesID props = SDL_GetWindowProperties(window); Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0); Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); @@ -431,7 +427,7 @@ void SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect) if (cursor->x == -1 && cursor->y == -1 && cursor->w == 0 && cursor->h == 0) { /* move to bottom left */ int w = 0, h = 0; - SDL_GetWindowSize(focused_win, &w, &h); + SDL_GetWindowSize(window, &w, &h); cursor->x = 0; cursor->y = h; } diff --git a/src/core/linux/SDL_fcitx.h b/src/core/linux/SDL_fcitx.h index 44ee053309f68..daddf8fd4e143 100644 --- a/src/core/linux/SDL_fcitx.h +++ b/src/core/linux/SDL_fcitx.h @@ -29,7 +29,7 @@ extern void SDL_Fcitx_Quit(void); extern void SDL_Fcitx_SetFocus(SDL_bool focused); extern void SDL_Fcitx_Reset(void); extern SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state); -extern void SDL_Fcitx_UpdateTextRect(const SDL_Rect *rect); +extern void SDL_Fcitx_UpdateTextRect(SDL_Window *window); extern void SDL_Fcitx_PumpEvents(void); #endif /* SDL_fcitx_h_ */ diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 9e514c302220c..370dff7d4b65c 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -261,7 +261,7 @@ static DBusHandlerResult IBus_MessageHandler(DBusConnection *conn, DBusMessage * } } - SDL_IBus_UpdateTextRect(NULL); + SDL_IBus_UpdateTextRect(SDL_GetKeyboardFocus()); return DBUS_HANDLER_RESULT_HANDLED; } @@ -480,9 +480,13 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr) dbus->connection_flush(ibus_conn); } - SDL_IBus_SetFocus(SDL_GetKeyboardFocus() != NULL); - SDL_IBus_UpdateTextRect(NULL); - + SDL_Window *window = SDL_GetKeyboardFocus(); + if (SDL_TextInputActive(window)) { + SDL_IBus_SetFocus(SDL_TRUE); + SDL_IBus_UpdateTextRect(window); + } else { + SDL_IBus_SetFocus(SDL_FALSE); + } return result; } @@ -670,31 +674,27 @@ SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) } } - SDL_IBus_UpdateTextRect(NULL); + SDL_IBus_UpdateTextRect(SDL_GetKeyboardFocus()); return (result != 0); } -void SDL_IBus_UpdateTextRect(const SDL_Rect *rect) +void SDL_IBus_UpdateTextRect(SDL_Window *window) { - SDL_Window *focused_win; int x = 0, y = 0; SDL_DBusContext *dbus; - if (rect) { - SDL_memcpy(&ibus_cursor_rect, rect, sizeof(ibus_cursor_rect)); - } - - focused_win = SDL_GetKeyboardFocus(); - if (!focused_win) { + if (!window) { return; } - SDL_GetWindowPosition(focused_win, &x, &y); + SDL_copyp(&ibus_cursor_rect, &window->text_input_rect); + + SDL_GetWindowPosition(window, &x, &y); #ifdef SDL_VIDEO_DRIVER_X11 { - SDL_PropertiesID props = SDL_GetWindowProperties(focused_win); + SDL_PropertiesID props = SDL_GetWindowProperties(window); Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0); Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); diff --git a/src/core/linux/SDL_ibus.h b/src/core/linux/SDL_ibus.h index 377a9fc2bd36f..5ff90cb82de98 100644 --- a/src/core/linux/SDL_ibus.h +++ b/src/core/linux/SDL_ibus.h @@ -44,7 +44,7 @@ extern SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 st /* Update the position of IBus' candidate list. If rect is NULL then this will just reposition it relative to the focused window's new position. */ -extern void SDL_IBus_UpdateTextRect(const SDL_Rect *window_relative_rect); +extern void SDL_IBus_UpdateTextRect(SDL_Window *window); /* Checks DBus for new IBus events, and calls SDL_SendKeyboardText / SDL_SendEditingText for each event it finds */ diff --git a/src/core/linux/SDL_ime.c b/src/core/linux/SDL_ime.c index 752c3ab9b8c2b..7f2ba82392636 100644 --- a/src/core/linux/SDL_ime.c +++ b/src/core/linux/SDL_ime.c @@ -29,7 +29,7 @@ typedef void (*SDL_IME_Quit_t)(void); typedef void (*SDL_IME_SetFocus_t)(SDL_bool); typedef void (*SDL_IME_Reset_t)(void); typedef SDL_bool (*SDL_IME_ProcessKeyEvent_t)(Uint32, Uint32, Uint8 state); -typedef void (*SDL_IME_UpdateTextRect_t)(const SDL_Rect *); +typedef void (*SDL_IME_UpdateTextRect_t)(SDL_Window *window); typedef void (*SDL_IME_PumpEvents_t)(void); static SDL_IME_Init_t SDL_IME_Init_Real = NULL; @@ -135,10 +135,10 @@ SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) return SDL_FALSE; } -void SDL_IME_UpdateTextRect(const SDL_Rect *rect) +void SDL_IME_UpdateTextRect(SDL_Window *window) { if (SDL_IME_UpdateTextRect_Real) { - SDL_IME_UpdateTextRect_Real(rect); + SDL_IME_UpdateTextRect_Real(window); } } diff --git a/src/core/linux/SDL_ime.h b/src/core/linux/SDL_ime.h index f0ac778259afe..088ac53397821 100644 --- a/src/core/linux/SDL_ime.h +++ b/src/core/linux/SDL_ime.h @@ -29,7 +29,7 @@ extern void SDL_IME_Quit(void); extern void SDL_IME_SetFocus(SDL_bool focused); extern void SDL_IME_Reset(void); extern SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state); -extern void SDL_IME_UpdateTextRect(const SDL_Rect *rect); +extern void SDL_IME_UpdateTextRect(SDL_Window *window); extern void SDL_IME_PumpEvents(void); #endif /* SDL_ime_h_ */ diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 09cc85694a0ce..bc9b6bfe7a307 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -86,7 +86,7 @@ SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return) SDL_DYNAPI_PROC(void,SDL_CleanupTLS,(void),(),) SDL_DYNAPI_PROC(int,SDL_ClearAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ClearClipboardData,(void),(),return) -SDL_DYNAPI_PROC(void,SDL_ClearComposition,(void),(),) +SDL_DYNAPI_PROC(int,SDL_ClearComposition,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ClearError,(void),(),return) SDL_DYNAPI_PROC(int,SDL_ClearProperty,(SDL_PropertiesID a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),) @@ -779,7 +779,7 @@ SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b), SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTLS,(SDL_TLSID a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) -SDL_DYNAPI_PROC(int,SDL_SetTextInputRect,(const SDL_Rect *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_SetTextInputRect,(SDL_Window *a, const SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaModFloat,(SDL_Texture *a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode b),(a,b),return) @@ -821,17 +821,17 @@ SDL_DYNAPI_PROC(int,SDL_ShowWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SignalCondition,(SDL_Condition *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SoftStretch,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(void,SDL_StartTextInput,(void),(),) +SDL_DYNAPI_PROC(int,SDL_StartTextInput,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_StopHapticEffect,(SDL_Haptic *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_StopHapticEffects,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(int,SDL_StopHapticRumble,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(void,SDL_StopTextInput,(void),(),) +SDL_DYNAPI_PROC(int,SDL_StopTextInput,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_StorageReady,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasColorKey,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_SurfaceHasRLE,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SyncWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(Sint64,SDL_TellIO,(SDL_IOStream *a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_TextInputActive,(void),(),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_TextInputActive,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Time,SDL_TimeFromWindows,(Uint32 a, Uint32 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_TimeToDateTime,(SDL_Time a, SDL_DateTime *b, SDL_bool c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_TimeToWindows,(SDL_Time a, Uint32 *b, Uint32 *c),(a,b,c),) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index d490facae4536..21e581dcfde3c 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -303,9 +303,9 @@ int SDL_SetKeyboardFocus(SDL_Window *window) SDL_SendWindowEvent(keyboard->focus, SDL_EVENT_WINDOW_FOCUS_LOST, 0, 0); /* Ensures IME compositions are committed */ - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(keyboard->focus)) { if (video && video->StopTextInput) { - video->StopTextInput(video); + video->StopTextInput(video, keyboard->focus); } } } @@ -315,9 +315,9 @@ int SDL_SetKeyboardFocus(SDL_Window *window) if (keyboard->focus) { SDL_SendWindowEvent(keyboard->focus, SDL_EVENT_WINDOW_FOCUS_GAINED, 0, 0); - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(keyboard->focus)) { if (video && video->StartTextInput) { - video->StartTextInput(video); + video->StartTextInput(video, keyboard->focus); } } } @@ -598,7 +598,7 @@ int SDL_SendKeyboardText(const char *text) SDL_Keyboard *keyboard = &SDL_keyboard; int posted; - if (!SDL_TextInputActive()) { + if (!SDL_TextInputActive(keyboard->focus)) { return 0; } @@ -632,7 +632,7 @@ int SDL_SendEditingText(const char *text, int start, int length) SDL_Keyboard *keyboard = &SDL_keyboard; int posted; - if (!SDL_TextInputActive()) { + if (!SDL_TextInputActive(keyboard->focus)) { return 0; } diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 9add48fcac2c7..b49a1501ce20a 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -101,6 +101,9 @@ struct SDL_Window SDL_bool is_destroying; SDL_bool is_dropping; /* drag/drop in progress, expecting SDL_SendDropComplete(). */ + SDL_bool text_input_active; + SDL_Rect text_input_rect; + SDL_Rect mouse_rect; SDL_HitTest hit_test; @@ -322,10 +325,10 @@ struct SDL_VideoDevice int (*SuspendScreenSaver)(SDL_VideoDevice *_this); /* Text input */ - void (*StartTextInput)(SDL_VideoDevice *_this); - void (*StopTextInput)(SDL_VideoDevice *_this); - int (*SetTextInputRect)(SDL_VideoDevice *_this, const SDL_Rect *rect); - void (*ClearComposition)(SDL_VideoDevice *_this); + int (*StartTextInput)(SDL_VideoDevice *_this, SDL_Window *window); + int (*StopTextInput)(SDL_VideoDevice *_this, SDL_Window *window); + int (*UpdateTextInputRect)(SDL_VideoDevice *_this, SDL_Window *window); + int (*ClearComposition)(SDL_VideoDevice *_this, SDL_Window *window); /* Screen keyboard */ SDL_bool (*HasScreenKeyboardSupport)(SDL_VideoDevice *_this); @@ -382,7 +385,6 @@ struct SDL_VideoDevice SDL_bool setting_display_mode; Uint32 device_caps; SDL_SystemTheme system_theme; - SDL_bool text_input_active; /* * * */ /* Data used by the GL drivers */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 2cfbfb96dac63..2ffb28ff4576c 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4981,74 +4981,85 @@ void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask) } #endif -void SDL_StartTextInput(void) +int SDL_StartTextInput(SDL_Window *window) { - if (!_this) { - return; - } + CHECK_WINDOW_MAGIC(window, -1); /* Show the on-screen keyboard, if desired */ const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD); if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) || SDL_GetStringBoolean(hint, SDL_FALSE)) { - SDL_Window *window = SDL_GetKeyboardFocus(); - if (window && _this->ShowScreenKeyboard) { + if (_this->ShowScreenKeyboard) { _this->ShowScreenKeyboard(_this, window); } } /* Finally start the text input system */ if (_this->StartTextInput) { - _this->StartTextInput(_this); + if (_this->StartTextInput(_this, window) < 0) { + return -1; + } } - _this->text_input_active = SDL_TRUE; + window->text_input_active = SDL_TRUE; + return 0; } -void SDL_ClearComposition(void) +SDL_bool SDL_TextInputActive(SDL_Window *window) { - if (_this && _this->ClearComposition) { - _this->ClearComposition(_this); - } -} + CHECK_WINDOW_MAGIC(window, SDL_FALSE); -SDL_bool SDL_TextInputActive(void) -{ - return _this && _this->text_input_active; + return window->text_input_active; } -void SDL_StopTextInput(void) +int SDL_StopTextInput(SDL_Window *window) { - if (!_this) { - return; - } + CHECK_WINDOW_MAGIC(window, -1); /* Stop the text input system */ if (_this->StopTextInput) { - _this->StopTextInput(_this); + _this->StopTextInput(_this, window); } - _this->text_input_active = SDL_FALSE; + window->text_input_active = SDL_FALSE; /* Hide the on-screen keyboard, if desired */ const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD); if (((!hint || SDL_strcasecmp(hint, "auto") == 0) && !SDL_HasKeyboard()) || SDL_GetStringBoolean(hint, SDL_FALSE)) { - SDL_Window *window = SDL_GetKeyboardFocus(); - if (window && _this->HideScreenKeyboard) { + if (_this->HideScreenKeyboard) { _this->HideScreenKeyboard(_this, window); } } + return 0; } -int SDL_SetTextInputRect(const SDL_Rect *rect) +int SDL_SetTextInputRect(SDL_Window *window, const SDL_Rect *rect) { - if (!rect) { - return SDL_InvalidParamError("rect"); + CHECK_WINDOW_MAGIC(window, -1); + + if (rect) { + SDL_copyp(&window->text_input_rect, rect); + } else { + SDL_zero(window->text_input_rect); } - if (_this && _this->SetTextInputRect) { - return _this->SetTextInputRect(_this, rect); + if (_this && _this->UpdateTextInputRect) { + if (_this->UpdateTextInputRect(_this, window) < 0) { + return -1; + } } - return SDL_Unsupported(); + return 0; +} + +int SDL_ClearComposition(SDL_Window *window) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (_this->ClearComposition) { + if (_this->ClearComposition(_this, window) < 0) { + return -1; + } + } + return 0; } SDL_bool SDL_HasScreenKeyboardSupport(void) diff --git a/src/video/android/SDL_androidkeyboard.c b/src/video/android/SDL_androidkeyboard.c index 45bf4021aa564..85a124725ce67 100644 --- a/src/video/android/SDL_androidkeyboard.c +++ b/src/video/android/SDL_androidkeyboard.c @@ -345,8 +345,7 @@ SDL_bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this) void Android_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; - Android_JNI_ShowScreenKeyboard(&videodata->textRect); + Android_JNI_ShowScreenKeyboard(&window->text_input_rect); SDL_screen_keyboard_shown = SDL_TRUE; } @@ -368,11 +367,4 @@ SDL_bool Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *windo return Android_JNI_IsScreenKeyboardShown(); } -int Android_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) -{ - SDL_VideoData *videodata = _this->driverdata; - videodata->textRect = *rect; - return 0; -} - #endif /* SDL_VIDEO_DRIVER_ANDROID */ diff --git a/src/video/android/SDL_androidkeyboard.h b/src/video/android/SDL_androidkeyboard.h index 48de9d481f2c9..bcbd948e1caa9 100644 --- a/src/video/android/SDL_androidkeyboard.h +++ b/src/video/android/SDL_androidkeyboard.h @@ -30,4 +30,3 @@ extern void Android_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *windo extern void Android_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); extern void Android_RestoreScreenKeyboardOnResume(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -extern int Android_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c index 5924a027ecdd9..8e2cae7c00b9d 100644 --- a/src/video/android/SDL_androidvideo.c +++ b/src/video/android/SDL_androidvideo.c @@ -143,9 +143,6 @@ static SDL_VideoDevice *Android_CreateDevice(void) /* Screensaver */ device->SuspendScreenSaver = Android_SuspendScreenSaver; - /* Text input */ - device->SetTextInputRect = Android_SetTextInputRect; - /* Screen keyboard */ device->HasScreenKeyboardSupport = Android_HasScreenKeyboardSupport; device->ShowScreenKeyboard = Android_ShowScreenKeyboard; diff --git a/src/video/android/SDL_androidvideo.h b/src/video/android/SDL_androidvideo.h index f6dd54eb56073..b7043ffa8de9e 100644 --- a/src/video/android/SDL_androidvideo.h +++ b/src/video/android/SDL_androidvideo.h @@ -35,7 +35,6 @@ extern void Android_SetDarkMode(SDL_bool enabled); struct SDL_VideoData { - SDL_Rect textRect; int isPaused; int isPausing; int pauseAudio; diff --git a/src/video/cocoa/SDL_cocoakeyboard.h b/src/video/cocoa/SDL_cocoakeyboard.h index 1314ec67d857d..ccbc057b44b6f 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.h +++ b/src/video/cocoa/SDL_cocoakeyboard.h @@ -27,9 +27,9 @@ extern void Cocoa_InitKeyboard(SDL_VideoDevice *_this); extern void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event); extern void Cocoa_QuitKeyboard(SDL_VideoDevice *_this); -extern void Cocoa_StartTextInput(SDL_VideoDevice *_this); -extern void Cocoa_StopTextInput(SDL_VideoDevice *_this); -extern int Cocoa_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +extern int Cocoa_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); extern int Cocoa_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index f6ef52bf3ad57..b003d6910b488 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -48,7 +48,7 @@ @implementation SDLTranslatorResponder - (void)setInputRect:(const SDL_Rect *)rect { - _inputRect = *rect; + SDL_copyp(&_inputRect, rect); } - (void)insertText:(id)aString replacementRange:(NSRange)replacementRange @@ -343,16 +343,12 @@ void Cocoa_InitKeyboard(SDL_VideoDevice *_this) SDL_ToggleModState(SDL_KMOD_CAPS, (data.modifierFlags & NSEventModifierFlagCapsLock) ? SDL_TRUE : SDL_FALSE); } -void Cocoa_StartTextInput(SDL_VideoDevice *_this) +int Cocoa_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSView *parentView; SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; - SDL_Window *window = SDL_GetKeyboardFocus(); - NSWindow *nswindow = nil; - if (window) { - nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; - } + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; parentView = [nswindow contentView]; @@ -362,8 +358,7 @@ void Cocoa_StartTextInput(SDL_VideoDevice *_this) * text input, simply remove the field editor from its superview then add * it to the front most window's content view */ if (!data.fieldEdit) { - data.fieldEdit = - [[SDLTranslatorResponder alloc] initWithFrame:NSMakeRect(0.0, 0.0, 0.0, 0.0)]; + data.fieldEdit = [[SDLTranslatorResponder alloc] initWithFrame:NSMakeRect(0.0, 0.0, 0.0, 0.0)]; } if (![[data.fieldEdit superview] isEqual:parentView]) { @@ -373,9 +368,10 @@ void Cocoa_StartTextInput(SDL_VideoDevice *_this) [nswindow makeFirstResponder:data.fieldEdit]; } } + return Cocoa_UpdateTextInputRect(_this, window); } -void Cocoa_StopTextInput(SDL_VideoDevice *_this) +int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; @@ -385,12 +381,15 @@ void Cocoa_StopTextInput(SDL_VideoDevice *_this) data.fieldEdit = nil; } } + return 0; } -int Cocoa_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) +int Cocoa_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; - [data.fieldEdit setInputRect:rect]; + if (data.fieldEdit) { + [data.fieldEdit setInputRect:&window->text_input_rect]; + } return 0; } @@ -433,7 +432,7 @@ void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event) SDL_Log("The key you just pressed is not recognized by SDL. To help get this fixed, report this to the SDL forums/mailing list or to Christian Walther . Mac virtual key code is %d.\n", scancode); } #endif - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { /* FIXME CW 2007-08-16: only send those events to the field editor for which we actually want text events, not e.g. esc or function keys. Arrow keys in particular seem to produce crashes sometimes. */ [data.fieldEdit interpretKeyEvents:[NSArray arrayWithObject:event]]; #if 0 diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 5e796c73f4b29..0b63c248cc9fa 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -172,7 +172,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device) device->StartTextInput = Cocoa_StartTextInput; device->StopTextInput = Cocoa_StopTextInput; - device->SetTextInputRect = Cocoa_SetTextInputRect; + device->UpdateTextInputRect = Cocoa_UpdateTextInputRect; device->SetClipboardData = Cocoa_SetClipboardData; device->GetClipboardData = Cocoa_GetClipboardData; diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 99ed3efbb738f..fa6a0d1c98b98 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -790,6 +790,7 @@ static EM_BOOL Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) { + SDL_WindowData *window_data = (SDL_WindowData *)userData; const SDL_Keycode keycode = Emscripten_MapKeyCode(keyEvent); SDL_Scancode scancode = Emscripten_MapScanCode(keyEvent->code); SDL_bool prevent_default = SDL_TRUE; @@ -852,7 +853,7 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent is_nav_key = SDL_TRUE; } - if ((eventType == EMSCRIPTEN_EVENT_KEYDOWN) && SDL_TextInputActive() && !is_nav_key) { + if ((eventType == EMSCRIPTEN_EVENT_KEYDOWN) && SDL_TextInputActive(window_data->window) && !is_nav_key) { prevent_default = SDL_FALSE; } @@ -861,7 +862,9 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent static EM_BOOL Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) { - if (SDL_TextInputActive()) { + SDL_WindowData *window_data = (SDL_WindowData *)userData; + + if (SDL_TextInputActive(window_data->window)) { char text[5]; if (Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text)) { SDL_SendKeyboardText(text); diff --git a/src/video/gdk/SDL_gdktextinput.cpp b/src/video/gdk/SDL_gdktextinput.cpp index b54b1ab774672..de82500deda9b 100644 --- a/src/video/gdk/SDL_gdktextinput.cpp +++ b/src/video/gdk/SDL_gdktextinput.cpp @@ -178,7 +178,7 @@ void GDK_EnsureHints(void) } } -void GDK_StartTextInput(SDL_VideoDevice *_this) +int GDK_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { /* * Currently a stub, since all input is handled by the virtual keyboard, @@ -191,14 +191,16 @@ void GDK_StartTextInput(SDL_VideoDevice *_this) * Right now this function isn't implemented on Desktop * and seems to be present only in the docs? So I didn't bother. */ + return 0; } -void GDK_StopTextInput(SDL_VideoDevice *_this) +int GDK_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { /* See notice in GDK_StartTextInput */ + return 0; } -int GDK_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) +int GDK_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) { /* * XGameUiShowTextEntryAsync does not allow you to set @@ -212,9 +214,10 @@ int GDK_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) return 0; } -void GDK_ClearComposition(SDL_VideoDevice *_this) +int GDK_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) { /* See notice in GDK_StartTextInput */ + return 0; } SDL_bool GDK_HasScreenKeyboardSupport(SDL_VideoDevice *_this) diff --git a/src/video/gdk/SDL_gdktextinput.h b/src/video/gdk/SDL_gdktextinput.h index 52727031438d3..78c506cbf2774 100644 --- a/src/video/gdk/SDL_gdktextinput.h +++ b/src/video/gdk/SDL_gdktextinput.h @@ -32,10 +32,10 @@ extern "C" { void GDK_EnsureHints(void); -void GDK_StartTextInput(SDL_VideoDevice *_this); -void GDK_StopTextInput(SDL_VideoDevice *_this); -int GDK_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); -void GDK_ClearComposition(SDL_VideoDevice *_this); +int GDK_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); +int GDK_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); +int GDK_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +int GDK_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window); SDL_bool GDK_HasScreenKeyboardSupport(SDL_VideoDevice *_this); void GDK_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc index 2b5b170963b5a..f4ed4c8ba9207 100644 --- a/src/video/haiku/SDL_bvideo.cc +++ b/src/video/haiku/SDL_bvideo.cc @@ -47,16 +47,6 @@ static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { return (SDL_BWin *)(window->driverdata); } -/* FIXME: Undefined functions */ -// #define HAIKU_PumpEvents NULL - #define HAIKU_StartTextInput NULL - #define HAIKU_StopTextInput NULL - #define HAIKU_SetTextInputRect NULL - -// #define HAIKU_DeleteDevice NULL - -/* End undefined functions */ - static SDL_VideoDevice * HAIKU_CreateDevice(void) { SDL_VideoDevice *device; @@ -109,10 +99,6 @@ static SDL_VideoDevice * HAIKU_CreateDevice(void) device->GL_DeleteContext = HAIKU_GL_DeleteContext; #endif - device->StartTextInput = HAIKU_StartTextInput; - device->StopTextInput = HAIKU_StopTextInput; - device->SetTextInputRect = HAIKU_SetTextInputRect; - device->SetClipboardText = HAIKU_SetClipboardText; device->GetClipboardText = HAIKU_GetClipboardText; device->HasClipboardText = HAIKU_HasClipboardText; diff --git a/src/video/n3ds/SDL_n3dsswkb.c b/src/video/n3ds/SDL_n3dsswkb.c index 0948fff095e16..1140aae0872a2 100644 --- a/src/video/n3ds/SDL_n3dsswkb.c +++ b/src/video/n3ds/SDL_n3dsswkb.c @@ -50,7 +50,7 @@ SDL_bool N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this) return SDL_TRUE; } -void N3DS_StartTextInput(SDL_VideoDevice *_this) +int N3DS_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { char buffer[BUFFER_SIZE]; SwkbdButton button_pressed; @@ -58,11 +58,12 @@ void N3DS_StartTextInput(SDL_VideoDevice *_this) if (button_pressed == SWKBD_BUTTON_CONFIRM) { SDL_SendKeyboardText(buffer); } + return 0; } -void N3DS_StopTextInput(SDL_VideoDevice *_this) +int N3DS_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { - return; + return 0; } #endif /* SDL_VIDEO_DRIVER_N3DS */ diff --git a/src/video/n3ds/SDL_n3dsswkb.h b/src/video/n3ds/SDL_n3dsswkb.h index da86f0b5bb2d9..0f505ebe89101 100644 --- a/src/video/n3ds/SDL_n3dsswkb.h +++ b/src/video/n3ds/SDL_n3dsswkb.h @@ -30,7 +30,7 @@ void N3DS_SwkbQuit(); SDL_bool N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this); -void N3DS_StartTextInput(SDL_VideoDevice *_this); -void N3DS_StopTextInput(SDL_VideoDevice *_this); +int N3DS_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); +int N3DS_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); #endif /* SDL_n3dskeyboard_h_ */ diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index c4f1eb04609a5..dea57315cffc1 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -100,7 +100,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice *device) device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard; device->HideScreenKeyboard = UIKit_HideScreenKeyboard; device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown; - device->SetTextInputRect = UIKit_SetTextInputRect; + device->UpdateTextInputRect = UIKit_UpdateTextInputRect; #endif device->SetClipboardText = UIKit_SetClipboardText; diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index 92d3dd3461bcc..ebae602fc3ec1 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -417,7 +417,7 @@ - (void)pressesBegan:(NSSet *)presses withEvent:(UIPressesEvent *)eve SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_PRESSED); } } - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(sdlwindow)) { [super pressesBegan:presses withEvent:event]; } } @@ -430,7 +430,7 @@ - (void)pressesEnded:(NSSet *)presses withEvent:(UIPressesEvent *)eve SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); } } - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(sdlwindow)) { [super pressesEnded:presses withEvent:event]; } } @@ -443,7 +443,7 @@ - (void)pressesCancelled:(NSSet *)presses withEvent:(UIPressesEvent * SDL_SendKeyboardKey(UIKit_GetEventTimestamp([event timestamp]), SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); } } - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(sdlwindow)) { [super pressesCancelled:presses withEvent:event]; } } @@ -451,7 +451,7 @@ - (void)pressesCancelled:(NSSet *)presses withEvent:(UIPressesEvent * - (void)pressesChanged:(NSSet *)presses withEvent:(UIPressesEvent *)event { /* This is only called when the force of a press changes. */ - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(sdlwindow)) { [super pressesChanged:presses withEvent:event]; } } diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h index 23d93f876f27a..670c174fef681 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.h +++ b/src/video/uikit/SDL_uikitviewcontroller.h @@ -91,5 +91,5 @@ SDL_bool UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this); void UIKit_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); void UIKit_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -int UIKit_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +int UIKit_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); #endif diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index f6de072e85cb1..1027b8d883146 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -425,7 +425,7 @@ - (void)keyboardWillShow:(NSNotification *)notification { BOOL shouldStartTextInput = NO; - if (!SDL_TextInputActive() && !hidingKeyboard && !rotatingOrientation) { + if (!SDL_TextInputActive(window) && !hidingKeyboard && !rotatingOrientation) { shouldStartTextInput = YES; } @@ -441,7 +441,7 @@ - (void)keyboardWillShow:(NSNotification *)notification #endif if (shouldStartTextInput) { - SDL_StartTextInput(); + SDL_StartTextInput(window); } } @@ -454,7 +454,7 @@ - (void)keyboardWillHide:(NSNotification *)notification { BOOL shouldStopTextInput = NO; - if (SDL_TextInputActive() && !showingKeyboard && !rotatingOrientation) { + if (SDL_TextInputActive(window) && !showingKeyboard && !rotatingOrientation) { shouldStopTextInput = YES; } @@ -462,7 +462,7 @@ - (void)keyboardWillHide:(NSNotification *)notification [self setKeyboardHeight:0]; if (shouldStopTextInput) { - SDL_StopTextInput(); + SDL_StopTextInput(window); } } @@ -567,7 +567,7 @@ - (BOOL)textFieldShouldReturn:(UITextField *)_textField SDL_SendKeyboardKeyAutoRelease(0, SDL_SCANCODE_RETURN); if (keyboardVisible && SDL_GetHintBoolean(SDL_HINT_RETURN_KEY_HIDES_IME, SDL_FALSE)) { - SDL_StopTextInput(); + SDL_StopTextInput(window); } return YES; } @@ -623,12 +623,12 @@ SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) } } -int UIKit_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) +int UIKit_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_uikitviewcontroller *vc = GetWindowViewController(SDL_GetKeyboardFocus()); + SDL_uikitviewcontroller *vc = GetWindowViewController(window); if (vc != nil) { - vc.textInputRect = *rect; + vc.textInputRect = window->text_input_rect; if (vc.keyboardVisible) { [vc updateKeyboard]; diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 309f3e41308a6..05e4017dcba82 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -381,7 +381,7 @@ int Wayland_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) WAYLAND_wl_display_flush(d->display); #ifdef SDL_USE_IME - if (!d->text_input_manager && SDL_TextInputActive()) { + if (!d->text_input_manager && SDL_TextInputActive(SDL_GetKeyboardFocus())) { SDL_IME_PumpEvents(); } #endif @@ -454,7 +454,7 @@ void Wayland_PumpEvents(SDL_VideoDevice *_this) int err; #ifdef SDL_USE_IME - if (!d->text_input_manager && SDL_TextInputActive()) { + if (!d->text_input_manager && SDL_TextInputActive(SDL_GetKeyboardFocus())) { SDL_IME_PumpEvents(); } #endif @@ -1649,7 +1649,7 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, Wayland_UpdateImplicitGrabSerial(input, serial); if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { has_text = keyboard_input_get_text(text, input, key, SDL_PRESSED, &handled_by_ime); } } else { diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c index eac7e8219a57c..481e706cb2943 100644 --- a/src/video/wayland/SDL_waylandkeyboard.c +++ b/src/video/wayland/SDL_waylandkeyboard.c @@ -51,7 +51,7 @@ void Wayland_QuitKeyboard(SDL_VideoDevice *_this) #endif } -void Wayland_StartTextInput(SDL_VideoDevice *_this) +int Wayland_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *driverdata = _this->driverdata; struct SDL_WaylandInput *input = driverdata->input; @@ -82,9 +82,11 @@ void Wayland_StartTextInput(SDL_VideoDevice *_this) /* Reset compose state so composite and dead keys don't carry over */ WAYLAND_xkb_compose_state_reset(input->xkb.compose_state); } + + return Wayland_UpdateTextInputRect(_this, window); } -void Wayland_StopTextInput(SDL_VideoDevice *_this) +int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *driverdata = _this->driverdata; struct SDL_WaylandInput *input = driverdata->input; @@ -105,21 +107,22 @@ void Wayland_StopTextInput(SDL_VideoDevice *_this) /* Reset compose state so composite and dead keys don't carry over */ WAYLAND_xkb_compose_state_reset(input->xkb.compose_state); } + return 0; } -int Wayland_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) +int Wayland_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *driverdata = _this->driverdata; if (driverdata->text_input_manager) { struct SDL_WaylandInput *input = driverdata->input; if (input && input->text_input) { - if (!SDL_RectsEqual(rect, &input->text_input->cursor_rect)) { - SDL_copyp(&input->text_input->cursor_rect, rect); + if (!SDL_RectsEqual(&window->text_input_rect, &input->text_input->cursor_rect)) { + SDL_copyp(&input->text_input->cursor_rect, &window->text_input_rect); zwp_text_input_v3_set_cursor_rectangle(input->text_input->text_input, - rect->x, - rect->y, - rect->w, - rect->h); + window->text_input_rect.x, + window->text_input_rect.y, + window->text_input_rect.w, + window->text_input_rect.h); zwp_text_input_v3_commit(input->text_input->text_input); } } @@ -127,7 +130,7 @@ int Wayland_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) #ifdef SDL_USE_IME else { - SDL_IME_UpdateTextRect(rect); + SDL_IME_UpdateTextRect(window); } #endif return 0; diff --git a/src/video/wayland/SDL_waylandkeyboard.h b/src/video/wayland/SDL_waylandkeyboard.h index 62613cffffe79..b42bb11b91a14 100644 --- a/src/video/wayland/SDL_waylandkeyboard.h +++ b/src/video/wayland/SDL_waylandkeyboard.h @@ -32,9 +32,9 @@ typedef struct SDL_WaylandTextInput extern int Wayland_InitKeyboard(SDL_VideoDevice *_this); extern void Wayland_QuitKeyboard(SDL_VideoDevice *_this); -extern void Wayland_StartTextInput(SDL_VideoDevice *_this); -extern void Wayland_StopTextInput(SDL_VideoDevice *_this); -extern int Wayland_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +extern int Wayland_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool Wayland_HasScreenKeyboardSupport(SDL_VideoDevice *_this); #endif /* SDL_waylandkeyboard_h_ */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index aedc1b23934e1..893fd1bd9ad16 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -511,7 +511,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) device->HasClipboardData = Wayland_HasClipboardData; device->StartTextInput = Wayland_StartTextInput; device->StopTextInput = Wayland_StopTextInput; - device->SetTextInputRect = Wayland_SetTextInputRect; + device->UpdateTextInputRect = Wayland_UpdateTextInputRect; #ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = Wayland_Vulkan_LoadLibrary; diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 9cc060ac7c998..4e4f29f16e0c9 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1280,7 +1280,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara if (wParam == UNICODE_NOCHAR) { returnCode = 1; } else { - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(data->window)) { char text[5]; if (SDL_UCS4ToUTF8((Uint32)wParam, text) != text) { SDL_SendKeyboardText(text); @@ -1291,25 +1291,23 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara break; case WM_CHAR: - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(data->window)) { /* Characters outside Unicode Basic Multilingual Plane (BMP) * are coded as so called "surrogate pair" in two separate UTF-16 character events. * Cache high surrogate until next character event. */ if (IS_HIGH_SURROGATE(wParam)) { data->high_surrogate = (WCHAR)wParam; } else { - if (SDL_TextInputActive()) { - WCHAR utf16[3]; + WCHAR utf16[3]; - utf16[0] = data->high_surrogate ? data->high_surrogate : (WCHAR)wParam; - utf16[1] = data->high_surrogate ? (WCHAR)wParam : L'\0'; - utf16[2] = L'\0'; + utf16[0] = data->high_surrogate ? data->high_surrogate : (WCHAR)wParam; + utf16[1] = data->high_surrogate ? (WCHAR)wParam : L'\0'; + utf16[2] = L'\0'; - char utf8[5]; - int result = WIN_WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, utf16, -1, utf8, sizeof(utf8), NULL, NULL); - if (result > 0) { - SDL_SendKeyboardText(utf8); - } + char utf8[5]; + int result = WIN_WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, utf16, -1, utf8, sizeof(utf8), NULL, NULL); + if (result > 0) { + SDL_SendKeyboardText(utf8); } data->high_surrogate = L'\0'; } diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index a2206ea5a8eb9..61dfe9da394c6 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -34,6 +34,7 @@ static int IME_Init(SDL_VideoData *videodata, HWND hwnd); static void IME_Enable(SDL_VideoData *videodata, HWND hwnd); static void IME_Disable(SDL_VideoData *videodata, HWND hwnd); +static void IME_SetTextInputRect(SDL_VideoData *videodata, const SDL_Rect *rect); static void IME_Quit(SDL_VideoData *videodata); #endif /* !SDL_DISABLE_WINDOWS_IME */ @@ -190,9 +191,9 @@ void WIN_UpdateKeymap(SDL_bool send_event) void WIN_QuitKeyboard(SDL_VideoDevice *_this) { +#ifndef SDL_DISABLE_WINDOWS_IME SDL_VideoData *data = _this->driverdata; -#ifndef SDL_DISABLE_WINDOWS_IME IME_Quit(data); if (data->ime_composition) { @@ -233,87 +234,53 @@ void WIN_ResetDeadKeys() } } -void WIN_StartTextInput(SDL_VideoDevice *_this) +int WIN_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { -#ifndef SDL_DISABLE_WINDOWS_IME - SDL_Window *window; -#endif - WIN_ResetDeadKeys(); #ifndef SDL_DISABLE_WINDOWS_IME - window = SDL_GetKeyboardFocus(); - if (window) { - HWND hwnd = window->driverdata->hwnd; - SDL_VideoData *videodata = _this->driverdata; - SDL_GetWindowSize(window, &videodata->ime_winwidth, &videodata->ime_winheight); - IME_Init(videodata, hwnd); - IME_Enable(videodata, hwnd); - } + HWND hwnd = window->driverdata->hwnd; + SDL_VideoData *videodata = _this->driverdata; + SDL_GetWindowSize(window, &videodata->ime_winwidth, &videodata->ime_winheight); + IME_Init(videodata, hwnd); + IME_Enable(videodata, hwnd); + + WIN_UpdateTextInputRect(_this, window); #endif /* !SDL_DISABLE_WINDOWS_IME */ + + return 0; } -void WIN_StopTextInput(SDL_VideoDevice *_this) +int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { -#ifndef SDL_DISABLE_WINDOWS_IME - SDL_Window *window; -#endif - WIN_ResetDeadKeys(); #ifndef SDL_DISABLE_WINDOWS_IME - window = SDL_GetKeyboardFocus(); - if (window) { - HWND hwnd = window->driverdata->hwnd; - SDL_VideoData *videodata = _this->driverdata; - IME_Init(videodata, hwnd); - IME_Disable(videodata, hwnd); - } + HWND hwnd = window->driverdata->hwnd; + SDL_VideoData *videodata = _this->driverdata; + IME_Init(videodata, hwnd); + IME_Disable(videodata, hwnd); #endif /* !SDL_DISABLE_WINDOWS_IME */ + + return 0; } -int WIN_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) +int WIN_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; - HIMC himc = 0; - #ifndef SDL_DISABLE_WINDOWS_IME - videodata->ime_rect = *rect; - - himc = ImmGetContext(videodata->ime_hwnd_current); - if (himc) { - COMPOSITIONFORM cof; - CANDIDATEFORM caf; - - cof.dwStyle = CFS_RECT; - cof.ptCurrentPos.x = videodata->ime_rect.x; - cof.ptCurrentPos.y = videodata->ime_rect.y; - cof.rcArea.left = videodata->ime_rect.x; - cof.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; - cof.rcArea.top = videodata->ime_rect.y; - cof.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; - ImmSetCompositionWindow(himc, &cof); - - caf.dwIndex = 0; - caf.dwStyle = CFS_EXCLUDE; - caf.ptCurrentPos.x = videodata->ime_rect.x; - caf.ptCurrentPos.y = videodata->ime_rect.y; - caf.rcArea.left = videodata->ime_rect.x; - caf.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; - caf.rcArea.top = videodata->ime_rect.y; - caf.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; - ImmSetCandidateWindow(himc, &caf); + SDL_VideoData *data = _this->driverdata; - ImmReleaseContext(videodata->ime_hwnd_current, himc); - } + IME_SetTextInputRect(data, &window->text_input_rect); #endif /* !SDL_DISABLE_WINDOWS_IME */ + return 0; } #ifdef SDL_DISABLE_WINDOWS_IME -void WIN_ClearComposition(SDL_VideoDevice *_this) +int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) { + return 0; } SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) @@ -758,6 +725,41 @@ static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd) } } } + IME_SetTextInputRect(videodata, &videodata->ime_rect); +} + +static void IME_SetTextInputRect(SDL_VideoData *videodata, const SDL_Rect *rect) +{ + HIMC himc = 0; + + videodata->ime_rect = *rect; + + himc = ImmGetContext(videodata->ime_hwnd_current); + if (himc) { + COMPOSITIONFORM cof; + CANDIDATEFORM caf; + + cof.dwStyle = CFS_RECT; + cof.ptCurrentPos.x = videodata->ime_rect.x; + cof.ptCurrentPos.y = videodata->ime_rect.y; + cof.rcArea.left = videodata->ime_rect.x; + cof.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; + cof.rcArea.top = videodata->ime_rect.y; + cof.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; + ImmSetCompositionWindow(himc, &cof); + + caf.dwIndex = 0; + caf.dwStyle = CFS_EXCLUDE; + caf.ptCurrentPos.x = videodata->ime_rect.x; + caf.ptCurrentPos.y = videodata->ime_rect.y; + caf.rcArea.left = videodata->ime_rect.x; + caf.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; + caf.rcArea.top = videodata->ime_rect.y; + caf.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; + ImmSetCandidateWindow(himc, &caf); + + ImmReleaseContext(videodata->ime_hwnd_current, himc); + } } static void IME_UpdateInputLocale(SDL_VideoData *videodata) @@ -1742,10 +1744,11 @@ void IME_Present(SDL_VideoData *videodata) /* FIXME: Need to show the IME bitmap */ } -void WIN_ClearComposition(SDL_VideoDevice *_this) +int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; IME_ClearComposition(videodata); + return 0; } #endif /* SDL_DISABLE_WINDOWS_IME */ diff --git a/src/video/windows/SDL_windowskeyboard.h b/src/video/windows/SDL_windowskeyboard.h index 41ce58eb5d8eb..0c614b5488789 100644 --- a/src/video/windows/SDL_windowskeyboard.h +++ b/src/video/windows/SDL_windowskeyboard.h @@ -29,10 +29,10 @@ extern void WIN_QuitKeyboard(SDL_VideoDevice *_this); extern void WIN_ResetDeadKeys(void); -extern void WIN_StartTextInput(SDL_VideoDevice *_this); -extern void WIN_StopTextInput(SDL_VideoDevice *_this); -extern int WIN_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); -extern void WIN_ClearComposition(SDL_VideoDevice *_this); +extern int WIN_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 3130ecfbf6715..889f5e58aba39 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -268,7 +268,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void) #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) device->StartTextInput = WIN_StartTextInput; device->StopTextInput = WIN_StopTextInput; - device->SetTextInputRect = WIN_SetTextInputRect; + device->UpdateTextInputRect = WIN_UpdateTextInputRect; device->ClearComposition = WIN_ClearComposition; device->SetClipboardData = WIN_SetClipboardData; diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp index d5f9a6e832b7d..eece32c6e7153 100644 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/src/video/winrt/SDL_winrtkeyboard.cpp @@ -90,7 +90,7 @@ void WINRT_ProcessCharacterReceivedEvent(SDL_Window *window, Windows::UI::Core:: SDL_WindowData *data = window->driverdata; - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(window)) { /* Characters outside Unicode Basic Multilingual Plane (BMP) * are coded as so called "surrogate pair" in two separate UTF-16 character events. * Cache high surrogate until next character event. */ diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 043db8de53a34..abb75622bc0cb 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -883,7 +883,7 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_ text[0] = '\0'; - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(windowdata->window)) { #if defined(HAVE_IBUS_IBUS_H) || defined(HAVE_FCITX) /* Save the original keycode for dead keys, which are filtered out by the XFilterEvent() call below. @@ -1397,7 +1397,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_MOVED, x, y); #ifdef SDL_USE_IME - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(data->window)) { /* Update IME candidate list position */ SDL_IME_UpdateTextRect(NULL); } @@ -2014,7 +2014,7 @@ int X11_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) X11_DispatchEvent(_this, &xevent); #ifdef SDL_USE_IME - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { SDL_IME_PumpEvents(); } #endif @@ -2074,7 +2074,7 @@ void X11_PumpEvents(SDL_VideoDevice *_this) } #ifdef SDL_USE_IME - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { SDL_IME_PumpEvents(); } #endif diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 543c36e4a866b..2d772449c2def 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -430,44 +430,41 @@ void X11_QuitKeyboard(SDL_VideoDevice *_this) #endif } -static void X11_ResetXIM(SDL_VideoDevice *_this) +static void X11_ResetXIM(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef X_HAVE_UTF8_STRING - SDL_VideoData *videodata = _this->driverdata; - int i; + SDL_WindowData *data = window->driverdata; - if (videodata && videodata->windowlist) { - for (i = 0; i < videodata->numwindows; ++i) { - SDL_WindowData *data = videodata->windowlist[i]; - if (data && data->ic) { - /* Clear any partially entered dead keys */ - char *contents = X11_Xutf8ResetIC(data->ic); - if (contents) { - X11_XFree(contents); - } - } + if (data && data->ic) { + /* Clear any partially entered dead keys */ + char *contents = X11_Xutf8ResetIC(data->ic); + if (contents) { + X11_XFree(contents); } } #endif } -void X11_StartTextInput(SDL_VideoDevice *_this) +int X11_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { - X11_ResetXIM(_this); + X11_ResetXIM(_this, window); + + return X11_UpdateTextInputRect(_this, window); } -void X11_StopTextInput(SDL_VideoDevice *_this) +int X11_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { - X11_ResetXIM(_this); + X11_ResetXIM(_this, window); #ifdef SDL_USE_IME SDL_IME_Reset(); #endif + return 0; } -int X11_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect) +int X11_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_USE_IME - SDL_IME_UpdateTextRect(rect); + SDL_IME_UpdateTextRect(window); #endif return 0; } diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h index 5e0ed2803efb6..7fe7384496c72 100644 --- a/src/video/x11/SDL_x11keyboard.h +++ b/src/video/x11/SDL_x11keyboard.h @@ -26,9 +26,9 @@ extern int X11_InitKeyboard(SDL_VideoDevice *_this); extern void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event); extern void X11_QuitKeyboard(SDL_VideoDevice *_this); -extern void X11_StartTextInput(SDL_VideoDevice *_this); -extern void X11_StopTextInput(SDL_VideoDevice *_this); -extern int X11_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect); +extern int X11_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this); extern void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); extern void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index d417ce9223b17..aba3cfc728129 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -267,7 +267,7 @@ static SDL_VideoDevice *X11_CreateDevice(void) device->HasPrimarySelectionText = X11_HasPrimarySelectionText; device->StartTextInput = X11_StartTextInput; device->StopTextInput = X11_StopTextInput; - device->SetTextInputRect = X11_SetTextInputRect; + device->UpdateTextInputRect = X11_UpdateTextInputRect; device->HasScreenKeyboardSupport = X11_HasScreenKeyboardSupport; device->ShowScreenKeyboard = X11_ShowScreenKeyboard; device->HideScreenKeyboard = X11_HideScreenKeyboard; diff --git a/test/checkkeys.c b/test/checkkeys.c index 4dae90ae43154..f9f03f3e8fbea 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -252,28 +252,34 @@ static void loop(void) SDLTest_TextWindowAddText(textwin, "%s", event.text.text); break; case SDL_EVENT_FINGER_DOWN: - if (SDL_TextInputActive()) { + { + SDL_Window *window = SDL_GetWindowFromID(event.tfinger.windowID); + if (SDL_TextInputActive(window)) { SDL_Log("Stopping text input\n"); - SDL_StopTextInput(); + SDL_StopTextInput(window); } else { SDL_Log("Starting text input\n"); - SDL_StartTextInput(); + SDL_StartTextInput(window); } break; + } case SDL_EVENT_MOUSE_BUTTON_DOWN: + { + SDL_Window *window = SDL_GetWindowFromID(event.button.windowID); /* Left button quits the app, other buttons toggles text input */ if (event.button.button == SDL_BUTTON_LEFT) { done = 1; } else { - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(window)) { SDL_Log("Stopping text input\n"); - SDL_StopTextInput(); + SDL_StopTextInput(window); } else { SDL_Log("Starting text input\n"); - SDL_StartTextInput(); + SDL_StartTextInput(window); } } break; + } case SDL_EVENT_KEYMAP_CHANGED: SDL_Log("Keymap changed!\n"); PrintKeymap(); @@ -356,9 +362,9 @@ int main(int argc, char *argv[]) input_rect.y = h / 4; input_rect.w = w / 2; input_rect.h = h / 2; - SDL_SetTextInputRect(&input_rect); + SDL_SetTextInputRect(state->windows[0], &input_rect); - SDL_StartTextInput(); + SDL_StartTextInput(state->windows[0]); /* Print initial state */ SDL_PumpEvents(); diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c index a596bdd0bba36..881de8f94f243 100644 --- a/test/checkkeysthreads.c +++ b/test/checkkeysthreads.c @@ -186,20 +186,24 @@ static void loop(void) PrintText("INPUT", event.text.text); break; case SDL_EVENT_MOUSE_BUTTON_DOWN: + { + SDL_Window *window = SDL_GetWindowFromID(event.button.windowID); + /* Left button quits the app, other buttons toggles text input */ SDL_Log("mouse button down button: %d (LEFT=%d)\n", event.button.button, SDL_BUTTON_LEFT); if (event.button.button == SDL_BUTTON_LEFT) { done = 1; } else { - if (SDL_TextInputActive()) { + if (SDL_TextInputActive(window)) { SDL_Log("Stopping text input\n"); - SDL_StopTextInput(); + SDL_StopTextInput(window); } else { SDL_Log("Starting text input\n"); - SDL_StartTextInput(); + SDL_StartTextInput(window); } } break; + } case SDL_EVENT_QUIT: done = 1; break; @@ -278,7 +282,7 @@ int main(int argc, char *argv[]) SDL_GL_CreateContext(window); #endif - SDL_StartTextInput(); + SDL_StartTextInput(window); /* Print initial modifier state */ SDL_PumpEvents(); diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index d825db40755e4..d15d170520cd3 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -336,36 +336,38 @@ static int keyboard_getSetModState(void *arg) */ static int keyboard_startStopTextInput(void *arg) { + SDL_Window *window = SDL_GetKeyboardFocus(); + /* Start-Stop */ - SDL_StartTextInput(); + SDL_StartTextInput(window); SDLTest_AssertPass("Call to SDL_StartTextInput()"); - SDL_StopTextInput(); + SDL_StopTextInput(window); SDLTest_AssertPass("Call to SDL_StopTextInput()"); /* Stop-Start */ - SDL_StartTextInput(); + SDL_StartTextInput(window); SDLTest_AssertPass("Call to SDL_StartTextInput()"); /* Start-Start */ - SDL_StartTextInput(); + SDL_StartTextInput(window); SDLTest_AssertPass("Call to SDL_StartTextInput()"); /* Stop-Stop */ - SDL_StopTextInput(); + SDL_StopTextInput(window); SDLTest_AssertPass("Call to SDL_StopTextInput()"); - SDL_StopTextInput(); + SDL_StopTextInput(window); SDLTest_AssertPass("Call to SDL_StopTextInput()"); return TEST_COMPLETED; } /* Internal function to test SDL_SetTextInputRect */ -static void testSetTextInputRect(SDL_Rect refRect) +static void testSetTextInputRect(SDL_Window *window, SDL_Rect refRect) { SDL_Rect testRect; testRect = refRect; - SDL_SetTextInputRect(&testRect); + SDL_SetTextInputRect(window, &testRect); SDLTest_AssertPass("Call to SDL_SetTextInputRect with refRect(x:%d,y:%d,w:%d,h:%d)", refRect.x, refRect.y, refRect.w, refRect.h); SDLTest_AssertCheck( (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h), @@ -381,6 +383,7 @@ static void testSetTextInputRect(SDL_Rect refRect) */ static int keyboard_setTextInputRect(void *arg) { + SDL_Window *window = SDL_GetKeyboardFocus(); SDL_Rect refRect; /* Normal visible refRect, origin inside */ @@ -388,66 +391,66 @@ static int keyboard_setTextInputRect(void *arg) refRect.y = SDLTest_RandomIntegerInRange(1, 50); refRect.w = SDLTest_RandomIntegerInRange(10, 50); refRect.h = SDLTest_RandomIntegerInRange(10, 50); - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* Normal visible refRect, origin 0,0 */ refRect.x = 0; refRect.y = 0; refRect.w = SDLTest_RandomIntegerInRange(10, 50); refRect.h = SDLTest_RandomIntegerInRange(10, 50); - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* 1Pixel refRect */ refRect.x = SDLTest_RandomIntegerInRange(10, 50); refRect.y = SDLTest_RandomIntegerInRange(10, 50); refRect.w = 1; refRect.h = 1; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* 0pixel refRect */ refRect.x = 1; refRect.y = 1; refRect.w = 1; refRect.h = 0; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* 0pixel refRect */ refRect.x = 1; refRect.y = 1; refRect.w = 0; refRect.h = 1; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* 0pixel refRect */ refRect.x = 1; refRect.y = 1; refRect.w = 0; refRect.h = 0; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* 0pixel refRect */ refRect.x = 0; refRect.y = 0; refRect.w = 0; refRect.h = 0; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* negative refRect */ refRect.x = SDLTest_RandomIntegerInRange(-200, -100); refRect.y = SDLTest_RandomIntegerInRange(-200, -100); refRect.w = 50; refRect.h = 50; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* oversized refRect */ refRect.x = SDLTest_RandomIntegerInRange(1, 50); refRect.y = SDLTest_RandomIntegerInRange(1, 50); refRect.w = 5000; refRect.h = 5000; - testSetTextInputRect(refRect); + testSetTextInputRect(window, refRect); /* NULL refRect */ - SDL_SetTextInputRect(NULL); + SDL_SetTextInputRect(window, NULL); SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); return TEST_COMPLETED; @@ -470,7 +473,7 @@ static int keyboard_setTextInputRectNegative(void *arg) #endif /* NULL refRect */ - SDL_SetTextInputRect(NULL); + SDL_SetTextInputRect(SDL_GetKeyboardFocus(), NULL); SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); /* Some platforms set also an error message; so check it */ diff --git a/test/testime.c b/test/testime.c index dcf38ba00d32b..9e7a9a38025ac 100644 --- a/test/testime.c +++ b/test/testime.c @@ -440,12 +440,12 @@ static void InitInput(void) markedRect = textRect; markedText[0] = 0; - SDL_StartTextInput(); + SDL_StartTextInput(state->windows[0]); } static void CleanupVideo(void) { - SDL_StopTextInput(); + SDL_StopTextInput(state->windows[0]); #ifdef HAVE_SDL_TTF TTF_CloseFont(font); TTF_Quit(); @@ -507,10 +507,10 @@ static void _Redraw(int rendererID) markedRect.w = textRect.w - drawnTextRect.w; if (markedRect.w < 0) { /* Stop text input because we cannot hold any more characters */ - SDL_StopTextInput(); + SDL_StopTextInput(state->windows[0]); return; } else { - SDL_StartTextInput(); + SDL_StartTextInput(state->windows[0]); } cursorRect = drawnTextRect; @@ -602,7 +602,7 @@ static void _Redraw(int rendererID) inputrect.y = (int)markedRect.y; inputrect.w = (int)markedRect.w; inputrect.h = (int)markedRect.h; - SDL_SetTextInputRect(&inputrect); + SDL_SetTextInputRect(state->windows[0], &inputrect); } } From 505badb7af66171e9e331a855d4609a4a6dca393 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 05:58:26 -0700 Subject: [PATCH 035/431] checkkeys: added support for multiple windows --- test/checkkeys.c | 134 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 102 insertions(+), 32 deletions(-) diff --git a/test/checkkeys.c b/test/checkkeys.c index f9f03f3e8fbea..87ae2c5c5d5d6 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -23,10 +23,56 @@ #include #endif +#define TEXT_WINDOW_OFFSET_X 2.0f +#define TEXT_WINDOW_OFFSET_Y (2.0f + FONT_LINE_HEIGHT) + static SDLTest_CommonState *state; -static SDLTest_TextWindow *textwin; +static SDLTest_TextWindow **textwindows; +static SDL_bool escape_pressed; static int done; +static SDLTest_TextWindow *GetTextWindowForWindowID(SDL_WindowID id) +{ + int i; + + for (i = 0; i < state->num_windows; ++i) { + if (id == SDL_GetWindowID(state->windows[i])) { + return textwindows[i]; + } + } + return NULL; +} + +static void UpdateTextWindowInputRect(SDL_WindowID id) +{ + int i; + + for (i = 0; i < state->num_windows; ++i) { + if (id == SDL_GetWindowID(state->windows[i])) { + int w, h; + SDL_Rect rect; + int current = textwindows[i]->current; + const char *current_line = textwindows[i]->lines[current]; + + SDL_GetWindowSize(state->windows[i], &w, &h); + + rect.x = (int)TEXT_WINDOW_OFFSET_X; + if (current_line) { + rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; + } + rect.y = (int)TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; +#if 1 + rect.w = FONT_CHARACTER_SIZE; +#else + rect.w = (int)(w - (2 * TEXT_WINDOW_OFFSET_X)); +#endif + rect.h = FONT_LINE_HEIGHT; + SDL_SetTextInputRect(state->windows[i], &rect); + return; + } + } +} + static void print_string(char **text, size_t *maxlen, const char *fmt, ...) { int len; @@ -222,8 +268,6 @@ static void loop(void) { SDL_Event event; int i; - /* Check for events */ - /*SDL_WaitEvent(&event); emscripten does not like waiting*/ while (SDL_PollEvent(&event)) { switch (event.type) { @@ -233,14 +277,26 @@ static void loop(void) if (event.type == SDL_EVENT_KEY_DOWN) { switch (event.key.key) { case SDLK_BACKSPACE: - SDLTest_TextWindowAddText(textwin, "\b"); + SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.key.windowID), "\b"); + UpdateTextWindowInputRect(event.key.windowID); break; case SDLK_RETURN: - SDLTest_TextWindowAddText(textwin, "\n"); + SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.key.windowID), "\n"); + UpdateTextWindowInputRect(event.key.windowID); break; default: break; } + if (event.key.key == SDLK_ESCAPE) { + /* Pressing escape twice will stop the application */ + if (escape_pressed) { + done = 1; + } else { + escape_pressed = SDL_TRUE; + } + } else { + escape_pressed = SDL_TRUE; + } } CountKeysDown(); break; @@ -249,16 +305,17 @@ static void loop(void) break; case SDL_EVENT_TEXT_INPUT: PrintText("INPUT", event.text.text); - SDLTest_TextWindowAddText(textwin, "%s", event.text.text); + SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.text.windowID), "%s", event.text.text); + UpdateTextWindowInputRect(event.text.windowID); break; case SDL_EVENT_FINGER_DOWN: { SDL_Window *window = SDL_GetWindowFromID(event.tfinger.windowID); if (SDL_TextInputActive(window)) { - SDL_Log("Stopping text input\n"); + SDL_Log("Stopping text input for window %" SDL_PRIu32 "\n", event.tfinger.windowID); SDL_StopTextInput(window); } else { - SDL_Log("Starting text input\n"); + SDL_Log("Starting text input for window %" SDL_PRIu32 "\n", event.tfinger.windowID); SDL_StartTextInput(window); } break; @@ -266,17 +323,12 @@ static void loop(void) case SDL_EVENT_MOUSE_BUTTON_DOWN: { SDL_Window *window = SDL_GetWindowFromID(event.button.windowID); - /* Left button quits the app, other buttons toggles text input */ - if (event.button.button == SDL_BUTTON_LEFT) { - done = 1; + if (SDL_TextInputActive(window)) { + SDL_Log("Stopping text input for window %" SDL_PRIu32 "\n", event.button.windowID); + SDL_StopTextInput(window); } else { - if (SDL_TextInputActive(window)) { - SDL_Log("Stopping text input\n"); - SDL_StopTextInput(window); - } else { - SDL_Log("Starting text input\n"); - SDL_StartTextInput(window); - } + SDL_Log("Starting text input for window %" SDL_PRIu32 "\n", event.button.windowID); + SDL_StartTextInput(window); } break; } @@ -293,10 +345,14 @@ static void loop(void) } for (i = 0; i < state->num_windows; i++) { + char caption[1024]; + SDL_SetRenderDrawColor(state->renderers[i], 0, 0, 0, 255); SDL_RenderClear(state->renderers[i]); SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 255, 255); - SDLTest_TextWindowDisplay(textwin, state->renderers[i]); + SDL_snprintf(caption, sizeof(caption), "Text input %s (click mouse button to toggle)\n", SDL_TextInputActive(state->windows[i]) ? "enabled" : "disabled"); + SDLTest_DrawString(state->renderers[i], TEXT_WINDOW_OFFSET_X, TEXT_WINDOW_OFFSET_X, caption); + SDLTest_TextWindowDisplay(textwindows[i], state->renderers[i]); SDL_RenderPresent(state->renderers[i]); } @@ -312,8 +368,7 @@ static void loop(void) int main(int argc, char *argv[]) { - int w, h; - SDL_Rect input_rect; + int i; SDL_SetHint(SDL_HINT_WINDOWS_RAW_KEYBOARD, "1"); @@ -341,12 +396,26 @@ int main(int argc, char *argv[]) return 1; } - SDL_GetWindowSize(state->windows[0], &w, &h); - textwin = SDLTest_TextWindowCreate(0.f, 0.f, (float)w, (float)h); + textwindows = (SDLTest_TextWindow **)SDL_malloc(state->num_windows * sizeof(*textwindows)); + if (!textwindows) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't allocate text windows: %s\n", SDL_GetError()); + goto done; + } + + for (i = 0; i < state->num_windows; ++i) { + int w, h; + SDL_FRect rect; + + SDL_GetWindowSize(state->windows[i], &w, &h); + rect.x = TEXT_WINDOW_OFFSET_X; + rect.y = TEXT_WINDOW_OFFSET_Y; + rect.w = w - (2 * TEXT_WINDOW_OFFSET_X); + rect.h = h - TEXT_WINDOW_OFFSET_Y; + textwindows[i] = SDLTest_TextWindowCreate(rect.x, rect.y, rect.w, rect.h); + } #ifdef SDL_PLATFORM_IOS { - int i; /* Creating the context creates the view, which we need to show keyboard */ for (i = 0; i < state->num_windows; i++) { SDL_GL_CreateContext(state->windows[i]); @@ -357,14 +426,11 @@ int main(int argc, char *argv[]) /* Enable showing IME candidates */ SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1"); - /* Set an input rectangle in the center of the window */ - input_rect.x = w / 4; - input_rect.y = h / 4; - input_rect.w = w / 2; - input_rect.h = h / 2; - SDL_SetTextInputRect(state->windows[0], &input_rect); + for (i = 0; i < state->num_windows; ++i) { + UpdateTextWindowInputRect(SDL_GetWindowID(state->windows[i])); - SDL_StartTextInput(state->windows[0]); + SDL_StartTextInput(state->windows[i]); + } /* Print initial state */ SDL_PumpEvents(); @@ -382,7 +448,11 @@ int main(int argc, char *argv[]) } #endif - SDLTest_TextWindowDestroy(textwin); +done: + for (i = 0; i < state->num_windows; ++i) { + SDLTest_TextWindowDestroy(textwindows[i]); + } + SDL_free(textwindows); SDLTest_CleanupTextDrawing(); SDLTest_CommonQuit(state); return 0; From 138eb8649d90eab07048a56ac405052b16bd32ee Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 07:07:40 -0700 Subject: [PATCH 036/431] checkkeys: draw a blinking cursor --- test/checkkeys.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/checkkeys.c b/test/checkkeys.c index 87ae2c5c5d5d6..c3f084b932846 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -26,9 +26,13 @@ #define TEXT_WINDOW_OFFSET_X 2.0f #define TEXT_WINDOW_OFFSET_Y (2.0f + FONT_LINE_HEIGHT) +#define CURSOR_BLINK_INTERVAL_MS 500 + static SDLTest_CommonState *state; static SDLTest_TextWindow **textwindows; static SDL_bool escape_pressed; +static SDL_bool cursor_visible; +static Uint64 last_cursor_change; static int done; static SDLTest_TextWindow *GetTextWindowForWindowID(SDL_WindowID id) @@ -264,9 +268,28 @@ static void CountKeysDown(void) SDL_Log("Keys down: %d\n", count); } +static void DrawCursor(int i) +{ + SDL_FRect rect; + int current = textwindows[i]->current; + const char *current_line = textwindows[i]->lines[current]; + + rect.x = TEXT_WINDOW_OFFSET_X; + if (current_line) { + rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; + } + rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; + rect.w = FONT_CHARACTER_SIZE * 0.75f; + rect.h = FONT_CHARACTER_SIZE; + + SDL_SetRenderDrawColor(state->renderers[i], 0xAA, 0xAA, 0xAA, 255); + SDL_RenderFillRect(state->renderers[i], &rect); +} + static void loop(void) { SDL_Event event; + Uint64 now; int i; while (SDL_PollEvent(&event)) { @@ -344,15 +367,28 @@ static void loop(void) } } + now = SDL_GetTicks(); for (i = 0; i < state->num_windows; i++) { char caption[1024]; + /* Clear the window */ SDL_SetRenderDrawColor(state->renderers[i], 0, 0, 0, 255); SDL_RenderClear(state->renderers[i]); + + /* Draw the text */ SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 255, 255); SDL_snprintf(caption, sizeof(caption), "Text input %s (click mouse button to toggle)\n", SDL_TextInputActive(state->windows[i]) ? "enabled" : "disabled"); SDLTest_DrawString(state->renderers[i], TEXT_WINDOW_OFFSET_X, TEXT_WINDOW_OFFSET_X, caption); SDLTest_TextWindowDisplay(textwindows[i], state->renderers[i]); + + /* Draw the cursor */ + if ((now - last_cursor_change) >= CURSOR_BLINK_INTERVAL_MS) { + cursor_visible = !cursor_visible; + last_cursor_change = now; + } + if (cursor_visible) { + DrawCursor(i); + } SDL_RenderPresent(state->renderers[i]); } From 20dbe907714730a7d7ab1957beafbfb608e20320 Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Mon, 24 Jun 2024 19:45:37 +0200 Subject: [PATCH 037/431] Fix std::thread memory leak In the stdcpp thread implementation, the allocated std::thread objects were never deleted after joining/detaching --- src/thread/stdcpp/SDL_systhread.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/thread/stdcpp/SDL_systhread.cpp b/src/thread/stdcpp/SDL_systhread.cpp index 06bc933ed98c3..350431f0ede03 100644 --- a/src/thread/stdcpp/SDL_systhread.cpp +++ b/src/thread/stdcpp/SDL_systhread.cpp @@ -121,8 +121,12 @@ SDL_SYS_WaitThread(SDL_Thread *thread) try { std::thread *cpp_thread = (std::thread *)thread->handle; - if (cpp_thread->joinable()) { - cpp_thread->join(); + if (cpp_thread) { + if (cpp_thread->joinable()) { + cpp_thread->join(); + } + delete cpp_thread; + thread->handle = nullptr; } } catch (std::system_error &) { // An error occurred when joining the thread. SDL_WaitThread does not, @@ -140,8 +144,12 @@ SDL_SYS_DetachThread(SDL_Thread *thread) try { std::thread *cpp_thread = (std::thread *)thread->handle; - if (cpp_thread->joinable()) { - cpp_thread->detach(); + if (cpp_thread) { + if (cpp_thread->joinable()) { + cpp_thread->detach(); + } + delete cpp_thread; + thread->handle = nullptr; } } catch (std::system_error &) { // An error occurred when detaching the thread. SDL_DetachThread does not, From 410bed20baaa336d6442e7d93a3e1a25d447b757 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Mon, 24 Jun 2024 18:21:18 +0000 Subject: [PATCH 038/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_keyboard.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 7452461344588..fd44ef2f9d732 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -355,7 +355,9 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); /** * Start accepting Unicode text input events in a window. * - * This function will enable text input (SDL_EVENT_TEXT_INPUT and SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this function paired with SDL_StopTextInput(). + * This function will enable text input (SDL_EVENT_TEXT_INPUT and + * SDL_EVENT_TEXT_EDITING events) in the specified window. Please use this + * function paired with SDL_StopTextInput(). * * Text input events are not received by default. * @@ -388,7 +390,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_TextInputActive(SDL_Window *window); /** * Stop receiving any text input events in a window. * - * If SDL_StartTextInput() showed the screen keyboard, this function will hide it. + * If SDL_StartTextInput() showed the screen keyboard, this function will hide + * it. * * \param window the window to disable text input. * \returns 0 on success or a negative error code on failure; call From 89cdadf7c3364617059ea5298ace6ab3b5a3a20d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 09:39:53 -0700 Subject: [PATCH 039/431] Added SDL_isinf(), SDL_isinff(), SDL_isnan(), and SDL_isnanf() --- CMakeLists.txt | 2 +- VisualC-GDK/SDL/SDL.vcxproj | 4 + VisualC-GDK/SDL/SDL.vcxproj.filters | 4 + VisualC/SDL/SDL.vcxproj | 4 + VisualC/SDL/SDL.vcxproj.filters | 12 +++ Xcode/SDL/SDL.xcodeproj/project.pbxproj | 20 +++++ include/SDL3/SDL_stdinc.h | 56 +++++++++++++ include/build_config/SDL_build_config.h.cmake | 4 + .../build_config/SDL_build_config_android.h | 4 + include/build_config/SDL_build_config_ios.h | 4 + include/build_config/SDL_build_config_macos.h | 4 + .../build_config/SDL_build_config_windows.h | 4 + .../build_config/SDL_build_config_wingdk.h | 4 + include/build_config/SDL_build_config_winrt.h | 4 + include/build_config/SDL_build_config_xbox.h | 4 + src/dynapi/SDL_dynapi.sym | 4 + src/dynapi/SDL_dynapi_overrides.h | 4 + src/dynapi/SDL_dynapi_procs.h | 4 + src/libm/math_libm.h | 36 +++++---- src/libm/math_private.h | 78 ++++++++++--------- src/libm/s_isinf.c | 24 ++++++ src/libm/s_isinff.c | 24 ++++++ src/libm/s_isnan.c | 31 ++++++++ src/libm/s_isnanf.c | 33 ++++++++ src/stdlib/SDL_stdlib.c | 40 ++++++++++ 25 files changed, 359 insertions(+), 53 deletions(-) create mode 100644 src/libm/s_isinf.c create mode 100644 src/libm/s_isinff.c create mode 100644 src/libm/s_isnan.c create mode 100644 src/libm/s_isnanf.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ddb476c841ca..3f5f3d5020a1e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1064,7 +1064,7 @@ if(SDL_LIBC) _Exit exp expf fabs fabsf floor floorf fmod fmodf fopen64 free fseeko fseeko64 getenv - _i64toa index itoa + _i64toa index isinf isinff isnan isnanf itoa log log10 log10f logf lround lroundf _ltoa malloc memcmp memcpy memmove memset modf modff pow powf putenv diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 82a5aaae01495..4c0c080532988 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -724,6 +724,10 @@ + + + + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 91684485f4fa2..5be93eef16972 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -106,6 +106,10 @@ + + + + diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index a9849a3a53957..07f1fa70c4708 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -584,6 +584,10 @@ + + + + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 448bf3e4e49a5..a58186a588515 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -1096,6 +1096,18 @@ libm + + libm + + + libm + + + libm + + + libm + libm diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index 43ebab04d0429..aace663af0e5e 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -450,6 +450,11 @@ F3E5A6EB2AD5E0E600293D83 /* SDL_properties.c in Sources */ = {isa = PBXBuildFile; fileRef = F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */; }; F3E5A6ED2AD5E10800293D83 /* SDL_properties.h in Headers */ = {isa = PBXBuildFile; fileRef = F3E5A6EC2AD5E10800293D83 /* SDL_properties.h */; settings = {ATTRIBUTES = (Public, ); }; }; F3F07D5A269640160074468B /* SDL_hidapi_luna.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F07D59269640160074468B /* SDL_hidapi_luna.c */; }; + F3F528CB2C29E1C300E6CC26 /* s_isnanf.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F528C62C29E1C300E6CC26 /* s_isnanf.c */; }; + F3F528CC2C29E1C300E6CC26 /* s_isinf.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F528C72C29E1C300E6CC26 /* s_isinf.c */; }; + F3F528CD2C29E1C300E6CC26 /* s_isnan.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F528C82C29E1C300E6CC26 /* s_isnan.c */; }; + F3F528CE2C29E1C300E6CC26 /* s_modf.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F528C92C29E1C300E6CC26 /* s_modf.c */; }; + F3F528CF2C29E1C300E6CC26 /* s_isinff.c in Sources */ = {isa = PBXBuildFile; fileRef = F3F528CA2C29E1C300E6CC26 /* s_isinff.c */; }; F3F7D8ED2933074E00816151 /* SDL_audio.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8AA2933074900816151 /* SDL_audio.h */; settings = {ATTRIBUTES = (Public, ); }; }; F3F7D8F12933074E00816151 /* SDL_platform.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8AB2933074900816151 /* SDL_platform.h */; settings = {ATTRIBUTES = (Public, ); }; }; F3F7D8F52933074E00816151 /* SDL_stdinc.h in Headers */ = {isa = PBXBuildFile; fileRef = F3F7D8AC2933074900816151 /* SDL_stdinc.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -994,6 +999,11 @@ F3E5A6EA2AD5E0E600293D83 /* SDL_properties.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_properties.c; sourceTree = ""; }; F3E5A6EC2AD5E10800293D83 /* SDL_properties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_properties.h; path = SDL3/SDL_properties.h; sourceTree = ""; }; F3F07D59269640160074468B /* SDL_hidapi_luna.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_hidapi_luna.c; sourceTree = ""; }; + F3F528C62C29E1C300E6CC26 /* s_isnanf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_isnanf.c; sourceTree = ""; }; + F3F528C72C29E1C300E6CC26 /* s_isinf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_isinf.c; sourceTree = ""; }; + F3F528C82C29E1C300E6CC26 /* s_isnan.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_isnan.c; sourceTree = ""; }; + F3F528C92C29E1C300E6CC26 /* s_modf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_modf.c; sourceTree = ""; }; + F3F528CA2C29E1C300E6CC26 /* s_isinff.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = s_isinff.c; sourceTree = ""; }; F3F7D8AA2933074900816151 /* SDL_audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_audio.h; path = SDL3/SDL_audio.h; sourceTree = ""; }; F3F7D8AB2933074900816151 /* SDL_platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_platform.h; path = SDL3/SDL_platform.h; sourceTree = ""; }; F3F7D8AC2933074900816151 /* SDL_stdinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SDL_stdinc.h; path = SDL3/SDL_stdinc.h; sourceTree = ""; }; @@ -2161,6 +2171,11 @@ A7D8A91323E2514000DCD162 /* s_cos.c */, A7D8A91523E2514000DCD162 /* s_fabs.c */, A7D8A92523E2514000DCD162 /* s_floor.c */, + F3F528C72C29E1C300E6CC26 /* s_isinf.c */, + F3F528CA2C29E1C300E6CC26 /* s_isinff.c */, + F3F528C82C29E1C300E6CC26 /* s_isnan.c */, + F3F528C62C29E1C300E6CC26 /* s_isnanf.c */, + F3F528C92C29E1C300E6CC26 /* s_modf.c */, A7D8A91A23E2514000DCD162 /* s_scalbn.c */, A7D8A91223E2514000DCD162 /* s_sin.c */, A7D8A91E23E2514000DCD162 /* s_tan.c */, @@ -2708,7 +2723,9 @@ F31A92D228D4CB39003BFD6A /* SDL_offscreenopengles.c in Sources */, A1626A3E2617006A003F1973 /* SDL_triangle.c in Sources */, A7D8B3F223E2514300DCD162 /* SDL_thread.c in Sources */, + F3F528CF2C29E1C300E6CC26 /* s_isinff.c in Sources */, A7D8B55D23E2514300DCD162 /* SDL_hidapi_xbox360w.c in Sources */, + F3F528CB2C29E1C300E6CC26 /* s_isnanf.c in Sources */, A7D8A95723E2514000DCD162 /* SDL_atomic.c in Sources */, A75FDBCE23EA380300529352 /* SDL_hidapi_rumble.c in Sources */, A7D8BB2723E2514500DCD162 /* SDL_displayevents.c in Sources */, @@ -2756,6 +2773,7 @@ A7D8BB7B23E2514500DCD162 /* SDL_dropevents.c in Sources */, A7D8BACD23E2514500DCD162 /* e_atan2.c in Sources */, A7D8BA8B23E2514400DCD162 /* s_sin.c in Sources */, + F3F528CE2C29E1C300E6CC26 /* s_modf.c in Sources */, A7D8BBEB23E2574800DCD162 /* SDL_uikitwindow.m in Sources */, F395BF6525633B2400942BFF /* SDL_crc32.c in Sources */, A7D8B5E723E2514300DCD162 /* SDL_power.c in Sources */, @@ -2788,6 +2806,7 @@ A7D8B95023E2514400DCD162 /* SDL_iconv.c in Sources */, F3E5A6EB2AD5E0E600293D83 /* SDL_properties.c in Sources */, A7D8BA9D23E2514400DCD162 /* s_fabs.c in Sources */, + F3F528CC2C29E1C300E6CC26 /* s_isinf.c in Sources */, F395C1B12569C6A000942BFF /* SDL_mfijoystick.m in Sources */, A7D8B99223E2514400DCD162 /* SDL_shaders_metal.metal in Sources */, F3990DF52A787C10000D8759 /* SDL_sysurl.m in Sources */, @@ -2855,6 +2874,7 @@ A7D8AEA623E2514100DCD162 /* SDL_cocoawindow.m in Sources */, A7D8B43A23E2514300DCD162 /* SDL_sysmutex.c in Sources */, A7D8AAB023E2514100DCD162 /* SDL_syshaptic.c in Sources */, + F3F528CD2C29E1C300E6CC26 /* s_isnan.c in Sources */, F3F07D5A269640160074468B /* SDL_hidapi_luna.c in Sources */, A7D8BBD523E2574800DCD162 /* SDL_uikitclipboard.m in Sources */, A7D8B5C923E2514300DCD162 /* SDL_iostreambundlesupport.m in Sources */, diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 418a46cee9454..4544980d0e802 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -2066,6 +2066,62 @@ extern SDL_DECLSPEC double SDLCALL SDL_fmod(double x, double y); */ extern SDL_DECLSPEC float SDLCALL SDL_fmodf(float x, float y); +/** + * Return whether the value is infinity. + * + * \param x double-precision floating point value. + * \returns non-zero if the value is infinity, 0 otherwise. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_isinff + */ +extern SDL_DECLSPEC int SDLCALL SDL_isinf(double x); + +/** + * Return whether the value is infinity. + * + * \param x floating point value. + * \returns non-zero if the value is infinity, 0 otherwise. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_isinf + */ +extern SDL_DECLSPEC int SDLCALL SDL_isinff(float x); + +/** + * Return whether the value is NaN. + * + * \param x double-precision floating point value. + * \returns non-zero if the value is NaN, 0 otherwise. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_isnanf + */ +extern SDL_DECLSPEC int SDLCALL SDL_isnan(double x); + +/** + * Return whether the value is NaN. + * + * \param x floating point value. + * \returns non-zero if the value is NaN, 0 otherwise. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_isnan + */ +extern SDL_DECLSPEC int SDLCALL SDL_isnanf(float x); + /** * Compute the natural logarithm of `x`. * diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake index e12b96b36df6c..69efb8fcadb70 100644 --- a/include/build_config/SDL_build_config.h.cmake +++ b/include/build_config/SDL_build_config.h.cmake @@ -152,6 +152,10 @@ #cmakedefine HAVE_FLOORF 1 #cmakedefine HAVE_FMOD 1 #cmakedefine HAVE_FMODF 1 +#cmakedefine HAVE_ISINF 1 +#cmakedefine HAVE_ISINFF 1 +#cmakedefine HAVE_ISNAN 1 +#cmakedefine HAVE_ISNANF 1 #cmakedefine HAVE_LOG 1 #cmakedefine HAVE_LOGF 1 #cmakedefine HAVE_LOG10 1 diff --git a/include/build_config/SDL_build_config_android.h b/include/build_config/SDL_build_config_android.h index 314e9416c0df4..013bd060eebf5 100644 --- a/include/build_config/SDL_build_config_android.h +++ b/include/build_config/SDL_build_config_android.h @@ -109,6 +109,10 @@ #define HAVE_FLOORF 1 #define HAVE_FMOD 1 #define HAVE_FMODF 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOGF 1 #define HAVE_LOG10 1 diff --git a/include/build_config/SDL_build_config_ios.h b/include/build_config/SDL_build_config_ios.h index b8349930a9ae0..93bf3abea84c3 100644 --- a/include/build_config/SDL_build_config_ios.h +++ b/include/build_config/SDL_build_config_ios.h @@ -101,6 +101,10 @@ #define HAVE_FLOORF 1 #define HAVE_FMOD 1 #define HAVE_FMODF 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOGF 1 #define HAVE_LOG10 1 diff --git a/include/build_config/SDL_build_config_macos.h b/include/build_config/SDL_build_config_macos.h index 597cf8874579a..c5bbc199e96a2 100644 --- a/include/build_config/SDL_build_config_macos.h +++ b/include/build_config/SDL_build_config_macos.h @@ -105,6 +105,10 @@ #define HAVE_FLOORF 1 #define HAVE_FMOD 1 #define HAVE_FMODF 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOGF 1 #define HAVE_LOG10 1 diff --git a/include/build_config/SDL_build_config_windows.h b/include/build_config/SDL_build_config_windows.h index f147afe0c2b13..457b58e00d420 100644 --- a/include/build_config/SDL_build_config_windows.h +++ b/include/build_config/SDL_build_config_windows.h @@ -175,6 +175,10 @@ typedef unsigned int uintptr_t; #define HAVE_FABS 1 #define HAVE_FLOOR 1 #define HAVE_FMOD 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOG10 1 #define HAVE_POW 1 diff --git a/include/build_config/SDL_build_config_wingdk.h b/include/build_config/SDL_build_config_wingdk.h index 2845b0ecc1479..896499060e43f 100644 --- a/include/build_config/SDL_build_config_wingdk.h +++ b/include/build_config/SDL_build_config_wingdk.h @@ -111,6 +111,10 @@ #define HAVE_FABS 1 #define HAVE_FLOOR 1 #define HAVE_FMOD 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOG10 1 #define HAVE_POW 1 diff --git a/include/build_config/SDL_build_config_winrt.h b/include/build_config/SDL_build_config_winrt.h index 1555962b87e8c..7de89bf803b24 100644 --- a/include/build_config/SDL_build_config_winrt.h +++ b/include/build_config/SDL_build_config_winrt.h @@ -123,6 +123,10 @@ #define HAVE_FLOORF 1 #define HAVE_FMOD 1 #define HAVE_FMODF 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOGF 1 #define HAVE_LOG10 1 diff --git a/include/build_config/SDL_build_config_xbox.h b/include/build_config/SDL_build_config_xbox.h index 0ca413132f5a8..80c5d95a3dcb1 100644 --- a/include/build_config/SDL_build_config_xbox.h +++ b/include/build_config/SDL_build_config_xbox.h @@ -110,6 +110,10 @@ #define HAVE_FABS 1 #define HAVE_FLOOR 1 #define HAVE_FMOD 1 +#define HAVE_ISINF 1 +#define HAVE_ISINF_FLOAT_MACRO 1 +#define HAVE_ISNAN 1 +#define HAVE_ISNAN_FLOAT_MACRO 1 #define HAVE_LOG 1 #define HAVE_LOG10 1 #define HAVE_POW 1 diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 070835992ebca..cf0d4ac6a1f9d 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -930,7 +930,11 @@ SDL3_0.0.0 { SDL_iscntrl; SDL_isdigit; SDL_isgraph; + SDL_isinf; + SDL_isinff; SDL_islower; + SDL_isnan; + SDL_isnanf; SDL_isprint; SDL_ispunct; SDL_isspace; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 9b3d0aed2e383..3d0eaf0b7299e 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -955,7 +955,11 @@ #define SDL_iscntrl SDL_iscntrl_REAL #define SDL_isdigit SDL_isdigit_REAL #define SDL_isgraph SDL_isgraph_REAL +#define SDL_isinf SDL_isinf_REAL +#define SDL_isinff SDL_isinff_REAL #define SDL_islower SDL_islower_REAL +#define SDL_isnan SDL_isnan_REAL +#define SDL_isnanf SDL_isnanf_REAL #define SDL_isprint SDL_isprint_REAL #define SDL_ispunct SDL_ispunct_REAL #define SDL_isspace SDL_isspace_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index bc9b6bfe7a307..d2217995faad4 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -964,7 +964,11 @@ SDL_DYNAPI_PROC(int,SDL_isblank,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_iscntrl,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_isdigit,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_isgraph,(int a),(a),return) +SDL_DYNAPI_PROC(int,SDL_isinf,(double a),(a),return) +SDL_DYNAPI_PROC(int,SDL_isinff,(float a),(a),return) SDL_DYNAPI_PROC(int,SDL_islower,(int a),(a),return) +SDL_DYNAPI_PROC(int,SDL_isnan,(double a),(a),return) +SDL_DYNAPI_PROC(int,SDL_isnanf,(float a),(a),return) SDL_DYNAPI_PROC(int,SDL_isprint,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_ispunct,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_isspace,(int a),(a),return) diff --git a/src/libm/math_libm.h b/src/libm/math_libm.h index 1313a075df326..bbe4ce87a3ddf 100644 --- a/src/libm/math_libm.h +++ b/src/libm/math_libm.h @@ -26,21 +26,25 @@ /* Math routines from uClibc: http://www.uclibc.org */ -double SDL_uclibc_atan(double x); -double SDL_uclibc_atan2(double y, double x); -double SDL_uclibc_copysign(double x, double y); -double SDL_uclibc_cos(double x); -double SDL_uclibc_exp(double x); -double SDL_uclibc_fabs(double x); -double SDL_uclibc_floor(double x); -double SDL_uclibc_fmod(double x, double y); -double SDL_uclibc_log(double x); -double SDL_uclibc_log10(double x); -double SDL_uclibc_modf(double x, double *y); -double SDL_uclibc_pow(double x, double y); -double SDL_uclibc_scalbn(double x, int n); -double SDL_uclibc_sin(double x); -double SDL_uclibc_sqrt(double x); -double SDL_uclibc_tan(double x); +extern double SDL_uclibc_atan(double x); +extern double SDL_uclibc_atan2(double y, double x); +extern double SDL_uclibc_copysign(double x, double y); +extern double SDL_uclibc_cos(double x); +extern double SDL_uclibc_exp(double x); +extern double SDL_uclibc_fabs(double x); +extern double SDL_uclibc_floor(double x); +extern double SDL_uclibc_fmod(double x, double y); +extern int SDL_uclibc_isinf(double x); +extern int SDL_uclibc_isinff(float x); +extern int SDL_uclibc_isnan(double x); +extern int SDL_uclibc_isnanf(float x); +extern double SDL_uclibc_log(double x); +extern double SDL_uclibc_log10(double x); +extern double SDL_uclibc_modf(double x, double *y); +extern double SDL_uclibc_pow(double x, double y); +extern double SDL_uclibc_scalbn(double x, int n); +extern double SDL_uclibc_sin(double x); +extern double SDL_uclibc_sqrt(double x); +extern double SDL_uclibc_tan(double x); #endif /* math_libm_h_ */ diff --git a/src/libm/math_private.h b/src/libm/math_private.h index 9beb41027ef13..b7d60e4310719 100644 --- a/src/libm/math_private.h +++ b/src/libm/math_private.h @@ -25,6 +25,7 @@ #define libm_hidden_proto(x) #define libm_hidden_def(x) #define strong_alias(x, y) +#define weak_alias(x, y) #if !defined(SDL_PLATFORM_HAIKU) && !defined(SDL_PLATFORM_PSP) && !defined(SDL_PLATFORM_3DS) && !defined(SDL_PLATFORM_PS2) /* already defined in a system header. */ typedef unsigned int u_int32_t; @@ -38,6 +39,14 @@ typedef unsigned int u_int32_t; #define fabs SDL_uclibc_fabs #define floor SDL_uclibc_floor #define __ieee754_fmod SDL_uclibc_fmod +#undef __isinf +#define __isinf SDL_uclibc_isinf +#undef __isinff +#define __isinff SDL_uclibc_isinff +#undef __isnan +#define __isnan SDL_uclibc_isnan +#undef __isnanf +#define __isnanf SDL_uclibc_isnanf #define __ieee754_log SDL_uclibc_log #define __ieee754_log10 SDL_uclibc_log10 #define modf SDL_uclibc_modf @@ -181,48 +190,45 @@ do { \ } while (0) /* ieee style elementary functions */ -extern double -__ieee754_sqrt(double) - attribute_hidden; - extern double __ieee754_acos(double) attribute_hidden; - extern double __ieee754_acosh(double) attribute_hidden; - extern double __ieee754_log(double) attribute_hidden; - extern double __ieee754_atanh(double) attribute_hidden; - extern double __ieee754_asin(double) attribute_hidden; - extern double __ieee754_atan2(double, double) attribute_hidden; - extern double __ieee754_exp(double) attribute_hidden; - extern double __ieee754_cosh(double) attribute_hidden; - extern double __ieee754_fmod(double, double) attribute_hidden; - extern double __ieee754_pow(double, double) attribute_hidden; - extern double __ieee754_lgamma_r(double, int *) attribute_hidden; - extern double __ieee754_gamma_r(double, int *) attribute_hidden; - extern double __ieee754_lgamma(double) attribute_hidden; - extern double __ieee754_gamma(double) attribute_hidden; - extern double __ieee754_log10(double) attribute_hidden; - extern double __ieee754_sinh(double) attribute_hidden; - extern double __ieee754_hypot(double, double) attribute_hidden; - extern double __ieee754_j0(double) attribute_hidden; - extern double __ieee754_j1(double) attribute_hidden; - extern double __ieee754_y0(double) attribute_hidden; - extern double __ieee754_y1(double) attribute_hidden; - extern double __ieee754_jn(int, double) attribute_hidden; - extern double __ieee754_yn(int, double) attribute_hidden; - extern double __ieee754_remainder(double, double) attribute_hidden; - extern int32_t __ieee754_rem_pio2(double, double *) attribute_hidden; +extern double __ieee754_sqrt(double) attribute_hidden; +extern double __ieee754_acos(double) attribute_hidden; +extern double __ieee754_acosh(double) attribute_hidden; +extern double __ieee754_log(double) attribute_hidden; +extern double __ieee754_atanh(double) attribute_hidden; +extern double __ieee754_asin(double) attribute_hidden; +extern double __ieee754_atan2(double, double) attribute_hidden; +extern double __ieee754_exp(double) attribute_hidden; +extern double __ieee754_cosh(double) attribute_hidden; +extern double __ieee754_fmod(double, double) attribute_hidden; +extern double __ieee754_pow(double, double) attribute_hidden; +extern double __ieee754_lgamma_r(double, int *) attribute_hidden; +extern double __ieee754_gamma_r(double, int *) attribute_hidden; +extern double __ieee754_lgamma(double) attribute_hidden; +extern double __ieee754_gamma(double) attribute_hidden; +extern double __ieee754_log10(double) attribute_hidden; +extern double __ieee754_sinh(double) attribute_hidden; +extern double __ieee754_hypot(double, double) attribute_hidden; +extern double __ieee754_j0(double) attribute_hidden; +extern double __ieee754_j1(double) attribute_hidden; +extern double __ieee754_y0(double) attribute_hidden; +extern double __ieee754_y1(double) attribute_hidden; +extern double __ieee754_jn(int, double) attribute_hidden; +extern double __ieee754_yn(int, double) attribute_hidden; +extern double __ieee754_remainder(double, double) attribute_hidden; +extern int32_t __ieee754_rem_pio2(double, double *) attribute_hidden; #if defined(_SCALB_INT) - extern double __ieee754_scalb(double, int) attribute_hidden; +extern double __ieee754_scalb(double, int) attribute_hidden; #else - extern double __ieee754_scalb(double, double) attribute_hidden; +extern double __ieee754_scalb(double, double) attribute_hidden; #endif /* fdlibm kernel function */ #ifndef _IEEE_LIBM - extern double __kernel_standard(double, double, int) attribute_hidden; +extern double __kernel_standard(double, double, int) attribute_hidden; #endif - extern double __kernel_sin(double, double, int) attribute_hidden; - extern double __kernel_cos(double, double) attribute_hidden; - extern double __kernel_tan(double, double, int) attribute_hidden; - extern int32_t __kernel_rem_pio2(const double *, double *, int, int, const unsigned int, - const int32_t *) attribute_hidden; +extern double __kernel_sin(double, double, int) attribute_hidden; +extern double __kernel_cos(double, double) attribute_hidden; +extern double __kernel_tan(double, double, int) attribute_hidden; +extern int32_t __kernel_rem_pio2(const double *, double *, int, int, const unsigned int, const int32_t *) attribute_hidden; #endif /* _MATH_PRIVATE_H_ */ diff --git a/src/libm/s_isinf.c b/src/libm/s_isinf.c new file mode 100644 index 0000000000000..9486b05903f25 --- /dev/null +++ b/src/libm/s_isinf.c @@ -0,0 +1,24 @@ +#include "SDL_internal.h" +/* + * Written by J.T. Conklin . + * Changed to return -1 for -Inf by Ulrich Drepper . + * Public domain. + */ + +/* + * isinf(x) returns 1 is x is inf, -1 if x is -inf, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +int __isinf(double x) +{ + int32_t hx,lx; + EXTRACT_WORDS(hx,lx,x); + lx |= (hx & 0x7fffffff) ^ 0x7ff00000; + lx |= -lx; + return ~(lx >> 31) & (hx >> 30); +} +libm_hidden_def(__isinf) diff --git a/src/libm/s_isinff.c b/src/libm/s_isinff.c new file mode 100644 index 0000000000000..184c9aa6caf4a --- /dev/null +++ b/src/libm/s_isinff.c @@ -0,0 +1,24 @@ +#include "SDL_internal.h" +/* + * Written by J.T. Conklin . + * Public domain. + */ + +/* + * isinff(x) returns 1 if x is inf, -1 if x is -inf, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +int __isinff (float x) +{ + int32_t ix,t; + GET_FLOAT_WORD(ix,x); + t = ix & 0x7fffffff; + t ^= 0x7f800000; + t |= -t; + return ~(t >> 31) & (ix >> 30); +} +libm_hidden_def(__isinff) diff --git a/src/libm/s_isnan.c b/src/libm/s_isnan.c new file mode 100644 index 0000000000000..4831086adcc45 --- /dev/null +++ b/src/libm/s_isnan.c @@ -0,0 +1,31 @@ +#include "SDL_internal.h" +/* + * ==================================================== + * 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. + * ==================================================== + */ + +/* + * isnan(x) returns 1 is x is nan, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +int __isnan(double x) +{ + int32_t hx,lx; + EXTRACT_WORDS(hx,lx,x); + hx &= 0x7fffffff; + hx |= (u_int32_t)(lx|(-lx))>>31; + hx = 0x7ff00000 - hx; + return (int)(((u_int32_t)hx)>>31); +} +weak_alias(__isnan, isnan) +libm_hidden_def(__isnan) diff --git a/src/libm/s_isnanf.c b/src/libm/s_isnanf.c new file mode 100644 index 0000000000000..1cb308cfa98ca --- /dev/null +++ b/src/libm/s_isnanf.c @@ -0,0 +1,33 @@ +#include "SDL_internal.h" +/* s_isnanf.c -- float version of s_isnan.c. + * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com. + */ + +/* + * ==================================================== + * 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. + * ==================================================== + */ + +/* + * isnanf(x) returns 1 is x is nan, else 0; + * no branching! + */ + +#include "math.h" +#include "math_private.h" + +int __isnanf(float x) +{ + int32_t ix; + GET_FLOAT_WORD(ix,x); + ix &= 0x7fffffff; + ix = 0x7f800000 - ix; + return (int)(((u_int32_t)(ix))>>31); +} +libm_hidden_def(__isnanf) diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c index d655d9dc4ef7d..3a8443735d510 100644 --- a/src/stdlib/SDL_stdlib.c +++ b/src/stdlib/SDL_stdlib.c @@ -272,6 +272,46 @@ float SDL_fmodf(float x, float y) #endif } +SDL_bool SDL_isinf(double x) +{ +#ifdef HAVE_ISINF + return isinf(x); +#else + return SDL_uclibc_isinf(x); +#endif +} + +SDL_bool SDL_isinff(float x) +{ +#ifdef HAVE_ISINF_FLOAT_MACRO + return isinf(x); +#elif defined(HAVE_ISINFF) + return isinff(x); +#else + return SDL_uclibc_isinff(x); +#endif +} + +SDL_bool SDL_isnan(double x) +{ +#ifdef HAVE_ISNAN + return isnan(x); +#else + return SDL_uclibc_isnan(x); +#endif +} + +SDL_bool SDL_isnanf(float x) +{ +#ifdef HAVE_ISNAN_FLOAT_MACRO + return isnan(x); +#elif defined(HAVE_ISNANF) + return isnanf(x); +#else + return SDL_uclibc_isnanf(x); +#endif +} + double SDL_log(double x) { #ifdef HAVE_LOG From d013ac80ef1d2e0cbfc2a461624b92eab84c4a90 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 10:37:20 -0700 Subject: [PATCH 040/431] Don't check for isinf() and friends using CMake These are often macros or defined for only doubles or only floats, so the current detection doesn't meet our needs --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f5f3d5020a1e..7ddb476c841ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1064,7 +1064,7 @@ if(SDL_LIBC) _Exit exp expf fabs fabsf floor floorf fmod fmodf fopen64 free fseeko fseeko64 getenv - _i64toa index isinf isinff isnan isnanf itoa + _i64toa index itoa log log10 log10f logf lround lroundf _ltoa malloc memcmp memcpy memmove memset modf modff pow powf putenv From 96f2f232404ddb175a385fb43bd758d943339dd4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 23 Jun 2024 12:11:33 -0700 Subject: [PATCH 041/431] Simplified SDL random function names and added thread-safe versions --- include/SDL3/SDL_stdinc.h | 98 +++++++++++++++++++++++-------- src/dynapi/SDL_dynapi.sym | 8 ++- src/dynapi/SDL_dynapi_overrides.h | 8 ++- src/dynapi/SDL_dynapi_procs.h | 8 ++- src/stdlib/SDL_random.c | 35 ++++++++--- test/checkkeysthreads.c | 2 +- test/testdraw.c | 20 +++---- test/testffmpeg.c | 8 +-- test/testintersections.c | 20 +++---- test/testnative.c | 8 +-- test/testspriteminimal.c | 8 +-- test/testwaylandcustom.c | 8 +-- 12 files changed, 154 insertions(+), 77 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 4544980d0e802..f4d9c9fa8a239 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1273,16 +1273,20 @@ extern SDL_DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STR * * \since This function is available since SDL 3.0.0. * - * \sa SDL_rand_n - * \sa SDL_rand_float - * \sa SDL_rand_bits + * \sa SDL_rand + * \sa SDL_randf */ extern SDL_DECLSPEC void SDLCALL SDL_srand(Uint64 seed); /** - * Generates 32 pseudo-random bits. + * Generate a pseudo-random number less than n for positive n * - * You likely want to use SDL_rand_n() to get a psuedo-randum number instead. + * The method used is faster and of better quality than `rand() % n`. Odds are + * roughly 99.9% even for n = 1 million. Evenness is better for smaller n, and + * much worse as n gets bigger. + * + * Example: to simulate a d6 use `SDL_rand(6) + 1` The +1 converts 0..5 to + * 1..6 * * If you want reproducible output, be sure to initialize with SDL_srand() * first. @@ -1293,51 +1297,73 @@ extern SDL_DECLSPEC void SDLCALL SDL_srand(Uint64 seed); * libraries available with different characteristics and you should pick one * of those to meet any serious needs. * - * \returns a random value in the range of [0-SDL_MAX_UINT32]. + * \param n the number of possible outcomes. n must be positive. + * \returns a random value in the range of [0 .. n-1]. + * + * \threadsafety All calls should be made from a single thread + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_srand + * \sa SDL_randf + */ +extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand(Sint32 n); + +/** + * Generate a uniform pseudo-random floating point number less than 1.0 + * + * If you want reproducible output, be sure to initialize with SDL_srand() + * first. + * + * There are no guarantees as to the quality of the random sequence produced, + * and this should not be used for security (cryptography, passwords) or where + * money is on the line (loot-boxes, casinos). There are many random number + * libraries available with different characteristics and you should pick one + * of those to meet any serious needs. + * + * \returns a random value in the range of [0.0, 1.0). * * \threadsafety All calls should be made from a single thread * * \since This function is available since SDL 3.0.0. * * \sa SDL_srand - * \sa SDL_rand_n - * \sa SDL_rand_float + * \sa SDL_rand */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits(void); +extern SDL_DECLSPEC float SDLCALL SDL_randf(void); /** - * Generates a pseudo-random number less than n for positive n + * Generate a pseudo-random number less than n for positive n * * The method used is faster and of better quality than `rand() % n`. Odds are * roughly 99.9% even for n = 1 million. Evenness is better for smaller n, and * much worse as n gets bigger. * - * Example: to simulate a d6 use `SDL_rand_n(6) + 1` The +1 converts 0..5 to + * Example: to simulate a d6 use `SDL_rand_r(state, 6) + 1` The +1 converts 0..5 to * 1..6 * - * If you want reproducible output, be sure to initialize with SDL_srand() - * first. - * * There are no guarantees as to the quality of the random sequence produced, * and this should not be used for security (cryptography, passwords) or where * money is on the line (loot-boxes, casinos). There are many random number * libraries available with different characteristics and you should pick one * of those to meet any serious needs. * + * \param state a pointer to the current random number state, this may not be NULL. * \param n the number of possible outcomes. n must be positive. * \returns a random value in the range of [0 .. n-1]. * - * \threadsafety All calls should be made from a single thread + * \threadsafety This function is thread-safe, as long as the state pointer isn't shared between threads. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_srand - * \sa SDL_rand_float + * \sa SDL_rand + * \sa SDL_rand_bits_r + * \sa SDL_randf_r */ -extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand_n(Sint32 n); +extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand_r(Uint64 *state, Sint32 n); /** - * Generates a uniform pseudo-random floating point number less than 1.0 + * Generate a uniform pseudo-random floating point number less than 1.0 * * If you want reproducible output, be sure to initialize with SDL_srand() * first. @@ -1348,16 +1374,42 @@ extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand_n(Sint32 n); * libraries available with different characteristics and you should pick one * of those to meet any serious needs. * + * \param state a pointer to the current random number state, this may not be NULL. * \returns a random value in the range of [0.0, 1.0). * - * \threadsafety All calls should be made from a single thread + * \threadsafety This function is thread-safe, as long as the state pointer isn't shared between threads. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_srand - * \sa SDL_rand_n + * \sa SDL_rand_bits_r + * \sa SDL_rand_r + * \sa SDL_randf + */ +extern SDL_DECLSPEC float SDLCALL SDL_randf_r(Uint64 *state); + +/** + * Generate 32 pseudo-random bits. + * + * You likely want to use SDL_rand_r() to get a psuedo-randum number instead. + * + * There are no guarantees as to the quality of the random sequence produced, + * and this should not be used for security (cryptography, passwords) or where + * money is on the line (loot-boxes, casinos). There are many random number + * libraries available with different characteristics and you should pick one + * of those to meet any serious needs. + * + * \param state a pointer to the current random number state, this may not be NULL. + * \returns a random value in the range of [0-SDL_MAX_UINT32]. + * + * \threadsafety This function is thread-safe, as long as the state pointer isn't shared between threads. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_rand_r + * \sa SDL_randf_r */ -extern SDL_DECLSPEC float SDLCALL SDL_rand_float(void); +extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits_r(Uint64 *state); + #ifndef SDL_PI_D #define SDL_PI_D 3.141592653589793238462643383279502884 /**< pi (double) */ diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index cf0d4ac6a1f9d..261f6c4e5899b 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -961,9 +961,11 @@ SDL3_0.0.0 { SDL_powf; SDL_qsort; SDL_qsort_r; - SDL_rand_bits; - SDL_rand_float; - SDL_rand_n; + SDL_rand; + SDL_rand_bits_r; + SDL_rand_r; + SDL_randf; + SDL_randf_r; SDL_realloc; SDL_round; SDL_roundf; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 3d0eaf0b7299e..e3a1e4c90af3a 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -986,9 +986,11 @@ #define SDL_powf SDL_powf_REAL #define SDL_qsort SDL_qsort_REAL #define SDL_qsort_r SDL_qsort_r_REAL -#define SDL_rand_bits SDL_rand_bits_REAL -#define SDL_rand_float SDL_rand_float_REAL -#define SDL_rand_n SDL_rand_n_REAL +#define SDL_rand SDL_rand_REAL +#define SDL_rand_bits_r SDL_rand_bits_r_REAL +#define SDL_rand_r SDL_rand_r_REAL +#define SDL_randf SDL_randf_REAL +#define SDL_randf_r SDL_randf_r_REAL #define SDL_realloc SDL_realloc_REAL #define SDL_round SDL_round_REAL #define SDL_roundf SDL_roundf_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index d2217995faad4..f3467300052e2 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -995,9 +995,11 @@ SDL_DYNAPI_PROC(double,SDL_pow,(double a, double b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_powf,(float a, float b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_qsort,(void *a, size_t b, size_t c, SDL_CompareCallback d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_qsort_r,(void *a, size_t b, size_t c, SDL_CompareCallback_r d, void *e),(a,b,c,d,e),) -SDL_DYNAPI_PROC(Uint32,SDL_rand_bits,(void),(),return) -SDL_DYNAPI_PROC(float,SDL_rand_float,(void),(),return) -SDL_DYNAPI_PROC(Sint32,SDL_rand_n,(Sint32 a),(a),return) +SDL_DYNAPI_PROC(Sint32,SDL_rand,(Sint32 a),(a),return) +SDL_DYNAPI_PROC(Uint32,SDL_rand_bits_r,(Uint64 *a),(a),return) +SDL_DYNAPI_PROC(Sint32,SDL_rand_r,(Uint64 *a, Sint32 b),(a,b),return) +SDL_DYNAPI_PROC(float,SDL_randf,(void),(),return) +SDL_DYNAPI_PROC(float,SDL_randf_r,(Uint64 *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_realloc,(void *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(double,SDL_round,(double a),(a),return) SDL_DYNAPI_PROC(float,SDL_roundf,(float a),(a),return) diff --git a/src/stdlib/SDL_random.c b/src/stdlib/SDL_random.c index 2007431733b35..1ad0b3ea59212 100644 --- a/src/stdlib/SDL_random.c +++ b/src/stdlib/SDL_random.c @@ -34,12 +34,30 @@ void SDL_srand(Uint64 seed) SDL_rand_initialized = SDL_TRUE; } -Uint32 SDL_rand_bits(void) +Sint32 SDL_rand(Sint32 n) { if (!SDL_rand_initialized) { SDL_srand(0); } + return SDL_rand_r(&SDL_rand_state, n); +} + +float SDL_randf(void) +{ + if (!SDL_rand_initialized) { + SDL_srand(0); + } + + return SDL_randf_r(&SDL_rand_state); +} + +Uint32 SDL_rand_bits_r(Uint64 *state) +{ + if (!state) { + return 0; + } + // The C and A parameters of this LCG have been chosen based on hundreds // of core-hours of testing with PractRand and TestU01's Crush. // Using a 32-bit A improves performance on 32-bit architectures. @@ -55,13 +73,13 @@ Uint32 SDL_rand_bits(void) // Softw Pract Exper. 2022;52(2):443-458. doi: 10.1002/spe.3030 // https://arxiv.org/abs/2001.05304v2 - SDL_rand_state = SDL_rand_state * 0xff1cd035ul + 0x05; + *state = *state * 0xff1cd035ul + 0x05; // Only return top 32 bits because they have a longer period - return (Uint32)(SDL_rand_state >> 32); + return (Uint32)(*state >> 32); } -Sint32 SDL_rand_n(Sint32 n) +Sint32 SDL_rand_r(Uint64 *state, Sint32 n) { // Algorithm: get 32 bits from SDL_rand_bits() and treat it as a 0.32 bit // fixed point number. Multiply by the 31.0 bit n to get a 31.32 bit @@ -70,18 +88,19 @@ Sint32 SDL_rand_n(Sint32 n) if (n < 0) { // The algorithm looks like it works for numbers < 0 but it has an // infintesimal chance of returning a value out of range. - // Returning -SDL_rand_n(abs(n)) blows up at INT_MIN instead. + // Returning -SDL_rand(abs(n)) blows up at INT_MIN instead. // It's easier to just say no. return 0; } // On 32-bit arch, the compiler will optimize to a single 32-bit multiply - Uint64 val = (Uint64)SDL_rand_bits() * n; + Uint64 val = (Uint64)SDL_rand_bits_r(state) * n; return (Sint32)(val >> 32); } -float SDL_rand_float(void) +float SDL_randf_r(Uint64 *state) { // Note: its using 24 bits because float has 23 bits significand + 1 implicit bit - return (SDL_rand_bits() >> (32 - 24)) * 0x1p-24f; + return (SDL_rand_bits_r(state) >> (32 - 24)) * 0x1p-24f; } + diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c index 881de8f94f243..e236b8592503a 100644 --- a/test/checkkeysthreads.c +++ b/test/checkkeysthreads.c @@ -231,7 +231,7 @@ static int SDLCALL ping_thread(void *ptr) sdlevent.type = SDL_EVENT_KEY_DOWN; sdlevent.key.key = SDLK_1; SDL_PushEvent(&sdlevent); - SDL_Delay(1000 + SDL_rand_n(1000)); + SDL_Delay(1000 + SDL_rand(1000)); } return cnt; } diff --git a/test/testdraw.c b/test/testdraw.c index 5622c0e762612..242b49ec82bc5 100644 --- a/test/testdraw.c +++ b/test/testdraw.c @@ -72,8 +72,8 @@ static void DrawPoints(SDL_Renderer *renderer) SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, (Uint8)current_color, (Uint8)current_alpha); - x = (float)SDL_rand_n(viewport.w); - y = (float)SDL_rand_n(viewport.h); + x = (float)SDL_rand(viewport.w); + y = (float)SDL_rand(viewport.h); SDL_RenderPoint(renderer, x, y); } } @@ -120,10 +120,10 @@ static void DrawLines(SDL_Renderer *renderer) SDL_RenderLine(renderer, 0.0f, (float)(viewport.h / 2), (float)(viewport.w - 1), (float)(viewport.h / 2)); SDL_RenderLine(renderer, (float)(viewport.w / 2), 0.0f, (float)(viewport.w / 2), (float)(viewport.h - 1)); } else { - x1 = (float)(SDL_rand_n(viewport.w * 2) - viewport.w); - x2 = (float)(SDL_rand_n(viewport.w * 2) - viewport.w); - y1 = (float)(SDL_rand_n(viewport.h * 2) - viewport.h); - y2 = (float)(SDL_rand_n(viewport.h * 2) - viewport.h); + x1 = (float)(SDL_rand(viewport.w * 2) - viewport.w); + x2 = (float)(SDL_rand(viewport.w * 2) - viewport.w); + y1 = (float)(SDL_rand(viewport.h * 2) - viewport.h); + y2 = (float)(SDL_rand(viewport.h * 2) - viewport.h); SDL_RenderLine(renderer, x1, y1, x2, y2); } } @@ -165,10 +165,10 @@ static void DrawRects(SDL_Renderer *renderer) SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, (Uint8)current_color, (Uint8)current_alpha); - rect.w = (float)SDL_rand_n(viewport.h / 2); - rect.h = (float)SDL_rand_n(viewport.h / 2); - rect.x = (float)((SDL_rand_n(viewport.w * 2) - viewport.w) - (rect.w / 2)); - rect.y = (float)((SDL_rand_n(viewport.h * 2) - viewport.h) - (rect.h / 2)); + rect.w = (float)SDL_rand(viewport.h / 2); + rect.h = (float)SDL_rand(viewport.h / 2); + rect.x = (float)((SDL_rand(viewport.w * 2) - viewport.w) - (rect.w / 2)); + rect.y = (float)((SDL_rand(viewport.h * 2) - viewport.h) - (rect.h / 2)); SDL_RenderFillRect(renderer, &rect); } } diff --git a/test/testffmpeg.c b/test/testffmpeg.c index 1f717d1b77704..3826be652792f 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -1485,15 +1485,15 @@ int main(int argc, char *argv[]) SDL_Rect viewport; SDL_GetRenderViewport(renderer, &viewport); for (i = 0; i < num_sprites; ++i) { - positions[i].x = (float)SDL_rand_n(viewport.w - sprite_w); - positions[i].y = (float)SDL_rand_n(viewport.h - sprite_h); + positions[i].x = (float)SDL_rand(viewport.w - sprite_w); + positions[i].y = (float)SDL_rand(viewport.h - sprite_h); positions[i].w = (float)sprite_w; positions[i].h = (float)sprite_h; velocities[i].x = 0.0f; velocities[i].y = 0.0f; while (velocities[i].x == 0.f || velocities[i].y == 0.f) { - velocities[i].x = (float)(SDL_rand_n(2 + 1) - 1); - velocities[i].y = (float)(SDL_rand_n(2 + 1) - 1); + velocities[i].x = (float)(SDL_rand(2 + 1) - 1); + velocities[i].y = (float)(SDL_rand(2 + 1) - 1); } } diff --git a/test/testintersections.c b/test/testintersections.c index 28c1d0d7a5602..ad16951ccadfb 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -74,8 +74,8 @@ static void DrawPoints(SDL_Renderer *renderer) SDL_SetRenderDrawColor(renderer, 255, (Uint8)current_color, (Uint8)current_color, (Uint8)current_alpha); - x = (float)SDL_rand_n(viewport.w); - y = (float)SDL_rand_n(viewport.h); + x = (float)SDL_rand(viewport.w); + y = (float)SDL_rand(viewport.h); SDL_RenderPoint(renderer, x, y); } } @@ -231,20 +231,20 @@ static void loop(void *arg) break; case SDLK_l: add_line( - (float)SDL_rand_n(640), - (float)SDL_rand_n(480), - (float)SDL_rand_n(640), - (float)SDL_rand_n(480)); + (float)SDL_rand(640), + (float)SDL_rand(480), + (float)SDL_rand(640), + (float)SDL_rand(480)); break; case SDLK_R: num_rects = 0; break; case SDLK_r: add_rect( - (float)SDL_rand_n(640), - (float)SDL_rand_n(480), - (float)SDL_rand_n(640), - (float)SDL_rand_n(480)); + (float)SDL_rand(640), + (float)SDL_rand(480), + (float)SDL_rand(640), + (float)SDL_rand(480)); break; default: break; diff --git a/test/testnative.c b/test/testnative.c index 1df5ebd25e24a..6a0db0757cef1 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -189,15 +189,15 @@ int main(int argc, char *argv[]) quit(2); } for (i = 0; i < NUM_SPRITES; ++i) { - positions[i].x = (float)(SDL_rand_n(window_w - (int)sprite_w)); - positions[i].y = (float)(SDL_rand_n(window_h - (int)sprite_h)); + positions[i].x = (float)(SDL_rand(window_w - (int)sprite_w)); + positions[i].y = (float)(SDL_rand(window_h - (int)sprite_h)); positions[i].w = sprite_w; positions[i].h = sprite_h; velocities[i].x = 0.0f; velocities[i].y = 0.0f; while (velocities[i].x == 0.f && velocities[i].y == 0.f) { - velocities[i].x = (float)(SDL_rand_n(MAX_SPEED * 2 + 1) - MAX_SPEED); - velocities[i].y = (float)(SDL_rand_n(MAX_SPEED * 2 + 1) - MAX_SPEED); + velocities[i].x = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED); + velocities[i].y = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED); } } diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c index a3e2e1c57445f..41704992dece3 100644 --- a/test/testspriteminimal.c +++ b/test/testspriteminimal.c @@ -135,15 +135,15 @@ int main(int argc, char *argv[]) /* Initialize the sprite positions */ for (i = 0; i < NUM_SPRITES; ++i) { - positions[i].x = (float)SDL_rand_n(WINDOW_WIDTH - sprite_w); - positions[i].y = (float)SDL_rand_n(WINDOW_HEIGHT - sprite_h); + positions[i].x = (float)SDL_rand(WINDOW_WIDTH - sprite_w); + positions[i].y = (float)SDL_rand(WINDOW_HEIGHT - sprite_h); positions[i].w = (float)sprite_w; positions[i].h = (float)sprite_h; velocities[i].x = 0.0f; velocities[i].y = 0.0f; while (velocities[i].x == 0.f && velocities[i].y == 0.f) { - velocities[i].x = (float)(SDL_rand_n(MAX_SPEED * 2 + 1) - MAX_SPEED); - velocities[i].y = (float)(SDL_rand_n(MAX_SPEED * 2 + 1) - MAX_SPEED); + velocities[i].x = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED); + velocities[i].y = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED); } } diff --git a/test/testwaylandcustom.c b/test/testwaylandcustom.c index 2703b5faecd5e..38b61f8ff2edb 100644 --- a/test/testwaylandcustom.c +++ b/test/testwaylandcustom.c @@ -97,15 +97,15 @@ static int InitSprites(void) } for (int i = 0; i < NUM_SPRITES; ++i) { - positions[i].x = (float)SDL_rand_n(WINDOW_WIDTH - sprite_w); - positions[i].y = (float)SDL_rand_n(WINDOW_HEIGHT - sprite_h); + positions[i].x = (float)SDL_rand(WINDOW_WIDTH - sprite_w); + positions[i].y = (float)SDL_rand(WINDOW_HEIGHT - sprite_h); positions[i].w = (float)sprite_w; positions[i].h = (float)sprite_h; velocities[i].x = 0.0f; velocities[i].y = 0.0f; while (velocities[i].x == 0.f && velocities[i].y == 0.f) { - velocities[i].x = (float)(SDL_rand_n(MAX_SPEED * 2 + 1) - MAX_SPEED); - velocities[i].y = (float)(SDL_rand_n(MAX_SPEED * 2 + 1) - MAX_SPEED); + velocities[i].x = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED); + velocities[i].y = (float)(SDL_rand(MAX_SPEED * 2 + 1) - MAX_SPEED); } } From a938e2b979f66b9fa35d53ba4eb972dde9c43d10 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 23 Jun 2024 12:42:54 -0700 Subject: [PATCH 042/431] Replaced test framework random code with SDL random functions --- VisualC-GDK/SDL/SDL.vcxproj | 1 - VisualC-GDK/SDL/SDL.vcxproj.filters | 1 - VisualC-GDK/SDL_test/SDL_test.vcxproj | 1 - VisualC-WinRT/testdraw/testdraw.vcxproj | 1 - .../testdraw/testdraw.vcxproj.filters | 3 - VisualC/SDL/SDL.vcxproj | 1 - VisualC/SDL/SDL.vcxproj.filters | 3 - VisualC/SDL_test/SDL_test.vcxproj | 3 +- .../SDLTest/SDLTest.xcodeproj/project.pbxproj | 4 - include/SDL3/SDL_test.h | 1 - include/SDL3/SDL_test_random.h | 112 ------------------ src/test/SDL_test_fuzzer.c | 29 ++--- src/test/SDL_test_harness.c | 6 +- src/test/SDL_test_random.c | 98 --------------- test/testqsort.c | 16 +-- test/testsprite.c | 5 +- 16 files changed, 21 insertions(+), 264 deletions(-) delete mode 100644 include/SDL3/SDL_test_random.h delete mode 100644 src/test/SDL_test_random.c diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 4c0c080532988..bb7c85405bf71 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -375,7 +375,6 @@ - diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 5be93eef16972..2b4f69eb03c67 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -295,7 +295,6 @@ - diff --git a/VisualC-GDK/SDL_test/SDL_test.vcxproj b/VisualC-GDK/SDL_test/SDL_test.vcxproj index 2984a460998f4..2c7ada3ca0148 100644 --- a/VisualC-GDK/SDL_test/SDL_test.vcxproj +++ b/VisualC-GDK/SDL_test/SDL_test.vcxproj @@ -195,7 +195,6 @@ - diff --git a/VisualC-WinRT/testdraw/testdraw.vcxproj b/VisualC-WinRT/testdraw/testdraw.vcxproj index f612acf98b121..eea5a6ccd31eb 100644 --- a/VisualC-WinRT/testdraw/testdraw.vcxproj +++ b/VisualC-WinRT/testdraw/testdraw.vcxproj @@ -294,7 +294,6 @@ - true true diff --git a/VisualC-WinRT/testdraw/testdraw.vcxproj.filters b/VisualC-WinRT/testdraw/testdraw.vcxproj.filters index d41d939d6da7c..2640e2a472ab8 100644 --- a/VisualC-WinRT/testdraw/testdraw.vcxproj.filters +++ b/VisualC-WinRT/testdraw/testdraw.vcxproj.filters @@ -75,9 +75,6 @@ Common - - Common - diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 07f1fa70c4708..87dd7ee8ee27b 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -300,7 +300,6 @@ - diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index a58186a588515..4eb44ad41f30c 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -399,9 +399,6 @@ API Headers - - API Headers - API Headers diff --git a/VisualC/SDL_test/SDL_test.vcxproj b/VisualC/SDL_test/SDL_test.vcxproj index da264650fae17..90b52243ca199 100644 --- a/VisualC/SDL_test/SDL_test.vcxproj +++ b/VisualC/SDL_test/SDL_test.vcxproj @@ -163,9 +163,8 @@ - - \ No newline at end of file + diff --git a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj index c0c1cb8a58600..e40038e4c9931 100644 --- a/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj +++ b/Xcode/SDLTest/SDLTest.xcodeproj/project.pbxproj @@ -116,7 +116,6 @@ DB166D9916A1D1A500A1396C /* SDL_test_harness.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */; }; DB166D9F16A1D1A500A1396C /* SDL_test_log.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9016A1D1A500A1396C /* SDL_test_log.c */; }; DB166DA016A1D1A500A1396C /* SDL_test_md5.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9116A1D1A500A1396C /* SDL_test_md5.c */; }; - DB166DA116A1D1A500A1396C /* SDL_test_random.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166D9216A1D1A500A1396C /* SDL_test_random.c */; }; DB166DD716A1D37800A1396C /* testmessage.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBD16A1C74100A1396C /* testmessage.c */; }; DB166DDB16A1D42F00A1396C /* icon.bmp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 00794E5D09D20839003FC8A1 /* icon.bmp */; }; DB166DF016A1D52500A1396C /* testrelative.c in Sources */ = {isa = PBXBuildFile; fileRef = DB166CBF16A1C74100A1396C /* testrelative.c */; }; @@ -1315,7 +1314,6 @@ DB166D8A16A1D1A500A1396C /* SDL_test_harness.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_harness.c; sourceTree = ""; }; DB166D9016A1D1A500A1396C /* SDL_test_log.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_log.c; sourceTree = ""; }; DB166D9116A1D1A500A1396C /* SDL_test_md5.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_md5.c; sourceTree = ""; }; - DB166D9216A1D1A500A1396C /* SDL_test_random.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_test_random.c; sourceTree = ""; }; DB166DD516A1D36A00A1396C /* testmessage.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testmessage.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB166DEE16A1D50C00A1396C /* testrelative.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrelative.app; sourceTree = BUILT_PRODUCTS_DIR; }; DB166E0516A1D57C00A1396C /* testrendercopyex.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testrendercopyex.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -1935,7 +1933,6 @@ DB166D9016A1D1A500A1396C /* SDL_test_log.c */, DB166D9116A1D1A500A1396C /* SDL_test_md5.c */, AAF02FF41F90089800B9A9FB /* SDL_test_memory.c */, - DB166D9216A1D1A500A1396C /* SDL_test_random.c */, ); name = SDL_Test; path = ../../src/test; @@ -3308,7 +3305,6 @@ DB166D9F16A1D1A500A1396C /* SDL_test_log.c in Sources */, DB166DA016A1D1A500A1396C /* SDL_test_md5.c in Sources */, AAF02FFA1F90092700B9A9FB /* SDL_test_memory.c in Sources */, - DB166DA116A1D1A500A1396C /* SDL_test_random.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/include/SDL3/SDL_test.h b/include/SDL3/SDL_test.h index 634382cf41cdd..e8468739136de 100644 --- a/include/SDL3/SDL_test.h +++ b/include/SDL3/SDL_test.h @@ -41,7 +41,6 @@ #include #include #include -#include #include /* Set up for C function definitions, even when using C++ */ diff --git a/include/SDL3/SDL_test_random.h b/include/SDL3/SDL_test_random.h deleted file mode 100644 index 73088e138fdcc..0000000000000 --- a/include/SDL3/SDL_test_random.h +++ /dev/null @@ -1,112 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/** - * \file SDL_test_random.h - * - * Random number generator related function of SDL test framework. - * - * This code is a part of the SDL test library, not the main SDL library. - */ - -/* - - A "32-bit Multiply with carry random number generator. Very fast. - Includes a list of recommended multipliers. - - multiply-with-carry generator: x(n) = a*x(n-1) + carry mod 2^32. - period: (a*2^31)-1 - -*/ - -#ifndef SDL_test_random_h_ -#define SDL_test_random_h_ - -#include -/* Set up for C function definitions, even when using C++ */ -#ifdef __cplusplus -extern "C" { -#endif - -/* --- Definitions */ - -/* - * Macros that return a random number in a specific format. - */ -#define SDLTest_RandomInt(c) ((int)SDLTest_Random(c)) - -/* - * Context structure for the random number generator state. - */ - typedef struct SDLTest_RandomContext { - unsigned int a; - unsigned int x; - unsigned int c; - unsigned int ah; - unsigned int al; - } SDLTest_RandomContext; - - -/* --- Function prototypes */ - -/** - * Initialize random number generator with two integers. - * - * Note: The random sequence of numbers returned by ...Random() is the - * same for the same two integers and has a period of 2^31. - * - * \param rndContext pointer to context structure - * \param xi integer that defines the random sequence - * \param ci integer that defines the random sequence - * - */ - void SDLTest_RandomInit(SDLTest_RandomContext *rndContext, unsigned int xi, unsigned int ci); - -/** - * Initialize random number generator based on current system time. - * - * \param rndContext pointer to context structure - * - */ - void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext); - - -/** - * Initialize random number generator based on current system time. - * - * Note: ...RandomInit() or ...RandomInitTime() must have been called - * before using this function. - * - * \param rndContext pointer to context structure - * - * \returns a random number (32bit unsigned integer) - * - */ - unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext); - - -/* Ends C function definitions when using C++ */ -#ifdef __cplusplus -} -#endif -#include - -#endif /* SDL_test_random_h_ */ diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index 7e45f6c0e603a..73fc07f1e36c6 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -37,7 +37,7 @@ static int fuzzerInvocationCounter = 0; /** * Context for shared random number generator */ -static SDLTest_RandomContext rndContext; +static Uint64 rndContext; /* * Note: doxygen documentation markup for functions is in the header file. @@ -45,10 +45,7 @@ static SDLTest_RandomContext rndContext; void SDLTest_FuzzerInit(Uint64 execKey) { - Uint32 a = (execKey >> 32) & 0x00000000FFFFFFFF; - Uint32 b = execKey & 0x00000000FFFFFFFF; - SDL_memset((void *)&rndContext, 0, sizeof(SDLTest_RandomContext)); - SDLTest_RandomInit(&rndContext, a, b); + rndContext = execKey; fuzzerInvocationCounter = 0; } @@ -61,42 +58,42 @@ Uint8 SDLTest_RandomUint8(void) { fuzzerInvocationCounter++; - return (Uint8)SDLTest_RandomInt(&rndContext) & 0x000000FF; + return (Uint8)SDL_rand_r(&rndContext, SDL_MAX_UINT8 + 1); } Sint8 SDLTest_RandomSint8(void) { fuzzerInvocationCounter++; - return (Sint8)SDLTest_RandomInt(&rndContext) & 0x000000FF; + return (Sint8)SDL_rand_r(&rndContext, SDL_MAX_UINT8 + 1) ; } Uint16 SDLTest_RandomUint16(void) { fuzzerInvocationCounter++; - return (Uint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF; + return (Uint16)SDL_rand_r(&rndContext, SDL_MAX_UINT16 + 1); } Sint16 SDLTest_RandomSint16(void) { fuzzerInvocationCounter++; - return (Sint16)SDLTest_RandomInt(&rndContext) & 0x0000FFFF; + return (Sint16)SDL_rand_r(&rndContext, SDL_MAX_UINT16 + 1); } Sint32 SDLTest_RandomSint32(void) { fuzzerInvocationCounter++; - return (Sint32)SDLTest_RandomInt(&rndContext); + return (Sint32)SDL_rand_bits_r(&rndContext); } Uint32 SDLTest_RandomUint32(void) { fuzzerInvocationCounter++; - return (Uint32)SDLTest_RandomInt(&rndContext); + return (Uint32)SDL_rand_bits_r(&rndContext); } Uint64 SDLTest_RandomUint64(void) @@ -110,8 +107,8 @@ Uint64 SDLTest_RandomUint64(void) fuzzerInvocationCounter++; - value.v32[0] = SDLTest_RandomSint32(); - value.v32[1] = SDLTest_RandomSint32(); + value.v32[0] = SDLTest_RandomUint32(); + value.v32[1] = SDLTest_RandomUint32(); return value.v64; } @@ -127,8 +124,8 @@ Sint64 SDLTest_RandomSint64(void) fuzzerInvocationCounter++; - value.v32[0] = SDLTest_RandomSint32(); - value.v32[1] = SDLTest_RandomSint32(); + value.v32[0] = SDLTest_RandomUint32(); + value.v32[1] = SDLTest_RandomUint32(); return (Sint64)value.v64; } @@ -432,7 +429,7 @@ SDLTest_RandomDouble(void) double s = 1.0; do { s /= UINT_MAX + 1.0; - r += (double)SDLTest_RandomInt(&rndContext) * s; + r += (double)SDLTest_RandomSint32() * s; } while (s > DBL_EPSILON); fuzzerInvocationCounter++; diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index fd46e8f140525..674d125de0df7 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -63,7 +63,7 @@ static Uint32 SDLTest_TestCaseTimeout = 3600; char *SDLTest_GenerateRunSeed(const int length) { char *seed = NULL; - SDLTest_RandomContext randomContext; + Uint64 randomContext = SDL_GetPerformanceCounter(); int counter; /* Sanity check input */ @@ -80,10 +80,8 @@ char *SDLTest_GenerateRunSeed(const int length) } /* Generate a random string of alphanumeric characters */ - SDLTest_RandomInitTime(&randomContext); for (counter = 0; counter < length; counter++) { - unsigned int number = SDLTest_Random(&randomContext); - char ch = (char)(number % (91 - 48)) + 48; + char ch = (char)(SDL_rand_r(&randomContext, (91 - 48) + 1) + 48); if (ch >= 58 && ch <= 64) { ch = 65; } diff --git a/src/test/SDL_test_random.c b/src/test/SDL_test_random.c deleted file mode 100644 index 679ef7ee00d3c..0000000000000 --- a/src/test/SDL_test_random.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -/* - - A portable "32-bit Multiply with carry" random number generator. - - Used by the fuzzer component. - Original source code contributed by A. Schiffler for GSOC project. - -*/ -#include - -#include /* Needed for srand() and rand() */ -#include /* Needed for time() */ - -/* Initialize random number generator with two integer variables */ - -void SDLTest_RandomInit(SDLTest_RandomContext *rndContext, unsigned int xi, unsigned int ci) -{ - if (!rndContext) { - return; - } - - /* - * Choose a value for 'a' from this list - * 1791398085 1929682203 1683268614 1965537969 1675393560 - * 1967773755 1517746329 1447497129 1655692410 1606218150 - * 2051013963 1075433238 1557985959 1781943330 1893513180 - * 1631296680 2131995753 2083801278 1873196400 1554115554 - */ - rndContext->a = 1655692410; - rndContext->x = 30903; - rndContext->c = 0; - if (xi != 0) { - rndContext->x = xi; - } - rndContext->c = ci; - rndContext->ah = rndContext->a >> 16; - rndContext->al = rndContext->a & 65535; -} - -/* Initialize random number generator from system time */ - -void SDLTest_RandomInitTime(SDLTest_RandomContext *rndContext) -{ - int a, b; - - if (!rndContext) { - return; - } - - srand((unsigned int)time(NULL)); - a = rand(); - srand((unsigned int)SDL_GetPerformanceCounter()); - b = rand(); - SDLTest_RandomInit(rndContext, a, b); -} - -/* Returns random numbers */ - -unsigned int SDLTest_Random(SDLTest_RandomContext *rndContext) -{ - unsigned int xh, xl; - - if (!rndContext) { - return 0; - } - - xh = rndContext->x >> 16; - xl = rndContext->x & 65535; - rndContext->x = rndContext->x * rndContext->a + rndContext->c; - rndContext->c = - xh * rndContext->ah + ((xh * rndContext->al) >> 16) + - ((xl * rndContext->ah) >> 16); - if (xl * rndContext->al >= (~rndContext->c + 1)) { - rndContext->c++; - } - return rndContext->x; -} diff --git a/test/testqsort.c b/test/testqsort.c index 5fa5db7b8c96a..5b8eb5b2f4c26 100644 --- a/test/testqsort.c +++ b/test/testqsort.c @@ -67,12 +67,10 @@ int main(int argc, char *argv[]) static const int itervals[] = { SDL_arraysize(nums), 12 }; int i; int iteration; - SDLTest_RandomContext rndctx; SDLTest_CommonState *state; + Uint64 seed = 0; int seed_seen = 0; - SDL_zero(rndctx); - /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, 0); if (!state) { @@ -86,7 +84,6 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (!consumed) { if (!seed_seen) { - Uint64 seed = 0; char *endptr = NULL; seed = SDL_strtoull(argv[i], &endptr, 0); @@ -97,11 +94,6 @@ int main(int argc, char *argv[]) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid seed. Use a decimal or hexadecimal number.\n"); return 1; } - if (seed <= ((Uint64)0xffffffff)) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Seed must be equal or greater than 0x100000000.\n"); - return 1; - } - SDLTest_RandomInit(&rndctx, (unsigned int)(seed >> 32), (unsigned int)(seed & 0xffffffff)); } } if (consumed <= 0) { @@ -114,9 +106,9 @@ int main(int argc, char *argv[]) } if (!seed_seen) { - SDLTest_RandomInitTime(&rndctx); + seed = SDL_GetPerformanceCounter(); } - SDL_Log("Using random seed 0x%08x%08x\n", rndctx.x, rndctx.c); + SDL_Log("Using random seed 0x%" SDL_PRIx64 "\n", seed); for (iteration = 0; iteration < SDL_arraysize(itervals); iteration++) { const int arraylen = itervals[iteration]; @@ -138,7 +130,7 @@ int main(int argc, char *argv[]) test_sort("reverse sorted", nums, arraylen); for (i = 0; i < arraylen; i++) { - nums[i] = SDLTest_RandomInt(&rndctx); + nums[i] = SDL_rand_r(&seed, SDL_MAX_SINT32); } test_sort("random sorted", nums, arraylen); } diff --git a/test/testsprite.c b/test/testsprite.c index a9e8888a7dd6c..8fb3531d62ac3 100644 --- a/test/testsprite.c +++ b/test/testsprite.c @@ -11,9 +11,6 @@ */ /* Simple program: Move N sprites around on the screen as fast as possible */ -#include -#include - #define SDL_MAIN_USE_CALLBACKS 1 #include #include @@ -558,7 +555,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) seed = (Uint64)iterations; } else { /* Pseudo-random seed generated from the time */ - seed = (Uint64)time(NULL); + seed = SDL_GetPerformanceCounter(); } SDLTest_FuzzerInit(seed); for (i = 0; i < num_sprites; ++i) { From 2f5b20fcb5f24531ce27784a8c466ba21038562e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 08:28:14 -0700 Subject: [PATCH 043/431] Updated based on feedback from @JKaniarz --- include/SDL3/SDL_stdinc.h | 30 +++++++++++- src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/stdlib/SDL_random.c | 9 ++++ src/test/SDL_test_fuzzer.c | 81 ++++++++++++++++--------------- src/test/SDL_test_harness.c | 9 ++-- test/testqsort.c | 2 +- 8 files changed, 91 insertions(+), 43 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index f4d9c9fa8a239..e4f8ad25042b6 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1274,6 +1274,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_vasprintf(char **strp, SDL_PRINTF_FORMAT_STR * \since This function is available since SDL 3.0.0. * * \sa SDL_rand + * \sa SDL_rand_bits * \sa SDL_randf */ extern SDL_DECLSPEC void SDLCALL SDL_srand(Uint64 seed); @@ -1288,6 +1289,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_srand(Uint64 seed); * Example: to simulate a d6 use `SDL_rand(6) + 1` The +1 converts 0..5 to * 1..6 * + * If you want to generate a pseudo-random number in the full range of Sint32, you should use: (Sint32)SDL_rand_bits() + * * If you want reproducible output, be sure to initialize with SDL_srand() * first. * @@ -1332,6 +1335,29 @@ extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand(Sint32 n); */ extern SDL_DECLSPEC float SDLCALL SDL_randf(void); +/** + * Generate 32 pseudo-random bits. + * + * You likely want to use SDL_rand() to get a psuedo-random number instead. + * + * There are no guarantees as to the quality of the random sequence produced, + * and this should not be used for security (cryptography, passwords) or where + * money is on the line (loot-boxes, casinos). There are many random number + * libraries available with different characteristics and you should pick one + * of those to meet any serious needs. + * + * \returns a random value in the range of [0-SDL_MAX_UINT32]. + * + * \threadsafety All calls should be made from a single thread + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_rand + * \sa SDL_randf + * \sa SDL_srand + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits(void); + /** * Generate a pseudo-random number less than n for positive n * @@ -1342,6 +1368,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_randf(void); * Example: to simulate a d6 use `SDL_rand_r(state, 6) + 1` The +1 converts 0..5 to * 1..6 * + * If you want to generate a pseudo-random number in the full range of Sint32, you should use: (Sint32)SDL_rand_bits_r(state) + * * There are no guarantees as to the quality of the random sequence produced, * and this should not be used for security (cryptography, passwords) or where * money is on the line (loot-boxes, casinos). There are many random number @@ -1390,7 +1418,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_randf_r(Uint64 *state); /** * Generate 32 pseudo-random bits. * - * You likely want to use SDL_rand_r() to get a psuedo-randum number instead. + * You likely want to use SDL_rand_r() to get a psuedo-random number instead. * * There are no guarantees as to the quality of the random sequence produced, * and this should not be used for security (cryptography, passwords) or where diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 261f6c4e5899b..02fe914686724 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -962,6 +962,7 @@ SDL3_0.0.0 { SDL_qsort; SDL_qsort_r; SDL_rand; + SDL_rand_bits; SDL_rand_bits_r; SDL_rand_r; SDL_randf; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index e3a1e4c90af3a..ba1777a3731f7 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -987,6 +987,7 @@ #define SDL_qsort SDL_qsort_REAL #define SDL_qsort_r SDL_qsort_r_REAL #define SDL_rand SDL_rand_REAL +#define SDL_rand_bits SDL_rand_bits_REAL #define SDL_rand_bits_r SDL_rand_bits_r_REAL #define SDL_rand_r SDL_rand_r_REAL #define SDL_randf SDL_randf_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index f3467300052e2..67e62d7b6bf6a 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -996,6 +996,7 @@ SDL_DYNAPI_PROC(float,SDL_powf,(float a, float b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_qsort,(void *a, size_t b, size_t c, SDL_CompareCallback d),(a,b,c,d),) SDL_DYNAPI_PROC(void,SDL_qsort_r,(void *a, size_t b, size_t c, SDL_CompareCallback_r d, void *e),(a,b,c,d,e),) SDL_DYNAPI_PROC(Sint32,SDL_rand,(Sint32 a),(a),return) +SDL_DYNAPI_PROC(Uint32,SDL_rand_bits,(void),(),return) SDL_DYNAPI_PROC(Uint32,SDL_rand_bits_r,(Uint64 *a),(a),return) SDL_DYNAPI_PROC(Sint32,SDL_rand_r,(Uint64 *a, Sint32 b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_randf,(void),(),return) diff --git a/src/stdlib/SDL_random.c b/src/stdlib/SDL_random.c index 1ad0b3ea59212..9295d593ac0d2 100644 --- a/src/stdlib/SDL_random.c +++ b/src/stdlib/SDL_random.c @@ -52,6 +52,15 @@ float SDL_randf(void) return SDL_randf_r(&SDL_rand_state); } +Uint32 SDL_rand_bits(void) +{ + if (!SDL_rand_initialized) { + SDL_srand(0); + } + + return SDL_rand_bits_r(&SDL_rand_state); +} + Uint32 SDL_rand_bits_r(Uint64 *state) { if (!state) { diff --git a/src/test/SDL_test_fuzzer.c b/src/test/SDL_test_fuzzer.c index 73fc07f1e36c6..991e2211f3a67 100644 --- a/src/test/SDL_test_fuzzer.c +++ b/src/test/SDL_test_fuzzer.c @@ -58,42 +58,42 @@ Uint8 SDLTest_RandomUint8(void) { fuzzerInvocationCounter++; - return (Uint8)SDL_rand_r(&rndContext, SDL_MAX_UINT8 + 1); + return (Uint8)(SDL_rand_bits_r(&rndContext) >> 24); } Sint8 SDLTest_RandomSint8(void) { fuzzerInvocationCounter++; - return (Sint8)SDL_rand_r(&rndContext, SDL_MAX_UINT8 + 1) ; + return (Sint8)(SDL_rand_bits_r(&rndContext) >> 24); } Uint16 SDLTest_RandomUint16(void) { fuzzerInvocationCounter++; - return (Uint16)SDL_rand_r(&rndContext, SDL_MAX_UINT16 + 1); + return (Uint16)(SDL_rand_bits_r(&rndContext) >> 16); } Sint16 SDLTest_RandomSint16(void) { fuzzerInvocationCounter++; - return (Sint16)SDL_rand_r(&rndContext, SDL_MAX_UINT16 + 1); + return (Sint16)(SDL_rand_bits_r(&rndContext) >> 16); } -Sint32 SDLTest_RandomSint32(void) +Uint32 SDLTest_RandomUint32(void) { fuzzerInvocationCounter++; - return (Sint32)SDL_rand_bits_r(&rndContext); + return SDL_rand_bits_r(&rndContext); } -Uint32 SDLTest_RandomUint32(void) +Sint32 SDLTest_RandomSint32(void) { fuzzerInvocationCounter++; - return (Uint32)SDL_rand_bits_r(&rndContext); + return (Sint32)SDL_rand_bits_r(&rndContext); } Uint64 SDLTest_RandomUint64(void) @@ -103,7 +103,6 @@ Uint64 SDLTest_RandomUint64(void) Uint64 v64; Uint32 v32[2]; } value; - value.v64 = 0; fuzzerInvocationCounter++; @@ -120,7 +119,6 @@ Sint64 SDLTest_RandomSint64(void) Uint64 v64; Uint32 v32[2]; } value; - value.v64 = 0; fuzzerInvocationCounter++; @@ -130,25 +128,23 @@ Sint64 SDLTest_RandomSint64(void) return (Sint64)value.v64; } -Sint32 SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax) +Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max) { - Sint64 min = pMin; - Sint64 max = pMax; - Sint64 temp; - Sint64 number; + fuzzerInvocationCounter++; + + if (min == max) { + return min; + } - if (pMin > pMax) { - temp = min; + if (min > max) { + Sint32 temp = min; min = max; max = temp; - } else if (pMin == pMax) { - return (Sint32)min; } - number = SDLTest_RandomUint32(); - /* invocation count increment in preceding call */ - - return (Sint32)((number % ((max + 1) - min)) + min); + Sint32 range = (max - min); + SDL_assert(range < SDL_MAX_SINT32); + return min + SDL_rand(range + 1); } /** @@ -408,33 +404,42 @@ Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL float SDLTest_RandomUnitFloat(void) { - return SDLTest_RandomUint32() / (float)UINT_MAX; + return SDL_randf(); } float SDLTest_RandomFloat(void) { - return (float)(SDLTest_RandomUnitDouble() * 2.0 * (double)FLT_MAX - (double)(FLT_MAX)); + union + { + float f; + Uint32 v32; + } value; + + do { + value.v32 = SDLTest_RandomUint32(); + } while (SDL_isnanf(value.f) || SDL_isinff(value.f)); + + return value.f; } -double -SDLTest_RandomUnitDouble(void) +double SDLTest_RandomUnitDouble(void) { - return (double)(SDLTest_RandomUint64() >> 11) * (1.0 / 9007199254740992.0); + return (double)(SDLTest_RandomUint64() >> (64-53)) * 0x1.0p-53; } -double -SDLTest_RandomDouble(void) +double SDLTest_RandomDouble(void) { - double r = 0.0; - double s = 1.0; - do { - s /= UINT_MAX + 1.0; - r += (double)SDLTest_RandomSint32() * s; - } while (s > DBL_EPSILON); + union + { + double d; + Uint64 v64; + } value; - fuzzerInvocationCounter++; + do { + value.v64 = SDLTest_RandomUint64(); + } while (SDL_isnan(value.d) || SDL_isinf(value.d)); - return r; + return value.d; } char *SDLTest_RandomAsciiString(void) diff --git a/src/test/SDL_test_harness.c b/src/test/SDL_test_harness.c index 674d125de0df7..e306e4630d4de 100644 --- a/src/test/SDL_test_harness.c +++ b/src/test/SDL_test_harness.c @@ -81,9 +81,12 @@ char *SDLTest_GenerateRunSeed(const int length) /* Generate a random string of alphanumeric characters */ for (counter = 0; counter < length; counter++) { - char ch = (char)(SDL_rand_r(&randomContext, (91 - 48) + 1) + 48); - if (ch >= 58 && ch <= 64) { - ch = 65; + char ch; + int v = SDL_rand_r(&randomContext, 10 + 26); + if (v < 10) { + ch = (char)('0' + v); + } else { + ch = (char)('A' + v - 10); } seed[counter] = ch; } diff --git a/test/testqsort.c b/test/testqsort.c index 5b8eb5b2f4c26..8ea18c03f1c6f 100644 --- a/test/testqsort.c +++ b/test/testqsort.c @@ -130,7 +130,7 @@ int main(int argc, char *argv[]) test_sort("reverse sorted", nums, arraylen); for (i = 0; i < arraylen; i++) { - nums[i] = SDL_rand_r(&seed, SDL_MAX_SINT32); + nums[i] = SDL_rand_r(&seed, 1000000); } test_sort("random sorted", nums, arraylen); } From 2c745dbd3cd794beacfbd589379da21b1c3cc2f7 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Mon, 24 Jun 2024 18:50:19 +0000 Subject: [PATCH 044/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_stdinc.h | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index e4f8ad25042b6..a45958b2992b8 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1289,7 +1289,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_srand(Uint64 seed); * Example: to simulate a d6 use `SDL_rand(6) + 1` The +1 converts 0..5 to * 1..6 * - * If you want to generate a pseudo-random number in the full range of Sint32, you should use: (Sint32)SDL_rand_bits() + * If you want to generate a pseudo-random number in the full range of Sint32, + * you should use: (Sint32)SDL_rand_bits() * * If you want reproducible output, be sure to initialize with SDL_srand() * first. @@ -1365,10 +1366,11 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits(void); * roughly 99.9% even for n = 1 million. Evenness is better for smaller n, and * much worse as n gets bigger. * - * Example: to simulate a d6 use `SDL_rand_r(state, 6) + 1` The +1 converts 0..5 to - * 1..6 + * Example: to simulate a d6 use `SDL_rand_r(state, 6) + 1` The +1 converts + * 0..5 to 1..6 * - * If you want to generate a pseudo-random number in the full range of Sint32, you should use: (Sint32)SDL_rand_bits_r(state) + * If you want to generate a pseudo-random number in the full range of Sint32, + * you should use: (Sint32)SDL_rand_bits_r(state) * * There are no guarantees as to the quality of the random sequence produced, * and this should not be used for security (cryptography, passwords) or where @@ -1376,11 +1378,13 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits(void); * libraries available with different characteristics and you should pick one * of those to meet any serious needs. * - * \param state a pointer to the current random number state, this may not be NULL. + * \param state a pointer to the current random number state, this may not be + * NULL. * \param n the number of possible outcomes. n must be positive. * \returns a random value in the range of [0 .. n-1]. * - * \threadsafety This function is thread-safe, as long as the state pointer isn't shared between threads. + * \threadsafety This function is thread-safe, as long as the state pointer + * isn't shared between threads. * * \since This function is available since SDL 3.0.0. * @@ -1402,10 +1406,12 @@ extern SDL_DECLSPEC Sint32 SDLCALL SDL_rand_r(Uint64 *state, Sint32 n); * libraries available with different characteristics and you should pick one * of those to meet any serious needs. * - * \param state a pointer to the current random number state, this may not be NULL. + * \param state a pointer to the current random number state, this may not be + * NULL. * \returns a random value in the range of [0.0, 1.0). * - * \threadsafety This function is thread-safe, as long as the state pointer isn't shared between threads. + * \threadsafety This function is thread-safe, as long as the state pointer + * isn't shared between threads. * * \since This function is available since SDL 3.0.0. * @@ -1426,10 +1432,12 @@ extern SDL_DECLSPEC float SDLCALL SDL_randf_r(Uint64 *state); * libraries available with different characteristics and you should pick one * of those to meet any serious needs. * - * \param state a pointer to the current random number state, this may not be NULL. + * \param state a pointer to the current random number state, this may not be + * NULL. * \returns a random value in the range of [0-SDL_MAX_UINT32]. * - * \threadsafety This function is thread-safe, as long as the state pointer isn't shared between threads. + * \threadsafety This function is thread-safe, as long as the state pointer + * isn't shared between threads. * * \since This function is available since SDL 3.0.0. * From 0ff5c054862caebe26e8a3febc366c4098353267 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 12:22:12 -0700 Subject: [PATCH 045/431] Added SDL_GetWindows() --- include/SDL3/SDL_video.h | 14 ++++++++++- src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/video/SDL_video.c | 42 +++++++++++++++++++++++++++++-- test/testautomation_video.c | 8 ++++++ 6 files changed, 64 insertions(+), 3 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 6ff85cf0936dc..5943d9d2b8c76 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -384,7 +384,7 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); /** * Get a list of currently connected displays. * - * \param count a pointer filled in with the number of displays returned. + * \param count a pointer filled in with the number of displays returned, may be NULL. * \returns a 0 terminated array of display instance IDs which should be freed * with SDL_free(), or NULL on error; call SDL_GetError() for more * details. @@ -783,6 +783,18 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, si */ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window); +/** + * Get a list of valid windows. + * + * \param count a pointer filled in with the number of windows returned, may be NULL. + * \returns a 0 terminated array of window pointers which should be freed + * with SDL_free(), or NULL on error; call SDL_GetError() for more + * details. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC SDL_Window **SDLCALL SDL_GetWindows(int *count); + /** * Create a window with the specified dimensions and flags. * diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 02fe914686724..e3bcc9d445873 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -480,6 +480,7 @@ SDL3_0.0.0 { SDL_GetWindowSurface; SDL_GetWindowSurfaceVSync; SDL_GetWindowTitle; + SDL_GetWindows; SDL_GlobDirectory; SDL_GlobStorageDirectory; SDL_HapticEffectSupported; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index ba1777a3731f7..2d71ca64a5b80 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -505,6 +505,7 @@ #define SDL_GetWindowSurface SDL_GetWindowSurface_REAL #define SDL_GetWindowSurfaceVSync SDL_GetWindowSurfaceVSync_REAL #define SDL_GetWindowTitle SDL_GetWindowTitle_REAL +#define SDL_GetWindows SDL_GetWindows_REAL #define SDL_GlobDirectory SDL_GlobDirectory_REAL #define SDL_GlobStorageDirectory SDL_GlobStorageDirectory_REAL #define SDL_HapticEffectSupported SDL_HapticEffectSupported_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 67e62d7b6bf6a..a1528faeba295 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -525,6 +525,7 @@ SDL_DYNAPI_PROC(int,SDL_GetWindowSizeInPixels,(SDL_Window *a, int *b, int *c),(a SDL_DYNAPI_PROC(SDL_Surface*,SDL_GetWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowSurfaceVSync,(SDL_Window *a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetWindowTitle,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(SDL_Window**,SDL_GetWindows,(int *a),(a),return) SDL_DYNAPI_PROC(char**,SDL_GlobDirectory,(const char *a, const char *b, SDL_GlobFlags c, int *d),(a,b,c,d),return) SDL_DYNAPI_PROC(char**,SDL_GlobStorageDirectory,(SDL_Storage *a, const char *b, const char *c, SDL_GlobFlags d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HapticEffectSupported,(SDL_Haptic *a, const SDL_HapticEffect *b),(a,b),return) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 2ffb28ff4576c..37628f086084b 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1999,6 +1999,44 @@ void SDL_ToggleDragAndDropSupport(void) } } +SDL_Window **SDLCALL SDL_GetWindows(int *count) +{ + if (count) { + *count = 0; + } + + if (!_this) { + SDL_UninitializedVideo(); + return NULL; + } + + SDL_Window *window; + int num_added = 0; + int num_windows = 0; + for (window = _this->windows; window; window = window->next) { + ++num_windows; + } + + SDL_Window **windows = SDL_malloc((num_windows + 1) * sizeof(*windows)); + if (!windows) { + return NULL; + } + + for (window = _this->windows; window; window = window->next) { + windows[num_added++] = window; + if (num_added == num_windows) { + // Race condition? Multi-threading not supported, ignore it + break; + } + } + windows[num_added] = NULL; + + if (count) { + *count = num_added; + } + return windows; +} + static void ApplyWindowFlags(SDL_Window *window, SDL_WindowFlags flags) { if (!SDL_WINDOW_IS_POPUP(window)) { @@ -3955,7 +3993,7 @@ SDL_bool SDL_ScreenSaverEnabled(void) int SDL_EnableScreenSaver(void) { if (!_this) { - return 0; + return SDL_UninitializedVideo(); } if (!_this->suspend_screensaver) { return 0; @@ -3971,7 +4009,7 @@ int SDL_EnableScreenSaver(void) int SDL_DisableScreenSaver(void) { if (!_this) { - return 0; + return SDL_UninitializedVideo(); } if (_this->suspend_screensaver) { return 0; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index c98cab7e22616..88ae689f08bcc 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -13,8 +13,10 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) { SDL_Window *window; + SDL_Window **windows; SDL_Event event; int w, h; + int count; SDL_WindowFlags flags; SDL_bool needs_renderer = SDL_FALSE; SDL_bool needs_events_pumped = SDL_FALSE; @@ -28,6 +30,12 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%" SDL_PRIu64 ")", w, h, flags); SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + /* Check the window is available in the window list */ + windows = SDL_GetWindows(&count); + SDLTest_AssertCheck(windows != NULL, "Validate that returned window list is not NULL"); + SDLTest_AssertCheck(windows[0] == window, "Validate that the window is first in the window list"); + SDL_free(windows); + /* Wayland and XWayland windows require that a frame be presented before they are fully mapped and visible onscreen. * This is required for the mouse/keyboard grab tests to pass. */ From ea11c9e0c75b09442c2d2387e866fed2b146ae22 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Mon, 24 Jun 2024 19:23:37 +0000 Subject: [PATCH 046/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_video.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 5943d9d2b8c76..a64ff6431c40e 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -384,7 +384,8 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); /** * Get a list of currently connected displays. * - * \param count a pointer filled in with the number of displays returned, may be NULL. + * \param count a pointer filled in with the number of displays returned, may + * be NULL. * \returns a 0 terminated array of display instance IDs which should be freed * with SDL_free(), or NULL on error; call SDL_GetError() for more * details. @@ -786,9 +787,10 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window); /** * Get a list of valid windows. * - * \param count a pointer filled in with the number of windows returned, may be NULL. - * \returns a 0 terminated array of window pointers which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more + * \param count a pointer filled in with the number of windows returned, may + * be NULL. + * \returns a 0 terminated array of window pointers which should be freed with + * SDL_free(), or NULL on error; call SDL_GetError() for more * details. * * \since This function is available since SDL 3.0.0. From d52ea209165222f2a91e7d71ce9f1787c9b7119c Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 24 Jun 2024 21:47:19 +0200 Subject: [PATCH 047/431] cmake: check for valid isinf/isinff/isnan/isnanf macros --- CMakeLists.txt | 37 +++++++++++++++++++ cmake/PreseedMSVCCache.cmake | 6 +++ include/build_config/SDL_build_config.h.cmake | 2 + 3 files changed, 45 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ddb476c841ca..0472fd8dc7d4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1100,6 +1100,43 @@ if(SDL_LIBC) endforeach() cmake_pop_check_state() + cmake_push_check_state() + if(MSVC) + string(APPEND CMAKE_REQUIRED_FLAGS " -we4244 -WX") # 'conversion' conversion from 'type1' to 'type2', possible loss of data + else() + string(APPEND CMAKE_REQUIRED_FLAGS " -Wfloat-conversion -Werror") + endif() + foreach(math_fn isinf isnan) + string(TOUPPER "${math_fn}" MATH_FN) + check_c_source_compiles(" + #include + int main() { + double d = 3.14159; + return ${math_fn}(d); + } + " LIBC_HAS_${MATH_FN}) + set(HAVE_${MATH_FN} ${LIBC_HAS_${MATH_FN}}) + + check_c_source_compiles(" + #include + int main() { + float f = 3.14159f; + return ${math_fn}(f); + } + " LIBC_${MATH_FN}_HANDLES_FLOAT) + set(HAVE_${MATH_FN}_FLOAT_MACRO ${LIBC_${MATH_FN}_HANDLES_FLOAT}) + + check_c_source_compiles(" + #include + int main() { + float f = 3.14159f; + return ${math_fn}f(f); + } + " LIBC_HAS_${MATH_FN}F) + set(HAVE_${MATH_FN}F "${LIBC_HAS_${MATH_FN}}") + endforeach() + cmake_pop_check_state() + if(NOT WINDOWS) check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE) check_symbol_exists(sigaction "signal.h" HAVE_SIGACTION) diff --git a/cmake/PreseedMSVCCache.cmake b/cmake/PreseedMSVCCache.cmake index 61980f118b4a4..2a52d56baddb5 100644 --- a/cmake/PreseedMSVCCache.cmake +++ b/cmake/PreseedMSVCCache.cmake @@ -55,6 +55,12 @@ function(SDL_Preseed_CMakeCache) set(LIBC_HAS_ICONV_H "" CACHE INTERNAL "Have include iconv.h") set(LIBC_HAS_INDEX "" CACHE INTERNAL "Have symbol index") set(LIBC_HAS_INTTYPES_H "1" CACHE INTERNAL "Have include inttypes.h") + set(LIBC_HAS_ISINF "1" CACHE INTERNAL "Have include isinf(double)") + set(LIBC_ISINF_HANDLES_FLOAT "1" CACHE INTERNAL "Have include isinf(float)") + set(LIBC_HAS_ISINFF "" CACHE INTERNAL "Have include isinff(float)") + set(LIBC_HAS_ISNAN "1" CACHE INTERNAL "Have include isnan(double)") + set(LIBC_ISNAN_HANDLES_FLOAT "1" CACHE INTERNAL "Have include isnan(float)") + set(LIBC_HAS_ISNANF "" CACHE INTERNAL "Have include isnanf(float)") set(LIBC_HAS_ITOA "1" CACHE INTERNAL "Have symbol itoa") set(LIBC_HAS_LIMITS_H "1" CACHE INTERNAL "Have include limits.h") set(LIBC_HAS_LOG "1" CACHE INTERNAL "Have symbol log") diff --git a/include/build_config/SDL_build_config.h.cmake b/include/build_config/SDL_build_config.h.cmake index 69efb8fcadb70..0e63c1d645f29 100644 --- a/include/build_config/SDL_build_config.h.cmake +++ b/include/build_config/SDL_build_config.h.cmake @@ -154,8 +154,10 @@ #cmakedefine HAVE_FMODF 1 #cmakedefine HAVE_ISINF 1 #cmakedefine HAVE_ISINFF 1 +#cmakedefine HAVE_ISINF_FLOAT_MACRO 1 #cmakedefine HAVE_ISNAN 1 #cmakedefine HAVE_ISNANF 1 +#cmakedefine HAVE_ISNAN_FLOAT_MACRO 1 #cmakedefine HAVE_LOG 1 #cmakedefine HAVE_LOGF 1 #cmakedefine HAVE_LOG10 1 From 94ae4e1513937938c883c4f450143573c3d41538 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 13:36:46 -0700 Subject: [PATCH 048/431] Fixed build warnings --- test/checkkeys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/checkkeys.c b/test/checkkeys.c index c3f084b932846..f7e40b7b503a8 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -62,7 +62,7 @@ static void UpdateTextWindowInputRect(SDL_WindowID id) rect.x = (int)TEXT_WINDOW_OFFSET_X; if (current_line) { - rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; + rect.x += (int)SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; } rect.y = (int)TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; #if 1 @@ -280,7 +280,7 @@ static void DrawCursor(int i) } rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; rect.w = FONT_CHARACTER_SIZE * 0.75f; - rect.h = FONT_CHARACTER_SIZE; + rect.h = (float)FONT_CHARACTER_SIZE; SDL_SetRenderDrawColor(state->renderers[i], 0xAA, 0xAA, 0xAA, 255); SDL_RenderFillRect(state->renderers[i], &rect); From f79d0adfc9300173669db646d68a567ed7196508 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Mon, 24 Jun 2024 16:39:20 -0400 Subject: [PATCH 049/431] x11: Avoid excessive keymap reconstruction KeymapNotify events happen on focus events, as well as when the keymap group changes. Query the current group and don't rebuild the keymap if it hasn't changed. Note that some IME changes, such as activating intelligent Japanese or Chinese input methods on Gnome, will only trigger IBus activation, and won't send a keymap or group update as they use the existing layout. --- src/video/x11/SDL_x11events.c | 12 +++++++++++- src/video/x11/SDL_x11keyboard.c | 5 ++--- src/video/x11/SDL_x11video.h | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index abb75622bc0cb..251f6781412ed 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1131,7 +1131,17 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) printf("window %p: KeymapNotify!\n", data); #endif if (SDL_GetKeyboardFocus() != NULL) { - X11_UpdateKeymap(_this, SDL_TRUE); +#ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM + if (videodata->xkb) { + XkbStateRec state; + if (X11_XkbGetState(videodata->display, XkbUseCoreKbd, &state) == Success) { + if (state.group != videodata->xkb_group) { + /* Only rebuild the keymap if the layout has changed. */ + X11_UpdateKeymap(_this, SDL_TRUE); + } + } + } +#endif X11_ReconcileKeyboardState(_this); } } else if (xevent->type == MappingNotify) { diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 2d772449c2def..6f7a6d3e0c362 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -347,7 +347,6 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) int i; SDL_Scancode scancode; SDL_Keymap *keymap; - unsigned char group = 0; keymap = SDL_CreateKeymap(); @@ -357,7 +356,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) X11_XkbGetUpdatedMap(data->display, XkbAllClientInfoMask, data->xkb); if (X11_XkbGetState(data->display, XkbUseCoreKbd, &state) == Success) { - group = state.group; + data->xkb_group = state.group; } } #endif @@ -372,7 +371,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) continue; } - KeySym keysym = X11_KeyCodeToSym(_this, i, group, keymod_masks[m].xkb_mask); + KeySym keysym = X11_KeyCodeToSym(_this, i, data->xkb_group, keymod_masks[m].xkb_mask); /* Note: The default SDL scancode table sets this to right alt instead of AltGr/Mode, so handle it separately. */ if (keysym != XK_ISO_Level3_Shift) { diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 80b5c47997923..f8e567c777cc2 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -125,6 +125,7 @@ struct SDL_VideoData XkbDescPtr xkb; #endif int xkb_event; + unsigned int xkb_group; KeyCode filter_code; Time filter_time; From 8328fdfe0d9bfc7303ed30b2a708ab3e2b6c1c38 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 15:35:32 -0700 Subject: [PATCH 050/431] Don't use raw keyboard input when text input is active This lets IME processing consume key events that shouldn't be passed on to the application --- src/video/windows/SDL_windowsevents.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 4e4f29f16e0c9..533e21cbd77d3 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -724,8 +724,11 @@ static void WIN_HandleRawKeyboardInput(Uint64 timestamp, SDL_VideoData *data, HA } code = windows_scancode_table[index]; } - if (state && !SDL_GetKeyboardFocus()) { - return; + if (state) { + SDL_Window *focus = SDL_GetKeyboardFocus(); + if (!focus || focus->text_input_active) { + return; + } } SDL_SendKeyboardKey(timestamp, keyboardID, rawcode, code, state); @@ -1244,7 +1247,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } } - if (virtual_key || !data->videodata->raw_keyboard_enabled) { + if (virtual_key || !data->videodata->raw_keyboard_enabled || data->window->text_input_active) { SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, rawcode, code, SDL_PRESSED); } } @@ -1265,7 +1268,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &rawcode, &virtual_key); const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); - if (virtual_key || !data->videodata->raw_keyboard_enabled) { + if (virtual_key || !data->videodata->raw_keyboard_enabled || data->window->text_input_active) { if (code == SDL_SCANCODE_PRINTSCREEN && keyboardState[code] == SDL_RELEASED) { SDL_SendKeyboardKey(WIN_GetEventTimestamp(), SDL_GLOBAL_KEYBOARD_ID, rawcode, code, SDL_PRESSED); From 01ae067504c61a46aed2f86e79868553df4bf91d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 17:05:08 -0700 Subject: [PATCH 051/431] checkkeys: print the start/length values of the SDL_EVENT_TEXT_EDITING event --- test/checkkeys.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/checkkeys.c b/test/checkkeys.c index f7e40b7b503a8..7f2f3e9530923 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -291,6 +291,7 @@ static void loop(void) SDL_Event event; Uint64 now; int i; + char line[1024]; while (SDL_PollEvent(&event)) { switch (event.type) { @@ -324,7 +325,8 @@ static void loop(void) CountKeysDown(); break; case SDL_EVENT_TEXT_EDITING: - PrintText("EDIT", event.edit.text); + SDL_snprintf(line, sizeof(line), "EDIT %" SDL_PRIs32 ":%" SDL_PRIs32, event.edit.start, event.edit.length); + PrintText(line, event.edit.text); break; case SDL_EVENT_TEXT_INPUT: PrintText("INPUT", event.text.text); @@ -381,7 +383,7 @@ static void loop(void) SDLTest_DrawString(state->renderers[i], TEXT_WINDOW_OFFSET_X, TEXT_WINDOW_OFFSET_X, caption); SDLTest_TextWindowDisplay(textwindows[i], state->renderers[i]); - /* Draw the cursor */ + /* Draw the cursor */ if ((now - last_cursor_change) >= CURSOR_BLINK_INTERVAL_MS) { cursor_visible = !cursor_visible; last_cursor_change = now; From 377014c430e60403b9db70bd73b99ed86ac25149 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 17:13:56 -0700 Subject: [PATCH 052/431] Added some documentation to the SDL_EVENT_TEXT_EDITING event --- include/SDL3/SDL_events.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index fdde915a0e68a..ecd7cf7fd168d 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -317,6 +317,8 @@ typedef struct SDL_KeyboardEvent /** * Keyboard text editing event structure (event.edit.*) * + * The start cursor is the position, in UTF-8 characters, where new typing will be inserted into the editing text. The length is the number of UTF-8 characters that will be replaced by new typing. + * * The text string follows the SDL_GetStringRule. * * \since This struct is available since SDL 3.0.0. @@ -328,8 +330,8 @@ typedef struct SDL_TextEditingEvent Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_WindowID windowID; /**< The window with keyboard focus, if any */ const char *text; /**< The editing text */ - Sint32 start; /**< The start cursor of selected editing text */ - Sint32 length; /**< The length of selected editing text */ + Sint32 start; /**< The start cursor of selected editing text, or -1 if not set */ + Sint32 length; /**< The length of selected editing text, or -1 if not set */ } SDL_TextEditingEvent; /** From 92b3ce20b1c1eb579cff995e3aad2679093cc058 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 17:27:06 -0700 Subject: [PATCH 053/431] checkkeys: don't toggle text input with the left mouse button This often gets triggered when clicking back and forth between the language bar and the application --- test/checkkeys.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/checkkeys.c b/test/checkkeys.c index 7f2f3e9530923..2270ab6595348 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -346,17 +346,17 @@ static void loop(void) break; } case SDL_EVENT_MOUSE_BUTTON_DOWN: - { - SDL_Window *window = SDL_GetWindowFromID(event.button.windowID); - if (SDL_TextInputActive(window)) { - SDL_Log("Stopping text input for window %" SDL_PRIu32 "\n", event.button.windowID); - SDL_StopTextInput(window); - } else { - SDL_Log("Starting text input for window %" SDL_PRIu32 "\n", event.button.windowID); - SDL_StartTextInput(window); + if (event.button.button == SDL_BUTTON_RIGHT) { + SDL_Window *window = SDL_GetWindowFromID(event.button.windowID); + if (SDL_TextInputActive(window)) { + SDL_Log("Stopping text input for window %" SDL_PRIu32 "\n", event.button.windowID); + SDL_StopTextInput(window); + } else { + SDL_Log("Starting text input for window %" SDL_PRIu32 "\n", event.button.windowID); + SDL_StartTextInput(window); + } } break; - } case SDL_EVENT_KEYMAP_CHANGED: SDL_Log("Keymap changed!\n"); PrintKeymap(); @@ -379,7 +379,7 @@ static void loop(void) /* Draw the text */ SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 255, 255); - SDL_snprintf(caption, sizeof(caption), "Text input %s (click mouse button to toggle)\n", SDL_TextInputActive(state->windows[i]) ? "enabled" : "disabled"); + SDL_snprintf(caption, sizeof(caption), "Text input %s (click right mouse button to toggle)\n", SDL_TextInputActive(state->windows[i]) ? "enabled" : "disabled"); SDLTest_DrawString(state->renderers[i], TEXT_WINDOW_OFFSET_X, TEXT_WINDOW_OFFSET_X, caption); SDLTest_TextWindowDisplay(textwindows[i], state->renderers[i]); From 018ca39c45ee703e991ff35cefa9c005f950284f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 17:41:06 -0700 Subject: [PATCH 054/431] Don't move the cursor to the end of the selected candidate We might have legitimately moved the cursor to the beginning. Fixes https://github.com/libsdl-org/SDL/issues/9761 --- src/video/windows/SDL_windowskeyboard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 61dfe9da394c6..2863fd6d4e218 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -839,6 +839,7 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD videodata->ime_composition[length] = 0; +#if 0 // At least with the Chinese IME, it's possible to move the cursor to the beginning of the selection, see https://github.com/libsdl-org/SDL/issues/9761 for details // Get the correct caret position if we've selected a candidate from the candidate window if (videodata->ime_cursor == 0 && length > 0) { Sint32 start = 0; @@ -871,6 +872,7 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD videodata->ime_cursor = end; } +#endif // 0 } static void IME_SendInputEvent(SDL_VideoData *videodata) From 382494eeda1b6960925498916afdc0258a0a1ebe Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 18:07:49 -0700 Subject: [PATCH 055/431] checkkeys: draw the IME composition text --- test/checkkeys.c | 105 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 92 insertions(+), 13 deletions(-) diff --git a/test/checkkeys.c b/test/checkkeys.c index 2270ab6595348..adaa1cb0ff61d 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -28,35 +28,53 @@ #define CURSOR_BLINK_INTERVAL_MS 500 +typedef struct +{ + SDLTest_TextWindow *textwindow; + char *edit_text; + int edit_cursor; + int edit_length; +} TextWindowState; + static SDLTest_CommonState *state; -static SDLTest_TextWindow **textwindows; +static TextWindowState *windowstates; static SDL_bool escape_pressed; static SDL_bool cursor_visible; static Uint64 last_cursor_change; static int done; -static SDLTest_TextWindow *GetTextWindowForWindowID(SDL_WindowID id) +static TextWindowState *GetTextWindowStateForWindowID(SDL_WindowID id) { int i; for (i = 0; i < state->num_windows; ++i) { if (id == SDL_GetWindowID(state->windows[i])) { - return textwindows[i]; + return &windowstates[i]; } } return NULL; } +static SDLTest_TextWindow *GetTextWindowForWindowID(SDL_WindowID id) +{ + TextWindowState *windowstate = GetTextWindowStateForWindowID(id); + if (windowstate) { + return windowstate->textwindow; + } + return NULL; +} + static void UpdateTextWindowInputRect(SDL_WindowID id) { int i; for (i = 0; i < state->num_windows; ++i) { if (id == SDL_GetWindowID(state->windows[i])) { + SDLTest_TextWindow *textwindow = windowstates[i].textwindow; int w, h; SDL_Rect rect; - int current = textwindows[i]->current; - const char *current_line = textwindows[i]->lines[current]; + int current = textwindow->current; + const char *current_line = textwindow->lines[current]; SDL_GetWindowSize(state->windows[i], &w, &h); @@ -271,13 +289,18 @@ static void CountKeysDown(void) static void DrawCursor(int i) { SDL_FRect rect; - int current = textwindows[i]->current; - const char *current_line = textwindows[i]->lines[current]; + TextWindowState *windowstate = &windowstates[i]; + SDLTest_TextWindow *textwindow = windowstate->textwindow; + int current = textwindow->current; + const char *current_line = textwindow->lines[current]; rect.x = TEXT_WINDOW_OFFSET_X; if (current_line) { rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; } + if (windowstate->edit_cursor > 0) { + rect.x += (float)windowstate->edit_cursor * FONT_CHARACTER_SIZE; + } rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; rect.w = FONT_CHARACTER_SIZE * 0.75f; rect.h = (float)FONT_CHARACTER_SIZE; @@ -286,6 +309,45 @@ static void DrawCursor(int i) SDL_RenderFillRect(state->renderers[i], &rect); } +static void DrawEditText(int i) +{ + SDL_FRect rect; + TextWindowState *windowstate = &windowstates[i]; + SDLTest_TextWindow *textwindow = windowstate->textwindow; + int current = textwindow->current; + const char *current_line = textwindow->lines[current]; + + if (windowstate->edit_text == NULL) { + return; + } + + /* Draw the highlight under the selected text */ + if (windowstate->edit_length > 0) { + rect.x = TEXT_WINDOW_OFFSET_X; + if (current_line) { + rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; + } + if (windowstate->edit_cursor > 0) { + rect.x += (float)windowstate->edit_cursor * FONT_CHARACTER_SIZE; + } + rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; + rect.w = (float)windowstate->edit_length * FONT_CHARACTER_SIZE; + rect.h = (float)FONT_CHARACTER_SIZE; + + SDL_SetRenderDrawColor(state->renderers[i], 0xAA, 0xAA, 0xAA, 255); + SDL_RenderFillRect(state->renderers[i], &rect); + } + + /* Draw the edit text */ + rect.x = TEXT_WINDOW_OFFSET_X; + if (current_line) { + rect.x += SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; + } + rect.y = TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; + SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 0, 255); + SDLTest_DrawString(state->renderers[i], rect.x, rect.y, windowstate->edit_text); +} + static void loop(void) { SDL_Event event; @@ -325,9 +387,22 @@ static void loop(void) CountKeysDown(); break; case SDL_EVENT_TEXT_EDITING: + { + TextWindowState *windowstate = GetTextWindowStateForWindowID(event.edit.windowID); + if (windowstate->edit_text) { + SDL_free(windowstate->edit_text); + windowstate->edit_text = NULL; + } + if (event.edit.text && *event.edit.text) { + windowstate->edit_text = SDL_strdup(event.edit.text); + } + windowstate->edit_cursor = event.edit.start; + windowstate->edit_length = event.edit.length; + SDL_snprintf(line, sizeof(line), "EDIT %" SDL_PRIs32 ":%" SDL_PRIs32, event.edit.start, event.edit.length); PrintText(line, event.edit.text); break; + } case SDL_EVENT_TEXT_INPUT: PrintText("INPUT", event.text.text); SDLTest_TextWindowAddText(GetTextWindowForWindowID(event.text.windowID), "%s", event.text.text); @@ -381,7 +456,7 @@ static void loop(void) SDL_SetRenderDrawColor(state->renderers[i], 255, 255, 255, 255); SDL_snprintf(caption, sizeof(caption), "Text input %s (click right mouse button to toggle)\n", SDL_TextInputActive(state->windows[i]) ? "enabled" : "disabled"); SDLTest_DrawString(state->renderers[i], TEXT_WINDOW_OFFSET_X, TEXT_WINDOW_OFFSET_X, caption); - SDLTest_TextWindowDisplay(textwindows[i], state->renderers[i]); + SDLTest_TextWindowDisplay(windowstates[i].textwindow, state->renderers[i]); /* Draw the cursor */ if ((now - last_cursor_change) >= CURSOR_BLINK_INTERVAL_MS) { @@ -391,6 +466,10 @@ static void loop(void) if (cursor_visible) { DrawCursor(i); } + + /* Draw the composition text */ + DrawEditText(i); + SDL_RenderPresent(state->renderers[i]); } @@ -434,8 +513,8 @@ int main(int argc, char *argv[]) return 1; } - textwindows = (SDLTest_TextWindow **)SDL_malloc(state->num_windows * sizeof(*textwindows)); - if (!textwindows) { + windowstates = (TextWindowState *)SDL_calloc(state->num_windows, sizeof(*windowstates)); + if (!windowstates) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't allocate text windows: %s\n", SDL_GetError()); goto done; } @@ -449,7 +528,7 @@ int main(int argc, char *argv[]) rect.y = TEXT_WINDOW_OFFSET_Y; rect.w = w - (2 * TEXT_WINDOW_OFFSET_X); rect.h = h - TEXT_WINDOW_OFFSET_Y; - textwindows[i] = SDLTest_TextWindowCreate(rect.x, rect.y, rect.w, rect.h); + windowstates[i].textwindow = SDLTest_TextWindowCreate(rect.x, rect.y, rect.w, rect.h); } #ifdef SDL_PLATFORM_IOS @@ -488,9 +567,9 @@ int main(int argc, char *argv[]) done: for (i = 0; i < state->num_windows; ++i) { - SDLTest_TextWindowDestroy(textwindows[i]); + SDLTest_TextWindowDestroy(windowstates[i].textwindow); } - SDL_free(textwindows); + SDL_free(windowstates); SDLTest_CleanupTextDrawing(); SDLTest_CommonQuit(state); return 0; From def7a43a2eaeae2c56e41181ad6b075e189d3740 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 19:32:11 -0700 Subject: [PATCH 056/431] SDL_HINT_IME_SHOW_UI defaults to SDL_TRUE This hint is currently only used on Windows, and this matches the behavior of other platforms. --- include/SDL3/SDL_hints.h | 4 ++-- src/video/windows/SDL_windowskeyboard.c | 2 +- test/checkkeys.c | 3 --- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index c28fc5df5b1ab..3a5e026375502 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -966,8 +966,8 @@ extern "C" { * * The variable can be set to the following values: * - * - "0": Native UI components are not display. (default) - * - "1": Native UI components are displayed. + * - "0": Native UI components are not display. + * - "1": Native UI components are displayed. (default) * * This hint should be set before SDL is initialized. * diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 2863fd6d4e218..cbb29a3d82c9c 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -365,7 +365,7 @@ static void UILess_DisableUIUpdates(SDL_VideoData *videodata); static SDL_bool WIN_ShouldShowNativeUI() { - return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_FALSE); + return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_TRUE); } static int IME_Init(SDL_VideoData *videodata, HWND hwnd) diff --git a/test/checkkeys.c b/test/checkkeys.c index adaa1cb0ff61d..052a7b98d6ad6 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -540,9 +540,6 @@ int main(int argc, char *argv[]) } #endif - /* Enable showing IME candidates */ - SDL_SetHint(SDL_HINT_IME_SHOW_UI, "1"); - for (i = 0; i < state->num_windows; ++i) { UpdateTextWindowInputRect(SDL_GetWindowID(state->windows[i])); From 0804598b5d2919c733c24f8cc471461d5a33f75f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 24 Jun 2024 19:53:04 -0700 Subject: [PATCH 057/431] Added a font glyph for missing characters --- src/test/SDL_test_font.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/test/SDL_test_font.c b/src/test/SDL_test_font.c index 67e2c17ba9603..3c246d3a5b3e3 100644 --- a/src/test/SDL_test_font.c +++ b/src/test/SDL_test_font.c @@ -35,6 +35,8 @@ ; */ +#define NUM_FONT_GLYPHS 257 + static unsigned char SDLTest_FontData[] = { /* @@ -3110,14 +3112,26 @@ static unsigned char SDLTest_FontData[] = { 0x30, /* 00001100 */ 0x1f, /* 11111000 */ + /* + * 256 0x100 - missing character + */ + 0x55, /* 01010101 */ + 0xAA, /* 10101010 */ + 0x55, /* 01010101 */ + 0xAA, /* 10101010 */ + 0x55, /* 01010101 */ + 0xAA, /* 10101010 */ + 0x55, /* 01010101 */ + 0xAA, /* 10101010 */ }; +SDL_COMPILE_TIME_ASSERT(SDLTest_FontDataSize, SDL_arraysize(SDLTest_FontData) == NUM_FONT_GLYPHS * 8); /* ---- Character */ struct SDLTest_CharTextureCache { SDL_Renderer *renderer; - SDL_Texture *charTextureCache[256]; + SDL_Texture *charTextureCache[NUM_FONT_GLYPHS]; struct SDLTest_CharTextureCache *next; }; @@ -3163,6 +3177,9 @@ int SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c) /* Character index in cache */ ci = c; + if (ci >= NUM_FONT_GLYPHS) { + ci = (NUM_FONT_GLYPHS - 1); + } /* Search for this renderer's cache */ for (cache = SDLTest_CharTextureCacheList; cache; cache = cache->next) { @@ -3342,9 +3359,7 @@ int SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s) while (len > 0 && !result) { int advance = 0; Uint32 ch = UTF8_getch(s, len, &advance); - if (ch < 256) { - result |= SDLTest_DrawCharacter(renderer, curx, cury, ch); - } + result |= SDLTest_DrawCharacter(renderer, curx, cury, ch); curx += charWidth; s += advance; len -= advance; From 3d121d9bc7fb40a349a9901d68c171e4aa345dae Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 25 Jun 2024 03:32:46 +0000 Subject: [PATCH 058/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_events.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index ecd7cf7fd168d..db56f790d8d7a 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -317,7 +317,9 @@ typedef struct SDL_KeyboardEvent /** * Keyboard text editing event structure (event.edit.*) * - * The start cursor is the position, in UTF-8 characters, where new typing will be inserted into the editing text. The length is the number of UTF-8 characters that will be replaced by new typing. + * The start cursor is the position, in UTF-8 characters, where new typing + * will be inserted into the editing text. The length is the number of UTF-8 + * characters that will be replaced by new typing. * * The text string follows the SDL_GetStringRule. * From 596c0af0f319157d748b00d369240a9177a3132f Mon Sep 17 00:00:00 2001 From: Aleksander Date: Tue, 25 Jun 2024 15:11:10 +0200 Subject: [PATCH 059/431] Camera: Bugfix: `ChooseBestCameraSpec` doesn't set camera colorspace --- src/camera/SDL_camera.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index a36149ccffee8..b919948706de6 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -1006,22 +1006,27 @@ static void ChooseBestCameraSpec(SDL_CameraDevice *device, const SDL_CameraSpec // okay, we have what we think is the best resolution, now we just need the best format that supports it... const SDL_PixelFormatEnum wantfmt = spec->format; - SDL_PixelFormatEnum bestfmt = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormatEnum best_format = SDL_PIXELFORMAT_UNKNOWN; + SDL_Colorspace best_colorspace = SDL_COLORSPACE_UNKNOWN; for (int i = 0; i < num_specs; i++) { const SDL_CameraSpec *thisspec = &device->all_specs[i]; if ((thisspec->width == closest->width) && (thisspec->height == closest->height)) { - if (bestfmt == SDL_PIXELFORMAT_UNKNOWN) { - bestfmt = thisspec->format; // spec list is sorted by what we consider "best" format, so unless we find an exact match later, first size match is the one! + if (best_format == SDL_PIXELFORMAT_UNKNOWN) { + best_format = thisspec->format; // spec list is sorted by what we consider "best" format, so unless we find an exact match later, first size match is the one! + best_colorspace = thisspec->colorspace; } if (thisspec->format == wantfmt) { - bestfmt = thisspec->format; + best_format = thisspec->format; + best_colorspace = thisspec->colorspace; break; // exact match, stop looking. } } } - SDL_assert(bestfmt != SDL_PIXELFORMAT_UNKNOWN); - closest->format = bestfmt; + SDL_assert(best_format != SDL_PIXELFORMAT_UNKNOWN); + SDL_assert(best_colorspace != SDL_COLORSPACE_UNKNOWN); + closest->format = best_format; + closest->colorspace = best_colorspace; // We have a resolution and a format, find the closest framerate... const float wantfps = spec->framerate_denominator ? ((float)spec->framerate_numerator / spec->framerate_denominator) : 0.0f; From b37b94453c6d410d624a414e4aaa241f8825dc57 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 25 Jun 2024 10:15:36 -0700 Subject: [PATCH 060/431] Fixed multi-window test programs not quitting when windows are closed --- src/events/SDL_windowevents.c | 4 ++-- src/test/SDL_test_common.c | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/events/SDL_windowevents.c b/src/events/SDL_windowevents.c index fb66714f93541..0273b2c61fbab 100644 --- a/src/events/SDL_windowevents.c +++ b/src/events/SDL_windowevents.c @@ -248,12 +248,12 @@ int SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int toplevel_count = 0; SDL_Window *n; for (n = SDL_GetVideoDevice()->windows; n; n = n->next) { - if (!n->parent) { + if (!n->parent && !(n->flags & SDL_WINDOW_HIDDEN)) { ++toplevel_count; } } - if (toplevel_count == 1) { + if (toplevel_count <= 1) { if (SDL_GetHintBoolean(SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE, SDL_TRUE)) { SDL_SendQuit(); /* This is the last toplevel window in the list so send the SDL_EVENT_QUIT event */ } diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 84f2a1c6cae48..791c5b4c386fd 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2095,6 +2095,14 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; + case SDL_EVENT_WINDOW_CLOSE_REQUESTED: + { + SDL_Window *window = SDL_GetWindowFromID(event->window.windowID); + if (window) { + SDL_HideWindow(window); + } + break; + } case SDL_EVENT_KEY_DOWN: { SDL_bool withControl = !!(event->key.mod & SDL_KMOD_CTRL); From e9a93246ef0889f3f40503e9ba24b168526ae31e Mon Sep 17 00:00:00 2001 From: Cecill Etheredge Date: Tue, 25 Jun 2024 22:43:32 +0200 Subject: [PATCH 061/431] fix: Use drmModeAddFB2WithModifiers instead of drmModeAddFB to allow using GBM modifiers. This fixes corrupt framebuffers on platforms that require the use of modifiers. (cherry picked from commit 620e875335e35a6cc6c187079951f598bfd3b595) (cherry picked from commit 6589287ed6c7701ba98efc2833b4dd9891ccece5) --- src/video/kmsdrm/SDL_kmsdrmsym.h | 9 +++++++++ src/video/kmsdrm/SDL_kmsdrmvideo.c | 32 +++++++++++++++++++++--------- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmsym.h b/src/video/kmsdrm/SDL_kmsdrmsym.h index ad91d0691f758..2b4fe4bf35dc6 100644 --- a/src/video/kmsdrm/SDL_kmsdrmsym.h +++ b/src/video/kmsdrm/SDL_kmsdrmsym.h @@ -54,6 +54,11 @@ SDL_KMSDRM_SYM(int,drmModeAddFB2,(int fd, uint32_t width, uint32_t height, const uint32_t pitches[4], const uint32_t offsets[4], uint32_t *buf_id, uint32_t flags)) +SDL_KMSDRM_SYM(int,drmModeAddFB2WithModifiers,(int fd, uint32_t width, + uint32_t height, uint32_t pixel_format, const uint32_t bo_handles[4], + const uint32_t pitches[4], const uint32_t offsets[4], + const uint64_t modifier[4], uint32_t *buf_id, uint32_t flags)) + SDL_KMSDRM_SYM(int,drmModeRmFB,(int fd, uint32_t bufferId)) SDL_KMSDRM_SYM(drmModeFBPtr,drmModeGetFB,(int fd, uint32_t buf)) SDL_KMSDRM_SYM(drmModeCrtcPtr,drmModeGetCrtc,(int fd, uint32_t crtcId)) @@ -120,6 +125,10 @@ SDL_KMSDRM_SYM(void,gbm_surface_destroy,(struct gbm_surface *surf)) SDL_KMSDRM_SYM(struct gbm_bo *,gbm_surface_lock_front_buffer,(struct gbm_surface *surf)) SDL_KMSDRM_SYM(void,gbm_surface_release_buffer,(struct gbm_surface *surf, struct gbm_bo *bo)) +SDL_KMSDRM_SYM(uint64_t,gbm_bo_get_modifier,(struct gbm_bo *bo)) +SDL_KMSDRM_SYM(int,gbm_bo_get_plane_count,(struct gbm_bo *bo)) +SDL_KMSDRM_SYM(uint32_t,gbm_bo_get_offset,(struct gbm_bo *bo, int plane)) +SDL_KMSDRM_SYM(uint32_t,gbm_bo_get_stride_for_plane,(struct gbm_bo *bo, int plane)) #undef SDL_KMSDRM_MODULE #undef SDL_KMSDRM_SYM diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index ccc72b6f55a37..4a873a32c4a51 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -352,8 +352,9 @@ KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) { SDL_VideoData *viddata = _this->driverdata; unsigned w, h; - int ret; - Uint32 stride, handle; + int ret, num_planes = 0; + Uint32 format, strides[4] = { 0 }, handles[4] = { 0 }, offsets[4] = { 0 }, flags = 0; + uint64_t modifiers[4] = { 0 }; /* Check for an existing framebuffer */ KMSDRM_FBInfo *fb_info = (KMSDRM_FBInfo *)KMSDRM_gbm_bo_get_user_data(bo); @@ -372,20 +373,33 @@ KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) fb_info->drm_fd = viddata->drm_fd; - /* Create framebuffer object for the buffer */ + /* Create framebuffer object for the buffer using the modifiers requested by GBM. + Use of the modifiers is necessary on some platforms. */ w = KMSDRM_gbm_bo_get_width(bo); h = KMSDRM_gbm_bo_get_height(bo); - stride = KMSDRM_gbm_bo_get_stride(bo); - handle = KMSDRM_gbm_bo_get_handle(bo).u32; - ret = KMSDRM_drmModeAddFB(viddata->drm_fd, w, h, 24, 32, stride, handle, - &fb_info->fb_id); + format = KMSDRM_gbm_bo_get_format(bo); + + modifiers[0] = KMSDRM_gbm_bo_get_modifier(bo); + num_planes = KMSDRM_gbm_bo_get_plane_count(bo); + for (int i = 0; i < num_planes; i++) { + strides[i] = KMSDRM_gbm_bo_get_stride_for_plane(bo, i); + handles[i] = KMSDRM_gbm_bo_get_handle(bo).u32; + offsets[i] = KMSDRM_gbm_bo_get_offset(bo, i); + modifiers[i] = modifiers[0]; + } + + if (modifiers[0]) { + flags = DRM_MODE_FB_MODIFIERS; + } + + ret = KMSDRM_drmModeAddFB2WithModifiers(viddata->drm_fd, w, h, format, handles, strides, offsets, modifiers, &fb_info->fb_id, flags); if (ret) { SDL_free(fb_info); return NULL; } - SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "New DRM FB (%u): %ux%u, stride %u from BO %p", - fb_info->fb_id, w, h, stride, (void *)bo); + SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "New DRM FB (%u): %ux%u, from BO %p", + fb_info->fb_id, w, h, (void *)bo); /* Associate our DRM framebuffer with this buffer object */ KMSDRM_gbm_bo_set_user_data(bo, fb_info, KMSDRM_FBDestroyCallback); From 64acde86de41c085947a2b25a63f9ae3e6038c51 Mon Sep 17 00:00:00 2001 From: Edoardo Lolletti Date: Mon, 24 Jun 2024 22:31:32 +0200 Subject: [PATCH 062/431] stdcpp threads, simplify SDL_GetCurrentThreadID implementation Removed the workaround that handrolled a thread id using a thread_local variable alongside static mutexes --- src/thread/stdcpp/SDL_systhread.cpp | 31 ++++++++--------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/src/thread/stdcpp/SDL_systhread.cpp b/src/thread/stdcpp/SDL_systhread.cpp index 350431f0ede03..a2b6f4a79bc37 100644 --- a/src/thread/stdcpp/SDL_systhread.cpp +++ b/src/thread/stdcpp/SDL_systhread.cpp @@ -27,7 +27,6 @@ extern "C" { #include "../SDL_systhread.h" } -#include #include #include @@ -47,11 +46,10 @@ SDL_SYS_CreateThread(SDL_Thread *thread, { try { // !!! FIXME: no way to set a thread stack size here. - std::thread cpp_thread(RunThread, thread); - thread->handle = (void *)new std::thread(std::move(cpp_thread)); + thread->handle = (void *)new std::thread(RunThread, thread); return 0; } catch (std::system_error &ex) { - return SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code(), ex.what()); + return SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code().value(), ex.what()); } catch (std::bad_alloc &) { return SDL_OutOfMemory(); } @@ -60,30 +58,17 @@ SDL_SYS_CreateThread(SDL_Thread *thread, extern "C" void SDL_SYS_SetupThread(const char *name) { - // Make sure a thread ID gets assigned ASAP, for debugging purposes: - SDL_GetCurrentThreadID(); - return; + /* Do nothing. */ } extern "C" SDL_ThreadID SDL_GetCurrentThreadID(void) { -#ifdef SDL_PLATFORM_WINRT - return GetCurrentThreadId(); -#else - // HACK: Mimic a thread ID, if one isn't otherwise available. - static thread_local SDL_ThreadID current_thread_id = 0; - static SDL_ThreadID next_thread_id = 1; - static std::mutex next_thread_id_mutex; - - if (current_thread_id == 0) { - std::lock_guard lock(next_thread_id_mutex); - current_thread_id = next_thread_id; - ++next_thread_id; - } - - return current_thread_id; -#endif + static_assert(sizeof(std::thread::id) <= sizeof(SDL_ThreadID), "std::thread::id must not be bigger than SDL_ThreadID"); + SDL_ThreadID thread_id{}; + const auto cpp_thread_id = std::this_thread::get_id(); + SDL_memcpy(&thread_id, &cpp_thread_id, sizeof(std::thread::id)); + return thread_id; } extern "C" int From dc8b06fb5a91df91844c3e69463a029222d12d91 Mon Sep 17 00:00:00 2001 From: hwsmm Date: Wed, 26 Jun 2024 23:58:00 +0900 Subject: [PATCH 063/431] Check if SDL_GetKeyboardFocus is null in X11/Wayland events --- src/video/wayland/SDL_waylandevents.c | 9 ++++++--- src/video/x11/SDL_x11events.c | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 05e4017dcba82..802ba01ab2a9a 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -381,7 +381,8 @@ int Wayland_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) WAYLAND_wl_display_flush(d->display); #ifdef SDL_USE_IME - if (!d->text_input_manager && SDL_TextInputActive(SDL_GetKeyboardFocus())) { + SDL_Window *keyboard_focus = SDL_GetKeyboardFocus(); + if (!d->text_input_manager && keyboard_focus && SDL_TextInputActive(keyboard_focus)) { SDL_IME_PumpEvents(); } #endif @@ -454,7 +455,8 @@ void Wayland_PumpEvents(SDL_VideoDevice *_this) int err; #ifdef SDL_USE_IME - if (!d->text_input_manager && SDL_TextInputActive(SDL_GetKeyboardFocus())) { + SDL_Window *keyboard_focus = SDL_GetKeyboardFocus(); + if (!d->text_input_manager && keyboard_focus && SDL_TextInputActive(keyboard_focus)) { SDL_IME_PumpEvents(); } #endif @@ -1649,7 +1651,8 @@ static void keyboard_handle_key(void *data, struct wl_keyboard *keyboard, Wayland_UpdateImplicitGrabSerial(input, serial); if (state == WL_KEYBOARD_KEY_STATE_PRESSED) { - if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { + SDL_Window *keyboard_focus = SDL_GetKeyboardFocus(); + if (keyboard_focus && SDL_TextInputActive(keyboard_focus)) { has_text = keyboard_input_get_text(text, input, key, SDL_PRESSED, &handled_by_ime); } } else { diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 251f6781412ed..decb47a93b787 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -2024,7 +2024,8 @@ int X11_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) X11_DispatchEvent(_this, &xevent); #ifdef SDL_USE_IME - if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { + SDL_Window *keyboard_focus = SDL_GetKeyboardFocus(); + if (keyboard_focus && SDL_TextInputActive(keyboard_focus)) { SDL_IME_PumpEvents(); } #endif @@ -2084,7 +2085,8 @@ void X11_PumpEvents(SDL_VideoDevice *_this) } #ifdef SDL_USE_IME - if (SDL_TextInputActive(SDL_GetKeyboardFocus())) { + SDL_Window *keyboard_focus = SDL_GetKeyboardFocus(); + if (keyboard_focus && SDL_TextInputActive(keyboard_focus)) { SDL_IME_PumpEvents(); } #endif From 80e64ef9217a73e26764ca71f3b076ef0602590e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 08:05:25 -0700 Subject: [PATCH 064/431] Windows IME cleanup * Don't need to initialize values already zeroed * Added debug message logging * Don't send duplicate SDL_EVENT_TEXT_EDITING events with empty text * Send the length of selected text in the SDL_EVENT_TEXT_EDITING event * Fixed potential crashes when out of memory --- src/video/windows/SDL_windowskeyboard.c | 157 ++++++++++++------------ src/video/windows/SDL_windowsvideo.h | 5 +- 2 files changed, 84 insertions(+), 78 deletions(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index cbb29a3d82c9c..f4c2916ae7d22 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -31,6 +31,11 @@ #include #ifndef SDL_DISABLE_WINDOWS_IME +#if 0 +#define SDL_DebugIMELog SDL_Log +#else +#define SDL_DebugIMELog(...) +#endif static int IME_Init(SDL_VideoData *videodata, HWND hwnd); static void IME_Enable(SDL_VideoData *videodata, HWND hwnd); static void IME_Disable(SDL_VideoData *videodata, HWND hwnd); @@ -51,51 +56,13 @@ void WIN_InitKeyboard(SDL_VideoDevice *_this) #ifndef SDL_DISABLE_WINDOWS_IME SDL_VideoData *data = _this->driverdata; - data->ime_com_initialized = SDL_FALSE; - data->ime_threadmgr = 0; - data->ime_initialized = SDL_FALSE; - data->ime_enabled = SDL_FALSE; - data->ime_available = SDL_FALSE; - data->ime_hwnd_main = 0; - data->ime_hwnd_current = 0; - data->ime_himc = 0; data->ime_composition_length = 32 * sizeof(WCHAR); - data->ime_composition = (WCHAR *)SDL_malloc(data->ime_composition_length + sizeof(WCHAR)); - data->ime_composition[0] = 0; - data->ime_readingstring[0] = 0; - data->ime_cursor = 0; - - data->ime_candlist = SDL_FALSE; - data->ime_candidates = NULL; - data->ime_candcount = 0; - data->ime_candref = 0; - data->ime_candsel = 0; - data->ime_candpgsize = 0; - data->ime_candlistindexbase = 0; + data->ime_composition = (WCHAR *)SDL_calloc(data->ime_composition_length, sizeof(WCHAR)); data->ime_candvertical = SDL_TRUE; - - data->ime_dirty = SDL_FALSE; - SDL_memset(&data->ime_rect, 0, sizeof(data->ime_rect)); - SDL_memset(&data->ime_candlistrect, 0, sizeof(data->ime_candlistrect)); - data->ime_winwidth = 0; - data->ime_winheight = 0; - - data->ime_hkl = 0; - data->ime_himm32 = 0; - data->GetReadingString = 0; - data->ShowReadingWindow = 0; - data->ImmLockIMC = 0; - data->ImmUnlockIMC = 0; - data->ImmLockIMCC = 0; - data->ImmUnlockIMCC = 0; - data->ime_uiless = SDL_FALSE; - data->ime_threadmgrex = 0; data->ime_uielemsinkcookie = TF_INVALID_COOKIE; data->ime_alpnsinkcookie = TF_INVALID_COOKIE; data->ime_openmodesinkcookie = TF_INVALID_COOKIE; data->ime_convmodesinkcookie = TF_INVALID_COOKIE; - data->ime_uielemsink = 0; - data->ime_ippasink = 0; #endif /* !SDL_DISABLE_WINDOWS_IME */ WIN_UpdateKeymap(SDL_FALSE); @@ -356,6 +323,7 @@ static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd); static void IME_SetupAPI(SDL_VideoData *videodata); static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex); static void IME_SendEditingEvent(SDL_VideoData *videodata); +static void IME_SendClearComposition(SDL_VideoData *videodata); static void IME_DestroyTextures(SDL_VideoData *videodata); static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata); @@ -793,7 +761,7 @@ static void IME_ClearComposition(SDL_VideoData *videodata) ImmNotifyIME(himc, NI_CLOSECANDIDATE, 0, 0); ImmReleaseContext(videodata->ime_hwnd_current, himc); - SDL_SendEditingText("", 0, 0); + IME_SendClearComposition(videodata); } static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD string) @@ -811,17 +779,12 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD videodata->ime_composition_length = length; } - length = ImmGetCompositionStringW( - himc, - string, - videodata->ime_composition, - videodata->ime_composition_length); - + length = ImmGetCompositionStringW(himc, string, videodata->ime_composition, videodata->ime_composition_length); if (length < 0) { length = 0; } - length /= sizeof(WCHAR); + videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); if ((dwLang == LANG_CHT || dwLang == LANG_CHS) && videodata->ime_cursor > 0 && @@ -829,26 +792,25 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD (videodata->ime_composition[0] == 0x3000 || videodata->ime_composition[0] == 0x0020)) { // Traditional Chinese IMEs add a placeholder U+3000 // Simplified Chinese IMEs seem to add a placeholder U+0020 sometimes - int i; - for (i = videodata->ime_cursor + 1; i < length; ++i) { + for (int i = videodata->ime_cursor + 1; i < length; ++i) { videodata->ime_composition[i - 1] = videodata->ime_composition[i]; } - --length; } videodata->ime_composition[length] = 0; -#if 0 // At least with the Chinese IME, it's possible to move the cursor to the beginning of the selection, see https://github.com/libsdl-org/SDL/issues/9761 for details - // Get the correct caret position if we've selected a candidate from the candidate window - if (videodata->ime_cursor == 0 && length > 0) { - Sint32 start = 0; - Sint32 end = 0; + length = ImmGetCompositionStringW(himc, GCS_COMPATTR, NULL, 0); + if (length > 0) { + Uint8 *attributes = (Uint8 *)SDL_malloc(length); + if (attributes) { + int start = 0; + int end = 0; - length = ImmGetCompositionStringW(himc, GCS_COMPATTR, NULL, 0); - if (length > 0) { - Uint8 *attributes = (Uint8 *)SDL_malloc(length + sizeof(WCHAR)); - ImmGetCompositionString(himc, GCS_COMPATTR, attributes, length); + length = ImmGetCompositionString(himc, GCS_COMPATTR, attributes, length); + if (length < 0) { + length = 0; + } for (start = 0; start < length; ++start) { if (attributes[start] == ATTR_TARGET_CONVERTED || attributes[start] == ATTR_TARGET_NOTCONVERTED) { @@ -862,17 +824,22 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD } } - if (start == length) { - start = 0; - end = length; + if (end > start) { + videodata->ime_selected_start = start; + videodata->ime_selected_length = end - start; + } else { + videodata->ime_selected_start = 0; + videodata->ime_selected_length = 0; } SDL_free(attributes); } + } - videodata->ime_cursor = end; + // Get the correct caret position if we've selected a candidate from the candidate window + if (videodata->ime_cursor == 0 && !videodata->ime_candidates_open) { + videodata->ime_cursor = videodata->ime_selected_start + videodata->ime_selected_length; } -#endif // 0 } static void IME_SendInputEvent(SDL_VideoData *videodata) @@ -897,6 +864,9 @@ static void IME_SendEditingEvent(SDL_VideoData *videodata) size += sizeof(videodata->ime_readingstring); buffer = (WCHAR *)SDL_malloc(size + sizeof(WCHAR)); + if (!buffer) { + return; + } buffer[0] = 0; SDL_wcslcpy(buffer, videodata->ime_composition, len + 1); @@ -904,16 +874,36 @@ static void IME_SendEditingEvent(SDL_VideoData *videodata) SDL_wcslcat(buffer, &videodata->ime_composition[len], size); } else { buffer = (WCHAR *)SDL_malloc(size + sizeof(WCHAR)); + if (!buffer) { + return; + } buffer[0] = 0; SDL_wcslcpy(buffer, videodata->ime_composition, size); } s = WIN_StringToUTF8W(buffer); - SDL_SendEditingText(s, videodata->ime_cursor + (int)SDL_wcslen(videodata->ime_readingstring), 0); - SDL_free(s); + if (s) { + if (videodata->ime_cursor > 0 || videodata->ime_readingstring[0]) { + SDL_SendEditingText(s, videodata->ime_cursor, (int)SDL_wcslen(videodata->ime_readingstring)); + } else { + SDL_SendEditingText(s, videodata->ime_selected_start, videodata->ime_selected_length); + } + if (*s) { + videodata->ime_needs_clear_composition = SDL_TRUE; + } + SDL_free(s); + } SDL_free(buffer); } +static void IME_SendClearComposition(SDL_VideoData *videodata) +{ + if (videodata->ime_needs_clear_composition) { + SDL_SendEditingText("", 0, 0); + videodata->ime_needs_clear_composition = SDL_FALSE; + } +} + static void IME_AddCandidate(SDL_VideoData *videodata, UINT i, LPCWSTR candidate) { LPWSTR dst = &videodata->ime_candidates[i * MAX_CANDLENGTH]; @@ -1033,34 +1023,40 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S switch (msg) { case WM_KEYDOWN: if (wParam == VK_PROCESSKEY) { + SDL_DebugIMELog("WM_KEYDOWN VK_PROCESSKEY\n"); videodata->ime_uicontext = 1; trap = SDL_TRUE; } else { + SDL_DebugIMELog("WM_KEYDOWN normal\n"); videodata->ime_uicontext = 0; } break; case WM_INPUTLANGCHANGE: + SDL_DebugIMELog("WM_INPUTLANGCHANGE\n"); IME_InputLangChanged(videodata); break; case WM_IME_SETCONTEXT: + SDL_DebugIMELog("WM_IME_SETCONTEXT\n"); if (videodata->ime_uiless) { *lParam = 0; } break; case WM_IME_STARTCOMPOSITION: - videodata->ime_suppress_endcomposition_event = SDL_FALSE; + SDL_DebugIMELog("WM_IME_STARTCOMPOSITION\n"); trap = SDL_TRUE; break; case WM_IME_COMPOSITION: + SDL_DebugIMELog("WM_IME_COMPOSITION %x\n", lParam); trap = SDL_TRUE; himc = ImmGetContext(hwnd); if (*lParam & GCS_RESULTSTR) { - videodata->ime_suppress_endcomposition_event = SDL_TRUE; + SDL_DebugIMELog("GCS_RESULTSTR\n"); IME_GetCompositionString(videodata, himc, GCS_RESULTSTR); - SDL_SendEditingText("", 0, 0); + IME_SendClearComposition(videodata); IME_SendInputEvent(videodata); } if (*lParam & GCS_COMPSTR) { + SDL_DebugIMELog("GCS_COMPSTR\n"); if (!videodata->ime_uiless) { videodata->ime_readingstring[0] = 0; } @@ -1071,40 +1067,47 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S ImmReleaseContext(hwnd, himc); break; case WM_IME_ENDCOMPOSITION: + SDL_DebugIMELog("WM_IME_ENDCOMPOSITION\n"); videodata->ime_uicontext = 0; videodata->ime_composition[0] = 0; videodata->ime_readingstring[0] = 0; videodata->ime_cursor = 0; - if (videodata->ime_suppress_endcomposition_event == SDL_FALSE) { - SDL_SendEditingText("", 0, 0); - } - videodata->ime_suppress_endcomposition_event = SDL_FALSE; + IME_SendClearComposition(videodata); break; case WM_IME_NOTIFY: + SDL_DebugIMELog("WM_IME_NOTIFY %x\n", wParam); switch (wParam) { + case IMN_SETCOMPOSITIONWINDOW: + SDL_DebugIMELog("IMN_SETCOMPOSITIONWINDOW\n"); + break; + case IMN_SETCANDIDATEPOS: + SDL_DebugIMELog("IMN_SETCANDIDATEPOS\n"); + break; case IMN_SETCONVERSIONMODE: case IMN_SETOPENSTATUS: + SDL_DebugIMELog("%s\n", wParam == IMN_SETCONVERSIONMODE ? "IMN_SETCONVERSIONMODE" : "IMN_SETOPENSTATUS"); IME_UpdateInputLocale(videodata); break; case IMN_OPENCANDIDATE: case IMN_CHANGECANDIDATE: - if (videodata->ime_uiless) { - break; - } - + SDL_DebugIMELog("%s\n", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); trap = SDL_TRUE; videodata->ime_uicontext = 1; + videodata->ime_candidates_open = SDL_TRUE; IME_GetCandidateList(hwnd, videodata); break; case IMN_CLOSECANDIDATE: + SDL_DebugIMELog("IMN_CLOSECANDIDATE\n"); trap = SDL_TRUE; videodata->ime_uicontext = 0; + videodata->ime_candidates_open = SDL_FALSE; IME_HideCandidateList(videodata); break; case IMN_PRIVATE: { DWORD dwId = IME_GetId(videodata, 0); IME_GetReadingString(videodata, hwnd); + SDL_DebugIMELog("IMN_PRIVATE %u\n", dwId); switch (dwId) { case IMEID_CHT_VER42: case IMEID_CHT_VER43: diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index bee76380b405c..09a930a2c23a3 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -429,14 +429,17 @@ struct SDL_VideoData SDL_bool ime_available; HWND ime_hwnd_main; HWND ime_hwnd_current; - SDL_bool ime_suppress_endcomposition_event; + SDL_bool ime_needs_clear_composition; HIMC ime_himc; WCHAR *ime_composition; int ime_composition_length; WCHAR ime_readingstring[16]; int ime_cursor; + int ime_selected_start; + int ime_selected_length; + SDL_bool ime_candidates_open; SDL_bool ime_candlist; WCHAR *ime_candidates; DWORD ime_candcount; From 306cc6f91e3896b4db959b6aa335edbc2a1193bf Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 26 Jun 2024 17:52:24 +0000 Subject: [PATCH 065/431] Sync SDL3 wiki -> header --- docs/README-migration.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 3790bc49b563a..f31cb356c177b 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -148,13 +148,13 @@ Devices are not opened by an arbitrary string name anymore, but by device instan Many functions that would accept a device index and an `iscapture` parameter now just take an SDL_AudioDeviceID, as they are unique across all devices, instead of separate indices into playback and recording device lists. -Rather than iterating over audio devices using a device index, there are new functions, SDL_GetAudioOutputDevices() and SDL_GetAudioCaptureDevices(), to get the current list of devices, and new functions to get information about devices from their instance ID: +Rather than iterating over audio devices using a device index, there are new functions, SDL_GetAudioPlaybackDevices() and SDL_GetAudioRecordingDevices(), to get the current list of devices, and new functions to get information about devices from their instance ID: ```c { if (SDL_InitSubSystem(SDL_INIT_AUDIO) == 0) { int i, num_devices; - SDL_AudioDeviceID *devices = SDL_GetAudioOutputDevices(&num_devices); + SDL_AudioDeviceID *devices = SDL_GetAudioPlaybackDevices(&num_devices); if (devices) { for (i = 0; i < num_devices; ++i) { SDL_AudioDeviceID instance_id = devices[i]; From 9fd54b724f14243f56240752b8347b66a34e18e7 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 26 Jun 2024 14:08:56 -0400 Subject: [PATCH 066/431] include: Added documentation for SDL_PRESSED and SDL_RELEASED. Fixes #10069. --- include/SDL3/SDL_events.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index db56f790d8d7a..6e30acc48e258 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -46,10 +46,27 @@ extern "C" { #endif -/* General keyboard/mouse state definitions */ +/* General keyboard/mouse/pen state definitions */ + +/** + * A value that signifies a button is no longer pressed. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_PRESSED + */ #define SDL_RELEASED 0 + +/** + * A value that signifies a button has been pressed down. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_RELEASED + */ #define SDL_PRESSED 1 + /** * The types of events that can be delivered. * From 56e85064ffbc9afbcb7ab811f14d5439db26d7cf Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 11:04:00 -0700 Subject: [PATCH 067/431] Fixed audio recording latency after a hitch We want to return any data as soon as it's available, if we get a hitch and always wait, we'll never catch up. --- src/audio/wasapi/SDL_wasapi.c | 43 +++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/src/audio/wasapi/SDL_wasapi.c b/src/audio/wasapi/SDL_wasapi.c index 5b957f717a6c8..b133b16658cae 100644 --- a/src/audio/wasapi/SDL_wasapi.c +++ b/src/audio/wasapi/SDL_wasapi.c @@ -465,22 +465,41 @@ static int WASAPI_WaitDevice(SDL_AudioDevice *device) { // WaitDevice does not hold the device lock, so check for recovery/disconnect details here. while (RecoverWasapiIfLost(device) && device->hidden->client && device->hidden->event) { - DWORD waitResult = WaitForSingleObjectEx(device->hidden->event, 200, FALSE); - if (waitResult == WAIT_OBJECT_0) { - const UINT32 maxpadding = device->sample_frames; + if (device->recording) { + // Recording devices should return immediately if there is any data available UINT32 padding = 0; if (!WasapiFailed(device, IAudioClient_GetCurrentPadding(device->hidden->client, &padding))) { - //SDL_Log("WASAPI EVENT! padding=%u maxpadding=%u", (unsigned int)padding, (unsigned int)maxpadding);*/ - if (device->recording && (padding > 0)) { - break; - } else if (!device->recording && (padding <= maxpadding)) { + //SDL_Log("WASAPI EVENT! padding=%u maxpadding=%u", (unsigned int)padding, (unsigned int)maxpadding); + if (padding > 0) { break; } } - } else if (waitResult != WAIT_TIMEOUT) { - //SDL_Log("WASAPI FAILED EVENT!");*/ - IAudioClient_Stop(device->hidden->client); - return -1; + + switch (WaitForSingleObjectEx(device->hidden->event, 200, FALSE)) { + case WAIT_OBJECT_0: + case WAIT_TIMEOUT: + break; + + default: + //SDL_Log("WASAPI FAILED EVENT!"); + IAudioClient_Stop(device->hidden->client); + return -1; + } + } else { + DWORD waitResult = WaitForSingleObjectEx(device->hidden->event, 200, FALSE); + if (waitResult == WAIT_OBJECT_0) { + UINT32 padding = 0; + if (!WasapiFailed(device, IAudioClient_GetCurrentPadding(device->hidden->client, &padding))) { + //SDL_Log("WASAPI EVENT! padding=%u maxpadding=%u", (unsigned int)padding, (unsigned int)maxpadding); + if (padding <= (UINT32)device->sample_frames) { + break; + } + } + } else if (waitResult != WAIT_TIMEOUT) { + //SDL_Log("WASAPI FAILED EVENT!");*/ + IAudioClient_Stop(device->hidden->client); + return -1; + } } } @@ -662,7 +681,7 @@ static int mgmtthrtask_PrepDevice(void *userdata) iaudioclient3_initialized = SDL_TRUE; } } - + IAudioClient3_Release(client3); } } From 8949de3978a360c04dbf9e9b4b7d7b6b4f86be5a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 12:18:43 -0700 Subject: [PATCH 068/431] Fixed building with older libdrm headers --- src/video/kmsdrm/SDL_kmsdrmvideo.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.h b/src/video/kmsdrm/SDL_kmsdrmvideo.h index 738165e923369..71d195ac6bab0 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.h +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.h @@ -33,6 +33,10 @@ #include #include +#ifndef DRM_MODE_FB_MODIFIERS +#define DRM_MODE_FB_MODIFIERS 2 +#endif + #ifndef DRM_MODE_PAGE_FLIP_ASYNC #define DRM_MODE_PAGE_FLIP_ASYNC 2 #endif From c7f7464174918fcd1e2b3f5ae4deeea3fe3cdc27 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 12:33:16 -0700 Subject: [PATCH 069/431] Updated scancode documentation --- include/SDL3/SDL_scancode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_scancode.h b/include/SDL3/SDL_scancode.h index 95317332e8179..62b098257945c 100644 --- a/include/SDL3/SDL_scancode.h +++ b/include/SDL3/SDL_scancode.h @@ -37,7 +37,7 @@ * independent of language and keyboard mapping. * * Values of this type are used to represent keyboard keys, among other places - * in the `keysym.scancode` field of the SDL_KeyboardEvent structure. + * in the `scancode` field of the SDL_KeyboardEvent structure. * * The values in this enumeration are based on the USB usage page standard: * https://usb.org/sites/default/files/hut1_5.pdf From d86ea0622d5e2cf254cb41b6bd534bf9467d97ce Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Wed, 26 Jun 2024 22:20:37 +0200 Subject: [PATCH 070/431] Add slash to cwd call --- src/filesystem/ps2/SDL_sysfilesystem.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index d5b2632b2950c..da773eb690330 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -30,16 +30,14 @@ char *SDL_GetBasePath(void) { - char *retval; + char *retval = NULL; size_t len; char cwd[FILENAME_MAX]; getcwd(cwd, sizeof(cwd)); - len = SDL_strlen(cwd) + 1; + len = SDL_strlen(cwd) + 2; retval = (char *)SDL_malloc(len); - if (retval) { - SDL_memcpy(retval, cwd, len); - } + SDL_snprintf(retval, len, "%s/", cwd); return retval; } From 0ae4fd0ec9e2d6b048cde926653b7895b380232b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 15:42:06 -0700 Subject: [PATCH 071/431] Make sure we don't try to use the XInput DLL after it's unloaded Steam ran into a crash SDL_XINPUT_JoystickDetect() with XINPUTGETCAPABILITIES being NULL. I'm not sure how that happened, and there may still be a race condition if this is a multi-threaded issue, but at least this is more correct. --- src/joystick/windows/SDL_xinputjoystick.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/joystick/windows/SDL_xinputjoystick.c b/src/joystick/windows/SDL_xinputjoystick.c index 133461972ce0f..2489b7bb37e43 100644 --- a/src/joystick/windows/SDL_xinputjoystick.c +++ b/src/joystick/windows/SDL_xinputjoystick.c @@ -417,6 +417,7 @@ void SDL_XINPUT_JoystickClose(SDL_Joystick *joystick) void SDL_XINPUT_JoystickQuit(void) { if (s_bXInputEnabled) { + s_bXInputEnabled = SDL_FALSE; WIN_UnloadXInputDLL(); } } From 71200e94a82b081eb0d426324e3465f7c01f4c09 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 26 Jun 2024 18:13:29 -0400 Subject: [PATCH 072/431] core: Factor out common URI decode functions from Wayland and X11 --- src/core/unix/SDL_uri_decode.c | 123 ++++++++++++++++++++++++ src/core/unix/SDL_uri_decode.h | 56 +++++++++++ src/video/wayland/SDL_waylandevents.c | 129 +------------------------- src/video/x11/SDL_x11events.c | 123 +----------------------- 4 files changed, 185 insertions(+), 246 deletions(-) create mode 100644 src/core/unix/SDL_uri_decode.c create mode 100644 src/core/unix/SDL_uri_decode.h diff --git a/src/core/unix/SDL_uri_decode.c b/src/core/unix/SDL_uri_decode.c new file mode 100644 index 0000000000000..dd60595864d42 --- /dev/null +++ b/src/core/unix/SDL_uri_decode.c @@ -0,0 +1,123 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_internal.h" + +#include "SDL_uri_decode.h" +#include +#include + +int SDL_URIDecode(const char *src, char *dst, int len) +{ + int ri, wi, di; + char decode = '\0'; + if (!src || !dst || len < 0) { + errno = EINVAL; + return -1; + } + if (len == 0) { + len = SDL_strlen(src); + } + for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) { + if (di == 0) { + /* start decoding */ + if (src[ri] == '%') { + decode = '\0'; + di += 1; + continue; + } + /* normal write */ + dst[wi] = src[ri]; + wi += 1; + continue; + } else if (di == 1 || di == 2) { + char off = '\0'; + char isa = src[ri] >= 'a' && src[ri] <= 'f'; + char isA = src[ri] >= 'A' && src[ri] <= 'F'; + char isn = src[ri] >= '0' && src[ri] <= '9'; + if (!(isa || isA || isn)) { + /* not a hexadecimal */ + int sri; + for (sri = ri - di; sri <= ri; sri += 1) { + dst[wi] = src[sri]; + wi += 1; + } + di = 0; + continue; + } + /* itsy bitsy magicsy */ + if (isn) { + off = 0 - '0'; + } else if (isa) { + off = 10 - 'a'; + } else if (isA) { + off = 10 - 'A'; + } + decode |= (src[ri] + off) << (2 - di) * 4; + if (di == 2) { + dst[wi] = decode; + wi += 1; + di = 0; + } else { + di += 1; + } + continue; + } + } + dst[wi] = '\0'; + return wi; +} + +int SDL_URIToLocal(const char *src, char *dst) +{ + if (SDL_memcmp(src, "file:/", 6) == 0) { + src += 6; /* local file? */ + } else if (SDL_strstr(src, ":/") != NULL) { + return -1; /* wrong scheme */ + } + + SDL_bool local = src[0] != '/' || (src[0] != '\0' && src[1] == '/'); + + /* got a hostname? */ + if (!local && src[0] == '/' && src[2] != '/') { + char *hostname_end = SDL_strchr(src + 1, '/'); + if (hostname_end) { + char hostname[257]; + if (gethostname(hostname, 255) == 0) { + hostname[256] = '\0'; + if (SDL_memcmp(src + 1, hostname, hostname_end - (src + 1)) == 0) { + src = hostname_end + 1; + local = SDL_TRUE; + } + } + } + } + if (local) { + /* Convert URI escape sequences to real characters */ + if (src[0] == '/') { + src++; + } else { + src--; + } + return SDL_URIDecode(src, dst, 0); + } + return -1; +} diff --git a/src/core/unix/SDL_uri_decode.h b/src/core/unix/SDL_uri_decode.h new file mode 100644 index 0000000000000..fbe33f12b8dd9 --- /dev/null +++ b/src/core/unix/SDL_uri_decode.h @@ -0,0 +1,56 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#include "SDL_internal.h" + +#ifndef SDL_uri_decode_h_ +#define SDL_uri_decode_h_ + +/* Decodes URI escape sequences in string src of len bytes + * (excluding the terminating NULL byte) into the dst buffer. + * Since URI-encoded characters take three times the space of + * normal characters, src and dst can safely point to the same + * buffer for in situ conversion. + * + * The buffer is guaranteed to be NULL-terminated, but + * may contain embedded NULL bytes. + * + * Returns the number of decoded bytes that wound up in + * the destination buffer, excluding the terminating NULL byte. + * + * On error, -1 is returned. + */ +int SDL_URIDecode(const char *src, char *dst, int len); + +/* Convert URI to a local filename, stripping the "file://" + * preamble and hostname if present, and writes the result + * to the dst buffer. Since URI-encoded characters take + * three times the space of normal characters, src and dst + * can safely point to the same buffer for in situ conversion. + * + * Returns the number of decoded bytes that wound up in + * the destination buffer, excluding the terminating NULL byte. + * + * On error, -1 is returned; + */ +int SDL_URIToLocal(const char *src, char *dst); + +#endif /* SDL_uri_decode_h_ */ diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 802ba01ab2a9a..693655b399967 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -24,6 +24,7 @@ #ifdef SDL_VIDEO_DRIVER_WAYLAND #include "../../core/unix/SDL_poll.h" +#include "../../core/unix/SDL_uri_decode.h" #include "../../events/SDL_events_c.h" #include "../../events/SDL_scancode_tables_c.h" #include "../../core/linux/SDL_system_theme.h" @@ -89,8 +90,6 @@ struct SDL_WaylandTouchPoint static struct wl_list touch_points; -static char *Wayland_URIToLocal(char *uri); - static void touch_add(SDL_TouchID id, wl_fixed_t fx, wl_fixed_t fy, struct wl_surface *surface) { struct SDL_WaylandTouchPoint *tp = SDL_malloc(sizeof(struct SDL_WaylandTouchPoint)); @@ -2060,127 +2059,6 @@ static void data_device_handle_motion(void *data, struct wl_data_device *wl_data } } -/* Decodes URI escape sequences in string buf of len bytes - * (excluding the terminating NULL byte) in-place. Since - * URI-encoded characters take three times the space of - * normal characters, this should not be an issue. - * - * Returns the number of decoded bytes that wound up in - * the buffer, excluding the terminating NULL byte. - * - * The buffer is guaranteed to be NULL-terminated but - * may contain embedded NULL bytes. - * - * On error, -1 is returned. - * - * FIXME: This was shamelessly copied from SDL_x11events.c - */ -static int Wayland_URIDecode(char *buf, int len) -{ - int ri, wi, di; - char decode = '\0'; - if (!buf || len < 0) { - errno = EINVAL; - return -1; - } - if (len == 0) { - len = SDL_strlen(buf); - } - for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) { - if (di == 0) { - /* start decoding */ - if (buf[ri] == '%') { - decode = '\0'; - di += 1; - continue; - } - /* normal write */ - buf[wi] = buf[ri]; - wi += 1; - continue; - } else if (di == 1 || di == 2) { - char off = '\0'; - char isa = buf[ri] >= 'a' && buf[ri] <= 'f'; - char isA = buf[ri] >= 'A' && buf[ri] <= 'F'; - char isn = buf[ri] >= '0' && buf[ri] <= '9'; - if (!(isa || isA || isn)) { - /* not a hexadecimal */ - int sri; - for (sri = ri - di; sri <= ri; sri += 1) { - buf[wi] = buf[sri]; - wi += 1; - } - di = 0; - continue; - } - /* itsy bitsy magicsy */ - if (isn) { - off = 0 - '0'; - } else if (isa) { - off = 10 - 'a'; - } else if (isA) { - off = 10 - 'A'; - } - decode |= (buf[ri] + off) << (2 - di) * 4; - if (di == 2) { - buf[wi] = decode; - wi += 1; - di = 0; - } else { - di += 1; - } - continue; - } - } - buf[wi] = '\0'; - return wi; -} - -/* Convert URI to local filename - * return filename if possible, else NULL - * - * FIXME: This was shamelessly copied from SDL_x11events.c - */ -static char *Wayland_URIToLocal(char *uri) -{ - char *file = NULL; - SDL_bool local; - - if (SDL_memcmp(uri, "file:/", 6) == 0) { - uri += 6; /* local file? */ - } else if (SDL_strstr(uri, ":/") != NULL) { - return file; /* wrong scheme */ - } - - local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/'); - - /* got a hostname? */ - if (!local && uri[0] == '/' && uri[2] != '/') { - char *hostname_end = SDL_strchr(uri + 1, '/'); - if (hostname_end) { - char hostname[257]; - if (gethostname(hostname, 255) == 0) { - hostname[256] = '\0'; - if (SDL_memcmp(uri + 1, hostname, hostname_end - (uri + 1)) == 0) { - uri = hostname_end + 1; - local = SDL_TRUE; - } - } - } - } - if (local) { - file = uri; - /* Convert URI escape sequences to real characters */ - Wayland_URIDecode(file, 0); - if (uri[1] == '/') { - file++; - } else { - file--; - } - } - return file; -} - static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_device) { SDL_WaylandDataDevice *data_device = data; @@ -2226,9 +2104,8 @@ static void data_device_handle_drop(void *data, struct wl_data_device *wl_data_d char *saveptr = NULL; char *token = SDL_strtok_r((char *)buffer, "\r\n", &saveptr); while (token) { - char *fn = Wayland_URIToLocal(token); - if (fn) { - SDL_SendDropFile(data_device->dnd_window, NULL, fn); + if (SDL_URIToLocal(token, token) >= 0) { + SDL_SendDropFile(data_device->dnd_window, NULL, token); } token = SDL_strtok_r(NULL, "\r\n", &saveptr); } diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index decb47a93b787..560d316ca2c7f 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -36,6 +36,7 @@ #include "SDL_x11settings.h" #include "../SDL_clipboard_c.h" #include "../../core/unix/SDL_poll.h" +#include "../../core/unix/SDL_uri_decode.h" #include "../../events/SDL_events_c.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" @@ -207,123 +208,6 @@ static SDL_bool X11_IsWheelEvent(Display *display, int button, int *xticks, int return SDL_FALSE; } -/* Decodes URI escape sequences in string buf of len bytes - (excluding the terminating NULL byte) in-place. Since - URI-encoded characters take three times the space of - normal characters, this should not be an issue. - - Returns the number of decoded bytes that wound up in - the buffer, excluding the terminating NULL byte. - - The buffer is guaranteed to be NULL-terminated but - may contain embedded NULL bytes. - - On error, -1 is returned. - */ -static int X11_URIDecode(char *buf, int len) -{ - int ri, wi, di; - char decode = '\0'; - if (!buf || len < 0) { - errno = EINVAL; - return -1; - } - if (len == 0) { - len = SDL_strlen(buf); - } - for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) { - if (di == 0) { - /* start decoding */ - if (buf[ri] == '%') { - decode = '\0'; - di += 1; - continue; - } - /* normal write */ - buf[wi] = buf[ri]; - wi += 1; - continue; - } else if (di == 1 || di == 2) { - char off = '\0'; - char isa = buf[ri] >= 'a' && buf[ri] <= 'f'; - char isA = buf[ri] >= 'A' && buf[ri] <= 'F'; - char isn = buf[ri] >= '0' && buf[ri] <= '9'; - if (!(isa || isA || isn)) { - /* not a hexadecimal */ - int sri; - for (sri = ri - di; sri <= ri; sri += 1) { - buf[wi] = buf[sri]; - wi += 1; - } - di = 0; - continue; - } - /* itsy bitsy magicsy */ - if (isn) { - off = 0 - '0'; - } else if (isa) { - off = 10 - 'a'; - } else if (isA) { - off = 10 - 'A'; - } - decode |= (buf[ri] + off) << (2 - di) * 4; - if (di == 2) { - buf[wi] = decode; - wi += 1; - di = 0; - } else { - di += 1; - } - continue; - } - } - buf[wi] = '\0'; - return wi; -} - -/* Convert URI to local filename - return filename if possible, else NULL -*/ -static char *X11_URIToLocal(char *uri) -{ - char *file = NULL; - SDL_bool local; - - if (SDL_memcmp(uri, "file:/", 6) == 0) { - uri += 6; /* local file? */ - } else if (SDL_strstr(uri, ":/") != NULL) { - return file; /* wrong scheme */ - } - - local = uri[0] != '/' || (uri[0] != '\0' && uri[1] == '/'); - - /* got a hostname? */ - if (!local && uri[0] == '/' && uri[2] != '/') { - char *hostname_end = SDL_strchr(uri + 1, '/'); - if (hostname_end) { - char hostname[257]; - if (gethostname(hostname, 255) == 0) { - hostname[256] = '\0'; - if (SDL_memcmp(uri + 1, hostname, hostname_end - (uri + 1)) == 0) { - uri = hostname_end + 1; - local = SDL_TRUE; - } - } - } - } - if (local) { - file = uri; - /* Convert URI escape sequences to real characters */ - X11_URIDecode(file, 0); - if (uri[1] == '/') { - file++; - } else { - file--; - } - } - return file; -} - /* An X11 event hook */ static SDL_X11EventHook g_X11EventHook = NULL; static void *g_X11EventHookData = NULL; @@ -1886,9 +1770,8 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) if (SDL_strcmp("text/plain", name) == 0) { SDL_SendDropText(data->window, token); } else if (SDL_strcmp("text/uri-list", name) == 0) { - char *fn = X11_URIToLocal(token); - if (fn) { - SDL_SendDropFile(data->window, NULL, fn); + if (SDL_URIToLocal(token, token) >= 0) { + SDL_SendDropFile(data->window, NULL, token); } } token = SDL_strtok_r(NULL, "\r\n", &saveptr); From 596651f13a234b6ef66ad8f02b332d16922914ad Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 26 Jun 2024 19:51:00 -0400 Subject: [PATCH 073/431] dialog: Decodes percent encoded URI paths returned by the xdg file portal --- src/dialog/unix/SDL_portaldialog.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/dialog/unix/SDL_portaldialog.c b/src/dialog/unix/SDL_portaldialog.c index d9717750b8e17..ece4e39db8ca3 100644 --- a/src/dialog/unix/SDL_portaldialog.c +++ b/src/dialog/unix/SDL_portaldialog.c @@ -22,6 +22,7 @@ #include "../SDL_dialog_utils.h" #include "../../core/linux/SDL_dbus.h" +#include "../../core/unix/SDL_uri_decode.h" #ifdef SDL_USE_LIBDBUS @@ -226,8 +227,6 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m while (dbus->message_iter_get_arg_type(&uri_entry) == DBUS_TYPE_STRING) { - const char *prefix = "file://"; - const int prefix_len = 7; const char *uri = NULL; if (current >= length - 1) { @@ -242,10 +241,12 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m dbus->message_iter_get_basic(&uri_entry, &uri); /* https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.FileChooser.html */ - /* Returned paths will always start with 'file://'; truncate it */ - if (SDL_strncmp(uri, prefix, prefix_len) == 0) { - path[current] = uri + prefix_len; - } else if (SDL_strstr(uri, "://")) { + /* Returned paths will always start with 'file://'; SDL_URIToLocal() truncates it. */ + char *decoded_uri = SDL_malloc(SDL_strlen(uri) + 1); + if (SDL_URIToLocal(uri, decoded_uri)) { + path[current] = decoded_uri; + } else { + SDL_free(decoded_uri); SDL_SetError("Portal dialogs: Unsupported protocol: %s", uri); signal_data->callback(signal_data->userdata, NULL, -1); goto cleanup; @@ -259,6 +260,12 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m cleanup: dbus->connection_remove_filter(conn, &DBus_MessageFilter, signal_data); + if (path) { + for (size_t i = 0; i < length; ++i) { + SDL_free((char *)path[i]); + } + } + SDL_free(path); SDL_free((void *)signal_data->path); SDL_free(signal_data); From 800c35a2c165ff0e7032392490d4cea560ea6e17 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 26 Jun 2024 21:56:40 -0400 Subject: [PATCH 074/431] dialog: Don't potentially call SDL_free() on an uninitialized value --- src/dialog/unix/SDL_portaldialog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dialog/unix/SDL_portaldialog.c b/src/dialog/unix/SDL_portaldialog.c index ece4e39db8ca3..de75719eb84f3 100644 --- a/src/dialog/unix/SDL_portaldialog.c +++ b/src/dialog/unix/SDL_portaldialog.c @@ -261,7 +261,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m dbus->connection_remove_filter(conn, &DBus_MessageFilter, signal_data); if (path) { - for (size_t i = 0; i < length; ++i) { + for (size_t i = 0; i < current; ++i) { SDL_free((char *)path[i]); } } From a4f962fd46b5b0b4ed9d5eb1e40a203cc0e5f422 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 27 Jun 2024 05:47:50 +0300 Subject: [PATCH 075/431] SDL_x11shape.c: fix build if SDL_VIDEO_DRIVER_X11_XSHAPE isn't defined Fixes : https://github.com/libsdl-org/SDL/issues/10128. --- src/video/x11/SDL_x11shape.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c index 7abe55ab3775d..0766586b1462b 100644 --- a/src/video/x11/SDL_x11shape.c +++ b/src/video/x11/SDL_x11shape.c @@ -55,9 +55,10 @@ static Uint8 *GenerateShapeMask(SDL_Surface *shape) int X11_UpdateWindowShape(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *shape) { + int result = -1; + #ifdef SDL_VIDEO_DRIVER_X11_XSHAPE SDL_WindowData *windowdata = window->driverdata; - int result = -1; /* Generate a set of spans for the region */ if (shape) { From 982feb7a65aef15e4cff157120808f439a9abdc4 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 Jun 2024 00:03:22 -0400 Subject: [PATCH 076/431] vulkan: SDL_Vulkan_CreateSurface now returns the usual int (0=ok, -1=error). Fixes #10091. --- docs/README-migration.md | 2 + include/SDL3/SDL_vulkan.h | 4 +- src/dynapi/SDL_dynapi_procs.h | 2 +- src/render/vulkan/SDL_render_vulkan.c | 2 +- src/video/SDL_sysvideo.h | 2 +- src/video/SDL_video.c | 11 ++--- src/video/android/SDL_androidvulkan.c | 24 ++++------ src/video/android/SDL_androidvulkan.h | 10 ++-- src/video/cocoa/SDL_cocoavulkan.h | 10 ++-- src/video/cocoa/SDL_cocoavulkan.m | 54 +++++++++------------ src/video/kmsdrm/SDL_kmsdrmvulkan.c | 14 +++--- src/video/kmsdrm/SDL_kmsdrmvulkan.h | 10 ++-- src/video/offscreen/SDL_offscreenvulkan.c | 58 ++++++++++------------- src/video/offscreen/SDL_offscreenvulkan.h | 2 +- src/video/uikit/SDL_uikitvulkan.h | 10 ++-- src/video/uikit/SDL_uikitvulkan.m | 30 +++++------- src/video/vivante/SDL_vivantevulkan.c | 13 +++-- src/video/vivante/SDL_vivantevulkan.h | 10 ++-- src/video/wayland/SDL_waylandvulkan.c | 24 ++++------ src/video/wayland/SDL_waylandvulkan.h | 2 +- src/video/windows/SDL_windowsvulkan.c | 24 ++++------ src/video/windows/SDL_windowsvulkan.h | 10 ++-- src/video/x11/SDL_x11vulkan.c | 34 +++++-------- src/video/x11/SDL_x11vulkan.h | 10 ++-- test/testffmpeg_vulkan.c | 5 +- test/testvulkan.c | 5 +- 26 files changed, 166 insertions(+), 216 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index f31cb356c177b..9512b2592c8cb 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -2005,6 +2005,8 @@ SDL_Vulkan_GetInstanceExtensions() no longer takes a window parameter, and no lo SDL_Vulkan_GetVkGetInstanceProcAddr() now returns `SDL_FunctionPointer` instead of `void *`, and should be cast to PFN_vkGetInstanceProcAddr. +SDL_Vulkan_CreateSurface() now returns an int (0=success, -1=error) instead of an SDL_bool (true=success, false=error). + SDL_Vulkan_CreateSurface() now takes a VkAllocationCallbacks pointer as its third parameter. If you don't have an allocator to supply, pass a NULL here to use the system default allocator (SDL2 always used the system default allocator here). SDL_Vulkan_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be used in its place. diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index 86c57751da32e..7361621297c47 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -172,14 +172,14 @@ extern SDL_DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions( * allocator that creates the surface. Can be NULL. * \param surface a pointer to a VkSurfaceKHR handle to output the newly * created surface. - * \returns SDL_TRUE on success, SDL_FALSE on error. + * \returns 0 on success, -1 on error (check SDL_GetError() for specifics). * * \since This function is available since SDL 3.0.0. * * \sa SDL_Vulkan_GetInstanceExtensions * \sa SDL_Vulkan_DestroySurface */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, +extern SDL_DECLSPEC int SDLCALL SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR* surface); diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index a1528faeba295..9206f567bc5e9 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -862,7 +862,7 @@ SDL_DYNAPI_PROC(int,SDL_UpdateTexture,(SDL_Texture *a, const SDL_Rect *b, const SDL_DYNAPI_PROC(int,SDL_UpdateWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_UpdateWindowSurfaceRects,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_UpdateYUVTexture,(SDL_Texture *a, const SDL_Rect *b, const Uint8 *c, int d, const Uint8 *e, int f, const Uint8 *g, int h),(a,b,c,d,e,f,g,h),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_CreateSurface,(SDL_Window *a, VkInstance b, const struct VkAllocationCallbacks *c, VkSurfaceKHR *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(int,SDL_Vulkan_CreateSurface,(SDL_Window *a, VkInstance b, const struct VkAllocationCallbacks *c, VkSurfaceKHR *d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_Vulkan_DestroySurface,(VkInstance a, VkSurfaceKHR b, const struct VkAllocationCallbacks *c),(a,b,c),) SDL_DYNAPI_PROC(char const* const*,SDL_Vulkan_GetInstanceExtensions,(Uint32 *a),(a),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_Vulkan_GetVkGetInstanceProcAddr,(void),(),return) diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index e1931242447b8..a7dba54ab7230 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -1761,7 +1761,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert if (rendererData->surface) { rendererData->surface_external = SDL_TRUE; } else { - if (!device->Vulkan_CreateSurface || !device->Vulkan_CreateSurface(device, renderer->window, rendererData->instance, NULL, &rendererData->surface)) { + if (!device->Vulkan_CreateSurface || (device->Vulkan_CreateSurface(device, renderer->window, rendererData->instance, NULL, &rendererData->surface) < 0)) { VULKAN_DestroyAll(renderer); SDL_LogError(SDL_LOG_CATEGORY_RENDER, "Vulkan_CreateSurface() failed.\n"); return VK_ERROR_UNKNOWN; diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index b49a1501ce20a..91c86cd02b6f0 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -302,7 +302,7 @@ struct SDL_VideoDevice int (*Vulkan_LoadLibrary)(SDL_VideoDevice *_this, const char *path); void (*Vulkan_UnloadLibrary)(SDL_VideoDevice *_this); char const* const* (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count); - SDL_bool (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface); + int (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface); void (*Vulkan_DestroySurface)(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); /* * * */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 37628f086084b..e7c5111f6991e 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5462,7 +5462,7 @@ char const* const* SDL_Vulkan_GetInstanceExtensions(Uint32 *count) return _this->Vulkan_GetInstanceExtensions(_this, count); } -SDL_bool SDL_Vulkan_CreateSurface(SDL_Window *window, +int SDL_Vulkan_CreateSurface(SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) @@ -5470,18 +5470,15 @@ SDL_bool SDL_Vulkan_CreateSurface(SDL_Window *window, CHECK_WINDOW_MAGIC(window, SDL_FALSE); if (!(window->flags & SDL_WINDOW_VULKAN)) { - SDL_SetError(NOT_A_VULKAN_WINDOW); - return SDL_FALSE; + return SDL_SetError(NOT_A_VULKAN_WINDOW); } if (!instance) { - SDL_InvalidParamError("instance"); - return SDL_FALSE; + return SDL_InvalidParamError("instance"); } if (!surface) { - SDL_InvalidParamError("surface"); - return SDL_FALSE; + return SDL_InvalidParamError("surface"); } return _this->Vulkan_CreateSurface(_this, window, instance, allocator, surface); diff --git a/src/video/android/SDL_androidvulkan.c b/src/video/android/SDL_androidvulkan.c index b23be101951ea..d177110869cae 100644 --- a/src/video/android/SDL_androidvulkan.c +++ b/src/video/android/SDL_androidvulkan.c @@ -122,11 +122,11 @@ char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, return extensionsForAndroid; } -SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { SDL_WindowData *windowData = window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = @@ -139,14 +139,12 @@ SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkResult result; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } if (!vkCreateAndroidSurfaceKHR) { - SDL_SetError(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME - " extension is not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME + " extension is not enabled in the Vulkan instance."); } SDL_zero(createInfo); createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR; @@ -155,11 +153,9 @@ SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, createInfo.window = windowData->native_window; result = vkCreateAndroidSurfaceKHR(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateAndroidSurfaceKHR failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateAndroidSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); } - return SDL_TRUE; + return 0; } void Android_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/android/SDL_androidvulkan.h b/src/video/android/SDL_androidvulkan.h index eed91490761e9..7bc5e21940e12 100644 --- a/src/video/android/SDL_androidvulkan.h +++ b/src/video/android/SDL_androidvulkan.h @@ -38,11 +38,11 @@ int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void Android_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/src/video/cocoa/SDL_cocoavulkan.h b/src/video/cocoa/SDL_cocoavulkan.h index 158cf378fad53..3b42d4a3dcf0f 100644 --- a/src/video/cocoa/SDL_cocoavulkan.h +++ b/src/video/cocoa/SDL_cocoavulkan.h @@ -38,11 +38,11 @@ int Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void Cocoa_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/src/video/cocoa/SDL_cocoavulkan.m b/src/video/cocoa/SDL_cocoavulkan.m index f54164316e70a..710d9309cb4ec 100644 --- a/src/video/cocoa/SDL_cocoavulkan.m +++ b/src/video/cocoa/SDL_cocoavulkan.m @@ -173,18 +173,18 @@ void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) return extensionsForCocoa; } -static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface, - PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT, - PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK) +static int Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface, + PFN_vkCreateMetalSurfaceEXT vkCreateMetalSurfaceEXT, + PFN_vkCreateMacOSSurfaceMVK vkCreateMacOSSurfaceMVK) { VkResult result; SDL_MetalView metalview = Cocoa_Metal_CreateView(_this, window); if (metalview == NULL) { - return SDL_FALSE; + return -1; } if (vkCreateMetalSurfaceEXT) { @@ -197,9 +197,7 @@ static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this, result = vkCreateMetalSurfaceEXT(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { Cocoa_Metal_DestroyView(_this, metalview); - SDL_SetError("vkCreateMetalSurfaceEXT failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateMetalSurfaceEXT failed: %s", SDL_Vulkan_GetResultString(result));; } } else { VkMacOSSurfaceCreateInfoMVK createInfo = {}; @@ -211,9 +209,7 @@ static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this, NULL, surface); if (result != VK_SUCCESS) { Cocoa_Metal_DestroyView(_this, metalview); - SDL_SetError("vkCreateMacOSSurfaceMVK failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateMacOSSurfaceMVK failed: %s", SDL_Vulkan_GetResultString(result)); } } @@ -227,14 +223,14 @@ static SDL_bool Cocoa_Vulkan_CreateSurfaceViaMetalView(SDL_VideoDevice *_this, * knowledge of Metal can proceed. */ CFBridgingRelease(metalview); - return SDL_TRUE; + return 0; // success! } -SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; @@ -249,14 +245,12 @@ SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkResult result; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } if (!vkCreateMetalSurfaceEXT && !vkCreateMacOSSurfaceMVK) { - SDL_SetError(VK_EXT_METAL_SURFACE_EXTENSION_NAME " or " VK_MVK_MACOS_SURFACE_EXTENSION_NAME - " extensions are not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_EXT_METAL_SURFACE_EXTENSION_NAME " or " VK_MVK_MACOS_SURFACE_EXTENSION_NAME + " extensions are not enabled in the Vulkan instance."); } if (window->flags & SDL_WINDOW_EXTERNAL) { @@ -274,9 +268,7 @@ SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, createInfo.pLayer = (CAMetalLayer *)data.sdlContentView.layer; result = vkCreateMetalSurfaceEXT(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateMetalSurfaceEXT failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateMetalSurfaceEXT failed: %s", SDL_Vulkan_GetResultString(result)); } } else { VkMacOSSurfaceCreateInfoMVK createInfo = {}; @@ -287,9 +279,7 @@ SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, result = vkCreateMacOSSurfaceMVK(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateMacOSSurfaceMVK failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateMacOSSurfaceMVK failed: %s", SDL_Vulkan_GetResultString(result)); } } } @@ -297,7 +287,7 @@ SDL_bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, return Cocoa_Vulkan_CreateSurfaceViaMetalView(_this, window, instance, allocator, surface, vkCreateMetalSurfaceEXT, vkCreateMacOSSurfaceMVK); } - return SDL_TRUE; + return 0; } void Cocoa_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.c b/src/video/kmsdrm/SDL_kmsdrmvulkan.c index 1590de1f98944..eb68199258d17 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.c +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.c @@ -158,11 +158,11 @@ char const* const* KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, /* KMSDRM_Vulkan_GetInstanceExtensions(), like we do with */ /* VK_KHR_DISPLAY_EXTENSION_NAME, which is what we need for x-less VK. */ /***********************************************************************/ -SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { VkPhysicalDevice gpu = NULL; uint32_t gpu_count; @@ -190,7 +190,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkDisplayPlaneAlphaFlagBitsKHR alpha_mode = VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR; VkResult result; - SDL_bool ret = SDL_FALSE; + SDL_bool ret = -1; SDL_bool valid_gpu = SDL_FALSE; SDL_bool mode_found = SDL_FALSE; SDL_bool plane_supports_display = SDL_FALSE; @@ -483,7 +483,7 @@ SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, goto clean; } - ret = SDL_TRUE; + ret = 0; // success! clean: if (physical_devices) { diff --git a/src/video/kmsdrm/SDL_kmsdrmvulkan.h b/src/video/kmsdrm/SDL_kmsdrmvulkan.h index b8dfd591a782b..bdb476b8496bb 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvulkan.h +++ b/src/video/kmsdrm/SDL_kmsdrmvulkan.h @@ -38,11 +38,11 @@ int KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void KMSDRM_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/src/video/offscreen/SDL_offscreenvulkan.c b/src/video/offscreen/SDL_offscreenvulkan.c index 380acad26c707..ec33186d20f55 100644 --- a/src/video/offscreen/SDL_offscreenvulkan.c +++ b/src/video/offscreen/SDL_offscreenvulkan.c @@ -214,44 +214,38 @@ char const *const *OFFSCREEN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this return returnExtensions; } -SDL_bool OFFSCREEN_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int OFFSCREEN_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { surface = NULL; - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } - vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; - { - PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT = - (PFN_vkCreateHeadlessSurfaceEXT)vkGetInstanceProcAddr(instance, - "vkCreateHeadlessSurfaceEXT"); - VkHeadlessSurfaceCreateInfoEXT createInfo; - VkResult result; - if (!vkCreateHeadlessSurfaceEXT) { - /*This may be surprising to the consumer when HEADLESS_SURFACE_EXTENSION_REQUIRED_TO_LOAD == 0 - But this is the tradeoff for allowing offscreen rendering to a buffer to continue working without requiring the extension during driver load*/ - SDL_SetError(VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME - " extension is not enabled in the Vulkan instance."); - return SDL_FALSE; - } - SDL_zero(createInfo); - createInfo.sType = VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT; - createInfo.pNext = NULL; - createInfo.flags = 0; - result = vkCreateHeadlessSurfaceEXT(instance, &createInfo, allocator, surface); - if (result != VK_SUCCESS) { - SDL_SetError("vkCreateHeadlessSurfaceEXT failed: %s", SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; - } - return SDL_TRUE; + + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; + PFN_vkCreateHeadlessSurfaceEXT vkCreateHeadlessSurfaceEXT = + (PFN_vkCreateHeadlessSurfaceEXT)vkGetInstanceProcAddr(instance, "vkCreateHeadlessSurfaceEXT"); + VkHeadlessSurfaceCreateInfoEXT createInfo; + VkResult result; + if (!vkCreateHeadlessSurfaceEXT) { + /* This may be surprising to the consumer when HEADLESS_SURFACE_EXTENSION_REQUIRED_TO_LOAD == 0 + But this is the tradeoff for allowing offscreen rendering to a buffer to continue working without requiring the extension during driver load */ + return SDL_SetError(VK_EXT_HEADLESS_SURFACE_EXTENSION_NAME + " extension is not enabled in the Vulkan instance."); + } + SDL_zero(createInfo); + createInfo.sType = VK_STRUCTURE_TYPE_HEADLESS_SURFACE_CREATE_INFO_EXT; + createInfo.pNext = NULL; + createInfo.flags = 0; + result = vkCreateHeadlessSurfaceEXT(instance, &createInfo, allocator, surface); + if (result != VK_SUCCESS) { + return SDL_SetError("vkCreateHeadlessSurfaceEXT failed: %s", SDL_Vulkan_GetResultString(result)); } + return 0; } void OFFSCREEN_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/offscreen/SDL_offscreenvulkan.h b/src/video/offscreen/SDL_offscreenvulkan.h index bbcafa5f2a7a2..a7f70c5316e7e 100644 --- a/src/video/offscreen/SDL_offscreenvulkan.h +++ b/src/video/offscreen/SDL_offscreenvulkan.h @@ -30,7 +30,7 @@ extern int OFFSCREEN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); extern void OFFSCREEN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); extern char const *const *OFFSCREEN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -extern SDL_bool OFFSCREEN_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface); +extern int OFFSCREEN_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface); extern void OFFSCREEN_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); #endif /* SDL_VIDEO_DRIVER_OFFSCREEN && SDL_VIDEO_VULKAN */ diff --git a/src/video/uikit/SDL_uikitvulkan.h b/src/video/uikit/SDL_uikitvulkan.h index 71509708a9b04..29c20f4754982 100644 --- a/src/video/uikit/SDL_uikitvulkan.h +++ b/src/video/uikit/SDL_uikitvulkan.h @@ -38,11 +38,11 @@ int UIKit_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void UIKit_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/src/video/uikit/SDL_uikitvulkan.m b/src/video/uikit/SDL_uikitvulkan.m index 9d624843bce05..cab1c75873b7c 100644 --- a/src/video/uikit/SDL_uikitvulkan.m +++ b/src/video/uikit/SDL_uikitvulkan.m @@ -179,11 +179,11 @@ void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) return extensionsForUIKit; } -SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; @@ -199,19 +199,17 @@ SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_MetalView metalview; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } if (!vkCreateMetalSurfaceEXT && !vkCreateIOSSurfaceMVK) { - SDL_SetError(VK_EXT_METAL_SURFACE_EXTENSION_NAME " or " VK_MVK_IOS_SURFACE_EXTENSION_NAME - " extensions are not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_EXT_METAL_SURFACE_EXTENSION_NAME " or " VK_MVK_IOS_SURFACE_EXTENSION_NAME + " extensions are not enabled in the Vulkan instance."); } metalview = UIKit_Metal_CreateView(_this, window); if (metalview == NULL) { - return SDL_FALSE; + return -1; } if (vkCreateMetalSurfaceEXT) { @@ -224,9 +222,7 @@ SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, result = vkCreateMetalSurfaceEXT(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { UIKit_Metal_DestroyView(_this, metalview); - SDL_SetError("vkCreateMetalSurfaceEXT failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateMetalSurfaceEXT failed: %s", SDL_Vulkan_GetResultString(result)); } } else { VkIOSSurfaceCreateInfoMVK createInfo = {}; @@ -238,9 +234,7 @@ SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, allocator, surface); if (result != VK_SUCCESS) { UIKit_Metal_DestroyView(_this, metalview); - SDL_SetError("vkCreateIOSSurfaceMVK failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateIOSSurfaceMVK failed: %s", SDL_Vulkan_GetResultString(result)); } } @@ -254,7 +248,7 @@ SDL_bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this, * knowledge of Metal can proceed. */ CFBridgingRelease(metalview); - return SDL_TRUE; + return 0; } void UIKit_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/vivante/SDL_vivantevulkan.c b/src/video/vivante/SDL_vivantevulkan.c index 752a64860e9dc..d1a7ef7cc0a0c 100644 --- a/src/video/vivante/SDL_vivantevulkan.c +++ b/src/video/vivante/SDL_vivantevulkan.c @@ -129,15 +129,14 @@ char const* const* VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, return extensionsForVivante; } -SDL_bool VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } return SDL_Vulkan_Display_CreateSurface(_this->vulkan_config.vkGetInstanceProcAddr, instance, allocator, surface); } diff --git a/src/video/vivante/SDL_vivantevulkan.h b/src/video/vivante/SDL_vivantevulkan.h index b73ad549e27f1..3c78f60499763 100644 --- a/src/video/vivante/SDL_vivantevulkan.h +++ b/src/video/vivante/SDL_vivantevulkan.h @@ -37,11 +37,11 @@ int VIVANTE_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void VIVANTE_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/src/video/wayland/SDL_waylandvulkan.c b/src/video/wayland/SDL_waylandvulkan.c index 2c6950a2b7410..1bcb262dce961 100644 --- a/src/video/wayland/SDL_waylandvulkan.c +++ b/src/video/wayland/SDL_waylandvulkan.c @@ -128,11 +128,11 @@ char const* const* Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, return extensionsForWayland; } -SDL_bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { SDL_WindowData *windowData = window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = @@ -145,14 +145,12 @@ SDL_bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkResult result; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } if (!vkCreateWaylandSurfaceKHR) { - SDL_SetError(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME - " extension is not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME + " extension is not enabled in the Vulkan instance."); } SDL_zero(createInfo); createInfo.sType = VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR; @@ -162,11 +160,9 @@ SDL_bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, createInfo.surface = windowData->surface; result = vkCreateWaylandSurfaceKHR(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateWaylandSurfaceKHR failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateWaylandSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); } - return SDL_TRUE; + return 0; } void Wayland_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/wayland/SDL_waylandvulkan.h b/src/video/wayland/SDL_waylandvulkan.h index a4b7d14769e4f..85d2adaee197a 100644 --- a/src/video/wayland/SDL_waylandvulkan.h +++ b/src/video/wayland/SDL_waylandvulkan.h @@ -37,7 +37,7 @@ int Wayland_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, +int Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, diff --git a/src/video/windows/SDL_windowsvulkan.c b/src/video/windows/SDL_windowsvulkan.c index 7aa28c935a5e5..1584c526b0297 100644 --- a/src/video/windows/SDL_windowsvulkan.c +++ b/src/video/windows/SDL_windowsvulkan.c @@ -120,11 +120,11 @@ char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, return extensionsForWin32; } -SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { SDL_WindowData *windowData = window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = @@ -137,14 +137,12 @@ SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkResult result; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } if (!vkCreateWin32SurfaceKHR) { - SDL_SetError(VK_KHR_WIN32_SURFACE_EXTENSION_NAME - " extension is not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_KHR_WIN32_SURFACE_EXTENSION_NAME + " extension is not enabled in the Vulkan instance."); } createInfo.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR; createInfo.pNext = NULL; @@ -153,11 +151,9 @@ SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, createInfo.hwnd = windowData->hwnd; result = vkCreateWin32SurfaceKHR(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateWin32SurfaceKHR failed: %s", - SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateWin32SurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); } - return SDL_TRUE; + return 0; } void WIN_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/windows/SDL_windowsvulkan.h b/src/video/windows/SDL_windowsvulkan.h index 86ff9981471e2..474a6fce4c656 100644 --- a/src/video/windows/SDL_windowsvulkan.h +++ b/src/video/windows/SDL_windowsvulkan.h @@ -37,11 +37,11 @@ int WIN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void WIN_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/src/video/x11/SDL_x11vulkan.c b/src/video/x11/SDL_x11vulkan.c index ef0d87259de48..25d4f90f789b5 100644 --- a/src/video/x11/SDL_x11vulkan.c +++ b/src/video/x11/SDL_x11vulkan.c @@ -167,18 +167,17 @@ char const* const* X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, } } -SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { SDL_VideoData *videoData = _this->driverdata; SDL_WindowData *windowData = window->driverdata; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; if (!_this->vulkan_config.loader_handle) { - SDL_SetError("Vulkan is not loaded"); - return SDL_FALSE; + return SDL_SetError("Vulkan is not loaded"); } vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; if (videoData->vulkan_xlib_xcb_library) { @@ -188,24 +187,19 @@ SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkXcbSurfaceCreateInfoKHR createInfo; VkResult result; if (!vkCreateXcbSurfaceKHR) { - SDL_SetError(VK_KHR_XCB_SURFACE_EXTENSION_NAME - " extension is not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_KHR_XCB_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); } SDL_zero(createInfo); createInfo.sType = VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR; createInfo.connection = videoData->vulkan_XGetXCBConnection(videoData->display); if (!createInfo.connection) { - SDL_SetError("XGetXCBConnection failed"); - return SDL_FALSE; + return SDL_SetError("XGetXCBConnection failed"); } createInfo.window = (xcb_window_t)windowData->xwindow; result = vkCreateXcbSurfaceKHR(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateXcbSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateXcbSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); } - return SDL_TRUE; } else { PFN_vkCreateXlibSurfaceKHR vkCreateXlibSurfaceKHR = (PFN_vkCreateXlibSurfaceKHR)vkGetInstanceProcAddr(instance, @@ -213,9 +207,7 @@ SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, VkXlibSurfaceCreateInfoKHR createInfo; VkResult result; if (!vkCreateXlibSurfaceKHR) { - SDL_SetError(VK_KHR_XLIB_SURFACE_EXTENSION_NAME - " extension is not enabled in the Vulkan instance."); - return SDL_FALSE; + return SDL_SetError(VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); } SDL_zero(createInfo); createInfo.sType = VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR; @@ -223,11 +215,11 @@ SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, createInfo.window = (xcb_window_t)windowData->xwindow; result = vkCreateXlibSurfaceKHR(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { - SDL_SetError("vkCreateXlibSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + return SDL_SetError("vkCreateXlibSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); } - return SDL_TRUE; } + + return 0; // success! } void X11_Vulkan_DestroySurface(SDL_VideoDevice *_this, diff --git a/src/video/x11/SDL_x11vulkan.h b/src/video/x11/SDL_x11vulkan.h index 47dea0f348d7d..217ea726d9439 100644 --- a/src/video/x11/SDL_x11vulkan.h +++ b/src/video/x11/SDL_x11vulkan.h @@ -34,11 +34,11 @@ int X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path); void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this); char const* const* X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count); -SDL_bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, - SDL_Window *window, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +int X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, + SDL_Window *window, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); void X11_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c index fb9e224608d32..5ffaf589f91cf 100644 --- a/test/testffmpeg_vulkan.c +++ b/test/testffmpeg_vulkan.c @@ -253,10 +253,7 @@ static int createInstance(VulkanVideoContext *context) static int createSurface(VulkanVideoContext *context, SDL_Window *window) { - if (!SDL_Vulkan_CreateSurface(window, - context->instance, - NULL, - &context->surface)) { + if (SDL_Vulkan_CreateSurface(window, context->instance, NULL, &context->surface) < 0) { context->surface = VK_NULL_HANDLE; return -1; } diff --git a/test/testvulkan.c b/test/testvulkan.c index 7b38fb9b6d0af..e6c7bc432f8e0 100644 --- a/test/testvulkan.c +++ b/test/testvulkan.c @@ -259,10 +259,7 @@ static void loadInstanceFunctions(void) static void createSurface(void) { - if (!SDL_Vulkan_CreateSurface(vulkanContext->window, - vulkanContext->instance, - NULL, - &vulkanContext->surface)) { + if (SDL_Vulkan_CreateSurface(vulkanContext->window, vulkanContext->instance, NULL, &vulkanContext->surface) < 0) { vulkanContext->surface = VK_NULL_HANDLE; SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "SDL_Vulkan_CreateSurface(): %s\n", SDL_GetError()); quit(2); From 5631c6dbaaafb532a75654e0da4b9846940ca5d6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 Jun 2024 17:20:11 -0400 Subject: [PATCH 077/431] testaudio: Don't crash if SDL_GetAudioDeviceName() returns NULL. It definitely will for default devices, so this crash is real, but it's also good defensive coding if something blows up unexpectedly. Fixes #10130. --- test/testaudio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/testaudio.c b/test/testaudio.c index c2951acafc518..f32ea28f70be2 100644 --- a/test/testaudio.c +++ b/test/testaudio.c @@ -983,9 +983,13 @@ static Thing *CreatePhysicalDeviceThing(const SDL_AudioDeviceID which, const SDL SDL_Log("Adding physical audio device %u", (unsigned int) which); thing = CreateThing(recording ? THING_PHYSDEV_RECORDING : THING_PHYSDEV, next_physdev_x, 170, 5, -1, -1, physdev_texture, NULL); if (thing) { + const char *name = SDL_GetAudioDeviceName(which); + if (!name) { + name = "[Unnamed device]"; + } thing->data.physdev.devid = which; thing->data.physdev.recording = recording; - thing->data.physdev.name = SDL_strdup(SDL_GetAudioDeviceName(which)); + thing->data.physdev.name = SDL_strdup(name); thing->ondrag = DeviceThing_ondrag; thing->ondrop = PhysicalDeviceThing_ondrop; thing->ontick = PhysicalDeviceThing_ontick; From 9b8c5f642f51465663dae13c90d719e62517cb3c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 Jun 2024 17:24:49 -0400 Subject: [PATCH 078/431] testaudio: Better fix for NULL dereference. This code already handled NULL fine, it just got wrapped in a SDL_strdup call in e23257307e220c7dd3d827e195f52adaabaaeeeb, so make that SDL_strdup check for NULL first. --- test/testaudio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/testaudio.c b/test/testaudio.c index f32ea28f70be2..9f8d561e66d3a 100644 --- a/test/testaudio.c +++ b/test/testaudio.c @@ -984,12 +984,9 @@ static Thing *CreatePhysicalDeviceThing(const SDL_AudioDeviceID which, const SDL thing = CreateThing(recording ? THING_PHYSDEV_RECORDING : THING_PHYSDEV, next_physdev_x, 170, 5, -1, -1, physdev_texture, NULL); if (thing) { const char *name = SDL_GetAudioDeviceName(which); - if (!name) { - name = "[Unnamed device]"; - } thing->data.physdev.devid = which; thing->data.physdev.recording = recording; - thing->data.physdev.name = SDL_strdup(name); + thing->data.physdev.name = name ? SDL_strdup(name) : NULL; thing->ondrag = DeviceThing_ondrag; thing->ondrop = PhysicalDeviceThing_ondrop; thing->ontick = PhysicalDeviceThing_ontick; From a9cfcf6bdef8738d0746f0b0d76fac8a95a84eed Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 26 Jun 2024 21:32:45 -0400 Subject: [PATCH 079/431] stdinc: Drastically improve SDL_StepUTF8() and make it a public API. Fixes #10105. --- include/SDL3/SDL_stdinc.h | 61 +++++++++++++++++ src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/filesystem/SDL_filesystem.c | 2 +- src/stdlib/SDL_string.c | 109 ++++++++++++++++++++---------- src/stdlib/SDL_sysstdlib.h | 2 - test/testiconv.c | 94 ++++++++++++++++++++------ 8 files changed, 212 insertions(+), 59 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index a45958b2992b8..532fc97fcce0c 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1250,6 +1250,67 @@ extern SDL_DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str */ extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen); +/** + * The Unicode REPLACEMENT CHARACTER codepoint. + * + * SDL_StepUTF8() reports this codepoint when it encounters a UTF-8 string + * with encoding errors. + * + * This tends to render as something like a question mark in most places. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_StepUTF8 + */ +#define SDL_INVALID_UNICODE_CODEPOINT 0xFFFD + +/** + * Decode a UTF-8 string, one Unicode codepoint at a time. + * + * This will return the first Unicode codepoint in the UTF-8 encoded + * string in `*pstr`, and then advance `*pstr` past any consumed bytes + * before returning. + * + * It will not access more than `*pslen` bytes from the string. + * `*pslen` will be adjusted, as well, subtracting the number of + * bytes consumed. + * + * `pslen` is allowed to be NULL, in which case the string _must_ be + * NULL-terminated, as the function will blindly read until it sees + * the NULL char. + * + * if `*pslen` is zero, it assumes the end of string is reached and + * returns a zero codepoint regardless of the contents of the string + * buffer. + * + * If the resulting codepoint is zero (a NULL terminator), or `*pslen` + * is zero, it will not advance `*pstr` or `*pslen` at all. + * + * Generally this function is called in a loop until it returns zero, + * adjusting its parameters each iteration. + * + * If an invalid UTF-8 sequence is encountered, this function returns + * SDL_INVALID_UNICODE_CODEPOINT and advances the string/length by one + * byte (which is to say, a multibyte sequence might produce several + * SDL_INVALID_UNICODE_CODEPOINT returns before it syncs to the next + * valid UTF-8 sequence). + * + * Several things can generate invalid UTF-8 sequences, including + * overlong encodings, the use of UTF-16 surrogate values, and + * truncated data. Please refer to + * [RFC3629](https://www.ietf.org/rfc/rfc3629.txt) for details. + * + * \param pstr a pointer to a UTF-8 string pointer to be read and adjusted. + * \param pslen a pointer to the number of bytes in the string, to be read + * and adjusted. NULL is allowed. + * \returns the first Unicode codepoint in the string. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepUTF8(const char **pstr, size_t *pslen); + extern SDL_DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); extern SDL_DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2); extern SDL_DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index e3bcc9d445873..f6ce6ba8be5dc 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -788,6 +788,7 @@ SDL3_0.0.0 { SDL_SignalCondition; SDL_SoftStretch; SDL_StartTextInput; + SDL_StepUTF8; SDL_StopHapticEffect; SDL_StopHapticEffects; SDL_StopHapticRumble; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 2d71ca64a5b80..8e238965b6681 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -813,6 +813,7 @@ #define SDL_SignalCondition SDL_SignalCondition_REAL #define SDL_SoftStretch SDL_SoftStretch_REAL #define SDL_StartTextInput SDL_StartTextInput_REAL +#define SDL_StepUTF8 SDL_StepUTF8_REAL #define SDL_StopHapticEffect SDL_StopHapticEffect_REAL #define SDL_StopHapticEffects SDL_StopHapticEffects_REAL #define SDL_StopHapticRumble SDL_StopHapticRumble_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 9206f567bc5e9..4780080bbf414 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -823,6 +823,7 @@ SDL_DYNAPI_PROC(int,SDL_ShowWindowSystemMenu,(SDL_Window *a, int b, int c),(a,b, SDL_DYNAPI_PROC(int,SDL_SignalCondition,(SDL_Condition *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SoftStretch,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_StartTextInput,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(Uint32,SDL_StepUTF8,(const char **a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_StopHapticEffect,(SDL_Haptic *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_StopHapticEffects,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(int,SDL_StopHapticRumble,(SDL_Haptic *a),(a),return) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index d038d2840af57..4310bbb6a69a0 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -185,7 +185,7 @@ static char *CaseFoldUtf8String(const char *fname) Uint32 codepoint; char *ptr = retval; size_t remaining = allocation; - while ((codepoint = SDL_StepUTF8(&fname, 4)) != 0) { + while ((codepoint = SDL_StepUTF8(&fname, NULL)) != 0) { Uint32 folded[3]; const int num_folded = SDL_CaseFoldUnicode(codepoint, folded); SDL_assert(num_folded > 0); diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index fd494fdcbb3e8..554a746ff45d6 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -32,9 +32,6 @@ #include "SDL_casefolding.h" -// this is the Unicode REPLACEMENT CHARACTER, used for invalid codepoint values. -#define INVALID_UNICODE_CODEPOINT 0xFFFD - #if defined(__SIZEOF_WCHAR_T__) #define SDL_SIZEOF_WCHAR_T __SIZEOF_WCHAR_T__ #elif defined(SDL_PLATFORM_WINDOWS) @@ -129,7 +126,7 @@ int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to) cp1 = folded1[tail1++]; \ } else { \ const Uint##bits *str1start = (const Uint##bits *) str1; \ - head1 = SDL_CaseFoldUnicode(SDL_StepUTF##bits(&str1, slen1), folded1); \ + head1 = SDL_CaseFoldUnicode(StepUTF##bits(&str1, slen1), folded1); \ update_slen1; \ cp1 = folded1[0]; \ tail1 = 1; \ @@ -138,7 +135,7 @@ int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to) cp2 = folded2[tail2++]; \ } else { \ const Uint##bits *str2start = (const Uint##bits *) str2; \ - head2 = SDL_CaseFoldUnicode(SDL_StepUTF##bits(&str2, slen2), folded2); \ + head2 = SDL_CaseFoldUnicode(StepUTF##bits(&str2, slen2), folded2); \ update_slen2; \ cp2 = folded2[0]; \ tail2 = 1; \ @@ -154,12 +151,23 @@ int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to) return 0 -Uint32 SDL_StepUTF8(const char **_str, const size_t slen) +static Uint32 StepUTF8(const char **_str, const size_t slen) { - const char *str = *_str; - const Uint32 octet = (Uint32) (slen ? ((Uint8) *str) : 0); - - // !!! FIXME: this could have _way_ more error checking! Illegal surrogate codepoints, unexpected bit patterns, etc. + /* + * From rfc3629, the UTF-8 spec: + * https://www.ietf.org/rfc/rfc3629.txt + * + * Char. number range | UTF-8 octet sequence + * (hexadecimal) | (binary) + * --------------------+--------------------------------------------- + * 0000 0000-0000 007F | 0xxxxxxx + * 0000 0080-0000 07FF | 110xxxxx 10xxxxxx + * 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx + * 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx + */ + + const Uint8 *str = (const Uint8 *) *_str; + const Uint32 octet = (Uint32) (slen ? *str : 0); if (octet == 0) { // null terminator, end of string. return 0; // don't advance `*_str`. @@ -167,41 +175,73 @@ Uint32 SDL_StepUTF8(const char **_str, const size_t slen) (*_str)++; return octet; } else if (((octet & 0xE0) == 0xC0) && (slen >= 2)) { // 110xxxxx 10xxxxxx: two byte codepoint. - if (slen >= 2) { - *_str += 2; - return ((octet & 0x1F) << 6) | (((Uint8) str[1]) & 0x3F); + const Uint8 str1 = str[1]; + if ((str1 & 0xC0) == 0x80) { // If trailing bytes aren't 10xxxxxx, sequence is bogus. + const Uint32 retval = ((octet & 0x1F) << 6) | (str1 & 0x3F); + if (retval >= 0x0080) { // rfc3629 says you can't use overlong sequences for smaller values. + *_str += 2; + return retval; + } } } else if (((octet & 0xF0) == 0xE0) && (slen >= 3)) { // 1110xxxx 10xxxxxx 10xxxxxx: three byte codepoint. - *_str += 3; - const Uint32 octet2 = ((Uint32) (((Uint8) str[1]) & 0x1F)) << 6; - const Uint32 octet3 = (Uint32) (((Uint8) str[2]) & 0x3F); - return ((octet & 0x0F) << 12) | octet2 | octet3; + const Uint8 str1 = str[1]; + const Uint8 str2 = str[2]; + if (((str1 & 0xC0) == 0x80) && ((str2 & 0xC0) == 0x80)) { // If trailing bytes aren't 10xxxxxx, sequence is bogus. + const Uint32 octet2 = ((Uint32) (str1 & 0x3F)) << 6; + const Uint32 octet3 = ((Uint32) (str2 & 0x3F)); + const Uint32 retval = ((octet & 0x0F) << 12) | octet2 | octet3; + if (retval >= 0x800) { // rfc3629 says you can't use overlong sequences for smaller values. + if ((retval < 0xD800) || (retval > 0xDFFF)) { // UTF-16 surrogate values are illegal in UTF-8. + *_str += 3; + return retval; + } + } + } } else if (((octet & 0xF8) == 0xF0) && (slen >= 4)) { // 11110xxxx 10xxxxxx 10xxxxxx 10xxxxxx: four byte codepoint. - *_str += 4; - const Uint32 octet2 = ((Uint32) (((Uint8) str[1]) & 0x1F)) << 12; - const Uint32 octet3 = ((Uint32) (((Uint8) str[2]) & 0x3F)) << 6; - const Uint32 octet4 = (Uint32) (((Uint8) str[3]) & 0x3F); - return ((octet & 0x07) << 18) | octet2 | octet3 | octet4; + const Uint8 str1 = str[1]; + const Uint8 str2 = str[2]; + const Uint8 str3 = str[3]; + if (((str1 & 0xC0) == 0x80) && ((str2 & 0xC0) == 0x80) && ((str3 & 0xC0) == 0x80)) { // If trailing bytes aren't 10xxxxxx, sequence is bogus. + const Uint32 octet2 = ((Uint32) (str1 & 0x1F)) << 12; + const Uint32 octet3 = ((Uint32) (str2 & 0x3F)) << 6; + const Uint32 octet4 = ((Uint32) (str3 & 0x3F)); + const Uint32 retval = ((octet & 0x07) << 18) | octet2 | octet3 | octet4; + if (retval >= 0x10000) { // rfc3629 says you can't use overlong sequences for smaller values. + *_str += 4; + return retval; + } + } } // bogus byte, skip ahead, return a REPLACEMENT CHARACTER. (*_str)++; - return INVALID_UNICODE_CODEPOINT; + return SDL_INVALID_UNICODE_CODEPOINT; +} + +Uint32 SDL_StepUTF8(const char **pstr, size_t *pslen) +{ + if (!pslen) { + return StepUTF8(pstr, 4); // 4 == max codepoint size. + } + const char *origstr = *pstr; + const Uint32 retval = StepUTF8(pstr, *pslen); + *pslen -= (size_t) (*pstr - origstr); + return retval; } #if (SDL_SIZEOF_WCHAR_T == 2) -static Uint32 SDL_StepUTF16(const Uint16 **_str, const size_t slen) +static Uint32 StepUTF16(const Uint16 **_str, const size_t slen) { const Uint16 *str = *_str; Uint32 cp = (Uint32) *(str++); if (cp == 0) { return 0; // don't advance string pointer. } else if ((cp >= 0xDC00) && (cp <= 0xDFFF)) { - cp = INVALID_UNICODE_CODEPOINT; // Orphaned second half of surrogate pair + cp = SDL_INVALID_UNICODE_CODEPOINT; // Orphaned second half of surrogate pair } else if ((cp >= 0xD800) && (cp <= 0xDBFF)) { // start of surrogate pair! const Uint32 pair = (Uint32) *str; if ((pair == 0) || ((pair < 0xDC00) || (pair > 0xDFFF))) { - cp = INVALID_UNICODE_CODEPOINT; + cp = SDL_INVALID_UNICODE_CODEPOINT; } else { str++; // eat the other surrogate. cp = 0x10000 + (((cp - 0xD800) << 10) | (pair - 0xDC00)); @@ -209,10 +249,10 @@ static Uint32 SDL_StepUTF16(const Uint16 **_str, const size_t slen) } *_str = str; - return (cp > 0x10FFFF) ? INVALID_UNICODE_CODEPOINT : cp; + return (cp > 0x10FFFF) ? SDL_INVALID_UNICODE_CODEPOINT : cp; } #elif (SDL_SIZEOF_WCHAR_T == 4) -static Uint32 SDL_StepUTF32(const Uint32 **_str, const size_t slen) +static Uint32 StepUTF32(const Uint32 **_str, const size_t slen) { if (!slen) { return 0; @@ -225,7 +265,7 @@ static Uint32 SDL_StepUTF32(const Uint32 **_str, const size_t slen) } (*_str)++; - return (cp > 0x10FFFF) ? INVALID_UNICODE_CODEPOINT : cp; + return (cp > 0x10FFFF) ? SDL_INVALID_UNICODE_CODEPOINT : cp; } #endif @@ -816,7 +856,7 @@ size_t SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size size_t SDL_utf8strlen(const char *str) { size_t retval = 0; - while (SDL_StepUTF8(&str, 4)) { + while (SDL_StepUTF8(&str, NULL)) { retval++; } return retval; @@ -825,14 +865,9 @@ size_t SDL_utf8strlen(const char *str) size_t SDL_utf8strnlen(const char *str, size_t bytes) { size_t retval = 0; - const char *strstart = str; - - while (SDL_StepUTF8(&str, bytes)) { - bytes -= (size_t) (str - strstart); - strstart = str; + while (SDL_StepUTF8(&str, &bytes)) { retval++; } - return retval; } @@ -983,7 +1018,7 @@ char *SDL_strcasestr(const char *haystack, const char *needle) if (SDL_strncasecmp(haystack, needle, length) == 0) { return (char *)haystack; } - } while (SDL_StepUTF8(&haystack, 4)); // move ahead by a full codepoint at a time, regardless of bytes. + } while (SDL_StepUTF8(&haystack, NULL)); // move ahead by a full codepoint at a time, regardless of bytes. return NULL; } diff --git a/src/stdlib/SDL_sysstdlib.h b/src/stdlib/SDL_sysstdlib.h index ef7ec0748dbe1..305fd31d304ec 100644 --- a/src/stdlib/SDL_sysstdlib.h +++ b/src/stdlib/SDL_sysstdlib.h @@ -25,8 +25,6 @@ // most things you might need internally in here are public APIs, this is // just a few special pieces right now. -Uint32 SDL_StepUTF8(const char **_str, const size_t slen); - // this expects `from` to be a Unicode codepoint, and `to` to point to AT LEAST THREE Uint32s. int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to); diff --git a/test/testiconv.c b/test/testiconv.c index b7e71edbdb8b1..54eb90245bec3 100644 --- a/test/testiconv.c +++ b/test/testiconv.c @@ -10,13 +10,6 @@ freely. */ -/* quiet windows compiler warnings */ -#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) -#define _CRT_SECURE_NO_WARNINGS -#endif - -#include - #include #include #include @@ -33,6 +26,34 @@ widelen(char *data) return len; } +static char *get_next_line(Uint8 **fdataptr, size_t *fdatalen) +{ + char *retval = (char *) *fdataptr; + Uint8 *ptr = *fdataptr; + size_t len = *fdatalen; + + if (len == 0) { + return NULL; + } + + while (len > 0) { + if (*ptr == '\r') { + *ptr = '\0'; + } else if (*ptr == '\n') { + *ptr = '\0'; + ptr++; + len--; + break; + } + ptr++; + len--; + } + + *fdataptr = ptr; + *fdatalen = len; + return retval; +} + int main(int argc, char *argv[]) { const char *formats[] = { @@ -51,13 +72,15 @@ int main(int argc, char *argv[]) }; char *fname = NULL; - char buffer[BUFSIZ]; char *ucs4; char *test[2]; int i; - FILE *file; int errors = 0; SDLTest_CommonState *state; + Uint8 *fdata = NULL; + Uint8 *fdataptr = NULL; + char *line = NULL; + size_t fdatalen = 0; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, 0); @@ -89,20 +112,19 @@ int main(int argc, char *argv[]) } fname = GetResourceFilename(fname, "utf8.txt"); - file = fopen(fname, "rb"); - if (!file) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to open %s\n", fname); + fdata = (Uint8 *) (fname ? SDL_LoadFile(fname, &fdatalen) : NULL); + if (!fdata) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load %s\n", fname); return 1; } - SDL_free(fname); - while (fgets(buffer, sizeof(buffer), file)) { + fdataptr = fdata; + while ((line = get_next_line(&fdataptr, &fdatalen)) != NULL) { /* Convert to UCS-4 */ size_t len; - ucs4 = - SDL_iconv_string("UCS-4", "UTF-8", buffer, - SDL_strlen(buffer) + 1); + ucs4 = SDL_iconv_string("UCS-4", "UTF-8", line, SDL_strlen(line) + 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); @@ -115,10 +137,44 @@ int main(int argc, char *argv[]) } test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len); SDL_free(ucs4); - (void)fputs(test[0], stdout); + SDL_Log("%s", test[0]); SDL_free(test[0]); } - (void)fclose(file); + SDL_free(fdata); + + #if 0 + { + Uint32 *ucs4buf; + Uint32 *ucs4ptr; + char *utf8out; + Uint32 cp; + SDL_IOStream *io; + + fdata = (Uint8 *) (fname ? SDL_LoadFile(fname, &fdatalen) : NULL); + if (!fdata) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load %s\n", fname); + return 1; + } + + ucs4buf = (Uint32 *) SDL_malloc(fdatalen * 4); + ucs4ptr = ucs4buf; + + fdataptr = fdata; + while ((cp = SDL_StepUTF8((const char **) &fdataptr, &fdatalen)) != 0) { + *(ucs4ptr++) = SDL_Swap32BE(cp); + } + *(ucs4ptr++) = 0; + utf8out = SDL_iconv_string("UTF-8", "UCS-4", (const char *) ucs4buf, (size_t) ((ucs4ptr - ucs4buf)) * 4); + io = SDL_IOFromFile("test_steputf8.txt", "wb"); + SDL_WriteIO(io, utf8out, SDL_strlen(utf8out)); + SDL_CloseIO(io); + SDL_free(ucs4buf); + SDL_free(utf8out); + SDL_free(fdata); + } + #endif + + SDL_free(fname); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Total errors: %d\n", errors); SDL_Quit(); From 1e0ac5771a3823aa625474383b9ef11158ad9cb5 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 26 Jun 2024 23:40:16 -0400 Subject: [PATCH 080/431] testiconv: Remove half-baked SDL_StepUTF8 testing code. --- test/testiconv.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/test/testiconv.c b/test/testiconv.c index 54eb90245bec3..e631f8bb5dc2f 100644 --- a/test/testiconv.c +++ b/test/testiconv.c @@ -141,39 +141,6 @@ int main(int argc, char *argv[]) SDL_free(test[0]); } SDL_free(fdata); - - #if 0 - { - Uint32 *ucs4buf; - Uint32 *ucs4ptr; - char *utf8out; - Uint32 cp; - SDL_IOStream *io; - - fdata = (Uint8 *) (fname ? SDL_LoadFile(fname, &fdatalen) : NULL); - if (!fdata) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to load %s\n", fname); - return 1; - } - - ucs4buf = (Uint32 *) SDL_malloc(fdatalen * 4); - ucs4ptr = ucs4buf; - - fdataptr = fdata; - while ((cp = SDL_StepUTF8((const char **) &fdataptr, &fdatalen)) != 0) { - *(ucs4ptr++) = SDL_Swap32BE(cp); - } - *(ucs4ptr++) = 0; - utf8out = SDL_iconv_string("UTF-8", "UCS-4", (const char *) ucs4buf, (size_t) ((ucs4ptr - ucs4buf)) * 4); - io = SDL_IOFromFile("test_steputf8.txt", "wb"); - SDL_WriteIO(io, utf8out, SDL_strlen(utf8out)); - SDL_CloseIO(io); - SDL_free(ucs4buf); - SDL_free(utf8out); - SDL_free(fdata); - } - #endif - SDL_free(fname); SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "Total errors: %d\n", errors); From b7ab5182d312cbc162bcdc772dc3a2ea229bb35e Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Thu, 27 Jun 2024 21:37:27 +0000 Subject: [PATCH 081/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_stdinc.h | 44 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 532fc97fcce0c..c3628cc6b74ca 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1267,42 +1267,40 @@ extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *st /** * Decode a UTF-8 string, one Unicode codepoint at a time. * - * This will return the first Unicode codepoint in the UTF-8 encoded - * string in `*pstr`, and then advance `*pstr` past any consumed bytes - * before returning. + * This will return the first Unicode codepoint in the UTF-8 encoded string in + * `*pstr`, and then advance `*pstr` past any consumed bytes before returning. * - * It will not access more than `*pslen` bytes from the string. - * `*pslen` will be adjusted, as well, subtracting the number of - * bytes consumed. + * It will not access more than `*pslen` bytes from the string. `*pslen` will + * be adjusted, as well, subtracting the number of bytes consumed. * * `pslen` is allowed to be NULL, in which case the string _must_ be - * NULL-terminated, as the function will blindly read until it sees - * the NULL char. + * NULL-terminated, as the function will blindly read until it sees the NULL + * char. * - * if `*pslen` is zero, it assumes the end of string is reached and - * returns a zero codepoint regardless of the contents of the string - * buffer. + * if `*pslen` is zero, it assumes the end of string is reached and returns a + * zero codepoint regardless of the contents of the string buffer. * - * If the resulting codepoint is zero (a NULL terminator), or `*pslen` - * is zero, it will not advance `*pstr` or `*pslen` at all. + * If the resulting codepoint is zero (a NULL terminator), or `*pslen` is + * zero, it will not advance `*pstr` or `*pslen` at all. * * Generally this function is called in a loop until it returns zero, * adjusting its parameters each iteration. * * If an invalid UTF-8 sequence is encountered, this function returns - * SDL_INVALID_UNICODE_CODEPOINT and advances the string/length by one - * byte (which is to say, a multibyte sequence might produce several - * SDL_INVALID_UNICODE_CODEPOINT returns before it syncs to the next - * valid UTF-8 sequence). + * SDL_INVALID_UNICODE_CODEPOINT and advances the string/length by one byte + * (which is to say, a multibyte sequence might produce several + * SDL_INVALID_UNICODE_CODEPOINT returns before it syncs to the next valid + * UTF-8 sequence). * - * Several things can generate invalid UTF-8 sequences, including - * overlong encodings, the use of UTF-16 surrogate values, and - * truncated data. Please refer to - * [RFC3629](https://www.ietf.org/rfc/rfc3629.txt) for details. + * Several things can generate invalid UTF-8 sequences, including overlong + * encodings, the use of UTF-16 surrogate values, and truncated data. Please + * refer to + * [RFC3629](https://www.ietf.org/rfc/rfc3629.txt) + * for details. * * \param pstr a pointer to a UTF-8 string pointer to be read and adjusted. - * \param pslen a pointer to the number of bytes in the string, to be read - * and adjusted. NULL is allowed. + * \param pslen a pointer to the number of bytes in the string, to be read and + * adjusted. NULL is allowed. * \returns the first Unicode codepoint in the string. * * \threadsafety It is safe to call this function from any thread. From 3609b159201ef733b032685db5b3b7d7e863fb8e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 11:38:01 -0700 Subject: [PATCH 082/431] Fixed showing the selected clause in the Japanese IME --- src/video/windows/SDL_windowskeyboard.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index f4c2916ae7d22..78a7b437e29da 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -769,6 +769,11 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD LONG length; DWORD dwLang = ((DWORD_PTR)videodata->ime_hkl & 0xffff); + videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); + videodata->ime_selected_start = 0; + videodata->ime_selected_length = 0; + SDL_DebugIMELog("Cursor = %d\n", videodata->ime_cursor); + length = ImmGetCompositionStringW(himc, string, NULL, 0); if (length > 0 && videodata->ime_composition_length < length) { if (videodata->ime_composition) { @@ -785,7 +790,6 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD } length /= sizeof(WCHAR); - videodata->ime_cursor = LOWORD(ImmGetCompositionStringW(himc, GCS_CURSORPOS, 0, 0)); if ((dwLang == LANG_CHT || dwLang == LANG_CHS) && videodata->ime_cursor > 0 && videodata->ime_cursor < (int)(videodata->ime_composition_length / sizeof(WCHAR)) && @@ -812,6 +816,10 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD length = 0; } + for (LONG i = 0; i < length; ++i) { + SDL_DebugIMELog("attrib[%d] = %d\n", i, attributes[i]); + } + for (start = 0; start < length; ++start) { if (attributes[start] == ATTR_TARGET_CONVERTED || attributes[start] == ATTR_TARGET_NOTCONVERTED) { break; @@ -827,19 +835,11 @@ static void IME_GetCompositionString(SDL_VideoData *videodata, HIMC himc, DWORD if (end > start) { videodata->ime_selected_start = start; videodata->ime_selected_length = end - start; - } else { - videodata->ime_selected_start = 0; - videodata->ime_selected_length = 0; } SDL_free(attributes); } } - - // Get the correct caret position if we've selected a candidate from the candidate window - if (videodata->ime_cursor == 0 && !videodata->ime_candidates_open) { - videodata->ime_cursor = videodata->ime_selected_start + videodata->ime_selected_length; - } } static void IME_SendInputEvent(SDL_VideoData *videodata) @@ -883,10 +883,12 @@ static void IME_SendEditingEvent(SDL_VideoData *videodata) s = WIN_StringToUTF8W(buffer); if (s) { - if (videodata->ime_cursor > 0 || videodata->ime_readingstring[0]) { + if (videodata->ime_readingstring[0]) { SDL_SendEditingText(s, videodata->ime_cursor, (int)SDL_wcslen(videodata->ime_readingstring)); - } else { + } else if (videodata->ime_cursor == videodata->ime_selected_start) { SDL_SendEditingText(s, videodata->ime_selected_start, videodata->ime_selected_length); + } else { + SDL_SendEditingText(s, videodata->ime_cursor, 0); } if (*s) { videodata->ime_needs_clear_composition = SDL_TRUE; From b7748c15134c6160518fc2d4343861ec074aaed1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 10:49:24 -0700 Subject: [PATCH 083/431] Prevent duplicate calls to start/stop text input --- src/video/SDL_video.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index e7c5111f6991e..69b71b3bcc154 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5032,13 +5032,15 @@ int SDL_StartTextInput(SDL_Window *window) } } - /* Finally start the text input system */ - if (_this->StartTextInput) { - if (_this->StartTextInput(_this, window) < 0) { - return -1; + if (!window->text_input_active) { + /* Finally start the text input system */ + if (_this->StartTextInput) { + if (_this->StartTextInput(_this, window) < 0) { + return -1; + } } + window->text_input_active = SDL_TRUE; } - window->text_input_active = SDL_TRUE; return 0; } @@ -5053,11 +5055,13 @@ int SDL_StopTextInput(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, -1); - /* Stop the text input system */ - if (_this->StopTextInput) { - _this->StopTextInput(_this, window); + if (window->text_input_active) { + /* Stop the text input system */ + if (_this->StopTextInput) { + _this->StopTextInput(_this, window); + } + window->text_input_active = SDL_FALSE; } - window->text_input_active = SDL_FALSE; /* Hide the on-screen keyboard, if desired */ const char *hint = SDL_GetHint(SDL_HINT_ENABLE_SCREEN_KEYBOARD); From 50f50612bd6c4883e74eb30c2854e07108cab3d9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 18:56:01 -0700 Subject: [PATCH 084/431] Removed checkkeysthreads It's out of date relative to the IME changes and doesn't add any value --- test/CMakeLists.txt | 1 - test/checkkeysthreads.c | 311 ---------------------------------------- 2 files changed, 312 deletions(-) delete mode 100644 test/checkkeysthreads.c diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 32e952d19e6e3..202599efa301b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -266,7 +266,6 @@ else() endif() add_sdl_test_executable(checkkeys SOURCES checkkeys.c) -add_sdl_test_executable(checkkeysthreads SOURCES checkkeysthreads.c) add_sdl_test_executable(loopwave NEEDS_RESOURCES TESTUTILS MAIN_CALLBACKS SOURCES loopwave.c) add_sdl_test_executable(testsurround SOURCES testsurround.c) add_sdl_test_executable(testresample NEEDS_RESOURCES SOURCES testresample.c) diff --git a/test/checkkeysthreads.c b/test/checkkeysthreads.c deleted file mode 100644 index e236b8592503a..0000000000000 --- a/test/checkkeysthreads.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely. -*/ - -/* 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 -#include -#include - -#ifdef SDL_PLATFORM_EMSCRIPTEN -#include -#endif - -#include - -static int done; - -/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ -static void -quit(int rc) -{ - SDL_Quit(); - /* Let 'main()' return normally */ - if (rc != 0) { - exit(rc); - } -} - -static void -print_string(char **text, size_t *maxlen, const char *fmt, ...) -{ - int len; - va_list ap; - - va_start(ap, fmt); - len = SDL_vsnprintf(*text, *maxlen, fmt, ap); - if (len > 0) { - *text += len; - if (((size_t)len) < *maxlen) { - *maxlen -= (size_t)len; - } else { - *maxlen = 0; - } - } - va_end(ap); -} - -static void -print_modifiers(char **text, size_t *maxlen) -{ - int mod; - print_string(text, maxlen, " modifiers:"); - mod = SDL_GetModState(); - if (!mod) { - print_string(text, maxlen, " (none)"); - return; - } - if (mod & SDL_KMOD_LSHIFT) { - print_string(text, maxlen, " LSHIFT"); - } - if (mod & SDL_KMOD_RSHIFT) { - print_string(text, maxlen, " RSHIFT"); - } - if (mod & SDL_KMOD_LCTRL) { - print_string(text, maxlen, " LCTRL"); - } - if (mod & SDL_KMOD_RCTRL) { - print_string(text, maxlen, " RCTRL"); - } - if (mod & SDL_KMOD_LALT) { - print_string(text, maxlen, " LALT"); - } - if (mod & SDL_KMOD_RALT) { - print_string(text, maxlen, " RALT"); - } - if (mod & SDL_KMOD_LGUI) { - print_string(text, maxlen, " LGUI"); - } - if (mod & SDL_KMOD_RGUI) { - print_string(text, maxlen, " RGUI"); - } - if (mod & SDL_KMOD_NUM) { - print_string(text, maxlen, " NUM"); - } - if (mod & SDL_KMOD_CAPS) { - print_string(text, maxlen, " CAPS"); - } - if (mod & SDL_KMOD_MODE) { - print_string(text, maxlen, " MODE"); - } - if (mod & SDL_KMOD_SCROLL) { - print_string(text, maxlen, " SCROLL"); - } -} - -static void -PrintModifierState(void) -{ - char message[512]; - char *spot; - size_t left; - - spot = message; - left = sizeof(message); - - print_modifiers(&spot, &left); - SDL_Log("Initial state:%s\n", message); -} - -static void -PrintKey(SDL_KeyboardEvent *event) -{ - char message[512]; - char *spot; - size_t left; - - spot = message; - left = sizeof(message); - - /* Print the keycode, name and state */ - if (event->key) { - print_string(&spot, &left, - "Key %s: scancode %d = %s, keycode 0x%08X = %s ", - event->state ? "pressed " : "released", - event->scancode, - SDL_GetScancodeName(event->scancode), - event->key, SDL_GetKeyName(event->key)); - } else { - print_string(&spot, &left, - "Unknown Key (scancode %d = %s) %s ", - event->scancode, - SDL_GetScancodeName(event->scancode), - event->state ? "pressed " : "released"); - } - print_modifiers(&spot, &left); - if (event->repeat) { - print_string(&spot, &left, " (repeat)"); - } - SDL_Log("%s\n", message); -} - -static void -PrintText(const char *eventtype, const char *text) -{ - const char *spot; - char expanded[1024]; - - expanded[0] = '\0'; - for (spot = text; *spot; ++spot) { - size_t length = SDL_strlen(expanded); - (void)SDL_snprintf(expanded + length, sizeof(expanded) - length, "\\x%.2x", (unsigned char)*spot); - } - SDL_Log("%s Text (%s): \"%s%s\"\n", eventtype, expanded, *text == '"' ? "\\" : "", text); -} - -static void loop(void) -{ - SDL_Event event; - /* Check for events */ - /*SDL_WaitEvent(&event); emscripten does not like waiting*/ - - SDL_Log("starting loop\n"); - while (!done && SDL_WaitEvent(&event)) { - SDL_Log("Got event type: %" SDL_PRIu32 "\n", event.type); - switch (event.type) { - case SDL_EVENT_KEY_DOWN: - case SDL_EVENT_KEY_UP: - PrintKey(&event.key); - break; - case SDL_EVENT_TEXT_EDITING: - PrintText("EDIT", event.text.text); - break; - case SDL_EVENT_TEXT_INPUT: - PrintText("INPUT", event.text.text); - break; - case SDL_EVENT_MOUSE_BUTTON_DOWN: - { - SDL_Window *window = SDL_GetWindowFromID(event.button.windowID); - - /* Left button quits the app, other buttons toggles text input */ - SDL_Log("mouse button down button: %d (LEFT=%d)\n", event.button.button, SDL_BUTTON_LEFT); - if (event.button.button == SDL_BUTTON_LEFT) { - done = 1; - } else { - if (SDL_TextInputActive(window)) { - SDL_Log("Stopping text input\n"); - SDL_StopTextInput(window); - } else { - SDL_Log("Starting text input\n"); - SDL_StartTextInput(window); - } - } - break; - } - case SDL_EVENT_QUIT: - done = 1; - break; - default: - break; - } - SDL_Log("waiting new event\n"); - } - SDL_Log("exiting event loop\n"); -#ifdef SDL_PLATFORM_EMSCRIPTEN - if (done) { - emscripten_cancel_main_loop(); - } -#endif -} - -/* Very simple thread - counts 0 to 9 delaying 50ms between increments */ -static int SDLCALL ping_thread(void *ptr) -{ - int cnt; - SDL_Event sdlevent; - SDL_zero(sdlevent); - for (cnt = 0; cnt < 10; ++cnt) { - SDL_Log("sending event (%d/%d) from thread.\n", cnt + 1, 10); - sdlevent.type = SDL_EVENT_KEY_DOWN; - sdlevent.key.key = SDLK_1; - SDL_PushEvent(&sdlevent); - SDL_Delay(1000 + SDL_rand(1000)); - } - return cnt; -} - -int main(int argc, char *argv[]) -{ - SDL_Window *window; - SDL_Renderer *renderer; - SDL_Thread *thread; - SDLTest_CommonState *state; - - /* Initialize test framework */ - state = SDLTest_CommonCreateState(argv, 0); - if (!state) { - return 1; - } - - /* Enable standard application logging */ - SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); - - /* Parse commandline */ - if (!SDLTest_CommonDefaultArgs(state, argc, argv)) { - return 1; - } - - /* Initialize SDL */ - if (SDL_Init(SDL_INIT_VIDEO) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL: %s\n", SDL_GetError()); - return 1; - } - - /* Set 640x480 video mode */ - window = SDL_CreateWindow("CheckKeys Test", 640, 480, 0); - if (!window) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create 640x480 window: %s\n", - SDL_GetError()); - quit(2); - } - - /* On wayland, no window will actually show until something has - actually been displayed. - */ - renderer = SDL_CreateRenderer(window, NULL); - SDL_RenderPresent(renderer); - -#ifdef SDL_PLATFORM_IOS - /* Creating the context creates the view, which we need to show keyboard */ - SDL_GL_CreateContext(window); -#endif - - SDL_StartTextInput(window); - - /* Print initial modifier state */ - SDL_PumpEvents(); - PrintModifierState(); - - /* Watch keystrokes */ - done = 0; - - thread = SDL_CreateThread(ping_thread, "PingThread", NULL); - -#ifdef SDL_PLATFORM_EMSCRIPTEN - emscripten_set_main_loop(loop, 0, 1); -#else - while (!done) { - loop(); - } -#endif - - SDL_DestroyRenderer(renderer); - SDL_DestroyWindow(window); - - SDL_WaitThread(thread, NULL); - SDL_Quit(); - SDLTest_CommonDestroyState(state); - return 0; -} From a67e6b80de1ba0d885f49080ebc95c451e73696d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 19:29:24 -0700 Subject: [PATCH 085/431] Updated unifont to version 15.1.05 --- test/testime.c | 2 +- ...icense.txt => unifont-15.1.05-license.txt} | 0 ...nifont-13.0.06.hex => unifont-15.1.05.hex} | 24570 ++++++++-------- 3 files changed, 12285 insertions(+), 12287 deletions(-) rename test/{unifont-13.0.06-license.txt => unifont-15.1.05-license.txt} (100%) rename test/{unifont-13.0.06.hex => unifont-15.1.05.hex} (79%) diff --git a/test/testime.c b/test/testime.c index 9e7a9a38025ac..f08cbd2835862 100644 --- a/test/testime.c +++ b/test/testime.c @@ -36,7 +36,7 @@ #define DEFAULT_FONT "NoDefaultFont.ttf" #endif #else -#define DEFAULT_FONT "unifont-13.0.06.hex" +#define DEFAULT_FONT "unifont-15.1.05.hex" #endif #define MAX_TEXT_LENGTH 256 diff --git a/test/unifont-13.0.06-license.txt b/test/unifont-15.1.05-license.txt similarity index 100% rename from test/unifont-13.0.06-license.txt rename to test/unifont-15.1.05-license.txt diff --git a/test/unifont-13.0.06.hex b/test/unifont-15.1.05.hex similarity index 79% rename from test/unifont-13.0.06.hex rename to test/unifont-15.1.05.hex index 320686a0c222b..70e0ccfe5d76b 100644 --- a/test/unifont-13.0.06.hex +++ b/test/unifont-15.1.05.hex @@ -269,7 +269,7 @@ 010C:241800003C42424040404042423C0000 010D:0000241800003C4240404040423C0000 010E:48300000784442424242424244780000 -010F:2418000202023A4642424242463A0000 +010F:00000016121254B090909090B0500000 0110:0000000078444242F242424244780000 0111:000000020F023A4642424242463A0000 0112:003C00007E4040407C404040407E0000 @@ -289,7 +289,7 @@ 0120:101000003C424240404E4242463A0000 0121:0000101000023A44444438203C42423C 0122:000000003C424240404E4242463A0830 -0123:00000C1000023A44444438203C42423C +0123:0000202018023A44444438203C42423C 0124:18240000424242427E42424242420000 0125:3048004040405C624242424242420000 0126:000000004242FF42427E424242420000 @@ -304,8 +304,8 @@ 012F:000000080800180808080808083E0806 0130:080800003E08080808080808083E0000 0131:000000000000180808080808083E0000 -0132:000000004242424242420202423C0000 -0133:0000222200002222222222221A02221C +0132:000000007722222222222272021C0000 +0133:00000022220066222222227202022418 0134:0C1200001F0404040404044444380000 0135:00000C1200000C040404040404044830 0136:000000004244485060605048444220C0 @@ -315,8 +315,8 @@ 013A:0C3000180808080808080808083E0000 013B:000000004040404040404040407E0830 013C:000000180808080808080808083E0830 -013D:241800004040404040404040407E0000 -013E:241800180808080808080808083E0000 +013D:000000004C44444840404040407E0000 +013E:000000361212141010101010107C0000 013F:000000004040404044444040407E0000 0140:000000301010101014141010107C0000 0141:000000004040485060C04040407E0000 @@ -355,7 +355,7 @@ 0162:000000007F0808080808080808080830 0163:000000001010107C10101010100C0830 0164:241800007F0808080808080808080000 -0165:241800001010107C10101010100C0000 +0165:00000602222420F82020202020180000 0166:000000007F0808083E08080808080000 0167:000000001010107C10107C10100C0000 0168:324C00004242424242424242423C0000 @@ -381,7 +381,7 @@ 017C:0000101000007E0204081020407E0000 017D:241800007E02020408102040407E0000 017E:0000241800007E0204081020407E0000 -017F:0000000C101010301010101010100000 +017F:0000000C101010701010101010100000 0180:00000040F0405C6242424242625C0000 0181:000000007CA2A2223C222222223C0000 0182:000000007E4040407C424242427C0000 @@ -610,7 +610,7 @@ 0261:0000000000003A46424242463A02423C 0262:0000000000003C4240404E42423E0000 0263:00000000000042424224241818242418 -0264:00000000000042422424181824180000 +0264:00000000000044AA2810102828100000 0265:0000000000424242424242463A020202 0266:0000003840405C624242424242420000 0267:0000003840405C62424242424242020C @@ -692,7 +692,7 @@ 02B3:00000000005864444040000000000000 02B4:00000000000404444C34000000000000 02B5:00000000000404444C34030000000000 -02B6:00000044444878444478000000000000 +02B6:00000000004448784478000000000000 02B7:00000000004949553622000000000000 02B8:000000000044444C3404380000000000 02B9:00000000081020000000000000000000 @@ -702,8 +702,8 @@ 02BD:00000000181010080000000000000000 02BE:00000030080404083000000000000000 02BF:0000000C102020100C00000000000000 -02C0:0000003C4202021C1010000000000000 -02C1:0000003C424040380808000000000000 +02C0:0000003C42021C101000000000000000 +02C1:0000003C424038080800000000000000 02C2:00000004081020100804000000000000 02C3:00000020100804081020000000000000 02C4:00000000081422410000000000000000 @@ -736,9 +736,9 @@ 02DF:00000000422418244200000000000000 02E0:00000000004242241824241800000000 02E1:00000030101010101038000000000000 -02E2:00000000003E403C027C000000000000 +02E2:00000000003C40380478000000000000 02E3:00000000004224182442000000000000 -02E4:00003C40403808000000000000000000 +02E4:0000003C424038080808000000000000 02E5:0000007C040404040404040404040000 02E6:00000004047C04040404040404040000 02E7:00000004040404047C04040404040000 @@ -797,7 +797,7 @@ 031C:00000000000000000000000000182018 031D:00000000000000000000000000101038 031E:00000000000000000000000000381010 -031F:00000000000000000000000000107C10 +031F:00000000000000000000000000103810 0320:0000000000000000000000000000003C 0321:0000000000000000000000000202120C 0322:00000000000000000000000008080906 @@ -809,7 +809,7 @@ 0328:00000000000000000000000000080806 0329:00000000000000000000000000101010 032A:00000000000000000000000000007E42 -032B:00000000000000000000000000494936 +032B:0000000000000000000000000092926C 032C:00000000000000000000000000422418 032D:00000000000000000000000000182442 032E:0000000000000000000000000042423C @@ -871,7 +871,7 @@ 0366:38444444380000000000000000000000 0367:444444443C0000000000000000000000 0368:1C2020201C0000000000000000000000 -0369:04043C243C0000000000000000000000 +0369:04041C241C0000000000000000000000 036A:20203824240000000000000000000000 036B:0000EC92920000000000000000000000 036C:00382420200000000000000000000000 @@ -879,13 +879,13 @@ 036E:00444428100000000000000000000000 036F:44281028440000000000000000000000 0370:00000000404040407C40404040400000 -0371:0000000000002050501E101010100000 -0372:00000000FE9292921010101010100000 +0371:0000000000006010101E101010100000 +0372:000000007F4949490808080808080000 0373:000000007C5454541010101010100000 0374:000000000C1810200000000000000000 0375:00000000000000000000000004081830 0376:000000004246464A4A52526262420000 -0377:000000000000889898A8A8CACA840000 +0377:000000000000444C4C54546464440000 0378:00007FFE738E6DF66DC66DF6738E7FFE7FFE61CE7DB67BCE77B677CE7FFE0000 0379:00007FFE738E6DF66DC66DF6738E7FFE7FFE61CE7DB67BC677F677CE7FFE0000 037A:00000000000000000000000020202018 @@ -900,16 +900,16 @@ 0383:00007FFE738E6DF66DC66DF6738E7FFE7FFE738E6DF673C66DF6738E7FFE0000 0384:00040810000000000000000000000000 0385:04085444000000000000000000000000 -0386:1020400018242442427E424242420000 +0386:0000204098242442427E424242420000 0387:00000000000000001818000000000000 -0388:102040007E4040407C404040407E0000 -0389:10204000424242427E42424242420000 -038A:102040003E08080808080808083E0000 +0388:00002040BF2020203E202020203F0000 +0389:00002040A12121213F21212121210000 +038A:00002040BE08080808080808083E0000 038B:00007FFE738E6DF66DC66DF6738E7FFE7FFE738E6DB6738E6DB6738E7FFE0000 -038C:102040003C42424242424242423C0000 +038C:00002040BC42424242424242423C0000 038D:00007FFE738E6DF66DC66DF6738E7FFE7FFE738E6DB673B66DB6738E7FFE0000 -038E:10204000414122221408080808080000 -038F:102040003E4141414141412214147700 +038E:00002040C14122221408080808080000 +038F:00002040BE4141414141221414770000 0390:040810444400301010101010100C0000 0391:0000000018242442427E424242420000 0392:000000007C4242427C424242427C0000 @@ -945,27 +945,27 @@ 03B0:040810444400424242424242423C0000 03B1:000000000000324A444444444A320000 03B2:00000000384444447C424242625C4040 -03B3:00000000000031490A04080810100000 +03B3:00000000000042222214141408080808 03B4:000000001C20202018244242423C0000 03B5:0000000000003C42403C4040423C0000 -03B6:0000000020201C0810202020201C021C +03B6:000000007F06182020404040201C021C 03B7:0000000000005C624242424242420202 -03B8:00000000182424427E42422424180000 +03B8:00000000182442427E42424224180000 03B9:000000000000301010101010100C0000 03BA:00000000000022242830302824220000 03BB:00000000202010100818242442420000 -03BC:0000000000004242424266665A424040 +03BC:00000000000042424242424266594040 03BD:00000000000042424244444850600000 -03BE:0000000040403C40403C40403C02023C +03BE:000000007E30404038404040201C021C 03BF:0000000000003C4242424242423C0000 03C0:0000000000007E242424242424240000 03C1:0000000000003C4242424242625C4040 -03C2:0000000000001E20404040201C02021C +03C2:0000000000001E2040404040201C021C 03C3:0000000000003F484444444444380000 03C4:0000000000007E1010101010100C0000 03C5:000000000000424242424242423C0000 03C6:000000000000264949494949493E0808 -03C7:0000000000C121221214182848448483 +03C7:000000000000C1211214182848448483 03C8:000000000000494949494949493E0808 03C9:00000000000022414149494949360000 03CA:000024240000301010101010100C0000 @@ -977,35 +977,35 @@ 03D0:000000001C2242447844424244380000 03D1:000000000C1212120F226222221C0000 03D2:000000003655141408080808081C0000 -03D3:102040003655141408080808081C0000 +03D3:00002040B655141408080808081C0000 03D4:003636003655141408080808081C0000 03D5:0000000008083E4949494949493E0808 03D6:0000000000007F224141494949360000 -03D7:00000000000082442C2C34342241011E +03D7:00000000000082442C2C34342241020C 03D8:000000003C42424242424242423C183C 03D9:0000000000003C4242424242423C1818 -03DA:000000003844404040404038081C0000 -03DB:000000000000003E4040201C021C0000 +03DA:000000001C22414040404040201C021C +03DB:0000000001021C2040404040201C021C 03DC:000000007E4240407840404040400000 -03DD:000000000000003C2220203820202020 +03DD:0000000000003C222020382020202020 03DE:0000000060202020203E040408080000 -03DF:000000000000201010223C4408080400 -03E0:000000001C22060A12060A12020C0000 -03E1:00000000000000601018284C14240408 -03E2:0000000044929292929292926E027C80 -03E3:0000000000004492929292926E027C80 -03E4:0000000032424242463A020202020000 -03E5:000000000000122222221E0202020000 -03E6:000000004040405C624141410101621C -03E7:0000000000083C5252220202324C0000 -03E8:000000003C42420204081020423C0000 -03E9:0000000000003C4242040830423C0000 +03DF:000000000000201010223C4408080806 +03E0:0000000078840C1222060A1202040000 +03E1:00000000000030080C1422060A120204 +03E2:000000004492929292929292926E021C +03E3:000000000000449292929292926E021C +03E4:000000002242424242463A0202020202 +03E5:00000000000012222222221E02020202 +03E6:000000004040405C624141414141021C +03E7:0000000000004040405C62414141021C +03E8:000000003C424202040810204040433C +03E9:0000000000003C42420408102040433C 03EA:00000000C3A5241818242442427E8100 03EB:000000000000245A18181824427E0000 -03EC:000000023C40405C62424242423C0000 -03ED:0000000000023C405C624242423C0000 -03EE:000000001010FE921010101010101000 -03EF:0000000000001010FE92101010101000 +03EC:000000003E41405C62424242423C0000 +03ED:0000000000003E41405C6242423C0000 +03EE:000000001010FE921010101010101010 +03EF:0000000000001010FE92101010101010 03F0:00000000000082442C2C343422410000 03F1:0000000000003C4242427C40403C0200 03F2:0000000000003C4240404040423C0000 @@ -1013,11 +1013,11 @@ 03F4:000000003C4242427E424242423C0000 03F5:0000000000001C2040784040201C0000 03F6:0000000000007008043C040408700000 -03F7:00000000E040784442424242447840E0 +03F7:00000000407844424242424244784040 03F8:0000000040405C6242424242625C4040 03F9:000000003C42424040404042423C0000 03FA:00000000424266665A5A424242420000 -03FB:0000000000446C6C5454444445424040 +03FB:000000000000446C6C54444444434040 03FC:0000000000003C42424242625C40F840 03FD:000000003C42420202020242423C0000 03FE:000000003C42424058584042423C0000 @@ -1464,7 +1464,7 @@ 05B7:00000000000000000000000000003C00 05B8:000000000000000000000000003E0808 05B9:00003030000000000000000000000000 -05BA:00006060000000000000000000000000 +05BA:00001818000000000000000000000000 05BB:00000000000000000000000000200802 05BC:00000000000000001800000000000000 05BD:00000000000000000000000000080808 @@ -1517,12 +1517,12 @@ 05EC:00007FFE73866DBE6D866DF673867FFE7FFE61C66FBE63BE6FBE61C67FFE0000 05ED:00007FFE73866DBE6D866DF673867FFE7FFE618E6FB663B66FB6618E7FFE0000 05EE:00007FFE73866DBE6D866DF673867FFE7FFE61866FBE638E6FBE61867FFE0000 -05EF:00000000003808087711111100000000 +05EF:00380808087711111100000000000000 05F0:00000000007711111111111111110000 05F1:00000000007711111101010101010000 05F2:00000000007711111100000000000000 -05F3:00000204080000000000000000000000 -05F4:00001224480000000000000000000000 +05F3:00000000000408100000000000000000 +05F4:00000000001224480000000000000000 05F5:00007FFE73866DBE6D866DF673867FFE7FFE61866FBE63866FF66F867FFE0000 05F6:00007FFE73866DBE6D866DF673867FFE7FFE61CE6FBE638E6FB66FCE7FFE0000 05F7:00007FFE73866DBE6D866DF673867FFE7FFE61866FF663EE6FDE6FDE7FFE0000 @@ -1551,9 +1551,9 @@ 060E:0000000000000000000000000000000000000E00110011060FF8000000000000 060F:0000000000000600080008000600080013001480188009001600200000000000 0610:00060939160000000000000000000000 -0611:0000003000400278038004000800000000000000000000000000000000000000 +0611:00000060048007F0040004000000000000000000000000000000000000000000 0612:00001F880208041008E008000000000000000000000000000000000000000000 -0613:0000060809083910166000000000000000000000000000000000000000000000 +0613:1000061049107E2050C040000000000000000000000000000000000000000000 0614:0000000000081FC8002800100000000000000000000000000000000000000000 0615:0000040005C006200FC000000000000000000000000000000000000000000000 0616:0500050005000D0010000FE00000000000000000000000000000000000000000 @@ -1563,7 +1563,7 @@ 061A:00000000000000000000000000001800 061B:00000000000000081018001800000000 061C:AAAA000180000001B2224A37FA2A4A23CBA20001800000018000000180005555 -061D:00007FFE73CE6DBE6D8E6DB673CE7FFE7FFE7B8E73B67BB67BB6718E7FFE0000 +061D:000000003844402010160E0000000000 061E:0000000000000000000000000000000000000000000000800000014000000000 061F:0000003E414020100808000800000000 0620:000000000000000C5248443810281000 @@ -1616,7 +1616,7 @@ 064F:0C0E0810200000000000000000000000 0650:00000000000000000000000000000C30 0651:00000004145860000000000000000000 -0652:18242418000000000000000000000000 +0652:18241800000000000000000000000000 0653:00013E40000000000000000000000000 0654:18201820000000000000000000000000 0655:00000000000000000000000018201820 @@ -1650,11 +1650,11 @@ 0671:040A1E20080808080808080000000000 0672:06082658000808080808080000000000 0673:00000000080808080808080006082658 -0674:18201820000000000000000000000000 -0675:06080608202020202020200000000000 -0676:000003040304000C12121E0204483000 -0677:000033341324400C12121E0204483000 -0678:00000000030403040046484846423C00 +0674:0000001C203C10200000000000000000 +0675:00000046484648404040400000000000 +0676:00000003040304102828380808106000 +0677:00003033142344102828380808106000 +0678:00000006080608000854504844443800 0679:000020203838000422423C0000000000 067A:000010001000000422423C0000000000 067B:000000000000000422423C0008000800 @@ -1731,7 +1731,7 @@ 06C2:000000001820182000102F4000000000 06C3:000000000000280000102F4000000000 06C4:000000000000000C12120E2252247800 -06C5:000000000000000C12121E021C483000 +06C5:000000000000000C12121E023C483000 06C6:000000221408000C12121E0204483000 06C7:000018180810200C12121E0204483000 06C8:000000080404000C12121E0204483000 @@ -1788,7 +1788,7 @@ 06FB:000000000004000006194E484A300000 06FC:000000000800001824201C204840423C 06FD:0000000000001C203C10200014141414 -06FE:00000000000000001C063E404A4A4A4A +06FE:000000000000000814122E204A0A0A0A 06FF:000000102844102C2A1A244000000000 0700:000000000000000001000380010008201C700820010003800100000000000000 0701:0000000000001800180000000000000000000000000000000000000000000000 @@ -2158,54 +2158,54 @@ 086D:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6FB663B66DB6738E7FFE0000 086E:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866FBE638E6DBE73867FFE0000 086F:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866FBE638E6DBE73BE7FFE0000 -0870:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61CE7DB67BB677B677CE7FFE0000 -0871:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61EE7DCE7BEE77EE77C67FFE0000 -0872:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61867DF67B8677BE77867FFE0000 -0873:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE618E7DF67BC677F6778E7FFE0000 -0874:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61B67DB67B8677F677F67FFE0000 -0875:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61867DBE7B8677F677867FFE0000 -0876:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61CE7DBE7B8E77B677CE7FFE0000 -0877:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61867DF67BEE77DE77DE7FFE0000 -0878:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61CE7DB67BCE77B677CE7FFE0000 -0879:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61CE7DB67BC677F677CE7FFE0000 -087A:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61867DB67B8677B677B67FFE0000 -087B:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE618E7DB67B8E77B6778E7FFE0000 -087C:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61C67DBE7BBE77BE77C67FFE0000 -087D:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE618E7DB67BB677B6778E7FFE0000 -087E:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61867DBE7B8E77BE77867FFE0000 -087F:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE61867DBE7B8E77BE77BE7FFE0000 -0880:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DB673B66DB673CE7FFE0000 -0881:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73EE6DCE73EE6DEE73C67FFE0000 -0882:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DF673866DBE73867FFE0000 -0883:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6DF673C66DF6738E7FFE0000 -0884:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73B66DB673866DF673F67FFE0000 -0885:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DBE73866DF673867FFE0000 -0886:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DBE738E6DB673CE7FFE0000 -0887:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DF673EE6DDE73DE7FFE0000 -0888:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DB673CE6DB673CE7FFE0000 -0889:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DB673C66DF673CE7FFE0000 -088A:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DB673866DB673B67FFE0000 -088B:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6DB6738E6DB6738E7FFE0000 -088C:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73C66DBE73BE6DBE73C67FFE0000 -088D:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6DB673B66DB6738E7FFE0000 -088E:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DBE738E6DBE73867FFE0000 +0870:00000638080808080808080000000000 +0871:00000C30202020202020200000000000 +0872:00000020202C30202020200000000000 +0873:0000000404040C340404040000000000 +0874:000000080808080808080E3000000000 +0875:0000002020202020202C300000000000 +0876:001C1C08080808080808080000000000 +0877:0000001010101C1C1010100000000000 +0878:00000008080838380808080000000000 +0879:00000008080808080808081C1C000000 +087A:00080008080808080808080000000000 +087B:00200C30202020202020200000000000 +087C:00200020202C30202020200000000000 +087D:0020002020202020202C300000000000 +087E:00000618101030503010100000000000 +087F:00000010103658301010100000000000 +0880:00000010103050301016180000000000 +0881:00000020202C303C3020200000000000 +0882:00000004041C243C1424040000000000 +0883:000000000000001C203CFF2000000000 +0884:000000000000000C1212FF0204483000 +0885:00000000000000000000FF0028000000 +0886:00000000000000000804780028000000 +0887:00000000000000183C3C180000000000 +0888:00000000000018180000000000000000 +0889:00000000102844000422424244380000 +088A:00000000000000007E10244A5140221C +088B:000000202020202C32227C0008000000 +088C:000000202020202C32227C0014000800 +088D:00000004081020403C827E0008000800 +088E:000000000000000000080F0808080800 088F:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DBE738E6DBE73BE7FFE0000 -0890:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DB671B67DB673CE7FFE0000 -0891:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73EE6DCE71EE7DEE73C67FFE0000 +0890:5555800000E180983FFD8000000180000001800000018000000180000001AAAA +0891:55558000070199003FFD8000000180000001800000018000000180000001AAAA 0892:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DF671867DBE73867FFE0000 0893:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6DF671C67DF6738E7FFE0000 0894:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73B66DB671867DF673F67FFE0000 0895:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DBE71867DF673867FFE0000 0896:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DBE718E7DB673CE7FFE0000 0897:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DF671EE7DDE73DE7FFE0000 -0898:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DB671CE7DB673CE7FFE0000 -0899:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73CE6DB671C67DF673CE7FFE0000 -089A:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DB671867DB673B67FFE0000 -089B:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6DB6718E7DB6738E7FFE0000 -089C:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73C66DBE71BE7DBE73C67FFE0000 -089D:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE738E6DB671B67DB6738E7FFE0000 -089E:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DBE718E7DBE73867FFE0000 -089F:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE73866DBE718E7DBE73BE7FFE0000 +0898:002202221872220A3BF242001C10000000000000000000000000000000000000 +0899:0000000000000000000000000000000000000000000000203452740244FA43C2 +089A:0000000000000000000000000000000000000000000000005282029232AA4CDA +089B:00000000000000000000000000000000000000000000000610001F4290BE6680 +089C:00017E20000000000000000000000000 +089D:9CA0C000000000000000000000000000 +089E:7F803F40000000000000000000000000 +089F:78813E40000000000000000000000000 08A0:000000000000000422423C0022140800 08A1:00000C100C10000422423C0010000000 08A2:00000000000820007E1020404840221C @@ -2218,7 +2218,7 @@ 08A9:0000000000001000044A4844423C0028 08AA:00000000000000000402020234483402 08AB:000000000000000C12120E2204483000 -08AC:000000000000000000000814146E404A +08AC:000000000000000814146E404A000000 08AD:00000000000000000000080808080800 08AE:000000000000080402427C0028001000 08AF:000000000000000006194E4830042008 @@ -2227,7 +2227,7 @@ 08B2:00001028440010000402020204483000 08B3:0000000000001824201C20544048423C 08B4:000000020A120A2242423C0000080000 -08B5:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE63866DBE63866DF663867FFE0000 +08B5:000000000000001C120A264244380010 08B6:000018041C10100422423C0000080000 08B7:000018041C10100422423C0024000800 08B8:00000000140000229D413E0000000000 @@ -2246,19 +2246,19 @@ 08C5:00000010002400007E1020404840221C 08C6:000000000000007E204840544048221C 08C7:4040506AF202020202224242443C0000 -08C8:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE71CE6FB66FCE6FB671CE7FFE0000 -08C9:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE71CE6FB66FC66FF671CE7FFE0000 -08CA:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE71866FB66F866FB671B67FFE0000 -08CB:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE718E6FB66F8E6FB6718E7FFE0000 -08CC:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE71C66FBE6FBE6FBE71C67FFE0000 -08CD:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE718E6FB66FB66FB6718E7FFE0000 -08CE:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE71866FBE6F8E6FBE71867FFE0000 -08CF:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE71866FBE6F8E6FBE71BE7FFE0000 -08D0:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE63CE6DB66DB66DB663CE7FFE0000 -08D1:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE63EE6DCE6DEE6DEE63C67FFE0000 -08D2:00007FFE73CE6DB66DCE6DB673CE7FFE7FFE63866DF66D866DBE63867FFE0000 +08C8:20483024481020403C827E0000000000 +08C9:0000000000000000064846423C000000 +08CA:064846423C0000000000000000000000 +08CB:1020407F002800000000000000000000 +08CC:00C011202FC04000000000000000000000000000000000000000000000000000 +08CD:0080040005C006200FC000000000000000000000000000000000000000000000 +08CE:183C3C18000000000000000000000000 +08CF:000000000000000000000000183C3C18 +08D0:00000000000000000000000018241800 +08D1:00000000000000000000000018242418 +08D2:0000000000000000000000003C5A5A3C 08D3:0000000000000000000000040A0E021C -08D4:216B87A7839364000000000000000000 +08D4:720A520A3C4A4172404039800000000000000000000000000000000000000000 08D5:0000000006194E502000000000000000 08D6:00102820182044380000000000000000 08D7:0024000C0A4638000000000000000000 @@ -3130,7 +3130,7 @@ 0C39:040008005000200007F8022801100080008038804C8033000000000000000000 0C3A:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE63867DB671867DB663B67FFE0000 0C3B:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE638E7DB6718E7DB6638E7FFE0000 -0C3C:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE63C67DBE71BE7DBE63C67FFE0000 +0C3C:0000000000000000000000000000000000000000000000000000018002400180 0C3D:0000000000000000000007000080008003000400040003F80000000000000000 0C3E:000000000000000000FF00050002000000000000000000000000000000000000 0C3F:0180024001C00780000000000000000000000000000000000000000000000000 @@ -3163,7 +3163,7 @@ 0C5A:00000000000007C00820101010101FF01110111011100EE00000000000000000 0C5B:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE618E6FB6618E7DB6618E7FFE0000 0C5C:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61C66FBE61BE7DBE61C67FFE0000 -0C5D:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE618E6FB661B67DB6618E7FFE0000 +0C5D:0000000000001FF8200020001F80200020001F80200020001F80000000000000 0C5E:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61866FBE618E7DBE61867FFE0000 0C5F:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61866FBE618E7DBE61BE7FFE0000 0C60:0000000000000000493EA4952492249044908490A4905B600000000000000000 @@ -3291,7 +3291,7 @@ 0CDA:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE63866DB66D866DB663B67FFE0000 0CDB:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE638E6DB66D8E6DB6638E7FFE0000 0CDC:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE63C66DBE6DBE6DBE63C67FFE0000 -0CDD:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE638E6DB66DB66DB6638E7FFE0000 +0CDD:0000000000001FF8200020001F80200020001F80200020001F80000000000000 0CDE:00000000000000000C60129032982C682008200811100EE00000000000000000 0CDF:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE63866DBE6D8E6DBE63BE7FFE0000 0CE0:00000000004000400F80620E9111711111137115999566620000000000000000 @@ -3313,7 +3313,7 @@ 0CF0:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61CE6FB663B66FB66FCE7FFE0000 0CF1:AAAA000180001FF188200441828001018280044188201FF18000000180005555 0CF2:AAAA000180000001800000019C702289A28822899C7000018000000180005555 -0CF3:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE618E6FF663C66FF66F8E7FFE0000 +0CF3:0000000600090009000600000000000000000000000000000000000000000000 0CF4:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61B66FB663866FF66FF67FFE0000 0CF5:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61866FBE63866FF66F867FFE0000 0CF6:00007FFE73C66DBE6DBE6DBE73C67FFE7FFE61CE6FBE638E6FB66FCE7FFE0000 @@ -3788,7 +3788,7 @@ 0ECB:081C0800000000000000000000000000 0ECC:021C1800000000000000000000000000 0ECD:00000814080000000000000000000000 -0ECE:00007FFE73866DBE6D8E6DBE73867FFE7FFE71866FBE6F8E6FBE71867FFE0000 +0ECE:000A1500000000000000000000000000 0ECF:00007FFE73866DBE6D8E6DBE73867FFE7FFE71866FBE6F8E6FBE71BE7FFE0000 0ED0:0000000000003C4242424242423C0000 0ED1:0000000000003C42425A3A0204380000 @@ -4350,262 +4350,262 @@ 10FD:0000000000003C42422010080442423C 10FE:00000000000000C0221C2222221C0000 10FF:0000000000000000001C2222221C0000 -1100:000000007F800080008000800080010001000200040018006000000000000000 -1101:0000000000007B80088008800880088011001100220044000800000000000000 -1102:000020002000200020003F800000000000000000000000000000000000000000 -1103:00003F802000200020003F800000000000000000000000000000000000000000 -1104:00003B802200220022003B800000000000000000000000000000000000000000 -1105:000000003F8000803F8020003F80000000000000000000000000000000000000 -1106:00003F802080208020803F800000000000000000000000000000000000000000 -1107:0000208020803F8020803F800000000000000000000000000000000000000000 -1108:00002A802A803B802A803B800000000000000000000000000000000000000000 -1109:00000400040004000A0011000000000000000000000000000000000000000000 -110A:00001100110011002A8044400000000000000000000000000000000000000000 -110B:00000E001100110011000E000000000000000000000000000000000000000000 -110C:00003F80010002000D0030800000000000000000000000000000000000000000 -110D:000000003BC00880150022800440000000000000000000000000000000000000 -110E:0E0000003F8002000D0030800000000000000000000000000000000000000000 -110F:00003F8000803F80008000800000000000000000000000000000000000000000 -1110:00003F8020003F8020003F800000000000000000000000000000000000000000 -1111:00007F801200120012007F800000000000000000000000000000000000000000 -1112:00000E0000003F8000001F002080208020801F00000000000000000000000000 -1113:000021FC2004200420043F840000000000000000000000000000000000000000 -1114:000020402040204020403E7C0000000000000000000000000000000000000000 -1115:0000207C2040204020403E7C0000000000000000000000000000000000000000 -1116:000020442044207C20443E7C0000000000000000000000000000000000000000 -1117:00003E7C2004200420043E040000000000000000000000000000000000000000 -1118:000000003E4002403E4020403E7C000000000000000000000000000000000000 -1119:000000003E7C02043E7C20403E7C000000000000000000000000000000000000 -111A:000000003E3002FC3E3020483E30000000000000000000000000000000000000 -111B:000000001FF800081FF810001FF803C00420042003C000000000000000000000 -111C:00003E442244227C22443E7C0000000000000000000000000000000000000000 -111D:00001FFC1004100410041FFC00000000000003E004100410041003E000000000 -111E:0000227C22043E0422043E040000000000000000000000000000000000000000 -111F:0000224022403E4022403E7C0000000000000000000000000000000000000000 -1120:0000227C22403E4022403E7C0000000000000000000000000000000000000000 -1121:0000221022103E1022283E440000000000000000000000000000000000000000 -1122:0000489E4882788249427A220000000000000000000000000000000000000000 -1123:0000488E4888788849487A2E0000000000000000000000000000000000000000 -1124:000049244924793C4AA47C7C0000000000000000000000000000000000000000 -1125:000048884888788849547A220000000000000000000000000000000000000000 -1126:0000493E490479084A947C620000000000000000000000000000000000000000 -1127:0000227C22083E1022283E440000000000000000000000000000000000000000 -1128:00382200227C3E1022283E440000000000000000000000000000000000000000 -1129:0000227C22403E7C22403E7C0000000000000000000000000000000000000000 -112A:0000227C22283E2822283E7C0000000000000000000000000000000000000000 -112B:000008080FF808080FF801C0022001C000000000000000000000000000000000 -112C:000022443E7C22443E7C03C0042003C000000000000000000000000000000000 -112D:0000047C040404040A0411040000000000000000000000000000000000000000 -112E:00000440044004400A40117C0000000000000000000000000000000000000000 -112F:0000047C044004400A40117C0000000000000000000000000000000000000000 -1130:0000047C0404047C0A40117C0000000000000000000000000000000000000000 -1131:0000047C044404440A44117C0000000000000000000000000000000000000000 -1132:000004440444047C0A44117C0000000000000000000000000000000000000000 -1133:0000112E112211E2292245E20000000000000000000000000000000000000000 -1134:0000088808880888155422220000000000000000000000000000000000000000 -1135:00000438044404440A4411380000000000000000000000000000000000000000 -1136:0000047C040804100A2811440000000000000000000000000000000000000000 -1137:00380400047C04100A2811440000000000000000000000000000000000000000 -1138:0000047C0404047C0A0411040000000000000000000000000000000000000000 -1139:0000047C0440047C0A40117C0000000000000000000000000000000000000000 -113A:0000047C042804280A28117C0000000000000000000000000000000000000000 -113B:0000043004FC04300A4811300000000000000000000000000000000000000000 -113C:0000004000400180068018400000000000000000000000000000000000000000 -113D:00000120012002A0045019880000000000000000000000000000000000000000 -113E:0000008000800100068018400000000000000000000000000000000000000000 -113F:00000480048005400A30118C0000000000000000000000000000000000000000 -1140:000002000500088010403FE00000000000000000000000000000000000000000 -1141:00000E7C1104110411040E040000000000000000000000000000000000000000 -1142:00000E3C1120112011200E3C0000000000000000000000000000000000000000 -1143:00000E3E1122112211220E3E0000000000000000000000000000000000000000 -1144:00000E241124113C11240E3C0000000000000000000000000000000000000000 -1145:00000E081108110811140E220000000000000000000000000000000000000000 -1146:0000382044504488450439FC0000000000000000000000000000000000000000 -1147:00000E381144114411440E380000000000000000000000000000000000000000 -1148:00000E7C1108111011280E440000000000000000000000000000000000000000 -1149:00380E00117C111011280E440000000000000000000000000000000000000000 -114A:00000E3C1120113C11200E3C0000000000000000000000000000000000000000 -114B:00000E7C1128112811280E7C0000000000000000000000000000000000000000 -114C:00000E001100110011000E000000000000000000000000000000000000000000 -114D:00003E3804440844144422380000000000000000000000000000000000000000 -114E:00003FE000C003800C4030200000000000000000000000000000000000000000 -114F:000000001FF0012002A00C503188000000000000000000000000000000000000 -1150:00001FF0006001C0062018100000000000000000000000000000000000000000 -1151:000000003FE0084014A02310018C000000000000000000000000000000000000 -1152:1C00007C3E04087C140422040000000000000000000000000000000000000000 -1153:180000303EFC0830144822300000000000000000000000000000000000000000 -1154:078000001FC00180064038200000000000000000000000000000000000000000 -1155:0E0000003F0002000D8030700000000000000000000000000000000000000000 -1156:00003E441444147C14443E7C0000000000000000000000000000000000000000 -1157:00001FF804201FF803C0042003C0000000000000000000000000000000000000 -1158:000018307EFC1C70228822881C70000000000000000000000000000000000000 -1159:1FF0010007C00820082007C00000000000000000000000000000000000000000 -115A:00003E7C024002400240027C0000000000000000000000000000000000000000 -115B:000010101010101010281F440000000000000000000000000000000000000000 -115C:0000107C1008101010281F440000000000000000000000000000000000000000 -115D:0000107011FC107010881E700000000000000000000000000000000000000000 -115E:000000003E7C2004207C20403E7C000000000000000000000000000000000000 +1100:00000000000000000FF800080008000800080008000800080008000000000000 +1101:00000000000000001F7C01040104010401040104010401040104000000000000 +1102:00000000000000000800080008000800080008000800080007F8000000000000 +1103:00000000000000000FF8080008000800080008000800080007F8000000000000 +1104:00000000000000001F7C10401040104010401040104010400F3C000000000000 +1105:00000000000000000FF80008000800080FF008000800080007F8000000000000 +1106:00000000000000000FF8080808080808080808080808080807F8000000000000 +1107:000000000000000008080808080808080FF808080808080807F8000000000000 +1108:000000000000000011441144114411441F7C1144114411440F3C000000000000 +1109:0000000000000000008000800080014001400220022004100808000000000000 +110A:000000000000000004100410041004100A280A28114411442082000000000000 +110B:000000000000000003E0041008080808080808080808041003E0000000000000 +110C:00000000000000000FF800800080014001400220022004100808000000000000 +110D:00000000000000003FFE0410041004100A280A28114411442082000000000000 +110E:000000000000000003E000000FF8008000800140022004100808000000000000 +110F:00000000000000000FF80008000800080FF80008000800080008000000000000 +1110:00000000000000000FF80800080008000FF808000800080007F8000000000000 +1111:00000000000000000FF802200220022002200220022002200FF8000000000000 +1112:000000000000000003E000000FF8000003E004100410041003E0000000000000 +1113:0000000000000000107C10041004100410041004100410040F04000000000000 +1114:0000000000000000104010401040104010401040104010400F3C000000000000 +1115:0000000000000000107C10401040104010401040104010400F3C000000000000 +1116:00000000000000001044104410441044107C1044104410440F3C000000000000 +1117:00000000000000001F7C10041004100410041004100410040F04000000000000 +1118:00000000000000001F400140014001401E401040104010400F3C000000000000 +1119:00000000000000001F7C0104010401041E781040104010400F3C000000000000 +111A:00000000000000001F38010001FE01001E381044104410440F38000000000000 +111B:0000000000000FF800080FF0080007F8000007F008080808080807F000000000 +111C:00000000000000001F44114411441144117C1144114411440F3C000000000000 +111D:0000000000000FF808080808080807F8000007F008080808080807F000000000 +111E:0000000000000000117C1104110411041F041104110411040F04000000000000 +111F:000000000000000011401140114011401F401140114011400F3C000000000000 +1120:0000000000000000117C1140114011401F401140114011400F3C000000000000 +1121:000000000000000011101110111011101F281128114411440F82000000000000 +1122:0000000000000000225E2242224222423EA222A222A223121F12000000000000 +1123:0000000000000000249E2490249024903D502550255026301E2E000000000000 +1124:000000000000000024922492249224923D5E2552255226321E2E000000000000 +1125:000000000000000024882488248824883D542554255426221E22000000000000 +1126:000000000000000024BE2488248824883D542554255426221E22000000000000 +1127:0000000000000000117C1110111011101F281128114411440F82000000000000 +1128:000000000000000011381100117C11101F101128112811440F82000000000000 +1129:0000000000000000117C1140114011401F781140114011400F3C000000000000 +112A:0000000000000000117E1100112411241F241124112411240F7E000000000000 +112B:000000000000080808080FF8080807F8000007F008080808080807F000000000 +112C:000000000000114411441F7C11440F3C000007F008080808080807F000000000 +112D:0000000000000000047C0404040404040A040A04110411042084000000000000 +112E:000000000000000004400440044004400A400A401140114020BC000000000000 +112F:0000000000000000047C0440044004400A400A401140114020BC000000000000 +1130:0000000000000000047C0404040404040A780A401140114020BC000000000000 +1131:0000000000000000047C0444044404440A440A441144114420BC000000000000 +1132:000000000000000004440444044404440A7C0A441144114420BC000000000000 +1133:000000000000000004100410041004100A280A28114411442082000000000000 +1134:0000000000000000088808880888088815541554155422222222000000000000 +1135:000000000000000004380444044404440A440A441144114420B8000000000000 +1136:0000000000000000047C0410041004100A280A28114411442082000000000000 +1137:000000000000000004380400047C04100A100A28112811442082000000000000 +1138:0000000000000000047C0404040404040A7C0A04110411042084000000000000 +1139:0000000000000000047C0440044004400A780A401140114020BC000000000000 +113A:0000000000000000047E0400042404240A240A241124112420FE000000000000 +113B:00000000000000000438040004FE04000A380A441144114420B8000000000000 +113C:000000000000000000400040004000A000A00110020804000800000000000000 +113D:000000000000000001100110011002A802A80444044008801100000000000000 +113E:0000000000000000010001000100028002800440082000100008000000000000 +113F:00000000000000000440044004400AA00AA01110011000880044000000000000 +1140:0000000000000000008000800140014002200410041008080FF8000000000000 +1141:00000000000000000E7C11041104110411041104110411040E04000000000000 +1142:00000000000000000E7C11401140114011401140114011400E3C000000000000 +1143:00000000000000000E7C11441144114411441144114411440E3C000000000000 +1144:00000000000000000E44114411441144117C1144114411440E3C000000000000 +1145:00000000000000000E1011101110111011281128114411440E82000000000000 +1146:00000000000000000E1011101128112811281144114411820EFE000000000000 +1147:00000000000000000E3811441144114411441144114411440E38000000000000 +1148:00000000000000000E7C11101110111011281128114411440E82000000000000 +1149:00000000000000000E381100117C111011101128112811440E82000000000000 +114A:00000000000000000E7C11401140114011781140114011400E3C000000000000 +114B:00000000000000000E7E11001124112411241124112411240E7E000000000000 +114C:00000000000000000080008003E00410080808080808041003E0000000000000 +114D:00000000000000003F900410043804440A440A441144114420B8000000000000 +114E:000000000000000003F80040004000A000A00110020804000800000000000000 +114F:000000000000000007FC0110011002A802A80444044008801100000000000000 +1150:00000000000000000FE001000100028002800440082000100008000000000000 +1151:00000000000000001FF0044004400AA00AA01110011000880044000000000000 +1152:00000000000000000E7C00043F840404047C0A040A0411042084000000000000 +1153:00000000000000000E3800003FFE04000A380A441144114420B8000000000000 +1154:000000000000000000E0000003F8004000A00110020804000800000000000000 +1155:0000000000000000038000000FE0010002800440082000100008000000000000 +1156:00000000000000003F44004412441244127C1244124412443F3C000000000000 +1157:0000000000001FFC0410041004101FFC000007F008080808080807F000000000 +1158:00000000000000000E3800003FFE00000E381144114411440E38000000000000 +1159:00000000000000000FF8000001C00220041004100410022001C0000000000000 +115A:00000000000000001F7C0140014001400140014001400140013C000000000000 +115B:0000000000000000101010101010101010281028104410440F82000000000000 +115C:000000000000000010FE10101010101010281028104410440F82000000000000 +115D:00000000000000001038100010FE100010381044104410440F38000000000000 +115E:00000000000000001F7C10041004100410781040104010400F3C000000000000 115F:AAAA000180002239A2403E41A2402239800003E1820003818200020180005555 1160:AAAA000180002279A2103E11A2502221800003E1820003818200020180005555 -1161:0000001000100010001E00100010001000000000000000000000000000000000 -1162:0000001200120012001E00120012001200000000000000000000000000000000 -1163:0000001000100010001E0010001E001000000000000000000000000000000000 -1164:0000001200120012001E0012001E001200000000000000000000000000000000 -1165:0000001000100010007000100010001000000000000000000000000000000000 -1166:0000001200120012007200120012001200000000000000000000000000000000 -1167:0000001000100010007000100070001000000000000000000000000000000000 -1168:0000001200120012007200120072001200000000000000000000000000000000 -1169:000000000000000000000000000000000000008000803FFE0000000000000000 -116A:0000001000100010001E041004103FF000000000000000000000000000000000 -116B:0000001200120012001E041204123FF200000000000000000000000000000000 -116C:00000010001000100010041004103FF000000000000000000000000000000000 -116D:00000000000000000000024002403FFE00000000000000000000000000000000 -116E:00000000000000000000000000003FFE00800080000000000000000000000000 -116F:00000010001000100010001000103F90041004F0041000000000000000000000 -1170:00000012001200120012001200123F92041204F2041200000000000000000000 -1171:00000010001000100010001000103FF004100410041000000000000000000000 -1172:00000000000000000000000000003FFE02200220000000000000000000000000 -1173:00000000000000000000000000003FFE00000000000000000000000000000000 -1174:000000100010001000100010001000100010001000103FF00010001000000000 -1175:0000001000100010001000100010001000000000000000000000000000000000 -1176:00000000000000000000002000200020003800A000A03FF80000000000000000 -1177:0000001000100010001C001000103FFE00800080000000000000000000000000 -1178:000000000000000000080008000E0008000E008800883FFE0000000000000000 -1179:00080008000E0008000E024802483FFE00000000000000000000000000000000 -117A:000000000000000800080008003800080008008800883FFE0000000000000000 -117B:00000000000400040004001C0004000400043FFE008000800000000000000000 -117C:00200020002000E000200020002000203FF00000000000000000000000000000 -117D:000000000000000000080008003800080038008800883FFE0000000000000000 -117E:00080008000800380008003800083FFE00800080000000000000000000000000 -117F:00000000000200020002000200023FFE0082008E000200000000000000000000 -1180:000000000000001200120012007200120012011201123FF20012000000000000 -1181:000000000000001200120012007200120012017201123FF20012000000000000 -1182:000000000000000000000000000000803FFE00803FFE00000000000000000000 -1183:000000000000000000000000008000803FFE00003FFE00800080000000000000 -1184:0000000000100010001E091009103FFE00100000000000000000000000000000 -1185:000000A400A400A404BC04A404FC3FA400000000000000000000000000000000 -1186:00020002000E0002000E048204823FFE00020000000000000000000000000000 -1187:0000000000000000000002203FFE00803FFE0000000000000000000000000000 -1188:00000000000200020002024202423FFE00020000000000000000000000000000 -1189:00000000000000000008000800083FFE02080208000800000000000000000000 -118A:00000000000000000012001200123FFE02120212001200000000000000000000 -118B:000000080008000800081FC80208027802083FFE000000000000000000000000 -118C:0000000A000A000A000A000A000A3FEA020A023A000A003A000A000000000000 -118D:00000000000000000000000000003FFE00803FFE008000000000000000000000 -118E:00000008000800080008000800083FFE02480248000800000000000000000000 -118F:00000001000100010001000100013FFF0221022F000100000000000000000000 -1190:00000000000A000A000A000A000A3FFA048A04BA000A00000000000000000000 -1191:00000000000200020002000200023FFE0242024E0002000E0002000000000000 -1192:00000000000A000A000A000A000A3FFA048A04BA000A003A000A000000000000 -1193:00000000000000000000000000003FFE02203FFE008000000000000000000000 -1194:00000000000100010001000100013FFF02210221000100000000000000000000 -1195:00000000000000000000000000003FFE00003FFE008000000000000000000000 -1196:00000000000000000000000000003FFE00003FFE000000000000000000000000 -1197:00040004000400040004000400040FFC00043FFE008000000000000000000000 -1198:0000004800480048004E00480048004800000000000000000000000000000000 -1199:000000480048004E0048004E0048004800000000000000000000000000000000 -119A:000000000000000400040004000400040004008400843FFE0000000000000000 -119B:00040004000400040004000400043FFE00800080000000000000000000000000 -119C:00000004000400040004000400043FFE00000000000000000000000000000000 -119D:00000020002000200020002000200020000000C0002000100000000000000000 -119E:00000000000000000000000000000000000000C0002000100000000000000000 -119F:000000100010001000700C100210011000000000000000000000000000000000 -11A0:000000000000000000000060001000083FFE0080008000000000000000000000 -11A1:0000001000100010001018100410021000000000000000000000000000000000 -11A2:0000000000000000000018600410020800000000000000000000000000000000 -11A3:000000000000000000000020002000200038002000203FF80000000000000000 -11A4:000000000000000000080008000E0008000E000800083FFE0080008000000000 -11A5:000000000000000000280028002E00E8002800EE002800280028000000000000 -11A6:0000000000100010001E011001103FFE00100000000000000000000000000000 -11A7:0000002400240024003C042404FC3F2400000000000000000000000000000000 -11A8:00000000000000000000000000000000000007F0001000100010001000000000 -11A9:0000000000000000000000000000000000000F78010801080108010800000000 -11AA:0000000000000000000000000000000000000F10011001100128014400000000 -11AB:000000000000000000000000000000000000040004000400040007F000000000 -11AC:00000000000000000000000000000000000008F80820082008500F8800000000 -11AD:000000000000000000000000000000000000083008FC083008480F3000000000 -11AE:00000000000000000000000000000000000007F004000400040007F000000000 -11AF:00000000000000000000000000000000000007F0001007F0040007F000000000 -11B0:0000000000000000000000000000000000000F7801080F0808080F0800000000 -11B1:0000000000000000000000000000000000001EF002901E9010901EF000000000 -11B2:0000000000000000000000000000000000001E9002901EF010901EF000000000 -11B3:0000000000000000000000000000000000001E2002201E2010501E8800000000 -11B4:0000000000000000000000000000000000001EF002801EF010801EF000000000 -11B5:0000000000000000000000000000000000001EF802501E5010501EF800000000 -11B6:0000000000000000000000000000000000001E6003F81E6010901E6000000000 -11B7:00000000000000000000000000000000000007F004100410041007F000000000 -11B8:0000000000000000000000000000000000000410041007F0041007F000000000 -11B9:000000000000000000000000000000000000122012201E2012501E8800000000 -11BA:0000000000000000000000000000000000000040004000C003201C1000000000 -11BB:0000000000000000000000000000000000000120012003A00C50318800000000 -11BC:00000000000000000000000000000000000001C002200220022001C000000000 -11BD:00000000000000000000000000000000000007F0008000800140022000000000 -11BE:00000000000000000000000000000000000001E0000007F8004003A00C180000 -11BF:00000000000000000000000000000000000007F0001007F00010001000000000 -11C0:00000000000000000000000000000000000007F0040007F0040007F000000000 -11C1:0000000000000000000000000000000000000FF00240024002400FF000000000 -11C2:000000000000000000000000000001C0000007F0000001C0022001C000000000 -11C3:0000000000000000000000000000000000007E7C0204027C0240027C00000000 -11C4:00000000000000000000000000000000789E0882088209420A22000000000000 -11C5:00000000000000000000000000000000000021FC2004200420043F8400000000 -11C6:000000000000000000000000000000000000207C2040204020403E7C00000000 -11C7:00000000000000000000000000000000000020202020202020503E8800000000 -11C8:00000000000000000000000000000000000040104028404440827CFE00000000 -11C9:000000000000000000000000000000000000207C2040207C20403E7C00000000 -11CA:0000000000000000000000000000000000003E7C2004200420043E0400000000 -11CB:0000000000000000000000000000000000003E7C2004207C20403E7C00000000 -11CC:0000000000000000000000000000000000007BC408447844404A785100000000 -11CD:0000000000000000000000000000000000003E4002403E4020403E7C00000000 -11CE:0000000000000000000000000000000000003E7C02403E4020403E7C00000000 -11CF:000000000000000000000000000000000000F78C143FF40C8412F78C00000000 -11D0:0000000000000000000000000000000000003E7C02043E7C20403E7C00000000 -11D1:0000000000000000000000000000000000007BDE0A427A4242427BC200000000 -11D2:0000000000000000000000000000000000007BC40A447A44424A7BD100000000 -11D3:0000000000000000000000000000000000007A440A447BC4424A7BD100000000 -11D4:000000000000000000000000000000000000F48C14BFF78C8492F78C00000000 -11D5:0000000000000000000000000000004800783E4802783E3020483E3000000000 -11D6:00000000000000000000000000000000000078880888788841547A2200000000 -11D7:0000000000000000000000000000000000003C2004503C8821043DFC00000000 -11D8:0000000000000000000000000000000000003E7C02043E7C20043E0400000000 -11D9:0000000000000000000000000000000000003E3802FE3E3820443E3800000000 -11DA:0000000000000000000000000000000000003E7C2204220422043E0400000000 -11DB:0000000000000000000000000000000000003E7C2204227C22403E7C00000000 -11DC:0000000000000000000000000000000000003E442244227C22443E7C00000000 -11DD:0000000000000000000000000000000000001F101110111011281F4400000000 -11DE:0000000000000000000000000000000000007C444444444444AA7D1100000000 -11DF:0000000000000000000000000000000000003E102228224422823EFE00000000 -11E0:0000000000000000000000000000000000383E0022FE220822343EC200000000 -11E1:0000000000000000000000000000000000003E3822FE223822443E3800000000 -11E2:00000000000000000000000000000FE008200FE0000003800440038000000000 -11E3:000000000000000000000000000000000000227C22043E7C22403E7C00000000 -11E4:000000000000000000000000000000000000227C22283E2822283E7C00000000 -11E5:000000000000000000000000000000000000223822FE3E3822443E3800000000 -11E6:0000000000000000000000000000041007F0041007F001C0022001C000000000 -11E7:00000000000000000000000000000000000004F8040804080A08110800000000 -11E8:000000000000000000000000000000000000047C044004400A40117C00000000 -11E9:00000000000000000000000000000000000008F8080808F8148022F800000000 -11EA:00000000000000000000000000000000000004440444047C0A44117C00000000 -11EB:00000000000000000000000000000000000001000280044008201FF000000000 -11EC:0000000000000000000000000000000000000E7C1104110411040E0400000000 -11ED:00000000000000000000000000000000000039DC444444444444384400000000 -11EE:0000000000000000000000000000000000001C382244224422441C3800000000 -11EF:0000000000000000000000000000000000001C7C2204227C22041C0400000000 -11F0:0000000000000000000000000000010001000380044004400440038000000000 -11F1:0000000000000000000000000000000000001C202220222022501C8800000000 -11F2:000000000000000000000000000000000000382044504488450439FC00000000 -11F3:0000000000000000000000000000000000003E441444147C14443E7C00000000 -11F4:000000000000000000000000000000000FF002400FF003C0042003C000000000 -11F5:0000000000000000000000000000000000001C407F401C4022401C7C00000000 -11F6:0000000000000000000000000000000000001C7C7F041C7C22401C7C00000000 -11F7:0000000000000000000000000000000000001C7C7F441C4422441C7C00000000 -11F8:0000000000000000000000000000000000001C447F441C7C22441C7C00000000 -11F9:00000000000000000000000000000000000003800FE003800440038000000000 -11FA:0000000000000000000000000000000000003E40024002400240027C00000000 -11FB:0000000000000000000000000000000000003E440244027C0244027C00000000 -11FC:0000000000000000000000000000000000383E0002FE0208023402C200000000 -11FD:0000000000000000000000000000000000003E7C0204027C0204020400000000 -11FE:0000000000000000000000000000000000003E3802FE02380244023800000000 -11FF:00000000000000000000000000000000000020402040204020403E7C00000000 +1161:0000000000800080008000800080008000F00080008000800080008000800080 +1162:0000000002200220022002200220022003E00220022002200220022002200220 +1163:00000000008000800080008000F000800080008000F000800080008000800080 +1164:00000000022002200220022003E002200220022003E002200220022002200220 +1165:0000000000800080008000800080008007800080008000800080008000800080 +1166:000000000120012001200120012001200F200120012001200120012001200120 +1167:0000000000800080008000800780008000800080078000800080008000800080 +1168:0000000001200120012001200F200120012001200F2001200120012001200120 +1169:00000000000000000000000000000000000000000080008000807FFF00000000 +116A:00000000000400040004000400040004000700040204020402047FF400040004 +116B:00000000001200120012001200120012001E00120412041204127FD200120012 +116C:00000000000400040004000400040004000400040204020402047FF400040004 +116D:00000000000000000000000000000000000000000220022002207FFF00000000 +116E:000000000000000000000000000000007FFF0080008000800080008000800080 +116F:000000000004000400040004000400047FF402040204023C0204020402040204 +1170:000000000012001200120012001200127FD20412041204F20412041204120412 +1171:000000000004000400040004000400047FF40204020402040204020402040204 +1172:000000000000000000000000000000007FFF0220022002200220022002200220 +1173:000000000000000000000000000000007FFF0000000000000000000000000000 +1174:00000000000400040004000400040004000400040004000400047FF400040004 +1175:0000000000800080008000800080008000800080008000800080008000800080 +1176:000000000008000800080008000F0008000800080088008000807FFF00000000 +1177:000000000008000800080008000F000800080008000800007FFF008000800080 +1178:0000000000080008000F00080008000F000800080088008000807FFF00000000 +1179:0000000000080008000F00080008000F000800080228022002207FFF00000000 +117A:00000000000800080008000800780008000800080088008000807FFF00000000 +117B:0000000000080008000800080078000800080008000800007FFF008000800080 +117C:00000000000800080008000800780008000800080008000000007FFF00000000 +117D:00000000000800080078000800080078000800080088008000807FFF00000000 +117E:0000000000080008007800080008007800080008000800007FFF008000800080 +117F:00000000000400040004000400040004003C00040204020402047FF400040004 +1180:0000000000120012001200120012001200F200120412041204127FD200120012 +1181:00000000001200120012001200F20012001200F20412041204127FD200120012 +1182:000000000000000000000080008000807FFF00000080008000807FFF00000000 +1183:000000000000000000000080008000807FFF0000000000007FFF008000800080 +1184:00000000000400040004000400070004000400040887088408847FF400040004 +1185:000000000012001200120012001E00120012001E1112111211127FD200120012 +1186:000000000004000400040004003C00040004003C0884088408847FF400040004 +1187:000000000000000000000220022002207FFF00000080008000807FFF00000000 +1188:00000000000400040004000400040004000400040884088408847FF400040004 +1189:0000000000040004000400040004000400077FF4020402040204020402040204 +118A:00000000001200120012001200120012001E7FD2041204120412041204120412 +118B:00000000000800080008000800083FE8020802780208020800007FFF00000000 +118C:000000000012001200120012001200127FD2041204F20412041204F204120412 +118D:00000000000000000000000000007FFF00800080008000007FFF008000800080 +118E:0000000000040004000400040004000400077FF4088408840884088408840884 +118F:0000000000040004000400040004000400047FF40884088408BC088408840884 +1190:0000000000120012001200120012001200127FD2111211121172111211121112 +1191:0000000000040004000400040004000400047FF4088408BC0884088408BC0884 +1192:0000000000120012001200120012001200127FD2111211721112111211721112 +1193:00000000000000000000000000007FFF02200220022000007FFF008000800080 +1194:0000000000040004000400040004000400047FF4088408840884088408840884 +1195:000000000000000000000000000000007FFF0000000000007FFF008000800080 +1196:000000000000000000000000000000007FFF00000000000000007FFF00000000 +1197:00000000000800080008000800083FE800080008000800007FFF008000800080 +1198:0000000000800480048004800480048004F00480048004800480048004800080 +1199:00000000008004800480048004F004800480048004F004800480048004800080 +119A:00000000000800080008000800080008000800080088008000807FFF00000000 +119B:0000000000080008000800080008000800080008000800007FFF008000800080 +119C:00000000000800080008000800080008000800080008000000007FFF00000000 +119D:0000000000080008000800080008000800080008000800000180018000000000 +119E:0000000000000000000000000000000000000000000000000180018000000000 +119F:00000000000400040004000400040004003C0004000400040604060400040004 +11A0:0000000000000000000000000000000001800180000000007FFF008000800080 +11A1:0000000000040004000400040004000400040004000400040304030400040004 +11A2:0000000000000000000000000000000000000000000000000630063000000000 +11A3:000000000008000800080008000F0008000800080008000000007FFF00000000 +11A4:0000000000080008000E00080008000E00080008000800007FFF008000800080 +11A5:0000000000200120012001200F3C0120012001200F3C01200120012001200020 +11A6:00000000000400040004000400070004000400040207020402047FF400040004 +11A7:000000000012001200120012001E00120012001E0412041204127FD200120012 +11A8:00000000000000000FF800080008000800080008000800080008000000000000 +11A9:00000000000000001F7C01040104010401040104010401040104000000000000 +11AA:00000000000000001F1001100110011001280128014401440182000000000000 +11AB:00000000000000000800080008000800080008000800080007F8000000000000 +11AC:000000000000000010FE10101010101010281028104410440F82000000000000 +11AD:00000000000000001038100010FE100010381044104410440F38000000000000 +11AE:00000000000000000FF8080008000800080008000800080007F8000000000000 +11AF:00000000000000000FF80008000800080FF008000800080007F8000000000000 +11B0:00000000000000001F7C0104010401041E041004100410040F04000000000000 +11B1:00000000000000001F7C0144014401441E441044104410440F3C000000000000 +11B2:00000000000000001F440144014401441E7C1044104410440F3C000000000000 +11B3:00000000000000001F100110011001101E281028104410440F82000000000000 +11B4:00000000000000001F7C0140014001401E781040104010400FBC000000000000 +11B5:00000000000000001F7E0100012401241E241024102410240F7E000000000000 +11B6:00000000000000001F38010001FE01001E381044104410440F38000000000000 +11B7:00000000000000000FF8080808080808080808080808080807F8000000000000 +11B8:000000000000000008080808080808080FF808080808080807F8000000000000 +11B9:000000000000000011101110111011101F281128114411440F82000000000000 +11BA:0000000000000000008000800080014001400220022004100808000000000000 +11BB:000000000000000004100410041004100A280A28114411442082000000000000 +11BC:000000000000000003E0041008080808080808080808041003E0000000000000 +11BD:00000000000000000FF800800080014001400220022004100808000000000000 +11BE:000000000000000003E000000FF8008000800140022004100808000000000000 +11BF:00000000000000000FF80008000800080FF80008000800080008000000000000 +11C0:00000000000000000FF80800080008000FF808000800080007F8000000000000 +11C1:00000000000000001FFC04100410041004100410041004101FFC000000000000 +11C2:000000000000000003E000001FFC000003E004100410041003E0000000000000 +11C3:00000000000000001F7C0104010401040178014001400140013C000000000000 +11C4:00000000000000003E5E02420242024202A202A202A203120312000000000000 +11C5:0000000000000000107C10041004100410041004100410040F04000000000000 +11C6:0000000000000000107C10401040104010401040104010400F3C000000000000 +11C7:0000000000000000101010101010101010281028104410440F82000000000000 +11C8:0000000000000000101010101010102810281044104410820FFE000000000000 +11C9:0000000000000000107C10401040104010781040104010400F3C000000000000 +11CA:00000000000000001F7C10041004100410041004100410040F04000000000000 +11CB:00000000000000001F7C10041004100410781040104010400F3C000000000000 +11CC:00000000000000007BC4084408440844704A404A404A40513851000000000000 +11CD:00000000000000001F400140014001401F401040104010400F3C000000000000 +11CE:00000000000000001F7C0140014001401F401040104010400F3C000000000000 +11CF:00000000000000007BCC0A000A3F0A00720C42124212421239CC000000000000 +11D0:00000000000000001F7C0104010401041F781040104010400F3C000000000000 +11D1:00000000000000007BDE0A420A420A42724242424242424239C2000000000000 +11D2:00000000000000007BC40A440A440A44724A424A424A425139D1000000000000 +11D3:00000000000000007A440A440A440A4473CA424A424A425139D1000000000000 +11D4:00000000000000007A4C0A400A7F0A4073CC42524252425239CC000000000000 +11D5:00000000000000441F44017C0144013C1F001038104410440F44003800000000 +11D6:00000000000000003C880488048804883D542154215422221E22000000000000 +11D7:00000000000000001F100110011001281E281044104410820FFE000000000000 +11D8:00000000000000001F7C0104010401041E7C1004100410040F04000000000000 +11D9:00000000000000001FFE0100013801441E441044104410440F38000000000000 +11DA:00000000000000001F7C11041104110411041104110411040F04000000000000 +11DB:00000000000000001F7C11041104110411781140114011400F3C000000000000 +11DC:00000000000000001F44114411441144117C1144114411440F3C000000000000 +11DD:00000000000000001F1011101110111011281128114411440F82000000000000 +11DE:00000000000000003C8824882488248825542554255426221E22000000000000 +11DF:00000000000000001F1011101110112811281144114411820FFE000000000000 +11E0:00000000000000001F38110011FE111011101128112811440F82000000000000 +11E1:00000000000000001F38110011FE110011381144114411440F38000000000000 +11E2:0000000000000FF808080808080807F8000007F008080808080807F000000000 +11E3:0000000000000000117C1104110411041F781140114011400F3C000000000000 +11E4:0000000000000000117E1100112411241F241124112411240F7E000000000000 +11E5:00000000000000001138110011FE11001F381144114411440F38000000000000 +11E6:000000000000080808080FF8080807F8000007F008080808080807F000000000 +11E7:0000000000000000047C0404040404040A040A04110411042084000000000000 +11E8:0000000000000000047C0440044004400A400A401140114020BC000000000000 +11E9:0000000000000000047C0404040404040A780A401140114020BC000000000000 +11EA:000000000000000004440444044404440A7C0A441144114420BC000000000000 +11EB:0000000000000000008000800140014002200410041008080FF8000000000000 +11EC:00000000000000000E7C11041104110411041104110411040E04000000000000 +11ED:000000000000000033DE48424842484248424842484248423042000000000000 +11EE:00000000000000000E3811441144114411441144114411440E38000000000000 +11EF:00000000000000000E7C110411041104117C1104110411040E04000000000000 +11F0:00000000000000000080008003E00410080808080808041003E0000000000000 +11F1:0000000000000000041004100E10111011281128114411440E82000000000000 +11F2:0000000000000000041004100E28112811281144114411820EFE000000000000 +11F3:00000000000000003F44004412441244127C1244124412443F3C000000000000 +11F4:0000000000001FFC0410041004101FFC000007F008080808080807F000000000 +11F5:00000000000000000E4000403FC000400E401140114011400E3C000000000000 +11F6:00000000000000000E7C00043F8400040E781140114011400E3C000000000000 +11F7:00000000000000000E7C00443FC400440E441144114411440E3C000000000000 +11F8:00000000000000000E4400443FC400440E7C1144114411440E3C000000000000 +11F9:00000000000000000FF8000001C00220041004100410022001C0000000000000 +11FA:00000000000000001F400140014001400140014001400140013C000000000000 +11FB:00000000000000001F44014401440144017C014401440144013C000000000000 +11FC:00000000000000001F38010001FE011001100128012801440182000000000000 +11FD:00000000000000001F7C010401040104017C0104010401040104000000000000 +11FE:00000000000000001F38010001FE010001380144014401440138000000000000 +11FF:0000000000000000104010401040104010401040104010400F3C000000000000 1200:00000000000001C030C030C030C030C030C030C0318031801F000E0000000000 1201:00000000000001C030C030C030C030FC30CC30C0318031801F000E0000000000 1202:0000000006600C600C600C600C6007C003C000C001800300033003F000000000 @@ -5063,7 +5063,7 @@ 13C6:00000000FE1010101010101010FE0000 13C7:000000000C1202424A4A4A4A4A340000 13C8:00000000661919292A48484848300000 -13C9:00000000F1A122222224242428100000 +13C9:00000000A3A566242414141408080000 13CA:000000001C2222029AA2A2A2A25C0000 13CB:000000003C4240403C404442423C0000 13CC:0000000042424242427E4242423C0000 @@ -5156,7 +5156,7 @@ 1423:00000000780404047800000000000000 1424:00000000384444443800000000000000 1425:00000000091224489000000000000000 -1426:00000000242424240000000000000000 +1426:00000000242424242400000000000000 1427:00000000000000001818000000000000 1428:0000000000007C000000000000000000 1429:0000000010107C101000000000000000 @@ -5193,7 +5193,7 @@ 1448:00000180018000200C400C800100020004000400020001000080004000200000 1449:00000000040810201008040000000000 144A:00000000101010101000000000000000 -144B:00000000202038242400000000000000 +144B:00000000000020203824240000000000 144C:000000000000000000001008100810081008100810081008081007E000000000 144D:0180024002400180000007E00810100810081008100810081008100800000000 144E:0000000000000000000007E00810100810081008100810081008100800000000 @@ -5267,9 +5267,9 @@ 1492:00000000001C22222202C2C202020000 1493:00000000007088888B0B080808080000 1494:00000000000E1111D1D0101010100000 -1495:00000000007088888880868680800000 +1495:00000000003844444440464640400000 1496:00000C0C000E1111D1D0101010100000 -1497:000060600070888888808C8C80800000 +1497:00003030003844444440464640400000 1498:00000000000202C2C2022222221C0000 1499:00000000000808080B0B888888700000 149A:00000606000202C2C2022222221C0000 @@ -5327,7 +5327,7 @@ 14CE:0000000000000000000000000C000C0000000E301130110011000FF000000000 14CF:0000000000000000000000001980198000000E001100110011000FF000000000 14D0:000000003048483F0000000000000000 -14D1:000000002222221C0000000000000000 +14D1:00000000000044444444380000000000 14D2:000000000609097E0000000000000000 14D3:0000000000000000000000000000000000001FE000100010001000E000000000 14D4:0000000000000000060009000900060000000FF01000100010000E0000000000 @@ -5380,7 +5380,7 @@ 1503:00C0C000808086E61008080808080000 1504:0000000010D0D01C02C1C10101010000 1505:00000000202030080808000000000000 -1506:00000000182010083000000000000000 +1506:00000000000018201008300000000000 1507:00000000080818202020000000000000 1508:000000002020201C0000000000000000 1509:00000000202038041C24180000000000 @@ -5438,7 +5438,7 @@ 153D:000000001010D0D0101FC2C408100000 153E:0000000020203C081020000000000000 153F:00000000282854540000000000000000 -1540:0000000010107C101000000000000000 +1540:00000000000010107C10100000000000 1541:00000000000044281028440000000000 1542:0000000000000000000000000000000010F010801080108010800F0000000000 1543:000000000000000000000000000000001E10021002100210021001E000000000 @@ -5566,10 +5566,10 @@ 15BD:0000000000000000000000100010001000100010011002900450083000000000 15BE:0000000000000000000008000800080008000800088009400A200C1000000000 15BF:0000000000000000000008300450029001100010001000100010001000000000 -15C0:0000000000000000000000100010001007100890089000500050003000000000 -15C1:0000000000000000000008000800080008E0091009100A000A000C0000000000 -15C2:0000000000000000000000300050005008900890071000100010001000000000 -15C3:000000000000000000000C000A000A000910091008E008000800080000000000 +15C0:000000000000000000000E101110111010900090005000500050003000000000 +15C1:0000000000000000000010E01110111012101200140014001400180000000000 +15C2:00000000000000000000003000500050005000901090111011100E1000000000 +15C3:000000000000000000001800140014001400120012101110111010E000000000 15C4:00000000000000000000000000004002200410080FF004200240018000000000 15C5:00000000000000000000000000000180024004200FF010082004400200000000 15C6:0000000008000400020001000180014001200120014001800100020004000800 @@ -5612,7 +5612,7 @@ 15EB:00000000000000001FC0042004100490049004900490041004201FC000000000 15EC:00000000000000001FC0042004100410059005900410041004201FC000000000 15ED:000000000000000007F00840104010401040104010401040084007F000000000 -15EE:00000000101010107C00000000000000 +15EE:000000000000101010107C0000000000 15EF:00000000000000000000410441044104410441044104410422881C7000000000 15F0:000000000000000000001C702288410441044104410441044104410400000000 15F1:000000000000000000000FE00010001000100FE00010001000100FE000000000 @@ -5631,69 +5631,69 @@ 15FE:000000000000000000000FE00810041002500FE00250041008100FE000000000 15FF:000000000000000000000FE00810041002D00FE002D0041008100FE000000000 1600:0000000000000000000007F008100820084007F008400820081007F000000000 -1601:00000000442810000000000000000000 -1602:00000000004040404040444444380000 -1603:00000000003844444404040404040000 -1604:0000000000000000000000000000000000000FF0000800080008007000000000 -1605:0000000000000000000000000000000000000FF0000800480048000800700000 -1606:0000000000000000000000000000000000000FF0000800680068000800700000 -1607:000000000000000000000000000000000000070008000800080007F800000000 -1608:00000000000000000000400040004100410041044104410422881C7000000000 -1609:000000000000000000001C702288410441044104010401040004000400000000 -160A:000000000000000000001FE000100010001007E000100010001001E000000000 -160B:000000000000000000001FE000100410041007E004100410001001E000000000 +1601:00000000000000442810000000000000 +1602:000000000000000000001000100010001000100810081008081007E000000000 +1603:0000000000000000000007E00810100810081008000800080008000800000000 +1604:00000000000000001FC00020001000100010001000100010002001C000000000 +1605:00000000000000001FC00020001001100110011001100010002001C000000000 +1606:00000000000000001FC00020001000100310031000100010002001C000000000 +1607:000000000000000007000800100010001000100010001000080007F000000000 +1608:00000000000000000000400040004000400041044104410422881C7000000000 +1609:000000000000000000001C702288410441044104000400040004000400000000 +160A:000000000000000000001FE000100010001001E000100010001001E000000000 +160B:000000000000000000001FE000100110011001E001100110001001E000000000 160C:000000000000000000001FE000100010031007E003100010001001E000000000 -160D:000000000000000000000F001000100010000FC01000100010000FF000000000 -160E:000000000000000000001070108810881088104810081008081007E000000000 -160F:0000000000000000000007E008101008100812081108110811080E0800000000 -1610:00000000000000000FE00010000800080008070808880808081007E000000000 -1611:00000000000000000FE00010000800080088078808880808081007E000000000 -1612:00000000000000000FE0001000080008018807C809880808081007E000000000 -1613:000000000000000003F00408080808880870080008000800040003F800000000 -1614:000000000000000007F8003000C00100020004E005100410022001C000000000 -1615:00000000000000000FF00600018000400020039004500410022001C000000000 -1616:000000000000000001C0022004100450039000200040018006000FF000000000 -1617:00000000000000000000000010E0111012481488148818901860100000000000 -1618:00000000000000000000000021E02210244828C829483108311020E000000000 -1619:00000000000000000000000021F02208246428F429643104310820F000000000 -161A:000000000000000000000000100018601890148814881248111010E000000000 -161B:0000000000000000000000000008061809181128112812480888070800000000 -161C:000000000000100008780580020002000400047004880408020801F000000000 -161D:00000000000000000F801040102011200E2000200040004001A01E1000080000 -161E:000000000000200011F00A08040404C40904090808F010001000100000000000 -161F:000000000000200011F00A08044404C40944090808F010001000100000000000 -1620:000000000000200011F00A08046404E40964090808F010001000100000000000 -1621:000000000000000000000E081108110811081210101008600790000800040000 -1622:000000000000000000000000000000003C04040404040404020801F000000000 -1623:000000000000000000000000000000000F801040202020202020203C00000000 -1624:0000000000000400040004000780004000200020002000200040078000000000 -1625:0000000000000400040004000780004001200120012001200040078000000000 -1626:0000000000000400040004000780004000200320032000200040078000000000 -1627:00000000000000200020002001E002000400040004000400020001E000000000 -1628:000000000000000000000000000020003C04240404040404020801F000000000 -1629:000000000000000000000000000000000F801040202020202024203C00040000 -162A:0000000000000E00040004000780004000200020002000200040078000000000 -162B:0000000000000E00040004000780004001200120012001200040078000000000 -162C:0000000000000E00040004000780004000200320032000200040078000000000 -162D:00000000000000E00040004003C004000800080008000800040003C000000000 +160D:000000000000000000000F001000100010000F001000100010000FF000000000 +160E:0000000000000000000010F011081108110810C810081008081007E000000000 +160F:0000000000000000000007E008101008100813081088108810880F0800000000 +1610:00000000000000001FC00020001000100E1011101010101010200FC000000000 +1611:00000000000000001FC00020001001100F1011101110101010200FC000000000 +1612:00000000000000001FC00020001003100F9013101010101010200FC000000000 +1613:000000000000000007E0081010101010111010E010001000080007F000000000 +1614:00000000000000001FF003000400080008E0111010101010081007E000000000 +1615:00000000000000001FF00180004000200E2011101010101010200FC000000000 +1616:00000000000000000FC010201010101011100E200020004001801FF000000000 +1617:0000000000000000000010E013101408180818C811081108110810F000000000 +1618:0000000000000000000010E013101408184818C811481148110810F000000000 +1619:0000000000000000000010E01310140818C819E812C81208120811F000000000 +161A:0000000000000000000010F011081108110818C818081408131010E000000000 +161B:000000000000000000000F0810881088108813181018102808C8070800000000 +161C:000000000000000010F00B000400080008E0111011101010081007E000000000 +161D:00000000000000000FC010201010111011100E200020004001A01E1000000000 +161E:0000000000000000000010E00B100408080808C811081108110810F000000000 +161F:0000000000000000000010E00B100408084808C811481148110810F000000000 +1620:0000000000000000000010E00B10040808C809E812C81208120811F000000000 +1621:000000000000000000000F0810881088108813101010102008D0070800000000 +1622:000000000000000000001E08040808081008100810081008081007E000000000 +1623:0000000000000000000007E00810100810081008100810101020107800000000 +1624:000000000000000013C0142018101010001000100010001000201FC000000000 +1625:000000000000000013C0142018101110011001100110001000201FC000000000 +1626:000000000000000013C0142018101010031003100010001000201FC000000000 +1627:000000000000000007900850103010101000100010001000080007F000000000 +1628:000000000000000000081078104810201010100810081008081007E000000000 +1629:0000000000000000000007E00810100810081008101010201048107800080000 +162A:00000000000000001CE009100A080C08000800080008000800100FE000000000 +162B:00000000000000001CE009100A080C88008800880088000800100FE000000000 +162C:00000000000000001CE009100A080C08018801880008000800100FE000000000 +162D:000000000000000007380890105010301000100010001000080007F000000000 162E:000000000000000000001E78042008101008100810081008081007E000000000 162F:0000000000000000000007E008101008100810081008081004201E7800000000 -1630:000000000000080008000FE00010000800080008000800100FE0080008000000 -1631:000000000000080008000FE00010008800880088008800100FE0080008000000 -1632:000000000000080008000FE00010000801880188000800100FE0080008000000 -1633:0000000000000008000803F804000800080008000800040003F8000800080000 -1634:00000000000000000000000000000002701E101210101010082007C000000000 -1635:0000000000000000000000000000000003E00410080808084808780E40000000 -1636:000000001C00080008000FE00010000800080008000800100FE0080008000000 -1637:000000001C00080008000FE00010008800880088008800100FE0080008000000 -1638:000000001C00080008000FE00010000801880188000800100FE0080008000000 -1639:0000000000380010001007F008001000100010001000080007F0001000100000 -163A:000000000000000000000002610E210A210821082108210821081EF000000000 -163B:0000000000000000000000000F78108410841084108410845084708640000000 -163C:0000000000001C0008000FE00010001000100FE00010001000100FE008000000 -163D:0000000000001C0008000FE00010001008100FE00810001000100FE008000000 -163E:0000000000001C0008000FE0001000100C100FE00C10001000100FE008000000 -163F:000000000000007000200FE01000100010000FE01000100010000FE000200000 +1630:000000000000000013C01420181010100010001010101810142013C000000000 +1631:000000000000000013C01420181011100110011011101810142013C000000000 +1632:000000000000000013C01420181010100310031010101810142013C000000000 +1633:0000000000000000079008501030101010001000101010300850079000000000 +1634:000000000000000000081E78024804200810100810081008081007E000000000 +1635:0000000000000000000007E008101008100810080810042012401E7810000000 +1636:000000000000000039C01220141018100010001018101410122011C000000000 +1637:000000000000000039C01220141018900090009018901410122011C000000000 +1638:000000000000000039C01220141018100190019018101410122011C000000000 +1639:0000000000000000073808901050103010001000103010500890071000000000 +163A:000000000000000000081C78044808201010101011101110092006C000000000 +163B:0000000000000000000006C009201110111010101010082004481C7800080000 +163C:0000000000000000380013C014201810001000E000101810142013C000000000 +163D:0000000000000000380013C014201810021002E002101810142013C000000000 +163E:0000000000000000380013C0142018100210076002101810142013C000000000 +163F:0000000000000000003807900850103010000E00100010300850079000000000 1640:000000000000000000001818042004200810100810081008081007E000000000 1641:0000000000000000000007E00810100810081008081004200420181800000000 1642:000000000000000023E02410180800080008000800081808241023E000000000 @@ -5708,37 +5708,37 @@ 164B:00000000000023E024101808008820883888208800881808241023E000000000 164C:00000000000023E024101808000820C839E820C800081808241023E000000000 164D:0000000000000F881048203020002008203820082000203010480F8800000000 -164E:00000000000000000000000021081110111021082108210821081EF000000000 -164F:0000000000000000000000001EF0210821082108210811101110210800000000 -1650:00000000000009E006100010001000100FE0001000100010061009E000000000 -1651:00000000000009E006100010001002100FE0021000100010061009E000000000 -1652:00000000000009E006100010001003100FE0031000100010061009E000000000 -1653:0000000000000790086008000800080007F00800080008000860079000000000 -1654:000000000000000000000000210811101FF021082108210821081EF000000000 -1655:0000000000000000000000001EF021082108210821081FF01110210800000000 -1656:00000000000013E00C100408040804081FF00408040804080C1013E000000000 -1657:00000000000013E00C100408048804881FF00488048804080C1013E000000000 -1658:00000000000013E00C100408040804C81FF004C8040804080C1013E000000000 -1659:00000000000007C808301020102010200FF8102010201020083007C800000000 -165A:000010103C4038047810100000000000 -165B:000000000000000000000000238811101FF021082108210821081EF000000000 -165C:0000000000000000000000001EF021082108210821081FF01110238800000000 -165D:00000000000013E00C100408040814081FF01408040804080C1013E000000000 -165E:00000000000013E00C100408048814881FF01488048804080C1013E000000000 -165F:00000000000013E00C100408040814C81FF014C8040804080C1013E000000000 -1660:00000000000013E00C100408040814081FF01408040804080C1013E000000000 -1661:00000000000000000000000023881110111021082108210821081EF000000000 -1662:0000000000000000000000001EF0210821082108210811101110238800000000 -1663:00000000000009E006100010001008100FE0081000100010061009E000000000 -1664:00000000000009E00610001000100A100FE00A1000100010061009E000000000 -1665:00000000000009E00610001000100B100FE00B1000100010061009E000000000 -1666:0000000000000790086008000800081007F00810080008000860079000000000 -1667:00000000000000000000000023881110193025482388210821081EF000000000 -1668:0000000000000000000000001EF0210821082388254819301110238800000000 -1669:00000000000027E018100808040822083FF0220804080808181027E000000000 -166A:00000000000027E018100808044822483FF0224804480808181027E000000000 -166B:00000000000027E018100808040822683FF0226804080808181027E000000000 -166C:0000000000000FC810302020204020881FF820882040202010300FC800000000 +164E:00000000000000000000311809200920111021082108210821081EF000000000 +164F:000000000000000000001EF02108210821082108111809200920311800000000 +1650:00000000000011E012100C10001000101FE0001000100C10121011E000000000 +1651:00000000000011E012100C10009000901FE0009000900C10121011E000000000 +1652:00000000000011E012100C10001001901FE0019000100C10121011E000000000 +1653:0000000000000F1010901060100010000FF010001000106010900F1000000000 +1654:00000000000000000000311809200FE0111021082108210821081EF000000000 +1655:000000000000000000001EF0210821082108210811180FE00920311800000000 +1656:00000000000011E012100C10041004101FE0041004100C10121011E000000000 +1657:00000000000011E012100C10049004901FE0049004900C10121011E000000000 +1658:00000000000011E012100C10041005901FE0059004100C10121011E000000000 +1659:0000000000000F1010901060104010400FF010401040106010900F1000000000 +165A:0000000010103C503814781010000000 +165B:00000000000000000000339809200FE0111021082108210821081EF000000000 +165C:000000000000000000001EF0210821082108210811180FE00920339800000000 +165D:00000000000011E012100C10041014101FE0141004100C10121011E000000000 +165E:00000000000011E012100C10049014901FE0149004900C10121011E000000000 +165F:00000000000011E012100C10041015901FE0159004100C10121011E000000000 +1660:0000000000000F1010901060104010500FF010501040106010900F1000000000 +1661:00000000000000000000339809200920111021082108210821081EF000000000 +1662:000000000000000000001EF02108210821082108111809200920339800000000 +1663:00000000000011E012100C10001010101FE0101000100C10121011E000000000 +1664:00000000000011E012100C10009010901FE0109000900C10121011E000000000 +1665:00000000000011E012100C10001011901FE0119000100C10121011E000000000 +1666:0000000000000F1010901060100010100FF010101000106010900F1000000000 +1667:00000000000000000000339809200920155023882108210821081EF000000000 +1668:000000000000000000001EF02108210821082388155809200920339800000000 +1669:00000000000011E012100C10021011101FE0111002100C10121011E000000000 +166A:00000000000011E012100C10025011501FE0115002500C10121011E000000000 +166B:00000000000011E012100C10041012D01FE012D006100C10121011E000000000 +166C:0000000000000F1010901060108011100FF011101080106010900F1000000000 166D:00000000424224241818242442420000 166E:00000000000000000044281028440000 166F:000000000000000000001C70208820881C880478040800080008000800000000 @@ -5792,19 +5792,19 @@ 169F:00007FFE7BCE73BE7B8E7BB671CE7FFE7FFE73866DBE718E7DBE73BE7FFE0000 16A0:0092A4C890A0C0808080808080808000 16A1:00AA94A8D0A0C0808080808080808000 -16A2:0080C0A0908884848484848484848400 +16A2:00406050484442424242424242424200 16A3:0080C0A0908884829292929292929200 -16A4:0080C0A090888484B4B4848484848400 +16A4:00406050484442425A5A424242424200 16A5:0080C0A0908884C2A292929292929200 -16A6:00808080C0A090888890A0C080808000 -16A7:00808080C0A090A8A890A0C080808000 -16A8:0080C0A090C8A0908880808080808000 +16A6:00404040605048444448506040404000 +16A7:00404040605048545448506040404000 +16A8:00203028243028242020202020202000 16A9:0080C2A498C2A4988080808080808000 16AA:0080C2A498C0A0908080808080808000 -16AB:0080C0A090C8A0908880808080808000 +16AB:00406050486450484440404040404000 16AC:00101090503090583412181412101000 -16AD:00101010101018141218141210101000 -16AE:00080808080818284818284808080808 +16AD:00202020202030282430282420202000 +16AE:00080808080818284818284808080800 16AF:00101012141812345890305090101000 16B0:00101012141810305090305090101000 16B1:0080C0A09088848890A0A09088848200 @@ -5815,7 +5815,7 @@ 16B6:0042444850E0E0E04040404040404000 16B7:00828244442828101028284444828200 16B8:00828244442828545428284444828200 -16B9:0080C0A0908890A0C080808080808000 +16B9:00406050484448506040404040404000 16BA:008282828282E2928E82828282828200 16BB:0082828282E2928EE2928E8282828200 16BC:00101010925438103854921010101000 @@ -5842,7 +5842,7 @@ 16D1:000818284888081C1C1C080808080800 16D2:00605048444850606050484448506000 16D3:00404044485064485060404040404000 -16D4:00C0A090A890A0C0C0A090A890A0C000 +16D4:00605048544850606050485448506000 16D5:0082848890A0C08080C0A09088848200 16D6:0082C6C6AAAA92928282828282828200 16D7:0082C6AA92AAC6828282828282828200 @@ -5854,9 +5854,9 @@ 16DD:00824428102844828244281028448200 16DE:0082C6C6AAAA92929292AAAAC6C68200 16DF:00001028448282442810284482000000 -16E0:0000820847102AA0124002000200020002000200020002000200020002000000 +16E0:0000410423881550092001000100010001000100010001000100010001000000 16E1:00101010925438103854921010101000 -16E2:00000208031002A0024002000200020002000200020012002A00460082000000 +16E2:0000010401880150012001000100010001000100010009001500230041000000 16E3:00101010101010101038385454929200 16E4:00929254543838545438385454929200 16E5:0082C6AA92AAC68282C6AA92AAC68200 @@ -5866,19 +5866,19 @@ 16E9:00040C14244424140C04040404040400 16EA:004040E040444C546444040E04040400 16EB:00000000000038383800000000000000 -16EC:00007070700000000000707070000000 +16EC:00003838380000000000383838000000 16ED:000000383810D6FED610383800000000 16EE:00101814121010305090101010101000 16EF:00925454383810101010383854549200 16F0:00101010385492929292925438101000 16F1:00404040404040404854644442424200 -16F2:000808080888C8A89888808080808000 -16F3:00081C2A492A1C080808080808080800 +16F2:00040404044464544C44404040404000 +16F3:00081C2A49492A1C0808080808080800 16F4:0040404044464C5464C4440404040400 16F5:00081020100810201008102010080000 16F6:00808040402224181028488404020200 16F7:00404040407048444242424242424200 -16F8:00080808080808080808142222414100 +16F8:00101010101010101010284444828200 16F9:00007FFE7BCE73BE7B8E7BB671CE7FFE7FFE61CE6FB663C66FF66FCE7FFE0000 16FA:00007FFE7BCE73BE7B8E7BB671CE7FFE7FFE61866FB663866FB66FB67FFE0000 16FB:00007FFE7BCE73BE7B8E7BB671CE7FFE7FFE618E6FB6638E6FB66F8E7FFE0000 @@ -5891,15 +5891,15 @@ 1702:000000000000000003E0041000100020005000100010082007C0000000000000 1703:0000000000000000400020021FFC0100010043FC3C0200020004000000000000 1704:00000000000000001F6020900090011002900090009001103E0C000000000000 -1705:0000000000000000000000004E0C511221E201023E0C40000000000000000000 +1705:0000000000000000200040004E00310C011201E20102020C3C00400000000000 1706:0000000000000000401C4022404220801F000800100010000000000000000000 -1707:000000000000000040FC43022C02303010480F80000000000000000000000000 +1707:00000000000000000000000040F83F041000200020F81F040000000000000000 1708:000000000000000007C009201110121001000080010002000100000000000000 1709:0000000000000000780C08120812101010182024204010800F00000000000000 170A:00000000000000000FC010202010400840084008410822901C60000000000000 170B:00000000000000000006000870080BD00C300820084008800700000000000000 170C:00000000000000000004000A300A481C08100820084008800700000000000000 -170D:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE738E6DB66DB66DB6738E7FFE0000 +170D:00000000000000000000000040F83F041000200020F81F240010000000000000 170E:0000000000000000407C43823C82010000800100010000800300000000000000 170F:000000000000000001C00220041000080008010803080C900060000000000000 1710:0000000000000000000C001238220824084A0442048202840318000000000000 @@ -5907,7 +5907,7 @@ 1712:0000000C000C0000000000000000000000000000000000000000000000000000 1713:0000000000000000000000000000000000000000000000000000001800180000 1714:0000000000000000000000000000000000000000000000000000010003800100 -1715:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7B8673BE7B867BF671867FFE0000 +1715:00000000000000000000000000020002000200020002000200020004000801F0 1716:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7BCE73BE7B8E7BB671CE7FFE0000 1717:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7B8673F67BEE7BDE71DE7FFE0000 1718:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7BCE73B67BCE7BB671CE7FFE0000 @@ -5917,7 +5917,7 @@ 171C:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7BC673BE7BBE7BBE71C67FFE0000 171D:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7B8E73B67BB67BB6718E7FFE0000 171E:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7B8673BE7B8E7BBE71867FFE0000 -171F:00007FFE7B8673F67BEE7BDE71DE7FFE7FFE7B8673BE7B8E7BBE71BE7FFE0000 +171F:00000000000001E00210021004600410042008C0482030400780000000000000 1720:000000000000000000040008181068200840088009000A000C00000000000000 1721:000000000000000000040008181068200848089009200A000C00000000000000 1722:000000000000000007E000400080010007F00020004000800100000000000000 @@ -6157,7 +6157,7 @@ 180C:AAAA0001BC442045B8282029A010000180001C79A00418398440387D80005555 180D:AAAA0001BC442045B8282029A010000180001C79A00418398404387980005555 180E:AAAA0001A2443645AA282229A2100001800001E1820001C1802003C180005555 -180F:00007FFE7BCE73B67BCE7BB671CE7FFE7FFE73866DBE6D8E6DBE73BE7FFE0000 +180F:AAAA0001BC442045B8282029A010000180001C45A044187D8404380580005555 1810:0000000003C0042004200810081008100810081008100420042003C000000000 1811:0000000003C0042004200810081008100410041000100820042003C000000000 1812:0000000003C00420042008100810081008100812081204240438020000000000 @@ -6361,7 +6361,7 @@ 18D8:00000000784040404040000000000000 18D9:000000003E4848300000000000000000 18DA:00000000080808106040400000000000 -18DB:0000000062928C000000000000000000 +18DB:00000000081410502000000000000000 18DC:00000008C8D414223E00000000000000 18DD:0000002026565088F800000000000000 18DE:18242418000000000000000000000000 @@ -6378,16 +6378,16 @@ 18E9:0000060600090905050F1111110E0000 18EA:000000000000000000000F001080128012800C98009800800080008000000000 18EB:000006060002020202324A4A423C0000 -18EC:0000000000300030000000300050005008900890071000100010001000000000 +18EC:00000000003000300000003000500050005000901090111011100E1000000000 18ED:00000000000000000000000042104210421642164210421042103DE000000000 18EE:000000000300030000000FE00010001000100FE00010001000100FE000000000 18EF:0000000000C000C0000007F008000800080007F008000800080007F000000000 18F0:000000000000000000001FC020002000200C1FCC2000200020001FC000000000 -18F1:00000180018000000FF00600018000400020039004500410022001C000000000 -18F2:00000000000000000000000000201860246C44AC44A0492022201C2000000000 +18F1:00000300030000001FF00180004000200E2011101010101010200FC000000000 +18F2:000000000000000000003C204220422042204C6C406C40A023201C2000000000 18F3:00000030101010103800000000000000 18F4:00000000586440404000000000000000 -18F5:000000003C4038047800000000000000 +18F5:0000000000003C403804780000000000 18F6:00007FFE7BCE73B67BCE7BB671CE7FFE7FFE61CE6FBE638E6FB66FCE7FFE0000 18F7:00007FFE7BCE73B67BCE7BB671CE7FFE7FFE61866FF663EE6FDE6FDE7FFE0000 18F8:00007FFE7BCE73B67BCE7BB671CE7FFE7FFE61CE6FB663CE6FB66FCE7FFE0000 @@ -6847,20 +6847,20 @@ 1ABE:00000000000000000000428181420000 1ABF:00000000000000000000000000005428 1AC0:00000000000000000000000000002854 -1AC1:00007FFE7B8673B67B867BB671B67FFE7FFE71EE6FCE6FEE6FEE71C67FFE0000 -1AC2:00007FFE7B8673B67B867BB671B67FFE7FFE71866FF66F866FBE71867FFE0000 -1AC3:00007FFE7B8673B67B867BB671B67FFE7FFE718E6FF66FC66FF6718E7FFE0000 -1AC4:00007FFE7B8673B67B867BB671B67FFE7FFE71B66FB66F866FF671F67FFE0000 -1AC5:00007FFE7B8673B67B867BB671B67FFE7FFE71866FBE6F866FF671867FFE0000 -1AC6:00007FFE7B8673B67B867BB671B67FFE7FFE71CE6FBE6F8E6FB671CE7FFE0000 -1AC7:00007FFE7B8673B67B867BB671B67FFE7FFE71866FF66FEE6FDE71DE7FFE0000 -1AC8:00007FFE7B8673B67B867BB671B67FFE7FFE71CE6FB66FCE6FB671CE7FFE0000 -1AC9:00007FFE7B8673B67B867BB671B67FFE7FFE71CE6FB66FC66FF671CE7FFE0000 -1ACA:00007FFE7B8673B67B867BB671B67FFE7FFE71866FB66F866FB671B67FFE0000 -1ACB:00007FFE7B8673B67B867BB671B67FFE7FFE718E6FB66F8E6FB6718E7FFE0000 -1ACC:00007FFE7B8673B67B867BB671B67FFE7FFE71C66FBE6FBE6FBE71C67FFE0000 -1ACD:00007FFE7B8673B67B867BB671B67FFE7FFE718E6FB66FB66FB6718E7FFE0000 -1ACE:00007FFE7B8673B67B867BB671B67FFE7FFE71866FBE6F8E6FBE71867FFE0000 +1AC1:40808040000000000000000000000000 +1AC2:02010102000000000000000000000000 +1AC3:00000000000000000000000040808040 +1AC4:00000000000000000000000002010102 +1AC5:C38181C3000000000000000000000000 +1AC6:24FF24FF240000000000000000000000 +1AC7:92926C00000000000000000000000000 +1AC8:10381000000000000000000000000000 +1AC9:44EE4400000000000000000000000000 +1ACA:0000000000000000000000000044EE44 +1ACB:49920000000000000000000000000000 +1ACC:7E201C423C0000000000000000000000 +1ACD:58644440800000000000000000000000 +1ACE:7C204438000000000000000000000000 1ACF:00007FFE7B8673B67B867BB671B67FFE7FFE71866FBE6F8E6FBE71BE7FFE0000 1AD0:00007FFE7B8673B67B867BB671B67FFE7FFE63CE6DB66DB66DB663CE7FFE0000 1AD1:00007FFE7B8673B67B867BB671B67FFE7FFE63EE6DCE6DEE6DEE63C67FFE0000 @@ -6986,7 +6986,7 @@ 1B49:000000000000000008F0144804280528052803C80100011000E0000000000000 1B4A:00000000000000001060285008501D502B5011900100011000E0000000000000 1B4B:00000000000000004302A2A522A572B5AAB544B5004D00000000000000000000 -1B4C:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE6DC66DBE61BE7DBE7DC67FFE0000 +1B4C:000000000000000030FC49024A024A720A0C0A040902073200400038010400F8 1B4D:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE6D8E6DB661B67DB67D8E7FFE0000 1B4E:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE6D866DBE618E7DBE7D867FFE0000 1B4F:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE6D866DBE618E7DBE7DBE7FFE0000 @@ -7035,8 +7035,8 @@ 1B7A:0000000000000000000000004000200078001000080000000000000000000000 1B7B:00000000000000000000900050002000300048007C0000000000000000000000 1B7C:0000000000000000000000000000300030000000000000000000000000000000 -1B7D:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE618E7DB67BB677B6778E7FFE0000 -1B7E:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE61867DBE7B8E77BE77867FFE0000 +1B7D:0000000000000000100029102AAA2AAAAAA4A440400000000000000000000000 +1B7E:00000000000000004500AAC828D528D525524F50B0A044803B00000000000000 1B7F:00007FFE7B8E73B67B8E7BB6718E7FFE7FFE61867DBE7B8E77BE77BE7FFE0000 1B80:0020005000200000000000000000000000000000000000000000000000000000 1B81:0022005400080000000000000000000000000000000000000000000000000000 @@ -7485,7 +7485,7 @@ 1D3C:0000003C42424242423C000000000000 1D3D:00000044443844444438000000000000 1D3E:0000007C42427C404040000000000000 -1D3F:0000007C42427C484442000000000000 +1D3F:00000078444478484444000000000000 1D40:0000007F080808080808000000000000 1D41:0000004242424242423C000000000000 1D42:000000444444546C6C44000000000000 @@ -7503,7 +7503,7 @@ 1D4E:00000000007C10101018001000000000 1D4F:00000040404850605048000000000000 1D50:00000000007649494949000000000000 -1D51:00000000005C6242424A040000000000 +1D51:00000000005864444444041800000000 1D52:00000000003844444438000000000000 1D53:00000000003844044438000000000000 1D54:00000000003844440000000000000000 @@ -7514,12 +7514,12 @@ 1D59:00000000007C08040478000000000000 1D5A:00000000004949494937000000000000 1D5B:00000000004444282810000000000000 -1D5C:000000387CFEFE7C38926C0000000000 -1D5D:0000003844447C42625C400000000000 +1D5C:00000000387C7C38926C000000000000 +1D5D:00000030484878446458404000000000 1D5E:00000000002252140810200000000000 1D5F:00000038404038444438000000000000 1D60:0000000000264949493E080800000000 -1D61:00000000006112141830488600000000 +1D61:00000000006212141830484600000000 1D62:00000000000000001000301010107C00 1D63:00000000000000000000586440404000 1D64:000000000000000000004444444C3400 @@ -7542,7 +7542,7 @@ 1D75:0000000010107C1010325C10100C0000 1D76:0000000000007E04086A9C10207E0000 1D77:00000000003C42423C041C2222225C40 -1D78:00004242427E42424242000000000000 +1D78:000000000044447C4444000000000000 1D79:0000000000007E04081010083C42423C 1D7A:000000000000004810501060105C7CE2114212421442184210422C4200000000 1D7B:0000000000007C10107C1010107C0000 @@ -7588,12 +7588,12 @@ 1DA3:0000004444444C340404000000000000 1DA4:0000001000301038107C000000000000 1DA5:0000000000301010100C000000000000 -1DA6:0000007C10101010107C000000000000 -1DA7:0000007C10107C10107C000000000000 +1DA6:00000000007C1010107C000000000000 +1DA7:00000000007C107C107C000000000000 1DA8:000000080018080808384C3200000000 1DA9:00000070101010101010100C00000000 1DAA:00000070101010101818083000000000 -1DAB:0000002020202020203E000000000000 +1DAB:0000000000202020203E000000000000 1DAC:00000000007649494949010600000000 1DAD:00000000004949494937010100000000 1DAE:00000000002C32222222204000000000 @@ -7601,7 +7601,7 @@ 1DB0:0000002232322A262622000000000000 1DB1:000000000038447C4438000000000000 1DB2:00000000103854545438100000000000 -1DB3:00000000003840380478403000000000 +1DB3:00000000003C40380478403000000000 1DB4:0000000C101010101010600000000000 1DB5:00000010107C1010100E020C00000000 1DB6:000000000022227F261A000000000000 @@ -7610,9 +7610,9 @@ 1DB9:0000000000CC44444830000000000000 1DBA:00000010282828444444000000000000 1DBB:00000000007C0810207C000000000000 -1DBC:0000007C04081020447C040300000000 -1DBD:0000007E02041826497E080800000000 -1DBE:00000000007E0408103C027C00000000 +1DBC:00000000007C0810207C040300000000 +1DBD:00000000007C0812257E040000000000 +1DBE:00000000007E04081C02423C00000000 1DBF:0000001824427E422418000000000000 1DC0:24100824000000000000000000000000 1DC1:24081024000000000000000000000000 @@ -7634,7 +7634,7 @@ 1DD1:0064924C000000000000000000000000 1DD2:00182414040810000000000000000000 1DD3:00926C00000000000000000000000000 -1DD4:EC127C906E0000000000000000000000 +1DD4:EC127E906E0000000000000000000000 1DD5:EC1272926C0000000000000000000000 1DD6:E1117A9A640000000000000000000000 1DD7:1C2020201C0810000000000000000000 @@ -7653,7 +7653,7 @@ 1DE4:1C201804380000000000000000000000 1DE5:18242060202000000000000000000000 1DE6:3C0418203C0000000000000000000000 -1DE7:001C24241C0000000000000000000000 +1DE7:001A24241A0000000000000000000000 1DE8:101C121C000000000000000000000000 1DE9:18242824380000000000000000000000 1DEA:38043C24180000000000000000000000 @@ -7672,7 +7672,7 @@ 1DF7:00484830000000000000000000000000 1DF8:00303000000000000000000000000000 1DF9:0000000000000000000000000000827C -1DFA:00007FFE7B8E73B67BB67BB6718E7FFE7FFE61866FB663866FB66FB67FFE0000 +1DFA:0000000000000000000000000000C0C0 1DFB:49499292000000000000000000000000 1DFC:000000000000000000000000000000000000000000000000000007E018182004 1DFD:0000000000000000000000324C00324C @@ -7836,7 +7836,7 @@ 1E9B:0010000C101010301010101010100000 1E9C:0000000C101010341830501010100000 1E9D:0000000C107C10301010101010100000 -1E9E:0000003E424444484C424242524C0000 +1E9E:000000003E4244484C424242524C0000 1E9F:000000001C20202018244242423C0000 1EA0:0000000010282844447C444444440010 1EA1:0000000000003C42023E4242463A0010 @@ -8248,7 +8248,7 @@ 2037:00000000FC7E2A150000000000000000 2038:00000000000000000000000000102844 2039:00000000000404080810080804040000 -203A:00000000202010100808101020200000 +203A:00000000002020101008101020200000 203B:00000000004922144914224900000000 203C:00000000242424242424240024240000 203D:000000003C4A4A0A0C08080008080000 @@ -8359,7 +8359,7 @@ 20A6:000000002222327F2A7F262622220000 20A7:0000000068585F5C6C4A4949494E0000 20A8:0000000070484B4C74545249494E0000 -20A9:0000002222227F2A7F36362222000000 +20A9:000000002222227F2A7F363622220000 20AA:000000000000F28AAAAAAAAAA2BC0000 20AB:000000020F023A4642424242463A007E 20AC:000000000C12207C207C2020120C0000 @@ -8382,7 +8382,7 @@ 20BD:000000003C2222227C207C2020200000 20BE:0000287CAAAAAA808080804020FE0000 20BF:00002828FC4242427C42424242FC2828 -20C0:00007FFE61CE7DB661B66FB661CE7FFE7FFE71CE6FB66FB66FB671CE7FFE0000 +20C0:000000003C4242404042423C007E0000 20C1:00007FFE61CE7DB661B66FB661CE7FFE7FFE71EE6FCE6FEE6FEE71C67FFE0000 20C2:00007FFE61CE7DB661B66FB661CE7FFE7FFE71866FF66F866FBE71867FFE0000 20C3:00007FFE61CE7DB661B66FB661CE7FFE7FFE718E6FF66FC66FF6718E7FFE0000 @@ -8456,15 +8456,15 @@ 2107:000000003E42404038404042423C0000 2108:000000007C4202121E120202423C0000 2109:40A0A0407E4040407C40404040400000 -210A:0000000000003A4642423E023F423C00 -210B:00000000127596141C34549494630000 +210A:00000000000000000000000003B006601CC00DC006C000E003800D8011000E00 +210B:00000000000000001A3026682E68167007E00E60166026602468183000000000 210C:000018B66068743666666666E6063408 210D:00000000715151515F51515151710000 210E:00000000000000400080008000F0018801080108021002100210042000000000 210F:000000000000005000E0038004F0018801080108021002100210042000000000 -2110:000000000C14240404060C1424283000 +2110:0000000000000004007800900130012800F0004000C000800980110012000C00 2111:00000000397FC68066086CA6663C0000 -2112:0000000C12123C101010107099660000 +2112:000000000000061809340864046803F000C000C01D88230826901C6000000000 2113:000000182424242830602020221C0000 2114:000000004848FE484A4D494949360000 2115:00000000715159595555535351710000 @@ -8473,11 +8473,10 @@ 2118:000000000000204C5222222A54505020 2119:000000007C525252525C505050700000 211A:000000001C32515151515151361E0100 -211B:000000402E113151515E545252210000 +211B:0000000000000000077018E820C424C418C800F001A031A223241E1800000000 211C:00000000446EB233363C3636A2C30000 211D:000000007E515151515E585452710000 211E:000000007C4242427C504A444A500000 -211F:000038087C4A4A4A7C6858484C4A0800 2120:00000000719B5531D100000000000000 2121:00000000FE525A525F00000000000000 2122:00000000F15B55515100000000000000 @@ -8490,15 +8489,15 @@ 2129:000000000000300808080808080C0000 212A:00000000424448506060504844420000 212B:1824180018242442427E424242420000 -212C:000000002E5151515E515151512E0000 +212C:000000000000073009C810C812C80CC800F001901188230826981C7000000000 212D:000000001624686866666468221C0000 212E:0000000000000000000007E00810181818181FF818001800081007E000000000 -212F:00000000000000182448704044380000 -2130:000000000E1220201C204044423C0000 -2131:000000003C42020404083E1020200000 +212F:00000000000000000000000000C0032006200C400F800C100C60078000000000 +2130:00000000000000600C90119011E00F8003C006000CC00D20042003C000000000 +2131:0000000000000E1C11E010C00CC000C001F000C81980218023001E0000000000 2132:0000000002020202023E0202027E0000 -2133:0000000063362A2A2A2A2A6AAA490000 -2134:0000000000001824534E424224180000 +2133:00000000000001CE02D602D6069405AC0DAC09481B581359A39AC18C00000000 +2134:000000000000000000000000007000A801A803180F160310032001C000000000 2135:00000000000044462214286472620000 2136:0000000000103E02020202023F7E0000 2137:0000000000403C1E0202020E32320000 @@ -9696,10 +9695,10 @@ 25DF:00000000000000004040201800000000 25E0:00000000001C22414100000000000000 25E1:00000000000000004141221C00000000 -25E2:0101030307070F0F1F1F3F3F7F7FFFFF -25E3:8080C0C0E0E0F0F0F8F8FCFCFEFEFFFF -25E4:FFFFFEFEFCFCF8F8F0F0E0E0C0C08080 -25E5:FFFF7F7F3F3F1F1F0F0F070703030101 +25E2:010101030307070F0F1F1F3F3F7F7FFF +25E3:808080C0C0E0E0F0F0F8F8FCFCFEFEFF +25E4:FFFEFEFCFCF8F8F0F0E0E0C0C0808080 +25E5:FF7F7F3F3F1F1F0F0F07070303010101 25E6:00000000000000384444443800000000 25E7:00000000007E727272727E0000000000 25E8:00000000007E4E4E4E4E7E0000000000 @@ -9718,21 +9717,21 @@ 25F5:0000000000003C428181F191523C0000 25F6:0000000000003C4281818F894A3C0000 25F7:0000000000003C4A898F8181423C0000 -25F8:00007E44485060400000000000000000 -25F9:00007E22120A06020000000000000000 -25FA:00000000000000000040605048447E00 +25F8:FF81818282848488889090A0A0C0C080 +25F9:FF818141412121111109090505030301 +25FA:80C0C0A0A090908888848482828181FF 25FB:0000000000000000007E424242427E00 25FC:00000000000000007E7E7E7E7E7E0000 25FD:000000000000000000003C24243C0000 25FE:00000000000000007C7C7C7C7C000000 -25FF:00000000000000000002060A12227E00 +25FF:010303050509091111212141418181FF 2600:0000084922001C3E3E1C002249080000 2601:000000002076FF7E0000000000000000 2602:000000001C3E7F080808081000000000 2603:8BC803C02FF104248A5028120A504994042147E008101088781E1088081007E0 2604:00000022222424282902304848300000 -2605:000000000008087F1C36220000000000 -2606:00000000080877222A36220000000000 +2605:0000010001000380038007C07FFE3FF81FF00FE007C00FE01EF0183020080000 +2606:000001000100028002800440783C2008101008200440092016D0183020080000 2607:00000000000204081020100A060E0000 2608:0000000000007E424448504A464E0000 2609:0000000000003C4281999981423C0000 @@ -9835,9 +9834,9 @@ 266A:00000000080C0A0A0808083878700000 266B:0000001C171111111171F1E70F0E0000 266C:0000001C17111D171171F1E70F0E0000 -266D:000040404040405C6646444850600000 -266E:00000040404E7E72424E7E7202020000 -266F:00000424263E7C6424263E7C64242000 +266D:00004040404058644448506000000000 +266E:000040444C54644C5464440400000000 +266F:000404262C34662C3464202000000000 2670:00000000140808493E49080808140000 2671:000000001C14086B5D6B080814080000 2672:03C005200A9812480AD004303004480A8C115009A005AE26525852861E5C0020 @@ -9914,7 +9913,7 @@ 26B9:000000000000422418FF182442000000 26BA:00000000000044444428282810FE0000 26BB:000000000000FE102828284444440000 -26BC:0000000000007E4242424A7E207E0000 +26BC:00000000000000FE8282829292FE101E 26BD:0000000001C007300F38173C100421C223E239CE1C1C180C09C807F001C00000 26BE:0000000001C006300C1812241004214220022142100412240C18063001C00000 26BF:000000007FFC4004438444444444438441044104410441C4410440047FFC0000 @@ -9928,7 +9927,7 @@ 26C7:8BC803C02FF107E48DB02FF20DB04E7407E147E00FF01F787FFE1F780FF007E0 26C8:0000072008CC10B22102208211040A1807E02000444000801010222044400000 26C9:00003FF820082008200820082008200820081010082004400280010000000000 -26CA:00003FF83FF83FF83FF83FF83FF83FF83FF83FF81FF00FE00380010000000000 +26CA:00003FF83FF83FF83FF83FF83FF83FF83FF81FF00FE007C00380010000000000 26CB:0000000000007FF04510489050506030401060305050489045107FF000000000 26CC:0000000000000000202010400880040002000100088010402020000000000000 26CD:00003C00420042008100FF00FF00FF0042004200004000A00110020804040FFE @@ -10656,7 +10655,7 @@ 299F:000000000000000000000618207E0000 29A0:00000000000000503028262830500000 29A1:0000000000000000413E631408080000 -29A2:00000000000000007E20100804020000 +29A2:00000000000000007E04081020400000 29A3:000000000000000040201008047E0000 29A4:000000000000000002040810207E007E 29A5:000000000000000040201008047E007E @@ -11238,7 +11237,7 @@ 2BE5:0000000000000000044004400380054007C00540038001000100010001000100 2BE6:0000000000000100038007C00100010001000100010002800440082010103FF8 2BE7:0000000000000000200820081110092007C00100010007C00920111020082008 -2BE8:00000040004000C000C001C01FC00FC007C003C001C003C00780060008000000 +2BE8:0000008000800180018003803F801F800F800780038007800F000C0010000000 2BE9:00000400040006000600070007F007E007C007800700078003C000C000200000 2BEA:0000010001000380038007407F3C3F081F100F6007400F201ED0183020080000 2BEB:0000010001000380038005C079FC21F811F00DE005C009E016F0183020080000 @@ -11309,7 +11308,7 @@ 2C2C:000000001C0404040404040408100000 2C2D:0000000082C2B28AFE8AB2C282020000 2C2E:00000000245456525252565A52520000 -2C2F:00007FFE61C67DBE61BE6FBE61C67FFE7FFE61867DBE618E6FBE61BE7FFE0000 +2C2F:000000004444444444444444447C1E18 2C30:0000000000001010107C545410100000 2C31:0000000000002A2A2A3E2020203E0000 2C32:00000000000044AA6C28444444380000 @@ -11357,7 +11356,7 @@ 2C5C:0000000000001C040404040408100000 2C5D:0000000000000262524A7E4A52620000 2C5E:00000000000024545652565A52520000 -2C5F:00007FFE61C67DBE61BE6FBE61C67FFE7FFE61866FBE618E7DBE61BE7FFE0000 +2C5F:000000000000444444444444447C1E18 2C60:000000002020207020702020203E0000 2C61:000000180808081C081C0808083E0000 2C62:000000001010101034581010101F0000 @@ -11456,8 +11455,8 @@ 2CBF:000000000000929292FF929292920000 2CC0:000000003C2222223C20FEA020202020 2CC1:0000000000003C2222223C20FEA02020 -2CC2:54107C1044929292929292926E027C80 -2CC3:000054107C104492929292926E027C80 +2CC2:54107C104492929292929292926E021C +2CC3:00000054107C104492929292926E021C 2CC4:000000407E020C307804020202047800 2CC5:0000000000407C0408103C0202423C00 2CC6:00000000040404080808081010102020 @@ -11857,17 +11856,17 @@ 2E50:00003FE00F8007080708071807F807F807F80718070807080F803FE000000000 2E51:00000FF803E021C021C031C03FC03FC03FC031C021C021C003E00FF800000000 2E52:000000007E02020202020202221C0000 -2E53:00007FFE61867DBE618E6FBE61867FFE7FFE618E6FF661C67DF6618E7FFE0000 -2E54:00007FFE61867DBE618E6FBE61867FFE7FFE61B66FB661867DF661F67FFE0000 -2E55:00007FFE61867DBE618E6FBE61867FFE7FFE61866FBE61867DF661867FFE0000 -2E56:00007FFE61867DBE618E6FBE61867FFE7FFE61CE6FBE618E7DB661CE7FFE0000 -2E57:00007FFE61867DBE618E6FBE61867FFE7FFE61866FF661EE7DDE61DE7FFE0000 -2E58:00007FFE61867DBE618E6FBE61867FFE7FFE61CE6FB661CE7DB661CE7FFE0000 -2E59:00007FFE61867DBE618E6FBE61867FFE7FFE61CE6FB661C67DF661CE7FFE0000 -2E5A:00007FFE61867DBE618E6FBE61867FFE7FFE61866FB661867DB661B67FFE0000 -2E5B:00007FFE61867DBE618E6FBE61867FFE7FFE618E6FB6618E7DB6618E7FFE0000 -2E5C:00007FFE61867DBE618E6FBE61867FFE7FFE61C66FBE61BE7DBE61C67FFE0000 -2E5D:00007FFE61867DBE618E6FBE61867FFE7FFE618E6FB661B67DB6618E7FFE0000 +2E53:000000000001020400303000C0C00000 +2E54:0000000000000002023C4000C0C00000 +2E55:00001E10101010107E10101010101E00 +2E56:00007808080808087E08080808087800 +2E57:00001E101010107E107E101010101E00 +2E58:000078080808087E087E080808087800 +2E59:00000004080810101000000000000000 +2E5A:00000020101008080800000000000000 +2E5B:00000000000000000010101008080400 +2E5C:00000000000000000008080810102000 +2E5D:00000000000000000618600000000000 2E5E:00007FFE61867DBE618E6FBE61867FFE7FFE61866FBE618E7DBE61867FFE0000 2E5F:00007FFE61867DBE618E6FBE61867FFE7FFE61866FBE618E7DBE61BE7FFE0000 2E60:00007FFE61867DBE618E6FBE61867FFE7FFE73CE6FB663B66DB673CE7FFE0000 @@ -12270,25 +12269,25 @@ 2FED:00007FFE61867DBE618E6FBE61BE7FFE7FFE618E6FB663B66FB6618E7FFE0000 2FEE:00007FFE61867DBE618E6FBE61BE7FFE7FFE61866FBE638E6FBE61867FFE0000 2FEF:00007FFE61867DBE618E6FBE61BE7FFE7FFE61866FBE638E6FBE61BE7FFE0000 -2FF0:EDB600008102810200008102810200008102810200008102810201008002B6DA -2FF1:EDB6000080028002800200008002800236D8800280020000800280020000EDB6 -2FF2:EDB600008442844280020440844280020440844280020440844284420000EDB6 -2FF3:EDB600008002800280020000B6DA800200008002B6DA0000800280020000EDB6 -2FF4:AAAA00008002155080021010800210108002101090120000955280020000AAAA -2FF5:DBB60000800280020D608822800208208002882288220000882288220000DBB6 -2FF6:DBB600008822882200008822882200008822800288220D60800280020000DBB6 -2FF7:DB6D000180008001056D84008001040180008401056D8000800100018000B6DB -2FF8:DB6D0001800080010B6D8800800108018800800108018800800108018800B6DB -2FF9:DB6D00018000800136D18010800100118010800100118010800100118010B6DB -2FFA:DB6D08018800800108018800800108018800800108018B6C800100018000B6DB +2FF0:DBB600008102800201008002810200008102800281020000810280020100DBB6 +2FF1:DBB60000800280020000800280022AA88002800280020000800280020000DBB6 +2FF2:DBB600008442800204408002844200008442800284420000844280020440DBB6 +2FF3:DBB600008002800200008002AAAA000080028002AAAA0000800280020000DBB6 +2FF4:DBB600008002955200109002801210008012900280121000955280020000DBB6 +2FF5:DBB60000800280020AA08822800208208002882280020820800288220000DBB6 +2FF6:DBB600008822800208208002882200008822800288220AA0800280020000DBB6 +2FF7:DBB60000800280020AA88802800208008002880280020AA8800280020000DBB6 +2FF8:DBB60000800280020AA88002880200008802800288020000880280020800DBB6 +2FF9:DBB60000800280022AA08002802200008022800280220000802280020020DBB6 +2FFA:DBB608008002880200008802800208008002880280020AA8800280020000DBB6 2FFB:0000DB60802000009B6C902400009024902400009024DB64000010041B6C0000 -2FFC:00007FFE61867DBE618E6FBE61BE7FFE7FFE61C66FBE63BE6FBE6FC67FFE0000 -2FFD:00007FFE61867DBE618E6FBE61BE7FFE7FFE618E6FB663B66FB66F8E7FFE0000 -2FFE:00007FFE61867DBE618E6FBE61BE7FFE7FFE61866FBE638E6FBE6F867FFE0000 -2FFF:00007FFE61867DBE618E6FBE61BE7FFE7FFE61866FBE638E6FBE6FBE7FFE0000 +2FFC:DBB60000800280022AA08022800200208002802280022AA0800280020000DBB6 +2FFD:DBB600208002802200008022800200208002802280022AA0800280020000DBB6 +2FFE:DBB60000800280020000882290122AA89012882280020000800280020000DBB6 +2FFF:DBB614008102804200008022800200208002802288021080AA0290020800DBB6 3000:0000000000000000000000000000000000000000000000000000000000000000 -3001:000000000000000000000000000010000C000600020000000000000000000000 -3002:000000000000000000000000000000000C00120012000C000000000000000000 +3001:000000000000000000000000000000000000000010000C000600020000000000 +3002:00000000000000000000000000000000000000000C00120012000C0000000000 3003:0000000000000240024002400480048009000900000000000000000000000000 3004:0000060018202030412841A881448D0493044908440824101860018000000000 3005:00000000020001000100023003C8041008201240218000800040000000000000 @@ -12591,100 +12590,99 @@ 312E:00000180018000003FFC0080008007800800100010001008081007E000000000 312F:000000001FE0004000800100020007F801080108010801080150012000000000 3130:00007FFE63EE7DCE71EE7DEE63C67FFE7FFE63CE7DB671B67DB663CE7FFE0000 -3131:00000000000020081FFC08080008000800080008000800080008000000000000 -3132:00000000000041083FFC11080108010801080108010801080000000000000000 -3133:00000000000082607F1022100210023002280248024402820301000000000000 -3134:0000000000000000000030000800080008000800080807FC0000000000000000 -3135:00000000000000000204C1FE20A02020205023881D0402020000000000000000 -3136:00000000000000400038C40223FF21002078208423841C840078000000000000 -3137:000000000000000070101FF8100010001000100010080FFC0000000000000000 -3138:000000000000000062883FFC208020802080208023841C7E0000000000000000 -3139:00000000000020101FF80810001030101FF81000100010100FF8000000000000 -313A:00000000000082047FFE22840204FF044004400443043C040000000000000000 -313B:00000000000041443FFE114401447FC42044204423C41C7E0040000000000000 -313C:00000000000042083F04028402847EFC2084208423841CFC0000000000000000 -313D:00000000000084607E1024100410FE3040284048468439020000000000000000 -313E:00000000000042C43F7E024002447F7E2040204023441C3E0000000000000000 -313F:00000000000085087EFC04000400FE8440484048464A3BFF0000000000000000 -3140:00000000000084407E38050204FFFE0040384044464438380000000000000000 -3141:00000000000038100FF80810081008100810081008100FF80800000000000000 -3142:00000000002000101010081008100FF00810081008100FF00810000000000000 -3143:00000000000802842144114411441F7C1144114411441F7C1144000000000000 -3144:00000000000004604210221022103E102228222822443E442282000000000000 -3145:0000000002000180008000800080014001400220041008083004000000000000 -3146:00000000000008400420042004200A200A5011482084C3020000000000000000 -3147:0000000000000200010007C008201010101010101010082007C0000000000000 -3148:00000000000020101FF809000100010002800440082010106008000000000000 -3149:000000000000000081047FFE242004200A50095010882104C602000000000000 -314A:00000000040003E0000020081FFC088001400220041008083004000000000000 -314B:00000000000010080FFC0408000800F83F081008000800080008000000000000 -314C:00000000000038200FF0080008200FF008000800081007F80000000000000000 -314D:00000000000020101FF80800000008100420022042483FFC1000000000000000 -314E:000000000000040003C040083FFC100003C0042008100810042003C000000000 -314F:004000300010001000100012001F001000100010001000100010001000100000 -3150:0020011800C80048004800480078004800480048004800480048004800080000 -3151:00400030001000100012001F00100012001F0010001000100010001000100000 -3152:0020011800C80048004800780048004800780048004800480048004800080000 -3153:004000300010001000100010001003F001100010001000100010001000100000 -3154:0010008C006400240024002403E4012400240024002400240024002400040000 -3155:0040003000100010001003F00110001003F00110001000100010001000100000 -3156:0010008C00640024002403E40124002403E40124002400240024002400040000 -3157:000000000000000000000000010000800080008040823FFF1000000000000000 -3158:00400030001000100010001008100412041F05F07E1020100010001000100000 -3159:0010008C00640024002408240424043C042407E47C2420240024002400040000 -315A:00200018000800080008040802080208020803F87E0820080008000800080000 -315B:000000000000000000000000004004200220022042223FFF1000000000000000 -315C:00000000000000000000000040023FFF10800080008000800080008000800000 -315D:00200018000800080008000801E87E08280809F8088808080808080800080000 -315E:002000980048004800480048004803C87C4828480BC808480848084800080000 -315F:002000180008000800080008000801E87E082408040804080408040800080000 -3160:00000000000000000000000040023FFF12200220022002200220022002200000 -3161:00000000000000000000000000000000000040023FFF10000000000000000000 -3162:0020001800080008000800080008000801F87E08200800080008000800080000 -3163:0040003000100010001000100010001000100010001000100010001000100000 -3164:AAAA00018000000180000001913C11219F381121912000018000000180005555 -3165:000000000000C1802040204020402040204023441C3E00000000000000000000 -3166:000000000000C0C4207E204020402040204023421C3F00000000000000000000 -3167:000000000000C0202010201020102010202823481C8401020000000000000000 -3168:000000000000C0102010202820282044204423821CFF00000000000000000000 -3169:00000000000088507FE808480848FC54405440623C4100000000000000000000 -316A:00000000000042C83F7C024002407F402040204023441C3E0000000000000000 -316B:00000000000088907C480A480A48FFD442544E6233C100000000000000000000 -316C:0000000084207E2004200450FC504088408847043BFE00000000000000000000 -316D:00000000000084007E00050404FEFE4040384044464438380000000000000000 -316E:000000000000000862843F442244227C2244224422443F7C2044000000000000 -316F:00000000000062203F10221022102210222822283E4422820000000000000000 -3170:00000000000062103F102228222822442244224422823FFF2000000000000000 -3171:000030081FFC1008100810081FFC1100008007E0081010081008081007E00000 -3172:00000000000004000282827F42227E024202420242027E024202000000000000 -3173:00000000040002C8827C424042407E404240424042447E3E4200000000000000 -3174:000000000000114288BF48824882798249424A427A224C120000000000000000 -3175:0000000000001132889F48904890799049504A507A524C2F0000000000000000 -3176:0000000000000800860445FE44A07C20442044507C8847060000000000000000 -3177:00000000040002C4827E424042447E7E4240424042447E3E4200000000000000 -3178:0010200810081FF8100810081FF81108008007E0081010081008081007E00000 -3179:0010248812481E78124812481E781248008007E0081010081008081007E00000 -317A:000000000000090404FE044404040A040A0411042104C0840000000000000000 -317B:00000000000008000580044006400A400A401140214440BE0000000000000000 -317C:00000000000010C4087E08400840144014402240414480BE0000000000000000 -317D:000000000004100208820842087E144214422242217E40C20000000000000000 -317E:000000000000120209FF08900810142814282244414281810000000000000000 -317F:000000000100010002800280044004400820082010103FF80000000000000000 -3180:00000000181808083C3C4242424242424242424242423C3C0000000000000000 -3181:0000030001000FE0101020082008200820082008200810100FE0000000000000 -3182:00003000120479FE84A08420842084508450848885047A020000000000000000 -3183:000030001020782084508450848884888488850485047BFE0000000000000000 -3184:000020101FF80000042042483FFC1100008007E0081010081008081007E00000 -3185:0000000020401C3881027FFF20001C382244224422441C380000000000000000 -3186:0000000040083FFC1200010007C0082008200820082007C00000000000000000 -3187:004000300010001000100912091F091009F27E1F201000100010001000100000 -3188:0020011800C800480048047802482248127813C87C4820480048004800080000 -3189:0020001800080008000802081108090809080BE87C0820080008000800080000 -318A:00200018000800080008000801E87F0829780908097809080908090800080000 -318B:0020011800C80048004800480348FC4855C8144815C814481448004800080000 -318C:002000180008000800080008000801E87F082908090809080908090800080000 -318D:0000000000000000000000000100038001000000000000000000000000000000 -318E:0020001800080008000800080008000802080708020800080008000800080000 +3131:00000000000000000FF800080008000800080008000800080008000000000000 +3132:00000000000000001F7C01040104010401040104010401040104000000000000 +3133:00000000000000001F1001100110011001280128014401440182000000000000 +3134:00000000000000000800080008000800080008000800080007F8000000000000 +3135:000000000000000010FE10101010101010281028104410440F82000000000000 +3136:00000000000000001038100010FE100010381044104410440F38000000000000 +3137:00000000000000000FF8080008000800080008000800080007F8000000000000 +3138:00000000000000001F7C10401040104010401040104010400F3C000000000000 +3139:00000000000000000FF80008000800080FF008000800080007F8000000000000 +313A:00000000000000001F7C0104010401041E041004100410040F04000000000000 +313B:00000000000000001F7C0144014401441E441044104410440F3C000000000000 +313C:00000000000000001F440144014401441E7C1044104410440F3C000000000000 +313D:00000000000000001F100110011001101E281028104410440F82000000000000 +313E:00000000000000001F7C0140014001401E781040104010400FBC000000000000 +313F:00000000000000001F7E0100012401241E241024102410240F7E000000000000 +3140:00000000000000001F38010001FE01001E381044104410440F38000000000000 +3141:00000000000000000FF8080808080808080808080808080807F8000000000000 +3142:000000000000000008080808080808080FF808080808080807F8000000000000 +3143:000000000000000011441144114411441F7C1144114411440F3C000000000000 +3144:000000000000000011101110111011101F281128114411440F82000000000000 +3145:0000000000000000008000800080014001400220022004100808000000000000 +3146:000000000000000004100410041004100A280A28114411442082000000000000 +3147:000000000000000003E0041008080808080808080808041003E0000000000000 +3148:00000000000000000FF800800080014001400220022004100808000000000000 +3149:00000000000000003FFE0410041004100A280A28114411442082000000000000 +314A:000000000000000003E000000FF8008000800140022004100808000000000000 +314B:00000000000000000FF80008000800080FF80008000800080008000000000000 +314C:00000000000000000FF80800080008000FF808000800080007F8000000000000 +314D:00000000000000000FF802200220022002200220022002200FF8000000000000 +314E:000000000000000003E000000FF8000003E004100410041003E0000000000000 +314F:0000000000800080008000800080008000F00080008000800080008000800080 +3150:0000000002200220022002200220022003E00220022002200220022002200220 +3151:00000000008000800080008000F000800080008000F000800080008000800080 +3152:00000000022002200220022003E002200220022003E002200220022002200220 +3153:0000000000800080008000800080008007800080008000800080008000800080 +3154:000000000120012001200120012001200F200120012001200120012001200120 +3155:0000000000800080008000800780008000800080078000800080008000800080 +3156:0000000001200120012001200F200120012001200F2001200120012001200120 +3157:00000000000000000000000000000000000000000080008000807FFF00000000 +3158:00000000000400040004000400040004000700040204020402047FF400040004 +3159:00000000001200120012001200120012001E00120412041204127FD200120012 +315A:00000000000400040004000400040004000400040204020402047FF400040004 +315B:00000000000000000000000000000000000000000220022002207FFF00000000 +315C:000000000000000000000000000000007FFF0080008000800080008000800080 +315D:000000000004000400040004000400047FF402040204023C0204020402040204 +315E:000000000012001200120012001200127FD20412041204F20412041204120412 +315F:000000000004000400040004000400047FF40204020402040204020402040204 +3160:000000000000000000000000000000007FFF0220022002200220022002200220 +3161:000000000000000000000000000000007FFF0000000000000000000000000000 +3162:00000000000400040004000400040004000400040004000400047FF400040004 +3163:0000000000800080008000800080008000800080008000800080008000800080 +3165:0000000000000000104010401040104010401040104010400F3C000000000000 +3166:0000000000000000107C10401040104010401040104010400F3C000000000000 +3167:0000000000000000101010101010101010281028104410440F82000000000000 +3168:0000000000000000101010101010102810281044104410820FFE000000000000 +3169:00000000000000007BC4084408440844704A404A404A40513851000000000000 +316A:00000000000000001F7C0140014001401F401040104010400F3C000000000000 +316B:00000000000000007A440A440A440A4473CA424A424A425139D1000000000000 +316C:00000000000000001F100110011001281E281044104410820FFE000000000000 +316D:00000000000000001F38010001FE01001E381044104410440F38000000000000 +316E:00000000000000001F44114411441144117C1144114411440F3C000000000000 +316F:00000000000000001F1011101110111011281128114411440F82000000000000 +3170:00000000000000001F1011101110112811281144114411820FFE000000000000 +3171:0000000000000FF808080808080807F8000007F008080808080807F000000000 +3172:0000000000000000117C1104110411041F041104110411040F04000000000000 +3173:0000000000000000117C1140114011401F401140114011400F3C000000000000 +3174:0000000000000000225E2242224222423EA222A222A223121F12000000000000 +3175:0000000000000000249E2490249024903D502550255026301E2E000000000000 +3176:0000000000000000117C1110111011101F281128114411440F82000000000000 +3177:0000000000000000117C1140114011401F7C1140114011400F3C000000000000 +3178:000000000000080808080FF8080807F8000007F008080808080807F000000000 +3179:000000000000114411441F7C11440F3C000007F008080808080807F000000000 +317A:0000000000000000047C0404040404040A040A04110411042084000000000000 +317B:000000000000000004400440044004400A400A401140114020BC000000000000 +317C:0000000000000000047C0440044004400A400A401140114020BC000000000000 +317D:000000000000000004440444044404440A7C0A441144114420BC000000000000 +317E:000000000000000004FE0410041004100A280A28114411442082000000000000 +317F:0000000000000000008000800140014002200410041008080FF8000000000000 +3180:00000000000000000E3811441144114411441144114411440E38000000000000 +3181:00000000000000000080008003E00410080808080808041003E0000000000000 +3182:0000000000000000041004100E10111011281128114411440E82000000000000 +3183:0000000000000000041004100E28112811281144114411820EFE000000000000 +3184:0000000000001FFC0410041004101FFC000007F008080808080807F000000000 +3185:00000000000000000E3800003FFE00000E381144114411440E38000000000000 +3186:00000000000000000FF8000001C00220041004100410022001C0000000000000 +3187:00000000000400040004000400070004000409040907090409047FF400040004 +3188:000000000012001200120012001E001200121212121E121212127FD200120012 +3189:00000000000400040004000400040004000409040904090409047FF400040004 +318A:0000000000040004000400040004000400047FF4090409040904090409040904 +318B:0000000000120012001200120012001200127FD2121212F2121212F212121212 +318C:0000000000040004000400040004000400047FF4090409040904090409040904 +318D:0000000000000000000000000000000000000000000000000180018000000000 +318E:0000000000040004000400040004000400040004000400040304030400040004 318F:00007FFE63EE7DCE71EE7DEE63C67FFE7FFE73866DBE738E6DBE73BE7FFE0000 3190:0000000000800080008000800080008000800000000000000000000000000000 3191:0000000002000200020002200240028003000000000000000000000000000000 @@ -12781,7 +12779,7 @@ 31EC:00007FFE63EE7DCE71EE7DEE63C67FFE7FFE61C66FBE63BE6FBE61C67FFE0000 31ED:00007FFE63EE7DCE71EE7DEE63C67FFE7FFE618E6FB663B66FB6618E7FFE0000 31EE:00007FFE63EE7DCE71EE7DEE63C67FFE7FFE61866FBE638E6FBE61867FFE0000 -31EF:00007FFE63EE7DCE71EE7DEE63C67FFE7FFE61866FBE638E6FBE61BE7FFE0000 +31EF:DBB600008002955200109002801210008552900280121000955280020000DBB6 31F0:00000000000000000000000040002E0032002400440008001000200040000000 31F1:0000000000000000000000000000600010000000610012000400480030000000 31F2:00000000000000000000000000008E00720004000400080014002200C2000000 @@ -12799,36 +12797,36 @@ 31FE:0000000000000000000000000000800040004000400044004800500060000000 31FF:00000000000000000000000000F01F10101010101020102011F01E0000000000 3200:00001818200440024FF240124012401240124012401240124002200418180000 -3201:000018182004400244024402440244024402440247FA40024002200418180000 -3202:000018182004400240024FF2480248024802480248024FF24002200418180000 -3203:00001818200440024FF2401240124FF24802480248024FFA4002200418180000 -3204:000018182004400240024FF248124812481248124FF240024002200418180000 +3201:000018182004400248024802480248024802480248024FF24002200418180000 +3202:00001818200440024FF24802480248024802480248024FF24002200418180000 +3203:00001818200440024FF2401240124FF24802480248024FF24002200418180000 +3204:00001818200440024FF24812481248124812481248124FF24002200418180000 3205:00001818200440024812481248124FF24812481248124FF24002200418180000 -3206:0000181820044082408240824142414242224412480A40024002200418180000 +3206:00001818200440824082408240824142414242224412480A4002200418180000 3207:000018182004400243C244224812481248124812442243C24002200418180000 -3208:00001818200440025FF241024102428242824442482250124002200418180000 -3209:00001818200443E2400240024FFA4082414242224412480A4002200418180000 -320A:00001818200440024FF2401240125FF240124012401240124012200418180000 +3208:00001818200440024FFA408240824142414242224412480A4002200418180000 +3209:00001818200443E240024FFA40824082414242224412480A4002200418180000 +320A:00001818200440024FF24012401240124FF24012401240124002200418180000 320B:00001818200440024FF2480248024FF24802480248024FF24002200418180000 -320C:000018182004400240024FF2400244224422424242425FFA4002200418180000 -320D:000018182004400243C240025FFA400243C244224422442243C2200418180000 -320E:00001818202440225FA240A2413E422244224822502260224022202418180000 -320F:0000181820244022502250225022503E50225FE2402240224022202418180000 -3210:00001818202440225FA250225022503E50225FA2402240224022202418180000 -3211:00001818202440225FA240A240A25FBE502250225FA240224022202418180000 -3212:000018182024402240225F225122513E51225F22402240224022202418180000 -3213:0000181820244022512251225F22513E51225F22402240224022202418180000 -3214:0000181820244022442244224A224A3E512260A2402240224022202418180000 -3215:00001818202440224E2251225122513E512251224E2240224022202418180000 -3216:00001818202440225FE242224222453E452248A2506240224022202418180000 -3217:000018182024472240225FE24222423E452248A2506240224022202418180000 -3218:00001818202440225FA240A27F22423E44224822502260224022202418180000 -3219:00001818202440225FA250225FA2503E50225FA2402260224022202418180000 -321A:00001818202440225FA2402250A2493E49224BE27C2240224022202418180000 -321B:0000181820244F2240227FE240224F3E50A250A24F2260224022202418180000 -321C:0000301840049FF2810282828C62B01A8002BFFA810281028102410431180000 -321D:00003018400499EAA44AA4DAA52A992A800A88828882BEFA8002400430180000 -321E:30184004806299FAA462A492A4929862800288FA8822BE228022400430180000 +320C:00001818200440024FF24242424242424242424242424FF24002200418180000 +320D:00001818200443C240024FF2400243C244224422442243C24002200418180000 +320E:00001818200440224F2241224122423A42224422482240224022200418180000 +320F:0000181820044022482248224822483A482248224FA240224022200418180000 +3210:00001818200440224F2248224822483A482248224F2240224022200418180000 +3211:00001818200440224F22412241224F3A482248224F2240224022200418180000 +3212:00001818200440224F2249224922493A492249224F2240224022200418180000 +3213:0000181820044022492249224F22493A492249224F2240224022200418180000 +3214:0000181820044022422242224222453A452248A248A240224022200418180000 +3215:0000181820044022462249224922493A49224922462240224022200418180000 +3216:00001818200440224FA242224222453A452248A248A240224022200418180000 +3217:000018182004472240224FA24222423A4522452248A240224022200418180000 +3218:00001818200440224F22412241224E3A42224422482240224022200418180000 +3219:00001818200440224F22482248224F3A482248224F2240224022200418180000 +321A:00001818200440225FA249224922493A492249225FA240224022200418180000 +321B:000018182004472240224FA24022473A48A248A2472240224022200418180000 +321C:00001818200447F2408241424222441240024FFA408240824086208418180000 +321D:00003018400499EAA44AA45AA4AA992A800A888A8882BE8280FA400430180000 +321E:30184004806299FAA462A492A4929862800289FA8822BE228022400430180000 321F:00007FFE63867DF671867DBE63867FFE7FFE7B8673BE7B8E7BBE71BE7FFE0000 3220:0000200840048002800280028012BFFA80028002800280028002400420080000 3221:00002008400480229FF280028002800280028012BFFA80028002400420080000 @@ -12894,38 +12892,38 @@ 325D:00001FF0200840049C72A28A820A8C32820A820AA28A9C72400420081FF00000 325E:00001FF0200840049C92A29282928CFA82128212A2129C12400420081FF00000 325F:00001FF0200840049CFAA28282828C72820A820AA28A9C72400420081FF00000 -3260:00000FF01008200440025FF2401240124012401240124012200410080FF00000 -3261:00000FF01008200440024802480248024802480248024FF2200410080FF00000 -3262:00000FF0100820044FF2480248024802480248024FF24002200410080FF00000 -3263:00000FF0100820044FF2401240124FF24802480248024FFA200410080FF00000 -3264:00000FF0100820044FF2481248124812481248124FF24002200410080FF00000 +3260:00000FF0100820044FF24012401240124012401240124012200410080FF00000 +3261:00000FF01008200448024802480248024802480248024FF2200410080FF00000 +3262:00000FF0100820044FF24802480248024802480248024FF2200410080FF00000 +3263:00000FF0100820044FF2401240124FF24802480248024FF2200410080FF00000 +3264:00000FF0100820044FF24812481248124812481248124FF2200410080FF00000 3265:00000FF0100820044812481248124FF24812481248124FF2200410080FF00000 -3266:00000FF0100820844082408241424142422242224412480A200410080FF00000 +3266:00000FF0100820844082408240824142414242224412480A200410080FF00000 3267:00000FF01008200443C244224812481248124812442243C2200410080FF00000 -3268:00000FF01008200440024FFA40824082414242224412480A200410080FF00000 +3268:00000FF0100820044FFA408240824142414242224412480A200410080FF00000 3269:00000FF01008200443E240024FFA4082414242224412480A200410080FF00000 -326A:00000FF0100820044FF2401240125FF24012401240124012200410080FF00000 -326B:00000FF0100820044FE2480248024FE24802480248024FF2200410080FF00000 -326C:00000FF01008200440024FF2400244224222424242425FFA200410080FF00000 -326D:00000FF01008200447E240025FFA400243C24422442243C2200410080FF00000 -326E:00000FF0102820245FA240A2413E41224222442248225022202410280FF00000 -326F:00000FF010282024502250225022503E50225FE240224022202410280FF00000 -3270:00000FF0102820245FA250225022503E50225FA240224022202410280FF00000 -3271:00000FF0102820245FA240A240A25FBE502250225FA24022202410280FF00000 -3272:00000FF01028202440225F225122513E512251225F224022202410280FF00000 -3273:00000FF010282024512251225F22513E512251225F224022202410280FF00000 -3274:00000FF010282224422244224622493E50A2602240224022202410280FF00000 -3275:00000FF0102820244E2251225122513E512251224E224022202410280FF00000 -3276:00000FF0102820245FE242224222453E48A2506260224022202410280FF00000 -3277:00000FF0102827A440225FE24222453E48A2506260224022202410280FF00000 -3278:00000FF0102820245FA240A241225E3E4422482250226022202410280FF00000 -3279:00000FF0102820245FA250225FA2503E50225FA240226022202410280FF00000 -327A:00000FF0102820245FA2402250A2493E49224BE27C224022202410280FF00000 -327B:00000FF010282F2440227FE240224F3E50A250A24F224022202410280FF00000 -327C:00000FF010082E8440BA5E8A44EA4A8A51AA40AA5E2252223EFC10080FF00000 -327D:00000FF010083F6C429A449A4A9A516A400A7F8A440A44FA200C10080FF00000 -327E:00000FE010102388444444444444438440044FE441044104210810100FE00000 -327F:00001FF020085EF48C428C80ED0E0E020D028C828C425EF420081FF000000000 +326A:00000FF0100820044FF2401240124FF24012401240124012200410080FF00000 +326B:00000FF0100820044FF2480248024FF24802480248024FF2200410080FF00000 +326C:00000FF0100820044FF24242424242424242424242424FF2200410080FF00000 +326D:00000FF01008200443C240024FF2400243C24422442243C2200410080FF00000 +326E:00000FF0100820244F2241224122423A4222442248224022202410080FF00000 +326F:00000FF010082024482248224822483A482248224FA24022202410080FF00000 +3270:00000FF0100820244F2248224822483A482248224F224022202410080FF00000 +3271:00000FF0100820244F22412241224F3A482248224F224022202410080FF00000 +3272:00000FF0100820244F2249224922493A492249224F224022202410080FF00000 +3273:00000FF010082024492249224F22493A492249224F224022202410080FF00000 +3274:00000FF010082024422242224222453A452248A248A24022202410080FF00000 +3275:00000FF010082024462249224922493A4922492246224022202410080FF00000 +3276:00000FF0100820244FA242224222453A452248A248A24022202410080FF00000 +3277:00000FF01008272440224FA24222423A4522452248A24022202410080FF00000 +3278:00000FF0100820244F22412241224E3A4222442248226022202410080FF00000 +3279:00000FF0100820244F22482248224F3A482248224F226022202410080FF00000 +327A:00000FF0100820245FA249224922493A492249225FA24022202410080FF00000 +327B:00000FF01008272440224FA24022473A48A248A247224022202410080FF00000 +327C:00000FF010082004497A5D8A490A550A402A4F2249224F7A200410080FF00000 +327D:00000FF0100820045F4A44AA4AAA514A400A5F0A44EA440A200410080FF00000 +327E:00000FE0101027C84824482447C440045FF4410441044104210810100FE00000 +327F:00000FF0100820044002444244827500071E448244424002200410080FF00000 3280:00001FF020084004800280028012BFFA8002800280028002400420081FF00000 3281:00001FF0200840249FF280028002800280028012BFFA8002400420081FF00000 3282:00001FF0200840249FF2800280428FE280028012BFFA8002400420081FF00000 @@ -13692,7 +13690,7 @@ 357B:0200010000007FFC010003000D603118C10401001FF01010101010101FF01010 357C:0100010079FE4A024A024C8A48524A224A524A8A7A024BFE0002000200140008 357D:0008008878484A284A284A084A084A084A084A084A107A984B24022400420082 -357E:0100010009200910110821044104000000403E4422482270224022423E42223E +357E:0100010009200910110821044104000000203E20223C22E0222022223E22221E 357F:00701F8001000100FFFE054009203118C0061FF010101010101010101FF01010 3580:004000407BF848484FFE48484BF8484048404BF87840484007FC004000400040 3581:00080190786048984B04484048404FFE48804890791049200248048409FC0084 @@ -13705,10 +13703,10 @@ 3588:02083FD00220FFFE02000C703F84C80407FC00001FF01010101010101FF01010 3589:002000207850488849244A224C204920493C492079204920012007FE00000000 358A:000003FC7804480449FC480448044BFC480848084FFE79084888008800280010 -358B:0100028004401830E44E0440044004400840104000007C8844B044C47C84447C -358C:0880088013F03090509090921112120E140000003E442258226022423E42223E -358D:0040044002401240084009FC7E400040004000003E442258226022423E42223E -358E:00807C8844B044C444847C7C0100028004401830E44E04400440044008401040 +358B:0100028004401830E44E0440044004400840100000407C7845C044407C44443C +358C:0880088013F03090509090921112120E140000003E20223C22E022203E22221E +358D:0040044002401240084009FC7E400040004000003E20223C22E022203E22221E +358E:00407C7845C0444044447C3C0100028004401830E44E04400440044008401040 358F:000001FC7904490449FC4904490449FC4820482079FC48200020002003FE0000 3590:7CF8448844887CF800003FF002100210FFFE021004103FF0081010002000C000 3591:0014001278104FFE48104A904A924A924FD24A947A944A88028A049A04260842 @@ -13719,11 +13717,11 @@ 3596:020001003FF808200440FFFE010001003FF8010001003FF8200820083FF82008 3597:004002487A484A484BF8484048A049104A884C4678404BF00010002000200040 3598:000003FC7A004A004AF84A004A004BFC4AA04AA47AA84A900290048804A408C2 -3599:100010007E7C124412441244227C4A44840000003E442258226022423E42223E -359A:0810081017FE30105210911011101050102000003E442258226022423E42223E -359B:010001007FFC010001001FF0101010101FF000003E442258226022423E42223E -359C:02000100FFFE00001FF0101010101FF0000000003E442258226022423E42223E -359D:010001003FF801000100FFFE09203118C10600003E442258226022423E42223E +3599:100010007E7C124412441244227C4A44840000003E20223C22E022203E22221E +359A:0810081017FE30105210911011101050102000003E20223C22E022203E22221E +359B:010001007FFC010001001FF0101010101FF000003E20223C22E022203E22221E +359C:02000100FFFE00001FF0101010101FF0000000003E20223C22E022203E22221E +359D:010001003FF801000100FFFE09203118C10600003E20223C22E022203E22221E 359E:000001FC79044904490449FC482048204BFE4A227A524A8A030A0202020A0204 359F:001C03E0F08492449148911097FE9402900093F8F108911000A0004001B0060E 35A0:002000207BFE4850488849044AFA480048004BFE782049240122022200A00040 @@ -13741,11 +13739,11 @@ 35AC:0080031C7A044A044B9C4A044A044BFC480048007BF849080090006001980606 35AD:000003FCF040904097FE90A09110920894469040F04892640252045201400080 35AE:00400040F0A0911092089DF6900097FC94A494A4F7FC94A404A404A404140408 -35AF:3FF820082FE8200827C8244827C82028201000003E442258226022423E42223E -35B0:00807C8844B044C444847C7C00003FF820082FE8200827C8244827C820282010 +35AF:3FF820082FE8200827C8244827C82028201000003E20223C22E022203E22221E +35B0:00407C7845C0444044427C3E00003FF820082FE8200827C8244827C820282010 35B1:0100FFFE088010F83148D328149010601198160600003FF8200820083FF82008 -35B2:10001000FE7C2244444434440844147C2244C0003E442258226022423E42223E -35B3:1080088047FC21100A1011A070601090130800003E442258226022423E42223E +35B2:10001000FE7C2244444434440844147C2244C0003E20223C22E022203E22221E +35B3:1080088047FC21100A1011A070601090130800003E20223C22E022203E22221E 35B4:011001107BFE49104880488049FC49544A544C9478A449240244008401280210 35B5:000001F87908490849F8490849F8490849F8490879084FFE0000011002080404 35B6:000007FCF0A090A097FC94A494A494A497FC9040F04097FC004000400FFE0000 @@ -13789,9 +13787,9 @@ 35DC:00800040F7FC9080910893F09060918497FE9002F7FC944407FC044407FC0404 35DD:01040084788848004BFE4820482049FC482048207BFE480002A4025204520000 35DE:000800087788527E524A544A57485D7C55545554755457540548008801140022 -35DF:2080104087FC4040104023F8E040204027FC200000007C8844B044C47C84447C -35E0:084008407E8413FE220214FC0884148462FC00003E442258226022423E42223E -35E1:0440FFFE0440100027F86110A13C21042214240800007C8844B044C47C84447C +35DF:2080104087FC4040104023F8E040204027FC200000007C40447845C07C42443E +35E0:084008407E8413FE220214FC0884148462FC00003E20223C22E022203E22221E +35E1:0440FFFE0440100027F86110A13C21042214240800007C40447845C07C42443E 35E2:01C8070871085FE8511E57CA554A57CA554A57CA710A57CA011201D20E2A0444 35E3:02A802A877FC52A852AA54E6580057FC5444504073F852480248024802580040 35E4:002800243FFE2220232422242FA822182A92522A464680820FF808080FF80808 @@ -13805,7 +13803,7 @@ 35EC:111009207FFE40029FF410101FF002000FE034C00700388003F81D3001C03E00 35ED:001C01E07820492448A84BFE487048A849244A227840482402A2028A04880078 35EE:202020103DFE4510457CA9141914117E21147D14A57C251025283E2802440482 -35EF:01081FD001207FFC02000FF03810CFF008100FF000007C8844B044C47C84447C +35EF:01081FD001207FFC02000FF03810CFF008100FF000007C40447845C07C42443E 35F0:01240124722454245954514A529256105A105250725C5250025002B0029E0300 35F1:014001207BFE4E204BFC4A204BFC4A204BFE4A4078404FFE015002480C460040 35F2:004003F878484FFE48484BF848404FFE48004BF87A484BF8024803F8000007FE @@ -13837,10 +13835,10 @@ 360C:020203C2E202AFEAAA2AAB8AAE4AA9CAA80AAFEAEA0AAD4A0A820DC212AA2584 360D:0108014CE52AA548A88EA138A288A7EABC8AA7ECE48CA7E8048A07FA04260442 360E:040002FEE202A802AB92A892AFDEAAAAABCAAAAAEB92AAD20FAA08C608820806 -360F:211017FE108003F8F20813F8120813F8120813F8280047FE00903EE422843E7C +360F:211017FE108003F8F20813F8120813F8120813F8280047FE00403E7022C23E3E 3610:001007C8753E57C0551457D25522550057D450547554554805480454005401A2 3611:041004101F7CE414A414AEFEA014AE14A07CBF10E45404381654251214500820 -3612:0C3871E0102013FEFD2431FC392455FC502093FE10007C8844B044C47C84447C +3612:0C3871E0102013FEFD2431FC392455FC502093FE10007C40447845C07C44443C 3613:07BC04A4F7BC94A497BC944495F4944495F49554F5F4955405F404E40554044C 3614:004007FE749253FC509053FC509057FE510853FC750A51F8010801F800900108 3615:009007FE78904BE84A884BCE4A504BD44AA24BE278004BFC0294029407FE0000 @@ -15259,7 +15257,7 @@ 3B9A:010001F801003FF8210822C82D28228824483FF801007FFC05401930E10E0100 3B9B:100011FC11041104FDFC1104310439FC540053FE90201120113C112012A0147E 3B9C:100013FE12001224FAA412A432E43A3E57E452A492A412A4132E120013FE1000 -3B9D:2000229E22522252F5522112229272526C32A3D2A25A22542250225023D02250 +3B9D:2000229E22522252F5542114229872546C32A3D2A252225A2254225023D02250 3B9E:1020112010BE1042FC841310311039285544548290FC10841084108410FC1084 3B9F:2008200827E82108F93E220823D8765C6A6CA26AA248224823C8224820082008 3BA0:1088108813FE1088FC0013FE3A023424502053FE907010A810A8112412221020 @@ -17740,7 +17738,7 @@ 454B:0820FFFE08201040102013FE12207EFC122413FE12241EFCE22004FC048408FC 454C:0820FFFE082000000CA0709011FE1120FB2031FC392055FC5120912011FE1100 454D:0820FFFE0A200100FFFE04881A70EC1808063FF824482FE8345827C820282010 -454E:08200820FFFE082001FC7C0044F844887CF8440045FC7D2445FC45247DFC4504 +454E:08200820FFFE082001FC7C0044F8448844F87C0045FC452445FC7D2445FC0104 454F:0440FFFE0440101008203FF801007FFC02403C500848FFFE08507E240854198C 4550:08200820FFFE082021FC1000FCF8088810F8380055FC952411FC112411FC1104 4551:0440FFFE0440001C11E0104425247C880820102025FC7C4800C8543054688184 @@ -18886,7 +18884,7 @@ 49C5:004078404BFC484053F8504863F852404BFC4844485468A850A0411042084406 49C6:00907C90449048904BFC509048904890449047FE440068905088410841044204 49C7:0040782048204BFE5040504060A050A249A44A984C906888508440A240C04080 -49C8:00007BFE48505050505061FC5154495449544954695C51844104410441FC4104 +49C8:00007BFE48505050505063FE52524A524A524A526A525252425243FE42024000 49C9:00007DFC4524492449FC5124492449FC4420442045FC68205020402043FE4000 49CA:00207D20452049FC4920522048204BFE4400440045FC69045104410441FC4104 49CB:00007DFC4504490449FC5104490449FC4504450445FC6850509040924112420E @@ -19519,7 +19517,7 @@ 4C3E:2000200078FC48A490A47CA454A454A47CFC548054807C800082AA82AA7E0000 4C3F:20402040787E488091207CA054AC54B47DE454A454B47CA800A2AA82AA7E0000 4C40:20202020782048FC90A47CA454A454A47CA455FE54207C500050AA88AB040202 -4C41:2020202078204BFE90507C50548855247E22542055FC7C200020AA20AA200020 +4C41:202020207820482093FE7C20547054707CA854A855247EFA0020AA20AA200020 4C42:201020507850489090FC7D5455D454947C94551455547DD40054AA24AA340048 4C43:201020107C504450887C7E90531052107EFE521052287E280028AA44AA440082 4C44:2008201C79F0495091507D50555055507D50554855487D680154AA74AA520400 @@ -19894,14 +19892,14 @@ 4DB5:1004103E2BE0463CBA2002FCFEA4AAB8FEE4029CFE80AAB8FEA8AAAAAB2A8646 4DB6:020003F802007FFE000011F811087DF811081DF8300057FE1090109C5150223E 4DB7:00000110791049104910491049104910491049107A104A1202120412040E0800 -4DB8:00000080788048804880492049204A204840484078884884010403FE01020000 +4DB8:00400040F0809080910091109210942090209040F0809108020407FE02020000 4DB9:000001000100210821082108210821083FF80100010002000200040008003000 -4DBA:3C102410241025FF3D112511251125293D252543258125012501450155058902 -4DBB:3C202420242025FE3D2224242420242824283C48244824882489450956078800 -4DBC:7848488449124A21784449824BFE480278204810495249414A458845A83C1000 -4DBD:3D5225222552258A3DFE2448244824873D102420247C24842548442054588984 -4DBE:000008100810681F8BA188AAEBC88888FF88081408140C1412222122C1410000 -4DBF:084808481448124828487E48A2483E4822483E482088288924892A8933072100 +4DBA:00E0782048204BFE4A227A224A224A524A527A8A4B064A024A024A024A0A9A04 +4DBB:00203C20242025FE25223E242420242024503C50245024502490449255128A0E +4DBC:00707810490849484A447C9249084BFC48047840482048A44A824A8A4C889878 +4DBD:008878504A224A524A8A7A024BFE488849087A46497848884950482048D89B06 +4DBE:081028104B10493E49226B44491049107F104910082814281248224440848102 +4DBF:10001090289024905290FC9044907C9044907C904090509248925512650E4200 4DC0:0000000000007FFC00007FFC00007FFC00007FFC00007FFC00007FFC00000000 4DC1:0000000000007C7C00007C7C00007C7C00007C7C00007C7C00007C7C00000000 4DC2:0000000000007C7C00007FFC00007C7C00007C7C00007C7C00007FFC00000000 @@ -20857,7 +20855,7 @@ 5178:0440044004403FF82448244824483FF8244824482448FFFE0440082010102008 5179:082004200440FFFE1020102020402448448878F008101020142822447EFC0204 517A:0440082010102FE8C4260420082010A0604000003E442258226022423E42223E -517B:0820044002887FFC01003FF80200FFFE04400830344EC4440440044008401040 +517B:0820044000007FFC01003FF80200FFFE044008203458C4460440044008401040 517C:102008407FFC048004803FF00490FFFE04903FF00CC014A02498C48604800480 517D:082004403FF821083FF821083FF80000FFFE00001FF01010101010101FF01010 517E:082004403FF821083FF821083FF8000008207FFC08200820FFFE082010102008 @@ -21702,7 +21700,7 @@ 54C5:01000100790049FE4A024A024D1248A24A4A4AAA7B1A4A0A03FA000200140008 54C6:00800080F1F89210952090C0909093209C7C9084F10896900060004001800E00 54C7:0020002079FC4820482048204BFE48004820482079FC48200020002003FE0000 -54C8:0040004000A0F8A089108A088C0689F4880088008BF8FA088A08020803F80208 +54C8:0040004000A079104A084C064BF8480048004BF87A084A080208020803F80208 54C9:0840084808447F4408400840FFFE004000443E442228222A22123E2A22460082 54CA:00400040F7FE9080910091FC9304950499FC9104F10491FC0104010401140108 54CB:021002507250525C5F7452D4525452545254525C725053520E420442003E0000 @@ -22198,7 +22196,7 @@ 56B5:01F0021077FC520453FC522453B8522251FE521077FC524403FC00D0014A063E 56B6:03DE02527BDE4A524BDE4A524BDE498C4A5248407FFE48880190006000D80304 56B7:004007FCF00093B892A893B8911097FC911097FCF1109FFE012803100D480186 -56B8:00080FE8E928AB68A9AEA928AFE8A108AFE8A11EE112BFF200121552155E2012 +56B8:00080FE8E928AD68ABAEA928AFE8A108AFE8A11EE112BFF200121552155E2012 56B9:0820083CEE20B4FEA4A2A4B8BFE2A49EB582B5BCF5AAB79C18FF010801280210 56BA:01FC095475FC5488505053FE5C4054A25534545875B45452059204500A2011FE 56BB:00007BDE489249124BD24A527A5E03C07A5E4BD24A524A524BD2781E49920240 @@ -22567,7 +22565,7 @@ 5826:1110111211D411181152FD92112E104011FC110411041DFCE104410401FC0104 5827:100013FE1020104011FCFD54115411541154112C1C20E3FE4050008801040202 5828:100011FC110411FC1104FDFC108011FE1222112211521D02E1FA400200140008 -5829:2100213C21002100F9BC25642524253C252421242124393CE1244100017E0100 +5829:220022FE22202220FB2022BC26442A54224C228422A43A18E208420802FE0200 582A:1088108813FE108810F8FC8810F81088108813FE11001D48E184410001FE0000 582B:20002088225222222252FA8A220223FE20882144227A3888E150402000D80706 582C:204020A02110220825F6F80023C42254225423D422543A54E3D44244025402C8 @@ -23184,7 +23182,7 @@ 5A8F:1020112411241124FDFC240027FE2420244049FC29541154295445548554010C 5A90:00007F7C444444445F7C51405F4244427FBE0200FFFE08201C4003800C707008 5A91:2008203C21E02020FBFE482049FC492449FC912451FC202031FC48204BFE8000 -5A92:21102110211027FCF91029F0291029F048404FFE284010E011502A4E44448040 +5A92:1088108813FE1088FC8824F82488248824F848202BFE107028A8452482220020 5A93:1020104011FC1104FDFC250425FC240027FE4820282011FC2820442083FE0000 5A94:200027FE20402080FBFC4A944A944AF44A94929452F4229432944A944BFC8204 5A95:1020105010881104FEFA240025FC2504250449FC288810882BFE448881080208 @@ -23572,7 +23570,7 @@ 5C13:0800080008001FFC100021004100810001001110110821044102810205000200 5C14:0800080008001FFC100421084100810001001110110821044102810205000200 5C15:00003FF008100820083C10041004211441080920091011082104410405000200 -5C16:01000100092009101108210800000104FFFE01000280028004400830300EC004 +5C16:0100010009200910110821044104000001000100FFFE0280044008203018C006 5C17:0200020003F8020002000200FFFE010001000920111021084104010005000200 5C18:01000100092009101108210441040000010001003FF8010001000100FFFE0000 5C19:010011101108210441043FF82008200827C824482448244827C8200820282010 @@ -23679,7 +23677,7 @@ 5C7E:102010201020102055245524552455245524552455245D24652401FC00040000 5C7F:104010401040107E54405480548054FC5404540454045DF46404000400280010 5C80:0100010021082108210821083FF80000010041044104410441047FFC00040000 -5C81:01002108210821083FF80200020007F00810141022200140008003001C00E000 +5C81:00801084108410841FFC0100010003F804080A08111000A0004001800E007000 5C82:01002108210821083FF8000000003FF00010001000103FF02000200420041FFC 5C83:01002108210821083FF8000000003FF802081208120822080408080810506020 5C84:100010FC10841084548454FC54845484548454FC54845C846504010402140408 @@ -24376,7 +24374,7 @@ 5F37:0020F840088809040BFE7822402043FE42227A220BFE08200824082257FE2002 5F38:0000FBDE0A520A520A527BDE4252425242527BDE0A520A520A520A52555228A6 5F39:0104F888085009FC0924792441FC4124412479FC082008200BFE082050202020 -5F3A:0000F9FC0904090479FC402083FE8222FA220A220BFE082008240822903F63C1 +5F3A:0000F9FC0904090409FC7820402043FE42227A220BFE08200824082257FE2002 5F3B:0000F01E17C211021102F7DE855085508550F6DE14421442144217C2A4544008 5F3C:0000F01E17C211021202F7DE845084508450F7DE14421442144217C2A4544008 5F3D:0048F94809480BFE094879484178410041FE78200BFE087008A8092456222020 @@ -24433,7 +24431,7 @@ 5F70:100008047F0422081410FFA200027F0441087F1041227F020804FF8808100860 5F71:00007F0441047F0841107F220802FFC400087F1041227F020804490888901860 5F72:7BC200027BC44A486B504A4204027FC44A087FD04A427FC252445B88525099E0 -5F73:0800080010002000480008001000300050009000100010001000100010001000 +5F73:0040004000800110061018200040008001800680388000800080008000800080 5F74:08400840108020FC490409041204348450449024102410041004100410281010 5F75:08400840104022404A580A6812C8374852489268125012441244120411FC1000 5F76:100017F82108411091101120213C6104A1042288228822502420245028882306 @@ -24533,7 +24531,7 @@ 5FD4:10801080110011FE1A00540051F8500890101060108011001202120211FE1000 5FD5:1040104010401840544053FE50409040104010A010A010901110110812041402 5FD6:10101010101010101BFE54105010501091101090109010101010101010501020 -5FD7:0100010001087FFC0100010001103FF800000A102908292C6824482407E00000 +5FD7:010001000100FFFE0100010001003FF800000100088848844812481287F00000 5FD8:02000100FFFE10001000100010001FF800000100088848844812481287F00000 5FD9:10201010101010001BFE54805080508090801080108010801080108010FE1000 5FDA:1020102010201120192C5534516453A491241134112811221122110210FE1000 @@ -25452,7 +25450,7 @@ 636B:200027BC24A424A4FFBC24A424A42FBC3404E4042404240424042404A4144408 636C:2040202027FE2400FC88248825082D7E3708E5482528252829082908B1284110 636D:1040108013FC1224FA2413FC16241A4433FCD090111017FE1010101050102010 -636E:11FE11021102FF0211FE1310151019FF1110311051FE928212821482548228FE +636E:100013FC12041204FBFC122016201BFE3220D22012FC12841284148454FC2884 636F:200420042FC42214FA14249427D429143114E7D42114211421C42E04A4144008 6370:100011FC11241124FDFC1124112415FC182033FED07010A81124122250202020 6371:100013FE12101210FEFE1210121017FE1A003210D21012FE1210141055FE2800 @@ -25795,7 +25793,7 @@ 64C2:200027FC20402FFEF842235820402B583000E7FC2444244427FC2444A44447FC 64C3:109013FC129413FCFE9413FC100017FC1A0032F8D20013FE1520151455482986 64C4:1040107C104013FEFE4213F8124412FC1AA832F8D2A812F8122015FC5444298C -64C5:102013FF1000FDFE1102117A114A157A190231FED00010FC108410FC508433FF +64C5:20402FFE200027FCFC0425F425142FFC3000E3F8220823F8220823F8A0004FFE 64C6:1108110817FE1108F84413F41048185037FED08011FC130415FC190451FC2104 64C7:100013FE125213FEFC2011FC14201BFE3088D05011FC102017FE102050202020 64C8:1050125211541050FBFE108814501BFE3020D1FC102013FE10A8112456222020 @@ -26374,7 +26372,7 @@ 6705:100011FC11047DFC110411FC1080FDFE122211222152290245FAFC0244140008 6706:444024402840FE7E92AAD72ABA2A924AFE4A00927D1244227C2244427C944408 6707:1010282044FEBA920092FEFE9292D69292FEFE2800487DFE44087C0844087C08 -6708:07FC040404040404040407FC04040404040407FC040404040804080410142008 +6708:00000FF80808080808080FF80808080808080FF8080808081008100820284010 6709:02000200FFFE040004000FF0081018102FF0481088100FF00810081008500820 670A:0000780049FC4800480078004BFE489048907890489048904892491249129A0E 670B:00003E7C2244224422443E7C2244224422443E7C22442244224442844A948508 @@ -27527,7 +27525,7 @@ 6B86:0020FC202020204020483C8445FE4482640094FC088408841084208440FC8084 6B87:00800080FCFE210022F83C104420444065FC9494089409241224244440A88110 6B88:00200020FC40208021FC3D544554455465549554095409541154215443FE8000 -6B89:0080FE8020FC210421043FF445144514A5F41914091411F41114200440148008 +6B89:0080FE8021FC210422043DE445244524A5E41924092411E41124200440288010 6B8A:00200120FD2021FC21203E20442047FE647094A808A809241124222240208020 6B8B:00500048FC40205C21E03C40445E47E064449448083008221052208A43068002 6B8C:000003FCF800212422483C904A48492468009BFC084010401040204047FE8000 @@ -28163,7 +28161,7 @@ 6E02:03F82208120813F8820842084BF80880104017FCE110211020A0204021B00E0E 6E03:0108210817FE11088148404047FE1080110023FCE50429042104210421FC0104 6E04:009020901090179E8090409048900B9C10901090E090279E2090209020900090 -6E05:2040104017FC004083F840404FFE080013F8120813F8E20823F8220822280210 +6E05:0040204017FC104083F8404047FE100013F82208E3F8220823F8220822280210 6E06:0844448420042FD404948494449454941FF42494E49424942484288428941088 6E07:000023F8120813F8820843F849000BFC14041224E3D4221421F4200420280010 6E08:0040202017FE11088090406041981606110821F8E10821F82108210822080408 @@ -28663,7 +28661,7 @@ 6FF6:07BC24A417BC14A487BC4404443415C4144427FCE44425F4251425F424140408 6FF7:0108799009603518C206011047FC211081F0404017FC1664E55426EC2444244C 6FF8:01102FFE1110104081B04E4E43F8120813F82208E3F8220025FC250429FC0104 -6FF9:000027FC144417FC844447FC404017FC10402FFEE5242892204027FC20400FFE +6FF9:000027FC1444164C855447FC404017FC10402FFEE5242892204027FC20400FFE 6FFA:00142792149E14F08794448A449617E214942492E79E20702514248A28960062 6FFB:0010277C1554157C851046FE4500157C1544257CE544267C2444247C24280444 6FFC:044444E428A82AAA0EEE84A44AAA4EEE12422040EFFE20E0215022482C460040 @@ -28782,7 +28780,7 @@ 706D:0000FFFE0100010011081108111021204280028004400440082010102008C006 706E:010011081108229004401830E00E0440044004400440084010422042C03E0000 706F:1000100013FE1020542058205020902010201020102028202420442040A08040 -7070:040004000400FFFE0480088008880A9012A014802140414082200210040E1804 +7070:040004000400FFFE040008400840084812481250244020A040A0811002080C06 7071:1000100011FC1044544458445044904410441044104428842484450442288410 7072:080408040804094449444A444C44884408440844144412442104210440148008 7073:0800080008001FFC100422044244924412842204050404840844100460280010 @@ -32420,7 +32418,7 @@ 7EA3:100810082008240845FEF808100820084088FC48404800081C08E00840280010 7EA4:1008103C21E024204420F820102023FE4020FC20402000201C20E02040200020 7EA5:10401040208024FE4500FA0010FC20084010FC20404000801D02E10240FE0000 -7EA6:108010802080210445FEFA04140420844044FC24002400041C04E04440280010 +7EA6:10401040208024FC4504FA04100421044084FC44404400041C04E00440280010 7EA7:100013FC208420884888F890109C20844144F944412801281A10E22844440182 7EA8:104010402040244045F8F848104820484148FCC8404800A81CAAE10A42060402 7EA9:10201010201025FE4500F900110021004100FD00410001001D00E20042000400 @@ -32924,7 +32922,7 @@ 809B:00003C0025FC242024203C202420242024203C20242024202420442057FE8800 809C:00043E042208221022203E442204220822103E2222422204220842104A2084C0 809D:00003DFC2420242024203C20242027FE24203C20242024202420442054208820 -809E:00403C242524250425043C882488248824503C50242024202450448855048A02 +809E:00003DF8248824C824A83CA82488245024503C50242024202450448855048A02 809F:00003CFC2400240024003DFE2440244024803CFC240424042404440454288810 80A0:00003DF82410242024403C8025FE249224923C92251225222622444254948908 80A1:00003CF82488248824883D06260025FC24843C84244824502420445054888B06 @@ -35099,7 +35097,7 @@ 891A:2020102201FAF824082813FE1420384054FC9184128410FC1084108410FC1084 891B:2020112400A8F02013FE20A821246A02B0402BFE208821082190206021982604 891C:008079F84A087DE8492879E8491449049AFC0100FFFE04880C503420C5180606 -891D:224211240000FDFC0924112411FC3524592495FC1420102013FE102010201020 +891D:210410880050F9FC0924112411FC3524592495FC1420102013FE102010201020 891E:200011F80108F90809F81108150839F8540093FC129412941294129417FE1000 891F:200011FC0104F9FC090411FC14003BDE54429252114A10C6135A1042114A1084 8920:2088108803FEFC8809FC108813FE342059FC952415FC112413FE110411141108 @@ -36170,7 +36168,7 @@ 8D49:010001007FFC11100920FFFE054009203018DFF610101110111002C00C303008 8D4A:00207C2044505488550456FA5400540057FE5420552811242A22242244A08040 8D4B:00087C0C44EA440A540855FE544854485548556855481148294A256A43868102 -8D4C:004000407C4445FC4448545057FE544054F85588568854F82888248844F88088 +8D4C:00207C2245FA4424542857FE5420544054FC5584568410FC2884248440FC8084 8D4D:01007FFC0920092015507FFE400280041FF0101011101110111002600C187004 8D4E:00207C2045FC4420542057FE5402549454505510549013FE2828244440828302 8D4F:111009203FFC20044FE808200FE000001FF0101011101110111002600C187004 @@ -36764,7 +36762,7 @@ 8F9B:020001003FF8000008200440FFFE0100010001007FFC01000100010001000100 8F9C:01007FFC01001FF010101FF001003FF808200440FFFE01003FF8010001000100 8F9D:10401020202029FC4400FE88425001FE7C20442045FC442044207C2044200020 -8F9E:00201E10F01011FF1000FE441024102811FF7C10441045FF441044107C104410 +8F9E:08401C2071FC10001088FC5013FE10207C20442045FC442044207C2044200020 8F9F:00407C20442045FC44007C88405041FE7C206420A5FCA42024203C2024200020 8FA0:02001FF010101FF010101FF010101FF001003FF80820FFFE01003FF801000100 8FA1:204010201020FDFC000044882850FDFE10201020FDFC10202020202040208020 @@ -36863,7 +36861,7 @@ 8FFE:000427E411041114011403D4F2541254155410941094110412141408280047FE 8FFF:0100210011FC1204040403E4F224122413E41224122413E410041028281047FE 9000:03F82208120813F802080208F3F8124412281210128813041204280047FE0000 -9001:020241043088101003FE0020F020102017FF10201050108811042A02440183FF +9001:02082108111013FC00400040F04017FE104010A0109011081208280047FE0000 9002:007823C01040104007FE0040F04013F812081208120813F81208280047FE0000 9003:00A020A014A412A801B000A0F1B012A814A4112011241224141C280047FE0000 9004:0080208010FC110802900060F1981626102011FC1020122013FE1020282047FE @@ -40642,7 +40640,7 @@ 9EC1:00803FFE24103F7C26382D5434122FE020803FFC24902FF8341647F0441087F0 9EC2:00803FFE24103F7C26382D5434922FF822A02FFC22202FF828884FF844108808 9EC3:08207FFC08200FE00000FFFE01001FF0111011101FF0111011101FF008201010 -9EC4:044004403FF804400440FFFE01001FF011101FF011101FF0000008201010600C +9EC4:04403FF804400440FFFE01001FF0111011101FF0111011101FF0082010102008 9EC5:221022107F1022282228FFC408447FA249107F10497C7F040008220821104110 9EC6:221022107F10221022FEFF9208927F1049287F2849287F280048224A218A4106 9EC7:221022107F102210221EFF9008107F10497C7F4449447F4400442244217C4144 @@ -40898,19 +40896,19 @@ 9FC1:209010900090FC9003FC78900090789000907BFE48004800489079084A040404 9FC2:10201040FEFC10847CFC54847CFC548054FE7C8054FE1002FEAA10AE1152100C 9FC3:00400040F7FC90409250F148914892D4F460904090A090A0F110920804040802 -9FC4:10000BF840882288098850C82108222825100100FFFE05400920111C61080100 +9FC4:10000BFC40442244098410C46108222825100100FFFE054009203118C1060100 9FC5:21FC102003FEFA2209AC1020118C382054509188162611F8100810D010201010 -9FC6:404020400040FBFE0880108020F830886948A150215022202220245028882104 +9FC6:404020400040F8400BFE1080208030FC6884A144214821282210222824442082 9FC7:088008F81110122035FC5044904417FE1044104413FC10441040104011401080 9FC8:080009FC11042104490409FC1124312051209110111011101208120814041802 9FC9:08000BFE104020404840084013F8304850489088108810881088108817FE1000 -9FCA:08200820FFFE082008204000202090204120293C11201120E1202120212027FE +9FCA:08200820FFFE082008202000102010208120413C4920112011206120212027FE 9FCB:204017FE0040FBFC08001BF816083BF855109FFE100013F81208120813F81208 9FCC:008040402FFE2000800043F84A080BF8120813F8E04022482244244229420080 9FCD:2080208020FC21082290F86021982626202021FC3C20E22043FE002000200020 9FCE:00100010FA102110217E401078104F28C92849244944494279024A80447E0000 9FCF:102010203DFE202041FCBC20102013FEFC40107C108411481450182010D80706 -9FD0:200024FE72285228A0FE74AA52AA53AA79AE52C256827AFE0282AA82AAFE0082 +9FD0:200024FE7228902824FEFAAAAAAAA8AAF9AEAAC2AE82FAFE0282AA82AAFE0082 9FD1:000047FE2040204000400840084013FC1040E040204820442044204027FE0000 9FD2:08200820FFFE08207FFC02001FF0101011101110111012100280046018106008 9FD3:08200820FFFE08207FFC04001FF010101FF010101FF010101FF0082010102008 @@ -40938,26 +40936,26 @@ 9FE9:20003CFE24547E92D3FE7E9252D67EBA2AD6D5927ED642BA7ED642927E9A4284 9FEA:211010A017FC0080F14816D0116816A8112416A4284047FE0000244422224222 9FEB:20003FFC40009FF000007FF008107FD055504E507FD04E52554AFFEA0A06F1E2 -9FEC:000000007DFF1111111121113D1165FFA5112511251125113DFF210100000000 -9FED:104010401C7F208121127A1090101054FC521092109111111410181010500020 -9FEE:00803FFE200024442FFE244427FC200027FE284223FC2244424C424080400040 +9FEC:000001FCFD241124112421243D2465FC6524A524252425243D2425FC21040000 +9FED:108010803C8020FE4102BD0412201020FCA810A410A4112215221A2210A00040 +9FEE:00803FFE224822482FFE224823F820002FFE284223F822484248426882500040 9FEF:000050807EFE50AA952A384AD11212860C603118C92605407FFC03800D60711C -9FF0:01082108110817DF810847C8545E17C8244827DFC10947C9410D410A41080108 +9FF0:0210421022102FBE82104F9048BC0F9028902FBE4212DFD2421A421442104210 9FF1:00000000FDFC11241124112411247DFC11041100110011001D02E10240FE0000 -9FF2:0044FDFF004400007CFF4511441044FE7C120012441228222E42F08441080000 -9FF3:204420823DE2452F49297DAAD56855E97D2A55AC55687D295529B2292AA70040 -9FF4:102010201E7E228225447E28AA182A243E422A812A303E0800040E6070102008 -9FF5:202020203C2045FE48207C20D42055FC7C00542054127D5101451A45E03C4000 -9FF6:204020203DF8450849087DF8D50855087DF8554455487D3001101D48E1864100 -9FF7:102010101E7C220024443E286AFE2A003E7C2A442A443E7C00440E44707C2044 -9FF8:204420823DE2452F49297DAAD56855E97D2A55AC55687D2901291E29E2A74040 -9FF9:202020103CFF4481494A7C28D55256657CC4553C54107C9200921C92E0FE4002 -9FFA:081008207F7C08443E6408547F44104C1E40227E24025402087A1402200A4004 -9FFB:2010CE108210EEFE82208248FE48008892FF92C9DB499249DA4D924A9308D908 -9FFC:2040CE408240EE4782F58255FE55005592559255DA559255DA9592D793A5D900 -9FFD:00007FFE73866DBE718E7DBE73BE7FFE7FFE618E6FB663B66FB66F8E7FFE0000 -9FFE:00007FFE73866DBE718E7DBE73BE7FFE7FFE61866FBE638E6FBE6F867FFE0000 -9FFF:00007FFE73866DBE718E7DBE73BE7FFE7FFE61866FBE638E6FBE6FBE7FFE0000 +9FF2:0048FDFE004800007DFE4502462444207DFC0024442428442E44F08441280210 +9FF3:2090210873C8927E2362FAD4AA50AFD0FA52AA54AB58FAD00252AA52AA5204CE +9FF4:204020407C7C448489887E50542054507C88570654607C1000081CC0E0204010 +9FF5:202020207C2045FE88207C20542055FC7C00544054207CA402821E8AE28A4478 +9FF6:102010101EFC228424847EFCAA842A843EFC2AA22AA43E9800900E8870C42082 +9FF7:202020107CFC440088847C4855FE54007CFC548454847CFC00841C84E0FC4084 +9FF8:409041087BC88A7E1362FAD4AA50AFD0FA52AA54AB58FAD002521A52E25244CE +9FF9:404040207BFE8A421028FA94AAAAACCAF8F8AB00A820F92401241D24E1FC4004 +9FFA:10201040FEF810887CC810A8FE8820983C8044FC4804A80411F4280444148008 +9FFB:2020CE208220EEFE82208250FE50007E92D29352DA529252DA5A92549310D910 +9FFC:2080CE808280EE8E83EA82AAFEAA00AA92AA92AADAAA92AADAAA92AE932AD940 +9FFD:0080004007FEF50A9204910091FC9280948090F8F080908000FC008000800080 +9FFE:0200211E27D224522454F7D42458245427D224122512349AE554465004100010 +9FFF:01107FFC01003FF821083FF821083FF8210806C01930E92E05C0193061080300 A000:000000000000000010101FF010101010101010107C101010082007C000000000 A001:000003800440000010101FF010107C10121012107C101010082007C000000000 A002:000000000000000010101FF010107C10121012107C101010082007C000000000 @@ -42650,8 +42648,8 @@ A698:00000000000000001E78218421842184218421842184218421841E7800000000 A699:0000000000000000000000001E782184218421842184218421841E7800000000 A69A:000000007C929292FE929292927C0000 A69B:0000000000003E49497F4949493E0000 -A69C:0070501C121C00000000000000000000 -A69D:00202038243800000000000000000000 +A69C:000000000070101C121C000000000000 +A69D:00000000002020382438000000000000 A69E:081C2A2A2A1C08000000000000000000 A69F:004C507C504C00000000000000000000 A6A0:00000000080C0A080808084848300000 @@ -42779,9 +42777,9 @@ A719:00000000000010007C00000000000000 A71A:00000000000004047C00000000000000 A71B:0000000010387C101010000000000000 A71C:000000001010107C3810000000000000 -A71D:00000000101010100010000000000000 -A71E:00000000100010101010000000000000 -A71F:00000000000000001000101010100000 +A71D:00000010101010100010000000000000 +A71E:00000010001010101010000000000000 +A71F:00000000000000001000101010101000 A720:007E5050000000000000000000000000 A721:00000000000000000000000050507E00 A722:00007078040438000070780404380000 @@ -42862,7 +42860,7 @@ A76C:0000000C1212127C1010101050200000 A76D:0000000C1212127C1010101010105020 A76E:00000000182442424A32020204380000 A76F:000000000000182442424A3202020438 -A770:00001824424A32020438000000000000 +A770:00000000003C424A3202043800000000 A771:0000000000000100010001001D002300210021082108211023241DF800400080 A772:00000000000018000800080008000800080008100810082008483FF000800100 A773:000000000000000000000000760049004900490849084910492449F800400080 @@ -42902,7 +42900,7 @@ A794:0000000000003C4240404040423E020C A795:0000004040405C624242424242430106 A796:000000001C1212123C525252121C0000 A797:00000000101010101C325252525C4030 -A798:000000001E1010107C10101010101060 +A798:000000007E40F0407C40404040400000 A799:0000000C1010107C107C101010100000 A79A:000000003A46422212224242463A0000 A79B:0000000000003A4642322242463A0000 @@ -42942,8 +42940,8 @@ A7BC:000000603E48080808080808083E0000 A7BD:000018081000180808080808083E0000 A7BE:000000C062A2222222222222221C0000 A7BF:000018081000424242424242463A0000 -A7C0:00007FFE61866DF661EE6DDE6DDE7FFE7FFE71CE6FB66FB66FB671CE7FFE0000 -A7C1:00007FFE61866DF661EE6DDE6DDE7FFE7FFE71EE6FCE6FEE6FEE71C67FFE0000 +A7C0:000010107C82828282828282827C1010 +A7C1:0000000010107C8282828282827C1010 A7C2:0000000000800100417041884108220822702208150815080888087000000000 A7C3:00000000000000000100020042F0430842082670250825081888187000000000 A7C4:000000003C42424040404042463A020C @@ -42958,16 +42956,16 @@ A7CC:00007FFE61866DF661EE6DDE6DDE7FFE7FFE71C66FBE6FBE6FBE71C67FFE0000 A7CD:00007FFE61866DF661EE6DDE6DDE7FFE7FFE718E6FB66FB66FB6718E7FFE0000 A7CE:00007FFE61866DF661EE6DDE6DDE7FFE7FFE71866FBE6F8E6FBE71867FFE0000 A7CF:00007FFE61866DF661EE6DDE6DDE7FFE7FFE71866FBE6F8E6FBE71BE7FFE0000 -A7D0:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63CE6DB66DB66DB663CE7FFE0000 -A7D1:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63EE6DCE6DEE6DEE63C67FFE0000 +A7D0:00000000FE4444443810080444443800 +A7D1:000000000000FE444444380804444438 A7D2:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63866DF66D866DBE63867FFE0000 -A7D3:00007FFE61866DF661EE6DDE6DDE7FFE7FFE638E6DF66DC66DF6638E7FFE0000 +A7D3:0000000040405C62427C4242625C4040 A7D4:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63B66DB66D866DF663F67FFE0000 -A7D5:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63866DBE6D866DF663867FFE0000 -A7D6:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63CE6DBE6D8E6DB663CE7FFE0000 -A7D7:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63866DF66DEE6DDE63DE7FFE0000 -A7D8:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63CE6DB66DCE6DB663CE7FFE0000 -A7D9:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63CE6DB66DC66DF663CE7FFE0000 +A7D5:0000000000005C62425C6242425C6040 +A7D6:00000038444444484844444448400000 +A7D7:0000001C222222E42422222224200000 +A7D8:000000003C424240303C4242423C0000 +A7D9:0000000000003C4240303C42423C0000 A7DA:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63866DB66D866DB663B67FFE0000 A7DB:00007FFE61866DF661EE6DDE6DDE7FFE7FFE638E6DB66D8E6DB6638E7FFE0000 A7DC:00007FFE61866DF661EE6DDE6DDE7FFE7FFE63C66DBE6DBE6DBE63C67FFE0000 @@ -42992,9 +42990,9 @@ A7EE:00007FFE61866DF661EE6DDE6DDE7FFE7FFE61866FBE638E6FBE61867FFE0000 A7EF:00007FFE61866DF661EE6DDE6DDE7FFE7FFE61866FBE638E6FBE61BE7FFE0000 A7F0:00007FFE61866DF661EE6DDE6DDE7FFE7FFE61CE6FB663B66FB66FCE7FFE0000 A7F1:00007FFE61866DF661EE6DDE6DDE7FFE7FFE61EE6FCE63EE6FEE6FC67FFE0000 -A7F2:00007FFE61866DF661EE6DDE6DDE7FFE7FFE61866FF663866FBE6F867FFE0000 -A7F3:00007FFE61866DF661EE6DDE6DDE7FFE7FFE618E6FF663C66FF66F8E7FFE0000 -A7F4:00007FFE61866DF661EE6DDE6DDE7FFE7FFE61B66FB663866FF66FF67FFE0000 +A7F2:003C42404040423C0000000000000000 +A7F3:007E40407C4040400000000000000000 +A7F4:003C4242524A3C020000000000000000 A7F5:00000000040404043C04040404040000 A7F6:0000000000000404043C040404040000 A7F7:0000000000000000427E420000000000 @@ -43358,35 +43356,35 @@ A95C:00007FFE61CE6DB661C66DF66DCE7FFE7FFE61C66FBE61BE7DBE61C67FFE0000 A95D:00007FFE61CE6DB661C66DF66DCE7FFE7FFE618E6FB661B67DB6618E7FFE0000 A95E:00007FFE61CE6DB661C66DF66DCE7FFE7FFE61866FBE618E7DBE61867FFE0000 A95F:0000000000000000008009300940058012700E4801A002900C90010000000000 -A960:00003E7C2044204420443E7C0000000000000000000000000000000000000000 -A961:00003E442044207C20443E7C0000000000000000000000000000000000000000 -A962:00003E102010201020283E440000000000000000000000000000000000000000 -A963:00003E7C2008201020283E440000000000000000000000000000000000000000 -A964:00007CF804087C0840087C080000000000000000000000000000000000000000 -A965:00003DDC04443C4420443C440000000000000000000000000000000000000000 -A966:00003E7C02403E4020403E7C0000000000000000000000000000000000000000 -A967:00003DDC05103D1021103DDC0000000000000000000000000000000000000000 -A968:00003E7C02443E4420443E7C0000000000000000000000000000000000000000 -A969:00003E4402443E7C20443E7C0000000000000000000000000000000000000000 -A96A:00003D5405543DDC21543DDC0000000000000000000000000000000000000000 -A96B:00443E7C02443E7C20383E440038000000000000000000000000000000000000 -A96C:00003E1002103E1020283E440000000000000000000000000000000000000000 -A96D:00003E7C02083E1020283E440000000000000000000000000000000000000000 -A96E:00003E7C02043E7C20043E040000000000000000000000000000000000000000 -A96F:00003E7C2204220422043E040000000000000000000000000000000000000000 -A970:00003E7C2240224022403E7C0000000000000000000000000000000000000000 -A971:00003E102210221022283E440000000000000000000000000000000000000000 -A972:0000293C2920393C2AA03C7C0000000000000000000000000000000000000000 -A973:0000227C22043E7C22043E040000000000000000000000000000000000000000 -A974:0000223022FC3E3022483E300000000000000000000000000000000000000000 -A975:000008920892089E1552223E0000000000000000000000000000000000000000 -A976:00000E3E1102113E11200E3E0000000000000000000000000000000000000000 -A977:00001C3022FC223022481C300000000000000000000000000000000000000000 -A978:00003FEC047F088C1552222C0000000000000000000000000000000000000000 -A979:00003E7C20403E7C20403E7C0000000000000000000000000000000000000000 -A97A:00003E3014FC143014483E300000000000000000000000000000000000000000 -A97B:00000C103F100C1012280C440000000000000000000000000000000000000000 -A97C:00003EFC00000C3012480C300000000000000000000000000000000000000000 +A960:00000000000000001F7C10441044104410441044104410440F3C000000000000 +A961:00000000000000001F44104410441044107C1044104410440F3C000000000000 +A962:00000000000000001F1010101010101010281028104410440F82000000000000 +A963:00000000000000001F7E10101010101010281028104410440F82000000000000 +A964:00000000000000001F7C0104010401041E041004100410040F04000000000000 +A965:00000000000000007BDE08420842084270424042404240423842000000000000 +A966:00000000000000001F7C0140014001401E401040104010400F3C000000000000 +A967:00000000000000007BDE0A100A100A10721042104210421039CE000000000000 +A968:00000000000000001F7C0144014401441E441044104410440F3C000000000000 +A969:00000000000000001F440144014401441E7C1044104410440F3C000000000000 +A96A:00000000000000007A520A520A520A5273DE42524252425239CE000000000000 +A96B:00000000000000441F44017C0144013C1F001038104410440F44003800000000 +A96C:00000000000000001F100110011001101E281028104410440F82000000000000 +A96D:00000000000000001F7E0110011001101E281028104410440F82000000000000 +A96E:00000000000000001F7C0104010401041E7C1004100410040F04000000000000 +A96F:00000000000000001F7C11041104110411041104110411040F04000000000000 +A970:00000000000000001F7C11401140114011401140114011400F3C000000000000 +A971:00000000000000001F1011101110111011281128114411440F82000000000000 +A972:0000000000000000249E2490249024903D5E2550255026301E2E000000000000 +A973:0000000000000000117C1104110411041F7C1104110411040F04000000000000 +A974:00000000000000001138110011FE11001F381144114411440F38000000000000 +A975:00000000000000000892089208920892155E155215522232222E000000000000 +A976:00000000000000000E7C11041104110411781140114011400E3C000000000000 +A977:00000000000000000E38110011FE110011381144114411440E38000000000000 +A978:00000000000000007FCC1100113F11002A8C2A922A924452444C000000000000 +A979:00000000000000001F7C1040104010401E781040104010400F3C000000000000 +A97A:00000000000000003F38000012FE120012381244124412443F38000000000000 +A97B:00000000000000000E1000103F9000100E281128114411440E82000000000000 +A97C:00000000000000000E3800003FFE00000E381144114411440E38000000000000 A97D:00007FFE61CE6DB661C66DF66DCE7FFE7FFE618E7DB67BB677B6778E7FFE0000 A97E:00007FFE61CE6DB661C66DF66DCE7FFE7FFE61867DBE7B8E77BE77867FFE0000 A97F:00007FFE61CE6DB661C66DF66DCE7FFE7FFE61867DBE7B8E77BE77BE7FFE0000 @@ -43416,7 +43414,7 @@ A996:000000000000000010002200452049524A55529654A5552A2210000000000000 A997:000000000000000038784484451C45E045C04530450824882780000000000000 A998:000000000000000038784484451C45E045C04530450824882780018002600010 A999:000800140014000E31454AA54AA648244A2449244F2400440784080808C80730 -A99A:0000000000008000457EAADAAADAA0DAA8DAA4DABCDA00000000000000000000 +A99A:0000000000000000457EAADAAADAA0DAA8DAA4DABCDA00000000000000000000 A99B:000000000000000031B04A484A484808480848084B084C884708084008400780 A99C:000000000000000031B04A484A4848084808480849884A484F88000000000000 A99D:000000000000000038F048909050905090509050925092504D90000000000000 @@ -43864,9 +43862,9 @@ AB56:00000000000084844830304A85850200 AB57:0000000000002121120C0C1221418000 AB58:000000000000424224181A2545820000 AB59:0000000000002121120C0C1221A1C080 -AB5A:0000000000004040424242261A02023C +AB5A:0000000000004040404242261A02023C AB5B:00000000000044380038440000000000 -AB5C:00000020203824242424040800000000 +AB5C:00000040405864444444041800000000 AB5D:0000007014127C9050107C0000000000 AB5E:0000003808083A4C08083E0000000000 AB5F:000000000042A222261A000000000000 @@ -43876,8 +43874,8 @@ AB62:0000000000006C92121E1010926C0000 AB63:0000000000008C9292929292926C0000 AB64:000000000000324A46424242463A0000 AB65:0000000000007C828282442828EE0000 -AB66:0000000000000200020002003BF84608421042204240428047083BF800080006 -AB67:00000000000000001000100010F07F08110010C01030100813080DF0010000C0 +AB66:0000002020207EA2A4A4A8A8B07E0806 +AB67:00000000404046F948444241512E0806 AB68:00000000000004051E2404444C340000 AB69:00000000002236554949000000000000 AB6A:0000000000000404047C040404000000 @@ -43927,7 +43925,7 @@ AB95:0000000000003048484A4D4948300000 AB96:000000000000FE101010101010FE0000 AB97:0000000000000C1202424A4A4A340000 AB98:0000000000006619292A484848300000 -AB99:000000000000F1A12222242428100000 +AB99:000000000000A3A56624141408080000 AB9A:0000000000001C22029AA2A2A25C0000 AB9B:0000000000003C42403C4042423C0000 AB9C:000000000000424242427E42423C0000 @@ -44030,11178 +44028,11178 @@ ABFC:00007FFE618E6DB6618E6DB66D8E7FFE7FFE61C66FBE63BE6FBE6FC67FFE0000 ABFD:00007FFE618E6DB6618E6DB66D8E7FFE7FFE618E6FB663B66FB66F8E7FFE0000 ABFE:00007FFE618E6DB6618E6DB66D8E7FFE7FFE61866FBE638E6FBE6F867FFE0000 ABFF:00007FFE618E6DB6618E6DB66D8E7FFE7FFE61866FBE638E6FBE6FBE7FFE0000 -AC00:00000000001000101F9000900090009E01100110021004101810001000100000 -AC01:000000083E0802080208040E080830080008000007F800080008000800080000 -AC02:000000083E0802080208040E080830080008000000003EF80208020802080000 -AC03:000000083E0802080208040E080830080008000000001F080108011401620000 -AC04:000000083E0802080208040E080830080008000808000800080008000FF80000 -AC05:000000083E0802080208040E0808300800080000000010F8101010301ECC0000 -AC06:000000083E0802080208040E08083008000800000808087F081C08220F9C0000 -AC07:000000083E0802080208040E080830080008000003F802000200020003F80000 -AC08:000000083E0802080208040E080830080008000007F8000807F8040007F80000 -AC09:000000083E0802080208040E08083008000800003EF802083E0820083E080000 -AC0A:000000083E0802080208040E08083008000800003EF802883E8820883EF80000 -AC0B:000000083E0802080208040E08083008000800003E8802883EF820883EF80000 -AC0C:000000083E0802080208040E08083008000800001F0801081F0810141F620000 -AC0D:000000083E0802080208040E08083008000800003EF802803EF820803EF80000 -AC0E:000000083E0802080208040E08083008000800003EFC02483E4820483EFC0000 -AC0F:000000083E0802080208040E08083008000800001F08017F1F1C10221F1C0000 -AC10:000000083E0802080208040E080830080008000003F802080208020803F80000 -AC11:000000083E0802080208040E08083008000800000208020803F8020803F80000 -AC12:000000083E0802080208040E0808300800080000110811081F0811141F620000 -AC13:000000083E0802080208040E0808300800080000001000100010006801840000 -AC14:000000083E0802080208040E08083008000800000048004800A8011406620000 -AC15:000000083E0802080208040E0808300800080000000003F00408040803F00000 -AC16:000000083E0802080208040E080830080008000003F80020002000D003080000 -AC17:000000083E0802080208040E0808300800080000004003F8004000A003180000 -AC18:000000083E0802080208040E080830080008000003F8000803F8000800080000 -AC19:000000083E0802080208040E080830080008000003F8020003F8020003F80000 -AC1A:000000083E0802080208040E080830080008000000000FF8022002200FF80000 -AC1B:000000083E0802080208040E080830080008000000800FF803E0041003E00000 -AC1C:00000000001200121F9200920092009E01120112021204121812001200120000 -AC1D:000000283E28022802280438082830280028000007F800080008000800080000 -AC1E:000000283E28022802280438082830280028000000003EF80208020802080000 -AC1F:000000283E28022802280438082830280028000000003E100210022802C40000 -AC20:000000283E28022802280438082830280028002808000800080008000FF80000 -AC21:000000283E280228022804380828302800280000000020F8201020303ECC0000 -AC22:000000283E280228022804380828302800280000202021FC207020883E700000 -AC23:000000283E28022802280438082830280028000003F802000200020003F80000 -AC24:000000283E28022802280438082830280028000007F8000807F8040007F80000 -AC25:000000283E2802280228043808283028002800003EF802083E0820083E080000 -AC26:000000283E2802280228043808283028002800003EF802883E8820883EF80000 -AC27:000000283E2802280228043808283028002800003E8802883EF820883EF80000 -AC28:000000283E2802280228043808283028002800001F0801081F0810141F620000 -AC29:000000283E2802280228043808283028002800003EF802803EF820803EF80000 -AC2A:000000283E2802280228043808283028002800003EFC02483E4820483EFC0000 -AC2B:000000283E2802280228043808283028002800003E1002FE3E3820443E380000 -AC2C:000000283E28022802280438082830280028000003F802080208020803F80000 -AC2D:000000283E2802280228043808283028002800000208020803F8020803F80000 -AC2E:000000283E280228022804380828302800280000110811081F0811141F620000 -AC2F:000000283E280228022804380828302800280000000800080008003400C20000 -AC30:000000283E2802280228043808283028002800000048004800A8011406620000 -AC31:000000283E280228022804380828302800280000000001F00208020801F00000 -AC32:000000283E28022802280438082830280028000003F80020002000D003080000 -AC33:000000283E280228022804380828302800280000004003F8004000A003180000 -AC34:000000283E28022802280438082830280028000003F8000803F8000800080000 -AC35:000000283E28022802280438082830280028000003F8020003F8020003F80000 -AC36:000000283E28022802280438082830280028000000000FF8022002200FF80000 -AC37:000000283E28022802280438082830280028000000800FF803E0041003E00000 -AC38:00000000001000101F900090009E00900110011E021004101810001000100000 -AC39:000000083E080208020E0408080E30080008000007F800080008000800080000 -AC3A:000000083E080208020E0408080E30080008000000003EF80208020802080000 -AC3B:000000083E080208020E0408080E30080008000000001F080108011401620000 -AC3C:000000083E080208020E0408080E30080008000008000800080008000FF80000 -AC3D:000000083E080208020E0408080E300800080000000010F8101010301ECC0000 -AC3E:000000083E080208020E0408080E3008000800000808087F081C08220F9C0000 -AC3F:000000083E080208020E0408080E30080008000003F802000200020003F80000 -AC40:000000083E080208020E0408080E30080008000007F8000807F8040007F80000 -AC41:000000083E080208020E0408080E3008000800003EF802083E0820083E080000 -AC42:000000083E080208020E0408080E3008000800003EF802883E8820883EF80000 -AC43:000000083E080208020E0408080E3008000800003E8802883EF820883EF80000 -AC44:000000083E080208020E0408080E3008000800001F0801081F0810141F620000 -AC45:000000083E080208020E0408080E3008000800003EF802803EF820803EF80000 -AC46:000000083E080208020E0408080E3008000800003EFC02483E4820483EFC0000 -AC47:000000083E080208020E0408080E3008000800001F08017F1F1C10221F1C0000 -AC48:000000083E080208020E0408080E30080008000003F802080208020803F80000 -AC49:000000083E080208020E0408080E3008000800000208020803F8020803F80000 -AC4A:000000083E080208020E0408080E300800080000110811081F0811141F620000 -AC4B:000000083E080208020E0408080E300800080000001000100010006801840000 -AC4C:000000083E080208020E0408080E3008000800000048004800A8011406620000 -AC4D:000000083E080208020E0408080E300800080000000003F00408040803F00000 -AC4E:000000083E080208020E0408080E30080008000003F80020002000D003080000 -AC4F:000000083E080208020E0408080E300800080000004003F8004000A003180000 -AC50:000000083E080208020E0408080E30080008000003F8000803F8000800080000 -AC51:000000083E080208020E0408080E30080008000003F8020003F8020003F80000 -AC52:000000083E080208020E0408080E30080008000000000FF8022002200FF80000 -AC53:000000083E080208020E0408080E30080008000000800FF803E0041003E00000 -AC54:00000000001200121F920092009E00920112011E021204121812001200120000 -AC55:000000283E28022802380428083830280028000007F800080008000800080000 -AC56:000000283E28022802380428083830280028000000003EF80208020802080000 -AC57:000000283E28022802380428083830280028000000003E100210022802C40000 -AC58:000000283E28022802380428083830280028002808000800080008000FF80000 -AC59:000000283E280228023804280838302800280000000020F8201020303ECC0000 -AC5A:000000283E280228023804280838302800280000202021FC207020883E700000 -AC5B:000000283E28022802380428083830280028000003F802000200020003F80000 -AC5C:000000283E28022802380428083830280028000007F8000807F8040007F80000 -AC5D:000000283E2802280238042808383028002800003EF802083E0820083E080000 -AC5E:000000283E2802280238042808383028002800003EF802883E8820883EF80000 -AC5F:000000283E2802280238042808383028002800003E8802883EF820883EF80000 -AC60:000000283E2802280238042808383028002800001F0801081F0810141F620000 -AC61:000000283E2802280238042808383028002800003EF802803EF820803EF80000 -AC62:000000283E2802280238042808383028002800003EFC02483E4820483EFC0000 -AC63:000000283E2802280238042808383028002800003E1002FE3E3820443E380000 -AC64:000000283E28022802380428083830280028000003F802080208020803F80000 -AC65:000000283E2802280238042808383028002800000208020803F8020803F80000 -AC66:000000283E280228023804280838302800280000110811081F0811141F620000 -AC67:000000283E280228023804280838302800280000000800080008003400C20000 -AC68:000000283E2802280238042808383028002800000048004800A8011406620000 -AC69:000000283E280228023804280838302800280000000001F00208020801F00000 -AC6A:000000283E28022802380428083830280028000003F80020002000D003080000 -AC6B:000000283E280228023804280838302800280000004003F8004000A003180000 -AC6C:000000283E28022802380428083830280028000003F8000803F8000800080000 -AC6D:000000283E28022802380428083830280028000003F8020003F8020003F80000 -AC6E:000000283E28022802380428083830280028000000000FF8022002200FF80000 -AC6F:000000283E28022802380428083830280028000000800FF803E0041003E00000 -AC70:00000000000200021F8200820082009E01020102020204021802000200020000 -AC71:000000083E080208020804380808300800080000000007F80008000800080000 -AC72:000000083E08020802080438080830080008000000003EF80208020802080000 -AC73:000000083E08020802080438080830080008000000001F080108011401620000 -AC74:000000083E08020802080438080830080008000000001000100010001FF80000 -AC75:000000083E080208020804380808300800080000000020F8201020303ECC0000 -AC76:000000083E080208020804380808300800080000202021FC207020883E700000 -AC77:000000083E08020802080438080830080008000003F802000200020003F80000 -AC78:000000083E08020802080438080830080008000007F8000807F8040007F80000 -AC79:000000083E0802080208043808083008000800003EF802083E0820083E080000 -AC7A:000000083E0802080208043808083008000800003EF802883E8820883EF80000 -AC7B:000000083E0802080208043808083008000800003E8802883EF820883EF80000 -AC7C:000000083E0802080208043808083008000800000F8800880F8808140FA20000 -AC7D:000000083E0802080208043808083008000800003EF802803EF820803EF80000 -AC7E:000000083E0802080208043808083008000800003EFC02483E4820483EFC0000 -AC7F:000000083E0802080208043808083008000800003E1002FE3E3820443E380000 -AC80:000000083E08020802080438080830080008000003F802080208020803F80000 -AC81:000000083E0802080208043808083008000800000208020803F8020803F80000 -AC82:000000083E080208020804380808300800080000210821083F0821143F620000 -AC83:000000083E080208020804380808300800080000001000100010006801840000 -AC84:000000083E0802080208043808083008000800000048004800A8011406620000 -AC85:000000083E080208020804380808300800080000000003F00408040803F00000 -AC86:000000083E08020802080438080830080008000003F80020002000D003080000 -AC87:000000083E080208020804380808300800080000004003F8004000A003180000 -AC88:000000083E08020802080438080830080008000003F8000803F8000800080000 -AC89:000000083E08020802080438080830080008000003F8020003F8020003F80000 -AC8A:000000083E08020802080438080830080008000000000FF8022002200FF80000 -AC8B:000000083E08020802080438080830080008000000800FF803E0041003E00000 -AC8C:00000000000A000A1F8A008A008A00BA010A010A020A040A180A000A000A0000 -AC8D:000000283E280228022804E8082830280028000007F800080008000800080000 -AC8E:000000283E280228022804E8082830280028000000003EF80208020802080000 -AC8F:000000283E280228022804E8082830280028000000003E100210022802C40000 -AC90:000000283E280228022804E8082830280028000008000800080008000FF80000 -AC91:000000283E280228022804E80828302800280000000020F8201020303ECC0000 -AC92:000000283E280228022804E80828302800280000202021FC207020883E700000 -AC93:000000283E280228022804E8082830280028000003F802000200020003F80000 -AC94:000000283E280228022804E8082830280028000007F8000807F8040007F80000 -AC95:000000283E280228022804E808283028002800003EF802083E0820083E080000 -AC96:000000283E280228022804E808283028002800003EF802883E8820883EF80000 -AC97:000000283E280228022804E808283028002800003E8802883EF820883EF80000 -AC98:000000283E280228022804E808283028002800001F0801081F0810141F620000 -AC99:000000283E280228022804E808283028002800003EF802803EF820803EF80000 -AC9A:000000283E280228022804E808283028002800003EFC02483E4820483EFC0000 -AC9B:000000283E280228022804E808283028002800003E1002FE3E3820443E380000 -AC9C:000000283E280228022804E8082830280028000003F802080208020803F80000 -AC9D:000000283E280228022804E808283028002800000208020803F8020803F80000 -AC9E:000000283E280228022804E80828302800280000110811081F0811141F620000 -AC9F:000000283E280228022804E80828302800280000000800080008003400C20000 -ACA0:000000283E280228022804E808283028002800000048004800A8011406620000 -ACA1:000000283E280228022804E80828302800280000000001F00208020801F00000 -ACA2:000000283E280228022804E8082830280028000003F80020002000D003080000 -ACA3:000000283E280228022804E80828302800280000004003F8004000A003180000 -ACA4:000000283E280228022804E8082830280028000003F8000803F8000800080000 -ACA5:000000283E280228022804E8082830280028000003F8020003F8020003F80000 -ACA6:000000283E280228022804E8082830280028000000000FF8022002200FF80000 -ACA7:000000283E280228022804E8082830280028000000800FF803E0041003E00000 -ACA8:00000000000200021F820082009E00820102011E020204021802000200020000 -ACA9:000000083E080208023804080838300800080000000007F80008000800080000 -ACAA:000000083E08020802380408083830080008000000003EF80208020802080000 -ACAB:000000083E08020802380408083830080008000000001F080108011401620000 -ACAC:000000083E08020802380408083830080008000800001000100010001FF80000 -ACAD:000000083E080208023804080838300800080000000020F8201020303ECC0000 -ACAE:000000083E080208023804080838300800080000202021FC207020883E700000 -ACAF:000000083E08020802380408083830080008000003F802000200020003F80000 -ACB0:000000083E08020802380408083830080008000007F8000807F8040007F80000 -ACB1:000000083E0802080238040808383008000800003EF802083E0820083E080000 -ACB2:000000083E0802080238040808383008000800003EF802883E8820883EF80000 -ACB3:000000083E0802080238040808383008000800003E8802883EF820883EF80000 -ACB4:000000083E0802080238040808383008000800000F8800880F8808140FA20000 -ACB5:000000083E0802080238040808383008000800003EF802803EF820803EF80000 -ACB6:000000083E0802080238040808383008000800003EFC02483E4820483EFC0000 -ACB7:000000083E0802080238040808383008000800003E1002FE3E3820443E380000 -ACB8:000000083E08020802380408083830080008000003F802080208020803F80000 -ACB9:000000083E0802080238040808383008000800000208020803F8020803F80000 -ACBA:000000083E080208023804080838300800080000210821083F0821143F620000 -ACBB:000000083E080208023804080838300800080000001000100010006801840000 -ACBC:000000083E0802080238040808383008000800000048004800A8011406620000 -ACBD:000000083E080208023804080838300800080000000003F00408040803F00000 -ACBE:000000083E08020802380408083830080008000003F80020002000D003080000 -ACBF:000000083E080208023804080838300800080000004003F8004000A003180000 -ACC0:000000083E08020802380408083830080008000003F8000803F8000800080000 -ACC1:000000083E08020802380408083830080008000003F8020003F8020003F80000 -ACC2:000000083E08020802380408083830080008000000000FF8022002200FF80000 -ACC3:000000083E08020802380408083830080008000000800FF803E0041003E00000 -ACC4:00000000000A000A1F8A008A00BA008A010A013A020A040A180A000A000A0000 -ACC5:000000283E28022802E8042808E830280028000007F800080008000800080000 -ACC6:000000283E28022802E8042808E830280028000000003EF80208020802080000 -ACC7:000000283E28022802E8042808E830280028000000003E100210022802C40000 -ACC8:000000283E28022802E8042808E830280028002808000800080008000FF80000 -ACC9:000000283E28022802E8042808E8302800280000000020F8201020303ECC0000 -ACCA:000000283E28022802E8042808E8302800280000202021FC207020883E700000 -ACCB:000000283E28022802E8042808E830280028000003F802000200020003F80000 -ACCC:000000283E28022802E8042808E830280028000007F8000807F8040007F80000 -ACCD:000000283E28022802E8042808E83028002800003EF802083E0820083E080000 -ACCE:000000283E28022802E8042808E83028002800003EF802883E8820883EF80000 -ACCF:000000283E28022802E8042808E83028002800003E8802883EF820883EF80000 -ACD0:000000283E28022802E8042808E83028002800001F0801081F0810141F620000 -ACD1:000000283E28022802E8042808E83028002800003EF802803EF820803EF80000 -ACD2:000000283E28022802E8042808E83028002800003EFC02483E4820483EFC0000 -ACD3:000000283E28022802E8042808E83028002800003E1002FE3E3820443E380000 -ACD4:000000283E28022802E8042808E830280028000003F802080208020803F80000 -ACD5:000000283E28022802E8042808E83028002800000208020803F8020803F80000 -ACD6:000000283E28022802E8042808E8302800280000110811081F0811141F620000 -ACD7:000000283E28022802E8042808E8302800280000000800080008003400C20000 -ACD8:000000283E28022802E8042808E83028002800000048004800A8011406620000 -ACD9:000000283E28022802E8042808E8302800280000000001F00208020801F00000 -ACDA:000000283E28022802E8042808E830280028000003F80020002000D003080000 -ACDB:000000283E28022802E8042808E8302800280000004003F8004000A003180000 -ACDC:000000283E28022802E8042808E830280028000003F8000803F8000800080000 -ACDD:000000283E28022802E8042808E830280028000003F8020003F8020003F80000 -ACDE:000000283E28022802E8042808E830280028000000000FF8022002200FF80000 -ACDF:000000283E28022802E8042808E830280028000000800FF803E0041003E00000 -ACE0:00000000000000003FF0001000100010001002100200020002007FFC00000000 -ACE1:000000001FF0001000100010011001007FFC00001FF000100010001000100000 -ACE2:000000001FF0001000100010011001007FFC000000003EF80208020802080000 -ACE3:000000001FF0001000100010011001007FFC000000001E100210022802C40000 -ACE4:000000001FF0001000100010011001007FFC000000001000100010001FF00000 -ACE5:000000001FF0001000100010011001007FFC0000000020F8201020303ECC0000 -ACE6:000000001FF0001000100010011001007FFC0000202021FC207020883E700000 -ACE7:000000001FF0001000100010011001007FFC00001FF01000100010001FF00000 -ACE8:000000001FF0001000100010011001007FFC00001FF000101FF010001FF00000 -ACE9:000000001FF0001000100010011001007FFC00003EF802083E0820083E080000 -ACEA:000000001FF0001000100010011001007FFC00003EF802883E8820883EF80000 -ACEB:000000001FF0001000100010011001007FFC00003E8802883EF820883EF80000 -ACEC:000000001FF0001000100010011001007FFC00003E1002103E1020283EC40000 -ACED:000000001FF0001000100010011001007FFC00003EF802803EF820803EF80000 -ACEE:000000001FF0001000100010011001007FFC00003EFC02483E4820483EFC0000 -ACEF:000000001FF0001000100010011001007FFC00003E2003FC3E7020883E700000 -ACF0:000000001FF0001000100010011001007FFC00001FF01010101010101FF00000 -ACF1:000000001FF0001000100010011001007FFC0000101010101FF010101FF00000 -ACF2:000000001FF0001000100010011001007FFC0000222022203E2022503E880000 -ACF3:000000001FF0001000100010011001007FFC000000000100010002800C400000 -ACF4:000000001FF0001000100010011001007FFC00000000024002400DA033100000 -ACF5:000000001FF0001000100010011001007FFC0000000007C00820082007C00000 -ACF6:000000001FF0001000100010011001007FFC0000000007E00080014006200000 -ACF7:000000001FF0001000100010011001007FFC0000008007E00080014006200000 -ACF8:000000001FF0001000100010011001007FFC00001FF000101FF0001000100000 -ACF9:000000001FF0001000100010011001007FFC00001FF010001FF010001FF00000 -ACFA:000000001FF0001000100010011001007FFC000000001FF0044004401FF00000 -ACFB:000000001FF0001000100010011001007FFC000001001FF007C0082007C00000 -ACFC:00000000001000103FD000500050005E0450041004107FD00010001000100000 -ACFD:000000081F880088008E0088048804087FE8000007F800080008000800080000 -ACFE:000000081F880088008E0088048804087FE8000000003EF80208020802080000 -ACFF:000000081F880088008E0088048804087FE8000000001F080108011401620000 -AD00:000000081F880088008E0088048804087FE8000008000800080008000FF80000 -AD01:000000081F880088008E0088048804087FE80000000010F8101010301ECC0000 -AD02:000000081F880088008E0088048804087FE800000808087F081C08220F9C0000 -AD03:000000081F880088008E0088048804087FE8000003F802000200020003F80000 -AD04:000000081F880088008E0088048804087FE8000007F8000807F8040007F80000 -AD05:000000081F880088008E0088048804087FE800003EF802083E0820083E080000 -AD06:000000081F880088008E0088048804087FE800003EF802883E8820883EF80000 -AD07:000000081F880088008E0088048804087FE800003E8802883EF820883EF80000 -AD08:000000081F880088008E0088048804087FE800001F0801081F0810141F620000 -AD09:000000081F880088008E0088048804087FE800003EF802803EF820803EF80000 -AD0A:000000081F880088008E0088048804087FE800003EFC02483E4820483EFC0000 -AD0B:000000081F880088008E0088048804087FE800001F08017F1F1C10221F1C0000 -AD0C:000000081F880088008E0088048804087FE8000003F802080208020803F80000 -AD0D:000000081F880088008E0088048804087FE800000208020803F8020803F80000 -AD0E:000000081F880088008E0088048804087FE80000110811081F0811141F620000 -AD0F:000000081F880088008E0088048804087FE80000001000100010006801840000 -AD10:000000081F880088008E0088048804087FE800000048004800A8011406620000 -AD11:000000081F880088008E0088048804087FE80000000003F00408040803F00000 -AD12:000000081F880088008E0088048804087FE8000003F80020002000D003080000 -AD13:000000081F880088008E0088048804087FE80000004003F8004000A003180000 -AD14:000000081F880088008E0088048804087FE8000003F8000803F8000800080000 -AD15:000000081F880088008E0088048804087FE8000003F8020003F8020003F80000 -AD16:000000081F880088008E0088048804087FE8000000000FF8022002200FF80000 -AD17:000000081F880088008E0088048804087FE8000000800FF803E0041003E00000 -AD18:00000000001200123FD200520052005E0452041204127FD20012001200120000 -AD19:000000281FA800A800B800A804A804287FA8000007F800080008000800080000 -AD1A:000000281FA800A800B800A804A804287FA8000000003EF80208020802080000 -AD1B:000000281FA800A800B800A804A804287FA8000000001F080108011401620000 -AD1C:000000281FA800A800B800A804A804287FA8000008000800080008000FF80000 -AD1D:000000281FA800A800B800A804A804287FA80000000010F8101010301ECC0000 -AD1E:000000281FA800A800B800A804A804287FA800000808087F081C08220F9C0000 -AD1F:000000281FA800A800B800A804A804287FA8000003F802000200020003F80000 -AD20:000000281FA800A800B800A804A804287FA8000007F8000807F8040007F80000 -AD21:000000281FA800A800B800A804A804287FA800003EF802083E0820083E080000 -AD22:000000281FA800A800B800A804A804287FA800003EF802883E8820883EF80000 -AD23:000000281FA800A800B800A804A804287FA800003E8802883EF820883EF80000 -AD24:000000281FA800A800B800A804A804287FA800001F0801081F0810141F620000 -AD25:000000281FA800A800B800A804A804287FA800003EF802803EF820803EF80000 -AD26:000000281FA800A800B800A804A804287FA800003EFC02483E4820483EFC0000 -AD27:000000281FA800A800B800A804A804287FA800001F08017F1F1C10221F1C0000 -AD28:000000281FA800A800B800A804A804287FA8000003F802080208020803F80000 -AD29:000000281FA800A800B800A804A804287FA800000208020803F8020803F80000 -AD2A:000000281FA800A800B800A804A804287FA80000110811081F0811141F620000 -AD2B:000000281FA800A800B800A804A804287FA80000001000100010006801840000 -AD2C:000000281FA800A800B800A804A804287FA800000048004800A8011406620000 -AD2D:000000281FA800A800B800A804A804287FA80000000003F00408040803F00000 -AD2E:000000281FA800A800B800A804A804287FA8000003F80020002000D003080000 -AD2F:000000281FA800A800B800A804A804287FA80000004003F8004000A003180000 -AD30:000000281FA800A800B800A804A804287FA8000003F8000803F8000800080000 -AD31:000000281FA800A800B800A804A804287FA8000003F8020003F8020003F80000 -AD32:000000281FA800A800B800A804A804287FA8000000000FF8022002200FF80000 -AD33:000000281FA800A800B800A804A804287FA8000000800FF803E0041003E00000 -AD34:00000000000400043FC40044004400440444040404047FF40004000400040000 -AD35:000000081F88008800880088048804087FE8000007F800080008000800080000 -AD36:000000081F88008800880088048804087FE8000000003EF80208020802080000 -AD37:000000081F88008800880088048804087FE8000000001F080108011401620000 -AD38:000000081F88008800880088048804087FE8000008000800080008000FF80000 -AD39:000000081F88008800880088048804087FE80000000010F8101010301ECC0000 -AD3A:000000081F88008800880088048804087FE800000808087F081C08220F9C0000 -AD3B:000000081F88008800880088048804087FE8000003F802000200020003F80000 -AD3C:000000081F88008800880088048804087FE8000007F8000807F8040007F80000 -AD3D:000000081F88008800880088048804087FE800003EF802083E0820083E080000 -AD3E:000000081F88008800880088048804087FE800003EF802883E8820883EF80000 -AD3F:000000081F88008800880088048804087FE800003E8802883EF820883EF80000 -AD40:000000081F88008800880088048804087FE800001F0801081F0810141F620000 -AD41:000000081F88008800880088048804087FE800003EF802803EF820803EF80000 -AD42:000000081F88008800880088048804087FE800003EFC02483E4820483EFC0000 -AD43:000000081F88008800880088048804087FE800001F08017F1F1C10221F1C0000 -AD44:000000081F88008800880088048804087FE8000003F802080208020803F80000 -AD45:000000081F88008800880088048804087FE800000208020803F8020803F80000 -AD46:000000081F88008800880088048804087FE80000110811081F0811141F620000 -AD47:000000081F88008800880088048804087FE80000001000100010006801840000 -AD48:000000081F88008800880088048804087FE800000048004800A8011406620000 -AD49:000000081F88008800880088048804087FE80000000003F00408040803F00000 -AD4A:000000081F88008800880088048804087FE8000003F80020002000D003080000 -AD4B:000000081F88008800880088048804087FE80000004003F8004000A003180000 -AD4C:000000081F88008800880088048804087FE8000003F8000803F8000800080000 -AD4D:000000081F88008800880088048804087FE8000003F8020003F8020003F80000 -AD4E:000000081F88008800880088048804087FE8000000000FF8022002200FF80000 -AD4F:000000081F88008800880088048804087FE8000000800FF803E0041003E00000 -AD50:00000000000000003FF0001000100010001008900880088008807FFC00000000 -AD51:000000001FF0001000100010049004807FFC00001FF000100010001000100000 -AD52:000000001FF0001000100010049004807FFC000000003EF80208020802080000 -AD53:000000001FF0001000100010049004807FFC000000001E100210022802C40000 -AD54:000000001FF0001000100010049004807FFC000000001000100010001FF00000 -AD55:000000001FF0001000100010049004807FFC0000000020F8201020303ECC0000 -AD56:000000001FF0001000100010049004807FFC0000202021FC207020883E700000 -AD57:000000001FF0001000100010049004807FFC00001FF01000100010001FF00000 -AD58:000000001FF0001000100010049004807FFC00001FF000101FF010001FF00000 -AD59:000000001FF0001000100010049004807FFC00003EF802083E0820083E080000 -AD5A:000000001FF0001000100010049004807FFC00003EF802883E8820883EF80000 -AD5B:000000001FF0001000100010049004807FFC00003E8802883EF820883EF80000 -AD5C:000000001FF0001000100010049004807FFC00003E1002103E1020283EC40000 -AD5D:000000001FF0001000100010049004807FFC00003EF802803EF820803EF80000 -AD5E:000000001FF0001000100010049004807FFC00003EFC02483E4820483EFC0000 -AD5F:000000001FF0001000100010049004807FFC00003E2003FC3E7020883E700000 -AD60:000000001FF0001000100010049004807FFC00001FF01010101010101FF00000 -AD61:000000001FF0001000100010049004807FFC0000101010101FF010101FF00000 -AD62:000000001FF0001000100010049004807FFC0000222022203E2022503E880000 -AD63:000000001FF0001000100010049004807FFC000000000100010002800C400000 -AD64:000000001FF0001000100010049004807FFC00000000024002400DA033100000 -AD65:000000001FF0001000100010049004807FFC0000000007C00820082007C00000 -AD66:000000001FF0001000100010049004807FFC0000000007E00080014006200000 -AD67:000000001FF0001000100010049004807FFC0000008007E00080014006200000 -AD68:000000001FF0001000100010049004807FFC00001FF000101FF0001000100000 -AD69:000000001FF0001000100010049004807FFC00001FF010001FF010001FF00000 -AD6A:000000001FF0001000100010049004807FFC000000001FF0044004401FF00000 -AD6B:000000001FF0001000100010049004807FFC000001001FF007C0082007C00000 -AD6C:0000000000003FE00020002000200020002000003FF801000100010001000000 -AD6D:000000001FF000100010001000007FFC010001001FF000100010001000100000 -AD6E:000000001FF000100010001000007FFC0100010000003EF80208020802080000 -AD6F:000000001FF000100010001000007FFC0100010000001E100210022802C40000 -AD70:000000001FF0001000100010000000007FFC010001001100100010001FF00000 -AD71:000000001FF000100010001000007FFC01000100000020F8201020303ECC0000 -AD72:000000001FF000100010001000007FFC01000100202021FC207020883E700000 -AD73:000000001FF000100010001000007FFC010001001FF01000100010001FF00000 -AD74:000000001FF000100010001000007FFC010001001FF000101FF010001FF00000 -AD75:000000001FF000100010001000007FFC010001003EF802083E0820083E080000 -AD76:000000001FF000100010001000007FFC010001003EF802883E8820883EF80000 -AD77:000000001FF000100010001000007FFC010001003E8802883EF820883EF80000 -AD78:000000001FF000100010001000007FFC010001003E1002103E1020283EC40000 -AD79:000000001FF000100010001000007FFC010001003EF802803EF820803EF80000 -AD7A:000000001FF000100010001000007FFC010001003EFC02483E4820483EFC0000 -AD7B:000000001FF000100010001000007FFC010001003E2003FC3E7020883E700000 -AD7C:000000001FF000100010001000007FFC010001001FF01010101010101FF00000 -AD7D:000000001FF000100010001000007FFC01000100101010101FF010101FF00000 -AD7E:000000001FF000100010001000007FFC01000100222022203E2022503E880000 -AD7F:000000001FF000100010001000007FFC0100010000000100010002800C400000 -AD80:000000001FF000100010001000007FFC010001000000024002400DA033100000 -AD81:000000001FF000100010001000007FFC01000100000007C00820082007C00000 -AD82:000000001FF000100010001000007FFC01000100000007E00080014006200000 -AD83:000000001FF000100010001000007FFC01000100008007E00080014006200000 -AD84:000000001FF000100010001000007FFC010001001FF000101FF0001000100000 -AD85:000000001FF000100010001000007FFC010001001FF010001FF010001FF00000 -AD86:000000001FF000100010001000007FFC0100010000001FF0044004401FF00000 -AD87:000000001FF000100010001000007FFC0100010001001FF007C0082007C00000 -AD88:00000008000800083FE8002800280028002800087FE8040804F8040804080000 -AD89:000800083F080108010801087FE8027802080000000007F80008000800080000 -AD8A:000800083F080108010801087FE802780208000000003EF80208020802080000 -AD8B:000800083F080108010801087FE802780208000000001F080108011401620000 -AD8C:000800083F0801080108010800087FE80278020802081000100010001FF80000 -AD8D:000800083F080108010801087FE8027802080000000020F8201020303ECC0000 -AD8E:000800083F080108010801087FE8027802080000202021FC207020883E700000 -AD8F:000800083F080108010801087FE802780208000003F802000200020003F80000 -AD90:000800083F080108010801087FE802780208000007F8000807F8040007F80000 -AD91:000800083F080108010801087FE80278020800003EF802083E0820083E080000 -AD92:000800083F080108010801087FE80278020800003EF802883E8820883EF80000 -AD93:000800083F080108010801087FE80278020800003E8802883EF820883EF80000 -AD94:000800083F080108010801087FE80278020800000F8800880F8808140FA20000 -AD95:000800083F080108010801087FE80278020800003EF802803EF820803EF80000 -AD96:000800083F080108010801087FE80278020800003EFC02483E4820483EFC0000 -AD97:000800083F080108010801087FE80278020800003E1002FE3E3820443E380000 -AD98:000800083F080108010801087FE802780208000003F802080208020803F80000 -AD99:000800083F080108010801087FE80278020800000208020803F8020803F80000 -AD9A:000800083F080108010801087FE8027802080000210821083F0821143F620000 -AD9B:000800083F080108010801087FE8027802080000001000100010006801840000 -AD9C:000800083F080108010801087FE80278020800000048004800A8011406620000 -AD9D:000800083F080108010801087FE8027802080000000003F00408040803F00000 -AD9E:000800083F080108010801087FE802780208000003F80020002000D003080000 -AD9F:000800083F080108010801087FE8027802080000004003F8004000A003180000 -ADA0:000800083F080108010801087FE802780208000003F8000803F8000800080000 -ADA1:000800083F080108010801087FE802780208000003F8020003F8020003F80000 -ADA2:000800083F080108010801087FE802780208000000000FF8022002200FF80000 -ADA3:000800083F080108010801087FE802780208000000800FF803E0041003E00000 -ADA4:0000000A000A000A3FEA002A002A002A002A000A7FEA040A047A040A040A0000 -ADA5:002800283F280128012801287FA805E804280000000007F80008000800080000 -ADA6:002800283F280128012801287FA805E80428000000003EF80208020802080000 -ADA7:002800283F280128012801287FA805E80428000000001F080108011401620000 -ADA8:002800283F2801280128012800287FA8042805E804281428100010001FF80000 -ADA9:002800283F280128012801287FA805E804280000000020F8201020303ECC0000 -ADAA:002800283F280128012801287FA805E804280000202021FC207020883E700000 -ADAB:002800283F280128012801287FA805E80428000003F802000200020003F80000 -ADAC:002800283F280128012801287FA805E80428000007F8000807F8040007F80000 -ADAD:002800283F280128012801287FA805E8042800003EF802083E0820083E080000 -ADAE:002800283F280128012801287FA805E8042800003EF802883E8820883EF80000 -ADAF:002800283F280128012801287FA805E8042800003E8802883EF820883EF80000 -ADB0:002800283F280128012801287FA805E8042800000F8800880F8808140FA20000 -ADB1:002800283F280128012801287FA805E8042800003EF802803EF820803EF80000 -ADB2:002800283F280128012801287FA805E8042800003EFC02483E4820483EFC0000 -ADB3:002800283F280128012801287FA805E8042800003E1002FE3E3820443E380000 -ADB4:002800283F280128012801287FA805E80428000003F802080208020803F80000 -ADB5:002800283F280128012801287FA805E8042800000208020803F8020803F80000 -ADB6:002800283F280128012801287FA805E804280000210821083F0821143F620000 -ADB7:002800283F280128012801287FA805E804280000001000100010006801840000 -ADB8:002800283F280128012801287FA805E8042800000048004800A8011406620000 -ADB9:002800283F280128012801287FA805E804280000000003F00408040803F00000 -ADBA:002800283F280128012801287FA805E80428000003F80020002000D003080000 -ADBB:002800283F280128012801287FA805E804280000004003F8004000A003180000 -ADBC:002800283F280128012801287FA805E80428000003F8000803F8000800080000 -ADBD:002800283F280128012801287FA805E80428000003F8020003F8020003F80000 -ADBE:002800283F280128012801287FA805E80428000000000FF8022002200FF80000 -ADBF:002800283F280128012801287FA805E80428000000800FF803E0041003E00000 -ADC0:00000008000800083FE8002800280028002800087FE804080408040804080000 -ADC1:000800083F080108010801087FE8020802000000000007F80008000800080000 -ADC2:000800083F080108010801087FE802080200000000003EF80208020802080000 -ADC3:000800083F080108010801087FE802080200000000001F080108011401620000 -ADC4:000800083F0801080108010800087FE80208020802081008100010001FF80000 -ADC5:000800083F080108010801087FE8020802000000000020F8201020303ECC0000 -ADC6:000800083F080108010801087FE8020802000000202021FC207020883E700000 -ADC7:000800083F080108010801087FE802080200000003F802000200020003F80000 -ADC8:000800083F080108010801087FE802080200000007F8000807F8040007F80000 -ADC9:000800083F080108010801087FE80208020000003EF802083E0820083E080000 -ADCA:000800083F080108010801087FE80208020000003EF802883E8820883EF80000 -ADCB:000800083F080108010801087FE80208020000003E8802883EF820883EF80000 -ADCC:000800083F080108010801087FE80208020000000F8800880F8808140FA20000 -ADCD:000800083F080108010801087FE80208020000003EF802803EF820803EF80000 -ADCE:000800083F080108010801087FE80208020000003EFC02483E4820483EFC0000 -ADCF:000800083F080108010801087FE80208020000003E1002FE3E3820443E380000 -ADD0:000800083F080108010801087FE802080200000003F802080208020803F80000 -ADD1:000800083F080108010801087FE80208020000000208020803F8020803F80000 -ADD2:000800083F080108010801087FE8020802000000210821083F0821143F620000 -ADD3:000800083F080108010801087FE8020802000000001000100010006801840000 -ADD4:000800083F080108010801087FE80208020000000048004800A8011406620000 -ADD5:000800083F080108010801087FE8020802000000000003F00408040803F00000 -ADD6:000800083F080108010801087FE802080200000003F80020002000D003080000 -ADD7:000800083F080108010801087FE8020802000000004003F8004000A003180000 -ADD8:000800083F080108010801087FE802080200000003F8000803F8000800080000 -ADD9:000800083F080108010801087FE802080200000003F8020003F8020003F80000 -ADDA:000800083F080108010801087FE802080200000000000FF8022002200FF80000 -ADDB:000800083F080108010801087FE802080200000000800FF803E0041003E00000 -ADDC:0000000000003FE00020002000200020002000007FFC04400440044004400000 -ADDD:000000001FF000100010001000007FFC044004401FF000100010001000100000 -ADDE:000000001FF000100010001000007FFC0440044000003EF80208020802080000 -ADDF:000000001FF000100010001000007FFC0440044000001E100210022802C40000 -ADE0:000000001FF0001000100010000000007FFC044004401440100010001FF00000 -ADE1:000000001FF000100010001000007FFC04400440000020F8201020303ECC0000 -ADE2:000000001FF000100010001000007FFC04400440202021FC207020883E700000 -ADE3:000000001FF000100010001000007FFC044004401FF01000100010001FF00000 -ADE4:000000001FF000100010001000007FFC044004401FF000101FF010001FF00000 -ADE5:000000001FF000100010001000007FFC044004403EF802083E0820083E080000 -ADE6:000000001FF000100010001000007FFC044004403EF802883E8820883EF80000 -ADE7:000000001FF000100010001000007FFC044004403E8802883EF820883EF80000 -ADE8:000000001FF000100010001000007FFC044004403E1002103E1020283EC40000 -ADE9:000000001FF000100010001000007FFC044004403EF802803EF820803EF80000 -ADEA:000000001FF000100010001000007FFC044004403EFC02483E4820483EFC0000 -ADEB:000000001FF000100010001000007FFC044004403E2003FC3E7020883E700000 -ADEC:000000001FF000100010001000007FFC044004401FF01010101010101FF00000 -ADED:000000001FF000100010001000007FFC04400440101010101FF010101FF00000 -ADEE:000000001FF000100010001000007FFC04400440222022203E2022503E880000 -ADEF:000000001FF000100010001000007FFC0440044000000100010002800C400000 -ADF0:000000001FF000100010001000007FFC044004400000024002400DA033100000 -ADF1:000000001FF000100010001000007FFC04400440000007C00820082007C00000 -ADF2:000000001FF000100010001000007FFC04400440000007E00080014006200000 -ADF3:000000001FF000100010001000007FFC04400440008007E00080014006200000 -ADF4:000000001FF000100010001000007FFC044004401FF000101FF0001000100000 -ADF5:000000001FF000100010001000007FFC044004401FF010001FF010001FF00000 -ADF6:000000001FF000100010001000007FFC0440044000001FF0044004401FF00000 -ADF7:000000001FF000100010001000007FFC0440044001001FF007C0082007C00000 -ADF8:00000000000000003FF00010001000100010001000007FFC0000000000000000 -ADF9:000000001FF0001000100010001000007FFC00001FF000100010001000100000 -ADFA:000000001FF0001000100010001000007FFC000000003EF80208020802080000 -ADFB:000000001FF0001000100010001000007FFC000000001E100210022802C40000 -ADFC:000000001FF0001000100010001000007FFC000000001000100010001FF00000 -ADFD:000000001FF0001000100010001000007FFC0000000020F8201020303ECC0000 -ADFE:000000001FF0001000100010001000007FFC0000202021FC207020883E700000 -ADFF:000000001FF0001000100010001000007FFC00001FF01000100010001FF00000 -AE00:000000001FF0001000100010001000007FFC00001FF000101FF010001FF00000 -AE01:000000001FF0001000100010001000007FFC00003EF802083E0820083E080000 -AE02:000000001FF0001000100010001000007FFC00003EF802883E8820883EF80000 -AE03:000000001FF0001000100010001000007FFC00003E8802883EF820883EF80000 -AE04:000000001FF0001000100010001000007FFC00003E1002103E1020283EC40000 -AE05:000000001FF0001000100010001000007FFC00003EF802803EF820803EF80000 -AE06:000000001FF0001000100010001000007FFC00003EFC02483E4820483EFC0000 -AE07:000000001FF0001000100010001000007FFC00003E2003FC3E7020883E700000 -AE08:000000001FF0001000100010001000007FFC00001FF01010101010101FF00000 -AE09:000000001FF0001000100010001000007FFC0000101010101FF010101FF00000 -AE0A:000000001FF0001000100010001000007FFC0000222022203E2022503E880000 -AE0B:000000001FF0001000100010001000007FFC000000000100010002800C400000 -AE0C:000000001FF0001000100010001000007FFC00000000024002400DA033100000 -AE0D:000000001FF0001000100010001000007FFC0000000007C00820082007C00000 -AE0E:000000001FF0001000100010001000007FFC0000000007E00080014006200000 -AE0F:000000001FF0001000100010001000007FFC0000008007E00080014006200000 -AE10:000000001FF0001000100010001000007FFC00001FF000101FF0001000100000 -AE11:000000001FF0001000100010001000007FFC00001FF010001FF010001FF00000 -AE12:000000001FF0001000100010001000007FFC000000001FF0044004401FF00000 -AE13:000000001FF0001000100010001000007FFC000001001FF007C0082007C00000 -AE14:00000000000800083FC80048004800480048000800087FE80008000800080000 -AE15:000000081F88008800880088008800087FE8000007F800080008000800080000 -AE16:000000081F88008800880088008800087FE8000000003EF80208020802080000 -AE17:000000081F88008800880088008800087FE8000000001F080108011401620000 -AE18:000000081F88008800880088008800087FE8000008000800080008000FF80000 -AE19:000000081F88008800880088008800087FE80000000010F8101010301ECC0000 -AE1A:000000081F88008800880088008800087FE800000808087F081C08220F9C0000 -AE1B:000000081F88008800880088008800087FE8000003F802000200020003F80000 -AE1C:000000081F88008800880088008800087FE8000007F8000807F8040007F80000 -AE1D:000000081F88008800880088008800087FE800003EF802083E0820083E080000 -AE1E:000000081F88008800880088008800087FE800003EF802883E8820883EF80000 -AE1F:000000081F88008800880088008800087FE800003E8802883EF820883EF80000 -AE20:000000081F88008800880088008800087FE800001F0801081F0810141F620000 -AE21:000000081F88008800880088008800087FE800003EF802803EF820803EF80000 -AE22:000000081F88008800880088008800087FE800003EFC02483E4820483EFC0000 -AE23:000000081F88008800880088008800087FE800001F08017F1F1C10221F1C0000 -AE24:000000081F88008800880088008800087FE8000003F802080208020803F80000 -AE25:000000081F88008800880088008800087FE800000208020803F8020803F80000 -AE26:000000081F88008800880088008800087FE80000110811081F0811141F620000 -AE27:000000081F88008800880088008800087FE80000001000100010006801840000 -AE28:000000081F88008800880088008800087FE800000048004800A8011406620000 -AE29:000000081F88008800880088008800087FE80000000003F00408040803F00000 -AE2A:000000081F88008800880088008800087FE8000003F80020002000D003080000 -AE2B:000000081F88008800880088008800087FE80000004003F8004000A003180000 -AE2C:000000081F88008800880088008800087FE8000003F8000803F8000800080000 -AE2D:000000081F88008800880088008800087FE8000003F8020003F8020003F80000 -AE2E:000000081F88008800880088008800087FE8000000000FF8022002200FF80000 -AE2F:000000081F88008800880088008800087FE8000000800FF803E0041003E00000 -AE30:00000000000800081F8800880088008801080108020804081808000800080000 -AE31:000000083E080208020804080808300800080000000007F80008000800080000 -AE32:000000083E08020802080408080830080008000000003EF80208020802080000 -AE33:000000083E08020802080408080830080008000000001F080108011401620000 -AE34:000000083E08020802080408080830080008000800001000100010001FF80000 -AE35:000000083E080208020804080808300800080000000020F8201020303ECC0000 -AE36:000000083E080208020804080808300800080000202021FC207020883E700000 -AE37:000000083E08020802080408080830080008000003F802000200020003F80000 -AE38:000000083E08020802080408080830080008000007F8000807F8040007F80000 -AE39:000000083E0802080208040808083008000800003EF802083E0820083E080000 -AE3A:000000083E0802080208040808083008000800003EF802883E8820883EF80000 -AE3B:000000083E0802080208040808083008000800003E8802883EF820883EF80000 -AE3C:000000083E0802080208040808083008000800000F8800880F8808140FA20000 -AE3D:000000083E0802080208040808083008000800003EF802803EF820803EF80000 -AE3E:000000083E0802080208040808083008000800003EFC02483E4820483EFC0000 -AE3F:000000083E0802080208040808083008000800003E1002FE3E3820443E380000 -AE40:000000083E08020802080408080830080008000003F802080208020803F80000 -AE41:000000083E0802080208040808083008000800000208020803F8020803F80000 -AE42:000000083E080208020804080808300800080000210821083F0821143F620000 -AE43:000000083E080208020804080808300800080000001000100010006801840000 -AE44:000000083E0802080208040808083008000800000048004800A8011406620000 -AE45:000000083E080208020804080808300800080000000003F00408040803F00000 -AE46:000000083E08020802080408080830080008000003F80020002000D003080000 -AE47:000000083E080208020804080808300800080000004003F8004000A003180000 -AE48:000000083E08020802080408080830080008000003F8000803F8000800080000 -AE49:000000083E08020802080408080830080008000003F8020003F8020003F80000 -AE4A:000000083E08020802080408080830080008000000000FF8022002200FF80000 -AE4B:000000083E08020802080408080830080008000000800FF803E0041003E00000 -AE4C:00000000001000107B9008900890089E11101110221044100810001000100000 -AE4D:00000008F78810881088108E2108C6080008000007F800080008000800080000 -AE4E:00000008F78810881088108E2108C6080008000000003EF80208020802080000 -AE4F:00000008F78810881088108E2108C6080008000000001F080108011401620000 -AE50:00000008F78810881088108E2108C6080008000808000800080008000FF80000 -AE51:00000008F78810881088108E2108C60800080000000010F8101010301ECC0000 -AE52:00000008F78810881088108E2108C608000800000808087F081C08220F9C0000 -AE53:00000008F78810881088108E2108C6080008000003F802000200020003F80000 -AE54:00000008F78810881088108E2108C6080008000007F8000807F8040007F80000 -AE55:00000008F78810881088108E2108C608000800003EF802083E0820083E080000 -AE56:00000008F78810881088108E2108C608000800003EF802883E8820883EF80000 -AE57:00000008F78810881088108E2108C608000800003E8802883EF820883EF80000 -AE58:00000008F78810881088108E2108C608000800001F0801081F0810141F620000 -AE59:00000008F78810881088108E2108C608000800003EF802803EF820803EF80000 -AE5A:00000008F78810881088108E2108C608000800003EFC02483E4820483EFC0000 -AE5B:00000008F78810881088108E2108C608000800001F08017F1F1C10221F1C0000 -AE5C:00000008F78810881088108E2108C6080008000003F802080208020803F80000 -AE5D:00000008F78810881088108E2108C608000800000208020803F8020803F80000 -AE5E:00000008F78810881088108E2108C60800080000110811081F0811141F620000 -AE5F:00000008F78810881088108E2108C60800080000001000100010006801840000 -AE60:00000008F78810881088108E2108C608000800000048004800A8011406620000 -AE61:00000008F78810881088108E2108C60800080000000003F00408040803F00000 -AE62:00000008F78810881088108E2108C6080008000003F80020002000D003080000 -AE63:00000008F78810881088108E2108C60800080000004003F8004000A003180000 -AE64:00000008F78810881088108E2108C6080008000003F8000803F8000800080000 -AE65:00000008F78810881088108E2108C6080008000003F8020003F8020003F80000 -AE66:00000008F78810881088108E2108C6080008000000000FF8022002200FF80000 -AE67:00000008F78810881088108E2108C6080008000000800FF803E0041003E00000 -AE68:00000000001200127B9208920892089E11121112221244120812001200120000 -AE69:00000028F7A810A810A810B82128C6280028000007F800080008000800080000 -AE6A:00000028F7A810A810A810B82128C6280028000000003EF80208020802080000 -AE6B:00000028F7A810A810A810B82128C6280028000000003E100210022802C40000 -AE6C:00000028F7A810A810A810B82128C6280028002808000800080008000FF80000 -AE6D:00000028F7A810A810A810B82128C62800280000000020F8201020303ECC0000 -AE6E:00000028F7A810A810A810B82128C62800280000202021FC207020883E700000 -AE6F:00000028F7A810A810A810B82128C6280028000003F802000200020003F80000 -AE70:00000028F7A810A810A810B82128C6280028000007F8000807F8040007F80000 -AE71:00000028F7A810A810A810B82128C628002800003EF802083E0820083E080000 -AE72:00000028F7A810A810A810B82128C628002800003EF802883E8820883EF80000 -AE73:00000028F7A810A810A810B82128C628002800003E8802883EF820883EF80000 -AE74:00000028F7A810A810A810B82128C628002800001F0801081F0810141F620000 -AE75:00000028F7A810A810A810B82128C628002800003EF802803EF820803EF80000 -AE76:00000028F7A810A810A810B82128C628002800003EFC02483E4820483EFC0000 -AE77:00000028F7A810A810A810B82128C628002800003E1002FE3E3820443E380000 -AE78:00000028F7A810A810A810B82128C6280028000003F802080208020803F80000 -AE79:00000028F7A810A810A810B82128C628002800000208020803F8020803F80000 -AE7A:00000028F7A810A810A810B82128C62800280000110811081F0811141F620000 -AE7B:00000028F7A810A810A810B82128C62800280000000800080008003400C20000 -AE7C:00000028F7A810A810A810B82128C628002800000048004800A8011406620000 -AE7D:00000028F7A810A810A810B82128C62800280000000001F00208020801F00000 -AE7E:00000028F7A810A810A810B82128C6280028000003F80020002000D003080000 -AE7F:00000028F7A810A810A810B82128C62800280000004003F8004000A003180000 -AE80:00000028F7A810A810A810B82128C6280028000003F8000803F8000800080000 -AE81:00000028F7A810A810A810B82128C6280028000003F8020003F8020003F80000 -AE82:00000028F7A810A810A810B82128C6280028000000000FF8022002200FF80000 -AE83:00000028F7A810A810A810B82128C6280028000000800FF803E0041003E00000 -AE84:00000000001000107B900890089E08901110111E221044100810001000100000 -AE85:00000008F7881088108E1088210EC6080008000007F800080008000800080000 -AE86:00000008F7881088108E1088210EC6080008000000003EF80208020802080000 -AE87:00000008F7881088108E1088210EC6080008000000001F080108011401620000 -AE88:00000008F7881088108E1088210EC6080008000008000800080008000FF80000 -AE89:00000008F7881088108E1088210EC60800080000000010F8101010301ECC0000 -AE8A:00000008F7881088108E1088210EC608000800000808087F081C08220F9C0000 -AE8B:00000008F7881088108E1088210EC6080008000003F802000200020003F80000 -AE8C:00000008F7881088108E1088210EC6080008000007F8000807F8040007F80000 -AE8D:00000008F7881088108E1088210EC608000800003EF802083E0820083E080000 -AE8E:00000008F7881088108E1088210EC608000800003EF802883E8820883EF80000 -AE8F:00000008F7881088108E1088210EC608000800003E8802883EF820883EF80000 -AE90:00000008F7881088108E1088210EC608000800001F0801081F0810141F620000 -AE91:00000008F7881088108E1088210EC608000800003EF802803EF820803EF80000 -AE92:00000008F7881088108E1088210EC608000800003EFC02483E4820483EFC0000 -AE93:00000008F7881088108E1088210EC608000800001F08017F1F1C10221F1C0000 -AE94:00000008F7881088108E1088210EC6080008000003F802080208020803F80000 -AE95:00000008F7881088108E1088210EC608000800000208020803F8020803F80000 -AE96:00000008F7881088108E1088210EC60800080000110811081F0811141F620000 -AE97:00000008F7881088108E1088210EC60800080000001000100010006801840000 -AE98:00000008F7881088108E1088210EC608000800000048004800A8011406620000 -AE99:00000008F7881088108E1088210EC60800080000000003F00408040803F00000 -AE9A:00000008F7881088108E1088210EC6080008000003F80020002000D003080000 -AE9B:00000008F7881088108E1088210EC60800080000004003F8004000A003180000 -AE9C:00000008F7881088108E1088210EC6080008000003F8000803F8000800080000 -AE9D:00000008F7881088108E1088210EC6080008000003F8020003F8020003F80000 -AE9E:00000008F7881088108E1088210EC6080008000000000FF8022002200FF80000 -AE9F:00000008F7881088108E1088210EC6080008000000800FF803E0041003E00000 -AEA0:00000000001200127B920892089E08921112111E221244120812001200120000 -AEA1:00000028F7A810A810B810A82138C6280028000007F800080008000800080000 -AEA2:00000028F7A810A810B810A82138C6280028000000003EF80208020802080000 -AEA3:00000028F7A810A810B810A82138C6280028000000003E100210022802C40000 -AEA4:00000028F7A810A810B810A82138C6280028002808000800080008000FF80000 -AEA5:00000028F7A810A810B810A82138C62800280000000020F8201020303ECC0000 -AEA6:00000028F7A810A810B810A82138C62800280000202021FC207020883E700000 -AEA7:00000028F7A810A810B810A82138C6280028000003F802000200020003F80000 -AEA8:00000028F7A810A810B810A82138C6280028000007F8000807F8040007F80000 -AEA9:00000028F7A810A810B810A82138C628002800003EF802083E0820083E080000 -AEAA:00000028F7A810A810B810A82138C628002800003EF802883E8820883EF80000 -AEAB:00000028F7A810A810B810A82138C628002800003E8802883EF820883EF80000 -AEAC:00000028F7A810A810B810A82138C628002800001F0801081F0810141F620000 -AEAD:00000028F7A810A810B810A82138C628002800003EF802803EF820803EF80000 -AEAE:00000028F7A810A810B810A82138C628002800003EFC02483E4820483EFC0000 -AEAF:00000028F7A810A810B810A82138C628002800003E1002FE3E3820443E380000 -AEB0:00000028F7A810A810B810A82138C6280028000003F802080208020803F80000 -AEB1:00000028F7A810A810B810A82138C628002800000208020803F8020803F80000 -AEB2:00000028F7A810A810B810A82138C62800280000110811081F0811141F620000 -AEB3:00000028F7A810A810B810A82138C62800280000000800080008003400C20000 -AEB4:00000028F7A810A810B810A82138C628002800000048004800A8011406620000 -AEB5:00000028F7A810A810B810A82138C62800280000000001F00208020801F00000 -AEB6:00000028F7A810A810B810A82138C6280028000003F80020002000D003080000 -AEB7:00000028F7A810A810B810A82138C62800280000004003F8004000A003180000 -AEB8:00000028F7A810A810B810A82138C6280028000003F8000803F8000800080000 -AEB9:00000028F7A810A810B810A82138C6280028000003F8020003F8020003F80000 -AEBA:00000028F7A810A810B810A82138C6280028000000000FF8022002200FF80000 -AEBB:00000028F7A810A810B810A82138C6280028000000800FF803E0041003E00000 -AEBC:00000000000200027B8208820882089E11021102220244020802000200020000 -AEBD:00000008F7881088108810B82108C60800080000000007F80008000800080000 -AEBE:00000008F7881088108810B82108C6080008000000003EF80208020802080000 -AEBF:00000008F7881088108810B82108C6080008000000001F080108011401620000 -AEC0:00000008F7881088108810B82108C6080008000000001000100010001FF80000 -AEC1:00000008F7881088108810B82108C60800080000000020F8201020303ECC0000 -AEC2:00000008F7881088108810B82108C60800080000202021FC207020883E700000 -AEC3:00000008F7881088108810B82108C6080008000003F802000200020003F80000 -AEC4:00000008F7881088108810B82108C6080008000007F8000807F8040007F80000 -AEC5:00000008F7881088108810B82108C608000800003EF802083E0820083E080000 -AEC6:00000008F7881088108810B82108C608000800003EF802883E8820883EF80000 -AEC7:00000008F7881088108810B82108C608000800003E8802883EF820883EF80000 -AEC8:00000008F7881088108810B82108C608000800000F8800880F8808140FA20000 -AEC9:00000008F7881088108810B82108C608000800003EF802803EF820803EF80000 -AECA:00000008F7881088108810B82108C608000800003EFC02483E4820483EFC0000 -AECB:00000008F7881088108810B82108C608000800003E1002FE3E3820443E380000 -AECC:00000008F7881088108810B82108C6080008000003F802080208020803F80000 -AECD:00000008F7881088108810B82108C608000800000208020803F8020803F80000 -AECE:00000008F7881088108810B82108C60800080000210821083F0821143F620000 -AECF:00000008F7881088108810B82108C60800080000001000100010006801840000 -AED0:00000008F7881088108810B82108C608000800000048004800A8011406620000 -AED1:00000008F7881088108810B82108C60800080000000003F00408040803F00000 -AED2:00000008F7881088108810B82108C6080008000003F80020002000D003080000 -AED3:00000008F7881088108810B82108C60800080000004003F8004000A003180000 -AED4:00000008F7881088108810B82108C6080008000003F8000803F8000800080000 -AED5:00000008F7881088108810B82108C6080008000003F8020003F8020003F80000 -AED6:00000008F7881088108810B82108C6080008000000000FF8022002200FF80000 -AED7:00000008F7881088108810B82108C6080008000000800FF803E0041003E00000 -AED8:00000000000A000A7B8A088A088A08BA110A110A220A440A080A000A000A0000 -AED9:00000028F7A810A810A810E82128C6280028000007F800080008000800080000 -AEDA:00000028F7A810A810A810E82128C6280028000000003EF80208020802080000 -AEDB:00000028F7A810A810A810E82128C6280028000000003E100210022802C40000 -AEDC:00000028F7A810A810A810E82128C6280028000008000800080008000FF80000 -AEDD:00000028F7A810A810A810E82128C62800280000000020F8201020303ECC0000 -AEDE:00000028F7A810A810A810E82128C62800280000202021FC207020883E700000 -AEDF:00000028F7A810A810A810E82128C6280028000003F802000200020003F80000 -AEE0:00000028F7A810A810A810E82128C6280028000007F8000807F8040007F80000 -AEE1:00000028F7A810A810A810E82128C628002800003EF802083E0820083E080000 -AEE2:00000028F7A810A810A810E82128C628002800003EF802883E8820883EF80000 -AEE3:00000028F7A810A810A810E82128C628002800003E8802883EF820883EF80000 -AEE4:00000028F7A810A810A810E82128C628002800001F0801081F0810141F620000 -AEE5:00000028F7A810A810A810E82128C628002800003EF802803EF820803EF80000 -AEE6:00000028F7A810A810A810E82128C628002800003EFC02483E4820483EFC0000 -AEE7:00000028F7A810A810A810E82128C628002800003E1002FE3E3820443E380000 -AEE8:00000028F7A810A810A810E82128C6280028000003F802080208020803F80000 -AEE9:00000028F7A810A810A810E82128C628002800000208020803F8020803F80000 -AEEA:00000028F7A810A810A810E82128C62800280000110811081F0811141F620000 -AEEB:00000028F7A810A810A810E82128C62800280000000800080008003400C20000 -AEEC:00000028F7A810A810A810E82128C628002800000048004800A8011406620000 -AEED:00000028F7A810A810A810E82128C62800280000000001F00208020801F00000 -AEEE:00000028F7A810A810A810E82128C6280028000003F80020002000D003080000 -AEEF:00000028F7A810A810A810E82128C62800280000004003F8004000A003180000 -AEF0:00000028F7A810A810A810E82128C6280028000003F8000803F8000800080000 -AEF1:00000028F7A810A810A810E82128C6280028000003F8020003F8020003F80000 -AEF2:00000028F7A810A810A810E82128C6280028000000000FF8022002200FF80000 -AEF3:00000028F7A810A810A810E82128C6280028000000800FF803E0041003E00000 -AEF4:00000000000200027B820882089E08821102111E220244020802000200020000 -AEF5:00000008F788108810B810882138C60800080000000007F80008000800080000 -AEF6:00000008F788108810B810882138C6080008000000003EF80208020802080000 -AEF7:00000008F788108810B810882138C6080008000000001F080108011401620000 -AEF8:00000008F788108810B810882138C6080008000800001000100010001FF80000 -AEF9:00000008F788108810B810882138C60800080000000020F8201020303ECC0000 -AEFA:00000008F788108810B810882138C60800080000202021FC207020883E700000 -AEFB:00000008F788108810B810882138C6080008000003F802000200020003F80000 -AEFC:00000008F788108810B810882138C6080008000007F8000807F8040007F80000 -AEFD:00000008F788108810B810882138C608000800003EF802083E0820083E080000 -AEFE:00000008F788108810B810882138C608000800003EF802883E8820883EF80000 -AEFF:00000008F788108810B810882138C608000800003E8802883EF820883EF80000 -AF00:00000008F788108810B810882138C608000800000F8800880F8808140FA20000 -AF01:00000008F788108810B810882138C608000800003EF802803EF820803EF80000 -AF02:00000008F788108810B810882138C608000800003EFC02483E4820483EFC0000 -AF03:00000008F788108810B810882138C608000800003E1002FE3E3820443E380000 -AF04:00000008F788108810B810882138C6080008000003F802080208020803F80000 -AF05:00000008F788108810B810882138C608000800000208020803F8020803F80000 -AF06:00000008F788108810B810882138C60800080000210821083F0821143F620000 -AF07:00000008F788108810B810882138C60800080000001000100010006801840000 -AF08:00000008F788108810B810882138C608000800000048004800A8011406620000 -AF09:00000008F788108810B810882138C60800080000000003F00408040803F00000 -AF0A:00000008F788108810B810882138C6080008000003F80020002000D003080000 -AF0B:00000008F788108810B810882138C60800080000004003F8004000A003180000 -AF0C:00000008F788108810B810882138C6080008000003F8000803F8000800080000 -AF0D:00000008F788108810B810882138C6080008000003F8020003F8020003F80000 -AF0E:00000008F788108810B810882138C6080008000000000FF8022002200FF80000 -AF0F:00000008F788108810B810882138C6080008000000800FF803E0041003E00000 -AF10:00000000000A000A7B8A088A08BA088A110A113A220A440A080A000A000A0000 -AF11:00000028F7A810A810E810A821E8C6280028000007F800080008000800080000 -AF12:00000028F7A810A810E810A821E8C6280028000000003EF80208020802080000 -AF13:00000028F7A810A810E810A821E8C6280028000000003E100210022802C40000 -AF14:00000028F7A810A810E810A821E8C6280028002808000800080008000FF80000 -AF15:00000028F7A810A810E810A821E8C62800280000000020F8201020303ECC0000 -AF16:00000028F7A810A810E810A821E8C62800280000202021FC207020883E700000 -AF17:00000028F7A810A810E810A821E8C6280028000003F802000200020003F80000 -AF18:00000028F7A810A810E810A821E8C6280028000007F8000807F8040007F80000 -AF19:00000028F7A810A810E810A821E8C628002800003EF802083E0820083E080000 -AF1A:00000028F7A810A810E810A821E8C628002800003EF802883E8820883EF80000 -AF1B:00000028F7A810A810E810A821E8C628002800003E8802883EF820883EF80000 -AF1C:00000028F7A810A810E810A821E8C628002800001F0801081F0810141F620000 -AF1D:00000028F7A810A810E810A821E8C628002800003EF802803EF820803EF80000 -AF1E:00000028F7A810A810E810A821E8C628002800003EFC02483E4820483EFC0000 -AF1F:00000028F7A810A810E810A821E8C628002800003E1002FE3E3820443E380000 -AF20:00000028F7A810A810E810A821E8C6280028000003F802080208020803F80000 -AF21:00000028F7A810A810E810A821E8C628002800000208020803F8020803F80000 -AF22:00000028F7A810A810E810A821E8C62800280000110811081F0811141F620000 -AF23:00000028F7A810A810E810A821E8C62800280000000800080008003400C20000 -AF24:00000028F7A810A810E810A821E8C628002800000048004800A8011406620000 -AF25:00000028F7A810A810E810A821E8C62800280000000001F00208020801F00000 -AF26:00000028F7A810A810E810A821E8C6280028000003F80020002000D003080000 -AF27:00000028F7A810A810E810A821E8C62800280000004003F8004000A003180000 -AF28:00000028F7A810A810E810A821E8C6280028000003F8000803F8000800080000 -AF29:00000028F7A810A810E810A821E8C6280028000003F8020003F8020003F80000 -AF2A:00000028F7A810A810E810A821E8C6280028000000000FF8022002200FF80000 -AF2B:00000028F7A810A810E810A821E8C6280028000000800FF803E0041003E00000 -AF2C:00000000000000003EF8020802080208020800000100010001007FFC00000000 -AF2D:000000003EF8020802080208010001007FFC00001FF000100010001000100000 -AF2E:000000003EF8020802080208010001007FFC000000003EF80208020802080000 -AF2F:000000003EF8020802080208010001007FFC000000001E100210022802C40000 -AF30:000000003EF8020802080208010001007FFC000000001000100010001FF00000 -AF31:000000003EF8020802080208010001007FFC0000000020F8201020303ECC0000 -AF32:000000003EF8020802080208010001007FFC0000202021FC207020883E700000 -AF33:000000003EF8020802080208010001007FFC00001FF01000100010001FF00000 -AF34:000000003EF8020802080208010001007FFC00001FF000101FF010001FF00000 -AF35:000000003EF8020802080208010001007FFC00003EF802083E0820083E080000 -AF36:000000003EF8020802080208010001007FFC00003EF802883E8820883EF80000 -AF37:000000003EF8020802080208010001007FFC00003E8802883EF820883EF80000 -AF38:000000003EF8020802080208010001007FFC00003E1002103E1020283EC40000 -AF39:000000003EF8020802080208010001007FFC00003EF802803EF820803EF80000 -AF3A:000000003EF8020802080208010001007FFC00003EFC02483E4820483EFC0000 -AF3B:000000003EF8020802080208010001007FFC00003E2003FC3E7020883E700000 -AF3C:000000003EF8020802080208010001007FFC00001FF01010101010101FF00000 -AF3D:000000003EF8020802080208010001007FFC0000101010101FF010101FF00000 -AF3E:000000003EF8020802080208010001007FFC0000222022203E2022503E880000 -AF3F:000000003EF8020802080208010001007FFC000000000100010002800C400000 -AF40:000000003EF8020802080208010001007FFC00000000024002400DA033100000 -AF41:000000003EF8020802080208010001007FFC0000000007C00820082007C00000 -AF42:000000003EF8020802080208010001007FFC0000000007E00080014006200000 -AF43:000000003EF8020802080208010001007FFC0000008007E00080014006200000 -AF44:000000003EF8020802080208010001007FFC00001FF000101FF0001000100000 -AF45:000000003EF8020802080208010001007FFC00001FF010001FF010001FF00000 -AF46:000000003EF8020802080208010001007FFC000000001FF0044004401FF00000 -AF47:000000003EF8020802080208010001007FFC000001001FF007C0082007C00000 -AF48:00000010001000107BD008500850085E08500010041004107FD0001000100000 -AF49:00000008F7881088108E1088148804087FE8000007F800080008000800080000 -AF4A:00000008F7881088108E1088148804087FE8000000003EF80208020802080000 -AF4B:00000008F7881088108E1088148804087FE8000000001F080108011401620000 -AF4C:00000008F7881088108E1088148804087FE8000008000800080008000FF80000 -AF4D:00000008F7881088108E1088148804087FE80000000010F8101010301ECC0000 -AF4E:00000008F7881088108E1088148804087FE800000808087F081C08220F9C0000 -AF4F:00000008F7881088108E1088148804087FE8000003F802000200020003F80000 -AF50:00000008F7881088108E1088148804087FE8000007F8000807F8040007F80000 -AF51:00000008F7881088108E1088148804087FE800003EF802083E0820083E080000 -AF52:00000008F7881088108E1088148804087FE800003EF802883E8820883EF80000 -AF53:00000008F7881088108E1088148804087FE800003E8802883EF820883EF80000 -AF54:00000008F7881088108E1088148804087FE800001F0801081F0810141F620000 -AF55:00000008F7881088108E1088148804087FE800003EF802803EF820803EF80000 -AF56:00000008F7881088108E1088148804087FE800003EFC02483E4820483EFC0000 -AF57:00000008F7881088108E1088148804087FE800001F08017F1F1C10221F1C0000 -AF58:00000008F7881088108E1088148804087FE8000003F802080208020803F80000 -AF59:00000008F7881088108E1088148804087FE800000208020803F8020803F80000 -AF5A:00000008F7881088108E1088148804087FE80000110811081F0811141F620000 -AF5B:00000008F7881088108E1088148804087FE80000001000100010006801840000 -AF5C:00000008F7881088108E1088148804087FE800000048004800A8011406620000 -AF5D:00000008F7881088108E1088148804087FE80000000003F00408040803F00000 -AF5E:00000008F7881088108E1088148804087FE8000003F80020002000D003080000 -AF5F:00000008F7881088108E1088148804087FE80000004003F8004000A003180000 -AF60:00000008F7881088108E1088148804087FE8000003F8000803F8000800080000 -AF61:00000008F7881088108E1088148804087FE8000003F8020003F8020003F80000 -AF62:00000008F7881088108E1088148804087FE8000000000FF8022002200FF80000 -AF63:00000008F7881088108E1088148804087FE8000000800FF803E0041003E00000 -AF64:00000012001200127BD208520852085E08520012041204127FD2001200120000 -AF65:00000028F7A810A810B810A814A804287FA8000007F800080008000800080000 -AF66:00000028F7A810A810B810A814A804287FA8000000003EF80208020802080000 -AF67:00000028F7A810A810B810A814A804287FA8000000001F080108011401620000 -AF68:00000028F7A810A810B810A814A804287FA8000008000800080008000FF80000 -AF69:00000028F7A810A810B810A814A804287FA80000000010F8101010301ECC0000 -AF6A:00000028F7A810A810B810A814A804287FA800000808087F081C08220F9C0000 -AF6B:00000028F7A810A810B810A814A804287FA8000003F802000200020003F80000 -AF6C:00000028F7A810A810B810A814A804287FA8000007F8000807F8040007F80000 -AF6D:00000028F7A810A810B810A814A804287FA800003EF802083E0820083E080000 -AF6E:00000028F7A810A810B810A814A804287FA800003EF802883E8820883EF80000 -AF6F:00000028F7A810A810B810A814A804287FA800003E8802883EF820883EF80000 -AF70:00000028F7A810A810B810A814A804287FA800001F0801081F0810141F620000 -AF71:00000028F7A810A810B810A814A804287FA800003EF802803EF820803EF80000 -AF72:00000028F7A810A810B810A814A804287FA800003EFC02483E4820483EFC0000 -AF73:00000028F7A810A810B810A814A804287FA800001F08017F1F1C10221F1C0000 -AF74:00000028F7A810A810B810A814A804287FA8000003F802080208020803F80000 -AF75:00000028F7A810A810B810A814A804287FA800000208020803F8020803F80000 -AF76:00000028F7A810A810B810A814A804287FA80000110811081F0811141F620000 -AF77:00000028F7A810A810B810A814A804287FA80000001000100010006801840000 -AF78:00000028F7A810A810B810A814A804287FA800000048004800A8011406620000 -AF79:00000028F7A810A810B810A814A804287FA80000000003F00408040803F00000 -AF7A:00000028F7A810A810B810A814A804287FA8000003F80020002000D003080000 -AF7B:00000028F7A810A810B810A814A804287FA80000004003F8004000A003180000 -AF7C:00000028F7A810A810B810A814A804287FA8000003F8000803F8000800080000 -AF7D:00000028F7A810A810B810A814A804287FA8000003F8020003F8020003F80000 -AF7E:00000028F7A810A810B810A814A804287FA8000000000FF8022002200FF80000 -AF7F:00000028F7A810A810B810A814A804287FA8000000800FF803E0041003E00000 -AF80:00000008000800087BC808480848084808480008040804087FE8000800080000 -AF81:00000008F788108810881088148804087FE8000007F800080008000800080000 -AF82:00000008F788108810881088148804087FE8000000003EF80208020802080000 -AF83:00000008F788108810881088148804087FE8000000001F080108011401620000 -AF84:00000008F788108810881088148804087FE8000008000800080008000FF80000 -AF85:00000008F788108810881088148804087FE80000000010F8101010301ECC0000 -AF86:00000008F788108810881088148804087FE800000808087F081C08220F9C0000 -AF87:00000008F788108810881088148804087FE8000003F802000200020003F80000 -AF88:00000008F788108810881088148804087FE8000007F8000807F8040007F80000 -AF89:00000008F788108810881088148804087FE800003EF802083E0820083E080000 -AF8A:00000008F788108810881088148804087FE800003EF802883E8820883EF80000 -AF8B:00000008F788108810881088148804087FE800003E8802883EF820883EF80000 -AF8C:00000008F788108810881088148804087FE800001F0801081F0810141F620000 -AF8D:00000008F788108810881088148804087FE800003EF802803EF820803EF80000 -AF8E:00000008F788108810881088148804087FE800003EFC02483E4820483EFC0000 -AF8F:00000008F788108810881088148804087FE800001F08017F1F1C10221F1C0000 -AF90:00000008F788108810881088148804087FE8000003F802080208020803F80000 -AF91:00000008F788108810881088148804087FE800000208020803F8020803F80000 -AF92:00000008F788108810881088148804087FE80000110811081F0811141F620000 -AF93:00000008F788108810881088148804087FE80000001000100010006801840000 -AF94:00000008F788108810881088148804087FE800000048004800A8011406620000 -AF95:00000008F788108810881088148804087FE80000000003F00408040803F00000 -AF96:00000008F788108810881088148804087FE8000003F80020002000D003080000 -AF97:00000008F788108810881088148804087FE80000004003F8004000A003180000 -AF98:00000008F788108810881088148804087FE8000003F8000803F8000800080000 -AF99:00000008F788108810881088148804087FE8000003F8020003F8020003F80000 -AF9A:00000008F788108810881088148804087FE8000000000FF8022002200FF80000 -AF9B:00000008F788108810881088148804087FE8000000800FF803E0041003E00000 -AF9C:00000000000000003EF8020802080208020804400440044004407FFC00000000 -AF9D:000000003EF8020802080208044004407FFC00001FF000100010001000100000 -AF9E:000000003EF8020802080208044004407FFC000000003EF80208020802080000 -AF9F:000000003EF8020802080208044004407FFC000000001E100210022802C40000 -AFA0:000000003EF8020802080208044004407FFC000000001000100010001FF00000 -AFA1:000000003EF8020802080208044004407FFC0000000020F8201020303ECC0000 -AFA2:000000003EF8020802080208044004407FFC0000202021FC207020883E700000 -AFA3:000000003EF8020802080208044004407FFC00001FF01000100010001FF00000 -AFA4:000000003EF8020802080208044004407FFC00001FF000101FF010001FF00000 -AFA5:000000003EF8020802080208044004407FFC00003EF802083E0820083E080000 -AFA6:000000003EF8020802080208044004407FFC00003EF802883E8820883EF80000 -AFA7:000000003EF8020802080208044004407FFC00003E8802883EF820883EF80000 -AFA8:000000003EF8020802080208044004407FFC00003E1002103E1020283EC40000 -AFA9:000000003EF8020802080208044004407FFC00003EF802803EF820803EF80000 -AFAA:000000003EF8020802080208044004407FFC00003EFC02483E4820483EFC0000 -AFAB:000000003EF8020802080208044004407FFC00003E2003FC3E7020883E700000 -AFAC:000000003EF8020802080208044004407FFC00001FF01010101010101FF00000 -AFAD:000000003EF8020802080208044004407FFC0000101010101FF010101FF00000 -AFAE:000000003EF8020802080208044004407FFC0000222022203E2022503E880000 -AFAF:000000003EF8020802080208044004407FFC000000000100010002800C400000 -AFB0:000000003EF8020802080208044004407FFC00000000024002400DA033100000 -AFB1:000000003EF8020802080208044004407FFC0000000007C00820082007C00000 -AFB2:000000003EF8020802080208044004407FFC0000000007E00080014006200000 -AFB3:000000003EF8020802080208044004407FFC0000008007E00080014006200000 -AFB4:000000003EF8020802080208044004407FFC00001FF000101FF0001000100000 -AFB5:000000003EF8020802080208044004407FFC00001FF010001FF010001FF00000 -AFB6:000000003EF8020802080208044004407FFC000000001FF0044004401FF00000 -AFB7:000000003EF8020802080208044004407FFC000001001FF007C0082007C00000 -AFB8:00000000000000007DF0041004100410041000003FF801000100010001000000 -AFB9:000000003EF802080208020800007FFC010001001FF000100010001000100000 -AFBA:000000003EF802080208020800007FFC0100010000003EF80208020802080000 -AFBB:000000003EF802080208020800007FFC0100010000001E100210022802C40000 -AFBC:000000003EF8020802080208000000007FFC010001001100100010001FF00000 -AFBD:000000003EF802080208020800007FFC01000100000020F8201020303ECC0000 -AFBE:000000003EF802080208020800007FFC01000100202021FC207020883E700000 -AFBF:000000003EF802080208020800007FFC010001001FF01000100010001FF00000 -AFC0:000000003EF802080208020800007FFC010001001FF000101FF010001FF00000 -AFC1:000000003EF802080208020800007FFC010001003EF802083E0820083E080000 -AFC2:000000003EF802080208020800007FFC010001003EF802883E8820883EF80000 -AFC3:000000003EF802080208020800007FFC010001003E8802883EF820883EF80000 -AFC4:000000003EF802080208020800007FFC010001003E1002103E1020283EC40000 -AFC5:000000003EF802080208020800007FFC010001003EF802803EF820803EF80000 -AFC6:000000003EF802080208020800007FFC010001003EFC02483E4820483EFC0000 -AFC7:000000003EF802080208020800007FFC010001003E2003FC3E7020883E700000 -AFC8:000000003EF802080208020800007FFC010001001FF01010101010101FF00000 -AFC9:000000003EF802080208020800007FFC01000100101010101FF010101FF00000 -AFCA:000000003EF802080208020800007FFC01000100222022203E2022503E880000 -AFCB:000000003EF802080208020800007FFC0100010000000100010002800C400000 -AFCC:000000003EF802080208020800007FFC010001000000024002400DA033100000 -AFCD:000000003EF802080208020800007FFC01000100000007C00820082007C00000 -AFCE:000000003EF802080208020800007FFC01000100000007E00080014006200000 -AFCF:000000003EF802080208020800007FFC01000100008007E00080014006200000 -AFD0:000000003EF802080208020800007FFC010001001FF000101FF0001000100000 -AFD1:000000003EF802080208020800007FFC010001001FF010001FF010001FF00000 -AFD2:000000003EF802080208020800007FFC0100010000001FF0044004401FF00000 -AFD3:000000003EF802080208020800007FFC0100010001001FF007C0082007C00000 -AFD4:00000008000800087BC8084808480848000800087FE8040804F8040804080000 -AFD5:00080008F7881088108810887FE8027802080000000007F80008000800080000 -AFD6:00080008F7881088108810887FE802780208000000003EF80208020802080000 -AFD7:00080008F7881088108810887FE802780208000000001F080108011401620000 -AFD8:00080008F78810881088108800087FE80278020802081000100010001FF80000 -AFD9:00080008F7881088108810887FE8027802080000000020F8201020303ECC0000 -AFDA:00080008F7881088108810887FE8027802080000202021FC207020883E700000 -AFDB:00080008F7881088108810887FE802780208000003F802000200020003F80000 -AFDC:00080008F7881088108810887FE802780208000007F8000807F8040007F80000 -AFDD:00080008F7881088108810887FE80278020800003EF802083E0820083E080000 -AFDE:00080008F7881088108810887FE80278020800003EF802883E8820883EF80000 -AFDF:00080008F7881088108810887FE80278020800003E8802883EF820883EF80000 -AFE0:00080008F7881088108810887FE80278020800000F8800880F8808140FA20000 -AFE1:00080008F7881088108810887FE80278020800003EF802803EF820803EF80000 -AFE2:00080008F7881088108810887FE80278020800003EFC02483E4820483EFC0000 -AFE3:00080008F7881088108810887FE80278020800003E1002FE3E3820443E380000 -AFE4:00080008F7881088108810887FE802780208000003F802080208020803F80000 -AFE5:00080008F7881088108810887FE80278020800000208020803F8020803F80000 -AFE6:00080008F7881088108810887FE8027802080000210821083F0821143F620000 -AFE7:00080008F7881088108810887FE8027802080000001000100010006801840000 -AFE8:00080008F7881088108810887FE80278020800000048004800A8011406620000 -AFE9:00080008F7881088108810887FE8027802080000000003F00408040803F00000 -AFEA:00080008F7881088108810887FE802780208000003F80020002000D003080000 -AFEB:00080008F7881088108810887FE8027802080000004003F8004000A003180000 -AFEC:00080008F7881088108810887FE802780208000003F8000803F8000800080000 -AFED:00080008F7881088108810887FE802780208000003F8020003F8020003F80000 -AFEE:00080008F7881088108810887FE802780208000000000FF8022002200FF80000 -AFEF:00080008F7881088108810887FE802780208000000800FF803E0041003E00000 -AFF0:0000000A000A000A7BCA084A084A084A000A000A7FEA040A047A040A040A0000 -AFF1:00280028F7A810A810A810A87FA805E804280000000007F80008000800080000 -AFF2:00280028F7A810A810A810A87FA805E80428000000003EF80208020802080000 -AFF3:00280028F7A810A810A810A87FA805E80428000000001F080108011401620000 -AFF4:00280028F7A810A810A810A800287FA8042805E804281428100010001FF80000 -AFF5:00280028F7A810A810A810A87FA805E804280000000020F8201020303ECC0000 -AFF6:00280028F7A810A810A810A87FA805E804280000202021FC207020883E700000 -AFF7:00280028F7A810A810A810A87FA805E80428000003F802000200020003F80000 -AFF8:00280028F7A810A810A810A87FA805E80428000007F8000807F8040007F80000 -AFF9:00280028F7A810A810A810A87FA805E8042800003EF802083E0820083E080000 -AFFA:00280028F7A810A810A810A87FA805E8042800003EF802883E8820883EF80000 -AFFB:00280028F7A810A810A810A87FA805E8042800003E8802883EF820883EF80000 -AFFC:00280028F7A810A810A810A87FA805E8042800000F8800880F8808140FA20000 -AFFD:00280028F7A810A810A810A87FA805E8042800003EF802803EF820803EF80000 -AFFE:00280028F7A810A810A810A87FA805E8042800003EFC02483E4820483EFC0000 -AFFF:00280028F7A810A810A810A87FA805E8042800003E1002FE3E3820443E380000 -B000:00280028F7A810A810A810A87FA805E80428000003F802080208020803F80000 -B001:00280028F7A810A810A810A87FA805E8042800000208020803F8020803F80000 -B002:00280028F7A810A810A810A87FA805E804280000210821083F0821143F620000 -B003:00280028F7A810A810A810A87FA805E804280000001000100010006801840000 -B004:00280028F7A810A810A810A87FA805E8042800000048004800A8011406620000 -B005:00280028F7A810A810A810A87FA805E804280000000003F00408040803F00000 -B006:00280028F7A810A810A810A87FA805E80428000003F80020002000D003080000 -B007:00280028F7A810A810A810A87FA805E804280000004003F8004000A003180000 -B008:00280028F7A810A810A810A87FA805E80428000003F8000803F8000800080000 -B009:00280028F7A810A810A810A87FA805E80428000003F8020003F8020003F80000 -B00A:00280028F7A810A810A810A87FA805E80428000000000FF8022002200FF80000 -B00B:00280028F7A810A810A810A87FA805E80428000000800FF803E0041003E00000 -B00C:00000008000800087BC8084808480848000800087FE804080408040804080000 -B00D:00080008F7881088108810887FE8020802000000000007F80008000800080000 -B00E:00080008F7881088108810887FE802080200000000003EF80208020802080000 -B00F:00080008F7881088108810887FE802080200000000001F080108011401620000 -B010:00080008F78810881088108800087FE80208020802081008100010001FF80000 -B011:00080008F7881088108810887FE8020802000000000020F8201020303ECC0000 -B012:00080008F7881088108810887FE8020802000000202021FC207020883E700000 -B013:00080008F7881088108810887FE802080200000003F802000200020003F80000 -B014:00080008F7881088108810887FE802080200000007F8000807F8040007F80000 -B015:00080008F7881088108810887FE80208020000003EF802083E0820083E080000 -B016:00080008F7881088108810887FE80208020000003EF802883E8820883EF80000 -B017:00080008F7881088108810887FE80208020000003E8802883EF820883EF80000 -B018:00080008F7881088108810887FE80208020000000F8800880F8808140FA20000 -B019:00080008F7881088108810887FE80208020000003EF802803EF820803EF80000 -B01A:00080008F7881088108810887FE80208020000003EFC02483E4820483EFC0000 -B01B:00080008F7881088108810887FE80208020000003E1002FE3E3820443E380000 -B01C:00080008F7881088108810887FE802080200000003F802080208020803F80000 -B01D:00080008F7881088108810887FE80208020000000208020803F8020803F80000 -B01E:00080008F7881088108810887FE8020802000000210821083F0821143F620000 -B01F:00080008F7881088108810887FE8020802000000001000100010006801840000 -B020:00080008F7881088108810887FE80208020000000048004800A8011406620000 -B021:00080008F7881088108810887FE8020802000000000003F00408040803F00000 -B022:00080008F7881088108810887FE802080200000003F80020002000D003080000 -B023:00080008F7881088108810887FE8020802000000004003F8004000A003180000 -B024:00080008F7881088108810887FE802080200000003F8000803F8000800080000 -B025:00080008F7881088108810887FE802080200000003F8020003F8020003F80000 -B026:00080008F7881088108810887FE802080200000000000FF8022002200FF80000 -B027:00080008F7881088108810887FE802080200000000800FF803E0041003E00000 -B028:00000000000000007DF0041004100410041000007FFC04400440044004400000 -B029:000000003EF802080208020800007FFC044004401FF000100010001000100000 -B02A:000000003EF802080208020800007FFC0440044000003EF80208020802080000 -B02B:000000003EF802080208020800007FFC0440044000001E100210022802C40000 -B02C:000000003EF8020802080208000000007FFC044004401440100010001FF00000 -B02D:000000003EF802080208020800007FFC04400440000020F8201020303ECC0000 -B02E:000000003EF802080208020800007FFC04400440202021FC207020883E700000 -B02F:000000003EF802080208020800007FFC044004401FF01000100010001FF00000 -B030:000000003EF802080208020800007FFC044004401FF000101FF010001FF00000 -B031:000000003EF802080208020800007FFC044004403EF802083E0820083E080000 -B032:000000003EF802080208020800007FFC044004403EF802883E8820883EF80000 -B033:000000003EF802080208020800007FFC044004403E8802883EF820883EF80000 -B034:000000003EF802080208020800007FFC044004403E1002103E1020283EC40000 -B035:000000003EF802080208020800007FFC044004403EF802803EF820803EF80000 -B036:000000003EF802080208020800007FFC044004403EFC02483E4820483EFC0000 -B037:000000003EF802080208020800007FFC044004403E2003FC3E7020883E700000 -B038:000000003EF802080208020800007FFC044004401FF01010101010101FF00000 -B039:000000003EF802080208020800007FFC04400440101010101FF010101FF00000 -B03A:000000003EF802080208020800007FFC04400440222022203E2022503E880000 -B03B:000000003EF802080208020800007FFC0440044000000100010002800C400000 -B03C:000000003EF802080208020800007FFC044004400000024002400DA033100000 -B03D:000000003EF802080208020800007FFC04400440000007C00820082007C00000 -B03E:000000003EF802080208020800007FFC04400440000007E00080014006200000 -B03F:000000003EF802080208020800007FFC04400440008007E00080014006200000 -B040:000000003EF802080208020800007FFC044004401FF000101FF0001000100000 -B041:000000003EF802080208020800007FFC044004401FF010001FF010001FF00000 -B042:000000003EF802080208020800007FFC0440044000001FF0044004401FF00000 -B043:000000003EF802080208020800007FFC0440044001001FF007C0082007C00000 -B044:00000000000000003EF80208020802080208000000007FFC0000000000000000 -B045:000000003EF8020802080208000000007FFC00001FF000100010001000100000 -B046:000000003EF8020802080208000000007FFC000000003EF80208020802080000 -B047:000000003EF8020802080208000000007FFC000000001E100210022802C40000 -B048:000000003EF8020802080208000000007FFC000000001000100010001FF00000 -B049:000000003EF8020802080208000000007FFC0000000020F8201020303ECC0000 -B04A:000000003EF8020802080208000000007FFC0000202021FC207020883E700000 -B04B:000000003EF8020802080208000000007FFC00001FF01000100010001FF00000 -B04C:000000003EF8020802080208000000007FFC00001FF000101FF010001FF00000 -B04D:000000003EF8020802080208000000007FFC00003EF802083E0820083E080000 -B04E:000000003EF8020802080208000000007FFC00003EF802883E8820883EF80000 -B04F:000000003EF8020802080208000000007FFC00003E8802883EF820883EF80000 -B050:000000003EF8020802080208000000007FFC00003E1002103E1020283EC40000 -B051:000000003EF8020802080208000000007FFC00003EF802803EF820803EF80000 -B052:000000003EF8020802080208000000007FFC00003EFC02483E4820483EFC0000 -B053:000000003EF8020802080208000000007FFC00003E2003FC3E7020883E700000 -B054:000000003EF8020802080208000000007FFC00001FF01010101010101FF00000 -B055:000000003EF8020802080208000000007FFC0000101010101FF010101FF00000 -B056:000000003EF8020802080208000000007FFC0000222022203E2022503E880000 -B057:000000003EF8020802080208000000007FFC000000000100010002800C400000 -B058:000000003EF8020802080208000000007FFC00000000024002400DA033100000 -B059:000000003EF8020802080208000000007FFC0000000007C00820082007C00000 -B05A:000000003EF8020802080208000000007FFC0000000007E00080014006200000 -B05B:000000003EF8020802080208000000007FFC0000008007E00080014006200000 -B05C:000000003EF8020802080208000000007FFC00001FF000101FF0001000100000 -B05D:000000003EF8020802080208000000007FFC00001FF010001FF010001FF00000 -B05E:000000003EF8020802080208000000007FFC000000001FF0044004401FF00000 -B05F:000000003EF8020802080208000000007FFC000001001FF007C0082007C00000 -B060:00000008000800087BC80848084808480848000800087FE80008000800080000 -B061:00000008F788108810881088108800087FE8000007F800080008000800080000 -B062:00000008F788108810881088108800087FE8000000003EF80208020802080000 -B063:00000008F788108810881088108800087FE8000000001F080108011401620000 -B064:00000008F788108810881088108800087FE8000008000800080008000FF80000 -B065:00000008F788108810881088108800087FE80000000010F8101010301ECC0000 -B066:00000008F788108810881088108800087FE800000808087F081C08220F9C0000 -B067:00000008F788108810881088108800087FE8000003F802000200020003F80000 -B068:00000008F788108810881088108800087FE8000007F8000807F8040007F80000 -B069:00000008F788108810881088108800087FE800003EF802083E0820083E080000 -B06A:00000008F788108810881088108800087FE800003EF802883E8820883EF80000 -B06B:00000008F788108810881088108800087FE800003E8802883EF820883EF80000 -B06C:00000008F788108810881088108800087FE800001F0801081F0810141F620000 -B06D:00000008F788108810881088108800087FE800003EF802803EF820803EF80000 -B06E:00000008F788108810881088108800087FE800003EFC02483E4820483EFC0000 -B06F:00000008F788108810881088108800087FE800001F08017F1F1C10221F1C0000 -B070:00000008F788108810881088108800087FE8000003F802080208020803F80000 -B071:00000008F788108810881088108800087FE800000208020803F8020803F80000 -B072:00000008F788108810881088108800087FE80000110811081F0811141F620000 -B073:00000008F788108810881088108800087FE80000001000100010006801840000 -B074:00000008F788108810881088108800087FE800000048004800A8011406620000 -B075:00000008F788108810881088108800087FE80000000003F00408040803F00000 -B076:00000008F788108810881088108800087FE8000003F80020002000D003080000 -B077:00000008F788108810881088108800087FE80000004003F8004000A003180000 -B078:00000008F788108810881088108800087FE8000003F8000803F8000800080000 -B079:00000008F788108810881088108800087FE8000003F8020003F8020003F80000 -B07A:00000008F788108810881088108800087FE8000000000FF8022002200FF80000 -B07B:00000008F788108810881088108800087FE8000000800FF803E0041003E00000 -B07C:00000000000800087B8808880888088811081108220844080808000800080000 -B07D:00000008F7881088108810882108C60800080000000007F80008000800080000 -B07E:00000008F7881088108810882108C6080008000000003EF80208020802080000 -B07F:00000008F7881088108810882108C6080008000000001F080108011401620000 -B080:00000008F7881088108810882108C6080008000800001000100010001FF80000 -B081:00000008F7881088108810882108C60800080000000020F8201020303ECC0000 -B082:00000008F7881088108810882108C60800080000202021FC207020883E700000 -B083:00000008F7881088108810882108C6080008000003F802000200020003F80000 -B084:00000008F7881088108810882108C6080008000007F8000807F8040007F80000 -B085:00000008F7881088108810882108C608000800003EF802083E0820083E080000 -B086:00000008F7881088108810882108C608000800003EF802883E8820883EF80000 -B087:00000008F7881088108810882108C608000800003E8802883EF820883EF80000 -B088:00000008F7881088108810882108C608000800000F8800880F8808140FA20000 -B089:00000008F7881088108810882108C608000800003EF802803EF820803EF80000 -B08A:00000008F7881088108810882108C608000800003EFC02483E4820483EFC0000 -B08B:00000008F7881088108810882108C608000800003E1002FE3E3820443E380000 -B08C:00000008F7881088108810882108C6080008000003F802080208020803F80000 -B08D:00000008F7881088108810882108C608000800000208020803F8020803F80000 -B08E:00000008F7881088108810882108C60800080000210821083F0821143F620000 -B08F:00000008F7881088108810882108C60800080000001000100010006801840000 -B090:00000008F7881088108810882108C608000800000048004800A8011406620000 -B091:00000008F7881088108810882108C60800080000000003F00408040803F00000 -B092:00000008F7881088108810882108C6080008000003F80020002000D003080000 -B093:00000008F7881088108810882108C60800080000004003F8004000A003180000 -B094:00000008F7881088108810882108C6080008000003F8000803F8000800080000 -B095:00000008F7881088108810882108C6080008000003F8020003F8020003F80000 -B096:00000008F7881088108810882108C6080008000000000FF8022002200FF80000 -B097:00000008F7881088108810882108C6080008000000800FF803E0041003E00000 -B098:0000000000100010001040104010401E4010401040107F900010001000100000 -B099:00000008000800084008400E400840087E08000007F800080008000800080000 -B09A:00000008000800084008400E400840087E08000000003EF80208020802080000 -B09B:00000008000800084008400E400840087E08000000001F080108011401620000 -B09C:00000008000800084008400E400840087E08000808000800080008000FF80000 -B09D:00000008000800084008400E400840087E080000000010F8101010301ECC0000 -B09E:00000008000800084008400E400840087E0800000808087F081C08220F9C0000 -B09F:00000008000800084008400E400840087E08000003F802000200020003F80000 -B0A0:00000008000800084008400E400840087E08000007F8000807F8040007F80000 -B0A1:00000008000800084008400E400840087E0800003EF802083E0820083E080000 -B0A2:00000008000800084008400E400840087E0800003EF802883E8820883EF80000 -B0A3:00000008000800084008400E400840087E0800003E8802883EF820883EF80000 -B0A4:00000008000800084008400E400840087E0800001F0801081F0810141F620000 -B0A5:00000008000800084008400E400840087E0800003EF802803EF820803EF80000 -B0A6:00000008000800084008400E400840087E0800003EFC02483E4820483EFC0000 -B0A7:00000008000800084008400E400840087E0800001F08017F1F1C10221F1C0000 -B0A8:00000008000800084008400E400840087E08000003F802080208020803F80000 -B0A9:00000008000800084008400E400840087E0800000208020803F8020803F80000 -B0AA:00000008000800084008400E400840087E080000110811081F0811141F620000 -B0AB:00000008000800084008400E400840087E080000001000100010006801840000 -B0AC:00000008000800084008400E400840087E0800000048004800A8011406620000 -B0AD:00000008000800084008400E400840087E080000000003F00408040803F00000 -B0AE:00000008000800084008400E400840087E08000003F80020002000D003080000 -B0AF:00000008000800084008400E400840087E080000004003F8004000A003180000 -B0B0:00000008000800084008400E400840087E08000003F8000803F8000800080000 -B0B1:00000008000800084008400E400840087E08000003F8020003F8020003F80000 -B0B2:00000008000800084008400E400840087E08000000000FF8022002200FF80000 -B0B3:00000008000800084008400E400840087E08000000800FF803E0041003E00000 -B0B4:0000000000120012001240124012401E4012401240127F920012001200120000 -B0B5:000000280028002840284038402840287E28000007F800080008000800080000 -B0B6:000000280028002840284038402840287E28000000003EF80208020802080000 -B0B7:000000280028002840284038402840287E28000000003E100210022802C40000 -B0B8:000000280028002840284038402840287E28002808000800080008000FF80000 -B0B9:000000280028002840284038402840287E280000000020F8201020303ECC0000 -B0BA:000000280028002840284038402840287E280000202021FC207020883E700000 -B0BB:000000280028002840284038402840287E28000003F802000200020003F80000 -B0BC:000000280028002840284038402840287E28000007F8000807F8040007F80000 -B0BD:000000280028002840284038402840287E2800003EF802083E0820083E080000 -B0BE:000000280028002840284038402840287E2800003EF802883E8820883EF80000 -B0BF:000000280028002840284038402840287E2800003E8802883EF820883EF80000 -B0C0:000000280028002840284038402840287E2800001F0801081F0810141F620000 -B0C1:000000280028002840284038402840287E2800003EF802803EF820803EF80000 -B0C2:000000280028002840284038402840287E2800003EFC02483E4820483EFC0000 -B0C3:000000280028002840284038402840287E2800003E1002FE3E3820443E380000 -B0C4:000000280028002840284038402840287E28000003F802080208020803F80000 -B0C5:000000280028002840284038402840287E2800000208020803F8020803F80000 -B0C6:000000280028002840284038402840287E280000110811081F0811141F620000 -B0C7:000000280028002840284038402840287E280000000800080008003400C20000 -B0C8:000000280028002840284038402840287E2800000048004800A8011406620000 -B0C9:000000280028002840284038402840287E280000000001F00208020801F00000 -B0CA:000000280028002840284038402840287E28000003F80020002000D003080000 -B0CB:000000280028002840284038402840287E280000004003F8004000A003180000 -B0CC:000000280028002840284038402840287E28000003F8000803F8000800080000 -B0CD:000000280028002840284038402840287E28000003F8020003F8020003F80000 -B0CE:000000280028002840284038402840287E28000000000FF8022002200FF80000 -B0CF:000000280028002840284038402840287E28000000800FF803E0041003E00000 -B0D0:000000000010001000104010401E40104010401E40107F900010001000100000 -B0D1:0000000800080008400E4008400E40087E08000007F800080008000800080000 -B0D2:0000000800080008400E4008400E40087E08000000003EF80208020802080000 -B0D3:0000000800080008400E4008400E40087E08000000001F080108011401620000 -B0D4:0000000800080008400E4008400E40087E08000008000800080008000FF80000 -B0D5:0000000800080008400E4008400E40087E080000000010F8101010301ECC0000 -B0D6:0000000800080008400E4008400E40087E0800000808087F081C08220F9C0000 -B0D7:0000000800080008400E4008400E40087E08000003F802000200020003F80000 -B0D8:0000000800080008400E4008400E40087E08000007F8000807F8040007F80000 -B0D9:0000000800080008400E4008400E40087E0800003EF802083E0820083E080000 -B0DA:0000000800080008400E4008400E40087E0800003EF802883E8820883EF80000 -B0DB:0000000800080008400E4008400E40087E0800003E8802883EF820883EF80000 -B0DC:0000000800080008400E4008400E40087E0800001F0801081F0810141F620000 -B0DD:0000000800080008400E4008400E40087E0800003EF802803EF820803EF80000 -B0DE:0000000800080008400E4008400E40087E0800003EFC02483E4820483EFC0000 -B0DF:0000000800080008400E4008400E40087E0800001F08017F1F1C10221F1C0000 -B0E0:0000000800080008400E4008400E40087E08000003F802080208020803F80000 -B0E1:0000000800080008400E4008400E40087E0800000208020803F8020803F80000 -B0E2:0000000800080008400E4008400E40087E080000110811081F0811141F620000 -B0E3:0000000800080008400E4008400E40087E080000001000100010006801840000 -B0E4:0000000800080008400E4008400E40087E0800000048004800A8011406620000 -B0E5:0000000800080008400E4008400E40087E080000000003F00408040803F00000 -B0E6:0000000800080008400E4008400E40087E08000003F80020002000D003080000 -B0E7:0000000800080008400E4008400E40087E080000004003F8004000A003180000 -B0E8:0000000800080008400E4008400E40087E08000003F8000803F8000800080000 -B0E9:0000000800080008400E4008400E40087E08000003F8020003F8020003F80000 -B0EA:0000000800080008400E4008400E40087E08000000000FF8022002200FF80000 -B0EB:0000000800080008400E4008400E40087E08000000800FF803E0041003E00000 -B0EC:000000000012001200124012401E40124012401E40127F920012001200120000 -B0ED:000000280028002840384028403840287E28000007F800080008000800080000 -B0EE:000000280028002840384028403840287E28000000003EF80208020802080000 -B0EF:000000280028002840384028403840287E28000000003E100210022802C40000 -B0F0:000000280028002840384028403840287E28002808000800080008000FF80000 -B0F1:000000280028002840384028403840287E280000000020F8201020303ECC0000 -B0F2:000000280028002840384028403840287E280000202021FC207020883E700000 -B0F3:000000280028002840384028403840287E28000003F802000200020003F80000 -B0F4:000000280028002840384028403840287E28000007F8000807F8040007F80000 -B0F5:000000280028002840384028403840287E2800003EF802083E0820083E080000 -B0F6:000000280028002840384028403840287E2800003EF802883E8820883EF80000 -B0F7:000000280028002840384028403840287E2800003E8802883EF820883EF80000 -B0F8:000000280028002840384028403840287E2800001F0801081F0810141F620000 -B0F9:000000280028002840384028403840287E2800003EF802803EF820803EF80000 -B0FA:000000280028002840384028403840287E2800003EFC02483E4820483EFC0000 -B0FB:000000280028002840384028403840287E2800003E1002FE3E3820443E380000 -B0FC:000000280028002840384028403840287E28000003F802080208020803F80000 -B0FD:000000280028002840384028403840287E2800000208020803F8020803F80000 -B0FE:000000280028002840384028403840287E280000110811081F0811141F620000 -B0FF:000000280028002840384028403840287E280000000800080008003400C20000 -B100:000000280028002840384028403840287E2800000048004800A8011406620000 -B101:000000280028002840384028403840287E280000000001F00208020801F00000 -B102:000000280028002840384028403840287E28000003F80020002000D003080000 -B103:000000280028002840384028403840287E280000004003F8004000A003180000 -B104:000000280028002840384028403840287E28000003F8000803F8000800080000 -B105:000000280028002840384028403840287E28000003F8020003F8020003F80000 -B106:000000280028002840384028403840287E28000000000FF8022002200FF80000 -B107:000000280028002840384028403840287E28000000800FF803E0041003E00000 -B108:0000000000020002000240024002401E4002400240027F820002000200020000 -B109:000000080008000840084038400840087E080000000007F80008000800080000 -B10A:000000080008000840084038400840087E08000000003EF80208020802080000 -B10B:000000080008000840084038400840087E08000000001F080108011401620000 -B10C:000000080008000840084038400840087E08000000001000100010001FF80000 -B10D:000000080008000840084038400840087E080000000020F8201020303ECC0000 -B10E:000000080008000840084038400840087E080000202021FC207020883E700000 -B10F:000000080008000840084038400840087E08000003F802000200020003F80000 -B110:000000080008000840084038400840087E08000007F8000807F8040007F80000 -B111:000000080008000840084038400840087E0800003EF802083E0820083E080000 -B112:000000080008000840084038400840087E0800003EF802883E8820883EF80000 -B113:000000080008000840084038400840087E0800003E8802883EF820883EF80000 -B114:000000080008000840084038400840087E0800000F8800880F8808140FA20000 -B115:000000080008000840084038400840087E0800003EF802803EF820803EF80000 -B116:000000080008000840084038400840087E0800003EFC02483E4820483EFC0000 -B117:000000080008000840084038400840087E0800003E1002FE3E3820443E380000 -B118:000000080008000840084038400840087E08000003F802080208020803F80000 -B119:000000080008000840084038400840087E0800000208020803F8020803F80000 -B11A:000000080008000840084038400840087E080000210821083F0821143F620000 -B11B:000000080008000840084038400840087E080000001000100010006801840000 -B11C:000000080008000840084038400840087E0800000048004800A8011406620000 -B11D:000000080008000840084038400840087E080000000003F00408040803F00000 -B11E:000000080008000840084038400840087E08000003F80020002000D003080000 -B11F:000000080008000840084038400840087E080000004003F8004000A003180000 -B120:000000080008000840084038400840087E08000003F8000803F8000800080000 -B121:000000080008000840084038400840087E08000003F8020003F8020003F80000 -B122:000000080008000840084038400840087E08000000000FF8022002200FF80000 -B123:000000080008000840084038400840087E08000000800FF803E0041003E00000 -B124:00000000000A000A000A400A400A403A400A400A400A7F8A000A000A000A0000 -B125:0000002800280028402840E8402840287E28000007F800080008000800080000 -B126:0000002800280028402840E8402840287E28000000003EF80208020802080000 -B127:0000002800280028402840E8402840287E28000000003E100210022802C40000 -B128:0000002800280028402840E8402840287E28000008000800080008000FF80000 -B129:0000002800280028402840E8402840287E280000000020F8201020303ECC0000 -B12A:0000002800280028402840E8402840287E280000202021FC207020883E700000 -B12B:0000002800280028402840E8402840287E28000003F802000200020003F80000 -B12C:0000002800280028402840E8402840287E28000007F8000807F8040007F80000 -B12D:0000002800280028402840E8402840287E2800003EF802083E0820083E080000 -B12E:0000002800280028402840E8402840287E2800003EF802883E8820883EF80000 -B12F:0000002800280028402840E8402840287E2800003E8802883EF820883EF80000 -B130:0000002800280028402840E8402840287E2800001F0801081F0810141F620000 -B131:0000002800280028402840E8402840287E2800003EF802803EF820803EF80000 -B132:0000002800280028402840E8402840287E2800003EFC02483E4820483EFC0000 -B133:0000002800280028402840E8402840287E2800003E1002FE3E3820443E380000 -B134:0000002800280028402840E8402840287E28000003F802080208020803F80000 -B135:0000002800280028402840E8402840287E2800000208020803F8020803F80000 -B136:0000002800280028402840E8402840287E280000110811081F0811141F620000 -B137:0000002800280028402840E8402840287E280000000800080008003400C20000 -B138:0000002800280028402840E8402840287E2800000048004800A8011406620000 -B139:0000002800280028402840E8402840287E280000000001F00208020801F00000 -B13A:0000002800280028402840E8402840287E28000003F80020002000D003080000 -B13B:0000002800280028402840E8402840287E280000004003F8004000A003180000 -B13C:0000002800280028402840E8402840287E28000003F8000803F8000800080000 -B13D:0000002800280028402840E8402840287E28000003F8020003F8020003F80000 -B13E:0000002800280028402840E8402840287E28000000000FF8022002200FF80000 -B13F:0000002800280028402840E8402840287E28000000800FF803E0041003E00000 -B140:000000000002000200024002401E40024002401E40027F820002000200020000 -B141:000000080008000840384008403840087E080000000007F80008000800080000 -B142:000000080008000840384008403840087E08000000003EF80208020802080000 -B143:000000080008000840384008403840087E08000000001F080108011401620000 -B144:000000080008000840384008403840087E08000800001000100010001FF80000 -B145:000000080008000840384008403840087E080000000020F8201020303ECC0000 -B146:000000080008000840384008403840087E080000202021FC207020883E700000 -B147:000000080008000840384008403840087E08000003F802000200020003F80000 -B148:000000080008000840384008403840087E08000007F8000807F8040007F80000 -B149:000000080008000840384008403840087E0800003EF802083E0820083E080000 -B14A:000000080008000840384008403840087E0800003EF802883E8820883EF80000 -B14B:000000080008000840384008403840087E0800003E8802883EF820883EF80000 -B14C:000000080008000840384008403840087E0800000F8800880F8808140FA20000 -B14D:000000080008000840384008403840087E0800003EF802803EF820803EF80000 -B14E:000000080008000840384008403840087E0800003EFC02483E4820483EFC0000 -B14F:000000080008000840384008403840087E0800003E1002FE3E3820443E380000 -B150:000000080008000840384008403840087E08000003F802080208020803F80000 -B151:000000080008000840384008403840087E0800000208020803F8020803F80000 -B152:000000080008000840384008403840087E080000210821083F0821143F620000 -B153:000000080008000840384008403840087E080000001000100010006801840000 -B154:000000080008000840384008403840087E0800000048004800A8011406620000 -B155:000000080008000840384008403840087E080000000003F00408040803F00000 -B156:000000080008000840384008403840087E08000003F80020002000D003080000 -B157:000000080008000840384008403840087E080000004003F8004000A003180000 -B158:000000080008000840384008403840087E08000003F8000803F8000800080000 -B159:000000080008000840384008403840087E08000003F8020003F8020003F80000 -B15A:000000080008000840384008403840087E08000000000FF8022002200FF80000 -B15B:000000080008000840384008403840087E08000000800FF803E0041003E00000 -B15C:00000000000A000A000A400A403A400A400A403A400A7F8A000A000A000A0000 -B15D:000000280028002840E8402840E840287E28000007F800080008000800080000 -B15E:000000280028002840E8402840E840287E28000000003EF80208020802080000 -B15F:000000280028002840E8402840E840287E28000000003E100210022802C40000 -B160:000000280028002840E8402840E840287E28002808000800080008000FF80000 -B161:000000280028002840E8402840E840287E280000000020F8201020303ECC0000 -B162:000000280028002840E8402840E840287E280000202021FC207020883E700000 -B163:000000280028002840E8402840E840287E28000003F802000200020003F80000 -B164:000000280028002840E8402840E840287E28000007F8000807F8040007F80000 -B165:000000280028002840E8402840E840287E2800003EF802083E0820083E080000 -B166:000000280028002840E8402840E840287E2800003EF802883E8820883EF80000 -B167:000000280028002840E8402840E840287E2800003E8802883EF820883EF80000 -B168:000000280028002840E8402840E840287E2800001F0801081F0810141F620000 -B169:000000280028002840E8402840E840287E2800003EF802803EF820803EF80000 -B16A:000000280028002840E8402840E840287E2800003EFC02483E4820483EFC0000 -B16B:000000280028002840E8402840E840287E2800003E1002FE3E3820443E380000 -B16C:000000280028002840E8402840E840287E28000003F802080208020803F80000 -B16D:000000280028002840E8402840E840287E2800000208020803F8020803F80000 -B16E:000000280028002840E8402840E840287E280000110811081F0811141F620000 -B16F:000000280028002840E8402840E840287E280000000800080008003400C20000 -B170:000000280028002840E8402840E840287E2800000048004800A8011406620000 -B171:000000280028002840E8402840E840287E280000000001F00208020801F00000 -B172:000000280028002840E8402840E840287E28000003F80020002000D003080000 -B173:000000280028002840E8402840E840287E280000004003F8004000A003180000 -B174:000000280028002840E8402840E840287E28000003F8000803F8000800080000 -B175:000000280028002840E8402840E840287E28000003F8020003F8020003F80000 -B176:000000280028002840E8402840E840287E28000000000FF8022002200FF80000 -B177:000000280028002840E8402840E840287E28000000800FF803E0041003E00000 -B178:00000000200020002000200020003FF8000000000100010001007FFC00000000 -B179:000000001000100010001FF0010001007FFC00001FF000100010001000100000 -B17A:000000001000100010001FF0010001007FFC000000003EF80208020802080000 -B17B:000000001000100010001FF0010001007FFC000000001E100210022802C40000 -B17C:000000001000100010001FF0010001007FFC000000001000100010001FF00000 -B17D:000000001000100010001FF0010001007FFC0000000020F8201020303ECC0000 -B17E:000000001000100010001FF0010001007FFC0000202021FC207020883E700000 -B17F:000000001000100010001FF0010001007FFC00001FF01000100010001FF00000 -B180:000000001000100010001FF0010001007FFC00001FF000101FF010001FF00000 -B181:000000001000100010001FF0010001007FFC00003EF802083E0820083E080000 -B182:000000001000100010001FF0010001007FFC00003EF802883E8820883EF80000 -B183:000000001000100010001FF0010001007FFC00003E8802883EF820883EF80000 -B184:000000001000100010001FF0010001007FFC00003E1002103E1020283EC40000 -B185:000000001000100010001FF0010001007FFC00003EF802803EF820803EF80000 -B186:000000001000100010001FF0010001007FFC00003EFC02483E4820483EFC0000 -B187:000000001000100010001FF0010001007FFC00003E2003FC3E7020883E700000 -B188:000000001000100010001FF0010001007FFC00001FF01010101010101FF00000 -B189:000000001000100010001FF0010001007FFC0000101010101FF010101FF00000 -B18A:000000001000100010001FF0010001007FFC0000222022203E2022503E880000 -B18B:000000001000100010001FF0010001007FFC000000000100010002800C400000 -B18C:000000001000100010001FF0010001007FFC00000000024002400DA033100000 -B18D:000000001000100010001FF0010001007FFC0000000007C00820082007C00000 -B18E:000000001000100010001FF0010001007FFC0000000007E00080014006200000 -B18F:000000001000100010001FF0010001007FFC0000008007E00080014006200000 -B190:000000001000100010001FF0010001007FFC00001FF000101FF0001000100000 -B191:000000001000100010001FF0010001007FFC00001FF010001FF010001FF00000 -B192:000000001000100010001FF0010001007FFC000000001FF0044004401FF00000 -B193:000000001000100010001FF0010001007FFC000001001FF007C0082007C00000 -B194:0000001000104010401040104010401E7F900010041004107FD0001000100000 -B195:0000000820082008200E20083F8804087FE8000007F800080008000800080000 -B196:0000000820082008200E20083F8804087FE8000000003EF80208020802080000 -B197:0000000820082008200E20083F8804087FE8000000001F080108011401620000 -B198:0000000820082008200E20083F8804087FE8000008000800080008000FF80000 -B199:0000000820082008200E20083F8804087FE80000000010F8101010301ECC0000 -B19A:0000000820082008200E20083F8804087FE800000808087F081C08220F9C0000 -B19B:0000000820082008200E20083F8804087FE8000003F802000200020003F80000 -B19C:0000000820082008200E20083F8804087FE8000007F8000807F8040007F80000 -B19D:0000000820082008200E20083F8804087FE800003EF802083E0820083E080000 -B19E:0000000820082008200E20083F8804087FE800003EF802883E8820883EF80000 -B19F:0000000820082008200E20083F8804087FE800003E8802883EF820883EF80000 -B1A0:0000000820082008200E20083F8804087FE800001F0801081F0810141F620000 -B1A1:0000000820082008200E20083F8804087FE800003EF802803EF820803EF80000 -B1A2:0000000820082008200E20083F8804087FE800003EFC02483E4820483EFC0000 -B1A3:0000000820082008200E20083F8804087FE800001F08017F1F1C10221F1C0000 -B1A4:0000000820082008200E20083F8804087FE8000003F802080208020803F80000 -B1A5:0000000820082008200E20083F8804087FE800000208020803F8020803F80000 -B1A6:0000000820082008200E20083F8804087FE80000110811081F0811141F620000 -B1A7:0000000820082008200E20083F8804087FE80000001000100010006801840000 -B1A8:0000000820082008200E20083F8804087FE800000048004800A8011406620000 -B1A9:0000000820082008200E20083F8804087FE80000000003F00408040803F00000 -B1AA:0000000820082008200E20083F8804087FE8000003F80020002000D003080000 -B1AB:0000000820082008200E20083F8804087FE80000004003F8004000A003180000 -B1AC:0000000820082008200E20083F8804087FE8000003F8000803F8000800080000 -B1AD:0000000820082008200E20083F8804087FE8000003F8020003F8020003F80000 -B1AE:0000000820082008200E20083F8804087FE8000000000FF8022002200FF80000 -B1AF:0000000820082008200E20083F8804087FE8000000800FF803E0041003E00000 -B1B0:0000001200124012401240124012401E7F920012041204127FD2001200120000 -B1B1:0000002820282028203820283FA804287FA8000007F800080008000800080000 -B1B2:0000002820282028203820283FA804287FA8000000003EF80208020802080000 -B1B3:0000002820282028203820283FA804287FA8000000001F080108011401620000 -B1B4:0000002820282028203820283FA804287FA8000008000800080008000FF80000 -B1B5:0000002820282028203820283FA804287FA80000000010F8101010301ECC0000 -B1B6:0000002820282028203820283FA804287FA800000808087F081C08220F9C0000 -B1B7:0000002820282028203820283FA804287FA8000003F802000200020003F80000 -B1B8:0000002820282028203820283FA804287FA8000007F8000807F8040007F80000 -B1B9:0000002820282028203820283FA804287FA800003EF802083E0820083E080000 -B1BA:0000002820282028203820283FA804287FA800003EF802883E8820883EF80000 -B1BB:0000002820282028203820283FA804287FA800003E8802883EF820883EF80000 -B1BC:0000002820282028203820283FA804287FA800001F0801081F0810141F620000 -B1BD:0000002820282028203820283FA804287FA800003EF802803EF820803EF80000 -B1BE:0000002820282028203820283FA804287FA800003EFC02483E4820483EFC0000 -B1BF:0000002820282028203820283FA804287FA800001F08017F1F1C10221F1C0000 -B1C0:0000002820282028203820283FA804287FA8000003F802080208020803F80000 -B1C1:0000002820282028203820283FA804287FA800000208020803F8020803F80000 -B1C2:0000002820282028203820283FA804287FA80000110811081F0811141F620000 -B1C3:0000002820282028203820283FA804287FA80000001000100010006801840000 -B1C4:0000002820282028203820283FA804287FA800000048004800A8011406620000 -B1C5:0000002820282028203820283FA804287FA80000000003F00408040803F00000 -B1C6:0000002820282028203820283FA804287FA8000003F80020002000D003080000 -B1C7:0000002820282028203820283FA804287FA80000004003F8004000A003180000 -B1C8:0000002820282028203820283FA804287FA8000003F8000803F8000800080000 -B1C9:0000002820282028203820283FA804287FA8000003F8020003F8020003F80000 -B1CA:0000002820282028203820283FA804287FA8000000000FF8022002200FF80000 -B1CB:0000002820282028203820283FA804287FA8000000800FF803E0041003E00000 -B1CC:000000080008400840084008400840087F880008040804087FE8000800080000 -B1CD:0000000820082008200820083F8804087FE8000007F800080008000800080000 -B1CE:0000000820082008200820083F8804087FE8000000003EF80208020802080000 -B1CF:0000000820082008200820083F8804087FE8000000001F080108011401620000 -B1D0:0000000820082008200820083F8804087FE8000008000800080008000FF80000 -B1D1:0000000820082008200820083F8804087FE80000000010F8101010301ECC0000 -B1D2:0000000820082008200820083F8804087FE800000808087F081C08220F9C0000 -B1D3:0000000820082008200820083F8804087FE8000003F802000200020003F80000 -B1D4:0000000820082008200820083F8804087FE8000007F8000807F8040007F80000 -B1D5:0000000820082008200820083F8804087FE800003EF802083E0820083E080000 -B1D6:0000000820082008200820083F8804087FE800003EF802883E8820883EF80000 -B1D7:0000000820082008200820083F8804087FE800003E8802883EF820883EF80000 -B1D8:0000000820082008200820083F8804087FE800001F0801081F0810141F620000 -B1D9:0000000820082008200820083F8804087FE800003EF802803EF820803EF80000 -B1DA:0000000820082008200820083F8804087FE800003EFC02483E4820483EFC0000 -B1DB:0000000820082008200820083F8804087FE800001F08017F1F1C10221F1C0000 -B1DC:0000000820082008200820083F8804087FE8000003F802080208020803F80000 -B1DD:0000000820082008200820083F8804087FE800000208020803F8020803F80000 -B1DE:0000000820082008200820083F8804087FE80000110811081F0811141F620000 -B1DF:0000000820082008200820083F8804087FE80000001000100010006801840000 -B1E0:0000000820082008200820083F8804087FE800000048004800A8011406620000 -B1E1:0000000820082008200820083F8804087FE80000000003F00408040803F00000 -B1E2:0000000820082008200820083F8804087FE8000003F80020002000D003080000 -B1E3:0000000820082008200820083F8804087FE80000004003F8004000A003180000 -B1E4:0000000820082008200820083F8804087FE8000003F8000803F8000800080000 -B1E5:0000000820082008200820083F8804087FE8000003F8020003F8020003F80000 -B1E6:0000000820082008200820083F8804087FE8000000000FF8022002200FF80000 -B1E7:0000000820082008200820083F8804087FE8000000800FF803E0041003E00000 -B1E8:00000000200020002000200020003FF8000004400440044004407FFC00000000 -B1E9:000000001000100010001FF0044004407FFC00001FF000100010001000100000 -B1EA:000000001000100010001FF0044004407FFC000000003EF80208020802080000 -B1EB:000000001000100010001FF0044004407FFC000000001E100210022802C40000 -B1EC:000000001000100010001FF0044004407FFC000000001000100010001FF00000 -B1ED:000000001000100010001FF0044004407FFC0000000020F8201020303ECC0000 -B1EE:000000001000100010001FF0044004407FFC0000202021FC207020883E700000 -B1EF:000000001000100010001FF0044004407FFC00001FF01000100010001FF00000 -B1F0:000000001000100010001FF0044004407FFC00001FF000101FF010001FF00000 -B1F1:000000001000100010001FF0044004407FFC00003EF802083E0820083E080000 -B1F2:000000001000100010001FF0044004407FFC00003EF802883E8820883EF80000 -B1F3:000000001000100010001FF0044004407FFC00003E8802883EF820883EF80000 -B1F4:000000001000100010001FF0044004407FFC00003E1002103E1020283EC40000 -B1F5:000000001000100010001FF0044004407FFC00003EF802803EF820803EF80000 -B1F6:000000001000100010001FF0044004407FFC00003EFC02483E4820483EFC0000 -B1F7:000000001000100010001FF0044004407FFC00003E2003FC3E7020883E700000 -B1F8:000000001000100010001FF0044004407FFC00001FF01010101010101FF00000 -B1F9:000000001000100010001FF0044004407FFC0000101010101FF010101FF00000 -B1FA:000000001000100010001FF0044004407FFC0000222022203E2022503E880000 -B1FB:000000001000100010001FF0044004407FFC000000000100010002800C400000 -B1FC:000000001000100010001FF0044004407FFC00000000024002400DA033100000 -B1FD:000000001000100010001FF0044004407FFC0000000007C00820082007C00000 -B1FE:000000001000100010001FF0044004407FFC0000000007E00080014006200000 -B1FF:000000001000100010001FF0044004407FFC0000008007E00080014006200000 -B200:000000001000100010001FF0044004407FFC00001FF000101FF0001000100000 -B201:000000001000100010001FF0044004407FFC00001FF010001FF010001FF00000 -B202:000000001000100010001FF0044004407FFC000000001FF0044004401FF00000 -B203:000000001000100010001FF0044004407FFC000001001FF007C0082007C00000 -B204:00000000200020002000200020003FF8000000003FF801000100010001000000 -B205:000000001000100010001FF000007FFC010001001FF000100010001000100000 -B206:000000001000100010001FF000007FFC0100010000003EF80208020802080000 -B207:000000001000100010001FF000007FFC0100010000001E100210022802C40000 -B208:000000001000100010001FF0000000007FFC010001001100100010001FF00000 -B209:000000001000100010001FF000007FFC01000100000020F8201020303ECC0000 -B20A:000000001000100010001FF000007FFC01000100202021FC207020883E700000 -B20B:000000001000100010001FF000007FFC010001001FF01000100010001FF00000 -B20C:000000001000100010001FF000007FFC010001001FF000101FF010001FF00000 -B20D:000000001000100010001FF000007FFC010001003EF802083E0820083E080000 -B20E:000000001000100010001FF000007FFC010001003EF802883E8820883EF80000 -B20F:000000001000100010001FF000007FFC010001003E8802883EF820883EF80000 -B210:000000001000100010001FF000007FFC010001003E1002103E1020283EC40000 -B211:000000001000100010001FF000007FFC010001003EF802803EF820803EF80000 -B212:000000001000100010001FF000007FFC010001003EFC02483E4820483EFC0000 -B213:000000001000100010001FF000007FFC010001003E2003FC3E7020883E700000 -B214:000000001000100010001FF000007FFC010001001FF01010101010101FF00000 -B215:000000001000100010001FF000007FFC01000100101010101FF010101FF00000 -B216:000000001000100010001FF000007FFC01000100222022203E2022503E880000 -B217:000000001000100010001FF000007FFC0100010000000100010002800C400000 -B218:000000001000100010001FF000007FFC010001000000024002400DA033100000 -B219:000000001000100010001FF000007FFC01000100000007C00820082007C00000 -B21A:000000001000100010001FF000007FFC01000100000007E00080014006200000 -B21B:000000001000100010001FF000007FFC01000100008007E00080014006200000 -B21C:000000001000100010001FF000007FFC010001001FF000101FF0001000100000 -B21D:000000001000100010001FF000007FFC010001001FF010001FF010001FF00000 -B21E:000000001000100010001FF000007FFC0100010000001FF0044004401FF00000 -B21F:000000001000100010001FF000007FFC0100010001001FF007C0082007C00000 -B220:00000008000840084008400840087F88000800087FE8040804F8040804080000 -B221:00082008200820083F8800087FE8027802080000000007F80008000800080000 -B222:00082008200820083F8800087FE802780208000000003EF80208020802080000 -B223:00082008200820083F8800087FE802780208000000001F080108011401620000 -B224:00082008200820083F88000800087FE80278020802081000100010001FF80000 -B225:00082008200820083F8800087FE8027802080000000020F8201020303ECC0000 -B226:00082008200820083F8800087FE8027802080000202021FC207020883E700000 -B227:00082008200820083F8800087FE802780208000003F802000200020003F80000 -B228:00082008200820083F8800087FE802780208000007F8000807F8040007F80000 -B229:00082008200820083F8800087FE80278020800003EF802083E0820083E080000 -B22A:00082008200820083F8800087FE80278020800003EF802883E8820883EF80000 -B22B:00082008200820083F8800087FE80278020800003E8802883EF820883EF80000 -B22C:00082008200820083F8800087FE80278020800000F8800880F8808140FA20000 -B22D:00082008200820083F8800087FE80278020800003EF802803EF820803EF80000 -B22E:00082008200820083F8800087FE80278020800003EFC02483E4820483EFC0000 -B22F:00082008200820083F8800087FE80278020800003E1002FE3E3820443E380000 -B230:00082008200820083F8800087FE802780208000003F802080208020803F80000 -B231:00082008200820083F8800087FE80278020800000208020803F8020803F80000 -B232:00082008200820083F8800087FE8027802080000210821083F0821143F620000 -B233:00082008200820083F8800087FE8027802080000001000100010006801840000 -B234:00082008200820083F8800087FE80278020800000048004800A8011406620000 -B235:00082008200820083F8800087FE8027802080000000003F00408040803F00000 -B236:00082008200820083F8800087FE802780208000003F80020002000D003080000 -B237:00082008200820083F8800087FE8027802080000004003F8004000A003180000 -B238:00082008200820083F8800087FE802780208000003F8000803F8000800080000 -B239:00082008200820083F8800087FE802780208000003F8020003F8020003F80000 -B23A:00082008200820083F8800087FE802780208000000000FF8022002200FF80000 -B23B:00082008200820083F8800087FE802780208000000800FF803E0041003E00000 -B23C:0000000A000A400A400A400A400A7F8A000A000A7FEA040A047A040A040A0000 -B23D:00282028202820283FA800287FA805E804280000000007F80008000800080000 -B23E:00282028202820283FA800287FA805E80428000000003EF80208020802080000 -B23F:00282028202820283FA800287FA805E80428000000001F080108011401620000 -B240:00282028202820283FA8002800287FA8042805E804281428100010001FF80000 -B241:00282028202820283FA800287FA805E804280000000020F8201020303ECC0000 -B242:00282028202820283FA800287FA805E804280000202021FC207020883E700000 -B243:00282028202820283FA800287FA805E80428000003F802000200020003F80000 -B244:00282028202820283FA800287FA805E80428000007F8000807F8040007F80000 -B245:00282028202820283FA800287FA805E8042800003EF802083E0820083E080000 -B246:00282028202820283FA800287FA805E8042800003EF802883E8820883EF80000 -B247:00282028202820283FA800287FA805E8042800003E8802883EF820883EF80000 -B248:00282028202820283FA800287FA805E8042800000F8800880F8808140FA20000 -B249:00282028202820283FA800287FA805E8042800003EF802803EF820803EF80000 -B24A:00282028202820283FA800287FA805E8042800003EFC02483E4820483EFC0000 -B24B:00282028202820283FA800287FA805E8042800003E1002FE3E3820443E380000 -B24C:00282028202820283FA800287FA805E80428000003F802080208020803F80000 -B24D:00282028202820283FA800287FA805E8042800000208020803F8020803F80000 -B24E:00282028202820283FA800287FA805E804280000210821083F0821143F620000 -B24F:00282028202820283FA800287FA805E804280000001000100010006801840000 -B250:00282028202820283FA800287FA805E8042800000048004800A8011406620000 -B251:00282028202820283FA800287FA805E804280000000003F00408040803F00000 -B252:00282028202820283FA800287FA805E80428000003F80020002000D003080000 -B253:00282028202820283FA800287FA805E804280000004003F8004000A003180000 -B254:00282028202820283FA800287FA805E80428000003F8000803F8000800080000 -B255:00282028202820283FA800287FA805E80428000003F8020003F8020003F80000 -B256:00282028202820283FA800287FA805E80428000000000FF8022002200FF80000 -B257:00282028202820283FA800287FA805E80428000000800FF803E0041003E00000 -B258:00000008000840084008400840087F88000800087FE804080408040804080000 -B259:00082008200820083F8800087FE8020802000000000007F80008000800080000 -B25A:00082008200820083F8800087FE802080200000000003EF80208020802080000 -B25B:00082008200820083F8800087FE802080200000000001F080108011401620000 -B25C:00082008200820083F88000800087FE80208020802081008100010001FF80000 -B25D:00082008200820083F8800087FE8020802000000000020F8201020303ECC0000 -B25E:00082008200820083F8800087FE8020802000000202021FC207020883E700000 -B25F:00082008200820083F8800087FE802080200000003F802000200020003F80000 -B260:00082008200820083F8800087FE802080200000007F8000807F8040007F80000 -B261:00082008200820083F8800087FE80208020000003EF802083E0820083E080000 -B262:00082008200820083F8800087FE80208020000003EF802883E8820883EF80000 -B263:00082008200820083F8800087FE80208020000003E8802883EF820883EF80000 -B264:00082008200820083F8800087FE80208020000000F8800880F8808140FA20000 -B265:00082008200820083F8800087FE80208020000003EF802803EF820803EF80000 -B266:00082008200820083F8800087FE80208020000003EFC02483E4820483EFC0000 -B267:00082008200820083F8800087FE80208020000003E1002FE3E3820443E380000 -B268:00082008200820083F8800087FE802080200000003F802080208020803F80000 -B269:00082008200820083F8800087FE80208020000000208020803F8020803F80000 -B26A:00082008200820083F8800087FE8020802000000210821083F0821143F620000 -B26B:00082008200820083F8800087FE8020802000000001000100010006801840000 -B26C:00082008200820083F8800087FE80208020000000048004800A8011406620000 -B26D:00082008200820083F8800087FE8020802000000000003F00408040803F00000 -B26E:00082008200820083F8800087FE802080200000003F80020002000D003080000 -B26F:00082008200820083F8800087FE8020802000000004003F8004000A003180000 -B270:00082008200820083F8800087FE802080200000003F8000803F8000800080000 -B271:00082008200820083F8800087FE802080200000003F8020003F8020003F80000 -B272:00082008200820083F8800087FE802080200000000000FF8022002200FF80000 -B273:00082008200820083F8800087FE802080200000000800FF803E0041003E00000 -B274:00000000200020002000200020003FF8000000007FFC04400440044004400000 -B275:000000001000100010001FF000007FFC044004401FF000100010001000100000 -B276:000000001000100010001FF000007FFC0440044000003EF80208020802080000 -B277:000000001000100010001FF000007FFC0440044000001E100210022802C40000 -B278:000000001000100010001FF0000000007FFC044004401440100010001FF00000 -B279:000000001000100010001FF000007FFC04400440000020F8201020303ECC0000 -B27A:000000001000100010001FF000007FFC04400440202021FC207020883E700000 -B27B:000000001000100010001FF000007FFC044004401FF01000100010001FF00000 -B27C:000000001000100010001FF000007FFC044004401FF000101FF010001FF00000 -B27D:000000001000100010001FF000007FFC044004403EF802083E0820083E080000 -B27E:000000001000100010001FF000007FFC044004403EF802883E8820883EF80000 -B27F:000000001000100010001FF000007FFC044004403E8802883EF820883EF80000 -B280:000000001000100010001FF000007FFC044004403E1002103E1020283EC40000 -B281:000000001000100010001FF000007FFC044004403EF802803EF820803EF80000 -B282:000000001000100010001FF000007FFC044004403EFC02483E4820483EFC0000 -B283:000000001000100010001FF000007FFC044004403E2003FC3E7020883E700000 -B284:000000001000100010001FF000007FFC044004401FF01010101010101FF00000 -B285:000000001000100010001FF000007FFC04400440101010101FF010101FF00000 -B286:000000001000100010001FF000007FFC04400440222022203E2022503E880000 -B287:000000001000100010001FF000007FFC0440044000000100010002800C400000 -B288:000000001000100010001FF000007FFC044004400000024002400DA033100000 -B289:000000001000100010001FF000007FFC04400440000007C00820082007C00000 -B28A:000000001000100010001FF000007FFC04400440000007E00080014006200000 -B28B:000000001000100010001FF000007FFC04400440008007E00080014006200000 -B28C:000000001000100010001FF000007FFC044004401FF000101FF0001000100000 -B28D:000000001000100010001FF000007FFC044004401FF010001FF010001FF00000 -B28E:000000001000100010001FF000007FFC0440044000001FF0044004401FF00000 -B28F:000000001000100010001FF000007FFC0440044001001FF007C0082007C00000 -B290:00000000200020002000200020003FF80000000000007FFC0000000000000000 -B291:000000001000100010001FF0000000007FFC00001FF000100010001000100000 -B292:000000001000100010001FF0000000007FFC000000003EF80208020802080000 -B293:000000001000100010001FF0000000007FFC000000001E100210022802C40000 -B294:000000001000100010001FF0000000007FFC000000001000100010001FF00000 -B295:000000001000100010001FF0000000007FFC0000000020F8201020303ECC0000 -B296:000000001000100010001FF0000000007FFC0000202021FC207020883E700000 -B297:000000001000100010001FF0000000007FFC00001FF01000100010001FF00000 -B298:000000001000100010001FF0000000007FFC00001FF000101FF010001FF00000 -B299:000000001000100010001FF0000000007FFC00003EF802083E0820083E080000 -B29A:000000001000100010001FF0000000007FFC00003EF802883E8820883EF80000 -B29B:000000001000100010001FF0000000007FFC00003E8802883EF820883EF80000 -B29C:000000001000100010001FF0000000007FFC00003E1002103E1020283EC40000 -B29D:000000001000100010001FF0000000007FFC00003EF802803EF820803EF80000 -B29E:000000001000100010001FF0000000007FFC00003EFC02483E4820483EFC0000 -B29F:000000001000100010001FF0000000007FFC00003E2003FC3E7020883E700000 -B2A0:000000001000100010001FF0000000007FFC00001FF01010101010101FF00000 -B2A1:000000001000100010001FF0000000007FFC0000101010101FF010101FF00000 -B2A2:000000001000100010001FF0000000007FFC0000222022203E2022503E880000 -B2A3:000000001000100010001FF0000000007FFC000000000100010002800C400000 -B2A4:000000001000100010001FF0000000007FFC00000000024002400DA033100000 -B2A5:000000001000100010001FF0000000007FFC0000000007C00820082007C00000 -B2A6:000000001000100010001FF0000000007FFC0000000007E00080014006200000 -B2A7:000000001000100010001FF0000000007FFC0000008007E00080014006200000 -B2A8:000000001000100010001FF0000000007FFC00001FF000101FF0001000100000 -B2A9:000000001000100010001FF0000000007FFC00001FF010001FF010001FF00000 -B2AA:000000001000100010001FF0000000007FFC000000001FF0044004401FF00000 -B2AB:000000001000100010001FF0000000007FFC000001001FF007C0082007C00000 -B2AC:000000080008400840084008400840087F88000800087FE80008000800080000 -B2AD:0000000820082008200820083F8800087FE8000007F800080008000800080000 -B2AE:0000000820082008200820083F8800087FE8000000003EF80208020802080000 -B2AF:0000000820082008200820083F8800087FE8000000001F080108011401620000 -B2B0:0000000820082008200820083F8800087FE8000008000800080008000FF80000 -B2B1:0000000820082008200820083F8800087FE80000000010F8101010301ECC0000 -B2B2:0000000820082008200820083F8800087FE800000808087F081C08220F9C0000 -B2B3:0000000820082008200820083F8800087FE8000003F802000200020003F80000 -B2B4:0000000820082008200820083F8800087FE8000007F8000807F8040007F80000 -B2B5:0000000820082008200820083F8800087FE800003EF802083E0820083E080000 -B2B6:0000000820082008200820083F8800087FE800003EF802883E8820883EF80000 -B2B7:0000000820082008200820083F8800087FE800003E8802883EF820883EF80000 -B2B8:0000000820082008200820083F8800087FE800001F0801081F0810141F620000 -B2B9:0000000820082008200820083F8800087FE800003EF802803EF820803EF80000 -B2BA:0000000820082008200820083F8800087FE800003EFC02483E4820483EFC0000 -B2BB:0000000820082008200820083F8800087FE800001F08017F1F1C10221F1C0000 -B2BC:0000000820082008200820083F8800087FE8000003F802080208020803F80000 -B2BD:0000000820082008200820083F8800087FE800000208020803F8020803F80000 -B2BE:0000000820082008200820083F8800087FE80000110811081F0811141F620000 -B2BF:0000000820082008200820083F8800087FE80000001000100010006801840000 -B2C0:0000000820082008200820083F8800087FE800000048004800A8011406620000 -B2C1:0000000820082008200820083F8800087FE80000000003F00408040803F00000 -B2C2:0000000820082008200820083F8800087FE8000003F80020002000D003080000 -B2C3:0000000820082008200820083F8800087FE80000004003F8004000A003180000 -B2C4:0000000820082008200820083F8800087FE8000003F8000803F8000800080000 -B2C5:0000000820082008200820083F8800087FE8000003F8020003F8020003F80000 -B2C6:0000000820082008200820083F8800087FE8000000000FF8022002200FF80000 -B2C7:0000000820082008200820083F8800087FE8000000800FF803E0041003E00000 -B2C8:000000000008000800084008400840084008400840087F880008000800080000 -B2C9:000000080008000840084008400840087E080000000007F80008000800080000 -B2CA:000000080008000840084008400840087E08000000003EF80208020802080000 -B2CB:000000080008000840084008400840087E08000000001F080108011401620000 -B2CC:000000080008000840084008400840087E08000800001000100010001FF80000 -B2CD:000000080008000840084008400840087E080000000020F8201020303ECC0000 -B2CE:000000080008000840084008400840087E080000202021FC207020883E700000 -B2CF:000000080008000840084008400840087E08000003F802000200020003F80000 -B2D0:000000080008000840084008400840087E08000007F8000807F8040007F80000 -B2D1:000000080008000840084008400840087E0800003EF802083E0820083E080000 -B2D2:000000080008000840084008400840087E0800003EF802883E8820883EF80000 -B2D3:000000080008000840084008400840087E0800003E8802883EF820883EF80000 -B2D4:000000080008000840084008400840087E0800000F8800880F8808140FA20000 -B2D5:000000080008000840084008400840087E0800003EF802803EF820803EF80000 -B2D6:000000080008000840084008400840087E0800003EFC02483E4820483EFC0000 -B2D7:000000080008000840084008400840087E0800003E1002FE3E3820443E380000 -B2D8:000000080008000840084008400840087E08000003F802080208020803F80000 -B2D9:000000080008000840084008400840087E0800000208020803F8020803F80000 -B2DA:000000080008000840084008400840087E080000210821083F0821143F620000 -B2DB:000000080008000840084008400840087E080000001000100010006801840000 -B2DC:000000080008000840084008400840087E0800000048004800A8011406620000 -B2DD:000000080008000840084008400840087E080000000003F00408040803F00000 -B2DE:000000080008000840084008400840087E08000003F80020002000D003080000 -B2DF:000000080008000840084008400840087E080000004003F8004000A003180000 -B2E0:000000080008000840084008400840087E08000003F8000803F8000800080000 -B2E1:000000080008000840084008400840087E08000003F8020003F8020003F80000 -B2E2:000000080008000840084008400840087E08000000000FF8022002200FF80000 -B2E3:000000080008000840084008400840087E08000000800FF803E0041003E00000 -B2E4:00000000001000107F9040104010401E401040107F9000100010001000100000 -B2E5:0000000800087E084008400E40087E080008000007F800080008000800080000 -B2E6:0000000800087E084008400E40087E080008000000003EF80208020802080000 -B2E7:0000000800087E084008400E40087E080008000000001F080108011401620000 -B2E8:0000000800087E084008400E40087E080008000808000800080008000FF80000 -B2E9:0000000800087E084008400E40087E0800080000000010F8101010301ECC0000 -B2EA:0000000800087E084008400E40087E08000800000808087F081C08220F9C0000 -B2EB:0000000800087E084008400E40087E080008000003F802000200020003F80000 -B2EC:0000000800087E084008400E40087E080008000007F8000807F8040007F80000 -B2ED:0000000800087E084008400E40087E08000800003EF802083E0820083E080000 -B2EE:0000000800087E084008400E40087E08000800003EF802883E8820883EF80000 -B2EF:0000000800087E084008400E40087E08000800003E8802883EF820883EF80000 -B2F0:0000000800087E084008400E40087E08000800001F0801081F0810141F620000 -B2F1:0000000800087E084008400E40087E08000800003EF802803EF820803EF80000 -B2F2:0000000800087E084008400E40087E08000800003EFC02483E4820483EFC0000 -B2F3:0000000800087E084008400E40087E08000800001F08017F1F1C10221F1C0000 -B2F4:0000000800087E084008400E40087E080008000003F802080208020803F80000 -B2F5:0000000800087E084008400E40087E08000800000208020803F8020803F80000 -B2F6:0000000800087E084008400E40087E0800080000110811081F0811141F620000 -B2F7:0000000800087E084008400E40087E0800080000001000100010006801840000 -B2F8:0000000800087E084008400E40087E08000800000048004800A8011406620000 -B2F9:0000000800087E084008400E40087E0800080000000003F00408040803F00000 -B2FA:0000000800087E084008400E40087E080008000003F80020002000D003080000 -B2FB:0000000800087E084008400E40087E0800080000004003F8004000A003180000 -B2FC:0000000800087E084008400E40087E080008000003F8000803F8000800080000 -B2FD:0000000800087E084008400E40087E080008000003F8020003F8020003F80000 -B2FE:0000000800087E084008400E40087E080008000000000FF8022002200FF80000 -B2FF:0000000800087E084008400E40087E080008000000800FF803E0041003E00000 -B300:00000000001200127F9240124012401E401240127F9200120012001200120000 -B301:0000002800287E284028403840287E280028000007F800080008000800080000 -B302:0000002800287E284028403840287E280028000000003EF80208020802080000 -B303:0000002800287E284028403840287E280028000000003E100210022802C40000 -B304:0000002800287E284028403840287E280028002808000800080008000FF80000 -B305:0000002800287E284028403840287E2800280000000020F8201020303ECC0000 -B306:0000002800287E284028403840287E2800280000202021FC207020883E700000 -B307:0000002800287E284028403840287E280028000003F802000200020003F80000 -B308:0000002800287E284028403840287E280028000007F8000807F8040007F80000 -B309:0000002800287E284028403840287E28002800003EF802083E0820083E080000 -B30A:0000002800287E284028403840287E28002800003EF802883E8820883EF80000 -B30B:0000002800287E284028403840287E28002800003E8802883EF820883EF80000 -B30C:0000002800287E284028403840287E28002800001F0801081F0810141F620000 -B30D:0000002800287E284028403840287E28002800003EF802803EF820803EF80000 -B30E:0000002800287E284028403840287E28002800003EFC02483E4820483EFC0000 -B30F:0000002800287E284028403840287E28002800003E1002FE3E3820443E380000 -B310:0000002800287E284028403840287E280028000003F802080208020803F80000 -B311:0000002800287E284028403840287E28002800000208020803F8020803F80000 -B312:0000002800287E284028403840287E2800280000110811081F0811141F620000 -B313:0000002800287E284028403840287E2800280000000800080008003400C20000 -B314:0000002800287E284028403840287E28002800000048004800A8011406620000 -B315:0000002800287E284028403840287E2800280000000001F00208020801F00000 -B316:0000002800287E284028403840287E280028000003F80020002000D003080000 -B317:0000002800287E284028403840287E2800280000004003F8004000A003180000 -B318:0000002800287E284028403840287E280028000003F8000803F8000800080000 -B319:0000002800287E284028403840287E280028000003F8020003F8020003F80000 -B31A:0000002800287E284028403840287E280028000000000FF8022002200FF80000 -B31B:0000002800287E284028403840287E280028000000800FF803E0041003E00000 -B31C:00000000001000107F904010401E40104010401E7F9000100010001000100000 -B31D:0000000800087E08400E4008400E7E080008000007F800080008000800080000 -B31E:0000000800087E08400E4008400E7E080008000000003EF80208020802080000 -B31F:0000000800087E08400E4008400E7E080008000000001F080108011401620000 -B320:0000000800087E08400E4008400E7E080008000008000800080008000FF80000 -B321:0000000800087E08400E4008400E7E0800080000000010F8101010301ECC0000 -B322:0000000800087E08400E4008400E7E08000800000808087F081C08220F9C0000 -B323:0000000800087E08400E4008400E7E080008000003F802000200020003F80000 -B324:0000000800087E08400E4008400E7E080008000007F8000807F8040007F80000 -B325:0000000800087E08400E4008400E7E08000800003EF802083E0820083E080000 -B326:0000000800087E08400E4008400E7E08000800003EF802883E8820883EF80000 -B327:0000000800087E08400E4008400E7E08000800003E8802883EF820883EF80000 -B328:0000000800087E08400E4008400E7E08000800001F0801081F0810141F620000 -B329:0000000800087E08400E4008400E7E08000800003EF802803EF820803EF80000 -B32A:0000000800087E08400E4008400E7E08000800003EFC02483E4820483EFC0000 -B32B:0000000800087E08400E4008400E7E08000800001F08017F1F1C10221F1C0000 -B32C:0000000800087E08400E4008400E7E080008000003F802080208020803F80000 -B32D:0000000800087E08400E4008400E7E08000800000208020803F8020803F80000 -B32E:0000000800087E08400E4008400E7E0800080000110811081F0811141F620000 -B32F:0000000800087E08400E4008400E7E0800080000001000100010006801840000 -B330:0000000800087E08400E4008400E7E08000800000048004800A8011406620000 -B331:0000000800087E08400E4008400E7E0800080000000003F00408040803F00000 -B332:0000000800087E08400E4008400E7E080008000003F80020002000D003080000 -B333:0000000800087E08400E4008400E7E0800080000004003F8004000A003180000 -B334:0000000800087E08400E4008400E7E080008000003F8000803F8000800080000 -B335:0000000800087E08400E4008400E7E080008000003F8020003F8020003F80000 -B336:0000000800087E08400E4008400E7E080008000000000FF8022002200FF80000 -B337:0000000800087E08400E4008400E7E080008000000800FF803E0041003E00000 -B338:00000000001200127F924012401E40124012401E7F9200120012001200120000 -B339:0000002800287E284038402840387E280028000007F800080008000800080000 -B33A:0000002800287E284038402840387E280028000000003EF80208020802080000 -B33B:0000002800287E284038402840387E280028000000003E100210022802C40000 -B33C:0000002800287E284038402840387E280028002808000800080008000FF80000 -B33D:0000002800287E284038402840387E2800280000000020F8201020303ECC0000 -B33E:0000002800287E284038402840387E2800280000202021FC207020883E700000 -B33F:0000002800287E284038402840387E280028000003F802000200020003F80000 -B340:0000002800287E284038402840387E280028000007F8000807F8040007F80000 -B341:0000002800287E284038402840387E28002800003EF802083E0820083E080000 -B342:0000002800287E284038402840387E28002800003EF802883E8820883EF80000 -B343:0000002800287E284038402840387E28002800003E8802883EF820883EF80000 -B344:0000002800287E284038402840387E28002800001F0801081F0810141F620000 -B345:0000002800287E284038402840387E28002800003EF802803EF820803EF80000 -B346:0000002800287E284038402840387E28002800003EFC02483E4820483EFC0000 -B347:0000002800287E284038402840387E28002800003E1002FE3E3820443E380000 -B348:0000002800287E284038402840387E280028000003F802080208020803F80000 -B349:0000002800287E284038402840387E28002800000208020803F8020803F80000 -B34A:0000002800287E284038402840387E2800280000110811081F0811141F620000 -B34B:0000002800287E284038402840387E2800280000000800080008003400C20000 -B34C:0000002800287E284038402840387E28002800000048004800A8011406620000 -B34D:0000002800287E284038402840387E2800280000000001F00208020801F00000 -B34E:0000002800287E284038402840387E280028000003F80020002000D003080000 -B34F:0000002800287E284038402840387E2800280000004003F8004000A003180000 -B350:0000002800287E284038402840387E280028000003F8000803F8000800080000 -B351:0000002800287E284038402840387E280028000003F8020003F8020003F80000 -B352:0000002800287E284038402840387E280028000000000FF8022002200FF80000 -B353:0000002800287E284038402840387E280028000000800FF803E0041003E00000 -B354:00000000000200027F8240024002401E400240027F8200020002000200020000 -B355:0000000800087E084008403840087E0800080000000007F80008000800080000 -B356:0000000800087E084008403840087E080008000000003EF80208020802080000 -B357:0000000800087E084008403840087E080008000000001F080108011401620000 -B358:0000000800087E084008403840087E080008000000001000100010001FF80000 -B359:0000000800087E084008403840087E0800080000000020F8201020303ECC0000 -B35A:0000000800087E084008403840087E0800080000202021FC207020883E700000 -B35B:0000000800087E084008403840087E080008000003F802000200020003F80000 -B35C:0000000800087E084008403840087E080008000007F8000807F8040007F80000 -B35D:0000000800087E084008403840087E08000800003EF802083E0820083E080000 -B35E:0000000800087E084008403840087E08000800003EF802883E8820883EF80000 -B35F:0000000800087E084008403840087E08000800003E8802883EF820883EF80000 -B360:0000000800087E084008403840087E08000800000F8800880F8808140FA20000 -B361:0000000800087E084008403840087E08000800003EF802803EF820803EF80000 -B362:0000000800087E084008403840087E08000800003EFC02483E4820483EFC0000 -B363:0000000800087E084008403840087E08000800003E1002FE3E3820443E380000 -B364:0000000800087E084008403840087E080008000003F802080208020803F80000 -B365:0000000800087E084008403840087E08000800000208020803F8020803F80000 -B366:0000000800087E084008403840087E0800080000210821083F0821143F620000 -B367:0000000800087E084008403840087E0800080000001000100010006801840000 -B368:0000000800087E084008403840087E08000800000048004800A8011406620000 -B369:0000000800087E084008403840087E0800080000000003F00408040803F00000 -B36A:0000000800087E084008403840087E080008000003F80020002000D003080000 -B36B:0000000800087E084008403840087E0800080000004003F8004000A003180000 -B36C:0000000800087E084008403840087E080008000003F8000803F8000800080000 -B36D:0000000800087E084008403840087E080008000003F8020003F8020003F80000 -B36E:0000000800087E084008403840087E080008000000000FF8022002200FF80000 -B36F:0000000800087E084008403840087E080008000000800FF803E0041003E00000 -B370:00000000000A000A7F8A400A400A403A400A400A7F8A000A000A000A000A0000 -B371:0000002800287E28402840E840287E280028000007F800080008000800080000 -B372:0000002800287E28402840E840287E280028000000003EF80208020802080000 -B373:0000002800287E28402840E840287E280028000000003E100210022802C40000 -B374:0000002800287E28402840E840287E280028000008000800080008000FF80000 -B375:0000002800287E28402840E840287E2800280000000020F8201020303ECC0000 -B376:0000002800287E28402840E840287E2800280000202021FC207020883E700000 -B377:0000002800287E28402840E840287E280028000003F802000200020003F80000 -B378:0000002800287E28402840E840287E280028000007F8000807F8040007F80000 -B379:0000002800287E28402840E840287E28002800003EF802083E0820083E080000 -B37A:0000002800287E28402840E840287E28002800003EF802883E8820883EF80000 -B37B:0000002800287E28402840E840287E28002800003E8802883EF820883EF80000 -B37C:0000002800287E28402840E840287E28002800001F0801081F0810141F620000 -B37D:0000002800287E28402840E840287E28002800003EF802803EF820803EF80000 -B37E:0000002800287E28402840E840287E28002800003EFC02483E4820483EFC0000 -B37F:0000002800287E28402840E840287E28002800003E1002FE3E3820443E380000 -B380:0000002800287E28402840E840287E280028000003F802080208020803F80000 -B381:0000002800287E28402840E840287E28002800000208020803F8020803F80000 -B382:0000002800287E28402840E840287E2800280000110811081F0811141F620000 -B383:0000002800287E28402840E840287E2800280000000800080008003400C20000 -B384:0000002800287E28402840E840287E28002800000048004800A8011406620000 -B385:0000002800287E28402840E840287E2800280000000001F00208020801F00000 -B386:0000002800287E28402840E840287E280028000003F80020002000D003080000 -B387:0000002800287E28402840E840287E2800280000004003F8004000A003180000 -B388:0000002800287E28402840E840287E280028000003F8000803F8000800080000 -B389:0000002800287E28402840E840287E280028000003F8020003F8020003F80000 -B38A:0000002800287E28402840E840287E280028000000000FF8022002200FF80000 -B38B:0000002800287E28402840E840287E280028000000800FF803E0041003E00000 -B38C:00000000000200027F824002401E40024002401E7F8200020002000200020000 -B38D:0000000800087E084038400840387E0800080000000007F80008000800080000 -B38E:0000000800087E084038400840387E080008000000003EF80208020802080000 -B38F:0000000800087E084038400840387E080008000000001F080108011401620000 -B390:0000000800087E084038400840387E080008000800001000100010001FF80000 -B391:0000000800087E084038400840387E0800080000000020F8201020303ECC0000 -B392:0000000800087E084038400840387E0800080000202021FC207020883E700000 -B393:0000000800087E084038400840387E080008000003F802000200020003F80000 -B394:0000000800087E084038400840387E080008000007F8000807F8040007F80000 -B395:0000000800087E084038400840387E08000800003EF802083E0820083E080000 -B396:0000000800087E084038400840387E08000800003EF802883E8820883EF80000 -B397:0000000800087E084038400840387E08000800003E8802883EF820883EF80000 -B398:0000000800087E084038400840387E08000800000F8800880F8808140FA20000 -B399:0000000800087E084038400840387E08000800003EF802803EF820803EF80000 -B39A:0000000800087E084038400840387E08000800003EFC02483E4820483EFC0000 -B39B:0000000800087E084038400840387E08000800003E1002FE3E3820443E380000 -B39C:0000000800087E084038400840387E080008000003F802080208020803F80000 -B39D:0000000800087E084038400840387E08000800000208020803F8020803F80000 -B39E:0000000800087E084038400840387E0800080000210821083F0821143F620000 -B39F:0000000800087E084038400840387E0800080000001000100010006801840000 -B3A0:0000000800087E084038400840387E08000800000048004800A8011406620000 -B3A1:0000000800087E084038400840387E0800080000000003F00408040803F00000 -B3A2:0000000800087E084038400840387E080008000003F80020002000D003080000 -B3A3:0000000800087E084038400840387E0800080000004003F8004000A003180000 -B3A4:0000000800087E084038400840387E080008000003F8000803F8000800080000 -B3A5:0000000800087E084038400840387E080008000003F8020003F8020003F80000 -B3A6:0000000800087E084038400840387E080008000000000FF8022002200FF80000 -B3A7:0000000800087E084038400840387E080008000000800FF803E0041003E00000 -B3A8:00000000000A000A7F8A400A403A400A400A403A7F8A000A000A000A000A0000 -B3A9:0000002800287E2840E8402840E87E280028000007F800080008000800080000 -B3AA:0000002800287E2840E8402840E87E280028000000003EF80208020802080000 -B3AB:0000002800287E2840E8402840E87E280028000000003E100210022802C40000 -B3AC:0000002800287E2840E8402840E87E280028002808000800080008000FF80000 -B3AD:0000002800287E2840E8402840E87E2800280000000020F8201020303ECC0000 -B3AE:0000002800287E2840E8402840E87E2800280000202021FC207020883E700000 -B3AF:0000002800287E2840E8402840E87E280028000003F802000200020003F80000 -B3B0:0000002800287E2840E8402840E87E280028000007F8000807F8040007F80000 -B3B1:0000002800287E2840E8402840E87E28002800003EF802083E0820083E080000 -B3B2:0000002800287E2840E8402840E87E28002800003EF802883E8820883EF80000 -B3B3:0000002800287E2840E8402840E87E28002800003E8802883EF820883EF80000 -B3B4:0000002800287E2840E8402840E87E28002800001F0801081F0810141F620000 -B3B5:0000002800287E2840E8402840E87E28002800003EF802803EF820803EF80000 -B3B6:0000002800287E2840E8402840E87E28002800003EFC02483E4820483EFC0000 -B3B7:0000002800287E2840E8402840E87E28002800003E1002FE3E3820443E380000 -B3B8:0000002800287E2840E8402840E87E280028000003F802080208020803F80000 -B3B9:0000002800287E2840E8402840E87E28002800000208020803F8020803F80000 -B3BA:0000002800287E2840E8402840E87E2800280000110811081F0811141F620000 -B3BB:0000002800287E2840E8402840E87E2800280000000800080008003400C20000 -B3BC:0000002800287E2840E8402840E87E28002800000048004800A8011406620000 -B3BD:0000002800287E2840E8402840E87E2800280000000001F00208020801F00000 -B3BE:0000002800287E2840E8402840E87E280028000003F80020002000D003080000 -B3BF:0000002800287E2840E8402840E87E2800280000004003F8004000A003180000 -B3C0:0000002800287E2840E8402840E87E280028000003F8000803F8000800080000 -B3C1:0000002800287E2840E8402840E87E280028000003F8020003F8020003F80000 -B3C2:0000002800287E2840E8402840E87E280028000000000FF8022002200FF80000 -B3C3:0000002800287E2840E8402840E87E280028000000800FF803E0041003E00000 -B3C4:000000003FF820002000200020003FF8000000000100010001007FFC00000000 -B3C5:000000001FF0100010001FF0010001007FFC00001FF000100010001000100000 -B3C6:000000001FF0100010001FF0010001007FFC000000003EF80208020802080000 -B3C7:000000001FF0100010001FF0010001007FFC000000001E100210022802C40000 -B3C8:000000001FF0100010001FF0010001007FFC000000001000100010001FF00000 -B3C9:000000001FF0100010001FF0010001007FFC0000000020F8201020303ECC0000 -B3CA:000000001FF0100010001FF0010001007FFC0000202021FC207020883E700000 -B3CB:000000001FF0100010001FF0010001007FFC00001FF01000100010001FF00000 -B3CC:000000001FF0100010001FF0010001007FFC00001FF000101FF010001FF00000 -B3CD:000000001FF0100010001FF0010001007FFC00003EF802083E0820083E080000 -B3CE:000000001FF0100010001FF0010001007FFC00003EF802883E8820883EF80000 -B3CF:000000001FF0100010001FF0010001007FFC00003E8802883EF820883EF80000 -B3D0:000000001FF0100010001FF0010001007FFC00003E1002103E1020283EC40000 -B3D1:000000001FF0100010001FF0010001007FFC00003EF802803EF820803EF80000 -B3D2:000000001FF0100010001FF0010001007FFC00003EFC02483E4820483EFC0000 -B3D3:000000001FF0100010001FF0010001007FFC00003E2003FC3E7020883E700000 -B3D4:000000001FF0100010001FF0010001007FFC00001FF01010101010101FF00000 -B3D5:000000001FF0100010001FF0010001007FFC0000101010101FF010101FF00000 -B3D6:000000001FF0100010001FF0010001007FFC0000222022203E2022503E880000 -B3D7:000000001FF0100010001FF0010001007FFC000000000100010002800C400000 -B3D8:000000001FF0100010001FF0010001007FFC00000000024002400DA033100000 -B3D9:000000001FF0100010001FF0010001007FFC0000000007C00820082007C00000 -B3DA:000000001FF0100010001FF0010001007FFC0000000007E00080014006200000 -B3DB:000000001FF0100010001FF0010001007FFC0000008007E00080014006200000 -B3DC:000000001FF0100010001FF0010001007FFC00001FF000101FF0001000100000 -B3DD:000000001FF0100010001FF0010001007FFC00001FF010001FF010001FF00000 -B3DE:000000001FF0100010001FF0010001007FFC000000001FF0044004401FF00000 -B3DF:000000001FF0100010001FF0010001007FFC000001001FF007C0082007C00000 -B3E0:0000001000107F904010401040107F9E00100010041004107FD0001000100000 -B3E1:000000083F882008200E3F88040804087FE8000007F800080008000800080000 -B3E2:000000083F882008200E3F88040804087FE8000000003EF80208020802080000 -B3E3:000000083F882008200E3F88040804087FE8000000001F080108011401620000 -B3E4:000000083F882008200E3F88040804087FE8000008000800080008000FF80000 -B3E5:000000083F882008200E3F88040804087FE80000000010F8101010301ECC0000 -B3E6:000000083F882008200E3F88040804087FE800000808087F081C08220F9C0000 -B3E7:000000083F882008200E3F88040804087FE8000003F802000200020003F80000 -B3E8:000000083F882008200E3F88040804087FE8000007F8000807F8040007F80000 -B3E9:000000083F882008200E3F88040804087FE800003EF802083E0820083E080000 -B3EA:000000083F882008200E3F88040804087FE800003EF802883E8820883EF80000 -B3EB:000000083F882008200E3F88040804087FE800003E8802883EF820883EF80000 -B3EC:000000083F882008200E3F88040804087FE800001F0801081F0810141F620000 -B3ED:000000083F882008200E3F88040804087FE800003EF802803EF820803EF80000 -B3EE:000000083F882008200E3F88040804087FE800003EFC02483E4820483EFC0000 -B3EF:000000083F882008200E3F88040804087FE800001F08017F1F1C10221F1C0000 -B3F0:000000083F882008200E3F88040804087FE8000003F802080208020803F80000 -B3F1:000000083F882008200E3F88040804087FE800000208020803F8020803F80000 -B3F2:000000083F882008200E3F88040804087FE80000110811081F0811141F620000 -B3F3:000000083F882008200E3F88040804087FE80000001000100010006801840000 -B3F4:000000083F882008200E3F88040804087FE800000048004800A8011406620000 -B3F5:000000083F882008200E3F88040804087FE80000000003F00408040803F00000 -B3F6:000000083F882008200E3F88040804087FE8000003F80020002000D003080000 -B3F7:000000083F882008200E3F88040804087FE80000004003F8004000A003180000 -B3F8:000000083F882008200E3F88040804087FE8000003F8000803F8000800080000 -B3F9:000000083F882008200E3F88040804087FE8000003F8020003F8020003F80000 -B3FA:000000083F882008200E3F88040804087FE8000000000FF8022002200FF80000 -B3FB:000000083F882008200E3F88040804087FE8000000800FF803E0041003E00000 -B3FC:0000001200127F924012401240127F9E00120012041204127FD2001200120000 -B3FD:000000283FA8202820383FA8042804287FA8000007F800080008000800080000 -B3FE:000000283FA8202820383FA8042804287FA8000000003EF80208020802080000 -B3FF:000000283FA8202820383FA8042804287FA8000000001F080108011401620000 -B400:000000283FA8202820383FA8042804287FA8000008000800080008000FF80000 -B401:000000283FA8202820383FA8042804287FA80000000010F8101010301ECC0000 -B402:000000283FA8202820383FA8042804287FA800000808087F081C08220F9C0000 -B403:000000283FA8202820383FA8042804287FA8000003F802000200020003F80000 -B404:000000283FA8202820383FA8042804287FA8000007F8000807F8040007F80000 -B405:000000283FA8202820383FA8042804287FA800003EF802083E0820083E080000 -B406:000000283FA8202820383FA8042804287FA800003EF802883E8820883EF80000 -B407:000000283FA8202820383FA8042804287FA800003E8802883EF820883EF80000 -B408:000000283FA8202820383FA8042804287FA800001F0801081F0810141F620000 -B409:000000283FA8202820383FA8042804287FA800003EF802803EF820803EF80000 -B40A:000000283FA8202820383FA8042804287FA800003EFC02483E4820483EFC0000 -B40B:000000283FA8202820383FA8042804287FA800001F08017F1F1C10221F1C0000 -B40C:000000283FA8202820383FA8042804287FA8000003F802080208020803F80000 -B40D:000000283FA8202820383FA8042804287FA800000208020803F8020803F80000 -B40E:000000283FA8202820383FA8042804287FA80000110811081F0811141F620000 -B40F:000000283FA8202820383FA8042804287FA80000001000100010006801840000 -B410:000000283FA8202820383FA8042804287FA800000048004800A8011406620000 -B411:000000283FA8202820383FA8042804287FA80000000003F00408040803F00000 -B412:000000283FA8202820383FA8042804287FA8000003F80020002000D003080000 -B413:000000283FA8202820383FA8042804287FA80000004003F8004000A003180000 -B414:000000283FA8202820383FA8042804287FA8000003F8000803F8000800080000 -B415:000000283FA8202820383FA8042804287FA8000003F8020003F8020003F80000 -B416:000000283FA8202820383FA8042804287FA8000000000FF8022002200FF80000 -B417:000000283FA8202820383FA8042804287FA8000000800FF803E0041003E00000 -B418:0000000800087F884008400840087F8800080008040804087FE8000800080000 -B419:000000083F88200820083F88040804087FE8000007F800080008000800080000 -B41A:000000083F88200820083F88040804087FE8000000003EF80208020802080000 -B41B:000000083F88200820083F88040804087FE8000000001F080108011401620000 -B41C:000000083F88200820083F88040804087FE8000008000800080008000FF80000 -B41D:000000083F88200820083F88040804087FE80000000010F8101010301ECC0000 -B41E:000000083F88200820083F88040804087FE800000808087F081C08220F9C0000 -B41F:000000083F88200820083F88040804087FE8000003F802000200020003F80000 -B420:000000083F88200820083F88040804087FE8000007F8000807F8040007F80000 -B421:000000083F88200820083F88040804087FE800003EF802083E0820083E080000 -B422:000000083F88200820083F88040804087FE800003EF802883E8820883EF80000 -B423:000000083F88200820083F88040804087FE800003E8802883EF820883EF80000 -B424:000000083F88200820083F88040804087FE800001F0801081F0810141F620000 -B425:000000083F88200820083F88040804087FE800003EF802803EF820803EF80000 -B426:000000083F88200820083F88040804087FE800003EFC02483E4820483EFC0000 -B427:000000083F88200820083F88040804087FE800001F08017F1F1C10221F1C0000 -B428:000000083F88200820083F88040804087FE8000003F802080208020803F80000 -B429:000000083F88200820083F88040804087FE800000208020803F8020803F80000 -B42A:000000083F88200820083F88040804087FE80000110811081F0811141F620000 -B42B:000000083F88200820083F88040804087FE80000001000100010006801840000 -B42C:000000083F88200820083F88040804087FE800000048004800A8011406620000 -B42D:000000083F88200820083F88040804087FE80000000003F00408040803F00000 -B42E:000000083F88200820083F88040804087FE8000003F80020002000D003080000 -B42F:000000083F88200820083F88040804087FE80000004003F8004000A003180000 -B430:000000083F88200820083F88040804087FE8000003F8000803F8000800080000 -B431:000000083F88200820083F88040804087FE8000003F8020003F8020003F80000 -B432:000000083F88200820083F88040804087FE8000000000FF8022002200FF80000 -B433:000000083F88200820083F88040804087FE8000000800FF803E0041003E00000 -B434:000000003FF820002000200020003FF8000004400440044004407FFC00000000 -B435:000000001FF0100010001FF0044004407FFC00001FF000100010001000100000 -B436:000000001FF0100010001FF0044004407FFC000000003EF80208020802080000 -B437:000000001FF0100010001FF0044004407FFC000000001E100210022802C40000 -B438:000000001FF0100010001FF0044004407FFC000000001000100010001FF00000 -B439:000000001FF0100010001FF0044004407FFC0000000020F8201020303ECC0000 -B43A:000000001FF0100010001FF0044004407FFC0000202021FC207020883E700000 -B43B:000000001FF0100010001FF0044004407FFC00001FF01000100010001FF00000 -B43C:000000001FF0100010001FF0044004407FFC00001FF000101FF010001FF00000 -B43D:000000001FF0100010001FF0044004407FFC00003EF802083E0820083E080000 -B43E:000000001FF0100010001FF0044004407FFC00003EF802883E8820883EF80000 -B43F:000000001FF0100010001FF0044004407FFC00003E8802883EF820883EF80000 -B440:000000001FF0100010001FF0044004407FFC00003E1002103E1020283EC40000 -B441:000000001FF0100010001FF0044004407FFC00003EF802803EF820803EF80000 -B442:000000001FF0100010001FF0044004407FFC00003EFC02483E4820483EFC0000 -B443:000000001FF0100010001FF0044004407FFC00003E2003FC3E7020883E700000 -B444:000000001FF0100010001FF0044004407FFC00001FF01010101010101FF00000 -B445:000000001FF0100010001FF0044004407FFC0000101010101FF010101FF00000 -B446:000000001FF0100010001FF0044004407FFC0000222022203E2022503E880000 -B447:000000001FF0100010001FF0044004407FFC000000000100010002800C400000 -B448:000000001FF0100010001FF0044004407FFC00000000024002400DA033100000 -B449:000000001FF0100010001FF0044004407FFC0000000007C00820082007C00000 -B44A:000000001FF0100010001FF0044004407FFC0000000007E00080014006200000 -B44B:000000001FF0100010001FF0044004407FFC0000008007E00080014006200000 -B44C:000000001FF0100010001FF0044004407FFC00001FF000101FF0001000100000 -B44D:000000001FF0100010001FF0044004407FFC00001FF010001FF010001FF00000 -B44E:000000001FF0100010001FF0044004407FFC000000001FF0044004401FF00000 -B44F:000000001FF0100010001FF0044004407FFC000001001FF007C0082007C00000 -B450:000000003FF820002000200020003FF8000000003FF801000100010001000000 -B451:000000001FF0100010001FF000007FFC010001001FF000100010001000100000 -B452:000000001FF0100010001FF000007FFC0100010000003EF80208020802080000 -B453:000000001FF0100010001FF000007FFC0100010000001E100210022802C40000 -B454:000000001FF0100010001FF0000000007FFC010001001100100010001FF00000 -B455:000000001FF0100010001FF000007FFC01000100000020F8201020303ECC0000 -B456:000000001FF0100010001FF000007FFC01000100202021FC207020883E700000 -B457:000000001FF0100010001FF000007FFC010001001FF01000100010001FF00000 -B458:000000001FF0100010001FF000007FFC010001001FF000101FF010001FF00000 -B459:000000001FF0100010001FF000007FFC010001003EF802083E0820083E080000 -B45A:000000001FF0100010001FF000007FFC010001003EF802883E8820883EF80000 -B45B:000000001FF0100010001FF000007FFC010001003E8802883EF820883EF80000 -B45C:000000001FF0100010001FF000007FFC010001003E1002103E1020283EC40000 -B45D:000000001FF0100010001FF000007FFC010001003EF802803EF820803EF80000 -B45E:000000001FF0100010001FF000007FFC010001003EFC02483E4820483EFC0000 -B45F:000000001FF0100010001FF000007FFC010001003E2003FC3E7020883E700000 -B460:000000001FF0100010001FF000007FFC010001001FF01010101010101FF00000 -B461:000000001FF0100010001FF000007FFC01000100101010101FF010101FF00000 -B462:000000001FF0100010001FF000007FFC01000100222022203E2022503E880000 -B463:000000001FF0100010001FF000007FFC0100010000000100010002800C400000 -B464:000000001FF0100010001FF000007FFC010001000000024002400DA033100000 -B465:000000001FF0100010001FF000007FFC01000100000007C00820082007C00000 -B466:000000001FF0100010001FF000007FFC01000100000007E00080014006200000 -B467:000000001FF0100010001FF000007FFC01000100008007E00080014006200000 -B468:000000001FF0100010001FF000007FFC010001001FF000101FF0001000100000 -B469:000000001FF0100010001FF000007FFC010001001FF010001FF010001FF00000 -B46A:000000001FF0100010001FF000007FFC0100010000001FF0044004401FF00000 -B46B:000000001FF0100010001FF000007FFC0100010001001FF007C0082007C00000 -B46C:0000000800087FC84008400840087FC8000800087FE8040804F8040804080000 -B46D:00083F88200820083F8800087FE8027802080000000007F80008000800080000 -B46E:00083F88200820083F8800087FE802780208000000003EF80208020802080000 -B46F:00083F88200820083F8800087FE802780208000000001F080108011401620000 -B470:00083F88200820083F88000800087FE80278020802081000100010001FF80000 -B471:00083F88200820083F8800087FE8027802080000000020F8201020303ECC0000 -B472:00083F88200820083F8800087FE8027802080000202021FC207020883E700000 -B473:00083F88200820083F8800087FE802780208000003F802000200020003F80000 -B474:00083F88200820083F8800087FE802780208000007F8000807F8040007F80000 -B475:00083F88200820083F8800087FE80278020800003EF802083E0820083E080000 -B476:00083F88200820083F8800087FE80278020800003EF802883E8820883EF80000 -B477:00083F88200820083F8800087FE80278020800003E8802883EF820883EF80000 -B478:00083F88200820083F8800087FE80278020800000F8800880F8808140FA20000 -B479:00083F88200820083F8800087FE80278020800003EF802803EF820803EF80000 -B47A:00083F88200820083F8800087FE80278020800003EFC02483E4820483EFC0000 -B47B:00083F88200820083F8800087FE80278020800003E1002FE3E3820443E380000 -B47C:00083F88200820083F8800087FE802780208000003F802080208020803F80000 -B47D:00083F88200820083F8800087FE80278020800000208020803F8020803F80000 -B47E:00083F88200820083F8800087FE8027802080000210821083F0821143F620000 -B47F:00083F88200820083F8800087FE8027802080000001000100010006801840000 -B480:00083F88200820083F8800087FE80278020800000048004800A8011406620000 -B481:00083F88200820083F8800087FE8027802080000000003F00408040803F00000 -B482:00083F88200820083F8800087FE802780208000003F80020002000D003080000 -B483:00083F88200820083F8800087FE8027802080000004003F8004000A003180000 -B484:00083F88200820083F8800087FE802780208000003F8000803F8000800080000 -B485:00083F88200820083F8800087FE802780208000003F8020003F8020003F80000 -B486:00083F88200820083F8800087FE802780208000000000FF8022002200FF80000 -B487:00083F88200820083F8800087FE802780208000000800FF803E0041003E00000 -B488:0000000A000A7FCA400A400A400A7FCA000A000A7FEA040A047A040A040A0000 -B489:00283FA8202820283FA800287FA805E804280000000007F80008000800080000 -B48A:00283FA8202820283FA800287FA805E80428000000003EF80208020802080000 -B48B:00283FA8202820283FA800287FA805E80428000000001F080108011401620000 -B48C:00283FA8202820283FA8002800287FA8042805E804281428100010001FF80000 -B48D:00283FA8202820283FA800287FA805E804280000000020F8201020303ECC0000 -B48E:00283FA8202820283FA800287FA805E804280000202021FC207020883E700000 -B48F:00283FA8202820283FA800287FA805E80428000003F802000200020003F80000 -B490:00283FA8202820283FA800287FA805E80428000007F8000807F8040007F80000 -B491:00283FA8202820283FA800287FA805E8042800003EF802083E0820083E080000 -B492:00283FA8202820283FA800287FA805E8042800003EF802883E8820883EF80000 -B493:00283FA8202820283FA800287FA805E8042800003E8802883EF820883EF80000 -B494:00283FA8202820283FA800287FA805E8042800000F8800880F8808140FA20000 -B495:00283FA8202820283FA800287FA805E8042800003EF802803EF820803EF80000 -B496:00283FA8202820283FA800287FA805E8042800003EFC02483E4820483EFC0000 -B497:00283FA8202820283FA800287FA805E8042800003E1002FE3E3820443E380000 -B498:00283FA8202820283FA800287FA805E80428000003F802080208020803F80000 -B499:00283FA8202820283FA800287FA805E8042800000208020803F8020803F80000 -B49A:00283FA8202820283FA800287FA805E804280000210821083F0821143F620000 -B49B:00283FA8202820283FA800287FA805E804280000001000100010006801840000 -B49C:00283FA8202820283FA800287FA805E8042800000048004800A8011406620000 -B49D:00283FA8202820283FA800287FA805E804280000000003F00408040803F00000 -B49E:00283FA8202820283FA800287FA805E80428000003F80020002000D003080000 -B49F:00283FA8202820283FA800287FA805E804280000004003F8004000A003180000 -B4A0:00283FA8202820283FA800287FA805E80428000003F8000803F8000800080000 -B4A1:00283FA8202820283FA800287FA805E80428000003F8020003F8020003F80000 -B4A2:00283FA8202820283FA800287FA805E80428000000000FF8022002200FF80000 -B4A3:00283FA8202820283FA800287FA805E80428000000800FF803E0041003E00000 -B4A4:0000000800087FC84008400840087FC8000800087FE804080408040804080000 -B4A5:00083F88200820083F8800087FE8020802000000000007F80008000800080000 -B4A6:00083F88200820083F8800087FE802080200000000003EF80208020802080000 -B4A7:00083F88200820083F8800087FE802080200000000001F080108011401620000 -B4A8:00083F88200820083F88000800087FE80208020802081008100010001FF80000 -B4A9:00083F88200820083F8800087FE8020802000000000020F8201020303ECC0000 -B4AA:00083F88200820083F8800087FE8020802000000202021FC207020883E700000 -B4AB:00083F88200820083F8800087FE802080200000003F802000200020003F80000 -B4AC:00083F88200820083F8800087FE802080200000007F8000807F8040007F80000 -B4AD:00083F88200820083F8800087FE80208020000003EF802083E0820083E080000 -B4AE:00083F88200820083F8800087FE80208020000003EF802883E8820883EF80000 -B4AF:00083F88200820083F8800087FE80208020000003E8802883EF820883EF80000 -B4B0:00083F88200820083F8800087FE80208020000000F8800880F8808140FA20000 -B4B1:00083F88200820083F8800087FE80208020000003EF802803EF820803EF80000 -B4B2:00083F88200820083F8800087FE80208020000003EFC02483E4820483EFC0000 -B4B3:00083F88200820083F8800087FE80208020000003E1002FE3E3820443E380000 -B4B4:00083F88200820083F8800087FE802080200000003F802080208020803F80000 -B4B5:00083F88200820083F8800087FE80208020000000208020803F8020803F80000 -B4B6:00083F88200820083F8800087FE8020802000000210821083F0821143F620000 -B4B7:00083F88200820083F8800087FE8020802000000001000100010006801840000 -B4B8:00083F88200820083F8800087FE80208020000000048004800A8011406620000 -B4B9:00083F88200820083F8800087FE8020802000000000003F00408040803F00000 -B4BA:00083F88200820083F8800087FE802080200000003F80020002000D003080000 -B4BB:00083F88200820083F8800087FE8020802000000004003F8004000A003180000 -B4BC:00083F88200820083F8800087FE802080200000003F8000803F8000800080000 -B4BD:00083F88200820083F8800087FE802080200000003F8020003F8020003F80000 -B4BE:00083F88200820083F8800087FE802080200000000000FF8022002200FF80000 -B4BF:00083F88200820083F8800087FE802080200000000800FF803E0041003E00000 -B4C0:000000003FF820002000200020003FF8000000007FFC04400440044004400000 -B4C1:000000001FF0100010001FF000007FFC044004401FF000100010001000100000 -B4C2:000000001FF0100010001FF000007FFC0440044000003EF80208020802080000 -B4C3:000000001FF0100010001FF000007FFC0440044000001E100210022802C40000 -B4C4:000000001FF0100010001FF0000000007FFC044004401440100010001FF00000 -B4C5:000000001FF0100010001FF000007FFC04400440000020F8201020303ECC0000 -B4C6:000000001FF0100010001FF000007FFC04400440202021FC207020883E700000 -B4C7:000000001FF0100010001FF000007FFC044004401FF01000100010001FF00000 -B4C8:000000001FF0100010001FF000007FFC044004401FF000101FF010001FF00000 -B4C9:000000001FF0100010001FF000007FFC044004403EF802083E0820083E080000 -B4CA:000000001FF0100010001FF000007FFC044004403EF802883E8820883EF80000 -B4CB:000000001FF0100010001FF000007FFC044004403E8802883EF820883EF80000 -B4CC:000000001FF0100010001FF000007FFC044004403E1002103E1020283EC40000 -B4CD:000000001FF0100010001FF000007FFC044004403EF802803EF820803EF80000 -B4CE:000000001FF0100010001FF000007FFC044004403EFC02483E4820483EFC0000 -B4CF:000000001FF0100010001FF000007FFC044004403E2003FC3E7020883E700000 -B4D0:000000001FF0100010001FF000007FFC044004401FF01010101010101FF00000 -B4D1:000000001FF0100010001FF000007FFC04400440101010101FF010101FF00000 -B4D2:000000001FF0100010001FF000007FFC04400440222022203E2022503E880000 -B4D3:000000001FF0100010001FF000007FFC0440044000000100010002800C400000 -B4D4:000000001FF0100010001FF000007FFC044004400000024002400DA033100000 -B4D5:000000001FF0100010001FF000007FFC04400440000007C00820082007C00000 -B4D6:000000001FF0100010001FF000007FFC04400440000007E00080014006200000 -B4D7:000000001FF0100010001FF000007FFC04400440008007E00080014006200000 -B4D8:000000001FF0100010001FF000007FFC044004401FF000101FF0001000100000 -B4D9:000000001FF0100010001FF000007FFC044004401FF010001FF010001FF00000 -B4DA:000000001FF0100010001FF000007FFC0440044000001FF0044004401FF00000 -B4DB:000000001FF0100010001FF000007FFC0440044001001FF007C0082007C00000 -B4DC:000000003FF820002000200020003FF80000000000007FFC0000000000000000 -B4DD:000000001FF0100010001FF0000000007FFC00001FF000100010001000100000 -B4DE:000000001FF0100010001FF0000000007FFC000000003EF80208020802080000 -B4DF:000000001FF0100010001FF0000000007FFC000000001E100210022802C40000 -B4E0:000000001FF0100010001FF0000000007FFC000000001000100010001FF00000 -B4E1:000000001FF0100010001FF0000000007FFC0000000020F8201020303ECC0000 -B4E2:000000001FF0100010001FF0000000007FFC0000202021FC207020883E700000 -B4E3:000000001FF0100010001FF0000000007FFC00001FF01000100010001FF00000 -B4E4:000000001FF0100010001FF0000000007FFC00001FF000101FF010001FF00000 -B4E5:000000001FF0100010001FF0000000007FFC00003EF802083E0820083E080000 -B4E6:000000001FF0100010001FF0000000007FFC00003EF802883E8820883EF80000 -B4E7:000000001FF0100010001FF0000000007FFC00003E8802883EF820883EF80000 -B4E8:000000001FF0100010001FF0000000007FFC00003E1002103E1020283EC40000 -B4E9:000000001FF0100010001FF0000000007FFC00003EF802803EF820803EF80000 -B4EA:000000001FF0100010001FF0000000007FFC00003EFC02483E4820483EFC0000 -B4EB:000000001FF0100010001FF0000000007FFC00003E2003FC3E7020883E700000 -B4EC:000000001FF0100010001FF0000000007FFC00001FF01010101010101FF00000 -B4ED:000000001FF0100010001FF0000000007FFC0000101010101FF010101FF00000 -B4EE:000000001FF0100010001FF0000000007FFC0000222022203E2022503E880000 -B4EF:000000001FF0100010001FF0000000007FFC000000000100010002800C400000 -B4F0:000000001FF0100010001FF0000000007FFC00000000024002400DA033100000 -B4F1:000000001FF0100010001FF0000000007FFC0000000007C00820082007C00000 -B4F2:000000001FF0100010001FF0000000007FFC0000000007E00080014006200000 -B4F3:000000001FF0100010001FF0000000007FFC0000008007E00080014006200000 -B4F4:000000001FF0100010001FF0000000007FFC00001FF000101FF0001000100000 -B4F5:000000001FF0100010001FF0000000007FFC00001FF010001FF010001FF00000 -B4F6:000000001FF0100010001FF0000000007FFC000000001FF0044004401FF00000 -B4F7:000000001FF0100010001FF0000000007FFC000001001FF007C0082007C00000 -B4F8:0000000800087F884008400840087F880008000800087FE80008000800080000 -B4F9:000000083F88200820083F88000800087FE8000007F800080008000800080000 -B4FA:000000083F88200820083F88000800087FE8000000003EF80208020802080000 -B4FB:000000083F88200820083F88000800087FE8000000001F080108011401620000 -B4FC:000000083F88200820083F88000800087FE8000008000800080008000FF80000 -B4FD:000000083F88200820083F88000800087FE80000000010F8101010301ECC0000 -B4FE:000000083F88200820083F88000800087FE800000808087F081C08220F9C0000 -B4FF:000000083F88200820083F88000800087FE8000003F802000200020003F80000 -B500:000000083F88200820083F88000800087FE8000007F8000807F8040007F80000 -B501:000000083F88200820083F88000800087FE800003EF802083E0820083E080000 -B502:000000083F88200820083F88000800087FE800003EF802883E8820883EF80000 -B503:000000083F88200820083F88000800087FE800003E8802883EF820883EF80000 -B504:000000083F88200820083F88000800087FE800001F0801081F0810141F620000 -B505:000000083F88200820083F88000800087FE800003EF802803EF820803EF80000 -B506:000000083F88200820083F88000800087FE800003EFC02483E4820483EFC0000 -B507:000000083F88200820083F88000800087FE800001F08017F1F1C10221F1C0000 -B508:000000083F88200820083F88000800087FE8000003F802080208020803F80000 -B509:000000083F88200820083F88000800087FE800000208020803F8020803F80000 -B50A:000000083F88200820083F88000800087FE80000110811081F0811141F620000 -B50B:000000083F88200820083F88000800087FE80000001000100010006801840000 -B50C:000000083F88200820083F88000800087FE800000048004800A8011406620000 -B50D:000000083F88200820083F88000800087FE80000000003F00408040803F00000 -B50E:000000083F88200820083F88000800087FE8000003F80020002000D003080000 -B50F:000000083F88200820083F88000800087FE80000004003F8004000A003180000 -B510:000000083F88200820083F88000800087FE8000003F8000803F8000800080000 -B511:000000083F88200820083F88000800087FE8000003F8020003F8020003F80000 -B512:000000083F88200820083F88000800087FE8000000000FF8022002200FF80000 -B513:000000083F88200820083F88000800087FE8000000800FF803E0041003E00000 -B514:00000000000800087F88400840084008400840087F8800080008000800080000 -B515:0000000800087E084008400840087E0800080000000007F80008000800080000 -B516:0000000800087E084008400840087E080008000000003EF80208020802080000 -B517:0000000800087E084008400840087E080008000000001F080108011401620000 -B518:0000000800087E084008400840087E080008000800001000100010001FF80000 -B519:0000000800087E084008400840087E0800080000000020F8201020303ECC0000 -B51A:0000000800087E084008400840087E0800080000202021FC207020883E700000 -B51B:0000000800087E084008400840087E080008000003F802000200020003F80000 -B51C:0000000800087E084008400840087E080008000007F8000807F8040007F80000 -B51D:0000000800087E084008400840087E08000800003EF802083E0820083E080000 -B51E:0000000800087E084008400840087E08000800003EF802883E8820883EF80000 -B51F:0000000800087E084008400840087E08000800003E8802883EF820883EF80000 -B520:0000000800087E084008400840087E08000800000F8800880F8808140FA20000 -B521:0000000800087E084008400840087E08000800003EF802803EF820803EF80000 -B522:0000000800087E084008400840087E08000800003EFC02483E4820483EFC0000 -B523:0000000800087E084008400840087E08000800003E1002FE3E3820443E380000 -B524:0000000800087E084008400840087E080008000003F802080208020803F80000 -B525:0000000800087E084008400840087E08000800000208020803F8020803F80000 -B526:0000000800087E084008400840087E0800080000210821083F0821143F620000 -B527:0000000800087E084008400840087E0800080000001000100010006801840000 -B528:0000000800087E084008400840087E08000800000048004800A8011406620000 -B529:0000000800087E084008400840087E0800080000000003F00408040803F00000 -B52A:0000000800087E084008400840087E080008000003F80020002000D003080000 -B52B:0000000800087E084008400840087E0800080000004003F8004000A003180000 -B52C:0000000800087E084008400840087E080008000003F8000803F8000800080000 -B52D:0000000800087E084008400840087E080008000003F8020003F8020003F80000 -B52E:0000000800087E084008400840087E080008000000000FF8022002200FF80000 -B52F:0000000800087E084008400840087E080008000000800FF803E0041003E00000 -B530:00000000001000107BD042104210421E421042107BD000100010001000100000 -B531:00000008000877084408440E440877080008000007F800080008000800080000 -B532:00000008000877084408440E440877080008000000003EF80208020802080000 -B533:00000008000877084408440E440877080008000000001F080108011401620000 -B534:00000008000877084408440E440877080008000808000800080008000FF80000 -B535:00000008000877084408440E4408770800080000000010F8101010301ECC0000 -B536:00000008000877084408440E44087708000800000808087F081C08220F9C0000 -B537:00000008000877084408440E440877080008000003F802000200020003F80000 -B538:00000008000877084408440E440877080008000007F8000807F8040007F80000 -B539:00000008000877084408440E44087708000800003EF802083E0820083E080000 -B53A:00000008000877084408440E44087708000800003EF802883E8820883EF80000 -B53B:00000008000877084408440E44087708000800003E8802883EF820883EF80000 -B53C:00000008000877084408440E44087708000800001F0801081F0810141F620000 -B53D:00000008000877084408440E44087708000800003EF802803EF820803EF80000 -B53E:00000008000877084408440E44087708000800003EFC02483E4820483EFC0000 -B53F:00000008000877084408440E44087708000800001F08017F1F1C10221F1C0000 -B540:00000008000877084408440E440877080008000003F802080208020803F80000 -B541:00000008000877084408440E44087708000800000208020803F8020803F80000 -B542:00000008000877084408440E4408770800080000110811081F0811141F620000 -B543:00000008000877084408440E4408770800080000001000100010006801840000 -B544:00000008000877084408440E44087708000800000048004800A8011406620000 -B545:00000008000877084408440E4408770800080000000003F00408040803F00000 -B546:00000008000877084408440E440877080008000003F80020002000D003080000 -B547:00000008000877084408440E4408770800080000004003F8004000A003180000 -B548:00000008000877084408440E440877080008000003F8000803F8000800080000 -B549:00000008000877084408440E440877080008000003F8020003F8020003F80000 -B54A:00000008000877084408440E440877080008000000000FF8022002200FF80000 -B54B:00000008000877084408440E440877080008000000800FF803E0041003E00000 -B54C:00000000001200127BD242124212421E421242127BD200120012001200120000 -B54D:000000280028772844284438442877280028000007F800080008000800080000 -B54E:000000280028772844284438442877280028000000003EF80208020802080000 -B54F:000000280028772844284438442877280028000000003E100210022802C40000 -B550:000000280028772844284438442877280028002808000800080008000FF80000 -B551:0000002800287728442844384428772800280000000020F8201020303ECC0000 -B552:0000002800287728442844384428772800280000202021FC207020883E700000 -B553:000000280028772844284438442877280028000003F802000200020003F80000 -B554:000000280028772844284438442877280028000007F8000807F8040007F80000 -B555:00000028002877284428443844287728002800003EF802083E0820083E080000 -B556:00000028002877284428443844287728002800003EF802883E8820883EF80000 -B557:00000028002877284428443844287728002800003E8802883EF820883EF80000 -B558:00000028002877284428443844287728002800001F0801081F0810141F620000 -B559:00000028002877284428443844287728002800003EF802803EF820803EF80000 -B55A:00000028002877284428443844287728002800003EFC02483E4820483EFC0000 -B55B:00000028002877284428443844287728002800003E1002FE3E3820443E380000 -B55C:000000280028772844284438442877280028000003F802080208020803F80000 -B55D:00000028002877284428443844287728002800000208020803F8020803F80000 -B55E:0000002800287728442844384428772800280000110811081F0811141F620000 -B55F:0000002800287728442844384428772800280000000800080008003400C20000 -B560:00000028002877284428443844287728002800000048004800A8011406620000 -B561:0000002800287728442844384428772800280000000001F00208020801F00000 -B562:000000280028772844284438442877280028000003F80020002000D003080000 -B563:0000002800287728442844384428772800280000004003F8004000A003180000 -B564:000000280028772844284438442877280028000003F8000803F8000800080000 -B565:000000280028772844284438442877280028000003F8020003F8020003F80000 -B566:000000280028772844284438442877280028000000000FF8022002200FF80000 -B567:000000280028772844284438442877280028000000800FF803E0041003E00000 -B568:00000000001000107BD04210421E42104210421E7BD000100010001000100000 -B569:0000000800087708440E4408440E77080008000007F800080008000800080000 -B56A:0000000800087708440E4408440E77080008000000003EF80208020802080000 -B56B:0000000800087708440E4408440E77080008000000001F080108011401620000 -B56C:0000000800087708440E4408440E77080008000008000800080008000FF80000 -B56D:0000000800087708440E4408440E770800080000000010F8101010301ECC0000 -B56E:0000000800087708440E4408440E7708000800000808087F081C08220F9C0000 -B56F:0000000800087708440E4408440E77080008000003F802000200020003F80000 -B570:0000000800087708440E4408440E77080008000007F8000807F8040007F80000 -B571:0000000800087708440E4408440E7708000800003EF802083E0820083E080000 -B572:0000000800087708440E4408440E7708000800003EF802883E8820883EF80000 -B573:0000000800087708440E4408440E7708000800003E8802883EF820883EF80000 -B574:0000000800087708440E4408440E7708000800001F0801081F0810141F620000 -B575:0000000800087708440E4408440E7708000800003EF802803EF820803EF80000 -B576:0000000800087708440E4408440E7708000800003EFC02483E4820483EFC0000 -B577:0000000800087708440E4408440E7708000800001F08017F1F1C10221F1C0000 -B578:0000000800087708440E4408440E77080008000003F802080208020803F80000 -B579:0000000800087708440E4408440E7708000800000208020803F8020803F80000 -B57A:0000000800087708440E4408440E770800080000110811081F0811141F620000 -B57B:0000000800087708440E4408440E770800080000001000100010006801840000 -B57C:0000000800087708440E4408440E7708000800000048004800A8011406620000 -B57D:0000000800087708440E4408440E770800080000000003F00408040803F00000 -B57E:0000000800087708440E4408440E77080008000003F80020002000D003080000 -B57F:0000000800087708440E4408440E770800080000004003F8004000A003180000 -B580:0000000800087708440E4408440E77080008000003F8000803F8000800080000 -B581:0000000800087708440E4408440E77080008000003F8020003F8020003F80000 -B582:0000000800087708440E4408440E77080008000000000FF8022002200FF80000 -B583:0000000800087708440E4408440E77080008000000800FF803E0041003E00000 -B584:00000000001200127BD24212421E42124212421E7BD200120012001200120000 -B585:000000280028772844384428443877280028000007F800080008000800080000 -B586:000000280028772844384428443877280028000000003EF80208020802080000 -B587:000000280028772844384428443877280028000000003E100210022802C40000 -B588:000000280028772844384428443877280028002808000800080008000FF80000 -B589:0000002800287728443844284438772800280000000020F8201020303ECC0000 -B58A:0000002800287728443844284438772800280000202021FC207020883E700000 -B58B:000000280028772844384428443877280028000003F802000200020003F80000 -B58C:000000280028772844384428443877280028000007F8000807F8040007F80000 -B58D:00000028002877284438442844387728002800003EF802083E0820083E080000 -B58E:00000028002877284438442844387728002800003EF802883E8820883EF80000 -B58F:00000028002877284438442844387728002800003E8802883EF820883EF80000 -B590:00000028002877284438442844387728002800001F0801081F0810141F620000 -B591:00000028002877284438442844387728002800003EF802803EF820803EF80000 -B592:00000028002877284438442844387728002800003EFC02483E4820483EFC0000 -B593:00000028002877284438442844387728002800003E1002FE3E3820443E380000 -B594:000000280028772844384428443877280028000003F802080208020803F80000 -B595:00000028002877284438442844387728002800000208020803F8020803F80000 -B596:0000002800287728443844284438772800280000110811081F0811141F620000 -B597:0000002800287728443844284438772800280000000800080008003400C20000 -B598:00000028002877284438442844387728002800000048004800A8011406620000 -B599:0000002800287728443844284438772800280000000001F00208020801F00000 -B59A:000000280028772844384428443877280028000003F80020002000D003080000 -B59B:0000002800287728443844284438772800280000004003F8004000A003180000 -B59C:000000280028772844384428443877280028000003F8000803F8000800080000 -B59D:000000280028772844384428443877280028000003F8020003F8020003F80000 -B59E:000000280028772844384428443877280028000000000FF8022002200FF80000 -B59F:000000280028772844384428443877280028000000800FF803E0041003E00000 -B5A0:00000000000200027BC242024202421E420242027BC200020002000200020000 -B5A1:0000000800087708440844384408770800080000000007F80008000800080000 -B5A2:000000080008770844084438440877080008000000003EF80208020802080000 -B5A3:000000080008770844084438440877080008000000001F080108011401620000 -B5A4:000000080008770844084438440877080008000000001000100010001FF80000 -B5A5:0000000800087708440844384408770800080000000020F8201020303ECC0000 -B5A6:0000000800087708440844384408770800080000202021FC207020883E700000 -B5A7:000000080008770844084438440877080008000003F802000200020003F80000 -B5A8:000000080008770844084438440877080008000007F8000807F8040007F80000 -B5A9:00000008000877084408443844087708000800003EF802083E0820083E080000 -B5AA:00000008000877084408443844087708000800003EF802883E8820883EF80000 -B5AB:00000008000877084408443844087708000800003E8802883EF820883EF80000 -B5AC:00000008000877084408443844087708000800000F8800880F8808140FA20000 -B5AD:00000008000877084408443844087708000800003EF802803EF820803EF80000 -B5AE:00000008000877084408443844087708000800003EFC02483E4820483EFC0000 -B5AF:00000008000877084408443844087708000800003E1002FE3E3820443E380000 -B5B0:000000080008770844084438440877080008000003F802080208020803F80000 -B5B1:00000008000877084408443844087708000800000208020803F8020803F80000 -B5B2:0000000800087708440844384408770800080000210821083F0821143F620000 -B5B3:0000000800087708440844384408770800080000001000100010006801840000 -B5B4:00000008000877084408443844087708000800000048004800A8011406620000 -B5B5:0000000800087708440844384408770800080000000003F00408040803F00000 -B5B6:000000080008770844084438440877080008000003F80020002000D003080000 -B5B7:0000000800087708440844384408770800080000004003F8004000A003180000 -B5B8:000000080008770844084438440877080008000003F8000803F8000800080000 -B5B9:000000080008770844084438440877080008000003F8020003F8020003F80000 -B5BA:000000080008770844084438440877080008000000000FF8022002200FF80000 -B5BB:000000080008770844084438440877080008000000800FF803E0041003E00000 -B5BC:00000000000A000A7BCA420A420A423A420A420A7BCA000A000A000A000A0000 -B5BD:0000002800287728442844E8442877280028000007F800080008000800080000 -B5BE:0000002800287728442844E8442877280028000000003EF80208020802080000 -B5BF:0000002800287728442844E8442877280028000000003E100210022802C40000 -B5C0:0000002800287728442844E8442877280028000008000800080008000FF80000 -B5C1:0000002800287728442844E84428772800280000000020F8201020303ECC0000 -B5C2:0000002800287728442844E84428772800280000202021FC207020883E700000 -B5C3:0000002800287728442844E8442877280028000003F802000200020003F80000 -B5C4:0000002800287728442844E8442877280028000007F8000807F8040007F80000 -B5C5:0000002800287728442844E844287728002800003EF802083E0820083E080000 -B5C6:0000002800287728442844E844287728002800003EF802883E8820883EF80000 -B5C7:0000002800287728442844E844287728002800003E8802883EF820883EF80000 -B5C8:0000002800287728442844E844287728002800001F0801081F0810141F620000 -B5C9:0000002800287728442844E844287728002800003EF802803EF820803EF80000 -B5CA:0000002800287728442844E844287728002800003EFC02483E4820483EFC0000 -B5CB:0000002800287728442844E844287728002800003E1002FE3E3820443E380000 -B5CC:0000002800287728442844E8442877280028000003F802080208020803F80000 -B5CD:0000002800287728442844E844287728002800000208020803F8020803F80000 -B5CE:0000002800287728442844E84428772800280000110811081F0811141F620000 -B5CF:0000002800287728442844E84428772800280000000800080008003400C20000 -B5D0:0000002800287728442844E844287728002800000048004800A8011406620000 -B5D1:0000002800287728442844E84428772800280000000001F00208020801F00000 -B5D2:0000002800287728442844E8442877280028000003F80020002000D003080000 -B5D3:0000002800287728442844E84428772800280000004003F8004000A003180000 -B5D4:0000002800287728442844E8442877280028000003F8000803F8000800080000 -B5D5:0000002800287728442844E8442877280028000003F8020003F8020003F80000 -B5D6:0000002800287728442844E8442877280028000000000FF8022002200FF80000 -B5D7:0000002800287728442844E8442877280028000000800FF803E0041003E00000 -B5D8:00000000000200027BC24202421E42024202421E7BC200020002000200020000 -B5D9:0000000800087708443844084438770800080000000007F80008000800080000 -B5DA:000000080008770844384408443877080008000000003EF80208020802080000 -B5DB:000000080008770844384408443877080008000000001F080108011401620000 -B5DC:000000080008770844384408443877080008000800001000100010001FF80000 -B5DD:0000000800087708443844084438770800080000000020F8201020303ECC0000 -B5DE:0000000800087708443844084438770800080000202021FC207020883E700000 -B5DF:000000080008770844384408443877080008000003F802000200020003F80000 -B5E0:000000080008770844384408443877080008000007F8000807F8040007F80000 -B5E1:00000008000877084438440844387708000800003EF802083E0820083E080000 -B5E2:00000008000877084438440844387708000800003EF802883E8820883EF80000 -B5E3:00000008000877084438440844387708000800003E8802883EF820883EF80000 -B5E4:00000008000877084438440844387708000800000F8800880F8808140FA20000 -B5E5:00000008000877084438440844387708000800003EF802803EF820803EF80000 -B5E6:00000008000877084438440844387708000800003EFC02483E4820483EFC0000 -B5E7:00000008000877084438440844387708000800003E1002FE3E3820443E380000 -B5E8:000000080008770844384408443877080008000003F802080208020803F80000 -B5E9:00000008000877084438440844387708000800000208020803F8020803F80000 -B5EA:0000000800087708443844084438770800080000210821083F0821143F620000 -B5EB:0000000800087708443844084438770800080000001000100010006801840000 -B5EC:00000008000877084438440844387708000800000048004800A8011406620000 -B5ED:0000000800087708443844084438770800080000000003F00408040803F00000 -B5EE:000000080008770844384408443877080008000003F80020002000D003080000 -B5EF:0000000800087708443844084438770800080000004003F8004000A003180000 -B5F0:000000080008770844384408443877080008000003F8000803F8000800080000 -B5F1:000000080008770844384408443877080008000003F8020003F8020003F80000 -B5F2:000000080008770844384408443877080008000000000FF8022002200FF80000 -B5F3:000000080008770844384408443877080008000000800FF803E0041003E00000 -B5F4:00000000000A000A7BCA420A423A420A420A423A7BCA000A000A000A000A0000 -B5F5:000000280028772844E8442844E877280028000007F800080008000800080000 -B5F6:000000280028772844E8442844E877280028000000003EF80208020802080000 -B5F7:000000280028772844E8442844E877280028000000003E100210022802C40000 -B5F8:000000280028772844E8442844E877280028002808000800080008000FF80000 -B5F9:000000280028772844E8442844E8772800280000000020F8201020303ECC0000 -B5FA:000000280028772844E8442844E8772800280000202021FC207020883E700000 -B5FB:000000280028772844E8442844E877280028000003F802000200020003F80000 -B5FC:000000280028772844E8442844E877280028000007F8000807F8040007F80000 -B5FD:000000280028772844E8442844E87728002800003EF802083E0820083E080000 -B5FE:000000280028772844E8442844E87728002800003EF802883E8820883EF80000 -B5FF:000000280028772844E8442844E87728002800003E8802883EF820883EF80000 -B600:000000280028772844E8442844E87728002800001F0801081F0810141F620000 -B601:000000280028772844E8442844E87728002800003EF802803EF820803EF80000 -B602:000000280028772844E8442844E87728002800003EFC02483E4820483EFC0000 -B603:000000280028772844E8442844E87728002800003E1002FE3E3820443E380000 -B604:000000280028772844E8442844E877280028000003F802080208020803F80000 -B605:000000280028772844E8442844E87728002800000208020803F8020803F80000 -B606:000000280028772844E8442844E8772800280000110811081F0811141F620000 -B607:000000280028772844E8442844E8772800280000000800080008003400C20000 -B608:000000280028772844E8442844E87728002800000048004800A8011406620000 -B609:000000280028772844E8442844E8772800280000000001F00208020801F00000 -B60A:000000280028772844E8442844E877280028000003F80020002000D003080000 -B60B:000000280028772844E8442844E8772800280000004003F8004000A003180000 -B60C:000000280028772844E8442844E877280028000003F8000803F8000800080000 -B60D:000000280028772844E8442844E877280028000003F8020003F8020003F80000 -B60E:000000280028772844E8442844E877280028000000000FF8022002200FF80000 -B60F:000000280028772844E8442844E877280028000000800FF803E0041003E00000 -B610:000000003EF820802080208020803EF8000000000100010001007FFC00000000 -B611:000000001EF0108010801EF0010001007FFC00001FF000100010001000100000 -B612:000000001EF0108010801EF0010001007FFC000000003EF80208020802080000 -B613:000000001EF0108010801EF0010001007FFC000000001E100210022802C40000 -B614:000000001EF0108010801EF0010001007FFC000000001000100010001FF00000 -B615:000000001EF0108010801EF0010001007FFC0000000020F8201020303ECC0000 -B616:000000001EF0108010801EF0010001007FFC0000202021FC207020883E700000 -B617:000000001EF0108010801EF0010001007FFC00001FF01000100010001FF00000 -B618:000000001EF0108010801EF0010001007FFC00001FF000101FF010001FF00000 -B619:000000001EF0108010801EF0010001007FFC00003EF802083E0820083E080000 -B61A:000000001EF0108010801EF0010001007FFC00003EF802883E8820883EF80000 -B61B:000000001EF0108010801EF0010001007FFC00003E8802883EF820883EF80000 -B61C:000000001EF0108010801EF0010001007FFC00003E1002103E1020283EC40000 -B61D:000000001EF0108010801EF0010001007FFC00003EF802803EF820803EF80000 -B61E:000000001EF0108010801EF0010001007FFC00003EFC02483E4820483EFC0000 -B61F:000000001EF0108010801EF0010001007FFC00003E2003FC3E7020883E700000 -B620:000000001EF0108010801EF0010001007FFC00001FF01010101010101FF00000 -B621:000000001EF0108010801EF0010001007FFC0000101010101FF010101FF00000 -B622:000000001EF0108010801EF0010001007FFC0000222022203E2022503E880000 -B623:000000001EF0108010801EF0010001007FFC000000000100010002800C400000 -B624:000000001EF0108010801EF0010001007FFC00000000024002400DA033100000 -B625:000000001EF0108010801EF0010001007FFC0000000007C00820082007C00000 -B626:000000001EF0108010801EF0010001007FFC0000000007E00080014006200000 -B627:000000001EF0108010801EF0010001007FFC0000008007E00080014006200000 -B628:000000001EF0108010801EF0010001007FFC00001FF000101FF0001000100000 -B629:000000001EF0108010801EF0010001007FFC00001FF010001FF010001FF00000 -B62A:000000001EF0108010801EF0010001007FFC000000001FF0044004401FF00000 -B62B:000000001EF0108010801EF0010001007FFC000001001FF007C0082007C00000 -B62C:0000001000107BD0421042104210421E7BD00010041004107FD0001000100000 -B62D:000000083B882208220E3B88040804087FE8000007F800080008000800080000 -B62E:000000083B882208220E3B88040804087FE8000000003EF80208020802080000 -B62F:000000083B882208220E3B88040804087FE8000000001F080108011401620000 -B630:000000083B882208220E3B88040804087FE8000008000800080008000FF80000 -B631:000000083B882208220E3B88040804087FE80000000010F8101010301ECC0000 -B632:000000083B882208220E3B88040804087FE800000808087F081C08220F9C0000 -B633:000000083B882208220E3B88040804087FE8000003F802000200020003F80000 -B634:000000083B882208220E3B88040804087FE8000007F8000807F8040007F80000 -B635:000000083B882208220E3B88040804087FE800003EF802083E0820083E080000 -B636:000000083B882208220E3B88040804087FE800003EF802883E8820883EF80000 -B637:000000083B882208220E3B88040804087FE800003E8802883EF820883EF80000 -B638:000000083B882208220E3B88040804087FE800001F0801081F0810141F620000 -B639:000000083B882208220E3B88040804087FE800003EF802803EF820803EF80000 -B63A:000000083B882208220E3B88040804087FE800003EFC02483E4820483EFC0000 -B63B:000000083B882208220E3B88040804087FE800001F08017F1F1C10221F1C0000 -B63C:000000083B882208220E3B88040804087FE8000003F802080208020803F80000 -B63D:000000083B882208220E3B88040804087FE800000208020803F8020803F80000 -B63E:000000083B882208220E3B88040804087FE80000110811081F0811141F620000 -B63F:000000083B882208220E3B88040804087FE80000001000100010006801840000 -B640:000000083B882208220E3B88040804087FE800000048004800A8011406620000 -B641:000000083B882208220E3B88040804087FE80000000003F00408040803F00000 -B642:000000083B882208220E3B88040804087FE8000003F80020002000D003080000 -B643:000000083B882208220E3B88040804087FE80000004003F8004000A003180000 -B644:000000083B882208220E3B88040804087FE8000003F8000803F8000800080000 -B645:000000083B882208220E3B88040804087FE8000003F8020003F8020003F80000 -B646:000000083B882208220E3B88040804087FE8000000000FF8022002200FF80000 -B647:000000083B882208220E3B88040804087FE8000000800FF803E0041003E00000 -B648:0000001200127BD2421242124212421E7BD20012041204127FD2001200120000 -B649:000000283BA8222822383BA8042804287FA8000007F800080008000800080000 -B64A:000000283BA8222822383BA8042804287FA8000000003EF80208020802080000 -B64B:000000283BA8222822383BA8042804287FA8000000001F080108011401620000 -B64C:000000283BA8222822383BA8042804287FA8000008000800080008000FF80000 -B64D:000000283BA8222822383BA8042804287FA80000000010F8101010301ECC0000 -B64E:000000283BA8222822383BA8042804287FA800000808087F081C08220F9C0000 -B64F:000000283BA8222822383BA8042804287FA8000003F802000200020003F80000 -B650:000000283BA8222822383BA8042804287FA8000007F8000807F8040007F80000 -B651:000000283BA8222822383BA8042804287FA800003EF802083E0820083E080000 -B652:000000283BA8222822383BA8042804287FA800003EF802883E8820883EF80000 -B653:000000283BA8222822383BA8042804287FA800003E8802883EF820883EF80000 -B654:000000283BA8222822383BA8042804287FA800001F0801081F0810141F620000 -B655:000000283BA8222822383BA8042804287FA800003EF802803EF820803EF80000 -B656:000000283BA8222822383BA8042804287FA800003EFC02483E4820483EFC0000 -B657:000000283BA8222822383BA8042804287FA800001F08017F1F1C10221F1C0000 -B658:000000283BA8222822383BA8042804287FA8000003F802080208020803F80000 -B659:000000283BA8222822383BA8042804287FA800000208020803F8020803F80000 -B65A:000000283BA8222822383BA8042804287FA80000110811081F0811141F620000 -B65B:000000283BA8222822383BA8042804287FA80000001000100010006801840000 -B65C:000000283BA8222822383BA8042804287FA800000048004800A8011406620000 -B65D:000000283BA8222822383BA8042804287FA80000000003F00408040803F00000 -B65E:000000283BA8222822383BA8042804287FA8000003F80020002000D003080000 -B65F:000000283BA8222822383BA8042804287FA80000004003F8004000A003180000 -B660:000000283BA8222822383BA8042804287FA8000003F8000803F8000800080000 -B661:000000283BA8222822383BA8042804287FA8000003F8020003F8020003F80000 -B662:000000283BA8222822383BA8042804287FA8000000000FF8022002200FF80000 -B663:000000283BA8222822383BA8042804287FA8000000800FF803E0041003E00000 -B664:0000000800087BC842084208420842087BC80008040804087FE8000800080000 -B665:000000083B88220822083B88040804087FE8000007F800080008000800080000 -B666:000000083B88220822083B88040804087FE8000000003EF80208020802080000 -B667:000000083B88220822083B88040804087FE8000000001F080108011401620000 -B668:000000083B88220822083B88040804087FE8000008000800080008000FF80000 -B669:000000083B88220822083B88040804087FE80000000010F8101010301ECC0000 -B66A:000000083B88220822083B88040804087FE800000808087F081C08220F9C0000 -B66B:000000083B88220822083B88040804087FE8000003F802000200020003F80000 -B66C:000000083B88220822083B88040804087FE8000007F8000807F8040007F80000 -B66D:000000083B88220822083B88040804087FE800003EF802083E0820083E080000 -B66E:000000083B88220822083B88040804087FE800003EF802883E8820883EF80000 -B66F:000000083B88220822083B88040804087FE800003E8802883EF820883EF80000 -B670:000000083B88220822083B88040804087FE800001F0801081F0810141F620000 -B671:000000083B88220822083B88040804087FE800003EF802803EF820803EF80000 -B672:000000083B88220822083B88040804087FE800003EFC02483E4820483EFC0000 -B673:000000083B88220822083B88040804087FE800001F08017F1F1C10221F1C0000 -B674:000000083B88220822083B88040804087FE8000003F802080208020803F80000 -B675:000000083B88220822083B88040804087FE800000208020803F8020803F80000 -B676:000000083B88220822083B88040804087FE80000110811081F0811141F620000 -B677:000000083B88220822083B88040804087FE80000001000100010006801840000 -B678:000000083B88220822083B88040804087FE800000048004800A8011406620000 -B679:000000083B88220822083B88040804087FE80000000003F00408040803F00000 -B67A:000000083B88220822083B88040804087FE8000003F80020002000D003080000 -B67B:000000083B88220822083B88040804087FE80000004003F8004000A003180000 -B67C:000000083B88220822083B88040804087FE8000003F8000803F8000800080000 -B67D:000000083B88220822083B88040804087FE8000003F8020003F8020003F80000 -B67E:000000083B88220822083B88040804087FE8000000000FF8022002200FF80000 -B67F:000000083B88220822083B88040804087FE8000000800FF803E0041003E00000 -B680:000000003EF820802080208020803EF8000004400440044004407FFC00000000 -B681:000000001EF0108010801EF0044004407FFC00001FF000100010001000100000 -B682:000000001EF0108010801EF0044004407FFC000000003EF80208020802080000 -B683:000000001EF0108010801EF0044004407FFC000000001E100210022802C40000 -B684:000000001EF0108010801EF0044004407FFC000000001000100010001FF00000 -B685:000000001EF0108010801EF0044004407FFC0000000020F8201020303ECC0000 -B686:000000001EF0108010801EF0044004407FFC0000202021FC207020883E700000 -B687:000000001EF0108010801EF0044004407FFC00001FF01000100010001FF00000 -B688:000000001EF0108010801EF0044004407FFC00001FF000101FF010001FF00000 -B689:000000001EF0108010801EF0044004407FFC00003EF802083E0820083E080000 -B68A:000000001EF0108010801EF0044004407FFC00003EF802883E8820883EF80000 -B68B:000000001EF0108010801EF0044004407FFC00003E8802883EF820883EF80000 -B68C:000000001EF0108010801EF0044004407FFC00003E1002103E1020283EC40000 -B68D:000000001EF0108010801EF0044004407FFC00003EF802803EF820803EF80000 -B68E:000000001EF0108010801EF0044004407FFC00003EFC02483E4820483EFC0000 -B68F:000000001EF0108010801EF0044004407FFC00003E2003FC3E7020883E700000 -B690:000000001EF0108010801EF0044004407FFC00001FF01010101010101FF00000 -B691:000000001EF0108010801EF0044004407FFC0000101010101FF010101FF00000 -B692:000000001EF0108010801EF0044004407FFC0000222022203E2022503E880000 -B693:000000001EF0108010801EF0044004407FFC000000000100010002800C400000 -B694:000000001EF0108010801EF0044004407FFC00000000024002400DA033100000 -B695:000000001EF0108010801EF0044004407FFC0000000007C00820082007C00000 -B696:000000001EF0108010801EF0044004407FFC0000000007E00080014006200000 -B697:000000001EF0108010801EF0044004407FFC0000008007E00080014006200000 -B698:000000001EF0108010801EF0044004407FFC00001FF000101FF0001000100000 -B699:000000001EF0108010801EF0044004407FFC00001FF010001FF010001FF00000 -B69A:000000001EF0108010801EF0044004407FFC000000001FF0044004401FF00000 -B69B:000000001EF0108010801EF0044004407FFC000001001FF007C0082007C00000 -B69C:000000003EF820802080208020803EF8000000003FF801000100010001000000 -B69D:000000001EF0108010801EF000007FFC010001001FF000100010001000100000 -B69E:000000001EF0108010801EF000007FFC0100010000003EF80208020802080000 -B69F:000000001EF0108010801EF000007FFC0100010000001E100210022802C40000 -B6A0:000000001EF0108010801EF0000000007FFC010001001100100010001FF00000 -B6A1:000000001EF0108010801EF000007FFC01000100000020F8201020303ECC0000 -B6A2:000000001EF0108010801EF000007FFC01000100202021FC207020883E700000 -B6A3:000000001EF0108010801EF000007FFC010001001FF01000100010001FF00000 -B6A4:000000001EF0108010801EF000007FFC010001001FF000101FF010001FF00000 -B6A5:000000001EF0108010801EF000007FFC010001003EF802083E0820083E080000 -B6A6:000000001EF0108010801EF000007FFC010001003EF802883E8820883EF80000 -B6A7:000000001EF0108010801EF000007FFC010001003E8802883EF820883EF80000 -B6A8:000000001EF0108010801EF000007FFC010001003E1002103E1020283EC40000 -B6A9:000000001EF0108010801EF000007FFC010001003EF802803EF820803EF80000 -B6AA:000000001EF0108010801EF000007FFC010001003EFC02483E4820483EFC0000 -B6AB:000000001EF0108010801EF000007FFC010001003E2003FC3E7020883E700000 -B6AC:000000001EF0108010801EF000007FFC010001001FF01010101010101FF00000 -B6AD:000000001EF0108010801EF000007FFC01000100101010101FF010101FF00000 -B6AE:000000001EF0108010801EF000007FFC01000100222022203E2022503E880000 -B6AF:000000001EF0108010801EF000007FFC0100010000000100010002800C400000 -B6B0:000000001EF0108010801EF000007FFC010001000000024002400DA033100000 -B6B1:000000001EF0108010801EF000007FFC01000100000007C00820082007C00000 -B6B2:000000001EF0108010801EF000007FFC01000100000007E00080014006200000 -B6B3:000000001EF0108010801EF000007FFC01000100008007E00080014006200000 -B6B4:000000001EF0108010801EF000007FFC010001001FF000101FF0001000100000 -B6B5:000000001EF0108010801EF000007FFC010001001FF010001FF010001FF00000 -B6B6:000000001EF0108010801EF000007FFC0100010000001FF0044004401FF00000 -B6B7:000000001EF0108010801EF000007FFC0100010001001FF007C0082007C00000 -B6B8:000000087BC842084208420842087BC8000800087FE8040804F8040804080000 -B6B9:0008770844084408770800087FE8027802080000000007F80008000800080000 -B6BA:0008770844084408770800087FE802780208000000003EF80208020802080000 -B6BB:0008770844084408770800087FE802780208000000001F080108011401620000 -B6BC:00087708440844087708000800087FE80278020802081000100010001FF80000 -B6BD:0008770844084408770800087FE8027802080000000020F8201020303ECC0000 -B6BE:0008770844084408770800087FE8027802080000202021FC207020883E700000 -B6BF:0008770844084408770800087FE802780208000003F802000200020003F80000 -B6C0:0008770844084408770800087FE802780208000007F8000807F8040007F80000 -B6C1:0008770844084408770800087FE80278020800003EF802083E0820083E080000 -B6C2:0008770844084408770800087FE80278020800003EF802883E8820883EF80000 -B6C3:0008770844084408770800087FE80278020800003E8802883EF820883EF80000 -B6C4:0008770844084408770800087FE80278020800000F8800880F8808140FA20000 -B6C5:0008770844084408770800087FE80278020800003EF802803EF820803EF80000 -B6C6:0008770844084408770800087FE80278020800003EFC02483E4820483EFC0000 -B6C7:0008770844084408770800087FE80278020800003E1002FE3E3820443E380000 -B6C8:0008770844084408770800087FE802780208000003F802080208020803F80000 -B6C9:0008770844084408770800087FE80278020800000208020803F8020803F80000 -B6CA:0008770844084408770800087FE8027802080000210821083F0821143F620000 -B6CB:0008770844084408770800087FE8027802080000001000100010006801840000 -B6CC:0008770844084408770800087FE80278020800000048004800A8011406620000 -B6CD:0008770844084408770800087FE8027802080000000003F00408040803F00000 -B6CE:0008770844084408770800087FE802780208000003F80020002000D003080000 -B6CF:0008770844084408770800087FE8027802080000004003F8004000A003180000 -B6D0:0008770844084408770800087FE802780208000003F8000803F8000800080000 -B6D1:0008770844084408770800087FE802780208000003F8020003F8020003F80000 -B6D2:0008770844084408770800087FE802780208000000000FF8022002200FF80000 -B6D3:0008770844084408770800087FE802780208000000800FF803E0041003E00000 -B6D4:0000000A7BCA420A420A420A420A7BCA000A000A7FEA040A047A040A040A0000 -B6D5:0028772844284428772800287FA805E804280000000007F80008000800080000 -B6D6:0028772844284428772800287FA805E80428000000003EF80208020802080000 -B6D7:0028772844284428772800287FA805E80428000000001F080108011401620000 -B6D8:00287728442844287728002800287FA8042805E804281428100010001FF80000 -B6D9:0028772844284428772800287FA805E804280000000020F8201020303ECC0000 -B6DA:0028772844284428772800287FA805E804280000202021FC207020883E700000 -B6DB:0028772844284428772800287FA805E80428000003F802000200020003F80000 -B6DC:0028772844284428772800287FA805E80428000007F8000807F8040007F80000 -B6DD:0028772844284428772800287FA805E8042800003EF802083E0820083E080000 -B6DE:0028772844284428772800287FA805E8042800003EF802883E8820883EF80000 -B6DF:0028772844284428772800287FA805E8042800003E8802883EF820883EF80000 -B6E0:0028772844284428772800287FA805E8042800000F8800880F8808140FA20000 -B6E1:0028772844284428772800287FA805E8042800003EF802803EF820803EF80000 -B6E2:0028772844284428772800287FA805E8042800003EFC02483E4820483EFC0000 -B6E3:0028772844284428772800287FA805E8042800003E1002FE3E3820443E380000 -B6E4:0028772844284428772800287FA805E80428000003F802080208020803F80000 -B6E5:0028772844284428772800287FA805E8042800000208020803F8020803F80000 -B6E6:0028772844284428772800287FA805E804280000210821083F0821143F620000 -B6E7:0028772844284428772800287FA805E804280000001000100010006801840000 -B6E8:0028772844284428772800287FA805E8042800000048004800A8011406620000 -B6E9:0028772844284428772800287FA805E804280000000003F00408040803F00000 -B6EA:0028772844284428772800287FA805E80428000003F80020002000D003080000 -B6EB:0028772844284428772800287FA805E804280000004003F8004000A003180000 -B6EC:0028772844284428772800287FA805E80428000003F8000803F8000800080000 -B6ED:0028772844284428772800287FA805E80428000003F8020003F8020003F80000 -B6EE:0028772844284428772800287FA805E80428000000000FF8022002200FF80000 -B6EF:0028772844284428772800287FA805E80428000000800FF803E0041003E00000 -B6F0:000000087BC842084208420842087BC8000800087FE804080408040804080000 -B6F1:0008770844084408770800087FE8020802000000000007F80008000800080000 -B6F2:0008770844084408770800087FE802080200000000003EF80208020802080000 -B6F3:0008770844084408770800087FE802080200000000001F080108011401620000 -B6F4:00087708440844087708000800087FE80208020802081008100010001FF80000 -B6F5:0008770844084408770800087FE8020802000000000020F8201020303ECC0000 -B6F6:0008770844084408770800087FE8020802000000202021FC207020883E700000 -B6F7:0008770844084408770800087FE802080200000003F802000200020003F80000 -B6F8:0008770844084408770800087FE802080200000007F8000807F8040007F80000 -B6F9:0008770844084408770800087FE80208020000003EF802083E0820083E080000 -B6FA:0008770844084408770800087FE80208020000003EF802883E8820883EF80000 -B6FB:0008770844084408770800087FE80208020000003E8802883EF820883EF80000 -B6FC:0008770844084408770800087FE80208020000000F8800880F8808140FA20000 -B6FD:0008770844084408770800087FE80208020000003EF802803EF820803EF80000 -B6FE:0008770844084408770800087FE80208020000003EFC02483E4820483EFC0000 -B6FF:0008770844084408770800087FE80208020000003E1002FE3E3820443E380000 -B700:0008770844084408770800087FE802080200000003F802080208020803F80000 -B701:0008770844084408770800087FE80208020000000208020803F8020803F80000 -B702:0008770844084408770800087FE8020802000000210821083F0821143F620000 -B703:0008770844084408770800087FE8020802000000001000100010006801840000 -B704:0008770844084408770800087FE80208020000000048004800A8011406620000 -B705:0008770844084408770800087FE8020802000000000003F00408040803F00000 -B706:0008770844084408770800087FE802080200000003F80020002000D003080000 -B707:0008770844084408770800087FE8020802000000004003F8004000A003180000 -B708:0008770844084408770800087FE802080200000003F8000803F8000800080000 -B709:0008770844084408770800087FE802080200000003F8020003F8020003F80000 -B70A:0008770844084408770800087FE802080200000000000FF8022002200FF80000 -B70B:0008770844084408770800087FE802080200000000800FF803E0041003E00000 -B70C:000000003EF820802080208020803EF8000000007FFC04400440044004400000 -B70D:000000001EF0108010801EF000007FFC044004401FF000100010001000100000 -B70E:000000001EF0108010801EF000007FFC0440044000003EF80208020802080000 -B70F:000000001EF0108010801EF000007FFC0440044000001E100210022802C40000 -B710:000000001EF0108010801EF0000000007FFC044004401440100010001FF00000 -B711:000000001EF0108010801EF000007FFC04400440000020F8201020303ECC0000 -B712:000000001EF0108010801EF000007FFC04400440202021FC207020883E700000 -B713:000000001EF0108010801EF000007FFC044004401FF01000100010001FF00000 -B714:000000001EF0108010801EF000007FFC044004401FF000101FF010001FF00000 -B715:000000001EF0108010801EF000007FFC044004403EF802083E0820083E080000 -B716:000000001EF0108010801EF000007FFC044004403EF802883E8820883EF80000 -B717:000000001EF0108010801EF000007FFC044004403E8802883EF820883EF80000 -B718:000000001EF0108010801EF000007FFC044004403E1002103E1020283EC40000 -B719:000000001EF0108010801EF000007FFC044004403EF802803EF820803EF80000 -B71A:000000001EF0108010801EF000007FFC044004403EFC02483E4820483EFC0000 -B71B:000000001EF0108010801EF000007FFC044004403E2003FC3E7020883E700000 -B71C:000000001EF0108010801EF000007FFC044004401FF01010101010101FF00000 -B71D:000000001EF0108010801EF000007FFC04400440101010101FF010101FF00000 -B71E:000000001EF0108010801EF000007FFC04400440222022203E2022503E880000 -B71F:000000001EF0108010801EF000007FFC0440044000000100010002800C400000 -B720:000000001EF0108010801EF000007FFC044004400000024002400DA033100000 -B721:000000001EF0108010801EF000007FFC04400440000007C00820082007C00000 -B722:000000001EF0108010801EF000007FFC04400440000007E00080014006200000 -B723:000000001EF0108010801EF000007FFC04400440008007E00080014006200000 -B724:000000001EF0108010801EF000007FFC044004401FF000101FF0001000100000 -B725:000000001EF0108010801EF000007FFC044004401FF010001FF010001FF00000 -B726:000000001EF0108010801EF000007FFC0440044000001FF0044004401FF00000 -B727:000000001EF0108010801EF000007FFC0440044001001FF007C0082007C00000 -B728:000000003EF820802080208020803EF80000000000007FFC0000000000000000 -B729:000000001EF0108010801EF0000000007FFC00001FF000100010001000100000 -B72A:000000001EF0108010801EF0000000007FFC000000003EF80208020802080000 -B72B:000000001EF0108010801EF0000000007FFC000000001E100210022802C40000 -B72C:000000001EF0108010801EF0000000007FFC000000001000100010001FF00000 -B72D:000000001EF0108010801EF0000000007FFC0000000020F8201020303ECC0000 -B72E:000000001EF0108010801EF0000000007FFC0000202021FC207020883E700000 -B72F:000000001EF0108010801EF0000000007FFC00001FF01000100010001FF00000 -B730:000000001EF0108010801EF0000000007FFC00001FF000101FF010001FF00000 -B731:000000001EF0108010801EF0000000007FFC00003EF802083E0820083E080000 -B732:000000001EF0108010801EF0000000007FFC00003EF802883E8820883EF80000 -B733:000000001EF0108010801EF0000000007FFC00003E8802883EF820883EF80000 -B734:000000001EF0108010801EF0000000007FFC00003E1002103E1020283EC40000 -B735:000000001EF0108010801EF0000000007FFC00003EF802803EF820803EF80000 -B736:000000001EF0108010801EF0000000007FFC00003EFC02483E4820483EFC0000 -B737:000000001EF0108010801EF0000000007FFC00003E2003FC3E7020883E700000 -B738:000000001EF0108010801EF0000000007FFC00001FF01010101010101FF00000 -B739:000000001EF0108010801EF0000000007FFC0000101010101FF010101FF00000 -B73A:000000001EF0108010801EF0000000007FFC0000222022203E2022503E880000 -B73B:000000001EF0108010801EF0000000007FFC000000000100010002800C400000 -B73C:000000001EF0108010801EF0000000007FFC00000000024002400DA033100000 -B73D:000000001EF0108010801EF0000000007FFC0000000007C00820082007C00000 -B73E:000000001EF0108010801EF0000000007FFC0000000007E00080014006200000 -B73F:000000001EF0108010801EF0000000007FFC0000008007E00080014006200000 -B740:000000001EF0108010801EF0000000007FFC00001FF000101FF0001000100000 -B741:000000001EF0108010801EF0000000007FFC00001FF010001FF010001FF00000 -B742:000000001EF0108010801EF0000000007FFC000000001FF0044004401FF00000 -B743:000000001EF0108010801EF0000000007FFC000001001FF007C0082007C00000 -B744:0000000800087BC842084208420842087BC8000800087FE80008000800080000 -B745:000000083B88220822083B88000800087FE8000007F800080008000800080000 -B746:000000083B88220822083B88000800087FE8000000003EF80208020802080000 -B747:000000083B88220822083B88000800087FE8000000001F080108011401620000 -B748:000000083B88220822083B88000800087FE8000008000800080008000FF80000 -B749:000000083B88220822083B88000800087FE80000000010F8101010301ECC0000 -B74A:000000083B88220822083B88000800087FE800000808087F081C08220F9C0000 -B74B:000000083B88220822083B88000800087FE8000003F802000200020003F80000 -B74C:000000083B88220822083B88000800087FE8000007F8000807F8040007F80000 -B74D:000000083B88220822083B88000800087FE800003EF802083E0820083E080000 -B74E:000000083B88220822083B88000800087FE800003EF802883E8820883EF80000 -B74F:000000083B88220822083B88000800087FE800003E8802883EF820883EF80000 -B750:000000083B88220822083B88000800087FE800001F0801081F0810141F620000 -B751:000000083B88220822083B88000800087FE800003EF802803EF820803EF80000 -B752:000000083B88220822083B88000800087FE800003EFC02483E4820483EFC0000 -B753:000000083B88220822083B88000800087FE800001F08017F1F1C10221F1C0000 -B754:000000083B88220822083B88000800087FE8000003F802080208020803F80000 -B755:000000083B88220822083B88000800087FE800000208020803F8020803F80000 -B756:000000083B88220822083B88000800087FE80000110811081F0811141F620000 -B757:000000083B88220822083B88000800087FE80000001000100010006801840000 -B758:000000083B88220822083B88000800087FE800000048004800A8011406620000 -B759:000000083B88220822083B88000800087FE80000000003F00408040803F00000 -B75A:000000083B88220822083B88000800087FE8000003F80020002000D003080000 -B75B:000000083B88220822083B88000800087FE80000004003F8004000A003180000 -B75C:000000083B88220822083B88000800087FE8000003F8000803F8000800080000 -B75D:000000083B88220822083B88000800087FE8000003F8020003F8020003F80000 -B75E:000000083B88220822083B88000800087FE8000000000FF8022002200FF80000 -B75F:000000083B88220822083B88000800087FE8000000800FF803E0041003E00000 -B760:00000000000800087BC8420842084208420842087BC800080008000800080000 -B761:0000000800087708440844084408770800080000000007F80008000800080000 -B762:000000080008770844084408440877080008000000003EF80208020802080000 -B763:000000080008770844084408440877080008000000001F080108011401620000 -B764:000000080008770844084408440877080008000800001000100010001FF80000 -B765:0000000800087708440844084408770800080000000020F8201020303ECC0000 -B766:0000000800087708440844084408770800080000202021FC207020883E700000 -B767:000000080008770844084408440877080008000003F802000200020003F80000 -B768:000000080008770844084408440877080008000007F8000807F8040007F80000 -B769:00000008000877084408440844087708000800003EF802083E0820083E080000 -B76A:00000008000877084408440844087708000800003EF802883E8820883EF80000 -B76B:00000008000877084408440844087708000800003E8802883EF820883EF80000 -B76C:00000008000877084408440844087708000800000F8800880F8808140FA20000 -B76D:00000008000877084408440844087708000800003EF802803EF820803EF80000 -B76E:00000008000877084408440844087708000800003EFC02483E4820483EFC0000 -B76F:00000008000877084408440844087708000800003E1002FE3E3820443E380000 -B770:000000080008770844084408440877080008000003F802080208020803F80000 -B771:00000008000877084408440844087708000800000208020803F8020803F80000 -B772:0000000800087708440844084408770800080000210821083F0821143F620000 -B773:0000000800087708440844084408770800080000001000100010006801840000 -B774:00000008000877084408440844087708000800000048004800A8011406620000 -B775:0000000800087708440844084408770800080000000003F00408040803F00000 -B776:000000080008770844084408440877080008000003F80020002000D003080000 -B777:0000000800087708440844084408770800080000004003F8004000A003180000 -B778:000000080008770844084408440877080008000003F8000803F8000800080000 -B779:000000080008770844084408440877080008000003F8020003F8020003F80000 -B77A:000000080008770844084408440877080008000000000FF8022002200FF80000 -B77B:000000080008770844084408440877080008000000800FF803E0041003E00000 -B77C:00000000001000103F90009000903F9E2010201020103F900010001000100000 -B77D:0000000800083F0801083F0E20083F080008000007F800080008000800080000 -B77E:0000000800083F0801083F0E20083F080008000000003EF80208020802080000 -B77F:0000000800083F0801083F0E20083F080008000000001F080108011401620000 -B780:0000000800083F0801083F0E20083F080008000808000800080008000FF80000 -B781:0000000800083F0801083F0E20083F0800080000000010F8101010301ECC0000 -B782:0000000800083F0801083F0E20083F08000800000808087F081C08220F9C0000 -B783:0000000800083F0801083F0E20083F080008000003F802000200020003F80000 -B784:0000000800083F0801083F0E20083F080008000007F8000807F8040007F80000 -B785:0000000800083F0801083F0E20083F08000800003EF802083E0820083E080000 -B786:0000000800083F0801083F0E20083F08000800003EF802883E8820883EF80000 -B787:0000000800083F0801083F0E20083F08000800003E8802883EF820883EF80000 -B788:0000000800083F0801083F0E20083F08000800001F0801081F0810141F620000 -B789:0000000800083F0801083F0E20083F08000800003EF802803EF820803EF80000 -B78A:0000000800083F0801083F0E20083F08000800003EFC02483E4820483EFC0000 -B78B:0000000800083F0801083F0E20083F08000800001F08017F1F1C10221F1C0000 -B78C:0000000800083F0801083F0E20083F080008000003F802080208020803F80000 -B78D:0000000800083F0801083F0E20083F08000800000208020803F8020803F80000 -B78E:0000000800083F0801083F0E20083F0800080000110811081F0811141F620000 -B78F:0000000800083F0801083F0E20083F0800080000001000100010006801840000 -B790:0000000800083F0801083F0E20083F08000800000048004800A8011406620000 -B791:0000000800083F0801083F0E20083F0800080000000003F00408040803F00000 -B792:0000000800083F0801083F0E20083F080008000003F80020002000D003080000 -B793:0000000800083F0801083F0E20083F0800080000004003F8004000A003180000 -B794:0000000800083F0801083F0E20083F080008000003F8000803F8000800080000 -B795:0000000800083F0801083F0E20083F080008000003F8020003F8020003F80000 -B796:0000000800083F0801083F0E20083F080008000000000FF8022002200FF80000 -B797:0000000800083F0801083F0E20083F080008000000800FF803E0041003E00000 -B798:00000000001200123F92009200923F9E2012201220123F920012001200120000 -B799:0000002800283F2801283F3820283F280028000007F800080008000800080000 -B79A:0000002800283F2801283F3820283F280028000000003EF80208020802080000 -B79B:0000002800283F2801283F3820283F280028000000003E100210022802C40000 -B79C:0000002800283F2801283F3820283F280028002808000800080008000FF80000 -B79D:0000002800283F2801283F3820283F2800280000000020F8201020303ECC0000 -B79E:0000002800283F2801283F3820283F2800280000202021FC207020883E700000 -B79F:0000002800283F2801283F3820283F280028000003F802000200020003F80000 -B7A0:0000002800283F2801283F3820283F280028000007F8000807F8040007F80000 -B7A1:0000002800283F2801283F3820283F28002800003EF802083E0820083E080000 -B7A2:0000002800283F2801283F3820283F28002800003EF802883E8820883EF80000 -B7A3:0000002800283F2801283F3820283F28002800003E8802883EF820883EF80000 -B7A4:0000002800283F2801283F3820283F28002800001F0801081F0810141F620000 -B7A5:0000002800283F2801283F3820283F28002800003EF802803EF820803EF80000 -B7A6:0000002800283F2801283F3820283F28002800003EFC02483E4820483EFC0000 -B7A7:0000002800283F2801283F3820283F28002800003E1002FE3E3820443E380000 -B7A8:0000002800283F2801283F3820283F280028000003F802080208020803F80000 -B7A9:0000002800283F2801283F3820283F28002800000208020803F8020803F80000 -B7AA:0000002800283F2801283F3820283F2800280000110811081F0811141F620000 -B7AB:0000002800283F2801283F3820283F2800280000000800080008003400C20000 -B7AC:0000002800283F2801283F3820283F28002800000048004800A8011406620000 -B7AD:0000002800283F2801283F3820283F2800280000000001F00208020801F00000 -B7AE:0000002800283F2801283F3820283F280028000003F80020002000D003080000 -B7AF:0000002800283F2801283F3820283F2800280000004003F8004000A003180000 -B7B0:0000002800283F2801283F3820283F280028000003F8000803F8000800080000 -B7B1:0000002800283F2801283F3820283F280028000003F8020003F8020003F80000 -B7B2:0000002800283F2801283F3820283F280028000000000FF8022002200FF80000 -B7B3:0000002800283F2801283F3820283F280028000000800FF803E0041003E00000 -B7B4:00000000001000103F900090009E3F902010201E20103F900010001000100000 -B7B5:0000000800083F08010E3F08200E3F080008000007F800080008000800080000 -B7B6:0000000800083F08010E3F08200E3F080008000000003EF80208020802080000 -B7B7:0000000800083F08010E3F08200E3F080008000000001F080108011401620000 -B7B8:0000000800083F08010E3F08200E3F080008000008000800080008000FF80000 -B7B9:0000000800083F08010E3F08200E3F0800080000000010F8101010301ECC0000 -B7BA:0000000800083F08010E3F08200E3F08000800000808087F081C08220F9C0000 -B7BB:0000000800083F08010E3F08200E3F080008000003F802000200020003F80000 -B7BC:0000000800083F08010E3F08200E3F080008000007F8000807F8040007F80000 -B7BD:0000000800083F08010E3F08200E3F08000800003EF802083E0820083E080000 -B7BE:0000000800083F08010E3F08200E3F08000800003EF802883E8820883EF80000 -B7BF:0000000800083F08010E3F08200E3F08000800003E8802883EF820883EF80000 -B7C0:0000000800083F08010E3F08200E3F08000800001F0801081F0810141F620000 -B7C1:0000000800083F08010E3F08200E3F08000800003EF802803EF820803EF80000 -B7C2:0000000800083F08010E3F08200E3F08000800003EFC02483E4820483EFC0000 -B7C3:0000000800083F08010E3F08200E3F08000800001F08017F1F1C10221F1C0000 -B7C4:0000000800083F08010E3F08200E3F080008000003F802080208020803F80000 -B7C5:0000000800083F08010E3F08200E3F08000800000208020803F8020803F80000 -B7C6:0000000800083F08010E3F08200E3F0800080000110811081F0811141F620000 -B7C7:0000000800083F08010E3F08200E3F0800080000001000100010006801840000 -B7C8:0000000800083F08010E3F08200E3F08000800000048004800A8011406620000 -B7C9:0000000800083F08010E3F08200E3F0800080000000003F00408040803F00000 -B7CA:0000000800083F08010E3F08200E3F080008000003F80020002000D003080000 -B7CB:0000000800083F08010E3F08200E3F0800080000004003F8004000A003180000 -B7CC:0000000800083F08010E3F08200E3F080008000003F8000803F8000800080000 -B7CD:0000000800083F08010E3F08200E3F080008000003F8020003F8020003F80000 -B7CE:0000000800083F08010E3F08200E3F080008000000000FF8022002200FF80000 -B7CF:0000000800083F08010E3F08200E3F080008000000800FF803E0041003E00000 -B7D0:00000000001200123F920092009E3F922012201E20123F920012001200120000 -B7D1:0000002800283F2801383F2820383F280028000007F800080008000800080000 -B7D2:0000002800283F2801383F2820383F280028000000003EF80208020802080000 -B7D3:0000002800283F2801383F2820383F280028000000003E100210022802C40000 -B7D4:0000002800283F2801383F2820383F280028002808000800080008000FF80000 -B7D5:0000002800283F2801383F2820383F2800280000000020F8201020303ECC0000 -B7D6:0000002800283F2801383F2820383F2800280000202021FC207020883E700000 -B7D7:0000002800283F2801383F2820383F280028000003F802000200020003F80000 -B7D8:0000002800283F2801383F2820383F280028000007F8000807F8040007F80000 -B7D9:0000002800283F2801383F2820383F28002800003EF802083E0820083E080000 -B7DA:0000002800283F2801383F2820383F28002800003EF802883E8820883EF80000 -B7DB:0000002800283F2801383F2820383F28002800003E8802883EF820883EF80000 -B7DC:0000002800283F2801383F2820383F28002800001F0801081F0810141F620000 -B7DD:0000002800283F2801383F2820383F28002800003EF802803EF820803EF80000 -B7DE:0000002800283F2801383F2820383F28002800003EFC02483E4820483EFC0000 -B7DF:0000002800283F2801383F2820383F28002800003E1002FE3E3820443E380000 -B7E0:0000002800283F2801383F2820383F280028000003F802080208020803F80000 -B7E1:0000002800283F2801383F2820383F28002800000208020803F8020803F80000 -B7E2:0000002800283F2801383F2820383F2800280000110811081F0811141F620000 -B7E3:0000002800283F2801383F2820383F2800280000000800080008003400C20000 -B7E4:0000002800283F2801383F2820383F28002800000048004800A8011406620000 -B7E5:0000002800283F2801383F2820383F2800280000000001F00208020801F00000 -B7E6:0000002800283F2801383F2820383F280028000003F80020002000D003080000 -B7E7:0000002800283F2801383F2820383F2800280000004003F8004000A003180000 -B7E8:0000002800283F2801383F2820383F280028000003F8000803F8000800080000 -B7E9:0000002800283F2801383F2820383F280028000003F8020003F8020003F80000 -B7EA:0000002800283F2801383F2820383F280028000000000FF8022002200FF80000 -B7EB:0000002800283F2801383F2820383F280028000000800FF803E0041003E00000 -B7EC:00000000000200023F82008200823F9E2002200220023F820002000200020000 -B7ED:0000000800083F0801083F3820083F0800080000000007F80008000800080000 -B7EE:0000000800083F0801083F3820083F080008000000003EF80208020802080000 -B7EF:0000000800083F0801083F3820083F080008000000001F080108011401620000 -B7F0:0000000800083F0801083F3820083F080008000000001000100010001FF80000 -B7F1:0000000800083F0801083F3820083F0800080000000020F8201020303ECC0000 -B7F2:0000000800083F0801083F3820083F0800080000202021FC207020883E700000 -B7F3:0000000800083F0801083F3820083F080008000003F802000200020003F80000 -B7F4:0000000800083F0801083F3820083F080008000007F8000807F8040007F80000 -B7F5:0000000800083F0801083F3820083F08000800003EF802083E0820083E080000 -B7F6:0000000800083F0801083F3820083F08000800003EF802883E8820883EF80000 -B7F7:0000000800083F0801083F3820083F08000800003E8802883EF820883EF80000 -B7F8:0000000800083F0801083F3820083F08000800000F8800880F8808140FA20000 -B7F9:0000000800083F0801083F3820083F08000800003EF802803EF820803EF80000 -B7FA:0000000800083F0801083F3820083F08000800003EFC02483E4820483EFC0000 -B7FB:0000000800083F0801083F3820083F08000800003E1002FE3E3820443E380000 -B7FC:0000000800083F0801083F3820083F080008000003F802080208020803F80000 -B7FD:0000000800083F0801083F3820083F08000800000208020803F8020803F80000 -B7FE:0000000800083F0801083F3820083F0800080000210821083F0821143F620000 -B7FF:0000000800083F0801083F3820083F0800080000001000100010006801840000 -B800:0000000800083F0801083F3820083F08000800000048004800A8011406620000 -B801:0000000800083F0801083F3820083F0800080000000003F00408040803F00000 -B802:0000000800083F0801083F3820083F080008000003F80020002000D003080000 -B803:0000000800083F0801083F3820083F0800080000004003F8004000A003180000 -B804:0000000800083F0801083F3820083F080008000003F8000803F8000800080000 -B805:0000000800083F0801083F3820083F080008000003F8020003F8020003F80000 -B806:0000000800083F0801083F3820083F080008000000000FF8022002200FF80000 -B807:0000000800083F0801083F3820083F080008000000800FF803E0041003E00000 -B808:00000000000A000A3F8A008A008A3FBA200A200A200A3F8A000A000A000A0000 -B809:0000002800283F2801283FE820283F280028000007F800080008000800080000 -B80A:0000002800283F2801283FE820283F280028000000003EF80208020802080000 -B80B:0000002800283F2801283FE820283F280028000000003E100210022802C40000 -B80C:0000002800283F2801283FE820283F280028000008000800080008000FF80000 -B80D:0000002800283F2801283FE820283F2800280000000020F8201020303ECC0000 -B80E:0000002800283F2801283FE820283F2800280000202021FC207020883E700000 -B80F:0000002800283F2801283FE820283F280028000003F802000200020003F80000 -B810:0000002800283F2801283FE820283F280028000007F8000807F8040007F80000 -B811:0000002800283F2801283FE820283F28002800003EF802083E0820083E080000 -B812:0000002800283F2801283FE820283F28002800003EF802883E8820883EF80000 -B813:0000002800283F2801283FE820283F28002800003E8802883EF820883EF80000 -B814:0000002800283F2801283FE820283F28002800001F0801081F0810141F620000 -B815:0000002800283F2801283FE820283F28002800003EF802803EF820803EF80000 -B816:0000002800283F2801283FE820283F28002800003EFC02483E4820483EFC0000 -B817:0000002800283F2801283FE820283F28002800003E1002FE3E3820443E380000 -B818:0000002800283F2801283FE820283F280028000003F802080208020803F80000 -B819:0000002800283F2801283FE820283F28002800000208020803F8020803F80000 -B81A:0000002800283F2801283FE820283F2800280000110811081F0811141F620000 -B81B:0000002800283F2801283FE820283F2800280000000800080008003400C20000 -B81C:0000002800283F2801283FE820283F28002800000048004800A8011406620000 -B81D:0000002800283F2801283FE820283F2800280000000001F00208020801F00000 -B81E:0000002800283F2801283FE820283F280028000003F80020002000D003080000 -B81F:0000002800283F2801283FE820283F2800280000004003F8004000A003180000 -B820:0000002800283F2801283FE820283F280028000003F8000803F8000800080000 -B821:0000002800283F2801283FE820283F280028000003F8020003F8020003F80000 -B822:0000002800283F2801283FE820283F280028000000000FF8022002200FF80000 -B823:0000002800283F2801283FE820283F280028000000800FF803E0041003E00000 -B824:00000000000200023F820082009E3F822002201E20023F820002000200020000 -B825:0000000800083F0801383F0820383F0800080000000007F80008000800080000 -B826:0000000800083F0801383F0820383F080008000000003EF80208020802080000 -B827:0000000800083F0801383F0820383F080008000000001F080108011401620000 -B828:0000000800083F0801383F0820383F080008000800001000100010001FF80000 -B829:0000000800083F0801383F0820383F0800080000000020F8201020303ECC0000 -B82A:0000000800083F0801383F0820383F0800080000202021FC207020883E700000 -B82B:0000000800083F0801383F0820383F080008000003F802000200020003F80000 -B82C:0000000800083F0801383F0820383F080008000007F8000807F8040007F80000 -B82D:0000000800083F0801383F0820383F08000800003EF802083E0820083E080000 -B82E:0000000800083F0801383F0820383F08000800003EF802883E8820883EF80000 -B82F:0000000800083F0801383F0820383F08000800003E8802883EF820883EF80000 -B830:0000000800083F0801383F0820383F08000800000F8800880F8808140FA20000 -B831:0000000800083F0801383F0820383F08000800003EF802803EF820803EF80000 -B832:0000000800083F0801383F0820383F08000800003EFC02483E4820483EFC0000 -B833:0000000800083F0801383F0820383F08000800003E1002FE3E3820443E380000 -B834:0000000800083F0801383F0820383F080008000003F802080208020803F80000 -B835:0000000800083F0801383F0820383F08000800000208020803F8020803F80000 -B836:0000000800083F0801383F0820383F0800080000210821083F0821143F620000 -B837:0000000800083F0801383F0820383F0800080000001000100010006801840000 -B838:0000000800083F0801383F0820383F08000800000048004800A8011406620000 -B839:0000000800083F0801383F0820383F0800080000000003F00408040803F00000 -B83A:0000000800083F0801383F0820383F080008000003F80020002000D003080000 -B83B:0000000800083F0801383F0820383F0800080000004003F8004000A003180000 -B83C:0000000800083F0801383F0820383F080008000003F8000803F8000800080000 -B83D:0000000800083F0801383F0820383F080008000003F8020003F8020003F80000 -B83E:0000000800083F0801383F0820383F080008000000000FF8022002200FF80000 -B83F:0000000800083F0801383F0820383F080008000000800FF803E0041003E00000 -B840:00000000000A000A3F8A008A00BA3F8A200A203A200A3F8A000A000A000A0000 -B841:0000002800283F2801E83F2820E83F280028000007F800080008000800080000 -B842:0000002800283F2801E83F2820E83F280028000000003EF80208020802080000 -B843:0000002800283F2801E83F2820E83F280028000000003E100210022802C40000 -B844:0000002800283F2801E83F2820E83F280028002808000800080008000FF80000 -B845:0000002800283F2801E83F2820E83F2800280000000020F8201020303ECC0000 -B846:0000002800283F2801E83F2820E83F2800280000202021FC207020883E700000 -B847:0000002800283F2801E83F2820E83F280028000003F802000200020003F80000 -B848:0000002800283F2801E83F2820E83F280028000007F8000807F8040007F80000 -B849:0000002800283F2801E83F2820E83F28002800003EF802083E0820083E080000 -B84A:0000002800283F2801E83F2820E83F28002800003EF802883E8820883EF80000 -B84B:0000002800283F2801E83F2820E83F28002800003E8802883EF820883EF80000 -B84C:0000002800283F2801E83F2820E83F28002800001F0801081F0810141F620000 -B84D:0000002800283F2801E83F2820E83F28002800003EF802803EF820803EF80000 -B84E:0000002800283F2801E83F2820E83F28002800003EFC02483E4820483EFC0000 -B84F:0000002800283F2801E83F2820E83F28002800003E1002FE3E3820443E380000 -B850:0000002800283F2801E83F2820E83F280028000003F802080208020803F80000 -B851:0000002800283F2801E83F2820E83F28002800000208020803F8020803F80000 -B852:0000002800283F2801E83F2820E83F2800280000110811081F0811141F620000 -B853:0000002800283F2801E83F2820E83F2800280000000800080008003400C20000 -B854:0000002800283F2801E83F2820E83F28002800000048004800A8011406620000 -B855:0000002800283F2801E83F2820E83F2800280000000001F00208020801F00000 -B856:0000002800283F2801E83F2820E83F280028000003F80020002000D003080000 -B857:0000002800283F2801E83F2820E83F2800280000004003F8004000A003180000 -B858:0000002800283F2801E83F2820E83F280028000003F8000803F8000800080000 -B859:0000002800283F2801E83F2820E83F280028000003F8020003F8020003F80000 -B85A:0000002800283F2801E83F2820E83F280028000000000FF8022002200FF80000 -B85B:0000002800283F2801E83F2820E83F280028000000800FF803E0041003E00000 -B85C:000000001FF0001000101FF0100010001FF000000100010001007FFC00000000 -B85D:00001FF000101FF010001FF0010001007FFC00001FF000100010001000100000 -B85E:00001FF000101FF010001FF0010001007FFC000000003EF80208020802080000 -B85F:00001FF000101FF010001FF0010001007FFC000000001E100210022802C40000 -B860:00001FF000101FF010001FF0010001007FFC000000001000100010001FF00000 -B861:00001FF000101FF010001FF0010001007FFC0000000020F8201020303ECC0000 -B862:00001FF000101FF010001FF0010001007FFC0000202021FC207020883E700000 -B863:00001FF000101FF010001FF0010001007FFC00001FF01000100010001FF00000 -B864:00001FF000101FF010001FF0010001007FFC00001FF000101FF010001FF00000 -B865:00001FF000101FF010001FF0010001007FFC00003EF802083E0820083E080000 -B866:00001FF000101FF010001FF0010001007FFC00003EF802883E8820883EF80000 -B867:00001FF000101FF010001FF0010001007FFC00003E8802883EF820883EF80000 -B868:00001FF000101FF010001FF0010001007FFC00003E1002103E1020283EC40000 -B869:00001FF000101FF010001FF0010001007FFC00003EF802803EF820803EF80000 -B86A:00001FF000101FF010001FF0010001007FFC00003EFC02483E4820483EFC0000 -B86B:00001FF000101FF010001FF0010001007FFC00003E2003FC3E7020883E700000 -B86C:00001FF000101FF010001FF0010001007FFC00001FF01010101010101FF00000 -B86D:00001FF000101FF010001FF0010001007FFC0000101010101FF010101FF00000 -B86E:00001FF000101FF010001FF0010001007FFC0000222022203E2022503E880000 -B86F:00001FF000101FF010001FF0010001007FFC000000000100010002800C400000 -B870:00001FF000101FF010001FF0010001007FFC00000000024002400DA033100000 -B871:00001FF000101FF010001FF0010001007FFC0000000007C00820082007C00000 -B872:00001FF000101FF010001FF0010001007FFC0000000007E00080014006200000 -B873:00001FF000101FF010001FF0010001007FFC0000008007E00080014006200000 -B874:00001FF000101FF010001FF0010001007FFC00001FF000101FF0001000100000 -B875:00001FF000101FF010001FF0010001007FFC00001FF010001FF010001FF00000 -B876:00001FF000101FF010001FF0010001007FFC000000001FF0044004401FF00000 -B877:00001FF000101FF010001FF0010001007FFC000001001FF007C0082007C00000 -B878:0000001000103F90009000903F90201E20103F90041004107FD0001000100000 -B879:000000083F8800883F8E20083F8804087FE8000007F800080008000800080000 -B87A:000000083F8800883F8E20083F8804087FE8000000003EF80208020802080000 -B87B:000000083F8800883F8E20083F8804087FE8000000001F080108011401620000 -B87C:000000083F8800883F8E20083F8804087FE8000008000800080008000FF80000 -B87D:000000083F8800883F8E20083F8804087FE80000000010F8101010301ECC0000 -B87E:000000083F8800883F8E20083F8804087FE800000808087F081C08220F9C0000 -B87F:000000083F8800883F8E20083F8804087FE8000003F802000200020003F80000 -B880:000000083F8800883F8E20083F8804087FE8000007F8000807F8040007F80000 -B881:000000083F8800883F8E20083F8804087FE800003EF802083E0820083E080000 -B882:000000083F8800883F8E20083F8804087FE800003EF802883E8820883EF80000 -B883:000000083F8800883F8E20083F8804087FE800003E8802883EF820883EF80000 -B884:000000083F8800883F8E20083F8804087FE800001F0801081F0810141F620000 -B885:000000083F8800883F8E20083F8804087FE800003EF802803EF820803EF80000 -B886:000000083F8800883F8E20083F8804087FE800003EFC02483E4820483EFC0000 -B887:000000083F8800883F8E20083F8804087FE800001F08017F1F1C10221F1C0000 -B888:000000083F8800883F8E20083F8804087FE8000003F802080208020803F80000 -B889:000000083F8800883F8E20083F8804087FE800000208020803F8020803F80000 -B88A:000000083F8800883F8E20083F8804087FE80000110811081F0811141F620000 -B88B:000000083F8800883F8E20083F8804087FE80000001000100010006801840000 -B88C:000000083F8800883F8E20083F8804087FE800000048004800A8011406620000 -B88D:000000083F8800883F8E20083F8804087FE80000000003F00408040803F00000 -B88E:000000083F8800883F8E20083F8804087FE8000003F80020002000D003080000 -B88F:000000083F8800883F8E20083F8804087FE80000004003F8004000A003180000 -B890:000000083F8800883F8E20083F8804087FE8000003F8000803F8000800080000 -B891:000000083F8800883F8E20083F8804087FE8000003F8020003F8020003F80000 -B892:000000083F8800883F8E20083F8804087FE8000000000FF8022002200FF80000 -B893:000000083F8800883F8E20083F8804087FE8000000800FF803E0041003E00000 -B894:0000001200123F92009200923F92201E20123F92041204127FD2001200120000 -B895:000000283FA800A83FB820283FA804287FA8000007F800080008000800080000 -B896:000000283FA800A83FB820283FA804287FA8000000003EF80208020802080000 -B897:000000283FA800A83FB820283FA804287FA8000000001F080108011401620000 -B898:000000283FA800A83FB820283FA804287FA8000008000800080008000FF80000 -B899:000000283FA800A83FB820283FA804287FA80000000010F8101010301ECC0000 -B89A:000000283FA800A83FB820283FA804287FA800000808087F081C08220F9C0000 -B89B:000000283FA800A83FB820283FA804287FA8000003F802000200020003F80000 -B89C:000000283FA800A83FB820283FA804287FA8000007F8000807F8040007F80000 -B89D:000000283FA800A83FB820283FA804287FA800003EF802083E0820083E080000 -B89E:000000283FA800A83FB820283FA804287FA800003EF802883E8820883EF80000 -B89F:000000283FA800A83FB820283FA804287FA800003E8802883EF820883EF80000 -B8A0:000000283FA800A83FB820283FA804287FA800001F0801081F0810141F620000 -B8A1:000000283FA800A83FB820283FA804287FA800003EF802803EF820803EF80000 -B8A2:000000283FA800A83FB820283FA804287FA800003EFC02483E4820483EFC0000 -B8A3:000000283FA800A83FB820283FA804287FA800001F08017F1F1C10221F1C0000 -B8A4:000000283FA800A83FB820283FA804287FA8000003F802080208020803F80000 -B8A5:000000283FA800A83FB820283FA804287FA800000208020803F8020803F80000 -B8A6:000000283FA800A83FB820283FA804287FA80000110811081F0811141F620000 -B8A7:000000283FA800A83FB820283FA804287FA80000001000100010006801840000 -B8A8:000000283FA800A83FB820283FA804287FA800000048004800A8011406620000 -B8A9:000000283FA800A83FB820283FA804287FA80000000003F00408040803F00000 -B8AA:000000283FA800A83FB820283FA804287FA8000003F80020002000D003080000 -B8AB:000000283FA800A83FB820283FA804287FA80000004003F8004000A003180000 -B8AC:000000283FA800A83FB820283FA804287FA8000003F8000803F8000800080000 -B8AD:000000283FA800A83FB820283FA804287FA8000003F8020003F8020003F80000 -B8AE:000000283FA800A83FB820283FA804287FA8000000000FF8022002200FF80000 -B8AF:000000283FA800A83FB820283FA804287FA8000000800FF803E0041003E00000 -B8B0:0000000800083F88008800883F88200820083F88040804087FE8000800080000 -B8B1:000000083F8800883F8820083F8804087FE8000007F800080008000800080000 -B8B2:000000083F8800883F8820083F8804087FE8000000003EF80208020802080000 -B8B3:000000083F8800883F8820083F8804087FE8000000001F080108011401620000 -B8B4:000000083F8800883F8820083F8804087FE8000008000800080008000FF80000 -B8B5:000000083F8800883F8820083F8804087FE80000000010F8101010301ECC0000 -B8B6:000000083F8800883F8820083F8804087FE800000808087F081C08220F9C0000 -B8B7:000000083F8800883F8820083F8804087FE8000003F802000200020003F80000 -B8B8:000000083F8800883F8820083F8804087FE8000007F8000807F8040007F80000 -B8B9:000000083F8800883F8820083F8804087FE800003EF802083E0820083E080000 -B8BA:000000083F8800883F8820083F8804087FE800003EF802883E8820883EF80000 -B8BB:000000083F8800883F8820083F8804087FE800003E8802883EF820883EF80000 -B8BC:000000083F8800883F8820083F8804087FE800001F0801081F0810141F620000 -B8BD:000000083F8800883F8820083F8804087FE800003EF802803EF820803EF80000 -B8BE:000000083F8800883F8820083F8804087FE800003EFC02483E4820483EFC0000 -B8BF:000000083F8800883F8820083F8804087FE800001F08017F1F1C10221F1C0000 -B8C0:000000083F8800883F8820083F8804087FE8000003F802080208020803F80000 -B8C1:000000083F8800883F8820083F8804087FE800000208020803F8020803F80000 -B8C2:000000083F8800883F8820083F8804087FE80000110811081F0811141F620000 -B8C3:000000083F8800883F8820083F8804087FE80000001000100010006801840000 -B8C4:000000083F8800883F8820083F8804087FE800000048004800A8011406620000 -B8C5:000000083F8800883F8820083F8804087FE80000000003F00408040803F00000 -B8C6:000000083F8800883F8820083F8804087FE8000003F80020002000D003080000 -B8C7:000000083F8800883F8820083F8804087FE80000004003F8004000A003180000 -B8C8:000000083F8800883F8820083F8804087FE8000003F8000803F8000800080000 -B8C9:000000083F8800883F8820083F8804087FE8000003F8020003F8020003F80000 -B8CA:000000083F8800883F8820083F8804087FE8000000000FF8022002200FF80000 -B8CB:000000083F8800883F8820083F8804087FE8000000800FF803E0041003E00000 -B8CC:000000001FF0001000101FF0100010001FF004400440044004407FFC00000000 -B8CD:00001FF000101FF010001FF0044004407FFC00001FF000100010001000100000 -B8CE:00001FF000101FF010001FF0044004407FFC000000003EF80208020802080000 -B8CF:00001FF000101FF010001FF0044004407FFC000000001E100210022802C40000 -B8D0:00001FF000101FF010001FF0044004407FFC000000001000100010001FF00000 -B8D1:00001FF000101FF010001FF0044004407FFC0000000020F8201020303ECC0000 -B8D2:00001FF000101FF010001FF0044004407FFC0000202021FC207020883E700000 -B8D3:00001FF000101FF010001FF0044004407FFC00001FF01000100010001FF00000 -B8D4:00001FF000101FF010001FF0044004407FFC00001FF000101FF010001FF00000 -B8D5:00001FF000101FF010001FF0044004407FFC00003EF802083E0820083E080000 -B8D6:00001FF000101FF010001FF0044004407FFC00003EF802883E8820883EF80000 -B8D7:00001FF000101FF010001FF0044004407FFC00003E8802883EF820883EF80000 -B8D8:00001FF000101FF010001FF0044004407FFC00003E1002103E1020283EC40000 -B8D9:00001FF000101FF010001FF0044004407FFC00003EF802803EF820803EF80000 -B8DA:00001FF000101FF010001FF0044004407FFC00003EFC02483E4820483EFC0000 -B8DB:00001FF000101FF010001FF0044004407FFC00003E2003FC3E7020883E700000 -B8DC:00001FF000101FF010001FF0044004407FFC00001FF01010101010101FF00000 -B8DD:00001FF000101FF010001FF0044004407FFC0000101010101FF010101FF00000 -B8DE:00001FF000101FF010001FF0044004407FFC0000222022203E2022503E880000 -B8DF:00001FF000101FF010001FF0044004407FFC000000000100010002800C400000 -B8E0:00001FF000101FF010001FF0044004407FFC00000000024002400DA033100000 -B8E1:00001FF000101FF010001FF0044004407FFC0000000007C00820082007C00000 -B8E2:00001FF000101FF010001FF0044004407FFC0000000007E00080014006200000 -B8E3:00001FF000101FF010001FF0044004407FFC0000008007E00080014006200000 -B8E4:00001FF000101FF010001FF0044004407FFC00001FF000101FF0001000100000 -B8E5:00001FF000101FF010001FF0044004407FFC00001FF010001FF010001FF00000 -B8E6:00001FF000101FF010001FF0044004407FFC000000001FF0044004401FF00000 -B8E7:00001FF000101FF010001FF0044004407FFC000001001FF007C0082007C00000 -B8E8:000000001FF0001000101FF0100010001FF000003FF801000100010001000000 -B8E9:00001FF000101FF010001FF000007FFC010001001FF000100010001000100000 -B8EA:00001FF000101FF010001FF000007FFC0100010000003EF80208020802080000 -B8EB:00001FF000101FF010001FF000007FFC0100010000001E100210022802C40000 -B8EC:00001FF000101FF010001FF0000000007FFC010001001100100010001FF00000 -B8ED:00001FF000101FF010001FF000007FFC01000100000020F8201020303ECC0000 -B8EE:00001FF000101FF010001FF000007FFC01000100202021FC207020883E700000 -B8EF:00001FF000101FF010001FF000007FFC010001001FF01000100010001FF00000 -B8F0:00001FF000101FF010001FF000007FFC010001001FF000101FF010001FF00000 -B8F1:00001FF000101FF010001FF000007FFC010001003EF802083E0820083E080000 -B8F2:00001FF000101FF010001FF000007FFC010001003EF802883E8820883EF80000 -B8F3:00001FF000101FF010001FF000007FFC010001003E8802883EF820883EF80000 -B8F4:00001FF000101FF010001FF000007FFC010001003E1002103E1020283EC40000 -B8F5:00001FF000101FF010001FF000007FFC010001003EF802803EF820803EF80000 -B8F6:00001FF000101FF010001FF000007FFC010001003EFC02483E4820483EFC0000 -B8F7:00001FF000101FF010001FF000007FFC010001003E2003FC3E7020883E700000 -B8F8:00001FF000101FF010001FF000007FFC010001001FF01010101010101FF00000 -B8F9:00001FF000101FF010001FF000007FFC01000100101010101FF010101FF00000 -B8FA:00001FF000101FF010001FF000007FFC01000100222022203E2022503E880000 -B8FB:00001FF000101FF010001FF000007FFC0100010000000100010002800C400000 -B8FC:00001FF000101FF010001FF000007FFC010001000000024002400DA033100000 -B8FD:00001FF000101FF010001FF000007FFC01000100000007C00820082007C00000 -B8FE:00001FF000101FF010001FF000007FFC01000100000007E00080014006200000 -B8FF:00001FF000101FF010001FF000007FFC01000100008007E00080014006200000 -B900:00001FF000101FF010001FF000007FFC010001001FF000101FF0001000100000 -B901:00001FF000101FF010001FF000007FFC010001001FF010001FF010001FF00000 -B902:00001FF000101FF010001FF000007FFC0100010000001FF0044004401FF00000 -B903:00001FF000101FF010001FF000007FFC0100010001001FF007C0082007C00000 -B904:000000083FC8004800483FC8200820083FC800087FE8040804F8040804080000 -B905:7F8800887F8840087F8800087FE8027802080000000007F80008000800080000 -B906:7F8800887F8840087F8800087FE802780208000000003EF80208020802080000 -B907:7F8800887F8840087F8800087FE802780208000000001F080108011401620000 -B908:7F8800887F8840087F88000800087FE80278020802081000100010001FF80000 -B909:7F8800887F8840087F8800087FE8027802080000000020F8201020303ECC0000 -B90A:7F8800887F8840087F8800087FE8027802080000202021FC207020883E700000 -B90B:7F8800887F8840087F8800087FE802780208000003F802000200020003F80000 -B90C:7F8800887F8840087F8800087FE802780208000007F8000807F8040007F80000 -B90D:7F8800887F8840087F8800087FE80278020800003EF802083E0820083E080000 -B90E:7F8800887F8840087F8800087FE80278020800003EF802883E8820883EF80000 -B90F:7F8800887F8840087F8800087FE80278020800003E8802883EF820883EF80000 -B910:7F8800887F8840087F8800087FE80278020800000F8800880F8808140FA20000 -B911:7F8800887F8840087F8800087FE80278020800003EF802803EF820803EF80000 -B912:7F8800887F8840087F8800087FE80278020800003EFC02483E4820483EFC0000 -B913:7F8800887F8840087F8800087FE80278020800003E1002FE3E3820443E380000 -B914:7F8800887F8840087F8800087FE802780208000003F802080208020803F80000 -B915:7F8800887F8840087F8800087FE80278020800000208020803F8020803F80000 -B916:7F8800887F8840087F8800087FE8027802080000210821083F0821143F620000 -B917:7F8800887F8840087F8800087FE8027802080000001000100010006801840000 -B918:7F8800887F8840087F8800087FE80278020800000048004800A8011406620000 -B919:7F8800887F8840087F8800087FE8027802080000000003F00408040803F00000 -B91A:7F8800887F8840087F8800087FE802780208000003F80020002000D003080000 -B91B:7F8800887F8840087F8800087FE8027802080000004003F8004000A003180000 -B91C:7F8800887F8840087F8800087FE802780208000003F8000803F8000800080000 -B91D:7F8800887F8840087F8800087FE802780208000003F8020003F8020003F80000 -B91E:7F8800887F8840087F8800087FE802780208000000000FF8022002200FF80000 -B91F:7F8800887F8840087F8800087FE802780208000000800FF803E0041003E00000 -B920:0000000A3FCA004A004A3FCA200A200A3FCA000A7FEA040A047A040A040A0000 -B921:7FA800A87FA840287FA800287FA805E804280000000007F80008000800080000 -B922:7FA800A87FA840287FA800287FA805E80428000000003EF80208020802080000 -B923:7FA800A87FA840287FA800287FA805E80428000000001F080108011401620000 -B924:7FA800A87FA840287FA8002800287FA8042805E804281428100010001FF80000 -B925:7FA800A87FA840287FA800287FA805E804280000000020F8201020303ECC0000 -B926:7FA800A87FA840287FA800287FA805E804280000202021FC207020883E700000 -B927:7FA800A87FA840287FA800287FA805E80428000003F802000200020003F80000 -B928:7FA800A87FA840287FA800287FA805E80428000007F8000807F8040007F80000 -B929:7FA800A87FA840287FA800287FA805E8042800003EF802083E0820083E080000 -B92A:7FA800A87FA840287FA800287FA805E8042800003EF802883E8820883EF80000 -B92B:7FA800A87FA840287FA800287FA805E8042800003E8802883EF820883EF80000 -B92C:7FA800A87FA840287FA800287FA805E8042800000F8800880F8808140FA20000 -B92D:7FA800A87FA840287FA800287FA805E8042800003EF802803EF820803EF80000 -B92E:7FA800A87FA840287FA800287FA805E8042800003EFC02483E4820483EFC0000 -B92F:7FA800A87FA840287FA800287FA805E8042800003E1002FE3E3820443E380000 -B930:7FA800A87FA840287FA800287FA805E80428000003F802080208020803F80000 -B931:7FA800A87FA840287FA800287FA805E8042800000208020803F8020803F80000 -B932:7FA800A87FA840287FA800287FA805E804280000210821083F0821143F620000 -B933:7FA800A87FA840287FA800287FA805E804280000001000100010006801840000 -B934:7FA800A87FA840287FA800287FA805E8042800000048004800A8011406620000 -B935:7FA800A87FA840287FA800287FA805E804280000000003F00408040803F00000 -B936:7FA800A87FA840287FA800287FA805E80428000003F80020002000D003080000 -B937:7FA800A87FA840287FA800287FA805E804280000004003F8004000A003180000 -B938:7FA800A87FA840287FA800287FA805E80428000003F8000803F8000800080000 -B939:7FA800A87FA840287FA800287FA805E80428000003F8020003F8020003F80000 -B93A:7FA800A87FA840287FA800287FA805E80428000000000FF8022002200FF80000 -B93B:7FA800A87FA840287FA800287FA805E80428000000800FF803E0041003E00000 -B93C:000000083FC8004800483FC8200820083FC800087FE804080408040804080000 -B93D:7F8800887F8840087F8800087FE8020802000000000007F80008000800080000 -B93E:7F8800887F8840087F8800087FE802080200000000003EF80208020802080000 -B93F:7F8800887F8840087F8800087FE802080200000000001F080108011401620000 -B940:7F8800887F8840087F88000800087FE80208020802081008100010001FF80000 -B941:7F8800887F8840087F8800087FE8020802000000000020F8201020303ECC0000 -B942:7F8800887F8840087F8800087FE8020802000000202021FC207020883E700000 -B943:7F8800887F8840087F8800087FE802080200000003F802000200020003F80000 -B944:7F8800887F8840087F8800087FE802080200000007F8000807F8040007F80000 -B945:7F8800887F8840087F8800087FE80208020000003EF802083E0820083E080000 -B946:7F8800887F8840087F8800087FE80208020000003EF802883E8820883EF80000 -B947:7F8800887F8840087F8800087FE80208020000003E8802883EF820883EF80000 -B948:7F8800887F8840087F8800087FE80208020000000F8800880F8808140FA20000 -B949:7F8800887F8840087F8800087FE80208020000003EF802803EF820803EF80000 -B94A:7F8800887F8840087F8800087FE80208020000003EFC02483E4820483EFC0000 -B94B:7F8800887F8840087F8800087FE80208020000003E1002FE3E3820443E380000 -B94C:7F8800887F8840087F8800087FE802080200000003F802080208020803F80000 -B94D:7F8800887F8840087F8800087FE80208020000000208020803F8020803F80000 -B94E:7F8800887F8840087F8800087FE8020802000000210821083F0821143F620000 -B94F:7F8800887F8840087F8800087FE8020802000000001000100010006801840000 -B950:7F8800887F8840087F8800087FE80208020000000048004800A8011406620000 -B951:7F8800887F8840087F8800087FE8020802000000000003F00408040803F00000 -B952:7F8800887F8840087F8800087FE802080200000003F80020002000D003080000 -B953:7F8800887F8840087F8800087FE8020802000000004003F8004000A003180000 -B954:7F8800887F8840087F8800087FE802080200000003F8000803F8000800080000 -B955:7F8800887F8840087F8800087FE802080200000003F8020003F8020003F80000 -B956:7F8800887F8840087F8800087FE802080200000000000FF8022002200FF80000 -B957:7F8800887F8840087F8800087FE802080200000000800FF803E0041003E00000 -B958:000000001FF0001000101FF0100010001FF000007FFC04400440044004400000 -B959:00001FF000101FF010001FF000007FFC044004401FF000100010001000100000 -B95A:00001FF000101FF010001FF000007FFC0440044000003EF80208020802080000 -B95B:00001FF000101FF010001FF000007FFC0440044000001E100210022802C40000 -B95C:00001FF000101FF010001FF0000000007FFC044004401440100010001FF00000 -B95D:00001FF000101FF010001FF000007FFC04400440000020F8201020303ECC0000 -B95E:00001FF000101FF010001FF000007FFC04400440202021FC207020883E700000 -B95F:00001FF000101FF010001FF000007FFC044004401FF01000100010001FF00000 -B960:00001FF000101FF010001FF000007FFC044004401FF000101FF010001FF00000 -B961:00001FF000101FF010001FF000007FFC044004403EF802083E0820083E080000 -B962:00001FF000101FF010001FF000007FFC044004403EF802883E8820883EF80000 -B963:00001FF000101FF010001FF000007FFC044004403E8802883EF820883EF80000 -B964:00001FF000101FF010001FF000007FFC044004403E1002103E1020283EC40000 -B965:00001FF000101FF010001FF000007FFC044004403EF802803EF820803EF80000 -B966:00001FF000101FF010001FF000007FFC044004403EFC02483E4820483EFC0000 -B967:00001FF000101FF010001FF000007FFC044004403E2003FC3E7020883E700000 -B968:00001FF000101FF010001FF000007FFC044004401FF01010101010101FF00000 -B969:00001FF000101FF010001FF000007FFC04400440101010101FF010101FF00000 -B96A:00001FF000101FF010001FF000007FFC04400440222022203E2022503E880000 -B96B:00001FF000101FF010001FF000007FFC0440044000000100010002800C400000 -B96C:00001FF000101FF010001FF000007FFC044004400000024002400DA033100000 -B96D:00001FF000101FF010001FF000007FFC04400440000007C00820082007C00000 -B96E:00001FF000101FF010001FF000007FFC04400440000007E00080014006200000 -B96F:00001FF000101FF010001FF000007FFC04400440008007E00080014006200000 -B970:00001FF000101FF010001FF000007FFC044004401FF000101FF0001000100000 -B971:00001FF000101FF010001FF000007FFC044004401FF010001FF010001FF00000 -B972:00001FF000101FF010001FF000007FFC0440044000001FF0044004401FF00000 -B973:00001FF000101FF010001FF000007FFC0440044001001FF007C0082007C00000 -B974:000000001FF0001000101FF0100010001FF0000000007FFC0000000000000000 -B975:00001FF000101FF010001FF0000000007FFC00001FF000100010001000100000 -B976:00001FF000101FF010001FF0000000007FFC000000003EF80208020802080000 -B977:00001FF000101FF010001FF0000000007FFC000000001E100210022802C40000 -B978:00001FF000101FF010001FF0000000007FFC000000001000100010001FF00000 -B979:00001FF000101FF010001FF0000000007FFC0000000020F8201020303ECC0000 -B97A:00001FF000101FF010001FF0000000007FFC0000202021FC207020883E700000 -B97B:00001FF000101FF010001FF0000000007FFC00001FF01000100010001FF00000 -B97C:00001FF000101FF010001FF0000000007FFC00001FF000101FF010001FF00000 -B97D:00001FF000101FF010001FF0000000007FFC00003EF802083E0820083E080000 -B97E:00001FF000101FF010001FF0000000007FFC00003EF802883E8820883EF80000 -B97F:00001FF000101FF010001FF0000000007FFC00003E8802883EF820883EF80000 -B980:00001FF000101FF010001FF0000000007FFC00003E1002103E1020283EC40000 -B981:00001FF000101FF010001FF0000000007FFC00003EF802803EF820803EF80000 -B982:00001FF000101FF010001FF0000000007FFC00003EFC02483E4820483EFC0000 -B983:00001FF000101FF010001FF0000000007FFC00003E2003FC3E7020883E700000 -B984:00001FF000101FF010001FF0000000007FFC00001FF01010101010101FF00000 -B985:00001FF000101FF010001FF0000000007FFC0000101010101FF010101FF00000 -B986:00001FF000101FF010001FF0000000007FFC0000222022203E2022503E880000 -B987:00001FF000101FF010001FF0000000007FFC000000000100010002800C400000 -B988:00001FF000101FF010001FF0000000007FFC00000000024002400DA033100000 -B989:00001FF000101FF010001FF0000000007FFC0000000007C00820082007C00000 -B98A:00001FF000101FF010001FF0000000007FFC0000000007E00080014006200000 -B98B:00001FF000101FF010001FF0000000007FFC0000008007E00080014006200000 -B98C:00001FF000101FF010001FF0000000007FFC00001FF000101FF0001000100000 -B98D:00001FF000101FF010001FF0000000007FFC00001FF010001FF010001FF00000 -B98E:00001FF000101FF010001FF0000000007FFC000000001FF0044004401FF00000 -B98F:00001FF000101FF010001FF0000000007FFC000001001FF007C0082007C00000 -B990:0000000800083F88008800883F88200820083F8800087FE80008000800080000 -B991:000000083F8800883F8820083F8800087FE8000007F800080008000800080000 -B992:000000083F8800883F8820083F8800087FE8000000003EF80208020802080000 -B993:000000083F8800883F8820083F8800087FE8000000001F080108011401620000 -B994:000000083F8800883F8820083F8800087FE8000008000800080008000FF80000 -B995:000000083F8800883F8820083F8800087FE80000000010F8101010301ECC0000 -B996:000000083F8800883F8820083F8800087FE800000808087F081C08220F9C0000 -B997:000000083F8800883F8820083F8800087FE8000003F802000200020003F80000 -B998:000000083F8800883F8820083F8800087FE8000007F8000807F8040007F80000 -B999:000000083F8800883F8820083F8800087FE800003EF802083E0820083E080000 -B99A:000000083F8800883F8820083F8800087FE800003EF802883E8820883EF80000 -B99B:000000083F8800883F8820083F8800087FE800003E8802883EF820883EF80000 -B99C:000000083F8800883F8820083F8800087FE800001F0801081F0810141F620000 -B99D:000000083F8800883F8820083F8800087FE800003EF802803EF820803EF80000 -B99E:000000083F8800883F8820083F8800087FE800003EFC02483E4820483EFC0000 -B99F:000000083F8800883F8820083F8800087FE800001F08017F1F1C10221F1C0000 -B9A0:000000083F8800883F8820083F8800087FE8000003F802080208020803F80000 -B9A1:000000083F8800883F8820083F8800087FE800000208020803F8020803F80000 -B9A2:000000083F8800883F8820083F8800087FE80000110811081F0811141F620000 -B9A3:000000083F8800883F8820083F8800087FE80000001000100010006801840000 -B9A4:000000083F8800883F8820083F8800087FE800000048004800A8011406620000 -B9A5:000000083F8800883F8820083F8800087FE80000000003F00408040803F00000 -B9A6:000000083F8800883F8820083F8800087FE8000003F80020002000D003080000 -B9A7:000000083F8800883F8820083F8800087FE80000004003F8004000A003180000 -B9A8:000000083F8800883F8820083F8800087FE8000003F8000803F8000800080000 -B9A9:000000083F8800883F8820083F8800087FE8000003F8020003F8020003F80000 -B9AA:000000083F8800883F8820083F8800087FE8000000000FF8022002200FF80000 -B9AB:000000083F8800883F8820083F8800087FE8000000800FF803E0041003E00000 -B9AC:00000000000800083F88008800883F882008200820083F880008000800080000 -B9AD:0000000800083F0801083F0820083F0800080000000007F80008000800080000 -B9AE:0000000800083F0801083F0820083F080008000000003EF80208020802080000 -B9AF:0000000800083F0801083F0820083F080008000000001F080108011401620000 -B9B0:0000000800083F0801083F0820083F080008000800001000100010001FF80000 -B9B1:0000000800083F0801083F0820083F0800080000000020F8201020303ECC0000 -B9B2:0000000800083F0801083F0820083F0800080000202021FC207020883E700000 -B9B3:0000000800083F0801083F0820083F080008000003F802000200020003F80000 -B9B4:0000000800083F0801083F0820083F080008000007F8000807F8040007F80000 -B9B5:0000000800083F0801083F0820083F08000800003EF802083E0820083E080000 -B9B6:0000000800083F0801083F0820083F08000800003EF802883E8820883EF80000 -B9B7:0000000800083F0801083F0820083F08000800003E8802883EF820883EF80000 -B9B8:0000000800083F0801083F0820083F08000800000F8800880F8808140FA20000 -B9B9:0000000800083F0801083F0820083F08000800003EF802803EF820803EF80000 -B9BA:0000000800083F0801083F0820083F08000800003EFC02483E4820483EFC0000 -B9BB:0000000800083F0801083F0820083F08000800003E1002FE3E3820443E380000 -B9BC:0000000800083F0801083F0820083F080008000003F802080208020803F80000 -B9BD:0000000800083F0801083F0820083F08000800000208020803F8020803F80000 -B9BE:0000000800083F0801083F0820083F0800080000210821083F0821143F620000 -B9BF:0000000800083F0801083F0820083F0800080000001000100010006801840000 -B9C0:0000000800083F0801083F0820083F08000800000048004800A8011406620000 -B9C1:0000000800083F0801083F0820083F0800080000000003F00408040803F00000 -B9C2:0000000800083F0801083F0820083F080008000003F80020002000D003080000 -B9C3:0000000800083F0801083F0820083F0800080000004003F8004000A003180000 -B9C4:0000000800083F0801083F0820083F080008000003F8000803F8000800080000 -B9C5:0000000800083F0801083F0820083F080008000003F8020003F8020003F80000 -B9C6:0000000800083F0801083F0820083F080008000000000FF8022002200FF80000 -B9C7:0000000800083F0801083F0820083F080008000000800FF803E0041003E00000 -B9C8:00000000001000107F9040904090409E4090409040907F900010001000100000 -B9C9:000000087E0842084208420E42087E080008000007F800080008000800080000 -B9CA:000000087E0842084208420E42087E080008000000003EF80208020802080000 -B9CB:000000087E0842084208420E42087E080008000000001F080108011401620000 -B9CC:000000087E0842084208420E42087E080008000808000800080008000FF80000 -B9CD:000000087E0842084208420E42087E0800080000000010F8101010301ECC0000 -B9CE:000000087E0842084208420E42087E08000800000808087F081C08220F9C0000 -B9CF:000000087E0842084208420E42087E080008000003F802000200020003F80000 -B9D0:000000087E0842084208420E42087E080008000007F8000807F8040007F80000 -B9D1:000000087E0842084208420E42087E08000800003EF802083E0820083E080000 -B9D2:000000087E0842084208420E42087E08000800003EF802883E8820883EF80000 -B9D3:000000087E0842084208420E42087E08000800003E8802883EF820883EF80000 -B9D4:000000087E0842084208420E42087E08000800001F0801081F0810141F620000 -B9D5:000000087E0842084208420E42087E08000800003EF802803EF820803EF80000 -B9D6:000000087E0842084208420E42087E08000800003EFC02483E4820483EFC0000 -B9D7:000000087E0842084208420E42087E08000800001F08017F1F1C10221F1C0000 -B9D8:000000087E0842084208420E42087E080008000003F802080208020803F80000 -B9D9:000000087E0842084208420E42087E08000800000208020803F8020803F80000 -B9DA:000000087E0842084208420E42087E0800080000110811081F0811141F620000 -B9DB:000000087E0842084208420E42087E0800080000001000100010006801840000 -B9DC:000000087E0842084208420E42087E08000800000048004800A8011406620000 -B9DD:000000087E0842084208420E42087E0800080000000003F00408040803F00000 -B9DE:000000087E0842084208420E42087E080008000003F80020002000D003080000 -B9DF:000000087E0842084208420E42087E0800080000004003F8004000A003180000 -B9E0:000000087E0842084208420E42087E080008000003F8000803F8000800080000 -B9E1:000000087E0842084208420E42087E080008000003F8020003F8020003F80000 -B9E2:000000087E0842084208420E42087E080008000000000FF8022002200FF80000 -B9E3:000000087E0842084208420E42087E080008000000800FF803E0041003E00000 -B9E4:00000000001200127F9240924092409E4092409240927F920012001200120000 -B9E5:000000287E2842284228423842287E280028000007F800080008000800080000 -B9E6:000000287E2842284228423842287E280028000000003EF80208020802080000 -B9E7:000000287E2842284228423842287E280028000000003E100210022802C40000 -B9E8:000000287E2842284228423842287E280028002808000800080008000FF80000 -B9E9:000000287E2842284228423842287E2800280000000020F8201020303ECC0000 -B9EA:000000287E2842284228423842287E2800280000202021FC207020883E700000 -B9EB:000000287E2842284228423842287E280028000003F802000200020003F80000 -B9EC:000000287E2842284228423842287E280028000007F8000807F8040007F80000 -B9ED:000000287E2842284228423842287E28002800003EF802083E0820083E080000 -B9EE:000000287E2842284228423842287E28002800003EF802883E8820883EF80000 -B9EF:000000287E2842284228423842287E28002800003E8802883EF820883EF80000 -B9F0:000000287E2842284228423842287E28002800001F0801081F0810141F620000 -B9F1:000000287E2842284228423842287E28002800003EF802803EF820803EF80000 -B9F2:000000287E2842284228423842287E28002800003EFC02483E4820483EFC0000 -B9F3:000000287E2842284228423842287E28002800003E1002FE3E3820443E380000 -B9F4:000000287E2842284228423842287E280028000003F802080208020803F80000 -B9F5:000000287E2842284228423842287E28002800000208020803F8020803F80000 -B9F6:000000287E2842284228423842287E2800280000110811081F0811141F620000 -B9F7:000000287E2842284228423842287E2800280000000800080008003400C20000 -B9F8:000000287E2842284228423842287E28002800000048004800A8011406620000 -B9F9:000000287E2842284228423842287E2800280000000001F00208020801F00000 -B9FA:000000287E2842284228423842287E280028000003F80020002000D003080000 -B9FB:000000287E2842284228423842287E2800280000004003F8004000A003180000 -B9FC:000000287E2842284228423842287E280028000003F8000803F8000800080000 -B9FD:000000287E2842284228423842287E280028000003F8020003F8020003F80000 -B9FE:000000287E2842284228423842287E280028000000000FF8022002200FF80000 -B9FF:000000287E2842284228423842287E280028000000800FF803E0041003E00000 -BA00:00000000001000107F904090409E40904090409E40907F900010001000100000 -BA01:000000087E084208420E4208420E7E080008000007F800080008000800080000 -BA02:000000087E084208420E4208420E7E080008000000003EF80208020802080000 -BA03:000000087E084208420E4208420E7E080008000000001F080108011401620000 -BA04:000000087E084208420E4208420E7E080008000008000800080008000FF80000 -BA05:000000087E084208420E4208420E7E0800080000000010F8101010301ECC0000 -BA06:000000087E084208420E4208420E7E08000800000808087F081C08220F9C0000 -BA07:000000087E084208420E4208420E7E080008000003F802000200020003F80000 -BA08:000000087E084208420E4208420E7E080008000007F8000807F8040007F80000 -BA09:000000087E084208420E4208420E7E08000800003EF802083E0820083E080000 -BA0A:000000087E084208420E4208420E7E08000800003EF802883E8820883EF80000 -BA0B:000000087E084208420E4208420E7E08000800003E8802883EF820883EF80000 -BA0C:000000087E084208420E4208420E7E08000800001F0801081F0810141F620000 -BA0D:000000087E084208420E4208420E7E08000800003EF802803EF820803EF80000 -BA0E:000000087E084208420E4208420E7E08000800003EFC02483E4820483EFC0000 -BA0F:000000087E084208420E4208420E7E08000800001F08017F1F1C10221F1C0000 -BA10:000000087E084208420E4208420E7E080008000003F802080208020803F80000 -BA11:000000087E084208420E4208420E7E08000800000208020803F8020803F80000 -BA12:000000087E084208420E4208420E7E0800080000110811081F0811141F620000 -BA13:000000087E084208420E4208420E7E0800080000001000100010006801840000 -BA14:000000087E084208420E4208420E7E08000800000048004800A8011406620000 -BA15:000000087E084208420E4208420E7E0800080000000003F00408040803F00000 -BA16:000000087E084208420E4208420E7E080008000003F80020002000D003080000 -BA17:000000087E084208420E4208420E7E0800080000004003F8004000A003180000 -BA18:000000087E084208420E4208420E7E080008000003F8000803F8000800080000 -BA19:000000087E084208420E4208420E7E080008000003F8020003F8020003F80000 -BA1A:000000087E084208420E4208420E7E080008000000000FF8022002200FF80000 -BA1B:000000087E084208420E4208420E7E080008000000800FF803E0041003E00000 -BA1C:00000000001200127F924092409E40924092409E40927F920012001200120000 -BA1D:000000287E2842284238422842387E280028000007F800080008000800080000 -BA1E:000000287E2842284238422842387E280028000000003EF80208020802080000 -BA1F:000000287E2842284238422842387E280028000000003E100210022802C40000 -BA20:000000287E2842284238422842387E280028002808000800080008000FF80000 -BA21:000000287E2842284238422842387E2800280000000020F8201020303ECC0000 -BA22:000000287E2842284238422842387E2800280000202021FC207020883E700000 -BA23:000000287E2842284238422842387E280028000003F802000200020003F80000 -BA24:000000287E2842284238422842387E280028000007F8000807F8040007F80000 -BA25:000000287E2842284238422842387E28002800003EF802083E0820083E080000 -BA26:000000287E2842284238422842387E28002800003EF802883E8820883EF80000 -BA27:000000287E2842284238422842387E28002800003E8802883EF820883EF80000 -BA28:000000287E2842284238422842387E28002800001F0801081F0810141F620000 -BA29:000000287E2842284238422842387E28002800003EF802803EF820803EF80000 -BA2A:000000287E2842284238422842387E28002800003EFC02483E4820483EFC0000 -BA2B:000000287E2842284238422842387E28002800003E1002FE3E3820443E380000 -BA2C:000000287E2842284238422842387E280028000003F802080208020803F80000 -BA2D:000000287E2842284238422842387E28002800000208020803F8020803F80000 -BA2E:000000287E2842284238422842387E2800280000110811081F0811141F620000 -BA2F:000000287E2842284238422842387E2800280000000800080008003400C20000 -BA30:000000287E2842284238422842387E28002800000048004800A8011406620000 -BA31:000000287E2842284238422842387E2800280000000001F00208020801F00000 -BA32:000000287E2842284238422842387E280028000003F80020002000D003080000 -BA33:000000287E2842284238422842387E2800280000004003F8004000A003180000 -BA34:000000287E2842284238422842387E280028000003F8000803F8000800080000 -BA35:000000287E2842284238422842387E280028000003F8020003F8020003F80000 -BA36:000000287E2842284238422842387E280028000000000FF8022002200FF80000 -BA37:000000287E2842284238422842387E280028000000800FF803E0041003E00000 -BA38:00000000000200027F8240824082409E4082408240827F820002000200020000 -BA39:000000087E0842084208423842087E0800080000000007F80008000800080000 -BA3A:000000087E0842084208423842087E080008000000003EF80208020802080000 -BA3B:000000087E0842084208423842087E080008000000001F080108011401620000 -BA3C:000000087E0842084208423842087E080008000000001000100010001FF80000 -BA3D:000000087E0842084208423842087E0800080000000020F8201020303ECC0000 -BA3E:000000087E0842084208423842087E0800080000202021FC207020883E700000 -BA3F:000000087E0842084208423842087E080008000003F802000200020003F80000 -BA40:000000087E0842084208423842087E080008000007F8000807F8040007F80000 -BA41:000000087E0842084208423842087E08000800003EF802083E0820083E080000 -BA42:000000087E0842084208423842087E08000800003EF802883E8820883EF80000 -BA43:000000087E0842084208423842087E08000800003E8802883EF820883EF80000 -BA44:000000087E0842084208423842087E08000800000F8800880F8808140FA20000 -BA45:000000087E0842084208423842087E08000800003EF802803EF820803EF80000 -BA46:000000087E0842084208423842087E08000800003EFC02483E4820483EFC0000 -BA47:000000087E0842084208423842087E08000800003E1002FE3E3820443E380000 -BA48:000000087E0842084208423842087E080008000003F802080208020803F80000 -BA49:000000087E0842084208423842087E08000800000208020803F8020803F80000 -BA4A:000000087E0842084208423842087E0800080000210821083F0821143F620000 -BA4B:000000087E0842084208423842087E0800080000001000100010006801840000 -BA4C:000000087E0842084208423842087E08000800000048004800A8011406620000 -BA4D:000000087E0842084208423842087E0800080000000003F00408040803F00000 -BA4E:000000087E0842084208423842087E080008000003F80020002000D003080000 -BA4F:000000087E0842084208423842087E0800080000004003F8004000A003180000 -BA50:000000087E0842084208423842087E080008000003F8000803F8000800080000 -BA51:000000087E0842084208423842087E080008000003F8020003F8020003F80000 -BA52:000000087E0842084208423842087E080008000000000FF8022002200FF80000 -BA53:000000087E0842084208423842087E080008000000800FF803E0041003E00000 -BA54:00000000000A000A7F8A408A408A40BA408A408A408A7F8A000A000A000A0000 -BA55:000000287E284228422842E842287E280028000007F800080008000800080000 -BA56:000000287E284228422842E842287E280028000000003EF80208020802080000 -BA57:000000287E284228422842E842287E280028000000003E100210022802C40000 -BA58:000000287E284228422842E842287E280028000008000800080008000FF80000 -BA59:000000287E284228422842E842287E2800280000000020F8201020303ECC0000 -BA5A:000000287E284228422842E842287E2800280000202021FC207020883E700000 -BA5B:000000287E284228422842E842287E280028000003F802000200020003F80000 -BA5C:000000287E284228422842E842287E280028000007F8000807F8040007F80000 -BA5D:000000287E284228422842E842287E28002800003EF802083E0820083E080000 -BA5E:000000287E284228422842E842287E28002800003EF802883E8820883EF80000 -BA5F:000000287E284228422842E842287E28002800003E8802883EF820883EF80000 -BA60:000000287E284228422842E842287E28002800001F0801081F0810141F620000 -BA61:000000287E284228422842E842287E28002800003EF802803EF820803EF80000 -BA62:000000287E284228422842E842287E28002800003EFC02483E4820483EFC0000 -BA63:000000287E284228422842E842287E28002800003E1002FE3E3820443E380000 -BA64:000000287E284228422842E842287E280028000003F802080208020803F80000 -BA65:000000287E284228422842E842287E28002800000208020803F8020803F80000 -BA66:000000287E284228422842E842287E2800280000110811081F0811141F620000 -BA67:000000287E284228422842E842287E2800280000000800080008003400C20000 -BA68:000000287E284228422842E842287E28002800000048004800A8011406620000 -BA69:000000287E284228422842E842287E2800280000000001F00208020801F00000 -BA6A:000000287E284228422842E842287E280028000003F80020002000D003080000 -BA6B:000000287E284228422842E842287E2800280000004003F8004000A003180000 -BA6C:000000287E284228422842E842287E280028000003F8000803F8000800080000 -BA6D:000000287E284228422842E842287E280028000003F8020003F8020003F80000 -BA6E:000000287E284228422842E842287E280028000000000FF8022002200FF80000 -BA6F:000000287E284228422842E842287E280028000000800FF803E0041003E00000 -BA70:00000000000200027F824082409E40824082409E40827F820002000200020000 -BA71:000000087E0842084238420842387E0800080000000007F80008000800080000 -BA72:000000087E0842084238420842387E080008000000003EF80208020802080000 -BA73:000000087E0842084238420842387E080008000000001F080108011401620000 -BA74:000000087E0842084238420842387E080008000800001000100010001FF80000 -BA75:000000087E0842084238420842387E0800080000000020F8201020303ECC0000 -BA76:000000087E0842084238420842387E0800080000202021FC207020883E700000 -BA77:000000087E0842084238420842387E080008000003F802000200020003F80000 -BA78:000000087E0842084238420842387E080008000007F8000807F8040007F80000 -BA79:000000087E0842084238420842387E08000800003EF802083E0820083E080000 -BA7A:000000087E0842084238420842387E08000800003EF802883E8820883EF80000 -BA7B:000000087E0842084238420842387E08000800003E8802883EF820883EF80000 -BA7C:000000087E0842084238420842387E08000800000F8800880F8808140FA20000 -BA7D:000000087E0842084238420842387E08000800003EF802803EF820803EF80000 -BA7E:000000087E0842084238420842387E08000800003EFC02483E4820483EFC0000 -BA7F:000000087E0842084238420842387E08000800003E1002FE3E3820443E380000 -BA80:000000087E0842084238420842387E080008000003F802080208020803F80000 -BA81:000000087E0842084238420842387E08000800000208020803F8020803F80000 -BA82:000000087E0842084238420842387E0800080000210821083F0821143F620000 -BA83:000000087E0842084238420842387E0800080000001000100010006801840000 -BA84:000000087E0842084238420842387E08000800000048004800A8011406620000 -BA85:000000087E0842084238420842387E0800080000000003F00408040803F00000 -BA86:000000087E0842084238420842387E080008000003F80020002000D003080000 -BA87:000000087E0842084238420842387E0800080000004003F8004000A003180000 -BA88:000000087E0842084238420842387E080008000003F8000803F8000800080000 -BA89:000000087E0842084238420842387E080008000003F8020003F8020003F80000 -BA8A:000000087E0842084238420842387E080008000000000FF8022002200FF80000 -BA8B:000000087E0842084238420842387E080008000000800FF803E0041003E00000 -BA8C:00000000000A000A7F8A408A40BA408A408A40BA408A7F8A000A000A000A0000 -BA8D:000000287E28422842E8422842E87E280028000007F800080008000800080000 -BA8E:000000287E28422842E8422842E87E280028000000003EF80208020802080000 -BA8F:000000287E28422842E8422842E87E280028000000003E100210022802C40000 -BA90:000000287E28422842E8422842E87E280028002808000800080008000FF80000 -BA91:000000287E28422842E8422842E87E2800280000000020F8201020303ECC0000 -BA92:000000287E28422842E8422842E87E2800280000202021FC207020883E700000 -BA93:000000287E28422842E8422842E87E280028000003F802000200020003F80000 -BA94:000000287E28422842E8422842E87E280028000007F8000807F8040007F80000 -BA95:000000287E28422842E8422842E87E28002800003EF802083E0820083E080000 -BA96:000000287E28422842E8422842E87E28002800003EF802883E8820883EF80000 -BA97:000000287E28422842E8422842E87E28002800003E8802883EF820883EF80000 -BA98:000000287E28422842E8422842E87E28002800001F0801081F0810141F620000 -BA99:000000287E28422842E8422842E87E28002800003EF802803EF820803EF80000 -BA9A:000000287E28422842E8422842E87E28002800003EFC02483E4820483EFC0000 -BA9B:000000287E28422842E8422842E87E28002800003E1002FE3E3820443E380000 -BA9C:000000287E28422842E8422842E87E280028000003F802080208020803F80000 -BA9D:000000287E28422842E8422842E87E28002800000208020803F8020803F80000 -BA9E:000000287E28422842E8422842E87E2800280000110811081F0811141F620000 -BA9F:000000287E28422842E8422842E87E2800280000000800080008003400C20000 -BAA0:000000287E28422842E8422842E87E28002800000048004800A8011406620000 -BAA1:000000287E28422842E8422842E87E2800280000000001F00208020801F00000 -BAA2:000000287E28422842E8422842E87E280028000003F80020002000D003080000 -BAA3:000000287E28422842E8422842E87E2800280000004003F8004000A003180000 -BAA4:000000287E28422842E8422842E87E280028000003F8000803F8000800080000 -BAA5:000000287E28422842E8422842E87E280028000003F8020003F8020003F80000 -BAA6:000000287E28422842E8422842E87E280028000000000FF8022002200FF80000 -BAA7:000000287E28422842E8422842E87E280028000000800FF803E0041003E00000 -BAA8:000000003FF820082008200820083FF8000000000100010001007FFC00000000 -BAA9:00001FF01010101010101FF0010001007FFC00001FF000100010001000100000 -BAAA:00001FF01010101010101FF0010001007FFC000000003EF80208020802080000 -BAAB:00001FF01010101010101FF0010001007FFC000000001E100210022802C40000 -BAAC:00001FF01010101010101FF0010001007FFC000000001000100010001FF00000 -BAAD:00001FF01010101010101FF0010001007FFC0000000020F8201020303ECC0000 -BAAE:00001FF01010101010101FF0010001007FFC0000202021FC207020883E700000 -BAAF:00001FF01010101010101FF0010001007FFC00001FF01000100010001FF00000 -BAB0:00001FF01010101010101FF0010001007FFC00001FF000101FF010001FF00000 -BAB1:00001FF01010101010101FF0010001007FFC00003EF802083E0820083E080000 -BAB2:00001FF01010101010101FF0010001007FFC00003EF802883E8820883EF80000 -BAB3:00001FF01010101010101FF0010001007FFC00003E8802883EF820883EF80000 -BAB4:00001FF01010101010101FF0010001007FFC00003E1002103E1020283EC40000 -BAB5:00001FF01010101010101FF0010001007FFC00003EF802803EF820803EF80000 -BAB6:00001FF01010101010101FF0010001007FFC00003EFC02483E4820483EFC0000 -BAB7:00001FF01010101010101FF0010001007FFC00003E2003FC3E7020883E700000 -BAB8:00001FF01010101010101FF0010001007FFC00001FF01010101010101FF00000 -BAB9:00001FF01010101010101FF0010001007FFC0000101010101FF010101FF00000 -BABA:00001FF01010101010101FF0010001007FFC0000222022203E2022503E880000 -BABB:00001FF01010101010101FF0010001007FFC000000000100010002800C400000 -BABC:00001FF01010101010101FF0010001007FFC00000000024002400DA033100000 -BABD:00001FF01010101010101FF0010001007FFC0000000007C00820082007C00000 -BABE:00001FF01010101010101FF0010001007FFC0000000007E00080014006200000 -BABF:00001FF01010101010101FF0010001007FFC0000008007E00080014006200000 -BAC0:00001FF01010101010101FF0010001007FFC00001FF000101FF0001000100000 -BAC1:00001FF01010101010101FF0010001007FFC00001FF010001FF010001FF00000 -BAC2:00001FF01010101010101FF0010001007FFC000000001FF0044004401FF00000 -BAC3:00001FF01010101010101FF0010001007FFC000001001FF007C0082007C00000 -BAC4:0000001000103F90209020902090209E20903F90041004107FD0001000100000 -BAC5:000000083F882088208E20883F8804087FE8000007F800080008000800080000 -BAC6:000000083F882088208E20883F8804087FE8000000003EF80208020802080000 -BAC7:000000083F882088208E20883F8804087FE8000000001F080108011401620000 -BAC8:000000083F882088208E20883F8804087FE8000008000800080008000FF80000 -BAC9:000000083F882088208E20883F8804087FE80000000010F8101010301ECC0000 -BACA:000000083F882088208E20883F8804087FE800000808087F081C08220F9C0000 -BACB:000000083F882088208E20883F8804087FE8000003F802000200020003F80000 -BACC:000000083F882088208E20883F8804087FE8000007F8000807F8040007F80000 -BACD:000000083F882088208E20883F8804087FE800003EF802083E0820083E080000 -BACE:000000083F882088208E20883F8804087FE800003EF802883E8820883EF80000 -BACF:000000083F882088208E20883F8804087FE800003E8802883EF820883EF80000 -BAD0:000000083F882088208E20883F8804087FE800001F0801081F0810141F620000 -BAD1:000000083F882088208E20883F8804087FE800003EF802803EF820803EF80000 -BAD2:000000083F882088208E20883F8804087FE800003EFC02483E4820483EFC0000 -BAD3:000000083F882088208E20883F8804087FE800001F08017F1F1C10221F1C0000 -BAD4:000000083F882088208E20883F8804087FE8000003F802080208020803F80000 -BAD5:000000083F882088208E20883F8804087FE800000208020803F8020803F80000 -BAD6:000000083F882088208E20883F8804087FE80000110811081F0811141F620000 -BAD7:000000083F882088208E20883F8804087FE80000001000100010006801840000 -BAD8:000000083F882088208E20883F8804087FE800000048004800A8011406620000 -BAD9:000000083F882088208E20883F8804087FE80000000003F00408040803F00000 -BADA:000000083F882088208E20883F8804087FE8000003F80020002000D003080000 -BADB:000000083F882088208E20883F8804087FE80000004003F8004000A003180000 -BADC:000000083F882088208E20883F8804087FE8000003F8000803F8000800080000 -BADD:000000083F882088208E20883F8804087FE8000003F8020003F8020003F80000 -BADE:000000083F882088208E20883F8804087FE8000000000FF8022002200FF80000 -BADF:000000083F882088208E20883F8804087FE8000000800FF803E0041003E00000 -BAE0:0000001200123F92209220922092209E20923F92041204127FD2001200120000 -BAE1:000000283FA820A820B820A83FA804287FA8000007F800080008000800080000 -BAE2:000000283FA820A820B820A83FA804287FA8000000003EF80208020802080000 -BAE3:000000283FA820A820B820A83FA804287FA8000000001F080108011401620000 -BAE4:000000283FA820A820B820A83FA804287FA8000008000800080008000FF80000 -BAE5:000000283FA820A820B820A83FA804287FA80000000010F8101010301ECC0000 -BAE6:000000283FA820A820B820A83FA804287FA800000808087F081C08220F9C0000 -BAE7:000000283FA820A820B820A83FA804287FA8000003F802000200020003F80000 -BAE8:000000283FA820A820B820A83FA804287FA8000007F8000807F8040007F80000 -BAE9:000000283FA820A820B820A83FA804287FA800003EF802083E0820083E080000 -BAEA:000000283FA820A820B820A83FA804287FA800003EF802883E8820883EF80000 -BAEB:000000283FA820A820B820A83FA804287FA800003E8802883EF820883EF80000 -BAEC:000000283FA820A820B820A83FA804287FA800001F0801081F0810141F620000 -BAED:000000283FA820A820B820A83FA804287FA800003EF802803EF820803EF80000 -BAEE:000000283FA820A820B820A83FA804287FA800003EFC02483E4820483EFC0000 -BAEF:000000283FA820A820B820A83FA804287FA800001F08017F1F1C10221F1C0000 -BAF0:000000283FA820A820B820A83FA804287FA8000003F802080208020803F80000 -BAF1:000000283FA820A820B820A83FA804287FA800000208020803F8020803F80000 -BAF2:000000283FA820A820B820A83FA804287FA80000110811081F0811141F620000 -BAF3:000000283FA820A820B820A83FA804287FA80000001000100010006801840000 -BAF4:000000283FA820A820B820A83FA804287FA800000048004800A8011406620000 -BAF5:000000283FA820A820B820A83FA804287FA80000000003F00408040803F00000 -BAF6:000000283FA820A820B820A83FA804287FA8000003F80020002000D003080000 -BAF7:000000283FA820A820B820A83FA804287FA80000004003F8004000A003180000 -BAF8:000000283FA820A820B820A83FA804287FA8000003F8000803F8000800080000 -BAF9:000000283FA820A820B820A83FA804287FA8000003F8020003F8020003F80000 -BAFA:000000283FA820A820B820A83FA804287FA8000000000FF8022002200FF80000 -BAFB:000000283FA820A820B820A83FA804287FA8000000800FF803E0041003E00000 -BAFC:0000000800083F88208820882088208820883F88040804087FE8000800080000 -BAFD:000000083F882088208820883F8804087FE8000007F800080008000800080000 -BAFE:000000083F882088208820883F8804087FE8000000003EF80208020802080000 -BAFF:000000083F882088208820883F8804087FE8000000001F080108011401620000 -BB00:000000083F882088208820883F8804087FE8000008000800080008000FF80000 -BB01:000000083F882088208820883F8804087FE80000000010F8101010301ECC0000 -BB02:000000083F882088208820883F8804087FE800000808087F081C08220F9C0000 -BB03:000000083F882088208820883F8804087FE8000003F802000200020003F80000 -BB04:000000083F882088208820883F8804087FE8000007F8000807F8040007F80000 -BB05:000000083F882088208820883F8804087FE800003EF802083E0820083E080000 -BB06:000000083F882088208820883F8804087FE800003EF802883E8820883EF80000 -BB07:000000083F882088208820883F8804087FE800003E8802883EF820883EF80000 -BB08:000000083F882088208820883F8804087FE800001F0801081F0810141F620000 -BB09:000000083F882088208820883F8804087FE800003EF802803EF820803EF80000 -BB0A:000000083F882088208820883F8804087FE800003EFC02483E4820483EFC0000 -BB0B:000000083F882088208820883F8804087FE800001F08017F1F1C10221F1C0000 -BB0C:000000083F882088208820883F8804087FE8000003F802080208020803F80000 -BB0D:000000083F882088208820883F8804087FE800000208020803F8020803F80000 -BB0E:000000083F882088208820883F8804087FE80000110811081F0811141F620000 -BB0F:000000083F882088208820883F8804087FE80000001000100010006801840000 -BB10:000000083F882088208820883F8804087FE800000048004800A8011406620000 -BB11:000000083F882088208820883F8804087FE80000000003F00408040803F00000 -BB12:000000083F882088208820883F8804087FE8000003F80020002000D003080000 -BB13:000000083F882088208820883F8804087FE80000004003F8004000A003180000 -BB14:000000083F882088208820883F8804087FE8000003F8000803F8000800080000 -BB15:000000083F882088208820883F8804087FE8000003F8020003F8020003F80000 -BB16:000000083F882088208820883F8804087FE8000000000FF8022002200FF80000 -BB17:000000083F882088208820883F8804087FE8000000800FF803E0041003E00000 -BB18:000000003FF820082008200820083FF8000004400440044004407FFC00000000 -BB19:00001FF01010101010101FF0044004407FFC00001FF000100010001000100000 -BB1A:00001FF01010101010101FF0044004407FFC000000003EF80208020802080000 -BB1B:00001FF01010101010101FF0044004407FFC000000001E100210022802C40000 -BB1C:00001FF01010101010101FF0044004407FFC000000001000100010001FF00000 -BB1D:00001FF01010101010101FF0044004407FFC0000000020F8201020303ECC0000 -BB1E:00001FF01010101010101FF0044004407FFC0000202021FC207020883E700000 -BB1F:00001FF01010101010101FF0044004407FFC00001FF01000100010001FF00000 -BB20:00001FF01010101010101FF0044004407FFC00001FF000101FF010001FF00000 -BB21:00001FF01010101010101FF0044004407FFC00003EF802083E0820083E080000 -BB22:00001FF01010101010101FF0044004407FFC00003EF802883E8820883EF80000 -BB23:00001FF01010101010101FF0044004407FFC00003E8802883EF820883EF80000 -BB24:00001FF01010101010101FF0044004407FFC00003E1002103E1020283EC40000 -BB25:00001FF01010101010101FF0044004407FFC00003EF802803EF820803EF80000 -BB26:00001FF01010101010101FF0044004407FFC00003EFC02483E4820483EFC0000 -BB27:00001FF01010101010101FF0044004407FFC00003E2003FC3E7020883E700000 -BB28:00001FF01010101010101FF0044004407FFC00001FF01010101010101FF00000 -BB29:00001FF01010101010101FF0044004407FFC0000101010101FF010101FF00000 -BB2A:00001FF01010101010101FF0044004407FFC0000222022203E2022503E880000 -BB2B:00001FF01010101010101FF0044004407FFC000000000100010002800C400000 -BB2C:00001FF01010101010101FF0044004407FFC00000000024002400DA033100000 -BB2D:00001FF01010101010101FF0044004407FFC0000000007C00820082007C00000 -BB2E:00001FF01010101010101FF0044004407FFC0000000007E00080014006200000 -BB2F:00001FF01010101010101FF0044004407FFC0000008007E00080014006200000 -BB30:00001FF01010101010101FF0044004407FFC00001FF000101FF0001000100000 -BB31:00001FF01010101010101FF0044004407FFC00001FF010001FF010001FF00000 -BB32:00001FF01010101010101FF0044004407FFC000000001FF0044004401FF00000 -BB33:00001FF01010101010101FF0044004407FFC000001001FF007C0082007C00000 -BB34:000000003FF8200820082008200820083FF800003FF801000100010001000000 -BB35:00001FF01010101010101FF000007FFC010001001FF000100010001000100000 -BB36:00001FF01010101010101FF000007FFC0100010000003EF80208020802080000 -BB37:00001FF01010101010101FF000007FFC0100010000001E100210022802C40000 -BB38:00001FF01010101010101FF0000000007FFC010001001100100010001FF00000 -BB39:00001FF01010101010101FF000007FFC01000100000020F8201020303ECC0000 -BB3A:00001FF01010101010101FF000007FFC01000100202021FC207020883E700000 -BB3B:00001FF01010101010101FF000007FFC010001001FF01000100010001FF00000 -BB3C:00001FF01010101010101FF000007FFC010001001FF000101FF010001FF00000 -BB3D:00001FF01010101010101FF000007FFC010001003EF802083E0820083E080000 -BB3E:00001FF01010101010101FF000007FFC010001003EF802883E8820883EF80000 -BB3F:00001FF01010101010101FF000007FFC010001003E8802883EF820883EF80000 -BB40:00001FF01010101010101FF000007FFC010001003E1002103E1020283EC40000 -BB41:00001FF01010101010101FF000007FFC010001003EF802803EF820803EF80000 -BB42:00001FF01010101010101FF000007FFC010001003EFC02483E4820483EFC0000 -BB43:00001FF01010101010101FF000007FFC010001003E2003FC3E7020883E700000 -BB44:00001FF01010101010101FF000007FFC010001001FF01010101010101FF00000 -BB45:00001FF01010101010101FF000007FFC01000100101010101FF010101FF00000 -BB46:00001FF01010101010101FF000007FFC01000100222022203E2022503E880000 -BB47:00001FF01010101010101FF000007FFC0100010000000100010002800C400000 -BB48:00001FF01010101010101FF000007FFC010001000000024002400DA033100000 -BB49:00001FF01010101010101FF000007FFC01000100000007C00820082007C00000 -BB4A:00001FF01010101010101FF000007FFC01000100000007E00080014006200000 -BB4B:00001FF01010101010101FF000007FFC01000100008007E00080014006200000 -BB4C:00001FF01010101010101FF000007FFC010001001FF000101FF0001000100000 -BB4D:00001FF01010101010101FF000007FFC010001001FF010001FF010001FF00000 -BB4E:00001FF01010101010101FF000007FFC0100010000001FF0044004401FF00000 -BB4F:00001FF01010101010101FF000007FFC0100010001001FF007C0082007C00000 -BB50:000000083FC8204820482048204820483FC800087FE8040804F8040804080000 -BB51:00083F88208820883F8800087FE8027802080000000007F80008000800080000 -BB52:00083F88208820883F8800087FE802780208000000003EF80208020802080000 -BB53:00083F88208820883F8800087FE802780208000000001F080108011401620000 -BB54:00083F88208820883F88000800087FE80278020802081000100010001FF80000 -BB55:00083F88208820883F8800087FE8027802080000000020F8201020303ECC0000 -BB56:00083F88208820883F8800087FE8027802080000202021FC207020883E700000 -BB57:00083F88208820883F8800087FE802780208000003F802000200020003F80000 -BB58:00083F88208820883F8800087FE802780208000007F8000807F8040007F80000 -BB59:00083F88208820883F8800087FE80278020800003EF802083E0820083E080000 -BB5A:00083F88208820883F8800087FE80278020800003EF802883E8820883EF80000 -BB5B:00083F88208820883F8800087FE80278020800003E8802883EF820883EF80000 -BB5C:00083F88208820883F8800087FE80278020800000F8800880F8808140FA20000 -BB5D:00083F88208820883F8800087FE80278020800003EF802803EF820803EF80000 -BB5E:00083F88208820883F8800087FE80278020800003EFC02483E4820483EFC0000 -BB5F:00083F88208820883F8800087FE80278020800003E1002FE3E3820443E380000 -BB60:00083F88208820883F8800087FE802780208000003F802080208020803F80000 -BB61:00083F88208820883F8800087FE80278020800000208020803F8020803F80000 -BB62:00083F88208820883F8800087FE8027802080000210821083F0821143F620000 -BB63:00083F88208820883F8800087FE8027802080000001000100010006801840000 -BB64:00083F88208820883F8800087FE80278020800000048004800A8011406620000 -BB65:00083F88208820883F8800087FE8027802080000000003F00408040803F00000 -BB66:00083F88208820883F8800087FE802780208000003F80020002000D003080000 -BB67:00083F88208820883F8800087FE8027802080000004003F8004000A003180000 -BB68:00083F88208820883F8800087FE802780208000003F8000803F8000800080000 -BB69:00083F88208820883F8800087FE802780208000003F8020003F8020003F80000 -BB6A:00083F88208820883F8800087FE802780208000000000FF8022002200FF80000 -BB6B:00083F88208820883F8800087FE802780208000000800FF803E0041003E00000 -BB6C:0000000A3FCA204A204A204A204A204A3FCA000A7FEA040A047A040A040A0000 -BB6D:00283FA820A820A83FA800287FA805E804280000000007F80008000800080000 -BB6E:00283FA820A820A83FA800287FA805E80428000000003EF80208020802080000 -BB6F:00283FA820A820A83FA800287FA805E80428000000001F080108011401620000 -BB70:00283FA820A820A83FA8002800287FA8042805E804281428100010001FF80000 -BB71:00283FA820A820A83FA800287FA805E804280000000020F8201020303ECC0000 -BB72:00283FA820A820A83FA800287FA805E804280000202021FC207020883E700000 -BB73:00283FA820A820A83FA800287FA805E80428000003F802000200020003F80000 -BB74:00283FA820A820A83FA800287FA805E80428000007F8000807F8040007F80000 -BB75:00283FA820A820A83FA800287FA805E8042800003EF802083E0820083E080000 -BB76:00283FA820A820A83FA800287FA805E8042800003EF802883E8820883EF80000 -BB77:00283FA820A820A83FA800287FA805E8042800003E8802883EF820883EF80000 -BB78:00283FA820A820A83FA800287FA805E8042800000F8800880F8808140FA20000 -BB79:00283FA820A820A83FA800287FA805E8042800003EF802803EF820803EF80000 -BB7A:00283FA820A820A83FA800287FA805E8042800003EFC02483E4820483EFC0000 -BB7B:00283FA820A820A83FA800287FA805E8042800003E1002FE3E3820443E380000 -BB7C:00283FA820A820A83FA800287FA805E80428000003F802080208020803F80000 -BB7D:00283FA820A820A83FA800287FA805E8042800000208020803F8020803F80000 -BB7E:00283FA820A820A83FA800287FA805E804280000210821083F0821143F620000 -BB7F:00283FA820A820A83FA800287FA805E804280000001000100010006801840000 -BB80:00283FA820A820A83FA800287FA805E8042800000048004800A8011406620000 -BB81:00283FA820A820A83FA800287FA805E804280000000003F00408040803F00000 -BB82:00283FA820A820A83FA800287FA805E80428000003F80020002000D003080000 -BB83:00283FA820A820A83FA800287FA805E804280000004003F8004000A003180000 -BB84:00283FA820A820A83FA800287FA805E80428000003F8000803F8000800080000 -BB85:00283FA820A820A83FA800287FA805E80428000003F8020003F8020003F80000 -BB86:00283FA820A820A83FA800287FA805E80428000000000FF8022002200FF80000 -BB87:00283FA820A820A83FA800287FA805E80428000000800FF803E0041003E00000 -BB88:000000083FC8204820482048204820483FC800087FE804080408040804080000 -BB89:00083F88208820883F8800087FE8020802000000000007F80008000800080000 -BB8A:00083F88208820883F8800087FE802080200000000003EF80208020802080000 -BB8B:00083F88208820883F8800087FE802080200000000001F080108011401620000 -BB8C:00083F88208820883F88000800087FE80208020802081008100010001FF80000 -BB8D:00083F88208820883F8800087FE8020802000000000020F8201020303ECC0000 -BB8E:00083F88208820883F8800087FE8020802000000202021FC207020883E700000 -BB8F:00083F88208820883F8800087FE802080200000003F802000200020003F80000 -BB90:00083F88208820883F8800087FE802080200000007F8000807F8040007F80000 -BB91:00083F88208820883F8800087FE80208020000003EF802083E0820083E080000 -BB92:00083F88208820883F8800087FE80208020000003EF802883E8820883EF80000 -BB93:00083F88208820883F8800087FE80208020000003E8802883EF820883EF80000 -BB94:00083F88208820883F8800087FE80208020000000F8800880F8808140FA20000 -BB95:00083F88208820883F8800087FE80208020000003EF802803EF820803EF80000 -BB96:00083F88208820883F8800087FE80208020000003EFC02483E4820483EFC0000 -BB97:00083F88208820883F8800087FE80208020000003E1002FE3E3820443E380000 -BB98:00083F88208820883F8800087FE802080200000003F802080208020803F80000 -BB99:00083F88208820883F8800087FE80208020000000208020803F8020803F80000 -BB9A:00083F88208820883F8800087FE8020802000000210821083F0821143F620000 -BB9B:00083F88208820883F8800087FE8020802000000001000100010006801840000 -BB9C:00083F88208820883F8800087FE80208020000000048004800A8011406620000 -BB9D:00083F88208820883F8800087FE8020802000000000003F00408040803F00000 -BB9E:00083F88208820883F8800087FE802080200000003F80020002000D003080000 -BB9F:00083F88208820883F8800087FE8020802000000004003F8004000A003180000 -BBA0:00083F88208820883F8800087FE802080200000003F8000803F8000800080000 -BBA1:00083F88208820883F8800087FE802080200000003F8020003F8020003F80000 -BBA2:00083F88208820883F8800087FE802080200000000000FF8022002200FF80000 -BBA3:00083F88208820883F8800087FE802080200000000800FF803E0041003E00000 -BBA4:000000003FF8200820082008200820083FF800007FFC04400440044004400000 -BBA5:00001FF01010101010101FF000007FFC044004401FF000100010001000100000 -BBA6:00001FF01010101010101FF000007FFC0440044000003EF80208020802080000 -BBA7:00001FF01010101010101FF000007FFC0440044000001E100210022802C40000 -BBA8:00001FF01010101010101FF0000000007FFC044004401440100010001FF00000 -BBA9:00001FF01010101010101FF000007FFC04400440000020F8201020303ECC0000 -BBAA:00001FF01010101010101FF000007FFC04400440202021FC207020883E700000 -BBAB:00001FF01010101010101FF000007FFC044004401FF01000100010001FF00000 -BBAC:00001FF01010101010101FF000007FFC044004401FF000101FF010001FF00000 -BBAD:00001FF01010101010101FF000007FFC044004403EF802083E0820083E080000 -BBAE:00001FF01010101010101FF000007FFC044004403EF802883E8820883EF80000 -BBAF:00001FF01010101010101FF000007FFC044004403E8802883EF820883EF80000 -BBB0:00001FF01010101010101FF000007FFC044004403E1002103E1020283EC40000 -BBB1:00001FF01010101010101FF000007FFC044004403EF802803EF820803EF80000 -BBB2:00001FF01010101010101FF000007FFC044004403EFC02483E4820483EFC0000 -BBB3:00001FF01010101010101FF000007FFC044004403E2003FC3E7020883E700000 -BBB4:00001FF01010101010101FF000007FFC044004401FF01010101010101FF00000 -BBB5:00001FF01010101010101FF000007FFC04400440101010101FF010101FF00000 -BBB6:00001FF01010101010101FF000007FFC04400440222022203E2022503E880000 -BBB7:00001FF01010101010101FF000007FFC0440044000000100010002800C400000 -BBB8:00001FF01010101010101FF000007FFC044004400000024002400DA033100000 -BBB9:00001FF01010101010101FF000007FFC04400440000007C00820082007C00000 -BBBA:00001FF01010101010101FF000007FFC04400440000007E00080014006200000 -BBBB:00001FF01010101010101FF000007FFC04400440008007E00080014006200000 -BBBC:00001FF01010101010101FF000007FFC044004401FF000101FF0001000100000 -BBBD:00001FF01010101010101FF000007FFC044004401FF010001FF010001FF00000 -BBBE:00001FF01010101010101FF000007FFC0440044000001FF0044004401FF00000 -BBBF:00001FF01010101010101FF000007FFC0440044001001FF007C0082007C00000 -BBC0:000000003FF820082008200820083FF80000000000007FFC0000000000000000 -BBC1:00001FF01010101010101FF0000000007FFC00001FF000100010001000100000 -BBC2:00001FF01010101010101FF0000000007FFC000000003EF80208020802080000 -BBC3:00001FF01010101010101FF0000000007FFC000000001E100210022802C40000 -BBC4:00001FF01010101010101FF0000000007FFC000000001000100010001FF00000 -BBC5:00001FF01010101010101FF0000000007FFC0000000020F8201020303ECC0000 -BBC6:00001FF01010101010101FF0000000007FFC0000202021FC207020883E700000 -BBC7:00001FF01010101010101FF0000000007FFC00001FF01000100010001FF00000 -BBC8:00001FF01010101010101FF0000000007FFC00001FF000101FF010001FF00000 -BBC9:00001FF01010101010101FF0000000007FFC00003EF802083E0820083E080000 -BBCA:00001FF01010101010101FF0000000007FFC00003EF802883E8820883EF80000 -BBCB:00001FF01010101010101FF0000000007FFC00003E8802883EF820883EF80000 -BBCC:00001FF01010101010101FF0000000007FFC00003E1002103E1020283EC40000 -BBCD:00001FF01010101010101FF0000000007FFC00003EF802803EF820803EF80000 -BBCE:00001FF01010101010101FF0000000007FFC00003EFC02483E4820483EFC0000 -BBCF:00001FF01010101010101FF0000000007FFC00003E2003FC3E7020883E700000 -BBD0:00001FF01010101010101FF0000000007FFC00001FF01010101010101FF00000 -BBD1:00001FF01010101010101FF0000000007FFC0000101010101FF010101FF00000 -BBD2:00001FF01010101010101FF0000000007FFC0000222022203E2022503E880000 -BBD3:00001FF01010101010101FF0000000007FFC000000000100010002800C400000 -BBD4:00001FF01010101010101FF0000000007FFC00000000024002400DA033100000 -BBD5:00001FF01010101010101FF0000000007FFC0000000007C00820082007C00000 -BBD6:00001FF01010101010101FF0000000007FFC0000000007E00080014006200000 -BBD7:00001FF01010101010101FF0000000007FFC0000008007E00080014006200000 -BBD8:00001FF01010101010101FF0000000007FFC00001FF000101FF0001000100000 -BBD9:00001FF01010101010101FF0000000007FFC00001FF010001FF010001FF00000 -BBDA:00001FF01010101010101FF0000000007FFC000000001FF0044004401FF00000 -BBDB:00001FF01010101010101FF0000000007FFC000001001FF007C0082007C00000 -BBDC:0000000800083F88208820882088208820883F8800087FE80008000800080000 -BBDD:000000083F882088208820883F8800087FE8000007F800080008000800080000 -BBDE:000000083F882088208820883F8800087FE8000000003EF80208020802080000 -BBDF:000000083F882088208820883F8800087FE8000000001F080108011401620000 -BBE0:000000083F882088208820883F8800087FE8000008000800080008000FF80000 -BBE1:000000083F882088208820883F8800087FE80000000010F8101010301ECC0000 -BBE2:000000083F882088208820883F8800087FE800000808087F081C08220F9C0000 -BBE3:000000083F882088208820883F8800087FE8000003F802000200020003F80000 -BBE4:000000083F882088208820883F8800087FE8000007F8000807F8040007F80000 -BBE5:000000083F882088208820883F8800087FE800003EF802083E0820083E080000 -BBE6:000000083F882088208820883F8800087FE800003EF802883E8820883EF80000 -BBE7:000000083F882088208820883F8800087FE800003E8802883EF820883EF80000 -BBE8:000000083F882088208820883F8800087FE800001F0801081F0810141F620000 -BBE9:000000083F882088208820883F8800087FE800003EF802803EF820803EF80000 -BBEA:000000083F882088208820883F8800087FE800003EFC02483E4820483EFC0000 -BBEB:000000083F882088208820883F8800087FE800001F08017F1F1C10221F1C0000 -BBEC:000000083F882088208820883F8800087FE8000003F802080208020803F80000 -BBED:000000083F882088208820883F8800087FE800000208020803F8020803F80000 -BBEE:000000083F882088208820883F8800087FE80000110811081F0811141F620000 -BBEF:000000083F882088208820883F8800087FE80000001000100010006801840000 -BBF0:000000083F882088208820883F8800087FE800000048004800A8011406620000 -BBF1:000000083F882088208820883F8800087FE80000000003F00408040803F00000 -BBF2:000000083F882088208820883F8800087FE8000003F80020002000D003080000 -BBF3:000000083F882088208820883F8800087FE80000004003F8004000A003180000 -BBF4:000000083F882088208820883F8800087FE8000003F8000803F8000800080000 -BBF5:000000083F882088208820883F8800087FE8000003F8020003F8020003F80000 -BBF6:000000083F882088208820883F8800087FE8000000000FF8022002200FF80000 -BBF7:000000083F882088208820883F8800087FE8000000800FF803E0041003E00000 -BBF8:00000000000800087F884088408840884088408840887F880008000800080000 -BBF9:000000087E0842084208420842087E0800080000000007F80008000800080000 -BBFA:000000087E0842084208420842087E080008000000003EF80208020802080000 -BBFB:000000087E0842084208420842087E080008000000001F080108011401620000 -BBFC:000000087E0842084208420842087E080008000800001000100010001FF80000 -BBFD:000000087E0842084208420842087E0800080000000020F8201020303ECC0000 -BBFE:000000087E0842084208420842087E0800080000202021FC207020883E700000 -BBFF:000000087E0842084208420842087E080008000003F802000200020003F80000 -BC00:000000087E0842084208420842087E080008000007F8000807F8040007F80000 -BC01:000000087E0842084208420842087E08000800003EF802083E0820083E080000 -BC02:000000087E0842084208420842087E08000800003EF802883E8820883EF80000 -BC03:000000087E0842084208420842087E08000800003E8802883EF820883EF80000 -BC04:000000087E0842084208420842087E08000800000F8800880F8808140FA20000 -BC05:000000087E0842084208420842087E08000800003EF802803EF820803EF80000 -BC06:000000087E0842084208420842087E08000800003EFC02483E4820483EFC0000 -BC07:000000087E0842084208420842087E08000800003E1002FE3E3820443E380000 -BC08:000000087E0842084208420842087E080008000003F802080208020803F80000 -BC09:000000087E0842084208420842087E08000800000208020803F8020803F80000 -BC0A:000000087E0842084208420842087E0800080000210821083F0821143F620000 -BC0B:000000087E0842084208420842087E0800080000001000100010006801840000 -BC0C:000000087E0842084208420842087E08000800000048004800A8011406620000 -BC0D:000000087E0842084208420842087E0800080000000003F00408040803F00000 -BC0E:000000087E0842084208420842087E080008000003F80020002000D003080000 -BC0F:000000087E0842084208420842087E0800080000004003F8004000A003180000 -BC10:000000087E0842084208420842087E080008000003F8000803F8000800080000 -BC11:000000087E0842084208420842087E080008000003F8020003F8020003F80000 -BC12:000000087E0842084208420842087E080008000000000FF8022002200FF80000 -BC13:000000087E0842084208420842087E080008000000800FF803E0041003E00000 -BC14:00000000001000102090209020903F9E2090209020903F900010001000100000 -BC15:000000080008420842087E0E42087E080008000007F800080008000800080000 -BC16:000000080008420842087E0E42087E080008000000003EF80208020802080000 -BC17:000000080008420842087E0E42087E080008000000001F080108011401620000 -BC18:000000080008420842087E0E42087E080008000808000800080008000FF80000 -BC19:000000080008420842087E0E42087E0800080000000010F8101010301ECC0000 -BC1A:000000080008420842087E0E42087E08000800000808087F081C08220F9C0000 -BC1B:000000080008420842087E0E42087E080008000003F802000200020003F80000 -BC1C:000000080008420842087E0E42087E080008000007F8000807F8040007F80000 -BC1D:000000080008420842087E0E42087E08000800003EF802083E0820083E080000 -BC1E:000000080008420842087E0E42087E08000800003EF802883E8820883EF80000 -BC1F:000000080008420842087E0E42087E08000800003E8802883EF820883EF80000 -BC20:000000080008420842087E0E42087E08000800001F0801081F0810141F620000 -BC21:000000080008420842087E0E42087E08000800003EF802803EF820803EF80000 -BC22:000000080008420842087E0E42087E08000800003EFC02483E4820483EFC0000 -BC23:000000080008420842087E0E42087E08000800001F08017F1F1C10221F1C0000 -BC24:000000080008420842087E0E42087E080008000003F802080208020803F80000 -BC25:000000080008420842087E0E42087E08000800000208020803F8020803F80000 -BC26:000000080008420842087E0E42087E0800080000110811081F0811141F620000 -BC27:000000080008420842087E0E42087E0800080000001000100010006801840000 -BC28:000000080008420842087E0E42087E08000800000048004800A8011406620000 -BC29:000000080008420842087E0E42087E0800080000000003F00408040803F00000 -BC2A:000000080008420842087E0E42087E080008000003F80020002000D003080000 -BC2B:000000080008420842087E0E42087E0800080000004003F8004000A003180000 -BC2C:000000080008420842087E0E42087E080008000003F8000803F8000800080000 -BC2D:000000080008420842087E0E42087E080008000003F8020003F8020003F80000 -BC2E:000000080008420842087E0E42087E080008000000000FF8022002200FF80000 -BC2F:000000080008420842087E0E42087E080008000000800FF803E0041003E00000 -BC30:00000000001200122092209220923F9E2092209220923F920012001200120000 -BC31:000000280028422842287E3842287E280028000007F800080008000800080000 -BC32:000000280028422842287E3842287E280028000000003EF80208020802080000 -BC33:000000280028422842287E3842287E280028000000003E100210022802C40000 -BC34:000000280028422842287E3842287E280028002808000800080008000FF80000 -BC35:000000280028422842287E3842287E2800280000000020F8201020303ECC0000 -BC36:000000280028422842287E3842287E2800280000202021FC207020883E700000 -BC37:000000280028422842287E3842287E280028000003F802000200020003F80000 -BC38:000000280028422842287E3842287E280028000007F8000807F8040007F80000 -BC39:000000280028422842287E3842287E28002800003EF802083E0820083E080000 -BC3A:000000280028422842287E3842287E28002800003EF802883E8820883EF80000 -BC3B:000000280028422842287E3842287E28002800003E8802883EF820883EF80000 -BC3C:000000280028422842287E3842287E28002800001F0801081F0810141F620000 -BC3D:000000280028422842287E3842287E28002800003EF802803EF820803EF80000 -BC3E:000000280028422842287E3842287E28002800003EFC02483E4820483EFC0000 -BC3F:000000280028422842287E3842287E28002800003E1002FE3E3820443E380000 -BC40:000000280028422842287E3842287E280028000003F802080208020803F80000 -BC41:000000280028422842287E3842287E28002800000208020803F8020803F80000 -BC42:000000280028422842287E3842287E2800280000110811081F0811141F620000 -BC43:000000280028422842287E3842287E2800280000000800080008003400C20000 -BC44:000000280028422842287E3842287E28002800000048004800A8011406620000 -BC45:000000280028422842287E3842287E2800280000000001F00208020801F00000 -BC46:000000280028422842287E3842287E280028000003F80020002000D003080000 -BC47:000000280028422842287E3842287E2800280000004003F8004000A003180000 -BC48:000000280028422842287E3842287E280028000003F8000803F8000800080000 -BC49:000000280028422842287E3842287E280028000003F8020003F8020003F80000 -BC4A:000000280028422842287E3842287E280028000000000FF8022002200FF80000 -BC4B:000000280028422842287E3842287E280028000000800FF803E0041003E00000 -BC4C:000000000010001020902090209E3F902090209E20903F900010001000100000 -BC4D:0000000800084208420E7E08420E7E080008000007F800080008000800080000 -BC4E:0000000800084208420E7E08420E7E080008000000003EF80208020802080000 -BC4F:0000000800084208420E7E08420E7E080008000000001F080108011401620000 -BC50:0000000800084208420E7E08420E7E080008000008000800080008000FF80000 -BC51:0000000800084208420E7E08420E7E0800080000000010F8101010301ECC0000 -BC52:0000000800084208420E7E08420E7E08000800000808087F081C08220F9C0000 -BC53:0000000800084208420E7E08420E7E080008000003F802000200020003F80000 -BC54:0000000800084208420E7E08420E7E080008000007F8000807F8040007F80000 -BC55:0000000800084208420E7E08420E7E08000800003EF802083E0820083E080000 -BC56:0000000800084208420E7E08420E7E08000800003EF802883E8820883EF80000 -BC57:0000000800084208420E7E08420E7E08000800003E8802883EF820883EF80000 -BC58:0000000800084208420E7E08420E7E08000800001F0801081F0810141F620000 -BC59:0000000800084208420E7E08420E7E08000800003EF802803EF820803EF80000 -BC5A:0000000800084208420E7E08420E7E08000800003EFC02483E4820483EFC0000 -BC5B:0000000800084208420E7E08420E7E08000800001F08017F1F1C10221F1C0000 -BC5C:0000000800084208420E7E08420E7E080008000003F802080208020803F80000 -BC5D:0000000800084208420E7E08420E7E08000800000208020803F8020803F80000 -BC5E:0000000800084208420E7E08420E7E0800080000110811081F0811141F620000 -BC5F:0000000800084208420E7E08420E7E0800080000001000100010006801840000 -BC60:0000000800084208420E7E08420E7E08000800000048004800A8011406620000 -BC61:0000000800084208420E7E08420E7E0800080000000003F00408040803F00000 -BC62:0000000800084208420E7E08420E7E080008000003F80020002000D003080000 -BC63:0000000800084208420E7E08420E7E0800080000004003F8004000A003180000 -BC64:0000000800084208420E7E08420E7E080008000003F8000803F8000800080000 -BC65:0000000800084208420E7E08420E7E080008000003F8020003F8020003F80000 -BC66:0000000800084208420E7E08420E7E080008000000000FF8022002200FF80000 -BC67:0000000800084208420E7E08420E7E080008000000800FF803E0041003E00000 -BC68:000000000012001220922092209E3F922092209E20923F920012001200120000 -BC69:000000280028422842387E2842387E280028000007F800080008000800080000 -BC6A:000000280028422842387E2842387E280028000000003EF80208020802080000 -BC6B:000000280028422842387E2842387E280028000000003E100210022802C40000 -BC6C:000000280028422842387E2842387E280028002808000800080008000FF80000 -BC6D:000000280028422842387E2842387E2800280000000020F8201020303ECC0000 -BC6E:000000280028422842387E2842387E2800280000202021FC207020883E700000 -BC6F:000000280028422842387E2842387E280028000003F802000200020003F80000 -BC70:000000280028422842387E2842387E280028000007F8000807F8040007F80000 -BC71:000000280028422842387E2842387E28002800003EF802083E0820083E080000 -BC72:000000280028422842387E2842387E28002800003EF802883E8820883EF80000 -BC73:000000280028422842387E2842387E28002800003E8802883EF820883EF80000 -BC74:000000280028422842387E2842387E28002800001F0801081F0810141F620000 -BC75:000000280028422842387E2842387E28002800003EF802803EF820803EF80000 -BC76:000000280028422842387E2842387E28002800003EFC02483E4820483EFC0000 -BC77:000000280028422842387E2842387E28002800003E1002FE3E3820443E380000 -BC78:000000280028422842387E2842387E280028000003F802080208020803F80000 -BC79:000000280028422842387E2842387E28002800000208020803F8020803F80000 -BC7A:000000280028422842387E2842387E2800280000110811081F0811141F620000 -BC7B:000000280028422842387E2842387E2800280000000800080008003400C20000 -BC7C:000000280028422842387E2842387E28002800000048004800A8011406620000 -BC7D:000000280028422842387E2842387E2800280000000001F00208020801F00000 -BC7E:000000280028422842387E2842387E280028000003F80020002000D003080000 -BC7F:000000280028422842387E2842387E2800280000004003F8004000A003180000 -BC80:000000280028422842387E2842387E280028000003F8000803F8000800080000 -BC81:000000280028422842387E2842387E280028000003F8020003F8020003F80000 -BC82:000000280028422842387E2842387E280028000000000FF8022002200FF80000 -BC83:000000280028422842387E2842387E280028000000800FF803E0041003E00000 -BC84:00000000000200022082208220823F9E2082208220823F820002000200020000 -BC85:000000080008420842087E3842087E0800080000000007F80008000800080000 -BC86:000000080008420842087E3842087E080008000000003EF80208020802080000 -BC87:000000080008420842087E3842087E080008000000001F080108011401620000 -BC88:000000080008420842087E3842087E080008000000001000100010001FF80000 -BC89:000000080008420842087E3842087E0800080000000020F8201020303ECC0000 -BC8A:000000080008420842087E3842087E0800080000202021FC207020883E700000 -BC8B:000000080008420842087E3842087E080008000003F802000200020003F80000 -BC8C:000000080008420842087E3842087E080008000007F8000807F8040007F80000 -BC8D:000000080008420842087E3842087E08000800003EF802083E0820083E080000 -BC8E:000000080008420842087E3842087E08000800003EF802883E8820883EF80000 -BC8F:000000080008420842087E3842087E08000800003E8802883EF820883EF80000 -BC90:000000080008420842087E3842087E08000800000F8800880F8808140FA20000 -BC91:000000080008420842087E3842087E08000800003EF802803EF820803EF80000 -BC92:000000080008420842087E3842087E08000800003EFC02483E4820483EFC0000 -BC93:000000080008420842087E3842087E08000800003E1002FE3E3820443E380000 -BC94:000000080008420842087E3842087E080008000003F802080208020803F80000 -BC95:000000080008420842087E3842087E08000800000208020803F8020803F80000 -BC96:000000080008420842087E3842087E0800080000210821083F0821143F620000 -BC97:000000080008420842087E3842087E0800080000001000100010006801840000 -BC98:000000080008420842087E3842087E08000800000048004800A8011406620000 -BC99:000000080008420842087E3842087E0800080000000003F00408040803F00000 -BC9A:000000080008420842087E3842087E080008000003F80020002000D003080000 -BC9B:000000080008420842087E3842087E0800080000004003F8004000A003180000 -BC9C:000000080008420842087E3842087E080008000003F8000803F8000800080000 -BC9D:000000080008420842087E3842087E080008000003F8020003F8020003F80000 -BC9E:000000080008420842087E3842087E080008000000000FF8022002200FF80000 -BC9F:000000080008420842087E3842087E080008000000800FF803E0041003E00000 -BCA0:00000000000A000A208A208A208A3FBA208A208A208A3F8A000A000A000A0000 -BCA1:000000280028422842287EE842287E280028000007F800080008000800080000 -BCA2:000000280028422842287EE842287E280028000000003EF80208020802080000 -BCA3:000000280028422842287EE842287E280028000000003E100210022802C40000 -BCA4:000000280028422842287EE842287E280028000008000800080008000FF80000 -BCA5:000000280028422842287EE842287E2800280000000020F8201020303ECC0000 -BCA6:000000280028422842287EE842287E2800280000202021FC207020883E700000 -BCA7:000000280028422842287EE842287E280028000003F802000200020003F80000 -BCA8:000000280028422842287EE842287E280028000007F8000807F8040007F80000 -BCA9:000000280028422842287EE842287E28002800003EF802083E0820083E080000 -BCAA:000000280028422842287EE842287E28002800003EF802883E8820883EF80000 -BCAB:000000280028422842287EE842287E28002800003E8802883EF820883EF80000 -BCAC:000000280028422842287EE842287E28002800001F0801081F0810141F620000 -BCAD:000000280028422842287EE842287E28002800003EF802803EF820803EF80000 -BCAE:000000280028422842287EE842287E28002800003EFC02483E4820483EFC0000 -BCAF:000000280028422842287EE842287E28002800003E1002FE3E3820443E380000 -BCB0:000000280028422842287EE842287E280028000003F802080208020803F80000 -BCB1:000000280028422842287EE842287E28002800000208020803F8020803F80000 -BCB2:000000280028422842287EE842287E2800280000110811081F0811141F620000 -BCB3:000000280028422842287EE842287E2800280000000800080008003400C20000 -BCB4:000000280028422842287EE842287E28002800000048004800A8011406620000 -BCB5:000000280028422842287EE842287E2800280000000001F00208020801F00000 -BCB6:000000280028422842287EE842287E280028000003F80020002000D003080000 -BCB7:000000280028422842287EE842287E2800280000004003F8004000A003180000 -BCB8:000000280028422842287EE842287E280028000003F8000803F8000800080000 -BCB9:000000280028422842287EE842287E280028000003F8020003F8020003F80000 -BCBA:000000280028422842287EE842287E280028000000000FF8022002200FF80000 -BCBB:000000280028422842287EE842287E280028000000800FF803E0041003E00000 -BCBC:000000000002000220822082209E3F822082209E20823F820002000200020000 -BCBD:000000080008420842387E0842387E0800080000000007F80008000800080000 -BCBE:000000080008420842387E0842387E080008000000003EF80208020802080000 -BCBF:000000080008420842387E0842387E080008000000001F080108011401620000 -BCC0:000000080008420842387E0842387E080008000800001000100010001FF80000 -BCC1:000000080008420842387E0842387E0800080000000020F8201020303ECC0000 -BCC2:000000080008420842387E0842387E0800080000202021FC207020883E700000 -BCC3:000000080008420842387E0842387E080008000003F802000200020003F80000 -BCC4:000000080008420842387E0842387E080008000007F8000807F8040007F80000 -BCC5:000000080008420842387E0842387E08000800003EF802083E0820083E080000 -BCC6:000000080008420842387E0842387E08000800003EF802883E8820883EF80000 -BCC7:000000080008420842387E0842387E08000800003E8802883EF820883EF80000 -BCC8:000000080008420842387E0842387E08000800000F8800880F8808140FA20000 -BCC9:000000080008420842387E0842387E08000800003EF802803EF820803EF80000 -BCCA:000000080008420842387E0842387E08000800003EFC02483E4820483EFC0000 -BCCB:000000080008420842387E0842387E08000800003E1002FE3E3820443E380000 -BCCC:000000080008420842387E0842387E080008000003F802080208020803F80000 -BCCD:000000080008420842387E0842387E08000800000208020803F8020803F80000 -BCCE:000000080008420842387E0842387E0800080000210821083F0821143F620000 -BCCF:000000080008420842387E0842387E0800080000001000100010006801840000 -BCD0:000000080008420842387E0842387E08000800000048004800A8011406620000 -BCD1:000000080008420842387E0842387E0800080000000003F00408040803F00000 -BCD2:000000080008420842387E0842387E080008000003F80020002000D003080000 -BCD3:000000080008420842387E0842387E0800080000004003F8004000A003180000 -BCD4:000000080008420842387E0842387E080008000003F8000803F8000800080000 -BCD5:000000080008420842387E0842387E080008000003F8020003F8020003F80000 -BCD6:000000080008420842387E0842387E080008000000000FF8022002200FF80000 -BCD7:000000080008420842387E0842387E080008000000800FF803E0041003E00000 -BCD8:00000000000A000A208A208A20BA3F8A208A20BA208A3F8A000A000A000A0000 -BCD9:000000280028422842E87E2842E87E280028000007F800080008000800080000 -BCDA:000000280028422842E87E2842E87E280028000000003EF80208020802080000 -BCDB:000000280028422842E87E2842E87E280028000000003E100210022802C40000 -BCDC:000000280028422842E87E2842E87E280028002808000800080008000FF80000 -BCDD:000000280028422842E87E2842E87E2800280000000020F8201020303ECC0000 -BCDE:000000280028422842E87E2842E87E2800280000202021FC207020883E700000 -BCDF:000000280028422842E87E2842E87E280028000003F802000200020003F80000 -BCE0:000000280028422842E87E2842E87E280028000007F8000807F8040007F80000 -BCE1:000000280028422842E87E2842E87E28002800003EF802083E0820083E080000 -BCE2:000000280028422842E87E2842E87E28002800003EF802883E8820883EF80000 -BCE3:000000280028422842E87E2842E87E28002800003E8802883EF820883EF80000 -BCE4:000000280028422842E87E2842E87E28002800001F0801081F0810141F620000 -BCE5:000000280028422842E87E2842E87E28002800003EF802803EF820803EF80000 -BCE6:000000280028422842E87E2842E87E28002800003EFC02483E4820483EFC0000 -BCE7:000000280028422842E87E2842E87E28002800003E1002FE3E3820443E380000 -BCE8:000000280028422842E87E2842E87E280028000003F802080208020803F80000 -BCE9:000000280028422842E87E2842E87E28002800000208020803F8020803F80000 -BCEA:000000280028422842E87E2842E87E2800280000110811081F0811141F620000 -BCEB:000000280028422842E87E2842E87E2800280000000800080008003400C20000 -BCEC:000000280028422842E87E2842E87E28002800000048004800A8011406620000 -BCED:000000280028422842E87E2842E87E2800280000000001F00208020801F00000 -BCEE:000000280028422842E87E2842E87E280028000003F80020002000D003080000 -BCEF:000000280028422842E87E2842E87E2800280000004003F8004000A003180000 -BCF0:000000280028422842E87E2842E87E280028000003F8000803F8000800080000 -BCF1:000000280028422842E87E2842E87E280028000003F8020003F8020003F80000 -BCF2:000000280028422842E87E2842E87E280028000000000FF8022002200FF80000 -BCF3:000000280028422842E87E2842E87E280028000000800FF803E0041003E00000 -BCF4:000000001010101010101FF0101010101FF000000100010001007FFC00000000 -BCF5:0000101010101FF010101FF0010001007FFC00001FF000100010001000100000 -BCF6:0000101010101FF010101FF0010001007FFC000000003EF80208020802080000 -BCF7:0000101010101FF010101FF0010001007FFC000000001E100210022802C40000 -BCF8:0000101010101FF010101FF0010001007FFC000000001000100010001FF00000 -BCF9:0000101010101FF010101FF0010001007FFC0000000020F8201020303ECC0000 -BCFA:0000101010101FF010101FF0010001007FFC0000202021FC207020883E700000 -BCFB:0000101010101FF010101FF0010001007FFC00001FF01000100010001FF00000 -BCFC:0000101010101FF010101FF0010001007FFC00001FF000101FF010001FF00000 -BCFD:0000101010101FF010101FF0010001007FFC00003EF802083E0820083E080000 -BCFE:0000101010101FF010101FF0010001007FFC00003EF802883E8820883EF80000 -BCFF:0000101010101FF010101FF0010001007FFC00003E8802883EF820883EF80000 -BD00:0000101010101FF010101FF0010001007FFC00003E1002103E1020283EC40000 -BD01:0000101010101FF010101FF0010001007FFC00003EF802803EF820803EF80000 -BD02:0000101010101FF010101FF0010001007FFC00003EFC02483E4820483EFC0000 -BD03:0000101010101FF010101FF0010001007FFC00003E2003FC3E7020883E700000 -BD04:0000101010101FF010101FF0010001007FFC00001FF01010101010101FF00000 -BD05:0000101010101FF010101FF0010001007FFC0000101010101FF010101FF00000 -BD06:0000101010101FF010101FF0010001007FFC0000222022203E2022503E880000 -BD07:0000101010101FF010101FF0010001007FFC000000000100010002800C400000 -BD08:0000101010101FF010101FF0010001007FFC00000000024002400DA033100000 -BD09:0000101010101FF010101FF0010001007FFC0000000007C00820082007C00000 -BD0A:0000101010101FF010101FF0010001007FFC0000000007E00080014006200000 -BD0B:0000101010101FF010101FF0010001007FFC0000008007E00080014006200000 -BD0C:0000101010101FF010101FF0010001007FFC00001FF000101FF0001000100000 -BD0D:0000101010101FF010101FF0010001007FFC00001FF010001FF010001FF00000 -BD0E:0000101010101FF010101FF0010001007FFC000000001FF0044004401FF00000 -BD0F:0000101010101FF010101FF0010001007FFC000001001FF007C0082007C00000 -BD10:0000001000102090209020903F90209E20903F90041004107FD0001000100000 -BD11:00000008208820883F8E20883F8804087FE8000007F800080008000800080000 -BD12:00000008208820883F8E20883F8804087FE8000000003EF80208020802080000 -BD13:00000008208820883F8E20883F8804087FE8000000001F080108011401620000 -BD14:00000008208820883F8E20883F8804087FE8000008000800080008000FF80000 -BD15:00000008208820883F8E20883F8804087FE80000000010F8101010301ECC0000 -BD16:00000008208820883F8E20883F8804087FE800000808087F081C08220F9C0000 -BD17:00000008208820883F8E20883F8804087FE8000003F802000200020003F80000 -BD18:00000008208820883F8E20883F8804087FE8000007F8000807F8040007F80000 -BD19:00000008208820883F8E20883F8804087FE800003EF802083E0820083E080000 -BD1A:00000008208820883F8E20883F8804087FE800003EF802883E8820883EF80000 -BD1B:00000008208820883F8E20883F8804087FE800003E8802883EF820883EF80000 -BD1C:00000008208820883F8E20883F8804087FE800001F0801081F0810141F620000 -BD1D:00000008208820883F8E20883F8804087FE800003EF802803EF820803EF80000 -BD1E:00000008208820883F8E20883F8804087FE800003EFC02483E4820483EFC0000 -BD1F:00000008208820883F8E20883F8804087FE800001F08017F1F1C10221F1C0000 -BD20:00000008208820883F8E20883F8804087FE8000003F802080208020803F80000 -BD21:00000008208820883F8E20883F8804087FE800000208020803F8020803F80000 -BD22:00000008208820883F8E20883F8804087FE80000110811081F0811141F620000 -BD23:00000008208820883F8E20883F8804087FE80000001000100010006801840000 -BD24:00000008208820883F8E20883F8804087FE800000048004800A8011406620000 -BD25:00000008208820883F8E20883F8804087FE80000000003F00408040803F00000 -BD26:00000008208820883F8E20883F8804087FE8000003F80020002000D003080000 -BD27:00000008208820883F8E20883F8804087FE80000004003F8004000A003180000 -BD28:00000008208820883F8E20883F8804087FE8000003F8000803F8000800080000 -BD29:00000008208820883F8E20883F8804087FE8000003F8020003F8020003F80000 -BD2A:00000008208820883F8E20883F8804087FE8000000000FF8022002200FF80000 -BD2B:00000008208820883F8E20883F8804087FE8000000800FF803E0041003E00000 -BD2C:0000001200122092209220923F92209E20923F92041204127FD2001200120000 -BD2D:0000002820A820A83FB820A83FA804287FA8000007F800080008000800080000 -BD2E:0000002820A820A83FB820A83FA804287FA8000000003EF80208020802080000 -BD2F:0000002820A820A83FB820A83FA804287FA8000000001F080108011401620000 -BD30:0000002820A820A83FB820A83FA804287FA8000008000800080008000FF80000 -BD31:0000002820A820A83FB820A83FA804287FA80000000010F8101010301ECC0000 -BD32:0000002820A820A83FB820A83FA804287FA800000808087F081C08220F9C0000 -BD33:0000002820A820A83FB820A83FA804287FA8000003F802000200020003F80000 -BD34:0000002820A820A83FB820A83FA804287FA8000007F8000807F8040007F80000 -BD35:0000002820A820A83FB820A83FA804287FA800003EF802083E0820083E080000 -BD36:0000002820A820A83FB820A83FA804287FA800003EF802883E8820883EF80000 -BD37:0000002820A820A83FB820A83FA804287FA800003E8802883EF820883EF80000 -BD38:0000002820A820A83FB820A83FA804287FA800001F0801081F0810141F620000 -BD39:0000002820A820A83FB820A83FA804287FA800003EF802803EF820803EF80000 -BD3A:0000002820A820A83FB820A83FA804287FA800003EFC02483E4820483EFC0000 -BD3B:0000002820A820A83FB820A83FA804287FA800001F08017F1F1C10221F1C0000 -BD3C:0000002820A820A83FB820A83FA804287FA8000003F802080208020803F80000 -BD3D:0000002820A820A83FB820A83FA804287FA800000208020803F8020803F80000 -BD3E:0000002820A820A83FB820A83FA804287FA80000110811081F0811141F620000 -BD3F:0000002820A820A83FB820A83FA804287FA80000001000100010006801840000 -BD40:0000002820A820A83FB820A83FA804287FA800000048004800A8011406620000 -BD41:0000002820A820A83FB820A83FA804287FA80000000003F00408040803F00000 -BD42:0000002820A820A83FB820A83FA804287FA8000003F80020002000D003080000 -BD43:0000002820A820A83FB820A83FA804287FA80000004003F8004000A003180000 -BD44:0000002820A820A83FB820A83FA804287FA8000003F8000803F8000800080000 -BD45:0000002820A820A83FB820A83FA804287FA8000003F8020003F8020003F80000 -BD46:0000002820A820A83FB820A83FA804287FA8000000000FF8022002200FF80000 -BD47:0000002820A820A83FB820A83FA804287FA8000000800FF803E0041003E00000 -BD48:0000000800082088208820883F88208820883F88040804087FE8000800080000 -BD49:00000008208820883F8820883F8804087FE8000007F800080008000800080000 -BD4A:00000008208820883F8820883F8804087FE8000000003EF80208020802080000 -BD4B:00000008208820883F8820883F8804087FE8000000001F080108011401620000 -BD4C:00000008208820883F8820883F8804087FE8000008000800080008000FF80000 -BD4D:00000008208820883F8820883F8804087FE80000000010F8101010301ECC0000 -BD4E:00000008208820883F8820883F8804087FE800000808087F081C08220F9C0000 -BD4F:00000008208820883F8820883F8804087FE8000003F802000200020003F80000 -BD50:00000008208820883F8820883F8804087FE8000007F8000807F8040007F80000 -BD51:00000008208820883F8820883F8804087FE800003EF802083E0820083E080000 -BD52:00000008208820883F8820883F8804087FE800003EF802883E8820883EF80000 -BD53:00000008208820883F8820883F8804087FE800003E8802883EF820883EF80000 -BD54:00000008208820883F8820883F8804087FE800001F0801081F0810141F620000 -BD55:00000008208820883F8820883F8804087FE800003EF802803EF820803EF80000 -BD56:00000008208820883F8820883F8804087FE800003EFC02483E4820483EFC0000 -BD57:00000008208820883F8820883F8804087FE800001F08017F1F1C10221F1C0000 -BD58:00000008208820883F8820883F8804087FE8000003F802080208020803F80000 -BD59:00000008208820883F8820883F8804087FE800000208020803F8020803F80000 -BD5A:00000008208820883F8820883F8804087FE80000110811081F0811141F620000 -BD5B:00000008208820883F8820883F8804087FE80000001000100010006801840000 -BD5C:00000008208820883F8820883F8804087FE800000048004800A8011406620000 -BD5D:00000008208820883F8820883F8804087FE80000000003F00408040803F00000 -BD5E:00000008208820883F8820883F8804087FE8000003F80020002000D003080000 -BD5F:00000008208820883F8820883F8804087FE80000004003F8004000A003180000 -BD60:00000008208820883F8820883F8804087FE8000003F8000803F8000800080000 -BD61:00000008208820883F8820883F8804087FE8000003F8020003F8020003F80000 -BD62:00000008208820883F8820883F8804087FE8000000000FF8022002200FF80000 -BD63:00000008208820883F8820883F8804087FE8000000800FF803E0041003E00000 -BD64:000000001010101010101FF0101010101FF004400440044004407FFC00000000 -BD65:0000101010101FF010101FF0044004407FFC00001FF000100010001000100000 -BD66:0000101010101FF010101FF0044004407FFC000000003EF80208020802080000 -BD67:0000101010101FF010101FF0044004407FFC000000001E100210022802C40000 -BD68:0000101010101FF010101FF0044004407FFC000000001000100010001FF00000 -BD69:0000101010101FF010101FF0044004407FFC0000000020F8201020303ECC0000 -BD6A:0000101010101FF010101FF0044004407FFC0000202021FC207020883E700000 -BD6B:0000101010101FF010101FF0044004407FFC00001FF01000100010001FF00000 -BD6C:0000101010101FF010101FF0044004407FFC00001FF000101FF010001FF00000 -BD6D:0000101010101FF010101FF0044004407FFC00003EF802083E0820083E080000 -BD6E:0000101010101FF010101FF0044004407FFC00003EF802883E8820883EF80000 -BD6F:0000101010101FF010101FF0044004407FFC00003E8802883EF820883EF80000 -BD70:0000101010101FF010101FF0044004407FFC00003E1002103E1020283EC40000 -BD71:0000101010101FF010101FF0044004407FFC00003EF802803EF820803EF80000 -BD72:0000101010101FF010101FF0044004407FFC00003EFC02483E4820483EFC0000 -BD73:0000101010101FF010101FF0044004407FFC00003E2003FC3E7020883E700000 -BD74:0000101010101FF010101FF0044004407FFC00001FF01010101010101FF00000 -BD75:0000101010101FF010101FF0044004407FFC0000101010101FF010101FF00000 -BD76:0000101010101FF010101FF0044004407FFC0000222022203E2022503E880000 -BD77:0000101010101FF010101FF0044004407FFC000000000100010002800C400000 -BD78:0000101010101FF010101FF0044004407FFC00000000024002400DA033100000 -BD79:0000101010101FF010101FF0044004407FFC0000000007C00820082007C00000 -BD7A:0000101010101FF010101FF0044004407FFC0000000007E00080014006200000 -BD7B:0000101010101FF010101FF0044004407FFC0000008007E00080014006200000 -BD7C:0000101010101FF010101FF0044004407FFC00001FF000101FF0001000100000 -BD7D:0000101010101FF010101FF0044004407FFC00001FF010001FF010001FF00000 -BD7E:0000101010101FF010101FF0044004407FFC000000001FF0044004401FF00000 -BD7F:0000101010101FF010101FF0044004407FFC000001001FF007C0082007C00000 -BD80:000000001010101010101FF0101010101FF000003FF801000100010001000000 -BD81:0000101010101FF010101FF000007FFC010001001FF000100010001000100000 -BD82:0000101010101FF010101FF000007FFC0100010000003EF80208020802080000 -BD83:0000101010101FF010101FF000007FFC0100010000001E100210022802C40000 -BD84:0000101010101FF010101FF0000000007FFC010001001100100010001FF00000 -BD85:0000101010101FF010101FF000007FFC01000100000020F8201020303ECC0000 -BD86:0000101010101FF010101FF000007FFC01000100202021FC207020883E700000 -BD87:0000101010101FF010101FF000007FFC010001001FF01000100010001FF00000 -BD88:0000101010101FF010101FF000007FFC010001001FF000101FF010001FF00000 -BD89:0000101010101FF010101FF000007FFC010001003EF802083E0820083E080000 -BD8A:0000101010101FF010101FF000007FFC010001003EF802883E8820883EF80000 -BD8B:0000101010101FF010101FF000007FFC010001003E8802883EF820883EF80000 -BD8C:0000101010101FF010101FF000007FFC010001003E1002103E1020283EC40000 -BD8D:0000101010101FF010101FF000007FFC010001003EF802803EF820803EF80000 -BD8E:0000101010101FF010101FF000007FFC010001003EFC02483E4820483EFC0000 -BD8F:0000101010101FF010101FF000007FFC010001003E2003FC3E7020883E700000 -BD90:0000101010101FF010101FF000007FFC010001001FF01010101010101FF00000 -BD91:0000101010101FF010101FF000007FFC01000100101010101FF010101FF00000 -BD92:0000101010101FF010101FF000007FFC01000100222022203E2022503E880000 -BD93:0000101010101FF010101FF000007FFC0100010000000100010002800C400000 -BD94:0000101010101FF010101FF000007FFC010001000000024002400DA033100000 -BD95:0000101010101FF010101FF000007FFC01000100000007C00820082007C00000 -BD96:0000101010101FF010101FF000007FFC01000100000007E00080014006200000 -BD97:0000101010101FF010101FF000007FFC01000100008007E00080014006200000 -BD98:0000101010101FF010101FF000007FFC010001001FF000101FF0001000100000 -BD99:0000101010101FF010101FF000007FFC010001001FF010001FF010001FF00000 -BD9A:0000101010101FF010101FF000007FFC0100010000001FF0044004401FF00000 -BD9B:0000101010101FF010101FF000007FFC0100010001001FF007C0082007C00000 -BD9C:000000082088208820883F88208820883F8800087FE8040804F8040804080000 -BD9D:208820883F8820883F8800087FE8027802080000000007F80008000800080000 -BD9E:208820883F8820883F8800087FE802780208000000003EF80208020802080000 -BD9F:208820883F8820883F8800087FE802780208000000001F080108011401620000 -BDA0:208820883F8820883F88000800087FE80278020802081000100010001FF80000 -BDA1:208820883F8820883F8800087FE8027802080000000020F8201020303ECC0000 -BDA2:208820883F8820883F8800087FE8027802080000202021FC207020883E700000 -BDA3:208820883F8820883F8800087FE802780208000003F802000200020003F80000 -BDA4:208820883F8820883F8800087FE802780208000007F8000807F8040007F80000 -BDA5:208820883F8820883F8800087FE80278020800003EF802083E0820083E080000 -BDA6:208820883F8820883F8800087FE80278020800003EF802883E8820883EF80000 -BDA7:208820883F8820883F8800087FE80278020800003E8802883EF820883EF80000 -BDA8:208820883F8820883F8800087FE80278020800000F8800880F8808140FA20000 -BDA9:208820883F8820883F8800087FE80278020800003EF802803EF820803EF80000 -BDAA:208820883F8820883F8800087FE80278020800003EFC02483E4820483EFC0000 -BDAB:208820883F8820883F8800087FE80278020800003E1002FE3E3820443E380000 -BDAC:208820883F8820883F8800087FE802780208000003F802080208020803F80000 -BDAD:208820883F8820883F8800087FE80278020800000208020803F8020803F80000 -BDAE:208820883F8820883F8800087FE8027802080000210821083F0821143F620000 -BDAF:208820883F8820883F8800087FE8027802080000001000100010006801840000 -BDB0:208820883F8820883F8800087FE80278020800000048004800A8011406620000 -BDB1:208820883F8820883F8800087FE8027802080000000003F00408040803F00000 -BDB2:208820883F8820883F8800087FE802780208000003F80020002000D003080000 -BDB3:208820883F8820883F8800087FE8027802080000004003F8004000A003180000 -BDB4:208820883F8820883F8800087FE802780208000003F8000803F8000800080000 -BDB5:208820883F8820883F8800087FE802780208000003F8020003F8020003F80000 -BDB6:208820883F8820883F8800087FE802780208000000000FF8022002200FF80000 -BDB7:208820883F8820883F8800087FE802780208000000800FF803E0041003E00000 -BDB8:0000000A208A208A208A3F8A208A208A3F8A000A7FEA040A047A040A040A0000 -BDB9:20A820A83FA820A83FA800287FA805E804280000000007F80008000800080000 -BDBA:20A820A83FA820A83FA800287FA805E80428000000003EF80208020802080000 -BDBB:20A820A83FA820A83FA800287FA805E80428000000001F080108011401620000 -BDBC:20A820A83FA820A83FA8002800287FA8042805E804281428100010001FF80000 -BDBD:20A820A83FA820A83FA800287FA805E804280000000020F8201020303ECC0000 -BDBE:20A820A83FA820A83FA800287FA805E804280000202021FC207020883E700000 -BDBF:20A820A83FA820A83FA800287FA805E80428000003F802000200020003F80000 -BDC0:20A820A83FA820A83FA800287FA805E80428000007F8000807F8040007F80000 -BDC1:20A820A83FA820A83FA800287FA805E8042800003EF802083E0820083E080000 -BDC2:20A820A83FA820A83FA800287FA805E8042800003EF802883E8820883EF80000 -BDC3:20A820A83FA820A83FA800287FA805E8042800003E8802883EF820883EF80000 -BDC4:20A820A83FA820A83FA800287FA805E8042800000F8800880F8808140FA20000 -BDC5:20A820A83FA820A83FA800287FA805E8042800003EF802803EF820803EF80000 -BDC6:20A820A83FA820A83FA800287FA805E8042800003EFC02483E4820483EFC0000 -BDC7:20A820A83FA820A83FA800287FA805E8042800003E1002FE3E3820443E380000 -BDC8:20A820A83FA820A83FA800287FA805E80428000003F802080208020803F80000 -BDC9:20A820A83FA820A83FA800287FA805E8042800000208020803F8020803F80000 -BDCA:20A820A83FA820A83FA800287FA805E804280000210821083F0821143F620000 -BDCB:20A820A83FA820A83FA800287FA805E804280000001000100010006801840000 -BDCC:20A820A83FA820A83FA800287FA805E8042800000048004800A8011406620000 -BDCD:20A820A83FA820A83FA800287FA805E804280000000003F00408040803F00000 -BDCE:20A820A83FA820A83FA800287FA805E80428000003F80020002000D003080000 -BDCF:20A820A83FA820A83FA800287FA805E804280000004003F8004000A003180000 -BDD0:20A820A83FA820A83FA800287FA805E80428000003F8000803F8000800080000 -BDD1:20A820A83FA820A83FA800287FA805E80428000003F8020003F8020003F80000 -BDD2:20A820A83FA820A83FA800287FA805E80428000000000FF8022002200FF80000 -BDD3:20A820A83FA820A83FA800287FA805E80428000000800FF803E0041003E00000 -BDD4:000000082088208820883F88208820883F8800087FE804080408040804080000 -BDD5:208820883F8820883F8800087FE8020802000000000007F80008000800080000 -BDD6:208820883F8820883F8800087FE802080200000000003EF80208020802080000 -BDD7:208820883F8820883F8800087FE802080200000000001F080108011401620000 -BDD8:208820883F8820883F88000800087FE80208020802081008100010001FF80000 -BDD9:208820883F8820883F8800087FE8020802000000000020F8201020303ECC0000 -BDDA:208820883F8820883F8800087FE8020802000000202021FC207020883E700000 -BDDB:208820883F8820883F8800087FE802080200000003F802000200020003F80000 -BDDC:208820883F8820883F8800087FE802080200000007F8000807F8040007F80000 -BDDD:208820883F8820883F8800087FE80208020000003EF802083E0820083E080000 -BDDE:208820883F8820883F8800087FE80208020000003EF802883E8820883EF80000 -BDDF:208820883F8820883F8800087FE80208020000003E8802883EF820883EF80000 -BDE0:208820883F8820883F8800087FE80208020000000F8800880F8808140FA20000 -BDE1:208820883F8820883F8800087FE80208020000003EF802803EF820803EF80000 -BDE2:208820883F8820883F8800087FE80208020000003EFC02483E4820483EFC0000 -BDE3:208820883F8820883F8800087FE80208020000003E1002FE3E3820443E380000 -BDE4:208820883F8820883F8800087FE802080200000003F802080208020803F80000 -BDE5:208820883F8820883F8800087FE80208020000000208020803F8020803F80000 -BDE6:208820883F8820883F8800087FE8020802000000210821083F0821143F620000 -BDE7:208820883F8820883F8800087FE8020802000000001000100010006801840000 -BDE8:208820883F8820883F8800087FE80208020000000048004800A8011406620000 -BDE9:208820883F8820883F8800087FE8020802000000000003F00408040803F00000 -BDEA:208820883F8820883F8800087FE802080200000003F80020002000D003080000 -BDEB:208820883F8820883F8800087FE8020802000000004003F8004000A003180000 -BDEC:208820883F8820883F8800087FE802080200000003F8000803F8000800080000 -BDED:208820883F8820883F8800087FE802080200000003F8020003F8020003F80000 -BDEE:208820883F8820883F8800087FE802080200000000000FF8022002200FF80000 -BDEF:208820883F8820883F8800087FE802080200000000800FF803E0041003E00000 -BDF0:000000001010101010101FF0101010101FF000007FFC04400440044004400000 -BDF1:0000101010101FF010101FF000007FFC044004401FF000100010001000100000 -BDF2:0000101010101FF010101FF000007FFC0440044000003EF80208020802080000 -BDF3:0000101010101FF010101FF000007FFC0440044000001E100210022802C40000 -BDF4:0000101010101FF010101FF0000000007FFC044004401440100010001FF00000 -BDF5:0000101010101FF010101FF000007FFC04400440000020F8201020303ECC0000 -BDF6:0000101010101FF010101FF000007FFC04400440202021FC207020883E700000 -BDF7:0000101010101FF010101FF000007FFC044004401FF01000100010001FF00000 -BDF8:0000101010101FF010101FF000007FFC044004401FF000101FF010001FF00000 -BDF9:0000101010101FF010101FF000007FFC044004403EF802083E0820083E080000 -BDFA:0000101010101FF010101FF000007FFC044004403EF802883E8820883EF80000 -BDFB:0000101010101FF010101FF000007FFC044004403E8802883EF820883EF80000 -BDFC:0000101010101FF010101FF000007FFC044004403E1002103E1020283EC40000 -BDFD:0000101010101FF010101FF000007FFC044004403EF802803EF820803EF80000 -BDFE:0000101010101FF010101FF000007FFC044004403EFC02483E4820483EFC0000 -BDFF:0000101010101FF010101FF000007FFC044004403E2003FC3E7020883E700000 -BE00:0000101010101FF010101FF000007FFC044004401FF01010101010101FF00000 -BE01:0000101010101FF010101FF000007FFC04400440101010101FF010101FF00000 -BE02:0000101010101FF010101FF000007FFC04400440222022203E2022503E880000 -BE03:0000101010101FF010101FF000007FFC0440044000000100010002800C400000 -BE04:0000101010101FF010101FF000007FFC044004400000024002400DA033100000 -BE05:0000101010101FF010101FF000007FFC04400440000007C00820082007C00000 -BE06:0000101010101FF010101FF000007FFC04400440000007E00080014006200000 -BE07:0000101010101FF010101FF000007FFC04400440008007E00080014006200000 -BE08:0000101010101FF010101FF000007FFC044004401FF000101FF0001000100000 -BE09:0000101010101FF010101FF000007FFC044004401FF010001FF010001FF00000 -BE0A:0000101010101FF010101FF000007FFC0440044000001FF0044004401FF00000 -BE0B:0000101010101FF010101FF000007FFC0440044001001FF007C0082007C00000 -BE0C:000000001010101010101FF0101010101FF0000000007FFC0000000000000000 -BE0D:0000101010101FF010101FF0000000007FFC00001FF000100010001000100000 -BE0E:0000101010101FF010101FF0000000007FFC000000003EF80208020802080000 -BE0F:0000101010101FF010101FF0000000007FFC000000001E100210022802C40000 -BE10:0000101010101FF010101FF0000000007FFC000000001000100010001FF00000 -BE11:0000101010101FF010101FF0000000007FFC0000000020F8201020303ECC0000 -BE12:0000101010101FF010101FF0000000007FFC0000202021FC207020883E700000 -BE13:0000101010101FF010101FF0000000007FFC00001FF01000100010001FF00000 -BE14:0000101010101FF010101FF0000000007FFC00001FF000101FF010001FF00000 -BE15:0000101010101FF010101FF0000000007FFC00003EF802083E0820083E080000 -BE16:0000101010101FF010101FF0000000007FFC00003EF802883E8820883EF80000 -BE17:0000101010101FF010101FF0000000007FFC00003E8802883EF820883EF80000 -BE18:0000101010101FF010101FF0000000007FFC00003E1002103E1020283EC40000 -BE19:0000101010101FF010101FF0000000007FFC00003EF802803EF820803EF80000 -BE1A:0000101010101FF010101FF0000000007FFC00003EFC02483E4820483EFC0000 -BE1B:0000101010101FF010101FF0000000007FFC00003E2003FC3E7020883E700000 -BE1C:0000101010101FF010101FF0000000007FFC00001FF01010101010101FF00000 -BE1D:0000101010101FF010101FF0000000007FFC0000101010101FF010101FF00000 -BE1E:0000101010101FF010101FF0000000007FFC0000222022203E2022503E880000 -BE1F:0000101010101FF010101FF0000000007FFC000000000100010002800C400000 -BE20:0000101010101FF010101FF0000000007FFC00000000024002400DA033100000 -BE21:0000101010101FF010101FF0000000007FFC0000000007C00820082007C00000 -BE22:0000101010101FF010101FF0000000007FFC0000000007E00080014006200000 -BE23:0000101010101FF010101FF0000000007FFC0000008007E00080014006200000 -BE24:0000101010101FF010101FF0000000007FFC00001FF000101FF0001000100000 -BE25:0000101010101FF010101FF0000000007FFC00001FF010001FF010001FF00000 -BE26:0000101010101FF010101FF0000000007FFC000000001FF0044004401FF00000 -BE27:0000101010101FF010101FF0000000007FFC000001001FF007C0082007C00000 -BE28:0000000800082088208820883F88208820883F8800087FE80008000800080000 -BE29:00000008208820883F8820883F8800087FE8000007F800080008000800080000 -BE2A:00000008208820883F8820883F8800087FE8000000003EF80208020802080000 -BE2B:00000008208820883F8820883F8800087FE8000000001F080108011401620000 -BE2C:00000008208820883F8820883F8800087FE8000008000800080008000FF80000 -BE2D:00000008208820883F8820883F8800087FE80000000010F8101010301ECC0000 -BE2E:00000008208820883F8820883F8800087FE800000808087F081C08220F9C0000 -BE2F:00000008208820883F8820883F8800087FE8000003F802000200020003F80000 -BE30:00000008208820883F8820883F8800087FE8000007F8000807F8040007F80000 -BE31:00000008208820883F8820883F8800087FE800003EF802083E0820083E080000 -BE32:00000008208820883F8820883F8800087FE800003EF802883E8820883EF80000 -BE33:00000008208820883F8820883F8800087FE800003E8802883EF820883EF80000 -BE34:00000008208820883F8820883F8800087FE800001F0801081F0810141F620000 -BE35:00000008208820883F8820883F8800087FE800003EF802803EF820803EF80000 -BE36:00000008208820883F8820883F8800087FE800003EFC02483E4820483EFC0000 -BE37:00000008208820883F8820883F8800087FE800001F08017F1F1C10221F1C0000 -BE38:00000008208820883F8820883F8800087FE8000003F802080208020803F80000 -BE39:00000008208820883F8820883F8800087FE800000208020803F8020803F80000 -BE3A:00000008208820883F8820883F8800087FE80000110811081F0811141F620000 -BE3B:00000008208820883F8820883F8800087FE80000001000100010006801840000 -BE3C:00000008208820883F8820883F8800087FE800000048004800A8011406620000 -BE3D:00000008208820883F8820883F8800087FE80000000003F00408040803F00000 -BE3E:00000008208820883F8820883F8800087FE8000003F80020002000D003080000 -BE3F:00000008208820883F8820883F8800087FE80000004003F8004000A003180000 -BE40:00000008208820883F8820883F8800087FE8000003F8000803F8000800080000 -BE41:00000008208820883F8820883F8800087FE8000003F8020003F8020003F80000 -BE42:00000008208820883F8820883F8800087FE8000000000FF8022002200FF80000 -BE43:00000008208820883F8820883F8800087FE8000000800FF803E0041003E00000 -BE44:00000000000800082088208820883F882088208820883F880008000800080000 -BE45:000000080008420842087E0842087E0800080000000007F80008000800080000 -BE46:000000080008420842087E0842087E080008000000003EF80208020802080000 -BE47:000000080008420842087E0842087E080008000000001F080108011401620000 -BE48:000000080008420842087E0842087E080008000800001000100010001FF80000 -BE49:000000080008420842087E0842087E0800080000000020F8201020303ECC0000 -BE4A:000000080008420842087E0842087E0800080000202021FC207020883E700000 -BE4B:000000080008420842087E0842087E080008000003F802000200020003F80000 -BE4C:000000080008420842087E0842087E080008000007F8000807F8040007F80000 -BE4D:000000080008420842087E0842087E08000800003EF802083E0820083E080000 -BE4E:000000080008420842087E0842087E08000800003EF802883E8820883EF80000 -BE4F:000000080008420842087E0842087E08000800003E8802883EF820883EF80000 -BE50:000000080008420842087E0842087E08000800000F8800880F8808140FA20000 -BE51:000000080008420842087E0842087E08000800003EF802803EF820803EF80000 -BE52:000000080008420842087E0842087E08000800003EFC02483E4820483EFC0000 -BE53:000000080008420842087E0842087E08000800003E1002FE3E3820443E380000 -BE54:000000080008420842087E0842087E080008000003F802080208020803F80000 -BE55:000000080008420842087E0842087E08000800000208020803F8020803F80000 -BE56:000000080008420842087E0842087E0800080000210821083F0821143F620000 -BE57:000000080008420842087E0842087E0800080000001000100010006801840000 -BE58:000000080008420842087E0842087E08000800000048004800A8011406620000 -BE59:000000080008420842087E0842087E0800080000000003F00408040803F00000 -BE5A:000000080008420842087E0842087E080008000003F80020002000D003080000 -BE5B:000000080008420842087E0842087E0800080000004003F8004000A003180000 -BE5C:000000080008420842087E0842087E080008000003F8000803F8000800080000 -BE5D:000000080008420842087E0842087E080008000003F8020003F8020003F80000 -BE5E:000000080008420842087E0842087E080008000000000FF8022002200FF80000 -BE5F:000000080008420842087E0842087E080008000000800FF803E0041003E00000 -BE60:00000000001000102490249024903F9E249024903F9000100010001000100000 -BE61:000000084908490849087F0E49087F080008000007F800080008000800080000 -BE62:000000084908490849087F0E49087F080008000000003EF80208020802080000 -BE63:000000084908490849087F0E49087F080008000000001F080108011401620000 -BE64:000000084908490849087F0E49087F080008000808000800080008000FF80000 -BE65:000000084908490849087F0E49087F0800080000000010F8101010301ECC0000 -BE66:000000084908490849087F0E49087F08000800000808087F081C08220F9C0000 -BE67:000000084908490849087F0E49087F080008000003F802000200020003F80000 -BE68:000000084908490849087F0E49087F080008000007F8000807F8040007F80000 -BE69:000000084908490849087F0E49087F08000800003EF802083E0820083E080000 -BE6A:000000084908490849087F0E49087F08000800003EF802883E8820883EF80000 -BE6B:000000084908490849087F0E49087F08000800003E8802883EF820883EF80000 -BE6C:000000084908490849087F0E49087F08000800001F0801081F0810141F620000 -BE6D:000000084908490849087F0E49087F08000800003EF802803EF820803EF80000 -BE6E:000000084908490849087F0E49087F08000800003EFC02483E4820483EFC0000 -BE6F:000000084908490849087F0E49087F08000800001F08017F1F1C10221F1C0000 -BE70:000000084908490849087F0E49087F080008000003F802080208020803F80000 -BE71:000000084908490849087F0E49087F08000800000208020803F8020803F80000 -BE72:000000084908490849087F0E49087F0800080000110811081F0811141F620000 -BE73:000000084908490849087F0E49087F0800080000001000100010006801840000 -BE74:000000084908490849087F0E49087F08000800000048004800A8011406620000 -BE75:000000084908490849087F0E49087F0800080000000003F00408040803F00000 -BE76:000000084908490849087F0E49087F080008000003F80020002000D003080000 -BE77:000000084908490849087F0E49087F0800080000004003F8004000A003180000 -BE78:000000084908490849087F0E49087F080008000003F8000803F8000800080000 -BE79:000000084908490849087F0E49087F080008000003F8020003F8020003F80000 -BE7A:000000084908490849087F0E49087F080008000000000FF8022002200FF80000 -BE7B:000000084908490849087F0E49087F080008000000800FF803E0041003E00000 -BE7C:00000000001200122492249224923F9E249224923F9200120012001200120000 -BE7D:000000284928492849287F3849287F280028000007F800080008000800080000 -BE7E:000000284928492849287F3849287F280028000000003EF80208020802080000 -BE7F:000000284928492849287F3849287F280028000000003E100210022802C40000 -BE80:000000284928492849287F3849287F280028002808000800080008000FF80000 -BE81:000000284928492849287F3849287F2800280000000020F8201020303ECC0000 -BE82:000000284928492849287F3849287F2800280000202021FC207020883E700000 -BE83:000000284928492849287F3849287F280028000003F802000200020003F80000 -BE84:000000284928492849287F3849287F280028000007F8000807F8040007F80000 -BE85:000000284928492849287F3849287F28002800003EF802083E0820083E080000 -BE86:000000284928492849287F3849287F28002800003EF802883E8820883EF80000 -BE87:000000284928492849287F3849287F28002800003E8802883EF820883EF80000 -BE88:000000284928492849287F3849287F28002800001F0801081F0810141F620000 -BE89:000000284928492849287F3849287F28002800003EF802803EF820803EF80000 -BE8A:000000284928492849287F3849287F28002800003EFC02483E4820483EFC0000 -BE8B:000000284928492849287F3849287F28002800003E1002FE3E3820443E380000 -BE8C:000000284928492849287F3849287F280028000003F802080208020803F80000 -BE8D:000000284928492849287F3849287F28002800000208020803F8020803F80000 -BE8E:000000284928492849287F3849287F2800280000110811081F0811141F620000 -BE8F:000000284928492849287F3849287F2800280000000800080008003400C20000 -BE90:000000284928492849287F3849287F28002800000048004800A8011406620000 -BE91:000000284928492849287F3849287F2800280000000001F00208020801F00000 -BE92:000000284928492849287F3849287F280028000003F80020002000D003080000 -BE93:000000284928492849287F3849287F2800280000004003F8004000A003180000 -BE94:000000284928492849287F3849287F280028000003F8000803F8000800080000 -BE95:000000284928492849287F3849287F280028000003F8020003F8020003F80000 -BE96:000000284928492849287F3849287F280028000000000FF8022002200FF80000 -BE97:000000284928492849287F3849287F280028000000800FF803E0041003E00000 -BE98:000000000010001024902490249E3F902490249E3F9000100010001000100000 -BE99:0000000849084908490E7F08490E7F080008000007F800080008000800080000 -BE9A:0000000849084908490E7F08490E7F080008000000003EF80208020802080000 -BE9B:0000000849084908490E7F08490E7F080008000000001F080108011401620000 -BE9C:0000000849084908490E7F08490E7F080008000008000800080008000FF80000 -BE9D:0000000849084908490E7F08490E7F0800080000000010F8101010301ECC0000 -BE9E:0000000849084908490E7F08490E7F08000800000808087F081C08220F9C0000 -BE9F:0000000849084908490E7F08490E7F080008000003F802000200020003F80000 -BEA0:0000000849084908490E7F08490E7F080008000007F8000807F8040007F80000 -BEA1:0000000849084908490E7F08490E7F08000800003EF802083E0820083E080000 -BEA2:0000000849084908490E7F08490E7F08000800003EF802883E8820883EF80000 -BEA3:0000000849084908490E7F08490E7F08000800003E8802883EF820883EF80000 -BEA4:0000000849084908490E7F08490E7F08000800001F0801081F0810141F620000 -BEA5:0000000849084908490E7F08490E7F08000800003EF802803EF820803EF80000 -BEA6:0000000849084908490E7F08490E7F08000800003EFC02483E4820483EFC0000 -BEA7:0000000849084908490E7F08490E7F08000800001F08017F1F1C10221F1C0000 -BEA8:0000000849084908490E7F08490E7F080008000003F802080208020803F80000 -BEA9:0000000849084908490E7F08490E7F08000800000208020803F8020803F80000 -BEAA:0000000849084908490E7F08490E7F0800080000110811081F0811141F620000 -BEAB:0000000849084908490E7F08490E7F0800080000001000100010006801840000 -BEAC:0000000849084908490E7F08490E7F08000800000048004800A8011406620000 -BEAD:0000000849084908490E7F08490E7F0800080000000003F00408040803F00000 -BEAE:0000000849084908490E7F08490E7F080008000003F80020002000D003080000 -BEAF:0000000849084908490E7F08490E7F0800080000004003F8004000A003180000 -BEB0:0000000849084908490E7F08490E7F080008000003F8000803F8000800080000 -BEB1:0000000849084908490E7F08490E7F080008000003F8020003F8020003F80000 -BEB2:0000000849084908490E7F08490E7F080008000000000FF8022002200FF80000 -BEB3:0000000849084908490E7F08490E7F080008000000800FF803E0041003E00000 -BEB4:000000000012001224922492249E3F922492249E3F9200120012001200120000 -BEB5:000000284928492849387F2849387F280028000007F800080008000800080000 -BEB6:000000284928492849387F2849387F280028000000003EF80208020802080000 -BEB7:000000284928492849387F2849387F280028000000003E100210022802C40000 -BEB8:000000284928492849387F2849387F280028002808000800080008000FF80000 -BEB9:000000284928492849387F2849387F2800280000000020F8201020303ECC0000 -BEBA:000000284928492849387F2849387F2800280000202021FC207020883E700000 -BEBB:000000284928492849387F2849387F280028000003F802000200020003F80000 -BEBC:000000284928492849387F2849387F280028000007F8000807F8040007F80000 -BEBD:000000284928492849387F2849387F28002800003EF802083E0820083E080000 -BEBE:000000284928492849387F2849387F28002800003EF802883E8820883EF80000 -BEBF:000000284928492849387F2849387F28002800003E8802883EF820883EF80000 -BEC0:000000284928492849387F2849387F28002800001F0801081F0810141F620000 -BEC1:000000284928492849387F2849387F28002800003EF802803EF820803EF80000 -BEC2:000000284928492849387F2849387F28002800003EFC02483E4820483EFC0000 -BEC3:000000284928492849387F2849387F28002800003E1002FE3E3820443E380000 -BEC4:000000284928492849387F2849387F280028000003F802080208020803F80000 -BEC5:000000284928492849387F2849387F28002800000208020803F8020803F80000 -BEC6:000000284928492849387F2849387F2800280000110811081F0811141F620000 -BEC7:000000284928492849387F2849387F2800280000000800080008003400C20000 -BEC8:000000284928492849387F2849387F28002800000048004800A8011406620000 -BEC9:000000284928492849387F2849387F2800280000000001F00208020801F00000 -BECA:000000284928492849387F2849387F280028000003F80020002000D003080000 -BECB:000000284928492849387F2849387F2800280000004003F8004000A003180000 -BECC:000000284928492849387F2849387F280028000003F8000803F8000800080000 -BECD:000000284928492849387F2849387F280028000003F8020003F8020003F80000 -BECE:000000284928492849387F2849387F280028000000000FF8022002200FF80000 -BECF:000000284928492849387F2849387F280028000000800FF803E0041003E00000 -BED0:00000000000200022482248224823F9E248224823F8200020002000200020000 -BED1:000000084908490849087F3849087F0800080000000007F80008000800080000 -BED2:000000084908490849087F3849087F080008000000003EF80208020802080000 -BED3:000000084908490849087F3849087F080008000000001F080108011401620000 -BED4:000000084908490849087F3849087F080008000000001000100010001FF80000 -BED5:000000084908490849087F3849087F0800080000000020F8201020303ECC0000 -BED6:000000084908490849087F3849087F0800080000202021FC207020883E700000 -BED7:000000084908490849087F3849087F080008000003F802000200020003F80000 -BED8:000000084908490849087F3849087F080008000007F8000807F8040007F80000 -BED9:000000084908490849087F3849087F08000800003EF802083E0820083E080000 -BEDA:000000084908490849087F3849087F08000800003EF802883E8820883EF80000 -BEDB:000000084908490849087F3849087F08000800003E8802883EF820883EF80000 -BEDC:000000084908490849087F3849087F08000800000F8800880F8808140FA20000 -BEDD:000000084908490849087F3849087F08000800003EF802803EF820803EF80000 -BEDE:000000084908490849087F3849087F08000800003EFC02483E4820483EFC0000 -BEDF:000000084908490849087F3849087F08000800003E1002FE3E3820443E380000 -BEE0:000000084908490849087F3849087F080008000003F802080208020803F80000 -BEE1:000000084908490849087F3849087F08000800000208020803F8020803F80000 -BEE2:000000084908490849087F3849087F0800080000210821083F0821143F620000 -BEE3:000000084908490849087F3849087F0800080000001000100010006801840000 -BEE4:000000084908490849087F3849087F08000800000048004800A8011406620000 -BEE5:000000084908490849087F3849087F0800080000000003F00408040803F00000 -BEE6:000000084908490849087F3849087F080008000003F80020002000D003080000 -BEE7:000000084908490849087F3849087F0800080000004003F8004000A003180000 -BEE8:000000084908490849087F3849087F080008000003F8000803F8000800080000 -BEE9:000000084908490849087F3849087F080008000003F8020003F8020003F80000 -BEEA:000000084908490849087F3849087F080008000000000FF8022002200FF80000 -BEEB:000000084908490849087F3849087F080008000000800FF803E0041003E00000 -BEEC:00000000000A000A248A248A248A3FBA248A248A3F8A000A000A000A000A0000 -BEED:000000284928492849287FE849287F280028000007F800080008000800080000 -BEEE:000000284928492849287FE849287F280028000000003EF80208020802080000 -BEEF:000000284928492849287FE849287F280028000000003E100210022802C40000 -BEF0:000000284928492849287FE849287F280028000008000800080008000FF80000 -BEF1:000000284928492849287FE849287F2800280000000020F8201020303ECC0000 -BEF2:000000284928492849287FE849287F2800280000202021FC207020883E700000 -BEF3:000000284928492849287FE849287F280028000003F802000200020003F80000 -BEF4:000000284928492849287FE849287F280028000007F8000807F8040007F80000 -BEF5:000000284928492849287FE849287F28002800003EF802083E0820083E080000 -BEF6:000000284928492849287FE849287F28002800003EF802883E8820883EF80000 -BEF7:000000284928492849287FE849287F28002800003E8802883EF820883EF80000 -BEF8:000000284928492849287FE849287F28002800001F0801081F0810141F620000 -BEF9:000000284928492849287FE849287F28002800003EF802803EF820803EF80000 -BEFA:000000284928492849287FE849287F28002800003EFC02483E4820483EFC0000 -BEFB:000000284928492849287FE849287F28002800003E1002FE3E3820443E380000 -BEFC:000000284928492849287FE849287F280028000003F802080208020803F80000 -BEFD:000000284928492849287FE849287F28002800000208020803F8020803F80000 -BEFE:000000284928492849287FE849287F2800280000110811081F0811141F620000 -BEFF:000000284928492849287FE849287F2800280000000800080008003400C20000 -BF00:000000284928492849287FE849287F28002800000048004800A8011406620000 -BF01:000000284928492849287FE849287F2800280000000001F00208020801F00000 -BF02:000000284928492849287FE849287F280028000003F80020002000D003080000 -BF03:000000284928492849287FE849287F2800280000004003F8004000A003180000 -BF04:000000284928492849287FE849287F280028000003F8000803F8000800080000 -BF05:000000284928492849287FE849287F280028000003F8020003F8020003F80000 -BF06:000000284928492849287FE849287F280028000000000FF8022002200FF80000 -BF07:000000284928492849287FE849287F280028000000800FF803E0041003E00000 -BF08:000000000002000224822482249E3F822482249E3F8200020002000200020000 -BF09:000000084908490849387F0849387F0800080000000007F80008000800080000 -BF0A:000000084908490849387F0849387F080008000000003EF80208020802080000 -BF0B:000000084908490849387F0849387F080008000000001F080108011401620000 -BF0C:000000084908490849387F0849387F080008000800001000100010001FF80000 -BF0D:000000084908490849387F0849387F0800080000000020F8201020303ECC0000 -BF0E:000000084908490849387F0849387F0800080000202021FC207020883E700000 -BF0F:000000084908490849387F0849387F080008000003F802000200020003F80000 -BF10:000000084908490849387F0849387F080008000007F8000807F8040007F80000 -BF11:000000084908490849387F0849387F08000800003EF802083E0820083E080000 -BF12:000000084908490849387F0849387F08000800003EF802883E8820883EF80000 -BF13:000000084908490849387F0849387F08000800003E8802883EF820883EF80000 -BF14:000000084908490849387F0849387F08000800000F8800880F8808140FA20000 -BF15:000000084908490849387F0849387F08000800003EF802803EF820803EF80000 -BF16:000000084908490849387F0849387F08000800003EFC02483E4820483EFC0000 -BF17:000000084908490849387F0849387F08000800003E1002FE3E3820443E380000 -BF18:000000084908490849387F0849387F080008000003F802080208020803F80000 -BF19:000000084908490849387F0849387F08000800000208020803F8020803F80000 -BF1A:000000084908490849387F0849387F0800080000210821083F0821143F620000 -BF1B:000000084908490849387F0849387F0800080000001000100010006801840000 -BF1C:000000084908490849387F0849387F08000800000048004800A8011406620000 -BF1D:000000084908490849387F0849387F0800080000000003F00408040803F00000 -BF1E:000000084908490849387F0849387F080008000003F80020002000D003080000 -BF1F:000000084908490849387F0849387F0800080000004003F8004000A003180000 -BF20:000000084908490849387F0849387F080008000003F8000803F8000800080000 -BF21:000000084908490849387F0849387F080008000003F8020003F8020003F80000 -BF22:000000084908490849387F0849387F080008000000000FF8022002200FF80000 -BF23:000000084908490849387F0849387F080008000000800FF803E0041003E00000 -BF24:00000000000A000A248A248A24BA3F8A248A24BA3F8A000A000A000A000A0000 -BF25:000000284928492849E87F2849E87F280028000007F800080008000800080000 -BF26:000000284928492849E87F2849E87F280028000000003EF80208020802080000 -BF27:000000284928492849E87F2849E87F280028000000003E100210022802C40000 -BF28:000000284928492849E87F2849E87F280028002808000800080008000FF80000 -BF29:000000284928492849E87F2849E87F2800280000000020F8201020303ECC0000 -BF2A:000000284928492849E87F2849E87F2800280000202021FC207020883E700000 -BF2B:000000284928492849E87F2849E87F280028000003F802000200020003F80000 -BF2C:000000284928492849E87F2849E87F280028000007F8000807F8040007F80000 -BF2D:000000284928492849E87F2849E87F28002800003EF802083E0820083E080000 -BF2E:000000284928492849E87F2849E87F28002800003EF802883E8820883EF80000 -BF2F:000000284928492849E87F2849E87F28002800003E8802883EF820883EF80000 -BF30:000000284928492849E87F2849E87F28002800001F0801081F0810141F620000 -BF31:000000284928492849E87F2849E87F28002800003EF802803EF820803EF80000 -BF32:000000284928492849E87F2849E87F28002800003EFC02483E4820483EFC0000 -BF33:000000284928492849E87F2849E87F28002800003E1002FE3E3820443E380000 -BF34:000000284928492849E87F2849E87F280028000003F802080208020803F80000 -BF35:000000284928492849E87F2849E87F28002800000208020803F8020803F80000 -BF36:000000284928492849E87F2849E87F2800280000110811081F0811141F620000 -BF37:000000284928492849E87F2849E87F2800280000000800080008003400C20000 -BF38:000000284928492849E87F2849E87F28002800000048004800A8011406620000 -BF39:000000284928492849E87F2849E87F2800280000000001F00208020801F00000 -BF3A:000000284928492849E87F2849E87F280028000003F80020002000D003080000 -BF3B:000000284928492849E87F2849E87F2800280000004003F8004000A003180000 -BF3C:000000284928492849E87F2849E87F280028000003F8000803F8000800080000 -BF3D:000000284928492849E87F2849E87F280028000003F8020003F8020003F80000 -BF3E:000000284928492849E87F2849E87F280028000000000FF8022002200FF80000 -BF3F:000000284928492849E87F2849E87F280028000000800FF803E0041003E00000 -BF40:000000002108210821083FF8210821083FF800000100010001007FFC00000000 -BF41:0000210821083FF821083FF8010001007FFC00001FF000100010001000100000 -BF42:0000210821083FF821083FF8010001007FFC000000003EF80208020802080000 -BF43:0000210821083FF821083FF8010001007FFC000000001E100210022802C40000 -BF44:0000210821083FF821083FF8010001007FFC000000001000100010001FF00000 -BF45:0000210821083FF821083FF8010001007FFC0000000020F8201020303ECC0000 -BF46:0000210821083FF821083FF8010001007FFC0000202021FC207020883E700000 -BF47:0000210821083FF821083FF8010001007FFC00001FF01000100010001FF00000 -BF48:0000210821083FF821083FF8010001007FFC00001FF000101FF010001FF00000 -BF49:0000210821083FF821083FF8010001007FFC00003EF802083E0820083E080000 -BF4A:0000210821083FF821083FF8010001007FFC00003EF802883E8820883EF80000 -BF4B:0000210821083FF821083FF8010001007FFC00003E8802883EF820883EF80000 -BF4C:0000210821083FF821083FF8010001007FFC00003E1002103E1020283EC40000 -BF4D:0000210821083FF821083FF8010001007FFC00003EF802803EF820803EF80000 -BF4E:0000210821083FF821083FF8010001007FFC00003EFC02483E4820483EFC0000 -BF4F:0000210821083FF821083FF8010001007FFC00003E2003FC3E7020883E700000 -BF50:0000210821083FF821083FF8010001007FFC00001FF01010101010101FF00000 -BF51:0000210821083FF821083FF8010001007FFC0000101010101FF010101FF00000 -BF52:0000210821083FF821083FF8010001007FFC0000222022203E2022503E880000 -BF53:0000210821083FF821083FF8010001007FFC000000000100010002800C400000 -BF54:0000210821083FF821083FF8010001007FFC00000000024002400DA033100000 -BF55:0000210821083FF821083FF8010001007FFC0000000007C00820082007C00000 -BF56:0000210821083FF821083FF8010001007FFC0000000007E00080014006200000 -BF57:0000210821083FF821083FF8010001007FFC0000008007E00080014006200000 -BF58:0000210821083FF821083FF8010001007FFC00001FF000101FF0001000100000 -BF59:0000210821083FF821083FF8010001007FFC00001FF010001FF010001FF00000 -BF5A:0000210821083FF821083FF8010001007FFC000000001FF0044004401FF00000 -BF5B:0000210821083FF821083FF8010001007FFC000001001FF007C0082007C00000 -BF5C:0000001000104450445044507FD0445E44507FD0041004107FD0001000100000 -BF5D:0000248824883F88248E3F88040804087FE8000007F800080008000800080000 -BF5E:0000248824883F88248E3F88040804087FE8000000003EF80208020802080000 -BF5F:0000248824883F88248E3F88040804087FE8000000001F080108011401620000 -BF60:0000248824883F88248E3F88040804087FE8000008000800080008000FF80000 -BF61:0000248824883F88248E3F88040804087FE80000000010F8101010301ECC0000 -BF62:0000248824883F88248E3F88040804087FE800000808087F081C08220F9C0000 -BF63:0000248824883F88248E3F88040804087FE8000003F802000200020003F80000 -BF64:0000248824883F88248E3F88040804087FE8000007F8000807F8040007F80000 -BF65:0000248824883F88248E3F88040804087FE800003EF802083E0820083E080000 -BF66:0000248824883F88248E3F88040804087FE800003EF802883E8820883EF80000 -BF67:0000248824883F88248E3F88040804087FE800003E8802883EF820883EF80000 -BF68:0000248824883F88248E3F88040804087FE800001F0801081F0810141F620000 -BF69:0000248824883F88248E3F88040804087FE800003EF802803EF820803EF80000 -BF6A:0000248824883F88248E3F88040804087FE800003EFC02483E4820483EFC0000 -BF6B:0000248824883F88248E3F88040804087FE800001F08017F1F1C10221F1C0000 -BF6C:0000248824883F88248E3F88040804087FE8000003F802080208020803F80000 -BF6D:0000248824883F88248E3F88040804087FE800000208020803F8020803F80000 -BF6E:0000248824883F88248E3F88040804087FE80000110811081F0811141F620000 -BF6F:0000248824883F88248E3F88040804087FE80000001000100010006801840000 -BF70:0000248824883F88248E3F88040804087FE800000048004800A8011406620000 -BF71:0000248824883F88248E3F88040804087FE80000000003F00408040803F00000 -BF72:0000248824883F88248E3F88040804087FE8000003F80020002000D003080000 -BF73:0000248824883F88248E3F88040804087FE80000004003F8004000A003180000 -BF74:0000248824883F88248E3F88040804087FE8000003F8000803F8000800080000 -BF75:0000248824883F88248E3F88040804087FE8000003F8020003F8020003F80000 -BF76:0000248824883F88248E3F88040804087FE8000000000FF8022002200FF80000 -BF77:0000248824883F88248E3F88040804087FE8000000800FF803E0041003E00000 -BF78:0000001200124452445244527FD2445E44527FD2041204127FD2001200120000 -BF79:000024A824A83FA824B83FA8042804287FA8000007F800080008000800080000 -BF7A:000024A824A83FA824B83FA8042804287FA8000000003EF80208020802080000 -BF7B:000024A824A83FA824B83FA8042804287FA8000000001F080108011401620000 -BF7C:000024A824A83FA824B83FA8042804287FA8000008000800080008000FF80000 -BF7D:000024A824A83FA824B83FA8042804287FA80000000010F8101010301ECC0000 -BF7E:000024A824A83FA824B83FA8042804287FA800000808087F081C08220F9C0000 -BF7F:000024A824A83FA824B83FA8042804287FA8000003F802000200020003F80000 -BF80:000024A824A83FA824B83FA8042804287FA8000007F8000807F8040007F80000 -BF81:000024A824A83FA824B83FA8042804287FA800003EF802083E0820083E080000 -BF82:000024A824A83FA824B83FA8042804287FA800003EF802883E8820883EF80000 -BF83:000024A824A83FA824B83FA8042804287FA800003E8802883EF820883EF80000 -BF84:000024A824A83FA824B83FA8042804287FA800001F0801081F0810141F620000 -BF85:000024A824A83FA824B83FA8042804287FA800003EF802803EF820803EF80000 -BF86:000024A824A83FA824B83FA8042804287FA800003EFC02483E4820483EFC0000 -BF87:000024A824A83FA824B83FA8042804287FA800001F08017F1F1C10221F1C0000 -BF88:000024A824A83FA824B83FA8042804287FA8000003F802080208020803F80000 -BF89:000024A824A83FA824B83FA8042804287FA800000208020803F8020803F80000 -BF8A:000024A824A83FA824B83FA8042804287FA80000110811081F0811141F620000 -BF8B:000024A824A83FA824B83FA8042804287FA80000001000100010006801840000 -BF8C:000024A824A83FA824B83FA8042804287FA800000048004800A8011406620000 -BF8D:000024A824A83FA824B83FA8042804287FA80000000003F00408040803F00000 -BF8E:000024A824A83FA824B83FA8042804287FA8000003F80020002000D003080000 -BF8F:000024A824A83FA824B83FA8042804287FA80000004003F8004000A003180000 -BF90:000024A824A83FA824B83FA8042804287FA8000003F8000803F8000800080000 -BF91:000024A824A83FA824B83FA8042804287FA8000003F8020003F8020003F80000 -BF92:000024A824A83FA824B83FA8042804287FA8000000000FF8022002200FF80000 -BF93:000024A824A83FA824B83FA8042804287FA8000000800FF803E0041003E00000 -BF94:0000000800084448444844487FC8444844487FC8040804087FE8000800080000 -BF95:0000248824883F8824883F88040804087FE8000007F800080008000800080000 -BF96:0000248824883F8824883F88040804087FE8000000003EF80208020802080000 -BF97:0000248824883F8824883F88040804087FE8000000001F080108011401620000 -BF98:0000248824883F8824883F88040804087FE8000008000800080008000FF80000 -BF99:0000248824883F8824883F88040804087FE80000000010F8101010301ECC0000 -BF9A:0000248824883F8824883F88040804087FE800000808087F081C08220F9C0000 -BF9B:0000248824883F8824883F88040804087FE8000003F802000200020003F80000 -BF9C:0000248824883F8824883F88040804087FE8000007F8000807F8040007F80000 -BF9D:0000248824883F8824883F88040804087FE800003EF802083E0820083E080000 -BF9E:0000248824883F8824883F88040804087FE800003EF802883E8820883EF80000 -BF9F:0000248824883F8824883F88040804087FE800003E8802883EF820883EF80000 -BFA0:0000248824883F8824883F88040804087FE800001F0801081F0810141F620000 -BFA1:0000248824883F8824883F88040804087FE800003EF802803EF820803EF80000 -BFA2:0000248824883F8824883F88040804087FE800003EFC02483E4820483EFC0000 -BFA3:0000248824883F8824883F88040804087FE800001F08017F1F1C10221F1C0000 -BFA4:0000248824883F8824883F88040804087FE8000003F802080208020803F80000 -BFA5:0000248824883F8824883F88040804087FE800000208020803F8020803F80000 -BFA6:0000248824883F8824883F88040804087FE80000110811081F0811141F620000 -BFA7:0000248824883F8824883F88040804087FE80000001000100010006801840000 -BFA8:0000248824883F8824883F88040804087FE800000048004800A8011406620000 -BFA9:0000248824883F8824883F88040804087FE80000000003F00408040803F00000 -BFAA:0000248824883F8824883F88040804087FE8000003F80020002000D003080000 -BFAB:0000248824883F8824883F88040804087FE80000004003F8004000A003180000 -BFAC:0000248824883F8824883F88040804087FE8000003F8000803F8000800080000 -BFAD:0000248824883F8824883F88040804087FE8000003F8020003F8020003F80000 -BFAE:0000248824883F8824883F88040804087FE8000000000FF8022002200FF80000 -BFAF:0000248824883F8824883F88040804087FE8000000800FF803E0041003E00000 -BFB0:000000002108210821083FF8210821083FF804400440044004407FFC00000000 -BFB1:0000210821083FF821083FF8044004407FFC00001FF000100010001000100000 -BFB2:0000210821083FF821083FF8044004407FFC000000003EF80208020802080000 -BFB3:0000210821083FF821083FF8044004407FFC000000001E100210022802C40000 -BFB4:0000210821083FF821083FF8044004407FFC000000001000100010001FF00000 -BFB5:0000210821083FF821083FF8044004407FFC0000000020F8201020303ECC0000 -BFB6:0000210821083FF821083FF8044004407FFC0000202021FC207020883E700000 -BFB7:0000210821083FF821083FF8044004407FFC00001FF01000100010001FF00000 -BFB8:0000210821083FF821083FF8044004407FFC00001FF000101FF010001FF00000 -BFB9:0000210821083FF821083FF8044004407FFC00003EF802083E0820083E080000 -BFBA:0000210821083FF821083FF8044004407FFC00003EF802883E8820883EF80000 -BFBB:0000210821083FF821083FF8044004407FFC00003E8802883EF820883EF80000 -BFBC:0000210821083FF821083FF8044004407FFC00003E1002103E1020283EC40000 -BFBD:0000210821083FF821083FF8044004407FFC00003EF802803EF820803EF80000 -BFBE:0000210821083FF821083FF8044004407FFC00003EFC02483E4820483EFC0000 -BFBF:0000210821083FF821083FF8044004407FFC00003E2003FC3E7020883E700000 -BFC0:0000210821083FF821083FF8044004407FFC00001FF01010101010101FF00000 -BFC1:0000210821083FF821083FF8044004407FFC0000101010101FF010101FF00000 -BFC2:0000210821083FF821083FF8044004407FFC0000222022203E2022503E880000 -BFC3:0000210821083FF821083FF8044004407FFC000000000100010002800C400000 -BFC4:0000210821083FF821083FF8044004407FFC00000000024002400DA033100000 -BFC5:0000210821083FF821083FF8044004407FFC0000000007C00820082007C00000 -BFC6:0000210821083FF821083FF8044004407FFC0000000007E00080014006200000 -BFC7:0000210821083FF821083FF8044004407FFC0000008007E00080014006200000 -BFC8:0000210821083FF821083FF8044004407FFC00001FF000101FF0001000100000 -BFC9:0000210821083FF821083FF8044004407FFC00001FF010001FF010001FF00000 -BFCA:0000210821083FF821083FF8044004407FFC000000001FF0044004401FF00000 -BFCB:0000210821083FF821083FF8044004407FFC000001001FF007C0082007C00000 -BFCC:000000002108210821083FF8210821083FF800003FF801000100010001000000 -BFCD:0000210821083FF821083FF800007FFC010001001FF000100010001000100000 -BFCE:0000210821083FF821083FF800007FFC0100010000003EF80208020802080000 -BFCF:0000210821083FF821083FF800007FFC0100010000001E100210022802C40000 -BFD0:0000210821083FF821083FF8000000007FFC010001001100100010001FF00000 -BFD1:0000210821083FF821083FF800007FFC01000100000020F8201020303ECC0000 -BFD2:0000210821083FF821083FF800007FFC01000100202021FC207020883E700000 -BFD3:0000210821083FF821083FF800007FFC010001001FF01000100010001FF00000 -BFD4:0000210821083FF821083FF800007FFC010001001FF000101FF010001FF00000 -BFD5:0000210821083FF821083FF800007FFC010001003EF802083E0820083E080000 -BFD6:0000210821083FF821083FF800007FFC010001003EF802883E8820883EF80000 -BFD7:0000210821083FF821083FF800007FFC010001003E8802883EF820883EF80000 -BFD8:0000210821083FF821083FF800007FFC010001003E1002103E1020283EC40000 -BFD9:0000210821083FF821083FF800007FFC010001003EF802803EF820803EF80000 -BFDA:0000210821083FF821083FF800007FFC010001003EFC02483E4820483EFC0000 -BFDB:0000210821083FF821083FF800007FFC010001003E2003FC3E7020883E700000 -BFDC:0000210821083FF821083FF800007FFC010001001FF01010101010101FF00000 -BFDD:0000210821083FF821083FF800007FFC01000100101010101FF010101FF00000 -BFDE:0000210821083FF821083FF800007FFC01000100222022203E2022503E880000 -BFDF:0000210821083FF821083FF800007FFC0100010000000100010002800C400000 -BFE0:0000210821083FF821083FF800007FFC010001000000024002400DA033100000 -BFE1:0000210821083FF821083FF800007FFC01000100000007C00820082007C00000 -BFE2:0000210821083FF821083FF800007FFC01000100000007E00080014006200000 -BFE3:0000210821083FF821083FF800007FFC01000100008007E00080014006200000 -BFE4:0000210821083FF821083FF800007FFC010001001FF000101FF0001000100000 -BFE5:0000210821083FF821083FF800007FFC010001001FF010001FF010001FF00000 -BFE6:0000210821083FF821083FF800007FFC0100010000001FF0044004401FF00000 -BFE7:0000210821083FF821083FF800007FFC0100010001001FF007C0082007C00000 -BFE8:000000084448444844487FC8444844487FC800087FE8040804F8040804080000 -BFE9:248824883F8824883F8800087FE8027802080000000007F80008000800080000 -BFEA:248824883F8824883F8800087FE802780208000000003EF80208020802080000 -BFEB:248824883F8824883F8800087FE802780208000000001F080108011401620000 -BFEC:248824883F8824883F88000800087FE80278020802081000100010001FF80000 -BFED:248824883F8824883F8800087FE8027802080000000020F8201020303ECC0000 -BFEE:248824883F8824883F8800087FE8027802080000202021FC207020883E700000 -BFEF:248824883F8824883F8800087FE802780208000003F802000200020003F80000 -BFF0:248824883F8824883F8800087FE802780208000007F8000807F8040007F80000 -BFF1:248824883F8824883F8800087FE80278020800003EF802083E0820083E080000 -BFF2:248824883F8824883F8800087FE80278020800003EF802883E8820883EF80000 -BFF3:248824883F8824883F8800087FE80278020800003E8802883EF820883EF80000 -BFF4:248824883F8824883F8800087FE80278020800000F8800880F8808140FA20000 -BFF5:248824883F8824883F8800087FE80278020800003EF802803EF820803EF80000 -BFF6:248824883F8824883F8800087FE80278020800003EFC02483E4820483EFC0000 -BFF7:248824883F8824883F8800087FE80278020800003E1002FE3E3820443E380000 -BFF8:248824883F8824883F8800087FE802780208000003F802080208020803F80000 -BFF9:248824883F8824883F8800087FE80278020800000208020803F8020803F80000 -BFFA:248824883F8824883F8800087FE8027802080000210821083F0821143F620000 -BFFB:248824883F8824883F8800087FE8027802080000001000100010006801840000 -BFFC:248824883F8824883F8800087FE80278020800000048004800A8011406620000 -BFFD:248824883F8824883F8800087FE8027802080000000003F00408040803F00000 -BFFE:248824883F8824883F8800087FE802780208000003F80020002000D003080000 -BFFF:248824883F8824883F8800087FE8027802080000004003F8004000A003180000 -C000:248824883F8824883F8800087FE802780208000003F8000803F8000800080000 -C001:248824883F8824883F8800087FE802780208000003F8020003F8020003F80000 -C002:248824883F8824883F8800087FE802780208000000000FF8022002200FF80000 -C003:248824883F8824883F8800087FE802780208000000800FF803E0041003E00000 -C004:0000000A444A444A444A7FCA444A444A7FCA000A7FEA040A047A040A040A0000 -C005:24A824A83FA824A83FA800287FA805E804280000000007F80008000800080000 -C006:24A824A83FA824A83FA800287FA805E80428000000003EF80208020802080000 -C007:24A824A83FA824A83FA800287FA805E80428000000001F080108011401620000 -C008:24A824A83FA824A83FA8002800287FA8042805E804281428100010001FF80000 -C009:24A824A83FA824A83FA800287FA805E804280000000020F8201020303ECC0000 -C00A:24A824A83FA824A83FA800287FA805E804280000202021FC207020883E700000 -C00B:24A824A83FA824A83FA800287FA805E80428000003F802000200020003F80000 -C00C:24A824A83FA824A83FA800287FA805E80428000007F8000807F8040007F80000 -C00D:24A824A83FA824A83FA800287FA805E8042800003EF802083E0820083E080000 -C00E:24A824A83FA824A83FA800287FA805E8042800003EF802883E8820883EF80000 -C00F:24A824A83FA824A83FA800287FA805E8042800003E8802883EF820883EF80000 -C010:24A824A83FA824A83FA800287FA805E8042800000F8800880F8808140FA20000 -C011:24A824A83FA824A83FA800287FA805E8042800003EF802803EF820803EF80000 -C012:24A824A83FA824A83FA800287FA805E8042800003EFC02483E4820483EFC0000 -C013:24A824A83FA824A83FA800287FA805E8042800003E1002FE3E3820443E380000 -C014:24A824A83FA824A83FA800287FA805E80428000003F802080208020803F80000 -C015:24A824A83FA824A83FA800287FA805E8042800000208020803F8020803F80000 -C016:24A824A83FA824A83FA800287FA805E804280000210821083F0821143F620000 -C017:24A824A83FA824A83FA800287FA805E804280000001000100010006801840000 -C018:24A824A83FA824A83FA800287FA805E8042800000048004800A8011406620000 -C019:24A824A83FA824A83FA800287FA805E804280000000003F00408040803F00000 -C01A:24A824A83FA824A83FA800287FA805E80428000003F80020002000D003080000 -C01B:24A824A83FA824A83FA800287FA805E804280000004003F8004000A003180000 -C01C:24A824A83FA824A83FA800287FA805E80428000003F8000803F8000800080000 -C01D:24A824A83FA824A83FA800287FA805E80428000003F8020003F8020003F80000 -C01E:24A824A83FA824A83FA800287FA805E80428000000000FF8022002200FF80000 -C01F:24A824A83FA824A83FA800287FA805E80428000000800FF803E0041003E00000 -C020:000000084448444844487FC8444844487FC800087FE804080408040804080000 -C021:248824883F8824883F8800087FE8020802000000000007F80008000800080000 -C022:248824883F8824883F8800087FE802080200000000003EF80208020802080000 -C023:248824883F8824883F8800087FE802080200000000001F080108011401620000 -C024:248824883F8824883F88000800087FE80208020802081008100010001FF80000 -C025:248824883F8824883F8800087FE8020802000000000020F8201020303ECC0000 -C026:248824883F8824883F8800087FE8020802000000202021FC207020883E700000 -C027:248824883F8824883F8800087FE802080200000003F802000200020003F80000 -C028:248824883F8824883F8800087FE802080200000007F8000807F8040007F80000 -C029:248824883F8824883F8800087FE80208020000003EF802083E0820083E080000 -C02A:248824883F8824883F8800087FE80208020000003EF802883E8820883EF80000 -C02B:248824883F8824883F8800087FE80208020000003E8802883EF820883EF80000 -C02C:248824883F8824883F8800087FE80208020000000F8800880F8808140FA20000 -C02D:248824883F8824883F8800087FE80208020000003EF802803EF820803EF80000 -C02E:248824883F8824883F8800087FE80208020000003EFC02483E4820483EFC0000 -C02F:248824883F8824883F8800087FE80208020000003E1002FE3E3820443E380000 -C030:248824883F8824883F8800087FE802080200000003F802080208020803F80000 -C031:248824883F8824883F8800087FE80208020000000208020803F8020803F80000 -C032:248824883F8824883F8800087FE8020802000000210821083F0821143F620000 -C033:248824883F8824883F8800087FE8020802000000001000100010006801840000 -C034:248824883F8824883F8800087FE80208020000000048004800A8011406620000 -C035:248824883F8824883F8800087FE8020802000000000003F00408040803F00000 -C036:248824883F8824883F8800087FE802080200000003F80020002000D003080000 -C037:248824883F8824883F8800087FE8020802000000004003F8004000A003180000 -C038:248824883F8824883F8800087FE802080200000003F8000803F8000800080000 -C039:248824883F8824883F8800087FE802080200000003F8020003F8020003F80000 -C03A:248824883F8824883F8800087FE802080200000000000FF8022002200FF80000 -C03B:248824883F8824883F8800087FE802080200000000800FF803E0041003E00000 -C03C:000000002108210821083FF8210821083FF800007FFC04400440044004400000 -C03D:0000210821083FF821083FF800007FFC044004401FF000100010001000100000 -C03E:0000210821083FF821083FF800007FFC0440044000003EF80208020802080000 -C03F:0000210821083FF821083FF800007FFC0440044000001E100210022802C40000 -C040:0000210821083FF821083FF8000000007FFC044004401440100010001FF00000 -C041:0000210821083FF821083FF800007FFC04400440000020F8201020303ECC0000 -C042:0000210821083FF821083FF800007FFC04400440202021FC207020883E700000 -C043:0000210821083FF821083FF800007FFC044004401FF01000100010001FF00000 -C044:0000210821083FF821083FF800007FFC044004401FF000101FF010001FF00000 -C045:0000210821083FF821083FF800007FFC044004403EF802083E0820083E080000 -C046:0000210821083FF821083FF800007FFC044004403EF802883E8820883EF80000 -C047:0000210821083FF821083FF800007FFC044004403E8802883EF820883EF80000 -C048:0000210821083FF821083FF800007FFC044004403E1002103E1020283EC40000 -C049:0000210821083FF821083FF800007FFC044004403EF802803EF820803EF80000 -C04A:0000210821083FF821083FF800007FFC044004403EFC02483E4820483EFC0000 -C04B:0000210821083FF821083FF800007FFC044004403E2003FC3E7020883E700000 -C04C:0000210821083FF821083FF800007FFC044004401FF01010101010101FF00000 -C04D:0000210821083FF821083FF800007FFC04400440101010101FF010101FF00000 -C04E:0000210821083FF821083FF800007FFC04400440222022203E2022503E880000 -C04F:0000210821083FF821083FF800007FFC0440044000000100010002800C400000 -C050:0000210821083FF821083FF800007FFC044004400000024002400DA033100000 -C051:0000210821083FF821083FF800007FFC04400440000007C00820082007C00000 -C052:0000210821083FF821083FF800007FFC04400440000007E00080014006200000 -C053:0000210821083FF821083FF800007FFC04400440008007E00080014006200000 -C054:0000210821083FF821083FF800007FFC044004401FF000101FF0001000100000 -C055:0000210821083FF821083FF800007FFC044004401FF010001FF010001FF00000 -C056:0000210821083FF821083FF800007FFC0440044000001FF0044004401FF00000 -C057:0000210821083FF821083FF800007FFC0440044001001FF007C0082007C00000 -C058:000000002108210821083FF8210821083FF8000000007FFC0000000000000000 -C059:0000210821083FF821083FF8000000007FFC00001FF000100010001000100000 -C05A:0000210821083FF821083FF8000000007FFC000000003EF80208020802080000 -C05B:0000210821083FF821083FF8000000007FFC000000001E100210022802C40000 -C05C:0000210821083FF821083FF8000000007FFC000000001000100010001FF00000 -C05D:0000210821083FF821083FF8000000007FFC0000000020F8201020303ECC0000 -C05E:0000210821083FF821083FF8000000007FFC0000202021FC207020883E700000 -C05F:0000210821083FF821083FF8000000007FFC00001FF01000100010001FF00000 -C060:0000210821083FF821083FF8000000007FFC00001FF000101FF010001FF00000 -C061:0000210821083FF821083FF8000000007FFC00003EF802083E0820083E080000 -C062:0000210821083FF821083FF8000000007FFC00003EF802883E8820883EF80000 -C063:0000210821083FF821083FF8000000007FFC00003E8802883EF820883EF80000 -C064:0000210821083FF821083FF8000000007FFC00003E1002103E1020283EC40000 -C065:0000210821083FF821083FF8000000007FFC00003EF802803EF820803EF80000 -C066:0000210821083FF821083FF8000000007FFC00003EFC02483E4820483EFC0000 -C067:0000210821083FF821083FF8000000007FFC00003E2003FC3E7020883E700000 -C068:0000210821083FF821083FF8000000007FFC00001FF01010101010101FF00000 -C069:0000210821083FF821083FF8000000007FFC0000101010101FF010101FF00000 -C06A:0000210821083FF821083FF8000000007FFC0000222022203E2022503E880000 -C06B:0000210821083FF821083FF8000000007FFC000000000100010002800C400000 -C06C:0000210821083FF821083FF8000000007FFC00000000024002400DA033100000 -C06D:0000210821083FF821083FF8000000007FFC0000000007C00820082007C00000 -C06E:0000210821083FF821083FF8000000007FFC0000000007E00080014006200000 -C06F:0000210821083FF821083FF8000000007FFC0000008007E00080014006200000 -C070:0000210821083FF821083FF8000000007FFC00001FF000101FF0001000100000 -C071:0000210821083FF821083FF8000000007FFC00001FF010001FF010001FF00000 -C072:0000210821083FF821083FF8000000007FFC000000001FF0044004401FF00000 -C073:0000210821083FF821083FF8000000007FFC000001001FF007C0082007C00000 -C074:0000000800084448444844487FC8444844487FC800087FE80008000800080000 -C075:0000248824883F8824883F88000800087FE8000007F800080008000800080000 -C076:0000248824883F8824883F88000800087FE8000000003EF80208020802080000 -C077:0000248824883F8824883F88000800087FE8000000001F080108011401620000 -C078:0000248824883F8824883F88000800087FE8000008000800080008000FF80000 -C079:0000248824883F8824883F88000800087FE80000000010F8101010301ECC0000 -C07A:0000248824883F8824883F88000800087FE800000808087F081C08220F9C0000 -C07B:0000248824883F8824883F88000800087FE8000003F802000200020003F80000 -C07C:0000248824883F8824883F88000800087FE8000007F8000807F8040007F80000 -C07D:0000248824883F8824883F88000800087FE800003EF802083E0820083E080000 -C07E:0000248824883F8824883F88000800087FE800003EF802883E8820883EF80000 -C07F:0000248824883F8824883F88000800087FE800003E8802883EF820883EF80000 -C080:0000248824883F8824883F88000800087FE800001F0801081F0810141F620000 -C081:0000248824883F8824883F88000800087FE800003EF802803EF820803EF80000 -C082:0000248824883F8824883F88000800087FE800003EFC02483E4820483EFC0000 -C083:0000248824883F8824883F88000800087FE800001F08017F1F1C10221F1C0000 -C084:0000248824883F8824883F88000800087FE8000003F802080208020803F80000 -C085:0000248824883F8824883F88000800087FE800000208020803F8020803F80000 -C086:0000248824883F8824883F88000800087FE80000110811081F0811141F620000 -C087:0000248824883F8824883F88000800087FE80000001000100010006801840000 -C088:0000248824883F8824883F88000800087FE800000048004800A8011406620000 -C089:0000248824883F8824883F88000800087FE80000000003F00408040803F00000 -C08A:0000248824883F8824883F88000800087FE8000003F80020002000D003080000 -C08B:0000248824883F8824883F88000800087FE80000004003F8004000A003180000 -C08C:0000248824883F8824883F88000800087FE8000003F8000803F8000800080000 -C08D:0000248824883F8824883F88000800087FE8000003F8020003F8020003F80000 -C08E:0000248824883F8824883F88000800087FE8000000000FF8022002200FF80000 -C08F:0000248824883F8824883F88000800087FE8000000800FF803E0041003E00000 -C090:00000000000800082488248824883F88248824883F8800080008000800080000 -C091:000000084908490849087F0849087F0800080000000007F80008000800080000 -C092:000000084908490849087F0849087F080008000000003EF80208020802080000 -C093:000000084908490849087F0849087F080008000000001F080108011401620000 -C094:000000084908490849087F0849087F080008000800001000100010001FF80000 -C095:000000084908490849087F0849087F0800080000000020F8201020303ECC0000 -C096:000000084908490849087F0849087F0800080000202021FC207020883E700000 -C097:000000084908490849087F0849087F080008000003F802000200020003F80000 -C098:000000084908490849087F0849087F080008000007F8000807F8040007F80000 -C099:000000084908490849087F0849087F08000800003EF802083E0820083E080000 -C09A:000000084908490849087F0849087F08000800003EF802883E8820883EF80000 -C09B:000000084908490849087F0849087F08000800003E8802883EF820883EF80000 -C09C:000000084908490849087F0849087F08000800000F8800880F8808140FA20000 -C09D:000000084908490849087F0849087F08000800003EF802803EF820803EF80000 -C09E:000000084908490849087F0849087F08000800003EFC02483E4820483EFC0000 -C09F:000000084908490849087F0849087F08000800003E1002FE3E3820443E380000 -C0A0:000000084908490849087F0849087F080008000003F802080208020803F80000 -C0A1:000000084908490849087F0849087F08000800000208020803F8020803F80000 -C0A2:000000084908490849087F0849087F0800080000210821083F0821143F620000 -C0A3:000000084908490849087F0849087F0800080000001000100010006801840000 -C0A4:000000084908490849087F0849087F08000800000048004800A8011406620000 -C0A5:000000084908490849087F0849087F0800080000000003F00408040803F00000 -C0A6:000000084908490849087F0849087F080008000003F80020002000D003080000 -C0A7:000000084908490849087F0849087F0800080000004003F8004000A003180000 -C0A8:000000084908490849087F0849087F080008000003F8000803F8000800080000 -C0A9:000000084908490849087F0849087F080008000003F8020003F8020003F80000 -C0AA:000000084908490849087F0849087F080008000000000FF8022002200FF80000 -C0AB:000000084908490849087F0849087F080008000000800FF803E0041003E00000 -C0AC:0000000000100010021002100410041E0A101110609000100010001000100000 -C0AD:000000080008040804080C0E120861080008000007F800080008000800080000 -C0AE:000000080008040804080C0E120861080008000000003EF80208020802080000 -C0AF:000000080008040804080C0E120861080008000000001F080108011401620000 -C0B0:000000080008040804080C0E120861080008000808000800080008000FF80000 -C0B1:000000080008040804080C0E1208610800080000000010F8101010301ECC0000 -C0B2:000000080008040804080C0E12086108000800000808087F081C08220F9C0000 -C0B3:000000080008040804080C0E120861080008000003F802000200020003F80000 -C0B4:000000080008040804080C0E120861080008000007F8000807F8040007F80000 -C0B5:000000080008040804080C0E12086108000800003EF802083E0820083E080000 -C0B6:000000080008040804080C0E12086108000800003EF802883E8820883EF80000 -C0B7:000000080008040804080C0E12086108000800003E8802883EF820883EF80000 -C0B8:000000080008040804080C0E12086108000800001F0801081F0810141F620000 -C0B9:000000080008040804080C0E12086108000800003EF802803EF820803EF80000 -C0BA:000000080008040804080C0E12086108000800003EFC02483E4820483EFC0000 -C0BB:000000080008040804080C0E12086108000800001F08017F1F1C10221F1C0000 -C0BC:000000080008040804080C0E120861080008000003F802080208020803F80000 -C0BD:000000080008040804080C0E12086108000800000208020803F8020803F80000 -C0BE:000000080008040804080C0E1208610800080000110811081F0811141F620000 -C0BF:000000080008040804080C0E1208610800080000001000100010006801840000 -C0C0:000000080008040804080C0E12086108000800000048004800A8011406620000 -C0C1:000000080008040804080C0E1208610800080000000003F00408040803F00000 -C0C2:000000080008040804080C0E120861080008000003F80020002000D003080000 -C0C3:000000080008040804080C0E1208610800080000004003F8004000A003180000 -C0C4:000000080008040804080C0E120861080008000003F8000803F8000800080000 -C0C5:000000080008040804080C0E120861080008000003F8020003F8020003F80000 -C0C6:000000080008040804080C0E120861080008000000000FF8022002200FF80000 -C0C7:000000080008040804080C0E120861080008000000800FF803E0041003E00000 -C0C8:0000000000120012021202120412041E0A121112609200120012001200120000 -C0C9:000000280028042804280C38122861280028000007F800080008000800080000 -C0CA:000000280028042804280C38122861280028000000003EF80208020802080000 -C0CB:000000280028042804280C38122861280028000000003E100210022802C40000 -C0CC:000000280028042804280C38122861280028002808000800080008000FF80000 -C0CD:000000280028042804280C381228612800280000000020F8201020303ECC0000 -C0CE:000000280028042804280C381228612800280000202021FC207020883E700000 -C0CF:000000280028042804280C38122861280028000003F802000200020003F80000 -C0D0:000000280028042804280C38122861280028000007F8000807F8040007F80000 -C0D1:000000280028042804280C3812286128002800003EF802083E0820083E080000 -C0D2:000000280028042804280C3812286128002800003EF802883E8820883EF80000 -C0D3:000000280028042804280C3812286128002800003E8802883EF820883EF80000 -C0D4:000000280028042804280C3812286128002800001F0801081F0810141F620000 -C0D5:000000280028042804280C3812286128002800003EF802803EF820803EF80000 -C0D6:000000280028042804280C3812286128002800003EFC02483E4820483EFC0000 -C0D7:000000280028042804280C3812286128002800003E1002FE3E3820443E380000 -C0D8:000000280028042804280C38122861280028000003F802080208020803F80000 -C0D9:000000280028042804280C3812286128002800000208020803F8020803F80000 -C0DA:000000280028042804280C381228612800280000110811081F0811141F620000 -C0DB:000000280028042804280C381228612800280000000800080008003400C20000 -C0DC:000000280028042804280C3812286128002800000048004800A8011406620000 -C0DD:000000280028042804280C381228612800280000000001F00208020801F00000 -C0DE:000000280028042804280C38122861280028000003F80020002000D003080000 -C0DF:000000280028042804280C381228612800280000004003F8004000A003180000 -C0E0:000000280028042804280C38122861280028000003F8000803F8000800080000 -C0E1:000000280028042804280C38122861280028000003F8020003F8020003F80000 -C0E2:000000280028042804280C38122861280028000000000FF8022002200FF80000 -C0E3:000000280028042804280C38122861280028000000800FF803E0041003E00000 -C0E4:000000000010001002100210041E04100A10111E609000100010001000100000 -C0E5:0000000800080408040E0C08120E61080008000007F800080008000800080000 -C0E6:0000000800080408040E0C08120E61080008000000003EF80208020802080000 -C0E7:0000000800080408040E0C08120E61080008000000001F080108011401620000 -C0E8:0000000800080408040E0C08120E61080008000008000800080008000FF80000 -C0E9:0000000800080408040E0C08120E610800080000000010F8101010301ECC0000 -C0EA:0000000800080408040E0C08120E6108000800000808087F081C08220F9C0000 -C0EB:0000000800080408040E0C08120E61080008000003F802000200020003F80000 -C0EC:0000000800080408040E0C08120E61080008000007F8000807F8040007F80000 -C0ED:0000000800080408040E0C08120E6108000800003EF802083E0820083E080000 -C0EE:0000000800080408040E0C08120E6108000800003EF802883E8820883EF80000 -C0EF:0000000800080408040E0C08120E6108000800003E8802883EF820883EF80000 -C0F0:0000000800080408040E0C08120E6108000800001F0801081F0810141F620000 -C0F1:0000000800080408040E0C08120E6108000800003EF802803EF820803EF80000 -C0F2:0000000800080408040E0C08120E6108000800003EFC02483E4820483EFC0000 -C0F3:0000000800080408040E0C08120E6108000800001F08017F1F1C10221F1C0000 -C0F4:0000000800080408040E0C08120E61080008000003F802080208020803F80000 -C0F5:0000000800080408040E0C08120E6108000800000208020803F8020803F80000 -C0F6:0000000800080408040E0C08120E610800080000110811081F0811141F620000 -C0F7:0000000800080408040E0C08120E610800080000001000100010006801840000 -C0F8:0000000800080408040E0C08120E6108000800000048004800A8011406620000 -C0F9:0000000800080408040E0C08120E610800080000000003F00408040803F00000 -C0FA:0000000800080408040E0C08120E61080008000003F80020002000D003080000 -C0FB:0000000800080408040E0C08120E610800080000004003F8004000A003180000 -C0FC:0000000800080408040E0C08120E61080008000003F8000803F8000800080000 -C0FD:0000000800080408040E0C08120E61080008000003F8020003F8020003F80000 -C0FE:0000000800080408040E0C08120E61080008000000000FF8022002200FF80000 -C0FF:0000000800080408040E0C08120E61080008000000800FF803E0041003E00000 -C100:000000000012001202120212041E04120A12111E609200120012001200120000 -C101:000000280028042804380C28123861280028000007F800080008000800080000 -C102:000000280028042804380C28123861280028000000003EF80208020802080000 -C103:000000280028042804380C28123861280028000000003E100210022802C40000 -C104:000000280028042804380C28123861280028002808000800080008000FF80000 -C105:000000280028042804380C281238612800280000000020F8201020303ECC0000 -C106:000000280028042804380C281238612800280000202021FC207020883E700000 -C107:000000280028042804380C28123861280028000003F802000200020003F80000 -C108:000000280028042804380C28123861280028000007F8000807F8040007F80000 -C109:000000280028042804380C2812386128002800003EF802083E0820083E080000 -C10A:000000280028042804380C2812386128002800003EF802883E8820883EF80000 -C10B:000000280028042804380C2812386128002800003E8802883EF820883EF80000 -C10C:000000280028042804380C2812386128002800001F0801081F0810141F620000 -C10D:000000280028042804380C2812386128002800003EF802803EF820803EF80000 -C10E:000000280028042804380C2812386128002800003EFC02483E4820483EFC0000 -C10F:000000280028042804380C2812386128002800003E1002FE3E3820443E380000 -C110:000000280028042804380C28123861280028000003F802080208020803F80000 -C111:000000280028042804380C2812386128002800000208020803F8020803F80000 -C112:000000280028042804380C281238612800280000110811081F0811141F620000 -C113:000000280028042804380C281238612800280000000800080008003400C20000 -C114:000000280028042804380C2812386128002800000048004800A8011406620000 -C115:000000280028042804380C281238612800280000000001F00208020801F00000 -C116:000000280028042804380C28123861280028000003F80020002000D003080000 -C117:000000280028042804380C281238612800280000004003F8004000A003180000 -C118:000000280028042804380C28123861280028000003F8000803F8000800080000 -C119:000000280028042804380C28123861280028000003F8020003F8020003F80000 -C11A:000000280028042804380C28123861280028000000000FF8022002200FF80000 -C11B:000000280028042804380C28123861280028000000800FF803E0041003E00000 -C11C:0000000000020002020202020402041E0A021102608200020002000200020000 -C11D:000000080008040804080C381208610800080000000007F80008000800080000 -C11E:000000080008040804080C38120861080008000000003EF80208020802080000 -C11F:000000080008040804080C38120861080008000000001F080108011401620000 -C120:000000080008040804080C38120861080008000000001000100010001FF80000 -C121:000000080008040804080C381208610800080000000020F8201020303ECC0000 -C122:000000080008040804080C381208610800080000202021FC207020883E700000 -C123:000000080008040804080C38120861080008000003F802000200020003F80000 -C124:000000080008040804080C38120861080008000007F8000807F8040007F80000 -C125:000000080008040804080C3812086108000800003EF802083E0820083E080000 -C126:000000080008040804080C3812086108000800003EF802883E8820883EF80000 -C127:000000080008040804080C3812086108000800003E8802883EF820883EF80000 -C128:000000080008040804080C3812086108000800000F8800880F8808140FA20000 -C129:000000080008040804080C3812086108000800003EF802803EF820803EF80000 -C12A:000000080008040804080C3812086108000800003EFC02483E4820483EFC0000 -C12B:000000080008040804080C3812086108000800003E1002FE3E3820443E380000 -C12C:000000080008040804080C38120861080008000003F802080208020803F80000 -C12D:000000080008040804080C3812086108000800000208020803F8020803F80000 -C12E:000000080008040804080C381208610800080000210821083F0821143F620000 -C12F:000000080008040804080C381208610800080000001000100010006801840000 -C130:000000080008040804080C3812086108000800000048004800A8011406620000 -C131:000000080008040804080C381208610800080000000003F00408040803F00000 -C132:000000080008040804080C38120861080008000003F80020002000D003080000 -C133:000000080008040804080C381208610800080000004003F8004000A003180000 -C134:000000080008040804080C38120861080008000003F8000803F8000800080000 -C135:000000080008040804080C38120861080008000003F8020003F8020003F80000 -C136:000000080008040804080C38120861080008000000000FF8022002200FF80000 -C137:000000080008040804080C38120861080008000000800FF803E0041003E00000 -C138:00000000000A000A020A020A040A043A0A0A110A608A000A000A000A000A0000 -C139:000000280028042804280CE8122861280028000007F800080008000800080000 -C13A:000000280028042804280CE8122861280028000000003EF80208020802080000 -C13B:000000280028042804280CE8122861280028000000003E100210022802C40000 -C13C:000000280028042804280CE8122861280028000008000800080008000FF80000 -C13D:000000280028042804280CE81228612800280000000020F8201020303ECC0000 -C13E:000000280028042804280CE81228612800280000202021FC207020883E700000 -C13F:000000280028042804280CE8122861280028000003F802000200020003F80000 -C140:000000280028042804280CE8122861280028000007F8000807F8040007F80000 -C141:000000280028042804280CE812286128002800003EF802083E0820083E080000 -C142:000000280028042804280CE812286128002800003EF802883E8820883EF80000 -C143:000000280028042804280CE812286128002800003E8802883EF820883EF80000 -C144:000000280028042804280CE812286128002800001F0801081F0810141F620000 -C145:000000280028042804280CE812286128002800003EF802803EF820803EF80000 -C146:000000280028042804280CE812286128002800003EFC02483E4820483EFC0000 -C147:000000280028042804280CE812286128002800003E1002FE3E3820443E380000 -C148:000000280028042804280CE8122861280028000003F802080208020803F80000 -C149:000000280028042804280CE812286128002800000208020803F8020803F80000 -C14A:000000280028042804280CE81228612800280000110811081F0811141F620000 -C14B:000000280028042804280CE81228612800280000000800080008003400C20000 -C14C:000000280028042804280CE812286128002800000048004800A8011406620000 -C14D:000000280028042804280CE81228612800280000000001F00208020801F00000 -C14E:000000280028042804280CE8122861280028000003F80020002000D003080000 -C14F:000000280028042804280CE81228612800280000004003F8004000A003180000 -C150:000000280028042804280CE8122861280028000003F8000803F8000800080000 -C151:000000280028042804280CE8122861280028000003F8020003F8020003F80000 -C152:000000280028042804280CE8122861280028000000000FF8022002200FF80000 -C153:000000280028042804280CE8122861280028000000800FF803E0041003E00000 -C154:000000000002000202020202041E04020A02111E608200020002000200020000 -C155:000000080008040804380C081238610800080000000007F80008000800080000 -C156:000000080008040804380C08123861080008000000003EF80208020802080000 -C157:000000080008040804380C08123861080008000000001F080108011401620000 -C158:000000080008040804380C08123861080008000800001000100010001FF80000 -C159:000000080008040804380C081238610800080000000020F8201020303ECC0000 -C15A:000000080008040804380C081238610800080000202021FC207020883E700000 -C15B:000000080008040804380C08123861080008000003F802000200020003F80000 -C15C:000000080008040804380C08123861080008000007F8000807F8040007F80000 -C15D:000000080008040804380C0812386108000800003EF802083E0820083E080000 -C15E:000000080008040804380C0812386108000800003EF802883E8820883EF80000 -C15F:000000080008040804380C0812386108000800003E8802883EF820883EF80000 -C160:000000080008040804380C0812386108000800000F8800880F8808140FA20000 -C161:000000080008040804380C0812386108000800003EF802803EF820803EF80000 -C162:000000080008040804380C0812386108000800003EFC02483E4820483EFC0000 -C163:000000080008040804380C0812386108000800003E1002FE3E3820443E380000 -C164:000000080008040804380C08123861080008000003F802080208020803F80000 -C165:000000080008040804380C0812386108000800000208020803F8020803F80000 -C166:000000080008040804380C081238610800080000210821083F0821143F620000 -C167:000000080008040804380C081238610800080000001000100010006801840000 -C168:000000080008040804380C0812386108000800000048004800A8011406620000 -C169:000000080008040804380C081238610800080000000003F00408040803F00000 -C16A:000000080008040804380C08123861080008000003F80020002000D003080000 -C16B:000000080008040804380C081238610800080000004003F8004000A003180000 -C16C:000000080008040804380C08123861080008000003F8000803F8000800080000 -C16D:000000080008040804380C08123861080008000003F8020003F8020003F80000 -C16E:000000080008040804380C08123861080008000000000FF8022002200FF80000 -C16F:000000080008040804380C08123861080008000000800FF803E0041003E00000 -C170:00000000000A000A020A020A043A040A0A0A113A608A000A000A000A000A0000 -C171:000000280028042804E80C2812E861280028000007F800080008000800080000 -C172:000000280028042804E80C2812E861280028000000003EF80208020802080000 -C173:000000280028042804E80C2812E861280028000000003E100210022802C40000 -C174:000000280028042804E80C2812E861280028002808000800080008000FF80000 -C175:000000280028042804E80C2812E8612800280000000020F8201020303ECC0000 -C176:000000280028042804E80C2812E8612800280000202021FC207020883E700000 -C177:000000280028042804E80C2812E861280028000003F802000200020003F80000 -C178:000000280028042804E80C2812E861280028000007F8000807F8040007F80000 -C179:000000280028042804E80C2812E86128002800003EF802083E0820083E080000 -C17A:000000280028042804E80C2812E86128002800003EF802883E8820883EF80000 -C17B:000000280028042804E80C2812E86128002800003E8802883EF820883EF80000 -C17C:000000280028042804E80C2812E86128002800001F0801081F0810141F620000 -C17D:000000280028042804E80C2812E86128002800003EF802803EF820803EF80000 -C17E:000000280028042804E80C2812E86128002800003EFC02483E4820483EFC0000 -C17F:000000280028042804E80C2812E86128002800003E1002FE3E3820443E380000 -C180:000000280028042804E80C2812E861280028000003F802080208020803F80000 -C181:000000280028042804E80C2812E86128002800000208020803F8020803F80000 -C182:000000280028042804E80C2812E8612800280000110811081F0811141F620000 -C183:000000280028042804E80C2812E8612800280000000800080008003400C20000 -C184:000000280028042804E80C2812E86128002800000048004800A8011406620000 -C185:000000280028042804E80C2812E8612800280000000001F00208020801F00000 -C186:000000280028042804E80C2812E861280028000003F80020002000D003080000 -C187:000000280028042804E80C2812E8612800280000004003F8004000A003180000 -C188:000000280028042804E80C2812E861280028000003F8000803F8000800080000 -C189:000000280028042804E80C2812E861280028000003F8020003F8020003F80000 -C18A:000000280028042804E80C2812E861280028000000000FF8022002200FF80000 -C18B:000000280028042804E80C2812E861280028000000800FF803E0041003E00000 -C18C:00000000008000800100010002800440182000000100010001007FFC00000000 -C18D:000000800080018002400C20010001007FFC00001FF000100010001000100000 -C18E:000000800080018002400C20010001007FFC000000003EF80208020802080000 -C18F:000000800080018002400C20010001007FFC000000001E100210022802C40000 -C190:000000800080018002400C20010001007FFC000000001000100010001FF00000 -C191:000000800080018002400C20010001007FFC0000000020F8201020303ECC0000 -C192:000000800080018002400C20010001007FFC0000202021FC207020883E700000 -C193:000000800080018002400C20010001007FFC00001FF01000100010001FF00000 -C194:000000800080018002400C20010001007FFC00001FF000101FF010001FF00000 -C195:000000800080018002400C20010001007FFC00003EF802083E0820083E080000 -C196:000000800080018002400C20010001007FFC00003EF802883E8820883EF80000 -C197:000000800080018002400C20010001007FFC00003E8802883EF820883EF80000 -C198:000000800080018002400C20010001007FFC00003E1002103E1020283EC40000 -C199:000000800080018002400C20010001007FFC00003EF802803EF820803EF80000 -C19A:000000800080018002400C20010001007FFC00003EFC02483E4820483EFC0000 -C19B:000000800080018002400C20010001007FFC00003E2003FC3E7020883E700000 -C19C:000000800080018002400C20010001007FFC00001FF01010101010101FF00000 -C19D:000000800080018002400C20010001007FFC0000101010101FF010101FF00000 -C19E:000000800080018002400C20010001007FFC0000222022203E2022503E880000 -C19F:000000800080018002400C20010001007FFC000000000100010002800C400000 -C1A0:000000800080018002400C20010001007FFC00000000024002400DA033100000 -C1A1:000000800080018002400C20010001007FFC0000000007C00820082007C00000 -C1A2:000000800080018002400C20010001007FFC0000000007E00080014006200000 -C1A3:000000800080018002400C20010001007FFC0000008007E00080014006200000 -C1A4:000000800080018002400C20010001007FFC00001FF000101FF0001000100000 -C1A5:000000800080018002400C20010001007FFC00001FF010001FF010001FF00000 -C1A6:000000800080018002400C20010001007FFC000000001FF0044004401FF00000 -C1A7:000000800080018002400C20010001007FFC000001001FF007C0082007C00000 -C1A8:00000010001002100210041004100A1E11106090041004107FD0001000100000 -C1A9:0000020802080608090E3088040804087FE8000007F800080008000800080000 -C1AA:0000020802080608090E3088040804087FE8000000003EF80208020802080000 -C1AB:0000020802080608090E3088040804087FE8000000001F080108011401620000 -C1AC:0000020802080608090E3088040804087FE8000008000800080008000FF80000 -C1AD:0000020802080608090E3088040804087FE80000000010F8101010301ECC0000 -C1AE:0000020802080608090E3088040804087FE800000808087F081C08220F9C0000 -C1AF:0000020802080608090E3088040804087FE8000003F802000200020003F80000 -C1B0:0000020802080608090E3088040804087FE8000007F8000807F8040007F80000 -C1B1:0000020802080608090E3088040804087FE800003EF802083E0820083E080000 -C1B2:0000020802080608090E3088040804087FE800003EF802883E8820883EF80000 -C1B3:0000020802080608090E3088040804087FE800003E8802883EF820883EF80000 -C1B4:0000020802080608090E3088040804087FE800001F0801081F0810141F620000 -C1B5:0000020802080608090E3088040804087FE800003EF802803EF820803EF80000 -C1B6:0000020802080608090E3088040804087FE800003EFC02483E4820483EFC0000 -C1B7:0000020802080608090E3088040804087FE800001F08017F1F1C10221F1C0000 -C1B8:0000020802080608090E3088040804087FE8000003F802080208020803F80000 -C1B9:0000020802080608090E3088040804087FE800000208020803F8020803F80000 -C1BA:0000020802080608090E3088040804087FE80000110811081F0811141F620000 -C1BB:0000020802080608090E3088040804087FE80000001000100010006801840000 -C1BC:0000020802080608090E3088040804087FE800000048004800A8011406620000 -C1BD:0000020802080608090E3088040804087FE80000000003F00408040803F00000 -C1BE:0000020802080608090E3088040804087FE8000003F80020002000D003080000 -C1BF:0000020802080608090E3088040804087FE80000004003F8004000A003180000 -C1C0:0000020802080608090E3088040804087FE8000003F8000803F8000800080000 -C1C1:0000020802080608090E3088040804087FE8000003F8020003F8020003F80000 -C1C2:0000020802080608090E3088040804087FE8000000000FF8022002200FF80000 -C1C3:0000020802080608090E3088040804087FE8000000800FF803E0041003E00000 -C1C4:00000012001202120212041204120A1E11126092041204127FD2001200120000 -C1C5:0000022802280628093830A8042804287FA8000007F800080008000800080000 -C1C6:0000022802280628093830A8042804287FA8000000003EF80208020802080000 -C1C7:0000022802280628093830A8042804287FA8000000001F080108011401620000 -C1C8:0000022802280628093830A8042804287FA8000008000800080008000FF80000 -C1C9:0000022802280628093830A8042804287FA80000000010F8101010301ECC0000 -C1CA:0000022802280628093830A8042804287FA800000808087F081C08220F9C0000 -C1CB:0000022802280628093830A8042804287FA8000003F802000200020003F80000 -C1CC:0000022802280628093830A8042804287FA8000007F8000807F8040007F80000 -C1CD:0000022802280628093830A8042804287FA800003EF802083E0820083E080000 -C1CE:0000022802280628093830A8042804287FA800003EF802883E8820883EF80000 -C1CF:0000022802280628093830A8042804287FA800003E8802883EF820883EF80000 -C1D0:0000022802280628093830A8042804287FA800001F0801081F0810141F620000 -C1D1:0000022802280628093830A8042804287FA800003EF802803EF820803EF80000 -C1D2:0000022802280628093830A8042804287FA800003EFC02483E4820483EFC0000 -C1D3:0000022802280628093830A8042804287FA800001F08017F1F1C10221F1C0000 -C1D4:0000022802280628093830A8042804287FA8000003F802080208020803F80000 -C1D5:0000022802280628093830A8042804287FA800000208020803F8020803F80000 -C1D6:0000022802280628093830A8042804287FA80000110811081F0811141F620000 -C1D7:0000022802280628093830A8042804287FA80000001000100010006801840000 -C1D8:0000022802280628093830A8042804287FA800000048004800A8011406620000 -C1D9:0000022802280628093830A8042804287FA80000000003F00408040803F00000 -C1DA:0000022802280628093830A8042804287FA8000003F80020002000D003080000 -C1DB:0000022802280628093830A8042804287FA80000004003F8004000A003180000 -C1DC:0000022802280628093830A8042804287FA8000003F8000803F8000800080000 -C1DD:0000022802280628093830A8042804287FA8000003F8020003F8020003F80000 -C1DE:0000022802280628093830A8042804287FA8000000000FF8022002200FF80000 -C1DF:0000022802280628093830A8042804287FA8000000800FF803E0041003E00000 -C1E0:00000008000802080208040804080A0811086088040804087FE8000800080000 -C1E1:000002080208060809083088040804087FE8000007F800080008000800080000 -C1E2:000002080208060809083088040804087FE8000000003EF80208020802080000 -C1E3:000002080208060809083088040804087FE8000000001F080108011401620000 -C1E4:000002080208060809083088040804087FE8000008000800080008000FF80000 -C1E5:000002080208060809083088040804087FE80000000010F8101010301ECC0000 -C1E6:000002080208060809083088040804087FE800000808087F081C08220F9C0000 -C1E7:000002080208060809083088040804087FE8000003F802000200020003F80000 -C1E8:000002080208060809083088040804087FE8000007F8000807F8040007F80000 -C1E9:000002080208060809083088040804087FE800003EF802083E0820083E080000 -C1EA:000002080208060809083088040804087FE800003EF802883E8820883EF80000 -C1EB:000002080208060809083088040804087FE800003E8802883EF820883EF80000 -C1EC:000002080208060809083088040804087FE800001F0801081F0810141F620000 -C1ED:000002080208060809083088040804087FE800003EF802803EF820803EF80000 -C1EE:000002080208060809083088040804087FE800003EFC02483E4820483EFC0000 -C1EF:000002080208060809083088040804087FE800001F08017F1F1C10221F1C0000 -C1F0:000002080208060809083088040804087FE8000003F802080208020803F80000 -C1F1:000002080208060809083088040804087FE800000208020803F8020803F80000 -C1F2:000002080208060809083088040804087FE80000110811081F0811141F620000 -C1F3:000002080208060809083088040804087FE80000001000100010006801840000 -C1F4:000002080208060809083088040804087FE800000048004800A8011406620000 -C1F5:000002080208060809083088040804087FE80000000003F00408040803F00000 -C1F6:000002080208060809083088040804087FE8000003F80020002000D003080000 -C1F7:000002080208060809083088040804087FE80000004003F8004000A003180000 -C1F8:000002080208060809083088040804087FE8000003F8000803F8000800080000 -C1F9:000002080208060809083088040804087FE8000003F8020003F8020003F80000 -C1FA:000002080208060809083088040804087FE8000000000FF8022002200FF80000 -C1FB:000002080208060809083088040804087FE8000000800FF803E0041003E00000 -C1FC:00000000008000800100010002800440182004400440044004407FFC00000000 -C1FD:000000800080018002400C20044004407FFC00001FF000100010001000100000 -C1FE:000000800080018002400C20044004407FFC000000003EF80208020802080000 -C1FF:000000800080018002400C20044004407FFC000000001E100210022802C40000 -C200:000000800080018002400C20044004407FFC000000001000100010001FF00000 -C201:000000800080018002400C20044004407FFC0000000020F8201020303ECC0000 -C202:000000800080018002400C20044004407FFC0000202021FC207020883E700000 -C203:000000800080018002400C20044004407FFC00001FF01000100010001FF00000 -C204:000000800080018002400C20044004407FFC00001FF000101FF010001FF00000 -C205:000000800080018002400C20044004407FFC00003EF802083E0820083E080000 -C206:000000800080018002400C20044004407FFC00003EF802883E8820883EF80000 -C207:000000800080018002400C20044004407FFC00003E8802883EF820883EF80000 -C208:000000800080018002400C20044004407FFC00003E1002103E1020283EC40000 -C209:000000800080018002400C20044004407FFC00003EF802803EF820803EF80000 -C20A:000000800080018002400C20044004407FFC00003EFC02483E4820483EFC0000 -C20B:000000800080018002400C20044004407FFC00003E2003FC3E7020883E700000 -C20C:000000800080018002400C20044004407FFC00001FF01010101010101FF00000 -C20D:000000800080018002400C20044004407FFC0000101010101FF010101FF00000 -C20E:000000800080018002400C20044004407FFC0000222022203E2022503E880000 -C20F:000000800080018002400C20044004407FFC000000000100010002800C400000 -C210:000000800080018002400C20044004407FFC00000000024002400DA033100000 -C211:000000800080018002400C20044004407FFC0000000007C00820082007C00000 -C212:000000800080018002400C20044004407FFC0000000007E00080014006200000 -C213:000000800080018002400C20044004407FFC0000008007E00080014006200000 -C214:000000800080018002400C20044004407FFC00001FF000101FF0001000100000 -C215:000000800080018002400C20044004407FFC00001FF010001FF010001FF00000 -C216:000000800080018002400C20044004407FFC000000001FF0044004401FF00000 -C217:000000800080018002400C20044004407FFC000001001FF007C0082007C00000 -C218:00000000008000800100010002800440182000003FF801000100010001000000 -C219:000000800080018002400C2000007FFC010001001FF000100010001000100000 -C21A:000000800080018002400C2000007FFC0100010000003EF80208020802080000 -C21B:000000800080018002400C2000007FFC0100010000001E100210022802C40000 -C21C:000000800080018002400C20000000007FFC010001001100100010001FF00000 -C21D:000000800080018002400C2000007FFC01000100000020F8201020303ECC0000 -C21E:000000800080018002400C2000007FFC01000100202021FC207020883E700000 -C21F:000000800080018002400C2000007FFC010001001FF01000100010001FF00000 -C220:000000800080018002400C2000007FFC010001001FF000101FF010001FF00000 -C221:000000800080018002400C2000007FFC010001003EF802083E0820083E080000 -C222:000000800080018002400C2000007FFC010001003EF802883E8820883EF80000 -C223:000000800080018002400C2000007FFC010001003E8802883EF820883EF80000 -C224:000000800080018002400C2000007FFC010001003E1002103E1020283EC40000 -C225:000000800080018002400C2000007FFC010001003EF802803EF820803EF80000 -C226:000000800080018002400C2000007FFC010001003EFC02483E4820483EFC0000 -C227:000000800080018002400C2000007FFC010001003E2003FC3E7020883E700000 -C228:000000800080018002400C2000007FFC010001001FF01010101010101FF00000 -C229:000000800080018002400C2000007FFC01000100101010101FF010101FF00000 -C22A:000000800080018002400C2000007FFC01000100222022203E2022503E880000 -C22B:000000800080018002400C2000007FFC0100010000000100010002800C400000 -C22C:000000800080018002400C2000007FFC010001000000024002400DA033100000 -C22D:000000800080018002400C2000007FFC01000100000007C00820082007C00000 -C22E:000000800080018002400C2000007FFC01000100000007E00080014006200000 -C22F:000000800080018002400C2000007FFC01000100008007E00080014006200000 -C230:000000800080018002400C2000007FFC010001001FF000101FF0001000100000 -C231:000000800080018002400C2000007FFC010001001FF010001FF010001FF00000 -C232:000000800080018002400C2000007FFC0100010000001FF0044004401FF00000 -C233:000000800080018002400C2000007FFC0100010001001FF007C0082007C00000 -C234:0000000802080208040804080A081108608800087FE8040804F8040804080000 -C235:0208020806080908308800087FE8027802080000000007F80008000800080000 -C236:0208020806080908308800087FE802780208000000003EF80208020802080000 -C237:0208020806080908308800087FE802780208000000001F080108011401620000 -C238:02080208060809083088000800087FE80278020802081000100010001FF80000 -C239:0208020806080908308800087FE8027802080000000020F8201020303ECC0000 -C23A:0208020806080908308800087FE8027802080000202021FC207020883E700000 -C23B:0208020806080908308800087FE802780208000003F802000200020003F80000 -C23C:0208020806080908308800087FE802780208000007F8000807F8040007F80000 -C23D:0208020806080908308800087FE80278020800003EF802083E0820083E080000 -C23E:0208020806080908308800087FE80278020800003EF802883E8820883EF80000 -C23F:0208020806080908308800087FE80278020800003E8802883EF820883EF80000 -C240:0208020806080908308800087FE80278020800000F8800880F8808140FA20000 -C241:0208020806080908308800087FE80278020800003EF802803EF820803EF80000 -C242:0208020806080908308800087FE80278020800003EFC02483E4820483EFC0000 -C243:0208020806080908308800087FE80278020800003E1002FE3E3820443E380000 -C244:0208020806080908308800087FE802780208000003F802080208020803F80000 -C245:0208020806080908308800087FE80278020800000208020803F8020803F80000 -C246:0208020806080908308800087FE8027802080000210821083F0821143F620000 -C247:0208020806080908308800087FE8027802080000001000100010006801840000 -C248:0208020806080908308800087FE80278020800000048004800A8011406620000 -C249:0208020806080908308800087FE8027802080000000003F00408040803F00000 -C24A:0208020806080908308800087FE802780208000003F80020002000D003080000 -C24B:0208020806080908308800087FE8027802080000004003F8004000A003180000 -C24C:0208020806080908308800087FE802780208000003F8000803F8000800080000 -C24D:0208020806080908308800087FE802780208000003F8020003F8020003F80000 -C24E:0208020806080908308800087FE802780208000000000FF8022002200FF80000 -C24F:0208020806080908308800087FE802780208000000800FF803E0041003E00000 -C250:0000000A020A020A040A040A0A0A110A608A000A7FEA040A047A040A040A0000 -C251:022802280628092830A800287FA805E804280000000007F80008000800080000 -C252:022802280628092830A800287FA805E80428000000003EF80208020802080000 -C253:022802280628092830A800287FA805E80428000000001F080108011401620000 -C254:022802280628092830A8002800287FA8042805E804281428100010001FF80000 -C255:022802280628092830A800287FA805E804280000000020F8201020303ECC0000 -C256:022802280628092830A800287FA805E804280000202021FC207020883E700000 -C257:022802280628092830A800287FA805E80428000003F802000200020003F80000 -C258:022802280628092830A800287FA805E80428000007F8000807F8040007F80000 -C259:022802280628092830A800287FA805E8042800003EF802083E0820083E080000 -C25A:022802280628092830A800287FA805E8042800003EF802883E8820883EF80000 -C25B:022802280628092830A800287FA805E8042800003E8802883EF820883EF80000 -C25C:022802280628092830A800287FA805E8042800000F8800880F8808140FA20000 -C25D:022802280628092830A800287FA805E8042800003EF802803EF820803EF80000 -C25E:022802280628092830A800287FA805E8042800003EFC02483E4820483EFC0000 -C25F:022802280628092830A800287FA805E8042800003E1002FE3E3820443E380000 -C260:022802280628092830A800287FA805E80428000003F802080208020803F80000 -C261:022802280628092830A800287FA805E8042800000208020803F8020803F80000 -C262:022802280628092830A800287FA805E804280000210821083F0821143F620000 -C263:022802280628092830A800287FA805E804280000001000100010006801840000 -C264:022802280628092830A800287FA805E8042800000048004800A8011406620000 -C265:022802280628092830A800287FA805E804280000000003F00408040803F00000 -C266:022802280628092830A800287FA805E80428000003F80020002000D003080000 -C267:022802280628092830A800287FA805E804280000004003F8004000A003180000 -C268:022802280628092830A800287FA805E80428000003F8000803F8000800080000 -C269:022802280628092830A800287FA805E80428000003F8020003F8020003F80000 -C26A:022802280628092830A800287FA805E80428000000000FF8022002200FF80000 -C26B:022802280628092830A800287FA805E80428000000800FF803E0041003E00000 -C26C:0000000802080208040804080A081108608800087FE804080408040804080000 -C26D:0208020806080908308800087FE8020802000000000007F80008000800080000 -C26E:0208020806080908308800087FE802080200000000003EF80208020802080000 -C26F:0208020806080908308800087FE802080200000000001F080108011401620000 -C270:02080208060809083088000800087FE80208020802081008100010001FF80000 -C271:0208020806080908308800087FE8020802000000000020F8201020303ECC0000 -C272:0208020806080908308800087FE8020802000000202021FC207020883E700000 -C273:0208020806080908308800087FE802080200000003F802000200020003F80000 -C274:0208020806080908308800087FE802080200000007F8000807F8040007F80000 -C275:0208020806080908308800087FE80208020000003EF802083E0820083E080000 -C276:0208020806080908308800087FE80208020000003EF802883E8820883EF80000 -C277:0208020806080908308800087FE80208020000003E8802883EF820883EF80000 -C278:0208020806080908308800087FE80208020000000F8800880F8808140FA20000 -C279:0208020806080908308800087FE80208020000003EF802803EF820803EF80000 -C27A:0208020806080908308800087FE80208020000003EFC02483E4820483EFC0000 -C27B:0208020806080908308800087FE80208020000003E1002FE3E3820443E380000 -C27C:0208020806080908308800087FE802080200000003F802080208020803F80000 -C27D:0208020806080908308800087FE80208020000000208020803F8020803F80000 -C27E:0208020806080908308800087FE8020802000000210821083F0821143F620000 -C27F:0208020806080908308800087FE8020802000000001000100010006801840000 -C280:0208020806080908308800087FE80208020000000048004800A8011406620000 -C281:0208020806080908308800087FE8020802000000000003F00408040803F00000 -C282:0208020806080908308800087FE802080200000003F80020002000D003080000 -C283:0208020806080908308800087FE8020802000000004003F8004000A003180000 -C284:0208020806080908308800087FE802080200000003F8000803F8000800080000 -C285:0208020806080908308800087FE802080200000003F8020003F8020003F80000 -C286:0208020806080908308800087FE802080200000000000FF8022002200FF80000 -C287:0208020806080908308800087FE802080200000000800FF803E0041003E00000 -C288:00000000008000800100010002800440182000007FFC04400440044004400000 -C289:000000800080018002400C2000007FFC044004401FF000100010001000100000 -C28A:000000800080018002400C2000007FFC0440044000003EF80208020802080000 -C28B:000000800080018002400C2000007FFC0440044000001E100210022802C40000 -C28C:000000800080018002400C20000000007FFC044004401440100010001FF00000 -C28D:000000800080018002400C2000007FFC04400440000020F8201020303ECC0000 -C28E:000000800080018002400C2000007FFC04400440202021FC207020883E700000 -C28F:000000800080018002400C2000007FFC044004401FF01000100010001FF00000 -C290:000000800080018002400C2000007FFC044004401FF000101FF010001FF00000 -C291:000000800080018002400C2000007FFC044004403EF802083E0820083E080000 -C292:000000800080018002400C2000007FFC044004403EF802883E8820883EF80000 -C293:000000800080018002400C2000007FFC044004403E8802883EF820883EF80000 -C294:000000800080018002400C2000007FFC044004403E1002103E1020283EC40000 -C295:000000800080018002400C2000007FFC044004403EF802803EF820803EF80000 -C296:000000800080018002400C2000007FFC044004403EFC02483E4820483EFC0000 -C297:000000800080018002400C2000007FFC044004403E2003FC3E7020883E700000 -C298:000000800080018002400C2000007FFC044004401FF01010101010101FF00000 -C299:000000800080018002400C2000007FFC04400440101010101FF010101FF00000 -C29A:000000800080018002400C2000007FFC04400440222022203E2022503E880000 -C29B:000000800080018002400C2000007FFC0440044000000100010002800C400000 -C29C:000000800080018002400C2000007FFC044004400000024002400DA033100000 -C29D:000000800080018002400C2000007FFC04400440000007C00820082007C00000 -C29E:000000800080018002400C2000007FFC04400440000007E00080014006200000 -C29F:000000800080018002400C2000007FFC04400440008007E00080014006200000 -C2A0:000000800080018002400C2000007FFC044004401FF000101FF0001000100000 -C2A1:000000800080018002400C2000007FFC044004401FF010001FF010001FF00000 -C2A2:000000800080018002400C2000007FFC0440044000001FF0044004401FF00000 -C2A3:000000800080018002400C2000007FFC0440044001001FF007C0082007C00000 -C2A4:000000000080008001000100028004401820000000007FFC0000000000000000 -C2A5:000000800080018002400C20000000007FFC00001FF000100010001000100000 -C2A6:000000800080018002400C20000000007FFC000000003EF80208020802080000 -C2A7:000000800080018002400C20000000007FFC000000001E100210022802C40000 -C2A8:000000800080018002400C20000000007FFC000000001000100010001FF00000 -C2A9:000000800080018002400C20000000007FFC0000000020F8201020303ECC0000 -C2AA:000000800080018002400C20000000007FFC0000202021FC207020883E700000 -C2AB:000000800080018002400C20000000007FFC00001FF01000100010001FF00000 -C2AC:000000800080018002400C20000000007FFC00001FF000101FF010001FF00000 -C2AD:000000800080018002400C20000000007FFC00003EF802083E0820083E080000 -C2AE:000000800080018002400C20000000007FFC00003EF802883E8820883EF80000 -C2AF:000000800080018002400C20000000007FFC00003E8802883EF820883EF80000 -C2B0:000000800080018002400C20000000007FFC00003E1002103E1020283EC40000 -C2B1:000000800080018002400C20000000007FFC00003EF802803EF820803EF80000 -C2B2:000000800080018002400C20000000007FFC00003EFC02483E4820483EFC0000 -C2B3:000000800080018002400C20000000007FFC00003E2003FC3E7020883E700000 -C2B4:000000800080018002400C20000000007FFC00001FF01010101010101FF00000 -C2B5:000000800080018002400C20000000007FFC0000101010101FF010101FF00000 -C2B6:000000800080018002400C20000000007FFC0000222022203E2022503E880000 -C2B7:000000800080018002400C20000000007FFC000000000100010002800C400000 -C2B8:000000800080018002400C20000000007FFC00000000024002400DA033100000 -C2B9:000000800080018002400C20000000007FFC0000000007C00820082007C00000 -C2BA:000000800080018002400C20000000007FFC0000000007E00080014006200000 -C2BB:000000800080018002400C20000000007FFC0000008007E00080014006200000 -C2BC:000000800080018002400C20000000007FFC00001FF000101FF0001000100000 -C2BD:000000800080018002400C20000000007FFC00001FF010001FF010001FF00000 -C2BE:000000800080018002400C20000000007FFC000000001FF0044004401FF00000 -C2BF:000000800080018002400C20000000007FFC000001001FF007C0082007C00000 -C2C0:00000008000802080208040804080A081108608800087FE80008000800080000 -C2C1:000002080208060809083088000800087FE8000007F800080008000800080000 -C2C2:000002080208060809083088000800087FE8000000003EF80208020802080000 -C2C3:000002080208060809083088000800087FE8000000001F080108011401620000 -C2C4:000002080208060809083088000800087FE8000008000800080008000FF80000 -C2C5:000002080208060809083088000800087FE80000000010F8101010301ECC0000 -C2C6:000002080208060809083088000800087FE800000808087F081C08220F9C0000 -C2C7:000002080208060809083088000800087FE8000003F802000200020003F80000 -C2C8:000002080208060809083088000800087FE8000007F8000807F8040007F80000 -C2C9:000002080208060809083088000800087FE800003EF802083E0820083E080000 -C2CA:000002080208060809083088000800087FE800003EF802883E8820883EF80000 -C2CB:000002080208060809083088000800087FE800003E8802883EF820883EF80000 -C2CC:000002080208060809083088000800087FE800001F0801081F0810141F620000 -C2CD:000002080208060809083088000800087FE800003EF802803EF820803EF80000 -C2CE:000002080208060809083088000800087FE800003EFC02483E4820483EFC0000 -C2CF:000002080208060809083088000800087FE800001F08017F1F1C10221F1C0000 -C2D0:000002080208060809083088000800087FE8000003F802080208020803F80000 -C2D1:000002080208060809083088000800087FE800000208020803F8020803F80000 -C2D2:000002080208060809083088000800087FE80000110811081F0811141F620000 -C2D3:000002080208060809083088000800087FE80000001000100010006801840000 -C2D4:000002080208060809083088000800087FE800000048004800A8011406620000 -C2D5:000002080208060809083088000800087FE80000000003F00408040803F00000 -C2D6:000002080208060809083088000800087FE8000003F80020002000D003080000 -C2D7:000002080208060809083088000800087FE80000004003F8004000A003180000 -C2D8:000002080208060809083088000800087FE8000003F8000803F8000800080000 -C2D9:000002080208060809083088000800087FE8000003F8020003F8020003F80000 -C2DA:000002080208060809083088000800087FE8000000000FF8022002200FF80000 -C2DB:000002080208060809083088000800087FE8000000800FF803E0041003E00000 -C2DC:000000000008000802080208040804080A081108608800080008000800080000 -C2DD:000000080008040804080C081208610800080000000007F80008000800080000 -C2DE:000000080008040804080C08120861080008000000003EF80208020802080000 -C2DF:000000080008040804080C08120861080008000000001F080108011401620000 -C2E0:000000080008040804080C08120861080008000800001000100010001FF80000 -C2E1:000000080008040804080C081208610800080000000020F8201020303ECC0000 -C2E2:000000080008040804080C081208610800080000202021FC207020883E700000 -C2E3:000000080008040804080C08120861080008000003F802000200020003F80000 -C2E4:000000080008040804080C08120861080008000007F8000807F8040007F80000 -C2E5:000000080008040804080C0812086108000800003EF802083E0820083E080000 -C2E6:000000080008040804080C0812086108000800003EF802883E8820883EF80000 -C2E7:000000080008040804080C0812086108000800003E8802883EF820883EF80000 -C2E8:000000080008040804080C0812086108000800000F8800880F8808140FA20000 -C2E9:000000080008040804080C0812086108000800003EF802803EF820803EF80000 -C2EA:000000080008040804080C0812086108000800003EFC02483E4820483EFC0000 -C2EB:000000080008040804080C0812086108000800003E1002FE3E3820443E380000 -C2EC:000000080008040804080C08120861080008000003F802080208020803F80000 -C2ED:000000080008040804080C0812086108000800000208020803F8020803F80000 -C2EE:000000080008040804080C081208610800080000210821083F0821143F620000 -C2EF:000000080008040804080C081208610800080000001000100010006801840000 -C2F0:000000080008040804080C0812086108000800000048004800A8011406620000 -C2F1:000000080008040804080C081208610800080000000003F00408040803F00000 -C2F2:000000080008040804080C08120861080008000003F80020002000D003080000 -C2F3:000000080008040804080C081208610800080000004003F8004000A003180000 -C2F4:000000080008040804080C08120861080008000003F8000803F8000800080000 -C2F5:000000080008040804080C08120861080008000003F8020003F8020003F80000 -C2F6:000000080008040804080C08120861080008000000000FF8022002200FF80000 -C2F7:000000080008040804080C08120861080008000000800FF803E0041003E00000 -C2F8:0000000000100010089008900890191E15102290CC5000100010001000100000 -C2F9:00000008000812081208340E2A0849080008000007F800080008000800080000 -C2FA:00000008000812081208340E2A0849080008000000003EF80208020802080000 -C2FB:00000008000812081208340E2A0849080008000000001F080108011401620000 -C2FC:00000008000812081208340E2A0849080008000808000800080008000FF80000 -C2FD:00000008000812081208340E2A08490800080000000010F8101010301ECC0000 -C2FE:00000008000812081208340E2A084908000800000808087F081C08220F9C0000 -C2FF:00000008000812081208340E2A0849080008000003F802000200020003F80000 -C300:00000008000812081208340E2A0849080008000007F8000807F8040007F80000 -C301:00000008000812081208340E2A084908000800003EF802083E0820083E080000 -C302:00000008000812081208340E2A084908000800003EF802883E8820883EF80000 -C303:00000008000812081208340E2A084908000800003E8802883EF820883EF80000 -C304:00000008000812081208340E2A084908000800001F0801081F0810141F620000 -C305:00000008000812081208340E2A084908000800003EF802803EF820803EF80000 -C306:00000008000812081208340E2A084908000800003EFC02483E4820483EFC0000 -C307:00000008000812081208340E2A084908000800001F08017F1F1C10221F1C0000 -C308:00000008000812081208340E2A0849080008000003F802080208020803F80000 -C309:00000008000812081208340E2A084908000800000208020803F8020803F80000 -C30A:00000008000812081208340E2A08490800080000110811081F0811141F620000 -C30B:00000008000812081208340E2A08490800080000001000100010006801840000 -C30C:00000008000812081208340E2A084908000800000048004800A8011406620000 -C30D:00000008000812081208340E2A08490800080000000003F00408040803F00000 -C30E:00000008000812081208340E2A0849080008000003F80020002000D003080000 -C30F:00000008000812081208340E2A08490800080000004003F8004000A003180000 -C310:00000008000812081208340E2A0849080008000003F8000803F8000800080000 -C311:00000008000812081208340E2A0849080008000003F8020003F8020003F80000 -C312:00000008000812081208340E2A0849080008000000000FF8022002200FF80000 -C313:00000008000812081208340E2A0849080008000000800FF803E0041003E00000 -C314:0000000000120012089208920892191E15122292CC5200120012001200120000 -C315:0000002800281228122834382A2849280028000007F800080008000800080000 -C316:0000002800281228122834382A2849280028000000003EF80208020802080000 -C317:0000002800281228122834382A2849280028000000003E100210022802C40000 -C318:0000002800281228122834382A2849280028002808000800080008000FF80000 -C319:0000002800281228122834382A28492800280000000020F8201020303ECC0000 -C31A:0000002800281228122834382A28492800280000202021FC207020883E700000 -C31B:0000002800281228122834382A2849280028000003F802000200020003F80000 -C31C:0000002800281228122834382A2849280028000007F8000807F8040007F80000 -C31D:0000002800281228122834382A284928002800003EF802083E0820083E080000 -C31E:0000002800281228122834382A284928002800003EF802883E8820883EF80000 -C31F:0000002800281228122834382A284928002800003E8802883EF820883EF80000 -C320:0000002800281228122834382A284928002800001F0801081F0810141F620000 -C321:0000002800281228122834382A284928002800003EF802803EF820803EF80000 -C322:0000002800281228122834382A284928002800003EFC02483E4820483EFC0000 -C323:0000002800281228122834382A284928002800003E1002FE3E3820443E380000 -C324:0000002800281228122834382A2849280028000003F802080208020803F80000 -C325:0000002800281228122834382A284928002800000208020803F8020803F80000 -C326:0000002800281228122834382A28492800280000110811081F0811141F620000 -C327:0000002800281228122834382A28492800280000000800080008003400C20000 -C328:0000002800281228122834382A284928002800000048004800A8011406620000 -C329:0000002800281228122834382A28492800280000000001F00208020801F00000 -C32A:0000002800281228122834382A2849280028000003F80020002000D003080000 -C32B:0000002800281228122834382A28492800280000004003F8004000A003180000 -C32C:0000002800281228122834382A2849280028000003F8000803F8000800080000 -C32D:0000002800281228122834382A2849280028000003F8020003F8020003F80000 -C32E:0000002800281228122834382A2849280028000000000FF8022002200FF80000 -C32F:0000002800281228122834382A2849280028000000800FF803E0041003E00000 -C330:000000000010001008900890089E19101510229ECC5000100010001000100000 -C331:0000000800081208120E34082A0E49080008000007F800080008000800080000 -C332:0000000800081208120E34082A0E49080008000000003EF80208020802080000 -C333:0000000800081208120E34082A0E49080008000000001F080108011401620000 -C334:0000000800081208120E34082A0E49080008000008000800080008000FF80000 -C335:0000000800081208120E34082A0E490800080000000010F8101010301ECC0000 -C336:0000000800081208120E34082A0E4908000800000808087F081C08220F9C0000 -C337:0000000800081208120E34082A0E49080008000003F802000200020003F80000 -C338:0000000800081208120E34082A0E49080008000007F8000807F8040007F80000 -C339:0000000800081208120E34082A0E4908000800003EF802083E0820083E080000 -C33A:0000000800081208120E34082A0E4908000800003EF802883E8820883EF80000 -C33B:0000000800081208120E34082A0E4908000800003E8802883EF820883EF80000 -C33C:0000000800081208120E34082A0E4908000800001F0801081F0810141F620000 -C33D:0000000800081208120E34082A0E4908000800003EF802803EF820803EF80000 -C33E:0000000800081208120E34082A0E4908000800003EFC02483E4820483EFC0000 -C33F:0000000800081208120E34082A0E4908000800001F08017F1F1C10221F1C0000 -C340:0000000800081208120E34082A0E49080008000003F802080208020803F80000 -C341:0000000800081208120E34082A0E4908000800000208020803F8020803F80000 -C342:0000000800081208120E34082A0E490800080000110811081F0811141F620000 -C343:0000000800081208120E34082A0E490800080000001000100010006801840000 -C344:0000000800081208120E34082A0E4908000800000048004800A8011406620000 -C345:0000000800081208120E34082A0E490800080000000003F00408040803F00000 -C346:0000000800081208120E34082A0E49080008000003F80020002000D003080000 -C347:0000000800081208120E34082A0E490800080000004003F8004000A003180000 -C348:0000000800081208120E34082A0E49080008000003F8000803F8000800080000 -C349:0000000800081208120E34082A0E49080008000003F8020003F8020003F80000 -C34A:0000000800081208120E34082A0E49080008000000000FF8022002200FF80000 -C34B:0000000800081208120E34082A0E49080008000000800FF803E0041003E00000 -C34C:000000000012001208920892089E19121512229ECC5200120012001200120000 -C34D:0000002800281228123834282A3849280028000007F800080008000800080000 -C34E:0000002800281228123834282A3849280028000000003EF80208020802080000 -C34F:0000002800281228123834282A3849280028000000003E100210022802C40000 -C350:0000002800281228123834282A3849280028002808000800080008000FF80000 -C351:0000002800281228123834282A38492800280000000020F8201020303ECC0000 -C352:0000002800281228123834282A38492800280000202021FC207020883E700000 -C353:0000002800281228123834282A3849280028000003F802000200020003F80000 -C354:0000002800281228123834282A3849280028000007F8000807F8040007F80000 -C355:0000002800281228123834282A384928002800003EF802083E0820083E080000 -C356:0000002800281228123834282A384928002800003EF802883E8820883EF80000 -C357:0000002800281228123834282A384928002800003E8802883EF820883EF80000 -C358:0000002800281228123834282A384928002800001F0801081F0810141F620000 -C359:0000002800281228123834282A384928002800003EF802803EF820803EF80000 -C35A:0000002800281228123834282A384928002800003EFC02483E4820483EFC0000 -C35B:0000002800281228123834282A384928002800003E1002FE3E3820443E380000 -C35C:0000002800281228123834282A3849280028000003F802080208020803F80000 -C35D:0000002800281228123834282A384928002800000208020803F8020803F80000 -C35E:0000002800281228123834282A38492800280000110811081F0811141F620000 -C35F:0000002800281228123834282A38492800280000000800080008003400C20000 -C360:0000002800281228123834282A384928002800000048004800A8011406620000 -C361:0000002800281228123834282A38492800280000000001F00208020801F00000 -C362:0000002800281228123834282A3849280028000003F80020002000D003080000 -C363:0000002800281228123834282A38492800280000004003F8004000A003180000 -C364:0000002800281228123834282A3849280028000003F8000803F8000800080000 -C365:0000002800281228123834282A3849280028000003F8020003F8020003F80000 -C366:0000002800281228123834282A3849280028000000000FF8022002200FF80000 -C367:0000002800281228123834282A3849280028000000800FF803E0041003E00000 -C368:0000000000020002088208820882191E15022282CC4200020002000200020000 -C369:0000000800081208120834382A08490800080000000007F80008000800080000 -C36A:0000000800081208120834382A0849080008000000003EF80208020802080000 -C36B:0000000800081208120834382A0849080008000000001F080108011401620000 -C36C:0000000800081208120834382A0849080008000000001000100010001FF80000 -C36D:0000000800081208120834382A08490800080000000020F8201020303ECC0000 -C36E:0000000800081208120834382A08490800080000202021FC207020883E700000 -C36F:0000000800081208120834382A0849080008000003F802000200020003F80000 -C370:0000000800081208120834382A0849080008000007F8000807F8040007F80000 -C371:0000000800081208120834382A084908000800003EF802083E0820083E080000 -C372:0000000800081208120834382A084908000800003EF802883E8820883EF80000 -C373:0000000800081208120834382A084908000800003E8802883EF820883EF80000 -C374:0000000800081208120834382A084908000800000F8800880F8808140FA20000 -C375:0000000800081208120834382A084908000800003EF802803EF820803EF80000 -C376:0000000800081208120834382A084908000800003EFC02483E4820483EFC0000 -C377:0000000800081208120834382A084908000800003E1002FE3E3820443E380000 -C378:0000000800081208120834382A0849080008000003F802080208020803F80000 -C379:0000000800081208120834382A084908000800000208020803F8020803F80000 -C37A:0000000800081208120834382A08490800080000210821083F0821143F620000 -C37B:0000000800081208120834382A08490800080000001000100010006801840000 -C37C:0000000800081208120834382A084908000800000048004800A8011406620000 -C37D:0000000800081208120834382A08490800080000000003F00408040803F00000 -C37E:0000000800081208120834382A0849080008000003F80020002000D003080000 -C37F:0000000800081208120834382A08490800080000004003F8004000A003180000 -C380:0000000800081208120834382A0849080008000003F8000803F8000800080000 -C381:0000000800081208120834382A0849080008000003F8020003F8020003F80000 -C382:0000000800081208120834382A0849080008000000000FF8022002200FF80000 -C383:0000000800081208120834382A0849080008000000800FF803E0041003E00000 -C384:00000000000A000A088A088A088A193A150A228ACC4A000A000A000A000A0000 -C385:0000002800281228122834E82A2849280028000007F800080008000800080000 -C386:0000002800281228122834E82A2849280028000000003EF80208020802080000 -C387:0000002800281228122834E82A2849280028000000003E100210022802C40000 -C388:0000002800281228122834E82A2849280028000008000800080008000FF80000 -C389:0000002800281228122834E82A28492800280000000020F8201020303ECC0000 -C38A:0000002800281228122834E82A28492800280000202021FC207020883E700000 -C38B:0000002800281228122834E82A2849280028000003F802000200020003F80000 -C38C:0000002800281228122834E82A2849280028000007F8000807F8040007F80000 -C38D:0000002800281228122834E82A284928002800003EF802083E0820083E080000 -C38E:0000002800281228122834E82A284928002800003EF802883E8820883EF80000 -C38F:0000002800281228122834E82A284928002800003E8802883EF820883EF80000 -C390:0000002800281228122834E82A284928002800001F0801081F0810141F620000 -C391:0000002800281228122834E82A284928002800003EF802803EF820803EF80000 -C392:0000002800281228122834E82A284928002800003EFC02483E4820483EFC0000 -C393:0000002800281228122834E82A284928002800003E1002FE3E3820443E380000 -C394:0000002800281228122834E82A2849280028000003F802080208020803F80000 -C395:0000002800281228122834E82A284928002800000208020803F8020803F80000 -C396:0000002800281228122834E82A28492800280000110811081F0811141F620000 -C397:0000002800281228122834E82A28492800280000000800080008003400C20000 -C398:0000002800281228122834E82A284928002800000048004800A8011406620000 -C399:0000002800281228122834E82A28492800280000000001F00208020801F00000 -C39A:0000002800281228122834E82A2849280028000003F80020002000D003080000 -C39B:0000002800281228122834E82A28492800280000004003F8004000A003180000 -C39C:0000002800281228122834E82A2849280028000003F8000803F8000800080000 -C39D:0000002800281228122834E82A2849280028000003F8020003F8020003F80000 -C39E:0000002800281228122834E82A2849280028000000000FF8022002200FF80000 -C39F:0000002800281228122834E82A2849280028000000800FF803E0041003E00000 -C3A0:000000000002000208820882089E19021502229ECC4200020002000200020000 -C3A1:0000000800081208123834082A38490800080000000007F80008000800080000 -C3A2:0000000800081208123834082A3849080008000000003EF80208020802080000 -C3A3:0000000800081208123834082A3849080008000000001F080108011401620000 -C3A4:0000000800081208123834082A3849080008000800001000100010001FF80000 -C3A5:0000000800081208123834082A38490800080000000020F8201020303ECC0000 -C3A6:0000000800081208123834082A38490800080000202021FC207020883E700000 -C3A7:0000000800081208123834082A3849080008000003F802000200020003F80000 -C3A8:0000000800081208123834082A3849080008000007F8000807F8040007F80000 -C3A9:0000000800081208123834082A384908000800003EF802083E0820083E080000 -C3AA:0000000800081208123834082A384908000800003EF802883E8820883EF80000 -C3AB:0000000800081208123834082A384908000800003E8802883EF820883EF80000 -C3AC:0000000800081208123834082A384908000800000F8800880F8808140FA20000 -C3AD:0000000800081208123834082A384908000800003EF802803EF820803EF80000 -C3AE:0000000800081208123834082A384908000800003EFC02483E4820483EFC0000 -C3AF:0000000800081208123834082A384908000800003E1002FE3E3820443E380000 -C3B0:0000000800081208123834082A3849080008000003F802080208020803F80000 -C3B1:0000000800081208123834082A384908000800000208020803F8020803F80000 -C3B2:0000000800081208123834082A38490800080000210821083F0821143F620000 -C3B3:0000000800081208123834082A38490800080000001000100010006801840000 -C3B4:0000000800081208123834082A384908000800000048004800A8011406620000 -C3B5:0000000800081208123834082A38490800080000000003F00408040803F00000 -C3B6:0000000800081208123834082A3849080008000003F80020002000D003080000 -C3B7:0000000800081208123834082A38490800080000004003F8004000A003180000 -C3B8:0000000800081208123834082A3849080008000003F8000803F8000800080000 -C3B9:0000000800081208123834082A3849080008000003F8020003F8020003F80000 -C3BA:0000000800081208123834082A3849080008000000000FF8022002200FF80000 -C3BB:0000000800081208123834082A3849080008000000800FF803E0041003E00000 -C3BC:00000000000A000A088A088A08BA190A150A22BACC4A000A000A000A000A0000 -C3BD:000000280028122812E834282AE849280028000007F800080008000800080000 -C3BE:000000280028122812E834282AE849280028000000003EF80208020802080000 -C3BF:000000280028122812E834282AE849280028000000003E100210022802C40000 -C3C0:000000280028122812E834282AE849280028002808000800080008000FF80000 -C3C1:000000280028122812E834282AE8492800280000000020F8201020303ECC0000 -C3C2:000000280028122812E834282AE8492800280000202021FC207020883E700000 -C3C3:000000280028122812E834282AE849280028000003F802000200020003F80000 -C3C4:000000280028122812E834282AE849280028000007F8000807F8040007F80000 -C3C5:000000280028122812E834282AE84928002800003EF802083E0820083E080000 -C3C6:000000280028122812E834282AE84928002800003EF802883E8820883EF80000 -C3C7:000000280028122812E834282AE84928002800003E8802883EF820883EF80000 -C3C8:000000280028122812E834282AE84928002800001F0801081F0810141F620000 -C3C9:000000280028122812E834282AE84928002800003EF802803EF820803EF80000 -C3CA:000000280028122812E834282AE84928002800003EFC02483E4820483EFC0000 -C3CB:000000280028122812E834282AE84928002800003E1002FE3E3820443E380000 -C3CC:000000280028122812E834282AE849280028000003F802080208020803F80000 -C3CD:000000280028122812E834282AE84928002800000208020803F8020803F80000 -C3CE:000000280028122812E834282AE8492800280000110811081F0811141F620000 -C3CF:000000280028122812E834282AE8492800280000000800080008003400C20000 -C3D0:000000280028122812E834282AE84928002800000048004800A8011406620000 -C3D1:000000280028122812E834282AE8492800280000000001F00208020801F00000 -C3D2:000000280028122812E834282AE849280028000003F80020002000D003080000 -C3D3:000000280028122812E834282AE8492800280000004003F8004000A003180000 -C3D4:000000280028122812E834282AE849280028000003F8000803F8000800080000 -C3D5:000000280028122812E834282AE849280028000003F8020003F8020003F80000 -C3D6:000000280028122812E834282AE849280028000000000FF8022002200FF80000 -C3D7:000000280028122812E834282AE849280028000000800FF803E0041003E00000 -C3D8:0000000000000220022002200640054008A033100100010001007FFC00000000 -C3D9:000000000220022004400AA0111001007FFC00001FF000100010001000100000 -C3DA:000000000220022004400AA0111001007FFC000000003EF80208020802080000 -C3DB:000000000220022004400AA0111001007FFC000000001E100210022802C40000 -C3DC:000000000220022004400AA0111001007FFC000000001000100010001FF00000 -C3DD:000000000220022004400AA0111001007FFC0000000020F8201020303ECC0000 -C3DE:000000000220022004400AA0111001007FFC0000202021FC207020883E700000 -C3DF:000000000220022004400AA0111001007FFC00001FF01000100010001FF00000 -C3E0:000000000220022004400AA0111001007FFC00001FF000101FF010001FF00000 -C3E1:000000000220022004400AA0111001007FFC00003EF802083E0820083E080000 -C3E2:000000000220022004400AA0111001007FFC00003EF802883E8820883EF80000 -C3E3:000000000220022004400AA0111001007FFC00003E8802883EF820883EF80000 -C3E4:000000000220022004400AA0111001007FFC00003E1002103E1020283EC40000 -C3E5:000000000220022004400AA0111001007FFC00003EF802803EF820803EF80000 -C3E6:000000000220022004400AA0111001007FFC00003EFC02483E4820483EFC0000 -C3E7:000000000220022004400AA0111001007FFC00003E2003FC3E7020883E700000 -C3E8:000000000220022004400AA0111001007FFC00001FF01010101010101FF00000 -C3E9:000000000220022004400AA0111001007FFC0000101010101FF010101FF00000 -C3EA:000000000220022004400AA0111001007FFC0000222022203E2022503E880000 -C3EB:000000000220022004400AA0111001007FFC000000000100010002800C400000 -C3EC:000000000220022004400AA0111001007FFC00000000024002400DA033100000 -C3ED:000000000220022004400AA0111001007FFC0000000007C00820082007C00000 -C3EE:000000000220022004400AA0111001007FFC0000000007E00080014006200000 -C3EF:000000000220022004400AA0111001007FFC0000008007E00080014006200000 -C3F0:000000000220022004400AA0111001007FFC00001FF000101FF0001000100000 -C3F1:000000000220022004400AA0111001007FFC00001FF010001FF010001FF00000 -C3F2:000000000220022004400AA0111001007FFC000000001FF0044004401FF00000 -C3F3:000000000220022004400AA0111001007FFC000001001FF007C0082007C00000 -C3F4:0000001000100890089008901910151E2290CC50041004107FD0001000100000 -C3F5:00000888088811082A8E4448040804087FE8000007F800080008000800080000 -C3F6:00000888088811082A8E4448040804087FE8000000003EF80208020802080000 -C3F7:00000888088811082A8E4448040804087FE8000000001F080108011401620000 -C3F8:00000888088811082A8E4448040804087FE8000008000800080008000FF80000 -C3F9:00000888088811082A8E4448040804087FE80000000010F8101010301ECC0000 -C3FA:00000888088811082A8E4448040804087FE800000808087F081C08220F9C0000 -C3FB:00000888088811082A8E4448040804087FE8000003F802000200020003F80000 -C3FC:00000888088811082A8E4448040804087FE8000007F8000807F8040007F80000 -C3FD:00000888088811082A8E4448040804087FE800003EF802083E0820083E080000 -C3FE:00000888088811082A8E4448040804087FE800003EF802883E8820883EF80000 -C3FF:00000888088811082A8E4448040804087FE800003E8802883EF820883EF80000 -C400:00000888088811082A8E4448040804087FE800001F0801081F0810141F620000 -C401:00000888088811082A8E4448040804087FE800003EF802803EF820803EF80000 -C402:00000888088811082A8E4448040804087FE800003EFC02483E4820483EFC0000 -C403:00000888088811082A8E4448040804087FE800001F08017F1F1C10221F1C0000 -C404:00000888088811082A8E4448040804087FE8000003F802080208020803F80000 -C405:00000888088811082A8E4448040804087FE800000208020803F8020803F80000 -C406:00000888088811082A8E4448040804087FE80000110811081F0811141F620000 -C407:00000888088811082A8E4448040804087FE80000001000100010006801840000 -C408:00000888088811082A8E4448040804087FE800000048004800A8011406620000 -C409:00000888088811082A8E4448040804087FE80000000003F00408040803F00000 -C40A:00000888088811082A8E4448040804087FE8000003F80020002000D003080000 -C40B:00000888088811082A8E4448040804087FE80000004003F8004000A003180000 -C40C:00000888088811082A8E4448040804087FE8000003F8000803F8000800080000 -C40D:00000888088811082A8E4448040804087FE8000003F8020003F8020003F80000 -C40E:00000888088811082A8E4448040804087FE8000000000FF8022002200FF80000 -C40F:00000888088811082A8E4448040804087FE8000000800FF803E0041003E00000 -C410:0000001200120892089208921912151E2292CC52041204127FD2001200120000 -C411:000008A808A811282AB84468042804287FA8000007F800080008000800080000 -C412:000008A808A811282AB84468042804287FA8000000003EF80208020802080000 -C413:000008A808A811282AB84468042804287FA8000000001F080108011401620000 -C414:000008A808A811282AB84468042804287FA8000008000800080008000FF80000 -C415:000008A808A811282AB84468042804287FA80000000010F8101010301ECC0000 -C416:000008A808A811282AB84468042804287FA800000808087F081C08220F9C0000 -C417:000008A808A811282AB84468042804287FA8000003F802000200020003F80000 -C418:000008A808A811282AB84468042804287FA8000007F8000807F8040007F80000 -C419:000008A808A811282AB84468042804287FA800003EF802083E0820083E080000 -C41A:000008A808A811282AB84468042804287FA800003EF802883E8820883EF80000 -C41B:000008A808A811282AB84468042804287FA800003E8802883EF820883EF80000 -C41C:000008A808A811282AB84468042804287FA800001F0801081F0810141F620000 -C41D:000008A808A811282AB84468042804287FA800003EF802803EF820803EF80000 -C41E:000008A808A811282AB84468042804287FA800003EFC02483E4820483EFC0000 -C41F:000008A808A811282AB84468042804287FA800001F08017F1F1C10221F1C0000 -C420:000008A808A811282AB84468042804287FA8000003F802080208020803F80000 -C421:000008A808A811282AB84468042804287FA800000208020803F8020803F80000 -C422:000008A808A811282AB84468042804287FA80000110811081F0811141F620000 -C423:000008A808A811282AB84468042804287FA80000001000100010006801840000 -C424:000008A808A811282AB84468042804287FA800000048004800A8011406620000 -C425:000008A808A811282AB84468042804287FA80000000003F00408040803F00000 -C426:000008A808A811282AB84468042804287FA8000003F80020002000D003080000 -C427:000008A808A811282AB84468042804287FA80000004003F8004000A003180000 -C428:000008A808A811282AB84468042804287FA8000003F8000803F8000800080000 -C429:000008A808A811282AB84468042804287FA8000003F8020003F8020003F80000 -C42A:000008A808A811282AB84468042804287FA8000000000FF8022002200FF80000 -C42B:000008A808A811282AB84468042804287FA8000000800FF803E0041003E00000 -C42C:000000080008088808880888190815082288CC48040804087FE8000800080000 -C42D:00000888088811082A884448040804087FE8000007F800080008000800080000 -C42E:00000888088811082A884448040804087FE8000000003EF80208020802080000 -C42F:00000888088811082A884448040804087FE8000000001F080108011401620000 -C430:00000888088811082A884448040804087FE8000008000800080008000FF80000 -C431:00000888088811082A884448040804087FE80000000010F8101010301ECC0000 -C432:00000888088811082A884448040804087FE800000808087F081C08220F9C0000 -C433:00000888088811082A884448040804087FE8000003F802000200020003F80000 -C434:00000888088811082A884448040804087FE8000007F8000807F8040007F80000 -C435:00000888088811082A884448040804087FE800003EF802083E0820083E080000 -C436:00000888088811082A884448040804087FE800003EF802883E8820883EF80000 -C437:00000888088811082A884448040804087FE800003E8802883EF820883EF80000 -C438:00000888088811082A884448040804087FE800001F0801081F0810141F620000 -C439:00000888088811082A884448040804087FE800003EF802803EF820803EF80000 -C43A:00000888088811082A884448040804087FE800003EFC02483E4820483EFC0000 -C43B:00000888088811082A884448040804087FE800001F08017F1F1C10221F1C0000 -C43C:00000888088811082A884448040804087FE8000003F802080208020803F80000 -C43D:00000888088811082A884448040804087FE800000208020803F8020803F80000 -C43E:00000888088811082A884448040804087FE80000110811081F0811141F620000 -C43F:00000888088811082A884448040804087FE80000001000100010006801840000 -C440:00000888088811082A884448040804087FE800000048004800A8011406620000 -C441:00000888088811082A884448040804087FE80000000003F00408040803F00000 -C442:00000888088811082A884448040804087FE8000003F80020002000D003080000 -C443:00000888088811082A884448040804087FE80000004003F8004000A003180000 -C444:00000888088811082A884448040804087FE8000003F8000803F8000800080000 -C445:00000888088811082A884448040804087FE8000003F8020003F8020003F80000 -C446:00000888088811082A884448040804087FE8000000000FF8022002200FF80000 -C447:00000888088811082A884448040804087FE8000000800FF803E0041003E00000 -C448:0000000000000220022002200640054008A037500440044004407FFC00000000 -C449:000000000220022004400AA0155004407FFC00001FF000100010001000100000 -C44A:000000000220022004400AA0155004407FFC000000003EF80208020802080000 -C44B:000000000220022004400AA0155004407FFC000000001E100210022802C40000 -C44C:000000000220022004400AA0155004407FFC000000001000100010001FF00000 -C44D:000000000220022004400AA0155004407FFC0000000020F8201020303ECC0000 -C44E:000000000220022004400AA0155004407FFC0000202021FC207020883E700000 -C44F:000000000220022004400AA0155004407FFC00001FF01000100010001FF00000 -C450:000000000220022004400AA0155004407FFC00001FF000101FF010001FF00000 -C451:000000000220022004400AA0155004407FFC00003EF802083E0820083E080000 -C452:000000000220022004400AA0155004407FFC00003EF802883E8820883EF80000 -C453:000000000220022004400AA0155004407FFC00003E8802883EF820883EF80000 -C454:000000000220022004400AA0155004407FFC00003E1002103E1020283EC40000 -C455:000000000220022004400AA0155004407FFC00003EF802803EF820803EF80000 -C456:000000000220022004400AA0155004407FFC00003EFC02483E4820483EFC0000 -C457:000000000220022004400AA0155004407FFC00003E2003FC3E7020883E700000 -C458:000000000220022004400AA0155004407FFC00001FF01010101010101FF00000 -C459:000000000220022004400AA0155004407FFC0000101010101FF010101FF00000 -C45A:000000000220022004400AA0155004407FFC0000222022203E2022503E880000 -C45B:000000000220022004400AA0155004407FFC000000000100010002800C400000 -C45C:000000000220022004400AA0155004407FFC00000000024002400DA033100000 -C45D:000000000220022004400AA0155004407FFC0000000007C00820082007C00000 -C45E:000000000220022004400AA0155004407FFC0000000007E00080014006200000 -C45F:000000000220022004400AA0155004407FFC0000008007E00080014006200000 -C460:000000000220022004400AA0155004407FFC00001FF000101FF0001000100000 -C461:000000000220022004400AA0155004407FFC00001FF010001FF010001FF00000 -C462:000000000220022004400AA0155004407FFC000000001FF0044004401FF00000 -C463:000000000220022004400AA0155004407FFC000001001FF007C0082007C00000 -C464:000000000220022002200640054008A0331000003FF801000100010001000000 -C465:000000000220022004400AA011107FFC010001001FF000100010001000100000 -C466:000000000220022004400AA011107FFC0100010000003EF80208020802080000 -C467:000000000220022004400AA011107FFC0100010000001E100210022802C40000 -C468:000000000220022004400AA0111000007FFC010001001100100010001FF00000 -C469:000000000220022004400AA011107FFC01000100000020F8201020303ECC0000 -C46A:000000000220022004400AA011107FFC01000100202021FC207020883E700000 -C46B:000000000220022004400AA011107FFC010001001FF01000100010001FF00000 -C46C:000000000220022004400AA011107FFC010001001FF000101FF010001FF00000 -C46D:000000000220022004400AA011107FFC010001003EF802083E0820083E080000 -C46E:000000000220022004400AA011107FFC010001003EF802883E8820883EF80000 -C46F:000000000220022004400AA011107FFC010001003E8802883EF820883EF80000 -C470:000000000220022004400AA011107FFC010001003E1002103E1020283EC40000 -C471:000000000220022004400AA011107FFC010001003EF802803EF820803EF80000 -C472:000000000220022004400AA011107FFC010001003EFC02483E4820483EFC0000 -C473:000000000220022004400AA011107FFC010001003E2003FC3E7020883E700000 -C474:000000000220022004400AA011107FFC010001001FF01010101010101FF00000 -C475:000000000220022004400AA011107FFC01000100101010101FF010101FF00000 -C476:000000000220022004400AA011107FFC01000100222022203E2022503E880000 -C477:000000000220022004400AA011107FFC0100010000000100010002800C400000 -C478:000000000220022004400AA011107FFC010001000000024002400DA033100000 -C479:000000000220022004400AA011107FFC01000100000007C00820082007C00000 -C47A:000000000220022004400AA011107FFC01000100000007E00080014006200000 -C47B:000000000220022004400AA011107FFC01000100008007E00080014006200000 -C47C:000000000220022004400AA011107FFC010001001FF000101FF0001000100000 -C47D:000000000220022004400AA011107FFC010001001FF010001FF010001FF00000 -C47E:000000000220022004400AA011107FFC0100010000001FF0044004401FF00000 -C47F:000000000220022004400AA011107FFC0100010001001FF007C0082007C00000 -C480:00000008088808880888190815082288CC4800087FE8040804F8040804080000 -C481:00080888088811082A8844487FE8027802080000000007F80008000800080000 -C482:00080888088811082A8844487FE802780208000000003EF80208020802080000 -C483:00080888088811082A8844487FE802780208000000001F080108011401620000 -C484:00080888088811082A88444800087FE80278020802081000100010001FF80000 -C485:00080888088811082A8844487FE8027802080000000020F8201020303ECC0000 -C486:00080888088811082A8844487FE8027802080000202021FC207020883E700000 -C487:00080888088811082A8844487FE802780208000003F802000200020003F80000 -C488:00080888088811082A8844487FE802780208000007F8000807F8040007F80000 -C489:00080888088811082A8844487FE80278020800003EF802083E0820083E080000 -C48A:00080888088811082A8844487FE80278020800003EF802883E8820883EF80000 -C48B:00080888088811082A8844487FE80278020800003E8802883EF820883EF80000 -C48C:00080888088811082A8844487FE80278020800000F8800880F8808140FA20000 -C48D:00080888088811082A8844487FE80278020800003EF802803EF820803EF80000 -C48E:00080888088811082A8844487FE80278020800003EFC02483E4820483EFC0000 -C48F:00080888088811082A8844487FE80278020800003E1002FE3E3820443E380000 -C490:00080888088811082A8844487FE802780208000003F802080208020803F80000 -C491:00080888088811082A8844487FE80278020800000208020803F8020803F80000 -C492:00080888088811082A8844487FE8027802080000210821083F0821143F620000 -C493:00080888088811082A8844487FE8027802080000001000100010006801840000 -C494:00080888088811082A8844487FE80278020800000048004800A8011406620000 -C495:00080888088811082A8844487FE8027802080000000003F00408040803F00000 -C496:00080888088811082A8844487FE802780208000003F80020002000D003080000 -C497:00080888088811082A8844487FE8027802080000004003F8004000A003180000 -C498:00080888088811082A8844487FE802780208000003F8000803F8000800080000 -C499:00080888088811082A8844487FE802780208000003F8020003F8020003F80000 -C49A:00080888088811082A8844487FE802780208000000000FF8022002200FF80000 -C49B:00080888088811082A8844487FE802780208000000800FF803E0041003E00000 -C49C:0000000A088A088A088A190A150A228ACC4A000A7FEA040A047A040A040A0000 -C49D:002808A808A811282AA844687FA805E804280000000007F80008000800080000 -C49E:002808A808A811282AA844687FA805E80428000000003EF80208020802080000 -C49F:002808A808A811282AA844687FA805E80428000000001F080108011401620000 -C4A0:002808A808A811282AA8446800287FA8042805E804281428100010001FF80000 -C4A1:002808A808A811282AA844687FA805E804280000000020F8201020303ECC0000 -C4A2:002808A808A811282AA844687FA805E804280000202021FC207020883E700000 -C4A3:002808A808A811282AA844687FA805E80428000003F802000200020003F80000 -C4A4:002808A808A811282AA844687FA805E80428000007F8000807F8040007F80000 -C4A5:002808A808A811282AA844687FA805E8042800003EF802083E0820083E080000 -C4A6:002808A808A811282AA844687FA805E8042800003EF802883E8820883EF80000 -C4A7:002808A808A811282AA844687FA805E8042800003E8802883EF820883EF80000 -C4A8:002808A808A811282AA844687FA805E8042800000F8800880F8808140FA20000 -C4A9:002808A808A811282AA844687FA805E8042800003EF802803EF820803EF80000 -C4AA:002808A808A811282AA844687FA805E8042800003EFC02483E4820483EFC0000 -C4AB:002808A808A811282AA844687FA805E8042800003E1002FE3E3820443E380000 -C4AC:002808A808A811282AA844687FA805E80428000003F802080208020803F80000 -C4AD:002808A808A811282AA844687FA805E8042800000208020803F8020803F80000 -C4AE:002808A808A811282AA844687FA805E804280000210821083F0821143F620000 -C4AF:002808A808A811282AA844687FA805E804280000001000100010006801840000 -C4B0:002808A808A811282AA844687FA805E8042800000048004800A8011406620000 -C4B1:002808A808A811282AA844687FA805E804280000000003F00408040803F00000 -C4B2:002808A808A811282AA844687FA805E80428000003F80020002000D003080000 -C4B3:002808A808A811282AA844687FA805E804280000004003F8004000A003180000 -C4B4:002808A808A811282AA844687FA805E80428000003F8000803F8000800080000 -C4B5:002808A808A811282AA844687FA805E80428000003F8020003F8020003F80000 -C4B6:002808A808A811282AA844687FA805E80428000000000FF8022002200FF80000 -C4B7:002808A808A811282AA844687FA805E80428000000800FF803E0041003E00000 -C4B8:00000008088808880888190815082288CC4800087FE804080408040804080000 -C4B9:00080888088811082A8844487FE8020802000000000007F80008000800080000 -C4BA:00080888088811082A8844487FE802080200000000003EF80208020802080000 -C4BB:00080888088811082A8844487FE802080200000000001F080108011401620000 -C4BC:00080888088811082A88444800087FE80208020802081008100010001FF80000 -C4BD:00080888088811082A8844487FE8020802000000000020F8201020303ECC0000 -C4BE:00080888088811082A8844487FE8020802000000202021FC207020883E700000 -C4BF:00080888088811082A8844487FE802080200000003F802000200020003F80000 -C4C0:00080888088811082A8844487FE802080200000007F8000807F8040007F80000 -C4C1:00080888088811082A8844487FE80208020000003EF802083E0820083E080000 -C4C2:00080888088811082A8844487FE80208020000003EF802883E8820883EF80000 -C4C3:00080888088811082A8844487FE80208020000003E8802883EF820883EF80000 -C4C4:00080888088811082A8844487FE80208020000000F8800880F8808140FA20000 -C4C5:00080888088811082A8844487FE80208020000003EF802803EF820803EF80000 -C4C6:00080888088811082A8844487FE80208020000003EFC02483E4820483EFC0000 -C4C7:00080888088811082A8844487FE80208020000003E1002FE3E3820443E380000 -C4C8:00080888088811082A8844487FE802080200000003F802080208020803F80000 -C4C9:00080888088811082A8844487FE80208020000000208020803F8020803F80000 -C4CA:00080888088811082A8844487FE8020802000000210821083F0821143F620000 -C4CB:00080888088811082A8844487FE8020802000000001000100010006801840000 -C4CC:00080888088811082A8844487FE80208020000000048004800A8011406620000 -C4CD:00080888088811082A8844487FE8020802000000000003F00408040803F00000 -C4CE:00080888088811082A8844487FE802080200000003F80020002000D003080000 -C4CF:00080888088811082A8844487FE8020802000000004003F8004000A003180000 -C4D0:00080888088811082A8844487FE802080200000003F8000803F8000800080000 -C4D1:00080888088811082A8844487FE802080200000003F8020003F8020003F80000 -C4D2:00080888088811082A8844487FE802080200000000000FF8022002200FF80000 -C4D3:00080888088811082A8844487FE802080200000000800FF803E0041003E00000 -C4D4:000000000220022002200640054008A0331000007FFC04400440044004400000 -C4D5:000000000220022004400AA011107FFC044004401FF000100010001000100000 -C4D6:000000000220022004400AA011107FFC0440044000003EF80208020802080000 -C4D7:000000000220022004400AA011107FFC0440044000001E100210022802C40000 -C4D8:000000000220022004400AA0111000007FFC044004401440100010001FF00000 -C4D9:000000000220022004400AA011107FFC04400440000020F8201020303ECC0000 -C4DA:000000000220022004400AA011107FFC04400440202021FC207020883E700000 -C4DB:000000000220022004400AA011107FFC044004401FF01000100010001FF00000 -C4DC:000000000220022004400AA011107FFC044004401FF000101FF010001FF00000 -C4DD:000000000220022004400AA011107FFC044004403EF802083E0820083E080000 -C4DE:000000000220022004400AA011107FFC044004403EF802883E8820883EF80000 -C4DF:000000000220022004400AA011107FFC044004403E8802883EF820883EF80000 -C4E0:000000000220022004400AA011107FFC044004403E1002103E1020283EC40000 -C4E1:000000000220022004400AA011107FFC044004403EF802803EF820803EF80000 -C4E2:000000000220022004400AA011107FFC044004403EFC02483E4820483EFC0000 -C4E3:000000000220022004400AA011107FFC044004403E2003FC3E7020883E700000 -C4E4:000000000220022004400AA011107FFC044004401FF01010101010101FF00000 -C4E5:000000000220022004400AA011107FFC04400440101010101FF010101FF00000 -C4E6:000000000220022004400AA011107FFC04400440222022203E2022503E880000 -C4E7:000000000220022004400AA011107FFC0440044000000100010002800C400000 -C4E8:000000000220022004400AA011107FFC044004400000024002400DA033100000 -C4E9:000000000220022004400AA011107FFC04400440000007C00820082007C00000 -C4EA:000000000220022004400AA011107FFC04400440000007E00080014006200000 -C4EB:000000000220022004400AA011107FFC04400440008007E00080014006200000 -C4EC:000000000220022004400AA011107FFC044004401FF000101FF0001000100000 -C4ED:000000000220022004400AA011107FFC044004401FF010001FF010001FF00000 -C4EE:000000000220022004400AA011107FFC0440044000001FF0044004401FF00000 -C4EF:000000000220022004400AA011107FFC0440044001001FF007C0082007C00000 -C4F0:0000000000000220022002200640054008A0331000007FFC0000000000000000 -C4F1:000000000220022004400AA0111000007FFC00001FF000100010001000100000 -C4F2:000000000220022004400AA0111000007FFC000000003EF80208020802080000 -C4F3:000000000220022004400AA0111000007FFC000000001E100210022802C40000 -C4F4:000000000220022004400AA0111000007FFC000000001000100010001FF00000 -C4F5:000000000220022004400AA0111000007FFC0000000020F8201020303ECC0000 -C4F6:000000000220022004400AA0111000007FFC0000202021FC207020883E700000 -C4F7:000000000220022004400AA0111000007FFC00001FF01000100010001FF00000 -C4F8:000000000220022004400AA0111000007FFC00001FF000101FF010001FF00000 -C4F9:000000000220022004400AA0111000007FFC00003EF802083E0820083E080000 -C4FA:000000000220022004400AA0111000007FFC00003EF802883E8820883EF80000 -C4FB:000000000220022004400AA0111000007FFC00003E8802883EF820883EF80000 -C4FC:000000000220022004400AA0111000007FFC00003E1002103E1020283EC40000 -C4FD:000000000220022004400AA0111000007FFC00003EF802803EF820803EF80000 -C4FE:000000000220022004400AA0111000007FFC00003EFC02483E4820483EFC0000 -C4FF:000000000220022004400AA0111000007FFC00003E2003FC3E7020883E700000 -C500:000000000220022004400AA0111000007FFC00001FF01010101010101FF00000 -C501:000000000220022004400AA0111000007FFC0000101010101FF010101FF00000 -C502:000000000220022004400AA0111000007FFC0000222022203E2022503E880000 -C503:000000000220022004400AA0111000007FFC000000000100010002800C400000 -C504:000000000220022004400AA0111000007FFC00000000024002400DA033100000 -C505:000000000220022004400AA0111000007FFC0000000007C00820082007C00000 -C506:000000000220022004400AA0111000007FFC0000000007E00080014006200000 -C507:000000000220022004400AA0111000007FFC0000008007E00080014006200000 -C508:000000000220022004400AA0111000007FFC00001FF000101FF0001000100000 -C509:000000000220022004400AA0111000007FFC00001FF010001FF010001FF00000 -C50A:000000000220022004400AA0111000007FFC000000001FF0044004401FF00000 -C50B:000000000220022004400AA0111000007FFC000001001FF007C0082007C00000 -C50C:000000080008088808880888190815082288CC4800087FE80008000800080000 -C50D:00000888088811082A884448000800087FE8000007F800080008000800080000 -C50E:00000888088811082A884448000800087FE8000000003EF80208020802080000 -C50F:00000888088811082A884448000800087FE8000000001F080108011401620000 -C510:00000888088811082A884448000800087FE8000008000800080008000FF80000 -C511:00000888088811082A884448000800087FE80000000010F8101010301ECC0000 -C512:00000888088811082A884448000800087FE800000808087F081C08220F9C0000 -C513:00000888088811082A884448000800087FE8000003F802000200020003F80000 -C514:00000888088811082A884448000800087FE8000007F8000807F8040007F80000 -C515:00000888088811082A884448000800087FE800003EF802083E0820083E080000 -C516:00000888088811082A884448000800087FE800003EF802883E8820883EF80000 -C517:00000888088811082A884448000800087FE800003E8802883EF820883EF80000 -C518:00000888088811082A884448000800087FE800001F0801081F0810141F620000 -C519:00000888088811082A884448000800087FE800003EF802803EF820803EF80000 -C51A:00000888088811082A884448000800087FE800003EFC02483E4820483EFC0000 -C51B:00000888088811082A884448000800087FE800001F08017F1F1C10221F1C0000 -C51C:00000888088811082A884448000800087FE8000003F802080208020803F80000 -C51D:00000888088811082A884448000800087FE800000208020803F8020803F80000 -C51E:00000888088811082A884448000800087FE80000110811081F0811141F620000 -C51F:00000888088811082A884448000800087FE80000001000100010006801840000 -C520:00000888088811082A884448000800087FE800000048004800A8011406620000 -C521:00000888088811082A884448000800087FE80000000003F00408040803F00000 -C522:00000888088811082A884448000800087FE8000003F80020002000D003080000 -C523:00000888088811082A884448000800087FE80000004003F8004000A003180000 -C524:00000888088811082A884448000800087FE8000003F8000803F8000800080000 -C525:00000888088811082A884448000800087FE8000003F8020003F8020003F80000 -C526:00000888088811082A884448000800087FE8000000000FF8022002200FF80000 -C527:00000888088811082A884448000800087FE8000000800FF803E0041003E00000 -C528:0000000000080008088808880888190815082288CC4800080008000800080000 -C529:0000000800081208120834082A08490800080000000007F80008000800080000 -C52A:0000000800081208120834082A0849080008000000003EF80208020802080000 -C52B:0000000800081208120834082A0849080008000000001F080108011401620000 -C52C:0000000800081208120834082A0849080008000800001000100010001FF80000 -C52D:0000000800081208120834082A08490800080000000020F8201020303ECC0000 -C52E:0000000800081208120834082A08490800080000202021FC207020883E700000 -C52F:0000000800081208120834082A0849080008000003F802000200020003F80000 -C530:0000000800081208120834082A0849080008000007F8000807F8040007F80000 -C531:0000000800081208120834082A084908000800003EF802083E0820083E080000 -C532:0000000800081208120834082A084908000800003EF802883E8820883EF80000 -C533:0000000800081208120834082A084908000800003E8802883EF820883EF80000 -C534:0000000800081208120834082A084908000800000F8800880F8808140FA20000 -C535:0000000800081208120834082A084908000800003EF802803EF820803EF80000 -C536:0000000800081208120834082A084908000800003EFC02483E4820483EFC0000 -C537:0000000800081208120834082A084908000800003E1002FE3E3820443E380000 -C538:0000000800081208120834082A0849080008000003F802080208020803F80000 -C539:0000000800081208120834082A084908000800000208020803F8020803F80000 -C53A:0000000800081208120834082A08490800080000210821083F0821143F620000 -C53B:0000000800081208120834082A08490800080000001000100010006801840000 -C53C:0000000800081208120834082A084908000800000048004800A8011406620000 -C53D:0000000800081208120834082A08490800080000000003F00408040803F00000 -C53E:0000000800081208120834082A0849080008000003F80020002000D003080000 -C53F:0000000800081208120834082A08490800080000004003F8004000A003180000 -C540:0000000800081208120834082A0849080008000003F8000803F8000800080000 -C541:0000000800081208120834082A0849080008000003F8020003F8020003F80000 -C542:0000000800081208120834082A0849080008000000000FF8022002200FF80000 -C543:0000000800081208120834082A0849080008000000800FF803E0041003E00000 -C544:00000000001000101E1021104090409E409021101E1000100010001000100000 -C545:000000081E0821082108210E21081E080008000007F800080008000800080000 -C546:000000081E0821082108210E21081E080008000000003EF80208020802080000 -C547:000000081E0821082108210E21081E080008000000001F080108011401620000 -C548:000000081E0821082108210E21081E080008000808000800080008000FF80000 -C549:000000081E0821082108210E21081E0800080000000010F8101010301ECC0000 -C54A:000000081E0821082108210E21081E08000800000808087F081C08220F9C0000 -C54B:000000081E0821082108210E21081E080008000003F802000200020003F80000 -C54C:000000081E0821082108210E21081E080008000007F8000807F8040007F80000 -C54D:000000081E0821082108210E21081E08000800003EF802083E0820083E080000 -C54E:000000081E0821082108210E21081E08000800003EF802883E8820883EF80000 -C54F:000000081E0821082108210E21081E08000800003E8802883EF820883EF80000 -C550:000000081E0821082108210E21081E08000800001F0801081F0810141F620000 -C551:000000081E0821082108210E21081E08000800003EF802803EF820803EF80000 -C552:000000081E0821082108210E21081E08000800003EFC02483E4820483EFC0000 -C553:000000081E0821082108210E21081E08000800001F08017F1F1C10221F1C0000 -C554:000000081E0821082108210E21081E080008000003F802080208020803F80000 -C555:000000081E0821082108210E21081E08000800000208020803F8020803F80000 -C556:000000081E0821082108210E21081E0800080000110811081F0811141F620000 -C557:000000081E0821082108210E21081E0800080000001000100010006801840000 -C558:000000081E0821082108210E21081E08000800000048004800A8011406620000 -C559:000000081E0821082108210E21081E0800080000000003F00408040803F00000 -C55A:000000081E0821082108210E21081E080008000003F80020002000D003080000 -C55B:000000081E0821082108210E21081E0800080000004003F8004000A003180000 -C55C:000000081E0821082108210E21081E080008000003F8000803F8000800080000 -C55D:000000081E0821082108210E21081E080008000003F8020003F8020003F80000 -C55E:000000081E0821082108210E21081E080008000000000FF8022002200FF80000 -C55F:000000081E0821082108210E21081E080008000000800FF803E0041003E00000 -C560:00000000001200121E1221124092409E409221121E1200120012001200120000 -C561:000000281E2821282128213821281E280028000007F800080008000800080000 -C562:000000281E2821282128213821281E280028000000003EF80208020802080000 -C563:000000281E2821282128213821281E280028000000003E100210022802C40000 -C564:000000281E2821282128213821281E280028002808000800080008000FF80000 -C565:000000281E2821282128213821281E2800280000000020F8201020303ECC0000 -C566:000000281E2821282128213821281E2800280000202021FC207020883E700000 -C567:000000281E2821282128213821281E280028000003F802000200020003F80000 -C568:000000281E2821282128213821281E280028000007F8000807F8040007F80000 -C569:000000281E2821282128213821281E28002800003EF802083E0820083E080000 -C56A:000000281E2821282128213821281E28002800003EF802883E8820883EF80000 -C56B:000000281E2821282128213821281E28002800003E8802883EF820883EF80000 -C56C:000000281E2821282128213821281E28002800001F0801081F0810141F620000 -C56D:000000281E2821282128213821281E28002800003EF802803EF820803EF80000 -C56E:000000281E2821282128213821281E28002800003EFC02483E4820483EFC0000 -C56F:000000281E2821282128213821281E28002800003E1002FE3E3820443E380000 -C570:000000281E2821282128213821281E280028000003F802080208020803F80000 -C571:000000281E2821282128213821281E28002800000208020803F8020803F80000 -C572:000000281E2821282128213821281E2800280000110811081F0811141F620000 -C573:000000281E2821282128213821281E2800280000000800080008003400C20000 -C574:000000281E2821282128213821281E28002800000048004800A8011406620000 -C575:000000281E2821282128213821281E2800280000000001F00208020801F00000 -C576:000000281E2821282128213821281E280028000003F80020002000D003080000 -C577:000000281E2821282128213821281E2800280000004003F8004000A003180000 -C578:000000281E2821282128213821281E280028000003F8000803F8000800080000 -C579:000000281E2821282128213821281E280028000003F8020003F8020003F80000 -C57A:000000281E2821282128213821281E280028000000000FF8022002200FF80000 -C57B:000000281E2821282128213821281E280028000000800FF803E0041003E00000 -C57C:00000000001000101E102110409E40904090211E1E1000100010001000100000 -C57D:000000081E082108210E2108210E1E080008000007F800080008000800080000 -C57E:000000081E082108210E2108210E1E080008000000003EF80208020802080000 -C57F:000000081E082108210E2108210E1E080008000000001F080108011401620000 -C580:000000081E082108210E2108210E1E080008000008000800080008000FF80000 -C581:000000081E082108210E2108210E1E0800080000000010F8101010301ECC0000 -C582:000000081E082108210E2108210E1E08000800000808087F081C08220F9C0000 -C583:000000081E082108210E2108210E1E080008000003F802000200020003F80000 -C584:000000081E082108210E2108210E1E080008000007F8000807F8040007F80000 -C585:000000081E082108210E2108210E1E08000800003EF802083E0820083E080000 -C586:000000081E082108210E2108210E1E08000800003EF802883E8820883EF80000 -C587:000000081E082108210E2108210E1E08000800003E8802883EF820883EF80000 -C588:000000081E082108210E2108210E1E08000800001F0801081F0810141F620000 -C589:000000081E082108210E2108210E1E08000800003EF802803EF820803EF80000 -C58A:000000081E082108210E2108210E1E08000800003EFC02483E4820483EFC0000 -C58B:000000081E082108210E2108210E1E08000800001F08017F1F1C10221F1C0000 -C58C:000000081E082108210E2108210E1E080008000003F802080208020803F80000 -C58D:000000081E082108210E2108210E1E08000800000208020803F8020803F80000 -C58E:000000081E082108210E2108210E1E0800080000110811081F0811141F620000 -C58F:000000081E082108210E2108210E1E0800080000001000100010006801840000 -C590:000000081E082108210E2108210E1E08000800000048004800A8011406620000 -C591:000000081E082108210E2108210E1E0800080000000003F00408040803F00000 -C592:000000081E082108210E2108210E1E080008000003F80020002000D003080000 -C593:000000081E082108210E2108210E1E0800080000004003F8004000A003180000 -C594:000000081E082108210E2108210E1E080008000003F8000803F8000800080000 -C595:000000081E082108210E2108210E1E080008000003F8020003F8020003F80000 -C596:000000081E082108210E2108210E1E080008000000000FF8022002200FF80000 -C597:000000081E082108210E2108210E1E080008000000800FF803E0041003E00000 -C598:00000000001200121E122112409E40924092211E1E1200120012001200120000 -C599:000000281E2821282138212821381E280028000007F800080008000800080000 -C59A:000000281E2821282138212821381E280028000000003EF80208020802080000 -C59B:000000281E2821282138212821381E280028000000003E100210022802C40000 -C59C:000000281E2821282138212821381E280028002808000800080008000FF80000 -C59D:000000281E2821282138212821381E2800280000000020F8201020303ECC0000 -C59E:000000281E2821282138212821381E2800280000202021FC207020883E700000 -C59F:000000281E2821282138212821381E280028000003F802000200020003F80000 -C5A0:000000281E2821282138212821381E280028000007F8000807F8040007F80000 -C5A1:000000281E2821282138212821381E28002800003EF802083E0820083E080000 -C5A2:000000281E2821282138212821381E28002800003EF802883E8820883EF80000 -C5A3:000000281E2821282138212821381E28002800003E8802883EF820883EF80000 -C5A4:000000281E2821282138212821381E28002800001F0801081F0810141F620000 -C5A5:000000281E2821282138212821381E28002800003EF802803EF820803EF80000 -C5A6:000000281E2821282138212821381E28002800003EFC02483E4820483EFC0000 -C5A7:000000281E2821282138212821381E28002800003E1002FE3E3820443E380000 -C5A8:000000281E2821282138212821381E280028000003F802080208020803F80000 -C5A9:000000281E2821282138212821381E28002800000208020803F8020803F80000 -C5AA:000000281E2821282138212821381E2800280000110811081F0811141F620000 -C5AB:000000281E2821282138212821381E2800280000000800080008003400C20000 -C5AC:000000281E2821282138212821381E28002800000048004800A8011406620000 -C5AD:000000281E2821282138212821381E2800280000000001F00208020801F00000 -C5AE:000000281E2821282138212821381E280028000003F80020002000D003080000 -C5AF:000000281E2821282138212821381E2800280000004003F8004000A003180000 -C5B0:000000281E2821282138212821381E280028000003F8000803F8000800080000 -C5B1:000000281E2821282138212821381E280028000003F8020003F8020003F80000 -C5B2:000000281E2821282138212821381E280028000000000FF8022002200FF80000 -C5B3:000000281E2821282138212821381E280028000000800FF803E0041003E00000 -C5B4:00000000000200021E0221024082409E408221021E0200020002000200020000 -C5B5:000000081E0821082108213821081E0800080000000007F80008000800080000 -C5B6:000000081E0821082108213821081E080008000000003EF80208020802080000 -C5B7:000000081E0821082108213821081E080008000000001F080108011401620000 -C5B8:000000081E0821082108213821081E080008000000001000100010001FF80000 -C5B9:000000081E0821082108213821081E0800080000000020F8201020303ECC0000 -C5BA:000000081E0821082108213821081E0800080000202021FC207020883E700000 -C5BB:000000081E0821082108213821081E080008000003F802000200020003F80000 -C5BC:000000081E0821082108213821081E080008000007F8000807F8040007F80000 -C5BD:000000081E0821082108213821081E08000800003EF802083E0820083E080000 -C5BE:000000081E0821082108213821081E08000800003EF802883E8820883EF80000 -C5BF:000000081E0821082108213821081E08000800003E8802883EF820883EF80000 -C5C0:000000081E0821082108213821081E08000800000F8800880F8808140FA20000 -C5C1:000000081E0821082108213821081E08000800003EF802803EF820803EF80000 -C5C2:000000081E0821082108213821081E08000800003EFC02483E4820483EFC0000 -C5C3:000000081E0821082108213821081E08000800003E1002FE3E3820443E380000 -C5C4:000000081E0821082108213821081E080008000003F802080208020803F80000 -C5C5:000000081E0821082108213821081E08000800000208020803F8020803F80000 -C5C6:000000081E0821082108213821081E0800080000210821083F0821143F620000 -C5C7:000000081E0821082108213821081E0800080000001000100010006801840000 -C5C8:000000081E0821082108213821081E08000800000048004800A8011406620000 -C5C9:000000081E0821082108213821081E0800080000000003F00408040803F00000 -C5CA:000000081E0821082108213821081E080008000003F80020002000D003080000 -C5CB:000000081E0821082108213821081E0800080000004003F8004000A003180000 -C5CC:000000081E0821082108213821081E080008000003F8000803F8000800080000 -C5CD:000000081E0821082108213821081E080008000003F8020003F8020003F80000 -C5CE:000000081E0821082108213821081E080008000000000FF8022002200FF80000 -C5CF:000000081E0821082108213821081E080008000000800FF803E0041003E00000 -C5D0:00000000000A000A1E0A210A408A40BA408A210A1E0A000A000A000A000A0000 -C5D1:000000281E282128212821E821281E280028000007F800080008000800080000 -C5D2:000000281E282128212821E821281E280028000000003EF80208020802080000 -C5D3:000000281E282128212821E821281E280028000000003E100210022802C40000 -C5D4:000000281E282128212821E821281E280028000008000800080008000FF80000 -C5D5:000000281E282128212821E821281E2800280000000020F8201020303ECC0000 -C5D6:000000281E282128212821E821281E2800280000202021FC207020883E700000 -C5D7:000000281E282128212821E821281E280028000003F802000200020003F80000 -C5D8:000000281E282128212821E821281E280028000007F8000807F8040007F80000 -C5D9:000000281E282128212821E821281E28002800003EF802083E0820083E080000 -C5DA:000000281E282128212821E821281E28002800003EF802883E8820883EF80000 -C5DB:000000281E282128212821E821281E28002800003E8802883EF820883EF80000 -C5DC:000000281E282128212821E821281E28002800001F0801081F0810141F620000 -C5DD:000000281E282128212821E821281E28002800003EF802803EF820803EF80000 -C5DE:000000281E282128212821E821281E28002800003EFC02483E4820483EFC0000 -C5DF:000000281E282128212821E821281E28002800003E1002FE3E3820443E380000 -C5E0:000000281E282128212821E821281E280028000003F802080208020803F80000 -C5E1:000000281E282128212821E821281E28002800000208020803F8020803F80000 -C5E2:000000281E282128212821E821281E2800280000110811081F0811141F620000 -C5E3:000000281E282128212821E821281E2800280000000800080008003400C20000 -C5E4:000000281E282128212821E821281E28002800000048004800A8011406620000 -C5E5:000000281E282128212821E821281E2800280000000001F00208020801F00000 -C5E6:000000281E282128212821E821281E280028000003F80020002000D003080000 -C5E7:000000281E282128212821E821281E2800280000004003F8004000A003180000 -C5E8:000000281E282128212821E821281E280028000003F8000803F8000800080000 -C5E9:000000281E282128212821E821281E280028000003F8020003F8020003F80000 -C5EA:000000281E282128212821E821281E280028000000000FF8022002200FF80000 -C5EB:000000281E282128212821E821281E280028000000800FF803E0041003E00000 -C5EC:00000000000200021E022102409E40824082211E1E0200020002000200020000 -C5ED:000000081E0821082138210821381E0800080000000007F80008000800080000 -C5EE:000000081E0821082138210821381E080008000000003EF80208020802080000 -C5EF:000000081E0821082138210821381E080008000000001F080108011401620000 -C5F0:000000081E0821082138210821381E080008000800001000100010001FF80000 -C5F1:000000081E0821082138210821381E0800080000000020F8201020303ECC0000 -C5F2:000000081E0821082138210821381E0800080000202021FC207020883E700000 -C5F3:000000081E0821082138210821381E080008000003F802000200020003F80000 -C5F4:000000081E0821082138210821381E080008000007F8000807F8040007F80000 -C5F5:000000081E0821082138210821381E08000800003EF802083E0820083E080000 -C5F6:000000081E0821082138210821381E08000800003EF802883E8820883EF80000 -C5F7:000000081E0821082138210821381E08000800003E8802883EF820883EF80000 -C5F8:000000081E0821082138210821381E08000800000F8800880F8808140FA20000 -C5F9:000000081E0821082138210821381E08000800003EF802803EF820803EF80000 -C5FA:000000081E0821082138210821381E08000800003EFC02483E4820483EFC0000 -C5FB:000000081E0821082138210821381E08000800003E1002FE3E3820443E380000 -C5FC:000000081E0821082138210821381E080008000003F802080208020803F80000 -C5FD:000000081E0821082138210821381E08000800000208020803F8020803F80000 -C5FE:000000081E0821082138210821381E0800080000210821083F0821143F620000 -C5FF:000000081E0821082138210821381E0800080000001000100010006801840000 -C600:000000081E0821082138210821381E08000800000048004800A8011406620000 -C601:000000081E0821082138210821381E0800080000000003F00408040803F00000 -C602:000000081E0821082138210821381E080008000003F80020002000D003080000 -C603:000000081E0821082138210821381E0800080000004003F8004000A003180000 -C604:000000081E0821082138210821381E080008000003F8000803F8000800080000 -C605:000000081E0821082138210821381E080008000003F8020003F8020003F80000 -C606:000000081E0821082138210821381E080008000000000FF8022002200FF80000 -C607:000000081E0821082138210821381E080008000000800FF803E0041003E00000 -C608:00000000000A000A1E0A210A40BA408A408A213A1E0A000A000A000A000A0000 -C609:000000281E28212821E8212821E81E280028000007F800080008000800080000 -C60A:000000281E28212821E8212821E81E280028000000003EF80208020802080000 -C60B:000000281E28212821E8212821E81E280028000000003E100210022802C40000 -C60C:000000281E28212821E8212821E81E280028002808000800080008000FF80000 -C60D:000000281E28212821E8212821E81E2800280000000020F8201020303ECC0000 -C60E:000000281E28212821E8212821E81E2800280000202021FC207020883E700000 -C60F:000000281E28212821E8212821E81E280028000003F802000200020003F80000 -C610:000000281E28212821E8212821E81E280028000007F8000807F8040007F80000 -C611:000000281E28212821E8212821E81E28002800003EF802083E0820083E080000 -C612:000000281E28212821E8212821E81E28002800003EF802883E8820883EF80000 -C613:000000281E28212821E8212821E81E28002800003E8802883EF820883EF80000 -C614:000000281E28212821E8212821E81E28002800001F0801081F0810141F620000 -C615:000000281E28212821E8212821E81E28002800003EF802803EF820803EF80000 -C616:000000281E28212821E8212821E81E28002800003EFC02483E4820483EFC0000 -C617:000000281E28212821E8212821E81E28002800003E1002FE3E3820443E380000 -C618:000000281E28212821E8212821E81E280028000003F802080208020803F80000 -C619:000000281E28212821E8212821E81E28002800000208020803F8020803F80000 -C61A:000000281E28212821E8212821E81E2800280000110811081F0811141F620000 -C61B:000000281E28212821E8212821E81E2800280000000800080008003400C20000 -C61C:000000281E28212821E8212821E81E28002800000048004800A8011406620000 -C61D:000000281E28212821E8212821E81E2800280000000001F00208020801F00000 -C61E:000000281E28212821E8212821E81E280028000003F80020002000D003080000 -C61F:000000281E28212821E8212821E81E2800280000004003F8004000A003180000 -C620:000000281E28212821E8212821E81E280028000003F8000803F8000800080000 -C621:000000281E28212821E8212821E81E280028000003F8020003F8020003F80000 -C622:000000281E28212821E8212821E81E280028000000000FF8022002200FF80000 -C623:000000281E28212821E8212821E81E280028000000800FF803E0041003E00000 -C624:000007C00820101010101010082007C0000000000100010001007FFC00000000 -C625:000007C008200820082007C0010001007FFC00001FF000100010001000100000 -C626:000007C008200820082007C0010001007FFC000000003EF80208020802080000 -C627:000007C008200820082007C0010001007FFC000000001E100210022802C40000 -C628:000007C008200820082007C0010001007FFC000000001000100010001FF00000 -C629:000007C008200820082007C0010001007FFC0000000020F8201020303ECC0000 -C62A:000007C008200820082007C0010001007FFC0000202021FC207020883E700000 -C62B:000007C008200820082007C0010001007FFC00001FF01000100010001FF00000 -C62C:000007C008200820082007C0010001007FFC00001FF000101FF010001FF00000 -C62D:000007C008200820082007C0010001007FFC00003EF802083E0820083E080000 -C62E:000007C008200820082007C0010001007FFC00003EF802883E8820883EF80000 -C62F:000007C008200820082007C0010001007FFC00003E8802883EF820883EF80000 -C630:000007C008200820082007C0010001007FFC00003E1002103E1020283EC40000 -C631:000007C008200820082007C0010001007FFC00003EF802803EF820803EF80000 -C632:000007C008200820082007C0010001007FFC00003EFC02483E4820483EFC0000 -C633:000007C008200820082007C0010001007FFC00003E2003FC3E7020883E700000 -C634:000007C008200820082007C0010001007FFC00001FF01010101010101FF00000 -C635:000007C008200820082007C0010001007FFC0000101010101FF010101FF00000 -C636:000007C008200820082007C0010001007FFC0000222022203E2022503E880000 -C637:000007C008200820082007C0010001007FFC000000000100010002800C400000 -C638:000007C008200820082007C0010001007FFC00000000024002400DA033100000 -C639:000007C008200820082007C0010001007FFC0000000007C00820082007C00000 -C63A:000007C008200820082007C0010001007FFC0000000007E00080014006200000 -C63B:000007C008200820082007C0010001007FFC0000008007E00080014006200000 -C63C:000007C008200820082007C0010001007FFC00001FF000101FF0001000100000 -C63D:000007C008200820082007C0010001007FFC00001FF010001FF010001FF00000 -C63E:000007C008200820082007C0010001007FFC000000001FF0044004401FF00000 -C63F:000007C008200820082007C0010001007FFC000001001FF007C0082007C00000 -C640:0000001000101F10209040504050405E20901F10041004107FD0001000100000 -C641:000000081F082088208E20881F0804087FE8000007F800080008000800080000 -C642:000000081F082088208E20881F0804087FE8000000003EF80208020802080000 -C643:000000081F082088208E20881F0804087FE8000000001F080108011401620000 -C644:000000081F082088208E20881F0804087FE8000008000800080008000FF80000 -C645:000000081F082088208E20881F0804087FE80000000010F8101010301ECC0000 -C646:000000081F082088208E20881F0804087FE800000808087F081C08220F9C0000 -C647:000000081F082088208E20881F0804087FE8000003F802000200020003F80000 -C648:000000081F082088208E20881F0804087FE8000007F8000807F8040007F80000 -C649:000000081F082088208E20881F0804087FE800003EF802083E0820083E080000 -C64A:000000081F082088208E20881F0804087FE800003EF802883E8820883EF80000 -C64B:000000081F082088208E20881F0804087FE800003E8802883EF820883EF80000 -C64C:000000081F082088208E20881F0804087FE800001F0801081F0810141F620000 -C64D:000000081F082088208E20881F0804087FE800003EF802803EF820803EF80000 -C64E:000000081F082088208E20881F0804087FE800003EFC02483E4820483EFC0000 -C64F:000000081F082088208E20881F0804087FE800001F08017F1F1C10221F1C0000 -C650:000000081F082088208E20881F0804087FE8000003F802080208020803F80000 -C651:000000081F082088208E20881F0804087FE800000208020803F8020803F80000 -C652:000000081F082088208E20881F0804087FE80000110811081F0811141F620000 -C653:000000081F082088208E20881F0804087FE80000001000100010006801840000 -C654:000000081F082088208E20881F0804087FE800000048004800A8011406620000 -C655:000000081F082088208E20881F0804087FE80000000003F00408040803F00000 -C656:000000081F082088208E20881F0804087FE8000003F80020002000D003080000 -C657:000000081F082088208E20881F0804087FE80000004003F8004000A003180000 -C658:000000081F082088208E20881F0804087FE8000003F8000803F8000800080000 -C659:000000081F082088208E20881F0804087FE8000003F8020003F8020003F80000 -C65A:000000081F082088208E20881F0804087FE8000000000FF8022002200FF80000 -C65B:000000081F082088208E20881F0804087FE8000000800FF803E0041003E00000 -C65C:0000001200121F12209240524052405E20921F12041204127FD2001200120000 -C65D:000000281F2820A820B820A81F2804287FA8000007F800080008000800080000 -C65E:000000281F2820A820B820A81F2804287FA8000000003EF80208020802080000 -C65F:000000281F2820A820B820A81F2804287FA8000000001F080108011401620000 -C660:000000281F2820A820B820A81F2804287FA8000008000800080008000FF80000 -C661:000000281F2820A820B820A81F2804287FA80000000010F8101010301ECC0000 -C662:000000281F2820A820B820A81F2804287FA800000808087F081C08220F9C0000 -C663:000000281F2820A820B820A81F2804287FA8000003F802000200020003F80000 -C664:000000281F2820A820B820A81F2804287FA8000007F8000807F8040007F80000 -C665:000000281F2820A820B820A81F2804287FA800003EF802083E0820083E080000 -C666:000000281F2820A820B820A81F2804287FA800003EF802883E8820883EF80000 -C667:000000281F2820A820B820A81F2804287FA800003E8802883EF820883EF80000 -C668:000000281F2820A820B820A81F2804287FA800001F0801081F0810141F620000 -C669:000000281F2820A820B820A81F2804287FA800003EF802803EF820803EF80000 -C66A:000000281F2820A820B820A81F2804287FA800003EFC02483E4820483EFC0000 -C66B:000000281F2820A820B820A81F2804287FA800001F08017F1F1C10221F1C0000 -C66C:000000281F2820A820B820A81F2804287FA8000003F802080208020803F80000 -C66D:000000281F2820A820B820A81F2804287FA800000208020803F8020803F80000 -C66E:000000281F2820A820B820A81F2804287FA80000110811081F0811141F620000 -C66F:000000281F2820A820B820A81F2804287FA80000001000100010006801840000 -C670:000000281F2820A820B820A81F2804287FA800000048004800A8011406620000 -C671:000000281F2820A820B820A81F2804287FA80000000003F00408040803F00000 -C672:000000281F2820A820B820A81F2804287FA8000003F80020002000D003080000 -C673:000000281F2820A820B820A81F2804287FA80000004003F8004000A003180000 -C674:000000281F2820A820B820A81F2804287FA8000003F8000803F8000800080000 -C675:000000281F2820A820B820A81F2804287FA8000003F8020003F8020003F80000 -C676:000000281F2820A820B820A81F2804287FA8000000000FF8022002200FF80000 -C677:000000281F2820A820B820A81F2804287FA8000000800FF803E0041003E00000 -C678:0000000800081F08208840484048404820881F08040804087FE8000800080000 -C679:000000081F082088208820881F0804087FE8000007F800080008000800080000 -C67A:000000081F082088208820881F0804087FE8000000003EF80208020802080000 -C67B:000000081F082088208820881F0804087FE8000000001F080108011401620000 -C67C:000000081F082088208820881F0804087FE8000008000800080008000FF80000 -C67D:000000081F082088208820881F0804087FE80000000010F8101010301ECC0000 -C67E:000000081F082088208820881F0804087FE800000808087F081C08220F9C0000 -C67F:000000081F082088208820881F0804087FE8000003F802000200020003F80000 -C680:000000081F082088208820881F0804087FE8000007F8000807F8040007F80000 -C681:000000081F082088208820881F0804087FE800003EF802083E0820083E080000 -C682:000000081F082088208820881F0804087FE800003EF802883E8820883EF80000 -C683:000000081F082088208820881F0804087FE800003E8802883EF820883EF80000 -C684:000000081F082088208820881F0804087FE800001F0801081F0810141F620000 -C685:000000081F082088208820881F0804087FE800003EF802803EF820803EF80000 -C686:000000081F082088208820881F0804087FE800003EFC02483E4820483EFC0000 -C687:000000081F082088208820881F0804087FE800001F08017F1F1C10221F1C0000 -C688:000000081F082088208820881F0804087FE8000003F802080208020803F80000 -C689:000000081F082088208820881F0804087FE800000208020803F8020803F80000 -C68A:000000081F082088208820881F0804087FE80000110811081F0811141F620000 -C68B:000000081F082088208820881F0804087FE80000001000100010006801840000 -C68C:000000081F082088208820881F0804087FE800000048004800A8011406620000 -C68D:000000081F082088208820881F0804087FE80000000003F00408040803F00000 -C68E:000000081F082088208820881F0804087FE8000003F80020002000D003080000 -C68F:000000081F082088208820881F0804087FE80000004003F8004000A003180000 -C690:000000081F082088208820881F0804087FE8000003F8000803F8000800080000 -C691:000000081F082088208820881F0804087FE8000003F8020003F8020003F80000 -C692:000000081F082088208820881F0804087FE8000000000FF8022002200FF80000 -C693:000000081F082088208820881F0804087FE8000000800FF803E0041003E00000 -C694:000007C00820101010101010082007C0000004400440044004407FFC00000000 -C695:000007C008200820082007C0044004407FFC00001FF000100010001000100000 -C696:000007C008200820082007C0044004407FFC000000003EF80208020802080000 -C697:000007C008200820082007C0044004407FFC000000001E100210022802C40000 -C698:000007C008200820082007C0044004407FFC000000001000100010001FF00000 -C699:000007C008200820082007C0044004407FFC0000000020F8201020303ECC0000 -C69A:000007C008200820082007C0044004407FFC0000202021FC207020883E700000 -C69B:000007C008200820082007C0044004407FFC00001FF01000100010001FF00000 -C69C:000007C008200820082007C0044004407FFC00001FF000101FF010001FF00000 -C69D:000007C008200820082007C0044004407FFC00003EF802083E0820083E080000 -C69E:000007C008200820082007C0044004407FFC00003EF802883E8820883EF80000 -C69F:000007C008200820082007C0044004407FFC00003E8802883EF820883EF80000 -C6A0:000007C008200820082007C0044004407FFC00003E1002103E1020283EC40000 -C6A1:000007C008200820082007C0044004407FFC00003EF802803EF820803EF80000 -C6A2:000007C008200820082007C0044004407FFC00003EFC02483E4820483EFC0000 -C6A3:000007C008200820082007C0044004407FFC00003E2003FC3E7020883E700000 -C6A4:000007C008200820082007C0044004407FFC00001FF01010101010101FF00000 -C6A5:000007C008200820082007C0044004407FFC0000101010101FF010101FF00000 -C6A6:000007C008200820082007C0044004407FFC0000222022203E2022503E880000 -C6A7:000007C008200820082007C0044004407FFC000000000100010002800C400000 -C6A8:000007C008200820082007C0044004407FFC00000000024002400DA033100000 -C6A9:000007C008200820082007C0044004407FFC0000000007C00820082007C00000 -C6AA:000007C008200820082007C0044004407FFC0000000007E00080014006200000 -C6AB:000007C008200820082007C0044004407FFC0000008007E00080014006200000 -C6AC:000007C008200820082007C0044004407FFC00001FF000101FF0001000100000 -C6AD:000007C008200820082007C0044004407FFC00001FF010001FF010001FF00000 -C6AE:000007C008200820082007C0044004407FFC000000001FF0044004401FF00000 -C6AF:000007C008200820082007C0044004407FFC000001001FF007C0082007C00000 -C6B0:0000000007C00820101010101010082007C000003FF801000100010001000000 -C6B1:000007C008200820082007C000007FFC010001001FF000100010001000100000 -C6B2:000007C008200820082007C000007FFC0100010000003EF80208020802080000 -C6B3:000007C008200820082007C000007FFC0100010000001E100210022802C40000 -C6B4:000007C008200820082007C0000000007FFC010001001100100010001FF00000 -C6B5:000007C008200820082007C000007FFC01000100000020F8201020303ECC0000 -C6B6:000007C008200820082007C000007FFC01000100202021FC207020883E700000 -C6B7:000007C008200820082007C000007FFC010001001FF01000100010001FF00000 -C6B8:000007C008200820082007C000007FFC010001001FF000101FF010001FF00000 -C6B9:000007C008200820082007C000007FFC010001003EF802083E0820083E080000 -C6BA:000007C008200820082007C000007FFC010001003EF802883E8820883EF80000 -C6BB:000007C008200820082007C000007FFC010001003E8802883EF820883EF80000 -C6BC:000007C008200820082007C000007FFC010001003E1002103E1020283EC40000 -C6BD:000007C008200820082007C000007FFC010001003EF802803EF820803EF80000 -C6BE:000007C008200820082007C000007FFC010001003EFC02483E4820483EFC0000 -C6BF:000007C008200820082007C000007FFC010001003E2003FC3E7020883E700000 -C6C0:000007C008200820082007C000007FFC010001001FF01010101010101FF00000 -C6C1:000007C008200820082007C000007FFC01000100101010101FF010101FF00000 -C6C2:000007C008200820082007C000007FFC01000100222022203E2022503E880000 -C6C3:000007C008200820082007C000007FFC0100010000000100010002800C400000 -C6C4:000007C008200820082007C000007FFC010001000000024002400DA033100000 -C6C5:000007C008200820082007C000007FFC01000100000007C00820082007C00000 -C6C6:000007C008200820082007C000007FFC01000100000007E00080014006200000 -C6C7:000007C008200820082007C000007FFC01000100008007E00080014006200000 -C6C8:000007C008200820082007C000007FFC010001001FF000101FF0001000100000 -C6C9:000007C008200820082007C000007FFC010001001FF010001FF010001FF00000 -C6CA:000007C008200820082007C000007FFC0100010000001FF0044004401FF00000 -C6CB:000007C008200820082007C000007FFC0100010001001FF007C0082007C00000 -C6CC:000000081F08208840484048404820881F0800087FE8040804F8040804080000 -C6CD:1F082088208820881F0800087FE8027802080000000007F80008000800080000 -C6CE:1F082088208820881F0800087FE802780208000000003EF80208020802080000 -C6CF:1F082088208820881F0800087FE802780208000000001F080108011401620000 -C6D0:1F082088208820881F08000800087FE80278020802081000100010001FF80000 -C6D1:1F082088208820881F0800087FE8027802080000000020F8201020303ECC0000 -C6D2:1F082088208820881F0800087FE8027802080000202021FC207020883E700000 -C6D3:1F082088208820881F0800087FE802780208000003F802000200020003F80000 -C6D4:1F082088208820881F0800087FE802780208000007F8000807F8040007F80000 -C6D5:1F082088208820881F0800087FE80278020800003EF802083E0820083E080000 -C6D6:1F082088208820881F0800087FE80278020800003EF802883E8820883EF80000 -C6D7:1F082088208820881F0800087FE80278020800003E8802883EF820883EF80000 -C6D8:1F082088208820881F0800087FE80278020800000F8800880F8808140FA20000 -C6D9:1F082088208820881F0800087FE80278020800003EF802803EF820803EF80000 -C6DA:1F082088208820881F0800087FE80278020800003EFC02483E4820483EFC0000 -C6DB:1F082088208820881F0800087FE80278020800003E1002FE3E3820443E380000 -C6DC:1F082088208820881F0800087FE802780208000003F802080208020803F80000 -C6DD:1F082088208820881F0800087FE80278020800000208020803F8020803F80000 -C6DE:1F082088208820881F0800087FE8027802080000210821083F0821143F620000 -C6DF:1F082088208820881F0800087FE8027802080000001000100010006801840000 -C6E0:1F082088208820881F0800087FE80278020800000048004800A8011406620000 -C6E1:1F082088208820881F0800087FE8027802080000000003F00408040803F00000 -C6E2:1F082088208820881F0800087FE802780208000003F80020002000D003080000 -C6E3:1F082088208820881F0800087FE8027802080000004003F8004000A003180000 -C6E4:1F082088208820881F0800087FE802780208000003F8000803F8000800080000 -C6E5:1F082088208820881F0800087FE802780208000003F8020003F8020003F80000 -C6E6:1F082088208820881F0800087FE802780208000000000FF8022002200FF80000 -C6E7:1F082088208820881F0800087FE802780208000000800FF803E0041003E00000 -C6E8:0000000A1F0A208A404A404A404A208A1F0A000A7FEA040A047A040A040A0000 -C6E9:1F2820A820A820A81F2800287FA805E804280000000007F80008000800080000 -C6EA:1F2820A820A820A81F2800287FA805E80428000000003EF80208020802080000 -C6EB:1F2820A820A820A81F2800287FA805E80428000000001F080108011401620000 -C6EC:1F2820A820A820A81F28002800287FA8042805E804281428100010001FF80000 -C6ED:1F2820A820A820A81F2800287FA805E804280000000020F8201020303ECC0000 -C6EE:1F2820A820A820A81F2800287FA805E804280000202021FC207020883E700000 -C6EF:1F2820A820A820A81F2800287FA805E80428000003F802000200020003F80000 -C6F0:1F2820A820A820A81F2800287FA805E80428000007F8000807F8040007F80000 -C6F1:1F2820A820A820A81F2800287FA805E8042800003EF802083E0820083E080000 -C6F2:1F2820A820A820A81F2800287FA805E8042800003EF802883E8820883EF80000 -C6F3:1F2820A820A820A81F2800287FA805E8042800003E8802883EF820883EF80000 -C6F4:1F2820A820A820A81F2800287FA805E8042800000F8800880F8808140FA20000 -C6F5:1F2820A820A820A81F2800287FA805E8042800003EF802803EF820803EF80000 -C6F6:1F2820A820A820A81F2800287FA805E8042800003EFC02483E4820483EFC0000 -C6F7:1F2820A820A820A81F2800287FA805E8042800003E1002FE3E3820443E380000 -C6F8:1F2820A820A820A81F2800287FA805E80428000003F802080208020803F80000 -C6F9:1F2820A820A820A81F2800287FA805E8042800000208020803F8020803F80000 -C6FA:1F2820A820A820A81F2800287FA805E804280000210821083F0821143F620000 -C6FB:1F2820A820A820A81F2800287FA805E804280000001000100010006801840000 -C6FC:1F2820A820A820A81F2800287FA805E8042800000048004800A8011406620000 -C6FD:1F2820A820A820A81F2800287FA805E804280000000003F00408040803F00000 -C6FE:1F2820A820A820A81F2800287FA805E80428000003F80020002000D003080000 -C6FF:1F2820A820A820A81F2800287FA805E804280000004003F8004000A003180000 -C700:1F2820A820A820A81F2800287FA805E80428000003F8000803F8000800080000 -C701:1F2820A820A820A81F2800287FA805E80428000003F8020003F8020003F80000 -C702:1F2820A820A820A81F2800287FA805E80428000000000FF8022002200FF80000 -C703:1F2820A820A820A81F2800287FA805E80428000000800FF803E0041003E00000 -C704:000000081F08208840484048404820881F0800087FE804080408040804080000 -C705:1F082088208820881F0800087FE8020802000000000007F80008000800080000 -C706:1F082088208820881F0800087FE802080200000000003EF80208020802080000 -C707:1F082088208820881F0800087FE802080200000000001F080108011401620000 -C708:1F082088208820881F08000800087FE80208020802081008100010001FF80000 -C709:1F082088208820881F0800087FE8020802000000000020F8201020303ECC0000 -C70A:1F082088208820881F0800087FE8020802000000202021FC207020883E700000 -C70B:1F082088208820881F0800087FE802080200000003F802000200020003F80000 -C70C:1F082088208820881F0800087FE802080200000007F8000807F8040007F80000 -C70D:1F082088208820881F0800087FE80208020000003EF802083E0820083E080000 -C70E:1F082088208820881F0800087FE80208020000003EF802883E8820883EF80000 -C70F:1F082088208820881F0800087FE80208020000003E8802883EF820883EF80000 -C710:1F082088208820881F0800087FE80208020000000F8800880F8808140FA20000 -C711:1F082088208820881F0800087FE80208020000003EF802803EF820803EF80000 -C712:1F082088208820881F0800087FE80208020000003EFC02483E4820483EFC0000 -C713:1F082088208820881F0800087FE80208020000003E1002FE3E3820443E380000 -C714:1F082088208820881F0800087FE802080200000003F802080208020803F80000 -C715:1F082088208820881F0800087FE80208020000000208020803F8020803F80000 -C716:1F082088208820881F0800087FE8020802000000210821083F0821143F620000 -C717:1F082088208820881F0800087FE8020802000000001000100010006801840000 -C718:1F082088208820881F0800087FE80208020000000048004800A8011406620000 -C719:1F082088208820881F0800087FE8020802000000000003F00408040803F00000 -C71A:1F082088208820881F0800087FE802080200000003F80020002000D003080000 -C71B:1F082088208820881F0800087FE8020802000000004003F8004000A003180000 -C71C:1F082088208820881F0800087FE802080200000003F8000803F8000800080000 -C71D:1F082088208820881F0800087FE802080200000003F8020003F8020003F80000 -C71E:1F082088208820881F0800087FE802080200000000000FF8022002200FF80000 -C71F:1F082088208820881F0800087FE802080200000000800FF803E0041003E00000 -C720:0000000007C00820101010101010082007C000007FFC04400440044004400000 -C721:000007C008200820082007C000007FFC044004401FF000100010001000100000 -C722:000007C008200820082007C000007FFC0440044000003EF80208020802080000 -C723:000007C008200820082007C000007FFC0440044000001E100210022802C40000 -C724:000007C008200820082007C0000000007FFC044004401440100010001FF00000 -C725:000007C008200820082007C000007FFC04400440000020F8201020303ECC0000 -C726:000007C008200820082007C000007FFC04400440202021FC207020883E700000 -C727:000007C008200820082007C000007FFC044004401FF01000100010001FF00000 -C728:000007C008200820082007C000007FFC044004401FF000101FF010001FF00000 -C729:000007C008200820082007C000007FFC044004403EF802083E0820083E080000 -C72A:000007C008200820082007C000007FFC044004403EF802883E8820883EF80000 -C72B:000007C008200820082007C000007FFC044004403E8802883EF820883EF80000 -C72C:000007C008200820082007C000007FFC044004403E1002103E1020283EC40000 -C72D:000007C008200820082007C000007FFC044004403EF802803EF820803EF80000 -C72E:000007C008200820082007C000007FFC044004403EFC02483E4820483EFC0000 -C72F:000007C008200820082007C000007FFC044004403E2003FC3E7020883E700000 -C730:000007C008200820082007C000007FFC044004401FF01010101010101FF00000 -C731:000007C008200820082007C000007FFC04400440101010101FF010101FF00000 -C732:000007C008200820082007C000007FFC04400440222022203E2022503E880000 -C733:000007C008200820082007C000007FFC0440044000000100010002800C400000 -C734:000007C008200820082007C000007FFC044004400000024002400DA033100000 -C735:000007C008200820082007C000007FFC04400440000007C00820082007C00000 -C736:000007C008200820082007C000007FFC04400440000007E00080014006200000 -C737:000007C008200820082007C000007FFC04400440008007E00080014006200000 -C738:000007C008200820082007C000007FFC044004401FF000101FF0001000100000 -C739:000007C008200820082007C000007FFC044004401FF010001FF010001FF00000 -C73A:000007C008200820082007C000007FFC0440044000001FF0044004401FF00000 -C73B:000007C008200820082007C000007FFC0440044001001FF007C0082007C00000 -C73C:000007C00820101010101010082007C00000000000007FFC0000000000000000 -C73D:000007C008200820082007C0000000007FFC00001FF000100010001000100000 -C73E:000007C008200820082007C0000000007FFC000000003EF80208020802080000 -C73F:000007C008200820082007C0000000007FFC000000001E100210022802C40000 -C740:000007C008200820082007C0000000007FFC000000001000100010001FF00000 -C741:000007C008200820082007C0000000007FFC0000000020F8201020303ECC0000 -C742:000007C008200820082007C0000000007FFC0000202021FC207020883E700000 -C743:000007C008200820082007C0000000007FFC00001FF01000100010001FF00000 -C744:000007C008200820082007C0000000007FFC00001FF000101FF010001FF00000 -C745:000007C008200820082007C0000000007FFC00003EF802083E0820083E080000 -C746:000007C008200820082007C0000000007FFC00003EF802883E8820883EF80000 -C747:000007C008200820082007C0000000007FFC00003E8802883EF820883EF80000 -C748:000007C008200820082007C0000000007FFC00003E1002103E1020283EC40000 -C749:000007C008200820082007C0000000007FFC00003EF802803EF820803EF80000 -C74A:000007C008200820082007C0000000007FFC00003EFC02483E4820483EFC0000 -C74B:000007C008200820082007C0000000007FFC00003E2003FC3E7020883E700000 -C74C:000007C008200820082007C0000000007FFC00001FF01010101010101FF00000 -C74D:000007C008200820082007C0000000007FFC0000101010101FF010101FF00000 -C74E:000007C008200820082007C0000000007FFC0000222022203E2022503E880000 -C74F:000007C008200820082007C0000000007FFC000000000100010002800C400000 -C750:000007C008200820082007C0000000007FFC00000000024002400DA033100000 -C751:000007C008200820082007C0000000007FFC0000000007C00820082007C00000 -C752:000007C008200820082007C0000000007FFC0000000007E00080014006200000 -C753:000007C008200820082007C0000000007FFC0000008007E00080014006200000 -C754:000007C008200820082007C0000000007FFC00001FF000101FF0001000100000 -C755:000007C008200820082007C0000000007FFC00001FF010001FF010001FF00000 -C756:000007C008200820082007C0000000007FFC000000001FF0044004401FF00000 -C757:000007C008200820082007C0000000007FFC000001001FF007C0082007C00000 -C758:0000000800081F08208840484048404820881F0800087FE80008000800080000 -C759:000000081F082088208820881F0800087FE8000007F800080008000800080000 -C75A:000000081F082088208820881F0800087FE8000000003EF80208020802080000 -C75B:000000081F082088208820881F0800087FE8000000001F080108011401620000 -C75C:000000081F082088208820881F0800087FE8000008000800080008000FF80000 -C75D:000000081F082088208820881F0800087FE80000000010F8101010301ECC0000 -C75E:000000081F082088208820881F0800087FE800000808087F081C08220F9C0000 -C75F:000000081F082088208820881F0800087FE8000003F802000200020003F80000 -C760:000000081F082088208820881F0800087FE8000007F8000807F8040007F80000 -C761:000000081F082088208820881F0800087FE800003EF802083E0820083E080000 -C762:000000081F082088208820881F0800087FE800003EF802883E8820883EF80000 -C763:000000081F082088208820881F0800087FE800003E8802883EF820883EF80000 -C764:000000081F082088208820881F0800087FE800001F0801081F0810141F620000 -C765:000000081F082088208820881F0800087FE800003EF802803EF820803EF80000 -C766:000000081F082088208820881F0800087FE800003EFC02483E4820483EFC0000 -C767:000000081F082088208820881F0800087FE800001F08017F1F1C10221F1C0000 -C768:000000081F082088208820881F0800087FE8000003F802080208020803F80000 -C769:000000081F082088208820881F0800087FE800000208020803F8020803F80000 -C76A:000000081F082088208820881F0800087FE80000110811081F0811141F620000 -C76B:000000081F082088208820881F0800087FE80000001000100010006801840000 -C76C:000000081F082088208820881F0800087FE800000048004800A8011406620000 -C76D:000000081F082088208820881F0800087FE80000000003F00408040803F00000 -C76E:000000081F082088208820881F0800087FE8000003F80020002000D003080000 -C76F:000000081F082088208820881F0800087FE80000004003F8004000A003180000 -C770:000000081F082088208820881F0800087FE8000003F8000803F8000800080000 -C771:000000081F082088208820881F0800087FE8000003F8020003F8020003F80000 -C772:000000081F082088208820881F0800087FE8000000000FF8022002200FF80000 -C773:000000081F082088208820881F0800087FE8000000800FF803E0041003E00000 -C774:00000000000800081E08210840884088408821081E0800080008000800080000 -C775:000000081E0821082108210821081E0800080000000007F80008000800080000 -C776:000000081E0821082108210821081E080008000000003EF80208020802080000 -C777:000000081E0821082108210821081E080008000000001F080108011401620000 -C778:000000081E0821082108210821081E080008000800001000100010001FF80000 -C779:000000081E0821082108210821081E0800080000000020F8201020303ECC0000 -C77A:000000081E0821082108210821081E0800080000202021FC207020883E700000 -C77B:000000081E0821082108210821081E080008000003F802000200020003F80000 -C77C:000000081E0821082108210821081E080008000007F8000807F8040007F80000 -C77D:000000081E0821082108210821081E08000800003EF802083E0820083E080000 -C77E:000000081E0821082108210821081E08000800003EF802883E8820883EF80000 -C77F:000000081E0821082108210821081E08000800003E8802883EF820883EF80000 -C780:000000081E0821082108210821081E08000800000F8800880F8808140FA20000 -C781:000000081E0821082108210821081E08000800003EF802803EF820803EF80000 -C782:000000081E0821082108210821081E08000800003EFC02483E4820483EFC0000 -C783:000000081E0821082108210821081E08000800003E1002FE3E3820443E380000 -C784:000000081E0821082108210821081E080008000003F802080208020803F80000 -C785:000000081E0821082108210821081E08000800000208020803F8020803F80000 -C786:000000081E0821082108210821081E0800080000210821083F0821143F620000 -C787:000000081E0821082108210821081E0800080000001000100010006801840000 -C788:000000081E0821082108210821081E08000800000048004800A8011406620000 -C789:000000081E0821082108210821081E0800080000000003F00408040803F00000 -C78A:000000081E0821082108210821081E080008000003F80020002000D003080000 -C78B:000000081E0821082108210821081E0800080000004003F8004000A003180000 -C78C:000000081E0821082108210821081E080008000003F8000803F8000800080000 -C78D:000000081E0821082108210821081E080008000003F8020003F8020003F80000 -C78E:000000081E0821082108210821081E080008000000000FF8022002200FF80000 -C78F:000000081E0821082108210821081E080008000000800FF803E0041003E00000 -C790:00000000001000103F9001100110021E06100910309000100010001000100000 -C791:0000000800087E080408040E1A0861080008000007F800080008000800080000 -C792:0000000800087E080408040E1A0861080008000000003EF80208020802080000 -C793:0000000800087E080408040E1A0861080008000000001F080108011401620000 -C794:0000000800087E080408040E1A0861080008000808000800080008000FF80000 -C795:0000000800087E080408040E1A08610800080000000010F8101010301ECC0000 -C796:0000000800087E080408040E1A086108000800000808087F081C08220F9C0000 -C797:0000000800087E080408040E1A0861080008000003F802000200020003F80000 -C798:0000000800087E080408040E1A0861080008000007F8000807F8040007F80000 -C799:0000000800087E080408040E1A086108000800003EF802083E0820083E080000 -C79A:0000000800087E080408040E1A086108000800003EF802883E8820883EF80000 -C79B:0000000800087E080408040E1A086108000800003E8802883EF820883EF80000 -C79C:0000000800087E080408040E1A086108000800001F0801081F0810141F620000 -C79D:0000000800087E080408040E1A086108000800003EF802803EF820803EF80000 -C79E:0000000800087E080408040E1A086108000800003EFC02483E4820483EFC0000 -C79F:0000000800087E080408040E1A086108000800001F08017F1F1C10221F1C0000 -C7A0:0000000800087E080408040E1A0861080008000003F802080208020803F80000 -C7A1:0000000800087E080408040E1A086108000800000208020803F8020803F80000 -C7A2:0000000800087E080408040E1A08610800080000110811081F0811141F620000 -C7A3:0000000800087E080408040E1A08610800080000001000100010006801840000 -C7A4:0000000800087E080408040E1A086108000800000048004800A8011406620000 -C7A5:0000000800087E080408040E1A08610800080000000003F00408040803F00000 -C7A6:0000000800087E080408040E1A0861080008000003F80020002000D003080000 -C7A7:0000000800087E080408040E1A08610800080000004003F8004000A003180000 -C7A8:0000000800087E080408040E1A0861080008000003F8000803F8000800080000 -C7A9:0000000800087E080408040E1A0861080008000003F8020003F8020003F80000 -C7AA:0000000800087E080408040E1A0861080008000000000FF8022002200FF80000 -C7AB:0000000800087E080408040E1A0861080008000000800FF803E0041003E00000 -C7AC:00000000001200123F9201120112021E06120912309200120012001200120000 -C7AD:0000002800287E28042804381A2861280028000007F800080008000800080000 -C7AE:0000002800287E28042804381A2861280028000000003EF80208020802080000 -C7AF:0000002800287E28042804381A2861280028000000003E100210022802C40000 -C7B0:0000002800287E28042804381A2861280028002808000800080008000FF80000 -C7B1:0000002800287E28042804381A28612800280000000020F8201020303ECC0000 -C7B2:0000002800287E28042804381A28612800280000202021FC207020883E700000 -C7B3:0000002800287E28042804381A2861280028000003F802000200020003F80000 -C7B4:0000002800287E28042804381A2861280028000007F8000807F8040007F80000 -C7B5:0000002800287E28042804381A286128002800003EF802083E0820083E080000 -C7B6:0000002800287E28042804381A286128002800003EF802883E8820883EF80000 -C7B7:0000002800287E28042804381A286128002800003E8802883EF820883EF80000 -C7B8:0000002800287E28042804381A286128002800001F0801081F0810141F620000 -C7B9:0000002800287E28042804381A286128002800003EF802803EF820803EF80000 -C7BA:0000002800287E28042804381A286128002800003EFC02483E4820483EFC0000 -C7BB:0000002800287E28042804381A286128002800003E1002FE3E3820443E380000 -C7BC:0000002800287E28042804381A2861280028000003F802080208020803F80000 -C7BD:0000002800287E28042804381A286128002800000208020803F8020803F80000 -C7BE:0000002800287E28042804381A28612800280000110811081F0811141F620000 -C7BF:0000002800287E28042804381A28612800280000000800080008003400C20000 -C7C0:0000002800287E28042804381A286128002800000048004800A8011406620000 -C7C1:0000002800287E28042804381A28612800280000000001F00208020801F00000 -C7C2:0000002800287E28042804381A2861280028000003F80020002000D003080000 -C7C3:0000002800287E28042804381A28612800280000004003F8004000A003180000 -C7C4:0000002800287E28042804381A2861280028000003F8000803F8000800080000 -C7C5:0000002800287E28042804381A2861280028000003F8020003F8020003F80000 -C7C6:0000002800287E28042804381A2861280028000000000FF8022002200FF80000 -C7C7:0000002800287E28042804381A2861280028000000800FF803E0041003E00000 -C7C8:00000000001000103F900110011E02100610091E309000100010001000100000 -C7C9:0000000800087E08040E04081A0E61080008000007F800080008000800080000 -C7CA:0000000800087E08040E04081A0E61080008000000003EF80208020802080000 -C7CB:0000000800087E08040E04081A0E61080008000000001F080108011401620000 -C7CC:0000000800087E08040E04081A0E61080008000008000800080008000FF80000 -C7CD:0000000800087E08040E04081A0E610800080000000010F8101010301ECC0000 -C7CE:0000000800087E08040E04081A0E6108000800000808087F081C08220F9C0000 -C7CF:0000000800087E08040E04081A0E61080008000003F802000200020003F80000 -C7D0:0000000800087E08040E04081A0E61080008000007F8000807F8040007F80000 -C7D1:0000000800087E08040E04081A0E6108000800003EF802083E0820083E080000 -C7D2:0000000800087E08040E04081A0E6108000800003EF802883E8820883EF80000 -C7D3:0000000800087E08040E04081A0E6108000800003E8802883EF820883EF80000 -C7D4:0000000800087E08040E04081A0E6108000800001F0801081F0810141F620000 -C7D5:0000000800087E08040E04081A0E6108000800003EF802803EF820803EF80000 -C7D6:0000000800087E08040E04081A0E6108000800003EFC02483E4820483EFC0000 -C7D7:0000000800087E08040E04081A0E6108000800001F08017F1F1C10221F1C0000 -C7D8:0000000800087E08040E04081A0E61080008000003F802080208020803F80000 -C7D9:0000000800087E08040E04081A0E6108000800000208020803F8020803F80000 -C7DA:0000000800087E08040E04081A0E610800080000110811081F0811141F620000 -C7DB:0000000800087E08040E04081A0E610800080000001000100010006801840000 -C7DC:0000000800087E08040E04081A0E6108000800000048004800A8011406620000 -C7DD:0000000800087E08040E04081A0E610800080000000003F00408040803F00000 -C7DE:0000000800087E08040E04081A0E61080008000003F80020002000D003080000 -C7DF:0000000800087E08040E04081A0E610800080000004003F8004000A003180000 -C7E0:0000000800087E08040E04081A0E61080008000003F8000803F8000800080000 -C7E1:0000000800087E08040E04081A0E61080008000003F8020003F8020003F80000 -C7E2:0000000800087E08040E04081A0E61080008000000000FF8022002200FF80000 -C7E3:0000000800087E08040E04081A0E61080008000000800FF803E0041003E00000 -C7E4:00000000001200123F920112011E02120612091E309200120012001200120000 -C7E5:0000002800287E28043804281A3861280028000007F800080008000800080000 -C7E6:0000002800287E28043804281A3861280028000000003EF80208020802080000 -C7E7:0000002800287E28043804281A3861280028000000003E100210022802C40000 -C7E8:0000002800287E28043804281A3861280028002808000800080008000FF80000 -C7E9:0000002800287E28043804281A38612800280000000020F8201020303ECC0000 -C7EA:0000002800287E28043804281A38612800280000202021FC207020883E700000 -C7EB:0000002800287E28043804281A3861280028000003F802000200020003F80000 -C7EC:0000002800287E28043804281A3861280028000007F8000807F8040007F80000 -C7ED:0000002800287E28043804281A386128002800003EF802083E0820083E080000 -C7EE:0000002800287E28043804281A386128002800003EF802883E8820883EF80000 -C7EF:0000002800287E28043804281A386128002800003E8802883EF820883EF80000 -C7F0:0000002800287E28043804281A386128002800001F0801081F0810141F620000 -C7F1:0000002800287E28043804281A386128002800003EF802803EF820803EF80000 -C7F2:0000002800287E28043804281A386128002800003EFC02483E4820483EFC0000 -C7F3:0000002800287E28043804281A386128002800003E1002FE3E3820443E380000 -C7F4:0000002800287E28043804281A3861280028000003F802080208020803F80000 -C7F5:0000002800287E28043804281A386128002800000208020803F8020803F80000 -C7F6:0000002800287E28043804281A38612800280000110811081F0811141F620000 -C7F7:0000002800287E28043804281A38612800280000000800080008003400C20000 -C7F8:0000002800287E28043804281A386128002800000048004800A8011406620000 -C7F9:0000002800287E28043804281A38612800280000000001F00208020801F00000 -C7FA:0000002800287E28043804281A3861280028000003F80020002000D003080000 -C7FB:0000002800287E28043804281A38612800280000004003F8004000A003180000 -C7FC:0000002800287E28043804281A3861280028000003F8000803F8000800080000 -C7FD:0000002800287E28043804281A3861280028000003F8020003F8020003F80000 -C7FE:0000002800287E28043804281A3861280028000000000FF8022002200FF80000 -C7FF:0000002800287E28043804281A3861280028000000800FF803E0041003E00000 -C800:00000000000200023F8201020102021E06020902308200020002000200020000 -C801:0000000800087E08040804381A08610800080000000007F80008000800080000 -C802:0000000800087E08040804381A0861080008000000003EF80208020802080000 -C803:0000000800087E08040804381A0861080008000000001F080108011401620000 -C804:0000000800087E08040804381A0861080008000000001000100010001FF80000 -C805:0000000800087E08040804381A08610800080000000020F8201020303ECC0000 -C806:0000000800087E08040804381A08610800080000202021FC207020883E700000 -C807:0000000800087E08040804381A0861080008000003F802000200020003F80000 -C808:0000000800087E08040804381A0861080008000007F8000807F8040007F80000 -C809:0000000800087E08040804381A086108000800003EF802083E0820083E080000 -C80A:0000000800087E08040804381A086108000800003EF802883E8820883EF80000 -C80B:0000000800087E08040804381A086108000800003E8802883EF820883EF80000 -C80C:0000000800087E08040804381A086108000800000F8800880F8808140FA20000 -C80D:0000000800087E08040804381A086108000800003EF802803EF820803EF80000 -C80E:0000000800087E08040804381A086108000800003EFC02483E4820483EFC0000 -C80F:0000000800087E08040804381A086108000800003E1002FE3E3820443E380000 -C810:0000000800087E08040804381A0861080008000003F802080208020803F80000 -C811:0000000800087E08040804381A086108000800000208020803F8020803F80000 -C812:0000000800087E08040804381A08610800080000210821083F0821143F620000 -C813:0000000800087E08040804381A08610800080000001000100010006801840000 -C814:0000000800087E08040804381A086108000800000048004800A8011406620000 -C815:0000000800087E08040804381A08610800080000000003F00408040803F00000 -C816:0000000800087E08040804381A0861080008000003F80020002000D003080000 -C817:0000000800087E08040804381A08610800080000004003F8004000A003180000 -C818:0000000800087E08040804381A0861080008000003F8000803F8000800080000 -C819:0000000800087E08040804381A0861080008000003F8020003F8020003F80000 -C81A:0000000800087E08040804381A0861080008000000000FF8022002200FF80000 -C81B:0000000800087E08040804381A0861080008000000800FF803E0041003E00000 -C81C:00000000000A000A3F8A010A010A023A060A090A308A000A000A000A000A0000 -C81D:0000002800287E28042804E81A2861280028000007F800080008000800080000 -C81E:0000002800287E28042804E81A2861280028000000003EF80208020802080000 -C81F:0000002800287E28042804E81A2861280028000000003E100210022802C40000 -C820:0000002800287E28042804E81A2861280028000008000800080008000FF80000 -C821:0000002800287E28042804E81A28612800280000000020F8201020303ECC0000 -C822:0000002800287E28042804E81A28612800280000202021FC207020883E700000 -C823:0000002800287E28042804E81A2861280028000003F802000200020003F80000 -C824:0000002800287E28042804E81A2861280028000007F8000807F8040007F80000 -C825:0000002800287E28042804E81A286128002800003EF802083E0820083E080000 -C826:0000002800287E28042804E81A286128002800003EF802883E8820883EF80000 -C827:0000002800287E28042804E81A286128002800003E8802883EF820883EF80000 -C828:0000002800287E28042804E81A286128002800001F0801081F0810141F620000 -C829:0000002800287E28042804E81A286128002800003EF802803EF820803EF80000 -C82A:0000002800287E28042804E81A286128002800003EFC02483E4820483EFC0000 -C82B:0000002800287E28042804E81A286128002800003E1002FE3E3820443E380000 -C82C:0000002800287E28042804E81A2861280028000003F802080208020803F80000 -C82D:0000002800287E28042804E81A286128002800000208020803F8020803F80000 -C82E:0000002800287E28042804E81A28612800280000110811081F0811141F620000 -C82F:0000002800287E28042804E81A28612800280000000800080008003400C20000 -C830:0000002800287E28042804E81A286128002800000048004800A8011406620000 -C831:0000002800287E28042804E81A28612800280000000001F00208020801F00000 -C832:0000002800287E28042804E81A2861280028000003F80020002000D003080000 -C833:0000002800287E28042804E81A28612800280000004003F8004000A003180000 -C834:0000002800287E28042804E81A2861280028000003F8000803F8000800080000 -C835:0000002800287E28042804E81A2861280028000003F8020003F8020003F80000 -C836:0000002800287E28042804E81A2861280028000000000FF8022002200FF80000 -C837:0000002800287E28042804E81A2861280028000000800FF803E0041003E00000 -C838:00000000000200023F820102011E02020602091E308200020002000200020000 -C839:0000000800087E08043804081A38610800080000000007F80008000800080000 -C83A:0000000800087E08043804081A3861080008000000003EF80208020802080000 -C83B:0000000800087E08043804081A3861080008000000001F080108011401620000 -C83C:0000000800087E08043804081A3861080008000800001000100010001FF80000 -C83D:0000000800087E08043804081A38610800080000000020F8201020303ECC0000 -C83E:0000000800087E08043804081A38610800080000202021FC207020883E700000 -C83F:0000000800087E08043804081A3861080008000003F802000200020003F80000 -C840:0000000800087E08043804081A3861080008000007F8000807F8040007F80000 -C841:0000000800087E08043804081A386108000800003EF802083E0820083E080000 -C842:0000000800087E08043804081A386108000800003EF802883E8820883EF80000 -C843:0000000800087E08043804081A386108000800003E8802883EF820883EF80000 -C844:0000000800087E08043804081A386108000800000F8800880F8808140FA20000 -C845:0000000800087E08043804081A386108000800003EF802803EF820803EF80000 -C846:0000000800087E08043804081A386108000800003EFC02483E4820483EFC0000 -C847:0000000800087E08043804081A386108000800003E1002FE3E3820443E380000 -C848:0000000800087E08043804081A3861080008000003F802080208020803F80000 -C849:0000000800087E08043804081A386108000800000208020803F8020803F80000 -C84A:0000000800087E08043804081A38610800080000210821083F0821143F620000 -C84B:0000000800087E08043804081A38610800080000001000100010006801840000 -C84C:0000000800087E08043804081A386108000800000048004800A8011406620000 -C84D:0000000800087E08043804081A38610800080000000003F00408040803F00000 -C84E:0000000800087E08043804081A3861080008000003F80020002000D003080000 -C84F:0000000800087E08043804081A38610800080000004003F8004000A003180000 -C850:0000000800087E08043804081A3861080008000003F8000803F8000800080000 -C851:0000000800087E08043804081A3861080008000003F8020003F8020003F80000 -C852:0000000800087E08043804081A3861080008000000000FF8022002200FF80000 -C853:0000000800087E08043804081A3861080008000000800FF803E0041003E00000 -C854:00000000000A000A3F8A010A013A020A060A093A308A000A000A000A000A0000 -C855:0000002800287E2804E804281AE861280028000007F800080008000800080000 -C856:0000002800287E2804E804281AE861280028000000003EF80208020802080000 -C857:0000002800287E2804E804281AE861280028000000003E100210022802C40000 -C858:0000002800287E2804E804281AE861280028002808000800080008000FF80000 -C859:0000002800287E2804E804281AE8612800280000000020F8201020303ECC0000 -C85A:0000002800287E2804E804281AE8612800280000202021FC207020883E700000 -C85B:0000002800287E2804E804281AE861280028000003F802000200020003F80000 -C85C:0000002800287E2804E804281AE861280028000007F8000807F8040007F80000 -C85D:0000002800287E2804E804281AE86128002800003EF802083E0820083E080000 -C85E:0000002800287E2804E804281AE86128002800003EF802883E8820883EF80000 -C85F:0000002800287E2804E804281AE86128002800003E8802883EF820883EF80000 -C860:0000002800287E2804E804281AE86128002800001F0801081F0810141F620000 -C861:0000002800287E2804E804281AE86128002800003EF802803EF820803EF80000 -C862:0000002800287E2804E804281AE86128002800003EFC02483E4820483EFC0000 -C863:0000002800287E2804E804281AE86128002800003E1002FE3E3820443E380000 -C864:0000002800287E2804E804281AE861280028000003F802080208020803F80000 -C865:0000002800287E2804E804281AE86128002800000208020803F8020803F80000 -C866:0000002800287E2804E804281AE8612800280000110811081F0811141F620000 -C867:0000002800287E2804E804281AE8612800280000000800080008003400C20000 -C868:0000002800287E2804E804281AE86128002800000048004800A8011406620000 -C869:0000002800287E2804E804281AE8612800280000000001F00208020801F00000 -C86A:0000002800287E2804E804281AE861280028000003F80020002000D003080000 -C86B:0000002800287E2804E804281AE8612800280000004003F8004000A003180000 -C86C:0000002800287E2804E804281AE861280028000003F8000803F8000800080000 -C86D:0000002800287E2804E804281AE861280028000003F8020003F8020003F80000 -C86E:0000002800287E2804E804281AE861280028000000000FF8022002200FF80000 -C86F:0000002800287E2804E804281AE861280028000000800FF803E0041003E00000 -C870:000000000FE0004000400080018002400C2000000100010001007FFC00000000 -C871:00000FC0008003400C200000010001007FFC00001FF000100010001000100000 -C872:00000FC0008003400C200000010001007FFC000000003EF80208020802080000 -C873:00000FC0008003400C200000010001007FFC000000001E100210022802C40000 -C874:00000FC0008003400C200000010001007FFC000000001000100010001FF00000 -C875:00000FC0008003400C200000010001007FFC0000000020F8201020303ECC0000 -C876:00000FC0008003400C200000010001007FFC0000202021FC207020883E700000 -C877:00000FC0008003400C200000010001007FFC00001FF01000100010001FF00000 -C878:00000FC0008003400C200000010001007FFC00001FF000101FF010001FF00000 -C879:00000FC0008003400C200000010001007FFC00003EF802083E0820083E080000 -C87A:00000FC0008003400C200000010001007FFC00003EF802883E8820883EF80000 -C87B:00000FC0008003400C200000010001007FFC00003E8802883EF820883EF80000 -C87C:00000FC0008003400C200000010001007FFC00003E1002103E1020283EC40000 -C87D:00000FC0008003400C200000010001007FFC00003EF802803EF820803EF80000 -C87E:00000FC0008003400C200000010001007FFC00003EFC02483E4820483EFC0000 -C87F:00000FC0008003400C200000010001007FFC00003E2003FC3E7020883E700000 -C880:00000FC0008003400C200000010001007FFC00001FF01010101010101FF00000 -C881:00000FC0008003400C200000010001007FFC0000101010101FF010101FF00000 -C882:00000FC0008003400C200000010001007FFC0000222022203E2022503E880000 -C883:00000FC0008003400C200000010001007FFC000000000100010002800C400000 -C884:00000FC0008003400C200000010001007FFC00000000024002400DA033100000 -C885:00000FC0008003400C200000010001007FFC0000000007C00820082007C00000 -C886:00000FC0008003400C200000010001007FFC0000000007E00080014006200000 -C887:00000FC0008003400C200000010001007FFC0000008007E00080014006200000 -C888:00000FC0008003400C200000010001007FFC00001FF000101FF0001000100000 -C889:00000FC0008003400C200000010001007FFC00001FF010001FF010001FF00000 -C88A:00000FC0008003400C200000010001007FFC000000001FF0044004401FF00000 -C88B:00000FC0008003400C200000010001007FFC000001001FF007C0082007C00000 -C88C:0000001000103F90011001100210061E09103090041004107FD0001000100000 -C88D:000000083F0802080D0E3088040804087FE8000007F800080008000800080000 -C88E:000000083F0802080D0E3088040804087FE8000000003EF80208020802080000 -C88F:000000083F0802080D0E3088040804087FE8000000001F080108011401620000 -C890:000000083F0802080D0E3088040804087FE8000008000800080008000FF80000 -C891:000000083F0802080D0E3088040804087FE80000000010F8101010301ECC0000 -C892:000000083F0802080D0E3088040804087FE800000808087F081C08220F9C0000 -C893:000000083F0802080D0E3088040804087FE8000003F802000200020003F80000 -C894:000000083F0802080D0E3088040804087FE8000007F8000807F8040007F80000 -C895:000000083F0802080D0E3088040804087FE800003EF802083E0820083E080000 -C896:000000083F0802080D0E3088040804087FE800003EF802883E8820883EF80000 -C897:000000083F0802080D0E3088040804087FE800003E8802883EF820883EF80000 -C898:000000083F0802080D0E3088040804087FE800001F0801081F0810141F620000 -C899:000000083F0802080D0E3088040804087FE800003EF802803EF820803EF80000 -C89A:000000083F0802080D0E3088040804087FE800003EFC02483E4820483EFC0000 -C89B:000000083F0802080D0E3088040804087FE800001F08017F1F1C10221F1C0000 -C89C:000000083F0802080D0E3088040804087FE8000003F802080208020803F80000 -C89D:000000083F0802080D0E3088040804087FE800000208020803F8020803F80000 -C89E:000000083F0802080D0E3088040804087FE80000110811081F0811141F620000 -C89F:000000083F0802080D0E3088040804087FE80000001000100010006801840000 -C8A0:000000083F0802080D0E3088040804087FE800000048004800A8011406620000 -C8A1:000000083F0802080D0E3088040804087FE80000000003F00408040803F00000 -C8A2:000000083F0802080D0E3088040804087FE8000003F80020002000D003080000 -C8A3:000000083F0802080D0E3088040804087FE80000004003F8004000A003180000 -C8A4:000000083F0802080D0E3088040804087FE8000003F8000803F8000800080000 -C8A5:000000083F0802080D0E3088040804087FE8000003F8020003F8020003F80000 -C8A6:000000083F0802080D0E3088040804087FE8000000000FF8022002200FF80000 -C8A7:000000083F0802080D0E3088040804087FE8000000800FF803E0041003E00000 -C8A8:0000001200123F92011201120212061E09123092041204127FD2001200120000 -C8A9:000000283F2802280D3830A8042804287FA8000007F800080008000800080000 -C8AA:000000283F2802280D3830A8042804287FA8000000003EF80208020802080000 -C8AB:000000283F2802280D3830A8042804287FA8000000001F080108011401620000 -C8AC:000000283F2802280D3830A8042804287FA8000008000800080008000FF80000 -C8AD:000000283F2802280D3830A8042804287FA80000000010F8101010301ECC0000 -C8AE:000000283F2802280D3830A8042804287FA800000808087F081C08220F9C0000 -C8AF:000000283F2802280D3830A8042804287FA8000003F802000200020003F80000 -C8B0:000000283F2802280D3830A8042804287FA8000007F8000807F8040007F80000 -C8B1:000000283F2802280D3830A8042804287FA800003EF802083E0820083E080000 -C8B2:000000283F2802280D3830A8042804287FA800003EF802883E8820883EF80000 -C8B3:000000283F2802280D3830A8042804287FA800003E8802883EF820883EF80000 -C8B4:000000283F2802280D3830A8042804287FA800001F0801081F0810141F620000 -C8B5:000000283F2802280D3830A8042804287FA800003EF802803EF820803EF80000 -C8B6:000000283F2802280D3830A8042804287FA800003EFC02483E4820483EFC0000 -C8B7:000000283F2802280D3830A8042804287FA800001F08017F1F1C10221F1C0000 -C8B8:000000283F2802280D3830A8042804287FA8000003F802080208020803F80000 -C8B9:000000283F2802280D3830A8042804287FA800000208020803F8020803F80000 -C8BA:000000283F2802280D3830A8042804287FA80000110811081F0811141F620000 -C8BB:000000283F2802280D3830A8042804287FA80000001000100010006801840000 -C8BC:000000283F2802280D3830A8042804287FA800000048004800A8011406620000 -C8BD:000000283F2802280D3830A8042804287FA80000000003F00408040803F00000 -C8BE:000000283F2802280D3830A8042804287FA8000003F80020002000D003080000 -C8BF:000000283F2802280D3830A8042804287FA80000004003F8004000A003180000 -C8C0:000000283F2802280D3830A8042804287FA8000003F8000803F8000800080000 -C8C1:000000283F2802280D3830A8042804287FA8000003F8020003F8020003F80000 -C8C2:000000283F2802280D3830A8042804287FA8000000000FF8022002200FF80000 -C8C3:000000283F2802280D3830A8042804287FA8000000800FF803E0041003E00000 -C8C4:0000000800083F88010801080208060809083088040804087FE8000800080000 -C8C5:000000083F0802080D083088040804087FE8000007F800080008000800080000 -C8C6:000000083F0802080D083088040804087FE8000000003EF80208020802080000 -C8C7:000000083F0802080D083088040804087FE8000000001F080108011401620000 -C8C8:000000083F0802080D083088040804087FE8000008000800080008000FF80000 -C8C9:000000083F0802080D083088040804087FE80000000010F8101010301ECC0000 -C8CA:000000083F0802080D083088040804087FE800000808087F081C08220F9C0000 -C8CB:000000083F0802080D083088040804087FE8000003F802000200020003F80000 -C8CC:000000083F0802080D083088040804087FE8000007F8000807F8040007F80000 -C8CD:000000083F0802080D083088040804087FE800003EF802083E0820083E080000 -C8CE:000000083F0802080D083088040804087FE800003EF802883E8820883EF80000 -C8CF:000000083F0802080D083088040804087FE800003E8802883EF820883EF80000 -C8D0:000000083F0802080D083088040804087FE800001F0801081F0810141F620000 -C8D1:000000083F0802080D083088040804087FE800003EF802803EF820803EF80000 -C8D2:000000083F0802080D083088040804087FE800003EFC02483E4820483EFC0000 -C8D3:000000083F0802080D083088040804087FE800001F08017F1F1C10221F1C0000 -C8D4:000000083F0802080D083088040804087FE8000003F802080208020803F80000 -C8D5:000000083F0802080D083088040804087FE800000208020803F8020803F80000 -C8D6:000000083F0802080D083088040804087FE80000110811081F0811141F620000 -C8D7:000000083F0802080D083088040804087FE80000001000100010006801840000 -C8D8:000000083F0802080D083088040804087FE800000048004800A8011406620000 -C8D9:000000083F0802080D083088040804087FE80000000003F00408040803F00000 -C8DA:000000083F0802080D083088040804087FE8000003F80020002000D003080000 -C8DB:000000083F0802080D083088040804087FE80000004003F8004000A003180000 -C8DC:000000083F0802080D083088040804087FE8000003F8000803F8000800080000 -C8DD:000000083F0802080D083088040804087FE8000003F8020003F8020003F80000 -C8DE:000000083F0802080D083088040804087FE8000000000FF8022002200FF80000 -C8DF:000000083F0802080D083088040804087FE8000000800FF803E0041003E00000 -C8E0:000000000FE0004000400080018002400C2004400440044004407FFC00000000 -C8E1:00000FC0008003400C200000044004407FFC00001FF000100010001000100000 -C8E2:00000FC0008003400C200000044004407FFC000000003EF80208020802080000 -C8E3:00000FC0008003400C200000044004407FFC000000001E100210022802C40000 -C8E4:00000FC0008003400C200000044004407FFC000000001000100010001FF00000 -C8E5:00000FC0008003400C200000044004407FFC0000000020F8201020303ECC0000 -C8E6:00000FC0008003400C200000044004407FFC0000202021FC207020883E700000 -C8E7:00000FC0008003400C200000044004407FFC00001FF01000100010001FF00000 -C8E8:00000FC0008003400C200000044004407FFC00001FF000101FF010001FF00000 -C8E9:00000FC0008003400C200000044004407FFC00003EF802083E0820083E080000 -C8EA:00000FC0008003400C200000044004407FFC00003EF802883E8820883EF80000 -C8EB:00000FC0008003400C200000044004407FFC00003E8802883EF820883EF80000 -C8EC:00000FC0008003400C200000044004407FFC00003E1002103E1020283EC40000 -C8ED:00000FC0008003400C200000044004407FFC00003EF802803EF820803EF80000 -C8EE:00000FC0008003400C200000044004407FFC00003EFC02483E4820483EFC0000 -C8EF:00000FC0008003400C200000044004407FFC00003E2003FC3E7020883E700000 -C8F0:00000FC0008003400C200000044004407FFC00001FF01010101010101FF00000 -C8F1:00000FC0008003400C200000044004407FFC0000101010101FF010101FF00000 -C8F2:00000FC0008003400C200000044004407FFC0000222022203E2022503E880000 -C8F3:00000FC0008003400C200000044004407FFC000000000100010002800C400000 -C8F4:00000FC0008003400C200000044004407FFC00000000024002400DA033100000 -C8F5:00000FC0008003400C200000044004407FFC0000000007C00820082007C00000 -C8F6:00000FC0008003400C200000044004407FFC0000000007E00080014006200000 -C8F7:00000FC0008003400C200000044004407FFC0000008007E00080014006200000 -C8F8:00000FC0008003400C200000044004407FFC00001FF000101FF0001000100000 -C8F9:00000FC0008003400C200000044004407FFC00001FF010001FF010001FF00000 -C8FA:00000FC0008003400C200000044004407FFC000000001FF0044004401FF00000 -C8FB:00000FC0008003400C200000044004407FFC000001001FF007C0082007C00000 -C8FC:000000000FE0004000400080018002400C2000003FF801000100010001000000 -C8FD:00000FC00080008003400C2000007FFC010001001FF000100010001000100000 -C8FE:00000FC00080008003400C2000007FFC0100010000003EF80208020802080000 -C8FF:00000FC00080008003400C2000007FFC0100010000001E100210022802C40000 -C900:00000FC00080008003400C20000000007FFC010001001100100010001FF00000 -C901:00000FC00080008003400C2000007FFC01000100000020F8201020303ECC0000 -C902:00000FC00080008003400C2000007FFC01000100202021FC207020883E700000 -C903:00000FC00080008003400C2000007FFC010001001FF01000100010001FF00000 -C904:00000FC00080008003400C2000007FFC010001001FF000101FF010001FF00000 -C905:00000FC00080008003400C2000007FFC010001003EF802083E0820083E080000 -C906:00000FC00080008003400C2000007FFC010001003EF802883E8820883EF80000 -C907:00000FC00080008003400C2000007FFC010001003E8802883EF820883EF80000 -C908:00000FC00080008003400C2000007FFC010001003E1002103E1020283EC40000 -C909:00000FC00080008003400C2000007FFC010001003EF802803EF820803EF80000 -C90A:00000FC00080008003400C2000007FFC010001003EFC02483E4820483EFC0000 -C90B:00000FC00080008003400C2000007FFC010001003E2003FC3E7020883E700000 -C90C:00000FC00080008003400C2000007FFC010001001FF01010101010101FF00000 -C90D:00000FC00080008003400C2000007FFC01000100101010101FF010101FF00000 -C90E:00000FC00080008003400C2000007FFC01000100222022203E2022503E880000 -C90F:00000FC00080008003400C2000007FFC0100010000000100010002800C400000 -C910:00000FC00080008003400C2000007FFC010001000000024002400DA033100000 -C911:00000FC00080008003400C2000007FFC01000100000007C00820082007C00000 -C912:00000FC00080008003400C2000007FFC01000100000007E00080014006200000 -C913:00000FC00080008003400C2000007FFC01000100008007E00080014006200000 -C914:00000FC00080008003400C2000007FFC010001001FF000101FF0001000100000 -C915:00000FC00080008003400C2000007FFC010001001FF010001FF010001FF00000 -C916:00000FC00080008003400C2000007FFC0100010000001FF0044004401FF00000 -C917:00000FC00080008003400C2000007FFC0100010001001FF007C0082007C00000 -C918:000000083F8801080108020806080908308800087FE8040804F8040804080000 -C919:3F08020802080D08308800087FE8027802080000000007F80008000800080000 -C91A:3F08020802080D08308800087FE802780208000000003EF80208020802080000 -C91B:3F08020802080D08308800087FE802780208000000001F080108011401620000 -C91C:3F08020802080D083088000800087FE80278020802081000100010001FF80000 -C91D:3F08020802080D08308800087FE8027802080000000020F8201020303ECC0000 -C91E:3F08020802080D08308800087FE8027802080000202021FC207020883E700000 -C91F:3F08020802080D08308800087FE802780208000003F802000200020003F80000 -C920:3F08020802080D08308800087FE802780208000007F8000807F8040007F80000 -C921:3F08020802080D08308800087FE80278020800003EF802083E0820083E080000 -C922:3F08020802080D08308800087FE80278020800003EF802883E8820883EF80000 -C923:3F08020802080D08308800087FE80278020800003E8802883EF820883EF80000 -C924:3F08020802080D08308800087FE80278020800000F8800880F8808140FA20000 -C925:3F08020802080D08308800087FE80278020800003EF802803EF820803EF80000 -C926:3F08020802080D08308800087FE80278020800003EFC02483E4820483EFC0000 -C927:3F08020802080D08308800087FE80278020800003E1002FE3E3820443E380000 -C928:3F08020802080D08308800087FE802780208000003F802080208020803F80000 -C929:3F08020802080D08308800087FE80278020800000208020803F8020803F80000 -C92A:3F08020802080D08308800087FE8027802080000210821083F0821143F620000 -C92B:3F08020802080D08308800087FE8027802080000001000100010006801840000 -C92C:3F08020802080D08308800087FE80278020800000048004800A8011406620000 -C92D:3F08020802080D08308800087FE8027802080000000003F00408040803F00000 -C92E:3F08020802080D08308800087FE802780208000003F80020002000D003080000 -C92F:3F08020802080D08308800087FE8027802080000004003F8004000A003180000 -C930:3F08020802080D08308800087FE802780208000003F8000803F8000800080000 -C931:3F08020802080D08308800087FE802780208000003F8020003F8020003F80000 -C932:3F08020802080D08308800087FE802780208000000000FF8022002200FF80000 -C933:3F08020802080D08308800087FE802780208000000800FF803E0041003E00000 -C934:0000000A3F8A010A010A020A060A090A308A000A7FEA040A047A040A040A0000 -C935:3F28022802280D2830A800287FA805E804280000000007F80008000800080000 -C936:3F28022802280D2830A800287FA805E80428000000003EF80208020802080000 -C937:3F28022802280D2830A800287FA805E80428000000001F080108011401620000 -C938:3F28022802280D2830A8002800287FA8042805E804281428100010001FF80000 -C939:3F28022802280D2830A800287FA805E804280000000020F8201020303ECC0000 -C93A:3F28022802280D2830A800287FA805E804280000202021FC207020883E700000 -C93B:3F28022802280D2830A800287FA805E80428000003F802000200020003F80000 -C93C:3F28022802280D2830A800287FA805E80428000007F8000807F8040007F80000 -C93D:3F28022802280D2830A800287FA805E8042800003EF802083E0820083E080000 -C93E:3F28022802280D2830A800287FA805E8042800003EF802883E8820883EF80000 -C93F:3F28022802280D2830A800287FA805E8042800003E8802883EF820883EF80000 -C940:3F28022802280D2830A800287FA805E8042800000F8800880F8808140FA20000 -C941:3F28022802280D2830A800287FA805E8042800003EF802803EF820803EF80000 -C942:3F28022802280D2830A800287FA805E8042800003EFC02483E4820483EFC0000 -C943:3F28022802280D2830A800287FA805E8042800003E1002FE3E3820443E380000 -C944:3F28022802280D2830A800287FA805E80428000003F802080208020803F80000 -C945:3F28022802280D2830A800287FA805E8042800000208020803F8020803F80000 -C946:3F28022802280D2830A800287FA805E804280000210821083F0821143F620000 -C947:3F28022802280D2830A800287FA805E804280000001000100010006801840000 -C948:3F28022802280D2830A800287FA805E8042800000048004800A8011406620000 -C949:3F28022802280D2830A800287FA805E804280000000003F00408040803F00000 -C94A:3F28022802280D2830A800287FA805E80428000003F80020002000D003080000 -C94B:3F28022802280D2830A800287FA805E804280000004003F8004000A003180000 -C94C:3F28022802280D2830A800287FA805E80428000003F8000803F8000800080000 -C94D:3F28022802280D2830A800287FA805E80428000003F8020003F8020003F80000 -C94E:3F28022802280D2830A800287FA805E80428000000000FF8022002200FF80000 -C94F:3F28022802280D2830A800287FA805E80428000000800FF803E0041003E00000 -C950:000000083F8801080108020806080908308800087FE804080408040804080000 -C951:3F08020802080D08308800087FE8020802000000000007F80008000800080000 -C952:3F08020802080D08308800087FE802080200000000003EF80208020802080000 -C953:3F08020802080D08308800087FE802080200000000001F080108011401620000 -C954:3F08020802080D083088000800087FE80208020802081008100010001FF80000 -C955:3F08020802080D08308800087FE8020802000000000020F8201020303ECC0000 -C956:3F08020802080D08308800087FE8020802000000202021FC207020883E700000 -C957:3F08020802080D08308800087FE802080200000003F802000200020003F80000 -C958:3F08020802080D08308800087FE802080200000007F8000807F8040007F80000 -C959:3F08020802080D08308800087FE80208020000003EF802083E0820083E080000 -C95A:3F08020802080D08308800087FE80208020000003EF802883E8820883EF80000 -C95B:3F08020802080D08308800087FE80208020000003E8802883EF820883EF80000 -C95C:3F08020802080D08308800087FE80208020000000F8800880F8808140FA20000 -C95D:3F08020802080D08308800087FE80208020000003EF802803EF820803EF80000 -C95E:3F08020802080D08308800087FE80208020000003EFC02483E4820483EFC0000 -C95F:3F08020802080D08308800087FE80208020000003E1002FE3E3820443E380000 -C960:3F08020802080D08308800087FE802080200000003F802080208020803F80000 -C961:3F08020802080D08308800087FE80208020000000208020803F8020803F80000 -C962:3F08020802080D08308800087FE8020802000000210821083F0821143F620000 -C963:3F08020802080D08308800087FE8020802000000001000100010006801840000 -C964:3F08020802080D08308800087FE80208020000000048004800A8011406620000 -C965:3F08020802080D08308800087FE8020802000000000003F00408040803F00000 -C966:3F08020802080D08308800087FE802080200000003F80020002000D003080000 -C967:3F08020802080D08308800087FE8020802000000004003F8004000A003180000 -C968:3F08020802080D08308800087FE802080200000003F8000803F8000800080000 -C969:3F08020802080D08308800087FE802080200000003F8020003F8020003F80000 -C96A:3F08020802080D08308800087FE802080200000000000FF8022002200FF80000 -C96B:3F08020802080D08308800087FE802080200000000800FF803E0041003E00000 -C96C:000000000FE0004000400080018002400C2000007FFC04400440044004400000 -C96D:00000FC00080008003400C2000007FFC044004401FF000100010001000100000 -C96E:00000FC00080008003400C2000007FFC0440044000003EF80208020802080000 -C96F:00000FC00080008003400C2000007FFC0440044000001E100210022802C40000 -C970:00000FC00080008003400C20000000007FFC044004401440100010001FF00000 -C971:00000FC00080008003400C2000007FFC04400440000020F8201020303ECC0000 -C972:00000FC00080008003400C2000007FFC04400440202021FC207020883E700000 -C973:00000FC00080008003400C2000007FFC044004401FF01000100010001FF00000 -C974:00000FC00080008003400C2000007FFC044004401FF000101FF010001FF00000 -C975:00000FC00080008003400C2000007FFC044004403EF802083E0820083E080000 -C976:00000FC00080008003400C2000007FFC044004403EF802883E8820883EF80000 -C977:00000FC00080008003400C2000007FFC044004403E8802883EF820883EF80000 -C978:00000FC00080008003400C2000007FFC044004403E1002103E1020283EC40000 -C979:00000FC00080008003400C2000007FFC044004403EF802803EF820803EF80000 -C97A:00000FC00080008003400C2000007FFC044004403EFC02483E4820483EFC0000 -C97B:00000FC00080008003400C2000007FFC044004403E2003FC3E7020883E700000 -C97C:00000FC00080008003400C2000007FFC044004401FF01010101010101FF00000 -C97D:00000FC00080008003400C2000007FFC04400440101010101FF010101FF00000 -C97E:00000FC00080008003400C2000007FFC04400440222022203E2022503E880000 -C97F:00000FC00080008003400C2000007FFC0440044000000100010002800C400000 -C980:00000FC00080008003400C2000007FFC044004400000024002400DA033100000 -C981:00000FC00080008003400C2000007FFC04400440000007C00820082007C00000 -C982:00000FC00080008003400C2000007FFC04400440000007E00080014006200000 -C983:00000FC00080008003400C2000007FFC04400440008007E00080014006200000 -C984:00000FC00080008003400C2000007FFC044004401FF000101FF0001000100000 -C985:00000FC00080008003400C2000007FFC044004401FF010001FF010001FF00000 -C986:00000FC00080008003400C2000007FFC0440044000001FF0044004401FF00000 -C987:00000FC00080008003400C2000007FFC0440044001001FF007C0082007C00000 -C988:000000000FE0004000400080018002400C20000000007FFC0000000000000000 -C989:00000FC0008003400C200000000000007FFC00001FF000100010001000100000 -C98A:00000FC0008003400C200000000000007FFC000000003EF80208020802080000 -C98B:00000FC0008003400C200000000000007FFC000000001E100210022802C40000 -C98C:00000FC0008003400C200000000000007FFC000000001000100010001FF00000 -C98D:00000FC0008003400C200000000000007FFC0000000020F8201020303ECC0000 -C98E:00000FC0008003400C200000000000007FFC0000202021FC207020883E700000 -C98F:00000FC0008003400C200000000000007FFC00001FF01000100010001FF00000 -C990:00000FC0008003400C200000000000007FFC00001FF000101FF010001FF00000 -C991:00000FC0008003400C200000000000007FFC00003EF802083E0820083E080000 -C992:00000FC0008003400C200000000000007FFC00003EF802883E8820883EF80000 -C993:00000FC0008003400C200000000000007FFC00003E8802883EF820883EF80000 -C994:00000FC0008003400C200000000000007FFC00003E1002103E1020283EC40000 -C995:00000FC0008003400C200000000000007FFC00003EF802803EF820803EF80000 -C996:00000FC0008003400C200000000000007FFC00003EFC02483E4820483EFC0000 -C997:00000FC0008003400C200000000000007FFC00003E2003FC3E7020883E700000 -C998:00000FC0008003400C200000000000007FFC00001FF01010101010101FF00000 -C999:00000FC0008003400C200000000000007FFC0000101010101FF010101FF00000 -C99A:00000FC0008003400C200000000000007FFC0000222022203E2022503E880000 -C99B:00000FC0008003400C200000000000007FFC000000000100010002800C400000 -C99C:00000FC0008003400C200000000000007FFC00000000024002400DA033100000 -C99D:00000FC0008003400C200000000000007FFC0000000007C00820082007C00000 -C99E:00000FC0008003400C200000000000007FFC0000000007E00080014006200000 -C99F:00000FC0008003400C200000000000007FFC0000008007E00080014006200000 -C9A0:00000FC0008003400C200000000000007FFC00001FF000101FF0001000100000 -C9A1:00000FC0008003400C200000000000007FFC00001FF010001FF010001FF00000 -C9A2:00000FC0008003400C200000000000007FFC000000001FF0044004401FF00000 -C9A3:00000FC0008003400C200000000000007FFC000001001FF007C0082007C00000 -C9A4:0000000800083F8801080108020806080908308800087FE80008000800080000 -C9A5:000000083F0802080D083088000800087FE8000007F800080008000800080000 -C9A6:000000083F0802080D083088000800087FE8000000003EF80208020802080000 -C9A7:000000083F0802080D083088000800087FE8000000001F080108011401620000 -C9A8:000000083F0802080D083088000800087FE8000008000800080008000FF80000 -C9A9:000000083F0802080D083088000800087FE80000000010F8101010301ECC0000 -C9AA:000000083F0802080D083088000800087FE800000808087F081C08220F9C0000 -C9AB:000000083F0802080D083088000800087FE8000003F802000200020003F80000 -C9AC:000000083F0802080D083088000800087FE8000007F8000807F8040007F80000 -C9AD:000000083F0802080D083088000800087FE800003EF802083E0820083E080000 -C9AE:000000083F0802080D083088000800087FE800003EF802883E8820883EF80000 -C9AF:000000083F0802080D083088000800087FE800003E8802883EF820883EF80000 -C9B0:000000083F0802080D083088000800087FE800001F0801081F0810141F620000 -C9B1:000000083F0802080D083088000800087FE800003EF802803EF820803EF80000 -C9B2:000000083F0802080D083088000800087FE800003EFC02483E4820483EFC0000 -C9B3:000000083F0802080D083088000800087FE800001F08017F1F1C10221F1C0000 -C9B4:000000083F0802080D083088000800087FE8000003F802080208020803F80000 -C9B5:000000083F0802080D083088000800087FE800000208020803F8020803F80000 -C9B6:000000083F0802080D083088000800087FE80000110811081F0811141F620000 -C9B7:000000083F0802080D083088000800087FE80000001000100010006801840000 -C9B8:000000083F0802080D083088000800087FE800000048004800A8011406620000 -C9B9:000000083F0802080D083088000800087FE80000000003F00408040803F00000 -C9BA:000000083F0802080D083088000800087FE8000003F80020002000D003080000 -C9BB:000000083F0802080D083088000800087FE80000004003F8004000A003180000 -C9BC:000000083F0802080D083088000800087FE8000003F8000803F8000800080000 -C9BD:000000083F0802080D083088000800087FE8000003F8020003F8020003F80000 -C9BE:000000083F0802080D083088000800087FE8000000000FF8022002200FF80000 -C9BF:000000083F0802080D083088000800087FE8000000800FF803E0041003E00000 -C9C0:00000000000800083F8801080108020806080908308800080008000800080000 -C9C1:0000000800087E08040804081A08610800080000000007F80008000800080000 -C9C2:0000000800087E08040804081A0861080008000000003EF80208020802080000 -C9C3:0000000800087E08040804081A0861080008000000001F080108011401620000 -C9C4:0000000800087E08040804081A0861080008000800001000100010001FF80000 -C9C5:0000000800087E08040804081A08610800080000000020F8201020303ECC0000 -C9C6:0000000800087E08040804081A08610800080000202021FC207020883E700000 -C9C7:0000000800087E08040804081A0861080008000003F802000200020003F80000 -C9C8:0000000800087E08040804081A0861080008000007F8000807F8040007F80000 -C9C9:0000000800087E08040804081A086108000800003EF802083E0820083E080000 -C9CA:0000000800087E08040804081A086108000800003EF802883E8820883EF80000 -C9CB:0000000800087E08040804081A086108000800003E8802883EF820883EF80000 -C9CC:0000000800087E08040804081A086108000800000F8800880F8808140FA20000 -C9CD:0000000800087E08040804081A086108000800003EF802803EF820803EF80000 -C9CE:0000000800087E08040804081A086108000800003EFC02483E4820483EFC0000 -C9CF:0000000800087E08040804081A086108000800003E1002FE3E3820443E380000 -C9D0:0000000800087E08040804081A0861080008000003F802080208020803F80000 -C9D1:0000000800087E08040804081A086108000800000208020803F8020803F80000 -C9D2:0000000800087E08040804081A08610800080000210821083F0821143F620000 -C9D3:0000000800087E08040804081A08610800080000001000100010006801840000 -C9D4:0000000800087E08040804081A086108000800000048004800A8011406620000 -C9D5:0000000800087E08040804081A08610800080000000003F00408040803F00000 -C9D6:0000000800087E08040804081A0861080008000003F80020002000D003080000 -C9D7:0000000800087E08040804081A08610800080000004003F8004000A003180000 -C9D8:0000000800087E08040804081A0861080008000003F8000803F8000800080000 -C9D9:0000000800087E08040804081A0861080008000003F8020003F8020003F80000 -C9DA:0000000800087E08040804081A0861080008000000000FF8022002200FF80000 -C9DB:0000000800087E08040804081A0861080008000000800FF803E0041003E00000 -C9DC:00000000001000107B9008900890191E15102290CC5000100010001000100000 -C9DD:00000008000877082208220E550888880008000007F800080008000800080000 -C9DE:00000008000877082208220E550888880008000000003EF80208020802080000 -C9DF:00000008000877082208220E550888880008000000001F080108011401620000 -C9E0:00000008000877082208220E550888880008000808000800080008000FF80000 -C9E1:00000008000877082208220E5508888800080000000010F8101010301ECC0000 -C9E2:00000008000877082208220E55088888000800000808087F081C08220F9C0000 -C9E3:00000008000877082208220E550888880008000003F802000200020003F80000 -C9E4:00000008000877082208220E550888880008000007F8000807F8040007F80000 -C9E5:00000008000877082208220E55088888000800003EF802083E0820083E080000 -C9E6:00000008000877082208220E55088888000800003EF802883E8820883EF80000 -C9E7:00000008000877082208220E55088888000800003E8802883EF820883EF80000 -C9E8:00000008000877082208220E55088888000800001F0801081F0810141F620000 -C9E9:00000008000877082208220E55088888000800003EF802803EF820803EF80000 -C9EA:00000008000877082208220E55088888000800003EFC02483E4820483EFC0000 -C9EB:00000008000877082208220E55088888000800001F08017F1F1C10221F1C0000 -C9EC:00000008000877082208220E550888880008000003F802080208020803F80000 -C9ED:00000008000877082208220E55088888000800000208020803F8020803F80000 -C9EE:00000008000877082208220E5508888800080000110811081F0811141F620000 -C9EF:00000008000877082208220E5508888800080000001000100010006801840000 -C9F0:00000008000877082208220E55088888000800000048004800A8011406620000 -C9F1:00000008000877082208220E5508888800080000000003F00408040803F00000 -C9F2:00000008000877082208220E550888880008000003F80020002000D003080000 -C9F3:00000008000877082208220E5508888800080000004003F8004000A003180000 -C9F4:00000008000877082208220E550888880008000003F8000803F8000800080000 -C9F5:00000008000877082208220E550888880008000003F8020003F8020003F80000 -C9F6:00000008000877082208220E550888880008000000000FF8022002200FF80000 -C9F7:00000008000877082208220E550888880008000000800FF803E0041003E00000 -C9F8:00000000001200127B9208920892191E15122292CC5200120012001200120000 -C9F9:000000280028772822282238552888A80028000007F800080008000800080000 -C9FA:000000280028772822282238552888A80028000000003EF80208020802080000 -C9FB:000000280028772822282238552888A80028000000003E100210022802C40000 -C9FC:000000280028772822282238552888A80028002808000800080008000FF80000 -C9FD:000000280028772822282238552888A800280000000020F8201020303ECC0000 -C9FE:000000280028772822282238552888A800280000202021FC207020883E700000 -C9FF:000000280028772822282238552888A80028000003F802000200020003F80000 -CA00:000000280028772822282238552888A80028000007F8000807F8040007F80000 -CA01:000000280028772822282238552888A8002800003EF802083E0820083E080000 -CA02:000000280028772822282238552888A8002800003EF802883E8820883EF80000 -CA03:000000280028772822282238552888A8002800003E8802883EF820883EF80000 -CA04:000000280028772822282238552888A8002800001F0801081F0810141F620000 -CA05:000000280028772822282238552888A8002800003EF802803EF820803EF80000 -CA06:000000280028772822282238552888A8002800003EFC02483E4820483EFC0000 -CA07:000000280028772822282238552888A8002800003E1002FE3E3820443E380000 -CA08:000000280028772822282238552888A80028000003F802080208020803F80000 -CA09:000000280028772822282238552888A8002800000208020803F8020803F80000 -CA0A:000000280028772822282238552888A800280000110811081F0811141F620000 -CA0B:000000280028772822282238552888A800280000000800080008003400C20000 -CA0C:000000280028772822282238552888A8002800000048004800A8011406620000 -CA0D:000000280028772822282238552888A800280000000001F00208020801F00000 -CA0E:000000280028772822282238552888A80028000003F80020002000D003080000 -CA0F:000000280028772822282238552888A800280000004003F8004000A003180000 -CA10:000000280028772822282238552888A80028000003F8000803F8000800080000 -CA11:000000280028772822282238552888A80028000003F8020003F8020003F80000 -CA12:000000280028772822282238552888A80028000000000FF8022002200FF80000 -CA13:000000280028772822282238552888A80028000000800FF803E0041003E00000 -CA14:00000000001000107B900890089E19101510229ECC5000100010001000100000 -CA15:0000000800087708220E2208550E88880008000007F800080008000800080000 -CA16:0000000800087708220E2208550E88880008000000003EF80208020802080000 -CA17:0000000800087708220E2208550E88880008000000001F080108011401620000 -CA18:0000000800087708220E2208550E88880008000008000800080008000FF80000 -CA19:0000000800087708220E2208550E888800080000000010F8101010301ECC0000 -CA1A:0000000800087708220E2208550E8888000800000808087F081C08220F9C0000 -CA1B:0000000800087708220E2208550E88880008000003F802000200020003F80000 -CA1C:0000000800087708220E2208550E88880008000007F8000807F8040007F80000 -CA1D:0000000800087708220E2208550E8888000800003EF802083E0820083E080000 -CA1E:0000000800087708220E2208550E8888000800003EF802883E8820883EF80000 -CA1F:0000000800087708220E2208550E8888000800003E8802883EF820883EF80000 -CA20:0000000800087708220E2208550E8888000800001F0801081F0810141F620000 -CA21:0000000800087708220E2208550E8888000800003EF802803EF820803EF80000 -CA22:0000000800087708220E2208550E8888000800003EFC02483E4820483EFC0000 -CA23:0000000800087708220E2208550E8888000800001F08017F1F1C10221F1C0000 -CA24:0000000800087708220E2208550E88880008000003F802080208020803F80000 -CA25:0000000800087708220E2208550E8888000800000208020803F8020803F80000 -CA26:0000000800087708220E2208550E888800080000110811081F0811141F620000 -CA27:0000000800087708220E2208550E888800080000001000100010006801840000 -CA28:0000000800087708220E2208550E8888000800000048004800A8011406620000 -CA29:0000000800087708220E2208550E888800080000000003F00408040803F00000 -CA2A:0000000800087708220E2208550E88880008000003F80020002000D003080000 -CA2B:0000000800087708220E2208550E888800080000004003F8004000A003180000 -CA2C:0000000800087708220E2208550E88880008000003F8000803F8000800080000 -CA2D:0000000800087708220E2208550E88880008000003F8020003F8020003F80000 -CA2E:0000000800087708220E2208550E88880008000000000FF8022002200FF80000 -CA2F:0000000800087708220E2208550E88880008000000800FF803E0041003E00000 -CA30:00000000001200127B920892089E19121512229ECC5200120012001200120000 -CA31:000000280028772822382228553888A80028000007F800080008000800080000 -CA32:000000280028772822382228553888A80028000000003EF80208020802080000 -CA33:000000280028772822382228553888A80028000000003E100210022802C40000 -CA34:000000280028772822382228553888A80028002808000800080008000FF80000 -CA35:000000280028772822382228553888A800280000000020F8201020303ECC0000 -CA36:000000280028772822382228553888A800280000202021FC207020883E700000 -CA37:000000280028772822382228553888A80028000003F802000200020003F80000 -CA38:000000280028772822382228553888A80028000007F8000807F8040007F80000 -CA39:000000280028772822382228553888A8002800003EF802083E0820083E080000 -CA3A:000000280028772822382228553888A8002800003EF802883E8820883EF80000 -CA3B:000000280028772822382228553888A8002800003E8802883EF820883EF80000 -CA3C:000000280028772822382228553888A8002800001F0801081F0810141F620000 -CA3D:000000280028772822382228553888A8002800003EF802803EF820803EF80000 -CA3E:000000280028772822382228553888A8002800003EFC02483E4820483EFC0000 -CA3F:000000280028772822382228553888A8002800003E1002FE3E3820443E380000 -CA40:000000280028772822382228553888A80028000003F802080208020803F80000 -CA41:000000280028772822382228553888A8002800000208020803F8020803F80000 -CA42:000000280028772822382228553888A800280000110811081F0811141F620000 -CA43:000000280028772822382228553888A800280000000800080008003400C20000 -CA44:000000280028772822382228553888A8002800000048004800A8011406620000 -CA45:000000280028772822382228553888A800280000000001F00208020801F00000 -CA46:000000280028772822382228553888A80028000003F80020002000D003080000 -CA47:000000280028772822382228553888A800280000004003F8004000A003180000 -CA48:000000280028772822382228553888A80028000003F8000803F8000800080000 -CA49:000000280028772822382228553888A80028000003F8020003F8020003F80000 -CA4A:000000280028772822382228553888A80028000000000FF8022002200FF80000 -CA4B:000000280028772822382228553888A80028000000800FF803E0041003E00000 -CA4C:00000000000200027B8208820882191E15022282CC4200020002000200020000 -CA4D:0000000800087708220822385508888800080000000007F80008000800080000 -CA4E:000000080008770822082238550888880008000000003EF80208020802080000 -CA4F:000000080008770822082238550888880008000000001F080108011401620000 -CA50:000000080008770822082238550888880008000000001000100010001FF80000 -CA51:0000000800087708220822385508888800080000000020F8201020303ECC0000 -CA52:0000000800087708220822385508888800080000202021FC207020883E700000 -CA53:000000080008770822082238550888880008000003F802000200020003F80000 -CA54:000000080008770822082238550888880008000007F8000807F8040007F80000 -CA55:00000008000877082208223855088888000800003EF802083E0820083E080000 -CA56:00000008000877082208223855088888000800003EF802883E8820883EF80000 -CA57:00000008000877082208223855088888000800003E8802883EF820883EF80000 -CA58:00000008000877082208223855088888000800000F8800880F8808140FA20000 -CA59:00000008000877082208223855088888000800003EF802803EF820803EF80000 -CA5A:00000008000877082208223855088888000800003EFC02483E4820483EFC0000 -CA5B:00000008000877082208223855088888000800003E1002FE3E3820443E380000 -CA5C:000000080008770822082238550888880008000003F802080208020803F80000 -CA5D:00000008000877082208223855088888000800000208020803F8020803F80000 -CA5E:0000000800087708220822385508888800080000210821083F0821143F620000 -CA5F:0000000800087708220822385508888800080000001000100010006801840000 -CA60:00000008000877082208223855088888000800000048004800A8011406620000 -CA61:0000000800087708220822385508888800080000000003F00408040803F00000 -CA62:000000080008770822082238550888880008000003F80020002000D003080000 -CA63:0000000800087708220822385508888800080000004003F8004000A003180000 -CA64:000000080008770822082238550888880008000003F8000803F8000800080000 -CA65:000000080008770822082238550888880008000003F8020003F8020003F80000 -CA66:000000080008770822082238550888880008000000000FF8022002200FF80000 -CA67:000000080008770822082238550888880008000000800FF803E0041003E00000 -CA68:00000000000A000A7B8A088A088A193A150A228ACC4A000A000A000A000A0000 -CA69:0000002800287728222822E8552888A80028000007F800080008000800080000 -CA6A:0000002800287728222822E8552888A80028000000003EF80208020802080000 -CA6B:0000002800287728222822E8552888A80028000000003E100210022802C40000 -CA6C:0000002800287728222822E8552888A80028000008000800080008000FF80000 -CA6D:0000002800287728222822E8552888A800280000000020F8201020303ECC0000 -CA6E:0000002800287728222822E8552888A800280000202021FC207020883E700000 -CA6F:0000002800287728222822E8552888A80028000003F802000200020003F80000 -CA70:0000002800287728222822E8552888A80028000007F8000807F8040007F80000 -CA71:0000002800287728222822E8552888A8002800003EF802083E0820083E080000 -CA72:0000002800287728222822E8552888A8002800003EF802883E8820883EF80000 -CA73:0000002800287728222822E8552888A8002800003E8802883EF820883EF80000 -CA74:0000002800287728222822E8552888A8002800001F0801081F0810141F620000 -CA75:0000002800287728222822E8552888A8002800003EF802803EF820803EF80000 -CA76:0000002800287728222822E8552888A8002800003EFC02483E4820483EFC0000 -CA77:0000002800287728222822E8552888A8002800003E1002FE3E3820443E380000 -CA78:0000002800287728222822E8552888A80028000003F802080208020803F80000 -CA79:0000002800287728222822E8552888A8002800000208020803F8020803F80000 -CA7A:0000002800287728222822E8552888A800280000110811081F0811141F620000 -CA7B:0000002800287728222822E8552888A800280000000800080008003400C20000 -CA7C:0000002800287728222822E8552888A8002800000048004800A8011406620000 -CA7D:0000002800287728222822E8552888A800280000000001F00208020801F00000 -CA7E:0000002800287728222822E8552888A80028000003F80020002000D003080000 -CA7F:0000002800287728222822E8552888A800280000004003F8004000A003180000 -CA80:0000002800287728222822E8552888A80028000003F8000803F8000800080000 -CA81:0000002800287728222822E8552888A80028000003F8020003F8020003F80000 -CA82:0000002800287728222822E8552888A80028000000000FF8022002200FF80000 -CA83:0000002800287728222822E8552888A80028000000800FF803E0041003E00000 -CA84:00000000000200027B820882089E19021502229ECC4200020002000200020000 -CA85:0000000800087708223822085538888800080000000007F80008000800080000 -CA86:000000080008770822382208553888880008000000003EF80208020802080000 -CA87:000000080008770822382208553888880008000000001F080108011401620000 -CA88:000000080008770822382208553888880008000800001000100010001FF80000 -CA89:0000000800087708223822085538888800080000000020F8201020303ECC0000 -CA8A:0000000800087708223822085538888800080000202021FC207020883E700000 -CA8B:000000080008770822382208553888880008000003F802000200020003F80000 -CA8C:000000080008770822382208553888880008000007F8000807F8040007F80000 -CA8D:00000008000877082238220855388888000800003EF802083E0820083E080000 -CA8E:00000008000877082238220855388888000800003EF802883E8820883EF80000 -CA8F:00000008000877082238220855388888000800003E8802883EF820883EF80000 -CA90:00000008000877082238220855388888000800000F8800880F8808140FA20000 -CA91:00000008000877082238220855388888000800003EF802803EF820803EF80000 -CA92:00000008000877082238220855388888000800003EFC02483E4820483EFC0000 -CA93:00000008000877082238220855388888000800003E1002FE3E3820443E380000 -CA94:000000080008770822382208553888880008000003F802080208020803F80000 -CA95:00000008000877082238220855388888000800000208020803F8020803F80000 -CA96:0000000800087708223822085538888800080000210821083F0821143F620000 -CA97:0000000800087708223822085538888800080000001000100010006801840000 -CA98:00000008000877082238220855388888000800000048004800A8011406620000 -CA99:0000000800087708223822085538888800080000000003F00408040803F00000 -CA9A:000000080008770822382208553888880008000003F80020002000D003080000 -CA9B:0000000800087708223822085538888800080000004003F8004000A003180000 -CA9C:000000080008770822382208553888880008000003F8000803F8000800080000 -CA9D:000000080008770822382208553888880008000003F8020003F8020003F80000 -CA9E:000000080008770822382208553888880008000000000FF8022002200FF80000 -CA9F:000000080008770822382208553888880008000000800FF803E0041003E00000 -CAA0:00000000000A000A7B8A088A08BA190A150A22BACC4A000A000A000A000A0000 -CAA1:000000280028772822E8222855E888A80028000007F800080008000800080000 -CAA2:000000280028772822E8222855E888A80028000000003EF80208020802080000 -CAA3:000000280028772822E8222855E888A80028000000003E100210022802C40000 -CAA4:000000280028772822E8222855E888A80028002808000800080008000FF80000 -CAA5:000000280028772822E8222855E888A800280000000020F8201020303ECC0000 -CAA6:000000280028772822E8222855E888A800280000202021FC207020883E700000 -CAA7:000000280028772822E8222855E888A80028000003F802000200020003F80000 -CAA8:000000280028772822E8222855E888A80028000007F8000807F8040007F80000 -CAA9:000000280028772822E8222855E888A8002800003EF802083E0820083E080000 -CAAA:000000280028772822E8222855E888A8002800003EF802883E8820883EF80000 -CAAB:000000280028772822E8222855E888A8002800003E8802883EF820883EF80000 -CAAC:000000280028772822E8222855E888A8002800001F0801081F0810141F620000 -CAAD:000000280028772822E8222855E888A8002800003EF802803EF820803EF80000 -CAAE:000000280028772822E8222855E888A8002800003EFC02483E4820483EFC0000 -CAAF:000000280028772822E8222855E888A8002800003E1002FE3E3820443E380000 -CAB0:000000280028772822E8222855E888A80028000003F802080208020803F80000 -CAB1:000000280028772822E8222855E888A8002800000208020803F8020803F80000 -CAB2:000000280028772822E8222855E888A800280000110811081F0811141F620000 -CAB3:000000280028772822E8222855E888A800280000000800080008003400C20000 -CAB4:000000280028772822E8222855E888A8002800000048004800A8011406620000 -CAB5:000000280028772822E8222855E888A800280000000001F00208020801F00000 -CAB6:000000280028772822E8222855E888A80028000003F80020002000D003080000 -CAB7:000000280028772822E8222855E888A800280000004003F8004000A003180000 -CAB8:000000280028772822E8222855E888A80028000003F8000803F8000800080000 -CAB9:000000280028772822E8222855E888A80028000003F8020003F8020003F80000 -CABA:000000280028772822E8222855E888A80028000000000FF8022002200FF80000 -CABB:000000280028772822E8222855E888A80028000000800FF803E0041003E00000 -CABC:0000000000001EE0022002200640054008A033100100010001007FFC00000000 -CABD:00003DE00440088015402220010001007FFC00001FF000100010001000100000 -CABE:00003DE00440088015402220010001007FFC000000003EF80208020802080000 -CABF:00003DE00440088015402220010001007FFC000000001E100210022802C40000 -CAC0:00003DE00440088015402220010001007FFC000000001000100010001FF00000 -CAC1:00003DE00440088015402220010001007FFC0000000020F8201020303ECC0000 -CAC2:00003DE00440088015402220010001007FFC0000202021FC207020883E700000 -CAC3:00003DE00440088015402220010001007FFC00001FF01000100010001FF00000 -CAC4:00003DE00440088015402220010001007FFC00001FF000101FF010001FF00000 -CAC5:00003DE00440088015402220010001007FFC00003EF802083E0820083E080000 -CAC6:00003DE00440088015402220010001007FFC00003EF802883E8820883EF80000 -CAC7:00003DE00440088015402220010001007FFC00003E8802883EF820883EF80000 -CAC8:00003DE00440088015402220010001007FFC00003E1002103E1020283EC40000 -CAC9:00003DE00440088015402220010001007FFC00003EF802803EF820803EF80000 -CACA:00003DE00440088015402220010001007FFC00003EFC02483E4820483EFC0000 -CACB:00003DE00440088015402220010001007FFC00003E2003FC3E7020883E700000 -CACC:00003DE00440088015402220010001007FFC00001FF01010101010101FF00000 -CACD:00003DE00440088015402220010001007FFC0000101010101FF010101FF00000 -CACE:00003DE00440088015402220010001007FFC0000222022203E2022503E880000 -CACF:00003DE00440088015402220010001007FFC000000000100010002800C400000 -CAD0:00003DE00440088015402220010001007FFC00000000024002400DA033100000 -CAD1:00003DE00440088015402220010001007FFC0000000007C00820082007C00000 -CAD2:00003DE00440088015402220010001007FFC0000000007E00080014006200000 -CAD3:00003DE00440088015402220010001007FFC0000008007E00080014006200000 -CAD4:00003DE00440088015402220010001007FFC00001FF000101FF0001000100000 -CAD5:00003DE00440088015402220010001007FFC00001FF010001FF010001FF00000 -CAD6:00003DE00440088015402220010001007FFC000000001FF0044004401FF00000 -CAD7:00003DE00440088015402220010001007FFC000001001FF007C0082007C00000 -CAD8:0000001000107B90089008901910151E2290CC50041004107FD0001000100000 -CAD9:00007BC8088811082A8E4448040804087FE8000007F800080008000800080000 -CADA:00007BC8088811082A8E4448040804087FE8000000003EF80208020802080000 -CADB:00007BC8088811082A8E4448040804087FE8000000001F080108011401620000 -CADC:00007BC8088811082A8E4448040804087FE8000008000800080008000FF80000 -CADD:00007BC8088811082A8E4448040804087FE80000000010F8101010301ECC0000 -CADE:00007BC8088811082A8E4448040804087FE800000808087F081C08220F9C0000 -CADF:00007BC8088811082A8E4448040804087FE8000003F802000200020003F80000 -CAE0:00007BC8088811082A8E4448040804087FE8000007F8000807F8040007F80000 -CAE1:00007BC8088811082A8E4448040804087FE800003EF802083E0820083E080000 -CAE2:00007BC8088811082A8E4448040804087FE800003EF802883E8820883EF80000 -CAE3:00007BC8088811082A8E4448040804087FE800003E8802883EF820883EF80000 -CAE4:00007BC8088811082A8E4448040804087FE800001F0801081F0810141F620000 -CAE5:00007BC8088811082A8E4448040804087FE800003EF802803EF820803EF80000 -CAE6:00007BC8088811082A8E4448040804087FE800003EFC02483E4820483EFC0000 -CAE7:00007BC8088811082A8E4448040804087FE800001F08017F1F1C10221F1C0000 -CAE8:00007BC8088811082A8E4448040804087FE8000003F802080208020803F80000 -CAE9:00007BC8088811082A8E4448040804087FE800000208020803F8020803F80000 -CAEA:00007BC8088811082A8E4448040804087FE80000110811081F0811141F620000 -CAEB:00007BC8088811082A8E4448040804087FE80000001000100010006801840000 -CAEC:00007BC8088811082A8E4448040804087FE800000048004800A8011406620000 -CAED:00007BC8088811082A8E4448040804087FE80000000003F00408040803F00000 -CAEE:00007BC8088811082A8E4448040804087FE8000003F80020002000D003080000 -CAEF:00007BC8088811082A8E4448040804087FE80000004003F8004000A003180000 -CAF0:00007BC8088811082A8E4448040804087FE8000003F8000803F8000800080000 -CAF1:00007BC8088811082A8E4448040804087FE8000003F8020003F8020003F80000 -CAF2:00007BC8088811082A8E4448040804087FE8000000000FF8022002200FF80000 -CAF3:00007BC8088811082A8E4448040804087FE8000000800FF803E0041003E00000 -CAF4:0000001200127B92089208921912151E2292CC52041204127FD2001200120000 -CAF5:00007BE808A811282AB84468042804287FA8000007F800080008000800080000 -CAF6:00007BE808A811282AB84468042804287FA8000000003EF80208020802080000 -CAF7:00007BE808A811282AB84468042804287FA8000000001F080108011401620000 -CAF8:00007BE808A811282AB84468042804287FA8000008000800080008000FF80000 -CAF9:00007BE808A811282AB84468042804287FA80000000010F8101010301ECC0000 -CAFA:00007BE808A811282AB84468042804287FA800000808087F081C08220F9C0000 -CAFB:00007BE808A811282AB84468042804287FA8000003F802000200020003F80000 -CAFC:00007BE808A811282AB84468042804287FA8000007F8000807F8040007F80000 -CAFD:00007BE808A811282AB84468042804287FA800003EF802083E0820083E080000 -CAFE:00007BE808A811282AB84468042804287FA800003EF802883E8820883EF80000 -CAFF:00007BE808A811282AB84468042804287FA800003E8802883EF820883EF80000 -CB00:00007BE808A811282AB84468042804287FA800001F0801081F0810141F620000 -CB01:00007BE808A811282AB84468042804287FA800003EF802803EF820803EF80000 -CB02:00007BE808A811282AB84468042804287FA800003EFC02483E4820483EFC0000 -CB03:00007BE808A811282AB84468042804287FA800001F08017F1F1C10221F1C0000 -CB04:00007BE808A811282AB84468042804287FA8000003F802080208020803F80000 -CB05:00007BE808A811282AB84468042804287FA800000208020803F8020803F80000 -CB06:00007BE808A811282AB84468042804287FA80000110811081F0811141F620000 -CB07:00007BE808A811282AB84468042804287FA80000001000100010006801840000 -CB08:00007BE808A811282AB84468042804287FA800000048004800A8011406620000 -CB09:00007BE808A811282AB84468042804287FA80000000003F00408040803F00000 -CB0A:00007BE808A811282AB84468042804287FA8000003F80020002000D003080000 -CB0B:00007BE808A811282AB84468042804287FA80000004003F8004000A003180000 -CB0C:00007BE808A811282AB84468042804287FA8000003F8000803F8000800080000 -CB0D:00007BE808A811282AB84468042804287FA8000003F8020003F8020003F80000 -CB0E:00007BE808A811282AB84468042804287FA8000000000FF8022002200FF80000 -CB0F:00007BE808A811282AB84468042804287FA8000000800FF803E0041003E00000 -CB10:0000000800087B8808880888190815082288CC48040804087FE8000800080000 -CB11:00007BC8088811082A884448040804087FE8000007F800080008000800080000 -CB12:00007BC8088811082A884448040804087FE8000000003EF80208020802080000 -CB13:00007BC8088811082A884448040804087FE8000000001F080108011401620000 -CB14:00007BC8088811082A884448040804087FE8000008000800080008000FF80000 -CB15:00007BC8088811082A884448040804087FE80000000010F8101010301ECC0000 -CB16:00007BC8088811082A884448040804087FE800000808087F081C08220F9C0000 -CB17:00007BC8088811082A884448040804087FE8000003F802000200020003F80000 -CB18:00007BC8088811082A884448040804087FE8000007F8000807F8040007F80000 -CB19:00007BC8088811082A884448040804087FE800003EF802083E0820083E080000 -CB1A:00007BC8088811082A884448040804087FE800003EF802883E8820883EF80000 -CB1B:00007BC8088811082A884448040804087FE800003E8802883EF820883EF80000 -CB1C:00007BC8088811082A884448040804087FE800001F0801081F0810141F620000 -CB1D:00007BC8088811082A884448040804087FE800003EF802803EF820803EF80000 -CB1E:00007BC8088811082A884448040804087FE800003EFC02483E4820483EFC0000 -CB1F:00007BC8088811082A884448040804087FE800001F08017F1F1C10221F1C0000 -CB20:00007BC8088811082A884448040804087FE8000003F802080208020803F80000 -CB21:00007BC8088811082A884448040804087FE800000208020803F8020803F80000 -CB22:00007BC8088811082A884448040804087FE80000110811081F0811141F620000 -CB23:00007BC8088811082A884448040804087FE80000001000100010006801840000 -CB24:00007BC8088811082A884448040804087FE800000048004800A8011406620000 -CB25:00007BC8088811082A884448040804087FE80000000003F00408040803F00000 -CB26:00007BC8088811082A884448040804087FE8000003F80020002000D003080000 -CB27:00007BC8088811082A884448040804087FE80000004003F8004000A003180000 -CB28:00007BC8088811082A884448040804087FE8000003F8000803F8000800080000 -CB29:00007BC8088811082A884448040804087FE8000003F8020003F8020003F80000 -CB2A:00007BC8088811082A884448040804087FE8000000000FF8022002200FF80000 -CB2B:00007BC8088811082A884448040804087FE8000000800FF803E0041003E00000 -CB2C:0000000000001EE0022002200640054008A037500440044004407FFC00000000 -CB2D:00003DE00440088015402220044004407FFC00001FF000100010001000100000 -CB2E:00003DE00440088015402220044004407FFC000000003EF80208020802080000 -CB2F:00003DE00440088015402220044004407FFC000000001E100210022802C40000 -CB30:00003DE00440088015402220044004407FFC000000001000100010001FF00000 -CB31:00003DE00440088015402220044004407FFC0000000020F8201020303ECC0000 -CB32:00003DE00440088015402220044004407FFC0000202021FC207020883E700000 -CB33:00003DE00440088015402220044004407FFC00001FF01000100010001FF00000 -CB34:00003DE00440088015402220044004407FFC00001FF000101FF010001FF00000 -CB35:00003DE00440088015402220044004407FFC00003EF802083E0820083E080000 -CB36:00003DE00440088015402220044004407FFC00003EF802883E8820883EF80000 -CB37:00003DE00440088015402220044004407FFC00003E8802883EF820883EF80000 -CB38:00003DE00440088015402220044004407FFC00003E1002103E1020283EC40000 -CB39:00003DE00440088015402220044004407FFC00003EF802803EF820803EF80000 -CB3A:00003DE00440088015402220044004407FFC00003EFC02483E4820483EFC0000 -CB3B:00003DE00440088015402220044004407FFC00003E2003FC3E7020883E700000 -CB3C:00003DE00440088015402220044004407FFC00001FF01010101010101FF00000 -CB3D:00003DE00440088015402220044004407FFC0000101010101FF010101FF00000 -CB3E:00003DE00440088015402220044004407FFC0000222022203E2022503E880000 -CB3F:00003DE00440088015402220044004407FFC000000000100010002800C400000 -CB40:00003DE00440088015402220044004407FFC00000000024002400DA033100000 -CB41:00003DE00440088015402220044004407FFC0000000007C00820082007C00000 -CB42:00003DE00440088015402220044004407FFC0000000007E00080014006200000 -CB43:00003DE00440088015402220044004407FFC0000008007E00080014006200000 -CB44:00003DE00440088015402220044004407FFC00001FF000101FF0001000100000 -CB45:00003DE00440088015402220044004407FFC00001FF010001FF010001FF00000 -CB46:00003DE00440088015402220044004407FFC000000001FF0044004401FF00000 -CB47:00003DE00440088015402220044004407FFC000001001FF007C0082007C00000 -CB48:000000001EE0022002200640054008A0331000003FF801000100010001000000 -CB49:00003DE0044008801540222000007FFC010001001FF000100010001000100000 -CB4A:00003DE0044008801540222000007FFC0100010000003EF80208020802080000 -CB4B:00003DE0044008801540222000007FFC0100010000001E100210022802C40000 -CB4C:00003DE00440088015402220000000007FFC010001001100100010001FF00000 -CB4D:00003DE0044008801540222000007FFC01000100000020F8201020303ECC0000 -CB4E:00003DE0044008801540222000007FFC01000100202021FC207020883E700000 -CB4F:00003DE0044008801540222000007FFC010001001FF01000100010001FF00000 -CB50:00003DE0044008801540222000007FFC010001001FF000101FF010001FF00000 -CB51:00003DE0044008801540222000007FFC010001003EF802083E0820083E080000 -CB52:00003DE0044008801540222000007FFC010001003EF802883E8820883EF80000 -CB53:00003DE0044008801540222000007FFC010001003E8802883EF820883EF80000 -CB54:00003DE0044008801540222000007FFC010001003E1002103E1020283EC40000 -CB55:00003DE0044008801540222000007FFC010001003EF802803EF820803EF80000 -CB56:00003DE0044008801540222000007FFC010001003EFC02483E4820483EFC0000 -CB57:00003DE0044008801540222000007FFC010001003E2003FC3E7020883E700000 -CB58:00003DE0044008801540222000007FFC010001001FF01010101010101FF00000 -CB59:00003DE0044008801540222000007FFC01000100101010101FF010101FF00000 -CB5A:00003DE0044008801540222000007FFC01000100222022203E2022503E880000 -CB5B:00003DE0044008801540222000007FFC0100010000000100010002800C400000 -CB5C:00003DE0044008801540222000007FFC010001000000024002400DA033100000 -CB5D:00003DE0044008801540222000007FFC01000100000007C00820082007C00000 -CB5E:00003DE0044008801540222000007FFC01000100000007E00080014006200000 -CB5F:00003DE0044008801540222000007FFC01000100008007E00080014006200000 -CB60:00003DE0044008801540222000007FFC010001001FF000101FF0001000100000 -CB61:00003DE0044008801540222000007FFC010001001FF010001FF010001FF00000 -CB62:00003DE0044008801540222000007FFC0100010000001FF0044004401FF00000 -CB63:00003DE0044008801540222000007FFC0100010001001FF007C0082007C00000 -CB64:000000087B8808880888190815082288CC4800087FE8040804F8040804080000 -CB65:7BC8088811082A88444800087FE8027802080000000007F80008000800080000 -CB66:7BC8088811082A88444800087FE802780208000000003EF80208020802080000 -CB67:7BC8088811082A88444800087FE802780208000000001F080108011401620000 -CB68:7BC8088811082A884448000800087FE80278020802081000100010001FF80000 -CB69:7BC8088811082A88444800087FE8027802080000000020F8201020303ECC0000 -CB6A:7BC8088811082A88444800087FE8027802080000202021FC207020883E700000 -CB6B:7BC8088811082A88444800087FE802780208000003F802000200020003F80000 -CB6C:7BC8088811082A88444800087FE802780208000007F8000807F8040007F80000 -CB6D:7BC8088811082A88444800087FE80278020800003EF802083E0820083E080000 -CB6E:7BC8088811082A88444800087FE80278020800003EF802883E8820883EF80000 -CB6F:7BC8088811082A88444800087FE80278020800003E8802883EF820883EF80000 -CB70:7BC8088811082A88444800087FE80278020800000F8800880F8808140FA20000 -CB71:7BC8088811082A88444800087FE80278020800003EF802803EF820803EF80000 -CB72:7BC8088811082A88444800087FE80278020800003EFC02483E4820483EFC0000 -CB73:7BC8088811082A88444800087FE80278020800003E1002FE3E3820443E380000 -CB74:7BC8088811082A88444800087FE802780208000003F802080208020803F80000 -CB75:7BC8088811082A88444800087FE80278020800000208020803F8020803F80000 -CB76:7BC8088811082A88444800087FE8027802080000210821083F0821143F620000 -CB77:7BC8088811082A88444800087FE8027802080000001000100010006801840000 -CB78:7BC8088811082A88444800087FE80278020800000048004800A8011406620000 -CB79:7BC8088811082A88444800087FE8027802080000000003F00408040803F00000 -CB7A:7BC8088811082A88444800087FE802780208000003F80020002000D003080000 -CB7B:7BC8088811082A88444800087FE8027802080000004003F8004000A003180000 -CB7C:7BC8088811082A88444800087FE802780208000003F8000803F8000800080000 -CB7D:7BC8088811082A88444800087FE802780208000003F8020003F8020003F80000 -CB7E:7BC8088811082A88444800087FE802780208000000000FF8022002200FF80000 -CB7F:7BC8088811082A88444800087FE802780208000000800FF803E0041003E00000 -CB80:0000000A7B8A088A088A190A150A228ACC4A000A7FEA040A047A040A040A0000 -CB81:7BE808A811282AA8446800287FA805E804280000000007F80008000800080000 -CB82:7BE808A811282AA8446800287FA805E80428000000003EF80208020802080000 -CB83:7BE808A811282AA8446800287FA805E80428000000001F080108011401620000 -CB84:7BE808A811282AA84468002800287FA8042805E804281428100010001FF80000 -CB85:7BE808A811282AA8446800287FA805E804280000000020F8201020303ECC0000 -CB86:7BE808A811282AA8446800287FA805E804280000202021FC207020883E700000 -CB87:7BE808A811282AA8446800287FA805E80428000003F802000200020003F80000 -CB88:7BE808A811282AA8446800287FA805E80428000007F8000807F8040007F80000 -CB89:7BE808A811282AA8446800287FA805E8042800003EF802083E0820083E080000 -CB8A:7BE808A811282AA8446800287FA805E8042800003EF802883E8820883EF80000 -CB8B:7BE808A811282AA8446800287FA805E8042800003E8802883EF820883EF80000 -CB8C:7BE808A811282AA8446800287FA805E8042800000F8800880F8808140FA20000 -CB8D:7BE808A811282AA8446800287FA805E8042800003EF802803EF820803EF80000 -CB8E:7BE808A811282AA8446800287FA805E8042800003EFC02483E4820483EFC0000 -CB8F:7BE808A811282AA8446800287FA805E8042800003E1002FE3E3820443E380000 -CB90:7BE808A811282AA8446800287FA805E80428000003F802080208020803F80000 -CB91:7BE808A811282AA8446800287FA805E8042800000208020803F8020803F80000 -CB92:7BE808A811282AA8446800287FA805E804280000210821083F0821143F620000 -CB93:7BE808A811282AA8446800287FA805E804280000001000100010006801840000 -CB94:7BE808A811282AA8446800287FA805E8042800000048004800A8011406620000 -CB95:7BE808A811282AA8446800287FA805E804280000000003F00408040803F00000 -CB96:7BE808A811282AA8446800287FA805E80428000003F80020002000D003080000 -CB97:7BE808A811282AA8446800287FA805E804280000004003F8004000A003180000 -CB98:7BE808A811282AA8446800287FA805E80428000003F8000803F8000800080000 -CB99:7BE808A811282AA8446800287FA805E80428000003F8020003F8020003F80000 -CB9A:7BE808A811282AA8446800287FA805E80428000000000FF8022002200FF80000 -CB9B:7BE808A811282AA8446800287FA805E80428000000800FF803E0041003E00000 -CB9C:000000087B8808880888190815082288CC4800087FE804080408040804080000 -CB9D:7BC8088811082A88444800087FE8020802000000000007F80008000800080000 -CB9E:7BC8088811082A88444800087FE802080200000000003EF80208020802080000 -CB9F:7BC8088811082A88444800087FE802080200000000001F080108011401620000 -CBA0:7BC8088811082A884448000800087FE80208020802081008100010001FF80000 -CBA1:7BC8088811082A88444800087FE8020802000000000020F8201020303ECC0000 -CBA2:7BC8088811082A88444800087FE8020802000000202021FC207020883E700000 -CBA3:7BC8088811082A88444800087FE802080200000003F802000200020003F80000 -CBA4:7BC8088811082A88444800087FE802080200000007F8000807F8040007F80000 -CBA5:7BC8088811082A88444800087FE80208020000003EF802083E0820083E080000 -CBA6:7BC8088811082A88444800087FE80208020000003EF802883E8820883EF80000 -CBA7:7BC8088811082A88444800087FE80208020000003E8802883EF820883EF80000 -CBA8:7BC8088811082A88444800087FE80208020000000F8800880F8808140FA20000 -CBA9:7BC8088811082A88444800087FE80208020000003EF802803EF820803EF80000 -CBAA:7BC8088811082A88444800087FE80208020000003EFC02483E4820483EFC0000 -CBAB:7BC8088811082A88444800087FE80208020000003E1002FE3E3820443E380000 -CBAC:7BC8088811082A88444800087FE802080200000003F802080208020803F80000 -CBAD:7BC8088811082A88444800087FE80208020000000208020803F8020803F80000 -CBAE:7BC8088811082A88444800087FE8020802000000210821083F0821143F620000 -CBAF:7BC8088811082A88444800087FE8020802000000001000100010006801840000 -CBB0:7BC8088811082A88444800087FE80208020000000048004800A8011406620000 -CBB1:7BC8088811082A88444800087FE8020802000000000003F00408040803F00000 -CBB2:7BC8088811082A88444800087FE802080200000003F80020002000D003080000 -CBB3:7BC8088811082A88444800087FE8020802000000004003F8004000A003180000 -CBB4:7BC8088811082A88444800087FE802080200000003F8000803F8000800080000 -CBB5:7BC8088811082A88444800087FE802080200000003F8020003F8020003F80000 -CBB6:7BC8088811082A88444800087FE802080200000000000FF8022002200FF80000 -CBB7:7BC8088811082A88444800087FE802080200000000800FF803E0041003E00000 -CBB8:000000001EE0022002200640054008A0331000007FFC04400440044004400000 -CBB9:00003DE0044008801540222000007FFC044004401FF000100010001000100000 -CBBA:00003DE0044008801540222000007FFC0440044000003EF80208020802080000 -CBBB:00003DE0044008801540222000007FFC0440044000001E100210022802C40000 -CBBC:00003DE00440088015402220000000007FFC044004401440100010001FF00000 -CBBD:00003DE0044008801540222000007FFC04400440000020F8201020303ECC0000 -CBBE:00003DE0044008801540222000007FFC04400440202021FC207020883E700000 -CBBF:00003DE0044008801540222000007FFC044004401FF01000100010001FF00000 -CBC0:00003DE0044008801540222000007FFC044004401FF000101FF010001FF00000 -CBC1:00003DE0044008801540222000007FFC044004403EF802083E0820083E080000 -CBC2:00003DE0044008801540222000007FFC044004403EF802883E8820883EF80000 -CBC3:00003DE0044008801540222000007FFC044004403E8802883EF820883EF80000 -CBC4:00003DE0044008801540222000007FFC044004403E1002103E1020283EC40000 -CBC5:00003DE0044008801540222000007FFC044004403EF802803EF820803EF80000 -CBC6:00003DE0044008801540222000007FFC044004403EFC02483E4820483EFC0000 -CBC7:00003DE0044008801540222000007FFC044004403E2003FC3E7020883E700000 -CBC8:00003DE0044008801540222000007FFC044004401FF01010101010101FF00000 -CBC9:00003DE0044008801540222000007FFC04400440101010101FF010101FF00000 -CBCA:00003DE0044008801540222000007FFC04400440222022203E2022503E880000 -CBCB:00003DE0044008801540222000007FFC0440044000000100010002800C400000 -CBCC:00003DE0044008801540222000007FFC044004400000024002400DA033100000 -CBCD:00003DE0044008801540222000007FFC04400440000007C00820082007C00000 -CBCE:00003DE0044008801540222000007FFC04400440000007E00080014006200000 -CBCF:00003DE0044008801540222000007FFC04400440008007E00080014006200000 -CBD0:00003DE0044008801540222000007FFC044004401FF000101FF0001000100000 -CBD1:00003DE0044008801540222000007FFC044004401FF010001FF010001FF00000 -CBD2:00003DE0044008801540222000007FFC0440044000001FF0044004401FF00000 -CBD3:00003DE0044008801540222000007FFC0440044001001FF007C0082007C00000 -CBD4:0000000000001EE0022002200640054008A0331000007FFC0000000000000000 -CBD5:00003DE00440088015402220000000007FFC00001FF000100010001000100000 -CBD6:00003DE00440088015402220000000007FFC000000003EF80208020802080000 -CBD7:00003DE00440088015402220000000007FFC000000001E100210022802C40000 -CBD8:00003DE00440088015402220000000007FFC000000001000100010001FF00000 -CBD9:00003DE00440088015402220000000007FFC0000000020F8201020303ECC0000 -CBDA:00003DE00440088015402220000000007FFC0000202021FC207020883E700000 -CBDB:00003DE00440088015402220000000007FFC00001FF01000100010001FF00000 -CBDC:00003DE00440088015402220000000007FFC00001FF000101FF010001FF00000 -CBDD:00003DE00440088015402220000000007FFC00003EF802083E0820083E080000 -CBDE:00003DE00440088015402220000000007FFC00003EF802883E8820883EF80000 -CBDF:00003DE00440088015402220000000007FFC00003E8802883EF820883EF80000 -CBE0:00003DE00440088015402220000000007FFC00003E1002103E1020283EC40000 -CBE1:00003DE00440088015402220000000007FFC00003EF802803EF820803EF80000 -CBE2:00003DE00440088015402220000000007FFC00003EFC02483E4820483EFC0000 -CBE3:00003DE00440088015402220000000007FFC00003E2003FC3E7020883E700000 -CBE4:00003DE00440088015402220000000007FFC00001FF01010101010101FF00000 -CBE5:00003DE00440088015402220000000007FFC0000101010101FF010101FF00000 -CBE6:00003DE00440088015402220000000007FFC0000222022203E2022503E880000 -CBE7:00003DE00440088015402220000000007FFC000000000100010002800C400000 -CBE8:00003DE00440088015402220000000007FFC00000000024002400DA033100000 -CBE9:00003DE00440088015402220000000007FFC0000000007C00820082007C00000 -CBEA:00003DE00440088015402220000000007FFC0000000007E00080014006200000 -CBEB:00003DE00440088015402220000000007FFC0000008007E00080014006200000 -CBEC:00003DE00440088015402220000000007FFC00001FF000101FF0001000100000 -CBED:00003DE00440088015402220000000007FFC00001FF010001FF010001FF00000 -CBEE:00003DE00440088015402220000000007FFC000000001FF0044004401FF00000 -CBEF:00003DE00440088015402220000000007FFC000001001FF007C0082007C00000 -CBF0:0000000800087B8808880888190815082288CC4800087FE80008000800080000 -CBF1:00007BC8088811082A884448000800087FE8000007F800080008000800080000 -CBF2:00007BC8088811082A884448000800087FE8000000003EF80208020802080000 -CBF3:00007BC8088811082A884448000800087FE8000000001F080108011401620000 -CBF4:00007BC8088811082A884448000800087FE8000008000800080008000FF80000 -CBF5:00007BC8088811082A884448000800087FE80000000010F8101010301ECC0000 -CBF6:00007BC8088811082A884448000800087FE800000808087F081C08220F9C0000 -CBF7:00007BC8088811082A884448000800087FE8000003F802000200020003F80000 -CBF8:00007BC8088811082A884448000800087FE8000007F8000807F8040007F80000 -CBF9:00007BC8088811082A884448000800087FE800003EF802083E0820083E080000 -CBFA:00007BC8088811082A884448000800087FE800003EF802883E8820883EF80000 -CBFB:00007BC8088811082A884448000800087FE800003E8802883EF820883EF80000 -CBFC:00007BC8088811082A884448000800087FE800001F0801081F0810141F620000 -CBFD:00007BC8088811082A884448000800087FE800003EF802803EF820803EF80000 -CBFE:00007BC8088811082A884448000800087FE800003EFC02483E4820483EFC0000 -CBFF:00007BC8088811082A884448000800087FE800001F08017F1F1C10221F1C0000 -CC00:00007BC8088811082A884448000800087FE8000003F802080208020803F80000 -CC01:00007BC8088811082A884448000800087FE800000208020803F8020803F80000 -CC02:00007BC8088811082A884448000800087FE80000110811081F0811141F620000 -CC03:00007BC8088811082A884448000800087FE80000001000100010006801840000 -CC04:00007BC8088811082A884448000800087FE800000048004800A8011406620000 -CC05:00007BC8088811082A884448000800087FE80000000003F00408040803F00000 -CC06:00007BC8088811082A884448000800087FE8000003F80020002000D003080000 -CC07:00007BC8088811082A884448000800087FE80000004003F8004000A003180000 -CC08:00007BC8088811082A884448000800087FE8000003F8000803F8000800080000 -CC09:00007BC8088811082A884448000800087FE8000003F8020003F8020003F80000 -CC0A:00007BC8088811082A884448000800087FE8000000000FF8022002200FF80000 -CC0B:00007BC8088811082A884448000800087FE8000000800FF803E0041003E00000 -CC0C:00000000000800087B8808880888190815082288CC4800080008000800080000 -CC0D:0000000800087708220822085508888800080000000007F80008000800080000 -CC0E:000000080008770822082208550888880008000000003EF80208020802080000 -CC0F:000000080008770822082208550888880008000000001F080108011401620000 -CC10:000000080008770822082208550888880008000800001000100010001FF80000 -CC11:0000000800087708220822085508888800080000000020F8201020303ECC0000 -CC12:0000000800087708220822085508888800080000202021FC207020883E700000 -CC13:000000080008770822082208550888880008000003F802000200020003F80000 -CC14:000000080008770822082208550888880008000007F8000807F8040007F80000 -CC15:00000008000877082208220855088888000800003EF802083E0820083E080000 -CC16:00000008000877082208220855088888000800003EF802883E8820883EF80000 -CC17:00000008000877082208220855088888000800003E8802883EF820883EF80000 -CC18:00000008000877082208220855088888000800000F8800880F8808140FA20000 -CC19:00000008000877082208220855088888000800003EF802803EF820803EF80000 -CC1A:00000008000877082208220855088888000800003EFC02483E4820483EFC0000 -CC1B:00000008000877082208220855088888000800003E1002FE3E3820443E380000 -CC1C:000000080008770822082208550888880008000003F802080208020803F80000 -CC1D:00000008000877082208220855088888000800000208020803F8020803F80000 -CC1E:0000000800087708220822085508888800080000210821083F0821143F620000 -CC1F:0000000800087708220822085508888800080000001000100010006801840000 -CC20:00000008000877082208220855088888000800000048004800A8011406620000 -CC21:0000000800087708220822085508888800080000000003F00408040803F00000 -CC22:000000080008770822082208550888880008000003F80020002000D003080000 -CC23:0000000800087708220822085508888800080000004003F8004000A003180000 -CC24:000000080008770822082208550888880008000003F8000803F8000800080000 -CC25:000000080008770822082208550888880008000003F8020003F8020003F80000 -CC26:000000080008770822082208550888880008000000000FF8022002200FF80000 -CC27:000000080008770822082208550888880008000000800FF803E0041003E00000 -CC28:000000000010041004103F900110021E06100910309000100010001000100000 -CC29:00000008000808087E08080E140862080008000007F800080008000800080000 -CC2A:00000008000808087E08080E140862080008000000003EF80208020802080000 -CC2B:00000008000808087E08080E140862080008000000001F080108011401620000 -CC2C:00000008000808087E08080E140862080008000808000800080008000FF80000 -CC2D:00000008000808087E08080E1408620800080000000010F8101010301ECC0000 -CC2E:00000008000808087E08080E14086208000800000808087F081C08220F9C0000 -CC2F:00000008000808087E08080E140862080008000003F802000200020003F80000 -CC30:00000008000808087E08080E140862080008000007F8000807F8040007F80000 -CC31:00000008000808087E08080E14086208000800003EF802083E0820083E080000 -CC32:00000008000808087E08080E14086208000800003EF802883E8820883EF80000 -CC33:00000008000808087E08080E14086208000800003E8802883EF820883EF80000 -CC34:00000008000808087E08080E14086208000800001F0801081F0810141F620000 -CC35:00000008000808087E08080E14086208000800003EF802803EF820803EF80000 -CC36:00000008000808087E08080E14086208000800003EFC02483E4820483EFC0000 -CC37:00000008000808087E08080E14086208000800001F08017F1F1C10221F1C0000 -CC38:00000008000808087E08080E140862080008000003F802080208020803F80000 -CC39:00000008000808087E08080E14086208000800000208020803F8020803F80000 -CC3A:00000008000808087E08080E1408620800080000110811081F0811141F620000 -CC3B:00000008000808087E08080E1408620800080000001000100010006801840000 -CC3C:00000008000808087E08080E14086208000800000048004800A8011406620000 -CC3D:00000008000808087E08080E1408620800080000000003F00408040803F00000 -CC3E:00000008000808087E08080E140862080008000003F80020002000D003080000 -CC3F:00000008000808087E08080E1408620800080000004003F8004000A003180000 -CC40:00000008000808087E08080E140862080008000003F8000803F8000800080000 -CC41:00000008000808087E08080E140862080008000003F8020003F8020003F80000 -CC42:00000008000808087E08080E140862080008000000000FF8022002200FF80000 -CC43:00000008000808087E08080E140862080008000000800FF803E0041003E00000 -CC44:000000000012041204123F920112021E06120912309200120012001200120000 -CC45:00000028002808287E280838142862280028000007F800080008000800080000 -CC46:00000028002808287E280838142862280028000000003EF80208020802080000 -CC47:00000028002808287E280838142862280028000000003E100210022802C40000 -CC48:00000028002808287E280838142862280028002808000800080008000FF80000 -CC49:00000028002808287E2808381428622800280000000020F8201020303ECC0000 -CC4A:00000028002808287E2808381428622800280000202021FC207020883E700000 -CC4B:00000028002808287E280838142862280028000003F802000200020003F80000 -CC4C:00000028002808287E280838142862280028000007F8000807F8040007F80000 -CC4D:00000028002808287E28083814286228002800003EF802083E0820083E080000 -CC4E:00000028002808287E28083814286228002800003EF802883E8820883EF80000 -CC4F:00000028002808287E28083814286228002800003E8802883EF820883EF80000 -CC50:00000028002808287E28083814286228002800001F0801081F0810141F620000 -CC51:00000028002808287E28083814286228002800003EF802803EF820803EF80000 -CC52:00000028002808287E28083814286228002800003EFC02483E4820483EFC0000 -CC53:00000028002808287E28083814286228002800003E1002FE3E3820443E380000 -CC54:00000028002808287E280838142862280028000003F802080208020803F80000 -CC55:00000028002808287E28083814286228002800000208020803F8020803F80000 -CC56:00000028002808287E2808381428622800280000110811081F0811141F620000 -CC57:00000028002808287E2808381428622800280000000800080008003400C20000 -CC58:00000028002808287E28083814286228002800000048004800A8011406620000 -CC59:00000028002808287E2808381428622800280000000001F00208020801F00000 -CC5A:00000028002808287E280838142862280028000003F80020002000D003080000 -CC5B:00000028002808287E2808381428622800280000004003F8004000A003180000 -CC5C:00000028002808287E280838142862280028000003F8000803F8000800080000 -CC5D:00000028002808287E280838142862280028000003F8020003F8020003F80000 -CC5E:00000028002808287E280838142862280028000000000FF8022002200FF80000 -CC5F:00000028002808287E280838142862280028000000800FF803E0041003E00000 -CC60:000000000010041004103F90011E02100610091E309000100010001000100000 -CC61:00000008000808087E0E0808140E62080008000007F800080008000800080000 -CC62:00000008000808087E0E0808140E62080008000000003EF80208020802080000 -CC63:00000008000808087E0E0808140E62080008000000001F080108011401620000 -CC64:00000008000808087E0E0808140E62080008000008000800080008000FF80000 -CC65:00000008000808087E0E0808140E620800080000000010F8101010301ECC0000 -CC66:00000008000808087E0E0808140E6208000800000808087F081C08220F9C0000 -CC67:00000008000808087E0E0808140E62080008000003F802000200020003F80000 -CC68:00000008000808087E0E0808140E62080008000007F8000807F8040007F80000 -CC69:00000008000808087E0E0808140E6208000800003EF802083E0820083E080000 -CC6A:00000008000808087E0E0808140E6208000800003EF802883E8820883EF80000 -CC6B:00000008000808087E0E0808140E6208000800003E8802883EF820883EF80000 -CC6C:00000008000808087E0E0808140E6208000800001F0801081F0810141F620000 -CC6D:00000008000808087E0E0808140E6208000800003EF802803EF820803EF80000 -CC6E:00000008000808087E0E0808140E6208000800003EFC02483E4820483EFC0000 -CC6F:00000008000808087E0E0808140E6208000800001F08017F1F1C10221F1C0000 -CC70:00000008000808087E0E0808140E62080008000003F802080208020803F80000 -CC71:00000008000808087E0E0808140E6208000800000208020803F8020803F80000 -CC72:00000008000808087E0E0808140E620800080000110811081F0811141F620000 -CC73:00000008000808087E0E0808140E620800080000001000100010006801840000 -CC74:00000008000808087E0E0808140E6208000800000048004800A8011406620000 -CC75:00000008000808087E0E0808140E620800080000000003F00408040803F00000 -CC76:00000008000808087E0E0808140E62080008000003F80020002000D003080000 -CC77:00000008000808087E0E0808140E620800080000004003F8004000A003180000 -CC78:00000008000808087E0E0808140E62080008000003F8000803F8000800080000 -CC79:00000008000808087E0E0808140E62080008000003F8020003F8020003F80000 -CC7A:00000008000808087E0E0808140E62080008000000000FF8022002200FF80000 -CC7B:00000008000808087E0E0808140E62080008000000800FF803E0041003E00000 -CC7C:000000000012041204123F92011E02120612091E309200120012001200120000 -CC7D:00000028002808287E380828143862280028000007F800080008000800080000 -CC7E:00000028002808287E380828143862280028000000003EF80208020802080000 -CC7F:00000028002808287E380828143862280028000000003E100210022802C40000 -CC80:00000028002808287E380828143862280028002808000800080008000FF80000 -CC81:00000028002808287E3808281438622800280000000020F8201020303ECC0000 -CC82:00000028002808287E3808281438622800280000202021FC207020883E700000 -CC83:00000028002808287E380828143862280028000003F802000200020003F80000 -CC84:00000028002808287E380828143862280028000007F8000807F8040007F80000 -CC85:00000028002808287E38082814386228002800003EF802083E0820083E080000 -CC86:00000028002808287E38082814386228002800003EF802883E8820883EF80000 -CC87:00000028002808287E38082814386228002800003E8802883EF820883EF80000 -CC88:00000028002808287E38082814386228002800001F0801081F0810141F620000 -CC89:00000028002808287E38082814386228002800003EF802803EF820803EF80000 -CC8A:00000028002808287E38082814386228002800003EFC02483E4820483EFC0000 -CC8B:00000028002808287E38082814386228002800003E1002FE3E3820443E380000 -CC8C:00000028002808287E380828143862280028000003F802080208020803F80000 -CC8D:00000028002808287E38082814386228002800000208020803F8020803F80000 -CC8E:00000028002808287E3808281438622800280000110811081F0811141F620000 -CC8F:00000028002808287E3808281438622800280000000800080008003400C20000 -CC90:00000028002808287E38082814386228002800000048004800A8011406620000 -CC91:00000028002808287E3808281438622800280000000001F00208020801F00000 -CC92:00000028002808287E380828143862280028000003F80020002000D003080000 -CC93:00000028002808287E3808281438622800280000004003F8004000A003180000 -CC94:00000028002808287E380828143862280028000003F8000803F8000800080000 -CC95:00000028002808287E380828143862280028000003F8020003F8020003F80000 -CC96:00000028002808287E380828143862280028000000000FF8022002200FF80000 -CC97:00000028002808287E380828143862280028000000800FF803E0041003E00000 -CC98:000000000002040204023F820102021E06020902308200020002000200020000 -CC99:00000008000808087E0808381408620800080000000007F80008000800080000 -CC9A:00000008000808087E080838140862080008000000003EF80208020802080000 -CC9B:00000008000808087E080838140862080008000000001F080108011401620000 -CC9C:00000008000808087E080838140862080008000000001000100010001FF80000 -CC9D:00000008000808087E0808381408620800080000000020F8201020303ECC0000 -CC9E:00000008000808087E0808381408620800080000202021FC207020883E700000 -CC9F:00000008000808087E080838140862080008000003F802000200020003F80000 -CCA0:00000008000808087E080838140862080008000007F8000807F8040007F80000 -CCA1:00000008000808087E08083814086208000800003EF802083E0820083E080000 -CCA2:00000008000808087E08083814086208000800003EF802883E8820883EF80000 -CCA3:00000008000808087E08083814086208000800003E8802883EF820883EF80000 -CCA4:00000008000808087E08083814086208000800000F8800880F8808140FA20000 -CCA5:00000008000808087E08083814086208000800003EF802803EF820803EF80000 -CCA6:00000008000808087E08083814086208000800003EFC02483E4820483EFC0000 -CCA7:00000008000808087E08083814086208000800003E1002FE3E3820443E380000 -CCA8:00000008000808087E080838140862080008000003F802080208020803F80000 -CCA9:00000008000808087E08083814086208000800000208020803F8020803F80000 -CCAA:00000008000808087E0808381408620800080000210821083F0821143F620000 -CCAB:00000008000808087E0808381408620800080000001000100010006801840000 -CCAC:00000008000808087E08083814086208000800000048004800A8011406620000 -CCAD:00000008000808087E0808381408620800080000000003F00408040803F00000 -CCAE:00000008000808087E080838140862080008000003F80020002000D003080000 -CCAF:00000008000808087E0808381408620800080000004003F8004000A003180000 -CCB0:00000008000808087E080838140862080008000003F8000803F8000800080000 -CCB1:00000008000808087E080838140862080008000003F8020003F8020003F80000 -CCB2:00000008000808087E080838140862080008000000000FF8022002200FF80000 -CCB3:00000008000808087E080838140862080008000000800FF803E0041003E00000 -CCB4:00000000000A040A040A3F8A010A023A060A090A308A000A000A000A000A0000 -CCB5:00000028002808287E2808E8142862280028000007F800080008000800080000 -CCB6:00000028002808287E2808E8142862280028000000003EF80208020802080000 -CCB7:00000028002808287E2808E8142862280028000000003E100210022802C40000 -CCB8:00000028002808287E2808E8142862280028000008000800080008000FF80000 -CCB9:00000028002808287E2808E81428622800280000000020F8201020303ECC0000 -CCBA:00000028002808287E2808E81428622800280000202021FC207020883E700000 -CCBB:00000028002808287E2808E8142862280028000003F802000200020003F80000 -CCBC:00000028002808287E2808E8142862280028000007F8000807F8040007F80000 -CCBD:00000028002808287E2808E814286228002800003EF802083E0820083E080000 -CCBE:00000028002808287E2808E814286228002800003EF802883E8820883EF80000 -CCBF:00000028002808287E2808E814286228002800003E8802883EF820883EF80000 -CCC0:00000028002808287E2808E814286228002800001F0801081F0810141F620000 -CCC1:00000028002808287E2808E814286228002800003EF802803EF820803EF80000 -CCC2:00000028002808287E2808E814286228002800003EFC02483E4820483EFC0000 -CCC3:00000028002808287E2808E814286228002800003E1002FE3E3820443E380000 -CCC4:00000028002808287E2808E8142862280028000003F802080208020803F80000 -CCC5:00000028002808287E2808E814286228002800000208020803F8020803F80000 -CCC6:00000028002808287E2808E81428622800280000110811081F0811141F620000 -CCC7:00000028002808287E2808E81428622800280000000800080008003400C20000 -CCC8:00000028002808287E2808E814286228002800000048004800A8011406620000 -CCC9:00000028002808287E2808E81428622800280000000001F00208020801F00000 -CCCA:00000028002808287E2808E8142862280028000003F80020002000D003080000 -CCCB:00000028002808287E2808E81428622800280000004003F8004000A003180000 -CCCC:00000028002808287E2808E8142862280028000003F8000803F8000800080000 -CCCD:00000028002808287E2808E8142862280028000003F8020003F8020003F80000 -CCCE:00000028002808287E2808E8142862280028000000000FF8022002200FF80000 -CCCF:00000028002808287E2808E8142862280028000000800FF803E0041003E00000 -CCD0:000000000002040204023F82011E02020602091E308200020002000200020000 -CCD1:00000008000808087E3808081438620800080000000007F80008000800080000 -CCD2:00000008000808087E380808143862080008000000003EF80208020802080000 -CCD3:00000008000808087E380808143862080008000000001F080108011401620000 -CCD4:00000008000808087E380808143862080008000800001000100010001FF80000 -CCD5:00000008000808087E3808081438620800080000000020F8201020303ECC0000 -CCD6:00000008000808087E3808081438620800080000202021FC207020883E700000 -CCD7:00000008000808087E380808143862080008000003F802000200020003F80000 -CCD8:00000008000808087E380808143862080008000007F8000807F8040007F80000 -CCD9:00000008000808087E38080814386208000800003EF802083E0820083E080000 -CCDA:00000008000808087E38080814386208000800003EF802883E8820883EF80000 -CCDB:00000008000808087E38080814386208000800003E8802883EF820883EF80000 -CCDC:00000008000808087E38080814386208000800000F8800880F8808140FA20000 -CCDD:00000008000808087E38080814386208000800003EF802803EF820803EF80000 -CCDE:00000008000808087E38080814386208000800003EFC02483E4820483EFC0000 -CCDF:00000008000808087E38080814386208000800003E1002FE3E3820443E380000 -CCE0:00000008000808087E380808143862080008000003F802080208020803F80000 -CCE1:00000008000808087E38080814386208000800000208020803F8020803F80000 -CCE2:00000008000808087E3808081438620800080000210821083F0821143F620000 -CCE3:00000008000808087E3808081438620800080000001000100010006801840000 -CCE4:00000008000808087E38080814386208000800000048004800A8011406620000 -CCE5:00000008000808087E3808081438620800080000000003F00408040803F00000 -CCE6:00000008000808087E380808143862080008000003F80020002000D003080000 -CCE7:00000008000808087E3808081438620800080000004003F8004000A003180000 -CCE8:00000008000808087E380808143862080008000003F8000803F8000800080000 -CCE9:00000008000808087E380808143862080008000003F8020003F8020003F80000 -CCEA:00000008000808087E380808143862080008000000000FF8022002200FF80000 -CCEB:00000008000808087E380808143862080008000000800FF803E0041003E00000 -CCEC:00000000000A040A040A3F8A013A020A060A093A308A000A000A000A000A0000 -CCED:00000028002808287EE8082814E862280028000007F800080008000800080000 -CCEE:00000028002808287EE8082814E862280028000000003EF80208020802080000 -CCEF:00000028002808287EE8082814E862280028000000003E100210022802C40000 -CCF0:00000028002808287EE8082814E862280028002808000800080008000FF80000 -CCF1:00000028002808287EE8082814E8622800280000000020F8201020303ECC0000 -CCF2:00000028002808287EE8082814E8622800280000202021FC207020883E700000 -CCF3:00000028002808287EE8082814E862280028000003F802000200020003F80000 -CCF4:00000028002808287EE8082814E862280028000007F8000807F8040007F80000 -CCF5:00000028002808287EE8082814E86228002800003EF802083E0820083E080000 -CCF6:00000028002808287EE8082814E86228002800003EF802883E8820883EF80000 -CCF7:00000028002808287EE8082814E86228002800003E8802883EF820883EF80000 -CCF8:00000028002808287EE8082814E86228002800001F0801081F0810141F620000 -CCF9:00000028002808287EE8082814E86228002800003EF802803EF820803EF80000 -CCFA:00000028002808287EE8082814E86228002800003EFC02483E4820483EFC0000 -CCFB:00000028002808287EE8082814E86228002800003E1002FE3E3820443E380000 -CCFC:00000028002808287EE8082814E862280028000003F802080208020803F80000 -CCFD:00000028002808287EE8082814E86228002800000208020803F8020803F80000 -CCFE:00000028002808287EE8082814E8622800280000110811081F0811141F620000 -CCFF:00000028002808287EE8082814E8622800280000000800080008003400C20000 -CD00:00000028002808287EE8082814E86228002800000048004800A8011406620000 -CD01:00000028002808287EE8082814E8622800280000000001F00208020801F00000 -CD02:00000028002808287EE8082814E862280028000003F80020002000D003080000 -CD03:00000028002808287EE8082814E8622800280000004003F8004000A003180000 -CD04:00000028002808287EE8082814E862280028000003F8000803F8000800080000 -CD05:00000028002808287EE8082814E862280028000003F8020003F8020003F80000 -CD06:00000028002808287EE8082814E862280028000000000FF8022002200FF80000 -CD07:00000028002808287EE8082814E862280028000000800FF803E0041003E00000 -CD08:0000010001000FE000400080018002400C2000000100010001007FFC00000000 -CD09:000001000FC0010002800C40010001007FFC00001FF000100010001000100000 -CD0A:000001000FC0010002800C40010001007FFC000000003EF80208020802080000 -CD0B:000001000FC0010002800C40010001007FFC000000001E100210022802C40000 -CD0C:000001000FC0010002800C40010001007FFC000000001000100010001FF00000 -CD0D:000001000FC0010002800C40010001007FFC0000000020F8201020303ECC0000 -CD0E:000001000FC0010002800C40010001007FFC0000202021FC207020883E700000 -CD0F:000001000FC0010002800C40010001007FFC00001FF01000100010001FF00000 -CD10:000001000FC0010002800C40010001007FFC00001FF000101FF010001FF00000 -CD11:000001000FC0010002800C40010001007FFC00003EF802083E0820083E080000 -CD12:000001000FC0010002800C40010001007FFC00003EF802883E8820883EF80000 -CD13:000001000FC0010002800C40010001007FFC00003E8802883EF820883EF80000 -CD14:000001000FC0010002800C40010001007FFC00003E1002103E1020283EC40000 -CD15:000001000FC0010002800C40010001007FFC00003EF802803EF820803EF80000 -CD16:000001000FC0010002800C40010001007FFC00003EFC02483E4820483EFC0000 -CD17:000001000FC0010002800C40010001007FFC00003E2003FC3E7020883E700000 -CD18:000001000FC0010002800C40010001007FFC00001FF01010101010101FF00000 -CD19:000001000FC0010002800C40010001007FFC0000101010101FF010101FF00000 -CD1A:000001000FC0010002800C40010001007FFC0000222022203E2022503E880000 -CD1B:000001000FC0010002800C40010001007FFC000000000100010002800C400000 -CD1C:000001000FC0010002800C40010001007FFC00000000024002400DA033100000 -CD1D:000001000FC0010002800C40010001007FFC0000000007C00820082007C00000 -CD1E:000001000FC0010002800C40010001007FFC0000000007E00080014006200000 -CD1F:000001000FC0010002800C40010001007FFC0000008007E00080014006200000 -CD20:000001000FC0010002800C40010001007FFC00001FF000101FF0001000100000 -CD21:000001000FC0010002800C40010001007FFC00001FF010001FF010001FF00000 -CD22:000001000FC0010002800C40010001007FFC000000001FF0044004401FF00000 -CD23:000001000FC0010002800C40010001007FFC000001001FF007C0082007C00000 -CD24:00000010041004103F9001100210061E09103090041004107FD0001000100000 -CD25:000002081F880208050E1888040804087FE8000007F800080008000800080000 -CD26:000002081F880208050E1888040804087FE8000000003EF80208020802080000 -CD27:000002081F880208050E1888040804087FE8000000001F080108011401620000 -CD28:000002081F880208050E1888040804087FE8000008000800080008000FF80000 -CD29:000002081F880208050E1888040804087FE80000000010F8101010301ECC0000 -CD2A:000002081F880208050E1888040804087FE800000808087F081C08220F9C0000 -CD2B:000002081F880208050E1888040804087FE8000003F802000200020003F80000 -CD2C:000002081F880208050E1888040804087FE8000007F8000807F8040007F80000 -CD2D:000002081F880208050E1888040804087FE800003EF802083E0820083E080000 -CD2E:000002081F880208050E1888040804087FE800003EF802883E8820883EF80000 -CD2F:000002081F880208050E1888040804087FE800003E8802883EF820883EF80000 -CD30:000002081F880208050E1888040804087FE800001F0801081F0810141F620000 -CD31:000002081F880208050E1888040804087FE800003EF802803EF820803EF80000 -CD32:000002081F880208050E1888040804087FE800003EFC02483E4820483EFC0000 -CD33:000002081F880208050E1888040804087FE800001F08017F1F1C10221F1C0000 -CD34:000002081F880208050E1888040804087FE8000003F802080208020803F80000 -CD35:000002081F880208050E1888040804087FE800000208020803F8020803F80000 -CD36:000002081F880208050E1888040804087FE80000110811081F0811141F620000 -CD37:000002081F880208050E1888040804087FE80000001000100010006801840000 -CD38:000002081F880208050E1888040804087FE800000048004800A8011406620000 -CD39:000002081F880208050E1888040804087FE80000000003F00408040803F00000 -CD3A:000002081F880208050E1888040804087FE8000003F80020002000D003080000 -CD3B:000002081F880208050E1888040804087FE80000004003F8004000A003180000 -CD3C:000002081F880208050E1888040804087FE8000003F8000803F8000800080000 -CD3D:000002081F880208050E1888040804087FE8000003F8020003F8020003F80000 -CD3E:000002081F880208050E1888040804087FE8000000000FF8022002200FF80000 -CD3F:000002081F880208050E1888040804087FE8000000800FF803E0041003E00000 -CD40:00000012041204123F9201120212061E09123092041204127FD2001200120000 -CD41:000002281FA80228053818A8042804287FA8000007F800080008000800080000 -CD42:000002281FA80228053818A8042804287FA8000000003EF80208020802080000 -CD43:000002281FA80228053818A8042804287FA8000000001F080108011401620000 -CD44:000002281FA80228053818A8042804287FA8000008000800080008000FF80000 -CD45:000002281FA80228053818A8042804287FA80000000010F8101010301ECC0000 -CD46:000002281FA80228053818A8042804287FA800000808087F081C08220F9C0000 -CD47:000002281FA80228053818A8042804287FA8000003F802000200020003F80000 -CD48:000002281FA80228053818A8042804287FA8000007F8000807F8040007F80000 -CD49:000002281FA80228053818A8042804287FA800003EF802083E0820083E080000 -CD4A:000002281FA80228053818A8042804287FA800003EF802883E8820883EF80000 -CD4B:000002281FA80228053818A8042804287FA800003E8802883EF820883EF80000 -CD4C:000002281FA80228053818A8042804287FA800001F0801081F0810141F620000 -CD4D:000002281FA80228053818A8042804287FA800003EF802803EF820803EF80000 -CD4E:000002281FA80228053818A8042804287FA800003EFC02483E4820483EFC0000 -CD4F:000002281FA80228053818A8042804287FA800001F08017F1F1C10221F1C0000 -CD50:000002281FA80228053818A8042804287FA8000003F802080208020803F80000 -CD51:000002281FA80228053818A8042804287FA800000208020803F8020803F80000 -CD52:000002281FA80228053818A8042804287FA80000110811081F0811141F620000 -CD53:000002281FA80228053818A8042804287FA80000001000100010006801840000 -CD54:000002281FA80228053818A8042804287FA800000048004800A8011406620000 -CD55:000002281FA80228053818A8042804287FA80000000003F00408040803F00000 -CD56:000002281FA80228053818A8042804287FA8000003F80020002000D003080000 -CD57:000002281FA80228053818A8042804287FA80000004003F8004000A003180000 -CD58:000002281FA80228053818A8042804287FA8000003F8000803F8000800080000 -CD59:000002281FA80228053818A8042804287FA8000003F8020003F8020003F80000 -CD5A:000002281FA80228053818A8042804287FA8000000000FF8022002200FF80000 -CD5B:000002281FA80228053818A8042804287FA8000000800FF803E0041003E00000 -CD5C:00000008040804083F8801080208060809083088040804087FE8000800080000 -CD5D:000002081F88020805081888040804087FE8000007F800080008000800080000 -CD5E:000002081F88020805081888040804087FE8000000003EF80208020802080000 -CD5F:000002081F88020805081888040804087FE8000000001F080108011401620000 -CD60:000002081F88020805081888040804087FE8000008000800080008000FF80000 -CD61:000002081F88020805081888040804087FE80000000010F8101010301ECC0000 -CD62:000002081F88020805081888040804087FE800000808087F081C08220F9C0000 -CD63:000002081F88020805081888040804087FE8000003F802000200020003F80000 -CD64:000002081F88020805081888040804087FE8000007F8000807F8040007F80000 -CD65:000002081F88020805081888040804087FE800003EF802083E0820083E080000 -CD66:000002081F88020805081888040804087FE800003EF802883E8820883EF80000 -CD67:000002081F88020805081888040804087FE800003E8802883EF820883EF80000 -CD68:000002081F88020805081888040804087FE800001F0801081F0810141F620000 -CD69:000002081F88020805081888040804087FE800003EF802803EF820803EF80000 -CD6A:000002081F88020805081888040804087FE800003EFC02483E4820483EFC0000 -CD6B:000002081F88020805081888040804087FE800001F08017F1F1C10221F1C0000 -CD6C:000002081F88020805081888040804087FE8000003F802080208020803F80000 -CD6D:000002081F88020805081888040804087FE800000208020803F8020803F80000 -CD6E:000002081F88020805081888040804087FE80000110811081F0811141F620000 -CD6F:000002081F88020805081888040804087FE80000001000100010006801840000 -CD70:000002081F88020805081888040804087FE800000048004800A8011406620000 -CD71:000002081F88020805081888040804087FE80000000003F00408040803F00000 -CD72:000002081F88020805081888040804087FE8000003F80020002000D003080000 -CD73:000002081F88020805081888040804087FE80000004003F8004000A003180000 -CD74:000002081F88020805081888040804087FE8000003F8000803F8000800080000 -CD75:000002081F88020805081888040804087FE8000003F8020003F8020003F80000 -CD76:000002081F88020805081888040804087FE8000000000FF8022002200FF80000 -CD77:000002081F88020805081888040804087FE8000000800FF803E0041003E00000 -CD78:0000010001000FE000400080018002400C2004400440044004407FFC00000000 -CD79:000001000FC0010002800C40044004407FFC00001FF000100010001000100000 -CD7A:000001000FC0010002800C40044004407FFC000000003EF80208020802080000 -CD7B:000001000FC0010002800C40044004407FFC000000001E100210022802C40000 -CD7C:000001000FC0010002800C40044004407FFC000000001000100010001FF00000 -CD7D:000001000FC0010002800C40044004407FFC0000000020F8201020303ECC0000 -CD7E:000001000FC0010002800C40044004407FFC0000202021FC207020883E700000 -CD7F:000001000FC0010002800C40044004407FFC00001FF01000100010001FF00000 -CD80:000001000FC0010002800C40044004407FFC00001FF000101FF010001FF00000 -CD81:000001000FC0010002800C40044004407FFC00003EF802083E0820083E080000 -CD82:000001000FC0010002800C40044004407FFC00003EF802883E8820883EF80000 -CD83:000001000FC0010002800C40044004407FFC00003E8802883EF820883EF80000 -CD84:000001000FC0010002800C40044004407FFC00003E1002103E1020283EC40000 -CD85:000001000FC0010002800C40044004407FFC00003EF802803EF820803EF80000 -CD86:000001000FC0010002800C40044004407FFC00003EFC02483E4820483EFC0000 -CD87:000001000FC0010002800C40044004407FFC00003E2003FC3E7020883E700000 -CD88:000001000FC0010002800C40044004407FFC00001FF01010101010101FF00000 -CD89:000001000FC0010002800C40044004407FFC0000101010101FF010101FF00000 -CD8A:000001000FC0010002800C40044004407FFC0000222022203E2022503E880000 -CD8B:000001000FC0010002800C40044004407FFC000000000100010002800C400000 -CD8C:000001000FC0010002800C40044004407FFC00000000024002400DA033100000 -CD8D:000001000FC0010002800C40044004407FFC0000000007C00820082007C00000 -CD8E:000001000FC0010002800C40044004407FFC0000000007E00080014006200000 -CD8F:000001000FC0010002800C40044004407FFC0000008007E00080014006200000 -CD90:000001000FC0010002800C40044004407FFC00001FF000101FF0001000100000 -CD91:000001000FC0010002800C40044004407FFC00001FF010001FF010001FF00000 -CD92:000001000FC0010002800C40044004407FFC000000001FF0044004401FF00000 -CD93:000001000FC0010002800C40044004407FFC000001001FF007C0082007C00000 -CD94:00000080008007F00020004000C00120061000003FF801000100010001000000 -CD95:000001000FC0010002800C4000007FFC010001001FF000100010001000100000 -CD96:000001000FC0010002800C4000007FFC0100010000003EF80208020802080000 -CD97:000001000FC0010002800C4000007FFC0100010000001E100210022802C40000 -CD98:000001000FC0010002800C40000000007FFC010001001100100010001FF00000 -CD99:000001000FC0010002800C4000007FFC01000100000020F8201020303ECC0000 -CD9A:000001000FC0010002800C4000007FFC01000100202021FC207020883E700000 -CD9B:000001000FC0010002800C4000007FFC010001001FF01000100010001FF00000 -CD9C:000001000FC0010002800C4000007FFC010001001FF000101FF010001FF00000 -CD9D:000001000FC0010002800C4000007FFC010001003EF802083E0820083E080000 -CD9E:000001000FC0010002800C4000007FFC010001003EF802883E8820883EF80000 -CD9F:000001000FC0010002800C4000007FFC010001003E8802883EF820883EF80000 -CDA0:000001000FC0010002800C4000007FFC010001003E1002103E1020283EC40000 -CDA1:000001000FC0010002800C4000007FFC010001003EF802803EF820803EF80000 -CDA2:000001000FC0010002800C4000007FFC010001003EFC02483E4820483EFC0000 -CDA3:000001000FC0010002800C4000007FFC010001003E2003FC3E7020883E700000 -CDA4:000001000FC0010002800C4000007FFC010001001FF01010101010101FF00000 -CDA5:000001000FC0010002800C4000007FFC01000100101010101FF010101FF00000 -CDA6:000001000FC0010002800C4000007FFC01000100222022203E2022503E880000 -CDA7:000001000FC0010002800C4000007FFC0100010000000100010002800C400000 -CDA8:000001000FC0010002800C4000007FFC010001000000024002400DA033100000 -CDA9:000001000FC0010002800C4000007FFC01000100000007C00820082007C00000 -CDAA:000001000FC0010002800C4000007FFC01000100000007E00080014006200000 -CDAB:000001000FC0010002800C4000007FFC01000100008007E00080014006200000 -CDAC:000001000FC0010002800C4000007FFC010001001FF000101FF0001000100000 -CDAD:000001000FC0010002800C4000007FFC010001001FF010001FF010001FF00000 -CDAE:000001000FC0010002800C4000007FFC0100010000001FF0044004401FF00000 -CDAF:000001000FC0010002800C4000007FFC0100010001001FF007C0082007C00000 -CDB0:0000040804083F880108020806080908308800087FE8040804F8040804080000 -CDB1:04083F0804080A08310800087FE8027802080000000007F80008000800080000 -CDB2:04083F0804080A08310800087FE802780208000000003EF80208020802080000 -CDB3:04083F0804080A08310800087FE802780208000000001F080108011401620000 -CDB4:04083F0804080A083108000800087FE80278020802081000100010001FF80000 -CDB5:04083F0804080A08310800087FE8027802080000000020F8201020303ECC0000 -CDB6:04083F0804080A08310800087FE8027802080000202021FC207020883E700000 -CDB7:04083F0804080A08310800087FE802780208000003F802000200020003F80000 -CDB8:04083F0804080A08310800087FE802780208000007F8000807F8040007F80000 -CDB9:04083F0804080A08310800087FE80278020800003EF802083E0820083E080000 -CDBA:04083F0804080A08310800087FE80278020800003EF802883E8820883EF80000 -CDBB:04083F0804080A08310800087FE80278020800003E8802883EF820883EF80000 -CDBC:04083F0804080A08310800087FE80278020800000F8800880F8808140FA20000 -CDBD:04083F0804080A08310800087FE80278020800003EF802803EF820803EF80000 -CDBE:04083F0804080A08310800087FE80278020800003EFC02483E4820483EFC0000 -CDBF:04083F0804080A08310800087FE80278020800003E1002FE3E3820443E380000 -CDC0:04083F0804080A08310800087FE802780208000003F802080208020803F80000 -CDC1:04083F0804080A08310800087FE80278020800000208020803F8020803F80000 -CDC2:04083F0804080A08310800087FE8027802080000210821083F0821143F620000 -CDC3:04083F0804080A08310800087FE8027802080000001000100010006801840000 -CDC4:04083F0804080A08310800087FE80278020800000048004800A8011406620000 -CDC5:04083F0804080A08310800087FE8027802080000000003F00408040803F00000 -CDC6:04083F0804080A08310800087FE802780208000003F80020002000D003080000 -CDC7:04083F0804080A08310800087FE8027802080000004003F8004000A003180000 -CDC8:04083F0804080A08310800087FE802780208000003F8000803F8000800080000 -CDC9:04083F0804080A08310800087FE802780208000003F8020003F8020003F80000 -CDCA:04083F0804080A08310800087FE802780208000000000FF8022002200FF80000 -CDCB:04083F0804080A08310800087FE802780208000000800FF803E0041003E00000 -CDCC:0000040A040A3F8A010A020A060A090A308A000A7FEA040A047A040A040A0000 -CDCD:04283F2804280A28312800287FA805E804280000000007F80008000800080000 -CDCE:04283F2804280A28312800287FA805E80428000000003EF80208020802080000 -CDCF:04283F2804280A28312800287FA805E80428000000001F080108011401620000 -CDD0:04283F2804280A283128002800287FA8042805E804281428100010001FF80000 -CDD1:04283F2804280A28312800287FA805E804280000000020F8201020303ECC0000 -CDD2:04283F2804280A28312800287FA805E804280000202021FC207020883E700000 -CDD3:04283F2804280A28312800287FA805E80428000003F802000200020003F80000 -CDD4:04283F2804280A28312800287FA805E80428000007F8000807F8040007F80000 -CDD5:04283F2804280A28312800287FA805E8042800003EF802083E0820083E080000 -CDD6:04283F2804280A28312800287FA805E8042800003EF802883E8820883EF80000 -CDD7:04283F2804280A28312800287FA805E8042800003E8802883EF820883EF80000 -CDD8:04283F2804280A28312800287FA805E8042800000F8800880F8808140FA20000 -CDD9:04283F2804280A28312800287FA805E8042800003EF802803EF820803EF80000 -CDDA:04283F2804280A28312800287FA805E8042800003EFC02483E4820483EFC0000 -CDDB:04283F2804280A28312800287FA805E8042800003E1002FE3E3820443E380000 -CDDC:04283F2804280A28312800287FA805E80428000003F802080208020803F80000 -CDDD:04283F2804280A28312800287FA805E8042800000208020803F8020803F80000 -CDDE:04283F2804280A28312800287FA805E804280000210821083F0821143F620000 -CDDF:04283F2804280A28312800287FA805E804280000001000100010006801840000 -CDE0:04283F2804280A28312800287FA805E8042800000048004800A8011406620000 -CDE1:04283F2804280A28312800287FA805E804280000000003F00408040803F00000 -CDE2:04283F2804280A28312800287FA805E80428000003F80020002000D003080000 -CDE3:04283F2804280A28312800287FA805E804280000004003F8004000A003180000 -CDE4:04283F2804280A28312800287FA805E80428000003F8000803F8000800080000 -CDE5:04283F2804280A28312800287FA805E80428000003F8020003F8020003F80000 -CDE6:04283F2804280A28312800287FA805E80428000000000FF8022002200FF80000 -CDE7:04283F2804280A28312800287FA805E80428000000800FF803E0041003E00000 -CDE8:0000040804083F880108020806080908308800087FE804080408040804080000 -CDE9:04083F0804080A08310800087FE8020802000000000007F80008000800080000 -CDEA:04083F0804080A08310800087FE802080200000000003EF80208020802080000 -CDEB:04083F0804080A08310800087FE802080200000000001F080108011401620000 -CDEC:04083F0804080A083108000800087FE80208020802081008100010001FF80000 -CDED:04083F0804080A08310800087FE8020802000000000020F8201020303ECC0000 -CDEE:04083F0804080A08310800087FE8020802000000202021FC207020883E700000 -CDEF:04083F0804080A08310800087FE802080200000003F802000200020003F80000 -CDF0:04083F0804080A08310800087FE802080200000007F8000807F8040007F80000 -CDF1:04083F0804080A08310800087FE80208020000003EF802083E0820083E080000 -CDF2:04083F0804080A08310800087FE80208020000003EF802883E8820883EF80000 -CDF3:04083F0804080A08310800087FE80208020000003E8802883EF820883EF80000 -CDF4:04083F0804080A08310800087FE80208020000000F8800880F8808140FA20000 -CDF5:04083F0804080A08310800087FE80208020000003EF802803EF820803EF80000 -CDF6:04083F0804080A08310800087FE80208020000003EFC02483E4820483EFC0000 -CDF7:04083F0804080A08310800087FE80208020000003E1002FE3E3820443E380000 -CDF8:04083F0804080A08310800087FE802080200000003F802080208020803F80000 -CDF9:04083F0804080A08310800087FE80208020000000208020803F8020803F80000 -CDFA:04083F0804080A08310800087FE8020802000000210821083F0821143F620000 -CDFB:04083F0804080A08310800087FE8020802000000001000100010006801840000 -CDFC:04083F0804080A08310800087FE80208020000000048004800A8011406620000 -CDFD:04083F0804080A08310800087FE8020802000000000003F00408040803F00000 -CDFE:04083F0804080A08310800087FE802080200000003F80020002000D003080000 -CDFF:04083F0804080A08310800087FE8020802000000004003F8004000A003180000 -CE00:04083F0804080A08310800087FE802080200000003F8000803F8000800080000 -CE01:04083F0804080A08310800087FE802080200000003F8020003F8020003F80000 -CE02:04083F0804080A08310800087FE802080200000000000FF8022002200FF80000 -CE03:04083F0804080A08310800087FE802080200000000800FF803E0041003E00000 -CE04:00000080008007F00020004000C00120061000007FFC04400440044004400000 -CE05:000001000FC0010002800C4000007FFC044004401FF000100010001000100000 -CE06:000001000FC0010002800C4000007FFC0440044000003EF80208020802080000 -CE07:000001000FC0010002800C4000007FFC0440044000001E100210022802C40000 -CE08:000001000FC0010002800C40000000007FFC044004401440100010001FF00000 -CE09:000001000FC0010002800C4000007FFC04400440000020F8201020303ECC0000 -CE0A:000001000FC0010002800C4000007FFC04400440202021FC207020883E700000 -CE0B:000001000FC0010002800C4000007FFC044004401FF01000100010001FF00000 -CE0C:000001000FC0010002800C4000007FFC044004401FF000101FF010001FF00000 -CE0D:000001000FC0010002800C4000007FFC044004403EF802083E0820083E080000 -CE0E:000001000FC0010002800C4000007FFC044004403EF802883E8820883EF80000 -CE0F:000001000FC0010002800C4000007FFC044004403E8802883EF820883EF80000 -CE10:000001000FC0010002800C4000007FFC044004403E1002103E1020283EC40000 -CE11:000001000FC0010002800C4000007FFC044004403EF802803EF820803EF80000 -CE12:000001000FC0010002800C4000007FFC044004403EFC02483E4820483EFC0000 -CE13:000001000FC0010002800C4000007FFC044004403E2003FC3E7020883E700000 -CE14:000001000FC0010002800C4000007FFC044004401FF01010101010101FF00000 -CE15:000001000FC0010002800C4000007FFC04400440101010101FF010101FF00000 -CE16:000001000FC0010002800C4000007FFC04400440222022203E2022503E880000 -CE17:000001000FC0010002800C4000007FFC0440044000000100010002800C400000 -CE18:000001000FC0010002800C4000007FFC044004400000024002400DA033100000 -CE19:000001000FC0010002800C4000007FFC04400440000007C00820082007C00000 -CE1A:000001000FC0010002800C4000007FFC04400440000007E00080014006200000 -CE1B:000001000FC0010002800C4000007FFC04400440008007E00080014006200000 -CE1C:000001000FC0010002800C4000007FFC044004401FF000101FF0001000100000 -CE1D:000001000FC0010002800C4000007FFC044004401FF010001FF010001FF00000 -CE1E:000001000FC0010002800C4000007FFC0440044000001FF0044004401FF00000 -CE1F:000001000FC0010002800C4000007FFC0440044001001FF007C0082007C00000 -CE20:0000010001000FE000400080018002400C20000000007FFC0000000000000000 -CE21:000001000FC0010002800C40000000007FFC00001FF000100010001000100000 -CE22:000001000FC0010002800C40000000007FFC000000003EF80208020802080000 -CE23:000001000FC0010002800C40000000007FFC000000001E100210022802C40000 -CE24:000001000FC0010002800C40000000007FFC000000001000100010001FF00000 -CE25:000001000FC0010002800C40000000007FFC0000000020F8201020303ECC0000 -CE26:000001000FC0010002800C40000000007FFC0000202021FC207020883E700000 -CE27:000001000FC0010002800C40000000007FFC00001FF01000100010001FF00000 -CE28:000001000FC0010002800C40000000007FFC00001FF000101FF010001FF00000 -CE29:000001000FC0010002800C40000000007FFC00003EF802083E0820083E080000 -CE2A:000001000FC0010002800C40000000007FFC00003EF802883E8820883EF80000 -CE2B:000001000FC0010002800C40000000007FFC00003E8802883EF820883EF80000 -CE2C:000001000FC0010002800C40000000007FFC00003E1002103E1020283EC40000 -CE2D:000001000FC0010002800C40000000007FFC00003EF802803EF820803EF80000 -CE2E:000001000FC0010002800C40000000007FFC00003EFC02483E4820483EFC0000 -CE2F:000001000FC0010002800C40000000007FFC00003E2003FC3E7020883E700000 -CE30:000001000FC0010002800C40000000007FFC00001FF01010101010101FF00000 -CE31:000001000FC0010002800C40000000007FFC0000101010101FF010101FF00000 -CE32:000001000FC0010002800C40000000007FFC0000222022203E2022503E880000 -CE33:000001000FC0010002800C40000000007FFC000000000100010002800C400000 -CE34:000001000FC0010002800C40000000007FFC00000000024002400DA033100000 -CE35:000001000FC0010002800C40000000007FFC0000000007C00820082007C00000 -CE36:000001000FC0010002800C40000000007FFC0000000007E00080014006200000 -CE37:000001000FC0010002800C40000000007FFC0000008007E00080014006200000 -CE38:000001000FC0010002800C40000000007FFC00001FF000101FF0001000100000 -CE39:000001000FC0010002800C40000000007FFC00001FF010001FF010001FF00000 -CE3A:000001000FC0010002800C40000000007FFC000000001FF0044004401FF00000 -CE3B:000001000FC0010002800C40000000007FFC000001001FF007C0082007C00000 -CE3C:00000008040804083F880108020806080908308800087FE80008000800080000 -CE3D:000002081F88020805081888000800087FE8000007F800080008000800080000 -CE3E:000002081F88020805081888000800087FE8000000003EF80208020802080000 -CE3F:000002081F88020805081888000800087FE8000000001F080108011401620000 -CE40:000002081F88020805081888000800087FE8000008000800080008000FF80000 -CE41:000002081F88020805081888000800087FE80000000010F8101010301ECC0000 -CE42:000002081F88020805081888000800087FE800000808087F081C08220F9C0000 -CE43:000002081F88020805081888000800087FE8000003F802000200020003F80000 -CE44:000002081F88020805081888000800087FE8000007F8000807F8040007F80000 -CE45:000002081F88020805081888000800087FE800003EF802083E0820083E080000 -CE46:000002081F88020805081888000800087FE800003EF802883E8820883EF80000 -CE47:000002081F88020805081888000800087FE800003E8802883EF820883EF80000 -CE48:000002081F88020805081888000800087FE800001F0801081F0810141F620000 -CE49:000002081F88020805081888000800087FE800003EF802803EF820803EF80000 -CE4A:000002081F88020805081888000800087FE800003EFC02483E4820483EFC0000 -CE4B:000002081F88020805081888000800087FE800001F08017F1F1C10221F1C0000 -CE4C:000002081F88020805081888000800087FE8000003F802080208020803F80000 -CE4D:000002081F88020805081888000800087FE800000208020803F8020803F80000 -CE4E:000002081F88020805081888000800087FE80000110811081F0811141F620000 -CE4F:000002081F88020805081888000800087FE80000001000100010006801840000 -CE50:000002081F88020805081888000800087FE800000048004800A8011406620000 -CE51:000002081F88020805081888000800087FE80000000003F00408040803F00000 -CE52:000002081F88020805081888000800087FE8000003F80020002000D003080000 -CE53:000002081F88020805081888000800087FE80000004003F8004000A003180000 -CE54:000002081F88020805081888000800087FE8000003F8000803F8000800080000 -CE55:000002081F88020805081888000800087FE8000003F8020003F8020003F80000 -CE56:000002081F88020805081888000800087FE8000000000FF8022002200FF80000 -CE57:000002081F88020805081888000800087FE8000000800FF803E0041003E00000 -CE58:000000000008040804083F880108020806080908308800080008000800080000 -CE59:00000008000808087E0808081408620800080000000007F80008000800080000 -CE5A:00000008000808087E080808140862080008000000003EF80208020802080000 -CE5B:00000008000808087E080808140862080008000000001F080108011401620000 -CE5C:00000008000808087E080808140862080008000800001000100010001FF80000 -CE5D:00000008000808087E0808081408620800080000000020F8201020303ECC0000 -CE5E:00000008000808087E0808081408620800080000202021FC207020883E700000 -CE5F:00000008000808087E080808140862080008000003F802000200020003F80000 -CE60:00000008000808087E080808140862080008000007F8000807F8040007F80000 -CE61:00000008000808087E08080814086208000800003EF802083E0820083E080000 -CE62:00000008000808087E08080814086208000800003EF802883E8820883EF80000 -CE63:00000008000808087E08080814086208000800003E8802883EF820883EF80000 -CE64:00000008000808087E08080814086208000800000F8800880F8808140FA20000 -CE65:00000008000808087E08080814086208000800003EF802803EF820803EF80000 -CE66:00000008000808087E08080814086208000800003EFC02483E4820483EFC0000 -CE67:00000008000808087E08080814086208000800003E1002FE3E3820443E380000 -CE68:00000008000808087E080808140862080008000003F802080208020803F80000 -CE69:00000008000808087E08080814086208000800000208020803F8020803F80000 -CE6A:00000008000808087E0808081408620800080000210821083F0821143F620000 -CE6B:00000008000808087E0808081408620800080000001000100010006801840000 -CE6C:00000008000808087E08080814086208000800000048004800A8011406620000 -CE6D:00000008000808087E0808081408620800080000000003F00408040803F00000 -CE6E:00000008000808087E080808140862080008000003F80020002000D003080000 -CE6F:00000008000808087E0808081408620800080000004003F8004000A003180000 -CE70:00000008000808087E080808140862080008000003F8000803F8000800080000 -CE71:00000008000808087E080808140862080008000003F8020003F8020003F80000 -CE72:00000008000808087E080808140862080008000000000FF8022002200FF80000 -CE73:00000008000808087E080808140862080008000000800FF803E0041003E00000 -CE74:00000000001000101F9000900090009E1F100110021004101810001000100000 -CE75:000000087E08020802087E0E040818086008000007F800080008000800080000 -CE76:000000087E08020802087E0E040818086008000000003EF80208020802080000 -CE77:000000087E08020802087E0E040818086008000000001F080108011401620000 -CE78:000000087E08020802087E0E040818086008000808000800080008000FF80000 -CE79:000000087E08020802087E0E0408180860080000000010F8101010301ECC0000 -CE7A:000000087E08020802087E0E04081808600800000808087F081C08220F9C0000 -CE7B:000000087E08020802087E0E040818086008000003F802000200020003F80000 -CE7C:000000087E08020802087E0E040818086008000007F8000807F8040007F80000 -CE7D:000000087E08020802087E0E04081808600800003EF802083E0820083E080000 -CE7E:000000087E08020802087E0E04081808600800003EF802883E8820883EF80000 -CE7F:000000087E08020802087E0E04081808600800003E8802883EF820883EF80000 -CE80:000000087E08020802087E0E04081808600800001F0801081F0810141F620000 -CE81:000000087E08020802087E0E04081808600800003EF802803EF820803EF80000 -CE82:000000087E08020802087E0E04081808600800003EFC02483E4820483EFC0000 -CE83:000000087E08020802087E0E04081808600800001F08017F1F1C10221F1C0000 -CE84:000000087E08020802087E0E040818086008000003F802080208020803F80000 -CE85:000000087E08020802087E0E04081808600800000208020803F8020803F80000 -CE86:000000087E08020802087E0E0408180860080000110811081F0811141F620000 -CE87:000000087E08020802087E0E0408180860080000001000100010006801840000 -CE88:000000087E08020802087E0E04081808600800000048004800A8011406620000 -CE89:000000087E08020802087E0E0408180860080000000003F00408040803F00000 -CE8A:000000087E08020802087E0E040818086008000003F80020002000D003080000 -CE8B:000000087E08020802087E0E0408180860080000004003F8004000A003180000 -CE8C:000000087E08020802087E0E040818086008000003F8000803F8000800080000 -CE8D:000000087E08020802087E0E040818086008000003F8020003F8020003F80000 -CE8E:000000087E08020802087E0E040818086008000000000FF8022002200FF80000 -CE8F:000000087E08020802087E0E040818086008000000800FF803E0041003E00000 -CE90:00000000001200121F9200920092009E1F120112021204121812001200120000 -CE91:000000287E28022802287E38042818286028000007F800080008000800080000 -CE92:000000287E28022802287E38042818286028000000003EF80208020802080000 -CE93:000000287E28022802287E38042818286028000000003E100210022802C40000 -CE94:000000287E28022802287E38042818286028002808000800080008000FF80000 -CE95:000000287E28022802287E380428182860280000000020F8201020303ECC0000 -CE96:000000287E28022802287E380428182860280000202021FC207020883E700000 -CE97:000000287E28022802287E38042818286028000003F802000200020003F80000 -CE98:000000287E28022802287E38042818286028000007F8000807F8040007F80000 -CE99:000000287E28022802287E3804281828602800003EF802083E0820083E080000 -CE9A:000000287E28022802287E3804281828602800003EF802883E8820883EF80000 -CE9B:000000287E28022802287E3804281828602800003E8802883EF820883EF80000 -CE9C:000000287E28022802287E3804281828602800001F0801081F0810141F620000 -CE9D:000000287E28022802287E3804281828602800003EF802803EF820803EF80000 -CE9E:000000287E28022802287E3804281828602800003EFC02483E4820483EFC0000 -CE9F:000000287E28022802287E3804281828602800003E1002FE3E3820443E380000 -CEA0:000000287E28022802287E38042818286028000003F802080208020803F80000 -CEA1:000000287E28022802287E3804281828602800000208020803F8020803F80000 -CEA2:000000287E28022802287E380428182860280000110811081F0811141F620000 -CEA3:000000287E28022802287E380428182860280000000800080008003400C20000 -CEA4:000000287E28022802287E3804281828602800000048004800A8011406620000 -CEA5:000000287E28022802287E380428182860280000000001F00208020801F00000 -CEA6:000000287E28022802287E38042818286028000003F80020002000D003080000 -CEA7:000000287E28022802287E380428182860280000004003F8004000A003180000 -CEA8:000000287E28022802287E38042818286028000003F8000803F8000800080000 -CEA9:000000287E28022802287E38042818286028000003F8020003F8020003F80000 -CEAA:000000287E28022802287E38042818286028000000000FF8022002200FF80000 -CEAB:000000287E28022802287E38042818286028000000800FF803E0041003E00000 -CEAC:00000000001000101F900090009E00901F10011E021004101810001000100000 -CEAD:000000087E080208020E7E08040E18086008000007F800080008000800080000 -CEAE:000000087E080208020E7E08040E18086008000000003EF80208020802080000 -CEAF:000000087E080208020E7E08040E18086008000000001F080108011401620000 -CEB0:000000087E080208020E7E08040E18086008000008000800080008000FF80000 -CEB1:000000087E080208020E7E08040E180860080000000010F8101010301ECC0000 -CEB2:000000087E080208020E7E08040E1808600800000808087F081C08220F9C0000 -CEB3:000000087E080208020E7E08040E18086008000003F802000200020003F80000 -CEB4:000000087E080208020E7E08040E18086008000007F8000807F8040007F80000 -CEB5:000000087E080208020E7E08040E1808600800003EF802083E0820083E080000 -CEB6:000000087E080208020E7E08040E1808600800003EF802883E8820883EF80000 -CEB7:000000087E080208020E7E08040E1808600800003E8802883EF820883EF80000 -CEB8:000000087E080208020E7E08040E1808600800001F0801081F0810141F620000 -CEB9:000000087E080208020E7E08040E1808600800003EF802803EF820803EF80000 -CEBA:000000087E080208020E7E08040E1808600800003EFC02483E4820483EFC0000 -CEBB:000000087E080208020E7E08040E1808600800001F08017F1F1C10221F1C0000 -CEBC:000000087E080208020E7E08040E18086008000003F802080208020803F80000 -CEBD:000000087E080208020E7E08040E1808600800000208020803F8020803F80000 -CEBE:000000087E080208020E7E08040E180860080000110811081F0811141F620000 -CEBF:000000087E080208020E7E08040E180860080000001000100010006801840000 -CEC0:000000087E080208020E7E08040E1808600800000048004800A8011406620000 -CEC1:000000087E080208020E7E08040E180860080000000003F00408040803F00000 -CEC2:000000087E080208020E7E08040E18086008000003F80020002000D003080000 -CEC3:000000087E080208020E7E08040E180860080000004003F8004000A003180000 -CEC4:000000087E080208020E7E08040E18086008000003F8000803F8000800080000 -CEC5:000000087E080208020E7E08040E18086008000003F8020003F8020003F80000 -CEC6:000000087E080208020E7E08040E18086008000000000FF8022002200FF80000 -CEC7:000000087E080208020E7E08040E18086008000000800FF803E0041003E00000 -CEC8:00000000001200121F920092009E00921F12011E021204121812001200120000 -CEC9:000000287E28022802387E28043818286028000007F800080008000800080000 -CECA:000000287E28022802387E28043818286028000000003EF80208020802080000 -CECB:000000287E28022802387E28043818286028000000003E100210022802C40000 -CECC:000000287E28022802387E28043818286028002808000800080008000FF80000 -CECD:000000287E28022802387E280438182860280000000020F8201020303ECC0000 -CECE:000000287E28022802387E280438182860280000202021FC207020883E700000 -CECF:000000287E28022802387E28043818286028000003F802000200020003F80000 -CED0:000000287E28022802387E28043818286028000007F8000807F8040007F80000 -CED1:000000287E28022802387E2804381828602800003EF802083E0820083E080000 -CED2:000000287E28022802387E2804381828602800003EF802883E8820883EF80000 -CED3:000000287E28022802387E2804381828602800003E8802883EF820883EF80000 -CED4:000000287E28022802387E2804381828602800001F0801081F0810141F620000 -CED5:000000287E28022802387E2804381828602800003EF802803EF820803EF80000 -CED6:000000287E28022802387E2804381828602800003EFC02483E4820483EFC0000 -CED7:000000287E28022802387E2804381828602800003E1002FE3E3820443E380000 -CED8:000000287E28022802387E28043818286028000003F802080208020803F80000 -CED9:000000287E28022802387E2804381828602800000208020803F8020803F80000 -CEDA:000000287E28022802387E280438182860280000110811081F0811141F620000 -CEDB:000000287E28022802387E280438182860280000000800080008003400C20000 -CEDC:000000287E28022802387E2804381828602800000048004800A8011406620000 -CEDD:000000287E28022802387E280438182860280000000001F00208020801F00000 -CEDE:000000287E28022802387E28043818286028000003F80020002000D003080000 -CEDF:000000287E28022802387E280438182860280000004003F8004000A003180000 -CEE0:000000287E28022802387E28043818286028000003F8000803F8000800080000 -CEE1:000000287E28022802387E28043818286028000003F8020003F8020003F80000 -CEE2:000000287E28022802387E28043818286028000000000FF8022002200FF80000 -CEE3:000000287E28022802387E28043818286028000000800FF803E0041003E00000 -CEE4:00000000000200021F8200820082009E1F020102020204021802000200020000 -CEE5:000000087E08020802087E380408180860080000000007F80008000800080000 -CEE6:000000087E08020802087E38040818086008000000003EF80208020802080000 -CEE7:000000087E08020802087E38040818086008000000001F080108011401620000 -CEE8:000000087E08020802087E38040818086008000000001000100010001FF80000 -CEE9:000000087E08020802087E380408180860080000000020F8201020303ECC0000 -CEEA:000000087E08020802087E380408180860080000202021FC207020883E700000 -CEEB:000000087E08020802087E38040818086008000003F802000200020003F80000 -CEEC:000000087E08020802087E38040818086008000007F8000807F8040007F80000 -CEED:000000087E08020802087E3804081808600800003EF802083E0820083E080000 -CEEE:000000087E08020802087E3804081808600800003EF802883E8820883EF80000 -CEEF:000000087E08020802087E3804081808600800003E8802883EF820883EF80000 -CEF0:000000087E08020802087E3804081808600800000F8800880F8808140FA20000 -CEF1:000000087E08020802087E3804081808600800003EF802803EF820803EF80000 -CEF2:000000087E08020802087E3804081808600800003EFC02483E4820483EFC0000 -CEF3:000000087E08020802087E3804081808600800003E1002FE3E3820443E380000 -CEF4:000000087E08020802087E38040818086008000003F802080208020803F80000 -CEF5:000000087E08020802087E3804081808600800000208020803F8020803F80000 -CEF6:000000087E08020802087E380408180860080000210821083F0821143F620000 -CEF7:000000087E08020802087E380408180860080000001000100010006801840000 -CEF8:000000087E08020802087E3804081808600800000048004800A8011406620000 -CEF9:000000087E08020802087E380408180860080000000003F00408040803F00000 -CEFA:000000087E08020802087E38040818086008000003F80020002000D003080000 -CEFB:000000087E08020802087E380408180860080000004003F8004000A003180000 -CEFC:000000087E08020802087E38040818086008000003F8000803F8000800080000 -CEFD:000000087E08020802087E38040818086008000003F8020003F8020003F80000 -CEFE:000000087E08020802087E38040818086008000000000FF8022002200FF80000 -CEFF:000000087E08020802087E38040818086008000000800FF803E0041003E00000 -CF00:00000000000A000A1F8A008A008A00BA1F0A010A020A040A180A000A000A0000 -CF01:000000287E28022802287EE8042818286028000007F800080008000800080000 -CF02:000000287E28022802287EE8042818286028000000003EF80208020802080000 -CF03:000000287E28022802287EE8042818286028000000003E100210022802C40000 -CF04:000000287E28022802287EE8042818286028000008000800080008000FF80000 -CF05:000000287E28022802287EE80428182860280000000020F8201020303ECC0000 -CF06:000000287E28022802287EE80428182860280000202021FC207020883E700000 -CF07:000000287E28022802287EE8042818286028000003F802000200020003F80000 -CF08:000000287E28022802287EE8042818286028000007F8000807F8040007F80000 -CF09:000000287E28022802287EE804281828602800003EF802083E0820083E080000 -CF0A:000000287E28022802287EE804281828602800003EF802883E8820883EF80000 -CF0B:000000287E28022802287EE804281828602800003E8802883EF820883EF80000 -CF0C:000000287E28022802287EE804281828602800001F0801081F0810141F620000 -CF0D:000000287E28022802287EE804281828602800003EF802803EF820803EF80000 -CF0E:000000287E28022802287EE804281828602800003EFC02483E4820483EFC0000 -CF0F:000000287E28022802287EE804281828602800003E1002FE3E3820443E380000 -CF10:000000287E28022802287EE8042818286028000003F802080208020803F80000 -CF11:000000287E28022802287EE804281828602800000208020803F8020803F80000 -CF12:000000287E28022802287EE80428182860280000110811081F0811141F620000 -CF13:000000287E28022802287EE80428182860280000000800080008003400C20000 -CF14:000000287E28022802287EE804281828602800000048004800A8011406620000 -CF15:000000287E28022802287EE80428182860280000000001F00208020801F00000 -CF16:000000287E28022802287EE8042818286028000003F80020002000D003080000 -CF17:000000287E28022802287EE80428182860280000004003F8004000A003180000 -CF18:000000287E28022802287EE8042818286028000003F8000803F8000800080000 -CF19:000000287E28022802287EE8042818286028000003F8020003F8020003F80000 -CF1A:000000287E28022802287EE8042818286028000000000FF8022002200FF80000 -CF1B:000000287E28022802287EE8042818286028000000800FF803E0041003E00000 -CF1C:00000000000200021F820082009E00821F02011E020204021802000200020000 -CF1D:000000087E08020802387E080438180860080000000007F80008000800080000 -CF1E:000000087E08020802387E08043818086008000000003EF80208020802080000 -CF1F:000000087E08020802387E08043818086008000000001F080108011401620000 -CF20:000000087E08020802387E08043818086008000800001000100010001FF80000 -CF21:000000087E08020802387E080438180860080000000020F8201020303ECC0000 -CF22:000000087E08020802387E080438180860080000202021FC207020883E700000 -CF23:000000087E08020802387E08043818086008000003F802000200020003F80000 -CF24:000000087E08020802387E08043818086008000007F8000807F8040007F80000 -CF25:000000087E08020802387E0804381808600800003EF802083E0820083E080000 -CF26:000000087E08020802387E0804381808600800003EF802883E8820883EF80000 -CF27:000000087E08020802387E0804381808600800003E8802883EF820883EF80000 -CF28:000000087E08020802387E0804381808600800000F8800880F8808140FA20000 -CF29:000000087E08020802387E0804381808600800003EF802803EF820803EF80000 -CF2A:000000087E08020802387E0804381808600800003EFC02483E4820483EFC0000 -CF2B:000000087E08020802387E0804381808600800003E1002FE3E3820443E380000 -CF2C:000000087E08020802387E08043818086008000003F802080208020803F80000 -CF2D:000000087E08020802387E0804381808600800000208020803F8020803F80000 -CF2E:000000087E08020802387E080438180860080000210821083F0821143F620000 -CF2F:000000087E08020802387E080438180860080000001000100010006801840000 -CF30:000000087E08020802387E0804381808600800000048004800A8011406620000 -CF31:000000087E08020802387E080438180860080000000003F00408040803F00000 -CF32:000000087E08020802387E08043818086008000003F80020002000D003080000 -CF33:000000087E08020802387E080438180860080000004003F8004000A003180000 -CF34:000000087E08020802387E08043818086008000003F8000803F8000800080000 -CF35:000000087E08020802387E08043818086008000003F8020003F8020003F80000 -CF36:000000087E08020802387E08043818086008000000000FF8022002200FF80000 -CF37:000000087E08020802387E08043818086008000000800FF803E0041003E00000 -CF38:00000000000A000A1F8A008A00BA008A1F0A013A020A040A180A000A000A0000 -CF39:000000287E28022802E87E2804E818286028000007F800080008000800080000 -CF3A:000000287E28022802E87E2804E818286028000000003EF80208020802080000 -CF3B:000000287E28022802E87E2804E818286028000000003E100210022802C40000 -CF3C:000000287E28022802E87E2804E818286028002808000800080008000FF80000 -CF3D:000000287E28022802E87E2804E8182860280000000020F8201020303ECC0000 -CF3E:000000287E28022802E87E2804E8182860280000202021FC207020883E700000 -CF3F:000000287E28022802E87E2804E818286028000003F802000200020003F80000 -CF40:000000287E28022802E87E2804E818286028000007F8000807F8040007F80000 -CF41:000000287E28022802E87E2804E81828602800003EF802083E0820083E080000 -CF42:000000287E28022802E87E2804E81828602800003EF802883E8820883EF80000 -CF43:000000287E28022802E87E2804E81828602800003E8802883EF820883EF80000 -CF44:000000287E28022802E87E2804E81828602800001F0801081F0810141F620000 -CF45:000000287E28022802E87E2804E81828602800003EF802803EF820803EF80000 -CF46:000000287E28022802E87E2804E81828602800003EFC02483E4820483EFC0000 -CF47:000000287E28022802E87E2804E81828602800003E1002FE3E3820443E380000 -CF48:000000287E28022802E87E2804E818286028000003F802080208020803F80000 -CF49:000000287E28022802E87E2804E81828602800000208020803F8020803F80000 -CF4A:000000287E28022802E87E2804E8182860280000110811081F0811141F620000 -CF4B:000000287E28022802E87E2804E8182860280000000800080008003400C20000 -CF4C:000000287E28022802E87E2804E81828602800000048004800A8011406620000 -CF4D:000000287E28022802E87E2804E8182860280000000001F00208020801F00000 -CF4E:000000287E28022802E87E2804E818286028000003F80020002000D003080000 -CF4F:000000287E28022802E87E2804E8182860280000004003F8004000A003180000 -CF50:000000287E28022802E87E2804E818286028000003F8000803F8000800080000 -CF51:000000287E28022802E87E2804E818286028000003F8020003F8020003F80000 -CF52:000000287E28022802E87E2804E818286028000000000FF8022002200FF80000 -CF53:000000287E28022802E87E2804E818286028000000800FF803E0041003E00000 -CF54:00000000000000003FF8000800083FF8000802080208020002007FFC00000000 -CF55:000000001FF000101FF00010011001007FFC00001FF000100010001000100000 -CF56:000000001FF000101FF00010011001007FFC000000003EF80208020802080000 -CF57:000000001FF000101FF00010011001007FFC000000001E100210022802C40000 -CF58:000000001FF000101FF00010011001007FFC000000001000100010001FF00000 -CF59:000000001FF000101FF00010011001007FFC0000000020F8201020303ECC0000 -CF5A:000000001FF000101FF00010011001007FFC0000202021FC207020883E700000 -CF5B:000000001FF000101FF00010011001007FFC00001FF01000100010001FF00000 -CF5C:000000001FF000101FF00010011001007FFC00001FF000101FF010001FF00000 -CF5D:000000001FF000101FF00010011001007FFC00003EF802083E0820083E080000 -CF5E:000000001FF000101FF00010011001007FFC00003EF802883E8820883EF80000 -CF5F:000000001FF000101FF00010011001007FFC00003E8802883EF820883EF80000 -CF60:000000001FF000101FF00010011001007FFC00003E1002103E1020283EC40000 -CF61:000000001FF000101FF00010011001007FFC00003EF802803EF820803EF80000 -CF62:000000001FF000101FF00010011001007FFC00003EFC02483E4820483EFC0000 -CF63:000000001FF000101FF00010011001007FFC00003E2003FC3E7020883E700000 -CF64:000000001FF000101FF00010011001007FFC00001FF01010101010101FF00000 -CF65:000000001FF000101FF00010011001007FFC0000101010101FF010101FF00000 -CF66:000000001FF000101FF00010011001007FFC0000222022203E2022503E880000 -CF67:000000001FF000101FF00010011001007FFC000000000100010002800C400000 -CF68:000000001FF000101FF00010011001007FFC00000000024002400DA033100000 -CF69:000000001FF000101FF00010011001007FFC0000000007C00820082007C00000 -CF6A:000000001FF000101FF00010011001007FFC0000000007E00080014006200000 -CF6B:000000001FF000101FF00010011001007FFC0000008007E00080014006200000 -CF6C:000000001FF000101FF00010011001007FFC00001FF000101FF0001000100000 -CF6D:000000001FF000101FF00010011001007FFC00001FF010001FF010001FF00000 -CF6E:000000001FF000101FF00010011001007FFC000000001FF0044004401FF00000 -CF6F:000000001FF000101FF00010011001007FFC000001001FF007C0082007C00000 -CF70:00000000001000103FD0005000503FDE0450045004107FD00010001000100000 -CF71:000000083F8800883F8E0088048804087FE8000007F800080008000800080000 -CF72:000000083F8800883F8E0088048804087FE8000000003EF80208020802080000 -CF73:000000083F8800883F8E0088048804087FE8000000001F080108011401620000 -CF74:000000083F8800883F8E0088048804087FE8000008000800080008000FF80000 -CF75:000000083F8800883F8E0088048804087FE80000000010F8101010301ECC0000 -CF76:000000083F8800883F8E0088048804087FE800000808087F081C08220F9C0000 -CF77:000000083F8800883F8E0088048804087FE8000003F802000200020003F80000 -CF78:000000083F8800883F8E0088048804087FE8000007F8000807F8040007F80000 -CF79:000000083F8800883F8E0088048804087FE800003EF802083E0820083E080000 -CF7A:000000083F8800883F8E0088048804087FE800003EF802883E8820883EF80000 -CF7B:000000083F8800883F8E0088048804087FE800003E8802883EF820883EF80000 -CF7C:000000083F8800883F8E0088048804087FE800001F0801081F0810141F620000 -CF7D:000000083F8800883F8E0088048804087FE800003EF802803EF820803EF80000 -CF7E:000000083F8800883F8E0088048804087FE800003EFC02483E4820483EFC0000 -CF7F:000000083F8800883F8E0088048804087FE800001F08017F1F1C10221F1C0000 -CF80:000000083F8800883F8E0088048804087FE8000003F802080208020803F80000 -CF81:000000083F8800883F8E0088048804087FE800000208020803F8020803F80000 -CF82:000000083F8800883F8E0088048804087FE80000110811081F0811141F620000 -CF83:000000083F8800883F8E0088048804087FE80000001000100010006801840000 -CF84:000000083F8800883F8E0088048804087FE800000048004800A8011406620000 -CF85:000000083F8800883F8E0088048804087FE80000000003F00408040803F00000 -CF86:000000083F8800883F8E0088048804087FE8000003F80020002000D003080000 -CF87:000000083F8800883F8E0088048804087FE80000004003F8004000A003180000 -CF88:000000083F8800883F8E0088048804087FE8000003F8000803F8000800080000 -CF89:000000083F8800883F8E0088048804087FE8000003F8020003F8020003F80000 -CF8A:000000083F8800883F8E0088048804087FE8000000000FF8022002200FF80000 -CF8B:000000083F8800883F8E0088048804087FE8000000800FF803E0041003E00000 -CF8C:00000000001200123FD2005200523FDE0452045204127FD20012001200120000 -CF8D:000000283FA800A83FB800A804A804287FA8000007F800080008000800080000 -CF8E:000000283FA800A83FB800A804A804287FA8000000003EF80208020802080000 -CF8F:000000283FA800A83FB800A804A804287FA8000000001F080108011401620000 -CF90:000000283FA800A83FB800A804A804287FA8000008000800080008000FF80000 -CF91:000000283FA800A83FB800A804A804287FA80000000010F8101010301ECC0000 -CF92:000000283FA800A83FB800A804A804287FA800000808087F081C08220F9C0000 -CF93:000000283FA800A83FB800A804A804287FA8000003F802000200020003F80000 -CF94:000000283FA800A83FB800A804A804287FA8000007F8000807F8040007F80000 -CF95:000000283FA800A83FB800A804A804287FA800003EF802083E0820083E080000 -CF96:000000283FA800A83FB800A804A804287FA800003EF802883E8820883EF80000 -CF97:000000283FA800A83FB800A804A804287FA800003E8802883EF820883EF80000 -CF98:000000283FA800A83FB800A804A804287FA800001F0801081F0810141F620000 -CF99:000000283FA800A83FB800A804A804287FA800003EF802803EF820803EF80000 -CF9A:000000283FA800A83FB800A804A804287FA800003EFC02483E4820483EFC0000 -CF9B:000000283FA800A83FB800A804A804287FA800001F08017F1F1C10221F1C0000 -CF9C:000000283FA800A83FB800A804A804287FA8000003F802080208020803F80000 -CF9D:000000283FA800A83FB800A804A804287FA800000208020803F8020803F80000 -CF9E:000000283FA800A83FB800A804A804287FA80000110811081F0811141F620000 -CF9F:000000283FA800A83FB800A804A804287FA80000001000100010006801840000 -CFA0:000000283FA800A83FB800A804A804287FA800000048004800A8011406620000 -CFA1:000000283FA800A83FB800A804A804287FA80000000003F00408040803F00000 -CFA2:000000283FA800A83FB800A804A804287FA8000003F80020002000D003080000 -CFA3:000000283FA800A83FB800A804A804287FA80000004003F8004000A003180000 -CFA4:000000283FA800A83FB800A804A804287FA8000003F8000803F8000800080000 -CFA5:000000283FA800A83FB800A804A804287FA8000003F8020003F8020003F80000 -CFA6:000000283FA800A83FB800A804A804287FA8000000000FF8022002200FF80000 -CFA7:000000283FA800A83FB800A804A804287FA8000000800FF803E0041003E00000 -CFA8:00000000000400043FC4004400443FC40444044404047FF40004000400040000 -CFA9:000000083F8800883F880088048804087FE8000007F800080008000800080000 -CFAA:000000083F8800883F880088048804087FE8000000003EF80208020802080000 -CFAB:000000083F8800883F880088048804087FE8000000001F080108011401620000 -CFAC:000000083F8800883F880088048804087FE8000008000800080008000FF80000 -CFAD:000000083F8800883F880088048804087FE80000000010F8101010301ECC0000 -CFAE:000000083F8800883F880088048804087FE800000808087F081C08220F9C0000 -CFAF:000000083F8800883F880088048804087FE8000003F802000200020003F80000 -CFB0:000000083F8800883F880088048804087FE8000007F8000807F8040007F80000 -CFB1:000000083F8800883F880088048804087FE800003EF802083E0820083E080000 -CFB2:000000083F8800883F880088048804087FE800003EF802883E8820883EF80000 -CFB3:000000083F8800883F880088048804087FE800003E8802883EF820883EF80000 -CFB4:000000083F8800883F880088048804087FE800001F0801081F0810141F620000 -CFB5:000000083F8800883F880088048804087FE800003EF802803EF820803EF80000 -CFB6:000000083F8800883F880088048804087FE800003EFC02483E4820483EFC0000 -CFB7:000000083F8800883F880088048804087FE800001F08017F1F1C10221F1C0000 -CFB8:000000083F8800883F880088048804087FE8000003F802080208020803F80000 -CFB9:000000083F8800883F880088048804087FE800000208020803F8020803F80000 -CFBA:000000083F8800883F880088048804087FE80000110811081F0811141F620000 -CFBB:000000083F8800883F880088048804087FE80000001000100010006801840000 -CFBC:000000083F8800883F880088048804087FE800000048004800A8011406620000 -CFBD:000000083F8800883F880088048804087FE80000000003F00408040803F00000 -CFBE:000000083F8800883F880088048804087FE8000003F80020002000D003080000 -CFBF:000000083F8800883F880088048804087FE80000004003F8004000A003180000 -CFC0:000000083F8800883F880088048804087FE8000003F8000803F8000800080000 -CFC1:000000083F8800883F880088048804087FE8000003F8020003F8020003F80000 -CFC2:000000083F8800883F880088048804087FE8000000000FF8022002200FF80000 -CFC3:000000083F8800883F880088048804087FE8000000800FF803E0041003E00000 -CFC4:00000000000000003FF8000800083FF8000808880888088008807FFC00000000 -CFC5:000000001FF000101FF00010049004807FFC00001FF000100010001000100000 -CFC6:000000001FF000101FF00010049004807FFC000000003EF80208020802080000 -CFC7:000000001FF000101FF00010049004807FFC000000001E100210022802C40000 -CFC8:000000001FF000101FF00010049004807FFC000000001000100010001FF00000 -CFC9:000000001FF000101FF00010049004807FFC0000000020F8201020303ECC0000 -CFCA:000000001FF000101FF00010049004807FFC0000202021FC207020883E700000 -CFCB:000000001FF000101FF00010049004807FFC00001FF01000100010001FF00000 -CFCC:000000001FF000101FF00010049004807FFC00001FF000101FF010001FF00000 -CFCD:000000001FF000101FF00010049004807FFC00003EF802083E0820083E080000 -CFCE:000000001FF000101FF00010049004807FFC00003EF802883E8820883EF80000 -CFCF:000000001FF000101FF00010049004807FFC00003E8802883EF820883EF80000 -CFD0:000000001FF000101FF00010049004807FFC00003E1002103E1020283EC40000 -CFD1:000000001FF000101FF00010049004807FFC00003EF802803EF820803EF80000 -CFD2:000000001FF000101FF00010049004807FFC00003EFC02483E4820483EFC0000 -CFD3:000000001FF000101FF00010049004807FFC00003E2003FC3E7020883E700000 -CFD4:000000001FF000101FF00010049004807FFC00001FF01010101010101FF00000 -CFD5:000000001FF000101FF00010049004807FFC0000101010101FF010101FF00000 -CFD6:000000001FF000101FF00010049004807FFC0000222022203E2022503E880000 -CFD7:000000001FF000101FF00010049004807FFC000000000100010002800C400000 -CFD8:000000001FF000101FF00010049004807FFC00000000024002400DA033100000 -CFD9:000000001FF000101FF00010049004807FFC0000000007C00820082007C00000 -CFDA:000000001FF000101FF00010049004807FFC0000000007E00080014006200000 -CFDB:000000001FF000101FF00010049004807FFC0000008007E00080014006200000 -CFDC:000000001FF000101FF00010049004807FFC00001FF000101FF0001000100000 -CFDD:000000001FF000101FF00010049004807FFC00001FF010001FF010001FF00000 -CFDE:000000001FF000101FF00010049004807FFC000000001FF0044004401FF00000 -CFDF:000000001FF000101FF00010049004807FFC000001001FF007C0082007C00000 -CFE0:0000000000003FF8000800083FF80008000800003FF801000100010001000000 -CFE1:000000001FF000101FF0001000107FFC010001001FF000100010001000100000 -CFE2:000000001FF000101FF0001000107FFC0100010000003EF80208020802080000 -CFE3:000000001FF000101FF0001000107FFC0100010000001E100210022802C40000 -CFE4:000000001FF000101FF00010001000007FFC010001001100100010001FF00000 -CFE5:000000001FF000101FF0001000107FFC01000100000020F8201020303ECC0000 -CFE6:000000001FF000101FF0001000107FFC01000100202021FC207020883E700000 -CFE7:000000001FF000101FF0001000107FFC010001001FF01000100010001FF00000 -CFE8:000000001FF000101FF0001000107FFC010001001FF000101FF010001FF00000 -CFE9:000000001FF000101FF0001000107FFC010001003EF802083E0820083E080000 -CFEA:000000001FF000101FF0001000107FFC010001003EF802883E8820883EF80000 -CFEB:000000001FF000101FF0001000107FFC010001003E8802883EF820883EF80000 -CFEC:000000001FF000101FF0001000107FFC010001003E1002103E1020283EC40000 -CFED:000000001FF000101FF0001000107FFC010001003EF802803EF820803EF80000 -CFEE:000000001FF000101FF0001000107FFC010001003EFC02483E4820483EFC0000 -CFEF:000000001FF000101FF0001000107FFC010001003E2003FC3E7020883E700000 -CFF0:000000001FF000101FF0001000107FFC010001001FF01010101010101FF00000 -CFF1:000000001FF000101FF0001000107FFC01000100101010101FF010101FF00000 -CFF2:000000001FF000101FF0001000107FFC01000100222022203E2022503E880000 -CFF3:000000001FF000101FF0001000107FFC0100010000000100010002800C400000 -CFF4:000000001FF000101FF0001000107FFC010001000000024002400DA033100000 -CFF5:000000001FF000101FF0001000107FFC01000100000007C00820082007C00000 -CFF6:000000001FF000101FF0001000107FFC01000100000007E00080014006200000 -CFF7:000000001FF000101FF0001000107FFC01000100008007E00080014006200000 -CFF8:000000001FF000101FF0001000107FFC010001001FF000101FF0001000100000 -CFF9:000000001FF000101FF0001000107FFC010001001FF010001FF010001FF00000 -CFFA:000000001FF000101FF0001000107FFC0100010000001FF0044004401FF00000 -CFFB:000000001FF000101FF0001000107FFC0100010001001FF007C0082007C00000 -CFFC:0000000800083FC8004800483FC80048004800087FE8040804F8040804080000 -CFFD:00083F8800883F88008800887FE8027802080000000007F80008000800080000 -CFFE:00083F8800883F88008800887FE802780208000000003EF80208020802080000 -CFFF:00083F8800883F88008800887FE802780208000000001F080108011401620000 -D000:00083F8800883F880088008800087FE80278020802081000100010001FF80000 -D001:00083F8800883F88008800887FE8027802080000000020F8201020303ECC0000 -D002:00083F8800883F88008800887FE8027802080000202021FC207020883E700000 -D003:00083F8800883F88008800887FE802780208000003F802000200020003F80000 -D004:00083F8800883F88008800887FE802780208000007F8000807F8040007F80000 -D005:00083F8800883F88008800887FE80278020800003EF802083E0820083E080000 -D006:00083F8800883F88008800887FE80278020800003EF802883E8820883EF80000 -D007:00083F8800883F88008800887FE80278020800003E8802883EF820883EF80000 -D008:00083F8800883F88008800887FE80278020800000F8800880F8808140FA20000 -D009:00083F8800883F88008800887FE80278020800003EF802803EF820803EF80000 -D00A:00083F8800883F88008800887FE80278020800003EFC02483E4820483EFC0000 -D00B:00083F8800883F88008800887FE80278020800003E1002FE3E3820443E380000 -D00C:00083F8800883F88008800887FE802780208000003F802080208020803F80000 -D00D:00083F8800883F88008800887FE80278020800000208020803F8020803F80000 -D00E:00083F8800883F88008800887FE8027802080000210821083F0821143F620000 -D00F:00083F8800883F88008800887FE8027802080000001000100010006801840000 -D010:00083F8800883F88008800887FE80278020800000048004800A8011406620000 -D011:00083F8800883F88008800887FE8027802080000000003F00408040803F00000 -D012:00083F8800883F88008800887FE802780208000003F80020002000D003080000 -D013:00083F8800883F88008800887FE8027802080000004003F8004000A003180000 -D014:00083F8800883F88008800887FE802780208000003F8000803F8000800080000 -D015:00083F8800883F88008800887FE802780208000003F8020003F8020003F80000 -D016:00083F8800883F88008800887FE802780208000000000FF8022002200FF80000 -D017:00083F8800883F88008800887FE802780208000000800FF803E0041003E00000 -D018:0000000A000A3FCA004A004A3FCA004A004A000A7FEA040A047A040A040A0000 -D019:00283FA800A83FA800A800A87FA805E804280000000007F80008000800080000 -D01A:00283FA800A83FA800A800A87FA805E80428000000003EF80208020802080000 -D01B:00283FA800A83FA800A800A87FA805E80428000000001F080108011401620000 -D01C:00283FA800A83FA800A800A800287FA8042805E804281428100010001FF80000 -D01D:00283FA800A83FA800A800A87FA805E804280000000020F8201020303ECC0000 -D01E:00283FA800A83FA800A800A87FA805E804280000202021FC207020883E700000 -D01F:00283FA800A83FA800A800A87FA805E80428000003F802000200020003F80000 -D020:00283FA800A83FA800A800A87FA805E80428000007F8000807F8040007F80000 -D021:00283FA800A83FA800A800A87FA805E8042800003EF802083E0820083E080000 -D022:00283FA800A83FA800A800A87FA805E8042800003EF802883E8820883EF80000 -D023:00283FA800A83FA800A800A87FA805E8042800003E8802883EF820883EF80000 -D024:00283FA800A83FA800A800A87FA805E8042800000F8800880F8808140FA20000 -D025:00283FA800A83FA800A800A87FA805E8042800003EF802803EF820803EF80000 -D026:00283FA800A83FA800A800A87FA805E8042800003EFC02483E4820483EFC0000 -D027:00283FA800A83FA800A800A87FA805E8042800003E1002FE3E3820443E380000 -D028:00283FA800A83FA800A800A87FA805E80428000003F802080208020803F80000 -D029:00283FA800A83FA800A800A87FA805E8042800000208020803F8020803F80000 -D02A:00283FA800A83FA800A800A87FA805E804280000210821083F0821143F620000 -D02B:00283FA800A83FA800A800A87FA805E804280000001000100010006801840000 -D02C:00283FA800A83FA800A800A87FA805E8042800000048004800A8011406620000 -D02D:00283FA800A83FA800A800A87FA805E804280000000003F00408040803F00000 -D02E:00283FA800A83FA800A800A87FA805E80428000003F80020002000D003080000 -D02F:00283FA800A83FA800A800A87FA805E804280000004003F8004000A003180000 -D030:00283FA800A83FA800A800A87FA805E80428000003F8000803F8000800080000 -D031:00283FA800A83FA800A800A87FA805E80428000003F8020003F8020003F80000 -D032:00283FA800A83FA800A800A87FA805E80428000000000FF8022002200FF80000 -D033:00283FA800A83FA800A800A87FA805E80428000000800FF803E0041003E00000 -D034:0000000800083FC8004800483FC80048004800087FE804080408040804080000 -D035:00083F8800883F88008800887FE8020802000000000007F80008000800080000 -D036:00083F8800883F88008800887FE802080200000000003EF80208020802080000 -D037:00083F8800883F88008800887FE802080200000000001F080108011401620000 -D038:00083F8800883F880088008800087FE80208020802081008100010001FF80000 -D039:00083F8800883F88008800887FE8020802000000000020F8201020303ECC0000 -D03A:00083F8800883F88008800887FE8020802000000202021FC207020883E700000 -D03B:00083F8800883F88008800887FE802080200000003F802000200020003F80000 -D03C:00083F8800883F88008800887FE802080200000007F8000807F8040007F80000 -D03D:00083F8800883F88008800887FE80208020000003EF802083E0820083E080000 -D03E:00083F8800883F88008800887FE80208020000003EF802883E8820883EF80000 -D03F:00083F8800883F88008800887FE80208020000003E8802883EF820883EF80000 -D040:00083F8800883F88008800887FE80208020000000F8800880F8808140FA20000 -D041:00083F8800883F88008800887FE80208020000003EF802803EF820803EF80000 -D042:00083F8800883F88008800887FE80208020000003EFC02483E4820483EFC0000 -D043:00083F8800883F88008800887FE80208020000003E1002FE3E3820443E380000 -D044:00083F8800883F88008800887FE802080200000003F802080208020803F80000 -D045:00083F8800883F88008800887FE80208020000000208020803F8020803F80000 -D046:00083F8800883F88008800887FE8020802000000210821083F0821143F620000 -D047:00083F8800883F88008800887FE8020802000000001000100010006801840000 -D048:00083F8800883F88008800887FE80208020000000048004800A8011406620000 -D049:00083F8800883F88008800887FE8020802000000000003F00408040803F00000 -D04A:00083F8800883F88008800887FE802080200000003F80020002000D003080000 -D04B:00083F8800883F88008800887FE8020802000000004003F8004000A003180000 -D04C:00083F8800883F88008800887FE802080200000003F8000803F8000800080000 -D04D:00083F8800883F88008800887FE802080200000003F8020003F8020003F80000 -D04E:00083F8800883F88008800887FE802080200000000000FF8022002200FF80000 -D04F:00083F8800883F88008800887FE802080200000000800FF803E0041003E00000 -D050:0000000000003FF8000800083FF80008000800007FFC04400440044004400000 -D051:000000001FF000101FF0001000107FFC044004401FF000100010001000100000 -D052:000000001FF000101FF0001000107FFC0440044000003EF80208020802080000 -D053:000000001FF000101FF0001000107FFC0440044000001E100210022802C40000 -D054:000000001FF000101FF00010001000007FFC044004401440100010001FF00000 -D055:000000001FF000101FF0001000107FFC04400440000020F8201020303ECC0000 -D056:000000001FF000101FF0001000107FFC04400440202021FC207020883E700000 -D057:000000001FF000101FF0001000107FFC044004401FF01000100010001FF00000 -D058:000000001FF000101FF0001000107FFC044004401FF000101FF010001FF00000 -D059:000000001FF000101FF0001000107FFC044004403EF802083E0820083E080000 -D05A:000000001FF000101FF0001000107FFC044004403EF802883E8820883EF80000 -D05B:000000001FF000101FF0001000107FFC044004403E8802883EF820883EF80000 -D05C:000000001FF000101FF0001000107FFC044004403E1002103E1020283EC40000 -D05D:000000001FF000101FF0001000107FFC044004403EF802803EF820803EF80000 -D05E:000000001FF000101FF0001000107FFC044004403EFC02483E4820483EFC0000 -D05F:000000001FF000101FF0001000107FFC044004403E2003FC3E7020883E700000 -D060:000000001FF000101FF0001000107FFC044004401FF01010101010101FF00000 -D061:000000001FF000101FF0001000107FFC04400440101010101FF010101FF00000 -D062:000000001FF000101FF0001000107FFC04400440222022203E2022503E880000 -D063:000000001FF000101FF0001000107FFC0440044000000100010002800C400000 -D064:000000001FF000101FF0001000107FFC044004400000024002400DA033100000 -D065:000000001FF000101FF0001000107FFC04400440000007C00820082007C00000 -D066:000000001FF000101FF0001000107FFC04400440000007E00080014006200000 -D067:000000001FF000101FF0001000107FFC04400440008007E00080014006200000 -D068:000000001FF000101FF0001000107FFC044004401FF000101FF0001000100000 -D069:000000001FF000101FF0001000107FFC044004401FF010001FF010001FF00000 -D06A:000000001FF000101FF0001000107FFC0440044000001FF0044004401FF00000 -D06B:000000001FF000101FF0001000107FFC0440044001001FF007C0082007C00000 -D06C:00000000000000003FF8000800083FF80008000800087FFC0000000000000000 -D06D:000000001FF000101FF00010001000007FFC00001FF000100010001000100000 -D06E:000000001FF000101FF00010001000007FFC000000003EF80208020802080000 -D06F:000000001FF000101FF00010001000007FFC000000001E100210022802C40000 -D070:000000001FF000101FF00010001000007FFC000000001000100010001FF00000 -D071:000000001FF000101FF00010001000007FFC0000000020F8201020303ECC0000 -D072:000000001FF000101FF00010001000007FFC0000202021FC207020883E700000 -D073:000000001FF000101FF00010001000007FFC00001FF01000100010001FF00000 -D074:000000001FF000101FF00010001000007FFC00001FF000101FF010001FF00000 -D075:000000001FF000101FF00010001000007FFC00003EF802083E0820083E080000 -D076:000000001FF000101FF00010001000007FFC00003EF802883E8820883EF80000 -D077:000000001FF000101FF00010001000007FFC00003E8802883EF820883EF80000 -D078:000000001FF000101FF00010001000007FFC00003E1002103E1020283EC40000 -D079:000000001FF000101FF00010001000007FFC00003EF802803EF820803EF80000 -D07A:000000001FF000101FF00010001000007FFC00003EFC02483E4820483EFC0000 -D07B:000000001FF000101FF00010001000007FFC00003E2003FC3E7020883E700000 -D07C:000000001FF000101FF00010001000007FFC00001FF01010101010101FF00000 -D07D:000000001FF000101FF00010001000007FFC0000101010101FF010101FF00000 -D07E:000000001FF000101FF00010001000007FFC0000222022203E2022503E880000 -D07F:000000001FF000101FF00010001000007FFC000000000100010002800C400000 -D080:000000001FF000101FF00010001000007FFC00000000024002400DA033100000 -D081:000000001FF000101FF00010001000007FFC0000000007C00820082007C00000 -D082:000000001FF000101FF00010001000007FFC0000000007E00080014006200000 -D083:000000001FF000101FF00010001000007FFC0000008007E00080014006200000 -D084:000000001FF000101FF00010001000007FFC00001FF000101FF0001000100000 -D085:000000001FF000101FF00010001000007FFC00001FF010001FF010001FF00000 -D086:000000001FF000101FF00010001000007FFC000000001FF0044004401FF00000 -D087:000000001FF000101FF00010001000007FFC000001001FF007C0082007C00000 -D088:00000000000800083FC8004800483FC80048004800087FE80008000800080000 -D089:000000083F8800883F880088008800087FE8000007F800080008000800080000 -D08A:000000083F8800883F880088008800087FE8000000003EF80208020802080000 -D08B:000000083F8800883F880088008800087FE8000000001F080108011401620000 -D08C:000000083F8800883F880088008800087FE8000008000800080008000FF80000 -D08D:000000083F8800883F880088008800087FE80000000010F8101010301ECC0000 -D08E:000000083F8800883F880088008800087FE800000808087F081C08220F9C0000 -D08F:000000083F8800883F880088008800087FE8000003F802000200020003F80000 -D090:000000083F8800883F880088008800087FE8000007F8000807F8040007F80000 -D091:000000083F8800883F880088008800087FE800003EF802083E0820083E080000 -D092:000000083F8800883F880088008800087FE800003EF802883E8820883EF80000 -D093:000000083F8800883F880088008800087FE800003E8802883EF820883EF80000 -D094:000000083F8800883F880088008800087FE800001F0801081F0810141F620000 -D095:000000083F8800883F880088008800087FE800003EF802803EF820803EF80000 -D096:000000083F8800883F880088008800087FE800003EFC02483E4820483EFC0000 -D097:000000083F8800883F880088008800087FE800001F08017F1F1C10221F1C0000 -D098:000000083F8800883F880088008800087FE8000003F802080208020803F80000 -D099:000000083F8800883F880088008800087FE800000208020803F8020803F80000 -D09A:000000083F8800883F880088008800087FE80000110811081F0811141F620000 -D09B:000000083F8800883F880088008800087FE80000001000100010006801840000 -D09C:000000083F8800883F880088008800087FE800000048004800A8011406620000 -D09D:000000083F8800883F880088008800087FE80000000003F00408040803F00000 -D09E:000000083F8800883F880088008800087FE8000003F80020002000D003080000 -D09F:000000083F8800883F880088008800087FE80000004003F8004000A003180000 -D0A0:000000083F8800883F880088008800087FE8000003F8000803F8000800080000 -D0A1:000000083F8800883F880088008800087FE8000003F8020003F8020003F80000 -D0A2:000000083F8800883F880088008800087FE8000000000FF8022002200FF80000 -D0A3:000000083F8800883F880088008800087FE8000000800FF803E0041003E00000 -D0A4:00000000000800081F880088008800881F080108020804081808000800080000 -D0A5:000000087E08020802087E080408180860080000000007F80008000800080000 -D0A6:000000087E08020802087E08040818086008000000003EF80208020802080000 -D0A7:000000087E08020802087E08040818086008000000001F080108011401620000 -D0A8:000000087E08020802087E08040818086008000800001000100010001FF80000 -D0A9:000000087E08020802087E080408180860080000000020F8201020303ECC0000 -D0AA:000000087E08020802087E080408180860080000202021FC207020883E700000 -D0AB:000000087E08020802087E08040818086008000003F802000200020003F80000 -D0AC:000000087E08020802087E08040818086008000007F8000807F8040007F80000 -D0AD:000000087E08020802087E0804081808600800003EF802083E0820083E080000 -D0AE:000000087E08020802087E0804081808600800003EF802883E8820883EF80000 -D0AF:000000087E08020802087E0804081808600800003E8802883EF820883EF80000 -D0B0:000000087E08020802087E0804081808600800000F8800880F8808140FA20000 -D0B1:000000087E08020802087E0804081808600800003EF802803EF820803EF80000 -D0B2:000000087E08020802087E0804081808600800003EFC02483E4820483EFC0000 -D0B3:000000087E08020802087E0804081808600800003E1002FE3E3820443E380000 -D0B4:000000087E08020802087E08040818086008000003F802080208020803F80000 -D0B5:000000087E08020802087E0804081808600800000208020803F8020803F80000 -D0B6:000000087E08020802087E080408180860080000210821083F0821143F620000 -D0B7:000000087E08020802087E080408180860080000001000100010006801840000 -D0B8:000000087E08020802087E0804081808600800000048004800A8011406620000 -D0B9:000000087E08020802087E080408180860080000000003F00408040803F00000 -D0BA:000000087E08020802087E08040818086008000003F80020002000D003080000 -D0BB:000000087E08020802087E080408180860080000004003F8004000A003180000 -D0BC:000000087E08020802087E08040818086008000003F8000803F8000800080000 -D0BD:000000087E08020802087E08040818086008000003F8020003F8020003F80000 -D0BE:000000087E08020802087E08040818086008000000000FF8022002200FF80000 -D0BF:000000087E08020802087E08040818086008000000800FF803E0041003E00000 -D0C0:00000000001000103F90201020103F9E201020103F9000100010001000100000 -D0C1:0000000800087E0840087E0E40087E080008000007F800080008000800080000 -D0C2:0000000800087E0840087E0E40087E080008000000003EF80208020802080000 -D0C3:0000000800087E0840087E0E40087E080008000000001F080108011401620000 -D0C4:0000000800087E0840087E0E40087E080008000808000800080008000FF80000 -D0C5:0000000800087E0840087E0E40087E0800080000000010F8101010301ECC0000 -D0C6:0000000800087E0840087E0E40087E08000800000808087F081C08220F9C0000 -D0C7:0000000800087E0840087E0E40087E080008000003F802000200020003F80000 -D0C8:0000000800087E0840087E0E40087E080008000007F8000807F8040007F80000 -D0C9:0000000800087E0840087E0E40087E08000800003EF802083E0820083E080000 -D0CA:0000000800087E0840087E0E40087E08000800003EF802883E8820883EF80000 -D0CB:0000000800087E0840087E0E40087E08000800003E8802883EF820883EF80000 -D0CC:0000000800087E0840087E0E40087E08000800001F0801081F0810141F620000 -D0CD:0000000800087E0840087E0E40087E08000800003EF802803EF820803EF80000 -D0CE:0000000800087E0840087E0E40087E08000800003EFC02483E4820483EFC0000 -D0CF:0000000800087E0840087E0E40087E08000800001F08017F1F1C10221F1C0000 -D0D0:0000000800087E0840087E0E40087E080008000003F802080208020803F80000 -D0D1:0000000800087E0840087E0E40087E08000800000208020803F8020803F80000 -D0D2:0000000800087E0840087E0E40087E0800080000110811081F0811141F620000 -D0D3:0000000800087E0840087E0E40087E0800080000001000100010006801840000 -D0D4:0000000800087E0840087E0E40087E08000800000048004800A8011406620000 -D0D5:0000000800087E0840087E0E40087E0800080000000003F00408040803F00000 -D0D6:0000000800087E0840087E0E40087E080008000003F80020002000D003080000 -D0D7:0000000800087E0840087E0E40087E0800080000004003F8004000A003180000 -D0D8:0000000800087E0840087E0E40087E080008000003F8000803F8000800080000 -D0D9:0000000800087E0840087E0E40087E080008000003F8020003F8020003F80000 -D0DA:0000000800087E0840087E0E40087E080008000000000FF8022002200FF80000 -D0DB:0000000800087E0840087E0E40087E080008000000800FF803E0041003E00000 -D0DC:00000000001200123F92201220123F9E201220123F9200120012001200120000 -D0DD:0000002800287E2840287E3840287E280028000007F800080008000800080000 -D0DE:0000002800287E2840287E3840287E280028000000003EF80208020802080000 -D0DF:0000002800287E2840287E3840287E280028000000003E100210022802C40000 -D0E0:0000002800287E2840287E3840287E280028002808000800080008000FF80000 -D0E1:0000002800287E2840287E3840287E2800280000000020F8201020303ECC0000 -D0E2:0000002800287E2840287E3840287E2800280000202021FC207020883E700000 -D0E3:0000002800287E2840287E3840287E280028000003F802000200020003F80000 -D0E4:0000002800287E2840287E3840287E280028000007F8000807F8040007F80000 -D0E5:0000002800287E2840287E3840287E28002800003EF802083E0820083E080000 -D0E6:0000002800287E2840287E3840287E28002800003EF802883E8820883EF80000 -D0E7:0000002800287E2840287E3840287E28002800003E8802883EF820883EF80000 -D0E8:0000002800287E2840287E3840287E28002800001F0801081F0810141F620000 -D0E9:0000002800287E2840287E3840287E28002800003EF802803EF820803EF80000 -D0EA:0000002800287E2840287E3840287E28002800003EFC02483E4820483EFC0000 -D0EB:0000002800287E2840287E3840287E28002800003E1002FE3E3820443E380000 -D0EC:0000002800287E2840287E3840287E280028000003F802080208020803F80000 -D0ED:0000002800287E2840287E3840287E28002800000208020803F8020803F80000 -D0EE:0000002800287E2840287E3840287E2800280000110811081F0811141F620000 -D0EF:0000002800287E2840287E3840287E2800280000000800080008003400C20000 -D0F0:0000002800287E2840287E3840287E28002800000048004800A8011406620000 -D0F1:0000002800287E2840287E3840287E2800280000000001F00208020801F00000 -D0F2:0000002800287E2840287E3840287E280028000003F80020002000D003080000 -D0F3:0000002800287E2840287E3840287E2800280000004003F8004000A003180000 -D0F4:0000002800287E2840287E3840287E280028000003F8000803F8000800080000 -D0F5:0000002800287E2840287E3840287E280028000003F8020003F8020003F80000 -D0F6:0000002800287E2840287E3840287E280028000000000FF8022002200FF80000 -D0F7:0000002800287E2840287E3840287E280028000000800FF803E0041003E00000 -D0F8:00000000001000103F902010201E3F902010201E3F9000100010001000100000 -D0F9:0000000800087E08400E7E08400E7E080008000007F800080008000800080000 -D0FA:0000000800087E08400E7E08400E7E080008000000003EF80208020802080000 -D0FB:0000000800087E08400E7E08400E7E080008000000001F080108011401620000 -D0FC:0000000800087E08400E7E08400E7E080008000008000800080008000FF80000 -D0FD:0000000800087E08400E7E08400E7E0800080000000010F8101010301ECC0000 -D0FE:0000000800087E08400E7E08400E7E08000800000808087F081C08220F9C0000 -D0FF:0000000800087E08400E7E08400E7E080008000003F802000200020003F80000 -D100:0000000800087E08400E7E08400E7E080008000007F8000807F8040007F80000 -D101:0000000800087E08400E7E08400E7E08000800003EF802083E0820083E080000 -D102:0000000800087E08400E7E08400E7E08000800003EF802883E8820883EF80000 -D103:0000000800087E08400E7E08400E7E08000800003E8802883EF820883EF80000 -D104:0000000800087E08400E7E08400E7E08000800001F0801081F0810141F620000 -D105:0000000800087E08400E7E08400E7E08000800003EF802803EF820803EF80000 -D106:0000000800087E08400E7E08400E7E08000800003EFC02483E4820483EFC0000 -D107:0000000800087E08400E7E08400E7E08000800001F08017F1F1C10221F1C0000 -D108:0000000800087E08400E7E08400E7E080008000003F802080208020803F80000 -D109:0000000800087E08400E7E08400E7E08000800000208020803F8020803F80000 -D10A:0000000800087E08400E7E08400E7E0800080000110811081F0811141F620000 -D10B:0000000800087E08400E7E08400E7E0800080000001000100010006801840000 -D10C:0000000800087E08400E7E08400E7E08000800000048004800A8011406620000 -D10D:0000000800087E08400E7E08400E7E0800080000000003F00408040803F00000 -D10E:0000000800087E08400E7E08400E7E080008000003F80020002000D003080000 -D10F:0000000800087E08400E7E08400E7E0800080000004003F8004000A003180000 -D110:0000000800087E08400E7E08400E7E080008000003F8000803F8000800080000 -D111:0000000800087E08400E7E08400E7E080008000003F8020003F8020003F80000 -D112:0000000800087E08400E7E08400E7E080008000000000FF8022002200FF80000 -D113:0000000800087E08400E7E08400E7E080008000000800FF803E0041003E00000 -D114:00000000001200123F922012201E3F922012201E3F9200120012001200120000 -D115:0000002800287E2840387E2840387E280028000007F800080008000800080000 -D116:0000002800287E2840387E2840387E280028000000003EF80208020802080000 -D117:0000002800287E2840387E2840387E280028000000003E100210022802C40000 -D118:0000002800287E2840387E2840387E280028002808000800080008000FF80000 -D119:0000002800287E2840387E2840387E2800280000000020F8201020303ECC0000 -D11A:0000002800287E2840387E2840387E2800280000202021FC207020883E700000 -D11B:0000002800287E2840387E2840387E280028000003F802000200020003F80000 -D11C:0000002800287E2840387E2840387E280028000007F8000807F8040007F80000 -D11D:0000002800287E2840387E2840387E28002800003EF802083E0820083E080000 -D11E:0000002800287E2840387E2840387E28002800003EF802883E8820883EF80000 -D11F:0000002800287E2840387E2840387E28002800003E8802883EF820883EF80000 -D120:0000002800287E2840387E2840387E28002800001F0801081F0810141F620000 -D121:0000002800287E2840387E2840387E28002800003EF802803EF820803EF80000 -D122:0000002800287E2840387E2840387E28002800003EFC02483E4820483EFC0000 -D123:0000002800287E2840387E2840387E28002800003E1002FE3E3820443E380000 -D124:0000002800287E2840387E2840387E280028000003F802080208020803F80000 -D125:0000002800287E2840387E2840387E28002800000208020803F8020803F80000 -D126:0000002800287E2840387E2840387E2800280000110811081F0811141F620000 -D127:0000002800287E2840387E2840387E2800280000000800080008003400C20000 -D128:0000002800287E2840387E2840387E28002800000048004800A8011406620000 -D129:0000002800287E2840387E2840387E2800280000000001F00208020801F00000 -D12A:0000002800287E2840387E2840387E280028000003F80020002000D003080000 -D12B:0000002800287E2840387E2840387E2800280000004003F8004000A003180000 -D12C:0000002800287E2840387E2840387E280028000003F8000803F8000800080000 -D12D:0000002800287E2840387E2840387E280028000003F8020003F8020003F80000 -D12E:0000002800287E2840387E2840387E280028000000000FF8022002200FF80000 -D12F:0000002800287E2840387E2840387E280028000000800FF803E0041003E00000 -D130:00000000000200023F82200220023F9E200220023F8200020002000200020000 -D131:0000000800087E0840087E3840087E0800080000000007F80008000800080000 -D132:0000000800087E0840087E3840087E080008000000003EF80208020802080000 -D133:0000000800087E0840087E3840087E080008000000001F080108011401620000 -D134:0000000800087E0840087E3840087E080008000000001000100010001FF80000 -D135:0000000800087E0840087E3840087E0800080000000020F8201020303ECC0000 -D136:0000000800087E0840087E3840087E0800080000202021FC207020883E700000 -D137:0000000800087E0840087E3840087E080008000003F802000200020003F80000 -D138:0000000800087E0840087E3840087E080008000007F8000807F8040007F80000 -D139:0000000800087E0840087E3840087E08000800003EF802083E0820083E080000 -D13A:0000000800087E0840087E3840087E08000800003EF802883E8820883EF80000 -D13B:0000000800087E0840087E3840087E08000800003E8802883EF820883EF80000 -D13C:0000000800087E0840087E3840087E08000800000F8800880F8808140FA20000 -D13D:0000000800087E0840087E3840087E08000800003EF802803EF820803EF80000 -D13E:0000000800087E0840087E3840087E08000800003EFC02483E4820483EFC0000 -D13F:0000000800087E0840087E3840087E08000800003E1002FE3E3820443E380000 -D140:0000000800087E0840087E3840087E080008000003F802080208020803F80000 -D141:0000000800087E0840087E3840087E08000800000208020803F8020803F80000 -D142:0000000800087E0840087E3840087E0800080000210821083F0821143F620000 -D143:0000000800087E0840087E3840087E0800080000001000100010006801840000 -D144:0000000800087E0840087E3840087E08000800000048004800A8011406620000 -D145:0000000800087E0840087E3840087E0800080000000003F00408040803F00000 -D146:0000000800087E0840087E3840087E080008000003F80020002000D003080000 -D147:0000000800087E0840087E3840087E0800080000004003F8004000A003180000 -D148:0000000800087E0840087E3840087E080008000003F8000803F8000800080000 -D149:0000000800087E0840087E3840087E080008000003F8020003F8020003F80000 -D14A:0000000800087E0840087E3840087E080008000000000FF8022002200FF80000 -D14B:0000000800087E0840087E3840087E080008000000800FF803E0041003E00000 -D14C:00000000000A000A3F8A200A200A3FBA200A200A3F8A000A000A000A000A0000 -D14D:0000002800287E2840287EE840287E280028000007F800080008000800080000 -D14E:0000002800287E2840287EE840287E280028000000003EF80208020802080000 -D14F:0000002800287E2840287EE840287E280028000000003E100210022802C40000 -D150:0000002800287E2840287EE840287E280028000008000800080008000FF80000 -D151:0000002800287E2840287EE840287E2800280000000020F8201020303ECC0000 -D152:0000002800287E2840287EE840287E2800280000202021FC207020883E700000 -D153:0000002800287E2840287EE840287E280028000003F802000200020003F80000 -D154:0000002800287E2840287EE840287E280028000007F8000807F8040007F80000 -D155:0000002800287E2840287EE840287E28002800003EF802083E0820083E080000 -D156:0000002800287E2840287EE840287E28002800003EF802883E8820883EF80000 -D157:0000002800287E2840287EE840287E28002800003E8802883EF820883EF80000 -D158:0000002800287E2840287EE840287E28002800001F0801081F0810141F620000 -D159:0000002800287E2840287EE840287E28002800003EF802803EF820803EF80000 -D15A:0000002800287E2840287EE840287E28002800003EFC02483E4820483EFC0000 -D15B:0000002800287E2840287EE840287E28002800003E1002FE3E3820443E380000 -D15C:0000002800287E2840287EE840287E280028000003F802080208020803F80000 -D15D:0000002800287E2840287EE840287E28002800000208020803F8020803F80000 -D15E:0000002800287E2840287EE840287E2800280000110811081F0811141F620000 -D15F:0000002800287E2840287EE840287E2800280000000800080008003400C20000 -D160:0000002800287E2840287EE840287E28002800000048004800A8011406620000 -D161:0000002800287E2840287EE840287E2800280000000001F00208020801F00000 -D162:0000002800287E2840287EE840287E280028000003F80020002000D003080000 -D163:0000002800287E2840287EE840287E2800280000004003F8004000A003180000 -D164:0000002800287E2840287EE840287E280028000003F8000803F8000800080000 -D165:0000002800287E2840287EE840287E280028000003F8020003F8020003F80000 -D166:0000002800287E2840287EE840287E280028000000000FF8022002200FF80000 -D167:0000002800287E2840287EE840287E280028000000800FF803E0041003E00000 -D168:00000000000200023F822002201E3F822002201E3F8200020002000200020000 -D169:0000000800087E0840387E0840387E0800080000000007F80008000800080000 -D16A:0000000800087E0840387E0840387E080008000000003EF80208020802080000 -D16B:0000000800087E0840387E0840387E080008000000001F080108011401620000 -D16C:0000000800087E0840387E0840387E080008000800001000100010001FF80000 -D16D:0000000800087E0840387E0840387E0800080000000020F8201020303ECC0000 -D16E:0000000800087E0840387E0840387E0800080000202021FC207020883E700000 -D16F:0000000800087E0840387E0840387E080008000003F802000200020003F80000 -D170:0000000800087E0840387E0840387E080008000007F8000807F8040007F80000 -D171:0000000800087E0840387E0840387E08000800003EF802083E0820083E080000 -D172:0000000800087E0840387E0840387E08000800003EF802883E8820883EF80000 -D173:0000000800087E0840387E0840387E08000800003E8802883EF820883EF80000 -D174:0000000800087E0840387E0840387E08000800000F8800880F8808140FA20000 -D175:0000000800087E0840387E0840387E08000800003EF802803EF820803EF80000 -D176:0000000800087E0840387E0840387E08000800003EFC02483E4820483EFC0000 -D177:0000000800087E0840387E0840387E08000800003E1002FE3E3820443E380000 -D178:0000000800087E0840387E0840387E080008000003F802080208020803F80000 -D179:0000000800087E0840387E0840387E08000800000208020803F8020803F80000 -D17A:0000000800087E0840387E0840387E0800080000210821083F0821143F620000 -D17B:0000000800087E0840387E0840387E0800080000001000100010006801840000 -D17C:0000000800087E0840387E0840387E08000800000048004800A8011406620000 -D17D:0000000800087E0840387E0840387E0800080000000003F00408040803F00000 -D17E:0000000800087E0840387E0840387E080008000003F80020002000D003080000 -D17F:0000000800087E0840387E0840387E0800080000004003F8004000A003180000 -D180:0000000800087E0840387E0840387E080008000003F8000803F8000800080000 -D181:0000000800087E0840387E0840387E080008000003F8020003F8020003F80000 -D182:0000000800087E0840387E0840387E080008000000000FF8022002200FF80000 -D183:0000000800087E0840387E0840387E080008000000800FF803E0041003E00000 -D184:00000000000A000A3F8A200A203A3F8A200A203A3F8A000A000A000A000A0000 -D185:0000002800287E2840E87E2840E87E280028000007F800080008000800080000 -D186:0000002800287E2840E87E2840E87E280028000000003EF80208020802080000 -D187:0000002800287E2840E87E2840E87E280028000000003E100210022802C40000 -D188:0000002800287E2840E87E2840E87E280028002808000800080008000FF80000 -D189:0000002800287E2840E87E2840E87E2800280000000020F8201020303ECC0000 -D18A:0000002800287E2840E87E2840E87E2800280000202021FC207020883E700000 -D18B:0000002800287E2840E87E2840E87E280028000003F802000200020003F80000 -D18C:0000002800287E2840E87E2840E87E280028000007F8000807F8040007F80000 -D18D:0000002800287E2840E87E2840E87E28002800003EF802083E0820083E080000 -D18E:0000002800287E2840E87E2840E87E28002800003EF802883E8820883EF80000 -D18F:0000002800287E2840E87E2840E87E28002800003E8802883EF820883EF80000 -D190:0000002800287E2840E87E2840E87E28002800001F0801081F0810141F620000 -D191:0000002800287E2840E87E2840E87E28002800003EF802803EF820803EF80000 -D192:0000002800287E2840E87E2840E87E28002800003EFC02483E4820483EFC0000 -D193:0000002800287E2840E87E2840E87E28002800003E1002FE3E3820443E380000 -D194:0000002800287E2840E87E2840E87E280028000003F802080208020803F80000 -D195:0000002800287E2840E87E2840E87E28002800000208020803F8020803F80000 -D196:0000002800287E2840E87E2840E87E2800280000110811081F0811141F620000 -D197:0000002800287E2840E87E2840E87E2800280000000800080008003400C20000 -D198:0000002800287E2840E87E2840E87E28002800000048004800A8011406620000 -D199:0000002800287E2840E87E2840E87E2800280000000001F00208020801F00000 -D19A:0000002800287E2840E87E2840E87E280028000003F80020002000D003080000 -D19B:0000002800287E2840E87E2840E87E2800280000004003F8004000A003180000 -D19C:0000002800287E2840E87E2840E87E280028000003F8000803F8000800080000 -D19D:0000002800287E2840E87E2840E87E280028000003F8020003F8020003F80000 -D19E:0000002800287E2840E87E2840E87E280028000000000FF8022002200FF80000 -D19F:0000002800287E2840E87E2840E87E280028000000800FF803E0041003E00000 -D1A0:00003FF8200020003FF8200020003FF8000000000100010001007FFC00000000 -D1A1:00001FF010001FF010001FF0010001007FFC00001FF000100010001000100000 -D1A2:00001FF010001FF010001FF0010001007FFC000000003EF80208020802080000 -D1A3:00001FF010001FF010001FF0010001007FFC000000001E100210022802C40000 -D1A4:00001FF010001FF010001FF0010001007FFC000000001000100010001FF00000 -D1A5:00001FF010001FF010001FF0010001007FFC0000000020F8201020303ECC0000 -D1A6:00001FF010001FF010001FF0010001007FFC0000202021FC207020883E700000 -D1A7:00001FF010001FF010001FF0010001007FFC00001FF01000100010001FF00000 -D1A8:00001FF010001FF010001FF0010001007FFC00001FF000101FF010001FF00000 -D1A9:00001FF010001FF010001FF0010001007FFC00003EF802083E0820083E080000 -D1AA:00001FF010001FF010001FF0010001007FFC00003EF802883E8820883EF80000 -D1AB:00001FF010001FF010001FF0010001007FFC00003E8802883EF820883EF80000 -D1AC:00001FF010001FF010001FF0010001007FFC00003E1002103E1020283EC40000 -D1AD:00001FF010001FF010001FF0010001007FFC00003EF802803EF820803EF80000 -D1AE:00001FF010001FF010001FF0010001007FFC00003EFC02483E4820483EFC0000 -D1AF:00001FF010001FF010001FF0010001007FFC00003E2003FC3E7020883E700000 -D1B0:00001FF010001FF010001FF0010001007FFC00001FF01010101010101FF00000 -D1B1:00001FF010001FF010001FF0010001007FFC0000101010101FF010101FF00000 -D1B2:00001FF010001FF010001FF0010001007FFC0000222022203E2022503E880000 -D1B3:00001FF010001FF010001FF0010001007FFC000000000100010002800C400000 -D1B4:00001FF010001FF010001FF0010001007FFC00000000024002400DA033100000 -D1B5:00001FF010001FF010001FF0010001007FFC0000000007C00820082007C00000 -D1B6:00001FF010001FF010001FF0010001007FFC0000000007E00080014006200000 -D1B7:00001FF010001FF010001FF0010001007FFC0000008007E00080014006200000 -D1B8:00001FF010001FF010001FF0010001007FFC00001FF000101FF0001000100000 -D1B9:00001FF010001FF010001FF0010001007FFC00001FF010001FF010001FF00000 -D1BA:00001FF010001FF010001FF0010001007FFC000000001FF0044004401FF00000 -D1BB:00001FF010001FF010001FF0010001007FFC000001001FF007C0082007C00000 -D1BC:000000103FD0201020103FD02010201E3FD00010041004107FD0001000100000 -D1BD:000000087F0840087F0E40087F0804087FE8000007F800080008000800080000 -D1BE:000000087F0840087F0E40087F0804087FE8000000003EF80208020802080000 -D1BF:000000087F0840087F0E40087F0804087FE8000000001F080108011401620000 -D1C0:000000087F0840087F0E40087F0804087FE8000008000800080008000FF80000 -D1C1:000000087F0840087F0E40087F0804087FE80000000010F8101010301ECC0000 -D1C2:000000087F0840087F0E40087F0804087FE800000808087F081C08220F9C0000 -D1C3:000000087F0840087F0E40087F0804087FE8000003F802000200020003F80000 -D1C4:000000087F0840087F0E40087F0804087FE8000007F8000807F8040007F80000 -D1C5:000000087F0840087F0E40087F0804087FE800003EF802083E0820083E080000 -D1C6:000000087F0840087F0E40087F0804087FE800003EF802883E8820883EF80000 -D1C7:000000087F0840087F0E40087F0804087FE800003E8802883EF820883EF80000 -D1C8:000000087F0840087F0E40087F0804087FE800001F0801081F0810141F620000 -D1C9:000000087F0840087F0E40087F0804087FE800003EF802803EF820803EF80000 -D1CA:000000087F0840087F0E40087F0804087FE800003EFC02483E4820483EFC0000 -D1CB:000000087F0840087F0E40087F0804087FE800001F08017F1F1C10221F1C0000 -D1CC:000000087F0840087F0E40087F0804087FE8000003F802080208020803F80000 -D1CD:000000087F0840087F0E40087F0804087FE800000208020803F8020803F80000 -D1CE:000000087F0840087F0E40087F0804087FE80000110811081F0811141F620000 -D1CF:000000087F0840087F0E40087F0804087FE80000001000100010006801840000 -D1D0:000000087F0840087F0E40087F0804087FE800000048004800A8011406620000 -D1D1:000000087F0840087F0E40087F0804087FE80000000003F00408040803F00000 -D1D2:000000087F0840087F0E40087F0804087FE8000003F80020002000D003080000 -D1D3:000000087F0840087F0E40087F0804087FE80000004003F8004000A003180000 -D1D4:000000087F0840087F0E40087F0804087FE8000003F8000803F8000800080000 -D1D5:000000087F0840087F0E40087F0804087FE8000003F8020003F8020003F80000 -D1D6:000000087F0840087F0E40087F0804087FE8000000000FF8022002200FF80000 -D1D7:000000087F0840087F0E40087F0804087FE8000000800FF803E0041003E00000 -D1D8:000000123FD2201220123FD22012201E3FD20012041204127FD2001200120000 -D1D9:000000287F2840287F3840287F2804287FA8000007F800080008000800080000 -D1DA:000000287F2840287F3840287F2804287FA8000000003EF80208020802080000 -D1DB:000000287F2840287F3840287F2804287FA8000000001F080108011401620000 -D1DC:000000287F2840287F3840287F2804287FA8000008000800080008000FF80000 -D1DD:000000287F2840287F3840287F2804287FA80000000010F8101010301ECC0000 -D1DE:000000287F2840287F3840287F2804287FA800000808087F081C08220F9C0000 -D1DF:000000287F2840287F3840287F2804287FA8000003F802000200020003F80000 -D1E0:000000287F2840287F3840287F2804287FA8000007F8000807F8040007F80000 -D1E1:000000287F2840287F3840287F2804287FA800003EF802083E0820083E080000 -D1E2:000000287F2840287F3840287F2804287FA800003EF802883E8820883EF80000 -D1E3:000000287F2840287F3840287F2804287FA800003E8802883EF820883EF80000 -D1E4:000000287F2840287F3840287F2804287FA800001F0801081F0810141F620000 -D1E5:000000287F2840287F3840287F2804287FA800003EF802803EF820803EF80000 -D1E6:000000287F2840287F3840287F2804287FA800003EFC02483E4820483EFC0000 -D1E7:000000287F2840287F3840287F2804287FA800001F08017F1F1C10221F1C0000 -D1E8:000000287F2840287F3840287F2804287FA8000003F802080208020803F80000 -D1E9:000000287F2840287F3840287F2804287FA800000208020803F8020803F80000 -D1EA:000000287F2840287F3840287F2804287FA80000110811081F0811141F620000 -D1EB:000000287F2840287F3840287F2804287FA80000001000100010006801840000 -D1EC:000000287F2840287F3840287F2804287FA800000048004800A8011406620000 -D1ED:000000287F2840287F3840287F2804287FA80000000003F00408040803F00000 -D1EE:000000287F2840287F3840287F2804287FA8000003F80020002000D003080000 -D1EF:000000287F2840287F3840287F2804287FA80000004003F8004000A003180000 -D1F0:000000287F2840287F3840287F2804287FA8000003F8000803F8000800080000 -D1F1:000000287F2840287F3840287F2804287FA8000003F8020003F8020003F80000 -D1F2:000000287F2840287F3840287F2804287FA8000000000FF8022002200FF80000 -D1F3:000000287F2840287F3840287F2804287FA8000000800FF803E0041003E00000 -D1F4:000000083FC8200820083FC8200820083FC80008040804087FE8000800080000 -D1F5:000000087F0840087F0840087F0804087FE8000007F800080008000800080000 -D1F6:000000087F0840087F0840087F0804087FE8000000003EF80208020802080000 -D1F7:000000087F0840087F0840087F0804087FE8000000001F080108011401620000 -D1F8:000000087F0840087F0840087F0804087FE8000008000800080008000FF80000 -D1F9:000000087F0840087F0840087F0804087FE80000000010F8101010301ECC0000 -D1FA:000000087F0840087F0840087F0804087FE800000808087F081C08220F9C0000 -D1FB:000000087F0840087F0840087F0804087FE8000003F802000200020003F80000 -D1FC:000000087F0840087F0840087F0804087FE8000007F8000807F8040007F80000 -D1FD:000000087F0840087F0840087F0804087FE800003EF802083E0820083E080000 -D1FE:000000087F0840087F0840087F0804087FE800003EF802883E8820883EF80000 -D1FF:000000087F0840087F0840087F0804087FE800003E8802883EF820883EF80000 -D200:000000087F0840087F0840087F0804087FE800001F0801081F0810141F620000 -D201:000000087F0840087F0840087F0804087FE800003EF802803EF820803EF80000 -D202:000000087F0840087F0840087F0804087FE800003EFC02483E4820483EFC0000 -D203:000000087F0840087F0840087F0804087FE800001F08017F1F1C10221F1C0000 -D204:000000087F0840087F0840087F0804087FE8000003F802080208020803F80000 -D205:000000087F0840087F0840087F0804087FE800000208020803F8020803F80000 -D206:000000087F0840087F0840087F0804087FE80000110811081F0811141F620000 -D207:000000087F0840087F0840087F0804087FE80000001000100010006801840000 -D208:000000087F0840087F0840087F0804087FE800000048004800A8011406620000 -D209:000000087F0840087F0840087F0804087FE80000000003F00408040803F00000 -D20A:000000087F0840087F0840087F0804087FE8000003F80020002000D003080000 -D20B:000000087F0840087F0840087F0804087FE80000004003F8004000A003180000 -D20C:000000087F0840087F0840087F0804087FE8000003F8000803F8000800080000 -D20D:000000087F0840087F0840087F0804087FE8000003F8020003F8020003F80000 -D20E:000000087F0840087F0840087F0804087FE8000000000FF8022002200FF80000 -D20F:000000087F0840087F0840087F0804087FE8000000800FF803E0041003E00000 -D210:00003FF8200020003FF8200020003FF8000004400440044004407FFC00000000 -D211:00001FF010001FF010001FF0044004407FFC00001FF000100010001000100000 -D212:00001FF010001FF010001FF0044004407FFC000000003EF80208020802080000 -D213:00001FF010001FF010001FF0044004407FFC000000001E100210022802C40000 -D214:00001FF010001FF010001FF0044004407FFC000000001000100010001FF00000 -D215:00001FF010001FF010001FF0044004407FFC0000000020F8201020303ECC0000 -D216:00001FF010001FF010001FF0044004407FFC0000202021FC207020883E700000 -D217:00001FF010001FF010001FF0044004407FFC00001FF01000100010001FF00000 -D218:00001FF010001FF010001FF0044004407FFC00001FF000101FF010001FF00000 -D219:00001FF010001FF010001FF0044004407FFC00003EF802083E0820083E080000 -D21A:00001FF010001FF010001FF0044004407FFC00003EF802883E8820883EF80000 -D21B:00001FF010001FF010001FF0044004407FFC00003E8802883EF820883EF80000 -D21C:00001FF010001FF010001FF0044004407FFC00003E1002103E1020283EC40000 -D21D:00001FF010001FF010001FF0044004407FFC00003EF802803EF820803EF80000 -D21E:00001FF010001FF010001FF0044004407FFC00003EFC02483E4820483EFC0000 -D21F:00001FF010001FF010001FF0044004407FFC00003E2003FC3E7020883E700000 -D220:00001FF010001FF010001FF0044004407FFC00001FF01010101010101FF00000 -D221:00001FF010001FF010001FF0044004407FFC0000101010101FF010101FF00000 -D222:00001FF010001FF010001FF0044004407FFC0000222022203E2022503E880000 -D223:00001FF010001FF010001FF0044004407FFC000000000100010002800C400000 -D224:00001FF010001FF010001FF0044004407FFC00000000024002400DA033100000 -D225:00001FF010001FF010001FF0044004407FFC0000000007C00820082007C00000 -D226:00001FF010001FF010001FF0044004407FFC0000000007E00080014006200000 -D227:00001FF010001FF010001FF0044004407FFC0000008007E00080014006200000 -D228:00001FF010001FF010001FF0044004407FFC00001FF000101FF0001000100000 -D229:00001FF010001FF010001FF0044004407FFC00001FF010001FF010001FF00000 -D22A:00001FF010001FF010001FF0044004407FFC000000001FF0044004401FF00000 -D22B:00001FF010001FF010001FF0044004407FFC000001001FF007C0082007C00000 -D22C:000000003FF8200020003FF8200020003FF800003FF801000100010001000000 -D22D:00001FF010001FF010001FF000007FFC010001001FF000100010001000100000 -D22E:00001FF010001FF010001FF000007FFC0100010000003EF80208020802080000 -D22F:00001FF010001FF010001FF000007FFC0100010000001E100210022802C40000 -D230:00001FF010001FF010001FF0000000007FFC010001001100100010001FF00000 -D231:00001FF010001FF010001FF000007FFC01000100000020F8201020303ECC0000 -D232:00001FF010001FF010001FF000007FFC01000100202021FC207020883E700000 -D233:00001FF010001FF010001FF000007FFC010001001FF01000100010001FF00000 -D234:00001FF010001FF010001FF000007FFC010001001FF000101FF010001FF00000 -D235:00001FF010001FF010001FF000007FFC010001003EF802083E0820083E080000 -D236:00001FF010001FF010001FF000007FFC010001003EF802883E8820883EF80000 -D237:00001FF010001FF010001FF000007FFC010001003E8802883EF820883EF80000 -D238:00001FF010001FF010001FF000007FFC010001003E1002103E1020283EC40000 -D239:00001FF010001FF010001FF000007FFC010001003EF802803EF820803EF80000 -D23A:00001FF010001FF010001FF000007FFC010001003EFC02483E4820483EFC0000 -D23B:00001FF010001FF010001FF000007FFC010001003E2003FC3E7020883E700000 -D23C:00001FF010001FF010001FF000007FFC010001001FF01010101010101FF00000 -D23D:00001FF010001FF010001FF000007FFC01000100101010101FF010101FF00000 -D23E:00001FF010001FF010001FF000007FFC01000100222022203E2022503E880000 -D23F:00001FF010001FF010001FF000007FFC0100010000000100010002800C400000 -D240:00001FF010001FF010001FF000007FFC010001000000024002400DA033100000 -D241:00001FF010001FF010001FF000007FFC01000100000007C00820082007C00000 -D242:00001FF010001FF010001FF000007FFC01000100000007E00080014006200000 -D243:00001FF010001FF010001FF000007FFC01000100008007E00080014006200000 -D244:00001FF010001FF010001FF000007FFC010001001FF000101FF0001000100000 -D245:00001FF010001FF010001FF000007FFC010001001FF010001FF010001FF00000 -D246:00001FF010001FF010001FF000007FFC0100010000001FF0044004401FF00000 -D247:00001FF010001FF010001FF000007FFC0100010001001FF007C0082007C00000 -D248:000000083FC8200820083FC8200820083FC800087FE8040804F8040804080000 -D249:7F8840087F8840087F8800087FE8027802080000000007F80008000800080000 -D24A:7F8840087F8840087F8800087FE802780208000000003EF80208020802080000 -D24B:7F8840087F8840087F8800087FE802780208000000001F080108011401620000 -D24C:7F8840087F8840087F88000800087FE80278020802081000100010001FF80000 -D24D:7F8840087F8840087F8800087FE8027802080000000020F8201020303ECC0000 -D24E:7F8840087F8840087F8800087FE8027802080000202021FC207020883E700000 -D24F:7F8840087F8840087F8800087FE802780208000003F802000200020003F80000 -D250:7F8840087F8840087F8800087FE802780208000007F8000807F8040007F80000 -D251:7F8840087F8840087F8800087FE80278020800003EF802083E0820083E080000 -D252:7F8840087F8840087F8800087FE80278020800003EF802883E8820883EF80000 -D253:7F8840087F8840087F8800087FE80278020800003E8802883EF820883EF80000 -D254:7F8840087F8840087F8800087FE80278020800000F8800880F8808140FA20000 -D255:7F8840087F8840087F8800087FE80278020800003EF802803EF820803EF80000 -D256:7F8840087F8840087F8800087FE80278020800003EFC02483E4820483EFC0000 -D257:7F8840087F8840087F8800087FE80278020800003E1002FE3E3820443E380000 -D258:7F8840087F8840087F8800087FE802780208000003F802080208020803F80000 -D259:7F8840087F8840087F8800087FE80278020800000208020803F8020803F80000 -D25A:7F8840087F8840087F8800087FE8027802080000210821083F0821143F620000 -D25B:7F8840087F8840087F8800087FE8027802080000001000100010006801840000 -D25C:7F8840087F8840087F8800087FE80278020800000048004800A8011406620000 -D25D:7F8840087F8840087F8800087FE8027802080000000003F00408040803F00000 -D25E:7F8840087F8840087F8800087FE802780208000003F80020002000D003080000 -D25F:7F8840087F8840087F8800087FE8027802080000004003F8004000A003180000 -D260:7F8840087F8840087F8800087FE802780208000003F8000803F8000800080000 -D261:7F8840087F8840087F8800087FE802780208000003F8020003F8020003F80000 -D262:7F8840087F8840087F8800087FE802780208000000000FF8022002200FF80000 -D263:7F8840087F8840087F8800087FE802780208000000800FF803E0041003E00000 -D264:0000000A3FCA200A200A3FCA200A200A3FCA000A7FEA040A047A040A040A0000 -D265:7FA840287FA840287FA800287FA805E804280000000007F80008000800080000 -D266:7FA840287FA840287FA800287FA805E80428000000003EF80208020802080000 -D267:7FA840287FA840287FA800287FA805E80428000000001F080108011401620000 -D268:7FA840287FA840287FA8002800287FA8042805E804281428100010001FF80000 -D269:7FA840287FA840287FA800287FA805E804280000000020F8201020303ECC0000 -D26A:7FA840287FA840287FA800287FA805E804280000202021FC207020883E700000 -D26B:7FA840287FA840287FA800287FA805E80428000003F802000200020003F80000 -D26C:7FA840287FA840287FA800287FA805E80428000007F8000807F8040007F80000 -D26D:7FA840287FA840287FA800287FA805E8042800003EF802083E0820083E080000 -D26E:7FA840287FA840287FA800287FA805E8042800003EF802883E8820883EF80000 -D26F:7FA840287FA840287FA800287FA805E8042800003E8802883EF820883EF80000 -D270:7FA840287FA840287FA800287FA805E8042800000F8800880F8808140FA20000 -D271:7FA840287FA840287FA800287FA805E8042800003EF802803EF820803EF80000 -D272:7FA840287FA840287FA800287FA805E8042800003EFC02483E4820483EFC0000 -D273:7FA840287FA840287FA800287FA805E8042800003E1002FE3E3820443E380000 -D274:7FA840287FA840287FA800287FA805E80428000003F802080208020803F80000 -D275:7FA840287FA840287FA800287FA805E8042800000208020803F8020803F80000 -D276:7FA840287FA840287FA800287FA805E804280000210821083F0821143F620000 -D277:7FA840287FA840287FA800287FA805E804280000001000100010006801840000 -D278:7FA840287FA840287FA800287FA805E8042800000048004800A8011406620000 -D279:7FA840287FA840287FA800287FA805E804280000000003F00408040803F00000 -D27A:7FA840287FA840287FA800287FA805E80428000003F80020002000D003080000 -D27B:7FA840287FA840287FA800287FA805E804280000004003F8004000A003180000 -D27C:7FA840287FA840287FA800287FA805E80428000003F8000803F8000800080000 -D27D:7FA840287FA840287FA800287FA805E80428000003F8020003F8020003F80000 -D27E:7FA840287FA840287FA800287FA805E80428000000000FF8022002200FF80000 -D27F:7FA840287FA840287FA800287FA805E80428000000800FF803E0041003E00000 -D280:000000083FC8200820083FC8200820083FC800087FE804080408040804080000 -D281:7F8840087F8840087F8800087FE8020802000000000007F80008000800080000 -D282:7F8840087F8840087F8800087FE802080200000000003EF80208020802080000 -D283:7F8840087F8840087F8800087FE802080200000000001F080108011401620000 -D284:7F8840087F8840087F88000800087FE80208020802081008100010001FF80000 -D285:7F8840087F8840087F8800087FE8020802000000000020F8201020303ECC0000 -D286:7F8840087F8840087F8800087FE8020802000000202021FC207020883E700000 -D287:7F8840087F8840087F8800087FE802080200000003F802000200020003F80000 -D288:7F8840087F8840087F8800087FE802080200000007F8000807F8040007F80000 -D289:7F8840087F8840087F8800087FE80208020000003EF802083E0820083E080000 -D28A:7F8840087F8840087F8800087FE80208020000003EF802883E8820883EF80000 -D28B:7F8840087F8840087F8800087FE80208020000003E8802883EF820883EF80000 -D28C:7F8840087F8840087F8800087FE80208020000000F8800880F8808140FA20000 -D28D:7F8840087F8840087F8800087FE80208020000003EF802803EF820803EF80000 -D28E:7F8840087F8840087F8800087FE80208020000003EFC02483E4820483EFC0000 -D28F:7F8840087F8840087F8800087FE80208020000003E1002FE3E3820443E380000 -D290:7F8840087F8840087F8800087FE802080200000003F802080208020803F80000 -D291:7F8840087F8840087F8800087FE80208020000000208020803F8020803F80000 -D292:7F8840087F8840087F8800087FE8020802000000210821083F0821143F620000 -D293:7F8840087F8840087F8800087FE8020802000000001000100010006801840000 -D294:7F8840087F8840087F8800087FE80208020000000048004800A8011406620000 -D295:7F8840087F8840087F8800087FE8020802000000000003F00408040803F00000 -D296:7F8840087F8840087F8800087FE802080200000003F80020002000D003080000 -D297:7F8840087F8840087F8800087FE8020802000000004003F8004000A003180000 -D298:7F8840087F8840087F8800087FE802080200000003F8000803F8000800080000 -D299:7F8840087F8840087F8800087FE802080200000003F8020003F8020003F80000 -D29A:7F8840087F8840087F8800087FE802080200000000000FF8022002200FF80000 -D29B:7F8840087F8840087F8800087FE802080200000000800FF803E0041003E00000 -D29C:000000003FF8200020003FF8200020003FF800007FFC04400440044004400000 -D29D:00001FF010001FF010001FF000007FFC044004401FF000100010001000100000 -D29E:00001FF010001FF010001FF000007FFC0440044000003EF80208020802080000 -D29F:00001FF010001FF010001FF000007FFC0440044000001E100210022802C40000 -D2A0:00001FF010001FF010001FF0000000007FFC044004401440100010001FF00000 -D2A1:00001FF010001FF010001FF000007FFC04400440000020F8201020303ECC0000 -D2A2:00001FF010001FF010001FF000007FFC04400440202021FC207020883E700000 -D2A3:00001FF010001FF010001FF000007FFC044004401FF01000100010001FF00000 -D2A4:00001FF010001FF010001FF000007FFC044004401FF000101FF010001FF00000 -D2A5:00001FF010001FF010001FF000007FFC044004403EF802083E0820083E080000 -D2A6:00001FF010001FF010001FF000007FFC044004403EF802883E8820883EF80000 -D2A7:00001FF010001FF010001FF000007FFC044004403E8802883EF820883EF80000 -D2A8:00001FF010001FF010001FF000007FFC044004403E1002103E1020283EC40000 -D2A9:00001FF010001FF010001FF000007FFC044004403EF802803EF820803EF80000 -D2AA:00001FF010001FF010001FF000007FFC044004403EFC02483E4820483EFC0000 -D2AB:00001FF010001FF010001FF000007FFC044004403E2003FC3E7020883E700000 -D2AC:00001FF010001FF010001FF000007FFC044004401FF01010101010101FF00000 -D2AD:00001FF010001FF010001FF000007FFC04400440101010101FF010101FF00000 -D2AE:00001FF010001FF010001FF000007FFC04400440222022203E2022503E880000 -D2AF:00001FF010001FF010001FF000007FFC0440044000000100010002800C400000 -D2B0:00001FF010001FF010001FF000007FFC044004400000024002400DA033100000 -D2B1:00001FF010001FF010001FF000007FFC04400440000007C00820082007C00000 -D2B2:00001FF010001FF010001FF000007FFC04400440000007E00080014006200000 -D2B3:00001FF010001FF010001FF000007FFC04400440008007E00080014006200000 -D2B4:00001FF010001FF010001FF000007FFC044004401FF000101FF0001000100000 -D2B5:00001FF010001FF010001FF000007FFC044004401FF010001FF010001FF00000 -D2B6:00001FF010001FF010001FF000007FFC0440044000001FF0044004401FF00000 -D2B7:00001FF010001FF010001FF000007FFC0440044001001FF007C0082007C00000 -D2B8:00003FF8200020003FF8200020003FF80000000000007FFC0000000000000000 -D2B9:00001FF010001FF010001FF0000000007FFC00001FF000100010001000100000 -D2BA:00001FF010001FF010001FF0000000007FFC000000003EF80208020802080000 -D2BB:00001FF010001FF010001FF0000000007FFC000000001E100210022802C40000 -D2BC:00001FF010001FF010001FF0000000007FFC000000001000100010001FF00000 -D2BD:00001FF010001FF010001FF0000000007FFC0000000020F8201020303ECC0000 -D2BE:00001FF010001FF010001FF0000000007FFC0000202021FC207020883E700000 -D2BF:00001FF010001FF010001FF0000000007FFC00001FF01000100010001FF00000 -D2C0:00001FF010001FF010001FF0000000007FFC00001FF000101FF010001FF00000 -D2C1:00001FF010001FF010001FF0000000007FFC00003EF802083E0820083E080000 -D2C2:00001FF010001FF010001FF0000000007FFC00003EF802883E8820883EF80000 -D2C3:00001FF010001FF010001FF0000000007FFC00003E8802883EF820883EF80000 -D2C4:00001FF010001FF010001FF0000000007FFC00003E1002103E1020283EC40000 -D2C5:00001FF010001FF010001FF0000000007FFC00003EF802803EF820803EF80000 -D2C6:00001FF010001FF010001FF0000000007FFC00003EFC02483E4820483EFC0000 -D2C7:00001FF010001FF010001FF0000000007FFC00003E2003FC3E7020883E700000 -D2C8:00001FF010001FF010001FF0000000007FFC00001FF01010101010101FF00000 -D2C9:00001FF010001FF010001FF0000000007FFC0000101010101FF010101FF00000 -D2CA:00001FF010001FF010001FF0000000007FFC0000222022203E2022503E880000 -D2CB:00001FF010001FF010001FF0000000007FFC000000000100010002800C400000 -D2CC:00001FF010001FF010001FF0000000007FFC00000000024002400DA033100000 -D2CD:00001FF010001FF010001FF0000000007FFC0000000007C00820082007C00000 -D2CE:00001FF010001FF010001FF0000000007FFC0000000007E00080014006200000 -D2CF:00001FF010001FF010001FF0000000007FFC0000008007E00080014006200000 -D2D0:00001FF010001FF010001FF0000000007FFC00001FF000101FF0001000100000 -D2D1:00001FF010001FF010001FF0000000007FFC00001FF010001FF010001FF00000 -D2D2:00001FF010001FF010001FF0000000007FFC000000001FF0044004401FF00000 -D2D3:00001FF010001FF010001FF0000000007FFC000001001FF007C0082007C00000 -D2D4:000000083FC8200820083FC8200820083FC8000800087FE80008000800080000 -D2D5:000000087F0840087F0840087F0800087FE8000007F800080008000800080000 -D2D6:000000087F0840087F0840087F0800087FE8000000003EF80208020802080000 -D2D7:000000087F0840087F0840087F0800087FE8000000001F080108011401620000 -D2D8:000000087F0840087F0840087F0800087FE8000008000800080008000FF80000 -D2D9:000000087F0840087F0840087F0800087FE80000000010F8101010301ECC0000 -D2DA:000000087F0840087F0840087F0800087FE800000808087F081C08220F9C0000 -D2DB:000000087F0840087F0840087F0800087FE8000003F802000200020003F80000 -D2DC:000000087F0840087F0840087F0800087FE8000007F8000807F8040007F80000 -D2DD:000000087F0840087F0840087F0800087FE800003EF802083E0820083E080000 -D2DE:000000087F0840087F0840087F0800087FE800003EF802883E8820883EF80000 -D2DF:000000087F0840087F0840087F0800087FE800003E8802883EF820883EF80000 -D2E0:000000087F0840087F0840087F0800087FE800001F0801081F0810141F620000 -D2E1:000000087F0840087F0840087F0800087FE800003EF802803EF820803EF80000 -D2E2:000000087F0840087F0840087F0800087FE800003EFC02483E4820483EFC0000 -D2E3:000000087F0840087F0840087F0800087FE800001F08017F1F1C10221F1C0000 -D2E4:000000087F0840087F0840087F0800087FE8000003F802080208020803F80000 -D2E5:000000087F0840087F0840087F0800087FE800000208020803F8020803F80000 -D2E6:000000087F0840087F0840087F0800087FE80000110811081F0811141F620000 -D2E7:000000087F0840087F0840087F0800087FE80000001000100010006801840000 -D2E8:000000087F0840087F0840087F0800087FE800000048004800A8011406620000 -D2E9:000000087F0840087F0840087F0800087FE80000000003F00408040803F00000 -D2EA:000000087F0840087F0840087F0800087FE8000003F80020002000D003080000 -D2EB:000000087F0840087F0840087F0800087FE80000004003F8004000A003180000 -D2EC:000000087F0840087F0840087F0800087FE8000003F8000803F8000800080000 -D2ED:000000087F0840087F0840087F0800087FE8000003F8020003F8020003F80000 -D2EE:000000087F0840087F0840087F0800087FE8000000000FF8022002200FF80000 -D2EF:000000087F0840087F0840087F0800087FE8000000800FF803E0041003E00000 -D2F0:00000000000800083F88200820083F88200820083F8800080008000800080000 -D2F1:0000000800087E0840087E0840087E0800080000000007F80008000800080000 -D2F2:0000000800087E0840087E0840087E080008000000003EF80208020802080000 -D2F3:0000000800087E0840087E0840087E080008000000001F080108011401620000 -D2F4:0000000800087E0840087E0840087E080008000800001000100010001FF80000 -D2F5:0000000800087E0840087E0840087E0800080000000020F8201020303ECC0000 -D2F6:0000000800087E0840087E0840087E0800080000202021FC207020883E700000 -D2F7:0000000800087E0840087E0840087E080008000003F802000200020003F80000 -D2F8:0000000800087E0840087E0840087E080008000007F8000807F8040007F80000 -D2F9:0000000800087E0840087E0840087E08000800003EF802083E0820083E080000 -D2FA:0000000800087E0840087E0840087E08000800003EF802883E8820883EF80000 -D2FB:0000000800087E0840087E0840087E08000800003E8802883EF820883EF80000 -D2FC:0000000800087E0840087E0840087E08000800000F8800880F8808140FA20000 -D2FD:0000000800087E0840087E0840087E08000800003EF802803EF820803EF80000 -D2FE:0000000800087E0840087E0840087E08000800003EFC02483E4820483EFC0000 -D2FF:0000000800087E0840087E0840087E08000800003E1002FE3E3820443E380000 -D300:0000000800087E0840087E0840087E080008000003F802080208020803F80000 -D301:0000000800087E0840087E0840087E08000800000208020803F8020803F80000 -D302:0000000800087E0840087E0840087E0800080000210821083F0821143F620000 -D303:0000000800087E0840087E0840087E0800080000001000100010006801840000 -D304:0000000800087E0840087E0840087E08000800000048004800A8011406620000 -D305:0000000800087E0840087E0840087E0800080000000003F00408040803F00000 -D306:0000000800087E0840087E0840087E080008000003F80020002000D003080000 -D307:0000000800087E0840087E0840087E0800080000004003F8004000A003180000 -D308:0000000800087E0840087E0840087E080008000003F8000803F8000800080000 -D309:0000000800087E0840087E0840087E080008000003F8020003F8020003F80000 -D30A:0000000800087E0840087E0840087E080008000000000FF8022002200FF80000 -D30B:0000000800087E0840087E0840087E080008000000800FF803E0041003E00000 -D30C:00000000001000107FD011101110111E111011107FD000100010001000100000 -D30D:0000000800087F881208120E12087F880008000007F800080008000800080000 -D30E:0000000800087F881208120E12087F880008000000003EF80208020802080000 -D30F:0000000800087F881208120E12087F880008000000001F080108011401620000 -D310:0000000800087F881208120E12087F880008000808000800080008000FF80000 -D311:0000000800087F881208120E12087F8800080000000010F8101010301ECC0000 -D312:0000000800087F881208120E12087F88000800000808087F081C08220F9C0000 -D313:0000000800087F881208120E12087F880008000003F802000200020003F80000 -D314:0000000800087F881208120E12087F880008000007F8000807F8040007F80000 -D315:0000000800087F881208120E12087F88000800003EF802083E0820083E080000 -D316:0000000800087F881208120E12087F88000800003EF802883E8820883EF80000 -D317:0000000800087F881208120E12087F88000800003E8802883EF820883EF80000 -D318:0000000800087F881208120E12087F88000800001F0801081F0810141F620000 -D319:0000000800087F881208120E12087F88000800003EF802803EF820803EF80000 -D31A:0000000800087F881208120E12087F88000800003EFC02483E4820483EFC0000 -D31B:0000000800087F881208120E12087F88000800001F08017F1F1C10221F1C0000 -D31C:0000000800087F881208120E12087F880008000003F802080208020803F80000 -D31D:0000000800087F881208120E12087F88000800000208020803F8020803F80000 -D31E:0000000800087F881208120E12087F8800080000110811081F0811141F620000 -D31F:0000000800087F881208120E12087F8800080000001000100010006801840000 -D320:0000000800087F881208120E12087F88000800000048004800A8011406620000 -D321:0000000800087F881208120E12087F8800080000000003F00408040803F00000 -D322:0000000800087F881208120E12087F880008000003F80020002000D003080000 -D323:0000000800087F881208120E12087F8800080000004003F8004000A003180000 -D324:0000000800087F881208120E12087F880008000003F8000803F8000800080000 -D325:0000000800087F881208120E12087F880008000003F8020003F8020003F80000 -D326:0000000800087F881208120E12087F880008000000000FF8022002200FF80000 -D327:0000000800087F881208120E12087F880008000000800FF803E0041003E00000 -D328:00000000001200127FD211121112111E111211127FD200120012001200120000 -D329:0000002800287FA81228123812287FA80028000007F800080008000800080000 -D32A:0000002800287FA81228123812287FA80028000000003EF80208020802080000 -D32B:0000002800287FA81228123812287FA80028000000003E100210022802C40000 -D32C:0000002800287FA81228123812287FA80028002808000800080008000FF80000 -D32D:0000002800287FA81228123812287FA800280000000020F8201020303ECC0000 -D32E:0000002800287FA81228123812287FA800280000202021FC207020883E700000 -D32F:0000002800287FA81228123812287FA80028000003F802000200020003F80000 -D330:0000002800287FA81228123812287FA80028000007F8000807F8040007F80000 -D331:0000002800287FA81228123812287FA8002800003EF802083E0820083E080000 -D332:0000002800287FA81228123812287FA8002800003EF802883E8820883EF80000 -D333:0000002800287FA81228123812287FA8002800003E8802883EF820883EF80000 -D334:0000002800287FA81228123812287FA8002800001F0801081F0810141F620000 -D335:0000002800287FA81228123812287FA8002800003EF802803EF820803EF80000 -D336:0000002800287FA81228123812287FA8002800003EFC02483E4820483EFC0000 -D337:0000002800287FA81228123812287FA8002800003E1002FE3E3820443E380000 -D338:0000002800287FA81228123812287FA80028000003F802080208020803F80000 -D339:0000002800287FA81228123812287FA8002800000208020803F8020803F80000 -D33A:0000002800287FA81228123812287FA800280000110811081F0811141F620000 -D33B:0000002800287FA81228123812287FA800280000000800080008003400C20000 -D33C:0000002800287FA81228123812287FA8002800000048004800A8011406620000 -D33D:0000002800287FA81228123812287FA800280000000001F00208020801F00000 -D33E:0000002800287FA81228123812287FA80028000003F80020002000D003080000 -D33F:0000002800287FA81228123812287FA800280000004003F8004000A003180000 -D340:0000002800287FA81228123812287FA80028000003F8000803F8000800080000 -D341:0000002800287FA81228123812287FA80028000003F8020003F8020003F80000 -D342:0000002800287FA81228123812287FA80028000000000FF8022002200FF80000 -D343:0000002800287FA81228123812287FA80028000000800FF803E0041003E00000 -D344:00000000001000107FD01110111E11101110111E7FD000100010001000100000 -D345:0000000800087F88120E1208120E7F880008000007F800080008000800080000 -D346:0000000800087F88120E1208120E7F880008000000003EF80208020802080000 -D347:0000000800087F88120E1208120E7F880008000000001F080108011401620000 -D348:0000000800087F88120E1208120E7F880008000008000800080008000FF80000 -D349:0000000800087F88120E1208120E7F8800080000000010F8101010301ECC0000 -D34A:0000000800087F88120E1208120E7F88000800000808087F081C08220F9C0000 -D34B:0000000800087F88120E1208120E7F880008000003F802000200020003F80000 -D34C:0000000800087F88120E1208120E7F880008000007F8000807F8040007F80000 -D34D:0000000800087F88120E1208120E7F88000800003EF802083E0820083E080000 -D34E:0000000800087F88120E1208120E7F88000800003EF802883E8820883EF80000 -D34F:0000000800087F88120E1208120E7F88000800003E8802883EF820883EF80000 -D350:0000000800087F88120E1208120E7F88000800001F0801081F0810141F620000 -D351:0000000800087F88120E1208120E7F88000800003EF802803EF820803EF80000 -D352:0000000800087F88120E1208120E7F88000800003EFC02483E4820483EFC0000 -D353:0000000800087F88120E1208120E7F88000800001F08017F1F1C10221F1C0000 -D354:0000000800087F88120E1208120E7F880008000003F802080208020803F80000 -D355:0000000800087F88120E1208120E7F88000800000208020803F8020803F80000 -D356:0000000800087F88120E1208120E7F8800080000110811081F0811141F620000 -D357:0000000800087F88120E1208120E7F8800080000001000100010006801840000 -D358:0000000800087F88120E1208120E7F88000800000048004800A8011406620000 -D359:0000000800087F88120E1208120E7F8800080000000003F00408040803F00000 -D35A:0000000800087F88120E1208120E7F880008000003F80020002000D003080000 -D35B:0000000800087F88120E1208120E7F8800080000004003F8004000A003180000 -D35C:0000000800087F88120E1208120E7F880008000003F8000803F8000800080000 -D35D:0000000800087F88120E1208120E7F880008000003F8020003F8020003F80000 -D35E:0000000800087F88120E1208120E7F880008000000000FF8022002200FF80000 -D35F:0000000800087F88120E1208120E7F880008000000800FF803E0041003E00000 -D360:00000000001200127FD21112111E11121112111E7FD200120012001200120000 -D361:0000002800287FA81238122812387FA80028000007F800080008000800080000 -D362:0000002800287FA81238122812387FA80028000000003EF80208020802080000 -D363:0000002800287FA81238122812387FA80028000000003E100210022802C40000 -D364:0000002800287FA81238122812387FA80028002808000800080008000FF80000 -D365:0000002800287FA81238122812387FA800280000000020F8201020303ECC0000 -D366:0000002800287FA81238122812387FA800280000202021FC207020883E700000 -D367:0000002800287FA81238122812387FA80028000003F802000200020003F80000 -D368:0000002800287FA81238122812387FA80028000007F8000807F8040007F80000 -D369:0000002800287FA81238122812387FA8002800003EF802083E0820083E080000 -D36A:0000002800287FA81238122812387FA8002800003EF802883E8820883EF80000 -D36B:0000002800287FA81238122812387FA8002800003E8802883EF820883EF80000 -D36C:0000002800287FA81238122812387FA8002800001F0801081F0810141F620000 -D36D:0000002800287FA81238122812387FA8002800003EF802803EF820803EF80000 -D36E:0000002800287FA81238122812387FA8002800003EFC02483E4820483EFC0000 -D36F:0000002800287FA81238122812387FA8002800003E1002FE3E3820443E380000 -D370:0000002800287FA81238122812387FA80028000003F802080208020803F80000 -D371:0000002800287FA81238122812387FA8002800000208020803F8020803F80000 -D372:0000002800287FA81238122812387FA800280000110811081F0811141F620000 -D373:0000002800287FA81238122812387FA800280000000800080008003400C20000 -D374:0000002800287FA81238122812387FA8002800000048004800A8011406620000 -D375:0000002800287FA81238122812387FA800280000000001F00208020801F00000 -D376:0000002800287FA81238122812387FA80028000003F80020002000D003080000 -D377:0000002800287FA81238122812387FA800280000004003F8004000A003180000 -D378:0000002800287FA81238122812387FA80028000003F8000803F8000800080000 -D379:0000002800287FA81238122812387FA80028000003F8020003F8020003F80000 -D37A:0000002800287FA81238122812387FA80028000000000FF8022002200FF80000 -D37B:0000002800287FA81238122812387FA80028000000800FF803E0041003E00000 -D37C:00000000000200027FC211021102111E110211027FC200020002000200020000 -D37D:0000000800087F881208123812087F8800080000000007F80008000800080000 -D37E:0000000800087F881208123812087F880008000000003EF80208020802080000 -D37F:0000000800087F881208123812087F880008000000001F080108011401620000 -D380:0000000800087F881208123812087F880008000000001000100010001FF80000 -D381:0000000800087F881208123812087F8800080000000020F8201020303ECC0000 -D382:0000000800087F881208123812087F8800080000202021FC207020883E700000 -D383:0000000800087F881208123812087F880008000003F802000200020003F80000 -D384:0000000800087F881208123812087F880008000007F8000807F8040007F80000 -D385:0000000800087F881208123812087F88000800003EF802083E0820083E080000 -D386:0000000800087F881208123812087F88000800003EF802883E8820883EF80000 -D387:0000000800087F881208123812087F88000800003E8802883EF820883EF80000 -D388:0000000800087F881208123812087F88000800000F8800880F8808140FA20000 -D389:0000000800087F881208123812087F88000800003EF802803EF820803EF80000 -D38A:0000000800087F881208123812087F88000800003EFC02483E4820483EFC0000 -D38B:0000000800087F881208123812087F88000800003E1002FE3E3820443E380000 -D38C:0000000800087F881208123812087F880008000003F802080208020803F80000 -D38D:0000000800087F881208123812087F88000800000208020803F8020803F80000 -D38E:0000000800087F881208123812087F8800080000210821083F0821143F620000 -D38F:0000000800087F881208123812087F8800080000001000100010006801840000 -D390:0000000800087F881208123812087F88000800000048004800A8011406620000 -D391:0000000800087F881208123812087F8800080000000003F00408040803F00000 -D392:0000000800087F881208123812087F880008000003F80020002000D003080000 -D393:0000000800087F881208123812087F8800080000004003F8004000A003180000 -D394:0000000800087F881208123812087F880008000003F8000803F8000800080000 -D395:0000000800087F881208123812087F880008000003F8020003F8020003F80000 -D396:0000000800087F881208123812087F880008000000000FF8022002200FF80000 -D397:0000000800087F881208123812087F880008000000800FF803E0041003E00000 -D398:00000000000A000A7FCA110A110A113A110A110A7FCA000A000A000A000A0000 -D399:0000002800287FA8122812E812287FA80028000007F800080008000800080000 -D39A:0000002800287FA8122812E812287FA80028000000003EF80208020802080000 -D39B:0000002800287FA8122812E812287FA80028000000003E100210022802C40000 -D39C:0000002800287FA8122812E812287FA80028000008000800080008000FF80000 -D39D:0000002800287FA8122812E812287FA800280000000020F8201020303ECC0000 -D39E:0000002800287FA8122812E812287FA800280000202021FC207020883E700000 -D39F:0000002800287FA8122812E812287FA80028000003F802000200020003F80000 -D3A0:0000002800287FA8122812E812287FA80028000007F8000807F8040007F80000 -D3A1:0000002800287FA8122812E812287FA8002800003EF802083E0820083E080000 -D3A2:0000002800287FA8122812E812287FA8002800003EF802883E8820883EF80000 -D3A3:0000002800287FA8122812E812287FA8002800003E8802883EF820883EF80000 -D3A4:0000002800287FA8122812E812287FA8002800001F0801081F0810141F620000 -D3A5:0000002800287FA8122812E812287FA8002800003EF802803EF820803EF80000 -D3A6:0000002800287FA8122812E812287FA8002800003EFC02483E4820483EFC0000 -D3A7:0000002800287FA8122812E812287FA8002800003E1002FE3E3820443E380000 -D3A8:0000002800287FA8122812E812287FA80028000003F802080208020803F80000 -D3A9:0000002800287FA8122812E812287FA8002800000208020803F8020803F80000 -D3AA:0000002800287FA8122812E812287FA800280000110811081F0811141F620000 -D3AB:0000002800287FA8122812E812287FA800280000000800080008003400C20000 -D3AC:0000002800287FA8122812E812287FA8002800000048004800A8011406620000 -D3AD:0000002800287FA8122812E812287FA800280000000001F00208020801F00000 -D3AE:0000002800287FA8122812E812287FA80028000003F80020002000D003080000 -D3AF:0000002800287FA8122812E812287FA800280000004003F8004000A003180000 -D3B0:0000002800287FA8122812E812287FA80028000003F8000803F8000800080000 -D3B1:0000002800287FA8122812E812287FA80028000003F8020003F8020003F80000 -D3B2:0000002800287FA8122812E812287FA80028000000000FF8022002200FF80000 -D3B3:0000002800287FA8122812E812287FA80028000000800FF803E0041003E00000 -D3B4:00000000000200027FC21102111E11021102111E7FC200020002000200020000 -D3B5:0000000800087F881238120812387F8800080000000007F80008000800080000 -D3B6:0000000800087F881238120812387F880008000000003EF80208020802080000 -D3B7:0000000800087F881238120812387F880008000000001F080108011401620000 -D3B8:0000000800087F881238120812387F880008000800001000100010001FF80000 -D3B9:0000000800087F881238120812387F8800080000000020F8201020303ECC0000 -D3BA:0000000800087F881238120812387F8800080000202021FC207020883E700000 -D3BB:0000000800087F881238120812387F880008000003F802000200020003F80000 -D3BC:0000000800087F881238120812387F880008000007F8000807F8040007F80000 -D3BD:0000000800087F881238120812387F88000800003EF802083E0820083E080000 -D3BE:0000000800087F881238120812387F88000800003EF802883E8820883EF80000 -D3BF:0000000800087F881238120812387F88000800003E8802883EF820883EF80000 -D3C0:0000000800087F881238120812387F88000800000F8800880F8808140FA20000 -D3C1:0000000800087F881238120812387F88000800003EF802803EF820803EF80000 -D3C2:0000000800087F881238120812387F88000800003EFC02483E4820483EFC0000 -D3C3:0000000800087F881238120812387F88000800003E1002FE3E3820443E380000 -D3C4:0000000800087F881238120812387F880008000003F802080208020803F80000 -D3C5:0000000800087F881238120812387F88000800000208020803F8020803F80000 -D3C6:0000000800087F881238120812387F8800080000210821083F0821143F620000 -D3C7:0000000800087F881238120812387F8800080000001000100010006801840000 -D3C8:0000000800087F881238120812387F88000800000048004800A8011406620000 -D3C9:0000000800087F881238120812387F8800080000000003F00408040803F00000 -D3CA:0000000800087F881238120812387F880008000003F80020002000D003080000 -D3CB:0000000800087F881238120812387F8800080000004003F8004000A003180000 -D3CC:0000000800087F881238120812387F880008000003F8000803F8000800080000 -D3CD:0000000800087F881238120812387F880008000003F8020003F8020003F80000 -D3CE:0000000800087F881238120812387F880008000000000FF8022002200FF80000 -D3CF:0000000800087F881238120812387F880008000000800FF803E0041003E00000 -D3D0:00000000000A000A7FCA110A113A110A110A113A7FCA000A000A000A000A0000 -D3D1:0000002800287FA812E8122812E87FA80028000007F800080008000800080000 -D3D2:0000002800287FA812E8122812E87FA80028000000003EF80208020802080000 -D3D3:0000002800287FA812E8122812E87FA80028000000003E100210022802C40000 -D3D4:0000002800287FA812E8122812E87FA80028002808000800080008000FF80000 -D3D5:0000002800287FA812E8122812E87FA800280000000020F8201020303ECC0000 -D3D6:0000002800287FA812E8122812E87FA800280000202021FC207020883E700000 -D3D7:0000002800287FA812E8122812E87FA80028000003F802000200020003F80000 -D3D8:0000002800287FA812E8122812E87FA80028000007F8000807F8040007F80000 -D3D9:0000002800287FA812E8122812E87FA8002800003EF802083E0820083E080000 -D3DA:0000002800287FA812E8122812E87FA8002800003EF802883E8820883EF80000 -D3DB:0000002800287FA812E8122812E87FA8002800003E8802883EF820883EF80000 -D3DC:0000002800287FA812E8122812E87FA8002800001F0801081F0810141F620000 -D3DD:0000002800287FA812E8122812E87FA8002800003EF802803EF820803EF80000 -D3DE:0000002800287FA812E8122812E87FA8002800003EFC02483E4820483EFC0000 -D3DF:0000002800287FA812E8122812E87FA8002800003E1002FE3E3820443E380000 -D3E0:0000002800287FA812E8122812E87FA80028000003F802080208020803F80000 -D3E1:0000002800287FA812E8122812E87FA8002800000208020803F8020803F80000 -D3E2:0000002800287FA812E8122812E87FA800280000110811081F0811141F620000 -D3E3:0000002800287FA812E8122812E87FA800280000000800080008003400C20000 -D3E4:0000002800287FA812E8122812E87FA8002800000048004800A8011406620000 -D3E5:0000002800287FA812E8122812E87FA800280000000001F00208020801F00000 -D3E6:0000002800287FA812E8122812E87FA80028000003F80020002000D003080000 -D3E7:0000002800287FA812E8122812E87FA800280000004003F8004000A003180000 -D3E8:0000002800287FA812E8122812E87FA80028000003F8000803F8000800080000 -D3E9:0000002800287FA812E8122812E87FA80028000003F8020003F8020003F80000 -D3EA:0000002800287FA812E8122812E87FA80028000000000FF8022002200FF80000 -D3EB:0000002800287FA812E8122812E87FA80028000000800FF803E0041003E00000 -D3EC:000000003FF808200820082008203FF8000000000100010001007FFC00000000 -D3ED:00001FF00440044004401FF0010001007FFC00001FF000100010001000100000 -D3EE:00001FF00440044004401FF0010001007FFC000000003EF80208020802080000 -D3EF:00001FF00440044004401FF0010001007FFC000000001E100210022802C40000 -D3F0:00001FF00440044004401FF0010001007FFC000000001000100010001FF00000 -D3F1:00001FF00440044004401FF0010001007FFC0000000020F8201020303ECC0000 -D3F2:00001FF00440044004401FF0010001007FFC0000202021FC207020883E700000 -D3F3:00001FF00440044004401FF0010001007FFC00001FF01000100010001FF00000 -D3F4:00001FF00440044004401FF0010001007FFC00001FF000101FF010001FF00000 -D3F5:00001FF00440044004401FF0010001007FFC00003EF802083E0820083E080000 -D3F6:00001FF00440044004401FF0010001007FFC00003EF802883E8820883EF80000 -D3F7:00001FF00440044004401FF0010001007FFC00003E8802883EF820883EF80000 -D3F8:00001FF00440044004401FF0010001007FFC00003E1002103E1020283EC40000 -D3F9:00001FF00440044004401FF0010001007FFC00003EF802803EF820803EF80000 -D3FA:00001FF00440044004401FF0010001007FFC00003EFC02483E4820483EFC0000 -D3FB:00001FF00440044004401FF0010001007FFC00003E2003FC3E7020883E700000 -D3FC:00001FF00440044004401FF0010001007FFC00001FF01010101010101FF00000 -D3FD:00001FF00440044004401FF0010001007FFC0000101010101FF010101FF00000 -D3FE:00001FF00440044004401FF0010001007FFC0000222022203E2022503E880000 -D3FF:00001FF00440044004401FF0010001007FFC000000000100010002800C400000 -D400:00001FF00440044004401FF0010001007FFC00000000024002400DA033100000 -D401:00001FF00440044004401FF0010001007FFC0000000007C00820082007C00000 -D402:00001FF00440044004401FF0010001007FFC0000000007E00080014006200000 -D403:00001FF00440044004401FF0010001007FFC0000008007E00080014006200000 -D404:00001FF00440044004401FF0010001007FFC00001FF000101FF0001000100000 -D405:00001FF00440044004401FF0010001007FFC00001FF010001FF010001FF00000 -D406:00001FF00440044004401FF0010001007FFC000000001FF0044004401FF00000 -D407:00001FF00440044004401FF0010001007FFC000001001FF007C0082007C00000 -D408:00000010001000107FD011101110111E11107FD0041004107FD0001000100000 -D409:000000083F881108110E3F88040804087FE8000007F800080008000800080000 -D40A:000000083F881108110E3F88040804087FE8000000003EF80208020802080000 -D40B:000000083F881108110E3F88040804087FE8000000001F080108011401620000 -D40C:000000083F881108110E3F88040804087FE8000008000800080008000FF80000 -D40D:000000083F881108110E3F88040804087FE80000000010F8101010301ECC0000 -D40E:000000083F881108110E3F88040804087FE800000808087F081C08220F9C0000 -D40F:000000083F881108110E3F88040804087FE8000003F802000200020003F80000 -D410:000000083F881108110E3F88040804087FE8000007F8000807F8040007F80000 -D411:000000083F881108110E3F88040804087FE800003EF802083E0820083E080000 -D412:000000083F881108110E3F88040804087FE800003EF802883E8820883EF80000 -D413:000000083F881108110E3F88040804087FE800003E8802883EF820883EF80000 -D414:000000083F881108110E3F88040804087FE800001F0801081F0810141F620000 -D415:000000083F881108110E3F88040804087FE800003EF802803EF820803EF80000 -D416:000000083F881108110E3F88040804087FE800003EFC02483E4820483EFC0000 -D417:000000083F881108110E3F88040804087FE800001F08017F1F1C10221F1C0000 -D418:000000083F881108110E3F88040804087FE8000003F802080208020803F80000 -D419:000000083F881108110E3F88040804087FE800000208020803F8020803F80000 -D41A:000000083F881108110E3F88040804087FE80000110811081F0811141F620000 -D41B:000000083F881108110E3F88040804087FE80000001000100010006801840000 -D41C:000000083F881108110E3F88040804087FE800000048004800A8011406620000 -D41D:000000083F881108110E3F88040804087FE80000000003F00408040803F00000 -D41E:000000083F881108110E3F88040804087FE8000003F80020002000D003080000 -D41F:000000083F881108110E3F88040804087FE80000004003F8004000A003180000 -D420:000000083F881108110E3F88040804087FE8000003F8000803F8000800080000 -D421:000000083F881108110E3F88040804087FE8000003F8020003F8020003F80000 -D422:000000083F881108110E3F88040804087FE8000000000FF8022002200FF80000 -D423:000000083F881108110E3F88040804087FE8000000800FF803E0041003E00000 -D424:00000012001200127FD211121112111E11127FD2041204127FD2001200120000 -D425:000000283FA8112811383FA8042804287FA8000007F800080008000800080000 -D426:000000283FA8112811383FA8042804287FA8000000003EF80208020802080000 -D427:000000283FA8112811383FA8042804287FA8000000001F080108011401620000 -D428:000000283FA8112811383FA8042804287FA8000008000800080008000FF80000 -D429:000000283FA8112811383FA8042804287FA80000000010F8101010301ECC0000 -D42A:000000283FA8112811383FA8042804287FA800000808087F081C08220F9C0000 -D42B:000000283FA8112811383FA8042804287FA8000003F802000200020003F80000 -D42C:000000283FA8112811383FA8042804287FA8000007F8000807F8040007F80000 -D42D:000000283FA8112811383FA8042804287FA800003EF802083E0820083E080000 -D42E:000000283FA8112811383FA8042804287FA800003EF802883E8820883EF80000 -D42F:000000283FA8112811383FA8042804287FA800003E8802883EF820883EF80000 -D430:000000283FA8112811383FA8042804287FA800001F0801081F0810141F620000 -D431:000000283FA8112811383FA8042804287FA800003EF802803EF820803EF80000 -D432:000000283FA8112811383FA8042804287FA800003EFC02483E4820483EFC0000 -D433:000000283FA8112811383FA8042804287FA800001F08017F1F1C10221F1C0000 -D434:000000283FA8112811383FA8042804287FA8000003F802080208020803F80000 -D435:000000283FA8112811383FA8042804287FA800000208020803F8020803F80000 -D436:000000283FA8112811383FA8042804287FA80000110811081F0811141F620000 -D437:000000283FA8112811383FA8042804287FA80000001000100010006801840000 -D438:000000283FA8112811383FA8042804287FA800000048004800A8011406620000 -D439:000000283FA8112811383FA8042804287FA80000000003F00408040803F00000 -D43A:000000283FA8112811383FA8042804287FA8000003F80020002000D003080000 -D43B:000000283FA8112811383FA8042804287FA80000004003F8004000A003180000 -D43C:000000283FA8112811383FA8042804287FA8000003F8000803F8000800080000 -D43D:000000283FA8112811383FA8042804287FA8000003F8020003F8020003F80000 -D43E:000000283FA8112811383FA8042804287FA8000000000FF8022002200FF80000 -D43F:000000283FA8112811383FA8042804287FA8000000800FF803E0041003E00000 -D440:00000008000800087FC811081108110811087FC8040804087FE8000800080000 -D441:000000083F88110811083F88040804087FE8000007F800080008000800080000 -D442:000000083F88110811083F88040804087FE8000000003EF80208020802080000 -D443:000000083F88110811083F88040804087FE8000000001F080108011401620000 -D444:000000083F88110811083F88040804087FE8000008000800080008000FF80000 -D445:000000083F88110811083F88040804087FE80000000010F8101010301ECC0000 -D446:000000083F88110811083F88040804087FE800000808087F081C08220F9C0000 -D447:000000083F88110811083F88040804087FE8000003F802000200020003F80000 -D448:000000083F88110811083F88040804087FE8000007F8000807F8040007F80000 -D449:000000083F88110811083F88040804087FE800003EF802083E0820083E080000 -D44A:000000083F88110811083F88040804087FE800003EF802883E8820883EF80000 -D44B:000000083F88110811083F88040804087FE800003E8802883EF820883EF80000 -D44C:000000083F88110811083F88040804087FE800001F0801081F0810141F620000 -D44D:000000083F88110811083F88040804087FE800003EF802803EF820803EF80000 -D44E:000000083F88110811083F88040804087FE800003EFC02483E4820483EFC0000 -D44F:000000083F88110811083F88040804087FE800001F08017F1F1C10221F1C0000 -D450:000000083F88110811083F88040804087FE8000003F802080208020803F80000 -D451:000000083F88110811083F88040804087FE800000208020803F8020803F80000 -D452:000000083F88110811083F88040804087FE80000110811081F0811141F620000 -D453:000000083F88110811083F88040804087FE80000001000100010006801840000 -D454:000000083F88110811083F88040804087FE800000048004800A8011406620000 -D455:000000083F88110811083F88040804087FE80000000003F00408040803F00000 -D456:000000083F88110811083F88040804087FE8000003F80020002000D003080000 -D457:000000083F88110811083F88040804087FE80000004003F8004000A003180000 -D458:000000083F88110811083F88040804087FE8000003F8000803F8000800080000 -D459:000000083F88110811083F88040804087FE8000003F8020003F8020003F80000 -D45A:000000083F88110811083F88040804087FE8000000000FF8022002200FF80000 -D45B:000000083F88110811083F88040804087FE8000000800FF803E0041003E00000 -D45C:000000003FF808200820082008203FF8000004400440044004407FFC00000000 -D45D:00001FF00440044004401FF0044004407FFC00001FF000100010001000100000 -D45E:00001FF00440044004401FF0044004407FFC000000003EF80208020802080000 -D45F:00001FF00440044004401FF0044004407FFC000000001E100210022802C40000 -D460:00001FF00440044004401FF0044004407FFC000000001000100010001FF00000 -D461:00001FF00440044004401FF0044004407FFC0000000020F8201020303ECC0000 -D462:00001FF00440044004401FF0044004407FFC0000202021FC207020883E700000 -D463:00001FF00440044004401FF0044004407FFC00001FF01000100010001FF00000 -D464:00001FF00440044004401FF0044004407FFC00001FF000101FF010001FF00000 -D465:00001FF00440044004401FF0044004407FFC00003EF802083E0820083E080000 -D466:00001FF00440044004401FF0044004407FFC00003EF802883E8820883EF80000 -D467:00001FF00440044004401FF0044004407FFC00003E8802883EF820883EF80000 -D468:00001FF00440044004401FF0044004407FFC00003E1002103E1020283EC40000 -D469:00001FF00440044004401FF0044004407FFC00003EF802803EF820803EF80000 -D46A:00001FF00440044004401FF0044004407FFC00003EFC02483E4820483EFC0000 -D46B:00001FF00440044004401FF0044004407FFC00003E2003FC3E7020883E700000 -D46C:00001FF00440044004401FF0044004407FFC00001FF01010101010101FF00000 -D46D:00001FF00440044004401FF0044004407FFC0000101010101FF010101FF00000 -D46E:00001FF00440044004401FF0044004407FFC0000222022203E2022503E880000 -D46F:00001FF00440044004401FF0044004407FFC000000000100010002800C400000 -D470:00001FF00440044004401FF0044004407FFC00000000024002400DA033100000 -D471:00001FF00440044004401FF0044004407FFC0000000007C00820082007C00000 -D472:00001FF00440044004401FF0044004407FFC0000000007E00080014006200000 -D473:00001FF00440044004401FF0044004407FFC0000008007E00080014006200000 -D474:00001FF00440044004401FF0044004407FFC00001FF000101FF0001000100000 -D475:00001FF00440044004401FF0044004407FFC00001FF010001FF010001FF00000 -D476:00001FF00440044004401FF0044004407FFC000000001FF0044004401FF00000 -D477:00001FF00440044004401FF0044004407FFC000001001FF007C0082007C00000 -D478:000000003FF808200820082008203FF8000000003FF801000100010001000000 -D479:00001FF00440044004401FF000007FFC010001001FF000100010001000100000 -D47A:00001FF00440044004401FF000007FFC0100010000003EF80208020802080000 -D47B:00001FF00440044004401FF000007FFC0100010000001E100210022802C40000 -D47C:00001FF00440044004401FF0000000007FFC010001001100100010001FF00000 -D47D:00001FF00440044004401FF000007FFC01000100000020F8201020303ECC0000 -D47E:00001FF00440044004401FF000007FFC01000100202021FC207020883E700000 -D47F:00001FF00440044004401FF000007FFC010001001FF01000100010001FF00000 -D480:00001FF00440044004401FF000007FFC010001001FF000101FF010001FF00000 -D481:00001FF00440044004401FF000007FFC010001003EF802083E0820083E080000 -D482:00001FF00440044004401FF000007FFC010001003EF802883E8820883EF80000 -D483:00001FF00440044004401FF000007FFC010001003E8802883EF820883EF80000 -D484:00001FF00440044004401FF000007FFC010001003E1002103E1020283EC40000 -D485:00001FF00440044004401FF000007FFC010001003EF802803EF820803EF80000 -D486:00001FF00440044004401FF000007FFC010001003EFC02483E4820483EFC0000 -D487:00001FF00440044004401FF000007FFC010001003E2003FC3E7020883E700000 -D488:00001FF00440044004401FF000007FFC010001001FF01010101010101FF00000 -D489:00001FF00440044004401FF000007FFC01000100101010101FF010101FF00000 -D48A:00001FF00440044004401FF000007FFC01000100222022203E2022503E880000 -D48B:00001FF00440044004401FF000007FFC0100010000000100010002800C400000 -D48C:00001FF00440044004401FF000007FFC010001000000024002400DA033100000 -D48D:00001FF00440044004401FF000007FFC01000100000007C00820082007C00000 -D48E:00001FF00440044004401FF000007FFC01000100000007E00080014006200000 -D48F:00001FF00440044004401FF000007FFC01000100008007E00080014006200000 -D490:00001FF00440044004401FF000007FFC010001001FF000101FF0001000100000 -D491:00001FF00440044004401FF000007FFC010001001FF010001FF010001FF00000 -D492:00001FF00440044004401FF000007FFC0100010000001FF0044004401FF00000 -D493:00001FF00440044004401FF000007FFC0100010001001FF007C0082007C00000 -D494:0000000800087FC811081108110811087FC800087FE8040804F8040804080000 -D495:00083F88110811083F8800087FE8027802080000000007F80008000800080000 -D496:00083F88110811083F8800087FE802780208000000003EF80208020802080000 -D497:00083F88110811083F8800087FE802780208000000001F080108011401620000 -D498:00083F88110811083F88000800087FE80278020802081000100010001FF80000 -D499:00083F88110811083F8800087FE8027802080000000020F8201020303ECC0000 -D49A:00083F88110811083F8800087FE8027802080000202021FC207020883E700000 -D49B:00083F88110811083F8800087FE802780208000003F802000200020003F80000 -D49C:00083F88110811083F8800087FE802780208000007F8000807F8040007F80000 -D49D:00083F88110811083F8800087FE80278020800003EF802083E0820083E080000 -D49E:00083F88110811083F8800087FE80278020800003EF802883E8820883EF80000 -D49F:00083F88110811083F8800087FE80278020800003E8802883EF820883EF80000 -D4A0:00083F88110811083F8800087FE80278020800000F8800880F8808140FA20000 -D4A1:00083F88110811083F8800087FE80278020800003EF802803EF820803EF80000 -D4A2:00083F88110811083F8800087FE80278020800003EFC02483E4820483EFC0000 -D4A3:00083F88110811083F8800087FE80278020800003E1002FE3E3820443E380000 -D4A4:00083F88110811083F8800087FE802780208000003F802080208020803F80000 -D4A5:00083F88110811083F8800087FE80278020800000208020803F8020803F80000 -D4A6:00083F88110811083F8800087FE8027802080000210821083F0821143F620000 -D4A7:00083F88110811083F8800087FE8027802080000001000100010006801840000 -D4A8:00083F88110811083F8800087FE80278020800000048004800A8011406620000 -D4A9:00083F88110811083F8800087FE8027802080000000003F00408040803F00000 -D4AA:00083F88110811083F8800087FE802780208000003F80020002000D003080000 -D4AB:00083F88110811083F8800087FE8027802080000004003F8004000A003180000 -D4AC:00083F88110811083F8800087FE802780208000003F8000803F8000800080000 -D4AD:00083F88110811083F8800087FE802780208000003F8020003F8020003F80000 -D4AE:00083F88110811083F8800087FE802780208000000000FF8022002200FF80000 -D4AF:00083F88110811083F8800087FE802780208000000800FF803E0041003E00000 -D4B0:0000000A000A7FCA110A110A110A110A7FCA000A7FEA040A047A040A040A0000 -D4B1:00283FA8112811283FA800287FA805E804280000000007F80008000800080000 -D4B2:00283FA8112811283FA800287FA805E80428000000003EF80208020802080000 -D4B3:00283FA8112811283FA800287FA805E80428000000001F080108011401620000 -D4B4:00283FA8112811283FA8002800287FA8042805E804281428100010001FF80000 -D4B5:00283FA8112811283FA800287FA805E804280000000020F8201020303ECC0000 -D4B6:00283FA8112811283FA800287FA805E804280000202021FC207020883E700000 -D4B7:00283FA8112811283FA800287FA805E80428000003F802000200020003F80000 -D4B8:00283FA8112811283FA800287FA805E80428000007F8000807F8040007F80000 -D4B9:00283FA8112811283FA800287FA805E8042800003EF802083E0820083E080000 -D4BA:00283FA8112811283FA800287FA805E8042800003EF802883E8820883EF80000 -D4BB:00283FA8112811283FA800287FA805E8042800003E8802883EF820883EF80000 -D4BC:00283FA8112811283FA800287FA805E8042800000F8800880F8808140FA20000 -D4BD:00283FA8112811283FA800287FA805E8042800003EF802803EF820803EF80000 -D4BE:00283FA8112811283FA800287FA805E8042800003EFC02483E4820483EFC0000 -D4BF:00283FA8112811283FA800287FA805E8042800003E1002FE3E3820443E380000 -D4C0:00283FA8112811283FA800287FA805E80428000003F802080208020803F80000 -D4C1:00283FA8112811283FA800287FA805E8042800000208020803F8020803F80000 -D4C2:00283FA8112811283FA800287FA805E804280000210821083F0821143F620000 -D4C3:00283FA8112811283FA800287FA805E804280000001000100010006801840000 -D4C4:00283FA8112811283FA800287FA805E8042800000048004800A8011406620000 -D4C5:00283FA8112811283FA800287FA805E804280000000003F00408040803F00000 -D4C6:00283FA8112811283FA800287FA805E80428000003F80020002000D003080000 -D4C7:00283FA8112811283FA800287FA805E804280000004003F8004000A003180000 -D4C8:00283FA8112811283FA800287FA805E80428000003F8000803F8000800080000 -D4C9:00283FA8112811283FA800287FA805E80428000003F8020003F8020003F80000 -D4CA:00283FA8112811283FA800287FA805E80428000000000FF8022002200FF80000 -D4CB:00283FA8112811283FA800287FA805E80428000000800FF803E0041003E00000 -D4CC:0000000800087FC811081108110811087FC800087FE804080408040804080000 -D4CD:00083F88110811083F8800087FE8020802000000000007F80008000800080000 -D4CE:00083F88110811083F8800087FE802080200000000003EF80208020802080000 -D4CF:00083F88110811083F8800087FE802080200000000001F080108011401620000 -D4D0:00083F88110811083F88000800087FE80208020802081008100010001FF80000 -D4D1:00083F88110811083F8800087FE8020802000000000020F8201020303ECC0000 -D4D2:00083F88110811083F8800087FE8020802000000202021FC207020883E700000 -D4D3:00083F88110811083F8800087FE802080200000003F802000200020003F80000 -D4D4:00083F88110811083F8800087FE802080200000007F8000807F8040007F80000 -D4D5:00083F88110811083F8800087FE80208020000003EF802083E0820083E080000 -D4D6:00083F88110811083F8800087FE80208020000003EF802883E8820883EF80000 -D4D7:00083F88110811083F8800087FE80208020000003E8802883EF820883EF80000 -D4D8:00083F88110811083F8800087FE80208020000000F8800880F8808140FA20000 -D4D9:00083F88110811083F8800087FE80208020000003EF802803EF820803EF80000 -D4DA:00083F88110811083F8800087FE80208020000003EFC02483E4820483EFC0000 -D4DB:00083F88110811083F8800087FE80208020000003E1002FE3E3820443E380000 -D4DC:00083F88110811083F8800087FE802080200000003F802080208020803F80000 -D4DD:00083F88110811083F8800087FE80208020000000208020803F8020803F80000 -D4DE:00083F88110811083F8800087FE8020802000000210821083F0821143F620000 -D4DF:00083F88110811083F8800087FE8020802000000001000100010006801840000 -D4E0:00083F88110811083F8800087FE80208020000000048004800A8011406620000 -D4E1:00083F88110811083F8800087FE8020802000000000003F00408040803F00000 -D4E2:00083F88110811083F8800087FE802080200000003F80020002000D003080000 -D4E3:00083F88110811083F8800087FE8020802000000004003F8004000A003180000 -D4E4:00083F88110811083F8800087FE802080200000003F8000803F8000800080000 -D4E5:00083F88110811083F8800087FE802080200000003F8020003F8020003F80000 -D4E6:00083F88110811083F8800087FE802080200000000000FF8022002200FF80000 -D4E7:00083F88110811083F8800087FE802080200000000800FF803E0041003E00000 -D4E8:000000003FF808200820082008203FF8000000007FFC04400440044004400000 -D4E9:00001FF00440044004401FF000007FFC044004401FF000100010001000100000 -D4EA:00001FF00440044004401FF000007FFC0440044000003EF80208020802080000 -D4EB:00001FF00440044004401FF000007FFC0440044000001E100210022802C40000 -D4EC:00001FF00440044004401FF0000000007FFC044004401440100010001FF00000 -D4ED:00001FF00440044004401FF000007FFC04400440000020F8201020303ECC0000 -D4EE:00001FF00440044004401FF000007FFC04400440202021FC207020883E700000 -D4EF:00001FF00440044004401FF000007FFC044004401FF01000100010001FF00000 -D4F0:00001FF00440044004401FF000007FFC044004401FF000101FF010001FF00000 -D4F1:00001FF00440044004401FF000007FFC044004403EF802083E0820083E080000 -D4F2:00001FF00440044004401FF000007FFC044004403EF802883E8820883EF80000 -D4F3:00001FF00440044004401FF000007FFC044004403E8802883EF820883EF80000 -D4F4:00001FF00440044004401FF000007FFC044004403E1002103E1020283EC40000 -D4F5:00001FF00440044004401FF000007FFC044004403EF802803EF820803EF80000 -D4F6:00001FF00440044004401FF000007FFC044004403EFC02483E4820483EFC0000 -D4F7:00001FF00440044004401FF000007FFC044004403E2003FC3E7020883E700000 -D4F8:00001FF00440044004401FF000007FFC044004401FF01010101010101FF00000 -D4F9:00001FF00440044004401FF000007FFC04400440101010101FF010101FF00000 -D4FA:00001FF00440044004401FF000007FFC04400440222022203E2022503E880000 -D4FB:00001FF00440044004401FF000007FFC0440044000000100010002800C400000 -D4FC:00001FF00440044004401FF000007FFC044004400000024002400DA033100000 -D4FD:00001FF00440044004401FF000007FFC04400440000007C00820082007C00000 -D4FE:00001FF00440044004401FF000007FFC04400440000007E00080014006200000 -D4FF:00001FF00440044004401FF000007FFC04400440008007E00080014006200000 -D500:00001FF00440044004401FF000007FFC044004401FF000101FF0001000100000 -D501:00001FF00440044004401FF000007FFC044004401FF010001FF010001FF00000 -D502:00001FF00440044004401FF000007FFC0440044000001FF0044004401FF00000 -D503:00001FF00440044004401FF000007FFC0440044001001FF007C0082007C00000 -D504:000000003FF808200820082008203FF80000000000007FFC0000000000000000 -D505:00001FF00440044004401FF0000000007FFC00001FF000100010001000100000 -D506:00001FF00440044004401FF0000000007FFC000000003EF80208020802080000 -D507:00001FF00440044004401FF0000000007FFC000000001E100210022802C40000 -D508:00001FF00440044004401FF0000000007FFC000000001000100010001FF00000 -D509:00001FF00440044004401FF0000000007FFC0000000020F8201020303ECC0000 -D50A:00001FF00440044004401FF0000000007FFC0000202021FC207020883E700000 -D50B:00001FF00440044004401FF0000000007FFC00001FF01000100010001FF00000 -D50C:00001FF00440044004401FF0000000007FFC00001FF000101FF010001FF00000 -D50D:00001FF00440044004401FF0000000007FFC00003EF802083E0820083E080000 -D50E:00001FF00440044004401FF0000000007FFC00003EF802883E8820883EF80000 -D50F:00001FF00440044004401FF0000000007FFC00003E8802883EF820883EF80000 -D510:00001FF00440044004401FF0000000007FFC00003E1002103E1020283EC40000 -D511:00001FF00440044004401FF0000000007FFC00003EF802803EF820803EF80000 -D512:00001FF00440044004401FF0000000007FFC00003EFC02483E4820483EFC0000 -D513:00001FF00440044004401FF0000000007FFC00003E2003FC3E7020883E700000 -D514:00001FF00440044004401FF0000000007FFC00001FF01010101010101FF00000 -D515:00001FF00440044004401FF0000000007FFC0000101010101FF010101FF00000 -D516:00001FF00440044004401FF0000000007FFC0000222022203E2022503E880000 -D517:00001FF00440044004401FF0000000007FFC000000000100010002800C400000 -D518:00001FF00440044004401FF0000000007FFC00000000024002400DA033100000 -D519:00001FF00440044004401FF0000000007FFC0000000007C00820082007C00000 -D51A:00001FF00440044004401FF0000000007FFC0000000007E00080014006200000 -D51B:00001FF00440044004401FF0000000007FFC0000008007E00080014006200000 -D51C:00001FF00440044004401FF0000000007FFC00001FF000101FF0001000100000 -D51D:00001FF00440044004401FF0000000007FFC00001FF010001FF010001FF00000 -D51E:00001FF00440044004401FF0000000007FFC000000001FF0044004401FF00000 -D51F:00001FF00440044004401FF0000000007FFC000001001FF007C0082007C00000 -D520:00000008000800087FC811081108110811087FC800087FE80008000800080000 -D521:000000083F88110811083F88000800087FE8000007F800080008000800080000 -D522:000000083F88110811083F88000800087FE8000000003EF80208020802080000 -D523:000000083F88110811083F88000800087FE8000000001F080108011401620000 -D524:000000083F88110811083F88000800087FE8000008000800080008000FF80000 -D525:000000083F88110811083F88000800087FE80000000010F8101010301ECC0000 -D526:000000083F88110811083F88000800087FE800000808087F081C08220F9C0000 -D527:000000083F88110811083F88000800087FE8000003F802000200020003F80000 -D528:000000083F88110811083F88000800087FE8000007F8000807F8040007F80000 -D529:000000083F88110811083F88000800087FE800003EF802083E0820083E080000 -D52A:000000083F88110811083F88000800087FE800003EF802883E8820883EF80000 -D52B:000000083F88110811083F88000800087FE800003E8802883EF820883EF80000 -D52C:000000083F88110811083F88000800087FE800001F0801081F0810141F620000 -D52D:000000083F88110811083F88000800087FE800003EF802803EF820803EF80000 -D52E:000000083F88110811083F88000800087FE800003EFC02483E4820483EFC0000 -D52F:000000083F88110811083F88000800087FE800001F08017F1F1C10221F1C0000 -D530:000000083F88110811083F88000800087FE8000003F802080208020803F80000 -D531:000000083F88110811083F88000800087FE800000208020803F8020803F80000 -D532:000000083F88110811083F88000800087FE80000110811081F0811141F620000 -D533:000000083F88110811083F88000800087FE80000001000100010006801840000 -D534:000000083F88110811083F88000800087FE800000048004800A8011406620000 -D535:000000083F88110811083F88000800087FE80000000003F00408040803F00000 -D536:000000083F88110811083F88000800087FE8000003F80020002000D003080000 -D537:000000083F88110811083F88000800087FE80000004003F8004000A003180000 -D538:000000083F88110811083F88000800087FE8000003F8000803F8000800080000 -D539:000000083F88110811083F88000800087FE8000003F8020003F8020003F80000 -D53A:000000083F88110811083F88000800087FE8000000000FF8022002200FF80000 -D53B:000000083F88110811083F88000800087FE8000000800FF803E0041003E00000 -D53C:00000000000800087FC8110811081108110811087FC800080008000800080000 -D53D:0000000800087F881208120812087F8800080000000007F80008000800080000 -D53E:0000000800087F881208120812087F880008000000003EF80208020802080000 -D53F:0000000800087F881208120812087F880008000000001F080108011401620000 -D540:0000000800087F881208120812087F880008000800001000100010001FF80000 -D541:0000000800087F881208120812087F8800080000000020F8201020303ECC0000 -D542:0000000800087F881208120812087F8800080000202021FC207020883E700000 -D543:0000000800087F881208120812087F880008000003F802000200020003F80000 -D544:0000000800087F881208120812087F880008000007F8000807F8040007F80000 -D545:0000000800087F881208120812087F88000800003EF802083E0820083E080000 -D546:0000000800087F881208120812087F88000800003EF802883E8820883EF80000 -D547:0000000800087F881208120812087F88000800003E8802883EF820883EF80000 -D548:0000000800087F881208120812087F88000800000F8800880F8808140FA20000 -D549:0000000800087F881208120812087F88000800003EF802803EF820803EF80000 -D54A:0000000800087F881208120812087F88000800003EFC02483E4820483EFC0000 -D54B:0000000800087F881208120812087F88000800003E1002FE3E3820443E380000 -D54C:0000000800087F881208120812087F880008000003F802080208020803F80000 -D54D:0000000800087F881208120812087F88000800000208020803F8020803F80000 -D54E:0000000800087F881208120812087F8800080000210821083F0821143F620000 -D54F:0000000800087F881208120812087F8800080000001000100010006801840000 -D550:0000000800087F881208120812087F88000800000048004800A8011406620000 -D551:0000000800087F881208120812087F8800080000000003F00408040803F00000 -D552:0000000800087F881208120812087F880008000003F80020002000D003080000 -D553:0000000800087F881208120812087F8800080000004003F8004000A003180000 -D554:0000000800087F881208120812087F880008000003F8000803F8000800080000 -D555:0000000800087F881208120812087F880008000003F8020003F8020003F80000 -D556:0000000800087F881208120812087F880008000000000FF8022002200FF80000 -D557:0000000800087F881208120812087F880008000000800FF803E0041003E00000 -D558:00000000041004103F900E101110209E2090209011100E100010001000100000 -D559:000008087F081C082208220E22081C080008000007F800080008000800080000 -D55A:000008087F081C082208220E22081C080008000000003EF80208020802080000 -D55B:000008087F081C082208220E22081C080008000000001F080108011401620000 -D55C:000008087F081C082208220E22081C080008000808000800080008000FF80000 -D55D:000008087F081C082208220E22081C0800080000000010F8101010301ECC0000 -D55E:000008087F081C082208220E22081C08000800000808087F081C08220F9C0000 -D55F:000008087F081C082208220E22081C080008000003F802000200020003F80000 -D560:000008087F081C082208220E22081C080008000007F8000807F8040007F80000 -D561:000008087F081C082208220E22081C08000800003EF802083E0820083E080000 -D562:000008087F081C082208220E22081C08000800003EF802883E8820883EF80000 -D563:000008087F081C082208220E22081C08000800003E8802883EF820883EF80000 -D564:000008087F081C082208220E22081C08000800001F0801081F0810141F620000 -D565:000008087F081C082208220E22081C08000800003EF802803EF820803EF80000 -D566:000008087F081C082208220E22081C08000800003EFC02483E4820483EFC0000 -D567:000008087F081C082208220E22081C08000800001F08017F1F1C10221F1C0000 -D568:000008087F081C082208220E22081C080008000003F802080208020803F80000 -D569:000008087F081C082208220E22081C08000800000208020803F8020803F80000 -D56A:000008087F081C082208220E22081C0800080000110811081F0811141F620000 -D56B:000008087F081C082208220E22081C0800080000001000100010006801840000 -D56C:000008087F081C082208220E22081C08000800000048004800A8011406620000 -D56D:000008087F081C082208220E22081C0800080000000003F00408040803F00000 -D56E:000008087F081C082208220E22081C080008000003F80020002000D003080000 -D56F:000008087F081C082208220E22081C0800080000004003F8004000A003180000 -D570:000008087F081C082208220E22081C080008000003F8000803F8000800080000 -D571:000008087F081C082208220E22081C080008000003F8020003F8020003F80000 -D572:000008087F081C082208220E22081C080008000000000FF8022002200FF80000 -D573:000008087F081C082208220E22081C080008000000800FF803E0041003E00000 -D574:00000000041204123F920E121112209E2092209211120E120012001200120000 -D575:000008287F281C282228223822281C280028000007F800080008000800080000 -D576:000008287F281C282228223822281C280028000000003EF80208020802080000 -D577:000008287F281C282228223822281C280028000000003E100210022802C40000 -D578:000008287F281C282228223822281C280028002808000800080008000FF80000 -D579:000008287F281C282228223822281C2800280000000020F8201020303ECC0000 -D57A:000008287F281C282228223822281C2800280000202021FC207020883E700000 -D57B:000008287F281C282228223822281C280028000003F802000200020003F80000 -D57C:000008287F281C282228223822281C280028000007F8000807F8040007F80000 -D57D:000008287F281C282228223822281C28002800003EF802083E0820083E080000 -D57E:000008287F281C282228223822281C28002800003EF802883E8820883EF80000 -D57F:000008287F281C282228223822281C28002800003E8802883EF820883EF80000 -D580:000008287F281C282228223822281C28002800001F0801081F0810141F620000 -D581:000008287F281C282228223822281C28002800003EF802803EF820803EF80000 -D582:000008287F281C282228223822281C28002800003EFC02483E4820483EFC0000 -D583:000008287F281C282228223822281C28002800003E1002FE3E3820443E380000 -D584:000008287F281C282228223822281C280028000003F802080208020803F80000 -D585:000008287F281C282228223822281C28002800000208020803F8020803F80000 -D586:000008287F281C282228223822281C2800280000110811081F0811141F620000 -D587:000008287F281C282228223822281C2800280000000800080008003400C20000 -D588:000008287F281C282228223822281C28002800000048004800A8011406620000 -D589:000008287F281C282228223822281C2800280000000001F00208020801F00000 -D58A:000008287F281C282228223822281C280028000003F80020002000D003080000 -D58B:000008287F281C282228223822281C2800280000004003F8004000A003180000 -D58C:000008287F281C282228223822281C280028000003F8000803F8000800080000 -D58D:000008287F281C282228223822281C280028000003F8020003F8020003F80000 -D58E:000008287F281C282228223822281C280028000000000FF8022002200FF80000 -D58F:000008287F281C282228223822281C280028000000800FF803E0041003E00000 -D590:00000000041004103F900E10111E20902090209E11100E100010001000100000 -D591:000008087F081C08220E2208220E1C080008000007F800080008000800080000 -D592:000008087F081C08220E2208220E1C080008000000003EF80208020802080000 -D593:000008087F081C08220E2208220E1C080008000000001F080108011401620000 -D594:000008087F081C08220E2208220E1C080008000008000800080008000FF80000 -D595:000008087F081C08220E2208220E1C0800080000000010F8101010301ECC0000 -D596:000008087F081C08220E2208220E1C08000800000808087F081C08220F9C0000 -D597:000008087F081C08220E2208220E1C080008000003F802000200020003F80000 -D598:000008087F081C08220E2208220E1C080008000007F8000807F8040007F80000 -D599:000008087F081C08220E2208220E1C08000800003EF802083E0820083E080000 -D59A:000008087F081C08220E2208220E1C08000800003EF802883E8820883EF80000 -D59B:000008087F081C08220E2208220E1C08000800003E8802883EF820883EF80000 -D59C:000008087F081C08220E2208220E1C08000800001F0801081F0810141F620000 -D59D:000008087F081C08220E2208220E1C08000800003EF802803EF820803EF80000 -D59E:000008087F081C08220E2208220E1C08000800003EFC02483E4820483EFC0000 -D59F:000008087F081C08220E2208220E1C08000800001F08017F1F1C10221F1C0000 -D5A0:000008087F081C08220E2208220E1C080008000003F802080208020803F80000 -D5A1:000008087F081C08220E2208220E1C08000800000208020803F8020803F80000 -D5A2:000008087F081C08220E2208220E1C0800080000110811081F0811141F620000 -D5A3:000008087F081C08220E2208220E1C0800080000001000100010006801840000 -D5A4:000008087F081C08220E2208220E1C08000800000048004800A8011406620000 -D5A5:000008087F081C08220E2208220E1C0800080000000003F00408040803F00000 -D5A6:000008087F081C08220E2208220E1C080008000003F80020002000D003080000 -D5A7:000008087F081C08220E2208220E1C0800080000004003F8004000A003180000 -D5A8:000008087F081C08220E2208220E1C080008000003F8000803F8000800080000 -D5A9:000008087F081C08220E2208220E1C080008000003F8020003F8020003F80000 -D5AA:000008087F081C08220E2208220E1C080008000000000FF8022002200FF80000 -D5AB:000008087F081C08220E2208220E1C080008000000800FF803E0041003E00000 -D5AC:00000000041204123F920E12111E20922092209E11120E120012001200120000 -D5AD:000008287F281C282238222822381C280028000007F800080008000800080000 -D5AE:000008287F281C282238222822381C280028000000003EF80208020802080000 -D5AF:000008287F281C282238222822381C280028000000003E100210022802C40000 -D5B0:000008287F281C282238222822381C280028002808000800080008000FF80000 -D5B1:000008287F281C282238222822381C2800280000000020F8201020303ECC0000 -D5B2:000008287F281C282238222822381C2800280000202021FC207020883E700000 -D5B3:000008287F281C282238222822381C280028000003F802000200020003F80000 -D5B4:000008287F281C282238222822381C280028000007F8000807F8040007F80000 -D5B5:000008287F281C282238222822381C28002800003EF802083E0820083E080000 -D5B6:000008287F281C282238222822381C28002800003EF802883E8820883EF80000 -D5B7:000008287F281C282238222822381C28002800003E8802883EF820883EF80000 -D5B8:000008287F281C282238222822381C28002800001F0801081F0810141F620000 -D5B9:000008287F281C282238222822381C28002800003EF802803EF820803EF80000 -D5BA:000008287F281C282238222822381C28002800003EFC02483E4820483EFC0000 -D5BB:000008287F281C282238222822381C28002800003E1002FE3E3820443E380000 -D5BC:000008287F281C282238222822381C280028000003F802080208020803F80000 -D5BD:000008287F281C282238222822381C28002800000208020803F8020803F80000 -D5BE:000008287F281C282238222822381C2800280000110811081F0811141F620000 -D5BF:000008287F281C282238222822381C2800280000000800080008003400C20000 -D5C0:000008287F281C282238222822381C28002800000048004800A8011406620000 -D5C1:000008287F281C282238222822381C2800280000000001F00208020801F00000 -D5C2:000008287F281C282238222822381C280028000003F80020002000D003080000 -D5C3:000008287F281C282238222822381C2800280000004003F8004000A003180000 -D5C4:000008287F281C282238222822381C280028000003F8000803F8000800080000 -D5C5:000008287F281C282238222822381C280028000003F8020003F8020003F80000 -D5C6:000008287F281C282238222822381C280028000000000FF8022002200FF80000 -D5C7:000008287F281C282238222822381C280028000000800FF803E0041003E00000 -D5C8:00000000040204023F820E021102209E2082208211020E020002000200020000 -D5C9:000008087F081C082208223822081C0800080000000007F80008000800080000 -D5CA:000008087F081C082208223822081C080008000000003EF80208020802080000 -D5CB:000008087F081C082208223822081C080008000000001F080108011401620000 -D5CC:000008087F081C082208223822081C080008000000001000100010001FF80000 -D5CD:000008087F081C082208223822081C0800080000000020F8201020303ECC0000 -D5CE:000008087F081C082208223822081C0800080000202021FC207020883E700000 -D5CF:000008087F081C082208223822081C080008000003F802000200020003F80000 -D5D0:000008087F081C082208223822081C080008000007F8000807F8040007F80000 -D5D1:000008087F081C082208223822081C08000800003EF802083E0820083E080000 -D5D2:000008087F081C082208223822081C08000800003EF802883E8820883EF80000 -D5D3:000008087F081C082208223822081C08000800003E8802883EF820883EF80000 -D5D4:000008087F081C082208223822081C08000800000F8800880F8808140FA20000 -D5D5:000008087F081C082208223822081C08000800003EF802803EF820803EF80000 -D5D6:000008087F081C082208223822081C08000800003EFC02483E4820483EFC0000 -D5D7:000008087F081C082208223822081C08000800003E1002FE3E3820443E380000 -D5D8:000008087F081C082208223822081C080008000003F802080208020803F80000 -D5D9:000008087F081C082208223822081C08000800000208020803F8020803F80000 -D5DA:000008087F081C082208223822081C0800080000210821083F0821143F620000 -D5DB:000008087F081C082208223822081C0800080000001000100010006801840000 -D5DC:000008087F081C082208223822081C08000800000048004800A8011406620000 -D5DD:000008087F081C082208223822081C0800080000000003F00408040803F00000 -D5DE:000008087F081C082208223822081C080008000003F80020002000D003080000 -D5DF:000008087F081C082208223822081C0800080000004003F8004000A003180000 -D5E0:000008087F081C082208223822081C080008000003F8000803F8000800080000 -D5E1:000008087F081C082208223822081C080008000003F8020003F8020003F80000 -D5E2:000008087F081C082208223822081C080008000000000FF8022002200FF80000 -D5E3:000008087F081C082208223822081C080008000000800FF803E0041003E00000 -D5E4:00000000040A040A3F8A0E0A110A20BA208A208A110A0E0A000A000A000A0000 -D5E5:000008287F281C28222822E822281C280028000007F800080008000800080000 -D5E6:000008287F281C28222822E822281C280028000000003EF80208020802080000 -D5E7:000008287F281C28222822E822281C280028000000003E100210022802C40000 -D5E8:000008287F281C28222822E822281C280028000008000800080008000FF80000 -D5E9:000008287F281C28222822E822281C2800280000000020F8201020303ECC0000 -D5EA:000008287F281C28222822E822281C2800280000202021FC207020883E700000 -D5EB:000008287F281C28222822E822281C280028000003F802000200020003F80000 -D5EC:000008287F281C28222822E822281C280028000007F8000807F8040007F80000 -D5ED:000008287F281C28222822E822281C28002800003EF802083E0820083E080000 -D5EE:000008287F281C28222822E822281C28002800003EF802883E8820883EF80000 -D5EF:000008287F281C28222822E822281C28002800003E8802883EF820883EF80000 -D5F0:000008287F281C28222822E822281C28002800001F0801081F0810141F620000 -D5F1:000008287F281C28222822E822281C28002800003EF802803EF820803EF80000 -D5F2:000008287F281C28222822E822281C28002800003EFC02483E4820483EFC0000 -D5F3:000008287F281C28222822E822281C28002800003E1002FE3E3820443E380000 -D5F4:000008287F281C28222822E822281C280028000003F802080208020803F80000 -D5F5:000008287F281C28222822E822281C28002800000208020803F8020803F80000 -D5F6:000008287F281C28222822E822281C2800280000110811081F0811141F620000 -D5F7:000008287F281C28222822E822281C2800280000000800080008003400C20000 -D5F8:000008287F281C28222822E822281C28002800000048004800A8011406620000 -D5F9:000008287F281C28222822E822281C2800280000000001F00208020801F00000 -D5FA:000008287F281C28222822E822281C280028000003F80020002000D003080000 -D5FB:000008287F281C28222822E822281C2800280000004003F8004000A003180000 -D5FC:000008287F281C28222822E822281C280028000003F8000803F8000800080000 -D5FD:000008287F281C28222822E822281C280028000003F8020003F8020003F80000 -D5FE:000008287F281C28222822E822281C280028000000000FF8022002200FF80000 -D5FF:000008287F281C28222822E822281C280028000000800FF803E0041003E00000 -D600:00000000040204023F820E02111E20822082209E11020E020002000200020000 -D601:000008087F081C082238220822381C0800080000000007F80008000800080000 -D602:000008087F081C082238220822381C080008000000003EF80208020802080000 -D603:000008087F081C082238220822381C080008000000001F080108011401620000 -D604:000008087F081C082238220822381C080008000800001000100010001FF80000 -D605:000008087F081C082238220822381C0800080000000020F8201020303ECC0000 -D606:000008087F081C082238220822381C0800080000202021FC207020883E700000 -D607:000008087F081C082238220822381C080008000003F802000200020003F80000 -D608:000008087F081C082238220822381C080008000007F8000807F8040007F80000 -D609:000008087F081C082238220822381C08000800003EF802083E0820083E080000 -D60A:000008087F081C082238220822381C08000800003EF802883E8820883EF80000 -D60B:000008087F081C082238220822381C08000800003E8802883EF820883EF80000 -D60C:000008087F081C082238220822381C08000800000F8800880F8808140FA20000 -D60D:000008087F081C082238220822381C08000800003EF802803EF820803EF80000 -D60E:000008087F081C082238220822381C08000800003EFC02483E4820483EFC0000 -D60F:000008087F081C082238220822381C08000800003E1002FE3E3820443E380000 -D610:000008087F081C082238220822381C080008000003F802080208020803F80000 -D611:000008087F081C082238220822381C08000800000208020803F8020803F80000 -D612:000008087F081C082238220822381C0800080000210821083F0821143F620000 -D613:000008087F081C082238220822381C0800080000001000100010006801840000 -D614:000008087F081C082238220822381C08000800000048004800A8011406620000 -D615:000008087F081C082238220822381C0800080000000003F00408040803F00000 -D616:000008087F081C082238220822381C080008000003F80020002000D003080000 -D617:000008087F081C082238220822381C0800080000004003F8004000A003180000 -D618:000008087F081C082238220822381C080008000003F8000803F8000800080000 -D619:000008087F081C082238220822381C080008000003F8020003F8020003F80000 -D61A:000008087F081C082238220822381C080008000000000FF8022002200FF80000 -D61B:000008087F081C082238220822381C080008000000800FF803E0041003E00000 -D61C:00000000040A040A3F8A0E0A113A208A208A20BA110A0E0A000A000A000A0000 -D61D:000008287F281C2822E8222822E81C280028000007F800080008000800080000 -D61E:000008287F281C2822E8222822E81C280028000000003EF80208020802080000 -D61F:000008287F281C2822E8222822E81C280028000000003E100210022802C40000 -D620:000008287F281C2822E8222822E81C280028002808000800080008000FF80000 -D621:000008287F281C2822E8222822E81C2800280000000020F8201020303ECC0000 -D622:000008287F281C2822E8222822E81C2800280000202021FC207020883E700000 -D623:000008287F281C2822E8222822E81C280028000003F802000200020003F80000 -D624:000008287F281C2822E8222822E81C280028000007F8000807F8040007F80000 -D625:000008287F281C2822E8222822E81C28002800003EF802083E0820083E080000 -D626:000008287F281C2822E8222822E81C28002800003EF802883E8820883EF80000 -D627:000008287F281C2822E8222822E81C28002800003E8802883EF820883EF80000 -D628:000008287F281C2822E8222822E81C28002800001F0801081F0810141F620000 -D629:000008287F281C2822E8222822E81C28002800003EF802803EF820803EF80000 -D62A:000008287F281C2822E8222822E81C28002800003EFC02483E4820483EFC0000 -D62B:000008287F281C2822E8222822E81C28002800003E1002FE3E3820443E380000 -D62C:000008287F281C2822E8222822E81C280028000003F802080208020803F80000 -D62D:000008287F281C2822E8222822E81C28002800000208020803F8020803F80000 -D62E:000008287F281C2822E8222822E81C2800280000110811081F0811141F620000 -D62F:000008287F281C2822E8222822E81C2800280000000800080008003400C20000 -D630:000008287F281C2822E8222822E81C28002800000048004800A8011406620000 -D631:000008287F281C2822E8222822E81C2800280000000001F00208020801F00000 -D632:000008287F281C2822E8222822E81C280028000003F80020002000D003080000 -D633:000008287F281C2822E8222822E81C2800280000004003F8004000A003180000 -D634:000008287F281C2822E8222822E81C280028000003F8000803F8000800080000 -D635:000008287F281C2822E8222822E81C280028000003F8020003F8020003F80000 -D636:000008287F281C2822E8222822E81C280028000000000FF8022002200FF80000 -D637:000008287F281C2822E8222822E81C280028000000800FF803E0041003E00000 -D638:0000010001000FE0000007C00820082007C000000100010001007FFC00000000 -D639:01000FE007C00820082007C0010001007FFC00001FF000100010001000100000 -D63A:01000FE007C00820082007C0010001007FFC000000003EF80208020802080000 -D63B:01000FE007C00820082007C0010001007FFC000000001E100210022802C40000 -D63C:01000FE007C00820082007C0010001007FFC000000001000100010001FF00000 -D63D:01000FE007C00820082007C0010001007FFC0000000020F8201020303ECC0000 -D63E:01000FE007C00820082007C0010001007FFC0000202021FC207020883E700000 -D63F:01000FE007C00820082007C0010001007FFC00001FF01000100010001FF00000 -D640:01000FE007C00820082007C0010001007FFC00001FF000101FF010001FF00000 -D641:01000FE007C00820082007C0010001007FFC00003EF802083E0820083E080000 -D642:01000FE007C00820082007C0010001007FFC00003EF802883E8820883EF80000 -D643:01000FE007C00820082007C0010001007FFC00003E8802883EF820883EF80000 -D644:01000FE007C00820082007C0010001007FFC00003E1002103E1020283EC40000 -D645:01000FE007C00820082007C0010001007FFC00003EF802803EF820803EF80000 -D646:01000FE007C00820082007C0010001007FFC00003EFC02483E4820483EFC0000 -D647:01000FE007C00820082007C0010001007FFC00003E2003FC3E7020883E700000 -D648:01000FE007C00820082007C0010001007FFC00001FF01010101010101FF00000 -D649:01000FE007C00820082007C0010001007FFC0000101010101FF010101FF00000 -D64A:01000FE007C00820082007C0010001007FFC0000222022203E2022503E880000 -D64B:01000FE007C00820082007C0010001007FFC000000000100010002800C400000 -D64C:01000FE007C00820082007C0010001007FFC00000000024002400DA033100000 -D64D:01000FE007C00820082007C0010001007FFC0000000007C00820082007C00000 -D64E:01000FE007C00820082007C0010001007FFC0000000007E00080014006200000 -D64F:01000FE007C00820082007C0010001007FFC0000008007E00080014006200000 -D650:01000FE007C00820082007C0010001007FFC00001FF000101FF0001000100000 -D651:01000FE007C00820082007C0010001007FFC00001FF010001FF010001FF00000 -D652:01000FE007C00820082007C0010001007FFC000000001FF0044004401FF00000 -D653:01000FE007C00820082007C0010001007FFC000001001FF007C0082007C00000 -D654:00000010041004103F9000101F10209E20901F10041004107FD0001000100000 -D655:000004083F880E08110E11080E0804087FE8000007F800080008000800080000 -D656:000004083F880E08110E11080E0804087FE8000000003EF80208020802080000 -D657:000004083F880E08110E11080E0804087FE8000000001F080108011401620000 -D658:000004083F880E08110E11080E0804087FE8000008000800080008000FF80000 -D659:000004083F880E08110E11080E0804087FE80000000010F8101010301ECC0000 -D65A:000004083F880E08110E11080E0804087FE800000808087F081C08220F9C0000 -D65B:000004083F880E08110E11080E0804087FE8000003F802000200020003F80000 -D65C:000004083F880E08110E11080E0804087FE8000007F8000807F8040007F80000 -D65D:000004083F880E08110E11080E0804087FE800003EF802083E0820083E080000 -D65E:000004083F880E08110E11080E0804087FE800003EF802883E8820883EF80000 -D65F:000004083F880E08110E11080E0804087FE800003E8802883EF820883EF80000 -D660:000004083F880E08110E11080E0804087FE800001F0801081F0810141F620000 -D661:000004083F880E08110E11080E0804087FE800003EF802803EF820803EF80000 -D662:000004083F880E08110E11080E0804087FE800003EFC02483E4820483EFC0000 -D663:000004083F880E08110E11080E0804087FE800001F08017F1F1C10221F1C0000 -D664:000004083F880E08110E11080E0804087FE8000003F802080208020803F80000 -D665:000004083F880E08110E11080E0804087FE800000208020803F8020803F80000 -D666:000004083F880E08110E11080E0804087FE80000110811081F0811141F620000 -D667:000004083F880E08110E11080E0804087FE80000001000100010006801840000 -D668:000004083F880E08110E11080E0804087FE800000048004800A8011406620000 -D669:000004083F880E08110E11080E0804087FE80000000003F00408040803F00000 -D66A:000004083F880E08110E11080E0804087FE8000003F80020002000D003080000 -D66B:000004083F880E08110E11080E0804087FE80000004003F8004000A003180000 -D66C:000004083F880E08110E11080E0804087FE8000003F8000803F8000800080000 -D66D:000004083F880E08110E11080E0804087FE8000003F8020003F8020003F80000 -D66E:000004083F880E08110E11080E0804087FE8000000000FF8022002200FF80000 -D66F:000004083F880E08110E11080E0804087FE8000000800FF803E0041003E00000 -D670:00000012041204123F9200121F12209E20921F12041204127FD2001200120000 -D671:000004283FA80E28113811280E2804287FA8000007F800080008000800080000 -D672:000004283FA80E28113811280E2804287FA8000000003EF80208020802080000 -D673:000004283FA80E28113811280E2804287FA8000000001F080108011401620000 -D674:000004283FA80E28113811280E2804287FA8000008000800080008000FF80000 -D675:000004283FA80E28113811280E2804287FA80000000010F8101010301ECC0000 -D676:000004283FA80E28113811280E2804287FA800000808087F081C08220F9C0000 -D677:000004283FA80E28113811280E2804287FA8000003F802000200020003F80000 -D678:000004283FA80E28113811280E2804287FA8000007F8000807F8040007F80000 -D679:000004283FA80E28113811280E2804287FA800003EF802083E0820083E080000 -D67A:000004283FA80E28113811280E2804287FA800003EF802883E8820883EF80000 -D67B:000004283FA80E28113811280E2804287FA800003E8802883EF820883EF80000 -D67C:000004283FA80E28113811280E2804287FA800001F0801081F0810141F620000 -D67D:000004283FA80E28113811280E2804287FA800003EF802803EF820803EF80000 -D67E:000004283FA80E28113811280E2804287FA800003EFC02483E4820483EFC0000 -D67F:000004283FA80E28113811280E2804287FA800001F08017F1F1C10221F1C0000 -D680:000004283FA80E28113811280E2804287FA8000003F802080208020803F80000 -D681:000004283FA80E28113811280E2804287FA800000208020803F8020803F80000 -D682:000004283FA80E28113811280E2804287FA80000110811081F0811141F620000 -D683:000004283FA80E28113811280E2804287FA80000001000100010006801840000 -D684:000004283FA80E28113811280E2804287FA800000048004800A8011406620000 -D685:000004283FA80E28113811280E2804287FA80000000003F00408040803F00000 -D686:000004283FA80E28113811280E2804287FA8000003F80020002000D003080000 -D687:000004283FA80E28113811280E2804287FA80000004003F8004000A003180000 -D688:000004283FA80E28113811280E2804287FA8000003F8000803F8000800080000 -D689:000004283FA80E28113811280E2804287FA8000003F8020003F8020003F80000 -D68A:000004283FA80E28113811280E2804287FA8000000000FF8022002200FF80000 -D68B:000004283FA80E28113811280E2804287FA8000000800FF803E0041003E00000 -D68C:00000008040804083F8800081F08208820881F08040804087FE8000800080000 -D68D:000004083F880E08110811080E0804087FE8000007F800080008000800080000 -D68E:000004083F880E08110811080E0804087FE8000000003EF80208020802080000 -D68F:000004083F880E08110811080E0804087FE8000000001F080108011401620000 -D690:000004083F880E08110811080E0804087FE8000008000800080008000FF80000 -D691:000004083F880E08110811080E0804087FE80000000010F8101010301ECC0000 -D692:000004083F880E08110811080E0804087FE800000808087F081C08220F9C0000 -D693:000004083F880E08110811080E0804087FE8000003F802000200020003F80000 -D694:000004083F880E08110811080E0804087FE8000007F8000807F8040007F80000 -D695:000004083F880E08110811080E0804087FE800003EF802083E0820083E080000 -D696:000004083F880E08110811080E0804087FE800003EF802883E8820883EF80000 -D697:000004083F880E08110811080E0804087FE800003E8802883EF820883EF80000 -D698:000004083F880E08110811080E0804087FE800001F0801081F0810141F620000 -D699:000004083F880E08110811080E0804087FE800003EF802803EF820803EF80000 -D69A:000004083F880E08110811080E0804087FE800003EFC02483E4820483EFC0000 -D69B:000004083F880E08110811080E0804087FE800001F08017F1F1C10221F1C0000 -D69C:000004083F880E08110811080E0804087FE8000003F802080208020803F80000 -D69D:000004083F880E08110811080E0804087FE800000208020803F8020803F80000 -D69E:000004083F880E08110811080E0804087FE80000110811081F0811141F620000 -D69F:000004083F880E08110811080E0804087FE80000001000100010006801840000 -D6A0:000004083F880E08110811080E0804087FE800000048004800A8011406620000 -D6A1:000004083F880E08110811080E0804087FE80000000003F00408040803F00000 -D6A2:000004083F880E08110811080E0804087FE8000003F80020002000D003080000 -D6A3:000004083F880E08110811080E0804087FE80000004003F8004000A003180000 -D6A4:000004083F880E08110811080E0804087FE8000003F8000803F8000800080000 -D6A5:000004083F880E08110811080E0804087FE8000003F8020003F8020003F80000 -D6A6:000004083F880E08110811080E0804087FE8000000000FF8022002200FF80000 -D6A7:000004083F880E08110811080E0804087FE8000000800FF803E0041003E00000 -D6A8:0000010001000FE0000007C00820082007C004400440044004407FFC00000000 -D6A9:01000FE007C00820082007C0044004407FFC00001FF000100010001000100000 -D6AA:01000FE007C00820082007C0044004407FFC000000003EF80208020802080000 -D6AB:01000FE007C00820082007C0044004407FFC000000001E100210022802C40000 -D6AC:01000FE007C00820082007C0044004407FFC000000001000100010001FF00000 -D6AD:01000FE007C00820082007C0044004407FFC0000000020F8201020303ECC0000 -D6AE:01000FE007C00820082007C0044004407FFC0000202021FC207020883E700000 -D6AF:01000FE007C00820082007C0044004407FFC00001FF01000100010001FF00000 -D6B0:01000FE007C00820082007C0044004407FFC00001FF000101FF010001FF00000 -D6B1:01000FE007C00820082007C0044004407FFC00003EF802083E0820083E080000 -D6B2:01000FE007C00820082007C0044004407FFC00003EF802883E8820883EF80000 -D6B3:01000FE007C00820082007C0044004407FFC00003E8802883EF820883EF80000 -D6B4:01000FE007C00820082007C0044004407FFC00003E1002103E1020283EC40000 -D6B5:01000FE007C00820082007C0044004407FFC00003EF802803EF820803EF80000 -D6B6:01000FE007C00820082007C0044004407FFC00003EFC02483E4820483EFC0000 -D6B7:01000FE007C00820082007C0044004407FFC00003E2003FC3E7020883E700000 -D6B8:01000FE007C00820082007C0044004407FFC00001FF01010101010101FF00000 -D6B9:01000FE007C00820082007C0044004407FFC0000101010101FF010101FF00000 -D6BA:01000FE007C00820082007C0044004407FFC0000222022203E2022503E880000 -D6BB:01000FE007C00820082007C0044004407FFC000000000100010002800C400000 -D6BC:01000FE007C00820082007C0044004407FFC00000000024002400DA033100000 -D6BD:01000FE007C00820082007C0044004407FFC0000000007C00820082007C00000 -D6BE:01000FE007C00820082007C0044004407FFC0000000007E00080014006200000 -D6BF:01000FE007C00820082007C0044004407FFC0000008007E00080014006200000 -D6C0:01000FE007C00820082007C0044004407FFC00001FF000101FF0001000100000 -D6C1:01000FE007C00820082007C0044004407FFC00001FF010001FF010001FF00000 -D6C2:01000FE007C00820082007C0044004407FFC000000001FF0044004401FF00000 -D6C3:01000FE007C00820082007C0044004407FFC000001001FF007C0082007C00000 -D6C4:0000010001000FE0000007C00820082007C000003FF801000100010001000000 -D6C5:01000FE007C00820082007C000007FFC010001001FF000100010001000100000 -D6C6:01000FE007C00820082007C000007FFC0100010000003EF80208020802080000 -D6C7:01000FE007C00820082007C000007FFC0100010000001E100210022802C40000 -D6C8:01000FE007C00820082007C0000000007FFC010001001100100010001FF00000 -D6C9:01000FE007C00820082007C000007FFC01000100000020F8201020303ECC0000 -D6CA:01000FE007C00820082007C000007FFC01000100202021FC207020883E700000 -D6CB:01000FE007C00820082007C000007FFC010001001FF01000100010001FF00000 -D6CC:01000FE007C00820082007C000007FFC010001001FF000101FF010001FF00000 -D6CD:01000FE007C00820082007C000007FFC010001003EF802083E0820083E080000 -D6CE:01000FE007C00820082007C000007FFC010001003EF802883E8820883EF80000 -D6CF:01000FE007C00820082007C000007FFC010001003E8802883EF820883EF80000 -D6D0:01000FE007C00820082007C000007FFC010001003E1002103E1020283EC40000 -D6D1:01000FE007C00820082007C000007FFC010001003EF802803EF820803EF80000 -D6D2:01000FE007C00820082007C000007FFC010001003EFC02483E4820483EFC0000 -D6D3:01000FE007C00820082007C000007FFC010001003E2003FC3E7020883E700000 -D6D4:01000FE007C00820082007C000007FFC010001001FF01010101010101FF00000 -D6D5:01000FE007C00820082007C000007FFC01000100101010101FF010101FF00000 -D6D6:01000FE007C00820082007C000007FFC01000100222022203E2022503E880000 -D6D7:01000FE007C00820082007C000007FFC0100010000000100010002800C400000 -D6D8:01000FE007C00820082007C000007FFC010001000000024002400DA033100000 -D6D9:01000FE007C00820082007C000007FFC01000100000007C00820082007C00000 -D6DA:01000FE007C00820082007C000007FFC01000100000007E00080014006200000 -D6DB:01000FE007C00820082007C000007FFC01000100008007E00080014006200000 -D6DC:01000FE007C00820082007C000007FFC010001001FF000101FF0001000100000 -D6DD:01000FE007C00820082007C000007FFC010001001FF010001FF010001FF00000 -D6DE:01000FE007C00820082007C000007FFC0100010000001FF0044004401FF00000 -D6DF:01000FE007C00820082007C000007FFC0100010001001FF007C0082007C00000 -D6E0:0000040804083F8800081F08208820881F0800087FE8040804F8040804080000 -D6E1:04083F880E0811080E0800087FE8027802080000000007F80008000800080000 -D6E2:04083F880E0811080E0800087FE802780208000000003EF80208020802080000 -D6E3:04083F880E0811080E0800087FE802780208000000001F080108011401620000 -D6E4:04083F880E0811080E08000800087FE80278020802081000100010001FF80000 -D6E5:04083F880E0811080E0800087FE8027802080000000020F8201020303ECC0000 -D6E6:04083F880E0811080E0800087FE8027802080000202021FC207020883E700000 -D6E7:04083F880E0811080E0800087FE802780208000003F802000200020003F80000 -D6E8:04083F880E0811080E0800087FE802780208000007F8000807F8040007F80000 -D6E9:04083F880E0811080E0800087FE80278020800003EF802083E0820083E080000 -D6EA:04083F880E0811080E0800087FE80278020800003EF802883E8820883EF80000 -D6EB:04083F880E0811080E0800087FE80278020800003E8802883EF820883EF80000 -D6EC:04083F880E0811080E0800087FE80278020800000F8800880F8808140FA20000 -D6ED:04083F880E0811080E0800087FE80278020800003EF802803EF820803EF80000 -D6EE:04083F880E0811080E0800087FE80278020800003EFC02483E4820483EFC0000 -D6EF:04083F880E0811080E0800087FE80278020800003E1002FE3E3820443E380000 -D6F0:04083F880E0811080E0800087FE802780208000003F802080208020803F80000 -D6F1:04083F880E0811080E0800087FE80278020800000208020803F8020803F80000 -D6F2:04083F880E0811080E0800087FE8027802080000210821083F0821143F620000 -D6F3:04083F880E0811080E0800087FE8027802080000001000100010006801840000 -D6F4:04083F880E0811080E0800087FE80278020800000048004800A8011406620000 -D6F5:04083F880E0811080E0800087FE8027802080000000003F00408040803F00000 -D6F6:04083F880E0811080E0800087FE802780208000003F80020002000D003080000 -D6F7:04083F880E0811080E0800087FE8027802080000004003F8004000A003180000 -D6F8:04083F880E0811080E0800087FE802780208000003F8000803F8000800080000 -D6F9:04083F880E0811080E0800087FE802780208000003F8020003F8020003F80000 -D6FA:04083F880E0811080E0800087FE802780208000000000FF8022002200FF80000 -D6FB:04083F880E0811080E0800087FE802780208000000800FF803E0041003E00000 -D6FC:0000040A040A3F8A000A1F0A208A208A1F0A000A7FEA040A047A040A040A0000 -D6FD:04283FA80E2811280E2800287FA805E804280000000007F80008000800080000 -D6FE:04283FA80E2811280E2800287FA805E80428000000003EF80208020802080000 -D6FF:04283FA80E2811280E2800287FA805E80428000000001F080108011401620000 -D700:04283FA80E2811280E28002800287FA8042805E804281428100010001FF80000 -D701:04283FA80E2811280E2800287FA805E804280000000020F8201020303ECC0000 -D702:04283FA80E2811280E2800287FA805E804280000202021FC207020883E700000 -D703:04283FA80E2811280E2800287FA805E80428000003F802000200020003F80000 -D704:04283FA80E2811280E2800287FA805E80428000007F8000807F8040007F80000 -D705:04283FA80E2811280E2800287FA805E8042800003EF802083E0820083E080000 -D706:04283FA80E2811280E2800287FA805E8042800003EF802883E8820883EF80000 -D707:04283FA80E2811280E2800287FA805E8042800003E8802883EF820883EF80000 -D708:04283FA80E2811280E2800287FA805E8042800000F8800880F8808140FA20000 -D709:04283FA80E2811280E2800287FA805E8042800003EF802803EF820803EF80000 -D70A:04283FA80E2811280E2800287FA805E8042800003EFC02483E4820483EFC0000 -D70B:04283FA80E2811280E2800287FA805E8042800003E1002FE3E3820443E380000 -D70C:04283FA80E2811280E2800287FA805E80428000003F802080208020803F80000 -D70D:04283FA80E2811280E2800287FA805E8042800000208020803F8020803F80000 -D70E:04283FA80E2811280E2800287FA805E804280000210821083F0821143F620000 -D70F:04283FA80E2811280E2800287FA805E804280000001000100010006801840000 -D710:04283FA80E2811280E2800287FA805E8042800000048004800A8011406620000 -D711:04283FA80E2811280E2800287FA805E804280000000003F00408040803F00000 -D712:04283FA80E2811280E2800287FA805E80428000003F80020002000D003080000 -D713:04283FA80E2811280E2800287FA805E804280000004003F8004000A003180000 -D714:04283FA80E2811280E2800287FA805E80428000003F8000803F8000800080000 -D715:04283FA80E2811280E2800287FA805E80428000003F8020003F8020003F80000 -D716:04283FA80E2811280E2800287FA805E80428000000000FF8022002200FF80000 -D717:04283FA80E2811280E2800287FA805E80428000000800FF803E0041003E00000 -D718:0000040804083F8800081F08208820881F0800087FE804080408040804080000 -D719:04083F880E0811080E0800087FE8020802000000000007F80008000800080000 -D71A:04083F880E0811080E0800087FE802080200000000003EF80208020802080000 -D71B:04083F880E0811080E0800087FE802080200000000001F080108011401620000 -D71C:04083F880E0811080E08000800087FE80208020802081008100010001FF80000 -D71D:04083F880E0811080E0800087FE8020802000000000020F8201020303ECC0000 -D71E:04083F880E0811080E0800087FE8020802000000202021FC207020883E700000 -D71F:04083F880E0811080E0800087FE802080200000003F802000200020003F80000 -D720:04083F880E0811080E0800087FE802080200000007F8000807F8040007F80000 -D721:04083F880E0811080E0800087FE80208020000003EF802083E0820083E080000 -D722:04083F880E0811080E0800087FE80208020000003EF802883E8820883EF80000 -D723:04083F880E0811080E0800087FE80208020000003E8802883EF820883EF80000 -D724:04083F880E0811080E0800087FE80208020000000F8800880F8808140FA20000 -D725:04083F880E0811080E0800087FE80208020000003EF802803EF820803EF80000 -D726:04083F880E0811080E0800087FE80208020000003EFC02483E4820483EFC0000 -D727:04083F880E0811080E0800087FE80208020000003E1002FE3E3820443E380000 -D728:04083F880E0811080E0800087FE802080200000003F802080208020803F80000 -D729:04083F880E0811080E0800087FE80208020000000208020803F8020803F80000 -D72A:04083F880E0811080E0800087FE8020802000000210821083F0821143F620000 -D72B:04083F880E0811080E0800087FE8020802000000001000100010006801840000 -D72C:04083F880E0811080E0800087FE80208020000000048004800A8011406620000 -D72D:04083F880E0811080E0800087FE8020802000000000003F00408040803F00000 -D72E:04083F880E0811080E0800087FE802080200000003F80020002000D003080000 -D72F:04083F880E0811080E0800087FE8020802000000004003F8004000A003180000 -D730:04083F880E0811080E0800087FE802080200000003F8000803F8000800080000 -D731:04083F880E0811080E0800087FE802080200000003F8020003F8020003F80000 -D732:04083F880E0811080E0800087FE802080200000000000FF8022002200FF80000 -D733:04083F880E0811080E0800087FE802080200000000800FF803E0041003E00000 -D734:0000010001000FE0000007C00820082007C000007FFC04400440044004400000 -D735:01000FE007C00820082007C000007FFC044004401FF000100010001000100000 -D736:01000FE007C00820082007C000007FFC0440044000003EF80208020802080000 -D737:01000FE007C00820082007C000007FFC0440044000001E100210022802C40000 -D738:01000FE007C00820082007C0000000007FFC044004401440100010001FF00000 -D739:01000FE007C00820082007C000007FFC04400440000020F8201020303ECC0000 -D73A:01000FE007C00820082007C000007FFC04400440202021FC207020883E700000 -D73B:01000FE007C00820082007C000007FFC044004401FF01000100010001FF00000 -D73C:01000FE007C00820082007C000007FFC044004401FF000101FF010001FF00000 -D73D:01000FE007C00820082007C000007FFC044004403EF802083E0820083E080000 -D73E:01000FE007C00820082007C000007FFC044004403EF802883E8820883EF80000 -D73F:01000FE007C00820082007C000007FFC044004403E8802883EF820883EF80000 -D740:01000FE007C00820082007C000007FFC044004403E1002103E1020283EC40000 -D741:01000FE007C00820082007C000007FFC044004403EF802803EF820803EF80000 -D742:01000FE007C00820082007C000007FFC044004403EFC02483E4820483EFC0000 -D743:01000FE007C00820082007C000007FFC044004403E2003FC3E7020883E700000 -D744:01000FE007C00820082007C000007FFC044004401FF01010101010101FF00000 -D745:01000FE007C00820082007C000007FFC04400440101010101FF010101FF00000 -D746:01000FE007C00820082007C000007FFC04400440222022203E2022503E880000 -D747:01000FE007C00820082007C000007FFC0440044000000100010002800C400000 -D748:01000FE007C00820082007C000007FFC044004400000024002400DA033100000 -D749:01000FE007C00820082007C000007FFC04400440000007C00820082007C00000 -D74A:01000FE007C00820082007C000007FFC04400440000007E00080014006200000 -D74B:01000FE007C00820082007C000007FFC04400440008007E00080014006200000 -D74C:01000FE007C00820082007C000007FFC044004401FF000101FF0001000100000 -D74D:01000FE007C00820082007C000007FFC044004401FF010001FF010001FF00000 -D74E:01000FE007C00820082007C000007FFC0440044000001FF0044004401FF00000 -D74F:01000FE007C00820082007C000007FFC0440044001001FF007C0082007C00000 -D750:0000010001000FE0000007C00820082007C0000000007FFC0000000000000000 -D751:01000FE007C00820082007C0000000007FFC00001FF000100010001000100000 -D752:01000FE007C00820082007C0000000007FFC000000003EF80208020802080000 -D753:01000FE007C00820082007C0000000007FFC000000001E100210022802C40000 -D754:01000FE007C00820082007C0000000007FFC000000001000100010001FF00000 -D755:01000FE007C00820082007C0000000007FFC0000000020F8201020303ECC0000 -D756:01000FE007C00820082007C0000000007FFC0000202021FC207020883E700000 -D757:01000FE007C00820082007C0000000007FFC00001FF01000100010001FF00000 -D758:01000FE007C00820082007C0000000007FFC00001FF000101FF010001FF00000 -D759:01000FE007C00820082007C0000000007FFC00003EF802083E0820083E080000 -D75A:01000FE007C00820082007C0000000007FFC00003EF802883E8820883EF80000 -D75B:01000FE007C00820082007C0000000007FFC00003E8802883EF820883EF80000 -D75C:01000FE007C00820082007C0000000007FFC00003E1002103E1020283EC40000 -D75D:01000FE007C00820082007C0000000007FFC00003EF802803EF820803EF80000 -D75E:01000FE007C00820082007C0000000007FFC00003EFC02483E4820483EFC0000 -D75F:01000FE007C00820082007C0000000007FFC00003E2003FC3E7020883E700000 -D760:01000FE007C00820082007C0000000007FFC00001FF01010101010101FF00000 -D761:01000FE007C00820082007C0000000007FFC0000101010101FF010101FF00000 -D762:01000FE007C00820082007C0000000007FFC0000222022203E2022503E880000 -D763:01000FE007C00820082007C0000000007FFC000000000100010002800C400000 -D764:01000FE007C00820082007C0000000007FFC00000000024002400DA033100000 -D765:01000FE007C00820082007C0000000007FFC0000000007C00820082007C00000 -D766:01000FE007C00820082007C0000000007FFC0000000007E00080014006200000 -D767:01000FE007C00820082007C0000000007FFC0000008007E00080014006200000 -D768:01000FE007C00820082007C0000000007FFC00001FF000101FF0001000100000 -D769:01000FE007C00820082007C0000000007FFC00001FF010001FF010001FF00000 -D76A:01000FE007C00820082007C0000000007FFC000000001FF0044004401FF00000 -D76B:01000FE007C00820082007C0000000007FFC000001001FF007C0082007C00000 -D76C:00000008040804083F8800081F08208820881F0800087FE80008000800080000 -D76D:000004083F880E08110811080E0800087FE8000007F800080008000800080000 -D76E:000004083F880E08110811080E0800087FE8000000003EF80208020802080000 -D76F:000004083F880E08110811080E0800087FE8000000001F080108011401620000 -D770:000004083F880E08110811080E0800087FE8000008000800080008000FF80000 -D771:000004083F880E08110811080E0800087FE80000000010F8101010301ECC0000 -D772:000004083F880E08110811080E0800087FE800000808087F081C08220F9C0000 -D773:000004083F880E08110811080E0800087FE8000003F802000200020003F80000 -D774:000004083F880E08110811080E0800087FE8000007F8000807F8040007F80000 -D775:000004083F880E08110811080E0800087FE800003EF802083E0820083E080000 -D776:000004083F880E08110811080E0800087FE800003EF802883E8820883EF80000 -D777:000004083F880E08110811080E0800087FE800003E8802883EF820883EF80000 -D778:000004083F880E08110811080E0800087FE800001F0801081F0810141F620000 -D779:000004083F880E08110811080E0800087FE800003EF802803EF820803EF80000 -D77A:000004083F880E08110811080E0800087FE800003EFC02483E4820483EFC0000 -D77B:000004083F880E08110811080E0800087FE800001F08017F1F1C10221F1C0000 -D77C:000004083F880E08110811080E0800087FE8000003F802080208020803F80000 -D77D:000004083F880E08110811080E0800087FE800000208020803F8020803F80000 -D77E:000004083F880E08110811080E0800087FE80000110811081F0811141F620000 -D77F:000004083F880E08110811080E0800087FE80000001000100010006801840000 -D780:000004083F880E08110811080E0800087FE800000048004800A8011406620000 -D781:000004083F880E08110811080E0800087FE80000000003F00408040803F00000 -D782:000004083F880E08110811080E0800087FE8000003F80020002000D003080000 -D783:000004083F880E08110811080E0800087FE80000004003F8004000A003180000 -D784:000004083F880E08110811080E0800087FE8000003F8000803F8000800080000 -D785:000004083F880E08110811080E0800087FE8000003F8020003F8020003F80000 -D786:000004083F880E08110811080E0800087FE8000000000FF8022002200FF80000 -D787:000004083F880E08110811080E0800087FE8000000800FF803E0041003E00000 -D788:00000000040804083F880E08110820882088208811080E080008000800080000 -D789:000008087F081C082208220822081C0800080000000007F80008000800080000 -D78A:000008087F081C082208220822081C080008000000003EF80208020802080000 -D78B:000008087F081C082208220822081C080008000000001F080108011401620000 -D78C:000008087F081C082208220822081C080008000800001000100010001FF80000 -D78D:000008087F081C082208220822081C0800080000000020F8201020303ECC0000 -D78E:000008087F081C082208220822081C0800080000202021FC207020883E700000 -D78F:000008087F081C082208220822081C080008000003F802000200020003F80000 -D790:000008087F081C082208220822081C080008000007F8000807F8040007F80000 -D791:000008087F081C082208220822081C08000800003EF802083E0820083E080000 -D792:000008087F081C082208220822081C08000800003EF802883E8820883EF80000 -D793:000008087F081C082208220822081C08000800003E8802883EF820883EF80000 -D794:000008087F081C082208220822081C08000800000F8800880F8808140FA20000 -D795:000008087F081C082208220822081C08000800003EF802803EF820803EF80000 -D796:000008087F081C082208220822081C08000800003EFC02483E4820483EFC0000 -D797:000008087F081C082208220822081C08000800003E1002FE3E3820443E380000 -D798:000008087F081C082208220822081C080008000003F802080208020803F80000 -D799:000008087F081C082208220822081C08000800000208020803F8020803F80000 -D79A:000008087F081C082208220822081C0800080000210821083F0821143F620000 -D79B:000008087F081C082208220822081C0800080000001000100010006801840000 -D79C:000008087F081C082208220822081C08000800000048004800A8011406620000 -D79D:000008087F081C082208220822081C0800080000000003F00408040803F00000 -D79E:000008087F081C082208220822081C080008000003F80020002000D003080000 -D79F:000008087F081C082208220822081C0800080000004003F8004000A003180000 -D7A0:000008087F081C082208220822081C080008000003F8000803F8000800080000 -D7A1:000008087F081C082208220822081C080008000003F8020003F8020003F80000 -D7A2:000008087F081C082208220822081C080008000000000FF8022002200FF80000 -D7A3:000008087F081C082208220822081C080008000000800FF803E0041003E00000 +AC00:0000000000043F8400840084008400870104010402040C043004000400040004 +AC01:000000003F84008400840107010406043804000400001FFC0004000400040004 +AC02:000000003F84008400840107010406043804000400001F7C0104010401040104 +AC03:000000003F84008400840107010406043804000400001F1001100110012801C6 +AC04:000000003F840084008401070104060438040004000410041000100010000FFC +AC05:000000003F8400840084010701040604380400040000107C1010101010280FC6 +AC06:000000003F84008400840107010406043804000400001038100010FE10440F38 +AC07:000000003F84008400840107010406043804000400001FFC1000100010000FFC +AC08:000000003F84008400840107010406043804000400001FFC00041FF810000FFC +AC09:000000003F84008400840107010406043804000400001F7C01041E0410040F04 +AC0A:000000003F84008400840107010406043804000400001F7C01441E4410440F3C +AC0B:000000003F84008400840107010406043804000400001F4401441E7C10440F3C +AC0C:000000003F84008400840107010406043804000400001F1001101E1010280FC6 +AC0D:000000003F84008400840107010406043804000400001F7C01401E7C10400F3C +AC0E:000000003F84008400840107010406043804000400001F7E01241E2410240F7E +AC0F:000000003F84008400840107010406043804000400001F3801001EFE10440F38 +AC10:000000003F84008400840107010406043804000400001FFC1004100410040FFC +AC11:000000003F8400840084010701040604380400040000100410041FFC10040FFC +AC12:000000003F8400840084010701040604380400040000111011101F1011280FC6 +AC13:000000003F84008400840107010406043804000400000080008001400630180C +AC14:000000003F84008400840107010406043804000400000410041004100A2831C6 +AC15:000000003F84008400840107010406043804000400000FF81004100410040FF8 +AC16:000000003F84008400840107010406043804000400001FFC008001400630180C +AC17:000000003F840084008401070104060438040004000003E000001FFC02201C1C +AC18:000000003F84008400840107010406043804000400001FFC00041FFC00040004 +AC19:000000003F84008400840107010406043804000400001FFC10001FF810000FFC +AC1A:000000003F84008400840107010406043804000400001FFC0410041004101FFC +AC1B:000000003F840084008401070104060438040004000003E000001FFC080807F0 +AC1C:0000000000123F92009200920092009E0112011202120C123012001200120012 +AC1D:000000003F9200920092011E011206123812001200000FFE0002000200020002 +AC1E:000000003F9200920092011E011206123812001200000FBE0082008200820082 +AC1F:000000003F9200920092011E011206123812001200000F8800880088009400E3 +AC20:000000003F9200920092011E01120612381200120012081208000800080007FE +AC21:000000003F9200920092011E01120612381200120000083E08080808081407E3 +AC22:000000003F9200920092011E01120612381200120000081C0800087F0822079C +AC23:000000003F9200920092011E011206123812001200000FFE08000800080007FE +AC24:000000003F9200920092011E011206123812001200000FFE00020FFC080007FE +AC25:000000003F9200920092011E011206123812001200000FBE00820F0208020782 +AC26:000000003F9200920092011E011206123812001200000FBE00A20F220822079E +AC27:000000003F9200920092011E011206123812001200000FA200A20F3E0822079E +AC28:000000003F9200920092011E011206123812001200000F8800880F08081407E3 +AC29:000000003F9200920092011E011206123812001200000FBE00A00F3E0820079E +AC2A:000000003F9200920092011E011206123812001200000FBF00920F12081207BF +AC2B:000000003F9200920092011E011206123812001200000F9C00800F7F0822079C +AC2C:000000003F9200920092011E011206123812001200000FFE08020802080207FE +AC2D:000000003F9200920092011E01120612381200120000080208020FFE080207FE +AC2E:000000003F9200920092011E01120612381200120000088808880F88089407E3 +AC2F:000000003F9200920092011E011206123812001200000040004000A003180C06 +AC30:000000003F9200920092011E01120612381200120000020802080208051418E3 +AC31:000000003F9200920092011E0112061238120012000007FC08020802080207FC +AC32:000000003F9200920092011E011206123812001200000FFE004000A003180C06 +AC33:000000003F9200920092011E0112061238120012000001F000000FFE01100E0E +AC34:000000003F9200920092011E011206123812001200000FFE00020FFE00020002 +AC35:000000003F9200920092011E011206123812001200000FFE08000FFC080007FE +AC36:000000003F9200920092011E011206123812001200000FFE0208020802080FFE +AC37:000000003F9200920092011E0112061238120012000001F000000FFE040403F8 +AC38:0000000000043F8400840084008700840104010702040C043004000400040004 +AC39:000000003F84008400870104010406073804000400001FFC0004000400040004 +AC3A:000000003F84008400870104010406073804000400001F7C0104010401040104 +AC3B:000000003F84008400870104010406073804000400001F1001100110012801C6 +AC3C:000000003F840084008701040104060738040004000410041000100010000FFC +AC3D:000000003F8400840087010401040607380400040000107C1010101010280FC6 +AC3E:000000003F84008400870104010406073804000400001038100010FE10440F38 +AC3F:000000003F84008400870104010406073804000400001FFC1000100010000FFC +AC40:000000003F84008400870104010406073804000400001FFC00041FF810000FFC +AC41:000000003F84008400870104010406073804000400001F7C01041E0410040F04 +AC42:000000003F84008400870104010406073804000400001F7C01441E4410440F3C +AC43:000000003F84008400870104010406073804000400001F4401441E7C10440F3C +AC44:000000003F84008400870104010406073804000400001F1001101E1010280FC6 +AC45:000000003F84008400870104010406073804000400001F7C01401E7C10400F3C +AC46:000000003F84008400870104010406073804000400001F7E01241E2410240F7E +AC47:000000003F84008400870104010406073804000400001F3801001EFE10440F38 +AC48:000000003F84008400870104010406073804000400001FFC1004100410040FFC +AC49:000000003F8400840087010401040607380400040000100410041FFC10040FFC +AC4A:000000003F8400840087010401040607380400040000111011101F1011280FC6 +AC4B:000000003F84008400870104010406073804000400000080008001400630180C +AC4C:000000003F84008400870104010406073804000400000410041004100A2831C6 +AC4D:000000003F84008400870104010406073804000400000FF81004100410040FF8 +AC4E:000000003F84008400870104010406073804000400001FFC008001400630180C +AC4F:000000003F840084008701040104060738040004000003E000001FFC02201C1C +AC50:000000003F84008400870104010406073804000400001FFC00041FFC00040004 +AC51:000000003F84008400870104010406073804000400001FFC10001FF810000FFC +AC52:000000003F84008400870104010406073804000400001FFC0410041004101FFC +AC53:000000003F840084008701040104060738040004000003E000001FFC080807F0 +AC54:0000000000123F9200920092009E00920112011E02120C123012001200120012 +AC55:000000003F920092009E01120112061E3812001200000FFE0002000200020002 +AC56:000000003F920092009E01120112061E3812001200000FBE0082008200820082 +AC57:000000003F920092009E01120112061E3812001200000F8800880088009400E3 +AC58:000000003F920092009E01120112061E381200120012081208000800080007FE +AC59:000000003F920092009E01120112061E381200120000083E08080808081407E3 +AC5A:000000003F920092009E01120112061E381200120000081C0800087F0822079C +AC5B:000000003F920092009E01120112061E3812001200000FFE08000800080007FE +AC5C:000000003F920092009E01120112061E3812001200000FFE00020FFC080007FE +AC5D:000000003F920092009E01120112061E3812001200000FBE00820F0208020782 +AC5E:000000003F920092009E01120112061E3812001200000FBE00A20F220822079E +AC5F:000000003F920092009E01120112061E3812001200000FA200A20F3E0822079E +AC60:000000003F920092009E01120112061E3812001200000F8800880F08081407E3 +AC61:000000003F920092009E01120112061E3812001200000FBE00A00F3E0820079E +AC62:000000003F920092009E01120112061E3812001200000FBF00920F12081207BF +AC63:000000003F920092009E01120112061E3812001200000F9C00800F7F0822079C +AC64:000000003F920092009E01120112061E3812001200000FFE08020802080207FE +AC65:000000003F920092009E01120112061E381200120000080208020FFE080207FE +AC66:000000003F920092009E01120112061E381200120000088808880F88089407E3 +AC67:000000003F920092009E01120112061E3812001200000040004000A003180C06 +AC68:000000003F920092009E01120112061E381200120000020802080208051418E3 +AC69:000000003F920092009E01120112061E38120012000007FC08020802080207FC +AC6A:000000003F920092009E01120112061E3812001200000FFE004000A003180C06 +AC6B:000000003F920092009E01120112061E38120012000001F000000FFE01100E0E +AC6C:000000003F920092009E01120112061E3812001200000FFE00020FFE00020002 +AC6D:000000003F920092009E01120112061E3812001200000FFE08000FFC080007FE +AC6E:000000003F920092009E01120112061E3812001200000FFE0208020802080FFE +AC6F:000000003F920092009E01120112061E38120012000001F000000FFE040403F8 +AC70:0000000000043F8400840084008400BC0104010402040C043004000400040004 +AC71:000000003F8400840084013C010406043804000400001FFC0004000400040004 +AC72:000000003F8400840084013C010406043804000400001F7C0104010401040104 +AC73:000000003F8400840084013C010406043804000400001F1001100110012801C6 +AC74:000000003F8400840084013C0104060438040004000410041000100010000FFC +AC75:000000003F8400840084013C01040604380400040000107C1010101010280FC6 +AC76:000000003F8400840084013C010406043804000400001038100010FE10440F38 +AC77:000000003F8400840084013C010406043804000400001FFC1000100010000FFC +AC78:000000003F8400840084013C010406043804000400001FFC00041FF810000FFC +AC79:000000003F8400840084013C010406043804000400001F7C01041E0410040F04 +AC7A:000000003F8400840084013C010406043804000400001F7C01441E4410440F3C +AC7B:000000003F8400840084013C010406043804000400001F4401441E7C10440F3C +AC7C:000000003F8400840084013C010406043804000400001F1001101E1010280FC6 +AC7D:000000003F8400840084013C010406043804000400001F7C01401E7C10400F3C +AC7E:000000003F8400840084013C010406043804000400001F7E01241E2410240F7E +AC7F:000000003F8400840084013C010406043804000400001F3801001EFE10440F38 +AC80:000000003F8400840084013C010406043804000400001FFC1004100410040FFC +AC81:000000003F8400840084013C01040604380400040000100410041FFC10040FFC +AC82:000000003F8400840084013C01040604380400040000111011101F1011280FC6 +AC83:000000003F8400840084013C010406043804000400000080008001400630180C +AC84:000000003F8400840084013C010406043804000400000410041004100A2831C6 +AC85:000000003F8400840084013C010406043804000400000FF81004100410040FF8 +AC86:000000003F8400840084013C010406043804000400001FFC008001400630180C +AC87:000000003F8400840084013C0104060438040004000003E000001FFC02201C1C +AC88:000000003F8400840084013C010406043804000400001FFC00041FFC00040004 +AC89:000000003F8400840084013C010406043804000400001FFC10001FF810000FFC +AC8A:000000003F8400840084013C010406043804000400001FFC0410041004101FFC +AC8B:000000003F8400840084013C0104060438040004000003E000001FFC080807F0 +AC8C:0000000000123F9200920092009200F20112011202120C123012001200120012 +AC8D:000000003F92009200920172011206123812001200000FFE0002000200020002 +AC8E:000000003F92009200920172011206123812001200000FBE0082008200820082 +AC8F:000000003F92009200920172011206123812001200000F8800880088009400E3 +AC90:000000003F9200920092017201120612381200120012081208000800080007FE +AC91:000000003F9200920092017201120612381200120000083E08080808081407E3 +AC92:000000003F9200920092017201120612381200120000081C0800087F0822079C +AC93:000000003F92009200920172011206123812001200000FFE08000800080007FE +AC94:000000003F92009200920172011206123812001200000FFE00020FFC080007FE +AC95:000000003F92009200920172011206123812001200000FBE00820F0208020782 +AC96:000000003F92009200920172011206123812001200000FBE00A20F220822079E +AC97:000000003F92009200920172011206123812001200000FA200A20F3E0822079E +AC98:000000003F92009200920172011206123812001200000F8800880F08081407E3 +AC99:000000003F92009200920172011206123812001200000FBE00A00F3E0820079E +AC9A:000000003F92009200920172011206123812001200000FBF00920F12081207BF +AC9B:000000003F92009200920172011206123812001200000F9C00800F7F0822079C +AC9C:000000003F92009200920172011206123812001200000FFE08020802080207FE +AC9D:000000003F9200920092017201120612381200120000080208020FFE080207FE +AC9E:000000003F9200920092017201120612381200120000088808880F88089407E3 +AC9F:000000003F92009200920172011206123812001200000040004000A003180C06 +ACA0:000000003F9200920092017201120612381200120000020802080208051418E3 +ACA1:000000003F920092009201720112061238120012000007FC08020802080207FC +ACA2:000000003F92009200920172011206123812001200000FFE004000A003180C06 +ACA3:000000003F920092009201720112061238120012000001F000000FFE01100E0E +ACA4:000000003F92009200920172011206123812001200000FFE00020FFE00020002 +ACA5:000000003F92009200920172011206123812001200000FFE08000FFC080007FE +ACA6:000000003F92009200920172011206123812001200000FFE0208020802080FFE +ACA7:000000003F920092009201720112061238120012000001F000000FFE040403F8 +ACA8:0000000000043F840084008400BC00840104013C02040C043004000400040004 +ACA9:000000003F84008400BC01040104063C3804000400001FFC0004000400040004 +ACAA:000000003F84008400BC01040104063C3804000400001F7C0104010401040104 +ACAB:000000003F84008400BC01040104063C3804000400001F1001100110012801C6 +ACAC:000000003F84008400BC01040104063C38040004000410041000100010000FFC +ACAD:000000003F84008400BC01040104063C380400040000107C1010101010280FC6 +ACAE:000000003F84008400BC01040104063C3804000400001038100010FE10440F38 +ACAF:000000003F84008400BC01040104063C3804000400001FFC1000100010000FFC +ACB0:000000003F84008400BC01040104063C3804000400001FFC00041FF810000FFC +ACB1:000000003F84008400BC01040104063C3804000400001F7C01041E0410040F04 +ACB2:000000003F84008400BC01040104063C3804000400001F7C01441E4410440F3C +ACB3:000000003F84008400BC01040104063C3804000400001F4401441E7C10440F3C +ACB4:000000003F84008400BC01040104063C3804000400001F1001101E1010280FC6 +ACB5:000000003F84008400BC01040104063C3804000400001F7C01401E7C10400F3C +ACB6:000000003F84008400BC01040104063C3804000400001F7E01241E2410240F7E +ACB7:000000003F84008400BC01040104063C3804000400001F3801001EFE10440F38 +ACB8:000000003F84008400BC01040104063C3804000400001FFC1004100410040FFC +ACB9:000000003F84008400BC01040104063C380400040000100410041FFC10040FFC +ACBA:000000003F84008400BC01040104063C380400040000111011101F1011280FC6 +ACBB:000000003F84008400BC01040104063C3804000400000080008001400630180C +ACBC:000000003F84008400BC01040104063C3804000400000410041004100A2831C6 +ACBD:000000003F84008400BC01040104063C3804000400000FF81004100410040FF8 +ACBE:000000003F84008400BC01040104063C3804000400001FFC008001400630180C +ACBF:000000003F84008400BC01040104063C38040004000003E000001FFC02201C1C +ACC0:000000003F84008400BC01040104063C3804000400001FFC00041FFC00040004 +ACC1:000000003F84008400BC01040104063C3804000400001FFC10001FF810000FFC +ACC2:000000003F84008400BC01040104063C3804000400001FFC0410041004101FFC +ACC3:000000003F84008400BC01040104063C38040004000003E000001FFC080807F0 +ACC4:0000000000123F920092009200F200920112017202120C123012001200120012 +ACC5:000000003F92009200F20112011206723812001200000FFE0002000200020002 +ACC6:000000003F92009200F20112011206723812001200000FBE0082008200820082 +ACC7:000000003F92009200F20112011206723812001200000F8800880088009400E3 +ACC8:000000003F92009200F2011201120672381200120012081208000800080007FE +ACC9:000000003F92009200F2011201120672381200120000083E08080808081407E3 +ACCA:000000003F92009200F2011201120672381200120000081C0800087F0822079C +ACCB:000000003F92009200F20112011206723812001200000FFE08000800080007FE +ACCC:000000003F92009200F20112011206723812001200000FFE00020FFC080007FE +ACCD:000000003F92009200F20112011206723812001200000FBE00820F0208020782 +ACCE:000000003F92009200F20112011206723812001200000FBE00A20F220822079E +ACCF:000000003F92009200F20112011206723812001200000FA200A20F3E0822079E +ACD0:000000003F92009200F20112011206723812001200000F8800880F08081407E3 +ACD1:000000003F92009200F20112011206723812001200000FBE00A00F3E0820079E +ACD2:000000003F92009200F20112011206723812001200000FBF00920F12081207BF +ACD3:000000003F92009200F20112011206723812001200000F9C00800F7F0822079C +ACD4:000000003F92009200F20112011206723812001200000FFE08020802080207FE +ACD5:000000003F92009200F2011201120672381200120000080208020FFE080207FE +ACD6:000000003F92009200F2011201120672381200120000088808880F88089407E3 +ACD7:000000003F92009200F20112011206723812001200000040004000A003180C06 +ACD8:000000003F92009200F2011201120672381200120000020802080208051418E3 +ACD9:000000003F92009200F201120112067238120012000007FC08020802080207FC +ACDA:000000003F92009200F20112011206723812001200000FFE004000A003180C06 +ACDB:000000003F92009200F201120112067238120012000001F000000FFE01100E0E +ACDC:000000003F92009200F20112011206723812001200000FFE00020FFE00020002 +ACDD:000000003F92009200F20112011206723812001200000FFE08000FFC080007FE +ACDE:000000003F92009200F20112011206723812001200000FFE0208020802080FFE +ACDF:000000003F92009200F201120112067238120012000001F000000FFE040403F8 +ACE0:0000000000001FFC0004000400040004000400040084008000807FFF00000000 +ACE1:000000001FFC0004000400040004008400807FFF00001FFC0004000400040004 +ACE2:000000001FFC0004000400040004008400807FFF00001F7C0104010401040104 +ACE3:000000001FFC0004000400040004008400807FFF00001F1001100110012801C6 +ACE4:000000001FFC0004000400040004008400807FFF000010001000100010000FFC +ACE5:000000001FFC0004000400040004008400807FFF0000107C1010101010280FC6 +ACE6:000000001FFC0004000400040004008400807FFF00001038100010FE10440F38 +ACE7:000000001FFC0004000400040004008400807FFF00001FFC1000100010000FFC +ACE8:000000001FFC0004000400040004008400807FFF00001FFC00041FF810000FFC +ACE9:000000001FFC0004000400040004008400807FFF00001F7C01041E0410040F04 +ACEA:000000001FFC0004000400040004008400807FFF00001F7C01441E4410440F3C +ACEB:000000001FFC0004000400040004008400807FFF00001F4401441E7C10440F3C +ACEC:000000001FFC0004000400040004008400807FFF00001F1001101E1010280FC6 +ACED:000000001FFC0004000400040004008400807FFF00001F7C01401E7C10400F3C +ACEE:000000001FFC0004000400040004008400807FFF00001F7E01241E2410240F7E +ACEF:000000001FFC0004000400040004008400807FFF00001F3801001EFE10440F38 +ACF0:000000001FFC0004000400040004008400807FFF00001FFC1004100410040FFC +ACF1:000000001FFC0004000400040004008400807FFF0000100410041FFC10040FFC +ACF2:000000001FFC0004000400040004008400807FFF0000111011101F1011280FC6 +ACF3:000000001FFC0004000400040004008400807FFF00000080008001400630180C +ACF4:000000001FFC0004000400040004008400807FFF00000410041004100A2831C6 +ACF5:000000001FFC0004000400040004008400807FFF00000FF81004100410040FF8 +ACF6:000000001FFC0004000400040004008400807FFF00001FFC008001400630180C +ACF7:000000001FFC0004000400040004008400807FFF000003E000001FFC02201C1C +ACF8:000000001FFC0004000400040004008400807FFF00001FFC00041FFC00040004 +ACF9:000000001FFC0004000400040004008400807FFF00001FFC10001FF810000FFC +ACFA:000000001FFC0004000400040004008400807FFF00001FFC0410041004101FFC +ACFB:000000001FFC0004000400040004008400807FFF000003E000001FFC080807F0 +ACFC:0000000000043F840084008400840087008400840484040404047FF400040004 +ACFD:000000003F840084008400870084048404047FF400001FFC0004000400040004 +ACFE:000000003F840084008400870084048404047FF400001F7C0104010401040104 +ACFF:000000003F840084008400870084048404047FF400001F1001100110012801C6 +AD00:000000003F840084008400870084048404047FF4000410041000100010000FFC +AD01:000000003F840084008400870084048404047FF40000107C1010101010280FC6 +AD02:000000003F840084008400870084048404047FF400001038100010FE10440F38 +AD03:000000003F840084008400870084048404047FF400001FFC1000100010000FFC +AD04:000000003F840084008400870084048404047FF400001FFC00041FF810000FFC +AD05:000000003F840084008400870084048404047FF400001F7C01041E0410040F04 +AD06:000000003F840084008400870084048404047FF400001F7C01441E4410440F3C +AD07:000000003F840084008400870084048404047FF400001F4401441E7C10440F3C +AD08:000000003F840084008400870084048404047FF400001F1001101E1010280FC6 +AD09:000000003F840084008400870084048404047FF400001F7C01401E7C10400F3C +AD0A:000000003F840084008400870084048404047FF400001F7E01241E2410240F7E +AD0B:000000003F840084008400870084048404047FF400001F3801001EFE10440F38 +AD0C:000000003F840084008400870084048404047FF400001FFC1004100410040FFC +AD0D:000000003F840084008400870084048404047FF40000100410041FFC10040FFC +AD0E:000000003F840084008400870084048404047FF40000111011101F1011280FC6 +AD0F:000000003F840084008400870084048404047FF400000080008001400630180C +AD10:000000003F840084008400870084048404047FF400000410041004100A2831C6 +AD11:000000003F840084008400870084048404047FF400000FF81004100410040FF8 +AD12:000000003F840084008400870084048404047FF400001FFC008001400630180C +AD13:000000003F840084008400870084048404047FF4000003E000001FFC02201C1C +AD14:000000003F840084008400870084048404047FF400001FFC00041FFC00040004 +AD15:000000003F840084008400870084048404047FF400001FFC10001FF810000FFC +AD16:000000003F840084008400870084048404047FF400001FFC0410041004101FFC +AD17:000000003F840084008400870084048404047FF4000003E000001FFC080807F0 +AD18:0000000000123F92009200920092009E009200920492041204127FD200120012 +AD19:000000003F9200920092009E0092049204127FD200000FFE0002000200020002 +AD1A:000000003F9200920092009E0092049204127FD200000FBE0082008200820082 +AD1B:000000003F9200920092009E0092049204127FD200000F8800880088009400E3 +AD1C:000000003F9200920092009E0092049204127FD20012081208000800080007FE +AD1D:000000003F9200920092009E0092049204127FD20000083E08080808081407E3 +AD1E:000000003F9200920092009E0092049204127FD20000081C0800087F0822079C +AD1F:000000003F9200920092009E0092049204127FD200000FFE08000800080007FE +AD20:000000003F9200920092009E0092049204127FD200000FFE00020FFC080007FE +AD21:000000003F9200920092009E0092049204127FD200000FBE00820F0208020782 +AD22:000000003F9200920092009E0092049204127FD200000FBE00A20F220822079E +AD23:000000003F9200920092009E0092049204127FD200000FA200A20F3E0822079E +AD24:000000003F9200920092009E0092049204127FD200000F8800880F08081407E3 +AD25:000000003F9200920092009E0092049204127FD200000FBE00A00F3E0820079E +AD26:000000003F9200920092009E0092049204127FD200000FBF00920F12081207BF +AD27:000000003F9200920092009E0092049204127FD200000F9C00800F7F0822079C +AD28:000000003F9200920092009E0092049204127FD200000FFE08020802080207FE +AD29:000000003F9200920092009E0092049204127FD20000080208020FFE080207FE +AD2A:000000003F9200920092009E0092049204127FD20000088808880F88089407E3 +AD2B:000000003F9200920092009E0092049204127FD200000040004000A003180C06 +AD2C:000000003F9200920092009E0092049204127FD20000020802080208051418E3 +AD2D:000000003F9200920092009E0092049204127FD2000007FC08020802080207FC +AD2E:000000003F9200920092009E0092049204127FD200000FFE004000A003180C06 +AD2F:000000003F9200920092009E0092049204127FD2000001F000000FFE01100E0E +AD30:000000003F9200920092009E0092049204127FD200000FFE00020FFE00020002 +AD31:000000003F9200920092009E0092049204127FD200000FFE08000FFC080007FE +AD32:000000003F9200920092009E0092049204127FD200000FFE0208020802080FFE +AD33:000000003F9200920092009E0092049204127FD2000001F000000FFE040403F8 +AD34:0000000000043F840084008400840084008400840484040404047FF400040004 +AD35:000000003F840084008400840084048404047FF400001FFC0004000400040004 +AD36:000000003F840084008400840084048404047FF400001F7C0104010401040104 +AD37:000000003F840084008400840084048404047FF400001F1001100110012801C6 +AD38:000000003F840084008400840084048404047FF4000410041000100010000FFC +AD39:000000003F840084008400840084048404047FF40000107C1010101010280FC6 +AD3A:000000003F840084008400840084048404047FF400001038100010FE10440F38 +AD3B:000000003F840084008400840084048404047FF400001FFC1000100010000FFC +AD3C:000000003F840084008400840084048404047FF400001FFC00041FF810000FFC +AD3D:000000003F840084008400840084048404047FF400001F7C01041E0410040F04 +AD3E:000000003F840084008400840084048404047FF400001F7C01441E4410440F3C +AD3F:000000003F840084008400840084048404047FF400001F4401441E7C10440F3C +AD40:000000003F840084008400840084048404047FF400001F1001101E1010280FC6 +AD41:000000003F840084008400840084048404047FF400001F7C01401E7C10400F3C +AD42:000000003F840084008400840084048404047FF400001F7E01241E2410240F7E +AD43:000000003F840084008400840084048404047FF400001F3801001EFE10440F38 +AD44:000000003F840084008400840084048404047FF400001FFC1004100410040FFC +AD45:000000003F840084008400840084048404047FF40000100410041FFC10040FFC +AD46:000000003F840084008400840084048404047FF40000111011101F1011280FC6 +AD47:000000003F840084008400840084048404047FF400000080008001400630180C +AD48:000000003F840084008400840084048404047FF400000410041004100A2831C6 +AD49:000000003F840084008400840084048404047FF400000FF81004100410040FF8 +AD4A:000000003F840084008400840084048404047FF400001FFC008001400630180C +AD4B:000000003F840084008400840084048404047FF4000003E000001FFC02201C1C +AD4C:000000003F840084008400840084048404047FF400001FFC00041FFC00040004 +AD4D:000000003F840084008400840084048404047FF400001FFC10001FF810000FFC +AD4E:000000003F840084008400840084048404047FF400001FFC0410041004101FFC +AD4F:000000003F840084008400840084048404047FF4000003E000001FFC080807F0 +AD50:0000000000001FFC0004000400040004000400040224022002207FFF00000000 +AD51:000000001FFC0004000400040004022402207FFF00001FFC0004000400040004 +AD52:000000001FFC0004000400040004022402207FFF00001F7C0104010401040104 +AD53:000000001FFC0004000400040004022402207FFF00001F1001100110012801C6 +AD54:000000001FFC0004000400040004022402207FFF000010001000100010000FFC +AD55:000000001FFC0004000400040004022402207FFF0000107C1010101010280FC6 +AD56:000000001FFC0004000400040004022402207FFF00001038100010FE10440F38 +AD57:000000001FFC0004000400040004022402207FFF00001FFC1000100010000FFC +AD58:000000001FFC0004000400040004022402207FFF00001FFC00041FF810000FFC +AD59:000000001FFC0004000400040004022402207FFF00001F7C01041E0410040F04 +AD5A:000000001FFC0004000400040004022402207FFF00001F7C01441E4410440F3C +AD5B:000000001FFC0004000400040004022402207FFF00001F4401441E7C10440F3C +AD5C:000000001FFC0004000400040004022402207FFF00001F1001101E1010280FC6 +AD5D:000000001FFC0004000400040004022402207FFF00001F7C01401E7C10400F3C +AD5E:000000001FFC0004000400040004022402207FFF00001F7E01241E2410240F7E +AD5F:000000001FFC0004000400040004022402207FFF00001F3801001EFE10440F38 +AD60:000000001FFC0004000400040004022402207FFF00001FFC1004100410040FFC +AD61:000000001FFC0004000400040004022402207FFF0000100410041FFC10040FFC +AD62:000000001FFC0004000400040004022402207FFF0000111011101F1011280FC6 +AD63:000000001FFC0004000400040004022402207FFF00000080008001400630180C +AD64:000000001FFC0004000400040004022402207FFF00000410041004100A2831C6 +AD65:000000001FFC0004000400040004022402207FFF00000FF81004100410040FF8 +AD66:000000001FFC0004000400040004022402207FFF00001FFC008001400630180C +AD67:000000001FFC0004000400040004022402207FFF000003E000001FFC02201C1C +AD68:000000001FFC0004000400040004022402207FFF00001FFC00041FFC00040004 +AD69:000000001FFC0004000400040004022402207FFF00001FFC10001FF810000FFC +AD6A:000000001FFC0004000400040004022402207FFF00001FFC0410041004101FFC +AD6B:000000001FFC0004000400040004022402207FFF000003E000001FFC080807F0 +AD6C:000000001FFC0004000400040004000400007FFF008000800080008000800080 +AD6D:000000001FFC000400040004000400047FFF008000801FFC0004000400040004 +AD6E:000000001FFC000400040004000400047FFF008000801F7C0104010401040104 +AD6F:000000001FFC000400040004000400047FFF008000801F1001100110012801C6 +AD70:000000001FFC0004000400040004000400007FFF008010801080100010000FFC +AD71:000000001FFC000400040004000400047FFF00800080107C1010101010280FC6 +AD72:000000001FFC000400040004000400047FFF008000801038100010FE10440F38 +AD73:000000001FFC000400040004000400047FFF008000801FFC1000100010000FFC +AD74:000000001FFC000400040004000400047FFF008000801FFC00041FF810000FFC +AD75:000000001FFC000400040004000400047FFF008000801F7C01041E0410040F04 +AD76:000000001FFC000400040004000400047FFF008000801F7C01441E4410440F3C +AD77:000000001FFC000400040004000400047FFF008000801F4401441E7C10440F3C +AD78:000000001FFC000400040004000400047FFF008000801F1001101E1010280FC6 +AD79:000000001FFC000400040004000400047FFF008000801F7C01401E7C10400F3C +AD7A:000000001FFC000400040004000400047FFF008000801F7E01241E2410240F7E +AD7B:000000001FFC000400040004000400047FFF008000801F3801001EFE10440F38 +AD7C:000000001FFC000400040004000400047FFF008000801FFC1004100410040FFC +AD7D:000000001FFC000400040004000400047FFF00800080100410041FFC10040FFC +AD7E:000000001FFC000400040004000400047FFF00800080111011101F1011280FC6 +AD7F:000000001FFC000400040004000400047FFF008000800080008001400630180C +AD80:000000001FFC000400040004000400047FFF008000800410041004100A2831C6 +AD81:000000001FFC000400040004000400047FFF008000800FF81004100410040FF8 +AD82:000000001FFC000400040004000400047FFF008000801FFC008001400630180C +AD83:000000001FFC000400040004000400047FFF0080008003E000001FFC02201C1C +AD84:000000001FFC000400040004000400047FFF008000801FFC00041FFC00040004 +AD85:000000001FFC000400040004000400047FFF008000801FFC10001FF810000FFC +AD86:000000001FFC000400040004000400047FFF008000801FFC0410041004101FFC +AD87:000000001FFC000400040004000400047FFF0080008003E000001FFC080807F0 +AD88:000000003F840084008400840084008400047FF404040404043C040404040404 +AD89:000000003F8400840084009C008400847FF4040404001FFC0004000400040004 +AD8A:000000003F8400840084009C008400847FF4040404001F7C0104010401040104 +AD8B:000000003F8400840084009C008400847FF4040404001F1001100110012801C6 +AD8C:000000003F84008400840084008400847FF40404043C14041000100010000FFC +AD8D:000000003F8400840084009C008400847FF404040400107C1010101010280FC6 +AD8E:000000003F8400840084009C008400847FF4040404001038100010FE10440F38 +AD8F:000000003F8400840084009C008400847FF4040404001FFC1000100010000FFC +AD90:000000003F8400840084009C008400847FF4040404001FFC00041FF810000FFC +AD91:000000003F8400840084009C008400847FF4040404001F7C01041E0410040F04 +AD92:000000003F8400840084009C008400847FF4040404001F7C01441E4410440F3C +AD93:000000003F8400840084009C008400847FF4040404001F4401441E7C10440F3C +AD94:000000003F8400840084009C008400847FF4040404001F1001101E1010280FC6 +AD95:000000003F8400840084009C008400847FF4040404001F7C01401E7C10400F3C +AD96:000000003F8400840084009C008400847FF4040404001F7E01241E2410240F7E +AD97:000000003F8400840084009C008400847FF4040404001F3801001EFE10440F38 +AD98:000000003F8400840084009C008400847FF4040404001FFC1004100410040FFC +AD99:000000003F8400840084009C008400847FF404040400100410041FFC10040FFC +AD9A:000000003F8400840084009C008400847FF404040400111011101F1011280FC6 +AD9B:000000003F8400840084009C008400847FF4040404000080008001400630180C +AD9C:000000003F8400840084009C008400847FF4040404000410041004100A2831C6 +AD9D:000000003F8400840084009C008400847FF4040404000FF81004100410040FF8 +AD9E:000000003F8400840084009C008400847FF4040404001FFC008001400630180C +AD9F:000000003F8400840084009C008400847FF40404040003E000001FFC02201C1C +ADA0:000000003F8400840084009C008400847FF4040404001FFC00041FFC00040004 +ADA1:000000003F8400840084009C008400847FF4040404001FFC10001FF810000FFC +ADA2:000000003F8400840084009C008400847FF4040404001FFC0410041004101FFC +ADA3:000000003F8400840084009C008400847FF40404040003E000001FFC080807F0 +ADA4:000000003F920092009200920092009200127FD20412041204F2041204120412 +ADA5:000000003F920092009200F2009200927FD2041204000FFE0002000200020002 +ADA6:000000003F920092009200F2009200927FD2041204000FBE0082008200820082 +ADA7:000000003F920092009200F2009200927FD2041204000F8800880088009400E3 +ADA8:000000003F92009200920092009200927FD2021202F20A1208000800080007FE +ADA9:000000003F920092009200F2009200927FD204120400083E08080808081407E3 +ADAA:000000003F920092009200F2009200927FD204120400081C0800087F0822079C +ADAB:000000003F920092009200F2009200927FD2041204000FFE08000800080007FE +ADAC:000000003F920092009200F2009200927FD2041204000FFE00020FFC080007FE +ADAD:000000003F920092009200F2009200927FD2041204000FBE00820F0208020782 +ADAE:000000003F920092009200F2009200927FD2041204000FBE00A20F220822079E +ADAF:000000003F920092009200F2009200927FD2041204000FA200A20F3E0822079E +ADB0:000000003F920092009200F2009200927FD2041204000F8800880F08081407E3 +ADB1:000000003F920092009200F2009200927FD2041204000FBE00A00F3E0820079E +ADB2:000000003F920092009200F2009200927FD2041204000FBF00920F12081207BF +ADB3:000000003F920092009200F2009200927FD2041204000F9C00800F7F0822079C +ADB4:000000003F920092009200F2009200927FD2041204000FFE08020802080207FE +ADB5:000000003F920092009200F2009200927FD204120400080208020FFE080207FE +ADB6:000000003F920092009200F2009200927FD204120400088808880F88089407E3 +ADB7:000000003F920092009200F2009200927FD2041204000040004000A003180C06 +ADB8:000000003F920092009200F2009200927FD204120400020802080208051418E3 +ADB9:000000003F920092009200F2009200927FD20412040007FC08020802080207FC +ADBA:000000003F920092009200F2009200927FD2041204000FFE004000A003180C06 +ADBB:000000003F920092009200F2009200927FD20412040001F000000FFE01100E0E +ADBC:000000003F920092009200F2009200927FD2041204000FFE00020FFE00020002 +ADBD:000000003F920092009200F2009200927FD2041204000FFE08000FFC080007FE +ADBE:000000003F920092009200F2009200927FD2041204000FFE0208020802080FFE +ADBF:000000003F920092009200F2009200927FD20412040001F000000FFE040403F8 +ADC0:000000003F840084008400840084008400047FF4040404040404040404040404 +ADC1:000000003F84008400840084008400847FF4040404001FFC0004000400040004 +ADC2:000000003F84008400840084008400847FF4040404001F7C0104010401040104 +ADC3:000000003F84008400840084008400847FF4040404001F1001100110012801C6 +ADC4:000000003F84008400840084008400847FF40404040414041000100010000FFC +ADC5:000000003F84008400840084008400847FF404040400107C1010101010280FC6 +ADC6:000000003F84008400840084008400847FF4040404001038100010FE10440F38 +ADC7:000000003F84008400840084008400847FF4040404001FFC1000100010000FFC +ADC8:000000003F84008400840084008400847FF4040404001FFC00041FF810000FFC +ADC9:000000003F84008400840084008400847FF4040404001F7C01041E0410040F04 +ADCA:000000003F84008400840084008400847FF4040404001F7C01441E4410440F3C +ADCB:000000003F84008400840084008400847FF4040404001F4401441E7C10440F3C +ADCC:000000003F84008400840084008400847FF4040404001F1001101E1010280FC6 +ADCD:000000003F84008400840084008400847FF4040404001F7C01401E7C10400F3C +ADCE:000000003F84008400840084008400847FF4040404001F7E01241E2410240F7E +ADCF:000000003F84008400840084008400847FF4040404001F3801001EFE10440F38 +ADD0:000000003F84008400840084008400847FF4040404001FFC1004100410040FFC +ADD1:000000003F84008400840084008400847FF404040400100410041FFC10040FFC +ADD2:000000003F84008400840084008400847FF404040400111011101F1011280FC6 +ADD3:000000003F84008400840084008400847FF4040404000080008001400630180C +ADD4:000000003F84008400840084008400847FF4040404000410041004100A2831C6 +ADD5:000000003F84008400840084008400847FF4040404000FF81004100410040FF8 +ADD6:000000003F84008400840084008400847FF4040404001FFC008001400630180C +ADD7:000000003F84008400840084008400847FF40404040003E000001FFC02201C1C +ADD8:000000003F84008400840084008400847FF4040404001FFC00041FFC00040004 +ADD9:000000003F84008400840084008400847FF4040404001FFC10001FF810000FFC +ADDA:000000003F84008400840084008400847FF4040404001FFC0410041004101FFC +ADDB:000000003F84008400840084008400847FF40404040003E000001FFC080807F0 +ADDC:000000001FFC0004000400040004000400007FFF041004100410041004100410 +ADDD:000000001FFC000400040004000400047FFF022002201FFC0004000400040004 +ADDE:000000001FFC000400040004000400047FFF022002201F7C0104010401040104 +ADDF:000000001FFC000400040004000400047FFF022002201F1001100110012801C6 +ADE0:000000001FFC0004000400040004000400007FFF022012201220100010000FFC +ADE1:000000001FFC000400040004000400047FFF02200220107C1010101010280FC6 +ADE2:000000001FFC000400040004000400047FFF022002201038100010FE10440F38 +ADE3:000000001FFC000400040004000400047FFF022002201FFC1000100010000FFC +ADE4:000000001FFC000400040004000400047FFF022002201FFC00041FF810000FFC +ADE5:000000001FFC000400040004000400047FFF022002201F7C01041E0410040F04 +ADE6:000000001FFC000400040004000400047FFF022002201F7C01441E4410440F3C +ADE7:000000001FFC000400040004000400047FFF022002201F4401441E7C10440F3C +ADE8:000000001FFC000400040004000400047FFF022002201F1001101E1010280FC6 +ADE9:000000001FFC000400040004000400047FFF022002201F7C01401E7C10400F3C +ADEA:000000001FFC000400040004000400047FFF022002201F7E01241E2410240F7E +ADEB:000000001FFC000400040004000400047FFF022002201F3801001EFE10440F38 +ADEC:000000001FFC000400040004000400047FFF022002201FFC1004100410040FFC +ADED:000000001FFC000400040004000400047FFF02200220100410041FFC10040FFC +ADEE:000000001FFC000400040004000400047FFF02200220111011101F1011280FC6 +ADEF:000000001FFC000400040004000400047FFF022002200080008001400630180C +ADF0:000000001FFC000400040004000400047FFF022002200410041004100A2831C6 +ADF1:000000001FFC000400040004000400047FFF022002200FF81004100410040FF8 +ADF2:000000001FFC000400040004000400047FFF022002201FFC008001400630180C +ADF3:000000001FFC000400040004000400047FFF0220022003E000001FFC02201C1C +ADF4:000000001FFC000400040004000400047FFF022002201FFC00041FFC00040004 +ADF5:000000001FFC000400040004000400047FFF022002201FFC10001FF810000FFC +ADF6:000000001FFC000400040004000400047FFF022002201FFC0410041004101FFC +ADF7:000000001FFC000400040004000400047FFF0220022003E000001FFC080807F0 +ADF8:0000000000001FFC0004000400040004000400040004000000007FFF00000000 +ADF9:000000001FFC000400040004000400047FFF000000001FFC0004000400040004 +ADFA:000000001FFC000400040004000400047FFF000000001F7C0104010401040104 +ADFB:000000001FFC000400040004000400047FFF000000001F1001100110012801C6 +ADFC:000000001FFC0004000400040004000400007FFF000010001000100010000FFC +ADFD:000000001FFC000400040004000400047FFF00000000107C1010101010280FC6 +ADFE:000000001FFC000400040004000400047FFF000000001038100010FE10440F38 +ADFF:000000001FFC000400040004000400047FFF000000001FFC1000100010000FFC +AE00:000000001FFC000400040004000400047FFF000000001FFC00041FF810000FFC +AE01:000000001FFC000400040004000400047FFF000000001F7C01041E0410040F04 +AE02:000000001FFC000400040004000400047FFF000000001F7C01441E4410440F3C +AE03:000000001FFC000400040004000400047FFF000000001F4401441E7C10440F3C +AE04:000000001FFC000400040004000400047FFF000000001F1001101E1010280FC6 +AE05:000000001FFC000400040004000400047FFF000000001F7C01401E7C10400F3C +AE06:000000001FFC000400040004000400047FFF000000001F7E01241E2410240F7E +AE07:000000001FFC000400040004000400047FFF000000001F3801001EFE10440F38 +AE08:000000001FFC000400040004000400047FFF000000001FFC1004100410040FFC +AE09:000000001FFC000400040004000400047FFF00000000100410041FFC10040FFC +AE0A:000000001FFC000400040004000400047FFF00000000111011101F1011280FC6 +AE0B:000000001FFC000400040004000400047FFF000000000080008001400630180C +AE0C:000000001FFC000400040004000400047FFF000000000410041004100A2831C6 +AE0D:000000001FFC000400040004000400047FFF000000000FF81004100410040FF8 +AE0E:000000001FFC000400040004000400047FFF000000001FFC008001400630180C +AE0F:000000001FFC000400040004000400047FFF0000000003E000001FFC02201C1C +AE10:000000001FFC000400040004000400047FFF000000001FFC00041FFC00040004 +AE11:000000001FFC000400040004000400047FFF000000001FFC10001FF810000FFC +AE12:000000001FFC000400040004000400047FFF000000001FFC0410041004101FFC +AE13:000000001FFC000400040004000400047FFF0000000003E000001FFC080807F0 +AE14:0000000000043F840084008400840084008400840084000400047FF400040004 +AE15:000000003F84008400840084008400847FF4000400001FFC0004000400040004 +AE16:000000003F84008400840084008400847FF4000400001F7C0104010401040104 +AE17:000000003F84008400840084008400847FF4000400001F1001100110012801C6 +AE18:000000003F840084008400840084008400047FF4000410041000100010000FFC +AE19:000000003F84008400840084008400847FF400040000107C1010101010280FC6 +AE1A:000000003F84008400840084008400847FF4000400001038100010FE10440F38 +AE1B:000000003F84008400840084008400847FF4000400001FFC1000100010000FFC +AE1C:000000003F84008400840084008400847FF4000400001FFC00041FF810000FFC +AE1D:000000003F84008400840084008400847FF4000400001F7C01041E0410040F04 +AE1E:000000003F84008400840084008400847FF4000400001F7C01441E4410440F3C +AE1F:000000003F84008400840084008400847FF4000400001F4401441E7C10440F3C +AE20:000000003F84008400840084008400847FF4000400001F1001101E1010280FC6 +AE21:000000003F84008400840084008400847FF4000400001F7C01401E7C10400F3C +AE22:000000003F84008400840084008400847FF4000400001F7E01241E2410240F7E +AE23:000000003F84008400840084008400847FF4000400001F3801001EFE10440F38 +AE24:000000003F84008400840084008400847FF4000400001FFC1004100410040FFC +AE25:000000003F84008400840084008400847FF400040000100410041FFC10040FFC +AE26:000000003F84008400840084008400847FF400040000111011101F1011280FC6 +AE27:000000003F84008400840084008400847FF4000400000080008001400630180C +AE28:000000003F84008400840084008400847FF4000400000410041004100A2831C6 +AE29:000000003F84008400840084008400847FF4000400000FF81004100410040FF8 +AE2A:000000003F84008400840084008400847FF4000400001FFC008001400630180C +AE2B:000000003F84008400840084008400847FF40004000003E000001FFC02201C1C +AE2C:000000003F84008400840084008400847FF4000400001FFC00041FFC00040004 +AE2D:000000003F84008400840084008400847FF4000400001FFC10001FF810000FFC +AE2E:000000003F84008400840084008400847FF4000400001FFC0410041004101FFC +AE2F:000000003F84008400840084008400847FF40004000003E000001FFC080807F0 +AE30:0000000000043F8400840084008400840104010402040C043004000400040004 +AE31:000000003F84008400840104010406043804000400001FFC0004000400040004 +AE32:000000003F84008400840104010406043804000400001F7C0104010401040104 +AE33:000000003F84008400840104010406043804000400001F1001100110012801C6 +AE34:000000003F840084008401040104060438040004000410041000100010000FFC +AE35:000000003F8400840084010401040604380400040000107C1010101010280FC6 +AE36:000000003F84008400840104010406043804000400001038100010FE10440F38 +AE37:000000003F84008400840104010406043804000400001FFC1000100010000FFC +AE38:000000003F84008400840104010406043804000400001FFC00041FF810000FFC +AE39:000000003F84008400840104010406043804000400001F7C01041E0410040F04 +AE3A:000000003F84008400840104010406043804000400001F7C01441E4410440F3C +AE3B:000000003F84008400840104010406043804000400001F4401441E7C10440F3C +AE3C:000000003F84008400840104010406043804000400001F1001101E1010280FC6 +AE3D:000000003F84008400840104010406043804000400001F7C01401E7C10400F3C +AE3E:000000003F84008400840104010406043804000400001F7E01241E2410240F7E +AE3F:000000003F84008400840104010406043804000400001F3801001EFE10440F38 +AE40:000000003F84008400840104010406043804000400001FFC1004100410040FFC +AE41:000000003F8400840084010401040604380400040000100410041FFC10040FFC +AE42:000000003F8400840084010401040604380400040000111011101F1011280FC6 +AE43:000000003F84008400840104010406043804000400000080008001400630180C +AE44:000000003F84008400840104010406043804000400000410041004100A2831C6 +AE45:000000003F84008400840104010406043804000400000FF81004100410040FF8 +AE46:000000003F84008400840104010406043804000400001FFC008001400630180C +AE47:000000003F840084008401040104060438040004000003E000001FFC02201C1C +AE48:000000003F84008400840104010406043804000400001FFC00041FFC00040004 +AE49:000000003F84008400840104010406043804000400001FFC10001FF810000FFC +AE4A:000000003F84008400840104010406043804000400001FFC0410041004101FFC +AE4B:000000003F840084008401040104060438040004000003E000001FFC080807F0 +AE4C:0000000000043F84048404840484048704840904090412042404000400040004 +AE4D:000000003F84048404840907090412042404000400001FFC0004000400040004 +AE4E:000000003F84048404840907090412042404000400001F7C0104010401040104 +AE4F:000000003F84048404840907090412042404000400001F1001100110012801C6 +AE50:000000003F840484048409070904120424040004000410041000100010000FFC +AE51:000000003F8404840484090709041204240400040000107C1010101010280FC6 +AE52:000000003F84048404840907090412042404000400001038100010FE10440F38 +AE53:000000003F84048404840907090412042404000400001FFC1000100010000FFC +AE54:000000003F84048404840907090412042404000400001FFC00041FF810000FFC +AE55:000000003F84048404840907090412042404000400001F7C01041E0410040F04 +AE56:000000003F84048404840907090412042404000400001F7C01441E4410440F3C +AE57:000000003F84048404840907090412042404000400001F4401441E7C10440F3C +AE58:000000003F84048404840907090412042404000400001F1001101E1010280FC6 +AE59:000000003F84048404840907090412042404000400001F7C01401E7C10400F3C +AE5A:000000003F84048404840907090412042404000400001F7E01241E2410240F7E +AE5B:000000003F84048404840907090412042404000400001F3801001EFE10440F38 +AE5C:000000003F84048404840907090412042404000400001FFC1004100410040FFC +AE5D:000000003F8404840484090709041204240400040000100410041FFC10040FFC +AE5E:000000003F8404840484090709041204240400040000111011101F1011280FC6 +AE5F:000000003F84048404840907090412042404000400000080008001400630180C +AE60:000000003F84048404840907090412042404000400000410041004100A2831C6 +AE61:000000003F84048404840907090412042404000400000FF81004100410040FF8 +AE62:000000003F84048404840907090412042404000400001FFC008001400630180C +AE63:000000003F840484048409070904120424040004000003E000001FFC02201C1C +AE64:000000003F84048404840907090412042404000400001FFC00041FFC00040004 +AE65:000000003F84048404840907090412042404000400001FFC10001FF810000FFC +AE66:000000003F84048404840907090412042404000400001FFC0410041004101FFC +AE67:000000003F840484048409070904120424040004000003E000001FFC080807F0 +AE68:0000000000123F92049204920492049E04920912091212122412001200120012 +AE69:000000003F9204920492091E091212122412001200000FFE0002000200020002 +AE6A:000000003F9204920492091E091212122412001200000FBE0082008200820082 +AE6B:000000003F9204920492091E091212122412001200000F8800880088009400E3 +AE6C:000000003F9204920492091E09121212241200120012081208000800080007FE +AE6D:000000003F9204920492091E09121212241200120000083E08080808081407E3 +AE6E:000000003F9204920492091E09121212241200120000081C0800087F0822079C +AE6F:000000003F9204920492091E091212122412001200000FFE08000800080007FE +AE70:000000003F9204920492091E091212122412001200000FFE00020FFC080007FE +AE71:000000003F9204920492091E091212122412001200000FBE00820F0208020782 +AE72:000000003F9204920492091E091212122412001200000FBE00A20F220822079E +AE73:000000003F9204920492091E091212122412001200000FA200A20F3E0822079E +AE74:000000003F9204920492091E091212122412001200000F8800880F08081407E3 +AE75:000000003F9204920492091E091212122412001200000FBE00A00F3E0820079E +AE76:000000003F9204920492091E091212122412001200000FBF00920F12081207BF +AE77:000000003F9204920492091E091212122412001200000F9C00800F7F0822079C +AE78:000000003F9204920492091E091212122412001200000FFE08020802080207FE +AE79:000000003F9204920492091E09121212241200120000080208020FFE080207FE +AE7A:000000003F9204920492091E09121212241200120000088808880F88089407E3 +AE7B:000000003F9204920492091E091212122412001200000040004000A003180C06 +AE7C:000000003F9204920492091E09121212241200120000020802080208051418E3 +AE7D:000000003F9204920492091E0912121224120012000007FC08020802080207FC +AE7E:000000003F9204920492091E091212122412001200000FFE004000A003180C06 +AE7F:000000003F9204920492091E0912121224120012000001F000000FFE01100E0E +AE80:000000003F9204920492091E091212122412001200000FFE00020FFE00020002 +AE81:000000003F9204920492091E091212122412001200000FFE08000FFC080007FE +AE82:000000003F9204920492091E091212122412001200000FFE0208020802080FFE +AE83:000000003F9204920492091E0912121224120012000001F000000FFE040403F8 +AE84:0000000000043F84048404840487048404840907090412042404000400040004 +AE85:000000003F84048404870904090412072404000400001FFC0004000400040004 +AE86:000000003F84048404870904090412072404000400001F7C0104010401040104 +AE87:000000003F84048404870904090412072404000400001F1001100110012801C6 +AE88:000000003F840484048709040904120724040004000410041000100010000FFC +AE89:000000003F8404840487090409041207240400040000107C1010101010280FC6 +AE8A:000000003F84048404870904090412072404000400001038100010FE10440F38 +AE8B:000000003F84048404870904090412072404000400001FFC1000100010000FFC +AE8C:000000003F84048404870904090412072404000400001FFC00041FF810000FFC +AE8D:000000003F84048404870904090412072404000400001F7C01041E0410040F04 +AE8E:000000003F84048404870904090412072404000400001F7C01441E4410440F3C +AE8F:000000003F84048404870904090412072404000400001F4401441E7C10440F3C +AE90:000000003F84048404870904090412072404000400001F1001101E1010280FC6 +AE91:000000003F84048404870904090412072404000400001F7C01401E7C10400F3C +AE92:000000003F84048404870904090412072404000400001F7E01241E2410240F7E +AE93:000000003F84048404870904090412072404000400001F3801001EFE10440F38 +AE94:000000003F84048404870904090412072404000400001FFC1004100410040FFC +AE95:000000003F8404840487090409041207240400040000100410041FFC10040FFC +AE96:000000003F8404840487090409041207240400040000111011101F1011280FC6 +AE97:000000003F84048404870904090412072404000400000080008001400630180C +AE98:000000003F84048404870904090412072404000400000410041004100A2831C6 +AE99:000000003F84048404870904090412072404000400000FF81004100410040FF8 +AE9A:000000003F84048404870904090412072404000400001FFC008001400630180C +AE9B:000000003F840484048709040904120724040004000003E000001FFC02201C1C +AE9C:000000003F84048404870904090412072404000400001FFC00041FFC00040004 +AE9D:000000003F84048404870904090412072404000400001FFC10001FF810000FFC +AE9E:000000003F84048404870904090412072404000400001FFC0410041004101FFC +AE9F:000000003F840484048709040904120724040004000003E000001FFC080807F0 +AEA0:0000000000123F9204920492049E04920492091E091212122412001200120012 +AEA1:000000003F920492049E09120912121E2412001200000FFE0002000200020002 +AEA2:000000003F920492049E09120912121E2412001200000FBE0082008200820082 +AEA3:000000003F920492049E09120912121E2412001200000F8800880088009400E3 +AEA4:000000003F920492049E09120912121E241200120012081208000800080007FE +AEA5:000000003F920492049E09120912121E241200120000083E08080808081407E3 +AEA6:000000003F920492049E09120912121E241200120000081C0800087F0822079C +AEA7:000000003F920492049E09120912121E2412001200000FFE08000800080007FE +AEA8:000000003F920492049E09120912121E2412001200000FFE00020FFC080007FE +AEA9:000000003F920492049E09120912121E2412001200000FBE00820F0208020782 +AEAA:000000003F920492049E09120912121E2412001200000FBE00A20F220822079E +AEAB:000000003F920492049E09120912121E2412001200000FA200A20F3E0822079E +AEAC:000000003F920492049E09120912121E2412001200000F8800880F08081407E3 +AEAD:000000003F920492049E09120912121E2412001200000FBE00A00F3E0820079E +AEAE:000000003F920492049E09120912121E2412001200000FBF00920F12081207BF +AEAF:000000003F920492049E09120912121E2412001200000F9C00800F7F0822079C +AEB0:000000003F920492049E09120912121E2412001200000FFE08020802080207FE +AEB1:000000003F920492049E09120912121E241200120000080208020FFE080207FE +AEB2:000000003F920492049E09120912121E241200120000088808880F88089407E3 +AEB3:000000003F920492049E09120912121E2412001200000040004000A003180C06 +AEB4:000000003F920492049E09120912121E241200120000020802080208051418E3 +AEB5:000000003F920492049E09120912121E24120012000007FC08020802080207FC +AEB6:000000003F920492049E09120912121E2412001200000FFE004000A003180C06 +AEB7:000000003F920492049E09120912121E24120012000001F000000FFE01100E0E +AEB8:000000003F920492049E09120912121E2412001200000FFE00020FFE00020002 +AEB9:000000003F920492049E09120912121E2412001200000FFE08000FFC080007FE +AEBA:000000003F920492049E09120912121E2412001200000FFE0208020802080FFE +AEBB:000000003F920492049E09120912121E24120012000001F000000FFE040403F8 +AEBC:0000000000043F8404840484048404BC04840904090412042404000400040004 +AEBD:000000003F8404840484093C090412042404000400001FFC0004000400040004 +AEBE:000000003F8404840484093C090412042404000400001F7C0104010401040104 +AEBF:000000003F8404840484093C090412042404000400001F1001100110012801C6 +AEC0:000000003F8404840484093C0904120424040004000410041000100010000FFC +AEC1:000000003F8404840484093C09041204240400040000107C1010101010280FC6 +AEC2:000000003F8404840484093C090412042404000400001038100010FE10440F38 +AEC3:000000003F8404840484093C090412042404000400001FFC1000100010000FFC +AEC4:000000003F8404840484093C090412042404000400001FFC00041FF810000FFC +AEC5:000000003F8404840484093C090412042404000400001F7C01041E0410040F04 +AEC6:000000003F8404840484093C090412042404000400001F7C01441E4410440F3C +AEC7:000000003F8404840484093C090412042404000400001F4401441E7C10440F3C +AEC8:000000003F8404840484093C090412042404000400001F1001101E1010280FC6 +AEC9:000000003F8404840484093C090412042404000400001F7C01401E7C10400F3C +AECA:000000003F8404840484093C090412042404000400001F7E01241E2410240F7E +AECB:000000003F8404840484093C090412042404000400001F3801001EFE10440F38 +AECC:000000003F8404840484093C090412042404000400001FFC1004100410040FFC +AECD:000000003F8404840484093C09041204240400040000100410041FFC10040FFC +AECE:000000003F8404840484093C09041204240400040000111011101F1011280FC6 +AECF:000000003F8404840484093C090412042404000400000080008001400630180C +AED0:000000003F8404840484093C090412042404000400000410041004100A2831C6 +AED1:000000003F8404840484093C090412042404000400000FF81004100410040FF8 +AED2:000000003F8404840484093C090412042404000400001FFC008001400630180C +AED3:000000003F8404840484093C0904120424040004000003E000001FFC02201C1C +AED4:000000003F8404840484093C090412042404000400001FFC00041FFC00040004 +AED5:000000003F8404840484093C090412042404000400001FFC10001FF810000FFC +AED6:000000003F8404840484093C090412042404000400001FFC0410041004101FFC +AED7:000000003F8404840484093C0904120424040004000003E000001FFC080807F0 +AED8:0000000000123F9204920492049204F204920912091212122412001200120012 +AED9:000000003F92049204920972091212122412001200000FFE0002000200020002 +AEDA:000000003F92049204920972091212122412001200000FBE0082008200820082 +AEDB:000000003F92049204920972091212122412001200000F8800880088009400E3 +AEDC:000000003F9204920492097209121212241200120012081208000800080007FE +AEDD:000000003F9204920492097209121212241200120000083E08080808081407E3 +AEDE:000000003F9204920492097209121212241200120000081C0800087F0822079C +AEDF:000000003F92049204920972091212122412001200000FFE08000800080007FE +AEE0:000000003F92049204920972091212122412001200000FFE00020FFC080007FE +AEE1:000000003F92049204920972091212122412001200000FBE00820F0208020782 +AEE2:000000003F92049204920972091212122412001200000FBE00A20F220822079E +AEE3:000000003F92049204920972091212122412001200000FA200A20F3E0822079E +AEE4:000000003F92049204920972091212122412001200000F8800880F08081407E3 +AEE5:000000003F92049204920972091212122412001200000FBE00A00F3E0820079E +AEE6:000000003F92049204920972091212122412001200000FBF00920F12081207BF +AEE7:000000003F92049204920972091212122412001200000F9C00800F7F0822079C +AEE8:000000003F92049204920972091212122412001200000FFE08020802080207FE +AEE9:000000003F9204920492097209121212241200120000080208020FFE080207FE +AEEA:000000003F9204920492097209121212241200120000088808880F88089407E3 +AEEB:000000003F92049204920972091212122412001200000040004000A003180C06 +AEEC:000000003F9204920492097209121212241200120000020802080208051418E3 +AEED:000000003F920492049209720912121224120012000007FC08020802080207FC +AEEE:000000003F92049204920972091212122412001200000FFE004000A003180C06 +AEEF:000000003F920492049209720912121224120012000001F000000FFE01100E0E +AEF0:000000003F92049204920972091212122412001200000FFE00020FFE00020002 +AEF1:000000003F92049204920972091212122412001200000FFE08000FFC080007FE +AEF2:000000003F92049204920972091212122412001200000FFE0208020802080FFE +AEF3:000000003F920492049209720912121224120012000001F000000FFE040403F8 +AEF4:0000000000043F840484048404BC04840484093C090412042404000400040004 +AEF5:000000003F84048404BC09040904123C2404000400001FFC0004000400040004 +AEF6:000000003F84048404BC09040904123C2404000400001F7C0104010401040104 +AEF7:000000003F84048404BC09040904123C2404000400001F1001100110012801C6 +AEF8:000000003F84048404BC09040904123C24040004000410041000100010000FFC +AEF9:000000003F84048404BC09040904123C240400040000107C1010101010280FC6 +AEFA:000000003F84048404BC09040904123C2404000400001038100010FE10440F38 +AEFB:000000003F84048404BC09040904123C2404000400001FFC1000100010000FFC +AEFC:000000003F84048404BC09040904123C2404000400001FFC00041FF810000FFC +AEFD:000000003F84048404BC09040904123C2404000400001F7C01041E0410040F04 +AEFE:000000003F84048404BC09040904123C2404000400001F7C01441E4410440F3C +AEFF:000000003F84048404BC09040904123C2404000400001F4401441E7C10440F3C +AF00:000000003F84048404BC09040904123C2404000400001F1001101E1010280FC6 +AF01:000000003F84048404BC09040904123C2404000400001F7C01401E7C10400F3C +AF02:000000003F84048404BC09040904123C2404000400001F7E01241E2410240F7E +AF03:000000003F84048404BC09040904123C2404000400001F3801001EFE10440F38 +AF04:000000003F84048404BC09040904123C2404000400001FFC1004100410040FFC +AF05:000000003F84048404BC09040904123C240400040000100410041FFC10040FFC +AF06:000000003F84048404BC09040904123C240400040000111011101F1011280FC6 +AF07:000000003F84048404BC09040904123C2404000400000080008001400630180C +AF08:000000003F84048404BC09040904123C2404000400000410041004100A2831C6 +AF09:000000003F84048404BC09040904123C2404000400000FF81004100410040FF8 +AF0A:000000003F84048404BC09040904123C2404000400001FFC008001400630180C +AF0B:000000003F84048404BC09040904123C24040004000003E000001FFC02201C1C +AF0C:000000003F84048404BC09040904123C2404000400001FFC00041FFC00040004 +AF0D:000000003F84048404BC09040904123C2404000400001FFC10001FF810000FFC +AF0E:000000003F84048404BC09040904123C2404000400001FFC0410041004101FFC +AF0F:000000003F84048404BC09040904123C24040004000003E000001FFC080807F0 +AF10:0000000000123F920492049204F2049204920972091212122412001200120012 +AF11:000000003F92049204F20912091212722412001200000FFE0002000200020002 +AF12:000000003F92049204F20912091212722412001200000FBE0082008200820082 +AF13:000000003F92049204F20912091212722412001200000F8800880088009400E3 +AF14:000000003F92049204F2091209121272241200120012081208000800080007FE +AF15:000000003F92049204F2091209121272241200120000083E08080808081407E3 +AF16:000000003F92049204F2091209121272241200120000081C0800087F0822079C +AF17:000000003F92049204F20912091212722412001200000FFE08000800080007FE +AF18:000000003F92049204F20912091212722412001200000FFE00020FFC080007FE +AF19:000000003F92049204F20912091212722412001200000FBE00820F0208020782 +AF1A:000000003F92049204F20912091212722412001200000FBE00A20F220822079E +AF1B:000000003F92049204F20912091212722412001200000FA200A20F3E0822079E +AF1C:000000003F92049204F20912091212722412001200000F8800880F08081407E3 +AF1D:000000003F92049204F20912091212722412001200000FBE00A00F3E0820079E +AF1E:000000003F92049204F20912091212722412001200000FBF00920F12081207BF +AF1F:000000003F92049204F20912091212722412001200000F9C00800F7F0822079C +AF20:000000003F92049204F20912091212722412001200000FFE08020802080207FE +AF21:000000003F92049204F2091209121272241200120000080208020FFE080207FE +AF22:000000003F92049204F2091209121272241200120000088808880F88089407E3 +AF23:000000003F92049204F20912091212722412001200000040004000A003180C06 +AF24:000000003F92049204F2091209121272241200120000020802080208051418E3 +AF25:000000003F92049204F209120912127224120012000007FC08020802080207FC +AF26:000000003F92049204F20912091212722412001200000FFE004000A003180C06 +AF27:000000003F92049204F209120912127224120012000001F000000FFE01100E0E +AF28:000000003F92049204F20912091212722412001200000FFE00020FFE00020002 +AF29:000000003F92049204F20912091212722412001200000FFE08000FFC080007FE +AF2A:000000003F92049204F20912091212722412001200000FFE0208020802080FFE +AF2B:000000003F92049204F209120912127224120012000001F000000FFE040403F8 +AF2C:0000000000001F7C0104010401040104020404040888008000807FFF00000000 +AF2D:000000001F7C0104010402040408008000807FFF00001FFC0004000400040004 +AF2E:000000001F7C0104010402040408008000807FFF00001F7C0104010401040104 +AF2F:000000001F7C0104010402040408008000807FFF00001F1001100110012801C6 +AF30:000000001F7C0104010402040408008000807FFF000010001000100010000FFC +AF31:000000001F7C0104010402040408008000807FFF0000107C1010101010280FC6 +AF32:000000001F7C0104010402040408008000807FFF00001038100010FE10440F38 +AF33:000000001F7C0104010402040408008000807FFF00001FFC1000100010000FFC +AF34:000000001F7C0104010402040408008000807FFF00001FFC00041FF810000FFC +AF35:000000001F7C0104010402040408008000807FFF00001F7C01041E0410040F04 +AF36:000000001F7C0104010402040408008000807FFF00001F7C01441E4410440F3C +AF37:000000001F7C0104010402040408008000807FFF00001F4401441E7C10440F3C +AF38:000000001F7C0104010402040408008000807FFF00001F1001101E1010280FC6 +AF39:000000001F7C0104010402040408008000807FFF00001F7C01401E7C10400F3C +AF3A:000000001F7C0104010402040408008000807FFF00001F7E01241E2410240F7E +AF3B:000000001F7C0104010402040408008000807FFF00001F3801001EFE10440F38 +AF3C:000000001F7C0104010402040408008000807FFF00001FFC1004100410040FFC +AF3D:000000001F7C0104010402040408008000807FFF0000100410041FFC10040FFC +AF3E:000000001F7C0104010402040408008000807FFF0000111011101F1011280FC6 +AF3F:000000001F7C0104010402040408008000807FFF00000080008001400630180C +AF40:000000001F7C0104010402040408008000807FFF00000410041004100A2831C6 +AF41:000000001F7C0104010402040408008000807FFF00000FF81004100410040FF8 +AF42:000000001F7C0104010402040408008000807FFF00001FFC008001400630180C +AF43:000000001F7C0104010402040408008000807FFF000003E000001FFC02201C1C +AF44:000000001F7C0104010402040408008000807FFF00001FFC00041FFC00040004 +AF45:000000001F7C0104010402040408008000807FFF00001FFC10001FF810000FFC +AF46:000000001F7C0104010402040408008000807FFF00001FFC0410041004101FFC +AF47:000000001F7C0104010402040408008000807FFF000003E000001FFC080807F0 +AF48:0000000000047FC40444044404440847088410842504040404047FF400040004 +AF49:000000007F840884088408871104040404047FF400001FFC0004000400040004 +AF4A:000000007F840884088408871104040404047FF400001F7C0104010401040104 +AF4B:000000007F840884088408871104040404047FF400001F1001100110012801C6 +AF4C:000000007F840884088408871104040404047FF4000410041000100010000FFC +AF4D:000000007F840884088408871104040404047FF40000107C1010101010280FC6 +AF4E:000000007F840884088408871104040404047FF400001038100010FE10440F38 +AF4F:000000007F840884088408871104040404047FF400001FFC1000100010000FFC +AF50:000000007F840884088408871104040404047FF400001FFC00041FF810000FFC +AF51:000000007F840884088408871104040404047FF400001F7C01041E0410040F04 +AF52:000000007F840884088408871104040404047FF400001F7C01441E4410440F3C +AF53:000000007F840884088408871104040404047FF400001F4401441E7C10440F3C +AF54:000000007F840884088408871104040404047FF400001F1001101E1010280FC6 +AF55:000000007F840884088408871104040404047FF400001F7C01401E7C10400F3C +AF56:000000007F840884088408871104040404047FF400001F7E01241E2410240F7E +AF57:000000007F840884088408871104040404047FF400001F3801001EFE10440F38 +AF58:000000007F840884088408871104040404047FF400001FFC1004100410040FFC +AF59:000000007F840884088408871104040404047FF40000100410041FFC10040FFC +AF5A:000000007F840884088408871104040404047FF40000111011101F1011280FC6 +AF5B:000000007F840884088408871104040404047FF400000080008001400630180C +AF5C:000000007F840884088408871104040404047FF400000410041004100A2831C6 +AF5D:000000007F840884088408871104040404047FF400000FF81004100410040FF8 +AF5E:000000007F840884088408871104040404047FF400001FFC008001400630180C +AF5F:000000007F840884088408871104040404047FF4000003E000001FFC02201C1C +AF60:000000007F840884088408871104040404047FF400001FFC00041FFC00040004 +AF61:000000007F840884088408871104040404047FF400001FFC10001FF810000FFC +AF62:000000007F840884088408871104040404047FF400001FFC0410041004101FFC +AF63:000000007F840884088408871104040404047FF4000003E000001FFC080807F0 +AF64:0000000000127FD2045204520452085E089210922512041204127FD200120012 +AF65:000000007F9208920892089E1112041204127FD200000FFE0002000200020002 +AF66:000000007F9208920892089E1112041204127FD200000FBE0082008200820082 +AF67:000000007F9208920892089E1112041204127FD200000F8800880088009400E3 +AF68:000000007F9208920892089E1112041204127FD20012081208000800080007FE +AF69:000000007F9208920892089E1112041204127FD20000083E08080808081407E3 +AF6A:000000007F9208920892089E1112041204127FD20000081C0800087F0822079C +AF6B:000000007F9208920892089E1112041204127FD200000FFE08000800080007FE +AF6C:000000007F9208920892089E1112041204127FD200000FFE00020FFC080007FE +AF6D:000000007F9208920892089E1112041204127FD200000FBE00820F0208020782 +AF6E:000000007F9208920892089E1112041204127FD200000FBE00A20F220822079E +AF6F:000000007F9208920892089E1112041204127FD200000FA200A20F3E0822079E +AF70:000000007F9208920892089E1112041204127FD200000F8800880F08081407E3 +AF71:000000007F9208920892089E1112041204127FD200000FBE00A00F3E0820079E +AF72:000000007F9208920892089E1112041204127FD200000FBF00920F12081207BF +AF73:000000007F9208920892089E1112041204127FD200000F9C00800F7F0822079C +AF74:000000007F9208920892089E1112041204127FD200000FFE08020802080207FE +AF75:000000007F9208920892089E1112041204127FD20000080208020FFE080207FE +AF76:000000007F9208920892089E1112041204127FD20000088808880F88089407E3 +AF77:000000007F9208920892089E1112041204127FD200000040004000A003180C06 +AF78:000000007F9208920892089E1112041204127FD20000020802080208051418E3 +AF79:000000007F9208920892089E1112041204127FD2000007FC08020802080207FC +AF7A:000000007F9208920892089E1112041204127FD200000FFE004000A003180C06 +AF7B:000000007F9208920892089E1112041204127FD2000001F000000FFE01100E0E +AF7C:000000007F9208920892089E1112041204127FD200000FFE00020FFE00020002 +AF7D:000000007F9208920892089E1112041204127FD200000FFE08000FFC080007FE +AF7E:000000007F9208920892089E1112041204127FD200000FFE0208020802080FFE +AF7F:000000007F9208920892089E1112041204127FD2000001F000000FFE040403F8 +AF80:0000000000047FC40444044404440844088410842504040404047FF400040004 +AF81:000000007F840884088408841104040404047FF400001FFC0004000400040004 +AF82:000000007F840884088408841104040404047FF400001F7C0104010401040104 +AF83:000000007F840884088408841104040404047FF400001F1001100110012801C6 +AF84:000000007F840884088408841104040404047FF4000410041000100010000FFC +AF85:000000007F840884088408841104040404047FF40000107C1010101010280FC6 +AF86:000000007F840884088408841104040404047FF400001038100010FE10440F38 +AF87:000000007F840884088408841104040404047FF400001FFC1000100010000FFC +AF88:000000007F840884088408841104040404047FF400001FFC00041FF810000FFC +AF89:000000007F840884088408841104040404047FF400001F7C01041E0410040F04 +AF8A:000000007F840884088408841104040404047FF400001F7C01441E4410440F3C +AF8B:000000007F840884088408841104040404047FF400001F4401441E7C10440F3C +AF8C:000000007F840884088408841104040404047FF400001F1001101E1010280FC6 +AF8D:000000007F840884088408841104040404047FF400001F7C01401E7C10400F3C +AF8E:000000007F840884088408841104040404047FF400001F7E01241E2410240F7E +AF8F:000000007F840884088408841104040404047FF400001F3801001EFE10440F38 +AF90:000000007F840884088408841104040404047FF400001FFC1004100410040FFC +AF91:000000007F840884088408841104040404047FF40000100410041FFC10040FFC +AF92:000000007F840884088408841104040404047FF40000111011101F1011280FC6 +AF93:000000007F840884088408841104040404047FF400000080008001400630180C +AF94:000000007F840884088408841104040404047FF400000410041004100A2831C6 +AF95:000000007F840884088408841104040404047FF400000FF81004100410040FF8 +AF96:000000007F840884088408841104040404047FF400001FFC008001400630180C +AF97:000000007F840884088408841104040404047FF4000003E000001FFC02201C1C +AF98:000000007F840884088408841104040404047FF400001FFC00041FFC00040004 +AF99:000000007F840884088408841104040404047FF400001FFC10001FF810000FFC +AF9A:000000007F840884088408841104040404047FF400001FFC0410041004101FFC +AF9B:000000007F840884088408841104040404047FF4000003E000001FFC080807F0 +AF9C:0000000000001F7C0104010401040104020404040A28022002207FFF00000000 +AF9D:000000001F7C0104010402040408022002207FFF00001FFC0004000400040004 +AF9E:000000001F7C0104010402040408022002207FFF00001F7C0104010401040104 +AF9F:000000001F7C0104010402040408022002207FFF00001F1001100110012801C6 +AFA0:000000001F7C0104010402040408022002207FFF000010001000100010000FFC +AFA1:000000001F7C0104010402040408022002207FFF0000107C1010101010280FC6 +AFA2:000000001F7C0104010402040408022002207FFF00001038100010FE10440F38 +AFA3:000000001F7C0104010402040408022002207FFF00001FFC1000100010000FFC +AFA4:000000001F7C0104010402040408022002207FFF00001FFC00041FF810000FFC +AFA5:000000001F7C0104010402040408022002207FFF00001F7C01041E0410040F04 +AFA6:000000001F7C0104010402040408022002207FFF00001F7C01441E4410440F3C +AFA7:000000001F7C0104010402040408022002207FFF00001F4401441E7C10440F3C +AFA8:000000001F7C0104010402040408022002207FFF00001F1001101E1010280FC6 +AFA9:000000001F7C0104010402040408022002207FFF00001F7C01401E7C10400F3C +AFAA:000000001F7C0104010402040408022002207FFF00001F7E01241E2410240F7E +AFAB:000000001F7C0104010402040408022002207FFF00001F3801001EFE10440F38 +AFAC:000000001F7C0104010402040408022002207FFF00001FFC1004100410040FFC +AFAD:000000001F7C0104010402040408022002207FFF0000100410041FFC10040FFC +AFAE:000000001F7C0104010402040408022002207FFF0000111011101F1011280FC6 +AFAF:000000001F7C0104010402040408022002207FFF00000080008001400630180C +AFB0:000000001F7C0104010402040408022002207FFF00000410041004100A2831C6 +AFB1:000000001F7C0104010402040408022002207FFF00000FF81004100410040FF8 +AFB2:000000001F7C0104010402040408022002207FFF00001FFC008001400630180C +AFB3:000000001F7C0104010402040408022002207FFF000003E000001FFC02201C1C +AFB4:000000001F7C0104010402040408022002207FFF00001FFC00041FFC00040004 +AFB5:000000001F7C0104010402040408022002207FFF00001FFC10001FF810000FFC +AFB6:000000001F7C0104010402040408022002207FFF00001FFC0410041004101FFC +AFB7:000000001F7C0104010402040408022002207FFF000003E000001FFC080807F0 +AFB8:000000001F7C0104010402040408000000007FFF008000800080008000800080 +AFB9:000000001F7C010401040204040800007FFF008000801FFC0004000400040004 +AFBA:000000001F7C010401040204040800007FFF008000801F7C0104010401040104 +AFBB:000000001F7C010401040204040800007FFF008000801F1001100110012801C6 +AFBC:000000001F7C0104010402040408000000007FFF008010801080100010000FFC +AFBD:000000001F7C010401040204040800007FFF00800080107C1010101010280FC6 +AFBE:000000001F7C010401040204040800007FFF008000801038100010FE10440F38 +AFBF:000000001F7C010401040204040800007FFF008000801FFC1000100010000FFC +AFC0:000000001F7C010401040204040800007FFF008000801FFC00041FF810000FFC +AFC1:000000001F7C010401040204040800007FFF008000801F7C01041E0410040F04 +AFC2:000000001F7C010401040204040800007FFF008000801F7C01441E4410440F3C +AFC3:000000001F7C010401040204040800007FFF008000801F4401441E7C10440F3C +AFC4:000000001F7C010401040204040800007FFF008000801F1001101E1010280FC6 +AFC5:000000001F7C010401040204040800007FFF008000801F7C01401E7C10400F3C +AFC6:000000001F7C010401040204040800007FFF008000801F7E01241E2410240F7E +AFC7:000000001F7C010401040204040800007FFF008000801F3801001EFE10440F38 +AFC8:000000001F7C010401040204040800007FFF008000801FFC1004100410040FFC +AFC9:000000001F7C010401040204040800007FFF00800080100410041FFC10040FFC +AFCA:000000001F7C010401040204040800007FFF00800080111011101F1011280FC6 +AFCB:000000001F7C010401040204040800007FFF008000800080008001400630180C +AFCC:000000001F7C010401040204040800007FFF008000800410041004100A2831C6 +AFCD:000000001F7C010401040204040800007FFF008000800FF81004100410040FF8 +AFCE:000000001F7C010401040204040800007FFF008000801FFC008001400630180C +AFCF:000000001F7C010401040204040800007FFF0080008003E000001FFC02201C1C +AFD0:000000001F7C010401040204040800007FFF008000801FFC00041FFC00040004 +AFD1:000000001F7C010401040204040800007FFF008000801FFC10001FF810000FFC +AFD2:000000001F7C010401040204040800007FFF008000801FFC0410041004101FFC +AFD3:000000001F7C010401040204040800007FFF0080008003E000001FFC080807F0 +AFD4:000000007F840884088408841104000400047FF404040404043C040404040404 +AFD5:000000007F8408840884089C110400047FF4040404001FFC0004000400040004 +AFD6:000000007F8408840884089C110400047FF4040404001F7C0104010401040104 +AFD7:000000007F8408840884089C110400047FF4040404001F1001100110012801C6 +AFD8:000000007F84088408840884110400047FF40404043C14041000100010000FFC +AFD9:000000007F8408840884089C110400047FF404040400107C1010101010280FC6 +AFDA:000000007F8408840884089C110400047FF4040404001038100010FE10440F38 +AFDB:000000007F8408840884089C110400047FF4040404001FFC1000100010000FFC +AFDC:000000007F8408840884089C110400047FF4040404001FFC00041FF810000FFC +AFDD:000000007F8408840884089C110400047FF4040404001F7C01041E0410040F04 +AFDE:000000007F8408840884089C110400047FF4040404001F7C01441E4410440F3C +AFDF:000000007F8408840884089C110400047FF4040404001F4401441E7C10440F3C +AFE0:000000007F8408840884089C110400047FF4040404001F1001101E1010280FC6 +AFE1:000000007F8408840884089C110400047FF4040404001F7C01401E7C10400F3C +AFE2:000000007F8408840884089C110400047FF4040404001F7E01241E2410240F7E +AFE3:000000007F8408840884089C110400047FF4040404001F3801001EFE10440F38 +AFE4:000000007F8408840884089C110400047FF4040404001FFC1004100410040FFC +AFE5:000000007F8408840884089C110400047FF404040400100410041FFC10040FFC +AFE6:000000007F8408840884089C110400047FF404040400111011101F1011280FC6 +AFE7:000000007F8408840884089C110400047FF4040404000080008001400630180C +AFE8:000000007F8408840884089C110400047FF4040404000410041004100A2831C6 +AFE9:000000007F8408840884089C110400047FF4040404000FF81004100410040FF8 +AFEA:000000007F8408840884089C110400047FF4040404001FFC008001400630180C +AFEB:000000007F8408840884089C110400047FF40404040003E000001FFC02201C1C +AFEC:000000007F8408840884089C110400047FF4040404001FFC00041FFC00040004 +AFED:000000007F8408840884089C110400047FF4040404001FFC10001FF810000FFC +AFEE:000000007F8408840884089C110400047FF4040404001FFC0410041004101FFC +AFEF:000000007F8408840884089C110400047FF40404040003E000001FFC080807F0 +AFF0:000000007F920892089208921112001200127FD20412041204F2041204120412 +AFF1:000000007F920892089208F2111200127FD2041204000FFE0002000200020002 +AFF2:000000007F920892089208F2111200127FD2041204000FBE0082008200820082 +AFF3:000000007F920892089208F2111200127FD2041204000F8800880088009400E3 +AFF4:000000007F92089208920892111200127FD2021202F20A1208000800080007FE +AFF5:000000007F920892089208F2111200127FD204120400083E08080808081407E3 +AFF6:000000007F920892089208F2111200127FD204120400081C0800087F0822079C +AFF7:000000007F920892089208F2111200127FD2041204000FFE08000800080007FE +AFF8:000000007F920892089208F2111200127FD2041204000FFE00020FFC080007FE +AFF9:000000007F920892089208F2111200127FD2041204000FBE00820F0208020782 +AFFA:000000007F920892089208F2111200127FD2041204000FBE00A20F220822079E +AFFB:000000007F920892089208F2111200127FD2041204000FA200A20F3E0822079E +AFFC:000000007F920892089208F2111200127FD2041204000F8800880F08081407E3 +AFFD:000000007F920892089208F2111200127FD2041204000FBE00A00F3E0820079E +AFFE:000000007F920892089208F2111200127FD2041204000FBF00920F12081207BF +AFFF:000000007F920892089208F2111200127FD2041204000F9C00800F7F0822079C +B000:000000007F920892089208F2111200127FD2041204000FFE08020802080207FE +B001:000000007F920892089208F2111200127FD204120400080208020FFE080207FE +B002:000000007F920892089208F2111200127FD204120400088808880F88089407E3 +B003:000000007F920892089208F2111200127FD2041204000040004000A003180C06 +B004:000000007F920892089208F2111200127FD204120400020802080208051418E3 +B005:000000007F920892089208F2111200127FD20412040007FC08020802080207FC +B006:000000007F920892089208F2111200127FD2041204000FFE004000A003180C06 +B007:000000007F920892089208F2111200127FD20412040001F000000FFE01100E0E +B008:000000007F920892089208F2111200127FD2041204000FFE00020FFE00020002 +B009:000000007F920892089208F2111200127FD2041204000FFE08000FFC080007FE +B00A:000000007F920892089208F2111200127FD2041204000FFE0208020802080FFE +B00B:000000007F920892089208F2111200127FD20412040001F000000FFE040403F8 +B00C:000000007F840884088408841104000400047FF4040404040404040404040404 +B00D:000000007F84088408840884110400047FF4040404001FFC0004000400040004 +B00E:000000007F84088408840884110400047FF4040404001F7C0104010401040104 +B00F:000000007F84088408840884110400047FF4040404001F1001100110012801C6 +B010:000000007F84088408840884110400047FF40404040414041000100010000FFC +B011:000000007F84088408840884110400047FF404040400107C1010101010280FC6 +B012:000000007F84088408840884110400047FF4040404001038100010FE10440F38 +B013:000000007F84088408840884110400047FF4040404001FFC1000100010000FFC +B014:000000007F84088408840884110400047FF4040404001FFC00041FF810000FFC +B015:000000007F84088408840884110400047FF4040404001F7C01041E0410040F04 +B016:000000007F84088408840884110400047FF4040404001F7C01441E4410440F3C +B017:000000007F84088408840884110400047FF4040404001F4401441E7C10440F3C +B018:000000007F84088408840884110400047FF4040404001F1001101E1010280FC6 +B019:000000007F84088408840884110400047FF4040404001F7C01401E7C10400F3C +B01A:000000007F84088408840884110400047FF4040404001F7E01241E2410240F7E +B01B:000000007F84088408840884110400047FF4040404001F3801001EFE10440F38 +B01C:000000007F84088408840884110400047FF4040404001FFC1004100410040FFC +B01D:000000007F84088408840884110400047FF404040400100410041FFC10040FFC +B01E:000000007F84088408840884110400047FF404040400111011101F1011280FC6 +B01F:000000007F84088408840884110400047FF4040404000080008001400630180C +B020:000000007F84088408840884110400047FF4040404000410041004100A2831C6 +B021:000000007F84088408840884110400047FF4040404000FF81004100410040FF8 +B022:000000007F84088408840884110400047FF4040404001FFC008001400630180C +B023:000000007F84088408840884110400047FF40404040003E000001FFC02201C1C +B024:000000007F84088408840884110400047FF4040404001FFC00041FFC00040004 +B025:000000007F84088408840884110400047FF4040404001FFC10001FF810000FFC +B026:000000007F84088408840884110400047FF4040404001FFC0410041004101FFC +B027:000000007F84088408840884110400047FF40404040003E000001FFC080807F0 +B028:000000001F7C0104010402040408000000007FFF041004100410041004100410 +B029:000000001F7C010401040204040800007FFF022002201FFC0004000400040004 +B02A:000000001F7C010401040204040800007FFF022002201F7C0104010401040104 +B02B:000000001F7C010401040204040800007FFF022002201F1001100110012801C6 +B02C:000000001F7C0104010402040408000000007FFF022012201220100010000FFC +B02D:000000001F7C010401040204040800007FFF02200220107C1010101010280FC6 +B02E:000000001F7C010401040204040800007FFF022002201038100010FE10440F38 +B02F:000000001F7C010401040204040800007FFF022002201FFC1000100010000FFC +B030:000000001F7C010401040204040800007FFF022002201FFC00041FF810000FFC +B031:000000001F7C010401040204040800007FFF022002201F7C01041E0410040F04 +B032:000000001F7C010401040204040800007FFF022002201F7C01441E4410440F3C +B033:000000001F7C010401040204040800007FFF022002201F4401441E7C10440F3C +B034:000000001F7C010401040204040800007FFF022002201F1001101E1010280FC6 +B035:000000001F7C010401040204040800007FFF022002201F7C01401E7C10400F3C +B036:000000001F7C010401040204040800007FFF022002201F7E01241E2410240F7E +B037:000000001F7C010401040204040800007FFF022002201F3801001EFE10440F38 +B038:000000001F7C010401040204040800007FFF022002201FFC1004100410040FFC +B039:000000001F7C010401040204040800007FFF02200220100410041FFC10040FFC +B03A:000000001F7C010401040204040800007FFF02200220111011101F1011280FC6 +B03B:000000001F7C010401040204040800007FFF022002200080008001400630180C +B03C:000000001F7C010401040204040800007FFF022002200410041004100A2831C6 +B03D:000000001F7C010401040204040800007FFF022002200FF81004100410040FF8 +B03E:000000001F7C010401040204040800007FFF022002201FFC008001400630180C +B03F:000000001F7C010401040204040800007FFF0220022003E000001FFC02201C1C +B040:000000001F7C010401040204040800007FFF022002201FFC00041FFC00040004 +B041:000000001F7C010401040204040800007FFF022002201FFC10001FF810000FFC +B042:000000001F7C010401040204040800007FFF022002201FFC0410041004101FFC +B043:000000001F7C010401040204040800007FFF0220022003E000001FFC080807F0 +B044:0000000000001F7C0104010401040104020404040808000000007FFF00000000 +B045:000000001F7C010401040204040800007FFF000000001FFC0004000400040004 +B046:000000001F7C010401040204040800007FFF000000001F7C0104010401040104 +B047:000000001F7C010401040204040800007FFF000000001F1001100110012801C6 +B048:000000001F7C0104010402040408000000007FFF000010001000100010000FFC +B049:000000001F7C010401040204040800007FFF00000000107C1010101010280FC6 +B04A:000000001F7C010401040204040800007FFF000000001038100010FE10440F38 +B04B:000000001F7C010401040204040800007FFF000000001FFC1000100010000FFC +B04C:000000001F7C010401040204040800007FFF000000001FFC00041FF810000FFC +B04D:000000001F7C010401040204040800007FFF000000001F7C01041E0410040F04 +B04E:000000001F7C010401040204040800007FFF000000001F7C01441E4410440F3C +B04F:000000001F7C010401040204040800007FFF000000001F4401441E7C10440F3C +B050:000000001F7C010401040204040800007FFF000000001F1001101E1010280FC6 +B051:000000001F7C010401040204040800007FFF000000001F7C01401E7C10400F3C +B052:000000001F7C010401040204040800007FFF000000001F7E01241E2410240F7E +B053:000000001F7C010401040204040800007FFF000000001F3801001EFE10440F38 +B054:000000001F7C010401040204040800007FFF000000001FFC1004100410040FFC +B055:000000001F7C010401040204040800007FFF00000000100410041FFC10040FFC +B056:000000001F7C010401040204040800007FFF00000000111011101F1011280FC6 +B057:000000001F7C010401040204040800007FFF000000000080008001400630180C +B058:000000001F7C010401040204040800007FFF000000000410041004100A2831C6 +B059:000000001F7C010401040204040800007FFF000000000FF81004100410040FF8 +B05A:000000001F7C010401040204040800007FFF000000001FFC008001400630180C +B05B:000000001F7C010401040204040800007FFF0000000003E000001FFC02201C1C +B05C:000000001F7C010401040204040800007FFF000000001FFC00041FFC00040004 +B05D:000000001F7C010401040204040800007FFF000000001FFC10001FF810000FFC +B05E:000000001F7C010401040204040800007FFF000000001FFC0410041004101FFC +B05F:000000001F7C010401040204040800007FFF0000000003E000001FFC080807F0 +B060:0000000000047FC40444044404440844088410842104000400047FF400040004 +B061:000000007F84088408840884110400047FF4000400001FFC0004000400040004 +B062:000000007F84088408840884110400047FF4000400001F7C0104010401040104 +B063:000000007F84088408840884110400047FF4000400001F1001100110012801C6 +B064:000000007F840884088408841104000400047FF4000410041000100010000FFC +B065:000000007F84088408840884110400047FF400040000107C1010101010280FC6 +B066:000000007F84088408840884110400047FF4000400001038100010FE10440F38 +B067:000000007F84088408840884110400047FF4000400001FFC1000100010000FFC +B068:000000007F84088408840884110400047FF4000400001FFC00041FF810000FFC +B069:000000007F84088408840884110400047FF4000400001F7C01041E0410040F04 +B06A:000000007F84088408840884110400047FF4000400001F7C01441E4410440F3C +B06B:000000007F84088408840884110400047FF4000400001F4401441E7C10440F3C +B06C:000000007F84088408840884110400047FF4000400001F1001101E1010280FC6 +B06D:000000007F84088408840884110400047FF4000400001F7C01401E7C10400F3C +B06E:000000007F84088408840884110400047FF4000400001F7E01241E2410240F7E +B06F:000000007F84088408840884110400047FF4000400001F3801001EFE10440F38 +B070:000000007F84088408840884110400047FF4000400001FFC1004100410040FFC +B071:000000007F84088408840884110400047FF400040000100410041FFC10040FFC +B072:000000007F84088408840884110400047FF400040000111011101F1011280FC6 +B073:000000007F84088408840884110400047FF4000400000080008001400630180C +B074:000000007F84088408840884110400047FF4000400000410041004100A2831C6 +B075:000000007F84088408840884110400047FF4000400000FF81004100410040FF8 +B076:000000007F84088408840884110400047FF4000400001FFC008001400630180C +B077:000000007F84088408840884110400047FF40004000003E000001FFC02201C1C +B078:000000007F84088408840884110400047FF4000400001FFC00041FFC00040004 +B079:000000007F84088408840884110400047FF4000400001FFC10001FF810000FFC +B07A:000000007F84088408840884110400047FF4000400001FFC0410041004101FFC +B07B:000000007F84088408840884110400047FF40004000003E000001FFC080807F0 +B07C:0000000000043F84048404840484048404840904090412042404000400040004 +B07D:000000003F84048404840904090412042404000400001FFC0004000400040004 +B07E:000000003F84048404840904090412042404000400001F7C0104010401040104 +B07F:000000003F84048404840904090412042404000400001F1001100110012801C6 +B080:000000003F840484048409040904120424040004000410041000100010000FFC +B081:000000003F8404840484090409041204240400040000107C1010101010280FC6 +B082:000000003F84048404840904090412042404000400001038100010FE10440F38 +B083:000000003F84048404840904090412042404000400001FFC1000100010000FFC +B084:000000003F84048404840904090412042404000400001FFC00041FF810000FFC +B085:000000003F84048404840904090412042404000400001F7C01041E0410040F04 +B086:000000003F84048404840904090412042404000400001F7C01441E4410440F3C +B087:000000003F84048404840904090412042404000400001F4401441E7C10440F3C +B088:000000003F84048404840904090412042404000400001F1001101E1010280FC6 +B089:000000003F84048404840904090412042404000400001F7C01401E7C10400F3C +B08A:000000003F84048404840904090412042404000400001F7E01241E2410240F7E +B08B:000000003F84048404840904090412042404000400001F3801001EFE10440F38 +B08C:000000003F84048404840904090412042404000400001FFC1004100410040FFC +B08D:000000003F8404840484090409041204240400040000100410041FFC10040FFC +B08E:000000003F8404840484090409041204240400040000111011101F1011280FC6 +B08F:000000003F84048404840904090412042404000400000080008001400630180C +B090:000000003F84048404840904090412042404000400000410041004100A2831C6 +B091:000000003F84048404840904090412042404000400000FF81004100410040FF8 +B092:000000003F84048404840904090412042404000400001FFC008001400630180C +B093:000000003F840484048409040904120424040004000003E000001FFC02201C1C +B094:000000003F84048404840904090412042404000400001FFC00041FFC00040004 +B095:000000003F84048404840904090412042404000400001FFC10001FF810000FFC +B096:000000003F84048404840904090412042404000400001FFC0410041004101FFC +B097:000000003F840484048409040904120424040004000003E000001FFC080807F0 +B098:0000000000042004200420042004200720042004200420041F84000400040004 +B099:000000002004200420042007200420041F84000400001FFC0004000400040004 +B09A:000000002004200420042007200420041F84000400001F7C0104010401040104 +B09B:000000002004200420042007200420041F84000400001F1001100110012801C6 +B09C:000000002004200420042007200420041F840004000410041000100010000FFC +B09D:000000002004200420042007200420041F8400040000107C1010101010280FC6 +B09E:000000002004200420042007200420041F84000400001038100010FE10440F38 +B09F:000000002004200420042007200420041F84000400001FFC1000100010000FFC +B0A0:000000002004200420042007200420041F84000400001FFC00041FF810000FFC +B0A1:000000002004200420042007200420041F84000400001F7C01041E0410040F04 +B0A2:000000002004200420042007200420041F84000400001F7C01441E4410440F3C +B0A3:000000002004200420042007200420041F84000400001F4401441E7C10440F3C +B0A4:000000002004200420042007200420041F84000400001F1001101E1010280FC6 +B0A5:000000002004200420042007200420041F84000400001F7C01401E7C10400F3C +B0A6:000000002004200420042007200420041F84000400001F7E01241E2410240F7E +B0A7:000000002004200420042007200420041F84000400001F3801001EFE10440F38 +B0A8:000000002004200420042007200420041F84000400001FFC1004100410040FFC +B0A9:000000002004200420042007200420041F8400040000100410041FFC10040FFC +B0AA:000000002004200420042007200420041F8400040000111011101F1011280FC6 +B0AB:000000002004200420042007200420041F84000400000080008001400630180C +B0AC:000000002004200420042007200420041F84000400000410041004100A2831C6 +B0AD:000000002004200420042007200420041F84000400000FF81004100410040FF8 +B0AE:000000002004200420042007200420041F84000400001FFC008001400630180C +B0AF:000000002004200420042007200420041F840004000003E000001FFC02201C1C +B0B0:000000002004200420042007200420041F84000400001FFC00041FFC00040004 +B0B1:000000002004200420042007200420041F84000400001FFC10001FF810000FFC +B0B2:000000002004200420042007200420041F84000400001FFC0410041004101FFC +B0B3:000000002004200420042007200420041F840004000003E000001FFC080807F0 +B0B4:0000000000122012201220122012201E20122012201220121F92001200120012 +B0B5:00000000201220122012201E201220121F92001200000FFE0002000200020002 +B0B6:00000000201220122012201E201220121F92001200000FBE0082008200820082 +B0B7:00000000201220122012201E201220121F92001200000F8800880088009400E3 +B0B8:00000000201220122012201E201220121F9200120012081208000800080007FE +B0B9:00000000201220122012201E201220121F9200120000083E08080808081407E3 +B0BA:00000000201220122012201E201220121F9200120000081C0800087F0822079C +B0BB:00000000201220122012201E201220121F92001200000FFE08000800080007FE +B0BC:00000000201220122012201E201220121F92001200000FFE00020FFC080007FE +B0BD:00000000201220122012201E201220121F92001200000FBE00820F0208020782 +B0BE:00000000201220122012201E201220121F92001200000FBE00A20F220822079E +B0BF:00000000201220122012201E201220121F92001200000FA200A20F3E0822079E +B0C0:00000000201220122012201E201220121F92001200000F8800880F08081407E3 +B0C1:00000000201220122012201E201220121F92001200000FBE00A00F3E0820079E +B0C2:00000000201220122012201E201220121F92001200000FBF00920F12081207BF +B0C3:00000000201220122012201E201220121F92001200000F9C00800F7F0822079C +B0C4:00000000201220122012201E201220121F92001200000FFE08020802080207FE +B0C5:00000000201220122012201E201220121F9200120000080208020FFE080207FE +B0C6:00000000201220122012201E201220121F9200120000088808880F88089407E3 +B0C7:00000000201220122012201E201220121F92001200000040004000A003180C06 +B0C8:00000000201220122012201E201220121F9200120000020802080208051418E3 +B0C9:00000000201220122012201E201220121F920012000007FC08020802080207FC +B0CA:00000000201220122012201E201220121F92001200000FFE004000A003180C06 +B0CB:00000000201220122012201E201220121F920012000001F000000FFE01100E0E +B0CC:00000000201220122012201E201220121F92001200000FFE00020FFE00020002 +B0CD:00000000201220122012201E201220121F92001200000FFE08000FFC080007FE +B0CE:00000000201220122012201E201220121F92001200000FFE0208020802080FFE +B0CF:00000000201220122012201E201220121F920012000001F000000FFE040403F8 +B0D0:0000000000042004200420042007200420042007200420041F84000400040004 +B0D1:000000002004200420072004200420071F84000400001FFC0004000400040004 +B0D2:000000002004200420072004200420071F84000400001F7C0104010401040104 +B0D3:000000002004200420072004200420071F84000400001F1001100110012801C6 +B0D4:000000002004200420072004200420071F840004000410041000100010000FFC +B0D5:000000002004200420072004200420071F8400040000107C1010101010280FC6 +B0D6:000000002004200420072004200420071F84000400001038100010FE10440F38 +B0D7:000000002004200420072004200420071F84000400001FFC1000100010000FFC +B0D8:000000002004200420072004200420071F84000400001FFC00041FF810000FFC +B0D9:000000002004200420072004200420071F84000400001F7C01041E0410040F04 +B0DA:000000002004200420072004200420071F84000400001F7C01441E4410440F3C +B0DB:000000002004200420072004200420071F84000400001F4401441E7C10440F3C +B0DC:000000002004200420072004200420071F84000400001F1001101E1010280FC6 +B0DD:000000002004200420072004200420071F84000400001F7C01401E7C10400F3C +B0DE:000000002004200420072004200420071F84000400001F7E01241E2410240F7E +B0DF:000000002004200420072004200420071F84000400001F3801001EFE10440F38 +B0E0:000000002004200420072004200420071F84000400001FFC1004100410040FFC +B0E1:000000002004200420072004200420071F8400040000100410041FFC10040FFC +B0E2:000000002004200420072004200420071F8400040000111011101F1011280FC6 +B0E3:000000002004200420072004200420071F84000400000080008001400630180C +B0E4:000000002004200420072004200420071F84000400000410041004100A2831C6 +B0E5:000000002004200420072004200420071F84000400000FF81004100410040FF8 +B0E6:000000002004200420072004200420071F84000400001FFC008001400630180C +B0E7:000000002004200420072004200420071F840004000003E000001FFC02201C1C +B0E8:000000002004200420072004200420071F84000400001FFC00041FFC00040004 +B0E9:000000002004200420072004200420071F84000400001FFC10001FF810000FFC +B0EA:000000002004200420072004200420071F84000400001FFC0410041004101FFC +B0EB:000000002004200420072004200420071F840004000003E000001FFC080807F0 +B0EC:000000000012201220122012201E20122012201E201220121F92001200120012 +B0ED:0000000020122012201E20122012201E1F92001200000FFE0002000200020002 +B0EE:0000000020122012201E20122012201E1F92001200000FBE0082008200820082 +B0EF:0000000020122012201E20122012201E1F92001200000F8800880088009400E3 +B0F0:0000000020122012201E20122012201E1F9200120012081208000800080007FE +B0F1:0000000020122012201E20122012201E1F9200120000083E08080808081407E3 +B0F2:0000000020122012201E20122012201E1F9200120000081C0800087F0822079C +B0F3:0000000020122012201E20122012201E1F92001200000FFE08000800080007FE +B0F4:0000000020122012201E20122012201E1F92001200000FFE00020FFC080007FE +B0F5:0000000020122012201E20122012201E1F92001200000FBE00820F0208020782 +B0F6:0000000020122012201E20122012201E1F92001200000FBE00A20F220822079E +B0F7:0000000020122012201E20122012201E1F92001200000FA200A20F3E0822079E +B0F8:0000000020122012201E20122012201E1F92001200000F8800880F08081407E3 +B0F9:0000000020122012201E20122012201E1F92001200000FBE00A00F3E0820079E +B0FA:0000000020122012201E20122012201E1F92001200000FBF00920F12081207BF +B0FB:0000000020122012201E20122012201E1F92001200000F9C00800F7F0822079C +B0FC:0000000020122012201E20122012201E1F92001200000FFE08020802080207FE +B0FD:0000000020122012201E20122012201E1F9200120000080208020FFE080207FE +B0FE:0000000020122012201E20122012201E1F9200120000088808880F88089407E3 +B0FF:0000000020122012201E20122012201E1F92001200000040004000A003180C06 +B100:0000000020122012201E20122012201E1F9200120000020802080208051418E3 +B101:0000000020122012201E20122012201E1F920012000007FC08020802080207FC +B102:0000000020122012201E20122012201E1F92001200000FFE004000A003180C06 +B103:0000000020122012201E20122012201E1F920012000001F000000FFE01100E0E +B104:0000000020122012201E20122012201E1F92001200000FFE00020FFE00020002 +B105:0000000020122012201E20122012201E1F92001200000FFE08000FFC080007FE +B106:0000000020122012201E20122012201E1F92001200000FFE0208020802080FFE +B107:0000000020122012201E20122012201E1F920012000001F000000FFE040403F8 +B108:0000000000042004200420042004203C20042004200420041F84000400040004 +B109:00000000200420042004203C200420041F84000400001FFC0004000400040004 +B10A:00000000200420042004203C200420041F84000400001F7C0104010401040104 +B10B:00000000200420042004203C200420041F84000400001F1001100110012801C6 +B10C:00000000200420042004203C200420041F840004000410041000100010000FFC +B10D:00000000200420042004203C200420041F8400040000107C1010101010280FC6 +B10E:00000000200420042004203C200420041F84000400001038100010FE10440F38 +B10F:00000000200420042004203C200420041F84000400001FFC1000100010000FFC +B110:00000000200420042004203C200420041F84000400001FFC00041FF810000FFC +B111:00000000200420042004203C200420041F84000400001F7C01041E0410040F04 +B112:00000000200420042004203C200420041F84000400001F7C01441E4410440F3C +B113:00000000200420042004203C200420041F84000400001F4401441E7C10440F3C +B114:00000000200420042004203C200420041F84000400001F1001101E1010280FC6 +B115:00000000200420042004203C200420041F84000400001F7C01401E7C10400F3C +B116:00000000200420042004203C200420041F84000400001F7E01241E2410240F7E +B117:00000000200420042004203C200420041F84000400001F3801001EFE10440F38 +B118:00000000200420042004203C200420041F84000400001FFC1004100410040FFC +B119:00000000200420042004203C200420041F8400040000100410041FFC10040FFC +B11A:00000000200420042004203C200420041F8400040000111011101F1011280FC6 +B11B:00000000200420042004203C200420041F84000400000080008001400630180C +B11C:00000000200420042004203C200420041F84000400000410041004100A2831C6 +B11D:00000000200420042004203C200420041F84000400000FF81004100410040FF8 +B11E:00000000200420042004203C200420041F84000400001FFC008001400630180C +B11F:00000000200420042004203C200420041F840004000003E000001FFC02201C1C +B120:00000000200420042004203C200420041F84000400001FFC00041FFC00040004 +B121:00000000200420042004203C200420041F84000400001FFC10001FF810000FFC +B122:00000000200420042004203C200420041F84000400001FFC0410041004101FFC +B123:00000000200420042004203C200420041F840004000003E000001FFC080807F0 +B124:0000000000122012201220122012207220122012201220121F92001200120012 +B125:000000002012201220122072201220121F92001200000FFE0002000200020002 +B126:000000002012201220122072201220121F92001200000FBE0082008200820082 +B127:000000002012201220122072201220121F92001200000F8800880088009400E3 +B128:000000002012201220122072201220121F9200120012081208000800080007FE +B129:000000002012201220122072201220121F9200120000083E08080808081407E3 +B12A:000000002012201220122072201220121F9200120000081C0800087F0822079C +B12B:000000002012201220122072201220121F92001200000FFE08000800080007FE +B12C:000000002012201220122072201220121F92001200000FFE00020FFC080007FE +B12D:000000002012201220122072201220121F92001200000FBE00820F0208020782 +B12E:000000002012201220122072201220121F92001200000FBE00A20F220822079E +B12F:000000002012201220122072201220121F92001200000FA200A20F3E0822079E +B130:000000002012201220122072201220121F92001200000F8800880F08081407E3 +B131:000000002012201220122072201220121F92001200000FBE00A00F3E0820079E +B132:000000002012201220122072201220121F92001200000FBF00920F12081207BF +B133:000000002012201220122072201220121F92001200000F9C00800F7F0822079C +B134:000000002012201220122072201220121F92001200000FFE08020802080207FE +B135:000000002012201220122072201220121F9200120000080208020FFE080207FE +B136:000000002012201220122072201220121F9200120000088808880F88089407E3 +B137:000000002012201220122072201220121F92001200000040004000A003180C06 +B138:000000002012201220122072201220121F9200120000020802080208051418E3 +B139:000000002012201220122072201220121F920012000007FC08020802080207FC +B13A:000000002012201220122072201220121F92001200000FFE004000A003180C06 +B13B:000000002012201220122072201220121F920012000001F000000FFE01100E0E +B13C:000000002012201220122072201220121F92001200000FFE00020FFE00020002 +B13D:000000002012201220122072201220121F92001200000FFE08000FFC080007FE +B13E:000000002012201220122072201220121F92001200000FFE0208020802080FFE +B13F:000000002012201220122072201220121F920012000001F000000FFE040403F8 +B140:000000000004200420042004203C20042004203C200420041F84000400040004 +B141:0000000020042004203C20042004203C1F84000400001FFC0004000400040004 +B142:0000000020042004203C20042004203C1F84000400001F7C0104010401040104 +B143:0000000020042004203C20042004203C1F84000400001F1001100110012801C6 +B144:0000000020042004203C20042004203C1F840004000410041000100010000FFC +B145:0000000020042004203C20042004203C1F8400040000107C1010101010280FC6 +B146:0000000020042004203C20042004203C1F84000400001038100010FE10440F38 +B147:0000000020042004203C20042004203C1F84000400001FFC1000100010000FFC +B148:0000000020042004203C20042004203C1F84000400001FFC00041FF810000FFC +B149:0000000020042004203C20042004203C1F84000400001F7C01041E0410040F04 +B14A:0000000020042004203C20042004203C1F84000400001F7C01441E4410440F3C +B14B:0000000020042004203C20042004203C1F84000400001F4401441E7C10440F3C +B14C:0000000020042004203C20042004203C1F84000400001F1001101E1010280FC6 +B14D:0000000020042004203C20042004203C1F84000400001F7C01401E7C10400F3C +B14E:0000000020042004203C20042004203C1F84000400001F7E01241E2410240F7E +B14F:0000000020042004203C20042004203C1F84000400001F3801001EFE10440F38 +B150:0000000020042004203C20042004203C1F84000400001FFC1004100410040FFC +B151:0000000020042004203C20042004203C1F8400040000100410041FFC10040FFC +B152:0000000020042004203C20042004203C1F8400040000111011101F1011280FC6 +B153:0000000020042004203C20042004203C1F84000400000080008001400630180C +B154:0000000020042004203C20042004203C1F84000400000410041004100A2831C6 +B155:0000000020042004203C20042004203C1F84000400000FF81004100410040FF8 +B156:0000000020042004203C20042004203C1F84000400001FFC008001400630180C +B157:0000000020042004203C20042004203C1F840004000003E000001FFC02201C1C +B158:0000000020042004203C20042004203C1F84000400001FFC00041FFC00040004 +B159:0000000020042004203C20042004203C1F84000400001FFC10001FF810000FFC +B15A:0000000020042004203C20042004203C1F84000400001FFC0410041004101FFC +B15B:0000000020042004203C20042004203C1F840004000003E000001FFC080807F0 +B15C:0000000000122012201220122072201220122072201220121F92001200120012 +B15D:000000002012201220722012201220721F92001200000FFE0002000200020002 +B15E:000000002012201220722012201220721F92001200000FBE0082008200820082 +B15F:000000002012201220722012201220721F92001200000F8800880088009400E3 +B160:000000002012201220722012201220721F9200120012081208000800080007FE +B161:000000002012201220722012201220721F9200120000083E08080808081407E3 +B162:000000002012201220722012201220721F9200120000081C0800087F0822079C +B163:000000002012201220722012201220721F92001200000FFE08000800080007FE +B164:000000002012201220722012201220721F92001200000FFE00020FFC080007FE +B165:000000002012201220722012201220721F92001200000FBE00820F0208020782 +B166:000000002012201220722012201220721F92001200000FBE00A20F220822079E +B167:000000002012201220722012201220721F92001200000FA200A20F3E0822079E +B168:000000002012201220722012201220721F92001200000F8800880F08081407E3 +B169:000000002012201220722012201220721F92001200000FBE00A00F3E0820079E +B16A:000000002012201220722012201220721F92001200000FBF00920F12081207BF +B16B:000000002012201220722012201220721F92001200000F9C00800F7F0822079C +B16C:000000002012201220722012201220721F92001200000FFE08020802080207FE +B16D:000000002012201220722012201220721F9200120000080208020FFE080207FE +B16E:000000002012201220722012201220721F9200120000088808880F88089407E3 +B16F:000000002012201220722012201220721F92001200000040004000A003180C06 +B170:000000002012201220722012201220721F9200120000020802080208051418E3 +B171:000000002012201220722012201220721F920012000007FC08020802080207FC +B172:000000002012201220722012201220721F92001200000FFE004000A003180C06 +B173:000000002012201220722012201220721F920012000001F000000FFE01100E0E +B174:000000002012201220722012201220721F92001200000FFE00020FFE00020002 +B175:000000002012201220722012201220721F92001200000FFE08000FFC080007FE +B176:000000002012201220722012201220721F92001200000FFE0208020802080FFE +B177:000000002012201220722012201220721F920012000001F000000FFE040403F8 +B178:0000000000001000100010001000100010000FFC0080008000807FFF00000000 +B179:0000000010001000100010000FFC008000807FFF00001FFC0004000400040004 +B17A:0000000010001000100010000FFC008000807FFF00001F7C0104010401040104 +B17B:0000000010001000100010000FFC008000807FFF00001F1001100110012801C6 +B17C:0000000010001000100010000FFC008000807FFF000010001000100010000FFC +B17D:0000000010001000100010000FFC008000807FFF0000107C1010101010280FC6 +B17E:0000000010001000100010000FFC008000807FFF00001038100010FE10440F38 +B17F:0000000010001000100010000FFC008000807FFF00001FFC1000100010000FFC +B180:0000000010001000100010000FFC008000807FFF00001FFC00041FF810000FFC +B181:0000000010001000100010000FFC008000807FFF00001F7C01041E0410040F04 +B182:0000000010001000100010000FFC008000807FFF00001F7C01441E4410440F3C +B183:0000000010001000100010000FFC008000807FFF00001F4401441E7C10440F3C +B184:0000000010001000100010000FFC008000807FFF00001F1001101E1010280FC6 +B185:0000000010001000100010000FFC008000807FFF00001F7C01401E7C10400F3C +B186:0000000010001000100010000FFC008000807FFF00001F7E01241E2410240F7E +B187:0000000010001000100010000FFC008000807FFF00001F3801001EFE10440F38 +B188:0000000010001000100010000FFC008000807FFF00001FFC1004100410040FFC +B189:0000000010001000100010000FFC008000807FFF0000100410041FFC10040FFC +B18A:0000000010001000100010000FFC008000807FFF0000111011101F1011280FC6 +B18B:0000000010001000100010000FFC008000807FFF00000080008001400630180C +B18C:0000000010001000100010000FFC008000807FFF00000410041004100A2831C6 +B18D:0000000010001000100010000FFC008000807FFF00000FF81004100410040FF8 +B18E:0000000010001000100010000FFC008000807FFF00001FFC008001400630180C +B18F:0000000010001000100010000FFC008000807FFF000003E000001FFC02201C1C +B190:0000000010001000100010000FFC008000807FFF00001FFC00041FFC00040004 +B191:0000000010001000100010000FFC008000807FFF00001FFC10001FF810000FFC +B192:0000000010001000100010000FFC008000807FFF00001FFC0410041004101FFC +B193:0000000010001000100010000FFC008000807FFF000003E000001FFC080807F0 +B194:0000000000042004200420042004200720041F840404040404047FF400040004 +B195:0000000020042004200420071F84040404047FF400001FFC0004000400040004 +B196:0000000020042004200420071F84040404047FF400001F7C0104010401040104 +B197:0000000020042004200420071F84040404047FF400001F1001100110012801C6 +B198:0000000020042004200420071F84040404047FF4000410041000100010000FFC +B199:0000000020042004200420071F84040404047FF40000107C1010101010280FC6 +B19A:0000000020042004200420071F84040404047FF400001038100010FE10440F38 +B19B:0000000020042004200420071F84040404047FF400001FFC1000100010000FFC +B19C:0000000020042004200420071F84040404047FF400001FFC00041FF810000FFC +B19D:0000000020042004200420071F84040404047FF400001F7C01041E0410040F04 +B19E:0000000020042004200420071F84040404047FF400001F7C01441E4410440F3C +B19F:0000000020042004200420071F84040404047FF400001F4401441E7C10440F3C +B1A0:0000000020042004200420071F84040404047FF400001F1001101E1010280FC6 +B1A1:0000000020042004200420071F84040404047FF400001F7C01401E7C10400F3C +B1A2:0000000020042004200420071F84040404047FF400001F7E01241E2410240F7E +B1A3:0000000020042004200420071F84040404047FF400001F3801001EFE10440F38 +B1A4:0000000020042004200420071F84040404047FF400001FFC1004100410040FFC +B1A5:0000000020042004200420071F84040404047FF40000100410041FFC10040FFC +B1A6:0000000020042004200420071F84040404047FF40000111011101F1011280FC6 +B1A7:0000000020042004200420071F84040404047FF400000080008001400630180C +B1A8:0000000020042004200420071F84040404047FF400000410041004100A2831C6 +B1A9:0000000020042004200420071F84040404047FF400000FF81004100410040FF8 +B1AA:0000000020042004200420071F84040404047FF400001FFC008001400630180C +B1AB:0000000020042004200420071F84040404047FF4000003E000001FFC02201C1C +B1AC:0000000020042004200420071F84040404047FF400001FFC00041FFC00040004 +B1AD:0000000020042004200420071F84040404047FF400001FFC10001FF810000FFC +B1AE:0000000020042004200420071F84040404047FF400001FFC0410041004101FFC +B1AF:0000000020042004200420071F84040404047FF4000003E000001FFC080807F0 +B1B0:0000000000122012201220122012201E20121F920412041204127FD200120012 +B1B1:00000000201220122012201E1F92041204127FD200000FFE0002000200020002 +B1B2:00000000201220122012201E1F92041204127FD200000FBE0082008200820082 +B1B3:00000000201220122012201E1F92041204127FD200000F8800880088009400E3 +B1B4:00000000201220122012201E1F92041204127FD20012081208000800080007FE +B1B5:00000000201220122012201E1F92041204127FD20000083E08080808081407E3 +B1B6:00000000201220122012201E1F92041204127FD20000081C0800087F0822079C +B1B7:00000000201220122012201E1F92041204127FD200000FFE08000800080007FE +B1B8:00000000201220122012201E1F92041204127FD200000FFE00020FFC080007FE +B1B9:00000000201220122012201E1F92041204127FD200000FBE00820F0208020782 +B1BA:00000000201220122012201E1F92041204127FD200000FBE00A20F220822079E +B1BB:00000000201220122012201E1F92041204127FD200000FA200A20F3E0822079E +B1BC:00000000201220122012201E1F92041204127FD200000F8800880F08081407E3 +B1BD:00000000201220122012201E1F92041204127FD200000FBE00A00F3E0820079E +B1BE:00000000201220122012201E1F92041204127FD200000FBF00920F12081207BF +B1BF:00000000201220122012201E1F92041204127FD200000F9C00800F7F0822079C +B1C0:00000000201220122012201E1F92041204127FD200000FFE08020802080207FE +B1C1:00000000201220122012201E1F92041204127FD20000080208020FFE080207FE +B1C2:00000000201220122012201E1F92041204127FD20000088808880F88089407E3 +B1C3:00000000201220122012201E1F92041204127FD200000040004000A003180C06 +B1C4:00000000201220122012201E1F92041204127FD20000020802080208051418E3 +B1C5:00000000201220122012201E1F92041204127FD2000007FC08020802080207FC +B1C6:00000000201220122012201E1F92041204127FD200000FFE004000A003180C06 +B1C7:00000000201220122012201E1F92041204127FD2000001F000000FFE01100E0E +B1C8:00000000201220122012201E1F92041204127FD200000FFE00020FFE00020002 +B1C9:00000000201220122012201E1F92041204127FD200000FFE08000FFC080007FE +B1CA:00000000201220122012201E1F92041204127FD200000FFE0208020802080FFE +B1CB:00000000201220122012201E1F92041204127FD2000001F000000FFE040403F8 +B1CC:0000000000042004200420042004200420041F840404040404047FF400040004 +B1CD:0000000020042004200420041F84040404047FF400001FFC0004000400040004 +B1CE:0000000020042004200420041F84040404047FF400001F7C0104010401040104 +B1CF:0000000020042004200420041F84040404047FF400001F1001100110012801C6 +B1D0:0000000020042004200420041F84040404047FF4000410041000100010000FFC +B1D1:0000000020042004200420041F84040404047FF40000107C1010101010280FC6 +B1D2:0000000020042004200420041F84040404047FF400001038100010FE10440F38 +B1D3:0000000020042004200420041F84040404047FF400001FFC1000100010000FFC +B1D4:0000000020042004200420041F84040404047FF400001FFC00041FF810000FFC +B1D5:0000000020042004200420041F84040404047FF400001F7C01041E0410040F04 +B1D6:0000000020042004200420041F84040404047FF400001F7C01441E4410440F3C +B1D7:0000000020042004200420041F84040404047FF400001F4401441E7C10440F3C +B1D8:0000000020042004200420041F84040404047FF400001F1001101E1010280FC6 +B1D9:0000000020042004200420041F84040404047FF400001F7C01401E7C10400F3C +B1DA:0000000020042004200420041F84040404047FF400001F7E01241E2410240F7E +B1DB:0000000020042004200420041F84040404047FF400001F3801001EFE10440F38 +B1DC:0000000020042004200420041F84040404047FF400001FFC1004100410040FFC +B1DD:0000000020042004200420041F84040404047FF40000100410041FFC10040FFC +B1DE:0000000020042004200420041F84040404047FF40000111011101F1011280FC6 +B1DF:0000000020042004200420041F84040404047FF400000080008001400630180C +B1E0:0000000020042004200420041F84040404047FF400000410041004100A2831C6 +B1E1:0000000020042004200420041F84040404047FF400000FF81004100410040FF8 +B1E2:0000000020042004200420041F84040404047FF400001FFC008001400630180C +B1E3:0000000020042004200420041F84040404047FF4000003E000001FFC02201C1C +B1E4:0000000020042004200420041F84040404047FF400001FFC00041FFC00040004 +B1E5:0000000020042004200420041F84040404047FF400001FFC10001FF810000FFC +B1E6:0000000020042004200420041F84040404047FF400001FFC0410041004101FFC +B1E7:0000000020042004200420041F84040404047FF4000003E000001FFC080807F0 +B1E8:0000000000001000100010001000100010000FFC0220022002207FFF00000000 +B1E9:0000000010001000100010000FFC022002207FFF00001FFC0004000400040004 +B1EA:0000000010001000100010000FFC022002207FFF00001F7C0104010401040104 +B1EB:0000000010001000100010000FFC022002207FFF00001F1001100110012801C6 +B1EC:0000000010001000100010000FFC022002207FFF000010001000100010000FFC +B1ED:0000000010001000100010000FFC022002207FFF0000107C1010101010280FC6 +B1EE:0000000010001000100010000FFC022002207FFF00001038100010FE10440F38 +B1EF:0000000010001000100010000FFC022002207FFF00001FFC1000100010000FFC +B1F0:0000000010001000100010000FFC022002207FFF00001FFC00041FF810000FFC +B1F1:0000000010001000100010000FFC022002207FFF00001F7C01041E0410040F04 +B1F2:0000000010001000100010000FFC022002207FFF00001F7C01441E4410440F3C +B1F3:0000000010001000100010000FFC022002207FFF00001F4401441E7C10440F3C +B1F4:0000000010001000100010000FFC022002207FFF00001F1001101E1010280FC6 +B1F5:0000000010001000100010000FFC022002207FFF00001F7C01401E7C10400F3C +B1F6:0000000010001000100010000FFC022002207FFF00001F7E01241E2410240F7E +B1F7:0000000010001000100010000FFC022002207FFF00001F3801001EFE10440F38 +B1F8:0000000010001000100010000FFC022002207FFF00001FFC1004100410040FFC +B1F9:0000000010001000100010000FFC022002207FFF0000100410041FFC10040FFC +B1FA:0000000010001000100010000FFC022002207FFF0000111011101F1011280FC6 +B1FB:0000000010001000100010000FFC022002207FFF00000080008001400630180C +B1FC:0000000010001000100010000FFC022002207FFF00000410041004100A2831C6 +B1FD:0000000010001000100010000FFC022002207FFF00000FF81004100410040FF8 +B1FE:0000000010001000100010000FFC022002207FFF00001FFC008001400630180C +B1FF:0000000010001000100010000FFC022002207FFF000003E000001FFC02201C1C +B200:0000000010001000100010000FFC022002207FFF00001FFC00041FFC00040004 +B201:0000000010001000100010000FFC022002207FFF00001FFC10001FF810000FFC +B202:0000000010001000100010000FFC022002207FFF00001FFC0410041004101FFC +B203:0000000010001000100010000FFC022002207FFF000003E000001FFC080807F0 +B204:0000000010001000100010000FFC000000007FFF008000800080008000800080 +B205:0000000010001000100010000FFC00007FFF008000801FFC0004000400040004 +B206:0000000010001000100010000FFC00007FFF008000801F7C0104010401040104 +B207:0000000010001000100010000FFC00007FFF008000801F1001100110012801C6 +B208:0000000010001000100010000FFC000000007FFF008010801080100010000FFC +B209:0000000010001000100010000FFC00007FFF00800080107C1010101010280FC6 +B20A:0000000010001000100010000FFC00007FFF008000801038100010FE10440F38 +B20B:0000000010001000100010000FFC00007FFF008000801FFC1000100010000FFC +B20C:0000000010001000100010000FFC00007FFF008000801FFC00041FF810000FFC +B20D:0000000010001000100010000FFC00007FFF008000801F7C01041E0410040F04 +B20E:0000000010001000100010000FFC00007FFF008000801F7C01441E4410440F3C +B20F:0000000010001000100010000FFC00007FFF008000801F4401441E7C10440F3C +B210:0000000010001000100010000FFC00007FFF008000801F1001101E1010280FC6 +B211:0000000010001000100010000FFC00007FFF008000801F7C01401E7C10400F3C +B212:0000000010001000100010000FFC00007FFF008000801F7E01241E2410240F7E +B213:0000000010001000100010000FFC00007FFF008000801F3801001EFE10440F38 +B214:0000000010001000100010000FFC00007FFF008000801FFC1004100410040FFC +B215:0000000010001000100010000FFC00007FFF00800080100410041FFC10040FFC +B216:0000000010001000100010000FFC00007FFF00800080111011101F1011280FC6 +B217:0000000010001000100010000FFC00007FFF008000800080008001400630180C +B218:0000000010001000100010000FFC00007FFF008000800410041004100A2831C6 +B219:0000000010001000100010000FFC00007FFF008000800FF81004100410040FF8 +B21A:0000000010001000100010000FFC00007FFF008000801FFC008001400630180C +B21B:0000000010001000100010000FFC00007FFF0080008003E000001FFC02201C1C +B21C:0000000010001000100010000FFC00007FFF008000801FFC00041FFC00040004 +B21D:0000000010001000100010000FFC00007FFF008000801FFC10001FF810000FFC +B21E:0000000010001000100010000FFC00007FFF008000801FFC0410041004101FFC +B21F:0000000010001000100010000FFC00007FFF0080008003E000001FFC080807F0 +B220:0000000020042004200420041F84000400047FF404040404043C040404040404 +B221:00000000200420042004201C1F8400047FF4040404001FFC0004000400040004 +B222:00000000200420042004201C1F8400047FF4040404001F7C0104010401040104 +B223:00000000200420042004201C1F8400047FF4040404001F1001100110012801C6 +B224:0000000020042004200420041F8400047FF40404043C14041000100010000FFC +B225:00000000200420042004201C1F8400047FF404040400107C1010101010280FC6 +B226:00000000200420042004201C1F8400047FF4040404001038100010FE10440F38 +B227:00000000200420042004201C1F8400047FF4040404001FFC1000100010000FFC +B228:00000000200420042004201C1F8400047FF4040404001FFC00041FF810000FFC +B229:00000000200420042004201C1F8400047FF4040404001F7C01041E0410040F04 +B22A:00000000200420042004201C1F8400047FF4040404001F7C01441E4410440F3C +B22B:00000000200420042004201C1F8400047FF4040404001F4401441E7C10440F3C +B22C:00000000200420042004201C1F8400047FF4040404001F1001101E1010280FC6 +B22D:00000000200420042004201C1F8400047FF4040404001F7C01401E7C10400F3C +B22E:00000000200420042004201C1F8400047FF4040404001F7E01241E2410240F7E +B22F:00000000200420042004201C1F8400047FF4040404001F3801001EFE10440F38 +B230:00000000200420042004201C1F8400047FF4040404001FFC1004100410040FFC +B231:00000000200420042004201C1F8400047FF404040400100410041FFC10040FFC +B232:00000000200420042004201C1F8400047FF404040400111011101F1011280FC6 +B233:00000000200420042004201C1F8400047FF4040404000080008001400630180C +B234:00000000200420042004201C1F8400047FF4040404000410041004100A2831C6 +B235:00000000200420042004201C1F8400047FF4040404000FF81004100410040FF8 +B236:00000000200420042004201C1F8400047FF4040404001FFC008001400630180C +B237:00000000200420042004201C1F8400047FF40404040003E000001FFC02201C1C +B238:00000000200420042004201C1F8400047FF4040404001FFC00041FFC00040004 +B239:00000000200420042004201C1F8400047FF4040404001FFC10001FF810000FFC +B23A:00000000200420042004201C1F8400047FF4040404001FFC0410041004101FFC +B23B:00000000200420042004201C1F8400047FF40404040003E000001FFC080807F0 +B23C:0000000020122012201220121F92001200127FD20412041204F2041204120412 +B23D:0000000020122012201220721F9200127FD2041204000FFE0002000200020002 +B23E:0000000020122012201220721F9200127FD2041204000FBE0082008200820082 +B23F:0000000020122012201220721F9200127FD2041204000F8800880088009400E3 +B240:0000000020122012201220121F9200127FD2021202F20A1208000800080007FE +B241:0000000020122012201220721F9200127FD204120400083E08080808081407E3 +B242:0000000020122012201220721F9200127FD204120400081C0800087F0822079C +B243:0000000020122012201220721F9200127FD2041204000FFE08000800080007FE +B244:0000000020122012201220721F9200127FD2041204000FFE00020FFC080007FE +B245:0000000020122012201220721F9200127FD2041204000FBE00820F0208020782 +B246:0000000020122012201220721F9200127FD2041204000FBE00A20F220822079E +B247:0000000020122012201220721F9200127FD2041204000FA200A20F3E0822079E +B248:0000000020122012201220721F9200127FD2041204000F8800880F08081407E3 +B249:0000000020122012201220721F9200127FD2041204000FBE00A00F3E0820079E +B24A:0000000020122012201220721F9200127FD2041204000FBF00920F12081207BF +B24B:0000000020122012201220721F9200127FD2041204000F9C00800F7F0822079C +B24C:0000000020122012201220721F9200127FD2041204000FFE08020802080207FE +B24D:0000000020122012201220721F9200127FD204120400080208020FFE080207FE +B24E:0000000020122012201220721F9200127FD204120400088808880F88089407E3 +B24F:0000000020122012201220721F9200127FD2041204000040004000A003180C06 +B250:0000000020122012201220721F9200127FD204120400020802080208051418E3 +B251:0000000020122012201220721F9200127FD20412040007FC08020802080207FC +B252:0000000020122012201220721F9200127FD2041204000FFE004000A003180C06 +B253:0000000020122012201220721F9200127FD20412040001F000000FFE01100E0E +B254:0000000020122012201220721F9200127FD2041204000FFE00020FFE00020002 +B255:0000000020122012201220721F9200127FD2041204000FFE08000FFC080007FE +B256:0000000020122012201220721F9200127FD2041204000FFE0208020802080FFE +B257:0000000020122012201220721F9200127FD20412040001F000000FFE040403F8 +B258:0000000020042004200420041F84000400047FF4040404040404040404040404 +B259:0000000020042004200420041F8400047FF4040404001FFC0004000400040004 +B25A:0000000020042004200420041F8400047FF4040404001F7C0104010401040104 +B25B:0000000020042004200420041F8400047FF4040404001F1001100110012801C6 +B25C:0000000020042004200420041F8400047FF40404040414041000100010000FFC +B25D:0000000020042004200420041F8400047FF404040400107C1010101010280FC6 +B25E:0000000020042004200420041F8400047FF4040404001038100010FE10440F38 +B25F:0000000020042004200420041F8400047FF4040404001FFC1000100010000FFC +B260:0000000020042004200420041F8400047FF4040404001FFC00041FF810000FFC +B261:0000000020042004200420041F8400047FF4040404001F7C01041E0410040F04 +B262:0000000020042004200420041F8400047FF4040404001F7C01441E4410440F3C +B263:0000000020042004200420041F8400047FF4040404001F4401441E7C10440F3C +B264:0000000020042004200420041F8400047FF4040404001F1001101E1010280FC6 +B265:0000000020042004200420041F8400047FF4040404001F7C01401E7C10400F3C +B266:0000000020042004200420041F8400047FF4040404001F7E01241E2410240F7E +B267:0000000020042004200420041F8400047FF4040404001F3801001EFE10440F38 +B268:0000000020042004200420041F8400047FF4040404001FFC1004100410040FFC +B269:0000000020042004200420041F8400047FF404040400100410041FFC10040FFC +B26A:0000000020042004200420041F8400047FF404040400111011101F1011280FC6 +B26B:0000000020042004200420041F8400047FF4040404000080008001400630180C +B26C:0000000020042004200420041F8400047FF4040404000410041004100A2831C6 +B26D:0000000020042004200420041F8400047FF4040404000FF81004100410040FF8 +B26E:0000000020042004200420041F8400047FF4040404001FFC008001400630180C +B26F:0000000020042004200420041F8400047FF40404040003E000001FFC02201C1C +B270:0000000020042004200420041F8400047FF4040404001FFC00041FFC00040004 +B271:0000000020042004200420041F8400047FF4040404001FFC10001FF810000FFC +B272:0000000020042004200420041F8400047FF4040404001FFC0410041004101FFC +B273:0000000020042004200420041F8400047FF40404040003E000001FFC080807F0 +B274:0000000010001000100010000FFC000000007FFF041004100410041004100410 +B275:0000000010001000100010000FFC00007FFF022002201FFC0004000400040004 +B276:0000000010001000100010000FFC00007FFF022002201F7C0104010401040104 +B277:0000000010001000100010000FFC00007FFF022002201F1001100110012801C6 +B278:0000000010001000100010000FFC000000007FFF022012201220100010000FFC +B279:0000000010001000100010000FFC00007FFF02200220107C1010101010280FC6 +B27A:0000000010001000100010000FFC00007FFF022002201038100010FE10440F38 +B27B:0000000010001000100010000FFC00007FFF022002201FFC1000100010000FFC +B27C:0000000010001000100010000FFC00007FFF022002201FFC00041FF810000FFC +B27D:0000000010001000100010000FFC00007FFF022002201F7C01041E0410040F04 +B27E:0000000010001000100010000FFC00007FFF022002201F7C01441E4410440F3C +B27F:0000000010001000100010000FFC00007FFF022002201F4401441E7C10440F3C +B280:0000000010001000100010000FFC00007FFF022002201F1001101E1010280FC6 +B281:0000000010001000100010000FFC00007FFF022002201F7C01401E7C10400F3C +B282:0000000010001000100010000FFC00007FFF022002201F7E01241E2410240F7E +B283:0000000010001000100010000FFC00007FFF022002201F3801001EFE10440F38 +B284:0000000010001000100010000FFC00007FFF022002201FFC1004100410040FFC +B285:0000000010001000100010000FFC00007FFF02200220100410041FFC10040FFC +B286:0000000010001000100010000FFC00007FFF02200220111011101F1011280FC6 +B287:0000000010001000100010000FFC00007FFF022002200080008001400630180C +B288:0000000010001000100010000FFC00007FFF022002200410041004100A2831C6 +B289:0000000010001000100010000FFC00007FFF022002200FF81004100410040FF8 +B28A:0000000010001000100010000FFC00007FFF022002201FFC008001400630180C +B28B:0000000010001000100010000FFC00007FFF0220022003E000001FFC02201C1C +B28C:0000000010001000100010000FFC00007FFF022002201FFC00041FFC00040004 +B28D:0000000010001000100010000FFC00007FFF022002201FFC10001FF810000FFC +B28E:0000000010001000100010000FFC00007FFF022002201FFC0410041004101FFC +B28F:0000000010001000100010000FFC00007FFF0220022003E000001FFC080807F0 +B290:0000000000001000100010001000100010000FFC0000000000007FFF00000000 +B291:0000000010001000100010000FFC00007FFF000000001FFC0004000400040004 +B292:0000000010001000100010000FFC00007FFF000000001F7C0104010401040104 +B293:0000000010001000100010000FFC00007FFF000000001F1001100110012801C6 +B294:0000000010001000100010000FFC000000007FFF000010001000100010000FFC +B295:0000000010001000100010000FFC00007FFF00000000107C1010101010280FC6 +B296:0000000010001000100010000FFC00007FFF000000001038100010FE10440F38 +B297:0000000010001000100010000FFC00007FFF000000001FFC1000100010000FFC +B298:0000000010001000100010000FFC00007FFF000000001FFC00041FF810000FFC +B299:0000000010001000100010000FFC00007FFF000000001F7C01041E0410040F04 +B29A:0000000010001000100010000FFC00007FFF000000001F7C01441E4410440F3C +B29B:0000000010001000100010000FFC00007FFF000000001F4401441E7C10440F3C +B29C:0000000010001000100010000FFC00007FFF000000001F1001101E1010280FC6 +B29D:0000000010001000100010000FFC00007FFF000000001F7C01401E7C10400F3C +B29E:0000000010001000100010000FFC00007FFF000000001F7E01241E2410240F7E +B29F:0000000010001000100010000FFC00007FFF000000001F3801001EFE10440F38 +B2A0:0000000010001000100010000FFC00007FFF000000001FFC1004100410040FFC +B2A1:0000000010001000100010000FFC00007FFF00000000100410041FFC10040FFC +B2A2:0000000010001000100010000FFC00007FFF00000000111011101F1011280FC6 +B2A3:0000000010001000100010000FFC00007FFF000000000080008001400630180C +B2A4:0000000010001000100010000FFC00007FFF000000000410041004100A2831C6 +B2A5:0000000010001000100010000FFC00007FFF000000000FF81004100410040FF8 +B2A6:0000000010001000100010000FFC00007FFF000000001FFC008001400630180C +B2A7:0000000010001000100010000FFC00007FFF0000000003E000001FFC02201C1C +B2A8:0000000010001000100010000FFC00007FFF000000001FFC00041FFC00040004 +B2A9:0000000010001000100010000FFC00007FFF000000001FFC10001FF810000FFC +B2AA:0000000010001000100010000FFC00007FFF000000001FFC0410041004101FFC +B2AB:0000000010001000100010000FFC00007FFF0000000003E000001FFC080807F0 +B2AC:0000000000042004200420042004200420041F840004000400047FF400040004 +B2AD:0000000020042004200420041F8400047FF4000400001FFC0004000400040004 +B2AE:0000000020042004200420041F8400047FF4000400001F7C0104010401040104 +B2AF:0000000020042004200420041F8400047FF4000400001F1001100110012801C6 +B2B0:0000000020042004200420041F84000400047FF4000410041000100010000FFC +B2B1:0000000020042004200420041F8400047FF400040000107C1010101010280FC6 +B2B2:0000000020042004200420041F8400047FF4000400001038100010FE10440F38 +B2B3:0000000020042004200420041F8400047FF4000400001FFC1000100010000FFC +B2B4:0000000020042004200420041F8400047FF4000400001FFC00041FF810000FFC +B2B5:0000000020042004200420041F8400047FF4000400001F7C01041E0410040F04 +B2B6:0000000020042004200420041F8400047FF4000400001F7C01441E4410440F3C +B2B7:0000000020042004200420041F8400047FF4000400001F4401441E7C10440F3C +B2B8:0000000020042004200420041F8400047FF4000400001F1001101E1010280FC6 +B2B9:0000000020042004200420041F8400047FF4000400001F7C01401E7C10400F3C +B2BA:0000000020042004200420041F8400047FF4000400001F7E01241E2410240F7E +B2BB:0000000020042004200420041F8400047FF4000400001F3801001EFE10440F38 +B2BC:0000000020042004200420041F8400047FF4000400001FFC1004100410040FFC +B2BD:0000000020042004200420041F8400047FF400040000100410041FFC10040FFC +B2BE:0000000020042004200420041F8400047FF400040000111011101F1011280FC6 +B2BF:0000000020042004200420041F8400047FF4000400000080008001400630180C +B2C0:0000000020042004200420041F8400047FF4000400000410041004100A2831C6 +B2C1:0000000020042004200420041F8400047FF4000400000FF81004100410040FF8 +B2C2:0000000020042004200420041F8400047FF4000400001FFC008001400630180C +B2C3:0000000020042004200420041F8400047FF40004000003E000001FFC02201C1C +B2C4:0000000020042004200420041F8400047FF4000400001FFC00041FFC00040004 +B2C5:0000000020042004200420041F8400047FF4000400001FFC10001FF810000FFC +B2C6:0000000020042004200420041F8400047FF4000400001FFC0410041004101FFC +B2C7:0000000020042004200420041F8400047FF40004000003E000001FFC080807F0 +B2C8:0000000000042004200420042004200420042004200420041F84000400040004 +B2C9:000000002004200420042004200420041F84000400001FFC0004000400040004 +B2CA:000000002004200420042004200420041F84000400001F7C0104010401040104 +B2CB:000000002004200420042004200420041F84000400001F1001100110012801C6 +B2CC:000000002004200420042004200420041F840004000410041000100010000FFC +B2CD:000000002004200420042004200420041F8400040000107C1010101010280FC6 +B2CE:000000002004200420042004200420041F84000400001038100010FE10440F38 +B2CF:000000002004200420042004200420041F84000400001FFC1000100010000FFC +B2D0:000000002004200420042004200420041F84000400001FFC00041FF810000FFC +B2D1:000000002004200420042004200420041F84000400001F7C01041E0410040F04 +B2D2:000000002004200420042004200420041F84000400001F7C01441E4410440F3C +B2D3:000000002004200420042004200420041F84000400001F4401441E7C10440F3C +B2D4:000000002004200420042004200420041F84000400001F1001101E1010280FC6 +B2D5:000000002004200420042004200420041F84000400001F7C01401E7C10400F3C +B2D6:000000002004200420042004200420041F84000400001F7E01241E2410240F7E +B2D7:000000002004200420042004200420041F84000400001F3801001EFE10440F38 +B2D8:000000002004200420042004200420041F84000400001FFC1004100410040FFC +B2D9:000000002004200420042004200420041F8400040000100410041FFC10040FFC +B2DA:000000002004200420042004200420041F8400040000111011101F1011280FC6 +B2DB:000000002004200420042004200420041F84000400000080008001400630180C +B2DC:000000002004200420042004200420041F84000400000410041004100A2831C6 +B2DD:000000002004200420042004200420041F84000400000FF81004100410040FF8 +B2DE:000000002004200420042004200420041F84000400001FFC008001400630180C +B2DF:000000002004200420042004200420041F840004000003E000001FFC02201C1C +B2E0:000000002004200420042004200420041F84000400001FFC00041FFC00040004 +B2E1:000000002004200420042004200420041F84000400001FFC10001FF810000FFC +B2E2:000000002004200420042004200420041F84000400001FFC0410041004101FFC +B2E3:000000002004200420042004200420041F840004000003E000001FFC080807F0 +B2E4:0000000000043F84200420042004200720042004200420041F84000400040004 +B2E5:000000003F84200420042007200420041F84000400001FFC0004000400040004 +B2E6:000000003F84200420042007200420041F84000400001F7C0104010401040104 +B2E7:000000003F84200420042007200420041F84000400001F1001100110012801C6 +B2E8:000000003F84200420042007200420041F840004000410041000100010000FFC +B2E9:000000003F84200420042007200420041F8400040000107C1010101010280FC6 +B2EA:000000003F84200420042007200420041F84000400001038100010FE10440F38 +B2EB:000000003F84200420042007200420041F84000400001FFC1000100010000FFC +B2EC:000000003F84200420042007200420041F84000400001FFC00041FF810000FFC +B2ED:000000003F84200420042007200420041F84000400001F7C01041E0410040F04 +B2EE:000000003F84200420042007200420041F84000400001F7C01441E4410440F3C +B2EF:000000003F84200420042007200420041F84000400001F4401441E7C10440F3C +B2F0:000000003F84200420042007200420041F84000400001F1001101E1010280FC6 +B2F1:000000003F84200420042007200420041F84000400001F7C01401E7C10400F3C +B2F2:000000003F84200420042007200420041F84000400001F7E01241E2410240F7E +B2F3:000000003F84200420042007200420041F84000400001F3801001EFE10440F38 +B2F4:000000003F84200420042007200420041F84000400001FFC1004100410040FFC +B2F5:000000003F84200420042007200420041F8400040000100410041FFC10040FFC +B2F6:000000003F84200420042007200420041F8400040000111011101F1011280FC6 +B2F7:000000003F84200420042007200420041F84000400000080008001400630180C +B2F8:000000003F84200420042007200420041F84000400000410041004100A2831C6 +B2F9:000000003F84200420042007200420041F84000400000FF81004100410040FF8 +B2FA:000000003F84200420042007200420041F84000400001FFC008001400630180C +B2FB:000000003F84200420042007200420041F840004000003E000001FFC02201C1C +B2FC:000000003F84200420042007200420041F84000400001FFC00041FFC00040004 +B2FD:000000003F84200420042007200420041F84000400001FFC10001FF810000FFC +B2FE:000000003F84200420042007200420041F84000400001FFC0410041004101FFC +B2FF:000000003F84200420042007200420041F840004000003E000001FFC080807F0 +B300:0000000000123F92201220122012201E20122012201220121F92001200120012 +B301:000000003F9220122012201E201220121F92001200000FFE0002000200020002 +B302:000000003F9220122012201E201220121F92001200000FBE0082008200820082 +B303:000000003F9220122012201E201220121F92001200000F8800880088009400E3 +B304:000000003F9220122012201E201220121F9200120012081208000800080007FE +B305:000000003F9220122012201E201220121F9200120000083E08080808081407E3 +B306:000000003F9220122012201E201220121F9200120000081C0800087F0822079C +B307:000000003F9220122012201E201220121F92001200000FFE08000800080007FE +B308:000000003F9220122012201E201220121F92001200000FFE00020FFC080007FE +B309:000000003F9220122012201E201220121F92001200000FBE00820F0208020782 +B30A:000000003F9220122012201E201220121F92001200000FBE00A20F220822079E +B30B:000000003F9220122012201E201220121F92001200000FA200A20F3E0822079E +B30C:000000003F9220122012201E201220121F92001200000F8800880F08081407E3 +B30D:000000003F9220122012201E201220121F92001200000FBE00A00F3E0820079E +B30E:000000003F9220122012201E201220121F92001200000FBF00920F12081207BF +B30F:000000003F9220122012201E201220121F92001200000F9C00800F7F0822079C +B310:000000003F9220122012201E201220121F92001200000FFE08020802080207FE +B311:000000003F9220122012201E201220121F9200120000080208020FFE080207FE +B312:000000003F9220122012201E201220121F9200120000088808880F88089407E3 +B313:000000003F9220122012201E201220121F92001200000040004000A003180C06 +B314:000000003F9220122012201E201220121F9200120000020802080208051418E3 +B315:000000003F9220122012201E201220121F920012000007FC08020802080207FC +B316:000000003F9220122012201E201220121F92001200000FFE004000A003180C06 +B317:000000003F9220122012201E201220121F920012000001F000000FFE01100E0E +B318:000000003F9220122012201E201220121F92001200000FFE00020FFE00020002 +B319:000000003F9220122012201E201220121F92001200000FFE08000FFC080007FE +B31A:000000003F9220122012201E201220121F92001200000FFE0208020802080FFE +B31B:000000003F9220122012201E201220121F920012000001F000000FFE040403F8 +B31C:0000000000043F84200420042007200420042007200420041F84000400040004 +B31D:000000003F84200420072004200420071F84000400001FFC0004000400040004 +B31E:000000003F84200420072004200420071F84000400001F7C0104010401040104 +B31F:000000003F84200420072004200420071F84000400001F1001100110012801C6 +B320:000000003F84200420072004200420071F840004000410041000100010000FFC +B321:000000003F84200420072004200420071F8400040000107C1010101010280FC6 +B322:000000003F84200420072004200420071F84000400001038100010FE10440F38 +B323:000000003F84200420072004200420071F84000400001FFC1000100010000FFC +B324:000000003F84200420072004200420071F84000400001FFC00041FF810000FFC +B325:000000003F84200420072004200420071F84000400001F7C01041E0410040F04 +B326:000000003F84200420072004200420071F84000400001F7C01441E4410440F3C +B327:000000003F84200420072004200420071F84000400001F4401441E7C10440F3C +B328:000000003F84200420072004200420071F84000400001F1001101E1010280FC6 +B329:000000003F84200420072004200420071F84000400001F7C01401E7C10400F3C +B32A:000000003F84200420072004200420071F84000400001F7E01241E2410240F7E +B32B:000000003F84200420072004200420071F84000400001F3801001EFE10440F38 +B32C:000000003F84200420072004200420071F84000400001FFC1004100410040FFC +B32D:000000003F84200420072004200420071F8400040000100410041FFC10040FFC +B32E:000000003F84200420072004200420071F8400040000111011101F1011280FC6 +B32F:000000003F84200420072004200420071F84000400000080008001400630180C +B330:000000003F84200420072004200420071F84000400000410041004100A2831C6 +B331:000000003F84200420072004200420071F84000400000FF81004100410040FF8 +B332:000000003F84200420072004200420071F84000400001FFC008001400630180C +B333:000000003F84200420072004200420071F840004000003E000001FFC02201C1C +B334:000000003F84200420072004200420071F84000400001FFC00041FFC00040004 +B335:000000003F84200420072004200420071F84000400001FFC10001FF810000FFC +B336:000000003F84200420072004200420071F84000400001FFC0410041004101FFC +B337:000000003F84200420072004200420071F840004000003E000001FFC080807F0 +B338:0000000000123F9220122012201E20122012201E201220121F92001200120012 +B339:000000003F922012201E20122012201E1F92001200000FFE0002000200020002 +B33A:000000003F922012201E20122012201E1F92001200000FBE0082008200820082 +B33B:000000003F922012201E20122012201E1F92001200000F8800880088009400E3 +B33C:000000003F922012201E20122012201E1F9200120012081208000800080007FE +B33D:000000003F922012201E20122012201E1F9200120000083E08080808081407E3 +B33E:000000003F922012201E20122012201E1F9200120000081C0800087F0822079C +B33F:000000003F922012201E20122012201E1F92001200000FFE08000800080007FE +B340:000000003F922012201E20122012201E1F92001200000FFE00020FFC080007FE +B341:000000003F922012201E20122012201E1F92001200000FBE00820F0208020782 +B342:000000003F922012201E20122012201E1F92001200000FBE00A20F220822079E +B343:000000003F922012201E20122012201E1F92001200000FA200A20F3E0822079E +B344:000000003F922012201E20122012201E1F92001200000F8800880F08081407E3 +B345:000000003F922012201E20122012201E1F92001200000FBE00A00F3E0820079E +B346:000000003F922012201E20122012201E1F92001200000FBF00920F12081207BF +B347:000000003F922012201E20122012201E1F92001200000F9C00800F7F0822079C +B348:000000003F922012201E20122012201E1F92001200000FFE08020802080207FE +B349:000000003F922012201E20122012201E1F9200120000080208020FFE080207FE +B34A:000000003F922012201E20122012201E1F9200120000088808880F88089407E3 +B34B:000000003F922012201E20122012201E1F92001200000040004000A003180C06 +B34C:000000003F922012201E20122012201E1F9200120000020802080208051418E3 +B34D:000000003F922012201E20122012201E1F920012000007FC08020802080207FC +B34E:000000003F922012201E20122012201E1F92001200000FFE004000A003180C06 +B34F:000000003F922012201E20122012201E1F920012000001F000000FFE01100E0E +B350:000000003F922012201E20122012201E1F92001200000FFE00020FFE00020002 +B351:000000003F922012201E20122012201E1F92001200000FFE08000FFC080007FE +B352:000000003F922012201E20122012201E1F92001200000FFE0208020802080FFE +B353:000000003F922012201E20122012201E1F920012000001F000000FFE040403F8 +B354:0000000000043F84200420042004203C20042004200420041F84000400040004 +B355:000000003F8420042004203C200420041F84000400001FFC0004000400040004 +B356:000000003F8420042004203C200420041F84000400001F7C0104010401040104 +B357:000000003F8420042004203C200420041F84000400001F1001100110012801C6 +B358:000000003F8420042004203C200420041F840004000410041000100010000FFC +B359:000000003F8420042004203C200420041F8400040000107C1010101010280FC6 +B35A:000000003F8420042004203C200420041F84000400001038100010FE10440F38 +B35B:000000003F8420042004203C200420041F84000400001FFC1000100010000FFC +B35C:000000003F8420042004203C200420041F84000400001FFC00041FF810000FFC +B35D:000000003F8420042004203C200420041F84000400001F7C01041E0410040F04 +B35E:000000003F8420042004203C200420041F84000400001F7C01441E4410440F3C +B35F:000000003F8420042004203C200420041F84000400001F4401441E7C10440F3C +B360:000000003F8420042004203C200420041F84000400001F1001101E1010280FC6 +B361:000000003F8420042004203C200420041F84000400001F7C01401E7C10400F3C +B362:000000003F8420042004203C200420041F84000400001F7E01241E2410240F7E +B363:000000003F8420042004203C200420041F84000400001F3801001EFE10440F38 +B364:000000003F8420042004203C200420041F84000400001FFC1004100410040FFC +B365:000000003F8420042004203C200420041F8400040000100410041FFC10040FFC +B366:000000003F8420042004203C200420041F8400040000111011101F1011280FC6 +B367:000000003F8420042004203C200420041F84000400000080008001400630180C +B368:000000003F8420042004203C200420041F84000400000410041004100A2831C6 +B369:000000003F8420042004203C200420041F84000400000FF81004100410040FF8 +B36A:000000003F8420042004203C200420041F84000400001FFC008001400630180C +B36B:000000003F8420042004203C200420041F840004000003E000001FFC02201C1C +B36C:000000003F8420042004203C200420041F84000400001FFC00041FFC00040004 +B36D:000000003F8420042004203C200420041F84000400001FFC10001FF810000FFC +B36E:000000003F8420042004203C200420041F84000400001FFC0410041004101FFC +B36F:000000003F8420042004203C200420041F840004000003E000001FFC080807F0 +B370:0000000000123F92201220122012207220122012201220121F92001200120012 +B371:000000003F92201220122072201220121F92001200000FFE0002000200020002 +B372:000000003F92201220122072201220121F92001200000FBE0082008200820082 +B373:000000003F92201220122072201220121F92001200000F8800880088009400E3 +B374:000000003F92201220122072201220121F9200120012081208000800080007FE +B375:000000003F92201220122072201220121F9200120000083E08080808081407E3 +B376:000000003F92201220122072201220121F9200120000081C0800087F0822079C +B377:000000003F92201220122072201220121F92001200000FFE08000800080007FE +B378:000000003F92201220122072201220121F92001200000FFE00020FFC080007FE +B379:000000003F92201220122072201220121F92001200000FBE00820F0208020782 +B37A:000000003F92201220122072201220121F92001200000FBE00A20F220822079E +B37B:000000003F92201220122072201220121F92001200000FA200A20F3E0822079E +B37C:000000003F92201220122072201220121F92001200000F8800880F08081407E3 +B37D:000000003F92201220122072201220121F92001200000FBE00A00F3E0820079E +B37E:000000003F92201220122072201220121F92001200000FBF00920F12081207BF +B37F:000000003F92201220122072201220121F92001200000F9C00800F7F0822079C +B380:000000003F92201220122072201220121F92001200000FFE08020802080207FE +B381:000000003F92201220122072201220121F9200120000080208020FFE080207FE +B382:000000003F92201220122072201220121F9200120000088808880F88089407E3 +B383:000000003F92201220122072201220121F92001200000040004000A003180C06 +B384:000000003F92201220122072201220121F9200120000020802080208051418E3 +B385:000000003F92201220122072201220121F920012000007FC08020802080207FC +B386:000000003F92201220122072201220121F92001200000FFE004000A003180C06 +B387:000000003F92201220122072201220121F920012000001F000000FFE01100E0E +B388:000000003F92201220122072201220121F92001200000FFE00020FFE00020002 +B389:000000003F92201220122072201220121F92001200000FFE08000FFC080007FE +B38A:000000003F92201220122072201220121F92001200000FFE0208020802080FFE +B38B:000000003F92201220122072201220121F920012000001F000000FFE040403F8 +B38C:0000000000043F8420042004203C20042004203C200420041F84000400040004 +B38D:000000003F842004203C20042004203C1F84000400001FFC0004000400040004 +B38E:000000003F842004203C20042004203C1F84000400001F7C0104010401040104 +B38F:000000003F842004203C20042004203C1F84000400001F1001100110012801C6 +B390:000000003F842004203C20042004203C1F840004000410041000100010000FFC +B391:000000003F842004203C20042004203C1F8400040000107C1010101010280FC6 +B392:000000003F842004203C20042004203C1F84000400001038100010FE10440F38 +B393:000000003F842004203C20042004203C1F84000400001FFC1000100010000FFC +B394:000000003F842004203C20042004203C1F84000400001FFC00041FF810000FFC +B395:000000003F842004203C20042004203C1F84000400001F7C01041E0410040F04 +B396:000000003F842004203C20042004203C1F84000400001F7C01441E4410440F3C +B397:000000003F842004203C20042004203C1F84000400001F4401441E7C10440F3C +B398:000000003F842004203C20042004203C1F84000400001F1001101E1010280FC6 +B399:000000003F842004203C20042004203C1F84000400001F7C01401E7C10400F3C +B39A:000000003F842004203C20042004203C1F84000400001F7E01241E2410240F7E +B39B:000000003F842004203C20042004203C1F84000400001F3801001EFE10440F38 +B39C:000000003F842004203C20042004203C1F84000400001FFC1004100410040FFC +B39D:000000003F842004203C20042004203C1F8400040000100410041FFC10040FFC +B39E:000000003F842004203C20042004203C1F8400040000111011101F1011280FC6 +B39F:000000003F842004203C20042004203C1F84000400000080008001400630180C +B3A0:000000003F842004203C20042004203C1F84000400000410041004100A2831C6 +B3A1:000000003F842004203C20042004203C1F84000400000FF81004100410040FF8 +B3A2:000000003F842004203C20042004203C1F84000400001FFC008001400630180C +B3A3:000000003F842004203C20042004203C1F840004000003E000001FFC02201C1C +B3A4:000000003F842004203C20042004203C1F84000400001FFC00041FFC00040004 +B3A5:000000003F842004203C20042004203C1F84000400001FFC10001FF810000FFC +B3A6:000000003F842004203C20042004203C1F84000400001FFC0410041004101FFC +B3A7:000000003F842004203C20042004203C1F840004000003E000001FFC080807F0 +B3A8:0000000000123F92201220122072201220122072201220121F92001200120012 +B3A9:000000003F92201220722012201220721F92001200000FFE0002000200020002 +B3AA:000000003F92201220722012201220721F92001200000FBE0082008200820082 +B3AB:000000003F92201220722012201220721F92001200000F8800880088009400E3 +B3AC:000000003F92201220722012201220721F9200120012081208000800080007FE +B3AD:000000003F92201220722012201220721F9200120000083E08080808081407E3 +B3AE:000000003F92201220722012201220721F9200120000081C0800087F0822079C +B3AF:000000003F92201220722012201220721F92001200000FFE08000800080007FE +B3B0:000000003F92201220722012201220721F92001200000FFE00020FFC080007FE +B3B1:000000003F92201220722012201220721F92001200000FBE00820F0208020782 +B3B2:000000003F92201220722012201220721F92001200000FBE00A20F220822079E +B3B3:000000003F92201220722012201220721F92001200000FA200A20F3E0822079E +B3B4:000000003F92201220722012201220721F92001200000F8800880F08081407E3 +B3B5:000000003F92201220722012201220721F92001200000FBE00A00F3E0820079E +B3B6:000000003F92201220722012201220721F92001200000FBF00920F12081207BF +B3B7:000000003F92201220722012201220721F92001200000F9C00800F7F0822079C +B3B8:000000003F92201220722012201220721F92001200000FFE08020802080207FE +B3B9:000000003F92201220722012201220721F9200120000080208020FFE080207FE +B3BA:000000003F92201220722012201220721F9200120000088808880F88089407E3 +B3BB:000000003F92201220722012201220721F92001200000040004000A003180C06 +B3BC:000000003F92201220722012201220721F9200120000020802080208051418E3 +B3BD:000000003F92201220722012201220721F920012000007FC08020802080207FC +B3BE:000000003F92201220722012201220721F92001200000FFE004000A003180C06 +B3BF:000000003F92201220722012201220721F920012000001F000000FFE01100E0E +B3C0:000000003F92201220722012201220721F92001200000FFE00020FFE00020002 +B3C1:000000003F92201220722012201220721F92001200000FFE08000FFC080007FE +B3C2:000000003F92201220722012201220721F92001200000FFE0208020802080FFE +B3C3:000000003F92201220722012201220721F920012000001F000000FFE040403F8 +B3C4:0000000000001FFC100010001000100010000FFC0080008000807FFF00000000 +B3C5:000000001FFC1000100010000FFC008000807FFF00001FFC0004000400040004 +B3C6:000000001FFC1000100010000FFC008000807FFF00001F7C0104010401040104 +B3C7:000000001FFC1000100010000FFC008000807FFF00001F1001100110012801C6 +B3C8:000000001FFC1000100010000FFC008000807FFF000010001000100010000FFC +B3C9:000000001FFC1000100010000FFC008000807FFF0000107C1010101010280FC6 +B3CA:000000001FFC1000100010000FFC008000807FFF00001038100010FE10440F38 +B3CB:000000001FFC1000100010000FFC008000807FFF00001FFC1000100010000FFC +B3CC:000000001FFC1000100010000FFC008000807FFF00001FFC00041FF810000FFC +B3CD:000000001FFC1000100010000FFC008000807FFF00001F7C01041E0410040F04 +B3CE:000000001FFC1000100010000FFC008000807FFF00001F7C01441E4410440F3C +B3CF:000000001FFC1000100010000FFC008000807FFF00001F4401441E7C10440F3C +B3D0:000000001FFC1000100010000FFC008000807FFF00001F1001101E1010280FC6 +B3D1:000000001FFC1000100010000FFC008000807FFF00001F7C01401E7C10400F3C +B3D2:000000001FFC1000100010000FFC008000807FFF00001F7E01241E2410240F7E +B3D3:000000001FFC1000100010000FFC008000807FFF00001F3801001EFE10440F38 +B3D4:000000001FFC1000100010000FFC008000807FFF00001FFC1004100410040FFC +B3D5:000000001FFC1000100010000FFC008000807FFF0000100410041FFC10040FFC +B3D6:000000001FFC1000100010000FFC008000807FFF0000111011101F1011280FC6 +B3D7:000000001FFC1000100010000FFC008000807FFF00000080008001400630180C +B3D8:000000001FFC1000100010000FFC008000807FFF00000410041004100A2831C6 +B3D9:000000001FFC1000100010000FFC008000807FFF00000FF81004100410040FF8 +B3DA:000000001FFC1000100010000FFC008000807FFF00001FFC008001400630180C +B3DB:000000001FFC1000100010000FFC008000807FFF000003E000001FFC02201C1C +B3DC:000000001FFC1000100010000FFC008000807FFF00001FFC00041FFC00040004 +B3DD:000000001FFC1000100010000FFC008000807FFF00001FFC10001FF810000FFC +B3DE:000000001FFC1000100010000FFC008000807FFF00001FFC0410041004101FFC +B3DF:000000001FFC1000100010000FFC008000807FFF000003E000001FFC080807F0 +B3E0:0000000000043F84200420042004200720041F840404040404047FF400040004 +B3E1:000000003F842004200420071F84040404047FF400001FFC0004000400040004 +B3E2:000000003F842004200420071F84040404047FF400001F7C0104010401040104 +B3E3:000000003F842004200420071F84040404047FF400001F1001100110012801C6 +B3E4:000000003F842004200420071F84040404047FF4000410041000100010000FFC +B3E5:000000003F842004200420071F84040404047FF40000107C1010101010280FC6 +B3E6:000000003F842004200420071F84040404047FF400001038100010FE10440F38 +B3E7:000000003F842004200420071F84040404047FF400001FFC1000100010000FFC +B3E8:000000003F842004200420071F84040404047FF400001FFC00041FF810000FFC +B3E9:000000003F842004200420071F84040404047FF400001F7C01041E0410040F04 +B3EA:000000003F842004200420071F84040404047FF400001F7C01441E4410440F3C +B3EB:000000003F842004200420071F84040404047FF400001F4401441E7C10440F3C +B3EC:000000003F842004200420071F84040404047FF400001F1001101E1010280FC6 +B3ED:000000003F842004200420071F84040404047FF400001F7C01401E7C10400F3C +B3EE:000000003F842004200420071F84040404047FF400001F7E01241E2410240F7E +B3EF:000000003F842004200420071F84040404047FF400001F3801001EFE10440F38 +B3F0:000000003F842004200420071F84040404047FF400001FFC1004100410040FFC +B3F1:000000003F842004200420071F84040404047FF40000100410041FFC10040FFC +B3F2:000000003F842004200420071F84040404047FF40000111011101F1011280FC6 +B3F3:000000003F842004200420071F84040404047FF400000080008001400630180C +B3F4:000000003F842004200420071F84040404047FF400000410041004100A2831C6 +B3F5:000000003F842004200420071F84040404047FF400000FF81004100410040FF8 +B3F6:000000003F842004200420071F84040404047FF400001FFC008001400630180C +B3F7:000000003F842004200420071F84040404047FF4000003E000001FFC02201C1C +B3F8:000000003F842004200420071F84040404047FF400001FFC00041FFC00040004 +B3F9:000000003F842004200420071F84040404047FF400001FFC10001FF810000FFC +B3FA:000000003F842004200420071F84040404047FF400001FFC0410041004101FFC +B3FB:000000003F842004200420071F84040404047FF4000003E000001FFC080807F0 +B3FC:0000000000123F92201220122012201E20121F920412041204127FD200120012 +B3FD:000000003F9220122012201E1F92041204127FD200000FFE0002000200020002 +B3FE:000000003F9220122012201E1F92041204127FD200000FBE0082008200820082 +B3FF:000000003F9220122012201E1F92041204127FD200000F8800880088009400E3 +B400:000000003F9220122012201E1F92041204127FD20012081208000800080007FE +B401:000000003F9220122012201E1F92041204127FD20000083E08080808081407E3 +B402:000000003F9220122012201E1F92041204127FD20000081C0800087F0822079C +B403:000000003F9220122012201E1F92041204127FD200000FFE08000800080007FE +B404:000000003F9220122012201E1F92041204127FD200000FFE00020FFC080007FE +B405:000000003F9220122012201E1F92041204127FD200000FBE00820F0208020782 +B406:000000003F9220122012201E1F92041204127FD200000FBE00A20F220822079E +B407:000000003F9220122012201E1F92041204127FD200000FA200A20F3E0822079E +B408:000000003F9220122012201E1F92041204127FD200000F8800880F08081407E3 +B409:000000003F9220122012201E1F92041204127FD200000FBE00A00F3E0820079E +B40A:000000003F9220122012201E1F92041204127FD200000FBF00920F12081207BF +B40B:000000003F9220122012201E1F92041204127FD200000F9C00800F7F0822079C +B40C:000000003F9220122012201E1F92041204127FD200000FFE08020802080207FE +B40D:000000003F9220122012201E1F92041204127FD20000080208020FFE080207FE +B40E:000000003F9220122012201E1F92041204127FD20000088808880F88089407E3 +B40F:000000003F9220122012201E1F92041204127FD200000040004000A003180C06 +B410:000000003F9220122012201E1F92041204127FD20000020802080208051418E3 +B411:000000003F9220122012201E1F92041204127FD2000007FC08020802080207FC +B412:000000003F9220122012201E1F92041204127FD200000FFE004000A003180C06 +B413:000000003F9220122012201E1F92041204127FD2000001F000000FFE01100E0E +B414:000000003F9220122012201E1F92041204127FD200000FFE00020FFE00020002 +B415:000000003F9220122012201E1F92041204127FD200000FFE08000FFC080007FE +B416:000000003F9220122012201E1F92041204127FD200000FFE0208020802080FFE +B417:000000003F9220122012201E1F92041204127FD2000001F000000FFE040403F8 +B418:0000000000043F84200420042004200420041F840404040404047FF400040004 +B419:000000003F842004200420041F84040404047FF400001FFC0004000400040004 +B41A:000000003F842004200420041F84040404047FF400001F7C0104010401040104 +B41B:000000003F842004200420041F84040404047FF400001F1001100110012801C6 +B41C:000000003F842004200420041F84040404047FF4000410041000100010000FFC +B41D:000000003F842004200420041F84040404047FF40000107C1010101010280FC6 +B41E:000000003F842004200420041F84040404047FF400001038100010FE10440F38 +B41F:000000003F842004200420041F84040404047FF400001FFC1000100010000FFC +B420:000000003F842004200420041F84040404047FF400001FFC00041FF810000FFC +B421:000000003F842004200420041F84040404047FF400001F7C01041E0410040F04 +B422:000000003F842004200420041F84040404047FF400001F7C01441E4410440F3C +B423:000000003F842004200420041F84040404047FF400001F4401441E7C10440F3C +B424:000000003F842004200420041F84040404047FF400001F1001101E1010280FC6 +B425:000000003F842004200420041F84040404047FF400001F7C01401E7C10400F3C +B426:000000003F842004200420041F84040404047FF400001F7E01241E2410240F7E +B427:000000003F842004200420041F84040404047FF400001F3801001EFE10440F38 +B428:000000003F842004200420041F84040404047FF400001FFC1004100410040FFC +B429:000000003F842004200420041F84040404047FF40000100410041FFC10040FFC +B42A:000000003F842004200420041F84040404047FF40000111011101F1011280FC6 +B42B:000000003F842004200420041F84040404047FF400000080008001400630180C +B42C:000000003F842004200420041F84040404047FF400000410041004100A2831C6 +B42D:000000003F842004200420041F84040404047FF400000FF81004100410040FF8 +B42E:000000003F842004200420041F84040404047FF400001FFC008001400630180C +B42F:000000003F842004200420041F84040404047FF4000003E000001FFC02201C1C +B430:000000003F842004200420041F84040404047FF400001FFC00041FFC00040004 +B431:000000003F842004200420041F84040404047FF400001FFC10001FF810000FFC +B432:000000003F842004200420041F84040404047FF400001FFC0410041004101FFC +B433:000000003F842004200420041F84040404047FF4000003E000001FFC080807F0 +B434:0000000000001FFC100010001000100010000FFC0220022002207FFF00000000 +B435:000000001FFC1000100010000FFC022002207FFF00001FFC0004000400040004 +B436:000000001FFC1000100010000FFC022002207FFF00001F7C0104010401040104 +B437:000000001FFC1000100010000FFC022002207FFF00001F1001100110012801C6 +B438:000000001FFC1000100010000FFC022002207FFF000010001000100010000FFC +B439:000000001FFC1000100010000FFC022002207FFF0000107C1010101010280FC6 +B43A:000000001FFC1000100010000FFC022002207FFF00001038100010FE10440F38 +B43B:000000001FFC1000100010000FFC022002207FFF00001FFC1000100010000FFC +B43C:000000001FFC1000100010000FFC022002207FFF00001FFC00041FF810000FFC +B43D:000000001FFC1000100010000FFC022002207FFF00001F7C01041E0410040F04 +B43E:000000001FFC1000100010000FFC022002207FFF00001F7C01441E4410440F3C +B43F:000000001FFC1000100010000FFC022002207FFF00001F4401441E7C10440F3C +B440:000000001FFC1000100010000FFC022002207FFF00001F1001101E1010280FC6 +B441:000000001FFC1000100010000FFC022002207FFF00001F7C01401E7C10400F3C +B442:000000001FFC1000100010000FFC022002207FFF00001F7E01241E2410240F7E +B443:000000001FFC1000100010000FFC022002207FFF00001F3801001EFE10440F38 +B444:000000001FFC1000100010000FFC022002207FFF00001FFC1004100410040FFC +B445:000000001FFC1000100010000FFC022002207FFF0000100410041FFC10040FFC +B446:000000001FFC1000100010000FFC022002207FFF0000111011101F1011280FC6 +B447:000000001FFC1000100010000FFC022002207FFF00000080008001400630180C +B448:000000001FFC1000100010000FFC022002207FFF00000410041004100A2831C6 +B449:000000001FFC1000100010000FFC022002207FFF00000FF81004100410040FF8 +B44A:000000001FFC1000100010000FFC022002207FFF00001FFC008001400630180C +B44B:000000001FFC1000100010000FFC022002207FFF000003E000001FFC02201C1C +B44C:000000001FFC1000100010000FFC022002207FFF00001FFC00041FFC00040004 +B44D:000000001FFC1000100010000FFC022002207FFF00001FFC10001FF810000FFC +B44E:000000001FFC1000100010000FFC022002207FFF00001FFC0410041004101FFC +B44F:000000001FFC1000100010000FFC022002207FFF000003E000001FFC080807F0 +B450:000000001FFC1000100010000FFC000000007FFF008000800080008000800080 +B451:000000001FFC1000100010000FFC00007FFF008000801FFC0004000400040004 +B452:000000001FFC1000100010000FFC00007FFF008000801F7C0104010401040104 +B453:000000001FFC1000100010000FFC00007FFF008000801F1001100110012801C6 +B454:000000001FFC1000100010000FFC000000007FFF008010801080100010000FFC +B455:000000001FFC1000100010000FFC00007FFF00800080107C1010101010280FC6 +B456:000000001FFC1000100010000FFC00007FFF008000801038100010FE10440F38 +B457:000000001FFC1000100010000FFC00007FFF008000801FFC1000100010000FFC +B458:000000001FFC1000100010000FFC00007FFF008000801FFC00041FF810000FFC +B459:000000001FFC1000100010000FFC00007FFF008000801F7C01041E0410040F04 +B45A:000000001FFC1000100010000FFC00007FFF008000801F7C01441E4410440F3C +B45B:000000001FFC1000100010000FFC00007FFF008000801F4401441E7C10440F3C +B45C:000000001FFC1000100010000FFC00007FFF008000801F1001101E1010280FC6 +B45D:000000001FFC1000100010000FFC00007FFF008000801F7C01401E7C10400F3C +B45E:000000001FFC1000100010000FFC00007FFF008000801F7E01241E2410240F7E +B45F:000000001FFC1000100010000FFC00007FFF008000801F3801001EFE10440F38 +B460:000000001FFC1000100010000FFC00007FFF008000801FFC1004100410040FFC +B461:000000001FFC1000100010000FFC00007FFF00800080100410041FFC10040FFC +B462:000000001FFC1000100010000FFC00007FFF00800080111011101F1011280FC6 +B463:000000001FFC1000100010000FFC00007FFF008000800080008001400630180C +B464:000000001FFC1000100010000FFC00007FFF008000800410041004100A2831C6 +B465:000000001FFC1000100010000FFC00007FFF008000800FF81004100410040FF8 +B466:000000001FFC1000100010000FFC00007FFF008000801FFC008001400630180C +B467:000000001FFC1000100010000FFC00007FFF0080008003E000001FFC02201C1C +B468:000000001FFC1000100010000FFC00007FFF008000801FFC00041FFC00040004 +B469:000000001FFC1000100010000FFC00007FFF008000801FFC10001FF810000FFC +B46A:000000001FFC1000100010000FFC00007FFF008000801FFC0410041004101FFC +B46B:000000001FFC1000100010000FFC00007FFF0080008003E000001FFC080807F0 +B46C:000000003F842004200420041F84000400047FF404040404043C040404040404 +B46D:000000003F8420042004201C1F8400047FF4040404001FFC0004000400040004 +B46E:000000003F8420042004201C1F8400047FF4040404001F7C0104010401040104 +B46F:000000003F8420042004201C1F8400047FF4040404001F1001100110012801C6 +B470:000000003F842004200420041F8400047FF40404043C14041000100010000FFC +B471:000000003F8420042004201C1F8400047FF404040400107C1010101010280FC6 +B472:000000003F8420042004201C1F8400047FF4040404001038100010FE10440F38 +B473:000000003F8420042004201C1F8400047FF4040404001FFC1000100010000FFC +B474:000000003F8420042004201C1F8400047FF4040404001FFC00041FF810000FFC +B475:000000003F8420042004201C1F8400047FF4040404001F7C01041E0410040F04 +B476:000000003F8420042004201C1F8400047FF4040404001F7C01441E4410440F3C +B477:000000003F8420042004201C1F8400047FF4040404001F4401441E7C10440F3C +B478:000000003F8420042004201C1F8400047FF4040404001F1001101E1010280FC6 +B479:000000003F8420042004201C1F8400047FF4040404001F7C01401E7C10400F3C +B47A:000000003F8420042004201C1F8400047FF4040404001F7E01241E2410240F7E +B47B:000000003F8420042004201C1F8400047FF4040404001F3801001EFE10440F38 +B47C:000000003F8420042004201C1F8400047FF4040404001FFC1004100410040FFC +B47D:000000003F8420042004201C1F8400047FF404040400100410041FFC10040FFC +B47E:000000003F8420042004201C1F8400047FF404040400111011101F1011280FC6 +B47F:000000003F8420042004201C1F8400047FF4040404000080008001400630180C +B480:000000003F8420042004201C1F8400047FF4040404000410041004100A2831C6 +B481:000000003F8420042004201C1F8400047FF4040404000FF81004100410040FF8 +B482:000000003F8420042004201C1F8400047FF4040404001FFC008001400630180C +B483:000000003F8420042004201C1F8400047FF40404040003E000001FFC02201C1C +B484:000000003F8420042004201C1F8400047FF4040404001FFC00041FFC00040004 +B485:000000003F8420042004201C1F8400047FF4040404001FFC10001FF810000FFC +B486:000000003F8420042004201C1F8400047FF4040404001FFC0410041004101FFC +B487:000000003F8420042004201C1F8400047FF40404040003E000001FFC080807F0 +B488:000000003F922012201220121F92001200127FD20412041204F2041204120412 +B489:000000003F922012201220721F9200127FD2041204000FFE0002000200020002 +B48A:000000003F922012201220721F9200127FD2041204000FBE0082008200820082 +B48B:000000003F922012201220721F9200127FD2041204000F8800880088009400E3 +B48C:000000003F922012201220121F9200127FD2021202F20A1208000800080007FE +B48D:000000003F922012201220721F9200127FD204120400083E08080808081407E3 +B48E:000000003F922012201220721F9200127FD204120400081C0800087F0822079C +B48F:000000003F922012201220721F9200127FD2041204000FFE08000800080007FE +B490:000000003F922012201220721F9200127FD2041204000FFE00020FFC080007FE +B491:000000003F922012201220721F9200127FD2041204000FBE00820F0208020782 +B492:000000003F922012201220721F9200127FD2041204000FBE00A20F220822079E +B493:000000003F922012201220721F9200127FD2041204000FA200A20F3E0822079E +B494:000000003F922012201220721F9200127FD2041204000F8800880F08081407E3 +B495:000000003F922012201220721F9200127FD2041204000FBE00A00F3E0820079E +B496:000000003F922012201220721F9200127FD2041204000FBF00920F12081207BF +B497:000000003F922012201220721F9200127FD2041204000F9C00800F7F0822079C +B498:000000003F922012201220721F9200127FD2041204000FFE08020802080207FE +B499:000000003F922012201220721F9200127FD204120400080208020FFE080207FE +B49A:000000003F922012201220721F9200127FD204120400088808880F88089407E3 +B49B:000000003F922012201220721F9200127FD2041204000040004000A003180C06 +B49C:000000003F922012201220721F9200127FD204120400020802080208051418E3 +B49D:000000003F922012201220721F9200127FD20412040007FC08020802080207FC +B49E:000000003F922012201220721F9200127FD2041204000FFE004000A003180C06 +B49F:000000003F922012201220721F9200127FD20412040001F000000FFE01100E0E +B4A0:000000003F922012201220721F9200127FD2041204000FFE00020FFE00020002 +B4A1:000000003F922012201220721F9200127FD2041204000FFE08000FFC080007FE +B4A2:000000003F922012201220721F9200127FD2041204000FFE0208020802080FFE +B4A3:000000003F922012201220721F9200127FD20412040001F000000FFE040403F8 +B4A4:000000003F842004200420041F84000400047FF4040404040404040404040404 +B4A5:000000003F842004200420041F8400047FF4040404001FFC0004000400040004 +B4A6:000000003F842004200420041F8400047FF4040404001F7C0104010401040104 +B4A7:000000003F842004200420041F8400047FF4040404001F1001100110012801C6 +B4A8:000000003F842004200420041F8400047FF40404040414041000100010000FFC +B4A9:000000003F842004200420041F8400047FF404040400107C1010101010280FC6 +B4AA:000000003F842004200420041F8400047FF4040404001038100010FE10440F38 +B4AB:000000003F842004200420041F8400047FF4040404001FFC1000100010000FFC +B4AC:000000003F842004200420041F8400047FF4040404001FFC00041FF810000FFC +B4AD:000000003F842004200420041F8400047FF4040404001F7C01041E0410040F04 +B4AE:000000003F842004200420041F8400047FF4040404001F7C01441E4410440F3C +B4AF:000000003F842004200420041F8400047FF4040404001F4401441E7C10440F3C +B4B0:000000003F842004200420041F8400047FF4040404001F1001101E1010280FC6 +B4B1:000000003F842004200420041F8400047FF4040404001F7C01401E7C10400F3C +B4B2:000000003F842004200420041F8400047FF4040404001F7E01241E2410240F7E +B4B3:000000003F842004200420041F8400047FF4040404001F3801001EFE10440F38 +B4B4:000000003F842004200420041F8400047FF4040404001FFC1004100410040FFC +B4B5:000000003F842004200420041F8400047FF404040400100410041FFC10040FFC +B4B6:000000003F842004200420041F8400047FF404040400111011101F1011280FC6 +B4B7:000000003F842004200420041F8400047FF4040404000080008001400630180C +B4B8:000000003F842004200420041F8400047FF4040404000410041004100A2831C6 +B4B9:000000003F842004200420041F8400047FF4040404000FF81004100410040FF8 +B4BA:000000003F842004200420041F8400047FF4040404001FFC008001400630180C +B4BB:000000003F842004200420041F8400047FF40404040003E000001FFC02201C1C +B4BC:000000003F842004200420041F8400047FF4040404001FFC00041FFC00040004 +B4BD:000000003F842004200420041F8400047FF4040404001FFC10001FF810000FFC +B4BE:000000003F842004200420041F8400047FF4040404001FFC0410041004101FFC +B4BF:000000003F842004200420041F8400047FF40404040003E000001FFC080807F0 +B4C0:000000001FFC1000100010000FFC000000007FFF041004100410041004100410 +B4C1:000000001FFC1000100010000FFC00007FFF022002201FFC0004000400040004 +B4C2:000000001FFC1000100010000FFC00007FFF022002201F7C0104010401040104 +B4C3:000000001FFC1000100010000FFC00007FFF022002201F1001100110012801C6 +B4C4:000000001FFC1000100010000FFC000000007FFF022012201220100010000FFC +B4C5:000000001FFC1000100010000FFC00007FFF02200220107C1010101010280FC6 +B4C6:000000001FFC1000100010000FFC00007FFF022002201038100010FE10440F38 +B4C7:000000001FFC1000100010000FFC00007FFF022002201FFC1000100010000FFC +B4C8:000000001FFC1000100010000FFC00007FFF022002201FFC00041FF810000FFC +B4C9:000000001FFC1000100010000FFC00007FFF022002201F7C01041E0410040F04 +B4CA:000000001FFC1000100010000FFC00007FFF022002201F7C01441E4410440F3C +B4CB:000000001FFC1000100010000FFC00007FFF022002201F4401441E7C10440F3C +B4CC:000000001FFC1000100010000FFC00007FFF022002201F1001101E1010280FC6 +B4CD:000000001FFC1000100010000FFC00007FFF022002201F7C01401E7C10400F3C +B4CE:000000001FFC1000100010000FFC00007FFF022002201F7E01241E2410240F7E +B4CF:000000001FFC1000100010000FFC00007FFF022002201F3801001EFE10440F38 +B4D0:000000001FFC1000100010000FFC00007FFF022002201FFC1004100410040FFC +B4D1:000000001FFC1000100010000FFC00007FFF02200220100410041FFC10040FFC +B4D2:000000001FFC1000100010000FFC00007FFF02200220111011101F1011280FC6 +B4D3:000000001FFC1000100010000FFC00007FFF022002200080008001400630180C +B4D4:000000001FFC1000100010000FFC00007FFF022002200410041004100A2831C6 +B4D5:000000001FFC1000100010000FFC00007FFF022002200FF81004100410040FF8 +B4D6:000000001FFC1000100010000FFC00007FFF022002201FFC008001400630180C +B4D7:000000001FFC1000100010000FFC00007FFF0220022003E000001FFC02201C1C +B4D8:000000001FFC1000100010000FFC00007FFF022002201FFC00041FFC00040004 +B4D9:000000001FFC1000100010000FFC00007FFF022002201FFC10001FF810000FFC +B4DA:000000001FFC1000100010000FFC00007FFF022002201FFC0410041004101FFC +B4DB:000000001FFC1000100010000FFC00007FFF0220022003E000001FFC080807F0 +B4DC:0000000000001FFC100010001000100010000FFC0000000000007FFF00000000 +B4DD:000000001FFC1000100010000FFC00007FFF000000001FFC0004000400040004 +B4DE:000000001FFC1000100010000FFC00007FFF000000001F7C0104010401040104 +B4DF:000000001FFC1000100010000FFC00007FFF000000001F1001100110012801C6 +B4E0:000000001FFC1000100010000FFC000000007FFF000010001000100010000FFC +B4E1:000000001FFC1000100010000FFC00007FFF00000000107C1010101010280FC6 +B4E2:000000001FFC1000100010000FFC00007FFF000000001038100010FE10440F38 +B4E3:000000001FFC1000100010000FFC00007FFF000000001FFC1000100010000FFC +B4E4:000000001FFC1000100010000FFC00007FFF000000001FFC00041FF810000FFC +B4E5:000000001FFC1000100010000FFC00007FFF000000001F7C01041E0410040F04 +B4E6:000000001FFC1000100010000FFC00007FFF000000001F7C01441E4410440F3C +B4E7:000000001FFC1000100010000FFC00007FFF000000001F4401441E7C10440F3C +B4E8:000000001FFC1000100010000FFC00007FFF000000001F1001101E1010280FC6 +B4E9:000000001FFC1000100010000FFC00007FFF000000001F7C01401E7C10400F3C +B4EA:000000001FFC1000100010000FFC00007FFF000000001F7E01241E2410240F7E +B4EB:000000001FFC1000100010000FFC00007FFF000000001F3801001EFE10440F38 +B4EC:000000001FFC1000100010000FFC00007FFF000000001FFC1004100410040FFC +B4ED:000000001FFC1000100010000FFC00007FFF00000000100410041FFC10040FFC +B4EE:000000001FFC1000100010000FFC00007FFF00000000111011101F1011280FC6 +B4EF:000000001FFC1000100010000FFC00007FFF000000000080008001400630180C +B4F0:000000001FFC1000100010000FFC00007FFF000000000410041004100A2831C6 +B4F1:000000001FFC1000100010000FFC00007FFF000000000FF81004100410040FF8 +B4F2:000000001FFC1000100010000FFC00007FFF000000001FFC008001400630180C +B4F3:000000001FFC1000100010000FFC00007FFF0000000003E000001FFC02201C1C +B4F4:000000001FFC1000100010000FFC00007FFF000000001FFC00041FFC00040004 +B4F5:000000001FFC1000100010000FFC00007FFF000000001FFC10001FF810000FFC +B4F6:000000001FFC1000100010000FFC00007FFF000000001FFC0410041004101FFC +B4F7:000000001FFC1000100010000FFC00007FFF0000000003E000001FFC080807F0 +B4F8:0000000000043F84200420042004200420041F840004000400047FF400040004 +B4F9:000000003F842004200420041F8400047FF4000400001FFC0004000400040004 +B4FA:000000003F842004200420041F8400047FF4000400001F7C0104010401040104 +B4FB:000000003F842004200420041F8400047FF4000400001F1001100110012801C6 +B4FC:000000003F842004200420041F84000400047FF4000410041000100010000FFC +B4FD:000000003F842004200420041F8400047FF400040000107C1010101010280FC6 +B4FE:000000003F842004200420041F8400047FF4000400001038100010FE10440F38 +B4FF:000000003F842004200420041F8400047FF4000400001FFC1000100010000FFC +B500:000000003F842004200420041F8400047FF4000400001FFC00041FF810000FFC +B501:000000003F842004200420041F8400047FF4000400001F7C01041E0410040F04 +B502:000000003F842004200420041F8400047FF4000400001F7C01441E4410440F3C +B503:000000003F842004200420041F8400047FF4000400001F4401441E7C10440F3C +B504:000000003F842004200420041F8400047FF4000400001F1001101E1010280FC6 +B505:000000003F842004200420041F8400047FF4000400001F7C01401E7C10400F3C +B506:000000003F842004200420041F8400047FF4000400001F7E01241E2410240F7E +B507:000000003F842004200420041F8400047FF4000400001F3801001EFE10440F38 +B508:000000003F842004200420041F8400047FF4000400001FFC1004100410040FFC +B509:000000003F842004200420041F8400047FF400040000100410041FFC10040FFC +B50A:000000003F842004200420041F8400047FF400040000111011101F1011280FC6 +B50B:000000003F842004200420041F8400047FF4000400000080008001400630180C +B50C:000000003F842004200420041F8400047FF4000400000410041004100A2831C6 +B50D:000000003F842004200420041F8400047FF4000400000FF81004100410040FF8 +B50E:000000003F842004200420041F8400047FF4000400001FFC008001400630180C +B50F:000000003F842004200420041F8400047FF40004000003E000001FFC02201C1C +B510:000000003F842004200420041F8400047FF4000400001FFC00041FFC00040004 +B511:000000003F842004200420041F8400047FF4000400001FFC10001FF810000FFC +B512:000000003F842004200420041F8400047FF4000400001FFC0410041004101FFC +B513:000000003F842004200420041F8400047FF40004000003E000001FFC080807F0 +B514:0000000000043F84200420042004200420042004200420041F84000400040004 +B515:000000003F84200420042004200420041F84000400001FFC0004000400040004 +B516:000000003F84200420042004200420041F84000400001F7C0104010401040104 +B517:000000003F84200420042004200420041F84000400001F1001100110012801C6 +B518:000000003F84200420042004200420041F840004000410041000100010000FFC +B519:000000003F84200420042004200420041F8400040000107C1010101010280FC6 +B51A:000000003F84200420042004200420041F84000400001038100010FE10440F38 +B51B:000000003F84200420042004200420041F84000400001FFC1000100010000FFC +B51C:000000003F84200420042004200420041F84000400001FFC00041FF810000FFC +B51D:000000003F84200420042004200420041F84000400001F7C01041E0410040F04 +B51E:000000003F84200420042004200420041F84000400001F7C01441E4410440F3C +B51F:000000003F84200420042004200420041F84000400001F4401441E7C10440F3C +B520:000000003F84200420042004200420041F84000400001F1001101E1010280FC6 +B521:000000003F84200420042004200420041F84000400001F7C01401E7C10400F3C +B522:000000003F84200420042004200420041F84000400001F7E01241E2410240F7E +B523:000000003F84200420042004200420041F84000400001F3801001EFE10440F38 +B524:000000003F84200420042004200420041F84000400001FFC1004100410040FFC +B525:000000003F84200420042004200420041F8400040000100410041FFC10040FFC +B526:000000003F84200420042004200420041F8400040000111011101F1011280FC6 +B527:000000003F84200420042004200420041F84000400000080008001400630180C +B528:000000003F84200420042004200420041F84000400000410041004100A2831C6 +B529:000000003F84200420042004200420041F84000400000FF81004100410040FF8 +B52A:000000003F84200420042004200420041F84000400001FFC008001400630180C +B52B:000000003F84200420042004200420041F840004000003E000001FFC02201C1C +B52C:000000003F84200420042004200420041F84000400001FFC00041FFC00040004 +B52D:000000003F84200420042004200420041F84000400001FFC10001FF810000FFC +B52E:000000003F84200420042004200420041F84000400001FFC0410041004101FFC +B52F:000000003F84200420042004200420041F840004000003E000001FFC080807F0 +B530:0000000000043B84220422042204220722042204220422041984000400040004 +B531:000000003B84220422042207220422041984000400001FFC0004000400040004 +B532:000000003B84220422042207220422041984000400001F7C0104010401040104 +B533:000000003B84220422042207220422041984000400001F1001100110012801C6 +B534:000000003B842204220422072204220419840004000410041000100010000FFC +B535:000000003B8422042204220722042204198400040000107C1010101010280FC6 +B536:000000003B84220422042207220422041984000400001038100010FE10440F38 +B537:000000003B84220422042207220422041984000400001FFC1000100010000FFC +B538:000000003B84220422042207220422041984000400001FFC00041FF810000FFC +B539:000000003B84220422042207220422041984000400001F7C01041E0410040F04 +B53A:000000003B84220422042207220422041984000400001F7C01441E4410440F3C +B53B:000000003B84220422042207220422041984000400001F4401441E7C10440F3C +B53C:000000003B84220422042207220422041984000400001F1001101E1010280FC6 +B53D:000000003B84220422042207220422041984000400001F7C01401E7C10400F3C +B53E:000000003B84220422042207220422041984000400001F7E01241E2410240F7E +B53F:000000003B84220422042207220422041984000400001F3801001EFE10440F38 +B540:000000003B84220422042207220422041984000400001FFC1004100410040FFC +B541:000000003B8422042204220722042204198400040000100410041FFC10040FFC +B542:000000003B8422042204220722042204198400040000111011101F1011280FC6 +B543:000000003B84220422042207220422041984000400000080008001400630180C +B544:000000003B84220422042207220422041984000400000410041004100A2831C6 +B545:000000003B84220422042207220422041984000400000FF81004100410040FF8 +B546:000000003B84220422042207220422041984000400001FFC008001400630180C +B547:000000003B842204220422072204220419840004000003E000001FFC02201C1C +B548:000000003B84220422042207220422041984000400001FFC00041FFC00040004 +B549:000000003B84220422042207220422041984000400001FFC10001FF810000FFC +B54A:000000003B84220422042207220422041984000400001FFC0410041004101FFC +B54B:000000003B842204220422072204220419840004000003E000001FFC080807F0 +B54C:0000000000123B92221222122212221E22122212221222121992001200120012 +B54D:000000003B9222122212221E221222121992001200000FFE0002000200020002 +B54E:000000003B9222122212221E221222121992001200000FBE0082008200820082 +B54F:000000003B9222122212221E221222121992001200000F8800880088009400E3 +B550:000000003B9222122212221E22122212199200120012081208000800080007FE +B551:000000003B9222122212221E22122212199200120000083E08080808081407E3 +B552:000000003B9222122212221E22122212199200120000081C0800087F0822079C +B553:000000003B9222122212221E221222121992001200000FFE08000800080007FE +B554:000000003B9222122212221E221222121992001200000FFE00020FFC080007FE +B555:000000003B9222122212221E221222121992001200000FBE00820F0208020782 +B556:000000003B9222122212221E221222121992001200000FBE00A20F220822079E +B557:000000003B9222122212221E221222121992001200000FA200A20F3E0822079E +B558:000000003B9222122212221E221222121992001200000F8800880F08081407E3 +B559:000000003B9222122212221E221222121992001200000FBE00A00F3E0820079E +B55A:000000003B9222122212221E221222121992001200000FBF00920F12081207BF +B55B:000000003B9222122212221E221222121992001200000F9C00800F7F0822079C +B55C:000000003B9222122212221E221222121992001200000FFE08020802080207FE +B55D:000000003B9222122212221E22122212199200120000080208020FFE080207FE +B55E:000000003B9222122212221E22122212199200120000088808880F88089407E3 +B55F:000000003B9222122212221E221222121992001200000040004000A003180C06 +B560:000000003B9222122212221E22122212199200120000020802080208051418E3 +B561:000000003B9222122212221E2212221219920012000007FC08020802080207FC +B562:000000003B9222122212221E221222121992001200000FFE004000A003180C06 +B563:000000003B9222122212221E2212221219920012000001F000000FFE01100E0E +B564:000000003B9222122212221E221222121992001200000FFE00020FFE00020002 +B565:000000003B9222122212221E221222121992001200000FFE08000FFC080007FE +B566:000000003B9222122212221E221222121992001200000FFE0208020802080FFE +B567:000000003B9222122212221E2212221219920012000001F000000FFE040403F8 +B568:0000000000043B84220422042207220422042207220422041984000400040004 +B569:000000003B84220422072204220422071984000400001FFC0004000400040004 +B56A:000000003B84220422072204220422071984000400001F7C0104010401040104 +B56B:000000003B84220422072204220422071984000400001F1001100110012801C6 +B56C:000000003B842204220722042204220719840004000410041000100010000FFC +B56D:000000003B8422042207220422042207198400040000107C1010101010280FC6 +B56E:000000003B84220422072204220422071984000400001038100010FE10440F38 +B56F:000000003B84220422072204220422071984000400001FFC1000100010000FFC +B570:000000003B84220422072204220422071984000400001FFC00041FF810000FFC +B571:000000003B84220422072204220422071984000400001F7C01041E0410040F04 +B572:000000003B84220422072204220422071984000400001F7C01441E4410440F3C +B573:000000003B84220422072204220422071984000400001F4401441E7C10440F3C +B574:000000003B84220422072204220422071984000400001F1001101E1010280FC6 +B575:000000003B84220422072204220422071984000400001F7C01401E7C10400F3C +B576:000000003B84220422072204220422071984000400001F7E01241E2410240F7E +B577:000000003B84220422072204220422071984000400001F3801001EFE10440F38 +B578:000000003B84220422072204220422071984000400001FFC1004100410040FFC +B579:000000003B8422042207220422042207198400040000100410041FFC10040FFC +B57A:000000003B8422042207220422042207198400040000111011101F1011280FC6 +B57B:000000003B84220422072204220422071984000400000080008001400630180C +B57C:000000003B84220422072204220422071984000400000410041004100A2831C6 +B57D:000000003B84220422072204220422071984000400000FF81004100410040FF8 +B57E:000000003B84220422072204220422071984000400001FFC008001400630180C +B57F:000000003B842204220722042204220719840004000003E000001FFC02201C1C +B580:000000003B84220422072204220422071984000400001FFC00041FFC00040004 +B581:000000003B84220422072204220422071984000400001FFC10001FF810000FFC +B582:000000003B84220422072204220422071984000400001FFC0410041004101FFC +B583:000000003B842204220722042204220719840004000003E000001FFC080807F0 +B584:0000000000123B9222122212221E22122212221E221222121992001200120012 +B585:000000003B922212221E22122212221E1992001200000FFE0002000200020002 +B586:000000003B922212221E22122212221E1992001200000FBE0082008200820082 +B587:000000003B922212221E22122212221E1992001200000F8800880088009400E3 +B588:000000003B922212221E22122212221E199200120012081208000800080007FE +B589:000000003B922212221E22122212221E199200120000083E08080808081407E3 +B58A:000000003B922212221E22122212221E199200120000081C0800087F0822079C +B58B:000000003B922212221E22122212221E1992001200000FFE08000800080007FE +B58C:000000003B922212221E22122212221E1992001200000FFE00020FFC080007FE +B58D:000000003B922212221E22122212221E1992001200000FBE00820F0208020782 +B58E:000000003B922212221E22122212221E1992001200000FBE00A20F220822079E +B58F:000000003B922212221E22122212221E1992001200000FA200A20F3E0822079E +B590:000000003B922212221E22122212221E1992001200000F8800880F08081407E3 +B591:000000003B922212221E22122212221E1992001200000FBE00A00F3E0820079E +B592:000000003B922212221E22122212221E1992001200000FBF00920F12081207BF +B593:000000003B922212221E22122212221E1992001200000F9C00800F7F0822079C +B594:000000003B922212221E22122212221E1992001200000FFE08020802080207FE +B595:000000003B922212221E22122212221E199200120000080208020FFE080207FE +B596:000000003B922212221E22122212221E199200120000088808880F88089407E3 +B597:000000003B922212221E22122212221E1992001200000040004000A003180C06 +B598:000000003B922212221E22122212221E199200120000020802080208051418E3 +B599:000000003B922212221E22122212221E19920012000007FC08020802080207FC +B59A:000000003B922212221E22122212221E1992001200000FFE004000A003180C06 +B59B:000000003B922212221E22122212221E19920012000001F000000FFE01100E0E +B59C:000000003B922212221E22122212221E1992001200000FFE00020FFE00020002 +B59D:000000003B922212221E22122212221E1992001200000FFE08000FFC080007FE +B59E:000000003B922212221E22122212221E1992001200000FFE0208020802080FFE +B59F:000000003B922212221E22122212221E19920012000001F000000FFE040403F8 +B5A0:0000000000043B84220422042204223C22042204220422041984000400040004 +B5A1:000000003B8422042204223C220422041984000400001FFC0004000400040004 +B5A2:000000003B8422042204223C220422041984000400001F7C0104010401040104 +B5A3:000000003B8422042204223C220422041984000400001F1001100110012801C6 +B5A4:000000003B8422042204223C2204220419840004000410041000100010000FFC +B5A5:000000003B8422042204223C22042204198400040000107C1010101010280FC6 +B5A6:000000003B8422042204223C220422041984000400001038100010FE10440F38 +B5A7:000000003B8422042204223C220422041984000400001FFC1000100010000FFC +B5A8:000000003B8422042204223C220422041984000400001FFC00041FF810000FFC +B5A9:000000003B8422042204223C220422041984000400001F7C01041E0410040F04 +B5AA:000000003B8422042204223C220422041984000400001F7C01441E4410440F3C +B5AB:000000003B8422042204223C220422041984000400001F4401441E7C10440F3C +B5AC:000000003B8422042204223C220422041984000400001F1001101E1010280FC6 +B5AD:000000003B8422042204223C220422041984000400001F7C01401E7C10400F3C +B5AE:000000003B8422042204223C220422041984000400001F7E01241E2410240F7E +B5AF:000000003B8422042204223C220422041984000400001F3801001EFE10440F38 +B5B0:000000003B8422042204223C220422041984000400001FFC1004100410040FFC +B5B1:000000003B8422042204223C22042204198400040000100410041FFC10040FFC +B5B2:000000003B8422042204223C22042204198400040000111011101F1011280FC6 +B5B3:000000003B8422042204223C220422041984000400000080008001400630180C +B5B4:000000003B8422042204223C220422041984000400000410041004100A2831C6 +B5B5:000000003B8422042204223C220422041984000400000FF81004100410040FF8 +B5B6:000000003B8422042204223C220422041984000400001FFC008001400630180C +B5B7:000000003B8422042204223C2204220419840004000003E000001FFC02201C1C +B5B8:000000003B8422042204223C220422041984000400001FFC00041FFC00040004 +B5B9:000000003B8422042204223C220422041984000400001FFC10001FF810000FFC +B5BA:000000003B8422042204223C220422041984000400001FFC0410041004101FFC +B5BB:000000003B8422042204223C2204220419840004000003E000001FFC080807F0 +B5BC:0000000000123B92221222122212227222122212221222121992001200120012 +B5BD:000000003B92221222122272221222121992001200000FFE0002000200020002 +B5BE:000000003B92221222122272221222121992001200000FBE0082008200820082 +B5BF:000000003B92221222122272221222121992001200000F8800880088009400E3 +B5C0:000000003B9222122212227222122212199200120012081208000800080007FE +B5C1:000000003B9222122212227222122212199200120000083E08080808081407E3 +B5C2:000000003B9222122212227222122212199200120000081C0800087F0822079C +B5C3:000000003B92221222122272221222121992001200000FFE08000800080007FE +B5C4:000000003B92221222122272221222121992001200000FFE00020FFC080007FE +B5C5:000000003B92221222122272221222121992001200000FBE00820F0208020782 +B5C6:000000003B92221222122272221222121992001200000FBE00A20F220822079E +B5C7:000000003B92221222122272221222121992001200000FA200A20F3E0822079E +B5C8:000000003B92221222122272221222121992001200000F8800880F08081407E3 +B5C9:000000003B92221222122272221222121992001200000FBE00A00F3E0820079E +B5CA:000000003B92221222122272221222121992001200000FBF00920F12081207BF +B5CB:000000003B92221222122272221222121992001200000F9C00800F7F0822079C +B5CC:000000003B92221222122272221222121992001200000FFE08020802080207FE +B5CD:000000003B9222122212227222122212199200120000080208020FFE080207FE +B5CE:000000003B9222122212227222122212199200120000088808880F88089407E3 +B5CF:000000003B92221222122272221222121992001200000040004000A003180C06 +B5D0:000000003B9222122212227222122212199200120000020802080208051418E3 +B5D1:000000003B922212221222722212221219920012000007FC08020802080207FC +B5D2:000000003B92221222122272221222121992001200000FFE004000A003180C06 +B5D3:000000003B922212221222722212221219920012000001F000000FFE01100E0E +B5D4:000000003B92221222122272221222121992001200000FFE00020FFE00020002 +B5D5:000000003B92221222122272221222121992001200000FFE08000FFC080007FE +B5D6:000000003B92221222122272221222121992001200000FFE0208020802080FFE +B5D7:000000003B922212221222722212221219920012000001F000000FFE040403F8 +B5D8:0000000000043B8422042204223C22042204223C220422041984000400040004 +B5D9:000000003B842204223C22042204223C1984000400001FFC0004000400040004 +B5DA:000000003B842204223C22042204223C1984000400001F7C0104010401040104 +B5DB:000000003B842204223C22042204223C1984000400001F1001100110012801C6 +B5DC:000000003B842204223C22042204223C19840004000410041000100010000FFC +B5DD:000000003B842204223C22042204223C198400040000107C1010101010280FC6 +B5DE:000000003B842204223C22042204223C1984000400001038100010FE10440F38 +B5DF:000000003B842204223C22042204223C1984000400001FFC1000100010000FFC +B5E0:000000003B842204223C22042204223C1984000400001FFC00041FF810000FFC +B5E1:000000003B842204223C22042204223C1984000400001F7C01041E0410040F04 +B5E2:000000003B842204223C22042204223C1984000400001F7C01441E4410440F3C +B5E3:000000003B842204223C22042204223C1984000400001F4401441E7C10440F3C +B5E4:000000003B842204223C22042204223C1984000400001F1001101E1010280FC6 +B5E5:000000003B842204223C22042204223C1984000400001F7C01401E7C10400F3C +B5E6:000000003B842204223C22042204223C1984000400001F7E01241E2410240F7E +B5E7:000000003B842204223C22042204223C1984000400001F3801001EFE10440F38 +B5E8:000000003B842204223C22042204223C1984000400001FFC1004100410040FFC +B5E9:000000003B842204223C22042204223C198400040000100410041FFC10040FFC +B5EA:000000003B842204223C22042204223C198400040000111011101F1011280FC6 +B5EB:000000003B842204223C22042204223C1984000400000080008001400630180C +B5EC:000000003B842204223C22042204223C1984000400000410041004100A2831C6 +B5ED:000000003B842204223C22042204223C1984000400000FF81004100410040FF8 +B5EE:000000003B842204223C22042204223C1984000400001FFC008001400630180C +B5EF:000000003B842204223C22042204223C19840004000003E000001FFC02201C1C +B5F0:000000003B842204223C22042204223C1984000400001FFC00041FFC00040004 +B5F1:000000003B842204223C22042204223C1984000400001FFC10001FF810000FFC +B5F2:000000003B842204223C22042204223C1984000400001FFC0410041004101FFC +B5F3:000000003B842204223C22042204223C19840004000003E000001FFC080807F0 +B5F4:0000000000123B92221222122272221222122272221222121992001200120012 +B5F5:000000003B92221222722212221222721992001200000FFE0002000200020002 +B5F6:000000003B92221222722212221222721992001200000FBE0082008200820082 +B5F7:000000003B92221222722212221222721992001200000F8800880088009400E3 +B5F8:000000003B9222122272221222122272199200120012081208000800080007FE +B5F9:000000003B9222122272221222122272199200120000083E08080808081407E3 +B5FA:000000003B9222122272221222122272199200120000081C0800087F0822079C +B5FB:000000003B92221222722212221222721992001200000FFE08000800080007FE +B5FC:000000003B92221222722212221222721992001200000FFE00020FFC080007FE +B5FD:000000003B92221222722212221222721992001200000FBE00820F0208020782 +B5FE:000000003B92221222722212221222721992001200000FBE00A20F220822079E +B5FF:000000003B92221222722212221222721992001200000FA200A20F3E0822079E +B600:000000003B92221222722212221222721992001200000F8800880F08081407E3 +B601:000000003B92221222722212221222721992001200000FBE00A00F3E0820079E +B602:000000003B92221222722212221222721992001200000FBF00920F12081207BF +B603:000000003B92221222722212221222721992001200000F9C00800F7F0822079C +B604:000000003B92221222722212221222721992001200000FFE08020802080207FE +B605:000000003B9222122272221222122272199200120000080208020FFE080207FE +B606:000000003B9222122272221222122272199200120000088808880F88089407E3 +B607:000000003B92221222722212221222721992001200000040004000A003180C06 +B608:000000003B9222122272221222122272199200120000020802080208051418E3 +B609:000000003B922212227222122212227219920012000007FC08020802080207FC +B60A:000000003B92221222722212221222721992001200000FFE004000A003180C06 +B60B:000000003B922212227222122212227219920012000001F000000FFE01100E0E +B60C:000000003B92221222722212221222721992001200000FFE00020FFE00020002 +B60D:000000003B92221222722212221222721992001200000FFE08000FFC080007FE +B60E:000000003B92221222722212221222721992001200000FFE0208020802080FFE +B60F:000000003B922212227222122212227219920012000001F000000FFE040403F8 +B610:0000000000001F7C104010401040104010400F3C0080008000807FFF00000000 +B611:000000001F7C1040104010400F3C008000807FFF00001FFC0004000400040004 +B612:000000001F7C1040104010400F3C008000807FFF00001F7C0104010401040104 +B613:000000001F7C1040104010400F3C008000807FFF00001F1001100110012801C6 +B614:000000001F7C1040104010400F3C008000807FFF000010001000100010000FFC +B615:000000001F7C1040104010400F3C008000807FFF0000107C1010101010280FC6 +B616:000000001F7C1040104010400F3C008000807FFF00001038100010FE10440F38 +B617:000000001F7C1040104010400F3C008000807FFF00001FFC1000100010000FFC +B618:000000001F7C1040104010400F3C008000807FFF00001FFC00041FF810000FFC +B619:000000001F7C1040104010400F3C008000807FFF00001F7C01041E0410040F04 +B61A:000000001F7C1040104010400F3C008000807FFF00001F7C01441E4410440F3C +B61B:000000001F7C1040104010400F3C008000807FFF00001F4401441E7C10440F3C +B61C:000000001F7C1040104010400F3C008000807FFF00001F1001101E1010280FC6 +B61D:000000001F7C1040104010400F3C008000807FFF00001F7C01401E7C10400F3C +B61E:000000001F7C1040104010400F3C008000807FFF00001F7E01241E2410240F7E +B61F:000000001F7C1040104010400F3C008000807FFF00001F3801001EFE10440F38 +B620:000000001F7C1040104010400F3C008000807FFF00001FFC1004100410040FFC +B621:000000001F7C1040104010400F3C008000807FFF0000100410041FFC10040FFC +B622:000000001F7C1040104010400F3C008000807FFF0000111011101F1011280FC6 +B623:000000001F7C1040104010400F3C008000807FFF00000080008001400630180C +B624:000000001F7C1040104010400F3C008000807FFF00000410041004100A2831C6 +B625:000000001F7C1040104010400F3C008000807FFF00000FF81004100410040FF8 +B626:000000001F7C1040104010400F3C008000807FFF00001FFC008001400630180C +B627:000000001F7C1040104010400F3C008000807FFF000003E000001FFC02201C1C +B628:000000001F7C1040104010400F3C008000807FFF00001FFC00041FFC00040004 +B629:000000001F7C1040104010400F3C008000807FFF00001FFC10001FF810000FFC +B62A:000000001F7C1040104010400F3C008000807FFF00001FFC0410041004101FFC +B62B:000000001F7C1040104010400F3C008000807FFF000003E000001FFC080807F0 +B62C:0000000000043B842204220422042207220419840404040404047FF400040004 +B62D:000000003B842204220422071984040404047FF400001FFC0004000400040004 +B62E:000000003B842204220422071984040404047FF400001F7C0104010401040104 +B62F:000000003B842204220422071984040404047FF400001F1001100110012801C6 +B630:000000003B842204220422071984040404047FF4000410041000100010000FFC +B631:000000003B842204220422071984040404047FF40000107C1010101010280FC6 +B632:000000003B842204220422071984040404047FF400001038100010FE10440F38 +B633:000000003B842204220422071984040404047FF400001FFC1000100010000FFC +B634:000000003B842204220422071984040404047FF400001FFC00041FF810000FFC +B635:000000003B842204220422071984040404047FF400001F7C01041E0410040F04 +B636:000000003B842204220422071984040404047FF400001F7C01441E4410440F3C +B637:000000003B842204220422071984040404047FF400001F4401441E7C10440F3C +B638:000000003B842204220422071984040404047FF400001F1001101E1010280FC6 +B639:000000003B842204220422071984040404047FF400001F7C01401E7C10400F3C +B63A:000000003B842204220422071984040404047FF400001F7E01241E2410240F7E +B63B:000000003B842204220422071984040404047FF400001F3801001EFE10440F38 +B63C:000000003B842204220422071984040404047FF400001FFC1004100410040FFC +B63D:000000003B842204220422071984040404047FF40000100410041FFC10040FFC +B63E:000000003B842204220422071984040404047FF40000111011101F1011280FC6 +B63F:000000003B842204220422071984040404047FF400000080008001400630180C +B640:000000003B842204220422071984040404047FF400000410041004100A2831C6 +B641:000000003B842204220422071984040404047FF400000FF81004100410040FF8 +B642:000000003B842204220422071984040404047FF400001FFC008001400630180C +B643:000000003B842204220422071984040404047FF4000003E000001FFC02201C1C +B644:000000003B842204220422071984040404047FF400001FFC00041FFC00040004 +B645:000000003B842204220422071984040404047FF400001FFC10001FF810000FFC +B646:000000003B842204220422071984040404047FF400001FFC0410041004101FFC +B647:000000003B842204220422071984040404047FF4000003E000001FFC080807F0 +B648:0000000000123B92221222122212221E221219920412041204127FD200120012 +B649:000000003B9222122212221E1992041204127FD200000FFE0002000200020002 +B64A:000000003B9222122212221E1992041204127FD200000FBE0082008200820082 +B64B:000000003B9222122212221E1992041204127FD200000F8800880088009400E3 +B64C:000000003B9222122212221E1992041204127FD20012081208000800080007FE +B64D:000000003B9222122212221E1992041204127FD20000083E08080808081407E3 +B64E:000000003B9222122212221E1992041204127FD20000081C0800087F0822079C +B64F:000000003B9222122212221E1992041204127FD200000FFE08000800080007FE +B650:000000003B9222122212221E1992041204127FD200000FFE00020FFC080007FE +B651:000000003B9222122212221E1992041204127FD200000FBE00820F0208020782 +B652:000000003B9222122212221E1992041204127FD200000FBE00A20F220822079E +B653:000000003B9222122212221E1992041204127FD200000FA200A20F3E0822079E +B654:000000003B9222122212221E1992041204127FD200000F8800880F08081407E3 +B655:000000003B9222122212221E1992041204127FD200000FBE00A00F3E0820079E +B656:000000003B9222122212221E1992041204127FD200000FBF00920F12081207BF +B657:000000003B9222122212221E1992041204127FD200000F9C00800F7F0822079C +B658:000000003B9222122212221E1992041204127FD200000FFE08020802080207FE +B659:000000003B9222122212221E1992041204127FD20000080208020FFE080207FE +B65A:000000003B9222122212221E1992041204127FD20000088808880F88089407E3 +B65B:000000003B9222122212221E1992041204127FD200000040004000A003180C06 +B65C:000000003B9222122212221E1992041204127FD20000020802080208051418E3 +B65D:000000003B9222122212221E1992041204127FD2000007FC08020802080207FC +B65E:000000003B9222122212221E1992041204127FD200000FFE004000A003180C06 +B65F:000000003B9222122212221E1992041204127FD2000001F000000FFE01100E0E +B660:000000003B9222122212221E1992041204127FD200000FFE00020FFE00020002 +B661:000000003B9222122212221E1992041204127FD200000FFE08000FFC080007FE +B662:000000003B9222122212221E1992041204127FD200000FFE0208020802080FFE +B663:000000003B9222122212221E1992041204127FD2000001F000000FFE040403F8 +B664:0000000000043B842204220422042204220419840404040404047FF400040004 +B665:000000003B842204220422041984040404047FF400001FFC0004000400040004 +B666:000000003B842204220422041984040404047FF400001F7C0104010401040104 +B667:000000003B842204220422041984040404047FF400001F1001100110012801C6 +B668:000000003B842204220422041984040404047FF4000410041000100010000FFC +B669:000000003B842204220422041984040404047FF40000107C1010101010280FC6 +B66A:000000003B842204220422041984040404047FF400001038100010FE10440F38 +B66B:000000003B842204220422041984040404047FF400001FFC1000100010000FFC +B66C:000000003B842204220422041984040404047FF400001FFC00041FF810000FFC +B66D:000000003B842204220422041984040404047FF400001F7C01041E0410040F04 +B66E:000000003B842204220422041984040404047FF400001F7C01441E4410440F3C +B66F:000000003B842204220422041984040404047FF400001F4401441E7C10440F3C +B670:000000003B842204220422041984040404047FF400001F1001101E1010280FC6 +B671:000000003B842204220422041984040404047FF400001F7C01401E7C10400F3C +B672:000000003B842204220422041984040404047FF400001F7E01241E2410240F7E +B673:000000003B842204220422041984040404047FF400001F3801001EFE10440F38 +B674:000000003B842204220422041984040404047FF400001FFC1004100410040FFC +B675:000000003B842204220422041984040404047FF40000100410041FFC10040FFC +B676:000000003B842204220422041984040404047FF40000111011101F1011280FC6 +B677:000000003B842204220422041984040404047FF400000080008001400630180C +B678:000000003B842204220422041984040404047FF400000410041004100A2831C6 +B679:000000003B842204220422041984040404047FF400000FF81004100410040FF8 +B67A:000000003B842204220422041984040404047FF400001FFC008001400630180C +B67B:000000003B842204220422041984040404047FF4000003E000001FFC02201C1C +B67C:000000003B842204220422041984040404047FF400001FFC00041FFC00040004 +B67D:000000003B842204220422041984040404047FF400001FFC10001FF810000FFC +B67E:000000003B842204220422041984040404047FF400001FFC0410041004101FFC +B67F:000000003B842204220422041984040404047FF4000003E000001FFC080807F0 +B680:0000000000001F7C104010401040104010400F3C0220022002207FFF00000000 +B681:000000001F7C1040104010400F3C022002207FFF00001FFC0004000400040004 +B682:000000001F7C1040104010400F3C022002207FFF00001F7C0104010401040104 +B683:000000001F7C1040104010400F3C022002207FFF00001F1001100110012801C6 +B684:000000001F7C1040104010400F3C022002207FFF000010001000100010000FFC +B685:000000001F7C1040104010400F3C022002207FFF0000107C1010101010280FC6 +B686:000000001F7C1040104010400F3C022002207FFF00001038100010FE10440F38 +B687:000000001F7C1040104010400F3C022002207FFF00001FFC1000100010000FFC +B688:000000001F7C1040104010400F3C022002207FFF00001FFC00041FF810000FFC +B689:000000001F7C1040104010400F3C022002207FFF00001F7C01041E0410040F04 +B68A:000000001F7C1040104010400F3C022002207FFF00001F7C01441E4410440F3C +B68B:000000001F7C1040104010400F3C022002207FFF00001F4401441E7C10440F3C +B68C:000000001F7C1040104010400F3C022002207FFF00001F1001101E1010280FC6 +B68D:000000001F7C1040104010400F3C022002207FFF00001F7C01401E7C10400F3C +B68E:000000001F7C1040104010400F3C022002207FFF00001F7E01241E2410240F7E +B68F:000000001F7C1040104010400F3C022002207FFF00001F3801001EFE10440F38 +B690:000000001F7C1040104010400F3C022002207FFF00001FFC1004100410040FFC +B691:000000001F7C1040104010400F3C022002207FFF0000100410041FFC10040FFC +B692:000000001F7C1040104010400F3C022002207FFF0000111011101F1011280FC6 +B693:000000001F7C1040104010400F3C022002207FFF00000080008001400630180C +B694:000000001F7C1040104010400F3C022002207FFF00000410041004100A2831C6 +B695:000000001F7C1040104010400F3C022002207FFF00000FF81004100410040FF8 +B696:000000001F7C1040104010400F3C022002207FFF00001FFC008001400630180C +B697:000000001F7C1040104010400F3C022002207FFF000003E000001FFC02201C1C +B698:000000001F7C1040104010400F3C022002207FFF00001FFC00041FFC00040004 +B699:000000001F7C1040104010400F3C022002207FFF00001FFC10001FF810000FFC +B69A:000000001F7C1040104010400F3C022002207FFF00001FFC0410041004101FFC +B69B:000000001F7C1040104010400F3C022002207FFF000003E000001FFC080807F0 +B69C:000000001F7C1040104010400F3C000000007FFF008000800080008000800080 +B69D:000000001F7C1040104010400F3C00007FFF008000801FFC0004000400040004 +B69E:000000001F7C1040104010400F3C00007FFF008000801F7C0104010401040104 +B69F:000000001F7C1040104010400F3C00007FFF008000801F1001100110012801C6 +B6A0:000000001F7C1040104010400F3C000000007FFF008010801080100010000FFC +B6A1:000000001F7C1040104010400F3C00007FFF00800080107C1010101010280FC6 +B6A2:000000001F7C1040104010400F3C00007FFF008000801038100010FE10440F38 +B6A3:000000001F7C1040104010400F3C00007FFF008000801FFC1000100010000FFC +B6A4:000000001F7C1040104010400F3C00007FFF008000801FFC00041FF810000FFC +B6A5:000000001F7C1040104010400F3C00007FFF008000801F7C01041E0410040F04 +B6A6:000000001F7C1040104010400F3C00007FFF008000801F7C01441E4410440F3C +B6A7:000000001F7C1040104010400F3C00007FFF008000801F4401441E7C10440F3C +B6A8:000000001F7C1040104010400F3C00007FFF008000801F1001101E1010280FC6 +B6A9:000000001F7C1040104010400F3C00007FFF008000801F7C01401E7C10400F3C +B6AA:000000001F7C1040104010400F3C00007FFF008000801F7E01241E2410240F7E +B6AB:000000001F7C1040104010400F3C00007FFF008000801F3801001EFE10440F38 +B6AC:000000001F7C1040104010400F3C00007FFF008000801FFC1004100410040FFC +B6AD:000000001F7C1040104010400F3C00007FFF00800080100410041FFC10040FFC +B6AE:000000001F7C1040104010400F3C00007FFF00800080111011101F1011280FC6 +B6AF:000000001F7C1040104010400F3C00007FFF008000800080008001400630180C +B6B0:000000001F7C1040104010400F3C00007FFF008000800410041004100A2831C6 +B6B1:000000001F7C1040104010400F3C00007FFF008000800FF81004100410040FF8 +B6B2:000000001F7C1040104010400F3C00007FFF008000801FFC008001400630180C +B6B3:000000001F7C1040104010400F3C00007FFF0080008003E000001FFC02201C1C +B6B4:000000001F7C1040104010400F3C00007FFF008000801FFC00041FFC00040004 +B6B5:000000001F7C1040104010400F3C00007FFF008000801FFC10001FF810000FFC +B6B6:000000001F7C1040104010400F3C00007FFF008000801FFC0410041004101FFC +B6B7:000000001F7C1040104010400F3C00007FFF0080008003E000001FFC080807F0 +B6B8:000000003B842204220422041984000400047FF404040404043C040404040404 +B6B9:000000003B8422042204221C198400047FF4040404001FFC0004000400040004 +B6BA:000000003B8422042204221C198400047FF4040404001F7C0104010401040104 +B6BB:000000003B8422042204221C198400047FF4040404001F1001100110012801C6 +B6BC:000000003B84220422042204198400047FF40404043C14041000100010000FFC +B6BD:000000003B8422042204221C198400047FF404040400107C1010101010280FC6 +B6BE:000000003B8422042204221C198400047FF4040404001038100010FE10440F38 +B6BF:000000003B8422042204221C198400047FF4040404001FFC1000100010000FFC +B6C0:000000003B8422042204221C198400047FF4040404001FFC00041FF810000FFC +B6C1:000000003B8422042204221C198400047FF4040404001F7C01041E0410040F04 +B6C2:000000003B8422042204221C198400047FF4040404001F7C01441E4410440F3C +B6C3:000000003B8422042204221C198400047FF4040404001F4401441E7C10440F3C +B6C4:000000003B8422042204221C198400047FF4040404001F1001101E1010280FC6 +B6C5:000000003B8422042204221C198400047FF4040404001F7C01401E7C10400F3C +B6C6:000000003B8422042204221C198400047FF4040404001F7E01241E2410240F7E +B6C7:000000003B8422042204221C198400047FF4040404001F3801001EFE10440F38 +B6C8:000000003B8422042204221C198400047FF4040404001FFC1004100410040FFC +B6C9:000000003B8422042204221C198400047FF404040400100410041FFC10040FFC +B6CA:000000003B8422042204221C198400047FF404040400111011101F1011280FC6 +B6CB:000000003B8422042204221C198400047FF4040404000080008001400630180C +B6CC:000000003B8422042204221C198400047FF4040404000410041004100A2831C6 +B6CD:000000003B8422042204221C198400047FF4040404000FF81004100410040FF8 +B6CE:000000003B8422042204221C198400047FF4040404001FFC008001400630180C +B6CF:000000003B8422042204221C198400047FF40404040003E000001FFC02201C1C +B6D0:000000003B8422042204221C198400047FF4040404001FFC00041FFC00040004 +B6D1:000000003B8422042204221C198400047FF4040404001FFC10001FF810000FFC +B6D2:000000003B8422042204221C198400047FF4040404001FFC0410041004101FFC +B6D3:000000003B8422042204221C198400047FF40404040003E000001FFC080807F0 +B6D4:000000003B922212221222121992001200127FD20412041204F2041204120412 +B6D5:000000003B92221222122272199200127FD2041204000FFE0002000200020002 +B6D6:000000003B92221222122272199200127FD2041204000FBE0082008200820082 +B6D7:000000003B92221222122272199200127FD2041204000F8800880088009400E3 +B6D8:000000003B92221222122212199200127FD2021202F20A1208000800080007FE +B6D9:000000003B92221222122272199200127FD204120400083E08080808081407E3 +B6DA:000000003B92221222122272199200127FD204120400081C0800087F0822079C +B6DB:000000003B92221222122272199200127FD2041204000FFE08000800080007FE +B6DC:000000003B92221222122272199200127FD2041204000FFE00020FFC080007FE +B6DD:000000003B92221222122272199200127FD2041204000FBE00820F0208020782 +B6DE:000000003B92221222122272199200127FD2041204000FBE00A20F220822079E +B6DF:000000003B92221222122272199200127FD2041204000FA200A20F3E0822079E +B6E0:000000003B92221222122272199200127FD2041204000F8800880F08081407E3 +B6E1:000000003B92221222122272199200127FD2041204000FBE00A00F3E0820079E +B6E2:000000003B92221222122272199200127FD2041204000FBF00920F12081207BF +B6E3:000000003B92221222122272199200127FD2041204000F9C00800F7F0822079C +B6E4:000000003B92221222122272199200127FD2041204000FFE08020802080207FE +B6E5:000000003B92221222122272199200127FD204120400080208020FFE080207FE +B6E6:000000003B92221222122272199200127FD204120400088808880F88089407E3 +B6E7:000000003B92221222122272199200127FD2041204000040004000A003180C06 +B6E8:000000003B92221222122272199200127FD204120400020802080208051418E3 +B6E9:000000003B92221222122272199200127FD20412040007FC08020802080207FC +B6EA:000000003B92221222122272199200127FD2041204000FFE004000A003180C06 +B6EB:000000003B92221222122272199200127FD20412040001F000000FFE01100E0E +B6EC:000000003B92221222122272199200127FD2041204000FFE00020FFE00020002 +B6ED:000000003B92221222122272199200127FD2041204000FFE08000FFC080007FE +B6EE:000000003B92221222122272199200127FD2041204000FFE0208020802080FFE +B6EF:000000003B92221222122272199200127FD20412040001F000000FFE040403F8 +B6F0:000000003B842204220422041984000400047FF4040404040404040404040404 +B6F1:000000003B84220422042204198400047FF4040404001FFC0004000400040004 +B6F2:000000003B84220422042204198400047FF4040404001F7C0104010401040104 +B6F3:000000003B84220422042204198400047FF4040404001F1001100110012801C6 +B6F4:000000003B84220422042204198400047FF40404040414041000100010000FFC +B6F5:000000003B84220422042204198400047FF404040400107C1010101010280FC6 +B6F6:000000003B84220422042204198400047FF4040404001038100010FE10440F38 +B6F7:000000003B84220422042204198400047FF4040404001FFC1000100010000FFC +B6F8:000000003B84220422042204198400047FF4040404001FFC00041FF810000FFC +B6F9:000000003B84220422042204198400047FF4040404001F7C01041E0410040F04 +B6FA:000000003B84220422042204198400047FF4040404001F7C01441E4410440F3C +B6FB:000000003B84220422042204198400047FF4040404001F4401441E7C10440F3C +B6FC:000000003B84220422042204198400047FF4040404001F1001101E1010280FC6 +B6FD:000000003B84220422042204198400047FF4040404001F7C01401E7C10400F3C +B6FE:000000003B84220422042204198400047FF4040404001F7E01241E2410240F7E +B6FF:000000003B84220422042204198400047FF4040404001F3801001EFE10440F38 +B700:000000003B84220422042204198400047FF4040404001FFC1004100410040FFC +B701:000000003B84220422042204198400047FF404040400100410041FFC10040FFC +B702:000000003B84220422042204198400047FF404040400111011101F1011280FC6 +B703:000000003B84220422042204198400047FF4040404000080008001400630180C +B704:000000003B84220422042204198400047FF4040404000410041004100A2831C6 +B705:000000003B84220422042204198400047FF4040404000FF81004100410040FF8 +B706:000000003B84220422042204198400047FF4040404001FFC008001400630180C +B707:000000003B84220422042204198400047FF40404040003E000001FFC02201C1C +B708:000000003B84220422042204198400047FF4040404001FFC00041FFC00040004 +B709:000000003B84220422042204198400047FF4040404001FFC10001FF810000FFC +B70A:000000003B84220422042204198400047FF4040404001FFC0410041004101FFC +B70B:000000003B84220422042204198400047FF40404040003E000001FFC080807F0 +B70C:000000001F7C1040104010400F3C000000007FFF041004100410041004100410 +B70D:000000001F7C1040104010400F3C00007FFF022002201FFC0004000400040004 +B70E:000000001F7C1040104010400F3C00007FFF022002201F7C0104010401040104 +B70F:000000001F7C1040104010400F3C00007FFF022002201F1001100110012801C6 +B710:000000001F7C1040104010400F3C000000007FFF022012201220100010000FFC +B711:000000001F7C1040104010400F3C00007FFF02200220107C1010101010280FC6 +B712:000000001F7C1040104010400F3C00007FFF022002201038100010FE10440F38 +B713:000000001F7C1040104010400F3C00007FFF022002201FFC1000100010000FFC +B714:000000001F7C1040104010400F3C00007FFF022002201FFC00041FF810000FFC +B715:000000001F7C1040104010400F3C00007FFF022002201F7C01041E0410040F04 +B716:000000001F7C1040104010400F3C00007FFF022002201F7C01441E4410440F3C +B717:000000001F7C1040104010400F3C00007FFF022002201F4401441E7C10440F3C +B718:000000001F7C1040104010400F3C00007FFF022002201F1001101E1010280FC6 +B719:000000001F7C1040104010400F3C00007FFF022002201F7C01401E7C10400F3C +B71A:000000001F7C1040104010400F3C00007FFF022002201F7E01241E2410240F7E +B71B:000000001F7C1040104010400F3C00007FFF022002201F3801001EFE10440F38 +B71C:000000001F7C1040104010400F3C00007FFF022002201FFC1004100410040FFC +B71D:000000001F7C1040104010400F3C00007FFF02200220100410041FFC10040FFC +B71E:000000001F7C1040104010400F3C00007FFF02200220111011101F1011280FC6 +B71F:000000001F7C1040104010400F3C00007FFF022002200080008001400630180C +B720:000000001F7C1040104010400F3C00007FFF022002200410041004100A2831C6 +B721:000000001F7C1040104010400F3C00007FFF022002200FF81004100410040FF8 +B722:000000001F7C1040104010400F3C00007FFF022002201FFC008001400630180C +B723:000000001F7C1040104010400F3C00007FFF0220022003E000001FFC02201C1C +B724:000000001F7C1040104010400F3C00007FFF022002201FFC00041FFC00040004 +B725:000000001F7C1040104010400F3C00007FFF022002201FFC10001FF810000FFC +B726:000000001F7C1040104010400F3C00007FFF022002201FFC0410041004101FFC +B727:000000001F7C1040104010400F3C00007FFF0220022003E000001FFC080807F0 +B728:0000000000001F7C104010401040104010400F3C0000000000007FFF00000000 +B729:000000001F7C1040104010400F3C00007FFF000000001FFC0004000400040004 +B72A:000000001F7C1040104010400F3C00007FFF000000001F7C0104010401040104 +B72B:000000001F7C1040104010400F3C00007FFF000000001F1001100110012801C6 +B72C:000000001F7C1040104010400F3C000000007FFF000010001000100010000FFC +B72D:000000001F7C1040104010400F3C00007FFF00000000107C1010101010280FC6 +B72E:000000001F7C1040104010400F3C00007FFF000000001038100010FE10440F38 +B72F:000000001F7C1040104010400F3C00007FFF000000001FFC1000100010000FFC +B730:000000001F7C1040104010400F3C00007FFF000000001FFC00041FF810000FFC +B731:000000001F7C1040104010400F3C00007FFF000000001F7C01041E0410040F04 +B732:000000001F7C1040104010400F3C00007FFF000000001F7C01441E4410440F3C +B733:000000001F7C1040104010400F3C00007FFF000000001F4401441E7C10440F3C +B734:000000001F7C1040104010400F3C00007FFF000000001F1001101E1010280FC6 +B735:000000001F7C1040104010400F3C00007FFF000000001F7C01401E7C10400F3C +B736:000000001F7C1040104010400F3C00007FFF000000001F7E01241E2410240F7E +B737:000000001F7C1040104010400F3C00007FFF000000001F3801001EFE10440F38 +B738:000000001F7C1040104010400F3C00007FFF000000001FFC1004100410040FFC +B739:000000001F7C1040104010400F3C00007FFF00000000100410041FFC10040FFC +B73A:000000001F7C1040104010400F3C00007FFF00000000111011101F1011280FC6 +B73B:000000001F7C1040104010400F3C00007FFF000000000080008001400630180C +B73C:000000001F7C1040104010400F3C00007FFF000000000410041004100A2831C6 +B73D:000000001F7C1040104010400F3C00007FFF000000000FF81004100410040FF8 +B73E:000000001F7C1040104010400F3C00007FFF000000001FFC008001400630180C +B73F:000000001F7C1040104010400F3C00007FFF0000000003E000001FFC02201C1C +B740:000000001F7C1040104010400F3C00007FFF000000001FFC00041FFC00040004 +B741:000000001F7C1040104010400F3C00007FFF000000001FFC10001FF810000FFC +B742:000000001F7C1040104010400F3C00007FFF000000001FFC0410041004101FFC +B743:000000001F7C1040104010400F3C00007FFF0000000003E000001FFC080807F0 +B744:0000000000043B842204220422042204220419840004000400047FF400040004 +B745:000000003B84220422042204198400047FF4000400001FFC0004000400040004 +B746:000000003B84220422042204198400047FF4000400001F7C0104010401040104 +B747:000000003B84220422042204198400047FF4000400001F1001100110012801C6 +B748:000000003B842204220422041984000400047FF4000410041000100010000FFC +B749:000000003B84220422042204198400047FF400040000107C1010101010280FC6 +B74A:000000003B84220422042204198400047FF4000400001038100010FE10440F38 +B74B:000000003B84220422042204198400047FF4000400001FFC1000100010000FFC +B74C:000000003B84220422042204198400047FF4000400001FFC00041FF810000FFC +B74D:000000003B84220422042204198400047FF4000400001F7C01041E0410040F04 +B74E:000000003B84220422042204198400047FF4000400001F7C01441E4410440F3C +B74F:000000003B84220422042204198400047FF4000400001F4401441E7C10440F3C +B750:000000003B84220422042204198400047FF4000400001F1001101E1010280FC6 +B751:000000003B84220422042204198400047FF4000400001F7C01401E7C10400F3C +B752:000000003B84220422042204198400047FF4000400001F7E01241E2410240F7E +B753:000000003B84220422042204198400047FF4000400001F3801001EFE10440F38 +B754:000000003B84220422042204198400047FF4000400001FFC1004100410040FFC +B755:000000003B84220422042204198400047FF400040000100410041FFC10040FFC +B756:000000003B84220422042204198400047FF400040000111011101F1011280FC6 +B757:000000003B84220422042204198400047FF4000400000080008001400630180C +B758:000000003B84220422042204198400047FF4000400000410041004100A2831C6 +B759:000000003B84220422042204198400047FF4000400000FF81004100410040FF8 +B75A:000000003B84220422042204198400047FF4000400001FFC008001400630180C +B75B:000000003B84220422042204198400047FF40004000003E000001FFC02201C1C +B75C:000000003B84220422042204198400047FF4000400001FFC00041FFC00040004 +B75D:000000003B84220422042204198400047FF4000400001FFC10001FF810000FFC +B75E:000000003B84220422042204198400047FF4000400001FFC0410041004101FFC +B75F:000000003B84220422042204198400047FF40004000003E000001FFC080807F0 +B760:0000000000043B84220422042204220422042204220422041984000400040004 +B761:000000003B84220422042204220422041984000400001FFC0004000400040004 +B762:000000003B84220422042204220422041984000400001F7C0104010401040104 +B763:000000003B84220422042204220422041984000400001F1001100110012801C6 +B764:000000003B842204220422042204220419840004000410041000100010000FFC +B765:000000003B8422042204220422042204198400040000107C1010101010280FC6 +B766:000000003B84220422042204220422041984000400001038100010FE10440F38 +B767:000000003B84220422042204220422041984000400001FFC1000100010000FFC +B768:000000003B84220422042204220422041984000400001FFC00041FF810000FFC +B769:000000003B84220422042204220422041984000400001F7C01041E0410040F04 +B76A:000000003B84220422042204220422041984000400001F7C01441E4410440F3C +B76B:000000003B84220422042204220422041984000400001F4401441E7C10440F3C +B76C:000000003B84220422042204220422041984000400001F1001101E1010280FC6 +B76D:000000003B84220422042204220422041984000400001F7C01401E7C10400F3C +B76E:000000003B84220422042204220422041984000400001F7E01241E2410240F7E +B76F:000000003B84220422042204220422041984000400001F3801001EFE10440F38 +B770:000000003B84220422042204220422041984000400001FFC1004100410040FFC +B771:000000003B8422042204220422042204198400040000100410041FFC10040FFC +B772:000000003B8422042204220422042204198400040000111011101F1011280FC6 +B773:000000003B84220422042204220422041984000400000080008001400630180C +B774:000000003B84220422042204220422041984000400000410041004100A2831C6 +B775:000000003B84220422042204220422041984000400000FF81004100410040FF8 +B776:000000003B84220422042204220422041984000400001FFC008001400630180C +B777:000000003B842204220422042204220419840004000003E000001FFC02201C1C +B778:000000003B84220422042204220422041984000400001FFC00041FFC00040004 +B779:000000003B84220422042204220422041984000400001FFC10001FF810000FFC +B77A:000000003B84220422042204220422041984000400001FFC0410041004101FFC +B77B:000000003B842204220422042204220419840004000003E000001FFC080807F0 +B77C:0000000000043F840084008400843F0720042004200420041F84000400040004 +B77D:000000003F84008400843F07200420041F84000400001FFC0004000400040004 +B77E:000000003F84008400843F07200420041F84000400001F7C0104010401040104 +B77F:000000003F84008400843F07200420041F84000400001F1001100110012801C6 +B780:000000003F84008400843F07200420041F840004000410041000100010000FFC +B781:000000003F84008400843F07200420041F8400040000107C1010101010280FC6 +B782:000000003F84008400843F07200420041F84000400001038100010FE10440F38 +B783:000000003F84008400843F07200420041F84000400001FFC1000100010000FFC +B784:000000003F84008400843F07200420041F84000400001FFC00041FF810000FFC +B785:000000003F84008400843F07200420041F84000400001F7C01041E0410040F04 +B786:000000003F84008400843F07200420041F84000400001F7C01441E4410440F3C +B787:000000003F84008400843F07200420041F84000400001F4401441E7C10440F3C +B788:000000003F84008400843F07200420041F84000400001F1001101E1010280FC6 +B789:000000003F84008400843F07200420041F84000400001F7C01401E7C10400F3C +B78A:000000003F84008400843F07200420041F84000400001F7E01241E2410240F7E +B78B:000000003F84008400843F07200420041F84000400001F3801001EFE10440F38 +B78C:000000003F84008400843F07200420041F84000400001FFC1004100410040FFC +B78D:000000003F84008400843F07200420041F8400040000100410041FFC10040FFC +B78E:000000003F84008400843F07200420041F8400040000111011101F1011280FC6 +B78F:000000003F84008400843F07200420041F84000400000080008001400630180C +B790:000000003F84008400843F07200420041F84000400000410041004100A2831C6 +B791:000000003F84008400843F07200420041F84000400000FF81004100410040FF8 +B792:000000003F84008400843F07200420041F84000400001FFC008001400630180C +B793:000000003F84008400843F07200420041F840004000003E000001FFC02201C1C +B794:000000003F84008400843F07200420041F84000400001FFC00041FFC00040004 +B795:000000003F84008400843F07200420041F84000400001FFC10001FF810000FFC +B796:000000003F84008400843F07200420041F84000400001FFC0410041004101FFC +B797:000000003F84008400843F07200420041F840004000003E000001FFC080807F0 +B798:0000000000123F920092009200923F1E20122012201220121F92001200120012 +B799:000000003F92009200923F1E201220121F92001200000FFE0002000200020002 +B79A:000000003F92009200923F1E201220121F92001200000FBE0082008200820082 +B79B:000000003F92009200923F1E201220121F92001200000F8800880088009400E3 +B79C:000000003F92009200923F1E201220121F9200120012081208000800080007FE +B79D:000000003F92009200923F1E201220121F9200120000083E08080808081407E3 +B79E:000000003F92009200923F1E201220121F9200120000081C0800087F0822079C +B79F:000000003F92009200923F1E201220121F92001200000FFE08000800080007FE +B7A0:000000003F92009200923F1E201220121F92001200000FFE00020FFC080007FE +B7A1:000000003F92009200923F1E201220121F92001200000FBE00820F0208020782 +B7A2:000000003F92009200923F1E201220121F92001200000FBE00A20F220822079E +B7A3:000000003F92009200923F1E201220121F92001200000FA200A20F3E0822079E +B7A4:000000003F92009200923F1E201220121F92001200000F8800880F08081407E3 +B7A5:000000003F92009200923F1E201220121F92001200000FBE00A00F3E0820079E +B7A6:000000003F92009200923F1E201220121F92001200000FBF00920F12081207BF +B7A7:000000003F92009200923F1E201220121F92001200000F9C00800F7F0822079C +B7A8:000000003F92009200923F1E201220121F92001200000FFE08020802080207FE +B7A9:000000003F92009200923F1E201220121F9200120000080208020FFE080207FE +B7AA:000000003F92009200923F1E201220121F9200120000088808880F88089407E3 +B7AB:000000003F92009200923F1E201220121F92001200000040004000A003180C06 +B7AC:000000003F92009200923F1E201220121F9200120000020802080208051418E3 +B7AD:000000003F92009200923F1E201220121F920012000007FC08020802080207FC +B7AE:000000003F92009200923F1E201220121F92001200000FFE004000A003180C06 +B7AF:000000003F92009200923F1E201220121F920012000001F000000FFE01100E0E +B7B0:000000003F92009200923F1E201220121F92001200000FFE00020FFE00020002 +B7B1:000000003F92009200923F1E201220121F92001200000FFE08000FFC080007FE +B7B2:000000003F92009200923F1E201220121F92001200000FFE0208020802080FFE +B7B3:000000003F92009200923F1E201220121F920012000001F000000FFE040403F8 +B7B4:0000000000043F840084008400873F0420042007200420041F84000400040004 +B7B5:000000003F84008400873F04200420071F84000400001FFC0004000400040004 +B7B6:000000003F84008400873F04200420071F84000400001F7C0104010401040104 +B7B7:000000003F84008400873F04200420071F84000400001F1001100110012801C6 +B7B8:000000003F84008400873F04200420071F840004000410041000100010000FFC +B7B9:000000003F84008400873F04200420071F8400040000107C1010101010280FC6 +B7BA:000000003F84008400873F04200420071F84000400001038100010FE10440F38 +B7BB:000000003F84008400873F04200420071F84000400001FFC1000100010000FFC +B7BC:000000003F84008400873F04200420071F84000400001FFC00041FF810000FFC +B7BD:000000003F84008400873F04200420071F84000400001F7C01041E0410040F04 +B7BE:000000003F84008400873F04200420071F84000400001F7C01441E4410440F3C +B7BF:000000003F84008400873F04200420071F84000400001F4401441E7C10440F3C +B7C0:000000003F84008400873F04200420071F84000400001F1001101E1010280FC6 +B7C1:000000003F84008400873F04200420071F84000400001F7C01401E7C10400F3C +B7C2:000000003F84008400873F04200420071F84000400001F7E01241E2410240F7E +B7C3:000000003F84008400873F04200420071F84000400001F3801001EFE10440F38 +B7C4:000000003F84008400873F04200420071F84000400001FFC1004100410040FFC +B7C5:000000003F84008400873F04200420071F8400040000100410041FFC10040FFC +B7C6:000000003F84008400873F04200420071F8400040000111011101F1011280FC6 +B7C7:000000003F84008400873F04200420071F84000400000080008001400630180C +B7C8:000000003F84008400873F04200420071F84000400000410041004100A2831C6 +B7C9:000000003F84008400873F04200420071F84000400000FF81004100410040FF8 +B7CA:000000003F84008400873F04200420071F84000400001FFC008001400630180C +B7CB:000000003F84008400873F04200420071F840004000003E000001FFC02201C1C +B7CC:000000003F84008400873F04200420071F84000400001FFC00041FFC00040004 +B7CD:000000003F84008400873F04200420071F84000400001FFC10001FF810000FFC +B7CE:000000003F84008400873F04200420071F84000400001FFC0410041004101FFC +B7CF:000000003F84008400873F04200420071F840004000003E000001FFC080807F0 +B7D0:0000000000123F9200920092009E3F122012201E201220121F92001200120012 +B7D1:000000003F920092009E3F122012201E1F92001200000FFE0002000200020002 +B7D2:000000003F920092009E3F122012201E1F92001200000FBE0082008200820082 +B7D3:000000003F920092009E3F122012201E1F92001200000F8800880088009400E3 +B7D4:000000003F920092009E3F122012201E1F9200120012081208000800080007FE +B7D5:000000003F920092009E3F122012201E1F9200120000083E08080808081407E3 +B7D6:000000003F920092009E3F122012201E1F9200120000081C0800087F0822079C +B7D7:000000003F920092009E3F122012201E1F92001200000FFE08000800080007FE +B7D8:000000003F920092009E3F122012201E1F92001200000FFE00020FFC080007FE +B7D9:000000003F920092009E3F122012201E1F92001200000FBE00820F0208020782 +B7DA:000000003F920092009E3F122012201E1F92001200000FBE00A20F220822079E +B7DB:000000003F920092009E3F122012201E1F92001200000FA200A20F3E0822079E +B7DC:000000003F920092009E3F122012201E1F92001200000F8800880F08081407E3 +B7DD:000000003F920092009E3F122012201E1F92001200000FBE00A00F3E0820079E +B7DE:000000003F920092009E3F122012201E1F92001200000FBF00920F12081207BF +B7DF:000000003F920092009E3F122012201E1F92001200000F9C00800F7F0822079C +B7E0:000000003F920092009E3F122012201E1F92001200000FFE08020802080207FE +B7E1:000000003F920092009E3F122012201E1F9200120000080208020FFE080207FE +B7E2:000000003F920092009E3F122012201E1F9200120000088808880F88089407E3 +B7E3:000000003F920092009E3F122012201E1F92001200000040004000A003180C06 +B7E4:000000003F920092009E3F122012201E1F9200120000020802080208051418E3 +B7E5:000000003F920092009E3F122012201E1F920012000007FC08020802080207FC +B7E6:000000003F920092009E3F122012201E1F92001200000FFE004000A003180C06 +B7E7:000000003F920092009E3F122012201E1F920012000001F000000FFE01100E0E +B7E8:000000003F920092009E3F122012201E1F92001200000FFE00020FFE00020002 +B7E9:000000003F920092009E3F122012201E1F92001200000FFE08000FFC080007FE +B7EA:000000003F920092009E3F122012201E1F92001200000FFE0208020802080FFE +B7EB:000000003F920092009E3F122012201E1F920012000001F000000FFE040403F8 +B7EC:0000000000043F840084008400843F3C20042004200420041F84000400040004 +B7ED:000000003F84008400843F3C200420041F84000400001FFC0004000400040004 +B7EE:000000003F84008400843F3C200420041F84000400001F7C0104010401040104 +B7EF:000000003F84008400843F3C200420041F84000400001F1001100110012801C6 +B7F0:000000003F84008400843F3C200420041F840004000410041000100010000FFC +B7F1:000000003F84008400843F3C200420041F8400040000107C1010101010280FC6 +B7F2:000000003F84008400843F3C200420041F84000400001038100010FE10440F38 +B7F3:000000003F84008400843F3C200420041F84000400001FFC1000100010000FFC +B7F4:000000003F84008400843F3C200420041F84000400001FFC00041FF810000FFC +B7F5:000000003F84008400843F3C200420041F84000400001F7C01041E0410040F04 +B7F6:000000003F84008400843F3C200420041F84000400001F7C01441E4410440F3C +B7F7:000000003F84008400843F3C200420041F84000400001F4401441E7C10440F3C +B7F8:000000003F84008400843F3C200420041F84000400001F1001101E1010280FC6 +B7F9:000000003F84008400843F3C200420041F84000400001F7C01401E7C10400F3C +B7FA:000000003F84008400843F3C200420041F84000400001F7E01241E2410240F7E +B7FB:000000003F84008400843F3C200420041F84000400001F3801001EFE10440F38 +B7FC:000000003F84008400843F3C200420041F84000400001FFC1004100410040FFC +B7FD:000000003F84008400843F3C200420041F8400040000100410041FFC10040FFC +B7FE:000000003F84008400843F3C200420041F8400040000111011101F1011280FC6 +B7FF:000000003F84008400843F3C200420041F84000400000080008001400630180C +B800:000000003F84008400843F3C200420041F84000400000410041004100A2831C6 +B801:000000003F84008400843F3C200420041F84000400000FF81004100410040FF8 +B802:000000003F84008400843F3C200420041F84000400001FFC008001400630180C +B803:000000003F84008400843F3C200420041F840004000003E000001FFC02201C1C +B804:000000003F84008400843F3C200420041F84000400001FFC00041FFC00040004 +B805:000000003F84008400843F3C200420041F84000400001FFC10001FF810000FFC +B806:000000003F84008400843F3C200420041F84000400001FFC0410041004101FFC +B807:000000003F84008400843F3C200420041F840004000003E000001FFC080807F0 +B808:0000000000123F920092009200923F7220122012201220121F92001200120012 +B809:000000003F92009200923F72201220121F92001200000FFE0002000200020002 +B80A:000000003F92009200923F72201220121F92001200000FBE0082008200820082 +B80B:000000003F92009200923F72201220121F92001200000F8800880088009400E3 +B80C:000000003F92009200923F72201220121F9200120012081208000800080007FE +B80D:000000003F92009200923F72201220121F9200120000083E08080808081407E3 +B80E:000000003F92009200923F72201220121F9200120000081C0800087F0822079C +B80F:000000003F92009200923F72201220121F92001200000FFE08000800080007FE +B810:000000003F92009200923F72201220121F92001200000FFE00020FFC080007FE +B811:000000003F92009200923F72201220121F92001200000FBE00820F0208020782 +B812:000000003F92009200923F72201220121F92001200000FBE00A20F220822079E +B813:000000003F92009200923F72201220121F92001200000FA200A20F3E0822079E +B814:000000003F92009200923F72201220121F92001200000F8800880F08081407E3 +B815:000000003F92009200923F72201220121F92001200000FBE00A00F3E0820079E +B816:000000003F92009200923F72201220121F92001200000FBF00920F12081207BF +B817:000000003F92009200923F72201220121F92001200000F9C00800F7F0822079C +B818:000000003F92009200923F72201220121F92001200000FFE08020802080207FE +B819:000000003F92009200923F72201220121F9200120000080208020FFE080207FE +B81A:000000003F92009200923F72201220121F9200120000088808880F88089407E3 +B81B:000000003F92009200923F72201220121F92001200000040004000A003180C06 +B81C:000000003F92009200923F72201220121F9200120000020802080208051418E3 +B81D:000000003F92009200923F72201220121F920012000007FC08020802080207FC +B81E:000000003F92009200923F72201220121F92001200000FFE004000A003180C06 +B81F:000000003F92009200923F72201220121F920012000001F000000FFE01100E0E +B820:000000003F92009200923F72201220121F92001200000FFE00020FFE00020002 +B821:000000003F92009200923F72201220121F92001200000FFE08000FFC080007FE +B822:000000003F92009200923F72201220121F92001200000FFE0208020802080FFE +B823:000000003F92009200923F72201220121F920012000001F000000FFE040403F8 +B824:0000000000043F840084008400BC3F042004203C200420041F84000400040004 +B825:000000003F84008400BC3F042004203C1F84000400001FFC0004000400040004 +B826:000000003F84008400BC3F042004203C1F84000400001F7C0104010401040104 +B827:000000003F84008400BC3F042004203C1F84000400001F1001100110012801C6 +B828:000000003F84008400BC3F042004203C1F840004000410041000100010000FFC +B829:000000003F84008400BC3F042004203C1F8400040000107C1010101010280FC6 +B82A:000000003F84008400BC3F042004203C1F84000400001038100010FE10440F38 +B82B:000000003F84008400BC3F042004203C1F84000400001FFC1000100010000FFC +B82C:000000003F84008400BC3F042004203C1F84000400001FFC00041FF810000FFC +B82D:000000003F84008400BC3F042004203C1F84000400001F7C01041E0410040F04 +B82E:000000003F84008400BC3F042004203C1F84000400001F7C01441E4410440F3C +B82F:000000003F84008400BC3F042004203C1F84000400001F4401441E7C10440F3C +B830:000000003F84008400BC3F042004203C1F84000400001F1001101E1010280FC6 +B831:000000003F84008400BC3F042004203C1F84000400001F7C01401E7C10400F3C +B832:000000003F84008400BC3F042004203C1F84000400001F7E01241E2410240F7E +B833:000000003F84008400BC3F042004203C1F84000400001F3801001EFE10440F38 +B834:000000003F84008400BC3F042004203C1F84000400001FFC1004100410040FFC +B835:000000003F84008400BC3F042004203C1F8400040000100410041FFC10040FFC +B836:000000003F84008400BC3F042004203C1F8400040000111011101F1011280FC6 +B837:000000003F84008400BC3F042004203C1F84000400000080008001400630180C +B838:000000003F84008400BC3F042004203C1F84000400000410041004100A2831C6 +B839:000000003F84008400BC3F042004203C1F84000400000FF81004100410040FF8 +B83A:000000003F84008400BC3F042004203C1F84000400001FFC008001400630180C +B83B:000000003F84008400BC3F042004203C1F840004000003E000001FFC02201C1C +B83C:000000003F84008400BC3F042004203C1F84000400001FFC00041FFC00040004 +B83D:000000003F84008400BC3F042004203C1F84000400001FFC10001FF810000FFC +B83E:000000003F84008400BC3F042004203C1F84000400001FFC0410041004101FFC +B83F:000000003F84008400BC3F042004203C1F840004000003E000001FFC080807F0 +B840:0000000000123F920092009200F23F1220122072201220121F92001200120012 +B841:000000003F92009200F23F12201220721F92001200000FFE0002000200020002 +B842:000000003F92009200F23F12201220721F92001200000FBE0082008200820082 +B843:000000003F92009200F23F12201220721F92001200000F8800880088009400E3 +B844:000000003F92009200F23F12201220721F9200120012081208000800080007FE +B845:000000003F92009200F23F12201220721F9200120000083E08080808081407E3 +B846:000000003F92009200F23F12201220721F9200120000081C0800087F0822079C +B847:000000003F92009200F23F12201220721F92001200000FFE08000800080007FE +B848:000000003F92009200F23F12201220721F92001200000FFE00020FFC080007FE +B849:000000003F92009200F23F12201220721F92001200000FBE00820F0208020782 +B84A:000000003F92009200F23F12201220721F92001200000FBE00A20F220822079E +B84B:000000003F92009200F23F12201220721F92001200000FA200A20F3E0822079E +B84C:000000003F92009200F23F12201220721F92001200000F8800880F08081407E3 +B84D:000000003F92009200F23F12201220721F92001200000FBE00A00F3E0820079E +B84E:000000003F92009200F23F12201220721F92001200000FBF00920F12081207BF +B84F:000000003F92009200F23F12201220721F92001200000F9C00800F7F0822079C +B850:000000003F92009200F23F12201220721F92001200000FFE08020802080207FE +B851:000000003F92009200F23F12201220721F9200120000080208020FFE080207FE +B852:000000003F92009200F23F12201220721F9200120000088808880F88089407E3 +B853:000000003F92009200F23F12201220721F92001200000040004000A003180C06 +B854:000000003F92009200F23F12201220721F9200120000020802080208051418E3 +B855:000000003F92009200F23F12201220721F920012000007FC08020802080207FC +B856:000000003F92009200F23F12201220721F92001200000FFE004000A003180C06 +B857:000000003F92009200F23F12201220721F920012000001F000000FFE01100E0E +B858:000000003F92009200F23F12201220721F92001200000FFE00020FFE00020002 +B859:000000003F92009200F23F12201220721F92001200000FFE08000FFC080007FE +B85A:000000003F92009200F23F12201220721F92001200000FFE0208020802080FFE +B85B:000000003F92009200F23F12201220721F920012000001F000000FFE040403F8 +B85C:0000000000001FFC000400041FF8100010000FFC0080008000807FFF00000000 +B85D:000000001FFC00041FF810000FFC008000807FFF00001FFC0004000400040004 +B85E:000000001FFC00041FF810000FFC008000807FFF00001F7C0104010401040104 +B85F:000000001FFC00041FF810000FFC008000807FFF00001F1001100110012801C6 +B860:000000001FFC00041FF810000FFC008000807FFF000010001000100010000FFC +B861:000000001FFC00041FF810000FFC008000807FFF0000107C1010101010280FC6 +B862:000000001FFC00041FF810000FFC008000807FFF00001038100010FE10440F38 +B863:000000001FFC00041FF810000FFC008000807FFF00001FFC1000100010000FFC +B864:000000001FFC00041FF810000FFC008000807FFF00001FFC00041FF810000FFC +B865:000000001FFC00041FF810000FFC008000807FFF00001F7C01041E0410040F04 +B866:000000001FFC00041FF810000FFC008000807FFF00001F7C01441E4410440F3C +B867:000000001FFC00041FF810000FFC008000807FFF00001F4401441E7C10440F3C +B868:000000001FFC00041FF810000FFC008000807FFF00001F1001101E1010280FC6 +B869:000000001FFC00041FF810000FFC008000807FFF00001F7C01401E7C10400F3C +B86A:000000001FFC00041FF810000FFC008000807FFF00001F7E01241E2410240F7E +B86B:000000001FFC00041FF810000FFC008000807FFF00001F3801001EFE10440F38 +B86C:000000001FFC00041FF810000FFC008000807FFF00001FFC1004100410040FFC +B86D:000000001FFC00041FF810000FFC008000807FFF0000100410041FFC10040FFC +B86E:000000001FFC00041FF810000FFC008000807FFF0000111011101F1011280FC6 +B86F:000000001FFC00041FF810000FFC008000807FFF00000080008001400630180C +B870:000000001FFC00041FF810000FFC008000807FFF00000410041004100A2831C6 +B871:000000001FFC00041FF810000FFC008000807FFF00000FF81004100410040FF8 +B872:000000001FFC00041FF810000FFC008000807FFF00001FFC008001400630180C +B873:000000001FFC00041FF810000FFC008000807FFF000003E000001FFC02201C1C +B874:000000001FFC00041FF810000FFC008000807FFF00001FFC00041FFC00040004 +B875:000000001FFC00041FF810000FFC008000807FFF00001FFC10001FF810000FFC +B876:000000001FFC00041FF810000FFC008000807FFF00001FFC0410041004101FFC +B877:000000001FFC00041FF810000FFC008000807FFF000003E000001FFC080807F0 +B878:0000000000043F84008400843F04200720041F840404040404047FF400040004 +B879:000000003F8400843F0420071F84040404047FF400001FFC0004000400040004 +B87A:000000003F8400843F0420071F84040404047FF400001F7C0104010401040104 +B87B:000000003F8400843F0420071F84040404047FF400001F1001100110012801C6 +B87C:000000003F8400843F0420071F84040404047FF4000410041000100010000FFC +B87D:000000003F8400843F0420071F84040404047FF40000107C1010101010280FC6 +B87E:000000003F8400843F0420071F84040404047FF400001038100010FE10440F38 +B87F:000000003F8400843F0420071F84040404047FF400001FFC1000100010000FFC +B880:000000003F8400843F0420071F84040404047FF400001FFC00041FF810000FFC +B881:000000003F8400843F0420071F84040404047FF400001F7C01041E0410040F04 +B882:000000003F8400843F0420071F84040404047FF400001F7C01441E4410440F3C +B883:000000003F8400843F0420071F84040404047FF400001F4401441E7C10440F3C +B884:000000003F8400843F0420071F84040404047FF400001F1001101E1010280FC6 +B885:000000003F8400843F0420071F84040404047FF400001F7C01401E7C10400F3C +B886:000000003F8400843F0420071F84040404047FF400001F7E01241E2410240F7E +B887:000000003F8400843F0420071F84040404047FF400001F3801001EFE10440F38 +B888:000000003F8400843F0420071F84040404047FF400001FFC1004100410040FFC +B889:000000003F8400843F0420071F84040404047FF40000100410041FFC10040FFC +B88A:000000003F8400843F0420071F84040404047FF40000111011101F1011280FC6 +B88B:000000003F8400843F0420071F84040404047FF400000080008001400630180C +B88C:000000003F8400843F0420071F84040404047FF400000410041004100A2831C6 +B88D:000000003F8400843F0420071F84040404047FF400000FF81004100410040FF8 +B88E:000000003F8400843F0420071F84040404047FF400001FFC008001400630180C +B88F:000000003F8400843F0420071F84040404047FF4000003E000001FFC02201C1C +B890:000000003F8400843F0420071F84040404047FF400001FFC00041FFC00040004 +B891:000000003F8400843F0420071F84040404047FF400001FFC10001FF810000FFC +B892:000000003F8400843F0420071F84040404047FF400001FFC0410041004101FFC +B893:000000003F8400843F0420071F84040404047FF4000003E000001FFC080807F0 +B894:0000000000123F92009200923F12201E20121F920412041204127FD200120012 +B895:000000003F9200923F12201E1F92041204127FD200000FFE0002000200020002 +B896:000000003F9200923F12201E1F92041204127FD200000FBE0082008200820082 +B897:000000003F9200923F12201E1F92041204127FD200000F8800880088009400E3 +B898:000000003F9200923F12201E1F92041204127FD20012081208000800080007FE +B899:000000003F9200923F12201E1F92041204127FD20000083E08080808081407E3 +B89A:000000003F9200923F12201E1F92041204127FD20000081C0800087F0822079C +B89B:000000003F9200923F12201E1F92041204127FD200000FFE08000800080007FE +B89C:000000003F9200923F12201E1F92041204127FD200000FFE00020FFC080007FE +B89D:000000003F9200923F12201E1F92041204127FD200000FBE00820F0208020782 +B89E:000000003F9200923F12201E1F92041204127FD200000FBE00A20F220822079E +B89F:000000003F9200923F12201E1F92041204127FD200000FA200A20F3E0822079E +B8A0:000000003F9200923F12201E1F92041204127FD200000F8800880F08081407E3 +B8A1:000000003F9200923F12201E1F92041204127FD200000FBE00A00F3E0820079E +B8A2:000000003F9200923F12201E1F92041204127FD200000FBF00920F12081207BF +B8A3:000000003F9200923F12201E1F92041204127FD200000F9C00800F7F0822079C +B8A4:000000003F9200923F12201E1F92041204127FD200000FFE08020802080207FE +B8A5:000000003F9200923F12201E1F92041204127FD20000080208020FFE080207FE +B8A6:000000003F9200923F12201E1F92041204127FD20000088808880F88089407E3 +B8A7:000000003F9200923F12201E1F92041204127FD200000040004000A003180C06 +B8A8:000000003F9200923F12201E1F92041204127FD20000020802080208051418E3 +B8A9:000000003F9200923F12201E1F92041204127FD2000007FC08020802080207FC +B8AA:000000003F9200923F12201E1F92041204127FD200000FFE004000A003180C06 +B8AB:000000003F9200923F12201E1F92041204127FD2000001F000000FFE01100E0E +B8AC:000000003F9200923F12201E1F92041204127FD200000FFE00020FFE00020002 +B8AD:000000003F9200923F12201E1F92041204127FD200000FFE08000FFC080007FE +B8AE:000000003F9200923F12201E1F92041204127FD200000FFE0208020802080FFE +B8AF:000000003F9200923F12201E1F92041204127FD2000001F000000FFE040403F8 +B8B0:0000000000043F84008400843F04200420041F840404040404047FF400040004 +B8B1:000000003F8400843F0420041F84040404047FF400001FFC0004000400040004 +B8B2:000000003F8400843F0420041F84040404047FF400001F7C0104010401040104 +B8B3:000000003F8400843F0420041F84040404047FF400001F1001100110012801C6 +B8B4:000000003F8400843F0420041F84040404047FF4000410041000100010000FFC +B8B5:000000003F8400843F0420041F84040404047FF40000107C1010101010280FC6 +B8B6:000000003F8400843F0420041F84040404047FF400001038100010FE10440F38 +B8B7:000000003F8400843F0420041F84040404047FF400001FFC1000100010000FFC +B8B8:000000003F8400843F0420041F84040404047FF400001FFC00041FF810000FFC +B8B9:000000003F8400843F0420041F84040404047FF400001F7C01041E0410040F04 +B8BA:000000003F8400843F0420041F84040404047FF400001F7C01441E4410440F3C +B8BB:000000003F8400843F0420041F84040404047FF400001F4401441E7C10440F3C +B8BC:000000003F8400843F0420041F84040404047FF400001F1001101E1010280FC6 +B8BD:000000003F8400843F0420041F84040404047FF400001F7C01401E7C10400F3C +B8BE:000000003F8400843F0420041F84040404047FF400001F7E01241E2410240F7E +B8BF:000000003F8400843F0420041F84040404047FF400001F3801001EFE10440F38 +B8C0:000000003F8400843F0420041F84040404047FF400001FFC1004100410040FFC +B8C1:000000003F8400843F0420041F84040404047FF40000100410041FFC10040FFC +B8C2:000000003F8400843F0420041F84040404047FF40000111011101F1011280FC6 +B8C3:000000003F8400843F0420041F84040404047FF400000080008001400630180C +B8C4:000000003F8400843F0420041F84040404047FF400000410041004100A2831C6 +B8C5:000000003F8400843F0420041F84040404047FF400000FF81004100410040FF8 +B8C6:000000003F8400843F0420041F84040404047FF400001FFC008001400630180C +B8C7:000000003F8400843F0420041F84040404047FF4000003E000001FFC02201C1C +B8C8:000000003F8400843F0420041F84040404047FF400001FFC00041FFC00040004 +B8C9:000000003F8400843F0420041F84040404047FF400001FFC10001FF810000FFC +B8CA:000000003F8400843F0420041F84040404047FF400001FFC0410041004101FFC +B8CB:000000003F8400843F0420041F84040404047FF4000003E000001FFC080807F0 +B8CC:0000000000001FFC000400041FF8100010000FFC0220022002207FFF00000000 +B8CD:000000001FFC00041FF810000FFC022002207FFF00001FFC0004000400040004 +B8CE:000000001FFC00041FF810000FFC022002207FFF00001F7C0104010401040104 +B8CF:000000001FFC00041FF810000FFC022002207FFF00001F1001100110012801C6 +B8D0:000000001FFC00041FF810000FFC022002207FFF000010001000100010000FFC +B8D1:000000001FFC00041FF810000FFC022002207FFF0000107C1010101010280FC6 +B8D2:000000001FFC00041FF810000FFC022002207FFF00001038100010FE10440F38 +B8D3:000000001FFC00041FF810000FFC022002207FFF00001FFC1000100010000FFC +B8D4:000000001FFC00041FF810000FFC022002207FFF00001FFC00041FF810000FFC +B8D5:000000001FFC00041FF810000FFC022002207FFF00001F7C01041E0410040F04 +B8D6:000000001FFC00041FF810000FFC022002207FFF00001F7C01441E4410440F3C +B8D7:000000001FFC00041FF810000FFC022002207FFF00001F4401441E7C10440F3C +B8D8:000000001FFC00041FF810000FFC022002207FFF00001F1001101E1010280FC6 +B8D9:000000001FFC00041FF810000FFC022002207FFF00001F7C01401E7C10400F3C +B8DA:000000001FFC00041FF810000FFC022002207FFF00001F7E01241E2410240F7E +B8DB:000000001FFC00041FF810000FFC022002207FFF00001F3801001EFE10440F38 +B8DC:000000001FFC00041FF810000FFC022002207FFF00001FFC1004100410040FFC +B8DD:000000001FFC00041FF810000FFC022002207FFF0000100410041FFC10040FFC +B8DE:000000001FFC00041FF810000FFC022002207FFF0000111011101F1011280FC6 +B8DF:000000001FFC00041FF810000FFC022002207FFF00000080008001400630180C +B8E0:000000001FFC00041FF810000FFC022002207FFF00000410041004100A2831C6 +B8E1:000000001FFC00041FF810000FFC022002207FFF00000FF81004100410040FF8 +B8E2:000000001FFC00041FF810000FFC022002207FFF00001FFC008001400630180C +B8E3:000000001FFC00041FF810000FFC022002207FFF000003E000001FFC02201C1C +B8E4:000000001FFC00041FF810000FFC022002207FFF00001FFC00041FFC00040004 +B8E5:000000001FFC00041FF810000FFC022002207FFF00001FFC10001FF810000FFC +B8E6:000000001FFC00041FF810000FFC022002207FFF00001FFC0410041004101FFC +B8E7:000000001FFC00041FF810000FFC022002207FFF000003E000001FFC080807F0 +B8E8:000000001FFC00041FF810000FFC000000007FFF008000800080008000800080 +B8E9:000000001FFC00041FF810000FFC00007FFF008000801FFC0004000400040004 +B8EA:000000001FFC00041FF810000FFC00007FFF008000801F7C0104010401040104 +B8EB:000000001FFC00041FF810000FFC00007FFF008000801F1001100110012801C6 +B8EC:000000001FFC00041FF810000FFC000000007FFF008010801080100010000FFC +B8ED:000000001FFC00041FF810000FFC00007FFF00800080107C1010101010280FC6 +B8EE:000000001FFC00041FF810000FFC00007FFF008000801038100010FE10440F38 +B8EF:000000001FFC00041FF810000FFC00007FFF008000801FFC1000100010000FFC +B8F0:000000001FFC00041FF810000FFC00007FFF008000801FFC00041FF810000FFC +B8F1:000000001FFC00041FF810000FFC00007FFF008000801F7C01041E0410040F04 +B8F2:000000001FFC00041FF810000FFC00007FFF008000801F7C01441E4410440F3C +B8F3:000000001FFC00041FF810000FFC00007FFF008000801F4401441E7C10440F3C +B8F4:000000001FFC00041FF810000FFC00007FFF008000801F1001101E1010280FC6 +B8F5:000000001FFC00041FF810000FFC00007FFF008000801F7C01401E7C10400F3C +B8F6:000000001FFC00041FF810000FFC00007FFF008000801F7E01241E2410240F7E +B8F7:000000001FFC00041FF810000FFC00007FFF008000801F3801001EFE10440F38 +B8F8:000000001FFC00041FF810000FFC00007FFF008000801FFC1004100410040FFC +B8F9:000000001FFC00041FF810000FFC00007FFF00800080100410041FFC10040FFC +B8FA:000000001FFC00041FF810000FFC00007FFF00800080111011101F1011280FC6 +B8FB:000000001FFC00041FF810000FFC00007FFF008000800080008001400630180C +B8FC:000000001FFC00041FF810000FFC00007FFF008000800410041004100A2831C6 +B8FD:000000001FFC00041FF810000FFC00007FFF008000800FF81004100410040FF8 +B8FE:000000001FFC00041FF810000FFC00007FFF008000801FFC008001400630180C +B8FF:000000001FFC00041FF810000FFC00007FFF0080008003E000001FFC02201C1C +B900:000000001FFC00041FF810000FFC00007FFF008000801FFC00041FFC00040004 +B901:000000001FFC00041FF810000FFC00007FFF008000801FFC10001FF810000FFC +B902:000000001FFC00041FF810000FFC00007FFF008000801FFC0410041004101FFC +B903:000000001FFC00041FF810000FFC00007FFF0080008003E000001FFC080807F0 +B904:000000003F8400843F0420041F84000400047FF404040404043C040404040404 +B905:000000003F8400843F04201C1F8400047FF4040404001FFC0004000400040004 +B906:000000003F8400843F04201C1F8400047FF4040404001F7C0104010401040104 +B907:000000003F8400843F04201C1F8400047FF4040404001F1001100110012801C6 +B908:000000003F8400843F0420041F8400047FF40404043C14041000100010000FFC +B909:000000003F8400843F04201C1F8400047FF404040400107C1010101010280FC6 +B90A:000000003F8400843F04201C1F8400047FF4040404001038100010FE10440F38 +B90B:000000003F8400843F04201C1F8400047FF4040404001FFC1000100010000FFC +B90C:000000003F8400843F04201C1F8400047FF4040404001FFC00041FF810000FFC +B90D:000000003F8400843F04201C1F8400047FF4040404001F7C01041E0410040F04 +B90E:000000003F8400843F04201C1F8400047FF4040404001F7C01441E4410440F3C +B90F:000000003F8400843F04201C1F8400047FF4040404001F4401441E7C10440F3C +B910:000000003F8400843F04201C1F8400047FF4040404001F1001101E1010280FC6 +B911:000000003F8400843F04201C1F8400047FF4040404001F7C01401E7C10400F3C +B912:000000003F8400843F04201C1F8400047FF4040404001F7E01241E2410240F7E +B913:000000003F8400843F04201C1F8400047FF4040404001F3801001EFE10440F38 +B914:000000003F8400843F04201C1F8400047FF4040404001FFC1004100410040FFC +B915:000000003F8400843F04201C1F8400047FF404040400100410041FFC10040FFC +B916:000000003F8400843F04201C1F8400047FF404040400111011101F1011280FC6 +B917:000000003F8400843F04201C1F8400047FF4040404000080008001400630180C +B918:000000003F8400843F04201C1F8400047FF4040404000410041004100A2831C6 +B919:000000003F8400843F04201C1F8400047FF4040404000FF81004100410040FF8 +B91A:000000003F8400843F04201C1F8400047FF4040404001FFC008001400630180C +B91B:000000003F8400843F04201C1F8400047FF40404040003E000001FFC02201C1C +B91C:000000003F8400843F04201C1F8400047FF4040404001FFC00041FFC00040004 +B91D:000000003F8400843F04201C1F8400047FF4040404001FFC10001FF810000FFC +B91E:000000003F8400843F04201C1F8400047FF4040404001FFC0410041004101FFC +B91F:000000003F8400843F04201C1F8400047FF40404040003E000001FFC080807F0 +B920:000000003F9200923F1220121F92001200127FD20412041204F2041204120412 +B921:000000003F9200923F1220721F9200127FD2041204000FFE0002000200020002 +B922:000000003F9200923F1220721F9200127FD2041204000FBE0082008200820082 +B923:000000003F9200923F1220721F9200127FD2041204000F8800880088009400E3 +B924:000000003F9200923F1220121F9200127FD2021202F20A1208000800080007FE +B925:000000003F9200923F1220721F9200127FD204120400083E08080808081407E3 +B926:000000003F9200923F1220721F9200127FD204120400081C0800087F0822079C +B927:000000003F9200923F1220721F9200127FD2041204000FFE08000800080007FE +B928:000000003F9200923F1220721F9200127FD2041204000FFE00020FFC080007FE +B929:000000003F9200923F1220721F9200127FD2041204000FBE00820F0208020782 +B92A:000000003F9200923F1220721F9200127FD2041204000FBE00A20F220822079E +B92B:000000003F9200923F1220721F9200127FD2041204000FA200A20F3E0822079E +B92C:000000003F9200923F1220721F9200127FD2041204000F8800880F08081407E3 +B92D:000000003F9200923F1220721F9200127FD2041204000FBE00A00F3E0820079E +B92E:000000003F9200923F1220721F9200127FD2041204000FBF00920F12081207BF +B92F:000000003F9200923F1220721F9200127FD2041204000F9C00800F7F0822079C +B930:000000003F9200923F1220721F9200127FD2041204000FFE08020802080207FE +B931:000000003F9200923F1220721F9200127FD204120400080208020FFE080207FE +B932:000000003F9200923F1220721F9200127FD204120400088808880F88089407E3 +B933:000000003F9200923F1220721F9200127FD2041204000040004000A003180C06 +B934:000000003F9200923F1220721F9200127FD204120400020802080208051418E3 +B935:000000003F9200923F1220721F9200127FD20412040007FC08020802080207FC +B936:000000003F9200923F1220721F9200127FD2041204000FFE004000A003180C06 +B937:000000003F9200923F1220721F9200127FD20412040001F000000FFE01100E0E +B938:000000003F9200923F1220721F9200127FD2041204000FFE00020FFE00020002 +B939:000000003F9200923F1220721F9200127FD2041204000FFE08000FFC080007FE +B93A:000000003F9200923F1220721F9200127FD2041204000FFE0208020802080FFE +B93B:000000003F9200923F1220721F9200127FD20412040001F000000FFE040403F8 +B93C:000000003F8400843F0420041F84000400047FF4040404040404040404040404 +B93D:000000003F8400843F0420041F8400047FF4040404001FFC0004000400040004 +B93E:000000003F8400843F0420041F8400047FF4040404001F7C0104010401040104 +B93F:000000003F8400843F0420041F8400047FF4040404001F1001100110012801C6 +B940:000000003F8400843F0420041F8400047FF40404040414041000100010000FFC +B941:000000003F8400843F0420041F8400047FF404040400107C1010101010280FC6 +B942:000000003F8400843F0420041F8400047FF4040404001038100010FE10440F38 +B943:000000003F8400843F0420041F8400047FF4040404001FFC1000100010000FFC +B944:000000003F8400843F0420041F8400047FF4040404001FFC00041FF810000FFC +B945:000000003F8400843F0420041F8400047FF4040404001F7C01041E0410040F04 +B946:000000003F8400843F0420041F8400047FF4040404001F7C01441E4410440F3C +B947:000000003F8400843F0420041F8400047FF4040404001F4401441E7C10440F3C +B948:000000003F8400843F0420041F8400047FF4040404001F1001101E1010280FC6 +B949:000000003F8400843F0420041F8400047FF4040404001F7C01401E7C10400F3C +B94A:000000003F8400843F0420041F8400047FF4040404001F7E01241E2410240F7E +B94B:000000003F8400843F0420041F8400047FF4040404001F3801001EFE10440F38 +B94C:000000003F8400843F0420041F8400047FF4040404001FFC1004100410040FFC +B94D:000000003F8400843F0420041F8400047FF404040400100410041FFC10040FFC +B94E:000000003F8400843F0420041F8400047FF404040400111011101F1011280FC6 +B94F:000000003F8400843F0420041F8400047FF4040404000080008001400630180C +B950:000000003F8400843F0420041F8400047FF4040404000410041004100A2831C6 +B951:000000003F8400843F0420041F8400047FF4040404000FF81004100410040FF8 +B952:000000003F8400843F0420041F8400047FF4040404001FFC008001400630180C +B953:000000003F8400843F0420041F8400047FF40404040003E000001FFC02201C1C +B954:000000003F8400843F0420041F8400047FF4040404001FFC00041FFC00040004 +B955:000000003F8400843F0420041F8400047FF4040404001FFC10001FF810000FFC +B956:000000003F8400843F0420041F8400047FF4040404001FFC0410041004101FFC +B957:000000003F8400843F0420041F8400047FF40404040003E000001FFC080807F0 +B958:000000001FFC00041FF810000FFC000000007FFF041004100410041004100410 +B959:000000001FFC00041FF810000FFC00007FFF022002201FFC0004000400040004 +B95A:000000001FFC00041FF810000FFC00007FFF022002201F7C0104010401040104 +B95B:000000001FFC00041FF810000FFC00007FFF022002201F1001100110012801C6 +B95C:000000001FFC00041FF810000FFC000000007FFF022012201220100010000FFC +B95D:000000001FFC00041FF810000FFC00007FFF02200220107C1010101010280FC6 +B95E:000000001FFC00041FF810000FFC00007FFF022002201038100010FE10440F38 +B95F:000000001FFC00041FF810000FFC00007FFF022002201FFC1000100010000FFC +B960:000000001FFC00041FF810000FFC00007FFF022002201FFC00041FF810000FFC +B961:000000001FFC00041FF810000FFC00007FFF022002201F7C01041E0410040F04 +B962:000000001FFC00041FF810000FFC00007FFF022002201F7C01441E4410440F3C +B963:000000001FFC00041FF810000FFC00007FFF022002201F4401441E7C10440F3C +B964:000000001FFC00041FF810000FFC00007FFF022002201F1001101E1010280FC6 +B965:000000001FFC00041FF810000FFC00007FFF022002201F7C01401E7C10400F3C +B966:000000001FFC00041FF810000FFC00007FFF022002201F7E01241E2410240F7E +B967:000000001FFC00041FF810000FFC00007FFF022002201F3801001EFE10440F38 +B968:000000001FFC00041FF810000FFC00007FFF022002201FFC1004100410040FFC +B969:000000001FFC00041FF810000FFC00007FFF02200220100410041FFC10040FFC +B96A:000000001FFC00041FF810000FFC00007FFF02200220111011101F1011280FC6 +B96B:000000001FFC00041FF810000FFC00007FFF022002200080008001400630180C +B96C:000000001FFC00041FF810000FFC00007FFF022002200410041004100A2831C6 +B96D:000000001FFC00041FF810000FFC00007FFF022002200FF81004100410040FF8 +B96E:000000001FFC00041FF810000FFC00007FFF022002201FFC008001400630180C +B96F:000000001FFC00041FF810000FFC00007FFF0220022003E000001FFC02201C1C +B970:000000001FFC00041FF810000FFC00007FFF022002201FFC00041FFC00040004 +B971:000000001FFC00041FF810000FFC00007FFF022002201FFC10001FF810000FFC +B972:000000001FFC00041FF810000FFC00007FFF022002201FFC0410041004101FFC +B973:000000001FFC00041FF810000FFC00007FFF0220022003E000001FFC080807F0 +B974:0000000000001FFC000400041FF8100010000FFC0000000000007FFF00000000 +B975:000000001FFC00041FF810000FFC00007FFF000000001FFC0004000400040004 +B976:000000001FFC00041FF810000FFC00007FFF000000001F7C0104010401040104 +B977:000000001FFC00041FF810000FFC00007FFF000000001F1001100110012801C6 +B978:000000001FFC00041FF810000FFC000000007FFF000010001000100010000FFC +B979:000000001FFC00041FF810000FFC00007FFF00000000107C1010101010280FC6 +B97A:000000001FFC00041FF810000FFC00007FFF000000001038100010FE10440F38 +B97B:000000001FFC00041FF810000FFC00007FFF000000001FFC1000100010000FFC +B97C:000000001FFC00041FF810000FFC00007FFF000000001FFC00041FF810000FFC +B97D:000000001FFC00041FF810000FFC00007FFF000000001F7C01041E0410040F04 +B97E:000000001FFC00041FF810000FFC00007FFF000000001F7C01441E4410440F3C +B97F:000000001FFC00041FF810000FFC00007FFF000000001F4401441E7C10440F3C +B980:000000001FFC00041FF810000FFC00007FFF000000001F1001101E1010280FC6 +B981:000000001FFC00041FF810000FFC00007FFF000000001F7C01401E7C10400F3C +B982:000000001FFC00041FF810000FFC00007FFF000000001F7E01241E2410240F7E +B983:000000001FFC00041FF810000FFC00007FFF000000001F3801001EFE10440F38 +B984:000000001FFC00041FF810000FFC00007FFF000000001FFC1004100410040FFC +B985:000000001FFC00041FF810000FFC00007FFF00000000100410041FFC10040FFC +B986:000000001FFC00041FF810000FFC00007FFF00000000111011101F1011280FC6 +B987:000000001FFC00041FF810000FFC00007FFF000000000080008001400630180C +B988:000000001FFC00041FF810000FFC00007FFF000000000410041004100A2831C6 +B989:000000001FFC00041FF810000FFC00007FFF000000000FF81004100410040FF8 +B98A:000000001FFC00041FF810000FFC00007FFF000000001FFC008001400630180C +B98B:000000001FFC00041FF810000FFC00007FFF0000000003E000001FFC02201C1C +B98C:000000001FFC00041FF810000FFC00007FFF000000001FFC00041FFC00040004 +B98D:000000001FFC00041FF810000FFC00007FFF000000001FFC10001FF810000FFC +B98E:000000001FFC00041FF810000FFC00007FFF000000001FFC0410041004101FFC +B98F:000000001FFC00041FF810000FFC00007FFF0000000003E000001FFC080807F0 +B990:0000000000043F84008400843F04200420041F840004000400047FF400040004 +B991:000000003F8400843F0420041F8400047FF4000400001FFC0004000400040004 +B992:000000003F8400843F0420041F8400047FF4000400001F7C0104010401040104 +B993:000000003F8400843F0420041F8400047FF4000400001F1001100110012801C6 +B994:000000003F8400843F0420041F84000400047FF4000410041000100010000FFC +B995:000000003F8400843F0420041F8400047FF400040000107C1010101010280FC6 +B996:000000003F8400843F0420041F8400047FF4000400001038100010FE10440F38 +B997:000000003F8400843F0420041F8400047FF4000400001FFC1000100010000FFC +B998:000000003F8400843F0420041F8400047FF4000400001FFC00041FF810000FFC +B999:000000003F8400843F0420041F8400047FF4000400001F7C01041E0410040F04 +B99A:000000003F8400843F0420041F8400047FF4000400001F7C01441E4410440F3C +B99B:000000003F8400843F0420041F8400047FF4000400001F4401441E7C10440F3C +B99C:000000003F8400843F0420041F8400047FF4000400001F1001101E1010280FC6 +B99D:000000003F8400843F0420041F8400047FF4000400001F7C01401E7C10400F3C +B99E:000000003F8400843F0420041F8400047FF4000400001F7E01241E2410240F7E +B99F:000000003F8400843F0420041F8400047FF4000400001F3801001EFE10440F38 +B9A0:000000003F8400843F0420041F8400047FF4000400001FFC1004100410040FFC +B9A1:000000003F8400843F0420041F8400047FF400040000100410041FFC10040FFC +B9A2:000000003F8400843F0420041F8400047FF400040000111011101F1011280FC6 +B9A3:000000003F8400843F0420041F8400047FF4000400000080008001400630180C +B9A4:000000003F8400843F0420041F8400047FF4000400000410041004100A2831C6 +B9A5:000000003F8400843F0420041F8400047FF4000400000FF81004100410040FF8 +B9A6:000000003F8400843F0420041F8400047FF4000400001FFC008001400630180C +B9A7:000000003F8400843F0420041F8400047FF40004000003E000001FFC02201C1C +B9A8:000000003F8400843F0420041F8400047FF4000400001FFC00041FFC00040004 +B9A9:000000003F8400843F0420041F8400047FF4000400001FFC10001FF810000FFC +B9AA:000000003F8400843F0420041F8400047FF4000400001FFC0410041004101FFC +B9AB:000000003F8400843F0420041F8400047FF40004000003E000001FFC080807F0 +B9AC:0000000000043F840084008400843F0420042004200420041F84000400040004 +B9AD:000000003F84008400843F04200420041F84000400001FFC0004000400040004 +B9AE:000000003F84008400843F04200420041F84000400001F7C0104010401040104 +B9AF:000000003F84008400843F04200420041F84000400001F1001100110012801C6 +B9B0:000000003F84008400843F04200420041F840004000410041000100010000FFC +B9B1:000000003F84008400843F04200420041F8400040000107C1010101010280FC6 +B9B2:000000003F84008400843F04200420041F84000400001038100010FE10440F38 +B9B3:000000003F84008400843F04200420041F84000400001FFC1000100010000FFC +B9B4:000000003F84008400843F04200420041F84000400001FFC00041FF810000FFC +B9B5:000000003F84008400843F04200420041F84000400001F7C01041E0410040F04 +B9B6:000000003F84008400843F04200420041F84000400001F7C01441E4410440F3C +B9B7:000000003F84008400843F04200420041F84000400001F4401441E7C10440F3C +B9B8:000000003F84008400843F04200420041F84000400001F1001101E1010280FC6 +B9B9:000000003F84008400843F04200420041F84000400001F7C01401E7C10400F3C +B9BA:000000003F84008400843F04200420041F84000400001F7E01241E2410240F7E +B9BB:000000003F84008400843F04200420041F84000400001F3801001EFE10440F38 +B9BC:000000003F84008400843F04200420041F84000400001FFC1004100410040FFC +B9BD:000000003F84008400843F04200420041F8400040000100410041FFC10040FFC +B9BE:000000003F84008400843F04200420041F8400040000111011101F1011280FC6 +B9BF:000000003F84008400843F04200420041F84000400000080008001400630180C +B9C0:000000003F84008400843F04200420041F84000400000410041004100A2831C6 +B9C1:000000003F84008400843F04200420041F84000400000FF81004100410040FF8 +B9C2:000000003F84008400843F04200420041F84000400001FFC008001400630180C +B9C3:000000003F84008400843F04200420041F840004000003E000001FFC02201C1C +B9C4:000000003F84008400843F04200420041F84000400001FFC00041FFC00040004 +B9C5:000000003F84008400843F04200420041F84000400001FFC10001FF810000FFC +B9C6:000000003F84008400843F04200420041F84000400001FFC0410041004101FFC +B9C7:000000003F84008400843F04200420041F840004000003E000001FFC080807F0 +B9C8:0000000000043F84208420842084208720842084208420841F84000400040004 +B9C9:000000003F84208420842087208420841F84000400001FFC0004000400040004 +B9CA:000000003F84208420842087208420841F84000400001F7C0104010401040104 +B9CB:000000003F84208420842087208420841F84000400001F1001100110012801C6 +B9CC:000000003F84208420842087208420841F840004000410041000100010000FFC +B9CD:000000003F84208420842087208420841F8400040000107C1010101010280FC6 +B9CE:000000003F84208420842087208420841F84000400001038100010FE10440F38 +B9CF:000000003F84208420842087208420841F84000400001FFC1000100010000FFC +B9D0:000000003F84208420842087208420841F84000400001FFC00041FF810000FFC +B9D1:000000003F84208420842087208420841F84000400001F7C01041E0410040F04 +B9D2:000000003F84208420842087208420841F84000400001F7C01441E4410440F3C +B9D3:000000003F84208420842087208420841F84000400001F4401441E7C10440F3C +B9D4:000000003F84208420842087208420841F84000400001F1001101E1010280FC6 +B9D5:000000003F84208420842087208420841F84000400001F7C01401E7C10400F3C +B9D6:000000003F84208420842087208420841F84000400001F7E01241E2410240F7E +B9D7:000000003F84208420842087208420841F84000400001F3801001EFE10440F38 +B9D8:000000003F84208420842087208420841F84000400001FFC1004100410040FFC +B9D9:000000003F84208420842087208420841F8400040000100410041FFC10040FFC +B9DA:000000003F84208420842087208420841F8400040000111011101F1011280FC6 +B9DB:000000003F84208420842087208420841F84000400000080008001400630180C +B9DC:000000003F84208420842087208420841F84000400000410041004100A2831C6 +B9DD:000000003F84208420842087208420841F84000400000FF81004100410040FF8 +B9DE:000000003F84208420842087208420841F84000400001FFC008001400630180C +B9DF:000000003F84208420842087208420841F840004000003E000001FFC02201C1C +B9E0:000000003F84208420842087208420841F84000400001FFC00041FFC00040004 +B9E1:000000003F84208420842087208420841F84000400001FFC10001FF810000FFC +B9E2:000000003F84208420842087208420841F84000400001FFC0410041004101FFC +B9E3:000000003F84208420842087208420841F840004000003E000001FFC080807F0 +B9E4:0000000000123F92209220922092209E20922092209220921F92001200120012 +B9E5:000000003F9220922092209E209220921F92001200000FFE0002000200020002 +B9E6:000000003F9220922092209E209220921F92001200000FBE0082008200820082 +B9E7:000000003F9220922092209E209220921F92001200000F8800880088009400E3 +B9E8:000000003F9220922092209E209220921F9200120012081208000800080007FE +B9E9:000000003F9220922092209E209220921F9200120000083E08080808081407E3 +B9EA:000000003F9220922092209E209220921F9200120000081C0800087F0822079C +B9EB:000000003F9220922092209E209220921F92001200000FFE08000800080007FE +B9EC:000000003F9220922092209E209220921F92001200000FFE00020FFC080007FE +B9ED:000000003F9220922092209E209220921F92001200000FBE00820F0208020782 +B9EE:000000003F9220922092209E209220921F92001200000FBE00A20F220822079E +B9EF:000000003F9220922092209E209220921F92001200000FA200A20F3E0822079E +B9F0:000000003F9220922092209E209220921F92001200000F8800880F08081407E3 +B9F1:000000003F9220922092209E209220921F92001200000FBE00A00F3E0820079E +B9F2:000000003F9220922092209E209220921F92001200000FBF00920F12081207BF +B9F3:000000003F9220922092209E209220921F92001200000F9C00800F7F0822079C +B9F4:000000003F9220922092209E209220921F92001200000FFE08020802080207FE +B9F5:000000003F9220922092209E209220921F9200120000080208020FFE080207FE +B9F6:000000003F9220922092209E209220921F9200120000088808880F88089407E3 +B9F7:000000003F9220922092209E209220921F92001200000040004000A003180C06 +B9F8:000000003F9220922092209E209220921F9200120000020802080208051418E3 +B9F9:000000003F9220922092209E209220921F920012000007FC08020802080207FC +B9FA:000000003F9220922092209E209220921F92001200000FFE004000A003180C06 +B9FB:000000003F9220922092209E209220921F920012000001F000000FFE01100E0E +B9FC:000000003F9220922092209E209220921F92001200000FFE00020FFE00020002 +B9FD:000000003F9220922092209E209220921F92001200000FFE08000FFC080007FE +B9FE:000000003F9220922092209E209220921F92001200000FFE0208020802080FFE +B9FF:000000003F9220922092209E209220921F920012000001F000000FFE040403F8 +BA00:0000000000043F84208420842087208420842087208420841F84000400040004 +BA01:000000003F84208420872084208420871F84000400001FFC0004000400040004 +BA02:000000003F84208420872084208420871F84000400001F7C0104010401040104 +BA03:000000003F84208420872084208420871F84000400001F1001100110012801C6 +BA04:000000003F84208420872084208420871F840004000410041000100010000FFC +BA05:000000003F84208420872084208420871F8400040000107C1010101010280FC6 +BA06:000000003F84208420872084208420871F84000400001038100010FE10440F38 +BA07:000000003F84208420872084208420871F84000400001FFC1000100010000FFC +BA08:000000003F84208420872084208420871F84000400001FFC00041FF810000FFC +BA09:000000003F84208420872084208420871F84000400001F7C01041E0410040F04 +BA0A:000000003F84208420872084208420871F84000400001F7C01441E4410440F3C +BA0B:000000003F84208420872084208420871F84000400001F4401441E7C10440F3C +BA0C:000000003F84208420872084208420871F84000400001F1001101E1010280FC6 +BA0D:000000003F84208420872084208420871F84000400001F7C01401E7C10400F3C +BA0E:000000003F84208420872084208420871F84000400001F7E01241E2410240F7E +BA0F:000000003F84208420872084208420871F84000400001F3801001EFE10440F38 +BA10:000000003F84208420872084208420871F84000400001FFC1004100410040FFC +BA11:000000003F84208420872084208420871F8400040000100410041FFC10040FFC +BA12:000000003F84208420872084208420871F8400040000111011101F1011280FC6 +BA13:000000003F84208420872084208420871F84000400000080008001400630180C +BA14:000000003F84208420872084208420871F84000400000410041004100A2831C6 +BA15:000000003F84208420872084208420871F84000400000FF81004100410040FF8 +BA16:000000003F84208420872084208420871F84000400001FFC008001400630180C +BA17:000000003F84208420872084208420871F840004000003E000001FFC02201C1C +BA18:000000003F84208420872084208420871F84000400001FFC00041FFC00040004 +BA19:000000003F84208420872084208420871F84000400001FFC10001FF810000FFC +BA1A:000000003F84208420872084208420871F84000400001FFC0410041004101FFC +BA1B:000000003F84208420872084208420871F840004000003E000001FFC080807F0 +BA1C:0000000000123F9220922092209E20922092209E209220921F92001200120012 +BA1D:000000003F922092209E20922092209E1F92001200000FFE0002000200020002 +BA1E:000000003F922092209E20922092209E1F92001200000FBE0082008200820082 +BA1F:000000003F922092209E20922092209E1F92001200000F8800880088009400E3 +BA20:000000003F922092209E20922092209E1F9200120012081208000800080007FE +BA21:000000003F922092209E20922092209E1F9200120000083E08080808081407E3 +BA22:000000003F922092209E20922092209E1F9200120000081C0800087F0822079C +BA23:000000003F922092209E20922092209E1F92001200000FFE08000800080007FE +BA24:000000003F922092209E20922092209E1F92001200000FFE00020FFC080007FE +BA25:000000003F922092209E20922092209E1F92001200000FBE00820F0208020782 +BA26:000000003F922092209E20922092209E1F92001200000FBE00A20F220822079E +BA27:000000003F922092209E20922092209E1F92001200000FA200A20F3E0822079E +BA28:000000003F922092209E20922092209E1F92001200000F8800880F08081407E3 +BA29:000000003F922092209E20922092209E1F92001200000FBE00A00F3E0820079E +BA2A:000000003F922092209E20922092209E1F92001200000FBF00920F12081207BF +BA2B:000000003F922092209E20922092209E1F92001200000F9C00800F7F0822079C +BA2C:000000003F922092209E20922092209E1F92001200000FFE08020802080207FE +BA2D:000000003F922092209E20922092209E1F9200120000080208020FFE080207FE +BA2E:000000003F922092209E20922092209E1F9200120000088808880F88089407E3 +BA2F:000000003F922092209E20922092209E1F92001200000040004000A003180C06 +BA30:000000003F922092209E20922092209E1F9200120000020802080208051418E3 +BA31:000000003F922092209E20922092209E1F920012000007FC08020802080207FC +BA32:000000003F922092209E20922092209E1F92001200000FFE004000A003180C06 +BA33:000000003F922092209E20922092209E1F920012000001F000000FFE01100E0E +BA34:000000003F922092209E20922092209E1F92001200000FFE00020FFE00020002 +BA35:000000003F922092209E20922092209E1F92001200000FFE08000FFC080007FE +BA36:000000003F922092209E20922092209E1F92001200000FFE0208020802080FFE +BA37:000000003F922092209E20922092209E1F920012000001F000000FFE040403F8 +BA38:0000000000043F8420842084208420BC20842084208420841F84000400040004 +BA39:000000003F842084208420BC208420841F84000400001FFC0004000400040004 +BA3A:000000003F842084208420BC208420841F84000400001F7C0104010401040104 +BA3B:000000003F842084208420BC208420841F84000400001F1001100110012801C6 +BA3C:000000003F842084208420BC208420841F840004000410041000100010000FFC +BA3D:000000003F842084208420BC208420841F8400040000107C1010101010280FC6 +BA3E:000000003F842084208420BC208420841F84000400001038100010FE10440F38 +BA3F:000000003F842084208420BC208420841F84000400001FFC1000100010000FFC +BA40:000000003F842084208420BC208420841F84000400001FFC00041FF810000FFC +BA41:000000003F842084208420BC208420841F84000400001F7C01041E0410040F04 +BA42:000000003F842084208420BC208420841F84000400001F7C01441E4410440F3C +BA43:000000003F842084208420BC208420841F84000400001F4401441E7C10440F3C +BA44:000000003F842084208420BC208420841F84000400001F1001101E1010280FC6 +BA45:000000003F842084208420BC208420841F84000400001F7C01401E7C10400F3C +BA46:000000003F842084208420BC208420841F84000400001F7E01241E2410240F7E +BA47:000000003F842084208420BC208420841F84000400001F3801001EFE10440F38 +BA48:000000003F842084208420BC208420841F84000400001FFC1004100410040FFC +BA49:000000003F842084208420BC208420841F8400040000100410041FFC10040FFC +BA4A:000000003F842084208420BC208420841F8400040000111011101F1011280FC6 +BA4B:000000003F842084208420BC208420841F84000400000080008001400630180C +BA4C:000000003F842084208420BC208420841F84000400000410041004100A2831C6 +BA4D:000000003F842084208420BC208420841F84000400000FF81004100410040FF8 +BA4E:000000003F842084208420BC208420841F84000400001FFC008001400630180C +BA4F:000000003F842084208420BC208420841F840004000003E000001FFC02201C1C +BA50:000000003F842084208420BC208420841F84000400001FFC00041FFC00040004 +BA51:000000003F842084208420BC208420841F84000400001FFC10001FF810000FFC +BA52:000000003F842084208420BC208420841F84000400001FFC0410041004101FFC +BA53:000000003F842084208420BC208420841F840004000003E000001FFC080807F0 +BA54:0000000000123F9220922092209220F220922092209220921F92001200120012 +BA55:000000003F922092209220F2209220921F92001200000FFE0002000200020002 +BA56:000000003F922092209220F2209220921F92001200000FBE0082008200820082 +BA57:000000003F922092209220F2209220921F92001200000F8800880088009400E3 +BA58:000000003F922092209220F2209220921F9200120012081208000800080007FE +BA59:000000003F922092209220F2209220921F9200120000083E08080808081407E3 +BA5A:000000003F922092209220F2209220921F9200120000081C0800087F0822079C +BA5B:000000003F922092209220F2209220921F92001200000FFE08000800080007FE +BA5C:000000003F922092209220F2209220921F92001200000FFE00020FFC080007FE +BA5D:000000003F922092209220F2209220921F92001200000FBE00820F0208020782 +BA5E:000000003F922092209220F2209220921F92001200000FBE00A20F220822079E +BA5F:000000003F922092209220F2209220921F92001200000FA200A20F3E0822079E +BA60:000000003F922092209220F2209220921F92001200000F8800880F08081407E3 +BA61:000000003F922092209220F2209220921F92001200000FBE00A00F3E0820079E +BA62:000000003F922092209220F2209220921F92001200000FBF00920F12081207BF +BA63:000000003F922092209220F2209220921F92001200000F9C00800F7F0822079C +BA64:000000003F922092209220F2209220921F92001200000FFE08020802080207FE +BA65:000000003F922092209220F2209220921F9200120000080208020FFE080207FE +BA66:000000003F922092209220F2209220921F9200120000088808880F88089407E3 +BA67:000000003F922092209220F2209220921F92001200000040004000A003180C06 +BA68:000000003F922092209220F2209220921F9200120000020802080208051418E3 +BA69:000000003F922092209220F2209220921F920012000007FC08020802080207FC +BA6A:000000003F922092209220F2209220921F92001200000FFE004000A003180C06 +BA6B:000000003F922092209220F2209220921F920012000001F000000FFE01100E0E +BA6C:000000003F922092209220F2209220921F92001200000FFE00020FFE00020002 +BA6D:000000003F922092209220F2209220921F92001200000FFE08000FFC080007FE +BA6E:000000003F922092209220F2209220921F92001200000FFE0208020802080FFE +BA6F:000000003F922092209220F2209220921F920012000001F000000FFE040403F8 +BA70:0000000000043F842084208420BC2084208420BC208420841F84000400040004 +BA71:000000003F84208420BC2084208420BC1F84000400001FFC0004000400040004 +BA72:000000003F84208420BC2084208420BC1F84000400001F7C0104010401040104 +BA73:000000003F84208420BC2084208420BC1F84000400001F1001100110012801C6 +BA74:000000003F84208420BC2084208420BC1F840004000410041000100010000FFC +BA75:000000003F84208420BC2084208420BC1F8400040000107C1010101010280FC6 +BA76:000000003F84208420BC2084208420BC1F84000400001038100010FE10440F38 +BA77:000000003F84208420BC2084208420BC1F84000400001FFC1000100010000FFC +BA78:000000003F84208420BC2084208420BC1F84000400001FFC00041FF810000FFC +BA79:000000003F84208420BC2084208420BC1F84000400001F7C01041E0410040F04 +BA7A:000000003F84208420BC2084208420BC1F84000400001F7C01441E4410440F3C +BA7B:000000003F84208420BC2084208420BC1F84000400001F4401441E7C10440F3C +BA7C:000000003F84208420BC2084208420BC1F84000400001F1001101E1010280FC6 +BA7D:000000003F84208420BC2084208420BC1F84000400001F7C01401E7C10400F3C +BA7E:000000003F84208420BC2084208420BC1F84000400001F7E01241E2410240F7E +BA7F:000000003F84208420BC2084208420BC1F84000400001F3801001EFE10440F38 +BA80:000000003F84208420BC2084208420BC1F84000400001FFC1004100410040FFC +BA81:000000003F84208420BC2084208420BC1F8400040000100410041FFC10040FFC +BA82:000000003F84208420BC2084208420BC1F8400040000111011101F1011280FC6 +BA83:000000003F84208420BC2084208420BC1F84000400000080008001400630180C +BA84:000000003F84208420BC2084208420BC1F84000400000410041004100A2831C6 +BA85:000000003F84208420BC2084208420BC1F84000400000FF81004100410040FF8 +BA86:000000003F84208420BC2084208420BC1F84000400001FFC008001400630180C +BA87:000000003F84208420BC2084208420BC1F840004000003E000001FFC02201C1C +BA88:000000003F84208420BC2084208420BC1F84000400001FFC00041FFC00040004 +BA89:000000003F84208420BC2084208420BC1F84000400001FFC10001FF810000FFC +BA8A:000000003F84208420BC2084208420BC1F84000400001FFC0410041004101FFC +BA8B:000000003F84208420BC2084208420BC1F840004000003E000001FFC080807F0 +BA8C:0000000000123F922092209220F22092209220F2209220921F92001200120012 +BA8D:000000003F92209220F22092209220F21F92001200000FFE0002000200020002 +BA8E:000000003F92209220F22092209220F21F92001200000FBE0082008200820082 +BA8F:000000003F92209220F22092209220F21F92001200000F8800880088009400E3 +BA90:000000003F92209220F22092209220F21F9200120012081208000800080007FE +BA91:000000003F92209220F22092209220F21F9200120000083E08080808081407E3 +BA92:000000003F92209220F22092209220F21F9200120000081C0800087F0822079C +BA93:000000003F92209220F22092209220F21F92001200000FFE08000800080007FE +BA94:000000003F92209220F22092209220F21F92001200000FFE00020FFC080007FE +BA95:000000003F92209220F22092209220F21F92001200000FBE00820F0208020782 +BA96:000000003F92209220F22092209220F21F92001200000FBE00A20F220822079E +BA97:000000003F92209220F22092209220F21F92001200000FA200A20F3E0822079E +BA98:000000003F92209220F22092209220F21F92001200000F8800880F08081407E3 +BA99:000000003F92209220F22092209220F21F92001200000FBE00A00F3E0820079E +BA9A:000000003F92209220F22092209220F21F92001200000FBF00920F12081207BF +BA9B:000000003F92209220F22092209220F21F92001200000F9C00800F7F0822079C +BA9C:000000003F92209220F22092209220F21F92001200000FFE08020802080207FE +BA9D:000000003F92209220F22092209220F21F9200120000080208020FFE080207FE +BA9E:000000003F92209220F22092209220F21F9200120000088808880F88089407E3 +BA9F:000000003F92209220F22092209220F21F92001200000040004000A003180C06 +BAA0:000000003F92209220F22092209220F21F9200120000020802080208051418E3 +BAA1:000000003F92209220F22092209220F21F920012000007FC08020802080207FC +BAA2:000000003F92209220F22092209220F21F92001200000FFE004000A003180C06 +BAA3:000000003F92209220F22092209220F21F920012000001F000000FFE01100E0E +BAA4:000000003F92209220F22092209220F21F92001200000FFE00020FFE00020002 +BAA5:000000003F92209220F22092209220F21F92001200000FFE08000FFC080007FE +BAA6:000000003F92209220F22092209220F21F92001200000FFE0208020802080FFE +BAA7:000000003F92209220F22092209220F21F920012000001F000000FFE040403F8 +BAA8:0000000000001FFC100410041004100410040FFC0080008000807FFF00000000 +BAA9:000000001FFC1004100410040FFC008000807FFF00001FFC0004000400040004 +BAAA:000000001FFC1004100410040FFC008000807FFF00001F7C0104010401040104 +BAAB:000000001FFC1004100410040FFC008000807FFF00001F1001100110012801C6 +BAAC:000000001FFC1004100410040FFC008000807FFF000010001000100010000FFC +BAAD:000000001FFC1004100410040FFC008000807FFF0000107C1010101010280FC6 +BAAE:000000001FFC1004100410040FFC008000807FFF00001038100010FE10440F38 +BAAF:000000001FFC1004100410040FFC008000807FFF00001FFC1000100010000FFC +BAB0:000000001FFC1004100410040FFC008000807FFF00001FFC00041FF810000FFC +BAB1:000000001FFC1004100410040FFC008000807FFF00001F7C01041E0410040F04 +BAB2:000000001FFC1004100410040FFC008000807FFF00001F7C01441E4410440F3C +BAB3:000000001FFC1004100410040FFC008000807FFF00001F4401441E7C10440F3C +BAB4:000000001FFC1004100410040FFC008000807FFF00001F1001101E1010280FC6 +BAB5:000000001FFC1004100410040FFC008000807FFF00001F7C01401E7C10400F3C +BAB6:000000001FFC1004100410040FFC008000807FFF00001F7E01241E2410240F7E +BAB7:000000001FFC1004100410040FFC008000807FFF00001F3801001EFE10440F38 +BAB8:000000001FFC1004100410040FFC008000807FFF00001FFC1004100410040FFC +BAB9:000000001FFC1004100410040FFC008000807FFF0000100410041FFC10040FFC +BABA:000000001FFC1004100410040FFC008000807FFF0000111011101F1011280FC6 +BABB:000000001FFC1004100410040FFC008000807FFF00000080008001400630180C +BABC:000000001FFC1004100410040FFC008000807FFF00000410041004100A2831C6 +BABD:000000001FFC1004100410040FFC008000807FFF00000FF81004100410040FF8 +BABE:000000001FFC1004100410040FFC008000807FFF00001FFC008001400630180C +BABF:000000001FFC1004100410040FFC008000807FFF000003E000001FFC02201C1C +BAC0:000000001FFC1004100410040FFC008000807FFF00001FFC00041FFC00040004 +BAC1:000000001FFC1004100410040FFC008000807FFF00001FFC10001FF810000FFC +BAC2:000000001FFC1004100410040FFC008000807FFF00001FFC0410041004101FFC +BAC3:000000001FFC1004100410040FFC008000807FFF000003E000001FFC080807F0 +BAC4:0000000000043F84208420842084208720841F840404040404047FF400040004 +BAC5:000000003F842084208420871F84040404047FF400001FFC0004000400040004 +BAC6:000000003F842084208420871F84040404047FF400001F7C0104010401040104 +BAC7:000000003F842084208420871F84040404047FF400001F1001100110012801C6 +BAC8:000000003F842084208420871F84040404047FF4000410041000100010000FFC +BAC9:000000003F842084208420871F84040404047FF40000107C1010101010280FC6 +BACA:000000003F842084208420871F84040404047FF400001038100010FE10440F38 +BACB:000000003F842084208420871F84040404047FF400001FFC1000100010000FFC +BACC:000000003F842084208420871F84040404047FF400001FFC00041FF810000FFC +BACD:000000003F842084208420871F84040404047FF400001F7C01041E0410040F04 +BACE:000000003F842084208420871F84040404047FF400001F7C01441E4410440F3C +BACF:000000003F842084208420871F84040404047FF400001F4401441E7C10440F3C +BAD0:000000003F842084208420871F84040404047FF400001F1001101E1010280FC6 +BAD1:000000003F842084208420871F84040404047FF400001F7C01401E7C10400F3C +BAD2:000000003F842084208420871F84040404047FF400001F7E01241E2410240F7E +BAD3:000000003F842084208420871F84040404047FF400001F3801001EFE10440F38 +BAD4:000000003F842084208420871F84040404047FF400001FFC1004100410040FFC +BAD5:000000003F842084208420871F84040404047FF40000100410041FFC10040FFC +BAD6:000000003F842084208420871F84040404047FF40000111011101F1011280FC6 +BAD7:000000003F842084208420871F84040404047FF400000080008001400630180C +BAD8:000000003F842084208420871F84040404047FF400000410041004100A2831C6 +BAD9:000000003F842084208420871F84040404047FF400000FF81004100410040FF8 +BADA:000000003F842084208420871F84040404047FF400001FFC008001400630180C +BADB:000000003F842084208420871F84040404047FF4000003E000001FFC02201C1C +BADC:000000003F842084208420871F84040404047FF400001FFC00041FFC00040004 +BADD:000000003F842084208420871F84040404047FF400001FFC10001FF810000FFC +BADE:000000003F842084208420871F84040404047FF400001FFC0410041004101FFC +BADF:000000003F842084208420871F84040404047FF4000003E000001FFC080807F0 +BAE0:0000000000123F92209220922092209E20921F920412041204127FD200120012 +BAE1:000000003F9220922092209E1F92041204127FD200000FFE0002000200020002 +BAE2:000000003F9220922092209E1F92041204127FD200000FBE0082008200820082 +BAE3:000000003F9220922092209E1F92041204127FD200000F8800880088009400E3 +BAE4:000000003F9220922092209E1F92041204127FD20012081208000800080007FE +BAE5:000000003F9220922092209E1F92041204127FD20000083E08080808081407E3 +BAE6:000000003F9220922092209E1F92041204127FD20000081C0800087F0822079C +BAE7:000000003F9220922092209E1F92041204127FD200000FFE08000800080007FE +BAE8:000000003F9220922092209E1F92041204127FD200000FFE00020FFC080007FE +BAE9:000000003F9220922092209E1F92041204127FD200000FBE00820F0208020782 +BAEA:000000003F9220922092209E1F92041204127FD200000FBE00A20F220822079E +BAEB:000000003F9220922092209E1F92041204127FD200000FA200A20F3E0822079E +BAEC:000000003F9220922092209E1F92041204127FD200000F8800880F08081407E3 +BAED:000000003F9220922092209E1F92041204127FD200000FBE00A00F3E0820079E +BAEE:000000003F9220922092209E1F92041204127FD200000FBF00920F12081207BF +BAEF:000000003F9220922092209E1F92041204127FD200000F9C00800F7F0822079C +BAF0:000000003F9220922092209E1F92041204127FD200000FFE08020802080207FE +BAF1:000000003F9220922092209E1F92041204127FD20000080208020FFE080207FE +BAF2:000000003F9220922092209E1F92041204127FD20000088808880F88089407E3 +BAF3:000000003F9220922092209E1F92041204127FD200000040004000A003180C06 +BAF4:000000003F9220922092209E1F92041204127FD20000020802080208051418E3 +BAF5:000000003F9220922092209E1F92041204127FD2000007FC08020802080207FC +BAF6:000000003F9220922092209E1F92041204127FD200000FFE004000A003180C06 +BAF7:000000003F9220922092209E1F92041204127FD2000001F000000FFE01100E0E +BAF8:000000003F9220922092209E1F92041204127FD200000FFE00020FFE00020002 +BAF9:000000003F9220922092209E1F92041204127FD200000FFE08000FFC080007FE +BAFA:000000003F9220922092209E1F92041204127FD200000FFE0208020802080FFE +BAFB:000000003F9220922092209E1F92041204127FD2000001F000000FFE040403F8 +BAFC:0000000000043F84208420842084208420841F840404040404047FF400040004 +BAFD:000000003F842084208420841F84040404047FF400001FFC0004000400040004 +BAFE:000000003F842084208420841F84040404047FF400001F7C0104010401040104 +BAFF:000000003F842084208420841F84040404047FF400001F1001100110012801C6 +BB00:000000003F842084208420841F84040404047FF4000410041000100010000FFC +BB01:000000003F842084208420841F84040404047FF40000107C1010101010280FC6 +BB02:000000003F842084208420841F84040404047FF400001038100010FE10440F38 +BB03:000000003F842084208420841F84040404047FF400001FFC1000100010000FFC +BB04:000000003F842084208420841F84040404047FF400001FFC00041FF810000FFC +BB05:000000003F842084208420841F84040404047FF400001F7C01041E0410040F04 +BB06:000000003F842084208420841F84040404047FF400001F7C01441E4410440F3C +BB07:000000003F842084208420841F84040404047FF400001F4401441E7C10440F3C +BB08:000000003F842084208420841F84040404047FF400001F1001101E1010280FC6 +BB09:000000003F842084208420841F84040404047FF400001F7C01401E7C10400F3C +BB0A:000000003F842084208420841F84040404047FF400001F7E01241E2410240F7E +BB0B:000000003F842084208420841F84040404047FF400001F3801001EFE10440F38 +BB0C:000000003F842084208420841F84040404047FF400001FFC1004100410040FFC +BB0D:000000003F842084208420841F84040404047FF40000100410041FFC10040FFC +BB0E:000000003F842084208420841F84040404047FF40000111011101F1011280FC6 +BB0F:000000003F842084208420841F84040404047FF400000080008001400630180C +BB10:000000003F842084208420841F84040404047FF400000410041004100A2831C6 +BB11:000000003F842084208420841F84040404047FF400000FF81004100410040FF8 +BB12:000000003F842084208420841F84040404047FF400001FFC008001400630180C +BB13:000000003F842084208420841F84040404047FF4000003E000001FFC02201C1C +BB14:000000003F842084208420841F84040404047FF400001FFC00041FFC00040004 +BB15:000000003F842084208420841F84040404047FF400001FFC10001FF810000FFC +BB16:000000003F842084208420841F84040404047FF400001FFC0410041004101FFC +BB17:000000003F842084208420841F84040404047FF4000003E000001FFC080807F0 +BB18:0000000000001FFC100410041004100410040FFC0220022002207FFF00000000 +BB19:000000001FFC1004100410040FFC022002207FFF00001FFC0004000400040004 +BB1A:000000001FFC1004100410040FFC022002207FFF00001F7C0104010401040104 +BB1B:000000001FFC1004100410040FFC022002207FFF00001F1001100110012801C6 +BB1C:000000001FFC1004100410040FFC022002207FFF000010001000100010000FFC +BB1D:000000001FFC1004100410040FFC022002207FFF0000107C1010101010280FC6 +BB1E:000000001FFC1004100410040FFC022002207FFF00001038100010FE10440F38 +BB1F:000000001FFC1004100410040FFC022002207FFF00001FFC1000100010000FFC +BB20:000000001FFC1004100410040FFC022002207FFF00001FFC00041FF810000FFC +BB21:000000001FFC1004100410040FFC022002207FFF00001F7C01041E0410040F04 +BB22:000000001FFC1004100410040FFC022002207FFF00001F7C01441E4410440F3C +BB23:000000001FFC1004100410040FFC022002207FFF00001F4401441E7C10440F3C +BB24:000000001FFC1004100410040FFC022002207FFF00001F1001101E1010280FC6 +BB25:000000001FFC1004100410040FFC022002207FFF00001F7C01401E7C10400F3C +BB26:000000001FFC1004100410040FFC022002207FFF00001F7E01241E2410240F7E +BB27:000000001FFC1004100410040FFC022002207FFF00001F3801001EFE10440F38 +BB28:000000001FFC1004100410040FFC022002207FFF00001FFC1004100410040FFC +BB29:000000001FFC1004100410040FFC022002207FFF0000100410041FFC10040FFC +BB2A:000000001FFC1004100410040FFC022002207FFF0000111011101F1011280FC6 +BB2B:000000001FFC1004100410040FFC022002207FFF00000080008001400630180C +BB2C:000000001FFC1004100410040FFC022002207FFF00000410041004100A2831C6 +BB2D:000000001FFC1004100410040FFC022002207FFF00000FF81004100410040FF8 +BB2E:000000001FFC1004100410040FFC022002207FFF00001FFC008001400630180C +BB2F:000000001FFC1004100410040FFC022002207FFF000003E000001FFC02201C1C +BB30:000000001FFC1004100410040FFC022002207FFF00001FFC00041FFC00040004 +BB31:000000001FFC1004100410040FFC022002207FFF00001FFC10001FF810000FFC +BB32:000000001FFC1004100410040FFC022002207FFF00001FFC0410041004101FFC +BB33:000000001FFC1004100410040FFC022002207FFF000003E000001FFC080807F0 +BB34:000000001FFC1004100410040FFC000000007FFF008000800080008000800080 +BB35:000000001FFC1004100410040FFC00007FFF008000801FFC0004000400040004 +BB36:000000001FFC1004100410040FFC00007FFF008000801F7C0104010401040104 +BB37:000000001FFC1004100410040FFC00007FFF008000801F1001100110012801C6 +BB38:000000001FFC1004100410040FFC000000007FFF008010801080100010000FFC +BB39:000000001FFC1004100410040FFC00007FFF00800080107C1010101010280FC6 +BB3A:000000001FFC1004100410040FFC00007FFF008000801038100010FE10440F38 +BB3B:000000001FFC1004100410040FFC00007FFF008000801FFC1000100010000FFC +BB3C:000000001FFC1004100410040FFC00007FFF008000801FFC00041FF810000FFC +BB3D:000000001FFC1004100410040FFC00007FFF008000801F7C01041E0410040F04 +BB3E:000000001FFC1004100410040FFC00007FFF008000801F7C01441E4410440F3C +BB3F:000000001FFC1004100410040FFC00007FFF008000801F4401441E7C10440F3C +BB40:000000001FFC1004100410040FFC00007FFF008000801F1001101E1010280FC6 +BB41:000000001FFC1004100410040FFC00007FFF008000801F7C01401E7C10400F3C +BB42:000000001FFC1004100410040FFC00007FFF008000801F7E01241E2410240F7E +BB43:000000001FFC1004100410040FFC00007FFF008000801F3801001EFE10440F38 +BB44:000000001FFC1004100410040FFC00007FFF008000801FFC1004100410040FFC +BB45:000000001FFC1004100410040FFC00007FFF00800080100410041FFC10040FFC +BB46:000000001FFC1004100410040FFC00007FFF00800080111011101F1011280FC6 +BB47:000000001FFC1004100410040FFC00007FFF008000800080008001400630180C +BB48:000000001FFC1004100410040FFC00007FFF008000800410041004100A2831C6 +BB49:000000001FFC1004100410040FFC00007FFF008000800FF81004100410040FF8 +BB4A:000000001FFC1004100410040FFC00007FFF008000801FFC008001400630180C +BB4B:000000001FFC1004100410040FFC00007FFF0080008003E000001FFC02201C1C +BB4C:000000001FFC1004100410040FFC00007FFF008000801FFC00041FFC00040004 +BB4D:000000001FFC1004100410040FFC00007FFF008000801FFC10001FF810000FFC +BB4E:000000001FFC1004100410040FFC00007FFF008000801FFC0410041004101FFC +BB4F:000000001FFC1004100410040FFC00007FFF0080008003E000001FFC080807F0 +BB50:000000003F842084208420841F84000400047FF404040404043C040404040404 +BB51:000000003F8420842084209C1F8400047FF4040404001FFC0004000400040004 +BB52:000000003F8420842084209C1F8400047FF4040404001F7C0104010401040104 +BB53:000000003F8420842084209C1F8400047FF4040404001F1001100110012801C6 +BB54:000000003F842084208420841F8400047FF40404043C14041000100010000FFC +BB55:000000003F8420842084209C1F8400047FF404040400107C1010101010280FC6 +BB56:000000003F8420842084209C1F8400047FF4040404001038100010FE10440F38 +BB57:000000003F8420842084209C1F8400047FF4040404001FFC1000100010000FFC +BB58:000000003F8420842084209C1F8400047FF4040404001FFC00041FF810000FFC +BB59:000000003F8420842084209C1F8400047FF4040404001F7C01041E0410040F04 +BB5A:000000003F8420842084209C1F8400047FF4040404001F7C01441E4410440F3C +BB5B:000000003F8420842084209C1F8400047FF4040404001F4401441E7C10440F3C +BB5C:000000003F8420842084209C1F8400047FF4040404001F1001101E1010280FC6 +BB5D:000000003F8420842084209C1F8400047FF4040404001F7C01401E7C10400F3C +BB5E:000000003F8420842084209C1F8400047FF4040404001F7E01241E2410240F7E +BB5F:000000003F8420842084209C1F8400047FF4040404001F3801001EFE10440F38 +BB60:000000003F8420842084209C1F8400047FF4040404001FFC1004100410040FFC +BB61:000000003F8420842084209C1F8400047FF404040400100410041FFC10040FFC +BB62:000000003F8420842084209C1F8400047FF404040400111011101F1011280FC6 +BB63:000000003F8420842084209C1F8400047FF4040404000080008001400630180C +BB64:000000003F8420842084209C1F8400047FF4040404000410041004100A2831C6 +BB65:000000003F8420842084209C1F8400047FF4040404000FF81004100410040FF8 +BB66:000000003F8420842084209C1F8400047FF4040404001FFC008001400630180C +BB67:000000003F8420842084209C1F8400047FF40404040003E000001FFC02201C1C +BB68:000000003F8420842084209C1F8400047FF4040404001FFC00041FFC00040004 +BB69:000000003F8420842084209C1F8400047FF4040404001FFC10001FF810000FFC +BB6A:000000003F8420842084209C1F8400047FF4040404001FFC0410041004101FFC +BB6B:000000003F8420842084209C1F8400047FF40404040003E000001FFC080807F0 +BB6C:000000003F922092209220921F92001200127FD20412041204F2041204120412 +BB6D:000000003F922092209220F21F9200127FD2041204000FFE0002000200020002 +BB6E:000000003F922092209220F21F9200127FD2041204000FBE0082008200820082 +BB6F:000000003F922092209220F21F9200127FD2041204000F8800880088009400E3 +BB70:000000003F922092209220921F9200127FD2021202F20A1208000800080007FE +BB71:000000003F922092209220F21F9200127FD204120400083E08080808081407E3 +BB72:000000003F922092209220F21F9200127FD204120400081C0800087F0822079C +BB73:000000003F922092209220F21F9200127FD2041204000FFE08000800080007FE +BB74:000000003F922092209220F21F9200127FD2041204000FFE00020FFC080007FE +BB75:000000003F922092209220F21F9200127FD2041204000FBE00820F0208020782 +BB76:000000003F922092209220F21F9200127FD2041204000FBE00A20F220822079E +BB77:000000003F922092209220F21F9200127FD2041204000FA200A20F3E0822079E +BB78:000000003F922092209220F21F9200127FD2041204000F8800880F08081407E3 +BB79:000000003F922092209220F21F9200127FD2041204000FBE00A00F3E0820079E +BB7A:000000003F922092209220F21F9200127FD2041204000FBF00920F12081207BF +BB7B:000000003F922092209220F21F9200127FD2041204000F9C00800F7F0822079C +BB7C:000000003F922092209220F21F9200127FD2041204000FFE08020802080207FE +BB7D:000000003F922092209220F21F9200127FD204120400080208020FFE080207FE +BB7E:000000003F922092209220F21F9200127FD204120400088808880F88089407E3 +BB7F:000000003F922092209220F21F9200127FD2041204000040004000A003180C06 +BB80:000000003F922092209220F21F9200127FD204120400020802080208051418E3 +BB81:000000003F922092209220F21F9200127FD20412040007FC08020802080207FC +BB82:000000003F922092209220F21F9200127FD2041204000FFE004000A003180C06 +BB83:000000003F922092209220F21F9200127FD20412040001F000000FFE01100E0E +BB84:000000003F922092209220F21F9200127FD2041204000FFE00020FFE00020002 +BB85:000000003F922092209220F21F9200127FD2041204000FFE08000FFC080007FE +BB86:000000003F922092209220F21F9200127FD2041204000FFE0208020802080FFE +BB87:000000003F922092209220F21F9200127FD20412040001F000000FFE040403F8 +BB88:000000003F842084208420841F84000400047FF4040404040404040404040404 +BB89:000000003F842084208420841F8400047FF4040404001FFC0004000400040004 +BB8A:000000003F842084208420841F8400047FF4040404001F7C0104010401040104 +BB8B:000000003F842084208420841F8400047FF4040404001F1001100110012801C6 +BB8C:000000003F842084208420841F8400047FF40404040414041000100010000FFC +BB8D:000000003F842084208420841F8400047FF404040400107C1010101010280FC6 +BB8E:000000003F842084208420841F8400047FF4040404001038100010FE10440F38 +BB8F:000000003F842084208420841F8400047FF4040404001FFC1000100010000FFC +BB90:000000003F842084208420841F8400047FF4040404001FFC00041FF810000FFC +BB91:000000003F842084208420841F8400047FF4040404001F7C01041E0410040F04 +BB92:000000003F842084208420841F8400047FF4040404001F7C01441E4410440F3C +BB93:000000003F842084208420841F8400047FF4040404001F4401441E7C10440F3C +BB94:000000003F842084208420841F8400047FF4040404001F1001101E1010280FC6 +BB95:000000003F842084208420841F8400047FF4040404001F7C01401E7C10400F3C +BB96:000000003F842084208420841F8400047FF4040404001F7E01241E2410240F7E +BB97:000000003F842084208420841F8400047FF4040404001F3801001EFE10440F38 +BB98:000000003F842084208420841F8400047FF4040404001FFC1004100410040FFC +BB99:000000003F842084208420841F8400047FF404040400100410041FFC10040FFC +BB9A:000000003F842084208420841F8400047FF404040400111011101F1011280FC6 +BB9B:000000003F842084208420841F8400047FF4040404000080008001400630180C +BB9C:000000003F842084208420841F8400047FF4040404000410041004100A2831C6 +BB9D:000000003F842084208420841F8400047FF4040404000FF81004100410040FF8 +BB9E:000000003F842084208420841F8400047FF4040404001FFC008001400630180C +BB9F:000000003F842084208420841F8400047FF40404040003E000001FFC02201C1C +BBA0:000000003F842084208420841F8400047FF4040404001FFC00041FFC00040004 +BBA1:000000003F842084208420841F8400047FF4040404001FFC10001FF810000FFC +BBA2:000000003F842084208420841F8400047FF4040404001FFC0410041004101FFC +BBA3:000000003F842084208420841F8400047FF40404040003E000001FFC080807F0 +BBA4:000000001FFC1004100410040FFC000000007FFF041004100410041004100410 +BBA5:000000001FFC1004100410040FFC00007FFF022002201FFC0004000400040004 +BBA6:000000001FFC1004100410040FFC00007FFF022002201F7C0104010401040104 +BBA7:000000001FFC1004100410040FFC00007FFF022002201F1001100110012801C6 +BBA8:000000001FFC1004100410040FFC000000007FFF022012201220100010000FFC +BBA9:000000001FFC1004100410040FFC00007FFF02200220107C1010101010280FC6 +BBAA:000000001FFC1004100410040FFC00007FFF022002201038100010FE10440F38 +BBAB:000000001FFC1004100410040FFC00007FFF022002201FFC1000100010000FFC +BBAC:000000001FFC1004100410040FFC00007FFF022002201FFC00041FF810000FFC +BBAD:000000001FFC1004100410040FFC00007FFF022002201F7C01041E0410040F04 +BBAE:000000001FFC1004100410040FFC00007FFF022002201F7C01441E4410440F3C +BBAF:000000001FFC1004100410040FFC00007FFF022002201F4401441E7C10440F3C +BBB0:000000001FFC1004100410040FFC00007FFF022002201F1001101E1010280FC6 +BBB1:000000001FFC1004100410040FFC00007FFF022002201F7C01401E7C10400F3C +BBB2:000000001FFC1004100410040FFC00007FFF022002201F7E01241E2410240F7E +BBB3:000000001FFC1004100410040FFC00007FFF022002201F3801001EFE10440F38 +BBB4:000000001FFC1004100410040FFC00007FFF022002201FFC1004100410040FFC +BBB5:000000001FFC1004100410040FFC00007FFF02200220100410041FFC10040FFC +BBB6:000000001FFC1004100410040FFC00007FFF02200220111011101F1011280FC6 +BBB7:000000001FFC1004100410040FFC00007FFF022002200080008001400630180C +BBB8:000000001FFC1004100410040FFC00007FFF022002200410041004100A2831C6 +BBB9:000000001FFC1004100410040FFC00007FFF022002200FF81004100410040FF8 +BBBA:000000001FFC1004100410040FFC00007FFF022002201FFC008001400630180C +BBBB:000000001FFC1004100410040FFC00007FFF0220022003E000001FFC02201C1C +BBBC:000000001FFC1004100410040FFC00007FFF022002201FFC00041FFC00040004 +BBBD:000000001FFC1004100410040FFC00007FFF022002201FFC10001FF810000FFC +BBBE:000000001FFC1004100410040FFC00007FFF022002201FFC0410041004101FFC +BBBF:000000001FFC1004100410040FFC00007FFF0220022003E000001FFC080807F0 +BBC0:0000000000001FFC100410041004100410040FFC0000000000007FFF00000000 +BBC1:000000001FFC1004100410040FFC00007FFF000000001FFC0004000400040004 +BBC2:000000001FFC1004100410040FFC00007FFF000000001F7C0104010401040104 +BBC3:000000001FFC1004100410040FFC00007FFF000000001F1001100110012801C6 +BBC4:000000001FFC1004100410040FFC000000007FFF000010001000100010000FFC +BBC5:000000001FFC1004100410040FFC00007FFF00000000107C1010101010280FC6 +BBC6:000000001FFC1004100410040FFC00007FFF000000001038100010FE10440F38 +BBC7:000000001FFC1004100410040FFC00007FFF000000001FFC1000100010000FFC +BBC8:000000001FFC1004100410040FFC00007FFF000000001FFC00041FF810000FFC +BBC9:000000001FFC1004100410040FFC00007FFF000000001F7C01041E0410040F04 +BBCA:000000001FFC1004100410040FFC00007FFF000000001F7C01441E4410440F3C +BBCB:000000001FFC1004100410040FFC00007FFF000000001F4401441E7C10440F3C +BBCC:000000001FFC1004100410040FFC00007FFF000000001F1001101E1010280FC6 +BBCD:000000001FFC1004100410040FFC00007FFF000000001F7C01401E7C10400F3C +BBCE:000000001FFC1004100410040FFC00007FFF000000001F7E01241E2410240F7E +BBCF:000000001FFC1004100410040FFC00007FFF000000001F3801001EFE10440F38 +BBD0:000000001FFC1004100410040FFC00007FFF000000001FFC1004100410040FFC +BBD1:000000001FFC1004100410040FFC00007FFF00000000100410041FFC10040FFC +BBD2:000000001FFC1004100410040FFC00007FFF00000000111011101F1011280FC6 +BBD3:000000001FFC1004100410040FFC00007FFF000000000080008001400630180C +BBD4:000000001FFC1004100410040FFC00007FFF000000000410041004100A2831C6 +BBD5:000000001FFC1004100410040FFC00007FFF000000000FF81004100410040FF8 +BBD6:000000001FFC1004100410040FFC00007FFF000000001FFC008001400630180C +BBD7:000000001FFC1004100410040FFC00007FFF0000000003E000001FFC02201C1C +BBD8:000000001FFC1004100410040FFC00007FFF000000001FFC00041FFC00040004 +BBD9:000000001FFC1004100410040FFC00007FFF000000001FFC10001FF810000FFC +BBDA:000000001FFC1004100410040FFC00007FFF000000001FFC0410041004101FFC +BBDB:000000001FFC1004100410040FFC00007FFF0000000003E000001FFC080807F0 +BBDC:0000000000043F84208420842084208420841F840004000400047FF400040004 +BBDD:000000003F842084208420841F8400047FF4000400001FFC0004000400040004 +BBDE:000000003F842084208420841F8400047FF4000400001F7C0104010401040104 +BBDF:000000003F842084208420841F8400047FF4000400001F1001100110012801C6 +BBE0:000000003F842084208420841F84000400047FF4000410041000100010000FFC +BBE1:000000003F842084208420841F8400047FF400040000107C1010101010280FC6 +BBE2:000000003F842084208420841F8400047FF4000400001038100010FE10440F38 +BBE3:000000003F842084208420841F8400047FF4000400001FFC1000100010000FFC +BBE4:000000003F842084208420841F8400047FF4000400001FFC00041FF810000FFC +BBE5:000000003F842084208420841F8400047FF4000400001F7C01041E0410040F04 +BBE6:000000003F842084208420841F8400047FF4000400001F7C01441E4410440F3C +BBE7:000000003F842084208420841F8400047FF4000400001F4401441E7C10440F3C +BBE8:000000003F842084208420841F8400047FF4000400001F1001101E1010280FC6 +BBE9:000000003F842084208420841F8400047FF4000400001F7C01401E7C10400F3C +BBEA:000000003F842084208420841F8400047FF4000400001F7E01241E2410240F7E +BBEB:000000003F842084208420841F8400047FF4000400001F3801001EFE10440F38 +BBEC:000000003F842084208420841F8400047FF4000400001FFC1004100410040FFC +BBED:000000003F842084208420841F8400047FF400040000100410041FFC10040FFC +BBEE:000000003F842084208420841F8400047FF400040000111011101F1011280FC6 +BBEF:000000003F842084208420841F8400047FF4000400000080008001400630180C +BBF0:000000003F842084208420841F8400047FF4000400000410041004100A2831C6 +BBF1:000000003F842084208420841F8400047FF4000400000FF81004100410040FF8 +BBF2:000000003F842084208420841F8400047FF4000400001FFC008001400630180C +BBF3:000000003F842084208420841F8400047FF40004000003E000001FFC02201C1C +BBF4:000000003F842084208420841F8400047FF4000400001FFC00041FFC00040004 +BBF5:000000003F842084208420841F8400047FF4000400001FFC10001FF810000FFC +BBF6:000000003F842084208420841F8400047FF4000400001FFC0410041004101FFC +BBF7:000000003F842084208420841F8400047FF40004000003E000001FFC080807F0 +BBF8:0000000000043F84208420842084208420842084208420841F84000400040004 +BBF9:000000003F84208420842084208420841F84000400001FFC0004000400040004 +BBFA:000000003F84208420842084208420841F84000400001F7C0104010401040104 +BBFB:000000003F84208420842084208420841F84000400001F1001100110012801C6 +BBFC:000000003F84208420842084208420841F840004000410041000100010000FFC +BBFD:000000003F84208420842084208420841F8400040000107C1010101010280FC6 +BBFE:000000003F84208420842084208420841F84000400001038100010FE10440F38 +BBFF:000000003F84208420842084208420841F84000400001FFC1000100010000FFC +BC00:000000003F84208420842084208420841F84000400001FFC00041FF810000FFC +BC01:000000003F84208420842084208420841F84000400001F7C01041E0410040F04 +BC02:000000003F84208420842084208420841F84000400001F7C01441E4410440F3C +BC03:000000003F84208420842084208420841F84000400001F4401441E7C10440F3C +BC04:000000003F84208420842084208420841F84000400001F1001101E1010280FC6 +BC05:000000003F84208420842084208420841F84000400001F7C01401E7C10400F3C +BC06:000000003F84208420842084208420841F84000400001F7E01241E2410240F7E +BC07:000000003F84208420842084208420841F84000400001F3801001EFE10440F38 +BC08:000000003F84208420842084208420841F84000400001FFC1004100410040FFC +BC09:000000003F84208420842084208420841F8400040000100410041FFC10040FFC +BC0A:000000003F84208420842084208420841F8400040000111011101F1011280FC6 +BC0B:000000003F84208420842084208420841F84000400000080008001400630180C +BC0C:000000003F84208420842084208420841F84000400000410041004100A2831C6 +BC0D:000000003F84208420842084208420841F84000400000FF81004100410040FF8 +BC0E:000000003F84208420842084208420841F84000400001FFC008001400630180C +BC0F:000000003F84208420842084208420841F840004000003E000001FFC02201C1C +BC10:000000003F84208420842084208420841F84000400001FFC00041FFC00040004 +BC11:000000003F84208420842084208420841F84000400001FFC10001FF810000FFC +BC12:000000003F84208420842084208420841F84000400001FFC0410041004101FFC +BC13:000000003F84208420842084208420841F840004000003E000001FFC080807F0 +BC14:00000000000420842084208420843F8720842084208420841F84000400040004 +BC15:000000002084208420843F87208420841F84000400001FFC0004000400040004 +BC16:000000002084208420843F87208420841F84000400001F7C0104010401040104 +BC17:000000002084208420843F87208420841F84000400001F1001100110012801C6 +BC18:000000002084208420843F87208420841F840004000410041000100010000FFC +BC19:000000002084208420843F87208420841F8400040000107C1010101010280FC6 +BC1A:000000002084208420843F87208420841F84000400001038100010FE10440F38 +BC1B:000000002084208420843F87208420841F84000400001FFC1000100010000FFC +BC1C:000000002084208420843F87208420841F84000400001FFC00041FF810000FFC +BC1D:000000002084208420843F87208420841F84000400001F7C01041E0410040F04 +BC1E:000000002084208420843F87208420841F84000400001F7C01441E4410440F3C +BC1F:000000002084208420843F87208420841F84000400001F4401441E7C10440F3C +BC20:000000002084208420843F87208420841F84000400001F1001101E1010280FC6 +BC21:000000002084208420843F87208420841F84000400001F7C01401E7C10400F3C +BC22:000000002084208420843F87208420841F84000400001F7E01241E2410240F7E +BC23:000000002084208420843F87208420841F84000400001F3801001EFE10440F38 +BC24:000000002084208420843F87208420841F84000400001FFC1004100410040FFC +BC25:000000002084208420843F87208420841F8400040000100410041FFC10040FFC +BC26:000000002084208420843F87208420841F8400040000111011101F1011280FC6 +BC27:000000002084208420843F87208420841F84000400000080008001400630180C +BC28:000000002084208420843F87208420841F84000400000410041004100A2831C6 +BC29:000000002084208420843F87208420841F84000400000FF81004100410040FF8 +BC2A:000000002084208420843F87208420841F84000400001FFC008001400630180C +BC2B:000000002084208420843F87208420841F840004000003E000001FFC02201C1C +BC2C:000000002084208420843F87208420841F84000400001FFC00041FFC00040004 +BC2D:000000002084208420843F87208420841F84000400001FFC10001FF810000FFC +BC2E:000000002084208420843F87208420841F84000400001FFC0410041004101FFC +BC2F:000000002084208420843F87208420841F840004000003E000001FFC080807F0 +BC30:00000000001220922092209220923F9E20922092209220921F92001200120012 +BC31:000000002092209220923F9E209220921F92001200000FFE0002000200020002 +BC32:000000002092209220923F9E209220921F92001200000FBE0082008200820082 +BC33:000000002092209220923F9E209220921F92001200000F8800880088009400E3 +BC34:000000002092209220923F9E209220921F9200120012081208000800080007FE +BC35:000000002092209220923F9E209220921F9200120000083E08080808081407E3 +BC36:000000002092209220923F9E209220921F9200120000081C0800087F0822079C +BC37:000000002092209220923F9E209220921F92001200000FFE08000800080007FE +BC38:000000002092209220923F9E209220921F92001200000FFE00020FFC080007FE +BC39:000000002092209220923F9E209220921F92001200000FBE00820F0208020782 +BC3A:000000002092209220923F9E209220921F92001200000FBE00A20F220822079E +BC3B:000000002092209220923F9E209220921F92001200000FA200A20F3E0822079E +BC3C:000000002092209220923F9E209220921F92001200000F8800880F08081407E3 +BC3D:000000002092209220923F9E209220921F92001200000FBE00A00F3E0820079E +BC3E:000000002092209220923F9E209220921F92001200000FBF00920F12081207BF +BC3F:000000002092209220923F9E209220921F92001200000F9C00800F7F0822079C +BC40:000000002092209220923F9E209220921F92001200000FFE08020802080207FE +BC41:000000002092209220923F9E209220921F9200120000080208020FFE080207FE +BC42:000000002092209220923F9E209220921F9200120000088808880F88089407E3 +BC43:000000002092209220923F9E209220921F92001200000040004000A003180C06 +BC44:000000002092209220923F9E209220921F9200120000020802080208051418E3 +BC45:000000002092209220923F9E209220921F920012000007FC08020802080207FC +BC46:000000002092209220923F9E209220921F92001200000FFE004000A003180C06 +BC47:000000002092209220923F9E209220921F920012000001F000000FFE01100E0E +BC48:000000002092209220923F9E209220921F92001200000FFE00020FFE00020002 +BC49:000000002092209220923F9E209220921F92001200000FFE08000FFC080007FE +BC4A:000000002092209220923F9E209220921F92001200000FFE0208020802080FFE +BC4B:000000002092209220923F9E209220921F920012000001F000000FFE040403F8 +BC4C:00000000000420842084208420873F8420842087208420841F84000400040004 +BC4D:000000002084208420873F84208420871F84000400001FFC0004000400040004 +BC4E:000000002084208420873F84208420871F84000400001F7C0104010401040104 +BC4F:000000002084208420873F84208420871F84000400001F1001100110012801C6 +BC50:000000002084208420873F84208420871F840004000410041000100010000FFC +BC51:000000002084208420873F84208420871F8400040000107C1010101010280FC6 +BC52:000000002084208420873F84208420871F84000400001038100010FE10440F38 +BC53:000000002084208420873F84208420871F84000400001FFC1000100010000FFC +BC54:000000002084208420873F84208420871F84000400001FFC00041FF810000FFC +BC55:000000002084208420873F84208420871F84000400001F7C01041E0410040F04 +BC56:000000002084208420873F84208420871F84000400001F7C01441E4410440F3C +BC57:000000002084208420873F84208420871F84000400001F4401441E7C10440F3C +BC58:000000002084208420873F84208420871F84000400001F1001101E1010280FC6 +BC59:000000002084208420873F84208420871F84000400001F7C01401E7C10400F3C +BC5A:000000002084208420873F84208420871F84000400001F7E01241E2410240F7E +BC5B:000000002084208420873F84208420871F84000400001F3801001EFE10440F38 +BC5C:000000002084208420873F84208420871F84000400001FFC1004100410040FFC +BC5D:000000002084208420873F84208420871F8400040000100410041FFC10040FFC +BC5E:000000002084208420873F84208420871F8400040000111011101F1011280FC6 +BC5F:000000002084208420873F84208420871F84000400000080008001400630180C +BC60:000000002084208420873F84208420871F84000400000410041004100A2831C6 +BC61:000000002084208420873F84208420871F84000400000FF81004100410040FF8 +BC62:000000002084208420873F84208420871F84000400001FFC008001400630180C +BC63:000000002084208420873F84208420871F840004000003E000001FFC02201C1C +BC64:000000002084208420873F84208420871F84000400001FFC00041FFC00040004 +BC65:000000002084208420873F84208420871F84000400001FFC10001FF810000FFC +BC66:000000002084208420873F84208420871F84000400001FFC0410041004101FFC +BC67:000000002084208420873F84208420871F840004000003E000001FFC080807F0 +BC68:000000000012209220922092209E3F922092209E209220921F92001200120012 +BC69:0000000020922092209E3F922092209E1F92001200000FFE0002000200020002 +BC6A:0000000020922092209E3F922092209E1F92001200000FBE0082008200820082 +BC6B:0000000020922092209E3F922092209E1F92001200000F8800880088009400E3 +BC6C:0000000020922092209E3F922092209E1F9200120012081208000800080007FE +BC6D:0000000020922092209E3F922092209E1F9200120000083E08080808081407E3 +BC6E:0000000020922092209E3F922092209E1F9200120000081C0800087F0822079C +BC6F:0000000020922092209E3F922092209E1F92001200000FFE08000800080007FE +BC70:0000000020922092209E3F922092209E1F92001200000FFE00020FFC080007FE +BC71:0000000020922092209E3F922092209E1F92001200000FBE00820F0208020782 +BC72:0000000020922092209E3F922092209E1F92001200000FBE00A20F220822079E +BC73:0000000020922092209E3F922092209E1F92001200000FA200A20F3E0822079E +BC74:0000000020922092209E3F922092209E1F92001200000F8800880F08081407E3 +BC75:0000000020922092209E3F922092209E1F92001200000FBE00A00F3E0820079E +BC76:0000000020922092209E3F922092209E1F92001200000FBF00920F12081207BF +BC77:0000000020922092209E3F922092209E1F92001200000F9C00800F7F0822079C +BC78:0000000020922092209E3F922092209E1F92001200000FFE08020802080207FE +BC79:0000000020922092209E3F922092209E1F9200120000080208020FFE080207FE +BC7A:0000000020922092209E3F922092209E1F9200120000088808880F88089407E3 +BC7B:0000000020922092209E3F922092209E1F92001200000040004000A003180C06 +BC7C:0000000020922092209E3F922092209E1F9200120000020802080208051418E3 +BC7D:0000000020922092209E3F922092209E1F920012000007FC08020802080207FC +BC7E:0000000020922092209E3F922092209E1F92001200000FFE004000A003180C06 +BC7F:0000000020922092209E3F922092209E1F920012000001F000000FFE01100E0E +BC80:0000000020922092209E3F922092209E1F92001200000FFE00020FFE00020002 +BC81:0000000020922092209E3F922092209E1F92001200000FFE08000FFC080007FE +BC82:0000000020922092209E3F922092209E1F92001200000FFE0208020802080FFE +BC83:0000000020922092209E3F922092209E1F920012000001F000000FFE040403F8 +BC84:00000000000420842084208420843FBC20842084208420841F84000400040004 +BC85:000000002084208420843FBC208420841F84000400001FFC0004000400040004 +BC86:000000002084208420843FBC208420841F84000400001F7C0104010401040104 +BC87:000000002084208420843FBC208420841F84000400001F1001100110012801C6 +BC88:000000002084208420843FBC208420841F840004000410041000100010000FFC +BC89:000000002084208420843FBC208420841F8400040000107C1010101010280FC6 +BC8A:000000002084208420843FBC208420841F84000400001038100010FE10440F38 +BC8B:000000002084208420843FBC208420841F84000400001FFC1000100010000FFC +BC8C:000000002084208420843FBC208420841F84000400001FFC00041FF810000FFC +BC8D:000000002084208420843FBC208420841F84000400001F7C01041E0410040F04 +BC8E:000000002084208420843FBC208420841F84000400001F7C01441E4410440F3C +BC8F:000000002084208420843FBC208420841F84000400001F4401441E7C10440F3C +BC90:000000002084208420843FBC208420841F84000400001F1001101E1010280FC6 +BC91:000000002084208420843FBC208420841F84000400001F7C01401E7C10400F3C +BC92:000000002084208420843FBC208420841F84000400001F7E01241E2410240F7E +BC93:000000002084208420843FBC208420841F84000400001F3801001EFE10440F38 +BC94:000000002084208420843FBC208420841F84000400001FFC1004100410040FFC +BC95:000000002084208420843FBC208420841F8400040000100410041FFC10040FFC +BC96:000000002084208420843FBC208420841F8400040000111011101F1011280FC6 +BC97:000000002084208420843FBC208420841F84000400000080008001400630180C +BC98:000000002084208420843FBC208420841F84000400000410041004100A2831C6 +BC99:000000002084208420843FBC208420841F84000400000FF81004100410040FF8 +BC9A:000000002084208420843FBC208420841F84000400001FFC008001400630180C +BC9B:000000002084208420843FBC208420841F840004000003E000001FFC02201C1C +BC9C:000000002084208420843FBC208420841F84000400001FFC00041FFC00040004 +BC9D:000000002084208420843FBC208420841F84000400001FFC10001FF810000FFC +BC9E:000000002084208420843FBC208420841F84000400001FFC0410041004101FFC +BC9F:000000002084208420843FBC208420841F840004000003E000001FFC080807F0 +BCA0:00000000001220922092209220923FF220922092209220921F92001200120012 +BCA1:000000002092209220923FF2209220921F92001200000FFE0002000200020002 +BCA2:000000002092209220923FF2209220921F92001200000FBE0082008200820082 +BCA3:000000002092209220923FF2209220921F92001200000F8800880088009400E3 +BCA4:000000002092209220923FF2209220921F9200120012081208000800080007FE +BCA5:000000002092209220923FF2209220921F9200120000083E08080808081407E3 +BCA6:000000002092209220923FF2209220921F9200120000081C0800087F0822079C +BCA7:000000002092209220923FF2209220921F92001200000FFE08000800080007FE +BCA8:000000002092209220923FF2209220921F92001200000FFE00020FFC080007FE +BCA9:000000002092209220923FF2209220921F92001200000FBE00820F0208020782 +BCAA:000000002092209220923FF2209220921F92001200000FBE00A20F220822079E +BCAB:000000002092209220923FF2209220921F92001200000FA200A20F3E0822079E +BCAC:000000002092209220923FF2209220921F92001200000F8800880F08081407E3 +BCAD:000000002092209220923FF2209220921F92001200000FBE00A00F3E0820079E +BCAE:000000002092209220923FF2209220921F92001200000FBF00920F12081207BF +BCAF:000000002092209220923FF2209220921F92001200000F9C00800F7F0822079C +BCB0:000000002092209220923FF2209220921F92001200000FFE08020802080207FE +BCB1:000000002092209220923FF2209220921F9200120000080208020FFE080207FE +BCB2:000000002092209220923FF2209220921F9200120000088808880F88089407E3 +BCB3:000000002092209220923FF2209220921F92001200000040004000A003180C06 +BCB4:000000002092209220923FF2209220921F9200120000020802080208051418E3 +BCB5:000000002092209220923FF2209220921F920012000007FC08020802080207FC +BCB6:000000002092209220923FF2209220921F92001200000FFE004000A003180C06 +BCB7:000000002092209220923FF2209220921F920012000001F000000FFE01100E0E +BCB8:000000002092209220923FF2209220921F92001200000FFE00020FFE00020002 +BCB9:000000002092209220923FF2209220921F92001200000FFE08000FFC080007FE +BCBA:000000002092209220923FF2209220921F92001200000FFE0208020802080FFE +BCBB:000000002092209220923FF2209220921F920012000001F000000FFE040403F8 +BCBC:00000000000420842084208420BC3F84208420BC208420841F84000400040004 +BCBD:000000002084208420BC3F84208420BC1F84000400001FFC0004000400040004 +BCBE:000000002084208420BC3F84208420BC1F84000400001F7C0104010401040104 +BCBF:000000002084208420BC3F84208420BC1F84000400001F1001100110012801C6 +BCC0:000000002084208420BC3F84208420BC1F840004000410041000100010000FFC +BCC1:000000002084208420BC3F84208420BC1F8400040000107C1010101010280FC6 +BCC2:000000002084208420BC3F84208420BC1F84000400001038100010FE10440F38 +BCC3:000000002084208420BC3F84208420BC1F84000400001FFC1000100010000FFC +BCC4:000000002084208420BC3F84208420BC1F84000400001FFC00041FF810000FFC +BCC5:000000002084208420BC3F84208420BC1F84000400001F7C01041E0410040F04 +BCC6:000000002084208420BC3F84208420BC1F84000400001F7C01441E4410440F3C +BCC7:000000002084208420BC3F84208420BC1F84000400001F4401441E7C10440F3C +BCC8:000000002084208420BC3F84208420BC1F84000400001F1001101E1010280FC6 +BCC9:000000002084208420BC3F84208420BC1F84000400001F7C01401E7C10400F3C +BCCA:000000002084208420BC3F84208420BC1F84000400001F7E01241E2410240F7E +BCCB:000000002084208420BC3F84208420BC1F84000400001F3801001EFE10440F38 +BCCC:000000002084208420BC3F84208420BC1F84000400001FFC1004100410040FFC +BCCD:000000002084208420BC3F84208420BC1F8400040000100410041FFC10040FFC +BCCE:000000002084208420BC3F84208420BC1F8400040000111011101F1011280FC6 +BCCF:000000002084208420BC3F84208420BC1F84000400000080008001400630180C +BCD0:000000002084208420BC3F84208420BC1F84000400000410041004100A2831C6 +BCD1:000000002084208420BC3F84208420BC1F84000400000FF81004100410040FF8 +BCD2:000000002084208420BC3F84208420BC1F84000400001FFC008001400630180C +BCD3:000000002084208420BC3F84208420BC1F840004000003E000001FFC02201C1C +BCD4:000000002084208420BC3F84208420BC1F84000400001FFC00041FFC00040004 +BCD5:000000002084208420BC3F84208420BC1F84000400001FFC10001FF810000FFC +BCD6:000000002084208420BC3F84208420BC1F84000400001FFC0410041004101FFC +BCD7:000000002084208420BC3F84208420BC1F840004000003E000001FFC080807F0 +BCD8:00000000001220922092209220F23F92209220F2209220921F92001200120012 +BCD9:000000002092209220F23F92209220F21F92001200000FFE0002000200020002 +BCDA:000000002092209220F23F92209220F21F92001200000FBE0082008200820082 +BCDB:000000002092209220F23F92209220F21F92001200000F8800880088009400E3 +BCDC:000000002092209220F23F92209220F21F9200120012081208000800080007FE +BCDD:000000002092209220F23F92209220F21F9200120000083E08080808081407E3 +BCDE:000000002092209220F23F92209220F21F9200120000081C0800087F0822079C +BCDF:000000002092209220F23F92209220F21F92001200000FFE08000800080007FE +BCE0:000000002092209220F23F92209220F21F92001200000FFE00020FFC080007FE +BCE1:000000002092209220F23F92209220F21F92001200000FBE00820F0208020782 +BCE2:000000002092209220F23F92209220F21F92001200000FBE00A20F220822079E +BCE3:000000002092209220F23F92209220F21F92001200000FA200A20F3E0822079E +BCE4:000000002092209220F23F92209220F21F92001200000F8800880F08081407E3 +BCE5:000000002092209220F23F92209220F21F92001200000FBE00A00F3E0820079E +BCE6:000000002092209220F23F92209220F21F92001200000FBF00920F12081207BF +BCE7:000000002092209220F23F92209220F21F92001200000F9C00800F7F0822079C +BCE8:000000002092209220F23F92209220F21F92001200000FFE08020802080207FE +BCE9:000000002092209220F23F92209220F21F9200120000080208020FFE080207FE +BCEA:000000002092209220F23F92209220F21F9200120000088808880F88089407E3 +BCEB:000000002092209220F23F92209220F21F92001200000040004000A003180C06 +BCEC:000000002092209220F23F92209220F21F9200120000020802080208051418E3 +BCED:000000002092209220F23F92209220F21F920012000007FC08020802080207FC +BCEE:000000002092209220F23F92209220F21F92001200000FFE004000A003180C06 +BCEF:000000002092209220F23F92209220F21F920012000001F000000FFE01100E0E +BCF0:000000002092209220F23F92209220F21F92001200000FFE00020FFE00020002 +BCF1:000000002092209220F23F92209220F21F92001200000FFE08000FFC080007FE +BCF2:000000002092209220F23F92209220F21F92001200000FFE0208020802080FFE +BCF3:000000002092209220F23F92209220F21F920012000001F000000FFE040403F8 +BCF4:0000000000001004100410041FFC100410040FFC0080008000807FFF00000000 +BCF5:00000000100410041FFC10040FFC008000807FFF00001FFC0004000400040004 +BCF6:00000000100410041FFC10040FFC008000807FFF00001F7C0104010401040104 +BCF7:00000000100410041FFC10040FFC008000807FFF00001F1001100110012801C6 +BCF8:00000000100410041FFC10040FFC008000807FFF000010001000100010000FFC +BCF9:00000000100410041FFC10040FFC008000807FFF0000107C1010101010280FC6 +BCFA:00000000100410041FFC10040FFC008000807FFF00001038100010FE10440F38 +BCFB:00000000100410041FFC10040FFC008000807FFF00001FFC1000100010000FFC +BCFC:00000000100410041FFC10040FFC008000807FFF00001FFC00041FF810000FFC +BCFD:00000000100410041FFC10040FFC008000807FFF00001F7C01041E0410040F04 +BCFE:00000000100410041FFC10040FFC008000807FFF00001F7C01441E4410440F3C +BCFF:00000000100410041FFC10040FFC008000807FFF00001F4401441E7C10440F3C +BD00:00000000100410041FFC10040FFC008000807FFF00001F1001101E1010280FC6 +BD01:00000000100410041FFC10040FFC008000807FFF00001F7C01401E7C10400F3C +BD02:00000000100410041FFC10040FFC008000807FFF00001F7E01241E2410240F7E +BD03:00000000100410041FFC10040FFC008000807FFF00001F3801001EFE10440F38 +BD04:00000000100410041FFC10040FFC008000807FFF00001FFC1004100410040FFC +BD05:00000000100410041FFC10040FFC008000807FFF0000100410041FFC10040FFC +BD06:00000000100410041FFC10040FFC008000807FFF0000111011101F1011280FC6 +BD07:00000000100410041FFC10040FFC008000807FFF00000080008001400630180C +BD08:00000000100410041FFC10040FFC008000807FFF00000410041004100A2831C6 +BD09:00000000100410041FFC10040FFC008000807FFF00000FF81004100410040FF8 +BD0A:00000000100410041FFC10040FFC008000807FFF00001FFC008001400630180C +BD0B:00000000100410041FFC10040FFC008000807FFF000003E000001FFC02201C1C +BD0C:00000000100410041FFC10040FFC008000807FFF00001FFC00041FFC00040004 +BD0D:00000000100410041FFC10040FFC008000807FFF00001FFC10001FF810000FFC +BD0E:00000000100410041FFC10040FFC008000807FFF00001FFC0410041004101FFC +BD0F:00000000100410041FFC10040FFC008000807FFF000003E000001FFC080807F0 +BD10:0000000000042084208420843F84208720841F840404040404047FF400040004 +BD11:00000000208420843F8420871F84040404047FF400001FFC0004000400040004 +BD12:00000000208420843F8420871F84040404047FF400001F7C0104010401040104 +BD13:00000000208420843F8420871F84040404047FF400001F1001100110012801C6 +BD14:00000000208420843F8420871F84040404047FF4000410041000100010000FFC +BD15:00000000208420843F8420871F84040404047FF40000107C1010101010280FC6 +BD16:00000000208420843F8420871F84040404047FF400001038100010FE10440F38 +BD17:00000000208420843F8420871F84040404047FF400001FFC1000100010000FFC +BD18:00000000208420843F8420871F84040404047FF400001FFC00041FF810000FFC +BD19:00000000208420843F8420871F84040404047FF400001F7C01041E0410040F04 +BD1A:00000000208420843F8420871F84040404047FF400001F7C01441E4410440F3C +BD1B:00000000208420843F8420871F84040404047FF400001F4401441E7C10440F3C +BD1C:00000000208420843F8420871F84040404047FF400001F1001101E1010280FC6 +BD1D:00000000208420843F8420871F84040404047FF400001F7C01401E7C10400F3C +BD1E:00000000208420843F8420871F84040404047FF400001F7E01241E2410240F7E +BD1F:00000000208420843F8420871F84040404047FF400001F3801001EFE10440F38 +BD20:00000000208420843F8420871F84040404047FF400001FFC1004100410040FFC +BD21:00000000208420843F8420871F84040404047FF40000100410041FFC10040FFC +BD22:00000000208420843F8420871F84040404047FF40000111011101F1011280FC6 +BD23:00000000208420843F8420871F84040404047FF400000080008001400630180C +BD24:00000000208420843F8420871F84040404047FF400000410041004100A2831C6 +BD25:00000000208420843F8420871F84040404047FF400000FF81004100410040FF8 +BD26:00000000208420843F8420871F84040404047FF400001FFC008001400630180C +BD27:00000000208420843F8420871F84040404047FF4000003E000001FFC02201C1C +BD28:00000000208420843F8420871F84040404047FF400001FFC00041FFC00040004 +BD29:00000000208420843F8420871F84040404047FF400001FFC10001FF810000FFC +BD2A:00000000208420843F8420871F84040404047FF400001FFC0410041004101FFC +BD2B:00000000208420843F8420871F84040404047FF4000003E000001FFC080807F0 +BD2C:0000000000122092209220923F92209E20921F920412041204127FD200120012 +BD2D:00000000209220923F92209E1F92041204127FD200000FFE0002000200020002 +BD2E:00000000209220923F92209E1F92041204127FD200000FBE0082008200820082 +BD2F:00000000209220923F92209E1F92041204127FD200000F8800880088009400E3 +BD30:00000000209220923F92209E1F92041204127FD20012081208000800080007FE +BD31:00000000209220923F92209E1F92041204127FD20000083E08080808081407E3 +BD32:00000000209220923F92209E1F92041204127FD20000081C0800087F0822079C +BD33:00000000209220923F92209E1F92041204127FD200000FFE08000800080007FE +BD34:00000000209220923F92209E1F92041204127FD200000FFE00020FFC080007FE +BD35:00000000209220923F92209E1F92041204127FD200000FBE00820F0208020782 +BD36:00000000209220923F92209E1F92041204127FD200000FBE00A20F220822079E +BD37:00000000209220923F92209E1F92041204127FD200000FA200A20F3E0822079E +BD38:00000000209220923F92209E1F92041204127FD200000F8800880F08081407E3 +BD39:00000000209220923F92209E1F92041204127FD200000FBE00A00F3E0820079E +BD3A:00000000209220923F92209E1F92041204127FD200000FBF00920F12081207BF +BD3B:00000000209220923F92209E1F92041204127FD200000F9C00800F7F0822079C +BD3C:00000000209220923F92209E1F92041204127FD200000FFE08020802080207FE +BD3D:00000000209220923F92209E1F92041204127FD20000080208020FFE080207FE +BD3E:00000000209220923F92209E1F92041204127FD20000088808880F88089407E3 +BD3F:00000000209220923F92209E1F92041204127FD200000040004000A003180C06 +BD40:00000000209220923F92209E1F92041204127FD20000020802080208051418E3 +BD41:00000000209220923F92209E1F92041204127FD2000007FC08020802080207FC +BD42:00000000209220923F92209E1F92041204127FD200000FFE004000A003180C06 +BD43:00000000209220923F92209E1F92041204127FD2000001F000000FFE01100E0E +BD44:00000000209220923F92209E1F92041204127FD200000FFE00020FFE00020002 +BD45:00000000209220923F92209E1F92041204127FD200000FFE08000FFC080007FE +BD46:00000000209220923F92209E1F92041204127FD200000FFE0208020802080FFE +BD47:00000000209220923F92209E1F92041204127FD2000001F000000FFE040403F8 +BD48:0000000000042084208420843F84208420841F840404040404047FF400040004 +BD49:00000000208420843F8420841F84040404047FF400001FFC0004000400040004 +BD4A:00000000208420843F8420841F84040404047FF400001F7C0104010401040104 +BD4B:00000000208420843F8420841F84040404047FF400001F1001100110012801C6 +BD4C:00000000208420843F8420841F84040404047FF4000410041000100010000FFC +BD4D:00000000208420843F8420841F84040404047FF40000107C1010101010280FC6 +BD4E:00000000208420843F8420841F84040404047FF400001038100010FE10440F38 +BD4F:00000000208420843F8420841F84040404047FF400001FFC1000100010000FFC +BD50:00000000208420843F8420841F84040404047FF400001FFC00041FF810000FFC +BD51:00000000208420843F8420841F84040404047FF400001F7C01041E0410040F04 +BD52:00000000208420843F8420841F84040404047FF400001F7C01441E4410440F3C +BD53:00000000208420843F8420841F84040404047FF400001F4401441E7C10440F3C +BD54:00000000208420843F8420841F84040404047FF400001F1001101E1010280FC6 +BD55:00000000208420843F8420841F84040404047FF400001F7C01401E7C10400F3C +BD56:00000000208420843F8420841F84040404047FF400001F7E01241E2410240F7E +BD57:00000000208420843F8420841F84040404047FF400001F3801001EFE10440F38 +BD58:00000000208420843F8420841F84040404047FF400001FFC1004100410040FFC +BD59:00000000208420843F8420841F84040404047FF40000100410041FFC10040FFC +BD5A:00000000208420843F8420841F84040404047FF40000111011101F1011280FC6 +BD5B:00000000208420843F8420841F84040404047FF400000080008001400630180C +BD5C:00000000208420843F8420841F84040404047FF400000410041004100A2831C6 +BD5D:00000000208420843F8420841F84040404047FF400000FF81004100410040FF8 +BD5E:00000000208420843F8420841F84040404047FF400001FFC008001400630180C +BD5F:00000000208420843F8420841F84040404047FF4000003E000001FFC02201C1C +BD60:00000000208420843F8420841F84040404047FF400001FFC00041FFC00040004 +BD61:00000000208420843F8420841F84040404047FF400001FFC10001FF810000FFC +BD62:00000000208420843F8420841F84040404047FF400001FFC0410041004101FFC +BD63:00000000208420843F8420841F84040404047FF4000003E000001FFC080807F0 +BD64:0000000000001004100410041FFC100410040FFC0220022002207FFF00000000 +BD65:00000000100410041FFC10040FFC022002207FFF00001FFC0004000400040004 +BD66:00000000100410041FFC10040FFC022002207FFF00001F7C0104010401040104 +BD67:00000000100410041FFC10040FFC022002207FFF00001F1001100110012801C6 +BD68:00000000100410041FFC10040FFC022002207FFF000010001000100010000FFC +BD69:00000000100410041FFC10040FFC022002207FFF0000107C1010101010280FC6 +BD6A:00000000100410041FFC10040FFC022002207FFF00001038100010FE10440F38 +BD6B:00000000100410041FFC10040FFC022002207FFF00001FFC1000100010000FFC +BD6C:00000000100410041FFC10040FFC022002207FFF00001FFC00041FF810000FFC +BD6D:00000000100410041FFC10040FFC022002207FFF00001F7C01041E0410040F04 +BD6E:00000000100410041FFC10040FFC022002207FFF00001F7C01441E4410440F3C +BD6F:00000000100410041FFC10040FFC022002207FFF00001F4401441E7C10440F3C +BD70:00000000100410041FFC10040FFC022002207FFF00001F1001101E1010280FC6 +BD71:00000000100410041FFC10040FFC022002207FFF00001F7C01401E7C10400F3C +BD72:00000000100410041FFC10040FFC022002207FFF00001F7E01241E2410240F7E +BD73:00000000100410041FFC10040FFC022002207FFF00001F3801001EFE10440F38 +BD74:00000000100410041FFC10040FFC022002207FFF00001FFC1004100410040FFC +BD75:00000000100410041FFC10040FFC022002207FFF0000100410041FFC10040FFC +BD76:00000000100410041FFC10040FFC022002207FFF0000111011101F1011280FC6 +BD77:00000000100410041FFC10040FFC022002207FFF00000080008001400630180C +BD78:00000000100410041FFC10040FFC022002207FFF00000410041004100A2831C6 +BD79:00000000100410041FFC10040FFC022002207FFF00000FF81004100410040FF8 +BD7A:00000000100410041FFC10040FFC022002207FFF00001FFC008001400630180C +BD7B:00000000100410041FFC10040FFC022002207FFF000003E000001FFC02201C1C +BD7C:00000000100410041FFC10040FFC022002207FFF00001FFC00041FFC00040004 +BD7D:00000000100410041FFC10040FFC022002207FFF00001FFC10001FF810000FFC +BD7E:00000000100410041FFC10040FFC022002207FFF00001FFC0410041004101FFC +BD7F:00000000100410041FFC10040FFC022002207FFF000003E000001FFC080807F0 +BD80:00000000100410041FFC10040FFC000000007FFF008000800080008000800080 +BD81:00000000100410041FFC10040FFC00007FFF008000801FFC0004000400040004 +BD82:00000000100410041FFC10040FFC00007FFF008000801F7C0104010401040104 +BD83:00000000100410041FFC10040FFC00007FFF008000801F1001100110012801C6 +BD84:00000000100410041FFC10040FFC000000007FFF008010801080100010000FFC +BD85:00000000100410041FFC10040FFC00007FFF00800080107C1010101010280FC6 +BD86:00000000100410041FFC10040FFC00007FFF008000801038100010FE10440F38 +BD87:00000000100410041FFC10040FFC00007FFF008000801FFC1000100010000FFC +BD88:00000000100410041FFC10040FFC00007FFF008000801FFC00041FF810000FFC +BD89:00000000100410041FFC10040FFC00007FFF008000801F7C01041E0410040F04 +BD8A:00000000100410041FFC10040FFC00007FFF008000801F7C01441E4410440F3C +BD8B:00000000100410041FFC10040FFC00007FFF008000801F4401441E7C10440F3C +BD8C:00000000100410041FFC10040FFC00007FFF008000801F1001101E1010280FC6 +BD8D:00000000100410041FFC10040FFC00007FFF008000801F7C01401E7C10400F3C +BD8E:00000000100410041FFC10040FFC00007FFF008000801F7E01241E2410240F7E +BD8F:00000000100410041FFC10040FFC00007FFF008000801F3801001EFE10440F38 +BD90:00000000100410041FFC10040FFC00007FFF008000801FFC1004100410040FFC +BD91:00000000100410041FFC10040FFC00007FFF00800080100410041FFC10040FFC +BD92:00000000100410041FFC10040FFC00007FFF00800080111011101F1011280FC6 +BD93:00000000100410041FFC10040FFC00007FFF008000800080008001400630180C +BD94:00000000100410041FFC10040FFC00007FFF008000800410041004100A2831C6 +BD95:00000000100410041FFC10040FFC00007FFF008000800FF81004100410040FF8 +BD96:00000000100410041FFC10040FFC00007FFF008000801FFC008001400630180C +BD97:00000000100410041FFC10040FFC00007FFF0080008003E000001FFC02201C1C +BD98:00000000100410041FFC10040FFC00007FFF008000801FFC00041FFC00040004 +BD99:00000000100410041FFC10040FFC00007FFF008000801FFC10001FF810000FFC +BD9A:00000000100410041FFC10040FFC00007FFF008000801FFC0410041004101FFC +BD9B:00000000100410041FFC10040FFC00007FFF0080008003E000001FFC080807F0 +BD9C:00000000208420843F8420841F84000400047FF404040404043C040404040404 +BD9D:00000000208420843F84209C1F8400047FF4040404001FFC0004000400040004 +BD9E:00000000208420843F84209C1F8400047FF4040404001F7C0104010401040104 +BD9F:00000000208420843F84209C1F8400047FF4040404001F1001100110012801C6 +BDA0:00000000208420843F8420841F8400047FF40404043C14041000100010000FFC +BDA1:00000000208420843F84209C1F8400047FF404040400107C1010101010280FC6 +BDA2:00000000208420843F84209C1F8400047FF4040404001038100010FE10440F38 +BDA3:00000000208420843F84209C1F8400047FF4040404001FFC1000100010000FFC +BDA4:00000000208420843F84209C1F8400047FF4040404001FFC00041FF810000FFC +BDA5:00000000208420843F84209C1F8400047FF4040404001F7C01041E0410040F04 +BDA6:00000000208420843F84209C1F8400047FF4040404001F7C01441E4410440F3C +BDA7:00000000208420843F84209C1F8400047FF4040404001F4401441E7C10440F3C +BDA8:00000000208420843F84209C1F8400047FF4040404001F1001101E1010280FC6 +BDA9:00000000208420843F84209C1F8400047FF4040404001F7C01401E7C10400F3C +BDAA:00000000208420843F84209C1F8400047FF4040404001F7E01241E2410240F7E +BDAB:00000000208420843F84209C1F8400047FF4040404001F3801001EFE10440F38 +BDAC:00000000208420843F84209C1F8400047FF4040404001FFC1004100410040FFC +BDAD:00000000208420843F84209C1F8400047FF404040400100410041FFC10040FFC +BDAE:00000000208420843F84209C1F8400047FF404040400111011101F1011280FC6 +BDAF:00000000208420843F84209C1F8400047FF4040404000080008001400630180C +BDB0:00000000208420843F84209C1F8400047FF4040404000410041004100A2831C6 +BDB1:00000000208420843F84209C1F8400047FF4040404000FF81004100410040FF8 +BDB2:00000000208420843F84209C1F8400047FF4040404001FFC008001400630180C +BDB3:00000000208420843F84209C1F8400047FF40404040003E000001FFC02201C1C +BDB4:00000000208420843F84209C1F8400047FF4040404001FFC00041FFC00040004 +BDB5:00000000208420843F84209C1F8400047FF4040404001FFC10001FF810000FFC +BDB6:00000000208420843F84209C1F8400047FF4040404001FFC0410041004101FFC +BDB7:00000000208420843F84209C1F8400047FF40404040003E000001FFC080807F0 +BDB8:00000000209220923F9220921F92001200127FD20412041204F2041204120412 +BDB9:00000000209220923F9220F21F9200127FD2041204000FFE0002000200020002 +BDBA:00000000209220923F9220F21F9200127FD2041204000FBE0082008200820082 +BDBB:00000000209220923F9220F21F9200127FD2041204000F8800880088009400E3 +BDBC:00000000209220923F9220921F9200127FD2021202F20A1208000800080007FE +BDBD:00000000209220923F9220F21F9200127FD204120400083E08080808081407E3 +BDBE:00000000209220923F9220F21F9200127FD204120400081C0800087F0822079C +BDBF:00000000209220923F9220F21F9200127FD2041204000FFE08000800080007FE +BDC0:00000000209220923F9220F21F9200127FD2041204000FFE00020FFC080007FE +BDC1:00000000209220923F9220F21F9200127FD2041204000FBE00820F0208020782 +BDC2:00000000209220923F9220F21F9200127FD2041204000FBE00A20F220822079E +BDC3:00000000209220923F9220F21F9200127FD2041204000FA200A20F3E0822079E +BDC4:00000000209220923F9220F21F9200127FD2041204000F8800880F08081407E3 +BDC5:00000000209220923F9220F21F9200127FD2041204000FBE00A00F3E0820079E +BDC6:00000000209220923F9220F21F9200127FD2041204000FBF00920F12081207BF +BDC7:00000000209220923F9220F21F9200127FD2041204000F9C00800F7F0822079C +BDC8:00000000209220923F9220F21F9200127FD2041204000FFE08020802080207FE +BDC9:00000000209220923F9220F21F9200127FD204120400080208020FFE080207FE +BDCA:00000000209220923F9220F21F9200127FD204120400088808880F88089407E3 +BDCB:00000000209220923F9220F21F9200127FD2041204000040004000A003180C06 +BDCC:00000000209220923F9220F21F9200127FD204120400020802080208051418E3 +BDCD:00000000209220923F9220F21F9200127FD20412040007FC08020802080207FC +BDCE:00000000209220923F9220F21F9200127FD2041204000FFE004000A003180C06 +BDCF:00000000209220923F9220F21F9200127FD20412040001F000000FFE01100E0E +BDD0:00000000209220923F9220F21F9200127FD2041204000FFE00020FFE00020002 +BDD1:00000000209220923F9220F21F9200127FD2041204000FFE08000FFC080007FE +BDD2:00000000209220923F9220F21F9200127FD2041204000FFE0208020802080FFE +BDD3:00000000209220923F9220F21F9200127FD20412040001F000000FFE040403F8 +BDD4:00000000208420843F8420841F84000400047FF4040404040404040404040404 +BDD5:00000000208420843F8420841F8400047FF4040404001FFC0004000400040004 +BDD6:00000000208420843F8420841F8400047FF4040404001F7C0104010401040104 +BDD7:00000000208420843F8420841F8400047FF4040404001F1001100110012801C6 +BDD8:00000000208420843F8420841F8400047FF40404040414041000100010000FFC +BDD9:00000000208420843F8420841F8400047FF404040400107C1010101010280FC6 +BDDA:00000000208420843F8420841F8400047FF4040404001038100010FE10440F38 +BDDB:00000000208420843F8420841F8400047FF4040404001FFC1000100010000FFC +BDDC:00000000208420843F8420841F8400047FF4040404001FFC00041FF810000FFC +BDDD:00000000208420843F8420841F8400047FF4040404001F7C01041E0410040F04 +BDDE:00000000208420843F8420841F8400047FF4040404001F7C01441E4410440F3C +BDDF:00000000208420843F8420841F8400047FF4040404001F4401441E7C10440F3C +BDE0:00000000208420843F8420841F8400047FF4040404001F1001101E1010280FC6 +BDE1:00000000208420843F8420841F8400047FF4040404001F7C01401E7C10400F3C +BDE2:00000000208420843F8420841F8400047FF4040404001F7E01241E2410240F7E +BDE3:00000000208420843F8420841F8400047FF4040404001F3801001EFE10440F38 +BDE4:00000000208420843F8420841F8400047FF4040404001FFC1004100410040FFC +BDE5:00000000208420843F8420841F8400047FF404040400100410041FFC10040FFC +BDE6:00000000208420843F8420841F8400047FF404040400111011101F1011280FC6 +BDE7:00000000208420843F8420841F8400047FF4040404000080008001400630180C +BDE8:00000000208420843F8420841F8400047FF4040404000410041004100A2831C6 +BDE9:00000000208420843F8420841F8400047FF4040404000FF81004100410040FF8 +BDEA:00000000208420843F8420841F8400047FF4040404001FFC008001400630180C +BDEB:00000000208420843F8420841F8400047FF40404040003E000001FFC02201C1C +BDEC:00000000208420843F8420841F8400047FF4040404001FFC00041FFC00040004 +BDED:00000000208420843F8420841F8400047FF4040404001FFC10001FF810000FFC +BDEE:00000000208420843F8420841F8400047FF4040404001FFC0410041004101FFC +BDEF:00000000208420843F8420841F8400047FF40404040003E000001FFC080807F0 +BDF0:00000000100410041FFC10040FFC000000007FFF041004100410041004100410 +BDF1:00000000100410041FFC10040FFC00007FFF022002201FFC0004000400040004 +BDF2:00000000100410041FFC10040FFC00007FFF022002201F7C0104010401040104 +BDF3:00000000100410041FFC10040FFC00007FFF022002201F1001100110012801C6 +BDF4:00000000100410041FFC10040FFC000000007FFF022012201220100010000FFC +BDF5:00000000100410041FFC10040FFC00007FFF02200220107C1010101010280FC6 +BDF6:00000000100410041FFC10040FFC00007FFF022002201038100010FE10440F38 +BDF7:00000000100410041FFC10040FFC00007FFF022002201FFC1000100010000FFC +BDF8:00000000100410041FFC10040FFC00007FFF022002201FFC00041FF810000FFC +BDF9:00000000100410041FFC10040FFC00007FFF022002201F7C01041E0410040F04 +BDFA:00000000100410041FFC10040FFC00007FFF022002201F7C01441E4410440F3C +BDFB:00000000100410041FFC10040FFC00007FFF022002201F4401441E7C10440F3C +BDFC:00000000100410041FFC10040FFC00007FFF022002201F1001101E1010280FC6 +BDFD:00000000100410041FFC10040FFC00007FFF022002201F7C01401E7C10400F3C +BDFE:00000000100410041FFC10040FFC00007FFF022002201F7E01241E2410240F7E +BDFF:00000000100410041FFC10040FFC00007FFF022002201F3801001EFE10440F38 +BE00:00000000100410041FFC10040FFC00007FFF022002201FFC1004100410040FFC +BE01:00000000100410041FFC10040FFC00007FFF02200220100410041FFC10040FFC +BE02:00000000100410041FFC10040FFC00007FFF02200220111011101F1011280FC6 +BE03:00000000100410041FFC10040FFC00007FFF022002200080008001400630180C +BE04:00000000100410041FFC10040FFC00007FFF022002200410041004100A2831C6 +BE05:00000000100410041FFC10040FFC00007FFF022002200FF81004100410040FF8 +BE06:00000000100410041FFC10040FFC00007FFF022002201FFC008001400630180C +BE07:00000000100410041FFC10040FFC00007FFF0220022003E000001FFC02201C1C +BE08:00000000100410041FFC10040FFC00007FFF022002201FFC00041FFC00040004 +BE09:00000000100410041FFC10040FFC00007FFF022002201FFC10001FF810000FFC +BE0A:00000000100410041FFC10040FFC00007FFF022002201FFC0410041004101FFC +BE0B:00000000100410041FFC10040FFC00007FFF0220022003E000001FFC080807F0 +BE0C:0000000000001004100410041FFC100410040FFC0000000000007FFF00000000 +BE0D:00000000100410041FFC10040FFC00007FFF000000001FFC0004000400040004 +BE0E:00000000100410041FFC10040FFC00007FFF000000001F7C0104010401040104 +BE0F:00000000100410041FFC10040FFC00007FFF000000001F1001100110012801C6 +BE10:00000000100410041FFC10040FFC000000007FFF000010001000100010000FFC +BE11:00000000100410041FFC10040FFC00007FFF00000000107C1010101010280FC6 +BE12:00000000100410041FFC10040FFC00007FFF000000001038100010FE10440F38 +BE13:00000000100410041FFC10040FFC00007FFF000000001FFC1000100010000FFC +BE14:00000000100410041FFC10040FFC00007FFF000000001FFC00041FF810000FFC +BE15:00000000100410041FFC10040FFC00007FFF000000001F7C01041E0410040F04 +BE16:00000000100410041FFC10040FFC00007FFF000000001F7C01441E4410440F3C +BE17:00000000100410041FFC10040FFC00007FFF000000001F4401441E7C10440F3C +BE18:00000000100410041FFC10040FFC00007FFF000000001F1001101E1010280FC6 +BE19:00000000100410041FFC10040FFC00007FFF000000001F7C01401E7C10400F3C +BE1A:00000000100410041FFC10040FFC00007FFF000000001F7E01241E2410240F7E +BE1B:00000000100410041FFC10040FFC00007FFF000000001F3801001EFE10440F38 +BE1C:00000000100410041FFC10040FFC00007FFF000000001FFC1004100410040FFC +BE1D:00000000100410041FFC10040FFC00007FFF00000000100410041FFC10040FFC +BE1E:00000000100410041FFC10040FFC00007FFF00000000111011101F1011280FC6 +BE1F:00000000100410041FFC10040FFC00007FFF000000000080008001400630180C +BE20:00000000100410041FFC10040FFC00007FFF000000000410041004100A2831C6 +BE21:00000000100410041FFC10040FFC00007FFF000000000FF81004100410040FF8 +BE22:00000000100410041FFC10040FFC00007FFF000000001FFC008001400630180C +BE23:00000000100410041FFC10040FFC00007FFF0000000003E000001FFC02201C1C +BE24:00000000100410041FFC10040FFC00007FFF000000001FFC00041FFC00040004 +BE25:00000000100410041FFC10040FFC00007FFF000000001FFC10001FF810000FFC +BE26:00000000100410041FFC10040FFC00007FFF000000001FFC0410041004101FFC +BE27:00000000100410041FFC10040FFC00007FFF0000000003E000001FFC080807F0 +BE28:0000000000042084208420843F84208420841F840004000400047FF400040004 +BE29:00000000208420843F8420841F8400047FF4000400001FFC0004000400040004 +BE2A:00000000208420843F8420841F8400047FF4000400001F7C0104010401040104 +BE2B:00000000208420843F8420841F8400047FF4000400001F1001100110012801C6 +BE2C:00000000208420843F8420841F84000400047FF4000410041000100010000FFC +BE2D:00000000208420843F8420841F8400047FF400040000107C1010101010280FC6 +BE2E:00000000208420843F8420841F8400047FF4000400001038100010FE10440F38 +BE2F:00000000208420843F8420841F8400047FF4000400001FFC1000100010000FFC +BE30:00000000208420843F8420841F8400047FF4000400001FFC00041FF810000FFC +BE31:00000000208420843F8420841F8400047FF4000400001F7C01041E0410040F04 +BE32:00000000208420843F8420841F8400047FF4000400001F7C01441E4410440F3C +BE33:00000000208420843F8420841F8400047FF4000400001F4401441E7C10440F3C +BE34:00000000208420843F8420841F8400047FF4000400001F1001101E1010280FC6 +BE35:00000000208420843F8420841F8400047FF4000400001F7C01401E7C10400F3C +BE36:00000000208420843F8420841F8400047FF4000400001F7E01241E2410240F7E +BE37:00000000208420843F8420841F8400047FF4000400001F3801001EFE10440F38 +BE38:00000000208420843F8420841F8400047FF4000400001FFC1004100410040FFC +BE39:00000000208420843F8420841F8400047FF400040000100410041FFC10040FFC +BE3A:00000000208420843F8420841F8400047FF400040000111011101F1011280FC6 +BE3B:00000000208420843F8420841F8400047FF4000400000080008001400630180C +BE3C:00000000208420843F8420841F8400047FF4000400000410041004100A2831C6 +BE3D:00000000208420843F8420841F8400047FF4000400000FF81004100410040FF8 +BE3E:00000000208420843F8420841F8400047FF4000400001FFC008001400630180C +BE3F:00000000208420843F8420841F8400047FF40004000003E000001FFC02201C1C +BE40:00000000208420843F8420841F8400047FF4000400001FFC00041FFC00040004 +BE41:00000000208420843F8420841F8400047FF4000400001FFC10001FF810000FFC +BE42:00000000208420843F8420841F8400047FF4000400001FFC0410041004101FFC +BE43:00000000208420843F8420841F8400047FF40004000003E000001FFC080807F0 +BE44:00000000000420842084208420843F8420842084208420841F84000400040004 +BE45:000000002084208420843F84208420841F84000400001FFC0004000400040004 +BE46:000000002084208420843F84208420841F84000400001F7C0104010401040104 +BE47:000000002084208420843F84208420841F84000400001F1001100110012801C6 +BE48:000000002084208420843F84208420841F840004000410041000100010000FFC +BE49:000000002084208420843F84208420841F8400040000107C1010101010280FC6 +BE4A:000000002084208420843F84208420841F84000400001038100010FE10440F38 +BE4B:000000002084208420843F84208420841F84000400001FFC1000100010000FFC +BE4C:000000002084208420843F84208420841F84000400001FFC00041FF810000FFC +BE4D:000000002084208420843F84208420841F84000400001F7C01041E0410040F04 +BE4E:000000002084208420843F84208420841F84000400001F7C01441E4410440F3C +BE4F:000000002084208420843F84208420841F84000400001F4401441E7C10440F3C +BE50:000000002084208420843F84208420841F84000400001F1001101E1010280FC6 +BE51:000000002084208420843F84208420841F84000400001F7C01401E7C10400F3C +BE52:000000002084208420843F84208420841F84000400001F7E01241E2410240F7E +BE53:000000002084208420843F84208420841F84000400001F3801001EFE10440F38 +BE54:000000002084208420843F84208420841F84000400001FFC1004100410040FFC +BE55:000000002084208420843F84208420841F8400040000100410041FFC10040FFC +BE56:000000002084208420843F84208420841F8400040000111011101F1011280FC6 +BE57:000000002084208420843F84208420841F84000400000080008001400630180C +BE58:000000002084208420843F84208420841F84000400000410041004100A2831C6 +BE59:000000002084208420843F84208420841F84000400000FF81004100410040FF8 +BE5A:000000002084208420843F84208420841F84000400001FFC008001400630180C +BE5B:000000002084208420843F84208420841F840004000003E000001FFC02201C1C +BE5C:000000002084208420843F84208420841F84000400001FFC00041FFC00040004 +BE5D:000000002084208420843F84208420841F84000400001FFC10001FF810000FFC +BE5E:000000002084208420843F84208420841F84000400001FFC0410041004101FFC +BE5F:000000002084208420843F84208420841F840004000003E000001FFC080807F0 +BE60:00000000000424842484248424843F8724842484248424841F84000400040004 +BE61:000000002484248424843F87248424841F84000400001FFC0004000400040004 +BE62:000000002484248424843F87248424841F84000400001F7C0104010401040104 +BE63:000000002484248424843F87248424841F84000400001F1001100110012801C6 +BE64:000000002484248424843F87248424841F840004000410041000100010000FFC +BE65:000000002484248424843F87248424841F8400040000107C1010101010280FC6 +BE66:000000002484248424843F87248424841F84000400001038100010FE10440F38 +BE67:000000002484248424843F87248424841F84000400001FFC1000100010000FFC +BE68:000000002484248424843F87248424841F84000400001FFC00041FF810000FFC +BE69:000000002484248424843F87248424841F84000400001F7C01041E0410040F04 +BE6A:000000002484248424843F87248424841F84000400001F7C01441E4410440F3C +BE6B:000000002484248424843F87248424841F84000400001F4401441E7C10440F3C +BE6C:000000002484248424843F87248424841F84000400001F1001101E1010280FC6 +BE6D:000000002484248424843F87248424841F84000400001F7C01401E7C10400F3C +BE6E:000000002484248424843F87248424841F84000400001F7E01241E2410240F7E +BE6F:000000002484248424843F87248424841F84000400001F3801001EFE10440F38 +BE70:000000002484248424843F87248424841F84000400001FFC1004100410040FFC +BE71:000000002484248424843F87248424841F8400040000100410041FFC10040FFC +BE72:000000002484248424843F87248424841F8400040000111011101F1011280FC6 +BE73:000000002484248424843F87248424841F84000400000080008001400630180C +BE74:000000002484248424843F87248424841F84000400000410041004100A2831C6 +BE75:000000002484248424843F87248424841F84000400000FF81004100410040FF8 +BE76:000000002484248424843F87248424841F84000400001FFC008001400630180C +BE77:000000002484248424843F87248424841F840004000003E000001FFC02201C1C +BE78:000000002484248424843F87248424841F84000400001FFC00041FFC00040004 +BE79:000000002484248424843F87248424841F84000400001FFC10001FF810000FFC +BE7A:000000002484248424843F87248424841F84000400001FFC0410041004101FFC +BE7B:000000002484248424843F87248424841F840004000003E000001FFC080807F0 +BE7C:00000000001224922492249224923F9E24922492249224921F92001200120012 +BE7D:000000002492249224923F9E249224921F92001200000FFE0002000200020002 +BE7E:000000002492249224923F9E249224921F92001200000FBE0082008200820082 +BE7F:000000002492249224923F9E249224921F92001200000F8800880088009400E3 +BE80:000000002492249224923F9E249224921F9200120012081208000800080007FE +BE81:000000002492249224923F9E249224921F9200120000083E08080808081407E3 +BE82:000000002492249224923F9E249224921F9200120000081C0800087F0822079C +BE83:000000002492249224923F9E249224921F92001200000FFE08000800080007FE +BE84:000000002492249224923F9E249224921F92001200000FFE00020FFC080007FE +BE85:000000002492249224923F9E249224921F92001200000FBE00820F0208020782 +BE86:000000002492249224923F9E249224921F92001200000FBE00A20F220822079E +BE87:000000002492249224923F9E249224921F92001200000FA200A20F3E0822079E +BE88:000000002492249224923F9E249224921F92001200000F8800880F08081407E3 +BE89:000000002492249224923F9E249224921F92001200000FBE00A00F3E0820079E +BE8A:000000002492249224923F9E249224921F92001200000FBF00920F12081207BF +BE8B:000000002492249224923F9E249224921F92001200000F9C00800F7F0822079C +BE8C:000000002492249224923F9E249224921F92001200000FFE08020802080207FE +BE8D:000000002492249224923F9E249224921F9200120000080208020FFE080207FE +BE8E:000000002492249224923F9E249224921F9200120000088808880F88089407E3 +BE8F:000000002492249224923F9E249224921F92001200000040004000A003180C06 +BE90:000000002492249224923F9E249224921F9200120000020802080208051418E3 +BE91:000000002492249224923F9E249224921F920012000007FC08020802080207FC +BE92:000000002492249224923F9E249224921F92001200000FFE004000A003180C06 +BE93:000000002492249224923F9E249224921F920012000001F000000FFE01100E0E +BE94:000000002492249224923F9E249224921F92001200000FFE00020FFE00020002 +BE95:000000002492249224923F9E249224921F92001200000FFE08000FFC080007FE +BE96:000000002492249224923F9E249224921F92001200000FFE0208020802080FFE +BE97:000000002492249224923F9E249224921F920012000001F000000FFE040403F8 +BE98:00000000000424842484248424873F8424842487248424841F84000400040004 +BE99:000000002484248424873F84248424871F84000400001FFC0004000400040004 +BE9A:000000002484248424873F84248424871F84000400001F7C0104010401040104 +BE9B:000000002484248424873F84248424871F84000400001F1001100110012801C6 +BE9C:000000002484248424873F84248424871F840004000410041000100010000FFC +BE9D:000000002484248424873F84248424871F8400040000107C1010101010280FC6 +BE9E:000000002484248424873F84248424871F84000400001038100010FE10440F38 +BE9F:000000002484248424873F84248424871F84000400001FFC1000100010000FFC +BEA0:000000002484248424873F84248424871F84000400001FFC00041FF810000FFC +BEA1:000000002484248424873F84248424871F84000400001F7C01041E0410040F04 +BEA2:000000002484248424873F84248424871F84000400001F7C01441E4410440F3C +BEA3:000000002484248424873F84248424871F84000400001F4401441E7C10440F3C +BEA4:000000002484248424873F84248424871F84000400001F1001101E1010280FC6 +BEA5:000000002484248424873F84248424871F84000400001F7C01401E7C10400F3C +BEA6:000000002484248424873F84248424871F84000400001F7E01241E2410240F7E +BEA7:000000002484248424873F84248424871F84000400001F3801001EFE10440F38 +BEA8:000000002484248424873F84248424871F84000400001FFC1004100410040FFC +BEA9:000000002484248424873F84248424871F8400040000100410041FFC10040FFC +BEAA:000000002484248424873F84248424871F8400040000111011101F1011280FC6 +BEAB:000000002484248424873F84248424871F84000400000080008001400630180C +BEAC:000000002484248424873F84248424871F84000400000410041004100A2831C6 +BEAD:000000002484248424873F84248424871F84000400000FF81004100410040FF8 +BEAE:000000002484248424873F84248424871F84000400001FFC008001400630180C +BEAF:000000002484248424873F84248424871F840004000003E000001FFC02201C1C +BEB0:000000002484248424873F84248424871F84000400001FFC00041FFC00040004 +BEB1:000000002484248424873F84248424871F84000400001FFC10001FF810000FFC +BEB2:000000002484248424873F84248424871F84000400001FFC0410041004101FFC +BEB3:000000002484248424873F84248424871F840004000003E000001FFC080807F0 +BEB4:000000000012249224922492249E3F922492249E249224921F92001200120012 +BEB5:0000000024922492249E3F922492249E1F92001200000FFE0002000200020002 +BEB6:0000000024922492249E3F922492249E1F92001200000FBE0082008200820082 +BEB7:0000000024922492249E3F922492249E1F92001200000F8800880088009400E3 +BEB8:0000000024922492249E3F922492249E1F9200120012081208000800080007FE +BEB9:0000000024922492249E3F922492249E1F9200120000083E08080808081407E3 +BEBA:0000000024922492249E3F922492249E1F9200120000081C0800087F0822079C +BEBB:0000000024922492249E3F922492249E1F92001200000FFE08000800080007FE +BEBC:0000000024922492249E3F922492249E1F92001200000FFE00020FFC080007FE +BEBD:0000000024922492249E3F922492249E1F92001200000FBE00820F0208020782 +BEBE:0000000024922492249E3F922492249E1F92001200000FBE00A20F220822079E +BEBF:0000000024922492249E3F922492249E1F92001200000FA200A20F3E0822079E +BEC0:0000000024922492249E3F922492249E1F92001200000F8800880F08081407E3 +BEC1:0000000024922492249E3F922492249E1F92001200000FBE00A00F3E0820079E +BEC2:0000000024922492249E3F922492249E1F92001200000FBF00920F12081207BF +BEC3:0000000024922492249E3F922492249E1F92001200000F9C00800F7F0822079C +BEC4:0000000024922492249E3F922492249E1F92001200000FFE08020802080207FE +BEC5:0000000024922492249E3F922492249E1F9200120000080208020FFE080207FE +BEC6:0000000024922492249E3F922492249E1F9200120000088808880F88089407E3 +BEC7:0000000024922492249E3F922492249E1F92001200000040004000A003180C06 +BEC8:0000000024922492249E3F922492249E1F9200120000020802080208051418E3 +BEC9:0000000024922492249E3F922492249E1F920012000007FC08020802080207FC +BECA:0000000024922492249E3F922492249E1F92001200000FFE004000A003180C06 +BECB:0000000024922492249E3F922492249E1F920012000001F000000FFE01100E0E +BECC:0000000024922492249E3F922492249E1F92001200000FFE00020FFE00020002 +BECD:0000000024922492249E3F922492249E1F92001200000FFE08000FFC080007FE +BECE:0000000024922492249E3F922492249E1F92001200000FFE0208020802080FFE +BECF:0000000024922492249E3F922492249E1F920012000001F000000FFE040403F8 +BED0:00000000000424842484248424843FBC24842484248424841F84000400040004 +BED1:000000002484248424843FBC248424841F84000400001FFC0004000400040004 +BED2:000000002484248424843FBC248424841F84000400001F7C0104010401040104 +BED3:000000002484248424843FBC248424841F84000400001F1001100110012801C6 +BED4:000000002484248424843FBC248424841F840004000410041000100010000FFC +BED5:000000002484248424843FBC248424841F8400040000107C1010101010280FC6 +BED6:000000002484248424843FBC248424841F84000400001038100010FE10440F38 +BED7:000000002484248424843FBC248424841F84000400001FFC1000100010000FFC +BED8:000000002484248424843FBC248424841F84000400001FFC00041FF810000FFC +BED9:000000002484248424843FBC248424841F84000400001F7C01041E0410040F04 +BEDA:000000002484248424843FBC248424841F84000400001F7C01441E4410440F3C +BEDB:000000002484248424843FBC248424841F84000400001F4401441E7C10440F3C +BEDC:000000002484248424843FBC248424841F84000400001F1001101E1010280FC6 +BEDD:000000002484248424843FBC248424841F84000400001F7C01401E7C10400F3C +BEDE:000000002484248424843FBC248424841F84000400001F7E01241E2410240F7E +BEDF:000000002484248424843FBC248424841F84000400001F3801001EFE10440F38 +BEE0:000000002484248424843FBC248424841F84000400001FFC1004100410040FFC +BEE1:000000002484248424843FBC248424841F8400040000100410041FFC10040FFC +BEE2:000000002484248424843FBC248424841F8400040000111011101F1011280FC6 +BEE3:000000002484248424843FBC248424841F84000400000080008001400630180C +BEE4:000000002484248424843FBC248424841F84000400000410041004100A2831C6 +BEE5:000000002484248424843FBC248424841F84000400000FF81004100410040FF8 +BEE6:000000002484248424843FBC248424841F84000400001FFC008001400630180C +BEE7:000000002484248424843FBC248424841F840004000003E000001FFC02201C1C +BEE8:000000002484248424843FBC248424841F84000400001FFC00041FFC00040004 +BEE9:000000002484248424843FBC248424841F84000400001FFC10001FF810000FFC +BEEA:000000002484248424843FBC248424841F84000400001FFC0410041004101FFC +BEEB:000000002484248424843FBC248424841F840004000003E000001FFC080807F0 +BEEC:00000000001224922492249224923FF224922492249224921F92001200120012 +BEED:000000002492249224923FF2249224921F92001200000FFE0002000200020002 +BEEE:000000002492249224923FF2249224921F92001200000FBE0082008200820082 +BEEF:000000002492249224923FF2249224921F92001200000F8800880088009400E3 +BEF0:000000002492249224923FF2249224921F9200120012081208000800080007FE +BEF1:000000002492249224923FF2249224921F9200120000083E08080808081407E3 +BEF2:000000002492249224923FF2249224921F9200120000081C0800087F0822079C +BEF3:000000002492249224923FF2249224921F92001200000FFE08000800080007FE +BEF4:000000002492249224923FF2249224921F92001200000FFE00020FFC080007FE +BEF5:000000002492249224923FF2249224921F92001200000FBE00820F0208020782 +BEF6:000000002492249224923FF2249224921F92001200000FBE00A20F220822079E +BEF7:000000002492249224923FF2249224921F92001200000FA200A20F3E0822079E +BEF8:000000002492249224923FF2249224921F92001200000F8800880F08081407E3 +BEF9:000000002492249224923FF2249224921F92001200000FBE00A00F3E0820079E +BEFA:000000002492249224923FF2249224921F92001200000FBF00920F12081207BF +BEFB:000000002492249224923FF2249224921F92001200000F9C00800F7F0822079C +BEFC:000000002492249224923FF2249224921F92001200000FFE08020802080207FE +BEFD:000000002492249224923FF2249224921F9200120000080208020FFE080207FE +BEFE:000000002492249224923FF2249224921F9200120000088808880F88089407E3 +BEFF:000000002492249224923FF2249224921F92001200000040004000A003180C06 +BF00:000000002492249224923FF2249224921F9200120000020802080208051418E3 +BF01:000000002492249224923FF2249224921F920012000007FC08020802080207FC +BF02:000000002492249224923FF2249224921F92001200000FFE004000A003180C06 +BF03:000000002492249224923FF2249224921F920012000001F000000FFE01100E0E +BF04:000000002492249224923FF2249224921F92001200000FFE00020FFE00020002 +BF05:000000002492249224923FF2249224921F92001200000FFE08000FFC080007FE +BF06:000000002492249224923FF2249224921F92001200000FFE0208020802080FFE +BF07:000000002492249224923FF2249224921F920012000001F000000FFE040403F8 +BF08:00000000000424842484248424BC3F84248424BC248424841F84000400040004 +BF09:000000002484248424BC3F84248424BC1F84000400001FFC0004000400040004 +BF0A:000000002484248424BC3F84248424BC1F84000400001F7C0104010401040104 +BF0B:000000002484248424BC3F84248424BC1F84000400001F1001100110012801C6 +BF0C:000000002484248424BC3F84248424BC1F840004000410041000100010000FFC +BF0D:000000002484248424BC3F84248424BC1F8400040000107C1010101010280FC6 +BF0E:000000002484248424BC3F84248424BC1F84000400001038100010FE10440F38 +BF0F:000000002484248424BC3F84248424BC1F84000400001FFC1000100010000FFC +BF10:000000002484248424BC3F84248424BC1F84000400001FFC00041FF810000FFC +BF11:000000002484248424BC3F84248424BC1F84000400001F7C01041E0410040F04 +BF12:000000002484248424BC3F84248424BC1F84000400001F7C01441E4410440F3C +BF13:000000002484248424BC3F84248424BC1F84000400001F4401441E7C10440F3C +BF14:000000002484248424BC3F84248424BC1F84000400001F1001101E1010280FC6 +BF15:000000002484248424BC3F84248424BC1F84000400001F7C01401E7C10400F3C +BF16:000000002484248424BC3F84248424BC1F84000400001F7E01241E2410240F7E +BF17:000000002484248424BC3F84248424BC1F84000400001F3801001EFE10440F38 +BF18:000000002484248424BC3F84248424BC1F84000400001FFC1004100410040FFC +BF19:000000002484248424BC3F84248424BC1F8400040000100410041FFC10040FFC +BF1A:000000002484248424BC3F84248424BC1F8400040000111011101F1011280FC6 +BF1B:000000002484248424BC3F84248424BC1F84000400000080008001400630180C +BF1C:000000002484248424BC3F84248424BC1F84000400000410041004100A2831C6 +BF1D:000000002484248424BC3F84248424BC1F84000400000FF81004100410040FF8 +BF1E:000000002484248424BC3F84248424BC1F84000400001FFC008001400630180C +BF1F:000000002484248424BC3F84248424BC1F840004000003E000001FFC02201C1C +BF20:000000002484248424BC3F84248424BC1F84000400001FFC00041FFC00040004 +BF21:000000002484248424BC3F84248424BC1F84000400001FFC10001FF810000FFC +BF22:000000002484248424BC3F84248424BC1F84000400001FFC0410041004101FFC +BF23:000000002484248424BC3F84248424BC1F840004000003E000001FFC080807F0 +BF24:00000000001224922492249224F23F92249224F2249224921F92001200120012 +BF25:000000002492249224F23F92249224F21F92001200000FFE0002000200020002 +BF26:000000002492249224F23F92249224F21F92001200000FBE0082008200820082 +BF27:000000002492249224F23F92249224F21F92001200000F8800880088009400E3 +BF28:000000002492249224F23F92249224F21F9200120012081208000800080007FE +BF29:000000002492249224F23F92249224F21F9200120000083E08080808081407E3 +BF2A:000000002492249224F23F92249224F21F9200120000081C0800087F0822079C +BF2B:000000002492249224F23F92249224F21F92001200000FFE08000800080007FE +BF2C:000000002492249224F23F92249224F21F92001200000FFE00020FFC080007FE +BF2D:000000002492249224F23F92249224F21F92001200000FBE00820F0208020782 +BF2E:000000002492249224F23F92249224F21F92001200000FBE00A20F220822079E +BF2F:000000002492249224F23F92249224F21F92001200000FA200A20F3E0822079E +BF30:000000002492249224F23F92249224F21F92001200000F8800880F08081407E3 +BF31:000000002492249224F23F92249224F21F92001200000FBE00A00F3E0820079E +BF32:000000002492249224F23F92249224F21F92001200000FBF00920F12081207BF +BF33:000000002492249224F23F92249224F21F92001200000F9C00800F7F0822079C +BF34:000000002492249224F23F92249224F21F92001200000FFE08020802080207FE +BF35:000000002492249224F23F92249224F21F9200120000080208020FFE080207FE +BF36:000000002492249224F23F92249224F21F9200120000088808880F88089407E3 +BF37:000000002492249224F23F92249224F21F92001200000040004000A003180C06 +BF38:000000002492249224F23F92249224F21F9200120000020802080208051418E3 +BF39:000000002492249224F23F92249224F21F920012000007FC08020802080207FC +BF3A:000000002492249224F23F92249224F21F92001200000FFE004000A003180C06 +BF3B:000000002492249224F23F92249224F21F920012000001F000000FFE01100E0E +BF3C:000000002492249224F23F92249224F21F92001200000FFE00020FFE00020002 +BF3D:000000002492249224F23F92249224F21F92001200000FFE08000FFC080007FE +BF3E:000000002492249224F23F92249224F21F92001200000FFE0208020802080FFE +BF3F:000000002492249224F23F92249224F21F920012000001F000000FFE040403F8 +BF40:0000000000001144114411441F7C114411440F3C0080008000807FFF00000000 +BF41:00000000114411441F7C11440F3C008000807FFF00001FFC0004000400040004 +BF42:00000000114411441F7C11440F3C008000807FFF00001F7C0104010401040104 +BF43:00000000114411441F7C11440F3C008000807FFF00001F1001100110012801C6 +BF44:00000000114411441F7C11440F3C008000807FFF000010001000100010000FFC +BF45:00000000114411441F7C11440F3C008000807FFF0000107C1010101010280FC6 +BF46:00000000114411441F7C11440F3C008000807FFF00001038100010FE10440F38 +BF47:00000000114411441F7C11440F3C008000807FFF00001FFC1000100010000FFC +BF48:00000000114411441F7C11440F3C008000807FFF00001FFC00041FF810000FFC +BF49:00000000114411441F7C11440F3C008000807FFF00001F7C01041E0410040F04 +BF4A:00000000114411441F7C11440F3C008000807FFF00001F7C01441E4410440F3C +BF4B:00000000114411441F7C11440F3C008000807FFF00001F4401441E7C10440F3C +BF4C:00000000114411441F7C11440F3C008000807FFF00001F1001101E1010280FC6 +BF4D:00000000114411441F7C11440F3C008000807FFF00001F7C01401E7C10400F3C +BF4E:00000000114411441F7C11440F3C008000807FFF00001F7E01241E2410240F7E +BF4F:00000000114411441F7C11440F3C008000807FFF00001F3801001EFE10440F38 +BF50:00000000114411441F7C11440F3C008000807FFF00001FFC1004100410040FFC +BF51:00000000114411441F7C11440F3C008000807FFF0000100410041FFC10040FFC +BF52:00000000114411441F7C11440F3C008000807FFF0000111011101F1011280FC6 +BF53:00000000114411441F7C11440F3C008000807FFF00000080008001400630180C +BF54:00000000114411441F7C11440F3C008000807FFF00000410041004100A2831C6 +BF55:00000000114411441F7C11440F3C008000807FFF00000FF81004100410040FF8 +BF56:00000000114411441F7C11440F3C008000807FFF00001FFC008001400630180C +BF57:00000000114411441F7C11440F3C008000807FFF000003E000001FFC02201C1C +BF58:00000000114411441F7C11440F3C008000807FFF00001FFC00041FFC00040004 +BF59:00000000114411441F7C11440F3C008000807FFF00001FFC10001FF810000FFC +BF5A:00000000114411441F7C11440F3C008000807FFF00001FFC0410041004101FFC +BF5B:00000000114411441F7C11440F3C008000807FFF000003E000001FFC080807F0 +BF5C:0000000000042484248424843F84248724841F840404040404047FF400040004 +BF5D:00000000248424843F8424871F84040404047FF400001FFC0004000400040004 +BF5E:00000000248424843F8424871F84040404047FF400001F7C0104010401040104 +BF5F:00000000248424843F8424871F84040404047FF400001F1001100110012801C6 +BF60:00000000248424843F8424871F84040404047FF4000410041000100010000FFC +BF61:00000000248424843F8424871F84040404047FF40000107C1010101010280FC6 +BF62:00000000248424843F8424871F84040404047FF400001038100010FE10440F38 +BF63:00000000248424843F8424871F84040404047FF400001FFC1000100010000FFC +BF64:00000000248424843F8424871F84040404047FF400001FFC00041FF810000FFC +BF65:00000000248424843F8424871F84040404047FF400001F7C01041E0410040F04 +BF66:00000000248424843F8424871F84040404047FF400001F7C01441E4410440F3C +BF67:00000000248424843F8424871F84040404047FF400001F4401441E7C10440F3C +BF68:00000000248424843F8424871F84040404047FF400001F1001101E1010280FC6 +BF69:00000000248424843F8424871F84040404047FF400001F7C01401E7C10400F3C +BF6A:00000000248424843F8424871F84040404047FF400001F7E01241E2410240F7E +BF6B:00000000248424843F8424871F84040404047FF400001F3801001EFE10440F38 +BF6C:00000000248424843F8424871F84040404047FF400001FFC1004100410040FFC +BF6D:00000000248424843F8424871F84040404047FF40000100410041FFC10040FFC +BF6E:00000000248424843F8424871F84040404047FF40000111011101F1011280FC6 +BF6F:00000000248424843F8424871F84040404047FF400000080008001400630180C +BF70:00000000248424843F8424871F84040404047FF400000410041004100A2831C6 +BF71:00000000248424843F8424871F84040404047FF400000FF81004100410040FF8 +BF72:00000000248424843F8424871F84040404047FF400001FFC008001400630180C +BF73:00000000248424843F8424871F84040404047FF4000003E000001FFC02201C1C +BF74:00000000248424843F8424871F84040404047FF400001FFC00041FFC00040004 +BF75:00000000248424843F8424871F84040404047FF400001FFC10001FF810000FFC +BF76:00000000248424843F8424871F84040404047FF400001FFC0410041004101FFC +BF77:00000000248424843F8424871F84040404047FF4000003E000001FFC080807F0 +BF78:0000000000122492249224923F92249E24921F920412041204127FD200120012 +BF79:00000000249224923F92249E1F92041204127FD200000FFE0002000200020002 +BF7A:00000000249224923F92249E1F92041204127FD200000FBE0082008200820082 +BF7B:00000000249224923F92249E1F92041204127FD200000F8800880088009400E3 +BF7C:00000000249224923F92249E1F92041204127FD20012081208000800080007FE +BF7D:00000000249224923F92249E1F92041204127FD20000083E08080808081407E3 +BF7E:00000000249224923F92249E1F92041204127FD20000081C0800087F0822079C +BF7F:00000000249224923F92249E1F92041204127FD200000FFE08000800080007FE +BF80:00000000249224923F92249E1F92041204127FD200000FFE00020FFC080007FE +BF81:00000000249224923F92249E1F92041204127FD200000FBE00820F0208020782 +BF82:00000000249224923F92249E1F92041204127FD200000FBE00A20F220822079E +BF83:00000000249224923F92249E1F92041204127FD200000FA200A20F3E0822079E +BF84:00000000249224923F92249E1F92041204127FD200000F8800880F08081407E3 +BF85:00000000249224923F92249E1F92041204127FD200000FBE00A00F3E0820079E +BF86:00000000249224923F92249E1F92041204127FD200000FBF00920F12081207BF +BF87:00000000249224923F92249E1F92041204127FD200000F9C00800F7F0822079C +BF88:00000000249224923F92249E1F92041204127FD200000FFE08020802080207FE +BF89:00000000249224923F92249E1F92041204127FD20000080208020FFE080207FE +BF8A:00000000249224923F92249E1F92041204127FD20000088808880F88089407E3 +BF8B:00000000249224923F92249E1F92041204127FD200000040004000A003180C06 +BF8C:00000000249224923F92249E1F92041204127FD20000020802080208051418E3 +BF8D:00000000249224923F92249E1F92041204127FD2000007FC08020802080207FC +BF8E:00000000249224923F92249E1F92041204127FD200000FFE004000A003180C06 +BF8F:00000000249224923F92249E1F92041204127FD2000001F000000FFE01100E0E +BF90:00000000249224923F92249E1F92041204127FD200000FFE00020FFE00020002 +BF91:00000000249224923F92249E1F92041204127FD200000FFE08000FFC080007FE +BF92:00000000249224923F92249E1F92041204127FD200000FFE0208020802080FFE +BF93:00000000249224923F92249E1F92041204127FD2000001F000000FFE040403F8 +BF94:0000000000042484248424843F84248424841F840404040404047FF400040004 +BF95:00000000248424843F8424841F84040404047FF400001FFC0004000400040004 +BF96:00000000248424843F8424841F84040404047FF400001F7C0104010401040104 +BF97:00000000248424843F8424841F84040404047FF400001F1001100110012801C6 +BF98:00000000248424843F8424841F84040404047FF4000410041000100010000FFC +BF99:00000000248424843F8424841F84040404047FF40000107C1010101010280FC6 +BF9A:00000000248424843F8424841F84040404047FF400001038100010FE10440F38 +BF9B:00000000248424843F8424841F84040404047FF400001FFC1000100010000FFC +BF9C:00000000248424843F8424841F84040404047FF400001FFC00041FF810000FFC +BF9D:00000000248424843F8424841F84040404047FF400001F7C01041E0410040F04 +BF9E:00000000248424843F8424841F84040404047FF400001F7C01441E4410440F3C +BF9F:00000000248424843F8424841F84040404047FF400001F4401441E7C10440F3C +BFA0:00000000248424843F8424841F84040404047FF400001F1001101E1010280FC6 +BFA1:00000000248424843F8424841F84040404047FF400001F7C01401E7C10400F3C +BFA2:00000000248424843F8424841F84040404047FF400001F7E01241E2410240F7E +BFA3:00000000248424843F8424841F84040404047FF400001F3801001EFE10440F38 +BFA4:00000000248424843F8424841F84040404047FF400001FFC1004100410040FFC +BFA5:00000000248424843F8424841F84040404047FF40000100410041FFC10040FFC +BFA6:00000000248424843F8424841F84040404047FF40000111011101F1011280FC6 +BFA7:00000000248424843F8424841F84040404047FF400000080008001400630180C +BFA8:00000000248424843F8424841F84040404047FF400000410041004100A2831C6 +BFA9:00000000248424843F8424841F84040404047FF400000FF81004100410040FF8 +BFAA:00000000248424843F8424841F84040404047FF400001FFC008001400630180C +BFAB:00000000248424843F8424841F84040404047FF4000003E000001FFC02201C1C +BFAC:00000000248424843F8424841F84040404047FF400001FFC00041FFC00040004 +BFAD:00000000248424843F8424841F84040404047FF400001FFC10001FF810000FFC +BFAE:00000000248424843F8424841F84040404047FF400001FFC0410041004101FFC +BFAF:00000000248424843F8424841F84040404047FF4000003E000001FFC080807F0 +BFB0:0000000000001144114411441F7C114411440F3C0220022002207FFF00000000 +BFB1:00000000114411441F7C11440F3C022002207FFF00001FFC0004000400040004 +BFB2:00000000114411441F7C11440F3C022002207FFF00001F7C0104010401040104 +BFB3:00000000114411441F7C11440F3C022002207FFF00001F1001100110012801C6 +BFB4:00000000114411441F7C11440F3C022002207FFF000010001000100010000FFC +BFB5:00000000114411441F7C11440F3C022002207FFF0000107C1010101010280FC6 +BFB6:00000000114411441F7C11440F3C022002207FFF00001038100010FE10440F38 +BFB7:00000000114411441F7C11440F3C022002207FFF00001FFC1000100010000FFC +BFB8:00000000114411441F7C11440F3C022002207FFF00001FFC00041FF810000FFC +BFB9:00000000114411441F7C11440F3C022002207FFF00001F7C01041E0410040F04 +BFBA:00000000114411441F7C11440F3C022002207FFF00001F7C01441E4410440F3C +BFBB:00000000114411441F7C11440F3C022002207FFF00001F4401441E7C10440F3C +BFBC:00000000114411441F7C11440F3C022002207FFF00001F1001101E1010280FC6 +BFBD:00000000114411441F7C11440F3C022002207FFF00001F7C01401E7C10400F3C +BFBE:00000000114411441F7C11440F3C022002207FFF00001F7E01241E2410240F7E +BFBF:00000000114411441F7C11440F3C022002207FFF00001F3801001EFE10440F38 +BFC0:00000000114411441F7C11440F3C022002207FFF00001FFC1004100410040FFC +BFC1:00000000114411441F7C11440F3C022002207FFF0000100410041FFC10040FFC +BFC2:00000000114411441F7C11440F3C022002207FFF0000111011101F1011280FC6 +BFC3:00000000114411441F7C11440F3C022002207FFF00000080008001400630180C +BFC4:00000000114411441F7C11440F3C022002207FFF00000410041004100A2831C6 +BFC5:00000000114411441F7C11440F3C022002207FFF00000FF81004100410040FF8 +BFC6:00000000114411441F7C11440F3C022002207FFF00001FFC008001400630180C +BFC7:00000000114411441F7C11440F3C022002207FFF000003E000001FFC02201C1C +BFC8:00000000114411441F7C11440F3C022002207FFF00001FFC00041FFC00040004 +BFC9:00000000114411441F7C11440F3C022002207FFF00001FFC10001FF810000FFC +BFCA:00000000114411441F7C11440F3C022002207FFF00001FFC0410041004101FFC +BFCB:00000000114411441F7C11440F3C022002207FFF000003E000001FFC080807F0 +BFCC:00000000114411441F7C11440F3C000000007FFF008000800080008000800080 +BFCD:00000000114411441F7C11440F3C00007FFF008000801FFC0004000400040004 +BFCE:00000000114411441F7C11440F3C00007FFF008000801F7C0104010401040104 +BFCF:00000000114411441F7C11440F3C00007FFF008000801F1001100110012801C6 +BFD0:00000000114411441F7C11440F3C000000007FFF008010801080100010000FFC +BFD1:00000000114411441F7C11440F3C00007FFF00800080107C1010101010280FC6 +BFD2:00000000114411441F7C11440F3C00007FFF008000801038100010FE10440F38 +BFD3:00000000114411441F7C11440F3C00007FFF008000801FFC1000100010000FFC +BFD4:00000000114411441F7C11440F3C00007FFF008000801FFC00041FF810000FFC +BFD5:00000000114411441F7C11440F3C00007FFF008000801F7C01041E0410040F04 +BFD6:00000000114411441F7C11440F3C00007FFF008000801F7C01441E4410440F3C +BFD7:00000000114411441F7C11440F3C00007FFF008000801F4401441E7C10440F3C +BFD8:00000000114411441F7C11440F3C00007FFF008000801F1001101E1010280FC6 +BFD9:00000000114411441F7C11440F3C00007FFF008000801F7C01401E7C10400F3C +BFDA:00000000114411441F7C11440F3C00007FFF008000801F7E01241E2410240F7E +BFDB:00000000114411441F7C11440F3C00007FFF008000801F3801001EFE10440F38 +BFDC:00000000114411441F7C11440F3C00007FFF008000801FFC1004100410040FFC +BFDD:00000000114411441F7C11440F3C00007FFF00800080100410041FFC10040FFC +BFDE:00000000114411441F7C11440F3C00007FFF00800080111011101F1011280FC6 +BFDF:00000000114411441F7C11440F3C00007FFF008000800080008001400630180C +BFE0:00000000114411441F7C11440F3C00007FFF008000800410041004100A2831C6 +BFE1:00000000114411441F7C11440F3C00007FFF008000800FF81004100410040FF8 +BFE2:00000000114411441F7C11440F3C00007FFF008000801FFC008001400630180C +BFE3:00000000114411441F7C11440F3C00007FFF0080008003E000001FFC02201C1C +BFE4:00000000114411441F7C11440F3C00007FFF008000801FFC00041FFC00040004 +BFE5:00000000114411441F7C11440F3C00007FFF008000801FFC10001FF810000FFC +BFE6:00000000114411441F7C11440F3C00007FFF008000801FFC0410041004101FFC +BFE7:00000000114411441F7C11440F3C00007FFF0080008003E000001FFC080807F0 +BFE8:00000000248424843F8424841F84000400047FF404040404043C040404040404 +BFE9:00000000248424843F84249C1F8400047FF4040404001FFC0004000400040004 +BFEA:00000000248424843F84249C1F8400047FF4040404001F7C0104010401040104 +BFEB:00000000248424843F84249C1F8400047FF4040404001F1001100110012801C6 +BFEC:00000000248424843F8424841F8400047FF40404043C14041000100010000FFC +BFED:00000000248424843F84249C1F8400047FF404040400107C1010101010280FC6 +BFEE:00000000248424843F84249C1F8400047FF4040404001038100010FE10440F38 +BFEF:00000000248424843F84249C1F8400047FF4040404001FFC1000100010000FFC +BFF0:00000000248424843F84249C1F8400047FF4040404001FFC00041FF810000FFC +BFF1:00000000248424843F84249C1F8400047FF4040404001F7C01041E0410040F04 +BFF2:00000000248424843F84249C1F8400047FF4040404001F7C01441E4410440F3C +BFF3:00000000248424843F84249C1F8400047FF4040404001F4401441E7C10440F3C +BFF4:00000000248424843F84249C1F8400047FF4040404001F1001101E1010280FC6 +BFF5:00000000248424843F84249C1F8400047FF4040404001F7C01401E7C10400F3C +BFF6:00000000248424843F84249C1F8400047FF4040404001F7E01241E2410240F7E +BFF7:00000000248424843F84249C1F8400047FF4040404001F3801001EFE10440F38 +BFF8:00000000248424843F84249C1F8400047FF4040404001FFC1004100410040FFC +BFF9:00000000248424843F84249C1F8400047FF404040400100410041FFC10040FFC +BFFA:00000000248424843F84249C1F8400047FF404040400111011101F1011280FC6 +BFFB:00000000248424843F84249C1F8400047FF4040404000080008001400630180C +BFFC:00000000248424843F84249C1F8400047FF4040404000410041004100A2831C6 +BFFD:00000000248424843F84249C1F8400047FF4040404000FF81004100410040FF8 +BFFE:00000000248424843F84249C1F8400047FF4040404001FFC008001400630180C +BFFF:00000000248424843F84249C1F8400047FF40404040003E000001FFC02201C1C +C000:00000000248424843F84249C1F8400047FF4040404001FFC00041FFC00040004 +C001:00000000248424843F84249C1F8400047FF4040404001FFC10001FF810000FFC +C002:00000000248424843F84249C1F8400047FF4040404001FFC0410041004101FFC +C003:00000000248424843F84249C1F8400047FF40404040003E000001FFC080807F0 +C004:00000000249224923F9224921F92001200127FD20412041204F2041204120412 +C005:00000000249224923F9224F21F9200127FD2041204000FFE0002000200020002 +C006:00000000249224923F9224F21F9200127FD2041204000FBE0082008200820082 +C007:00000000249224923F9224F21F9200127FD2041204000F8800880088009400E3 +C008:00000000249224923F9224921F9200127FD2021202F20A1208000800080007FE +C009:00000000249224923F9224F21F9200127FD204120400083E08080808081407E3 +C00A:00000000249224923F9224F21F9200127FD204120400081C0800087F0822079C +C00B:00000000249224923F9224F21F9200127FD2041204000FFE08000800080007FE +C00C:00000000249224923F9224F21F9200127FD2041204000FFE00020FFC080007FE +C00D:00000000249224923F9224F21F9200127FD2041204000FBE00820F0208020782 +C00E:00000000249224923F9224F21F9200127FD2041204000FBE00A20F220822079E +C00F:00000000249224923F9224F21F9200127FD2041204000FA200A20F3E0822079E +C010:00000000249224923F9224F21F9200127FD2041204000F8800880F08081407E3 +C011:00000000249224923F9224F21F9200127FD2041204000FBE00A00F3E0820079E +C012:00000000249224923F9224F21F9200127FD2041204000FBF00920F12081207BF +C013:00000000249224923F9224F21F9200127FD2041204000F9C00800F7F0822079C +C014:00000000249224923F9224F21F9200127FD2041204000FFE08020802080207FE +C015:00000000249224923F9224F21F9200127FD204120400080208020FFE080207FE +C016:00000000249224923F9224F21F9200127FD204120400088808880F88089407E3 +C017:00000000249224923F9224F21F9200127FD2041204000040004000A003180C06 +C018:00000000249224923F9224F21F9200127FD204120400020802080208051418E3 +C019:00000000249224923F9224F21F9200127FD20412040007FC08020802080207FC +C01A:00000000249224923F9224F21F9200127FD2041204000FFE004000A003180C06 +C01B:00000000249224923F9224F21F9200127FD20412040001F000000FFE01100E0E +C01C:00000000249224923F9224F21F9200127FD2041204000FFE00020FFE00020002 +C01D:00000000249224923F9224F21F9200127FD2041204000FFE08000FFC080007FE +C01E:00000000249224923F9224F21F9200127FD2041204000FFE0208020802080FFE +C01F:00000000249224923F9224F21F9200127FD20412040001F000000FFE040403F8 +C020:00000000248424843F8424841F84000400047FF4040404040404040404040404 +C021:00000000248424843F8424841F8400047FF4040404001FFC0004000400040004 +C022:00000000248424843F8424841F8400047FF4040404001F7C0104010401040104 +C023:00000000248424843F8424841F8400047FF4040404001F1001100110012801C6 +C024:00000000248424843F8424841F8400047FF40404040414041000100010000FFC +C025:00000000248424843F8424841F8400047FF404040400107C1010101010280FC6 +C026:00000000248424843F8424841F8400047FF4040404001038100010FE10440F38 +C027:00000000248424843F8424841F8400047FF4040404001FFC1000100010000FFC +C028:00000000248424843F8424841F8400047FF4040404001FFC00041FF810000FFC +C029:00000000248424843F8424841F8400047FF4040404001F7C01041E0410040F04 +C02A:00000000248424843F8424841F8400047FF4040404001F7C01441E4410440F3C +C02B:00000000248424843F8424841F8400047FF4040404001F4401441E7C10440F3C +C02C:00000000248424843F8424841F8400047FF4040404001F1001101E1010280FC6 +C02D:00000000248424843F8424841F8400047FF4040404001F7C01401E7C10400F3C +C02E:00000000248424843F8424841F8400047FF4040404001F7E01241E2410240F7E +C02F:00000000248424843F8424841F8400047FF4040404001F3801001EFE10440F38 +C030:00000000248424843F8424841F8400047FF4040404001FFC1004100410040FFC +C031:00000000248424843F8424841F8400047FF404040400100410041FFC10040FFC +C032:00000000248424843F8424841F8400047FF404040400111011101F1011280FC6 +C033:00000000248424843F8424841F8400047FF4040404000080008001400630180C +C034:00000000248424843F8424841F8400047FF4040404000410041004100A2831C6 +C035:00000000248424843F8424841F8400047FF4040404000FF81004100410040FF8 +C036:00000000248424843F8424841F8400047FF4040404001FFC008001400630180C +C037:00000000248424843F8424841F8400047FF40404040003E000001FFC02201C1C +C038:00000000248424843F8424841F8400047FF4040404001FFC00041FFC00040004 +C039:00000000248424843F8424841F8400047FF4040404001FFC10001FF810000FFC +C03A:00000000248424843F8424841F8400047FF4040404001FFC0410041004101FFC +C03B:00000000248424843F8424841F8400047FF40404040003E000001FFC080807F0 +C03C:00000000114411441F7C11440F3C000000007FFF041004100410041004100410 +C03D:00000000114411441F7C11440F3C00007FFF022002201FFC0004000400040004 +C03E:00000000114411441F7C11440F3C00007FFF022002201F7C0104010401040104 +C03F:00000000114411441F7C11440F3C00007FFF022002201F1001100110012801C6 +C040:00000000114411441F7C11440F3C000000007FFF022012201220100010000FFC +C041:00000000114411441F7C11440F3C00007FFF02200220107C1010101010280FC6 +C042:00000000114411441F7C11440F3C00007FFF022002201038100010FE10440F38 +C043:00000000114411441F7C11440F3C00007FFF022002201FFC1000100010000FFC +C044:00000000114411441F7C11440F3C00007FFF022002201FFC00041FF810000FFC +C045:00000000114411441F7C11440F3C00007FFF022002201F7C01041E0410040F04 +C046:00000000114411441F7C11440F3C00007FFF022002201F7C01441E4410440F3C +C047:00000000114411441F7C11440F3C00007FFF022002201F4401441E7C10440F3C +C048:00000000114411441F7C11440F3C00007FFF022002201F1001101E1010280FC6 +C049:00000000114411441F7C11440F3C00007FFF022002201F7C01401E7C10400F3C +C04A:00000000114411441F7C11440F3C00007FFF022002201F7E01241E2410240F7E +C04B:00000000114411441F7C11440F3C00007FFF022002201F3801001EFE10440F38 +C04C:00000000114411441F7C11440F3C00007FFF022002201FFC1004100410040FFC +C04D:00000000114411441F7C11440F3C00007FFF02200220100410041FFC10040FFC +C04E:00000000114411441F7C11440F3C00007FFF02200220111011101F1011280FC6 +C04F:00000000114411441F7C11440F3C00007FFF022002200080008001400630180C +C050:00000000114411441F7C11440F3C00007FFF022002200410041004100A2831C6 +C051:00000000114411441F7C11440F3C00007FFF022002200FF81004100410040FF8 +C052:00000000114411441F7C11440F3C00007FFF022002201FFC008001400630180C +C053:00000000114411441F7C11440F3C00007FFF0220022003E000001FFC02201C1C +C054:00000000114411441F7C11440F3C00007FFF022002201FFC00041FFC00040004 +C055:00000000114411441F7C11440F3C00007FFF022002201FFC10001FF810000FFC +C056:00000000114411441F7C11440F3C00007FFF022002201FFC0410041004101FFC +C057:00000000114411441F7C11440F3C00007FFF0220022003E000001FFC080807F0 +C058:0000000000001144114411441F7C114411440F3C0000000000007FFF00000000 +C059:00000000114411441F7C11440F3C00007FFF000000001FFC0004000400040004 +C05A:00000000114411441F7C11440F3C00007FFF000000001F7C0104010401040104 +C05B:00000000114411441F7C11440F3C00007FFF000000001F1001100110012801C6 +C05C:00000000114411441F7C11440F3C000000007FFF000010001000100010000FFC +C05D:00000000114411441F7C11440F3C00007FFF00000000107C1010101010280FC6 +C05E:00000000114411441F7C11440F3C00007FFF000000001038100010FE10440F38 +C05F:00000000114411441F7C11440F3C00007FFF000000001FFC1000100010000FFC +C060:00000000114411441F7C11440F3C00007FFF000000001FFC00041FF810000FFC +C061:00000000114411441F7C11440F3C00007FFF000000001F7C01041E0410040F04 +C062:00000000114411441F7C11440F3C00007FFF000000001F7C01441E4410440F3C +C063:00000000114411441F7C11440F3C00007FFF000000001F4401441E7C10440F3C +C064:00000000114411441F7C11440F3C00007FFF000000001F1001101E1010280FC6 +C065:00000000114411441F7C11440F3C00007FFF000000001F7C01401E7C10400F3C +C066:00000000114411441F7C11440F3C00007FFF000000001F7E01241E2410240F7E +C067:00000000114411441F7C11440F3C00007FFF000000001F3801001EFE10440F38 +C068:00000000114411441F7C11440F3C00007FFF000000001FFC1004100410040FFC +C069:00000000114411441F7C11440F3C00007FFF00000000100410041FFC10040FFC +C06A:00000000114411441F7C11440F3C00007FFF00000000111011101F1011280FC6 +C06B:00000000114411441F7C11440F3C00007FFF000000000080008001400630180C +C06C:00000000114411441F7C11440F3C00007FFF000000000410041004100A2831C6 +C06D:00000000114411441F7C11440F3C00007FFF000000000FF81004100410040FF8 +C06E:00000000114411441F7C11440F3C00007FFF000000001FFC008001400630180C +C06F:00000000114411441F7C11440F3C00007FFF0000000003E000001FFC02201C1C +C070:00000000114411441F7C11440F3C00007FFF000000001FFC00041FFC00040004 +C071:00000000114411441F7C11440F3C00007FFF000000001FFC10001FF810000FFC +C072:00000000114411441F7C11440F3C00007FFF000000001FFC0410041004101FFC +C073:00000000114411441F7C11440F3C00007FFF0000000003E000001FFC080807F0 +C074:0000000000042484248424843F84248424841F840004000400047FF400040004 +C075:00000000248424843F8424841F8400047FF4000400001FFC0004000400040004 +C076:00000000248424843F8424841F8400047FF4000400001F7C0104010401040104 +C077:00000000248424843F8424841F8400047FF4000400001F1001100110012801C6 +C078:00000000248424843F8424841F84000400047FF4000410041000100010000FFC +C079:00000000248424843F8424841F8400047FF400040000107C1010101010280FC6 +C07A:00000000248424843F8424841F8400047FF4000400001038100010FE10440F38 +C07B:00000000248424843F8424841F8400047FF4000400001FFC1000100010000FFC +C07C:00000000248424843F8424841F8400047FF4000400001FFC00041FF810000FFC +C07D:00000000248424843F8424841F8400047FF4000400001F7C01041E0410040F04 +C07E:00000000248424843F8424841F8400047FF4000400001F7C01441E4410440F3C +C07F:00000000248424843F8424841F8400047FF4000400001F4401441E7C10440F3C +C080:00000000248424843F8424841F8400047FF4000400001F1001101E1010280FC6 +C081:00000000248424843F8424841F8400047FF4000400001F7C01401E7C10400F3C +C082:00000000248424843F8424841F8400047FF4000400001F7E01241E2410240F7E +C083:00000000248424843F8424841F8400047FF4000400001F3801001EFE10440F38 +C084:00000000248424843F8424841F8400047FF4000400001FFC1004100410040FFC +C085:00000000248424843F8424841F8400047FF400040000100410041FFC10040FFC +C086:00000000248424843F8424841F8400047FF400040000111011101F1011280FC6 +C087:00000000248424843F8424841F8400047FF4000400000080008001400630180C +C088:00000000248424843F8424841F8400047FF4000400000410041004100A2831C6 +C089:00000000248424843F8424841F8400047FF4000400000FF81004100410040FF8 +C08A:00000000248424843F8424841F8400047FF4000400001FFC008001400630180C +C08B:00000000248424843F8424841F8400047FF40004000003E000001FFC02201C1C +C08C:00000000248424843F8424841F8400047FF4000400001FFC00041FFC00040004 +C08D:00000000248424843F8424841F8400047FF4000400001FFC10001FF810000FFC +C08E:00000000248424843F8424841F8400047FF4000400001FFC0410041004101FFC +C08F:00000000248424843F8424841F8400047FF40004000003E000001FFC080807F0 +C090:00000000000424842484248424843F8424842484248424841F84000400040004 +C091:000000002484248424843F84248424841F84000400001FFC0004000400040004 +C092:000000002484248424843F84248424841F84000400001F7C0104010401040104 +C093:000000002484248424843F84248424841F84000400001F1001100110012801C6 +C094:000000002484248424843F84248424841F840004000410041000100010000FFC +C095:000000002484248424843F84248424841F8400040000107C1010101010280FC6 +C096:000000002484248424843F84248424841F84000400001038100010FE10440F38 +C097:000000002484248424843F84248424841F84000400001FFC1000100010000FFC +C098:000000002484248424843F84248424841F84000400001FFC00041FF810000FFC +C099:000000002484248424843F84248424841F84000400001F7C01041E0410040F04 +C09A:000000002484248424843F84248424841F84000400001F7C01441E4410440F3C +C09B:000000002484248424843F84248424841F84000400001F4401441E7C10440F3C +C09C:000000002484248424843F84248424841F84000400001F1001101E1010280FC6 +C09D:000000002484248424843F84248424841F84000400001F7C01401E7C10400F3C +C09E:000000002484248424843F84248424841F84000400001F7E01241E2410240F7E +C09F:000000002484248424843F84248424841F84000400001F3801001EFE10440F38 +C0A0:000000002484248424843F84248424841F84000400001FFC1004100410040FFC +C0A1:000000002484248424843F84248424841F8400040000100410041FFC10040FFC +C0A2:000000002484248424843F84248424841F8400040000111011101F1011280FC6 +C0A3:000000002484248424843F84248424841F84000400000080008001400630180C +C0A4:000000002484248424843F84248424841F84000400000410041004100A2831C6 +C0A5:000000002484248424843F84248424841F84000400000FF81004100410040FF8 +C0A6:000000002484248424843F84248424841F84000400001FFC008001400630180C +C0A7:000000002484248424843F84248424841F840004000003E000001FFC02201C1C +C0A8:000000002484248424843F84248424841F84000400001FFC00041FFC00040004 +C0A9:000000002484248424843F84248424841F84000400001FFC10001FF810000FFC +C0AA:000000002484248424843F84248424841F84000400001FFC0410041004101FFC +C0AB:000000002484248424843F84248424841F840004000003E000001FFC080807F0 +C0AC:00000000000404040404040404040A070A040A04110411042084000400040004 +C0AD:000000000404040404040A070A0411042084000400001FFC0004000400040004 +C0AE:000000000404040404040A070A0411042084000400001F7C0104010401040104 +C0AF:000000000404040404040A070A0411042084000400001F1001100110012801C6 +C0B0:000000000404040404040A070A04110420840004000410041000100010000FFC +C0B1:000000000404040404040A070A041104208400040000107C1010101010280FC6 +C0B2:000000000404040404040A070A0411042084000400001038100010FE10440F38 +C0B3:000000000404040404040A070A0411042084000400001FFC1000100010000FFC +C0B4:000000000404040404040A070A0411042084000400001FFC00041FF810000FFC +C0B5:000000000404040404040A070A0411042084000400001F7C01041E0410040F04 +C0B6:000000000404040404040A070A0411042084000400001F7C01441E4410440F3C +C0B7:000000000404040404040A070A0411042084000400001F4401441E7C10440F3C +C0B8:000000000404040404040A070A0411042084000400001F1001101E1010280FC6 +C0B9:000000000404040404040A070A0411042084000400001F7C01401E7C10400F3C +C0BA:000000000404040404040A070A0411042084000400001F7E01241E2410240F7E +C0BB:000000000404040404040A070A0411042084000400001F3801001EFE10440F38 +C0BC:000000000404040404040A070A0411042084000400001FFC1004100410040FFC +C0BD:000000000404040404040A070A041104208400040000100410041FFC10040FFC +C0BE:000000000404040404040A070A041104208400040000111011101F1011280FC6 +C0BF:000000000404040404040A070A0411042084000400000080008001400630180C +C0C0:000000000404040404040A070A0411042084000400000410041004100A2831C6 +C0C1:000000000404040404040A070A0411042084000400000FF81004100410040FF8 +C0C2:000000000404040404040A070A0411042084000400001FFC008001400630180C +C0C3:000000000404040404040A070A04110420840004000003E000001FFC02201C1C +C0C4:000000000404040404040A070A0411042084000400001FFC00041FFC00040004 +C0C5:000000000404040404040A070A0411042084000400001FFC10001FF810000FFC +C0C6:000000000404040404040A070A0411042084000400001FFC0410041004101FFC +C0C7:000000000404040404040A070A04110420840004000003E000001FFC080807F0 +C0C8:00000000001204120412041204120A1E0A120A12111211122092001200120012 +C0C9:000000000412041204120A1E0A1211122092001200000FFE0002000200020002 +C0CA:000000000412041204120A1E0A1211122092001200000FBE0082008200820082 +C0CB:000000000412041204120A1E0A1211122092001200000F8800880088009400E3 +C0CC:000000000412041204120A1E0A121112209200120012081208000800080007FE +C0CD:000000000412041204120A1E0A121112209200120000083E08080808081407E3 +C0CE:000000000412041204120A1E0A121112209200120000081C0800087F0822079C +C0CF:000000000412041204120A1E0A1211122092001200000FFE08000800080007FE +C0D0:000000000412041204120A1E0A1211122092001200000FFE00020FFC080007FE +C0D1:000000000412041204120A1E0A1211122092001200000FBE00820F0208020782 +C0D2:000000000412041204120A1E0A1211122092001200000FBE00A20F220822079E +C0D3:000000000412041204120A1E0A1211122092001200000FA200A20F3E0822079E +C0D4:000000000412041204120A1E0A1211122092001200000F8800880F08081407E3 +C0D5:000000000412041204120A1E0A1211122092001200000FBE00A00F3E0820079E +C0D6:000000000412041204120A1E0A1211122092001200000FBF00920F12081207BF +C0D7:000000000412041204120A1E0A1211122092001200000F9C00800F7F0822079C +C0D8:000000000412041204120A1E0A1211122092001200000FFE08020802080207FE +C0D9:000000000412041204120A1E0A121112209200120000080208020FFE080207FE +C0DA:000000000412041204120A1E0A121112209200120000088808880F88089407E3 +C0DB:000000000412041204120A1E0A1211122092001200000040004000A003180C06 +C0DC:000000000412041204120A1E0A121112209200120000020802080208051418E3 +C0DD:000000000412041204120A1E0A12111220920012000007FC08020802080207FC +C0DE:000000000412041204120A1E0A1211122092001200000FFE004000A003180C06 +C0DF:000000000412041204120A1E0A12111220920012000001F000000FFE01100E0E +C0E0:000000000412041204120A1E0A1211122092001200000FFE00020FFE00020002 +C0E1:000000000412041204120A1E0A1211122092001200000FFE08000FFC080007FE +C0E2:000000000412041204120A1E0A1211122092001200000FFE0208020802080FFE +C0E3:000000000412041204120A1E0A12111220920012000001F000000FFE040403F8 +C0E4:00000000000404040404040404070A040A040A07110411042084000400040004 +C0E5:000000000404040404070A040A0411072084000400001FFC0004000400040004 +C0E6:000000000404040404070A040A0411072084000400001F7C0104010401040104 +C0E7:000000000404040404070A040A0411072084000400001F1001100110012801C6 +C0E8:000000000404040404070A040A04110720840004000410041000100010000FFC +C0E9:000000000404040404070A040A041107208400040000107C1010101010280FC6 +C0EA:000000000404040404070A040A0411072084000400001038100010FE10440F38 +C0EB:000000000404040404070A040A0411072084000400001FFC1000100010000FFC +C0EC:000000000404040404070A040A0411072084000400001FFC00041FF810000FFC +C0ED:000000000404040404070A040A0411072084000400001F7C01041E0410040F04 +C0EE:000000000404040404070A040A0411072084000400001F7C01441E4410440F3C +C0EF:000000000404040404070A040A0411072084000400001F4401441E7C10440F3C +C0F0:000000000404040404070A040A0411072084000400001F1001101E1010280FC6 +C0F1:000000000404040404070A040A0411072084000400001F7C01401E7C10400F3C +C0F2:000000000404040404070A040A0411072084000400001F7E01241E2410240F7E +C0F3:000000000404040404070A040A0411072084000400001F3801001EFE10440F38 +C0F4:000000000404040404070A040A0411072084000400001FFC1004100410040FFC +C0F5:000000000404040404070A040A041107208400040000100410041FFC10040FFC +C0F6:000000000404040404070A040A041107208400040000111011101F1011280FC6 +C0F7:000000000404040404070A040A0411072084000400000080008001400630180C +C0F8:000000000404040404070A040A0411072084000400000410041004100A2831C6 +C0F9:000000000404040404070A040A0411072084000400000FF81004100410040FF8 +C0FA:000000000404040404070A040A0411072084000400001FFC008001400630180C +C0FB:000000000404040404070A040A04110720840004000003E000001FFC02201C1C +C0FC:000000000404040404070A040A0411072084000400001FFC00041FFC00040004 +C0FD:000000000404040404070A040A0411072084000400001FFC10001FF810000FFC +C0FE:000000000404040404070A040A0411072084000400001FFC0410041004101FFC +C0FF:000000000404040404070A040A04110720840004000003E000001FFC080807F0 +C100:000000000012041204120412041E0A120A120A1E111211122092001200120012 +C101:0000000004120412041E0A120A12111E2092001200000FFE0002000200020002 +C102:0000000004120412041E0A120A12111E2092001200000FBE0082008200820082 +C103:0000000004120412041E0A120A12111E2092001200000F8800880088009400E3 +C104:0000000004120412041E0A120A12111E209200120012081208000800080007FE +C105:0000000004120412041E0A120A12111E209200120000083E08080808081407E3 +C106:0000000004120412041E0A120A12111E209200120000081C0800087F0822079C +C107:0000000004120412041E0A120A12111E2092001200000FFE08000800080007FE +C108:0000000004120412041E0A120A12111E2092001200000FFE00020FFC080007FE +C109:0000000004120412041E0A120A12111E2092001200000FBE00820F0208020782 +C10A:0000000004120412041E0A120A12111E2092001200000FBE00A20F220822079E +C10B:0000000004120412041E0A120A12111E2092001200000FA200A20F3E0822079E +C10C:0000000004120412041E0A120A12111E2092001200000F8800880F08081407E3 +C10D:0000000004120412041E0A120A12111E2092001200000FBE00A00F3E0820079E +C10E:0000000004120412041E0A120A12111E2092001200000FBF00920F12081207BF +C10F:0000000004120412041E0A120A12111E2092001200000F9C00800F7F0822079C +C110:0000000004120412041E0A120A12111E2092001200000FFE08020802080207FE +C111:0000000004120412041E0A120A12111E209200120000080208020FFE080207FE +C112:0000000004120412041E0A120A12111E209200120000088808880F88089407E3 +C113:0000000004120412041E0A120A12111E2092001200000040004000A003180C06 +C114:0000000004120412041E0A120A12111E209200120000020802080208051418E3 +C115:0000000004120412041E0A120A12111E20920012000007FC08020802080207FC +C116:0000000004120412041E0A120A12111E2092001200000FFE004000A003180C06 +C117:0000000004120412041E0A120A12111E20920012000001F000000FFE01100E0E +C118:0000000004120412041E0A120A12111E2092001200000FFE00020FFE00020002 +C119:0000000004120412041E0A120A12111E2092001200000FFE08000FFC080007FE +C11A:0000000004120412041E0A120A12111E2092001200000FFE0208020802080FFE +C11B:0000000004120412041E0A120A12111E20920012000001F000000FFE040403F8 +C11C:00000000000404040404040404040A3C0A040A04110411042084000400040004 +C11D:000000000404040404040A3C0A0411042084000400001FFC0004000400040004 +C11E:000000000404040404040A3C0A0411042084000400001F7C0104010401040104 +C11F:000000000404040404040A3C0A0411042084000400001F1001100110012801C6 +C120:000000000404040404040A3C0A04110420840004000410041000100010000FFC +C121:000000000404040404040A3C0A041104208400040000107C1010101010280FC6 +C122:000000000404040404040A3C0A0411042084000400001038100010FE10440F38 +C123:000000000404040404040A3C0A0411042084000400001FFC1000100010000FFC +C124:000000000404040404040A3C0A0411042084000400001FFC00041FF810000FFC +C125:000000000404040404040A3C0A0411042084000400001F7C01041E0410040F04 +C126:000000000404040404040A3C0A0411042084000400001F7C01441E4410440F3C +C127:000000000404040404040A3C0A0411042084000400001F4401441E7C10440F3C +C128:000000000404040404040A3C0A0411042084000400001F1001101E1010280FC6 +C129:000000000404040404040A3C0A0411042084000400001F7C01401E7C10400F3C +C12A:000000000404040404040A3C0A0411042084000400001F7E01241E2410240F7E +C12B:000000000404040404040A3C0A0411042084000400001F3801001EFE10440F38 +C12C:000000000404040404040A3C0A0411042084000400001FFC1004100410040FFC +C12D:000000000404040404040A3C0A041104208400040000100410041FFC10040FFC +C12E:000000000404040404040A3C0A041104208400040000111011101F1011280FC6 +C12F:000000000404040404040A3C0A0411042084000400000080008001400630180C +C130:000000000404040404040A3C0A0411042084000400000410041004100A2831C6 +C131:000000000404040404040A3C0A0411042084000400000FF81004100410040FF8 +C132:000000000404040404040A3C0A0411042084000400001FFC008001400630180C +C133:000000000404040404040A3C0A04110420840004000003E000001FFC02201C1C +C134:000000000404040404040A3C0A0411042084000400001FFC00041FFC00040004 +C135:000000000404040404040A3C0A0411042084000400001FFC10001FF810000FFC +C136:000000000404040404040A3C0A0411042084000400001FFC0410041004101FFC +C137:000000000404040404040A3C0A04110420840004000003E000001FFC080807F0 +C138:00000000001204120412041204120A720A120A12111211122092001200120012 +C139:000000000412041204120A720A1211122092001200000FFE0002000200020002 +C13A:000000000412041204120A720A1211122092001200000FBE0082008200820082 +C13B:000000000412041204120A720A1211122092001200000F8800880088009400E3 +C13C:000000000412041204120A720A121112209200120012081208000800080007FE +C13D:000000000412041204120A720A121112209200120000083E08080808081407E3 +C13E:000000000412041204120A720A121112209200120000081C0800087F0822079C +C13F:000000000412041204120A720A1211122092001200000FFE08000800080007FE +C140:000000000412041204120A720A1211122092001200000FFE00020FFC080007FE +C141:000000000412041204120A720A1211122092001200000FBE00820F0208020782 +C142:000000000412041204120A720A1211122092001200000FBE00A20F220822079E +C143:000000000412041204120A720A1211122092001200000FA200A20F3E0822079E +C144:000000000412041204120A720A1211122092001200000F8800880F08081407E3 +C145:000000000412041204120A720A1211122092001200000FBE00A00F3E0820079E +C146:000000000412041204120A720A1211122092001200000FBF00920F12081207BF +C147:000000000412041204120A720A1211122092001200000F9C00800F7F0822079C +C148:000000000412041204120A720A1211122092001200000FFE08020802080207FE +C149:000000000412041204120A720A121112209200120000080208020FFE080207FE +C14A:000000000412041204120A720A121112209200120000088808880F88089407E3 +C14B:000000000412041204120A720A1211122092001200000040004000A003180C06 +C14C:000000000412041204120A720A121112209200120000020802080208051418E3 +C14D:000000000412041204120A720A12111220920012000007FC08020802080207FC +C14E:000000000412041204120A720A1211122092001200000FFE004000A003180C06 +C14F:000000000412041204120A720A12111220920012000001F000000FFE01100E0E +C150:000000000412041204120A720A1211122092001200000FFE00020FFE00020002 +C151:000000000412041204120A720A1211122092001200000FFE08000FFC080007FE +C152:000000000412041204120A720A1211122092001200000FFE0208020802080FFE +C153:000000000412041204120A720A12111220920012000001F000000FFE040403F8 +C154:000000000004040404040404043C0A040A040A3C110411042084000400040004 +C155:0000000004040404043C0A040A04113C2084000400001FFC0004000400040004 +C156:0000000004040404043C0A040A04113C2084000400001F7C0104010401040104 +C157:0000000004040404043C0A040A04113C2084000400001F1001100110012801C6 +C158:0000000004040404043C0A040A04113C20840004000410041000100010000FFC +C159:0000000004040404043C0A040A04113C208400040000107C1010101010280FC6 +C15A:0000000004040404043C0A040A04113C2084000400001038100010FE10440F38 +C15B:0000000004040404043C0A040A04113C2084000400001FFC1000100010000FFC +C15C:0000000004040404043C0A040A04113C2084000400001FFC00041FF810000FFC +C15D:0000000004040404043C0A040A04113C2084000400001F7C01041E0410040F04 +C15E:0000000004040404043C0A040A04113C2084000400001F7C01441E4410440F3C +C15F:0000000004040404043C0A040A04113C2084000400001F4401441E7C10440F3C +C160:0000000004040404043C0A040A04113C2084000400001F1001101E1010280FC6 +C161:0000000004040404043C0A040A04113C2084000400001F7C01401E7C10400F3C +C162:0000000004040404043C0A040A04113C2084000400001F7E01241E2410240F7E +C163:0000000004040404043C0A040A04113C2084000400001F3801001EFE10440F38 +C164:0000000004040404043C0A040A04113C2084000400001FFC1004100410040FFC +C165:0000000004040404043C0A040A04113C208400040000100410041FFC10040FFC +C166:0000000004040404043C0A040A04113C208400040000111011101F1011280FC6 +C167:0000000004040404043C0A040A04113C2084000400000080008001400630180C +C168:0000000004040404043C0A040A04113C2084000400000410041004100A2831C6 +C169:0000000004040404043C0A040A04113C2084000400000FF81004100410040FF8 +C16A:0000000004040404043C0A040A04113C2084000400001FFC008001400630180C +C16B:0000000004040404043C0A040A04113C20840004000003E000001FFC02201C1C +C16C:0000000004040404043C0A040A04113C2084000400001FFC00041FFC00040004 +C16D:0000000004040404043C0A040A04113C2084000400001FFC10001FF810000FFC +C16E:0000000004040404043C0A040A04113C2084000400001FFC0410041004101FFC +C16F:0000000004040404043C0A040A04113C20840004000003E000001FFC080807F0 +C170:00000000001204120412041204720A120A120A72111211122092001200120012 +C171:000000000412041204720A120A1211722092001200000FFE0002000200020002 +C172:000000000412041204720A120A1211722092001200000FBE0082008200820082 +C173:000000000412041204720A120A1211722092001200000F8800880088009400E3 +C174:000000000412041204720A120A121172209200120012081208000800080007FE +C175:000000000412041204720A120A121172209200120000083E08080808081407E3 +C176:000000000412041204720A120A121172209200120000081C0800087F0822079C +C177:000000000412041204720A120A1211722092001200000FFE08000800080007FE +C178:000000000412041204720A120A1211722092001200000FFE00020FFC080007FE +C179:000000000412041204720A120A1211722092001200000FBE00820F0208020782 +C17A:000000000412041204720A120A1211722092001200000FBE00A20F220822079E +C17B:000000000412041204720A120A1211722092001200000FA200A20F3E0822079E +C17C:000000000412041204720A120A1211722092001200000F8800880F08081407E3 +C17D:000000000412041204720A120A1211722092001200000FBE00A00F3E0820079E +C17E:000000000412041204720A120A1211722092001200000FBF00920F12081207BF +C17F:000000000412041204720A120A1211722092001200000F9C00800F7F0822079C +C180:000000000412041204720A120A1211722092001200000FFE08020802080207FE +C181:000000000412041204720A120A121172209200120000080208020FFE080207FE +C182:000000000412041204720A120A121172209200120000088808880F88089407E3 +C183:000000000412041204720A120A1211722092001200000040004000A003180C06 +C184:000000000412041204720A120A121172209200120000020802080208051418E3 +C185:000000000412041204720A120A12117220920012000007FC08020802080207FC +C186:000000000412041204720A120A1211722092001200000FFE004000A003180C06 +C187:000000000412041204720A120A12117220920012000001F000000FFE01100E0E +C188:000000000412041204720A120A1211722092001200000FFE00020FFE00020002 +C189:000000000412041204720A120A1211722092001200000FFE08000FFC080007FE +C18A:000000000412041204720A120A1211722092001200000FFE0208020802080FFE +C18B:000000000412041204720A120A12117220920012000001F000000FFE040403F8 +C18C:000000000000008000800080014002200410180C0080008000807FFF00000000 +C18D:000000000080008001400630180C008000807FFF00001FFC0004000400040004 +C18E:000000000080008001400630180C008000807FFF00001F7C0104010401040104 +C18F:000000000080008001400630180C008000807FFF00001F1001100110012801C6 +C190:000000000080008001400630180C008000807FFF000010001000100010000FFC +C191:000000000080008001400630180C008000807FFF0000107C1010101010280FC6 +C192:000000000080008001400630180C008000807FFF00001038100010FE10440F38 +C193:000000000080008001400630180C008000807FFF00001FFC1000100010000FFC +C194:000000000080008001400630180C008000807FFF00001FFC00041FF810000FFC +C195:000000000080008001400630180C008000807FFF00001F7C01041E0410040F04 +C196:000000000080008001400630180C008000807FFF00001F7C01441E4410440F3C +C197:000000000080008001400630180C008000807FFF00001F4401441E7C10440F3C +C198:000000000080008001400630180C008000807FFF00001F1001101E1010280FC6 +C199:000000000080008001400630180C008000807FFF00001F7C01401E7C10400F3C +C19A:000000000080008001400630180C008000807FFF00001F7E01241E2410240F7E +C19B:000000000080008001400630180C008000807FFF00001F3801001EFE10440F38 +C19C:000000000080008001400630180C008000807FFF00001FFC1004100410040FFC +C19D:000000000080008001400630180C008000807FFF0000100410041FFC10040FFC +C19E:000000000080008001400630180C008000807FFF0000111011101F1011280FC6 +C19F:000000000080008001400630180C008000807FFF00000080008001400630180C +C1A0:000000000080008001400630180C008000807FFF00000410041004100A2831C6 +C1A1:000000000080008001400630180C008000807FFF00000FF81004100410040FF8 +C1A2:000000000080008001400630180C008000807FFF00001FFC008001400630180C +C1A3:000000000080008001400630180C008000807FFF000003E000001FFC02201C1C +C1A4:000000000080008001400630180C008000807FFF00001FFC00041FFC00040004 +C1A5:000000000080008001400630180C008000807FFF00001FFC10001FF810000FFC +C1A6:000000000080008001400630180C008000807FFF00001FFC0410041004101FFC +C1A7:000000000080008001400630180C008000807FFF000003E000001FFC080807F0 +C1A8:0000000000040404040404040A040A07110420840404040404047FF400040004 +C1A9:00000000040404040A0411072084040404047FF400001FFC0004000400040004 +C1AA:00000000040404040A0411072084040404047FF400001F7C0104010401040104 +C1AB:00000000040404040A0411072084040404047FF400001F1001100110012801C6 +C1AC:00000000040404040A0411072084040404047FF4000410041000100010000FFC +C1AD:00000000040404040A0411072084040404047FF40000107C1010101010280FC6 +C1AE:00000000040404040A0411072084040404047FF400001038100010FE10440F38 +C1AF:00000000040404040A0411072084040404047FF400001FFC1000100010000FFC +C1B0:00000000040404040A0411072084040404047FF400001FFC00041FF810000FFC +C1B1:00000000040404040A0411072084040404047FF400001F7C01041E0410040F04 +C1B2:00000000040404040A0411072084040404047FF400001F7C01441E4410440F3C +C1B3:00000000040404040A0411072084040404047FF400001F4401441E7C10440F3C +C1B4:00000000040404040A0411072084040404047FF400001F1001101E1010280FC6 +C1B5:00000000040404040A0411072084040404047FF400001F7C01401E7C10400F3C +C1B6:00000000040404040A0411072084040404047FF400001F7E01241E2410240F7E +C1B7:00000000040404040A0411072084040404047FF400001F3801001EFE10440F38 +C1B8:00000000040404040A0411072084040404047FF400001FFC1004100410040FFC +C1B9:00000000040404040A0411072084040404047FF40000100410041FFC10040FFC +C1BA:00000000040404040A0411072084040404047FF40000111011101F1011280FC6 +C1BB:00000000040404040A0411072084040404047FF400000080008001400630180C +C1BC:00000000040404040A0411072084040404047FF400000410041004100A2831C6 +C1BD:00000000040404040A0411072084040404047FF400000FF81004100410040FF8 +C1BE:00000000040404040A0411072084040404047FF400001FFC008001400630180C +C1BF:00000000040404040A0411072084040404047FF4000003E000001FFC02201C1C +C1C0:00000000040404040A0411072084040404047FF400001FFC00041FFC00040004 +C1C1:00000000040404040A0411072084040404047FF400001FFC10001FF810000FFC +C1C2:00000000040404040A0411072084040404047FF400001FFC0410041004101FFC +C1C3:00000000040404040A0411072084040404047FF4000003E000001FFC080807F0 +C1C4:0000000000120412041204120A120A1E111220920412041204127FD200120012 +C1C5:00000000041204120A12111E2092041204127FD200000FFE0002000200020002 +C1C6:00000000041204120A12111E2092041204127FD200000FBE0082008200820082 +C1C7:00000000041204120A12111E2092041204127FD200000F8800880088009400E3 +C1C8:00000000041204120A12111E2092041204127FD20012081208000800080007FE +C1C9:00000000041204120A12111E2092041204127FD20000083E08080808081407E3 +C1CA:00000000041204120A12111E2092041204127FD20000081C0800087F0822079C +C1CB:00000000041204120A12111E2092041204127FD200000FFE08000800080007FE +C1CC:00000000041204120A12111E2092041204127FD200000FFE00020FFC080007FE +C1CD:00000000041204120A12111E2092041204127FD200000FBE00820F0208020782 +C1CE:00000000041204120A12111E2092041204127FD200000FBE00A20F220822079E +C1CF:00000000041204120A12111E2092041204127FD200000FA200A20F3E0822079E +C1D0:00000000041204120A12111E2092041204127FD200000F8800880F08081407E3 +C1D1:00000000041204120A12111E2092041204127FD200000FBE00A00F3E0820079E +C1D2:00000000041204120A12111E2092041204127FD200000FBF00920F12081207BF +C1D3:00000000041204120A12111E2092041204127FD200000F9C00800F7F0822079C +C1D4:00000000041204120A12111E2092041204127FD200000FFE08020802080207FE +C1D5:00000000041204120A12111E2092041204127FD20000080208020FFE080207FE +C1D6:00000000041204120A12111E2092041204127FD20000088808880F88089407E3 +C1D7:00000000041204120A12111E2092041204127FD200000040004000A003180C06 +C1D8:00000000041204120A12111E2092041204127FD20000020802080208051418E3 +C1D9:00000000041204120A12111E2092041204127FD2000007FC08020802080207FC +C1DA:00000000041204120A12111E2092041204127FD200000FFE004000A003180C06 +C1DB:00000000041204120A12111E2092041204127FD2000001F000000FFE01100E0E +C1DC:00000000041204120A12111E2092041204127FD200000FFE00020FFE00020002 +C1DD:00000000041204120A12111E2092041204127FD200000FFE08000FFC080007FE +C1DE:00000000041204120A12111E2092041204127FD200000FFE0208020802080FFE +C1DF:00000000041204120A12111E2092041204127FD2000001F000000FFE040403F8 +C1E0:0000000000040404040404040A040A04110420840404040404047FF400040004 +C1E1:00000000040404040A0411042084040404047FF400001FFC0004000400040004 +C1E2:00000000040404040A0411042084040404047FF400001F7C0104010401040104 +C1E3:00000000040404040A0411042084040404047FF400001F1001100110012801C6 +C1E4:00000000040404040A0411042084040404047FF4000410041000100010000FFC +C1E5:00000000040404040A0411042084040404047FF40000107C1010101010280FC6 +C1E6:00000000040404040A0411042084040404047FF400001038100010FE10440F38 +C1E7:00000000040404040A0411042084040404047FF400001FFC1000100010000FFC +C1E8:00000000040404040A0411042084040404047FF400001FFC00041FF810000FFC +C1E9:00000000040404040A0411042084040404047FF400001F7C01041E0410040F04 +C1EA:00000000040404040A0411042084040404047FF400001F7C01441E4410440F3C +C1EB:00000000040404040A0411042084040404047FF400001F4401441E7C10440F3C +C1EC:00000000040404040A0411042084040404047FF400001F1001101E1010280FC6 +C1ED:00000000040404040A0411042084040404047FF400001F7C01401E7C10400F3C +C1EE:00000000040404040A0411042084040404047FF400001F7E01241E2410240F7E +C1EF:00000000040404040A0411042084040404047FF400001F3801001EFE10440F38 +C1F0:00000000040404040A0411042084040404047FF400001FFC1004100410040FFC +C1F1:00000000040404040A0411042084040404047FF40000100410041FFC10040FFC +C1F2:00000000040404040A0411042084040404047FF40000111011101F1011280FC6 +C1F3:00000000040404040A0411042084040404047FF400000080008001400630180C +C1F4:00000000040404040A0411042084040404047FF400000410041004100A2831C6 +C1F5:00000000040404040A0411042084040404047FF400000FF81004100410040FF8 +C1F6:00000000040404040A0411042084040404047FF400001FFC008001400630180C +C1F7:00000000040404040A0411042084040404047FF4000003E000001FFC02201C1C +C1F8:00000000040404040A0411042084040404047FF400001FFC00041FFC00040004 +C1F9:00000000040404040A0411042084040404047FF400001FFC10001FF810000FFC +C1FA:00000000040404040A0411042084040404047FF400001FFC0410041004101FFC +C1FB:00000000040404040A0411042084040404047FF4000003E000001FFC080807F0 +C1FC:000000000000008000800080014002200410180C0220022002207FFF00000000 +C1FD:000000000080008001400630180C022002207FFF00001FFC0004000400040004 +C1FE:000000000080008001400630180C022002207FFF00001F7C0104010401040104 +C1FF:000000000080008001400630180C022002207FFF00001F1001100110012801C6 +C200:000000000080008001400630180C022002207FFF000010001000100010000FFC +C201:000000000080008001400630180C022002207FFF0000107C1010101010280FC6 +C202:000000000080008001400630180C022002207FFF00001038100010FE10440F38 +C203:000000000080008001400630180C022002207FFF00001FFC1000100010000FFC +C204:000000000080008001400630180C022002207FFF00001FFC00041FF810000FFC +C205:000000000080008001400630180C022002207FFF00001F7C01041E0410040F04 +C206:000000000080008001400630180C022002207FFF00001F7C01441E4410440F3C +C207:000000000080008001400630180C022002207FFF00001F4401441E7C10440F3C +C208:000000000080008001400630180C022002207FFF00001F1001101E1010280FC6 +C209:000000000080008001400630180C022002207FFF00001F7C01401E7C10400F3C +C20A:000000000080008001400630180C022002207FFF00001F7E01241E2410240F7E +C20B:000000000080008001400630180C022002207FFF00001F3801001EFE10440F38 +C20C:000000000080008001400630180C022002207FFF00001FFC1004100410040FFC +C20D:000000000080008001400630180C022002207FFF0000100410041FFC10040FFC +C20E:000000000080008001400630180C022002207FFF0000111011101F1011280FC6 +C20F:000000000080008001400630180C022002207FFF00000080008001400630180C +C210:000000000080008001400630180C022002207FFF00000410041004100A2831C6 +C211:000000000080008001400630180C022002207FFF00000FF81004100410040FF8 +C212:000000000080008001400630180C022002207FFF00001FFC008001400630180C +C213:000000000080008001400630180C022002207FFF000003E000001FFC02201C1C +C214:000000000080008001400630180C022002207FFF00001FFC00041FFC00040004 +C215:000000000080008001400630180C022002207FFF00001FFC10001FF810000FFC +C216:000000000080008001400630180C022002207FFF00001FFC0410041004101FFC +C217:000000000080008001400630180C022002207FFF000003E000001FFC080807F0 +C218:000000000080008001400630180C000000007FFF008000800080008000800080 +C219:000000000080008001400630180C00007FFF008000801FFC0004000400040004 +C21A:000000000080008001400630180C00007FFF008000801F7C0104010401040104 +C21B:000000000080008001400630180C00007FFF008000801F1001100110012801C6 +C21C:000000000080008001400630180C000000007FFF008010801080100010000FFC +C21D:000000000080008001400630180C00007FFF00800080107C1010101010280FC6 +C21E:000000000080008001400630180C00007FFF008000801038100010FE10440F38 +C21F:000000000080008001400630180C00007FFF008000801FFC1000100010000FFC +C220:000000000080008001400630180C00007FFF008000801FFC00041FF810000FFC +C221:000000000080008001400630180C00007FFF008000801F7C01041E0410040F04 +C222:000000000080008001400630180C00007FFF008000801F7C01441E4410440F3C +C223:000000000080008001400630180C00007FFF008000801F4401441E7C10440F3C +C224:000000000080008001400630180C00007FFF008000801F1001101E1010280FC6 +C225:000000000080008001400630180C00007FFF008000801F7C01401E7C10400F3C +C226:000000000080008001400630180C00007FFF008000801F7E01241E2410240F7E +C227:000000000080008001400630180C00007FFF008000801F3801001EFE10440F38 +C228:000000000080008001400630180C00007FFF008000801FFC1004100410040FFC +C229:000000000080008001400630180C00007FFF00800080100410041FFC10040FFC +C22A:000000000080008001400630180C00007FFF00800080111011101F1011280FC6 +C22B:000000000080008001400630180C00007FFF008000800080008001400630180C +C22C:000000000080008001400630180C00007FFF008000800410041004100A2831C6 +C22D:000000000080008001400630180C00007FFF008000800FF81004100410040FF8 +C22E:000000000080008001400630180C00007FFF008000801FFC008001400630180C +C22F:000000000080008001400630180C00007FFF0080008003E000001FFC02201C1C +C230:000000000080008001400630180C00007FFF008000801FFC00041FFC00040004 +C231:000000000080008001400630180C00007FFF008000801FFC10001FF810000FFC +C232:000000000080008001400630180C00007FFF008000801FFC0410041004101FFC +C233:000000000080008001400630180C00007FFF0080008003E000001FFC080807F0 +C234:00000000040404040A0411042084000400047FF404040404043C040404040404 +C235:00000000040404040A04111C208400047FF4040404001FFC0004000400040004 +C236:00000000040404040A04111C208400047FF4040404001F7C0104010401040104 +C237:00000000040404040A04111C208400047FF4040404001F1001100110012801C6 +C238:00000000040404040A041104208400047FF40404043C14041000100010000FFC +C239:00000000040404040A04111C208400047FF404040400107C1010101010280FC6 +C23A:00000000040404040A04111C208400047FF4040404001038100010FE10440F38 +C23B:00000000040404040A04111C208400047FF4040404001FFC1000100010000FFC +C23C:00000000040404040A04111C208400047FF4040404001FFC00041FF810000FFC +C23D:00000000040404040A04111C208400047FF4040404001F7C01041E0410040F04 +C23E:00000000040404040A04111C208400047FF4040404001F7C01441E4410440F3C +C23F:00000000040404040A04111C208400047FF4040404001F4401441E7C10440F3C +C240:00000000040404040A04111C208400047FF4040404001F1001101E1010280FC6 +C241:00000000040404040A04111C208400047FF4040404001F7C01401E7C10400F3C +C242:00000000040404040A04111C208400047FF4040404001F7E01241E2410240F7E +C243:00000000040404040A04111C208400047FF4040404001F3801001EFE10440F38 +C244:00000000040404040A04111C208400047FF4040404001FFC1004100410040FFC +C245:00000000040404040A04111C208400047FF404040400100410041FFC10040FFC +C246:00000000040404040A04111C208400047FF404040400111011101F1011280FC6 +C247:00000000040404040A04111C208400047FF4040404000080008001400630180C +C248:00000000040404040A04111C208400047FF4040404000410041004100A2831C6 +C249:00000000040404040A04111C208400047FF4040404000FF81004100410040FF8 +C24A:00000000040404040A04111C208400047FF4040404001FFC008001400630180C +C24B:00000000040404040A04111C208400047FF40404040003E000001FFC02201C1C +C24C:00000000040404040A04111C208400047FF4040404001FFC00041FFC00040004 +C24D:00000000040404040A04111C208400047FF4040404001FFC10001FF810000FFC +C24E:00000000040404040A04111C208400047FF4040404001FFC0410041004101FFC +C24F:00000000040404040A04111C208400047FF40404040003E000001FFC080807F0 +C250:00000000041204120A1211122092001200127FD20412041204F2041204120412 +C251:00000000041204120A121172209200127FD2041204000FFE0002000200020002 +C252:00000000041204120A121172209200127FD2041204000FBE0082008200820082 +C253:00000000041204120A121172209200127FD2041204000F8800880088009400E3 +C254:00000000041204120A121112209200127FD2021202F20A1208000800080007FE +C255:00000000041204120A121172209200127FD204120400083E08080808081407E3 +C256:00000000041204120A121172209200127FD204120400081C0800087F0822079C +C257:00000000041204120A121172209200127FD2041204000FFE08000800080007FE +C258:00000000041204120A121172209200127FD2041204000FFE00020FFC080007FE +C259:00000000041204120A121172209200127FD2041204000FBE00820F0208020782 +C25A:00000000041204120A121172209200127FD2041204000FBE00A20F220822079E +C25B:00000000041204120A121172209200127FD2041204000FA200A20F3E0822079E +C25C:00000000041204120A121172209200127FD2041204000F8800880F08081407E3 +C25D:00000000041204120A121172209200127FD2041204000FBE00A00F3E0820079E +C25E:00000000041204120A121172209200127FD2041204000FBF00920F12081207BF +C25F:00000000041204120A121172209200127FD2041204000F9C00800F7F0822079C +C260:00000000041204120A121172209200127FD2041204000FFE08020802080207FE +C261:00000000041204120A121172209200127FD204120400080208020FFE080207FE +C262:00000000041204120A121172209200127FD204120400088808880F88089407E3 +C263:00000000041204120A121172209200127FD2041204000040004000A003180C06 +C264:00000000041204120A121172209200127FD204120400020802080208051418E3 +C265:00000000041204120A121172209200127FD20412040007FC08020802080207FC +C266:00000000041204120A121172209200127FD2041204000FFE004000A003180C06 +C267:00000000041204120A121172209200127FD20412040001F000000FFE01100E0E +C268:00000000041204120A121172209200127FD2041204000FFE00020FFE00020002 +C269:00000000041204120A121172209200127FD2041204000FFE08000FFC080007FE +C26A:00000000041204120A121172209200127FD2041204000FFE0208020802080FFE +C26B:00000000041204120A121172209200127FD20412040001F000000FFE040403F8 +C26C:00000000040404040A0411042084000400047FF4040404040404040404040404 +C26D:00000000040404040A041104208400047FF4040404001FFC0004000400040004 +C26E:00000000040404040A041104208400047FF4040404001F7C0104010401040104 +C26F:00000000040404040A041104208400047FF4040404001F1001100110012801C6 +C270:00000000040404040A041104208400047FF40404040414041000100010000FFC +C271:00000000040404040A041104208400047FF404040400107C1010101010280FC6 +C272:00000000040404040A041104208400047FF4040404001038100010FE10440F38 +C273:00000000040404040A041104208400047FF4040404001FFC1000100010000FFC +C274:00000000040404040A041104208400047FF4040404001FFC00041FF810000FFC +C275:00000000040404040A041104208400047FF4040404001F7C01041E0410040F04 +C276:00000000040404040A041104208400047FF4040404001F7C01441E4410440F3C +C277:00000000040404040A041104208400047FF4040404001F4401441E7C10440F3C +C278:00000000040404040A041104208400047FF4040404001F1001101E1010280FC6 +C279:00000000040404040A041104208400047FF4040404001F7C01401E7C10400F3C +C27A:00000000040404040A041104208400047FF4040404001F7E01241E2410240F7E +C27B:00000000040404040A041104208400047FF4040404001F3801001EFE10440F38 +C27C:00000000040404040A041104208400047FF4040404001FFC1004100410040FFC +C27D:00000000040404040A041104208400047FF404040400100410041FFC10040FFC +C27E:00000000040404040A041104208400047FF404040400111011101F1011280FC6 +C27F:00000000040404040A041104208400047FF4040404000080008001400630180C +C280:00000000040404040A041104208400047FF4040404000410041004100A2831C6 +C281:00000000040404040A041104208400047FF4040404000FF81004100410040FF8 +C282:00000000040404040A041104208400047FF4040404001FFC008001400630180C +C283:00000000040404040A041104208400047FF40404040003E000001FFC02201C1C +C284:00000000040404040A041104208400047FF4040404001FFC00041FFC00040004 +C285:00000000040404040A041104208400047FF4040404001FFC10001FF810000FFC +C286:00000000040404040A041104208400047FF4040404001FFC0410041004101FFC +C287:00000000040404040A041104208400047FF40404040003E000001FFC080807F0 +C288:000000000080008001400630180C000000007FFF041004100410041004100410 +C289:000000000080008001400630180C00007FFF022002201FFC0004000400040004 +C28A:000000000080008001400630180C00007FFF022002201F7C0104010401040104 +C28B:000000000080008001400630180C00007FFF022002201F1001100110012801C6 +C28C:000000000080008001400630180C000000007FFF022012201220100010000FFC +C28D:000000000080008001400630180C00007FFF02200220107C1010101010280FC6 +C28E:000000000080008001400630180C00007FFF022002201038100010FE10440F38 +C28F:000000000080008001400630180C00007FFF022002201FFC1000100010000FFC +C290:000000000080008001400630180C00007FFF022002201FFC00041FF810000FFC +C291:000000000080008001400630180C00007FFF022002201F7C01041E0410040F04 +C292:000000000080008001400630180C00007FFF022002201F7C01441E4410440F3C +C293:000000000080008001400630180C00007FFF022002201F4401441E7C10440F3C +C294:000000000080008001400630180C00007FFF022002201F1001101E1010280FC6 +C295:000000000080008001400630180C00007FFF022002201F7C01401E7C10400F3C +C296:000000000080008001400630180C00007FFF022002201F7E01241E2410240F7E +C297:000000000080008001400630180C00007FFF022002201F3801001EFE10440F38 +C298:000000000080008001400630180C00007FFF022002201FFC1004100410040FFC +C299:000000000080008001400630180C00007FFF02200220100410041FFC10040FFC +C29A:000000000080008001400630180C00007FFF02200220111011101F1011280FC6 +C29B:000000000080008001400630180C00007FFF022002200080008001400630180C +C29C:000000000080008001400630180C00007FFF022002200410041004100A2831C6 +C29D:000000000080008001400630180C00007FFF022002200FF81004100410040FF8 +C29E:000000000080008001400630180C00007FFF022002201FFC008001400630180C +C29F:000000000080008001400630180C00007FFF0220022003E000001FFC02201C1C +C2A0:000000000080008001400630180C00007FFF022002201FFC00041FFC00040004 +C2A1:000000000080008001400630180C00007FFF022002201FFC10001FF810000FFC +C2A2:000000000080008001400630180C00007FFF022002201FFC0410041004101FFC +C2A3:000000000080008001400630180C00007FFF0220022003E000001FFC080807F0 +C2A4:000000000000008000800080014002200410180C0000000000007FFF00000000 +C2A5:000000000080008001400630180C00007FFF000000001FFC0004000400040004 +C2A6:000000000080008001400630180C00007FFF000000001F7C0104010401040104 +C2A7:000000000080008001400630180C00007FFF000000001F1001100110012801C6 +C2A8:000000000080008001400630180C000000007FFF000010001000100010000FFC +C2A9:000000000080008001400630180C00007FFF00000000107C1010101010280FC6 +C2AA:000000000080008001400630180C00007FFF000000001038100010FE10440F38 +C2AB:000000000080008001400630180C00007FFF000000001FFC1000100010000FFC +C2AC:000000000080008001400630180C00007FFF000000001FFC00041FF810000FFC +C2AD:000000000080008001400630180C00007FFF000000001F7C01041E0410040F04 +C2AE:000000000080008001400630180C00007FFF000000001F7C01441E4410440F3C +C2AF:000000000080008001400630180C00007FFF000000001F4401441E7C10440F3C +C2B0:000000000080008001400630180C00007FFF000000001F1001101E1010280FC6 +C2B1:000000000080008001400630180C00007FFF000000001F7C01401E7C10400F3C +C2B2:000000000080008001400630180C00007FFF000000001F7E01241E2410240F7E +C2B3:000000000080008001400630180C00007FFF000000001F3801001EFE10440F38 +C2B4:000000000080008001400630180C00007FFF000000001FFC1004100410040FFC +C2B5:000000000080008001400630180C00007FFF00000000100410041FFC10040FFC +C2B6:000000000080008001400630180C00007FFF00000000111011101F1011280FC6 +C2B7:000000000080008001400630180C00007FFF000000000080008001400630180C +C2B8:000000000080008001400630180C00007FFF000000000410041004100A2831C6 +C2B9:000000000080008001400630180C00007FFF000000000FF81004100410040FF8 +C2BA:000000000080008001400630180C00007FFF000000001FFC008001400630180C +C2BB:000000000080008001400630180C00007FFF0000000003E000001FFC02201C1C +C2BC:000000000080008001400630180C00007FFF000000001FFC00041FFC00040004 +C2BD:000000000080008001400630180C00007FFF000000001FFC10001FF810000FFC +C2BE:000000000080008001400630180C00007FFF000000001FFC0410041004101FFC +C2BF:000000000080008001400630180C00007FFF0000000003E000001FFC080807F0 +C2C0:0000000000040404040404040A040A04110420840004000400047FF400040004 +C2C1:00000000040404040A041104208400047FF4000400001FFC0004000400040004 +C2C2:00000000040404040A041104208400047FF4000400001F7C0104010401040104 +C2C3:00000000040404040A041104208400047FF4000400001F1001100110012801C6 +C2C4:00000000040404040A0411042084000400047FF4000410041000100010000FFC +C2C5:00000000040404040A041104208400047FF400040000107C1010101010280FC6 +C2C6:00000000040404040A041104208400047FF4000400001038100010FE10440F38 +C2C7:00000000040404040A041104208400047FF4000400001FFC1000100010000FFC +C2C8:00000000040404040A041104208400047FF4000400001FFC00041FF810000FFC +C2C9:00000000040404040A041104208400047FF4000400001F7C01041E0410040F04 +C2CA:00000000040404040A041104208400047FF4000400001F7C01441E4410440F3C +C2CB:00000000040404040A041104208400047FF4000400001F4401441E7C10440F3C +C2CC:00000000040404040A041104208400047FF4000400001F1001101E1010280FC6 +C2CD:00000000040404040A041104208400047FF4000400001F7C01401E7C10400F3C +C2CE:00000000040404040A041104208400047FF4000400001F7E01241E2410240F7E +C2CF:00000000040404040A041104208400047FF4000400001F3801001EFE10440F38 +C2D0:00000000040404040A041104208400047FF4000400001FFC1004100410040FFC +C2D1:00000000040404040A041104208400047FF400040000100410041FFC10040FFC +C2D2:00000000040404040A041104208400047FF400040000111011101F1011280FC6 +C2D3:00000000040404040A041104208400047FF4000400000080008001400630180C +C2D4:00000000040404040A041104208400047FF4000400000410041004100A2831C6 +C2D5:00000000040404040A041104208400047FF4000400000FF81004100410040FF8 +C2D6:00000000040404040A041104208400047FF4000400001FFC008001400630180C +C2D7:00000000040404040A041104208400047FF40004000003E000001FFC02201C1C +C2D8:00000000040404040A041104208400047FF4000400001FFC00041FFC00040004 +C2D9:00000000040404040A041104208400047FF4000400001FFC10001FF810000FFC +C2DA:00000000040404040A041104208400047FF4000400001FFC0410041004101FFC +C2DB:00000000040404040A041104208400047FF40004000003E000001FFC080807F0 +C2DC:00000000000404040404040404040A040A040A04110411042084000400040004 +C2DD:000000000404040404040A040A0411042084000400001FFC0004000400040004 +C2DE:000000000404040404040A040A0411042084000400001F7C0104010401040104 +C2DF:000000000404040404040A040A0411042084000400001F1001100110012801C6 +C2E0:000000000404040404040A040A04110420840004000410041000100010000FFC +C2E1:000000000404040404040A040A041104208400040000107C1010101010280FC6 +C2E2:000000000404040404040A040A0411042084000400001038100010FE10440F38 +C2E3:000000000404040404040A040A0411042084000400001FFC1000100010000FFC +C2E4:000000000404040404040A040A0411042084000400001FFC00041FF810000FFC +C2E5:000000000404040404040A040A0411042084000400001F7C01041E0410040F04 +C2E6:000000000404040404040A040A0411042084000400001F7C01441E4410440F3C +C2E7:000000000404040404040A040A0411042084000400001F4401441E7C10440F3C +C2E8:000000000404040404040A040A0411042084000400001F1001101E1010280FC6 +C2E9:000000000404040404040A040A0411042084000400001F7C01401E7C10400F3C +C2EA:000000000404040404040A040A0411042084000400001F7E01241E2410240F7E +C2EB:000000000404040404040A040A0411042084000400001F3801001EFE10440F38 +C2EC:000000000404040404040A040A0411042084000400001FFC1004100410040FFC +C2ED:000000000404040404040A040A041104208400040000100410041FFC10040FFC +C2EE:000000000404040404040A040A041104208400040000111011101F1011280FC6 +C2EF:000000000404040404040A040A0411042084000400000080008001400630180C +C2F0:000000000404040404040A040A0411042084000400000410041004100A2831C6 +C2F1:000000000404040404040A040A0411042084000400000FF81004100410040FF8 +C2F2:000000000404040404040A040A0411042084000400001FFC008001400630180C +C2F3:000000000404040404040A040A04110420840004000003E000001FFC02201C1C +C2F4:000000000404040404040A040A0411042084000400001FFC00041FFC00040004 +C2F5:000000000404040404040A040A0411042084000400001FFC10001FF810000FFC +C2F6:000000000404040404040A040A0411042084000400001FFC0410041004101FFC +C2F7:000000000404040404040A040A04110420840004000003E000001FFC080807F0 +C2F8:0000000000041104110411041104110711042A842A842A844444000400040004 +C2F9:0000000011041104110411072A842A844444000400001FFC0004000400040004 +C2FA:0000000011041104110411072A842A844444000400001F7C0104010401040104 +C2FB:0000000011041104110411072A842A844444000400001F1001100110012801C6 +C2FC:0000000011041104110411072A842A8444440004000410041000100010000FFC +C2FD:0000000011041104110411072A842A84444400040000107C1010101010280FC6 +C2FE:0000000011041104110411072A842A844444000400001038100010FE10440F38 +C2FF:0000000011041104110411072A842A844444000400001FFC1000100010000FFC +C300:0000000011041104110411072A842A844444000400001FFC00041FF810000FFC +C301:0000000011041104110411072A842A844444000400001F7C01041E0410040F04 +C302:0000000011041104110411072A842A844444000400001F7C01441E4410440F3C +C303:0000000011041104110411072A842A844444000400001F4401441E7C10440F3C +C304:0000000011041104110411072A842A844444000400001F1001101E1010280FC6 +C305:0000000011041104110411072A842A844444000400001F7C01401E7C10400F3C +C306:0000000011041104110411072A842A844444000400001F7E01241E2410240F7E +C307:0000000011041104110411072A842A844444000400001F3801001EFE10440F38 +C308:0000000011041104110411072A842A844444000400001FFC1004100410040FFC +C309:0000000011041104110411072A842A84444400040000100410041FFC10040FFC +C30A:0000000011041104110411072A842A84444400040000111011101F1011280FC6 +C30B:0000000011041104110411072A842A844444000400000080008001400630180C +C30C:0000000011041104110411072A842A844444000400000410041004100A2831C6 +C30D:0000000011041104110411072A842A844444000400000FF81004100410040FF8 +C30E:0000000011041104110411072A842A844444000400001FFC008001400630180C +C30F:0000000011041104110411072A842A8444440004000003E000001FFC02201C1C +C310:0000000011041104110411072A842A844444000400001FFC00041FFC00040004 +C311:0000000011041104110411072A842A844444000400001FFC10001FF810000FFC +C312:0000000011041104110411072A842A844444000400001FFC0410041004101FFC +C313:0000000011041104110411072A842A8444440004000003E000001FFC080807F0 +C314:0000000000121112111211121112111E11122A922A922A924452001200120012 +C315:00000000111211121112111E2A922A924452001200000FFE0002000200020002 +C316:00000000111211121112111E2A922A924452001200000FBE0082008200820082 +C317:00000000111211121112111E2A922A924452001200000F8800880088009400E3 +C318:00000000111211121112111E2A922A92445200120012081208000800080007FE +C319:00000000111211121112111E2A922A92445200120000083E08080808081407E3 +C31A:00000000111211121112111E2A922A92445200120000081C0800087F0822079C +C31B:00000000111211121112111E2A922A924452001200000FFE08000800080007FE +C31C:00000000111211121112111E2A922A924452001200000FFE00020FFC080007FE +C31D:00000000111211121112111E2A922A924452001200000FBE00820F0208020782 +C31E:00000000111211121112111E2A922A924452001200000FBE00A20F220822079E +C31F:00000000111211121112111E2A922A924452001200000FA200A20F3E0822079E +C320:00000000111211121112111E2A922A924452001200000F8800880F08081407E3 +C321:00000000111211121112111E2A922A924452001200000FBE00A00F3E0820079E +C322:00000000111211121112111E2A922A924452001200000FBF00920F12081207BF +C323:00000000111211121112111E2A922A924452001200000F9C00800F7F0822079C +C324:00000000111211121112111E2A922A924452001200000FFE08020802080207FE +C325:00000000111211121112111E2A922A92445200120000080208020FFE080207FE +C326:00000000111211121112111E2A922A92445200120000088808880F88089407E3 +C327:00000000111211121112111E2A922A924452001200000040004000A003180C06 +C328:00000000111211121112111E2A922A92445200120000020802080208051418E3 +C329:00000000111211121112111E2A922A9244520012000007FC08020802080207FC +C32A:00000000111211121112111E2A922A924452001200000FFE004000A003180C06 +C32B:00000000111211121112111E2A922A9244520012000001F000000FFE01100E0E +C32C:00000000111211121112111E2A922A924452001200000FFE00020FFE00020002 +C32D:00000000111211121112111E2A922A924452001200000FFE08000FFC080007FE +C32E:00000000111211121112111E2A922A924452001200000FFE0208020802080FFE +C32F:00000000111211121112111E2A922A9244520012000001F000000FFE040403F8 +C330:0000000000041104110411041107110411042A872A842A844444000400040004 +C331:0000000011041104110711042A842A874444000400001FFC0004000400040004 +C332:0000000011041104110711042A842A874444000400001F7C0104010401040104 +C333:0000000011041104110711042A842A874444000400001F1001100110012801C6 +C334:0000000011041104110711042A842A8744440004000410041000100010000FFC +C335:0000000011041104110711042A842A87444400040000107C1010101010280FC6 +C336:0000000011041104110711042A842A874444000400001038100010FE10440F38 +C337:0000000011041104110711042A842A874444000400001FFC1000100010000FFC +C338:0000000011041104110711042A842A874444000400001FFC00041FF810000FFC +C339:0000000011041104110711042A842A874444000400001F7C01041E0410040F04 +C33A:0000000011041104110711042A842A874444000400001F7C01441E4410440F3C +C33B:0000000011041104110711042A842A874444000400001F4401441E7C10440F3C +C33C:0000000011041104110711042A842A874444000400001F1001101E1010280FC6 +C33D:0000000011041104110711042A842A874444000400001F7C01401E7C10400F3C +C33E:0000000011041104110711042A842A874444000400001F7E01241E2410240F7E +C33F:0000000011041104110711042A842A874444000400001F3801001EFE10440F38 +C340:0000000011041104110711042A842A874444000400001FFC1004100410040FFC +C341:0000000011041104110711042A842A87444400040000100410041FFC10040FFC +C342:0000000011041104110711042A842A87444400040000111011101F1011280FC6 +C343:0000000011041104110711042A842A874444000400000080008001400630180C +C344:0000000011041104110711042A842A874444000400000410041004100A2831C6 +C345:0000000011041104110711042A842A874444000400000FF81004100410040FF8 +C346:0000000011041104110711042A842A874444000400001FFC008001400630180C +C347:0000000011041104110711042A842A8744440004000003E000001FFC02201C1C +C348:0000000011041104110711042A842A874444000400001FFC00041FFC00040004 +C349:0000000011041104110711042A842A874444000400001FFC10001FF810000FFC +C34A:0000000011041104110711042A842A874444000400001FFC0410041004101FFC +C34B:0000000011041104110711042A842A8744440004000003E000001FFC080807F0 +C34C:000000000012111211121112111E111211122A9E2A922A924452001200120012 +C34D:0000000011121112111E11122A922A9E4452001200000FFE0002000200020002 +C34E:0000000011121112111E11122A922A9E4452001200000FBE0082008200820082 +C34F:0000000011121112111E11122A922A9E4452001200000F8800880088009400E3 +C350:0000000011121112111E11122A922A9E445200120012081208000800080007FE +C351:0000000011121112111E11122A922A9E445200120000083E08080808081407E3 +C352:0000000011121112111E11122A922A9E445200120000081C0800087F0822079C +C353:0000000011121112111E11122A922A9E4452001200000FFE08000800080007FE +C354:0000000011121112111E11122A922A9E4452001200000FFE00020FFC080007FE +C355:0000000011121112111E11122A922A9E4452001200000FBE00820F0208020782 +C356:0000000011121112111E11122A922A9E4452001200000FBE00A20F220822079E +C357:0000000011121112111E11122A922A9E4452001200000FA200A20F3E0822079E +C358:0000000011121112111E11122A922A9E4452001200000F8800880F08081407E3 +C359:0000000011121112111E11122A922A9E4452001200000FBE00A00F3E0820079E +C35A:0000000011121112111E11122A922A9E4452001200000FBF00920F12081207BF +C35B:0000000011121112111E11122A922A9E4452001200000F9C00800F7F0822079C +C35C:0000000011121112111E11122A922A9E4452001200000FFE08020802080207FE +C35D:0000000011121112111E11122A922A9E445200120000080208020FFE080207FE +C35E:0000000011121112111E11122A922A9E445200120000088808880F88089407E3 +C35F:0000000011121112111E11122A922A9E4452001200000040004000A003180C06 +C360:0000000011121112111E11122A922A9E445200120000020802080208051418E3 +C361:0000000011121112111E11122A922A9E44520012000007FC08020802080207FC +C362:0000000011121112111E11122A922A9E4452001200000FFE004000A003180C06 +C363:0000000011121112111E11122A922A9E44520012000001F000000FFE01100E0E +C364:0000000011121112111E11122A922A9E4452001200000FFE00020FFE00020002 +C365:0000000011121112111E11122A922A9E4452001200000FFE08000FFC080007FE +C366:0000000011121112111E11122A922A9E4452001200000FFE0208020802080FFE +C367:0000000011121112111E11122A922A9E44520012000001F000000FFE040403F8 +C368:0000000000041104110411041104113C11042A842A842A844444000400040004 +C369:00000000110411041104113C2A842A844444000400001FFC0004000400040004 +C36A:00000000110411041104113C2A842A844444000400001F7C0104010401040104 +C36B:00000000110411041104113C2A842A844444000400001F1001100110012801C6 +C36C:00000000110411041104113C2A842A8444440004000410041000100010000FFC +C36D:00000000110411041104113C2A842A84444400040000107C1010101010280FC6 +C36E:00000000110411041104113C2A842A844444000400001038100010FE10440F38 +C36F:00000000110411041104113C2A842A844444000400001FFC1000100010000FFC +C370:00000000110411041104113C2A842A844444000400001FFC00041FF810000FFC +C371:00000000110411041104113C2A842A844444000400001F7C01041E0410040F04 +C372:00000000110411041104113C2A842A844444000400001F7C01441E4410440F3C +C373:00000000110411041104113C2A842A844444000400001F4401441E7C10440F3C +C374:00000000110411041104113C2A842A844444000400001F1001101E1010280FC6 +C375:00000000110411041104113C2A842A844444000400001F7C01401E7C10400F3C +C376:00000000110411041104113C2A842A844444000400001F7E01241E2410240F7E +C377:00000000110411041104113C2A842A844444000400001F3801001EFE10440F38 +C378:00000000110411041104113C2A842A844444000400001FFC1004100410040FFC +C379:00000000110411041104113C2A842A84444400040000100410041FFC10040FFC +C37A:00000000110411041104113C2A842A84444400040000111011101F1011280FC6 +C37B:00000000110411041104113C2A842A844444000400000080008001400630180C +C37C:00000000110411041104113C2A842A844444000400000410041004100A2831C6 +C37D:00000000110411041104113C2A842A844444000400000FF81004100410040FF8 +C37E:00000000110411041104113C2A842A844444000400001FFC008001400630180C +C37F:00000000110411041104113C2A842A8444440004000003E000001FFC02201C1C +C380:00000000110411041104113C2A842A844444000400001FFC00041FFC00040004 +C381:00000000110411041104113C2A842A844444000400001FFC10001FF810000FFC +C382:00000000110411041104113C2A842A844444000400001FFC0410041004101FFC +C383:00000000110411041104113C2A842A8444440004000003E000001FFC080807F0 +C384:0000000000121112111211121112117211122A922A922A924452001200120012 +C385:0000000011121112111211722A922A924452001200000FFE0002000200020002 +C386:0000000011121112111211722A922A924452001200000FBE0082008200820082 +C387:0000000011121112111211722A922A924452001200000F8800880088009400E3 +C388:0000000011121112111211722A922A92445200120012081208000800080007FE +C389:0000000011121112111211722A922A92445200120000083E08080808081407E3 +C38A:0000000011121112111211722A922A92445200120000081C0800087F0822079C +C38B:0000000011121112111211722A922A924452001200000FFE08000800080007FE +C38C:0000000011121112111211722A922A924452001200000FFE00020FFC080007FE +C38D:0000000011121112111211722A922A924452001200000FBE00820F0208020782 +C38E:0000000011121112111211722A922A924452001200000FBE00A20F220822079E +C38F:0000000011121112111211722A922A924452001200000FA200A20F3E0822079E +C390:0000000011121112111211722A922A924452001200000F8800880F08081407E3 +C391:0000000011121112111211722A922A924452001200000FBE00A00F3E0820079E +C392:0000000011121112111211722A922A924452001200000FBF00920F12081207BF +C393:0000000011121112111211722A922A924452001200000F9C00800F7F0822079C +C394:0000000011121112111211722A922A924452001200000FFE08020802080207FE +C395:0000000011121112111211722A922A92445200120000080208020FFE080207FE +C396:0000000011121112111211722A922A92445200120000088808880F88089407E3 +C397:0000000011121112111211722A922A924452001200000040004000A003180C06 +C398:0000000011121112111211722A922A92445200120000020802080208051418E3 +C399:0000000011121112111211722A922A9244520012000007FC08020802080207FC +C39A:0000000011121112111211722A922A924452001200000FFE004000A003180C06 +C39B:0000000011121112111211722A922A9244520012000001F000000FFE01100E0E +C39C:0000000011121112111211722A922A924452001200000FFE00020FFE00020002 +C39D:0000000011121112111211722A922A924452001200000FFE08000FFC080007FE +C39E:0000000011121112111211722A922A924452001200000FFE0208020802080FFE +C39F:0000000011121112111211722A922A9244520012000001F000000FFE040403F8 +C3A0:000000000004110411041104113C110411042ABC2A842A844444000400040004 +C3A1:0000000011041104113C11042A842ABC4444000400001FFC0004000400040004 +C3A2:0000000011041104113C11042A842ABC4444000400001F7C0104010401040104 +C3A3:0000000011041104113C11042A842ABC4444000400001F1001100110012801C6 +C3A4:0000000011041104113C11042A842ABC44440004000410041000100010000FFC +C3A5:0000000011041104113C11042A842ABC444400040000107C1010101010280FC6 +C3A6:0000000011041104113C11042A842ABC4444000400001038100010FE10440F38 +C3A7:0000000011041104113C11042A842ABC4444000400001FFC1000100010000FFC +C3A8:0000000011041104113C11042A842ABC4444000400001FFC00041FF810000FFC +C3A9:0000000011041104113C11042A842ABC4444000400001F7C01041E0410040F04 +C3AA:0000000011041104113C11042A842ABC4444000400001F7C01441E4410440F3C +C3AB:0000000011041104113C11042A842ABC4444000400001F4401441E7C10440F3C +C3AC:0000000011041104113C11042A842ABC4444000400001F1001101E1010280FC6 +C3AD:0000000011041104113C11042A842ABC4444000400001F7C01401E7C10400F3C +C3AE:0000000011041104113C11042A842ABC4444000400001F7E01241E2410240F7E +C3AF:0000000011041104113C11042A842ABC4444000400001F3801001EFE10440F38 +C3B0:0000000011041104113C11042A842ABC4444000400001FFC1004100410040FFC +C3B1:0000000011041104113C11042A842ABC444400040000100410041FFC10040FFC +C3B2:0000000011041104113C11042A842ABC444400040000111011101F1011280FC6 +C3B3:0000000011041104113C11042A842ABC4444000400000080008001400630180C +C3B4:0000000011041104113C11042A842ABC4444000400000410041004100A2831C6 +C3B5:0000000011041104113C11042A842ABC4444000400000FF81004100410040FF8 +C3B6:0000000011041104113C11042A842ABC4444000400001FFC008001400630180C +C3B7:0000000011041104113C11042A842ABC44440004000003E000001FFC02201C1C +C3B8:0000000011041104113C11042A842ABC4444000400001FFC00041FFC00040004 +C3B9:0000000011041104113C11042A842ABC4444000400001FFC10001FF810000FFC +C3BA:0000000011041104113C11042A842ABC4444000400001FFC0410041004101FFC +C3BB:0000000011041104113C11042A842ABC44440004000003E000001FFC080807F0 +C3BC:0000000000121112111211121172111211122AF22A922A924452001200120012 +C3BD:0000000011121112117211122A922AF24452001200000FFE0002000200020002 +C3BE:0000000011121112117211122A922AF24452001200000FBE0082008200820082 +C3BF:0000000011121112117211122A922AF24452001200000F8800880088009400E3 +C3C0:0000000011121112117211122A922AF2445200120012081208000800080007FE +C3C1:0000000011121112117211122A922AF2445200120000083E08080808081407E3 +C3C2:0000000011121112117211122A922AF2445200120000081C0800087F0822079C +C3C3:0000000011121112117211122A922AF24452001200000FFE08000800080007FE +C3C4:0000000011121112117211122A922AF24452001200000FFE00020FFC080007FE +C3C5:0000000011121112117211122A922AF24452001200000FBE00820F0208020782 +C3C6:0000000011121112117211122A922AF24452001200000FBE00A20F220822079E +C3C7:0000000011121112117211122A922AF24452001200000FA200A20F3E0822079E +C3C8:0000000011121112117211122A922AF24452001200000F8800880F08081407E3 +C3C9:0000000011121112117211122A922AF24452001200000FBE00A00F3E0820079E +C3CA:0000000011121112117211122A922AF24452001200000FBF00920F12081207BF +C3CB:0000000011121112117211122A922AF24452001200000F9C00800F7F0822079C +C3CC:0000000011121112117211122A922AF24452001200000FFE08020802080207FE +C3CD:0000000011121112117211122A922AF2445200120000080208020FFE080207FE +C3CE:0000000011121112117211122A922AF2445200120000088808880F88089407E3 +C3CF:0000000011121112117211122A922AF24452001200000040004000A003180C06 +C3D0:0000000011121112117211122A922AF2445200120000020802080208051418E3 +C3D1:0000000011121112117211122A922AF244520012000007FC08020802080207FC +C3D2:0000000011121112117211122A922AF24452001200000FFE004000A003180C06 +C3D3:0000000011121112117211122A922AF244520012000001F000000FFE01100E0E +C3D4:0000000011121112117211122A922AF24452001200000FFE00020FFE00020002 +C3D5:0000000011121112117211122A922AF24452001200000FFE08000FFC080007FE +C3D6:0000000011121112117211122A922AF24452001200000FFE0208020802080FFE +C3D7:0000000011121112117211122A922AF244520012000001F000000FFE040403F8 +C3D8:00000000000004100410041004100A280A2811440080008000807FFF00000000 +C3D9:000000000410041004100A2831C6008000807FFF00001FFC0004000400040004 +C3DA:000000000410041004100A2831C6008000807FFF00001F7C0104010401040104 +C3DB:000000000410041004100A2831C6008000807FFF00001F1001100110012801C6 +C3DC:000000000410041004100A2831C6008000807FFF000010001000100010000FFC +C3DD:000000000410041004100A2831C6008000807FFF0000107C1010101010280FC6 +C3DE:000000000410041004100A2831C6008000807FFF00001038100010FE10440F38 +C3DF:000000000410041004100A2831C6008000807FFF00001FFC1000100010000FFC +C3E0:000000000410041004100A2831C6008000807FFF00001FFC00041FF810000FFC +C3E1:000000000410041004100A2831C6008000807FFF00001F7C01041E0410040F04 +C3E2:000000000410041004100A2831C6008000807FFF00001F7C01441E4410440F3C +C3E3:000000000410041004100A2831C6008000807FFF00001F4401441E7C10440F3C +C3E4:000000000410041004100A2831C6008000807FFF00001F1001101E1010280FC6 +C3E5:000000000410041004100A2831C6008000807FFF00001F7C01401E7C10400F3C +C3E6:000000000410041004100A2831C6008000807FFF00001F7E01241E2410240F7E +C3E7:000000000410041004100A2831C6008000807FFF00001F3801001EFE10440F38 +C3E8:000000000410041004100A2831C6008000807FFF00001FFC1004100410040FFC +C3E9:000000000410041004100A2831C6008000807FFF0000100410041FFC10040FFC +C3EA:000000000410041004100A2831C6008000807FFF0000111011101F1011280FC6 +C3EB:000000000410041004100A2831C6008000807FFF00000080008001400630180C +C3EC:000000000410041004100A2831C6008000807FFF00000410041004100A2831C6 +C3ED:000000000410041004100A2831C6008000807FFF00000FF81004100410040FF8 +C3EE:000000000410041004100A2831C6008000807FFF00001FFC008001400630180C +C3EF:000000000410041004100A2831C6008000807FFF000003E000001FFC02201C1C +C3F0:000000000410041004100A2831C6008000807FFF00001FFC00041FFC00040004 +C3F1:000000000410041004100A2831C6008000807FFF00001FFC10001FF810000FFC +C3F2:000000000410041004100A2831C6008000807FFF00001FFC0410041004101FFC +C3F3:000000000410041004100A2831C6008000807FFF000003E000001FFC080807F0 +C3F4:00000000000411041104110411042A872A8444440404040404047FF400040004 +C3F5:000000001104110411042A874444040404047FF400001FFC0004000400040004 +C3F6:000000001104110411042A874444040404047FF400001F7C0104010401040104 +C3F7:000000001104110411042A874444040404047FF400001F1001100110012801C6 +C3F8:000000001104110411042A874444040404047FF4000410041000100010000FFC +C3F9:000000001104110411042A874444040404047FF40000107C1010101010280FC6 +C3FA:000000001104110411042A874444040404047FF400001038100010FE10440F38 +C3FB:000000001104110411042A874444040404047FF400001FFC1000100010000FFC +C3FC:000000001104110411042A874444040404047FF400001FFC00041FF810000FFC +C3FD:000000001104110411042A874444040404047FF400001F7C01041E0410040F04 +C3FE:000000001104110411042A874444040404047FF400001F7C01441E4410440F3C +C3FF:000000001104110411042A874444040404047FF400001F4401441E7C10440F3C +C400:000000001104110411042A874444040404047FF400001F1001101E1010280FC6 +C401:000000001104110411042A874444040404047FF400001F7C01401E7C10400F3C +C402:000000001104110411042A874444040404047FF400001F7E01241E2410240F7E +C403:000000001104110411042A874444040404047FF400001F3801001EFE10440F38 +C404:000000001104110411042A874444040404047FF400001FFC1004100410040FFC +C405:000000001104110411042A874444040404047FF40000100410041FFC10040FFC +C406:000000001104110411042A874444040404047FF40000111011101F1011280FC6 +C407:000000001104110411042A874444040404047FF400000080008001400630180C +C408:000000001104110411042A874444040404047FF400000410041004100A2831C6 +C409:000000001104110411042A874444040404047FF400000FF81004100410040FF8 +C40A:000000001104110411042A874444040404047FF400001FFC008001400630180C +C40B:000000001104110411042A874444040404047FF4000003E000001FFC02201C1C +C40C:000000001104110411042A874444040404047FF400001FFC00041FFC00040004 +C40D:000000001104110411042A874444040404047FF400001FFC10001FF810000FFC +C40E:000000001104110411042A874444040404047FF400001FFC0410041004101FFC +C40F:000000001104110411042A874444040404047FF4000003E000001FFC080807F0 +C410:00000000001211121112111211122A9E2A9244520412041204127FD200120012 +C411:000000001112111211122A9E4452041204127FD200000FFE0002000200020002 +C412:000000001112111211122A9E4452041204127FD200000FBE0082008200820082 +C413:000000001112111211122A9E4452041204127FD200000F8800880088009400E3 +C414:000000001112111211122A9E4452041204127FD20012081208000800080007FE +C415:000000001112111211122A9E4452041204127FD20000083E08080808081407E3 +C416:000000001112111211122A9E4452041204127FD20000081C0800087F0822079C +C417:000000001112111211122A9E4452041204127FD200000FFE08000800080007FE +C418:000000001112111211122A9E4452041204127FD200000FFE00020FFC080007FE +C419:000000001112111211122A9E4452041204127FD200000FBE00820F0208020782 +C41A:000000001112111211122A9E4452041204127FD200000FBE00A20F220822079E +C41B:000000001112111211122A9E4452041204127FD200000FA200A20F3E0822079E +C41C:000000001112111211122A9E4452041204127FD200000F8800880F08081407E3 +C41D:000000001112111211122A9E4452041204127FD200000FBE00A00F3E0820079E +C41E:000000001112111211122A9E4452041204127FD200000FBF00920F12081207BF +C41F:000000001112111211122A9E4452041204127FD200000F9C00800F7F0822079C +C420:000000001112111211122A9E4452041204127FD200000FFE08020802080207FE +C421:000000001112111211122A9E4452041204127FD20000080208020FFE080207FE +C422:000000001112111211122A9E4452041204127FD20000088808880F88089407E3 +C423:000000001112111211122A9E4452041204127FD200000040004000A003180C06 +C424:000000001112111211122A9E4452041204127FD20000020802080208051418E3 +C425:000000001112111211122A9E4452041204127FD2000007FC08020802080207FC +C426:000000001112111211122A9E4452041204127FD200000FFE004000A003180C06 +C427:000000001112111211122A9E4452041204127FD2000001F000000FFE01100E0E +C428:000000001112111211122A9E4452041204127FD200000FFE00020FFE00020002 +C429:000000001112111211122A9E4452041204127FD200000FFE08000FFC080007FE +C42A:000000001112111211122A9E4452041204127FD200000FFE0208020802080FFE +C42B:000000001112111211122A9E4452041204127FD2000001F000000FFE040403F8 +C42C:00000000000411041104110411042A842A8444440404040404047FF400040004 +C42D:000000001104110411042A844444040404047FF400001FFC0004000400040004 +C42E:000000001104110411042A844444040404047FF400001F7C0104010401040104 +C42F:000000001104110411042A844444040404047FF400001F1001100110012801C6 +C430:000000001104110411042A844444040404047FF4000410041000100010000FFC +C431:000000001104110411042A844444040404047FF40000107C1010101010280FC6 +C432:000000001104110411042A844444040404047FF400001038100010FE10440F38 +C433:000000001104110411042A844444040404047FF400001FFC1000100010000FFC +C434:000000001104110411042A844444040404047FF400001FFC00041FF810000FFC +C435:000000001104110411042A844444040404047FF400001F7C01041E0410040F04 +C436:000000001104110411042A844444040404047FF400001F7C01441E4410440F3C +C437:000000001104110411042A844444040404047FF400001F4401441E7C10440F3C +C438:000000001104110411042A844444040404047FF400001F1001101E1010280FC6 +C439:000000001104110411042A844444040404047FF400001F7C01401E7C10400F3C +C43A:000000001104110411042A844444040404047FF400001F7E01241E2410240F7E +C43B:000000001104110411042A844444040404047FF400001F3801001EFE10440F38 +C43C:000000001104110411042A844444040404047FF400001FFC1004100410040FFC +C43D:000000001104110411042A844444040404047FF40000100410041FFC10040FFC +C43E:000000001104110411042A844444040404047FF40000111011101F1011280FC6 +C43F:000000001104110411042A844444040404047FF400000080008001400630180C +C440:000000001104110411042A844444040404047FF400000410041004100A2831C6 +C441:000000001104110411042A844444040404047FF400000FF81004100410040FF8 +C442:000000001104110411042A844444040404047FF400001FFC008001400630180C +C443:000000001104110411042A844444040404047FF4000003E000001FFC02201C1C +C444:000000001104110411042A844444040404047FF400001FFC00041FFC00040004 +C445:000000001104110411042A844444040404047FF400001FFC10001FF810000FFC +C446:000000001104110411042A844444040404047FF400001FFC0410041004101FFC +C447:000000001104110411042A844444040404047FF4000003E000001FFC080807F0 +C448:00000000000004100410041004100A280A2811440220022002207FFF00000000 +C449:000000000410041004100A2831C6022002207FFF00001FFC0004000400040004 +C44A:000000000410041004100A2831C6022002207FFF00001F7C0104010401040104 +C44B:000000000410041004100A2831C6022002207FFF00001F1001100110012801C6 +C44C:000000000410041004100A2831C6022002207FFF000010001000100010000FFC +C44D:000000000410041004100A2831C6022002207FFF0000107C1010101010280FC6 +C44E:000000000410041004100A2831C6022002207FFF00001038100010FE10440F38 +C44F:000000000410041004100A2831C6022002207FFF00001FFC1000100010000FFC +C450:000000000410041004100A2831C6022002207FFF00001FFC00041FF810000FFC +C451:000000000410041004100A2831C6022002207FFF00001F7C01041E0410040F04 +C452:000000000410041004100A2831C6022002207FFF00001F7C01441E4410440F3C +C453:000000000410041004100A2831C6022002207FFF00001F4401441E7C10440F3C +C454:000000000410041004100A2831C6022002207FFF00001F1001101E1010280FC6 +C455:000000000410041004100A2831C6022002207FFF00001F7C01401E7C10400F3C +C456:000000000410041004100A2831C6022002207FFF00001F7E01241E2410240F7E +C457:000000000410041004100A2831C6022002207FFF00001F3801001EFE10440F38 +C458:000000000410041004100A2831C6022002207FFF00001FFC1004100410040FFC +C459:000000000410041004100A2831C6022002207FFF0000100410041FFC10040FFC +C45A:000000000410041004100A2831C6022002207FFF0000111011101F1011280FC6 +C45B:000000000410041004100A2831C6022002207FFF00000080008001400630180C +C45C:000000000410041004100A2831C6022002207FFF00000410041004100A2831C6 +C45D:000000000410041004100A2831C6022002207FFF00000FF81004100410040FF8 +C45E:000000000410041004100A2831C6022002207FFF00001FFC008001400630180C +C45F:000000000410041004100A2831C6022002207FFF000003E000001FFC02201C1C +C460:000000000410041004100A2831C6022002207FFF00001FFC00041FFC00040004 +C461:000000000410041004100A2831C6022002207FFF00001FFC10001FF810000FFC +C462:000000000410041004100A2831C6022002207FFF00001FFC0410041004101FFC +C463:000000000410041004100A2831C6022002207FFF000003E000001FFC080807F0 +C464:000000000410041004100A2831C6000000007FFF008000800080008000800080 +C465:000000000410041004100A2831C600007FFF008000801FFC0004000400040004 +C466:000000000410041004100A2831C600007FFF008000801F7C0104010401040104 +C467:000000000410041004100A2831C600007FFF008000801F1001100110012801C6 +C468:000000000410041004100A2831C6000000007FFF008010801080100010000FFC +C469:000000000410041004100A2831C600007FFF00800080107C1010101010280FC6 +C46A:000000000410041004100A2831C600007FFF008000801038100010FE10440F38 +C46B:000000000410041004100A2831C600007FFF008000801FFC1000100010000FFC +C46C:000000000410041004100A2831C600007FFF008000801FFC00041FF810000FFC +C46D:000000000410041004100A2831C600007FFF008000801F7C01041E0410040F04 +C46E:000000000410041004100A2831C600007FFF008000801F7C01441E4410440F3C +C46F:000000000410041004100A2831C600007FFF008000801F4401441E7C10440F3C +C470:000000000410041004100A2831C600007FFF008000801F1001101E1010280FC6 +C471:000000000410041004100A2831C600007FFF008000801F7C01401E7C10400F3C +C472:000000000410041004100A2831C600007FFF008000801F7E01241E2410240F7E +C473:000000000410041004100A2831C600007FFF008000801F3801001EFE10440F38 +C474:000000000410041004100A2831C600007FFF008000801FFC1004100410040FFC +C475:000000000410041004100A2831C600007FFF00800080100410041FFC10040FFC +C476:000000000410041004100A2831C600007FFF00800080111011101F1011280FC6 +C477:000000000410041004100A2831C600007FFF008000800080008001400630180C +C478:000000000410041004100A2831C600007FFF008000800410041004100A2831C6 +C479:000000000410041004100A2831C600007FFF008000800FF81004100410040FF8 +C47A:000000000410041004100A2831C600007FFF008000801FFC008001400630180C +C47B:000000000410041004100A2831C600007FFF0080008003E000001FFC02201C1C +C47C:000000000410041004100A2831C600007FFF008000801FFC00041FFC00040004 +C47D:000000000410041004100A2831C600007FFF008000801FFC10001FF810000FFC +C47E:000000000410041004100A2831C600007FFF008000801FFC0410041004101FFC +C47F:000000000410041004100A2831C600007FFF0080008003E000001FFC080807F0 +C480:000000001104110411042A844444000400047FF404040404043C040404040404 +C481:000000001104110411042A9C444400047FF4040404001FFC0004000400040004 +C482:000000001104110411042A9C444400047FF4040404001F7C0104010401040104 +C483:000000001104110411042A9C444400047FF4040404001F1001100110012801C6 +C484:000000001104110411042A84444400047FF40404043C14041000100010000FFC +C485:000000001104110411042A9C444400047FF404040400107C1010101010280FC6 +C486:000000001104110411042A9C444400047FF4040404001038100010FE10440F38 +C487:000000001104110411042A9C444400047FF4040404001FFC1000100010000FFC +C488:000000001104110411042A9C444400047FF4040404001FFC00041FF810000FFC +C489:000000001104110411042A9C444400047FF4040404001F7C01041E0410040F04 +C48A:000000001104110411042A9C444400047FF4040404001F7C01441E4410440F3C +C48B:000000001104110411042A9C444400047FF4040404001F4401441E7C10440F3C +C48C:000000001104110411042A9C444400047FF4040404001F1001101E1010280FC6 +C48D:000000001104110411042A9C444400047FF4040404001F7C01401E7C10400F3C +C48E:000000001104110411042A9C444400047FF4040404001F7E01241E2410240F7E +C48F:000000001104110411042A9C444400047FF4040404001F3801001EFE10440F38 +C490:000000001104110411042A9C444400047FF4040404001FFC1004100410040FFC +C491:000000001104110411042A9C444400047FF404040400100410041FFC10040FFC +C492:000000001104110411042A9C444400047FF404040400111011101F1011280FC6 +C493:000000001104110411042A9C444400047FF4040404000080008001400630180C +C494:000000001104110411042A9C444400047FF4040404000410041004100A2831C6 +C495:000000001104110411042A9C444400047FF4040404000FF81004100410040FF8 +C496:000000001104110411042A9C444400047FF4040404001FFC008001400630180C +C497:000000001104110411042A9C444400047FF40404040003E000001FFC02201C1C +C498:000000001104110411042A9C444400047FF4040404001FFC00041FFC00040004 +C499:000000001104110411042A9C444400047FF4040404001FFC10001FF810000FFC +C49A:000000001104110411042A9C444400047FF4040404001FFC0410041004101FFC +C49B:000000001104110411042A9C444400047FF40404040003E000001FFC080807F0 +C49C:000000001112111211122A924452001200127FD20412041204F2041204120412 +C49D:000000001112111211122AF2445200127FD2041204000FFE0002000200020002 +C49E:000000001112111211122AF2445200127FD2041204000FBE0082008200820082 +C49F:000000001112111211122AF2445200127FD2041204000F8800880088009400E3 +C4A0:000000001112111211122A92445200127FD2021202F20A1208000800080007FE +C4A1:000000001112111211122AF2445200127FD204120400083E08080808081407E3 +C4A2:000000001112111211122AF2445200127FD204120400081C0800087F0822079C +C4A3:000000001112111211122AF2445200127FD2041204000FFE08000800080007FE +C4A4:000000001112111211122AF2445200127FD2041204000FFE00020FFC080007FE +C4A5:000000001112111211122AF2445200127FD2041204000FBE00820F0208020782 +C4A6:000000001112111211122AF2445200127FD2041204000FBE00A20F220822079E +C4A7:000000001112111211122AF2445200127FD2041204000FA200A20F3E0822079E +C4A8:000000001112111211122AF2445200127FD2041204000F8800880F08081407E3 +C4A9:000000001112111211122AF2445200127FD2041204000FBE00A00F3E0820079E +C4AA:000000001112111211122AF2445200127FD2041204000FBF00920F12081207BF +C4AB:000000001112111211122AF2445200127FD2041204000F9C00800F7F0822079C +C4AC:000000001112111211122AF2445200127FD2041204000FFE08020802080207FE +C4AD:000000001112111211122AF2445200127FD204120400080208020FFE080207FE +C4AE:000000001112111211122AF2445200127FD204120400088808880F88089407E3 +C4AF:000000001112111211122AF2445200127FD2041204000040004000A003180C06 +C4B0:000000001112111211122AF2445200127FD204120400020802080208051418E3 +C4B1:000000001112111211122AF2445200127FD20412040007FC08020802080207FC +C4B2:000000001112111211122AF2445200127FD2041204000FFE004000A003180C06 +C4B3:000000001112111211122AF2445200127FD20412040001F000000FFE01100E0E +C4B4:000000001112111211122AF2445200127FD2041204000FFE00020FFE00020002 +C4B5:000000001112111211122AF2445200127FD2041204000FFE08000FFC080007FE +C4B6:000000001112111211122AF2445200127FD2041204000FFE0208020802080FFE +C4B7:000000001112111211122AF2445200127FD20412040001F000000FFE040403F8 +C4B8:000000001104110411042A844444000400047FF4040404040404040404040404 +C4B9:000000001104110411042A84444400047FF4040404001FFC0004000400040004 +C4BA:000000001104110411042A84444400047FF4040404001F7C0104010401040104 +C4BB:000000001104110411042A84444400047FF4040404001F1001100110012801C6 +C4BC:000000001104110411042A84444400047FF40404040414041000100010000FFC +C4BD:000000001104110411042A84444400047FF404040400107C1010101010280FC6 +C4BE:000000001104110411042A84444400047FF4040404001038100010FE10440F38 +C4BF:000000001104110411042A84444400047FF4040404001FFC1000100010000FFC +C4C0:000000001104110411042A84444400047FF4040404001FFC00041FF810000FFC +C4C1:000000001104110411042A84444400047FF4040404001F7C01041E0410040F04 +C4C2:000000001104110411042A84444400047FF4040404001F7C01441E4410440F3C +C4C3:000000001104110411042A84444400047FF4040404001F4401441E7C10440F3C +C4C4:000000001104110411042A84444400047FF4040404001F1001101E1010280FC6 +C4C5:000000001104110411042A84444400047FF4040404001F7C01401E7C10400F3C +C4C6:000000001104110411042A84444400047FF4040404001F7E01241E2410240F7E +C4C7:000000001104110411042A84444400047FF4040404001F3801001EFE10440F38 +C4C8:000000001104110411042A84444400047FF4040404001FFC1004100410040FFC +C4C9:000000001104110411042A84444400047FF404040400100410041FFC10040FFC +C4CA:000000001104110411042A84444400047FF404040400111011101F1011280FC6 +C4CB:000000001104110411042A84444400047FF4040404000080008001400630180C +C4CC:000000001104110411042A84444400047FF4040404000410041004100A2831C6 +C4CD:000000001104110411042A84444400047FF4040404000FF81004100410040FF8 +C4CE:000000001104110411042A84444400047FF4040404001FFC008001400630180C +C4CF:000000001104110411042A84444400047FF40404040003E000001FFC02201C1C +C4D0:000000001104110411042A84444400047FF4040404001FFC00041FFC00040004 +C4D1:000000001104110411042A84444400047FF4040404001FFC10001FF810000FFC +C4D2:000000001104110411042A84444400047FF4040404001FFC0410041004101FFC +C4D3:000000001104110411042A84444400047FF40404040003E000001FFC080807F0 +C4D4:000000000410041004100A2831C6000000007FFF041004100410041004100410 +C4D5:000000000410041004100A2831C600007FFF022002201FFC0004000400040004 +C4D6:000000000410041004100A2831C600007FFF022002201F7C0104010401040104 +C4D7:000000000410041004100A2831C600007FFF022002201F1001100110012801C6 +C4D8:000000000410041004100A2831C6000000007FFF022012201220100010000FFC +C4D9:000000000410041004100A2831C600007FFF02200220107C1010101010280FC6 +C4DA:000000000410041004100A2831C600007FFF022002201038100010FE10440F38 +C4DB:000000000410041004100A2831C600007FFF022002201FFC1000100010000FFC +C4DC:000000000410041004100A2831C600007FFF022002201FFC00041FF810000FFC +C4DD:000000000410041004100A2831C600007FFF022002201F7C01041E0410040F04 +C4DE:000000000410041004100A2831C600007FFF022002201F7C01441E4410440F3C +C4DF:000000000410041004100A2831C600007FFF022002201F4401441E7C10440F3C +C4E0:000000000410041004100A2831C600007FFF022002201F1001101E1010280FC6 +C4E1:000000000410041004100A2831C600007FFF022002201F7C01401E7C10400F3C +C4E2:000000000410041004100A2831C600007FFF022002201F7E01241E2410240F7E +C4E3:000000000410041004100A2831C600007FFF022002201F3801001EFE10440F38 +C4E4:000000000410041004100A2831C600007FFF022002201FFC1004100410040FFC +C4E5:000000000410041004100A2831C600007FFF02200220100410041FFC10040FFC +C4E6:000000000410041004100A2831C600007FFF02200220111011101F1011280FC6 +C4E7:000000000410041004100A2831C600007FFF022002200080008001400630180C +C4E8:000000000410041004100A2831C600007FFF022002200410041004100A2831C6 +C4E9:000000000410041004100A2831C600007FFF022002200FF81004100410040FF8 +C4EA:000000000410041004100A2831C600007FFF022002201FFC008001400630180C +C4EB:000000000410041004100A2831C600007FFF0220022003E000001FFC02201C1C +C4EC:000000000410041004100A2831C600007FFF022002201FFC00041FFC00040004 +C4ED:000000000410041004100A2831C600007FFF022002201FFC10001FF810000FFC +C4EE:000000000410041004100A2831C600007FFF022002201FFC0410041004101FFC +C4EF:000000000410041004100A2831C600007FFF0220022003E000001FFC080807F0 +C4F0:00000000000004100410041004100A280A2811440000000000007FFF00000000 +C4F1:000000000410041004100A2831C600007FFF000000001FFC0004000400040004 +C4F2:000000000410041004100A2831C600007FFF000000001F7C0104010401040104 +C4F3:000000000410041004100A2831C600007FFF000000001F1001100110012801C6 +C4F4:000000000410041004100A2831C6000000007FFF000010001000100010000FFC +C4F5:000000000410041004100A2831C600007FFF00000000107C1010101010280FC6 +C4F6:000000000410041004100A2831C600007FFF000000001038100010FE10440F38 +C4F7:000000000410041004100A2831C600007FFF000000001FFC1000100010000FFC +C4F8:000000000410041004100A2831C600007FFF000000001FFC00041FF810000FFC +C4F9:000000000410041004100A2831C600007FFF000000001F7C01041E0410040F04 +C4FA:000000000410041004100A2831C600007FFF000000001F7C01441E4410440F3C +C4FB:000000000410041004100A2831C600007FFF000000001F4401441E7C10440F3C +C4FC:000000000410041004100A2831C600007FFF000000001F1001101E1010280FC6 +C4FD:000000000410041004100A2831C600007FFF000000001F7C01401E7C10400F3C +C4FE:000000000410041004100A2831C600007FFF000000001F7E01241E2410240F7E +C4FF:000000000410041004100A2831C600007FFF000000001F3801001EFE10440F38 +C500:000000000410041004100A2831C600007FFF000000001FFC1004100410040FFC +C501:000000000410041004100A2831C600007FFF00000000100410041FFC10040FFC +C502:000000000410041004100A2831C600007FFF00000000111011101F1011280FC6 +C503:000000000410041004100A2831C600007FFF000000000080008001400630180C +C504:000000000410041004100A2831C600007FFF000000000410041004100A2831C6 +C505:000000000410041004100A2831C600007FFF000000000FF81004100410040FF8 +C506:000000000410041004100A2831C600007FFF000000001FFC008001400630180C +C507:000000000410041004100A2831C600007FFF0000000003E000001FFC02201C1C +C508:000000000410041004100A2831C600007FFF000000001FFC00041FFC00040004 +C509:000000000410041004100A2831C600007FFF000000001FFC10001FF810000FFC +C50A:000000000410041004100A2831C600007FFF000000001FFC0410041004101FFC +C50B:000000000410041004100A2831C600007FFF0000000003E000001FFC080807F0 +C50C:00000000000411041104110411042A842A8444440004000400047FF400040004 +C50D:000000001104110411042A84444400047FF4000400001FFC0004000400040004 +C50E:000000001104110411042A84444400047FF4000400001F7C0104010401040104 +C50F:000000001104110411042A84444400047FF4000400001F1001100110012801C6 +C510:000000001104110411042A844444000400047FF4000410041000100010000FFC +C511:000000001104110411042A84444400047FF400040000107C1010101010280FC6 +C512:000000001104110411042A84444400047FF4000400001038100010FE10440F38 +C513:000000001104110411042A84444400047FF4000400001FFC1000100010000FFC +C514:000000001104110411042A84444400047FF4000400001FFC00041FF810000FFC +C515:000000001104110411042A84444400047FF4000400001F7C01041E0410040F04 +C516:000000001104110411042A84444400047FF4000400001F7C01441E4410440F3C +C517:000000001104110411042A84444400047FF4000400001F4401441E7C10440F3C +C518:000000001104110411042A84444400047FF4000400001F1001101E1010280FC6 +C519:000000001104110411042A84444400047FF4000400001F7C01401E7C10400F3C +C51A:000000001104110411042A84444400047FF4000400001F7E01241E2410240F7E +C51B:000000001104110411042A84444400047FF4000400001F3801001EFE10440F38 +C51C:000000001104110411042A84444400047FF4000400001FFC1004100410040FFC +C51D:000000001104110411042A84444400047FF400040000100410041FFC10040FFC +C51E:000000001104110411042A84444400047FF400040000111011101F1011280FC6 +C51F:000000001104110411042A84444400047FF4000400000080008001400630180C +C520:000000001104110411042A84444400047FF4000400000410041004100A2831C6 +C521:000000001104110411042A84444400047FF4000400000FF81004100410040FF8 +C522:000000001104110411042A84444400047FF4000400001FFC008001400630180C +C523:000000001104110411042A84444400047FF40004000003E000001FFC02201C1C +C524:000000001104110411042A84444400047FF4000400001FFC00041FFC00040004 +C525:000000001104110411042A84444400047FF4000400001FFC10001FF810000FFC +C526:000000001104110411042A84444400047FF4000400001FFC0410041004101FFC +C527:000000001104110411042A84444400047FF40004000003E000001FFC080807F0 +C528:0000000000041104110411041104110411042A842A842A844444000400040004 +C529:0000000011041104110411042A842A844444000400001FFC0004000400040004 +C52A:0000000011041104110411042A842A844444000400001F7C0104010401040104 +C52B:0000000011041104110411042A842A844444000400001F1001100110012801C6 +C52C:0000000011041104110411042A842A8444440004000410041000100010000FFC +C52D:0000000011041104110411042A842A84444400040000107C1010101010280FC6 +C52E:0000000011041104110411042A842A844444000400001038100010FE10440F38 +C52F:0000000011041104110411042A842A844444000400001FFC1000100010000FFC +C530:0000000011041104110411042A842A844444000400001FFC00041FF810000FFC +C531:0000000011041104110411042A842A844444000400001F7C01041E0410040F04 +C532:0000000011041104110411042A842A844444000400001F7C01441E4410440F3C +C533:0000000011041104110411042A842A844444000400001F4401441E7C10440F3C +C534:0000000011041104110411042A842A844444000400001F1001101E1010280FC6 +C535:0000000011041104110411042A842A844444000400001F7C01401E7C10400F3C +C536:0000000011041104110411042A842A844444000400001F7E01241E2410240F7E +C537:0000000011041104110411042A842A844444000400001F3801001EFE10440F38 +C538:0000000011041104110411042A842A844444000400001FFC1004100410040FFC +C539:0000000011041104110411042A842A84444400040000100410041FFC10040FFC +C53A:0000000011041104110411042A842A84444400040000111011101F1011280FC6 +C53B:0000000011041104110411042A842A844444000400000080008001400630180C +C53C:0000000011041104110411042A842A844444000400000410041004100A2831C6 +C53D:0000000011041104110411042A842A844444000400000FF81004100410040FF8 +C53E:0000000011041104110411042A842A844444000400001FFC008001400630180C +C53F:0000000011041104110411042A842A8444440004000003E000001FFC02201C1C +C540:0000000011041104110411042A842A844444000400001FFC00041FFC00040004 +C541:0000000011041104110411042A842A844444000400001FFC10001FF810000FFC +C542:0000000011041104110411042A842A844444000400001FFC0410041004101FFC +C543:0000000011041104110411042A842A8444440004000003E000001FFC080807F0 +C544:0000000000040E04110420842084208720842084208411040E04000400040004 +C545:000000000E04110420842087208411040E04000400001FFC0004000400040004 +C546:000000000E04110420842087208411040E04000400001F7C0104010401040104 +C547:000000000E04110420842087208411040E04000400001F1001100110012801C6 +C548:000000000E04110420842087208411040E040004000410041000100010000FFC +C549:000000000E04110420842087208411040E0400040000107C1010101010280FC6 +C54A:000000000E04110420842087208411040E04000400001038100010FE10440F38 +C54B:000000000E04110420842087208411040E04000400001FFC1000100010000FFC +C54C:000000000E04110420842087208411040E04000400001FFC00041FF810000FFC +C54D:000000000E04110420842087208411040E04000400001F7C01041E0410040F04 +C54E:000000000E04110420842087208411040E04000400001F7C01441E4410440F3C +C54F:000000000E04110420842087208411040E04000400001F4401441E7C10440F3C +C550:000000000E04110420842087208411040E04000400001F1001101E1010280FC6 +C551:000000000E04110420842087208411040E04000400001F7C01401E7C10400F3C +C552:000000000E04110420842087208411040E04000400001F7E01241E2410240F7E +C553:000000000E04110420842087208411040E04000400001F3801001EFE10440F38 +C554:000000000E04110420842087208411040E04000400001FFC1004100410040FFC +C555:000000000E04110420842087208411040E0400040000100410041FFC10040FFC +C556:000000000E04110420842087208411040E0400040000111011101F1011280FC6 +C557:000000000E04110420842087208411040E04000400000080008001400630180C +C558:000000000E04110420842087208411040E04000400000410041004100A2831C6 +C559:000000000E04110420842087208411040E04000400000FF81004100410040FF8 +C55A:000000000E04110420842087208411040E04000400001FFC008001400630180C +C55B:000000000E04110420842087208411040E040004000003E000001FFC02201C1C +C55C:000000000E04110420842087208411040E04000400001FFC00041FFC00040004 +C55D:000000000E04110420842087208411040E04000400001FFC10001FF810000FFC +C55E:000000000E04110420842087208411040E04000400001FFC0410041004101FFC +C55F:000000000E04110420842087208411040E040004000003E000001FFC080807F0 +C560:0000000000120E12111220922092209E20922092209211120E12001200120012 +C561:000000000E1211122092209E209211120E12001200000FFE0002000200020002 +C562:000000000E1211122092209E209211120E12001200000FBE0082008200820082 +C563:000000000E1211122092209E209211120E12001200000F8800880088009400E3 +C564:000000000E1211122092209E209211120E1200120012081208000800080007FE +C565:000000000E1211122092209E209211120E1200120000083E08080808081407E3 +C566:000000000E1211122092209E209211120E1200120000081C0800087F0822079C +C567:000000000E1211122092209E209211120E12001200000FFE08000800080007FE +C568:000000000E1211122092209E209211120E12001200000FFE00020FFC080007FE +C569:000000000E1211122092209E209211120E12001200000FBE00820F0208020782 +C56A:000000000E1211122092209E209211120E12001200000FBE00A20F220822079E +C56B:000000000E1211122092209E209211120E12001200000FA200A20F3E0822079E +C56C:000000000E1211122092209E209211120E12001200000F8800880F08081407E3 +C56D:000000000E1211122092209E209211120E12001200000FBE00A00F3E0820079E +C56E:000000000E1211122092209E209211120E12001200000FBF00920F12081207BF +C56F:000000000E1211122092209E209211120E12001200000F9C00800F7F0822079C +C570:000000000E1211122092209E209211120E12001200000FFE08020802080207FE +C571:000000000E1211122092209E209211120E1200120000080208020FFE080207FE +C572:000000000E1211122092209E209211120E1200120000088808880F88089407E3 +C573:000000000E1211122092209E209211120E12001200000040004000A003180C06 +C574:000000000E1211122092209E209211120E1200120000020802080208051418E3 +C575:000000000E1211122092209E209211120E120012000007FC08020802080207FC +C576:000000000E1211122092209E209211120E12001200000FFE004000A003180C06 +C577:000000000E1211122092209E209211120E120012000001F000000FFE01100E0E +C578:000000000E1211122092209E209211120E12001200000FFE00020FFE00020002 +C579:000000000E1211122092209E209211120E12001200000FFE08000FFC080007FE +C57A:000000000E1211122092209E209211120E12001200000FFE0208020802080FFE +C57B:000000000E1211122092209E209211120E120012000001F000000FFE040403F8 +C57C:0000000000040E04110420842087208420842087208411040E04000400040004 +C57D:000000000E04110420872084208411070E04000400001FFC0004000400040004 +C57E:000000000E04110420872084208411070E04000400001F7C0104010401040104 +C57F:000000000E04110420872084208411070E04000400001F1001100110012801C6 +C580:000000000E04110420872084208411070E040004000410041000100010000FFC +C581:000000000E04110420872084208411070E0400040000107C1010101010280FC6 +C582:000000000E04110420872084208411070E04000400001038100010FE10440F38 +C583:000000000E04110420872084208411070E04000400001FFC1000100010000FFC +C584:000000000E04110420872084208411070E04000400001FFC00041FF810000FFC +C585:000000000E04110420872084208411070E04000400001F7C01041E0410040F04 +C586:000000000E04110420872084208411070E04000400001F7C01441E4410440F3C +C587:000000000E04110420872084208411070E04000400001F4401441E7C10440F3C +C588:000000000E04110420872084208411070E04000400001F1001101E1010280FC6 +C589:000000000E04110420872084208411070E04000400001F7C01401E7C10400F3C +C58A:000000000E04110420872084208411070E04000400001F7E01241E2410240F7E +C58B:000000000E04110420872084208411070E04000400001F3801001EFE10440F38 +C58C:000000000E04110420872084208411070E04000400001FFC1004100410040FFC +C58D:000000000E04110420872084208411070E0400040000100410041FFC10040FFC +C58E:000000000E04110420872084208411070E0400040000111011101F1011280FC6 +C58F:000000000E04110420872084208411070E04000400000080008001400630180C +C590:000000000E04110420872084208411070E04000400000410041004100A2831C6 +C591:000000000E04110420872084208411070E04000400000FF81004100410040FF8 +C592:000000000E04110420872084208411070E04000400001FFC008001400630180C +C593:000000000E04110420872084208411070E040004000003E000001FFC02201C1C +C594:000000000E04110420872084208411070E04000400001FFC00041FFC00040004 +C595:000000000E04110420872084208411070E04000400001FFC10001FF810000FFC +C596:000000000E04110420872084208411070E04000400001FFC0410041004101FFC +C597:000000000E04110420872084208411070E040004000003E000001FFC080807F0 +C598:0000000000120E1211122092209E20922092209E209211120E12001200120012 +C599:000000000E121112209E20922092111E0E12001200000FFE0002000200020002 +C59A:000000000E121112209E20922092111E0E12001200000FBE0082008200820082 +C59B:000000000E121112209E20922092111E0E12001200000F8800880088009400E3 +C59C:000000000E121112209E20922092111E0E1200120012081208000800080007FE +C59D:000000000E121112209E20922092111E0E1200120000083E08080808081407E3 +C59E:000000000E121112209E20922092111E0E1200120000081C0800087F0822079C +C59F:000000000E121112209E20922092111E0E12001200000FFE08000800080007FE +C5A0:000000000E121112209E20922092111E0E12001200000FFE00020FFC080007FE +C5A1:000000000E121112209E20922092111E0E12001200000FBE00820F0208020782 +C5A2:000000000E121112209E20922092111E0E12001200000FBE00A20F220822079E +C5A3:000000000E121112209E20922092111E0E12001200000FA200A20F3E0822079E +C5A4:000000000E121112209E20922092111E0E12001200000F8800880F08081407E3 +C5A5:000000000E121112209E20922092111E0E12001200000FBE00A00F3E0820079E +C5A6:000000000E121112209E20922092111E0E12001200000FBF00920F12081207BF +C5A7:000000000E121112209E20922092111E0E12001200000F9C00800F7F0822079C +C5A8:000000000E121112209E20922092111E0E12001200000FFE08020802080207FE +C5A9:000000000E121112209E20922092111E0E1200120000080208020FFE080207FE +C5AA:000000000E121112209E20922092111E0E1200120000088808880F88089407E3 +C5AB:000000000E121112209E20922092111E0E12001200000040004000A003180C06 +C5AC:000000000E121112209E20922092111E0E1200120000020802080208051418E3 +C5AD:000000000E121112209E20922092111E0E120012000007FC08020802080207FC +C5AE:000000000E121112209E20922092111E0E12001200000FFE004000A003180C06 +C5AF:000000000E121112209E20922092111E0E120012000001F000000FFE01100E0E +C5B0:000000000E121112209E20922092111E0E12001200000FFE00020FFE00020002 +C5B1:000000000E121112209E20922092111E0E12001200000FFE08000FFC080007FE +C5B2:000000000E121112209E20922092111E0E12001200000FFE0208020802080FFE +C5B3:000000000E121112209E20922092111E0E120012000001F000000FFE040403F8 +C5B4:0000000000040E0411042084208420BC20842084208411040E04000400040004 +C5B5:000000000E041104208420BC208411040E04000400001FFC0004000400040004 +C5B6:000000000E041104208420BC208411040E04000400001F7C0104010401040104 +C5B7:000000000E041104208420BC208411040E04000400001F1001100110012801C6 +C5B8:000000000E041104208420BC208411040E040004000410041000100010000FFC +C5B9:000000000E041104208420BC208411040E0400040000107C1010101010280FC6 +C5BA:000000000E041104208420BC208411040E04000400001038100010FE10440F38 +C5BB:000000000E041104208420BC208411040E04000400001FFC1000100010000FFC +C5BC:000000000E041104208420BC208411040E04000400001FFC00041FF810000FFC +C5BD:000000000E041104208420BC208411040E04000400001F7C01041E0410040F04 +C5BE:000000000E041104208420BC208411040E04000400001F7C01441E4410440F3C +C5BF:000000000E041104208420BC208411040E04000400001F4401441E7C10440F3C +C5C0:000000000E041104208420BC208411040E04000400001F1001101E1010280FC6 +C5C1:000000000E041104208420BC208411040E04000400001F7C01401E7C10400F3C +C5C2:000000000E041104208420BC208411040E04000400001F7E01241E2410240F7E +C5C3:000000000E041104208420BC208411040E04000400001F3801001EFE10440F38 +C5C4:000000000E041104208420BC208411040E04000400001FFC1004100410040FFC +C5C5:000000000E041104208420BC208411040E0400040000100410041FFC10040FFC +C5C6:000000000E041104208420BC208411040E0400040000111011101F1011280FC6 +C5C7:000000000E041104208420BC208411040E04000400000080008001400630180C +C5C8:000000000E041104208420BC208411040E04000400000410041004100A2831C6 +C5C9:000000000E041104208420BC208411040E04000400000FF81004100410040FF8 +C5CA:000000000E041104208420BC208411040E04000400001FFC008001400630180C +C5CB:000000000E041104208420BC208411040E040004000003E000001FFC02201C1C +C5CC:000000000E041104208420BC208411040E04000400001FFC00041FFC00040004 +C5CD:000000000E041104208420BC208411040E04000400001FFC10001FF810000FFC +C5CE:000000000E041104208420BC208411040E04000400001FFC0410041004101FFC +C5CF:000000000E041104208420BC208411040E040004000003E000001FFC080807F0 +C5D0:0000000000120E1211122092209220F220922092209211120E12001200120012 +C5D1:000000000E121112209220F2209211120E12001200000FFE0002000200020002 +C5D2:000000000E121112209220F2209211120E12001200000FBE0082008200820082 +C5D3:000000000E121112209220F2209211120E12001200000F8800880088009400E3 +C5D4:000000000E121112209220F2209211120E1200120012081208000800080007FE +C5D5:000000000E121112209220F2209211120E1200120000083E08080808081407E3 +C5D6:000000000E121112209220F2209211120E1200120000081C0800087F0822079C +C5D7:000000000E121112209220F2209211120E12001200000FFE08000800080007FE +C5D8:000000000E121112209220F2209211120E12001200000FFE00020FFC080007FE +C5D9:000000000E121112209220F2209211120E12001200000FBE00820F0208020782 +C5DA:000000000E121112209220F2209211120E12001200000FBE00A20F220822079E +C5DB:000000000E121112209220F2209211120E12001200000FA200A20F3E0822079E +C5DC:000000000E121112209220F2209211120E12001200000F8800880F08081407E3 +C5DD:000000000E121112209220F2209211120E12001200000FBE00A00F3E0820079E +C5DE:000000000E121112209220F2209211120E12001200000FBF00920F12081207BF +C5DF:000000000E121112209220F2209211120E12001200000F9C00800F7F0822079C +C5E0:000000000E121112209220F2209211120E12001200000FFE08020802080207FE +C5E1:000000000E121112209220F2209211120E1200120000080208020FFE080207FE +C5E2:000000000E121112209220F2209211120E1200120000088808880F88089407E3 +C5E3:000000000E121112209220F2209211120E12001200000040004000A003180C06 +C5E4:000000000E121112209220F2209211120E1200120000020802080208051418E3 +C5E5:000000000E121112209220F2209211120E120012000007FC08020802080207FC +C5E6:000000000E121112209220F2209211120E12001200000FFE004000A003180C06 +C5E7:000000000E121112209220F2209211120E120012000001F000000FFE01100E0E +C5E8:000000000E121112209220F2209211120E12001200000FFE00020FFE00020002 +C5E9:000000000E121112209220F2209211120E12001200000FFE08000FFC080007FE +C5EA:000000000E121112209220F2209211120E12001200000FFE0208020802080FFE +C5EB:000000000E121112209220F2209211120E120012000001F000000FFE040403F8 +C5EC:0000000000040E041104208420BC2084208420BC208411040E04000400040004 +C5ED:000000000E04110420BC20842084113C0E04000400001FFC0004000400040004 +C5EE:000000000E04110420BC20842084113C0E04000400001F7C0104010401040104 +C5EF:000000000E04110420BC20842084113C0E04000400001F1001100110012801C6 +C5F0:000000000E04110420BC20842084113C0E040004000410041000100010000FFC +C5F1:000000000E04110420BC20842084113C0E0400040000107C1010101010280FC6 +C5F2:000000000E04110420BC20842084113C0E04000400001038100010FE10440F38 +C5F3:000000000E04110420BC20842084113C0E04000400001FFC1000100010000FFC +C5F4:000000000E04110420BC20842084113C0E04000400001FFC00041FF810000FFC +C5F5:000000000E04110420BC20842084113C0E04000400001F7C01041E0410040F04 +C5F6:000000000E04110420BC20842084113C0E04000400001F7C01441E4410440F3C +C5F7:000000000E04110420BC20842084113C0E04000400001F4401441E7C10440F3C +C5F8:000000000E04110420BC20842084113C0E04000400001F1001101E1010280FC6 +C5F9:000000000E04110420BC20842084113C0E04000400001F7C01401E7C10400F3C +C5FA:000000000E04110420BC20842084113C0E04000400001F7E01241E2410240F7E +C5FB:000000000E04110420BC20842084113C0E04000400001F3801001EFE10440F38 +C5FC:000000000E04110420BC20842084113C0E04000400001FFC1004100410040FFC +C5FD:000000000E04110420BC20842084113C0E0400040000100410041FFC10040FFC +C5FE:000000000E04110420BC20842084113C0E0400040000111011101F1011280FC6 +C5FF:000000000E04110420BC20842084113C0E04000400000080008001400630180C +C600:000000000E04110420BC20842084113C0E04000400000410041004100A2831C6 +C601:000000000E04110420BC20842084113C0E04000400000FF81004100410040FF8 +C602:000000000E04110420BC20842084113C0E04000400001FFC008001400630180C +C603:000000000E04110420BC20842084113C0E040004000003E000001FFC02201C1C +C604:000000000E04110420BC20842084113C0E04000400001FFC00041FFC00040004 +C605:000000000E04110420BC20842084113C0E04000400001FFC10001FF810000FFC +C606:000000000E04110420BC20842084113C0E04000400001FFC0410041004101FFC +C607:000000000E04110420BC20842084113C0E040004000003E000001FFC080807F0 +C608:0000000000120E121112209220F22092209220F2209211120E12001200120012 +C609:000000000E12111220F22092209211720E12001200000FFE0002000200020002 +C60A:000000000E12111220F22092209211720E12001200000FBE0082008200820082 +C60B:000000000E12111220F22092209211720E12001200000F8800880088009400E3 +C60C:000000000E12111220F22092209211720E1200120012081208000800080007FE +C60D:000000000E12111220F22092209211720E1200120000083E08080808081407E3 +C60E:000000000E12111220F22092209211720E1200120000081C0800087F0822079C +C60F:000000000E12111220F22092209211720E12001200000FFE08000800080007FE +C610:000000000E12111220F22092209211720E12001200000FFE00020FFC080007FE +C611:000000000E12111220F22092209211720E12001200000FBE00820F0208020782 +C612:000000000E12111220F22092209211720E12001200000FBE00A20F220822079E +C613:000000000E12111220F22092209211720E12001200000FA200A20F3E0822079E +C614:000000000E12111220F22092209211720E12001200000F8800880F08081407E3 +C615:000000000E12111220F22092209211720E12001200000FBE00A00F3E0820079E +C616:000000000E12111220F22092209211720E12001200000FBF00920F12081207BF +C617:000000000E12111220F22092209211720E12001200000F9C00800F7F0822079C +C618:000000000E12111220F22092209211720E12001200000FFE08020802080207FE +C619:000000000E12111220F22092209211720E1200120000080208020FFE080207FE +C61A:000000000E12111220F22092209211720E1200120000088808880F88089407E3 +C61B:000000000E12111220F22092209211720E12001200000040004000A003180C06 +C61C:000000000E12111220F22092209211720E1200120000020802080208051418E3 +C61D:000000000E12111220F22092209211720E120012000007FC08020802080207FC +C61E:000000000E12111220F22092209211720E12001200000FFE004000A003180C06 +C61F:000000000E12111220F22092209211720E120012000001F000000FFE01100E0E +C620:000000000E12111220F22092209211720E12001200000FFE00020FFE00020002 +C621:000000000E12111220F22092209211720E12001200000FFE08000FFC080007FE +C622:000000000E12111220F22092209211720E12001200000FFE0208020802080FFE +C623:000000000E12111220F22092209211720E120012000001F000000FFE040403F8 +C624:00000000000007F00808100410041004080807F00080008000807FFF00000000 +C625:000000000FF81004100410040FF8008000807FFF00001FFC0004000400040004 +C626:000000000FF81004100410040FF8008000807FFF00001F7C0104010401040104 +C627:000000000FF81004100410040FF8008000807FFF00001F1001100110012801C6 +C628:000000000FF81004100410040FF8008000807FFF000010001000100010000FFC +C629:000000000FF81004100410040FF8008000807FFF0000107C1010101010280FC6 +C62A:000000000FF81004100410040FF8008000807FFF00001038100010FE10440F38 +C62B:000000000FF81004100410040FF8008000807FFF00001FFC1000100010000FFC +C62C:000000000FF81004100410040FF8008000807FFF00001FFC00041FF810000FFC +C62D:000000000FF81004100410040FF8008000807FFF00001F7C01041E0410040F04 +C62E:000000000FF81004100410040FF8008000807FFF00001F7C01441E4410440F3C +C62F:000000000FF81004100410040FF8008000807FFF00001F4401441E7C10440F3C +C630:000000000FF81004100410040FF8008000807FFF00001F1001101E1010280FC6 +C631:000000000FF81004100410040FF8008000807FFF00001F7C01401E7C10400F3C +C632:000000000FF81004100410040FF8008000807FFF00001F7E01241E2410240F7E +C633:000000000FF81004100410040FF8008000807FFF00001F3801001EFE10440F38 +C634:000000000FF81004100410040FF8008000807FFF00001FFC1004100410040FFC +C635:000000000FF81004100410040FF8008000807FFF0000100410041FFC10040FFC +C636:000000000FF81004100410040FF8008000807FFF0000111011101F1011280FC6 +C637:000000000FF81004100410040FF8008000807FFF00000080008001400630180C +C638:000000000FF81004100410040FF8008000807FFF00000410041004100A2831C6 +C639:000000000FF81004100410040FF8008000807FFF00000FF81004100410040FF8 +C63A:000000000FF81004100410040FF8008000807FFF00001FFC008001400630180C +C63B:000000000FF81004100410040FF8008000807FFF000003E000001FFC02201C1C +C63C:000000000FF81004100410040FF8008000807FFF00001FFC00041FFC00040004 +C63D:000000000FF81004100410040FF8008000807FFF00001FFC10001FF810000FFC +C63E:000000000FF81004100410040FF8008000807FFF00001FFC0410041004101FFC +C63F:000000000FF81004100410040FF8008000807FFF000003E000001FFC080807F0 +C640:0000000000040E04110420842084208711040E040404040404047FF400040004 +C641:000000001F042084208420871F04040404047FF400001FFC0004000400040004 +C642:000000001F042084208420871F04040404047FF400001F7C0104010401040104 +C643:000000001F042084208420871F04040404047FF400001F1001100110012801C6 +C644:000000001F042084208420871F04040404047FF4000410041000100010000FFC +C645:000000001F042084208420871F04040404047FF40000107C1010101010280FC6 +C646:000000001F042084208420871F04040404047FF400001038100010FE10440F38 +C647:000000001F042084208420871F04040404047FF400001FFC1000100010000FFC +C648:000000001F042084208420871F04040404047FF400001FFC00041FF810000FFC +C649:000000001F042084208420871F04040404047FF400001F7C01041E0410040F04 +C64A:000000001F042084208420871F04040404047FF400001F7C01441E4410440F3C +C64B:000000001F042084208420871F04040404047FF400001F4401441E7C10440F3C +C64C:000000001F042084208420871F04040404047FF400001F1001101E1010280FC6 +C64D:000000001F042084208420871F04040404047FF400001F7C01401E7C10400F3C +C64E:000000001F042084208420871F04040404047FF400001F7E01241E2410240F7E +C64F:000000001F042084208420871F04040404047FF400001F3801001EFE10440F38 +C650:000000001F042084208420871F04040404047FF400001FFC1004100410040FFC +C651:000000001F042084208420871F04040404047FF40000100410041FFC10040FFC +C652:000000001F042084208420871F04040404047FF40000111011101F1011280FC6 +C653:000000001F042084208420871F04040404047FF400000080008001400630180C +C654:000000001F042084208420871F04040404047FF400000410041004100A2831C6 +C655:000000001F042084208420871F04040404047FF400000FF81004100410040FF8 +C656:000000001F042084208420871F04040404047FF400001FFC008001400630180C +C657:000000001F042084208420871F04040404047FF4000003E000001FFC02201C1C +C658:000000001F042084208420871F04040404047FF400001FFC00041FFC00040004 +C659:000000001F042084208420871F04040404047FF400001FFC10001FF810000FFC +C65A:000000001F042084208420871F04040404047FF400001FFC0410041004101FFC +C65B:000000001F042084208420871F04040404047FF4000003E000001FFC080807F0 +C65C:0000000000120E12111220922092209E11120E120412041204127FD200120012 +C65D:000000001F1220922092209E1F12041204127FD200000FFE0002000200020002 +C65E:000000001F1220922092209E1F12041204127FD200000FBE0082008200820082 +C65F:000000001F1220922092209E1F12041204127FD200000F8800880088009400E3 +C660:000000001F1220922092209E1F12041204127FD20012081208000800080007FE +C661:000000001F1220922092209E1F12041204127FD20000083E08080808081407E3 +C662:000000001F1220922092209E1F12041204127FD20000081C0800087F0822079C +C663:000000001F1220922092209E1F12041204127FD200000FFE08000800080007FE +C664:000000001F1220922092209E1F12041204127FD200000FFE00020FFC080007FE +C665:000000001F1220922092209E1F12041204127FD200000FBE00820F0208020782 +C666:000000001F1220922092209E1F12041204127FD200000FBE00A20F220822079E +C667:000000001F1220922092209E1F12041204127FD200000FA200A20F3E0822079E +C668:000000001F1220922092209E1F12041204127FD200000F8800880F08081407E3 +C669:000000001F1220922092209E1F12041204127FD200000FBE00A00F3E0820079E +C66A:000000001F1220922092209E1F12041204127FD200000FBF00920F12081207BF +C66B:000000001F1220922092209E1F12041204127FD200000F9C00800F7F0822079C +C66C:000000001F1220922092209E1F12041204127FD200000FFE08020802080207FE +C66D:000000001F1220922092209E1F12041204127FD20000080208020FFE080207FE +C66E:000000001F1220922092209E1F12041204127FD20000088808880F88089407E3 +C66F:000000001F1220922092209E1F12041204127FD200000040004000A003180C06 +C670:000000001F1220922092209E1F12041204127FD20000020802080208051418E3 +C671:000000001F1220922092209E1F12041204127FD2000007FC08020802080207FC +C672:000000001F1220922092209E1F12041204127FD200000FFE004000A003180C06 +C673:000000001F1220922092209E1F12041204127FD2000001F000000FFE01100E0E +C674:000000001F1220922092209E1F12041204127FD200000FFE00020FFE00020002 +C675:000000001F1220922092209E1F12041204127FD200000FFE08000FFC080007FE +C676:000000001F1220922092209E1F12041204127FD200000FFE0208020802080FFE +C677:000000001F1220922092209E1F12041204127FD2000001F000000FFE040403F8 +C678:0000000000040E04110420842084208411040E040404040404047FF400040004 +C679:000000001F042084208420841F04040404047FF400001FFC0004000400040004 +C67A:000000001F042084208420841F04040404047FF400001F7C0104010401040104 +C67B:000000001F042084208420841F04040404047FF400001F1001100110012801C6 +C67C:000000001F042084208420841F04040404047FF4000410041000100010000FFC +C67D:000000001F042084208420841F04040404047FF40000107C1010101010280FC6 +C67E:000000001F042084208420841F04040404047FF400001038100010FE10440F38 +C67F:000000001F042084208420841F04040404047FF400001FFC1000100010000FFC +C680:000000001F042084208420841F04040404047FF400001FFC00041FF810000FFC +C681:000000001F042084208420841F04040404047FF400001F7C01041E0410040F04 +C682:000000001F042084208420841F04040404047FF400001F7C01441E4410440F3C +C683:000000001F042084208420841F04040404047FF400001F4401441E7C10440F3C +C684:000000001F042084208420841F04040404047FF400001F1001101E1010280FC6 +C685:000000001F042084208420841F04040404047FF400001F7C01401E7C10400F3C +C686:000000001F042084208420841F04040404047FF400001F7E01241E2410240F7E +C687:000000001F042084208420841F04040404047FF400001F3801001EFE10440F38 +C688:000000001F042084208420841F04040404047FF400001FFC1004100410040FFC +C689:000000001F042084208420841F04040404047FF40000100410041FFC10040FFC +C68A:000000001F042084208420841F04040404047FF40000111011101F1011280FC6 +C68B:000000001F042084208420841F04040404047FF400000080008001400630180C +C68C:000000001F042084208420841F04040404047FF400000410041004100A2831C6 +C68D:000000001F042084208420841F04040404047FF400000FF81004100410040FF8 +C68E:000000001F042084208420841F04040404047FF400001FFC008001400630180C +C68F:000000001F042084208420841F04040404047FF4000003E000001FFC02201C1C +C690:000000001F042084208420841F04040404047FF400001FFC00041FFC00040004 +C691:000000001F042084208420841F04040404047FF400001FFC10001FF810000FFC +C692:000000001F042084208420841F04040404047FF400001FFC0410041004101FFC +C693:000000001F042084208420841F04040404047FF4000003E000001FFC080807F0 +C694:00000000000007F00808100410041004080807F00220022002207FFF00000000 +C695:000000000FF81004100410040FF8022002207FFF00001FFC0004000400040004 +C696:000000000FF81004100410040FF8022002207FFF00001F7C0104010401040104 +C697:000000000FF81004100410040FF8022002207FFF00001F1001100110012801C6 +C698:000000000FF81004100410040FF8022002207FFF000010001000100010000FFC +C699:000000000FF81004100410040FF8022002207FFF0000107C1010101010280FC6 +C69A:000000000FF81004100410040FF8022002207FFF00001038100010FE10440F38 +C69B:000000000FF81004100410040FF8022002207FFF00001FFC1000100010000FFC +C69C:000000000FF81004100410040FF8022002207FFF00001FFC00041FF810000FFC +C69D:000000000FF81004100410040FF8022002207FFF00001F7C01041E0410040F04 +C69E:000000000FF81004100410040FF8022002207FFF00001F7C01441E4410440F3C +C69F:000000000FF81004100410040FF8022002207FFF00001F4401441E7C10440F3C +C6A0:000000000FF81004100410040FF8022002207FFF00001F1001101E1010280FC6 +C6A1:000000000FF81004100410040FF8022002207FFF00001F7C01401E7C10400F3C +C6A2:000000000FF81004100410040FF8022002207FFF00001F7E01241E2410240F7E +C6A3:000000000FF81004100410040FF8022002207FFF00001F3801001EFE10440F38 +C6A4:000000000FF81004100410040FF8022002207FFF00001FFC1004100410040FFC +C6A5:000000000FF81004100410040FF8022002207FFF0000100410041FFC10040FFC +C6A6:000000000FF81004100410040FF8022002207FFF0000111011101F1011280FC6 +C6A7:000000000FF81004100410040FF8022002207FFF00000080008001400630180C +C6A8:000000000FF81004100410040FF8022002207FFF00000410041004100A2831C6 +C6A9:000000000FF81004100410040FF8022002207FFF00000FF81004100410040FF8 +C6AA:000000000FF81004100410040FF8022002207FFF00001FFC008001400630180C +C6AB:000000000FF81004100410040FF8022002207FFF000003E000001FFC02201C1C +C6AC:000000000FF81004100410040FF8022002207FFF00001FFC00041FFC00040004 +C6AD:000000000FF81004100410040FF8022002207FFF00001FFC10001FF810000FFC +C6AE:000000000FF81004100410040FF8022002207FFF00001FFC0410041004101FFC +C6AF:000000000FF81004100410040FF8022002207FFF000003E000001FFC080807F0 +C6B0:000000000FF81004100410040FF8000000007FFF008000800080008000800080 +C6B1:000000000FF81004100410040FF800007FFF008000801FFC0004000400040004 +C6B2:000000000FF81004100410040FF800007FFF008000801F7C0104010401040104 +C6B3:000000000FF81004100410040FF800007FFF008000801F1001100110012801C6 +C6B4:000000000FF81004100410040FF8000000007FFF008010801080100010000FFC +C6B5:000000000FF81004100410040FF800007FFF00800080107C1010101010280FC6 +C6B6:000000000FF81004100410040FF800007FFF008000801038100010FE10440F38 +C6B7:000000000FF81004100410040FF800007FFF008000801FFC1000100010000FFC +C6B8:000000000FF81004100410040FF800007FFF008000801FFC00041FF810000FFC +C6B9:000000000FF81004100410040FF800007FFF008000801F7C01041E0410040F04 +C6BA:000000000FF81004100410040FF800007FFF008000801F7C01441E4410440F3C +C6BB:000000000FF81004100410040FF800007FFF008000801F4401441E7C10440F3C +C6BC:000000000FF81004100410040FF800007FFF008000801F1001101E1010280FC6 +C6BD:000000000FF81004100410040FF800007FFF008000801F7C01401E7C10400F3C +C6BE:000000000FF81004100410040FF800007FFF008000801F7E01241E2410240F7E +C6BF:000000000FF81004100410040FF800007FFF008000801F3801001EFE10440F38 +C6C0:000000000FF81004100410040FF800007FFF008000801FFC1004100410040FFC +C6C1:000000000FF81004100410040FF800007FFF00800080100410041FFC10040FFC +C6C2:000000000FF81004100410040FF800007FFF00800080111011101F1011280FC6 +C6C3:000000000FF81004100410040FF800007FFF008000800080008001400630180C +C6C4:000000000FF81004100410040FF800007FFF008000800410041004100A2831C6 +C6C5:000000000FF81004100410040FF800007FFF008000800FF81004100410040FF8 +C6C6:000000000FF81004100410040FF800007FFF008000801FFC008001400630180C +C6C7:000000000FF81004100410040FF800007FFF0080008003E000001FFC02201C1C +C6C8:000000000FF81004100410040FF800007FFF008000801FFC00041FFC00040004 +C6C9:000000000FF81004100410040FF800007FFF008000801FFC10001FF810000FFC +C6CA:000000000FF81004100410040FF800007FFF008000801FFC0410041004101FFC +C6CB:000000000FF81004100410040FF800007FFF0080008003E000001FFC080807F0 +C6CC:000000001F042084208420841F04000400047FF404040404043C040404040404 +C6CD:000000001F0420842084209C1F0400047FF4040404001FFC0004000400040004 +C6CE:000000001F0420842084209C1F0400047FF4040404001F7C0104010401040104 +C6CF:000000001F0420842084209C1F0400047FF4040404001F1001100110012801C6 +C6D0:000000001F042084208420841F0400047FF40404043C14041000100010000FFC +C6D1:000000001F0420842084209C1F0400047FF404040400107C1010101010280FC6 +C6D2:000000001F0420842084209C1F0400047FF4040404001038100010FE10440F38 +C6D3:000000001F0420842084209C1F0400047FF4040404001FFC1000100010000FFC +C6D4:000000001F0420842084209C1F0400047FF4040404001FFC00041FF810000FFC +C6D5:000000001F0420842084209C1F0400047FF4040404001F7C01041E0410040F04 +C6D6:000000001F0420842084209C1F0400047FF4040404001F7C01441E4410440F3C +C6D7:000000001F0420842084209C1F0400047FF4040404001F4401441E7C10440F3C +C6D8:000000001F0420842084209C1F0400047FF4040404001F1001101E1010280FC6 +C6D9:000000001F0420842084209C1F0400047FF4040404001F7C01401E7C10400F3C +C6DA:000000001F0420842084209C1F0400047FF4040404001F7E01241E2410240F7E +C6DB:000000001F0420842084209C1F0400047FF4040404001F3801001EFE10440F38 +C6DC:000000001F0420842084209C1F0400047FF4040404001FFC1004100410040FFC +C6DD:000000001F0420842084209C1F0400047FF404040400100410041FFC10040FFC +C6DE:000000001F0420842084209C1F0400047FF404040400111011101F1011280FC6 +C6DF:000000001F0420842084209C1F0400047FF4040404000080008001400630180C +C6E0:000000001F0420842084209C1F0400047FF4040404000410041004100A2831C6 +C6E1:000000001F0420842084209C1F0400047FF4040404000FF81004100410040FF8 +C6E2:000000001F0420842084209C1F0400047FF4040404001FFC008001400630180C +C6E3:000000001F0420842084209C1F0400047FF40404040003E000001FFC02201C1C +C6E4:000000001F0420842084209C1F0400047FF4040404001FFC00041FFC00040004 +C6E5:000000001F0420842084209C1F0400047FF4040404001FFC10001FF810000FFC +C6E6:000000001F0420842084209C1F0400047FF4040404001FFC0410041004101FFC +C6E7:000000001F0420842084209C1F0400047FF40404040003E000001FFC080807F0 +C6E8:000000001F122092209220921F12001200127FD20412041204F2041204120412 +C6E9:000000001F122092209220F21F1200127FD2041204000FFE0002000200020002 +C6EA:000000001F122092209220F21F1200127FD2041204000FBE0082008200820082 +C6EB:000000001F122092209220F21F1200127FD2041204000F8800880088009400E3 +C6EC:000000001F122092209220921F1200127FD2021202F20A1208000800080007FE +C6ED:000000001F122092209220F21F1200127FD204120400083E08080808081407E3 +C6EE:000000001F122092209220F21F1200127FD204120400081C0800087F0822079C +C6EF:000000001F122092209220F21F1200127FD2041204000FFE08000800080007FE +C6F0:000000001F122092209220F21F1200127FD2041204000FFE00020FFC080007FE +C6F1:000000001F122092209220F21F1200127FD2041204000FBE00820F0208020782 +C6F2:000000001F122092209220F21F1200127FD2041204000FBE00A20F220822079E +C6F3:000000001F122092209220F21F1200127FD2041204000FA200A20F3E0822079E +C6F4:000000001F122092209220F21F1200127FD2041204000F8800880F08081407E3 +C6F5:000000001F122092209220F21F1200127FD2041204000FBE00A00F3E0820079E +C6F6:000000001F122092209220F21F1200127FD2041204000FBF00920F12081207BF +C6F7:000000001F122092209220F21F1200127FD2041204000F9C00800F7F0822079C +C6F8:000000001F122092209220F21F1200127FD2041204000FFE08020802080207FE +C6F9:000000001F122092209220F21F1200127FD204120400080208020FFE080207FE +C6FA:000000001F122092209220F21F1200127FD204120400088808880F88089407E3 +C6FB:000000001F122092209220F21F1200127FD2041204000040004000A003180C06 +C6FC:000000001F122092209220F21F1200127FD204120400020802080208051418E3 +C6FD:000000001F122092209220F21F1200127FD20412040007FC08020802080207FC +C6FE:000000001F122092209220F21F1200127FD2041204000FFE004000A003180C06 +C6FF:000000001F122092209220F21F1200127FD20412040001F000000FFE01100E0E +C700:000000001F122092209220F21F1200127FD2041204000FFE00020FFE00020002 +C701:000000001F122092209220F21F1200127FD2041204000FFE08000FFC080007FE +C702:000000001F122092209220F21F1200127FD2041204000FFE0208020802080FFE +C703:000000001F122092209220F21F1200127FD20412040001F000000FFE040403F8 +C704:000000001F042084208420841F04000400047FF4040404040404040404040404 +C705:000000001F042084208420841F0400047FF4040404001FFC0004000400040004 +C706:000000001F042084208420841F0400047FF4040404001F7C0104010401040104 +C707:000000001F042084208420841F0400047FF4040404001F1001100110012801C6 +C708:000000001F042084208420841F0400047FF40404040414041000100010000FFC +C709:000000001F042084208420841F0400047FF404040400107C1010101010280FC6 +C70A:000000001F042084208420841F0400047FF4040404001038100010FE10440F38 +C70B:000000001F042084208420841F0400047FF4040404001FFC1000100010000FFC +C70C:000000001F042084208420841F0400047FF4040404001FFC00041FF810000FFC +C70D:000000001F042084208420841F0400047FF4040404001F7C01041E0410040F04 +C70E:000000001F042084208420841F0400047FF4040404001F7C01441E4410440F3C +C70F:000000001F042084208420841F0400047FF4040404001F4401441E7C10440F3C +C710:000000001F042084208420841F0400047FF4040404001F1001101E1010280FC6 +C711:000000001F042084208420841F0400047FF4040404001F7C01401E7C10400F3C +C712:000000001F042084208420841F0400047FF4040404001F7E01241E2410240F7E +C713:000000001F042084208420841F0400047FF4040404001F3801001EFE10440F38 +C714:000000001F042084208420841F0400047FF4040404001FFC1004100410040FFC +C715:000000001F042084208420841F0400047FF404040400100410041FFC10040FFC +C716:000000001F042084208420841F0400047FF404040400111011101F1011280FC6 +C717:000000001F042084208420841F0400047FF4040404000080008001400630180C +C718:000000001F042084208420841F0400047FF4040404000410041004100A2831C6 +C719:000000001F042084208420841F0400047FF4040404000FF81004100410040FF8 +C71A:000000001F042084208420841F0400047FF4040404001FFC008001400630180C +C71B:000000001F042084208420841F0400047FF40404040003E000001FFC02201C1C +C71C:000000001F042084208420841F0400047FF4040404001FFC00041FFC00040004 +C71D:000000001F042084208420841F0400047FF4040404001FFC10001FF810000FFC +C71E:000000001F042084208420841F0400047FF4040404001FFC0410041004101FFC +C71F:000000001F042084208420841F0400047FF40404040003E000001FFC080807F0 +C720:000000000FF81004100410040FF8000000007FFF041004100410041004100410 +C721:000000000FF81004100410040FF800007FFF022002201FFC0004000400040004 +C722:000000000FF81004100410040FF800007FFF022002201F7C0104010401040104 +C723:000000000FF81004100410040FF800007FFF022002201F1001100110012801C6 +C724:000000000FF81004100410040FF8000000007FFF022012201220100010000FFC +C725:000000000FF81004100410040FF800007FFF02200220107C1010101010280FC6 +C726:000000000FF81004100410040FF800007FFF022002201038100010FE10440F38 +C727:000000000FF81004100410040FF800007FFF022002201FFC1000100010000FFC +C728:000000000FF81004100410040FF800007FFF022002201FFC00041FF810000FFC +C729:000000000FF81004100410040FF800007FFF022002201F7C01041E0410040F04 +C72A:000000000FF81004100410040FF800007FFF022002201F7C01441E4410440F3C +C72B:000000000FF81004100410040FF800007FFF022002201F4401441E7C10440F3C +C72C:000000000FF81004100410040FF800007FFF022002201F1001101E1010280FC6 +C72D:000000000FF81004100410040FF800007FFF022002201F7C01401E7C10400F3C +C72E:000000000FF81004100410040FF800007FFF022002201F7E01241E2410240F7E +C72F:000000000FF81004100410040FF800007FFF022002201F3801001EFE10440F38 +C730:000000000FF81004100410040FF800007FFF022002201FFC1004100410040FFC +C731:000000000FF81004100410040FF800007FFF02200220100410041FFC10040FFC +C732:000000000FF81004100410040FF800007FFF02200220111011101F1011280FC6 +C733:000000000FF81004100410040FF800007FFF022002200080008001400630180C +C734:000000000FF81004100410040FF800007FFF022002200410041004100A2831C6 +C735:000000000FF81004100410040FF800007FFF022002200FF81004100410040FF8 +C736:000000000FF81004100410040FF800007FFF022002201FFC008001400630180C +C737:000000000FF81004100410040FF800007FFF0220022003E000001FFC02201C1C +C738:000000000FF81004100410040FF800007FFF022002201FFC00041FFC00040004 +C739:000000000FF81004100410040FF800007FFF022002201FFC10001FF810000FFC +C73A:000000000FF81004100410040FF800007FFF022002201FFC0410041004101FFC +C73B:000000000FF81004100410040FF800007FFF0220022003E000001FFC080807F0 +C73C:00000000000007F00808100410041004080807F00000000000007FFF00000000 +C73D:000000000FF81004100410040FF800007FFF000000001FFC0004000400040004 +C73E:000000000FF81004100410040FF800007FFF000000001F7C0104010401040104 +C73F:000000000FF81004100410040FF800007FFF000000001F1001100110012801C6 +C740:000000000FF81004100410040FF8000000007FFF000010001000100010000FFC +C741:000000000FF81004100410040FF800007FFF00000000107C1010101010280FC6 +C742:000000000FF81004100410040FF800007FFF000000001038100010FE10440F38 +C743:000000000FF81004100410040FF800007FFF000000001FFC1000100010000FFC +C744:000000000FF81004100410040FF800007FFF000000001FFC00041FF810000FFC +C745:000000000FF81004100410040FF800007FFF000000001F7C01041E0410040F04 +C746:000000000FF81004100410040FF800007FFF000000001F7C01441E4410440F3C +C747:000000000FF81004100410040FF800007FFF000000001F4401441E7C10440F3C +C748:000000000FF81004100410040FF800007FFF000000001F1001101E1010280FC6 +C749:000000000FF81004100410040FF800007FFF000000001F7C01401E7C10400F3C +C74A:000000000FF81004100410040FF800007FFF000000001F7E01241E2410240F7E +C74B:000000000FF81004100410040FF800007FFF000000001F3801001EFE10440F38 +C74C:000000000FF81004100410040FF800007FFF000000001FFC1004100410040FFC +C74D:000000000FF81004100410040FF800007FFF00000000100410041FFC10040FFC +C74E:000000000FF81004100410040FF800007FFF00000000111011101F1011280FC6 +C74F:000000000FF81004100410040FF800007FFF000000000080008001400630180C +C750:000000000FF81004100410040FF800007FFF000000000410041004100A2831C6 +C751:000000000FF81004100410040FF800007FFF000000000FF81004100410040FF8 +C752:000000000FF81004100410040FF800007FFF000000001FFC008001400630180C +C753:000000000FF81004100410040FF800007FFF0000000003E000001FFC02201C1C +C754:000000000FF81004100410040FF800007FFF000000001FFC00041FFC00040004 +C755:000000000FF81004100410040FF800007FFF000000001FFC10001FF810000FFC +C756:000000000FF81004100410040FF800007FFF000000001FFC0410041004101FFC +C757:000000000FF81004100410040FF800007FFF0000000003E000001FFC080807F0 +C758:0000000000040E04110420842084208411040E040004000400047FF400040004 +C759:000000001F042084208420841F0400047FF4000400001FFC0004000400040004 +C75A:000000001F042084208420841F0400047FF4000400001F7C0104010401040104 +C75B:000000001F042084208420841F0400047FF4000400001F1001100110012801C6 +C75C:000000001F042084208420841F04000400047FF4000410041000100010000FFC +C75D:000000001F042084208420841F0400047FF400040000107C1010101010280FC6 +C75E:000000001F042084208420841F0400047FF4000400001038100010FE10440F38 +C75F:000000001F042084208420841F0400047FF4000400001FFC1000100010000FFC +C760:000000001F042084208420841F0400047FF4000400001FFC00041FF810000FFC +C761:000000001F042084208420841F0400047FF4000400001F7C01041E0410040F04 +C762:000000001F042084208420841F0400047FF4000400001F7C01441E4410440F3C +C763:000000001F042084208420841F0400047FF4000400001F4401441E7C10440F3C +C764:000000001F042084208420841F0400047FF4000400001F1001101E1010280FC6 +C765:000000001F042084208420841F0400047FF4000400001F7C01401E7C10400F3C +C766:000000001F042084208420841F0400047FF4000400001F7E01241E2410240F7E +C767:000000001F042084208420841F0400047FF4000400001F3801001EFE10440F38 +C768:000000001F042084208420841F0400047FF4000400001FFC1004100410040FFC +C769:000000001F042084208420841F0400047FF400040000100410041FFC10040FFC +C76A:000000001F042084208420841F0400047FF400040000111011101F1011280FC6 +C76B:000000001F042084208420841F0400047FF4000400000080008001400630180C +C76C:000000001F042084208420841F0400047FF4000400000410041004100A2831C6 +C76D:000000001F042084208420841F0400047FF4000400000FF81004100410040FF8 +C76E:000000001F042084208420841F0400047FF4000400001FFC008001400630180C +C76F:000000001F042084208420841F0400047FF40004000003E000001FFC02201C1C +C770:000000001F042084208420841F0400047FF4000400001FFC00041FFC00040004 +C771:000000001F042084208420841F0400047FF4000400001FFC10001FF810000FFC +C772:000000001F042084208420841F0400047FF4000400001FFC0410041004101FFC +C773:000000001F042084208420841F0400047FF40004000003E000001FFC080807F0 +C774:0000000000040E04110420842084208420842084208411040E04000400040004 +C775:000000000E04110420842084208411040E04000400001FFC0004000400040004 +C776:000000000E04110420842084208411040E04000400001F7C0104010401040104 +C777:000000000E04110420842084208411040E04000400001F1001100110012801C6 +C778:000000000E04110420842084208411040E040004000410041000100010000FFC +C779:000000000E04110420842084208411040E0400040000107C1010101010280FC6 +C77A:000000000E04110420842084208411040E04000400001038100010FE10440F38 +C77B:000000000E04110420842084208411040E04000400001FFC1000100010000FFC +C77C:000000000E04110420842084208411040E04000400001FFC00041FF810000FFC +C77D:000000000E04110420842084208411040E04000400001F7C01041E0410040F04 +C77E:000000000E04110420842084208411040E04000400001F7C01441E4410440F3C +C77F:000000000E04110420842084208411040E04000400001F4401441E7C10440F3C +C780:000000000E04110420842084208411040E04000400001F1001101E1010280FC6 +C781:000000000E04110420842084208411040E04000400001F7C01401E7C10400F3C +C782:000000000E04110420842084208411040E04000400001F7E01241E2410240F7E +C783:000000000E04110420842084208411040E04000400001F3801001EFE10440F38 +C784:000000000E04110420842084208411040E04000400001FFC1004100410040FFC +C785:000000000E04110420842084208411040E0400040000100410041FFC10040FFC +C786:000000000E04110420842084208411040E0400040000111011101F1011280FC6 +C787:000000000E04110420842084208411040E04000400000080008001400630180C +C788:000000000E04110420842084208411040E04000400000410041004100A2831C6 +C789:000000000E04110420842084208411040E04000400000FF81004100410040FF8 +C78A:000000000E04110420842084208411040E04000400001FFC008001400630180C +C78B:000000000E04110420842084208411040E040004000003E000001FFC02201C1C +C78C:000000000E04110420842084208411040E04000400001FFC00041FFC00040004 +C78D:000000000E04110420842084208411040E04000400001FFC10001FF810000FFC +C78E:000000000E04110420842084208411040E04000400001FFC0410041004101FFC +C78F:000000000E04110420842084208411040E040004000003E000001FFC080807F0 +C790:0000000000043F840404040404040A070A040A04110411042084000400040004 +C791:000000003F84040404040A070A0411042084000400001FFC0004000400040004 +C792:000000003F84040404040A070A0411042084000400001F7C0104010401040104 +C793:000000003F84040404040A070A0411042084000400001F1001100110012801C6 +C794:000000003F84040404040A070A04110420840004000410041000100010000FFC +C795:000000003F84040404040A070A041104208400040000107C1010101010280FC6 +C796:000000003F84040404040A070A0411042084000400001038100010FE10440F38 +C797:000000003F84040404040A070A0411042084000400001FFC1000100010000FFC +C798:000000003F84040404040A070A0411042084000400001FFC00041FF810000FFC +C799:000000003F84040404040A070A0411042084000400001F7C01041E0410040F04 +C79A:000000003F84040404040A070A0411042084000400001F7C01441E4410440F3C +C79B:000000003F84040404040A070A0411042084000400001F4401441E7C10440F3C +C79C:000000003F84040404040A070A0411042084000400001F1001101E1010280FC6 +C79D:000000003F84040404040A070A0411042084000400001F7C01401E7C10400F3C +C79E:000000003F84040404040A070A0411042084000400001F7E01241E2410240F7E +C79F:000000003F84040404040A070A0411042084000400001F3801001EFE10440F38 +C7A0:000000003F84040404040A070A0411042084000400001FFC1004100410040FFC +C7A1:000000003F84040404040A070A041104208400040000100410041FFC10040FFC +C7A2:000000003F84040404040A070A041104208400040000111011101F1011280FC6 +C7A3:000000003F84040404040A070A0411042084000400000080008001400630180C +C7A4:000000003F84040404040A070A0411042084000400000410041004100A2831C6 +C7A5:000000003F84040404040A070A0411042084000400000FF81004100410040FF8 +C7A6:000000003F84040404040A070A0411042084000400001FFC008001400630180C +C7A7:000000003F84040404040A070A04110420840004000003E000001FFC02201C1C +C7A8:000000003F84040404040A070A0411042084000400001FFC00041FFC00040004 +C7A9:000000003F84040404040A070A0411042084000400001FFC10001FF810000FFC +C7AA:000000003F84040404040A070A0411042084000400001FFC0410041004101FFC +C7AB:000000003F84040404040A070A04110420840004000003E000001FFC080807F0 +C7AC:0000000000123F920412041204120A1E0A120A12111211122092001200120012 +C7AD:000000003F92041204120A1E0A1211122092001200000FFE0002000200020002 +C7AE:000000003F92041204120A1E0A1211122092001200000FBE0082008200820082 +C7AF:000000003F92041204120A1E0A1211122092001200000F8800880088009400E3 +C7B0:000000003F92041204120A1E0A121112209200120012081208000800080007FE +C7B1:000000003F92041204120A1E0A121112209200120000083E08080808081407E3 +C7B2:000000003F92041204120A1E0A121112209200120000081C0800087F0822079C +C7B3:000000003F92041204120A1E0A1211122092001200000FFE08000800080007FE +C7B4:000000003F92041204120A1E0A1211122092001200000FFE00020FFC080007FE +C7B5:000000003F92041204120A1E0A1211122092001200000FBE00820F0208020782 +C7B6:000000003F92041204120A1E0A1211122092001200000FBE00A20F220822079E +C7B7:000000003F92041204120A1E0A1211122092001200000FA200A20F3E0822079E +C7B8:000000003F92041204120A1E0A1211122092001200000F8800880F08081407E3 +C7B9:000000003F92041204120A1E0A1211122092001200000FBE00A00F3E0820079E +C7BA:000000003F92041204120A1E0A1211122092001200000FBF00920F12081207BF +C7BB:000000003F92041204120A1E0A1211122092001200000F9C00800F7F0822079C +C7BC:000000003F92041204120A1E0A1211122092001200000FFE08020802080207FE +C7BD:000000003F92041204120A1E0A121112209200120000080208020FFE080207FE +C7BE:000000003F92041204120A1E0A121112209200120000088808880F88089407E3 +C7BF:000000003F92041204120A1E0A1211122092001200000040004000A003180C06 +C7C0:000000003F92041204120A1E0A121112209200120000020802080208051418E3 +C7C1:000000003F92041204120A1E0A12111220920012000007FC08020802080207FC +C7C2:000000003F92041204120A1E0A1211122092001200000FFE004000A003180C06 +C7C3:000000003F92041204120A1E0A12111220920012000001F000000FFE01100E0E +C7C4:000000003F92041204120A1E0A1211122092001200000FFE00020FFE00020002 +C7C5:000000003F92041204120A1E0A1211122092001200000FFE08000FFC080007FE +C7C6:000000003F92041204120A1E0A1211122092001200000FFE0208020802080FFE +C7C7:000000003F92041204120A1E0A12111220920012000001F000000FFE040403F8 +C7C8:0000000000043F840404040404070A040A040A07110411042084000400040004 +C7C9:000000003F84040404070A040A0411072084000400001FFC0004000400040004 +C7CA:000000003F84040404070A040A0411072084000400001F7C0104010401040104 +C7CB:000000003F84040404070A040A0411072084000400001F1001100110012801C6 +C7CC:000000003F84040404070A040A04110720840004000410041000100010000FFC +C7CD:000000003F84040404070A040A041107208400040000107C1010101010280FC6 +C7CE:000000003F84040404070A040A0411072084000400001038100010FE10440F38 +C7CF:000000003F84040404070A040A0411072084000400001FFC1000100010000FFC +C7D0:000000003F84040404070A040A0411072084000400001FFC00041FF810000FFC +C7D1:000000003F84040404070A040A0411072084000400001F7C01041E0410040F04 +C7D2:000000003F84040404070A040A0411072084000400001F7C01441E4410440F3C +C7D3:000000003F84040404070A040A0411072084000400001F4401441E7C10440F3C +C7D4:000000003F84040404070A040A0411072084000400001F1001101E1010280FC6 +C7D5:000000003F84040404070A040A0411072084000400001F7C01401E7C10400F3C +C7D6:000000003F84040404070A040A0411072084000400001F7E01241E2410240F7E +C7D7:000000003F84040404070A040A0411072084000400001F3801001EFE10440F38 +C7D8:000000003F84040404070A040A0411072084000400001FFC1004100410040FFC +C7D9:000000003F84040404070A040A041107208400040000100410041FFC10040FFC +C7DA:000000003F84040404070A040A041107208400040000111011101F1011280FC6 +C7DB:000000003F84040404070A040A0411072084000400000080008001400630180C +C7DC:000000003F84040404070A040A0411072084000400000410041004100A2831C6 +C7DD:000000003F84040404070A040A0411072084000400000FF81004100410040FF8 +C7DE:000000003F84040404070A040A0411072084000400001FFC008001400630180C +C7DF:000000003F84040404070A040A04110720840004000003E000001FFC02201C1C +C7E0:000000003F84040404070A040A0411072084000400001FFC00041FFC00040004 +C7E1:000000003F84040404070A040A0411072084000400001FFC10001FF810000FFC +C7E2:000000003F84040404070A040A0411072084000400001FFC0410041004101FFC +C7E3:000000003F84040404070A040A04110720840004000003E000001FFC080807F0 +C7E4:0000000000123F9204120412041E0A120A120A1E111211122092001200120012 +C7E5:000000003F920412041E0A120A12111E2092001200000FFE0002000200020002 +C7E6:000000003F920412041E0A120A12111E2092001200000FBE0082008200820082 +C7E7:000000003F920412041E0A120A12111E2092001200000F8800880088009400E3 +C7E8:000000003F920412041E0A120A12111E209200120012081208000800080007FE +C7E9:000000003F920412041E0A120A12111E209200120000083E08080808081407E3 +C7EA:000000003F920412041E0A120A12111E209200120000081C0800087F0822079C +C7EB:000000003F920412041E0A120A12111E2092001200000FFE08000800080007FE +C7EC:000000003F920412041E0A120A12111E2092001200000FFE00020FFC080007FE +C7ED:000000003F920412041E0A120A12111E2092001200000FBE00820F0208020782 +C7EE:000000003F920412041E0A120A12111E2092001200000FBE00A20F220822079E +C7EF:000000003F920412041E0A120A12111E2092001200000FA200A20F3E0822079E +C7F0:000000003F920412041E0A120A12111E2092001200000F8800880F08081407E3 +C7F1:000000003F920412041E0A120A12111E2092001200000FBE00A00F3E0820079E +C7F2:000000003F920412041E0A120A12111E2092001200000FBF00920F12081207BF +C7F3:000000003F920412041E0A120A12111E2092001200000F9C00800F7F0822079C +C7F4:000000003F920412041E0A120A12111E2092001200000FFE08020802080207FE +C7F5:000000003F920412041E0A120A12111E209200120000080208020FFE080207FE +C7F6:000000003F920412041E0A120A12111E209200120000088808880F88089407E3 +C7F7:000000003F920412041E0A120A12111E2092001200000040004000A003180C06 +C7F8:000000003F920412041E0A120A12111E209200120000020802080208051418E3 +C7F9:000000003F920412041E0A120A12111E20920012000007FC08020802080207FC +C7FA:000000003F920412041E0A120A12111E2092001200000FFE004000A003180C06 +C7FB:000000003F920412041E0A120A12111E20920012000001F000000FFE01100E0E +C7FC:000000003F920412041E0A120A12111E2092001200000FFE00020FFE00020002 +C7FD:000000003F920412041E0A120A12111E2092001200000FFE08000FFC080007FE +C7FE:000000003F920412041E0A120A12111E2092001200000FFE0208020802080FFE +C7FF:000000003F920412041E0A120A12111E20920012000001F000000FFE040403F8 +C800:0000000000043F840404040404040A3C0A040A04110411042084000400040004 +C801:000000003F84040404040A3C0A0411042084000400001FFC0004000400040004 +C802:000000003F84040404040A3C0A0411042084000400001F7C0104010401040104 +C803:000000003F84040404040A3C0A0411042084000400001F1001100110012801C6 +C804:000000003F84040404040A3C0A04110420840004000410041000100010000FFC +C805:000000003F84040404040A3C0A041104208400040000107C1010101010280FC6 +C806:000000003F84040404040A3C0A0411042084000400001038100010FE10440F38 +C807:000000003F84040404040A3C0A0411042084000400001FFC1000100010000FFC +C808:000000003F84040404040A3C0A0411042084000400001FFC00041FF810000FFC +C809:000000003F84040404040A3C0A0411042084000400001F7C01041E0410040F04 +C80A:000000003F84040404040A3C0A0411042084000400001F7C01441E4410440F3C +C80B:000000003F84040404040A3C0A0411042084000400001F4401441E7C10440F3C +C80C:000000003F84040404040A3C0A0411042084000400001F1001101E1010280FC6 +C80D:000000003F84040404040A3C0A0411042084000400001F7C01401E7C10400F3C +C80E:000000003F84040404040A3C0A0411042084000400001F7E01241E2410240F7E +C80F:000000003F84040404040A3C0A0411042084000400001F3801001EFE10440F38 +C810:000000003F84040404040A3C0A0411042084000400001FFC1004100410040FFC +C811:000000003F84040404040A3C0A041104208400040000100410041FFC10040FFC +C812:000000003F84040404040A3C0A041104208400040000111011101F1011280FC6 +C813:000000003F84040404040A3C0A0411042084000400000080008001400630180C +C814:000000003F84040404040A3C0A0411042084000400000410041004100A2831C6 +C815:000000003F84040404040A3C0A0411042084000400000FF81004100410040FF8 +C816:000000003F84040404040A3C0A0411042084000400001FFC008001400630180C +C817:000000003F84040404040A3C0A04110420840004000003E000001FFC02201C1C +C818:000000003F84040404040A3C0A0411042084000400001FFC00041FFC00040004 +C819:000000003F84040404040A3C0A0411042084000400001FFC10001FF810000FFC +C81A:000000003F84040404040A3C0A0411042084000400001FFC0410041004101FFC +C81B:000000003F84040404040A3C0A04110420840004000003E000001FFC080807F0 +C81C:0000000000123F920412041204120A720A120A12111211122092001200120012 +C81D:000000003F92041204120A720A1211122092001200000FFE0002000200020002 +C81E:000000003F92041204120A720A1211122092001200000FBE0082008200820082 +C81F:000000003F92041204120A720A1211122092001200000F8800880088009400E3 +C820:000000003F92041204120A720A121112209200120012081208000800080007FE +C821:000000003F92041204120A720A121112209200120000083E08080808081407E3 +C822:000000003F92041204120A720A121112209200120000081C0800087F0822079C +C823:000000003F92041204120A720A1211122092001200000FFE08000800080007FE +C824:000000003F92041204120A720A1211122092001200000FFE00020FFC080007FE +C825:000000003F92041204120A720A1211122092001200000FBE00820F0208020782 +C826:000000003F92041204120A720A1211122092001200000FBE00A20F220822079E +C827:000000003F92041204120A720A1211122092001200000FA200A20F3E0822079E +C828:000000003F92041204120A720A1211122092001200000F8800880F08081407E3 +C829:000000003F92041204120A720A1211122092001200000FBE00A00F3E0820079E +C82A:000000003F92041204120A720A1211122092001200000FBF00920F12081207BF +C82B:000000003F92041204120A720A1211122092001200000F9C00800F7F0822079C +C82C:000000003F92041204120A720A1211122092001200000FFE08020802080207FE +C82D:000000003F92041204120A720A121112209200120000080208020FFE080207FE +C82E:000000003F92041204120A720A121112209200120000088808880F88089407E3 +C82F:000000003F92041204120A720A1211122092001200000040004000A003180C06 +C830:000000003F92041204120A720A121112209200120000020802080208051418E3 +C831:000000003F92041204120A720A12111220920012000007FC08020802080207FC +C832:000000003F92041204120A720A1211122092001200000FFE004000A003180C06 +C833:000000003F92041204120A720A12111220920012000001F000000FFE01100E0E +C834:000000003F92041204120A720A1211122092001200000FFE00020FFE00020002 +C835:000000003F92041204120A720A1211122092001200000FFE08000FFC080007FE +C836:000000003F92041204120A720A1211122092001200000FFE0208020802080FFE +C837:000000003F92041204120A720A12111220920012000001F000000FFE040403F8 +C838:0000000000043F8404040404043C0A040A040A3C110411042084000400040004 +C839:000000003F840404043C0A040A04113C2084000400001FFC0004000400040004 +C83A:000000003F840404043C0A040A04113C2084000400001F7C0104010401040104 +C83B:000000003F840404043C0A040A04113C2084000400001F1001100110012801C6 +C83C:000000003F840404043C0A040A04113C20840004000410041000100010000FFC +C83D:000000003F840404043C0A040A04113C208400040000107C1010101010280FC6 +C83E:000000003F840404043C0A040A04113C2084000400001038100010FE10440F38 +C83F:000000003F840404043C0A040A04113C2084000400001FFC1000100010000FFC +C840:000000003F840404043C0A040A04113C2084000400001FFC00041FF810000FFC +C841:000000003F840404043C0A040A04113C2084000400001F7C01041E0410040F04 +C842:000000003F840404043C0A040A04113C2084000400001F7C01441E4410440F3C +C843:000000003F840404043C0A040A04113C2084000400001F4401441E7C10440F3C +C844:000000003F840404043C0A040A04113C2084000400001F1001101E1010280FC6 +C845:000000003F840404043C0A040A04113C2084000400001F7C01401E7C10400F3C +C846:000000003F840404043C0A040A04113C2084000400001F7E01241E2410240F7E +C847:000000003F840404043C0A040A04113C2084000400001F3801001EFE10440F38 +C848:000000003F840404043C0A040A04113C2084000400001FFC1004100410040FFC +C849:000000003F840404043C0A040A04113C208400040000100410041FFC10040FFC +C84A:000000003F840404043C0A040A04113C208400040000111011101F1011280FC6 +C84B:000000003F840404043C0A040A04113C2084000400000080008001400630180C +C84C:000000003F840404043C0A040A04113C2084000400000410041004100A2831C6 +C84D:000000003F840404043C0A040A04113C2084000400000FF81004100410040FF8 +C84E:000000003F840404043C0A040A04113C2084000400001FFC008001400630180C +C84F:000000003F840404043C0A040A04113C20840004000003E000001FFC02201C1C +C850:000000003F840404043C0A040A04113C2084000400001FFC00041FFC00040004 +C851:000000003F840404043C0A040A04113C2084000400001FFC10001FF810000FFC +C852:000000003F840404043C0A040A04113C2084000400001FFC0410041004101FFC +C853:000000003F840404043C0A040A04113C20840004000003E000001FFC080807F0 +C854:0000000000123F920412041204720A120A120A72111211122092001200120012 +C855:000000003F92041204720A120A1211722092001200000FFE0002000200020002 +C856:000000003F92041204720A120A1211722092001200000FBE0082008200820082 +C857:000000003F92041204720A120A1211722092001200000F8800880088009400E3 +C858:000000003F92041204720A120A121172209200120012081208000800080007FE +C859:000000003F92041204720A120A121172209200120000083E08080808081407E3 +C85A:000000003F92041204720A120A121172209200120000081C0800087F0822079C +C85B:000000003F92041204720A120A1211722092001200000FFE08000800080007FE +C85C:000000003F92041204720A120A1211722092001200000FFE00020FFC080007FE +C85D:000000003F92041204720A120A1211722092001200000FBE00820F0208020782 +C85E:000000003F92041204720A120A1211722092001200000FBE00A20F220822079E +C85F:000000003F92041204720A120A1211722092001200000FA200A20F3E0822079E +C860:000000003F92041204720A120A1211722092001200000F8800880F08081407E3 +C861:000000003F92041204720A120A1211722092001200000FBE00A00F3E0820079E +C862:000000003F92041204720A120A1211722092001200000FBF00920F12081207BF +C863:000000003F92041204720A120A1211722092001200000F9C00800F7F0822079C +C864:000000003F92041204720A120A1211722092001200000FFE08020802080207FE +C865:000000003F92041204720A120A121172209200120000080208020FFE080207FE +C866:000000003F92041204720A120A121172209200120000088808880F88089407E3 +C867:000000003F92041204720A120A1211722092001200000040004000A003180C06 +C868:000000003F92041204720A120A121172209200120000020802080208051418E3 +C869:000000003F92041204720A120A12117220920012000007FC08020802080207FC +C86A:000000003F92041204720A120A1211722092001200000FFE004000A003180C06 +C86B:000000003F92041204720A120A12117220920012000001F000000FFE01100E0E +C86C:000000003F92041204720A120A1211722092001200000FFE00020FFE00020002 +C86D:000000003F92041204720A120A1211722092001200000FFE08000FFC080007FE +C86E:000000003F92041204720A120A1211722092001200000FFE0208020802080FFE +C86F:000000003F92041204720A120A12117220920012000001F000000FFE040403F8 +C870:0000000000001FFC00800080014002200410180C0080008000807FFF00000000 +C871:000000001FFC008001400630180C008000807FFF00001FFC0004000400040004 +C872:000000001FFC008001400630180C008000807FFF00001F7C0104010401040104 +C873:000000001FFC008001400630180C008000807FFF00001F1001100110012801C6 +C874:000000001FFC008001400630180C008000807FFF000010001000100010000FFC +C875:000000001FFC008001400630180C008000807FFF0000107C1010101010280FC6 +C876:000000001FFC008001400630180C008000807FFF00001038100010FE10440F38 +C877:000000001FFC008001400630180C008000807FFF00001FFC1000100010000FFC +C878:000000001FFC008001400630180C008000807FFF00001FFC00041FF810000FFC +C879:000000001FFC008001400630180C008000807FFF00001F7C01041E0410040F04 +C87A:000000001FFC008001400630180C008000807FFF00001F7C01441E4410440F3C +C87B:000000001FFC008001400630180C008000807FFF00001F4401441E7C10440F3C +C87C:000000001FFC008001400630180C008000807FFF00001F1001101E1010280FC6 +C87D:000000001FFC008001400630180C008000807FFF00001F7C01401E7C10400F3C +C87E:000000001FFC008001400630180C008000807FFF00001F7E01241E2410240F7E +C87F:000000001FFC008001400630180C008000807FFF00001F3801001EFE10440F38 +C880:000000001FFC008001400630180C008000807FFF00001FFC1004100410040FFC +C881:000000001FFC008001400630180C008000807FFF0000100410041FFC10040FFC +C882:000000001FFC008001400630180C008000807FFF0000111011101F1011280FC6 +C883:000000001FFC008001400630180C008000807FFF00000080008001400630180C +C884:000000001FFC008001400630180C008000807FFF00000410041004100A2831C6 +C885:000000001FFC008001400630180C008000807FFF00000FF81004100410040FF8 +C886:000000001FFC008001400630180C008000807FFF00001FFC008001400630180C +C887:000000001FFC008001400630180C008000807FFF000003E000001FFC02201C1C +C888:000000001FFC008001400630180C008000807FFF00001FFC00041FFC00040004 +C889:000000001FFC008001400630180C008000807FFF00001FFC10001FF810000FFC +C88A:000000001FFC008001400630180C008000807FFF00001FFC0410041004101FFC +C88B:000000001FFC008001400630180C008000807FFF000003E000001FFC080807F0 +C88C:0000000000043F84040404040A040A07110420840404040404047FF400040004 +C88D:000000003F8404040A0411072084040404047FF400001FFC0004000400040004 +C88E:000000003F8404040A0411072084040404047FF400001F7C0104010401040104 +C88F:000000003F8404040A0411072084040404047FF400001F1001100110012801C6 +C890:000000003F8404040A0411072084040404047FF4000410041000100010000FFC +C891:000000003F8404040A0411072084040404047FF40000107C1010101010280FC6 +C892:000000003F8404040A0411072084040404047FF400001038100010FE10440F38 +C893:000000003F8404040A0411072084040404047FF400001FFC1000100010000FFC +C894:000000003F8404040A0411072084040404047FF400001FFC00041FF810000FFC +C895:000000003F8404040A0411072084040404047FF400001F7C01041E0410040F04 +C896:000000003F8404040A0411072084040404047FF400001F7C01441E4410440F3C +C897:000000003F8404040A0411072084040404047FF400001F4401441E7C10440F3C +C898:000000003F8404040A0411072084040404047FF400001F1001101E1010280FC6 +C899:000000003F8404040A0411072084040404047FF400001F7C01401E7C10400F3C +C89A:000000003F8404040A0411072084040404047FF400001F7E01241E2410240F7E +C89B:000000003F8404040A0411072084040404047FF400001F3801001EFE10440F38 +C89C:000000003F8404040A0411072084040404047FF400001FFC1004100410040FFC +C89D:000000003F8404040A0411072084040404047FF40000100410041FFC10040FFC +C89E:000000003F8404040A0411072084040404047FF40000111011101F1011280FC6 +C89F:000000003F8404040A0411072084040404047FF400000080008001400630180C +C8A0:000000003F8404040A0411072084040404047FF400000410041004100A2831C6 +C8A1:000000003F8404040A0411072084040404047FF400000FF81004100410040FF8 +C8A2:000000003F8404040A0411072084040404047FF400001FFC008001400630180C +C8A3:000000003F8404040A0411072084040404047FF4000003E000001FFC02201C1C +C8A4:000000003F8404040A0411072084040404047FF400001FFC00041FFC00040004 +C8A5:000000003F8404040A0411072084040404047FF400001FFC10001FF810000FFC +C8A6:000000003F8404040A0411072084040404047FF400001FFC0410041004101FFC +C8A7:000000003F8404040A0411072084040404047FF4000003E000001FFC080807F0 +C8A8:0000000000123F92041204120A120A1E111220920412041204127FD200120012 +C8A9:000000003F9204120A12111E2092041204127FD200000FFE0002000200020002 +C8AA:000000003F9204120A12111E2092041204127FD200000FBE0082008200820082 +C8AB:000000003F9204120A12111E2092041204127FD200000F8800880088009400E3 +C8AC:000000003F9204120A12111E2092041204127FD20012081208000800080007FE +C8AD:000000003F9204120A12111E2092041204127FD20000083E08080808081407E3 +C8AE:000000003F9204120A12111E2092041204127FD20000081C0800087F0822079C +C8AF:000000003F9204120A12111E2092041204127FD200000FFE08000800080007FE +C8B0:000000003F9204120A12111E2092041204127FD200000FFE00020FFC080007FE +C8B1:000000003F9204120A12111E2092041204127FD200000FBE00820F0208020782 +C8B2:000000003F9204120A12111E2092041204127FD200000FBE00A20F220822079E +C8B3:000000003F9204120A12111E2092041204127FD200000FA200A20F3E0822079E +C8B4:000000003F9204120A12111E2092041204127FD200000F8800880F08081407E3 +C8B5:000000003F9204120A12111E2092041204127FD200000FBE00A00F3E0820079E +C8B6:000000003F9204120A12111E2092041204127FD200000FBF00920F12081207BF +C8B7:000000003F9204120A12111E2092041204127FD200000F9C00800F7F0822079C +C8B8:000000003F9204120A12111E2092041204127FD200000FFE08020802080207FE +C8B9:000000003F9204120A12111E2092041204127FD20000080208020FFE080207FE +C8BA:000000003F9204120A12111E2092041204127FD20000088808880F88089407E3 +C8BB:000000003F9204120A12111E2092041204127FD200000040004000A003180C06 +C8BC:000000003F9204120A12111E2092041204127FD20000020802080208051418E3 +C8BD:000000003F9204120A12111E2092041204127FD2000007FC08020802080207FC +C8BE:000000003F9204120A12111E2092041204127FD200000FFE004000A003180C06 +C8BF:000000003F9204120A12111E2092041204127FD2000001F000000FFE01100E0E +C8C0:000000003F9204120A12111E2092041204127FD200000FFE00020FFE00020002 +C8C1:000000003F9204120A12111E2092041204127FD200000FFE08000FFC080007FE +C8C2:000000003F9204120A12111E2092041204127FD200000FFE0208020802080FFE +C8C3:000000003F9204120A12111E2092041204127FD2000001F000000FFE040403F8 +C8C4:0000000000043F84040404040A040A04110420840404040404047FF400040004 +C8C5:000000003F8404040A0411042084040404047FF400001FFC0004000400040004 +C8C6:000000003F8404040A0411042084040404047FF400001F7C0104010401040104 +C8C7:000000003F8404040A0411042084040404047FF400001F1001100110012801C6 +C8C8:000000003F8404040A0411042084040404047FF4000410041000100010000FFC +C8C9:000000003F8404040A0411042084040404047FF40000107C1010101010280FC6 +C8CA:000000003F8404040A0411042084040404047FF400001038100010FE10440F38 +C8CB:000000003F8404040A0411042084040404047FF400001FFC1000100010000FFC +C8CC:000000003F8404040A0411042084040404047FF400001FFC00041FF810000FFC +C8CD:000000003F8404040A0411042084040404047FF400001F7C01041E0410040F04 +C8CE:000000003F8404040A0411042084040404047FF400001F7C01441E4410440F3C +C8CF:000000003F8404040A0411042084040404047FF400001F4401441E7C10440F3C +C8D0:000000003F8404040A0411042084040404047FF400001F1001101E1010280FC6 +C8D1:000000003F8404040A0411042084040404047FF400001F7C01401E7C10400F3C +C8D2:000000003F8404040A0411042084040404047FF400001F7E01241E2410240F7E +C8D3:000000003F8404040A0411042084040404047FF400001F3801001EFE10440F38 +C8D4:000000003F8404040A0411042084040404047FF400001FFC1004100410040FFC +C8D5:000000003F8404040A0411042084040404047FF40000100410041FFC10040FFC +C8D6:000000003F8404040A0411042084040404047FF40000111011101F1011280FC6 +C8D7:000000003F8404040A0411042084040404047FF400000080008001400630180C +C8D8:000000003F8404040A0411042084040404047FF400000410041004100A2831C6 +C8D9:000000003F8404040A0411042084040404047FF400000FF81004100410040FF8 +C8DA:000000003F8404040A0411042084040404047FF400001FFC008001400630180C +C8DB:000000003F8404040A0411042084040404047FF4000003E000001FFC02201C1C +C8DC:000000003F8404040A0411042084040404047FF400001FFC00041FFC00040004 +C8DD:000000003F8404040A0411042084040404047FF400001FFC10001FF810000FFC +C8DE:000000003F8404040A0411042084040404047FF400001FFC0410041004101FFC +C8DF:000000003F8404040A0411042084040404047FF4000003E000001FFC080807F0 +C8E0:0000000000001FFC00800080014002200410180C0220022002207FFF00000000 +C8E1:000000001FFC008001400630180C022002207FFF00001FFC0004000400040004 +C8E2:000000001FFC008001400630180C022002207FFF00001F7C0104010401040104 +C8E3:000000001FFC008001400630180C022002207FFF00001F1001100110012801C6 +C8E4:000000001FFC008001400630180C022002207FFF000010001000100010000FFC +C8E5:000000001FFC008001400630180C022002207FFF0000107C1010101010280FC6 +C8E6:000000001FFC008001400630180C022002207FFF00001038100010FE10440F38 +C8E7:000000001FFC008001400630180C022002207FFF00001FFC1000100010000FFC +C8E8:000000001FFC008001400630180C022002207FFF00001FFC00041FF810000FFC +C8E9:000000001FFC008001400630180C022002207FFF00001F7C01041E0410040F04 +C8EA:000000001FFC008001400630180C022002207FFF00001F7C01441E4410440F3C +C8EB:000000001FFC008001400630180C022002207FFF00001F4401441E7C10440F3C +C8EC:000000001FFC008001400630180C022002207FFF00001F1001101E1010280FC6 +C8ED:000000001FFC008001400630180C022002207FFF00001F7C01401E7C10400F3C +C8EE:000000001FFC008001400630180C022002207FFF00001F7E01241E2410240F7E +C8EF:000000001FFC008001400630180C022002207FFF00001F3801001EFE10440F38 +C8F0:000000001FFC008001400630180C022002207FFF00001FFC1004100410040FFC +C8F1:000000001FFC008001400630180C022002207FFF0000100410041FFC10040FFC +C8F2:000000001FFC008001400630180C022002207FFF0000111011101F1011280FC6 +C8F3:000000001FFC008001400630180C022002207FFF00000080008001400630180C +C8F4:000000001FFC008001400630180C022002207FFF00000410041004100A2831C6 +C8F5:000000001FFC008001400630180C022002207FFF00000FF81004100410040FF8 +C8F6:000000001FFC008001400630180C022002207FFF00001FFC008001400630180C +C8F7:000000001FFC008001400630180C022002207FFF000003E000001FFC02201C1C +C8F8:000000001FFC008001400630180C022002207FFF00001FFC00041FFC00040004 +C8F9:000000001FFC008001400630180C022002207FFF00001FFC10001FF810000FFC +C8FA:000000001FFC008001400630180C022002207FFF00001FFC0410041004101FFC +C8FB:000000001FFC008001400630180C022002207FFF000003E000001FFC080807F0 +C8FC:000000001FFC008001400630180C000000007FFF008000800080008000800080 +C8FD:000000001FFC008001400630180C00007FFF008000801FFC0004000400040004 +C8FE:000000001FFC008001400630180C00007FFF008000801F7C0104010401040104 +C8FF:000000001FFC008001400630180C00007FFF008000801F1001100110012801C6 +C900:000000001FFC008001400630180C000000007FFF008010801080100010000FFC +C901:000000001FFC008001400630180C00007FFF00800080107C1010101010280FC6 +C902:000000001FFC008001400630180C00007FFF008000801038100010FE10440F38 +C903:000000001FFC008001400630180C00007FFF008000801FFC1000100010000FFC +C904:000000001FFC008001400630180C00007FFF008000801FFC00041FF810000FFC +C905:000000001FFC008001400630180C00007FFF008000801F7C01041E0410040F04 +C906:000000001FFC008001400630180C00007FFF008000801F7C01441E4410440F3C +C907:000000001FFC008001400630180C00007FFF008000801F4401441E7C10440F3C +C908:000000001FFC008001400630180C00007FFF008000801F1001101E1010280FC6 +C909:000000001FFC008001400630180C00007FFF008000801F7C01401E7C10400F3C +C90A:000000001FFC008001400630180C00007FFF008000801F7E01241E2410240F7E +C90B:000000001FFC008001400630180C00007FFF008000801F3801001EFE10440F38 +C90C:000000001FFC008001400630180C00007FFF008000801FFC1004100410040FFC +C90D:000000001FFC008001400630180C00007FFF00800080100410041FFC10040FFC +C90E:000000001FFC008001400630180C00007FFF00800080111011101F1011280FC6 +C90F:000000001FFC008001400630180C00007FFF008000800080008001400630180C +C910:000000001FFC008001400630180C00007FFF008000800410041004100A2831C6 +C911:000000001FFC008001400630180C00007FFF008000800FF81004100410040FF8 +C912:000000001FFC008001400630180C00007FFF008000801FFC008001400630180C +C913:000000001FFC008001400630180C00007FFF0080008003E000001FFC02201C1C +C914:000000001FFC008001400630180C00007FFF008000801FFC00041FFC00040004 +C915:000000001FFC008001400630180C00007FFF008000801FFC10001FF810000FFC +C916:000000001FFC008001400630180C00007FFF008000801FFC0410041004101FFC +C917:000000001FFC008001400630180C00007FFF0080008003E000001FFC080807F0 +C918:000000003F8404040A0411042084000400047FF404040404043C040404040404 +C919:000000003F8404040A04111C208400047FF4040404001FFC0004000400040004 +C91A:000000003F8404040A04111C208400047FF4040404001F7C0104010401040104 +C91B:000000003F8404040A04111C208400047FF4040404001F1001100110012801C6 +C91C:000000003F8404040A041104208400047FF40404043C14041000100010000FFC +C91D:000000003F8404040A04111C208400047FF404040400107C1010101010280FC6 +C91E:000000003F8404040A04111C208400047FF4040404001038100010FE10440F38 +C91F:000000003F8404040A04111C208400047FF4040404001FFC1000100010000FFC +C920:000000003F8404040A04111C208400047FF4040404001FFC00041FF810000FFC +C921:000000003F8404040A04111C208400047FF4040404001F7C01041E0410040F04 +C922:000000003F8404040A04111C208400047FF4040404001F7C01441E4410440F3C +C923:000000003F8404040A04111C208400047FF4040404001F4401441E7C10440F3C +C924:000000003F8404040A04111C208400047FF4040404001F1001101E1010280FC6 +C925:000000003F8404040A04111C208400047FF4040404001F7C01401E7C10400F3C +C926:000000003F8404040A04111C208400047FF4040404001F7E01241E2410240F7E +C927:000000003F8404040A04111C208400047FF4040404001F3801001EFE10440F38 +C928:000000003F8404040A04111C208400047FF4040404001FFC1004100410040FFC +C929:000000003F8404040A04111C208400047FF404040400100410041FFC10040FFC +C92A:000000003F8404040A04111C208400047FF404040400111011101F1011280FC6 +C92B:000000003F8404040A04111C208400047FF4040404000080008001400630180C +C92C:000000003F8404040A04111C208400047FF4040404000410041004100A2831C6 +C92D:000000003F8404040A04111C208400047FF4040404000FF81004100410040FF8 +C92E:000000003F8404040A04111C208400047FF4040404001FFC008001400630180C +C92F:000000003F8404040A04111C208400047FF40404040003E000001FFC02201C1C +C930:000000003F8404040A04111C208400047FF4040404001FFC00041FFC00040004 +C931:000000003F8404040A04111C208400047FF4040404001FFC10001FF810000FFC +C932:000000003F8404040A04111C208400047FF4040404001FFC0410041004101FFC +C933:000000003F8404040A04111C208400047FF40404040003E000001FFC080807F0 +C934:000000003F9204120A1211122092001200127FD20412041204F2041204120412 +C935:000000003F9204120A121172209200127FD2041204000FFE0002000200020002 +C936:000000003F9204120A121172209200127FD2041204000FBE0082008200820082 +C937:000000003F9204120A121172209200127FD2041204000F8800880088009400E3 +C938:000000003F9204120A121112209200127FD2021202F20A1208000800080007FE +C939:000000003F9204120A121172209200127FD204120400083E08080808081407E3 +C93A:000000003F9204120A121172209200127FD204120400081C0800087F0822079C +C93B:000000003F9204120A121172209200127FD2041204000FFE08000800080007FE +C93C:000000003F9204120A121172209200127FD2041204000FFE00020FFC080007FE +C93D:000000003F9204120A121172209200127FD2041204000FBE00820F0208020782 +C93E:000000003F9204120A121172209200127FD2041204000FBE00A20F220822079E +C93F:000000003F9204120A121172209200127FD2041204000FA200A20F3E0822079E +C940:000000003F9204120A121172209200127FD2041204000F8800880F08081407E3 +C941:000000003F9204120A121172209200127FD2041204000FBE00A00F3E0820079E +C942:000000003F9204120A121172209200127FD2041204000FBF00920F12081207BF +C943:000000003F9204120A121172209200127FD2041204000F9C00800F7F0822079C +C944:000000003F9204120A121172209200127FD2041204000FFE08020802080207FE +C945:000000003F9204120A121172209200127FD204120400080208020FFE080207FE +C946:000000003F9204120A121172209200127FD204120400088808880F88089407E3 +C947:000000003F9204120A121172209200127FD2041204000040004000A003180C06 +C948:000000003F9204120A121172209200127FD204120400020802080208051418E3 +C949:000000003F9204120A121172209200127FD20412040007FC08020802080207FC +C94A:000000003F9204120A121172209200127FD2041204000FFE004000A003180C06 +C94B:000000003F9204120A121172209200127FD20412040001F000000FFE01100E0E +C94C:000000003F9204120A121172209200127FD2041204000FFE00020FFE00020002 +C94D:000000003F9204120A121172209200127FD2041204000FFE08000FFC080007FE +C94E:000000003F9204120A121172209200127FD2041204000FFE0208020802080FFE +C94F:000000003F9204120A121172209200127FD20412040001F000000FFE040403F8 +C950:000000003F8404040A0411042084000400047FF4040404040404040404040404 +C951:000000003F8404040A041104208400047FF4040404001FFC0004000400040004 +C952:000000003F8404040A041104208400047FF4040404001F7C0104010401040104 +C953:000000003F8404040A041104208400047FF4040404001F1001100110012801C6 +C954:000000003F8404040A041104208400047FF40404040414041000100010000FFC +C955:000000003F8404040A041104208400047FF404040400107C1010101010280FC6 +C956:000000003F8404040A041104208400047FF4040404001038100010FE10440F38 +C957:000000003F8404040A041104208400047FF4040404001FFC1000100010000FFC +C958:000000003F8404040A041104208400047FF4040404001FFC00041FF810000FFC +C959:000000003F8404040A041104208400047FF4040404001F7C01041E0410040F04 +C95A:000000003F8404040A041104208400047FF4040404001F7C01441E4410440F3C +C95B:000000003F8404040A041104208400047FF4040404001F4401441E7C10440F3C +C95C:000000003F8404040A041104208400047FF4040404001F1001101E1010280FC6 +C95D:000000003F8404040A041104208400047FF4040404001F7C01401E7C10400F3C +C95E:000000003F8404040A041104208400047FF4040404001F7E01241E2410240F7E +C95F:000000003F8404040A041104208400047FF4040404001F3801001EFE10440F38 +C960:000000003F8404040A041104208400047FF4040404001FFC1004100410040FFC +C961:000000003F8404040A041104208400047FF404040400100410041FFC10040FFC +C962:000000003F8404040A041104208400047FF404040400111011101F1011280FC6 +C963:000000003F8404040A041104208400047FF4040404000080008001400630180C +C964:000000003F8404040A041104208400047FF4040404000410041004100A2831C6 +C965:000000003F8404040A041104208400047FF4040404000FF81004100410040FF8 +C966:000000003F8404040A041104208400047FF4040404001FFC008001400630180C +C967:000000003F8404040A041104208400047FF40404040003E000001FFC02201C1C +C968:000000003F8404040A041104208400047FF4040404001FFC00041FFC00040004 +C969:000000003F8404040A041104208400047FF4040404001FFC10001FF810000FFC +C96A:000000003F8404040A041104208400047FF4040404001FFC0410041004101FFC +C96B:000000003F8404040A041104208400047FF40404040003E000001FFC080807F0 +C96C:000000001FFC008001400630180C000000007FFF041004100410041004100410 +C96D:000000001FFC008001400630180C00007FFF022002201FFC0004000400040004 +C96E:000000001FFC008001400630180C00007FFF022002201F7C0104010401040104 +C96F:000000001FFC008001400630180C00007FFF022002201F1001100110012801C6 +C970:000000001FFC008001400630180C000000007FFF022012201220100010000FFC +C971:000000001FFC008001400630180C00007FFF02200220107C1010101010280FC6 +C972:000000001FFC008001400630180C00007FFF022002201038100010FE10440F38 +C973:000000001FFC008001400630180C00007FFF022002201FFC1000100010000FFC +C974:000000001FFC008001400630180C00007FFF022002201FFC00041FF810000FFC +C975:000000001FFC008001400630180C00007FFF022002201F7C01041E0410040F04 +C976:000000001FFC008001400630180C00007FFF022002201F7C01441E4410440F3C +C977:000000001FFC008001400630180C00007FFF022002201F4401441E7C10440F3C +C978:000000001FFC008001400630180C00007FFF022002201F1001101E1010280FC6 +C979:000000001FFC008001400630180C00007FFF022002201F7C01401E7C10400F3C +C97A:000000001FFC008001400630180C00007FFF022002201F7E01241E2410240F7E +C97B:000000001FFC008001400630180C00007FFF022002201F3801001EFE10440F38 +C97C:000000001FFC008001400630180C00007FFF022002201FFC1004100410040FFC +C97D:000000001FFC008001400630180C00007FFF02200220100410041FFC10040FFC +C97E:000000001FFC008001400630180C00007FFF02200220111011101F1011280FC6 +C97F:000000001FFC008001400630180C00007FFF022002200080008001400630180C +C980:000000001FFC008001400630180C00007FFF022002200410041004100A2831C6 +C981:000000001FFC008001400630180C00007FFF022002200FF81004100410040FF8 +C982:000000001FFC008001400630180C00007FFF022002201FFC008001400630180C +C983:000000001FFC008001400630180C00007FFF0220022003E000001FFC02201C1C +C984:000000001FFC008001400630180C00007FFF022002201FFC00041FFC00040004 +C985:000000001FFC008001400630180C00007FFF022002201FFC10001FF810000FFC +C986:000000001FFC008001400630180C00007FFF022002201FFC0410041004101FFC +C987:000000001FFC008001400630180C00007FFF0220022003E000001FFC080807F0 +C988:0000000000001FFC00800080014002200410180C0000000000007FFF00000000 +C989:000000001FFC008001400630180C00007FFF000000001FFC0004000400040004 +C98A:000000001FFC008001400630180C00007FFF000000001F7C0104010401040104 +C98B:000000001FFC008001400630180C00007FFF000000001F1001100110012801C6 +C98C:000000001FFC008001400630180C000000007FFF000010001000100010000FFC +C98D:000000001FFC008001400630180C00007FFF00000000107C1010101010280FC6 +C98E:000000001FFC008001400630180C00007FFF000000001038100010FE10440F38 +C98F:000000001FFC008001400630180C00007FFF000000001FFC1000100010000FFC +C990:000000001FFC008001400630180C00007FFF000000001FFC00041FF810000FFC +C991:000000001FFC008001400630180C00007FFF000000001F7C01041E0410040F04 +C992:000000001FFC008001400630180C00007FFF000000001F7C01441E4410440F3C +C993:000000001FFC008001400630180C00007FFF000000001F4401441E7C10440F3C +C994:000000001FFC008001400630180C00007FFF000000001F1001101E1010280FC6 +C995:000000001FFC008001400630180C00007FFF000000001F7C01401E7C10400F3C +C996:000000001FFC008001400630180C00007FFF000000001F7E01241E2410240F7E +C997:000000001FFC008001400630180C00007FFF000000001F3801001EFE10440F38 +C998:000000001FFC008001400630180C00007FFF000000001FFC1004100410040FFC +C999:000000001FFC008001400630180C00007FFF00000000100410041FFC10040FFC +C99A:000000001FFC008001400630180C00007FFF00000000111011101F1011280FC6 +C99B:000000001FFC008001400630180C00007FFF000000000080008001400630180C +C99C:000000001FFC008001400630180C00007FFF000000000410041004100A2831C6 +C99D:000000001FFC008001400630180C00007FFF000000000FF81004100410040FF8 +C99E:000000001FFC008001400630180C00007FFF000000001FFC008001400630180C +C99F:000000001FFC008001400630180C00007FFF0000000003E000001FFC02201C1C +C9A0:000000001FFC008001400630180C00007FFF000000001FFC00041FFC00040004 +C9A1:000000001FFC008001400630180C00007FFF000000001FFC10001FF810000FFC +C9A2:000000001FFC008001400630180C00007FFF000000001FFC0410041004101FFC +C9A3:000000001FFC008001400630180C00007FFF0000000003E000001FFC080807F0 +C9A4:0000000000043F84040404040A040A04110420840004000400047FF400040004 +C9A5:000000003F8404040A041104208400047FF4000400001FFC0004000400040004 +C9A6:000000003F8404040A041104208400047FF4000400001F7C0104010401040104 +C9A7:000000003F8404040A041104208400047FF4000400001F1001100110012801C6 +C9A8:000000003F8404040A0411042084000400047FF4000410041000100010000FFC +C9A9:000000003F8404040A041104208400047FF400040000107C1010101010280FC6 +C9AA:000000003F8404040A041104208400047FF4000400001038100010FE10440F38 +C9AB:000000003F8404040A041104208400047FF4000400001FFC1000100010000FFC +C9AC:000000003F8404040A041104208400047FF4000400001FFC00041FF810000FFC +C9AD:000000003F8404040A041104208400047FF4000400001F7C01041E0410040F04 +C9AE:000000003F8404040A041104208400047FF4000400001F7C01441E4410440F3C +C9AF:000000003F8404040A041104208400047FF4000400001F4401441E7C10440F3C +C9B0:000000003F8404040A041104208400047FF4000400001F1001101E1010280FC6 +C9B1:000000003F8404040A041104208400047FF4000400001F7C01401E7C10400F3C +C9B2:000000003F8404040A041104208400047FF4000400001F7E01241E2410240F7E +C9B3:000000003F8404040A041104208400047FF4000400001F3801001EFE10440F38 +C9B4:000000003F8404040A041104208400047FF4000400001FFC1004100410040FFC +C9B5:000000003F8404040A041104208400047FF400040000100410041FFC10040FFC +C9B6:000000003F8404040A041104208400047FF400040000111011101F1011280FC6 +C9B7:000000003F8404040A041104208400047FF4000400000080008001400630180C +C9B8:000000003F8404040A041104208400047FF4000400000410041004100A2831C6 +C9B9:000000003F8404040A041104208400047FF4000400000FF81004100410040FF8 +C9BA:000000003F8404040A041104208400047FF4000400001FFC008001400630180C +C9BB:000000003F8404040A041104208400047FF40004000003E000001FFC02201C1C +C9BC:000000003F8404040A041104208400047FF4000400001FFC00041FFC00040004 +C9BD:000000003F8404040A041104208400047FF4000400001FFC10001FF810000FFC +C9BE:000000003F8404040A041104208400047FF4000400001FFC0410041004101FFC +C9BF:000000003F8404040A041104208400047FF40004000003E000001FFC080807F0 +C9C0:0000000000043F840404040404040A040A040A04110411042084000400040004 +C9C1:000000003F84040404040A040A0411042084000400001FFC0004000400040004 +C9C2:000000003F84040404040A040A0411042084000400001F7C0104010401040104 +C9C3:000000003F84040404040A040A0411042084000400001F1001100110012801C6 +C9C4:000000003F84040404040A040A04110420840004000410041000100010000FFC +C9C5:000000003F84040404040A040A041104208400040000107C1010101010280FC6 +C9C6:000000003F84040404040A040A0411042084000400001038100010FE10440F38 +C9C7:000000003F84040404040A040A0411042084000400001FFC1000100010000FFC +C9C8:000000003F84040404040A040A0411042084000400001FFC00041FF810000FFC +C9C9:000000003F84040404040A040A0411042084000400001F7C01041E0410040F04 +C9CA:000000003F84040404040A040A0411042084000400001F7C01441E4410440F3C +C9CB:000000003F84040404040A040A0411042084000400001F4401441E7C10440F3C +C9CC:000000003F84040404040A040A0411042084000400001F1001101E1010280FC6 +C9CD:000000003F84040404040A040A0411042084000400001F7C01401E7C10400F3C +C9CE:000000003F84040404040A040A0411042084000400001F7E01241E2410240F7E +C9CF:000000003F84040404040A040A0411042084000400001F3801001EFE10440F38 +C9D0:000000003F84040404040A040A0411042084000400001FFC1004100410040FFC +C9D1:000000003F84040404040A040A041104208400040000100410041FFC10040FFC +C9D2:000000003F84040404040A040A041104208400040000111011101F1011280FC6 +C9D3:000000003F84040404040A040A0411042084000400000080008001400630180C +C9D4:000000003F84040404040A040A0411042084000400000410041004100A2831C6 +C9D5:000000003F84040404040A040A0411042084000400000FF81004100410040FF8 +C9D6:000000003F84040404040A040A0411042084000400001FFC008001400630180C +C9D7:000000003F84040404040A040A04110420840004000003E000001FFC02201C1C +C9D8:000000003F84040404040A040A0411042084000400001FFC00041FFC00040004 +C9D9:000000003F84040404040A040A0411042084000400001FFC10001FF810000FFC +C9DA:000000003F84040404040A040A0411042084000400001FFC0410041004101FFC +C9DB:000000003F84040404040A040A04110420840004000003E000001FFC080807F0 +C9DC:0000000000047FC4110411041104110711042A842A842A844444000400040004 +C9DD:000000007FC41104110411072A842A844444000400001FFC0004000400040004 +C9DE:000000007FC41104110411072A842A844444000400001F7C0104010401040104 +C9DF:000000007FC41104110411072A842A844444000400001F1001100110012801C6 +C9E0:000000007FC41104110411072A842A8444440004000410041000100010000FFC +C9E1:000000007FC41104110411072A842A84444400040000107C1010101010280FC6 +C9E2:000000007FC41104110411072A842A844444000400001038100010FE10440F38 +C9E3:000000007FC41104110411072A842A844444000400001FFC1000100010000FFC +C9E4:000000007FC41104110411072A842A844444000400001FFC00041FF810000FFC +C9E5:000000007FC41104110411072A842A844444000400001F7C01041E0410040F04 +C9E6:000000007FC41104110411072A842A844444000400001F7C01441E4410440F3C +C9E7:000000007FC41104110411072A842A844444000400001F4401441E7C10440F3C +C9E8:000000007FC41104110411072A842A844444000400001F1001101E1010280FC6 +C9E9:000000007FC41104110411072A842A844444000400001F7C01401E7C10400F3C +C9EA:000000007FC41104110411072A842A844444000400001F7E01241E2410240F7E +C9EB:000000007FC41104110411072A842A844444000400001F3801001EFE10440F38 +C9EC:000000007FC41104110411072A842A844444000400001FFC1004100410040FFC +C9ED:000000007FC41104110411072A842A84444400040000100410041FFC10040FFC +C9EE:000000007FC41104110411072A842A84444400040000111011101F1011280FC6 +C9EF:000000007FC41104110411072A842A844444000400000080008001400630180C +C9F0:000000007FC41104110411072A842A844444000400000410041004100A2831C6 +C9F1:000000007FC41104110411072A842A844444000400000FF81004100410040FF8 +C9F2:000000007FC41104110411072A842A844444000400001FFC008001400630180C +C9F3:000000007FC41104110411072A842A8444440004000003E000001FFC02201C1C +C9F4:000000007FC41104110411072A842A844444000400001FFC00041FFC00040004 +C9F5:000000007FC41104110411072A842A844444000400001FFC10001FF810000FFC +C9F6:000000007FC41104110411072A842A844444000400001FFC0410041004101FFC +C9F7:000000007FC41104110411072A842A8444440004000003E000001FFC080807F0 +C9F8:0000000000127FD2111211121112111E11122A922A922A924452001200120012 +C9F9:000000007FD211121112111E2A922A924452001200000FFE0002000200020002 +C9FA:000000007FD211121112111E2A922A924452001200000FBE0082008200820082 +C9FB:000000007FD211121112111E2A922A924452001200000F8800880088009400E3 +C9FC:000000007FD211121112111E2A922A92445200120012081208000800080007FE +C9FD:000000007FD211121112111E2A922A92445200120000083E08080808081407E3 +C9FE:000000007FD211121112111E2A922A92445200120000081C0800087F0822079C +C9FF:000000007FD211121112111E2A922A924452001200000FFE08000800080007FE +CA00:000000007FD211121112111E2A922A924452001200000FFE00020FFC080007FE +CA01:000000007FD211121112111E2A922A924452001200000FBE00820F0208020782 +CA02:000000007FD211121112111E2A922A924452001200000FBE00A20F220822079E +CA03:000000007FD211121112111E2A922A924452001200000FA200A20F3E0822079E +CA04:000000007FD211121112111E2A922A924452001200000F8800880F08081407E3 +CA05:000000007FD211121112111E2A922A924452001200000FBE00A00F3E0820079E +CA06:000000007FD211121112111E2A922A924452001200000FBF00920F12081207BF +CA07:000000007FD211121112111E2A922A924452001200000F9C00800F7F0822079C +CA08:000000007FD211121112111E2A922A924452001200000FFE08020802080207FE +CA09:000000007FD211121112111E2A922A92445200120000080208020FFE080207FE +CA0A:000000007FD211121112111E2A922A92445200120000088808880F88089407E3 +CA0B:000000007FD211121112111E2A922A924452001200000040004000A003180C06 +CA0C:000000007FD211121112111E2A922A92445200120000020802080208051418E3 +CA0D:000000007FD211121112111E2A922A9244520012000007FC08020802080207FC +CA0E:000000007FD211121112111E2A922A924452001200000FFE004000A003180C06 +CA0F:000000007FD211121112111E2A922A9244520012000001F000000FFE01100E0E +CA10:000000007FD211121112111E2A922A924452001200000FFE00020FFE00020002 +CA11:000000007FD211121112111E2A922A924452001200000FFE08000FFC080007FE +CA12:000000007FD211121112111E2A922A924452001200000FFE0208020802080FFE +CA13:000000007FD211121112111E2A922A9244520012000001F000000FFE040403F8 +CA14:0000000000047FC4110411041107110411042A872A842A844444000400040004 +CA15:000000007FC41104110711042A842A874444000400001FFC0004000400040004 +CA16:000000007FC41104110711042A842A874444000400001F7C0104010401040104 +CA17:000000007FC41104110711042A842A874444000400001F1001100110012801C6 +CA18:000000007FC41104110711042A842A8744440004000410041000100010000FFC +CA19:000000007FC41104110711042A842A87444400040000107C1010101010280FC6 +CA1A:000000007FC41104110711042A842A874444000400001038100010FE10440F38 +CA1B:000000007FC41104110711042A842A874444000400001FFC1000100010000FFC +CA1C:000000007FC41104110711042A842A874444000400001FFC00041FF810000FFC +CA1D:000000007FC41104110711042A842A874444000400001F7C01041E0410040F04 +CA1E:000000007FC41104110711042A842A874444000400001F7C01441E4410440F3C +CA1F:000000007FC41104110711042A842A874444000400001F4401441E7C10440F3C +CA20:000000007FC41104110711042A842A874444000400001F1001101E1010280FC6 +CA21:000000007FC41104110711042A842A874444000400001F7C01401E7C10400F3C +CA22:000000007FC41104110711042A842A874444000400001F7E01241E2410240F7E +CA23:000000007FC41104110711042A842A874444000400001F3801001EFE10440F38 +CA24:000000007FC41104110711042A842A874444000400001FFC1004100410040FFC +CA25:000000007FC41104110711042A842A87444400040000100410041FFC10040FFC +CA26:000000007FC41104110711042A842A87444400040000111011101F1011280FC6 +CA27:000000007FC41104110711042A842A874444000400000080008001400630180C +CA28:000000007FC41104110711042A842A874444000400000410041004100A2831C6 +CA29:000000007FC41104110711042A842A874444000400000FF81004100410040FF8 +CA2A:000000007FC41104110711042A842A874444000400001FFC008001400630180C +CA2B:000000007FC41104110711042A842A8744440004000003E000001FFC02201C1C +CA2C:000000007FC41104110711042A842A874444000400001FFC00041FFC00040004 +CA2D:000000007FC41104110711042A842A874444000400001FFC10001FF810000FFC +CA2E:000000007FC41104110711042A842A874444000400001FFC0410041004101FFC +CA2F:000000007FC41104110711042A842A8744440004000003E000001FFC080807F0 +CA30:0000000000127FD211121112111E111211122A9E2A922A924452001200120012 +CA31:000000007FD21112111E11122A922A9E4452001200000FFE0002000200020002 +CA32:000000007FD21112111E11122A922A9E4452001200000FBE0082008200820082 +CA33:000000007FD21112111E11122A922A9E4452001200000F8800880088009400E3 +CA34:000000007FD21112111E11122A922A9E445200120012081208000800080007FE +CA35:000000007FD21112111E11122A922A9E445200120000083E08080808081407E3 +CA36:000000007FD21112111E11122A922A9E445200120000081C0800087F0822079C +CA37:000000007FD21112111E11122A922A9E4452001200000FFE08000800080007FE +CA38:000000007FD21112111E11122A922A9E4452001200000FFE00020FFC080007FE +CA39:000000007FD21112111E11122A922A9E4452001200000FBE00820F0208020782 +CA3A:000000007FD21112111E11122A922A9E4452001200000FBE00A20F220822079E +CA3B:000000007FD21112111E11122A922A9E4452001200000FA200A20F3E0822079E +CA3C:000000007FD21112111E11122A922A9E4452001200000F8800880F08081407E3 +CA3D:000000007FD21112111E11122A922A9E4452001200000FBE00A00F3E0820079E +CA3E:000000007FD21112111E11122A922A9E4452001200000FBF00920F12081207BF +CA3F:000000007FD21112111E11122A922A9E4452001200000F9C00800F7F0822079C +CA40:000000007FD21112111E11122A922A9E4452001200000FFE08020802080207FE +CA41:000000007FD21112111E11122A922A9E445200120000080208020FFE080207FE +CA42:000000007FD21112111E11122A922A9E445200120000088808880F88089407E3 +CA43:000000007FD21112111E11122A922A9E4452001200000040004000A003180C06 +CA44:000000007FD21112111E11122A922A9E445200120000020802080208051418E3 +CA45:000000007FD21112111E11122A922A9E44520012000007FC08020802080207FC +CA46:000000007FD21112111E11122A922A9E4452001200000FFE004000A003180C06 +CA47:000000007FD21112111E11122A922A9E44520012000001F000000FFE01100E0E +CA48:000000007FD21112111E11122A922A9E4452001200000FFE00020FFE00020002 +CA49:000000007FD21112111E11122A922A9E4452001200000FFE08000FFC080007FE +CA4A:000000007FD21112111E11122A922A9E4452001200000FFE0208020802080FFE +CA4B:000000007FD21112111E11122A922A9E44520012000001F000000FFE040403F8 +CA4C:0000000000047FC4110411041104113C11042A842A842A844444000400040004 +CA4D:000000007FC411041104113C2A842A844444000400001FFC0004000400040004 +CA4E:000000007FC411041104113C2A842A844444000400001F7C0104010401040104 +CA4F:000000007FC411041104113C2A842A844444000400001F1001100110012801C6 +CA50:000000007FC411041104113C2A842A8444440004000410041000100010000FFC +CA51:000000007FC411041104113C2A842A84444400040000107C1010101010280FC6 +CA52:000000007FC411041104113C2A842A844444000400001038100010FE10440F38 +CA53:000000007FC411041104113C2A842A844444000400001FFC1000100010000FFC +CA54:000000007FC411041104113C2A842A844444000400001FFC00041FF810000FFC +CA55:000000007FC411041104113C2A842A844444000400001F7C01041E0410040F04 +CA56:000000007FC411041104113C2A842A844444000400001F7C01441E4410440F3C +CA57:000000007FC411041104113C2A842A844444000400001F4401441E7C10440F3C +CA58:000000007FC411041104113C2A842A844444000400001F1001101E1010280FC6 +CA59:000000007FC411041104113C2A842A844444000400001F7C01401E7C10400F3C +CA5A:000000007FC411041104113C2A842A844444000400001F7E01241E2410240F7E +CA5B:000000007FC411041104113C2A842A844444000400001F3801001EFE10440F38 +CA5C:000000007FC411041104113C2A842A844444000400001FFC1004100410040FFC +CA5D:000000007FC411041104113C2A842A84444400040000100410041FFC10040FFC +CA5E:000000007FC411041104113C2A842A84444400040000111011101F1011280FC6 +CA5F:000000007FC411041104113C2A842A844444000400000080008001400630180C +CA60:000000007FC411041104113C2A842A844444000400000410041004100A2831C6 +CA61:000000007FC411041104113C2A842A844444000400000FF81004100410040FF8 +CA62:000000007FC411041104113C2A842A844444000400001FFC008001400630180C +CA63:000000007FC411041104113C2A842A8444440004000003E000001FFC02201C1C +CA64:000000007FC411041104113C2A842A844444000400001FFC00041FFC00040004 +CA65:000000007FC411041104113C2A842A844444000400001FFC10001FF810000FFC +CA66:000000007FC411041104113C2A842A844444000400001FFC0410041004101FFC +CA67:000000007FC411041104113C2A842A8444440004000003E000001FFC080807F0 +CA68:0000000000127FD2111211121112117211122A922A922A924452001200120012 +CA69:000000007FD21112111211722A922A924452001200000FFE0002000200020002 +CA6A:000000007FD21112111211722A922A924452001200000FBE0082008200820082 +CA6B:000000007FD21112111211722A922A924452001200000F8800880088009400E3 +CA6C:000000007FD21112111211722A922A92445200120012081208000800080007FE +CA6D:000000007FD21112111211722A922A92445200120000083E08080808081407E3 +CA6E:000000007FD21112111211722A922A92445200120000081C0800087F0822079C +CA6F:000000007FD21112111211722A922A924452001200000FFE08000800080007FE +CA70:000000007FD21112111211722A922A924452001200000FFE00020FFC080007FE +CA71:000000007FD21112111211722A922A924452001200000FBE00820F0208020782 +CA72:000000007FD21112111211722A922A924452001200000FBE00A20F220822079E +CA73:000000007FD21112111211722A922A924452001200000FA200A20F3E0822079E +CA74:000000007FD21112111211722A922A924452001200000F8800880F08081407E3 +CA75:000000007FD21112111211722A922A924452001200000FBE00A00F3E0820079E +CA76:000000007FD21112111211722A922A924452001200000FBF00920F12081207BF +CA77:000000007FD21112111211722A922A924452001200000F9C00800F7F0822079C +CA78:000000007FD21112111211722A922A924452001200000FFE08020802080207FE +CA79:000000007FD21112111211722A922A92445200120000080208020FFE080207FE +CA7A:000000007FD21112111211722A922A92445200120000088808880F88089407E3 +CA7B:000000007FD21112111211722A922A924452001200000040004000A003180C06 +CA7C:000000007FD21112111211722A922A92445200120000020802080208051418E3 +CA7D:000000007FD21112111211722A922A9244520012000007FC08020802080207FC +CA7E:000000007FD21112111211722A922A924452001200000FFE004000A003180C06 +CA7F:000000007FD21112111211722A922A9244520012000001F000000FFE01100E0E +CA80:000000007FD21112111211722A922A924452001200000FFE00020FFE00020002 +CA81:000000007FD21112111211722A922A924452001200000FFE08000FFC080007FE +CA82:000000007FD21112111211722A922A924452001200000FFE0208020802080FFE +CA83:000000007FD21112111211722A922A9244520012000001F000000FFE040403F8 +CA84:0000000000047FC411041104113C110411042ABC2A842A844444000400040004 +CA85:000000007FC41104113C11042A842ABC4444000400001FFC0004000400040004 +CA86:000000007FC41104113C11042A842ABC4444000400001F7C0104010401040104 +CA87:000000007FC41104113C11042A842ABC4444000400001F1001100110012801C6 +CA88:000000007FC41104113C11042A842ABC44440004000410041000100010000FFC +CA89:000000007FC41104113C11042A842ABC444400040000107C1010101010280FC6 +CA8A:000000007FC41104113C11042A842ABC4444000400001038100010FE10440F38 +CA8B:000000007FC41104113C11042A842ABC4444000400001FFC1000100010000FFC +CA8C:000000007FC41104113C11042A842ABC4444000400001FFC00041FF810000FFC +CA8D:000000007FC41104113C11042A842ABC4444000400001F7C01041E0410040F04 +CA8E:000000007FC41104113C11042A842ABC4444000400001F7C01441E4410440F3C +CA8F:000000007FC41104113C11042A842ABC4444000400001F4401441E7C10440F3C +CA90:000000007FC41104113C11042A842ABC4444000400001F1001101E1010280FC6 +CA91:000000007FC41104113C11042A842ABC4444000400001F7C01401E7C10400F3C +CA92:000000007FC41104113C11042A842ABC4444000400001F7E01241E2410240F7E +CA93:000000007FC41104113C11042A842ABC4444000400001F3801001EFE10440F38 +CA94:000000007FC41104113C11042A842ABC4444000400001FFC1004100410040FFC +CA95:000000007FC41104113C11042A842ABC444400040000100410041FFC10040FFC +CA96:000000007FC41104113C11042A842ABC444400040000111011101F1011280FC6 +CA97:000000007FC41104113C11042A842ABC4444000400000080008001400630180C +CA98:000000007FC41104113C11042A842ABC4444000400000410041004100A2831C6 +CA99:000000007FC41104113C11042A842ABC4444000400000FF81004100410040FF8 +CA9A:000000007FC41104113C11042A842ABC4444000400001FFC008001400630180C +CA9B:000000007FC41104113C11042A842ABC44440004000003E000001FFC02201C1C +CA9C:000000007FC41104113C11042A842ABC4444000400001FFC00041FFC00040004 +CA9D:000000007FC41104113C11042A842ABC4444000400001FFC10001FF810000FFC +CA9E:000000007FC41104113C11042A842ABC4444000400001FFC0410041004101FFC +CA9F:000000007FC41104113C11042A842ABC44440004000003E000001FFC080807F0 +CAA0:0000000000127FD2111211121172111211122AF22A922A924452001200120012 +CAA1:000000007FD21112117211122A922AF24452001200000FFE0002000200020002 +CAA2:000000007FD21112117211122A922AF24452001200000FBE0082008200820082 +CAA3:000000007FD21112117211122A922AF24452001200000F8800880088009400E3 +CAA4:000000007FD21112117211122A922AF2445200120012081208000800080007FE +CAA5:000000007FD21112117211122A922AF2445200120000083E08080808081407E3 +CAA6:000000007FD21112117211122A922AF2445200120000081C0800087F0822079C +CAA7:000000007FD21112117211122A922AF24452001200000FFE08000800080007FE +CAA8:000000007FD21112117211122A922AF24452001200000FFE00020FFC080007FE +CAA9:000000007FD21112117211122A922AF24452001200000FBE00820F0208020782 +CAAA:000000007FD21112117211122A922AF24452001200000FBE00A20F220822079E +CAAB:000000007FD21112117211122A922AF24452001200000FA200A20F3E0822079E +CAAC:000000007FD21112117211122A922AF24452001200000F8800880F08081407E3 +CAAD:000000007FD21112117211122A922AF24452001200000FBE00A00F3E0820079E +CAAE:000000007FD21112117211122A922AF24452001200000FBF00920F12081207BF +CAAF:000000007FD21112117211122A922AF24452001200000F9C00800F7F0822079C +CAB0:000000007FD21112117211122A922AF24452001200000FFE08020802080207FE +CAB1:000000007FD21112117211122A922AF2445200120000080208020FFE080207FE +CAB2:000000007FD21112117211122A922AF2445200120000088808880F88089407E3 +CAB3:000000007FD21112117211122A922AF24452001200000040004000A003180C06 +CAB4:000000007FD21112117211122A922AF2445200120000020802080208051418E3 +CAB5:000000007FD21112117211122A922AF244520012000007FC08020802080207FC +CAB6:000000007FD21112117211122A922AF24452001200000FFE004000A003180C06 +CAB7:000000007FD21112117211122A922AF244520012000001F000000FFE01100E0E +CAB8:000000007FD21112117211122A922AF24452001200000FFE00020FFE00020002 +CAB9:000000007FD21112117211122A922AF24452001200000FFE08000FFC080007FE +CABA:000000007FD21112117211122A922AF24452001200000FFE0208020802080FFE +CABB:000000007FD21112117211122A922AF244520012000001F000000FFE040403F8 +CABC:0000000000001F7C0410041004100A280A2811440080008000807FFF00000000 +CABD:000000001F7C041004100A2831C6008000807FFF00001FFC0004000400040004 +CABE:000000001F7C041004100A2831C6008000807FFF00001F7C0104010401040104 +CABF:000000001F7C041004100A2831C6008000807FFF00001F1001100110012801C6 +CAC0:000000001F7C041004100A2831C6008000807FFF000010001000100010000FFC +CAC1:000000001F7C041004100A2831C6008000807FFF0000107C1010101010280FC6 +CAC2:000000001F7C041004100A2831C6008000807FFF00001038100010FE10440F38 +CAC3:000000001F7C041004100A2831C6008000807FFF00001FFC1000100010000FFC +CAC4:000000001F7C041004100A2831C6008000807FFF00001FFC00041FF810000FFC +CAC5:000000001F7C041004100A2831C6008000807FFF00001F7C01041E0410040F04 +CAC6:000000001F7C041004100A2831C6008000807FFF00001F7C01441E4410440F3C +CAC7:000000001F7C041004100A2831C6008000807FFF00001F4401441E7C10440F3C +CAC8:000000001F7C041004100A2831C6008000807FFF00001F1001101E1010280FC6 +CAC9:000000001F7C041004100A2831C6008000807FFF00001F7C01401E7C10400F3C +CACA:000000001F7C041004100A2831C6008000807FFF00001F7E01241E2410240F7E +CACB:000000001F7C041004100A2831C6008000807FFF00001F3801001EFE10440F38 +CACC:000000001F7C041004100A2831C6008000807FFF00001FFC1004100410040FFC +CACD:000000001F7C041004100A2831C6008000807FFF0000100410041FFC10040FFC +CACE:000000001F7C041004100A2831C6008000807FFF0000111011101F1011280FC6 +CACF:000000001F7C041004100A2831C6008000807FFF00000080008001400630180C +CAD0:000000001F7C041004100A2831C6008000807FFF00000410041004100A2831C6 +CAD1:000000001F7C041004100A2831C6008000807FFF00000FF81004100410040FF8 +CAD2:000000001F7C041004100A2831C6008000807FFF00001FFC008001400630180C +CAD3:000000001F7C041004100A2831C6008000807FFF000003E000001FFC02201C1C +CAD4:000000001F7C041004100A2831C6008000807FFF00001FFC00041FFC00040004 +CAD5:000000001F7C041004100A2831C6008000807FFF00001FFC10001FF810000FFC +CAD6:000000001F7C041004100A2831C6008000807FFF00001FFC0410041004101FFC +CAD7:000000001F7C041004100A2831C6008000807FFF000003E000001FFC080807F0 +CAD8:0000000000047FC41104110411042A872A8444440404040404047FF400040004 +CAD9:000000007FC4110411042A874444040404047FF400001FFC0004000400040004 +CADA:000000007FC4110411042A874444040404047FF400001F7C0104010401040104 +CADB:000000007FC4110411042A874444040404047FF400001F1001100110012801C6 +CADC:000000007FC4110411042A874444040404047FF4000410041000100010000FFC +CADD:000000007FC4110411042A874444040404047FF40000107C1010101010280FC6 +CADE:000000007FC4110411042A874444040404047FF400001038100010FE10440F38 +CADF:000000007FC4110411042A874444040404047FF400001FFC1000100010000FFC +CAE0:000000007FC4110411042A874444040404047FF400001FFC00041FF810000FFC +CAE1:000000007FC4110411042A874444040404047FF400001F7C01041E0410040F04 +CAE2:000000007FC4110411042A874444040404047FF400001F7C01441E4410440F3C +CAE3:000000007FC4110411042A874444040404047FF400001F4401441E7C10440F3C +CAE4:000000007FC4110411042A874444040404047FF400001F1001101E1010280FC6 +CAE5:000000007FC4110411042A874444040404047FF400001F7C01401E7C10400F3C +CAE6:000000007FC4110411042A874444040404047FF400001F7E01241E2410240F7E +CAE7:000000007FC4110411042A874444040404047FF400001F3801001EFE10440F38 +CAE8:000000007FC4110411042A874444040404047FF400001FFC1004100410040FFC +CAE9:000000007FC4110411042A874444040404047FF40000100410041FFC10040FFC +CAEA:000000007FC4110411042A874444040404047FF40000111011101F1011280FC6 +CAEB:000000007FC4110411042A874444040404047FF400000080008001400630180C +CAEC:000000007FC4110411042A874444040404047FF400000410041004100A2831C6 +CAED:000000007FC4110411042A874444040404047FF400000FF81004100410040FF8 +CAEE:000000007FC4110411042A874444040404047FF400001FFC008001400630180C +CAEF:000000007FC4110411042A874444040404047FF4000003E000001FFC02201C1C +CAF0:000000007FC4110411042A874444040404047FF400001FFC00041FFC00040004 +CAF1:000000007FC4110411042A874444040404047FF400001FFC10001FF810000FFC +CAF2:000000007FC4110411042A874444040404047FF400001FFC0410041004101FFC +CAF3:000000007FC4110411042A874444040404047FF4000003E000001FFC080807F0 +CAF4:0000000000127FD21112111211122A9E2A9244520412041204127FD200120012 +CAF5:000000007FD2111211122A9E4452041204127FD200000FFE0002000200020002 +CAF6:000000007FD2111211122A9E4452041204127FD200000FBE0082008200820082 +CAF7:000000007FD2111211122A9E4452041204127FD200000F8800880088009400E3 +CAF8:000000007FD2111211122A9E4452041204127FD20012081208000800080007FE +CAF9:000000007FD2111211122A9E4452041204127FD20000083E08080808081407E3 +CAFA:000000007FD2111211122A9E4452041204127FD20000081C0800087F0822079C +CAFB:000000007FD2111211122A9E4452041204127FD200000FFE08000800080007FE +CAFC:000000007FD2111211122A9E4452041204127FD200000FFE00020FFC080007FE +CAFD:000000007FD2111211122A9E4452041204127FD200000FBE00820F0208020782 +CAFE:000000007FD2111211122A9E4452041204127FD200000FBE00A20F220822079E +CAFF:000000007FD2111211122A9E4452041204127FD200000FA200A20F3E0822079E +CB00:000000007FD2111211122A9E4452041204127FD200000F8800880F08081407E3 +CB01:000000007FD2111211122A9E4452041204127FD200000FBE00A00F3E0820079E +CB02:000000007FD2111211122A9E4452041204127FD200000FBF00920F12081207BF +CB03:000000007FD2111211122A9E4452041204127FD200000F9C00800F7F0822079C +CB04:000000007FD2111211122A9E4452041204127FD200000FFE08020802080207FE +CB05:000000007FD2111211122A9E4452041204127FD20000080208020FFE080207FE +CB06:000000007FD2111211122A9E4452041204127FD20000088808880F88089407E3 +CB07:000000007FD2111211122A9E4452041204127FD200000040004000A003180C06 +CB08:000000007FD2111211122A9E4452041204127FD20000020802080208051418E3 +CB09:000000007FD2111211122A9E4452041204127FD2000007FC08020802080207FC +CB0A:000000007FD2111211122A9E4452041204127FD200000FFE004000A003180C06 +CB0B:000000007FD2111211122A9E4452041204127FD2000001F000000FFE01100E0E +CB0C:000000007FD2111211122A9E4452041204127FD200000FFE00020FFE00020002 +CB0D:000000007FD2111211122A9E4452041204127FD200000FFE08000FFC080007FE +CB0E:000000007FD2111211122A9E4452041204127FD200000FFE0208020802080FFE +CB0F:000000007FD2111211122A9E4452041204127FD2000001F000000FFE040403F8 +CB10:0000000000047FC41104110411042A842A8444440404040404047FF400040004 +CB11:000000007FC4110411042A844444040404047FF400001FFC0004000400040004 +CB12:000000007FC4110411042A844444040404047FF400001F7C0104010401040104 +CB13:000000007FC4110411042A844444040404047FF400001F1001100110012801C6 +CB14:000000007FC4110411042A844444040404047FF4000410041000100010000FFC +CB15:000000007FC4110411042A844444040404047FF40000107C1010101010280FC6 +CB16:000000007FC4110411042A844444040404047FF400001038100010FE10440F38 +CB17:000000007FC4110411042A844444040404047FF400001FFC1000100010000FFC +CB18:000000007FC4110411042A844444040404047FF400001FFC00041FF810000FFC +CB19:000000007FC4110411042A844444040404047FF400001F7C01041E0410040F04 +CB1A:000000007FC4110411042A844444040404047FF400001F7C01441E4410440F3C +CB1B:000000007FC4110411042A844444040404047FF400001F4401441E7C10440F3C +CB1C:000000007FC4110411042A844444040404047FF400001F1001101E1010280FC6 +CB1D:000000007FC4110411042A844444040404047FF400001F7C01401E7C10400F3C +CB1E:000000007FC4110411042A844444040404047FF400001F7E01241E2410240F7E +CB1F:000000007FC4110411042A844444040404047FF400001F3801001EFE10440F38 +CB20:000000007FC4110411042A844444040404047FF400001FFC1004100410040FFC +CB21:000000007FC4110411042A844444040404047FF40000100410041FFC10040FFC +CB22:000000007FC4110411042A844444040404047FF40000111011101F1011280FC6 +CB23:000000007FC4110411042A844444040404047FF400000080008001400630180C +CB24:000000007FC4110411042A844444040404047FF400000410041004100A2831C6 +CB25:000000007FC4110411042A844444040404047FF400000FF81004100410040FF8 +CB26:000000007FC4110411042A844444040404047FF400001FFC008001400630180C +CB27:000000007FC4110411042A844444040404047FF4000003E000001FFC02201C1C +CB28:000000007FC4110411042A844444040404047FF400001FFC00041FFC00040004 +CB29:000000007FC4110411042A844444040404047FF400001FFC10001FF810000FFC +CB2A:000000007FC4110411042A844444040404047FF400001FFC0410041004101FFC +CB2B:000000007FC4110411042A844444040404047FF4000003E000001FFC080807F0 +CB2C:0000000000001F7C0410041004100A280A2811440220022002207FFF00000000 +CB2D:000000001F7C041004100A2831C6022002207FFF00001FFC0004000400040004 +CB2E:000000001F7C041004100A2831C6022002207FFF00001F7C0104010401040104 +CB2F:000000001F7C041004100A2831C6022002207FFF00001F1001100110012801C6 +CB30:000000001F7C041004100A2831C6022002207FFF000010001000100010000FFC +CB31:000000001F7C041004100A2831C6022002207FFF0000107C1010101010280FC6 +CB32:000000001F7C041004100A2831C6022002207FFF00001038100010FE10440F38 +CB33:000000001F7C041004100A2831C6022002207FFF00001FFC1000100010000FFC +CB34:000000001F7C041004100A2831C6022002207FFF00001FFC00041FF810000FFC +CB35:000000001F7C041004100A2831C6022002207FFF00001F7C01041E0410040F04 +CB36:000000001F7C041004100A2831C6022002207FFF00001F7C01441E4410440F3C +CB37:000000001F7C041004100A2831C6022002207FFF00001F4401441E7C10440F3C +CB38:000000001F7C041004100A2831C6022002207FFF00001F1001101E1010280FC6 +CB39:000000001F7C041004100A2831C6022002207FFF00001F7C01401E7C10400F3C +CB3A:000000001F7C041004100A2831C6022002207FFF00001F7E01241E2410240F7E +CB3B:000000001F7C041004100A2831C6022002207FFF00001F3801001EFE10440F38 +CB3C:000000001F7C041004100A2831C6022002207FFF00001FFC1004100410040FFC +CB3D:000000001F7C041004100A2831C6022002207FFF0000100410041FFC10040FFC +CB3E:000000001F7C041004100A2831C6022002207FFF0000111011101F1011280FC6 +CB3F:000000001F7C041004100A2831C6022002207FFF00000080008001400630180C +CB40:000000001F7C041004100A2831C6022002207FFF00000410041004100A2831C6 +CB41:000000001F7C041004100A2831C6022002207FFF00000FF81004100410040FF8 +CB42:000000001F7C041004100A2831C6022002207FFF00001FFC008001400630180C +CB43:000000001F7C041004100A2831C6022002207FFF000003E000001FFC02201C1C +CB44:000000001F7C041004100A2831C6022002207FFF00001FFC00041FFC00040004 +CB45:000000001F7C041004100A2831C6022002207FFF00001FFC10001FF810000FFC +CB46:000000001F7C041004100A2831C6022002207FFF00001FFC0410041004101FFC +CB47:000000001F7C041004100A2831C6022002207FFF000003E000001FFC080807F0 +CB48:000000001F7C041004100A2831C6000000007FFF008000800080008000800080 +CB49:000000001F7C041004100A2831C600007FFF008000801FFC0004000400040004 +CB4A:000000001F7C041004100A2831C600007FFF008000801F7C0104010401040104 +CB4B:000000001F7C041004100A2831C600007FFF008000801F1001100110012801C6 +CB4C:000000001F7C041004100A2831C6000000007FFF008010801080100010000FFC +CB4D:000000001F7C041004100A2831C600007FFF00800080107C1010101010280FC6 +CB4E:000000001F7C041004100A2831C600007FFF008000801038100010FE10440F38 +CB4F:000000001F7C041004100A2831C600007FFF008000801FFC1000100010000FFC +CB50:000000001F7C041004100A2831C600007FFF008000801FFC00041FF810000FFC +CB51:000000001F7C041004100A2831C600007FFF008000801F7C01041E0410040F04 +CB52:000000001F7C041004100A2831C600007FFF008000801F7C01441E4410440F3C +CB53:000000001F7C041004100A2831C600007FFF008000801F4401441E7C10440F3C +CB54:000000001F7C041004100A2831C600007FFF008000801F1001101E1010280FC6 +CB55:000000001F7C041004100A2831C600007FFF008000801F7C01401E7C10400F3C +CB56:000000001F7C041004100A2831C600007FFF008000801F7E01241E2410240F7E +CB57:000000001F7C041004100A2831C600007FFF008000801F3801001EFE10440F38 +CB58:000000001F7C041004100A2831C600007FFF008000801FFC1004100410040FFC +CB59:000000001F7C041004100A2831C600007FFF00800080100410041FFC10040FFC +CB5A:000000001F7C041004100A2831C600007FFF00800080111011101F1011280FC6 +CB5B:000000001F7C041004100A2831C600007FFF008000800080008001400630180C +CB5C:000000001F7C041004100A2831C600007FFF008000800410041004100A2831C6 +CB5D:000000001F7C041004100A2831C600007FFF008000800FF81004100410040FF8 +CB5E:000000001F7C041004100A2831C600007FFF008000801FFC008001400630180C +CB5F:000000001F7C041004100A2831C600007FFF0080008003E000001FFC02201C1C +CB60:000000001F7C041004100A2831C600007FFF008000801FFC00041FFC00040004 +CB61:000000001F7C041004100A2831C600007FFF008000801FFC10001FF810000FFC +CB62:000000001F7C041004100A2831C600007FFF008000801FFC0410041004101FFC +CB63:000000001F7C041004100A2831C600007FFF0080008003E000001FFC080807F0 +CB64:000000007FC4110411042A844444000400047FF404040404043C040404040404 +CB65:000000007FC4110411042A9C444400047FF4040404001FFC0004000400040004 +CB66:000000007FC4110411042A9C444400047FF4040404001F7C0104010401040104 +CB67:000000007FC4110411042A9C444400047FF4040404001F1001100110012801C6 +CB68:000000007FC4110411042A84444400047FF40404043C14041000100010000FFC +CB69:000000007FC4110411042A9C444400047FF404040400107C1010101010280FC6 +CB6A:000000007FC4110411042A9C444400047FF4040404001038100010FE10440F38 +CB6B:000000007FC4110411042A9C444400047FF4040404001FFC1000100010000FFC +CB6C:000000007FC4110411042A9C444400047FF4040404001FFC00041FF810000FFC +CB6D:000000007FC4110411042A9C444400047FF4040404001F7C01041E0410040F04 +CB6E:000000007FC4110411042A9C444400047FF4040404001F7C01441E4410440F3C +CB6F:000000007FC4110411042A9C444400047FF4040404001F4401441E7C10440F3C +CB70:000000007FC4110411042A9C444400047FF4040404001F1001101E1010280FC6 +CB71:000000007FC4110411042A9C444400047FF4040404001F7C01401E7C10400F3C +CB72:000000007FC4110411042A9C444400047FF4040404001F7E01241E2410240F7E +CB73:000000007FC4110411042A9C444400047FF4040404001F3801001EFE10440F38 +CB74:000000007FC4110411042A9C444400047FF4040404001FFC1004100410040FFC +CB75:000000007FC4110411042A9C444400047FF404040400100410041FFC10040FFC +CB76:000000007FC4110411042A9C444400047FF404040400111011101F1011280FC6 +CB77:000000007FC4110411042A9C444400047FF4040404000080008001400630180C +CB78:000000007FC4110411042A9C444400047FF4040404000410041004100A2831C6 +CB79:000000007FC4110411042A9C444400047FF4040404000FF81004100410040FF8 +CB7A:000000007FC4110411042A9C444400047FF4040404001FFC008001400630180C +CB7B:000000007FC4110411042A9C444400047FF40404040003E000001FFC02201C1C +CB7C:000000007FC4110411042A9C444400047FF4040404001FFC00041FFC00040004 +CB7D:000000007FC4110411042A9C444400047FF4040404001FFC10001FF810000FFC +CB7E:000000007FC4110411042A9C444400047FF4040404001FFC0410041004101FFC +CB7F:000000007FC4110411042A9C444400047FF40404040003E000001FFC080807F0 +CB80:000000007FD2111211122A924452001200127FD20412041204F2041204120412 +CB81:000000007FD2111211122AF2445200127FD2041204000FFE0002000200020002 +CB82:000000007FD2111211122AF2445200127FD2041204000FBE0082008200820082 +CB83:000000007FD2111211122AF2445200127FD2041204000F8800880088009400E3 +CB84:000000007FD2111211122A92445200127FD2021202F20A1208000800080007FE +CB85:000000007FD2111211122AF2445200127FD204120400083E08080808081407E3 +CB86:000000007FD2111211122AF2445200127FD204120400081C0800087F0822079C +CB87:000000007FD2111211122AF2445200127FD2041204000FFE08000800080007FE +CB88:000000007FD2111211122AF2445200127FD2041204000FFE00020FFC080007FE +CB89:000000007FD2111211122AF2445200127FD2041204000FBE00820F0208020782 +CB8A:000000007FD2111211122AF2445200127FD2041204000FBE00A20F220822079E +CB8B:000000007FD2111211122AF2445200127FD2041204000FA200A20F3E0822079E +CB8C:000000007FD2111211122AF2445200127FD2041204000F8800880F08081407E3 +CB8D:000000007FD2111211122AF2445200127FD2041204000FBE00A00F3E0820079E +CB8E:000000007FD2111211122AF2445200127FD2041204000FBF00920F12081207BF +CB8F:000000007FD2111211122AF2445200127FD2041204000F9C00800F7F0822079C +CB90:000000007FD2111211122AF2445200127FD2041204000FFE08020802080207FE +CB91:000000007FD2111211122AF2445200127FD204120400080208020FFE080207FE +CB92:000000007FD2111211122AF2445200127FD204120400088808880F88089407E3 +CB93:000000007FD2111211122AF2445200127FD2041204000040004000A003180C06 +CB94:000000007FD2111211122AF2445200127FD204120400020802080208051418E3 +CB95:000000007FD2111211122AF2445200127FD20412040007FC08020802080207FC +CB96:000000007FD2111211122AF2445200127FD2041204000FFE004000A003180C06 +CB97:000000007FD2111211122AF2445200127FD20412040001F000000FFE01100E0E +CB98:000000007FD2111211122AF2445200127FD2041204000FFE00020FFE00020002 +CB99:000000007FD2111211122AF2445200127FD2041204000FFE08000FFC080007FE +CB9A:000000007FD2111211122AF2445200127FD2041204000FFE0208020802080FFE +CB9B:000000007FD2111211122AF2445200127FD20412040001F000000FFE040403F8 +CB9C:000000007FC4110411042A844444000400047FF4040404040404040404040404 +CB9D:000000007FC4110411042A84444400047FF4040404001FFC0004000400040004 +CB9E:000000007FC4110411042A84444400047FF4040404001F7C0104010401040104 +CB9F:000000007FC4110411042A84444400047FF4040404001F1001100110012801C6 +CBA0:000000007FC4110411042A84444400047FF40404040414041000100010000FFC +CBA1:000000007FC4110411042A84444400047FF404040400107C1010101010280FC6 +CBA2:000000007FC4110411042A84444400047FF4040404001038100010FE10440F38 +CBA3:000000007FC4110411042A84444400047FF4040404001FFC1000100010000FFC +CBA4:000000007FC4110411042A84444400047FF4040404001FFC00041FF810000FFC +CBA5:000000007FC4110411042A84444400047FF4040404001F7C01041E0410040F04 +CBA6:000000007FC4110411042A84444400047FF4040404001F7C01441E4410440F3C +CBA7:000000007FC4110411042A84444400047FF4040404001F4401441E7C10440F3C +CBA8:000000007FC4110411042A84444400047FF4040404001F1001101E1010280FC6 +CBA9:000000007FC4110411042A84444400047FF4040404001F7C01401E7C10400F3C +CBAA:000000007FC4110411042A84444400047FF4040404001F7E01241E2410240F7E +CBAB:000000007FC4110411042A84444400047FF4040404001F3801001EFE10440F38 +CBAC:000000007FC4110411042A84444400047FF4040404001FFC1004100410040FFC +CBAD:000000007FC4110411042A84444400047FF404040400100410041FFC10040FFC +CBAE:000000007FC4110411042A84444400047FF404040400111011101F1011280FC6 +CBAF:000000007FC4110411042A84444400047FF4040404000080008001400630180C +CBB0:000000007FC4110411042A84444400047FF4040404000410041004100A2831C6 +CBB1:000000007FC4110411042A84444400047FF4040404000FF81004100410040FF8 +CBB2:000000007FC4110411042A84444400047FF4040404001FFC008001400630180C +CBB3:000000007FC4110411042A84444400047FF40404040003E000001FFC02201C1C +CBB4:000000007FC4110411042A84444400047FF4040404001FFC00041FFC00040004 +CBB5:000000007FC4110411042A84444400047FF4040404001FFC10001FF810000FFC +CBB6:000000007FC4110411042A84444400047FF4040404001FFC0410041004101FFC +CBB7:000000007FC4110411042A84444400047FF40404040003E000001FFC080807F0 +CBB8:000000001F7C041004100A2831C6000000007FFF041004100410041004100410 +CBB9:000000001F7C041004100A2831C600007FFF022002201FFC0004000400040004 +CBBA:000000001F7C041004100A2831C600007FFF022002201F7C0104010401040104 +CBBB:000000001F7C041004100A2831C600007FFF022002201F1001100110012801C6 +CBBC:000000001F7C041004100A2831C6000000007FFF022012201220100010000FFC +CBBD:000000001F7C041004100A2831C600007FFF02200220107C1010101010280FC6 +CBBE:000000001F7C041004100A2831C600007FFF022002201038100010FE10440F38 +CBBF:000000001F7C041004100A2831C600007FFF022002201FFC1000100010000FFC +CBC0:000000001F7C041004100A2831C600007FFF022002201FFC00041FF810000FFC +CBC1:000000001F7C041004100A2831C600007FFF022002201F7C01041E0410040F04 +CBC2:000000001F7C041004100A2831C600007FFF022002201F7C01441E4410440F3C +CBC3:000000001F7C041004100A2831C600007FFF022002201F4401441E7C10440F3C +CBC4:000000001F7C041004100A2831C600007FFF022002201F1001101E1010280FC6 +CBC5:000000001F7C041004100A2831C600007FFF022002201F7C01401E7C10400F3C +CBC6:000000001F7C041004100A2831C600007FFF022002201F7E01241E2410240F7E +CBC7:000000001F7C041004100A2831C600007FFF022002201F3801001EFE10440F38 +CBC8:000000001F7C041004100A2831C600007FFF022002201FFC1004100410040FFC +CBC9:000000001F7C041004100A2831C600007FFF02200220100410041FFC10040FFC +CBCA:000000001F7C041004100A2831C600007FFF02200220111011101F1011280FC6 +CBCB:000000001F7C041004100A2831C600007FFF022002200080008001400630180C +CBCC:000000001F7C041004100A2831C600007FFF022002200410041004100A2831C6 +CBCD:000000001F7C041004100A2831C600007FFF022002200FF81004100410040FF8 +CBCE:000000001F7C041004100A2831C600007FFF022002201FFC008001400630180C +CBCF:000000001F7C041004100A2831C600007FFF0220022003E000001FFC02201C1C +CBD0:000000001F7C041004100A2831C600007FFF022002201FFC00041FFC00040004 +CBD1:000000001F7C041004100A2831C600007FFF022002201FFC10001FF810000FFC +CBD2:000000001F7C041004100A2831C600007FFF022002201FFC0410041004101FFC +CBD3:000000001F7C041004100A2831C600007FFF0220022003E000001FFC080807F0 +CBD4:0000000000001F7C0410041004100A280A2811440000000000007FFF00000000 +CBD5:000000001F7C041004100A2831C600007FFF000000001FFC0004000400040004 +CBD6:000000001F7C041004100A2831C600007FFF000000001F7C0104010401040104 +CBD7:000000001F7C041004100A2831C600007FFF000000001F1001100110012801C6 +CBD8:000000001F7C041004100A2831C6000000007FFF000010001000100010000FFC +CBD9:000000001F7C041004100A2831C600007FFF00000000107C1010101010280FC6 +CBDA:000000001F7C041004100A2831C600007FFF000000001038100010FE10440F38 +CBDB:000000001F7C041004100A2831C600007FFF000000001FFC1000100010000FFC +CBDC:000000001F7C041004100A2831C600007FFF000000001FFC00041FF810000FFC +CBDD:000000001F7C041004100A2831C600007FFF000000001F7C01041E0410040F04 +CBDE:000000001F7C041004100A2831C600007FFF000000001F7C01441E4410440F3C +CBDF:000000001F7C041004100A2831C600007FFF000000001F4401441E7C10440F3C +CBE0:000000001F7C041004100A2831C600007FFF000000001F1001101E1010280FC6 +CBE1:000000001F7C041004100A2831C600007FFF000000001F7C01401E7C10400F3C +CBE2:000000001F7C041004100A2831C600007FFF000000001F7E01241E2410240F7E +CBE3:000000001F7C041004100A2831C600007FFF000000001F3801001EFE10440F38 +CBE4:000000001F7C041004100A2831C600007FFF000000001FFC1004100410040FFC +CBE5:000000001F7C041004100A2831C600007FFF00000000100410041FFC10040FFC +CBE6:000000001F7C041004100A2831C600007FFF00000000111011101F1011280FC6 +CBE7:000000001F7C041004100A2831C600007FFF000000000080008001400630180C +CBE8:000000001F7C041004100A2831C600007FFF000000000410041004100A2831C6 +CBE9:000000001F7C041004100A2831C600007FFF000000000FF81004100410040FF8 +CBEA:000000001F7C041004100A2831C600007FFF000000001FFC008001400630180C +CBEB:000000001F7C041004100A2831C600007FFF0000000003E000001FFC02201C1C +CBEC:000000001F7C041004100A2831C600007FFF000000001FFC00041FFC00040004 +CBED:000000001F7C041004100A2831C600007FFF000000001FFC10001FF810000FFC +CBEE:000000001F7C041004100A2831C600007FFF000000001FFC0410041004101FFC +CBEF:000000001F7C041004100A2831C600007FFF0000000003E000001FFC080807F0 +CBF0:0000000000047FC41104110411042A842A8444440004000400047FF400040004 +CBF1:000000007FC4110411042A84444400047FF4000400001FFC0004000400040004 +CBF2:000000007FC4110411042A84444400047FF4000400001F7C0104010401040104 +CBF3:000000007FC4110411042A84444400047FF4000400001F1001100110012801C6 +CBF4:000000007FC4110411042A844444000400047FF4000410041000100010000FFC +CBF5:000000007FC4110411042A84444400047FF400040000107C1010101010280FC6 +CBF6:000000007FC4110411042A84444400047FF4000400001038100010FE10440F38 +CBF7:000000007FC4110411042A84444400047FF4000400001FFC1000100010000FFC +CBF8:000000007FC4110411042A84444400047FF4000400001FFC00041FF810000FFC +CBF9:000000007FC4110411042A84444400047FF4000400001F7C01041E0410040F04 +CBFA:000000007FC4110411042A84444400047FF4000400001F7C01441E4410440F3C +CBFB:000000007FC4110411042A84444400047FF4000400001F4401441E7C10440F3C +CBFC:000000007FC4110411042A84444400047FF4000400001F1001101E1010280FC6 +CBFD:000000007FC4110411042A84444400047FF4000400001F7C01401E7C10400F3C +CBFE:000000007FC4110411042A84444400047FF4000400001F7E01241E2410240F7E +CBFF:000000007FC4110411042A84444400047FF4000400001F3801001EFE10440F38 +CC00:000000007FC4110411042A84444400047FF4000400001FFC1004100410040FFC +CC01:000000007FC4110411042A84444400047FF400040000100410041FFC10040FFC +CC02:000000007FC4110411042A84444400047FF400040000111011101F1011280FC6 +CC03:000000007FC4110411042A84444400047FF4000400000080008001400630180C +CC04:000000007FC4110411042A84444400047FF4000400000410041004100A2831C6 +CC05:000000007FC4110411042A84444400047FF4000400000FF81004100410040FF8 +CC06:000000007FC4110411042A84444400047FF4000400001FFC008001400630180C +CC07:000000007FC4110411042A84444400047FF40004000003E000001FFC02201C1C +CC08:000000007FC4110411042A84444400047FF4000400001FFC00041FFC00040004 +CC09:000000007FC4110411042A84444400047FF4000400001FFC10001FF810000FFC +CC0A:000000007FC4110411042A84444400047FF4000400001FFC0410041004101FFC +CC0B:000000007FC4110411042A84444400047FF40004000003E000001FFC080807F0 +CC0C:0000000000047FC4110411041104110411042A842A842A844444000400040004 +CC0D:000000007FC41104110411042A842A844444000400001FFC0004000400040004 +CC0E:000000007FC41104110411042A842A844444000400001F7C0104010401040104 +CC0F:000000007FC41104110411042A842A844444000400001F1001100110012801C6 +CC10:000000007FC41104110411042A842A8444440004000410041000100010000FFC +CC11:000000007FC41104110411042A842A84444400040000107C1010101010280FC6 +CC12:000000007FC41104110411042A842A844444000400001038100010FE10440F38 +CC13:000000007FC41104110411042A842A844444000400001FFC1000100010000FFC +CC14:000000007FC41104110411042A842A844444000400001FFC00041FF810000FFC +CC15:000000007FC41104110411042A842A844444000400001F7C01041E0410040F04 +CC16:000000007FC41104110411042A842A844444000400001F7C01441E4410440F3C +CC17:000000007FC41104110411042A842A844444000400001F4401441E7C10440F3C +CC18:000000007FC41104110411042A842A844444000400001F1001101E1010280FC6 +CC19:000000007FC41104110411042A842A844444000400001F7C01401E7C10400F3C +CC1A:000000007FC41104110411042A842A844444000400001F7E01241E2410240F7E +CC1B:000000007FC41104110411042A842A844444000400001F3801001EFE10440F38 +CC1C:000000007FC41104110411042A842A844444000400001FFC1004100410040FFC +CC1D:000000007FC41104110411042A842A84444400040000100410041FFC10040FFC +CC1E:000000007FC41104110411042A842A84444400040000111011101F1011280FC6 +CC1F:000000007FC41104110411042A842A844444000400000080008001400630180C +CC20:000000007FC41104110411042A842A844444000400000410041004100A2831C6 +CC21:000000007FC41104110411042A842A844444000400000FF81004100410040FF8 +CC22:000000007FC41104110411042A842A844444000400001FFC008001400630180C +CC23:000000007FC41104110411042A842A8444440004000003E000001FFC02201C1C +CC24:000000007FC41104110411042A842A844444000400001FFC00041FFC00040004 +CC25:000000007FC41104110411042A842A844444000400001FFC10001FF810000FFC +CC26:000000007FC41104110411042A842A844444000400001FFC0410041004101FFC +CC27:000000007FC41104110411042A842A8444440004000003E000001FFC080807F0 +CC28:0000000000041F0400043F84040404070A040A04110411042084000400040004 +CC29:000000001F0400043F8404070A0411042084000400001FFC0004000400040004 +CC2A:000000001F0400043F8404070A0411042084000400001F7C0104010401040104 +CC2B:000000001F0400043F8404070A0411042084000400001F1001100110012801C6 +CC2C:000000001F0400043F8404070A04110420840004000410041000100010000FFC +CC2D:000000001F0400043F8404070A041104208400040000107C1010101010280FC6 +CC2E:000000001F0400043F8404070A0411042084000400001038100010FE10440F38 +CC2F:000000001F0400043F8404070A0411042084000400001FFC1000100010000FFC +CC30:000000001F0400043F8404070A0411042084000400001FFC00041FF810000FFC +CC31:000000001F0400043F8404070A0411042084000400001F7C01041E0410040F04 +CC32:000000001F0400043F8404070A0411042084000400001F7C01441E4410440F3C +CC33:000000001F0400043F8404070A0411042084000400001F4401441E7C10440F3C +CC34:000000001F0400043F8404070A0411042084000400001F1001101E1010280FC6 +CC35:000000001F0400043F8404070A0411042084000400001F7C01401E7C10400F3C +CC36:000000001F0400043F8404070A0411042084000400001F7E01241E2410240F7E +CC37:000000001F0400043F8404070A0411042084000400001F3801001EFE10440F38 +CC38:000000001F0400043F8404070A0411042084000400001FFC1004100410040FFC +CC39:000000001F0400043F8404070A041104208400040000100410041FFC10040FFC +CC3A:000000001F0400043F8404070A041104208400040000111011101F1011280FC6 +CC3B:000000001F0400043F8404070A0411042084000400000080008001400630180C +CC3C:000000001F0400043F8404070A0411042084000400000410041004100A2831C6 +CC3D:000000001F0400043F8404070A0411042084000400000FF81004100410040FF8 +CC3E:000000001F0400043F8404070A0411042084000400001FFC008001400630180C +CC3F:000000001F0400043F8404070A04110420840004000003E000001FFC02201C1C +CC40:000000001F0400043F8404070A0411042084000400001FFC00041FFC00040004 +CC41:000000001F0400043F8404070A0411042084000400001FFC10001FF810000FFC +CC42:000000001F0400043F8404070A0411042084000400001FFC0410041004101FFC +CC43:000000001F0400043F8404070A04110420840004000003E000001FFC080807F0 +CC44:0000000000121F1200123F920412041E0A120A12111211122092001200120012 +CC45:000000001F1200123F92041E0A1211122092001200000FFE0002000200020002 +CC46:000000001F1200123F92041E0A1211122092001200000FBE0082008200820082 +CC47:000000001F1200123F92041E0A1211122092001200000F8800880088009400E3 +CC48:000000001F1200123F92041E0A121112209200120012081208000800080007FE +CC49:000000001F1200123F92041E0A121112209200120000083E08080808081407E3 +CC4A:000000001F1200123F92041E0A121112209200120000081C0800087F0822079C +CC4B:000000001F1200123F92041E0A1211122092001200000FFE08000800080007FE +CC4C:000000001F1200123F92041E0A1211122092001200000FFE00020FFC080007FE +CC4D:000000001F1200123F92041E0A1211122092001200000FBE00820F0208020782 +CC4E:000000001F1200123F92041E0A1211122092001200000FBE00A20F220822079E +CC4F:000000001F1200123F92041E0A1211122092001200000FA200A20F3E0822079E +CC50:000000001F1200123F92041E0A1211122092001200000F8800880F08081407E3 +CC51:000000001F1200123F92041E0A1211122092001200000FBE00A00F3E0820079E +CC52:000000001F1200123F92041E0A1211122092001200000FBF00920F12081207BF +CC53:000000001F1200123F92041E0A1211122092001200000F9C00800F7F0822079C +CC54:000000001F1200123F92041E0A1211122092001200000FFE08020802080207FE +CC55:000000001F1200123F92041E0A121112209200120000080208020FFE080207FE +CC56:000000001F1200123F92041E0A121112209200120000088808880F88089407E3 +CC57:000000001F1200123F92041E0A1211122092001200000040004000A003180C06 +CC58:000000001F1200123F92041E0A121112209200120000020802080208051418E3 +CC59:000000001F1200123F92041E0A12111220920012000007FC08020802080207FC +CC5A:000000001F1200123F92041E0A1211122092001200000FFE004000A003180C06 +CC5B:000000001F1200123F92041E0A12111220920012000001F000000FFE01100E0E +CC5C:000000001F1200123F92041E0A1211122092001200000FFE00020FFE00020002 +CC5D:000000001F1200123F92041E0A1211122092001200000FFE08000FFC080007FE +CC5E:000000001F1200123F92041E0A1211122092001200000FFE0208020802080FFE +CC5F:000000001F1200123F92041E0A12111220920012000001F000000FFE040403F8 +CC60:0000000000041F0400043F84040704040A040A07110411042084000400040004 +CC61:000000001F0400043F8704040A0411072084000400001FFC0004000400040004 +CC62:000000001F0400043F8704040A0411072084000400001F7C0104010401040104 +CC63:000000001F0400043F8704040A0411072084000400001F1001100110012801C6 +CC64:000000001F0400043F8704040A04110720840004000410041000100010000FFC +CC65:000000001F0400043F8704040A041107208400040000107C1010101010280FC6 +CC66:000000001F0400043F8704040A0411072084000400001038100010FE10440F38 +CC67:000000001F0400043F8704040A0411072084000400001FFC1000100010000FFC +CC68:000000001F0400043F8704040A0411072084000400001FFC00041FF810000FFC +CC69:000000001F0400043F8704040A0411072084000400001F7C01041E0410040F04 +CC6A:000000001F0400043F8704040A0411072084000400001F7C01441E4410440F3C +CC6B:000000001F0400043F8704040A0411072084000400001F4401441E7C10440F3C +CC6C:000000001F0400043F8704040A0411072084000400001F1001101E1010280FC6 +CC6D:000000001F0400043F8704040A0411072084000400001F7C01401E7C10400F3C +CC6E:000000001F0400043F8704040A0411072084000400001F7E01241E2410240F7E +CC6F:000000001F0400043F8704040A0411072084000400001F3801001EFE10440F38 +CC70:000000001F0400043F8704040A0411072084000400001FFC1004100410040FFC +CC71:000000001F0400043F8704040A041107208400040000100410041FFC10040FFC +CC72:000000001F0400043F8704040A041107208400040000111011101F1011280FC6 +CC73:000000001F0400043F8704040A0411072084000400000080008001400630180C +CC74:000000001F0400043F8704040A0411072084000400000410041004100A2831C6 +CC75:000000001F0400043F8704040A0411072084000400000FF81004100410040FF8 +CC76:000000001F0400043F8704040A0411072084000400001FFC008001400630180C +CC77:000000001F0400043F8704040A04110720840004000003E000001FFC02201C1C +CC78:000000001F0400043F8704040A0411072084000400001FFC00041FFC00040004 +CC79:000000001F0400043F8704040A0411072084000400001FFC10001FF810000FFC +CC7A:000000001F0400043F8704040A0411072084000400001FFC0410041004101FFC +CC7B:000000001F0400043F8704040A04110720840004000003E000001FFC080807F0 +CC7C:0000000000121F1200123F92041E04120A120A1E111211122092001200120012 +CC7D:000000001F1200123F9E04120A12111E2092001200000FFE0002000200020002 +CC7E:000000001F1200123F9E04120A12111E2092001200000FBE0082008200820082 +CC7F:000000001F1200123F9E04120A12111E2092001200000F8800880088009400E3 +CC80:000000001F1200123F9E04120A12111E209200120012081208000800080007FE +CC81:000000001F1200123F9E04120A12111E209200120000083E08080808081407E3 +CC82:000000001F1200123F9E04120A12111E209200120000081C0800087F0822079C +CC83:000000001F1200123F9E04120A12111E2092001200000FFE08000800080007FE +CC84:000000001F1200123F9E04120A12111E2092001200000FFE00020FFC080007FE +CC85:000000001F1200123F9E04120A12111E2092001200000FBE00820F0208020782 +CC86:000000001F1200123F9E04120A12111E2092001200000FBE00A20F220822079E +CC87:000000001F1200123F9E04120A12111E2092001200000FA200A20F3E0822079E +CC88:000000001F1200123F9E04120A12111E2092001200000F8800880F08081407E3 +CC89:000000001F1200123F9E04120A12111E2092001200000FBE00A00F3E0820079E +CC8A:000000001F1200123F9E04120A12111E2092001200000FBF00920F12081207BF +CC8B:000000001F1200123F9E04120A12111E2092001200000F9C00800F7F0822079C +CC8C:000000001F1200123F9E04120A12111E2092001200000FFE08020802080207FE +CC8D:000000001F1200123F9E04120A12111E209200120000080208020FFE080207FE +CC8E:000000001F1200123F9E04120A12111E209200120000088808880F88089407E3 +CC8F:000000001F1200123F9E04120A12111E2092001200000040004000A003180C06 +CC90:000000001F1200123F9E04120A12111E209200120000020802080208051418E3 +CC91:000000001F1200123F9E04120A12111E20920012000007FC08020802080207FC +CC92:000000001F1200123F9E04120A12111E2092001200000FFE004000A003180C06 +CC93:000000001F1200123F9E04120A12111E20920012000001F000000FFE01100E0E +CC94:000000001F1200123F9E04120A12111E2092001200000FFE00020FFE00020002 +CC95:000000001F1200123F9E04120A12111E2092001200000FFE08000FFC080007FE +CC96:000000001F1200123F9E04120A12111E2092001200000FFE0208020802080FFE +CC97:000000001F1200123F9E04120A12111E20920012000001F000000FFE040403F8 +CC98:0000000000041F0400043F840404043C0A040A04110411042084000400040004 +CC99:000000001F0400043F84043C0A0411042084000400001FFC0004000400040004 +CC9A:000000001F0400043F84043C0A0411042084000400001F7C0104010401040104 +CC9B:000000001F0400043F84043C0A0411042084000400001F1001100110012801C6 +CC9C:000000001F0400043F84043C0A04110420840004000410041000100010000FFC +CC9D:000000001F0400043F84043C0A041104208400040000107C1010101010280FC6 +CC9E:000000001F0400043F84043C0A0411042084000400001038100010FE10440F38 +CC9F:000000001F0400043F84043C0A0411042084000400001FFC1000100010000FFC +CCA0:000000001F0400043F84043C0A0411042084000400001FFC00041FF810000FFC +CCA1:000000001F0400043F84043C0A0411042084000400001F7C01041E0410040F04 +CCA2:000000001F0400043F84043C0A0411042084000400001F7C01441E4410440F3C +CCA3:000000001F0400043F84043C0A0411042084000400001F4401441E7C10440F3C +CCA4:000000001F0400043F84043C0A0411042084000400001F1001101E1010280FC6 +CCA5:000000001F0400043F84043C0A0411042084000400001F7C01401E7C10400F3C +CCA6:000000001F0400043F84043C0A0411042084000400001F7E01241E2410240F7E +CCA7:000000001F0400043F84043C0A0411042084000400001F3801001EFE10440F38 +CCA8:000000001F0400043F84043C0A0411042084000400001FFC1004100410040FFC +CCA9:000000001F0400043F84043C0A041104208400040000100410041FFC10040FFC +CCAA:000000001F0400043F84043C0A041104208400040000111011101F1011280FC6 +CCAB:000000001F0400043F84043C0A0411042084000400000080008001400630180C +CCAC:000000001F0400043F84043C0A0411042084000400000410041004100A2831C6 +CCAD:000000001F0400043F84043C0A0411042084000400000FF81004100410040FF8 +CCAE:000000001F0400043F84043C0A0411042084000400001FFC008001400630180C +CCAF:000000001F0400043F84043C0A04110420840004000003E000001FFC02201C1C +CCB0:000000001F0400043F84043C0A0411042084000400001FFC00041FFC00040004 +CCB1:000000001F0400043F84043C0A0411042084000400001FFC10001FF810000FFC +CCB2:000000001F0400043F84043C0A0411042084000400001FFC0410041004101FFC +CCB3:000000001F0400043F84043C0A04110420840004000003E000001FFC080807F0 +CCB4:0000000000121F1200123F92041204720A120A12111211122092001200120012 +CCB5:000000001F1200123F9204720A1211122092001200000FFE0002000200020002 +CCB6:000000001F1200123F9204720A1211122092001200000FBE0082008200820082 +CCB7:000000001F1200123F9204720A1211122092001200000F8800880088009400E3 +CCB8:000000001F1200123F9204720A121112209200120012081208000800080007FE +CCB9:000000001F1200123F9204720A121112209200120000083E08080808081407E3 +CCBA:000000001F1200123F9204720A121112209200120000081C0800087F0822079C +CCBB:000000001F1200123F9204720A1211122092001200000FFE08000800080007FE +CCBC:000000001F1200123F9204720A1211122092001200000FFE00020FFC080007FE +CCBD:000000001F1200123F9204720A1211122092001200000FBE00820F0208020782 +CCBE:000000001F1200123F9204720A1211122092001200000FBE00A20F220822079E +CCBF:000000001F1200123F9204720A1211122092001200000FA200A20F3E0822079E +CCC0:000000001F1200123F9204720A1211122092001200000F8800880F08081407E3 +CCC1:000000001F1200123F9204720A1211122092001200000FBE00A00F3E0820079E +CCC2:000000001F1200123F9204720A1211122092001200000FBF00920F12081207BF +CCC3:000000001F1200123F9204720A1211122092001200000F9C00800F7F0822079C +CCC4:000000001F1200123F9204720A1211122092001200000FFE08020802080207FE +CCC5:000000001F1200123F9204720A121112209200120000080208020FFE080207FE +CCC6:000000001F1200123F9204720A121112209200120000088808880F88089407E3 +CCC7:000000001F1200123F9204720A1211122092001200000040004000A003180C06 +CCC8:000000001F1200123F9204720A121112209200120000020802080208051418E3 +CCC9:000000001F1200123F9204720A12111220920012000007FC08020802080207FC +CCCA:000000001F1200123F9204720A1211122092001200000FFE004000A003180C06 +CCCB:000000001F1200123F9204720A12111220920012000001F000000FFE01100E0E +CCCC:000000001F1200123F9204720A1211122092001200000FFE00020FFE00020002 +CCCD:000000001F1200123F9204720A1211122092001200000FFE08000FFC080007FE +CCCE:000000001F1200123F9204720A1211122092001200000FFE0208020802080FFE +CCCF:000000001F1200123F9204720A12111220920012000001F000000FFE040403F8 +CCD0:0000000000041F0400043F84043C04040A040A3C110411042084000400040004 +CCD1:000000001F0400043FBC04040A04113C2084000400001FFC0004000400040004 +CCD2:000000001F0400043FBC04040A04113C2084000400001F7C0104010401040104 +CCD3:000000001F0400043FBC04040A04113C2084000400001F1001100110012801C6 +CCD4:000000001F0400043FBC04040A04113C20840004000410041000100010000FFC +CCD5:000000001F0400043FBC04040A04113C208400040000107C1010101010280FC6 +CCD6:000000001F0400043FBC04040A04113C2084000400001038100010FE10440F38 +CCD7:000000001F0400043FBC04040A04113C2084000400001FFC1000100010000FFC +CCD8:000000001F0400043FBC04040A04113C2084000400001FFC00041FF810000FFC +CCD9:000000001F0400043FBC04040A04113C2084000400001F7C01041E0410040F04 +CCDA:000000001F0400043FBC04040A04113C2084000400001F7C01441E4410440F3C +CCDB:000000001F0400043FBC04040A04113C2084000400001F4401441E7C10440F3C +CCDC:000000001F0400043FBC04040A04113C2084000400001F1001101E1010280FC6 +CCDD:000000001F0400043FBC04040A04113C2084000400001F7C01401E7C10400F3C +CCDE:000000001F0400043FBC04040A04113C2084000400001F7E01241E2410240F7E +CCDF:000000001F0400043FBC04040A04113C2084000400001F3801001EFE10440F38 +CCE0:000000001F0400043FBC04040A04113C2084000400001FFC1004100410040FFC +CCE1:000000001F0400043FBC04040A04113C208400040000100410041FFC10040FFC +CCE2:000000001F0400043FBC04040A04113C208400040000111011101F1011280FC6 +CCE3:000000001F0400043FBC04040A04113C2084000400000080008001400630180C +CCE4:000000001F0400043FBC04040A04113C2084000400000410041004100A2831C6 +CCE5:000000001F0400043FBC04040A04113C2084000400000FF81004100410040FF8 +CCE6:000000001F0400043FBC04040A04113C2084000400001FFC008001400630180C +CCE7:000000001F0400043FBC04040A04113C20840004000003E000001FFC02201C1C +CCE8:000000001F0400043FBC04040A04113C2084000400001FFC00041FFC00040004 +CCE9:000000001F0400043FBC04040A04113C2084000400001FFC10001FF810000FFC +CCEA:000000001F0400043FBC04040A04113C2084000400001FFC0410041004101FFC +CCEB:000000001F0400043FBC04040A04113C20840004000003E000001FFC080807F0 +CCEC:0000000000121F1200123F92047204120A120A72111211122092001200120012 +CCED:000000001F1200123FF204120A1211722092001200000FFE0002000200020002 +CCEE:000000001F1200123FF204120A1211722092001200000FBE0082008200820082 +CCEF:000000001F1200123FF204120A1211722092001200000F8800880088009400E3 +CCF0:000000001F1200123FF204120A121172209200120012081208000800080007FE +CCF1:000000001F1200123FF204120A121172209200120000083E08080808081407E3 +CCF2:000000001F1200123FF204120A121172209200120000081C0800087F0822079C +CCF3:000000001F1200123FF204120A1211722092001200000FFE08000800080007FE +CCF4:000000001F1200123FF204120A1211722092001200000FFE00020FFC080007FE +CCF5:000000001F1200123FF204120A1211722092001200000FBE00820F0208020782 +CCF6:000000001F1200123FF204120A1211722092001200000FBE00A20F220822079E +CCF7:000000001F1200123FF204120A1211722092001200000FA200A20F3E0822079E +CCF8:000000001F1200123FF204120A1211722092001200000F8800880F08081407E3 +CCF9:000000001F1200123FF204120A1211722092001200000FBE00A00F3E0820079E +CCFA:000000001F1200123FF204120A1211722092001200000FBF00920F12081207BF +CCFB:000000001F1200123FF204120A1211722092001200000F9C00800F7F0822079C +CCFC:000000001F1200123FF204120A1211722092001200000FFE08020802080207FE +CCFD:000000001F1200123FF204120A121172209200120000080208020FFE080207FE +CCFE:000000001F1200123FF204120A121172209200120000088808880F88089407E3 +CCFF:000000001F1200123FF204120A1211722092001200000040004000A003180C06 +CD00:000000001F1200123FF204120A121172209200120000020802080208051418E3 +CD01:000000001F1200123FF204120A12117220920012000007FC08020802080207FC +CD02:000000001F1200123FF204120A1211722092001200000FFE004000A003180C06 +CD03:000000001F1200123FF204120A12117220920012000001F000000FFE01100E0E +CD04:000000001F1200123FF204120A1211722092001200000FFE00020FFE00020002 +CD05:000000001F1200123FF204120A1211722092001200000FFE08000FFC080007FE +CD06:000000001F1200123FF204120A1211722092001200000FFE0208020802080FFE +CD07:000000001F1200123FF204120A12117220920012000001F000000FFE040403F8 +CD08:00000000000003E000001FFC008001400630180C0080008000807FFF00000000 +CD09:0000000000801FFC01400630180C008000807FFF00001FFC0004000400040004 +CD0A:0000000000801FFC01400630180C008000807FFF00001F7C0104010401040104 +CD0B:0000000000801FFC01400630180C008000807FFF00001F1001100110012801C6 +CD0C:0000000000801FFC01400630180C008000807FFF000010001000100010000FFC +CD0D:0000000000801FFC01400630180C008000807FFF0000107C1010101010280FC6 +CD0E:0000000000801FFC01400630180C008000807FFF00001038100010FE10440F38 +CD0F:0000000000801FFC01400630180C008000807FFF00001FFC1000100010000FFC +CD10:0000000000801FFC01400630180C008000807FFF00001FFC00041FF810000FFC +CD11:0000000000801FFC01400630180C008000807FFF00001F7C01041E0410040F04 +CD12:0000000000801FFC01400630180C008000807FFF00001F7C01441E4410440F3C +CD13:0000000000801FFC01400630180C008000807FFF00001F4401441E7C10440F3C +CD14:0000000000801FFC01400630180C008000807FFF00001F1001101E1010280FC6 +CD15:0000000000801FFC01400630180C008000807FFF00001F7C01401E7C10400F3C +CD16:0000000000801FFC01400630180C008000807FFF00001F7E01241E2410240F7E +CD17:0000000000801FFC01400630180C008000807FFF00001F3801001EFE10440F38 +CD18:0000000000801FFC01400630180C008000807FFF00001FFC1004100410040FFC +CD19:0000000000801FFC01400630180C008000807FFF0000100410041FFC10040FFC +CD1A:0000000000801FFC01400630180C008000807FFF0000111011101F1011280FC6 +CD1B:0000000000801FFC01400630180C008000807FFF00000080008001400630180C +CD1C:0000000000801FFC01400630180C008000807FFF00000410041004100A2831C6 +CD1D:0000000000801FFC01400630180C008000807FFF00000FF81004100410040FF8 +CD1E:0000000000801FFC01400630180C008000807FFF00001FFC008001400630180C +CD1F:0000000000801FFC01400630180C008000807FFF000003E000001FFC02201C1C +CD20:0000000000801FFC01400630180C008000807FFF00001FFC00041FFC00040004 +CD21:0000000000801FFC01400630180C008000807FFF00001FFC10001FF810000FFC +CD22:0000000000801FFC01400630180C008000807FFF00001FFC0410041004101FFC +CD23:0000000000801FFC01400630180C008000807FFF000003E000001FFC080807F0 +CD24:0000000000041F0400043F8404040A07110420840404040404047FF400040004 +CD25:0000000004043F840A0411072084040404047FF400001FFC0004000400040004 +CD26:0000000004043F840A0411072084040404047FF400001F7C0104010401040104 +CD27:0000000004043F840A0411072084040404047FF400001F1001100110012801C6 +CD28:0000000004043F840A0411072084040404047FF4000410041000100010000FFC +CD29:0000000004043F840A0411072084040404047FF40000107C1010101010280FC6 +CD2A:0000000004043F840A0411072084040404047FF400001038100010FE10440F38 +CD2B:0000000004043F840A0411072084040404047FF400001FFC1000100010000FFC +CD2C:0000000004043F840A0411072084040404047FF400001FFC00041FF810000FFC +CD2D:0000000004043F840A0411072084040404047FF400001F7C01041E0410040F04 +CD2E:0000000004043F840A0411072084040404047FF400001F7C01441E4410440F3C +CD2F:0000000004043F840A0411072084040404047FF400001F4401441E7C10440F3C +CD30:0000000004043F840A0411072084040404047FF400001F1001101E1010280FC6 +CD31:0000000004043F840A0411072084040404047FF400001F7C01401E7C10400F3C +CD32:0000000004043F840A0411072084040404047FF400001F7E01241E2410240F7E +CD33:0000000004043F840A0411072084040404047FF400001F3801001EFE10440F38 +CD34:0000000004043F840A0411072084040404047FF400001FFC1004100410040FFC +CD35:0000000004043F840A0411072084040404047FF40000100410041FFC10040FFC +CD36:0000000004043F840A0411072084040404047FF40000111011101F1011280FC6 +CD37:0000000004043F840A0411072084040404047FF400000080008001400630180C +CD38:0000000004043F840A0411072084040404047FF400000410041004100A2831C6 +CD39:0000000004043F840A0411072084040404047FF400000FF81004100410040FF8 +CD3A:0000000004043F840A0411072084040404047FF400001FFC008001400630180C +CD3B:0000000004043F840A0411072084040404047FF4000003E000001FFC02201C1C +CD3C:0000000004043F840A0411072084040404047FF400001FFC00041FFC00040004 +CD3D:0000000004043F840A0411072084040404047FF400001FFC10001FF810000FFC +CD3E:0000000004043F840A0411072084040404047FF400001FFC0410041004101FFC +CD3F:0000000004043F840A0411072084040404047FF4000003E000001FFC080807F0 +CD40:0000000000121F1200123F9204120A1E111220920412041204127FD200120012 +CD41:0000000004123F920A12111E2092041204127FD200000FFE0002000200020002 +CD42:0000000004123F920A12111E2092041204127FD200000FBE0082008200820082 +CD43:0000000004123F920A12111E2092041204127FD200000F8800880088009400E3 +CD44:0000000004123F920A12111E2092041204127FD20012081208000800080007FE +CD45:0000000004123F920A12111E2092041204127FD20000083E08080808081407E3 +CD46:0000000004123F920A12111E2092041204127FD20000081C0800087F0822079C +CD47:0000000004123F920A12111E2092041204127FD200000FFE08000800080007FE +CD48:0000000004123F920A12111E2092041204127FD200000FFE00020FFC080007FE +CD49:0000000004123F920A12111E2092041204127FD200000FBE00820F0208020782 +CD4A:0000000004123F920A12111E2092041204127FD200000FBE00A20F220822079E +CD4B:0000000004123F920A12111E2092041204127FD200000FA200A20F3E0822079E +CD4C:0000000004123F920A12111E2092041204127FD200000F8800880F08081407E3 +CD4D:0000000004123F920A12111E2092041204127FD200000FBE00A00F3E0820079E +CD4E:0000000004123F920A12111E2092041204127FD200000FBF00920F12081207BF +CD4F:0000000004123F920A12111E2092041204127FD200000F9C00800F7F0822079C +CD50:0000000004123F920A12111E2092041204127FD200000FFE08020802080207FE +CD51:0000000004123F920A12111E2092041204127FD20000080208020FFE080207FE +CD52:0000000004123F920A12111E2092041204127FD20000088808880F88089407E3 +CD53:0000000004123F920A12111E2092041204127FD200000040004000A003180C06 +CD54:0000000004123F920A12111E2092041204127FD20000020802080208051418E3 +CD55:0000000004123F920A12111E2092041204127FD2000007FC08020802080207FC +CD56:0000000004123F920A12111E2092041204127FD200000FFE004000A003180C06 +CD57:0000000004123F920A12111E2092041204127FD2000001F000000FFE01100E0E +CD58:0000000004123F920A12111E2092041204127FD200000FFE00020FFE00020002 +CD59:0000000004123F920A12111E2092041204127FD200000FFE08000FFC080007FE +CD5A:0000000004123F920A12111E2092041204127FD200000FFE0208020802080FFE +CD5B:0000000004123F920A12111E2092041204127FD2000001F000000FFE040403F8 +CD5C:0000000000041F0400043F8404040A04110420840404040404047FF400040004 +CD5D:0000000004043F840A0411042084040404047FF400001FFC0004000400040004 +CD5E:0000000004043F840A0411042084040404047FF400001F7C0104010401040104 +CD5F:0000000004043F840A0411042084040404047FF400001F1001100110012801C6 +CD60:0000000004043F840A0411042084040404047FF4000410041000100010000FFC +CD61:0000000004043F840A0411042084040404047FF40000107C1010101010280FC6 +CD62:0000000004043F840A0411042084040404047FF400001038100010FE10440F38 +CD63:0000000004043F840A0411042084040404047FF400001FFC1000100010000FFC +CD64:0000000004043F840A0411042084040404047FF400001FFC00041FF810000FFC +CD65:0000000004043F840A0411042084040404047FF400001F7C01041E0410040F04 +CD66:0000000004043F840A0411042084040404047FF400001F7C01441E4410440F3C +CD67:0000000004043F840A0411042084040404047FF400001F4401441E7C10440F3C +CD68:0000000004043F840A0411042084040404047FF400001F1001101E1010280FC6 +CD69:0000000004043F840A0411042084040404047FF400001F7C01401E7C10400F3C +CD6A:0000000004043F840A0411042084040404047FF400001F7E01241E2410240F7E +CD6B:0000000004043F840A0411042084040404047FF400001F3801001EFE10440F38 +CD6C:0000000004043F840A0411042084040404047FF400001FFC1004100410040FFC +CD6D:0000000004043F840A0411042084040404047FF40000100410041FFC10040FFC +CD6E:0000000004043F840A0411042084040404047FF40000111011101F1011280FC6 +CD6F:0000000004043F840A0411042084040404047FF400000080008001400630180C +CD70:0000000004043F840A0411042084040404047FF400000410041004100A2831C6 +CD71:0000000004043F840A0411042084040404047FF400000FF81004100410040FF8 +CD72:0000000004043F840A0411042084040404047FF400001FFC008001400630180C +CD73:0000000004043F840A0411042084040404047FF4000003E000001FFC02201C1C +CD74:0000000004043F840A0411042084040404047FF400001FFC00041FFC00040004 +CD75:0000000004043F840A0411042084040404047FF400001FFC10001FF810000FFC +CD76:0000000004043F840A0411042084040404047FF400001FFC0410041004101FFC +CD77:0000000004043F840A0411042084040404047FF4000003E000001FFC080807F0 +CD78:00000000000003E000001FFC008001400630180C0220022002207FFF00000000 +CD79:0000000000801FFC01400630180C022002207FFF00001FFC0004000400040004 +CD7A:0000000000801FFC01400630180C022002207FFF00001F7C0104010401040104 +CD7B:0000000000801FFC01400630180C022002207FFF00001F1001100110012801C6 +CD7C:0000000000801FFC01400630180C022002207FFF000010001000100010000FFC +CD7D:0000000000801FFC01400630180C022002207FFF0000107C1010101010280FC6 +CD7E:0000000000801FFC01400630180C022002207FFF00001038100010FE10440F38 +CD7F:0000000000801FFC01400630180C022002207FFF00001FFC1000100010000FFC +CD80:0000000000801FFC01400630180C022002207FFF00001FFC00041FF810000FFC +CD81:0000000000801FFC01400630180C022002207FFF00001F7C01041E0410040F04 +CD82:0000000000801FFC01400630180C022002207FFF00001F7C01441E4410440F3C +CD83:0000000000801FFC01400630180C022002207FFF00001F4401441E7C10440F3C +CD84:0000000000801FFC01400630180C022002207FFF00001F1001101E1010280FC6 +CD85:0000000000801FFC01400630180C022002207FFF00001F7C01401E7C10400F3C +CD86:0000000000801FFC01400630180C022002207FFF00001F7E01241E2410240F7E +CD87:0000000000801FFC01400630180C022002207FFF00001F3801001EFE10440F38 +CD88:0000000000801FFC01400630180C022002207FFF00001FFC1004100410040FFC +CD89:0000000000801FFC01400630180C022002207FFF0000100410041FFC10040FFC +CD8A:0000000000801FFC01400630180C022002207FFF0000111011101F1011280FC6 +CD8B:0000000000801FFC01400630180C022002207FFF00000080008001400630180C +CD8C:0000000000801FFC01400630180C022002207FFF00000410041004100A2831C6 +CD8D:0000000000801FFC01400630180C022002207FFF00000FF81004100410040FF8 +CD8E:0000000000801FFC01400630180C022002207FFF00001FFC008001400630180C +CD8F:0000000000801FFC01400630180C022002207FFF000003E000001FFC02201C1C +CD90:0000000000801FFC01400630180C022002207FFF00001FFC00041FFC00040004 +CD91:0000000000801FFC01400630180C022002207FFF00001FFC10001FF810000FFC +CD92:0000000000801FFC01400630180C022002207FFF00001FFC0410041004101FFC +CD93:0000000000801FFC01400630180C022002207FFF000003E000001FFC080807F0 +CD94:0000000000801FFC01400630180C000000007FFF008000800080008000800080 +CD95:0000000000801FFC01400630180C00007FFF008000801FFC0004000400040004 +CD96:0000000000801FFC01400630180C00007FFF008000801F7C0104010401040104 +CD97:0000000000801FFC01400630180C00007FFF008000801F1001100110012801C6 +CD98:0000000000801FFC01400630180C000000007FFF008010801080100010000FFC +CD99:0000000000801FFC01400630180C00007FFF00800080107C1010101010280FC6 +CD9A:0000000000801FFC01400630180C00007FFF008000801038100010FE10440F38 +CD9B:0000000000801FFC01400630180C00007FFF008000801FFC1000100010000FFC +CD9C:0000000000801FFC01400630180C00007FFF008000801FFC00041FF810000FFC +CD9D:0000000000801FFC01400630180C00007FFF008000801F7C01041E0410040F04 +CD9E:0000000000801FFC01400630180C00007FFF008000801F7C01441E4410440F3C +CD9F:0000000000801FFC01400630180C00007FFF008000801F4401441E7C10440F3C +CDA0:0000000000801FFC01400630180C00007FFF008000801F1001101E1010280FC6 +CDA1:0000000000801FFC01400630180C00007FFF008000801F7C01401E7C10400F3C +CDA2:0000000000801FFC01400630180C00007FFF008000801F7E01241E2410240F7E +CDA3:0000000000801FFC01400630180C00007FFF008000801F3801001EFE10440F38 +CDA4:0000000000801FFC01400630180C00007FFF008000801FFC1004100410040FFC +CDA5:0000000000801FFC01400630180C00007FFF00800080100410041FFC10040FFC +CDA6:0000000000801FFC01400630180C00007FFF00800080111011101F1011280FC6 +CDA7:0000000000801FFC01400630180C00007FFF008000800080008001400630180C +CDA8:0000000000801FFC01400630180C00007FFF008000800410041004100A2831C6 +CDA9:0000000000801FFC01400630180C00007FFF008000800FF81004100410040FF8 +CDAA:0000000000801FFC01400630180C00007FFF008000801FFC008001400630180C +CDAB:0000000000801FFC01400630180C00007FFF0080008003E000001FFC02201C1C +CDAC:0000000000801FFC01400630180C00007FFF008000801FFC00041FFC00040004 +CDAD:0000000000801FFC01400630180C00007FFF008000801FFC10001FF810000FFC +CDAE:0000000000801FFC01400630180C00007FFF008000801FFC0410041004101FFC +CDAF:0000000000801FFC01400630180C00007FFF0080008003E000001FFC080807F0 +CDB0:0000000004043F840A0411042084000400047FF404040404043C040404040404 +CDB1:0000000004043F840A04111C208400047FF4040404001FFC0004000400040004 +CDB2:0000000004043F840A04111C208400047FF4040404001F7C0104010401040104 +CDB3:0000000004043F840A04111C208400047FF4040404001F1001100110012801C6 +CDB4:0000000004043F840A041104208400047FF40404043C14041000100010000FFC +CDB5:0000000004043F840A04111C208400047FF404040400107C1010101010280FC6 +CDB6:0000000004043F840A04111C208400047FF4040404001038100010FE10440F38 +CDB7:0000000004043F840A04111C208400047FF4040404001FFC1000100010000FFC +CDB8:0000000004043F840A04111C208400047FF4040404001FFC00041FF810000FFC +CDB9:0000000004043F840A04111C208400047FF4040404001F7C01041E0410040F04 +CDBA:0000000004043F840A04111C208400047FF4040404001F7C01441E4410440F3C +CDBB:0000000004043F840A04111C208400047FF4040404001F4401441E7C10440F3C +CDBC:0000000004043F840A04111C208400047FF4040404001F1001101E1010280FC6 +CDBD:0000000004043F840A04111C208400047FF4040404001F7C01401E7C10400F3C +CDBE:0000000004043F840A04111C208400047FF4040404001F7E01241E2410240F7E +CDBF:0000000004043F840A04111C208400047FF4040404001F3801001EFE10440F38 +CDC0:0000000004043F840A04111C208400047FF4040404001FFC1004100410040FFC +CDC1:0000000004043F840A04111C208400047FF404040400100410041FFC10040FFC +CDC2:0000000004043F840A04111C208400047FF404040400111011101F1011280FC6 +CDC3:0000000004043F840A04111C208400047FF4040404000080008001400630180C +CDC4:0000000004043F840A04111C208400047FF4040404000410041004100A2831C6 +CDC5:0000000004043F840A04111C208400047FF4040404000FF81004100410040FF8 +CDC6:0000000004043F840A04111C208400047FF4040404001FFC008001400630180C +CDC7:0000000004043F840A04111C208400047FF40404040003E000001FFC02201C1C +CDC8:0000000004043F840A04111C208400047FF4040404001FFC00041FFC00040004 +CDC9:0000000004043F840A04111C208400047FF4040404001FFC10001FF810000FFC +CDCA:0000000004043F840A04111C208400047FF4040404001FFC0410041004101FFC +CDCB:0000000004043F840A04111C208400047FF40404040003E000001FFC080807F0 +CDCC:0000000004123F920A1211122092001200127FD20412041204F2041204120412 +CDCD:0000000004123F920A121172209200127FD2041204000FFE0002000200020002 +CDCE:0000000004123F920A121172209200127FD2041204000FBE0082008200820082 +CDCF:0000000004123F920A121172209200127FD2041204000F8800880088009400E3 +CDD0:0000000004123F920A121112209200127FD2021202F20A1208000800080007FE +CDD1:0000000004123F920A121172209200127FD204120400083E08080808081407E3 +CDD2:0000000004123F920A121172209200127FD204120400081C0800087F0822079C +CDD3:0000000004123F920A121172209200127FD2041204000FFE08000800080007FE +CDD4:0000000004123F920A121172209200127FD2041204000FFE00020FFC080007FE +CDD5:0000000004123F920A121172209200127FD2041204000FBE00820F0208020782 +CDD6:0000000004123F920A121172209200127FD2041204000FBE00A20F220822079E +CDD7:0000000004123F920A121172209200127FD2041204000FA200A20F3E0822079E +CDD8:0000000004123F920A121172209200127FD2041204000F8800880F08081407E3 +CDD9:0000000004123F920A121172209200127FD2041204000FBE00A00F3E0820079E +CDDA:0000000004123F920A121172209200127FD2041204000FBF00920F12081207BF +CDDB:0000000004123F920A121172209200127FD2041204000F9C00800F7F0822079C +CDDC:0000000004123F920A121172209200127FD2041204000FFE08020802080207FE +CDDD:0000000004123F920A121172209200127FD204120400080208020FFE080207FE +CDDE:0000000004123F920A121172209200127FD204120400088808880F88089407E3 +CDDF:0000000004123F920A121172209200127FD2041204000040004000A003180C06 +CDE0:0000000004123F920A121172209200127FD204120400020802080208051418E3 +CDE1:0000000004123F920A121172209200127FD20412040007FC08020802080207FC +CDE2:0000000004123F920A121172209200127FD2041204000FFE004000A003180C06 +CDE3:0000000004123F920A121172209200127FD20412040001F000000FFE01100E0E +CDE4:0000000004123F920A121172209200127FD2041204000FFE00020FFE00020002 +CDE5:0000000004123F920A121172209200127FD2041204000FFE08000FFC080007FE +CDE6:0000000004123F920A121172209200127FD2041204000FFE0208020802080FFE +CDE7:0000000004123F920A121172209200127FD20412040001F000000FFE040403F8 +CDE8:0000000004043F840A0411042084000400047FF4040404040404040404040404 +CDE9:0000000004043F840A041104208400047FF4040404001FFC0004000400040004 +CDEA:0000000004043F840A041104208400047FF4040404001F7C0104010401040104 +CDEB:0000000004043F840A041104208400047FF4040404001F1001100110012801C6 +CDEC:0000000004043F840A041104208400047FF40404040414041000100010000FFC +CDED:0000000004043F840A041104208400047FF404040400107C1010101010280FC6 +CDEE:0000000004043F840A041104208400047FF4040404001038100010FE10440F38 +CDEF:0000000004043F840A041104208400047FF4040404001FFC1000100010000FFC +CDF0:0000000004043F840A041104208400047FF4040404001FFC00041FF810000FFC +CDF1:0000000004043F840A041104208400047FF4040404001F7C01041E0410040F04 +CDF2:0000000004043F840A041104208400047FF4040404001F7C01441E4410440F3C +CDF3:0000000004043F840A041104208400047FF4040404001F4401441E7C10440F3C +CDF4:0000000004043F840A041104208400047FF4040404001F1001101E1010280FC6 +CDF5:0000000004043F840A041104208400047FF4040404001F7C01401E7C10400F3C +CDF6:0000000004043F840A041104208400047FF4040404001F7E01241E2410240F7E +CDF7:0000000004043F840A041104208400047FF4040404001F3801001EFE10440F38 +CDF8:0000000004043F840A041104208400047FF4040404001FFC1004100410040FFC +CDF9:0000000004043F840A041104208400047FF404040400100410041FFC10040FFC +CDFA:0000000004043F840A041104208400047FF404040400111011101F1011280FC6 +CDFB:0000000004043F840A041104208400047FF4040404000080008001400630180C +CDFC:0000000004043F840A041104208400047FF4040404000410041004100A2831C6 +CDFD:0000000004043F840A041104208400047FF4040404000FF81004100410040FF8 +CDFE:0000000004043F840A041104208400047FF4040404001FFC008001400630180C +CDFF:0000000004043F840A041104208400047FF40404040003E000001FFC02201C1C +CE00:0000000004043F840A041104208400047FF4040404001FFC00041FFC00040004 +CE01:0000000004043F840A041104208400047FF4040404001FFC10001FF810000FFC +CE02:0000000004043F840A041104208400047FF4040404001FFC0410041004101FFC +CE03:0000000004043F840A041104208400047FF40404040003E000001FFC080807F0 +CE04:0000000000801FFC01400630180C000000007FFF041004100410041004100410 +CE05:0000000000801FFC01400630180C00007FFF022002201FFC0004000400040004 +CE06:0000000000801FFC01400630180C00007FFF022002201F7C0104010401040104 +CE07:0000000000801FFC01400630180C00007FFF022002201F1001100110012801C6 +CE08:0000000000801FFC01400630180C000000007FFF022012201220100010000FFC +CE09:0000000000801FFC01400630180C00007FFF02200220107C1010101010280FC6 +CE0A:0000000000801FFC01400630180C00007FFF022002201038100010FE10440F38 +CE0B:0000000000801FFC01400630180C00007FFF022002201FFC1000100010000FFC +CE0C:0000000000801FFC01400630180C00007FFF022002201FFC00041FF810000FFC +CE0D:0000000000801FFC01400630180C00007FFF022002201F7C01041E0410040F04 +CE0E:0000000000801FFC01400630180C00007FFF022002201F7C01441E4410440F3C +CE0F:0000000000801FFC01400630180C00007FFF022002201F4401441E7C10440F3C +CE10:0000000000801FFC01400630180C00007FFF022002201F1001101E1010280FC6 +CE11:0000000000801FFC01400630180C00007FFF022002201F7C01401E7C10400F3C +CE12:0000000000801FFC01400630180C00007FFF022002201F7E01241E2410240F7E +CE13:0000000000801FFC01400630180C00007FFF022002201F3801001EFE10440F38 +CE14:0000000000801FFC01400630180C00007FFF022002201FFC1004100410040FFC +CE15:0000000000801FFC01400630180C00007FFF02200220100410041FFC10040FFC +CE16:0000000000801FFC01400630180C00007FFF02200220111011101F1011280FC6 +CE17:0000000000801FFC01400630180C00007FFF022002200080008001400630180C +CE18:0000000000801FFC01400630180C00007FFF022002200410041004100A2831C6 +CE19:0000000000801FFC01400630180C00007FFF022002200FF81004100410040FF8 +CE1A:0000000000801FFC01400630180C00007FFF022002201FFC008001400630180C +CE1B:0000000000801FFC01400630180C00007FFF0220022003E000001FFC02201C1C +CE1C:0000000000801FFC01400630180C00007FFF022002201FFC00041FFC00040004 +CE1D:0000000000801FFC01400630180C00007FFF022002201FFC10001FF810000FFC +CE1E:0000000000801FFC01400630180C00007FFF022002201FFC0410041004101FFC +CE1F:0000000000801FFC01400630180C00007FFF0220022003E000001FFC080807F0 +CE20:00000000000003E000001FFC008001400630180C0000000000007FFF00000000 +CE21:0000000000801FFC01400630180C00007FFF000000001FFC0004000400040004 +CE22:0000000000801FFC01400630180C00007FFF000000001F7C0104010401040104 +CE23:0000000000801FFC01400630180C00007FFF000000001F1001100110012801C6 +CE24:0000000000801FFC01400630180C000000007FFF000010001000100010000FFC +CE25:0000000000801FFC01400630180C00007FFF00000000107C1010101010280FC6 +CE26:0000000000801FFC01400630180C00007FFF000000001038100010FE10440F38 +CE27:0000000000801FFC01400630180C00007FFF000000001FFC1000100010000FFC +CE28:0000000000801FFC01400630180C00007FFF000000001FFC00041FF810000FFC +CE29:0000000000801FFC01400630180C00007FFF000000001F7C01041E0410040F04 +CE2A:0000000000801FFC01400630180C00007FFF000000001F7C01441E4410440F3C +CE2B:0000000000801FFC01400630180C00007FFF000000001F4401441E7C10440F3C +CE2C:0000000000801FFC01400630180C00007FFF000000001F1001101E1010280FC6 +CE2D:0000000000801FFC01400630180C00007FFF000000001F7C01401E7C10400F3C +CE2E:0000000000801FFC01400630180C00007FFF000000001F7E01241E2410240F7E +CE2F:0000000000801FFC01400630180C00007FFF000000001F3801001EFE10440F38 +CE30:0000000000801FFC01400630180C00007FFF000000001FFC1004100410040FFC +CE31:0000000000801FFC01400630180C00007FFF00000000100410041FFC10040FFC +CE32:0000000000801FFC01400630180C00007FFF00000000111011101F1011280FC6 +CE33:0000000000801FFC01400630180C00007FFF000000000080008001400630180C +CE34:0000000000801FFC01400630180C00007FFF000000000410041004100A2831C6 +CE35:0000000000801FFC01400630180C00007FFF000000000FF81004100410040FF8 +CE36:0000000000801FFC01400630180C00007FFF000000001FFC008001400630180C +CE37:0000000000801FFC01400630180C00007FFF0000000003E000001FFC02201C1C +CE38:0000000000801FFC01400630180C00007FFF000000001FFC00041FFC00040004 +CE39:0000000000801FFC01400630180C00007FFF000000001FFC10001FF810000FFC +CE3A:0000000000801FFC01400630180C00007FFF000000001FFC0410041004101FFC +CE3B:0000000000801FFC01400630180C00007FFF0000000003E000001FFC080807F0 +CE3C:0000000000041F0400043F8404040A04110420840004000400047FF400040004 +CE3D:0000000004043F840A041104208400047FF4000400001FFC0004000400040004 +CE3E:0000000004043F840A041104208400047FF4000400001F7C0104010401040104 +CE3F:0000000004043F840A041104208400047FF4000400001F1001100110012801C6 +CE40:0000000004043F840A0411042084000400047FF4000410041000100010000FFC +CE41:0000000004043F840A041104208400047FF400040000107C1010101010280FC6 +CE42:0000000004043F840A041104208400047FF4000400001038100010FE10440F38 +CE43:0000000004043F840A041104208400047FF4000400001FFC1000100010000FFC +CE44:0000000004043F840A041104208400047FF4000400001FFC00041FF810000FFC +CE45:0000000004043F840A041104208400047FF4000400001F7C01041E0410040F04 +CE46:0000000004043F840A041104208400047FF4000400001F7C01441E4410440F3C +CE47:0000000004043F840A041104208400047FF4000400001F4401441E7C10440F3C +CE48:0000000004043F840A041104208400047FF4000400001F1001101E1010280FC6 +CE49:0000000004043F840A041104208400047FF4000400001F7C01401E7C10400F3C +CE4A:0000000004043F840A041104208400047FF4000400001F7E01241E2410240F7E +CE4B:0000000004043F840A041104208400047FF4000400001F3801001EFE10440F38 +CE4C:0000000004043F840A041104208400047FF4000400001FFC1004100410040FFC +CE4D:0000000004043F840A041104208400047FF400040000100410041FFC10040FFC +CE4E:0000000004043F840A041104208400047FF400040000111011101F1011280FC6 +CE4F:0000000004043F840A041104208400047FF4000400000080008001400630180C +CE50:0000000004043F840A041104208400047FF4000400000410041004100A2831C6 +CE51:0000000004043F840A041104208400047FF4000400000FF81004100410040FF8 +CE52:0000000004043F840A041104208400047FF4000400001FFC008001400630180C +CE53:0000000004043F840A041104208400047FF40004000003E000001FFC02201C1C +CE54:0000000004043F840A041104208400047FF4000400001FFC00041FFC00040004 +CE55:0000000004043F840A041104208400047FF4000400001FFC10001FF810000FFC +CE56:0000000004043F840A041104208400047FF4000400001FFC0410041004101FFC +CE57:0000000004043F840A041104208400047FF40004000003E000001FFC080807F0 +CE58:0000000000041F0400043F84040404040A040A04110411042084000400040004 +CE59:000000001F0400043F8404040A0411042084000400001FFC0004000400040004 +CE5A:000000001F0400043F8404040A0411042084000400001F7C0104010401040104 +CE5B:000000001F0400043F8404040A0411042084000400001F1001100110012801C6 +CE5C:000000001F0400043F8404040A04110420840004000410041000100010000FFC +CE5D:000000001F0400043F8404040A041104208400040000107C1010101010280FC6 +CE5E:000000001F0400043F8404040A0411042084000400001038100010FE10440F38 +CE5F:000000001F0400043F8404040A0411042084000400001FFC1000100010000FFC +CE60:000000001F0400043F8404040A0411042084000400001FFC00041FF810000FFC +CE61:000000001F0400043F8404040A0411042084000400001F7C01041E0410040F04 +CE62:000000001F0400043F8404040A0411042084000400001F7C01441E4410440F3C +CE63:000000001F0400043F8404040A0411042084000400001F4401441E7C10440F3C +CE64:000000001F0400043F8404040A0411042084000400001F1001101E1010280FC6 +CE65:000000001F0400043F8404040A0411042084000400001F7C01401E7C10400F3C +CE66:000000001F0400043F8404040A0411042084000400001F7E01241E2410240F7E +CE67:000000001F0400043F8404040A0411042084000400001F3801001EFE10440F38 +CE68:000000001F0400043F8404040A0411042084000400001FFC1004100410040FFC +CE69:000000001F0400043F8404040A041104208400040000100410041FFC10040FFC +CE6A:000000001F0400043F8404040A041104208400040000111011101F1011280FC6 +CE6B:000000001F0400043F8404040A0411042084000400000080008001400630180C +CE6C:000000001F0400043F8404040A0411042084000400000410041004100A2831C6 +CE6D:000000001F0400043F8404040A0411042084000400000FF81004100410040FF8 +CE6E:000000001F0400043F8404040A0411042084000400001FFC008001400630180C +CE6F:000000001F0400043F8404040A04110420840004000003E000001FFC02201C1C +CE70:000000001F0400043F8404040A0411042084000400001FFC00041FFC00040004 +CE71:000000001F0400043F8404040A0411042084000400001FFC10001FF810000FFC +CE72:000000001F0400043F8404040A0411042084000400001FFC0410041004101FFC +CE73:000000001F0400043F8404040A04110420840004000003E000001FFC080807F0 +CE74:0000000000043F840084008403843C870104010402040C043004000400040004 +CE75:000000003F84008400843F07010406043804000400001FFC0004000400040004 +CE76:000000003F84008400843F07010406043804000400001F7C0104010401040104 +CE77:000000003F84008400843F07010406043804000400001F1001100110012801C6 +CE78:000000003F84008400843F070104060438040004000410041000100010000FFC +CE79:000000003F84008400843F0701040604380400040000107C1010101010280FC6 +CE7A:000000003F84008400843F07010406043804000400001038100010FE10440F38 +CE7B:000000003F84008400843F07010406043804000400001FFC1000100010000FFC +CE7C:000000003F84008400843F07010406043804000400001FFC00041FF810000FFC +CE7D:000000003F84008400843F07010406043804000400001F7C01041E0410040F04 +CE7E:000000003F84008400843F07010406043804000400001F7C01441E4410440F3C +CE7F:000000003F84008400843F07010406043804000400001F4401441E7C10440F3C +CE80:000000003F84008400843F07010406043804000400001F1001101E1010280FC6 +CE81:000000003F84008400843F07010406043804000400001F7C01401E7C10400F3C +CE82:000000003F84008400843F07010406043804000400001F7E01241E2410240F7E +CE83:000000003F84008400843F07010406043804000400001F3801001EFE10440F38 +CE84:000000003F84008400843F07010406043804000400001FFC1004100410040FFC +CE85:000000003F84008400843F0701040604380400040000100410041FFC10040FFC +CE86:000000003F84008400843F0701040604380400040000111011101F1011280FC6 +CE87:000000003F84008400843F07010406043804000400000080008001400630180C +CE88:000000003F84008400843F07010406043804000400000410041004100A2831C6 +CE89:000000003F84008400843F07010406043804000400000FF81004100410040FF8 +CE8A:000000003F84008400843F07010406043804000400001FFC008001400630180C +CE8B:000000003F84008400843F070104060438040004000003E000001FFC02201C1C +CE8C:000000003F84008400843F07010406043804000400001FFC00041FFC00040004 +CE8D:000000003F84008400843F07010406043804000400001FFC10001FF810000FFC +CE8E:000000003F84008400843F07010406043804000400001FFC0410041004101FFC +CE8F:000000003F84008400843F070104060438040004000003E000001FFC080807F0 +CE90:0000000000123F920092009203923C9E0112011202120C123012001200120012 +CE91:000000003F92009200923F1E011206123812001200000FFE0002000200020002 +CE92:000000003F92009200923F1E011206123812001200000FBE0082008200820082 +CE93:000000003F92009200923F1E011206123812001200000F8800880088009400E3 +CE94:000000003F92009200923F1E01120612381200120012081208000800080007FE +CE95:000000003F92009200923F1E01120612381200120000083E08080808081407E3 +CE96:000000003F92009200923F1E01120612381200120000081C0800087F0822079C +CE97:000000003F92009200923F1E011206123812001200000FFE08000800080007FE +CE98:000000003F92009200923F1E011206123812001200000FFE00020FFC080007FE +CE99:000000003F92009200923F1E011206123812001200000FBE00820F0208020782 +CE9A:000000003F92009200923F1E011206123812001200000FBE00A20F220822079E +CE9B:000000003F92009200923F1E011206123812001200000FA200A20F3E0822079E +CE9C:000000003F92009200923F1E011206123812001200000F8800880F08081407E3 +CE9D:000000003F92009200923F1E011206123812001200000FBE00A00F3E0820079E +CE9E:000000003F92009200923F1E011206123812001200000FBF00920F12081207BF +CE9F:000000003F92009200923F1E011206123812001200000F9C00800F7F0822079C +CEA0:000000003F92009200923F1E011206123812001200000FFE08020802080207FE +CEA1:000000003F92009200923F1E01120612381200120000080208020FFE080207FE +CEA2:000000003F92009200923F1E01120612381200120000088808880F88089407E3 +CEA3:000000003F92009200923F1E011206123812001200000040004000A003180C06 +CEA4:000000003F92009200923F1E01120612381200120000020802080208051418E3 +CEA5:000000003F92009200923F1E0112061238120012000007FC08020802080207FC +CEA6:000000003F92009200923F1E011206123812001200000FFE004000A003180C06 +CEA7:000000003F92009200923F1E0112061238120012000001F000000FFE01100E0E +CEA8:000000003F92009200923F1E011206123812001200000FFE00020FFE00020002 +CEA9:000000003F92009200923F1E011206123812001200000FFE08000FFC080007FE +CEAA:000000003F92009200923F1E011206123812001200000FFE0208020802080FFE +CEAB:000000003F92009200923F1E0112061238120012000001F000000FFE040403F8 +CEAC:0000000000043F840084008403873C840104010702040C043004000400040004 +CEAD:000000003F84008400873F04010406073804000400001FFC0004000400040004 +CEAE:000000003F84008400873F04010406073804000400001F7C0104010401040104 +CEAF:000000003F84008400873F04010406073804000400001F1001100110012801C6 +CEB0:000000003F84008400873F040104060738040004000410041000100010000FFC +CEB1:000000003F84008400873F0401040607380400040000107C1010101010280FC6 +CEB2:000000003F84008400873F04010406073804000400001038100010FE10440F38 +CEB3:000000003F84008400873F04010406073804000400001FFC1000100010000FFC +CEB4:000000003F84008400873F04010406073804000400001FFC00041FF810000FFC +CEB5:000000003F84008400873F04010406073804000400001F7C01041E0410040F04 +CEB6:000000003F84008400873F04010406073804000400001F7C01441E4410440F3C +CEB7:000000003F84008400873F04010406073804000400001F4401441E7C10440F3C +CEB8:000000003F84008400873F04010406073804000400001F1001101E1010280FC6 +CEB9:000000003F84008400873F04010406073804000400001F7C01401E7C10400F3C +CEBA:000000003F84008400873F04010406073804000400001F7E01241E2410240F7E +CEBB:000000003F84008400873F04010406073804000400001F3801001EFE10440F38 +CEBC:000000003F84008400873F04010406073804000400001FFC1004100410040FFC +CEBD:000000003F84008400873F0401040607380400040000100410041FFC10040FFC +CEBE:000000003F84008400873F0401040607380400040000111011101F1011280FC6 +CEBF:000000003F84008400873F04010406073804000400000080008001400630180C +CEC0:000000003F84008400873F04010406073804000400000410041004100A2831C6 +CEC1:000000003F84008400873F04010406073804000400000FF81004100410040FF8 +CEC2:000000003F84008400873F04010406073804000400001FFC008001400630180C +CEC3:000000003F84008400873F040104060738040004000003E000001FFC02201C1C +CEC4:000000003F84008400873F04010406073804000400001FFC00041FFC00040004 +CEC5:000000003F84008400873F04010406073804000400001FFC10001FF810000FFC +CEC6:000000003F84008400873F04010406073804000400001FFC0410041004101FFC +CEC7:000000003F84008400873F040104060738040004000003E000001FFC080807F0 +CEC8:0000000000123F9200920092039E3C920112011E02120C123012001200120012 +CEC9:000000003F920092009E3F120112061E3812001200000FFE0002000200020002 +CECA:000000003F920092009E3F120112061E3812001200000FBE0082008200820082 +CECB:000000003F920092009E3F120112061E3812001200000F8800880088009400E3 +CECC:000000003F920092009E3F120112061E381200120012081208000800080007FE +CECD:000000003F920092009E3F120112061E381200120000083E08080808081407E3 +CECE:000000003F920092009E3F120112061E381200120000081C0800087F0822079C +CECF:000000003F920092009E3F120112061E3812001200000FFE08000800080007FE +CED0:000000003F920092009E3F120112061E3812001200000FFE00020FFC080007FE +CED1:000000003F920092009E3F120112061E3812001200000FBE00820F0208020782 +CED2:000000003F920092009E3F120112061E3812001200000FBE00A20F220822079E +CED3:000000003F920092009E3F120112061E3812001200000FA200A20F3E0822079E +CED4:000000003F920092009E3F120112061E3812001200000F8800880F08081407E3 +CED5:000000003F920092009E3F120112061E3812001200000FBE00A00F3E0820079E +CED6:000000003F920092009E3F120112061E3812001200000FBF00920F12081207BF +CED7:000000003F920092009E3F120112061E3812001200000F9C00800F7F0822079C +CED8:000000003F920092009E3F120112061E3812001200000FFE08020802080207FE +CED9:000000003F920092009E3F120112061E381200120000080208020FFE080207FE +CEDA:000000003F920092009E3F120112061E381200120000088808880F88089407E3 +CEDB:000000003F920092009E3F120112061E3812001200000040004000A003180C06 +CEDC:000000003F920092009E3F120112061E381200120000020802080208051418E3 +CEDD:000000003F920092009E3F120112061E38120012000007FC08020802080207FC +CEDE:000000003F920092009E3F120112061E3812001200000FFE004000A003180C06 +CEDF:000000003F920092009E3F120112061E38120012000001F000000FFE01100E0E +CEE0:000000003F920092009E3F120112061E3812001200000FFE00020FFE00020002 +CEE1:000000003F920092009E3F120112061E3812001200000FFE08000FFC080007FE +CEE2:000000003F920092009E3F120112061E3812001200000FFE0208020802080FFE +CEE3:000000003F920092009E3F120112061E38120012000001F000000FFE040403F8 +CEE4:0000000000043F840084008403843CBC0104010402040C043004000400040004 +CEE5:000000003F84008400843F3C010406043804000400001FFC0004000400040004 +CEE6:000000003F84008400843F3C010406043804000400001F7C0104010401040104 +CEE7:000000003F84008400843F3C010406043804000400001F1001100110012801C6 +CEE8:000000003F84008400843F3C0104060438040004000410041000100010000FFC +CEE9:000000003F84008400843F3C01040604380400040000107C1010101010280FC6 +CEEA:000000003F84008400843F3C010406043804000400001038100010FE10440F38 +CEEB:000000003F84008400843F3C010406043804000400001FFC1000100010000FFC +CEEC:000000003F84008400843F3C010406043804000400001FFC00041FF810000FFC +CEED:000000003F84008400843F3C010406043804000400001F7C01041E0410040F04 +CEEE:000000003F84008400843F3C010406043804000400001F7C01441E4410440F3C +CEEF:000000003F84008400843F3C010406043804000400001F4401441E7C10440F3C +CEF0:000000003F84008400843F3C010406043804000400001F1001101E1010280FC6 +CEF1:000000003F84008400843F3C010406043804000400001F7C01401E7C10400F3C +CEF2:000000003F84008400843F3C010406043804000400001F7E01241E2410240F7E +CEF3:000000003F84008400843F3C010406043804000400001F3801001EFE10440F38 +CEF4:000000003F84008400843F3C010406043804000400001FFC1004100410040FFC +CEF5:000000003F84008400843F3C01040604380400040000100410041FFC10040FFC +CEF6:000000003F84008400843F3C01040604380400040000111011101F1011280FC6 +CEF7:000000003F84008400843F3C010406043804000400000080008001400630180C +CEF8:000000003F84008400843F3C010406043804000400000410041004100A2831C6 +CEF9:000000003F84008400843F3C010406043804000400000FF81004100410040FF8 +CEFA:000000003F84008400843F3C010406043804000400001FFC008001400630180C +CEFB:000000003F84008400843F3C0104060438040004000003E000001FFC02201C1C +CEFC:000000003F84008400843F3C010406043804000400001FFC00041FFC00040004 +CEFD:000000003F84008400843F3C010406043804000400001FFC10001FF810000FFC +CEFE:000000003F84008400843F3C010406043804000400001FFC0410041004101FFC +CEFF:000000003F84008400843F3C0104060438040004000003E000001FFC080807F0 +CF00:0000000000123F920092009203923CF20112011202120C123012001200120012 +CF01:000000003F92009200923F72011206123812001200000FFE0002000200020002 +CF02:000000003F92009200923F72011206123812001200000FBE0082008200820082 +CF03:000000003F92009200923F72011206123812001200000F8800880088009400E3 +CF04:000000003F92009200923F7201120612381200120012081208000800080007FE +CF05:000000003F92009200923F7201120612381200120000083E08080808081407E3 +CF06:000000003F92009200923F7201120612381200120000081C0800087F0822079C +CF07:000000003F92009200923F72011206123812001200000FFE08000800080007FE +CF08:000000003F92009200923F72011206123812001200000FFE00020FFC080007FE +CF09:000000003F92009200923F72011206123812001200000FBE00820F0208020782 +CF0A:000000003F92009200923F72011206123812001200000FBE00A20F220822079E +CF0B:000000003F92009200923F72011206123812001200000FA200A20F3E0822079E +CF0C:000000003F92009200923F72011206123812001200000F8800880F08081407E3 +CF0D:000000003F92009200923F72011206123812001200000FBE00A00F3E0820079E +CF0E:000000003F92009200923F72011206123812001200000FBF00920F12081207BF +CF0F:000000003F92009200923F72011206123812001200000F9C00800F7F0822079C +CF10:000000003F92009200923F72011206123812001200000FFE08020802080207FE +CF11:000000003F92009200923F7201120612381200120000080208020FFE080207FE +CF12:000000003F92009200923F7201120612381200120000088808880F88089407E3 +CF13:000000003F92009200923F72011206123812001200000040004000A003180C06 +CF14:000000003F92009200923F7201120612381200120000020802080208051418E3 +CF15:000000003F92009200923F720112061238120012000007FC08020802080207FC +CF16:000000003F92009200923F72011206123812001200000FFE004000A003180C06 +CF17:000000003F92009200923F720112061238120012000001F000000FFE01100E0E +CF18:000000003F92009200923F72011206123812001200000FFE00020FFE00020002 +CF19:000000003F92009200923F72011206123812001200000FFE08000FFC080007FE +CF1A:000000003F92009200923F72011206123812001200000FFE0208020802080FFE +CF1B:000000003F92009200923F720112061238120012000001F000000FFE040403F8 +CF1C:0000000000043F840084008403BC3C840104013C02040C043004000400040004 +CF1D:000000003F84008400BC3F040104063C3804000400001FFC0004000400040004 +CF1E:000000003F84008400BC3F040104063C3804000400001F7C0104010401040104 +CF1F:000000003F84008400BC3F040104063C3804000400001F1001100110012801C6 +CF20:000000003F84008400BC3F040104063C38040004000410041000100010000FFC +CF21:000000003F84008400BC3F040104063C380400040000107C1010101010280FC6 +CF22:000000003F84008400BC3F040104063C3804000400001038100010FE10440F38 +CF23:000000003F84008400BC3F040104063C3804000400001FFC1000100010000FFC +CF24:000000003F84008400BC3F040104063C3804000400001FFC00041FF810000FFC +CF25:000000003F84008400BC3F040104063C3804000400001F7C01041E0410040F04 +CF26:000000003F84008400BC3F040104063C3804000400001F7C01441E4410440F3C +CF27:000000003F84008400BC3F040104063C3804000400001F4401441E7C10440F3C +CF28:000000003F84008400BC3F040104063C3804000400001F1001101E1010280FC6 +CF29:000000003F84008400BC3F040104063C3804000400001F7C01401E7C10400F3C +CF2A:000000003F84008400BC3F040104063C3804000400001F7E01241E2410240F7E +CF2B:000000003F84008400BC3F040104063C3804000400001F3801001EFE10440F38 +CF2C:000000003F84008400BC3F040104063C3804000400001FFC1004100410040FFC +CF2D:000000003F84008400BC3F040104063C380400040000100410041FFC10040FFC +CF2E:000000003F84008400BC3F040104063C380400040000111011101F1011280FC6 +CF2F:000000003F84008400BC3F040104063C3804000400000080008001400630180C +CF30:000000003F84008400BC3F040104063C3804000400000410041004100A2831C6 +CF31:000000003F84008400BC3F040104063C3804000400000FF81004100410040FF8 +CF32:000000003F84008400BC3F040104063C3804000400001FFC008001400630180C +CF33:000000003F84008400BC3F040104063C38040004000003E000001FFC02201C1C +CF34:000000003F84008400BC3F040104063C3804000400001FFC00041FFC00040004 +CF35:000000003F84008400BC3F040104063C3804000400001FFC10001FF810000FFC +CF36:000000003F84008400BC3F040104063C3804000400001FFC0410041004101FFC +CF37:000000003F84008400BC3F040104063C38040004000003E000001FFC080807F0 +CF38:0000000000123F920092009203F23C920112017202120C123012001200120012 +CF39:000000003F92009200F23F12011206723812001200000FFE0002000200020002 +CF3A:000000003F92009200F23F12011206723812001200000FBE0082008200820082 +CF3B:000000003F92009200F23F12011206723812001200000F8800880088009400E3 +CF3C:000000003F92009200F23F1201120672381200120012081208000800080007FE +CF3D:000000003F92009200F23F1201120672381200120000083E08080808081407E3 +CF3E:000000003F92009200F23F1201120672381200120000081C0800087F0822079C +CF3F:000000003F92009200F23F12011206723812001200000FFE08000800080007FE +CF40:000000003F92009200F23F12011206723812001200000FFE00020FFC080007FE +CF41:000000003F92009200F23F12011206723812001200000FBE00820F0208020782 +CF42:000000003F92009200F23F12011206723812001200000FBE00A20F220822079E +CF43:000000003F92009200F23F12011206723812001200000FA200A20F3E0822079E +CF44:000000003F92009200F23F12011206723812001200000F8800880F08081407E3 +CF45:000000003F92009200F23F12011206723812001200000FBE00A00F3E0820079E +CF46:000000003F92009200F23F12011206723812001200000FBF00920F12081207BF +CF47:000000003F92009200F23F12011206723812001200000F9C00800F7F0822079C +CF48:000000003F92009200F23F12011206723812001200000FFE08020802080207FE +CF49:000000003F92009200F23F1201120672381200120000080208020FFE080207FE +CF4A:000000003F92009200F23F1201120672381200120000088808880F88089407E3 +CF4B:000000003F92009200F23F12011206723812001200000040004000A003180C06 +CF4C:000000003F92009200F23F1201120672381200120000020802080208051418E3 +CF4D:000000003F92009200F23F120112067238120012000007FC08020802080207FC +CF4E:000000003F92009200F23F12011206723812001200000FFE004000A003180C06 +CF4F:000000003F92009200F23F120112067238120012000001F000000FFE01100E0E +CF50:000000003F92009200F23F12011206723812001200000FFE00020FFE00020002 +CF51:000000003F92009200F23F12011206723812001200000FFE08000FFC080007FE +CF52:000000003F92009200F23F12011206723812001200000FFE0208020802080FFE +CF53:000000003F92009200F23F120112067238120012000001F000000FFE040403F8 +CF54:0000000000001FFC000400041FFC0004000400040084008000807FFF00000000 +CF55:000000001FFC000400041FFC0004008400807FFF00001FFC0004000400040004 +CF56:000000001FFC000400041FFC0004008400807FFF00001F7C0104010401040104 +CF57:000000001FFC000400041FFC0004008400807FFF00001F1001100110012801C6 +CF58:000000001FFC000400041FFC0004008400807FFF000010001000100010000FFC +CF59:000000001FFC000400041FFC0004008400807FFF0000107C1010101010280FC6 +CF5A:000000001FFC000400041FFC0004008400807FFF00001038100010FE10440F38 +CF5B:000000001FFC000400041FFC0004008400807FFF00001FFC1000100010000FFC +CF5C:000000001FFC000400041FFC0004008400807FFF00001FFC00041FF810000FFC +CF5D:000000001FFC000400041FFC0004008400807FFF00001F7C01041E0410040F04 +CF5E:000000001FFC000400041FFC0004008400807FFF00001F7C01441E4410440F3C +CF5F:000000001FFC000400041FFC0004008400807FFF00001F4401441E7C10440F3C +CF60:000000001FFC000400041FFC0004008400807FFF00001F1001101E1010280FC6 +CF61:000000001FFC000400041FFC0004008400807FFF00001F7C01401E7C10400F3C +CF62:000000001FFC000400041FFC0004008400807FFF00001F7E01241E2410240F7E +CF63:000000001FFC000400041FFC0004008400807FFF00001F3801001EFE10440F38 +CF64:000000001FFC000400041FFC0004008400807FFF00001FFC1004100410040FFC +CF65:000000001FFC000400041FFC0004008400807FFF0000100410041FFC10040FFC +CF66:000000001FFC000400041FFC0004008400807FFF0000111011101F1011280FC6 +CF67:000000001FFC000400041FFC0004008400807FFF00000080008001400630180C +CF68:000000001FFC000400041FFC0004008400807FFF00000410041004100A2831C6 +CF69:000000001FFC000400041FFC0004008400807FFF00000FF81004100410040FF8 +CF6A:000000001FFC000400041FFC0004008400807FFF00001FFC008001400630180C +CF6B:000000001FFC000400041FFC0004008400807FFF000003E000001FFC02201C1C +CF6C:000000001FFC000400041FFC0004008400807FFF00001FFC00041FFC00040004 +CF6D:000000001FFC000400041FFC0004008400807FFF00001FFC10001FF810000FFC +CF6E:000000001FFC000400041FFC0004008400807FFF00001FFC0410041004101FFC +CF6F:000000001FFC000400041FFC0004008400807FFF000003E000001FFC080807F0 +CF70:0000000000043F84008400843F840087008400840484040404047FF400040004 +CF71:000000003F84008400843F870084048404047FF400001FFC0004000400040004 +CF72:000000003F84008400843F870084048404047FF400001F7C0104010401040104 +CF73:000000003F84008400843F870084048404047FF400001F1001100110012801C6 +CF74:000000003F84008400843F870084048404047FF4000410041000100010000FFC +CF75:000000003F84008400843F870084048404047FF40000107C1010101010280FC6 +CF76:000000003F84008400843F870084048404047FF400001038100010FE10440F38 +CF77:000000003F84008400843F870084048404047FF400001FFC1000100010000FFC +CF78:000000003F84008400843F870084048404047FF400001FFC00041FF810000FFC +CF79:000000003F84008400843F870084048404047FF400001F7C01041E0410040F04 +CF7A:000000003F84008400843F870084048404047FF400001F7C01441E4410440F3C +CF7B:000000003F84008400843F870084048404047FF400001F4401441E7C10440F3C +CF7C:000000003F84008400843F870084048404047FF400001F1001101E1010280FC6 +CF7D:000000003F84008400843F870084048404047FF400001F7C01401E7C10400F3C +CF7E:000000003F84008400843F870084048404047FF400001F7E01241E2410240F7E +CF7F:000000003F84008400843F870084048404047FF400001F3801001EFE10440F38 +CF80:000000003F84008400843F870084048404047FF400001FFC1004100410040FFC +CF81:000000003F84008400843F870084048404047FF40000100410041FFC10040FFC +CF82:000000003F84008400843F870084048404047FF40000111011101F1011280FC6 +CF83:000000003F84008400843F870084048404047FF400000080008001400630180C +CF84:000000003F84008400843F870084048404047FF400000410041004100A2831C6 +CF85:000000003F84008400843F870084048404047FF400000FF81004100410040FF8 +CF86:000000003F84008400843F870084048404047FF400001FFC008001400630180C +CF87:000000003F84008400843F870084048404047FF4000003E000001FFC02201C1C +CF88:000000003F84008400843F870084048404047FF400001FFC00041FFC00040004 +CF89:000000003F84008400843F870084048404047FF400001FFC10001FF810000FFC +CF8A:000000003F84008400843F870084048404047FF400001FFC0410041004101FFC +CF8B:000000003F84008400843F870084048404047FF4000003E000001FFC080807F0 +CF8C:0000000000123F92009200923F92009E009200920492041204127FD200120012 +CF8D:000000003F92009200923F9E0092049204127FD200000FFE0002000200020002 +CF8E:000000003F92009200923F9E0092049204127FD200000FBE0082008200820082 +CF8F:000000003F92009200923F9E0092049204127FD200000F8800880088009400E3 +CF90:000000003F92009200923F9E0092049204127FD20012081208000800080007FE +CF91:000000003F92009200923F9E0092049204127FD20000083E08080808081407E3 +CF92:000000003F92009200923F9E0092049204127FD20000081C0800087F0822079C +CF93:000000003F92009200923F9E0092049204127FD200000FFE08000800080007FE +CF94:000000003F92009200923F9E0092049204127FD200000FFE00020FFC080007FE +CF95:000000003F92009200923F9E0092049204127FD200000FBE00820F0208020782 +CF96:000000003F92009200923F9E0092049204127FD200000FBE00A20F220822079E +CF97:000000003F92009200923F9E0092049204127FD200000FA200A20F3E0822079E +CF98:000000003F92009200923F9E0092049204127FD200000F8800880F08081407E3 +CF99:000000003F92009200923F9E0092049204127FD200000FBE00A00F3E0820079E +CF9A:000000003F92009200923F9E0092049204127FD200000FBF00920F12081207BF +CF9B:000000003F92009200923F9E0092049204127FD200000F9C00800F7F0822079C +CF9C:000000003F92009200923F9E0092049204127FD200000FFE08020802080207FE +CF9D:000000003F92009200923F9E0092049204127FD20000080208020FFE080207FE +CF9E:000000003F92009200923F9E0092049204127FD20000088808880F88089407E3 +CF9F:000000003F92009200923F9E0092049204127FD200000040004000A003180C06 +CFA0:000000003F92009200923F9E0092049204127FD20000020802080208051418E3 +CFA1:000000003F92009200923F9E0092049204127FD2000007FC08020802080207FC +CFA2:000000003F92009200923F9E0092049204127FD200000FFE004000A003180C06 +CFA3:000000003F92009200923F9E0092049204127FD2000001F000000FFE01100E0E +CFA4:000000003F92009200923F9E0092049204127FD200000FFE00020FFE00020002 +CFA5:000000003F92009200923F9E0092049204127FD200000FFE08000FFC080007FE +CFA6:000000003F92009200923F9E0092049204127FD200000FFE0208020802080FFE +CFA7:000000003F92009200923F9E0092049204127FD2000001F000000FFE040403F8 +CFA8:0000000000043F84008400843F840084008400840484040404047FF400040004 +CFA9:000000003F84008400843F840084048404047FF400001FFC0004000400040004 +CFAA:000000003F84008400843F840084048404047FF400001F7C0104010401040104 +CFAB:000000003F84008400843F840084048404047FF400001F1001100110012801C6 +CFAC:000000003F84008400843F840084048404047FF4000410041000100010000FFC +CFAD:000000003F84008400843F840084048404047FF40000107C1010101010280FC6 +CFAE:000000003F84008400843F840084048404047FF400001038100010FE10440F38 +CFAF:000000003F84008400843F840084048404047FF400001FFC1000100010000FFC +CFB0:000000003F84008400843F840084048404047FF400001FFC00041FF810000FFC +CFB1:000000003F84008400843F840084048404047FF400001F7C01041E0410040F04 +CFB2:000000003F84008400843F840084048404047FF400001F7C01441E4410440F3C +CFB3:000000003F84008400843F840084048404047FF400001F4401441E7C10440F3C +CFB4:000000003F84008400843F840084048404047FF400001F1001101E1010280FC6 +CFB5:000000003F84008400843F840084048404047FF400001F7C01401E7C10400F3C +CFB6:000000003F84008400843F840084048404047FF400001F7E01241E2410240F7E +CFB7:000000003F84008400843F840084048404047FF400001F3801001EFE10440F38 +CFB8:000000003F84008400843F840084048404047FF400001FFC1004100410040FFC +CFB9:000000003F84008400843F840084048404047FF40000100410041FFC10040FFC +CFBA:000000003F84008400843F840084048404047FF40000111011101F1011280FC6 +CFBB:000000003F84008400843F840084048404047FF400000080008001400630180C +CFBC:000000003F84008400843F840084048404047FF400000410041004100A2831C6 +CFBD:000000003F84008400843F840084048404047FF400000FF81004100410040FF8 +CFBE:000000003F84008400843F840084048404047FF400001FFC008001400630180C +CFBF:000000003F84008400843F840084048404047FF4000003E000001FFC02201C1C +CFC0:000000003F84008400843F840084048404047FF400001FFC00041FFC00040004 +CFC1:000000003F84008400843F840084048404047FF400001FFC10001FF810000FFC +CFC2:000000003F84008400843F840084048404047FF400001FFC0410041004101FFC +CFC3:000000003F84008400843F840084048404047FF4000003E000001FFC080807F0 +CFC4:0000000000001FFC000400041FFC0004000400040224022002207FFF00000000 +CFC5:000000001FFC000400041FFC0004022402207FFF00001FFC0004000400040004 +CFC6:000000001FFC000400041FFC0004022402207FFF00001F7C0104010401040104 +CFC7:000000001FFC000400041FFC0004022402207FFF00001F1001100110012801C6 +CFC8:000000001FFC000400041FFC0004022402207FFF000010001000100010000FFC +CFC9:000000001FFC000400041FFC0004022402207FFF0000107C1010101010280FC6 +CFCA:000000001FFC000400041FFC0004022402207FFF00001038100010FE10440F38 +CFCB:000000001FFC000400041FFC0004022402207FFF00001FFC1000100010000FFC +CFCC:000000001FFC000400041FFC0004022402207FFF00001FFC00041FF810000FFC +CFCD:000000001FFC000400041FFC0004022402207FFF00001F7C01041E0410040F04 +CFCE:000000001FFC000400041FFC0004022402207FFF00001F7C01441E4410440F3C +CFCF:000000001FFC000400041FFC0004022402207FFF00001F4401441E7C10440F3C +CFD0:000000001FFC000400041FFC0004022402207FFF00001F1001101E1010280FC6 +CFD1:000000001FFC000400041FFC0004022402207FFF00001F7C01401E7C10400F3C +CFD2:000000001FFC000400041FFC0004022402207FFF00001F7E01241E2410240F7E +CFD3:000000001FFC000400041FFC0004022402207FFF00001F3801001EFE10440F38 +CFD4:000000001FFC000400041FFC0004022402207FFF00001FFC1004100410040FFC +CFD5:000000001FFC000400041FFC0004022402207FFF0000100410041FFC10040FFC +CFD6:000000001FFC000400041FFC0004022402207FFF0000111011101F1011280FC6 +CFD7:000000001FFC000400041FFC0004022402207FFF00000080008001400630180C +CFD8:000000001FFC000400041FFC0004022402207FFF00000410041004100A2831C6 +CFD9:000000001FFC000400041FFC0004022402207FFF00000FF81004100410040FF8 +CFDA:000000001FFC000400041FFC0004022402207FFF00001FFC008001400630180C +CFDB:000000001FFC000400041FFC0004022402207FFF000003E000001FFC02201C1C +CFDC:000000001FFC000400041FFC0004022402207FFF00001FFC00041FFC00040004 +CFDD:000000001FFC000400041FFC0004022402207FFF00001FFC10001FF810000FFC +CFDE:000000001FFC000400041FFC0004022402207FFF00001FFC0410041004101FFC +CFDF:000000001FFC000400041FFC0004022402207FFF000003E000001FFC080807F0 +CFE0:000000001FFC000400041FFC0004000400007FFF008000800080008000800080 +CFE1:000000001FFC000400041FFC000400047FFF008000801FFC0004000400040004 +CFE2:000000001FFC000400041FFC000400047FFF008000801F7C0104010401040104 +CFE3:000000001FFC000400041FFC000400047FFF008000801F1001100110012801C6 +CFE4:000000001FFC000400041FFC0004000400007FFF008010801080100010000FFC +CFE5:000000001FFC000400041FFC000400047FFF00800080107C1010101010280FC6 +CFE6:000000001FFC000400041FFC000400047FFF008000801038100010FE10440F38 +CFE7:000000001FFC000400041FFC000400047FFF008000801FFC1000100010000FFC +CFE8:000000001FFC000400041FFC000400047FFF008000801FFC00041FF810000FFC +CFE9:000000001FFC000400041FFC000400047FFF008000801F7C01041E0410040F04 +CFEA:000000001FFC000400041FFC000400047FFF008000801F7C01441E4410440F3C +CFEB:000000001FFC000400041FFC000400047FFF008000801F4401441E7C10440F3C +CFEC:000000001FFC000400041FFC000400047FFF008000801F1001101E1010280FC6 +CFED:000000001FFC000400041FFC000400047FFF008000801F7C01401E7C10400F3C +CFEE:000000001FFC000400041FFC000400047FFF008000801F7E01241E2410240F7E +CFEF:000000001FFC000400041FFC000400047FFF008000801F3801001EFE10440F38 +CFF0:000000001FFC000400041FFC000400047FFF008000801FFC1004100410040FFC +CFF1:000000001FFC000400041FFC000400047FFF00800080100410041FFC10040FFC +CFF2:000000001FFC000400041FFC000400047FFF00800080111011101F1011280FC6 +CFF3:000000001FFC000400041FFC000400047FFF008000800080008001400630180C +CFF4:000000001FFC000400041FFC000400047FFF008000800410041004100A2831C6 +CFF5:000000001FFC000400041FFC000400047FFF008000800FF81004100410040FF8 +CFF6:000000001FFC000400041FFC000400047FFF008000801FFC008001400630180C +CFF7:000000001FFC000400041FFC000400047FFF0080008003E000001FFC02201C1C +CFF8:000000001FFC000400041FFC000400047FFF008000801FFC00041FFC00040004 +CFF9:000000001FFC000400041FFC000400047FFF008000801FFC10001FF810000FFC +CFFA:000000001FFC000400041FFC000400047FFF008000801FFC0410041004101FFC +CFFB:000000001FFC000400041FFC000400047FFF0080008003E000001FFC080807F0 +CFFC:000000003F84008400843F840084008400047FF404040404043C040404040404 +CFFD:000000003F84008400843F9C008400847FF4040404001FFC0004000400040004 +CFFE:000000003F84008400843F9C008400847FF4040404001F7C0104010401040104 +CFFF:000000003F84008400843F9C008400847FF4040404001F1001100110012801C6 +D000:000000003F84008400843F84008400847FF40404043C14041000100010000FFC +D001:000000003F84008400843F9C008400847FF404040400107C1010101010280FC6 +D002:000000003F84008400843F9C008400847FF4040404001038100010FE10440F38 +D003:000000003F84008400843F9C008400847FF4040404001FFC1000100010000FFC +D004:000000003F84008400843F9C008400847FF4040404001FFC00041FF810000FFC +D005:000000003F84008400843F9C008400847FF4040404001F7C01041E0410040F04 +D006:000000003F84008400843F9C008400847FF4040404001F7C01441E4410440F3C +D007:000000003F84008400843F9C008400847FF4040404001F4401441E7C10440F3C +D008:000000003F84008400843F9C008400847FF4040404001F1001101E1010280FC6 +D009:000000003F84008400843F9C008400847FF4040404001F7C01401E7C10400F3C +D00A:000000003F84008400843F9C008400847FF4040404001F7E01241E2410240F7E +D00B:000000003F84008400843F9C008400847FF4040404001F3801001EFE10440F38 +D00C:000000003F84008400843F9C008400847FF4040404001FFC1004100410040FFC +D00D:000000003F84008400843F9C008400847FF404040400100410041FFC10040FFC +D00E:000000003F84008400843F9C008400847FF404040400111011101F1011280FC6 +D00F:000000003F84008400843F9C008400847FF4040404000080008001400630180C +D010:000000003F84008400843F9C008400847FF4040404000410041004100A2831C6 +D011:000000003F84008400843F9C008400847FF4040404000FF81004100410040FF8 +D012:000000003F84008400843F9C008400847FF4040404001FFC008001400630180C +D013:000000003F84008400843F9C008400847FF40404040003E000001FFC02201C1C +D014:000000003F84008400843F9C008400847FF4040404001FFC00041FFC00040004 +D015:000000003F84008400843F9C008400847FF4040404001FFC10001FF810000FFC +D016:000000003F84008400843F9C008400847FF4040404001FFC0410041004101FFC +D017:000000003F84008400843F9C008400847FF40404040003E000001FFC080807F0 +D018:000000003F92009200923F920092009200127FD20412041204F2041204120412 +D019:000000003F92009200923FF2009200927FD2041204000FFE0002000200020002 +D01A:000000003F92009200923FF2009200927FD2041204000FBE0082008200820082 +D01B:000000003F92009200923FF2009200927FD2041204000F8800880088009400E3 +D01C:000000003F92009200923F92009200927FD2021202F20A1208000800080007FE +D01D:000000003F92009200923FF2009200927FD204120400083E08080808081407E3 +D01E:000000003F92009200923FF2009200927FD204120400081C0800087F0822079C +D01F:000000003F92009200923FF2009200927FD2041204000FFE08000800080007FE +D020:000000003F92009200923FF2009200927FD2041204000FFE00020FFC080007FE +D021:000000003F92009200923FF2009200927FD2041204000FBE00820F0208020782 +D022:000000003F92009200923FF2009200927FD2041204000FBE00A20F220822079E +D023:000000003F92009200923FF2009200927FD2041204000FA200A20F3E0822079E +D024:000000003F92009200923FF2009200927FD2041204000F8800880F08081407E3 +D025:000000003F92009200923FF2009200927FD2041204000FBE00A00F3E0820079E +D026:000000003F92009200923FF2009200927FD2041204000FBF00920F12081207BF +D027:000000003F92009200923FF2009200927FD2041204000F9C00800F7F0822079C +D028:000000003F92009200923FF2009200927FD2041204000FFE08020802080207FE +D029:000000003F92009200923FF2009200927FD204120400080208020FFE080207FE +D02A:000000003F92009200923FF2009200927FD204120400088808880F88089407E3 +D02B:000000003F92009200923FF2009200927FD2041204000040004000A003180C06 +D02C:000000003F92009200923FF2009200927FD204120400020802080208051418E3 +D02D:000000003F92009200923FF2009200927FD20412040007FC08020802080207FC +D02E:000000003F92009200923FF2009200927FD2041204000FFE004000A003180C06 +D02F:000000003F92009200923FF2009200927FD20412040001F000000FFE01100E0E +D030:000000003F92009200923FF2009200927FD2041204000FFE00020FFE00020002 +D031:000000003F92009200923FF2009200927FD2041204000FFE08000FFC080007FE +D032:000000003F92009200923FF2009200927FD2041204000FFE0208020802080FFE +D033:000000003F92009200923FF2009200927FD20412040001F000000FFE040403F8 +D034:000000003F84008400843F840084008400047FF4040404040404040404040404 +D035:000000003F84008400843F84008400847FF4040404001FFC0004000400040004 +D036:000000003F84008400843F84008400847FF4040404001F7C0104010401040104 +D037:000000003F84008400843F84008400847FF4040404001F1001100110012801C6 +D038:000000003F84008400843F84008400847FF40404040414041000100010000FFC +D039:000000003F84008400843F84008400847FF404040400107C1010101010280FC6 +D03A:000000003F84008400843F84008400847FF4040404001038100010FE10440F38 +D03B:000000003F84008400843F84008400847FF4040404001FFC1000100010000FFC +D03C:000000003F84008400843F84008400847FF4040404001FFC00041FF810000FFC +D03D:000000003F84008400843F84008400847FF4040404001F7C01041E0410040F04 +D03E:000000003F84008400843F84008400847FF4040404001F7C01441E4410440F3C +D03F:000000003F84008400843F84008400847FF4040404001F4401441E7C10440F3C +D040:000000003F84008400843F84008400847FF4040404001F1001101E1010280FC6 +D041:000000003F84008400843F84008400847FF4040404001F7C01401E7C10400F3C +D042:000000003F84008400843F84008400847FF4040404001F7E01241E2410240F7E +D043:000000003F84008400843F84008400847FF4040404001F3801001EFE10440F38 +D044:000000003F84008400843F84008400847FF4040404001FFC1004100410040FFC +D045:000000003F84008400843F84008400847FF404040400100410041FFC10040FFC +D046:000000003F84008400843F84008400847FF404040400111011101F1011280FC6 +D047:000000003F84008400843F84008400847FF4040404000080008001400630180C +D048:000000003F84008400843F84008400847FF4040404000410041004100A2831C6 +D049:000000003F84008400843F84008400847FF4040404000FF81004100410040FF8 +D04A:000000003F84008400843F84008400847FF4040404001FFC008001400630180C +D04B:000000003F84008400843F84008400847FF40404040003E000001FFC02201C1C +D04C:000000003F84008400843F84008400847FF4040404001FFC00041FFC00040004 +D04D:000000003F84008400843F84008400847FF4040404001FFC10001FF810000FFC +D04E:000000003F84008400843F84008400847FF4040404001FFC0410041004101FFC +D04F:000000003F84008400843F84008400847FF40404040003E000001FFC080807F0 +D050:000000001FFC000400041FFC0004000400007FFF041004100410041004100410 +D051:000000001FFC000400041FFC000400047FFF022002201FFC0004000400040004 +D052:000000001FFC000400041FFC000400047FFF022002201F7C0104010401040104 +D053:000000001FFC000400041FFC000400047FFF022002201F1001100110012801C6 +D054:000000001FFC000400041FFC0004000400007FFF022012201220100010000FFC +D055:000000001FFC000400041FFC000400047FFF02200220107C1010101010280FC6 +D056:000000001FFC000400041FFC000400047FFF022002201038100010FE10440F38 +D057:000000001FFC000400041FFC000400047FFF022002201FFC1000100010000FFC +D058:000000001FFC000400041FFC000400047FFF022002201FFC00041FF810000FFC +D059:000000001FFC000400041FFC000400047FFF022002201F7C01041E0410040F04 +D05A:000000001FFC000400041FFC000400047FFF022002201F7C01441E4410440F3C +D05B:000000001FFC000400041FFC000400047FFF022002201F4401441E7C10440F3C +D05C:000000001FFC000400041FFC000400047FFF022002201F1001101E1010280FC6 +D05D:000000001FFC000400041FFC000400047FFF022002201F7C01401E7C10400F3C +D05E:000000001FFC000400041FFC000400047FFF022002201F7E01241E2410240F7E +D05F:000000001FFC000400041FFC000400047FFF022002201F3801001EFE10440F38 +D060:000000001FFC000400041FFC000400047FFF022002201FFC1004100410040FFC +D061:000000001FFC000400041FFC000400047FFF02200220100410041FFC10040FFC +D062:000000001FFC000400041FFC000400047FFF02200220111011101F1011280FC6 +D063:000000001FFC000400041FFC000400047FFF022002200080008001400630180C +D064:000000001FFC000400041FFC000400047FFF022002200410041004100A2831C6 +D065:000000001FFC000400041FFC000400047FFF022002200FF81004100410040FF8 +D066:000000001FFC000400041FFC000400047FFF022002201FFC008001400630180C +D067:000000001FFC000400041FFC000400047FFF0220022003E000001FFC02201C1C +D068:000000001FFC000400041FFC000400047FFF022002201FFC00041FFC00040004 +D069:000000001FFC000400041FFC000400047FFF022002201FFC10001FF810000FFC +D06A:000000001FFC000400041FFC000400047FFF022002201FFC0410041004101FFC +D06B:000000001FFC000400041FFC000400047FFF0220022003E000001FFC080807F0 +D06C:0000000000001FFC000400041FFC0004000400040004000000007FFF00000000 +D06D:000000001FFC000400041FFC000400047FFF000000001FFC0004000400040004 +D06E:000000001FFC000400041FFC000400047FFF000000001F7C0104010401040104 +D06F:000000001FFC000400041FFC000400047FFF000000001F1001100110012801C6 +D070:000000001FFC000400041FFC0004000400007FFF000010001000100010000FFC +D071:000000001FFC000400041FFC000400047FFF00000000107C1010101010280FC6 +D072:000000001FFC000400041FFC000400047FFF000000001038100010FE10440F38 +D073:000000001FFC000400041FFC000400047FFF000000001FFC1000100010000FFC +D074:000000001FFC000400041FFC000400047FFF000000001FFC00041FF810000FFC +D075:000000001FFC000400041FFC000400047FFF000000001F7C01041E0410040F04 +D076:000000001FFC000400041FFC000400047FFF000000001F7C01441E4410440F3C +D077:000000001FFC000400041FFC000400047FFF000000001F4401441E7C10440F3C +D078:000000001FFC000400041FFC000400047FFF000000001F1001101E1010280FC6 +D079:000000001FFC000400041FFC000400047FFF000000001F7C01401E7C10400F3C +D07A:000000001FFC000400041FFC000400047FFF000000001F7E01241E2410240F7E +D07B:000000001FFC000400041FFC000400047FFF000000001F3801001EFE10440F38 +D07C:000000001FFC000400041FFC000400047FFF000000001FFC1004100410040FFC +D07D:000000001FFC000400041FFC000400047FFF00000000100410041FFC10040FFC +D07E:000000001FFC000400041FFC000400047FFF00000000111011101F1011280FC6 +D07F:000000001FFC000400041FFC000400047FFF000000000080008001400630180C +D080:000000001FFC000400041FFC000400047FFF000000000410041004100A2831C6 +D081:000000001FFC000400041FFC000400047FFF000000000FF81004100410040FF8 +D082:000000001FFC000400041FFC000400047FFF000000001FFC008001400630180C +D083:000000001FFC000400041FFC000400047FFF0000000003E000001FFC02201C1C +D084:000000001FFC000400041FFC000400047FFF000000001FFC00041FFC00040004 +D085:000000001FFC000400041FFC000400047FFF000000001FFC10001FF810000FFC +D086:000000001FFC000400041FFC000400047FFF000000001FFC0410041004101FFC +D087:000000001FFC000400041FFC000400047FFF0000000003E000001FFC080807F0 +D088:0000000000043F84008400843F840084008400840084000400047FF400040004 +D089:000000003F84008400843F84008400847FF4000400001FFC0004000400040004 +D08A:000000003F84008400843F84008400847FF4000400001F7C0104010401040104 +D08B:000000003F84008400843F84008400847FF4000400001F1001100110012801C6 +D08C:000000003F84008400843F840084008400047FF4000410041000100010000FFC +D08D:000000003F84008400843F84008400847FF400040000107C1010101010280FC6 +D08E:000000003F84008400843F84008400847FF4000400001038100010FE10440F38 +D08F:000000003F84008400843F84008400847FF4000400001FFC1000100010000FFC +D090:000000003F84008400843F84008400847FF4000400001FFC00041FF810000FFC +D091:000000003F84008400843F84008400847FF4000400001F7C01041E0410040F04 +D092:000000003F84008400843F84008400847FF4000400001F7C01441E4410440F3C +D093:000000003F84008400843F84008400847FF4000400001F4401441E7C10440F3C +D094:000000003F84008400843F84008400847FF4000400001F1001101E1010280FC6 +D095:000000003F84008400843F84008400847FF4000400001F7C01401E7C10400F3C +D096:000000003F84008400843F84008400847FF4000400001F7E01241E2410240F7E +D097:000000003F84008400843F84008400847FF4000400001F3801001EFE10440F38 +D098:000000003F84008400843F84008400847FF4000400001FFC1004100410040FFC +D099:000000003F84008400843F84008400847FF400040000100410041FFC10040FFC +D09A:000000003F84008400843F84008400847FF400040000111011101F1011280FC6 +D09B:000000003F84008400843F84008400847FF4000400000080008001400630180C +D09C:000000003F84008400843F84008400847FF4000400000410041004100A2831C6 +D09D:000000003F84008400843F84008400847FF4000400000FF81004100410040FF8 +D09E:000000003F84008400843F84008400847FF4000400001FFC008001400630180C +D09F:000000003F84008400843F84008400847FF40004000003E000001FFC02201C1C +D0A0:000000003F84008400843F84008400847FF4000400001FFC00041FFC00040004 +D0A1:000000003F84008400843F84008400847FF4000400001FFC10001FF810000FFC +D0A2:000000003F84008400843F84008400847FF4000400001FFC0410041004101FFC +D0A3:000000003F84008400843F84008400847FF40004000003E000001FFC080807F0 +D0A4:0000000000043F840084008403843C840104010402040C043004000400040004 +D0A5:000000003F84008400843F04010406043804000400001FFC0004000400040004 +D0A6:000000003F84008400843F04010406043804000400001F7C0104010401040104 +D0A7:000000003F84008400843F04010406043804000400001F1001100110012801C6 +D0A8:000000003F84008400843F040104060438040004000410041000100010000FFC +D0A9:000000003F84008400843F0401040604380400040000107C1010101010280FC6 +D0AA:000000003F84008400843F04010406043804000400001038100010FE10440F38 +D0AB:000000003F84008400843F04010406043804000400001FFC1000100010000FFC +D0AC:000000003F84008400843F04010406043804000400001FFC00041FF810000FFC +D0AD:000000003F84008400843F04010406043804000400001F7C01041E0410040F04 +D0AE:000000003F84008400843F04010406043804000400001F7C01441E4410440F3C +D0AF:000000003F84008400843F04010406043804000400001F4401441E7C10440F3C +D0B0:000000003F84008400843F04010406043804000400001F1001101E1010280FC6 +D0B1:000000003F84008400843F04010406043804000400001F7C01401E7C10400F3C +D0B2:000000003F84008400843F04010406043804000400001F7E01241E2410240F7E +D0B3:000000003F84008400843F04010406043804000400001F3801001EFE10440F38 +D0B4:000000003F84008400843F04010406043804000400001FFC1004100410040FFC +D0B5:000000003F84008400843F0401040604380400040000100410041FFC10040FFC +D0B6:000000003F84008400843F0401040604380400040000111011101F1011280FC6 +D0B7:000000003F84008400843F04010406043804000400000080008001400630180C +D0B8:000000003F84008400843F04010406043804000400000410041004100A2831C6 +D0B9:000000003F84008400843F04010406043804000400000FF81004100410040FF8 +D0BA:000000003F84008400843F04010406043804000400001FFC008001400630180C +D0BB:000000003F84008400843F040104060438040004000003E000001FFC02201C1C +D0BC:000000003F84008400843F04010406043804000400001FFC00041FFC00040004 +D0BD:000000003F84008400843F04010406043804000400001FFC10001FF810000FFC +D0BE:000000003F84008400843F04010406043804000400001FFC0410041004101FFC +D0BF:000000003F84008400843F040104060438040004000003E000001FFC080807F0 +D0C0:0000000000043F842004200420043F0720042004200420041F84000400040004 +D0C1:000000003F84200420043F07200420041F84000400001FFC0004000400040004 +D0C2:000000003F84200420043F07200420041F84000400001F7C0104010401040104 +D0C3:000000003F84200420043F07200420041F84000400001F1001100110012801C6 +D0C4:000000003F84200420043F07200420041F840004000410041000100010000FFC +D0C5:000000003F84200420043F07200420041F8400040000107C1010101010280FC6 +D0C6:000000003F84200420043F07200420041F84000400001038100010FE10440F38 +D0C7:000000003F84200420043F07200420041F84000400001FFC1000100010000FFC +D0C8:000000003F84200420043F07200420041F84000400001FFC00041FF810000FFC +D0C9:000000003F84200420043F07200420041F84000400001F7C01041E0410040F04 +D0CA:000000003F84200420043F07200420041F84000400001F7C01441E4410440F3C +D0CB:000000003F84200420043F07200420041F84000400001F4401441E7C10440F3C +D0CC:000000003F84200420043F07200420041F84000400001F1001101E1010280FC6 +D0CD:000000003F84200420043F07200420041F84000400001F7C01401E7C10400F3C +D0CE:000000003F84200420043F07200420041F84000400001F7E01241E2410240F7E +D0CF:000000003F84200420043F07200420041F84000400001F3801001EFE10440F38 +D0D0:000000003F84200420043F07200420041F84000400001FFC1004100410040FFC +D0D1:000000003F84200420043F07200420041F8400040000100410041FFC10040FFC +D0D2:000000003F84200420043F07200420041F8400040000111011101F1011280FC6 +D0D3:000000003F84200420043F07200420041F84000400000080008001400630180C +D0D4:000000003F84200420043F07200420041F84000400000410041004100A2831C6 +D0D5:000000003F84200420043F07200420041F84000400000FF81004100410040FF8 +D0D6:000000003F84200420043F07200420041F84000400001FFC008001400630180C +D0D7:000000003F84200420043F07200420041F840004000003E000001FFC02201C1C +D0D8:000000003F84200420043F07200420041F84000400001FFC00041FFC00040004 +D0D9:000000003F84200420043F07200420041F84000400001FFC10001FF810000FFC +D0DA:000000003F84200420043F07200420041F84000400001FFC0410041004101FFC +D0DB:000000003F84200420043F07200420041F840004000003E000001FFC080807F0 +D0DC:0000000000123F922012201220123F1E20122012201220121F92001200120012 +D0DD:000000003F92201220123F1E201220121F92001200000FFE0002000200020002 +D0DE:000000003F92201220123F1E201220121F92001200000FBE0082008200820082 +D0DF:000000003F92201220123F1E201220121F92001200000F8800880088009400E3 +D0E0:000000003F92201220123F1E201220121F9200120012081208000800080007FE +D0E1:000000003F92201220123F1E201220121F9200120000083E08080808081407E3 +D0E2:000000003F92201220123F1E201220121F9200120000081C0800087F0822079C +D0E3:000000003F92201220123F1E201220121F92001200000FFE08000800080007FE +D0E4:000000003F92201220123F1E201220121F92001200000FFE00020FFC080007FE +D0E5:000000003F92201220123F1E201220121F92001200000FBE00820F0208020782 +D0E6:000000003F92201220123F1E201220121F92001200000FBE00A20F220822079E +D0E7:000000003F92201220123F1E201220121F92001200000FA200A20F3E0822079E +D0E8:000000003F92201220123F1E201220121F92001200000F8800880F08081407E3 +D0E9:000000003F92201220123F1E201220121F92001200000FBE00A00F3E0820079E +D0EA:000000003F92201220123F1E201220121F92001200000FBF00920F12081207BF +D0EB:000000003F92201220123F1E201220121F92001200000F9C00800F7F0822079C +D0EC:000000003F92201220123F1E201220121F92001200000FFE08020802080207FE +D0ED:000000003F92201220123F1E201220121F9200120000080208020FFE080207FE +D0EE:000000003F92201220123F1E201220121F9200120000088808880F88089407E3 +D0EF:000000003F92201220123F1E201220121F92001200000040004000A003180C06 +D0F0:000000003F92201220123F1E201220121F9200120000020802080208051418E3 +D0F1:000000003F92201220123F1E201220121F920012000007FC08020802080207FC +D0F2:000000003F92201220123F1E201220121F92001200000FFE004000A003180C06 +D0F3:000000003F92201220123F1E201220121F920012000001F000000FFE01100E0E +D0F4:000000003F92201220123F1E201220121F92001200000FFE00020FFE00020002 +D0F5:000000003F92201220123F1E201220121F92001200000FFE08000FFC080007FE +D0F6:000000003F92201220123F1E201220121F92001200000FFE0208020802080FFE +D0F7:000000003F92201220123F1E201220121F920012000001F000000FFE040403F8 +D0F8:0000000000043F842004200420073F0420042007200420041F84000400040004 +D0F9:000000003F84200420073F04200420071F84000400001FFC0004000400040004 +D0FA:000000003F84200420073F04200420071F84000400001F7C0104010401040104 +D0FB:000000003F84200420073F04200420071F84000400001F1001100110012801C6 +D0FC:000000003F84200420073F04200420071F840004000410041000100010000FFC +D0FD:000000003F84200420073F04200420071F8400040000107C1010101010280FC6 +D0FE:000000003F84200420073F04200420071F84000400001038100010FE10440F38 +D0FF:000000003F84200420073F04200420071F84000400001FFC1000100010000FFC +D100:000000003F84200420073F04200420071F84000400001FFC00041FF810000FFC +D101:000000003F84200420073F04200420071F84000400001F7C01041E0410040F04 +D102:000000003F84200420073F04200420071F84000400001F7C01441E4410440F3C +D103:000000003F84200420073F04200420071F84000400001F4401441E7C10440F3C +D104:000000003F84200420073F04200420071F84000400001F1001101E1010280FC6 +D105:000000003F84200420073F04200420071F84000400001F7C01401E7C10400F3C +D106:000000003F84200420073F04200420071F84000400001F7E01241E2410240F7E +D107:000000003F84200420073F04200420071F84000400001F3801001EFE10440F38 +D108:000000003F84200420073F04200420071F84000400001FFC1004100410040FFC +D109:000000003F84200420073F04200420071F8400040000100410041FFC10040FFC +D10A:000000003F84200420073F04200420071F8400040000111011101F1011280FC6 +D10B:000000003F84200420073F04200420071F84000400000080008001400630180C +D10C:000000003F84200420073F04200420071F84000400000410041004100A2831C6 +D10D:000000003F84200420073F04200420071F84000400000FF81004100410040FF8 +D10E:000000003F84200420073F04200420071F84000400001FFC008001400630180C +D10F:000000003F84200420073F04200420071F840004000003E000001FFC02201C1C +D110:000000003F84200420073F04200420071F84000400001FFC00041FFC00040004 +D111:000000003F84200420073F04200420071F84000400001FFC10001FF810000FFC +D112:000000003F84200420073F04200420071F84000400001FFC0410041004101FFC +D113:000000003F84200420073F04200420071F840004000003E000001FFC080807F0 +D114:0000000000123F9220122012201E3F122012201E201220121F92001200120012 +D115:000000003F922012201E3F122012201E1F92001200000FFE0002000200020002 +D116:000000003F922012201E3F122012201E1F92001200000FBE0082008200820082 +D117:000000003F922012201E3F122012201E1F92001200000F8800880088009400E3 +D118:000000003F922012201E3F122012201E1F9200120012081208000800080007FE +D119:000000003F922012201E3F122012201E1F9200120000083E08080808081407E3 +D11A:000000003F922012201E3F122012201E1F9200120000081C0800087F0822079C +D11B:000000003F922012201E3F122012201E1F92001200000FFE08000800080007FE +D11C:000000003F922012201E3F122012201E1F92001200000FFE00020FFC080007FE +D11D:000000003F922012201E3F122012201E1F92001200000FBE00820F0208020782 +D11E:000000003F922012201E3F122012201E1F92001200000FBE00A20F220822079E +D11F:000000003F922012201E3F122012201E1F92001200000FA200A20F3E0822079E +D120:000000003F922012201E3F122012201E1F92001200000F8800880F08081407E3 +D121:000000003F922012201E3F122012201E1F92001200000FBE00A00F3E0820079E +D122:000000003F922012201E3F122012201E1F92001200000FBF00920F12081207BF +D123:000000003F922012201E3F122012201E1F92001200000F9C00800F7F0822079C +D124:000000003F922012201E3F122012201E1F92001200000FFE08020802080207FE +D125:000000003F922012201E3F122012201E1F9200120000080208020FFE080207FE +D126:000000003F922012201E3F122012201E1F9200120000088808880F88089407E3 +D127:000000003F922012201E3F122012201E1F92001200000040004000A003180C06 +D128:000000003F922012201E3F122012201E1F9200120000020802080208051418E3 +D129:000000003F922012201E3F122012201E1F920012000007FC08020802080207FC +D12A:000000003F922012201E3F122012201E1F92001200000FFE004000A003180C06 +D12B:000000003F922012201E3F122012201E1F920012000001F000000FFE01100E0E +D12C:000000003F922012201E3F122012201E1F92001200000FFE00020FFE00020002 +D12D:000000003F922012201E3F122012201E1F92001200000FFE08000FFC080007FE +D12E:000000003F922012201E3F122012201E1F92001200000FFE0208020802080FFE +D12F:000000003F922012201E3F122012201E1F920012000001F000000FFE040403F8 +D130:0000000000043F842004200420043F3C20042004200420041F84000400040004 +D131:000000003F84200420043F3C200420041F84000400001FFC0004000400040004 +D132:000000003F84200420043F3C200420041F84000400001F7C0104010401040104 +D133:000000003F84200420043F3C200420041F84000400001F1001100110012801C6 +D134:000000003F84200420043F3C200420041F840004000410041000100010000FFC +D135:000000003F84200420043F3C200420041F8400040000107C1010101010280FC6 +D136:000000003F84200420043F3C200420041F84000400001038100010FE10440F38 +D137:000000003F84200420043F3C200420041F84000400001FFC1000100010000FFC +D138:000000003F84200420043F3C200420041F84000400001FFC00041FF810000FFC +D139:000000003F84200420043F3C200420041F84000400001F7C01041E0410040F04 +D13A:000000003F84200420043F3C200420041F84000400001F7C01441E4410440F3C +D13B:000000003F84200420043F3C200420041F84000400001F4401441E7C10440F3C +D13C:000000003F84200420043F3C200420041F84000400001F1001101E1010280FC6 +D13D:000000003F84200420043F3C200420041F84000400001F7C01401E7C10400F3C +D13E:000000003F84200420043F3C200420041F84000400001F7E01241E2410240F7E +D13F:000000003F84200420043F3C200420041F84000400001F3801001EFE10440F38 +D140:000000003F84200420043F3C200420041F84000400001FFC1004100410040FFC +D141:000000003F84200420043F3C200420041F8400040000100410041FFC10040FFC +D142:000000003F84200420043F3C200420041F8400040000111011101F1011280FC6 +D143:000000003F84200420043F3C200420041F84000400000080008001400630180C +D144:000000003F84200420043F3C200420041F84000400000410041004100A2831C6 +D145:000000003F84200420043F3C200420041F84000400000FF81004100410040FF8 +D146:000000003F84200420043F3C200420041F84000400001FFC008001400630180C +D147:000000003F84200420043F3C200420041F840004000003E000001FFC02201C1C +D148:000000003F84200420043F3C200420041F84000400001FFC00041FFC00040004 +D149:000000003F84200420043F3C200420041F84000400001FFC10001FF810000FFC +D14A:000000003F84200420043F3C200420041F84000400001FFC0410041004101FFC +D14B:000000003F84200420043F3C200420041F840004000003E000001FFC080807F0 +D14C:0000000000123F922012201220123F7220122012201220121F92001200120012 +D14D:000000003F92201220123F72201220121F92001200000FFE0002000200020002 +D14E:000000003F92201220123F72201220121F92001200000FBE0082008200820082 +D14F:000000003F92201220123F72201220121F92001200000F8800880088009400E3 +D150:000000003F92201220123F72201220121F9200120012081208000800080007FE +D151:000000003F92201220123F72201220121F9200120000083E08080808081407E3 +D152:000000003F92201220123F72201220121F9200120000081C0800087F0822079C +D153:000000003F92201220123F72201220121F92001200000FFE08000800080007FE +D154:000000003F92201220123F72201220121F92001200000FFE00020FFC080007FE +D155:000000003F92201220123F72201220121F92001200000FBE00820F0208020782 +D156:000000003F92201220123F72201220121F92001200000FBE00A20F220822079E +D157:000000003F92201220123F72201220121F92001200000FA200A20F3E0822079E +D158:000000003F92201220123F72201220121F92001200000F8800880F08081407E3 +D159:000000003F92201220123F72201220121F92001200000FBE00A00F3E0820079E +D15A:000000003F92201220123F72201220121F92001200000FBF00920F12081207BF +D15B:000000003F92201220123F72201220121F92001200000F9C00800F7F0822079C +D15C:000000003F92201220123F72201220121F92001200000FFE08020802080207FE +D15D:000000003F92201220123F72201220121F9200120000080208020FFE080207FE +D15E:000000003F92201220123F72201220121F9200120000088808880F88089407E3 +D15F:000000003F92201220123F72201220121F92001200000040004000A003180C06 +D160:000000003F92201220123F72201220121F9200120000020802080208051418E3 +D161:000000003F92201220123F72201220121F920012000007FC08020802080207FC +D162:000000003F92201220123F72201220121F92001200000FFE004000A003180C06 +D163:000000003F92201220123F72201220121F920012000001F000000FFE01100E0E +D164:000000003F92201220123F72201220121F92001200000FFE00020FFE00020002 +D165:000000003F92201220123F72201220121F92001200000FFE08000FFC080007FE +D166:000000003F92201220123F72201220121F92001200000FFE0208020802080FFE +D167:000000003F92201220123F72201220121F920012000001F000000FFE040403F8 +D168:0000000000043F8420042004203C3F042004203C200420041F84000400040004 +D169:000000003F842004203C3F042004203C1F84000400001FFC0004000400040004 +D16A:000000003F842004203C3F042004203C1F84000400001F7C0104010401040104 +D16B:000000003F842004203C3F042004203C1F84000400001F1001100110012801C6 +D16C:000000003F842004203C3F042004203C1F840004000410041000100010000FFC +D16D:000000003F842004203C3F042004203C1F8400040000107C1010101010280FC6 +D16E:000000003F842004203C3F042004203C1F84000400001038100010FE10440F38 +D16F:000000003F842004203C3F042004203C1F84000400001FFC1000100010000FFC +D170:000000003F842004203C3F042004203C1F84000400001FFC00041FF810000FFC +D171:000000003F842004203C3F042004203C1F84000400001F7C01041E0410040F04 +D172:000000003F842004203C3F042004203C1F84000400001F7C01441E4410440F3C +D173:000000003F842004203C3F042004203C1F84000400001F4401441E7C10440F3C +D174:000000003F842004203C3F042004203C1F84000400001F1001101E1010280FC6 +D175:000000003F842004203C3F042004203C1F84000400001F7C01401E7C10400F3C +D176:000000003F842004203C3F042004203C1F84000400001F7E01241E2410240F7E +D177:000000003F842004203C3F042004203C1F84000400001F3801001EFE10440F38 +D178:000000003F842004203C3F042004203C1F84000400001FFC1004100410040FFC +D179:000000003F842004203C3F042004203C1F8400040000100410041FFC10040FFC +D17A:000000003F842004203C3F042004203C1F8400040000111011101F1011280FC6 +D17B:000000003F842004203C3F042004203C1F84000400000080008001400630180C +D17C:000000003F842004203C3F042004203C1F84000400000410041004100A2831C6 +D17D:000000003F842004203C3F042004203C1F84000400000FF81004100410040FF8 +D17E:000000003F842004203C3F042004203C1F84000400001FFC008001400630180C +D17F:000000003F842004203C3F042004203C1F840004000003E000001FFC02201C1C +D180:000000003F842004203C3F042004203C1F84000400001FFC00041FFC00040004 +D181:000000003F842004203C3F042004203C1F84000400001FFC10001FF810000FFC +D182:000000003F842004203C3F042004203C1F84000400001FFC0410041004101FFC +D183:000000003F842004203C3F042004203C1F840004000003E000001FFC080807F0 +D184:0000000000123F922012201220723F1220122072201220121F92001200120012 +D185:000000003F92201220723F12201220721F92001200000FFE0002000200020002 +D186:000000003F92201220723F12201220721F92001200000FBE0082008200820082 +D187:000000003F92201220723F12201220721F92001200000F8800880088009400E3 +D188:000000003F92201220723F12201220721F9200120012081208000800080007FE +D189:000000003F92201220723F12201220721F9200120000083E08080808081407E3 +D18A:000000003F92201220723F12201220721F9200120000081C0800087F0822079C +D18B:000000003F92201220723F12201220721F92001200000FFE08000800080007FE +D18C:000000003F92201220723F12201220721F92001200000FFE00020FFC080007FE +D18D:000000003F92201220723F12201220721F92001200000FBE00820F0208020782 +D18E:000000003F92201220723F12201220721F92001200000FBE00A20F220822079E +D18F:000000003F92201220723F12201220721F92001200000FA200A20F3E0822079E +D190:000000003F92201220723F12201220721F92001200000F8800880F08081407E3 +D191:000000003F92201220723F12201220721F92001200000FBE00A00F3E0820079E +D192:000000003F92201220723F12201220721F92001200000FBF00920F12081207BF +D193:000000003F92201220723F12201220721F92001200000F9C00800F7F0822079C +D194:000000003F92201220723F12201220721F92001200000FFE08020802080207FE +D195:000000003F92201220723F12201220721F9200120000080208020FFE080207FE +D196:000000003F92201220723F12201220721F9200120000088808880F88089407E3 +D197:000000003F92201220723F12201220721F92001200000040004000A003180C06 +D198:000000003F92201220723F12201220721F9200120000020802080208051418E3 +D199:000000003F92201220723F12201220721F920012000007FC08020802080207FC +D19A:000000003F92201220723F12201220721F92001200000FFE004000A003180C06 +D19B:000000003F92201220723F12201220721F920012000001F000000FFE01100E0E +D19C:000000003F92201220723F12201220721F92001200000FFE00020FFE00020002 +D19D:000000003F92201220723F12201220721F92001200000FFE08000FFC080007FE +D19E:000000003F92201220723F12201220721F92001200000FFE0208020802080FFE +D19F:000000003F92201220723F12201220721F920012000001F000000FFE040403F8 +D1A0:0000000000001FFC100010001FF8100010000FFC0080008000807FFF00000000 +D1A1:000000001FFC10001FF810000FFC008000807FFF00001FFC0004000400040004 +D1A2:000000001FFC10001FF810000FFC008000807FFF00001F7C0104010401040104 +D1A3:000000001FFC10001FF810000FFC008000807FFF00001F1001100110012801C6 +D1A4:000000001FFC10001FF810000FFC008000807FFF000010001000100010000FFC +D1A5:000000001FFC10001FF810000FFC008000807FFF0000107C1010101010280FC6 +D1A6:000000001FFC10001FF810000FFC008000807FFF00001038100010FE10440F38 +D1A7:000000001FFC10001FF810000FFC008000807FFF00001FFC1000100010000FFC +D1A8:000000001FFC10001FF810000FFC008000807FFF00001FFC00041FF810000FFC +D1A9:000000001FFC10001FF810000FFC008000807FFF00001F7C01041E0410040F04 +D1AA:000000001FFC10001FF810000FFC008000807FFF00001F7C01441E4410440F3C +D1AB:000000001FFC10001FF810000FFC008000807FFF00001F4401441E7C10440F3C +D1AC:000000001FFC10001FF810000FFC008000807FFF00001F1001101E1010280FC6 +D1AD:000000001FFC10001FF810000FFC008000807FFF00001F7C01401E7C10400F3C +D1AE:000000001FFC10001FF810000FFC008000807FFF00001F7E01241E2410240F7E +D1AF:000000001FFC10001FF810000FFC008000807FFF00001F3801001EFE10440F38 +D1B0:000000001FFC10001FF810000FFC008000807FFF00001FFC1004100410040FFC +D1B1:000000001FFC10001FF810000FFC008000807FFF0000100410041FFC10040FFC +D1B2:000000001FFC10001FF810000FFC008000807FFF0000111011101F1011280FC6 +D1B3:000000001FFC10001FF810000FFC008000807FFF00000080008001400630180C +D1B4:000000001FFC10001FF810000FFC008000807FFF00000410041004100A2831C6 +D1B5:000000001FFC10001FF810000FFC008000807FFF00000FF81004100410040FF8 +D1B6:000000001FFC10001FF810000FFC008000807FFF00001FFC008001400630180C +D1B7:000000001FFC10001FF810000FFC008000807FFF000003E000001FFC02201C1C +D1B8:000000001FFC10001FF810000FFC008000807FFF00001FFC00041FFC00040004 +D1B9:000000001FFC10001FF810000FFC008000807FFF00001FFC10001FF810000FFC +D1BA:000000001FFC10001FF810000FFC008000807FFF00001FFC0410041004101FFC +D1BB:000000001FFC10001FF810000FFC008000807FFF000003E000001FFC080807F0 +D1BC:0000000000043F84200420043F04200720041F840404040404047FF400040004 +D1BD:000000003F8420043F0420071F84040404047FF400001FFC0004000400040004 +D1BE:000000003F8420043F0420071F84040404047FF400001F7C0104010401040104 +D1BF:000000003F8420043F0420071F84040404047FF400001F1001100110012801C6 +D1C0:000000003F8420043F0420071F84040404047FF4000410041000100010000FFC +D1C1:000000003F8420043F0420071F84040404047FF40000107C1010101010280FC6 +D1C2:000000003F8420043F0420071F84040404047FF400001038100010FE10440F38 +D1C3:000000003F8420043F0420071F84040404047FF400001FFC1000100010000FFC +D1C4:000000003F8420043F0420071F84040404047FF400001FFC00041FF810000FFC +D1C5:000000003F8420043F0420071F84040404047FF400001F7C01041E0410040F04 +D1C6:000000003F8420043F0420071F84040404047FF400001F7C01441E4410440F3C +D1C7:000000003F8420043F0420071F84040404047FF400001F4401441E7C10440F3C +D1C8:000000003F8420043F0420071F84040404047FF400001F1001101E1010280FC6 +D1C9:000000003F8420043F0420071F84040404047FF400001F7C01401E7C10400F3C +D1CA:000000003F8420043F0420071F84040404047FF400001F7E01241E2410240F7E +D1CB:000000003F8420043F0420071F84040404047FF400001F3801001EFE10440F38 +D1CC:000000003F8420043F0420071F84040404047FF400001FFC1004100410040FFC +D1CD:000000003F8420043F0420071F84040404047FF40000100410041FFC10040FFC +D1CE:000000003F8420043F0420071F84040404047FF40000111011101F1011280FC6 +D1CF:000000003F8420043F0420071F84040404047FF400000080008001400630180C +D1D0:000000003F8420043F0420071F84040404047FF400000410041004100A2831C6 +D1D1:000000003F8420043F0420071F84040404047FF400000FF81004100410040FF8 +D1D2:000000003F8420043F0420071F84040404047FF400001FFC008001400630180C +D1D3:000000003F8420043F0420071F84040404047FF4000003E000001FFC02201C1C +D1D4:000000003F8420043F0420071F84040404047FF400001FFC00041FFC00040004 +D1D5:000000003F8420043F0420071F84040404047FF400001FFC10001FF810000FFC +D1D6:000000003F8420043F0420071F84040404047FF400001FFC0410041004101FFC +D1D7:000000003F8420043F0420071F84040404047FF4000003E000001FFC080807F0 +D1D8:0000000000123F92201220123F12201E20121F920412041204127FD200120012 +D1D9:000000003F9220123F12201E1F92041204127FD200000FFE0002000200020002 +D1DA:000000003F9220123F12201E1F92041204127FD200000FBE0082008200820082 +D1DB:000000003F9220123F12201E1F92041204127FD200000F8800880088009400E3 +D1DC:000000003F9220123F12201E1F92041204127FD20012081208000800080007FE +D1DD:000000003F9220123F12201E1F92041204127FD20000083E08080808081407E3 +D1DE:000000003F9220123F12201E1F92041204127FD20000081C0800087F0822079C +D1DF:000000003F9220123F12201E1F92041204127FD200000FFE08000800080007FE +D1E0:000000003F9220123F12201E1F92041204127FD200000FFE00020FFC080007FE +D1E1:000000003F9220123F12201E1F92041204127FD200000FBE00820F0208020782 +D1E2:000000003F9220123F12201E1F92041204127FD200000FBE00A20F220822079E +D1E3:000000003F9220123F12201E1F92041204127FD200000FA200A20F3E0822079E +D1E4:000000003F9220123F12201E1F92041204127FD200000F8800880F08081407E3 +D1E5:000000003F9220123F12201E1F92041204127FD200000FBE00A00F3E0820079E +D1E6:000000003F9220123F12201E1F92041204127FD200000FBF00920F12081207BF +D1E7:000000003F9220123F12201E1F92041204127FD200000F9C00800F7F0822079C +D1E8:000000003F9220123F12201E1F92041204127FD200000FFE08020802080207FE +D1E9:000000003F9220123F12201E1F92041204127FD20000080208020FFE080207FE +D1EA:000000003F9220123F12201E1F92041204127FD20000088808880F88089407E3 +D1EB:000000003F9220123F12201E1F92041204127FD200000040004000A003180C06 +D1EC:000000003F9220123F12201E1F92041204127FD20000020802080208051418E3 +D1ED:000000003F9220123F12201E1F92041204127FD2000007FC08020802080207FC +D1EE:000000003F9220123F12201E1F92041204127FD200000FFE004000A003180C06 +D1EF:000000003F9220123F12201E1F92041204127FD2000001F000000FFE01100E0E +D1F0:000000003F9220123F12201E1F92041204127FD200000FFE00020FFE00020002 +D1F1:000000003F9220123F12201E1F92041204127FD200000FFE08000FFC080007FE +D1F2:000000003F9220123F12201E1F92041204127FD200000FFE0208020802080FFE +D1F3:000000003F9220123F12201E1F92041204127FD2000001F000000FFE040403F8 +D1F4:0000000000043F84200420043F04200420041F840404040404047FF400040004 +D1F5:000000003F8420043F0420041F84040404047FF400001FFC0004000400040004 +D1F6:000000003F8420043F0420041F84040404047FF400001F7C0104010401040104 +D1F7:000000003F8420043F0420041F84040404047FF400001F1001100110012801C6 +D1F8:000000003F8420043F0420041F84040404047FF4000410041000100010000FFC +D1F9:000000003F8420043F0420041F84040404047FF40000107C1010101010280FC6 +D1FA:000000003F8420043F0420041F84040404047FF400001038100010FE10440F38 +D1FB:000000003F8420043F0420041F84040404047FF400001FFC1000100010000FFC +D1FC:000000003F8420043F0420041F84040404047FF400001FFC00041FF810000FFC +D1FD:000000003F8420043F0420041F84040404047FF400001F7C01041E0410040F04 +D1FE:000000003F8420043F0420041F84040404047FF400001F7C01441E4410440F3C +D1FF:000000003F8420043F0420041F84040404047FF400001F4401441E7C10440F3C +D200:000000003F8420043F0420041F84040404047FF400001F1001101E1010280FC6 +D201:000000003F8420043F0420041F84040404047FF400001F7C01401E7C10400F3C +D202:000000003F8420043F0420041F84040404047FF400001F7E01241E2410240F7E +D203:000000003F8420043F0420041F84040404047FF400001F3801001EFE10440F38 +D204:000000003F8420043F0420041F84040404047FF400001FFC1004100410040FFC +D205:000000003F8420043F0420041F84040404047FF40000100410041FFC10040FFC +D206:000000003F8420043F0420041F84040404047FF40000111011101F1011280FC6 +D207:000000003F8420043F0420041F84040404047FF400000080008001400630180C +D208:000000003F8420043F0420041F84040404047FF400000410041004100A2831C6 +D209:000000003F8420043F0420041F84040404047FF400000FF81004100410040FF8 +D20A:000000003F8420043F0420041F84040404047FF400001FFC008001400630180C +D20B:000000003F8420043F0420041F84040404047FF4000003E000001FFC02201C1C +D20C:000000003F8420043F0420041F84040404047FF400001FFC00041FFC00040004 +D20D:000000003F8420043F0420041F84040404047FF400001FFC10001FF810000FFC +D20E:000000003F8420043F0420041F84040404047FF400001FFC0410041004101FFC +D20F:000000003F8420043F0420041F84040404047FF4000003E000001FFC080807F0 +D210:0000000000001FFC100010001FF8100010000FFC0220022002207FFF00000000 +D211:000000001FFC10001FF810000FFC022002207FFF00001FFC0004000400040004 +D212:000000001FFC10001FF810000FFC022002207FFF00001F7C0104010401040104 +D213:000000001FFC10001FF810000FFC022002207FFF00001F1001100110012801C6 +D214:000000001FFC10001FF810000FFC022002207FFF000010001000100010000FFC +D215:000000001FFC10001FF810000FFC022002207FFF0000107C1010101010280FC6 +D216:000000001FFC10001FF810000FFC022002207FFF00001038100010FE10440F38 +D217:000000001FFC10001FF810000FFC022002207FFF00001FFC1000100010000FFC +D218:000000001FFC10001FF810000FFC022002207FFF00001FFC00041FF810000FFC +D219:000000001FFC10001FF810000FFC022002207FFF00001F7C01041E0410040F04 +D21A:000000001FFC10001FF810000FFC022002207FFF00001F7C01441E4410440F3C +D21B:000000001FFC10001FF810000FFC022002207FFF00001F4401441E7C10440F3C +D21C:000000001FFC10001FF810000FFC022002207FFF00001F1001101E1010280FC6 +D21D:000000001FFC10001FF810000FFC022002207FFF00001F7C01401E7C10400F3C +D21E:000000001FFC10001FF810000FFC022002207FFF00001F7E01241E2410240F7E +D21F:000000001FFC10001FF810000FFC022002207FFF00001F3801001EFE10440F38 +D220:000000001FFC10001FF810000FFC022002207FFF00001FFC1004100410040FFC +D221:000000001FFC10001FF810000FFC022002207FFF0000100410041FFC10040FFC +D222:000000001FFC10001FF810000FFC022002207FFF0000111011101F1011280FC6 +D223:000000001FFC10001FF810000FFC022002207FFF00000080008001400630180C +D224:000000001FFC10001FF810000FFC022002207FFF00000410041004100A2831C6 +D225:000000001FFC10001FF810000FFC022002207FFF00000FF81004100410040FF8 +D226:000000001FFC10001FF810000FFC022002207FFF00001FFC008001400630180C +D227:000000001FFC10001FF810000FFC022002207FFF000003E000001FFC02201C1C +D228:000000001FFC10001FF810000FFC022002207FFF00001FFC00041FFC00040004 +D229:000000001FFC10001FF810000FFC022002207FFF00001FFC10001FF810000FFC +D22A:000000001FFC10001FF810000FFC022002207FFF00001FFC0410041004101FFC +D22B:000000001FFC10001FF810000FFC022002207FFF000003E000001FFC080807F0 +D22C:000000001FFC10001FF810000FFC000000007FFF008000800080008000800080 +D22D:000000001FFC10001FF810000FFC00007FFF008000801FFC0004000400040004 +D22E:000000001FFC10001FF810000FFC00007FFF008000801F7C0104010401040104 +D22F:000000001FFC10001FF810000FFC00007FFF008000801F1001100110012801C6 +D230:000000001FFC10001FF810000FFC000000007FFF008010801080100010000FFC +D231:000000001FFC10001FF810000FFC00007FFF00800080107C1010101010280FC6 +D232:000000001FFC10001FF810000FFC00007FFF008000801038100010FE10440F38 +D233:000000001FFC10001FF810000FFC00007FFF008000801FFC1000100010000FFC +D234:000000001FFC10001FF810000FFC00007FFF008000801FFC00041FF810000FFC +D235:000000001FFC10001FF810000FFC00007FFF008000801F7C01041E0410040F04 +D236:000000001FFC10001FF810000FFC00007FFF008000801F7C01441E4410440F3C +D237:000000001FFC10001FF810000FFC00007FFF008000801F4401441E7C10440F3C +D238:000000001FFC10001FF810000FFC00007FFF008000801F1001101E1010280FC6 +D239:000000001FFC10001FF810000FFC00007FFF008000801F7C01401E7C10400F3C +D23A:000000001FFC10001FF810000FFC00007FFF008000801F7E01241E2410240F7E +D23B:000000001FFC10001FF810000FFC00007FFF008000801F3801001EFE10440F38 +D23C:000000001FFC10001FF810000FFC00007FFF008000801FFC1004100410040FFC +D23D:000000001FFC10001FF810000FFC00007FFF00800080100410041FFC10040FFC +D23E:000000001FFC10001FF810000FFC00007FFF00800080111011101F1011280FC6 +D23F:000000001FFC10001FF810000FFC00007FFF008000800080008001400630180C +D240:000000001FFC10001FF810000FFC00007FFF008000800410041004100A2831C6 +D241:000000001FFC10001FF810000FFC00007FFF008000800FF81004100410040FF8 +D242:000000001FFC10001FF810000FFC00007FFF008000801FFC008001400630180C +D243:000000001FFC10001FF810000FFC00007FFF0080008003E000001FFC02201C1C +D244:000000001FFC10001FF810000FFC00007FFF008000801FFC00041FFC00040004 +D245:000000001FFC10001FF810000FFC00007FFF008000801FFC10001FF810000FFC +D246:000000001FFC10001FF810000FFC00007FFF008000801FFC0410041004101FFC +D247:000000001FFC10001FF810000FFC00007FFF0080008003E000001FFC080807F0 +D248:000000003F8420043F0420041F84000400047FF404040404043C040404040404 +D249:000000003F8420043F04201C1F8400047FF4040404001FFC0004000400040004 +D24A:000000003F8420043F04201C1F8400047FF4040404001F7C0104010401040104 +D24B:000000003F8420043F04201C1F8400047FF4040404001F1001100110012801C6 +D24C:000000003F8420043F0420041F8400047FF40404043C14041000100010000FFC +D24D:000000003F8420043F04201C1F8400047FF404040400107C1010101010280FC6 +D24E:000000003F8420043F04201C1F8400047FF4040404001038100010FE10440F38 +D24F:000000003F8420043F04201C1F8400047FF4040404001FFC1000100010000FFC +D250:000000003F8420043F04201C1F8400047FF4040404001FFC00041FF810000FFC +D251:000000003F8420043F04201C1F8400047FF4040404001F7C01041E0410040F04 +D252:000000003F8420043F04201C1F8400047FF4040404001F7C01441E4410440F3C +D253:000000003F8420043F04201C1F8400047FF4040404001F4401441E7C10440F3C +D254:000000003F8420043F04201C1F8400047FF4040404001F1001101E1010280FC6 +D255:000000003F8420043F04201C1F8400047FF4040404001F7C01401E7C10400F3C +D256:000000003F8420043F04201C1F8400047FF4040404001F7E01241E2410240F7E +D257:000000003F8420043F04201C1F8400047FF4040404001F3801001EFE10440F38 +D258:000000003F8420043F04201C1F8400047FF4040404001FFC1004100410040FFC +D259:000000003F8420043F04201C1F8400047FF404040400100410041FFC10040FFC +D25A:000000003F8420043F04201C1F8400047FF404040400111011101F1011280FC6 +D25B:000000003F8420043F04201C1F8400047FF4040404000080008001400630180C +D25C:000000003F8420043F04201C1F8400047FF4040404000410041004100A2831C6 +D25D:000000003F8420043F04201C1F8400047FF4040404000FF81004100410040FF8 +D25E:000000003F8420043F04201C1F8400047FF4040404001FFC008001400630180C +D25F:000000003F8420043F04201C1F8400047FF40404040003E000001FFC02201C1C +D260:000000003F8420043F04201C1F8400047FF4040404001FFC00041FFC00040004 +D261:000000003F8420043F04201C1F8400047FF4040404001FFC10001FF810000FFC +D262:000000003F8420043F04201C1F8400047FF4040404001FFC0410041004101FFC +D263:000000003F8420043F04201C1F8400047FF40404040003E000001FFC080807F0 +D264:000000003F9220123F1220121F92001200127FD20412041204F2041204120412 +D265:000000003F9220123F1220721F9200127FD2041204000FFE0002000200020002 +D266:000000003F9220123F1220721F9200127FD2041204000FBE0082008200820082 +D267:000000003F9220123F1220721F9200127FD2041204000F8800880088009400E3 +D268:000000003F9220123F1220121F9200127FD2021202F20A1208000800080007FE +D269:000000003F9220123F1220721F9200127FD204120400083E08080808081407E3 +D26A:000000003F9220123F1220721F9200127FD204120400081C0800087F0822079C +D26B:000000003F9220123F1220721F9200127FD2041204000FFE08000800080007FE +D26C:000000003F9220123F1220721F9200127FD2041204000FFE00020FFC080007FE +D26D:000000003F9220123F1220721F9200127FD2041204000FBE00820F0208020782 +D26E:000000003F9220123F1220721F9200127FD2041204000FBE00A20F220822079E +D26F:000000003F9220123F1220721F9200127FD2041204000FA200A20F3E0822079E +D270:000000003F9220123F1220721F9200127FD2041204000F8800880F08081407E3 +D271:000000003F9220123F1220721F9200127FD2041204000FBE00A00F3E0820079E +D272:000000003F9220123F1220721F9200127FD2041204000FBF00920F12081207BF +D273:000000003F9220123F1220721F9200127FD2041204000F9C00800F7F0822079C +D274:000000003F9220123F1220721F9200127FD2041204000FFE08020802080207FE +D275:000000003F9220123F1220721F9200127FD204120400080208020FFE080207FE +D276:000000003F9220123F1220721F9200127FD204120400088808880F88089407E3 +D277:000000003F9220123F1220721F9200127FD2041204000040004000A003180C06 +D278:000000003F9220123F1220721F9200127FD204120400020802080208051418E3 +D279:000000003F9220123F1220721F9200127FD20412040007FC08020802080207FC +D27A:000000003F9220123F1220721F9200127FD2041204000FFE004000A003180C06 +D27B:000000003F9220123F1220721F9200127FD20412040001F000000FFE01100E0E +D27C:000000003F9220123F1220721F9200127FD2041204000FFE00020FFE00020002 +D27D:000000003F9220123F1220721F9200127FD2041204000FFE08000FFC080007FE +D27E:000000003F9220123F1220721F9200127FD2041204000FFE0208020802080FFE +D27F:000000003F9220123F1220721F9200127FD20412040001F000000FFE040403F8 +D280:000000003F8420043F0420041F84000400047FF4040404040404040404040404 +D281:000000003F8420043F0420041F8400047FF4040404001FFC0004000400040004 +D282:000000003F8420043F0420041F8400047FF4040404001F7C0104010401040104 +D283:000000003F8420043F0420041F8400047FF4040404001F1001100110012801C6 +D284:000000003F8420043F0420041F8400047FF40404040414041000100010000FFC +D285:000000003F8420043F0420041F8400047FF404040400107C1010101010280FC6 +D286:000000003F8420043F0420041F8400047FF4040404001038100010FE10440F38 +D287:000000003F8420043F0420041F8400047FF4040404001FFC1000100010000FFC +D288:000000003F8420043F0420041F8400047FF4040404001FFC00041FF810000FFC +D289:000000003F8420043F0420041F8400047FF4040404001F7C01041E0410040F04 +D28A:000000003F8420043F0420041F8400047FF4040404001F7C01441E4410440F3C +D28B:000000003F8420043F0420041F8400047FF4040404001F4401441E7C10440F3C +D28C:000000003F8420043F0420041F8400047FF4040404001F1001101E1010280FC6 +D28D:000000003F8420043F0420041F8400047FF4040404001F7C01401E7C10400F3C +D28E:000000003F8420043F0420041F8400047FF4040404001F7E01241E2410240F7E +D28F:000000003F8420043F0420041F8400047FF4040404001F3801001EFE10440F38 +D290:000000003F8420043F0420041F8400047FF4040404001FFC1004100410040FFC +D291:000000003F8420043F0420041F8400047FF404040400100410041FFC10040FFC +D292:000000003F8420043F0420041F8400047FF404040400111011101F1011280FC6 +D293:000000003F8420043F0420041F8400047FF4040404000080008001400630180C +D294:000000003F8420043F0420041F8400047FF4040404000410041004100A2831C6 +D295:000000003F8420043F0420041F8400047FF4040404000FF81004100410040FF8 +D296:000000003F8420043F0420041F8400047FF4040404001FFC008001400630180C +D297:000000003F8420043F0420041F8400047FF40404040003E000001FFC02201C1C +D298:000000003F8420043F0420041F8400047FF4040404001FFC00041FFC00040004 +D299:000000003F8420043F0420041F8400047FF4040404001FFC10001FF810000FFC +D29A:000000003F8420043F0420041F8400047FF4040404001FFC0410041004101FFC +D29B:000000003F8420043F0420041F8400047FF40404040003E000001FFC080807F0 +D29C:000000001FFC10001FF810000FFC000000007FFF041004100410041004100410 +D29D:000000001FFC10001FF810000FFC00007FFF022002201FFC0004000400040004 +D29E:000000001FFC10001FF810000FFC00007FFF022002201F7C0104010401040104 +D29F:000000001FFC10001FF810000FFC00007FFF022002201F1001100110012801C6 +D2A0:000000001FFC10001FF810000FFC000000007FFF022012201220100010000FFC +D2A1:000000001FFC10001FF810000FFC00007FFF02200220107C1010101010280FC6 +D2A2:000000001FFC10001FF810000FFC00007FFF022002201038100010FE10440F38 +D2A3:000000001FFC10001FF810000FFC00007FFF022002201FFC1000100010000FFC +D2A4:000000001FFC10001FF810000FFC00007FFF022002201FFC00041FF810000FFC +D2A5:000000001FFC10001FF810000FFC00007FFF022002201F7C01041E0410040F04 +D2A6:000000001FFC10001FF810000FFC00007FFF022002201F7C01441E4410440F3C +D2A7:000000001FFC10001FF810000FFC00007FFF022002201F4401441E7C10440F3C +D2A8:000000001FFC10001FF810000FFC00007FFF022002201F1001101E1010280FC6 +D2A9:000000001FFC10001FF810000FFC00007FFF022002201F7C01401E7C10400F3C +D2AA:000000001FFC10001FF810000FFC00007FFF022002201F7E01241E2410240F7E +D2AB:000000001FFC10001FF810000FFC00007FFF022002201F3801001EFE10440F38 +D2AC:000000001FFC10001FF810000FFC00007FFF022002201FFC1004100410040FFC +D2AD:000000001FFC10001FF810000FFC00007FFF02200220100410041FFC10040FFC +D2AE:000000001FFC10001FF810000FFC00007FFF02200220111011101F1011280FC6 +D2AF:000000001FFC10001FF810000FFC00007FFF022002200080008001400630180C +D2B0:000000001FFC10001FF810000FFC00007FFF022002200410041004100A2831C6 +D2B1:000000001FFC10001FF810000FFC00007FFF022002200FF81004100410040FF8 +D2B2:000000001FFC10001FF810000FFC00007FFF022002201FFC008001400630180C +D2B3:000000001FFC10001FF810000FFC00007FFF0220022003E000001FFC02201C1C +D2B4:000000001FFC10001FF810000FFC00007FFF022002201FFC00041FFC00040004 +D2B5:000000001FFC10001FF810000FFC00007FFF022002201FFC10001FF810000FFC +D2B6:000000001FFC10001FF810000FFC00007FFF022002201FFC0410041004101FFC +D2B7:000000001FFC10001FF810000FFC00007FFF0220022003E000001FFC080807F0 +D2B8:0000000000001FFC100010001FF8100010000FFC0000000000007FFF00000000 +D2B9:000000001FFC10001FF810000FFC00007FFF000000001FFC0004000400040004 +D2BA:000000001FFC10001FF810000FFC00007FFF000000001F7C0104010401040104 +D2BB:000000001FFC10001FF810000FFC00007FFF000000001F1001100110012801C6 +D2BC:000000001FFC10001FF810000FFC000000007FFF000010001000100010000FFC +D2BD:000000001FFC10001FF810000FFC00007FFF00000000107C1010101010280FC6 +D2BE:000000001FFC10001FF810000FFC00007FFF000000001038100010FE10440F38 +D2BF:000000001FFC10001FF810000FFC00007FFF000000001FFC1000100010000FFC +D2C0:000000001FFC10001FF810000FFC00007FFF000000001FFC00041FF810000FFC +D2C1:000000001FFC10001FF810000FFC00007FFF000000001F7C01041E0410040F04 +D2C2:000000001FFC10001FF810000FFC00007FFF000000001F7C01441E4410440F3C +D2C3:000000001FFC10001FF810000FFC00007FFF000000001F4401441E7C10440F3C +D2C4:000000001FFC10001FF810000FFC00007FFF000000001F1001101E1010280FC6 +D2C5:000000001FFC10001FF810000FFC00007FFF000000001F7C01401E7C10400F3C +D2C6:000000001FFC10001FF810000FFC00007FFF000000001F7E01241E2410240F7E +D2C7:000000001FFC10001FF810000FFC00007FFF000000001F3801001EFE10440F38 +D2C8:000000001FFC10001FF810000FFC00007FFF000000001FFC1004100410040FFC +D2C9:000000001FFC10001FF810000FFC00007FFF00000000100410041FFC10040FFC +D2CA:000000001FFC10001FF810000FFC00007FFF00000000111011101F1011280FC6 +D2CB:000000001FFC10001FF810000FFC00007FFF000000000080008001400630180C +D2CC:000000001FFC10001FF810000FFC00007FFF000000000410041004100A2831C6 +D2CD:000000001FFC10001FF810000FFC00007FFF000000000FF81004100410040FF8 +D2CE:000000001FFC10001FF810000FFC00007FFF000000001FFC008001400630180C +D2CF:000000001FFC10001FF810000FFC00007FFF0000000003E000001FFC02201C1C +D2D0:000000001FFC10001FF810000FFC00007FFF000000001FFC00041FFC00040004 +D2D1:000000001FFC10001FF810000FFC00007FFF000000001FFC10001FF810000FFC +D2D2:000000001FFC10001FF810000FFC00007FFF000000001FFC0410041004101FFC +D2D3:000000001FFC10001FF810000FFC00007FFF0000000003E000001FFC080807F0 +D2D4:0000000000043F84200420043F04200420041F840004000400047FF400040004 +D2D5:000000003F8420043F0420041F8400047FF4000400001FFC0004000400040004 +D2D6:000000003F8420043F0420041F8400047FF4000400001F7C0104010401040104 +D2D7:000000003F8420043F0420041F8400047FF4000400001F1001100110012801C6 +D2D8:000000003F8420043F0420041F84000400047FF4000410041000100010000FFC +D2D9:000000003F8420043F0420041F8400047FF400040000107C1010101010280FC6 +D2DA:000000003F8420043F0420041F8400047FF4000400001038100010FE10440F38 +D2DB:000000003F8420043F0420041F8400047FF4000400001FFC1000100010000FFC +D2DC:000000003F8420043F0420041F8400047FF4000400001FFC00041FF810000FFC +D2DD:000000003F8420043F0420041F8400047FF4000400001F7C01041E0410040F04 +D2DE:000000003F8420043F0420041F8400047FF4000400001F7C01441E4410440F3C +D2DF:000000003F8420043F0420041F8400047FF4000400001F4401441E7C10440F3C +D2E0:000000003F8420043F0420041F8400047FF4000400001F1001101E1010280FC6 +D2E1:000000003F8420043F0420041F8400047FF4000400001F7C01401E7C10400F3C +D2E2:000000003F8420043F0420041F8400047FF4000400001F7E01241E2410240F7E +D2E3:000000003F8420043F0420041F8400047FF4000400001F3801001EFE10440F38 +D2E4:000000003F8420043F0420041F8400047FF4000400001FFC1004100410040FFC +D2E5:000000003F8420043F0420041F8400047FF400040000100410041FFC10040FFC +D2E6:000000003F8420043F0420041F8400047FF400040000111011101F1011280FC6 +D2E7:000000003F8420043F0420041F8400047FF4000400000080008001400630180C +D2E8:000000003F8420043F0420041F8400047FF4000400000410041004100A2831C6 +D2E9:000000003F8420043F0420041F8400047FF4000400000FF81004100410040FF8 +D2EA:000000003F8420043F0420041F8400047FF4000400001FFC008001400630180C +D2EB:000000003F8420043F0420041F8400047FF40004000003E000001FFC02201C1C +D2EC:000000003F8420043F0420041F8400047FF4000400001FFC00041FFC00040004 +D2ED:000000003F8420043F0420041F8400047FF4000400001FFC10001FF810000FFC +D2EE:000000003F8420043F0420041F8400047FF4000400001FFC0410041004101FFC +D2EF:000000003F8420043F0420041F8400047FF40004000003E000001FFC080807F0 +D2F0:0000000000043F842004200420043F0420042004200420041F84000400040004 +D2F1:000000003F84200420043F04200420041F84000400001FFC0004000400040004 +D2F2:000000003F84200420043F04200420041F84000400001F7C0104010401040104 +D2F3:000000003F84200420043F04200420041F84000400001F1001100110012801C6 +D2F4:000000003F84200420043F04200420041F840004000410041000100010000FFC +D2F5:000000003F84200420043F04200420041F8400040000107C1010101010280FC6 +D2F6:000000003F84200420043F04200420041F84000400001038100010FE10440F38 +D2F7:000000003F84200420043F04200420041F84000400001FFC1000100010000FFC +D2F8:000000003F84200420043F04200420041F84000400001FFC00041FF810000FFC +D2F9:000000003F84200420043F04200420041F84000400001F7C01041E0410040F04 +D2FA:000000003F84200420043F04200420041F84000400001F7C01441E4410440F3C +D2FB:000000003F84200420043F04200420041F84000400001F4401441E7C10440F3C +D2FC:000000003F84200420043F04200420041F84000400001F1001101E1010280FC6 +D2FD:000000003F84200420043F04200420041F84000400001F7C01401E7C10400F3C +D2FE:000000003F84200420043F04200420041F84000400001F7E01241E2410240F7E +D2FF:000000003F84200420043F04200420041F84000400001F3801001EFE10440F38 +D300:000000003F84200420043F04200420041F84000400001FFC1004100410040FFC +D301:000000003F84200420043F04200420041F8400040000100410041FFC10040FFC +D302:000000003F84200420043F04200420041F8400040000111011101F1011280FC6 +D303:000000003F84200420043F04200420041F84000400000080008001400630180C +D304:000000003F84200420043F04200420041F84000400000410041004100A2831C6 +D305:000000003F84200420043F04200420041F84000400000FF81004100410040FF8 +D306:000000003F84200420043F04200420041F84000400001FFC008001400630180C +D307:000000003F84200420043F04200420041F840004000003E000001FFC02201C1C +D308:000000003F84200420043F04200420041F84000400001FFC00041FFC00040004 +D309:000000003F84200420043F04200420041F84000400001FFC10001FF810000FFC +D30A:000000003F84200420043F04200420041F84000400001FFC0410041004101FFC +D30B:000000003F84200420043F04200420041F840004000003E000001FFC080807F0 +D30C:0000000000043F84000411041104110711041104110411043F84000400040004 +D30D:000000003F84000411041107110411043F84000400001FFC0004000400040004 +D30E:000000003F84000411041107110411043F84000400001F7C0104010401040104 +D30F:000000003F84000411041107110411043F84000400001F1001100110012801C6 +D310:000000003F84000411041107110411043F840004000410041000100010000FFC +D311:000000003F84000411041107110411043F8400040000107C1010101010280FC6 +D312:000000003F84000411041107110411043F84000400001038100010FE10440F38 +D313:000000003F84000411041107110411043F84000400001FFC1000100010000FFC +D314:000000003F84000411041107110411043F84000400001FFC00041FF810000FFC +D315:000000003F84000411041107110411043F84000400001F7C01041E0410040F04 +D316:000000003F84000411041107110411043F84000400001F7C01441E4410440F3C +D317:000000003F84000411041107110411043F84000400001F4401441E7C10440F3C +D318:000000003F84000411041107110411043F84000400001F1001101E1010280FC6 +D319:000000003F84000411041107110411043F84000400001F7C01401E7C10400F3C +D31A:000000003F84000411041107110411043F84000400001F7E01241E2410240F7E +D31B:000000003F84000411041107110411043F84000400001F3801001EFE10440F38 +D31C:000000003F84000411041107110411043F84000400001FFC1004100410040FFC +D31D:000000003F84000411041107110411043F8400040000100410041FFC10040FFC +D31E:000000003F84000411041107110411043F8400040000111011101F1011280FC6 +D31F:000000003F84000411041107110411043F84000400000080008001400630180C +D320:000000003F84000411041107110411043F84000400000410041004100A2831C6 +D321:000000003F84000411041107110411043F84000400000FF81004100410040FF8 +D322:000000003F84000411041107110411043F84000400001FFC008001400630180C +D323:000000003F84000411041107110411043F840004000003E000001FFC02201C1C +D324:000000003F84000411041107110411043F84000400001FFC00041FFC00040004 +D325:000000003F84000411041107110411043F84000400001FFC10001FF810000FFC +D326:000000003F84000411041107110411043F84000400001FFC0410041004101FFC +D327:000000003F84000411041107110411043F840004000003E000001FFC080807F0 +D328:0000000000123F92001211121112111E11121112111211123F92001200120012 +D329:000000003F9200121112111E111211123F92001200000FFE0002000200020002 +D32A:000000003F9200121112111E111211123F92001200000FBE0082008200820082 +D32B:000000003F9200121112111E111211123F92001200000F8800880088009400E3 +D32C:000000003F9200121112111E111211123F9200120012081208000800080007FE +D32D:000000003F9200121112111E111211123F9200120000083E08080808081407E3 +D32E:000000003F9200121112111E111211123F9200120000081C0800087F0822079C +D32F:000000003F9200121112111E111211123F92001200000FFE08000800080007FE +D330:000000003F9200121112111E111211123F92001200000FFE00020FFC080007FE +D331:000000003F9200121112111E111211123F92001200000FBE00820F0208020782 +D332:000000003F9200121112111E111211123F92001200000FBE00A20F220822079E +D333:000000003F9200121112111E111211123F92001200000FA200A20F3E0822079E +D334:000000003F9200121112111E111211123F92001200000F8800880F08081407E3 +D335:000000003F9200121112111E111211123F92001200000FBE00A00F3E0820079E +D336:000000003F9200121112111E111211123F92001200000FBF00920F12081207BF +D337:000000003F9200121112111E111211123F92001200000F9C00800F7F0822079C +D338:000000003F9200121112111E111211123F92001200000FFE08020802080207FE +D339:000000003F9200121112111E111211123F9200120000080208020FFE080207FE +D33A:000000003F9200121112111E111211123F9200120000088808880F88089407E3 +D33B:000000003F9200121112111E111211123F92001200000040004000A003180C06 +D33C:000000003F9200121112111E111211123F9200120000020802080208051418E3 +D33D:000000003F9200121112111E111211123F920012000007FC08020802080207FC +D33E:000000003F9200121112111E111211123F92001200000FFE004000A003180C06 +D33F:000000003F9200121112111E111211123F920012000001F000000FFE01100E0E +D340:000000003F9200121112111E111211123F92001200000FFE00020FFE00020002 +D341:000000003F9200121112111E111211123F92001200000FFE08000FFC080007FE +D342:000000003F9200121112111E111211123F92001200000FFE0208020802080FFE +D343:000000003F9200121112111E111211123F920012000001F000000FFE040403F8 +D344:0000000000043F84000411041107110411041107110411043F84000400040004 +D345:000000003F84000411071104110411073F84000400001FFC0004000400040004 +D346:000000003F84000411071104110411073F84000400001F7C0104010401040104 +D347:000000003F84000411071104110411073F84000400001F1001100110012801C6 +D348:000000003F84000411071104110411073F840004000410041000100010000FFC +D349:000000003F84000411071104110411073F8400040000107C1010101010280FC6 +D34A:000000003F84000411071104110411073F84000400001038100010FE10440F38 +D34B:000000003F84000411071104110411073F84000400001FFC1000100010000FFC +D34C:000000003F84000411071104110411073F84000400001FFC00041FF810000FFC +D34D:000000003F84000411071104110411073F84000400001F7C01041E0410040F04 +D34E:000000003F84000411071104110411073F84000400001F7C01441E4410440F3C +D34F:000000003F84000411071104110411073F84000400001F4401441E7C10440F3C +D350:000000003F84000411071104110411073F84000400001F1001101E1010280FC6 +D351:000000003F84000411071104110411073F84000400001F7C01401E7C10400F3C +D352:000000003F84000411071104110411073F84000400001F7E01241E2410240F7E +D353:000000003F84000411071104110411073F84000400001F3801001EFE10440F38 +D354:000000003F84000411071104110411073F84000400001FFC1004100410040FFC +D355:000000003F84000411071104110411073F8400040000100410041FFC10040FFC +D356:000000003F84000411071104110411073F8400040000111011101F1011280FC6 +D357:000000003F84000411071104110411073F84000400000080008001400630180C +D358:000000003F84000411071104110411073F84000400000410041004100A2831C6 +D359:000000003F84000411071104110411073F84000400000FF81004100410040FF8 +D35A:000000003F84000411071104110411073F84000400001FFC008001400630180C +D35B:000000003F84000411071104110411073F840004000003E000001FFC02201C1C +D35C:000000003F84000411071104110411073F84000400001FFC00041FFC00040004 +D35D:000000003F84000411071104110411073F84000400001FFC10001FF810000FFC +D35E:000000003F84000411071104110411073F84000400001FFC0410041004101FFC +D35F:000000003F84000411071104110411073F840004000003E000001FFC080807F0 +D360:0000000000123F9200121112111E11121112111E111211123F92001200120012 +D361:000000003F920012111E11121112111E3F92001200000FFE0002000200020002 +D362:000000003F920012111E11121112111E3F92001200000FBE0082008200820082 +D363:000000003F920012111E11121112111E3F92001200000F8800880088009400E3 +D364:000000003F920012111E11121112111E3F9200120012081208000800080007FE +D365:000000003F920012111E11121112111E3F9200120000083E08080808081407E3 +D366:000000003F920012111E11121112111E3F9200120000081C0800087F0822079C +D367:000000003F920012111E11121112111E3F92001200000FFE08000800080007FE +D368:000000003F920012111E11121112111E3F92001200000FFE00020FFC080007FE +D369:000000003F920012111E11121112111E3F92001200000FBE00820F0208020782 +D36A:000000003F920012111E11121112111E3F92001200000FBE00A20F220822079E +D36B:000000003F920012111E11121112111E3F92001200000FA200A20F3E0822079E +D36C:000000003F920012111E11121112111E3F92001200000F8800880F08081407E3 +D36D:000000003F920012111E11121112111E3F92001200000FBE00A00F3E0820079E +D36E:000000003F920012111E11121112111E3F92001200000FBF00920F12081207BF +D36F:000000003F920012111E11121112111E3F92001200000F9C00800F7F0822079C +D370:000000003F920012111E11121112111E3F92001200000FFE08020802080207FE +D371:000000003F920012111E11121112111E3F9200120000080208020FFE080207FE +D372:000000003F920012111E11121112111E3F9200120000088808880F88089407E3 +D373:000000003F920012111E11121112111E3F92001200000040004000A003180C06 +D374:000000003F920012111E11121112111E3F9200120000020802080208051418E3 +D375:000000003F920012111E11121112111E3F920012000007FC08020802080207FC +D376:000000003F920012111E11121112111E3F92001200000FFE004000A003180C06 +D377:000000003F920012111E11121112111E3F920012000001F000000FFE01100E0E +D378:000000003F920012111E11121112111E3F92001200000FFE00020FFE00020002 +D379:000000003F920012111E11121112111E3F92001200000FFE08000FFC080007FE +D37A:000000003F920012111E11121112111E3F92001200000FFE0208020802080FFE +D37B:000000003F920012111E11121112111E3F920012000001F000000FFE040403F8 +D37C:0000000000043F84000411041104113C11041104110411043F84000400040004 +D37D:000000003F8400041104113C110411043F84000400001FFC0004000400040004 +D37E:000000003F8400041104113C110411043F84000400001F7C0104010401040104 +D37F:000000003F8400041104113C110411043F84000400001F1001100110012801C6 +D380:000000003F8400041104113C110411043F840004000410041000100010000FFC +D381:000000003F8400041104113C110411043F8400040000107C1010101010280FC6 +D382:000000003F8400041104113C110411043F84000400001038100010FE10440F38 +D383:000000003F8400041104113C110411043F84000400001FFC1000100010000FFC +D384:000000003F8400041104113C110411043F84000400001FFC00041FF810000FFC +D385:000000003F8400041104113C110411043F84000400001F7C01041E0410040F04 +D386:000000003F8400041104113C110411043F84000400001F7C01441E4410440F3C +D387:000000003F8400041104113C110411043F84000400001F4401441E7C10440F3C +D388:000000003F8400041104113C110411043F84000400001F1001101E1010280FC6 +D389:000000003F8400041104113C110411043F84000400001F7C01401E7C10400F3C +D38A:000000003F8400041104113C110411043F84000400001F7E01241E2410240F7E +D38B:000000003F8400041104113C110411043F84000400001F3801001EFE10440F38 +D38C:000000003F8400041104113C110411043F84000400001FFC1004100410040FFC +D38D:000000003F8400041104113C110411043F8400040000100410041FFC10040FFC +D38E:000000003F8400041104113C110411043F8400040000111011101F1011280FC6 +D38F:000000003F8400041104113C110411043F84000400000080008001400630180C +D390:000000003F8400041104113C110411043F84000400000410041004100A2831C6 +D391:000000003F8400041104113C110411043F84000400000FF81004100410040FF8 +D392:000000003F8400041104113C110411043F84000400001FFC008001400630180C +D393:000000003F8400041104113C110411043F840004000003E000001FFC02201C1C +D394:000000003F8400041104113C110411043F84000400001FFC00041FFC00040004 +D395:000000003F8400041104113C110411043F84000400001FFC10001FF810000FFC +D396:000000003F8400041104113C110411043F84000400001FFC0410041004101FFC +D397:000000003F8400041104113C110411043F840004000003E000001FFC080807F0 +D398:0000000000123F92001211121112117211121112111211123F92001200120012 +D399:000000003F92001211121172111211123F92001200000FFE0002000200020002 +D39A:000000003F92001211121172111211123F92001200000FBE0082008200820082 +D39B:000000003F92001211121172111211123F92001200000F8800880088009400E3 +D39C:000000003F92001211121172111211123F9200120012081208000800080007FE +D39D:000000003F92001211121172111211123F9200120000083E08080808081407E3 +D39E:000000003F92001211121172111211123F9200120000081C0800087F0822079C +D39F:000000003F92001211121172111211123F92001200000FFE08000800080007FE +D3A0:000000003F92001211121172111211123F92001200000FFE00020FFC080007FE +D3A1:000000003F92001211121172111211123F92001200000FBE00820F0208020782 +D3A2:000000003F92001211121172111211123F92001200000FBE00A20F220822079E +D3A3:000000003F92001211121172111211123F92001200000FA200A20F3E0822079E +D3A4:000000003F92001211121172111211123F92001200000F8800880F08081407E3 +D3A5:000000003F92001211121172111211123F92001200000FBE00A00F3E0820079E +D3A6:000000003F92001211121172111211123F92001200000FBF00920F12081207BF +D3A7:000000003F92001211121172111211123F92001200000F9C00800F7F0822079C +D3A8:000000003F92001211121172111211123F92001200000FFE08020802080207FE +D3A9:000000003F92001211121172111211123F9200120000080208020FFE080207FE +D3AA:000000003F92001211121172111211123F9200120000088808880F88089407E3 +D3AB:000000003F92001211121172111211123F92001200000040004000A003180C06 +D3AC:000000003F92001211121172111211123F9200120000020802080208051418E3 +D3AD:000000003F92001211121172111211123F920012000007FC08020802080207FC +D3AE:000000003F92001211121172111211123F92001200000FFE004000A003180C06 +D3AF:000000003F92001211121172111211123F920012000001F000000FFE01100E0E +D3B0:000000003F92001211121172111211123F92001200000FFE00020FFE00020002 +D3B1:000000003F92001211121172111211123F92001200000FFE08000FFC080007FE +D3B2:000000003F92001211121172111211123F92001200000FFE0208020802080FFE +D3B3:000000003F92001211121172111211123F920012000001F000000FFE040403F8 +D3B4:0000000000043F8400041104113C11041104113C110411043F84000400040004 +D3B5:000000003F840004113C11041104113C3F84000400001FFC0004000400040004 +D3B6:000000003F840004113C11041104113C3F84000400001F7C0104010401040104 +D3B7:000000003F840004113C11041104113C3F84000400001F1001100110012801C6 +D3B8:000000003F840004113C11041104113C3F840004000410041000100010000FFC +D3B9:000000003F840004113C11041104113C3F8400040000107C1010101010280FC6 +D3BA:000000003F840004113C11041104113C3F84000400001038100010FE10440F38 +D3BB:000000003F840004113C11041104113C3F84000400001FFC1000100010000FFC +D3BC:000000003F840004113C11041104113C3F84000400001FFC00041FF810000FFC +D3BD:000000003F840004113C11041104113C3F84000400001F7C01041E0410040F04 +D3BE:000000003F840004113C11041104113C3F84000400001F7C01441E4410440F3C +D3BF:000000003F840004113C11041104113C3F84000400001F4401441E7C10440F3C +D3C0:000000003F840004113C11041104113C3F84000400001F1001101E1010280FC6 +D3C1:000000003F840004113C11041104113C3F84000400001F7C01401E7C10400F3C +D3C2:000000003F840004113C11041104113C3F84000400001F7E01241E2410240F7E +D3C3:000000003F840004113C11041104113C3F84000400001F3801001EFE10440F38 +D3C4:000000003F840004113C11041104113C3F84000400001FFC1004100410040FFC +D3C5:000000003F840004113C11041104113C3F8400040000100410041FFC10040FFC +D3C6:000000003F840004113C11041104113C3F8400040000111011101F1011280FC6 +D3C7:000000003F840004113C11041104113C3F84000400000080008001400630180C +D3C8:000000003F840004113C11041104113C3F84000400000410041004100A2831C6 +D3C9:000000003F840004113C11041104113C3F84000400000FF81004100410040FF8 +D3CA:000000003F840004113C11041104113C3F84000400001FFC008001400630180C +D3CB:000000003F840004113C11041104113C3F840004000003E000001FFC02201C1C +D3CC:000000003F840004113C11041104113C3F84000400001FFC00041FFC00040004 +D3CD:000000003F840004113C11041104113C3F84000400001FFC10001FF810000FFC +D3CE:000000003F840004113C11041104113C3F84000400001FFC0410041004101FFC +D3CF:000000003F840004113C11041104113C3F840004000003E000001FFC080807F0 +D3D0:0000000000123F92001211121172111211121172111211123F92001200120012 +D3D1:000000003F92001211721112111211723F92001200000FFE0002000200020002 +D3D2:000000003F92001211721112111211723F92001200000FBE0082008200820082 +D3D3:000000003F92001211721112111211723F92001200000F8800880088009400E3 +D3D4:000000003F92001211721112111211723F9200120012081208000800080007FE +D3D5:000000003F92001211721112111211723F9200120000083E08080808081407E3 +D3D6:000000003F92001211721112111211723F9200120000081C0800087F0822079C +D3D7:000000003F92001211721112111211723F92001200000FFE08000800080007FE +D3D8:000000003F92001211721112111211723F92001200000FFE00020FFC080007FE +D3D9:000000003F92001211721112111211723F92001200000FBE00820F0208020782 +D3DA:000000003F92001211721112111211723F92001200000FBE00A20F220822079E +D3DB:000000003F92001211721112111211723F92001200000FA200A20F3E0822079E +D3DC:000000003F92001211721112111211723F92001200000F8800880F08081407E3 +D3DD:000000003F92001211721112111211723F92001200000FBE00A00F3E0820079E +D3DE:000000003F92001211721112111211723F92001200000FBF00920F12081207BF +D3DF:000000003F92001211721112111211723F92001200000F9C00800F7F0822079C +D3E0:000000003F92001211721112111211723F92001200000FFE08020802080207FE +D3E1:000000003F92001211721112111211723F9200120000080208020FFE080207FE +D3E2:000000003F92001211721112111211723F9200120000088808880F88089407E3 +D3E3:000000003F92001211721112111211723F92001200000040004000A003180C06 +D3E4:000000003F92001211721112111211723F9200120000020802080208051418E3 +D3E5:000000003F92001211721112111211723F920012000007FC08020802080207FC +D3E6:000000003F92001211721112111211723F92001200000FFE004000A003180C06 +D3E7:000000003F92001211721112111211723F920012000001F000000FFE01100E0E +D3E8:000000003F92001211721112111211723F92001200000FFE00020FFE00020002 +D3E9:000000003F92001211721112111211723F92001200000FFE08000FFC080007FE +D3EA:000000003F92001211721112111211723F92001200000FFE0208020802080FFE +D3EB:000000003F92001211721112111211723F920012000001F000000FFE040403F8 +D3EC:0000000000001FFC000004100410041004101FFC0080008000807FFF00000000 +D3ED:000000001FFC0410041004101FFC008000807FFF00001FFC0004000400040004 +D3EE:000000001FFC0410041004101FFC008000807FFF00001F7C0104010401040104 +D3EF:000000001FFC0410041004101FFC008000807FFF00001F1001100110012801C6 +D3F0:000000001FFC0410041004101FFC008000807FFF000010001000100010000FFC +D3F1:000000001FFC0410041004101FFC008000807FFF0000107C1010101010280FC6 +D3F2:000000001FFC0410041004101FFC008000807FFF00001038100010FE10440F38 +D3F3:000000001FFC0410041004101FFC008000807FFF00001FFC1000100010000FFC +D3F4:000000001FFC0410041004101FFC008000807FFF00001FFC00041FF810000FFC +D3F5:000000001FFC0410041004101FFC008000807FFF00001F7C01041E0410040F04 +D3F6:000000001FFC0410041004101FFC008000807FFF00001F7C01441E4410440F3C +D3F7:000000001FFC0410041004101FFC008000807FFF00001F4401441E7C10440F3C +D3F8:000000001FFC0410041004101FFC008000807FFF00001F1001101E1010280FC6 +D3F9:000000001FFC0410041004101FFC008000807FFF00001F7C01401E7C10400F3C +D3FA:000000001FFC0410041004101FFC008000807FFF00001F7E01241E2410240F7E +D3FB:000000001FFC0410041004101FFC008000807FFF00001F3801001EFE10440F38 +D3FC:000000001FFC0410041004101FFC008000807FFF00001FFC1004100410040FFC +D3FD:000000001FFC0410041004101FFC008000807FFF0000100410041FFC10040FFC +D3FE:000000001FFC0410041004101FFC008000807FFF0000111011101F1011280FC6 +D3FF:000000001FFC0410041004101FFC008000807FFF00000080008001400630180C +D400:000000001FFC0410041004101FFC008000807FFF00000410041004100A2831C6 +D401:000000001FFC0410041004101FFC008000807FFF00000FF81004100410040FF8 +D402:000000001FFC0410041004101FFC008000807FFF00001FFC008001400630180C +D403:000000001FFC0410041004101FFC008000807FFF000003E000001FFC02201C1C +D404:000000001FFC0410041004101FFC008000807FFF00001FFC00041FFC00040004 +D405:000000001FFC0410041004101FFC008000807FFF00001FFC10001FF810000FFC +D406:000000001FFC0410041004101FFC008000807FFF00001FFC0410041004101FFC +D407:000000001FFC0410041004101FFC008000807FFF000003E000001FFC080807F0 +D408:0000000000043F84000411041104110711043F840404040404047FF400040004 +D409:000000003F841104110411073F84040404047FF400001FFC0004000400040004 +D40A:000000003F841104110411073F84040404047FF400001F7C0104010401040104 +D40B:000000003F841104110411073F84040404047FF400001F1001100110012801C6 +D40C:000000003F841104110411073F84040404047FF4000410041000100010000FFC +D40D:000000003F841104110411073F84040404047FF40000107C1010101010280FC6 +D40E:000000003F841104110411073F84040404047FF400001038100010FE10440F38 +D40F:000000003F841104110411073F84040404047FF400001FFC1000100010000FFC +D410:000000003F841104110411073F84040404047FF400001FFC00041FF810000FFC +D411:000000003F841104110411073F84040404047FF400001F7C01041E0410040F04 +D412:000000003F841104110411073F84040404047FF400001F7C01441E4410440F3C +D413:000000003F841104110411073F84040404047FF400001F4401441E7C10440F3C +D414:000000003F841104110411073F84040404047FF400001F1001101E1010280FC6 +D415:000000003F841104110411073F84040404047FF400001F7C01401E7C10400F3C +D416:000000003F841104110411073F84040404047FF400001F7E01241E2410240F7E +D417:000000003F841104110411073F84040404047FF400001F3801001EFE10440F38 +D418:000000003F841104110411073F84040404047FF400001FFC1004100410040FFC +D419:000000003F841104110411073F84040404047FF40000100410041FFC10040FFC +D41A:000000003F841104110411073F84040404047FF40000111011101F1011280FC6 +D41B:000000003F841104110411073F84040404047FF400000080008001400630180C +D41C:000000003F841104110411073F84040404047FF400000410041004100A2831C6 +D41D:000000003F841104110411073F84040404047FF400000FF81004100410040FF8 +D41E:000000003F841104110411073F84040404047FF400001FFC008001400630180C +D41F:000000003F841104110411073F84040404047FF4000003E000001FFC02201C1C +D420:000000003F841104110411073F84040404047FF400001FFC00041FFC00040004 +D421:000000003F841104110411073F84040404047FF400001FFC10001FF810000FFC +D422:000000003F841104110411073F84040404047FF400001FFC0410041004101FFC +D423:000000003F841104110411073F84040404047FF4000003E000001FFC080807F0 +D424:0000000000123F92001211121112111E11123F920412041204127FD200120012 +D425:000000003F9211121112111E3F92041204127FD200000FFE0002000200020002 +D426:000000003F9211121112111E3F92041204127FD200000FBE0082008200820082 +D427:000000003F9211121112111E3F92041204127FD200000F8800880088009400E3 +D428:000000003F9211121112111E3F92041204127FD20012081208000800080007FE +D429:000000003F9211121112111E3F92041204127FD20000083E08080808081407E3 +D42A:000000003F9211121112111E3F92041204127FD20000081C0800087F0822079C +D42B:000000003F9211121112111E3F92041204127FD200000FFE08000800080007FE +D42C:000000003F9211121112111E3F92041204127FD200000FFE00020FFC080007FE +D42D:000000003F9211121112111E3F92041204127FD200000FBE00820F0208020782 +D42E:000000003F9211121112111E3F92041204127FD200000FBE00A20F220822079E +D42F:000000003F9211121112111E3F92041204127FD200000FA200A20F3E0822079E +D430:000000003F9211121112111E3F92041204127FD200000F8800880F08081407E3 +D431:000000003F9211121112111E3F92041204127FD200000FBE00A00F3E0820079E +D432:000000003F9211121112111E3F92041204127FD200000FBF00920F12081207BF +D433:000000003F9211121112111E3F92041204127FD200000F9C00800F7F0822079C +D434:000000003F9211121112111E3F92041204127FD200000FFE08020802080207FE +D435:000000003F9211121112111E3F92041204127FD20000080208020FFE080207FE +D436:000000003F9211121112111E3F92041204127FD20000088808880F88089407E3 +D437:000000003F9211121112111E3F92041204127FD200000040004000A003180C06 +D438:000000003F9211121112111E3F92041204127FD20000020802080208051418E3 +D439:000000003F9211121112111E3F92041204127FD2000007FC08020802080207FC +D43A:000000003F9211121112111E3F92041204127FD200000FFE004000A003180C06 +D43B:000000003F9211121112111E3F92041204127FD2000001F000000FFE01100E0E +D43C:000000003F9211121112111E3F92041204127FD200000FFE00020FFE00020002 +D43D:000000003F9211121112111E3F92041204127FD200000FFE08000FFC080007FE +D43E:000000003F9211121112111E3F92041204127FD200000FFE0208020802080FFE +D43F:000000003F9211121112111E3F92041204127FD2000001F000000FFE040403F8 +D440:0000000000043F84000411041104110411043F840404040404047FF400040004 +D441:000000003F841104110411043F84040404047FF400001FFC0004000400040004 +D442:000000003F841104110411043F84040404047FF400001F7C0104010401040104 +D443:000000003F841104110411043F84040404047FF400001F1001100110012801C6 +D444:000000003F841104110411043F84040404047FF4000410041000100010000FFC +D445:000000003F841104110411043F84040404047FF40000107C1010101010280FC6 +D446:000000003F841104110411043F84040404047FF400001038100010FE10440F38 +D447:000000003F841104110411043F84040404047FF400001FFC1000100010000FFC +D448:000000003F841104110411043F84040404047FF400001FFC00041FF810000FFC +D449:000000003F841104110411043F84040404047FF400001F7C01041E0410040F04 +D44A:000000003F841104110411043F84040404047FF400001F7C01441E4410440F3C +D44B:000000003F841104110411043F84040404047FF400001F4401441E7C10440F3C +D44C:000000003F841104110411043F84040404047FF400001F1001101E1010280FC6 +D44D:000000003F841104110411043F84040404047FF400001F7C01401E7C10400F3C +D44E:000000003F841104110411043F84040404047FF400001F7E01241E2410240F7E +D44F:000000003F841104110411043F84040404047FF400001F3801001EFE10440F38 +D450:000000003F841104110411043F84040404047FF400001FFC1004100410040FFC +D451:000000003F841104110411043F84040404047FF40000100410041FFC10040FFC +D452:000000003F841104110411043F84040404047FF40000111011101F1011280FC6 +D453:000000003F841104110411043F84040404047FF400000080008001400630180C +D454:000000003F841104110411043F84040404047FF400000410041004100A2831C6 +D455:000000003F841104110411043F84040404047FF400000FF81004100410040FF8 +D456:000000003F841104110411043F84040404047FF400001FFC008001400630180C +D457:000000003F841104110411043F84040404047FF4000003E000001FFC02201C1C +D458:000000003F841104110411043F84040404047FF400001FFC00041FFC00040004 +D459:000000003F841104110411043F84040404047FF400001FFC10001FF810000FFC +D45A:000000003F841104110411043F84040404047FF400001FFC0410041004101FFC +D45B:000000003F841104110411043F84040404047FF4000003E000001FFC080807F0 +D45C:0000000000001FFC000004100410041004101FFC0220022002207FFF00000000 +D45D:000000001FFC0410041004101FFC022002207FFF00001FFC0004000400040004 +D45E:000000001FFC0410041004101FFC022002207FFF00001F7C0104010401040104 +D45F:000000001FFC0410041004101FFC022002207FFF00001F1001100110012801C6 +D460:000000001FFC0410041004101FFC022002207FFF000010001000100010000FFC +D461:000000001FFC0410041004101FFC022002207FFF0000107C1010101010280FC6 +D462:000000001FFC0410041004101FFC022002207FFF00001038100010FE10440F38 +D463:000000001FFC0410041004101FFC022002207FFF00001FFC1000100010000FFC +D464:000000001FFC0410041004101FFC022002207FFF00001FFC00041FF810000FFC +D465:000000001FFC0410041004101FFC022002207FFF00001F7C01041E0410040F04 +D466:000000001FFC0410041004101FFC022002207FFF00001F7C01441E4410440F3C +D467:000000001FFC0410041004101FFC022002207FFF00001F4401441E7C10440F3C +D468:000000001FFC0410041004101FFC022002207FFF00001F1001101E1010280FC6 +D469:000000001FFC0410041004101FFC022002207FFF00001F7C01401E7C10400F3C +D46A:000000001FFC0410041004101FFC022002207FFF00001F7E01241E2410240F7E +D46B:000000001FFC0410041004101FFC022002207FFF00001F3801001EFE10440F38 +D46C:000000001FFC0410041004101FFC022002207FFF00001FFC1004100410040FFC +D46D:000000001FFC0410041004101FFC022002207FFF0000100410041FFC10040FFC +D46E:000000001FFC0410041004101FFC022002207FFF0000111011101F1011280FC6 +D46F:000000001FFC0410041004101FFC022002207FFF00000080008001400630180C +D470:000000001FFC0410041004101FFC022002207FFF00000410041004100A2831C6 +D471:000000001FFC0410041004101FFC022002207FFF00000FF81004100410040FF8 +D472:000000001FFC0410041004101FFC022002207FFF00001FFC008001400630180C +D473:000000001FFC0410041004101FFC022002207FFF000003E000001FFC02201C1C +D474:000000001FFC0410041004101FFC022002207FFF00001FFC00041FFC00040004 +D475:000000001FFC0410041004101FFC022002207FFF00001FFC10001FF810000FFC +D476:000000001FFC0410041004101FFC022002207FFF00001FFC0410041004101FFC +D477:000000001FFC0410041004101FFC022002207FFF000003E000001FFC080807F0 +D478:000000001FFC0410041004101FFC000000007FFF008000800080008000800080 +D479:000000001FFC0410041004101FFC00007FFF008000801FFC0004000400040004 +D47A:000000001FFC0410041004101FFC00007FFF008000801F7C0104010401040104 +D47B:000000001FFC0410041004101FFC00007FFF008000801F1001100110012801C6 +D47C:000000001FFC0410041004101FFC000000007FFF008010801080100010000FFC +D47D:000000001FFC0410041004101FFC00007FFF00800080107C1010101010280FC6 +D47E:000000001FFC0410041004101FFC00007FFF008000801038100010FE10440F38 +D47F:000000001FFC0410041004101FFC00007FFF008000801FFC1000100010000FFC +D480:000000001FFC0410041004101FFC00007FFF008000801FFC00041FF810000FFC +D481:000000001FFC0410041004101FFC00007FFF008000801F7C01041E0410040F04 +D482:000000001FFC0410041004101FFC00007FFF008000801F7C01441E4410440F3C +D483:000000001FFC0410041004101FFC00007FFF008000801F4401441E7C10440F3C +D484:000000001FFC0410041004101FFC00007FFF008000801F1001101E1010280FC6 +D485:000000001FFC0410041004101FFC00007FFF008000801F7C01401E7C10400F3C +D486:000000001FFC0410041004101FFC00007FFF008000801F7E01241E2410240F7E +D487:000000001FFC0410041004101FFC00007FFF008000801F3801001EFE10440F38 +D488:000000001FFC0410041004101FFC00007FFF008000801FFC1004100410040FFC +D489:000000001FFC0410041004101FFC00007FFF00800080100410041FFC10040FFC +D48A:000000001FFC0410041004101FFC00007FFF00800080111011101F1011280FC6 +D48B:000000001FFC0410041004101FFC00007FFF008000800080008001400630180C +D48C:000000001FFC0410041004101FFC00007FFF008000800410041004100A2831C6 +D48D:000000001FFC0410041004101FFC00007FFF008000800FF81004100410040FF8 +D48E:000000001FFC0410041004101FFC00007FFF008000801FFC008001400630180C +D48F:000000001FFC0410041004101FFC00007FFF0080008003E000001FFC02201C1C +D490:000000001FFC0410041004101FFC00007FFF008000801FFC00041FFC00040004 +D491:000000001FFC0410041004101FFC00007FFF008000801FFC10001FF810000FFC +D492:000000001FFC0410041004101FFC00007FFF008000801FFC0410041004101FFC +D493:000000001FFC0410041004101FFC00007FFF0080008003E000001FFC080807F0 +D494:000000003F841104110411043F84000400047FF404040404043C040404040404 +D495:000000003F8411041104111C3F8400047FF4040404001FFC0004000400040004 +D496:000000003F8411041104111C3F8400047FF4040404001F7C0104010401040104 +D497:000000003F8411041104111C3F8400047FF4040404001F1001100110012801C6 +D498:000000003F841104110411043F8400047FF40404043C14041000100010000FFC +D499:000000003F8411041104111C3F8400047FF404040400107C1010101010280FC6 +D49A:000000003F8411041104111C3F8400047FF4040404001038100010FE10440F38 +D49B:000000003F8411041104111C3F8400047FF4040404001FFC1000100010000FFC +D49C:000000003F8411041104111C3F8400047FF4040404001FFC00041FF810000FFC +D49D:000000003F8411041104111C3F8400047FF4040404001F7C01041E0410040F04 +D49E:000000003F8411041104111C3F8400047FF4040404001F7C01441E4410440F3C +D49F:000000003F8411041104111C3F8400047FF4040404001F4401441E7C10440F3C +D4A0:000000003F8411041104111C3F8400047FF4040404001F1001101E1010280FC6 +D4A1:000000003F8411041104111C3F8400047FF4040404001F7C01401E7C10400F3C +D4A2:000000003F8411041104111C3F8400047FF4040404001F7E01241E2410240F7E +D4A3:000000003F8411041104111C3F8400047FF4040404001F3801001EFE10440F38 +D4A4:000000003F8411041104111C3F8400047FF4040404001FFC1004100410040FFC +D4A5:000000003F8411041104111C3F8400047FF404040400100410041FFC10040FFC +D4A6:000000003F8411041104111C3F8400047FF404040400111011101F1011280FC6 +D4A7:000000003F8411041104111C3F8400047FF4040404000080008001400630180C +D4A8:000000003F8411041104111C3F8400047FF4040404000410041004100A2831C6 +D4A9:000000003F8411041104111C3F8400047FF4040404000FF81004100410040FF8 +D4AA:000000003F8411041104111C3F8400047FF4040404001FFC008001400630180C +D4AB:000000003F8411041104111C3F8400047FF40404040003E000001FFC02201C1C +D4AC:000000003F8411041104111C3F8400047FF4040404001FFC00041FFC00040004 +D4AD:000000003F8411041104111C3F8400047FF4040404001FFC10001FF810000FFC +D4AE:000000003F8411041104111C3F8400047FF4040404001FFC0410041004101FFC +D4AF:000000003F8411041104111C3F8400047FF40404040003E000001FFC080807F0 +D4B0:000000003F921112111211123F92001200127FD20412041204F2041204120412 +D4B1:000000003F921112111211723F9200127FD2041204000FFE0002000200020002 +D4B2:000000003F921112111211723F9200127FD2041204000FBE0082008200820082 +D4B3:000000003F921112111211723F9200127FD2041204000F8800880088009400E3 +D4B4:000000003F921112111211123F9200127FD2021202F20A1208000800080007FE +D4B5:000000003F921112111211723F9200127FD204120400083E08080808081407E3 +D4B6:000000003F921112111211723F9200127FD204120400081C0800087F0822079C +D4B7:000000003F921112111211723F9200127FD2041204000FFE08000800080007FE +D4B8:000000003F921112111211723F9200127FD2041204000FFE00020FFC080007FE +D4B9:000000003F921112111211723F9200127FD2041204000FBE00820F0208020782 +D4BA:000000003F921112111211723F9200127FD2041204000FBE00A20F220822079E +D4BB:000000003F921112111211723F9200127FD2041204000FA200A20F3E0822079E +D4BC:000000003F921112111211723F9200127FD2041204000F8800880F08081407E3 +D4BD:000000003F921112111211723F9200127FD2041204000FBE00A00F3E0820079E +D4BE:000000003F921112111211723F9200127FD2041204000FBF00920F12081207BF +D4BF:000000003F921112111211723F9200127FD2041204000F9C00800F7F0822079C +D4C0:000000003F921112111211723F9200127FD2041204000FFE08020802080207FE +D4C1:000000003F921112111211723F9200127FD204120400080208020FFE080207FE +D4C2:000000003F921112111211723F9200127FD204120400088808880F88089407E3 +D4C3:000000003F921112111211723F9200127FD2041204000040004000A003180C06 +D4C4:000000003F921112111211723F9200127FD204120400020802080208051418E3 +D4C5:000000003F921112111211723F9200127FD20412040007FC08020802080207FC +D4C6:000000003F921112111211723F9200127FD2041204000FFE004000A003180C06 +D4C7:000000003F921112111211723F9200127FD20412040001F000000FFE01100E0E +D4C8:000000003F921112111211723F9200127FD2041204000FFE00020FFE00020002 +D4C9:000000003F921112111211723F9200127FD2041204000FFE08000FFC080007FE +D4CA:000000003F921112111211723F9200127FD2041204000FFE0208020802080FFE +D4CB:000000003F921112111211723F9200127FD20412040001F000000FFE040403F8 +D4CC:000000003F841104110411043F84000400047FF4040404040404040404040404 +D4CD:000000003F841104110411043F8400047FF4040404001FFC0004000400040004 +D4CE:000000003F841104110411043F8400047FF4040404001F7C0104010401040104 +D4CF:000000003F841104110411043F8400047FF4040404001F1001100110012801C6 +D4D0:000000003F841104110411043F8400047FF40404040414041000100010000FFC +D4D1:000000003F841104110411043F8400047FF404040400107C1010101010280FC6 +D4D2:000000003F841104110411043F8400047FF4040404001038100010FE10440F38 +D4D3:000000003F841104110411043F8400047FF4040404001FFC1000100010000FFC +D4D4:000000003F841104110411043F8400047FF4040404001FFC00041FF810000FFC +D4D5:000000003F841104110411043F8400047FF4040404001F7C01041E0410040F04 +D4D6:000000003F841104110411043F8400047FF4040404001F7C01441E4410440F3C +D4D7:000000003F841104110411043F8400047FF4040404001F4401441E7C10440F3C +D4D8:000000003F841104110411043F8400047FF4040404001F1001101E1010280FC6 +D4D9:000000003F841104110411043F8400047FF4040404001F7C01401E7C10400F3C +D4DA:000000003F841104110411043F8400047FF4040404001F7E01241E2410240F7E +D4DB:000000003F841104110411043F8400047FF4040404001F3801001EFE10440F38 +D4DC:000000003F841104110411043F8400047FF4040404001FFC1004100410040FFC +D4DD:000000003F841104110411043F8400047FF404040400100410041FFC10040FFC +D4DE:000000003F841104110411043F8400047FF404040400111011101F1011280FC6 +D4DF:000000003F841104110411043F8400047FF4040404000080008001400630180C +D4E0:000000003F841104110411043F8400047FF4040404000410041004100A2831C6 +D4E1:000000003F841104110411043F8400047FF4040404000FF81004100410040FF8 +D4E2:000000003F841104110411043F8400047FF4040404001FFC008001400630180C +D4E3:000000003F841104110411043F8400047FF40404040003E000001FFC02201C1C +D4E4:000000003F841104110411043F8400047FF4040404001FFC00041FFC00040004 +D4E5:000000003F841104110411043F8400047FF4040404001FFC10001FF810000FFC +D4E6:000000003F841104110411043F8400047FF4040404001FFC0410041004101FFC +D4E7:000000003F841104110411043F8400047FF40404040003E000001FFC080807F0 +D4E8:000000001FFC0410041004101FFC000000007FFF041004100410041004100410 +D4E9:000000001FFC0410041004101FFC00007FFF022002201FFC0004000400040004 +D4EA:000000001FFC0410041004101FFC00007FFF022002201F7C0104010401040104 +D4EB:000000001FFC0410041004101FFC00007FFF022002201F1001100110012801C6 +D4EC:000000001FFC0410041004101FFC000000007FFF022012201220100010000FFC +D4ED:000000001FFC0410041004101FFC00007FFF02200220107C1010101010280FC6 +D4EE:000000001FFC0410041004101FFC00007FFF022002201038100010FE10440F38 +D4EF:000000001FFC0410041004101FFC00007FFF022002201FFC1000100010000FFC +D4F0:000000001FFC0410041004101FFC00007FFF022002201FFC00041FF810000FFC +D4F1:000000001FFC0410041004101FFC00007FFF022002201F7C01041E0410040F04 +D4F2:000000001FFC0410041004101FFC00007FFF022002201F7C01441E4410440F3C +D4F3:000000001FFC0410041004101FFC00007FFF022002201F4401441E7C10440F3C +D4F4:000000001FFC0410041004101FFC00007FFF022002201F1001101E1010280FC6 +D4F5:000000001FFC0410041004101FFC00007FFF022002201F7C01401E7C10400F3C +D4F6:000000001FFC0410041004101FFC00007FFF022002201F7E01241E2410240F7E +D4F7:000000001FFC0410041004101FFC00007FFF022002201F3801001EFE10440F38 +D4F8:000000001FFC0410041004101FFC00007FFF022002201FFC1004100410040FFC +D4F9:000000001FFC0410041004101FFC00007FFF02200220100410041FFC10040FFC +D4FA:000000001FFC0410041004101FFC00007FFF02200220111011101F1011280FC6 +D4FB:000000001FFC0410041004101FFC00007FFF022002200080008001400630180C +D4FC:000000001FFC0410041004101FFC00007FFF022002200410041004100A2831C6 +D4FD:000000001FFC0410041004101FFC00007FFF022002200FF81004100410040FF8 +D4FE:000000001FFC0410041004101FFC00007FFF022002201FFC008001400630180C +D4FF:000000001FFC0410041004101FFC00007FFF0220022003E000001FFC02201C1C +D500:000000001FFC0410041004101FFC00007FFF022002201FFC00041FFC00040004 +D501:000000001FFC0410041004101FFC00007FFF022002201FFC10001FF810000FFC +D502:000000001FFC0410041004101FFC00007FFF022002201FFC0410041004101FFC +D503:000000001FFC0410041004101FFC00007FFF0220022003E000001FFC080807F0 +D504:0000000000001FFC000004100410041004101FFC0000000000007FFF00000000 +D505:000000001FFC0410041004101FFC00007FFF000000001FFC0004000400040004 +D506:000000001FFC0410041004101FFC00007FFF000000001F7C0104010401040104 +D507:000000001FFC0410041004101FFC00007FFF000000001F1001100110012801C6 +D508:000000001FFC0410041004101FFC000000007FFF000010001000100010000FFC +D509:000000001FFC0410041004101FFC00007FFF00000000107C1010101010280FC6 +D50A:000000001FFC0410041004101FFC00007FFF000000001038100010FE10440F38 +D50B:000000001FFC0410041004101FFC00007FFF000000001FFC1000100010000FFC +D50C:000000001FFC0410041004101FFC00007FFF000000001FFC00041FF810000FFC +D50D:000000001FFC0410041004101FFC00007FFF000000001F7C01041E0410040F04 +D50E:000000001FFC0410041004101FFC00007FFF000000001F7C01441E4410440F3C +D50F:000000001FFC0410041004101FFC00007FFF000000001F4401441E7C10440F3C +D510:000000001FFC0410041004101FFC00007FFF000000001F1001101E1010280FC6 +D511:000000001FFC0410041004101FFC00007FFF000000001F7C01401E7C10400F3C +D512:000000001FFC0410041004101FFC00007FFF000000001F7E01241E2410240F7E +D513:000000001FFC0410041004101FFC00007FFF000000001F3801001EFE10440F38 +D514:000000001FFC0410041004101FFC00007FFF000000001FFC1004100410040FFC +D515:000000001FFC0410041004101FFC00007FFF00000000100410041FFC10040FFC +D516:000000001FFC0410041004101FFC00007FFF00000000111011101F1011280FC6 +D517:000000001FFC0410041004101FFC00007FFF000000000080008001400630180C +D518:000000001FFC0410041004101FFC00007FFF000000000410041004100A2831C6 +D519:000000001FFC0410041004101FFC00007FFF000000000FF81004100410040FF8 +D51A:000000001FFC0410041004101FFC00007FFF000000001FFC008001400630180C +D51B:000000001FFC0410041004101FFC00007FFF0000000003E000001FFC02201C1C +D51C:000000001FFC0410041004101FFC00007FFF000000001FFC00041FFC00040004 +D51D:000000001FFC0410041004101FFC00007FFF000000001FFC10001FF810000FFC +D51E:000000001FFC0410041004101FFC00007FFF000000001FFC0410041004101FFC +D51F:000000001FFC0410041004101FFC00007FFF0000000003E000001FFC080807F0 +D520:0000000000043F84000411041104110411043F840004000400047FF400040004 +D521:000000003F841104110411043F8400047FF4000400001FFC0004000400040004 +D522:000000003F841104110411043F8400047FF4000400001F7C0104010401040104 +D523:000000003F841104110411043F8400047FF4000400001F1001100110012801C6 +D524:000000003F841104110411043F84000400047FF4000410041000100010000FFC +D525:000000003F841104110411043F8400047FF400040000107C1010101010280FC6 +D526:000000003F841104110411043F8400047FF4000400001038100010FE10440F38 +D527:000000003F841104110411043F8400047FF4000400001FFC1000100010000FFC +D528:000000003F841104110411043F8400047FF4000400001FFC00041FF810000FFC +D529:000000003F841104110411043F8400047FF4000400001F7C01041E0410040F04 +D52A:000000003F841104110411043F8400047FF4000400001F7C01441E4410440F3C +D52B:000000003F841104110411043F8400047FF4000400001F4401441E7C10440F3C +D52C:000000003F841104110411043F8400047FF4000400001F1001101E1010280FC6 +D52D:000000003F841104110411043F8400047FF4000400001F7C01401E7C10400F3C +D52E:000000003F841104110411043F8400047FF4000400001F7E01241E2410240F7E +D52F:000000003F841104110411043F8400047FF4000400001F3801001EFE10440F38 +D530:000000003F841104110411043F8400047FF4000400001FFC1004100410040FFC +D531:000000003F841104110411043F8400047FF400040000100410041FFC10040FFC +D532:000000003F841104110411043F8400047FF400040000111011101F1011280FC6 +D533:000000003F841104110411043F8400047FF4000400000080008001400630180C +D534:000000003F841104110411043F8400047FF4000400000410041004100A2831C6 +D535:000000003F841104110411043F8400047FF4000400000FF81004100410040FF8 +D536:000000003F841104110411043F8400047FF4000400001FFC008001400630180C +D537:000000003F841104110411043F8400047FF40004000003E000001FFC02201C1C +D538:000000003F841104110411043F8400047FF4000400001FFC00041FFC00040004 +D539:000000003F841104110411043F8400047FF4000400001FFC10001FF810000FFC +D53A:000000003F841104110411043F8400047FF4000400001FFC0410041004101FFC +D53B:000000003F841104110411043F8400047FF40004000003E000001FFC080807F0 +D53C:0000000000043F84000411041104110411041104110411043F84000400040004 +D53D:000000003F84000411041104110411043F84000400001FFC0004000400040004 +D53E:000000003F84000411041104110411043F84000400001F7C0104010401040104 +D53F:000000003F84000411041104110411043F84000400001F1001100110012801C6 +D540:000000003F84000411041104110411043F840004000410041000100010000FFC +D541:000000003F84000411041104110411043F8400040000107C1010101010280FC6 +D542:000000003F84000411041104110411043F84000400001038100010FE10440F38 +D543:000000003F84000411041104110411043F84000400001FFC1000100010000FFC +D544:000000003F84000411041104110411043F84000400001FFC00041FF810000FFC +D545:000000003F84000411041104110411043F84000400001F7C01041E0410040F04 +D546:000000003F84000411041104110411043F84000400001F7C01441E4410440F3C +D547:000000003F84000411041104110411043F84000400001F4401441E7C10440F3C +D548:000000003F84000411041104110411043F84000400001F1001101E1010280FC6 +D549:000000003F84000411041104110411043F84000400001F7C01401E7C10400F3C +D54A:000000003F84000411041104110411043F84000400001F7E01241E2410240F7E +D54B:000000003F84000411041104110411043F84000400001F3801001EFE10440F38 +D54C:000000003F84000411041104110411043F84000400001FFC1004100410040FFC +D54D:000000003F84000411041104110411043F8400040000100410041FFC10040FFC +D54E:000000003F84000411041104110411043F8400040000111011101F1011280FC6 +D54F:000000003F84000411041104110411043F84000400000080008001400630180C +D550:000000003F84000411041104110411043F84000400000410041004100A2831C6 +D551:000000003F84000411041104110411043F84000400000FF81004100410040FF8 +D552:000000003F84000411041104110411043F84000400001FFC008001400630180C +D553:000000003F84000411041104110411043F840004000003E000001FFC02201C1C +D554:000000003F84000411041104110411043F84000400001FFC00041FFC00040004 +D555:000000003F84000411041104110411043F84000400001FFC10001FF810000FFC +D556:000000003F84000411041104110411043F84000400001FFC0410041004101FFC +D557:000000003F84000411041104110411043F840004000003E000001FFC080807F0 +D558:0000000000040F0400043FC400040F0710841084108410840F04000400040004 +D559:0000000004047FC400041F07208420841F04000400001FFC0004000400040004 +D55A:0000000004047FC400041F07208420841F04000400001F7C0104010401040104 +D55B:0000000004047FC400041F07208420841F04000400001F1001100110012801C6 +D55C:0000000004047FC400041F07208420841F040004000410041000100010000FFC +D55D:0000000004047FC400041F07208420841F0400040000107C1010101010280FC6 +D55E:0000000004047FC400041F07208420841F04000400001038100010FE10440F38 +D55F:0000000004047FC400041F07208420841F04000400001FFC1000100010000FFC +D560:0000000004047FC400041F07208420841F04000400001FFC00041FF810000FFC +D561:0000000004047FC400041F07208420841F04000400001F7C01041E0410040F04 +D562:0000000004047FC400041F07208420841F04000400001F7C01441E4410440F3C +D563:0000000004047FC400041F07208420841F04000400001F4401441E7C10440F3C +D564:0000000004047FC400041F07208420841F04000400001F1001101E1010280FC6 +D565:0000000004047FC400041F07208420841F04000400001F7C01401E7C10400F3C +D566:0000000004047FC400041F07208420841F04000400001F7E01241E2410240F7E +D567:0000000004047FC400041F07208420841F04000400001F3801001EFE10440F38 +D568:0000000004047FC400041F07208420841F04000400001FFC1004100410040FFC +D569:0000000004047FC400041F07208420841F0400040000100410041FFC10040FFC +D56A:0000000004047FC400041F07208420841F0400040000111011101F1011280FC6 +D56B:0000000004047FC400041F07208420841F04000400000080008001400630180C +D56C:0000000004047FC400041F07208420841F04000400000410041004100A2831C6 +D56D:0000000004047FC400041F07208420841F04000400000FF81004100410040FF8 +D56E:0000000004047FC400041F07208420841F04000400001FFC008001400630180C +D56F:0000000004047FC400041F07208420841F040004000003E000001FFC02201C1C +D570:0000000004047FC400041F07208420841F04000400001FFC00041FFC00040004 +D571:0000000004047FC400041F07208420841F04000400001FFC10001FF810000FFC +D572:0000000004047FC400041F07208420841F04000400001FFC0410041004101FFC +D573:0000000004047FC400041F07208420841F040004000003E000001FFC080807F0 +D574:0000000000120F1200123FD200120F1E10921092109210920F12001200120012 +D575:0000000004127FD200121F1E209220921F12001200000FFE0002000200020002 +D576:0000000004127FD200121F1E209220921F12001200000FBE0082008200820082 +D577:0000000004127FD200121F1E209220921F12001200000F8800880088009400E3 +D578:0000000004127FD200121F1E209220921F1200120012081208000800080007FE +D579:0000000004127FD200121F1E209220921F1200120000083E08080808081407E3 +D57A:0000000004127FD200121F1E209220921F1200120000081C0800087F0822079C +D57B:0000000004127FD200121F1E209220921F12001200000FFE08000800080007FE +D57C:0000000004127FD200121F1E209220921F12001200000FFE00020FFC080007FE +D57D:0000000004127FD200121F1E209220921F12001200000FBE00820F0208020782 +D57E:0000000004127FD200121F1E209220921F12001200000FBE00A20F220822079E +D57F:0000000004127FD200121F1E209220921F12001200000FA200A20F3E0822079E +D580:0000000004127FD200121F1E209220921F12001200000F8800880F08081407E3 +D581:0000000004127FD200121F1E209220921F12001200000FBE00A00F3E0820079E +D582:0000000004127FD200121F1E209220921F12001200000FBF00920F12081207BF +D583:0000000004127FD200121F1E209220921F12001200000F9C00800F7F0822079C +D584:0000000004127FD200121F1E209220921F12001200000FFE08020802080207FE +D585:0000000004127FD200121F1E209220921F1200120000080208020FFE080207FE +D586:0000000004127FD200121F1E209220921F1200120000088808880F88089407E3 +D587:0000000004127FD200121F1E209220921F12001200000040004000A003180C06 +D588:0000000004127FD200121F1E209220921F1200120000020802080208051418E3 +D589:0000000004127FD200121F1E209220921F120012000007FC08020802080207FC +D58A:0000000004127FD200121F1E209220921F12001200000FFE004000A003180C06 +D58B:0000000004127FD200121F1E209220921F120012000001F000000FFE01100E0E +D58C:0000000004127FD200121F1E209220921F12001200000FFE00020FFE00020002 +D58D:0000000004127FD200121F1E209220921F12001200000FFE08000FFC080007FE +D58E:0000000004127FD200121F1E209220921F12001200000FFE0208020802080FFE +D58F:0000000004127FD200121F1E209220921F120012000001F000000FFE040403F8 +D590:0000000000040F0400043FC400070F0410841087108410840F04000400040004 +D591:0000000004047FC400071F04208420871F04000400001FFC0004000400040004 +D592:0000000004047FC400071F04208420871F04000400001F7C0104010401040104 +D593:0000000004047FC400071F04208420871F04000400001F1001100110012801C6 +D594:0000000004047FC400071F04208420871F040004000410041000100010000FFC +D595:0000000004047FC400071F04208420871F0400040000107C1010101010280FC6 +D596:0000000004047FC400071F04208420871F04000400001038100010FE10440F38 +D597:0000000004047FC400071F04208420871F04000400001FFC1000100010000FFC +D598:0000000004047FC400071F04208420871F04000400001FFC00041FF810000FFC +D599:0000000004047FC400071F04208420871F04000400001F7C01041E0410040F04 +D59A:0000000004047FC400071F04208420871F04000400001F7C01441E4410440F3C +D59B:0000000004047FC400071F04208420871F04000400001F4401441E7C10440F3C +D59C:0000000004047FC400071F04208420871F04000400001F1001101E1010280FC6 +D59D:0000000004047FC400071F04208420871F04000400001F7C01401E7C10400F3C +D59E:0000000004047FC400071F04208420871F04000400001F7E01241E2410240F7E +D59F:0000000004047FC400071F04208420871F04000400001F3801001EFE10440F38 +D5A0:0000000004047FC400071F04208420871F04000400001FFC1004100410040FFC +D5A1:0000000004047FC400071F04208420871F0400040000100410041FFC10040FFC +D5A2:0000000004047FC400071F04208420871F0400040000111011101F1011280FC6 +D5A3:0000000004047FC400071F04208420871F04000400000080008001400630180C +D5A4:0000000004047FC400071F04208420871F04000400000410041004100A2831C6 +D5A5:0000000004047FC400071F04208420871F04000400000FF81004100410040FF8 +D5A6:0000000004047FC400071F04208420871F04000400001FFC008001400630180C +D5A7:0000000004047FC400071F04208420871F040004000003E000001FFC02201C1C +D5A8:0000000004047FC400071F04208420871F04000400001FFC00041FFC00040004 +D5A9:0000000004047FC400071F04208420871F04000400001FFC10001FF810000FFC +D5AA:0000000004047FC400071F04208420871F04000400001FFC0410041004101FFC +D5AB:0000000004047FC400071F04208420871F040004000003E000001FFC080807F0 +D5AC:0000000000120F1200123FD2001E0F121092109E109210920F12001200120012 +D5AD:0000000004127FD2001E1F122092209E1F12001200000FFE0002000200020002 +D5AE:0000000004127FD2001E1F122092209E1F12001200000FBE0082008200820082 +D5AF:0000000004127FD2001E1F122092209E1F12001200000F8800880088009400E3 +D5B0:0000000004127FD2001E1F122092209E1F1200120012081208000800080007FE +D5B1:0000000004127FD2001E1F122092209E1F1200120000083E08080808081407E3 +D5B2:0000000004127FD2001E1F122092209E1F1200120000081C0800087F0822079C +D5B3:0000000004127FD2001E1F122092209E1F12001200000FFE08000800080007FE +D5B4:0000000004127FD2001E1F122092209E1F12001200000FFE00020FFC080007FE +D5B5:0000000004127FD2001E1F122092209E1F12001200000FBE00820F0208020782 +D5B6:0000000004127FD2001E1F122092209E1F12001200000FBE00A20F220822079E +D5B7:0000000004127FD2001E1F122092209E1F12001200000FA200A20F3E0822079E +D5B8:0000000004127FD2001E1F122092209E1F12001200000F8800880F08081407E3 +D5B9:0000000004127FD2001E1F122092209E1F12001200000FBE00A00F3E0820079E +D5BA:0000000004127FD2001E1F122092209E1F12001200000FBF00920F12081207BF +D5BB:0000000004127FD2001E1F122092209E1F12001200000F9C00800F7F0822079C +D5BC:0000000004127FD2001E1F122092209E1F12001200000FFE08020802080207FE +D5BD:0000000004127FD2001E1F122092209E1F1200120000080208020FFE080207FE +D5BE:0000000004127FD2001E1F122092209E1F1200120000088808880F88089407E3 +D5BF:0000000004127FD2001E1F122092209E1F12001200000040004000A003180C06 +D5C0:0000000004127FD2001E1F122092209E1F1200120000020802080208051418E3 +D5C1:0000000004127FD2001E1F122092209E1F120012000007FC08020802080207FC +D5C2:0000000004127FD2001E1F122092209E1F12001200000FFE004000A003180C06 +D5C3:0000000004127FD2001E1F122092209E1F120012000001F000000FFE01100E0E +D5C4:0000000004127FD2001E1F122092209E1F12001200000FFE00020FFE00020002 +D5C5:0000000004127FD2001E1F122092209E1F12001200000FFE08000FFC080007FE +D5C6:0000000004127FD2001E1F122092209E1F12001200000FFE0208020802080FFE +D5C7:0000000004127FD2001E1F122092209E1F120012000001F000000FFE040403F8 +D5C8:0000000000040F0400043FC400040F3C10841084108410840F04000400040004 +D5C9:0000000004047FC400041F3C208420841F04000400001FFC0004000400040004 +D5CA:0000000004047FC400041F3C208420841F04000400001F7C0104010401040104 +D5CB:0000000004047FC400041F3C208420841F04000400001F1001100110012801C6 +D5CC:0000000004047FC400041F3C208420841F040004000410041000100010000FFC +D5CD:0000000004047FC400041F3C208420841F0400040000107C1010101010280FC6 +D5CE:0000000004047FC400041F3C208420841F04000400001038100010FE10440F38 +D5CF:0000000004047FC400041F3C208420841F04000400001FFC1000100010000FFC +D5D0:0000000004047FC400041F3C208420841F04000400001FFC00041FF810000FFC +D5D1:0000000004047FC400041F3C208420841F04000400001F7C01041E0410040F04 +D5D2:0000000004047FC400041F3C208420841F04000400001F7C01441E4410440F3C +D5D3:0000000004047FC400041F3C208420841F04000400001F4401441E7C10440F3C +D5D4:0000000004047FC400041F3C208420841F04000400001F1001101E1010280FC6 +D5D5:0000000004047FC400041F3C208420841F04000400001F7C01401E7C10400F3C +D5D6:0000000004047FC400041F3C208420841F04000400001F7E01241E2410240F7E +D5D7:0000000004047FC400041F3C208420841F04000400001F3801001EFE10440F38 +D5D8:0000000004047FC400041F3C208420841F04000400001FFC1004100410040FFC +D5D9:0000000004047FC400041F3C208420841F0400040000100410041FFC10040FFC +D5DA:0000000004047FC400041F3C208420841F0400040000111011101F1011280FC6 +D5DB:0000000004047FC400041F3C208420841F04000400000080008001400630180C +D5DC:0000000004047FC400041F3C208420841F04000400000410041004100A2831C6 +D5DD:0000000004047FC400041F3C208420841F04000400000FF81004100410040FF8 +D5DE:0000000004047FC400041F3C208420841F04000400001FFC008001400630180C +D5DF:0000000004047FC400041F3C208420841F040004000003E000001FFC02201C1C +D5E0:0000000004047FC400041F3C208420841F04000400001FFC00041FFC00040004 +D5E1:0000000004047FC400041F3C208420841F04000400001FFC10001FF810000FFC +D5E2:0000000004047FC400041F3C208420841F04000400001FFC0410041004101FFC +D5E3:0000000004047FC400041F3C208420841F040004000003E000001FFC080807F0 +D5E4:0000000000120F1200123FD200120F7210921092109210920F12001200120012 +D5E5:0000000004127FD200121F72209220921F12001200000FFE0002000200020002 +D5E6:0000000004127FD200121F72209220921F12001200000FBE0082008200820082 +D5E7:0000000004127FD200121F72209220921F12001200000F8800880088009400E3 +D5E8:0000000004127FD200121F72209220921F1200120012081208000800080007FE +D5E9:0000000004127FD200121F72209220921F1200120000083E08080808081407E3 +D5EA:0000000004127FD200121F72209220921F1200120000081C0800087F0822079C +D5EB:0000000004127FD200121F72209220921F12001200000FFE08000800080007FE +D5EC:0000000004127FD200121F72209220921F12001200000FFE00020FFC080007FE +D5ED:0000000004127FD200121F72209220921F12001200000FBE00820F0208020782 +D5EE:0000000004127FD200121F72209220921F12001200000FBE00A20F220822079E +D5EF:0000000004127FD200121F72209220921F12001200000FA200A20F3E0822079E +D5F0:0000000004127FD200121F72209220921F12001200000F8800880F08081407E3 +D5F1:0000000004127FD200121F72209220921F12001200000FBE00A00F3E0820079E +D5F2:0000000004127FD200121F72209220921F12001200000FBF00920F12081207BF +D5F3:0000000004127FD200121F72209220921F12001200000F9C00800F7F0822079C +D5F4:0000000004127FD200121F72209220921F12001200000FFE08020802080207FE +D5F5:0000000004127FD200121F72209220921F1200120000080208020FFE080207FE +D5F6:0000000004127FD200121F72209220921F1200120000088808880F88089407E3 +D5F7:0000000004127FD200121F72209220921F12001200000040004000A003180C06 +D5F8:0000000004127FD200121F72209220921F1200120000020802080208051418E3 +D5F9:0000000004127FD200121F72209220921F120012000007FC08020802080207FC +D5FA:0000000004127FD200121F72209220921F12001200000FFE004000A003180C06 +D5FB:0000000004127FD200121F72209220921F120012000001F000000FFE01100E0E +D5FC:0000000004127FD200121F72209220921F12001200000FFE00020FFE00020002 +D5FD:0000000004127FD200121F72209220921F12001200000FFE08000FFC080007FE +D5FE:0000000004127FD200121F72209220921F12001200000FFE0208020802080FFE +D5FF:0000000004127FD200121F72209220921F120012000001F000000FFE040403F8 +D600:0000000000040F0400043FC4003C0F04108410BC108410840F04000400040004 +D601:0000000004047FC4003C1F04208420BC1F04000400001FFC0004000400040004 +D602:0000000004047FC4003C1F04208420BC1F04000400001F7C0104010401040104 +D603:0000000004047FC4003C1F04208420BC1F04000400001F1001100110012801C6 +D604:0000000004047FC4003C1F04208420BC1F040004000410041000100010000FFC +D605:0000000004047FC4003C1F04208420BC1F0400040000107C1010101010280FC6 +D606:0000000004047FC4003C1F04208420BC1F04000400001038100010FE10440F38 +D607:0000000004047FC4003C1F04208420BC1F04000400001FFC1000100010000FFC +D608:0000000004047FC4003C1F04208420BC1F04000400001FFC00041FF810000FFC +D609:0000000004047FC4003C1F04208420BC1F04000400001F7C01041E0410040F04 +D60A:0000000004047FC4003C1F04208420BC1F04000400001F7C01441E4410440F3C +D60B:0000000004047FC4003C1F04208420BC1F04000400001F4401441E7C10440F3C +D60C:0000000004047FC4003C1F04208420BC1F04000400001F1001101E1010280FC6 +D60D:0000000004047FC4003C1F04208420BC1F04000400001F7C01401E7C10400F3C +D60E:0000000004047FC4003C1F04208420BC1F04000400001F7E01241E2410240F7E +D60F:0000000004047FC4003C1F04208420BC1F04000400001F3801001EFE10440F38 +D610:0000000004047FC4003C1F04208420BC1F04000400001FFC1004100410040FFC +D611:0000000004047FC4003C1F04208420BC1F0400040000100410041FFC10040FFC +D612:0000000004047FC4003C1F04208420BC1F0400040000111011101F1011280FC6 +D613:0000000004047FC4003C1F04208420BC1F04000400000080008001400630180C +D614:0000000004047FC4003C1F04208420BC1F04000400000410041004100A2831C6 +D615:0000000004047FC4003C1F04208420BC1F04000400000FF81004100410040FF8 +D616:0000000004047FC4003C1F04208420BC1F04000400001FFC008001400630180C +D617:0000000004047FC4003C1F04208420BC1F040004000003E000001FFC02201C1C +D618:0000000004047FC4003C1F04208420BC1F04000400001FFC00041FFC00040004 +D619:0000000004047FC4003C1F04208420BC1F04000400001FFC10001FF810000FFC +D61A:0000000004047FC4003C1F04208420BC1F04000400001FFC0410041004101FFC +D61B:0000000004047FC4003C1F04208420BC1F040004000003E000001FFC080807F0 +D61C:0000000000120F1200123FD200720F12109210F2109210920F12001200120012 +D61D:0000000004127FD200721F12209220F21F12001200000FFE0002000200020002 +D61E:0000000004127FD200721F12209220F21F12001200000FBE0082008200820082 +D61F:0000000004127FD200721F12209220F21F12001200000F8800880088009400E3 +D620:0000000004127FD200721F12209220F21F1200120012081208000800080007FE +D621:0000000004127FD200721F12209220F21F1200120000083E08080808081407E3 +D622:0000000004127FD200721F12209220F21F1200120000081C0800087F0822079C +D623:0000000004127FD200721F12209220F21F12001200000FFE08000800080007FE +D624:0000000004127FD200721F12209220F21F12001200000FFE00020FFC080007FE +D625:0000000004127FD200721F12209220F21F12001200000FBE00820F0208020782 +D626:0000000004127FD200721F12209220F21F12001200000FBE00A20F220822079E +D627:0000000004127FD200721F12209220F21F12001200000FA200A20F3E0822079E +D628:0000000004127FD200721F12209220F21F12001200000F8800880F08081407E3 +D629:0000000004127FD200721F12209220F21F12001200000FBE00A00F3E0820079E +D62A:0000000004127FD200721F12209220F21F12001200000FBF00920F12081207BF +D62B:0000000004127FD200721F12209220F21F12001200000F9C00800F7F0822079C +D62C:0000000004127FD200721F12209220F21F12001200000FFE08020802080207FE +D62D:0000000004127FD200721F12209220F21F1200120000080208020FFE080207FE +D62E:0000000004127FD200721F12209220F21F1200120000088808880F88089407E3 +D62F:0000000004127FD200721F12209220F21F12001200000040004000A003180C06 +D630:0000000004127FD200721F12209220F21F1200120000020802080208051418E3 +D631:0000000004127FD200721F12209220F21F120012000007FC08020802080207FC +D632:0000000004127FD200721F12209220F21F12001200000FFE004000A003180C06 +D633:0000000004127FD200721F12209220F21F120012000001F000000FFE01100E0E +D634:0000000004127FD200721F12209220F21F12001200000FFE00020FFE00020002 +D635:0000000004127FD200721F12209220F21F12001200000FFE08000FFC080007FE +D636:0000000004127FD200721F12209220F21F12001200000FFE0208020802080FFE +D637:0000000004127FD200721F12209220F21F120012000001F000000FFE040403F8 +D638:00000000000003E000001FFC000007F00808080807F0008000807FFF00000000 +D639:0000000000801FFC0410080807F0008000807FFF00001FFC0004000400040004 +D63A:0000000000801FFC0410080807F0008000807FFF00001F7C0104010401040104 +D63B:0000000000801FFC0410080807F0008000807FFF00001F1001100110012801C6 +D63C:0000000000801FFC0410080807F0008000807FFF000010001000100010000FFC +D63D:0000000000801FFC0410080807F0008000807FFF0000107C1010101010280FC6 +D63E:0000000000801FFC0410080807F0008000807FFF00001038100010FE10440F38 +D63F:0000000000801FFC0410080807F0008000807FFF00001FFC1000100010000FFC +D640:0000000000801FFC0410080807F0008000807FFF00001FFC00041FF810000FFC +D641:0000000000801FFC0410080807F0008000807FFF00001F7C01041E0410040F04 +D642:0000000000801FFC0410080807F0008000807FFF00001F7C01441E4410440F3C +D643:0000000000801FFC0410080807F0008000807FFF00001F4401441E7C10440F3C +D644:0000000000801FFC0410080807F0008000807FFF00001F1001101E1010280FC6 +D645:0000000000801FFC0410080807F0008000807FFF00001F7C01401E7C10400F3C +D646:0000000000801FFC0410080807F0008000807FFF00001F7E01241E2410240F7E +D647:0000000000801FFC0410080807F0008000807FFF00001F3801001EFE10440F38 +D648:0000000000801FFC0410080807F0008000807FFF00001FFC1004100410040FFC +D649:0000000000801FFC0410080807F0008000807FFF0000100410041FFC10040FFC +D64A:0000000000801FFC0410080807F0008000807FFF0000111011101F1011280FC6 +D64B:0000000000801FFC0410080807F0008000807FFF00000080008001400630180C +D64C:0000000000801FFC0410080807F0008000807FFF00000410041004100A2831C6 +D64D:0000000000801FFC0410080807F0008000807FFF00000FF81004100410040FF8 +D64E:0000000000801FFC0410080807F0008000807FFF00001FFC008001400630180C +D64F:0000000000801FFC0410080807F0008000807FFF000003E000001FFC02201C1C +D650:0000000000801FFC0410080807F0008000807FFF00001FFC00041FFC00040004 +D651:0000000000801FFC0410080807F0008000807FFF00001FFC10001FF810000FFC +D652:0000000000801FFC0410080807F0008000807FFF00001FFC0410041004101FFC +D653:0000000000801FFC0410080807F0008000807FFF000003E000001FFC080807F0 +D654:0000000000041F0400047FC400041F07208420841F04040404047FF400040004 +D655:0000000004047FC4110420871F04040404047FF400001FFC0004000400040004 +D656:0000000004047FC4110420871F04040404047FF400001F7C0104010401040104 +D657:0000000004047FC4110420871F04040404047FF400001F1001100110012801C6 +D658:0000000004047FC4110420871F04040404047FF4000410041000100010000FFC +D659:0000000004047FC4110420871F04040404047FF40000107C1010101010280FC6 +D65A:0000000004047FC4110420871F04040404047FF400001038100010FE10440F38 +D65B:0000000004047FC4110420871F04040404047FF400001FFC1000100010000FFC +D65C:0000000004047FC4110420871F04040404047FF400001FFC00041FF810000FFC +D65D:0000000004047FC4110420871F04040404047FF400001F7C01041E0410040F04 +D65E:0000000004047FC4110420871F04040404047FF400001F7C01441E4410440F3C +D65F:0000000004047FC4110420871F04040404047FF400001F4401441E7C10440F3C +D660:0000000004047FC4110420871F04040404047FF400001F1001101E1010280FC6 +D661:0000000004047FC4110420871F04040404047FF400001F7C01401E7C10400F3C +D662:0000000004047FC4110420871F04040404047FF400001F7E01241E2410240F7E +D663:0000000004047FC4110420871F04040404047FF400001F3801001EFE10440F38 +D664:0000000004047FC4110420871F04040404047FF400001FFC1004100410040FFC +D665:0000000004047FC4110420871F04040404047FF40000100410041FFC10040FFC +D666:0000000004047FC4110420871F04040404047FF40000111011101F1011280FC6 +D667:0000000004047FC4110420871F04040404047FF400000080008001400630180C +D668:0000000004047FC4110420871F04040404047FF400000410041004100A2831C6 +D669:0000000004047FC4110420871F04040404047FF400000FF81004100410040FF8 +D66A:0000000004047FC4110420871F04040404047FF400001FFC008001400630180C +D66B:0000000004047FC4110420871F04040404047FF4000003E000001FFC02201C1C +D66C:0000000004047FC4110420871F04040404047FF400001FFC00041FFC00040004 +D66D:0000000004047FC4110420871F04040404047FF400001FFC10001FF810000FFC +D66E:0000000004047FC4110420871F04040404047FF400001FFC0410041004101FFC +D66F:0000000004047FC4110420871F04040404047FF4000003E000001FFC080807F0 +D670:0000000000121F1200127FD200121F1E209220921F12041204127FD200120012 +D671:0000000004127FD21112209E1F12041204127FD200000FFE0002000200020002 +D672:0000000004127FD21112209E1F12041204127FD200000FBE0082008200820082 +D673:0000000004127FD21112209E1F12041204127FD200000F8800880088009400E3 +D674:0000000004127FD21112209E1F12041204127FD20012081208000800080007FE +D675:0000000004127FD21112209E1F12041204127FD20000083E08080808081407E3 +D676:0000000004127FD21112209E1F12041204127FD20000081C0800087F0822079C +D677:0000000004127FD21112209E1F12041204127FD200000FFE08000800080007FE +D678:0000000004127FD21112209E1F12041204127FD200000FFE00020FFC080007FE +D679:0000000004127FD21112209E1F12041204127FD200000FBE00820F0208020782 +D67A:0000000004127FD21112209E1F12041204127FD200000FBE00A20F220822079E +D67B:0000000004127FD21112209E1F12041204127FD200000FA200A20F3E0822079E +D67C:0000000004127FD21112209E1F12041204127FD200000F8800880F08081407E3 +D67D:0000000004127FD21112209E1F12041204127FD200000FBE00A00F3E0820079E +D67E:0000000004127FD21112209E1F12041204127FD200000FBF00920F12081207BF +D67F:0000000004127FD21112209E1F12041204127FD200000F9C00800F7F0822079C +D680:0000000004127FD21112209E1F12041204127FD200000FFE08020802080207FE +D681:0000000004127FD21112209E1F12041204127FD20000080208020FFE080207FE +D682:0000000004127FD21112209E1F12041204127FD20000088808880F88089407E3 +D683:0000000004127FD21112209E1F12041204127FD200000040004000A003180C06 +D684:0000000004127FD21112209E1F12041204127FD20000020802080208051418E3 +D685:0000000004127FD21112209E1F12041204127FD2000007FC08020802080207FC +D686:0000000004127FD21112209E1F12041204127FD200000FFE004000A003180C06 +D687:0000000004127FD21112209E1F12041204127FD2000001F000000FFE01100E0E +D688:0000000004127FD21112209E1F12041204127FD200000FFE00020FFE00020002 +D689:0000000004127FD21112209E1F12041204127FD200000FFE08000FFC080007FE +D68A:0000000004127FD21112209E1F12041204127FD200000FFE0208020802080FFE +D68B:0000000004127FD21112209E1F12041204127FD2000001F000000FFE040403F8 +D68C:0000000000041F0400047FC400041F04208420841F04040404047FF400040004 +D68D:0000000004047FC4110420841F04040404047FF400001FFC0004000400040004 +D68E:0000000004047FC4110420841F04040404047FF400001F7C0104010401040104 +D68F:0000000004047FC4110420841F04040404047FF400001F1001100110012801C6 +D690:0000000004047FC4110420841F04040404047FF4000410041000100010000FFC +D691:0000000004047FC4110420841F04040404047FF40000107C1010101010280FC6 +D692:0000000004047FC4110420841F04040404047FF400001038100010FE10440F38 +D693:0000000004047FC4110420841F04040404047FF400001FFC1000100010000FFC +D694:0000000004047FC4110420841F04040404047FF400001FFC00041FF810000FFC +D695:0000000004047FC4110420841F04040404047FF400001F7C01041E0410040F04 +D696:0000000004047FC4110420841F04040404047FF400001F7C01441E4410440F3C +D697:0000000004047FC4110420841F04040404047FF400001F4401441E7C10440F3C +D698:0000000004047FC4110420841F04040404047FF400001F1001101E1010280FC6 +D699:0000000004047FC4110420841F04040404047FF400001F7C01401E7C10400F3C +D69A:0000000004047FC4110420841F04040404047FF400001F7E01241E2410240F7E +D69B:0000000004047FC4110420841F04040404047FF400001F3801001EFE10440F38 +D69C:0000000004047FC4110420841F04040404047FF400001FFC1004100410040FFC +D69D:0000000004047FC4110420841F04040404047FF40000100410041FFC10040FFC +D69E:0000000004047FC4110420841F04040404047FF40000111011101F1011280FC6 +D69F:0000000004047FC4110420841F04040404047FF400000080008001400630180C +D6A0:0000000004047FC4110420841F04040404047FF400000410041004100A2831C6 +D6A1:0000000004047FC4110420841F04040404047FF400000FF81004100410040FF8 +D6A2:0000000004047FC4110420841F04040404047FF400001FFC008001400630180C +D6A3:0000000004047FC4110420841F04040404047FF4000003E000001FFC02201C1C +D6A4:0000000004047FC4110420841F04040404047FF400001FFC00041FFC00040004 +D6A5:0000000004047FC4110420841F04040404047FF400001FFC10001FF810000FFC +D6A6:0000000004047FC4110420841F04040404047FF400001FFC0410041004101FFC +D6A7:0000000004047FC4110420841F04040404047FF4000003E000001FFC080807F0 +D6A8:00000000000003E000001FFC000007F00808080807F0022002207FFF00000000 +D6A9:0000000000801FFC0410080807F0022002207FFF00001FFC0004000400040004 +D6AA:0000000000801FFC0410080807F0022002207FFF00001F7C0104010401040104 +D6AB:0000000000801FFC0410080807F0022002207FFF00001F1001100110012801C6 +D6AC:0000000000801FFC0410080807F0022002207FFF000010001000100010000FFC +D6AD:0000000000801FFC0410080807F0022002207FFF0000107C1010101010280FC6 +D6AE:0000000000801FFC0410080807F0022002207FFF00001038100010FE10440F38 +D6AF:0000000000801FFC0410080807F0022002207FFF00001FFC1000100010000FFC +D6B0:0000000000801FFC0410080807F0022002207FFF00001FFC00041FF810000FFC +D6B1:0000000000801FFC0410080807F0022002207FFF00001F7C01041E0410040F04 +D6B2:0000000000801FFC0410080807F0022002207FFF00001F7C01441E4410440F3C +D6B3:0000000000801FFC0410080807F0022002207FFF00001F4401441E7C10440F3C +D6B4:0000000000801FFC0410080807F0022002207FFF00001F1001101E1010280FC6 +D6B5:0000000000801FFC0410080807F0022002207FFF00001F7C01401E7C10400F3C +D6B6:0000000000801FFC0410080807F0022002207FFF00001F7E01241E2410240F7E +D6B7:0000000000801FFC0410080807F0022002207FFF00001F3801001EFE10440F38 +D6B8:0000000000801FFC0410080807F0022002207FFF00001FFC1004100410040FFC +D6B9:0000000000801FFC0410080807F0022002207FFF0000100410041FFC10040FFC +D6BA:0000000000801FFC0410080807F0022002207FFF0000111011101F1011280FC6 +D6BB:0000000000801FFC0410080807F0022002207FFF00000080008001400630180C +D6BC:0000000000801FFC0410080807F0022002207FFF00000410041004100A2831C6 +D6BD:0000000000801FFC0410080807F0022002207FFF00000FF81004100410040FF8 +D6BE:0000000000801FFC0410080807F0022002207FFF00001FFC008001400630180C +D6BF:0000000000801FFC0410080807F0022002207FFF000003E000001FFC02201C1C +D6C0:0000000000801FFC0410080807F0022002207FFF00001FFC00041FFC00040004 +D6C1:0000000000801FFC0410080807F0022002207FFF00001FFC10001FF810000FFC +D6C2:0000000000801FFC0410080807F0022002207FFF00001FFC0410041004101FFC +D6C3:0000000000801FFC0410080807F0022002207FFF000003E000001FFC080807F0 +D6C4:0000000000801FFC0410080807F0000000007FFF008000800080008000800080 +D6C5:0000000000801FFC0410080807F000007FFF008000801FFC0004000400040004 +D6C6:0000000000801FFC0410080807F000007FFF008000801F7C0104010401040104 +D6C7:0000000000801FFC0410080807F000007FFF008000801F1001100110012801C6 +D6C8:0000000000801FFC0410080807F0000000007FFF008010801080100010000FFC +D6C9:0000000000801FFC0410080807F000007FFF00800080107C1010101010280FC6 +D6CA:0000000000801FFC0410080807F000007FFF008000801038100010FE10440F38 +D6CB:0000000000801FFC0410080807F000007FFF008000801FFC1000100010000FFC +D6CC:0000000000801FFC0410080807F000007FFF008000801FFC00041FF810000FFC +D6CD:0000000000801FFC0410080807F000007FFF008000801F7C01041E0410040F04 +D6CE:0000000000801FFC0410080807F000007FFF008000801F7C01441E4410440F3C +D6CF:0000000000801FFC0410080807F000007FFF008000801F4401441E7C10440F3C +D6D0:0000000000801FFC0410080807F000007FFF008000801F1001101E1010280FC6 +D6D1:0000000000801FFC0410080807F000007FFF008000801F7C01401E7C10400F3C +D6D2:0000000000801FFC0410080807F000007FFF008000801F7E01241E2410240F7E +D6D3:0000000000801FFC0410080807F000007FFF008000801F3801001EFE10440F38 +D6D4:0000000000801FFC0410080807F000007FFF008000801FFC1004100410040FFC +D6D5:0000000000801FFC0410080807F000007FFF00800080100410041FFC10040FFC +D6D6:0000000000801FFC0410080807F000007FFF00800080111011101F1011280FC6 +D6D7:0000000000801FFC0410080807F000007FFF008000800080008001400630180C +D6D8:0000000000801FFC0410080807F000007FFF008000800410041004100A2831C6 +D6D9:0000000000801FFC0410080807F000007FFF008000800FF81004100410040FF8 +D6DA:0000000000801FFC0410080807F000007FFF008000801FFC008001400630180C +D6DB:0000000000801FFC0410080807F000007FFF0080008003E000001FFC02201C1C +D6DC:0000000000801FFC0410080807F000007FFF008000801FFC00041FFC00040004 +D6DD:0000000000801FFC0410080807F000007FFF008000801FFC10001FF810000FFC +D6DE:0000000000801FFC0410080807F000007FFF008000801FFC0410041004101FFC +D6DF:0000000000801FFC0410080807F000007FFF0080008003E000001FFC080807F0 +D6E0:0000000004047FC4110420841F04000400047FF404040404043C040404040404 +D6E1:0000000004047FC41104209C1F0400047FF4040404001FFC0004000400040004 +D6E2:0000000004047FC41104209C1F0400047FF4040404001F7C0104010401040104 +D6E3:0000000004047FC41104209C1F0400047FF4040404001F1001100110012801C6 +D6E4:0000000004047FC4110420841F0400047FF40404043C14041000100010000FFC +D6E5:0000000004047FC41104209C1F0400047FF404040400107C1010101010280FC6 +D6E6:0000000004047FC41104209C1F0400047FF4040404001038100010FE10440F38 +D6E7:0000000004047FC41104209C1F0400047FF4040404001FFC1000100010000FFC +D6E8:0000000004047FC41104209C1F0400047FF4040404001FFC00041FF810000FFC +D6E9:0000000004047FC41104209C1F0400047FF4040404001F7C01041E0410040F04 +D6EA:0000000004047FC41104209C1F0400047FF4040404001F7C01441E4410440F3C +D6EB:0000000004047FC41104209C1F0400047FF4040404001F4401441E7C10440F3C +D6EC:0000000004047FC41104209C1F0400047FF4040404001F1001101E1010280FC6 +D6ED:0000000004047FC41104209C1F0400047FF4040404001F7C01401E7C10400F3C +D6EE:0000000004047FC41104209C1F0400047FF4040404001F7E01241E2410240F7E +D6EF:0000000004047FC41104209C1F0400047FF4040404001F3801001EFE10440F38 +D6F0:0000000004047FC41104209C1F0400047FF4040404001FFC1004100410040FFC +D6F1:0000000004047FC41104209C1F0400047FF404040400100410041FFC10040FFC +D6F2:0000000004047FC41104209C1F0400047FF404040400111011101F1011280FC6 +D6F3:0000000004047FC41104209C1F0400047FF4040404000080008001400630180C +D6F4:0000000004047FC41104209C1F0400047FF4040404000410041004100A2831C6 +D6F5:0000000004047FC41104209C1F0400047FF4040404000FF81004100410040FF8 +D6F6:0000000004047FC41104209C1F0400047FF4040404001FFC008001400630180C +D6F7:0000000004047FC41104209C1F0400047FF40404040003E000001FFC02201C1C +D6F8:0000000004047FC41104209C1F0400047FF4040404001FFC00041FFC00040004 +D6F9:0000000004047FC41104209C1F0400047FF4040404001FFC10001FF810000FFC +D6FA:0000000004047FC41104209C1F0400047FF4040404001FFC0410041004101FFC +D6FB:0000000004047FC41104209C1F0400047FF40404040003E000001FFC080807F0 +D6FC:0000000004127FD2111220921F12001200127FD20412041204F2041204120412 +D6FD:0000000004127FD2111220F21F1200127FD2041204000FFE0002000200020002 +D6FE:0000000004127FD2111220F21F1200127FD2041204000FBE0082008200820082 +D6FF:0000000004127FD2111220F21F1200127FD2041204000F8800880088009400E3 +D700:0000000004127FD2111220921F1200127FD2021202F20A1208000800080007FE +D701:0000000004127FD2111220F21F1200127FD204120400083E08080808081407E3 +D702:0000000004127FD2111220F21F1200127FD204120400081C0800087F0822079C +D703:0000000004127FD2111220F21F1200127FD2041204000FFE08000800080007FE +D704:0000000004127FD2111220F21F1200127FD2041204000FFE00020FFC080007FE +D705:0000000004127FD2111220F21F1200127FD2041204000FBE00820F0208020782 +D706:0000000004127FD2111220F21F1200127FD2041204000FBE00A20F220822079E +D707:0000000004127FD2111220F21F1200127FD2041204000FA200A20F3E0822079E +D708:0000000004127FD2111220F21F1200127FD2041204000F8800880F08081407E3 +D709:0000000004127FD2111220F21F1200127FD2041204000FBE00A00F3E0820079E +D70A:0000000004127FD2111220F21F1200127FD2041204000FBF00920F12081207BF +D70B:0000000004127FD2111220F21F1200127FD2041204000F9C00800F7F0822079C +D70C:0000000004127FD2111220F21F1200127FD2041204000FFE08020802080207FE +D70D:0000000004127FD2111220F21F1200127FD204120400080208020FFE080207FE +D70E:0000000004127FD2111220F21F1200127FD204120400088808880F88089407E3 +D70F:0000000004127FD2111220F21F1200127FD2041204000040004000A003180C06 +D710:0000000004127FD2111220F21F1200127FD204120400020802080208051418E3 +D711:0000000004127FD2111220F21F1200127FD20412040007FC08020802080207FC +D712:0000000004127FD2111220F21F1200127FD2041204000FFE004000A003180C06 +D713:0000000004127FD2111220F21F1200127FD20412040001F000000FFE01100E0E +D714:0000000004127FD2111220F21F1200127FD2041204000FFE00020FFE00020002 +D715:0000000004127FD2111220F21F1200127FD2041204000FFE08000FFC080007FE +D716:0000000004127FD2111220F21F1200127FD2041204000FFE0208020802080FFE +D717:0000000004127FD2111220F21F1200127FD20412040001F000000FFE040403F8 +D718:0000000004047FC4110420841F04000400047FF4040404040404040404040404 +D719:0000000004047FC4110420841F0400047FF4040404001FFC0004000400040004 +D71A:0000000004047FC4110420841F0400047FF4040404001F7C0104010401040104 +D71B:0000000004047FC4110420841F0400047FF4040404001F1001100110012801C6 +D71C:0000000004047FC4110420841F0400047FF40404040414041000100010000FFC +D71D:0000000004047FC4110420841F0400047FF404040400107C1010101010280FC6 +D71E:0000000004047FC4110420841F0400047FF4040404001038100010FE10440F38 +D71F:0000000004047FC4110420841F0400047FF4040404001FFC1000100010000FFC +D720:0000000004047FC4110420841F0400047FF4040404001FFC00041FF810000FFC +D721:0000000004047FC4110420841F0400047FF4040404001F7C01041E0410040F04 +D722:0000000004047FC4110420841F0400047FF4040404001F7C01441E4410440F3C +D723:0000000004047FC4110420841F0400047FF4040404001F4401441E7C10440F3C +D724:0000000004047FC4110420841F0400047FF4040404001F1001101E1010280FC6 +D725:0000000004047FC4110420841F0400047FF4040404001F7C01401E7C10400F3C +D726:0000000004047FC4110420841F0400047FF4040404001F7E01241E2410240F7E +D727:0000000004047FC4110420841F0400047FF4040404001F3801001EFE10440F38 +D728:0000000004047FC4110420841F0400047FF4040404001FFC1004100410040FFC +D729:0000000004047FC4110420841F0400047FF404040400100410041FFC10040FFC +D72A:0000000004047FC4110420841F0400047FF404040400111011101F1011280FC6 +D72B:0000000004047FC4110420841F0400047FF4040404000080008001400630180C +D72C:0000000004047FC4110420841F0400047FF4040404000410041004100A2831C6 +D72D:0000000004047FC4110420841F0400047FF4040404000FF81004100410040FF8 +D72E:0000000004047FC4110420841F0400047FF4040404001FFC008001400630180C +D72F:0000000004047FC4110420841F0400047FF40404040003E000001FFC02201C1C +D730:0000000004047FC4110420841F0400047FF4040404001FFC00041FFC00040004 +D731:0000000004047FC4110420841F0400047FF4040404001FFC10001FF810000FFC +D732:0000000004047FC4110420841F0400047FF4040404001FFC0410041004101FFC +D733:0000000004047FC4110420841F0400047FF40404040003E000001FFC080807F0 +D734:0000000000801FFC0410080807F0000000007FFF041004100410041004100410 +D735:0000000000801FFC0410080807F000007FFF022002201FFC0004000400040004 +D736:0000000000801FFC0410080807F000007FFF022002201F7C0104010401040104 +D737:0000000000801FFC0410080807F000007FFF022002201F1001100110012801C6 +D738:0000000000801FFC0410080807F0000000007FFF022012201220100010000FFC +D739:0000000000801FFC0410080807F000007FFF02200220107C1010101010280FC6 +D73A:0000000000801FFC0410080807F000007FFF022002201038100010FE10440F38 +D73B:0000000000801FFC0410080807F000007FFF022002201FFC1000100010000FFC +D73C:0000000000801FFC0410080807F000007FFF022002201FFC00041FF810000FFC +D73D:0000000000801FFC0410080807F000007FFF022002201F7C01041E0410040F04 +D73E:0000000000801FFC0410080807F000007FFF022002201F7C01441E4410440F3C +D73F:0000000000801FFC0410080807F000007FFF022002201F4401441E7C10440F3C +D740:0000000000801FFC0410080807F000007FFF022002201F1001101E1010280FC6 +D741:0000000000801FFC0410080807F000007FFF022002201F7C01401E7C10400F3C +D742:0000000000801FFC0410080807F000007FFF022002201F7E01241E2410240F7E +D743:0000000000801FFC0410080807F000007FFF022002201F3801001EFE10440F38 +D744:0000000000801FFC0410080807F000007FFF022002201FFC1004100410040FFC +D745:0000000000801FFC0410080807F000007FFF02200220100410041FFC10040FFC +D746:0000000000801FFC0410080807F000007FFF02200220111011101F1011280FC6 +D747:0000000000801FFC0410080807F000007FFF022002200080008001400630180C +D748:0000000000801FFC0410080807F000007FFF022002200410041004100A2831C6 +D749:0000000000801FFC0410080807F000007FFF022002200FF81004100410040FF8 +D74A:0000000000801FFC0410080807F000007FFF022002201FFC008001400630180C +D74B:0000000000801FFC0410080807F000007FFF0220022003E000001FFC02201C1C +D74C:0000000000801FFC0410080807F000007FFF022002201FFC00041FFC00040004 +D74D:0000000000801FFC0410080807F000007FFF022002201FFC10001FF810000FFC +D74E:0000000000801FFC0410080807F000007FFF022002201FFC0410041004101FFC +D74F:0000000000801FFC0410080807F000007FFF0220022003E000001FFC080807F0 +D750:00000000000003E000001FFC000007F00808080807F0000000007FFF00000000 +D751:0000000000801FFC0410080807F000007FFF000000001FFC0004000400040004 +D752:0000000000801FFC0410080807F000007FFF000000001F7C0104010401040104 +D753:0000000000801FFC0410080807F000007FFF000000001F1001100110012801C6 +D754:0000000000801FFC0410080807F0000000007FFF000010001000100010000FFC +D755:0000000000801FFC0410080807F000007FFF00000000107C1010101010280FC6 +D756:0000000000801FFC0410080807F000007FFF000000001038100010FE10440F38 +D757:0000000000801FFC0410080807F000007FFF000000001FFC1000100010000FFC +D758:0000000000801FFC0410080807F000007FFF000000001FFC00041FF810000FFC +D759:0000000000801FFC0410080807F000007FFF000000001F7C01041E0410040F04 +D75A:0000000000801FFC0410080807F000007FFF000000001F7C01441E4410440F3C +D75B:0000000000801FFC0410080807F000007FFF000000001F4401441E7C10440F3C +D75C:0000000000801FFC0410080807F000007FFF000000001F1001101E1010280FC6 +D75D:0000000000801FFC0410080807F000007FFF000000001F7C01401E7C10400F3C +D75E:0000000000801FFC0410080807F000007FFF000000001F7E01241E2410240F7E +D75F:0000000000801FFC0410080807F000007FFF000000001F3801001EFE10440F38 +D760:0000000000801FFC0410080807F000007FFF000000001FFC1004100410040FFC +D761:0000000000801FFC0410080807F000007FFF00000000100410041FFC10040FFC +D762:0000000000801FFC0410080807F000007FFF00000000111011101F1011280FC6 +D763:0000000000801FFC0410080807F000007FFF000000000080008001400630180C +D764:0000000000801FFC0410080807F000007FFF000000000410041004100A2831C6 +D765:0000000000801FFC0410080807F000007FFF000000000FF81004100410040FF8 +D766:0000000000801FFC0410080807F000007FFF000000001FFC008001400630180C +D767:0000000000801FFC0410080807F000007FFF0000000003E000001FFC02201C1C +D768:0000000000801FFC0410080807F000007FFF000000001FFC00041FFC00040004 +D769:0000000000801FFC0410080807F000007FFF000000001FFC10001FF810000FFC +D76A:0000000000801FFC0410080807F000007FFF000000001FFC0410041004101FFC +D76B:0000000000801FFC0410080807F000007FFF0000000003E000001FFC080807F0 +D76C:0000000000041F0400047FC400041F04208420841F04000400047FF400040004 +D76D:0000000004047FC4110420841F0400047FF4000400001FFC0004000400040004 +D76E:0000000004047FC4110420841F0400047FF4000400001F7C0104010401040104 +D76F:0000000004047FC4110420841F0400047FF4000400001F1001100110012801C6 +D770:0000000004047FC4110420841F04000400047FF4000410041000100010000FFC +D771:0000000004047FC4110420841F0400047FF400040000107C1010101010280FC6 +D772:0000000004047FC4110420841F0400047FF4000400001038100010FE10440F38 +D773:0000000004047FC4110420841F0400047FF4000400001FFC1000100010000FFC +D774:0000000004047FC4110420841F0400047FF4000400001FFC00041FF810000FFC +D775:0000000004047FC4110420841F0400047FF4000400001F7C01041E0410040F04 +D776:0000000004047FC4110420841F0400047FF4000400001F7C01441E4410440F3C +D777:0000000004047FC4110420841F0400047FF4000400001F4401441E7C10440F3C +D778:0000000004047FC4110420841F0400047FF4000400001F1001101E1010280FC6 +D779:0000000004047FC4110420841F0400047FF4000400001F7C01401E7C10400F3C +D77A:0000000004047FC4110420841F0400047FF4000400001F7E01241E2410240F7E +D77B:0000000004047FC4110420841F0400047FF4000400001F3801001EFE10440F38 +D77C:0000000004047FC4110420841F0400047FF4000400001FFC1004100410040FFC +D77D:0000000004047FC4110420841F0400047FF400040000100410041FFC10040FFC +D77E:0000000004047FC4110420841F0400047FF400040000111011101F1011280FC6 +D77F:0000000004047FC4110420841F0400047FF4000400000080008001400630180C +D780:0000000004047FC4110420841F0400047FF4000400000410041004100A2831C6 +D781:0000000004047FC4110420841F0400047FF4000400000FF81004100410040FF8 +D782:0000000004047FC4110420841F0400047FF4000400001FFC008001400630180C +D783:0000000004047FC4110420841F0400047FF40004000003E000001FFC02201C1C +D784:0000000004047FC4110420841F0400047FF4000400001FFC00041FFC00040004 +D785:0000000004047FC4110420841F0400047FF4000400001FFC10001FF810000FFC +D786:0000000004047FC4110420841F0400047FF4000400001FFC0410041004101FFC +D787:0000000004047FC4110420841F0400047FF40004000003E000001FFC080807F0 +D788:0000000000040F0400043FC400040F0410841084108410840F04000400040004 +D789:0000000004047FC400041F04208420841F04000400001FFC0004000400040004 +D78A:0000000004047FC400041F04208420841F04000400001F7C0104010401040104 +D78B:0000000004047FC400041F04208420841F04000400001F1001100110012801C6 +D78C:0000000004047FC400041F04208420841F040004000410041000100010000FFC +D78D:0000000004047FC400041F04208420841F0400040000107C1010101010280FC6 +D78E:0000000004047FC400041F04208420841F04000400001038100010FE10440F38 +D78F:0000000004047FC400041F04208420841F04000400001FFC1000100010000FFC +D790:0000000004047FC400041F04208420841F04000400001FFC00041FF810000FFC +D791:0000000004047FC400041F04208420841F04000400001F7C01041E0410040F04 +D792:0000000004047FC400041F04208420841F04000400001F7C01441E4410440F3C +D793:0000000004047FC400041F04208420841F04000400001F4401441E7C10440F3C +D794:0000000004047FC400041F04208420841F04000400001F1001101E1010280FC6 +D795:0000000004047FC400041F04208420841F04000400001F7C01401E7C10400F3C +D796:0000000004047FC400041F04208420841F04000400001F7E01241E2410240F7E +D797:0000000004047FC400041F04208420841F04000400001F3801001EFE10440F38 +D798:0000000004047FC400041F04208420841F04000400001FFC1004100410040FFC +D799:0000000004047FC400041F04208420841F0400040000100410041FFC10040FFC +D79A:0000000004047FC400041F04208420841F0400040000111011101F1011280FC6 +D79B:0000000004047FC400041F04208420841F04000400000080008001400630180C +D79C:0000000004047FC400041F04208420841F04000400000410041004100A2831C6 +D79D:0000000004047FC400041F04208420841F04000400000FF81004100410040FF8 +D79E:0000000004047FC400041F04208420841F04000400001FFC008001400630180C +D79F:0000000004047FC400041F04208420841F040004000003E000001FFC02201C1C +D7A0:0000000004047FC400041F04208420841F04000400001FFC00041FFC00040004 +D7A1:0000000004047FC400041F04208420841F04000400001FFC10001FF810000FFC +D7A2:0000000004047FC400041F04208420841F04000400001FFC0410041004101FFC +D7A3:0000000004047FC400041F04208420841F040004000003E000001FFC080807F0 D7A4:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61B66DB661866DF66DF67FFE0000 D7A5:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61866DBE61866DF66D867FFE0000 D7A6:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61CE6DBE618E6DB66DCE7FFE0000 @@ -55214,82 +55212,82 @@ D7AC:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61C66DBE61BE6DBE6DC67FFE0000 D7AD:00007FFE63866DF66DEE6DDE63DE7FFE7FFE618E6DB661B66DB66D8E7FFE0000 D7AE:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61866DBE618E6DBE6D867FFE0000 D7AF:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61866DBE618E6DBE6DBE7FFE0000 -D7B0:0040003000100010001003F00110001003F0011000100C1004D0071078100000 -D7B1:00000000000000000000000000000000030001001FF001003FF8000003000100 -D7B2:004000300010001000100010001000100010001001900C9C04F0071078100000 -D7B3:0048003600120012001200120012001200120012031E191209F20F1278020000 -D7B4:00080006000200020002000200020002001E00020302193209C20F0278020000 -D7B5:0008000600020002000200020002000200023FF20202021E0202021E00020000 -D7B6:0010008C006400240024002400240024002400247FE404240424042400040000 -D7B7:00480036001200120012001200120012001E00127FF211121112111200020000 -D7B8:00000000000000000000000000000000000000003FF808200BA000803FFC0000 -D7B9:00800060002000200020002000200020003C00200020002000E0072078200000 -D7BA:00080006000200020002000200020002001E00020002000200E2070278020000 -D7BB:00480036001200120012001200120012007200120012001200D2071278020000 -D7BC:00000000000000000000000000000000000000003FF80000038000803FFC0000 -D7BD:00000040013000D000500050005C00500050005C005000500E1002003FFC0000 -D7BE:0090046C03240124013C01240124013C01240124012401240024000400000000 -D7BF:011000CC00440044005C00440044005C00440044004400440044000400000000 -D7C0:0410034C01340114011401740114011401740114011401140114001400040000 -D7C1:000000200018000800080008000800080008070801003FF80000070001000100 -D7C2:00000020001800080008000800080008000839C808403FF80000000000000000 -D7C3:000000200018000800080008000800080008000800003FF80840084000000000 -D7C4:0048003600120012001200120012001200120012001200120012001200020000 -D7C5:00800060002000200020002000200020003C0020302038200820002000200000 -D7C6:0010008C00640024002400240024002401E40024302438240824002400040000 +D7B0:000000000004000400040004003C00040004003C0204020402047FF400040004 +D7B1:00000000000000000000008000807FFF0000008000807FFF0000008000800080 +D7B2:00000000000400040004000400040004000700040884088408847FF400040004 +D7B3:00000000001200120012001200120012001E00121112111211127FD200120012 +D7B4:00000000000400040004000400040004003C00040884088408847FF400040004 +D7B5:0000000000040004000400040004000400047FF40204023C02040204023C0204 +D7B6:000000000002001200120012001200127FD20412041204120412041204120002 +D7B7:0000000000120012001200120012001E7FD21112111211121112111211121112 +D7B8:00000000000000000000000000007FFF0220022002A0008000807FFF00000000 +D7B9:00000000000400040004000400040004000700040004000400047FF400040004 +D7BA:00000000000400040004000400040004001C00040004000400047FF400040004 +D7BB:0000000000120012001200120012001200F200120012001200127FD200120012 +D7BC:000000000000000000000000000000007FFF00000080008000807FFF00000000 +D7BD:00000000000400240027002400240027002400240084008000807FFF00000000 +D7BE:0000000000480448044804480478044804480448047804480448044804480048 +D7BF:00000000001004100410041004F004100410041004F004100410041004100010 +D7C0:00000000004808480848084809C808480848084809C808480848084808480048 +D7C1:000000000008000800080008000800080088008000807FFF0000008000800080 +D7C2:00000000000800080008000800080008000800080220022002207FFF00000000 +D7C3:0000000000080008000800080008000800080008000000007FFF022002200220 +D7C4:0000000000200220022002200220022002200220022002200220022002200020 +D7C5:0000000000040004000400040004000400070004000400040304030400040004 +D7C6:0000000000240024002400240024002401E40024002400241824182400240024 D7C7:00007FFE63866DF66DEE6DDE63DE7FFE7FFE71866FF66FEE6FDE71DE7FFE0000 D7C8:00007FFE63866DF66DEE6DDE63DE7FFE7FFE71CE6FB66FCE6FB671CE7FFE0000 D7C9:00007FFE63866DF66DEE6DDE63DE7FFE7FFE71CE6FB66FC66FF671CE7FFE0000 D7CA:00007FFE63866DF66DEE6DDE63DE7FFE7FFE71866FB66F866FB671B67FFE0000 -D7CB:0000000000000000000000000000000060FE2002200220FE2080268038FE0000 -D7CC:000000000000000000000078C00043FE402040304C4871840000000000000000 -D7CD:000000000000000000000000000000000000FDF8208020802080268018780000 -D7CE:00000000000000000000000000000000FFB62212221E22122212265E19920000 -D7CF:00000000000000000000000000000000FD98208820F82088208826F818880000 -D7D0:0000000000000000000000000000000000007C38200820082018262438C20000 -D7D1:00000000000000000000000000000000000078EE2022202220622492390A0000 -D7D2:0000000000000000000000000000000000007C7E200820082018262438C20000 -D7D3:00000000000000000000000000000000003C7C00207E20082018262438C20000 -D7D4:00000000000000000000000000000000000000007EFC1040107C13400C3C0000 -D7D5:00000000000000000000000000000000000000003DDC04443C4420443C440000 -D7D6:0000000000000000000000000000001C3DC0047E04483C5C206220623C5C0000 -D7D7:00000000000000000000000000000000000000007BDC08447BDC42047BC40000 -D7D8:0000000000000000000000000000001C7BC00A7E0A487A5C426243E27A1C0000 -D7D9:000000000000000000000000000004807A5E0A480BC87A48424843C87A4E0000 -D7DA:0000000000000000000000000000049E7A440A420BD27A4A424243C47A5E0000 -D7DB:000000000000000000000000000000083C08041C04223C22202220223C1C0000 -D7DC:0000000000000000000000000000000EF780101F1304F48E84918491F30E0000 -D7DD:000000000000000000001FF800081FF810001FF8000003E00410041003E00000 -D7DE:0000000000000000000000000000000000007DC044404440444044407C3E4000 -D7DF:0000000000000000000000000000000000007B30491049104910491078CC4000 -D7E0:00000000000000000000000000000000000000003E7C2244224422443E7C2040 -D7E1:0000000000000000000000000000000000000480F4889784948C9492F7A18000 -D7E2:00000000000000000000000000000000000000003EFC2220223022483E842000 -D7E3:000000000000000000000000000000004400227C22203E20222022203E3C0000 -D7E4:0000000000000000000000000000000049DE244424523DCA250225043DDE0000 -D7E5:000000000000000000000000000000004400227C22443E44224422443E7C0040 -D7E6:000000000000000000000000000000004488224422443E7C224422443E7C0000 -D7E7:000000000000000000000000000000009000485E4848788849484A287A2E0000 -D7E8:000000000000000000000000000000004400220022FC3E20223022483E840000 -D7E9:000000000000000000000000000000004478220022FC3E20223022483E840000 -D7EA:0000000000000000000000000000000000000800047C04440C441244617C0040 -D7EB:00000000000000000000000000000044007C0844047C04000C38124461380000 -D7EC:000000000000000000000000000000000000123C0904090419042684CC440000 -D7ED:000000000000000000000000000000000000123E0910091019102690CC5E0000 -D7EE:00000000000000000000000000000000000010200810082818442482C2FE0000 -D7EF:000000000000000000000000000000000000000010FC082018302448C2840000 -D7F0:000000000000000000000000000000000078100008FC082018302448C2840000 -D7F1:000000000000000000000000000000000000100008FC0840187C2440C23C0000 -D7F2:000000000000000000000000000000380000107C0810083818442444C2380000 -D7F3:0000000000000000000000000000000001102088108828F844888288FEF80000 -D7F4:0000000000000000000000000210010801F8210811F8287044888270FE000000 -D7F5:000000000000000000000000000000000800087C1C442244224422441C7C0040 -D7F6:000000000000000000000000000000380800087C1C102238224422441C380000 -D7F7:00000000000000000000000000000000000000003F4404440C7C1244217C0040 -D7F8:000000000000000000000000000000000000000001297D2911EF292945EF0108 -D7F9:00000000000000000000000000000000000000007EFC08201830244842840000 -D7FA:000000000000000000000000000000007800104048202820086010907B080000 -D7FB:0000000000000000000000000000000078FC10404840287C08401040783C0000 +D7CB:0000000000000000107C10041004100410781040104010400F3C000000000000 +D7CC:00000000000000001038100010FE101010281028104410440F82000000000000 +D7CD:00000000000000001F7C10401040104010401040104010400F3C000000000000 +D7CE:00000000000000007BD2421242124212421E42124212421239CE000000000000 +D7CF:00000000000000001F44104410441044107C1044104410440F3C000000000000 +D7D0:00000000000000001F1010101010101010281028104410440F82000000000000 +D7D1:00000000000000003C9E20822082208221422142214222221E22000000000000 +D7D2:00000000000000001F7E10101010101010281028104410440F82000000000000 +D7D3:00000000000000001F38100010FE101010101028102810440F82000000000000 +D7D4:00000000000000001F7C10401040104010781040104010400F3C000000000000 +D7D5:00000000000000007BDE08420842084270424042404240423842000000000000 +D7D6:00000000000000007BCC0840087F0840704C405240524052384C000000000000 +D7D7:00000000000000007BDE084208420842739E42024202420239C2000000000000 +D7D8:00000000000000007BCC0A400A7F0A40724C42524252425239CC000000000000 +D7D9:00000000000000007A5E0A500A500A5073D042504250425039CE000000000000 +D7DA:00000000000000007A5F0A400A4A0A4A73CA424A424A424A39DF000000000000 +D7DB:00000000000000001F100110013801441E441044104410440F38000000000000 +D7DC:00000000000000007FEC080009BF0A40724C425242524252398C000000000000 +D7DD:0000000000000FF800080FF0080007F8000007F008080808080807F000000000 +D7DE:00000000000000001F4011401140114011401140114011400F3C000000000000 +D7DF:00000000000000007A104A104A104A104A104A104A104A1039CE000000000000 +D7E0:00000000000000001F7C11441144114411441144114411440F3C000000000000 +D7E1:00000000000000007A444A444A444A444BCA4A4A4A4A4A5139D1000000000000 +D7E2:00000000000000001F7E11101110111011101128112811440F82000000000000 +D7E3:0000000000000000117C1140114011401F401140114011400F3C000000000000 +D7E4:00000000000000004BDF4840484A484A7B8A4A0A4A0A4A0A39DF000000000000 +D7E5:0000000000000000117C1144114411441F441144114411440F3C000000000000 +D7E6:000000000000000011441144114411441F7C1144114411440F3C000000000000 +D7E7:0000000000000000249E2490249024903D502550255026301E2E000000000000 +D7E8:0000000000000000117E1110111011101F281128114411440F82000000000000 +D7E9:00000000000000001138110011FE11101F101128112811440F82000000000000 +D7EA:0000000000000000047C0444044404440A440A441144114420BC000000000000 +D7EB:00000000000000440444047C0444043C0A000A381144114420C4003800000000 +D7EC:0000000000000000089E08820882088215421542154222222222000000000000 +D7ED:0000000000000000089E0890089008901550155015502230222E000000000000 +D7EE:000000000000000004100410042804280A280A441144118220FE000000000000 +D7EF:000000000000000004FE0410041004100A280A28114411442082000000000000 +D7F0:00000000000000000438040004FE04100A100A28112811442082000000000000 +D7F1:0000000000000000047C0440044004400A780A401140114020BC000000000000 +D7F2:00000000000000000438040004FE04000A380A441144114420B8000000000000 +D7F3:0000000000000000044404440A440A440A7C1144114420C43FBC000000000000 +D7F4:00000000000000440444047C0A440A3C0A001138114420C43FC4003800000000 +D7F5:0000000000000000047C04440E44114411441144114411440E3C000000000000 +D7F6:0000000000000000043804000EFE110011381144114411440E38000000000000 +D7F7:00000000000000001F440444044404440A7C0A441144114420BC000000000000 +D7F8:00000000000000007E521252125212522BDE2A522A52465245CE000000000000 +D7F9:00000000000000003FFE0410041004100A280A28114411442082000000000000 +D7FA:00000000000000003F38000012FE120012381244124412443F38000000000000 +D7FB:00000000000000003F7C00401240124012781240124012403F3C000000000000 D7FC:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61C66FBE63BE6FBE6FC67FFE0000 D7FD:00007FFE63866DF66DEE6DDE63DE7FFE7FFE618E6FB663B66FB66F8E7FFE0000 D7FE:00007FFE63866DF66DEE6DDE63DE7FFE7FFE61866FBE638E6FBE6F867FFE0000 @@ -55807,7 +55805,7 @@ FAFD:00007FFE61866FB663866FB66FB67FFE7FFE618E6FB663B66FB66F8E7FFE0000 FAFE:00007FFE61866FB663866FB66FB67FFE7FFE61866FBE638E6FBE6F867FFE0000 FAFF:00007FFE61866FB663866FB66FB67FFE7FFE61866FBE638E6FBE6FBE7FFE0000 FB00:0000001B2424247E2424242424240000 -FB01:0000001A2220207E2222222222220000 +FB01:0000001C2220207E2222222222220000 FB02:0000001E2222227A2222222222220000 FB03:000000162A28287E2A2A2A2A2A2A0000 FB04:0000001E2A2A2A7E2A2A2A2A2A2A0000 @@ -55839,20 +55837,20 @@ FB1D:00000000001C04040400040000000000 FB1E:0042423C000000000000000000000000 FB1F:000000000077111111003E0000000000 FB20:00000000001212121212121212FE0000 -FB21:00000000000000000000300C300C0C0C030C0CF030C03030300C300C00000000 -FB22:000000000000000000003FFC0030003000300030003000300030003000000000 -FB23:000000000000000000003FFC000C000C0C0C0C0C0C0C0C0C0C0C0C0C00000000 -FB24:000000000000000000003FFC000C000C000C000C000C000C000C3FF000000000 -FB25:0000000000000C000C000FFC000C000C000C000C0030003000C00F0000000000 -FB26:00000000000000000000FFFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C0FFC00000000 -FB27:000000000000000000003FFC000C000C000C000C000C000C000C000C00000000 -FB28:000000000000000000000FFC0C0C0C0C0C0C0C0C0C0C0C0C0C0C3C0C00000000 +FB21:000000000000000000004002400230020C02338C4070400C4002400200000000 +FB22:000000000000000000007FFE0004000400040004000400040004000400000000 +FB23:000000000000000000007FFE0002000220022002200220022002200200000000 +FB24:000000000000000000007FFE00020002000200020002000200027FFC00000000 +FB25:000000000000200020003FFE000200020002000200040008003001C000000000 +FB26:00000000000000000000FFFE20022002200220022002200220023FFE00000000 +FB27:000000000000000000007FFE0002000200020002000200020002000200000000 +FB28:000000000000000000003FFE2002200220022002200220022002600200000000 FB29:00000000000000080808087F00000000 FB2A:000000010049494949494949497F0000 FB2B:000000400049494949494949497F0000 FB2C:0000000100494949494D4949497F0000 FB2D:0000004000494949494D4949497F0000 -FB2E:0000000000464222122C484442411C00 +FB2E:0000000000424222122C48444242003C FB2F:0000000000464222122C484442411C08 FB30:0000000000424222122C484442410800 FB31:00000000007C040404240404047F0000 @@ -55882,9 +55880,9 @@ FB48:00000000007E02020212020202020000 FB49:0000000000494949494D4949497F0000 FB4A:00000000003E2222222A222222620000 FB4B:00000020003808080808080808080000 -FB4C:00000070007C040404040404047F0000 -FB4D:00000070007E020202020202027C0000 -FB4E:00000070007E424242720202027E0000 +FB4C:0000003C007C040404040404047F0000 +FB4D:0000003C007E020202020202027C0000 +FB4E:0000003C007E424242720202027E0000 FB4F:0000602020464222122C484442420000 FB50:040A1E20080808080808080000000000 FB51:102878802020202020201F0000000000 @@ -56000,7 +55998,7 @@ FBBE:000000000000000000003030000C0C00 FBBF:00000000000000000000000814242810 FBC0:0010101C1C0000000000000000000000 FBC1:00000000000000000000000010101C1C -FBC2:00007FFE618E6FB6638E6FB66F8E7FFE7FFE71866FF66F866FBE71867FFE0000 +FBC2:040A1E20000000000000000000000000 FBC3:00007FFE618E6FB6638E6FB66F8E7FFE7FFE718E6FF66FC66FF6718E7FFE0000 FBC4:00007FFE618E6FB6638E6FB66F8E7FFE7FFE71B66FB66F866FF671F67FFE0000 FBC5:00007FFE618E6FB6638E6FB66F8E7FFE7FFE71866FBE6F866FF671867FFE0000 @@ -56027,11 +56025,11 @@ FBD9:000000221408000C12121E0204483000 FBDA:000000221408000C12121F0204483000 FBDB:000000080404000C12121E0204483000 FBDC:000000080404000C12121F0204483000 -FBDD:000033341324400C12121E0204483000 +FBDD:00003033142344102828380808106000 FBDE:000008001200000C12121E0204483000 FBDF:000008001200000C12121F0204483000 -FBE0:000000000000000C12121E021C483000 -FBE1:000000000000000C12121F021C483000 +FBE0:000000000000000C12121E023C483000 +FBE1:000000000000000C12121F023C483000 FBE2:000000081422000C12121E0204483000 FBE3:000000081422000C12121F0204483000 FBE4:000000000000000C5248443800100010 @@ -56113,7 +56111,7 @@ FC2F:00008020503090207E1020404040211E FC30:00000040102818081020103840404040 FC31:00000400000C0A0602464844423C0000 FC32:00000400000C0A0602464844423C0028 -FC33:0000005000205030407E20404840221C +FC33:0000005000205030407E20404040221C FC34:00002800102818081020103840404040 FC35:00001400000C0A0602464844423C0000 FC36:00001400000C0A0602464844423C0028 @@ -56382,22 +56380,22 @@ FD3C:010204111214101010100F0000000000 FD3D:01020411121410101010100000000000 FD3E:0000007E018C023004C00F000A0035806AC035800A000F0004C00230018C007E FD3F:00007E0031800C40032000F0005001AC035601AC005000F003200C4031807E00 -FD40:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DCE6DB661B67DB67DCE7FFE0000 -FD41:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DEE6DCE61EE7DEE7DC67FFE0000 -FD42:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D866DF661867DBE7D867FFE0000 -FD43:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D8E6DF661C67DF67D8E7FFE0000 -FD44:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DB66DB661867DF67DF67FFE0000 -FD45:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D866DBE61867DF67D867FFE0000 -FD46:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DCE6DBE618E7DB67DCE7FFE0000 -FD47:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D866DF661EE7DDE7DDE7FFE0000 -FD48:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DCE6DB661CE7DB67DCE7FFE0000 -FD49:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DCE6DB661C67DF67DCE7FFE0000 -FD4A:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D866DB661867DB67DB67FFE0000 -FD4B:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D8E6DB6618E7DB67D8E7FFE0000 -FD4C:00007FFE618E6FB663B66FB66F8E7FFE7FFE6DC66DBE61BE7DBE7DC67FFE0000 -FD4D:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D8E6DB661B67DB67D8E7FFE0000 -FD4E:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D866DBE618E7DBE7D867FFE0000 -FD4F:00007FFE618E6FB663B66FB66F8E7FFE7FFE6D866DBE618E7DBE7DBE7FFE0000 +FD40:0000092419242924192406C40000000010C0302451F232820DA4001800000000 +FD41:092019242924192406C410043234504033E80C000038064449F9480244243818 +FD42:092419242924192446C450004D0C545038F807020038064449F9480244243818 +FD43:092419242924192406C410000D0C145038F8E7028038864409F9480244243818 +FD44:092419242924192446C450004D0C545058F837021038064449F9480244243818 +FD45:092419242924192406C010064C880A2E9CF093026038064449F9480244243818 +FD46:2AA06AA0AAAA6A2D145680C080287FC80009202A5FD78004024A024632424C4C +FD47:0000018000C0090A490A282A1AAA17D26000082018202826192806DE00000280 +FD48:0000018000CA090A490A282A1AB217C26010001006126A543FAE4A0046A00000 +FD49:0000018000CA490A290A182A1AB267C24010401040125A543EAE030002500000 +FD4A:21A8A7ABA02B6AA15F468000140A4D4AA5AAE5720A0210200026192826DE4000 +FD4B:000000002002312A49FC790002002400181402002A8CBC4A9026922263FC0000 +FD4C:2AA06AAAAA357446012014C45404D64522D60C6F00000452040525535BE1A006 +FD4D:0000018000C0490A290A182A1AAA67D200004020402046264AA83F5E0A0006A0 +FD4E:0040004013C04E0040A44C0A44463B82000C2880488528808A92726C02000C10 +FD4F:0000092419242924192406C4000000600010007A04A23D627504421840000000 FD50:0000000000000000000000000028020005040084FFFC50002100000000000000 FD51:00000000000000000000000000141080294204220BFF10002400200012000C00 FD52:0000000000000000000000000028210052840844FFFC00002000000000000000 @@ -56525,7 +56523,7 @@ FDCB:00007FFE618E6FB663B66FB66F8E7FFE7FFE718E6FB66F8E6FB6718E7FFE0000 FDCC:00007FFE618E6FB663B66FB66F8E7FFE7FFE71C66FBE6FBE6FBE71C67FFE0000 FDCD:00007FFE618E6FB663B66FB66F8E7FFE7FFE718E6FB66FB66FB6718E7FFE0000 FDCE:00007FFE618E6FB663B66FB66F8E7FFE7FFE71866FBE6F8E6FBE71867FFE0000 -FDCF:00007FFE618E6FB663B66FB66F8E7FFE7FFE71866FBE6F8E6FBE71BE7FFE0000 +FDCF:00000040024001412CD55CBE81000000402048204026492836DE000002800000 FDD0:FFFFFFFFE18FEFB7E3B7EFB7EF8FFFFFFFFFE3CFEDB7EDB7EDB7E3CFFFFFFFFF FDD1:FFFFFFFFE18FEFB7E3B7EFB7EF8FFFFFFFFFE3DFED9FEDDFEDDFE38FFFFFFFFF FDD2:FFFFFFFFE18FEFB7E3B7EFB7EF8FFFFFFFFFE387EDF7ED87EDBFE387FFFFFFFF @@ -56572,8 +56570,8 @@ FDFA:2AA06AA0AAAA6A2D145680C480287FC82029602ABFD7440204553D035351A0A6 FDFB:000008000804480A480137FF000002A412A032A452AA32210CDF000000040000 FDFC:0000028002800280028002A002A0224222021CA2000C00000000000000000000 FDFD:70A95FFF7000C5D5145515D5557D75C0C03B50295FFF7000758554957F9DC030 -FDFE:00007FFE618E6FB663B66FB66F8E7FFE7FFE61866FBE638E6FBE6F867FFE0000 -FDFF:00007FFE618E6FB663B66FB66F8E7FFE7FFE61866FBE638E6FBE6FBE7FFE0000 +FDFE:0040004013C04E0440AA4C0E44423B8C00000A0122555AFE828002F002400190 +FDFF:00002030004808400FFC0800100064000400040004C4242A47EE4402388C0000 FE00:AAAA00018000223DA2402239940408798000008181800281808003E180005555 FE01:AAAA00018000223DA2402239940408798000038180400181820003C180005555 FE02:AAAA00018000223DA24022399404087980000381804001818040038180005555 @@ -56627,8 +56625,8 @@ FE31:0000000000800080008000800080008000800080008000800080008000000000 FE32:0000000000000000008000800080008000800080008000800000000000000000 FE33:0000400040004000400040004000400040004000400040004000400040000000 FE34:2000400040002000100010002000400040002000100010002000400040002000 -FE35:0000000000000000000000000000000000000FF0100820044002000000000000 -FE36:0000000000004002200410080FF0000000000000000000000000000000000000 +FE35:0000000000000000000000000000000003C00C30100820044002000000000000 +FE36:0000000000004002200410080C3003C000000000000000000000000000000000 FE37:000000000000000000000000000000000000000001803E7C4002000000000000 FE38:00000000000040023E7C01800000000000000000000000000000000000000000 FE39:00000000000000000000000000000000000000001FF820044002000000000000 @@ -56831,106 +56829,106 @@ FEFD:00007FFE61866FBE638E6FBE6F867FFE7FFE618E6FB663B66FB66F8E7FFE0000 FEFE:00007FFE61866FBE638E6FBE6F867FFE7FFE61866FBE638E6FBE6F867FFE0000 FEFF:AAAA0001F4511458A55546D2F4510001F1DE4A10F19E4851F390000180005555 FF00:00007FFE61866FBE638E6FBE6FBE7FFE7FFE73CE6DB66DB66DB673CE7FFE0000 -FF01:0000000000000000018001800180018001800180018000000180018000000000 -FF02:000000000C300C300C300C300000000000000000000000000000000000000000 -FF03:0000000000000000030C030C030C3FFC0C300C303FFC30C030C030C000000000 -FF04:000000000000000001801FF8618661801F8001F8018661861FF8018000000000 -FF05:00000000000000001E06619861981E6001800180067819861986607800000000 -FF06:000000000000000007E018181818181807E01F866066601860781F8600000000 -FF07:0000000001800180018001800000000000000000000000000000000000000000 -FF08:000000000000003000C000C003000300030003000300030000C000C000300000 -FF09:0000000000000C000300030000C000C000C000C000C000C0030003000C000000 -FF0A:00000000000000000000000001806186199807E0199861860180000000000000 -FF0B:0000000000000000000000000180018001807FFE018001800180000000000000 -FF0C:00000000000000000000000000000000000000000000000003C000C000C00300 -FF0D:0000000000000000000000000000000000003FFC000000000000000000000000 -FF0E:00000000000000000000000000000000000000000000000003C003C000000000 -FF0F:0000000000000000000C000C003000C000C0030003000C003000300000000000 -FF10:000000000000000003C00C30300C303C30CC330C3C0C300C0C3003C000000000 -FF11:00000000000000000180078019800180018001800180018001801FF800000000 -FF12:00000000000000000FF0300C300C000C00F003000C00300030003FFC00000000 -FF13:00000000000000000FF0300C300C000C03F0000C000C300C300C0FF000000000 -FF14:0000000000000000003000F003300C30303030303FFC00300030003000000000 -FF15:00000000000000003FFC3000300030003FF0000C000C000C300C0FF000000000 -FF16:000000000000000003F00C00300030003FF0300C300C300C300C0FF000000000 -FF17:00000000000000003FFC000C000C00300030003000C000C000C000C000000000 -FF18:00000000000000000FF0300C300C300C0FF0300C300C300C300C0FF000000000 -FF19:00000000000000000FF0300C300C300C0FFC000C000C000C00300FC000000000 -FF1A:00000000000000000000000003C003C000000000000003C003C0000000000000 -FF1B:00000000000000000000000003C003C000000000000003C000C000C003000000 -FF1C:0000000000000000000000180060018006001800060001800060001800000000 -FF1D:00000000000000000000000000003FFC0000000000003FFC0000000000000000 -FF1E:0000000000000000000018000600018000600018006001800600180000000000 -FF1F:00000000000000000FF0300C300C000C003000C000C0000000C000C000000000 -FF20:000000000000000003F00C0C30CC333C330C330C330C30FC0C0003FC00000000 -FF21:000000000000000003C00C300C30300C300C3FFC300C300C300C300C00000000 -FF22:00000000000000003FF0300C300C300C3FF0300C300C300C300C3FF000000000 -FF23:00000000000000000FF0300C300C3000300030003000300C300C0FF000000000 -FF24:00000000000000003FC03030300C300C300C300C300C300C30303FC000000000 -FF25:00000000000000003FFC3000300030003FF030003000300030003FFC00000000 -FF26:00000000000000003FFC3000300030003FF03000300030003000300000000000 -FF27:00000000000000000FF0300C300C3000300030FC300C300C303C0FCC00000000 -FF28:0000000000000000300C300C300C300C3FFC300C300C300C300C300C00000000 -FF29:00000000000000001FF8018001800180018001800180018001801FF800000000 -FF2A:000000000000000007FE006000600060006000600060606060601F8000000000 -FF2B:0000000000000000300C303030C033003C003C00330030C03030300C00000000 -FF2C:00000000000000003000300030003000300030003000300030003FFC00000000 -FF2D:0000000000000000300C300C3C3C3C3C33CC33CC300C300C300C300C00000000 -FF2E:0000000000000000300C3C0C3C0C330C330C30CC30CC303C303C300C00000000 -FF2F:00000000000000000FF0300C300C300C300C300C300C300C300C0FF000000000 -FF30:00000000000000003FF0300C300C300C3FF03000300030003000300000000000 -FF31:00000000000000000FF0300C300C300C300C300C300C33CC3C3C0FF0000F0000 -FF32:00000000000000003FF0300C300C300C3FF030C030303030300C300C00000000 -FF33:00000000000000000FF0300C300C30000F0000F0000C300C300C0FF000000000 -FF34:00000000000000007FFE01800180018001800180018001800180018000000000 -FF35:0000000000000000300C300C300C300C300C300C300C300C300C0FF000000000 -FF36:0000000000000000600660066006181818181818066006600180018000000000 -FF37:0000000000000000300C300C300C300C33CC33CC3C3C3C3C300C300C00000000 -FF38:0000000000000000300C300C0C300C3003C003C00C300C30300C300C00000000 -FF39:0000000000000000600660061818181806600180018001800180018000000000 -FF3A:00000000000000003FFC000C000C003000C003000C00300030003FFC00000000 -FF3B:00000000000003F0030003000300030003000300030003000300030003F00000 -FF3C:0000000000000000300030000C000300030000C000C00030000C000C00000000 -FF3D:0000000000000FC000C000C000C000C000C000C000C000C000C000C00FC00000 -FF3E:0000000003C00C30300C00000000000000000000000000000000000000000000 -FF3F:000000000000000000000000000000000000000000000000000000007FFE0000 -FF40:0000060001800060000000000000000000000000000000000000000000000000 -FF41:0000000000000000000000000FF0300C000C0FFC300C300C303C0FCC00000000 -FF42:00000000000030003000300033F03C0C300C300C300C300C3C0C33F000000000 -FF43:0000000000000000000000000FF0300C3000300030003000300C0FF000000000 -FF44:000000000000000C000C000C0FCC303C300C300C300C300C303C0FCC00000000 -FF45:0000000000000000000000000FF0300C300C3FFC30003000300C0FF000000000 -FF46:00000000000000780180018001801FF801800180018001800180018000000000 -FF47:00000000000000000000000C0FCC3030303030300FC00C000FF0300C300C0FF0 -FF48:00000000000030003000300033F03C0C300C300C300C300C300C300C00000000 -FF49:00000000000001800180000007800180018001800180018001801FF800000000 -FF4A:00000000000000300030000000F0003000300030003000300030003030C00F00 -FF4B:000000000000300030003000303030C033003C00330030C03030300C00000000 -FF4C:00000000000007800180018001800180018001800180018001801FF800000000 -FF4D:0000000000000000000000007E78618661866186618661866186618600000000 -FF4E:00000000000000000000000033F03C0C300C300C300C300C300C300C00000000 -FF4F:0000000000000000000000000FF0300C300C300C300C300C300C0FF000000000 -FF50:00000000000000000000000033F03C0C300C300C300C300C3C0C33F030003000 -FF51:0000000000000000000000000FCC303C300C300C300C300C303C0FCC000C000C -FF52:00000000000000000000000033F03C0C300C3000300030003000300000000000 -FF53:0000000000000000000000000FF0300C30000F0000F0000C300C0FF000000000 -FF54:00000000000000000180018001801FF801800180018001800180007800000000 -FF55:000000000000000000000000300C300C300C300C300C300C303C0FCC00000000 -FF56:000000000000000000000000300C300C300C0C300C300C3003C003C000000000 -FF57:00000000000000000000000060066186618661866186618661861E7800000000 -FF58:000000000000000000000000300C300C0C3003C003C00C30300C300C00000000 -FF59:000000000000000000000000300C300C300C300C300C0C3C03CC000C000C0FF0 -FF5A:0000000000000000000000003FFC000C003000C003000C0030003FFC00000000 -FF5B:00000000000000F00300030000C000C003000C00030000C000C00300030000F0 -FF5C:0000000001800180018001800180018001800180018001800180018001800180 -FF5D:0000000000000F0000C000C00300030000C0003000C00300030000C000C00F00 -FF5E:0000000000001E06618660780000000000000000000000000000000000000000 -FF5F:0000000000000186061806181860186018601860186018600618061801860000 -FF60:0000000000006180186018600618061806180618061806181860186061800000 -FF61:00000000000000000000000030484830 +FF01:0000000002000700070007000700020002000200000000000200020000000000 +FF02:0000024002400240024002400000000000000000000000000000000000000000 +FF03:0000000000000220022002201FF804400440044004403FF00880088008800880 +FF04:000000000000010007C00920111011100D000380016011101110092007C00100 +FF05:0000000000000E041108111011200E4000800100027004880888108820700000 +FF06:0000000000000E001100110011000A0004380A10112020C020C011200E180000 +FF07:0000010001000100010001000000000000000000000000000000000000000000 +FF08:0000001000200040008000800100010001000100008000800040002000100000 +FF09:0000100008000400020002000100010001000100020002000400080010000000 +FF0A:0000000000000000010011100920054003800380054009201110010000000000 +FF0B:000000000000010001000100010001003FF80100010001000100010000000000 +FF0C:00000000000000000000000000000000000000000C000C000400040008000000 +FF0D:000000000000000000000000000000003FF80000000000000000000000000000 +FF0E:0000000000000000000000000000000000000000000000000C000C0000000000 +FF0F:0000000200040008001000200040008001000200040008001000200040000000 +FF10:000000000000038004400820086008A009200A200C2008200440038000000000 +FF11:00000000000001000300050009000100010001000100010001000FE000000000 +FF12:00000000000003C00420081008100020004001800200040008000FF000000000 +FF13:00000000000003C0042008100010002001C0002008100810042003C000000000 +FF14:000000000000004000C0014002400440084010401FF00040004000E000000000 +FF15:0000000000000FF00800080008000BC00C20001000100010082007C000000000 +FF16:00000000000003C004200800080013C01420181010100810042003C000000000 +FF17:0000000000000FF0082010400080008001000100010001000100010000000000 +FF18:00000000000003C0042008100810042003C0042008100810042003C000000000 +FF19:00000000000003C00420081008100810043003D000100810042003C000000000 +FF1A:0000000000000000000006000600000000000000060006000000000000000000 +FF1B:0000000000000000000006000600000000000000060006000200020004000000 +FF1C:00000000000800300040018002000C0010000C00020001800040003000080000 +FF1D:0000000000000000000000003FF80000000000003FF800000000000000000000 +FF1E:0000000010000C000200018000400030000800300040018002000C0010000000 +FF1F:0000000007C0082010100010002000C001000100000000000100010000000000 +FF20:00000000000003C00C30100821C422442444244424C8133010040C1803E00000 +FF21:00000000000001000100028002800440044008200FE010101010383800000000 +FF22:0000000000001FC008200810081008200FE008100808080808101FE000000000 +FF23:00000000000003E804180808100010001000100010000808041003E000000000 +FF24:0000000000001F800860081008080808080808080808081008601F8000000000 +FF25:0000000000001FF008100800080008200FE008200800080008101FF000000000 +FF26:0000000000001FF008100800080008400FC008400800080008001C0000000000 +FF27:00000000000003D00430081010001000107C101010100810043003D000000000 +FF28:0000000000001C3808100810081008100FF008100810081008101C3800000000 +FF29:00000000000007C001000100010001000100010001000100010007C000000000 +FF2A:00000000000000F8002000200020002000200020002008200840078000000000 +FF2B:0000000000001C700820084008800B000D0008800840082008101C3800000000 +FF2C:0000000000001C000800080008000800080008000800080008101FF000000000 +FF2D:000000000000300C181818281428144812481288110811081008381C00000000 +FF2E:00000000000018380C100C100A100910089008900850083008301C1000000000 +FF2F:00000000000003C004200810100810081008100810080810042003C000000000 +FF30:0000000000001FC008200810081008200FC008000800080008001C0000000000 +FF31:00000000000003C004200810100810081008100817080890046003E000180000 +FF32:0000000000001FC008200810081008200FC008800840082008101C3800000000 +FF33:00000000000003D0043008100400030000C00030080808080C100BE000000000 +FF34:0000000000003FF8210821080100010001000100010001000100038000000000 +FF35:0000000000001C3808100810081008100810081008100810042003C000000000 +FF36:0000000000003838101010100820082004400440028002800100010000000000 +FF37:000000000000711C21082108210812901290145014500C600820082000000000 +FF38:0000000000003838101008200440028001000280044008201010383800000000 +FF39:0000000000003838101008200440028001000100010001000100038000000000 +FF3A:0000000000001FF81010102000400080010002000400080810081FF800000000 +FF3B:000001F001000100010001000100010001000100010001000100010001F00000 +FF3C:0000400020001000080004000200010000800040002000100008000400020000 +FF3D:00001F000100010001000100010001000100010001000100010001001F000000 +FF3E:0000010006C01830000000000000000000000000000000000000000000000000 +FF3F:00000000000000000000000000000000000000000000000000000000FFFF0000 +FF40:0000020001000080004000000000000000000000000000000000000000000000 +FF41:00000000000000000000000003C00420042001E0062008200860079000000000 +FF42:00000000000018000800080009C00A200C100810081008100C201BC000000000 +FF43:00000000000000000000000003C004200810080008000800041003E000000000 +FF44:000000000000001800100010039004500830081008100810043003D800000000 +FF45:00000000000000000000000003C0042008100FF008000800041003E000000000 +FF46:00000000000003E00410040004001FC0040004000400040004000E0000000000 +FF47:00000000000000000000000003900460042004400380040007E00810081007E0 +FF48:00000000000018000800080009C00A200C1008100810081008101C3800000000 +FF49:000000000100010000000000030001000100010001000100010007C000000000 +FF4A:0000000000200020000000000060002000200020002000200020082008400780 +FF4B:0000000000001C00080008700840088009000B000C80084008201C7000000000 +FF4C:000000000000030001000100010001000100010001000100010007C000000000 +FF4D:00000000000000000000000036601990111011101110111011103BB800000000 +FF4E:00000000000000000000000019C00A200C2008200820082008201C7000000000 +FF4F:00000000000000000000000003C004200810081008100810042003C000000000 +FF50:0000000000000000000000000B800C4008200820082008200C400B8008001C00 +FF51:00000000000000000000000003A004600820082008200820046003A000200070 +FF52:00000000000000000000000019C00A200C2008000800080008001C0000000000 +FF53:00000000000000000000000007D008300800070000E000100C100BE000000000 +FF54:00000000000000000400040004001FE00400040004000420042003C000000000 +FF55:0000000000000000000000001C7008200820082008200820046003B000000000 +FF56:0000000000000000000000001C38081004200420024002400180018000000000 +FF57:0000000000000000000000003838111011100A900AA00AA00440044000000000 +FF58:0000000000000000000000000C300420024001800180024004200C3000000000 +FF59:0000000000000000000000001C70082004400440028002800100010001000E00 +FF5A:0000000000000000000000000FE00840008001000200040008200FE000000000 +FF5B:0000003000400080008000800080030000800080008000800080004000300000 +FF5C:0000010001000100010001000100010001000100010001000100010001000000 +FF5D:0000180004000200020002000200018002000200020002000200040018000000 +FF5E:00000000000000000000000000003E0041840078000000000000000000000000 +FF5F:0000000000880110022004400440088008800880088004400440022001100088 +FF60:0000000022001100088004400440022002200220022004400440088011002200 +FF61:00000000000000000000304848300000 FF62:3E202020202020202020200000000000 FF63:0000000000020202020202020202023E -FF64:00000000000000000000000000402010 +FF64:00000000000000000000403018080000 FF65:00000000000000181800000000000000 FF66:00007E0202027E020202040408106000 FF67:00000000007E02041408080810102000 @@ -57054,13 +57052,13 @@ FFDC:00000000000000000008080808080000 FFDD:00007FFE61866FBE638E6FBE6FBE7FFE7FFE638E6DB66DB66DB6638E7FFE0000 FFDE:00007FFE61866FBE638E6FBE6FBE7FFE7FFE63866DBE6D8E6DBE63867FFE0000 FFDF:00007FFE61866FBE638E6FBE6FBE7FFE7FFE63866DBE6D8E6DBE63BE7FFE0000 -FFE0:0000000000000000018001801FF861866180618061861FF80180018000000000 -FFE1:000000000000000001F80600060006007FE00600060006001FF8780600000000 -FFE2:00000000000000000000000000000000000000003FFC000C000C000C00000000 -FFE3:000000003FFC0000000000000000000000000000000000000000000000000000 -FFE4:0000000000000000018001800180018000000000018001800180018000000000 -FFE5:000000000000000060061818066001807FFE01807FFE01800180018000000000 -FFE6:00000000000000001818181818187FFE19987FFE1E781E781818181800000000 +FFE0:000000000000001003A00460085008900880090009000610022005C008000000 +FFE1:0000000000F0010802080208020002003FF001001D00230422C41C3800000000 +FFE2:000000000000000000000000000000003FF80008000800080008000000000000 +FFE3:00007FFE00000000000000000000000000000000000000000000000000000000 +FFE4:0000000000000100010001000100010000000000010001000100010001000000 +FFE5:000000003838101008203FF8044002803FF80100010001000100038000000000 +FFE6:00000000711C210821087FFC210812907FFC145014500C600820082000000000 FFE7:00007FFE61866FBE638E6FBE6FBE7FFE7FFE61866FF663EE6FDE61DE7FFE0000 FFE8:08080808080808080808080808080808 FFE9:000000000010207E2010000000000000 @@ -57082,5 +57080,5 @@ FFF8:00007FFE61866FBE638E6FBE6FBE7FFE7FFE61CE6FB663CE6FB66FCE7FFE0000 FFF9:AAAA000180003E118828083988443E4580000081814001C18220022180005555 FFFA:AAAA000180003E118828083988443E45800001E1820001C1802003C180005555 FFFB:AAAA000180003E118828083988443E45800003E1808000818080008180005555 -FFFC:5555800000018000000180001185A9442985A94411998000000180000001AAAA +FFFC:AAAA0001800000018000000191842945A9842945919800018000000180005555 FFFD:0000007E665A5A7A76767E76767E0000 From 938c974ccad07d90cd573a8590d8d7bd2adce680 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 20:23:58 -0700 Subject: [PATCH 086/431] testime: use a replacement character for characters not in the font --- test/testime.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/testime.c b/test/testime.c index f08cbd2835862..136725bba18c2 100644 --- a/test/testime.c +++ b/test/testime.c @@ -52,6 +52,7 @@ static TTF_Font *font; #else #define UNIFONT_MAX_CODEPOINT 0x1ffff #define UNIFONT_NUM_GLYPHS 0x20000 +#define UNIFONT_REPLACEMENT 0xFFFD /* Using 512x512 textures that are supported everywhere. */ #define UNIFONT_TEXTURE_WIDTH 512 #define UNIFONT_GLYPHS_IN_ROW (UNIFONT_TEXTURE_WIDTH / 16) @@ -228,8 +229,7 @@ static int unifont_init(const char *fontname) return 0; } -static void -unifont_make_rgba(const Uint8 *src, Uint8 *dst, Uint8 width) +static void unifont_make_rgba(const Uint8 *src, Uint8 *dst, Uint8 width) { int i, j; Uint8 *row = dst; @@ -313,12 +313,16 @@ static int unifont_load_texture(Uint32 textureID) static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_FRect *dst) { SDL_Texture *texture; - const Uint32 textureID = codepoint / UNIFONT_GLYPHS_IN_TEXTURE; + Uint32 textureID; SDL_FRect srcrect; srcrect.w = srcrect.h = 16.0f; - if (codepoint > UNIFONT_MAX_CODEPOINT) { - return 0; + + if (codepoint > UNIFONT_MAX_CODEPOINT || + unifontGlyph[codepoint].width == 0) { + codepoint = UNIFONT_REPLACEMENT; } + + textureID = codepoint / UNIFONT_GLYPHS_IN_TEXTURE; if (!unifontTextureLoaded[textureID]) { if (unifont_load_texture(textureID) < 0) { return 0; From 3d525331aa065a6436ae1498984d77cda87bc9d4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 08:32:28 -0700 Subject: [PATCH 087/431] testime: add a 1 pixel border around glyphs to avoid texture sampling into other glyphs --- test/testime.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/test/testime.c b/test/testime.c index 136725bba18c2..f72088d375d9b 100644 --- a/test/testime.c +++ b/test/testime.c @@ -55,7 +55,10 @@ static TTF_Font *font; #define UNIFONT_REPLACEMENT 0xFFFD /* Using 512x512 textures that are supported everywhere. */ #define UNIFONT_TEXTURE_WIDTH 512 -#define UNIFONT_GLYPHS_IN_ROW (UNIFONT_TEXTURE_WIDTH / 16) +#define UNIFONT_GLYPH_SIZE 16 +#define UNIFONT_GLYPH_BORDER 1 +#define UNIFONT_GLYPH_AREA (UNIFONT_GLYPH_BORDER + UNIFONT_GLYPH_SIZE + UNIFONT_GLYPH_BORDER) +#define UNIFONT_GLYPHS_IN_ROW (UNIFONT_TEXTURE_WIDTH / UNIFONT_GLYPH_AREA) #define UNIFONT_GLYPHS_IN_TEXTURE (UNIFONT_GLYPHS_IN_ROW * UNIFONT_GLYPHS_IN_ROW) #define UNIFONT_NUM_TEXTURES ((UNIFONT_NUM_GLYPHS + UNIFONT_GLYPHS_IN_TEXTURE - 1) / UNIFONT_GLYPHS_IN_TEXTURE) #define UNIFONT_TEXTURE_SIZE (UNIFONT_TEXTURE_WIDTH * UNIFONT_TEXTURE_WIDTH * 4) @@ -281,7 +284,7 @@ static int unifont_load_texture(Uint32 textureID) Uint32 codepoint = UNIFONT_GLYPHS_IN_TEXTURE * textureID + i; if (unifontGlyph[codepoint].width > 0) { const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; - const size_t offset = ((size_t)cInTex / UNIFONT_GLYPHS_IN_ROW) * UNIFONT_TEXTURE_PITCH * 16 + (cInTex % UNIFONT_GLYPHS_IN_ROW) * 16 * 4; + const size_t offset = ((size_t)cInTex / UNIFONT_GLYPHS_IN_ROW) * UNIFONT_TEXTURE_PITCH * UNIFONT_GLYPH_AREA + (cInTex % UNIFONT_GLYPHS_IN_ROW) * UNIFONT_GLYPH_AREA * 4; unifont_make_rgba(unifontGlyph[codepoint].data, textureRGBA + offset, unifontGlyph[codepoint].width); } } @@ -315,7 +318,7 @@ static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_FRect *ds SDL_Texture *texture; Uint32 textureID; SDL_FRect srcrect; - srcrect.w = srcrect.h = 16.0f; + srcrect.w = srcrect.h = (float)UNIFONT_GLYPH_SIZE; if (codepoint > UNIFONT_MAX_CODEPOINT || unifontGlyph[codepoint].width == 0) { @@ -331,8 +334,8 @@ static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_FRect *ds texture = unifontTexture[UNIFONT_NUM_TEXTURES * rendererID + textureID]; if (texture) { const Uint32 cInTex = codepoint % UNIFONT_GLYPHS_IN_TEXTURE; - srcrect.x = (float)(cInTex % UNIFONT_GLYPHS_IN_ROW * 16); - srcrect.y = (float)(cInTex / UNIFONT_GLYPHS_IN_ROW * 16); + srcrect.x = (float)(cInTex % UNIFONT_GLYPHS_IN_ROW * UNIFONT_GLYPH_AREA); + srcrect.y = (float)(cInTex / UNIFONT_GLYPHS_IN_ROW * UNIFONT_GLYPH_AREA); SDL_RenderTexture(state->renderers[rendererID], texture, &srcrect, dst); } return unifontGlyph[codepoint].width; @@ -492,9 +495,9 @@ static void _Redraw(int rendererID) SDL_FRect dstrect; dstrect.x = textRect.x; - dstrect.y = textRect.y + (textRect.h - 16 * UNIFONT_DRAW_SCALE) / 2; - dstrect.w = 16 * UNIFONT_DRAW_SCALE; - dstrect.h = 16 * UNIFONT_DRAW_SCALE; + dstrect.y = textRect.y + (textRect.h - UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE) / 2; + dstrect.w = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + dstrect.h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; drawnTextRect.y = dstrect.y; drawnTextRect.h = dstrect.h; @@ -564,9 +567,9 @@ static void _Redraw(int rendererID) SDL_FRect dstrect; dstrect.x = drawnTextRect.x; - dstrect.y = textRect.y + (textRect.h - 16 * UNIFONT_DRAW_SCALE) / 2; - dstrect.w = 16 * UNIFONT_DRAW_SCALE; - dstrect.h = 16 * UNIFONT_DRAW_SCALE; + dstrect.y = textRect.y + (textRect.h - UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE) / 2; + dstrect.w = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + dstrect.h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; drawnTextRect.y = dstrect.y; drawnTextRect.h = dstrect.h; From 50250adba7642c11e6aa0de1cc4eb36b590e3809 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 13:29:37 -0700 Subject: [PATCH 088/431] testime: draw a blinking cursor at the text insertion point --- test/testime.c | 67 ++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 29 deletions(-) diff --git a/test/testime.c b/test/testime.c index f72088d375d9b..e092af08d67a8 100644 --- a/test/testime.c +++ b/test/testime.c @@ -40,6 +40,8 @@ #endif #define MAX_TEXT_LENGTH 256 +#define CURSOR_BLINK_INTERVAL_MS 500 + static SDLTest_CommonState *state; static SDL_FRect textRect, markedRect; static SDL_Color lineColor = { 0, 0, 0, 255 }; @@ -47,6 +49,8 @@ static SDL_Color backColor = { 255, 255, 255, 255 }; static SDL_Color textColor = { 0, 0, 0, 255 }; static char text[MAX_TEXT_LENGTH], markedText[MAX_TEXT_LENGTH]; static int cursor = 0; +static SDL_bool cursor_visible; +static Uint64 last_cursor_change; #ifdef HAVE_SDL_TTF static TTF_Font *font; #else @@ -461,18 +465,20 @@ static void CleanupVideo(void) #endif } -static void _Redraw(int rendererID) +static void RedrawWindow(int rendererID) { SDL_Renderer *renderer = state->renderers[rendererID]; SDL_FRect drawnTextRect, cursorRect, underlineRect; - drawnTextRect.x = textRect.x; - drawnTextRect.y = 0; - drawnTextRect.w = 0; - drawnTextRect.h = 0; SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a); SDL_RenderFillRect(renderer, &textRect); + /* Initialize the drawn text rectangle for the cursor */ + drawnTextRect.x = textRect.x; + drawnTextRect.y = textRect.y + (textRect.h - UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE) / 2; + drawnTextRect.w = 0.0f; + drawnTextRect.h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + if (*text) { #ifdef HAVE_SDL_TTF SDL_Surface *textSur = TTF_RenderUTF8_Blended(font, text, textColor); @@ -510,6 +516,7 @@ static void _Redraw(int rendererID) #endif } + /* The marked text rectangle is the text area that hasn't been filled by committed text */ markedRect.x = textRect.x + drawnTextRect.w; markedRect.w = textRect.w - drawnTextRect.w; if (markedRect.w < 0) { @@ -520,16 +527,14 @@ static void _Redraw(int rendererID) SDL_StartTextInput(state->windows[0]); } - cursorRect = drawnTextRect; - cursorRect.x += cursorRect.w; - cursorRect.w = 2; - cursorRect.h = drawnTextRect.h; - + /* Update the drawn text rectangle for composition text, after the committed text */ drawnTextRect.x += drawnTextRect.w; drawnTextRect.w = 0; - SDL_SetRenderDrawColor(renderer, backColor.r, backColor.g, backColor.b, backColor.a); - SDL_RenderFillRect(renderer, &markedRect); + /* Set the cursor to the new location, we'll update it as we go, below */ + cursorRect = drawnTextRect; + cursorRect.w = 2; + cursorRect.h = drawnTextRect.h; if (markedText[0]) { #ifdef HAVE_SDL_TTF @@ -585,10 +590,8 @@ static void _Redraw(int rendererID) } #endif - if (cursor > 0) { - cursorRect.y = drawnTextRect.y; - cursorRect.h = drawnTextRect.h; - } + cursorRect.y = drawnTextRect.y; + cursorRect.h = drawnTextRect.h; underlineRect = markedRect; underlineRect.y = drawnTextRect.y + drawnTextRect.h - 2; @@ -599,16 +602,25 @@ static void _Redraw(int rendererID) SDL_RenderFillRect(renderer, &underlineRect); } - SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); - SDL_RenderFillRect(renderer, &cursorRect); + /* Draw the cursor */ + Uint64 now = SDL_GetTicks(); + if ((now - last_cursor_change) >= CURSOR_BLINK_INTERVAL_MS) { + cursor_visible = !cursor_visible; + last_cursor_change = now; + } + if (cursor_visible) { + SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); + SDL_RenderFillRect(renderer, &cursorRect); + } { SDL_Rect inputrect; - inputrect.x = (int)markedRect.x; - inputrect.y = (int)markedRect.y; - inputrect.w = (int)markedRect.w; - inputrect.h = (int)markedRect.h; + /* The input rect is a square at the cursor insertion point */ + inputrect.x = (int)cursorRect.x; + inputrect.y = (int)cursorRect.y; + inputrect.w = (int)cursorRect.h; + inputrect.h = (int)cursorRect.h; SDL_SetTextInputRect(state->windows[0], &inputrect); } } @@ -625,7 +637,7 @@ static void Redraw(void) SDL_RenderClear(renderer); /* Sending in the window id to let the font renderers know which one we're working with. */ - _Redraw(i); + RedrawWindow(i); SDL_RenderPresent(renderer); } @@ -697,7 +709,7 @@ int main(int argc, char *argv[]) SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); } - Redraw(); + /* Main render loop */ done = 0; while (!done) { @@ -709,7 +721,6 @@ int main(int argc, char *argv[]) switch (event.key.key) { case SDLK_RETURN: text[0] = 0x00; - Redraw(); break; case SDLK_BACKSPACE: /* Only delete text if not in editing mode. */ @@ -736,8 +747,6 @@ int main(int argc, char *argv[]) break; } } while (1); - - Redraw(); } break; default: @@ -771,7 +780,6 @@ int main(int argc, char *argv[]) /* After text inputted, we can clear up markedText because it */ /* is committed */ markedText[0] = 0; - Redraw(); break; case SDL_EVENT_TEXT_EDITING: @@ -780,13 +788,14 @@ int main(int argc, char *argv[]) SDL_strlcpy(markedText, event.edit.text, sizeof(markedText)); cursor = event.edit.start; - Redraw(); break; default: break; } } + + Redraw(); } SDL_free(fontname); CleanupVideo(); From dcd7b4e497286996490499e492a8ec436cc30b72 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 13:50:49 -0700 Subject: [PATCH 089/431] testime: highlight selected clauses in Japanese composition mode --- test/testime.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/test/testime.c b/test/testime.c index e092af08d67a8..d552d554eff40 100644 --- a/test/testime.c +++ b/test/testime.c @@ -49,8 +49,10 @@ static SDL_Color backColor = { 255, 255, 255, 255 }; static SDL_Color textColor = { 0, 0, 0, 255 }; static char text[MAX_TEXT_LENGTH], markedText[MAX_TEXT_LENGTH]; static int cursor = 0; +static int cursor_length = 0; static SDL_bool cursor_visible; static Uint64 last_cursor_change; +static SDL_BlendMode highlight_mode; #ifdef HAVE_SDL_TTF static TTF_Font *font; #else @@ -67,7 +69,7 @@ static TTF_Font *font; #define UNIFONT_NUM_TEXTURES ((UNIFONT_NUM_GLYPHS + UNIFONT_GLYPHS_IN_TEXTURE - 1) / UNIFONT_GLYPHS_IN_TEXTURE) #define UNIFONT_TEXTURE_SIZE (UNIFONT_TEXTURE_WIDTH * UNIFONT_TEXTURE_WIDTH * 4) #define UNIFONT_TEXTURE_PITCH (UNIFONT_TEXTURE_WIDTH * 4) -#define UNIFONT_DRAW_SCALE 2 +#define UNIFONT_DRAW_SCALE 2.0f static struct UnifontGlyph { Uint8 width; @@ -508,7 +510,7 @@ static void RedrawWindow(int rendererID) drawnTextRect.h = dstrect.h; while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) { - Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; + float advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; dstrect.x += advance; drawnTextRect.w += advance; utext += len; @@ -564,6 +566,11 @@ static void RedrawWindow(int rendererID) SDL_RenderTexture(renderer, texture, NULL, &drawnTextRect); SDL_DestroyTexture(texture); + + if (cursor_length > 0) { + /* FIXME: Need to measure text extents */ + cursorRect.w = cursor_length * UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + } #else int i = 0; char *utext = markedText; @@ -579,7 +586,7 @@ static void RedrawWindow(int rendererID) drawnTextRect.h = dstrect.h; while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) { - Sint32 advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; + float advance = unifont_draw_glyph(codepoint, rendererID, &dstrect) * UNIFONT_DRAW_SCALE; dstrect.x += advance; drawnTextRect.w += advance; if (i < cursor) { @@ -588,6 +595,10 @@ static void RedrawWindow(int rendererID) i++; utext += len; } + + if (cursor_length > 0) { + cursorRect.w = cursor_length * UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + } #endif cursorRect.y = drawnTextRect.y; @@ -608,7 +619,13 @@ static void RedrawWindow(int rendererID) cursor_visible = !cursor_visible; last_cursor_change = now; } - if (cursor_visible) { + if (cursor_length > 0) { + /* We'll show a highlight */ + SDL_SetRenderDrawBlendMode(renderer, highlight_mode); + SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); + SDL_RenderFillRect(renderer, &cursorRect); + SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); + } else if (cursor_visible) { SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); SDL_RenderFillRect(renderer, &cursorRect); } @@ -709,6 +726,12 @@ int main(int argc, char *argv[]) SDL_SetRenderDrawColor(renderer, 0xA0, 0xA0, 0xA0, 0xFF); SDL_RenderClear(renderer); } + highlight_mode = SDL_ComposeCustomBlendMode(SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR, + SDL_BLENDFACTOR_ZERO, + SDL_BLENDOPERATION_ADD, + SDL_BLENDFACTOR_ZERO, + SDL_BLENDFACTOR_ONE, + SDL_BLENDOPERATION_ADD); /* Main render loop */ done = 0; @@ -788,6 +811,7 @@ int main(int argc, char *argv[]) SDL_strlcpy(markedText, event.edit.text, sizeof(markedText)); cursor = event.edit.start; + cursor_length = event.edit.length; break; default: From 8165e96514d4b065d8cce081f59c9f9d6dd5ce4e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 18:35:12 -0700 Subject: [PATCH 090/431] Fixed whitespace --- test/testffmpeg_vulkan.c | 24 +++++++++++----------- test/testpen.c | 44 ++++++++++++++++++++-------------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c index 5ffaf589f91cf..36d69dd61f21e 100644 --- a/test/testffmpeg_vulkan.c +++ b/test/testffmpeg_vulkan.c @@ -91,11 +91,11 @@ struct VulkanVideoContext VulkanDeviceFeatures features; - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; #define VULKAN_GLOBAL_FUNCTION(name) PFN_##name name; #define VULKAN_INSTANCE_FUNCTION(name) PFN_##name name; #define VULKAN_DEVICE_FUNCTION(name) PFN_##name name; - VULKAN_FUNCTIONS() + VULKAN_FUNCTIONS() #undef VULKAN_GLOBAL_FUNCTION #undef VULKAN_INSTANCE_FUNCTION #undef VULKAN_DEVICE_FUNCTION @@ -440,7 +440,7 @@ static int findPhysicalDevice(VulkanVideoContext *context) if (!context->physicalDevice) { return SDL_SetError("Vulkan: no viable physical devices found"); } - return 0; + return 0; } static void initDeviceFeatures(VulkanDeviceFeatures *features) @@ -649,24 +649,24 @@ static int createDevice(VulkanVideoContext *context) if (result != VK_SUCCESS) { return -1; } - return 0; + return 0; } VulkanVideoContext *CreateVulkanVideoContext(SDL_Window *window) { - VulkanVideoContext *context = SDL_calloc(1, sizeof(*context)); - if (!context) { - return NULL; - } + VulkanVideoContext *context = SDL_calloc(1, sizeof(*context)); + if (!context) { + return NULL; + } if (loadGlobalFunctions(context) < 0 || createInstance(context) < 0 || createSurface(context, window) < 0 || findPhysicalDevice(context) < 0 || createDevice(context) < 0) { - DestroyVulkanVideoContext(context); - return NULL; - } - return context; + DestroyVulkanVideoContext(context); + return NULL; + } + return context; } void SetupVulkanRenderProperties(VulkanVideoContext *context, SDL_PropertiesID props) diff --git a/test/testpen.c b/test/testpen.c index 5804ebd6ed120..94c676606582f 100644 --- a/test/testpen.c +++ b/test/testpen.c @@ -75,32 +75,32 @@ static void DrawScreen(SDL_Renderer *renderer) SDL_SetRenderDrawColor(renderer, 0xa0, 0xa0, 0xa0, 0xff); if (last_touching) { - SDL_FRect rect; + SDL_FRect rect; rect.x = 0; rect.y = 0; rect.w = 2.0f * X - 1.0f; rect.h = 2.0f * Y - 1.0f; - SDL_RenderRect(renderer, &rect); + SDL_RenderRect(renderer, &rect); } else { - /* Show where the pen is rotating when it isn't touching the surface. - Otherwise we draw the rotation angle below together with pressure information. */ - float rot_vecx = SDL_sinf(last_rotation / 180.0f * SDL_PI_F); - float rot_vecy = -SDL_cosf(last_rotation / 180.0f * SDL_PI_F); - float px = X + rot_vecx * 100.0f; - float py = Y + rot_vecy * 100.0f; - float px2 = X + rot_vecx * 80.0f; - float py2 = Y + rot_vecy * 80.0f; - - SDL_RenderLine(renderer, - px, py, - px2 + rot_vecy * 20.0f, - py2 - rot_vecx * 20.0f); - SDL_RenderLine(renderer, - px, py, - px2 - rot_vecy * 20.0f, - py2 + rot_vecx * 20.0f); + /* Show where the pen is rotating when it isn't touching the surface. + Otherwise we draw the rotation angle below together with pressure information. */ + float rot_vecx = SDL_sinf(last_rotation / 180.0f * SDL_PI_F); + float rot_vecy = -SDL_cosf(last_rotation / 180.0f * SDL_PI_F); + float px = X + rot_vecx * 100.0f; + float py = Y + rot_vecy * 100.0f; + float px2 = X + rot_vecx * 80.0f; + float py2 = Y + rot_vecy * 80.0f; + + SDL_RenderLine(renderer, + px, py, + px2 + rot_vecy * 20.0f, + py2 - rot_vecx * 20.0f); + SDL_RenderLine(renderer, + px, py, + px2 - rot_vecy * 20.0f, + py2 + rot_vecx * 20.0f); } if (last_was_eraser) { @@ -359,7 +359,7 @@ static void process_event(SDL_Event event) SDL_HideCursor(); last_x = ev->x; last_y = ev->y; - update_axes(ev->axes); + update_axes(ev->axes); last_was_eraser = ev->pen_state & SDL_PEN_ERASER_MASK; #if VERBOSE SDL_Log("[%lu] pen motion: %s %u at (%.4f, %.4f); pressure=%.3f, tilt=%.3f/%.3f, dist=%.3f [buttons=%02x]\n", @@ -375,7 +375,7 @@ static void process_event(SDL_Event event) SDL_PenTipEvent *ev = &event.ptip; last_x = ev->x; last_y = ev->y; - update_axes(ev->axes); + update_axes(ev->axes); last_was_eraser = ev->tip == SDL_PEN_TIP_ERASER; last_button = ev->pen_state & 0xf; /* button mask */ last_touching = (event.type == SDL_EVENT_PEN_DOWN); @@ -389,7 +389,7 @@ static void process_event(SDL_Event event) SDL_HideCursor(); last_x = ev->x; last_y = ev->y; - update_axes(ev->axes); + update_axes(ev->axes); if (last_pressure > 0.0f && !last_touching) { SDL_LogWarn(SDL_LOG_CATEGORY_TEST, "[%lu] : reported pressure %.5f even though pen is not touching surface", From d8e68aea9ded7aff09f9e47857e1c3701cbcc099 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 Jun 2024 01:43:25 -0400 Subject: [PATCH 091/431] atomic: Solaris needs the `_nv` variant of `atomic_or_uint`. (This means "new value" and returns the atomically updated value. Before, we were returning a value from a void function.) (cherry picked from commit 498cbffd89105efbcdb5b79fa1478cdf91fbc351) --- src/atomic/SDL_atomic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c index e350c15b1ee85..ea26f17ae9031 100644 --- a/src/atomic/SDL_atomic.c +++ b/src/atomic/SDL_atomic.c @@ -257,7 +257,7 @@ int SDL_AtomicGet(SDL_AtomicInt *a) #elif defined(SDL_PLATFORM_MACOS) /* this is deprecated in 10.12 sdk; favor gcc atomics. */ return sizeof(a->value) == sizeof(uint32_t) ? OSAtomicOr32Barrier(0, (volatile uint32_t *)&a->value) : OSAtomicAdd64Barrier(0, (volatile int64_t *)&a->value); #elif defined(SDL_PLATFORM_SOLARIS) - return atomic_or_uint((volatile uint_t *)&a->value, 0); + return atomic_or_uint_nv((volatile uint_t *)&a->value, 0); #else int value; do { From d7ee9ce455e7df2b562fe1ac7245d60dab1aaf18 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 28 Jun 2024 00:14:26 -0400 Subject: [PATCH 092/431] SDL_endian.h: Fix byte order detection on Solaris (and some SPARC compilers). Fixes #10093. (Sort of cherry-picked from 14183f8ecac099982883331ae7e405f82e42aa6b.) --- include/SDL3/SDL_endian.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_endian.h b/include/SDL3/SDL_endian.h index 2f9583e20c22f..cb3d7f34e4f35 100644 --- a/include/SDL3/SDL_endian.h +++ b/include/SDL3/SDL_endian.h @@ -59,6 +59,15 @@ _m_prefetch(void *__P) #ifdef SDL_PLATFORM_LINUX #include #define SDL_BYTEORDER __BYTE_ORDER +#elif defined(SDL_PLATFORM_SOLARIS) +#include +#if defined(_LITTLE_ENDIAN) +#define SDL_BYTEORDER SDL_LIL_ENDIAN +#elif defined(_BIG_ENDIAN) +#define SDL_BYTEORDER SDL_BIG_ENDIAN +#else +#error Unsupported endianness +#endif #elif defined(SDL_PLATFORM_OPENBSD) || defined(__DragonFly__) #include #define SDL_BYTEORDER BYTE_ORDER @@ -79,7 +88,7 @@ _m_prefetch(void *__P) defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \ (defined(__MIPS__) && defined(__MIPSEB__)) || \ defined(__ppc__) || defined(__POWERPC__) || defined(__powerpc__) || defined(__PPC__) || \ - defined(__sparc__) + defined(__sparc__) || defined(__sparc) #define SDL_BYTEORDER SDL_BIG_ENDIAN #else #define SDL_BYTEORDER SDL_LIL_ENDIAN From ecfa363889e03b905e9a5428615587d53327a996 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 Jun 2024 20:38:45 -0400 Subject: [PATCH 093/431] begin_code: Solaris Studio has `__has_attribute` defined by isn't usable here. Fixes #10095. (cherry picked from commit d96f1d5360be6dd5f57c3f100deb80c7f39da2a5) --- include/SDL3/SDL_begin_code.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_begin_code.h b/include/SDL3/SDL_begin_code.h index e577029073946..f418c6109d855 100644 --- a/include/SDL3/SDL_begin_code.h +++ b/include/SDL3/SDL_begin_code.h @@ -165,7 +165,7 @@ (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202000L) #define SDL_FALLTHROUGH [[fallthrough]] #else -#ifdef __has_attribute +#if defined(__has_attribute) && !defined(__SUNPRO_C) && !defined(__SUNPRO_CC) #define SDL_HAS_FALLTHROUGH __has_attribute(__fallthrough__) #else #define SDL_HAS_FALLTHROUGH 0 From 87439c00083fd0069835e8ca2e65a44f9e449218 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 27 Jun 2024 01:53:15 -0400 Subject: [PATCH 094/431] x11: Fix build when `X_HAVE_UTF8_STRING` is not defined. Fixes #10094. (cherry picked from commit 3e4bb5acd019ecdbf6d4a0ef74a6af1e77e24516) --- src/video/x11/SDL_x11messagebox.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c index d8babc7ec4e49..957e38612c08a 100644 --- a/src/video/x11/SDL_x11messagebox.c +++ b/src/video/x11/SDL_x11messagebox.c @@ -124,12 +124,15 @@ static SDL_INLINE int IntMax(int a, int b) /* Return width and height for a string. */ static void GetTextWidthHeight(SDL_MessageBoxDataX11 *data, const char *str, int nbytes, int *pwidth, int *pheight) { +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { XRectangle overall_ink, overall_logical; X11_Xutf8TextExtents(data->font_set, str, nbytes, &overall_ink, &overall_logical); *pwidth = overall_logical.width; *pheight = overall_logical.height; - } else { + } else +#endif + { XCharStruct text_structure; int font_direction, font_ascent, font_descent; X11_XTextExtents(data->font_struct, str, nbytes, @@ -185,6 +188,7 @@ static int X11_MessageBoxInit(SDL_MessageBoxDataX11 *data, const SDL_MessageBoxD return SDL_SetError("Couldn't open X11 display"); } +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { char **missing = NULL; int num_missing = 0; @@ -196,7 +200,9 @@ static int X11_MessageBoxInit(SDL_MessageBoxDataX11 *data, const SDL_MessageBoxD if (!data->font_set) { return SDL_SetError("Couldn't load font %s", g_MessageBoxFont); } - } else { + } else +#endif + { data->font_struct = X11_XLoadQueryFont(data->display, g_MessageBoxFontLatin1); if (!data->font_struct) { return SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1); @@ -534,11 +540,14 @@ static void X11_MessageBoxDraw(SDL_MessageBoxDataX11 *data, GC ctx) for (i = 0; i < data->numlines; i++) { TextLineData *plinedata = &data->linedata[i]; +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { X11_Xutf8DrawString(display, window, data->font_set, ctx, data->xtext, data->ytext + i * data->text_height, plinedata->text, plinedata->length); - } else { + } else +#endif + { X11_XDrawString(display, window, ctx, data->xtext, data->ytext + i * data->text_height, plinedata->text, plinedata->length); @@ -563,12 +572,15 @@ static void X11_MessageBoxDraw(SDL_MessageBoxDataX11 *data, GC ctx) X11_XSetForeground(display, ctx, (data->mouse_over_index == i) ? data->color[SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED] : data->color[SDL_MESSAGEBOX_COLOR_TEXT]); +#ifdef X_HAVE_UTF8_STRING if (SDL_X11_HAVE_UTF8) { X11_Xutf8DrawString(display, window, data->font_set, ctx, buttondatax11->x + offset, buttondatax11->y + offset, buttondata->text, buttondatax11->length); - } else { + } else +#endif + { X11_XDrawString(display, window, ctx, buttondatax11->x + offset, buttondatax11->y + offset, buttondata->text, buttondatax11->length); @@ -602,12 +614,17 @@ static int X11_MessageBoxLoop(SDL_MessageBoxDataX11 *data) SDL_bool has_focus = SDL_TRUE; KeySym last_key_pressed = XK_VoidSymbol; unsigned long gcflags = GCForeground | GCBackground; +#ifdef X_HAVE_UTF8_STRING + const int have_utf8 = SDL_X11_HAVE_UTF8; +#else + const int have_utf8 = 0; +#endif SDL_zero(ctx_vals); ctx_vals.foreground = data->color[SDL_MESSAGEBOX_COLOR_BACKGROUND]; ctx_vals.background = data->color[SDL_MESSAGEBOX_COLOR_BACKGROUND]; - if (!SDL_X11_HAVE_UTF8) { + if (!have_utf8) { gcflags |= GCFont; ctx_vals.font = data->font_struct->fid; } From 915ef287530b91479f1d9587a9f5be442ddb5f94 Mon Sep 17 00:00:00 2001 From: hwsmm Date: Sat, 29 Jun 2024 00:03:43 +0900 Subject: [PATCH 095/431] Fix mouse button not changing in pen mouse emulation --- src/events/SDL_pen.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/events/SDL_pen.c b/src/events/SDL_pen.c index de143a609ce16..5feef99c62bcb 100644 --- a/src/events/SDL_pen.c +++ b/src/events/SDL_pen.c @@ -630,6 +630,11 @@ int SDL_SendPenTipEvent(Uint64 timestamp, SDL_PenID instance_id, Uint8 state) if (mouse_button == 0) { mouse_button = SDL_BUTTON_LEFT; /* No current button? Instead report left mouse button */ } + /* A button may get released while drawing, but SDL_SendPenButton doesn't reset last_mouse_button + while touching the surface, so release and reset last_mouse_button on pen tip release */ + if (pen->last.buttons == 0 && state == SDL_RELEASED) { + pen->last_mouse_button = 0; + } } switch (pen_mouse_emulation_mode) { From 339d83bdfa5fe3870f55213d2e460c56409801ca Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 28 Jun 2024 18:28:31 +0200 Subject: [PATCH 096/431] ci: assume all .dmp files in build directy are minidump files --- .github/workflows/main.yml | 2 +- .github/workflows/msvc.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e620718c1d325..385b59ef8843b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -178,7 +178,7 @@ jobs: with: if-no-files-found: ignore name: '${{ matrix.platform.artifact }}-minidumps' - path: build/minidumps/* + path: build/**/*.dmp - uses: actions/upload-artifact@v4 if: ${{ always() && matrix.platform.artifact != '' && steps.build.outcome == 'success' }} with: diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 6cde63bff64dc..0ce24788928ec 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -98,7 +98,7 @@ jobs: with: if-no-files-found: ignore name: '${{ matrix.platform.artifact }}-minidumps' - path: build/minidumps/* + path: build/**/*.dmp - uses: actions/upload-artifact@v4 if: ${{ always() && steps.build.outcome == 'success' }} with: From 44ec57626fe82dc5f4671792a7de2fdcf577ed73 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 28 Jun 2024 13:53:37 -0400 Subject: [PATCH 097/431] vulkan: Don't set the opaque bit on transparent windows If window transparency was requested via the SDL_WINDOW_TRANSPARENT flag, don't set the opaque bit on the swapchain composite alpha value. Fixes transparent windows when using the Vulkan renderer (e.g. testsprite --transparent). --- src/render/vulkan/SDL_render_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index a7dba54ab7230..0454e80ad99de 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -2150,7 +2150,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h) swapchainCreateInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT; swapchainCreateInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; swapchainCreateInfo.preTransform = rendererData->surfaceCapabilities.currentTransform; - swapchainCreateInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; + swapchainCreateInfo.compositeAlpha = (renderer->window->flags & SDL_WINDOW_TRANSPARENT) ? 0 : VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; swapchainCreateInfo.presentMode = presentMode; swapchainCreateInfo.clipped = VK_TRUE; swapchainCreateInfo.oldSwapchain = rendererData->swapchain; From c983c1da9776b7f536fb6391a3dc9d40d79c166c Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 28 Jun 2024 22:35:57 +0000 Subject: [PATCH 098/431] Sync SDL3 wiki -> header --- docs/README-migration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 9512b2592c8cb..63399f7dc9c5b 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -759,7 +759,7 @@ The following hints have been removed: * SDL_HINT_IDLE_TIMER_DISABLED - use SDL_DisableScreenSaver() instead * SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text * SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer -* SDL_HINT_PS2_DYNAMIC_VSYNC - use SDL_SetRendererVSync(renderer, -1) instead +* SDL_HINT_PS2_DYNAMIC_VSYNC - use SDL_SetRenderVSync(renderer, -1) instead * SDL_HINT_RENDER_BATCHING - Render batching is always enabled, apps should call SDL_FlushRenderer() before calling into a lower-level graphics API. * SDL_HINT_RENDER_LOGICAL_SIZE_MODE - the logical size mode is explicitly set with SDL_SetRenderLogicalPresentation() * SDL_HINT_RENDER_OPENGL_SHADERS - shaders are always used if they are available From ed2022a175258ef06205b9da00f3f064d81fa1ec Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 26 Jun 2024 10:19:00 -0700 Subject: [PATCH 099/431] Added SDL_EVENT_TEXT_EDITING_CANDIDATES This allows applications that have set SDL_HINT_IME_SHOW_UI to "0" to get candidates lists they can draw themselves. Fixes https://github.com/libsdl-org/SDL/issues/4855 --- include/SDL3/SDL_events.h | 33 +- src/events/SDL_events.c | 6 + src/events/SDL_keyboard.c | 41 +++ src/events/SDL_keyboard_c.h | 3 + src/video/windows/SDL_windowskeyboard.c | 461 +++--------------------- src/video/windows/SDL_windowsvideo.h | 13 +- test/testime.c | 218 ++++++++++- 7 files changed, 338 insertions(+), 437 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 6e30acc48e258..d3e84af0fa362 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -163,6 +163,7 @@ typedef enum SDL_EventType input language or keyboard layout change. */ SDL_EVENT_KEYBOARD_ADDED, /**< A new keyboard has been inserted into the system */ SDL_EVENT_KEYBOARD_REMOVED, /**< A keyboard has been removed */ + SDL_EVENT_TEXT_EDITING_CANDIDATES, /**< Keyboard text editing candidates */ /* Mouse events */ SDL_EVENT_MOUSE_MOTION = 0x400, /**< Mouse moved */ @@ -344,15 +345,34 @@ typedef struct SDL_KeyboardEvent */ typedef struct SDL_TextEditingEvent { - SDL_EventType type; /**< SDL_EVENT_TEXT_EDITING */ + SDL_EventType type; /**< SDL_EVENT_TEXT_EDITING */ Uint32 reserved; - Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_WindowID windowID; /**< The window with keyboard focus, if any */ - const char *text; /**< The editing text */ - Sint32 start; /**< The start cursor of selected editing text, or -1 if not set */ - Sint32 length; /**< The length of selected editing text, or -1 if not set */ + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with keyboard focus, if any */ + const char *text; /**< The editing text */ + Sint32 start; /**< The start cursor of selected editing text, or -1 if not set */ + Sint32 length; /**< The length of selected editing text, or -1 if not set */ } SDL_TextEditingEvent; +/** + * Keyboard IME candidates event structure (event.edit_candidates.*) + * + * The candidates follow the SDL_GetStringRule. + * + * \since This struct is available since SDL 3.0.0. + */ +typedef struct SDL_TextEditingCandidatesEvent +{ + SDL_EventType type; /**< SDL_EVENT_TEXT_EDITING_CANDIDATES */ + Uint32 reserved; + Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ + SDL_WindowID windowID; /**< The window with keyboard focus, if any */ + const char * const *candidates; /**< The list of candidates, or NULL if there are no candidates available */ + Sint32 num_candidates; /**< The number of strings in `candidates` */ + Sint32 selected_candidate; /**< The index of the selected candidate, or -1 if no candidate is selected */ + SDL_bool horizontal; /**< SDL_TRUE if the list is horizontal, SDL_FALSE if it's vertical */ +} SDL_TextEditingCandidatesEvent; + /** * Keyboard text input event structure (event.text.*) * @@ -846,6 +866,7 @@ typedef union SDL_Event SDL_KeyboardDeviceEvent kdevice; /**< Keyboard device change event data */ SDL_KeyboardEvent key; /**< Keyboard event data */ SDL_TextEditingEvent edit; /**< Text editing event data */ + SDL_TextEditingCandidatesEvent edit_candidates; /**< Text editing candidates event data */ SDL_TextInputEvent text; /**< Text input event data */ SDL_MouseDeviceEvent mdevice; /**< Mouse device change event data */ SDL_MouseMotionEvent motion; /**< Mouse motion event data */ diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 9b28b87a8d633..6df6b9cd3badd 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -360,6 +360,12 @@ static void SDL_LogEvent(const SDL_Event *event) event->edit.text, (int)event->edit.start, (int)event->edit.length); break; + SDL_EVENT_CASE(SDL_EVENT_TEXT_EDITING_CANDIDATES) + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u num_candidates=%d selected_candidate=%d)", + (uint)event->edit_candidates.timestamp, (uint)event->edit_candidates.windowID, + (int)event->edit_candidates.num_candidates, (int)event->edit_candidates.selected_candidate); + break; + SDL_EVENT_CASE(SDL_EVENT_TEXT_INPUT) (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u text='%s')", (uint)event->text.timestamp, (uint)event->text.windowID, event->text.text); break; diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 21e581dcfde3c..c7f815aa384ab 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -659,6 +659,47 @@ int SDL_SendEditingText(const char *text, int start, int length) return posted; } +int SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int selected_candidate, SDL_bool horizontal) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + int posted; + + if (!SDL_TextInputActive(keyboard->focus)) { + return 0; + } + + /* Post the event, if desired */ + posted = 0; + if (SDL_EventEnabled(SDL_EVENT_TEXT_EDITING_CANDIDATES)) { + SDL_Event event; + + event.type = SDL_EVENT_TEXT_EDITING_CANDIDATES; + event.common.timestamp = 0; + event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; + if (num_candidates > 0) { + const char **event_candidates = (const char **)SDL_AllocateEventMemory((num_candidates + 1) * sizeof(*event_candidates)); + if (!event_candidates) { + return 0; + } + for (int i = 0; i < num_candidates; ++i) { + event_candidates[i] = SDL_AllocateEventString(candidates[i]); + } + event_candidates[num_candidates] = NULL; + event.edit_candidates.candidates = event_candidates; + event.edit_candidates.num_candidates = num_candidates; + event.edit_candidates.selected_candidate = selected_candidate; + event.edit_candidates.horizontal = horizontal; + } else { + event.edit_candidates.candidates = NULL; + event.edit_candidates.num_candidates = 0; + event.edit_candidates.selected_candidate = -1; + event.edit_candidates.horizontal = SDL_FALSE; + } + posted = (SDL_PushEvent(&event) > 0); + } + return posted; +} + void SDL_QuitKeyboard(void) { for (int i = SDL_keyboard_count; i--;) { diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index df43168329f4f..d305641f78b45 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -78,6 +78,9 @@ extern int SDL_SendKeyboardText(const char *text); /* Send editing text for selected range from start to end */ extern int SDL_SendEditingText(const char *text, int start, int length); +/* Send editing text candidates, which will be copied into the event */ +int SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int selected_candidate, SDL_bool horizontal); + /* Shutdown the keyboard subsystem */ extern void SDL_QuitKeyboard(void); diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 78a7b437e29da..80c8d51bb9bea 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -56,9 +56,9 @@ void WIN_InitKeyboard(SDL_VideoDevice *_this) #ifndef SDL_DISABLE_WINDOWS_IME SDL_VideoData *data = _this->driverdata; + data->ime_candlistindexbase = 1; data->ime_composition_length = 32 * sizeof(WCHAR); data->ime_composition = (WCHAR *)SDL_calloc(data->ime_composition_length, sizeof(WCHAR)); - data->ime_candvertical = SDL_TRUE; data->ime_uielemsinkcookie = TF_INVALID_COOKIE; data->ime_alpnsinkcookie = TF_INVALID_COOKIE; data->ime_openmodesinkcookie = TF_INVALID_COOKIE; @@ -208,7 +208,6 @@ int WIN_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) #ifndef SDL_DISABLE_WINDOWS_IME HWND hwnd = window->driverdata->hwnd; SDL_VideoData *videodata = _this->driverdata; - SDL_GetWindowSize(window, &videodata->ime_winwidth, &videodata->ime_winheight); IME_Init(videodata, hwnd); IME_Enable(videodata, hwnd); @@ -255,10 +254,6 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S return SDL_FALSE; } -void IME_Present(SDL_VideoData *videodata) -{ -} - #else #ifdef SDL_msctf_h_ @@ -317,14 +312,12 @@ DEFINE_GUID(IID_ITfThreadMgrEx, 0x3E90ADE3, 0x7594, 0x4CB0, 0xBB, 0x58, 0x69, 0x #define SUBLANG() SUBLANGID(LANG()) static void IME_UpdateInputLocale(SDL_VideoData *videodata); -static int IME_ShowCandidateList(SDL_VideoData *videodata); static void IME_ClearComposition(SDL_VideoData *videodata); static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd); static void IME_SetupAPI(SDL_VideoData *videodata); static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex); static void IME_SendEditingEvent(SDL_VideoData *videodata); static void IME_SendClearComposition(SDL_VideoData *videodata); -static void IME_DestroyTextures(SDL_VideoData *videodata); static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata); static void UILess_ReleaseSinks(SDL_VideoData *videodata); @@ -447,7 +440,10 @@ static void IME_Quit(SDL_VideoData *videodata) WIN_CoUninitialize(); videodata->ime_com_initialized = SDL_FALSE; } - IME_DestroyTextures(videodata); + for (int i = 0; i < videodata->ime_candcount; ++i) { + SDL_free(videodata->ime_candidates[i]); + videodata->ime_candidates[i] = NULL; + } videodata->ime_initialized = SDL_FALSE; } @@ -739,7 +735,7 @@ static void IME_UpdateInputLocale(SDL_VideoData *videodata) } videodata->ime_hkl = hklnext; - videodata->ime_candvertical = (PRIMLANG() != LANG_KOREAN && LANG() != LANG_CHS); + videodata->ime_horizontal_candidates = (PRIMLANG() == LANG_KOREAN || LANG() == LANG_CHS); } static void IME_ClearComposition(SDL_VideoData *videodata) @@ -906,112 +902,47 @@ static void IME_SendClearComposition(SDL_VideoData *videodata) } } +static int IME_OpenCandidateList(SDL_VideoData *videodata) +{ + videodata->ime_candidates_open = SDL_TRUE; + videodata->ime_candcount = 0; + return 0; +} + + static void IME_AddCandidate(SDL_VideoData *videodata, UINT i, LPCWSTR candidate) { - LPWSTR dst = &videodata->ime_candidates[i * MAX_CANDLENGTH]; - LPWSTR end = &dst[MAX_CANDLENGTH - 1]; - SDL_COMPILE_TIME_ASSERT(IME_CANDIDATE_INDEXING_REQUIRES, MAX_CANDLIST == 10); - *dst++ = (WCHAR)(TEXT('0') + ((i + videodata->ime_candlistindexbase) % 10)); - if (videodata->ime_candvertical) { - *dst++ = TEXT(' '); + if (videodata->ime_candidates[i]) { + SDL_free(videodata->ime_candidates[i]); + videodata->ime_candidates[i] = NULL; } - while (*candidate && dst < end) { - *dst++ = *candidate++; - } + SDL_COMPILE_TIME_ASSERT(IME_CANDIDATE_INDEXING_REQUIRES, MAX_CANDLIST == 10); + char *candidate_utf8 = WIN_StringToUTF8W(candidate); + SDL_asprintf(&videodata->ime_candidates[i], "%d %s", ((i + videodata->ime_candlistindexbase) % 10), candidate_utf8); + SDL_free(candidate_utf8); - *dst = (WCHAR)'\0'; + videodata->ime_candcount = (i + 1); } -static void IME_GetCandidateList(HWND hwnd, SDL_VideoData *videodata) +static void IME_SendCandidateList(SDL_VideoData *videodata) { - HIMC himc; - DWORD size; - LPCANDIDATELIST cand_list; - - if (IME_ShowCandidateList(videodata) < 0) { - return; - } - himc = ImmGetContext(hwnd); - if (!himc) { - return; - } - size = ImmGetCandidateListW(himc, 0, 0, 0); - if (size != 0) { - cand_list = (LPCANDIDATELIST)SDL_malloc(size); - if (cand_list != NULL) { - size = ImmGetCandidateListW(himc, 0, cand_list, size); - if (size != 0) { - UINT i, j; - UINT page_start = 0; - videodata->ime_candsel = cand_list->dwSelection; - videodata->ime_candcount = cand_list->dwCount; - - if (LANG() == LANG_CHS && IME_GetId(videodata, 0)) { - const UINT maxcandchar = 18; - size_t cchars = 0; - - for (i = 0; i < videodata->ime_candcount; ++i) { - size_t len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1; - if (len + cchars > maxcandchar) { - if (i > cand_list->dwSelection) { - break; - } - - page_start = i; - cchars = len; - } else { - cchars += len; - } - } - videodata->ime_candpgsize = i - page_start; - } else { - videodata->ime_candpgsize = SDL_min(cand_list->dwPageSize == 0 ? MAX_CANDLIST : cand_list->dwPageSize, MAX_CANDLIST); - page_start = (cand_list->dwSelection / videodata->ime_candpgsize) * videodata->ime_candpgsize; - } - for (i = page_start, j = 0; (DWORD)i < cand_list->dwCount && j < videodata->ime_candpgsize; i++, j++) { - LPCWSTR candidate = (LPCWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i]); - IME_AddCandidate(videodata, j, candidate); - } - // TODO: why was this necessary? check ime_candvertical instead? PRIMLANG() never equals LANG_CHT ! - // if (PRIMLANG() == LANG_KOREAN || (PRIMLANG() == LANG_CHT && !IME_GetId(videodata, 0))) - // videodata->ime_candsel = -1; - } - SDL_free(cand_list); - } - } - ImmReleaseContext(hwnd, himc); + SDL_SendEditingTextCandidates(videodata->ime_candidates, videodata->ime_candcount, videodata->ime_candsel, videodata->ime_horizontal_candidates); } -static int IME_ShowCandidateList(SDL_VideoData *videodata) +static void IME_CloseCandidateList(SDL_VideoData *videodata) { - void *candidates; + videodata->ime_candidates_open = SDL_FALSE; - videodata->ime_candcount = 0; - candidates = SDL_realloc(videodata->ime_candidates, MAX_CANDSIZE); - if (candidates) { - videodata->ime_candidates = (WCHAR *)candidates; - } + if (videodata->ime_candcount > 0) { + for (int i = 0; i < videodata->ime_candcount; ++i) { + SDL_free(videodata->ime_candidates[i]); + videodata->ime_candidates[i] = NULL; + } + videodata->ime_candcount = 0; - if (!videodata->ime_candidates) { - return -1; + SDL_SendEditingTextCandidates(NULL, 0, -1, SDL_FALSE); } - - SDL_memset(videodata->ime_candidates, 0, MAX_CANDSIZE); - - videodata->ime_dirty = SDL_TRUE; - videodata->ime_candlist = SDL_TRUE; - IME_DestroyTextures(videodata); - IME_SendEditingEvent(videodata); - return 0; -} - -static void IME_HideCandidateList(SDL_VideoData *videodata) -{ - videodata->ime_dirty = SDL_FALSE; - videodata->ime_candlist = SDL_FALSE; - IME_DestroyTextures(videodata); - IME_SendEditingEvent(videodata); } SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) @@ -1026,11 +957,9 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S case WM_KEYDOWN: if (wParam == VK_PROCESSKEY) { SDL_DebugIMELog("WM_KEYDOWN VK_PROCESSKEY\n"); - videodata->ime_uicontext = 1; trap = SDL_TRUE; } else { SDL_DebugIMELog("WM_KEYDOWN normal\n"); - videodata->ime_uicontext = 0; } break; case WM_INPUTLANGCHANGE: @@ -1070,10 +999,11 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S break; case WM_IME_ENDCOMPOSITION: SDL_DebugIMELog("WM_IME_ENDCOMPOSITION\n"); - videodata->ime_uicontext = 0; videodata->ime_composition[0] = 0; videodata->ime_readingstring[0] = 0; videodata->ime_cursor = 0; + videodata->ime_selected_start = 0; + videodata->ime_selected_length = 0; IME_SendClearComposition(videodata); break; case WM_IME_NOTIFY: @@ -1094,16 +1024,10 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S case IMN_CHANGECANDIDATE: SDL_DebugIMELog("%s\n", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); trap = SDL_TRUE; - videodata->ime_uicontext = 1; - videodata->ime_candidates_open = SDL_TRUE; - IME_GetCandidateList(hwnd, videodata); break; case IMN_CLOSECANDIDATE: SDL_DebugIMELog("IMN_CLOSECANDIDATE\n"); trap = SDL_TRUE; - videodata->ime_uicontext = 0; - videodata->ime_candidates_open = SDL_FALSE; - IME_HideCandidateList(videodata); break; case IMN_PRIVATE: { @@ -1141,14 +1065,6 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S return trap; } -static void IME_CloseCandidateList(SDL_VideoData *videodata) -{ - IME_HideCandidateList(videodata); - videodata->ime_candcount = 0; - SDL_free(videodata->ime_candidates); - videodata->ime_candidates = NULL; -} - static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pcandlist) { UINT selection = 0; @@ -1159,7 +1075,7 @@ static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUI DWORD pgsize = 0; UINT i, j; - if (IME_ShowCandidateList(videodata) < 0) { + if (IME_OpenCandidateList(videodata) < 0) { return; } @@ -1167,10 +1083,7 @@ static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUI pcandlist->lpVtbl->GetCount(pcandlist, &count); pcandlist->lpVtbl->GetCurrentPage(pcandlist, &page); - videodata->ime_candsel = selection; - videodata->ime_candcount = count; - - pcandlist->lpVtbl->GetPageIndex(pcandlist, 0, 0, &pgcount); + pcandlist->lpVtbl->GetPageIndex(pcandlist, NULL, 0, &pgcount); if (pgcount > 0) { UINT *idxlist = SDL_malloc(sizeof(UINT) * pgcount); if (idxlist) { @@ -1185,9 +1098,9 @@ static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUI SDL_free(idxlist); } } - videodata->ime_candpgsize = SDL_min(pgsize, MAX_CANDLIST); - videodata->ime_candsel = videodata->ime_candsel - pgstart; - for (i = pgstart, j = 0; (DWORD)i < count && j < videodata->ime_candpgsize; i++, j++) { + pgsize = SDL_min(pgsize, MAX_CANDLIST); + videodata->ime_candsel = selection - pgstart; + for (i = pgstart, j = 0; (DWORD)i < count && j < pgsize; i++, j++) { BSTR bstr; if (SUCCEEDED(pcandlist->lpVtbl->GetString(pcandlist, i, &bstr))) { if (bstr) { @@ -1196,9 +1109,11 @@ static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUI } } } - // TODO: why was this necessary? check ime_candvertical instead? + // TODO: why was this necessary? check ime_horizontal_candidates instead? // if (PRIMLANG() == LANG_KOREAN) // videodata->ime_candsel = -1; + + IME_SendCandidateList(videodata); } STDMETHODIMP_(ULONG) @@ -1357,7 +1272,7 @@ STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID lan IME_InputLangChanged((SDL_VideoData *)sink->data); } - IME_HideCandidateList(videodata); + IME_CloseCandidateList(videodata); return S_OK; } @@ -1463,294 +1378,6 @@ static void UILess_ReleaseSinks(SDL_VideoData *videodata) } } -static void *StartDrawToBitmap(HDC hdc, HBITMAP *hhbm, int width, int height) -{ - BITMAPINFO info; - BITMAPINFOHEADER *infoHeader = &info.bmiHeader; - BYTE *bits = NULL; - if (hhbm) { - SDL_zero(info); - infoHeader->biSize = sizeof(BITMAPINFOHEADER); - infoHeader->biWidth = width; - infoHeader->biHeight = (LONG)-1 * SDL_abs(height); - infoHeader->biPlanes = 1; - infoHeader->biBitCount = 32; - infoHeader->biCompression = BI_RGB; - *hhbm = CreateDIBSection(hdc, &info, DIB_RGB_COLORS, (void **)&bits, 0, 0); - if (*hhbm) { - SelectObject(hdc, *hhbm); - } - } - return bits; -} - -static void StopDrawToBitmap(HDC hdc, HBITMAP *hhbm) -{ - if (hhbm && *hhbm) { - DeleteObject(*hhbm); - *hhbm = NULL; - } -} - -/* This draws only within the specified area and fills the entire region. */ -static void DrawRect(HDC hdc, int left, int top, int right, int bottom, int pensize) -{ - /* The case of no pen (PenSize = 0) is automatically taken care of. */ - const int penadjust = (int)SDL_floorf(pensize / 2.0f - 0.5f); - left += pensize / 2; - top += pensize / 2; - right -= penadjust; - bottom -= penadjust; - Rectangle(hdc, left, top, right, bottom); -} - -static void IME_DestroyTextures(SDL_VideoData *videodata) -{ -} - -#define SDL_swap(a, b) \ - { \ - int c = (a); \ - (a) = (b); \ - (b) = c; \ - } - -static void IME_PositionCandidateList(SDL_VideoData *videodata, SIZE size) -{ - int left, top, right, bottom; - SDL_bool ok = SDL_FALSE; - int winw = videodata->ime_winwidth; - int winh = videodata->ime_winheight; - - /* Bottom */ - left = videodata->ime_rect.x; - top = videodata->ime_rect.y + videodata->ime_rect.h; - right = left + size.cx; - bottom = top + size.cy; - if (right >= winw) { - left -= right - winw; - right = winw; - } - if (bottom < winh) { - ok = SDL_TRUE; - } - - /* Top */ - if (!ok) { - left = videodata->ime_rect.x; - top = videodata->ime_rect.y - size.cy; - right = left + size.cx; - bottom = videodata->ime_rect.y; - if (right >= winw) { - left -= right - winw; - right = winw; - } - if (top >= 0) { - ok = SDL_TRUE; - } - } - - /* Right */ - if (!ok) { - left = videodata->ime_rect.x + size.cx; - top = 0; - right = left + size.cx; - bottom = size.cy; - if (right < winw) { - ok = SDL_TRUE; - } - } - - /* Left */ - if (!ok) { - left = videodata->ime_rect.x - size.cx; - top = 0; - right = videodata->ime_rect.x; - bottom = size.cy; - if (right >= 0) { - ok = SDL_TRUE; - } - } - - /* Window too small, show at (0,0) */ - if (!ok) { - left = 0; - top = 0; - right = size.cx; - bottom = size.cy; - } - - videodata->ime_candlistrect.x = left; - videodata->ime_candlistrect.y = top; - videodata->ime_candlistrect.w = right - left; - videodata->ime_candlistrect.h = bottom - top; -} - -static void IME_RenderCandidateList(SDL_VideoData *videodata, HDC hdc) -{ - int i, j; - SIZE size = { 0 }; - SIZE candsizes[MAX_CANDLIST]; - SIZE maxcandsize = { 0 }; - HBITMAP hbm = NULL; - int candcount = SDL_min(SDL_min(MAX_CANDLIST, videodata->ime_candcount), videodata->ime_candpgsize); - SDL_bool vertical = videodata->ime_candvertical; - - const int listborder = 1; - const int listpadding = 0; - const int listbordercolor = RGB(0xB4, 0xC7, 0xAA); - const int listfillcolor = RGB(255, 255, 255); - - const int candborder = 1; - const int candpadding = 0; - const int candmargin = 1; - const COLORREF candbordercolor = RGB(255, 255, 255); - const COLORREF candfillcolor = RGB(255, 255, 255); - const COLORREF candtextcolor = RGB(0, 0, 0); - const COLORREF selbordercolor = RGB(0x84, 0xAC, 0xDD); - const COLORREF selfillcolor = RGB(0xD2, 0xE6, 0xFF); - const COLORREF seltextcolor = RGB(0, 0, 0); - const int horzcandspacing = 5; - - HPEN listpen = listborder != 0 ? CreatePen(PS_SOLID, listborder, listbordercolor) : (HPEN)GetStockObject(NULL_PEN); - HBRUSH listbrush = CreateSolidBrush(listfillcolor); - HPEN candpen = candborder != 0 ? CreatePen(PS_SOLID, candborder, candbordercolor) : (HPEN)GetStockObject(NULL_PEN); - HBRUSH candbrush = CreateSolidBrush(candfillcolor); - HPEN selpen = candborder != 0 ? CreatePen(PS_DOT, candborder, selbordercolor) : (HPEN)GetStockObject(NULL_PEN); - HBRUSH selbrush = CreateSolidBrush(selfillcolor); - HFONT font = CreateFont((int)(1 + videodata->ime_rect.h * 0.75f), 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, OUT_CHARACTER_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, VARIABLE_PITCH | FF_SWISS, TEXT("Microsoft Sans Serif")); - - SetBkMode(hdc, TRANSPARENT); - SelectObject(hdc, font); - - for (i = 0; i < candcount; ++i) { - const WCHAR *s = &videodata->ime_candidates[i * MAX_CANDLENGTH]; - if (!*s) { - candcount = i; - break; - } - - GetTextExtentPoint32W(hdc, s, (int)SDL_wcslen(s), &candsizes[i]); - maxcandsize.cx = SDL_max(maxcandsize.cx, candsizes[i].cx); - maxcandsize.cy = SDL_max(maxcandsize.cy, candsizes[i].cy); - } - if (vertical) { - size.cx = - (listborder * 2) + - (listpadding * 2) + - (candmargin * 2) + - (candborder * 2) + - (candpadding * 2) + - (maxcandsize.cx); - size.cy = - (listborder * 2) + - (listpadding * 2) + - ((candcount + 1) * candmargin) + - (candcount * candborder * 2) + - (candcount * candpadding * 2) + - (candcount * maxcandsize.cy); - } else { - size.cx = - (LONG)(listborder * 2) + - (listpadding * 2) + - ((candcount + 1) * candmargin) + - (candcount * candborder * 2) + - (candcount * candpadding * 2) + - ((candcount - 1) * horzcandspacing); - - for (i = 0; i < candcount; ++i) { - size.cx += candsizes[i].cx; - } - - size.cy = - (listborder * 2) + - (listpadding * 2) + - (candmargin * 2) + - (candborder * 2) + - (candpadding * 2) + - (maxcandsize.cy); - } - - StartDrawToBitmap(hdc, &hbm, size.cx, size.cy); - - SelectObject(hdc, listpen); - SelectObject(hdc, listbrush); - DrawRect(hdc, 0, 0, size.cx, size.cy, listborder); - - SelectObject(hdc, candpen); - SelectObject(hdc, candbrush); - SetTextColor(hdc, candtextcolor); - SetBkMode(hdc, TRANSPARENT); - - for (i = 0; i < candcount; ++i) { - const WCHAR *s = &videodata->ime_candidates[i * MAX_CANDLENGTH]; - int left, top, right, bottom; - - if (vertical) { - left = listborder + listpadding + candmargin; - top = listborder + listpadding + (i * candborder * 2) + (i * candpadding * 2) + ((i + 1) * candmargin) + (i * maxcandsize.cy); - right = size.cx - listborder - listpadding - candmargin; - bottom = top + maxcandsize.cy + (candpadding * 2) + (candborder * 2); - } else { - left = listborder + listpadding + (i * candborder * 2) + (i * candpadding * 2) + ((i + 1) * candmargin) + (i * horzcandspacing); - - for (j = 0; j < i; ++j) { - left += candsizes[j].cx; - } - - top = listborder + listpadding + candmargin; - right = left + candsizes[i].cx + (candpadding * 2) + (candborder * 2); - bottom = size.cy - listborder - listpadding - candmargin; - } - - if ((DWORD)i == videodata->ime_candsel) { - SelectObject(hdc, selpen); - SelectObject(hdc, selbrush); - SetTextColor(hdc, seltextcolor); - } else { - SelectObject(hdc, candpen); - SelectObject(hdc, candbrush); - SetTextColor(hdc, candtextcolor); - } - - DrawRect(hdc, left, top, right, bottom, candborder); - ExtTextOutW(hdc, left + candborder + candpadding, top + candborder + candpadding, 0, NULL, s, (int)SDL_wcslen(s), NULL); - } - StopDrawToBitmap(hdc, &hbm); - - DeleteObject(listpen); - DeleteObject(listbrush); - DeleteObject(candpen); - DeleteObject(candbrush); - DeleteObject(selpen); - DeleteObject(selbrush); - DeleteObject(font); - - IME_PositionCandidateList(videodata, size); -} - -static void IME_Render(SDL_VideoData *videodata) -{ - HDC hdc = CreateCompatibleDC(NULL); - - if (videodata->ime_candlist) { - IME_RenderCandidateList(videodata, hdc); - } - - DeleteDC(hdc); - - videodata->ime_dirty = SDL_FALSE; -} - -void IME_Present(SDL_VideoData *videodata) -{ - if (videodata->ime_dirty) { - IME_Render(videodata); - } - - /* FIXME: Need to show the IME bitmap */ -} - int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *videodata = _this->driverdata; diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 09a930a2c23a3..97d196a08838b 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -440,20 +440,14 @@ struct SDL_VideoData int ime_selected_length; SDL_bool ime_candidates_open; - SDL_bool ime_candlist; - WCHAR *ime_candidates; - DWORD ime_candcount; + char *ime_candidates[MAX_CANDLIST]; + int ime_candcount; DWORD ime_candref; DWORD ime_candsel; - UINT ime_candpgsize; int ime_candlistindexbase; - SDL_bool ime_candvertical; + SDL_bool ime_horizontal_candidates; - SDL_bool ime_dirty; SDL_Rect ime_rect; - SDL_Rect ime_candlistrect; - int ime_winwidth; - int ime_winheight; HKL ime_hkl; void *ime_himm32; @@ -474,7 +468,6 @@ struct SDL_VideoData DWORD ime_convmodesinkcookie; TSFSink *ime_uielemsink; TSFSink *ime_ippasink; - LONG ime_uicontext; #endif /* !SDL_DISABLE_WINDOWS_IME */ BYTE pre_hook_key_state[256]; diff --git a/test/testime.c b/test/testime.c index d552d554eff40..0adb9e2242e5e 100644 --- a/test/testime.c +++ b/test/testime.c @@ -53,6 +53,10 @@ static int cursor_length = 0; static SDL_bool cursor_visible; static Uint64 last_cursor_change; static SDL_BlendMode highlight_mode; +static char **candidates; +static int num_candidates; +static int selected_candidate; +static SDL_bool horizontal_candidates; #ifdef HAVE_SDL_TTF static TTF_Font *font; #else @@ -319,7 +323,16 @@ static int unifont_load_texture(Uint32 textureID) return 0; } -static Sint32 unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_FRect *dst) +static int unifont_glyph_width(Uint32 codepoint) +{ + if (codepoint > UNIFONT_MAX_CODEPOINT || + unifontGlyph[codepoint].width == 0) { + codepoint = UNIFONT_REPLACEMENT; + } + return unifontGlyph[codepoint].width; +} + +static int unifont_draw_glyph(Uint32 codepoint, int rendererID, SDL_FRect *dst) { SDL_Texture *texture; Uint32 textureID; @@ -456,9 +469,190 @@ static void InitInput(void) SDL_StartTextInput(state->windows[0]); } + +static void ClearCandidates(void) +{ + int i; + + for (i = 0; i < num_candidates; ++i) { + SDL_free(candidates[i]); + } + SDL_free(candidates); + candidates = NULL; + num_candidates = 0; +} + +static void SaveCandidates(SDL_Event *event) +{ + int i; + + ClearCandidates(); + + num_candidates = event->edit_candidates.num_candidates; + if (num_candidates > 0) { + candidates = (char **)SDL_malloc(num_candidates * sizeof(*candidates)); + if (!candidates) { + num_candidates = 0; + return; + } + for (i = 0; i < num_candidates; ++i) { + candidates[i] = SDL_strdup(event->edit_candidates.candidates[i]); + } + selected_candidate = event->edit_candidates.selected_candidate; + horizontal_candidates = event->edit_candidates.horizontal; + } +} + +static void DrawCandidates(int rendererID, SDL_FRect *cursorRect) +{ + SDL_Renderer *renderer = state->renderers[rendererID]; + int i; + int output_w = 0, output_h = 0; + float w = 0.0f, h = 0.0f; + SDL_FRect candidatesRect, dstRect, underlineRect; + + if (num_candidates == 0) { + return; + } + + /* Calculate the size of the candidate list */ + for (i = 0; i < num_candidates; ++i) { + if (!candidates[i]) { + continue; + } + +#ifdef HAVE_SDL_TTF + /* FIXME */ +#else + if (horizontal_candidates) { + char *utext = candidates[i]; + Uint32 codepoint; + size_t len; + float advance = 0.0f; + + if (i > 0) { + advance += unifont_glyph_width(' ') * UNIFONT_DRAW_SCALE; + } + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) { + advance += unifont_glyph_width(codepoint) * UNIFONT_DRAW_SCALE; + utext += len; + } + w += advance; + h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + } else { + char *utext = candidates[i]; + Uint32 codepoint; + size_t len; + float advance = 0.0f; + + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) { + advance += unifont_glyph_width(codepoint) * UNIFONT_DRAW_SCALE; + utext += len; + } + w = SDL_max(w, advance); + if (i > 0) { + h += 2.0f; + } + h += UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + } +#endif + } + + /* Position the candidate window */ + SDL_GetCurrentRenderOutputSize(renderer, &output_w, &output_h); + candidatesRect.x = cursorRect->x; + candidatesRect.y = cursorRect->y + cursorRect->h + 2.0f; + candidatesRect.w = 1.0f + 2.0f + w + 2.0f + 1.0f; + candidatesRect.h = 1.0f + 2.0f + h + 2.0f + 1.0f; + if ((candidatesRect.x + candidatesRect.w) > output_w) { + candidatesRect.x = (output_w - candidatesRect.w); + if (candidatesRect.x < 0.0f) { + candidatesRect.x = 0.0f; + } + } + + /* Draw the candidate background */ + SDL_SetRenderDrawColor(renderer, 0xAA, 0xAA, 0xAA, 0xFF); + SDL_RenderFillRect(renderer, &candidatesRect); + SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF); + SDL_RenderRect(renderer, &candidatesRect); + + /* Draw the candidates */ + dstRect.x = candidatesRect.x + 3.0f; + dstRect.y = candidatesRect.y + 3.0f; + for (i = 0; i < num_candidates; ++i) { + if (!candidates[i]) { + continue; + } + +#ifdef HAVE_SDL_TTF + /* FIXME */ +#else + dstRect.w = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + dstRect.h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; + + if (horizontal_candidates) { + char *utext = candidates[i]; + Uint32 codepoint; + size_t len; + float start; + + if (i > 0) { + dstRect.x += unifont_draw_glyph(' ', rendererID, &dstRect) * UNIFONT_DRAW_SCALE; + } + + start = dstRect.x + 2 * unifont_glyph_width(' ') * UNIFONT_DRAW_SCALE; + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) { + dstRect.x += unifont_draw_glyph(codepoint, rendererID, &dstRect) * UNIFONT_DRAW_SCALE; + utext += len; + } + + if (i == selected_candidate) { + underlineRect.x = start; + underlineRect.y = dstRect.y + dstRect.h - 2; + underlineRect.h = 2; + underlineRect.w = dstRect.x - start; + + SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); + SDL_RenderFillRect(renderer, &underlineRect); + } + } else { + char *utext = candidates[i]; + Uint32 codepoint; + size_t len; + float start; + + dstRect.x = candidatesRect.x + 3.0f; + + start = dstRect.x + 2 * unifont_glyph_width(' ') * UNIFONT_DRAW_SCALE; + while ((codepoint = utf8_decode(utext, len = utf8_length(*utext))) != 0) { + dstRect.x += unifont_draw_glyph(codepoint, rendererID, &dstRect) * UNIFONT_DRAW_SCALE; + utext += len; + } + + if (i == selected_candidate) { + underlineRect.x = start; + underlineRect.y = dstRect.y + dstRect.h - 2; + underlineRect.h = 2; + underlineRect.w = dstRect.x - start; + + SDL_SetRenderDrawColor(renderer, lineColor.r, lineColor.g, lineColor.b, lineColor.a); + SDL_RenderFillRect(renderer, &underlineRect); + } + + if (i > 0) { + dstRect.y += 2.0f; + } + dstRect.y += dstRect.h; + } +#endif + } +} + static void CleanupVideo(void) { SDL_StopTextInput(state->windows[0]); + ClearCandidates(); #ifdef HAVE_SDL_TTF TTF_CloseFont(font); TTF_Quit(); @@ -630,6 +824,9 @@ static void RedrawWindow(int rendererID) SDL_RenderFillRect(renderer, &cursorRect); } + /* Draw the candidates */ + DrawCandidates(rendererID, &cursorRect); + { SDL_Rect inputrect; @@ -681,13 +878,16 @@ int main(int argc, char *argv[]) consumed = SDLTest_CommonArg(state, i); if (SDL_strcmp(argv[i], "--font") == 0) { - if (*argv[i+1]) { - fontname = argv[i+1]; + if (*argv[i + 1]) { + fontname = argv[i + 1]; consumed = 2; } + } else if (SDL_strcmp(argv[i], "--disable-ui") == 0) { + SDL_SetHint(SDL_HINT_IME_SHOW_UI, "0"); + consumed = 1; } if (consumed <= 0) { - static const char *options[] = { "[--font fontfile]", NULL }; + static const char *options[] = { "[--font fontfile] [--disable-ui]", NULL }; SDLTest_CommonLogUsage(state, argv[0], options); return 1; } @@ -814,6 +1014,16 @@ int main(int argc, char *argv[]) cursor_length = event.edit.length; break; + case SDL_EVENT_TEXT_EDITING_CANDIDATES: + SDL_Log("text candidates:\n"); + for (i = 0; i < event.edit_candidates.num_candidates; ++i) { + SDL_Log("%c%s\n", i == event.edit_candidates.selected_candidate ? '>' : ' ', event.edit_candidates.candidates[i]); + } + + ClearCandidates(); + SaveCandidates(&event); + break; + default: break; } From 42d8db7e347396b587b9505fc12554c1e33d182f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 22:27:41 -0700 Subject: [PATCH 100/431] Current Korean IMEs don't have candidates --- src/video/windows/SDL_windowskeyboard.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 80c8d51bb9bea..b74f92b374ee6 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -1109,9 +1109,6 @@ static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUI } } } - // TODO: why was this necessary? check ime_horizontal_candidates instead? - // if (PRIMLANG() == LANG_KOREAN) - // videodata->ime_candsel = -1; IME_SendCandidateList(videodata); } From e324c7d6920be431b4324ae6bcc2d15f4cd808cc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 27 Jun 2024 22:35:19 -0700 Subject: [PATCH 101/431] Fixed event spam caused by repeated calls to IME_SetTextInputRect() --- src/video/windows/SDL_windowskeyboard.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index b74f92b374ee6..76973f0079de8 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -696,6 +696,10 @@ static void IME_SetTextInputRect(SDL_VideoData *videodata, const SDL_Rect *rect) { HIMC himc = 0; + if (SDL_memcmp(rect, &videodata->ime_rect, sizeof(*rect)) == 0) { + return; + } + videodata->ime_rect = *rect; himc = ImmGetContext(videodata->ime_hwnd_current); From bdd531986baf1c2bb1bdd4004a388b53a1993b25 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 13:17:04 -0700 Subject: [PATCH 102/431] SDL_SetTextInputRect() has been renamed to SDL_SetTextInputArea() The new function includes the cursor position so IME UI elements can be placed relative to the cursor, as well as having the whole text area available so on-screen keyboards can avoid it. --- docs/README-migration.md | 1 + include/SDL3/SDL_keyboard.h | 39 ++++++----- src/core/linux/SDL_fcitx.c | 12 ++-- src/core/linux/SDL_fcitx.h | 2 +- src/core/linux/SDL_ibus.c | 14 ++-- src/core/linux/SDL_ibus.h | 2 +- src/core/linux/SDL_ime.c | 16 ++--- src/core/linux/SDL_ime.h | 2 +- src/dynapi/SDL_dynapi.sym | 3 +- src/dynapi/SDL_dynapi_overrides.h | 3 +- src/dynapi/SDL_dynapi_procs.h | 3 +- src/video/SDL_sysvideo.h | 3 +- src/video/SDL_video.c | 21 +++++- src/video/cocoa/SDL_cocoakeyboard.h | 2 +- src/video/cocoa/SDL_cocoakeyboard.m | 4 +- src/video/cocoa/SDL_cocoavideo.m | 2 +- src/video/gdk/SDL_gdktextinput.cpp | 2 +- src/video/gdk/SDL_gdktextinput.h | 2 +- src/video/uikit/SDL_uikitvideo.m | 2 +- src/video/uikit/SDL_uikitviewcontroller.h | 2 +- src/video/uikit/SDL_uikitviewcontroller.m | 2 +- src/video/wayland/SDL_waylandkeyboard.c | 6 +- src/video/wayland/SDL_waylandkeyboard.h | 2 +- src/video/wayland/SDL_waylandvideo.c | 2 +- src/video/windows/SDL_windowskeyboard.c | 81 +++++++++++++---------- src/video/windows/SDL_windowskeyboard.h | 2 +- src/video/windows/SDL_windowsvideo.c | 4 +- src/video/windows/SDL_windowsvideo.h | 3 +- src/video/x11/SDL_x11events.c | 2 +- src/video/x11/SDL_x11keyboard.c | 6 +- src/video/x11/SDL_x11keyboard.h | 2 +- src/video/x11/SDL_x11video.c | 2 +- test/checkkeys.c | 14 ++-- test/testautomation_keyboard.c | 50 +++++++------- test/testime.c | 30 ++++++--- 35 files changed, 199 insertions(+), 146 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 63399f7dc9c5b..122983b4997e4 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -917,6 +917,7 @@ The following functions have been renamed: The following functions have been removed: * SDL_IsTextInputShown() +* SDL_SetTextInputRect() - replaced with SDL_SetTextInputArea() The following structures have been removed: * SDL_Keysym diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index fd44ef2f9d732..50ee5927da9e6 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -369,7 +369,7 @@ extern SDL_DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_SetTextInputRect + * \sa SDL_SetTextInputArea * \sa SDL_StopTextInput * \sa SDL_TextInputActive */ @@ -418,32 +418,39 @@ extern SDL_DECLSPEC int SDLCALL SDL_StopTextInput(SDL_Window *window); extern SDL_DECLSPEC int SDLCALL SDL_ClearComposition(SDL_Window *window); /** - * Set the rectangle used to type Unicode text inputs. + * Set the area used to type Unicode text input. * - * This is often set to the extents of a text field within the window. + * Native input methods may place a window with word suggestions near the cursor, without covering the text being entered. * - * Native input methods will place a window with word suggestions near it, - * without covering the text being inputted. + * \param window the window for which to set the text input area. + * \param rect the SDL_Rect representing the text input area, in window coordinates, or NULL to clear it. + * \param cursor the offset of the current cursor location relative to `rect->x`, in window coordinates. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * - * To start text input in a given location, this function is intended to be - * called before SDL_StartTextInput, although some platforms support moving - * the rectangle even while text input (and a composition) is active. + * \since This function is available since SDL 3.0.0. * - * Note: If you want to use the system native IME window, try setting hint - * **SDL_HINT_IME_SHOW_UI** to **1**, otherwise this function won't give you - * any feedback. + * \sa SDL_GetTextInputArea + * \sa SDL_StartTextInput + */ +extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor); + +/** + * Get the area used to type Unicode text input. * - * \param window the window for which to set the text input rectangle. - * \param rect the SDL_Rect structure representing the rectangle to receive - * text (ignored if NULL). + * This returns the values previously set by SDL_SetTextInputArea(). + * + * \param window the window for which to query the text input area. + * \param rect a pointer to an SDL_Rect filled in with the text input area, may be NULL. + * \param cursor a pointer to the offset of the current cursor location relative to `rect->x`, may be NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_StartTextInput + * \sa SDL_SetTextInputArea */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputRect(SDL_Window *window, const SDL_Rect *rect); +extern SDL_DECLSPEC int SDLCALL SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor); /** * Check whether the platform has screen keyboard support. diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index bd0a8fb7b2dc3..41895fa221e0a 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -211,7 +211,7 @@ static DBusHandlerResult DBus_MessageFilter(DBusConnection *conn, DBusMessage *m SDL_SendEditingText("", 0, 0); } - SDL_Fcitx_UpdateTextRect(SDL_GetKeyboardFocus()); + SDL_Fcitx_UpdateTextInputArea(SDL_GetKeyboardFocus()); return DBUS_HANDLER_RESULT_HANDLED; } @@ -390,7 +390,7 @@ SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) DBUS_TYPE_UINT32, &keysym, DBUS_TYPE_UINT32, &keycode, DBUS_TYPE_UINT32, &mod_state, DBUS_TYPE_BOOLEAN, &is_release, DBUS_TYPE_UINT32, &event_time, DBUS_TYPE_INVALID, DBUS_TYPE_BOOLEAN, &handled, DBUS_TYPE_INVALID)) { if (handled) { - SDL_Fcitx_UpdateTextRect(SDL_GetKeyboardFocus()); + SDL_Fcitx_UpdateTextInputArea(SDL_GetKeyboardFocus()); return SDL_TRUE; } } @@ -398,7 +398,7 @@ SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) return SDL_FALSE; } -void SDL_Fcitx_UpdateTextRect(SDL_Window *window) +void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window) { int x = 0, y = 0; SDL_Rect *cursor = &fcitx_client.cursor_rect; @@ -407,7 +407,11 @@ void SDL_Fcitx_UpdateTextRect(SDL_Window *window) return; } - SDL_copyp(cursor, &window->text_input_rect); + // We'll use a square at the text input cursor location for the cursor_rect + cursor->x = window->text_input_rect.x + window->text_input_cursor; + cursor->y = window->text_input_rect.x; + cursor->w = window->text_input_rect.h; + cursor->h = window->text_input_rect.h; SDL_GetWindowPosition(window, &x, &y); diff --git a/src/core/linux/SDL_fcitx.h b/src/core/linux/SDL_fcitx.h index daddf8fd4e143..75c2510e053ca 100644 --- a/src/core/linux/SDL_fcitx.h +++ b/src/core/linux/SDL_fcitx.h @@ -29,7 +29,7 @@ extern void SDL_Fcitx_Quit(void); extern void SDL_Fcitx_SetFocus(SDL_bool focused); extern void SDL_Fcitx_Reset(void); extern SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state); -extern void SDL_Fcitx_UpdateTextRect(SDL_Window *window); +extern void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window); extern void SDL_Fcitx_PumpEvents(void); #endif /* SDL_fcitx_h_ */ diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 370dff7d4b65c..ed73cc5bd82fb 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -261,7 +261,7 @@ static DBusHandlerResult IBus_MessageHandler(DBusConnection *conn, DBusMessage * } } - SDL_IBus_UpdateTextRect(SDL_GetKeyboardFocus()); + SDL_IBus_UpdateTextInputArea(SDL_GetKeyboardFocus()); return DBUS_HANDLER_RESULT_HANDLED; } @@ -483,7 +483,7 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr) SDL_Window *window = SDL_GetKeyboardFocus(); if (SDL_TextInputActive(window)) { SDL_IBus_SetFocus(SDL_TRUE); - SDL_IBus_UpdateTextRect(window); + SDL_IBus_UpdateTextInputArea(window); } else { SDL_IBus_SetFocus(SDL_FALSE); } @@ -674,12 +674,12 @@ SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) } } - SDL_IBus_UpdateTextRect(SDL_GetKeyboardFocus()); + SDL_IBus_UpdateTextInputArea(SDL_GetKeyboardFocus()); return (result != 0); } -void SDL_IBus_UpdateTextRect(SDL_Window *window) +void SDL_IBus_UpdateTextInputArea(SDL_Window *window) { int x = 0, y = 0; SDL_DBusContext *dbus; @@ -688,7 +688,11 @@ void SDL_IBus_UpdateTextRect(SDL_Window *window) return; } - SDL_copyp(&ibus_cursor_rect, &window->text_input_rect); + // We'll use a square at the text input cursor location for the ibus_cursor + ibus_cursor_rect.x = window->text_input_rect.x + window->text_input_cursor; + ibus_cursor_rect.y = window->text_input_rect.x; + ibus_cursor_rect.w = window->text_input_rect.h; + ibus_cursor_rect.h = window->text_input_rect.h; SDL_GetWindowPosition(window, &x, &y); diff --git a/src/core/linux/SDL_ibus.h b/src/core/linux/SDL_ibus.h index 5ff90cb82de98..1a6fc5bb73231 100644 --- a/src/core/linux/SDL_ibus.h +++ b/src/core/linux/SDL_ibus.h @@ -44,7 +44,7 @@ extern SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 st /* Update the position of IBus' candidate list. If rect is NULL then this will just reposition it relative to the focused window's new position. */ -extern void SDL_IBus_UpdateTextRect(SDL_Window *window); +extern void SDL_IBus_UpdateTextInputArea(SDL_Window *window); /* Checks DBus for new IBus events, and calls SDL_SendKeyboardText / SDL_SendEditingText for each event it finds */ diff --git a/src/core/linux/SDL_ime.c b/src/core/linux/SDL_ime.c index 7f2ba82392636..d9be1f0edf379 100644 --- a/src/core/linux/SDL_ime.c +++ b/src/core/linux/SDL_ime.c @@ -29,7 +29,7 @@ typedef void (*SDL_IME_Quit_t)(void); typedef void (*SDL_IME_SetFocus_t)(SDL_bool); typedef void (*SDL_IME_Reset_t)(void); typedef SDL_bool (*SDL_IME_ProcessKeyEvent_t)(Uint32, Uint32, Uint8 state); -typedef void (*SDL_IME_UpdateTextRect_t)(SDL_Window *window); +typedef void (*SDL_IME_UpdateTextInputArea_t)(SDL_Window *window); typedef void (*SDL_IME_PumpEvents_t)(void); static SDL_IME_Init_t SDL_IME_Init_Real = NULL; @@ -37,7 +37,7 @@ static SDL_IME_Quit_t SDL_IME_Quit_Real = NULL; static SDL_IME_SetFocus_t SDL_IME_SetFocus_Real = NULL; static SDL_IME_Reset_t SDL_IME_Reset_Real = NULL; static SDL_IME_ProcessKeyEvent_t SDL_IME_ProcessKeyEvent_Real = NULL; -static SDL_IME_UpdateTextRect_t SDL_IME_UpdateTextRect_Real = NULL; +static SDL_IME_UpdateTextInputArea_t SDL_IME_UpdateTextInputArea_Real = NULL; static SDL_IME_PumpEvents_t SDL_IME_PumpEvents_Real = NULL; static void InitIME(void) @@ -64,7 +64,7 @@ static void InitIME(void) SDL_IME_SetFocus_Real = SDL_Fcitx_SetFocus; SDL_IME_Reset_Real = SDL_Fcitx_Reset; SDL_IME_ProcessKeyEvent_Real = SDL_Fcitx_ProcessKeyEvent; - SDL_IME_UpdateTextRect_Real = SDL_Fcitx_UpdateTextRect; + SDL_IME_UpdateTextInputArea_Real = SDL_Fcitx_UpdateTextInputArea; SDL_IME_PumpEvents_Real = SDL_Fcitx_PumpEvents; } #endif /* HAVE_FCITX */ @@ -77,7 +77,7 @@ static void InitIME(void) SDL_IME_SetFocus_Real = SDL_IBus_SetFocus; SDL_IME_Reset_Real = SDL_IBus_Reset; SDL_IME_ProcessKeyEvent_Real = SDL_IBus_ProcessKeyEvent; - SDL_IME_UpdateTextRect_Real = SDL_IBus_UpdateTextRect; + SDL_IME_UpdateTextInputArea_Real = SDL_IBus_UpdateTextInputArea; SDL_IME_PumpEvents_Real = SDL_IBus_PumpEvents; } #endif /* HAVE_IBUS_IBUS_H */ @@ -98,7 +98,7 @@ SDL_bool SDL_IME_Init(void) SDL_IME_SetFocus_Real = NULL; SDL_IME_Reset_Real = NULL; SDL_IME_ProcessKeyEvent_Real = NULL; - SDL_IME_UpdateTextRect_Real = NULL; + SDL_IME_UpdateTextInputArea_Real = NULL; SDL_IME_PumpEvents_Real = NULL; } @@ -135,10 +135,10 @@ SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state) return SDL_FALSE; } -void SDL_IME_UpdateTextRect(SDL_Window *window) +void SDL_IME_UpdateTextInputArea(SDL_Window *window) { - if (SDL_IME_UpdateTextRect_Real) { - SDL_IME_UpdateTextRect_Real(window); + if (SDL_IME_UpdateTextInputArea_Real) { + SDL_IME_UpdateTextInputArea_Real(window); } } diff --git a/src/core/linux/SDL_ime.h b/src/core/linux/SDL_ime.h index 088ac53397821..700f5c626c886 100644 --- a/src/core/linux/SDL_ime.h +++ b/src/core/linux/SDL_ime.h @@ -29,7 +29,7 @@ extern void SDL_IME_Quit(void); extern void SDL_IME_SetFocus(SDL_bool focused); extern void SDL_IME_Reset(void); extern SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state); -extern void SDL_IME_UpdateTextRect(SDL_Window *window); +extern void SDL_IME_UpdateTextInputArea(SDL_Window *window); extern void SDL_IME_PumpEvents(void); #endif /* SDL_ime_h_ */ diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index f6ce6ba8be5dc..b81b894f45a50 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -437,6 +437,7 @@ SDL3_0.0.0 { SDL_GetSystemRAM; SDL_GetSystemTheme; SDL_GetTLS; + SDL_GetTextInputArea; SDL_GetTextureAlphaMod; SDL_GetTextureAlphaModFloat; SDL_GetTextureBlendMode; @@ -745,7 +746,7 @@ SDL3_0.0.0 { SDL_SetSurfacePalette; SDL_SetSurfaceRLE; SDL_SetTLS; - SDL_SetTextInputRect; + SDL_SetTextInputArea; SDL_SetTextureAlphaMod; SDL_SetTextureAlphaModFloat; SDL_SetTextureBlendMode; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 8e238965b6681..4cfcd09b63181 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -462,6 +462,7 @@ #define SDL_GetSystemRAM SDL_GetSystemRAM_REAL #define SDL_GetSystemTheme SDL_GetSystemTheme_REAL #define SDL_GetTLS SDL_GetTLS_REAL +#define SDL_GetTextInputArea SDL_GetTextInputArea_REAL #define SDL_GetTextureAlphaMod SDL_GetTextureAlphaMod_REAL #define SDL_GetTextureAlphaModFloat SDL_GetTextureAlphaModFloat_REAL #define SDL_GetTextureBlendMode SDL_GetTextureBlendMode_REAL @@ -770,7 +771,7 @@ #define SDL_SetSurfacePalette SDL_SetSurfacePalette_REAL #define SDL_SetSurfaceRLE SDL_SetSurfaceRLE_REAL #define SDL_SetTLS SDL_SetTLS_REAL -#define SDL_SetTextInputRect SDL_SetTextInputRect_REAL +#define SDL_SetTextInputArea SDL_SetTextInputArea_REAL #define SDL_SetTextureAlphaMod SDL_SetTextureAlphaMod_REAL #define SDL_SetTextureAlphaModFloat SDL_SetTextureAlphaModFloat_REAL #define SDL_SetTextureBlendMode SDL_SetTextureBlendMode_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 4780080bbf414..4c43f04070bfe 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -482,6 +482,7 @@ SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSurfaceProperties,(SDL_Surface *a),(a),r SDL_DYNAPI_PROC(int,SDL_GetSystemRAM,(void),(),return) SDL_DYNAPI_PROC(SDL_SystemTheme,SDL_GetSystemTheme,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_GetTLS,(SDL_TLSID a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetTextInputArea,(SDL_Window *a, SDL_Rect *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaMod,(SDL_Texture *a, Uint8 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaModFloat,(SDL_Texture *a, float *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode *b),(a,b),return) @@ -780,7 +781,7 @@ SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b), SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTLS,(SDL_TLSID a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) -SDL_DYNAPI_PROC(int,SDL_SetTextInputRect,(SDL_Window *a, const SDL_Rect *b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_SetTextInputArea,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaModFloat,(SDL_Texture *a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode b),(a,b),return) diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 91c86cd02b6f0..5437a838aab72 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -103,6 +103,7 @@ struct SDL_Window SDL_bool text_input_active; SDL_Rect text_input_rect; + int text_input_cursor; SDL_Rect mouse_rect; @@ -327,7 +328,7 @@ struct SDL_VideoDevice /* Text input */ int (*StartTextInput)(SDL_VideoDevice *_this, SDL_Window *window); int (*StopTextInput)(SDL_VideoDevice *_this, SDL_Window *window); - int (*UpdateTextInputRect)(SDL_VideoDevice *_this, SDL_Window *window); + int (*UpdateTextInputArea)(SDL_VideoDevice *_this, SDL_Window *window); int (*ClearComposition)(SDL_VideoDevice *_this, SDL_Window *window); /* Screen keyboard */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 69b71b3bcc154..5fa53035ad12c 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5074,24 +5074,39 @@ int SDL_StopTextInput(SDL_Window *window) return 0; } -int SDL_SetTextInputRect(SDL_Window *window, const SDL_Rect *rect) +int SDL_SetTextInputArea(SDL_Window *window, const SDL_Rect *rect, int cursor) { CHECK_WINDOW_MAGIC(window, -1); if (rect) { SDL_copyp(&window->text_input_rect, rect); + window->text_input_cursor = cursor; } else { SDL_zero(window->text_input_rect); + window->text_input_cursor = 0; } - if (_this && _this->UpdateTextInputRect) { - if (_this->UpdateTextInputRect(_this, window) < 0) { + if (_this && _this->UpdateTextInputArea) { + if (_this->UpdateTextInputArea(_this, window) < 0) { return -1; } } return 0; } +int SDL_GetTextInputArea(SDL_Window *window, SDL_Rect *rect, int *cursor) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (rect) { + SDL_copyp(rect, &window->text_input_rect); + } + if (cursor) { + *cursor = window->text_input_cursor; + } + return 0; +} + int SDL_ClearComposition(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, -1); diff --git a/src/video/cocoa/SDL_cocoakeyboard.h b/src/video/cocoa/SDL_cocoakeyboard.h index ccbc057b44b6f..85a409258a3a7 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.h +++ b/src/video/cocoa/SDL_cocoakeyboard.h @@ -29,7 +29,7 @@ extern void Cocoa_QuitKeyboard(SDL_VideoDevice *_this); extern int Cocoa_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); extern int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); -extern int Cocoa_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +extern int Cocoa_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); extern int Cocoa_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index b003d6910b488..bda67f2884cde 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -368,7 +368,7 @@ int Cocoa_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) [nswindow makeFirstResponder:data.fieldEdit]; } } - return Cocoa_UpdateTextInputRect(_this, window); + return Cocoa_UpdateTextInputArea(_this, window); } int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) @@ -384,7 +384,7 @@ int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) return 0; } -int Cocoa_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) +int Cocoa_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; if (data.fieldEdit) { diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 0b63c248cc9fa..c9cb9043d25c9 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -172,7 +172,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device) device->StartTextInput = Cocoa_StartTextInput; device->StopTextInput = Cocoa_StopTextInput; - device->UpdateTextInputRect = Cocoa_UpdateTextInputRect; + device->UpdateTextInputArea = Cocoa_UpdateTextInputArea; device->SetClipboardData = Cocoa_SetClipboardData; device->GetClipboardData = Cocoa_GetClipboardData; diff --git a/src/video/gdk/SDL_gdktextinput.cpp b/src/video/gdk/SDL_gdktextinput.cpp index de82500deda9b..3f73f66779eab 100644 --- a/src/video/gdk/SDL_gdktextinput.cpp +++ b/src/video/gdk/SDL_gdktextinput.cpp @@ -200,7 +200,7 @@ int GDK_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) return 0; } -int GDK_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) +int GDK_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { /* * XGameUiShowTextEntryAsync does not allow you to set diff --git a/src/video/gdk/SDL_gdktextinput.h b/src/video/gdk/SDL_gdktextinput.h index 78c506cbf2774..cbd043885cb3b 100644 --- a/src/video/gdk/SDL_gdktextinput.h +++ b/src/video/gdk/SDL_gdktextinput.h @@ -34,7 +34,7 @@ void GDK_EnsureHints(void); int GDK_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); int GDK_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); -int GDK_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +int GDK_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); int GDK_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window); SDL_bool GDK_HasScreenKeyboardSupport(SDL_VideoDevice *_this); diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index dea57315cffc1..916afb1d5d4b4 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -100,7 +100,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice *device) device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard; device->HideScreenKeyboard = UIKit_HideScreenKeyboard; device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown; - device->UpdateTextInputRect = UIKit_UpdateTextInputRect; + device->UpdateTextInputArea = UIKit_UpdateTextInputArea; #endif device->SetClipboardText = UIKit_SetClipboardText; diff --git a/src/video/uikit/SDL_uikitviewcontroller.h b/src/video/uikit/SDL_uikitviewcontroller.h index 670c174fef681..cfd8767dba63c 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.h +++ b/src/video/uikit/SDL_uikitviewcontroller.h @@ -91,5 +91,5 @@ SDL_bool UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this); void UIKit_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); void UIKit_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window); -int UIKit_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +int UIKit_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); #endif diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 1027b8d883146..0d69f50fbb44e 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -623,7 +623,7 @@ SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) } } -int UIKit_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) +int UIKit_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_uikitviewcontroller *vc = GetWindowViewController(window); diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c index 481e706cb2943..7f8d55e60a8f2 100644 --- a/src/video/wayland/SDL_waylandkeyboard.c +++ b/src/video/wayland/SDL_waylandkeyboard.c @@ -83,7 +83,7 @@ int Wayland_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) WAYLAND_xkb_compose_state_reset(input->xkb.compose_state); } - return Wayland_UpdateTextInputRect(_this, window); + return Wayland_UpdateTextInputArea(_this, window); } int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) @@ -110,7 +110,7 @@ int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) return 0; } -int Wayland_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) +int Wayland_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { SDL_VideoData *driverdata = _this->driverdata; if (driverdata->text_input_manager) { @@ -130,7 +130,7 @@ int Wayland_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) #ifdef SDL_USE_IME else { - SDL_IME_UpdateTextRect(window); + SDL_IME_UpdateTextInputArea(window); } #endif return 0; diff --git a/src/video/wayland/SDL_waylandkeyboard.h b/src/video/wayland/SDL_waylandkeyboard.h index b42bb11b91a14..8550aec2b44de 100644 --- a/src/video/wayland/SDL_waylandkeyboard.h +++ b/src/video/wayland/SDL_waylandkeyboard.h @@ -34,7 +34,7 @@ extern int Wayland_InitKeyboard(SDL_VideoDevice *_this); extern void Wayland_QuitKeyboard(SDL_VideoDevice *_this); extern int Wayland_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); extern int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); -extern int Wayland_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +extern int Wayland_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool Wayland_HasScreenKeyboardSupport(SDL_VideoDevice *_this); #endif /* SDL_waylandkeyboard_h_ */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 893fd1bd9ad16..6f07959e25937 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -511,7 +511,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) device->HasClipboardData = Wayland_HasClipboardData; device->StartTextInput = Wayland_StartTextInput; device->StopTextInput = Wayland_StopTextInput; - device->UpdateTextInputRect = Wayland_UpdateTextInputRect; + device->UpdateTextInputArea = Wayland_UpdateTextInputArea; #ifdef SDL_VIDEO_VULKAN device->Vulkan_LoadLibrary = Wayland_Vulkan_LoadLibrary; diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 76973f0079de8..80016fea2c3bf 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -36,10 +36,10 @@ #else #define SDL_DebugIMELog(...) #endif -static int IME_Init(SDL_VideoData *videodata, HWND hwnd); +static int IME_Init(SDL_VideoData *videodata, SDL_Window *window); static void IME_Enable(SDL_VideoData *videodata, HWND hwnd); static void IME_Disable(SDL_VideoData *videodata, HWND hwnd); -static void IME_SetTextInputRect(SDL_VideoData *videodata, const SDL_Rect *rect); +static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, int cursor); static void IME_Quit(SDL_VideoData *videodata); #endif /* !SDL_DISABLE_WINDOWS_IME */ @@ -208,10 +208,10 @@ int WIN_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) #ifndef SDL_DISABLE_WINDOWS_IME HWND hwnd = window->driverdata->hwnd; SDL_VideoData *videodata = _this->driverdata; - IME_Init(videodata, hwnd); + IME_Init(videodata, window); IME_Enable(videodata, hwnd); - WIN_UpdateTextInputRect(_this, window); + WIN_UpdateTextInputArea(_this, window); #endif /* !SDL_DISABLE_WINDOWS_IME */ return 0; @@ -224,19 +224,19 @@ int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) #ifndef SDL_DISABLE_WINDOWS_IME HWND hwnd = window->driverdata->hwnd; SDL_VideoData *videodata = _this->driverdata; - IME_Init(videodata, hwnd); + IME_Init(videodata, window); IME_Disable(videodata, hwnd); #endif /* !SDL_DISABLE_WINDOWS_IME */ return 0; } -int WIN_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) +int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { #ifndef SDL_DISABLE_WINDOWS_IME SDL_VideoData *data = _this->driverdata; - IME_SetTextInputRect(data, &window->text_input_rect); + IME_SetTextInputArea(data, &window->text_input_rect, window->text_input_cursor); #endif /* !SDL_DISABLE_WINDOWS_IME */ return 0; @@ -313,7 +313,7 @@ DEFINE_GUID(IID_ITfThreadMgrEx, 0x3E90ADE3, 0x7594, 0x4CB0, 0xBB, 0x58, 0x69, 0x static void IME_UpdateInputLocale(SDL_VideoData *videodata); static void IME_ClearComposition(SDL_VideoData *videodata); -static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd); +static void IME_SetWindow(SDL_VideoData *videodata, SDL_Window *window); static void IME_SetupAPI(SDL_VideoData *videodata); static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex); static void IME_SendEditingEvent(SDL_VideoData *videodata); @@ -329,8 +329,9 @@ static SDL_bool WIN_ShouldShowNativeUI() return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_TRUE); } -static int IME_Init(SDL_VideoData *videodata, HWND hwnd) +static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) { + HWND hwnd = window->driverdata->hwnd; HRESULT hResult = S_OK; if (videodata->ime_initialized) { @@ -360,7 +361,7 @@ static int IME_Init(SDL_VideoData *videodata, HWND hwnd) videodata->ImmUnlockIMCC = (BOOL (WINAPI *)(HIMCC))SDL_LoadFunction(videodata->ime_himm32, "ImmUnlockIMCC"); /* *INDENT-ON* */ /* clang-format on */ - IME_SetWindow(videodata, hwnd); + IME_SetWindow(videodata, window); videodata->ime_himc = ImmGetContext(hwnd); ImmReleaseContext(hwnd, videodata->ime_himc); if (!videodata->ime_himc) { @@ -678,9 +679,16 @@ static void IME_SetupAPI(SDL_VideoData *videodata) } } -static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd) +static void IME_SetWindow(SDL_VideoData *videodata, SDL_Window *window) { - videodata->ime_hwnd_current = hwnd; + HWND hwnd = window->driverdata->hwnd; + + if (hwnd != videodata->ime_hwnd_current) { + videodata->ime_hwnd_current = hwnd; + SDL_zero(videodata->ime_composition_area); + SDL_zero(videodata->ime_candidate_area); + } + if (videodata->ime_threadmgr) { struct ITfDocumentMgr *document_mgr = 0; if (SUCCEEDED(videodata->ime_threadmgr->lpVtbl->AssociateFocus(videodata->ime_threadmgr, hwnd, NULL, &document_mgr))) { @@ -689,42 +697,45 @@ static void IME_SetWindow(SDL_VideoData *videodata, HWND hwnd) } } } - IME_SetTextInputRect(videodata, &videodata->ime_rect); + + IME_SetTextInputArea(videodata, &window->text_input_rect, window->text_input_cursor); } -static void IME_SetTextInputRect(SDL_VideoData *videodata, const SDL_Rect *rect) +static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, int cursor) { - HIMC himc = 0; - - if (SDL_memcmp(rect, &videodata->ime_rect, sizeof(*rect)) == 0) { - return; - } - - videodata->ime_rect = *rect; + HIMC himc; himc = ImmGetContext(videodata->ime_hwnd_current); if (himc) { COMPOSITIONFORM cof; CANDIDATEFORM caf; + SDL_zero(cof); cof.dwStyle = CFS_RECT; - cof.ptCurrentPos.x = videodata->ime_rect.x; - cof.ptCurrentPos.y = videodata->ime_rect.y; - cof.rcArea.left = videodata->ime_rect.x; - cof.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; - cof.rcArea.top = videodata->ime_rect.y; - cof.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; - ImmSetCompositionWindow(himc, &cof); + cof.ptCurrentPos.x = rect->x + cursor; + cof.ptCurrentPos.y = rect->y; + cof.rcArea.left = rect->x; + cof.rcArea.right = (LONG)rect->x + rect->w; + cof.rcArea.top = rect->y; + cof.rcArea.bottom = (LONG)rect->y + rect->h; + if (SDL_memcmp(&cof, &videodata->ime_composition_area, sizeof(cof)) != 0) { + SDL_copyp(&videodata->ime_composition_area, &cof); + ImmSetCompositionWindow(himc, &cof); + } + SDL_zero(caf); caf.dwIndex = 0; caf.dwStyle = CFS_EXCLUDE; - caf.ptCurrentPos.x = videodata->ime_rect.x; - caf.ptCurrentPos.y = videodata->ime_rect.y; - caf.rcArea.left = videodata->ime_rect.x; - caf.rcArea.right = (LONG)videodata->ime_rect.x + videodata->ime_rect.w; - caf.rcArea.top = videodata->ime_rect.y; - caf.rcArea.bottom = (LONG)videodata->ime_rect.y + videodata->ime_rect.h; - ImmSetCandidateWindow(himc, &caf); + caf.ptCurrentPos.x = rect->x + cursor; + caf.ptCurrentPos.y = rect->y; + caf.rcArea.left = rect->x; + caf.rcArea.right = (LONG)rect->x + rect->w; + caf.rcArea.top = rect->y; + caf.rcArea.bottom = (LONG)rect->y + rect->h; + if (SDL_memcmp(&caf, &videodata->ime_candidate_area, sizeof(caf)) != 0) { + SDL_copyp(&videodata->ime_candidate_area, &caf); + ImmSetCandidateWindow(himc, &caf); + } ImmReleaseContext(videodata->ime_hwnd_current, himc); } diff --git a/src/video/windows/SDL_windowskeyboard.h b/src/video/windows/SDL_windowskeyboard.h index 0c614b5488789..e62ce045f87cc 100644 --- a/src/video/windows/SDL_windowskeyboard.h +++ b/src/video/windows/SDL_windowskeyboard.h @@ -31,7 +31,7 @@ extern void WIN_ResetDeadKeys(void); extern int WIN_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); extern int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); -extern int WIN_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +extern int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); extern int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 889f5e58aba39..688bc04b6a9bd 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -268,7 +268,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void) #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) device->StartTextInput = WIN_StartTextInput; device->StopTextInput = WIN_StopTextInput; - device->UpdateTextInputRect = WIN_UpdateTextInputRect; + device->UpdateTextInputArea = WIN_UpdateTextInputArea; device->ClearComposition = WIN_ClearComposition; device->SetClipboardData = WIN_SetClipboardData; @@ -281,7 +281,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void) device->StartTextInput = GDK_StartTextInput; device->StopTextInput = GDK_StopTextInput; - device->SetTextInputRect = GDK_SetTextInputRect; + device->SetTextInputArea = GDK_SetTextInputArea; device->ClearComposition = GDK_ClearComposition; device->HasScreenKeyboardSupport = GDK_HasScreenKeyboardSupport; diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 97d196a08838b..3d078619ad30c 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -447,7 +447,8 @@ struct SDL_VideoData int ime_candlistindexbase; SDL_bool ime_horizontal_candidates; - SDL_Rect ime_rect; + COMPOSITIONFORM ime_composition_area; + CANDIDATEFORM ime_candidate_area; HKL ime_hkl; void *ime_himm32; diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 560d316ca2c7f..daf6d9379881b 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1293,7 +1293,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) #ifdef SDL_USE_IME if (SDL_TextInputActive(data->window)) { /* Update IME candidate list position */ - SDL_IME_UpdateTextRect(NULL); + SDL_IME_UpdateTextInputArea(NULL); } #endif for (w = data->window->first_child; w; w = w->next_sibling) { diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 6f7a6d3e0c362..eed27218f3070 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -448,7 +448,7 @@ int X11_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { X11_ResetXIM(_this, window); - return X11_UpdateTextInputRect(_this, window); + return X11_UpdateTextInputArea(_this, window); } int X11_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) @@ -460,10 +460,10 @@ int X11_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) return 0; } -int X11_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window) +int X11_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_USE_IME - SDL_IME_UpdateTextRect(window); + SDL_IME_UpdateTextInputArea(window); #endif return 0; } diff --git a/src/video/x11/SDL_x11keyboard.h b/src/video/x11/SDL_x11keyboard.h index 7fe7384496c72..60e96af0bd570 100644 --- a/src/video/x11/SDL_x11keyboard.h +++ b/src/video/x11/SDL_x11keyboard.h @@ -28,7 +28,7 @@ extern void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event); extern void X11_QuitKeyboard(SDL_VideoDevice *_this); extern int X11_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window); extern int X11_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); -extern int X11_UpdateTextInputRect(SDL_VideoDevice *_this, SDL_Window *window); +extern int X11_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); extern SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this); extern void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); extern void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index aba3cfc728129..4f59aaeda56bf 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -267,7 +267,7 @@ static SDL_VideoDevice *X11_CreateDevice(void) device->HasPrimarySelectionText = X11_HasPrimarySelectionText; device->StartTextInput = X11_StartTextInput; device->StopTextInput = X11_StopTextInput; - device->UpdateTextInputRect = X11_UpdateTextInputRect; + device->UpdateTextInputArea = X11_UpdateTextInputArea; device->HasScreenKeyboardSupport = X11_HasScreenKeyboardSupport; device->ShowScreenKeyboard = X11_ShowScreenKeyboard; device->HideScreenKeyboard = X11_HideScreenKeyboard; diff --git a/test/checkkeys.c b/test/checkkeys.c index 052a7b98d6ad6..36aa88d439817 100644 --- a/test/checkkeys.c +++ b/test/checkkeys.c @@ -73,23 +73,21 @@ static void UpdateTextWindowInputRect(SDL_WindowID id) SDLTest_TextWindow *textwindow = windowstates[i].textwindow; int w, h; SDL_Rect rect; + int cursor = 0; int current = textwindow->current; const char *current_line = textwindow->lines[current]; SDL_GetWindowSize(state->windows[i], &w, &h); - rect.x = (int)TEXT_WINDOW_OFFSET_X; if (current_line) { - rect.x += (int)SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; + cursor = (int)SDL_utf8strlen(current_line) * FONT_CHARACTER_SIZE; } + + rect.x = (int)TEXT_WINDOW_OFFSET_X; rect.y = (int)TEXT_WINDOW_OFFSET_Y + current * FONT_LINE_HEIGHT; -#if 1 - rect.w = FONT_CHARACTER_SIZE; -#else rect.w = (int)(w - (2 * TEXT_WINDOW_OFFSET_X)); -#endif - rect.h = FONT_LINE_HEIGHT; - SDL_SetTextInputRect(state->windows[i], &rect); + rect.h = FONT_CHARACTER_SIZE; + SDL_SetTextInputArea(state->windows[i], &rect, cursor); return; } } diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index d15d170520cd3..25a4d9b7f6849 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -361,14 +361,14 @@ static int keyboard_startStopTextInput(void *arg) return TEST_COMPLETED; } -/* Internal function to test SDL_SetTextInputRect */ -static void testSetTextInputRect(SDL_Window *window, SDL_Rect refRect) +/* Internal function to test SDL_SetTextInputArea */ +static void testSetTextInputArea(SDL_Window *window, SDL_Rect refRect) { SDL_Rect testRect; testRect = refRect; - SDL_SetTextInputRect(window, &testRect); - SDLTest_AssertPass("Call to SDL_SetTextInputRect with refRect(x:%d,y:%d,w:%d,h:%d)", refRect.x, refRect.y, refRect.w, refRect.h); + SDL_SetTextInputArea(window, &testRect, 0); + SDLTest_AssertPass("Call to SDL_SetTextInputArea with refRect(x:%d,y:%d,w:%d,h:%d)", refRect.x, refRect.y, refRect.w, refRect.h); SDLTest_AssertCheck( (refRect.x == testRect.x) && (refRect.y == testRect.y) && (refRect.w == testRect.w) && (refRect.h == testRect.h), "Check that input data was not modified, expected: x:%d,y:%d,w:%d,h:%d, got: x:%d,y:%d,w:%d,h:%d", @@ -377,11 +377,11 @@ static void testSetTextInputRect(SDL_Window *window, SDL_Rect refRect) } /** - * Check call to SDL_SetTextInputRect + * Check call to SDL_SetTextInputArea * - * \sa SDL_SetTextInputRect + * \sa SDL_SetTextInputArea */ -static int keyboard_setTextInputRect(void *arg) +static int keyboard_setTextInputArea(void *arg) { SDL_Window *window = SDL_GetKeyboardFocus(); SDL_Rect refRect; @@ -391,77 +391,77 @@ static int keyboard_setTextInputRect(void *arg) refRect.y = SDLTest_RandomIntegerInRange(1, 50); refRect.w = SDLTest_RandomIntegerInRange(10, 50); refRect.h = SDLTest_RandomIntegerInRange(10, 50); - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* Normal visible refRect, origin 0,0 */ refRect.x = 0; refRect.y = 0; refRect.w = SDLTest_RandomIntegerInRange(10, 50); refRect.h = SDLTest_RandomIntegerInRange(10, 50); - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* 1Pixel refRect */ refRect.x = SDLTest_RandomIntegerInRange(10, 50); refRect.y = SDLTest_RandomIntegerInRange(10, 50); refRect.w = 1; refRect.h = 1; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* 0pixel refRect */ refRect.x = 1; refRect.y = 1; refRect.w = 1; refRect.h = 0; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* 0pixel refRect */ refRect.x = 1; refRect.y = 1; refRect.w = 0; refRect.h = 1; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* 0pixel refRect */ refRect.x = 1; refRect.y = 1; refRect.w = 0; refRect.h = 0; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* 0pixel refRect */ refRect.x = 0; refRect.y = 0; refRect.w = 0; refRect.h = 0; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* negative refRect */ refRect.x = SDLTest_RandomIntegerInRange(-200, -100); refRect.y = SDLTest_RandomIntegerInRange(-200, -100); refRect.w = 50; refRect.h = 50; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* oversized refRect */ refRect.x = SDLTest_RandomIntegerInRange(1, 50); refRect.y = SDLTest_RandomIntegerInRange(1, 50); refRect.w = 5000; refRect.h = 5000; - testSetTextInputRect(window, refRect); + testSetTextInputArea(window, refRect); /* NULL refRect */ - SDL_SetTextInputRect(window, NULL); - SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); + SDL_SetTextInputArea(window, NULL, 0); + SDLTest_AssertPass("Call to SDL_SetTextInputArea(NULL)"); return TEST_COMPLETED; } /** - * Check call to SDL_SetTextInputRect with invalid data + * Check call to SDL_SetTextInputArea with invalid data * - * \sa SDL_SetTextInputRect + * \sa SDL_SetTextInputArea */ -static int keyboard_setTextInputRectNegative(void *arg) +static int keyboard_setTextInputAreaNegative(void *arg) { /* Some platforms set also an error message; prepare for checking it */ #if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_ANDROID) || defined(SDL_VIDEO_DRIVER_COCOA) @@ -473,8 +473,8 @@ static int keyboard_setTextInputRectNegative(void *arg) #endif /* NULL refRect */ - SDL_SetTextInputRect(SDL_GetKeyboardFocus(), NULL); - SDLTest_AssertPass("Call to SDL_SetTextInputRect(NULL)"); + SDL_SetTextInputArea(SDL_GetKeyboardFocus(), NULL, 0); + SDLTest_AssertPass("Call to SDL_SetTextInputArea(NULL)"); /* Some platforms set also an error message; so check it */ #if defined(SDL_VIDEO_DRIVER_WINDOWS) || defined(SDL_VIDEO_DRIVER_ANDROID) || defined(SDL_VIDEO_DRIVER_COCOA) @@ -666,11 +666,11 @@ static const SDLTest_TestCaseReference keyboardTest7 = { }; static const SDLTest_TestCaseReference keyboardTest8 = { - (SDLTest_TestCaseFp)keyboard_setTextInputRect, "keyboard_setTextInputRect", "Check call to SDL_SetTextInputRect", TEST_ENABLED + (SDLTest_TestCaseFp)keyboard_setTextInputArea, "keyboard_setTextInputArea", "Check call to SDL_SetTextInputArea", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest9 = { - (SDLTest_TestCaseFp)keyboard_setTextInputRectNegative, "keyboard_setTextInputRectNegative", "Check call to SDL_SetTextInputRect with invalid data", TEST_ENABLED + (SDLTest_TestCaseFp)keyboard_setTextInputAreaNegative, "keyboard_setTextInputAreaNegative", "Check call to SDL_SetTextInputArea with invalid data", TEST_ENABLED }; static const SDLTest_TestCaseReference keyboardTest10 = { diff --git a/test/testime.c b/test/testime.c index 0adb9e2242e5e..24d3006537af4 100644 --- a/test/testime.c +++ b/test/testime.c @@ -457,6 +457,8 @@ static Uint32 utf8_decode(char *p, size_t len) static void InitInput(void) { + int i; + /* Prepare a rect for text input */ textRect.x = textRect.y = 100.0f; textRect.w = DEFAULT_WINDOW_WIDTH - 2 * textRect.x; @@ -466,7 +468,9 @@ static void InitInput(void) markedRect = textRect; markedText[0] = 0; - SDL_StartTextInput(state->windows[0]); + for (i = 0; i < state->num_windows; ++i) { + SDL_StartTextInput(state->windows[i]); + } } @@ -649,6 +653,18 @@ static void DrawCandidates(int rendererID, SDL_FRect *cursorRect) } } +static void UpdateTextInputArea(SDL_Window *window, const SDL_FRect *cursorRect) +{ + SDL_Rect rect; + int cursor_offset = (int)(cursorRect->x - textRect.x); + + rect.x = (int)textRect.x; + rect.y = (int)textRect.y; + rect.w = (int)textRect.w; + rect.h = (int)textRect.h; + SDL_SetTextInputArea(window, &rect, cursor_offset); +} + static void CleanupVideo(void) { SDL_StopTextInput(state->windows[0]); @@ -827,16 +843,8 @@ static void RedrawWindow(int rendererID) /* Draw the candidates */ DrawCandidates(rendererID, &cursorRect); - { - SDL_Rect inputrect; - - /* The input rect is a square at the cursor insertion point */ - inputrect.x = (int)cursorRect.x; - inputrect.y = (int)cursorRect.y; - inputrect.w = (int)cursorRect.h; - inputrect.h = (int)cursorRect.h; - SDL_SetTextInputRect(state->windows[0], &inputrect); - } + /* Update the area used to draw composition UI */ + UpdateTextInputArea(state->windows[0], &cursorRect); } static void Redraw(void) From d9d7104feb8c8c286f62922582c0c0600589a88f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 15:10:19 -0700 Subject: [PATCH 103/431] Removed unneeded Text Services Framework code from IME handling We can get the candidate list in uiless mode using ImmGetCandidateListW() once message processing has completed --- src/video/windows/SDL_windowsevents.c | 4 +- src/video/windows/SDL_windowskeyboard.c | 513 +++++------------------- src/video/windows/SDL_windowskeyboard.h | 3 +- src/video/windows/SDL_windowsvideo.h | 9 +- 4 files changed, 115 insertions(+), 414 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 533e21cbd77d3..3af82457774c1 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1051,7 +1051,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara #endif /* WMMSG_DEBUG */ #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - if (IME_HandleMessage(hwnd, msg, wParam, &lParam, data->videodata)) { + if (WIN_HandleIMEMessage(hwnd, msg, wParam, &lParam, data->videodata)) { return 0; } #endif @@ -2302,6 +2302,8 @@ void WIN_PumpEvents(SDL_VideoDevice *_this) #endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ + WIN_UpdateIMECandidates(_this); + #ifdef SDL_PLATFORM_GDK GDK_DispatchTaskQueue(); #endif diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 80016fea2c3bf..95d6c3ea1bcf4 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -40,6 +40,8 @@ static int IME_Init(SDL_VideoData *videodata, SDL_Window *window); static void IME_Enable(SDL_VideoData *videodata, HWND hwnd); static void IME_Disable(SDL_VideoData *videodata, HWND hwnd); static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, int cursor); +static void IME_ClearComposition(SDL_VideoData *videodata); +static void IME_GetCandidateList(SDL_VideoData *videodata, HWND hwnd); static void IME_Quit(SDL_VideoData *videodata); #endif /* !SDL_DISABLE_WINDOWS_IME */ @@ -59,10 +61,6 @@ void WIN_InitKeyboard(SDL_VideoDevice *_this) data->ime_candlistindexbase = 1; data->ime_composition_length = 32 * sizeof(WCHAR); data->ime_composition = (WCHAR *)SDL_calloc(data->ime_composition_length, sizeof(WCHAR)); - data->ime_uielemsinkcookie = TF_INVALID_COOKIE; - data->ime_alpnsinkcookie = TF_INVALID_COOKIE; - data->ime_openmodesinkcookie = TF_INVALID_COOKIE; - data->ime_convmodesinkcookie = TF_INVALID_COOKIE; #endif /* !SDL_DISABLE_WINDOWS_IME */ WIN_UpdateKeymap(SDL_FALSE); @@ -242,39 +240,29 @@ int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) return 0; } -#ifdef SDL_DISABLE_WINDOWS_IME - int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) { +#ifndef SDL_DISABLE_WINDOWS_IME + SDL_VideoData *videodata = _this->driverdata; + + IME_ClearComposition(videodata); +#endif return 0; } -SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) +#ifdef SDL_DISABLE_WINDOWS_IME + +SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { return SDL_FALSE; } -#else +void WIN_UpdateIMECandidates(SDL_VideoDevice *_this) +{ + return; +} -#ifdef SDL_msctf_h_ -#define USE_INIT_GUID -#elif defined(__GNUC__) -#define USE_INIT_GUID -#endif -#ifdef USE_INIT_GUID -#undef DEFINE_GUID -#define DEFINE_GUID(n, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) static const GUID n = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } -DEFINE_GUID(IID_ITfInputProcessorProfileActivationSink, 0x71C6E74E, 0x0F28, 0x11D8, 0xA8, 0x2A, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); -DEFINE_GUID(IID_ITfUIElementSink, 0xEA1EA136, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); -DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD, 0x34745C63, 0xB2F0, 0x4784, 0x8B, 0x67, 0x5E, 0x12, 0xC8, 0x70, 0x1A, 0x31); -DEFINE_GUID(IID_ITfSource, 0x4EA48A35, 0x60AE, 0x446F, 0x8F, 0xD6, 0xE6, 0xA8, 0xD8, 0x24, 0x59, 0xF7); -DEFINE_GUID(IID_ITfUIElementMgr, 0xEA1EA135, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); -DEFINE_GUID(IID_ITfCandidateListUIElement, 0xEA1EA138, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); -DEFINE_GUID(IID_ITfReadingInformationUIElement, 0xEA1EA139, 0x19DF, 0x11D7, 0xA6, 0xD2, 0x00, 0x06, 0x5B, 0x84, 0x43, 0x5C); -DEFINE_GUID(IID_ITfThreadMgr, 0xAA80E801, 0x2021, 0x11D2, 0x93, 0xE0, 0x00, 0x60, 0xB0, 0x67, 0xB8, 0x6E); -DEFINE_GUID(CLSID_TF_ThreadMgr, 0x529A9E6B, 0x6587, 0x4F23, 0xAB, 0x9E, 0x9C, 0x7D, 0x68, 0x3E, 0x3C, 0x50); -DEFINE_GUID(IID_ITfThreadMgrEx, 0x3E90ADE3, 0x7594, 0x4CB0, 0xBB, 0x58, 0x69, 0x62, 0x8F, 0x5F, 0x45, 0x8C); -#endif +#else #define LANG_CHT MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL) #define LANG_CHS MAKELANGID(LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED) @@ -312,18 +300,12 @@ DEFINE_GUID(IID_ITfThreadMgrEx, 0x3E90ADE3, 0x7594, 0x4CB0, 0xBB, 0x58, 0x69, 0x #define SUBLANG() SUBLANGID(LANG()) static void IME_UpdateInputLocale(SDL_VideoData *videodata); -static void IME_ClearComposition(SDL_VideoData *videodata); static void IME_SetWindow(SDL_VideoData *videodata, SDL_Window *window); static void IME_SetupAPI(SDL_VideoData *videodata); static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex); static void IME_SendEditingEvent(SDL_VideoData *videodata); static void IME_SendClearComposition(SDL_VideoData *videodata); -static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata); -static void UILess_ReleaseSinks(SDL_VideoData *videodata); -static void UILess_EnableUIUpdates(SDL_VideoData *videodata); -static void UILess_DisableUIUpdates(SDL_VideoData *videodata); - static SDL_bool WIN_ShouldShowNativeUI() { return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_TRUE); @@ -332,21 +314,12 @@ static SDL_bool WIN_ShouldShowNativeUI() static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) { HWND hwnd = window->driverdata->hwnd; - HRESULT hResult = S_OK; if (videodata->ime_initialized) { return 0; } videodata->ime_hwnd_main = hwnd; - if (SUCCEEDED(WIN_CoInitialize())) { - videodata->ime_com_initialized = SDL_TRUE; - hResult = CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgr, (LPVOID *)&videodata->ime_threadmgr); - if (hResult != S_OK) { - videodata->ime_available = SDL_FALSE; - return SDL_SetError("CoCreateInstance() failed, HRESULT is %08X", (unsigned int)hResult); - } - } videodata->ime_initialized = SDL_TRUE; videodata->ime_himm32 = SDL_LoadObject("imm32.dll"); if (!videodata->ime_himm32) { @@ -375,7 +348,7 @@ static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) if (WIN_ShouldShowNativeUI()) { videodata->ime_uiless = SDL_FALSE; } else { - videodata->ime_uiless = UILess_SetupSinks(videodata); + videodata->ime_uiless = SDL_TRUE; } IME_UpdateInputLocale(videodata); IME_Disable(videodata, hwnd); @@ -398,7 +371,6 @@ static void IME_Enable(SDL_VideoData *videodata, HWND hwnd) videodata->ime_enabled = SDL_TRUE; IME_UpdateInputLocale(videodata); - UILess_EnableUIUpdates(videodata); } static void IME_Disable(SDL_VideoData *videodata, HWND hwnd) @@ -413,7 +385,6 @@ static void IME_Disable(SDL_VideoData *videodata, HWND hwnd) } videodata->ime_enabled = SDL_FALSE; - UILess_DisableUIUpdates(videodata); } static void IME_Quit(SDL_VideoData *videodata) @@ -422,7 +393,6 @@ static void IME_Quit(SDL_VideoData *videodata) return; } - UILess_ReleaseSinks(videodata); if (videodata->ime_hwnd_main) { ImmAssociateContext(videodata->ime_hwnd_main, videodata->ime_himc); } @@ -433,14 +403,6 @@ static void IME_Quit(SDL_VideoData *videodata) SDL_UnloadObject(videodata->ime_himm32); videodata->ime_himm32 = 0; } - if (videodata->ime_threadmgr) { - videodata->ime_threadmgr->lpVtbl->Release(videodata->ime_threadmgr); - videodata->ime_threadmgr = 0; - } - if (videodata->ime_com_initialized) { - WIN_CoUninitialize(); - videodata->ime_com_initialized = SDL_FALSE; - } for (int i = 0; i < videodata->ime_candcount; ++i) { SDL_free(videodata->ime_candidates[i]); videodata->ime_candidates[i] = NULL; @@ -459,10 +421,6 @@ static void IME_GetReadingString(SDL_VideoData *videodata, HWND hwnd) BOOL vertical = FALSE; UINT maxuilen = 0; - if (videodata->ime_uiless) { - return; - } - videodata->ime_readingstring[0] = 0; id = IME_GetId(videodata, 0); @@ -554,9 +512,6 @@ static void IME_InputLangChanged(SDL_VideoData *videodata) { UINT lang = PRIMLANG(); IME_UpdateInputLocale(videodata); - if (!videodata->ime_uiless) { - videodata->ime_candlistindexbase = (videodata->ime_hkl == CHT_HKL_DAYI) ? 0 : 1; - } IME_SetupAPI(videodata); if (lang != PRIMLANG()) { @@ -647,11 +602,8 @@ static void IME_SetupAPI(SDL_VideoData *videodata) char ime_file[MAX_PATH + 1]; void *hime = 0; HKL hkl = 0; - videodata->GetReadingString = 0; - videodata->ShowReadingWindow = 0; - if (videodata->ime_uiless) { - return; - } + videodata->GetReadingString = NULL; + videodata->ShowReadingWindow = NULL; hkl = videodata->ime_hkl; if (!ImmGetIMEFileNameA(hkl, ime_file, sizeof(ime_file) - 1)) { @@ -689,15 +641,6 @@ static void IME_SetWindow(SDL_VideoData *videodata, SDL_Window *window) SDL_zero(videodata->ime_candidate_area); } - if (videodata->ime_threadmgr) { - struct ITfDocumentMgr *document_mgr = 0; - if (SUCCEEDED(videodata->ime_threadmgr->lpVtbl->AssociateFocus(videodata->ime_threadmgr, hwnd, NULL, &document_mgr))) { - if (document_mgr) { - document_mgr->lpVtbl->Release(document_mgr); - } - } - } - IME_SetTextInputArea(videodata, &window->text_input_rect, window->text_input_cursor); } @@ -751,6 +694,7 @@ static void IME_UpdateInputLocale(SDL_VideoData *videodata) videodata->ime_hkl = hklnext; videodata->ime_horizontal_candidates = (PRIMLANG() == LANG_KOREAN || LANG() == LANG_CHS); + videodata->ime_candlistindexbase = (videodata->ime_hkl == CHT_HKL_DAYI) ? 0 : 1; } static void IME_ClearComposition(SDL_VideoData *videodata) @@ -766,9 +710,7 @@ static void IME_ClearComposition(SDL_VideoData *videodata) } ImmNotifyIME(himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); - if (videodata->ime_uiless) { - ImmSetCompositionString(himc, SCS_SETSTR, TEXT(""), sizeof(TCHAR), TEXT(""), sizeof(TCHAR)); - } + ImmSetCompositionString(himc, SCS_SETSTR, TEXT(""), sizeof(TCHAR), TEXT(""), sizeof(TCHAR)); ImmNotifyIME(himc, NI_CLOSECANDIDATE, 0, 0); ImmReleaseContext(videodata->ime_hwnd_current, himc); @@ -924,7 +866,6 @@ static int IME_OpenCandidateList(SDL_VideoData *videodata) return 0; } - static void IME_AddCandidate(SDL_VideoData *videodata, UINT i, LPCWSTR candidate) { if (videodata->ime_candidates[i]) { @@ -960,10 +901,83 @@ static void IME_CloseCandidateList(SDL_VideoData *videodata) } } -SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) +static void IME_GetCandidateList(SDL_VideoData *videodata, HWND hwnd) +{ + HIMC himc; + DWORD size; + LPCANDIDATELIST cand_list; + SDL_bool has_candidates = SDL_FALSE; + + himc = ImmGetContext(hwnd); + if (himc) { + size = ImmGetCandidateListW(himc, 0, NULL, 0); + if (size != 0) { + cand_list = (LPCANDIDATELIST)SDL_malloc(size); + if (cand_list != NULL) { + size = ImmGetCandidateListW(himc, 0, cand_list, size); + if (size != 0) { + if (IME_OpenCandidateList(videodata) == 0) { + UINT i, j; + UINT page_start = 0; + UINT page_size = 0; + + videodata->ime_candsel = cand_list->dwSelection; + + if (LANG() == LANG_CHS && IME_GetId(videodata, 0)) { + const UINT maxcandchar = 18; + size_t cchars = 0; + + for (i = 0; i < cand_list->dwCount; ++i) { + size_t len = SDL_wcslen((LPWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i])) + 1; + if (len + cchars > maxcandchar) { + if (i > cand_list->dwSelection) { + break; + } + + page_start = i; + cchars = len; + } else { + cchars += len; + } + } + page_size = i - page_start; + } else { + page_size = SDL_min(cand_list->dwPageSize == 0 ? MAX_CANDLIST : cand_list->dwPageSize, MAX_CANDLIST); + page_start = (cand_list->dwSelection / page_size) * page_size; + } + for (i = page_start, j = 0; (DWORD)i < cand_list->dwCount && j < page_size; i++, j++) { + LPCWSTR candidate = (LPCWSTR)((DWORD_PTR)cand_list + cand_list->dwOffset[i]); + IME_AddCandidate(videodata, j, candidate); + } + + has_candidates = SDL_TRUE; + IME_SendCandidateList(videodata); + } + } + SDL_free(cand_list); + } + } + ImmReleaseContext(hwnd, himc); + } + + if (!has_candidates) { + IME_CloseCandidateList(videodata); + } +} + +SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata) { SDL_bool trap = SDL_FALSE; HIMC himc = 0; + + if (msg == WM_IME_SETCONTEXT) { + SDL_DebugIMELog("WM_IME_SETCONTEXT\n"); + if (videodata->ime_uiless) { + *lParam = 0; + } + return SDL_FALSE; + } + if (!videodata->ime_initialized || !videodata->ime_available || !videodata->ime_enabled) { return SDL_FALSE; } @@ -981,12 +995,6 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S SDL_DebugIMELog("WM_INPUTLANGCHANGE\n"); IME_InputLangChanged(videodata); break; - case WM_IME_SETCONTEXT: - SDL_DebugIMELog("WM_IME_SETCONTEXT\n"); - if (videodata->ime_uiless) { - *lParam = 0; - } - break; case WM_IME_STARTCOMPOSITION: SDL_DebugIMELog("WM_IME_STARTCOMPOSITION\n"); trap = SDL_TRUE; @@ -1003,10 +1011,7 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S } if (*lParam & GCS_COMPSTR) { SDL_DebugIMELog("GCS_COMPSTR\n"); - if (!videodata->ime_uiless) { - videodata->ime_readingstring[0] = 0; - } - + videodata->ime_readingstring[0] = 0; IME_GetCompositionString(videodata, himc, GCS_COMPSTR); IME_SendEditingEvent(videodata); } @@ -1038,11 +1043,18 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S case IMN_OPENCANDIDATE: case IMN_CHANGECANDIDATE: SDL_DebugIMELog("%s\n", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); - trap = SDL_TRUE; + if (videodata->ime_uiless) { + videodata->ime_update_candidates = SDL_TRUE; + trap = SDL_TRUE; + } break; case IMN_CLOSECANDIDATE: SDL_DebugIMELog("IMN_CLOSECANDIDATE\n"); - trap = SDL_TRUE; + if (videodata->ime_uiless) { + videodata->ime_update_candidates = SDL_FALSE; + IME_CloseCandidateList(videodata); + trap = SDL_TRUE; + } break; case IMN_PRIVATE: { @@ -1080,323 +1092,16 @@ SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, S return trap; } -static void UILess_GetCandidateList(SDL_VideoData *videodata, ITfCandidateListUIElement *pcandlist) +void WIN_UpdateIMECandidates(SDL_VideoDevice *_this) { - UINT selection = 0; - UINT count = 0; - UINT page = 0; - UINT pgcount = 0; - DWORD pgstart = 0; - DWORD pgsize = 0; - UINT i, j; - - if (IME_OpenCandidateList(videodata) < 0) { - return; - } - - pcandlist->lpVtbl->GetSelection(pcandlist, &selection); - pcandlist->lpVtbl->GetCount(pcandlist, &count); - pcandlist->lpVtbl->GetCurrentPage(pcandlist, &page); - - pcandlist->lpVtbl->GetPageIndex(pcandlist, NULL, 0, &pgcount); - if (pgcount > 0) { - UINT *idxlist = SDL_malloc(sizeof(UINT) * pgcount); - if (idxlist) { - pcandlist->lpVtbl->GetPageIndex(pcandlist, idxlist, pgcount, &pgcount); - pgstart = idxlist[page]; - if (page < pgcount - 1) { - pgsize = SDL_min(count, idxlist[page + 1]) - pgstart; - } else { - pgsize = count - pgstart; - } - - SDL_free(idxlist); - } - } - pgsize = SDL_min(pgsize, MAX_CANDLIST); - videodata->ime_candsel = selection - pgstart; - for (i = pgstart, j = 0; (DWORD)i < count && j < pgsize; i++, j++) { - BSTR bstr; - if (SUCCEEDED(pcandlist->lpVtbl->GetString(pcandlist, i, &bstr))) { - if (bstr) { - IME_AddCandidate(videodata, j, bstr); - SysFreeString(bstr); - } - } - } - - IME_SendCandidateList(videodata); -} - -STDMETHODIMP_(ULONG) -TSFSink_AddRef(TSFSink *sink) -{ - return ++sink->refcount; -} - -STDMETHODIMP_(ULONG) -TSFSink_Release(TSFSink *sink) -{ - --sink->refcount; - if (sink->refcount == 0) { - SDL_free(sink); - return 0; - } - return sink->refcount; -} - -STDMETHODIMP UIElementSink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv) -{ - if (!ppv) { - return E_INVALIDARG; - } - - *ppv = 0; - if (WIN_IsEqualIID(riid, &IID_IUnknown)) { - *ppv = (IUnknown *)sink; - } else if (WIN_IsEqualIID(riid, &IID_ITfUIElementSink)) { - *ppv = (ITfUIElementSink *)sink; - } - - if (*ppv) { - TSFSink_AddRef(sink); - return S_OK; - } - return E_NOINTERFACE; -} - -ITfUIElement *UILess_GetUIElement(SDL_VideoData *videodata, DWORD dwUIElementId) -{ - ITfUIElementMgr *puiem = 0; - ITfUIElement *pelem = 0; - ITfThreadMgrEx *threadmgrex = videodata->ime_threadmgrex; - - if (SUCCEEDED(threadmgrex->lpVtbl->QueryInterface(threadmgrex, &IID_ITfUIElementMgr, (LPVOID *)&puiem))) { - puiem->lpVtbl->GetUIElement(puiem, dwUIElementId, &pelem); - puiem->lpVtbl->Release(puiem); - } - return pelem; -} - -STDMETHODIMP UIElementSink_BeginUIElement(TSFSink *sink, DWORD dwUIElementId, BOOL *pbShow) -{ - ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId); - ITfReadingInformationUIElement *preading = 0; - ITfCandidateListUIElement *pcandlist = 0; - SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - if (!element) { - return E_INVALIDARG; - } - - *pbShow = FALSE; - if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) { - BSTR bstr; - if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) { - SysFreeString(bstr); - } - preading->lpVtbl->Release(preading); - } else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { - videodata->ime_candref++; - UILess_GetCandidateList(videodata, pcandlist); - pcandlist->lpVtbl->Release(pcandlist); - } - return S_OK; -} - -STDMETHODIMP UIElementSink_UpdateUIElement(TSFSink *sink, DWORD dwUIElementId) -{ - ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId); - ITfReadingInformationUIElement *preading = 0; - ITfCandidateListUIElement *pcandlist = 0; - SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - if (!element) { - return E_INVALIDARG; - } - - if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) { - BSTR bstr; - if (SUCCEEDED(preading->lpVtbl->GetString(preading, &bstr)) && bstr) { - WCHAR *s = (WCHAR *)bstr; - SDL_wcslcpy(videodata->ime_readingstring, s, SDL_arraysize(videodata->ime_readingstring)); - IME_SendEditingEvent(videodata); - SysFreeString(bstr); - } - preading->lpVtbl->Release(preading); - } else if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { - UILess_GetCandidateList(videodata, pcandlist); - pcandlist->lpVtbl->Release(pcandlist); - } - return S_OK; -} - -STDMETHODIMP UIElementSink_EndUIElement(TSFSink *sink, DWORD dwUIElementId) -{ - ITfUIElement *element = UILess_GetUIElement((SDL_VideoData *)sink->data, dwUIElementId); - ITfReadingInformationUIElement *preading = 0; - ITfCandidateListUIElement *pcandlist = 0; - SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - if (!element) { - return E_INVALIDARG; - } - - if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfReadingInformationUIElement, (LPVOID *)&preading))) { - videodata->ime_readingstring[0] = 0; - IME_SendEditingEvent(videodata); - preading->lpVtbl->Release(preading); - } - if (SUCCEEDED(element->lpVtbl->QueryInterface(element, &IID_ITfCandidateListUIElement, (LPVOID *)&pcandlist))) { - videodata->ime_candref--; - if (videodata->ime_candref == 0) { - IME_CloseCandidateList(videodata); - } - - pcandlist->lpVtbl->Release(pcandlist); - } - return S_OK; -} - -STDMETHODIMP IPPASink_QueryInterface(TSFSink *sink, REFIID riid, PVOID *ppv) -{ - if (!ppv) { - return E_INVALIDARG; - } - - *ppv = 0; - if (WIN_IsEqualIID(riid, &IID_IUnknown)) { - *ppv = (IUnknown *)sink; - } else if (WIN_IsEqualIID(riid, &IID_ITfInputProcessorProfileActivationSink)) { - *ppv = (ITfInputProcessorProfileActivationSink *)sink; - } - - if (*ppv) { - TSFSink_AddRef(sink); - return S_OK; - } - return E_NOINTERFACE; -} - -STDMETHODIMP IPPASink_OnActivated(TSFSink *sink, DWORD dwProfileType, LANGID langid, REFCLSID clsid, REFGUID catid, REFGUID guidProfile, HKL hkl, DWORD dwFlags) -{ - static const GUID SDL_TF_PROFILE_DAYI = { 0x037B2C25, 0x480C, 0x4D7F, { 0xB0, 0x27, 0xD6, 0xCA, 0x6B, 0x69, 0x78, 0x8A } }; - SDL_VideoData *videodata = (SDL_VideoData *)sink->data; - videodata->ime_candlistindexbase = WIN_IsEqualGUID(&SDL_TF_PROFILE_DAYI, guidProfile) ? 0 : 1; - if (WIN_IsEqualIID(catid, &GUID_TFCAT_TIP_KEYBOARD) && (dwFlags & TF_IPSINK_FLAG_ACTIVE)) { - IME_InputLangChanged((SDL_VideoData *)sink->data); - } - - IME_CloseCandidateList(videodata); - return S_OK; -} - -static void *vtUIElementSink[] = { - (void *)(UIElementSink_QueryInterface), - (void *)(TSFSink_AddRef), - (void *)(TSFSink_Release), - (void *)(UIElementSink_BeginUIElement), - (void *)(UIElementSink_UpdateUIElement), - (void *)(UIElementSink_EndUIElement) -}; - -static void *vtIPPASink[] = { - (void *)(IPPASink_QueryInterface), - (void *)(TSFSink_AddRef), - (void *)(TSFSink_Release), - (void *)(IPPASink_OnActivated) -}; - -static void UILess_EnableUIUpdates(SDL_VideoData *videodata) -{ - ITfSource *source = 0; - if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie != TF_INVALID_COOKIE) { - return; - } - - if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { - source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie); - source->lpVtbl->Release(source); - } -} - -static void UILess_DisableUIUpdates(SDL_VideoData *videodata) -{ - ITfSource *source = 0; - if (!videodata->ime_threadmgrex || videodata->ime_uielemsinkcookie == TF_INVALID_COOKIE) { - return; - } - - if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { - source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie); - videodata->ime_uielemsinkcookie = TF_INVALID_COOKIE; - source->lpVtbl->Release(source); - } -} - -static SDL_bool UILess_SetupSinks(SDL_VideoData *videodata) -{ - TfClientId clientid = 0; - SDL_bool result = SDL_FALSE; - ITfSource *source = 0; - if (FAILED(CoCreateInstance(&CLSID_TF_ThreadMgr, NULL, CLSCTX_INPROC_SERVER, &IID_ITfThreadMgrEx, (LPVOID *)&videodata->ime_threadmgrex))) { - return SDL_FALSE; - } - - if (FAILED(videodata->ime_threadmgrex->lpVtbl->ActivateEx(videodata->ime_threadmgrex, &clientid, TF_TMAE_UIELEMENTENABLEDONLY))) { - return SDL_FALSE; - } - - videodata->ime_uielemsink = (TSFSink *)SDL_malloc(sizeof(TSFSink)); - videodata->ime_ippasink = (TSFSink *)SDL_malloc(sizeof(TSFSink)); - - videodata->ime_uielemsink->lpVtbl = vtUIElementSink; - videodata->ime_uielemsink->refcount = 1; - videodata->ime_uielemsink->data = videodata; - - videodata->ime_ippasink->lpVtbl = vtIPPASink; - videodata->ime_ippasink->refcount = 1; - videodata->ime_ippasink->data = videodata; - - if (SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { - if (SUCCEEDED(source->lpVtbl->AdviseSink(source, &IID_ITfUIElementSink, (IUnknown *)videodata->ime_uielemsink, &videodata->ime_uielemsinkcookie))) { - if (SUCCEEDED(source->lpVtbl->AdviseSink(source, &IID_ITfInputProcessorProfileActivationSink, (IUnknown *)videodata->ime_ippasink, &videodata->ime_alpnsinkcookie))) { - result = SDL_TRUE; - } - } - source->lpVtbl->Release(source); - } - return result; -} - -#define SAFE_RELEASE(p) \ - { \ - if (p) { \ - (p)->lpVtbl->Release((p)); \ - (p) = 0; \ - } \ - } + SDL_VideoData *videodata = _this->driverdata; -static void UILess_ReleaseSinks(SDL_VideoData *videodata) -{ - ITfSource *source = 0; - if (videodata->ime_threadmgrex && SUCCEEDED(videodata->ime_threadmgrex->lpVtbl->QueryInterface(videodata->ime_threadmgrex, &IID_ITfSource, (LPVOID *)&source))) { - source->lpVtbl->UnadviseSink(source, videodata->ime_uielemsinkcookie); - source->lpVtbl->UnadviseSink(source, videodata->ime_alpnsinkcookie); - SAFE_RELEASE(source); - videodata->ime_threadmgrex->lpVtbl->Deactivate(videodata->ime_threadmgrex); - SAFE_RELEASE(videodata->ime_threadmgrex); - TSFSink_Release(videodata->ime_uielemsink); - videodata->ime_uielemsink = 0; - TSFSink_Release(videodata->ime_ippasink); - videodata->ime_ippasink = 0; + if (videodata->ime_update_candidates) { + IME_GetCandidateList(videodata, videodata->ime_hwnd_current); + videodata->ime_update_candidates = SDL_FALSE; } } -int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) -{ - SDL_VideoData *videodata = _this->driverdata; - IME_ClearComposition(videodata); - return 0; -} - #endif /* SDL_DISABLE_WINDOWS_IME */ #endif /* SDL_VIDEO_DRIVER_WINDOWS */ diff --git a/src/video/windows/SDL_windowskeyboard.h b/src/video/windows/SDL_windowskeyboard.h index e62ce045f87cc..15de35f208c46 100644 --- a/src/video/windows/SDL_windowskeyboard.h +++ b/src/video/windows/SDL_windowskeyboard.h @@ -34,6 +34,7 @@ extern int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window); extern int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window); extern int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window); -extern SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata); +extern SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, struct SDL_VideoData *videodata); +extern void WIN_UpdateIMECandidates(SDL_VideoDevice *_this); #endif /* SDL_windowskeyboard_h_ */ diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 3d078619ad30c..c2cf4677aa027 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -423,7 +423,6 @@ struct SDL_VideoData #ifndef SDL_DISABLE_WINDOWS_IME SDL_bool ime_com_initialized; - struct ITfThreadMgr *ime_threadmgr; SDL_bool ime_initialized; SDL_bool ime_enabled; SDL_bool ime_available; @@ -440,6 +439,7 @@ struct SDL_VideoData int ime_selected_length; SDL_bool ime_candidates_open; + SDL_bool ime_update_candidates; char *ime_candidates[MAX_CANDLIST]; int ime_candcount; DWORD ime_candref; @@ -462,13 +462,6 @@ struct SDL_VideoData /* *INDENT-ON* */ /* clang-format on */ SDL_bool ime_uiless; - struct ITfThreadMgrEx *ime_threadmgrex; - DWORD ime_uielemsinkcookie; - DWORD ime_alpnsinkcookie; - DWORD ime_openmodesinkcookie; - DWORD ime_convmodesinkcookie; - TSFSink *ime_uielemsink; - TSFSink *ime_ippasink; #endif /* !SDL_DISABLE_WINDOWS_IME */ BYTE pre_hook_key_state[256]; From 4c7db129df3f6d56a809826a6fa76375dca422f6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 16:14:52 -0700 Subject: [PATCH 104/431] SDL_HINT_IME_INTERNAL_EDITING and SDL_HINT_IME_SHOW_UI are replaced with SDL_HINT_IME_NATIVE_UI --- docs/README-migration.md | 2 + include/SDL3/SDL_hints.h | 31 +++----- src/core/linux/SDL_fcitx.c | 17 ++-- src/core/linux/SDL_ibus.c | 18 +++-- src/video/windows/SDL_windowskeyboard.c | 101 +++++++++++++++--------- src/video/windows/SDL_windowsvideo.h | 5 +- test/testime.c | 21 ++++- 7 files changed, 119 insertions(+), 76 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 122983b4997e4..15bb9650a2ec5 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -757,6 +757,8 @@ The following hints have been removed: * SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS - gamepad buttons are always positional * SDL_HINT_GRAB_KEYBOARD - use SDL_SetWindowKeyboardGrab() instead * SDL_HINT_IDLE_TIMER_DISABLED - use SDL_DisableScreenSaver() instead +* SDL_HINT_IME_INTERNAL_EDITING - replaced with SDL_HINT_IME_NATIVE_UI +* SDL_HINT_IME_SHOW_UI - replaced with SDL_HINT_IME_NATIVE_UI * SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text * SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer * SDL_HINT_PS2_DYNAMIC_VSYNC - use SDL_SetRenderVSync(renderer, -1) instead diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 3a5e026375502..07e2ea82fbc73 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -943,37 +943,26 @@ extern "C" { #define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES" /** - * A variable to control whether certain IMEs should handle text editing - * internally instead of sending SDL_EVENT_TEXT_EDITING events. + * A variable describing what IME elements the OS should render natively over the game. * - * The variable can be set to the following values: - * - * - "0": SDL_EVENT_TEXT_EDITING events are sent, and it is the application's - * responsibility to render the text from these events and differentiate it - * somehow from committed text. (default) - * - "1": If supported by the IME then SDL_EVENT_TEXT_EDITING events are not - * sent, and text that is being composed will be rendered in its own UI. + * By default IME UI is handled using native components by the OS, however this interferes with fullscreen games in some cases. * - * This hint can be set anytime. + * The variable can be set to a comma separated list containing the following items: * - * \since This hint is available since SDL 3.0.0. - */ -#define SDL_HINT_IME_INTERNAL_EDITING "SDL_IME_INTERNAL_EDITING" - -/** - * A variable to control whether certain IMEs should show native UI components - * (such as the Candidate List) instead of suppressing them. + * - "none" or "0": Native UI elements will not be displayed. + * - "composition": Native UI elements will be used for the IME composition string. + * - "candidates": Native UI elements will be used for the IME candidate list. + * - "all" or "1": Native UI elements will be used for all IME UI. (default) * - * The variable can be set to the following values: + * If native UI is used for the composition string, then SDL_EVENT_TEXT_EDITING will not be sent. * - * - "0": Native UI components are not display. - * - "1": Native UI components are displayed. (default) + * If native UI is used for the candidates list, then SDL_EVENT_TEXT_EDITING_CANDIDATES will not be sent. * * This hint should be set before SDL is initialized. * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_IME_SHOW_UI "SDL_IME_SHOW_UI" +#define SDL_HINT_IME_NATIVE_UI "SDL_IME_NATIVE_UI" /** * A variable controlling whether the home indicator bar on iPhone X should be diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 41895fa221e0a..44b1bb54df6e2 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -229,7 +229,7 @@ static void FcitxClientICCallMethod(FcitxClient *client, const char *method) static void SDLCALL Fcitx_SetCapabilities(void *data, const char *name, const char *old_val, - const char *internal_editing) + const char *hint) { FcitxClient *client = (FcitxClient *)data; Uint64 caps = 0; @@ -237,9 +237,16 @@ static void SDLCALL Fcitx_SetCapabilities(void *data, return; } - if (!(internal_editing && *internal_editing == '1')) { - caps |= (1 << 1); /* Preedit Flag */ - caps |= (1 << 4); /* Formatted Preedit Flag */ + if (!hint || !*hint || *hint == '1' || SDL_strstr(hint, "all")) { + // Let the OS handle IME UI + } else { + if (!SDL_strstr(hint, "composition")) { + caps |= (1 << 1); /* Preedit Flag */ + caps |= (1 << 4); /* Formatted Preedit Flag */ + } + if (!SDL_strstr(hint, "candidates")) { + // FIXME, turn off native candidate rendering + } } SDL_DBus_CallVoidMethod(FCITX_DBUS_SERVICE, client->ic_path, FCITX_IC_DBUS_INTERFACE, "SetCapability", DBUS_TYPE_UINT64, &caps, DBUS_TYPE_INVALID); @@ -300,7 +307,7 @@ static SDL_bool FcitxClientCreateIC(FcitxClient *client) NULL); dbus->connection_flush(dbus->session_conn); - SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, Fcitx_SetCapabilities, client); + SDL_AddHintCallback(SDL_HINT_IME_NATIVE_UI, Fcitx_SetCapabilities, client); return SDL_TRUE; } diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index ed73cc5bd82fb..c34ebc96c6f28 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -404,14 +404,22 @@ static char *IBus_GetDBusAddressFilename(void) static SDL_bool IBus_CheckConnection(SDL_DBusContext *dbus); static void SDLCALL IBus_SetCapabilities(void *data, const char *name, const char *old_val, - const char *internal_editing) + const char *hint) { SDL_DBusContext *dbus = SDL_DBus_GetContext(); if (IBus_CheckConnection(dbus)) { Uint32 caps = IBUS_CAP_FOCUS; - if (!(internal_editing && *internal_editing == '1')) { - caps |= IBUS_CAP_PREEDIT_TEXT; + + if (!hint || !*hint || *hint == '1' || SDL_strstr(hint, "all")) { + // Let the OS handle IME UI + } else { + if (!SDL_strstr(hint, "composition")) { + caps |= IBUS_CAP_PREEDIT_TEXT; + } + if (!SDL_strstr(hint, "candidates")) { + // FIXME, turn off native candidate rendering + } } SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCapabilities", @@ -474,7 +482,7 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr) (void)SDL_snprintf(matchstr, sizeof(matchstr), "type='signal',interface='%s'", ibus_input_interface); SDL_free(input_ctx_path); input_ctx_path = SDL_strdup(path); - SDL_AddHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL); + SDL_AddHintCallback(SDL_HINT_IME_NATIVE_UI, IBus_SetCapabilities, NULL); dbus->bus_add_match(ibus_conn, matchstr, NULL); dbus->connection_try_register_object_path(ibus_conn, input_ctx_path, &ibus_vtable, dbus, NULL); dbus->connection_flush(ibus_conn); @@ -631,7 +639,7 @@ void SDL_IBus_Quit(void) /* !!! FIXME: should we close(inotify_fd) here? */ - SDL_DelHintCallback(SDL_HINT_IME_INTERNAL_EDITING, IBus_SetCapabilities, NULL); + SDL_DelHintCallback(SDL_HINT_IME_NATIVE_UI, IBus_SetCapabilities, NULL); SDL_memset(&ibus_cursor_rect, 0, sizeof(ibus_cursor_rect)); } diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 95d6c3ea1bcf4..d654699bf2d5c 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -306,11 +306,6 @@ static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex); static void IME_SendEditingEvent(SDL_VideoData *videodata); static void IME_SendClearComposition(SDL_VideoData *videodata); -static SDL_bool WIN_ShouldShowNativeUI() -{ - return SDL_GetHintBoolean(SDL_HINT_IME_SHOW_UI, SDL_TRUE); -} - static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) { HWND hwnd = window->driverdata->hwnd; @@ -319,6 +314,19 @@ static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) return 0; } + const char *hint = SDL_GetHint(SDL_HINT_IME_NATIVE_UI); + if (!hint || !*hint || *hint == '1' || SDL_strstr(hint, "all")) { + videodata->ime_native_composition = SDL_TRUE; + videodata->ime_native_candidates = SDL_TRUE; + } else { + if (SDL_strstr(hint, "composition")) { + videodata->ime_native_composition = SDL_TRUE; + } + if (SDL_strstr(hint, "candidates")) { + videodata->ime_native_candidates = SDL_TRUE; + } + } + videodata->ime_hwnd_main = hwnd; videodata->ime_initialized = SDL_TRUE; videodata->ime_himm32 = SDL_LoadObject("imm32.dll"); @@ -345,11 +353,6 @@ static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) videodata->ime_available = SDL_TRUE; IME_UpdateInputLocale(videodata); IME_SetupAPI(videodata); - if (WIN_ShouldShowNativeUI()) { - videodata->ime_uiless = SDL_FALSE; - } else { - videodata->ime_uiless = SDL_TRUE; - } IME_UpdateInputLocale(videodata); IME_Disable(videodata, hwnd); return 0; @@ -541,7 +544,8 @@ static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex) SDL_assert(uIndex == 0); dwLang = ((DWORD_PTR)hkl & 0xffff); - if (videodata->ime_uiless && dwLang == LANG_CHT) { + // FIXME: What does this do? + if (!videodata->ime_native_candidates && dwLang == LANG_CHT) { dwRet[0] = IMEID_CHT_VER_VISTA; dwRet[1] = 0; return dwRet[0]; @@ -972,9 +976,21 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam if (msg == WM_IME_SETCONTEXT) { SDL_DebugIMELog("WM_IME_SETCONTEXT\n"); - if (videodata->ime_uiless) { - *lParam = 0; + + LPARAM element_mask; + if (!videodata->ime_native_composition && !videodata->ime_native_candidates) { + element_mask = 0; + } else { + element_mask = ISC_SHOWUIALL; + if (!videodata->ime_native_composition) { + element_mask &= ~ISC_SHOWUICOMPOSITIONWINDOW; + } + if (!videodata->ime_native_candidates) { + element_mask &= ~ISC_SHOWUIALLCANDIDATEWINDOW; + } } + *lParam &= element_mask; + return SDL_FALSE; } @@ -997,34 +1013,41 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam break; case WM_IME_STARTCOMPOSITION: SDL_DebugIMELog("WM_IME_STARTCOMPOSITION\n"); - trap = SDL_TRUE; + if (!videodata->ime_native_composition) { + trap = SDL_TRUE; + } break; case WM_IME_COMPOSITION: SDL_DebugIMELog("WM_IME_COMPOSITION %x\n", lParam); - trap = SDL_TRUE; - himc = ImmGetContext(hwnd); - if (*lParam & GCS_RESULTSTR) { - SDL_DebugIMELog("GCS_RESULTSTR\n"); - IME_GetCompositionString(videodata, himc, GCS_RESULTSTR); - IME_SendClearComposition(videodata); - IME_SendInputEvent(videodata); - } - if (*lParam & GCS_COMPSTR) { - SDL_DebugIMELog("GCS_COMPSTR\n"); - videodata->ime_readingstring[0] = 0; - IME_GetCompositionString(videodata, himc, GCS_COMPSTR); - IME_SendEditingEvent(videodata); + if (!videodata->ime_native_composition) { + trap = SDL_TRUE; + himc = ImmGetContext(hwnd); + if (*lParam & GCS_RESULTSTR) { + SDL_DebugIMELog("GCS_RESULTSTR\n"); + IME_GetCompositionString(videodata, himc, GCS_RESULTSTR); + IME_SendClearComposition(videodata); + IME_SendInputEvent(videodata); + } + if (*lParam & GCS_COMPSTR) { + SDL_DebugIMELog("GCS_COMPSTR\n"); + videodata->ime_readingstring[0] = 0; + IME_GetCompositionString(videodata, himc, GCS_COMPSTR); + IME_SendEditingEvent(videodata); + } + ImmReleaseContext(hwnd, himc); } - ImmReleaseContext(hwnd, himc); break; case WM_IME_ENDCOMPOSITION: SDL_DebugIMELog("WM_IME_ENDCOMPOSITION\n"); - videodata->ime_composition[0] = 0; - videodata->ime_readingstring[0] = 0; - videodata->ime_cursor = 0; - videodata->ime_selected_start = 0; - videodata->ime_selected_length = 0; - IME_SendClearComposition(videodata); + if (!videodata->ime_native_composition) { + trap = SDL_TRUE; + videodata->ime_composition[0] = 0; + videodata->ime_readingstring[0] = 0; + videodata->ime_cursor = 0; + videodata->ime_selected_start = 0; + videodata->ime_selected_length = 0; + IME_SendClearComposition(videodata); + } break; case WM_IME_NOTIFY: SDL_DebugIMELog("WM_IME_NOTIFY %x\n", wParam); @@ -1043,24 +1066,24 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam case IMN_OPENCANDIDATE: case IMN_CHANGECANDIDATE: SDL_DebugIMELog("%s\n", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); - if (videodata->ime_uiless) { - videodata->ime_update_candidates = SDL_TRUE; + if (!videodata->ime_native_candidates) { trap = SDL_TRUE; + videodata->ime_update_candidates = SDL_TRUE; } break; case IMN_CLOSECANDIDATE: SDL_DebugIMELog("IMN_CLOSECANDIDATE\n"); - if (videodata->ime_uiless) { + if (!videodata->ime_native_candidates) { + trap = SDL_TRUE; videodata->ime_update_candidates = SDL_FALSE; IME_CloseCandidateList(videodata); - trap = SDL_TRUE; } break; case IMN_PRIVATE: { DWORD dwId = IME_GetId(videodata, 0); - IME_GetReadingString(videodata, hwnd); SDL_DebugIMELog("IMN_PRIVATE %u\n", dwId); + IME_GetReadingString(videodata, hwnd); switch (dwId) { case IMEID_CHT_VER42: case IMEID_CHT_VER43: diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index c2cf4677aa027..7f74a27779ff3 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -339,7 +339,6 @@ typedef struct void *data; } TSFSink; -#ifndef SDL_DISABLE_WINDOWS_IME /* Definition from Win98DDK version of IMM.H */ typedef struct tagINPUTCONTEXT2 { @@ -365,7 +364,6 @@ typedef struct tagINPUTCONTEXT2 DWORD fdwInit; DWORD dwReserve[3]; } INPUTCONTEXT2, *PINPUTCONTEXT2, NEAR *NPINPUTCONTEXT2, FAR *LPINPUTCONTEXT2; -#endif /* !SDL_DISABLE_WINDOWS_IME */ /* Private display data */ @@ -461,7 +459,8 @@ struct SDL_VideoData BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc); /* *INDENT-ON* */ /* clang-format on */ - SDL_bool ime_uiless; + SDL_bool ime_native_composition; + SDL_bool ime_native_candidates; #endif /* !SDL_DISABLE_WINDOWS_IME */ BYTE pre_hook_key_state[256]; diff --git a/test/testime.c b/test/testime.c index 24d3006537af4..1ed6e0cb9d304 100644 --- a/test/testime.c +++ b/test/testime.c @@ -867,6 +867,8 @@ static void Redraw(void) int main(int argc, char *argv[]) { + SDL_bool native_composition = SDL_TRUE; + SDL_bool native_candidates = SDL_TRUE; int i, done; SDL_Event event; char *fontname = NULL; @@ -890,12 +892,15 @@ int main(int argc, char *argv[]) fontname = argv[i + 1]; consumed = 2; } - } else if (SDL_strcmp(argv[i], "--disable-ui") == 0) { - SDL_SetHint(SDL_HINT_IME_SHOW_UI, "0"); + } else if (SDL_strcmp(argv[i], "--disable-native-composition") == 0) { + native_composition = SDL_FALSE; + consumed = 1; + } else if (SDL_strcmp(argv[i], "--disable-native-candidates") == 0) { + native_candidates = SDL_FALSE; consumed = 1; } if (consumed <= 0) { - static const char *options[] = { "[--font fontfile] [--disable-ui]", NULL }; + static const char *options[] = { "[--font fontfile] [--disable-native-composition] [--disable-native-candidates]", NULL }; SDLTest_CommonLogUsage(state, argv[0], options); return 1; } @@ -903,6 +908,16 @@ int main(int argc, char *argv[]) i += consumed; } + if (native_composition && native_candidates) { + SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "1"); + } else if (native_composition) { + SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "composition"); + } else if (native_candidates) { + SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "candidates"); + } else { + SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "0"); + } + if (!SDLTest_CommonInit(state)) { return 2; } From a7d4f0a76c310a36f2cafa0211be70bcbe068090 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 17:08:54 -0700 Subject: [PATCH 105/431] Center the composition text in the text input area --- src/video/windows/SDL_windowskeyboard.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index d654699bf2d5c..52e162aff0e34 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -656,11 +656,17 @@ static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, if (himc) { COMPOSITIONFORM cof; CANDIDATEFORM caf; + int font_height = rect->h; + + LOGFONTW font; + if (ImmGetCompositionFontW(himc, &font)) { + font_height = font.lfHeight; + } SDL_zero(cof); cof.dwStyle = CFS_RECT; cof.ptCurrentPos.x = rect->x + cursor; - cof.ptCurrentPos.y = rect->y; + cof.ptCurrentPos.y = rect->y + (rect->h - font_height) / 2; cof.rcArea.left = rect->x; cof.rcArea.right = (LONG)rect->x + rect->w; cof.rcArea.top = rect->y; @@ -1055,6 +1061,9 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam case IMN_SETCOMPOSITIONWINDOW: SDL_DebugIMELog("IMN_SETCOMPOSITIONWINDOW\n"); break; + case IMN_SETCOMPOSITIONFONT: + SDL_DebugIMELog("IMN_SETCOMPOSITIONFONT\n"); + break; case IMN_SETCANDIDATEPOS: SDL_DebugIMELog("IMN_SETCANDIDATEPOS\n"); break; From 9332de9f258c3c9238c6f85d71e00d70c5f2a661 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 29 Jun 2024 00:09:51 +0000 Subject: [PATCH 106/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 18 ++++++++++++------ include/SDL3/SDL_keyboard.h | 15 ++++++++++----- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 07e2ea82fbc73..08c8b37a1ccec 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -943,20 +943,26 @@ extern "C" { #define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES" /** - * A variable describing what IME elements the OS should render natively over the game. + * A variable describing what IME elements the OS should render natively over + * the game. * - * By default IME UI is handled using native components by the OS, however this interferes with fullscreen games in some cases. + * By default IME UI is handled using native components by the OS, however + * this interferes with fullscreen games in some cases. * - * The variable can be set to a comma separated list containing the following items: + * The variable can be set to a comma separated list containing the following + * items: * * - "none" or "0": Native UI elements will not be displayed. - * - "composition": Native UI elements will be used for the IME composition string. + * - "composition": Native UI elements will be used for the IME composition + * string. * - "candidates": Native UI elements will be used for the IME candidate list. * - "all" or "1": Native UI elements will be used for all IME UI. (default) * - * If native UI is used for the composition string, then SDL_EVENT_TEXT_EDITING will not be sent. + * If native UI is used for the composition string, then + * SDL_EVENT_TEXT_EDITING will not be sent. * - * If native UI is used for the candidates list, then SDL_EVENT_TEXT_EDITING_CANDIDATES will not be sent. + * If native UI is used for the candidates list, then + * SDL_EVENT_TEXT_EDITING_CANDIDATES will not be sent. * * This hint should be set before SDL is initialized. * diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 50ee5927da9e6..232cde110f691 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -420,11 +420,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearComposition(SDL_Window *window); /** * Set the area used to type Unicode text input. * - * Native input methods may place a window with word suggestions near the cursor, without covering the text being entered. + * Native input methods may place a window with word suggestions near the + * cursor, without covering the text being entered. * * \param window the window for which to set the text input area. - * \param rect the SDL_Rect representing the text input area, in window coordinates, or NULL to clear it. - * \param cursor the offset of the current cursor location relative to `rect->x`, in window coordinates. + * \param rect the SDL_Rect representing the text input area, in window + * coordinates, or NULL to clear it. + * \param cursor the offset of the current cursor location relative to + * `rect->x`, in window coordinates. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -441,8 +444,10 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextInputArea(SDL_Window *window, const S * This returns the values previously set by SDL_SetTextInputArea(). * * \param window the window for which to query the text input area. - * \param rect a pointer to an SDL_Rect filled in with the text input area, may be NULL. - * \param cursor a pointer to the offset of the current cursor location relative to `rect->x`, may be NULL. + * \param rect a pointer to an SDL_Rect filled in with the text input area, + * may be NULL. + * \param cursor a pointer to the offset of the current cursor location + * relative to `rect->x`, may be NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * From e47179c4c7f084cf769e4c675c1c165889f2cbfb Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 18:00:48 -0700 Subject: [PATCH 107/431] We should still set the text input area if SDL_DISABLE_WINDOWS_IME is defined Fixes https://github.com/libsdl-org/SDL/issues/6254 --- src/video/windows/SDL_windowskeyboard.c | 24 ++++++++++++++---------- src/video/windows/SDL_windowsvideo.h | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 52e162aff0e34..cba4f59f8c295 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -39,10 +39,12 @@ static int IME_Init(SDL_VideoData *videodata, SDL_Window *window); static void IME_Enable(SDL_VideoData *videodata, HWND hwnd); static void IME_Disable(SDL_VideoData *videodata, HWND hwnd); -static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, int cursor); +static void IME_SetTextInputArea(SDL_VideoData *videodata, HWND hwnd, const SDL_Rect *rect, int cursor); static void IME_ClearComposition(SDL_VideoData *videodata); static void IME_GetCandidateList(SDL_VideoData *videodata, HWND hwnd); static void IME_Quit(SDL_VideoData *videodata); +#else +static void IME_SetTextInputArea(SDL_VideoData *videodata, HWND hwnd, const SDL_Rect *rect, int cursor); #endif /* !SDL_DISABLE_WINDOWS_IME */ #ifndef MAPVK_VK_TO_VSC @@ -231,12 +233,10 @@ int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { -#ifndef SDL_DISABLE_WINDOWS_IME - SDL_VideoData *data = _this->driverdata; - - IME_SetTextInputArea(data, &window->text_input_rect, window->text_input_cursor); -#endif /* !SDL_DISABLE_WINDOWS_IME */ + SDL_VideoData *videodata = _this->driverdata; + SDL_WindowData *data = window->driverdata; + IME_SetTextInputArea(videodata, data->hwnd, &window->text_input_rect, window->text_input_cursor); return 0; } @@ -645,14 +645,16 @@ static void IME_SetWindow(SDL_VideoData *videodata, SDL_Window *window) SDL_zero(videodata->ime_candidate_area); } - IME_SetTextInputArea(videodata, &window->text_input_rect, window->text_input_cursor); + IME_SetTextInputArea(videodata, hwnd, &window->text_input_rect, window->text_input_cursor); } -static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, int cursor) +#endif + +static void IME_SetTextInputArea(SDL_VideoData *videodata, HWND hwnd, const SDL_Rect *rect, int cursor) { HIMC himc; - himc = ImmGetContext(videodata->ime_hwnd_current); + himc = ImmGetContext(hwnd); if (himc) { COMPOSITIONFORM cof; CANDIDATEFORM caf; @@ -690,10 +692,12 @@ static void IME_SetTextInputArea(SDL_VideoData *videodata, const SDL_Rect *rect, ImmSetCandidateWindow(himc, &caf); } - ImmReleaseContext(videodata->ime_hwnd_current, himc); + ImmReleaseContext(hwnd, himc); } } +#ifndef SDL_DISABLE_WINDOWS_IME + static void IME_UpdateInputLocale(SDL_VideoData *videodata) { HKL hklnext = GetKeyboardLayout(0); diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 7f74a27779ff3..5a07f1a100b72 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -420,7 +420,6 @@ struct SDL_VideoData Uint32 raw_input_enabled; #ifndef SDL_DISABLE_WINDOWS_IME - SDL_bool ime_com_initialized; SDL_bool ime_initialized; SDL_bool ime_enabled; SDL_bool ime_available; @@ -444,10 +443,12 @@ struct SDL_VideoData DWORD ime_candsel; int ime_candlistindexbase; SDL_bool ime_horizontal_candidates; +#endif COMPOSITIONFORM ime_composition_area; CANDIDATEFORM ime_candidate_area; +#ifndef SDL_DISABLE_WINDOWS_IME HKL ime_hkl; void *ime_himm32; /* *INDENT-OFF* */ /* clang-format off */ From 212a491f7c1db477b29b89630d87575d64097c99 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 19:22:16 -0700 Subject: [PATCH 108/431] Renamed SDL_HINT_IME_NATIVE_UI to SDL_HINT_IME_IMPLEMENTED_UI This inverts the logic to make more sense from an application perspective. --- docs/README-migration.md | 4 +-- include/SDL3/SDL_hints.h | 22 +++++----------- src/core/linux/SDL_fcitx.c | 18 +++++-------- src/core/linux/SDL_ibus.c | 18 +++++-------- src/video/windows/SDL_windowskeyboard.c | 35 +++++++++++-------------- src/video/windows/SDL_windowsvideo.h | 4 +-- test/testime.c | 28 +++++++++----------- 7 files changed, 52 insertions(+), 77 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 15bb9650a2ec5..39f3d44a1407c 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -757,8 +757,8 @@ The following hints have been removed: * SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS - gamepad buttons are always positional * SDL_HINT_GRAB_KEYBOARD - use SDL_SetWindowKeyboardGrab() instead * SDL_HINT_IDLE_TIMER_DISABLED - use SDL_DisableScreenSaver() instead -* SDL_HINT_IME_INTERNAL_EDITING - replaced with SDL_HINT_IME_NATIVE_UI -* SDL_HINT_IME_SHOW_UI - replaced with SDL_HINT_IME_NATIVE_UI +* SDL_HINT_IME_INTERNAL_EDITING - replaced with SDL_HINT_IME_IMPLEMENTED_UI +* SDL_HINT_IME_SHOW_UI - replaced with SDL_HINT_IME_IMPLEMENTED_UI * SDL_HINT_IME_SUPPORT_EXTENDED_TEXT - the normal text editing event has extended text * SDL_HINT_MOUSE_RELATIVE_SCALING - mouse coordinates are no longer automatically scaled by the SDL renderer * SDL_HINT_PS2_DYNAMIC_VSYNC - use SDL_SetRenderVSync(renderer, -1) instead diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 08c8b37a1ccec..2f0ec2a8e9df0 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -943,32 +943,22 @@ extern "C" { #define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES" /** - * A variable describing what IME elements the OS should render natively over - * the game. + * A variable describing what IME UI elements the application can display. * - * By default IME UI is handled using native components by the OS, however - * this interferes with fullscreen games in some cases. + * By default IME UI is handled using native components by the OS where possible, however this can interfere with or not be visible when exclusive fullscreen mode is used. * * The variable can be set to a comma separated list containing the following * items: * - * - "none" or "0": Native UI elements will not be displayed. - * - "composition": Native UI elements will be used for the IME composition - * string. - * - "candidates": Native UI elements will be used for the IME candidate list. - * - "all" or "1": Native UI elements will be used for all IME UI. (default) - * - * If native UI is used for the composition string, then - * SDL_EVENT_TEXT_EDITING will not be sent. - * - * If native UI is used for the candidates list, then - * SDL_EVENT_TEXT_EDITING_CANDIDATES will not be sent. + * - "none" or "0": The application can't render any IME elements, and native UI should be used. (default) + * - "composition": The application handles SDL_EVENT_TEXT_EDITING events and can render the composition text. + * - "candidates": The application handles SDL_EVENT_TEXT_EDITING_CANDIDATES and can render the candidate list. * * This hint should be set before SDL is initialized. * * \since This hint is available since SDL 3.0.0. */ -#define SDL_HINT_IME_NATIVE_UI "SDL_IME_NATIVE_UI" +#define SDL_HINT_IME_IMPLEMENTED_UI "SDL_IME_IMPLEMENTED_UI" /** * A variable controlling whether the home indicator bar on iPhone X should be diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 44b1bb54df6e2..5c5db2890d15b 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -237,16 +237,12 @@ static void SDLCALL Fcitx_SetCapabilities(void *data, return; } - if (!hint || !*hint || *hint == '1' || SDL_strstr(hint, "all")) { - // Let the OS handle IME UI - } else { - if (!SDL_strstr(hint, "composition")) { - caps |= (1 << 1); /* Preedit Flag */ - caps |= (1 << 4); /* Formatted Preedit Flag */ - } - if (!SDL_strstr(hint, "candidates")) { - // FIXME, turn off native candidate rendering - } + if (hint && SDL_strstr(hint, "composition")) { + caps |= (1 << 1); /* Preedit Flag */ + caps |= (1 << 4); /* Formatted Preedit Flag */ + } + if (hint && SDL_strstr(hint, "candidates")) { + // FIXME, turn off native candidate rendering } SDL_DBus_CallVoidMethod(FCITX_DBUS_SERVICE, client->ic_path, FCITX_IC_DBUS_INTERFACE, "SetCapability", DBUS_TYPE_UINT64, &caps, DBUS_TYPE_INVALID); @@ -307,7 +303,7 @@ static SDL_bool FcitxClientCreateIC(FcitxClient *client) NULL); dbus->connection_flush(dbus->session_conn); - SDL_AddHintCallback(SDL_HINT_IME_NATIVE_UI, Fcitx_SetCapabilities, client); + SDL_AddHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, Fcitx_SetCapabilities, client); return SDL_TRUE; } diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index c34ebc96c6f28..305395430880d 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -411,15 +411,11 @@ static void SDLCALL IBus_SetCapabilities(void *data, const char *name, const cha if (IBus_CheckConnection(dbus)) { Uint32 caps = IBUS_CAP_FOCUS; - if (!hint || !*hint || *hint == '1' || SDL_strstr(hint, "all")) { - // Let the OS handle IME UI - } else { - if (!SDL_strstr(hint, "composition")) { - caps |= IBUS_CAP_PREEDIT_TEXT; - } - if (!SDL_strstr(hint, "candidates")) { - // FIXME, turn off native candidate rendering - } + if (hint && SDL_strstr(hint, "composition")) { + caps |= IBUS_CAP_PREEDIT_TEXT; + } + if (hint && SDL_strstr(hint, "candidates")) { + // FIXME, turn off native candidate rendering } SDL_DBus_CallVoidMethodOnConnection(ibus_conn, ibus_service, input_ctx_path, ibus_input_interface, "SetCapabilities", @@ -482,7 +478,7 @@ static SDL_bool IBus_SetupConnection(SDL_DBusContext *dbus, const char *addr) (void)SDL_snprintf(matchstr, sizeof(matchstr), "type='signal',interface='%s'", ibus_input_interface); SDL_free(input_ctx_path); input_ctx_path = SDL_strdup(path); - SDL_AddHintCallback(SDL_HINT_IME_NATIVE_UI, IBus_SetCapabilities, NULL); + SDL_AddHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, IBus_SetCapabilities, NULL); dbus->bus_add_match(ibus_conn, matchstr, NULL); dbus->connection_try_register_object_path(ibus_conn, input_ctx_path, &ibus_vtable, dbus, NULL); dbus->connection_flush(ibus_conn); @@ -639,7 +635,7 @@ void SDL_IBus_Quit(void) /* !!! FIXME: should we close(inotify_fd) here? */ - SDL_DelHintCallback(SDL_HINT_IME_NATIVE_UI, IBus_SetCapabilities, NULL); + SDL_DelHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, IBus_SetCapabilities, NULL); SDL_memset(&ibus_cursor_rect, 0, sizeof(ibus_cursor_rect)); } diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index cba4f59f8c295..c12a51dccf883 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -314,17 +314,12 @@ static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) return 0; } - const char *hint = SDL_GetHint(SDL_HINT_IME_NATIVE_UI); - if (!hint || !*hint || *hint == '1' || SDL_strstr(hint, "all")) { - videodata->ime_native_composition = SDL_TRUE; - videodata->ime_native_candidates = SDL_TRUE; - } else { - if (SDL_strstr(hint, "composition")) { - videodata->ime_native_composition = SDL_TRUE; - } - if (SDL_strstr(hint, "candidates")) { - videodata->ime_native_candidates = SDL_TRUE; - } + const char *hint = SDL_GetHint(SDL_HINT_IME_IMPLEMENTED_UI); + if (hint && SDL_strstr(hint, "composition")) { + videodata->ime_internal_composition = SDL_TRUE; + } + if (hint && SDL_strstr(hint, "candidates")) { + videodata->ime_internal_candidates = SDL_TRUE; } videodata->ime_hwnd_main = hwnd; @@ -545,7 +540,7 @@ static DWORD IME_GetId(SDL_VideoData *videodata, UINT uIndex) SDL_assert(uIndex == 0); dwLang = ((DWORD_PTR)hkl & 0xffff); // FIXME: What does this do? - if (!videodata->ime_native_candidates && dwLang == LANG_CHT) { + if (videodata->ime_internal_candidates && dwLang == LANG_CHT) { dwRet[0] = IMEID_CHT_VER_VISTA; dwRet[1] = 0; return dwRet[0]; @@ -988,14 +983,14 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam SDL_DebugIMELog("WM_IME_SETCONTEXT\n"); LPARAM element_mask; - if (!videodata->ime_native_composition && !videodata->ime_native_candidates) { + if (videodata->ime_internal_composition && videodata->ime_internal_candidates) { element_mask = 0; } else { element_mask = ISC_SHOWUIALL; - if (!videodata->ime_native_composition) { + if (videodata->ime_internal_composition) { element_mask &= ~ISC_SHOWUICOMPOSITIONWINDOW; } - if (!videodata->ime_native_candidates) { + if (videodata->ime_internal_candidates) { element_mask &= ~ISC_SHOWUIALLCANDIDATEWINDOW; } } @@ -1023,13 +1018,13 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam break; case WM_IME_STARTCOMPOSITION: SDL_DebugIMELog("WM_IME_STARTCOMPOSITION\n"); - if (!videodata->ime_native_composition) { + if (videodata->ime_internal_composition) { trap = SDL_TRUE; } break; case WM_IME_COMPOSITION: SDL_DebugIMELog("WM_IME_COMPOSITION %x\n", lParam); - if (!videodata->ime_native_composition) { + if (videodata->ime_internal_composition) { trap = SDL_TRUE; himc = ImmGetContext(hwnd); if (*lParam & GCS_RESULTSTR) { @@ -1049,7 +1044,7 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam break; case WM_IME_ENDCOMPOSITION: SDL_DebugIMELog("WM_IME_ENDCOMPOSITION\n"); - if (!videodata->ime_native_composition) { + if (videodata->ime_internal_composition) { trap = SDL_TRUE; videodata->ime_composition[0] = 0; videodata->ime_readingstring[0] = 0; @@ -1079,14 +1074,14 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam case IMN_OPENCANDIDATE: case IMN_CHANGECANDIDATE: SDL_DebugIMELog("%s\n", wParam == IMN_OPENCANDIDATE ? "IMN_OPENCANDIDATE" : "IMN_CHANGECANDIDATE"); - if (!videodata->ime_native_candidates) { + if (videodata->ime_internal_candidates) { trap = SDL_TRUE; videodata->ime_update_candidates = SDL_TRUE; } break; case IMN_CLOSECANDIDATE: SDL_DebugIMELog("IMN_CLOSECANDIDATE\n"); - if (!videodata->ime_native_candidates) { + if (videodata->ime_internal_candidates) { trap = SDL_TRUE; videodata->ime_update_candidates = SDL_FALSE; IME_CloseCandidateList(videodata); diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 5a07f1a100b72..44b3050ca48e6 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -423,6 +423,8 @@ struct SDL_VideoData SDL_bool ime_initialized; SDL_bool ime_enabled; SDL_bool ime_available; + SDL_bool ime_internal_composition; + SDL_bool ime_internal_candidates; HWND ime_hwnd_main; HWND ime_hwnd_current; SDL_bool ime_needs_clear_composition; @@ -460,8 +462,6 @@ struct SDL_VideoData BOOL (WINAPI *ImmUnlockIMCC)(HIMCC himcc); /* *INDENT-ON* */ /* clang-format on */ - SDL_bool ime_native_composition; - SDL_bool ime_native_candidates; #endif /* !SDL_DISABLE_WINDOWS_IME */ BYTE pre_hook_key_state[256]; diff --git a/test/testime.c b/test/testime.c index 1ed6e0cb9d304..1427ba5e57633 100644 --- a/test/testime.c +++ b/test/testime.c @@ -867,8 +867,8 @@ static void Redraw(void) int main(int argc, char *argv[]) { - SDL_bool native_composition = SDL_TRUE; - SDL_bool native_candidates = SDL_TRUE; + SDL_bool render_composition = SDL_FALSE; + SDL_bool render_candidates = SDL_FALSE; int i, done; SDL_Event event; char *fontname = NULL; @@ -892,15 +892,15 @@ int main(int argc, char *argv[]) fontname = argv[i + 1]; consumed = 2; } - } else if (SDL_strcmp(argv[i], "--disable-native-composition") == 0) { - native_composition = SDL_FALSE; + } else if (SDL_strcmp(argv[i], "--render-composition") == 0) { + render_composition = SDL_TRUE; consumed = 1; - } else if (SDL_strcmp(argv[i], "--disable-native-candidates") == 0) { - native_candidates = SDL_FALSE; + } else if (SDL_strcmp(argv[i], "--render-candidates") == 0) { + render_candidates = SDL_TRUE; consumed = 1; } if (consumed <= 0) { - static const char *options[] = { "[--font fontfile] [--disable-native-composition] [--disable-native-candidates]", NULL }; + static const char *options[] = { "[--font fontfile] [--render-composition] [--render-candidates]", NULL }; SDLTest_CommonLogUsage(state, argv[0], options); return 1; } @@ -908,14 +908,12 @@ int main(int argc, char *argv[]) i += consumed; } - if (native_composition && native_candidates) { - SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "1"); - } else if (native_composition) { - SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "composition"); - } else if (native_candidates) { - SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "candidates"); - } else { - SDL_SetHint(SDL_HINT_IME_NATIVE_UI, "0"); + if (render_composition && render_candidates) { + SDL_SetHint(SDL_HINT_IME_IMPLEMENTED_UI, "composition,candidates"); + } else if (render_composition) { + SDL_SetHint(SDL_HINT_IME_IMPLEMENTED_UI, "composition"); + } else if (render_candidates) { + SDL_SetHint(SDL_HINT_IME_IMPLEMENTED_UI, "candidates"); } if (!SDLTest_CommonInit(state)) { From 2cfcb144e45edd44664b520c1de9e772ed5050af Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 29 Jun 2024 02:42:49 +0000 Subject: [PATCH 109/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 2f0ec2a8e9df0..e5913bf4bfd56 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -945,14 +945,19 @@ extern "C" { /** * A variable describing what IME UI elements the application can display. * - * By default IME UI is handled using native components by the OS where possible, however this can interfere with or not be visible when exclusive fullscreen mode is used. + * By default IME UI is handled using native components by the OS where + * possible, however this can interfere with or not be visible when exclusive + * fullscreen mode is used. * * The variable can be set to a comma separated list containing the following * items: * - * - "none" or "0": The application can't render any IME elements, and native UI should be used. (default) - * - "composition": The application handles SDL_EVENT_TEXT_EDITING events and can render the composition text. - * - "candidates": The application handles SDL_EVENT_TEXT_EDITING_CANDIDATES and can render the candidate list. + * - "none" or "0": The application can't render any IME elements, and native + * UI should be used. (default) + * - "composition": The application handles SDL_EVENT_TEXT_EDITING events and + * can render the composition text. + * - "candidates": The application handles SDL_EVENT_TEXT_EDITING_CANDIDATES + * and can render the candidate list. * * This hint should be set before SDL is initialized. * From 79f6baa494b29d71212a014edb8aade7967193b1 Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Sat, 29 Jun 2024 14:47:27 +0800 Subject: [PATCH 110/431] Remove the inconsistent and lag-causing usleep call in SDL_fcitx.c (cherry picked from commit 3bf2b90da09637059cac62a08ac42b630bbfa817) --- src/core/linux/SDL_fcitx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 5c5db2890d15b..d86ee3d0542da 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -455,6 +455,5 @@ void SDL_Fcitx_PumpEvents(void) while (dbus->connection_dispatch(conn) == DBUS_DISPATCH_DATA_REMAINS) { /* Do nothing, actual work happens in DBus_MessageFilter */ - usleep(10); } } From 22bca55d840868b020b1c227780bd78ed1731247 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 23:47:41 -0700 Subject: [PATCH 111/431] Minor blitting cleanup --- src/video/SDL_blit.h | 28 ++++++++++++++-------------- src/video/SDL_pixels.c | 36 +++++++++++++++++++----------------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 235ca5422cdc4..ba5b95904e3a1 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -30,8 +30,8 @@ #endif /* Table to do pixel byte expansion */ -extern Uint8 *SDL_expand_byte[9]; -extern Uint16 SDL_expand_byte10[]; +extern const Uint8 *SDL_expand_byte[9]; +extern const Uint16 SDL_expand_byte_10[]; /* SDL blit copy flags */ #define SDL_COPY_MODULATE_COLOR 0x00000001 @@ -387,12 +387,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); b = ((Pixel >> 2) & 0xFF); \ a = SDL_expand_byte[6][(Pixel >> 30)]; \ } -#define RGBAFLOAT_FROM_ARGB2101010(Pixel, r, g, b, a) \ - { \ - r = (float)((Pixel >> 20) & 0x3FF) / 1023.0f; \ - g = (float)((Pixel >> 10) & 0x3FF) / 1023.0f; \ - b = (float)((Pixel >> 0) & 0x3FF) / 1023.0f; \ - a = (float)SDL_expand_byte[6][(Pixel >> 30)] / 255.0f; \ +#define RGBAFLOAT_FROM_ARGB2101010(Pixel, r, g, b, a) \ + { \ + r = (float)((Pixel >> 20) & 0x3FF) / 1023.0f; \ + g = (float)((Pixel >> 10) & 0x3FF) / 1023.0f; \ + b = (float)((Pixel >> 0) & 0x3FF) / 1023.0f; \ + a = (float)(Pixel >> 30) / 3.0f; \ } #define RGBA_FROM_ABGR2101010(Pixel, r, g, b, a) \ { \ @@ -401,12 +401,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); b = ((Pixel >> 22) & 0xFF); \ a = SDL_expand_byte[6][(Pixel >> 30)]; \ } -#define RGBAFLOAT_FROM_ABGR2101010(Pixel, r, g, b, a) \ - { \ - r = (float)((Pixel >> 0) & 0x3FF) / 1023.0f; \ - g = (float)((Pixel >> 10) & 0x3FF) / 1023.0f; \ - b = (float)((Pixel >> 20) & 0x3FF) / 1023.0f; \ - a = (float)SDL_expand_byte[6][(Pixel >> 30)] / 255.0f; \ +#define RGBAFLOAT_FROM_ABGR2101010(Pixel, r, g, b, a) \ + { \ + r = (float)((Pixel >> 0) & 0x3FF) / 1023.0f; \ + g = (float)((Pixel >> 10) & 0x3FF) / 1023.0f; \ + b = (float)((Pixel >> 20) & 0x3FF) / 1023.0f; \ + a = (float)(Pixel >> 30) / 3.0f; \ } #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a) \ do { \ diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index c87d92d182321..0e06737a5d94e 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -30,43 +30,43 @@ /* Lookup tables to expand partial bytes to the full 0..255 range */ -static Uint8 lookup_0[] = { +static const Uint8 lookup_0[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; -static Uint8 lookup_1[] = { +static const Uint8 lookup_1[] = { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 }; -static Uint8 lookup_2[] = { +static const Uint8 lookup_2[] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 }; -static Uint8 lookup_3[] = { +static const Uint8 lookup_3[] = { 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 }; -static Uint8 lookup_4[] = { +static const Uint8 lookup_4[] = { 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255 }; -static Uint8 lookup_5[] = { +static const Uint8 lookup_5[] = { 0, 36, 72, 109, 145, 182, 218, 255 }; -static Uint8 lookup_6[] = { +static const Uint8 lookup_6[] = { 0, 85, 170, 255 }; -static Uint8 lookup_7[] = { +static const Uint8 lookup_7[] = { 0, 255 }; -static Uint8 lookup_8[] = { +static const Uint8 lookup_8[] = { 255 }; -Uint8 *SDL_expand_byte[9] = { +const Uint8 *SDL_expand_byte[9] = { lookup_0, lookup_1, lookup_2, @@ -79,9 +79,11 @@ Uint8 *SDL_expand_byte[9] = { }; /* Lookup tables to expand 8 bit to 10 bit range */ -Uint16 SDL_expand_byte10[] = { +const Uint16 SDL_expand_byte_10[] = { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 233, 237, 241, 245, 249, 253, 257, 261, 265, 269, 273, 277, 281, 285, 289, 293, 297, 301, 305, 309, 313, 317, 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 365, 369, 373, 377, 381, 385, 389, 393, 397, 401, 405, 409, 413, 417, 421, 425, 429, 433, 437, 441, 445, 449, 453, 457, 461, 465, 469, 473, 477, 481, 485, 489, 493, 497, 501, 505, 509, 514, 518, 522, 526, 530, 534, 538, 542, 546, 550, 554, 558, 562, 566, 570, 574, 578, 582, 586, 590, 594, 598, 602, 606, 610, 614, 618, 622, 626, 630, 634, 638, 642, 646, 650, 654, 658, 662, 666, 670, 674, 678, 682, 686, 690, 694, 698, 702, 706, 710, 714, 718, 722, 726, 730, 734, 738, 742, 746, 750, 754, 758, 762, 766, 770, 774, 778, 782, 786, 790, 794, 798, 802, 806, 810, 814, 818, 822, 826, 830, 834, 838, 842, 846, 850, 855, 859, 863, 867, 871, 875, 879, 883, 887, 891, 895, 899, 903, 907, 911, 915, 919, 923, 927, 931, 935, 939, 943, 947, 951, 955, 959, 963, 967, 971, 975, 979, 983, 987, 991, 995, 999, 1003, 1007, 1011, 1015, 1019, 1023 }; +SDL_COMPILE_TIME_ASSERT(SDL_expand_byte_10_size, SDL_arraysize(SDL_expand_byte_10) == (1 << 8)); + /* Helper functions */ @@ -1242,9 +1244,9 @@ Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) if (format->palette) { return SDL_FindColor(format->palette, r, g, b, SDL_ALPHA_OPAQUE); } else if (SDL_ISPIXELFORMAT_10BIT(format->format)) { - return (((Uint32)SDL_expand_byte10[r]) << format->Rshift) | - (((Uint32)SDL_expand_byte10[g]) << format->Gshift) | - (((Uint32)SDL_expand_byte10[b]) << format->Bshift) | + return (((Uint32)SDL_expand_byte_10[r]) << format->Rshift) | + (((Uint32)SDL_expand_byte_10[g]) << format->Gshift) | + (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | format->Amask; } else { return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask; @@ -1262,9 +1264,9 @@ Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, if (format->palette) { return SDL_FindColor(format->palette, r, g, b, a); } else if (SDL_ISPIXELFORMAT_10BIT(format->format)) { - return (((Uint32)SDL_expand_byte10[r]) << format->Rshift) | - (((Uint32)SDL_expand_byte10[g]) << format->Gshift) | - (((Uint32)SDL_expand_byte10[b]) << format->Bshift) | + return (((Uint32)SDL_expand_byte_10[r]) << format->Rshift) | + (((Uint32)SDL_expand_byte_10[g]) << format->Gshift) | + (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); } else { return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); From 6f199eabb872466c0a38c4ecd88aa18885895b24 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 28 Jun 2024 23:55:23 -0700 Subject: [PATCH 112/431] Removed SDL_RenderGeometryRawFloat() After discussion with @ocornut, SDL_RenderGeometryRaw() will take floating point colors and conversion from 8-bit color can happen on the application side. We can always add an 8-bit color fast path in the future if we need it on handheld platforms. If you need code to do this in your application, you can use the following: int SDL_RenderGeometryRaw8BitColor(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices) { int i, retval, isstack; const Uint8 *color2 = (const Uint8 *)color; SDL_FColor *color3; if (num_vertices <= 0) { return SDL_InvalidParamError("num_vertices"); } if (!color) { return SDL_InvalidParamError("color"); } color3 = (SDL_FColor *)SDL_small_alloc(SDL_FColor, num_vertices, &isstack); if (!color3) { return -1; } for (i = 0; i < num_vertices; ++i) { color3[i].r = color->r / 255.0f; color3[i].g = color->g / 255.0f; color3[i].b = color->b / 255.0f; color3[i].a = color->a / 255.0f; color2 += color_stride; color = (const SDL_Color *)color2; } retval = SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color3, sizeof(*color3), uv, uv_stride, num_vertices, indices, num_indices, size_indices); SDL_small_free(color3, isstack); return retval; } Fixes https://github.com/libsdl-org/SDL/issues/9009 --- include/SDL3/SDL_render.h | 36 +---------------------------- src/dynapi/SDL_dynapi.sym | 1 - src/dynapi/SDL_dynapi_overrides.h | 1 - src/dynapi/SDL_dynapi_procs.h | 3 +-- src/render/SDL_render.c | 38 ++----------------------------- test/testcolorspace.c | 2 +- 6 files changed, 5 insertions(+), 76 deletions(-) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 063945365dfbd..ee94ee9bbb510 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1877,39 +1877,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometry(SDL_Renderer *renderer, const SDL_Vertex *vertices, int num_vertices, const int *indices, int num_indices); -/** - * Render a list of triangles, optionally using a texture and indices into the - * vertex arrays Color and alpha modulation is done per vertex - * (SDL_SetTextureColorMod and SDL_SetTextureAlphaMod are ignored). - * - * \param renderer the rendering context. - * \param texture (optional) The SDL texture to use. - * \param xy vertex positions. - * \param xy_stride byte size to move from one element to the next element. - * \param color vertex colors (as SDL_Color). - * \param color_stride byte size to move from one element to the next element. - * \param uv vertex normalized texture coordinates. - * \param uv_stride byte size to move from one element to the next element. - * \param num_vertices number of vertices. - * \param indices (optional) An array of indices into the 'vertices' arrays, - * if NULL all vertices will be rendered in sequential order. - * \param num_indices number of indices. - * \param size_indices index size: 1 (byte), 2 (short), 4 (int). - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_RenderGeometry - */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, - SDL_Texture *texture, - const float *xy, int xy_stride, - const SDL_Color *color, int color_stride, - const float *uv, int uv_stride, - int num_vertices, - const void *indices, int num_indices, int size_indices); - /** * Render a list of triangles, optionally using a texture and indices into the * vertex arrays Color and alpha modulation is done per vertex @@ -1934,9 +1901,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, * \since This function is available since SDL 3.0.0. * * \sa SDL_RenderGeometry - * \sa SDL_RenderGeometryRaw */ -extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRawFloat(SDL_Renderer *renderer, +extern SDL_DECLSPEC int SDLCALL SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index b81b894f45a50..8ca96c833db45 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -645,7 +645,6 @@ SDL3_0.0.0 { SDL_RenderFillRects; SDL_RenderGeometry; SDL_RenderGeometryRaw; - SDL_RenderGeometryRawFloat; SDL_RenderLine; SDL_RenderLines; SDL_RenderPoint; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 4cfcd09b63181..d809adcd724e6 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -670,7 +670,6 @@ #define SDL_RenderFillRects SDL_RenderFillRects_REAL #define SDL_RenderGeometry SDL_RenderGeometry_REAL #define SDL_RenderGeometryRaw SDL_RenderGeometryRaw_REAL -#define SDL_RenderGeometryRawFloat SDL_RenderGeometryRawFloat_REAL #define SDL_RenderLine SDL_RenderLine_REAL #define SDL_RenderLines SDL_RenderLines_REAL #define SDL_RenderPoint SDL_RenderPoint_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 4c43f04070bfe..43b85743922f3 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -680,8 +680,7 @@ SDL_DYNAPI_PROC(int,SDL_RenderCoordinatesToWindow,(SDL_Renderer *a, float b, flo SDL_DYNAPI_PROC(int,SDL_RenderFillRect,(SDL_Renderer *a, const SDL_FRect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_RenderFillRects,(SDL_Renderer *a, const SDL_FRect *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_RenderGeometry,(SDL_Renderer *a, SDL_Texture *b, const SDL_Vertex *c, int d, const int *e, int f),(a,b,c,d,e,f),return) -SDL_DYNAPI_PROC(int,SDL_RenderGeometryRaw,(SDL_Renderer *a, SDL_Texture *b, const float *c, int d, const SDL_Color *e, int f, const float *g, int h, int i, const void *j, int k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) -SDL_DYNAPI_PROC(int,SDL_RenderGeometryRawFloat,(SDL_Renderer *a, SDL_Texture *b, const float *c, int d, const SDL_FColor *e, int f, const float *g, int h, int i, const void *j, int k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) +SDL_DYNAPI_PROC(int,SDL_RenderGeometryRaw,(SDL_Renderer *a, SDL_Texture *b, const float *c, int d, const SDL_FColor *e, int f, const float *g, int h, int i, const void *j, int k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) SDL_DYNAPI_PROC(int,SDL_RenderLine,(SDL_Renderer *a, float b, float c, float d, float e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_RenderLines,(SDL_Renderer *a, const SDL_FPoint *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_RenderPoint,(SDL_Renderer *a, float b, float c),(a,b,c),return) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 83f63028995cd..0b504ca1d9c9b 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -3849,7 +3849,7 @@ int SDL_RenderGeometry(SDL_Renderer *renderer, const float *uv = &vertices->tex_coord.x; int uv_stride = sizeof(SDL_Vertex); int size_indices = 4; - return SDL_RenderGeometryRawFloat(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices); + return SDL_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices); } else { return SDL_InvalidParamError("vertices"); } @@ -4226,7 +4226,7 @@ static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, } #endif /* SDL_VIDEO_RENDER_SW */ -int SDL_RenderGeometryRawFloat(SDL_Renderer *renderer, +int SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_FColor *color, int color_stride, @@ -4338,40 +4338,6 @@ int SDL_RenderGeometryRawFloat(SDL_Renderer *renderer, renderer->view->scale.y); } -int SDL_RenderGeometryRaw(SDL_Renderer *renderer, SDL_Texture *texture, const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices) -{ - int i, retval, isstack; - const Uint8 *color2 = (const Uint8 *)color; - SDL_FColor *color3; - - if (num_vertices <= 0) { - return SDL_InvalidParamError("num_vertices"); - } - if (!color) { - return SDL_InvalidParamError("color"); - } - - color3 = (SDL_FColor *)SDL_small_alloc(SDL_FColor, num_vertices, &isstack); - if (!color3) { - return -1; - } - - for (i = 0; i < num_vertices; ++i) { - color3[i].r = color->r / 255.0f; - color3[i].g = color->g / 255.0f; - color3[i].b = color->b / 255.0f; - color3[i].a = color->a / 255.0f; - color2 += color_stride; - color = (const SDL_Color *)color2; - } - - retval = SDL_RenderGeometryRawFloat(renderer, texture, xy, xy_stride, color3, sizeof(*color3), uv, uv_stride, num_vertices, indices, num_indices, size_indices); - - SDL_small_free(color3, isstack); - - return retval; -} - SDL_Surface *SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { SDL_Rect real_rect; diff --git a/test/testcolorspace.c b/test/testcolorspace.c index 577b7d70d9a92..6afa0d748cf2c 100644 --- a/test/testcolorspace.c +++ b/test/testcolorspace.c @@ -388,7 +388,7 @@ static void DrawGradient(float x, float y, float width, float height, float star color[2] = max_color; color[3] = min_color; - SDL_RenderGeometryRawFloat(renderer, NULL, xy, xy_stride, color, color_stride, NULL, 0, num_vertices, indices, num_indices, size_indices); + SDL_RenderGeometryRaw(renderer, NULL, xy, xy_stride, color, color_stride, NULL, 0, num_vertices, indices, num_indices, size_indices); } static void RenderGradientDrawing(void) From a522bfe3f1402a3f47dfb90b6b44e2d5695fc953 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 02:34:17 -0700 Subject: [PATCH 113/431] Clean up any renderer in SDL_DestroyWindowSurface() Also added an automated test to verify window surface functionality. Fixes https://github.com/libsdl-org/SDL/issues/10133 --- src/video/SDL_video.c | 135 ++++++++++++++++++------------------ test/testautomation_video.c | 84 ++++++++++++++++++++-- 2 files changed, 148 insertions(+), 71 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 5fa53035ad12c..e8542430a2f76 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2442,12 +2442,6 @@ int SDL_RecreateWindow(SDL_Window *window, SDL_WindowFlags flags) /* Tear down the old native window */ SDL_DestroyWindowSurface(window); - if (_this->checked_texture_framebuffer) { /* never checked? No framebuffer to destroy. Don't risk calling the wrong implementation. */ - if (_this->DestroyWindowFramebuffer) { - _this->DestroyWindowFramebuffer(_this, window); - } - } - if ((window->flags & SDL_WINDOW_OPENGL) != (flags & SDL_WINDOW_OPENGL)) { if (flags & SDL_WINDOW_OPENGL) { need_gl_load = SDL_TRUE; @@ -3251,57 +3245,59 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) using a GPU texture through the 2D render API, if we think this would be more efficient. This only checks once, on demand. */ if (!_this->checked_texture_framebuffer) { - SDL_bool attempt_texture_framebuffer = SDL_TRUE; - - /* See if the user or application wants to specifically disable the framebuffer */ - const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); - if (hint) { - if ((*hint == '0') || (SDL_strcasecmp(hint, "false") == 0) || (SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) == 0)) { - attempt_texture_framebuffer = SDL_FALSE; - } - } + SDL_bool attempt_texture_framebuffer; if (_this->is_dummy) { /* dummy driver never has GPU support, of course. */ attempt_texture_framebuffer = SDL_FALSE; - } + } else { + /* See if the user or application wants to specifically disable the framebuffer */ + const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + if (hint && *hint) { + if ((*hint == '0') || (SDL_strcasecmp(hint, "false") == 0) || (SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) == 0)) { + attempt_texture_framebuffer = SDL_FALSE; + } else { + attempt_texture_framebuffer = SDL_TRUE; + } + } else { + attempt_texture_framebuffer = SDL_TRUE; #ifdef SDL_PLATFORM_LINUX - /* On WSL, direct X11 is faster than using OpenGL for window framebuffers, so try to detect WSL and avoid texture framebuffer. */ - else if ((_this->CreateWindowFramebuffer) && (SDL_strcmp(_this->name, "x11") == 0)) { - struct stat sb; - if ((stat("/proc/sys/fs/binfmt_misc/WSLInterop", &sb) == 0) || (stat("/run/WSL", &sb) == 0)) { /* if either of these exist, we're on WSL. */ - attempt_texture_framebuffer = SDL_FALSE; - } - } + /* On WSL, direct X11 is faster than using OpenGL for window framebuffers, so try to detect WSL and avoid texture framebuffer. */ + if ((_this->CreateWindowFramebuffer) && (SDL_strcmp(_this->name, "x11") == 0)) { + struct stat sb; + if ((stat("/proc/sys/fs/binfmt_misc/WSLInterop", &sb) == 0) || (stat("/run/WSL", &sb) == 0)) { /* if either of these exist, we're on WSL. */ + attempt_texture_framebuffer = SDL_FALSE; + } + } #endif #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. (!!! FIXME: is this still true?) */ - else if ((_this->CreateWindowFramebuffer) && (SDL_strcmp(_this->name, "windows") == 0)) { - attempt_texture_framebuffer = SDL_FALSE; - } + if (_this->CreateWindowFramebuffer && (SDL_strcmp(_this->name, "windows") == 0)) { + attempt_texture_framebuffer = SDL_FALSE; + } #endif #ifdef SDL_PLATFORM_EMSCRIPTEN - else { - attempt_texture_framebuffer = SDL_FALSE; - } + attempt_texture_framebuffer = SDL_FALSE; #endif + } - if (attempt_texture_framebuffer) { - if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) < 0) { - /* !!! FIXME: if this failed halfway (made renderer, failed to make texture, etc), - !!! FIXME: we probably need to clean this up so it doesn't interfere with - !!! FIXME: a software fallback at the system level (can we blit to an - !!! FIXME: OpenGL window? etc). */ - } else { - /* future attempts will just try to use a texture framebuffer. */ - /* !!! FIXME: maybe we shouldn't override these but check if we used a texture - !!! FIXME: framebuffer at the right places; is it feasible we could have an - !!! FIXME: accelerated OpenGL window and a second ends up in software? */ - _this->CreateWindowFramebuffer = SDL_CreateWindowTexture; - _this->SetWindowFramebufferVSync = SDL_SetWindowTextureVSync; - _this->GetWindowFramebufferVSync = SDL_GetWindowTextureVSync; - _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture; - _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture; - created_framebuffer = SDL_TRUE; + if (attempt_texture_framebuffer) { + if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) < 0) { + /* !!! FIXME: if this failed halfway (made renderer, failed to make texture, etc), + !!! FIXME: we probably need to clean this up so it doesn't interfere with + !!! FIXME: a software fallback at the system level (can we blit to an + !!! FIXME: OpenGL window? etc). */ + } else { + /* future attempts will just try to use a texture framebuffer. */ + /* !!! FIXME: maybe we shouldn't override these but check if we used a texture + !!! FIXME: framebuffer at the right places; is it feasible we could have an + !!! FIXME: accelerated OpenGL window and a second ends up in software? */ + _this->CreateWindowFramebuffer = SDL_CreateWindowTexture; + _this->SetWindowFramebufferVSync = SDL_SetWindowTextureVSync; + _this->GetWindowFramebufferVSync = SDL_GetWindowTextureVSync; + _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture; + _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture; + created_framebuffer = SDL_TRUE; + } } } @@ -3310,6 +3306,7 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) if (!created_framebuffer) { if (!_this->CreateWindowFramebuffer || !_this->UpdateWindowFramebuffer) { + SDL_SetError("Window framebuffer support not available"); return NULL; } @@ -3319,6 +3316,7 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) } if (window->surface) { + /* We may have gone recursive and already created the surface */ return window->surface; } @@ -3337,7 +3335,12 @@ SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) CHECK_WINDOW_MAGIC(window, NULL); if (!window->surface_valid) { - SDL_DestroyWindowSurface(window); + if (window->surface) { + window->surface->flags &= ~SDL_DONTFREE; + SDL_DestroySurface(window->surface); + window->surface = NULL; + } + window->surface = SDL_CreateWindowFramebuffer(window); if (window->surface) { window->surface_valid = SDL_TRUE; @@ -3394,6 +3397,25 @@ int SDL_UpdateWindowSurfaceRects(SDL_Window *window, const SDL_Rect *rects, return _this->UpdateWindowFramebuffer(_this, window, rects, numrects); } +int SDL_DestroyWindowSurface(SDL_Window *window) +{ + CHECK_WINDOW_MAGIC(window, -1); + + if (window->surface) { + window->surface->flags &= ~SDL_DONTFREE; + SDL_DestroySurface(window->surface); + window->surface = NULL; + window->surface_valid = SDL_FALSE; + } + + if (_this->checked_texture_framebuffer) { /* never checked? No framebuffer to destroy. Don't risk calling the wrong implementation. */ + if (_this->DestroyWindowFramebuffer) { + _this->DestroyWindowFramebuffer(_this, window); + } + } + return 0; +} + int SDL_SetWindowOpacity(SDL_Window *window, float opacity) { int retval; @@ -3417,19 +3439,6 @@ int SDL_SetWindowOpacity(SDL_Window *window, float opacity) return retval; } -int SDL_DestroyWindowSurface(SDL_Window *window) -{ - CHECK_WINDOW_MAGIC(window, -1); - - if (window->surface) { - window->surface->flags &= ~SDL_DONTFREE; - SDL_DestroySurface(window->surface); - window->surface = NULL; - window->surface_valid = SDL_FALSE; - } - return 0; -} - int SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity) { CHECK_WINDOW_MAGIC(window, -1); @@ -3922,12 +3931,6 @@ void SDL_DestroyWindow(SDL_Window *window) SDL_DestroyWindowSurface(window); - if (_this->checked_texture_framebuffer) { /* never checked? No framebuffer to destroy. Don't risk calling the wrong implementation. */ - if (_this->DestroyWindowFramebuffer) { - _this->DestroyWindowFramebuffer(_this, window); - } - } - /* Make no context current if this is the current context window */ if (window->flags & SDL_WINDOW_OPENGL) { if (_this->current_glwin == window) { diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 88ae689f08bcc..577e3d7d1101d 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -28,7 +28,7 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) window = SDL_CreateWindow(title, w, h, flags); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%" SDL_PRIu64 ")", w, h, flags); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + SDLTest_AssertCheck(window != NULL, "Validate that returned window is not NULL"); /* Check the window is available in the window list */ windows = SDL_GetWindows(&count); @@ -190,7 +190,7 @@ static int video_createWindowVariousSizes(void *arg) window = SDL_CreateWindow(title, w, h, 0); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,SHOWN)", w, h); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + SDLTest_AssertCheck(window != NULL, "Validate that returned window is not NULL"); /* Clean up */ destroyVideoSuiteTestWindow(window); @@ -265,7 +265,7 @@ static int video_createWindowVariousFlags(void *arg) window = SDL_CreateWindow(title, w, h, flags); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%" SDL_PRIu64 ")", w, h, flags); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + SDLTest_AssertCheck(window != NULL, "Validate that returned window is not NULL"); /* Clean up */ destroyVideoSuiteTestWindow(window); @@ -1732,7 +1732,7 @@ static int video_setWindowCenteredOnDisplay(void *arg) window = SDL_CreateWindowWithProperties(props); SDL_DestroyProperties(props); SDLTest_AssertPass("Call to SDL_CreateWindow('Title',%d,%d,%d,%d,SHOWN)", x, y, w, h); - SDLTest_AssertCheck(window != NULL, "Validate that returned window struct is not NULL"); + SDLTest_AssertCheck(window != NULL, "Validate that returned window is not NULL"); /* Wayland windows require that a frame be presented before they are fully mapped and visible onscreen. */ if (video_driver_is_wayland) { @@ -2238,6 +2238,76 @@ static int video_getSetWindowState(void *arg) return skipFlags != (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED) ? TEST_COMPLETED : TEST_SKIPPED; } +/** + * Tests window surface functionality + */ +static int video_getWindowSurface(void *arg) +{ + const char *title = "video_getWindowSurface Test Window"; + SDL_Window *window; + SDL_Surface *surface; + SDL_Renderer *renderer; + const char *renderer_name = NULL; + int result; + + if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0) { + renderer_name = SDL_SOFTWARE_RENDERER; + } + + /* Make sure we're testing interaction with an accelerated renderer */ + SDL_SetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION, "1"); + + window = SDL_CreateWindow(title, 320, 320, 0); + SDLTest_AssertPass("Call to SDL_CreateWindow('Title',320,320,0)"); + SDLTest_AssertCheck(window != NULL, "Validate that returned window is not NULL"); + + surface = SDL_GetWindowSurface(window); + SDLTest_AssertPass("Call to SDL_GetWindowSurface(window)"); + SDLTest_AssertCheck(surface != NULL, "Validate that returned surface is not NULL"); + SDLTest_AssertCheck(SDL_WindowHasSurface(window), "Validate that window has a surface"); + + result = SDL_UpdateWindowSurface(window); + SDLTest_AssertPass("Call to SDL_UpdateWindowSurface(window)"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + + /* We shouldn't be able to create a renderer on a window with a surface */ + renderer = SDL_CreateRenderer(window, renderer_name); + SDLTest_AssertPass("Call to SDL_CreateRenderer(window, %s)", renderer_name); + SDLTest_AssertCheck(renderer == NULL, "Validate that returned renderer is NULL"); + + result = SDL_DestroyWindowSurface(window); + SDLTest_AssertPass("Call to SDL_DestroyWindowSurface(window)"); + SDLTest_AssertCheck(result == 0, "Verify return value; expected: 0, got: %d", result); + SDLTest_AssertCheck(!SDL_WindowHasSurface(window), "Validate that window does not have a surface"); + + /* We should be able to create a renderer on the window now */ + renderer = SDL_CreateRenderer(window, renderer_name); + SDLTest_AssertPass("Call to SDL_CreateRenderer(window, %s)", renderer_name); + SDLTest_AssertCheck(renderer != NULL, "Validate that returned renderer is not NULL"); + + /* We should not be able to create a window surface now, unless it was created by the renderer */ + if (!SDL_WindowHasSurface(window)) { + surface = SDL_GetWindowSurface(window); + SDLTest_AssertPass("Call to SDL_GetWindowSurface(window)"); + SDLTest_AssertCheck(surface == NULL, "Validate that returned surface is NULL"); + } + + SDL_DestroyRenderer(renderer); + SDLTest_AssertPass("Call to SDL_DestroyRenderer(renderer)"); + SDLTest_AssertCheck(!SDL_WindowHasSurface(window), "Validate that window does not have a surface"); + + /* We should be able to create a window surface again */ + surface = SDL_GetWindowSurface(window); + SDLTest_AssertPass("Call to SDL_GetWindowSurface(window)"); + SDLTest_AssertCheck(surface != NULL, "Validate that returned surface is not NULL"); + SDLTest_AssertCheck(SDL_WindowHasSurface(window), "Validate that window has a surface"); + + /* Clean up */ + SDL_DestroyWindow(window); + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ /* Video test cases */ @@ -2317,12 +2387,16 @@ static const SDLTest_TestCaseReference videoTest19 = { (SDLTest_TestCaseFp)video_getSetWindowState, "video_getSetWindowState", "Checks transitioning between windowed, minimized, maximized, and fullscreen states", TEST_ENABLED }; +static const SDLTest_TestCaseReference videoTest20 = { + (SDLTest_TestCaseFp)video_getWindowSurface, "video_getWindowSurface", "Checks window surface functionality", TEST_ENABLED +}; + /* Sequence of Video test cases */ static const SDLTest_TestCaseReference *videoTests[] = { &videoTest1, &videoTest2, &videoTest3, &videoTest4, &videoTest5, &videoTest6, &videoTest7, &videoTest8, &videoTest9, &videoTest10, &videoTest11, &videoTest12, &videoTest13, &videoTest14, &videoTest15, &videoTest16, &videoTest17, - &videoTest18, &videoTest19, NULL + &videoTest18, &videoTest19, &videoTest20, NULL }; /* Video test suite (global) */ From 2a58e7b11c7896de0a9714d099de7409c360ee70 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 10:14:27 -0700 Subject: [PATCH 114/431] Respect SDL_HINT_RENDER_DRIVER when creating an accelerated window surface Fixes https://github.com/libsdl-org/SDL/issues/10061 --- src/video/SDL_video.c | 149 +++++++++++++++++++++++++----------------- 1 file changed, 88 insertions(+), 61 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index e8542430a2f76..5b67b6d4f86a4 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -297,23 +297,37 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S if (!data) { SDL_Renderer *renderer = NULL; - const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); - const SDL_bool specific_accelerated_renderer = (hint && *hint != '0' && *hint != '1' && - SDL_strcasecmp(hint, "true") != 0 && - SDL_strcasecmp(hint, "false") != 0 && - SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) != 0); + const char *render_driver = NULL; + const char *hint; + + /* See if there's a render driver being requested */ + hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + if (hint && *hint != '0' && *hint != '1' && + SDL_strcasecmp(hint, "true") != 0 && + SDL_strcasecmp(hint, "false") != 0 && + SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) != 0) { + render_driver = hint; + } + + if (!render_driver) { + hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER); + if (hint && *hint && SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) != 0) { + render_driver = hint; + } + } /* Check to see if there's a specific driver requested */ - if (specific_accelerated_renderer) { - renderer = SDL_CreateRenderer(window, hint); + if (render_driver) { + renderer = SDL_CreateRenderer(window, render_driver); if (!renderer) { - return SDL_SetError("Requested renderer for " SDL_HINT_FRAMEBUFFER_ACCELERATION " is not available"); + /* The error for this specific renderer has already been set */ + return -1; } } else { const int total = SDL_GetNumRenderDrivers(); for (i = 0; i < total; ++i) { const char *name = SDL_GetRenderDriver(i); - if (name && (SDL_strcmp(name, SDL_SOFTWARE_RENDERER) != 0)) { + if (name && SDL_strcmp(name, SDL_SOFTWARE_RENDERER) != 0) { renderer = SDL_CreateRenderer(window, name); if (renderer) { break; /* this will work. */ @@ -3231,6 +3245,55 @@ int SDL_SyncWindow(SDL_Window *window) return 0; } +static SDL_bool ShouldAttemptTextureFramebuffer(void) +{ + const char *hint; + SDL_bool attempt_texture_framebuffer = SDL_TRUE; + + /* The dummy driver never has GPU support, of course. */ + if (_this->is_dummy) { + return SDL_FALSE; + } + + /* See if there's a hint override */ + hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); + if (hint && *hint) { + if (*hint == '0' || SDL_strcasecmp(hint, "false") == 0 || SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) == 0) { + attempt_texture_framebuffer = SDL_FALSE; + } else { + attempt_texture_framebuffer = SDL_TRUE; + } + } else { + /* Check for platform specific defaults */ +#ifdef SDL_PLATFORM_LINUX + /* On WSL, direct X11 is faster than using OpenGL for window framebuffers, so try to detect WSL and avoid texture framebuffer. */ + if ((_this->CreateWindowFramebuffer) && (SDL_strcmp(_this->name, "x11") == 0)) { + struct stat sb; + if ((stat("/proc/sys/fs/binfmt_misc/WSLInterop", &sb) == 0) || (stat("/run/WSL", &sb) == 0)) { /* if either of these exist, we're on WSL. */ + attempt_texture_framebuffer = SDL_FALSE; + } + } +#endif +#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. (!!! FIXME: is this still true?) */ + if (_this->CreateWindowFramebuffer && (SDL_strcmp(_this->name, "windows") == 0)) { + attempt_texture_framebuffer = SDL_FALSE; + } +#endif +#ifdef SDL_PLATFORM_EMSCRIPTEN + attempt_texture_framebuffer = SDL_FALSE; +#endif + } + + if (attempt_texture_framebuffer) { + /* Using a software renderer will try to display on a window surface, so avoid recursion here */ + hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER); + if (hint && SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) == 0) { + attempt_texture_framebuffer = SDL_FALSE; + } + } + return attempt_texture_framebuffer; +} + static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) { SDL_PixelFormatEnum format = SDL_PIXELFORMAT_UNKNOWN; @@ -3245,59 +3308,23 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) using a GPU texture through the 2D render API, if we think this would be more efficient. This only checks once, on demand. */ if (!_this->checked_texture_framebuffer) { - SDL_bool attempt_texture_framebuffer; - - if (_this->is_dummy) { /* dummy driver never has GPU support, of course. */ - attempt_texture_framebuffer = SDL_FALSE; - } else { - /* See if the user or application wants to specifically disable the framebuffer */ - const char *hint = SDL_GetHint(SDL_HINT_FRAMEBUFFER_ACCELERATION); - if (hint && *hint) { - if ((*hint == '0') || (SDL_strcasecmp(hint, "false") == 0) || (SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) == 0)) { - attempt_texture_framebuffer = SDL_FALSE; - } else { - attempt_texture_framebuffer = SDL_TRUE; - } + if (ShouldAttemptTextureFramebuffer()) { + if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) < 0) { + /* !!! FIXME: if this failed halfway (made renderer, failed to make texture, etc), + !!! FIXME: we probably need to clean this up so it doesn't interfere with + !!! FIXME: a software fallback at the system level (can we blit to an + !!! FIXME: OpenGL window? etc). */ } else { - attempt_texture_framebuffer = SDL_TRUE; - -#ifdef SDL_PLATFORM_LINUX - /* On WSL, direct X11 is faster than using OpenGL for window framebuffers, so try to detect WSL and avoid texture framebuffer. */ - if ((_this->CreateWindowFramebuffer) && (SDL_strcmp(_this->name, "x11") == 0)) { - struct stat sb; - if ((stat("/proc/sys/fs/binfmt_misc/WSLInterop", &sb) == 0) || (stat("/run/WSL", &sb) == 0)) { /* if either of these exist, we're on WSL. */ - attempt_texture_framebuffer = SDL_FALSE; - } - } -#endif -#if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) /* GDI BitBlt() is way faster than Direct3D dynamic textures right now. (!!! FIXME: is this still true?) */ - if (_this->CreateWindowFramebuffer && (SDL_strcmp(_this->name, "windows") == 0)) { - attempt_texture_framebuffer = SDL_FALSE; - } -#endif -#ifdef SDL_PLATFORM_EMSCRIPTEN - attempt_texture_framebuffer = SDL_FALSE; -#endif - } - - if (attempt_texture_framebuffer) { - if (SDL_CreateWindowTexture(_this, window, &format, &pixels, &pitch) < 0) { - /* !!! FIXME: if this failed halfway (made renderer, failed to make texture, etc), - !!! FIXME: we probably need to clean this up so it doesn't interfere with - !!! FIXME: a software fallback at the system level (can we blit to an - !!! FIXME: OpenGL window? etc). */ - } else { - /* future attempts will just try to use a texture framebuffer. */ - /* !!! FIXME: maybe we shouldn't override these but check if we used a texture - !!! FIXME: framebuffer at the right places; is it feasible we could have an - !!! FIXME: accelerated OpenGL window and a second ends up in software? */ - _this->CreateWindowFramebuffer = SDL_CreateWindowTexture; - _this->SetWindowFramebufferVSync = SDL_SetWindowTextureVSync; - _this->GetWindowFramebufferVSync = SDL_GetWindowTextureVSync; - _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture; - _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture; - created_framebuffer = SDL_TRUE; - } + /* future attempts will just try to use a texture framebuffer. */ + /* !!! FIXME: maybe we shouldn't override these but check if we used a texture + !!! FIXME: framebuffer at the right places; is it feasible we could have an + !!! FIXME: accelerated OpenGL window and a second ends up in software? */ + _this->CreateWindowFramebuffer = SDL_CreateWindowTexture; + _this->SetWindowFramebufferVSync = SDL_SetWindowTextureVSync; + _this->GetWindowFramebufferVSync = SDL_GetWindowTextureVSync; + _this->UpdateWindowFramebuffer = SDL_UpdateWindowTexture; + _this->DestroyWindowFramebuffer = SDL_DestroyWindowTexture; + created_framebuffer = SDL_TRUE; } } From 5322b3528ae41e9f47aec5a0da7c8900ae9e48b8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 01:28:43 -0700 Subject: [PATCH 115/431] Losing keyboard focus doesn't automatically mean you lose mouse capture Fixes https://github.com/libsdl-org/SDL/issues/5616 --- src/events/SDL_keyboard.c | 17 ----------------- src/video/wayland/SDL_waylandevents.c | 1 - src/video/wayland/SDL_waylandwindow.c | 6 ------ 3 files changed, 24 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index c7f815aa384ab..5156e0a36550c 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -283,23 +283,6 @@ int SDL_SetKeyboardFocus(SDL_Window *window) /* See if the current window has lost focus */ if (keyboard->focus && keyboard->focus != window) { - - /* new window shouldn't think it has mouse captured. */ - SDL_assert(window == NULL || !(window->flags & SDL_WINDOW_MOUSE_CAPTURE)); - - /* old window must lose an existing mouse capture. */ - if (keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE) { - SDL_Mouse *mouse = SDL_GetMouse(); - - if (mouse->CaptureMouse) { - SDL_CaptureMouse(SDL_FALSE); /* drop the capture. */ - SDL_UpdateMouseCapture(SDL_TRUE); - SDL_assert(!(keyboard->focus->flags & SDL_WINDOW_MOUSE_CAPTURE)); - } else { - keyboard->focus->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; - } - } - SDL_SendWindowEvent(keyboard->focus, SDL_EVENT_WINDOW_FOCUS_LOST, 0, 0); /* Ensures IME compositions are committed */ diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 693655b399967..68b65f92aa78e 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1558,7 +1558,6 @@ static void keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, wind->keyboard_device = NULL; window = wind->sdlwindow; - window->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; /* Stop key repeat before clearing keyboard focus */ keyboard_repeat_clear(&input->keyboard_repeat); diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index cd0d163990115..9a5ab6c6e2c65 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1530,7 +1530,6 @@ static const struct frog_color_managed_surface_listener frog_surface_listener = static void SetKeyboardFocus(SDL_Window *window) { - SDL_Window *kb_focus = SDL_GetKeyboardFocus(); SDL_Window *topmost = window; /* Find the topmost parent */ @@ -1540,11 +1539,6 @@ static void SetKeyboardFocus(SDL_Window *window) topmost->driverdata->keyboard_focus = window; - /* Clear the mouse capture flags before changing keyboard focus */ - if (kb_focus) { - kb_focus->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; - } - window->flags &= ~SDL_WINDOW_MOUSE_CAPTURE; SDL_SetKeyboardFocus(window); } From 7258b36e305356f2c9abf5f783208d7cc5e1cfcd Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 12:58:25 -0700 Subject: [PATCH 116/431] Make it easier to turn on Windows message logging --- src/video/windows/SDL_windowsevents.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 3af82457774c1..748de691208d2 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -43,7 +43,9 @@ #include #endif /* HAVE_TPCSHRD_H */ -/* #define WMMSG_DEBUG */ +#if 0 +#define WMMSG_DEBUG +#endif #ifdef WMMSG_DEBUG #include #include "wmmsg.h" From 017a1039e2e714c181cf61d40afc710d8456d1ac Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 13:03:51 -0700 Subject: [PATCH 117/431] Removed unnecessary cast --- src/events/SDL_keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 5156e0a36550c..44fc1377879ed 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -714,7 +714,7 @@ SDL_Keymod SDL_GetModState(void) { SDL_Keyboard *keyboard = &SDL_keyboard; - return (SDL_Keymod)keyboard->modstate; + return keyboard->modstate; } void SDL_SetModState(SDL_Keymod modstate) From b72c22340e9a3c680011e245c28492bf60f5be66 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 13:04:31 -0700 Subject: [PATCH 118/431] We don't need to pull scancode state to see if ALT is held down --- src/video/windows/SDL_windowsevents.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 748de691208d2..8e6485b3cbf65 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1239,12 +1239,11 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara SDL_bool virtual_key = SDL_FALSE; Uint16 rawcode = 0; SDL_Scancode code = WindowsScanCodeToSDLScanCode(lParam, wParam, &rawcode, &virtual_key); - const Uint8 *keyboardState = SDL_GetKeyboardState(NULL); /* Detect relevant keyboard shortcuts */ - if (keyboardState[SDL_SCANCODE_LALT] == SDL_PRESSED || keyboardState[SDL_SCANCODE_RALT] == SDL_PRESSED) { + if (code == SDL_SCANCODE_F4 && (SDL_GetModState() & SDL_KMOD_ALT)) { /* ALT+F4: Close window */ - if (code == SDL_SCANCODE_F4 && ShouldGenerateWindowCloseOnAltF4()) { + if (ShouldGenerateWindowCloseOnAltF4()) { SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0); } } From 473257cce652773118a0042adbc2636100654b2a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 29 Jun 2024 14:12:50 -0700 Subject: [PATCH 119/431] Added SDL_GetRenderLogicalPresentationRect() Fixes https://github.com/libsdl-org/SDL/issues/8815 --- include/SDL3/SDL_render.h | 17 +++++++++ src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/render/SDL_render.c | 27 ++++++++++++++ test/testautomation_render.c | 60 +++++++++++++++++++++++++++++++ 6 files changed, 107 insertions(+) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index ee94ee9bbb510..a7302b68139e4 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1297,6 +1297,7 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_GetRenderTarget(SDL_Renderer *rende * * \sa SDL_ConvertEventToRenderCoordinates * \sa SDL_GetRenderLogicalPresentation + * \sa SDL_GetRenderLogicalPresentationRect */ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode); @@ -1320,6 +1321,22 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderLogicalPresentation(SDL_Renderer *r */ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode); +/** + * Get the final presentation rectangle for rendering. + * + * This function returns the calculated rectangle used for logical presentation, based on the presentation mode and output size. If logical presentation is disabled, it will fill the rectangle with the output size, in pixels. + * + * \param renderer the rendering context. + * \param rect a pointer filled in with the final presentation rectangle, may be NULL. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetRenderLogicalPresentation + */ +extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect); + /** * Get a point in render coordinates when given a point in window coordinates. * diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 8ca96c833db45..b54b9fd052694 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -393,6 +393,7 @@ SDL3_0.0.0 { SDL_GetRenderDrawColorFloat; SDL_GetRenderDriver; SDL_GetRenderLogicalPresentation; + SDL_GetRenderLogicalPresentationRect; SDL_GetRenderMetalCommandEncoder; SDL_GetRenderMetalLayer; SDL_GetRenderOutputSize; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index d809adcd724e6..b8c98467b2d63 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -418,6 +418,7 @@ #define SDL_GetRenderDrawColorFloat SDL_GetRenderDrawColorFloat_REAL #define SDL_GetRenderDriver SDL_GetRenderDriver_REAL #define SDL_GetRenderLogicalPresentation SDL_GetRenderLogicalPresentation_REAL +#define SDL_GetRenderLogicalPresentationRect SDL_GetRenderLogicalPresentationRect_REAL #define SDL_GetRenderMetalCommandEncoder SDL_GetRenderMetalCommandEncoder_REAL #define SDL_GetRenderMetalLayer SDL_GetRenderMetalLayer_REAL #define SDL_GetRenderOutputSize SDL_GetRenderOutputSize_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 43b85743922f3..740da8cf6aba3 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -438,6 +438,7 @@ SDL_DYNAPI_PROC(int,SDL_GetRenderDrawColor,(SDL_Renderer *a, Uint8 *b, Uint8 *c, SDL_DYNAPI_PROC(int,SDL_GetRenderDrawColorFloat,(SDL_Renderer *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetRenderDriver,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetRenderLogicalPresentation,(SDL_Renderer *a, int *b, int *c, SDL_RendererLogicalPresentation *d, SDL_ScaleMode *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(int,SDL_GetRenderLogicalPresentationRect,(SDL_Renderer *a, SDL_FRect *b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_GetRenderMetalCommandEncoder,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetRenderMetalLayer,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetRenderOutputSize,(SDL_Renderer *a, int *b, int *c),(a,b,c),return) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 0b504ca1d9c9b..ed705272df389 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -2607,6 +2607,33 @@ int SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL return 0; } +int SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect) +{ + if (rect) { + SDL_zerop(rect); + } + + CHECK_RENDERER_MAGIC(renderer, -1); + + if (rect) { + if (renderer->logical_presentation_mode == SDL_LOGICAL_PRESENTATION_DISABLED) { + int output_w = 0, output_h = 0; + + if (SDL_GetRenderOutputSize(renderer, &output_w, &output_h) < 0) { + return -1; + } + + rect->x = 0.0f; + rect->y = 0.0f; + rect->w = (float)output_w; + rect->h = (float)output_h; + } else { + SDL_copyp(rect, &renderer->logical_dst_rect); + } + } + return 0; +} + static void SDL_RenderLogicalBorders(SDL_Renderer *renderer) { const SDL_FRect *dst = &renderer->logical_dst_rect; diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 704bb41e362bb..644c6f4534d6e 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -920,6 +920,10 @@ static int render_testLogicalSize(void *arg) SDL_Rect viewport; SDL_FRect rect; int w, h; + int set_w, set_h; + SDL_RendererLogicalPresentation set_presentation_mode; + SDL_ScaleMode set_scale_mode; + SDL_FRect set_rect; const int factor = 2; viewport.x = ((TESTRENDER_SCREEN_W / 4) / factor) * factor; @@ -940,6 +944,20 @@ static int render_testLogicalSize(void *arg) CHECK_FUNC(SDL_SetRenderLogicalPresentation, (renderer, w / factor, h / factor, SDL_LOGICAL_PRESENTATION_LETTERBOX, SDL_SCALEMODE_NEAREST)) + CHECK_FUNC(SDL_GetRenderLogicalPresentation, (renderer, &set_w, &set_h, &set_presentation_mode, &set_scale_mode)) + SDLTest_AssertCheck( + set_w == (w / factor) && + set_h == (h / factor) && + set_presentation_mode == SDL_LOGICAL_PRESENTATION_LETTERBOX && + set_scale_mode == SDL_SCALEMODE_NEAREST, + "Validate result from SDL_GetRenderLogicalPresentation, got %d, %d, %d, %d", set_w, set_h, set_presentation_mode, set_scale_mode); + CHECK_FUNC(SDL_GetRenderLogicalPresentationRect, (renderer, &set_rect)) + SDLTest_AssertCheck( + set_rect.x == 0.0f && + set_rect.y == 0.0f && + set_rect.w == 320.0f && + set_rect.h == 240.0f, + "Validate result from SDL_GetRenderLogicalPresentationRect, got {%g, %g, %gx%g}", set_rect.x, set_rect.y, set_rect.w, set_rect.h); CHECK_FUNC(SDL_SetRenderDrawColor, (renderer, 0, 255, 0, SDL_ALPHA_OPAQUE)) rect.x = (float)viewport.x / factor; rect.y = (float)viewport.y / factor; @@ -949,6 +967,20 @@ static int render_testLogicalSize(void *arg) CHECK_FUNC(SDL_SetRenderLogicalPresentation, (renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_SCALEMODE_NEAREST)) + CHECK_FUNC(SDL_GetRenderLogicalPresentation, (renderer, &set_w, &set_h, &set_presentation_mode, &set_scale_mode)) + SDLTest_AssertCheck( + set_w == 0 && + set_h == 0 && + set_presentation_mode == SDL_LOGICAL_PRESENTATION_DISABLED && + set_scale_mode == SDL_SCALEMODE_NEAREST, + "Validate result from SDL_GetRenderLogicalPresentation, got %d, %d, %d, %d", set_w, set_h, set_presentation_mode, set_scale_mode); + CHECK_FUNC(SDL_GetRenderLogicalPresentationRect, (renderer, &set_rect)) + SDLTest_AssertCheck( + set_rect.x == 0.0f && + set_rect.y == 0.0f && + set_rect.w == 320.0f && + set_rect.h == 240.0f, + "Validate result from SDL_GetRenderLogicalPresentationRect, got {%g, %g, %gx%g}", set_rect.x, set_rect.y, set_rect.w, set_rect.h); /* Check to see if final image matches. */ compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); @@ -999,11 +1031,39 @@ static int render_testLogicalSize(void *arg) h, SDL_LOGICAL_PRESENTATION_LETTERBOX, SDL_SCALEMODE_LINEAR)) + CHECK_FUNC(SDL_GetRenderLogicalPresentation, (renderer, &set_w, &set_h, &set_presentation_mode, &set_scale_mode)) + SDLTest_AssertCheck( + set_w == w - 2 * (TESTRENDER_SCREEN_W / 4) && + set_h == h && + set_presentation_mode == SDL_LOGICAL_PRESENTATION_LETTERBOX && + set_scale_mode == SDL_SCALEMODE_LINEAR, + "Validate result from SDL_GetRenderLogicalPresentation, got %d, %d, %d, %d", set_w, set_h, set_presentation_mode, set_scale_mode); + CHECK_FUNC(SDL_GetRenderLogicalPresentationRect, (renderer, &set_rect)) + SDLTest_AssertCheck( + set_rect.x == 20.0f && + set_rect.y == 0.0f && + set_rect.w == 280.0f && + set_rect.h == 240.0f, + "Validate result from SDL_GetRenderLogicalPresentationRect, got {%g, %g, %gx%g}", set_rect.x, set_rect.y, set_rect.w, set_rect.h); CHECK_FUNC(SDL_SetRenderDrawColor, (renderer, 0, 255, 0, SDL_ALPHA_OPAQUE)) CHECK_FUNC(SDL_RenderFillRect, (renderer, NULL)) CHECK_FUNC(SDL_SetRenderLogicalPresentation, (renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_SCALEMODE_NEAREST)) + CHECK_FUNC(SDL_GetRenderLogicalPresentation, (renderer, &set_w, &set_h, &set_presentation_mode, &set_scale_mode)) + SDLTest_AssertCheck( + set_w == 0 && + set_h == 0 && + set_presentation_mode == SDL_LOGICAL_PRESENTATION_DISABLED && + set_scale_mode == SDL_SCALEMODE_NEAREST, + "Validate result from SDL_GetRenderLogicalPresentation, got %d, %d, %d, %d", set_w, set_h, set_presentation_mode, set_scale_mode); + CHECK_FUNC(SDL_GetRenderLogicalPresentationRect, (renderer, &set_rect)) + SDLTest_AssertCheck( + set_rect.x == 0.0f && + set_rect.y == 0.0f && + set_rect.w == 320.0f && + set_rect.h == 240.0f, + "Validate result from SDL_GetRenderLogicalPresentationRect, got {%g, %g, %gx%g}", set_rect.x, set_rect.y, set_rect.w, set_rect.h); /* Check to see if final image matches. */ compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); From ede44834203dae67ba5883db742b5bc46e089514 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 29 Jun 2024 21:26:31 +0000 Subject: [PATCH 120/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_render.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index a7302b68139e4..5dc8fa3ef545f 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1324,10 +1324,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetRenderLogicalPresentation(SDL_Renderer *r /** * Get the final presentation rectangle for rendering. * - * This function returns the calculated rectangle used for logical presentation, based on the presentation mode and output size. If logical presentation is disabled, it will fill the rectangle with the output size, in pixels. + * This function returns the calculated rectangle used for logical + * presentation, based on the presentation mode and output size. If logical + * presentation is disabled, it will fill the rectangle with the output size, + * in pixels. * * \param renderer the rendering context. - * \param rect a pointer filled in with the final presentation rectangle, may be NULL. + * \param rect a pointer filled in with the final presentation rectangle, may + * be NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * From 1f0bc4b808a5da933ce4fedee89e2d42eb862498 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sun, 30 Jun 2024 12:16:50 -0400 Subject: [PATCH 121/431] x11: Check for button presses before clearing an XInput2 pointer grab XInput2 will grab the pointer on button presses, which causes the grab attempt to fail and ultimately timeout since the pointer is already grabbed, however, ungrabbing the pointer when no buttons are pressed and the pointer is outside the window can generate enter/leave notify events, which result in further calls of the grab function. The end result is an infinite loop of grab/ungrab attempts generating enter/leave events. This causes a hang in testautomation when creating a window with the grabbed flag if the pointer is not positioned within window bounds. Check the button state and only ungrab if a mouse button is in the pressed state. --- src/video/x11/SDL_x11window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index d696ced794ac3..60e5a32817839 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1856,10 +1856,11 @@ int X11_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool } /* If XInput2 is enabled, it will grab the pointer on button presses, - * which results in XGrabPointer returning AlreadyGrabbed. Clear any - * existing grabs before attempting the confinement grab. + * which results in XGrabPointer returning AlreadyGrabbed. If buttons + * are currently pressed, clear any existing grabs before attempting + * the confinement grab. */ - if (data->xinput2_mouse_enabled) { + if (data->xinput2_mouse_enabled && SDL_GetMouseState(NULL, NULL)) { X11_XUngrabPointer(display, CurrentTime); } From 9601d98e7f108b79b738ccb2c6710e9186f69fe5 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 30 Jun 2024 13:11:07 +0200 Subject: [PATCH 122/431] SDL_test: always use symbols with 64-suffix from DbgHelp --- src/test/SDL_test_memory.c | 68 +++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 38 deletions(-) diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c index ca5ff62035e1c..21371399ba620 100644 --- a/src/test/SDL_test_memory.c +++ b/src/test/SDL_test_memory.c @@ -29,19 +29,12 @@ #include #include -static void *s_dbghelp; - -typedef BOOL (__stdcall *dbghelp_SymInitialize_fn)(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess); - -typedef BOOL (__stdcall *dbghelp_SymFromAddr_fn)(HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol); -static dbghelp_SymFromAddr_fn dbghelp_SymFromAddr; - -#ifdef _WIN64 -typedef BOOL (__stdcall *dbghelp_SymGetLineFromAddr_fn)(HANDLE hProcess, DWORD64 qwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line); -#else -typedef BOOL (__stdcall *dbghelp_SymGetLineFromAddr_fn)(HANDLE hProcess, DWORD qwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE Line); -#endif -static dbghelp_SymGetLineFromAddr_fn dbghelp_SymGetLineFromAddr; +static struct { + HMODULE module; + BOOL (WINAPI *pSymInitialize)(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess); + BOOL (WINAPI *pSymFromAddr)(HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol); + BOOL (WINAPI *pSymGetLineFromAddr64)(HANDLE hProcess, DWORD64 qwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line); +} dyn_dbghelp; /* older SDKs might not have this: */ __declspec(dllimport) USHORT WINAPI RtlCaptureStackBackTrace(ULONG FramesToSkip, ULONG FramesToCapture, PVOID* BackTrace, PULONG BackTraceHash); @@ -169,16 +162,16 @@ static void SDL_TrackAllocation(void *mem, size_t size) DWORD lineColumn = 0; pSymbol->SizeOfStruct = sizeof(SYMBOL_INFO); pSymbol->MaxNameLen = MAX_SYM_NAME; - IMAGEHLP_LINE line; + IMAGEHLP_LINE64 line; line.SizeOfStruct = sizeof(line); entry->stack[i] = (Uint64)(uintptr_t)frames[i]; - if (s_dbghelp) { - if (!dbghelp_SymFromAddr(GetCurrentProcess(), (DWORD64)(uintptr_t)frames[i], &dwDisplacement, pSymbol)) { + if (dyn_dbghelp.module) { + if (!dyn_dbghelp.pSymFromAddr(GetCurrentProcess(), (DWORD64)(uintptr_t)frames[i], &dwDisplacement, pSymbol)) { SDL_strlcpy(pSymbol->Name, "???", MAX_SYM_NAME); dwDisplacement = 0; } - if (!dbghelp_SymGetLineFromAddr(GetCurrentProcess(), (DWORD64)(uintptr_t)frames[i], &lineColumn, &line)) { + if (!dyn_dbghelp.pSymGetLineFromAddr64(GetCurrentProcess(), (DWORD64)(uintptr_t)frames[i], &lineColumn, &line)) { line.FileName = ""; line.LineNumber = 0; } @@ -296,28 +289,27 @@ void SDLTest_TrackAllocations(void) SDL_Log("SDLTest_TrackAllocations(): There are %d previous allocations, disabling free() validation", s_previous_allocations); } #ifdef SDL_PLATFORM_WIN32 - { - s_dbghelp = SDL_LoadObject("dbghelp.dll"); - if (s_dbghelp) { - dbghelp_SymInitialize_fn dbghelp_SymInitialize; - dbghelp_SymInitialize = (dbghelp_SymInitialize_fn)SDL_LoadFunction(s_dbghelp, "SymInitialize"); - dbghelp_SymFromAddr = (dbghelp_SymFromAddr_fn)SDL_LoadFunction(s_dbghelp, "SymFromAddr"); -#ifdef _WIN64 - dbghelp_SymGetLineFromAddr = (dbghelp_SymGetLineFromAddr_fn)SDL_LoadFunction(s_dbghelp, "SymGetLineFromAddr64"); -#else - dbghelp_SymGetLineFromAddr = (dbghelp_SymGetLineFromAddr_fn)SDL_LoadFunction(s_dbghelp, "SymGetLineFromAddr"); -#endif - if (!dbghelp_SymInitialize || !dbghelp_SymFromAddr || !dbghelp_SymGetLineFromAddr) { - SDL_UnloadObject(s_dbghelp); - s_dbghelp = NULL; - } else { - if (!dbghelp_SymInitialize(GetCurrentProcess(), NULL, TRUE)) { - SDL_UnloadObject(s_dbghelp); - s_dbghelp = NULL; - } - } + do { + dyn_dbghelp.module = SDL_LoadObject("dbghelp.dll"); + if (!dyn_dbghelp.module) { + goto dbghelp_failed; } - } + dyn_dbghelp.pSymInitialize = (void *)SDL_LoadFunction(dyn_dbghelp.module, "SymInitialize"); + dyn_dbghelp.pSymFromAddr = (void *)SDL_LoadFunction(dyn_dbghelp.module, "SymFromAddr"); + dyn_dbghelp.pSymGetLineFromAddr64 = (void *)SDL_LoadFunction(dyn_dbghelp.module, "SymGetLineFromAddr64"); + if (!dyn_dbghelp.pSymInitialize || !dyn_dbghelp.pSymFromAddr || !dyn_dbghelp.pSymGetLineFromAddr64) { + goto dbghelp_failed; + } + if (!dyn_dbghelp.pSymInitialize(GetCurrentProcess(), NULL, TRUE)) { + goto dbghelp_failed; + } + break; +dbghelp_failed: + if (dyn_dbghelp.module) { + SDL_UnloadObject(dyn_dbghelp.module); + dyn_dbghelp.module = NULL; + } + } while (0); #endif SDL_GetMemoryFunctions(&SDL_malloc_orig, From 8290c4e82e430efe095c51414e91cee53f18132d Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 1 Jul 2024 16:14:31 +0200 Subject: [PATCH 123/431] sdlprocdump: also print a stacktrace on a fatal exception --- test/win32/sdlprocdump.c | 358 +++++++++++++++++++++++++++++++++------ 1 file changed, 305 insertions(+), 53 deletions(-) diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c index c5fab0994fa5a..c23a4625e3a9e 100644 --- a/test/win32/sdlprocdump.c +++ b/test/win32/sdlprocdump.c @@ -1,20 +1,119 @@ #include #include +#include +#include #include #include -#define APPNAME "[SDLPROCDUMP]" #define DUMP_FOLDER "minidumps" +#define APPNAME "SDLPROCDUMP" -typedef BOOL (WINAPI *MiniDumpWriteDumpFuncType)( - HANDLE hProcess, - DWORD ProcessId, - HANDLE hFile, - MINIDUMP_TYPE DumpType, - PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, - PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, - PMINIDUMP_CALLBACK_INFORMATION CallbackParam); +#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86) +#define SDLPROCDUMP_CPU_X86 1 +#elif defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) +#define SDLPROCDUMP_CPU_X64 1 +#elif defined(__aarch64__) || defined(_M_ARM64) +#define SDLPROCDUMP_CPU_ARM64 1 +#elif defined(__arm__) || defined(_M_ARM) +#define SDLPROCDUMP_CPU_ARM32 1 +#endif + +#if defined(SDLPROCDUMP_CPU_X86) || defined(SDLPROCDUMP_CPU_X64) || defined(SDLPROCDUMP_CPU_ARM32) || defined(SDLPROCDUMP_CPU_ARM64) +#define SDLPROCDUMP_PRINTSTACK +#else +#pragma message("Unsupported architecture: don't know how to StackWalk") +#endif + +static void printf_message(const char *format, ...) { + va_list ap; + fprintf(stderr, "[" APPNAME "] "); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + fprintf(stderr, "\n"); +} + +static void printf_windows_message(const char *format, ...) { + va_list ap; + char win_msg[512]; + FormatMessageA( + FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + win_msg, sizeof(win_msg)/sizeof(*win_msg), + NULL); + size_t win_msg_len = strlen(win_msg); + while (win_msg[win_msg_len-1] == '\r' || win_msg[win_msg_len-1] == '\n' || win_msg[win_msg_len-1] == ' ') { + win_msg[win_msg_len-1] = '\0'; + win_msg_len--; + } + fprintf(stderr, "[" APPNAME "] "); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + fprintf(stderr, " (%s)\n", win_msg); +} + +struct { + HMODULE module; + BOOL (WINAPI *pSymInitialize)(HANDLE hProcess, PCSTR UserSearchPath, BOOL fInvadeProcess); + BOOL (WINAPI *pSymCleanup)(HANDLE hProcess); + BOOL (WINAPI *pMiniDumpWriteDump)( + HANDLE hProcess, + DWORD ProcessId, + HANDLE hFile, + MINIDUMP_TYPE DumpType, + PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, + PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam, + PMINIDUMP_CALLBACK_INFORMATION CallbackParam); + BOOL (WINAPI *pSymFromAddr)(HANDLE hProcess, DWORD64 Address, PDWORD64 Displacement, PSYMBOL_INFO Symbol); + BOOL (WINAPI *pSymGetLineFromAddr64)(HANDLE hProcess, DWORD64 qwAddr, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line); + BOOL (WINAPI *pStackWalk64)(DWORD MachineType, HANDLE hProcess, HANDLE hThread, LPSTACKFRAME64 StackFrame, + PVOID ContextRecord, PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine, + PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine, + PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine, PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress); + PVOID (WINAPI *pSymFunctionTableAccess64)(HANDLE hProcess, DWORD64 AddrBase); + DWORD64 (WINAPI *pSymGetModuleBase64)(HANDLE hProcess, DWORD64 qwAddr); + BOOL (WINAPI *pSymGetModuleInfo64)(HANDLE hProcess, DWORD64 qwAddr, PIMAGEHLP_MODULE64 ModuleInfo); + BOOL (WINAPI *pSymRefreshModuleList)(HANDLE hProcess); +} dyn_dbghelp; + +static void load_dbghelp(void) { + if (dyn_dbghelp.module) { + return; + } + dyn_dbghelp.module = LoadLibraryA("dbghelp.dll"); + if (!dyn_dbghelp.module) { + printf_message("Failed to load dbghelp.dll"); + goto failed; + } + dyn_dbghelp.pSymInitialize = (void *)GetProcAddress(dyn_dbghelp.module, "SymInitialize"); + dyn_dbghelp.pSymCleanup = (void *)GetProcAddress(dyn_dbghelp.module, "SymCleanup"); + dyn_dbghelp.pMiniDumpWriteDump = (void *)GetProcAddress(dyn_dbghelp.module, "MiniDumpWriteDump"); + dyn_dbghelp.pSymFromAddr = (void *)GetProcAddress(dyn_dbghelp.module, "SymFromAddr"); + dyn_dbghelp.pStackWalk64 = (void *)GetProcAddress(dyn_dbghelp.module, "StackWalk64"); + dyn_dbghelp.pSymGetLineFromAddr64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymGetLineFromAddr64"); + dyn_dbghelp.pSymFunctionTableAccess64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymFunctionTableAccess64"); + dyn_dbghelp.pSymGetModuleBase64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymGetModuleBase64"); + dyn_dbghelp.pSymGetModuleInfo64 = (void *)GetProcAddress(dyn_dbghelp.module, "SymGetModuleInfo64"); + dyn_dbghelp.pSymRefreshModuleList = (void *)GetProcAddress(dyn_dbghelp.module, "SymRefreshModuleList"); + return; +failed: + if (dyn_dbghelp.module) { + FreeLibrary(dyn_dbghelp.module); + dyn_dbghelp.module = NULL; + } +} + +static void unload_dbghelp(void) { + if (!dyn_dbghelp.module) { + return; + } + FreeLibrary(dyn_dbghelp.module); + memset(&dyn_dbghelp, 0, sizeof(dyn_dbghelp)); +} #define FOREACH_EXCEPTION_CODES(X) \ X(EXCEPTION_ACCESS_VIOLATION) \ @@ -46,8 +145,7 @@ static const char *exceptionCode_to_string(DWORD dwCode) { switch (dwCode) { FOREACH_EXCEPTION_CODES(SWITCH_CODE_STR) default: { - static const char unknown[] = "unknown"; - return unknown; + return "unknown"; } } #undef SWITCH_CODE_STR @@ -58,6 +156,7 @@ static int IsFatalExceptionCode(DWORD dwCode) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: case EXCEPTION_IN_PAGE_ERROR: + case EXCEPTION_ILLEGAL_INSTRUCTION: case EXCEPTION_INT_DIVIDE_BY_ZERO: case EXCEPTION_STACK_OVERFLOW: case STATUS_HEAP_CORRUPTION: @@ -70,36 +169,35 @@ static int IsFatalExceptionCode(DWORD dwCode) { } } -static void format_windows_error_message(const char *message) { - char win_msg[512]; - FormatMessageA( - FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - win_msg, sizeof(win_msg)/sizeof(*win_msg), - NULL); - size_t win_msg_len = strlen(win_msg); - while (win_msg[win_msg_len-1] == '\r' || win_msg[win_msg_len-1] == '\n' || win_msg[win_msg_len-1] == ' ') { - win_msg[win_msg_len-1] = '\0'; - win_msg_len--; +static const char *get_simple_basename(const char *path) { + const char *pos = strrchr(path, '\\'); + if (pos) { + return pos + 1; + } + pos = strrchr(path, '/'); + if (pos) { + return pos + 1; } - fprintf(stderr, "%s %s (%s)\n", APPNAME, message, win_msg); + return path; } -static void create_minidump(const char *child_file_path, const LPPROCESS_INFORMATION process_information, DWORD dwThreadId) { +static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMATION process_information, DWORD dwThreadId) { BOOL success; char dump_file_path[MAX_PATH]; char child_file_name[64]; HANDLE hFile = INVALID_HANDLE_VALUE; HMODULE dbghelp_module = NULL; - MiniDumpWriteDumpFuncType MiniDumpWriteDumpFunc = NULL; MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information; SYSTEMTIME system_time; + if (!dyn_dbghelp.pMiniDumpWriteDump) { + printf_message("Cannot find pMiniDumpWriteDump in dbghelp.dll: no minidump"); + return; + } + success = CreateDirectoryA(DUMP_FOLDER, NULL); if (!success && GetLastError() != ERROR_ALREADY_EXISTS) { - format_windows_error_message("Failed to create minidump directory"); + printf_windows_message("Failed to create minidump directory"); goto post_dump; } _splitpath_s(child_file_path, NULL, 0, NULL, 0, child_file_name, sizeof(child_file_name), NULL, 0); @@ -109,7 +207,8 @@ static void create_minidump(const char *child_file_path, const LPPROCESS_INFORMA child_file_name, system_time.wYear, system_time.wMonth, system_time.wDay, system_time.wHour, system_time.wMinute, system_time.wSecond); - fprintf(stderr, "%s Writing minidump to \"%s\"\n", APPNAME, dump_file_path); + printf_message(""); + printf_message("Writing minidump to \"%s\"", dump_file_path); hFile = CreateFileA( dump_file_path, GENERIC_WRITE, @@ -119,23 +218,13 @@ static void create_minidump(const char *child_file_path, const LPPROCESS_INFORMA FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { - format_windows_error_message("Failed to open file for minidump"); - goto post_dump; - } - dbghelp_module = LoadLibraryA("dbghelp.dll"); - if (!dbghelp_module) { - format_windows_error_message("Failed to load dbghelp.dll"); - goto post_dump; - } - MiniDumpWriteDumpFunc = (MiniDumpWriteDumpFuncType)GetProcAddress(dbghelp_module, "MiniDumpWriteDump"); - if (!MiniDumpWriteDumpFunc) { - format_windows_error_message("Failed to find MiniDumpWriteDump in dbghelp.dll"); + printf_windows_message("Failed to open file for minidump"); goto post_dump; } minidump_exception_information.ClientPointers = FALSE; minidump_exception_information.ExceptionPointers = FALSE; minidump_exception_information.ThreadId = dwThreadId; - success = MiniDumpWriteDumpFunc( + success = dyn_dbghelp.pMiniDumpWriteDump( process_information->hProcess, /* HANDLE hProcess */ process_information->dwProcessId, /* DWORD ProcessId */ hFile, /* HANDLE hFile */ @@ -144,7 +233,7 @@ static void create_minidump(const char *child_file_path, const LPPROCESS_INFORMA NULL, /* PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam */ NULL); /* PMINIDUMP_CALLBACK_INFORMATION CallbackParam */ if (!success) { - format_windows_error_message("Failed to write minidump"); + printf_windows_message("Failed to write minidump"); } post_dump: if (hFile != INVALID_HANDLE_VALUE) { @@ -155,6 +244,144 @@ static void create_minidump(const char *child_file_path, const LPPROCESS_INFORMA } } +static void print_stacktrace(const LPPROCESS_INFORMATION process_information, LPVOID address) { + STACKFRAME64 stack_frame; + CONTEXT context; + HANDLE thread_handle = NULL; + + if (!dyn_dbghelp.pStackWalk64) { + printf_message("Cannot find StackWalk64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymFunctionTableAccess64) { + printf_message("Cannot find SymFunctionTableAccess64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymGetModuleBase64) { + printf_message("Cannot find SymGetModuleBase64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymFromAddr) { + printf_message("Cannot find pSymFromAddr in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymGetLineFromAddr64) { + printf_message("Cannot find SymGetLineFromAddr64 in dbghelp.dll: no stacktrace"); + return; + } + if (!dyn_dbghelp.pSymGetModuleInfo64) { + printf_message("Cannot find SymGetModuleInfo64 in dbghelp.dll: no stacktrace"); + return; + } + + thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, process_information->dwThreadId); + if (!thread_handle) { + printf_windows_message("OpenThread failed: no stacktrace"); + goto cleanup; + } + + memset(&context, 0, sizeof(context)); + context.ContextFlags = CONTEXT_ALL; + if (!GetThreadContext(thread_handle, &context)) { + printf_windows_message("GetThreadContext failed: no stacktrace"); + goto cleanup; + } + + if (!dyn_dbghelp.pSymRefreshModuleList || !dyn_dbghelp.pSymRefreshModuleList(process_information->hProcess)) { + printf_windows_message("SymRefreshModuleList failed: maybe no stacktrace"); + } + + memset(&stack_frame, 0, sizeof(stack_frame)); + + stack_frame.AddrPC.Mode = AddrModeFlat; + stack_frame.AddrFrame.Mode = AddrModeFlat; + stack_frame.AddrStack.Mode = AddrModeFlat; + +#if defined(SDLPROCDUMP_CPU_X86) + DWORD machine_type = IMAGE_FILE_MACHINE_I386; + stack_frame.AddrFrame.Offset = context.Ebp; + stack_frame.AddrStack.Offset = context.Esp; + stack_frame.AddrPC.Offset = context.Eip; +#elif defined(SDLPROCDUMP_CPU_X64) + DWORD machine_type = IMAGE_FILE_MACHINE_AMD64; + stack_frame.AddrFrame.Offset = context.Rbp; + stack_frame.AddrStack.Offset = context.Rsp; + stack_frame.AddrPC.Offset = context.Rip; +#elif defined(SDLPROCDUMP_CPU_ARM32) + DWORD machine_type = IMAGE_FILE_MACHINE_ARM; + stack_frame.AddrFrame.Offset = context.Lr; + stack_frame.AddrStack.Offset = context.Sp; + stack_frame.AddrPC.Offset = context.Pc; +#elif defined(SDLPROCDUMP_CPU_ARM64) + DWORD machine_type = IMAGE_FILE_MACHINE_ARM64; + stack_frame.AddrFrame.Offset = context.Fp; + stack_frame.AddrStack.Offset = context.Sp; + stack_frame.AddrPC.Offset = context.Pc; +#endif + while (dyn_dbghelp.pStackWalk64(machine_type, /* DWORD MachineType */ + process_information->hProcess, /* HANDLE hProcess */ + process_information->hThread, /* HANDLE hThread */ + &stack_frame, /* LPSTACKFRAME64 StackFrame */ + &context, /* PVOID ContextRecord */ + NULL, /* PREAD_PROCESS_MEMORY_ROUTINE64 ReadMemoryRoutine */ + dyn_dbghelp.pSymFunctionTableAccess64, /* PFUNCTION_TABLE_ACCESS_ROUTINE64 FunctionTableAccessRoutine */ + dyn_dbghelp.pSymGetModuleBase64, /* PGET_MODULE_BASE_ROUTINE64 GetModuleBaseRoutine */ + NULL)) { /* PTRANSLATE_ADDRESS_ROUTINE64 TranslateAddress */ + + IMAGEHLP_MODULE64 module_info; + union { + char buffer[sizeof(SYMBOL_INFO) + MAX_SYM_NAME * sizeof(CHAR)]; + SYMBOL_INFO symbol_info; + } symbol; + DWORD64 dwDisplacement; + DWORD lineColumn = 0; + IMAGEHLP_LINE64 line; + const char *image_file_name; + const char *symbol_name; + const char *file_name; + char line_number[16]; + + if (stack_frame.AddrPC.Offset == stack_frame.AddrReturn.Offset) { + printf_message("PC == Return Address => Possible endless callstack"); + break; + } + + memset(&module_info, 0, sizeof(module_info)); + module_info.SizeOfStruct = sizeof(module_info); + if (!dyn_dbghelp.pSymGetModuleInfo64(process_information->hProcess, stack_frame.AddrPC.Offset, &module_info)) { + image_file_name = "?"; + } else { + image_file_name = get_simple_basename(module_info.ImageName); + } + + memset(&symbol, 0, sizeof(symbol)); + symbol.symbol_info.SizeOfStruct = sizeof(symbol.symbol_info); + symbol.symbol_info.MaxNameLen = MAX_SYM_NAME; + if (!dyn_dbghelp.pSymFromAddr(process_information->hProcess, (DWORD64)(uintptr_t)stack_frame.AddrPC.Offset, &dwDisplacement, &symbol.symbol_info)) { + symbol_name = "???"; + dwDisplacement = 0; + } else { + symbol_name = symbol.symbol_info.Name; + } + + line.SizeOfStruct = sizeof(line); + if (!dyn_dbghelp.pSymGetLineFromAddr64(process_information->hProcess, (DWORD64)(uintptr_t)stack_frame.AddrPC.Offset, &lineColumn, &line)) { + file_name = ""; + line_number[0] = '\0'; + } else { + file_name = line.FileName; + snprintf(line_number, sizeof(line_number), "Line %u", (unsigned int)line.LineNumber); + } + printf_message("%s!%s+0x%x %s %s", image_file_name, symbol_name, dwDisplacement, file_name, line_number); + } + +cleanup: + if (thread_handle) { + CloseHandle(thread_handle); + } + return; +} + int main(int argc, char *argv[]) { int i; size_t command_line_len = 0; @@ -176,7 +403,7 @@ int main(int argc, char *argv[]) { } command_line = malloc(command_line_len + 1); if (!command_line) { - fprintf(stderr, "%s Failed to allocate memory for command line\n", APPNAME); + printf_message("Failed to allocate memory for command line"); return 1; } command_line[0] = '\0'; @@ -208,7 +435,7 @@ int main(int argc, char *argv[]) { &process_information); /* LPPROCESS_INFORMATION lpProcessInformation */ if (!success) { - fprintf(stderr, "%s Failed to start application\n", APPNAME); + printf_windows_message("Failed to start application"); return 1; } @@ -221,24 +448,45 @@ int main(int argc, char *argv[]) { DWORD continue_status = DBG_CONTINUE; success = WaitForDebugEvent(&event, INFINITE); if (!success) { - fprintf(stderr, "%s Failed to get a debug event\n", APPNAME); + printf_message("Failed to get a debug event"); return 1; } switch (event.dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: if (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)) { - fprintf(stderr, "%s EXCEPTION_DEBUG_EVENT ExceptionCode: 0x%08lx (%s) ExceptionFlags: 0x%08lx\n", - APPNAME, - event.u.Exception.ExceptionRecord.ExceptionCode, - exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode), - event.u.Exception.ExceptionRecord.ExceptionFlags); - fprintf(stderr, "%s Non-continuable exception debug event\n", APPNAME); - create_minidump(argv[1], &process_information, event.dwThreadId); + printf_message("EXCEPTION_DEBUG_EVENT"); + printf_message(" ExceptionCode: 0x%08lx (%s)", + event.u.Exception.ExceptionRecord.ExceptionCode, + exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode)); + printf_message(" ExceptionFlags: 0x%08lx", + event.u.Exception.ExceptionRecord.ExceptionFlags); + printf_message(" ExceptionAddress: 0x%08lx", + event.u.Exception.ExceptionRecord.ExceptionAddress); + printf_message(" (Non-continuable exception debug event)"); + write_minidump(argv[1], &process_information, event.dwThreadId); + printf_message(""); +#ifdef SDLPROCDUMP_PRINTSTACK + print_stacktrace(&process_information, event.u.Exception.ExceptionRecord.ExceptionAddress); +#else + printf_message("No support for printing stacktrack for current architecture"); +#endif DebugActiveProcessStop(event.dwProcessId); process_alive = 0; } continue_status = DBG_EXCEPTION_HANDLED; break; + case CREATE_PROCESS_DEBUG_EVENT: + load_dbghelp(); + if (!dyn_dbghelp.pSymInitialize) { + printf_message("Cannot find pSymInitialize in dbghelp.dll: no stacktrace"); + break; + } + /* Don't invade process on CI: downloading symbols will cause test timeouts */ + if (!dyn_dbghelp.pSymInitialize(process_information.hProcess, NULL, FALSE)) { + printf_windows_message("pSymInitialize failed: no stacktrace"); + break; + } + break; case EXIT_PROCESS_DEBUG_EVENT: exit_code = event.u.ExitProcess.dwExitCode; if (event.dwProcessId == process_information.dwProcessId) { @@ -253,12 +501,16 @@ int main(int argc, char *argv[]) { } } } + if (dyn_dbghelp.pSymCleanup) { + dyn_dbghelp.pSymCleanup(process_information.hProcess); + } + unload_dbghelp(); exit_code = 1; success = GetExitCodeProcess(process_information.hProcess, &exit_code); if (!success) { - fprintf(stderr, "%s Failed to get process exit code\n", APPNAME); + printf_message("Failed to get process exit code"); return 1; } From 5755bde3b85fe0e7c77354bda6b787dfb8f350d2 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Mon, 1 Jul 2024 20:36:18 +0000 Subject: [PATCH 124/431] Sync SDL3 wiki -> header --- docs/README-wayland.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/README-wayland.md b/docs/README-wayland.md index bd6601cc2afa1..7f831fe6ed316 100644 --- a/docs/README-wayland.md +++ b/docs/README-wayland.md @@ -194,7 +194,7 @@ int main(int argc, char *argv[]) /* Draw a blue screen for the window until ESC is pressed or the window is no longer visible. */ while (!done) { while (SDL_PollEvent(&e)) { - if (e.type == SDL_EVENT_KEY_DOWN && e.key.keysym.sym == SDLK_ESCAPE) { + if (e.type == SDL_EVENT_KEY_DOWN && e.key.key == SDLK_ESCAPE) { done = 1; } } From d9dc4b320ad4023b51806faf419b3e2b4403fe0c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2024 19:58:48 -0700 Subject: [PATCH 125/431] The keycode in key events is the base, unmodified, keycode for the current keyboard layout --- include/SDL3/SDL_events.h | 5 + include/SDL3/SDL_hints.h | 8 +- include/SDL3/SDL_keycode.h | 26 ----- include/SDL3/SDL_scancode.h | 2 + src/core/haiku/SDL_BApp.h | 5 - src/core/linux/SDL_evdev.c | 8 +- src/events/SDL_keyboard.c | 125 +++++++++++++--------- src/events/SDL_keyboard_c.h | 5 +- src/events/SDL_keymap.c | 13 ++- src/test/SDL_test_common.c | 13 --- src/video/haiku/SDL_bkeyboard.cc | 19 ---- src/video/haiku/SDL_bkeyboard.h | 2 - src/video/uikit/SDL_uikitviewcontroller.m | 4 +- test/testaudiostreamdynamicresample.c | 14 +-- test/testintersections.c | 34 +++--- 15 files changed, 124 insertions(+), 159 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index d3e84af0fa362..112816717698b 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -315,6 +315,11 @@ typedef struct SDL_KeyboardDeviceEvent /** * Keyboard button event structure (event.key.*) * + * The `key` is the base SDL_Keycode generated by pressing the `scancode` using the current keyboard layout, applying any options specified in SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the event scancode and modifiers directly from the keyboard layout, bypassing SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode(). + * + * \sa SDL_GetKeyFromScancode + * \sa SDL_HINT_KEYCODE_OPTIONS + * * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_KeyboardEvent diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index e5913bf4bfd56..62847ea24c9ce 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -1999,11 +1999,7 @@ extern "C" { * This variable is a comma separated set of options for translating keycodes * in events: * - * - "unmodified": The keycode is the symbol generated by pressing the key - * without any modifiers applied. e.g. Shift+A would yield the keycode - * SDLK_a, or 'a'. - * - "modified": The keycode is the symbol generated by pressing the key with - * modifiers applied. e.g. Shift+A would yield the keycode SDLK_A, or 'A'. + * - "none": Keycode options are cleared, this overrides other options. * - "french_numbers": The number row on French keyboards is inverted, so * pressing the 1 key would yield the keycode SDLK_1, or '1', instead of * SDLK_AMPERSAND, or '&' @@ -2012,7 +2008,7 @@ extern "C" { * layout. e.g. pressing the key associated with SDL_SCANCODE_A on a Russian * keyboard would yield 'a' instead of 'Ñ„'. * - * The default value for this hint is equivalent to "modified,french_numbers" + * The default value for this hint is "french_numbers" * * Some platforms like Emscripten only provide modified keycodes and the * options are not used. diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index e2a14951e6c29..f3a98a34b1721 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -88,32 +88,6 @@ typedef Uint32 SDL_Keycode; #define SDLK_GREATER 0x0000003eu /* '>' */ #define SDLK_QUESTION 0x0000003fu /* '?' */ #define SDLK_AT 0x00000040u /* '@' */ -#define SDLK_A 0x00000041u /* 'A' */ -#define SDLK_B 0x00000042u /* 'B' */ -#define SDLK_C 0x00000043u /* 'C' */ -#define SDLK_D 0x00000044u /* 'D' */ -#define SDLK_E 0x00000045u /* 'E' */ -#define SDLK_F 0x00000046u /* 'F' */ -#define SDLK_G 0x00000047u /* 'G' */ -#define SDLK_H 0x00000048u /* 'H' */ -#define SDLK_I 0x00000049u /* 'I' */ -#define SDLK_J 0x0000004au /* 'J' */ -#define SDLK_K 0x0000004bu /* 'K' */ -#define SDLK_L 0x0000004cu /* 'L' */ -#define SDLK_M 0x0000004du /* 'M' */ -#define SDLK_N 0x0000004eu /* 'N' */ -#define SDLK_O 0x0000004fu /* 'O' */ -#define SDLK_P 0x00000050u /* 'P' */ -#define SDLK_Q 0x00000051u /* 'Q' */ -#define SDLK_R 0x00000052u /* 'R' */ -#define SDLK_S 0x00000053u /* 'S' */ -#define SDLK_T 0x00000054u /* 'T' */ -#define SDLK_U 0x00000055u /* 'U' */ -#define SDLK_V 0x00000056u /* 'V' */ -#define SDLK_W 0x00000057u /* 'W' */ -#define SDLK_X 0x00000058u /* 'X' */ -#define SDLK_Y 0x00000059u /* 'Y' */ -#define SDLK_Z 0x0000005au /* 'Z' */ #define SDLK_LEFTBRACKET 0x0000005bu /* '[' */ #define SDLK_BACKSLASH 0x0000005cu /* '\\' */ #define SDLK_RIGHTBRACKET 0x0000005du /* ']' */ diff --git a/include/SDL3/SDL_scancode.h b/include/SDL3/SDL_scancode.h index 62b098257945c..ccf8bb5f79daa 100644 --- a/include/SDL3/SDL_scancode.h +++ b/include/SDL3/SDL_scancode.h @@ -415,6 +415,8 @@ typedef enum SDL_Scancode /* Add any other keys here. */ + SDL_SCANCODE_RESERVED = 400, /**< 400-500 reserved for dynamic keycodes */ + SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes for array bounds */ } SDL_Scancode; diff --git a/src/core/haiku/SDL_BApp.h b/src/core/haiku/SDL_BApp.h index e4f3b8dcce427..80a61c338bd62 100644 --- a/src/core/haiku/SDL_BApp.h +++ b/src/core/haiku/SDL_BApp.h @@ -302,11 +302,6 @@ class SDL_BLooper : public BLooper return; } - /* Make sure this isn't a repeated event (key pressed and held) */ - if (state == SDL_PRESSED && HAIKU_GetKeyState(scancode) == SDL_PRESSED) { - return; - } - HAIKU_SetKeyState(scancode, state); SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, scancode, HAIKU_GetScancodeFromBeKey(scancode), state); win = GetSDLWindow(winID); diff --git a/src/core/linux/SDL_evdev.c b/src/core/linux/SDL_evdev.c index f0f31b395afd1..43b3b3b77d06a 100644 --- a/src/core/linux/SDL_evdev.c +++ b/src/core/linux/SDL_evdev.c @@ -314,7 +314,7 @@ void SDL_EVDEV_Poll(void) struct input_event events[32]; int i, j, len; SDL_evdevlist_item *item; - SDL_Scancode scan_code; + SDL_Scancode scancode; int mouse_button; SDL_Mouse *mouse; float norm_x, norm_y, norm_pressure; @@ -372,11 +372,11 @@ void SDL_EVDEV_Poll(void) } /* Probably keyboard */ - scan_code = SDL_EVDEV_translate_keycode(event->code); + scancode = SDL_EVDEV_translate_keycode(event->code); if (event->value == 0) { - SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scan_code, SDL_RELEASED); + SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scancode, SDL_RELEASED); } else if (event->value == 1 || event->value == 2 /* key repeated */) { - SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scan_code, SDL_PRESSED); + SDL_SendKeyboardKey(SDL_EVDEV_GetEventTimestamp(event), (SDL_KeyboardID)item->fd, event->code, scancode, SDL_PRESSED); } SDL_EVDEV_kbd_keycode(_this->kbd, event->code, event->value); break; diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 44fc1377879ed..f3530a27040a5 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -37,10 +37,9 @@ #define KEYBOARD_SOURCE_MASK (KEYBOARD_HARDWARE | KEYBOARD_AUTORELEASE) -#define KEYCODE_OPTION_APPLY_MODIFIERS 0x01 -#define KEYCODE_OPTION_FRENCH_NUMBERS 0x02 -#define KEYCODE_OPTION_LATIN_LETTERS 0x04 -#define DEFAULT_KEYCODE_OPTIONS (KEYCODE_OPTION_APPLY_MODIFIERS | KEYCODE_OPTION_FRENCH_NUMBERS) +#define KEYCODE_OPTION_FRENCH_NUMBERS 0x01 +#define KEYCODE_OPTION_LATIN_LETTERS 0x02 +#define DEFAULT_KEYCODE_OPTIONS (KEYCODE_OPTION_FRENCH_NUMBERS) typedef struct SDL_KeyboardInstance { @@ -61,6 +60,7 @@ typedef struct SDL_Keyboard Uint32 keycode_options; SDL_bool autorelease_pending; Uint64 hardware_timestamp; + int next_reserved_scancode; } SDL_Keyboard; static SDL_Keyboard SDL_keyboard; @@ -73,16 +73,13 @@ static void SDLCALL SDL_KeycodeOptionsChanged(void *userdata, const char *name, if (hint && *hint) { keyboard->keycode_options = 0; - if (SDL_strstr(hint, "unmodified")) { - keyboard->keycode_options &= ~KEYCODE_OPTION_APPLY_MODIFIERS; - } else if (SDL_strstr(hint, "modified")) { - keyboard->keycode_options |= KEYCODE_OPTION_APPLY_MODIFIERS; - } - if (SDL_strstr(hint, "french_numbers")) { - keyboard->keycode_options |= KEYCODE_OPTION_FRENCH_NUMBERS; - } - if (SDL_strstr(hint, "latin_letters")) { - keyboard->keycode_options |= KEYCODE_OPTION_LATIN_LETTERS; + if (!SDL_strstr(hint, "none")) { + if (SDL_strstr(hint, "french_numbers")) { + keyboard->keycode_options |= KEYCODE_OPTION_FRENCH_NUMBERS; + } + if (SDL_strstr(hint, "latin_letters")) { + keyboard->keycode_options |= KEYCODE_OPTION_LATIN_LETTERS; + } } } else { keyboard->keycode_options = DEFAULT_KEYCODE_OPTIONS; @@ -258,6 +255,32 @@ void SDL_SetKeymap(SDL_Keymap *keymap, SDL_bool send_event) } } +static SDL_Scancode GetNextReservedScancode(void) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + SDL_Scancode scancode; + + if (keyboard->next_reserved_scancode && keyboard->next_reserved_scancode < SDL_SCANCODE_RESERVED + 100) { + scancode = (SDL_Scancode)keyboard->next_reserved_scancode; + } else { + scancode = SDL_SCANCODE_RESERVED; + } + keyboard->next_reserved_scancode = (int)scancode + 1; + + return scancode; +} + +static void SetKeymapEntry(SDL_Scancode scancode, SDL_Keymod modstate, SDL_Keycode keycode) +{ + SDL_Keyboard *keyboard = &SDL_keyboard; + + if (!keyboard->keymap) { + keyboard->keymap = SDL_CreateKeymap(); + } + + SDL_SetKeymapEntry(keyboard->keymap, scancode, modstate, keycode); +} + SDL_Window *SDL_GetKeyboardFocus(void) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -309,23 +332,21 @@ int SDL_SetKeyboardFocus(SDL_Window *window) static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scancode, SDL_Keymod modstate) { - SDL_Keycode keycode; + SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) != 0; + + // We won't be applying any modifiers by default + modstate = SDL_KMOD_NONE; if (scancode >= SDL_SCANCODE_A && scancode <= SDL_SCANCODE_Z) { if (keyboard->non_latin_letters && (keyboard->keycode_options & KEYCODE_OPTION_LATIN_LETTERS)) { - if (keyboard->keycode_options & KEYCODE_OPTION_APPLY_MODIFIERS) { - keycode = SDL_GetDefaultKeyFromScancode(scancode, modstate); - } else { - keycode = SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE); - } - return keycode; + return SDL_GetDefaultKeyFromScancode(scancode, modstate); } } if (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) { if (keyboard->french_numbers && (keyboard->keycode_options & KEYCODE_OPTION_FRENCH_NUMBERS)) { // Invert the shift state to generate the correct keycode - if (modstate & SDL_KMOD_SHIFT) { + if (shifted) { modstate &= ~SDL_KMOD_SHIFT; } else { modstate |= SDL_KMOD_SHIFT; @@ -333,19 +354,14 @@ static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scan } } - if (keyboard->keycode_options & KEYCODE_OPTION_APPLY_MODIFIERS) { - keycode = SDL_GetKeyFromScancode(scancode, modstate); - } else { - keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); - } - return keycode; + return SDL_GetKeyFromScancode(scancode, modstate); } -static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, Uint8 state) +static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) { SDL_Keyboard *keyboard = &SDL_keyboard; int posted; - SDL_Keymod modifier; + SDL_Keycode keycode = SDLK_UNKNOWN; Uint32 type; Uint8 repeat = SDL_FALSE; const Uint8 source = flags & KEYBOARD_SOURCE_MASK; @@ -368,7 +384,7 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo return 0; } - if (scancode != SDL_SCANCODE_UNKNOWN && scancode < SDL_NUM_SCANCODES) { + if (scancode > SDL_SCANCODE_UNKNOWN && scancode < SDL_NUM_SCANCODES) { /* Drop events that don't change state */ if (state) { if (keyboard->keystate[scancode]) { @@ -389,11 +405,9 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo /* Update internal keyboard state */ keyboard->keystate[scancode] = state; - if (keycode == SDLK_UNKNOWN) { - keycode = SDL_GetEventKeycode(keyboard, scancode, keyboard->modstate); - } + keycode = SDL_GetEventKeycode(keyboard, scancode, keyboard->modstate); - } else if (keycode == SDLK_UNKNOWN && rawcode == 0) { + } else if (rawcode == 0) { /* Nothing to do! */ return 0; } @@ -406,6 +420,8 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo /* Update modifiers state if applicable */ if (!(flags & KEYBOARD_IGNOREMODIFIERS) && !repeat) { + SDL_Keymod modifier; + switch (keycode) { case SDLK_LCTRL: modifier = SDL_KMOD_LCTRL; @@ -496,48 +512,53 @@ static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_Keybo int SDL_SendKeyboardUnicodeKey(Uint64 timestamp, Uint32 ch) { SDL_Keymod modstate = SDL_KMOD_NONE; - SDL_Scancode scancode = SDL_GetDefaultScancodeFromKey(ch, &modstate); + SDL_Scancode scancode = SDL_GetScancodeFromKey(ch, &modstate); + // Make sure we have this keycode in our keymap + if (scancode == SDL_SCANCODE_UNKNOWN && ch < SDLK_SCANCODE_MASK) { + scancode = GetNextReservedScancode(); + SetKeymapEntry(scancode, modstate, ch); + } if (modstate & SDL_KMOD_SHIFT) { /* If the character uses shift, press shift down */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_LSHIFT, SDL_PRESSED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDL_PRESSED); } /* Send a keydown and keyup for the character */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, ch, SDL_PRESSED); - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, ch, SDL_RELEASED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_PRESSED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); if (modstate & SDL_KMOD_SHIFT) { /* If the character uses shift, release shift */ - SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDLK_LSHIFT, SDL_RELEASED); + SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_LSHIFT, SDL_RELEASED); } return 0; } -int SDL_SendVirtualKeyboardKey(Uint64 timestamp, Uint8 state, SDL_Scancode scancode) -{ - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_VIRTUAL, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDLK_UNKNOWN, state); -} - int SDL_SendKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, rawcode, scancode, SDLK_UNKNOWN, state); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, rawcode, scancode, state); } int SDL_SendKeyboardKeyAndKeycode(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, Uint8 state) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, rawcode, scancode, keycode, state); + if (state == SDL_PRESSED) { + // Make sure we have this keycode in our keymap + SetKeymapEntry(scancode, SDL_GetModState(), keycode); + } + + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE, keyboardID, rawcode, scancode, state); } -int SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode) +int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDLK_UNKNOWN, SDL_PRESSED); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE | KEYBOARD_IGNOREMODIFIERS, keyboardID, rawcode, scancode, state); } -int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) +int SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode) { - return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_HARDWARE | KEYBOARD_IGNOREMODIFIERS, keyboardID, rawcode, scancode, SDLK_UNKNOWN, state); + return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_PRESSED); } void SDL_ReleaseAutoReleaseKeys(void) @@ -548,7 +569,7 @@ void SDL_ReleaseAutoReleaseKeys(void) if (keyboard->autorelease_pending) { for (scancode = SDL_SCANCODE_UNKNOWN; scancode < SDL_NUM_SCANCODES; ++scancode) { if (keyboard->keysource[scancode] == KEYBOARD_AUTORELEASE) { - SDL_SendKeyboardKeyInternal(0, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDLK_UNKNOWN, SDL_RELEASED); + SDL_SendKeyboardKeyInternal(0, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, SDL_RELEASED); } } keyboard->autorelease_pending = SDL_FALSE; diff --git a/src/events/SDL_keyboard_c.h b/src/events/SDL_keyboard_c.h index d305641f78b45..de3f162ecb19d 100644 --- a/src/events/SDL_keyboard_c.h +++ b/src/events/SDL_keyboard_c.h @@ -54,13 +54,10 @@ extern int SDL_SetKeyboardFocus(SDL_Window *window); */ extern int SDL_SendKeyboardUnicodeKey(Uint64 timestamp, Uint32 ch); -/* Send a key from a virtual key source, like an on-screen keyboard */ -extern int SDL_SendVirtualKeyboardKey(Uint64 timestamp, Uint8 state, SDL_Scancode scancode); - /* Send a keyboard key event */ extern int SDL_SendKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state); -extern int SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode); extern int SDL_SendKeyboardKeyIgnoreModifiers(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state); +extern int SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode); /* This is for platforms that don't know the keymap but can report scancode and keycode directly. Most platforms should prefer to optionally call SDL_SetKeymap and then use SDL_SendKeyboardKey. */ diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index 60120270ecd85..b2182ebb585fe 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -69,11 +69,18 @@ void SDL_SetKeymapEntry(SDL_Keymap *keymap, SDL_Scancode scancode, SDL_Keymod mo return; } - if (keycode == SDL_GetDefaultKeyFromScancode(scancode, modstate)) { + if (keycode == SDL_GetKeymapKeycode(keymap, scancode, modstate)) { return; } Uint32 key = ((Uint32)NormalizeModifierStateForKeymap(modstate) << 16) | scancode; + const void *value; + if (SDL_FindInHashTable(keymap->scancode_to_keycode, (void *)(uintptr_t)key, &value)) { + // Changing the mapping, need to remove the existing entry from the keymap + SDL_RemoveFromHashTable(keymap->scancode_to_keycode, (void *)(uintptr_t)key); + SDL_RemoveFromHashTable(keymap->keycode_to_scancode, value); + } + SDL_InsertIntoHashTable(keymap->scancode_to_keycode, (void *)(uintptr_t)key, (void *)(uintptr_t)keycode); SDL_InsertIntoHashTable(keymap->keycode_to_scancode, (void *)(uintptr_t)keycode, (void *)(uintptr_t)key); } @@ -254,11 +261,11 @@ SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_a); } - if (key >= SDLK_Z && key <= SDLK_Z) { + if (key >= 'A' && key <= 'Z') { if (modstate) { *modstate = SDL_KMOD_SHIFT; } - return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_Z); + return (SDL_Scancode)(SDL_SCANCODE_A + key - 'Z'); } for (int i = 0; i < SDL_arraysize(normal_default_symbols); ++i) { diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 791c5b4c386fd..f713a5671d19a 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2206,7 +2206,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_O: case SDLK_o: if (withControl) { /* Ctrl-O (or Ctrl-Shift-O) changes window opacity. */ @@ -2224,7 +2223,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_H: case SDLK_h: if (withControl) { /* Ctrl-H changes cursor visibility. */ @@ -2235,7 +2233,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_C: case SDLK_c: if (withAlt) { /* Alt-C copy awesome text to the primary selection! */ @@ -2261,7 +2258,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event break; } break; - case SDLK_V: case SDLK_v: if (withAlt) { /* Alt-V paste awesome text from the primary selection! */ @@ -2289,7 +2285,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_F: case SDLK_f: if (withControl) { /* Ctrl-F flash the window */ @@ -2299,7 +2294,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_G: case SDLK_g: if (withControl) { /* Ctrl-G toggle mouse grab */ @@ -2309,7 +2303,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_K: case SDLK_k: if (withControl) { /* Ctrl-K toggle keyboard grab */ @@ -2319,7 +2312,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_M: case SDLK_m: if (withControl) { /* Ctrl-M maximize */ @@ -2342,14 +2334,12 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_R: case SDLK_r: if (withControl) { /* Ctrl-R toggle mouse relative mode */ SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode()); } break; - case SDLK_T: case SDLK_t: if (withControl) { /* Ctrl-T toggle topmost mode */ @@ -2364,7 +2354,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_Z: case SDLK_z: if (withControl) { /* Ctrl-Z minimize */ @@ -2404,7 +2393,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } break; - case SDLK_B: case SDLK_b: if (withControl) { /* Ctrl-B toggle window border */ @@ -2416,7 +2404,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_A: case SDLK_a: if (withControl) { /* Ctrl-A toggle aspect ratio */ diff --git a/src/video/haiku/SDL_bkeyboard.cc b/src/video/haiku/SDL_bkeyboard.cc index 5f3fbaf17a2af..45b444dc4e7f8 100644 --- a/src/video/haiku/SDL_bkeyboard.cc +++ b/src/video/haiku/SDL_bkeyboard.cc @@ -37,7 +37,6 @@ extern "C" { static SDL_Scancode keymap[KEYMAP_SIZE]; -static int8 keystate[KEYMAP_SIZE]; void HAIKU_InitOSKeymap(void) { @@ -45,10 +44,6 @@ void HAIKU_InitOSKeymap(void) keymap[i] = SDL_SCANCODE_UNKNOWN; } - for ( uint i = 0; i < KEYMAP_SIZE; ++i ) { - keystate[i] = SDL_RELEASED; - } - keymap[0x01] = SDL_SCANCODE_ESCAPE; keymap[B_F1_KEY] = SDL_SCANCODE_F1; keymap[B_F2_KEY] = SDL_SCANCODE_F2; @@ -166,20 +161,6 @@ SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) { } } -int8 HAIKU_GetKeyState(int32 bkey) { - if (bkey > 0 && bkey < KEYMAP_SIZE) { - return keystate[bkey]; - } else { - return SDL_RELEASED; - } -} - -void HAIKU_SetKeyState(int32 bkey, int8 state) { - if (bkey > 0 && bkey < KEYMAP_SIZE) { - keystate[bkey] = state; - } -} - #ifdef __cplusplus } #endif diff --git a/src/video/haiku/SDL_bkeyboard.h b/src/video/haiku/SDL_bkeyboard.h index d6bf261243479..e1896858d8c60 100644 --- a/src/video/haiku/SDL_bkeyboard.h +++ b/src/video/haiku/SDL_bkeyboard.h @@ -30,8 +30,6 @@ extern "C" { extern void HAIKU_InitOSKeymap(void); extern SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey); -extern int8 HAIKU_GetKeyState(int32 bkey); -extern void HAIKU_SetKeyState(int32 bkey, int8 state); #ifdef __cplusplus } diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 0d69f50fbb44e..4b6cd845a830e 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -487,8 +487,8 @@ - (void)textFieldTextDidChange:(NSNotification *)notification size_t deleteLength = SDL_utf8strlen([[committedText substringFromIndex:matchLength] UTF8String]); while (deleteLength > 0) { /* Send distinct down and up events for each backspace action */ - SDL_SendVirtualKeyboardKey(0, SDL_PRESSED, SDL_SCANCODE_BACKSPACE); - SDL_SendVirtualKeyboardKey(0, SDL_RELEASED, SDL_SCANCODE_BACKSPACE); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_BACKSPACE, SDL_PRESSED); + SDL_SendKeyboardKey(0, SDL_GLOBAL_KEYBOARD_ID, 0, SDL_SCANCODE_BACKSPACE, SDL_RELEASED); --deleteLength; } } diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index 4bea5ac68b220..b22af114d981e 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -218,23 +218,23 @@ static void loop(void) } #endif if (e.type == SDL_EVENT_KEY_DOWN) { - SDL_Keycode sym = e.key.key; - if (sym == SDLK_q) { + SDL_Keycode key = e.key.key; + if (key == SDLK_q) { if (SDL_AudioDevicePaused(state->audio_id)) { SDL_ResumeAudioDevice(state->audio_id); } else { SDL_PauseAudioDevice(state->audio_id); } - } else if (sym == SDLK_w) { + } else if (key == SDLK_w) { auto_loop = !auto_loop; - } else if (sym == SDLK_e) { + } else if (key == SDLK_e) { auto_flush = !auto_flush; - } else if (sym == SDLK_a) { + } else if (key == SDLK_a) { SDL_ClearAudioStream(stream); SDL_Log("Cleared audio stream"); - } else if (sym == SDLK_s) { + } else if (key == SDLK_s) { queue_audio(); - } else if (sym == SDLK_d || sym == SDLK_D) { + } else if (key == SDLK_d) { float amount = 1.0f; amount *= (e.key.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f; amount *= (e.key.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f; diff --git a/test/testintersections.c b/test/testintersections.c index ad16951ccadfb..9e62b9cea70be 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -226,25 +226,27 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: switch (event.key.key) { - case SDLK_L: - num_lines = 0; - break; case SDLK_l: - add_line( - (float)SDL_rand(640), - (float)SDL_rand(480), - (float)SDL_rand(640), - (float)SDL_rand(480)); - break; - case SDLK_R: - num_rects = 0; + if (event.key.mod & SDL_KMOD_SHIFT) { + num_lines = 0; + } else { + add_line( + (float)SDL_rand(640), + (float)SDL_rand(480), + (float)SDL_rand(640), + (float)SDL_rand(480)); + } break; case SDLK_r: - add_rect( - (float)SDL_rand(640), - (float)SDL_rand(480), - (float)SDL_rand(640), - (float)SDL_rand(480)); + if (event.key.mod & SDL_KMOD_SHIFT) { + num_rects = 0; + } else { + add_rect( + (float)SDL_rand(640), + (float)SDL_rand(480), + (float)SDL_rand(640), + (float)SDL_rand(480)); + } break; default: break; From e8dbbf8380dcbb4856e106faebd58b25366a6ea9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2024 20:05:22 -0700 Subject: [PATCH 126/431] Renamed SDLK_a-z to SDLK_A-Z Made the symbols uppercase for consistency with the other SDLK_* constants, but the values are still lowercase. --- build-scripts/SDL_migration.cocci | 104 ++++++++++++++++++++ docs/README-migration.md | 28 +++++- include/SDL3/SDL_keycode.h | 52 +++++----- include/SDL3/SDL_oldnames.h | 52 ++++++++++ src/events/SDL_keymap.c | 4 +- src/test/SDL_test_common.c | 26 ++--- src/video/emscripten/SDL_emscriptenevents.c | 52 +++++----- test/testaudiostreamdynamicresample.c | 12 +-- test/testautomation_keyboard.c | 4 +- test/testcontroller.c | 12 +-- test/testgl.c | 4 +- test/testhittesting.c | 2 +- test/testintersections.c | 4 +- test/testmodal.c | 8 +- test/testmouse.c | 2 +- test/testwm.c | 2 +- 16 files changed, 275 insertions(+), 93 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 328b359e07b7d..fef3d353644c9 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3384,3 +3384,107 @@ typedef SDL_Colour, SDL_Color; @@ - SDLK_MEDIASELECT + SDLK_MEDIA_SELECT +@@ +@@ +- SDLK_a ++ SDLK_A +@@ +@@ +- SDLK_b ++ SDLK_B +@@ +@@ +- SDLK_c ++ SDLK_C +@@ +@@ +- SDLK_d ++ SDLK_D +@@ +@@ +- SDLK_e ++ SDLK_E +@@ +@@ +- SDLK_f ++ SDLK_F +@@ +@@ +- SDLK_g ++ SDLK_G +@@ +@@ +- SDLK_h ++ SDLK_H +@@ +@@ +- SDLK_i ++ SDLK_I +@@ +@@ +- SDLK_j ++ SDLK_J +@@ +@@ +- SDLK_k ++ SDLK_K +@@ +@@ +- SDLK_l ++ SDLK_L +@@ +@@ +- SDLK_m ++ SDLK_M +@@ +@@ +- SDLK_n ++ SDLK_N +@@ +@@ +- SDLK_o ++ SDLK_O +@@ +@@ +- SDLK_p ++ SDLK_P +@@ +@@ +- SDLK_q ++ SDLK_Q +@@ +@@ +- SDLK_r ++ SDLK_R +@@ +@@ +- SDLK_s ++ SDLK_S +@@ +@@ +- SDLK_t ++ SDLK_T +@@ +@@ +- SDLK_u ++ SDLK_U +@@ +@@ +- SDLK_v ++ SDLK_V +@@ +@@ +- SDLK_w ++ SDLK_W +@@ +@@ +- SDLK_x ++ SDLK_X +@@ +@@ +- SDLK_y ++ SDLK_Y +@@ +@@ +- SDLK_z ++ SDLK_Z diff --git a/docs/README-migration.md b/docs/README-migration.md index 39f3d44a1407c..236af3de9f5c7 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -362,7 +362,7 @@ now looks like this: SDL_Keymod mod = event.key.mod; ``` -The keycode in key events is affected by modifiers by default. e.g. pressing the A key would generate the keycode `SDLK_a`, or 'a', and pressing it while holding the shift key would generate the keycode `SDLK_A`, or 'A'. This behavior can be customized with `SDL_HINT_KEYCODE_OPTIONS`. +The keycode in key events is affected by modifiers by default. e.g. pressing the A key would generate the keycode `SDLK_A`, or 'a', and pressing it while holding the shift key would generate the keycode `SDLK_A`, or 'A'. This behavior can be customized with `SDL_HINT_KEYCODE_OPTIONS`. The gamepad event structures caxis, cbutton, cdevice, ctouchpad, and csensor have been renamed gaxis, gbutton, gdevice, gtouchpad, and gsensor. @@ -975,6 +975,32 @@ The following symbols have been renamed: * SDLK_MEDIASELECT => SDLK_MEDIA_SELECT * SDLK_QUOTE => SDLK_APOSTROPHE * SDLK_QUOTEDBL => SDLK_DBLAPOSTROPHE +* SDLK_a => SDLK_A +* SDLK_b => SDLK_B +* SDLK_c => SDLK_C +* SDLK_d => SDLK_D +* SDLK_e => SDLK_E +* SDLK_f => SDLK_F +* SDLK_g => SDLK_G +* SDLK_h => SDLK_H +* SDLK_i => SDLK_I +* SDLK_j => SDLK_J +* SDLK_k => SDLK_K +* SDLK_l => SDLK_L +* SDLK_m => SDLK_M +* SDLK_n => SDLK_N +* SDLK_o => SDLK_O +* SDLK_p => SDLK_P +* SDLK_q => SDLK_Q +* SDLK_r => SDLK_R +* SDLK_s => SDLK_S +* SDLK_t => SDLK_T +* SDLK_u => SDLK_U +* SDLK_v => SDLK_V +* SDLK_w => SDLK_W +* SDLK_x => SDLK_X +* SDLK_y => SDLK_Y +* SDLK_z => SDLK_Z ## SDL_loadso.h diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index f3a98a34b1721..ef612ab4edaed 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -94,32 +94,32 @@ typedef Uint32 SDL_Keycode; #define SDLK_CARET 0x0000005eu /* '^' */ #define SDLK_UNDERSCORE 0x0000005fu /* '_' */ #define SDLK_GRAVE 0x00000060u /* '`' */ -#define SDLK_a 0x00000061u /* 'a' */ -#define SDLK_b 0x00000062u /* 'b' */ -#define SDLK_c 0x00000063u /* 'c' */ -#define SDLK_d 0x00000064u /* 'd' */ -#define SDLK_e 0x00000065u /* 'e' */ -#define SDLK_f 0x00000066u /* 'f' */ -#define SDLK_g 0x00000067u /* 'g' */ -#define SDLK_h 0x00000068u /* 'h' */ -#define SDLK_i 0x00000069u /* 'i' */ -#define SDLK_j 0x0000006au /* 'j' */ -#define SDLK_k 0x0000006bu /* 'k' */ -#define SDLK_l 0x0000006cu /* 'l' */ -#define SDLK_m 0x0000006du /* 'm' */ -#define SDLK_n 0x0000006eu /* 'n' */ -#define SDLK_o 0x0000006fu /* 'o' */ -#define SDLK_p 0x00000070u /* 'p' */ -#define SDLK_q 0x00000071u /* 'q' */ -#define SDLK_r 0x00000072u /* 'r' */ -#define SDLK_s 0x00000073u /* 's' */ -#define SDLK_t 0x00000074u /* 't' */ -#define SDLK_u 0x00000075u /* 'u' */ -#define SDLK_v 0x00000076u /* 'v' */ -#define SDLK_w 0x00000077u /* 'w' */ -#define SDLK_x 0x00000078u /* 'x' */ -#define SDLK_y 0x00000079u /* 'y' */ -#define SDLK_z 0x0000007au /* 'z' */ +#define SDLK_A 0x00000061u /* 'a' */ +#define SDLK_B 0x00000062u /* 'b' */ +#define SDLK_C 0x00000063u /* 'c' */ +#define SDLK_D 0x00000064u /* 'd' */ +#define SDLK_E 0x00000065u /* 'e' */ +#define SDLK_F 0x00000066u /* 'f' */ +#define SDLK_G 0x00000067u /* 'g' */ +#define SDLK_H 0x00000068u /* 'h' */ +#define SDLK_I 0x00000069u /* 'i' */ +#define SDLK_J 0x0000006au /* 'j' */ +#define SDLK_K 0x0000006bu /* 'k' */ +#define SDLK_L 0x0000006cu /* 'l' */ +#define SDLK_M 0x0000006du /* 'm' */ +#define SDLK_N 0x0000006eu /* 'n' */ +#define SDLK_O 0x0000006fu /* 'o' */ +#define SDLK_P 0x00000070u /* 'p' */ +#define SDLK_Q 0x00000071u /* 'q' */ +#define SDLK_R 0x00000072u /* 'r' */ +#define SDLK_S 0x00000073u /* 's' */ +#define SDLK_T 0x00000074u /* 't' */ +#define SDLK_U 0x00000075u /* 'u' */ +#define SDLK_V 0x00000076u /* 'v' */ +#define SDLK_W 0x00000077u /* 'w' */ +#define SDLK_X 0x00000078u /* 'x' */ +#define SDLK_Y 0x00000079u /* 'y' */ +#define SDLK_Z 0x0000007au /* 'z' */ #define SDLK_LEFTBRACE 0x0000007bu /* '{' */ #define SDLK_PIPE 0x0000007cu /* '|' */ #define SDLK_RIGHTBRACE 0x0000007du /* '}' */ diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 68c8f4a58e090..7d1bf8360e0e4 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -378,6 +378,32 @@ #define SDLK_MEDIASELECT SDLK_MEDIA_SELECT #define SDLK_QUOTE SDLK_APOSTROPHE #define SDLK_QUOTEDBL SDLK_DBLAPOSTROPHE +#define SDLK_a SDLK_A +#define SDLK_b SDLK_B +#define SDLK_c SDLK_C +#define SDLK_d SDLK_D +#define SDLK_e SDLK_E +#define SDLK_f SDLK_F +#define SDLK_g SDLK_G +#define SDLK_h SDLK_H +#define SDLK_i SDLK_I +#define SDLK_j SDLK_J +#define SDLK_k SDLK_K +#define SDLK_l SDLK_L +#define SDLK_m SDLK_M +#define SDLK_n SDLK_N +#define SDLK_o SDLK_O +#define SDLK_p SDLK_P +#define SDLK_q SDLK_Q +#define SDLK_r SDLK_R +#define SDLK_s SDLK_S +#define SDLK_t SDLK_T +#define SDLK_u SDLK_U +#define SDLK_v SDLK_V +#define SDLK_w SDLK_W +#define SDLK_x SDLK_X +#define SDLK_y SDLK_Y +#define SDLK_z SDLK_Z /* ##SDL_log.h */ #define SDL_LogGetOutputFunction SDL_GetLogOutputFunction @@ -947,6 +973,32 @@ #define SDLK_MEDIASELECT SDLK_MEDIASELECT_renamed_SDLK_MEDIA_SELECT #define SDLK_QUOTE SDLK_QUOTE_renamed_SDLK_APOSTROPHE #define SDLK_QUOTEDBL SDLK_QUOTEDBL_renamed_SDLK_DBLAPOSTROPHE +#define SDLK_a SDLK_a_renamed_SDLK_A +#define SDLK_b SDLK_b_renamed_SDLK_B +#define SDLK_c SDLK_c_renamed_SDLK_C +#define SDLK_d SDLK_d_renamed_SDLK_D +#define SDLK_e SDLK_e_renamed_SDLK_E +#define SDLK_f SDLK_f_renamed_SDLK_F +#define SDLK_g SDLK_g_renamed_SDLK_G +#define SDLK_h SDLK_h_renamed_SDLK_H +#define SDLK_i SDLK_i_renamed_SDLK_I +#define SDLK_j SDLK_j_renamed_SDLK_J +#define SDLK_k SDLK_k_renamed_SDLK_K +#define SDLK_l SDLK_l_renamed_SDLK_L +#define SDLK_m SDLK_m_renamed_SDLK_M +#define SDLK_n SDLK_n_renamed_SDLK_N +#define SDLK_o SDLK_o_renamed_SDLK_O +#define SDLK_p SDLK_p_renamed_SDLK_P +#define SDLK_q SDLK_q_renamed_SDLK_Q +#define SDLK_r SDLK_r_renamed_SDLK_R +#define SDLK_s SDLK_s_renamed_SDLK_S +#define SDLK_t SDLK_t_renamed_SDLK_T +#define SDLK_u SDLK_u_renamed_SDLK_U +#define SDLK_v SDLK_v_renamed_SDLK_V +#define SDLK_w SDLK_w_renamed_SDLK_W +#define SDLK_x SDLK_x_renamed_SDLK_X +#define SDLK_y SDLK_y_renamed_SDLK_Y +#define SDLK_z SDLK_z_renamed_SDLK_Z /* ##SDL_log.h */ #define SDL_LogGetOutputFunction SDL_LogGetOutputFunction_renamed_SDL_GetLogOutputFunction diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index b2182ebb585fe..4249465cfaec0 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -257,8 +257,8 @@ SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate return (SDL_Scancode)(key & ~SDLK_SCANCODE_MASK); } - if (key >= SDLK_a && key <= SDLK_z) { - return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_a); + if (key >= SDLK_A && key <= SDLK_Z) { + return (SDL_Scancode)(SDL_SCANCODE_A + key - SDLK_A); } if (key >= 'A' && key <= 'Z') { diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index f713a5671d19a..0a6f3b30ed13a 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2206,7 +2206,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_o: + case SDLK_O: if (withControl) { /* Ctrl-O (or Ctrl-Shift-O) changes window opacity. */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2223,7 +2223,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_h: + case SDLK_H: if (withControl) { /* Ctrl-H changes cursor visibility. */ if (SDL_CursorVisible()) { @@ -2233,7 +2233,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_c: + case SDLK_C: if (withAlt) { /* Alt-C copy awesome text to the primary selection! */ SDL_SetPrimarySelectionText("SDL rocks!\nYou know it!"); @@ -2258,7 +2258,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event break; } break; - case SDLK_v: + case SDLK_V: if (withAlt) { /* Alt-V paste awesome text from the primary selection! */ char *text = SDL_GetPrimarySelectionText(); @@ -2285,7 +2285,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_f: + case SDLK_F: if (withControl) { /* Ctrl-F flash the window */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2294,7 +2294,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_g: + case SDLK_G: if (withControl) { /* Ctrl-G toggle mouse grab */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2303,7 +2303,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_k: + case SDLK_K: if (withControl) { /* Ctrl-K toggle keyboard grab */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2312,7 +2312,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_m: + case SDLK_M: if (withControl) { /* Ctrl-M maximize */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2334,13 +2334,13 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_r: + case SDLK_R: if (withControl) { /* Ctrl-R toggle mouse relative mode */ SDL_SetRelativeMouseMode(!SDL_GetRelativeMouseMode()); } break; - case SDLK_t: + case SDLK_T: if (withControl) { /* Ctrl-T toggle topmost mode */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2354,7 +2354,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_z: + case SDLK_Z: if (withControl) { /* Ctrl-Z minimize */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2393,7 +2393,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } break; - case SDLK_b: + case SDLK_B: if (withControl) { /* Ctrl-B toggle window border */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); @@ -2404,7 +2404,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event } } break; - case SDLK_a: + case SDLK_A: if (withControl) { /* Ctrl-A toggle aspect ratio */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index fa6a0d1c98b98..4ccf8167839d6 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -104,32 +104,32 @@ static const SDL_Keycode emscripten_keycode_table[] = { /* 62 */ SDLK_UNKNOWN, /* 63 */ SDLK_MINUS, /* 64 */ SDLK_UNKNOWN, - /* 65 */ SDLK_a, - /* 66 */ SDLK_b, - /* 67 */ SDLK_c, - /* 68 */ SDLK_d, - /* 69 */ SDLK_e, - /* 70 */ SDLK_f, - /* 71 */ SDLK_g, - /* 72 */ SDLK_h, - /* 73 */ SDLK_i, - /* 74 */ SDLK_j, - /* 75 */ SDLK_k, - /* 76 */ SDLK_l, - /* 77 */ SDLK_m, - /* 78 */ SDLK_n, - /* 79 */ SDLK_o, - /* 80 */ SDLK_p, - /* 81 */ SDLK_q, - /* 82 */ SDLK_r, - /* 83 */ SDLK_s, - /* 84 */ SDLK_t, - /* 85 */ SDLK_u, - /* 86 */ SDLK_v, - /* 87 */ SDLK_w, - /* 88 */ SDLK_x, - /* 89 */ SDLK_y, - /* 90 */ SDLK_z, + /* 65 */ SDLK_A, + /* 66 */ SDLK_B, + /* 67 */ SDLK_C, + /* 68 */ SDLK_D, + /* 69 */ SDLK_E, + /* 70 */ SDLK_F, + /* 71 */ SDLK_G, + /* 72 */ SDLK_H, + /* 73 */ SDLK_I, + /* 74 */ SDLK_J, + /* 75 */ SDLK_K, + /* 76 */ SDLK_L, + /* 77 */ SDLK_M, + /* 78 */ SDLK_N, + /* 79 */ SDLK_O, + /* 80 */ SDLK_P, + /* 81 */ SDLK_Q, + /* 82 */ SDLK_R, + /* 83 */ SDLK_S, + /* 84 */ SDLK_T, + /* 85 */ SDLK_U, + /* 86 */ SDLK_V, + /* 87 */ SDLK_W, + /* 88 */ SDLK_X, + /* 89 */ SDLK_Y, + /* 90 */ SDLK_Z, /* 91 */ SDLK_LGUI, /* 92 */ SDLK_UNKNOWN, /* 93 */ SDLK_APPLICATION, diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index b22af114d981e..a0a949e621cf2 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -219,22 +219,22 @@ static void loop(void) #endif if (e.type == SDL_EVENT_KEY_DOWN) { SDL_Keycode key = e.key.key; - if (key == SDLK_q) { + if (key == SDLK_Q) { if (SDL_AudioDevicePaused(state->audio_id)) { SDL_ResumeAudioDevice(state->audio_id); } else { SDL_PauseAudioDevice(state->audio_id); } - } else if (key == SDLK_w) { + } else if (key == SDLK_W) { auto_loop = !auto_loop; - } else if (key == SDLK_e) { + } else if (key == SDLK_E) { auto_flush = !auto_flush; - } else if (key == SDLK_a) { + } else if (key == SDLK_A) { SDL_ClearAudioStream(stream); SDL_Log("Cleared audio stream"); - } else if (key == SDLK_s) { + } else if (key == SDLK_S) { queue_audio(); - } else if (key == SDLK_d) { + } else if (key == SDLK_D) { float amount = 1.0f; amount *= (e.key.mod & SDL_KMOD_CTRL) ? 10.0f : 1.0f; amount *= (e.key.mod & SDL_KMOD_SHIFT) ? 10.0f : 1.0f; diff --git a/test/testautomation_keyboard.c b/test/testautomation_keyboard.c index 25a4d9b7f6849..87f27817a1ad2 100644 --- a/test/testautomation_keyboard.c +++ b/test/testautomation_keyboard.c @@ -61,7 +61,7 @@ static int keyboard_getKeyFromName(void *arg) /* Case where Key is known, 1 character input */ result = SDL_GetKeyFromName("A"); SDLTest_AssertPass("Call to SDL_GetKeyFromName(known/single)"); - SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_a, result); + SDLTest_AssertCheck(result == SDLK_A, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_A, result); /* Case where Key is known, 2 character input */ result = SDL_GetKeyFromName("F1"); @@ -126,7 +126,7 @@ static int keyboard_getKeyFromScancode(void *arg) /* Case where input is valid */ result = SDL_GetKeyFromScancode(SDL_SCANCODE_A, SDL_KMOD_NONE); SDLTest_AssertPass("Call to SDL_GetKeyFromScancode(valid)"); - SDLTest_AssertCheck(result == SDLK_a, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_a, result); + SDLTest_AssertCheck(result == SDLK_A, "Verify result from call, expected: %d, got: %" SDL_PRIs32, SDLK_A, result); /* Case where input is zero */ result = SDL_GetKeyFromScancode(SDL_SCANCODE_UNKNOWN, SDL_KMOD_NONE); diff --git a/test/testcontroller.c b/test/testcontroller.c index 3b7f0c95276ae..5c50d21f65fa3 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -1853,30 +1853,30 @@ static void loop(void *arg) SDL_SetGamepadPlayerIndex(controller->gamepad, player_index); } break; - } else if (event.key.key == SDLK_a) { + } else if (event.key.key == SDLK_A) { OpenVirtualGamepad(); - } else if (event.key.key == SDLK_d) { + } else if (event.key.key == SDLK_D) { CloseVirtualGamepad(); - } else if (event.key.key == SDLK_r && (event.key.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_R && (event.key.mod & SDL_KMOD_CTRL)) { SDL_ReloadGamepadMappings(); } else if (event.key.key == SDLK_ESCAPE) { done = SDL_TRUE; } } else if (display_mode == CONTROLLER_MODE_BINDING) { - if (event.key.key == SDLK_c && (event.key.mod & SDL_KMOD_CTRL)) { + if (event.key.key == SDLK_C && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { CopyControllerName(); } else { CopyMapping(); } - } else if (event.key.key == SDLK_v && (event.key.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_V && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { ClearControllerName(); PasteControllerName(); } else { PasteMapping(); } - } else if (event.key.key == SDLK_x && (event.key.mod & SDL_KMOD_CTRL)) { + } else if (event.key.key == SDLK_X && (event.key.mod & SDL_KMOD_CTRL)) { if (binding_element == SDL_GAMEPAD_ELEMENT_NAME) { CopyControllerName(); ClearControllerName(); diff --git a/test/testgl.c b/test/testgl.c index b79cd2aca6fb9..abbaa0743a538 100644 --- a/test/testgl.c +++ b/test/testgl.c @@ -391,10 +391,10 @@ int main(int argc, char *argv[]) while (SDL_PollEvent(&event)) { SDLTest_CommonEvent(state, &event, &done); if (event.type == SDL_EVENT_KEY_DOWN) { - if (event.key.key == SDLK_o) { + if (event.key.key == SDLK_O) { swap_interval--; update_swap_interval = SDL_TRUE; - } else if (event.key.key == SDLK_p) { + } else if (event.key.key == SDLK_P) { swap_interval++; update_swap_interval = SDL_TRUE; } diff --git a/test/testhittesting.c b/test/testhittesting.c index 6c5c26bcf840c..63e7e3d9c9e4c 100644 --- a/test/testhittesting.c +++ b/test/testhittesting.c @@ -139,7 +139,7 @@ int main(int argc, char **argv) case SDL_EVENT_KEY_DOWN: if (e.key.key == SDLK_ESCAPE) { done = 1; - } else if (e.key.key == SDLK_x) { + } else if (e.key.key == SDLK_X) { if (!areas) { areas = drag_areas; numareas = SDL_arraysize(drag_areas); diff --git a/test/testintersections.c b/test/testintersections.c index 9e62b9cea70be..2ff5f09d1cce2 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -226,7 +226,7 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: switch (event.key.key) { - case SDLK_l: + case SDLK_L: if (event.key.mod & SDL_KMOD_SHIFT) { num_lines = 0; } else { @@ -237,7 +237,7 @@ static void loop(void *arg) (float)SDL_rand(480)); } break; - case SDLK_r: + case SDLK_R: if (event.key.mod & SDL_KMOD_SHIFT) { num_rects = 0; } else { diff --git a/test/testmodal.c b/test/testmodal.c index 9851551f49eee..f4e2fc4bbe16d 100644 --- a/test/testmodal.c +++ b/test/testmodal.c @@ -91,14 +91,14 @@ int main(int argc, char *argv[]) w1 = NULL; } } else if (e.type == SDL_EVENT_KEY_DOWN) { - if ((e.key.key == SDLK_m || e.key.key == SDLK_n) && !w2) { + if ((e.key.key == SDLK_M || e.key.key == SDLK_N) && !w2) { if (SDL_CreateWindowAndRenderer("Non-Modal Window", 320, 200, SDL_WINDOW_HIDDEN, &w2, &r2) < 0) { SDL_Log("Failed to create modal window and/or renderer: %s\n", SDL_GetError()); exit_code = 1; goto sdl_quit; } - if (e.key.key == SDLK_m) { + if (e.key.key == SDLK_M) { if (!SDL_SetWindowModalFor(w2, w1)) { SDL_SetWindowTitle(w2, "Modal Window"); } @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) SDL_DestroyWindow(w2); r2 = NULL; w2 = NULL; - } else if (e.key.key == SDLK_h) { + } else if (e.key.key == SDLK_H) { if (e.key.mod & SDL_KMOD_CTRL) { /* Hide the parent, which should hide the modal too. */ show_deadline = SDL_GetTicksNS() + SDL_SECONDS_TO_NS(3); @@ -121,7 +121,7 @@ int main(int argc, char *argv[]) SDL_HideWindow(w2); } } - } else if (e.key.key == SDLK_p && w2) { + } else if (e.key.key == SDLK_P && w2) { if (SDL_GetWindowFlags(w2) & SDL_WINDOW_MODAL) { /* Unparent the window */ if (!SDL_SetWindowModalFor(w2, NULL)) { diff --git a/test/testmouse.c b/test/testmouse.c index 38e42ca4c5c24..b26e7bad9a50e 100644 --- a/test/testmouse.c +++ b/test/testmouse.c @@ -211,7 +211,7 @@ static void loop(void *arg) break; case SDL_EVENT_KEY_DOWN: - if (event.key.key == SDLK_c) { + if (event.key.key == SDLK_C) { int x, y, w, h; SDL_GetWindowPosition(window, &x, &y); SDL_GetWindowSize(window, &w, &h); diff --git a/test/testwm.c b/test/testwm.c index 0d454ccc5525b..dea9d94e7702b 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -189,7 +189,7 @@ static void loop(void) if (event.type == SDL_EVENT_KEY_UP) { SDL_bool updateCursor = SDL_FALSE; - if (event.key.key == SDLK_a) { + if (event.key.key == SDLK_A) { SDL_assert(!"Keyboard generated assert"); } else if (event.key.key == SDLK_LEFT) { --system_cursor; From 78dbf9be504e6c466595338ef1a4cfbca66a7beb Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2024 20:07:31 -0700 Subject: [PATCH 127/431] Document that SDL_GetKeyName() always returns uppercase names for alphabetic keycodes --- include/SDL3/SDL_keyboard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 232cde110f691..92d40d46fd12b 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -321,6 +321,8 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * + * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. SDL_Keycode 'a' and 'A' both have the name "A". + * * The returned string follows the SDL_GetStringRule. * * \param key the desired SDL_Keycode to query. From d4497ecdbdfd4567eebddde2c3773e1a1cba4894 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2024 23:35:23 -0700 Subject: [PATCH 128/431] Numpad scancodes have non-numpad keycodes This allows the numpad to work as the user expects based on the numlock state. If the application needs to distinguish the keys, it can check to see whether the scancode is a numpad key or not. --- include/SDL3/SDL_keycode.h | 42 +- src/events/SDL_keyboard.c | 4 +- src/events/SDL_keymap.c | 89 +++- src/video/cocoa/SDL_cocoakeyboard.m | 2 +- src/video/emscripten/SDL_emscriptenevents.c | 496 +++++++++----------- src/video/wayland/SDL_waylandevents.c | 2 +- src/video/windows/SDL_windowskeyboard.c | 8 +- src/video/x11/SDL_x11keyboard.c | 25 +- 8 files changed, 316 insertions(+), 352 deletions(-) diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index ef612ab4edaed..a98bc08dd393d 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -125,6 +125,7 @@ typedef Uint32 SDL_Keycode; #define SDLK_RIGHTBRACE 0x0000007du /* '}' */ #define SDLK_TILDE 0x0000007eu /* '~' */ #define SDLK_DELETE 0x0000007fu /* '\x7F' */ +#define SDLK_PLUSMINUS 0x000000b1u /* '±' */ #define SDLK_CAPSLOCK 0x40000039u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CAPSLOCK) */ #define SDLK_F1 0x4000003au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F1) */ #define SDLK_F2 0x4000003bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F2) */ @@ -151,25 +152,8 @@ typedef Uint32 SDL_Keycode; #define SDLK_DOWN 0x40000051u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN) */ #define SDLK_UP 0x40000052u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP) */ #define SDLK_NUMLOCKCLEAR 0x40000053u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR) */ -#define SDLK_KP_DIVIDE 0x40000054u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE) */ -#define SDLK_KP_MULTIPLY 0x40000055u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY) */ -#define SDLK_KP_MINUS 0x40000056u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS) */ -#define SDLK_KP_PLUS 0x40000057u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS) */ -#define SDLK_KP_ENTER 0x40000058u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER) */ -#define SDLK_KP_1 0x40000059u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1) */ -#define SDLK_KP_2 0x4000005au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2) */ -#define SDLK_KP_3 0x4000005bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3) */ -#define SDLK_KP_4 0x4000005cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4) */ -#define SDLK_KP_5 0x4000005du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5) */ -#define SDLK_KP_6 0x4000005eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6) */ -#define SDLK_KP_7 0x4000005fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7) */ -#define SDLK_KP_8 0x40000060u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8) */ -#define SDLK_KP_9 0x40000061u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9) */ -#define SDLK_KP_0 0x40000062u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0) */ -#define SDLK_KP_PERIOD 0x40000063u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD) */ #define SDLK_APPLICATION 0x40000065u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION) */ #define SDLK_POWER 0x40000066u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER) */ -#define SDLK_KP_EQUALS 0x40000067u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS) */ #define SDLK_F13 0x40000068u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13) */ #define SDLK_F14 0x40000069u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14) */ #define SDLK_F15 0x4000006au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15) */ @@ -196,8 +180,6 @@ typedef Uint32 SDL_Keycode; #define SDLK_MUTE 0x4000007fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE) */ #define SDLK_VOLUMEUP 0x40000080u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP) */ #define SDLK_VOLUMEDOWN 0x40000081u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN) */ -#define SDLK_KP_COMMA 0x40000085u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA) */ -#define SDLK_KP_EQUALSAS400 0x40000086u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400) */ #define SDLK_ALTERASE 0x40000099u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE) */ #define SDLK_SYSREQ 0x4000009au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ) */ #define SDLK_CANCEL 0x4000009bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL) */ @@ -216,32 +198,11 @@ typedef Uint32 SDL_Keycode; #define SDLK_DECIMALSEPARATOR 0x400000b3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR) */ #define SDLK_CURRENCYUNIT 0x400000b4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT) */ #define SDLK_CURRENCYSUBUNIT 0x400000b5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT) */ -#define SDLK_KP_LEFTPAREN 0x400000b6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN) */ -#define SDLK_KP_RIGHTPAREN 0x400000b7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN) */ -#define SDLK_KP_LEFTBRACE 0x400000b8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE) */ -#define SDLK_KP_RIGHTBRACE 0x400000b9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE) */ -#define SDLK_KP_TAB 0x400000bau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB) */ -#define SDLK_KP_BACKSPACE 0x400000bbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE) */ -#define SDLK_KP_A 0x400000bcu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A) */ -#define SDLK_KP_B 0x400000bdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B) */ -#define SDLK_KP_C 0x400000beu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C) */ -#define SDLK_KP_D 0x400000bfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D) */ -#define SDLK_KP_E 0x400000c0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E) */ -#define SDLK_KP_F 0x400000c1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F) */ #define SDLK_KP_XOR 0x400000c2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR) */ #define SDLK_KP_POWER 0x400000c3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER) */ -#define SDLK_KP_PERCENT 0x400000c4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT) */ -#define SDLK_KP_LESS 0x400000c5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS) */ -#define SDLK_KP_GREATER 0x400000c6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER) */ -#define SDLK_KP_AMPERSAND 0x400000c7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND) */ #define SDLK_KP_DBLAMPERSAND 0x400000c8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND) */ #define SDLK_KP_VERTICALBAR 0x400000c9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR) */ #define SDLK_KP_DBLVERTICALBAR 0x400000cau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR) */ -#define SDLK_KP_COLON 0x400000cbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON) */ -#define SDLK_KP_HASH 0x400000ccu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH) */ -#define SDLK_KP_SPACE 0x400000cdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE) */ -#define SDLK_KP_AT 0x400000ceu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT) */ -#define SDLK_KP_EXCLAM 0x400000cfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM) */ #define SDLK_KP_MEMSTORE 0x400000d0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE) */ #define SDLK_KP_MEMRECALL 0x400000d1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL) */ #define SDLK_KP_MEMCLEAR 0x400000d2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR) */ @@ -249,7 +210,6 @@ typedef Uint32 SDL_Keycode; #define SDLK_KP_MEMSUBTRACT 0x400000d4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT) */ #define SDLK_KP_MEMMULTIPLY 0x400000d5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY) */ #define SDLK_KP_MEMDIVIDE 0x400000d6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE) */ -#define SDLK_KP_PLUSMINUS 0x400000d7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS) */ #define SDLK_KP_CLEAR 0x400000d8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR) */ #define SDLK_KP_CLEARENTRY 0x400000d9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY) */ #define SDLK_KP_BINARY 0x400000dau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY) */ diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index f3530a27040a5..87a57e40d2c3a 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -334,8 +334,8 @@ static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scan { SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) != 0; - // We won't be applying any modifiers by default - modstate = SDL_KMOD_NONE; + // We won't be applying any modifiers except numlock by default + modstate &= SDL_KMOD_NUM; if (scancode >= SDL_SCANCODE_A && scancode <= SDL_SCANCODE_Z) { if (keyboard->non_latin_letters && (keyboard->keycode_options & KEYCODE_OPTION_LATIN_LETTERS)) { diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index 4249465cfaec0..c1eb39bf5112d 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -236,11 +236,94 @@ SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod mods } } - if (scancode == SDL_SCANCODE_DELETE) { + switch (scancode) { + case SDL_SCANCODE_DELETE: return SDLK_DELETE; + case SDL_SCANCODE_KP_DIVIDE: + return SDLK_SLASH; + case SDL_SCANCODE_KP_MULTIPLY: + return SDLK_ASTERISK; + case SDL_SCANCODE_KP_MINUS: + return SDLK_MINUS; + case SDL_SCANCODE_KP_PLUS: + return SDLK_PLUS; + case SDL_SCANCODE_KP_ENTER: + return SDLK_RETURN; + case SDL_SCANCODE_KP_1: + return (modstate & SDL_KMOD_NUM) ? SDLK_1 : SDLK_END; + case SDL_SCANCODE_KP_2: + return (modstate & SDL_KMOD_NUM) ? SDLK_2 : SDLK_DOWN; + case SDL_SCANCODE_KP_3: + return (modstate & SDL_KMOD_NUM) ? SDLK_3 : SDLK_PAGEDOWN; + case SDL_SCANCODE_KP_4: + return (modstate & SDL_KMOD_NUM) ? SDLK_4 : SDLK_LEFT; + case SDL_SCANCODE_KP_5: + return (modstate & SDL_KMOD_NUM) ? SDLK_5 : SDLK_CLEAR; + case SDL_SCANCODE_KP_6: + return (modstate & SDL_KMOD_NUM) ? SDLK_6 : SDLK_RIGHT; + case SDL_SCANCODE_KP_7: + return (modstate & SDL_KMOD_NUM) ? SDLK_7 : SDLK_HOME; + case SDL_SCANCODE_KP_8: + return (modstate & SDL_KMOD_NUM) ? SDLK_8 : SDLK_UP; + case SDL_SCANCODE_KP_9: + return (modstate & SDL_KMOD_NUM) ? SDLK_9 : SDLK_PAGEUP; + case SDL_SCANCODE_KP_0: + return (modstate & SDL_KMOD_NUM) ? SDLK_0 : SDLK_INSERT; + case SDL_SCANCODE_KP_PERIOD: + return (modstate & SDL_KMOD_NUM) ? SDLK_PERIOD : SDLK_DELETE; + case SDL_SCANCODE_KP_EQUALS: + return SDLK_EQUALS; + case SDL_SCANCODE_KP_COMMA: + return SDLK_COMMA; + case SDL_SCANCODE_KP_EQUALSAS400: + return SDLK_EQUALS; + case SDL_SCANCODE_KP_LEFTPAREN: + return SDLK_LEFTPAREN; + case SDL_SCANCODE_KP_RIGHTPAREN: + return SDLK_RIGHTPAREN; + case SDL_SCANCODE_KP_LEFTBRACE: + return SDLK_LEFTBRACE; + case SDL_SCANCODE_KP_RIGHTBRACE: + return SDLK_RIGHTBRACE; + case SDL_SCANCODE_KP_TAB: + return SDLK_TAB; + case SDL_SCANCODE_KP_BACKSPACE: + return SDLK_BACKSPACE; + case SDL_SCANCODE_KP_A: + return SDLK_A; + case SDL_SCANCODE_KP_B: + return SDLK_B; + case SDL_SCANCODE_KP_C: + return SDLK_C; + case SDL_SCANCODE_KP_D: + return SDLK_D; + case SDL_SCANCODE_KP_E: + return SDLK_E; + case SDL_SCANCODE_KP_F: + return SDLK_F; + case SDL_SCANCODE_KP_PERCENT: + return SDLK_PERCENT; + case SDL_SCANCODE_KP_LESS: + return SDLK_LESS; + case SDL_SCANCODE_KP_GREATER: + return SDLK_GREATER; + case SDL_SCANCODE_KP_AMPERSAND: + return SDLK_AMPERSAND; + case SDL_SCANCODE_KP_COLON: + return SDLK_COLON; + case SDL_SCANCODE_KP_HASH: + return SDLK_HASH; + case SDL_SCANCODE_KP_SPACE: + return SDLK_SPACE; + case SDL_SCANCODE_KP_AT: + return SDLK_AT; + case SDL_SCANCODE_KP_EXCLAM: + return SDLK_EXCLAIM; + case SDL_SCANCODE_KP_PLUSMINUS: + return SDLK_PLUSMINUS; + default: + return SDL_SCANCODE_TO_KEYCODE(scancode); } - - return SDL_SCANCODE_TO_KEYCODE(scancode); } SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate) diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index bda67f2884cde..c575346f80ff0 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -288,7 +288,7 @@ static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) /* Make sure this scancode is a valid character scancode */ SDL_Scancode scancode = darwin_scancode_table[i]; if (scancode == SDL_SCANCODE_UNKNOWN || - (SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) { + scancode >= SDL_SCANCODE_CAPSLOCK) { continue; } diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 4ccf8167839d6..0e79d6d843c6e 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -39,229 +39,229 @@ https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode */ static const SDL_Keycode emscripten_keycode_table[] = { - /* 0 */ SDLK_UNKNOWN, - /* 1 */ SDLK_UNKNOWN, - /* 2 */ SDLK_UNKNOWN, - /* 3 */ SDLK_CANCEL, - /* 4 */ SDLK_UNKNOWN, - /* 5 */ SDLK_UNKNOWN, - /* 6 */ SDLK_HELP, - /* 7 */ SDLK_UNKNOWN, - /* 8 */ SDLK_BACKSPACE, - /* 9 */ SDLK_TAB, - /* 10 */ SDLK_UNKNOWN, - /* 11 */ SDLK_UNKNOWN, - /* 12 */ SDLK_KP_5, - /* 13 */ SDLK_RETURN, - /* 14 */ SDLK_UNKNOWN, - /* 15 */ SDLK_UNKNOWN, - /* 16 */ SDLK_LSHIFT, - /* 17 */ SDLK_LCTRL, - /* 18 */ SDLK_LALT, - /* 19 */ SDLK_PAUSE, - /* 20 */ SDLK_CAPSLOCK, - /* 21 */ SDLK_UNKNOWN, - /* 22 */ SDLK_UNKNOWN, - /* 23 */ SDLK_UNKNOWN, - /* 24 */ SDLK_UNKNOWN, - /* 25 */ SDLK_UNKNOWN, - /* 26 */ SDLK_UNKNOWN, - /* 27 */ SDLK_ESCAPE, - /* 28 */ SDLK_UNKNOWN, - /* 29 */ SDLK_UNKNOWN, - /* 30 */ SDLK_UNKNOWN, - /* 31 */ SDLK_UNKNOWN, - /* 32 */ SDLK_SPACE, - /* 33 */ SDLK_PAGEUP, - /* 34 */ SDLK_PAGEDOWN, - /* 35 */ SDLK_END, - /* 36 */ SDLK_HOME, - /* 37 */ SDLK_LEFT, - /* 38 */ SDLK_UP, - /* 39 */ SDLK_RIGHT, - /* 40 */ SDLK_DOWN, - /* 41 */ SDLK_UNKNOWN, - /* 42 */ SDLK_UNKNOWN, - /* 43 */ SDLK_UNKNOWN, - /* 44 */ SDLK_UNKNOWN, - /* 45 */ SDLK_INSERT, - /* 46 */ SDLK_DELETE, - /* 47 */ SDLK_UNKNOWN, - /* 48 */ SDLK_0, - /* 49 */ SDLK_1, - /* 50 */ SDLK_2, - /* 51 */ SDLK_3, - /* 52 */ SDLK_4, - /* 53 */ SDLK_5, - /* 54 */ SDLK_6, - /* 55 */ SDLK_7, - /* 56 */ SDLK_8, - /* 57 */ SDLK_9, - /* 58 */ SDLK_UNKNOWN, - /* 59 */ SDLK_SEMICOLON, - /* 60 */ SDLK_BACKSLASH /*SDL_SCANCODE_NONUSBACKSLASH*/, - /* 61 */ SDLK_EQUALS, - /* 62 */ SDLK_UNKNOWN, - /* 63 */ SDLK_MINUS, - /* 64 */ SDLK_UNKNOWN, - /* 65 */ SDLK_A, - /* 66 */ SDLK_B, - /* 67 */ SDLK_C, - /* 68 */ SDLK_D, - /* 69 */ SDLK_E, - /* 70 */ SDLK_F, - /* 71 */ SDLK_G, - /* 72 */ SDLK_H, - /* 73 */ SDLK_I, - /* 74 */ SDLK_J, - /* 75 */ SDLK_K, - /* 76 */ SDLK_L, - /* 77 */ SDLK_M, - /* 78 */ SDLK_N, - /* 79 */ SDLK_O, - /* 80 */ SDLK_P, - /* 81 */ SDLK_Q, - /* 82 */ SDLK_R, - /* 83 */ SDLK_S, - /* 84 */ SDLK_T, - /* 85 */ SDLK_U, - /* 86 */ SDLK_V, - /* 87 */ SDLK_W, - /* 88 */ SDLK_X, - /* 89 */ SDLK_Y, - /* 90 */ SDLK_Z, - /* 91 */ SDLK_LGUI, - /* 92 */ SDLK_UNKNOWN, - /* 93 */ SDLK_APPLICATION, - /* 94 */ SDLK_UNKNOWN, - /* 95 */ SDLK_UNKNOWN, - /* 96 */ SDLK_KP_0, - /* 97 */ SDLK_KP_1, - /* 98 */ SDLK_KP_2, - /* 99 */ SDLK_KP_3, - /* 100 */ SDLK_KP_4, - /* 101 */ SDLK_KP_5, - /* 102 */ SDLK_KP_6, - /* 103 */ SDLK_KP_7, - /* 104 */ SDLK_KP_8, - /* 105 */ SDLK_KP_9, - /* 106 */ SDLK_KP_MULTIPLY, - /* 107 */ SDLK_KP_PLUS, - /* 108 */ SDLK_UNKNOWN, - /* 109 */ SDLK_KP_MINUS, - /* 110 */ SDLK_KP_PERIOD, - /* 111 */ SDLK_KP_DIVIDE, - /* 112 */ SDLK_F1, - /* 113 */ SDLK_F2, - /* 114 */ SDLK_F3, - /* 115 */ SDLK_F4, - /* 116 */ SDLK_F5, - /* 117 */ SDLK_F6, - /* 118 */ SDLK_F7, - /* 119 */ SDLK_F8, - /* 120 */ SDLK_F9, - /* 121 */ SDLK_F10, - /* 122 */ SDLK_F11, - /* 123 */ SDLK_F12, - /* 124 */ SDLK_F13, - /* 125 */ SDLK_F14, - /* 126 */ SDLK_F15, - /* 127 */ SDLK_F16, - /* 128 */ SDLK_F17, - /* 129 */ SDLK_F18, - /* 130 */ SDLK_F19, - /* 131 */ SDLK_F20, - /* 132 */ SDLK_F21, - /* 133 */ SDLK_F22, - /* 134 */ SDLK_F23, - /* 135 */ SDLK_F24, - /* 136 */ SDLK_UNKNOWN, - /* 137 */ SDLK_UNKNOWN, - /* 138 */ SDLK_UNKNOWN, - /* 139 */ SDLK_UNKNOWN, - /* 140 */ SDLK_UNKNOWN, - /* 141 */ SDLK_UNKNOWN, - /* 142 */ SDLK_UNKNOWN, - /* 143 */ SDLK_UNKNOWN, - /* 144 */ SDLK_NUMLOCKCLEAR, - /* 145 */ SDLK_SCROLLLOCK, - /* 146 */ SDLK_UNKNOWN, - /* 147 */ SDLK_UNKNOWN, - /* 148 */ SDLK_UNKNOWN, - /* 149 */ SDLK_UNKNOWN, - /* 150 */ SDLK_UNKNOWN, - /* 151 */ SDLK_UNKNOWN, - /* 152 */ SDLK_UNKNOWN, - /* 153 */ SDLK_UNKNOWN, - /* 154 */ SDLK_UNKNOWN, - /* 155 */ SDLK_UNKNOWN, - /* 156 */ SDLK_UNKNOWN, - /* 157 */ SDLK_UNKNOWN, - /* 158 */ SDLK_UNKNOWN, - /* 159 */ SDLK_UNKNOWN, - /* 160 */ SDLK_GRAVE, - /* 161 */ SDLK_UNKNOWN, - /* 162 */ SDLK_UNKNOWN, - /* 163 */ SDLK_KP_HASH, /*KaiOS phone keypad*/ - /* 164 */ SDLK_UNKNOWN, - /* 165 */ SDLK_UNKNOWN, - /* 166 */ SDLK_UNKNOWN, - /* 167 */ SDLK_UNKNOWN, - /* 168 */ SDLK_UNKNOWN, - /* 169 */ SDLK_UNKNOWN, - /* 170 */ SDLK_KP_MULTIPLY, /*KaiOS phone keypad*/ - /* 171 */ SDLK_RIGHTBRACKET, - /* 172 */ SDLK_UNKNOWN, - /* 173 */ SDLK_MINUS, /*FX*/ - /* 174 */ SDLK_VOLUMEDOWN, /*IE, Chrome*/ - /* 175 */ SDLK_VOLUMEUP, /*IE, Chrome*/ - /* 176 */ SDLK_MEDIA_NEXT_TRACK, /*IE, Chrome*/ - /* 177 */ SDLK_MEDIA_PREVIOUS_TRACK, /*IE, Chrome*/ - /* 178 */ SDLK_UNKNOWN, - /* 179 */ SDLK_MEDIA_PLAY, /*IE, Chrome*/ - /* 180 */ SDLK_UNKNOWN, - /* 181 */ SDLK_UNKNOWN, - /* 182 */ SDLK_VOLUMEDOWN, /*FX*/ - /* 183 */ SDLK_VOLUMEUP, /*FX*/ - /* 184 */ SDLK_UNKNOWN, - /* 185 */ SDLK_UNKNOWN, - /* 186 */ SDLK_SEMICOLON, /*IE, Chrome, D3E legacy*/ - /* 187 */ SDLK_EQUALS, /*IE, Chrome, D3E legacy*/ - /* 188 */ SDLK_COMMA, - /* 189 */ SDLK_MINUS, /*IE, Chrome, D3E legacy*/ - /* 190 */ SDLK_PERIOD, - /* 191 */ SDLK_SLASH, - /* 192 */ SDLK_GRAVE, /*FX, D3E legacy (SDLK_APOSTROPHE in IE/Chrome)*/ - /* 193 */ SDLK_UNKNOWN, - /* 194 */ SDLK_UNKNOWN, - /* 195 */ SDLK_UNKNOWN, - /* 196 */ SDLK_UNKNOWN, - /* 197 */ SDLK_UNKNOWN, - /* 198 */ SDLK_UNKNOWN, - /* 199 */ SDLK_UNKNOWN, - /* 200 */ SDLK_UNKNOWN, - /* 201 */ SDLK_UNKNOWN, - /* 202 */ SDLK_UNKNOWN, - /* 203 */ SDLK_UNKNOWN, - /* 204 */ SDLK_UNKNOWN, - /* 205 */ SDLK_UNKNOWN, - /* 206 */ SDLK_UNKNOWN, - /* 207 */ SDLK_UNKNOWN, - /* 208 */ SDLK_UNKNOWN, - /* 209 */ SDLK_UNKNOWN, - /* 210 */ SDLK_UNKNOWN, - /* 211 */ SDLK_UNKNOWN, - /* 212 */ SDLK_UNKNOWN, - /* 213 */ SDLK_UNKNOWN, - /* 214 */ SDLK_UNKNOWN, - /* 215 */ SDLK_UNKNOWN, - /* 216 */ SDLK_UNKNOWN, - /* 217 */ SDLK_UNKNOWN, - /* 218 */ SDLK_UNKNOWN, - /* 219 */ SDLK_LEFTBRACKET, - /* 220 */ SDLK_BACKSLASH, - /* 221 */ SDLK_RIGHTBRACKET, - /* 222 */ SDLK_APOSTROPHE, /*FX, D3E legacy*/ + /* 0, 0x00 */ SDLK_UNKNOWN, + /* 1, 0x01 */ SDLK_UNKNOWN, + /* 2, 0x02 */ SDLK_UNKNOWN, + /* 3, 0x03 */ SDLK_CANCEL, + /* 4, 0x04 */ SDLK_UNKNOWN, + /* 5, 0x05 */ SDLK_UNKNOWN, + /* 6, 0x06 */ SDLK_HELP, + /* 7, 0x07 */ SDLK_UNKNOWN, + /* 8, 0x08 */ SDLK_BACKSPACE, + /* 9, 0x09 */ SDLK_TAB, + /* 10, 0x0a */ SDLK_UNKNOWN, + /* 11, 0x0b */ SDLK_UNKNOWN, + /* 12, 0x0c */ SDLK_KP_EQUALS, + /* 13, 0x0d */ SDLK_RETURN, + /* 14, 0x0e */ SDLK_UNKNOWN, + /* 15, 0x0f */ SDLK_UNKNOWN, + /* 16, 0x10 */ SDLK_LSHIFT, + /* 17, 0x11 */ SDLK_LCTRL, + /* 18, 0x12 */ SDLK_LALT, + /* 19, 0x13 */ SDLK_PAUSE, + /* 20, 0x14 */ SDLK_CAPSLOCK, + /* 21, 0x15 */ SDLK_UNKNOWN, + /* 22, 0x16 */ SDLK_UNKNOWN, + /* 23, 0x17 */ SDLK_UNKNOWN, + /* 24, 0x18 */ SDLK_UNKNOWN, + /* 25, 0x19 */ SDLK_UNKNOWN, + /* 26, 0x1a */ SDLK_UNKNOWN, + /* 27, 0x1b */ SDLK_ESCAPE, + /* 28, 0x1c */ SDLK_UNKNOWN, + /* 29, 0x1d */ SDLK_UNKNOWN, + /* 30, 0x1e */ SDLK_UNKNOWN, + /* 31, 0x1f */ SDLK_UNKNOWN, + /* 32, 0x20 */ SDLK_SPACE, + /* 33, 0x21 */ SDLK_PAGEUP, + /* 34, 0x22 */ SDLK_PAGEDOWN, + /* 35, 0x23 */ SDLK_END, + /* 36, 0x24 */ SDLK_HOME, + /* 37, 0x25 */ SDLK_LEFT, + /* 38, 0x26 */ SDLK_UP, + /* 39, 0x27 */ SDLK_RIGHT, + /* 40, 0x28 */ SDLK_DOWN, + /* 41, 0x29 */ SDLK_UNKNOWN, + /* 42, 0x2a */ SDLK_UNKNOWN, + /* 43, 0x2b */ SDLK_UNKNOWN, + /* 44, 0x2c */ SDLK_UNKNOWN, + /* 45, 0x2d */ SDLK_INSERT, + /* 46, 0x2e */ SDLK_DELETE, + /* 47, 0x2f */ SDLK_UNKNOWN, + /* 48, 0x30 */ SDLK_0, + /* 49, 0x31 */ SDLK_1, + /* 50, 0x32 */ SDLK_2, + /* 51, 0x33 */ SDLK_3, + /* 52, 0x34 */ SDLK_4, + /* 53, 0x35 */ SDLK_5, + /* 54, 0x36 */ SDLK_6, + /* 55, 0x37 */ SDLK_7, + /* 56, 0x38 */ SDLK_8, + /* 57, 0x39 */ SDLK_9, + /* 58, 0x3a */ SDLK_UNKNOWN, + /* 59, 0x3b */ SDLK_SEMICOLON, + /* 60, 0x3c */ SDLK_BACKSLASH /*SDL_SCANCODE_NONUSBACKSLASH*/, + /* 61, 0x3d */ SDLK_EQUALS, + /* 62, 0x3e */ SDLK_UNKNOWN, + /* 63, 0x3f */ SDLK_MINUS, + /* 64, 0x40 */ SDLK_UNKNOWN, + /* 65, 0x41 */ SDLK_A, + /* 66, 0x42 */ SDLK_B, + /* 67, 0x43 */ SDLK_C, + /* 68, 0x44 */ SDLK_D, + /* 69, 0x45 */ SDLK_E, + /* 70, 0x46 */ SDLK_F, + /* 71, 0x47 */ SDLK_G, + /* 72, 0x48 */ SDLK_H, + /* 73, 0x49 */ SDLK_I, + /* 74, 0x4a */ SDLK_J, + /* 75, 0x4b */ SDLK_K, + /* 76, 0x4c */ SDLK_L, + /* 77, 0x4d */ SDLK_M, + /* 78, 0x4e */ SDLK_N, + /* 79, 0x4f */ SDLK_O, + /* 80, 0x50 */ SDLK_P, + /* 81, 0x51 */ SDLK_Q, + /* 82, 0x52 */ SDLK_R, + /* 83, 0x53 */ SDLK_S, + /* 84, 0x54 */ SDLK_T, + /* 85, 0x55 */ SDLK_U, + /* 86, 0x56 */ SDLK_V, + /* 87, 0x57 */ SDLK_W, + /* 88, 0x58 */ SDLK_X, + /* 89, 0x59 */ SDLK_Y, + /* 90, 0x5a */ SDLK_Z, + /* 91, 0x5b */ SDLK_LGUI, + /* 92, 0x5c */ SDLK_UNKNOWN, + /* 93, 0x5d */ SDLK_APPLICATION, + /* 94, 0x5e */ SDLK_UNKNOWN, + /* 95, 0x5f */ SDLK_UNKNOWN, + /* 96, 0x60 */ SDLK_0, /* SDLK_KP_0 */ + /* 97, 0x61 */ SDLK_1, /* SDLK_KP_1 */ + /* 98, 0x62 */ SDLK_2, /* SDLK_KP_2 */ + /* 99, 0x63 */ SDLK_3, /* SDLK_KP_3 */ + /* 100, 0x64 */ SDLK_4, /* SDLK_KP_4 */ + /* 101, 0x65 */ SDLK_5, /* SDLK_KP_5 */ + /* 102, 0x66 */ SDLK_6, /* SDLK_KP_6 */ + /* 103, 0x67 */ SDLK_7, /* SDLK_KP_7 */ + /* 104, 0x68 */ SDLK_8, /* SDLK_KP_8 */ + /* 105, 0x69 */ SDLK_9, /* SDLK_KP_9 */ + /* 106, 0x6a */ SDLK_KP_MULTIPLY, + /* 107, 0x6b */ SDLK_KP_PLUS, + /* 108, 0x6c */ SDLK_UNKNOWN, + /* 109, 0x6d */ SDLK_KP_MINUS, + /* 110, 0x6e */ SDLK_PERIOD, /* SDLK_KP_PERIOD */ + /* 111, 0x6f */ SDLK_KP_DIVIDE, + /* 112, 0x70 */ SDLK_F1, + /* 113, 0x71 */ SDLK_F2, + /* 114, 0x72 */ SDLK_F3, + /* 115, 0x73 */ SDLK_F4, + /* 116, 0x74 */ SDLK_F5, + /* 117, 0x75 */ SDLK_F6, + /* 118, 0x76 */ SDLK_F7, + /* 119, 0x77 */ SDLK_F8, + /* 120, 0x78 */ SDLK_F9, + /* 121, 0x79 */ SDLK_F10, + /* 122, 0x7a */ SDLK_F11, + /* 123, 0x7b */ SDLK_F12, + /* 124, 0x7c */ SDLK_F13, + /* 125, 0x7d */ SDLK_F14, + /* 126, 0x7e */ SDLK_F15, + /* 127, 0x7f */ SDLK_F16, + /* 128, 0x80 */ SDLK_F17, + /* 129, 0x81 */ SDLK_F18, + /* 130, 0x82 */ SDLK_F19, + /* 131, 0x83 */ SDLK_F20, + /* 132, 0x84 */ SDLK_F21, + /* 133, 0x85 */ SDLK_F22, + /* 134, 0x86 */ SDLK_F23, + /* 135, 0x87 */ SDLK_F24, + /* 136, 0x88 */ SDLK_UNKNOWN, + /* 137, 0x89 */ SDLK_UNKNOWN, + /* 138, 0x8a */ SDLK_UNKNOWN, + /* 139, 0x8b */ SDLK_UNKNOWN, + /* 140, 0x8c */ SDLK_UNKNOWN, + /* 141, 0x8d */ SDLK_UNKNOWN, + /* 142, 0x8e */ SDLK_UNKNOWN, + /* 143, 0x8f */ SDLK_UNKNOWN, + /* 144, 0x90 */ SDLK_NUMLOCKCLEAR, + /* 145, 0x91 */ SDLK_SCROLLLOCK, + /* 146, 0x92 */ SDLK_UNKNOWN, + /* 147, 0x93 */ SDLK_UNKNOWN, + /* 148, 0x94 */ SDLK_UNKNOWN, + /* 149, 0x95 */ SDLK_UNKNOWN, + /* 150, 0x96 */ SDLK_UNKNOWN, + /* 151, 0x97 */ SDLK_UNKNOWN, + /* 152, 0x98 */ SDLK_UNKNOWN, + /* 153, 0x99 */ SDLK_UNKNOWN, + /* 154, 0x9a */ SDLK_UNKNOWN, + /* 155, 0x9b */ SDLK_UNKNOWN, + /* 156, 0x9c */ SDLK_UNKNOWN, + /* 157, 0x9d */ SDLK_UNKNOWN, + /* 158, 0x9e */ SDLK_UNKNOWN, + /* 159, 0x9f */ SDLK_UNKNOWN, + /* 160, 0xa0 */ SDLK_GRAVE, + /* 161, 0xa1 */ SDLK_UNKNOWN, + /* 162, 0xa2 */ SDLK_UNKNOWN, + /* 163, 0xa3 */ SDLK_KP_HASH, /*KaiOS phone keypad*/ + /* 164, 0xa4 */ SDLK_UNKNOWN, + /* 165, 0xa5 */ SDLK_UNKNOWN, + /* 166, 0xa6 */ SDLK_UNKNOWN, + /* 167, 0xa7 */ SDLK_UNKNOWN, + /* 168, 0xa8 */ SDLK_UNKNOWN, + /* 169, 0xa9 */ SDLK_UNKNOWN, + /* 170, 0xaa */ SDLK_KP_MULTIPLY, /*KaiOS phone keypad*/ + /* 171, 0xab */ SDLK_RIGHTBRACKET, + /* 172, 0xac */ SDLK_UNKNOWN, + /* 173, 0xad */ SDLK_MINUS, /*FX*/ + /* 174, 0xae */ SDLK_VOLUMEDOWN, /*IE, Chrome*/ + /* 175, 0xaf */ SDLK_VOLUMEUP, /*IE, Chrome*/ + /* 176, 0xb0 */ SDLK_MEDIA_NEXT_TRACK, /*IE, Chrome*/ + /* 177, 0xb1 */ SDLK_MEDIA_PREVIOUS_TRACK, /*IE, Chrome*/ + /* 178, 0xb2 */ SDLK_UNKNOWN, + /* 179, 0xb3 */ SDLK_MEDIA_PLAY, /*IE, Chrome*/ + /* 180, 0xb4 */ SDLK_UNKNOWN, + /* 181, 0xb5 */ SDLK_UNKNOWN, + /* 182, 0xb6 */ SDLK_VOLUMEDOWN, /*FX*/ + /* 183, 0xb7 */ SDLK_VOLUMEUP, /*FX*/ + /* 184, 0xb8 */ SDLK_UNKNOWN, + /* 185, 0xb9 */ SDLK_UNKNOWN, + /* 186, 0xba */ SDLK_SEMICOLON, /*IE, Chrome, D3E legacy*/ + /* 187, 0xbb */ SDLK_EQUALS, /*IE, Chrome, D3E legacy*/ + /* 188, 0xbc */ SDLK_COMMA, + /* 189, 0xbd */ SDLK_MINUS, /*IE, Chrome, D3E legacy*/ + /* 190, 0xbe */ SDLK_PERIOD, + /* 191, 0xbf */ SDLK_SLASH, + /* 192, 0xc0 */ SDLK_GRAVE, /*FX, D3E legacy (SDLK_APOSTROPHE in IE/Chrome)*/ + /* 193, 0xc1 */ SDLK_UNKNOWN, + /* 194, 0xc2 */ SDLK_UNKNOWN, + /* 195, 0xc3 */ SDLK_UNKNOWN, + /* 196, 0xc4 */ SDLK_UNKNOWN, + /* 197, 0xc5 */ SDLK_UNKNOWN, + /* 198, 0xc6 */ SDLK_UNKNOWN, + /* 199, 0xc7 */ SDLK_UNKNOWN, + /* 200, 0xc8 */ SDLK_UNKNOWN, + /* 201, 0xc9 */ SDLK_UNKNOWN, + /* 202, 0xca */ SDLK_UNKNOWN, + /* 203, 0xcb */ SDLK_UNKNOWN, + /* 204, 0xcc */ SDLK_UNKNOWN, + /* 205, 0xcd */ SDLK_UNKNOWN, + /* 206, 0xce */ SDLK_UNKNOWN, + /* 207, 0xcf */ SDLK_UNKNOWN, + /* 208, 0xd0 */ SDLK_UNKNOWN, + /* 209, 0xd1 */ SDLK_UNKNOWN, + /* 210, 0xd2 */ SDLK_UNKNOWN, + /* 211, 0xd3 */ SDLK_UNKNOWN, + /* 212, 0xd4 */ SDLK_UNKNOWN, + /* 213, 0xd5 */ SDLK_UNKNOWN, + /* 214, 0xd6 */ SDLK_UNKNOWN, + /* 215, 0xd7 */ SDLK_UNKNOWN, + /* 216, 0xd8 */ SDLK_UNKNOWN, + /* 217, 0xd9 */ SDLK_UNKNOWN, + /* 218, 0xda */ SDLK_UNKNOWN, + /* 219, 0xdb */ SDLK_LEFTBRACKET, + /* 220, 0xdc */ SDLK_BACKSLASH, + /* 221, 0xdd */ SDLK_RIGHTBRACKET, + /* 222, 0xde */ SDLK_APOSTROPHE, /*FX, D3E legacy*/ }; /* @@ -513,56 +513,6 @@ static SDL_Keycode Emscripten_MapKeyCode(const EmscriptenKeyboardEvent *keyEvent default: break; } - } else if (keyEvent->location == DOM_KEY_LOCATION_NUMPAD) { - switch (keycode) { - case SDLK_0: - case SDLK_INSERT: - keycode = SDLK_KP_0; - break; - case SDLK_1: - case SDLK_END: - keycode = SDLK_KP_1; - break; - case SDLK_2: - case SDLK_DOWN: - keycode = SDLK_KP_2; - break; - case SDLK_3: - case SDLK_PAGEDOWN: - keycode = SDLK_KP_3; - break; - case SDLK_4: - case SDLK_LEFT: - keycode = SDLK_KP_4; - break; - case SDLK_5: - keycode = SDLK_KP_5; - break; - case SDLK_6: - case SDLK_RIGHT: - keycode = SDLK_KP_6; - break; - case SDLK_7: - case SDLK_HOME: - keycode = SDLK_KP_7; - break; - case SDLK_8: - case SDLK_UP: - keycode = SDLK_KP_8; - break; - case SDLK_9: - case SDLK_PAGEUP: - keycode = SDLK_KP_9; - break; - case SDLK_RETURN: - keycode = SDLK_KP_ENTER; - break; - case SDLK_DELETE: - keycode = SDLK_KP_PERIOD; - break; - default: - break; - } } } } diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 68b65f92aa78e..4a6f4f04c45a6 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -1109,7 +1109,7 @@ static void Wayland_keymap_iter(struct xkb_keymap *keymap, xkb_keycode_t key, vo /* Note: The default SDL scancode table sets this to right alt instead of AltGr/Mode, so handle it separately. */ if (syms[0] != XKB_KEY_ISO_Level3_Shift) { - keycode = SDL_GetDefaultKeyFromScancode(sc, SDL_KMOD_NONE); + keycode = SDL_GetDefaultKeyFromScancode(sc, sdlKeymap->modstate); } else { keycode = SDLK_MODE; } diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index c12a51dccf883..cbb7a40b99eb0 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -106,13 +106,7 @@ void WIN_UpdateKeymap(SDL_bool send_event) /* Make sure this scancode is a valid character scancode */ scancode = windows_scancode_table[i]; if (scancode == SDL_SCANCODE_UNKNOWN || - (SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) { - continue; - } - - /* If this key is one of the non-mappable keys, ignore it */ - /* Uncomment the second part to re-enable the behavior of not mapping the "`"(grave) key to the users actual keyboard layout */ - if (scancode == SDL_SCANCODE_DELETE /*|| scancode == SDL_SCANCODE_GRAVE*/) { + scancode >= SDL_SCANCODE_CAPSLOCK) { continue; } diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index eed27218f3070..5320ef2d5e971 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -382,30 +382,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) if (!keycode) { SDL_Scancode keyScancode = SDL_GetScancodeFromKeySym(keysym, (KeyCode)i); - - switch (keyScancode) { - case SDL_SCANCODE_UNKNOWN: - keycode = SDLK_UNKNOWN; - break; - case SDL_SCANCODE_RETURN: - keycode = SDLK_RETURN; - break; - case SDL_SCANCODE_ESCAPE: - keycode = SDLK_ESCAPE; - break; - case SDL_SCANCODE_BACKSPACE: - keycode = SDLK_BACKSPACE; - break; - case SDL_SCANCODE_TAB: - keycode = SDLK_TAB; - break; - case SDL_SCANCODE_DELETE: - keycode = SDLK_DELETE; - break; - default: - keycode = SDL_SCANCODE_TO_KEYCODE(keyScancode); - break; - } + keycode = SDL_GetDefaultKeyFromScancode(keyScancode, keymod_masks[m].sdl_mask); } SDL_SetKeymapEntry(keymap, scancode, keymod_masks[m].sdl_mask, keycode); } From 2c333c7355349e7110089b04dfc61be90beebf03 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 30 Jun 2024 23:52:47 -0700 Subject: [PATCH 129/431] The mode modifier only affects character keys --- src/events/SDL_keymap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index c1eb39bf5112d..6dc233b520635 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -199,10 +199,6 @@ SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod mods return SDLK_UNKNOWN; } - if (modstate & SDL_KMOD_MODE) { - return SDLK_UNKNOWN; - } - if (scancode < SDL_SCANCODE_A) { return SDLK_UNKNOWN; } @@ -219,6 +215,9 @@ SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod mods shifted = !shifted; } #endif + if (modstate & SDL_KMOD_MODE) { + return SDLK_UNKNOWN; + } if (!shifted) { return (SDL_Keycode)('a' + scancode - SDL_SCANCODE_A); } else { @@ -229,6 +228,9 @@ SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod mods if (scancode < SDL_SCANCODE_CAPSLOCK) { SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) ? SDL_TRUE : SDL_FALSE; + if (modstate & SDL_KMOD_MODE) { + return SDLK_UNKNOWN; + } if (!shifted) { return normal_default_symbols[scancode - SDL_SCANCODE_1]; } else { From 109f26897297e7af3149591a0d73e2d7dd8370be Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 1 Jul 2024 00:41:42 -0700 Subject: [PATCH 130/431] Added support for non-US keyboard layouts in Emscripten --- src/video/emscripten/SDL_emscriptenevents.c | 309 ++------------------ 1 file changed, 18 insertions(+), 291 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 0e79d6d843c6e..59419720eb7a9 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -33,237 +33,6 @@ #include "SDL_emscriptenevents.h" #include "SDL_emscriptenvideo.h" -/* -.keyCode to SDL keycode -https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent -https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode -*/ -static const SDL_Keycode emscripten_keycode_table[] = { - /* 0, 0x00 */ SDLK_UNKNOWN, - /* 1, 0x01 */ SDLK_UNKNOWN, - /* 2, 0x02 */ SDLK_UNKNOWN, - /* 3, 0x03 */ SDLK_CANCEL, - /* 4, 0x04 */ SDLK_UNKNOWN, - /* 5, 0x05 */ SDLK_UNKNOWN, - /* 6, 0x06 */ SDLK_HELP, - /* 7, 0x07 */ SDLK_UNKNOWN, - /* 8, 0x08 */ SDLK_BACKSPACE, - /* 9, 0x09 */ SDLK_TAB, - /* 10, 0x0a */ SDLK_UNKNOWN, - /* 11, 0x0b */ SDLK_UNKNOWN, - /* 12, 0x0c */ SDLK_KP_EQUALS, - /* 13, 0x0d */ SDLK_RETURN, - /* 14, 0x0e */ SDLK_UNKNOWN, - /* 15, 0x0f */ SDLK_UNKNOWN, - /* 16, 0x10 */ SDLK_LSHIFT, - /* 17, 0x11 */ SDLK_LCTRL, - /* 18, 0x12 */ SDLK_LALT, - /* 19, 0x13 */ SDLK_PAUSE, - /* 20, 0x14 */ SDLK_CAPSLOCK, - /* 21, 0x15 */ SDLK_UNKNOWN, - /* 22, 0x16 */ SDLK_UNKNOWN, - /* 23, 0x17 */ SDLK_UNKNOWN, - /* 24, 0x18 */ SDLK_UNKNOWN, - /* 25, 0x19 */ SDLK_UNKNOWN, - /* 26, 0x1a */ SDLK_UNKNOWN, - /* 27, 0x1b */ SDLK_ESCAPE, - /* 28, 0x1c */ SDLK_UNKNOWN, - /* 29, 0x1d */ SDLK_UNKNOWN, - /* 30, 0x1e */ SDLK_UNKNOWN, - /* 31, 0x1f */ SDLK_UNKNOWN, - /* 32, 0x20 */ SDLK_SPACE, - /* 33, 0x21 */ SDLK_PAGEUP, - /* 34, 0x22 */ SDLK_PAGEDOWN, - /* 35, 0x23 */ SDLK_END, - /* 36, 0x24 */ SDLK_HOME, - /* 37, 0x25 */ SDLK_LEFT, - /* 38, 0x26 */ SDLK_UP, - /* 39, 0x27 */ SDLK_RIGHT, - /* 40, 0x28 */ SDLK_DOWN, - /* 41, 0x29 */ SDLK_UNKNOWN, - /* 42, 0x2a */ SDLK_UNKNOWN, - /* 43, 0x2b */ SDLK_UNKNOWN, - /* 44, 0x2c */ SDLK_UNKNOWN, - /* 45, 0x2d */ SDLK_INSERT, - /* 46, 0x2e */ SDLK_DELETE, - /* 47, 0x2f */ SDLK_UNKNOWN, - /* 48, 0x30 */ SDLK_0, - /* 49, 0x31 */ SDLK_1, - /* 50, 0x32 */ SDLK_2, - /* 51, 0x33 */ SDLK_3, - /* 52, 0x34 */ SDLK_4, - /* 53, 0x35 */ SDLK_5, - /* 54, 0x36 */ SDLK_6, - /* 55, 0x37 */ SDLK_7, - /* 56, 0x38 */ SDLK_8, - /* 57, 0x39 */ SDLK_9, - /* 58, 0x3a */ SDLK_UNKNOWN, - /* 59, 0x3b */ SDLK_SEMICOLON, - /* 60, 0x3c */ SDLK_BACKSLASH /*SDL_SCANCODE_NONUSBACKSLASH*/, - /* 61, 0x3d */ SDLK_EQUALS, - /* 62, 0x3e */ SDLK_UNKNOWN, - /* 63, 0x3f */ SDLK_MINUS, - /* 64, 0x40 */ SDLK_UNKNOWN, - /* 65, 0x41 */ SDLK_A, - /* 66, 0x42 */ SDLK_B, - /* 67, 0x43 */ SDLK_C, - /* 68, 0x44 */ SDLK_D, - /* 69, 0x45 */ SDLK_E, - /* 70, 0x46 */ SDLK_F, - /* 71, 0x47 */ SDLK_G, - /* 72, 0x48 */ SDLK_H, - /* 73, 0x49 */ SDLK_I, - /* 74, 0x4a */ SDLK_J, - /* 75, 0x4b */ SDLK_K, - /* 76, 0x4c */ SDLK_L, - /* 77, 0x4d */ SDLK_M, - /* 78, 0x4e */ SDLK_N, - /* 79, 0x4f */ SDLK_O, - /* 80, 0x50 */ SDLK_P, - /* 81, 0x51 */ SDLK_Q, - /* 82, 0x52 */ SDLK_R, - /* 83, 0x53 */ SDLK_S, - /* 84, 0x54 */ SDLK_T, - /* 85, 0x55 */ SDLK_U, - /* 86, 0x56 */ SDLK_V, - /* 87, 0x57 */ SDLK_W, - /* 88, 0x58 */ SDLK_X, - /* 89, 0x59 */ SDLK_Y, - /* 90, 0x5a */ SDLK_Z, - /* 91, 0x5b */ SDLK_LGUI, - /* 92, 0x5c */ SDLK_UNKNOWN, - /* 93, 0x5d */ SDLK_APPLICATION, - /* 94, 0x5e */ SDLK_UNKNOWN, - /* 95, 0x5f */ SDLK_UNKNOWN, - /* 96, 0x60 */ SDLK_0, /* SDLK_KP_0 */ - /* 97, 0x61 */ SDLK_1, /* SDLK_KP_1 */ - /* 98, 0x62 */ SDLK_2, /* SDLK_KP_2 */ - /* 99, 0x63 */ SDLK_3, /* SDLK_KP_3 */ - /* 100, 0x64 */ SDLK_4, /* SDLK_KP_4 */ - /* 101, 0x65 */ SDLK_5, /* SDLK_KP_5 */ - /* 102, 0x66 */ SDLK_6, /* SDLK_KP_6 */ - /* 103, 0x67 */ SDLK_7, /* SDLK_KP_7 */ - /* 104, 0x68 */ SDLK_8, /* SDLK_KP_8 */ - /* 105, 0x69 */ SDLK_9, /* SDLK_KP_9 */ - /* 106, 0x6a */ SDLK_KP_MULTIPLY, - /* 107, 0x6b */ SDLK_KP_PLUS, - /* 108, 0x6c */ SDLK_UNKNOWN, - /* 109, 0x6d */ SDLK_KP_MINUS, - /* 110, 0x6e */ SDLK_PERIOD, /* SDLK_KP_PERIOD */ - /* 111, 0x6f */ SDLK_KP_DIVIDE, - /* 112, 0x70 */ SDLK_F1, - /* 113, 0x71 */ SDLK_F2, - /* 114, 0x72 */ SDLK_F3, - /* 115, 0x73 */ SDLK_F4, - /* 116, 0x74 */ SDLK_F5, - /* 117, 0x75 */ SDLK_F6, - /* 118, 0x76 */ SDLK_F7, - /* 119, 0x77 */ SDLK_F8, - /* 120, 0x78 */ SDLK_F9, - /* 121, 0x79 */ SDLK_F10, - /* 122, 0x7a */ SDLK_F11, - /* 123, 0x7b */ SDLK_F12, - /* 124, 0x7c */ SDLK_F13, - /* 125, 0x7d */ SDLK_F14, - /* 126, 0x7e */ SDLK_F15, - /* 127, 0x7f */ SDLK_F16, - /* 128, 0x80 */ SDLK_F17, - /* 129, 0x81 */ SDLK_F18, - /* 130, 0x82 */ SDLK_F19, - /* 131, 0x83 */ SDLK_F20, - /* 132, 0x84 */ SDLK_F21, - /* 133, 0x85 */ SDLK_F22, - /* 134, 0x86 */ SDLK_F23, - /* 135, 0x87 */ SDLK_F24, - /* 136, 0x88 */ SDLK_UNKNOWN, - /* 137, 0x89 */ SDLK_UNKNOWN, - /* 138, 0x8a */ SDLK_UNKNOWN, - /* 139, 0x8b */ SDLK_UNKNOWN, - /* 140, 0x8c */ SDLK_UNKNOWN, - /* 141, 0x8d */ SDLK_UNKNOWN, - /* 142, 0x8e */ SDLK_UNKNOWN, - /* 143, 0x8f */ SDLK_UNKNOWN, - /* 144, 0x90 */ SDLK_NUMLOCKCLEAR, - /* 145, 0x91 */ SDLK_SCROLLLOCK, - /* 146, 0x92 */ SDLK_UNKNOWN, - /* 147, 0x93 */ SDLK_UNKNOWN, - /* 148, 0x94 */ SDLK_UNKNOWN, - /* 149, 0x95 */ SDLK_UNKNOWN, - /* 150, 0x96 */ SDLK_UNKNOWN, - /* 151, 0x97 */ SDLK_UNKNOWN, - /* 152, 0x98 */ SDLK_UNKNOWN, - /* 153, 0x99 */ SDLK_UNKNOWN, - /* 154, 0x9a */ SDLK_UNKNOWN, - /* 155, 0x9b */ SDLK_UNKNOWN, - /* 156, 0x9c */ SDLK_UNKNOWN, - /* 157, 0x9d */ SDLK_UNKNOWN, - /* 158, 0x9e */ SDLK_UNKNOWN, - /* 159, 0x9f */ SDLK_UNKNOWN, - /* 160, 0xa0 */ SDLK_GRAVE, - /* 161, 0xa1 */ SDLK_UNKNOWN, - /* 162, 0xa2 */ SDLK_UNKNOWN, - /* 163, 0xa3 */ SDLK_KP_HASH, /*KaiOS phone keypad*/ - /* 164, 0xa4 */ SDLK_UNKNOWN, - /* 165, 0xa5 */ SDLK_UNKNOWN, - /* 166, 0xa6 */ SDLK_UNKNOWN, - /* 167, 0xa7 */ SDLK_UNKNOWN, - /* 168, 0xa8 */ SDLK_UNKNOWN, - /* 169, 0xa9 */ SDLK_UNKNOWN, - /* 170, 0xaa */ SDLK_KP_MULTIPLY, /*KaiOS phone keypad*/ - /* 171, 0xab */ SDLK_RIGHTBRACKET, - /* 172, 0xac */ SDLK_UNKNOWN, - /* 173, 0xad */ SDLK_MINUS, /*FX*/ - /* 174, 0xae */ SDLK_VOLUMEDOWN, /*IE, Chrome*/ - /* 175, 0xaf */ SDLK_VOLUMEUP, /*IE, Chrome*/ - /* 176, 0xb0 */ SDLK_MEDIA_NEXT_TRACK, /*IE, Chrome*/ - /* 177, 0xb1 */ SDLK_MEDIA_PREVIOUS_TRACK, /*IE, Chrome*/ - /* 178, 0xb2 */ SDLK_UNKNOWN, - /* 179, 0xb3 */ SDLK_MEDIA_PLAY, /*IE, Chrome*/ - /* 180, 0xb4 */ SDLK_UNKNOWN, - /* 181, 0xb5 */ SDLK_UNKNOWN, - /* 182, 0xb6 */ SDLK_VOLUMEDOWN, /*FX*/ - /* 183, 0xb7 */ SDLK_VOLUMEUP, /*FX*/ - /* 184, 0xb8 */ SDLK_UNKNOWN, - /* 185, 0xb9 */ SDLK_UNKNOWN, - /* 186, 0xba */ SDLK_SEMICOLON, /*IE, Chrome, D3E legacy*/ - /* 187, 0xbb */ SDLK_EQUALS, /*IE, Chrome, D3E legacy*/ - /* 188, 0xbc */ SDLK_COMMA, - /* 189, 0xbd */ SDLK_MINUS, /*IE, Chrome, D3E legacy*/ - /* 190, 0xbe */ SDLK_PERIOD, - /* 191, 0xbf */ SDLK_SLASH, - /* 192, 0xc0 */ SDLK_GRAVE, /*FX, D3E legacy (SDLK_APOSTROPHE in IE/Chrome)*/ - /* 193, 0xc1 */ SDLK_UNKNOWN, - /* 194, 0xc2 */ SDLK_UNKNOWN, - /* 195, 0xc3 */ SDLK_UNKNOWN, - /* 196, 0xc4 */ SDLK_UNKNOWN, - /* 197, 0xc5 */ SDLK_UNKNOWN, - /* 198, 0xc6 */ SDLK_UNKNOWN, - /* 199, 0xc7 */ SDLK_UNKNOWN, - /* 200, 0xc8 */ SDLK_UNKNOWN, - /* 201, 0xc9 */ SDLK_UNKNOWN, - /* 202, 0xca */ SDLK_UNKNOWN, - /* 203, 0xcb */ SDLK_UNKNOWN, - /* 204, 0xcc */ SDLK_UNKNOWN, - /* 205, 0xcd */ SDLK_UNKNOWN, - /* 206, 0xce */ SDLK_UNKNOWN, - /* 207, 0xcf */ SDLK_UNKNOWN, - /* 208, 0xd0 */ SDLK_UNKNOWN, - /* 209, 0xd1 */ SDLK_UNKNOWN, - /* 210, 0xd2 */ SDLK_UNKNOWN, - /* 211, 0xd3 */ SDLK_UNKNOWN, - /* 212, 0xd4 */ SDLK_UNKNOWN, - /* 213, 0xd5 */ SDLK_UNKNOWN, - /* 214, 0xd6 */ SDLK_UNKNOWN, - /* 215, 0xd7 */ SDLK_UNKNOWN, - /* 216, 0xd8 */ SDLK_UNKNOWN, - /* 217, 0xd9 */ SDLK_UNKNOWN, - /* 218, 0xda */ SDLK_UNKNOWN, - /* 219, 0xdb */ SDLK_LEFTBRACKET, - /* 220, 0xdc */ SDLK_BACKSLASH, - /* 221, 0xdd */ SDLK_RIGHTBRACKET, - /* 222, 0xde */ SDLK_APOSTROPHE, /*FX, D3E legacy*/ -}; - /* Emscripten PK code to scancode https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent @@ -490,63 +259,6 @@ static SDL_Scancode Emscripten_MapScanCode(const char *code) return SDL_SCANCODE_UNKNOWN; } -static SDL_Keycode Emscripten_MapKeyCode(const EmscriptenKeyboardEvent *keyEvent) -{ - SDL_Keycode keycode = SDLK_UNKNOWN; - if (keyEvent->keyCode < SDL_arraysize(emscripten_keycode_table)) { - keycode = emscripten_keycode_table[keyEvent->keyCode]; - if (keycode != SDLK_UNKNOWN) { - if (keyEvent->location == DOM_KEY_LOCATION_RIGHT) { - switch (keycode) { - case SDLK_LSHIFT: - keycode = SDLK_RSHIFT; - break; - case SDLK_LCTRL: - keycode = SDLK_RCTRL; - break; - case SDLK_LALT: - keycode = SDLK_RALT; - break; - case SDLK_LGUI: - keycode = SDLK_RGUI; - break; - default: - break; - } - } - } - } - - return keycode; -} - -/* "borrowed" from SDL_windowsevents.c */ -static int Emscripten_ConvertUTF32toUTF8(Uint32 codepoint, char *text) -{ - if (codepoint <= 0x7F) { - text[0] = (char)codepoint; - text[1] = '\0'; - } else if (codepoint <= 0x7FF) { - text[0] = 0xC0 | (char)((codepoint >> 6) & 0x1F); - text[1] = 0x80 | (char)(codepoint & 0x3F); - text[2] = '\0'; - } else if (codepoint <= 0xFFFF) { - text[0] = 0xE0 | (char)((codepoint >> 12) & 0x0F); - text[1] = 0x80 | (char)((codepoint >> 6) & 0x3F); - text[2] = 0x80 | (char)(codepoint & 0x3F); - text[3] = '\0'; - } else if (codepoint <= 0x10FFFF) { - text[0] = 0xF0 | (char)((codepoint >> 18) & 0x0F); - text[1] = 0x80 | (char)((codepoint >> 12) & 0x3F); - text[2] = 0x80 | (char)((codepoint >> 6) & 0x3F); - text[3] = 0x80 | (char)(codepoint & 0x3F); - text[4] = '\0'; - } else { - return SDL_FALSE; - } - return SDL_TRUE; -} - static EM_BOOL Emscripten_HandlePointerLockChange(int eventType, const EmscriptenPointerlockChangeEvent *changeEvent, void *userData) { SDL_WindowData *window_data = (SDL_WindowData *)userData; @@ -738,11 +450,14 @@ static EM_BOOL Emscripten_HandleTouch(int eventType, const EmscriptenTouchEvent return preventDefault; } +/* This is a great tool to see web keyboard events live: + * https://w3c.github.io/uievents/tools/key-event-viewer.html + */ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent *keyEvent, void *userData) { SDL_WindowData *window_data = (SDL_WindowData *)userData; - const SDL_Keycode keycode = Emscripten_MapKeyCode(keyEvent); SDL_Scancode scancode = Emscripten_MapScanCode(keyEvent->code); + SDL_Keycode keycode = SDLK_UNKNOWN; SDL_bool prevent_default = SDL_TRUE; SDL_bool is_nav_key = SDL_FALSE; @@ -787,7 +502,19 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent } } - SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); + if (SDL_utf8strlen(keyEvent->key) == 1) { + const char *key = keyEvent->key; + keycode = SDL_StepUTF8(&key, NULL); + if (keycode == SDL_INVALID_UNICODE_CODEPOINT) { + keycode = SDLK_UNKNOWN; + } + } + + if (keycode != SDLK_UNKNOWN) { + SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); + } else { + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); + } /* if TEXTINPUT events are enabled we can't prevent keydown or we won't get keypress * we need to ALWAYS prevent backspace and tab otherwise chrome takes action and does bad navigation UX @@ -816,7 +543,7 @@ static EM_BOOL Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboard if (SDL_TextInputActive(window_data->window)) { char text[5]; - if (Emscripten_ConvertUTF32toUTF8(keyEvent->charCode, text)) { + if (SDL_UCS4ToUTF8(keyEvent->charCode, text)) { SDL_SendKeyboardText(text); } return EM_TRUE; From f7877902436eae72e3931b2d9ab9d213e095baab Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Mon, 1 Jul 2024 20:57:56 +0000 Subject: [PATCH 131/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_events.h | 10 +++++++--- include/SDL3/SDL_keyboard.h | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 112816717698b..dafc544f500cb 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -315,12 +315,16 @@ typedef struct SDL_KeyboardDeviceEvent /** * Keyboard button event structure (event.key.*) * - * The `key` is the base SDL_Keycode generated by pressing the `scancode` using the current keyboard layout, applying any options specified in SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the event scancode and modifiers directly from the keyboard layout, bypassing SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode(). + * The `key` is the base SDL_Keycode generated by pressing the `scancode` + * using the current keyboard layout, applying any options specified in + * SDL_HINT_KEYCODE_OPTIONS. You can get the SDL_Keycode corresponding to the + * event scancode and modifiers directly from the keyboard layout, bypassing + * SDL_HINT_KEYCODE_OPTIONS, by calling SDL_GetKeyFromScancode(). + * + * \since This struct is available since SDL 3.0.0. * * \sa SDL_GetKeyFromScancode * \sa SDL_HINT_KEYCODE_OPTIONS - * - * \since This struct is available since SDL 3.0.0. */ typedef struct SDL_KeyboardEvent { diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 92d40d46fd12b..0ae88b8f882ff 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -321,7 +321,8 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam /** * Get a human-readable name for a key. * - * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. SDL_Keycode 'a' and 'A' both have the name "A". + * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. + * SDL_Keycode 'a' and 'A' both have the name "A". * * The returned string follows the SDL_GetStringRule. * From e290d16c47fed58467758051e74bd2c4bb24013c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 2 Jul 2024 12:29:33 -0400 Subject: [PATCH 132/431] include: Clean up SDL_GetKeyName documentation. --- include/SDL3/SDL_keyboard.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 0ae88b8f882ff..67f3cbb7bd067 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -324,13 +324,12 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam * Both lowercase and uppercase alphabetic keycodes have uppercase names, e.g. * SDL_Keycode 'a' and 'A' both have the name "A". * + * If the key doesn't have a name, this function returns an empty string (""). + * * The returned string follows the SDL_GetStringRule. * * \param key the desired SDL_Keycode to query. - * \returns a pointer to a UTF-8 string that stays valid at least until the - * next call to this function. If you need it around any longer, you - * must copy it. If the key doesn't have a name, this function - * returns an empty string (""). + * \returns a UTF-8 encoded string of the key name. * * \since This function is available since SDL 3.0.0. * From bafd04ecdb4e733d8275c1198ee4d92426f7fb61 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 2 Jul 2024 15:16:10 -0400 Subject: [PATCH 133/431] camera: small Media Foundation backend init tweak. --- .../SDL_camera_mediafoundation.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/camera/mediafoundation/SDL_camera_mediafoundation.c b/src/camera/mediafoundation/SDL_camera_mediafoundation.c index d630fff9ecdee..0421b5b664df8 100644 --- a/src/camera/mediafoundation/SDL_camera_mediafoundation.c +++ b/src/camera/mediafoundation/SDL_camera_mediafoundation.c @@ -1084,25 +1084,24 @@ static SDL_bool MEDIAFOUNDATION_Init(SDL_CameraDriverImpl *impl) LOADSYM(mfreadwrite, MFCreateSourceReaderFromMediaSource); #undef LOADSYM + if (okay) { + const HRESULT ret = pMFStartup(MF_VERSION, MFSTARTUP_LITE); + if (FAILED(ret)) { + okay = SDL_FALSE; + } + } + if (!okay) { FreeLibrary(mfreadwrite); FreeLibrary(mfplat); FreeLibrary(mf); + return SDL_FALSE; } libmf = mf; libmfplat = mfplat; libmfreadwrite = mfreadwrite; - const HRESULT ret = pMFStartup(MF_VERSION, MFSTARTUP_LITE); - if (FAILED(ret)) { - FreeLibrary(libmfplat); - libmfplat = NULL; - FreeLibrary(libmf); - libmf = NULL; - return SDL_FALSE; - } - impl->DetectDevices = MEDIAFOUNDATION_DetectDevices; impl->OpenDevice = MEDIAFOUNDATION_OpenDevice; impl->CloseDevice = MEDIAFOUNDATION_CloseDevice; From ed9bbb2dca47671933f81fb2d118039a4595a02f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 2 Jul 2024 18:13:25 -0700 Subject: [PATCH 134/431] Restore default behavior for keypad keycodes Added a hint to translate numpad keycodes into their non-numpad versions based on the NumLock state --- include/SDL3/SDL_hints.h | 1 + include/SDL3/SDL_keycode.h | 41 ++++++ src/events/SDL_keyboard.c | 130 +++++++++++++++++--- src/events/SDL_keymap.c | 89 +------------- src/video/emscripten/SDL_emscriptenevents.c | 2 +- 5 files changed, 162 insertions(+), 101 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 62847ea24c9ce..769cbfcc5cfce 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2000,6 +2000,7 @@ extern "C" { * in events: * * - "none": Keycode options are cleared, this overrides other options. + * - "hide_numpad": The numpad keysyms will be translated into their non-numpad versions based on the current NumLock state. For example, SDLK_KP_4 would become SDLK_4 if SDL_KMOD_NUM is set in the event modifiers, and SDLK_LEFT if it is unset. * - "french_numbers": The number row on French keyboards is inverted, so * pressing the 1 key would yield the keycode SDLK_1, or '1', instead of * SDLK_AMPERSAND, or '&' diff --git a/include/SDL3/SDL_keycode.h b/include/SDL3/SDL_keycode.h index a98bc08dd393d..d8b2004d1b9fb 100644 --- a/include/SDL3/SDL_keycode.h +++ b/include/SDL3/SDL_keycode.h @@ -152,8 +152,25 @@ typedef Uint32 SDL_Keycode; #define SDLK_DOWN 0x40000051u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DOWN) */ #define SDLK_UP 0x40000052u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_UP) */ #define SDLK_NUMLOCKCLEAR 0x40000053u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_NUMLOCKCLEAR) */ +#define SDLK_KP_DIVIDE 0x40000054u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DIVIDE) */ +#define SDLK_KP_MULTIPLY 0x40000055u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MULTIPLY) */ +#define SDLK_KP_MINUS 0x40000056u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MINUS) */ +#define SDLK_KP_PLUS 0x40000057u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUS) */ +#define SDLK_KP_ENTER 0x40000058u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_ENTER) */ +#define SDLK_KP_1 0x40000059u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_1) */ +#define SDLK_KP_2 0x4000005au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_2) */ +#define SDLK_KP_3 0x4000005bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_3) */ +#define SDLK_KP_4 0x4000005cu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_4) */ +#define SDLK_KP_5 0x4000005du /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_5) */ +#define SDLK_KP_6 0x4000005eu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_6) */ +#define SDLK_KP_7 0x4000005fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_7) */ +#define SDLK_KP_8 0x40000060u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_8) */ +#define SDLK_KP_9 0x40000061u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_9) */ +#define SDLK_KP_0 0x40000062u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_0) */ +#define SDLK_KP_PERIOD 0x40000063u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERIOD) */ #define SDLK_APPLICATION 0x40000065u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_APPLICATION) */ #define SDLK_POWER 0x40000066u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_POWER) */ +#define SDLK_KP_EQUALS 0x40000067u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALS) */ #define SDLK_F13 0x40000068u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F13) */ #define SDLK_F14 0x40000069u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F14) */ #define SDLK_F15 0x4000006au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_F15) */ @@ -180,6 +197,8 @@ typedef Uint32 SDL_Keycode; #define SDLK_MUTE 0x4000007fu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_MUTE) */ #define SDLK_VOLUMEUP 0x40000080u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEUP) */ #define SDLK_VOLUMEDOWN 0x40000081u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_VOLUMEDOWN) */ +#define SDLK_KP_COMMA 0x40000085u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COMMA) */ +#define SDLK_KP_EQUALSAS400 0x40000086u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EQUALSAS400) */ #define SDLK_ALTERASE 0x40000099u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ALTERASE) */ #define SDLK_SYSREQ 0x4000009au /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SYSREQ) */ #define SDLK_CANCEL 0x4000009bu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CANCEL) */ @@ -198,11 +217,32 @@ typedef Uint32 SDL_Keycode; #define SDLK_DECIMALSEPARATOR 0x400000b3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_DECIMALSEPARATOR) */ #define SDLK_CURRENCYUNIT 0x400000b4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYUNIT) */ #define SDLK_CURRENCYSUBUNIT 0x400000b5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CURRENCYSUBUNIT) */ +#define SDLK_KP_LEFTPAREN 0x400000b6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTPAREN) */ +#define SDLK_KP_RIGHTPAREN 0x400000b7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTPAREN) */ +#define SDLK_KP_LEFTBRACE 0x400000b8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LEFTBRACE) */ +#define SDLK_KP_RIGHTBRACE 0x400000b9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_RIGHTBRACE) */ +#define SDLK_KP_TAB 0x400000bau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_TAB) */ +#define SDLK_KP_BACKSPACE 0x400000bbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BACKSPACE) */ +#define SDLK_KP_A 0x400000bcu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_A) */ +#define SDLK_KP_B 0x400000bdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_B) */ +#define SDLK_KP_C 0x400000beu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_C) */ +#define SDLK_KP_D 0x400000bfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_D) */ +#define SDLK_KP_E 0x400000c0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_E) */ +#define SDLK_KP_F 0x400000c1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_F) */ #define SDLK_KP_XOR 0x400000c2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_XOR) */ #define SDLK_KP_POWER 0x400000c3u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_POWER) */ +#define SDLK_KP_PERCENT 0x400000c4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PERCENT) */ +#define SDLK_KP_LESS 0x400000c5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_LESS) */ +#define SDLK_KP_GREATER 0x400000c6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_GREATER) */ +#define SDLK_KP_AMPERSAND 0x400000c7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AMPERSAND) */ #define SDLK_KP_DBLAMPERSAND 0x400000c8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLAMPERSAND) */ #define SDLK_KP_VERTICALBAR 0x400000c9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_VERTICALBAR) */ #define SDLK_KP_DBLVERTICALBAR 0x400000cau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_DBLVERTICALBAR) */ +#define SDLK_KP_COLON 0x400000cbu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_COLON) */ +#define SDLK_KP_HASH 0x400000ccu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_HASH) */ +#define SDLK_KP_SPACE 0x400000cdu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_SPACE) */ +#define SDLK_KP_AT 0x400000ceu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_AT) */ +#define SDLK_KP_EXCLAM 0x400000cfu /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_EXCLAM) */ #define SDLK_KP_MEMSTORE 0x400000d0u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSTORE) */ #define SDLK_KP_MEMRECALL 0x400000d1u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMRECALL) */ #define SDLK_KP_MEMCLEAR 0x400000d2u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMCLEAR) */ @@ -210,6 +250,7 @@ typedef Uint32 SDL_Keycode; #define SDLK_KP_MEMSUBTRACT 0x400000d4u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMSUBTRACT) */ #define SDLK_KP_MEMMULTIPLY 0x400000d5u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMMULTIPLY) */ #define SDLK_KP_MEMDIVIDE 0x400000d6u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_MEMDIVIDE) */ +#define SDLK_KP_PLUSMINUS 0x400000d7u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_PLUSMINUS) */ #define SDLK_KP_CLEAR 0x400000d8u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEAR) */ #define SDLK_KP_CLEARENTRY 0x400000d9u /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_CLEARENTRY) */ #define SDLK_KP_BINARY 0x400000dau /* SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_KP_BINARY) */ diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 87a57e40d2c3a..6d058a50ef6b6 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -37,8 +37,9 @@ #define KEYBOARD_SOURCE_MASK (KEYBOARD_HARDWARE | KEYBOARD_AUTORELEASE) -#define KEYCODE_OPTION_FRENCH_NUMBERS 0x01 -#define KEYCODE_OPTION_LATIN_LETTERS 0x02 +#define KEYCODE_OPTION_HIDE_NUMPAD 0x01 +#define KEYCODE_OPTION_FRENCH_NUMBERS 0x02 +#define KEYCODE_OPTION_LATIN_LETTERS 0x04 #define DEFAULT_KEYCODE_OPTIONS (KEYCODE_OPTION_FRENCH_NUMBERS) typedef struct SDL_KeyboardInstance @@ -74,6 +75,9 @@ static void SDLCALL SDL_KeycodeOptionsChanged(void *userdata, const char *name, if (hint && *hint) { keyboard->keycode_options = 0; if (!SDL_strstr(hint, "none")) { + if (SDL_strstr(hint, "hide_numpad")) { + keyboard->keycode_options |= KEYCODE_OPTION_HIDE_NUMPAD; + } if (SDL_strstr(hint, "french_numbers")) { keyboard->keycode_options |= KEYCODE_OPTION_FRENCH_NUMBERS; } @@ -330,31 +334,129 @@ int SDL_SetKeyboardFocus(SDL_Window *window) return 0; } +static SDL_Keycode SDL_ConvertNumpadKeycode(SDL_Keycode keycode, SDL_bool numlock) +{ + switch (keycode) { + case SDLK_KP_DIVIDE: + return SDLK_SLASH; + case SDLK_KP_MULTIPLY: + return SDLK_ASTERISK; + case SDLK_KP_MINUS: + return SDLK_MINUS; + case SDLK_KP_PLUS: + return SDLK_PLUS; + case SDLK_KP_ENTER: + return SDLK_RETURN; + case SDLK_KP_1: + return numlock ? SDLK_1 : SDLK_END; + case SDLK_KP_2: + return numlock ? SDLK_2 : SDLK_DOWN; + case SDLK_KP_3: + return numlock ? SDLK_3 : SDLK_PAGEDOWN; + case SDLK_KP_4: + return numlock ? SDLK_4 : SDLK_LEFT; + case SDLK_KP_5: + return numlock ? SDLK_5 : SDLK_CLEAR; + case SDLK_KP_6: + return numlock ? SDLK_6 : SDLK_RIGHT; + case SDLK_KP_7: + return numlock ? SDLK_7 : SDLK_HOME; + case SDLK_KP_8: + return numlock ? SDLK_8 : SDLK_UP; + case SDLK_KP_9: + return numlock ? SDLK_9 : SDLK_PAGEUP; + case SDLK_KP_0: + return numlock ? SDLK_0 : SDLK_INSERT; + case SDLK_KP_PERIOD: + return numlock ? SDLK_PERIOD : SDLK_DELETE; + case SDLK_KP_EQUALS: + return SDLK_EQUALS; + case SDLK_KP_COMMA: + return SDLK_COMMA; + case SDLK_KP_EQUALSAS400: + return SDLK_EQUALS; + case SDLK_KP_LEFTPAREN: + return SDLK_LEFTPAREN; + case SDLK_KP_RIGHTPAREN: + return SDLK_RIGHTPAREN; + case SDLK_KP_LEFTBRACE: + return SDLK_LEFTBRACE; + case SDLK_KP_RIGHTBRACE: + return SDLK_RIGHTBRACE; + case SDLK_KP_TAB: + return SDLK_TAB; + case SDLK_KP_BACKSPACE: + return SDLK_BACKSPACE; + case SDLK_KP_A: + return SDLK_A; + case SDLK_KP_B: + return SDLK_B; + case SDLK_KP_C: + return SDLK_C; + case SDLK_KP_D: + return SDLK_D; + case SDLK_KP_E: + return SDLK_E; + case SDLK_KP_F: + return SDLK_F; + case SDLK_KP_PERCENT: + return SDLK_PERCENT; + case SDLK_KP_LESS: + return SDLK_LESS; + case SDLK_KP_GREATER: + return SDLK_GREATER; + case SDLK_KP_AMPERSAND: + return SDLK_AMPERSAND; + case SDLK_KP_COLON: + return SDLK_COLON; + case SDLK_KP_HASH: + return SDLK_HASH; + case SDLK_KP_SPACE: + return SDLK_SPACE; + case SDLK_KP_AT: + return SDLK_AT; + case SDLK_KP_EXCLAM: + return SDLK_EXCLAIM; + case SDLK_KP_PLUSMINUS: + return SDLK_PLUSMINUS; + default: + return keycode; + } +} + static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scancode, SDL_Keymod modstate) { SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) != 0; + SDL_bool numlock = (modstate & SDL_KMOD_NUM) != 0; + SDL_Keycode keycode; - // We won't be applying any modifiers except numlock by default - modstate &= SDL_KMOD_NUM; - - if (scancode >= SDL_SCANCODE_A && scancode <= SDL_SCANCODE_Z) { - if (keyboard->non_latin_letters && (keyboard->keycode_options & KEYCODE_OPTION_LATIN_LETTERS)) { - return SDL_GetDefaultKeyFromScancode(scancode, modstate); - } - } + // We won't be applying any modifiers by default + modstate = SDL_KMOD_NONE; - if (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0) { - if (keyboard->french_numbers && (keyboard->keycode_options & KEYCODE_OPTION_FRENCH_NUMBERS)) { - // Invert the shift state to generate the correct keycode + if ((keyboard->keycode_options & KEYCODE_OPTION_LATIN_LETTERS) && + keyboard->non_latin_letters && + scancode >= SDL_SCANCODE_A && scancode <= SDL_SCANCODE_Z) { + keycode = SDL_GetDefaultKeyFromScancode(scancode, modstate); + } else { + if ((keyboard->keycode_options & KEYCODE_OPTION_FRENCH_NUMBERS) && + keyboard->french_numbers && + (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0)) { + // Invert the shift state to generate the expected keycode if (shifted) { modstate &= ~SDL_KMOD_SHIFT; } else { modstate |= SDL_KMOD_SHIFT; } } + + keycode = SDL_GetKeyFromScancode(scancode, modstate); + } + + if (keyboard->keycode_options & KEYCODE_OPTION_HIDE_NUMPAD) { + keycode = SDL_ConvertNumpadKeycode(keycode, numlock); } - return SDL_GetKeyFromScancode(scancode, modstate); + return keycode; } static int SDL_SendKeyboardKeyInternal(Uint64 timestamp, Uint32 flags, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, Uint8 state) diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index 6dc233b520635..b4a576cd5f99d 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -238,94 +238,11 @@ SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod mods } } - switch (scancode) { - case SDL_SCANCODE_DELETE: + if (scancode == SDL_SCANCODE_DELETE) { return SDLK_DELETE; - case SDL_SCANCODE_KP_DIVIDE: - return SDLK_SLASH; - case SDL_SCANCODE_KP_MULTIPLY: - return SDLK_ASTERISK; - case SDL_SCANCODE_KP_MINUS: - return SDLK_MINUS; - case SDL_SCANCODE_KP_PLUS: - return SDLK_PLUS; - case SDL_SCANCODE_KP_ENTER: - return SDLK_RETURN; - case SDL_SCANCODE_KP_1: - return (modstate & SDL_KMOD_NUM) ? SDLK_1 : SDLK_END; - case SDL_SCANCODE_KP_2: - return (modstate & SDL_KMOD_NUM) ? SDLK_2 : SDLK_DOWN; - case SDL_SCANCODE_KP_3: - return (modstate & SDL_KMOD_NUM) ? SDLK_3 : SDLK_PAGEDOWN; - case SDL_SCANCODE_KP_4: - return (modstate & SDL_KMOD_NUM) ? SDLK_4 : SDLK_LEFT; - case SDL_SCANCODE_KP_5: - return (modstate & SDL_KMOD_NUM) ? SDLK_5 : SDLK_CLEAR; - case SDL_SCANCODE_KP_6: - return (modstate & SDL_KMOD_NUM) ? SDLK_6 : SDLK_RIGHT; - case SDL_SCANCODE_KP_7: - return (modstate & SDL_KMOD_NUM) ? SDLK_7 : SDLK_HOME; - case SDL_SCANCODE_KP_8: - return (modstate & SDL_KMOD_NUM) ? SDLK_8 : SDLK_UP; - case SDL_SCANCODE_KP_9: - return (modstate & SDL_KMOD_NUM) ? SDLK_9 : SDLK_PAGEUP; - case SDL_SCANCODE_KP_0: - return (modstate & SDL_KMOD_NUM) ? SDLK_0 : SDLK_INSERT; - case SDL_SCANCODE_KP_PERIOD: - return (modstate & SDL_KMOD_NUM) ? SDLK_PERIOD : SDLK_DELETE; - case SDL_SCANCODE_KP_EQUALS: - return SDLK_EQUALS; - case SDL_SCANCODE_KP_COMMA: - return SDLK_COMMA; - case SDL_SCANCODE_KP_EQUALSAS400: - return SDLK_EQUALS; - case SDL_SCANCODE_KP_LEFTPAREN: - return SDLK_LEFTPAREN; - case SDL_SCANCODE_KP_RIGHTPAREN: - return SDLK_RIGHTPAREN; - case SDL_SCANCODE_KP_LEFTBRACE: - return SDLK_LEFTBRACE; - case SDL_SCANCODE_KP_RIGHTBRACE: - return SDLK_RIGHTBRACE; - case SDL_SCANCODE_KP_TAB: - return SDLK_TAB; - case SDL_SCANCODE_KP_BACKSPACE: - return SDLK_BACKSPACE; - case SDL_SCANCODE_KP_A: - return SDLK_A; - case SDL_SCANCODE_KP_B: - return SDLK_B; - case SDL_SCANCODE_KP_C: - return SDLK_C; - case SDL_SCANCODE_KP_D: - return SDLK_D; - case SDL_SCANCODE_KP_E: - return SDLK_E; - case SDL_SCANCODE_KP_F: - return SDLK_F; - case SDL_SCANCODE_KP_PERCENT: - return SDLK_PERCENT; - case SDL_SCANCODE_KP_LESS: - return SDLK_LESS; - case SDL_SCANCODE_KP_GREATER: - return SDLK_GREATER; - case SDL_SCANCODE_KP_AMPERSAND: - return SDLK_AMPERSAND; - case SDL_SCANCODE_KP_COLON: - return SDLK_COLON; - case SDL_SCANCODE_KP_HASH: - return SDLK_HASH; - case SDL_SCANCODE_KP_SPACE: - return SDLK_SPACE; - case SDL_SCANCODE_KP_AT: - return SDLK_AT; - case SDL_SCANCODE_KP_EXCLAM: - return SDLK_EXCLAIM; - case SDL_SCANCODE_KP_PLUSMINUS: - return SDLK_PLUSMINUS; - default: - return SDL_SCANCODE_TO_KEYCODE(scancode); } + + return SDL_SCANCODE_TO_KEYCODE(scancode); } SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate) diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 59419720eb7a9..f531e47b54733 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -502,7 +502,7 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent } } - if (SDL_utf8strlen(keyEvent->key) == 1) { + if (keyEvent->location == 0 && SDL_utf8strlen(keyEvent->key) == 1) { const char *key = keyEvent->key; keycode = SDL_StepUTF8(&key, NULL); if (keycode == SDL_INVALID_UNICODE_CODEPOINT) { From b948d1446ac3a106f580df151f7c9db0e577b0ac Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 3 Jul 2024 01:35:19 +0000 Subject: [PATCH 135/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 769cbfcc5cfce..31c184c72a36e 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2000,7 +2000,10 @@ extern "C" { * in events: * * - "none": Keycode options are cleared, this overrides other options. - * - "hide_numpad": The numpad keysyms will be translated into their non-numpad versions based on the current NumLock state. For example, SDLK_KP_4 would become SDLK_4 if SDL_KMOD_NUM is set in the event modifiers, and SDLK_LEFT if it is unset. + * - "hide_numpad": The numpad keysyms will be translated into their + * non-numpad versions based on the current NumLock state. For example, + * SDLK_KP_4 would become SDLK_4 if SDL_KMOD_NUM is set in the event + * modifiers, and SDLK_LEFT if it is unset. * - "french_numbers": The number row on French keyboards is inverted, so * pressing the 1 key would yield the keycode SDLK_1, or '1', instead of * SDLK_AMPERSAND, or '&' From 61441c2be930331928528523dbd343910d63f975 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 Jul 2024 10:33:08 -0700 Subject: [PATCH 136/431] Fixed the French numeric keycode from varying based on shift state --- src/events/SDL_keyboard.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 6d058a50ef6b6..0b73d154dae5f 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -426,7 +426,6 @@ static SDL_Keycode SDL_ConvertNumpadKeycode(SDL_Keycode keycode, SDL_bool numloc static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scancode, SDL_Keymod modstate) { - SDL_bool shifted = (modstate & SDL_KMOD_SHIFT) != 0; SDL_bool numlock = (modstate & SDL_KMOD_NUM) != 0; SDL_Keycode keycode; @@ -441,12 +440,8 @@ static SDL_Keycode SDL_GetEventKeycode(SDL_Keyboard *keyboard, SDL_Scancode scan if ((keyboard->keycode_options & KEYCODE_OPTION_FRENCH_NUMBERS) && keyboard->french_numbers && (scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0)) { - // Invert the shift state to generate the expected keycode - if (shifted) { - modstate &= ~SDL_KMOD_SHIFT; - } else { - modstate |= SDL_KMOD_SHIFT; - } + // Add the shift state to generate a numeric keycode + modstate |= SDL_KMOD_SHIFT; } keycode = SDL_GetKeyFromScancode(scancode, modstate); From 0367f1af19c2ae7d88c3bf485b9da67ef391a6a6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 3 Jul 2024 02:47:10 -0400 Subject: [PATCH 137/431] loopwave: Use SDL_ResumeAudioStreamDevice. ...instead of the more-wordy: `SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));` --- test/loopwave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/loopwave.c b/test/loopwave.c index 27b6532e04d2c..9cd24fae9e86e 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -114,7 +114,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s\n", SDL_GetError()); return SDL_APP_FAILURE; } - SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream)); + SDL_ResumeAudioStreamDevice(stream); return SDL_APP_CONTINUE; } From 16e7fdc4f2a76515bafa594c6c19ca3897fc396c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 3 Jul 2024 03:19:00 -0400 Subject: [PATCH 138/431] audio: Add channel remapping to SDL_AudioSpec and SDL_AudioStream. Fixes #8367. --- include/SDL3/SDL_audio.h | 56 ++++++++-- src/audio/SDL_audio.c | 33 ++++-- src/audio/SDL_audiocvt.c | 149 ++++++++++++++++++-------- src/audio/SDL_audioqueue.c | 17 ++- src/audio/SDL_audioqueue.h | 2 +- src/audio/SDL_sysaudio.h | 16 ++- src/audio/alsa/SDL_alsa_audio.c | 144 ++++++------------------- src/audio/pulseaudio/SDL_pulseaudio.c | 1 + src/audio/qnx/SDL_qsa_audio.c | 1 + test/testaudiostreamdynamicresample.c | 1 + test/testautomation_audio.c | 23 +++- test/testffmpeg.c | 4 +- 12 files changed, 254 insertions(+), 193 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 3f8b9d918db86..f2e7c0916bd59 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -43,20 +43,41 @@ * if you aren't reading from a file) as a basic means to load sound data into * your program. * - * For multi-channel audio, data is interleaved (one sample for each channel, - * then repeat). The SDL channel order is: - * - * - Stereo: FL, FR - * - 2.1 surround: FL, FR, LFE - * - Quad: FL, FR, BL, BR - * - 4.1 surround: FL, FR, LFE, BL, BR - * - 5.1 surround: FL, FR, FC, LFE, SL, SR (last two can also be BL BR) - * - 6.1 surround: FL, FR, FC, LFE, BC, SL, SR - * - 7.1 surround: FL, FR, FC, LFE, BL, BR, SL, SR + * ## Channel layouts as SDL expects them + * + * Abbreviations: + * + * - FRONT = single mono speaker + * - FL = front left speaker + * - FR = front right speaker + * - FC = front center speaker + * - BL = back left speaker + * - BR = back right speaker + * - SR = surround right speaker + * - SL = surround left speaker + * - BC = back center speaker + * - LFE = low-frequency speaker + * + * These are listed in the order they are laid out in + * memory, so "FL, FR" means "the front left speaker is + * laid out in memory first, then the front right, then + * it repeats for the next audio frame". + * + * - 1 channel (mono) layout: FRONT + * - 2 channels (stereo) layout: FL, FR + * - 3 channels (2.1) layout: FL, FR, LFE + * - 4 channels (quad) layout: FL, FR, BL, BR + * - 5 channels (4.1) layout: FL, FR, LFE, BL, BR + * - 6 channels (5.1) layout: FL, FR, FC, LFE, BL, BR (last two can also be BL, BR) + * - 7 channels (6.1) layout: FL, FR, FC, LFE, BC, SL, SR + * - 8 channels (7.1) layout: FL, FR, FC, LFE, BL, BR, SL, SR * * This is the same order as DirectSound expects, but applied to all * platforms; SDL will swizzle the channels as necessary if a platform expects * something different. + * + * SDL_AudioStream can also be provided a channel map to change this ordering + * to whatever is necessary, in other audio processing scenarios. */ #ifndef SDL_audio_h_ @@ -280,6 +301,18 @@ typedef Uint32 SDL_AudioDeviceID; */ #define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFE) +/** + * Maximum channels that an SDL_AudioSpec channel map can handle. + * + * This is (currently) double the number of channels that SDL supports, + * to allow for future expansion while maintaining binary compatibility. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_AudioSpec + */ +#define SDL_MAX_CHANNEL_MAP_SIZE 16 + /** * Format specifier for audio data. * @@ -292,6 +325,8 @@ typedef struct SDL_AudioSpec SDL_AudioFormat format; /**< Audio data format */ int channels; /**< Number of channels: 1 mono, 2 stereo, etc */ int freq; /**< sample rate: sample frames per second */ + SDL_bool use_channel_map; /**< If SDL_FALSE, ignore `channel_map` and use default order. */ + Uint8 channel_map[SDL_MAX_CHANNEL_MAP_SIZE]; /**< `channels` items of channel order. */ } SDL_AudioSpec; /** @@ -318,6 +353,7 @@ typedef struct SDL_AudioSpec * when it doesn't have the complete buffer available. * - It can handle incoming data in any variable size. * - It can handle input/output format changes on the fly. + * - It can remap audio channels between inputs and outputs. * - You push data as you have it, and pull it when you need it * - It can also function as a basic audio data queue even if you just have * sound that needs to pass from one place to another. diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 5194858bf700a..0c1edacdae3ac 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -249,6 +249,16 @@ static void UpdateAudioStreamFormatsPhysical(SDL_AudioDevice *device) } } +SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b) +{ + if ((a->format != b->format) || (a->channels != b->channels) || (a->freq != b->freq) || (a->use_channel_map != b->use_channel_map)) { + return SDL_FALSE; + } else if (a->use_channel_map && (SDL_memcmp(a->channel_map, b->channel_map, sizeof (a->channel_map[0]) * a->channels) != 0)) { + return SDL_FALSE; + } + return SDL_TRUE; +} + // Zombie device implementation... @@ -632,11 +642,13 @@ SDL_AudioDevice *SDL_AddAudioDevice(SDL_bool recording, const char *name, const const int default_freq = recording ? DEFAULT_AUDIO_RECORDING_FREQUENCY : DEFAULT_AUDIO_PLAYBACK_FREQUENCY; SDL_AudioSpec spec; + SDL_zero(spec); if (!inspec) { spec.format = default_format; spec.channels = default_channels; spec.freq = default_freq; } else { + SDL_assert(!inspec->use_channel_map); // backends shouldn't set a channel map here! Set it when opening the device! spec.format = (inspec->format != 0) ? inspec->format : default_format; spec.channels = (inspec->channels != 0) ? inspec->channels : default_channels; spec.freq = (inspec->freq != 0) ? inspec->freq : default_freq; @@ -1089,7 +1101,7 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) SDL_AudioStream *stream = logdev->bound_streams; // We should have updated this elsewhere if the format changed! - SDL_assert(AUDIO_SPECS_EQUAL(stream->dst_spec, device->spec)); + SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &device->spec)); const int br = SDL_AtomicGet(&logdev->paused) ? 0 : SDL_GetAudioStreamData(stream, device_buffer, buffer_size); if (br < 0) { // Probably OOM. Kill the audio device; the whole thing is likely dying soon anyhow. @@ -1106,9 +1118,8 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) SDL_assert(work_buffer_size <= device->work_buffer_size); + SDL_copyp(&outspec, &device->spec); outspec.format = SDL_AUDIO_F32; - outspec.channels = device->spec.channels; - outspec.freq = device->spec.freq; SDL_memset(final_mix_buffer, '\0', work_buffer_size); // start with silence. @@ -1126,7 +1137,7 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) for (SDL_AudioStream *stream = logdev->bound_streams; stream; stream = stream->next_binding) { // We should have updated this elsewhere if the format changed! - SDL_assert(AUDIO_SPECS_EQUAL(stream->dst_spec, outspec)); + SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &outspec)); /* this will hold a lock on `stream` while getting. We don't explicitly lock the streams for iterating here because the binding linked list can only change while the device lock is held. @@ -1150,8 +1161,8 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) if (((Uint8 *) final_mix_buffer) != device_buffer) { // !!! FIXME: we can't promise the device buf is aligned/padded for SIMD. - //ConvertAudio(needed_samples * device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, device_buffer, device->spec.format, device->spec.channels, device->work_buffer); - ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, device->work_buffer, device->spec.format, device->spec.channels, NULL); + //ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, NULL, device_buffer, device->spec.format, device->spec.channels, NULL, NULL); + ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, NULL, device->work_buffer, device->spec.format, device->spec.channels, NULL, NULL); SDL_memcpy(device_buffer, device->work_buffer, buffer_size); } } @@ -1242,13 +1253,12 @@ SDL_bool SDL_RecordingAudioThreadIterate(SDL_AudioDevice *device) if (logdev->postmix) { // move to float format. SDL_AudioSpec outspec; + SDL_copyp(&outspec, &device->spec); outspec.format = SDL_AUDIO_F32; - outspec.channels = device->spec.channels; - outspec.freq = device->spec.freq; output_buffer = device->postmix_buffer; const int frames = br / SDL_AUDIO_FRAMESIZE(device->spec); br = frames * SDL_AUDIO_FRAMESIZE(outspec); - ConvertAudio(frames, device->work_buffer, device->spec.format, outspec.channels, device->postmix_buffer, SDL_AUDIO_F32, outspec.channels, NULL); + ConvertAudio(frames, device->work_buffer, device->spec.format, outspec.channels, NULL, device->postmix_buffer, SDL_AUDIO_F32, outspec.channels, NULL, NULL); logdev->postmix(logdev->postmix_userdata, &outspec, device->postmix_buffer, br); } @@ -1606,6 +1616,7 @@ static int OpenPhysicalAudioDevice(SDL_AudioDevice *device, const SDL_AudioSpec device->spec.format = (SDL_AUDIO_BITSIZE(device->default_spec.format) >= SDL_AUDIO_BITSIZE(spec.format)) ? device->default_spec.format : spec.format; device->spec.freq = SDL_max(device->default_spec.freq, spec.freq); device->spec.channels = SDL_max(device->default_spec.channels, spec.channels); + device->spec.use_channel_map = SDL_FALSE; // all initial channel map requests are denied, since we might have to change channel counts. device->sample_frames = GetDefaultSampleFramesFromFreq(device->spec.freq); SDL_UpdatedAudioDeviceFormat(device); // start this off sane. @@ -2155,7 +2166,7 @@ void SDL_DefaultAudioDeviceChanged(SDL_AudioDevice *new_default_device) } if (needs_migration) { - const SDL_bool spec_changed = !AUDIO_SPECS_EQUAL(current_default_device->spec, new_default_device->spec); + const SDL_bool spec_changed = !SDL_AudioSpecsEqual(¤t_default_device->spec, &new_default_device->spec); SDL_LogicalAudioDevice *next = NULL; for (SDL_LogicalAudioDevice *logdev = current_default_device->logical_devices; logdev; logdev = next) { next = logdev->next; @@ -2235,7 +2246,7 @@ int SDL_AudioDeviceFormatChangedAlreadyLocked(SDL_AudioDevice *device, const SDL { const int orig_work_buffer_size = device->work_buffer_size; - if (AUDIO_SPECS_EQUAL(device->spec, *newspec) && new_sample_frames == device->sample_frames) { + if (SDL_AudioSpecsEqual(&device->spec, newspec) && (new_sample_frames == device->sample_frames)) { return 0; // we're already in that format. } diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 638f570962100..6b7a9e566e0ab 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -29,39 +29,6 @@ #define SDL_INT_MAX ((int)(~0u>>1)) #endif -/* - * CHANNEL LAYOUTS AS SDL EXPECTS THEM: - * - * (Even if the platform expects something else later, that - * SDL will swizzle between the app and the platform). - * - * Abbreviations: - * - FRONT=single mono speaker - * - FL=front left speaker - * - FR=front right speaker - * - FC=front center speaker - * - BL=back left speaker - * - BR=back right speaker - * - SR=surround right speaker - * - SL=surround left speaker - * - BC=back center speaker - * - LFE=low-frequency speaker - * - * These are listed in the order they are laid out in - * memory, so "FL+FR" means "the front left speaker is - * laid out in memory first, then the front right, then - * it repeats for the next audio frame". - * - * 1 channel (mono) layout: FRONT - * 2 channels (stereo) layout: FL+FR - * 3 channels (2.1) layout: FL+FR+LFE - * 4 channels (quad) layout: FL+FR+BL+BR - * 5 channels (4.1) layout: FL+FR+LFE+BL+BR - * 6 channels (5.1) layout: FL+FR+FC+LFE+BL+BR - * 7 channels (6.1) layout: FL+FR+FC+LFE+BC+SL+SR - * 8 channels (7.1) layout: FL+FR+FC+LFE+BL+BR+SL+SR - */ - #ifdef SDL_SSE3_INTRINSICS // Convert from stereo to mono. Average left and right. static void SDL_TARGETING("sse3") SDL_ConvertStereoToMono_SSE3(float *dst, const float *src, int num_frames) @@ -157,6 +124,68 @@ static SDL_bool SDL_IsSupportedChannelCount(const int channels) return ((channels >= 1) && (channels <= 8)); } +SDL_bool SDL_ChannelMapIsBogus(const Uint8 *map, int channels) +{ + if (map) { + for (int i = 0; i < channels; i++) { + if (map[i] >= ((Uint8) channels)) { + return SDL_TRUE; + } + } + } + return SDL_FALSE; +} + +SDL_bool SDL_ChannelMapIsDefault(const Uint8 *map, int channels) +{ + if (map) { + for (int i = 0; i < channels; i++) { + if (map[i] != i) { + return SDL_FALSE; + } + } + } + return SDL_TRUE; +} + +// Swizzle audio channels. src and dst can be the same pointer. It does not change the buffer size. +static void SwizzleAudio(const int num_frames, void *dst, const void *src, int channels, const Uint8 *map, int bitsize) +{ + #define CHANNEL_SWIZZLE(bits) { \ + Uint##bits *tdst = (Uint##bits *) dst; /* treat as UintX; we only care about moving bits and not the type here. */ \ + const Uint##bits *tsrc = (const Uint##bits *) src; \ + if (src != dst) { /* don't need to copy to a temporary frame first. */ \ + for (int i = 0; i < num_frames; i++, tsrc += channels, tdst += channels) { \ + for (int ch = 0; ch < channels; ch++) { \ + tdst[ch] = tsrc[map[ch]]; \ + } \ + } \ + } else { \ + Uint##bits tmp[SDL_MAX_CHANNEL_MAP_SIZE]; \ + SDL_assert(SDL_arraysize(tmp) >= channels); \ + for (int i = 0; i < num_frames; i++, tsrc += channels, tdst += channels) { \ + for (int ch = 0; ch < channels; ch++) { \ + tmp[ch] = tsrc[map[ch]]; \ + } \ + for (int ch = 0; ch < channels; ch++) { \ + tdst[ch] = tmp[ch]; \ + } \ + } \ + } \ + } + + switch (bitsize) { + case 8: CHANNEL_SWIZZLE(8); break; + case 16: CHANNEL_SWIZZLE(16); break; + case 32: CHANNEL_SWIZZLE(32); break; + // we don't currently have int64 or double audio datatypes, so no `case 64` for now. + default: SDL_assert(!"Unsupported audio datatype size"); break; + } + + #undef CHANNEL_SWIZZLE +} + + // This does type and channel conversions _but not resampling_ (resampling happens in SDL_AudioStream). // This does not check parameter validity, (beyond asserts), it expects you did that already! // All of this has to function as if src==dst==scratch (conversion in-place), but as a convenience @@ -164,8 +193,10 @@ static SDL_bool SDL_IsSupportedChannelCount(const int channels) // // The scratch buffer must be able to store `num_frames * CalculateMaxSampleFrameSize(src_format, src_channels, dst_format, dst_channels)` bytes. // If the scratch buffer is NULL, this restriction applies to the output buffer instead. -void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, int src_channels, - void *dst, SDL_AudioFormat dst_format, int dst_channels, void* scratch) +void ConvertAudio(int num_frames, + const void *src, SDL_AudioFormat src_format, int src_channels, const Uint8 *src_map, + void *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, + void* scratch) { SDL_assert(src != NULL); SDL_assert(dst != NULL); @@ -188,11 +219,13 @@ void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, i const int dst_sample_frame_size = (dst_bitsize / 8) * dst_channels; /* Type conversion goes like this now: + - swizzle through source channel map to "standard" layout. - byteswap to CPU native format first if necessary. - convert to native Float32 if necessary. - change channel count if necessary. - convert to final data format. - byteswap back to foreign format if necessary. + - swizzle through dest channel map from "standard" layout. The expectation is we can process data faster in float32 (possibly with SIMD), and making several passes over the same @@ -201,11 +234,20 @@ void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, i (script-generated) custom converters for every data type and it was a bloat on SDL compile times and final library size. */ + // swizzle input to "standard" format if necessary. + if (src_map) { + void* buf = scratch ? scratch : dst; // use scratch if available, since it has to be big enough to hold src, unless it's NULL, then dst has to be. + SwizzleAudio(num_frames, buf, src, src_channels, src_map, src_bitsize); + src = buf; + } + // see if we can skip float conversion entirely. if (src_channels == dst_channels) { if (src_format == dst_format) { // nothing to do, we're already in the right format, just copy it over if necessary. - if (src != dst) { + if (dst_map) { + SwizzleAudio(num_frames, dst, src, dst_channels, dst_map, dst_bitsize); + } else if (src != dst) { SDL_memcpy(dst, src, num_frames * dst_sample_frame_size); } return; @@ -213,7 +255,11 @@ void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, i // just a byteswap needed? if ((src_format ^ dst_format) == SDL_AUDIO_MASK_BIG_ENDIAN) { - ConvertAudioSwapEndian(dst, src, num_frames * src_channels, src_bitsize); + if (dst_map) { // do this first, in case we duplicate channels, we can avoid an extra copy if src != dst. + SwizzleAudio(num_frames, dst, src, dst_channels, dst_map, dst_bitsize); + src = dst; + } + ConvertAudioSwapEndian(dst, src, num_frames * dst_channels, dst_bitsize); return; // all done. } } @@ -275,6 +321,10 @@ void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, i } SDL_assert(src == dst); // if we got here, we _had_ to have done _something_. Otherwise, we should have memcpy'd! + + if (dst_map) { + SwizzleAudio(num_frames, dst, src, dst_channels, dst_map, dst_bitsize); + } } // Calculate the largest frame size needed to convert between the two formats. @@ -304,7 +354,7 @@ static Sint64 GetAudioStreamResampleRate(SDL_AudioStream* stream, int src_freq, static int UpdateAudioStreamInputSpec(SDL_AudioStream *stream, const SDL_AudioSpec *spec) { - if (AUDIO_SPECS_EQUAL(stream->input_spec, *spec)) { + if (SDL_AudioSpecsEqual(&stream->input_spec, spec)) { return 0; } @@ -451,6 +501,8 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s return SDL_SetError("Source rate is too low"); } else if (src_spec->freq > max_freq) { return SDL_SetError("Source rate is too high"); + } else if (src_spec->use_channel_map && SDL_ChannelMapIsBogus(src_spec->channel_map, src_spec->channels)) { + return SDL_SetError("Source channel map is invalid"); } } @@ -465,6 +517,8 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s return SDL_SetError("Destination rate is too low"); } else if (dst_spec->freq > max_freq) { return SDL_SetError("Destination rate is too high"); + } else if (dst_spec->use_channel_map && SDL_ChannelMapIsBogus(dst_spec->channel_map, dst_spec->channels)) { + return SDL_SetError("Destination channel map is invalid"); } } @@ -481,12 +535,21 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s if (src_spec) { SDL_copyp(&stream->src_spec, src_spec); + if (src_spec->use_channel_map && SDL_ChannelMapIsDefault(src_spec->channel_map, src_spec->channels)) { + stream->src_spec.use_channel_map = SDL_FALSE; // turn off the channel map, as this is just unnecessary work. + } } if (dst_spec) { SDL_copyp(&stream->dst_spec, dst_spec); + if (dst_spec->use_channel_map && !stream->src_spec.use_channel_map && SDL_ChannelMapIsDefault(dst_spec->channel_map, dst_spec->channels)) { + stream->dst_spec.use_channel_map = SDL_FALSE; // turn off the channel map, as this is just unnecessary work. + } } + // !!! FIXME: decide if the source and dest channel maps would swizzle us back to the starting order and just turn them both off. + // !!! FIXME: (but in this case, you can only do it if the channel count isn't changing, because source order is important to that.) + SDL_UnlockMutex(stream->lock); return 0; @@ -766,6 +829,7 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou const SDL_AudioFormat dst_format = dst_spec->format; const int dst_channels = dst_spec->channels; + const Uint8 *dst_map = dst_spec->use_channel_map ? dst_spec->channel_map : NULL; const int max_frame_size = CalculateMaxFrameSize(src_format, src_channels, dst_format, dst_channels); const Sint64 resample_rate = GetAudioStreamResampleRate(stream, src_spec->freq, stream->resample_offset); @@ -789,7 +853,7 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou } } - if (SDL_ReadFromAudioQueue(stream->queue, buf, dst_format, dst_channels, 0, output_frames, 0, work_buffer) != buf) { + if (SDL_ReadFromAudioQueue(stream->queue, buf, dst_format, dst_channels, dst_map, 0, output_frames, 0, work_buffer) != buf) { return SDL_SetError("Not enough data in queue"); } @@ -854,8 +918,9 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou return -1; } + // (dst channel map is NULL because we'll do the final swizzle on ConvertAudio after resample.) const Uint8* input_buffer = SDL_ReadFromAudioQueue(stream->queue, - NULL, resample_format, resample_channels, + NULL, resample_format, resample_channels, NULL, padding_frames, input_frames, padding_frames, work_buffer); if (!input_buffer) { @@ -872,8 +937,8 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou (float*) resample_buffer, output_frames, resample_rate, &stream->resample_offset); - // Convert to the final format, if necessary - ConvertAudio(output_frames, resample_buffer, resample_format, resample_channels, buf, dst_format, dst_channels, work_buffer); + // Convert to the final format, if necessary (src channel map is NULL because SDL_ReadFromAudioQueue already handled this). + ConvertAudio(output_frames, resample_buffer, resample_format, resample_channels, NULL, buf, dst_format, dst_channels, dst_map, work_buffer); return 0; } diff --git a/src/audio/SDL_audioqueue.c b/src/audio/SDL_audioqueue.c index 53ddddb17027d..41c8af3b456c7 100644 --- a/src/audio/SDL_audioqueue.c +++ b/src/audio/SDL_audioqueue.c @@ -23,8 +23,6 @@ #include "SDL_audioqueue.h" #include "SDL_sysaudio.h" -#define AUDIO_SPECS_EQUAL(x, y) (((x).format == (y).format) && ((x).channels == (y).channels) && ((x).freq == (y).freq)) - typedef struct SDL_MemoryPool SDL_MemoryPool; struct SDL_MemoryPool @@ -285,7 +283,7 @@ void SDL_AddTrackToAudioQueue(SDL_AudioQueue *queue, SDL_AudioTrack *track) if (tail) { // If the spec has changed, make sure to flush the previous track - if (!AUDIO_SPECS_EQUAL(tail->spec, track->spec)) { + if (!SDL_AudioSpecsEqual(&tail->spec, &track->spec)) { FlushAudioTrack(tail); } @@ -319,7 +317,7 @@ int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, cons SDL_AudioTrack *track = queue->tail; if (track) { - if (!AUDIO_SPECS_EQUAL(track->spec, *spec)) { + if (!SDL_AudioSpecsEqual(&track->spec, spec)) { FlushAudioTrack(track); } } else { @@ -514,7 +512,7 @@ static const Uint8 *PeekIntoAudioQueueFuture(SDL_AudioQueue *queue, Uint8 *data, } const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, - Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, + Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, int past_frames, int present_frames, int future_frames, Uint8 *scratch) { @@ -526,6 +524,7 @@ const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, SDL_AudioFormat src_format = track->spec.format; int src_channels = track->spec.channels; + const Uint8 *src_map = track->spec.use_channel_map ? track->spec.channel_map : NULL; size_t src_frame_size = SDL_AUDIO_BYTESIZE(src_format) * src_channels; size_t dst_frame_size = SDL_AUDIO_BYTESIZE(dst_format) * dst_channels; @@ -553,7 +552,7 @@ const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, // Do we still need to copy/convert the data? if (dst) { ConvertAudio(past_frames + present_frames + future_frames, ptr, - src_format, src_channels, dst, dst_format, dst_channels, scratch); + src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); ptr = dst; } @@ -571,19 +570,19 @@ const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, Uint8 *ptr = dst; if (src_past_bytes) { - ConvertAudio(past_frames, PeekIntoAudioQueuePast(queue, scratch, src_past_bytes), src_format, src_channels, dst, dst_format, dst_channels, scratch); + ConvertAudio(past_frames, PeekIntoAudioQueuePast(queue, scratch, src_past_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); dst += dst_past_bytes; scratch += dst_past_bytes; } if (src_present_bytes) { - ConvertAudio(present_frames, ReadFromAudioQueue(queue, scratch, src_present_bytes), src_format, src_channels, dst, dst_format, dst_channels, scratch); + ConvertAudio(present_frames, ReadFromAudioQueue(queue, scratch, src_present_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); dst += dst_present_bytes; scratch += dst_present_bytes; } if (src_future_bytes) { - ConvertAudio(future_frames, PeekIntoAudioQueueFuture(queue, scratch, src_future_bytes), src_format, src_channels, dst, dst_format, dst_channels, scratch); + ConvertAudio(future_frames, PeekIntoAudioQueueFuture(queue, scratch, src_future_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); dst += dst_future_bytes; scratch += dst_future_bytes; } diff --git a/src/audio/SDL_audioqueue.h b/src/audio/SDL_audioqueue.h index 54c2ba72ad104..26675ce295761 100644 --- a/src/audio/SDL_audioqueue.h +++ b/src/audio/SDL_audioqueue.h @@ -67,7 +67,7 @@ void *SDL_BeginAudioQueueIter(SDL_AudioQueue *queue); size_t SDL_NextAudioQueueIter(SDL_AudioQueue *queue, void **inout_iter, SDL_AudioSpec *out_spec, SDL_bool *out_flushed); const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, - Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, + Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, int past_frames, int present_frames, int future_frames, Uint8 *scratch); diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 4c3d2e6d062ad..9973be9bf115c 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -48,8 +48,6 @@ #define DEFAULT_AUDIO_RECORDING_CHANNELS 1 #define DEFAULT_AUDIO_RECORDING_FREQUENCY 44100 -#define AUDIO_SPECS_EQUAL(x, y) (((x).format == (y).format) && ((x).channels == (y).channels) && ((x).freq == (y).freq)) - typedef struct SDL_AudioDevice SDL_AudioDevice; typedef struct SDL_LogicalAudioDevice SDL_LogicalAudioDevice; @@ -113,9 +111,19 @@ extern void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SD extern void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_AudioFormat dst_fmt); extern void ConvertAudioSwapEndian(void* dst, const void* src, int num_samples, int bitsize); +extern SDL_bool SDL_ChannelMapIsDefault(const Uint8 *map, int channels); +extern SDL_bool SDL_ChannelMapIsBogus(const Uint8 *map, int channels); + // this gets used from the audio device threads. It has rules, don't use this if you don't know how to use it! -extern void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, int src_channels, - void *dst, SDL_AudioFormat dst_format, int dst_channels, void* scratch); +extern void ConvertAudio(int num_frames, + const void *src, SDL_AudioFormat src_format, int src_channels, const Uint8 *src_map, + void *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, + void* scratch); + +// Compare two SDL_AudioSpecs, return SDL_TRUE if they match exactly. +// Using SDL_memcmp directly isn't safe, since potential padding (and unused parts of the channel map) might not be initialized. +extern SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b); + // Special case to let something in SDL_audiocvt.c access something in SDL_audio.c. Don't use this. extern void OnAudioStreamCreated(SDL_AudioStream *stream); diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 115707f48c45a..07a4849709e30 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -242,108 +242,22 @@ static const char *get_audio_device(void *handle, const int channels) return dev->name; } -// !!! FIXME: is there a channel swizzler in alsalib instead? +// Swizzle channels to match SDL defaults. +// These are swizzles _from_ SDL's layouts to what ALSA wants. +// 5.1 swizzle: // https://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) \ - static void swizzle_alsa_channels_6_##T(void *buffer, const Uint32 bufferlen) \ - { \ - T *ptr = (T *)buffer; \ - Uint32 i; \ - for (i = 0; i < bufferlen; 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; \ - } \ - } - - -// !!! FIXME: is there a channel swizzler in alsalib instead? -// !!! FIXME: this screams for a SIMD shuffle operation. +static const Uint8 swizzle_alsa_channels_6[6] = { 0, 1, 4, 5, 2, 3 }; +// 7.1 swizzle: // https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/mapping-stream-formats-to-speaker-configurations // For Linux ALSA, this appears to be FL-FR-RL-RR-C-LFE-SL-SR // and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-SL-SR-RL-RR" -#define SWIZ8(T) \ - static void swizzle_alsa_channels_8_##T(void *buffer, const Uint32 bufferlen) \ - { \ - T *ptr = (T *)buffer; \ - Uint32 i; \ - for (i = 0; i < bufferlen; i++, ptr += 6) { \ - const T center = ptr[2]; \ - const T subwoofer = ptr[3]; \ - const T side_left = ptr[4]; \ - const T side_right = ptr[5]; \ - const T rear_left = ptr[6]; \ - const T rear_right = ptr[7]; \ - ptr[2] = rear_left; \ - ptr[3] = rear_right; \ - ptr[4] = center; \ - ptr[5] = subwoofer; \ - ptr[6] = side_left; \ - ptr[7] = side_right; \ - } \ - } - -#define CHANNEL_SWIZZLE(x) \ - x(Uint64) \ - x(Uint32) \ - x(Uint16) \ - x(Uint8) - -CHANNEL_SWIZZLE(SWIZ6) -CHANNEL_SWIZZLE(SWIZ8) - -#undef CHANNEL_SWIZZLE -#undef SWIZ6 -#undef SWIZ8 - -// Called right before feeding device->hidden->mixbuf to the hardware. Swizzle -// channels from Windows/Mac order to the format alsalib will want. -static void swizzle_alsa_channels(SDL_AudioDevice *device, void *buffer, Uint32 bufferlen) -{ - switch (device->spec.channels) { -#define CHANSWIZ(chans) \ - case chans: \ - switch ((device->spec.format & (0xFF))) { \ - case 8: \ - swizzle_alsa_channels_##chans##_Uint8(buffer, bufferlen); \ - break; \ - case 16: \ - swizzle_alsa_channels_##chans##_Uint16(buffer, bufferlen); \ - break; \ - case 32: \ - swizzle_alsa_channels_##chans##_Uint32(buffer, bufferlen); \ - break; \ - case 64: \ - swizzle_alsa_channels_##chans##_Uint64(buffer, bufferlen); \ - break; \ - default: \ - SDL_assert(!"unhandled bitsize"); \ - break; \ - } \ - return; +static const Uint8 swizzle_alsa_channels_8[8] = { 0, 1, 6, 7, 2, 3, 4, 5 }; - CHANSWIZ(6); - CHANSWIZ(8); -#undef CHANSWIZ - default: - break; - } -} -#ifdef SND_CHMAP_API_VERSION -// Some devices have the right channel map, no swizzling necessary -static void no_swizzle(SDL_AudioDevice *device, void *buffer, Uint32 bufferlen) -{ -} -#endif // SND_CHMAP_API_VERSION // This function waits until it is possible to write a full sound buffer static int ALSA_WaitDevice(SDL_AudioDevice *device) @@ -380,8 +294,6 @@ static int ALSA_PlayDevice(SDL_AudioDevice *device, const Uint8 *buffer, int buf const int frame_size = SDL_AUDIO_FRAMESIZE(device->spec); snd_pcm_uframes_t frames_left = (snd_pcm_uframes_t) (buflen / frame_size); - device->hidden->swizzle_func(device, sample_buf, frames_left); - while ((frames_left > 0) && !SDL_AtomicGet(&device->shutdown)) { const int rc = ALSA_snd_pcm_writei(device->hidden->pcm_handle, sample_buf, frames_left); //SDL_LogInfo(SDL_LOG_CATEGORY_AUDIO, "ALSA PLAYDEVICE: WROTE %d of %d bytes", (rc >= 0) ? ((int) (rc * frame_size)) : rc, (int) (frames_left * frame_size)); @@ -447,8 +359,6 @@ static int ALSA_RecordDevice(SDL_AudioDevice *device, void *buffer, int buflen) return -1; } return 0; // go back to WaitDevice and try again. - } else if (rc > 0) { - device->hidden->swizzle_func(device, buffer, total_frames - rc); } //SDL_LogInfo(SDL_LOG_CATEGORY_AUDIO, "ALSA: recorded %d bytes", rc * frame_size); @@ -611,35 +521,45 @@ static int ALSA_OpenDevice(SDL_AudioDevice *device) } device->spec.format = test_format; + // Set the number of channels + status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams, + device->spec.channels); + unsigned int channels = device->spec.channels; + if (status < 0) { + status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels); + if (status < 0) { + return SDL_SetError("ALSA: Couldn't set audio channels"); + } + device->spec.channels = channels; + } + // Validate number of channels and determine if swizzling is necessary. // Assume original swizzling, until proven otherwise. - device->hidden->swizzle_func = swizzle_alsa_channels; + if (channels == 6) { + device->spec.use_channel_map = SDL_TRUE; + SDL_memcpy(device->spec.channel_map, swizzle_alsa_channels_6, sizeof (device->spec.channel_map[0]) * channels); + } else if (channels == 8) { + device->spec.use_channel_map = SDL_TRUE; + SDL_memcpy(device->spec.channel_map, swizzle_alsa_channels_8, sizeof (device->spec.channel_map[0]) * channels); + } + #ifdef SND_CHMAP_API_VERSION snd_pcm_chmap_t *chmap = ALSA_snd_pcm_get_chmap(pcm_handle); if (chmap) { char chmap_str[64]; if (ALSA_snd_pcm_chmap_print(chmap, sizeof(chmap_str), chmap_str) > 0) { - if (SDL_strcmp("FL FR FC LFE RL RR", chmap_str) == 0 || - SDL_strcmp("FL FR FC LFE SL SR", chmap_str) == 0) { - device->hidden->swizzle_func = no_swizzle; + if ( (channels == 6) && + ((SDL_strcmp("FL FR FC LFE RL RR", chmap_str) == 0) || + (SDL_strcmp("FL FR FC LFE SL SR", chmap_str) == 0)) ) { + device->spec.use_channel_map = SDL_FALSE; + } else if ((channels == 8) && (SDL_strcmp("FL FR FC LFE SL SR RL RR", chmap_str) == 0)) { + device->spec.use_channel_map = SDL_FALSE; } } free(chmap); // This should NOT be SDL_free() } #endif // SND_CHMAP_API_VERSION - // Set the number of channels - status = ALSA_snd_pcm_hw_params_set_channels(pcm_handle, hwparams, - device->spec.channels); - unsigned int channels = device->spec.channels; - if (status < 0) { - status = ALSA_snd_pcm_hw_params_get_channels(hwparams, &channels); - if (status < 0) { - return SDL_SetError("ALSA: Couldn't set audio channels"); - } - device->spec.channels = channels; - } - // Set the audio rate unsigned int rate = device->spec.freq; status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c index 8bfb0e5763065..6a9681fd50017 100644 --- a/src/audio/pulseaudio/SDL_pulseaudio.c +++ b/src/audio/pulseaudio/SDL_pulseaudio.c @@ -789,6 +789,7 @@ static SDL_AudioFormat PulseFormatToSDLFormat(pa_sample_format_t format) static void AddPulseAudioDevice(const SDL_bool recording, const char *description, const char *name, const uint32_t index, const pa_sample_spec *sample_spec) { SDL_AudioSpec spec; + SDL_zero(spec); spec.format = PulseFormatToSDLFormat(sample_spec->format); spec.channels = sample_spec->channels; spec.freq = sample_spec->rate; diff --git a/src/audio/qnx/SDL_qsa_audio.c b/src/audio/qnx/SDL_qsa_audio.c index 531ec40368456..42e9c0e13d3cd 100644 --- a/src/audio/qnx/SDL_qsa_audio.c +++ b/src/audio/qnx/SDL_qsa_audio.c @@ -363,6 +363,7 @@ static void QSA_DetectDevices(SDL_AudioDevice **default_playback, SDL_AudioDevic if (status == EOK) { SDL_AudioSpec spec; + SDL_zero(spec); SDL_AudioSpec *pspec = &spec; snd_pcm_channel_setup_t csetup; SDL_zero(csetup); diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index a0a949e621cf2..58aeb4c96f367 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -109,6 +109,7 @@ static void queue_audio() int retval = 0; SDL_AudioSpec new_spec; + SDL_zero(new_spec); new_spec.format = spec.format; new_spec.channels = (int) sliders[2].value; new_spec.freq = (int) sliders[1].value; diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index aa2fb02d78348..a505efda738f3 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -181,7 +181,7 @@ static int audio_initOpenCloseQuitAudio(void *arg) SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); /* Set spec */ - SDL_memset(&desired, 0, sizeof(desired)); + SDL_zero(desired); switch (j) { case 0: /* Set standard desired spec */ @@ -272,7 +272,7 @@ static int audio_pauseUnpauseAudio(void *arg) SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); /* Set spec */ - SDL_memset(&desired, 0, sizeof(desired)); + SDL_zero(desired); switch (j) { case 0: /* Set standard desired spec */ @@ -496,6 +496,9 @@ static int audio_buildAudioStream(void *arg) SDL_AudioSpec spec2; int i, ii, j, jj, k, kk; + SDL_zero(spec1); + SDL_zero(spec2); + /* Call Quit */ SDL_QuitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_QuitSubSystem(SDL_INIT_AUDIO)"); @@ -567,6 +570,9 @@ static int audio_buildAudioStreamNegative(void *arg) int i; char message[256]; + SDL_zero(spec1); + SDL_zero(spec2); + /* Valid format */ spec1.format = SDL_AUDIO_S8; spec1.channels = 1; @@ -678,6 +684,9 @@ static int audio_convertAudio(void *arg) char message[128]; int i, ii, j, jj, k, kk; + SDL_zero(spec1); + SDL_zero(spec2); + /* Iterate over bitmask that determines which parameters are modified in the conversion */ for (c = 1; c < 8; c++) { SDL_strlcpy(message, "Changing:", 128); @@ -995,6 +1004,9 @@ static int audio_resampleLoss(void *arg) double sum_squared_value = 0; double signal_to_noise = 0; + SDL_zero(tmpspec1); + SDL_zero(tmpspec2); + SDLTest_AssertPass("Test resampling of %i s %i Hz %f phase sine wave from sampling rate of %i Hz to %i Hz", spec->time, spec->freq, spec->phase, spec->rate_in, spec->rate_out); @@ -1147,6 +1159,9 @@ static int audio_convertAccuracy(void *arg) int tmp_len, dst_len; int ret; + SDL_zero(src_spec); + SDL_zero(tmp_spec); + SDL_AudioFormat format = formats[i]; const char* format_name = format_names[i]; @@ -1238,6 +1253,10 @@ static int audio_formatChange(void *arg) double target_signal_to_noise = 75.0; int sine_freq = 500; + SDL_zero(spec1); + SDL_zero(spec2); + SDL_zero(spec3); + spec1.format = SDL_AUDIO_F32; spec1.channels = 1; spec1.freq = 20000; diff --git a/test/testffmpeg.c b/test/testffmpeg.c index 3826be652792f..3d9cca6660999 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -1167,7 +1167,7 @@ static AVCodecContext *OpenAudioStream(AVFormatContext *ic, int stream, const AV return NULL; } - SDL_AudioSpec spec = { SDL_AUDIO_F32, codecpar->ch_layout.nb_channels, codecpar->sample_rate }; + SDL_AudioSpec spec = { SDL_AUDIO_F32, codecpar->ch_layout.nb_channels, codecpar->sample_rate, SDL_FALSE }; audio = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, NULL, NULL); if (audio) { SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(audio)); @@ -1240,7 +1240,7 @@ static void InterleaveAudio(AVFrame *frame, const SDL_AudioSpec *spec) static void HandleAudioFrame(AVFrame *frame) { if (audio) { - SDL_AudioSpec spec = { GetAudioFormat(frame->format), frame->ch_layout.nb_channels, frame->sample_rate }; + SDL_AudioSpec spec = { GetAudioFormat(frame->format), frame->ch_layout.nb_channels, frame->sample_rate, SDL_FALSE }; SDL_SetAudioStreamFormat(audio, &spec, NULL); if (frame->ch_layout.nb_channels > 1 && IsPlanarAudioFormat(frame->format)) { From ece76ec90d42a15d701b1e1ae8f15fdc50730c31 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 3 Jul 2024 14:19:27 -0400 Subject: [PATCH 139/431] audio: Attempt to placate NetBSD 9.3's incorrect compiler warning. --- src/audio/SDL_audiocvt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 6b7a9e566e0ab..e05c88ee650b1 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -162,6 +162,7 @@ static void SwizzleAudio(const int num_frames, void *dst, const void *src, int c } \ } else { \ Uint##bits tmp[SDL_MAX_CHANNEL_MAP_SIZE]; \ + SDL_zeroa(tmp); \ SDL_assert(SDL_arraysize(tmp) >= channels); \ for (int i = 0; i < num_frames; i++, tsrc += channels, tdst += channels) { \ for (int ch = 0; ch < channels; ch++) { \ From 98f27b8f2e2b95c1faaeb6b6b2926258129c048e Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 3 Jul 2024 18:39:46 +0000 Subject: [PATCH 140/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_audio.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index f2e7c0916bd59..c3bf5e94f7796 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -58,17 +58,17 @@ * - BC = back center speaker * - LFE = low-frequency speaker * - * These are listed in the order they are laid out in - * memory, so "FL, FR" means "the front left speaker is - * laid out in memory first, then the front right, then - * it repeats for the next audio frame". + * These are listed in the order they are laid out in memory, so "FL, FR" + * means "the front left speaker is laid out in memory first, then the front + * right, then it repeats for the next audio frame". * * - 1 channel (mono) layout: FRONT * - 2 channels (stereo) layout: FL, FR * - 3 channels (2.1) layout: FL, FR, LFE * - 4 channels (quad) layout: FL, FR, BL, BR * - 5 channels (4.1) layout: FL, FR, LFE, BL, BR - * - 6 channels (5.1) layout: FL, FR, FC, LFE, BL, BR (last two can also be BL, BR) + * - 6 channels (5.1) layout: FL, FR, FC, LFE, BL, BR (last two can also be + * BL, BR) * - 7 channels (6.1) layout: FL, FR, FC, LFE, BC, SL, SR * - 8 channels (7.1) layout: FL, FR, FC, LFE, BL, BR, SL, SR * @@ -304,8 +304,8 @@ typedef Uint32 SDL_AudioDeviceID; /** * Maximum channels that an SDL_AudioSpec channel map can handle. * - * This is (currently) double the number of channels that SDL supports, - * to allow for future expansion while maintaining binary compatibility. + * This is (currently) double the number of channels that SDL supports, to + * allow for future expansion while maintaining binary compatibility. * * \since This macro is available since SDL 3.0.0. * From 0f8054cf87e6b221659acca70d2471e05f2133e1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 Jul 2024 11:43:43 -0700 Subject: [PATCH 141/431] Only use the default gamepad mapping if an automatic mapping isn't available Fixes https://github.com/libsdl-org/SDL/issues/10162 --- src/joystick/SDL_gamepad.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 833cfae42ec0d..bf1c5b35a6062 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -1676,9 +1676,6 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMappingForNameAndGUID(const char * } #endif /* SDL_PLATFORM_LINUX */ - if (!mapping) { - mapping = s_pDefaultMapping; - } return mapping; } @@ -1793,6 +1790,9 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id } } + if (!mapping) { + mapping = s_pDefaultMapping; + } return mapping; } @@ -2546,7 +2546,7 @@ SDL_bool SDL_IsGamepadNameAndGUID(const char *name, SDL_JoystickGUID guid) SDL_LockJoysticks(); { - if (SDL_PrivateGetGamepadMappingForNameAndGUID(name, guid) != NULL) { + if (s_pDefaultMapping || SDL_PrivateGetGamepadMappingForNameAndGUID(name, guid) != NULL) { retval = SDL_TRUE; } else { retval = SDL_FALSE; From be13328cb16bb64e0fbd8ec1711bbf7f5a3b8d20 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 3 Jul 2024 11:15:30 -0400 Subject: [PATCH 142/431] Remove SDL_SetWindowInputFocus This was added to SDL2 for the Unreal Engine's implementation of menus and dialogs on X11, window types for which SDL3 has added built-in, cross-platform support. Remove this function, as it was only ever implemented for X11 and is now basically useless aside from allowing annoying or malicious client apps to discretely steal focus. As the documentation states: "You almost certainly want SDL_RaiseWindow() instead of this function." --- docs/README-migration.md | 1 + include/SDL3/SDL_video.h | 17 ----------------- src/dynapi/SDL_dynapi.sym | 1 - src/dynapi/SDL_dynapi_overrides.h | 1 - src/dynapi/SDL_dynapi_procs.h | 1 - src/video/SDL_sysvideo.h | 1 - src/video/SDL_video.c | 12 ------------ src/video/x11/SDL_x11video.c | 1 - src/video/x11/SDL_x11window.c | 12 ------------ src/video/x11/SDL_x11window.h | 1 - 10 files changed, 1 insertion(+), 47 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 236af3de9f5c7..82f6cdc4f7091 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1983,6 +1983,7 @@ The following functions have been removed: * SDL_GetWindowData() - use SDL_GetWindowProperties() instead * SDL_SetWindowData() - use SDL_GetWindowProperties() instead * SDL_CreateWindowFrom() - use SDL_CreateWindowWithProperties() with the properties that allow you to wrap an existing window +* SDL_SetWindowInputFocus() - use SDL_RaiseWindow() instead The SDL_Window id type is named SDL_WindowID diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index a64ff6431c40e..cdb911f71e78d 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -2177,23 +2177,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window *window, float * */ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window); -/** - * Explicitly set input focus to the window. - * - * You almost certainly want SDL_RaiseWindow() instead of this function. Use - * this with caution, as you might give focus to a window that is completely - * obscured by other windows. - * - * \param window the window that should get the input focus. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_RaiseWindow - */ -extern SDL_DECLSPEC int SDLCALL SDL_SetWindowInputFocus(SDL_Window *window); - /** * Set whether the window may have input focus. * diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index b54b9fd052694..40d7177a8ae7a 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -762,7 +762,6 @@ SDL3_0.0.0 { SDL_SetWindowFullscreenMode; SDL_SetWindowHitTest; SDL_SetWindowIcon; - SDL_SetWindowInputFocus; SDL_SetWindowKeyboardGrab; SDL_SetWindowMaximumSize; SDL_SetWindowMinimumSize; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index b8c98467b2d63..76f69d781b6ff 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -787,7 +787,6 @@ #define SDL_SetWindowFullscreenMode SDL_SetWindowFullscreenMode_REAL #define SDL_SetWindowHitTest SDL_SetWindowHitTest_REAL #define SDL_SetWindowIcon SDL_SetWindowIcon_REAL -#define SDL_SetWindowInputFocus SDL_SetWindowInputFocus_REAL #define SDL_SetWindowKeyboardGrab SDL_SetWindowKeyboardGrab_REAL #define SDL_SetWindowMaximumSize SDL_SetWindowMaximumSize_REAL #define SDL_SetWindowMinimumSize SDL_SetWindowMinimumSize_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 740da8cf6aba3..50613fd993636 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -797,7 +797,6 @@ SDL_DYNAPI_PROC(int,SDL_SetWindowFullscreen,(SDL_Window *a, SDL_bool b),(a,b),re SDL_DYNAPI_PROC(int,SDL_SetWindowFullscreenMode,(SDL_Window *a, const SDL_DisplayMode *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowHitTest,(SDL_Window *a, SDL_HitTest b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowIcon,(SDL_Window *a, SDL_Surface *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_SetWindowInputFocus,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetWindowKeyboardGrab,(SDL_Window *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetWindowMaximumSize,(SDL_Window *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetWindowMinimumSize,(SDL_Window *a, int b, int c),(a,b,c),return) diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 5437a838aab72..0a5e7b56b7a1b 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -252,7 +252,6 @@ struct SDL_VideoDevice void (*GetWindowSizeInPixels)(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h); int (*SetWindowOpacity)(SDL_VideoDevice *_this, SDL_Window *window, float opacity); int (*SetWindowModalFor)(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window); - int (*SetWindowInputFocus)(SDL_VideoDevice *_this, SDL_Window *window); void (*ShowWindow)(SDL_VideoDevice *_this, SDL_Window *window); void (*HideWindow)(SDL_VideoDevice *_this, SDL_Window *window); void (*RaiseWindow)(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 5b67b6d4f86a4..9363a46ff85b4 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3511,18 +3511,6 @@ int SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window) return ret; } -int SDL_SetWindowInputFocus(SDL_Window *window) -{ - CHECK_WINDOW_MAGIC(window, -1); - CHECK_WINDOW_NOT_POPUP(window, -1); - - if (!_this->SetWindowInputFocus) { - return SDL_Unsupported(); - } - - return _this->SetWindowInputFocus(_this, window); -} - int SDL_SetWindowFocusable(SDL_Window *window, SDL_bool focusable) { CHECK_WINDOW_MAGIC(window, -1); diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 4f59aaeda56bf..2f87933f15aea 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -198,7 +198,6 @@ static SDL_VideoDevice *X11_CreateDevice(void) device->GetWindowBordersSize = X11_GetWindowBordersSize; device->SetWindowOpacity = X11_SetWindowOpacity; device->SetWindowModalFor = X11_SetWindowModalFor; - device->SetWindowInputFocus = X11_SetWindowInputFocus; device->ShowWindow = X11_ShowWindow; device->HideWindow = X11_HideWindow; device->RaiseWindow = X11_RaiseWindow; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 60e5a32817839..85818db8d01b0 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -1267,18 +1267,6 @@ int X11_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_ return 0; } -int X11_SetWindowInputFocus(SDL_VideoDevice *_this, SDL_Window *window) -{ - if (X11_IsWindowMapped(_this, window)) { - SDL_WindowData *data = window->driverdata; - Display *display = data->videodata->display; - X11_XSetInputFocus(display, data->xwindow, RevertToNone, CurrentTime); - X11_XFlush(display); - return 0; - } - return -1; -} - void X11_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { const SDL_bool focused = (window->flags & SDL_WINDOW_INPUT_FOCUS) ? SDL_TRUE : SDL_FALSE; diff --git a/src/video/x11/SDL_x11window.h b/src/video/x11/SDL_x11window.h index 0681bf7dfbda8..5e4866766b5e2 100644 --- a/src/video/x11/SDL_x11window.h +++ b/src/video/x11/SDL_x11window.h @@ -119,7 +119,6 @@ extern void X11_SetWindowAspectRatio(SDL_VideoDevice *_this, SDL_Window *window) extern int X11_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right); extern int X11_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity); extern int X11_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window); -extern int X11_SetWindowInputFocus(SDL_VideoDevice *_this, SDL_Window *window); extern void X11_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window); extern void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window); extern void X11_HideWindow(SDL_VideoDevice *_this, SDL_Window *window); From 74cc06db1b0ee0db89e18afc1c6d6e771bafff61 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 3 Jul 2024 11:39:59 -0400 Subject: [PATCH 143/431] Remove the SDL_EVENT_WINDOW_TAKE_FOCUS event This was added by the Unreal Engine to handle the input focus for popups and dialogs, window types for which SDL3 has built-in, cross-platform support. This was only ever implemented in X11, and the only purpose was to hint that a client application may want to call the SDL_SetWindowInputFocus() function, which has since been removed, rendering it pointless now. --- docs/README-migration.md | 4 +++- include/SDL3/SDL_events.h | 1 - src/events/SDL_events.c | 1 - src/test/SDL_test_common.c | 3 --- src/video/x11/SDL_x11events.c | 9 --------- 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 82f6cdc4f7091..61411ded21e6e 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -2008,10 +2008,12 @@ The following symbols have been renamed: * SDL_WINDOWEVENT_RESTORED => SDL_EVENT_WINDOW_RESTORED * SDL_WINDOWEVENT_SHOWN => SDL_EVENT_WINDOW_SHOWN * SDL_WINDOWEVENT_SIZE_CHANGED => SDL_EVENT_WINDOW_SIZE_CHANGED -* SDL_WINDOWEVENT_TAKE_FOCUS => SDL_EVENT_WINDOW_TAKE_FOCUS * SDL_WINDOW_ALLOW_HIGHDPI => SDL_WINDOW_HIGH_PIXEL_DENSITY * SDL_WINDOW_INPUT_GRABBED => SDL_WINDOW_MOUSE_GRABBED +The following symbols have been removed: +* SDL_WINDOWEVENT_TAKE_FOCUS + The following window operations are now considered to be asynchronous requests and should not be assumed to succeed unless a corresponding event has been received: * SDL_SetWindowSize() (SDL_EVENT_WINDOW_RESIZED) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index dafc544f500cb..678ce88d19cb1 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -136,7 +136,6 @@ typedef enum SDL_EventType SDL_EVENT_WINDOW_FOCUS_GAINED, /**< Window has gained keyboard focus */ SDL_EVENT_WINDOW_FOCUS_LOST, /**< Window has lost keyboard focus */ SDL_EVENT_WINDOW_CLOSE_REQUESTED, /**< The window manager requests that the window be closed */ - SDL_EVENT_WINDOW_TAKE_FOCUS, /**< Window is being offered a focus (should SetWindowInputFocus() on itself or a subwindow, or ignore) */ SDL_EVENT_WINDOW_HIT_TEST, /**< Window had a hit test that wasn't SDL_HITTEST_NORMAL */ SDL_EVENT_WINDOW_ICCPROF_CHANGED, /**< The ICC profile of the window's display has changed */ SDL_EVENT_WINDOW_DISPLAY_CHANGED, /**< Window has been moved to display data1 */ diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 6df6b9cd3badd..20a5aa97da08e 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -317,7 +317,6 @@ static void SDL_LogEvent(const SDL_Event *event) SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_FOCUS_GAINED); SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_FOCUS_LOST); SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_CLOSE_REQUESTED); - SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_TAKE_FOCUS); SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_HIT_TEST); SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_ICCPROF_CHANGED); SDL_WINDOWEVENT_CASE(SDL_EVENT_WINDOW_DISPLAY_CHANGED); diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 0a6f3b30ed13a..584c06c3777f6 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1635,9 +1635,6 @@ static void SDLTest_PrintEvent(const SDL_Event *event) case SDL_EVENT_WINDOW_CLOSE_REQUESTED: SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " closed", event->window.windowID); break; - case SDL_EVENT_WINDOW_TAKE_FOCUS: - SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " take focus", event->window.windowID); - break; case SDL_EVENT_WINDOW_HIT_TEST: SDL_Log("SDL EVENT: Window %" SDL_PRIu32 " hit test", event->window.windowID); break; diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index daf6d9379881b..3831c4fcbf035 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -1425,15 +1425,6 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) #endif SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_CLOSE_REQUESTED, 0, 0); break; - } else if ((xevent->xclient.message_type == videodata->WM_PROTOCOLS) && - (xevent->xclient.format == 32) && - (xevent->xclient.data.l[0] == videodata->WM_TAKE_FOCUS)) { - -#ifdef DEBUG_XEVENTS - printf("window %p: WM_TAKE_FOCUS\n", data); -#endif - SDL_SendWindowEvent(data->window, SDL_EVENT_WINDOW_TAKE_FOCUS, 0, 0); - break; } } break; From 2a8f1e11caf31790e1fc0efb1edc541366266085 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 1 Jul 2024 15:08:20 -0400 Subject: [PATCH 144/431] audio: Add gain support to audio streams and logical audio devices. Fixes #10028. --- include/SDL3/SDL_audio.h | 105 ++++++++++++++++++++++++++++++ src/audio/SDL_audio.c | 60 ++++++++++++++--- src/audio/SDL_audiocvt.c | 78 +++++++++++++++++++--- src/audio/SDL_audioqueue.c | 10 +-- src/audio/SDL_audioqueue.h | 2 +- src/audio/SDL_sysaudio.h | 10 ++- src/dynapi/SDL_dynapi.sym | 4 ++ src/dynapi/SDL_dynapi_overrides.h | 4 ++ src/dynapi/SDL_dynapi_procs.h | 4 ++ test/testaudio.c | 35 +++++++++- 10 files changed, 286 insertions(+), 26 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index c3bf5e94f7796..8ee76d166aa93 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -718,6 +718,62 @@ extern SDL_DECLSPEC int SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID dev); */ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev); +/** + * Get the gain of an audio device. + * + * The gain of a device is its volume; a larger gain means a louder output, + * with a gain of zero being silence. + * + * Audio devices default to a gain of 1.0f (no change in output). + * + * Physical devices may not have their gain changed, only logical devices, + * and this function will always return -1.0f when used on physical devices. + * + * \param devid the audio device to query. + * \returns the gain of the device, or -1.0f on error. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioDeviceGain + */ +extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid); + +/** + * Change the gain of an audio device. + * + * The gain of a device is its volume; a larger gain means a louder output, + * with a gain of zero being silence. + * + * Audio devices default to a gain of 1.0f (no change in output). + * + * Physical devices may not have their gain changed, only logical devices, + * and this function will always return -1 when used on physical devices. While + * it might seem attractive to adjust several logical devices at once in this + * way, it would allow an app or library to interfere with another portion of + * the program's otherwise-isolated devices. + * + * This is applied, along with any per-audiostream gain, during playback to + * the hardware, and can be continuously changed to create various effects. + * On recording devices, this will adjust the gain before passing the data + * into an audiostream; that recording audiostream can then adjust its gain + * further when outputting the data elsewhere, if it likes, but that second + * gain is not applied until the data leaves the audiostream again. + * + * \param devid the audio device on which to change gain. + * \param gain the gain. 1.0f is no change, 0.0f is silence. + * \returns 0 on success, or -1 on error. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetAudioDeviceGain + */ +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain); + /** * Close a previously-opened audio device. * @@ -981,6 +1037,51 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre */ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float ratio); +/** + * Get the gain of an audio stream. + * + * The gain of a stream is its volume; a larger gain means a louder output, + * with a gain of zero being silence. + * + * Audio streams default to a gain of 1.0f (no change in output). + * + * \param stream the SDL_AudioStream to query. + * \returns the gain of the stream, or -1.0f on error. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioStreamGain + */ +extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream); + +/** + * Change the gain of an audio stream. + * + * The gain of a stream is its volume; a larger gain means a louder output, + * with a gain of zero being silence. + * + * Audio streams default to a gain of 1.0f (no change in output). + * + * This is applied during SDL_GetAudioStreamData, and can be continuously + * changed to create various effects. + * + * \param stream the stream on which the gain is being changed. + * \param gain the gain. 1.0f is no change, 0.0f is silence. + * \returns 0 on success, or -1 on error. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetAudioStreamGain + */ +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain); + + /** * Add data to the stream. * @@ -1465,6 +1566,10 @@ extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_Audio * changed. However, this only covers frequency and channel count; data is * always provided here in SDL_AUDIO_F32 format. * + * The postmix callback runs _after_ logical device gain and audiostream gain + * have been applied, which is to say you can make the output data louder + * at this point than the gain settings would suggest. + * * \param userdata a pointer provided by the app through * SDL_SetAudioPostmixCallback, for its own use. * \param spec the current format of audio that is to be submitted to the diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 0c1edacdae3ac..4a3c7281f6aca 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1103,7 +1103,7 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) // We should have updated this elsewhere if the format changed! SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &device->spec)); - const int br = SDL_AtomicGet(&logdev->paused) ? 0 : SDL_GetAudioStreamData(stream, device_buffer, buffer_size); + const int br = SDL_AtomicGet(&logdev->paused) ? 0 : SDL_GetAudioStreamDataAdjustGain(stream, device_buffer, buffer_size, logdev->gain); if (br < 0) { // Probably OOM. Kill the audio device; the whole thing is likely dying soon anyhow. failed = SDL_TRUE; SDL_memset(device_buffer, device->silence_value, buffer_size); // just supply silence to the device before we die. @@ -1143,7 +1143,7 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) for iterating here because the binding linked list can only change while the device lock is held. (we _do_ lock the stream during binding/unbinding to make sure that two threads can't try to bind the same stream to different devices at the same time, though.) */ - const int br = SDL_GetAudioStreamData(stream, device->work_buffer, work_buffer_size); + const int br = SDL_GetAudioStreamDataAdjustGain(stream, device->work_buffer, work_buffer_size, logdev->gain); if (br < 0) { // Probably OOM. Kill the audio device; the whole thing is likely dying soon anyhow. failed = SDL_TRUE; break; @@ -1161,8 +1161,8 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) if (((Uint8 *) final_mix_buffer) != device_buffer) { // !!! FIXME: we can't promise the device buf is aligned/padded for SIMD. - //ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, NULL, device_buffer, device->spec.format, device->spec.channels, NULL, NULL); - ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, NULL, device->work_buffer, device->spec.format, device->spec.channels, NULL, NULL); + //ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, NULL, device_buffer, device->spec.format, device->spec.channels, NULL, NULL, 1.0f); + ConvertAudio(needed_samples / device->spec.channels, final_mix_buffer, SDL_AUDIO_F32, device->spec.channels, NULL, device->work_buffer, device->spec.format, device->spec.channels, NULL, NULL, 1.0f); SDL_memcpy(device_buffer, device->work_buffer, buffer_size); } } @@ -1250,7 +1250,7 @@ SDL_bool SDL_RecordingAudioThreadIterate(SDL_AudioDevice *device) void *output_buffer = device->work_buffer; // I don't know why someone would want a postmix on a recording device, but we offer it for API consistency. - if (logdev->postmix) { + if (logdev->postmix || (logdev->gain != 1.0f)) { // move to float format. SDL_AudioSpec outspec; SDL_copyp(&outspec, &device->spec); @@ -1258,13 +1258,15 @@ SDL_bool SDL_RecordingAudioThreadIterate(SDL_AudioDevice *device) output_buffer = device->postmix_buffer; const int frames = br / SDL_AUDIO_FRAMESIZE(device->spec); br = frames * SDL_AUDIO_FRAMESIZE(outspec); - ConvertAudio(frames, device->work_buffer, device->spec.format, outspec.channels, NULL, device->postmix_buffer, SDL_AUDIO_F32, outspec.channels, NULL, NULL); - logdev->postmix(logdev->postmix_userdata, &outspec, device->postmix_buffer, br); + ConvertAudio(frames, device->work_buffer, device->spec.format, outspec.channels, NULL, device->postmix_buffer, SDL_AUDIO_F32, outspec.channels, NULL, NULL, logdev->gain); + if (logdev->postmix) { + logdev->postmix(logdev->postmix_userdata, &outspec, device->postmix_buffer, br); + } } for (SDL_AudioStream *stream = logdev->bound_streams; stream; stream = stream->next_binding) { // We should have updated this elsewhere if the format changed! - SDL_assert(stream->src_spec.format == (logdev->postmix ? SDL_AUDIO_F32 : device->spec.format)); + SDL_assert(stream->src_spec.format == ((logdev->postmix || (logdev->gain != 1.0f)) ? SDL_AUDIO_F32 : device->spec.format)); SDL_assert(stream->src_spec.channels == device->spec.channels); SDL_assert(stream->src_spec.freq == device->spec.freq); @@ -1695,6 +1697,7 @@ SDL_AudioDeviceID SDL_OpenAudioDevice(SDL_AudioDeviceID devid, const SDL_AudioSp SDL_AtomicSet(&logdev->paused, 0); retval = logdev->instance_id = AssignAudioDeviceInstanceId(device->recording, /*islogical=*/SDL_TRUE); logdev->physical_device = device; + logdev->gain = 1.0f; logdev->opened_as_default = wants_default; logdev->next = device->logical_devices; if (device->logical_devices) { @@ -1752,6 +1755,44 @@ SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid) return retval; } +float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid) +{ + SDL_AudioDevice *device = NULL; + SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device); + const float retval = logdev ? logdev->gain : -1.0f; + ReleaseAudioDevice(device); + return retval; +} + +int SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain) +{ + if (gain < 0.0f) { + return SDL_InvalidParamError("gain"); + } + + SDL_AudioDevice *device = NULL; + SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device); + int retval = -1; + if (logdev) { + logdev->gain = gain; + if (device->recording) { + const SDL_bool need_float32 = (logdev->postmix || logdev->gain != 1.0f); + for (SDL_AudioStream *stream = logdev->bound_streams; stream; stream = stream->next_binding) { + // set the proper end of the stream to the device's format. + // SDL_SetAudioStreamFormat does a ton of validation just to memcpy an audiospec. + SDL_LockMutex(stream->lock); + stream->src_spec.format = need_float32 ? SDL_AUDIO_F32 : device->spec.format; + SDL_UnlockMutex(stream->lock); + } + } + + UpdateAudioStreamFormatsPhysical(device); + retval = 0; + } + ReleaseAudioDevice(device); + return retval; +} + int SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata) { SDL_AudioDevice *device = NULL; @@ -1770,11 +1811,12 @@ int SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallbac logdev->postmix_userdata = userdata; if (device->recording) { + const SDL_bool need_float32 = (callback || logdev->gain != 1.0f); for (SDL_AudioStream *stream = logdev->bound_streams; stream; stream = stream->next_binding) { // set the proper end of the stream to the device's format. // SDL_SetAudioStreamFormat does a ton of validation just to memcpy an audiospec. SDL_LockMutex(stream->lock); - stream->src_spec.format = callback ? SDL_AUDIO_F32 : device->spec.format; + stream->src_spec.format = need_float32 ? SDL_AUDIO_F32 : device->spec.format; SDL_UnlockMutex(stream->lock); } } diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index e05c88ee650b1..29cd63dc6d4db 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -194,10 +194,14 @@ static void SwizzleAudio(const int num_frames, void *dst, const void *src, int c // // The scratch buffer must be able to store `num_frames * CalculateMaxSampleFrameSize(src_format, src_channels, dst_format, dst_channels)` bytes. // If the scratch buffer is NULL, this restriction applies to the output buffer instead. +// +// Since this is a convenient point that audio goes through even if it doesn't need format conversion, +// we also handle gain adjustment here, so we don't have to make another pass over the data later. +// Strictly speaking, this is also a "conversion". :) void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, int src_channels, const Uint8 *src_map, void *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, - void* scratch) + void* scratch, float gain) { SDL_assert(src != NULL); SDL_assert(dst != NULL); @@ -243,7 +247,7 @@ void ConvertAudio(int num_frames, } // see if we can skip float conversion entirely. - if (src_channels == dst_channels) { + if ((src_channels == dst_channels) && (gain == 1.0f)) { if (src_format == dst_format) { // nothing to do, we're already in the right format, just copy it over if necessary. if (dst_map) { @@ -280,6 +284,23 @@ void ConvertAudio(int num_frames, src = buf; } + // Gain adjustment + if (gain != 1.0f) { + float *buf = (float *)(dstconvert ? scratch : dst); + const int total_samples = num_frames * src_channels; + if (src == buf) { + for (int i = 0; i < total_samples; i++) { + buf[i] *= gain; + } + } else { + float *fsrc = (float *)src; + for (int i = 0; i < total_samples; i++) { + buf[i] = fsrc[i] * gain; + } + } + src = buf; + } + // Channel conversion if (channelconvert) { @@ -379,6 +400,7 @@ SDL_AudioStream *SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_ } retval->freq_ratio = 1.0f; + retval->gain = 1.0f; retval->queue = SDL_CreateAudioQueue(8192); if (!retval->queue) { @@ -593,6 +615,35 @@ int SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio) return 0; } +float SDL_GetAudioStreamGain(SDL_AudioStream *stream) +{ + if (!stream) { + SDL_InvalidParamError("stream"); + return -1.0f; + } + + SDL_LockMutex(stream->lock); + const float gain = stream->gain; + SDL_UnlockMutex(stream->lock); + + return gain; +} + +int SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain) +{ + if (!stream) { + return SDL_InvalidParamError("stream"); + } else if (gain < 0.0f) { + return SDL_InvalidParamError("gain"); + } + + SDL_LockMutex(stream->lock); + stream->gain = gain; + SDL_UnlockMutex(stream->lock); + + return 0; +} + static int CheckAudioStreamIsFullySetup(SDL_AudioStream *stream) { if (stream->src_spec.format == 0) { @@ -820,7 +871,7 @@ static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spe // You must hold stream->lock and validate your parameters before calling this! // Enough input data MUST be available! -static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int output_frames) +static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int output_frames, float gain) { const SDL_AudioSpec* src_spec = &stream->input_spec; const SDL_AudioSpec* dst_spec = &stream->dst_spec; @@ -854,7 +905,7 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou } } - if (SDL_ReadFromAudioQueue(stream->queue, buf, dst_format, dst_channels, dst_map, 0, output_frames, 0, work_buffer) != buf) { + if (SDL_ReadFromAudioQueue(stream->queue, buf, dst_format, dst_channels, dst_map, 0, output_frames, 0, work_buffer, gain) != buf) { return SDL_SetError("Not enough data in queue"); } @@ -919,10 +970,15 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou return -1; } + // adjust gain either before resampling or after, depending on which point has less + // samples to process. + const float preresample_gain = (input_frames > output_frames) ? 1.0f : gain; + const float postresample_gain = (input_frames > output_frames) ? gain : 1.0f; + // (dst channel map is NULL because we'll do the final swizzle on ConvertAudio after resample.) const Uint8* input_buffer = SDL_ReadFromAudioQueue(stream->queue, NULL, resample_format, resample_channels, NULL, - padding_frames, input_frames, padding_frames, work_buffer); + padding_frames, input_frames, padding_frames, work_buffer, preresample_gain); if (!input_buffer) { return SDL_SetError("Not enough data in queue (resample)"); @@ -939,13 +995,13 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou resample_rate, &stream->resample_offset); // Convert to the final format, if necessary (src channel map is NULL because SDL_ReadFromAudioQueue already handled this). - ConvertAudio(output_frames, resample_buffer, resample_format, resample_channels, NULL, buf, dst_format, dst_channels, dst_map, work_buffer); + ConvertAudio(output_frames, resample_buffer, resample_format, resample_channels, NULL, buf, dst_format, dst_channels, dst_map, work_buffer, postresample_gain); return 0; } // get converted/resampled data from the stream -int SDL_GetAudioStreamData(SDL_AudioStream *stream, void *voidbuf, int len) +int SDL_GetAudioStreamDataAdjustGain(SDL_AudioStream *stream, void *voidbuf, int len, float extra_gain) { Uint8 *buf = (Uint8 *) voidbuf; @@ -970,6 +1026,7 @@ int SDL_GetAudioStreamData(SDL_AudioStream *stream, void *voidbuf, int len) return -1; } + const float gain = stream->gain * extra_gain; const int dst_frame_size = SDL_AUDIO_FRAMESIZE(stream->dst_spec); len -= len % dst_frame_size; // chop off any fractional sample frame. @@ -1029,7 +1086,7 @@ int SDL_GetAudioStreamData(SDL_AudioStream *stream, void *voidbuf, int len) output_frames = SDL_min(output_frames, chunk_size); output_frames = (int) SDL_min(output_frames, available_frames); - if (GetAudioStreamDataInternal(stream, &buf[total], output_frames) != 0) { + if (GetAudioStreamDataInternal(stream, &buf[total], output_frames, gain) != 0) { total = total ? total : -1; break; } @@ -1046,6 +1103,11 @@ int SDL_GetAudioStreamData(SDL_AudioStream *stream, void *voidbuf, int len) return total; } +int SDL_GetAudioStreamData(SDL_AudioStream *stream, void *voidbuf, int len) +{ + return SDL_GetAudioStreamDataAdjustGain(stream, voidbuf, len, 1.0f); +} + // number of converted/resampled bytes available for output int SDL_GetAudioStreamAvailable(SDL_AudioStream *stream) { diff --git a/src/audio/SDL_audioqueue.c b/src/audio/SDL_audioqueue.c index 41c8af3b456c7..e9110b5ac05f2 100644 --- a/src/audio/SDL_audioqueue.c +++ b/src/audio/SDL_audioqueue.c @@ -514,7 +514,7 @@ static const Uint8 *PeekIntoAudioQueueFuture(SDL_AudioQueue *queue, Uint8 *data, const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, int past_frames, int present_frames, int future_frames, - Uint8 *scratch) + Uint8 *scratch, float gain) { SDL_AudioTrack *track = queue->head; @@ -552,7 +552,7 @@ const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, // Do we still need to copy/convert the data? if (dst) { ConvertAudio(past_frames + present_frames + future_frames, ptr, - src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); + src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch, gain); ptr = dst; } @@ -570,19 +570,19 @@ const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, Uint8 *ptr = dst; if (src_past_bytes) { - ConvertAudio(past_frames, PeekIntoAudioQueuePast(queue, scratch, src_past_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); + ConvertAudio(past_frames, PeekIntoAudioQueuePast(queue, scratch, src_past_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch, gain); dst += dst_past_bytes; scratch += dst_past_bytes; } if (src_present_bytes) { - ConvertAudio(present_frames, ReadFromAudioQueue(queue, scratch, src_present_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); + ConvertAudio(present_frames, ReadFromAudioQueue(queue, scratch, src_present_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch, gain); dst += dst_present_bytes; scratch += dst_present_bytes; } if (src_future_bytes) { - ConvertAudio(future_frames, PeekIntoAudioQueueFuture(queue, scratch, src_future_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch); + ConvertAudio(future_frames, PeekIntoAudioQueueFuture(queue, scratch, src_future_bytes), src_format, src_channels, src_map, dst, dst_format, dst_channels, dst_map, scratch, gain); dst += dst_future_bytes; scratch += dst_future_bytes; } diff --git a/src/audio/SDL_audioqueue.h b/src/audio/SDL_audioqueue.h index 26675ce295761..46dce2d19b659 100644 --- a/src/audio/SDL_audioqueue.h +++ b/src/audio/SDL_audioqueue.h @@ -69,7 +69,7 @@ size_t SDL_NextAudioQueueIter(SDL_AudioQueue *queue, void **inout_iter, SDL_Audi const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, int past_frames, int present_frames, int future_frames, - Uint8 *scratch); + Uint8 *scratch, float gain); // Get the total number of bytes currently queued size_t SDL_GetAudioQueueQueued(SDL_AudioQueue *queue); diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 9973be9bf115c..b5c2335e2ca07 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -118,17 +118,19 @@ extern SDL_bool SDL_ChannelMapIsBogus(const Uint8 *map, int channels); extern void ConvertAudio(int num_frames, const void *src, SDL_AudioFormat src_format, int src_channels, const Uint8 *src_map, void *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, - void* scratch); + void* scratch, float gain); // Compare two SDL_AudioSpecs, return SDL_TRUE if they match exactly. // Using SDL_memcmp directly isn't safe, since potential padding (and unused parts of the channel map) might not be initialized. extern SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b); - // Special case to let something in SDL_audiocvt.c access something in SDL_audio.c. Don't use this. extern void OnAudioStreamCreated(SDL_AudioStream *stream); extern void OnAudioStreamDestroy(SDL_AudioStream *stream); +// This just lets audio playback apply logical device gain at the same time as audiostream gain, so it's one multiplication instead of thousands. +extern int SDL_GetAudioStreamDataAdjustGain(SDL_AudioStream *stream, void *voidbuf, int len, float extra_gain); + typedef struct SDL_AudioDriverImpl { void (*DetectDevices)(SDL_AudioDevice **default_playback, SDL_AudioDevice **default_recording); @@ -196,6 +198,7 @@ struct SDL_AudioStream SDL_AudioSpec src_spec; SDL_AudioSpec dst_spec; float freq_ratio; + float gain; struct SDL_AudioQueue* queue; @@ -230,6 +233,9 @@ struct SDL_LogicalAudioDevice // If whole logical device is paused (process no streams bound to this device). SDL_AtomicInt paused; + // Volume of the device output. + float gain; + // double-linked list of all audio streams currently bound to this opened device. SDL_AudioStream *bound_streams; diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 40d7177a8ae7a..1f5f8ca5429b7 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -167,6 +167,7 @@ SDL3_0.0.0 { SDL_GetAssertionHandler; SDL_GetAssertionReport; SDL_GetAudioDeviceFormat; + SDL_GetAudioDeviceGain; SDL_GetAudioDeviceName; SDL_GetAudioDriver; SDL_GetAudioPlaybackDevices; @@ -176,6 +177,7 @@ SDL3_0.0.0 { SDL_GetAudioStreamDevice; SDL_GetAudioStreamFormat; SDL_GetAudioStreamFrequencyRatio; + SDL_GetAudioStreamGain; SDL_GetAudioStreamProperties; SDL_GetAudioStreamQueued; SDL_GetBasePath; @@ -682,9 +684,11 @@ SDL3_0.0.0 { SDL_SendJoystickEffect; SDL_SendJoystickVirtualSensorData; SDL_SetAssertionHandler; + SDL_SetAudioDeviceGain; SDL_SetAudioPostmixCallback; SDL_SetAudioStreamFormat; SDL_SetAudioStreamFrequencyRatio; + SDL_SetAudioStreamGain; SDL_SetAudioStreamGetCallback; SDL_SetAudioStreamPutCallback; SDL_SetBooleanProperty; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 76f69d781b6ff..36fec9b6485b1 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -191,6 +191,7 @@ #define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL #define SDL_GetAssertionHandler SDL_GetAssertionHandler_REAL #define SDL_GetAssertionReport SDL_GetAssertionReport_REAL +#define SDL_GetAudioDeviceGain SDL_GetAudioDeviceGain_REAL #define SDL_GetAudioDeviceFormat SDL_GetAudioDeviceFormat_REAL #define SDL_GetAudioDeviceName SDL_GetAudioDeviceName_REAL #define SDL_GetAudioDriver SDL_GetAudioDriver_REAL @@ -201,6 +202,7 @@ #define SDL_GetAudioStreamDevice SDL_GetAudioStreamDevice_REAL #define SDL_GetAudioStreamFormat SDL_GetAudioStreamFormat_REAL #define SDL_GetAudioStreamFrequencyRatio SDL_GetAudioStreamFrequencyRatio_REAL +#define SDL_GetAudioStreamGain SDL_GetAudioStreamGain_REAL #define SDL_GetAudioStreamProperties SDL_GetAudioStreamProperties_REAL #define SDL_GetAudioStreamQueued SDL_GetAudioStreamQueued_REAL #define SDL_GetBasePath SDL_GetBasePath_REAL @@ -707,9 +709,11 @@ #define SDL_SendJoystickEffect SDL_SendJoystickEffect_REAL #define SDL_SendJoystickVirtualSensorData SDL_SendJoystickVirtualSensorData_REAL #define SDL_SetAssertionHandler SDL_SetAssertionHandler_REAL +#define SDL_SetAudioDeviceGain SDL_SetAudioDeviceGain_REAL #define SDL_SetAudioPostmixCallback SDL_SetAudioPostmixCallback_REAL #define SDL_SetAudioStreamFormat SDL_SetAudioStreamFormat_REAL #define SDL_SetAudioStreamFrequencyRatio SDL_SetAudioStreamFrequencyRatio_REAL +#define SDL_SetAudioStreamGain SDL_SetAudioStreamGain_REAL #define SDL_SetAudioStreamGetCallback SDL_SetAudioStreamGetCallback_REAL #define SDL_SetAudioStreamPutCallback SDL_SetAudioStreamPutCallback_REAL #define SDL_SetBooleanProperty SDL_SetBooleanProperty_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 50613fd993636..16c54b365896a 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -212,6 +212,7 @@ SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return) SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return) SDL_DYNAPI_PROC(const SDL_AssertData*,SDL_GetAssertionReport,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetAudioDeviceFormat,(SDL_AudioDeviceID a, SDL_AudioSpec *b, int *c),(a,b,c),return) +SDL_DYNAPI_PROC(float,SDL_GetAudioDeviceGain,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDeviceName,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDriver,(int a),(a),return) SDL_DYNAPI_PROC(SDL_AudioDeviceID*,SDL_GetAudioPlaybackDevices,(int *a),(a),return) @@ -221,6 +222,7 @@ SDL_DYNAPI_PROC(int,SDL_GetAudioStreamData,(SDL_AudioStream *a, void *b, int c), SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_GetAudioStreamDevice,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamFormat,(SDL_AudioStream *a, SDL_AudioSpec *b, SDL_AudioSpec *c),(a,b,c),return) SDL_DYNAPI_PROC(float,SDL_GetAudioStreamFrequencyRatio,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(float,SDL_GetAudioStreamGain,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetAudioStreamProperties,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamQueued,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_GetBasePath,(void),(),return) @@ -718,9 +720,11 @@ SDL_DYNAPI_PROC(int,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c) SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SendJoystickVirtualSensorData,(SDL_Joystick *a, SDL_SensorType b, Uint64 c, const float *d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(void,SDL_SetAssertionHandler,(SDL_AssertionHandler a, void *b),(a,b),) +SDL_DYNAPI_PROC(int,SDL_SetAudioDeviceGain,(SDL_AudioDeviceID a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetAudioPostmixCallback,(SDL_AudioDeviceID a, SDL_AudioPostmixCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamFormat,(SDL_AudioStream *a, const SDL_AudioSpec *b, const SDL_AudioSpec *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamFrequencyRatio,(SDL_AudioStream *a, float b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_SetAudioStreamGain,(SDL_AudioStream *a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamGetCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamPutCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) diff --git a/test/testaudio.c b/test/testaudio.c index 9f8d561e66d3a..728f4b670515c 100644 --- a/test/testaudio.c +++ b/test/testaudio.c @@ -94,6 +94,7 @@ struct Thing float z; Uint8 r, g, b, a; float progress; + float meter; float scale; Uint64 createticks; Texture *texture; @@ -103,6 +104,7 @@ struct Thing void (*ondrag)(Thing *thing, int button, float x, float y); void (*ondrop)(Thing *thing, int button, float x, float y); void (*ondraw)(Thing *thing, SDL_Renderer *renderer); + void (*onmousewheel)(Thing *thing, float y); Thing *prev; Thing *next; @@ -355,6 +357,16 @@ static void DrawOneThing(SDL_Renderer *renderer, Thing *thing) SDL_SetRenderDrawColor(renderer, 255, 255, 255, 128); SDL_RenderFillRect(renderer, &r); } + + if (thing->meter > 0.0f) { + SDL_FRect r; + r.w = 10.0f; + r.h = thing->rect.h * ((thing->meter > 1.0f) ? 1.0f : thing->meter); + r.x = thing->rect.x + thing->rect.w + 2.0f; + r.y = (thing->rect.y + thing->rect.h) - r.h; + SDL_SetRenderDrawColor(renderer, 255, 255, 255, 128); + SDL_RenderFillRect(renderer, &r); + } } static void DrawThings(SDL_Renderer *renderer) @@ -581,6 +593,13 @@ static void StreamThing_ondrop(Thing *thing, int button, float x, float y) } } +static void StreamThing_onmousewheel(Thing *thing, float y) +{ + thing->meter += y * 0.01f; + thing->meter = SDL_clamp(thing->meter, 0.0f, 1.0f); + SDL_SetAudioStreamGain(thing->data.stream.stream, thing->meter); +} + static void StreamThing_ondraw(Thing *thing, SDL_Renderer *renderer) { if (thing->line_connected_to) { /* are we playing? Update progress bar, and bounce the levels a little. */ @@ -618,7 +637,9 @@ static Thing *CreateStreamThing(const SDL_AudioSpec *spec, const Uint8 *buf, con thing->ondrag = StreamThing_ondrag; thing->ondrop = StreamThing_ondrop; thing->ondraw = StreamThing_ondraw; + thing->onmousewheel = StreamThing_onmousewheel; thing->can_be_dropped_onto = can_be_dropped_onto; + thing->meter = 1.0f; /* gain. */ } return thing; } @@ -898,6 +919,13 @@ static void LogicalDeviceThing_ondraw(Thing *thing, SDL_Renderer *renderer) } } +static void LogicalDeviceThing_onmousewheel(Thing *thing, float y) +{ + thing->meter += y * 0.01f; + thing->meter = SDL_clamp(thing->meter, 0.0f, 1.0f); + SDL_SetAudioDeviceGain(thing->data.logdev.devid, thing->meter); +} + static Thing *CreateLogicalDeviceThing(Thing *parent, const SDL_AudioDeviceID which, const float x, const float y) { static const ThingType can_be_dropped_onto[] = { THING_TRASHCAN, THING_NULL }; @@ -917,10 +945,12 @@ static Thing *CreateLogicalDeviceThing(Thing *parent, const SDL_AudioDeviceID wh SDL_SetTextureBlendMode(thing->data.logdev.visualizer, SDL_BLENDMODE_BLEND); } thing->line_connected_to = physthing; + thing->meter = 1.0f; thing->ontick = LogicalDeviceThing_ontick; thing->ondrag = DeviceThing_ondrag; thing->ondrop = LogicalDeviceThing_ondrop; thing->ondraw = LogicalDeviceThing_ondraw; + thing->onmousewheel = LogicalDeviceThing_onmousewheel; thing->can_be_dropped_onto = can_be_dropped_onto; SetLogicalDeviceTitlebar(thing); @@ -1181,7 +1211,10 @@ int SDL_AppEvent(void *appstate, const SDL_Event *event) break; case SDL_EVENT_MOUSE_WHEEL: - UpdateMouseOver(event->wheel.mouse_x, event->wheel.mouse_y); + thing = UpdateMouseOver(event->wheel.mouse_x, event->wheel.mouse_y); + if (thing && thing->onmousewheel) { + thing->onmousewheel(thing, event->wheel.y * ((event->wheel.direction == SDL_MOUSEWHEEL_FLIPPED) ? -1.0f : 1.0f)); + } break; case SDL_EVENT_KEY_DOWN: From d7a875432ba41f358570cc2b98cc505651173256 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 3 Jul 2024 20:07:11 +0000 Subject: [PATCH 145/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_audio.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 8ee76d166aa93..d8879e2aa9003 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -726,8 +726,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev * * Audio devices default to a gain of 1.0f (no change in output). * - * Physical devices may not have their gain changed, only logical devices, - * and this function will always return -1.0f when used on physical devices. + * Physical devices may not have their gain changed, only logical devices, and + * this function will always return -1.0f when used on physical devices. * * \param devid the audio device to query. * \returns the gain of the device, or -1.0f on error. @@ -748,18 +748,18 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * Audio devices default to a gain of 1.0f (no change in output). * - * Physical devices may not have their gain changed, only logical devices, - * and this function will always return -1 when used on physical devices. While - * it might seem attractive to adjust several logical devices at once in this + * Physical devices may not have their gain changed, only logical devices, and + * this function will always return -1 when used on physical devices. While it + * might seem attractive to adjust several logical devices at once in this * way, it would allow an app or library to interfere with another portion of * the program's otherwise-isolated devices. * * This is applied, along with any per-audiostream gain, during playback to - * the hardware, and can be continuously changed to create various effects. - * On recording devices, this will adjust the gain before passing the data - * into an audiostream; that recording audiostream can then adjust its gain - * further when outputting the data elsewhere, if it likes, but that second - * gain is not applied until the data leaves the audiostream again. + * the hardware, and can be continuously changed to create various effects. On + * recording devices, this will adjust the gain before passing the data into + * an audiostream; that recording audiostream can then adjust its gain further + * when outputting the data elsewhere, if it likes, but that second gain is + * not applied until the data leaves the audiostream again. * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. @@ -1567,8 +1567,8 @@ extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_Audio * always provided here in SDL_AUDIO_F32 format. * * The postmix callback runs _after_ logical device gain and audiostream gain - * have been applied, which is to say you can make the output data louder - * at this point than the gain settings would suggest. + * have been applied, which is to say you can make the output data louder at + * this point than the gain settings would suggest. * * \param userdata a pointer provided by the app through * SDL_SetAudioPostmixCallback, for its own use. From a04596c9a7b3c29e08d258c077bf466ccad1a66a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 Jul 2024 13:54:00 -0700 Subject: [PATCH 146/431] Added support for the ROG RAIKIRI --- .../app/src/main/java/org/libsdl/app/HIDDeviceManager.java | 1 + src/hidapi/libusb/hid.c | 1 + src/joystick/SDL_joystick.c | 5 +++++ src/joystick/hidapi/SDL_hidapijoystick.c | 1 + src/joystick/usb_ids.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java index df333307efb02..fe791432ffdad 100644 --- a/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java +++ b/android-project/app/src/main/java/org/libsdl/app/HIDDeviceManager.java @@ -281,6 +281,7 @@ private boolean isXboxOneController(UsbDevice usbDevice, UsbInterface usbInterfa 0x044f, // Thrustmaster 0x045e, // Microsoft 0x0738, // Mad Catz + 0x0b05, // ASUS 0x0e6f, // PDP 0x0f0d, // Hori 0x10f5, // Turtle Beach diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index f0ec00ca7ff8c..19551e59bc41f 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -872,6 +872,7 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de 0x044f, /* Thrustmaster */ 0x045e, /* Microsoft */ 0x0738, /* Mad Catz */ + 0x0b05, /* ASUS */ 0x0e6f, /* PDP */ 0x0f0d, /* Hori */ 0x10f5, /* Turtle Beach */ diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 7da7be28b5e61..15ee1e44f682e 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -2991,6 +2991,11 @@ SDL_bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id) return SDL_TRUE; } } + if (vendor_id == USB_VENDOR_ASUS) { + if (product_id == USB_PRODUCT_ROG_RAIKIRI) { + return SDL_TRUE; + } + } return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 1fca1f4614253..1e240f974eb04 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -275,6 +275,7 @@ static SDL_GamepadType SDL_GetJoystickGameControllerProtocol(const char *name, U 0x044f, /* Thrustmaster */ 0x045e, /* Microsoft */ 0x0738, /* Mad Catz */ + 0x0b05, /* ASUS */ 0x0e6f, /* PDP */ 0x0f0d, /* Hori */ 0x10f5, /* Turtle Beach */ diff --git a/src/joystick/usb_ids.h b/src/joystick/usb_ids.h index f913bc934f5cb..2d4d8914049f5 100644 --- a/src/joystick/usb_ids.h +++ b/src/joystick/usb_ids.h @@ -28,6 +28,7 @@ #define USB_VENDOR_AMAZON 0x1949 #define USB_VENDOR_APPLE 0x05ac #define USB_VENDOR_ASTRO 0x9886 +#define USB_VENDOR_ASUS 0x0b05 #define USB_VENDOR_BACKBONE 0x358a #define USB_VENDOR_GAMESIR 0x3537 #define USB_VENDOR_DRAGONRISE 0x0079 @@ -107,6 +108,7 @@ #define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_PS5_WIRELESS 0x100c #define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_XBOX_WIRED 0x1010 #define USB_PRODUCT_RAZER_WOLVERINE_V2_PRO_XBOX_WIRELESS 0x1011 +#define USB_PRODUCT_ROG_RAIKIRI 0x1a38 #define USB_PRODUCT_SAITEK_CYBORG_V3 0xf622 #define USB_PRODUCT_SHANWAN_DS3 0x0523 #define USB_PRODUCT_SONY_DS3 0x0268 From 9d47daef0a674b06f97be383f67b6e7bf406f41b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 3 Jul 2024 18:46:51 -0700 Subject: [PATCH 147/431] Do a final pass freeing temporary memory when we quit. Fixes https://github.com/libsdl-org/SDL/issues/10169 --- src/SDL.c | 2 ++ src/events/SDL_events.c | 2 +- src/events/SDL_events_c.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SDL.c b/src/SDL.c index 7814ad2062467..2957787244963 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -559,6 +559,8 @@ void SDL_Quit(void) */ SDL_memset(SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount)); + SDL_FlushEventMemory(0); + SDL_CleanupTLS(); SDL_FreeEnvironmentMemory(); diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 20a5aa97da08e..069c8248e2c20 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -143,7 +143,7 @@ const char *SDL_AllocateEventString(const char *string) return NULL; } -static void SDL_FlushEventMemory(Uint32 eventID) +void SDL_FlushEventMemory(Uint32 eventID) { SDL_LockMutex(SDL_event_memory_lock); { diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index 778af32cadbf0..cc544733c60ed 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -38,6 +38,7 @@ /* Start and stop the event processing loop */ extern int SDL_StartEventLoop(void); extern void SDL_StopEventLoop(void); +extern void SDL_FlushEventMemory(Uint32 eventID); extern void SDL_QuitInterrupt(void); extern const char *SDL_AllocateEventString(const char *string); From f338fa20dd8114d0a656305a8566a74c7f63d3db Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 3 Jul 2024 20:05:43 -0400 Subject: [PATCH 148/431] emscripten: Let SDL hints be set by URL parameters. Any parameters (key/value pairs after the '?' in a URL) that have a keyname that starts with `SDL_` will be put into Emscripten's environment variable emulation table at startup, before SDL_main runs. This lets users set hints the same way they might set them from a shell's command line on a desktop platform: For example: `https://example.com/my_sdl3_application.html?SDL_RENDER_DRIVER=software` Fixes #10154. --- CMakeLists.txt | 2 + include/SDL3/SDL_main.h | 10 +++++ src/core/emscripten/SDL_emscripten.c | 56 ++++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 src/core/emscripten/SDL_emscripten.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 0472fd8dc7d4b..a7f342579d07d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1480,6 +1480,8 @@ elseif(EMSCRIPTEN) # project. Uncomment at will for verbose cross-compiling -I/../ path info. sdl_compile_options(PRIVATE "-Wno-warn-absolute-paths") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/emscripten/*.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/emscripten/*.c") set(HAVE_SDL_MAIN_CALLBACKS TRUE) diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h index e293cc5054715..cd6a0b332f35a 100644 --- a/include/SDL3/SDL_main.h +++ b/include/SDL3/SDL_main.h @@ -94,6 +94,16 @@ /* We need to export SDL_main so it can be launched from Java */ #define SDLMAIN_DECLSPEC SDL_DECLSPEC + #elif defined(SDL_PLATFORM_EMSCRIPTEN) + /* On Emscripten, SDL provides a main function that converts URL + parameters that start with "SDL_" to environment variables, so + they can be used as SDL hints, etc. + + This is 100% optional, so if you don't want this to happen, you may + define SDL_MAIN_HANDLED + */ + #define SDL_MAIN_AVAILABLE + #elif defined(SDL_PLATFORM_PSP) /* On PSP SDL provides a main function that sets the module info, activates the GPU and starts the thread required to be able to exit diff --git a/src/core/emscripten/SDL_emscripten.c b/src/core/emscripten/SDL_emscripten.c new file mode 100644 index 0000000000000..6eda160962579 --- /dev/null +++ b/src/core/emscripten/SDL_emscripten.c @@ -0,0 +1,56 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +#ifdef SDL_PLATFORM_EMSCRIPTEN + +#include + +EM_JS_DEPS(sdlrunapp, "$dynCall,$stringToNewUTF8"); + +int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved) +{ + (void)reserved; + + // Move any URL params that start with "SDL_" over to environment + // variables, so the hint system can pick them up, etc, much like a user + // can set them from a shell prompt on a desktop machine. Ignore all + // other params, in case the app wants to use them for something. + MAIN_THREAD_EM_ASM({ + var parms = new URLSearchParams(window.location.search); + for (const [key, value] of parms) { + if (key.startsWith("SDL_")) { + var ckey = stringToNewUTF8(key); + var cvalue = stringToNewUTF8(value); + if ((ckey != 0) && (cvalue != 0)) { + //console.log("Setting SDL env var '" + key + "' to '" + value + "' ..."); + dynCall('iiii', $0, [ckey, cvalue, 1]); + } + _free(ckey); // these must use free(), not SDL_free()! + _free(cvalue); + } + } + }, SDL_setenv); + + return mainFunction(argc, argv); +} + +#endif From c3bf874abf713718586fbf66bba544958ce2785a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 4 Jul 2024 01:09:46 -0400 Subject: [PATCH 149/431] stdlib: Clean up and export SDL_UCS4ToUTF8(). Also fix internal usage of the function. Fixes #10157. --- include/SDL3/SDL_stdinc.h | 29 +++++++++++++++++ src/SDL_utils.c | 25 -------------- src/SDL_utils_c.h | 2 -- src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/stdlib/SDL_string.c | 36 +++++++++++++++++++++ src/video/emscripten/SDL_emscriptenevents.c | 6 ++-- src/video/windows/SDL_windowsevents.c | 6 ++-- 9 files changed, 74 insertions(+), 33 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index c3628cc6b74ca..482ae8cf59cd8 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1309,6 +1309,35 @@ extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *st */ extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepUTF8(const char **pstr, size_t *pslen); +/** + * Convert a single Unicode codepoint to UTF-8. + * + * The buffer pointed to by `dst` must be at least 4 bytes long, as this + * function may generate between 1 and 4 bytes of output. + * + * This function returns the first byte _after_ the newly-written UTF-8 + * sequence, which is useful for encoding multiple codepoints in a loop, or + * knowing where to write a NULL-terminator character to end the string (in + * either case, plan to have a buffer of _more_ than 4 bytes!). + * + * If `codepoint` is an invalid value (outside the Unicode range, or a UTF-16 + * surrogate value, etc), this will use U+FFFD (REPLACEMENT CHARACTER) for + * the codepoint instead, and not set an error. + * + * If `dst` is NULL, this returns NULL immediately without writing to the + * pointer and without setting an error. + * + * \param codepoint a Unicode codepoint to convert to UTF-8. + * \param dst the location to write the encoded UTF-8. Must point to at least 4 bytes! + * \returns the first byte past the newly-written UTF-8 sequence. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC char * SDLCALL SDL_UCS4ToUTF8(Uint32 codepoint, char *dst); + + extern SDL_DECLSPEC int SDLCALL SDL_sscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, ...) SDL_SCANF_VARARG_FUNC(2); extern SDL_DECLSPEC int SDLCALL SDL_vsscanf(const char *text, SDL_SCANF_FORMAT_STRING const char *fmt, va_list ap) SDL_SCANF_VARARG_FUNCV(2); extern SDL_DECLSPEC int SDLCALL SDL_snprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, SDL_PRINTF_FORMAT_STRING const char *fmt, ... ) SDL_PRINTF_VARARG_FUNC(3); diff --git a/src/SDL_utils.c b/src/SDL_utils.c index 0aaa3dc391bc3..222cf49a3ed13 100644 --- a/src/SDL_utils.c +++ b/src/SDL_utils.c @@ -101,31 +101,6 @@ SDL_bool SDL_endswith(const char *string, const char *suffix) return SDL_FALSE; } -char *SDL_UCS4ToUTF8(Uint32 ch, char *dst) -{ - Uint8 *p = (Uint8 *)dst; - if (ch <= 0x7F) { - *p = (Uint8)ch; - ++dst; - } else if (ch <= 0x7FF) { - p[0] = 0xC0 | (Uint8)((ch >> 6) & 0x1F); - p[1] = 0x80 | (Uint8)(ch & 0x3F); - dst += 2; - } else if (ch <= 0xFFFF) { - p[0] = 0xE0 | (Uint8)((ch >> 12) & 0x0F); - p[1] = 0x80 | (Uint8)((ch >> 6) & 0x3F); - p[2] = 0x80 | (Uint8)(ch & 0x3F); - dst += 3; - } else { - 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; - } - return dst; -} - /* Assume we can wrap SDL_AtomicInt values and cast to Uint32 */ SDL_COMPILE_TIME_ASSERT(sizeof_object_id, sizeof(int) == sizeof(Uint32)); diff --git a/src/SDL_utils_c.h b/src/SDL_utils_c.h index fb83c30be9ef8..35d8543e8a04f 100644 --- a/src/SDL_utils_c.h +++ b/src/SDL_utils_c.h @@ -32,8 +32,6 @@ extern void SDL_CalculateFraction(float x, int *numerator, int *denominator); extern SDL_bool SDL_endswith(const char *string, const char *suffix); -extern char *SDL_UCS4ToUTF8(Uint32 ch, char *dst); - typedef enum { SDL_OBJECT_TYPE_UNKNOWN, diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 1f5f8ca5429b7..284d1bda56b16 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -811,6 +811,7 @@ SDL3_0.0.0 { SDL_TryLockRWLockForWriting; SDL_TryLockSpinlock; SDL_TryWaitSemaphore; + SDL_UCS4ToUTF8; SDL_UnbindAudioStream; SDL_UnbindAudioStreams; SDL_UnloadObject; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 36fec9b6485b1..701d5fe3291cc 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -836,6 +836,7 @@ #define SDL_TryLockRWLockForWriting SDL_TryLockRWLockForWriting_REAL #define SDL_TryLockSpinlock SDL_TryLockSpinlock_REAL #define SDL_TryWaitSemaphore SDL_TryWaitSemaphore_REAL +#define SDL_UCS4ToUTF8 SDL_UCS4ToUTF8_REAL #define SDL_UnbindAudioStream SDL_UnbindAudioStream_REAL #define SDL_UnbindAudioStreams SDL_UnbindAudioStreams_REAL #define SDL_UnloadObject SDL_UnloadObject_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 16c54b365896a..75fd300e19183 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -846,6 +846,7 @@ SDL_DYNAPI_PROC(int,SDL_TryLockRWLockForReading,(SDL_RWLock *a),(a),return) SDL_DYNAPI_PROC(int,SDL_TryLockRWLockForWriting,(SDL_RWLock *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_TryLockSpinlock,(SDL_SpinLock *a),(a),return) SDL_DYNAPI_PROC(int,SDL_TryWaitSemaphore,(SDL_Semaphore *a),(a),return) +SDL_DYNAPI_PROC(char*,SDL_UCS4ToUTF8,(Uint32 a, char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_UnbindAudioStream,(SDL_AudioStream *a),(a),) SDL_DYNAPI_PROC(void,SDL_UnbindAudioStreams,(SDL_AudioStream **a, int b),(a,b),) SDL_DYNAPI_PROC(void,SDL_UnloadObject,(void *a),(a),) diff --git a/src/stdlib/SDL_string.c b/src/stdlib/SDL_string.c index 554a746ff45d6..cd6cd1868c04c 100644 --- a/src/stdlib/SDL_string.c +++ b/src/stdlib/SDL_string.c @@ -42,6 +42,42 @@ SDL_COMPILE_TIME_ASSERT(sizeof_wchar_t, sizeof(wchar_t) == SDL_SIZEOF_WCHAR_T); +char *SDL_UCS4ToUTF8(Uint32 codepoint, char *dst) +{ + if (!dst) { + return NULL; // I guess...? + } else if (codepoint > 0x10FFFF) { // Outside the range of Unicode codepoints (also, larger than can be encoded in 4 bytes of UTF-8!). + codepoint = SDL_INVALID_UNICODE_CODEPOINT; + } else if ((codepoint >= 0xD800) && (codepoint <= 0xDFFF)) { // UTF-16 surrogate values are illegal in UTF-8. + codepoint = SDL_INVALID_UNICODE_CODEPOINT; + } + + Uint8 *p = (Uint8 *)dst; + if (codepoint <= 0x7F) { + *p = (Uint8)codepoint; + ++dst; + } else if (codepoint <= 0x7FF) { + p[0] = 0xC0 | (Uint8)((codepoint >> 6) & 0x1F); + p[1] = 0x80 | (Uint8)(codepoint & 0x3F); + dst += 2; + } else if (codepoint <= 0xFFFF) { + p[0] = 0xE0 | (Uint8)((codepoint >> 12) & 0x0F); + p[1] = 0x80 | (Uint8)((codepoint >> 6) & 0x3F); + p[2] = 0x80 | (Uint8)(codepoint & 0x3F); + dst += 3; + } else { + SDL_assert(codepoint <= 0x10FFFF); + p[0] = 0xF0 | (Uint8)((codepoint >> 18) & 0x07); + p[1] = 0x80 | (Uint8)((codepoint >> 12) & 0x3F); + p[2] = 0x80 | (Uint8)((codepoint >> 6) & 0x3F); + p[3] = 0x80 | (Uint8)(codepoint & 0x3F); + dst += 4; + } + + return dst; +} + + // this expects `from` and `to` to be UTF-32 encoding! int SDL_CaseFoldUnicode(const Uint32 from, Uint32 *to) { diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index f531e47b54733..74fc3f1568e4e 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -543,9 +543,9 @@ static EM_BOOL Emscripten_HandleKeyPress(int eventType, const EmscriptenKeyboard if (SDL_TextInputActive(window_data->window)) { char text[5]; - if (SDL_UCS4ToUTF8(keyEvent->charCode, text)) { - SDL_SendKeyboardText(text); - } + char *end = SDL_UCS4ToUTF8(keyEvent->charCode, text); + *end = '\0'; + SDL_SendKeyboardText(text); return EM_TRUE; } return EM_FALSE; diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 8e6485b3cbf65..32a35076175df 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -1286,9 +1286,9 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } else { if (SDL_TextInputActive(data->window)) { char text[5]; - if (SDL_UCS4ToUTF8((Uint32)wParam, text) != text) { - SDL_SendKeyboardText(text); - } + char *end = SDL_UCS4ToUTF8((Uint32)wParam, text); + *end = '\0'; + SDL_SendKeyboardText(text); } returnCode = 0; } From b43f1688d95faf3b9bdc8a883d19215e597fce77 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Thu, 4 Jul 2024 15:12:07 +0000 Subject: [PATCH 150/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_stdinc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 482ae8cf59cd8..450a629e715dc 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -1321,14 +1321,15 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepUTF8(const char **pstr, size_t *pslen * either case, plan to have a buffer of _more_ than 4 bytes!). * * If `codepoint` is an invalid value (outside the Unicode range, or a UTF-16 - * surrogate value, etc), this will use U+FFFD (REPLACEMENT CHARACTER) for - * the codepoint instead, and not set an error. + * surrogate value, etc), this will use U+FFFD (REPLACEMENT CHARACTER) for the + * codepoint instead, and not set an error. * * If `dst` is NULL, this returns NULL immediately without writing to the * pointer and without setting an error. * * \param codepoint a Unicode codepoint to convert to UTF-8. - * \param dst the location to write the encoded UTF-8. Must point to at least 4 bytes! + * \param dst the location to write the encoded UTF-8. Must point to at least + * 4 bytes! * \returns the first byte past the newly-written UTF-8 sequence. * * \threadsafety It is safe to call this function from any thread. From d13fc3c3a7e47e7badb00a47cc0dd4a5dea4b376 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 4 Jul 2024 11:32:50 -0700 Subject: [PATCH 151/431] Fixed building without X11 support --- src/core/linux/SDL_fcitx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index d86ee3d0542da..f7c836e1fd1ec 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -23,6 +23,7 @@ #include #include "SDL_fcitx.h" +#include "../../video/SDL_sysvideo.h" #include "../../events/SDL_keyboard_c.h" #include "SDL_dbus.h" From 9f8dffbd2d00494c3512f423281fbcb676fd6467 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 4 Jul 2024 14:47:46 -0400 Subject: [PATCH 152/431] render: Set renderer->window to NULL in SDL_DestroyRendererWithoutFreeing. This wasn't triggering a bug afaik, but obviously the more correct thing to do. Reference Issue #10174. --- src/render/SDL_render.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index ed705272df389..383515a33a8c7 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -4603,6 +4603,7 @@ void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer) if (renderer->window) { SDL_ClearProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_RENDERER_POINTER); + renderer->window = NULL; } /* Free the target mutex */ From f9a06c20ed85fb1d6754fc2280d6183382217910 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 4 Jul 2024 19:45:37 -0400 Subject: [PATCH 153/431] Revert "render: Set renderer->window to NULL in SDL_DestroyRendererWithoutFreeing." This reverts commit 9f8dffbd2d00494c3512f423281fbcb676fd6467. This causes some tests to fail, and wasn't otherwise a necessary change, so I'm backing it out. (Looks like some sort of interaction with software renderers and their surfaces not getting destroyed...?) --- src/render/SDL_render.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 383515a33a8c7..ed705272df389 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -4603,7 +4603,6 @@ void SDL_DestroyRendererWithoutFreeing(SDL_Renderer *renderer) if (renderer->window) { SDL_ClearProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_RENDERER_POINTER); - renderer->window = NULL; } /* Free the target mutex */ From c057849035d6d985777ed15cfed178ee379ee98c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 08:05:20 -0700 Subject: [PATCH 154/431] Return the correct error from SDL_CreateSoftwareRenderer() when the surface is NULL --- src/render/SDL_render.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index ed705272df389..f1c72d3c1d813 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1156,6 +1156,11 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) { #if SDL_VIDEO_RENDER_SW SDL_Renderer *renderer; + + if (!surface) { + SDL_InvalidParamError("surface"); + } + SDL_PropertiesID props = SDL_CreateProperties(); SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface); renderer = SDL_CreateRendererWithProperties(props); From 065ec2d51897a533d635a6fb1948aa23d5d56279 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 08:12:05 -0700 Subject: [PATCH 155/431] Actually return an error when the surface is invalid --- src/render/SDL_render.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index f1c72d3c1d813..b880f6fba5f83 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1159,6 +1159,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) if (!surface) { SDL_InvalidParamError("surface"); + return NULL; } SDL_PropertiesID props = SDL_CreateProperties(); From c7ed78a9ef229c569e3999d3e2e7067ee4cfe056 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 08:18:45 -0700 Subject: [PATCH 156/431] Try to create an accelerated renderer for the window surface even if SDL_HINT_RENDER_DRIVER is "software" This case is properly handled inside SDL_CreateWindowTexture() Fixes https://github.com/libsdl-org/SDL/issues/10155 --- src/video/SDL_video.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 9363a46ff85b4..cd62a059d25b7 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3283,14 +3283,6 @@ static SDL_bool ShouldAttemptTextureFramebuffer(void) attempt_texture_framebuffer = SDL_FALSE; #endif } - - if (attempt_texture_framebuffer) { - /* Using a software renderer will try to display on a window surface, so avoid recursion here */ - hint = SDL_GetHint(SDL_HINT_RENDER_DRIVER); - if (hint && SDL_strcasecmp(hint, SDL_SOFTWARE_RENDERER) == 0) { - attempt_texture_framebuffer = SDL_FALSE; - } - } return attempt_texture_framebuffer; } From 607b1f225cccc921edf9382077aa1ee6e8606964 Mon Sep 17 00:00:00 2001 From: Max Maisel Date: Fri, 5 Jul 2024 16:34:50 +0200 Subject: [PATCH 157/431] Drain HIDAPI buffer in SDL_hidapi_steamdeck.c. Add a loop around SDL_hid_read() in the Steam Deck HIDAPI driver as it is done in other HIDAPI drivers. This loop reads data from the device and processes it until the input buffer is empty which ensures that clients always get the latest data. This fixes an input latency issue if the application polls the events slower than the hardware generates them. --- src/joystick/hidapi/SDL_hidapi_steamdeck.c | 203 +++++++++++---------- 1 file changed, 106 insertions(+), 97 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_steamdeck.c b/src/joystick/hidapi/SDL_hidapi_steamdeck.c index dc8d2ba0fd32e..7ccbca69bf139 100644 --- a/src/joystick/hidapi/SDL_hidapi_steamdeck.c +++ b/src/joystick/hidapi/SDL_hidapi_steamdeck.c @@ -143,6 +143,98 @@ static SDL_bool FeedDeckLizardWatchdog(SDL_hid_device *dev) return SDL_TRUE; } +static void HIDAPI_DriverSteamDeck_HandleState(SDL_HIDAPI_Device *device, + SDL_Joystick *joystick, + ValveInReport_t *pInReport) +{ + float values[3]; + SDL_DriverSteamDeck_Context *ctx = (SDL_DriverSteamDeck_Context *)device->context; + Uint64 timestamp = SDL_GetTicksNS(); + + if (pInReport->payload.deckState.ulButtons != ctx->last_button_state) { + Uint8 hat = 0; + + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_SOUTH, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_A) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_EAST, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_B) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_WEST, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_X) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_NORTH, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_Y) ? SDL_PRESSED : SDL_RELEASED); + + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R) ? SDL_PRESSED : SDL_RELEASED); + + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_BACK, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_VIEW) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_START, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_MENU) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_GUIDE, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_STEAM) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_QAM, + (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_QAM) ? SDL_PRESSED : SDL_RELEASED); + + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_STICK, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L3) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_STICK, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R3) ? SDL_PRESSED : SDL_RELEASED); + + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_RIGHT_PADDLE1, + (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_R4) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_LEFT_PADDLE1, + (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_L4) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_RIGHT_PADDLE2, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R5) ? SDL_PRESSED : SDL_RELEASED); + SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_LEFT_PADDLE2, + (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L5) ? SDL_PRESSED : SDL_RELEASED); + + if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_UP) { + hat |= SDL_HAT_UP; + } + if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_DOWN) { + hat |= SDL_HAT_DOWN; + } + if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_LEFT) { + hat |= SDL_HAT_LEFT; + } + if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_RIGHT) { + hat |= SDL_HAT_RIGHT; + } + SDL_SendJoystickHat(timestamp, joystick, 0, hat); + + ctx->last_button_state = pInReport->payload.deckState.ulButtons; + } + + SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFT_TRIGGER, + (int)pInReport->payload.deckState.sTriggerRawL * 2 - 32768); + SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, + (int)pInReport->payload.deckState.sTriggerRawR * 2 - 32768); + + SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFTX, + pInReport->payload.deckState.sLeftStickX); + SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFTY, + -pInReport->payload.deckState.sLeftStickY); + SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHTX, + pInReport->payload.deckState.sRightStickX); + SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHTY, + -pInReport->payload.deckState.sRightStickY); + + ctx->sensor_timestamp_us += ctx->update_rate_us; + + values[0] = (pInReport->payload.deckState.sGyroX / 32768.0f) * (2000.0f * (SDL_PI_F / 180.0f)); + values[1] = (pInReport->payload.deckState.sGyroZ / 32768.0f) * (2000.0f * (SDL_PI_F / 180.0f)); + values[2] = (-pInReport->payload.deckState.sGyroY / 32768.0f) * (2000.0f * (SDL_PI_F / 180.0f)); + SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_GYRO, ctx->sensor_timestamp_us, values, 3); + + values[0] = (pInReport->payload.deckState.sAccelX / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; + values[1] = (pInReport->payload.deckState.sAccelZ / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; + values[2] = (-pInReport->payload.deckState.sAccelY / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; + SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_ACCEL, ctx->sensor_timestamp_us, values, 3); +} + /*****************************************************************************************************/ static void HIDAPI_DriverSteamDeck_RegisterHints(SDL_HintCallback callback, void *userdata) @@ -187,8 +279,8 @@ static SDL_bool HIDAPI_DriverSteamDeck_InitDevice(SDL_HIDAPI_Device *device) return SDL_FALSE; } - // Always 1kHz according to USB descriptor - ctx->update_rate_us = 1000; + // Always 1kHz according to USB descriptor, but actually about 4 ms. + ctx->update_rate_us = 4000; device->context = ctx; @@ -222,7 +314,6 @@ static SDL_bool HIDAPI_DriverSteamDeck_UpdateDevice(SDL_HIDAPI_Device *device) SDL_Joystick *joystick = NULL; int r; uint8_t data[64]; - float values[3]; ValveInReport_t *pInReport = (ValveInReport_t *)data; if (device->num_joysticks > 0) { @@ -241,103 +332,21 @@ static SDL_bool HIDAPI_DriverSteamDeck_UpdateDevice(SDL_HIDAPI_Device *device) } SDL_memset(data, 0, sizeof(data)); - r = SDL_hid_read(device->dev, data, sizeof(data)); - if (r == 0) { - return SDL_FALSE; - } else if (r <= 0) { - /* Failed to read from controller */ - HIDAPI_JoystickDisconnected(device, device->joysticks[0]); - return SDL_FALSE; - } - - if (!(r == 64 && pInReport->header.unReportVersion == k_ValveInReportMsgVersion && pInReport->header.ucType == ID_CONTROLLER_DECK_STATE && pInReport->header.ucLength == 64)) { - return SDL_FALSE; - } - Uint64 timestamp = SDL_GetTicksNS(); - - if (pInReport->payload.deckState.ulButtons != ctx->last_button_state) { - Uint8 hat = 0; + do { + r = SDL_hid_read(device->dev, data, sizeof(data)); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_SOUTH, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_A) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_EAST, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_B) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_WEST, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_X) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_NORTH, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_Y) ? SDL_PRESSED : SDL_RELEASED); - - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_SHOULDER, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R) ? SDL_PRESSED : SDL_RELEASED); - - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_BACK, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_VIEW) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_START, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_MENU) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_GUIDE, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_STEAM) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_QAM, - (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_QAM) ? SDL_PRESSED : SDL_RELEASED); - - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_LEFT_STICK, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L3) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_RIGHT_STICK, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R3) ? SDL_PRESSED : SDL_RELEASED); - - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_RIGHT_PADDLE1, - (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_R4) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_LEFT_PADDLE1, - (pInReport->payload.deckState.ulButtonsH & STEAMDECK_HBUTTON_L4) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_RIGHT_PADDLE2, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_R5) ? SDL_PRESSED : SDL_RELEASED); - SDL_SendJoystickButton(timestamp, joystick, SDL_GAMEPAD_BUTTON_STEAM_DECK_LEFT_PADDLE2, - (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_L5) ? SDL_PRESSED : SDL_RELEASED); - - if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_UP) { - hat |= SDL_HAT_UP; - } - if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_DOWN) { - hat |= SDL_HAT_DOWN; - } - if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_LEFT) { - hat |= SDL_HAT_LEFT; - } - if (pInReport->payload.deckState.ulButtonsL & STEAMDECK_LBUTTON_DPAD_RIGHT) { - hat |= SDL_HAT_RIGHT; + if (r < 0) { + /* Failed to read from controller */ + HIDAPI_JoystickDisconnected(device, device->joysticks[0]); + return SDL_FALSE; + } else if (r == 64 && + pInReport->header.unReportVersion == k_ValveInReportMsgVersion && + pInReport->header.ucType == ID_CONTROLLER_DECK_STATE && + pInReport->header.ucLength == 64) { + HIDAPI_DriverSteamDeck_HandleState(device, joystick, pInReport); } - SDL_SendJoystickHat(timestamp, joystick, 0, hat); - - ctx->last_button_state = pInReport->payload.deckState.ulButtons; - } - - SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFT_TRIGGER, - (int)pInReport->payload.deckState.sTriggerRawL * 2 - 32768); - SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHT_TRIGGER, - (int)pInReport->payload.deckState.sTriggerRawR * 2 - 32768); - - SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFTX, - pInReport->payload.deckState.sLeftStickX); - SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_LEFTY, - -pInReport->payload.deckState.sLeftStickY); - SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHTX, - pInReport->payload.deckState.sRightStickX); - SDL_SendJoystickAxis(timestamp, joystick, SDL_GAMEPAD_AXIS_RIGHTY, - -pInReport->payload.deckState.sRightStickY); - - ctx->sensor_timestamp_us += ctx->update_rate_us; - - values[0] = (pInReport->payload.deckState.sGyroX / 32768.0f) * (2000.0f * (SDL_PI_F / 180.0f)); - values[1] = (pInReport->payload.deckState.sGyroZ / 32768.0f) * (2000.0f * (SDL_PI_F / 180.0f)); - values[2] = (-pInReport->payload.deckState.sGyroY / 32768.0f) * (2000.0f * (SDL_PI_F / 180.0f)); - SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_GYRO, ctx->sensor_timestamp_us, values, 3); - - values[0] = (pInReport->payload.deckState.sAccelX / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; - values[1] = (pInReport->payload.deckState.sAccelZ / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; - values[2] = (-pInReport->payload.deckState.sAccelY / 32768.0f) * 2.0f * SDL_STANDARD_GRAVITY; - SDL_SendJoystickSensor(timestamp, joystick, SDL_SENSOR_ACCEL, ctx->sensor_timestamp_us, values, 3); + } while (r > 0); return SDL_TRUE; } From 4b5309cd9888e5ed4a73712b22889e987f5810a4 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 4 Jul 2024 20:32:19 -0400 Subject: [PATCH 158/431] main: Move SDL_RunApp bits from src/core to src/main. Fixes #10170. --- CMakeLists.txt | 10 +- VisualC-GDK/SDL/SDL.vcxproj | 3 +- VisualC-GDK/SDL/SDL.vcxproj.filters | 3 +- VisualC-WinRT/SDL-UWP.vcxproj | 13 +- VisualC-WinRT/SDL-UWP.vcxproj.filters | 12 +- VisualC/SDL/SDL.vcxproj | 3 +- VisualC/SDL/SDL.vcxproj.filters | 12 +- Xcode/SDL/SDL.xcodeproj/project.pbxproj | 2 +- src/core/gdk/SDL_gdk.cpp | 157 --------------- src/core/windows/SDL_windows.c | 77 -------- src/core/winrt/SDL_winrtapp_common.cpp | 16 -- src/{core => main}/SDL_runapp.c | 0 .../emscripten/SDL_sysmain_runapp.c} | 0 src/main/gdk/SDL_sysmain_runapp.cpp | 187 ++++++++++++++++++ .../n3ds/SDL_sysmain_runapp.c} | 0 .../ngage/SDL_sysmain_runapp.cpp} | 0 .../ps2/SDL_sysmain_runapp.c} | 0 .../psp/SDL_sysmain_runapp.c} | 0 src/main/windows/SDL_sysmain_runapp.c | 99 ++++++++++ src/main/winrt/SDL_sysmain_runapp.cpp | 40 ++++ 20 files changed, 368 insertions(+), 266 deletions(-) rename src/{core => main}/SDL_runapp.c (100%) rename src/{core/emscripten/SDL_emscripten.c => main/emscripten/SDL_sysmain_runapp.c} (100%) create mode 100644 src/main/gdk/SDL_sysmain_runapp.cpp rename src/{core/n3ds/SDL_n3ds.c => main/n3ds/SDL_sysmain_runapp.c} (100%) rename src/{core/ngage/SDL_ngage_runapp.cpp => main/ngage/SDL_sysmain_runapp.cpp} (100%) rename src/{core/ps2/SDL_ps2.c => main/ps2/SDL_sysmain_runapp.c} (100%) rename src/{core/psp/SDL_psp.c => main/psp/SDL_sysmain_runapp.c} (100%) create mode 100644 src/main/windows/SDL_sysmain_runapp.c create mode 100644 src/main/winrt/SDL_sysmain_runapp.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index a7f342579d07d..a40bc609a4c14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1480,8 +1480,6 @@ elseif(EMSCRIPTEN) # project. Uncomment at will for verbose cross-compiling -I/../ path info. sdl_compile_options(PRIVATE "-Wno-warn-absolute-paths") - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/emscripten/*.c") - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/emscripten/*.c") set(HAVE_SDL_MAIN_CALLBACKS TRUE) @@ -1866,12 +1864,14 @@ elseif(WINDOWS) int main(int argc, char **argv) { return 0; }" HAVE_WIN32_CC) sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/windows/*.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/windows/*.c") if(WINDOWS_STORE) enable_language(CXX) sdl_glob_sources( "${SDL3_SOURCE_DIR}/src/core/winrt/*.c" "${SDL3_SOURCE_DIR}/src/core/winrt/*.cpp" + "${SDL3_SOURCE_DIR}/src/main/winrt/*.cpp" ) endif() @@ -2727,7 +2727,7 @@ elseif(VITA) sdl_compile_definitions(PRIVATE "__VITA__") elseif(PSP) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/psp/*.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/psp/*.c") if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_PSP 1) @@ -2796,7 +2796,7 @@ elseif(PS2) sdl_compile_definitions(PRIVATE "PS2" "__PS2__") sdl_include_directories(PRIVATE SYSTEM "$ENV{PS2SDK}/ports/include" "$ENV{PS2DEV}/gsKit/include") - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/ps2/*.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/ps2/*.c") if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_PS2 1) @@ -2853,7 +2853,7 @@ elseif(PS2) ps2_drivers ) elseif(N3DS) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/core/n3ds/*.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/main/n3ds/*.c") if(SDL_AUDIO) set(SDL_AUDIO_DRIVER_N3DS 1) diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index bb7c85405bf71..67e74896cd06d 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -503,8 +503,10 @@ + + @@ -600,7 +602,6 @@ - diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 2b4f69eb03c67..478d401f0c9ed 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -18,6 +18,8 @@ + + @@ -35,7 +37,6 @@ - diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index 0231e2dd03a3a..072c133d3136c 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -268,7 +268,6 @@ - @@ -359,8 +358,20 @@ + + + true + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + $(IntDir)$(TargetName)_cpp.pch + true diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index 7112f2f9cc378..4e573d6f2809e 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -34,6 +34,9 @@ {0000c99bfadbbcb05a474a8472910000} + + {00006680a11742e2b280c6453be80000} + @@ -549,9 +552,6 @@ Source Files - - Source Files - Source Files @@ -660,6 +660,12 @@ main + + Source Files + + + main\winrt + Source Files diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 87dd7ee8ee27b..879c607e8dd80 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -404,6 +404,8 @@ + + @@ -506,7 +508,6 @@ - diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 4eb44ad41f30c..93db4f199448a 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -202,6 +202,9 @@ {748cf015-00b8-4e71-ac48-02e947e4d93d} + + {00009d5ded166cc6c6680ec771a30000} + @@ -919,6 +922,12 @@ main + + main + + + main\windows + @@ -961,9 +970,6 @@ core - - core - core\windows diff --git a/Xcode/SDL/SDL.xcodeproj/project.pbxproj b/Xcode/SDL/SDL.xcodeproj/project.pbxproj index aace663af0e5e..f13182b501b4a 100644 --- a/Xcode/SDL/SDL.xcodeproj/project.pbxproj +++ b/Xcode/SDL/SDL.xcodeproj/project.pbxproj @@ -1145,6 +1145,7 @@ 00008B5A0CB83D2069E80000 /* ios */, 00009366FB9FBBD54C390000 /* SDL_main_callbacks.c */, 00003260407E1002EAC10000 /* SDL_main_callbacks.h */, + F36C7AD0294BA009004D61C3 /* SDL_runapp.c */, ); path = main; sourceTree = ""; @@ -2255,7 +2256,6 @@ isa = PBXGroup; children = ( E4F798192AD8D84800669F54 /* SDL_core_unsupported.c */, - F36C7AD0294BA009004D61C3 /* SDL_runapp.c */, ); path = core; sourceTree = ""; diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp index 8e7a8caaa4919..80166bae3c5ae 100644 --- a/src/core/gdk/SDL_gdk.cpp +++ b/src/core/gdk/SDL_gdk.cpp @@ -26,7 +26,6 @@ extern "C" { } #include #include -#include /* CommandLineToArgvW() */ #include static XTaskQueueHandle GDK_GlobalTaskQueue; @@ -74,162 +73,6 @@ void GDK_DispatchTaskQueue(void) } } -/* Pop up an out of memory message, returns to Windows */ -static BOOL OutOfMemory(void) -{ - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL); - return FALSE; -} - -/* Gets the arguments with GetCommandLine, converts them to argc and argv - and calls SDL_main */ -extern "C" -int SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved) -{ - LPWSTR *argvw; - char **argv; - int i, argc, result; - HRESULT hr; - XTaskQueueHandle taskQueue; - - argvw = CommandLineToArgvW(GetCommandLineW(), &argc); - if (argvw == NULL) { - return OutOfMemory(); - } - - /* Note that we need to be careful about how we allocate/free memory here. - * If the application calls SDL_SetMemoryFunctions(), we can't rely on - * SDL_free() to use the same allocator after SDL_main() returns. - */ - - /* Parse it into argv and argc */ - argv = (char **)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv)); - if (argv == NULL) { - return OutOfMemory(); - } - for (i = 0; i < argc; ++i) { - const int utf8size = WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL); - if (!utf8size) { // uhoh? - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); - return -1; - } - - argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, utf8size); // this size includes the null-terminator character. - if (!argv[i]) { - return OutOfMemory(); - } - - if (WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, argv[i], utf8size, NULL, NULL) == 0) { // failed? uhoh! - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); - return -1; - } - } - argv[i] = NULL; - LocalFree(argvw); - - hr = XGameRuntimeInitialize(); - - if (SUCCEEDED(hr) && SDL_GDKGetTaskQueue(&taskQueue) == 0) { - Uint32 titleid = 0; - char scidBuffer[64]; - XblInitArgs xblArgs; - - XTaskQueueSetCurrentProcessTaskQueue(taskQueue); - - /* Try to get the title ID and initialize Xbox Live */ - hr = XGameGetXboxTitleId(&titleid); - if (SUCCEEDED(hr)) { - SDL_zero(xblArgs); - xblArgs.queue = taskQueue; - SDL_snprintf(scidBuffer, 64, "00000000-0000-0000-0000-0000%08X", titleid); - xblArgs.scid = scidBuffer; - hr = XblInitialize(&xblArgs); - } else { - SDL_SetError("[GDK] Unable to get titleid. Will not call XblInitialize. Check MicrosoftGame.config!"); - } - - SDL_SetMainReady(); - - /* Register suspend/resume handling */ - plmSuspendComplete = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE); - if (!plmSuspendComplete) { - SDL_SetError("[GDK] Unable to create plmSuspendComplete event"); - return -1; - } - auto rascn = [](BOOLEAN quiesced, PVOID context) { - SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppStateChangeNotification handler"); - if (quiesced) { - ResetEvent(plmSuspendComplete); - SDL_SendAppEvent(SDL_EVENT_DID_ENTER_BACKGROUND); - - // To defer suspension, we must wait to exit this callback. - // IMPORTANT: The app must call SDL_GDKSuspendComplete() to release this lock. - (void)WaitForSingleObject(plmSuspendComplete, INFINITE); - - SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppStateChangeNotification handler: plmSuspendComplete event signaled."); - } else { - SDL_SendAppEvent(SDL_EVENT_WILL_ENTER_FOREGROUND); - } - }; - if (RegisterAppStateChangeNotification(rascn, NULL, &hPLM)) { - SDL_SetError("[GDK] Unable to call RegisterAppStateChangeNotification"); - return -1; - } - - /* Register constrain/unconstrain handling */ - auto raccn = [](BOOLEAN constrained, PVOID context) { - SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppConstrainedChangeNotification handler"); - SDL_VideoDevice *_this = SDL_GetVideoDevice(); - if (_this) { - if (constrained) { - SDL_SetKeyboardFocus(NULL); - } else { - SDL_SetKeyboardFocus(_this->windows); - } - } - }; - if (RegisterAppConstrainedChangeNotification(raccn, NULL, &hCPLM)) { - SDL_SetError("[GDK] Unable to call RegisterAppConstrainedChangeNotification"); - return -1; - } - - /* Run the application main() code */ - result = mainFunction(argc, argv); - - /* Unregister suspend/resume handling */ - UnregisterAppStateChangeNotification(hPLM); - CloseHandle(plmSuspendComplete); - - /* Unregister constrain/unconstrain handling */ - UnregisterAppConstrainedChangeNotification(hCPLM); - - /* !!! FIXME: This follows the docs exactly, but for some reason still leaks handles on exit? */ - /* Terminate the task queue and dispatch any pending tasks */ - XTaskQueueTerminate(taskQueue, false, nullptr, nullptr); - while (XTaskQueueDispatch(taskQueue, XTaskQueuePort::Completion, 0)) - ; - - XTaskQueueCloseHandle(taskQueue); - - XGameRuntimeUninitialize(); - } else { -#ifdef SDL_PLATFORM_WINGDK - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "[GDK] Could not initialize - aborting", NULL); -#else - SDL_assert_always(0 && "[GDK] Could not initialize - aborting"); -#endif - result = -1; - } - - /* Free argv, to avoid memory leak */ - for (i = 0; i < argc; ++i) { - HeapFree(GetProcessHeap(), 0, argv[i]); - } - HeapFree(GetProcessHeap(), 0, argv); - - return result; -} - extern "C" void SDL_GDKSuspendComplete() { diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c index eea88ff8e6bce..961d4de801fe9 100644 --- a/src/core/windows/SDL_windows.c +++ b/src/core/windows/SDL_windows.c @@ -389,81 +389,4 @@ int WIN_WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWCH lpWideCharStr, return WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, lpMultiByteStr, cbMultiByte, lpDefaultChar, lpUsedDefaultChar); } - -/* Win32-specific SDL_RunApp(), which does most of the SDL_main work, - based on SDL_windows_main.c, placed in the public domain by Sam Lantinga 4/13/98 */ -#ifdef SDL_PLATFORM_WIN32 - -#include /* CommandLineToArgvW() */ - -/* Pop up an out of memory message, returns to Windows */ -static int OutOfMemory(void) -{ - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL); - return -1; -} - -int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved) -{ - - /* Gets the arguments with GetCommandLine, converts them to argc and argv - and calls SDL_main */ - - LPWSTR *argvw; - char **argv; - int i, argc, result; - - (void)_argc; (void)_argv; (void)reserved; - - argvw = CommandLineToArgvW(GetCommandLineW(), &argc); - if (!argvw) { - return OutOfMemory(); - } - - /* Note that we need to be careful about how we allocate/free memory here. - * If the application calls SDL_SetMemoryFunctions(), we can't rely on - * SDL_free() to use the same allocator after SDL_main() returns. - */ - - /* Parse it into argv and argc */ - argv = (char **)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv)); - if (!argv) { - return OutOfMemory(); - } - for (i = 0; i < argc; ++i) { - const int utf8size = WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL); - if (!utf8size) { // uhoh? - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); - return -1; - } - - argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, utf8size); // this size includes the null-terminator character. - if (!argv[i]) { - return OutOfMemory(); - } - - if (WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, argv[i], utf8size, NULL, NULL) == 0) { // failed? uhoh! - SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); - return -1; - } - } - argv[i] = NULL; - LocalFree(argvw); - - SDL_SetMainReady(); - - /* Run the application main() code */ - result = mainFunction(argc, argv); - - /* Free argv, to avoid memory leak */ - for (i = 0; i < argc; ++i) { - HeapFree(GetProcessHeap(), 0, argv[i]); - } - HeapFree(GetProcessHeap(), 0, argv); - - return result; -} - -#endif /* SDL_PLATFORM_WIN32 */ - #endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_GDK) */ diff --git a/src/core/winrt/SDL_winrtapp_common.cpp b/src/core/winrt/SDL_winrtapp_common.cpp index 9df3c1d88825a..6cdb71d530b08 100644 --- a/src/core/winrt/SDL_winrtapp_common.cpp +++ b/src/core/winrt/SDL_winrtapp_common.cpp @@ -20,26 +20,10 @@ */ #include "SDL_internal.h" -#include "SDL_winrtapp_direct3d.h" -#include "SDL_winrtapp_xaml.h" - #include int (*WINRT_SDLAppEntryPoint)(int, char **) = NULL; -extern "C" -int SDL_RunApp(int, char**, SDL_main_func mainFunction, void * xamlBackgroundPanel) -{ - if (xamlBackgroundPanel) { - return SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel); - } else { - if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) { - return 1; - } - return SDL_WinRTInitNonXAMLApp(mainFunction); - } -} - extern "C" SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily() { diff --git a/src/core/SDL_runapp.c b/src/main/SDL_runapp.c similarity index 100% rename from src/core/SDL_runapp.c rename to src/main/SDL_runapp.c diff --git a/src/core/emscripten/SDL_emscripten.c b/src/main/emscripten/SDL_sysmain_runapp.c similarity index 100% rename from src/core/emscripten/SDL_emscripten.c rename to src/main/emscripten/SDL_sysmain_runapp.c diff --git a/src/main/gdk/SDL_sysmain_runapp.cpp b/src/main/gdk/SDL_sysmain_runapp.cpp new file mode 100644 index 0000000000000..4517b285779b9 --- /dev/null +++ b/src/main/gdk/SDL_sysmain_runapp.cpp @@ -0,0 +1,187 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +extern "C" { +#include "../../core/windows/SDL_windows.h" +#include "../../events/SDL_events_c.h" +} +#include +#include +#include /* CommandLineToArgvW() */ +#include + +/* Pop up an out of memory message, returns to Windows */ +static BOOL OutOfMemory(void) +{ + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL); + return FALSE; +} + +/* Gets the arguments with GetCommandLine, converts them to argc and argv + and calls SDL_main */ +extern "C" +int SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved) +{ + LPWSTR *argvw; + char **argv; + int i, argc, result; + HRESULT hr; + XTaskQueueHandle taskQueue; + + argvw = CommandLineToArgvW(GetCommandLineW(), &argc); + if (argvw == NULL) { + return OutOfMemory(); + } + + /* Note that we need to be careful about how we allocate/free memory here. + * If the application calls SDL_SetMemoryFunctions(), we can't rely on + * SDL_free() to use the same allocator after SDL_main() returns. + */ + + /* Parse it into argv and argc */ + argv = (char **)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv)); + if (argv == NULL) { + return OutOfMemory(); + } + for (i = 0; i < argc; ++i) { + const int utf8size = WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL); + if (!utf8size) { // uhoh? + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); + return -1; + } + + argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, utf8size); // this size includes the null-terminator character. + if (!argv[i]) { + return OutOfMemory(); + } + + if (WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, argv[i], utf8size, NULL, NULL) == 0) { // failed? uhoh! + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); + return -1; + } + } + argv[i] = NULL; + LocalFree(argvw); + + hr = XGameRuntimeInitialize(); + + if (SUCCEEDED(hr) && SDL_GDKGetTaskQueue(&taskQueue) == 0) { + Uint32 titleid = 0; + char scidBuffer[64]; + XblInitArgs xblArgs; + + XTaskQueueSetCurrentProcessTaskQueue(taskQueue); + + /* Try to get the title ID and initialize Xbox Live */ + hr = XGameGetXboxTitleId(&titleid); + if (SUCCEEDED(hr)) { + SDL_zero(xblArgs); + xblArgs.queue = taskQueue; + SDL_snprintf(scidBuffer, 64, "00000000-0000-0000-0000-0000%08X", titleid); + xblArgs.scid = scidBuffer; + hr = XblInitialize(&xblArgs); + } else { + SDL_SetError("[GDK] Unable to get titleid. Will not call XblInitialize. Check MicrosoftGame.config!"); + } + + SDL_SetMainReady(); + + /* Register suspend/resume handling */ + plmSuspendComplete = CreateEventEx(nullptr, nullptr, 0, EVENT_MODIFY_STATE | SYNCHRONIZE); + if (!plmSuspendComplete) { + SDL_SetError("[GDK] Unable to create plmSuspendComplete event"); + return -1; + } + auto rascn = [](BOOLEAN quiesced, PVOID context) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppStateChangeNotification handler"); + if (quiesced) { + ResetEvent(plmSuspendComplete); + SDL_SendAppEvent(SDL_EVENT_DID_ENTER_BACKGROUND); + + // To defer suspension, we must wait to exit this callback. + // IMPORTANT: The app must call SDL_GDKSuspendComplete() to release this lock. + (void)WaitForSingleObject(plmSuspendComplete, INFINITE); + + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppStateChangeNotification handler: plmSuspendComplete event signaled."); + } else { + SDL_SendAppEvent(SDL_EVENT_WILL_ENTER_FOREGROUND); + } + }; + if (RegisterAppStateChangeNotification(rascn, NULL, &hPLM)) { + SDL_SetError("[GDK] Unable to call RegisterAppStateChangeNotification"); + return -1; + } + + /* Register constrain/unconstrain handling */ + auto raccn = [](BOOLEAN constrained, PVOID context) { + SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, "[GDK] in RegisterAppConstrainedChangeNotification handler"); + SDL_VideoDevice *_this = SDL_GetVideoDevice(); + if (_this) { + if (constrained) { + SDL_SetKeyboardFocus(NULL); + } else { + SDL_SetKeyboardFocus(_this->windows); + } + } + }; + if (RegisterAppConstrainedChangeNotification(raccn, NULL, &hCPLM)) { + SDL_SetError("[GDK] Unable to call RegisterAppConstrainedChangeNotification"); + return -1; + } + + /* Run the application main() code */ + result = mainFunction(argc, argv); + + /* Unregister suspend/resume handling */ + UnregisterAppStateChangeNotification(hPLM); + CloseHandle(plmSuspendComplete); + + /* Unregister constrain/unconstrain handling */ + UnregisterAppConstrainedChangeNotification(hCPLM); + + /* !!! FIXME: This follows the docs exactly, but for some reason still leaks handles on exit? */ + /* Terminate the task queue and dispatch any pending tasks */ + XTaskQueueTerminate(taskQueue, false, nullptr, nullptr); + while (XTaskQueueDispatch(taskQueue, XTaskQueuePort::Completion, 0)) + ; + + XTaskQueueCloseHandle(taskQueue); + + XGameRuntimeUninitialize(); + } else { +#ifdef SDL_PLATFORM_WINGDK + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "[GDK] Could not initialize - aborting", NULL); +#else + SDL_assert_always(0 && "[GDK] Could not initialize - aborting"); +#endif + result = -1; + } + + /* Free argv, to avoid memory leak */ + for (i = 0; i < argc; ++i) { + HeapFree(GetProcessHeap(), 0, argv[i]); + } + HeapFree(GetProcessHeap(), 0, argv); + + return result; +} + diff --git a/src/core/n3ds/SDL_n3ds.c b/src/main/n3ds/SDL_sysmain_runapp.c similarity index 100% rename from src/core/n3ds/SDL_n3ds.c rename to src/main/n3ds/SDL_sysmain_runapp.c diff --git a/src/core/ngage/SDL_ngage_runapp.cpp b/src/main/ngage/SDL_sysmain_runapp.cpp similarity index 100% rename from src/core/ngage/SDL_ngage_runapp.cpp rename to src/main/ngage/SDL_sysmain_runapp.cpp diff --git a/src/core/ps2/SDL_ps2.c b/src/main/ps2/SDL_sysmain_runapp.c similarity index 100% rename from src/core/ps2/SDL_ps2.c rename to src/main/ps2/SDL_sysmain_runapp.c diff --git a/src/core/psp/SDL_psp.c b/src/main/psp/SDL_sysmain_runapp.c similarity index 100% rename from src/core/psp/SDL_psp.c rename to src/main/psp/SDL_sysmain_runapp.c diff --git a/src/main/windows/SDL_sysmain_runapp.c b/src/main/windows/SDL_sysmain_runapp.c new file mode 100644 index 0000000000000..426564e0ccc69 --- /dev/null +++ b/src/main/windows/SDL_sysmain_runapp.c @@ -0,0 +1,99 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +#ifdef SDL_PLATFORM_WIN32 + +#include "../../core/windows/SDL_windows.h" + +/* Win32-specific SDL_RunApp(), which does most of the SDL_main work, + based on SDL_windows_main.c, placed in the public domain by Sam Lantinga 4/13/98 */ + +#include /* CommandLineToArgvW() */ + +/* Pop up an out of memory message, returns to Windows */ +static int OutOfMemory(void) +{ + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Out of memory - aborting", NULL); + return -1; +} + +int MINGW32_FORCEALIGN SDL_RunApp(int _argc, char* _argv[], SDL_main_func mainFunction, void * reserved) +{ + /* Gets the arguments with GetCommandLine, converts them to argc and argv + and calls SDL_main */ + + LPWSTR *argvw; + char **argv; + int i, argc, result; + + (void)_argc; (void)_argv; (void)reserved; + + argvw = CommandLineToArgvW(GetCommandLineW(), &argc); + if (!argvw) { + return OutOfMemory(); + } + + /* Note that we need to be careful about how we allocate/free memory here. + * If the application calls SDL_SetMemoryFunctions(), we can't rely on + * SDL_free() to use the same allocator after SDL_main() returns. + */ + + /* Parse it into argv and argc */ + argv = (char **)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (argc + 1) * sizeof(*argv)); + if (!argv) { + return OutOfMemory(); + } + for (i = 0; i < argc; ++i) { + const int utf8size = WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, NULL, 0, NULL, NULL); + if (!utf8size) { // uhoh? + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); + return -1; + } + + argv[i] = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, utf8size); // this size includes the null-terminator character. + if (!argv[i]) { + return OutOfMemory(); + } + + if (WideCharToMultiByte(CP_UTF8, 0, argvw[i], -1, argv[i], utf8size, NULL, NULL) == 0) { // failed? uhoh! + SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Fatal Error", "Error processing command line arguments", NULL); + return -1; + } + } + argv[i] = NULL; + LocalFree(argvw); + + SDL_SetMainReady(); + + /* Run the application main() code */ + result = mainFunction(argc, argv); + + /* Free argv, to avoid memory leak */ + for (i = 0; i < argc; ++i) { + HeapFree(GetProcessHeap(), 0, argv[i]); + } + HeapFree(GetProcessHeap(), 0, argv); + + return result; +} + +#endif /* SDL_PLATFORM_WIN32 */ diff --git a/src/main/winrt/SDL_sysmain_runapp.cpp b/src/main/winrt/SDL_sysmain_runapp.cpp new file mode 100644 index 0000000000000..7a6e347c74fee --- /dev/null +++ b/src/main/winrt/SDL_sysmain_runapp.cpp @@ -0,0 +1,40 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +#include "../../core/winrt/SDL_winrtapp_direct3d.h" +#include "../../core/winrt/SDL_winrtapp_xaml.h" + +#include + +extern "C" +int SDL_RunApp(int, char**, SDL_main_func mainFunction, void * xamlBackgroundPanel) +{ + if (xamlBackgroundPanel) { + return SDL_WinRTInitXAMLApp(mainFunction, xamlBackgroundPanel); + } else { + if (FAILED(Windows::Foundation::Initialize(RO_INIT_MULTITHREADED))) { + return 1; + } + return SDL_WinRTInitNonXAMLApp(mainFunction); + } +} + From 8412f528538eb6baa2f7989318d337c0cac43688 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 08:57:30 -0700 Subject: [PATCH 159/431] Clarified that the renderer should be destroyed before the window I didn't add a note to SDL_DestroyWindow() because we actually protect against this case now, but it's useful information to know conceptually when working with the renderer. --- include/SDL3/SDL_render.h | 5 ++--- include/SDL3/SDL_video.h | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 5dc8fa3ef545f..bb2fbe87118ec 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -2007,10 +2007,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); extern SDL_DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture); /** - * Destroy the rendering context for a window and free associated textures. + * Destroy the rendering context for a window and free all associated textures. * - * If `renderer` is NULL, this function will return immediately after setting - * the SDL error message to "Invalid renderer". See SDL_GetError(). + * This should be called before destroying the associated window. * * \param renderer the rendering context. * diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index cdb911f71e78d..d536396102978 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -2333,9 +2333,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlashWindow(SDL_Window *window, SDL_FlashOpe * Any popups or modal windows owned by the window will be recursively * destroyed as well. * - * If `window` is NULL, this function will return immediately after setting - * the SDL error message to "Invalid window". See SDL_GetError(). - * * \param window the window to destroy. * * \since This function is available since SDL 3.0.0. From d5a0f609635abec6ba06b91f467da5168f120c5e Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 5 Jul 2024 15:59:26 +0000 Subject: [PATCH 160/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_render.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index bb2fbe87118ec..f33cdf906f175 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -2007,7 +2007,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPresent(SDL_Renderer *renderer); extern SDL_DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture *texture); /** - * Destroy the rendering context for a window and free all associated textures. + * Destroy the rendering context for a window and free all associated + * textures. * * This should be called before destroying the associated window. * From 4f71218e170ad75d7d43fb74cf299d982966257f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 09:23:06 -0700 Subject: [PATCH 161/431] Allow for floating point error in matching framerates Fixes https://github.com/libsdl-org/SDL/issues/10053 --- src/camera/coremedia/SDL_camera_coremedia.m | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/camera/coremedia/SDL_camera_coremedia.m b/src/camera/coremedia/SDL_camera_coremedia.m index 5b4bbaaf485e6..6e407ea4cdf12 100644 --- a/src/camera/coremedia/SDL_camera_coremedia.m +++ b/src/camera/coremedia/SDL_camera_coremedia.m @@ -268,12 +268,14 @@ static int COREMEDIA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec * } const CMVideoDimensions dim = CMVideoFormatDescriptionGetDimensions(formatDescription); - if ( ((int) dim.width != w) || (((int) dim.height) != h) ) { + if ((int)dim.width != w || (int)dim.height != h) { continue; } + const float FRAMERATE_EPSILON = 0.01f; for (AVFrameRateRange *framerate in format.videoSupportedFrameRateRanges) { - if (rate >= framerate.minFrameRate && rate <= framerate.maxFrameRate) { + if (rate > (framerate.minFrameRate - FRAMERATE_EPSILON) && + rate < (framerate.maxFrameRate + FRAMERATE_EPSILON)) { spec_format = format; break; } @@ -393,12 +395,15 @@ static void GatherCameraSpecs(AVCaptureDevice *device, CameraFormatAddData *add_ const int w = (int) dims.width; const int h = (int) dims.height; for (AVFrameRateRange *framerate in fmt.videoSupportedFrameRateRanges) { - int numerator = 0, denominator = 1; - - SDL_CalculateFraction(framerate.minFrameRate, &numerator, &denominator); - SDL_AddCameraFormat(add_data, device_format, device_colorspace, w, h, numerator, denominator); - SDL_CalculateFraction(framerate.maxFrameRate, &numerator, &denominator); - SDL_AddCameraFormat(add_data, device_format, device_colorspace, w, h, numerator, denominator); + int min_numerator = 0, min_denominator = 1; + int max_numerator = 0, max_denominator = 1; + + SDL_CalculateFraction(framerate.minFrameRate, &min_numerator, &min_denominator); + SDL_AddCameraFormat(add_data, device_format, device_colorspace, w, h, min_numerator, min_denominator); + SDL_CalculateFraction(framerate.maxFrameRate, &max_numerator, &max_denominator); + if (max_numerator != min_numerator || max_denominator != min_denominator) { + SDL_AddCameraFormat(add_data, device_format, device_colorspace, w, h, max_numerator, max_denominator); + } } } } From 2d05dcc1f7b7693c734ab376eeba65a938968dd1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 10:04:59 -0700 Subject: [PATCH 162/431] The same VID/PID is used for the FlyDigi Apex 4 --- src/joystick/sort_controllers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/sort_controllers.py b/src/joystick/sort_controllers.py index efbb51630a96a..5a9a228a15ec0 100755 --- a/src/joystick/sort_controllers.py +++ b/src/joystick/sort_controllers.py @@ -22,7 +22,7 @@ invalid_controllers = ( ('0079', '0006', '0000'), # DragonRise Inc. Generic USB Joystick ('0079', '0006', '6120'), # DragonRise Inc. Generic USB Joystick - ('04b4', '2412', 'c529'), # Flydigi Vader 2, Vader 2 Pro, Apex 2, Apex 3 + ('04b4', '2412', 'c529'), # Flydigi Vader 2, Vader 2 Pro, Apex 2, Apex 3, Apex 4 ('16c0', '05e1', '0000'), # Xinmotek Controller ) From 50ae47af5e67099f9e99f96440c4159d3e87c88d Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 5 Jul 2024 00:09:40 +0200 Subject: [PATCH 163/431] android: create android project in create-android-project.py python script This script supersedes androidbuild.sh, and also supports using a SDL3 prefab archive --- .github/workflows/android.yml | 6 +- .github/workflows/release.yml | 69 +++++++- android-project/app/jni/CMakeLists.txt | 5 - android-project/app/jni/src/Android.mk | 11 +- build-scripts/androidbuild.sh | 106 ------------ build-scripts/build-release.py | 2 +- build-scripts/create-android-project.py | 217 ++++++++++++++++++++++++ docs/README-android.md | 10 +- 8 files changed, 302 insertions(+), 124 deletions(-) delete mode 100755 build-scripts/androidbuild.sh create mode 100755 build-scripts/create-android-project.py diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index f6940806fb532..70029d686000f 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -40,7 +40,11 @@ jobs: - name: Create Gradle project if: ${{ matrix.platform.gradle }} run: | - build-scripts/androidbuild.sh org.libsdl.testspriteminimal test/testspriteminimal.c test/icon.h + python build-scripts/create-android-project.py \ + --output "build" \ + --variant copy \ + org.libsdl.testspriteminimal \ + test/testspriteminimal.c test/icon.h echo "" echo "Project contents:" echo "" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f79f64658e38..e9fdc3b13b17c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -461,7 +461,6 @@ jobs: sparse-checkout: 'build-scripts/build-release.py' - name: 'Setup Android NDK' uses: nttld/setup-ndk@v1 - id: setup_ndk with: local-cache: true ndk-version: r21e @@ -500,3 +499,71 @@ jobs: with: name: android path: '${{ github.workspace }}/dist' + + android-verify: + needs: [android, src] + runs-on: ubuntu-latest + steps: + - name: 'Set up Python' + uses: actions/setup-python@v5 + with: + python-version: '3.10' + - name: 'Setup Android NDK' + uses: nttld/setup-ndk@v1 + with: + local-cache: true + ndk-version: r21e + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + - name: 'Download source archives' + uses: actions/download-artifact@v4 + with: + name: sources + path: '${{ github.workspace }}' + - name: 'Download Android .aar archive' + uses: actions/download-artifact@v4 + with: + name: android + path: '${{ github.workspace }}' + - name: 'Untar ${{ needs.src.outputs.src-tar-gz }}' + id: src + run: | + mkdir -p /tmp/tardir + tar -C /tmp/tardir -v -x -f "${{ github.workspace }}/${{ needs.src.outputs.src-tar-gz }}" + echo "path=/tmp/tardir/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$GITHUB_OUTPUT + - name: 'Create gradle project' + id: create-gradle-project + run: | + python ${{ steps.src.outputs.path }}/build-scripts/create-android-project.py \ + org.libsdl.testspriteminimal \ + ${{ steps.src.outputs.path }}/test/testspriteminimal.c \ + ${{ steps.src.outputs.path }}/test/icon.h \ + --variant aar \ + --output "/tmp/projects" + echo "path=/tmp/projects/org.libsdl.testspriteminimal" >>$GITHUB_OUTPUT + + echo "" + echo "Project contents:" + echo "" + find "/tmp/projects/org.libsdl.testspriteminimal" + - name: 'Remove SDL sources to make sure they are not used' + run: | + rm -rf "${{ steps.src.outputs.path }}" + - name: 'Copy SDL3 aar into Gradle project' + run: | + cp "${{ github.workspace }}/${{ needs.android.outputs.android-aar }}" "${{ steps.create-gradle-project.outputs.path }}/app/libs" + + echo "" + echo "Project contents:" + echo "" + find "${{ steps.create-gradle-project.outputs.path }}" + - name: 'Build app (Gradle & ndk-build)' + run: | + cd "${{ steps.create-gradle-project.outputs.path }}" + ./gradlew -i assembleRelease -PBUILD_WITH_CMAKE=1 + - name: 'Build app (Gradle & CMake)' + run: | + cd "${{ steps.create-gradle-project.outputs.path }}" + ./gradlew -i assembleRelease diff --git a/android-project/app/jni/CMakeLists.txt b/android-project/app/jni/CMakeLists.txt index 3d49cf3437db3..404b87b37f447 100644 --- a/android-project/app/jni/CMakeLists.txt +++ b/android-project/app/jni/CMakeLists.txt @@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 3.6) project(GAME) -# armeabi-v7a requires cpufeatures library -# include(AndroidNdkModules) -# android_ndk_import_module_cpufeatures() - - # SDL sources are in a subfolder named "SDL" add_subdirectory(SDL) diff --git a/android-project/app/jni/src/Android.mk b/android-project/app/jni/src/Android.mk index 982f661703671..61672d4f6d84b 100644 --- a/android-project/app/jni/src/Android.mk +++ b/android-project/app/jni/src/Android.mk @@ -4,15 +4,16 @@ include $(CLEAR_VARS) LOCAL_MODULE := main -SDL_PATH := ../SDL +# Add your application source files here... +LOCAL_SRC_FILES := \ + YourSourceHere.c -LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include +SDL_PATH := ../SDL # SDL -# Add your application source files here... -LOCAL_SRC_FILES := YourSourceHere.c +LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(SDL_PATH)/include # SDL LOCAL_SHARED_LIBRARIES := SDL3 -LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid +LOCAL_LDLIBS := -lGLESv1_CM -lGLESv2 -lOpenSLES -llog -landroid # SDL include $(BUILD_SHARED_LIBRARY) diff --git a/build-scripts/androidbuild.sh b/build-scripts/androidbuild.sh deleted file mode 100755 index 399bb3fbde184..0000000000000 --- a/build-scripts/androidbuild.sh +++ /dev/null @@ -1,106 +0,0 @@ -#!/bin/bash - -SOURCES=() -MKSOURCES="" -CURDIR=`pwd -P` - -# Fetch sources -if [[ $# -ge 2 ]]; then - for src in ${@:2} - do - SOURCES+=($src) - MKSOURCES="$MKSOURCES $(basename $src)" - done -else - if [ -n "$1" ]; then - while read src - do - SOURCES+=($src) - MKSOURCES="$MKSOURCES $(basename $src)" - done - fi -fi - -if [ -z "$1" ] || [ -z "$SOURCES" ]; then - echo "Usage: androidbuild.sh com.yourcompany.yourapp < sources.list" - echo "Usage: androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c" - echo "To copy SDL source instead of symlinking: COPYSOURCE=1 androidbuild.sh ... " - exit 1 -fi - -SDLPATH="$( cd "$(dirname "$0")/.." ; pwd -P )" - -if [ -z "$ANDROID_HOME" ];then - echo "Please set the ANDROID_HOME directory to the path of the Android SDK" - exit 1 -fi - -if [ ! -d "$ANDROID_HOME/ndk-bundle" -a -z "$ANDROID_NDK_HOME" ]; then - echo "Please set the ANDROID_NDK_HOME directory to the path of the Android NDK" - exit 1 -fi - -APP="$1" -APPARR=(${APP//./ }) -BUILDPATH="$SDLPATH/build/$APP" - -# Start Building - -rm -rf $BUILDPATH -mkdir -p $BUILDPATH - -cp -r $SDLPATH/android-project/* $BUILDPATH - -# Copy SDL sources -mkdir -p $BUILDPATH/app/jni/SDL -if [ -z "$COPYSOURCE" ]; then - ln -s $SDLPATH/src $BUILDPATH/app/jni/SDL - ln -s $SDLPATH/include $BUILDPATH/app/jni/SDL -else - cp -r $SDLPATH/src $BUILDPATH/app/jni/SDL - cp -r $SDLPATH/include $BUILDPATH/app/jni/SDL -fi - -cp -r $SDLPATH/LICENSE.txt $BUILDPATH/app/jni/SDL -cp -r $SDLPATH/README.md $BUILDPATH/app/jni/SDL -cp -r $SDLPATH/Android.mk $BUILDPATH/app/jni/SDL -cp -r $SDLPATH/CMakeLists.txt $BUILDPATH/app/jni/SDL -cp -r $SDLPATH/cmake $BUILDPATH/app/jni/SDL -sed -i -e "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/app/jni/src/Android.mk -sed -i -e "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/app/jni/src/CMakeLists.txt -sed -i -e "s|org\.libsdl\.app|$APP|g" $BUILDPATH/app/build.gradle -sed -i -e "s|org\.libsdl\.app|$APP|g" $BUILDPATH/app/src/main/AndroidManifest.xml - -# Copy user sources -for src in "${SOURCES[@]}" -do - cp $src $BUILDPATH/app/jni/src -done - -# Create an inherited Activity -cd $BUILDPATH/app/src/main/java -for folder in "${APPARR[@]}" -do - mkdir -p $folder - cd $folder -done - -# Uppercase the first char in the activity class name because it's Java -ACTIVITY="$(echo $folder | awk '{$1=toupper(substr($1,0,1))substr($1,2)}1')Activity" -sed -i -e "s|\"SDLActivity\"|\"$ACTIVITY\"|g" $BUILDPATH/app/src/main/AndroidManifest.xml - -# Fill in a default Activity -cat >"$ACTIVITY.java" <<__EOF__ -package $APP; - -import org.libsdl.app.SDLActivity; - -public class $ACTIVITY extends SDLActivity -{ -} -__EOF__ - -# Update project and build -echo "To build and install to a device for testing, run the following:" -echo "cd $BUILDPATH" -echo "./gradlew installDebug" diff --git a/build-scripts/build-release.py b/build-scripts/build-release.py index 9615f90f6eeae..c9cb821711bec 100755 --- a/build-scripts/build-release.py +++ b/build-scripts/build-release.py @@ -694,7 +694,7 @@ def create_android_archives(self, android_api: int, android_home: Path, android_ zip_object.write(test_library, arcname=f"prefab/modules/{self.project}_test/libs/android.{android_abi}/lib{self.project}_test.a") zip_object.writestr(f"prefab/modules/{self.project}_test/libs/android.{android_abi}/abi.json", self.get_prefab_abi_json_text(abi=android_abi, cpp=False, shared=False)) - self.artifacts[f"android-prefab-aar"] = aar_path + self.artifacts[f"android-aar"] = aar_path @classmethod def extract_sdl_version(cls, root: Path, project: str): diff --git a/build-scripts/create-android-project.py b/build-scripts/create-android-project.py new file mode 100755 index 0000000000000..5ab6f4086dd1a --- /dev/null +++ b/build-scripts/create-android-project.py @@ -0,0 +1,217 @@ +#!/usr/bin/env python +import os +from argparse import ArgumentParser +from pathlib import Path +import re +import shutil +import sys +import textwrap + + +SDL_ROOT = Path(__file__).resolve().parents[1] + +def extract_sdl_version(): + """ + Extract SDL version from SDL3/SDL_version.h + """ + + with open(SDL_ROOT / "include/SDL3/SDL_version.h") as f: + data = f.read() + + major = int(next(re.finditer(r"#define\s+SDL_MAJOR_VERSION\s+([0-9]+)", data)).group(1)) + minor = int(next(re.finditer(r"#define\s+SDL_MINOR_VERSION\s+([0-9]+)", data)).group(1)) + micro = int(next(re.finditer(r"#define\s+SDL_MICRO_VERSION\s+([0-9]+)", data)).group(1)) + return f"{major}.{minor}.{micro}" + +def replace_in_file(path, regex_what, replace_with): + with open(path, "r") as f: + data = f.read() + + new_data, count = re.subn(regex_what, replace_with, data) + + assert count > 0, f"\"{regex_what}\" did not match anything in \"{path}\"" + + with open(path, "w") as f: + f.write(new_data) + + +def android_mk_use_prefab(path): + """ + Replace relative SDL inclusion with dependency on prefab package + """ + + with open(path) as f: + data = "".join(line for line in f.readlines() if "# SDL" not in line) + + data, _ = re.subn("[\n]{3,}", "\n\n", data) + + newdata = data + textwrap.dedent(""" + # https://google.github.io/prefab/build-systems.html + + # Add the prefab modules to the import path. + $(call import-add-path,/out) + + # Import SDL3 so we can depend on it. + $(call import-module,prefab/SDL3) + """) + + with open(path, "w") as f: + f.write(newdata) + +def cmake_mk_no_sdl(path): + """ + Don't add the source directories of SDL/SDL_image/SDL_mixer/... + """ + + with open(path) as f: + lines = f.readlines() + + newlines = [] + for line in lines: + if "add_subdirectory(SDL" in line: + while newlines[-1].startswith("#"): + newlines = newlines[:-1] + continue + newlines.append(line) + + newdata, _ = re.subn("[\n]{3,}", "\n\n", "".join(newlines)) + + with open(path, "w") as f: + f.write(newdata) + +def gradle_add_prefab_and_aar(path, aar): + with open(path) as f: + data = f.read() + + data, count = re.subn("android {", textwrap.dedent(""" + android { + buildFeatures { + prefab true + }"""), data) + assert count == 1 + + data, count = re.subn("dependencies {", textwrap.dedent(f""" + dependencies {{ + implementation files('libs/{aar}')"""), data) + assert count == 1 + + with open(path, "w") as f: + f.write(data) + + +def main(): + description = "Create a simple Android gradle project from input sources." + epilog = "You need to manually copy a prebuilt SDL3 Android archive into the project tree when using the aar variant." + parser = ArgumentParser(description=description, allow_abbrev=False) + parser.add_argument("package_name", metavar="PACKAGENAME", help="Android package name e.g. com.yourcompany.yourapp") + parser.add_argument("sources", metavar="SOURCE", nargs="*", help="Source code of your application. The files are copied to the output directory.") + parser.add_argument("--variant", choices=["copy", "symlink", "aar"], default="copy", help="Choose variant of SDL project (copy: copy SDL sources, symlink: symlink SDL sources, aar: use Android aar archive)") + parser.add_argument("--output", "-o", default=SDL_ROOT / "build", type=Path, help="Location where to store the Android project") + parser.add_argument("--version", default=None, help="SDL3 version to use as aar dependency (only used for aar variant)") + + args = parser.parse_args() + if not args.sources: + print("Reading source file paths from stdin (press CTRL+D to stop)") + args.sources = [path for path in sys.stdin.read().strip().split() if path] + if not args.sources: + parser.error("No sources passed") + + if not os.getenv("ANDROID_HOME"): + print("WARNING: ANDROID_HOME environment variable not set", file=sys.stderr) + if not os.getenv("ANDROID_NDK_HOME"): + print("WARNING: ANDROID_NDK_HOME environment variable not set", file=sys.stderr) + + args.sources = [Path(src) for src in args.sources] + + build_path = args.output / args.package_name + + # Remove the destination folder + shutil.rmtree(build_path, ignore_errors=True) + + # Copy the Android project + shutil.copytree(SDL_ROOT / "android-project", build_path) + + # Add the source files to the ndk-build and cmake projects + replace_in_file(build_path / "app/jni/src/Android.mk", r"YourSourceHere\.c", " \\\n ".join(src.name for src in args.sources)) + replace_in_file(build_path / "app/jni/src/CMakeLists.txt", r"YourSourceHere\.c", "\n ".join(src.name for src in args.sources)) + + # Remove placeholder source "YourSourceHere.c" + (build_path / "app/jni/src/YourSourceHere.c").unlink() + + # Copy sources to output folder + for src in args.sources: + if not src.is_file(): + parser.error(f"\"{src}\" is not a file") + shutil.copyfile(src, build_path / "app/jni/src" / src.name) + + sdl_project_files = ( + SDL_ROOT / "src", + SDL_ROOT / "include", + SDL_ROOT / "LICENSE.txt", + SDL_ROOT / "README.md", + SDL_ROOT / "Android.mk", + SDL_ROOT / "CMakeLists.txt", + SDL_ROOT / "cmake", + ) + if args.variant == "copy": + (build_path / "app/jni/SDL").mkdir(exist_ok=True, parents=True) + for sdl_project_file in sdl_project_files: + # Copy SDL project files and directories + if sdl_project_file.is_dir(): + shutil.copytree(sdl_project_file, build_path / "app/jni/SDL" / sdl_project_file.name) + elif sdl_project_file.is_file(): + shutil.copyfile(sdl_project_file, build_path / "app/jni/SDL" / sdl_project_file.name) + elif args.variant == "symlink": + (build_path / "app/jni/SDL").mkdir(exist_ok=True, parents=True) + # Create symbolic links for all SDL project files + for sdl_project_file in sdl_project_files: + os.symlink(sdl_project_file, build_path / "app/jni/SDL" / sdl_project_file.name) + elif args.variant == "aar": + if not args.version: + args.version = extract_sdl_version() + + major = args.version.split(".")[0] + aar = f"SDL{ major }-{ args.version }.aar" + + # Remove all SDL java classes + shutil.rmtree(build_path / "app/src/main/java") + + # Use prefab to generate include-able files + gradle_add_prefab_and_aar(build_path / "app/build.gradle", aar=aar) + + # Make sure to use the prefab-generated files and not SDL sources + android_mk_use_prefab(build_path / "app/jni/src/Android.mk") + cmake_mk_no_sdl(build_path / "app/jni/CMakeLists.txt") + + aar_libs_folder = build_path / "app/libs" + aar_libs_folder.mkdir(parents=True) + with (aar_libs_folder / "copy-sdl-aars-here.txt").open("w") as f: + f.write(f"Copy {aar} to this folder.\n") + + print(f"WARNING: copy { aar } to { aar_libs_folder }", file=sys.stderr) + + # Create entry activity, subclassing SDLActivity + activity = args.package_name[args.package_name.rfind(".") + 1:].capitalize() + "Activity" + activity_path = build_path / "app/src/main/java" / args.package_name.replace(".", "/") / f"{activity}.java" + activity_path.parent.mkdir(parents=True) + with activity_path.open("w") as f: + f.write(textwrap.dedent(f""" + package {args.package_name}; + + import org.libsdl.app.SDLActivity; + + public class {activity} extends SDLActivity + {{ + }} + """)) + + # Add the just-generated activity to the Android manifest + replace_in_file(build_path / "app/src/main/AndroidManifest.xml", "SDLActivity", activity) + + # Update project and build + print("To build and install to a device for testing, run the following:") + print(f"cd {build_path}") + print("./gradlew installDebug") + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/docs/README-android.md b/docs/README-android.md index 2f728f5a69fc1..cb46c604f2b05 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -40,19 +40,19 @@ src/core/android/SDL_android.c Building an app ================================================================================ -For simple projects you can use the script located at build-scripts/androidbuild.sh +For simple projects you can use the script located at build-scripts/create-android-project.py There's two ways of using it: - androidbuild.sh com.yourcompany.yourapp < sources.list - androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c + ./create-android-project.py com.yourcompany.yourapp < sources.list + ./create-android-project.py com.yourcompany.yourapp source1.c source2.c ...sourceN.c sources.list should be a text file with a source file name in each line Filenames should be specified relative to the current directory, for example if you are in the build-scripts directory and want to create the testgles.c test, you'll run: - ./androidbuild.sh org.libsdl.testgles ../test/testgles.c + ./create-android-project.py org.libsdl.testgles ../test/testgles.c One limitation of this script is that all sources provided will be aggregated into a single directory, thus all your source files should have a unique name. @@ -61,7 +61,7 @@ Once the project is complete the script will tell you where the debug APK is loc If you want to create a signed release APK, you can use the project created by this utility to generate it. -Finally, a word of caution: re running androidbuild.sh wipes any changes you may have +Finally, a word of caution: re running create-android-project.py wipes any changes you may have done in the build directory for the app! From c347bee7b872908dfd8b773e44f718f077d9e977 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 12:32:50 -0700 Subject: [PATCH 164/431] Fixed IME cursor location (thanks @zturtleman!) --- src/core/linux/SDL_fcitx.c | 2 +- src/core/linux/SDL_ibus.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index f7c836e1fd1ec..8efa305561f82 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -413,7 +413,7 @@ void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window) // We'll use a square at the text input cursor location for the cursor_rect cursor->x = window->text_input_rect.x + window->text_input_cursor; - cursor->y = window->text_input_rect.x; + cursor->y = window->text_input_rect.y; cursor->w = window->text_input_rect.h; cursor->h = window->text_input_rect.h; diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index 305395430880d..dfaab70a665c0 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -694,7 +694,7 @@ void SDL_IBus_UpdateTextInputArea(SDL_Window *window) // We'll use a square at the text input cursor location for the ibus_cursor ibus_cursor_rect.x = window->text_input_rect.x + window->text_input_cursor; - ibus_cursor_rect.y = window->text_input_rect.x; + ibus_cursor_rect.y = window->text_input_rect.y; ibus_cursor_rect.w = window->text_input_rect.h; ibus_cursor_rect.h = window->text_input_rect.h; From e559b271b560e42a8c7eee3ae81a5030e7f5ed67 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 12:44:25 -0700 Subject: [PATCH 165/431] Clear the wave format so the channel map is cleared before returning from SDL_LoadWAV_IO() --- src/audio/SDL_wave.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c index 9b1c43d964ad2..a7e6b48d4dead 100644 --- a/src/audio/SDL_wave.c +++ b/src/audio/SDL_wave.c @@ -2080,6 +2080,16 @@ int SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uin int result = -1; WaveFile file; + if (spec) { + SDL_zerop(spec); + } + if (audio_buf) { + *audio_buf = NULL; + } + if (audio_len) { + *audio_len = 0; + } + /* Make sure we are passed a valid data source */ if (!src) { goto done; /* Error may come from SDL_IOStream. */ @@ -2094,9 +2104,6 @@ int SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uin goto done; } - *audio_buf = NULL; - *audio_len = 0; - SDL_zero(file); file.riffhint = WaveGetRiffSizeHint(); file.trunchint = WaveGetTruncationHint(); From 753f3f860938ae2a02fe7a7c31c00d73b37ac2c2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 15:51:20 -0700 Subject: [PATCH 166/431] Fixed crash when disconnecting external display on iOS --- src/video/uikit/SDL_uikitmodes.h | 2 +- src/video/uikit/SDL_uikitmodes.m | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/video/uikit/SDL_uikitmodes.h b/src/video/uikit/SDL_uikitmodes.h index e8f4b0371c6b8..7fa01d6c3c494 100644 --- a/src/video/uikit/SDL_uikitmodes.h +++ b/src/video/uikit/SDL_uikitmodes.h @@ -48,7 +48,7 @@ extern SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen); extern int UIKit_InitModes(SDL_VideoDevice *_this); #ifndef SDL_PLATFORM_VISIONOS extern int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event); -extern void UIKit_DelDisplay(UIScreen *uiscreen); +extern void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event); #endif extern int UIKit_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display); extern int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode); diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 8b8ada13db53c..98b84ae96619e 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -92,7 +92,7 @@ + (void)screenConnected:(NSNotification *)notification + (void)screenDisconnected:(NSNotification *)notification { UIScreen *uiscreen = [notification object]; - UIKit_DelDisplay(uiscreen); + UIKit_DelDisplay(uiscreen, SDL_TRUE); } @end @@ -308,7 +308,7 @@ int UIKit_AddDisplay(SDL_bool send_event){ #ifndef SDL_PLATFORM_VISIONOS -void UIKit_DelDisplay(UIScreen *uiscreen) +void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event) { SDL_DisplayID *displays; int i; @@ -321,7 +321,8 @@ void UIKit_DelDisplay(UIScreen *uiscreen) if (data && data.uiscreen == uiscreen) { CFRelease(display->driverdata); - SDL_DelVideoDisplay(displays[i], SDL_FALSE); + display->driverdata = NULL; + SDL_DelVideoDisplay(displays[i], send_event); break; } } From 6d64d821fb615d4d0035d98239ac78278d443aa3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 15:55:56 -0700 Subject: [PATCH 167/431] Fixed display hotplug events The add event was accidentally removed in https://github.com/libsdl-org/SDL/commit/30e176d6ba5f89cd76a533aa4f1666b232c1132c --- src/video/SDL_video.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index cd62a059d25b7..e4939cd2da2c0 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -759,7 +759,7 @@ SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send _this->displays[_this->num_displays++] = new_display; id = SDL_GetNextObjectID(); - SDL_memcpy(new_display, display, sizeof(*new_display)); + SDL_copyp(new_display, display); new_display->id = id; new_display->device = _this; if (display->name) { @@ -790,6 +790,10 @@ SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send SDL_UpdateDesktopBounds(); + if (send_event) { + SDL_SendDisplayEvent(new_display, SDL_EVENT_DISPLAY_ADDED, 0); + } + return id; } From 4ba2e9f4f4557dadd59c80487122fe700e6ae283 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 6 Jul 2024 05:29:12 -0700 Subject: [PATCH 168/431] Improved detection of Nintendo Switch Pro controller report mode Fixes https://github.com/libsdl-org/SDL/issues/10182 --- src/joystick/hidapi/SDL_hidapi_switch.c | 30 ++++++++++++++++++------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c index 8eacba6329f5c..ebf4f3c869152 100644 --- a/src/joystick/hidapi/SDL_hidapi_switch.c +++ b/src/joystick/hidapi/SDL_hidapi_switch.c @@ -337,12 +337,28 @@ typedef struct static int ReadInput(SDL_DriverSwitch_Context *ctx) { + int result; + /* Make sure we don't try to read at the same time a write is happening */ if (SDL_AtomicGet(&ctx->device->rumble_pending) > 0) { return 0; } - return SDL_hid_read_timeout(ctx->device->dev, ctx->m_rgucReadBuffer, sizeof(ctx->m_rgucReadBuffer), 0); + result = SDL_hid_read_timeout(ctx->device->dev, ctx->m_rgucReadBuffer, sizeof(ctx->m_rgucReadBuffer), 0); + + /* See if we can guess the initial input mode */ + if (result > 0 && !ctx->m_bInputOnly && !ctx->m_nInitialInputMode) { + switch (ctx->m_rgucReadBuffer[0]) { + case k_eSwitchInputReportIDs_FullControllerState: + case k_eSwitchInputReportIDs_FullControllerAndMcuState: + case k_eSwitchInputReportIDs_SimpleControllerState: + ctx->m_nInitialInputMode = ctx->m_rgucReadBuffer[0]; + break; + default: + break; + } + } + return result; } static int WriteOutput(SDL_DriverSwitch_Context *ctx, const Uint8 *data, int size) @@ -738,14 +754,12 @@ static void SDLCALL SDL_PlayerLEDHintChanged(void *userdata, const char *name, c } } -static Uint8 GetInitialInputMode(SDL_DriverSwitch_Context *ctx) +static void GetInitialInputMode(SDL_DriverSwitch_Context *ctx) { - Uint8 input_mode = 0; - - if (ReadInput(ctx) > 0) { - input_mode = ctx->m_rgucReadBuffer[0]; + if (!ctx->m_nInitialInputMode) { + /* This will set the initial input mode if it can */ + ReadInput(ctx); } - return input_mode; } static Uint8 GetDefaultInputMode(SDL_DriverSwitch_Context *ctx) @@ -1391,7 +1405,7 @@ static SDL_bool HIDAPI_DriverSwitch_OpenJoystick(SDL_HIDAPI_Device *device, SDL_ ctx->m_bSyncWrite = SDL_TRUE; if (!ctx->m_bInputOnly) { - ctx->m_nInitialInputMode = GetInitialInputMode(ctx); + GetInitialInputMode(ctx); ctx->m_nCurrentInputMode = ctx->m_nInitialInputMode; /* Initialize rumble data */ From e52603ac8f602a065e0808431c4aa668baa13c41 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 6 Jul 2024 05:32:31 -0700 Subject: [PATCH 169/431] Support format conversion and YUV surfaces in SDL_SoftStretch() These are slow paths, but at least they'll do the right thing now. Fixes https://github.com/libsdl-org/SDL/issues/9496 --- src/video/SDL_stretch.c | 46 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index fb97cf6f65fc9..1778ccc0403f2 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -35,9 +35,53 @@ int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Rect full_src; SDL_Rect full_dst; + if (!src) { + return SDL_InvalidParamError("src"); + } + if (!dst) { + return SDL_InvalidParamError("dst"); + } if (src->format->format != dst->format->format) { - return SDL_SetError("Only works with same format surfaces"); + // Slow! + SDL_Surface *src_tmp = SDL_ConvertSurfaceFormat(src, dst->format->format); + if (!src_tmp) { + return -1; + } + ret = SDL_SoftStretch(src_tmp, srcrect, dst, dstrect, scaleMode); + SDL_DestroySurface(src_tmp); + return ret; + } + + if (SDL_ISPIXELFORMAT_FOURCC(src->format->format)) { + // Slow! + if (!dstrect) { + full_dst.x = 0; + full_dst.y = 0; + full_dst.w = dst->w; + full_dst.h = dst->h; + dstrect = &full_dst; + } + + SDL_Surface *src_tmp = SDL_ConvertSurfaceFormat(src, SDL_PIXELFORMAT_XRGB8888); + SDL_Surface *dst_tmp = SDL_CreateSurface(dstrect->w, dstrect->h, SDL_PIXELFORMAT_XRGB8888); + if (src_tmp && dst_tmp) { + ret = SDL_SoftStretch(src_tmp, srcrect, dst_tmp, NULL, scaleMode); + if (ret == 0) { + SDL_Colorspace dst_colorspace = SDL_COLORSPACE_UNKNOWN; + SDL_GetSurfaceColorspace(dst, &dst_colorspace); + SDL_ConvertPixelsAndColorspace(dstrect->w, dstrect->h, + dst_tmp->format->format, SDL_COLORSPACE_SRGB, 0, + dst_tmp->pixels, dst_tmp->pitch, + dst->format->format, dst_colorspace, SDL_GetSurfaceProperties(dst), + (Uint8 *)dst->pixels + dstrect->y * dst->pitch + dstrect->x * dst->format->bytes_per_pixel, dst->pitch); + } + } else { + ret = -1; + } + SDL_DestroySurface(src_tmp); + SDL_DestroySurface(dst_tmp); + return ret; } if (scaleMode != SDL_SCALEMODE_NEAREST && scaleMode != SDL_SCALEMODE_LINEAR && scaleMode != SDL_SCALEMODE_BEST) { From 0fa74d8aa8a35950a8d3a611e71968d61bcfd150 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 6 Jul 2024 05:53:40 -0700 Subject: [PATCH 170/431] Wiki-compatible documentation for SDL_ALPHA_OPAQUE and SDL_ALPHA_TRANSPARENT --- include/SDL3/SDL_pixels.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index db0e2db36b4ee..ec758d8d82fb1 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -39,14 +39,22 @@ extern "C" { #endif /** - * \name Transparency definitions + * A fully opaque 8-bit alpha value. * - * These define alpha as the opacity of a surface. + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_ALPHA_TRANSPARENT */ -/* @{ */ #define SDL_ALPHA_OPAQUE 255 + +/** + * A fully transparent 8-bit alpha value. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_ALPHA_OPAQUE + */ #define SDL_ALPHA_TRANSPARENT 0 -/* @} */ /** Pixel type. */ typedef enum SDL_PixelType From be43dec79848e5dc16ec0767ee691eb62b0819b4 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 5 Jul 2024 21:06:05 +0200 Subject: [PATCH 171/431] sdlprocdump: store context and exception record in minidump --- test/win32/sdlprocdump.c | 82 +++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c index c23a4625e3a9e..7034297bee43c 100644 --- a/test/win32/sdlprocdump.c +++ b/test/win32/sdlprocdump.c @@ -181,10 +181,11 @@ static const char *get_simple_basename(const char *path) { return path; } -static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMATION process_information, DWORD dwThreadId) { +static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMATION process_information, DWORD dwThreadId, PEXCEPTION_RECORD exception_record, PCONTEXT context) { BOOL success; char dump_file_path[MAX_PATH]; char child_file_name[64]; + EXCEPTION_POINTERS exception_pointers; HANDLE hFile = INVALID_HANDLE_VALUE; HMODULE dbghelp_module = NULL; MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information; @@ -221,8 +222,11 @@ static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMAT printf_windows_message("Failed to open file for minidump"); goto post_dump; } + memset(&exception_pointers, 0, sizeof(exception_pointers)); + exception_pointers.ContextRecord = context; + exception_pointers.ExceptionRecord = exception_record; minidump_exception_information.ClientPointers = FALSE; - minidump_exception_information.ExceptionPointers = FALSE; + minidump_exception_information.ExceptionPointers = &exception_pointers; minidump_exception_information.ThreadId = dwThreadId; success = dyn_dbghelp.pMiniDumpWriteDump( process_information->hProcess, /* HANDLE hProcess */ @@ -244,11 +248,13 @@ static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMAT } } -static void print_stacktrace(const LPPROCESS_INFORMATION process_information, LPVOID address) { +static void print_stacktrace(const LPPROCESS_INFORMATION process_information, PCONTEXT context, LPVOID address) { STACKFRAME64 stack_frame; - CONTEXT context; - HANDLE thread_handle = NULL; + if (!context) { + printf_message("Cannot create a stacktrace without a context"); + return; + } if (!dyn_dbghelp.pStackWalk64) { printf_message("Cannot find StackWalk64 in dbghelp.dll: no stacktrace"); return; @@ -274,19 +280,6 @@ static void print_stacktrace(const LPPROCESS_INFORMATION process_information, LP return; } - thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, process_information->dwThreadId); - if (!thread_handle) { - printf_windows_message("OpenThread failed: no stacktrace"); - goto cleanup; - } - - memset(&context, 0, sizeof(context)); - context.ContextFlags = CONTEXT_ALL; - if (!GetThreadContext(thread_handle, &context)) { - printf_windows_message("GetThreadContext failed: no stacktrace"); - goto cleanup; - } - if (!dyn_dbghelp.pSymRefreshModuleList || !dyn_dbghelp.pSymRefreshModuleList(process_information->hProcess)) { printf_windows_message("SymRefreshModuleList failed: maybe no stacktrace"); } @@ -299,24 +292,24 @@ static void print_stacktrace(const LPPROCESS_INFORMATION process_information, LP #if defined(SDLPROCDUMP_CPU_X86) DWORD machine_type = IMAGE_FILE_MACHINE_I386; - stack_frame.AddrFrame.Offset = context.Ebp; - stack_frame.AddrStack.Offset = context.Esp; - stack_frame.AddrPC.Offset = context.Eip; + stack_frame.AddrFrame.Offset = context->Ebp; + stack_frame.AddrStack.Offset = context->Esp; + stack_frame.AddrPC.Offset = context->Eip; #elif defined(SDLPROCDUMP_CPU_X64) DWORD machine_type = IMAGE_FILE_MACHINE_AMD64; - stack_frame.AddrFrame.Offset = context.Rbp; - stack_frame.AddrStack.Offset = context.Rsp; - stack_frame.AddrPC.Offset = context.Rip; + stack_frame.AddrFrame.Offset = context->Rbp; + stack_frame.AddrStack.Offset = context->Rsp; + stack_frame.AddrPC.Offset = context->Rip; #elif defined(SDLPROCDUMP_CPU_ARM32) DWORD machine_type = IMAGE_FILE_MACHINE_ARM; - stack_frame.AddrFrame.Offset = context.Lr; - stack_frame.AddrStack.Offset = context.Sp; - stack_frame.AddrPC.Offset = context.Pc; + stack_frame.AddrFrame.Offset = context->Lr; + stack_frame.AddrStack.Offset = context->Sp; + stack_frame.AddrPC.Offset = context->Pc; #elif defined(SDLPROCDUMP_CPU_ARM64) DWORD machine_type = IMAGE_FILE_MACHINE_ARM64; - stack_frame.AddrFrame.Offset = context.Fp; - stack_frame.AddrStack.Offset = context.Sp; - stack_frame.AddrPC.Offset = context.Pc; + stack_frame.AddrFrame.Offset = context->Fp; + stack_frame.AddrStack.Offset = context->Sp; + stack_frame.AddrPC.Offset = context->Pc; #endif while (dyn_dbghelp.pStackWalk64(machine_type, /* DWORD MachineType */ process_information->hProcess, /* HANDLE hProcess */ @@ -374,12 +367,26 @@ static void print_stacktrace(const LPPROCESS_INFORMATION process_information, LP } printf_message("%s!%s+0x%x %s %s", image_file_name, symbol_name, dwDisplacement, file_name, line_number); } +} -cleanup: - if (thread_handle) { +static PCONTEXT FillInThreadContext(LPPROCESS_INFORMATION process_information, PCONTEXT context_buffer) { + HANDLE thread_handle = NULL; + + thread_handle = OpenThread(THREAD_ALL_ACCESS, FALSE, process_information->dwThreadId); + if (!thread_handle) { + printf_windows_message("OpenThread failed: no stacktrace"); + return NULL; + } + + memset(context_buffer, 0, sizeof(*context_buffer)); + context_buffer->ContextFlags = CONTEXT_ALL; + if (!GetThreadContext(thread_handle, context_buffer)) { + printf_windows_message("GetThreadContext failed: no stacktrace"); CloseHandle(thread_handle); + return NULL; } - return; + CloseHandle(thread_handle); + return context_buffer; } int main(int argc, char *argv[]) { @@ -454,6 +461,9 @@ int main(int argc, char *argv[]) { switch (event.dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: if (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)) { + CONTEXT context_buffer; + PCONTEXT context; + printf_message("EXCEPTION_DEBUG_EVENT"); printf_message(" ExceptionCode: 0x%08lx (%s)", event.u.Exception.ExceptionRecord.ExceptionCode, @@ -463,10 +473,12 @@ int main(int argc, char *argv[]) { printf_message(" ExceptionAddress: 0x%08lx", event.u.Exception.ExceptionRecord.ExceptionAddress); printf_message(" (Non-continuable exception debug event)"); - write_minidump(argv[1], &process_information, event.dwThreadId); + + context = FillInThreadContext(&process_information, &context_buffer); + write_minidump(argv[1], &process_information, event.dwThreadId, &event.u.Exception.ExceptionRecord, context); printf_message(""); #ifdef SDLPROCDUMP_PRINTSTACK - print_stacktrace(&process_information, event.u.Exception.ExceptionRecord.ExceptionAddress); + print_stacktrace(&process_information, event.u.Exception.ExceptionRecord.ExceptionAddress, context); #else printf_message("No support for printing stacktrack for current architecture"); #endif From fbb5652d3ec5f04175c458442fc231857dab8e23 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Sat, 6 Jul 2024 11:45:04 -0400 Subject: [PATCH 172/431] video: Document that SDL_RaiseWindow is a request and subject to window manager policy The result of SDL_RaiseWindow is ultimately subject to window manager policy, particularly if the request would result in stealing focus from another window. Document that this is only a request, and if successful, will result in a focus gained event along with the input focus flag being set on the window. --- include/SDL3/SDL_video.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index d536396102978..ee85f44ee7c15 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -1709,7 +1709,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window); extern SDL_DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window); /** - * Raise a window above other windows and set the input focus. + * Request that a window be raised above other windows and gain the input focus. + * + * The result of this request is subject to desktop window manager policy, + * particularly if raising the requested window would result in stealing focus + * from another application. If the window is successfully raised and gains input + * focus, an SDL_EVENT_WINDOW_FOCUS_GAINED event will be emitted, and the window + * will have the SDL_WINDOW_INPUT_FOCUS flag set. * * \param window the window to raise. * \returns 0 on success or a negative error code on failure; call From f3ac2d9d4f37c2f5c39781fe9a42701287073d2a Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 6 Jul 2024 15:46:41 +0000 Subject: [PATCH 173/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_video.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index ee85f44ee7c15..bd0d726dd972d 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -1709,13 +1709,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ShowWindow(SDL_Window *window); extern SDL_DECLSPEC int SDLCALL SDL_HideWindow(SDL_Window *window); /** - * Request that a window be raised above other windows and gain the input focus. + * Request that a window be raised above other windows and gain the input + * focus. * * The result of this request is subject to desktop window manager policy, * particularly if raising the requested window would result in stealing focus - * from another application. If the window is successfully raised and gains input - * focus, an SDL_EVENT_WINDOW_FOCUS_GAINED event will be emitted, and the window - * will have the SDL_WINDOW_INPUT_FOCUS flag set. + * from another application. If the window is successfully raised and gains + * input focus, an SDL_EVENT_WINDOW_FOCUS_GAINED event will be emitted, and + * the window will have the SDL_WINDOW_INPUT_FOCUS flag set. * * \param window the window to raise. * \returns 0 on success or a negative error code on failure; call From 938971291761ba8ea1e776347cb1cf3dafe6d549 Mon Sep 17 00:00:00 2001 From: mariob92 <89140037+mariob92@users.noreply.github.com> Date: Sat, 6 Jul 2024 20:23:03 +0200 Subject: [PATCH 174/431] wgl/glx: Fix attribute list for SDL_GL_FLOATBUFFERS This commit fixes the attribute list in the WGL and GLX code when requesting a floating point pixel format. The name of the attribute was missing in the list. Fixes libsdl-org#10189 --- src/video/windows/SDL_windowsopengl.c | 1 + src/video/x11/SDL_x11opengl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c index 57fa7ec5499ad..0c6a2a9ff8f76 100644 --- a/src/video/windows/SDL_windowsopengl.c +++ b/src/video/windows/SDL_windowsopengl.c @@ -641,6 +641,7 @@ static int WIN_GL_SetupWindowInternal(SDL_VideoDevice *_this, SDL_Window *window } if (_this->gl_config.floatbuffers) { + *iAttr++ = WGL_PIXEL_TYPE_ARB; *iAttr++ = WGL_TYPE_RGBA_FLOAT_ARB; } diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 44a6c1e7723a3..5eb75a8588cf8 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -571,6 +571,7 @@ static int X11_GL_GetAttributes(SDL_VideoDevice *_this, Display *display, int sc } if (_this->gl_config.floatbuffers) { + attribs[i++] = GLX_RENDER_TYPE; attribs[i++] = GLX_RGBA_FLOAT_TYPE_ARB; } From 3c90b1c1f62c6757e85037934ef24caeebf58e2d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 6 Jul 2024 07:34:49 -0700 Subject: [PATCH 175/431] Switch pixel format loss fields to number of bits This makes more sense and handles pixel formats with > 8 bits per channel Fixes https://github.com/libsdl-org/SDL/issues/10168 --- include/SDL3/SDL_pixels.h | 8 ++--- src/test/SDL_test_compare.c | 8 ++--- src/video/SDL_RLEaccel.c | 28 +++++++-------- src/video/SDL_blit.c | 3 +- src/video/SDL_blit.h | 38 ++++++++++---------- src/video/SDL_blit_A.c | 2 +- src/video/SDL_blit_N.c | 4 +-- src/video/SDL_pixels.c | 68 ++++++++++++++++++++---------------- test/testautomation_pixels.c | 5 +++ 9 files changed, 88 insertions(+), 76 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index ec758d8d82fb1..29e512d936e3b 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -751,10 +751,10 @@ typedef struct SDL_PixelFormat Uint32 Gmask; Uint32 Bmask; Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; + Uint8 Rbits; + Uint8 Gbits; + Uint8 Bbits; + Uint8 Abits; Uint8 Rshift; Uint8 Gshift; Uint8 Bshift; diff --git a/src/test/SDL_test_compare.c b/src/test/SDL_test_compare.c index db2fd04772072..404b303d5438a 100644 --- a/src/test/SDL_test_compare.c +++ b/src/test/SDL_test_compare.c @@ -38,10 +38,10 @@ LogErrorFormat(const char *name, const SDL_PixelFormat *format) { SDLTest_LogError("%s: %08d %s, %u bits/%u bytes per pixel", name, format->format, SDL_GetPixelFormatName(format->format), format->bits_per_pixel, format->bytes_per_pixel); - SDLTest_LogError("%s: R mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Rmask, format->Rloss, format->Rshift); - SDLTest_LogError("%s: G mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Gmask, format->Gloss, format->Gshift); - SDLTest_LogError("%s: B mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Bmask, format->Bloss, format->Bshift); - SDLTest_LogError("%s: A mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Amask, format->Aloss, format->Ashift); + SDLTest_LogError("%s: R mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Rmask, format->Rbits, format->Rshift); + SDLTest_LogError("%s: G mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Gmask, format->Gbits, format->Gshift); + SDLTest_LogError("%s: B mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Bmask, format->Bbits, format->Bshift); + SDLTest_LogError("%s: A mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Amask, format->Abits, format->Ashift); } /* Compare surfaces */ diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 3d6830408000b..0e17ae1d43789 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -373,12 +373,12 @@ * Set a pixel value using the given format, except that the alpha value is * placed in the top byte. This is the format used for RLE with alpha. */ -#define RLEPIXEL_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 << 24); \ +#define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ + { \ + Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ + ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ + ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ + (a << 24); \ } /* @@ -614,10 +614,10 @@ typedef struct Uint32 Gmask; Uint32 Bmask; Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; + Uint8 Rbits; + Uint8 Gbits; + Uint8 Bbits; + Uint8 Abits; Uint8 Rshift; Uint8 Gshift; Uint8 Bshift; @@ -1091,10 +1091,10 @@ static int RLEAlphaSurface(SDL_Surface *surface) r->Gmask = df->Gmask; r->Bmask = df->Bmask; r->Amask = df->Amask; - r->Rloss = df->Rloss; - r->Gloss = df->Gloss; - r->Bloss = df->Bloss; - r->Aloss = df->Aloss; + r->Rbits = df->Rbits; + r->Gbits = df->Gbits; + r->Bbits = df->Bbits; + r->Abits = df->Abits; r->Rshift = df->Rshift; r->Gshift = df->Gshift; r->Bshift = df->Bshift; diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index 4297976312b92..3bb17ca430964 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -232,7 +232,8 @@ int SDL_CalculateBlit(SDL_Surface *surface) if (!blit) { if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) { blit = SDL_BlitCopy; - } else if (surface->format->Rloss > 8 || dst->format->Rloss > 8) { + } else if (SDL_ISPIXELFORMAT_10BIT(surface->format->format) || + SDL_ISPIXELFORMAT_10BIT(dst->format->format)) { blit = SDL_Blit_Slow; } #if SDL_HAVE_BLIT_0 diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index ba5b95904e3a1..0f3bf43efe60d 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -128,9 +128,9 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* Load pixel of the specified format from a buffer and get its R-G-B values */ #define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ { \ - r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + r = SDL_expand_byte[fmt->Rbits][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gbits][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bbits][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ } #define RGB_FROM_RGB565(Pixel, r, g, b) \ { \ @@ -222,12 +222,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } while (0) /* Assemble R-G-B values into a specified pixel format and store them */ -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ - { \ - Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ - ((g >> fmt->Gloss) << fmt->Gshift) | \ - ((b >> fmt->Bloss) << fmt->Bshift) | \ - fmt->Amask; \ +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ + { \ + Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ + ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ + ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ + fmt->Amask; \ } #define RGB565_FROM_RGB(Pixel, r, g, b) \ { \ @@ -340,10 +340,10 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* FIXME: Should we rescale alpha into 0..255 here? */ #define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ { \ - r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ - a = SDL_expand_byte[fmt->Aloss][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ + r = SDL_expand_byte[fmt->Rbits][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gbits][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bbits][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + a = SDL_expand_byte[fmt->Abits][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ } #define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ { \ @@ -450,12 +450,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } while (0) /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ -#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ - { \ - Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ - ((g >> fmt->Gloss) << fmt->Gshift) | \ - ((b >> fmt->Bloss) << fmt->Bshift) | \ - ((a >> fmt->Aloss) << fmt->Ashift); \ +#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ + { \ + Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ + ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ + ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ + ((a >> (8 - fmt->Abits)) << fmt->Ashift); \ } #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ { \ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 083e85663be4c..7cc60c6f7ee21 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1360,7 +1360,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) case 4: if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->bytes_per_pixel == 4) { #ifdef SDL_MMX_INTRINSICS - if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Aloss == 0) { + if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Abits == 8) { if (SDL_HasMMX()) { return BlitRGBtoRGBPixelAlphaMMX; } diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 64a051e1489d3..17f846fedda90 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -2066,7 +2066,7 @@ static void Blit_RGB555_ARGB1555(SDL_BlitInfo *info) int dstskip = info->dst_skip; SDL_PixelFormat *dstfmt = info->dst_fmt; - Uint16 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift; + Uint16 mask = ((Uint32)info->a >> (8 - dstfmt->Abits)) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ @@ -2188,7 +2188,7 @@ static void Blit4to4MaskAlpha(SDL_BlitInfo *info) if (dstfmt->Amask) { /* RGB->RGBA, SET_ALPHA */ - Uint32 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift; + Uint32 mask = ((Uint32)info->a >> (8 - dstfmt->Abits)) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 0e06737a5d94e..e78f7965bc17a 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -31,19 +31,19 @@ /* Lookup tables to expand partial bytes to the full 0..255 range */ static const Uint8 lookup_0[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 255 }; static const Uint8 lookup_1[] = { - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 + 0, 255 }; static const Uint8 lookup_2[] = { - 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 + 0, 85, 170, 255 }; static const Uint8 lookup_3[] = { - 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 + 0, 36, 72, 109, 145, 182, 218, 255 }; static const Uint8 lookup_4[] = { @@ -51,19 +51,19 @@ static const Uint8 lookup_4[] = { }; static const Uint8 lookup_5[] = { - 0, 36, 72, 109, 145, 182, 218, 255 + 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 }; static const Uint8 lookup_6[] = { - 0, 85, 170, 255 + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 }; static const Uint8 lookup_7[] = { - 0, 255 + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 }; static const Uint8 lookup_8[] = { - 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; const Uint8 *SDL_expand_byte[9] = { @@ -639,49 +639,49 @@ int SDL_InitFormat(SDL_PixelFormat *format, SDL_PixelFormatEnum pixel_format) format->Rmask = Rmask; format->Rshift = 0; - format->Rloss = 8; + format->Rbits = 0; if (Rmask) { for (mask = Rmask; !(mask & 0x01); mask >>= 1) { ++format->Rshift; } - for (; (mask & 0x01) && format->Rloss; mask >>= 1) { - --format->Rloss; + for (; (mask & 0x01); mask >>= 1) { + ++format->Rbits; } } format->Gmask = Gmask; format->Gshift = 0; - format->Gloss = 8; + format->Gbits = 0; if (Gmask) { for (mask = Gmask; !(mask & 0x01); mask >>= 1) { ++format->Gshift; } - for (; (mask & 0x01) && format->Gloss; mask >>= 1) { - --format->Gloss; + for (; (mask & 0x01); mask >>= 1) { + ++format->Gbits; } } format->Bmask = Bmask; format->Bshift = 0; - format->Bloss = 8; + format->Bbits = 0; if (Bmask) { for (mask = Bmask; !(mask & 0x01); mask >>= 1) { ++format->Bshift; } - for (; (mask & 0x01) && format->Bloss; mask >>= 1) { - --format->Bloss; + for (; (mask & 0x01); mask >>= 1) { + ++format->Bbits; } } format->Amask = Amask; format->Ashift = 0; - format->Aloss = 8; + format->Abits = 0; if (Amask) { for (mask = Amask; !(mask & 0x01); mask >>= 1) { ++format->Ashift; } - for (; (mask & 0x01) && format->Aloss; mask >>= 1) { - --format->Aloss; + for (; (mask & 0x01); mask >>= 1) { + ++format->Abits; } } @@ -1249,7 +1249,10 @@ Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | format->Amask; } else { - return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask; + return ((Uint32)(r >> (8 - format->Rbits))) << format->Rshift | + ((Uint32)(g >> (8 - format->Gbits))) << format->Gshift | + ((Uint32)(b >> (8 - format->Bbits))) << format->Bshift | + format->Amask; } } @@ -1267,9 +1270,12 @@ Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, return (((Uint32)SDL_expand_byte_10[r]) << format->Rshift) | (((Uint32)SDL_expand_byte_10[g]) << format->Gshift) | (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | - ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); + ((((Uint32)(a >> (8 - format->Abits))) << format->Ashift) & format->Amask); } else { - return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); + return ((Uint32)(r >> (8 - format->Rbits))) << format->Rshift | + ((Uint32)(g >> (8 - format->Gbits))) << format->Gshift | + ((Uint32)(b >> (8 - format->Bbits))) << format->Bshift | + ((((Uint32)(a >> (8 - format->Abits))) << format->Ashift) & format->Amask); } } @@ -1295,11 +1301,11 @@ void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, } else { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; - *r = SDL_expand_byte[format->Rloss][v]; + *r = SDL_expand_byte[format->Rbits][v]; v = (pixel & format->Gmask) >> format->Gshift; - *g = SDL_expand_byte[format->Gloss][v]; + *g = SDL_expand_byte[format->Gbits][v]; v = (pixel & format->Bmask) >> format->Bshift; - *b = SDL_expand_byte[format->Bloss][v]; + *b = SDL_expand_byte[format->Bbits][v]; } } @@ -1324,17 +1330,17 @@ void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, v = (pixel & format->Bmask) >> format->Bshift; *b = (Uint8)(v >> 2); v = (pixel & format->Amask) >> format->Ashift; - *a = SDL_expand_byte[format->Aloss][v]; + *a = SDL_expand_byte[format->Abits][v]; } else { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; - *r = SDL_expand_byte[format->Rloss][v]; + *r = SDL_expand_byte[format->Rbits][v]; v = (pixel & format->Gmask) >> format->Gshift; - *g = SDL_expand_byte[format->Gloss][v]; + *g = SDL_expand_byte[format->Gbits][v]; v = (pixel & format->Bmask) >> format->Bshift; - *b = SDL_expand_byte[format->Bloss][v]; + *b = SDL_expand_byte[format->Bbits][v]; v = (pixel & format->Amask) >> format->Ashift; - *a = SDL_expand_byte[format->Aloss][v]; + *a = SDL_expand_byte[format->Abits][v]; } } diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c index 6814b66fcc975..5c2cc8f323fd6 100644 --- a/test/testautomation_pixels.c +++ b/test/testautomation_pixels.c @@ -175,6 +175,11 @@ static int pixels_allocFreeFormat(void *arg) if (!SDL_ISPIXELFORMAT_INDEXED(format)) { masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks); + if (SDL_ISPIXELFORMAT_10BIT(format)) { + SDLTest_AssertCheck(result->Rbits == 10 && result->Gbits == 10 && result->Bbits == 10, "Verify value of result.[RGB]bits; expected: 10, got %d/%d/%d", result->Rbits, result->Gbits, result->Bbits); + } else if (SDL_BITSPERPIXEL(format) == 32) { + SDLTest_AssertCheck(result->Rbits == 8 && result->Gbits == 8 && result->Bbits == 8, "Verify value of result.[RGB]bits; expected: 8, got %d/%d/%d", result->Rbits, result->Gbits, result->Bbits); + } } } From a057240984a25105e053a5576e2149c05c865da0 Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni <7008900+sinkingsugar@users.noreply.github.com> Date: Sun, 7 Jul 2024 11:22:06 +0800 Subject: [PATCH 176/431] Fix vision os fake screen size It never really worked, as the value was arbitrary, digging apple docs showed the right values. --- src/video/uikit/SDL_uikitmodes.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/video/uikit/SDL_uikitmodes.h b/src/video/uikit/SDL_uikitmodes.h index 7fa01d6c3c494..75bb3b831a367 100644 --- a/src/video/uikit/SDL_uikitmodes.h +++ b/src/video/uikit/SDL_uikitmodes.h @@ -56,10 +56,12 @@ extern void UIKit_QuitModes(SDL_VideoDevice *_this); extern int UIKit_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect); // because visionOS does not have a screen -// we create a fake 1080p display to maintain compatibility. +// we create a fake display to maintain compatibility. +// By default, a window measures 1280x720 pt. +// https://developer.apple.com/design/human-interface-guidelines/windows#visionOS #ifdef SDL_PLATFORM_VISIONOS -#define SDL_XR_SCREENWIDTH 1920 -#define SDL_XR_SCREENHEIGHT 1080 +#define SDL_XR_SCREENWIDTH 1280 +#define SDL_XR_SCREENHEIGHT 720 #endif #endif /* SDL_uikitmodes_h_ */ From e37d6f71b3a60c14ba93cc1e01152deb8a371680 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 7 Jul 2024 18:02:15 +0000 Subject: [PATCH 177/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 31c184c72a36e..c31c0fae4d378 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -3714,7 +3714,7 @@ extern "C" { * A variable specifying the URL to a WinRT app's privacy policy. * * All network-enabled WinRT apps must make a privacy policy available to its - * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be be + * users. On Windows 8, 8.1, and RT, Microsoft mandates that this policy be * available in the Windows Settings charm, as accessed from within the app. * SDL provides code to add a URL-based link there, which can point to the * app's privacy policy. From bfa4e71284a38817ff5660eedef4a99faa8f0294 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 7 Jul 2024 18:05:35 +0000 Subject: [PATCH 178/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_hints.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index c31c0fae4d378..4c63c6f735dee 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2754,7 +2754,7 @@ extern "C" { * * This is useful as a debug tool to validate memory leaks, but shouldn't ever * be set in production applications, as other libraries used by the - * application might use dbus under the hood and this cause cause crashes if + * application might use dbus under the hood and this can cause crashes if * they continue after SDL_Quit(). * * The variable can be set to the following values: From 4d6b23b68fd1726873dfd84071478fc007563da2 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 6 Jul 2024 17:10:02 +0200 Subject: [PATCH 179/431] mingw: use DESTDIR to change the install location of the mingw package --- mingw/pkg-support/INSTALL.txt | 21 +++++++++++------ mingw/pkg-support/Makefile | 43 ++++++++++++++++++++++------------- 2 files changed, 41 insertions(+), 23 deletions(-) diff --git a/mingw/pkg-support/INSTALL.txt b/mingw/pkg-support/INSTALL.txt index 607dafd0ee0a7..61dc062e86dc7 100644 --- a/mingw/pkg-support/INSTALL.txt +++ b/mingw/pkg-support/INSTALL.txt @@ -2,17 +2,24 @@ The 32-bit files are in i686-w64-mingw32 The 64-bit files are in x86_64-w64-mingw32 -To install SDL for native development: - make native +To install SDL for 32-bit x86 executables (i686): + make install-i686 -To install SDL for cross-compiling development: - make cross +To install SDL for 64-bit x86 executables (x86_64): + make install-x86_64 + +To install both: + make install-all + +Use DESTDIR to change the target location + mkdir $HOME/mingw32-prefix + make install-i686 DESTDIR=$HOME/mingw32-prefix Look at the example programs in ./test, and check out online documentation: - http://wiki.libsdl.org/ + https://wiki.libsdl.org/SDL3/FrontPage -Join the SDL developer mailing list if you want to join the community: - http://www.libsdl.org/mailing-list.php +Join the SDL discourse server if you want to join the community: + https://discourse.libsdl.org/ That's it! Sam Lantinga diff --git a/mingw/pkg-support/Makefile b/mingw/pkg-support/Makefile index 19732d7d24c61..ff8d01f81eef2 100644 --- a/mingw/pkg-support/Makefile +++ b/mingw/pkg-support/Makefile @@ -1,26 +1,37 @@ # # Makefile for installing the mingw32 version of the SDL library -CROSS_PATH := /usr/local +DESTDIR = /usr/local ARCHITECTURES := i686-w64-mingw32 x86_64-w64-mingw32 -all install: - @echo "Type \"make native\" to install 32-bit to /usr" - @echo "Type \"make cross\" to install 32-bit and 64-bit to $(CROSS_PATH)" +default: + @echo "Run \"make install-i686\" to install 32-bit" + @echo "Run \"make install-x86_64\" to install 64-bit" + @echo "Run \"make install-all\" to install both" + @echo "Add DESTDIR=/custom/path to change the destination folder" -native: - make install-package arch=i686-w64-mingw32 prefix=/usr +install: + @if test -d $(ARCH) && test -d $(DESTDIR); then \ + (cd $(ARCH) && cp -rv bin include lib share $(DESTDIR)/); \ + else \ + echo "*** ERROR: $(ARCH) or $(DESTDIR) does not exist!"; \ + exit 1; \ + fi -cross: - for arch in $(ARCHITECTURES); do \ - make install-package arch=$$arch prefix=$(CROSS_PATH)/$$arch; \ - done +install-i686: + $(MAKE) install ARCH=i686-w64-mingw32 -install-package: - @if test -d $(arch) && test -d $(prefix); then \ - (cd $(arch) && cp -rv bin include lib share $(prefix)/); \ - sed "s|^prefix=.*|prefix=$(prefix)|" <$(arch)/lib/pkgconfig/sdl3.pc >$(prefix)/lib/pkgconfig/sdl3.pc; \ +install-x86_64: + $(MAKE) install ARCH=x86_64-w64-mingw32 + +install-all: + @if test -d $(DESTDIR); then \ + for arch in $(ARCHITECTURES); do \ + $(MAKE) install ARCH=$$arch DESTDIR=$(DESTDIR)/$$arch; \ + done \ else \ - echo "*** ERROR: $(arch) or $(prefix) does not exist!"; \ - exit 1; \ + echo "*** ERROR: $(DESTDIR) does not exist!"; \ + exit 1; \ fi + +.PHONY: default install install-i686 install-x86_64 install-all From 18c9bd21b5c225b98226e3730948ef86e41cc4d8 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 7 Jul 2024 21:18:16 +0200 Subject: [PATCH 180/431] sdlprocdump: become C90 compatible --- test/CMakeLists.txt | 1 + test/win32/sdlprocdump.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 202599efa301b..e98f4c954da12 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -41,6 +41,7 @@ file(GLOB RESOURCE_FILES *.bmp *.wav *.hex moose.dat utf8.txt) if(WIN32 AND NOT WINDOWS_STORE) option(SDLTEST_PROCDUMP "Run tests using sdlprocdump for minidump generation" OFF) add_executable(sdlprocdump win32/sdlprocdump.c) + set_property(TARGET sdlprocdump PROPERTY C_STANDARD "90") SDL_AddCommonCompilerFlags(sdlprocdump) if(SDLTEST_PROCDUMP) set(CMAKE_TEST_LAUNCHER "$") diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c index 7034297bee43c..edcb1369b7861 100644 --- a/test/win32/sdlprocdump.c +++ b/test/win32/sdlprocdump.c @@ -37,6 +37,8 @@ static void printf_message(const char *format, ...) { static void printf_windows_message(const char *format, ...) { va_list ap; char win_msg[512]; + size_t win_msg_len; + FormatMessageA( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, @@ -44,7 +46,7 @@ static void printf_windows_message(const char *format, ...) { MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), win_msg, sizeof(win_msg)/sizeof(*win_msg), NULL); - size_t win_msg_len = strlen(win_msg); + win_msg_len = strlen(win_msg); while (win_msg[win_msg_len-1] == '\r' || win_msg[win_msg_len-1] == '\n' || win_msg[win_msg_len-1] == ' ') { win_msg[win_msg_len-1] = '\0'; win_msg_len--; @@ -250,6 +252,7 @@ static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMAT static void print_stacktrace(const LPPROCESS_INFORMATION process_information, PCONTEXT context, LPVOID address) { STACKFRAME64 stack_frame; + DWORD machine_type; if (!context) { printf_message("Cannot create a stacktrace without a context"); @@ -291,22 +294,22 @@ static void print_stacktrace(const LPPROCESS_INFORMATION process_information, PC stack_frame.AddrStack.Mode = AddrModeFlat; #if defined(SDLPROCDUMP_CPU_X86) - DWORD machine_type = IMAGE_FILE_MACHINE_I386; + machine_type = IMAGE_FILE_MACHINE_I386; stack_frame.AddrFrame.Offset = context->Ebp; stack_frame.AddrStack.Offset = context->Esp; stack_frame.AddrPC.Offset = context->Eip; #elif defined(SDLPROCDUMP_CPU_X64) - DWORD machine_type = IMAGE_FILE_MACHINE_AMD64; + machine_type = IMAGE_FILE_MACHINE_AMD64; stack_frame.AddrFrame.Offset = context->Rbp; stack_frame.AddrStack.Offset = context->Rsp; stack_frame.AddrPC.Offset = context->Rip; #elif defined(SDLPROCDUMP_CPU_ARM32) - DWORD machine_type = IMAGE_FILE_MACHINE_ARM; + machine_type = IMAGE_FILE_MACHINE_ARM; stack_frame.AddrFrame.Offset = context->Lr; stack_frame.AddrStack.Offset = context->Sp; stack_frame.AddrPC.Offset = context->Pc; #elif defined(SDLPROCDUMP_CPU_ARM64) - DWORD machine_type = IMAGE_FILE_MACHINE_ARM64; + machine_type = IMAGE_FILE_MACHINE_ARM64; stack_frame.AddrFrame.Offset = context->Fp; stack_frame.AddrStack.Offset = context->Sp; stack_frame.AddrPC.Offset = context->Pc; From 4fa5196820a5b043096d2e72330a015fa3e46c30 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 7 Jul 2024 19:41:05 -0700 Subject: [PATCH 181/431] Revert "Switch pixel format loss fields to number of bits" This reverts commit 3c90b1c1f62c6757e85037934ef24caeebf58e2d. It turns out this is problematic for sdl2-compat. We're investigating a more complete separation between SDL2 and SDL3 surfaces, but in the meantime, I'll fix the breakage. --- include/SDL3/SDL_pixels.h | 8 ++--- src/test/SDL_test_compare.c | 8 ++--- src/video/SDL_RLEaccel.c | 28 +++++++-------- src/video/SDL_blit.c | 3 +- src/video/SDL_blit.h | 38 ++++++++++---------- src/video/SDL_blit_A.c | 2 +- src/video/SDL_blit_N.c | 4 +-- src/video/SDL_pixels.c | 68 ++++++++++++++++-------------------- test/testautomation_pixels.c | 5 --- 9 files changed, 76 insertions(+), 88 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 29e512d936e3b..ec758d8d82fb1 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -751,10 +751,10 @@ typedef struct SDL_PixelFormat Uint32 Gmask; Uint32 Bmask; Uint32 Amask; - Uint8 Rbits; - Uint8 Gbits; - Uint8 Bbits; - Uint8 Abits; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; Uint8 Rshift; Uint8 Gshift; Uint8 Bshift; diff --git a/src/test/SDL_test_compare.c b/src/test/SDL_test_compare.c index 404b303d5438a..db2fd04772072 100644 --- a/src/test/SDL_test_compare.c +++ b/src/test/SDL_test_compare.c @@ -38,10 +38,10 @@ LogErrorFormat(const char *name, const SDL_PixelFormat *format) { SDLTest_LogError("%s: %08d %s, %u bits/%u bytes per pixel", name, format->format, SDL_GetPixelFormatName(format->format), format->bits_per_pixel, format->bytes_per_pixel); - SDLTest_LogError("%s: R mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Rmask, format->Rbits, format->Rshift); - SDLTest_LogError("%s: G mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Gmask, format->Gbits, format->Gshift); - SDLTest_LogError("%s: B mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Bmask, format->Bbits, format->Bshift); - SDLTest_LogError("%s: A mask %08" SDL_PRIx32 ", bits %u, shift %u", name, format->Amask, format->Abits, format->Ashift); + SDLTest_LogError("%s: R mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Rmask, format->Rloss, format->Rshift); + SDLTest_LogError("%s: G mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Gmask, format->Gloss, format->Gshift); + SDLTest_LogError("%s: B mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Bmask, format->Bloss, format->Bshift); + SDLTest_LogError("%s: A mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Amask, format->Aloss, format->Ashift); } /* Compare surfaces */ diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 0e17ae1d43789..3d6830408000b 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -373,12 +373,12 @@ * Set a pixel value using the given format, except that the alpha value is * placed in the top byte. This is the format used for RLE with alpha. */ -#define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ - { \ - Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ - ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ - ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ - (a << 24); \ +#define RLEPIXEL_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 << 24); \ } /* @@ -614,10 +614,10 @@ typedef struct Uint32 Gmask; Uint32 Bmask; Uint32 Amask; - Uint8 Rbits; - Uint8 Gbits; - Uint8 Bbits; - Uint8 Abits; + Uint8 Rloss; + Uint8 Gloss; + Uint8 Bloss; + Uint8 Aloss; Uint8 Rshift; Uint8 Gshift; Uint8 Bshift; @@ -1091,10 +1091,10 @@ static int RLEAlphaSurface(SDL_Surface *surface) r->Gmask = df->Gmask; r->Bmask = df->Bmask; r->Amask = df->Amask; - r->Rbits = df->Rbits; - r->Gbits = df->Gbits; - r->Bbits = df->Bbits; - r->Abits = df->Abits; + r->Rloss = df->Rloss; + r->Gloss = df->Gloss; + r->Bloss = df->Bloss; + r->Aloss = df->Aloss; r->Rshift = df->Rshift; r->Gshift = df->Gshift; r->Bshift = df->Bshift; diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index 3bb17ca430964..4297976312b92 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -232,8 +232,7 @@ int SDL_CalculateBlit(SDL_Surface *surface) if (!blit) { if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) { blit = SDL_BlitCopy; - } else if (SDL_ISPIXELFORMAT_10BIT(surface->format->format) || - SDL_ISPIXELFORMAT_10BIT(dst->format->format)) { + } else if (surface->format->Rloss > 8 || dst->format->Rloss > 8) { blit = SDL_Blit_Slow; } #if SDL_HAVE_BLIT_0 diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 0f3bf43efe60d..ba5b95904e3a1 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -128,9 +128,9 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* Load pixel of the specified format from a buffer and get its R-G-B values */ #define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ { \ - r = SDL_expand_byte[fmt->Rbits][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gbits][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bbits][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ } #define RGB_FROM_RGB565(Pixel, r, g, b) \ { \ @@ -222,12 +222,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } while (0) /* Assemble R-G-B values into a specified pixel format and store them */ -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ - { \ - Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ - ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ - ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ - fmt->Amask; \ +#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) | \ + fmt->Amask; \ } #define RGB565_FROM_RGB(Pixel, r, g, b) \ { \ @@ -340,10 +340,10 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* FIXME: Should we rescale alpha into 0..255 here? */ #define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ { \ - r = SDL_expand_byte[fmt->Rbits][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gbits][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bbits][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ - a = SDL_expand_byte[fmt->Abits][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ + r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + a = SDL_expand_byte[fmt->Aloss][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ } #define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ { \ @@ -450,12 +450,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } while (0) /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ -#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ - { \ - Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ - ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ - ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ - ((a >> (8 - fmt->Abits)) << fmt->Ashift); \ +#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); \ } #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ { \ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 7cc60c6f7ee21..083e85663be4c 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1360,7 +1360,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) case 4: if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->bytes_per_pixel == 4) { #ifdef SDL_MMX_INTRINSICS - if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Abits == 8) { + if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Aloss == 0) { if (SDL_HasMMX()) { return BlitRGBtoRGBPixelAlphaMMX; } diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 17f846fedda90..64a051e1489d3 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -2066,7 +2066,7 @@ static void Blit_RGB555_ARGB1555(SDL_BlitInfo *info) int dstskip = info->dst_skip; SDL_PixelFormat *dstfmt = info->dst_fmt; - Uint16 mask = ((Uint32)info->a >> (8 - dstfmt->Abits)) << dstfmt->Ashift; + Uint16 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ @@ -2188,7 +2188,7 @@ static void Blit4to4MaskAlpha(SDL_BlitInfo *info) if (dstfmt->Amask) { /* RGB->RGBA, SET_ALPHA */ - Uint32 mask = ((Uint32)info->a >> (8 - dstfmt->Abits)) << dstfmt->Ashift; + Uint32 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index e78f7965bc17a..0e06737a5d94e 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -31,19 +31,19 @@ /* Lookup tables to expand partial bytes to the full 0..255 range */ static const Uint8 lookup_0[] = { - 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; static const Uint8 lookup_1[] = { - 0, 255 + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 }; static const Uint8 lookup_2[] = { - 0, 85, 170, 255 + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 }; static const Uint8 lookup_3[] = { - 0, 36, 72, 109, 145, 182, 218, 255 + 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 }; static const Uint8 lookup_4[] = { @@ -51,19 +51,19 @@ static const Uint8 lookup_4[] = { }; static const Uint8 lookup_5[] = { - 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 + 0, 36, 72, 109, 145, 182, 218, 255 }; static const Uint8 lookup_6[] = { - 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 + 0, 85, 170, 255 }; static const Uint8 lookup_7[] = { - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 + 0, 255 }; static const Uint8 lookup_8[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 255 }; const Uint8 *SDL_expand_byte[9] = { @@ -639,49 +639,49 @@ int SDL_InitFormat(SDL_PixelFormat *format, SDL_PixelFormatEnum pixel_format) format->Rmask = Rmask; format->Rshift = 0; - format->Rbits = 0; + format->Rloss = 8; if (Rmask) { for (mask = Rmask; !(mask & 0x01); mask >>= 1) { ++format->Rshift; } - for (; (mask & 0x01); mask >>= 1) { - ++format->Rbits; + for (; (mask & 0x01) && format->Rloss; mask >>= 1) { + --format->Rloss; } } format->Gmask = Gmask; format->Gshift = 0; - format->Gbits = 0; + format->Gloss = 8; if (Gmask) { for (mask = Gmask; !(mask & 0x01); mask >>= 1) { ++format->Gshift; } - for (; (mask & 0x01); mask >>= 1) { - ++format->Gbits; + for (; (mask & 0x01) && format->Gloss; mask >>= 1) { + --format->Gloss; } } format->Bmask = Bmask; format->Bshift = 0; - format->Bbits = 0; + format->Bloss = 8; if (Bmask) { for (mask = Bmask; !(mask & 0x01); mask >>= 1) { ++format->Bshift; } - for (; (mask & 0x01); mask >>= 1) { - ++format->Bbits; + for (; (mask & 0x01) && format->Bloss; mask >>= 1) { + --format->Bloss; } } format->Amask = Amask; format->Ashift = 0; - format->Abits = 0; + format->Aloss = 8; if (Amask) { for (mask = Amask; !(mask & 0x01); mask >>= 1) { ++format->Ashift; } - for (; (mask & 0x01); mask >>= 1) { - ++format->Abits; + for (; (mask & 0x01) && format->Aloss; mask >>= 1) { + --format->Aloss; } } @@ -1249,10 +1249,7 @@ Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | format->Amask; } else { - return ((Uint32)(r >> (8 - format->Rbits))) << format->Rshift | - ((Uint32)(g >> (8 - format->Gbits))) << format->Gshift | - ((Uint32)(b >> (8 - format->Bbits))) << format->Bshift | - format->Amask; + return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask; } } @@ -1270,12 +1267,9 @@ Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, return (((Uint32)SDL_expand_byte_10[r]) << format->Rshift) | (((Uint32)SDL_expand_byte_10[g]) << format->Gshift) | (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | - ((((Uint32)(a >> (8 - format->Abits))) << format->Ashift) & format->Amask); + ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); } else { - return ((Uint32)(r >> (8 - format->Rbits))) << format->Rshift | - ((Uint32)(g >> (8 - format->Gbits))) << format->Gshift | - ((Uint32)(b >> (8 - format->Bbits))) << format->Bshift | - ((((Uint32)(a >> (8 - format->Abits))) << format->Ashift) & format->Amask); + return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); } } @@ -1301,11 +1295,11 @@ void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, } else { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; - *r = SDL_expand_byte[format->Rbits][v]; + *r = SDL_expand_byte[format->Rloss][v]; v = (pixel & format->Gmask) >> format->Gshift; - *g = SDL_expand_byte[format->Gbits][v]; + *g = SDL_expand_byte[format->Gloss][v]; v = (pixel & format->Bmask) >> format->Bshift; - *b = SDL_expand_byte[format->Bbits][v]; + *b = SDL_expand_byte[format->Bloss][v]; } } @@ -1330,17 +1324,17 @@ void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, v = (pixel & format->Bmask) >> format->Bshift; *b = (Uint8)(v >> 2); v = (pixel & format->Amask) >> format->Ashift; - *a = SDL_expand_byte[format->Abits][v]; + *a = SDL_expand_byte[format->Aloss][v]; } else { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; - *r = SDL_expand_byte[format->Rbits][v]; + *r = SDL_expand_byte[format->Rloss][v]; v = (pixel & format->Gmask) >> format->Gshift; - *g = SDL_expand_byte[format->Gbits][v]; + *g = SDL_expand_byte[format->Gloss][v]; v = (pixel & format->Bmask) >> format->Bshift; - *b = SDL_expand_byte[format->Bbits][v]; + *b = SDL_expand_byte[format->Bloss][v]; v = (pixel & format->Amask) >> format->Ashift; - *a = SDL_expand_byte[format->Abits][v]; + *a = SDL_expand_byte[format->Aloss][v]; } } diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c index 5c2cc8f323fd6..6814b66fcc975 100644 --- a/test/testautomation_pixels.c +++ b/test/testautomation_pixels.c @@ -175,11 +175,6 @@ static int pixels_allocFreeFormat(void *arg) if (!SDL_ISPIXELFORMAT_INDEXED(format)) { masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks); - if (SDL_ISPIXELFORMAT_10BIT(format)) { - SDLTest_AssertCheck(result->Rbits == 10 && result->Gbits == 10 && result->Bbits == 10, "Verify value of result.[RGB]bits; expected: 10, got %d/%d/%d", result->Rbits, result->Gbits, result->Bbits); - } else if (SDL_BITSPERPIXEL(format) == 32) { - SDLTest_AssertCheck(result->Rbits == 8 && result->Gbits == 8 && result->Bbits == 8, "Verify value of result.[RGB]bits; expected: 8, got %d/%d/%d", result->Rbits, result->Gbits, result->Bbits); - } } } From 159d7087c6224908e489dbc826d5c802b62b89d6 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 26 Jun 2024 16:15:04 -0400 Subject: [PATCH 182/431] wayland: Only set the window geometry when viewports are unsupported Setting the window geometry on the xdg-toplevel path is a hack used to prevent protocol violations if a buffer with an old size is committed. Since viewports decouple the window geometry from the buffer size, this is not needed if viewports are supported. Fixes an invalid window geometry warning and incorrect window overview size for fullscreen windows in GNOME. --- src/video/wayland/SDL_waylandwindow.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 9a5ab6c6e2c65..93d9bb3144abf 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -407,8 +407,11 @@ static void ConfigureWindowGeometry(SDL_Window *window) * need to be recalculated if the output size has changed. */ if (window_size_changed) { - /* libdecor does this internally on frame commits, so it's only needed for xdg surfaces. */ - if (data->shell_surface_type != WAYLAND_SURFACE_LIBDECOR && data->shell_surface.xdg.surface) { + /* XXX: This is a hack and only set on the xdg-toplevel path when viewports + * aren't supported to avoid a potential protocol violation if a buffer + * with an old size is committed. + */ + if (!data->viewport && data->shell_surface_type == WAYLAND_SURFACE_XDG_TOPLEVEL && data->shell_surface.xdg.surface) { xdg_surface_set_window_geometry(data->shell_surface.xdg.surface, 0, 0, data->current.logical_width, data->current.logical_height); } @@ -1830,9 +1833,6 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) &decoration_listener, window); } - - /* Set the geometry */ - xdg_surface_set_window_geometry(data->shell_surface.xdg.surface, 0, 0, data->current.logical_width, data->current.logical_height); } else { /* Nothing to see here, just commit. */ wl_surface_commit(data->surface); From 3e0581c62587ba76c62f3c5f05e6dee2000c1537 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Sat, 8 Jun 2024 22:26:23 -0500 Subject: [PATCH 183/431] Merge upstream and sdl3-blitters --- CMakeLists.txt | 2 + VisualC-GDK/SDL/SDL.vcxproj | 6 +- VisualC-GDK/SDL/SDL.vcxproj.filters | 8 +- VisualC/SDL/SDL.vcxproj | 4 + VisualC/SDL/SDL.vcxproj.filters | 19 +++- src/video/SDL_blit_A.c | 30 ++++++ src/video/intrin/SDL_blit_A_avx2.c | 126 +++++++++++++++++++++++ src/video/intrin/SDL_blit_A_avx2.h | 7 ++ src/video/intrin/SDL_blit_A_sse4.1.h | 24 +++++ src/video/intrin/SDL_blit_A_sse4_1.c | 146 +++++++++++++++++++++++++++ 10 files changed, 369 insertions(+), 3 deletions(-) create mode 100644 src/video/intrin/SDL_blit_A_avx2.c create mode 100644 src/video/intrin/SDL_blit_A_avx2.h create mode 100644 src/video/intrin/SDL_blit_A_sse4.1.h create mode 100644 src/video/intrin/SDL_blit_A_sse4_1.c diff --git a/CMakeLists.txt b/CMakeLists.txt index a40bc609a4c14..f5fa4e2c4d7c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -739,6 +739,7 @@ if(SDL_ASSEMBLY) cmake_pop_check_state() if(COMPILER_SUPPORTS_SSE4_1) set(HAVE_SSE4_1 TRUE) + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/intrin/SDL_blit_A_sse4_1.c") endif() endif() if(SDL_SSE4_2) @@ -802,6 +803,7 @@ if(SDL_ASSEMBLY) return 0; }" COMPILER_SUPPORTS_AVX2) cmake_pop_check_state() + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/intrin/SDL_blit_A_*.c") if(COMPILER_SUPPORTS_AVX2) set(HAVE_AVX2 TRUE) endif() diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 67e74896cd06d..6c47cbaf10f26 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -529,6 +529,8 @@ + + @@ -817,6 +819,8 @@ $(IntDir)$(TargetName)_cpp.pch $(IntDir)$(TargetName)_cpp.pch + + @@ -863,4 +867,4 @@ - + \ No newline at end of file diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 478d401f0c9ed..873aa2e51f38c 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -458,8 +458,14 @@ + + video\intrin + + + video\intrin + - + \ No newline at end of file diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 879c607e8dd80..914895231d951 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -429,6 +429,8 @@ + + @@ -669,6 +671,8 @@ + + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 93db4f199448a..82944ba417c0f 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -172,6 +172,9 @@ {f48c2b17-1bee-4fec-a7c8-24cf619abe08} + + {653672cc-90ae-4eba-a256-6479f2c31804} + {00001967ea2801028a046a722a070000} @@ -868,6 +871,13 @@ + + video\intrin + + + video\intrin + + @@ -1515,6 +1525,13 @@ stdlib + + video\intrin + + + video\intrin + + @@ -1549,4 +1566,4 @@ - + \ No newline at end of file diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 083e85663be4c..5e35c9c7bbb62 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -24,6 +24,16 @@ #include "SDL_blit.h" +#ifdef SDL_SSE4_1_INTRINSICS +#include "intrin/SDL_blit_A_sse4.1.h" +#endif +#ifdef SDL_AVX2_INTRINSICS +#include "intrin/SDL_blit_A_avx2.h" +#endif +#if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) +#include "SDL3/SDL_cpuinfo.h" +#endif + /* Functions to perform alpha blended blitting */ /* N->1 blending with per-surface alpha */ @@ -1296,6 +1306,20 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) srcbpp = srcfmt->bytes_per_pixel; dstbpp = dstfmt->bytes_per_pixel; +#ifdef SDL_AVX2_INTRINSICS + if (srcbpp == 4 && dstbpp == 4 && width >= 4 && SDL_HasAVX2()) { + BlitNtoNPixelAlpha_AVX2(info); + return; + } +#endif + +#ifdef SDL_SSE4_1_INTRINSICS + if (srcbpp == 4 && dstbpp == 4 && width >= 2 && SDL_HasSSE41()) { + BlitNtoNPixelAlpha_SSE4_1(info); + return; + } +#endif + while (height--) { /* *INDENT-OFF* */ /* clang-format off */ DUFFS_LOOP4( @@ -1358,6 +1382,11 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) return BlitNtoNPixelAlpha; case 4: +#if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) + if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4) { + return BlitNtoNPixelAlpha; + } +#endif if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->bytes_per_pixel == 4) { #ifdef SDL_MMX_INTRINSICS if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Aloss == 0) { @@ -1469,3 +1498,4 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } #endif /* SDL_HAVE_BLIT_A */ + diff --git a/src/video/intrin/SDL_blit_A_avx2.c b/src/video/intrin/SDL_blit_A_avx2.c new file mode 100644 index 0000000000000..e9ebaa994ae99 --- /dev/null +++ b/src/video/intrin/SDL_blit_A_avx2.c @@ -0,0 +1,126 @@ +#include "SDL_internal.h" + +#if SDL_HAVE_BLIT_A + +#ifdef SDL_AVX2_INTRINSICS + +#include "../SDL_blit.h" +#include "SDL_blit_A_sse4.1.h" + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("avx2"))) +#endif +/** + * Using the AVX2 instruction set, blit eight pixels with alpha blending + * @param src A pointer to four 32-bit pixels of ARGB format to blit into dst + * @param dst A pointer to four 32-bit pixels of ARGB format to retain visual data for while alpha blending + * @return A 128-bit wide vector of four alpha-blended pixels in ARGB format + */ +__m128i MixRGBA_AVX2(__m128i src, __m128i dst) { + __m256i src_color = _mm256_cvtepu8_epi16(src); + __m256i dst_color = _mm256_cvtepu8_epi16(dst); + const __m256i SHUFFLE_ALPHA = _mm256_set_epi8( + -1, 30, -1, 30, -1, 30, -1, 30, + -1, 22, -1, 22, -1, 22, -1, 22, + -1, 14, -1, 14, -1, 14, -1, 14, + -1, 6, -1, 6, -1, 6, -1, 6); + __m256i alpha = _mm256_shuffle_epi8(src_color, SHUFFLE_ALPHA); + __m256i sub = _mm256_sub_epi16(src_color, dst_color); + __m256i mul = _mm256_mullo_epi16(sub, alpha); + /** + * With an 8-bit shuffle, one can only move integers within a lane. The 256-bit AVX2 lane is actually 4 64-bit + * lanes. We pack the integers into the start of each lane. The second shuffle operates on these 64-bit integers to + * put them into the correct order for transport back to the surface in the correct format. + */ + const __m256i SHUFFLE_REDUCE = _mm256_set_epi8( + -1, -1, -1, -1, -1, -1, -1, -1, + 31, 29, 27, 25, 23, 21, 19, 17, + -1, -1, -1, -1, -1, -1, -1, -1, + 15, 13, 11, 9, 7, 5, 3, 1); + __m256i reduced = _mm256_shuffle_epi8(mul, SHUFFLE_REDUCE); + __m256i packed = _mm256_permute4x64_epi64(reduced, _MM_SHUFFLE(3, 1, 2, 0)); + __m128i mix = _mm256_castsi256_si128(packed); + return _mm_add_epi8(mix, dst); +} + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("avx2"))) +#endif +void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + + int chunks = width / 4; + Uint8 *buf = SDL_malloc(sizeof(Uint8) * chunks * 16); + + while (height--) { + /* Process 4-wide chunks of source color data that may be in wrong format */ + for (int i = 0; i < chunks; i += 1) { + __m128i c_src = convertPixelFormatsx4(_mm_loadu_si128((__m128i*) (src + i * 16)), srcfmt); + _mm_store_si128((__m128i*)(buf + i * 16), c_src); + } + + /* Alpha-blend in 4-wide chunk from src into destination */ + for (int i = 0; i < chunks; i += 1) { + __m128i c_src = _mm_loadu_si128((__m128i*) (buf + i * 16)); + __m128i c_dst = _mm_loadu_si128((__m128i*) (dst + i * 16)); + __m128i c_mix = MixRGBA_AVX2(c_src, c_dst); + _mm_storeu_si128((__m128i*) (dst + i * 16), c_mix); + } + + /* Handle remaining pixels when width is not a multiple of 4 */ + if (width % 4 != 0) { + int remaining_pixels = width % 4; + int offset = width - remaining_pixels; + if (remaining_pixels >= 2) { + Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); + Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); + __m128i c_src = _mm_loadu_si64(src_ptr); + c_src = convertPixelFormatsx4(c_src, srcfmt); + __m128i c_dst = _mm_loadu_si64(dst_ptr); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); + _mm_storeu_si64(dst_ptr, c_mix); + remaining_pixels -= 2; + offset += 2; + } + if (remaining_pixels == 1) { + Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); + Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); + Uint32 pixel = convertPixelFormat(*src_ptr, srcfmt); + /* Old GCC has bad or no _mm_loadu_si32 */ + #if defined(__GNUC__) && (__GNUC__ < 11) + __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); + __m128i c_dst = _mm_set_epi32(0, 0, 0, *dst_ptr); + #else + __m128i c_src = _mm_loadu_si32(&pixel); + __m128i c_dst = _mm_loadu_si32(dst_ptr); + #endif + __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst); + /* Old GCC has bad or no _mm_storeu_si32 */ + #if defined(__GNUC__) && (__GNUC__ < 11) + *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); + #else + _mm_storeu_si32(dst_ptr, mixed_pixel); + #endif + } + } + + src += 4 * width; + dst += 4 * width; + + src += srcskip; + dst += dstskip; + } + SDL_free(buf); + +} + +#endif + +#endif diff --git a/src/video/intrin/SDL_blit_A_avx2.h b/src/video/intrin/SDL_blit_A_avx2.h new file mode 100644 index 0000000000000..c3fc7b1117ea0 --- /dev/null +++ b/src/video/intrin/SDL_blit_A_avx2.h @@ -0,0 +1,7 @@ +#ifndef SDL_SDL_BLIT_A_AVX2_H +#define SDL_SDL_BLIT_A_AVX2_H +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("avx2"))) +#endif +void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info); +#endif //SDL_SDL_BLIT_A_AVX2_H diff --git a/src/video/intrin/SDL_blit_A_sse4.1.h b/src/video/intrin/SDL_blit_A_sse4.1.h new file mode 100644 index 0000000000000..47be0dd5828a4 --- /dev/null +++ b/src/video/intrin/SDL_blit_A_sse4.1.h @@ -0,0 +1,24 @@ +#ifndef SDL_SDL_BLIT_A_SSE4_1_H +#define SDL_SDL_BLIT_A_SSE4_1_H + +#ifdef SDL_SSE4_1_INTRINSICS +Uint32 convertPixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat); + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("sse4.1"))) +#endif +__m128i convertPixelFormatsx4(__m128i colors, const SDL_PixelFormat* srcFormat); + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("sse4.1"))) +#endif +__m128i MixRGBA_SSE4_1(__m128i src, __m128i dst); + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("sse4.1"))) +#endif +void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); + +#endif + +#endif //SDL_SDL_BLIT_A_SSE4_1_H diff --git a/src/video/intrin/SDL_blit_A_sse4_1.c b/src/video/intrin/SDL_blit_A_sse4_1.c new file mode 100644 index 0000000000000..2e7d9139162da --- /dev/null +++ b/src/video/intrin/SDL_blit_A_sse4_1.c @@ -0,0 +1,146 @@ +#include "SDL_internal.h" + +#if SDL_HAVE_BLIT_A + +#ifdef SDL_SSE4_1_INTRINSICS + +#include "../SDL_blit.h" + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("sse4.1"))) +#endif +/** + * Using the SSE4.1 instruction set, blit four pixels with alpha blending + * @param src A pointer to two 32-bit pixels of ARGB format to blit into dst + * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending + * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format + */ +__m128i MixRGBA_SSE4_1(__m128i src, __m128i dst) { + __m128i src_color = _mm_cvtepu8_epi16(src); + __m128i dst_color = _mm_cvtepu8_epi16(dst); + /** + * Combines a shuffle and an _mm_cvtepu8_epi16 operation into one operation by moving the lower 8 bits of the alpha + * channel around to create 16-bit integers. + */ + const __m128i SHUFFLE_ALPHA = _mm_set_epi8( + -1, 7, -1, 7, -1, 7, -1, 7, + -1, 3, -1, 3, -1, 3, -1, 3); + __m128i alpha = _mm_shuffle_epi8(src, SHUFFLE_ALPHA); + __m128i sub = _mm_sub_epi16(src_color, dst_color); + __m128i mul = _mm_mullo_epi16(sub, alpha); + const __m128i SHUFFLE_REDUCE = _mm_set_epi8( + -1, -1, -1, -1, -1, -1, -1, -1, + 15, 13, 11, 9, 7, 5, 3, 1); + __m128i reduced = _mm_shuffle_epi8(mul, SHUFFLE_REDUCE); + + return _mm_add_epi8(reduced, dst); +} + +Uint32 convertPixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat) { + Uint8 a = (color >> srcFormat->Ashift) & 0xFF; + Uint8 r = (color >> srcFormat->Rshift) & 0xFF; + Uint8 g = (color >> srcFormat->Gshift) & 0xFF; + Uint8 b = (color >> srcFormat->Bshift) & 0xFF; + + return (a << 24) | (r << 16) | (g << 8) | b; +} + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("sse4.1"))) +#endif +/* + * This helper function converts arbitrary pixel format data into ARGB form with a 4 pixel-wide shuffle + */ +__m128i convertPixelFormatsx4(__m128i colors, const SDL_PixelFormat* srcFormat) { + // Create shuffle masks based on the source SDL_PixelFormat to ARGB + __m128i srcShuffleMask = _mm_set_epi8( + srcFormat->Ashift / 8 + 12, srcFormat->Rshift / 8 + 12, srcFormat->Gshift / 8 + 12, srcFormat->Bshift / 8 + 12, + srcFormat->Ashift / 8 + 8, srcFormat->Rshift / 8 + 8, srcFormat->Gshift / 8 + 8, srcFormat->Bshift / 8 + 8, + srcFormat->Ashift / 8 + 4, srcFormat->Rshift / 8 + 4, srcFormat->Gshift / 8 + 4, srcFormat->Bshift / 8 + 4, + srcFormat->Ashift / 8, srcFormat->Rshift / 8, srcFormat->Gshift / 8, srcFormat->Bshift / 8 + ); + + // Shuffle the colors + return _mm_shuffle_epi8(colors, srcShuffleMask); +} + +#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) +__attribute__((target("sse4.1"))) +#endif +void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + + int chunks = width / 4; + Uint8 *buffer = (Uint8*)SDL_malloc(chunks * 16 * sizeof(Uint8)); + + while (height--) { + /* Process 4-wide chunks of source color data that may be in wrong format into buffer */ + for (int i = 0; i < chunks; i += 1) { + __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); + _mm_storeu_si128((__m128i*)(buffer + i * 16), convertPixelFormatsx4(colors, srcfmt)); + } + + /* Alpha-blend in 2-wide chunks from buffer into destination */ + for (int i = 0; i < chunks * 2; i += 1) { + __m128i c_src = _mm_loadu_si64((buffer + (i * 8))); + __m128i c_dst = _mm_loadu_si64((dst + i * 8)); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); + _mm_storeu_si64(dst + i * 8, c_mix); + } + + /* Handle remaining pixels when width is not a multiple of 4 */ + if (width % 4 != 0) { + int remaining_pixels = width % 4; + int offset = width - remaining_pixels; + if (remaining_pixels >= 2) { + Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); + Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); + __m128i c_src = _mm_loadu_si64(src_ptr); + c_src = convertPixelFormatsx4(c_src, srcfmt); + __m128i c_dst = _mm_loadu_si64(dst_ptr); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); + _mm_storeu_si64(dst_ptr, c_mix); + remaining_pixels -= 2; + offset += 2; + } + if (remaining_pixels == 1) { + Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); + Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); + Uint32 pixel = convertPixelFormat(*src_ptr, srcfmt); + /* Old GCC has bad or no _mm_loadu_si32 */ + #if defined(__GNUC__) && (__GNUC__ < 11) + __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); + __m128i c_dst = _mm_set_epi32(0, 0, 0, *dst_ptr); + #else + __m128i c_src = _mm_loadu_si32(&pixel); + __m128i c_dst = _mm_loadu_si32(dst_ptr); + #endif + __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst); + /* Old GCC has bad or no _mm_storeu_si32 */ + #if defined(__GNUC__) && (__GNUC__ < 11) + *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); + #else + _mm_storeu_si32(dst_ptr, mixed_pixel); + #endif + } + } + + src += 4 * width; + dst += 4 * width; + + src += srcskip; + dst += dstskip; + } + + SDL_free(buffer); +} + +#endif + +#endif From f68a7edcf8187ba326232a4d4377de66e68a6638 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 5 Sep 2023 23:03:00 -0500 Subject: [PATCH 184/431] Properly shortcut only when AVX2 or SSE4.1 available --- src/video/SDL_blit_A.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 5e35c9c7bbb62..7a5757100e399 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1383,7 +1383,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) case 4: #if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) - if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4) { + if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && (SDL_HasAVX2() || SDL_HasSSE41())) { return BlitNtoNPixelAlpha; } #endif From 735cf5a6f9301b19fff8b22006457a1f32421d54 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 5 Sep 2023 23:48:52 -0500 Subject: [PATCH 185/431] Relocate intrinsic modules to src/video/ --- CMakeLists.txt | 11 ++++++++--- VisualC-GDK/SDL/SDL.vcxproj | 8 ++++---- VisualC-GDK/SDL/SDL.vcxproj.filters | 8 ++++---- VisualC/SDL/SDL.vcxproj | 6 ++++-- VisualC/SDL/SDL.vcxproj.filters | 16 ++++++++-------- src/video/SDL_blit_A.c | 4 ++-- src/video/{intrin => }/SDL_blit_A_avx2.c | 4 ++-- src/video/{intrin => }/SDL_blit_A_avx2.h | 0 src/video/{intrin => }/SDL_blit_A_sse4_1.c | 2 +- .../SDL_blit_A_sse4.1.h => SDL_blit_A_sse4_1.h} | 0 10 files changed, 33 insertions(+), 26 deletions(-) rename src/video/{intrin => }/SDL_blit_A_avx2.c (98%) rename src/video/{intrin => }/SDL_blit_A_avx2.h (100%) rename src/video/{intrin => }/SDL_blit_A_sse4_1.c (99%) rename src/video/{intrin/SDL_blit_A_sse4.1.h => SDL_blit_A_sse4_1.h} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5fa4e2c4d7c6..27223d7f66d10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -498,7 +498,6 @@ sdl_glob_sources( "${SDL3_SOURCE_DIR}/src/thread/*.c" "${SDL3_SOURCE_DIR}/src/time/*.c" "${SDL3_SOURCE_DIR}/src/timer/*.c" - "${SDL3_SOURCE_DIR}/src/video/*.c" "${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.c" ) if(MSVC AND TARGET SDL3-shared) @@ -514,6 +513,12 @@ if(MSVC AND TARGET SDL3-shared) endif() endif() +# Exclude intrinsinc modules from general builds +file(GLOB video_sources "${SDL3_SOURCE_DIR}/src/video/*.c") +list(FILTER video_sources EXCLUDE REGEX "SDL_blit_A_avx2.c$") +list(FILTER video_sources EXCLUDE REGEX "SDL_blit_A_sse4_1.c$") +sdl_glob_sources(${video_sources}) + if(USE_INTELCC) # warning #39: division by zero # warning #239: floating point underflow @@ -739,7 +744,7 @@ if(SDL_ASSEMBLY) cmake_pop_check_state() if(COMPILER_SUPPORTS_SSE4_1) set(HAVE_SSE4_1 TRUE) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/intrin/SDL_blit_A_sse4_1.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/SDL_blit_A_sse4_1.c") endif() endif() if(SDL_SSE4_2) @@ -803,7 +808,7 @@ if(SDL_ASSEMBLY) return 0; }" COMPILER_SUPPORTS_AVX2) cmake_pop_check_state() - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/intrin/SDL_blit_A_*.c") + sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/SDL_blit_A_*.c") if(COMPILER_SUPPORTS_AVX2) set(HAVE_AVX2 TRUE) endif() diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 6c47cbaf10f26..28c678bb5218f 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -529,8 +529,6 @@ - - @@ -553,6 +551,8 @@ + + @@ -819,13 +819,13 @@ $(IntDir)$(TargetName)_cpp.pch $(IntDir)$(TargetName)_cpp.pch - - + + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 873aa2e51f38c..06543fe5df551 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -458,11 +458,11 @@ - - video\intrin + + video - - video\intrin + + video diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 914895231d951..be171d4b3e3d2 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -429,8 +429,6 @@ - - @@ -459,6 +457,8 @@ + + @@ -684,6 +684,8 @@ + + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 82944ba417c0f..5d10b7e74f6c5 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -871,11 +871,11 @@ - - video\intrin + + video - - video\intrin + + video @@ -1525,11 +1525,11 @@ stdlib - - video\intrin + + video - - video\intrin + + video diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 7a5757100e399..6fb762d7750a6 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -25,10 +25,10 @@ #include "SDL_blit.h" #ifdef SDL_SSE4_1_INTRINSICS -#include "intrin/SDL_blit_A_sse4.1.h" +#include "SDL_blit_A_sse4_1.h" #endif #ifdef SDL_AVX2_INTRINSICS -#include "intrin/SDL_blit_A_avx2.h" +#include "SDL_blit_A_avx2.h" #endif #if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) #include "SDL3/SDL_cpuinfo.h" diff --git a/src/video/intrin/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c similarity index 98% rename from src/video/intrin/SDL_blit_A_avx2.c rename to src/video/SDL_blit_A_avx2.c index e9ebaa994ae99..ccb65f783e56e 100644 --- a/src/video/intrin/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -4,8 +4,8 @@ #ifdef SDL_AVX2_INTRINSICS -#include "../SDL_blit.h" -#include "SDL_blit_A_sse4.1.h" +#include "SDL_blit.h" +#include "SDL_blit_A_sse4_1.h" #if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) __attribute__((target("avx2"))) diff --git a/src/video/intrin/SDL_blit_A_avx2.h b/src/video/SDL_blit_A_avx2.h similarity index 100% rename from src/video/intrin/SDL_blit_A_avx2.h rename to src/video/SDL_blit_A_avx2.h diff --git a/src/video/intrin/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c similarity index 99% rename from src/video/intrin/SDL_blit_A_sse4_1.c rename to src/video/SDL_blit_A_sse4_1.c index 2e7d9139162da..3cc852e5da44a 100644 --- a/src/video/intrin/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -4,7 +4,7 @@ #ifdef SDL_SSE4_1_INTRINSICS -#include "../SDL_blit.h" +#include "SDL_blit.h" #if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) __attribute__((target("sse4.1"))) diff --git a/src/video/intrin/SDL_blit_A_sse4.1.h b/src/video/SDL_blit_A_sse4_1.h similarity index 100% rename from src/video/intrin/SDL_blit_A_sse4.1.h rename to src/video/SDL_blit_A_sse4_1.h From 12d18c7497c1735840f923a47e160d93bbb8983c Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Wed, 6 Sep 2023 17:08:19 -0500 Subject: [PATCH 186/431] Add back glob for src/video/*.c to CMakeLists.txt --- CMakeLists.txt | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27223d7f66d10..a40bc609a4c14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -498,6 +498,7 @@ sdl_glob_sources( "${SDL3_SOURCE_DIR}/src/thread/*.c" "${SDL3_SOURCE_DIR}/src/time/*.c" "${SDL3_SOURCE_DIR}/src/timer/*.c" + "${SDL3_SOURCE_DIR}/src/video/*.c" "${SDL3_SOURCE_DIR}/src/video/yuv2rgb/*.c" ) if(MSVC AND TARGET SDL3-shared) @@ -513,12 +514,6 @@ if(MSVC AND TARGET SDL3-shared) endif() endif() -# Exclude intrinsinc modules from general builds -file(GLOB video_sources "${SDL3_SOURCE_DIR}/src/video/*.c") -list(FILTER video_sources EXCLUDE REGEX "SDL_blit_A_avx2.c$") -list(FILTER video_sources EXCLUDE REGEX "SDL_blit_A_sse4_1.c$") -sdl_glob_sources(${video_sources}) - if(USE_INTELCC) # warning #39: division by zero # warning #239: floating point underflow @@ -744,7 +739,6 @@ if(SDL_ASSEMBLY) cmake_pop_check_state() if(COMPILER_SUPPORTS_SSE4_1) set(HAVE_SSE4_1 TRUE) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/SDL_blit_A_sse4_1.c") endif() endif() if(SDL_SSE4_2) @@ -808,7 +802,6 @@ if(SDL_ASSEMBLY) return 0; }" COMPILER_SUPPORTS_AVX2) cmake_pop_check_state() - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/SDL_blit_A_*.c") if(COMPILER_SUPPORTS_AVX2) set(HAVE_AVX2 TRUE) endif() From bac318fc27dc4084bda6959cf3929998e3e2b6f4 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Wed, 6 Sep 2023 17:06:16 -0500 Subject: [PATCH 187/431] Check for SSE4.1 first as more common --- src/video/SDL_blit_A.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 6fb762d7750a6..1cdbaf35909a2 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1383,7 +1383,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) case 4: #if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) - if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && (SDL_HasAVX2() || SDL_HasSSE41())) { + if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && (SDL_HasSSE41() || SDL_HasAVX2())) { return BlitNtoNPixelAlpha; } #endif From e8cba442c5bf9bd9a2122c6fb47d2a806ab48790 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Wed, 6 Sep 2023 17:13:41 -0500 Subject: [PATCH 188/431] Clean up API surface to use attribute macros and rename convertPixels --- src/video/SDL_blit_A_avx2.c | 16 +++++----------- src/video/SDL_blit_A_avx2.h | 5 +---- src/video/SDL_blit_A_sse4_1.c | 23 +++++++---------------- src/video/SDL_blit_A_sse4_1.h | 17 ++++------------- 4 files changed, 17 insertions(+), 44 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index ccb65f783e56e..d2a241874d87d 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -7,16 +7,13 @@ #include "SDL_blit.h" #include "SDL_blit_A_sse4_1.h" -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("avx2"))) -#endif /** * Using the AVX2 instruction set, blit eight pixels with alpha blending * @param src A pointer to four 32-bit pixels of ARGB format to blit into dst * @param dst A pointer to four 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of four alpha-blended pixels in ARGB format */ -__m128i MixRGBA_AVX2(__m128i src, __m128i dst) { +__m128i SDL_TARGETING("avx2") MixRGBA_AVX2(__m128i src, __m128i dst) { __m256i src_color = _mm256_cvtepu8_epi16(src); __m256i dst_color = _mm256_cvtepu8_epi16(dst); const __m256i SHUFFLE_ALPHA = _mm256_set_epi8( @@ -43,10 +40,7 @@ __m128i MixRGBA_AVX2(__m128i src, __m128i dst) { return _mm_add_epi8(mix, dst); } -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("avx2"))) -#endif -void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) +void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; @@ -62,7 +56,7 @@ void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) while (height--) { /* Process 4-wide chunks of source color data that may be in wrong format */ for (int i = 0; i < chunks; i += 1) { - __m128i c_src = convertPixelFormatsx4(_mm_loadu_si128((__m128i*) (src + i * 16)), srcfmt); + __m128i c_src = AlignPixelToSDL_PixelFormat_x4(_mm_loadu_si128((__m128i *) (src + i * 16)), srcfmt); _mm_store_si128((__m128i*)(buf + i * 16), c_src); } @@ -82,7 +76,7 @@ void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = convertPixelFormatsx4(c_src, srcfmt); + c_src = AlignPixelToSDL_PixelFormat_x4(c_src, srcfmt); __m128i c_dst = _mm_loadu_si64(dst_ptr); __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); _mm_storeu_si64(dst_ptr, c_mix); @@ -92,7 +86,7 @@ void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) if (remaining_pixels == 1) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - Uint32 pixel = convertPixelFormat(*src_ptr, srcfmt); + Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt); /* Old GCC has bad or no _mm_loadu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); diff --git a/src/video/SDL_blit_A_avx2.h b/src/video/SDL_blit_A_avx2.h index c3fc7b1117ea0..61eab95424171 100644 --- a/src/video/SDL_blit_A_avx2.h +++ b/src/video/SDL_blit_A_avx2.h @@ -1,7 +1,4 @@ #ifndef SDL_SDL_BLIT_A_AVX2_H #define SDL_SDL_BLIT_A_AVX2_H -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("avx2"))) -#endif -void BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info); +void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info); #endif //SDL_SDL_BLIT_A_AVX2_H diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 3cc852e5da44a..2135c87001adb 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -6,16 +6,13 @@ #include "SDL_blit.h" -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("sse4.1"))) -#endif /** * Using the SSE4.1 instruction set, blit four pixels with alpha blending * @param src A pointer to two 32-bit pixels of ARGB format to blit into dst * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format */ -__m128i MixRGBA_SSE4_1(__m128i src, __m128i dst) { +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst) { __m128i src_color = _mm_cvtepu8_epi16(src); __m128i dst_color = _mm_cvtepu8_epi16(dst); /** @@ -36,7 +33,7 @@ __m128i MixRGBA_SSE4_1(__m128i src, __m128i dst) { return _mm_add_epi8(reduced, dst); } -Uint32 convertPixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat) { +Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat) { Uint8 a = (color >> srcFormat->Ashift) & 0xFF; Uint8 r = (color >> srcFormat->Rshift) & 0xFF; Uint8 g = (color >> srcFormat->Gshift) & 0xFF; @@ -45,13 +42,10 @@ Uint32 convertPixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat) { return (a << 24) | (r << 16) | (g << 8) | b; } -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("sse4.1"))) -#endif /* * This helper function converts arbitrary pixel format data into ARGB form with a 4 pixel-wide shuffle */ -__m128i convertPixelFormatsx4(__m128i colors, const SDL_PixelFormat* srcFormat) { +__m128i SDL_TARGETING("sse4.1") AlignPixelToSDL_PixelFormat_x4(__m128i colors, const SDL_PixelFormat* srcFormat) { // Create shuffle masks based on the source SDL_PixelFormat to ARGB __m128i srcShuffleMask = _mm_set_epi8( srcFormat->Ashift / 8 + 12, srcFormat->Rshift / 8 + 12, srcFormat->Gshift / 8 + 12, srcFormat->Bshift / 8 + 12, @@ -64,10 +58,7 @@ __m128i convertPixelFormatsx4(__m128i colors, const SDL_PixelFormat* srcFormat) return _mm_shuffle_epi8(colors, srcShuffleMask); } -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("sse4.1"))) -#endif -void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { +void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; @@ -83,7 +74,7 @@ void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { /* Process 4-wide chunks of source color data that may be in wrong format into buffer */ for (int i = 0; i < chunks; i += 1) { __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); - _mm_storeu_si128((__m128i*)(buffer + i * 16), convertPixelFormatsx4(colors, srcfmt)); + _mm_storeu_si128((__m128i*)(buffer + i * 16), AlignPixelToSDL_PixelFormat_x4(colors, srcfmt)); } /* Alpha-blend in 2-wide chunks from buffer into destination */ @@ -102,7 +93,7 @@ void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = convertPixelFormatsx4(c_src, srcfmt); + c_src = AlignPixelToSDL_PixelFormat_x4(c_src, srcfmt); __m128i c_dst = _mm_loadu_si64(dst_ptr); __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); _mm_storeu_si64(dst_ptr, c_mix); @@ -112,7 +103,7 @@ void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { if (remaining_pixels == 1) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - Uint32 pixel = convertPixelFormat(*src_ptr, srcfmt); + Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt); /* Old GCC has bad or no _mm_loadu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h index 47be0dd5828a4..f26196efc6c7b 100644 --- a/src/video/SDL_blit_A_sse4_1.h +++ b/src/video/SDL_blit_A_sse4_1.h @@ -2,22 +2,13 @@ #define SDL_SDL_BLIT_A_SSE4_1_H #ifdef SDL_SSE4_1_INTRINSICS -Uint32 convertPixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat); +Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat); -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("sse4.1"))) -#endif -__m128i convertPixelFormatsx4(__m128i colors, const SDL_PixelFormat* srcFormat); +__m128i SDL_TARGETING("sse4.1") AlignPixelToSDL_PixelFormat_x4(__m128i colors, const SDL_PixelFormat* srcFormat); -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("sse4.1"))) -#endif -__m128i MixRGBA_SSE4_1(__m128i src, __m128i dst); +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst); -#if !defined(_MSC_VER) || (defined(_MSC_VER) && defined(__clang__)) -__attribute__((target("sse4.1"))) -#endif -void BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); +void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); #endif From c80c540be32e7b5872f2ef1af9cabd64af1c15c0 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Wed, 6 Sep 2023 17:17:09 -0500 Subject: [PATCH 189/431] Support older GCC and clang that lack some intrinsics --- src/video/SDL_blit_A_avx2.c | 2 ++ src/video/SDL_blit_A_sse4_1.c | 3 +++ src/video/SDL_blit_A_sse4_1.h | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index d2a241874d87d..4f8d01b313ccb 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -4,6 +4,8 @@ #ifdef SDL_AVX2_INTRINSICS +#define SDL_blit_A_avx2_c + #include "SDL_blit.h" #include "SDL_blit_A_sse4_1.h" diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 2135c87001adb..b8bf6f4902da1 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -4,7 +4,10 @@ #ifdef SDL_SSE4_1_INTRINSICS +#define SDL_blit_A_sse4_1_c + #include "SDL_blit.h" +#include "SDL_blit_A_sse4_1.h" /** * Using the SSE4.1 instruction set, blit four pixels with alpha blending diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h index f26196efc6c7b..2850290fd533a 100644 --- a/src/video/SDL_blit_A_sse4_1.h +++ b/src/video/SDL_blit_A_sse4_1.h @@ -12,4 +12,36 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); #endif +/* for compatibility with older compilers: */ +#if defined(SDL_blit_A_sse4_1_c) || defined(SDL_blit_A_avx2_c) +/* _mm_loadu_si64 : missing in clang < 3.9, missing in gcc < 9 + * _mm_storeu_si64: missing in clang < 8.0, missing in gcc < 9 + * __m128i_u type (to be used to define the missing two above): + * missing in gcc < 7, missing in clang < 9 + */ +#if defined(__clang__) +#if (__clang_major__ < 9) +#define MISSING__m128i_u +#endif +#if (__clang_major__ < 8) +#define MISSING__mm_storeu_si64 +#endif +#elif defined(__GNUC__) +#if (__GNUC__ < 7) +#define MISSING__m128i_u +#endif +#if (__GNUC__ < 9) +#define MISSING__mm_storeu_si64 +#endif +#endif + +#ifdef MISSING__m128i_u +typedef long long __m128i_u __attribute__((__vector_size__(16), __may_alias__, __aligned__(1))); +#endif +#ifdef MISSING__mm_storeu_si64 +#define _mm_loadu_si64(_x) _mm_loadl_epi64((__m128i_u*)(_x)) +#define _mm_storeu_si64(_x,_y) _mm_storel_epi64((__m128i_u*)(_x),(_y)) +#endif +#endif /**/ + #endif //SDL_SDL_BLIT_A_SSE4_1_H From 87958f44d090bc719df849882d241bc217de5822 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Thu, 7 Sep 2023 21:14:00 -0500 Subject: [PATCH 190/431] Support arbitrary destination formats; remove buffer from AVX2 --- src/video/SDL_blit_A_avx2.c | 46 ++++++++++++---------- src/video/SDL_blit_A_sse4_1.c | 73 ++++++++++++++++++++++++----------- src/video/SDL_blit_A_sse4_1.h | 6 ++- 3 files changed, 79 insertions(+), 46 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 4f8d01b313ccb..66c9d01c16354 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -9,21 +9,29 @@ #include "SDL_blit.h" #include "SDL_blit_A_sse4_1.h" +__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaMask_AVX2(SDL_PixelFormat* dstfmt) { + Uint8 index = dstfmt->Ashift / 4; + /* Handle case where bad input sent */ + if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { + index = 6; + } + return _mm256_set_epi8( + -1, index + 24, -1, index + 24, -1, index + 24, -1, index + 24, + -1, index + 16, -1, index + 16, -1, index + 16, -1, index + 16, + -1, index + 8, -1, index + 8, -1, index + 8, -1, index + 8, + -1, index, -1, index, -1, index, -1, index); +} + /** * Using the AVX2 instruction set, blit eight pixels with alpha blending * @param src A pointer to four 32-bit pixels of ARGB format to blit into dst * @param dst A pointer to four 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of four alpha-blended pixels in ARGB format */ -__m128i SDL_TARGETING("avx2") MixRGBA_AVX2(__m128i src, __m128i dst) { +__m128i SDL_TARGETING("avx2") MixRGBA_AVX2(__m128i src, __m128i dst, __m256i alphaMask) { __m256i src_color = _mm256_cvtepu8_epi16(src); __m256i dst_color = _mm256_cvtepu8_epi16(dst); - const __m256i SHUFFLE_ALPHA = _mm256_set_epi8( - -1, 30, -1, 30, -1, 30, -1, 30, - -1, 22, -1, 22, -1, 22, -1, 22, - -1, 14, -1, 14, -1, 14, -1, 14, - -1, 6, -1, 6, -1, 6, -1, 6); - __m256i alpha = _mm256_shuffle_epi8(src_color, SHUFFLE_ALPHA); + __m256i alpha = _mm256_shuffle_epi8(src_color, alphaMask); __m256i sub = _mm256_sub_epi16(src_color, dst_color); __m256i mul = _mm256_mullo_epi16(sub, alpha); /** @@ -51,22 +59,20 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) Uint8 *dst = info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; int chunks = width / 4; - Uint8 *buf = SDL_malloc(sizeof(Uint8) * chunks * 16); + const __m128i colorShiftMask = GetSDL_PixelFormatShuffleMask(srcfmt, dstfmt); + const __m256i alphaMask = GetSDL_PixelFormatAlphaMask_AVX2(dstfmt); + const __m128i sse4_1AlphaMask = GetSDL_PixelFormatAlphaMask_SSE4_1(dstfmt); while (height--) { /* Process 4-wide chunks of source color data that may be in wrong format */ for (int i = 0; i < chunks; i += 1) { - __m128i c_src = AlignPixelToSDL_PixelFormat_x4(_mm_loadu_si128((__m128i *) (src + i * 16)), srcfmt); - _mm_store_si128((__m128i*)(buf + i * 16), c_src); - } - - /* Alpha-blend in 4-wide chunk from src into destination */ - for (int i = 0; i < chunks; i += 1) { - __m128i c_src = _mm_loadu_si128((__m128i*) (buf + i * 16)); + __m128i c_src = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *) (src + i * 16)), colorShiftMask); + /* Alpha-blend in 4-wide chunk from src into destination */ __m128i c_dst = _mm_loadu_si128((__m128i*) (dst + i * 16)); - __m128i c_mix = MixRGBA_AVX2(c_src, c_dst); + __m128i c_mix = MixRGBA_AVX2(c_src, c_dst, alphaMask); _mm_storeu_si128((__m128i*) (dst + i * 16), c_mix); } @@ -78,9 +84,9 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = AlignPixelToSDL_PixelFormat_x4(c_src, srcfmt); + c_src = _mm_shuffle_epi8(c_src, colorShiftMask); __m128i c_dst = _mm_loadu_si64(dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -97,7 +103,7 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif - __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst); + __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); @@ -113,8 +119,6 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) src += srcskip; dst += dstskip; } - SDL_free(buf); - } #endif diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index b8bf6f4902da1..5a779b01c27e2 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -9,23 +9,34 @@ #include "SDL_blit.h" #include "SDL_blit_A_sse4_1.h" +/** + * A helper function to create an alpha mask for use with MixRGBA_SSE4_1 based on pixel format + */ +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(SDL_PixelFormat* dstfmt) { + Uint8 index = dstfmt->Ashift / 8; + /* Handle case where bad input sent */ + if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { + index = 3; + } + return _mm_set_epi8( + -1, index + 4, -1, index + 4, -1, index + 4, -1, index + 4, + -1, index, -1, index, -1, index, -1, index); +} + /** * Using the SSE4.1 instruction set, blit four pixels with alpha blending * @param src A pointer to two 32-bit pixels of ARGB format to blit into dst * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format */ -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst) { +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alphaMask) { __m128i src_color = _mm_cvtepu8_epi16(src); __m128i dst_color = _mm_cvtepu8_epi16(dst); /** * Combines a shuffle and an _mm_cvtepu8_epi16 operation into one operation by moving the lower 8 bits of the alpha * channel around to create 16-bit integers. */ - const __m128i SHUFFLE_ALPHA = _mm_set_epi8( - -1, 7, -1, 7, -1, 7, -1, 7, - -1, 3, -1, 3, -1, 3, -1, 3); - __m128i alpha = _mm_shuffle_epi8(src, SHUFFLE_ALPHA); + __m128i alpha = _mm_shuffle_epi8(src, alphaMask); __m128i sub = _mm_sub_epi16(src_color, dst_color); __m128i mul = _mm_mullo_epi16(sub, alpha); const __m128i SHUFFLE_REDUCE = _mm_set_epi8( @@ -46,21 +57,36 @@ Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcForma } /* - * This helper function converts arbitrary pixel format data into ARGB form with a 4 pixel-wide shuffle + * This helper function converts arbitrary pixel formats into a shuffle mask for _mm_shuffle_epi8 */ -__m128i SDL_TARGETING("sse4.1") AlignPixelToSDL_PixelFormat_x4(__m128i colors, const SDL_PixelFormat* srcFormat) { - // Create shuffle masks based on the source SDL_PixelFormat to ARGB - __m128i srcShuffleMask = _mm_set_epi8( - srcFormat->Ashift / 8 + 12, srcFormat->Rshift / 8 + 12, srcFormat->Gshift / 8 + 12, srcFormat->Bshift / 8 + 12, - srcFormat->Ashift / 8 + 8, srcFormat->Rshift / 8 + 8, srcFormat->Gshift / 8 + 8, srcFormat->Bshift / 8 + 8, - srcFormat->Ashift / 8 + 4, srcFormat->Rshift / 8 + 4, srcFormat->Gshift / 8 + 4, srcFormat->Bshift / 8 + 4, - srcFormat->Ashift / 8, srcFormat->Rshift / 8, srcFormat->Gshift / 8, srcFormat->Bshift / 8 - ); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcFormat, const SDL_PixelFormat* dstFormat) { + /* Calculate shuffle indices based on the source and destination SDL_PixelFormat */ + Uint8 shuffleIndices[16]; + Uint8 dstAshift = dstFormat->Ashift / 8; + Uint8 dstRshift = dstFormat->Rshift / 8; + Uint8 dstGshift = dstFormat->Gshift / 8; + Uint8 dstBshift = dstFormat->Bshift / 8; + /* Handle case where bad input sent */ + if (dstAshift == dstBshift && dstAshift == 0) { + dstAshift = 3; + } + for (int i = 0; i < 4; ++i) { + shuffleIndices[dstAshift + i * 4] = srcFormat->Ashift / 8 + i * 4; + shuffleIndices[dstRshift + i * 4] = srcFormat->Rshift / 8 + i * 4; + shuffleIndices[dstGshift + i * 4] = srcFormat->Gshift / 8 + i * 4; + shuffleIndices[dstBshift + i * 4] = srcFormat->Bshift / 8 + i * 4; + } - // Shuffle the colors - return _mm_shuffle_epi8(colors, srcShuffleMask); + /* Create shuffle mask based on the calculated indices */ + return _mm_set_epi8( + shuffleIndices[15], shuffleIndices[14], shuffleIndices[13], shuffleIndices[12], + shuffleIndices[11], shuffleIndices[10], shuffleIndices[9], shuffleIndices[8], + shuffleIndices[7], shuffleIndices[6], shuffleIndices[5], shuffleIndices[4], + shuffleIndices[3], shuffleIndices[2], shuffleIndices[1], shuffleIndices[0] + ); } + void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { int width = info->dst_w; int height = info->dst_h; @@ -69,22 +95,25 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { Uint8 *dst = info->dst; int dstskip = info->dst_skip; SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; int chunks = width / 4; Uint8 *buffer = (Uint8*)SDL_malloc(chunks * 16 * sizeof(Uint8)); + const __m128i colorShiftMask = GetSDL_PixelFormatShuffleMask(srcfmt, dstfmt); + const __m128i alphaMask = GetSDL_PixelFormatAlphaMask_SSE4_1(dstfmt); while (height--) { /* Process 4-wide chunks of source color data that may be in wrong format into buffer */ for (int i = 0; i < chunks; i += 1) { __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); - _mm_storeu_si128((__m128i*)(buffer + i * 16), AlignPixelToSDL_PixelFormat_x4(colors, srcfmt)); + _mm_storeu_si128((__m128i*)(buffer + i * 16), _mm_shuffle_epi8(colors, colorShiftMask)); } /* Alpha-blend in 2-wide chunks from buffer into destination */ for (int i = 0; i < chunks * 2; i += 1) { __m128i c_src = _mm_loadu_si64((buffer + (i * 8))); __m128i c_dst = _mm_loadu_si64((dst + i * 8)); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); _mm_storeu_si64(dst + i * 8, c_mix); } @@ -96,9 +125,9 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = AlignPixelToSDL_PixelFormat_x4(c_src, srcfmt); + c_src = _mm_shuffle_epi8(c_src, colorShiftMask); __m128i c_dst = _mm_loadu_si64(dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -115,7 +144,7 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif - __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst); + __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); @@ -131,8 +160,6 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { src += srcskip; dst += dstskip; } - - SDL_free(buffer); } #endif diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h index 2850290fd533a..ec7f8b7ae4b42 100644 --- a/src/video/SDL_blit_A_sse4_1.h +++ b/src/video/SDL_blit_A_sse4_1.h @@ -4,9 +4,11 @@ #ifdef SDL_SSE4_1_INTRINSICS Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat); -__m128i SDL_TARGETING("sse4.1") AlignPixelToSDL_PixelFormat_x4(__m128i colors, const SDL_PixelFormat* srcFormat); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(SDL_PixelFormat* dstfmt); -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcFormat, const SDL_PixelFormat* dstFormat); + +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alphaMask); void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); From 380bcff018094d87081b1ff2f9ea4d8fa21f90eb Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Fri, 8 Sep 2023 00:34:14 -0500 Subject: [PATCH 191/431] Allow arbitrary dstfmt in 1 pixel case; naming and const cleanup --- src/video/SDL_blit_A_avx2.c | 6 ++--- src/video/SDL_blit_A_sse4_1.c | 45 +++++++++++++++++++++-------------- src/video/SDL_blit_A_sse4_1.h | 6 ++--- 3 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 66c9d01c16354..78bdf9ecc71b8 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -9,7 +9,7 @@ #include "SDL_blit.h" #include "SDL_blit_A_sse4_1.h" -__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaMask_AVX2(SDL_PixelFormat* dstfmt) { +__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaMask_AVX2(const SDL_PixelFormat* dstfmt) { Uint8 index = dstfmt->Ashift / 4; /* Handle case where bad input sent */ if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { @@ -28,7 +28,7 @@ __m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaMask_AVX2(SDL_PixelFormat* * @param dst A pointer to four 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of four alpha-blended pixels in ARGB format */ -__m128i SDL_TARGETING("avx2") MixRGBA_AVX2(__m128i src, __m128i dst, __m256i alphaMask) { +__m128i SDL_TARGETING("avx2") MixRGBA_AVX2(const __m128i src, const __m128i dst, const __m256i alphaMask) { __m256i src_color = _mm256_cvtepu8_epi16(src); __m256i dst_color = _mm256_cvtepu8_epi16(dst); __m256i alpha = _mm256_shuffle_epi8(src_color, alphaMask); @@ -94,7 +94,7 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) if (remaining_pixels == 1) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt); + Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt, dstfmt); /* Old GCC has bad or no _mm_loadu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 5a779b01c27e2..7dfd669624847 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -12,7 +12,7 @@ /** * A helper function to create an alpha mask for use with MixRGBA_SSE4_1 based on pixel format */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(SDL_PixelFormat* dstfmt) { +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(const SDL_PixelFormat* dstfmt) { Uint8 index = dstfmt->Ashift / 8; /* Handle case where bad input sent */ if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { @@ -29,7 +29,7 @@ __m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(SDL_PixelForm * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format */ -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alphaMask) { +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(const __m128i src, const __m128i dst, const __m128i alphaMask) { __m128i src_color = _mm_cvtepu8_epi16(src); __m128i dst_color = _mm_cvtepu8_epi16(dst); /** @@ -47,34 +47,43 @@ __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i return _mm_add_epi8(reduced, dst); } -Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat) { - Uint8 a = (color >> srcFormat->Ashift) & 0xFF; - Uint8 r = (color >> srcFormat->Rshift) & 0xFF; - Uint8 g = (color >> srcFormat->Gshift) & 0xFF; - Uint8 b = (color >> srcFormat->Bshift) & 0xFF; +Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt) { + Uint8 a = (color >> srcfmt->Ashift) & 0xFF; + Uint8 r = (color >> srcfmt->Rshift) & 0xFF; + Uint8 g = (color >> srcfmt->Gshift) & 0xFF; + Uint8 b = (color >> srcfmt->Bshift) & 0xFF; - return (a << 24) | (r << 16) | (g << 8) | b; + /* Handle case where bad input sent */ + Uint8 aShift = dstfmt->Ashift; + if (aShift == dstfmt->Bshift && aShift == 0) { + aShift = 24; + } + return (a << aShift) | + (r << dstfmt->Rshift) | + (g << dstfmt->Gshift) | + (b << dstfmt->Bshift); } /* * This helper function converts arbitrary pixel formats into a shuffle mask for _mm_shuffle_epi8 */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcFormat, const SDL_PixelFormat* dstFormat) { +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcfmt, + const SDL_PixelFormat* dstfmt) { /* Calculate shuffle indices based on the source and destination SDL_PixelFormat */ Uint8 shuffleIndices[16]; - Uint8 dstAshift = dstFormat->Ashift / 8; - Uint8 dstRshift = dstFormat->Rshift / 8; - Uint8 dstGshift = dstFormat->Gshift / 8; - Uint8 dstBshift = dstFormat->Bshift / 8; + Uint8 dstAshift = dstfmt->Ashift / 8; + Uint8 dstRshift = dstfmt->Rshift / 8; + Uint8 dstGshift = dstfmt->Gshift / 8; + Uint8 dstBshift = dstfmt->Bshift / 8; /* Handle case where bad input sent */ if (dstAshift == dstBshift && dstAshift == 0) { dstAshift = 3; } for (int i = 0; i < 4; ++i) { - shuffleIndices[dstAshift + i * 4] = srcFormat->Ashift / 8 + i * 4; - shuffleIndices[dstRshift + i * 4] = srcFormat->Rshift / 8 + i * 4; - shuffleIndices[dstGshift + i * 4] = srcFormat->Gshift / 8 + i * 4; - shuffleIndices[dstBshift + i * 4] = srcFormat->Bshift / 8 + i * 4; + shuffleIndices[dstAshift + i * 4] = srcfmt->Ashift / 8 + i * 4; + shuffleIndices[dstRshift + i * 4] = srcfmt->Rshift / 8 + i * 4; + shuffleIndices[dstGshift + i * 4] = srcfmt->Gshift / 8 + i * 4; + shuffleIndices[dstBshift + i * 4] = srcfmt->Bshift / 8 + i * 4; } /* Create shuffle mask based on the calculated indices */ @@ -135,7 +144,7 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { if (remaining_pixels == 1) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt); + Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt, dstfmt); /* Old GCC has bad or no _mm_loadu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h index ec7f8b7ae4b42..132120d051769 100644 --- a/src/video/SDL_blit_A_sse4_1.h +++ b/src/video/SDL_blit_A_sse4_1.h @@ -2,11 +2,11 @@ #define SDL_SDL_BLIT_A_SSE4_1_H #ifdef SDL_SSE4_1_INTRINSICS -Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcFormat); +Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(SDL_PixelFormat* dstfmt); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(const SDL_PixelFormat* dstfmt); -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcFormat, const SDL_PixelFormat* dstFormat); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alphaMask); From 2432b6686e4f188a825ddef74dab326a0f9b0e98 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Fri, 8 Sep 2023 07:15:18 -0500 Subject: [PATCH 192/431] Add back in buffer free removed during testing --- src/video/SDL_blit_A_sse4_1.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 7dfd669624847..5348879277630 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -169,6 +169,7 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { src += srcskip; dst += dstskip; } + SDL_free(buffer); } #endif From a027ad97889feb1aa61ad142d990f53b10437356 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Fri, 8 Sep 2023 07:39:24 -0500 Subject: [PATCH 193/431] Remove buffer in SSE4.1, use unpacklo and packus intrinsics --- src/video/SDL_blit_A_avx2.c | 9 ++++-- src/video/SDL_blit_A_sse4_1.c | 54 +++++++++++++++++------------------ 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 78bdf9ecc71b8..4c157bc64390d 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -84,9 +84,10 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_shuffle_epi8(c_src, colorShiftMask); - __m128i c_dst = _mm_loadu_si64(dst_ptr); + c_src = _mm_unpacklo_epi8(_mm_shuffle_epi8(c_src, colorShiftMask), _mm_setzero_si128()); + __m128i c_dst = _mm_unpacklo_epi8(_mm_loadu_si64(dst_ptr), _mm_setzero_si128()); __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); + c_mix = _mm_packus_epi16(c_mix, _mm_setzero_si128()); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -103,7 +104,11 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif + c_src = _mm_unpacklo_epi8(c_src, _mm_setzero_si128()); + c_dst = _mm_unpacklo_epi8(c_dst, _mm_setzero_si128()); __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); + mixed_pixel = _mm_srli_epi16(mixed_pixel, 8); + mixed_pixel = _mm_unpacklo_epi8(mixed_pixel, _mm_setzero_si128()); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 5348879277630..82100ae9e5fdd 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -13,38 +13,33 @@ * A helper function to create an alpha mask for use with MixRGBA_SSE4_1 based on pixel format */ __m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(const SDL_PixelFormat* dstfmt) { - Uint8 index = dstfmt->Ashift / 8; + Uint8 index = dstfmt->Ashift / 4; /* Handle case where bad input sent */ if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { - index = 3; + index = 6; } return _mm_set_epi8( - -1, index + 4, -1, index + 4, -1, index + 4, -1, index + 4, + -1, index + 8, -1, index + 8, -1, index + 8, -1, index + 8, -1, index, -1, index, -1, index, -1, index); } /** * Using the SSE4.1 instruction set, blit four pixels with alpha blending - * @param src A pointer to two 32-bit pixels of ARGB format to blit into dst - * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending + * @param src_color A pointer to two 32-bit pixels of ARGB format to blit into dst + * @param dst_color A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format */ -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(const __m128i src, const __m128i dst, const __m128i alphaMask) { - __m128i src_color = _mm_cvtepu8_epi16(src); - __m128i dst_color = _mm_cvtepu8_epi16(dst); +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(const __m128i src_color, const __m128i dst_color, const __m128i alphaMask) { /** * Combines a shuffle and an _mm_cvtepu8_epi16 operation into one operation by moving the lower 8 bits of the alpha * channel around to create 16-bit integers. */ - __m128i alpha = _mm_shuffle_epi8(src, alphaMask); + __m128i alpha = _mm_shuffle_epi8(src_color, alphaMask); __m128i sub = _mm_sub_epi16(src_color, dst_color); __m128i mul = _mm_mullo_epi16(sub, alpha); - const __m128i SHUFFLE_REDUCE = _mm_set_epi8( - -1, -1, -1, -1, -1, -1, -1, -1, - 15, 13, 11, 9, 7, 5, 3, 1); - __m128i reduced = _mm_shuffle_epi8(mul, SHUFFLE_REDUCE); + mul = _mm_srli_epi16(mul, 8); - return _mm_add_epi8(reduced, dst); + return _mm_add_epi8(mul, dst_color); } Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt) { @@ -107,23 +102,22 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { SDL_PixelFormat *dstfmt = info->dst_fmt; int chunks = width / 4; - Uint8 *buffer = (Uint8*)SDL_malloc(chunks * 16 * sizeof(Uint8)); const __m128i colorShiftMask = GetSDL_PixelFormatShuffleMask(srcfmt, dstfmt); const __m128i alphaMask = GetSDL_PixelFormatAlphaMask_SSE4_1(dstfmt); while (height--) { /* Process 4-wide chunks of source color data that may be in wrong format into buffer */ for (int i = 0; i < chunks; i += 1) { - __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); - _mm_storeu_si128((__m128i*)(buffer + i * 16), _mm_shuffle_epi8(colors, colorShiftMask)); - } - - /* Alpha-blend in 2-wide chunks from buffer into destination */ - for (int i = 0; i < chunks * 2; i += 1) { - __m128i c_src = _mm_loadu_si64((buffer + (i * 8))); - __m128i c_dst = _mm_loadu_si64((dst + i * 8)); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); - _mm_storeu_si64(dst + i * 8, c_mix); + __m128i c_src = _mm_loadu_si128((__m128i*)(src + i * 16)); + c_src = _mm_shuffle_epi8(c_src, colorShiftMask); + __m128i c_dst = _mm_loadu_si128((__m128i*)(dst + i * 16)); + __m128i src_lo = _mm_unpacklo_epi8(c_src, _mm_setzero_si128()); + __m128i dst_lo = _mm_unpacklo_epi8(c_dst, _mm_setzero_si128()); + __m128i mix_lo = MixRGBA_SSE4_1(src_lo, dst_lo, alphaMask); + __m128i src_hi = _mm_unpackhi_epi8(c_src, _mm_setzero_si128()); + __m128i dst_hi = _mm_unpackhi_epi8(c_dst, _mm_setzero_si128()); + __m128i mix_hi = MixRGBA_SSE4_1(src_hi, dst_hi, alphaMask); + _mm_storeu_si128((__m128i*)(dst + i * 16), _mm_packus_epi16(mix_lo, mix_hi)); } /* Handle remaining pixels when width is not a multiple of 4 */ @@ -134,9 +128,10 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_shuffle_epi8(c_src, colorShiftMask); - __m128i c_dst = _mm_loadu_si64(dst_ptr); + c_src = _mm_unpacklo_epi8(_mm_shuffle_epi8(c_src, colorShiftMask), _mm_setzero_si128()); + __m128i c_dst = _mm_unpacklo_epi8(_mm_loadu_si64(dst_ptr), _mm_setzero_si128()); __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); + c_mix = _mm_packus_epi16(c_mix, _mm_setzero_si128()); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -153,7 +148,11 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif + c_src = _mm_unpacklo_epi8(c_src, _mm_setzero_si128()); + c_dst = _mm_unpacklo_epi8(c_dst, _mm_setzero_si128()); __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); + mixed_pixel = _mm_srli_epi16(mixed_pixel, 8); + mixed_pixel = _mm_unpacklo_epi8(mixed_pixel, _mm_setzero_si128()); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); @@ -169,7 +168,6 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { src += srcskip; dst += dstskip; } - SDL_free(buffer); } #endif From f6f12d0451b10f345b98a05c6f6aaef4295657ef Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Fri, 8 Sep 2023 08:34:44 -0500 Subject: [PATCH 194/431] Revert "Remove buffer in SSE4.1, use unpacklo and packus intrinsics" This reverts commit 149cd55840e7fdfd5ecde5c545aede5822abd14e. --- src/video/SDL_blit_A_avx2.c | 9 ++---- src/video/SDL_blit_A_sse4_1.c | 54 ++++++++++++++++++----------------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 4c157bc64390d..78bdf9ecc71b8 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -84,10 +84,9 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_unpacklo_epi8(_mm_shuffle_epi8(c_src, colorShiftMask), _mm_setzero_si128()); - __m128i c_dst = _mm_unpacklo_epi8(_mm_loadu_si64(dst_ptr), _mm_setzero_si128()); + c_src = _mm_shuffle_epi8(c_src, colorShiftMask); + __m128i c_dst = _mm_loadu_si64(dst_ptr); __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); - c_mix = _mm_packus_epi16(c_mix, _mm_setzero_si128()); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -104,11 +103,7 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif - c_src = _mm_unpacklo_epi8(c_src, _mm_setzero_si128()); - c_dst = _mm_unpacklo_epi8(c_dst, _mm_setzero_si128()); __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); - mixed_pixel = _mm_srli_epi16(mixed_pixel, 8); - mixed_pixel = _mm_unpacklo_epi8(mixed_pixel, _mm_setzero_si128()); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 82100ae9e5fdd..5348879277630 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -13,33 +13,38 @@ * A helper function to create an alpha mask for use with MixRGBA_SSE4_1 based on pixel format */ __m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(const SDL_PixelFormat* dstfmt) { - Uint8 index = dstfmt->Ashift / 4; + Uint8 index = dstfmt->Ashift / 8; /* Handle case where bad input sent */ if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { - index = 6; + index = 3; } return _mm_set_epi8( - -1, index + 8, -1, index + 8, -1, index + 8, -1, index + 8, + -1, index + 4, -1, index + 4, -1, index + 4, -1, index + 4, -1, index, -1, index, -1, index, -1, index); } /** * Using the SSE4.1 instruction set, blit four pixels with alpha blending - * @param src_color A pointer to two 32-bit pixels of ARGB format to blit into dst - * @param dst_color A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending + * @param src A pointer to two 32-bit pixels of ARGB format to blit into dst + * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format */ -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(const __m128i src_color, const __m128i dst_color, const __m128i alphaMask) { +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(const __m128i src, const __m128i dst, const __m128i alphaMask) { + __m128i src_color = _mm_cvtepu8_epi16(src); + __m128i dst_color = _mm_cvtepu8_epi16(dst); /** * Combines a shuffle and an _mm_cvtepu8_epi16 operation into one operation by moving the lower 8 bits of the alpha * channel around to create 16-bit integers. */ - __m128i alpha = _mm_shuffle_epi8(src_color, alphaMask); + __m128i alpha = _mm_shuffle_epi8(src, alphaMask); __m128i sub = _mm_sub_epi16(src_color, dst_color); __m128i mul = _mm_mullo_epi16(sub, alpha); - mul = _mm_srli_epi16(mul, 8); + const __m128i SHUFFLE_REDUCE = _mm_set_epi8( + -1, -1, -1, -1, -1, -1, -1, -1, + 15, 13, 11, 9, 7, 5, 3, 1); + __m128i reduced = _mm_shuffle_epi8(mul, SHUFFLE_REDUCE); - return _mm_add_epi8(mul, dst_color); + return _mm_add_epi8(reduced, dst); } Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt) { @@ -102,22 +107,23 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { SDL_PixelFormat *dstfmt = info->dst_fmt; int chunks = width / 4; + Uint8 *buffer = (Uint8*)SDL_malloc(chunks * 16 * sizeof(Uint8)); const __m128i colorShiftMask = GetSDL_PixelFormatShuffleMask(srcfmt, dstfmt); const __m128i alphaMask = GetSDL_PixelFormatAlphaMask_SSE4_1(dstfmt); while (height--) { /* Process 4-wide chunks of source color data that may be in wrong format into buffer */ for (int i = 0; i < chunks; i += 1) { - __m128i c_src = _mm_loadu_si128((__m128i*)(src + i * 16)); - c_src = _mm_shuffle_epi8(c_src, colorShiftMask); - __m128i c_dst = _mm_loadu_si128((__m128i*)(dst + i * 16)); - __m128i src_lo = _mm_unpacklo_epi8(c_src, _mm_setzero_si128()); - __m128i dst_lo = _mm_unpacklo_epi8(c_dst, _mm_setzero_si128()); - __m128i mix_lo = MixRGBA_SSE4_1(src_lo, dst_lo, alphaMask); - __m128i src_hi = _mm_unpackhi_epi8(c_src, _mm_setzero_si128()); - __m128i dst_hi = _mm_unpackhi_epi8(c_dst, _mm_setzero_si128()); - __m128i mix_hi = MixRGBA_SSE4_1(src_hi, dst_hi, alphaMask); - _mm_storeu_si128((__m128i*)(dst + i * 16), _mm_packus_epi16(mix_lo, mix_hi)); + __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); + _mm_storeu_si128((__m128i*)(buffer + i * 16), _mm_shuffle_epi8(colors, colorShiftMask)); + } + + /* Alpha-blend in 2-wide chunks from buffer into destination */ + for (int i = 0; i < chunks * 2; i += 1) { + __m128i c_src = _mm_loadu_si64((buffer + (i * 8))); + __m128i c_dst = _mm_loadu_si64((dst + i * 8)); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); + _mm_storeu_si64(dst + i * 8, c_mix); } /* Handle remaining pixels when width is not a multiple of 4 */ @@ -128,10 +134,9 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_unpacklo_epi8(_mm_shuffle_epi8(c_src, colorShiftMask), _mm_setzero_si128()); - __m128i c_dst = _mm_unpacklo_epi8(_mm_loadu_si64(dst_ptr), _mm_setzero_si128()); + c_src = _mm_shuffle_epi8(c_src, colorShiftMask); + __m128i c_dst = _mm_loadu_si64(dst_ptr); __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); - c_mix = _mm_packus_epi16(c_mix, _mm_setzero_si128()); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -148,11 +153,7 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif - c_src = _mm_unpacklo_epi8(c_src, _mm_setzero_si128()); - c_dst = _mm_unpacklo_epi8(c_dst, _mm_setzero_si128()); __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); - mixed_pixel = _mm_srli_epi16(mixed_pixel, 8); - mixed_pixel = _mm_unpacklo_epi8(mixed_pixel, _mm_setzero_si128()); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); @@ -168,6 +169,7 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { src += srcskip; dst += dstskip; } + SDL_free(buffer); } #endif From 9590a47629be6fa52d1dfb2104298ff2306776e9 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Sun, 10 Sep 2023 17:45:53 -0500 Subject: [PATCH 195/431] Implement visually accurate SIMD blitters --- src/video/SDL_blit_A_avx2.c | 166 ++++++++++++++++++++++++---------- src/video/SDL_blit_A_sse4_1.c | 159 +++++++++++++++++--------------- src/video/SDL_blit_A_sse4_1.h | 8 +- 3 files changed, 211 insertions(+), 122 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 78bdf9ecc71b8..ed2bfc1bfe8eb 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -9,45 +9,92 @@ #include "SDL_blit.h" #include "SDL_blit_A_sse4_1.h" -__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaMask_AVX2(const SDL_PixelFormat* dstfmt) { - Uint8 index = dstfmt->Ashift / 4; - /* Handle case where bad input sent */ - if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { - index = 6; +__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaSplatMask_AVX2(const SDL_PixelFormat* dstfmt) { + Uint8 index = dstfmt->Ashift / 8; + return _mm256_set_epi8( + index + 28, index + 28, index + 28, index + 28, index + 24, index + 24, index + 24, index + 24, + index + 20, index + 20, index + 20, index + 20, index + 16, index + 16, index + 16, index + 16, + index + 12, index + 12, index + 12, index + 12, index + 8, index + 8, index + 8, index + 8, + index + 4, index + 4, index + 4, index + 4, index, index, index, index); +} + +__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaSaturateMask_AVX2(const SDL_PixelFormat* dstfmt) { + const Uint8 bin = dstfmt->Ashift / 8; + return _mm256_set_epi8( + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0); +} + +__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatShuffleMask_AVX2(const SDL_PixelFormat* srcfmt, + const SDL_PixelFormat* dstfmt) { + /* Calculate shuffle indices based on the source and destination SDL_PixelFormat */ + Uint8 shuffleIndices[32]; + Uint8 dstAshift = dstfmt->Ashift / 8; + Uint8 dstRshift = dstfmt->Rshift / 8; + Uint8 dstGshift = dstfmt->Gshift / 8; + Uint8 dstBshift = dstfmt->Bshift / 8; + for (int i = 0; i < 8; ++i) { + shuffleIndices[dstAshift + i * 4] = srcfmt->Ashift / 8 + i * 4; + shuffleIndices[dstRshift + i * 4] = srcfmt->Rshift / 8 + i * 4; + shuffleIndices[dstGshift + i * 4] = srcfmt->Gshift / 8 + i * 4; + shuffleIndices[dstBshift + i * 4] = srcfmt->Bshift / 8 + i * 4; } + + /* Create shuffle mask based on the calculated indices */ return _mm256_set_epi8( - -1, index + 24, -1, index + 24, -1, index + 24, -1, index + 24, - -1, index + 16, -1, index + 16, -1, index + 16, -1, index + 16, - -1, index + 8, -1, index + 8, -1, index + 8, -1, index + 8, - -1, index, -1, index, -1, index, -1, index); + shuffleIndices[31], shuffleIndices[30], shuffleIndices[29], shuffleIndices[28], + shuffleIndices[27], shuffleIndices[26], shuffleIndices[25], shuffleIndices[24], + shuffleIndices[23], shuffleIndices[22], shuffleIndices[21], shuffleIndices[20], + shuffleIndices[19], shuffleIndices[18], shuffleIndices[17], shuffleIndices[16], + shuffleIndices[15], shuffleIndices[14], shuffleIndices[13], shuffleIndices[12], + shuffleIndices[11], shuffleIndices[10], shuffleIndices[9], shuffleIndices[8], + shuffleIndices[7], shuffleIndices[6], shuffleIndices[5], shuffleIndices[4], + shuffleIndices[3], shuffleIndices[2], shuffleIndices[1], shuffleIndices[0] + ); } /** - * Using the AVX2 instruction set, blit eight pixels with alpha blending - * @param src A pointer to four 32-bit pixels of ARGB format to blit into dst - * @param dst A pointer to four 32-bit pixels of ARGB format to retain visual data for while alpha blending - * @return A 128-bit wide vector of four alpha-blended pixels in ARGB format + * Using the AVX2 instruction set, blit sixteen pixels into eight with alpha blending */ -__m128i SDL_TARGETING("avx2") MixRGBA_AVX2(const __m128i src, const __m128i dst, const __m256i alphaMask) { - __m256i src_color = _mm256_cvtepu8_epi16(src); - __m256i dst_color = _mm256_cvtepu8_epi16(dst); - __m256i alpha = _mm256_shuffle_epi8(src_color, alphaMask); - __m256i sub = _mm256_sub_epi16(src_color, dst_color); - __m256i mul = _mm256_mullo_epi16(sub, alpha); - /** - * With an 8-bit shuffle, one can only move integers within a lane. The 256-bit AVX2 lane is actually 4 64-bit - * lanes. We pack the integers into the start of each lane. The second shuffle operates on these 64-bit integers to - * put them into the correct order for transport back to the surface in the correct format. - */ - const __m256i SHUFFLE_REDUCE = _mm256_set_epi8( - -1, -1, -1, -1, -1, -1, -1, -1, - 31, 29, 27, 25, 23, 21, 19, 17, - -1, -1, -1, -1, -1, -1, -1, -1, - 15, 13, 11, 9, 7, 5, 3, 1); - __m256i reduced = _mm256_shuffle_epi8(mul, SHUFFLE_REDUCE); - __m256i packed = _mm256_permute4x64_epi64(reduced, _MM_SHUFFLE(3, 1, 2, 0)); - __m128i mix = _mm256_castsi256_si128(packed); - return _mm_add_epi8(mix, dst); +__m256i SDL_TARGETING("avx2") MixRGBA_AVX2(__m256i src, __m256i dst, const __m256i alpha_shuffle, + const __m256i alpha_saturate) { + // SIMD implementation of blend_mul2. + // dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + // dstA = srcA + (dstA * (1-srcA)) = (1 * srcA) + (dstA * (1-srcA)) + + // Splat the alpha into all channels for each pixel + __m256i srca = _mm256_shuffle_epi8(src, alpha_shuffle); + + // Set the alpha channels of src to 255 + src = _mm256_or_si256(src, alpha_saturate); + + __m256i src_lo = _mm256_unpacklo_epi8(src, _mm256_setzero_si256()); + __m256i src_hi = _mm256_unpackhi_epi8(src, _mm256_setzero_si256()); + + __m256i dst_lo = _mm256_unpacklo_epi8(dst, _mm256_setzero_si256()); + __m256i dst_hi = _mm256_unpackhi_epi8(dst, _mm256_setzero_si256()); + + __m256i srca_lo = _mm256_unpacklo_epi8(srca, _mm256_setzero_si256()); + __m256i srca_hi = _mm256_unpackhi_epi8(srca, _mm256_setzero_si256()); + + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_lo, dst_lo), srca_lo), + _mm256_sub_epi16(_mm256_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_hi, dst_hi), srca_hi), + _mm256_sub_epi16(_mm256_slli_epi16(dst_hi, 8), dst_hi)); + + // dst = (dst * 0x8081) >> 23 + dst_lo = _mm256_srli_epi16(_mm256_mulhi_epu16(dst_lo, _mm256_set1_epi16(-0x7F7F)), 7); + dst_hi = _mm256_srli_epi16(_mm256_mulhi_epu16(dst_hi, _mm256_set1_epi16(-0x7F7F)), 7); + + dst = _mm256_packus_epi16(dst_lo, dst_hi); + return dst; } void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) @@ -61,32 +108,52 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; - int chunks = width / 4; - const __m128i colorShiftMask = GetSDL_PixelFormatShuffleMask(srcfmt, dstfmt); - const __m256i alphaMask = GetSDL_PixelFormatAlphaMask_AVX2(dstfmt); - const __m128i sse4_1AlphaMask = GetSDL_PixelFormatAlphaMask_SSE4_1(dstfmt); + int chunks = width / 8; + int free_format = 0; + /* Handle case when passed invalid format, assume ARGB destination */ + if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { + dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); + free_format = 1; + } + const __m256i shift_mask = GetSDL_PixelFormatShuffleMask_AVX2(srcfmt, dstfmt); + const __m256i splat_mask = GetSDL_PixelFormatAlphaSplatMask_AVX2(dstfmt); + const __m256i saturate_mask = GetSDL_PixelFormatAlphaSaturateMask_AVX2(dstfmt); + const __m128i sse4_1_shift_mask = GetSDL_PixelFormatShuffleMask_SSE4_1(srcfmt, dstfmt); + const __m128i sse4_1_splat_mask = GetSDL_PixelFormatAlphaSplatMask_SSE4_1(dstfmt); + const __m128i sse4_1_saturate_mask = GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(dstfmt); while (height--) { - /* Process 4-wide chunks of source color data that may be in wrong format */ + /* Process 8-wide chunks of source color data that may be in wrong format */ for (int i = 0; i < chunks; i += 1) { - __m128i c_src = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *) (src + i * 16)), colorShiftMask); - /* Alpha-blend in 4-wide chunk from src into destination */ - __m128i c_dst = _mm_loadu_si128((__m128i*) (dst + i * 16)); - __m128i c_mix = MixRGBA_AVX2(c_src, c_dst, alphaMask); - _mm_storeu_si128((__m128i*) (dst + i * 16), c_mix); + __m256i c_src = _mm256_shuffle_epi8(_mm256_loadu_si256((__m256i *) (src + i * 32)), shift_mask); + /* Alpha-blend in 8-wide chunk from src into destination */ + __m256i c_dst = _mm256_loadu_si256((__m256i*) (dst + i * 32)); + __m256i c_mix = MixRGBA_AVX2(c_src, c_dst, splat_mask, saturate_mask); + _mm256_storeu_si256((__m256i*) (dst + i * 32), c_mix); } /* Handle remaining pixels when width is not a multiple of 4 */ - if (width % 4 != 0) { - int remaining_pixels = width % 4; + if (width % 8 != 0) { + int remaining_pixels = width % 8; int offset = width - remaining_pixels; + if (remaining_pixels >= 4) { + Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); + Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); + __m128i c_src = _mm_loadu_si128((__m128i*)src_ptr); + c_src = _mm_shuffle_epi8(c_src, sse4_1_shift_mask); + __m128i c_dst = _mm_loadu_si128((__m128i*)dst_ptr); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1_splat_mask, sse4_1_saturate_mask); + _mm_storeu_si128((__m128i*)dst_ptr, c_mix); + remaining_pixels -= 4; + offset += 4; + } if (remaining_pixels >= 2) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_shuffle_epi8(c_src, colorShiftMask); + c_src = _mm_shuffle_epi8(c_src, sse4_1_shift_mask); __m128i c_dst = _mm_loadu_si64(dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1_splat_mask, sse4_1_saturate_mask); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -103,7 +170,7 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif - __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, sse4_1AlphaMask); + __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, sse4_1_splat_mask, sse4_1_saturate_mask); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); @@ -119,6 +186,9 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) src += srcskip; dst += dstskip; } + if (free_format) { + SDL_DestroyPixelFormat(dstfmt); + } } #endif diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 5348879277630..34355e8c950a3 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -10,75 +10,40 @@ #include "SDL_blit_A_sse4_1.h" /** - * A helper function to create an alpha mask for use with MixRGBA_SSE4_1 based on pixel format + * A helper function to create an alpha splat mask for use with MixRGBA_SSE4_1 based on pixel format */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(const SDL_PixelFormat* dstfmt) { - Uint8 index = dstfmt->Ashift / 8; - /* Handle case where bad input sent */ - if (dstfmt->Ashift == dstfmt->Bshift && dstfmt->Ashift == 0) { - index = 3; - } +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSplatMask_SSE4_1(const SDL_PixelFormat* dstfmt) { + const Uint8 index = dstfmt->Ashift / 8; return _mm_set_epi8( - -1, index + 4, -1, index + 4, -1, index + 4, -1, index + 4, - -1, index, -1, index, -1, index, -1, index); + index + 12, index + 12, index + 12, index + 12, + index + 8, index + 8, index + 8, index + 8, + index + 4, index + 4, index + 4, index + 4, + index, index, index, index); } /** - * Using the SSE4.1 instruction set, blit four pixels with alpha blending - * @param src A pointer to two 32-bit pixels of ARGB format to blit into dst - * @param dst A pointer to two 32-bit pixels of ARGB format to retain visual data for while alpha blending - * @return A 128-bit wide vector of two alpha-blended pixels in ARGB format + * A helper function to create an alpha saturate mask for use with MixRGBA_SSE4_1 based on pixel format */ -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(const __m128i src, const __m128i dst, const __m128i alphaMask) { - __m128i src_color = _mm_cvtepu8_epi16(src); - __m128i dst_color = _mm_cvtepu8_epi16(dst); - /** - * Combines a shuffle and an _mm_cvtepu8_epi16 operation into one operation by moving the lower 8 bits of the alpha - * channel around to create 16-bit integers. - */ - __m128i alpha = _mm_shuffle_epi8(src, alphaMask); - __m128i sub = _mm_sub_epi16(src_color, dst_color); - __m128i mul = _mm_mullo_epi16(sub, alpha); - const __m128i SHUFFLE_REDUCE = _mm_set_epi8( - -1, -1, -1, -1, -1, -1, -1, -1, - 15, 13, 11, 9, 7, 5, 3, 1); - __m128i reduced = _mm_shuffle_epi8(mul, SHUFFLE_REDUCE); - - return _mm_add_epi8(reduced, dst); -} - -Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt) { - Uint8 a = (color >> srcfmt->Ashift) & 0xFF; - Uint8 r = (color >> srcfmt->Rshift) & 0xFF; - Uint8 g = (color >> srcfmt->Gshift) & 0xFF; - Uint8 b = (color >> srcfmt->Bshift) & 0xFF; - - /* Handle case where bad input sent */ - Uint8 aShift = dstfmt->Ashift; - if (aShift == dstfmt->Bshift && aShift == 0) { - aShift = 24; - } - return (a << aShift) | - (r << dstfmt->Rshift) | - (g << dstfmt->Gshift) | - (b << dstfmt->Bshift); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(const SDL_PixelFormat* dstfmt) { + const Uint8 bin = dstfmt->Ashift / 8; + return _mm_set_epi8( + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, + bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0); } -/* +/** * This helper function converts arbitrary pixel formats into a shuffle mask for _mm_shuffle_epi8 */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcfmt, - const SDL_PixelFormat* dstfmt) { +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask_SSE4_1(const SDL_PixelFormat* srcfmt, + const SDL_PixelFormat* dstfmt) { /* Calculate shuffle indices based on the source and destination SDL_PixelFormat */ Uint8 shuffleIndices[16]; Uint8 dstAshift = dstfmt->Ashift / 8; Uint8 dstRshift = dstfmt->Rshift / 8; Uint8 dstGshift = dstfmt->Gshift / 8; Uint8 dstBshift = dstfmt->Bshift / 8; - /* Handle case where bad input sent */ - if (dstAshift == dstBshift && dstAshift == 0) { - dstAshift = 3; - } for (int i = 0; i < 4; ++i) { shuffleIndices[dstAshift + i * 4] = srcfmt->Ashift / 8 + i * 4; shuffleIndices[dstRshift + i * 4] = srcfmt->Rshift / 8 + i * 4; @@ -95,6 +60,56 @@ __m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFor ); } +/** + * Using the SSE4.1 instruction set, blit eight pixels into four with alpha blending + */ +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, + const __m128i alpha_splat, const __m128i alpha_saturate) { + // SIMD implementation of blend_mul2. + // dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + // dstA = srcA + (dstA * (1-srcA)) = (1 * srcA) + (dstA * (1-srcA)) + + // Splat the alpha into all channels for each pixel + __m128i srca = _mm_shuffle_epi8(src, alpha_splat); + + // Set the alpha channels of src to 255 + src = _mm_or_si128(src, alpha_saturate); + + __m128i src_lo = _mm_unpacklo_epi8(src, _mm_setzero_si128()); + __m128i src_hi = _mm_unpackhi_epi8(src, _mm_setzero_si128()); + + __m128i dst_lo = _mm_unpacklo_epi8(dst, _mm_setzero_si128()); + __m128i dst_hi = _mm_unpackhi_epi8(dst, _mm_setzero_si128()); + + __m128i srca_lo = _mm_unpacklo_epi8(srca, _mm_setzero_si128()); + __m128i srca_hi = _mm_unpackhi_epi8(srca, _mm_setzero_si128()); + + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_lo, dst_lo), srca_lo), + _mm_sub_epi16(_mm_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srca_hi), + _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); + + // dst = (dst * 0x8081) >> 23 + dst_lo = _mm_srli_epi16(_mm_mulhi_epu16(dst_lo, _mm_set1_epi16(-0x7F7F)), 7); + dst_hi = _mm_srli_epi16(_mm_mulhi_epu16(dst_hi, _mm_set1_epi16(-0x7F7F)), 7); + + dst = _mm_packus_epi16(dst_lo, dst_hi); + return dst; +} + +Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt) { + Uint8 a = (color >> srcfmt->Ashift) & 0xFF; + Uint8 r = (color >> srcfmt->Rshift) & 0xFF; + Uint8 g = (color >> srcfmt->Gshift) & 0xFF; + Uint8 b = (color >> srcfmt->Bshift) & 0xFF; + + return (a << dstfmt->Ashift) | + (r << dstfmt->Rshift) | + (g << dstfmt->Gshift) | + (b << dstfmt->Bshift); +} + void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { int width = info->dst_w; @@ -106,24 +121,24 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; - int chunks = width / 4; - Uint8 *buffer = (Uint8*)SDL_malloc(chunks * 16 * sizeof(Uint8)); - const __m128i colorShiftMask = GetSDL_PixelFormatShuffleMask(srcfmt, dstfmt); - const __m128i alphaMask = GetSDL_PixelFormatAlphaMask_SSE4_1(dstfmt); + const int chunks = width / 4; + int free_format = 0; + /* Handle case when passed invalid format, assume ARGB destination */ + if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { + dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); + free_format = 1; + } + const __m128i shift_mask = GetSDL_PixelFormatShuffleMask_SSE4_1(srcfmt, dstfmt); + const __m128i splat_mask = GetSDL_PixelFormatAlphaSplatMask_SSE4_1(dstfmt); + const __m128i saturate_mask = GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(dstfmt); while (height--) { - /* Process 4-wide chunks of source color data that may be in wrong format into buffer */ for (int i = 0; i < chunks; i += 1) { __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); - _mm_storeu_si128((__m128i*)(buffer + i * 16), _mm_shuffle_epi8(colors, colorShiftMask)); - } - - /* Alpha-blend in 2-wide chunks from buffer into destination */ - for (int i = 0; i < chunks * 2; i += 1) { - __m128i c_src = _mm_loadu_si64((buffer + (i * 8))); - __m128i c_dst = _mm_loadu_si64((dst + i * 8)); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); - _mm_storeu_si64(dst + i * 8, c_mix); + colors = _mm_shuffle_epi8(colors, shift_mask); + colors = MixRGBA_SSE4_1(colors, _mm_loadu_si128((__m128i*)(dst + i * 16)), + splat_mask, saturate_mask); + _mm_storeu_si128((__m128i*)(dst + i * 16), colors); } /* Handle remaining pixels when width is not a multiple of 4 */ @@ -134,9 +149,9 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_shuffle_epi8(c_src, colorShiftMask); + c_src = _mm_shuffle_epi8(c_src, shift_mask); __m128i c_dst = _mm_loadu_si64(dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); + __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, splat_mask, saturate_mask); _mm_storeu_si64(dst_ptr, c_mix); remaining_pixels -= 2; offset += 2; @@ -153,7 +168,7 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { __m128i c_src = _mm_loadu_si32(&pixel); __m128i c_dst = _mm_loadu_si32(dst_ptr); #endif - __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, alphaMask); + __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, splat_mask, saturate_mask); /* Old GCC has bad or no _mm_storeu_si32 */ #if defined(__GNUC__) && (__GNUC__ < 11) *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); @@ -169,7 +184,9 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { src += srcskip; dst += dstskip; } - SDL_free(buffer); + if (free_format) { + SDL_DestroyPixelFormat(dstfmt); + } } #endif diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h index 132120d051769..c6c8dec729a8a 100644 --- a/src/video/SDL_blit_A_sse4_1.h +++ b/src/video/SDL_blit_A_sse4_1.h @@ -4,11 +4,13 @@ #ifdef SDL_SSE4_1_INTRINSICS Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaMask_SSE4_1(const SDL_PixelFormat* dstfmt); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSplatMask_SSE4_1(const SDL_PixelFormat* dstfmt); -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask(const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(const SDL_PixelFormat* dstfmt); -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alphaMask); +__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask_SSE4_1(const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); + +__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alpha_splat, __m128i alpha_saturate); void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); From 594ca1a897e8f168fe0215ee50f8fd13cc83ca78 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 12 Sep 2023 18:41:36 -0500 Subject: [PATCH 196/431] Add testautomation suite for alpha blending --- test/testautomation_blit.c | 206 +++++++++++++++++++++ test/testautomation_images.c | 348 +++++++++++++++++++++++++++++++++++ test/testautomation_images.h | 2 + test/testautomation_suites.h | 1 + 4 files changed, 557 insertions(+) create mode 100644 test/testautomation_blit.c diff --git a/test/testautomation_blit.c b/test/testautomation_blit.c new file mode 100644 index 0000000000000..91b7dd8929f65 --- /dev/null +++ b/test/testautomation_blit.c @@ -0,0 +1,206 @@ +/** + * SDL_BlitSurface bit-perfect rendering test suite written by Isaac Aronson + */ + +/* Suppress C4996 VS compiler warnings for unlink() */ +#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +#define _CRT_SECURE_NO_DEPRECATE +#endif +#if defined(_MSC_VER) && !defined(_CRT_NONSTDC_NO_DEPRECATE) +#define _CRT_NONSTDC_NO_DEPRECATE +#endif + +#include +#ifndef _MSC_VER +#include +#endif +#include + +#include +#include +#include "testautomation_images.h" + +/* ====== xoroshiro128+ PRNG engine for deterministic blit input ===== */ +Uint64 rotl(uint64_t x, int k) { return (x << k) | (x >> (-k & 63)); } +Uint64 next(uint64_t state[2]) { + Uint64 s0 = state[0], s1 = state[1]; + Uint64 result = rotl((s0 + s1) * 9, 29) + s0; + state[0] = s0 ^ rotl(s1, 29); + state[1] = s0 ^ s1 << 9; + return result; +} +static Uint64 rngState[2] = {1, 2}; +Uint32 getRandomUint32() { + return (Uint32)next(rngState); +} +/* ================= Test Case Helper Functions ================== */ +/* + * Resets PRNG state to initialize tests using PRNG + */ +void blitSetUp(void *arg) { + rngState[0] = 1; + rngState[1] = 2; +} +/* + * Generates a stream of PRNG pixel data given length + */ +Uint32 *getNextRandomBuffer(const int width, const int height) { + Uint32* buf = SDL_malloc(sizeof(Uint32) * width * height); + for (int i = 0; i < width * height; i++) { + buf[i] = getRandomUint32(); + } + return buf; +} +/* + * Generates a small 15 x 15px surface of PRNG pixel data + */ +SDL_Surface* getRandomBlitChunk(Uint32 *pixels, SDL_PixelFormatEnum format) { + return SDL_CreateSurfaceFrom(pixels, 15, 15, 15 * 4, format); +} +/* + * Generates a 800 x 600 surface of PRNG pixel data + */ +SDL_Surface* getRandomSVGASurface(Uint32 *pixels, SDL_PixelFormatEnum format) { + return SDL_CreateSurfaceFrom(pixels, 800, 600, 800 * 4, format); +} +/* + * Calculates the FNV-1a hash of input pixel data + */ +Uint32 FNVHash(Uint32* buf, unsigned int length) { + const Uint32 fnv_prime = 0x811C9DC5; + Uint32 hash = 0; + + for (int i = 0; i < length; buf++, i++) + { + hash *= fnv_prime; + hash ^= (*buf); + } + + return hash; +} +/* + * Wraps the FNV-1a hash for an input surface's pixels + */ +Uint32 hashSurfacePixels(SDL_Surface * surface) { + Uint64 buffer_size = surface->w * surface->h; + return FNVHash(surface->pixels, buffer_size); +} +/* ================= Test Case Implementation ================== */ +/** + * Tests rendering a rainbow gradient background onto a blank surface, then rendering a sprite with complex geometry and + * transparency on top of said surface, and comparing the result to known accurate renders with a hash. + */ +int blit_testExampleApplicationRender(void *arg) { + const int width = 32; + const int height = 32; + const Uint32 scalar_hash = 0xf47a3f55; + const Uint32 x86_simd_hash = 0xe345d7a7; + SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ARGB8888); + SDL_Surface* rainbow_background = SDLTest_ImageBlendingBackground(); + SDL_Surface* gearbrain_sprite = SDLTest_ImageBlendingSprite(); + // Blit background into "screen" + SDL_BlitSurface(rainbow_background, NULL, dest_surface, NULL); + // Blit example game sprite onto "screen" + SDL_BlitSurface(gearbrain_sprite, NULL, dest_surface, NULL); + // Check result + Uint32 hash = hashSurfacePixels(dest_surface); + SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, + "Should render identically, expected 0x%x (scalar) or 0x%x (x86_simd), got 0x%x", + scalar_hash, x86_simd_hash, hash); + // Clean up + SDL_DestroySurface(rainbow_background); + SDL_DestroySurface(gearbrain_sprite); + SDL_DestroySurface(dest_surface); + return TEST_COMPLETED; +} +/** + * Tests rendering PRNG noise onto a surface of PRNG noise, while also testing color shift operations between the + * different source and destination pixel formats, without an alpha shuffle, at SVGA resolution. Compares to known + * accurate renders with a hash. + */ +int blit_testRandomToRandomSVGA(void *arg) { + const int width = 800; + const int height = 600; + const Uint32 scalar_hash = 0x1f56efad; + const Uint32 x86_simd_hash = 0x42140c5f; + // Allocate random buffers + Uint32 *dest_pixels = getNextRandomBuffer(width, height); + Uint32 *src_pixels = getNextRandomBuffer(width, height); + // Create surfaces of different pixel formats + SDL_Surface* dest_surface = getRandomSVGASurface(dest_pixels, SDL_PIXELFORMAT_BGRA8888); + SDL_Surface* src_surface = getRandomSVGASurface(src_pixels, SDL_PIXELFORMAT_RGBA8888); + // Blit surfaces + SDL_BlitSurface(src_surface, NULL, dest_surface, NULL); + // Check result + Uint32 hash = hashSurfacePixels(dest_surface); + SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, + "Should render identically, expected 0x%x (scalar) or 0x%x (x86_simd), got 0x%x", + scalar_hash, x86_simd_hash, hash); + // Clean up + SDL_DestroySurface(dest_surface); + SDL_DestroySurface(src_surface); + SDL_free(dest_pixels); + SDL_free(src_pixels); + return TEST_COMPLETED; +} +/** + * Tests rendering small chunks of 15 by 15px PRNG noise onto an initially blank SVGA surface, while also testing color + * shift operations between the different source and destination pixel formats, including an alpha shuffle. Compares to + * known accurate renders with a hash. + */ +int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { + const int width = 800; + const int height = 600; + const Uint32 x86_simd_hash = 0x2626be78; + const Uint32 scalar_hash = 0xfb2a8ee8; + // Create blank source surface + SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ABGR8888); + + // Perform 250k random blits into random areas of the blank surface + for (int i = 0; i < 250000; i++) { + Uint32 *buf = getNextRandomBuffer(15, 15); + SDL_Surface *sourceSurface = getRandomBlitChunk(buf, SDL_PIXELFORMAT_RGBA8888); + + SDL_Rect dest_rect; + int location = (int)getRandomUint32(); + dest_rect.x = location % (width - 15 - 1); + dest_rect.y = location % (height - 15 - 1); + + SDL_BlitSurface(sourceSurface, NULL, dest_surface, &dest_rect); + + SDL_DestroySurface(sourceSurface); + SDL_free(buf); + } + // Check result + Uint32 hash = hashSurfacePixels(dest_surface); + // Clean up + SDL_SaveBMP(dest_surface, "250k_scalar.bmp"); + SDL_DestroySurface(dest_surface); + SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, + "Should render identically, expected 0x%x (scalar) or 0x%x (x86_simd), got 0x%x", + scalar_hash, x86_simd_hash, hash); + return TEST_COMPLETED; +} + +static const SDLTest_TestCaseReference blitTest1 = { + (SDLTest_TestCaseFp)blit_testExampleApplicationRender, "blit_testExampleApplicationRender", + "Test example application render.", TEST_ENABLED +}; +static const SDLTest_TestCaseReference blitTest2 = { + (SDLTest_TestCaseFp)blit_testRandomToRandomSVGA, "blit_testRandomToRandomSVGA", + "Test SVGA noise render.", TEST_ENABLED +}; +static const SDLTest_TestCaseReference blitTest3 = { + (SDLTest_TestCaseFp)blit_testRandomToRandomSVGAMultipleIterations, "blit_testRandomToRandomSVGAMultipleIterations", + "Test SVGA noise render (250k iterations).", TEST_ENABLED +}; +static const SDLTest_TestCaseReference *blitTests[] = { + &blitTest1, &blitTest2, &blitTest3, NULL +}; + +SDLTest_TestSuiteReference blitTestSuite = { + "Blending", + blitSetUp, + blitTests, + NULL +}; \ No newline at end of file diff --git a/test/testautomation_images.c b/test/testautomation_images.c index f3c7b1e63cb2d..9c19ce021449b 100644 --- a/test/testautomation_images.c +++ b/test/testautomation_images.c @@ -5927,3 +5927,351 @@ SDL_Surface *SDLTest_ImagePrimitivesBlend(void) SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); return surface; } + +/* Rainbow gradient background */ + +static const SDLTest_SurfaceImage_t SDLTest_imageRainbowBackground = { + 32, + 32, + 4, + "\000\016\377\377\000\031\377\377\000\045\377\377\000\061\377\377\000\075\377\377\000\111\377\377\000\125\377" + "\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250" + "\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000" + "\374\377\377\000\377\356\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\216\377\000\377\167\377" + "\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\000\031\377\377\000\045\377" + "\377\000\061\377\377\000\075\377\377\000\111\377\377\000\125\377\377\000\141\377\377\000\155\377\377\000\170" + "\377\377\000\204\377\377\000\220\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000" + "\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\373\377\377\000\377\357\377\000\377\326\377" + "\000\377\276\377\000\377\247\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\110\377\000\377\060" + "\377\000\377\030\377\003\377\003\377\027\377\000\377\000\045\377\377\000\061\377\377\000\075\377\377\000\111" + "\377\377\000\125\377\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000" + "\235\377\377\000\251\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377" + "\000\360\377\377\000\374\377\377\000\377\357\377\000\377\325\377\000\377\276\377\000\377\246\377\000\377\216" + "\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\002\377\002\377\030\377" + "\000\377\060\377\000\377\000\061\377\377\000\075\377\377\000\111\377\377\000\125\377\377\000\141\377\377\000" + "\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377" + "\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357" + "\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377" + "\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\061\377\000\377\110\377\000\377\000" + "\075\377\377\000\111\377\377\000\125\377\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377" + "\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377" + "\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377" + "\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003" + "\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\000\111\377\377\000\125\377\377" + "\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377" + "\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374" + "\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000" + "\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377" + "\107\377\000\377\140\377\000\377\167\377\000\377\000\125\377\377\000\141\377\377\000\155\377\377\000\171\377" + "\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314" + "\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000" + "\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377" + "\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\137\377\000\377\170\377\000" + "\377\217\377\000\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234" + "\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000" + "\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377" + "\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000" + "\377\060\377\000\377\110\377\000\377\140\377\000\377\167\377\000\377\220\377\000\377\247\377\000\377\000\155" + "\377\377\000\170\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000" + "\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377" + "\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107" + "\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377" + "\000\377\170\377\000\377\217\377\000\377\250\377\000\377\277\377\000\377\000\171\377\377\000\204\377\377\000" + "\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377" + "\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246" + "\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377" + "\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247" + "\377\000\377\300\377\000\377\327\377\000\377\000\205\377\377\000\220\377\377\000\235\377\377\000\250\377\377" + "\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377" + "\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377" + "\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110" + "\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377" + "\357\377\000\377\000\221\377\377\000\234\377\377\000\251\377\377\000\264\377\377\000\300\377\377\000\314\377" + "\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377" + "\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000" + "\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377" + "\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\000\234\377" + "\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360" + "\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000" + "\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377" + "\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000" + "\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\000\250\377\377\000\264\377\377\000\300" + "\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000" + "\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377" + "\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000" + "\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367" + "\000\377\377\337\000\377\377\307\000\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000" + "\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377" + "\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003" + "\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377" + "\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\340\000\377\377\307\000\377\377" + "\260\000\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377" + "\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137" + "\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377" + "\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360" + "\377\000\377\377\367\000\377\377\337\000\377\377\310\000\377\377\257\000\377\377\230\000\377\000\314\377\377" + "\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276" + "\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377" + "\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217" + "\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377" + "\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\000\330\377\377\000\344\377\377\000\360\377" + "\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377" + "\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060" + "\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377" + "\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000" + "\377\377\200\000\377\377\151\000\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377" + "\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000" + "\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377" + "\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000" + "\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\201\000\377\377\150\000\377\377\121" + "\000\377\000\360\377\377\000\373\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000" + "\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377" + "\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000" + "\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260" + "\000\377\377\230\000\377\377\200\000\377\377\151\000\377\377\120\000\377\377\071\000\377\000\374\377\377\000" + "\377\357\377\000\377\325\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377" + "\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000" + "\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377" + "\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377" + "\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\000\377\356\377\000\377\326\377\000\377\276\377" + "\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027" + "\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377" + "\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377" + "\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377" + "\377\041\000\377\377\012\000\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167" + "\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377" + "\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327" + "\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377" + "\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015" + "\377\000\377\276\377\000\377\247\377\000\377\216\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377" + "\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170" + "\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377" + "\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000" + "\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\016\377\377\000\046\377\000\377\246\377\000\377" + "\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027" + "\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377" + "\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000" + "\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011" + "\000\377\377\000\015\377\377\000\047\377\377\000\076\377\000\377\216\377\000\377\167\377\000\377\137\377\000" + "\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377" + "\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000" + "\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150" + "\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015\377\377\000\046\377\377" + "\000\076\377\377\000\126\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377" + "\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000" + "\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307" + "\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377" + "\041\000\377\377\011\000\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\126\377\377\000\155\377" + "\000\377\137\377\000\377\110\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000" + "\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377" + "\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377" + "\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015\377" + "\377\000\046\377\377\000\076\377\377\000\125\377\377\000\156\377\377\000\205\377\000\377\107\377\000\377\060" + "\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377" + "\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377" + "\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377" + "\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\126" + "\377\377\000\155\377\377\000\206\377\377\000\235\377\000\377\060\377\000\377\030\377\002\377\002\377\027\377" + "\000\377\060\377\000\377\107\377\000\377\137\377\000\377\167\377\000\377\217\377\000\377\247\377\000\377\277" + "\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\340\000\377\377\310\000\377\377\260\000\377" + "\377\230\000\377\377\201\000\377\377\151\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000" + "\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\125\377\377\000\155\377\377\000\205\377\377\000" + "\235\377\377\000\264\377\000\377\027\377\003\377\003\377\030\377\000\377\061\377\000\377\110\377\000\377\140" + "\377\000\377\170\377\000\377\220\377\000\377\250\377\000\377\300\377\000\377\327\377\000\377\360\377\000\377" + "\377\367\000\377\377\337\000\377\377\307\000\377\377\257\000\377\377\230\000\377\377\200\000\377\377\150\000" + "\377\377\120\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\016\377\377\000\047\377\377\000" + "\076\377\377\000\126\377\377\000\156\377\377\000\206\377\377\000\235\377\377\000\266\377\377\000\315\377\003" + "\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\167\377\000\377\217\377\000\377" + "\247\377\000\377\277\377\000\377\327\377\000\377\357\377\000\377\377\367\000\377\377\337\000\377\377\307\000" + "\377\377\260\000\377\377\230\000\377\377\200\000\377\377\151\000\377\377\121\000\377\377\071\000\377\377\041" + "\000\377\377\012\000\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\126\377\377\000\155\377\377" + "\000\205\377\377\000\235\377\377\000\264\377\377\000\315\377\377\000\344\377" +}; + +/** + * \brief Returns the blending rendering background test image as an SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlendingBackground(void) +{ + SDL_Surface *surface = SDL_CreateSurfaceFrom( + (void *)SDLTest_imageRainbowBackground.pixel_data, + SDLTest_imageRainbowBackground.width, + SDLTest_imageRainbowBackground.height, + SDLTest_imageRainbowBackground.width * SDLTest_imageRainbowBackground.bytes_per_pixel, + SDL_PIXELFORMAT_ARGB8888); + return surface; +} + +/* Complex sprite with gradient transparency */ + +static const SDLTest_SurfaceImage_t SDLTest_imageTransparentSprite = { + 32, + 32, + 4, + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\101\205\101\000\143\152\143\000\143\151\143\003\145\151\145\034\146\150\146\111\146\150\146\132\145\150" + "\146\014\146\150\146\000\146\150\146\000\147\147\147\000\145\150\145\042\146\147\146\137\146\150\146\111\145" + "\151\145\056\144\152\144\017\151\145\151\000\067\215\076\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\125\166\126\000\177\120" + "\176\000\147\147\147\117\147\147\147\230\147\147\147\242\147\147\147\233\147\147\147\111\377\000\377\000\143" + "\152\143\000\143\152\143\005\146\147\146\120\147\147\147\155\147\147\147\144\147\147\147\135\144\151\144\057" + "\176\126\174\000\110\200\113\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\126\164\127\000\205\115\204\000\146\147\146\154\147" + "\147\147\260\147\147\147\243\147\147\147\234\147\147\147\211\146\150\146\047\335\017\335\000\146\150\146\052" + "\147\147\147\160\147\147\147\154\147\147\147\144\147\147\147\135\146\150\146\064\203\123\201\000\132\161\134" + "\000\135\156\136\000\146\151\145\000\150\146\150\000\135\155\135\000\144\151\144\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\144\152\144\000\126\165\131\000\147\147\147\000\146" + "\147\146\000\143\152\143\000\204\120\203\000\156\142\156\000\146\147\146\135\147\147\147\256\147\147\147\243" + "\147\147\147\233\147\147\147\224\147\147\147\171\146\150\146\134\147\147\147\155\147\147\147\164\147\147\147" + "\154\147\147\147\144\147\147\147\135\146\150\146\065\161\140\161\000\143\152\143\000\120\165\123\001\143\153" + "\143\014\143\152\143\013\152\146\153\000\145\147\145\000\146\146\146\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\133\161\133\000\101\207\104\000\150\146\150\000\146\150\146\045\146\150\146\046\141\154\141\003" + "\147\147\147\000\150\146\150\000\146\150\146\126\147\147\147\256\147\147\147\243\147\147\147\233\147\147\147" + "\223\147\147\147\214\147\147\147\206\147\147\147\174\147\147\147\163\147\147\147\154\147\147\147\144\147\147" + "\147\135\146\150\146\101\142\153\142\014\143\152\143\013\145\150\145\043\147\150\147\060\147\147\147\050\147" + "\147\147\013\147\152\147\000\143\150\143\000\133\161\134\000\000\000\000\000\000\000\000\000\150\146\150\000" + "\147\147\147\000\147\147\147\046\147\147\147\264\147\147\147\301\147\147\147\202\146\150\146\072\146\150\146" + "\071\147\147\147\222\147\147\147\255\147\147\147\243\147\147\147\234\147\147\147\225\147\147\147\216\147\147" + "\147\206\147\147\147\176\147\147\147\165\147\147\147\155\147\147\147\144\147\147\147\134\147\147\147\123\146" + "\150\146\103\146\147\146\074\147\147\147\074\147\147\147\064\147\147\147\054\147\147\147\040\146\150\146\011" + "\152\145\152\000\132\162\133\000\000\000\000\000\000\000\000\000\147\147\147\000\146\150\146\024\147\147\147" + "\243\147\147\147\336\147\147\147\325\147\147\147\316\147\147\147\275\147\147\147\264\147\147\147\265\147\147" + "\147\254\147\147\147\246\147\147\147\227\147\147\147\174\147\147\147\137\146\150\146\120\146\150\146\113\146" + "\147\146\117\146\147\146\132\147\147\147\141\147\147\147\135\147\147\147\124\147\147\147\114\147\146\147\104" + "\147\147\147\074\147\147\147\064\147\147\147\054\147\147\147\044\145\151\145\015\154\144\153\000\125\166\130" + "\000\000\000\000\000\000\000\000\000\147\147\147\000\146\150\146\057\147\147\147\320\147\147\147\335\147\147" + "\147\323\147\147\147\313\147\147\147\304\147\147\147\274\147\147\147\265\147\147\147\250\147\147\147\163\146" + "\150\146\061\144\151\145\016\137\155\140\002\170\133\212\000\170\127\213\000\134\160\134\002\143\152\143\012" + "\145\150\146\037\146\150\146\100\147\147\147\122\147\147\147\114\147\147\147\104\147\147\147\074\147\147\147" + "\064\147\147\147\054\146\150\146\035\141\154\141\003\142\152\142\000\134\161\135\000\000\000\000\000\000\000" + "\000\000\146\150\146\000\144\152\144\001\147\147\147\151\147\147\147\330\147\147\147\324\147\147\147\313\147" + "\147\147\303\147\147\147\275\147\147\147\244\147\147\146\110\143\150\133\006\163\162\231\000\202\204\275\000" + "\236\240\375\000\140\144\231\002\144\145\237\003\245\252\377\000\166\167\255\000\152\152\174\000\141\154\141" + "\004\146\150\146\042\147\147\147\105\147\147\147\104\147\147\147\074\147\147\147\064\147\147\147\052\144\151" + "\144\014\150\146\147\000\162\130\162\000\000\000\000\000\000\000\000\000\000\000\000\000\146\150\146\000\146" + "\147\146\000\146\150\146\012\147\147\147\215\147\147\147\325\147\147\147\313\147\147\147\305\147\147\147\253" + "\146\150\146\071\161\152\222\000\162\162\274\011\174\173\311\053\177\176\314\110\201\201\321\115\202\202\322" + "\127\202\202\322\126\173\172\307\101\167\167\300\041\170\167\302\010\213\217\320\000\157\143\213\000\146\147" + "\146\026\147\147\147\075\147\147\147\074\147\147\147\064\147\150\147\050\142\153\142\006\150\147\150\000\146" + "\150\146\000\144\151\144\000\135\151\135\000\150\145\147\000\133\160\133\000\142\153\142\000\147\147\147\000" + "\146\147\146\130\147\147\147\323\147\147\147\314\147\147\147\277\147\147\147\117\166\161\240\000\163\161\271" + "\032\202\201\321\163\176\176\314\216\200\200\320\217\204\204\326\214\201\201\321\203\177\177\316\173\203\203" + "\324\165\200\200\320\150\175\175\312\120\175\174\313\054\147\144\245\007\164\155\237\000\145\150\145\033\147" + "\147\147\072\147\147\147\064\147\147\147\054\145\151\145\031\143\152\144\014\142\152\142\010\134\157\134\004" + "\131\154\131\001\150\146\150\000\155\143\155\000\143\152\143\006\145\150\145\033\147\147\147\237\147\147\147" + "\326\147\147\147\316\147\147\147\212\137\143\116\007\165\163\276\032\174\173\310\173\206\206\331\243\176\176" + "\314\222\177\177\315\214\203\203\324\210\201\201\321\200\205\205\330\173\202\202\323\163\176\176\313\154\176" + "\176\314\144\177\177\315\134\172\171\304\073\172\167\306\011\130\150\106\002\146\150\146\051\147\147\147\065" + "\147\147\147\054\147\147\147\044\147\150\147\034\146\147\146\024\145\146\145\014\141\147\141\004\146\147\146" + "\113\147\147\147\211\147\147\147\250\147\147\147\302\147\147\147\330\147\147\147\324\147\147\147\306\146\147" + "\144\077\177\175\325\031\177\176\315\204\205\205\330\246\202\202\322\241\202\202\323\227\200\200\317\217\201" + "\201\320\211\201\201\321\202\211\211\337\173\203\203\324\163\200\200\317\154\203\203\324\144\175\175\312\134" + "\174\174\310\124\171\171\304\071\156\153\272\006\144\151\142\022\147\147\147\063\147\147\147\054\147\147\147" + "\044\150\150\150\034\146\146\146\024\146\146\146\014\143\147\143\004\147\147\147\305\147\147\147\371\147\147" + "\147\357\147\147\147\345\147\147\147\333\147\147\147\325\147\147\147\255\141\143\133\024\173\173\307\140\204" + "\204\326\264\210\210\334\252\200\200\317\233\205\205\330\233\203\203\324\223\202\202\322\212\205\205\330\203" + "\204\204\326\172\201\201\321\163\203\203\325\154\204\204\326\143\177\177\315\134\200\200\317\124\171\171\304" + "\112\162\161\270\031\132\152\114\005\146\150\146\053\147\147\147\054\147\147\147\044\150\150\150\034\146\146" + "\146\024\146\146\146\014\143\144\143\005\147\147\147\340\147\147\147\365\147\147\147\353\147\147\147\343\147" + "\147\147\333\147\147\147\326\147\147\146\217\155\160\236\016\176\176\314\211\204\204\326\265\211\211\337\252" + "\203\203\324\235\205\205\327\233\204\204\326\223\205\205\330\213\207\207\333\203\204\204\326\173\205\205\327" + "\163\201\201\320\153\176\176\313\143\203\203\323\134\204\204\325\124\201\201\320\115\171\170\302\053\062\123" + "\024\001\145\151\145\043\147\147\147\055\147\147\147\044\150\150\150\034\146\146\146\024\145\147\145\013\143" + "\147\143\003\147\147\147\331\147\147\147\364\147\147\147\356\147\147\147\344\147\147\147\333\147\147\147\327" + "\147\147\146\176\171\172\305\015\203\203\325\227\202\202\323\260\210\210\334\250\202\202\323\231\205\205\327" + "\234\204\204\327\223\204\204\325\212\204\204\326\201\203\203\323\173\200\200\317\164\177\177\316\153\201\201" + "\320\143\205\205\327\134\205\205\327\124\176\176\313\115\174\173\310\063\142\146\237\002\146\150\145\037\147" + "\147\147\055\147\147\147\044\147\150\147\032\144\152\144\014\140\152\140\002\036\233\036\000\146\150\146\054" + "\147\147\147\150\147\147\147\254\147\147\147\331\147\147\147\334\147\147\147\327\147\147\147\177\150\156\255" + "\003\201\201\321\176\177\177\315\261\206\206\330\251\203\203\323\234\202\202\323\233\203\203\324\223\205\205" + "\330\213\203\203\325\203\206\206\331\174\200\200\316\163\177\177\316\153\203\203\324\144\200\200\316\134\201" + "\201\321\124\200\200\316\114\202\202\323\067\153\154\254\004\145\150\145\037\147\147\147\055\147\147\147\044" + "\145\152\145\025\067\212\073\000\136\155\136\000\105\177\105\000\147\147\146\000\151\146\150\000\144\151\145" + "\010\147\147\147\171\147\147\147\335\147\147\147\326\147\147\147\221\104\124\011\003\177\176\315\103\206\206" + "\332\244\206\206\331\254\202\202\323\234\206\206\331\230\202\202\323\223\205\205\327\213\202\202\323\202\203" + "\203\324\171\205\205\327\163\201\201\320\154\176\176\314\144\201\201\320\134\205\205\330\124\201\201\320\115" + "\202\201\322\053\072\132\047\001\145\151\145\044\147\147\147\055\147\147\147\044\146\152\146\026\134\160\135" + "\002\145\154\144\000\072\203\072\000\136\157\137\000\154\143\153\000\147\147\147\000\146\147\146\103\147\147" + "\147\327\147\147\147\325\147\147\147\256\145\150\145\025\143\170\000\000\177\176\315\057\203\203\324\231\205" + "\205\327\240\176\176\313\217\201\201\321\220\174\174\310\211\174\174\311\201\200\200\320\170\176\176\314\162" + "\200\200\317\153\207\207\333\143\202\202\323\134\176\176\314\124\174\174\310\103\173\173\310\020\134\151\124" + "\005\146\150\146\054\147\147\147\054\147\147\147\044\150\150\150\034\144\147\144\017\140\151\140\003\227\076" + "\227\000\147\147\147\000\146\147\146\000\143\151\144\003\147\147\147\155\147\147\147\332\147\147\147\324\147" + "\147\147\307\147\147\147\103\150\147\161\000\137\133\225\003\174\173\307\163\202\202\322\246\203\203\324\227" + "\202\202\322\220\202\202\322\210\177\177\316\202\177\177\316\172\200\200\317\163\205\205\327\153\177\177\316" + "\142\201\201\320\134\175\174\311\120\162\160\266\036\166\166\233\000\144\151\144\023\147\147\147\063\147\147" + "\147\054\147\147\147\044\150\150\150\034\146\146\146\024\144\147\144\013\142\153\142\002\146\147\146\000\146" + "\150\146\007\147\147\147\160\147\147\147\332\147\147\147\334\147\147\147\323\147\147\147\316\147\147\147\216" + "\145\150\145\012\155\155\223\000\163\162\271\045\203\202\323\202\204\204\326\201\205\205\330\152\211\211\336" + "\212\203\203\324\203\200\200\316\173\203\203\324\163\201\201\320\154\200\200\316\144\176\176\314\134\172\171" + "\304\060\126\111\235\001\140\154\134\003\146\150\146\052\147\147\147\065\147\147\147\054\147\147\147\044\150" + "\150\150\034\146\146\146\024\146\146\146\014\142\150\142\003\222\076\212\000\147\147\147\157\147\147\147\346" + "\147\147\147\344\147\147\147\333\147\147\147\323\147\147\147\314\147\147\147\300\147\147\147\124\155\143\156" + "\000\202\204\302\000\172\167\304\020\165\163\275\017\166\164\277\013\203\203\324\123\204\203\325\172\205\205" + "\327\175\200\200\317\164\176\176\314\155\166\166\276\142\164\164\273\074\152\151\254\006\170\145\246\000\145" + "\150\145\035\147\147\147\073\147\147\147\064\147\147\147\054\147\147\147\044\150\150\150\034\147\146\147\024" + "\145\146\145\013\135\152\135\001\151\145\151\000\147\147\147\162\147\147\147\354\147\147\147\343\147\147\147" + "\334\147\147\147\325\147\147\147\314\147\147\147\304\147\147\147\255\146\150\147\076\155\142\155\000\161\161" + "\233\000\167\165\301\000\173\171\306\000\142\140\233\004\173\172\307\041\203\203\324\104\200\177\317\110\201" + "\200\320\102\176\175\313\046\170\164\306\005\172\147\252\000\143\151\144\031\146\147\146\076\147\147\147\074" + "\147\147\147\064\146\150\146\047\145\151\146\031\146\151\146\026\145\147\145\021\144\151\145\010\074\205\103" + "\000\147\147\147\000\147\147\147\034\147\147\147\304\147\147\147\347\147\147\147\323\147\147\147\271\147\147" + "\147\274\147\147\147\305\147\147\147\275\147\147\147\246\147\147\147\115\144\151\145\011\150\147\150\000\145" + "\150\145\000\146\152\212\000\200\200\315\000\257\261\377\000\000\000\011\000\257\306\304\000\167\166\237\000" + "\140\152\131\004\146\151\146\045\147\147\147\106\147\147\147\104\147\147\147\074\147\147\147\060\144\152\144" + "\015\056\226\063\000\132\163\132\001\134\160\134\002\137\156\137\001\150\143\150\000\141\154\141\000\151\144" + "\151\000\147\147\147\111\147\147\147\147\146\147\146\072\146\150\146\031\147\147\147\074\147\147\147\254\147" + "\147\147\274\147\147\147\264\147\147\147\251\147\147\147\170\146\150\146\066\145\150\145\021\141\154\141\004" + "\036\243\037\000\017\276\022\000\137\156\137\003\144\152\144\014\145\150\145\043\146\150\146\102\147\147\147" + "\122\147\147\147\114\147\147\147\104\147\147\147\074\146\150\146\053\140\154\140\004\136\155\137\000\131\164" + "\131\000\134\160\134\000\137\155\137\000\153\141\153\000\145\151\145\000\144\152\144\000\151\145\151\000\150" + "\146\150\000\147\147\147\000\146\150\146\000\147\147\147\000\147\150\146\130\147\147\147\274\147\147\147\263" + "\147\147\147\254\147\147\147\245\147\147\147\231\147\147\147\177\147\147\146\145\147\147\147\122\147\147\147" + "\115\146\147\146\123\147\147\147\135\147\147\147\142\147\147\147\135\147\147\147\124\147\147\147\114\147\147" + "\147\104\147\147\147\074\147\147\147\062\145\151\145\015\146\147\146\000\137\153\140\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\134\160\135\000\133\161\134\000\127\163\130\000\131\162\132\000" + "\075\206\100\000\152\145\152\000\147\147\147\141\147\147\147\276\147\147\147\263\147\147\147\253\147\147\147" + "\243\147\147\147\234\147\147\147\225\147\147\147\216\147\147\147\206\147\147\147\176\147\147\147\165\147\147" + "\147\154\147\147\147\144\147\147\147\135\147\147\147\125\147\147\147\114\146\146\146\104\147\147\147\074\147" + "\147\147\064\145\150\146\034\106\176\114\000\134\156\135\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\144\151\144\000\144\151\144" + "\006\147\147\147\214\147\147\147\276\147\147\147\263\147\147\147\254\147\147\147\243\147\147\147\221\147\147" + "\147\220\147\147\147\214\147\147\147\203\147\147\147\173\147\147\147\164\147\147\147\154\147\147\147\137\146" + "\150\146\100\146\150\146\057\146\147\146\104\147\147\147\105\147\147\147\074\147\147\147\065\145\150\146\042" + "\135\155\136\002\136\155\137\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\146\150\146\000\146\150\146\027\147\147\147\251\147\147" + "\147\277\147\147\147\264\147\147\147\254\147\147\147\152\145\151\145\037\146\150\146\054\147\147\147\145\147" + "\147\147\205\147\147\147\173\147\147\147\164\147\147\147\155\146\150\146\070\132\160\134\002\172\130\171\000" + "\145\150\145\023\146\147\146\067\147\147\147\074\146\150\146\046\143\152\144\011\175\141\167\000\133\155\136" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\146\150\146\000\145\150\146\007\147\147\147\116\147\147\147\234\147\147\147\263\147" + "\147\147\160\145\151\145\015\146\150\146\000\147\147\147\000\146\150\146\052\147\147\147\200\147\147\147\174" + "\147\147\147\164\147\147\147\152\145\150\145\040\146\150\146\000\134\160\134\000\147\146\147\000\143\152\143" + "\013\144\152\144\031\142\154\142\005\145\150\146\000\067\200\077\000\131\156\135\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\146" + "\150\146\000\146\150\146\000\152\145\152\000\146\150\146\030\147\147\147\103\145\150\145\017\146\147\146\000" + "\150\146\150\000\144\151\145\000\144\151\144\015\147\147\147\155\147\147\147\175\147\147\147\165\147\147\147" + "\143\144\151\144\021\144\151\145\000\131\162\131\000\375\000\374\000\146\147\146\000\155\142\154\000\143\152" + "\144\000\150\147\150\000\116\176\116\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\142\153\142\000" + "\124\166\124\000\147\150\147\000\150\146\150\000\146\147\146\000\150\146\150\000\120\170\120\000\136\156\136" + "\000\115\167\115\000\146\150\146\115\146\147\146\170\146\147\146\151\146\150\146\110\143\152\143\005\142\152" + "\143\000\000\000\000\000\072\212\100\000\073\213\077\000\073\213\076\000\076\220\070\000\000\000\000\000\000" + "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" +}; + +/** + * \brief Returns the blending rendering sprite test image as an SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlendingSprite(void) +{ + SDL_Surface *surface = SDL_CreateSurfaceFrom( + (void *)SDLTest_imageTransparentSprite.pixel_data, + SDLTest_imageTransparentSprite.width, + SDLTest_imageTransparentSprite.height, + SDLTest_imageTransparentSprite.width * SDLTest_imageTransparentSprite.bytes_per_pixel, + SDL_PIXELFORMAT_ARGB8888); + return surface; +} diff --git a/test/testautomation_images.h b/test/testautomation_images.h index 92b381e5996c6..f8541dedab8b6 100644 --- a/test/testautomation_images.h +++ b/test/testautomation_images.h @@ -34,3 +34,5 @@ SDL_Surface *SDLTest_ImageBlitBlendAll(void); SDL_Surface *SDLTest_ImageFace(void); SDL_Surface *SDLTest_ImagePrimitives(void); SDL_Surface *SDLTest_ImagePrimitivesBlend(void); +SDL_Surface *SDLTest_ImageBlendingBackground(void); +SDL_Surface *SDLTest_ImageBlendingSprite(void); diff --git a/test/testautomation_suites.h b/test/testautomation_suites.h index a962b9fcfdff5..db1b98b1cb72b 100644 --- a/test/testautomation_suites.h +++ b/test/testautomation_suites.h @@ -39,5 +39,6 @@ extern SDLTest_TestSuiteReference surfaceTestSuite; extern SDLTest_TestSuiteReference timeTestSuite; extern SDLTest_TestSuiteReference timerTestSuite; extern SDLTest_TestSuiteReference videoTestSuite; +extern SDLTest_TestSuiteReference blitTestSuite; #endif From f0238ef61503617447fd54a34db75ae073cb0936 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 12 Sep 2023 19:18:26 -0500 Subject: [PATCH 197/431] Fix build issues --- .../testautomation/testautomation.vcxproj | 3 +- test/testautomation_blit.c | 38 +++++++++++-------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/VisualC/tests/testautomation/testautomation.vcxproj b/VisualC/tests/testautomation/testautomation.vcxproj index cc5d345332d48..666c7155bfedf 100644 --- a/VisualC/tests/testautomation/testautomation.vcxproj +++ b/VisualC/tests/testautomation/testautomation.vcxproj @@ -194,6 +194,7 @@ + @@ -232,4 +233,4 @@ - + \ No newline at end of file diff --git a/test/testautomation_blit.c b/test/testautomation_blit.c index 91b7dd8929f65..9553bbeea1262 100644 --- a/test/testautomation_blit.c +++ b/test/testautomation_blit.c @@ -13,6 +13,9 @@ #include #ifndef _MSC_VER #include +#else +/* Suppress uint64 to uint32 conversion warning within the PRNG engine */ +#pragma warning( disable : 4244 ) #endif #include @@ -46,7 +49,8 @@ void blitSetUp(void *arg) { */ Uint32 *getNextRandomBuffer(const int width, const int height) { Uint32* buf = SDL_malloc(sizeof(Uint32) * width * height); - for (int i = 0; i < width * height; i++) { + int i; + for (i = 0; i < width * height; i++) { buf[i] = getRandomUint32(); } return buf; @@ -66,11 +70,12 @@ SDL_Surface* getRandomSVGASurface(Uint32 *pixels, SDL_PixelFormatEnum format) { /* * Calculates the FNV-1a hash of input pixel data */ -Uint32 FNVHash(Uint32* buf, unsigned int length) { +Uint32 FNVHash(Uint32* buf, int length) { const Uint32 fnv_prime = 0x811C9DC5; Uint32 hash = 0; + int i; - for (int i = 0; i < length; buf++, i++) + for (i = 0; i < length; buf++, i++) { hash *= fnv_prime; hash ^= (*buf); @@ -93,8 +98,8 @@ Uint32 hashSurfacePixels(SDL_Surface * surface) { int blit_testExampleApplicationRender(void *arg) { const int width = 32; const int height = 32; - const Uint32 scalar_hash = 0xf47a3f55; - const Uint32 x86_simd_hash = 0xe345d7a7; + const unsigned long scalar_hash = 0xf47a3f55; + const unsigned long x86_simd_hash = 0xe345d7a7; SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ARGB8888); SDL_Surface* rainbow_background = SDLTest_ImageBlendingBackground(); SDL_Surface* gearbrain_sprite = SDLTest_ImageBlendingSprite(); @@ -103,9 +108,9 @@ int blit_testExampleApplicationRender(void *arg) { // Blit example game sprite onto "screen" SDL_BlitSurface(gearbrain_sprite, NULL, dest_surface, NULL); // Check result - Uint32 hash = hashSurfacePixels(dest_surface); + const unsigned long hash = hashSurfacePixels(dest_surface); SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, - "Should render identically, expected 0x%x (scalar) or 0x%x (x86_simd), got 0x%x", + "Should render identically, expected 0x%lx (scalar) or 0x%lx (x86_simd), got 0x%lx", scalar_hash, x86_simd_hash, hash); // Clean up SDL_DestroySurface(rainbow_background); @@ -121,8 +126,8 @@ int blit_testExampleApplicationRender(void *arg) { int blit_testRandomToRandomSVGA(void *arg) { const int width = 800; const int height = 600; - const Uint32 scalar_hash = 0x1f56efad; - const Uint32 x86_simd_hash = 0x42140c5f; + const unsigned long scalar_hash = 0x1f56efad; + const unsigned long x86_simd_hash = 0x42140c5f; // Allocate random buffers Uint32 *dest_pixels = getNextRandomBuffer(width, height); Uint32 *src_pixels = getNextRandomBuffer(width, height); @@ -132,9 +137,9 @@ int blit_testRandomToRandomSVGA(void *arg) { // Blit surfaces SDL_BlitSurface(src_surface, NULL, dest_surface, NULL); // Check result - Uint32 hash = hashSurfacePixels(dest_surface); + const unsigned long hash = hashSurfacePixels(dest_surface); SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, - "Should render identically, expected 0x%x (scalar) or 0x%x (x86_simd), got 0x%x", + "Should render identically, expected 0x%lx (scalar) or 0x%lx (x86_simd), got 0x%lx", scalar_hash, x86_simd_hash, hash); // Clean up SDL_DestroySurface(dest_surface); @@ -151,13 +156,14 @@ int blit_testRandomToRandomSVGA(void *arg) { int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { const int width = 800; const int height = 600; - const Uint32 x86_simd_hash = 0x2626be78; - const Uint32 scalar_hash = 0xfb2a8ee8; + int i; + const unsigned long x86_simd_hash = 0x2626be78; + const unsigned long scalar_hash = 0xfb2a8ee8; // Create blank source surface SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ABGR8888); // Perform 250k random blits into random areas of the blank surface - for (int i = 0; i < 250000; i++) { + for (i = 0; i < 250000; i++) { Uint32 *buf = getNextRandomBuffer(15, 15); SDL_Surface *sourceSurface = getRandomBlitChunk(buf, SDL_PIXELFORMAT_RGBA8888); @@ -172,12 +178,12 @@ int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { SDL_free(buf); } // Check result - Uint32 hash = hashSurfacePixels(dest_surface); + const unsigned long hash = hashSurfacePixels(dest_surface); // Clean up SDL_SaveBMP(dest_surface, "250k_scalar.bmp"); SDL_DestroySurface(dest_surface); SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, - "Should render identically, expected 0x%x (scalar) or 0x%x (x86_simd), got 0x%x", + "Should render identically, expected 0x%lx (scalar) or 0x%lx (x86_simd), got 0x%lx", scalar_hash, x86_simd_hash, hash); return TEST_COMPLETED; } From f5ee88c2cfd60df3e418c576991be2002ec37caf Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 12 Sep 2023 22:28:08 -0500 Subject: [PATCH 198/431] Implement mathematically correct scalar blitters --- src/video/SDL_blit_A.c | 135 ++++++---------------------------- src/video/SDL_blit_A_avx2.c | 10 ++- src/video/SDL_blit_A_sse4_1.c | 10 ++- test/testautomation_blit.c | 25 +++---- 4 files changed, 46 insertions(+), 134 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 1cdbaf35909a2..ed3c941e04c46 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -546,112 +546,6 @@ static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) } } -/* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void BlitRGBtoRGBPixelAlpha(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *)info->dst; - int dstskip = info->dst_skip >> 2; - - while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - 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 = *srcp; - } else { - /* - * take out the middle component (green), and process - * the other two in parallel. One multiply less. - */ - d = *dstp; - dalpha = d >> 24; - s1 = s & 0xff00ff; - d1 = d & 0xff00ff; - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; - s &= 0xff00; - d &= 0xff00; - d = (d + ((s - d) * alpha >> 8)) & 0xff00; - dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8); - *dstp = d1 | d | (dalpha << 24); - } - } - ++srcp; - ++dstp; - }, width); - /* *INDENT-ON* */ /* clang-format on */ - srcp += srcskip; - dstp += dstskip; - } -} - -/* fast ARGB888->(A)BGR888 blending with pixel alpha */ -static void BlitRGBtoBGRPixelAlpha(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *)info->dst; - int dstskip = info->dst_skip >> 2; - - while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - 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) { - /* - * take out the middle component (green), and process - * the other two in parallel. One multiply less. - */ - s1 = s & 0xff00ff; - s1 = (s1 >> 16) | (s1 << 16); - s &= 0xff00; - - if (alpha == SDL_ALPHA_OPAQUE) { - *dstp = 0xff000000 | s | s1; - } else { - d = *dstp; - dalpha = d >> 24; - d1 = d & 0xff00ff; - d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff; - d &= 0xff00; - d = (d + ((s - d) * alpha >> 8)) & 0xff00; - dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8); - *dstp = d1 | d | (dalpha << 24); - } - } - ++srcp; - ++dstp; - }, width); - /* *INDENT-ON* */ /* clang-format on */ - srcp += srcskip; - dstp += dstskip; - } -} - /* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */ /* blend a single 16 bit pixel at 50% */ @@ -1285,6 +1179,15 @@ static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) } } +/* Accurate alpha blending with no division */ +static Uint8 AlphaBlendChannel(Uint8 sC, Uint8 dC, Uint8 sA) +{ + Uint16 x = ((sC - dC) * sA) + ((dC << 8) - dC); + x += 0x1U; // Use 0x80 to round instead of floor + x += x >> 8; + return x >> 8; +} + /* General (slow) N->N blending with pixel alpha */ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) { @@ -1298,6 +1201,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) SDL_PixelFormat *dstfmt = info->dst_fmt; int srcbpp; int dstbpp; + int freeFormat; Uint32 Pixel; unsigned sR, sG, sB, sA; unsigned dR, dG, dB, dA; @@ -1305,6 +1209,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) /* Set up some basic variables */ srcbpp = srcfmt->bytes_per_pixel; dstbpp = dstfmt->bytes_per_pixel; + freeFormat = 0; #ifdef SDL_AVX2_INTRINSICS if (srcbpp == 4 && dstbpp == 4 && width >= 4 && SDL_HasAVX2()) { @@ -1319,6 +1224,11 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) return; } #endif + /* Handle case where bad input sent */ + if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { + dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); + freeFormat = 1; + } while (height--) { /* *INDENT-OFF* */ /* clang-format off */ @@ -1327,7 +1237,10 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); if (sA) { DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); - ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); + dR = AlphaBlendChannel(sR, dR, sA); + dG = AlphaBlendChannel(sG, dG, sA); + dB = AlphaBlendChannel(sB, dB, sA); + dA = AlphaBlendChannel(255, dA, sA); ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); } src += srcbpp; @@ -1338,6 +1251,9 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) src += srcskip; dst += dstskip; } + if (freeFormat) { + SDL_DestroyPixelFormat(dstfmt); + } } SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) @@ -1406,11 +1322,6 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) return BlitRGBtoRGBPixelAlphaARMSIMD; } #endif - return BlitRGBtoRGBPixelAlpha; - } - } else if (sf->Rmask == df->Bmask && sf->Gmask == df->Gmask && sf->Bmask == df->Rmask && sf->bytes_per_pixel == 4) { - if (sf->Amask == 0xff000000) { - return BlitRGBtoBGRPixelAlpha; } } return BlitNtoNPixelAlpha; diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index ed2bfc1bfe8eb..8f4b3f3561cf4 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -89,9 +89,13 @@ __m256i SDL_TARGETING("avx2") MixRGBA_AVX2(__m256i src, __m256i dst, const __m25 dst_hi = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_hi, dst_hi), srca_hi), _mm256_sub_epi16(_mm256_slli_epi16(dst_hi, 8), dst_hi)); - // dst = (dst * 0x8081) >> 23 - dst_lo = _mm256_srli_epi16(_mm256_mulhi_epu16(dst_lo, _mm256_set1_epi16(-0x7F7F)), 7); - dst_hi = _mm256_srli_epi16(_mm256_mulhi_epu16(dst_hi, _mm256_set1_epi16(-0x7F7F)), 7); + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1)); + dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1)); + + // dst += dst >> 8 + dst_lo = _mm256_srli_epi16(_mm256_add_epi16(dst_lo, _mm256_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm256_srli_epi16(_mm256_add_epi16(dst_hi, _mm256_srli_epi16(dst_hi, 8)), 8); dst = _mm256_packus_epi16(dst_lo, dst_hi); return dst; diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 34355e8c950a3..e243561d8b6b4 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -90,9 +90,13 @@ __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srca_hi), _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); - // dst = (dst * 0x8081) >> 23 - dst_lo = _mm_srli_epi16(_mm_mulhi_epu16(dst_lo, _mm_set1_epi16(-0x7F7F)), 7); - dst_hi = _mm_srli_epi16(_mm_mulhi_epu16(dst_hi, _mm_set1_epi16(-0x7F7F)), 7); + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); + dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); + + // dst += dst >> 8; + dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); dst = _mm_packus_epi16(dst_lo, dst_hi); return dst; diff --git a/test/testautomation_blit.c b/test/testautomation_blit.c index 9553bbeea1262..dc745a9d8b33b 100644 --- a/test/testautomation_blit.c +++ b/test/testautomation_blit.c @@ -98,8 +98,7 @@ Uint32 hashSurfacePixels(SDL_Surface * surface) { int blit_testExampleApplicationRender(void *arg) { const int width = 32; const int height = 32; - const unsigned long scalar_hash = 0xf47a3f55; - const unsigned long x86_simd_hash = 0xe345d7a7; + const unsigned long correct_hash = 0xe345d7a7; SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ARGB8888); SDL_Surface* rainbow_background = SDLTest_ImageBlendingBackground(); SDL_Surface* gearbrain_sprite = SDLTest_ImageBlendingSprite(); @@ -109,9 +108,8 @@ int blit_testExampleApplicationRender(void *arg) { SDL_BlitSurface(gearbrain_sprite, NULL, dest_surface, NULL); // Check result const unsigned long hash = hashSurfacePixels(dest_surface); - SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, - "Should render identically, expected 0x%lx (scalar) or 0x%lx (x86_simd), got 0x%lx", - scalar_hash, x86_simd_hash, hash); + SDLTest_AssertCheck(hash == correct_hash, + "Should render identically, expected hash 0x%lx, got 0x%lx", correct_hash, hash); // Clean up SDL_DestroySurface(rainbow_background); SDL_DestroySurface(gearbrain_sprite); @@ -126,8 +124,7 @@ int blit_testExampleApplicationRender(void *arg) { int blit_testRandomToRandomSVGA(void *arg) { const int width = 800; const int height = 600; - const unsigned long scalar_hash = 0x1f56efad; - const unsigned long x86_simd_hash = 0x42140c5f; + const unsigned long correct_hash = 0x42140c5f; // Allocate random buffers Uint32 *dest_pixels = getNextRandomBuffer(width, height); Uint32 *src_pixels = getNextRandomBuffer(width, height); @@ -138,9 +135,8 @@ int blit_testRandomToRandomSVGA(void *arg) { SDL_BlitSurface(src_surface, NULL, dest_surface, NULL); // Check result const unsigned long hash = hashSurfacePixels(dest_surface); - SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, - "Should render identically, expected 0x%lx (scalar) or 0x%lx (x86_simd), got 0x%lx", - scalar_hash, x86_simd_hash, hash); + SDLTest_AssertCheck(hash == correct_hash, + "Should render identically, expected hash 0x%lx, got 0x%lx", correct_hash, hash); // Clean up SDL_DestroySurface(dest_surface); SDL_DestroySurface(src_surface); @@ -157,8 +153,7 @@ int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { const int width = 800; const int height = 600; int i; - const unsigned long x86_simd_hash = 0x2626be78; - const unsigned long scalar_hash = 0xfb2a8ee8; + const unsigned long correct_hash = 0x5d26be78; // Create blank source surface SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ABGR8888); @@ -180,11 +175,9 @@ int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { // Check result const unsigned long hash = hashSurfacePixels(dest_surface); // Clean up - SDL_SaveBMP(dest_surface, "250k_scalar.bmp"); SDL_DestroySurface(dest_surface); - SDLTest_AssertCheck(hash == scalar_hash || hash == x86_simd_hash, - "Should render identically, expected 0x%lx (scalar) or 0x%lx (x86_simd), got 0x%lx", - scalar_hash, x86_simd_hash, hash); + SDLTest_AssertCheck(hash == correct_hash, + "Should render identically, expected hash 0x%lx, got 0x%lx", correct_hash, hash); return TEST_COMPLETED; } From adca9d408e45247d7eb9b1bb30b3e550c12cb9fe Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 12 Sep 2023 22:58:01 -0500 Subject: [PATCH 199/431] Fixup tests to use correct types --- test/testautomation_blit.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/test/testautomation_blit.c b/test/testautomation_blit.c index dc745a9d8b33b..a2d2fd0a033f3 100644 --- a/test/testautomation_blit.c +++ b/test/testautomation_blit.c @@ -98,7 +98,7 @@ Uint32 hashSurfacePixels(SDL_Surface * surface) { int blit_testExampleApplicationRender(void *arg) { const int width = 32; const int height = 32; - const unsigned long correct_hash = 0xe345d7a7; + const Uint32 correct_hash = 0xe345d7a7; SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ARGB8888); SDL_Surface* rainbow_background = SDLTest_ImageBlendingBackground(); SDL_Surface* gearbrain_sprite = SDLTest_ImageBlendingSprite(); @@ -107,9 +107,10 @@ int blit_testExampleApplicationRender(void *arg) { // Blit example game sprite onto "screen" SDL_BlitSurface(gearbrain_sprite, NULL, dest_surface, NULL); // Check result - const unsigned long hash = hashSurfacePixels(dest_surface); + const Uint32 hash = hashSurfacePixels(dest_surface); SDLTest_AssertCheck(hash == correct_hash, - "Should render identically, expected hash 0x%lx, got 0x%lx", correct_hash, hash); + "Should render identically, expected hash 0x%" SDL_PRIx32 ", got 0x%" SDL_PRIx32, + correct_hash, hash); // Clean up SDL_DestroySurface(rainbow_background); SDL_DestroySurface(gearbrain_sprite); @@ -124,7 +125,7 @@ int blit_testExampleApplicationRender(void *arg) { int blit_testRandomToRandomSVGA(void *arg) { const int width = 800; const int height = 600; - const unsigned long correct_hash = 0x42140c5f; + const Uint32 correct_hash = 0x42140c5f; // Allocate random buffers Uint32 *dest_pixels = getNextRandomBuffer(width, height); Uint32 *src_pixels = getNextRandomBuffer(width, height); @@ -134,9 +135,10 @@ int blit_testRandomToRandomSVGA(void *arg) { // Blit surfaces SDL_BlitSurface(src_surface, NULL, dest_surface, NULL); // Check result - const unsigned long hash = hashSurfacePixels(dest_surface); + const Uint32 hash = hashSurfacePixels(dest_surface); SDLTest_AssertCheck(hash == correct_hash, - "Should render identically, expected hash 0x%lx, got 0x%lx", correct_hash, hash); + "Should render identically, expected hash 0x%" SDL_PRIx32 ", got 0x%" SDL_PRIx32, + correct_hash, hash); // Clean up SDL_DestroySurface(dest_surface); SDL_DestroySurface(src_surface); @@ -153,7 +155,7 @@ int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { const int width = 800; const int height = 600; int i; - const unsigned long correct_hash = 0x5d26be78; + const Uint32 correct_hash = 0x5d26be78; // Create blank source surface SDL_Surface* dest_surface = SDL_CreateSurface(width, height, SDL_PIXELFORMAT_ABGR8888); @@ -173,11 +175,12 @@ int blit_testRandomToRandomSVGAMultipleIterations(void *arg) { SDL_free(buf); } // Check result - const unsigned long hash = hashSurfacePixels(dest_surface); + const Uint32 hash = hashSurfacePixels(dest_surface); // Clean up SDL_DestroySurface(dest_surface); SDLTest_AssertCheck(hash == correct_hash, - "Should render identically, expected hash 0x%lx, got 0x%lx", correct_hash, hash); + "Should render identically, expected hash 0x%" SDL_PRIx32 ", got 0x%" SDL_PRIx32, + correct_hash, hash); return TEST_COMPLETED; } From 3ecb9275874f4f7c12b8b799df0e13ebcfaa0e19 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 12 Sep 2023 23:18:57 -0500 Subject: [PATCH 200/431] Remove last non-SDL types from test --- test/testautomation_blit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testautomation_blit.c b/test/testautomation_blit.c index a2d2fd0a033f3..d2e7e23d84841 100644 --- a/test/testautomation_blit.c +++ b/test/testautomation_blit.c @@ -24,8 +24,8 @@ #include "testautomation_images.h" /* ====== xoroshiro128+ PRNG engine for deterministic blit input ===== */ -Uint64 rotl(uint64_t x, int k) { return (x << k) | (x >> (-k & 63)); } -Uint64 next(uint64_t state[2]) { +Uint64 rotl(Uint64 x, int k) { return (x << k) | (x >> (-k & 63)); } +Uint64 next(Uint64 state[2]) { Uint64 s0 = state[0], s1 = state[1]; Uint64 result = rotl((s0 + s1) * 9, 29) + s0; state[0] = s0 ^ rotl(s1, 29); From 0f351cd6af832663ebd00e20719010d15c853417 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Wed, 13 Sep 2023 10:10:14 -0500 Subject: [PATCH 201/431] Remove ARM32 assembly/pixman blitters --- CMakeLists.txt | 62 -- cmake/3rdparty.cmake | 4 - src/video/SDL_blit.h | 6 - src/video/SDL_blit_A.c | 88 +- src/video/SDL_fillrect.c | 83 +- src/video/arm/pixman-arm-asm.h | 36 - src/video/arm/pixman-arm-neon-asm.S | 375 --------- src/video/arm/pixman-arm-neon-asm.h | 1184 --------------------------- src/video/arm/pixman-arm-simd-asm.S | 532 ------------ src/video/arm/pixman-arm-simd-asm.h | 1034 ----------------------- 10 files changed, 3 insertions(+), 3401 deletions(-) delete mode 100644 src/video/arm/pixman-arm-asm.h delete mode 100644 src/video/arm/pixman-arm-neon-asm.S delete mode 100644 src/video/arm/pixman-arm-neon-asm.h delete mode 100644 src/video/arm/pixman-arm-simd-asm.S delete mode 100644 src/video/arm/pixman-arm-simd-asm.h diff --git a/CMakeLists.txt b/CMakeLists.txt index a40bc609a4c14..14be990895425 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -292,7 +292,6 @@ dep_option(SDL_MMX "Use MMX assembly routines" ON "SDL_ASSEMBLY; dep_option(SDL_ALTIVEC "Use Altivec assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_POWERPC32 OR SDL_CPU_POWERPC64" OFF) dep_option(SDL_ARMSIMD "Use SIMD assembly blitters on ARM" OFF "SDL_ASSEMBLY;SDL_CPU_ARM32" OFF) dep_option(SDL_ARMNEON "Use NEON assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_ARM32 OR SDL_CPU_ARM64" OFF) -dep_option(SDL_ARMNEON_BLITTERS "Use NEON assembly blitters on ARM32" OFF "SDL_VIDEO;SDL_ASSEMBLY;SDL_ARMNEON;SDL_CPU_ARM32" OFF) dep_option(SDL_LSX "Use LSX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF) dep_option(SDL_LASX "Use LASX assembly routines" ON "SDL_ASSEMBLY;SDL_CPU_LOONGARCH64" OFF) @@ -883,67 +882,6 @@ if(SDL_ASSEMBLY) endif() endif() - if(SDL_ARMSIMD) - cmake_push_check_state() - string(APPEND CMAKE_REQUIRED_FLAGS " -x assembler-with-cpp") - list(APPEND CMAKE_REQUIRED_LINK_OPTIONS -x none) - check_c_source_compiles(" - .text - .arch armv6 - .object_arch armv4 - .arm - .altmacro - #ifndef __ARM_EABI__ - #error EABI is required (to be sure that calling conventions are compatible) - #endif - main: - .global main - pld [r0] - uqadd8 r0, r0, r0 - " ARMSIMD_FOUND) - cmake_pop_check_state() - - if(ARMSIMD_FOUND) - set(HAVE_ARMSIMD TRUE) - set(SDL_ARM_SIMD_BLITTERS 1) - enable_language(ASM) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-simd*.S") - set_property(SOURCE ${ARMSIMD_SOURCES} APPEND PROPERTY COMPILE_OPTIONS -x assembler-with-cpp) - set(WARN_ABOUT_ARM_SIMD_ASM_MIT TRUE) - endif() - endif() - - if(SDL_ARMNEON_BLITTERS) - cmake_push_check_state() - string(APPEND CMAKE_REQUIRED_FLAGS " -x assembler-with-cpp") - list(APPEND CMAKE_REQUIRED_LINK_OPTIONS -x none) - check_c_source_compiles(" - .text - .fpu neon - .arch armv7a - .object_arch armv4 - .eabi_attribute 10, 0 - .arm - .altmacro - #ifndef __ARM_EABI__ - #error EABI is required (to be sure that calling conventions are compatible) - #endif - main: - .global main - pld [r0] - vmovn.u16 d0, q0 - " COMPILER_SUPPORTS_ARMNEON_ASSEMBLY) - cmake_pop_check_state() - if(COMPILER_SUPPORTS_ARMNEON_ASSEMBLY) - set(HAVE_ARMNEON_BLITTERS TRUE) - set(SDL_ARM_NEON_BLITTERS 1) - enable_language(ASM) - sdl_glob_sources("${SDL3_SOURCE_DIR}/src/video/arm/pixman-arm-neon*.S") - set_property(SOURCE ${ARMNEON_SOURCES} APPEND PROPERTY COMPILE_OPTIONS -x assembler-with-cpp) - set(WARN_ABOUT_ARM_NEON_ASM_MIT TRUE) - endif() - endif() - if(SDL_ARMNEON) check_c_source_compiles(" #include diff --git a/cmake/3rdparty.cmake b/cmake/3rdparty.cmake index becb6d3abebe3..8b38a5ded6b6c 100644 --- a/cmake/3rdparty.cmake +++ b/cmake/3rdparty.cmake @@ -25,10 +25,6 @@ function(get_clang_tidy_ignored_files OUTVAR) # HIDAPI Steam controller "controller_constants.h" "controller_structs.h" - # Nokia Pixman - "pixman-arm-asm.h" - "pixman-arm-neon-asm.h" - "pixman-arm-simd-asm.h" # YUV2RGB "yuv_rgb.c" "yuv_rgb_lsx_func.h" diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index ba5b95904e3a1..90588153adbe7 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -23,12 +23,6 @@ #ifndef SDL_blit_h_ #define SDL_blit_h_ -/* pixman ARM blitters are 32 bit only : */ -#if defined(__aarch64__) || defined(_M_ARM64) -#undef SDL_ARM_SIMD_BLITTERS -#undef SDL_ARM_NEON_BLITTERS -#endif - /* Table to do pixel byte expansion */ extern const Uint8 *SDL_expand_byte[9]; extern const Uint16 SDL_expand_byte_10[]; diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index ed3c941e04c46..7f272fd0905cc 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -421,66 +421,6 @@ static void SDL_TARGETING("mmx") BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) #endif /* SDL_MMX_INTRINSICS */ -#ifdef SDL_ARM_SIMD_BLITTERS -void BlitARGBto565PixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); - -static void BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo *info) -{ - int32_t width = info->dst_w; - int32_t height = info->dst_h; - uint16_t *dstp = (uint16_t *)info->dst; - int32_t dststride = width + (info->dst_skip >> 1); - uint32_t *srcp = (uint32_t *)info->src; - int32_t srcstride = width + (info->src_skip >> 2); - - BlitARGBto565PixelAlphaARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride); -} - -void BlitRGBtoRGBPixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); - -static void BlitRGBtoRGBPixelAlphaARMSIMD(SDL_BlitInfo *info) -{ - int32_t width = info->dst_w; - int32_t height = info->dst_h; - uint32_t *dstp = (uint32_t *)info->dst; - int32_t dststride = width + (info->dst_skip >> 2); - uint32_t *srcp = (uint32_t *)info->src; - int32_t srcstride = width + (info->src_skip >> 2); - - BlitRGBtoRGBPixelAlphaARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride); -} -#endif - -#ifdef SDL_ARM_NEON_BLITTERS -void BlitARGBto565PixelAlphaARMNEONAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); - -static void BlitARGBto565PixelAlphaARMNEON(SDL_BlitInfo *info) -{ - int32_t width = info->dst_w; - int32_t height = info->dst_h; - uint16_t *dstp = (uint16_t *)info->dst; - int32_t dststride = width + (info->dst_skip >> 1); - uint32_t *srcp = (uint32_t *)info->src; - int32_t srcstride = width + (info->src_skip >> 2); - - BlitARGBto565PixelAlphaARMNEONAsm(width, height, dstp, dststride, srcp, srcstride); -} - -void BlitRGBtoRGBPixelAlphaARMNEONAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); - -static void BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo *info) -{ - int32_t width = info->dst_w; - int32_t height = info->dst_h; - uint32_t *dstp = (uint32_t *)info->dst; - int32_t dststride = width + (info->dst_skip >> 2); - uint32_t *srcp = (uint32_t *)info->src; - int32_t srcstride = width + (info->src_skip >> 2); - - BlitRGBtoRGBPixelAlphaARMNEONAsm(width, height, dstp, dststride, srcp, srcstride); -} -#endif - /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info) { @@ -1274,21 +1214,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } case 2: -#if defined(SDL_ARM_NEON_BLITTERS) || defined(SDL_ARM_SIMD_BLITTERS) - if (sf->bytes_per_pixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && df->Gmask == 0x7e0 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { -#ifdef SDL_ARM_NEON_BLITTERS - if (SDL_HasNEON()) { - return BlitARGBto565PixelAlphaARMNEON; - } -#endif -#ifdef SDL_ARM_SIMD_BLITTERS - if (SDL_HasARMSIMD()) { - return BlitARGBto565PixelAlphaARMSIMD; - } -#endif - } -#endif - if (sf->bytes_per_pixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { + 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) { @@ -1311,18 +1237,6 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } } #endif /* SDL_MMX_INTRINSICS */ - if (sf->Amask == 0xff000000) { -#ifdef SDL_ARM_NEON_BLITTERS - if (SDL_HasNEON()) { - return BlitRGBtoRGBPixelAlphaARMNEON; - } -#endif -#ifdef SDL_ARM_SIMD_BLITTERS - if (SDL_HasARMSIMD()) { - return BlitRGBtoRGBPixelAlphaARMSIMD; - } -#endif - } } return BlitNtoNPixelAlpha; diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index e38d7f73d90b7..04aa925fbeaf7 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -247,54 +247,6 @@ int SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) return SDL_FillSurfaceRects(dst, rect, 1, color); } -#ifdef SDL_ARM_NEON_BLITTERS -void FillSurfaceRect8ARMNEONAsm(int32_t w, int32_t h, uint8_t *dst, int32_t dst_stride, uint8_t src); -void FillSurfaceRect16ARMNEONAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint16_t src); -void FillSurfaceRect32ARMNEONAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t src); - -static void fill_8_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) -{ - FillSurfaceRect8ARMNEONAsm(w, h, (uint8_t *)pixels, pitch >> 0, color); - return; -} - -static void fill_16_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) -{ - FillSurfaceRect16ARMNEONAsm(w, h, (uint16_t *)pixels, pitch >> 1, color); - return; -} - -static void fill_32_neon(Uint8 *pixels, int pitch, Uint32 color, int w, int h) -{ - FillSurfaceRect32ARMNEONAsm(w, h, (uint32_t *)pixels, pitch >> 2, color); - return; -} -#endif - -#ifdef SDL_ARM_SIMD_BLITTERS -void FillSurfaceRect8ARMSIMDAsm(int32_t w, int32_t h, uint8_t *dst, int32_t dst_stride, uint8_t src); -void FillSurfaceRect16ARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int32_t dst_stride, uint16_t src); -void FillSurfaceRect32ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t src); - -static void fill_8_simd(Uint8 *pixels, int pitch, Uint32 color, int w, int h) -{ - FillSurfaceRect8ARMSIMDAsm(w, h, (uint8_t *)pixels, pitch >> 0, color); - return; -} - -static void fill_16_simd(Uint8 *pixels, int pitch, Uint32 color, int w, int h) -{ - FillSurfaceRect16ARMSIMDAsm(w, h, (uint16_t *)pixels, pitch >> 1, color); - return; -} - -static void fill_32_simd(Uint8 *pixels, int pitch, Uint32 color, int w, int h) -{ - FillSurfaceRect32ARMSIMDAsm(w, h, (uint32_t *)pixels, pitch >> 2, color); - return; -} -#endif - int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color) { @@ -339,39 +291,8 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, return SDL_SetError("SDL_FillSurfaceRects(): Unsupported surface format"); } -#ifdef SDL_ARM_NEON_BLITTERS - if (SDL_HasNEON() && dst->format->bytes_per_pixel != 3 && !fill_function) { - switch (dst->format->bytes_per_pixel) { - case 1: - fill_function = fill_8_neon; - break; - case 2: - fill_function = fill_16_neon; - break; - case 4: - fill_function = fill_32_neon; - break; - } - } -#endif -#ifdef SDL_ARM_SIMD_BLITTERS - if (SDL_HasARMSIMD() && dst->format->bytes_per_pixel != 3 && !fill_function) { - switch (dst->format->bytes_per_pixel) { - case 1: - fill_function = fill_8_simd; - break; - case 2: - fill_function = fill_16_simd; - break; - case 4: - fill_function = fill_32_simd; - break; - } - } -#endif - - if (!fill_function) { - switch (dst->format->bytes_per_pixel) { + if (fill_function == NULL) { + switch (dst->format->BytesPerPixel) { case 1: { color |= (color << 8); diff --git a/src/video/arm/pixman-arm-asm.h b/src/video/arm/pixman-arm-asm.h deleted file mode 100644 index 3f13ba0495da5..0000000000000 --- a/src/video/arm/pixman-arm-asm.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright © 2010 Nokia Corporation - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Mozilla Corporation not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Mozilla Corporation makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS - * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS 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. - * - * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com) - * - */ - -/* Supplementary macro for setting function attributes */ -.macro pixman_asm_function fname - .func fname - .global fname -#ifdef __ELF__ - .hidden fname - .type fname, %function -#endif -fname: -.endm diff --git a/src/video/arm/pixman-arm-neon-asm.S b/src/video/arm/pixman-arm-neon-asm.S deleted file mode 100644 index f9549621acbd2..0000000000000 --- a/src/video/arm/pixman-arm-neon-asm.S +++ /dev/null @@ -1,375 +0,0 @@ -/* - * Copyright © 2009 Nokia Corporation - * - * 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 (including the next - * paragraph) 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. - * - * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com) - */ - -/* - * Copyright (c) 2018 RISC OS Open Ltd - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -/* Prevent the stack from becoming executable for no reason... */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif - - .text - .fpu neon - .arch armv7a - .object_arch armv4 - .eabi_attribute 10, 0 /* suppress Tag_FP_arch */ - .eabi_attribute 12, 0 /* suppress Tag_Advanced_SIMD_arch */ - .arm - .altmacro - .p2align 2 - -#include "pixman-arm-asm.h" -#include "pixman-arm-neon-asm.h" - -/* Global configuration options and preferences */ - -/* - * The code can optionally make use of unaligned memory accesses to improve - * performance of handling leading/trailing pixels for each scanline. - * Configuration variable RESPECT_STRICT_ALIGNMENT can be set to 0 for - * example in linux if unaligned memory accesses are not configured to - * generate.exceptions. - */ -.set RESPECT_STRICT_ALIGNMENT, 1 - -/* - * Set default prefetch type. There is a choice between the following options: - * - * PREFETCH_TYPE_NONE (may be useful for the ARM cores where PLD is set to work - * as NOP to workaround some HW bugs or for whatever other reason) - * - * PREFETCH_TYPE_SIMPLE (may be useful for simple single-issue ARM cores where - * advanced prefetch introduces heavy overhead) - * - * PREFETCH_TYPE_ADVANCED (useful for superscalar cores such as ARM Cortex-A8 - * which can run ARM and NEON instructions simultaneously so that extra ARM - * instructions do not add (many) extra cycles, but improve prefetch efficiency) - * - * Note: some types of function can't support advanced prefetch and fallback - * to simple one (those which handle 24bpp pixels) - */ -.set PREFETCH_TYPE_DEFAULT, PREFETCH_TYPE_ADVANCED - -/* Prefetch distance in pixels for simple prefetch */ -.set PREFETCH_DISTANCE_SIMPLE, 64 - -/******************************************************************************/ - -/* We can actually do significantly better than the Pixman macros, at least for - * the case of fills, by using a carefully scheduled inner loop. Cortex-A53 - * shows an improvement of up to 78% in ideal cases (large fills to L1 cache). - */ - -.macro generate_fillrect_function name, bpp, log2Bpp -/* - * void name(int32_t w, int32_t h, uint8_t *dst, int32_t dst_stride, uint8_t src); - * On entry: - * a1 = width, pixels - * a2 = height, rows - * a3 = pointer to top-left destination pixel - * a4 = stride, pixels - * [sp] = pixel value to fill with - * Within the function: - * v1 = width remaining - * v2 = vst offset - * v3 = alternate pointer - * ip = data ARM register - */ -pixman_asm_function name - vld1.\bpp {d0[],d1[]}, [sp] - sub a4, a1 - vld1.\bpp {d2[],d3[]}, [sp] - cmp a1, #(15+64) >> \log2Bpp - push {v1-v3,lr} - vmov ip, s0 - blo 51f - - /* Long-row case */ - mov v2, #64 -1: mov v1, a1 - ands v3, a3, #15 - beq 2f - /* Leading pixels */ - rsb v3, v3, #16 /* number of leading bytes until 16-byte aligned */ - sub v1, v1, v3, lsr #\log2Bpp - rbit v3, v3 -.if bpp <= 16 -.if bpp == 8 - tst a3, #1 /* bit 0 unaffected by rsb so can avoid register interlock */ - strneb ip, [a3], #1 - tst v3, #1<<30 -.else - tst a3, #2 /* bit 1 unaffected by rsb (assuming halfword alignment) so can avoid register interlock */ -.endif - strneh ip, [a3], #2 -.endif - movs v3, v3, lsl #3 - vstmcs a3!, {s0} - vstmmi a3!, {d0} -2: sub v1, v1, #64 >> \log2Bpp /* simplifies inner loop termination */ - add v3, a3, #32 - /* Inner loop */ -3: vst1.\bpp {q0-q1}, [a3 :128], v2 - subs v1, v1, #64 >> \log2Bpp - vst1.\bpp {q0-q1}, [v3 :128], v2 - bhs 3b - /* Trailing pixels */ -4: movs v1, v1, lsl #27 + \log2Bpp - bcc 5f - vst1.\bpp {q0-q1}, [a3 :128]! -5: bpl 6f - vst1.\bpp {q0}, [a3 :128]! -6: movs v1, v1, lsl #2 - vstmcs a3!, {d0} - vstmmi a3!, {s0} -.if bpp <= 16 - movs v1, v1, lsl #2 - strcsh ip, [a3], #2 -.if bpp == 8 - strmib ip, [a3], #1 -.endif -.endif - subs a2, a2, #1 - add a3, a3, a4, lsl #\log2Bpp - bhi 1b - pop {v1-v3,pc} - - /* Short-row case */ -51: movs v1, a1 -.if bpp == 8 - tst a3, #3 - beq 53f -52: subs v1, v1, #1 - blo 57f - strb ip, [a3], #1 - tst a3, #3 - bne 52b -.elseif bpp == 16 - tstne a3, #2 - subne v1, v1, #1 - strneh ip, [a3], #2 -.endif -53: cmp v1, #32 >> \log2Bpp - bcc 54f - vst1.\bpp {q0-q1}, [a3]! - sub v1, v1, #32 >> \log2Bpp - /* Trailing pixels */ -54: movs v1, v1, lsl #27 + \log2Bpp - bcc 55f - vst1.\bpp {q0-q1}, [a3]! -55: bpl 56f - vst1.\bpp {q0}, [a3]! -56: movs v1, v1, lsl #2 - vstmcs a3!, {d0} - vstmmi a3!, {s0} -.if bpp <= 16 - movs v1, v1, lsl #2 - strcsh ip, [a3], #2 -.if bpp == 8 - strmib ip, [a3], #1 -.endif -.endif - subs a2, a2, #1 - add a3, a3, a4, lsl #\log2Bpp - bhi 51b -57: pop {v1-v3,pc} - -.endfunc -.endm - -generate_fillrect_function FillSurfaceRect32ARMNEONAsm, 32, 2 -generate_fillrect_function FillSurfaceRect16ARMNEONAsm, 16, 1 -generate_fillrect_function FillSurfaceRect8ARMNEONAsm, 8, 0 - -/******************************************************************************/ - -.macro RGBtoRGBPixelAlpha_process_pixblock_head - vmvn d30, d3 /* get inverted source alpha */ - vmov d31, d7 /* dest alpha is always unchanged */ - vmull.u8 q14, d0, d3 - vmlal.u8 q14, d4, d30 - vmull.u8 q0, d1, d3 - vmlal.u8 q0, d5, d30 - vmull.u8 q1, d2, d3 - vmlal.u8 q1, d6, d30 - vrshr.u16 q2, q14, #8 - vrshr.u16 q3, q0, #8 - vraddhn.u16 d28, q14, q2 - vrshr.u16 q2, q1, #8 - vraddhn.u16 d29, q0, q3 - vraddhn.u16 d30, q1, q2 -.endm - -.macro RGBtoRGBPixelAlpha_process_pixblock_tail - /* nothing */ -.endm - -.macro RGBtoRGBPixelAlpha_process_pixblock_tail_head - vld4.8 {d0-d3}, [SRC]! - PF add PF_X, PF_X, #8 - vst4.8 {d28-d31}, [DST_W :128]! - PF tst PF_CTL, #0xF - vld4.8 {d4-d7}, [DST_R :128]! - PF addne PF_X, PF_X, #8 - vmvn d30, d3 /* get inverted source alpha */ - vmov d31, d7 /* dest alpha is always unchanged */ - vmull.u8 q14, d0, d3 - PF subne PF_CTL, PF_CTL, #1 - vmlal.u8 q14, d4, d30 - PF cmp PF_X, ORIG_W - vmull.u8 q0, d1, d3 - PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] - vmlal.u8 q0, d5, d30 - PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] - vmull.u8 q1, d2, d3 - PF subge PF_X, PF_X, ORIG_W - vmlal.u8 q1, d6, d30 - PF subges PF_CTL, PF_CTL, #0x10 - vrshr.u16 q2, q14, #8 - PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! - vrshr.u16 q3, q0, #8 - PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! - vraddhn.u16 d28, q14, q2 - vrshr.u16 q2, q1, #8 - vraddhn.u16 d29, q0, q3 - vraddhn.u16 d30, q1, q2 -.endm - -generate_composite_function \ - BlitRGBtoRGBPixelAlphaARMNEONAsm, 32, 0, 32, \ - FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \ - 8, /* number of pixels, processed in a single block */ \ - 5, /* prefetch distance */ \ - default_init, \ - default_cleanup, \ - RGBtoRGBPixelAlpha_process_pixblock_head, \ - RGBtoRGBPixelAlpha_process_pixblock_tail, \ - RGBtoRGBPixelAlpha_process_pixblock_tail_head - - /******************************************************************************/ - -.macro ARGBto565PixelAlpha_process_pixblock_head - vmvn d6, d3 - vshr.u8 d1, #2 - vshr.u8 d3, #3 - vshr.u8 d0, #3 - vshrn.u16 d7, q2, #3 - vshrn.u16 d25, q2, #8 - vbic.i16 q2, #0xe0 - vshr.u8 d6, #3 - vshr.u8 d7, #2 - vshr.u8 d2, #3 - vmovn.u16 d24, q2 - vshr.u8 d25, #3 - vmull.u8 q13, d1, d3 - vmlal.u8 q13, d7, d6 - vmull.u8 q14, d0, d3 - vmlal.u8 q14, d24, d6 - vmull.u8 q15, d2, d3 - vmlal.u8 q15, d25, d6 -.endm - -.macro ARGBto565PixelAlpha_process_pixblock_tail - vsra.u16 q13, #5 - vsra.u16 q14, #5 - vsra.u16 q15, #5 - vrshr.u16 q13, #5 - vrshr.u16 q14, #5 - vrshr.u16 q15, #5 - vsli.u16 q14, q13, #5 - vsli.u16 q14, q15, #11 -.endm - -.macro ARGBto565PixelAlpha_process_pixblock_tail_head - vld4.8 {d0-d3}, [SRC]! - PF add PF_X, PF_X, #8 - vsra.u16 q13, #5 - PF tst PF_CTL, #0xF - vsra.u16 q14, #5 - PF addne PF_X, PF_X, #8 - vsra.u16 q15, #5 - PF subne PF_CTL, PF_CTL, #1 - vrshr.u16 q13, #5 - PF cmp PF_X, ORIG_W - vrshr.u16 q14, #5 - PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] - vrshr.u16 q15, #5 - PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] - vld1.8 {d4-d5}, [DST_R]! - PF subge PF_X, PF_X, ORIG_W - vsli.u16 q14, q13, #5 - PF subges PF_CTL, PF_CTL, #0x10 - vsli.u16 q14, q15, #11 - PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! - vst1.8 {q14}, [DST_W :128]! - vmvn d6, d3 - vshr.u8 d1, #2 - vshr.u8 d3, #3 - vshr.u8 d0, #3 - vshrn.u16 d7, q2, #3 - vshrn.u16 d25, q2, #8 - vbic.i16 q2, #0xe0 - PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! - vshr.u8 d6, #3 - vshr.u8 d7, #2 - vshr.u8 d2, #3 - vmovn.u16 d24, q2 - vshr.u8 d25, #3 - vmull.u8 q13, d1, d3 - vmlal.u8 q13, d7, d6 - vmull.u8 q14, d0, d3 - vmlal.u8 q14, d24, d6 - vmull.u8 q15, d2, d3 - vmlal.u8 q15, d25, d6 -.endm - -generate_composite_function \ - BlitARGBto565PixelAlphaARMNEONAsm, 32, 0, 16, \ - FLAG_DST_READWRITE | FLAG_DEINTERLEAVE_32BPP, \ - 8, /* number of pixels, processed in a single block */ \ - 6, /* prefetch distance */ \ - default_init, \ - default_cleanup, \ - ARGBto565PixelAlpha_process_pixblock_head, \ - ARGBto565PixelAlpha_process_pixblock_tail, \ - ARGBto565PixelAlpha_process_pixblock_tail_head diff --git a/src/video/arm/pixman-arm-neon-asm.h b/src/video/arm/pixman-arm-neon-asm.h deleted file mode 100644 index bdcf6a9d47f30..0000000000000 --- a/src/video/arm/pixman-arm-neon-asm.h +++ /dev/null @@ -1,1184 +0,0 @@ -/* - * Copyright © 2009 Nokia Corporation - * - * 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 (including the next - * paragraph) 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. - * - * Author: Siarhei Siamashka (siarhei.siamashka@nokia.com) - */ - -/* - * This file contains a macro ('generate_composite_function') which can - * construct 2D image processing functions, based on a common template. - * Any combinations of source, destination and mask images with 8bpp, - * 16bpp, 24bpp, 32bpp color formats are supported. - * - * This macro takes care of: - * - handling of leading and trailing unaligned pixels - * - doing most of the work related to L2 cache preload - * - encourages the use of software pipelining for better instructions - * scheduling - * - * The user of this macro has to provide some configuration parameters - * (bit depths for the images, prefetch distance, etc.) and a set of - * macros, which should implement basic code chunks responsible for - * pixels processing. See 'pixman-arm-neon-asm.S' file for the usage - * examples. - * - * TODO: - * - try overlapped pixel method (from Ian Rickards) when processing - * exactly two blocks of pixels - * - maybe add an option to do reverse scanline processing - */ - -/* - * Bit flags for 'generate_composite_function' macro which are used - * to tune generated functions behavior. - */ -.set FLAG_DST_WRITEONLY, 0 -.set FLAG_DST_READWRITE, 1 -.set FLAG_DEINTERLEAVE_32BPP, 2 - -/* - * Offset in stack where mask and source pointer/stride can be accessed - * from 'init' macro. This is useful for doing special handling for solid mask. - */ -.set ARGS_STACK_OFFSET, 40 - -/* - * Constants for selecting preferable prefetch type. - */ -.set PREFETCH_TYPE_NONE, 0 /* No prefetch at all */ -.set PREFETCH_TYPE_SIMPLE, 1 /* A simple, fixed-distance-ahead prefetch */ -.set PREFETCH_TYPE_ADVANCED, 2 /* Advanced fine-grained prefetch */ - -/* - * Definitions of supplementary pixld/pixst macros (for partial load/store of - * pixel data). - */ - -.macro pixldst1 op, elem_size, reg1, mem_operand, abits -.if abits > 0 - op&.&elem_size {d®1}, [&mem_operand&, :&abits&]! -.else - op&.&elem_size {d®1}, [&mem_operand&]! -.endif -.endm - -.macro pixldst2 op, elem_size, reg1, reg2, mem_operand, abits -.if abits > 0 - op&.&elem_size {d®1, d®2}, [&mem_operand&, :&abits&]! -.else - op&.&elem_size {d®1, d®2}, [&mem_operand&]! -.endif -.endm - -.macro pixldst4 op, elem_size, reg1, reg2, reg3, reg4, mem_operand, abits -.if abits > 0 - op&.&elem_size {d®1, d®2, d®3, d®4}, [&mem_operand&, :&abits&]! -.else - op&.&elem_size {d®1, d®2, d®3, d®4}, [&mem_operand&]! -.endif -.endm - -.macro pixldst0 op, elem_size, reg1, idx, mem_operand, abits - op&.&elem_size {d®1[idx]}, [&mem_operand&]! -.endm - -.macro pixldst3 op, elem_size, reg1, reg2, reg3, mem_operand - op&.&elem_size {d®1, d®2, d®3}, [&mem_operand&]! -.endm - -.macro pixldst30 op, elem_size, reg1, reg2, reg3, idx, mem_operand - op&.&elem_size {d®1[idx], d®2[idx], d®3[idx]}, [&mem_operand&]! -.endm - -.macro pixldst numbytes, op, elem_size, basereg, mem_operand, abits -.if numbytes == 32 - pixldst4 op, elem_size, %(basereg+4), %(basereg+5), \ - %(basereg+6), %(basereg+7), mem_operand, abits -.elseif numbytes == 16 - pixldst2 op, elem_size, %(basereg+2), %(basereg+3), mem_operand, abits -.elseif numbytes == 8 - pixldst1 op, elem_size, %(basereg+1), mem_operand, abits -.elseif numbytes == 4 - .if !RESPECT_STRICT_ALIGNMENT || (elem_size == 32) - pixldst0 op, 32, %(basereg+0), 1, mem_operand, abits - .elseif elem_size == 16 - pixldst0 op, 16, %(basereg+0), 2, mem_operand, abits - pixldst0 op, 16, %(basereg+0), 3, mem_operand, abits - .else - pixldst0 op, 8, %(basereg+0), 4, mem_operand, abits - pixldst0 op, 8, %(basereg+0), 5, mem_operand, abits - pixldst0 op, 8, %(basereg+0), 6, mem_operand, abits - pixldst0 op, 8, %(basereg+0), 7, mem_operand, abits - .endif -.elseif numbytes == 2 - .if !RESPECT_STRICT_ALIGNMENT || (elem_size == 16) - pixldst0 op, 16, %(basereg+0), 1, mem_operand, abits - .else - pixldst0 op, 8, %(basereg+0), 2, mem_operand, abits - pixldst0 op, 8, %(basereg+0), 3, mem_operand, abits - .endif -.elseif numbytes == 1 - pixldst0 op, 8, %(basereg+0), 1, mem_operand, abits -.else - .error "unsupported size: numbytes" -.endif -.endm - -.macro pixld numpix, bpp, basereg, mem_operand, abits=0 -.if bpp > 0 -.if (bpp == 32) && (numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0) - pixldst4 vld4, 8, %(basereg+4), %(basereg+5), \ - %(basereg+6), %(basereg+7), mem_operand, abits -.elseif (bpp == 24) && (numpix == 8) - pixldst3 vld3, 8, %(basereg+3), %(basereg+4), %(basereg+5), mem_operand -.elseif (bpp == 24) && (numpix == 4) - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 4, mem_operand - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 5, mem_operand - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 6, mem_operand - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 7, mem_operand -.elseif (bpp == 24) && (numpix == 2) - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 2, mem_operand - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 3, mem_operand -.elseif (bpp == 24) && (numpix == 1) - pixldst30 vld3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 1, mem_operand -.else - pixldst %(numpix * bpp / 8), vld1, %(bpp), basereg, mem_operand, abits -.endif -.endif -.endm - -.macro pixst numpix, bpp, basereg, mem_operand, abits=0 -.if bpp > 0 -.if (bpp == 32) && (numpix == 8) && (DEINTERLEAVE_32BPP_ENABLED != 0) - pixldst4 vst4, 8, %(basereg+4), %(basereg+5), \ - %(basereg+6), %(basereg+7), mem_operand, abits -.elseif (bpp == 24) && (numpix == 8) - pixldst3 vst3, 8, %(basereg+3), %(basereg+4), %(basereg+5), mem_operand -.elseif (bpp == 24) && (numpix == 4) - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 4, mem_operand - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 5, mem_operand - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 6, mem_operand - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 7, mem_operand -.elseif (bpp == 24) && (numpix == 2) - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 2, mem_operand - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 3, mem_operand -.elseif (bpp == 24) && (numpix == 1) - pixldst30 vst3, 8, %(basereg+0), %(basereg+1), %(basereg+2), 1, mem_operand -.else - pixldst %(numpix * bpp / 8), vst1, %(bpp), basereg, mem_operand, abits -.endif -.endif -.endm - -.macro pixld_a numpix, bpp, basereg, mem_operand -.if (bpp * numpix) <= 128 - pixld numpix, bpp, basereg, mem_operand, %(bpp * numpix) -.else - pixld numpix, bpp, basereg, mem_operand, 128 -.endif -.endm - -.macro pixst_a numpix, bpp, basereg, mem_operand -.if (bpp * numpix) <= 128 - pixst numpix, bpp, basereg, mem_operand, %(bpp * numpix) -.else - pixst numpix, bpp, basereg, mem_operand, 128 -.endif -.endm - -/* - * Pixel fetcher for nearest scaling (needs TMP1, TMP2, VX, UNIT_X register - * aliases to be defined) - */ -.macro pixld1_s elem_size, reg1, mem_operand -.if elem_size == 16 - mov TMP1, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP1, mem_operand, TMP1, asl #1 - mov TMP2, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP2, mem_operand, TMP2, asl #1 - vld1.16 {d®1&[0]}, [TMP1, :16] - mov TMP1, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP1, mem_operand, TMP1, asl #1 - vld1.16 {d®1&[1]}, [TMP2, :16] - mov TMP2, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP2, mem_operand, TMP2, asl #1 - vld1.16 {d®1&[2]}, [TMP1, :16] - vld1.16 {d®1&[3]}, [TMP2, :16] -.elseif elem_size == 32 - mov TMP1, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP1, mem_operand, TMP1, asl #2 - mov TMP2, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP2, mem_operand, TMP2, asl #2 - vld1.32 {d®1&[0]}, [TMP1, :32] - vld1.32 {d®1&[1]}, [TMP2, :32] -.else - .error "unsupported" -.endif -.endm - -.macro pixld2_s elem_size, reg1, reg2, mem_operand -.if 0 /* elem_size == 32 */ - mov TMP1, VX, asr #16 - add VX, VX, UNIT_X, asl #1 - add TMP1, mem_operand, TMP1, asl #2 - mov TMP2, VX, asr #16 - sub VX, VX, UNIT_X - add TMP2, mem_operand, TMP2, asl #2 - vld1.32 {d®1&[0]}, [TMP1, :32] - mov TMP1, VX, asr #16 - add VX, VX, UNIT_X, asl #1 - add TMP1, mem_operand, TMP1, asl #2 - vld1.32 {d®2&[0]}, [TMP2, :32] - mov TMP2, VX, asr #16 - add VX, VX, UNIT_X - add TMP2, mem_operand, TMP2, asl #2 - vld1.32 {d®1&[1]}, [TMP1, :32] - vld1.32 {d®2&[1]}, [TMP2, :32] -.else - pixld1_s elem_size, reg1, mem_operand - pixld1_s elem_size, reg2, mem_operand -.endif -.endm - -.macro pixld0_s elem_size, reg1, idx, mem_operand -.if elem_size == 16 - mov TMP1, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP1, mem_operand, TMP1, asl #1 - vld1.16 {d®1&[idx]}, [TMP1, :16] -.elseif elem_size == 32 - mov TMP1, VX, asr #16 - adds VX, VX, UNIT_X -5: subpls VX, VX, SRC_WIDTH_FIXED - bpl 5b - add TMP1, mem_operand, TMP1, asl #2 - vld1.32 {d®1&[idx]}, [TMP1, :32] -.endif -.endm - -.macro pixld_s_internal numbytes, elem_size, basereg, mem_operand -.if numbytes == 32 - pixld2_s elem_size, %(basereg+4), %(basereg+5), mem_operand - pixld2_s elem_size, %(basereg+6), %(basereg+7), mem_operand - pixdeinterleave elem_size, %(basereg+4) -.elseif numbytes == 16 - pixld2_s elem_size, %(basereg+2), %(basereg+3), mem_operand -.elseif numbytes == 8 - pixld1_s elem_size, %(basereg+1), mem_operand -.elseif numbytes == 4 - .if elem_size == 32 - pixld0_s elem_size, %(basereg+0), 1, mem_operand - .elseif elem_size == 16 - pixld0_s elem_size, %(basereg+0), 2, mem_operand - pixld0_s elem_size, %(basereg+0), 3, mem_operand - .else - pixld0_s elem_size, %(basereg+0), 4, mem_operand - pixld0_s elem_size, %(basereg+0), 5, mem_operand - pixld0_s elem_size, %(basereg+0), 6, mem_operand - pixld0_s elem_size, %(basereg+0), 7, mem_operand - .endif -.elseif numbytes == 2 - .if elem_size == 16 - pixld0_s elem_size, %(basereg+0), 1, mem_operand - .else - pixld0_s elem_size, %(basereg+0), 2, mem_operand - pixld0_s elem_size, %(basereg+0), 3, mem_operand - .endif -.elseif numbytes == 1 - pixld0_s elem_size, %(basereg+0), 1, mem_operand -.else - .error "unsupported size: numbytes" -.endif -.endm - -.macro pixld_s numpix, bpp, basereg, mem_operand -.if bpp > 0 - pixld_s_internal %(numpix * bpp / 8), %(bpp), basereg, mem_operand -.endif -.endm - -.macro vuzp8 reg1, reg2 - vuzp.8 d®1, d®2 -.endm - -.macro vzip8 reg1, reg2 - vzip.8 d®1, d®2 -.endm - -/* deinterleave B, G, R, A channels for eight 32bpp pixels in 4 registers */ -.macro pixdeinterleave bpp, basereg -.if (bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0) - vuzp8 %(basereg+0), %(basereg+1) - vuzp8 %(basereg+2), %(basereg+3) - vuzp8 %(basereg+1), %(basereg+3) - vuzp8 %(basereg+0), %(basereg+2) -.endif -.endm - -/* interleave B, G, R, A channels for eight 32bpp pixels in 4 registers */ -.macro pixinterleave bpp, basereg -.if (bpp == 32) && (DEINTERLEAVE_32BPP_ENABLED != 0) - vzip8 %(basereg+0), %(basereg+2) - vzip8 %(basereg+1), %(basereg+3) - vzip8 %(basereg+2), %(basereg+3) - vzip8 %(basereg+0), %(basereg+1) -.endif -.endm - -/* - * This is a macro for implementing cache preload. The main idea is that - * cache preload logic is mostly independent from the rest of pixels - * processing code. It starts at the top left pixel and moves forward - * across pixels and can jump across scanlines. Prefetch distance is - * handled in an 'incremental' way: it starts from 0 and advances to the - * optimal distance over time. After reaching optimal prefetch distance, - * it is kept constant. There are some checks which prevent prefetching - * unneeded pixel lines below the image (but it still can prefetch a bit - * more data on the right side of the image - not a big issue and may - * be actually helpful when rendering text glyphs). Additional trick is - * the use of LDR instruction for prefetch instead of PLD when moving to - * the next line, the point is that we have a high chance of getting TLB - * miss in this case, and PLD would be useless. - * - * This sounds like it may introduce a noticeable overhead (when working with - * fully cached data). But in reality, due to having a separate pipeline and - * instruction queue for NEON unit in ARM Cortex-A8, normal ARM code can - * execute simultaneously with NEON and be completely shadowed by it. Thus - * we get no performance overhead at all (*). This looks like a very nice - * feature of Cortex-A8, if used wisely. We don't have a hardware prefetcher, - * but still can implement some rather advanced prefetch logic in software - * for almost zero cost! - * - * (*) The overhead of the prefetcher is visible when running some trivial - * pixels processing like simple copy. Anyway, having prefetch is a must - * when working with the graphics data. - */ -.macro PF a, x:vararg -.if (PREFETCH_TYPE_CURRENT == PREFETCH_TYPE_ADVANCED) - a x -.endif -.endm - -.macro cache_preload std_increment, boost_increment -.if (src_bpp_shift >= 0) || (dst_r_bpp != 0) || (mask_bpp_shift >= 0) -.if regs_shortage - PF ldr ORIG_W, [sp] /* If we are short on regs, ORIG_W is kept on stack */ -.endif -.if std_increment != 0 - PF add PF_X, PF_X, #std_increment -.endif - PF tst PF_CTL, #0xF - PF addne PF_X, PF_X, #boost_increment - PF subne PF_CTL, PF_CTL, #1 - PF cmp PF_X, ORIG_W -.if src_bpp_shift >= 0 - PF pld, [PF_SRC, PF_X, lsl #src_bpp_shift] -.endif -.if dst_r_bpp != 0 - PF pld, [PF_DST, PF_X, lsl #dst_bpp_shift] -.endif -.if mask_bpp_shift >= 0 - PF pld, [PF_MASK, PF_X, lsl #mask_bpp_shift] -.endif - PF subge PF_X, PF_X, ORIG_W - PF subges PF_CTL, PF_CTL, #0x10 -.if src_bpp_shift >= 0 - PF ldrgeb DUMMY, [PF_SRC, SRC_STRIDE, lsl #src_bpp_shift]! -.endif -.if dst_r_bpp != 0 - PF ldrgeb DUMMY, [PF_DST, DST_STRIDE, lsl #dst_bpp_shift]! -.endif -.if mask_bpp_shift >= 0 - PF ldrgeb DUMMY, [PF_MASK, MASK_STRIDE, lsl #mask_bpp_shift]! -.endif -.endif -.endm - -.macro cache_preload_simple -.if (PREFETCH_TYPE_CURRENT == PREFETCH_TYPE_SIMPLE) -.if src_bpp > 0 - pld [SRC, #(PREFETCH_DISTANCE_SIMPLE * src_bpp / 8)] -.endif -.if dst_r_bpp > 0 - pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE * dst_r_bpp / 8)] -.endif -.if mask_bpp > 0 - pld [MASK, #(PREFETCH_DISTANCE_SIMPLE * mask_bpp / 8)] -.endif -.endif -.endm - -.macro fetch_mask_pixblock - pixld pixblock_size, mask_bpp, \ - (mask_basereg - pixblock_size * mask_bpp / 64), MASK -.endm - -/* - * Macro which is used to process leading pixels until destination - * pointer is properly aligned (at 16 bytes boundary). When destination - * buffer uses 16bpp format, this is unnecessary, or even pointless. - */ -.macro ensure_destination_ptr_alignment process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head -.if dst_w_bpp != 24 - tst DST_R, #0xF - beq 2f - -.irp lowbit, 1, 2, 4, 8, 16 -local skip1 -.if (dst_w_bpp <= (lowbit * 8)) && ((lowbit * 8) < (pixblock_size * dst_w_bpp)) -.if lowbit < 16 /* we don't need more than 16-byte alignment */ - tst DST_R, #lowbit - beq 1f -.endif - pixld_src (lowbit * 8 / dst_w_bpp), src_bpp, src_basereg, SRC - pixld (lowbit * 8 / dst_w_bpp), mask_bpp, mask_basereg, MASK -.if dst_r_bpp > 0 - pixld_a (lowbit * 8 / dst_r_bpp), dst_r_bpp, dst_r_basereg, DST_R -.else - add DST_R, DST_R, #lowbit -.endif - PF add PF_X, PF_X, #(lowbit * 8 / dst_w_bpp) - sub W, W, #(lowbit * 8 / dst_w_bpp) -1: -.endif -.endr - pixdeinterleave src_bpp, src_basereg - pixdeinterleave mask_bpp, mask_basereg - pixdeinterleave dst_r_bpp, dst_r_basereg - - process_pixblock_head - cache_preload 0, pixblock_size - cache_preload_simple - process_pixblock_tail - - pixinterleave dst_w_bpp, dst_w_basereg -.irp lowbit, 1, 2, 4, 8, 16 -.if (dst_w_bpp <= (lowbit * 8)) && ((lowbit * 8) < (pixblock_size * dst_w_bpp)) -.if lowbit < 16 /* we don't need more than 16-byte alignment */ - tst DST_W, #lowbit - beq 1f -.endif - pixst_a (lowbit * 8 / dst_w_bpp), dst_w_bpp, dst_w_basereg, DST_W -1: -.endif -.endr -.endif -2: -.endm - -/* - * Special code for processing up to (pixblock_size - 1) remaining - * trailing pixels. As SIMD processing performs operation on - * pixblock_size pixels, anything smaller than this has to be loaded - * and stored in a special way. Loading and storing of pixel data is - * performed in such a way that we fill some 'slots' in the NEON - * registers (some slots naturally are unused), then perform compositing - * operation as usual. In the end, the data is taken from these 'slots' - * and saved to memory. - * - * cache_preload_flag - allows to suppress prefetch if - * set to 0 - * dst_aligned_flag - selects whether destination buffer - * is aligned - */ -.macro process_trailing_pixels cache_preload_flag, \ - dst_aligned_flag, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - tst W, #(pixblock_size - 1) - beq 2f -.irp chunk_size, 16, 8, 4, 2, 1 -.if pixblock_size > chunk_size - tst W, #chunk_size - beq 1f - pixld_src chunk_size, src_bpp, src_basereg, SRC - pixld chunk_size, mask_bpp, mask_basereg, MASK -.if dst_aligned_flag != 0 - pixld_a chunk_size, dst_r_bpp, dst_r_basereg, DST_R -.else - pixld chunk_size, dst_r_bpp, dst_r_basereg, DST_R -.endif -.if cache_preload_flag != 0 - PF add PF_X, PF_X, #chunk_size -.endif -1: -.endif -.endr - pixdeinterleave src_bpp, src_basereg - pixdeinterleave mask_bpp, mask_basereg - pixdeinterleave dst_r_bpp, dst_r_basereg - - process_pixblock_head -.if cache_preload_flag != 0 - cache_preload 0, pixblock_size - cache_preload_simple -.endif - process_pixblock_tail - pixinterleave dst_w_bpp, dst_w_basereg -.irp chunk_size, 16, 8, 4, 2, 1 -.if pixblock_size > chunk_size - tst W, #chunk_size - beq 1f -.if dst_aligned_flag != 0 - pixst_a chunk_size, dst_w_bpp, dst_w_basereg, DST_W -.else - pixst chunk_size, dst_w_bpp, dst_w_basereg, DST_W -.endif -1: -.endif -.endr -2: -.endm - -/* - * Macro, which performs all the needed operations to switch to the next - * scanline and start the next loop iteration unless all the scanlines - * are already processed. - */ -.macro advance_to_next_scanline start_of_loop_label -.if regs_shortage - ldrd W, [sp] /* load W and H (width and height) from stack */ -.else - mov W, ORIG_W -.endif - add DST_W, DST_W, DST_STRIDE, lsl #dst_bpp_shift -.if src_bpp != 0 - add SRC, SRC, SRC_STRIDE, lsl #src_bpp_shift -.endif -.if mask_bpp != 0 - add MASK, MASK, MASK_STRIDE, lsl #mask_bpp_shift -.endif -.if (dst_w_bpp != 24) - sub DST_W, DST_W, W, lsl #dst_bpp_shift -.endif -.if (src_bpp != 24) && (src_bpp != 0) - sub SRC, SRC, W, lsl #src_bpp_shift -.endif -.if (mask_bpp != 24) && (mask_bpp != 0) - sub MASK, MASK, W, lsl #mask_bpp_shift -.endif - subs H, H, #1 - mov DST_R, DST_W -.if regs_shortage - str H, [sp, #4] /* save updated height to stack */ -.endif - bge start_of_loop_label -.endm - -/* - * Registers are allocated in the following way by default: - * d0, d1, d2, d3 - reserved for loading source pixel data - * d4, d5, d6, d7 - reserved for loading destination pixel data - * d24, d25, d26, d27 - reserved for loading mask pixel data - * d28, d29, d30, d31 - final destination pixel data for writeback to memory - */ -.macro generate_composite_function fname, \ - src_bpp_, \ - mask_bpp_, \ - dst_w_bpp_, \ - flags, \ - pixblock_size_, \ - prefetch_distance, \ - init, \ - cleanup, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head, \ - dst_w_basereg_ = 28, \ - dst_r_basereg_ = 4, \ - src_basereg_ = 0, \ - mask_basereg_ = 24 - - pixman_asm_function fname - - push {r4-r12, lr} /* save all registers */ - -/* - * Select prefetch type for this function. If prefetch distance is - * set to 0 or one of the color formats is 24bpp, SIMPLE prefetch - * has to be used instead of ADVANCED. - */ - .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_DEFAULT -.if prefetch_distance == 0 - .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE -.elseif (PREFETCH_TYPE_CURRENT > PREFETCH_TYPE_SIMPLE) && \ - ((src_bpp_ == 24) || (mask_bpp_ == 24) || (dst_w_bpp_ == 24)) - .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_SIMPLE -.endif - -/* - * Make some macro arguments globally visible and accessible - * from other macros - */ - .set src_bpp, src_bpp_ - .set mask_bpp, mask_bpp_ - .set dst_w_bpp, dst_w_bpp_ - .set pixblock_size, pixblock_size_ - .set dst_w_basereg, dst_w_basereg_ - .set dst_r_basereg, dst_r_basereg_ - .set src_basereg, src_basereg_ - .set mask_basereg, mask_basereg_ - - .macro pixld_src x:vararg - pixld x - .endm - .macro fetch_src_pixblock - pixld_src pixblock_size, src_bpp, \ - (src_basereg - pixblock_size * src_bpp / 64), SRC - .endm -/* - * Assign symbolic names to registers - */ - W .req r0 /* width (is updated during processing) */ - H .req r1 /* height (is updated during processing) */ - DST_W .req r2 /* destination buffer pointer for writes */ - DST_STRIDE .req r3 /* destination image stride */ - SRC .req r4 /* source buffer pointer */ - SRC_STRIDE .req r5 /* source image stride */ - DST_R .req r6 /* destination buffer pointer for reads */ - - MASK .req r7 /* mask pointer */ - MASK_STRIDE .req r8 /* mask stride */ - - PF_CTL .req r9 /* combined lines counter and prefetch */ - /* distance increment counter */ - PF_X .req r10 /* pixel index in a scanline for current */ - /* pretetch position */ - PF_SRC .req r11 /* pointer to source scanline start */ - /* for prefetch purposes */ - PF_DST .req r12 /* pointer to destination scanline start */ - /* for prefetch purposes */ - PF_MASK .req r14 /* pointer to mask scanline start */ - /* for prefetch purposes */ -/* - * Check whether we have enough registers for all the local variables. - * If we don't have enough registers, original width and height are - * kept on top of stack (and 'regs_shortage' variable is set to indicate - * this for the rest of code). Even if there are enough registers, the - * allocation scheme may be a bit different depending on whether source - * or mask is not used. - */ -.if (PREFETCH_TYPE_CURRENT < PREFETCH_TYPE_ADVANCED) - ORIG_W .req r10 /* saved original width */ - DUMMY .req r12 /* temporary register */ - .set regs_shortage, 0 -.elseif mask_bpp == 0 - ORIG_W .req r7 /* saved original width */ - DUMMY .req r8 /* temporary register */ - .set regs_shortage, 0 -.elseif src_bpp == 0 - ORIG_W .req r4 /* saved original width */ - DUMMY .req r5 /* temporary register */ - .set regs_shortage, 0 -.else - ORIG_W .req r1 /* saved original width */ - DUMMY .req r1 /* temporary register */ - .set regs_shortage, 1 -.endif - - .set mask_bpp_shift, -1 -.if src_bpp == 32 - .set src_bpp_shift, 2 -.elseif src_bpp == 24 - .set src_bpp_shift, 0 -.elseif src_bpp == 16 - .set src_bpp_shift, 1 -.elseif src_bpp == 8 - .set src_bpp_shift, 0 -.elseif src_bpp == 0 - .set src_bpp_shift, -1 -.else - .error "requested src bpp (src_bpp) is not supported" -.endif -.if mask_bpp == 32 - .set mask_bpp_shift, 2 -.elseif mask_bpp == 24 - .set mask_bpp_shift, 0 -.elseif mask_bpp == 8 - .set mask_bpp_shift, 0 -.elseif mask_bpp == 0 - .set mask_bpp_shift, -1 -.else - .error "requested mask bpp (mask_bpp) is not supported" -.endif -.if dst_w_bpp == 32 - .set dst_bpp_shift, 2 -.elseif dst_w_bpp == 24 - .set dst_bpp_shift, 0 -.elseif dst_w_bpp == 16 - .set dst_bpp_shift, 1 -.elseif dst_w_bpp == 8 - .set dst_bpp_shift, 0 -.else - .error "requested dst bpp (dst_w_bpp) is not supported" -.endif - -.if (((flags) & FLAG_DST_READWRITE) != 0) - .set dst_r_bpp, dst_w_bpp -.else - .set dst_r_bpp, 0 -.endif -.if (((flags) & FLAG_DEINTERLEAVE_32BPP) != 0) - .set DEINTERLEAVE_32BPP_ENABLED, 1 -.else - .set DEINTERLEAVE_32BPP_ENABLED, 0 -.endif - -.if prefetch_distance < 0 || prefetch_distance > 15 - .error "invalid prefetch distance (prefetch_distance)" -.endif - -.if src_bpp > 0 - ldr SRC, [sp, #40] -.endif -.if mask_bpp > 0 - ldr MASK, [sp, #48] -.endif - PF mov PF_X, #0 -.if src_bpp > 0 - ldr SRC_STRIDE, [sp, #44] -.endif -.if mask_bpp > 0 - ldr MASK_STRIDE, [sp, #52] -.endif - mov DST_R, DST_W - -.if src_bpp == 24 - sub SRC_STRIDE, SRC_STRIDE, W - sub SRC_STRIDE, SRC_STRIDE, W, lsl #1 -.endif -.if mask_bpp == 24 - sub MASK_STRIDE, MASK_STRIDE, W - sub MASK_STRIDE, MASK_STRIDE, W, lsl #1 -.endif -.if dst_w_bpp == 24 - sub DST_STRIDE, DST_STRIDE, W - sub DST_STRIDE, DST_STRIDE, W, lsl #1 -.endif - -/* - * Setup advanced prefetcher initial state - */ - PF mov PF_SRC, SRC - PF mov PF_DST, DST_R - PF mov PF_MASK, MASK - /* PF_CTL = prefetch_distance | ((h - 1) << 4) */ - PF mov PF_CTL, H, lsl #4 - PF add PF_CTL, #(prefetch_distance - 0x10) - - init -.if regs_shortage - push {r0, r1} -.endif - subs H, H, #1 -.if regs_shortage - str H, [sp, #4] /* save updated height to stack */ -.else - mov ORIG_W, W -.endif - blt 9f - cmp W, #(pixblock_size * 2) - blt 8f -/* - * This is the start of the pipelined loop, which if optimized for - * long scanlines - */ -0: - ensure_destination_ptr_alignment process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - - /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */ - pixld_a pixblock_size, dst_r_bpp, \ - (dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R - fetch_src_pixblock - pixld pixblock_size, mask_bpp, \ - (mask_basereg - pixblock_size * mask_bpp / 64), MASK - PF add PF_X, PF_X, #pixblock_size - process_pixblock_head - cache_preload 0, pixblock_size - cache_preload_simple - subs W, W, #(pixblock_size * 2) - blt 2f -1: - process_pixblock_tail_head - cache_preload_simple - subs W, W, #pixblock_size - bge 1b -2: - process_pixblock_tail - pixst_a pixblock_size, dst_w_bpp, \ - (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W - - /* Process the remaining trailing pixels in the scanline */ - process_trailing_pixels 1, 1, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - advance_to_next_scanline 0b - -.if regs_shortage - pop {r0, r1} -.endif - cleanup - pop {r4-r12, pc} /* exit */ -/* - * This is the start of the loop, designed to process images with small width - * (less than pixblock_size * 2 pixels). In this case neither pipelining - * nor prefetch are used. - */ -8: - /* Process exactly pixblock_size pixels if needed */ - tst W, #pixblock_size - beq 1f - pixld pixblock_size, dst_r_bpp, \ - (dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R - fetch_src_pixblock - pixld pixblock_size, mask_bpp, \ - (mask_basereg - pixblock_size * mask_bpp / 64), MASK - process_pixblock_head - process_pixblock_tail - pixst pixblock_size, dst_w_bpp, \ - (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W -1: - /* Process the remaining trailing pixels in the scanline */ - process_trailing_pixels 0, 0, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - advance_to_next_scanline 8b -9: -.if regs_shortage - pop {r0, r1} -.endif - cleanup - pop {r4-r12, pc} /* exit */ - - .purgem fetch_src_pixblock - .purgem pixld_src - - .unreq SRC - .unreq MASK - .unreq DST_R - .unreq DST_W - .unreq ORIG_W - .unreq W - .unreq H - .unreq SRC_STRIDE - .unreq DST_STRIDE - .unreq MASK_STRIDE - .unreq PF_CTL - .unreq PF_X - .unreq PF_SRC - .unreq PF_DST - .unreq PF_MASK - .unreq DUMMY - .endfunc -.endm - -/* - * A simplified variant of function generation template for a single - * scanline processing (for implementing pixman combine functions) - */ -.macro generate_composite_function_scanline use_nearest_scaling, \ - fname, \ - src_bpp_, \ - mask_bpp_, \ - dst_w_bpp_, \ - flags, \ - pixblock_size_, \ - init, \ - cleanup, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head, \ - dst_w_basereg_ = 28, \ - dst_r_basereg_ = 4, \ - src_basereg_ = 0, \ - mask_basereg_ = 24 - - pixman_asm_function fname - - .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE -/* - * Make some macro arguments globally visible and accessible - * from other macros - */ - .set src_bpp, src_bpp_ - .set mask_bpp, mask_bpp_ - .set dst_w_bpp, dst_w_bpp_ - .set pixblock_size, pixblock_size_ - .set dst_w_basereg, dst_w_basereg_ - .set dst_r_basereg, dst_r_basereg_ - .set src_basereg, src_basereg_ - .set mask_basereg, mask_basereg_ - -.if use_nearest_scaling != 0 - /* - * Assign symbolic names to registers for nearest scaling - */ - W .req r0 - DST_W .req r1 - SRC .req r2 - VX .req r3 - UNIT_X .req ip - MASK .req lr - TMP1 .req r4 - TMP2 .req r5 - DST_R .req r6 - SRC_WIDTH_FIXED .req r7 - - .macro pixld_src x:vararg - pixld_s x - .endm - - ldr UNIT_X, [sp] - push {r4-r8, lr} - ldr SRC_WIDTH_FIXED, [sp, #(24 + 4)] - .if mask_bpp != 0 - ldr MASK, [sp, #(24 + 8)] - .endif -.else - /* - * Assign symbolic names to registers - */ - W .req r0 /* width (is updated during processing) */ - DST_W .req r1 /* destination buffer pointer for writes */ - SRC .req r2 /* source buffer pointer */ - DST_R .req ip /* destination buffer pointer for reads */ - MASK .req r3 /* mask pointer */ - - .macro pixld_src x:vararg - pixld x - .endm -.endif - -.if (((flags) & FLAG_DST_READWRITE) != 0) - .set dst_r_bpp, dst_w_bpp -.else - .set dst_r_bpp, 0 -.endif -.if (((flags) & FLAG_DEINTERLEAVE_32BPP) != 0) - .set DEINTERLEAVE_32BPP_ENABLED, 1 -.else - .set DEINTERLEAVE_32BPP_ENABLED, 0 -.endif - - .macro fetch_src_pixblock - pixld_src pixblock_size, src_bpp, \ - (src_basereg - pixblock_size * src_bpp / 64), SRC - .endm - - init - mov DST_R, DST_W - - cmp W, #pixblock_size - blt 8f - - ensure_destination_ptr_alignment process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - - subs W, W, #pixblock_size - blt 7f - - /* Implement "head (tail_head) ... (tail_head) tail" loop pattern */ - pixld_a pixblock_size, dst_r_bpp, \ - (dst_r_basereg - pixblock_size * dst_r_bpp / 64), DST_R - fetch_src_pixblock - pixld pixblock_size, mask_bpp, \ - (mask_basereg - pixblock_size * mask_bpp / 64), MASK - process_pixblock_head - subs W, W, #pixblock_size - blt 2f -1: - process_pixblock_tail_head - subs W, W, #pixblock_size - bge 1b -2: - process_pixblock_tail - pixst_a pixblock_size, dst_w_bpp, \ - (dst_w_basereg - pixblock_size * dst_w_bpp / 64), DST_W -7: - /* Process the remaining trailing pixels in the scanline (dst aligned) */ - process_trailing_pixels 0, 1, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - - cleanup -.if use_nearest_scaling != 0 - pop {r4-r8, pc} /* exit */ -.else - bx lr /* exit */ -.endif -8: - /* Process the remaining trailing pixels in the scanline (dst unaligned) */ - process_trailing_pixels 0, 0, \ - process_pixblock_head, \ - process_pixblock_tail, \ - process_pixblock_tail_head - - cleanup - -.if use_nearest_scaling != 0 - pop {r4-r8, pc} /* exit */ - - .unreq DST_R - .unreq SRC - .unreq W - .unreq VX - .unreq UNIT_X - .unreq TMP1 - .unreq TMP2 - .unreq DST_W - .unreq MASK - .unreq SRC_WIDTH_FIXED - -.else - bx lr /* exit */ - - .unreq SRC - .unreq MASK - .unreq DST_R - .unreq DST_W - .unreq W -.endif - - .purgem fetch_src_pixblock - .purgem pixld_src - - .endfunc -.endm - -.macro generate_composite_function_single_scanline x:vararg - generate_composite_function_scanline 0, x -.endm - -.macro generate_composite_function_nearest_scanline x:vararg - generate_composite_function_scanline 1, x -.endm - -/* Default prologue/epilogue, nothing special needs to be done */ - -.macro default_init -.endm - -.macro default_cleanup -.endm - -/* - * Prologue/epilogue variant which additionally saves/restores d8-d15 - * registers (they need to be saved/restored by callee according to ABI). - * This is required if the code needs to use all the NEON registers. - */ - -.macro default_init_need_all_regs - vpush {d8-d15} -.endm - -.macro default_cleanup_need_all_regs - vpop {d8-d15} -.endm - -/******************************************************************************/ - -/* - * Conversion of 8 r5g6b6 pixels packed in 128-bit register (in) - * into a planar a8r8g8b8 format (with a, r, g, b color components - * stored into 64-bit registers out_a, out_r, out_g, out_b respectively). - * - * Warning: the conversion is destructive and the original - * value (in) is lost. - */ -.macro convert_0565_to_8888 in, out_a, out_r, out_g, out_b - vshrn.u16 out_r, in, #8 - vshrn.u16 out_g, in, #3 - vsli.u16 in, in, #5 - vmov.u8 out_a, #255 - vsri.u8 out_r, out_r, #5 - vsri.u8 out_g, out_g, #6 - vshrn.u16 out_b, in, #2 -.endm - -.macro convert_0565_to_x888 in, out_r, out_g, out_b - vshrn.u16 out_r, in, #8 - vshrn.u16 out_g, in, #3 - vsli.u16 in, in, #5 - vsri.u8 out_r, out_r, #5 - vsri.u8 out_g, out_g, #6 - vshrn.u16 out_b, in, #2 -.endm - -/* - * Conversion from planar a8r8g8b8 format (with a, r, g, b color components - * in 64-bit registers in_a, in_r, in_g, in_b respectively) into 8 r5g6b6 - * pixels packed in 128-bit register (out). Requires two temporary 128-bit - * registers (tmp1, tmp2) - */ -.macro convert_8888_to_0565 in_r, in_g, in_b, out, tmp1, tmp2 - vshll.u8 tmp1, in_g, #8 - vshll.u8 out, in_r, #8 - vshll.u8 tmp2, in_b, #8 - vsri.u16 out, tmp1, #5 - vsri.u16 out, tmp2, #11 -.endm - -/* - * Conversion of four r5g6b5 pixels (in) to four x8r8g8b8 pixels - * returned in (out0, out1) registers pair. Requires one temporary - * 64-bit register (tmp). 'out1' and 'in' may overlap, the original - * value from 'in' is lost - */ -.macro convert_four_0565_to_x888_packed in, out0, out1, tmp - vshl.u16 out0, in, #5 /* G top 6 bits */ - vshl.u16 tmp, in, #11 /* B top 5 bits */ - vsri.u16 in, in, #5 /* R is ready in top bits */ - vsri.u16 out0, out0, #6 /* G is ready in top bits */ - vsri.u16 tmp, tmp, #5 /* B is ready in top bits */ - vshr.u16 out1, in, #8 /* R is in place */ - vsri.u16 out0, tmp, #8 /* G & B is in place */ - vzip.u16 out0, out1 /* everything is in place */ -.endm diff --git a/src/video/arm/pixman-arm-simd-asm.S b/src/video/arm/pixman-arm-simd-asm.S deleted file mode 100644 index 57449c5f37981..0000000000000 --- a/src/video/arm/pixman-arm-simd-asm.S +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright (c) 2016 RISC OS Open Ltd - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -/* Prevent the stack from becoming executable */ -#if defined(__linux__) && defined(__ELF__) -.section .note.GNU-stack,"",%progbits -#endif - - .text - .arch armv6 - .object_arch armv4 - .arm - .altmacro - .p2align 2 - -#include "pixman-arm-asm.h" -#include "pixman-arm-simd-asm.h" - -/* A head macro should do all processing which results in an output of up to - * 16 bytes, as far as the final load instruction. The corresponding tail macro - * should complete the processing of the up-to-16 bytes. The calling macro will - * sometimes choose to insert a preload or a decrement of X between them. - * cond ARM condition code for code block - * numbytes Number of output bytes that should be generated this time - * firstreg First WK register in which to place output - * unaligned_src Whether to use non-wordaligned loads of source image - * unaligned_mask Whether to use non-wordaligned loads of mask image - * preload If outputting 16 bytes causes 64 bytes to be read, whether an extra preload should be output - */ - -/******************************************************************************/ - -.macro FillRect32_init - ldr SRC, [sp, #ARGS_STACK_OFFSET] - mov STRIDE_S, SRC - mov MASK, SRC - mov STRIDE_M, SRC -.endm - -.macro FillRect16_init - ldrh SRC, [sp, #ARGS_STACK_OFFSET] - orr SRC, SRC, lsl #16 - mov STRIDE_S, SRC - mov MASK, SRC - mov STRIDE_M, SRC -.endm - -.macro FillRect8_init - ldrb SRC, [sp, #ARGS_STACK_OFFSET] - orr SRC, SRC, lsl #8 - orr SRC, SRC, lsl #16 - mov STRIDE_S, SRC - mov MASK, SRC - mov STRIDE_M, SRC -.endm - -.macro FillRect_process_tail cond, numbytes, firstreg - WK4 .req SRC - WK5 .req STRIDE_S - WK6 .req MASK - WK7 .req STRIDE_M - pixst cond, numbytes, 4, DST - .unreq WK4 - .unreq WK5 - .unreq WK6 - .unreq WK7 -.endm - -generate_composite_function \ - FillSurfaceRect32ARMSIMDAsm, 0, 0, 32, \ - FLAG_DST_WRITEONLY | FLAG_COND_EXEC | FLAG_PROCESS_PRESERVES_PSR | FLAG_PROCESS_DOES_STORE | FLAG_PROCESS_PRESERVES_SCRATCH \ - 0, /* prefetch distance doesn't apply */ \ - FillRect32_init \ - nop_macro, /* newline */ \ - nop_macro /* cleanup */ \ - nop_macro /* process head */ \ - FillRect_process_tail - -generate_composite_function \ - FillSurfaceRect16ARMSIMDAsm, 0, 0, 16, \ - FLAG_DST_WRITEONLY | FLAG_COND_EXEC | FLAG_PROCESS_PRESERVES_PSR | FLAG_PROCESS_DOES_STORE | FLAG_PROCESS_PRESERVES_SCRATCH \ - 0, /* prefetch distance doesn't apply */ \ - FillRect16_init \ - nop_macro, /* newline */ \ - nop_macro /* cleanup */ \ - nop_macro /* process head */ \ - FillRect_process_tail - -generate_composite_function \ - FillSurfaceRect8ARMSIMDAsm, 0, 0, 8, \ - FLAG_DST_WRITEONLY | FLAG_COND_EXEC | FLAG_PROCESS_PRESERVES_PSR | FLAG_PROCESS_DOES_STORE | FLAG_PROCESS_PRESERVES_SCRATCH \ - 0, /* prefetch distance doesn't apply */ \ - FillRect8_init \ - nop_macro, /* newline */ \ - nop_macro /* cleanup */ \ - nop_macro /* process head */ \ - FillRect_process_tail - -/******************************************************************************/ - -/* This differs from the over_8888_8888 routine in Pixman in that the destination - * alpha component is always left unchanged, and RGB components are not - * premultiplied by alpha. It differs from BlitRGBtoRGBPixelAlpha in that - * renormalisation is done by multiplying by 257/256 (with rounding) rather than - * simply shifting right by 8 bits - removing the need to special-case alpha=0xff. - */ - -.macro RGBtoRGBPixelAlpha_init - line_saved_regs STRIDE_S, ORIG_W - mov MASK, #0x80 -.endm - -.macro RGBtoRGBPixelAlpha_1pixel_translucent s, d, tmp0, tmp1, tmp2, tmp3, half - uxtb tmp3, s - uxtb tmp0, d - sub tmp0, tmp3, tmp0 - uxtb tmp3, s, ror #16 - uxtb tmp1, d, ror #16 - sub tmp1, tmp3, tmp1 - uxtb tmp3, s, ror #8 - mov s, s, lsr #24 - uxtb tmp2, d, ror #8 - sub tmp2, tmp3, tmp2 - smlabb tmp0, tmp0, s, half - smlabb tmp1, tmp1, s, half - smlabb tmp2, tmp2, s, half - add tmp0, tmp0, asr #8 - add tmp1, tmp1, asr #8 - add tmp2, tmp2, asr #8 - pkhbt tmp0, tmp0, tmp1, lsl #16 - and tmp2, tmp2, #0xff00 - uxtb16 tmp0, tmp0, ror #8 - orr tmp0, tmp0, tmp2 - uadd8 d, d, tmp0 -.endm - -.macro RGBtoRGBPixelAlpha_1pixel_opaque s, d - and d, d, #0xff000000 - bic s, s, #0xff000000 - orr d, d, s -.endm - -.macro RGBtoRGBPixelAlpha_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload - .if numbytes == 16 - ldm SRC!, {WK0, WK1} - ldm SRC!, {STRIDE_S, STRIDE_M} - ldrd WK2, WK3, [DST], #16 - orr SCRATCH, WK0, WK1 - and ORIG_W, WK0, WK1 - orr SCRATCH, SCRATCH, STRIDE_S - and ORIG_W, ORIG_W, STRIDE_S - orr SCRATCH, SCRATCH, STRIDE_M - and ORIG_W, ORIG_W, STRIDE_M - tst SCRATCH, #0xff000000 - .elseif numbytes == 8 - ldm SRC!, {WK0, WK1} - ldm DST!, {WK2, WK3} - orr SCRATCH, WK0, WK1 - and ORIG_W, WK0, WK1 - tst SCRATCH, #0xff000000 - .else // numbytes == 4 - ldr WK0, [SRC], #4 - ldr WK2, [DST], #4 - tst WK0, #0xff000000 - .endif -.endm - -.macro RGBtoRGBPixelAlpha_process_tail cond, numbytes, firstreg - beq 20f @ all transparent - .if numbytes == 16 - cmp ORIG_W, #0xff000000 - bhs 10f @ all opaque - RGBtoRGBPixelAlpha_1pixel_translucent WK0, WK2, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - RGBtoRGBPixelAlpha_1pixel_translucent WK1, WK3, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - strd WK2, WK3, [DST, #-16] - ldrd WK0, WK1, [SRC, #-8] - ldrd WK2, WK3, [DST, #-8] - RGBtoRGBPixelAlpha_1pixel_translucent WK0, WK2, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - RGBtoRGBPixelAlpha_1pixel_translucent WK1, WK3, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - b 19f -10: RGBtoRGBPixelAlpha_1pixel_opaque WK0, WK2 - RGBtoRGBPixelAlpha_1pixel_opaque WK1, WK3 - strd WK2, WK3, [DST, #-16] - ldrd WK0, WK1, [SRC, #-8] - ldrd WK2, WK3, [DST, #-8] - RGBtoRGBPixelAlpha_1pixel_opaque WK0, WK2 - RGBtoRGBPixelAlpha_1pixel_opaque WK1, WK3 -19: strd WK2, WK3, [DST, #-8] - .elseif numbytes == 8 - cmp ORIG_W, #0xff000000 - bhs 10f @ all opaque - RGBtoRGBPixelAlpha_1pixel_translucent WK0, WK2, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - RGBtoRGBPixelAlpha_1pixel_translucent WK1, WK3, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - b 19f -10: RGBtoRGBPixelAlpha_1pixel_opaque WK0, WK2 - RGBtoRGBPixelAlpha_1pixel_opaque WK1, WK3 -19: strd WK2, WK3, [DST, #-8] - .else // numbytes == 4 - cmp WK0, #0xff000000 - bhs 10f @ opaque - RGBtoRGBPixelAlpha_1pixel_translucent WK0, WK2, STRIDE_S, STRIDE_M, SCRATCH, ORIG_W, MASK - b 19f -10: RGBtoRGBPixelAlpha_1pixel_opaque WK0, WK2 -19: str WK2, [DST, #-4] - .endif -20: -.endm - -generate_composite_function \ - BlitRGBtoRGBPixelAlphaARMSIMDAsm, 32, 0, 32, \ - FLAG_DST_READWRITE | FLAG_BRANCH_OVER | FLAG_PROCESS_CORRUPTS_PSR | FLAG_PROCESS_DOES_STORE | FLAG_SPILL_LINE_VARS | FLAG_PROCESS_CORRUPTS_WK0, \ - 2, /* prefetch distance */ \ - RGBtoRGBPixelAlpha_init, \ - nop_macro, /* newline */ \ - nop_macro, /* cleanup */ \ - RGBtoRGBPixelAlpha_process_head, \ - RGBtoRGBPixelAlpha_process_tail - -/******************************************************************************/ - -.macro ARGBto565PixelAlpha_init - line_saved_regs STRIDE_D, STRIDE_S, ORIG_W - mov MASK, #0x001f - mov STRIDE_M, #0x0010 - orr MASK, MASK, MASK, lsl #16 - orr STRIDE_M, STRIDE_M, STRIDE_M, lsl #16 -.endm - -.macro ARGBto565PixelAlpha_newline - mov STRIDE_S, #0x0200 -.endm - -/* On entry: - * s1 holds 1 32bpp source pixel - * d holds 1 16bpp destination pixel - * rbmask, rbhalf, ghalf hold 0x001f001f, 0x00100010, 0x00000200 respectively - * other registers are temporaries - * On exit: - * Constant registers preserved - */ - -.macro ARGBto565PixelAlpha_1pixel_translucent s, d, rbmask, rbhalf, ghalf, alpha, rb, g, misc - mov alpha, s, lsr #27 - and misc, s, #0xfc00 - and g, d, #0x07e0 - pkhbt rb, d, d, lsl #5 - rsb misc, g, misc, lsr #5 - and s, rbmask, s, lsr #3 - and rb, rbmask, rb - sub s, s, rb - smlabb misc, misc, alpha, ghalf - mla s, s, alpha, rbhalf - add misc, misc, misc, lsl #5 - add g, g, misc, asr #10 - add s, s, s, lsl #5 - and g, g, #0x07e0 - add rb, rb, s, asr #10 - and rb, rb, rbmask - pkhbt rb, rb, rb, lsl #11 - orr d, rb, g - orr d, d, rb, lsr #16 -.endm - -/* On entry: - * s1 holds 1 32bpp source pixel - * d holds 1 16bpp destination pixel - * rbmask holds 0x001f001f - * On exit: - * Constant registers preserved - */ - -.macro ARGBto565PixelAlpha_1pixel_opaque s, d, rbmask - and d, rbmask, s, lsr #3 - and s, s, #0xfc00 - orr d, d, d, lsr #5 - orr d, d, s, lsr #5 -.endm - -/* On entry: - * s1, s2 hold 2 32bpp source pixels - * d holds 2 16bpp destination pixels - * rbmask, rbhalf, ghalf hold 0x001f001f, 0x00100010, 0x00000200 respectively - * other registers are temporaries - * On exit: - * Constant registers preserved - * Blended results have been written through destination pointer - */ - -.macro ARGBto565PixelAlpha_2pixels_translucent s1, s2, d, rbmask, rbhalf, ghalf, alpha, rb, g, misc - mov alpha, s1, lsr #27 - and misc, s1, #0xfc00 - and g, d, #0x07e0 - pkhbt rb, d, d, lsl #5 - rsb misc, g, misc, lsr #5 - and s1, rbmask, s1, lsr #3 - and rb, rbmask, rb - sub s1, s1, rb - smlabb misc, misc, alpha, ghalf - mla s1, s1, alpha, rbhalf - uxth d, d, ror #16 - add misc, misc, misc, lsl #5 - mov alpha, s2, lsr #27 - add g, g, misc, asr #10 - add s1, s1, s1, lsl #5 - and g, g, #0x07e0 - add rb, rb, s1, asr #10 - and rb, rb, rbmask - and misc, s2, #0xfc00 - pkhbt rb, rb, rb, lsl #11 - and s1, d, #0x07e0 - pkhbt d, d, d, lsl #5 - rsb misc, s1, misc, lsr #5 - and s2, rbmask, s2, lsr #3 - and d, rbmask, d - sub s2, s2, d - smlabb misc, misc, alpha, ghalf - mla s2, s2, alpha, rbhalf - orr alpha, rb, g - add misc, misc, misc, lsl #5 - orr alpha, alpha, rb, lsr #16 - add s1, s1, misc, asr #10 - add s2, s2, s2, lsl #5 - and s1, s1, #0x07e0 - add d, d, s2, asr #10 - and d, d, rbmask - strh alpha, [DST, #-4] - pkhbt d, d, d, lsl #11 - orr alpha, d, s1 - orr alpha, alpha, d, lsr #16 - strh alpha, [DST, #-2] -.endm - -/* On entry: - * s1, s2 hold 2 32bpp source pixels - * rbmask holds 0x001f001f - * other registers are temporaries - * On exit: - * Constant registers preserved - * Blended results have been written through destination pointer - */ - -.macro ARGBto565PixelAlpha_2pixels_opaque s1, s2, d, rbmask, g - and g, s1, #0xfc00 - and d, rbmask, s1, lsr #3 - and s1, rbmask, s2, lsr #3 - orr d, d, d, lsr #5 - orr d, d, g, lsr #5 - and g, s2, #0xfc00 - strh d, [DST, #-4] - orr s1, s1, s1, lsr #5 - orr s1, s1, g, lsr #5 - strh s1, [DST, #-2] -.endm - -.macro ARGBto565PixelAlpha_2pixels_head - ldrd WK0, WK1, [SRC], #8 - ldr WK2, [DST], #4 - orr SCRATCH, WK0, WK1 - and ORIG_W, WK0, WK1 - tst SCRATCH, #0xff000000 -.endm - -.macro ARGBto565PixelAlpha_2pixels_tail - beq 20f @ all transparent - cmp ORIG_W, #0xff000000 - bhs 10f @ all opaque - ARGBto565PixelAlpha_2pixels_translucent WK0, WK1, WK2, MASK, STRIDE_M, STRIDE_S, STRIDE_D, WK3, SCRATCH, ORIG_W - b 20f -10: ARGBto565PixelAlpha_2pixels_opaque WK0, WK1, WK2, MASK, SCRATCH -20: -.endm - -.macro ARGBto565PixelAlpha_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload - .if numbytes == 16 - ARGBto565PixelAlpha_2pixels_head - ARGBto565PixelAlpha_2pixels_tail - ARGBto565PixelAlpha_2pixels_head - ARGBto565PixelAlpha_2pixels_tail - .endif - .if numbytes >= 8 - ARGBto565PixelAlpha_2pixels_head - ARGBto565PixelAlpha_2pixels_tail - .endif - .if numbytes >= 4 - ARGBto565PixelAlpha_2pixels_head - .else // numbytes == 2 - ldr WK0, [SRC], #4 - ldrh WK2, [DST], #2 - tst WK0, #0xff000000 - .endif -.endm - -.macro ARGBto565PixelAlpha_process_tail cond, numbytes, firstreg - .if numbytes >= 4 - ARGBto565PixelAlpha_2pixels_tail - .else // numbytes == 2 - beq 20f @ all transparent - cmp WK0, #0xff000000 - bhs 10f @ opaque - ARGBto565PixelAlpha_1pixel_translucent WK0, WK2, MASK, STRIDE_M, STRIDE_S, STRIDE_D, WK3, SCRATCH, ORIG_W - b 19f -10: ARGBto565PixelAlpha_1pixel_opaque WK0, WK2, MASK -19: strh WK2, [DST, #-2] -20: - .endif -.endm - -generate_composite_function \ - BlitARGBto565PixelAlphaARMSIMDAsm, 32, 0, 16, \ - FLAG_DST_READWRITE | FLAG_BRANCH_OVER | FLAG_PROCESS_CORRUPTS_PSR | FLAG_PROCESS_DOES_STORE | FLAG_SPILL_LINE_VARS | FLAG_PROCESS_CORRUPTS_WK0, \ - 2, /* prefetch distance */ \ - ARGBto565PixelAlpha_init, \ - ARGBto565PixelAlpha_newline, \ - nop_macro, /* cleanup */ \ - ARGBto565PixelAlpha_process_head, \ - ARGBto565PixelAlpha_process_tail - - /******************************************************************************/ - -.macro BGR888toRGB888_1pixel cond, reg, tmp - uxtb16&cond tmp, WK®, ror #8 - uxtb16&cond WK®, WK®, ror #16 - orr&cond WK®, WK®, tmp, lsl #8 -.endm - -.macro BGR888toRGB888_2pixels cond, reg1, reg2, tmp1, tmp2 - uxtb16&cond tmp1, WK®1, ror #8 - uxtb16&cond WK®1, WK®1, ror #16 - uxtb16&cond tmp2, WK®2, ror #8 - uxtb16&cond WK®2, WK®2, ror #16 - orr&cond WK®1, WK®1, tmp1, lsl #8 - orr&cond WK®2, WK®2, tmp2, lsl #8 -.endm - -.macro BGR888toRGB888_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload - pixld cond, numbytes, firstreg, SRC, unaligned_src -.endm - -.macro BGR888toRGB888_process_tail cond, numbytes, firstreg - .if numbytes >= 8 - BGR888toRGB888_2pixels cond, %(firstreg+0), %(firstreg+1), MASK, STRIDE_M - .if numbytes == 16 - BGR888toRGB888_2pixels cond, %(firstreg+2), %(firstreg+3), MASK, STRIDE_M - .endif - .else @ numbytes == 4 - BGR888toRGB888_1pixel cond, %(firstreg+0), MASK - .endif -.endm - -generate_composite_function \ - Blit_XBGR8888_XRGB8888ARMSIMDAsm, 32, 0, 32, \ - FLAG_DST_WRITEONLY | FLAG_COND_EXEC | FLAG_PROCESS_PRESERVES_SCRATCH, \ - 2, /* prefetch distance */ \ - nop_macro, /* init */ \ - nop_macro, /* newline */ \ - nop_macro, /* cleanup */ \ - BGR888toRGB888_process_head, \ - BGR888toRGB888_process_tail - -/******************************************************************************/ - -.macro RGB444toRGB888_init - ldr MASK, =0x0f0f0f0f - /* Set GE[3:0] to 0101 so SEL instructions do what we want */ - msr CPSR_s, #0x50000 -.endm - -.macro RGB444toRGB888_1pixel reg, mask, tmp - pkhbt WK®, WK®, WK®, lsl #12 @ 0000aaaarrrrggggaaaarrrrggggbbbb - and WK®, mask, WK® @ 0000aaaa0000gggg0000rrrr0000bbbb - orr WK®, WK®, WK®, lsl #4 @ aaaaaaaaggggggggrrrrrrrrbbbbbbbb - pkhtb tmp, WK®, WK®, asr #8 @ aaaaaaaaggggggggggggggggrrrrrrrr - pkhbt WK®, WK®, WK®, lsl #8 @ ggggggggrrrrrrrrrrrrrrrrbbbbbbbb - sel WK®, WK®, tmp @ aaaaaaaarrrrrrrrggggggggbbbbbbbb -.endm - -.macro RGB444toRGB888_2pixels in, out1, out2, mask, tmp1, tmp2 - and tmp1, mask, WK&in @ 0000RRRR0000BBBB0000rrrr0000bbbb - and tmp2, mask, WK&in, lsr #4 @ 0000AAAA0000GGGG0000aaaa0000gggg - orr tmp1, tmp1, tmp1, lsl #4 @ RRRRRRRRBBBBBBBBrrrrrrrrbbbbbbbb - orr tmp2, tmp2, tmp2, lsl #4 @ AAAAAAAAGGGGGGGGaaaaaaaagggggggg - pkhtb WK&out2, tmp2, tmp1, asr #16 @ AAAAAAAAGGGGGGGGRRRRRRRRBBBBBBBB - pkhbt WK&out1, tmp1, tmp2, lsl #16 @ aaaaaaaaggggggggrrrrrrrrbbbbbbbb - pkhtb tmp2, WK&out2, WK&out2, asr #8 @ AAAAAAAAGGGGGGGGGGGGGGGGRRRRRRRR - pkhtb tmp1, WK&out1, WK&out1, asr #8 @ aaaaaaaaggggggggggggggggrrrrrrrr - pkhbt WK&out1, WK&out1, WK&out1, lsl #8 @ ggggggggrrrrrrrrrrrrrrrrbbbbbbbb - pkhbt WK&out2, WK&out2, WK&out2, lsl #8 @ GGGGGGGGRRRRRRRRRRRRRRRRBBBBBBBB - sel WK&out1, WK&out1, tmp1 @ aaaaaaaarrrrrrrrggggggggbbbbbbbb - sel WK&out2, WK&out2, tmp2 @ AAAAAAAARRRRRRRRGGGGGGGGBBBBBBBB -.endm - -.macro RGB444toRGB888_process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, preload - pixld cond, numbytes/2, firstreg, SRC, unaligned_src -.endm - -.macro RGB444toRGB888_process_tail cond, numbytes, firstreg - .if numbytes >= 8 - .if numbytes == 16 - RGB444toRGB888_2pixels %(firstreg+1), %(firstreg+2), %(firstreg+3), MASK, STRIDE_M, SCRATCH - .endif - RGB444toRGB888_2pixels %(firstreg+0), %(firstreg+0), %(firstreg+1), MASK, STRIDE_M, SCRATCH - .else @ numbytes == 4 - RGB444toRGB888_1pixel %(firstreg+0), MASK, SCRATCH - .endif -.endm - -generate_composite_function \ - Blit_RGB444_XRGB8888ARMSIMDAsm, 16, 0, 32, \ - FLAG_DST_WRITEONLY | FLAG_BRANCH_OVER, \ - 2, /* prefetch distance */ \ - RGB444toRGB888_init, \ - nop_macro, /* newline */ \ - nop_macro, /* cleanup */ \ - RGB444toRGB888_process_head, \ - RGB444toRGB888_process_tail diff --git a/src/video/arm/pixman-arm-simd-asm.h b/src/video/arm/pixman-arm-simd-asm.h deleted file mode 100644 index 067d52c1a8c59..0000000000000 --- a/src/video/arm/pixman-arm-simd-asm.h +++ /dev/null @@ -1,1034 +0,0 @@ -/* - * Copyright (c) 2012 Raspberry Pi Foundation - * Copyright (c) 2012 RISC OS Open Ltd - * - * This software is provided 'as-is', without any express or implied - * warranty. In no event will the authors be held liable for any damages - * arising from the use of this software. - * - * Permission is granted to anyone to use this software for any purpose, - * including commercial applications, and to alter it and redistribute it - * freely, subject to the following restrictions: - * - * 1. The origin of this software must not be misrepresented; you must not - * claim that you wrote the original software. If you use this software - * in a product, an acknowledgment in the product documentation would be - * appreciated but is not required. - * 2. Altered source versions must be plainly marked as such, and must not be - * misrepresented as being the original software. - * 3. This notice may not be removed or altered from any source distribution. - */ - -/* - * Because the alignment of pixel data to cachelines, and even the number of - * cachelines per row can vary from row to row, and because of the need to - * preload each scanline once and only once, this prefetch strategy treats - * each row of pixels independently. When a pixel row is long enough, there - * are three distinct phases of prefetch: - * * an inner loop section, where each time a cacheline of data is - * processed, another cacheline is preloaded (the exact distance ahead is - * determined empirically using profiling results from lowlevel-blt-bench) - * * a leading section, where enough cachelines are preloaded to ensure no - * cachelines escape being preloaded when the inner loop starts - * * a trailing section, where a limited number (0 or more) of cachelines - * are preloaded to deal with data (if any) that hangs off the end of the - * last iteration of the inner loop, plus any trailing bytes that were not - * enough to make up one whole iteration of the inner loop - * - * There are (in general) three distinct code paths, selected between - * depending upon how long the pixel row is. If it is long enough that there - * is at least one iteration of the inner loop (as described above) then - * this is described as the "wide" case. If it is shorter than that, but - * there are still enough bytes output that there is at least one 16-byte- - * long, 16-byte-aligned write to the destination (the optimum type of - * write), then this is the "medium" case. If it is not even this long, then - * this is the "narrow" case, and there is no attempt to align writes to - * 16-byte boundaries. In the "medium" and "narrow" cases, all the - * cachelines containing data from the pixel row are prefetched up-front. - */ - -/* - * Determine whether we put the arguments on the stack for debugging. - */ -#undef DEBUG_PARAMS - -/* - * Bit flags for 'generate_composite_function' macro which are used - * to tune generated functions behavior. - */ -.set FLAG_DST_WRITEONLY, 0 -.set FLAG_DST_READWRITE, 1 -.set FLAG_COND_EXEC, 0 -.set FLAG_BRANCH_OVER, 2 -.set FLAG_PROCESS_PRESERVES_PSR, 0 -.set FLAG_PROCESS_CORRUPTS_PSR, 4 -.set FLAG_PROCESS_DOESNT_STORE, 0 -.set FLAG_PROCESS_DOES_STORE, 8 /* usually because it needs to conditionally skip it */ -.set FLAG_NO_SPILL_LINE_VARS, 0 -.set FLAG_SPILL_LINE_VARS_WIDE, 16 -.set FLAG_SPILL_LINE_VARS_NON_WIDE, 32 -.set FLAG_SPILL_LINE_VARS, 48 -.set FLAG_PROCESS_CORRUPTS_SCRATCH, 0 -.set FLAG_PROCESS_PRESERVES_SCRATCH, 64 -.set FLAG_PROCESS_PRESERVES_WK0, 0 -.set FLAG_PROCESS_CORRUPTS_WK0, 128 /* if possible, use the specified register(s) instead so WK0 can hold number of leading pixels */ -.set FLAG_PRELOAD_DST, 0 -.set FLAG_NO_PRELOAD_DST, 256 - -/* - * Number of bytes by which to adjust preload offset of destination - * buffer (allows preload instruction to be moved before the load(s)) - */ -.set DST_PRELOAD_BIAS, 0 - -/* - * Offset into stack where mask and source pointer/stride can be accessed. - */ -#ifdef DEBUG_PARAMS -.set ARGS_STACK_OFFSET, (9*4+9*4) -#else -.set ARGS_STACK_OFFSET, (9*4) -#endif - -/* - * Offset into stack where space allocated during init macro can be accessed. - */ -.set LOCALS_STACK_OFFSET, 0 - -/* - * Constants for selecting preferable prefetch type. - */ -.set PREFETCH_TYPE_NONE, 0 -.set PREFETCH_TYPE_STANDARD, 1 - -/* - * Definitions of macros for load/store of pixel data. - */ - -.macro pixldst op, cond=al, numbytes, reg0, reg1, reg2, reg3, base, unaligned=0 - .if numbytes == 16 - .if unaligned == 1 - op&r&cond WK®0, [base], #4 - op&r&cond WK®1, [base], #4 - op&r&cond WK®2, [base], #4 - op&r&cond WK®3, [base], #4 - .else - op&m&cond&ia base!, {WK®0,WK®1,WK®2,WK®3} - .endif - .elseif numbytes == 8 - .if unaligned == 1 - op&r&cond WK®0, [base], #4 - op&r&cond WK®1, [base], #4 - .else - op&m&cond&ia base!, {WK®0,WK®1} - .endif - .elseif numbytes == 4 - op&r&cond WK®0, [base], #4 - .elseif numbytes == 2 - op&r&cond&h WK®0, [base], #2 - .elseif numbytes == 1 - op&r&cond&b WK®0, [base], #1 - .else - .error "unsupported size: numbytes" - .endif -.endm - -.macro pixst_baseupdated cond, numbytes, reg0, reg1, reg2, reg3, base - .if numbytes == 16 - stm&cond&db base, {WK®0,WK®1,WK®2,WK®3} - .elseif numbytes == 8 - stm&cond&db base, {WK®0,WK®1} - .elseif numbytes == 4 - str&cond WK®0, [base, #-4] - .elseif numbytes == 2 - str&cond&h WK®0, [base, #-2] - .elseif numbytes == 1 - str&cond&b WK®0, [base, #-1] - .else - .error "unsupported size: numbytes" - .endif -.endm - -.macro pixld cond, numbytes, firstreg, base, unaligned - pixldst ld, cond, numbytes, %(firstreg+0), %(firstreg+1), %(firstreg+2), %(firstreg+3), base, unaligned -.endm - -.macro pixst cond, numbytes, firstreg, base - .if (flags) & FLAG_DST_READWRITE - pixst_baseupdated cond, numbytes, %(firstreg+0), %(firstreg+1), %(firstreg+2), %(firstreg+3), base - .else - pixldst st, cond, numbytes, %(firstreg+0), %(firstreg+1), %(firstreg+2), %(firstreg+3), base - .endif -.endm - -.macro PF a, x:vararg - .if (PREFETCH_TYPE_CURRENT == PREFETCH_TYPE_STANDARD) - a x - .endif -.endm - - -.macro preload_leading_step1 bpp, ptr, base -/* If the destination is already 16-byte aligned, then we need to preload - * between 0 and prefetch_distance (inclusive) cache lines ahead so there - * are no gaps when the inner loop starts. - */ - .if bpp > 0 - PF bic, ptr, base, #31 - .set OFFSET, 0 - .rept prefetch_distance+1 - PF pld, [ptr, #OFFSET] - .set OFFSET, OFFSET+32 - .endr - .endif -.endm - -.macro preload_leading_step2 bpp, bpp_shift, ptr, base -/* However, if the destination is not 16-byte aligned, we may need to - * preload more cache lines than that. The question we need to ask is: - * are the bytes corresponding to the leading pixels more than the amount - * by which the source pointer will be rounded down for preloading, and if - * so, by how many cache lines? Effectively, we want to calculate - * leading_bytes = ((-dst)&15)*src_bpp/dst_bpp - * inner_loop_offset = (src+leading_bytes)&31 - * extra_needed = leading_bytes - inner_loop_offset - * and test if extra_needed is <= 0, <= 32, or > 32 (where > 32 is only - * possible when there are 4 src bytes for every 1 dst byte). - */ - .if bpp > 0 - .ifc base,DST - /* The test can be simplified further when preloading the destination */ - PF tst, base, #16 - PF beq, 61f - .else - .if bpp/dst_w_bpp == 4 - PF add, SCRATCH, base, WK0, lsl #bpp_shift-dst_bpp_shift - PF and, SCRATCH, SCRATCH, #31 - PF rsb, SCRATCH, SCRATCH, WK0, lsl #bpp_shift-dst_bpp_shift - PF sub, SCRATCH, SCRATCH, #1 /* so now ranges are -16..-1 / 0..31 / 32..63 */ - PF movs, SCRATCH, SCRATCH, lsl #32-6 /* so this sets NC / nc / Nc */ - PF bcs, 61f - PF bpl, 60f - PF pld, [ptr, #32*(prefetch_distance+2)] - .else - PF mov, SCRATCH, base, lsl #32-5 - PF add, SCRATCH, SCRATCH, WK0, lsl #32-5+bpp_shift-dst_bpp_shift - PF rsbs, SCRATCH, SCRATCH, WK0, lsl #32-5+bpp_shift-dst_bpp_shift - PF bls, 61f - .endif - .endif -60: PF pld, [ptr, #32*(prefetch_distance+1)] -61: - .endif -.endm - -#define IS_END_OF_GROUP(INDEX,SIZE) ((SIZE) < 2 || ((INDEX) & ~((INDEX)+1)) & ((SIZE)/2)) -.macro preload_middle bpp, base, scratch_holds_offset - .if bpp > 0 - /* prefetch distance = 256/bpp, stm distance = 128/dst_w_bpp */ - .if IS_END_OF_GROUP(SUBBLOCK,256/128*dst_w_bpp/bpp) - .if scratch_holds_offset - PF pld, [base, SCRATCH] - .else - PF bic, SCRATCH, base, #31 - PF pld, [SCRATCH, #32*prefetch_distance] - .endif - .endif - .endif -.endm - -.macro preload_trailing bpp, bpp_shift, base - .if bpp > 0 - .if bpp*pix_per_block > 256 - /* Calculations are more complex if more than one fetch per block */ - PF and, WK1, base, #31 - PF add, WK1, WK1, WK0, lsl #bpp_shift - PF add, WK1, WK1, #32*(bpp*pix_per_block/256-1)*(prefetch_distance+1) - PF bic, SCRATCH, base, #31 -80: PF pld, [SCRATCH, #32*(prefetch_distance+1)] - PF add, SCRATCH, SCRATCH, #32 - PF subs, WK1, WK1, #32 - PF bhi, 80b - .else - /* If exactly one fetch per block, then we need either 0, 1 or 2 extra preloads */ - PF mov, SCRATCH, base, lsl #32-5 - PF adds, SCRATCH, SCRATCH, X, lsl #32-5+bpp_shift - PF adceqs, SCRATCH, SCRATCH, #0 - /* The instruction above has two effects: ensures Z is only - * set if C was clear (so Z indicates that both shifted quantities - * were 0), and clears C if Z was set (so C indicates that the sum - * of the shifted quantities was greater and not equal to 32) */ - PF beq, 82f - PF bic, SCRATCH, base, #31 - PF bcc, 81f - PF pld, [SCRATCH, #32*(prefetch_distance+2)] -81: PF pld, [SCRATCH, #32*(prefetch_distance+1)] -82: - .endif - .endif -.endm - - -.macro preload_line narrow_case, bpp, bpp_shift, base -/* "narrow_case" - just means that the macro was invoked from the "narrow" - * code path rather than the "medium" one - because in the narrow case, - * the row of pixels is known to output no more than 30 bytes, then - * (assuming the source pixels are no wider than the the destination - * pixels) they cannot possibly straddle more than 2 32-byte cachelines, - * meaning there's no need for a loop. - * "bpp" - number of bits per pixel in the channel (source, mask or - * destination) that's being preloaded, or 0 if this channel is not used - * for reading - * "bpp_shift" - log2 of ("bpp"/8) (except if "bpp"=0 of course) - * "base" - base address register of channel to preload (SRC, MASK or DST) - */ - .if bpp > 0 - .if narrow_case && (bpp <= dst_w_bpp) - /* In these cases, each line for each channel is in either 1 or 2 cache lines */ - PF bic, WK0, base, #31 - PF pld, [WK0] - PF add, WK1, base, X, LSL #bpp_shift - PF sub, WK1, WK1, #1 - PF bic, WK1, WK1, #31 - PF cmp, WK1, WK0 - PF beq, 90f - PF pld, [WK1] -90: - .else - PF bic, WK0, base, #31 - PF pld, [WK0] - PF add, WK1, base, X, lsl #bpp_shift - PF sub, WK1, WK1, #1 - PF bic, WK1, WK1, #31 - PF cmp, WK1, WK0 - PF beq, 92f -91: PF add, WK0, WK0, #32 - PF cmp, WK0, WK1 - PF pld, [WK0] - PF bne, 91b -92: - .endif - .endif -.endm - - -.macro conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx - process_head cond, numbytes, firstreg, unaligned_src, unaligned_mask, 0 - .if decrementx - sub&cond X, X, #8*numbytes/dst_w_bpp - .endif - process_tail cond, numbytes, firstreg - .if !((flags) & FLAG_PROCESS_DOES_STORE) - pixst cond, numbytes, firstreg, DST - .endif -.endm - -.macro conditional_process1 cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx - .if (flags) & FLAG_BRANCH_OVER - .ifc cond,mi - bpl 100f - .endif - .ifc cond,cs - bcc 100f - .endif - .ifc cond,ne - beq 100f - .endif - conditional_process1_helper , process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx -100: - .else - conditional_process1_helper cond, process_head, process_tail, numbytes, firstreg, unaligned_src, unaligned_mask, decrementx - .endif -.endm - -.macro conditional_process2 test, cond1, cond2, process_head, process_tail, numbytes1, numbytes2, firstreg1, firstreg2, unaligned_src, unaligned_mask, decrementx - .if (flags) & (FLAG_DST_READWRITE | FLAG_BRANCH_OVER | FLAG_PROCESS_CORRUPTS_PSR | FLAG_PROCESS_DOES_STORE) - /* Can't interleave reads and writes */ - test - conditional_process1 cond1, process_head, process_tail, numbytes1, firstreg1, unaligned_src, unaligned_mask, decrementx - .if (flags) & FLAG_PROCESS_CORRUPTS_PSR - test - .endif - conditional_process1 cond2, process_head, process_tail, numbytes2, firstreg2, unaligned_src, unaligned_mask, decrementx - .else - /* Can interleave reads and writes for better scheduling */ - test - process_head cond1, numbytes1, firstreg1, unaligned_src, unaligned_mask, 0 - process_head cond2, numbytes2, firstreg2, unaligned_src, unaligned_mask, 0 - .if decrementx - sub&cond1 X, X, #8*numbytes1/dst_w_bpp - sub&cond2 X, X, #8*numbytes2/dst_w_bpp - .endif - process_tail cond1, numbytes1, firstreg1 - process_tail cond2, numbytes2, firstreg2 - pixst cond1, numbytes1, firstreg1, DST - pixst cond2, numbytes2, firstreg2, DST - .endif -.endm - - -.macro test_bits_1_0_ptr - .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 - movs SCRATCH, X, lsl #32-1 /* C,N = bits 1,0 of DST */ - .else - movs SCRATCH, WK0, lsl #32-1 /* C,N = bits 1,0 of DST */ - .endif -.endm - -.macro test_bits_3_2_ptr - .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 - movs SCRATCH, X, lsl #32-3 /* C,N = bits 3, 2 of DST */ - .else - movs SCRATCH, WK0, lsl #32-3 /* C,N = bits 3, 2 of DST */ - .endif -.endm - -.macro leading_15bytes process_head, process_tail - /* On entry, WK0 bits 0-3 = number of bytes until destination is 16-byte aligned */ - .set DECREMENT_X, 1 - .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 - .set DECREMENT_X, 0 - sub X, X, WK0, lsr #dst_bpp_shift - str X, [sp, #LINE_SAVED_REG_COUNT*4] - mov X, WK0 - .endif - /* Use unaligned loads in all cases for simplicity */ - .if dst_w_bpp == 8 - conditional_process2 test_bits_1_0_ptr, mi, cs, process_head, process_tail, 1, 2, 1, 2, 1, 1, DECREMENT_X - .elseif dst_w_bpp == 16 - test_bits_1_0_ptr - conditional_process1 cs, process_head, process_tail, 2, 2, 1, 1, DECREMENT_X - .endif - conditional_process2 test_bits_3_2_ptr, mi, cs, process_head, process_tail, 4, 8, 1, 2, 1, 1, DECREMENT_X - .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 - ldr X, [sp, #LINE_SAVED_REG_COUNT*4] - .endif -.endm - -.macro test_bits_3_2_pix - movs SCRATCH, X, lsl #dst_bpp_shift+32-3 -.endm - -.macro test_bits_1_0_pix - .if dst_w_bpp == 8 - movs SCRATCH, X, lsl #dst_bpp_shift+32-1 - .else - movs SCRATCH, X, lsr #1 - .endif -.endm - -.macro trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask - conditional_process2 test_bits_3_2_pix, cs, mi, process_head, process_tail, 8, 4, 0, 2, unaligned_src, unaligned_mask, 0 - .if dst_w_bpp == 16 - test_bits_1_0_pix - conditional_process1 cs, process_head, process_tail, 2, 0, unaligned_src, unaligned_mask, 0 - .elseif dst_w_bpp == 8 - conditional_process2 test_bits_1_0_pix, cs, mi, process_head, process_tail, 2, 1, 0, 1, unaligned_src, unaligned_mask, 0 - .endif -.endm - - -.macro wide_case_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, dst_alignment -110: - .set SUBBLOCK, 0 /* this is a count of STMs; there can be up to 8 STMs per block */ - .rept pix_per_block*dst_w_bpp/128 - process_head , 16, 0, unaligned_src, unaligned_mask, 1 - .if (src_bpp > 0) && (mask_bpp == 0) && ((flags) & FLAG_PROCESS_PRESERVES_SCRATCH) - preload_middle src_bpp, SRC, 1 - .elseif (src_bpp == 0) && (mask_bpp > 0) && ((flags) & FLAG_PROCESS_PRESERVES_SCRATCH) - preload_middle mask_bpp, MASK, 1 - .else - preload_middle src_bpp, SRC, 0 - preload_middle mask_bpp, MASK, 0 - .endif - .if (dst_r_bpp > 0) && ((SUBBLOCK % 2) == 0) && (((flags) & FLAG_NO_PRELOAD_DST) == 0) - /* Because we know that writes are 16-byte aligned, it's relatively easy to ensure that - * destination prefetches are 32-byte aligned. It's also the easiest channel to offset - * preloads for, to achieve staggered prefetches for multiple channels, because there are - * always two STMs per prefetch, so there is always an opposite STM on which to put the - * preload. Note, no need to BIC the base register here */ - PF pld, [DST, #32*prefetch_distance - dst_alignment] - .endif - process_tail , 16, 0 - .if !((flags) & FLAG_PROCESS_DOES_STORE) - pixst , 16, 0, DST - .endif - .set SUBBLOCK, SUBBLOCK+1 - .endr - subs X, X, #pix_per_block - bhs 110b -.endm - -.macro wide_case_inner_loop_and_trailing_pixels process_head, process_tail, process_inner_loop, exit_label, unaligned_src, unaligned_mask - /* Destination now 16-byte aligned; we have at least one block before we have to stop preloading */ - .if dst_r_bpp > 0 - tst DST, #16 - bne 111f - process_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, 16 + DST_PRELOAD_BIAS - b 112f -111: - .endif - process_inner_loop process_head, process_tail, unaligned_src, unaligned_mask, 0 + DST_PRELOAD_BIAS -112: - /* Just before the final (prefetch_distance+1) 32-byte blocks, deal with final preloads */ - .if (src_bpp*pix_per_block > 256) || (mask_bpp*pix_per_block > 256) || (dst_r_bpp*pix_per_block > 256) - PF and, WK0, X, #pix_per_block-1 - .endif - preload_trailing src_bpp, src_bpp_shift, SRC - preload_trailing mask_bpp, mask_bpp_shift, MASK - .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 - preload_trailing dst_r_bpp, dst_bpp_shift, DST - .endif - add X, X, #(prefetch_distance+2)*pix_per_block - 128/dst_w_bpp - /* The remainder of the line is handled identically to the medium case */ - medium_case_inner_loop_and_trailing_pixels process_head, process_tail,, exit_label, unaligned_src, unaligned_mask -.endm - -.macro medium_case_inner_loop_and_trailing_pixels process_head, process_tail, unused, exit_label, unaligned_src, unaligned_mask -120: - process_head , 16, 0, unaligned_src, unaligned_mask, 0 - process_tail , 16, 0 - .if !((flags) & FLAG_PROCESS_DOES_STORE) - pixst , 16, 0, DST - .endif - subs X, X, #128/dst_w_bpp - bhs 120b - /* Trailing pixels */ - tst X, #128/dst_w_bpp - 1 - beq exit_label - trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask -.endm - -.macro narrow_case_inner_loop_and_trailing_pixels process_head, process_tail, unused, exit_label, unaligned_src, unaligned_mask - tst X, #16*8/dst_w_bpp - conditional_process1 ne, process_head, process_tail, 16, 0, unaligned_src, unaligned_mask, 0 - /* Trailing pixels */ - /* In narrow case, it's relatively unlikely to be aligned, so let's do without a branch here */ - trailing_15bytes process_head, process_tail, unaligned_src, unaligned_mask -.endm - -.macro switch_on_alignment action, process_head, process_tail, process_inner_loop, exit_label - /* Note that if we're reading the destination, it's already guaranteed to be aligned at this point */ - .if mask_bpp == 8 || mask_bpp == 16 - tst MASK, #3 - bne 141f - .endif - .if src_bpp == 8 || src_bpp == 16 - tst SRC, #3 - bne 140f - .endif - action process_head, process_tail, process_inner_loop, exit_label, 0, 0 - .if src_bpp == 8 || src_bpp == 16 - b exit_label -140: - action process_head, process_tail, process_inner_loop, exit_label, 1, 0 - .endif - .if mask_bpp == 8 || mask_bpp == 16 - b exit_label -141: - .if src_bpp == 8 || src_bpp == 16 - tst SRC, #3 - bne 142f - .endif - action process_head, process_tail, process_inner_loop, exit_label, 0, 1 - .if src_bpp == 8 || src_bpp == 16 - b exit_label -142: - action process_head, process_tail, process_inner_loop, exit_label, 1, 1 - .endif - .endif -.endm - - -.macro end_of_line restore_x, vars_spilled, loop_label, last_one - .if SINGLE_SCANLINE - .ifc "last_one","" - b 198f - .endif - .else - .if vars_spilled - /* Sadly, GAS doesn't seem have an equivalent of the DCI directive? */ - /* This is ldmia sp,{} */ - .word 0xE89D0000 | LINE_SAVED_REGS - .endif - subs Y, Y, #1 - .if vars_spilled - .if (LINE_SAVED_REGS) & (1<<1) - str Y, [sp] - .endif - .endif - add DST, DST, STRIDE_D - .if src_bpp > 0 - add SRC, SRC, STRIDE_S - .endif - .if mask_bpp > 0 - add MASK, MASK, STRIDE_M - .endif - .if restore_x - mov X, ORIG_W - .endif - bhs loop_label - .ifc "last_one","" - .if vars_spilled - b 197f - .else - b 198f - .endif - .else - .if (!vars_spilled) && ((flags) & FLAG_SPILL_LINE_VARS) - b 198f - .endif - .endif - .endif -.endm - - -.macro generate_composite_function_common fname, \ - src_bpp_, \ - mask_bpp_, \ - dst_w_bpp_, \ - flags_, \ - prefetch_distance_, \ - init, \ - newline, \ - cleanup, \ - process_head, \ - process_tail, \ - process_inner_loop - - pixman_asm_function fname - -/* - * Make some macro arguments globally visible and accessible - * from other macros - */ - .set src_bpp, src_bpp_ - .set mask_bpp, mask_bpp_ - .set dst_w_bpp, dst_w_bpp_ - .set flags, flags_ - .set prefetch_distance, prefetch_distance_ - -/* - * Select prefetch type for this function. - */ - .if prefetch_distance == 0 - .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_NONE - .else - .set PREFETCH_TYPE_CURRENT, PREFETCH_TYPE_STANDARD - .endif - - .if src_bpp == 32 - .set src_bpp_shift, 2 - .elseif src_bpp == 24 - .set src_bpp_shift, 0 - .elseif src_bpp == 16 - .set src_bpp_shift, 1 - .elseif src_bpp == 8 - .set src_bpp_shift, 0 - .elseif src_bpp == 0 - .set src_bpp_shift, -1 - .else - .error "requested src bpp (src_bpp) is not supported" - .endif - - .if mask_bpp == 32 - .set mask_bpp_shift, 2 - .elseif mask_bpp == 24 - .set mask_bpp_shift, 0 - .elseif mask_bpp == 8 - .set mask_bpp_shift, 0 - .elseif mask_bpp == 0 - .set mask_bpp_shift, -1 - .else - .error "requested mask bpp (mask_bpp) is not supported" - .endif - - .if dst_w_bpp == 32 - .set dst_bpp_shift, 2 - .elseif dst_w_bpp == 24 - .set dst_bpp_shift, 0 - .elseif dst_w_bpp == 16 - .set dst_bpp_shift, 1 - .elseif dst_w_bpp == 8 - .set dst_bpp_shift, 0 - .else - .error "requested dst bpp (dst_w_bpp) is not supported" - .endif - - .if (((flags) & FLAG_DST_READWRITE) != 0) - .set dst_r_bpp, dst_w_bpp - .else - .set dst_r_bpp, 0 - .endif - - .set pix_per_block, 16*8/dst_w_bpp - .if src_bpp != 0 - .if 32*8/src_bpp > pix_per_block - .set pix_per_block, 32*8/src_bpp - .endif - .endif - .if mask_bpp != 0 - .if 32*8/mask_bpp > pix_per_block - .set pix_per_block, 32*8/mask_bpp - .endif - .endif - .if dst_r_bpp != 0 - .if 32*8/dst_r_bpp > pix_per_block - .set pix_per_block, 32*8/dst_r_bpp - .endif - .endif - -/* The standard entry conditions set up by pixman-arm-common.h are: - * r0 = width (pixels) - * r1 = height (rows) - * r2 = pointer to top-left pixel of destination - * r3 = destination stride (pixels) - * [sp] = source pixel value, or pointer to top-left pixel of source - * [sp,#4] = 0 or source stride (pixels) - * The following arguments are unused for non-mask operations - * [sp,#8] = mask pixel value, or pointer to top-left pixel of mask - * [sp,#12] = 0 or mask stride (pixels) - * - * or in the single-scanline case: - * r0 = width (pixels) - * r1 = pointer to top-left pixel of destination - * r2 = pointer to top-left pixel of source - * The following argument is unused for non-mask operations - * r3 = pointer to top-left pixel of mask - */ - -/* - * Assign symbolic names to registers - */ - X .req r0 /* pixels to go on this line */ - .if SINGLE_SCANLINE - DST .req r1 /* destination pixel pointer */ - SRC .req r2 /* source pixel pointer */ - MASK .req r3 /* mask pixel pointer (if applicable) */ - Y .req r4 /* temporary */ - STRIDE_D .req r5 /* temporary */ - STRIDE_S .req r6 /* temporary */ - STRIDE_M .req r7 /* temporary */ - .else - Y .req r1 /* lines to go */ - DST .req r2 /* destination pixel pointer */ - STRIDE_D .req r3 /* destination stride (bytes, minus width) */ - SRC .req r4 /* source pixel pointer */ - STRIDE_S .req r5 /* source stride (bytes, minus width) */ - MASK .req r6 /* mask pixel pointer (if applicable) */ - STRIDE_M .req r7 /* mask stride (bytes, minus width) */ - .endif - WK0 .req r8 /* pixel data registers */ - WK1 .req r9 - WK2 .req r10 - WK3 .req r11 - SCRATCH .req r12 - ORIG_W .req r14 /* width (pixels) */ - - push {r4-r11, lr} /* save all registers */ - - .if !SINGLE_SCANLINE - subs Y, Y, #1 - blo 199f - .endif - -#ifdef DEBUG_PARAMS - sub sp, sp, #9*4 -#endif - - .if !SINGLE_SCANLINE - .if src_bpp > 0 - ldr SRC, [sp, #ARGS_STACK_OFFSET] - ldr STRIDE_S, [sp, #ARGS_STACK_OFFSET+4] - .endif - .if mask_bpp > 0 - ldr MASK, [sp, #ARGS_STACK_OFFSET+8] - ldr STRIDE_M, [sp, #ARGS_STACK_OFFSET+12] - .endif - .endif - -#ifdef DEBUG_PARAMS - add Y, Y, #1 - stmia sp, {r0-r7,pc} - sub Y, Y, #1 -#endif - - init - - .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 - /* Reserve a word in which to store X during leading pixels */ - sub sp, sp, #4 - .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET+4 - .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET+4 - .endif - - .if !SINGLE_SCANLINE - lsl STRIDE_D, #dst_bpp_shift /* stride in bytes */ - sub STRIDE_D, STRIDE_D, X, lsl #dst_bpp_shift - .if src_bpp > 0 - lsl STRIDE_S, #src_bpp_shift - sub STRIDE_S, STRIDE_S, X, lsl #src_bpp_shift - .endif - .if mask_bpp > 0 - lsl STRIDE_M, #mask_bpp_shift - sub STRIDE_M, STRIDE_M, X, lsl #mask_bpp_shift - .endif - .endif - - /* Are we not even wide enough to have one 16-byte aligned 16-byte block write? */ - cmp X, #2*16*8/dst_w_bpp - 1 - blo 170f - .if src_bpp || mask_bpp || dst_r_bpp /* Wide and medium cases are the same for fill */ - /* To preload ahead on the current line, we need at least (prefetch_distance+2) 32-byte blocks on all prefetch channels */ - cmp X, #(prefetch_distance+3)*pix_per_block - 1 - blo 160f - - /* Wide case */ - /* Adjust X so that the decrement instruction can also test for - * inner loop termination. We want it to stop when there are - * (prefetch_distance+1) complete blocks to go. */ - sub X, X, #(prefetch_distance+2)*pix_per_block - .if !SINGLE_SCANLINE - mov ORIG_W, X - .if (flags) & FLAG_SPILL_LINE_VARS_WIDE - /* This is stmdb sp!,{} */ - .word 0xE92D0000 | LINE_SAVED_REGS - .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 - .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 - .endif - .endif -151: /* New line */ - newline - preload_leading_step1 src_bpp, WK1, SRC - preload_leading_step1 mask_bpp, WK2, MASK - .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 - preload_leading_step1 dst_r_bpp, WK3, DST - .endif - - ands WK0, DST, #15 - beq 154f - rsb WK0, WK0, #16 /* number of leading bytes until destination aligned */ - - preload_leading_step2 src_bpp, src_bpp_shift, WK1, SRC - preload_leading_step2 mask_bpp, mask_bpp_shift, WK2, MASK - .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 - preload_leading_step2 dst_r_bpp, dst_bpp_shift, WK3, DST - .endif - - leading_15bytes process_head, process_tail - -154: /* Destination now 16-byte aligned; we have at least one prefetch on each channel as well as at least one 16-byte output block */ - .if (src_bpp > 0) && (mask_bpp == 0) && ((flags) & FLAG_PROCESS_PRESERVES_SCRATCH) - and SCRATCH, SRC, #31 - rsb SCRATCH, SCRATCH, #32*prefetch_distance - .elseif (src_bpp == 0) && (mask_bpp > 0) && ((flags) & FLAG_PROCESS_PRESERVES_SCRATCH) - and SCRATCH, MASK, #31 - rsb SCRATCH, SCRATCH, #32*prefetch_distance - .endif - .ifc "process_inner_loop","" - switch_on_alignment wide_case_inner_loop_and_trailing_pixels, process_head, process_tail, wide_case_inner_loop, 157f - .else - switch_on_alignment wide_case_inner_loop_and_trailing_pixels, process_head, process_tail, process_inner_loop, 157f - .endif - -157: /* Check for another line */ - end_of_line 1, %((flags) & FLAG_SPILL_LINE_VARS_WIDE), 151b - .if (!SINGLE_SCANLINE) && ((flags) & FLAG_SPILL_LINE_VARS_WIDE) - .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 - .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 - .endif - .endif - - .ltorg - -160: /* Medium case */ - .if !SINGLE_SCANLINE - mov ORIG_W, X - .if (flags) & FLAG_SPILL_LINE_VARS_NON_WIDE - /* This is stmdb sp!,{} */ - .word 0xE92D0000 | LINE_SAVED_REGS - .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 - .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET + LINE_SAVED_REG_COUNT*4 - .endif - .endif -161: /* New line */ - newline - preload_line 0, src_bpp, src_bpp_shift, SRC /* in: X, corrupts: WK0-WK1 */ - preload_line 0, mask_bpp, mask_bpp_shift, MASK - .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 - preload_line 0, dst_r_bpp, dst_bpp_shift, DST - .endif - - sub X, X, #128/dst_w_bpp /* simplifies inner loop termination */ - ands WK0, DST, #15 - beq 164f - rsb WK0, WK0, #16 /* number of leading bytes until destination aligned */ - - leading_15bytes process_head, process_tail - -164: /* Destination now 16-byte aligned; we have at least one 16-byte output block */ - switch_on_alignment medium_case_inner_loop_and_trailing_pixels, process_head, process_tail,, 167f - -167: /* Check for another line */ - end_of_line 1, %((flags) & FLAG_SPILL_LINE_VARS_NON_WIDE), 161b - - .ltorg - -170: /* Narrow case, less than 31 bytes, so no guarantee of at least one 16-byte block */ - .if !SINGLE_SCANLINE - .if dst_w_bpp < 32 - mov ORIG_W, X - .endif - .if (flags) & FLAG_SPILL_LINE_VARS_NON_WIDE - /* This is stmdb sp!,{} */ - .word 0xE92D0000 | LINE_SAVED_REGS - .endif - .endif -171: /* New line */ - newline - preload_line 1, src_bpp, src_bpp_shift, SRC /* in: X, corrupts: WK0-WK1 */ - preload_line 1, mask_bpp, mask_bpp_shift, MASK - .if ((flags) & FLAG_NO_PRELOAD_DST) == 0 - preload_line 1, dst_r_bpp, dst_bpp_shift, DST - .endif - - .if dst_w_bpp == 8 - tst DST, #3 - beq 174f -172: subs X, X, #1 - blo 177f - process_head , 1, 0, 1, 1, 0 - process_tail , 1, 0 - .if !((flags) & FLAG_PROCESS_DOES_STORE) - pixst , 1, 0, DST - .endif - tst DST, #3 - bne 172b - .elseif dst_w_bpp == 16 - tst DST, #2 - beq 174f - subs X, X, #1 - blo 177f - process_head , 2, 0, 1, 1, 0 - process_tail , 2, 0 - .if !((flags) & FLAG_PROCESS_DOES_STORE) - pixst , 2, 0, DST - .endif - .endif - -174: /* Destination now 4-byte aligned; we have 0 or more output bytes to go */ - switch_on_alignment narrow_case_inner_loop_and_trailing_pixels, process_head, process_tail,, 177f - -177: /* Check for another line */ - end_of_line %(dst_w_bpp < 32), %((flags) & FLAG_SPILL_LINE_VARS_NON_WIDE), 171b, last_one - .if (!SINGLE_SCANLINE) && ((flags) & FLAG_SPILL_LINE_VARS_NON_WIDE) - .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 - .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET - LINE_SAVED_REG_COUNT*4 - .endif - -197: - .if (!SINGLE_SCANLINE) && ((flags) & FLAG_SPILL_LINE_VARS) - add sp, sp, #LINE_SAVED_REG_COUNT*4 - .endif -198: - .if (flags) & FLAG_PROCESS_CORRUPTS_WK0 - .set ARGS_STACK_OFFSET, ARGS_STACK_OFFSET-4 - .set LOCALS_STACK_OFFSET, LOCALS_STACK_OFFSET-4 - add sp, sp, #4 - .endif - - cleanup - -#ifdef DEBUG_PARAMS - add sp, sp, #9*4 /* junk the debug copy of arguments */ -#endif -199: - pop {r4-r11, pc} /* exit */ - - .ltorg - - .unreq X - .unreq Y - .unreq DST - .unreq STRIDE_D - .unreq SRC - .unreq STRIDE_S - .unreq MASK - .unreq STRIDE_M - .unreq WK0 - .unreq WK1 - .unreq WK2 - .unreq WK3 - .unreq SCRATCH - .unreq ORIG_W - .endfunc -.endm - -.macro generate_composite_function fname, \ - src_bpp_, \ - mask_bpp_, \ - dst_w_bpp_, \ - flags_, \ - prefetch_distance_, \ - init, \ - newline, \ - cleanup, \ - process_head, \ - process_tail, \ - process_inner_loop - .set SINGLE_SCANLINE, 0 -generate_composite_function_common \ - fname, src_bpp_, mask_bpp_, dst_w_bpp_, flags_, prefetch_distance_, \ - init, newline, cleanup, process_head, process_tail, process_inner_loop -.endm - -.macro generate_composite_function_single_scanline fname, \ - src_bpp_, \ - mask_bpp_, \ - dst_w_bpp_, \ - flags_, \ - prefetch_distance_, \ - init, \ - newline, \ - cleanup, \ - process_head, \ - process_tail, \ - process_inner_loop - .set SINGLE_SCANLINE, 1 -generate_composite_function_common \ - fname, src_bpp_, mask_bpp_, dst_w_bpp_, flags_, prefetch_distance_, \ - init, newline, cleanup, process_head, process_tail, process_inner_loop -.endm - -.macro line_saved_regs x:vararg - .set LINE_SAVED_REGS, 0 - .set LINE_SAVED_REG_COUNT, 0 - .irp SAVED_REG,x - .ifc "SAVED_REG","Y" - .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<1) - .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1 - .endif - .ifc "SAVED_REG","STRIDE_D" - .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<3) - .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1 - .endif - .ifc "SAVED_REG","STRIDE_S" - .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<5) - .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1 - .endif - .ifc "SAVED_REG","STRIDE_M" - .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<7) - .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1 - .endif - .ifc "SAVED_REG","ORIG_W" - .set LINE_SAVED_REGS, LINE_SAVED_REGS | (1<<14) - .set LINE_SAVED_REG_COUNT, LINE_SAVED_REG_COUNT + 1 - .endif - .endr - .if SINGLE_SCANLINE - .set LINE_SAVED_REG_COUNT, 0 - .endif -.endm - -.macro nop_macro x:vararg -.endm From e5bbe32641a48a2cdb7eeb8246381b375543a929 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Wed, 13 Sep 2023 17:35:50 -0500 Subject: [PATCH 202/431] Implement alpha blend as macro and replace inaccurate blitters --- src/video/SDL_blit.h | 27 ++++--- src/video/SDL_blit_A.c | 140 ++++------------------------------ src/video/SDL_blit_A_avx2.c | 4 +- src/video/SDL_blit_A_sse4_1.c | 4 +- 4 files changed, 38 insertions(+), 137 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 90588153adbe7..04525d7ee080c 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -493,21 +493,30 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } \ } +/* Blend a single color channel or alpha value */ +#define ALPHA_BLEND_CHANNEL(sC, dC, sA) \ + do { \ + Uint16 x; \ + x = ((sC - dC) * sA) + ((dC << 8) - dC); \ + x += 0x1U; \ + x += x >> 8; \ + dC = x >> 8; \ + } while (0) /* Blend the RGB values of two pixels with an alpha value */ #define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ do { \ - dR = (Uint8)((((int)(sR - dR) * (int)A) / 255) + dR); \ - dG = (Uint8)((((int)(sG - dG) * (int)A) / 255) + dG); \ - dB = (Uint8)((((int)(sB - dB) * (int)A) / 255) + dB); \ + ALPHA_BLEND_CHANNEL(sR, dR, A); \ + ALPHA_BLEND_CHANNEL(sG, dG, A); \ + ALPHA_BLEND_CHANNEL(sB, dB, A); \ } while (0) /* Blend the RGBA values of two pixels */ -#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ - do { \ - dR = (Uint8)((((int)(sR - dR) * (int)sA) / 255) + dR); \ - dG = (Uint8)((((int)(sG - dG) * (int)sA) / 255) + dG); \ - dB = (Uint8)((((int)(sB - dB) * (int)sA) / 255) + dB); \ - dA = (Uint8)((int)sA + dA - ((int)sA * dA) / 255); \ +#define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ + do { \ + ALPHA_BLEND_CHANNEL(sR, dR, sA); \ + ALPHA_BLEND_CHANNEL(sG, dG, sA); \ + ALPHA_BLEND_CHANNEL(sB, dB, sA); \ + ALPHA_BLEND_CHANNEL(255, dA, sA); \ } while (0) /* This is a very useful loop for optimizing blitters */ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 7f272fd0905cc..3707ca891c964 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -460,22 +460,24 @@ static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) int dstskip = info->dst_skip >> 2; Uint32 s; Uint32 d; - Uint32 s1; - Uint32 d1; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ DUFFS_LOOP4({ 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; + Uint8 sR = (s >> 16) & 0xFF; + Uint8 sG = (s >> 8) & 0xFF; + Uint8 sB = s & 0xFF; + Uint8 dR = (d >> 16) & 0xFF; + Uint8 dG = (d >> 8) & 0xFF; + Uint8 dB = d & 0xFF; + + ALPHA_BLEND_CHANNEL(sR, dR, alpha); + ALPHA_BLEND_CHANNEL(sG, dG, alpha); + ALPHA_BLEND_CHANNEL(sB, dB, alpha); + + *dstp = (dR << 16) | (dG << 8) | dB | 0xFF000000; ++srcp; ++dstp; }, width); @@ -950,97 +952,6 @@ static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) } } -/* fast ARGB8888->RGB565 blending with pixel alpha */ -static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint16 *dstp = (Uint16 *)info->dst; - int dstskip = info->dst_skip >> 1; - - while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - 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); - /* *INDENT-ON* */ /* clang-format on */ - srcp += srcskip; - dstp += dstskip; - } -} - -/* fast ARGB8888->RGB555 blending with pixel alpha */ -static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint16 *dstp = (Uint16 *)info->dst; - int dstskip = info->dst_skip >> 1; - - while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - 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); - /* *INDENT-ON* */ /* clang-format on */ - srcp += srcskip; - dstp += dstskip; - } -} - /* General (slow) N->N blending with per-surface alpha */ static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info) { @@ -1119,15 +1030,6 @@ static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) } } -/* Accurate alpha blending with no division */ -static Uint8 AlphaBlendChannel(Uint8 sC, Uint8 dC, Uint8 sA) -{ - Uint16 x = ((sC - dC) * sA) + ((dC << 8) - dC); - x += 0x1U; // Use 0x80 to round instead of floor - x += x >> 8; - return x >> 8; -} - /* General (slow) N->N blending with pixel alpha */ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) { @@ -1141,7 +1043,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) SDL_PixelFormat *dstfmt = info->dst_fmt; int srcbpp; int dstbpp; - int freeFormat; + SDL_bool freeFormat; Uint32 Pixel; unsigned sR, sG, sB, sA; unsigned dR, dG, dB, dA; @@ -1149,7 +1051,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) /* Set up some basic variables */ srcbpp = srcfmt->bytes_per_pixel; dstbpp = dstfmt->bytes_per_pixel; - freeFormat = 0; + freeFormat = SDL_FALSE; #ifdef SDL_AVX2_INTRINSICS if (srcbpp == 4 && dstbpp == 4 && width >= 4 && SDL_HasAVX2()) { @@ -1167,7 +1069,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) /* Handle case where bad input sent */ if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); - freeFormat = 1; + freeFormat = SDL_TRUE; } while (height--) { @@ -1177,10 +1079,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); if (sA) { DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); - dR = AlphaBlendChannel(sR, dR, sA); - dG = AlphaBlendChannel(sG, dG, sA); - dB = AlphaBlendChannel(sB, dB, sA); - dA = AlphaBlendChannel(255, dA, sA); + ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); } src += srcbpp; @@ -1214,13 +1113,6 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } case 2: - if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { - if (df->Gmask == 0x7e0) { - return BlitARGBto565PixelAlpha; - } else if (df->Gmask == 0x3e0) { - return BlitARGBto555PixelAlpha; - } - } return BlitNtoNPixelAlpha; case 4: diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 8f4b3f3561cf4..04b5851c2de26 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -113,11 +113,11 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) SDL_PixelFormat *dstfmt = info->dst_fmt; int chunks = width / 8; - int free_format = 0; + SDL_bool free_format = SDL_FALSE; /* Handle case when passed invalid format, assume ARGB destination */ if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); - free_format = 1; + free_format = SDL_TRUE; } const __m256i shift_mask = GetSDL_PixelFormatShuffleMask_AVX2(srcfmt, dstfmt); const __m256i splat_mask = GetSDL_PixelFormatAlphaSplatMask_AVX2(dstfmt); diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index e243561d8b6b4..fae70c6cb9f76 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -126,11 +126,11 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { SDL_PixelFormat *dstfmt = info->dst_fmt; const int chunks = width / 4; - int free_format = 0; + SDL_bool free_format = SDL_FALSE; /* Handle case when passed invalid format, assume ARGB destination */ if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); - free_format = 1; + free_format = SDL_TRUE; } const __m128i shift_mask = GetSDL_PixelFormatShuffleMask_SSE4_1(srcfmt, dstfmt); const __m128i splat_mask = GetSDL_PixelFormatAlphaSplatMask_SSE4_1(dstfmt); From 5cec91e27a970233446d3d122f52bf3661ac5281 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 10 Oct 2023 08:09:10 -0500 Subject: [PATCH 203/431] Implement accurate, performant 32-bit scalar blitter for ARGB dst case --- src/video/SDL_blit.h | 30 +++++++++++++++++++++++++++- src/video/SDL_blit_A.c | 44 ++++++++++++++++++++++++++++-------------- 2 files changed, 58 insertions(+), 16 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 04525d7ee080c..1d677cb7be268 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -493,6 +493,13 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } \ } +/* Convert any 32-bit 4-bpp pixel to ARGB format */ +#define PIXEL_TO_ARGB_PIXEL(src, srcfmt, dst) \ + do { \ + Uint8 a, r, g, b; \ + RGBA_FROM_PIXEL(src, srcfmt, r, g, b, a); \ + dst = a << 24 | r << 16 | g << 8 | b; \ + } while (0) /* Blend a single color channel or alpha value */ #define ALPHA_BLEND_CHANNEL(sC, dC, sA) \ do { \ @@ -509,7 +516,28 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); ALPHA_BLEND_CHANNEL(sG, dG, A); \ ALPHA_BLEND_CHANNEL(sB, dB, A); \ } while (0) - +/* Blend the ARGB values of two 32-bit pixels */ +#define ALPHA_BLEND_ARGB_PIXELS(src, dst) \ + do { \ + Uint32 srcA = src >> 24; \ + src |= 0xFF000000; \ + \ + Uint32 srcRB = src & 0x00FF00FF; \ + Uint32 dstRB = dst & 0x00FF00FF; \ + \ + Uint32 srcGA = (src >> 8) & 0x00FF00FF; \ + Uint32 dstGA = (dst >> 8) & 0x00FF00FF; \ + \ + Uint32 resRB = ((srcRB - dstRB) * srcA) + (dstRB << 8) - dstRB; \ + resRB += 0x00010001; \ + resRB += (resRB >> 8) & 0x00FF00FF; \ + resRB = (resRB >> 8) & 0x00FF00FF; \ + Uint32 resGA = ((srcGA - dstGA) * srcA) + (dstGA << 8) - dstGA; \ + resGA += 0x00010001; \ + resGA += (resGA >> 8) & 0x00FF00FF; \ + resGA &= 0xFF00FF00; \ + dst = resRB | resGA; \ + } while (0) /* Blend the RGBA values of two pixels */ #define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 3707ca891c964..7268fa5ad90b3 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1073,22 +1073,36 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) } while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( - { - DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); - if (sA) { - DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); - ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + if (srcbpp == 4 && dstbpp == 4 && dstfmt->Ashift == 24 && dstfmt->Rshift == 16 && dstfmt->Gshift == 8 && + dstfmt->Bshift == 0) { + DUFFS_LOOP4( + { + PIXEL_TO_ARGB_PIXEL(*(Uint32 *) src, srcfmt, Pixel); + Uint32 blended = *(Uint32 *) dst; + ALPHA_BLEND_ARGB_PIXELS(Pixel, blended); + *(Uint32*)dst = blended; + src += srcbpp; + dst += dstbpp; + }, + width); + } else { + /* *INDENT-OFF* */ /* clang-format off */ + DUFFS_LOOP4( + { + DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); + if (sA) { + DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + src += srcbpp; + dst += dstbpp; + }, + width); + /* *INDENT-ON* */ /* clang-format on */ + src += srcskip; + dst += dstskip; } - src += srcbpp; - dst += dstbpp; - }, - width); - /* *INDENT-ON* */ /* clang-format on */ - src += srcskip; - dst += dstskip; } if (freeFormat) { SDL_DestroyPixelFormat(dstfmt); From 8e3afd56f5d93a77de358dc7b59ec3dd72eedd11 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 10 Oct 2023 08:48:14 -0500 Subject: [PATCH 204/431] Restore BlitARGB 555 and 565 blending algorithms --- src/video/SDL_blit_A.c | 98 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 7268fa5ad90b3..ae850a59f562e 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -952,6 +952,97 @@ static void Blit555to555SurfaceAlpha(SDL_BlitInfo *info) } } +/* fast ARGB8888->RGB565 blending with pixel alpha */ +static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *)info->src; + int srcskip = info->src_skip >> 2; + Uint16 *dstp = (Uint16 *)info->dst; + int dstskip = info->dst_skip >> 1; + + while (height--) { + /* *INDENT-OFF* */ /* clang-format off */ + 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); + /* *INDENT-ON* */ /* clang-format on */ + srcp += srcskip; + dstp += dstskip; + } +} + +/* fast ARGB8888->RGB555 blending with pixel alpha */ +static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint32 *srcp = (Uint32 *)info->src; + int srcskip = info->src_skip >> 2; + Uint16 *dstp = (Uint16 *)info->dst; + int dstskip = info->dst_skip >> 1; + + while (height--) { + /* *INDENT-OFF* */ /* clang-format off */ + 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); + /* *INDENT-ON* */ /* clang-format on */ + srcp += srcskip; + dstp += dstskip; + } +} + /* General (slow) N->N blending with per-surface alpha */ static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info) { @@ -1127,6 +1218,13 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } case 2: + if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { + if (df->Gmask == 0x7e0) { + return BlitARGBto565PixelAlpha; + } else if (df->Gmask == 0x3e0) { + return BlitARGBto555PixelAlpha; + } + } return BlitNtoNPixelAlpha; case 4: From 8d099d8976ccb6c6b5e87b02dac376cd39511c8c Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 10 Oct 2023 08:52:17 -0500 Subject: [PATCH 205/431] Fix formatting --- src/video/SDL_blit_A.c | 106 ++++++++++++++++++++--------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index ae850a59f562e..43a1a09abb05a 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -965,32 +965,32 @@ static void BlitARGBto565PixelAlpha(SDL_BlitInfo *info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ 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); + 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); /* *INDENT-ON* */ /* clang-format on */ srcp += srcskip; dstp += dstskip; @@ -1010,33 +1010,33 @@ static void BlitARGBto555PixelAlpha(SDL_BlitInfo *info) while (height--) { /* *INDENT-OFF* */ /* clang-format off */ 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); + 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); /* *INDENT-ON* */ /* clang-format on */ srcp += srcskip; dstp += dstskip; From 23d4e9ec13fadc83a72ee30728975431a782639f Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Tue, 10 Oct 2023 17:58:53 -0500 Subject: [PATCH 206/431] Support VisualC-WinRT UWP build --- VisualC-WinRT/SDL-UWP.vcxproj | 6 +++++- VisualC-WinRT/SDL-UWP.vcxproj.filters | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index 072c133d3136c..8e11e9ba3f17c 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -178,6 +178,8 @@ + + @@ -547,6 +549,8 @@ + + @@ -917,4 +921,4 @@ - + \ No newline at end of file diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index 4e573d6f2809e..21d0415627aef 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -426,9 +426,6 @@ Source Files - - video - Source Files @@ -533,7 +530,7 @@ Source Files - + Source Files @@ -954,6 +951,13 @@ Header Files + + + Source Files + + + Source Files + @@ -974,5 +978,11 @@ Source Files + + Source Files + + + Source Files + - + \ No newline at end of file From b34faf732d3a1d2340886a5ae26be343e514ebc0 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Sun, 17 Dec 2023 07:55:49 -0600 Subject: [PATCH 207/431] Implement fast 255 mult-div in SDL_blit_auto --- src/video/SDL_blit.h | 7 + src/video/SDL_blit_A.c | 6 +- src/video/SDL_blit_auto.c | 2681 ++++++++++++++++++++++--------------- src/video/SDL_blit_auto.h | 1 + src/video/sdlgenblit.pl | 51 +- 5 files changed, 1663 insertions(+), 1083 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 1d677cb7be268..a59c9a603c3e5 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -509,6 +509,13 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); x += x >> 8; \ dC = x >> 8; \ } while (0) +/* Perform a division by 255 after a multiplication of two 8-bit color channels */ +#define MULT_DIV_255(sC, dC, out) \ + do { \ + Uint16 x = sC * dC; \ + x += x >> 8; \ + out = x >> 8; \ + } while (0) /* Blend the RGB values of two pixels with an alpha value */ #define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ do { \ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 43a1a09abb05a..b512056da58b1 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1164,7 +1164,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) } while (height--) { - if (srcbpp == 4 && dstbpp == 4 && dstfmt->Ashift == 24 && dstfmt->Rshift == 16 && dstfmt->Gshift == 8 && + /* if (srcbpp == 4 && dstbpp == 4 && dstfmt->Ashift == 24 && dstfmt->Rshift == 16 && dstfmt->Gshift == 8 && dstfmt->Bshift == 0) { DUFFS_LOOP4( { @@ -1176,7 +1176,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) dst += dstbpp; }, width); - } else { + } else { */ /* *INDENT-OFF* */ /* clang-format off */ DUFFS_LOOP4( { @@ -1193,7 +1193,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) /* *INDENT-ON* */ /* clang-format on */ src += srcskip; dst += dstskip; - } + // } } if (freeFormat) { SDL_DestroyPixelFormat(dstfmt); diff --git a/src/video/SDL_blit_auto.c b/src/video/SDL_blit_auto.c index 0d9f1a8d90f86..e3c50e0efe2ba 100644 --- a/src/video/SDL_blit_auto.c +++ b/src/video/SDL_blit_auto.c @@ -20,6 +20,7 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_internal.h" +#include "SDL_blit.h" #if SDL_HAVE_BLIT_AUTO @@ -86,14 +87,14 @@ static void SDL_Blit_XRGB8888_XRGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -147,14 +148,14 @@ static void SDL_Blit_XRGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -184,9 +185,9 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -227,9 +228,9 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -264,23 +265,26 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -288,14 +292,20 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -343,23 +353,26 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -367,14 +380,20 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -450,14 +469,14 @@ static void SDL_Blit_XRGB8888_XBGR8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -511,14 +530,14 @@ static void SDL_Blit_XRGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -548,9 +567,9 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -591,9 +610,9 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -628,23 +647,26 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -652,14 +674,20 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -707,23 +735,26 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -731,14 +762,20 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -814,14 +851,14 @@ static void SDL_Blit_XRGB8888_ARGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -876,14 +913,14 @@ static void SDL_Blit_XRGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -915,9 +952,9 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -960,9 +997,9 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -997,24 +1034,28 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -1022,14 +1063,20 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1077,24 +1124,28 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -1102,14 +1153,20 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1185,14 +1242,14 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -1246,14 +1303,14 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -1283,9 +1340,9 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -1326,9 +1383,9 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -1363,23 +1420,26 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -1387,14 +1447,20 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -1442,23 +1508,26 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -1466,14 +1535,20 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -1544,14 +1619,14 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -1605,14 +1680,14 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -1642,9 +1717,9 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -1685,9 +1760,9 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -1722,23 +1797,26 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -1746,14 +1824,20 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -1801,23 +1885,26 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -1825,14 +1912,20 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -1910,14 +2003,14 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1972,14 +2065,14 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -2011,9 +2104,9 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -2056,9 +2149,9 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -2093,24 +2186,28 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2118,14 +2215,20 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -2173,24 +2276,28 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2198,14 +2305,20 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -2270,16 +2383,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2287,14 +2403,20 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2339,16 +2461,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2356,14 +2481,20 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2393,9 +2524,9 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -2436,9 +2567,9 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -2472,26 +2603,29 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2499,14 +2633,20 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2553,26 +2693,29 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2580,14 +2723,20 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2654,16 +2803,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2671,14 +2823,20 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -2723,16 +2881,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2740,14 +2901,20 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -2777,9 +2944,9 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -2820,9 +2987,9 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -2856,26 +3023,29 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2883,14 +3053,20 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -2937,26 +3113,29 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -2964,14 +3143,20 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -3033,17 +3218,21 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3051,14 +3240,20 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3103,17 +3298,21 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3121,14 +3320,20 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3159,12 +3364,12 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -3206,12 +3411,12 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -3245,27 +3450,31 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3273,14 +3482,20 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3327,27 +3542,31 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3355,14 +3574,20 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3427,16 +3652,19 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3444,14 +3672,20 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -3496,16 +3730,19 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3513,14 +3750,20 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -3550,9 +3793,9 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -3593,9 +3836,9 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -3629,26 +3872,29 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3656,14 +3902,20 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -3710,26 +3962,29 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3737,14 +3992,20 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -3811,16 +4072,19 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3828,14 +4092,20 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -3880,16 +4150,19 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -3897,14 +4170,20 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -3934,9 +4213,9 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -3977,9 +4256,9 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -4013,26 +4292,29 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4040,14 +4322,20 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -4094,26 +4382,29 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4121,14 +4412,20 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -4193,17 +4490,21 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4211,14 +4512,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4263,17 +4570,21 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4281,14 +4592,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4319,12 +4636,12 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -4366,12 +4683,12 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -4405,27 +4722,31 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4433,14 +4754,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4487,27 +4814,31 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4515,14 +4846,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -4589,16 +4926,19 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4606,14 +4946,20 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -4658,16 +5004,19 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4675,14 +5024,20 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -4712,9 +5067,9 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -4755,9 +5110,9 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -4791,26 +5146,29 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4818,14 +5176,20 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -4872,26 +5236,29 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4899,14 +5266,20 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -4971,16 +5344,19 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -4988,14 +5364,20 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -5040,16 +5422,19 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5057,14 +5442,20 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -5094,9 +5485,9 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -5137,9 +5528,9 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -5173,26 +5564,29 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5200,14 +5594,20 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -5254,26 +5654,29 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5281,14 +5684,20 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -5355,17 +5764,21 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5373,14 +5786,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5425,17 +5844,21 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5443,14 +5866,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5481,12 +5910,12 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -5528,12 +5957,12 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -5567,27 +5996,31 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5595,14 +6028,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5649,27 +6088,31 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5677,14 +6120,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -5751,16 +6200,19 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5768,14 +6220,20 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -5820,16 +6278,19 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5837,14 +6298,20 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -5874,9 +6341,9 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -5917,9 +6384,9 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (R << 16) | (G << 8) | B; *dst = pixel; @@ -5953,26 +6420,29 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -5980,14 +6450,20 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -6034,26 +6510,29 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6061,14 +6540,20 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -6133,16 +6618,19 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6150,14 +6638,20 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -6202,16 +6696,19 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6219,14 +6716,20 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -6256,9 +6759,9 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -6299,9 +6802,9 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } pixel = (B << 16) | (G << 8) | R; *dst = pixel; @@ -6335,26 +6838,29 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6362,14 +6868,20 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -6416,26 +6928,29 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6443,14 +6958,20 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -6517,17 +7038,21 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6535,14 +7060,20 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -6587,17 +7118,21 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6605,14 +7140,20 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -6643,12 +7184,12 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -6690,12 +7231,12 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) pixel = *src; B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { - R = (R * modulateR) / 255; - G = (G * modulateG) / 255; - B = (B * modulateB) / 255; + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); } if (flags & SDL_COPY_MODULATE_ALPHA) { - A = (A * modulateA) / 255; + MULT_DIV_255(A, modulateA, A); } pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; @@ -6729,27 +7270,31 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6757,14 +7302,20 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -6811,27 +7362,31 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { - srcR = (srcR * modulateR) / 255; - srcG = (srcG * modulateG) / 255; - srcB = (srcB * modulateB) / 255; + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); } if (flags & SDL_COPY_MODULATE_ALPHA) { - srcA = (srcA * modulateA) / 255; + MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { - srcR = (srcR * srcA) / 255; - srcG = (srcG * srcA) / 255; - srcB = (srcB * srcA) / 255; + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); } } switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR + ((255 - srcA) * dstR) / 255; - dstG = srcG + ((255 - srcA) * dstG) / 255; - dstB = srcB + ((255 - srcA) * dstB) / 255; - dstA = srcA + ((255 - srcA) * dstA) / 255; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; break; case SDL_COPY_ADD: dstR = srcR + dstR; if (dstR > 255) dstR = 255; @@ -6839,14 +7394,20 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstB = srcB + dstB; if (dstB > 255) dstB = 255; break; case SDL_COPY_MOD: - dstR = (srcR * dstR) / 255; - dstG = (srcG * dstG) / 255; - dstB = (srcB * dstB) / 255; + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - dstR = ((srcR * dstR) + (dstR * (255 - srcA))) / 255; if (dstR > 255) dstR = 255; - dstG = ((srcG * dstG) + (dstG * (255 - srcA))) / 255; if (dstG > 255) dstG = 255; - dstB = ((srcB * dstB) + (dstB * (255 - srcA))) / 255; if (dstB > 255) dstB = 255; + MULT_DIV_255(dstR, (255 - srcA), dstR); + dstR += (srcR * dstR); + if (dstR > 255) dstR = 255; + MULT_DIV_255(dstB, (255 - srcA), dstB); + dstB += (srcB * dstB); + if (dstB > 255) dstB = 255; + MULT_DIV_255(dstG, (255 - srcA), dstG); + dstG += (srcG * dstG); + if (dstG > 255) dstG = 255; break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; diff --git a/src/video/SDL_blit_auto.h b/src/video/SDL_blit_auto.h index 156145046d9f0..6ffb28c93d354 100644 --- a/src/video/SDL_blit_auto.h +++ b/src/video/SDL_blit_auto.h @@ -20,6 +20,7 @@ 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_internal.h" +#include "SDL_blit.h" #if SDL_HAVE_BLIT_AUTO diff --git a/src/video/sdlgenblit.pl b/src/video/sdlgenblit.pl index 00eede2c05159..001ec2fedd47a 100755 --- a/src/video/sdlgenblit.pl +++ b/src/video/sdlgenblit.pl @@ -111,6 +111,7 @@ sub open_file { 3. This notice may not be removed or altered from any source distribution. */ #include "SDL_internal.h" +#include "SDL_blit.h" #if SDL_HAVE_BLIT_AUTO @@ -309,15 +310,15 @@ sub output_copycore if ( $modulate ) { print FILE <<__EOF__; if (flags & SDL_COPY_MODULATE_COLOR) { - ${s}R = (${s}R * modulateR) / 255; - ${s}G = (${s}G * modulateG) / 255; - ${s}B = (${s}B * modulateB) / 255; + MULT_DIV_255(${s}R, modulateR, ${s}R); + MULT_DIV_255(${s}G, modulateG, ${s}G); + MULT_DIV_255(${s}B, modulateB, ${s}B); } __EOF__ if (!$ignore_dst_alpha && !$is_modulateA_done) { print FILE <<__EOF__; if (flags & SDL_COPY_MODULATE_ALPHA) { - ${s}A = (${s}A * modulateA) / 255; + MULT_DIV_255(${s}A, modulateA, ${s}A); } __EOF__ } @@ -328,9 +329,9 @@ sub output_copycore if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { /* This goes away if we ever use premultiplied alpha */ if (${s}A < 255) { - ${s}R = (${s}R * ${s}A) / 255; - ${s}G = (${s}G * ${s}A) / 255; - ${s}B = (${s}B * ${s}A) / 255; + MULT_DIV_255(${s}R, ${s}A, ${s}R); + MULT_DIV_255(${s}G, ${s}A, ${s}G); + MULT_DIV_255(${s}B, ${s}A, ${s}B); } } __EOF__ @@ -347,9 +348,12 @@ sub output_copycore __EOF__ } else { print FILE <<__EOF__; - ${d}R = ${s}R + ((255 - ${s}A) * ${d}R) / 255; - ${d}G = ${s}G + ((255 - ${s}A) * ${d}G) / 255; - ${d}B = ${s}B + ((255 - ${s}A) * ${d}B) / 255; + MULT_DIV_255((255 - ${s}A), ${d}R, ${d}R); + ${d}R += ${s}R; + MULT_DIV_255((255 - ${s}A), ${d}G, ${d}G); + ${d}G += ${s}G; + MULT_DIV_255((255 - ${s}A), ${d}B, ${d}B); + ${d}B += ${s}B; __EOF__ } if ( $dst_has_alpha ) { @@ -359,7 +363,8 @@ sub output_copycore __EOF__ } else { print FILE <<__EOF__; - ${d}A = ${s}A + ((255 - ${s}A) * ${d}A) / 255; + MULT_DIV_255((255 - ${s}A), ${d}A, ${d}A); + ${d}A += ${s}A; __EOF__ } } @@ -372,23 +377,29 @@ sub output_copycore ${d}B = ${s}B + ${d}B; if (${d}B > 255) ${d}B = 255; break; case SDL_COPY_MOD: - ${d}R = (${s}R * ${d}R) / 255; - ${d}G = (${s}G * ${d}G) / 255; - ${d}B = (${s}B * ${d}B) / 255; + MULT_DIV_255(${s}R, ${d}R, ${d}R); + MULT_DIV_255(${s}G, ${d}G, ${d}G); + MULT_DIV_255(${s}B, ${d}B, ${d}B); break; case SDL_COPY_MUL: __EOF__ if ($A_is_const_FF) { print FILE <<__EOF__; - ${d}R = (${s}R * ${d}R) / 255; - ${d}G = (${s}G * ${d}G) / 255; - ${d}B = (${s}B * ${d}B) / 255; + MULT_DIV_255(${s}R, ${d}R, ${d}R); + MULT_DIV_255(${s}G, ${d}G, ${d}G); + MULT_DIV_255(${s}B, ${d}B, ${d}B); __EOF__ } else { print FILE <<__EOF__; - ${d}R = ((${s}R * ${d}R) + (${d}R * (255 - ${s}A))) / 255; if (${d}R > 255) ${d}R = 255; - ${d}G = ((${s}G * ${d}G) + (${d}G * (255 - ${s}A))) / 255; if (${d}G > 255) ${d}G = 255; - ${d}B = ((${s}B * ${d}B) + (${d}B * (255 - ${s}A))) / 255; if (${d}B > 255) ${d}B = 255; + MULT_DIV_255(${d}R, (255 - ${s}A), ${d}R); + ${d}R += (${s}R * ${d}R); + if (${d}R > 255) ${d}R = 255; + MULT_DIV_255(${d}B, (255 - ${s}A), ${d}B); + ${d}B += (${s}B * ${d}B); + if (${d}B > 255) ${d}B = 255; + MULT_DIV_255(${d}G, (255 - ${s}A), ${d}G); + ${d}G += (${s}G * ${d}G); + if (${d}G > 255) ${d}G = 255; __EOF__ } From 44d397282db1cee2a184556c8066665b79b42ca0 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Sat, 8 Jun 2024 22:24:13 -0500 Subject: [PATCH 208/431] Re-enable intrinsic blitters --- src/video/SDL_blit_A.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index b512056da58b1..4a36e5ecd04dd 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1152,6 +1152,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) #endif #ifdef SDL_SSE4_1_INTRINSICS + // TODO: Re-enable if (srcbpp == 4 && dstbpp == 4 && width >= 2 && SDL_HasSSE41()) { BlitNtoNPixelAlpha_SSE4_1(info); return; From b7b513b70b516c922371d90d51b7c30cb6f7a245 Mon Sep 17 00:00:00 2001 From: Isaac Aronson Date: Sat, 8 Jun 2024 22:32:59 -0500 Subject: [PATCH 209/431] Fix bytes_per_pixel rename --- src/video/SDL_blit_A.c | 4 ++-- src/video/SDL_fillrect.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 4a36e5ecd04dd..3b97440ac19d8 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1219,7 +1219,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } case 2: - if (sf->BytesPerPixel == 4 && sf->Amask == 0xff000000 && sf->Gmask == 0xff00 && ((sf->Rmask == 0xff && df->Rmask == 0x1f) || (sf->Bmask == 0xff && df->Bmask == 0x1f))) { + if (sf->bytes_per_pixel == 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) { @@ -1230,7 +1230,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) case 4: #if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) - if (sf->BytesPerPixel == 4 && df->BytesPerPixel == 4 && (SDL_HasSSE41() || SDL_HasAVX2())) { + if (sf->bytes_per_pixel == 4 && df->bytes_per_pixel == 4 && (SDL_HasSSE41() || SDL_HasAVX2())) { return BlitNtoNPixelAlpha; } #endif diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index 04aa925fbeaf7..f47572032405d 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -292,7 +292,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, } if (fill_function == NULL) { - switch (dst->format->BytesPerPixel) { + switch (dst->format->bytes_per_pixel) { case 1: { color |= (color << 8); From 5d875aa94e2e19a138079156218b3d46c015f6d7 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:36:50 +0100 Subject: [PATCH 210/431] Fix rounding in MULT_DIV_255 --- src/video/SDL_blit.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index a59c9a603c3e5..b994f9e9bd592 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -513,6 +513,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); #define MULT_DIV_255(sC, dC, out) \ do { \ Uint16 x = sC * dC; \ + x += 0x1U; \ x += x >> 8; \ out = x >> 8; \ } while (0) From 070e48f66edebdde0606e97c5022bb8d4b8aa57b Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:36:50 +0100 Subject: [PATCH 211/431] Tidy up/optimize BlitNtoNPixelAlpha_AVX2 --- src/video/SDL_blit.h | 10 ++- src/video/SDL_blit_A.c | 2 +- src/video/SDL_blit_A_avx2.c | 171 ++++++++++-------------------------- 3 files changed, 53 insertions(+), 130 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index b994f9e9bd592..387db2f2cae5a 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -501,6 +501,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); dst = a << 24 | r << 16 | g << 8 | b; \ } while (0) /* Blend a single color channel or alpha value */ +/* dC = ((sC * sA) + (dC * (255 - sA))) / 255 */ #define ALPHA_BLEND_CHANNEL(sC, dC, sA) \ do { \ Uint16 x; \ @@ -510,6 +511,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); dC = x >> 8; \ } while (0) /* Perform a division by 255 after a multiplication of two 8-bit color channels */ +/* out = (sC * dC) / 255 */ #define MULT_DIV_255(sC, dC, out) \ do { \ Uint16 x = sC * dC; \ @@ -524,11 +526,11 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); ALPHA_BLEND_CHANNEL(sG, dG, A); \ ALPHA_BLEND_CHANNEL(sB, dB, A); \ } while (0) -/* Blend the ARGB values of two 32-bit pixels */ -#define ALPHA_BLEND_ARGB_PIXELS(src, dst) \ +/* Blend two 32-bit pixels with the same format */ +#define ALPHA_BLEND_RGBA_4(src, dst, ashift) \ do { \ - Uint32 srcA = src >> 24; \ - src |= 0xFF000000; \ + Uint32 srcA = (src >> ashift) & 0xFF; \ + src |= ((Uint32)0xFF) << ashift; \ \ Uint32 srcRB = src & 0x00FF00FF; \ Uint32 dstRB = dst & 0x00FF00FF; \ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 3b97440ac19d8..4dd67e341b54d 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -1171,7 +1171,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) { PIXEL_TO_ARGB_PIXEL(*(Uint32 *) src, srcfmt, Pixel); Uint32 blended = *(Uint32 *) dst; - ALPHA_BLEND_ARGB_PIXELS(Pixel, blended); + ALPHA_BLEND_RGBA_4(Pixel, blended); *(Uint32*)dst = blended; src += srcbpp; dst += dstbpp; diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 04b5851c2de26..d6828e2beef65 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -7,63 +7,14 @@ #define SDL_blit_A_avx2_c #include "SDL_blit.h" -#include "SDL_blit_A_sse4_1.h" - -__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaSplatMask_AVX2(const SDL_PixelFormat* dstfmt) { - Uint8 index = dstfmt->Ashift / 8; - return _mm256_set_epi8( - index + 28, index + 28, index + 28, index + 28, index + 24, index + 24, index + 24, index + 24, - index + 20, index + 20, index + 20, index + 20, index + 16, index + 16, index + 16, index + 16, - index + 12, index + 12, index + 12, index + 12, index + 8, index + 8, index + 8, index + 8, - index + 4, index + 4, index + 4, index + 4, index, index, index, index); -} - -__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatAlphaSaturateMask_AVX2(const SDL_PixelFormat* dstfmt) { - const Uint8 bin = dstfmt->Ashift / 8; - return _mm256_set_epi8( - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0); -} - -__m256i SDL_TARGETING("avx2") GetSDL_PixelFormatShuffleMask_AVX2(const SDL_PixelFormat* srcfmt, - const SDL_PixelFormat* dstfmt) { - /* Calculate shuffle indices based on the source and destination SDL_PixelFormat */ - Uint8 shuffleIndices[32]; - Uint8 dstAshift = dstfmt->Ashift / 8; - Uint8 dstRshift = dstfmt->Rshift / 8; - Uint8 dstGshift = dstfmt->Gshift / 8; - Uint8 dstBshift = dstfmt->Bshift / 8; - for (int i = 0; i < 8; ++i) { - shuffleIndices[dstAshift + i * 4] = srcfmt->Ashift / 8 + i * 4; - shuffleIndices[dstRshift + i * 4] = srcfmt->Rshift / 8 + i * 4; - shuffleIndices[dstGshift + i * 4] = srcfmt->Gshift / 8 + i * 4; - shuffleIndices[dstBshift + i * 4] = srcfmt->Bshift / 8 + i * 4; - } - - /* Create shuffle mask based on the calculated indices */ - return _mm256_set_epi8( - shuffleIndices[31], shuffleIndices[30], shuffleIndices[29], shuffleIndices[28], - shuffleIndices[27], shuffleIndices[26], shuffleIndices[25], shuffleIndices[24], - shuffleIndices[23], shuffleIndices[22], shuffleIndices[21], shuffleIndices[20], - shuffleIndices[19], shuffleIndices[18], shuffleIndices[17], shuffleIndices[16], - shuffleIndices[15], shuffleIndices[14], shuffleIndices[13], shuffleIndices[12], - shuffleIndices[11], shuffleIndices[10], shuffleIndices[9], shuffleIndices[8], - shuffleIndices[7], shuffleIndices[6], shuffleIndices[5], shuffleIndices[4], - shuffleIndices[3], shuffleIndices[2], shuffleIndices[1], shuffleIndices[0] - ); -} /** * Using the AVX2 instruction set, blit sixteen pixels into eight with alpha blending */ -__m256i SDL_TARGETING("avx2") MixRGBA_AVX2(__m256i src, __m256i dst, const __m256i alpha_shuffle, - const __m256i alpha_saturate) { +SDL_FORCE_INLINE __m256i SDL_TARGETING("avx2") MixRGBA_AVX2( + __m256i src, __m256i dst, + const __m256i alpha_shuffle, const __m256i alpha_saturate) +{ // SIMD implementation of blend_mul2. // dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) // dstA = srcA + (dstA * (1-srcA)) = (1 * srcA) + (dstA * (1-srcA)) @@ -112,87 +63,57 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; - int chunks = width / 8; - SDL_bool free_format = SDL_FALSE; - /* Handle case when passed invalid format, assume ARGB destination */ - if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { - dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); - free_format = SDL_TRUE; - } - const __m256i shift_mask = GetSDL_PixelFormatShuffleMask_AVX2(srcfmt, dstfmt); - const __m256i splat_mask = GetSDL_PixelFormatAlphaSplatMask_AVX2(dstfmt); - const __m256i saturate_mask = GetSDL_PixelFormatAlphaSaturateMask_AVX2(dstfmt); - const __m128i sse4_1_shift_mask = GetSDL_PixelFormatShuffleMask_SSE4_1(srcfmt, dstfmt); - const __m128i sse4_1_splat_mask = GetSDL_PixelFormatAlphaSplatMask_SSE4_1(dstfmt); - const __m128i sse4_1_saturate_mask = GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(dstfmt); + const __m256i mask_offsets = _mm256_set_epi8( + 28, 28, 28, 28, 24, 24, 24, 24, 20, 20, 20, 20, 16, 16, 16, 16, 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); + + const __m256i shift_mask = _mm256_add_epi32( + _mm256_set1_epi32( + ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | + ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | + ((srcfmt->Bshift >> 3) << dstfmt->Bshift) | + ((srcfmt->Ashift >> 3) << dstfmt->Ashift)), + mask_offsets); + + const __m256i splat_mask = _mm256_add_epi8(_mm256_set1_epi8(dstfmt->Ashift >> 3), mask_offsets); + const __m256i saturate_mask = _mm256_set1_epi32((int)dstfmt->Amask); while (height--) { - /* Process 8-wide chunks of source color data that may be in wrong format */ - for (int i = 0; i < chunks; i += 1) { - __m256i c_src = _mm256_shuffle_epi8(_mm256_loadu_si256((__m256i *) (src + i * 32)), shift_mask); - /* Alpha-blend in 8-wide chunk from src into destination */ - __m256i c_dst = _mm256_loadu_si256((__m256i*) (dst + i * 32)); - __m256i c_mix = MixRGBA_AVX2(c_src, c_dst, splat_mask, saturate_mask); - _mm256_storeu_si256((__m256i*) (dst + i * 32), c_mix); - } + int i = 0; + + for (; i + 8 <= width; i += 8) { + // Load 8 src pixels and shuffle into the dst format + __m256i c_src = _mm256_shuffle_epi8(_mm256_loadu_si256((__m256i *)src), shift_mask); + + // Load 8 dst pixels + __m256i c_dst = _mm256_loadu_si256((__m256i *)dst); - /* Handle remaining pixels when width is not a multiple of 4 */ - if (width % 8 != 0) { - int remaining_pixels = width % 8; - int offset = width - remaining_pixels; - if (remaining_pixels >= 4) { - Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); - Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - __m128i c_src = _mm_loadu_si128((__m128i*)src_ptr); - c_src = _mm_shuffle_epi8(c_src, sse4_1_shift_mask); - __m128i c_dst = _mm_loadu_si128((__m128i*)dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1_splat_mask, sse4_1_saturate_mask); - _mm_storeu_si128((__m128i*)dst_ptr, c_mix); - remaining_pixels -= 4; - offset += 4; - } - if (remaining_pixels >= 2) { - Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); - Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_shuffle_epi8(c_src, sse4_1_shift_mask); - __m128i c_dst = _mm_loadu_si64(dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, sse4_1_splat_mask, sse4_1_saturate_mask); - _mm_storeu_si64(dst_ptr, c_mix); - remaining_pixels -= 2; - offset += 2; - } - if (remaining_pixels == 1) { - Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); - Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt, dstfmt); - /* Old GCC has bad or no _mm_loadu_si32 */ - #if defined(__GNUC__) && (__GNUC__ < 11) - __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); - __m128i c_dst = _mm_set_epi32(0, 0, 0, *dst_ptr); - #else - __m128i c_src = _mm_loadu_si32(&pixel); - __m128i c_dst = _mm_loadu_si32(dst_ptr); - #endif - __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, sse4_1_splat_mask, sse4_1_saturate_mask); - /* Old GCC has bad or no _mm_storeu_si32 */ - #if defined(__GNUC__) && (__GNUC__ < 11) - *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); - #else - _mm_storeu_si32(dst_ptr, mixed_pixel); - #endif - } + // Blend the pixels together and save the result + _mm256_storeu_si256((__m256i *)dst, MixRGBA_AVX2(c_src, c_dst, splat_mask, saturate_mask)); + + src += 32; + dst += 32; } - src += 4 * width; - dst += 4 * width; + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; + + src32 = (((src32 >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | + (((src32 >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | + (((src32 >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | + (((src32 >> srcfmt->Ashift) & 0xFF) << dstfmt->Ashift); + + ALPHA_BLEND_RGBA_4(src32, dst32, dstfmt->Ashift); + + *(Uint32 *)dst = dst32; + + src += 4; + dst += 4; + } src += srcskip; dst += dstskip; } - if (free_format) { - SDL_DestroyPixelFormat(dstfmt); - } } #endif From 95b683ac3e5f355442d8365bba58c82bfc5bd574 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:43:01 +0100 Subject: [PATCH 212/431] Tidy up/optimize BlitNtoNPixelAlpha_SSE4_1 --- src/video/SDL_blit_A_avx2.c | 6 +- src/video/SDL_blit_A_sse4_1.c | 183 ++++++++++------------------------ src/video/SDL_blit_A_sse4_1.h | 47 --------- 3 files changed, 52 insertions(+), 184 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index d6828e2beef65..96e1714da0c08 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -4,13 +4,9 @@ #ifdef SDL_AVX2_INTRINSICS -#define SDL_blit_A_avx2_c - #include "SDL_blit.h" -/** - * Using the AVX2 instruction set, blit sixteen pixels into eight with alpha blending - */ +// Using the AVX2 instruction set, blit sixteen pixels into eight with alpha blending SDL_FORCE_INLINE __m256i SDL_TARGETING("avx2") MixRGBA_AVX2( __m256i src, __m256i dst, const __m256i alpha_shuffle, const __m256i alpha_saturate) diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index fae70c6cb9f76..3e6881943196e 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -4,73 +4,19 @@ #ifdef SDL_SSE4_1_INTRINSICS -#define SDL_blit_A_sse4_1_c - #include "SDL_blit.h" -#include "SDL_blit_A_sse4_1.h" - -/** - * A helper function to create an alpha splat mask for use with MixRGBA_SSE4_1 based on pixel format - */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSplatMask_SSE4_1(const SDL_PixelFormat* dstfmt) { - const Uint8 index = dstfmt->Ashift / 8; - return _mm_set_epi8( - index + 12, index + 12, index + 12, index + 12, - index + 8, index + 8, index + 8, index + 8, - index + 4, index + 4, index + 4, index + 4, - index, index, index, index); -} - -/** - * A helper function to create an alpha saturate mask for use with MixRGBA_SSE4_1 based on pixel format - */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(const SDL_PixelFormat* dstfmt) { - const Uint8 bin = dstfmt->Ashift / 8; - return _mm_set_epi8( - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0, - bin == 3 ? 0xFF : 0, bin == 2 ? 0xFF : 0, bin == 1 ? 0xFF : 0, bin == 0 ? 0xFF : 0); -} -/** - * This helper function converts arbitrary pixel formats into a shuffle mask for _mm_shuffle_epi8 - */ -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask_SSE4_1(const SDL_PixelFormat* srcfmt, - const SDL_PixelFormat* dstfmt) { - /* Calculate shuffle indices based on the source and destination SDL_PixelFormat */ - Uint8 shuffleIndices[16]; - Uint8 dstAshift = dstfmt->Ashift / 8; - Uint8 dstRshift = dstfmt->Rshift / 8; - Uint8 dstGshift = dstfmt->Gshift / 8; - Uint8 dstBshift = dstfmt->Bshift / 8; - for (int i = 0; i < 4; ++i) { - shuffleIndices[dstAshift + i * 4] = srcfmt->Ashift / 8 + i * 4; - shuffleIndices[dstRshift + i * 4] = srcfmt->Rshift / 8 + i * 4; - shuffleIndices[dstGshift + i * 4] = srcfmt->Gshift / 8 + i * 4; - shuffleIndices[dstBshift + i * 4] = srcfmt->Bshift / 8 + i * 4; - } - - /* Create shuffle mask based on the calculated indices */ - return _mm_set_epi8( - shuffleIndices[15], shuffleIndices[14], shuffleIndices[13], shuffleIndices[12], - shuffleIndices[11], shuffleIndices[10], shuffleIndices[9], shuffleIndices[8], - shuffleIndices[7], shuffleIndices[6], shuffleIndices[5], shuffleIndices[4], - shuffleIndices[3], shuffleIndices[2], shuffleIndices[1], shuffleIndices[0] - ); -} - -/** - * Using the SSE4.1 instruction set, blit eight pixels into four with alpha blending - */ -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, - const __m128i alpha_splat, const __m128i alpha_saturate) { +// Using the SSE4.1 instruction set, blit eight pixels into four with alpha blending +SDL_FORCE_INLINE __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1( + __m128i src, __m128i dst, + const __m128i alpha_shuffle, const __m128i alpha_saturate) +{ // SIMD implementation of blend_mul2. // dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) // dstA = srcA + (dstA * (1-srcA)) = (1 * srcA) + (dstA * (1-srcA)) // Splat the alpha into all channels for each pixel - __m128i srca = _mm_shuffle_epi8(src, alpha_splat); + __m128i srca = _mm_shuffle_epi8(src, alpha_shuffle); // Set the alpha channels of src to 255 src = _mm_or_si128(src, alpha_saturate); @@ -94,7 +40,7 @@ __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); - // dst += dst >> 8; + // dst += dst >> 8 dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); @@ -102,20 +48,8 @@ __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, return dst; } -Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt) { - Uint8 a = (color >> srcfmt->Ashift) & 0xFF; - Uint8 r = (color >> srcfmt->Rshift) & 0xFF; - Uint8 g = (color >> srcfmt->Gshift) & 0xFF; - Uint8 b = (color >> srcfmt->Bshift) & 0xFF; - - return (a << dstfmt->Ashift) | - (r << dstfmt->Rshift) | - (g << dstfmt->Gshift) | - (b << dstfmt->Bshift); -} - - -void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { +void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info) +{ int width = info->dst_w; int height = info->dst_h; Uint8 *src = info->src; @@ -125,72 +59,57 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo* info) { SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; - const int chunks = width / 4; - SDL_bool free_format = SDL_FALSE; - /* Handle case when passed invalid format, assume ARGB destination */ - if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { - dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); - free_format = SDL_TRUE; - } - const __m128i shift_mask = GetSDL_PixelFormatShuffleMask_SSE4_1(srcfmt, dstfmt); - const __m128i splat_mask = GetSDL_PixelFormatAlphaSplatMask_SSE4_1(dstfmt); - const __m128i saturate_mask = GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(dstfmt); + const __m128i mask_offsets = _mm_set_epi8( + 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); + + const __m128i shift_mask = _mm_add_epi32( + _mm_set1_epi32( + ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | + ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | + ((srcfmt->Bshift >> 3) << dstfmt->Bshift) | + ((srcfmt->Ashift >> 3) << dstfmt->Ashift)), + mask_offsets); + + const __m128i splat_mask = _mm_add_epi8(_mm_set1_epi8(dstfmt->Ashift >> 3), mask_offsets); + const __m128i saturate_mask = _mm_set1_epi32((int)dstfmt->Amask); while (height--) { - for (int i = 0; i < chunks; i += 1) { - __m128i colors = _mm_loadu_si128((__m128i*)(src + i * 16)); - colors = _mm_shuffle_epi8(colors, shift_mask); - colors = MixRGBA_SSE4_1(colors, _mm_loadu_si128((__m128i*)(dst + i * 16)), - splat_mask, saturate_mask); - _mm_storeu_si128((__m128i*)(dst + i * 16), colors); - } + int i = 0; + + for (; i + 4 <= width; i += 4) { + // Load 4 src pixels and shuffle into the dst format + __m128i c_src = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)src), shift_mask); + + // Load 4 dst pixels + __m128i c_dst = _mm_loadu_si128((__m128i *)dst); + + // Blend the pixels together and save the result + _mm_storeu_si128((__m128i *)dst, MixRGBA_SSE4_1(c_src, c_dst, splat_mask, saturate_mask)); - /* Handle remaining pixels when width is not a multiple of 4 */ - if (width % 4 != 0) { - int remaining_pixels = width % 4; - int offset = width - remaining_pixels; - if (remaining_pixels >= 2) { - Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); - Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - __m128i c_src = _mm_loadu_si64(src_ptr); - c_src = _mm_shuffle_epi8(c_src, shift_mask); - __m128i c_dst = _mm_loadu_si64(dst_ptr); - __m128i c_mix = MixRGBA_SSE4_1(c_src, c_dst, splat_mask, saturate_mask); - _mm_storeu_si64(dst_ptr, c_mix); - remaining_pixels -= 2; - offset += 2; - } - if (remaining_pixels == 1) { - Uint32 *src_ptr = ((Uint32*)(src + (offset * 4))); - Uint32 *dst_ptr = ((Uint32*)(dst + (offset * 4))); - Uint32 pixel = AlignPixelToSDL_PixelFormat(*src_ptr, srcfmt, dstfmt); - /* Old GCC has bad or no _mm_loadu_si32 */ - #if defined(__GNUC__) && (__GNUC__ < 11) - __m128i c_src = _mm_set_epi32(0, 0, 0, pixel); - __m128i c_dst = _mm_set_epi32(0, 0, 0, *dst_ptr); - #else - __m128i c_src = _mm_loadu_si32(&pixel); - __m128i c_dst = _mm_loadu_si32(dst_ptr); - #endif - __m128i mixed_pixel = MixRGBA_SSE4_1(c_src, c_dst, splat_mask, saturate_mask); - /* Old GCC has bad or no _mm_storeu_si32 */ - #if defined(__GNUC__) && (__GNUC__ < 11) - *dst_ptr = _mm_extract_epi32(mixed_pixel, 0); - #else - _mm_storeu_si32(dst_ptr, mixed_pixel); - #endif - } + src += 16; + dst += 16; } - src += 4 * width; - dst += 4 * width; + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; + + src32 = (((src32 >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | + (((src32 >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | + (((src32 >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | + (((src32 >> srcfmt->Ashift) & 0xFF) << dstfmt->Ashift); + + ALPHA_BLEND_RGBA_4(src32, dst32, dstfmt->Ashift); + + *(Uint32 *)dst = dst32; + + src += 4; + dst += 4; + } src += srcskip; dst += dstskip; } - if (free_format) { - SDL_DestroyPixelFormat(dstfmt); - } } #endif diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h index c6c8dec729a8a..56c5907cbe8ce 100644 --- a/src/video/SDL_blit_A_sse4_1.h +++ b/src/video/SDL_blit_A_sse4_1.h @@ -1,51 +1,4 @@ #ifndef SDL_SDL_BLIT_A_SSE4_1_H #define SDL_SDL_BLIT_A_SSE4_1_H - -#ifdef SDL_SSE4_1_INTRINSICS -Uint32 AlignPixelToSDL_PixelFormat(Uint32 color, const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); - -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSplatMask_SSE4_1(const SDL_PixelFormat* dstfmt); - -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatAlphaSaturateMask_SSE4_1(const SDL_PixelFormat* dstfmt); - -__m128i SDL_TARGETING("sse4.1") GetSDL_PixelFormatShuffleMask_SSE4_1(const SDL_PixelFormat* srcfmt, const SDL_PixelFormat* dstfmt); - -__m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1(__m128i src, __m128i dst, __m128i alpha_splat, __m128i alpha_saturate); - void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); - -#endif - -/* for compatibility with older compilers: */ -#if defined(SDL_blit_A_sse4_1_c) || defined(SDL_blit_A_avx2_c) -/* _mm_loadu_si64 : missing in clang < 3.9, missing in gcc < 9 - * _mm_storeu_si64: missing in clang < 8.0, missing in gcc < 9 - * __m128i_u type (to be used to define the missing two above): - * missing in gcc < 7, missing in clang < 9 - */ -#if defined(__clang__) -#if (__clang_major__ < 9) -#define MISSING__m128i_u -#endif -#if (__clang_major__ < 8) -#define MISSING__mm_storeu_si64 -#endif -#elif defined(__GNUC__) -#if (__GNUC__ < 7) -#define MISSING__m128i_u -#endif -#if (__GNUC__ < 9) -#define MISSING__mm_storeu_si64 -#endif -#endif - -#ifdef MISSING__m128i_u -typedef long long __m128i_u __attribute__((__vector_size__(16), __may_alias__, __aligned__(1))); -#endif -#ifdef MISSING__mm_storeu_si64 -#define _mm_loadu_si64(_x) _mm_loadl_epi64((__m128i_u*)(_x)) -#define _mm_storeu_si64(_x,_y) _mm_storel_epi64((__m128i_u*)(_x),(_y)) -#endif -#endif /**/ - #endif //SDL_SDL_BLIT_A_SSE4_1_H From 3c59d3f69cea5f6766a8409604d0b676c4fd65b9 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:46:32 +0100 Subject: [PATCH 213/431] Remove old references to blitter files --- VisualC/SDL/SDL.vcxproj | 2 -- 1 file changed, 2 deletions(-) diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index be171d4b3e3d2..f015e5a59f023 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -671,8 +671,6 @@ - - From c457dbb629ace70d928b8b7d33487dea9fc783a3 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Jul 2024 16:37:26 +0100 Subject: [PATCH 214/431] Fix BlitNtoNPixelAlpha for formats with no dst alpha --- src/video/SDL_blit_A_avx2.c | 113 ++++++++++++++++++---------------- src/video/SDL_blit_A_sse4_1.c | 113 ++++++++++++++++++---------------- 2 files changed, 120 insertions(+), 106 deletions(-) diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c index 96e1714da0c08..4421aed0e264d 100644 --- a/src/video/SDL_blit_A_avx2.c +++ b/src/video/SDL_blit_A_avx2.c @@ -6,48 +6,6 @@ #include "SDL_blit.h" -// Using the AVX2 instruction set, blit sixteen pixels into eight with alpha blending -SDL_FORCE_INLINE __m256i SDL_TARGETING("avx2") MixRGBA_AVX2( - __m256i src, __m256i dst, - const __m256i alpha_shuffle, const __m256i alpha_saturate) -{ - // SIMD implementation of blend_mul2. - // dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - // dstA = srcA + (dstA * (1-srcA)) = (1 * srcA) + (dstA * (1-srcA)) - - // Splat the alpha into all channels for each pixel - __m256i srca = _mm256_shuffle_epi8(src, alpha_shuffle); - - // Set the alpha channels of src to 255 - src = _mm256_or_si256(src, alpha_saturate); - - __m256i src_lo = _mm256_unpacklo_epi8(src, _mm256_setzero_si256()); - __m256i src_hi = _mm256_unpackhi_epi8(src, _mm256_setzero_si256()); - - __m256i dst_lo = _mm256_unpacklo_epi8(dst, _mm256_setzero_si256()); - __m256i dst_hi = _mm256_unpackhi_epi8(dst, _mm256_setzero_si256()); - - __m256i srca_lo = _mm256_unpacklo_epi8(srca, _mm256_setzero_si256()); - __m256i srca_hi = _mm256_unpackhi_epi8(srca, _mm256_setzero_si256()); - - // dst = ((src - dst) * srcA) + ((dst << 8) - dst) - dst_lo = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_lo, dst_lo), srca_lo), - _mm256_sub_epi16(_mm256_slli_epi16(dst_lo, 8), dst_lo)); - dst_hi = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_hi, dst_hi), srca_hi), - _mm256_sub_epi16(_mm256_slli_epi16(dst_hi, 8), dst_hi)); - - // dst += 0x1U (use 0x80 to round instead of floor) - dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1)); - dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1)); - - // dst += dst >> 8 - dst_lo = _mm256_srli_epi16(_mm256_add_epi16(dst_lo, _mm256_srli_epi16(dst_lo, 8)), 8); - dst_hi = _mm256_srli_epi16(_mm256_add_epi16(dst_hi, _mm256_srli_epi16(dst_hi, 8)), 8); - - dst = _mm256_packus_epi16(dst_lo, dst_hi); - return dst; -} - void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) { int width = info->dst_w; @@ -59,32 +17,64 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; + // The byte offsets for the start of each pixel const __m256i mask_offsets = _mm256_set_epi8( 28, 28, 28, 28, 24, 24, 24, 24, 20, 20, 20, 20, 16, 16, 16, 16, 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); - const __m256i shift_mask = _mm256_add_epi32( + const __m256i convert_mask = _mm256_add_epi32( _mm256_set1_epi32( ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | - ((srcfmt->Bshift >> 3) << dstfmt->Bshift) | - ((srcfmt->Ashift >> 3) << dstfmt->Ashift)), + ((srcfmt->Bshift >> 3) << dstfmt->Bshift)), mask_offsets); - const __m256i splat_mask = _mm256_add_epi8(_mm256_set1_epi8(dstfmt->Ashift >> 3), mask_offsets); - const __m256i saturate_mask = _mm256_set1_epi32((int)dstfmt->Amask); + const __m256i alpha_splat_mask = _mm256_add_epi8(_mm256_set1_epi8(srcfmt->Ashift >> 3), mask_offsets); + const __m256i alpha_fill_mask = _mm256_set1_epi32((int)dstfmt->Amask); while (height--) { int i = 0; for (; i + 8 <= width; i += 8) { - // Load 8 src pixels and shuffle into the dst format - __m256i c_src = _mm256_shuffle_epi8(_mm256_loadu_si256((__m256i *)src), shift_mask); + // Load 8 src pixels + __m256i src256 = _mm256_loadu_si256((__m256i *)src); // Load 8 dst pixels - __m256i c_dst = _mm256_loadu_si256((__m256i *)dst); + __m256i dst256 = _mm256_loadu_si256((__m256i *)dst); + + // Extract the alpha from each pixel and splat it into all the channels + __m256i srcA = _mm256_shuffle_epi8(src256, alpha_splat_mask); + + // Convert to dst format + src256 = _mm256_shuffle_epi8(src256, convert_mask); + + // Set the alpha channels of src to 255 + src256 = _mm256_or_si256(src256, alpha_fill_mask); + + __m256i src_lo = _mm256_unpacklo_epi8(src256, _mm256_setzero_si256()); + __m256i src_hi = _mm256_unpackhi_epi8(src256, _mm256_setzero_si256()); + + __m256i dst_lo = _mm256_unpacklo_epi8(dst256, _mm256_setzero_si256()); + __m256i dst_hi = _mm256_unpackhi_epi8(dst256, _mm256_setzero_si256()); + + __m256i srca_lo = _mm256_unpacklo_epi8(srcA, _mm256_setzero_si256()); + __m256i srca_hi = _mm256_unpackhi_epi8(srcA, _mm256_setzero_si256()); + + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_lo, dst_lo), srca_lo), + _mm256_sub_epi16(_mm256_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_hi, dst_hi), srca_hi), + _mm256_sub_epi16(_mm256_slli_epi16(dst_hi, 8), dst_hi)); + + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1)); + dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1)); + + // dst += dst >> 8 + dst_lo = _mm256_srli_epi16(_mm256_add_epi16(dst_lo, _mm256_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm256_srli_epi16(_mm256_add_epi16(dst_hi, _mm256_srli_epi16(dst_hi, 8)), 8); // Blend the pixels together and save the result - _mm256_storeu_si256((__m256i *)dst, MixRGBA_AVX2(c_src, c_dst, splat_mask, saturate_mask)); + _mm256_storeu_si256((__m256i *)dst, _mm256_packus_epi16(dst_lo, dst_hi)); src += 32; dst += 32; @@ -94,12 +84,29 @@ void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) Uint32 src32 = *(Uint32 *)src; Uint32 dst32 = *(Uint32 *)dst; + Uint32 srcA = (src32 >> srcfmt->Ashift) & 0xFF; + src32 = (((src32 >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | (((src32 >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | (((src32 >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | - (((src32 >> srcfmt->Ashift) & 0xFF) << dstfmt->Ashift); + dstfmt->Amask; + + Uint32 srcRB = src32 & 0x00FF00FF; + Uint32 dstRB = dst32 & 0x00FF00FF; + + Uint32 srcGA = (src32 >> 8) & 0x00FF00FF; + Uint32 dstGA = (dst32 >> 8) & 0x00FF00FF; + + Uint32 resRB = ((srcRB - dstRB) * srcA) + (dstRB << 8) - dstRB; + resRB += 0x00010001; + resRB += (resRB >> 8) & 0x00FF00FF; + resRB = (resRB >> 8) & 0x00FF00FF; - ALPHA_BLEND_RGBA_4(src32, dst32, dstfmt->Ashift); + Uint32 resGA = ((srcGA - dstGA) * srcA) + (dstGA << 8) - dstGA; + resGA += 0x00010001; + resGA += (resGA >> 8) & 0x00FF00FF; + resGA &= 0xFF00FF00; + dst32 = resRB | resGA; *(Uint32 *)dst = dst32; diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c index 3e6881943196e..425f5f028194b 100644 --- a/src/video/SDL_blit_A_sse4_1.c +++ b/src/video/SDL_blit_A_sse4_1.c @@ -6,48 +6,6 @@ #include "SDL_blit.h" -// Using the SSE4.1 instruction set, blit eight pixels into four with alpha blending -SDL_FORCE_INLINE __m128i SDL_TARGETING("sse4.1") MixRGBA_SSE4_1( - __m128i src, __m128i dst, - const __m128i alpha_shuffle, const __m128i alpha_saturate) -{ - // SIMD implementation of blend_mul2. - // dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - // dstA = srcA + (dstA * (1-srcA)) = (1 * srcA) + (dstA * (1-srcA)) - - // Splat the alpha into all channels for each pixel - __m128i srca = _mm_shuffle_epi8(src, alpha_shuffle); - - // Set the alpha channels of src to 255 - src = _mm_or_si128(src, alpha_saturate); - - __m128i src_lo = _mm_unpacklo_epi8(src, _mm_setzero_si128()); - __m128i src_hi = _mm_unpackhi_epi8(src, _mm_setzero_si128()); - - __m128i dst_lo = _mm_unpacklo_epi8(dst, _mm_setzero_si128()); - __m128i dst_hi = _mm_unpackhi_epi8(dst, _mm_setzero_si128()); - - __m128i srca_lo = _mm_unpacklo_epi8(srca, _mm_setzero_si128()); - __m128i srca_hi = _mm_unpackhi_epi8(srca, _mm_setzero_si128()); - - // dst = ((src - dst) * srcA) + ((dst << 8) - dst) - dst_lo = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_lo, dst_lo), srca_lo), - _mm_sub_epi16(_mm_slli_epi16(dst_lo, 8), dst_lo)); - dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srca_hi), - _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); - - // dst += 0x1U (use 0x80 to round instead of floor) - dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); - dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); - - // dst += dst >> 8 - dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); - dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); - - dst = _mm_packus_epi16(dst_lo, dst_hi); - return dst; -} - void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info) { int width = info->dst_w; @@ -59,32 +17,64 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info) SDL_PixelFormat *srcfmt = info->src_fmt; SDL_PixelFormat *dstfmt = info->dst_fmt; + // The byte offsets for the start of each pixel const __m128i mask_offsets = _mm_set_epi8( 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); - const __m128i shift_mask = _mm_add_epi32( + const __m128i convert_mask = _mm_add_epi32( _mm_set1_epi32( ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | - ((srcfmt->Bshift >> 3) << dstfmt->Bshift) | - ((srcfmt->Ashift >> 3) << dstfmt->Ashift)), + ((srcfmt->Bshift >> 3) << dstfmt->Bshift)), mask_offsets); - const __m128i splat_mask = _mm_add_epi8(_mm_set1_epi8(dstfmt->Ashift >> 3), mask_offsets); - const __m128i saturate_mask = _mm_set1_epi32((int)dstfmt->Amask); + const __m128i alpha_splat_mask = _mm_add_epi8(_mm_set1_epi8(srcfmt->Ashift >> 3), mask_offsets); + const __m128i alpha_fill_mask = _mm_set1_epi32((int)dstfmt->Amask); while (height--) { int i = 0; for (; i + 4 <= width; i += 4) { - // Load 4 src pixels and shuffle into the dst format - __m128i c_src = _mm_shuffle_epi8(_mm_loadu_si128((__m128i *)src), shift_mask); + // Load 4 src pixels + __m128i src128 = _mm_loadu_si128((__m128i *)src); // Load 4 dst pixels - __m128i c_dst = _mm_loadu_si128((__m128i *)dst); + __m128i dst128 = _mm_loadu_si128((__m128i *)dst); + + // Extract the alpha from each pixel and splat it into all the channels + __m128i srcA = _mm_shuffle_epi8(src128, alpha_splat_mask); + + // Convert to dst format + src128 = _mm_shuffle_epi8(src128, convert_mask); + + // Set the alpha channels of src to 255 + src128 = _mm_or_si128(src128, alpha_fill_mask); + + __m128i src_lo = _mm_unpacklo_epi8(src128, _mm_setzero_si128()); + __m128i src_hi = _mm_unpackhi_epi8(src128, _mm_setzero_si128()); + + __m128i dst_lo = _mm_unpacklo_epi8(dst128, _mm_setzero_si128()); + __m128i dst_hi = _mm_unpackhi_epi8(dst128, _mm_setzero_si128()); + + __m128i srca_lo = _mm_unpacklo_epi8(srcA, _mm_setzero_si128()); + __m128i srca_hi = _mm_unpackhi_epi8(srcA, _mm_setzero_si128()); + + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_lo, dst_lo), srca_lo), + _mm_sub_epi16(_mm_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srca_hi), + _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); + + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); + dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); + + // dst += dst >> 8 + dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); // Blend the pixels together and save the result - _mm_storeu_si128((__m128i *)dst, MixRGBA_SSE4_1(c_src, c_dst, splat_mask, saturate_mask)); + _mm_storeu_si128((__m128i *)dst, _mm_packus_epi16(dst_lo, dst_hi)); src += 16; dst += 16; @@ -94,12 +84,29 @@ void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info) Uint32 src32 = *(Uint32 *)src; Uint32 dst32 = *(Uint32 *)dst; + Uint32 srcA = (src32 >> srcfmt->Ashift) & 0xFF; + src32 = (((src32 >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | (((src32 >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | (((src32 >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | - (((src32 >> srcfmt->Ashift) & 0xFF) << dstfmt->Ashift); + dstfmt->Amask; + + Uint32 srcRB = src32 & 0x00FF00FF; + Uint32 dstRB = dst32 & 0x00FF00FF; + + Uint32 srcGA = (src32 >> 8) & 0x00FF00FF; + Uint32 dstGA = (dst32 >> 8) & 0x00FF00FF; + + Uint32 resRB = ((srcRB - dstRB) * srcA) + (dstRB << 8) - dstRB; + resRB += 0x00010001; + resRB += (resRB >> 8) & 0x00FF00FF; + resRB = (resRB >> 8) & 0x00FF00FF; - ALPHA_BLEND_RGBA_4(src32, dst32, dstfmt->Ashift); + Uint32 resGA = ((srcGA - dstGA) * srcA) + (dstGA << 8) - dstGA; + resGA += 0x00010001; + resGA += (resGA >> 8) & 0x00FF00FF; + resGA &= 0xFF00FF00; + dst32 = resRB | resGA; *(Uint32 *)dst = dst32; From 4d5f139f0fc2ccccd1f13537fbabe4165c2cc11f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 8 Jul 2024 10:58:48 -0700 Subject: [PATCH 215/431] Add the blit automation tests --- test/testautomation.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/testautomation.c b/test/testautomation.c index f966e568451d3..a8de28bf911cf 100644 --- a/test/testautomation.c +++ b/test/testautomation.c @@ -49,6 +49,7 @@ static SDLTest_TestSuiteReference *testSuites[] = { &timeTestSuite, &timerTestSuite, &videoTestSuite, + &blitTestSuite, &subsystemsTestSuite, /* run last, not interfere with other test environment */ NULL }; From d6c8485f2873e929fa047d6734d1337d6d1ffbda Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 8 Jul 2024 11:36:11 -0700 Subject: [PATCH 216/431] Make sure we're actually running on Windows before using D3D renderers --- src/render/direct3d/SDL_render_d3d.c | 8 +++++++- src/render/direct3d11/SDL_render_d3d11.c | 5 +++++ src/render/direct3d12/SDL_render_d3d12.c | 5 +++++ test/testautomation_render.c | 4 ---- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index e944d2639e707..b5cf4513d78c7 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1595,6 +1595,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie { D3D_RenderData *data; HRESULT result; + HWND hwnd; D3DPRESENT_PARAMETERS pparams; IDirect3DSwapChain9 *chain; D3DCAPS9 caps; @@ -1603,6 +1604,11 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie SDL_DisplayID displayID; const SDL_DisplayMode *fullscreen_mode = NULL; + hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + if (!hwnd) { + return SDL_SetError("Couldn't get window handle"); + } + SDL_SetupRendererColorspace(renderer, create_props); if (renderer->output_colorspace != SDL_COLORSPACE_SRGB) { @@ -1654,7 +1660,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie } SDL_zero(pparams); - pparams.hDeviceWindow = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + pparams.hDeviceWindow = hwnd; pparams.BackBufferWidth = w; pparams.BackBufferHeight = h; pparams.BackBufferCount = 1; diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index d19fcd8aaed39..42ae0be1ee17a 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -976,6 +976,11 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) } else { #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + if (!hwnd) { + SDL_SetError("Couldn't get window handle"); + result = E_FAIL; + goto done; + } result = IDXGIFactory2_CreateSwapChainForHwnd(data->dxgiFactory, (IUnknown *)data->d3dDevice, diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 65be4bbc6a9b4..c8340cc15853a 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -1311,6 +1311,11 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; /* To support presenting with allow tearing on */ HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + if (!hwnd) { + SDL_SetError("Couldn't get window handle"); + result = E_FAIL; + goto done; + } result = D3D_CALL(data->dxgiFactory, CreateSwapChainForHwnd, (IUnknown *)data->commandQueue, diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 644c6f4534d6e..f8af4697d20cc 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -58,10 +58,6 @@ static void InitCreateRenderer(void *arg) return; } - if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "dummy") == 0) { - renderer_name = SDL_SOFTWARE_RENDERER; - } - renderer = SDL_CreateRenderer(window, renderer_name); SDLTest_AssertPass("SDL_CreateRenderer()"); SDLTest_AssertCheck(renderer != NULL, "Check SDL_CreateRenderer result: %s", renderer != NULL ? "success" : SDL_GetError()); From c4cbbca185602e3cc51090124f54cea96eb8ae56 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 8 Jul 2024 19:36:38 +0200 Subject: [PATCH 217/431] sdlprocdump: ignore C++ exceptions --- test/win32/sdlprocdump.c | 79 +++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 14 deletions(-) diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c index edcb1369b7861..6c96971ae605b 100644 --- a/test/win32/sdlprocdump.c +++ b/test/win32/sdlprocdump.c @@ -145,6 +145,7 @@ static void unload_dbghelp(void) { static const char *exceptionCode_to_string(DWORD dwCode) { #define SWITCH_CODE_STR(V) case V: return #V; switch (dwCode) { + case 0xe06d7363: return "MS Visual C++ Exception"; FOREACH_EXCEPTION_CODES(SWITCH_CODE_STR) default: { return "unknown"; @@ -153,7 +154,12 @@ static const char *exceptionCode_to_string(DWORD dwCode) { #undef SWITCH_CODE_STR } -static int IsFatalExceptionCode(DWORD dwCode) { +static BOOL IsCXXException(DWORD dwCode) { + /* https://devblogs.microsoft.com/oldnewthing/20100730-00/?p=13273 */ + return dwCode == 0xe06d7363; /* FOURCC(0xe0, 'm', 's', 'c') */ +} + +static BOOL IsFatalExceptionCode(DWORD dwCode) { switch (dwCode) { case EXCEPTION_ACCESS_VIOLATION: case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: @@ -165,9 +171,9 @@ static int IsFatalExceptionCode(DWORD dwCode) { case STATUS_STACK_BUFFER_OVERRUN: case EXCEPTION_GUARD_PAGE: case EXCEPTION_INVALID_HANDLE: - return 1; + return TRUE; default: - return 0; + return FALSE; } } @@ -392,6 +398,46 @@ static PCONTEXT FillInThreadContext(LPPROCESS_INFORMATION process_information, P return context_buffer; } +static void GetMSCExceptionName(HANDLE hProcess, ULONG_PTR *parameters, DWORD count_parameters, char *buffer, size_t buffer_size) { + +#define FIXUP_DWORD_POINTER(ADDR) ((sizeof(void *) == 8) ? (parameters[3] + (ADDR)) : (ADDR)) +#define CHECKED_ReadProcessMemory(PROCESS, ADDRESS, BUFFER, COUNT, WHAT) \ + do { \ + SIZE_T actual_count; \ + BOOL res = ReadProcessMemory((PROCESS), (ADDRESS), (BUFFER), (COUNT), &actual_count); \ + if (!res) { \ + printf_windows_message(WHAT ": ReadProcessMemory failed"); \ + strncpy_s(buffer, buffer_size, "", buffer_size); \ + return; \ + } \ + if ((COUNT) != (actual_count)) { \ + printf_message(WHAT ": ReadProcessMemory did not read enough data actual=%lu expected=%lu", \ + (unsigned long) (actual_count), (unsigned long) (COUNT)); \ + strncpy_s(buffer, buffer_size, "", buffer_size); \ + return; \ + } \ + } while (0) + + DWORD depth0; + char *ptr_depth0; + DWORD depth1; + char *ptr_depth1; + DWORD depth2; + char *ptr_depth2; + + CHECKED_ReadProcessMemory(hProcess, (void *)(parameters[2] + 3 * sizeof(DWORD)), &depth0, sizeof(depth0), "depth 0"); + ptr_depth0 = (char *)FIXUP_DWORD_POINTER(depth0); + CHECKED_ReadProcessMemory(hProcess, ptr_depth0 + 1 * sizeof(DWORD), &depth1, sizeof(depth1), "depth 1"); + ptr_depth1 = (char *)FIXUP_DWORD_POINTER(depth1); + CHECKED_ReadProcessMemory(hProcess, ptr_depth1 + 1 * sizeof(DWORD), &depth2, sizeof(depth2), "depth 2"); + ptr_depth2 = (char *)FIXUP_DWORD_POINTER(depth2); + CHECKED_ReadProcessMemory(hProcess, ptr_depth2 + 2 * sizeof(void*), buffer, buffer_size, "data"); + buffer[buffer_size - 1] = '\0'; + +#undef FIXUP_DWORD_POINTER +#undef CHECKED_ReadProcessMemory +} + int main(int argc, char *argv[]) { int i; size_t command_line_len = 0; @@ -409,7 +455,7 @@ int main(int argc, char *argv[]) { } for (i = 1; i < argc; i++) { - command_line_len += strlen(argv[1]) + 1; + command_line_len += strlen(argv[i]) + 1; } command_line = malloc(command_line_len + 1); if (!command_line) { @@ -463,20 +509,25 @@ int main(int argc, char *argv[]) { } switch (event.dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: - if (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)) { + printf_message("EXCEPTION_DEBUG_EVENT"); + printf_message(" ExceptionCode: 0x%08lx (%s)", + event.u.Exception.ExceptionRecord.ExceptionCode, + exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode)); + printf_message(" ExceptionFlags: 0x%08lx", + event.u.Exception.ExceptionRecord.ExceptionFlags); + printf_message(" FirstChance: %ld", event.u.Exception.dwFirstChance); + printf_message(" ExceptionAddress: 0x%08lx", + event.u.Exception.ExceptionRecord.ExceptionAddress); + if (IsCXXException(event.u.Exception.ExceptionRecord.ExceptionCode)) { + char exception_name[256]; + GetMSCExceptionName(process_information.hProcess, event.u.Exception.ExceptionRecord.ExceptionInformation, event.u.Exception.ExceptionRecord.NumberParameters, + exception_name, sizeof(exception_name)); + printf_message(" Exception name: %s", exception_name); + } else if (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)) { CONTEXT context_buffer; PCONTEXT context; - printf_message("EXCEPTION_DEBUG_EVENT"); - printf_message(" ExceptionCode: 0x%08lx (%s)", - event.u.Exception.ExceptionRecord.ExceptionCode, - exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode)); - printf_message(" ExceptionFlags: 0x%08lx", - event.u.Exception.ExceptionRecord.ExceptionFlags); - printf_message(" ExceptionAddress: 0x%08lx", - event.u.Exception.ExceptionRecord.ExceptionAddress); printf_message(" (Non-continuable exception debug event)"); - context = FillInThreadContext(&process_information, &context_buffer); write_minidump(argv[1], &process_information, event.dwThreadId, &event.u.Exception.ExceptionRecord, context); printf_message(""); From 1cddc7b66ee8b2fef36da322c353041e7f3df4b1 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 8 Jul 2024 21:18:20 +0200 Subject: [PATCH 218/431] sdlprocdump: exceptions are not handled --- test/win32/sdlprocdump.c | 63 +++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 13 deletions(-) diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c index 6c96971ae605b..08409ab314d6c 100644 --- a/test/win32/sdlprocdump.c +++ b/test/win32/sdlprocdump.c @@ -25,6 +25,10 @@ #pragma message("Unsupported architecture: don't know how to StackWalk") #endif +#ifndef EXCEPTION_SOFTWARE_ORIGINATE +#define EXCEPTION_SOFTWARE_ORIGINATE 0x80 +#endif + static void printf_message(const char *format, ...) { va_list ap; fprintf(stderr, "[" APPNAME "] "); @@ -142,6 +146,16 @@ static void unload_dbghelp(void) { X(EXCEPTION_INVALID_HANDLE) \ X(STATUS_HEAP_CORRUPTION) +#define FOREACH_EXCEPTION_FLAGS(X) \ + X(EXCEPTION_NONCONTINUABLE) \ + X(EXCEPTION_UNWINDING) \ + X(EXCEPTION_EXIT_UNWIND) \ + X(EXCEPTION_STACK_INVALID) \ + X(EXCEPTION_NESTED_CALL) \ + X(EXCEPTION_TARGET_UNWIND) \ + X(EXCEPTION_COLLIDED_UNWIND) \ + X(EXCEPTION_SOFTWARE_ORIGINATE) + static const char *exceptionCode_to_string(DWORD dwCode) { #define SWITCH_CODE_STR(V) case V: return #V; switch (dwCode) { @@ -154,6 +168,21 @@ static const char *exceptionCode_to_string(DWORD dwCode) { #undef SWITCH_CODE_STR } +static const char *exceptionFlags_to_string(DWORD dwFlags, char *buffer, size_t buffer_length) { + buffer[0] = '\0'; + +#define APPEND_OR_STR(CODE) \ + if (dwFlags & (CODE)) { \ + if (buffer[0]) { \ + strcat_s(buffer, buffer_length, "|"); \ + } \ + strcat_s(buffer, buffer_length, #CODE); \ + } + + FOREACH_EXCEPTION_FLAGS(APPEND_OR_STR) + return buffer; +} + static BOOL IsCXXException(DWORD dwCode) { /* https://devblogs.microsoft.com/oldnewthing/20100730-00/?p=13273 */ return dwCode == 0xe06d7363; /* FOURCC(0xe0, 'm', 's', 'c') */ @@ -509,21 +538,29 @@ int main(int argc, char *argv[]) { } switch (event.dwDebugEventCode) { case EXCEPTION_DEBUG_EVENT: - printf_message("EXCEPTION_DEBUG_EVENT"); - printf_message(" ExceptionCode: 0x%08lx (%s)", - event.u.Exception.ExceptionRecord.ExceptionCode, - exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode)); - printf_message(" ExceptionFlags: 0x%08lx", - event.u.Exception.ExceptionRecord.ExceptionFlags); - printf_message(" FirstChance: %ld", event.u.Exception.dwFirstChance); - printf_message(" ExceptionAddress: 0x%08lx", - event.u.Exception.ExceptionRecord.ExceptionAddress); - if (IsCXXException(event.u.Exception.ExceptionRecord.ExceptionCode)) { + { + const BOOL cxx_exception = IsCXXException(event.u.Exception.ExceptionRecord.ExceptionCode); + const BOOL is_fatal = !cxx_exception && (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)); + if (cxx_exception || is_fatal) { + char flag_buffer[256]; + printf_message("EXCEPTION_DEBUG_EVENT"); + printf_message(" ExceptionCode: 0x%08lx (%s)", + event.u.Exception.ExceptionRecord.ExceptionCode, + exceptionCode_to_string(event.u.Exception.ExceptionRecord.ExceptionCode)); + printf_message(" ExceptionFlags: 0x%08lx (%s)", + event.u.Exception.ExceptionRecord.ExceptionFlags, + exceptionFlags_to_string(event.u.Exception.ExceptionRecord.ExceptionFlags, flag_buffer, sizeof(flag_buffer))); + + printf_message(" FirstChance: %ld", event.u.Exception.dwFirstChance); + printf_message(" ExceptionAddress: 0x%08lx", + event.u.Exception.ExceptionRecord.ExceptionAddress); + } + if (cxx_exception) { char exception_name[256]; GetMSCExceptionName(process_information.hProcess, event.u.Exception.ExceptionRecord.ExceptionInformation, event.u.Exception.ExceptionRecord.NumberParameters, exception_name, sizeof(exception_name)); printf_message(" Exception name: %s", exception_name); - } else if (IsFatalExceptionCode(event.u.Exception.ExceptionRecord.ExceptionCode) || (event.u.Exception.ExceptionRecord.ExceptionFlags & EXCEPTION_NONCONTINUABLE)) { + } else if (is_fatal) { CONTEXT context_buffer; PCONTEXT context; @@ -537,10 +574,10 @@ int main(int argc, char *argv[]) { printf_message("No support for printing stacktrack for current architecture"); #endif DebugActiveProcessStop(event.dwProcessId); - process_alive = 0; } - continue_status = DBG_EXCEPTION_HANDLED; + continue_status = DBG_EXCEPTION_NOT_HANDLED; break; + } case CREATE_PROCESS_DEBUG_EVENT: load_dbghelp(); if (!dyn_dbghelp.pSymInitialize) { From 43a5da358de9205c8ad9b71e493d1115ac3016bb Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Wed, 3 Jul 2024 18:02:52 +0100 Subject: [PATCH 219/431] Set ALLOWABLE_ERROR_BLENDED to 0 --- test/testautomation_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testautomation_render.c b/test/testautomation_render.c index f8af4697d20cc..ddbb30913ede9 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -18,7 +18,7 @@ #define RENDER_COLOR_GREEN 0xFF00FF00 #define ALLOWABLE_ERROR_OPAQUE 0 -#define ALLOWABLE_ERROR_BLENDED 64 +#define ALLOWABLE_ERROR_BLENDED 0 #define CHECK_FUNC(FUNC, PARAMS) \ { \ From fde2378ccd37dbcab0af60ede4c8200af6cc75da Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Sat, 6 Jul 2024 18:01:11 +0100 Subject: [PATCH 220/431] Refactor alpha blitters, move the SSE41/AVX2 versions into SDL_blit_A.c --- VisualC-GDK/SDL/SDL.vcxproj | 4 - VisualC-GDK/SDL/SDL.vcxproj.filters | 6 - VisualC-WinRT/SDL-UWP.vcxproj | 4 - VisualC-WinRT/SDL-UWP.vcxproj.filters | 12 - VisualC/SDL/SDL.vcxproj | 4 - VisualC/SDL/SDL.vcxproj.filters | 12 - src/video/SDL_blit.h | 80 +++-- src/video/SDL_blit_A.c | 439 ++++++++++++++++---------- src/video/SDL_blit_A_avx2.c | 124 -------- src/video/SDL_blit_A_avx2.h | 4 - src/video/SDL_blit_A_sse4_1.c | 124 -------- src/video/SDL_blit_A_sse4_1.h | 4 - 12 files changed, 330 insertions(+), 487 deletions(-) delete mode 100644 src/video/SDL_blit_A_avx2.c delete mode 100644 src/video/SDL_blit_A_avx2.h delete mode 100644 src/video/SDL_blit_A_sse4_1.c delete mode 100644 src/video/SDL_blit_A_sse4_1.h diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 28c678bb5218f..28fdc639ff8f2 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -551,8 +551,6 @@ - - @@ -824,8 +822,6 @@ - - diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 06543fe5df551..069e3bd14afd7 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -458,12 +458,6 @@ - - video - - - video - diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index 8e11e9ba3f17c..32966b4fedbc6 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -178,8 +178,6 @@ - - @@ -549,8 +547,6 @@ - - diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index 21d0415627aef..46d67b1459878 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -952,12 +952,6 @@ Header Files - - Source Files - - - Source Files - @@ -978,11 +972,5 @@ Source Files - - Source Files - - - Source Files - \ No newline at end of file diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index f015e5a59f023..879c607e8dd80 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -457,8 +457,6 @@ - - @@ -682,8 +680,6 @@ - - diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index 5d10b7e74f6c5..faa6a9d55598d 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -871,12 +871,6 @@ - - video - - - video - @@ -1525,12 +1519,6 @@ stdlib - - video - - - video - diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 387db2f2cae5a..5facdd5159406 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -526,27 +526,65 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); ALPHA_BLEND_CHANNEL(sG, dG, A); \ ALPHA_BLEND_CHANNEL(sB, dB, A); \ } while (0) -/* Blend two 32-bit pixels with the same format */ -#define ALPHA_BLEND_RGBA_4(src, dst, ashift) \ - do { \ - Uint32 srcA = (src >> ashift) & 0xFF; \ - src |= ((Uint32)0xFF) << ashift; \ - \ - Uint32 srcRB = src & 0x00FF00FF; \ - Uint32 dstRB = dst & 0x00FF00FF; \ - \ - Uint32 srcGA = (src >> 8) & 0x00FF00FF; \ - Uint32 dstGA = (dst >> 8) & 0x00FF00FF; \ - \ - Uint32 resRB = ((srcRB - dstRB) * srcA) + (dstRB << 8) - dstRB; \ - resRB += 0x00010001; \ - resRB += (resRB >> 8) & 0x00FF00FF; \ - resRB = (resRB >> 8) & 0x00FF00FF; \ - Uint32 resGA = ((srcGA - dstGA) * srcA) + (dstGA << 8) - dstGA; \ - resGA += 0x00010001; \ - resGA += (resGA >> 8) & 0x00FF00FF; \ - resGA &= 0xFF00FF00; \ - dst = resRB | resGA; \ + +/* Blend two 8888 pixels with the same format */ +/* Calculates dst = ((src * factor) + (dst * (255 - factor))) / 255 */ +/* FIXME: SDL_SIZE_MAX might not be an integer literal */ +#if defined(SIZE_MAX) && (SIZE_MAX == 0xffffffffffffffff) +#define FACTOR_BLEND_8888(src, dst, factor) \ + do { \ + Uint64 src64 = src; \ + src64 = (src64 | (src64 << 24)) & 0x00FF00FF00FF00FF; \ + \ + Uint64 dst64 = dst; \ + dst64 = (dst64 | (dst64 << 24)) & 0x00FF00FF00FF00FF; \ + \ + dst64 = ((src64 - dst64) * factor) + (dst64 << 8) - dst64; \ + dst64 += 0x0001000100010001; \ + dst64 += (dst64 >> 8) & 0x00FF00FF00FF00FF; \ + dst64 &= 0xFF00FF00FF00FF00; \ + \ + dst = (Uint32)((dst64 >> 8) | (dst64 >> 32)); \ + } while (0) +#else +#define FACTOR_BLEND_8888(src, dst, factor) \ + do { \ + Uint32 src02 = src & 0x00FF00FF; \ + Uint32 dst02 = dst & 0x00FF00FF; \ + \ + Uint32 src13 = (src >> 8) & 0x00FF00FF; \ + Uint32 dst13 = (dst >> 8) & 0x00FF00FF; \ + \ + Uint32 res02 = ((src02 - dst02) * factor) + (dst02 << 8) - dst02; \ + res02 += 0x00010001; \ + res02 += (res02 >> 8) & 0x00FF00FF; \ + res02 = (res02 >> 8) & 0x00FF00FF; \ + \ + Uint32 res13 = ((src13 - dst13) * factor) + (dst13 << 8) - dst13; \ + res13 += 0x00010001; \ + res13 += (res13 >> 8) & 0x00FF00FF; \ + res13 &= 0xFF00FF00; \ + dst = res02 | res13; \ + } while (0) +#endif + +/* Alpha blend two 8888 pixels with the same formats. */ +#define ALPHA_BLEND_8888(src, dst, fmt) \ + do { \ + Uint32 srcA = (src >> fmt->Ashift) & 0xFF; \ + Uint32 tmp = src | fmt->Amask; \ + FACTOR_BLEND_8888(tmp, dst, srcA); \ + } while (0) + +/* Alpha blend two 8888 pixels with differing formats. */ +#define ALPHA_BLEND_SWIZZLE_8888(src, dst, srcfmt, dstfmt) \ + do { \ + Uint32 srcA = (src >> srcfmt->Ashift) & 0xFF; \ + Uint32 tmp = (((src >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | \ + (((src >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | \ + (((src >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | \ + dstfmt->Amask; \ + FACTOR_BLEND_8888(tmp, dst, srcA); \ } while (0) /* Blend the RGBA values of two pixels */ #define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 4dd67e341b54d..51f1076547e87 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -24,16 +24,6 @@ #include "SDL_blit.h" -#ifdef SDL_SSE4_1_INTRINSICS -#include "SDL_blit_A_sse4_1.h" -#endif -#ifdef SDL_AVX2_INTRINSICS -#include "SDL_blit_A_avx2.h" -#endif -#if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) -#include "SDL3/SDL_cpuinfo.h" -#endif - /* Functions to perform alpha blended blitting */ /* N->1 blending with per-surface alpha */ @@ -327,98 +317,6 @@ static void SDL_TARGETING("mmx") BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info) } } -/* fast ARGB888->(A)RGB888 blending with pixel alpha */ -static void SDL_TARGETING("mmx") BlitRGBtoRGBPixelAlphaMMX(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *)info->dst; - int dstskip = info->dst_skip >> 2; - SDL_PixelFormat *sf = info->src_fmt; - Uint32 amask = sf->Amask; - Uint32 ashift = sf->Ashift; - Uint64 multmask, multmask2; - - __m64 src1, dst1, mm_alpha, mm_zero, mm_alpha2, mm_one_alpha; - - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ - if (amask == 0xFF000000) { /* 1 in the alpha channel -> mm_one_alpha */ - mm_one_alpha = _mm_set_pi16(1, 0, 0, 0); - } else if (amask == 0x00FF0000) { - mm_one_alpha = _mm_set_pi16(0, 1, 0, 0); - } else if (amask == 0x0000FF00) { - mm_one_alpha = _mm_set_pi16(0, 0, 1, 0); - } else { - mm_one_alpha = _mm_set_pi16(0, 0, 0, 1); - } - - multmask = 0x00FF; - multmask <<= ((Uint64)ashift * 2); - multmask2 = 0x00FF00FF00FF00FFULL; - - while (height--) { - /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4({ - Uint32 alpha = *srcp & amask; - if (alpha == 0) { - /* do nothing */ - } else if (alpha == amask) { - *dstp = *srcp; - } 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_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */ - mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask); /* 0F0A0A0A -> mm_alpha */ - mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2); /* 255 - mm_alpha -> mm_alpha */ - - /* - Alpha blending is: - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) * - - Here, 'src1' is: - srcRGB * srcA - srcA - And 'dst1' is: - dstRGB * (1-srcA) - dstA * (1-srcA) - so that *dstp is 'src1 + dst1' - - src1 is computed using mullo_pi16: (X * mask) >> 8, but is approximate for srcA ((srcA * 255) >> 8). - - need to a 1 to get an exact result: (srcA * 256) >> 8 == srcA - */ - mm_alpha = _mm_add_pi16(mm_alpha, mm_one_alpha); - - /* blend */ - src1 = _mm_mullo_pi16(src1, mm_alpha); - src1 = _mm_srli_pi16(src1, 8); - dst1 = _mm_mullo_pi16(dst1, mm_alpha2); - dst1 = _mm_srli_pi16(dst1, 8); - dst1 = _mm_add_pi16(src1, dst1); - dst1 = _mm_packs_pu16(dst1, mm_zero); - - *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */ - } - ++srcp; - ++dstp; - }, width); - /* *INDENT-ON* */ /* clang-format on */ - srcp += srcskip; - dstp += dstskip; - } - _mm_empty(); -} - #endif /* SDL_MMX_INTRINSICS */ /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ @@ -1121,6 +1019,247 @@ static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) } } +/* Fast 32-bit RGBA->RGBA blending with pixel alpha */ +static void Blit8888to8888PixelAlpha(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + + while (height--) { + int i = 0; + + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; + ALPHA_BLEND_8888(src32, dst32, srcfmt); + *(Uint32 *)dst = dst32; + src += 4; + dst += 4; + } + + src += srcskip; + dst += dstskip; + } +} + +/* Fast 32-bit RGBA->RGB(A) blending with pixel alpha and src swizzling */ +static void Blit8888to8888PixelAlphaSwizzle(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + + while (height--) { + int i = 0; + + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; + ALPHA_BLEND_SWIZZLE_8888(src32, dst32, srcfmt, dstfmt); + *(Uint32 *)dst = dst32; + src += 4; + dst += 4; + } + + src += srcskip; + dst += dstskip; + } +} + +#ifdef SDL_SSE4_1_INTRINSICS + +static void SDL_TARGETING("sse4.1") Blit8888to8888PixelAlphaSwizzleSSE41(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + + // The byte offsets for the start of each pixel + const __m128i mask_offsets = _mm_set_epi8( + 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); + + const __m128i convert_mask = _mm_add_epi32( + _mm_set1_epi32( + ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | + ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | + ((srcfmt->Bshift >> 3) << dstfmt->Bshift)), + mask_offsets); + + const __m128i alpha_splat_mask = _mm_add_epi8(_mm_set1_epi8(srcfmt->Ashift >> 3), mask_offsets); + const __m128i alpha_fill_mask = _mm_set1_epi32((int)dstfmt->Amask); + + while (height--) { + int i = 0; + + for (; i + 4 <= width; i += 4) { + // Load 4 src pixels + __m128i src128 = _mm_loadu_si128((__m128i *)src); + + // Load 4 dst pixels + __m128i dst128 = _mm_loadu_si128((__m128i *)dst); + + // Extract the alpha from each pixel and splat it into all the channels + __m128i srcA = _mm_shuffle_epi8(src128, alpha_splat_mask); + + // Convert to dst format + src128 = _mm_shuffle_epi8(src128, convert_mask); + + // Set the alpha channels of src to 255 + src128 = _mm_or_si128(src128, alpha_fill_mask); + + __m128i src_lo = _mm_unpacklo_epi8(src128, _mm_setzero_si128()); + __m128i src_hi = _mm_unpackhi_epi8(src128, _mm_setzero_si128()); + + __m128i dst_lo = _mm_unpacklo_epi8(dst128, _mm_setzero_si128()); + __m128i dst_hi = _mm_unpackhi_epi8(dst128, _mm_setzero_si128()); + + __m128i srca_lo = _mm_unpacklo_epi8(srcA, _mm_setzero_si128()); + __m128i srca_hi = _mm_unpackhi_epi8(srcA, _mm_setzero_si128()); + + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_lo, dst_lo), srca_lo), + _mm_sub_epi16(_mm_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srca_hi), + _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); + + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); + dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); + + // dst += dst >> 8 + dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); + + // Blend the pixels together and save the result + _mm_storeu_si128((__m128i *)dst, _mm_packus_epi16(dst_lo, dst_hi)); + + src += 16; + dst += 16; + } + + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; + ALPHA_BLEND_SWIZZLE_8888(src32, dst32, srcfmt, dstfmt); + *(Uint32 *)dst = dst32; + src += 4; + dst += 4; + } + + src += srcskip; + dst += dstskip; + } +} + +#endif + +#ifdef SDL_AVX2_INTRINSICS + +static void SDL_TARGETING("avx2") Blit8888to8888PixelAlphaSwizzleAVX2(SDL_BlitInfo *info) +{ + int width = info->dst_w; + int height = info->dst_h; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + SDL_PixelFormat *srcfmt = info->src_fmt; + SDL_PixelFormat *dstfmt = info->dst_fmt; + + // The byte offsets for the start of each pixel + const __m256i mask_offsets = _mm256_set_epi8( + 28, 28, 28, 28, 24, 24, 24, 24, 20, 20, 20, 20, 16, 16, 16, 16, 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); + + const __m256i convert_mask = _mm256_add_epi32( + _mm256_set1_epi32( + ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | + ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | + ((srcfmt->Bshift >> 3) << dstfmt->Bshift)), + mask_offsets); + + const __m256i alpha_splat_mask = _mm256_add_epi8(_mm256_set1_epi8(srcfmt->Ashift >> 3), mask_offsets); + const __m256i alpha_fill_mask = _mm256_set1_epi32((int)dstfmt->Amask); + + while (height--) { + int i = 0; + + for (; i + 8 <= width; i += 8) { + // Load 8 src pixels + __m256i src256 = _mm256_loadu_si256((__m256i *)src); + + // Load 8 dst pixels + __m256i dst256 = _mm256_loadu_si256((__m256i *)dst); + + // Extract the alpha from each pixel and splat it into all the channels + __m256i srcA = _mm256_shuffle_epi8(src256, alpha_splat_mask); + + // Convert to dst format + src256 = _mm256_shuffle_epi8(src256, convert_mask); + + // Set the alpha channels of src to 255 + src256 = _mm256_or_si256(src256, alpha_fill_mask); + + __m256i src_lo = _mm256_unpacklo_epi8(src256, _mm256_setzero_si256()); + __m256i src_hi = _mm256_unpackhi_epi8(src256, _mm256_setzero_si256()); + + __m256i dst_lo = _mm256_unpacklo_epi8(dst256, _mm256_setzero_si256()); + __m256i dst_hi = _mm256_unpackhi_epi8(dst256, _mm256_setzero_si256()); + + __m256i srca_lo = _mm256_unpacklo_epi8(srcA, _mm256_setzero_si256()); + __m256i srca_hi = _mm256_unpackhi_epi8(srcA, _mm256_setzero_si256()); + + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_lo, dst_lo), srca_lo), + _mm256_sub_epi16(_mm256_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_hi, dst_hi), srca_hi), + _mm256_sub_epi16(_mm256_slli_epi16(dst_hi, 8), dst_hi)); + + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1)); + dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1)); + + // dst += dst >> 8 + dst_lo = _mm256_srli_epi16(_mm256_add_epi16(dst_lo, _mm256_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm256_srli_epi16(_mm256_add_epi16(dst_hi, _mm256_srli_epi16(dst_hi, 8)), 8); + + // Blend the pixels together and save the result + _mm256_storeu_si256((__m256i *)dst, _mm256_packus_epi16(dst_lo, dst_hi)); + + src += 32; + dst += 32; + } + + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; + ALPHA_BLEND_SWIZZLE_8888(src32, dst32, srcfmt, dstfmt); + *(Uint32 *)dst = dst32; + src += 4; + dst += 4; + } + + src += srcskip; + dst += dstskip; + } +} + +#endif + /* General (slow) N->N blending with pixel alpha */ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) { @@ -1134,7 +1273,6 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) SDL_PixelFormat *dstfmt = info->dst_fmt; int srcbpp; int dstbpp; - SDL_bool freeFormat; Uint32 Pixel; unsigned sR, sG, sB, sA; unsigned dR, dG, dB, dA; @@ -1142,62 +1280,23 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) /* Set up some basic variables */ srcbpp = srcfmt->bytes_per_pixel; dstbpp = dstfmt->bytes_per_pixel; - freeFormat = SDL_FALSE; - -#ifdef SDL_AVX2_INTRINSICS - if (srcbpp == 4 && dstbpp == 4 && width >= 4 && SDL_HasAVX2()) { - BlitNtoNPixelAlpha_AVX2(info); - return; - } -#endif - -#ifdef SDL_SSE4_1_INTRINSICS - // TODO: Re-enable - if (srcbpp == 4 && dstbpp == 4 && width >= 2 && SDL_HasSSE41()) { - BlitNtoNPixelAlpha_SSE4_1(info); - return; - } -#endif - /* Handle case where bad input sent */ - if (dstfmt->Ashift == 0 && dstfmt->Ashift == dstfmt->Bshift) { - dstfmt = SDL_CreatePixelFormat(SDL_PIXELFORMAT_ARGB8888); - freeFormat = SDL_TRUE; - } while (height--) { - /* if (srcbpp == 4 && dstbpp == 4 && dstfmt->Ashift == 24 && dstfmt->Rshift == 16 && dstfmt->Gshift == 8 && - dstfmt->Bshift == 0) { - DUFFS_LOOP4( - { - PIXEL_TO_ARGB_PIXEL(*(Uint32 *) src, srcfmt, Pixel); - Uint32 blended = *(Uint32 *) dst; - ALPHA_BLEND_RGBA_4(Pixel, blended); - *(Uint32*)dst = blended; - src += srcbpp; - dst += dstbpp; - }, - width); - } else { */ - /* *INDENT-OFF* */ /* clang-format off */ - DUFFS_LOOP4( - { - DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); - if (sA) { - DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); - ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); - ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); - } - src += srcbpp; - dst += dstbpp; - }, - width); - /* *INDENT-ON* */ /* clang-format on */ - src += srcskip; - dst += dstskip; - // } - } - if (freeFormat) { - SDL_DestroyPixelFormat(dstfmt); + DUFFS_LOOP4( + { + DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA); + if (sA) { + DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA); + ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA); + ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA); + } + src += srcbpp; + dst += dstbpp; + }, + width); + /* *INDENT-ON* */ /* clang-format on */ + src += srcskip; + dst += dstskip; } } @@ -1229,19 +1328,23 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) return BlitNtoNPixelAlpha; case 4: -#if defined(SDL_SSE4_1_INTRINSICS) || defined(SDL_AVX2_INTRINSICS) - if (sf->bytes_per_pixel == 4 && df->bytes_per_pixel == 4 && (SDL_HasSSE41() || SDL_HasAVX2())) { - return BlitNtoNPixelAlpha; - } + if (SDL_PIXELLAYOUT(sf->format) == SDL_PACKEDLAYOUT_8888 && sf->Amask && + SDL_PIXELLAYOUT(df->format) == SDL_PACKEDLAYOUT_8888) { +#ifdef SDL_AVX2_INTRINSICS + if (SDL_HasAVX2()) { + return Blit8888to8888PixelAlphaSwizzleAVX2; + } #endif - if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->bytes_per_pixel == 4) { -#ifdef SDL_MMX_INTRINSICS - if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && sf->Ashift % 8 == 0 && sf->Aloss == 0) { - if (SDL_HasMMX()) { - return BlitRGBtoRGBPixelAlphaMMX; - } +#ifdef SDL_SSE4_1_INTRINSICS + if (SDL_HasSSE41()) { + return Blit8888to8888PixelAlphaSwizzleSSE41; + } +#endif + if (sf->format == df->format) { + return Blit8888to8888PixelAlpha; + } else { + return Blit8888to8888PixelAlphaSwizzle; } -#endif /* SDL_MMX_INTRINSICS */ } return BlitNtoNPixelAlpha; diff --git a/src/video/SDL_blit_A_avx2.c b/src/video/SDL_blit_A_avx2.c deleted file mode 100644 index 4421aed0e264d..0000000000000 --- a/src/video/SDL_blit_A_avx2.c +++ /dev/null @@ -1,124 +0,0 @@ -#include "SDL_internal.h" - -#if SDL_HAVE_BLIT_A - -#ifdef SDL_AVX2_INTRINSICS - -#include "SDL_blit.h" - -void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint8 *src = info->src; - int srcskip = info->src_skip; - Uint8 *dst = info->dst; - int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; - - // The byte offsets for the start of each pixel - const __m256i mask_offsets = _mm256_set_epi8( - 28, 28, 28, 28, 24, 24, 24, 24, 20, 20, 20, 20, 16, 16, 16, 16, 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); - - const __m256i convert_mask = _mm256_add_epi32( - _mm256_set1_epi32( - ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | - ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | - ((srcfmt->Bshift >> 3) << dstfmt->Bshift)), - mask_offsets); - - const __m256i alpha_splat_mask = _mm256_add_epi8(_mm256_set1_epi8(srcfmt->Ashift >> 3), mask_offsets); - const __m256i alpha_fill_mask = _mm256_set1_epi32((int)dstfmt->Amask); - - while (height--) { - int i = 0; - - for (; i + 8 <= width; i += 8) { - // Load 8 src pixels - __m256i src256 = _mm256_loadu_si256((__m256i *)src); - - // Load 8 dst pixels - __m256i dst256 = _mm256_loadu_si256((__m256i *)dst); - - // Extract the alpha from each pixel and splat it into all the channels - __m256i srcA = _mm256_shuffle_epi8(src256, alpha_splat_mask); - - // Convert to dst format - src256 = _mm256_shuffle_epi8(src256, convert_mask); - - // Set the alpha channels of src to 255 - src256 = _mm256_or_si256(src256, alpha_fill_mask); - - __m256i src_lo = _mm256_unpacklo_epi8(src256, _mm256_setzero_si256()); - __m256i src_hi = _mm256_unpackhi_epi8(src256, _mm256_setzero_si256()); - - __m256i dst_lo = _mm256_unpacklo_epi8(dst256, _mm256_setzero_si256()); - __m256i dst_hi = _mm256_unpackhi_epi8(dst256, _mm256_setzero_si256()); - - __m256i srca_lo = _mm256_unpacklo_epi8(srcA, _mm256_setzero_si256()); - __m256i srca_hi = _mm256_unpackhi_epi8(srcA, _mm256_setzero_si256()); - - // dst = ((src - dst) * srcA) + ((dst << 8) - dst) - dst_lo = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_lo, dst_lo), srca_lo), - _mm256_sub_epi16(_mm256_slli_epi16(dst_lo, 8), dst_lo)); - dst_hi = _mm256_add_epi16(_mm256_mullo_epi16(_mm256_sub_epi16(src_hi, dst_hi), srca_hi), - _mm256_sub_epi16(_mm256_slli_epi16(dst_hi, 8), dst_hi)); - - // dst += 0x1U (use 0x80 to round instead of floor) - dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1)); - dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1)); - - // dst += dst >> 8 - dst_lo = _mm256_srli_epi16(_mm256_add_epi16(dst_lo, _mm256_srli_epi16(dst_lo, 8)), 8); - dst_hi = _mm256_srli_epi16(_mm256_add_epi16(dst_hi, _mm256_srli_epi16(dst_hi, 8)), 8); - - // Blend the pixels together and save the result - _mm256_storeu_si256((__m256i *)dst, _mm256_packus_epi16(dst_lo, dst_hi)); - - src += 32; - dst += 32; - } - - for (; i < width; ++i) { - Uint32 src32 = *(Uint32 *)src; - Uint32 dst32 = *(Uint32 *)dst; - - Uint32 srcA = (src32 >> srcfmt->Ashift) & 0xFF; - - src32 = (((src32 >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | - (((src32 >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | - (((src32 >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | - dstfmt->Amask; - - Uint32 srcRB = src32 & 0x00FF00FF; - Uint32 dstRB = dst32 & 0x00FF00FF; - - Uint32 srcGA = (src32 >> 8) & 0x00FF00FF; - Uint32 dstGA = (dst32 >> 8) & 0x00FF00FF; - - Uint32 resRB = ((srcRB - dstRB) * srcA) + (dstRB << 8) - dstRB; - resRB += 0x00010001; - resRB += (resRB >> 8) & 0x00FF00FF; - resRB = (resRB >> 8) & 0x00FF00FF; - - Uint32 resGA = ((srcGA - dstGA) * srcA) + (dstGA << 8) - dstGA; - resGA += 0x00010001; - resGA += (resGA >> 8) & 0x00FF00FF; - resGA &= 0xFF00FF00; - dst32 = resRB | resGA; - - *(Uint32 *)dst = dst32; - - src += 4; - dst += 4; - } - - src += srcskip; - dst += dstskip; - } -} - -#endif - -#endif diff --git a/src/video/SDL_blit_A_avx2.h b/src/video/SDL_blit_A_avx2.h deleted file mode 100644 index 61eab95424171..0000000000000 --- a/src/video/SDL_blit_A_avx2.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef SDL_SDL_BLIT_A_AVX2_H -#define SDL_SDL_BLIT_A_AVX2_H -void SDL_TARGETING("avx2") BlitNtoNPixelAlpha_AVX2(SDL_BlitInfo *info); -#endif //SDL_SDL_BLIT_A_AVX2_H diff --git a/src/video/SDL_blit_A_sse4_1.c b/src/video/SDL_blit_A_sse4_1.c deleted file mode 100644 index 425f5f028194b..0000000000000 --- a/src/video/SDL_blit_A_sse4_1.c +++ /dev/null @@ -1,124 +0,0 @@ -#include "SDL_internal.h" - -#if SDL_HAVE_BLIT_A - -#ifdef SDL_SSE4_1_INTRINSICS - -#include "SDL_blit.h" - -void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info) -{ - int width = info->dst_w; - int height = info->dst_h; - Uint8 *src = info->src; - int srcskip = info->src_skip; - Uint8 *dst = info->dst; - int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; - - // The byte offsets for the start of each pixel - const __m128i mask_offsets = _mm_set_epi8( - 12, 12, 12, 12, 8, 8, 8, 8, 4, 4, 4, 4, 0, 0, 0, 0); - - const __m128i convert_mask = _mm_add_epi32( - _mm_set1_epi32( - ((srcfmt->Rshift >> 3) << dstfmt->Rshift) | - ((srcfmt->Gshift >> 3) << dstfmt->Gshift) | - ((srcfmt->Bshift >> 3) << dstfmt->Bshift)), - mask_offsets); - - const __m128i alpha_splat_mask = _mm_add_epi8(_mm_set1_epi8(srcfmt->Ashift >> 3), mask_offsets); - const __m128i alpha_fill_mask = _mm_set1_epi32((int)dstfmt->Amask); - - while (height--) { - int i = 0; - - for (; i + 4 <= width; i += 4) { - // Load 4 src pixels - __m128i src128 = _mm_loadu_si128((__m128i *)src); - - // Load 4 dst pixels - __m128i dst128 = _mm_loadu_si128((__m128i *)dst); - - // Extract the alpha from each pixel and splat it into all the channels - __m128i srcA = _mm_shuffle_epi8(src128, alpha_splat_mask); - - // Convert to dst format - src128 = _mm_shuffle_epi8(src128, convert_mask); - - // Set the alpha channels of src to 255 - src128 = _mm_or_si128(src128, alpha_fill_mask); - - __m128i src_lo = _mm_unpacklo_epi8(src128, _mm_setzero_si128()); - __m128i src_hi = _mm_unpackhi_epi8(src128, _mm_setzero_si128()); - - __m128i dst_lo = _mm_unpacklo_epi8(dst128, _mm_setzero_si128()); - __m128i dst_hi = _mm_unpackhi_epi8(dst128, _mm_setzero_si128()); - - __m128i srca_lo = _mm_unpacklo_epi8(srcA, _mm_setzero_si128()); - __m128i srca_hi = _mm_unpackhi_epi8(srcA, _mm_setzero_si128()); - - // dst = ((src - dst) * srcA) + ((dst << 8) - dst) - dst_lo = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_lo, dst_lo), srca_lo), - _mm_sub_epi16(_mm_slli_epi16(dst_lo, 8), dst_lo)); - dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srca_hi), - _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); - - // dst += 0x1U (use 0x80 to round instead of floor) - dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); - dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); - - // dst += dst >> 8 - dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); - dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); - - // Blend the pixels together and save the result - _mm_storeu_si128((__m128i *)dst, _mm_packus_epi16(dst_lo, dst_hi)); - - src += 16; - dst += 16; - } - - for (; i < width; ++i) { - Uint32 src32 = *(Uint32 *)src; - Uint32 dst32 = *(Uint32 *)dst; - - Uint32 srcA = (src32 >> srcfmt->Ashift) & 0xFF; - - src32 = (((src32 >> srcfmt->Rshift) & 0xFF) << dstfmt->Rshift) | - (((src32 >> srcfmt->Gshift) & 0xFF) << dstfmt->Gshift) | - (((src32 >> srcfmt->Bshift) & 0xFF) << dstfmt->Bshift) | - dstfmt->Amask; - - Uint32 srcRB = src32 & 0x00FF00FF; - Uint32 dstRB = dst32 & 0x00FF00FF; - - Uint32 srcGA = (src32 >> 8) & 0x00FF00FF; - Uint32 dstGA = (dst32 >> 8) & 0x00FF00FF; - - Uint32 resRB = ((srcRB - dstRB) * srcA) + (dstRB << 8) - dstRB; - resRB += 0x00010001; - resRB += (resRB >> 8) & 0x00FF00FF; - resRB = (resRB >> 8) & 0x00FF00FF; - - Uint32 resGA = ((srcGA - dstGA) * srcA) + (dstGA << 8) - dstGA; - resGA += 0x00010001; - resGA += (resGA >> 8) & 0x00FF00FF; - resGA &= 0xFF00FF00; - dst32 = resRB | resGA; - - *(Uint32 *)dst = dst32; - - src += 4; - dst += 4; - } - - src += srcskip; - dst += dstskip; - } -} - -#endif - -#endif diff --git a/src/video/SDL_blit_A_sse4_1.h b/src/video/SDL_blit_A_sse4_1.h deleted file mode 100644 index 56c5907cbe8ce..0000000000000 --- a/src/video/SDL_blit_A_sse4_1.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef SDL_SDL_BLIT_A_SSE4_1_H -#define SDL_SDL_BLIT_A_SSE4_1_H -void SDL_TARGETING("sse4.1") BlitNtoNPixelAlpha_SSE4_1(SDL_BlitInfo *info); -#endif //SDL_SDL_BLIT_A_SSE4_1_H From d37f8fa2b3ad865b23bc6c15f2d11c6bce70b4cd Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Mon, 8 Jul 2024 20:21:48 +0100 Subject: [PATCH 221/431] Optimize BlitRGBtoRGBSurfaceAlpha --- src/video/SDL_blit_A.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index 51f1076547e87..d8d6d80c7f9d5 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -364,18 +364,10 @@ static void BlitRGBtoRGBSurfaceAlpha(SDL_BlitInfo *info) DUFFS_LOOP4({ s = *srcp; d = *dstp; - Uint8 sR = (s >> 16) & 0xFF; - Uint8 sG = (s >> 8) & 0xFF; - Uint8 sB = s & 0xFF; - Uint8 dR = (d >> 16) & 0xFF; - Uint8 dG = (d >> 8) & 0xFF; - Uint8 dB = d & 0xFF; - - ALPHA_BLEND_CHANNEL(sR, dR, alpha); - ALPHA_BLEND_CHANNEL(sG, dG, alpha); - ALPHA_BLEND_CHANNEL(sB, dB, alpha); - - *dstp = (dR << 16) | (dG << 8) | dB | 0xFF000000; + + FACTOR_BLEND_8888(s, d, alpha); + + *dstp = d | 0xff000000; ++srcp; ++dstp; }, width); From d6045551420788a1ed2340182ec03907d2f4ce0e Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Sun, 7 Jul 2024 00:24:25 +0100 Subject: [PATCH 222/431] Replace BlitRGBtoRGBSurfaceAlphaMMX --- src/video/SDL_blit_A.c | 184 ++++++++++++----------------------------- 1 file changed, 53 insertions(+), 131 deletions(-) diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index d8d6d80c7f9d5..d87e752478a72 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -166,158 +166,80 @@ static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) } } -#ifdef SDL_MMX_INTRINSICS +#ifdef SDL_SSE2_INTRINSICS -/* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ -static void SDL_TARGETING("mmx") BlitRGBtoRGBSurfaceAlpha128MMX(SDL_BlitInfo *info) +static void SDL_TARGETING("sse2") Blit888to888SurfaceAlphaSSE2(SDL_BlitInfo *info) { int width = info->dst_w; int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *)info->dst; - int dstskip = info->dst_skip >> 2; - Uint32 dalpha = info->dst_fmt->Amask; - - __m64 src1, src2, dst1, dst2, lmask, hmask, dsta; + Uint8 *src = info->src; + int srcskip = info->src_skip; + Uint8 *dst = info->dst; + int dstskip = info->dst_skip; + Uint8 alpha = info->a; - 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 */ + const __m128i alpha_fill_mask = _mm_set1_epi32((int)0xff000000); + const __m128i srcA = _mm_set1_epi16(alpha); 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(); -} + int i = 0; -/* fast RGB888->(A)RGB888 blending with surface alpha */ -static void SDL_TARGETING("mmx") BlitRGBtoRGBSurfaceAlphaMMX(SDL_BlitInfo *info) -{ - SDL_PixelFormat *df = info->dst_fmt; - Uint32 chanmask; - unsigned alpha = info->a; + for (; i + 4 <= width; i += 4) { + // Load 4 src pixels + __m128i src128 = _mm_loadu_si128((__m128i *)src); - if (alpha == 128 && (df->Rmask | df->Gmask | df->Bmask) == 0x00FFFFFF) { - /* only call a128 version when R,G,B occupy lower bits */ - BlitRGBtoRGBSurfaceAlpha128MMX(info); - } else { - int width = info->dst_w; - int height = info->dst_h; - Uint32 *srcp = (Uint32 *)info->src; - int srcskip = info->src_skip >> 2; - Uint32 *dstp = (Uint32 *)info->dst; - int dstskip = info->dst_skip >> 2; - Uint32 dalpha = df->Amask; - Uint32 amult; - - __m64 src1, src2, dst1, dst2, mm_alpha, mm_zero, dsta; - - mm_zero = _mm_setzero_si64(); /* 0 -> mm_zero */ - /* form the alpha mult */ - amult = alpha | (alpha << 8); - amult = amult | (amult << 16); - chanmask = - (0xff << df->Rshift) | (0xff << df->Gshift) | (0xff << df->Bshift); - mm_alpha = _mm_set_pi32(0, amult & chanmask); /* 0000AAAA -> mm_alpha, minus 1 chan */ - mm_alpha = _mm_unpacklo_pi8(mm_alpha, mm_zero); /* 0A0A0A0A -> mm_alpha, minus 1 chan */ - /* at this point mm_alpha can be 000A0A0A or 0A0A0A00 or another combo */ - dsta = _mm_set_pi32(dalpha, dalpha); /* dst alpha mask -> dsta */ + // Load 4 dst pixels + __m128i dst128 = _mm_loadu_si128((__m128i *)dst); - 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 */ + __m128i src_lo = _mm_unpacklo_epi8(src128, _mm_setzero_si128()); + __m128i src_hi = _mm_unpackhi_epi8(src128, _mm_setzero_si128()); - dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */ - dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */ + __m128i dst_lo = _mm_unpacklo_epi8(dst128, _mm_setzero_si128()); + __m128i dst_hi = _mm_unpackhi_epi8(dst128, _mm_setzero_si128()); - 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 */ + // dst = ((src - dst) * srcA) + ((dst << 8) - dst) + dst_lo = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_lo, dst_lo), srcA), + _mm_sub_epi16(_mm_slli_epi16(dst_lo, 8), dst_lo)); + dst_hi = _mm_add_epi16(_mm_mullo_epi16(_mm_sub_epi16(src_hi, dst_hi), srcA), + _mm_sub_epi16(_mm_slli_epi16(dst_hi, 8), dst_hi)); - 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 */ + // dst += 0x1U (use 0x80 to round instead of floor) + dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); + dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); - ++srcp; - ++dstp; + // dst = (dst + (dst >> 8)) >> 8 + dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); + dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); - n--; - } + dst128 = _mm_packus_epi16(dst_lo, dst_hi); - 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 */ + // Set the alpha channels of dst to 255 + dst128 = _mm_or_si128(dst128, alpha_fill_mask); - 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 */ + _mm_storeu_si128((__m128i *)dst, dst128); - 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 */ + src += 16; + dst += 16; + } - 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 */ + for (; i < width; ++i) { + Uint32 src32 = *(Uint32 *)src; + Uint32 dst32 = *(Uint32 *)dst; - dst1 = _mm_packs_pu16(dst1, dst2); /* 0A0R0G0B(res1), 0A0R0G0B(res2) -> dst1(ARGBARGB) */ - dst1 = _mm_or_si64(dst1, dsta); /* dsta | dst1 -> dst1 */ + FACTOR_BLEND_8888(src32, dst32, alpha); - *(__m64 *)dstp = dst1; /* dst1 -> 2 x pixel */ + *dst = dst32 | 0xff000000; - srcp += 2; - dstp += 2; - } - srcp += srcskip; - dstp += dstskip; + src += 4; + dst += 4; } - _mm_empty(); + + src += srcskip; + dst += dstskip; } } -#endif /* SDL_MMX_INTRINSICS */ +#endif /* fast RGB888->(A)RGB888 blending with surface alpha=128 special case */ static void BlitRGBtoRGBSurfaceAlpha128(SDL_BlitInfo *info) @@ -1133,7 +1055,7 @@ static void SDL_TARGETING("sse4.1") Blit8888to8888PixelAlphaSwizzleSSE41(SDL_Bli dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1)); dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1)); - // dst += dst >> 8 + // dst = (dst + (dst >> 8)) >> 8 dst_lo = _mm_srli_epi16(_mm_add_epi16(dst_lo, _mm_srli_epi16(dst_lo, 8)), 8); dst_hi = _mm_srli_epi16(_mm_add_epi16(dst_hi, _mm_srli_epi16(dst_hi, 8)), 8); @@ -1225,7 +1147,7 @@ static void SDL_TARGETING("avx2") Blit8888to8888PixelAlphaSwizzleAVX2(SDL_BlitIn dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1)); dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1)); - // dst += dst >> 8 + // dst = (dst + (dst >> 8)) >> 8 dst_lo = _mm256_srli_epi16(_mm256_add_epi16(dst_lo, _mm256_srli_epi16(dst_lo, 8)), 8); dst_hi = _mm256_srli_epi16(_mm256_add_epi16(dst_hi, _mm256_srli_epi16(dst_hi, 8)), 8); @@ -1384,9 +1306,9 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) case 4: if (sf->Rmask == df->Rmask && sf->Gmask == df->Gmask && sf->Bmask == df->Bmask && sf->bytes_per_pixel == 4) { -#ifdef SDL_MMX_INTRINSICS - if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && SDL_HasMMX()) { - return BlitRGBtoRGBSurfaceAlphaMMX; +#ifdef SDL_SSE2_INTRINSICS + if (sf->Rshift % 8 == 0 && sf->Gshift % 8 == 0 && sf->Bshift % 8 == 0 && SDL_HasSSE2()) { + return Blit888to888SurfaceAlphaSSE2; } #endif if ((sf->Rmask | sf->Gmask | sf->Bmask) == 0xffffff) { From 40ed098ce8a0a4583250fa24b34f2045264a6d33 Mon Sep 17 00:00:00 2001 From: Brick <6098371+0x1F9F1@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:16:58 +0100 Subject: [PATCH 223/431] Improve the bucket distribution of SDL_HashTable SDL_HashID does no hashing, which isn't good if the lower bits of the key aren't evenly distributed. --- src/SDL_hashtable.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/SDL_hashtable.c b/src/SDL_hashtable.c index fc7a44791c9a4..b57aff267c64e 100644 --- a/src/SDL_hashtable.c +++ b/src/SDL_hashtable.c @@ -32,6 +32,7 @@ struct SDL_HashTable { SDL_HashItem **table; Uint32 table_len; + int hash_shift; SDL_bool stackable; void *data; SDL_HashTable_HashFn hash; @@ -46,8 +47,9 @@ SDL_HashTable *SDL_CreateHashTable(void *data, const Uint32 num_buckets, const S { SDL_HashTable *table; - // num_buckets must be a power of two so we get a solid block of bits to mask hash values against. - if ((num_buckets == 0) || ((num_buckets & (num_buckets - 1)) != 0)) { + // num_buckets must be a power of two so we can derive the bucket index with just a bitshift. + // Need at least two buckets, otherwise hash_shift would be 32, which is UB! + if ((num_buckets < 2) || !SDL_HasExactlyOneBitSet32(num_buckets)) { SDL_SetError("num_buckets must be a power of two"); return NULL; } @@ -64,6 +66,7 @@ SDL_HashTable *SDL_CreateHashTable(void *data, const Uint32 num_buckets, const S } table->table_len = num_buckets; + table->hash_shift = 32 - SDL_MostSignificantBitIndex32(num_buckets); table->stackable = stackable; table->data = data; table->hash = hashfn; @@ -74,7 +77,9 @@ SDL_HashTable *SDL_CreateHashTable(void *data, const Uint32 num_buckets, const S static SDL_INLINE Uint32 calc_hash(const SDL_HashTable *table, const void *key) { - return table->hash(key, table->data) & (table->table_len - 1); + // Mix the bits together, and use the highest bits as the bucket index. + const Uint32 BitMixer = 0x9E3779B1u; + return (table->hash(key, table->data) * BitMixer) >> table->hash_shift; } From 2ba76dbe803f8e76ee02f15e80d6dda3d9177845 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 8 Jul 2024 14:59:18 -0700 Subject: [PATCH 224/431] Simplified SDL_Surface SDL_Surface has been simplified and internal details are no longer in the public structure. The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect(). SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types. SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value. SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups. --- VisualC-GDK/SDL/SDL.vcxproj | 3 +- VisualC-GDK/SDL/SDL.vcxproj.filters | 3 +- VisualC-WinRT/SDL-UWP.vcxproj | 3 +- VisualC-WinRT/SDL-UWP.vcxproj.filters | 5 +- VisualC/SDL/SDL.vcxproj | 1 + VisualC/SDL/SDL.vcxproj.filters | 5 +- build-scripts/SDL_migration.cocci | 29 +- cmake/test/main_gui.c | 2 +- docs/README-migration.md | 55 +- include/SDL3/SDL_camera.h | 2 +- include/SDL3/SDL_oldnames.h | 20 +- include/SDL3/SDL_pixels.h | 167 ++-- include/SDL3/SDL_render.h | 11 +- include/SDL3/SDL_surface.h | 218 +++-- include/SDL3/SDL_video.h | 2 +- src/SDL.c | 3 + src/SDL_hashtable.c | 5 + src/SDL_hashtable.h | 40 +- src/camera/SDL_camera.c | 22 +- src/camera/SDL_syscamera.h | 2 +- src/camera/android/SDL_camera_android.c | 6 +- src/camera/coremedia/SDL_camera_coremedia.m | 6 +- .../SDL_camera_mediafoundation.c | 8 +- src/camera/pipewire/SDL_camera_pipewire.c | 12 +- src/camera/v4l2/SDL_camera_v4l2.c | 8 +- src/dynapi/SDL_dynapi.sym | 12 +- src/dynapi/SDL_dynapi_overrides.h | 15 +- src/dynapi/SDL_dynapi_procs.h | 42 +- src/events/SDL_mouse.c | 4 +- src/render/SDL_render.c | 61 +- src/render/SDL_sysrender.h | 6 +- src/render/SDL_yuv_sw.c | 6 +- src/render/SDL_yuv_sw_c.h | 8 +- src/render/direct3d/SDL_render_d3d.c | 2 +- src/render/direct3d11/SDL_render_d3d11.c | 2 +- src/render/direct3d12/SDL_render_d3d12.c | 2 +- src/render/opengl/SDL_render_gl.c | 2 +- src/render/opengles2/SDL_render_gles2.c | 2 +- src/render/software/SDL_blendfillrect.c | 42 +- src/render/software/SDL_blendline.c | 20 +- src/render/software/SDL_blendpoint.c | 50 +- src/render/software/SDL_draw.h | 8 +- src/render/software/SDL_drawline.c | 24 +- src/render/software/SDL_drawpoint.c | 26 +- src/render/software/SDL_render_sw.c | 54 +- src/render/software/SDL_rotate.c | 25 +- src/render/software/SDL_triangle.c | 47 +- src/render/vulkan/SDL_render_vulkan.c | 2 +- src/test/SDL_test_common.c | 10 +- src/test/SDL_test_compare.c | 15 +- src/video/SDL_RLEaccel.c | 188 ++-- src/video/SDL_blit.c | 51 +- src/video/SDL_blit.h | 55 +- src/video/SDL_blit_0.c | 25 +- src/video/SDL_blit_1.c | 19 +- src/video/SDL_blit_A.c | 70 +- src/video/SDL_blit_N.c | 84 +- src/video/SDL_blit_slow.c | 34 +- src/video/SDL_bmp.c | 52 +- src/video/SDL_fillrect.c | 16 +- src/video/SDL_pixels.c | 466 +++++---- src/video/SDL_pixels_c.h | 25 +- src/video/SDL_stretch.c | 22 +- src/video/SDL_surface.c | 894 +++++++++--------- src/video/SDL_surface_c.h | 80 ++ src/video/SDL_sysvideo.h | 2 +- src/video/SDL_video.c | 24 +- src/video/SDL_yuv.c | 52 +- src/video/SDL_yuv_c.h | 8 +- src/video/android/SDL_androidmouse.c | 2 +- src/video/cocoa/SDL_cocoavideo.m | 4 +- src/video/dummy/SDL_nullframebuffer.c | 4 +- src/video/dummy/SDL_nullframebuffer_c.h | 2 +- .../emscripten/SDL_emscriptenframebuffer.c | 4 +- .../emscripten/SDL_emscriptenframebuffer.h | 2 +- src/video/emscripten/SDL_emscriptenmouse.c | 2 +- src/video/haiku/SDL_bframebuffer.cc | 2 +- src/video/haiku/SDL_bframebuffer.h | 2 +- src/video/haiku/SDL_bmodes.cc | 2 +- src/video/haiku/SDL_bmodes.h | 2 +- src/video/haiku/SDL_bvideo.cc | 2 +- src/video/kmsdrm/SDL_kmsdrmmouse.c | 2 +- src/video/n3ds/SDL_n3dsframebuffer.c | 6 +- src/video/n3ds/SDL_n3dsframebuffer_c.h | 2 +- src/video/n3ds/SDL_n3dsvideo.c | 2 +- src/video/ngage/SDL_ngageframebuffer.cpp | 4 +- src/video/ngage/SDL_ngageframebuffer_c.h | 2 +- .../offscreen/SDL_offscreenframebuffer.c | 4 +- .../offscreen/SDL_offscreenframebuffer_c.h | 2 +- src/video/qnx/SDL_qnxvideo.c | 2 +- src/video/raspberry/SDL_rpimouse.c | 2 +- src/video/riscos/SDL_riscosframebuffer.c | 2 +- src/video/riscos/SDL_riscosframebuffer_c.h | 2 +- src/video/riscos/SDL_riscosmodes.c | 4 +- src/video/vita/SDL_vitaframebuffer.c | 2 +- src/video/vita/SDL_vitaframebuffer.h | 2 +- src/video/wayland/SDL_waylandmouse.c | 2 +- src/video/windows/SDL_windowsframebuffer.c | 4 +- src/video/windows/SDL_windowsframebuffer.h | 2 +- src/video/windows/SDL_windowsmouse.c | 6 +- src/video/windows/SDL_windowswindow.c | 2 +- src/video/winrt/SDL_winrtvideo.cpp | 2 +- src/video/x11/SDL_x11framebuffer.c | 2 +- src/video/x11/SDL_x11framebuffer.h | 2 +- src/video/x11/SDL_x11modes.c | 4 +- src/video/x11/SDL_x11modes.h | 2 +- src/video/x11/SDL_x11mouse.c | 4 +- src/video/x11/SDL_x11window.c | 2 +- test/testautomation_blit.c | 10 +- test/testautomation_images.c | 68 +- test/testautomation_pixels.c | 46 +- test/testautomation_render.c | 4 +- test/testautomation_surface.c | 106 +-- test/testcamera.c | 5 +- test/testcustomcursor.c | 8 +- test/testffmpeg.c | 12 +- test/testgles2_sdf.c | 2 +- test/testoverlay.c | 2 +- test/testshape.c | 4 +- test/testspriteminimal.c | 2 +- test/testutils.c | 8 +- test/testwaylandcustom.c | 2 +- test/testyuv.c | 22 +- 123 files changed, 1862 insertions(+), 1835 deletions(-) create mode 100644 src/video/SDL_surface_c.h diff --git a/VisualC-GDK/SDL/SDL.vcxproj b/VisualC-GDK/SDL/SDL.vcxproj index 28fdc639ff8f2..e136005281e9d 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj +++ b/VisualC-GDK/SDL/SDL.vcxproj @@ -558,6 +558,7 @@ + @@ -863,4 +864,4 @@ - \ No newline at end of file + diff --git a/VisualC-GDK/SDL/SDL.vcxproj.filters b/VisualC-GDK/SDL/SDL.vcxproj.filters index 069e3bd14afd7..4260bfcd900a9 100644 --- a/VisualC-GDK/SDL/SDL.vcxproj.filters +++ b/VisualC-GDK/SDL/SDL.vcxproj.filters @@ -436,6 +436,7 @@ + @@ -462,4 +463,4 @@ - \ No newline at end of file + diff --git a/VisualC-WinRT/SDL-UWP.vcxproj b/VisualC-WinRT/SDL-UWP.vcxproj index 32966b4fedbc6..a80d0924bab2a 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj +++ b/VisualC-WinRT/SDL-UWP.vcxproj @@ -185,6 +185,7 @@ + @@ -917,4 +918,4 @@ - \ No newline at end of file + diff --git a/VisualC-WinRT/SDL-UWP.vcxproj.filters b/VisualC-WinRT/SDL-UWP.vcxproj.filters index 46d67b1459878..e57ee7174426e 100644 --- a/VisualC-WinRT/SDL-UWP.vcxproj.filters +++ b/VisualC-WinRT/SDL-UWP.vcxproj.filters @@ -438,6 +438,9 @@ Source Files + + Source Files + Source Files @@ -973,4 +976,4 @@ Source Files - \ No newline at end of file + diff --git a/VisualC/SDL/SDL.vcxproj b/VisualC/SDL/SDL.vcxproj index 879c607e8dd80..3a7f523d9f907 100644 --- a/VisualC/SDL/SDL.vcxproj +++ b/VisualC/SDL/SDL.vcxproj @@ -464,6 +464,7 @@ + diff --git a/VisualC/SDL/SDL.vcxproj.filters b/VisualC/SDL/SDL.vcxproj.filters index faa6a9d55598d..24579a58ebcb0 100644 --- a/VisualC/SDL/SDL.vcxproj.filters +++ b/VisualC/SDL/SDL.vcxproj.filters @@ -615,6 +615,9 @@ video + + video + video @@ -1554,4 +1557,4 @@ - \ No newline at end of file + diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index fef3d353644c9..67fa06af3d87e 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -1566,7 +1566,7 @@ typedef SDL_GameControllerButton, SDL_GamepadButton; @@ @@ - SDL_AllocFormat -+ SDL_CreatePixelFormat ++ SDL_GetPixelFormatDetails (...) @@ @@ @@ -1575,23 +1575,18 @@ typedef SDL_GameControllerButton, SDL_GamepadButton; (...) @@ @@ -- SDL_FreeFormat -+ SDL_DestroyPixelFormat - (...) -@@ -@@ - SDL_FreePalette + SDL_DestroyPalette (...) @@ @@ - SDL_MasksToPixelFormatEnum -+ SDL_GetPixelFormatEnumForMasks ++ SDL_GetPixelFormatForMasks (...) @@ @@ - SDL_PixelFormatEnumToMasks -+ SDL_GetMasksForPixelFormatEnum ++ SDL_GetMasksForPixelFormat (...) @@ @@ @@ -3488,3 +3483,21 @@ typedef SDL_Colour, SDL_Color; @@ - SDLK_z + SDLK_Z +@@ +typedef SDL_PixelFormat, SDL_PackedPixelDetails; +@@ +- SDL_PixelFormat ++ SDL_PixelFormatDetails +@@ +@@ +- SDL_ConvertSurfaceFormat ++ SDL_ConvertSurface + (...) +@@ +@@ +- SDL_PREALLOC ++ SDL_SURFACE_PREALLOCATED +@@ +@@ +- SDL_SIMD_ALIGNED ++ SDL_SURFACE_SIMD_ALIGNED diff --git a/cmake/test/main_gui.c b/cmake/test/main_gui.c index c8cc03c1289b1..016573847141d 100644 --- a/cmake/test/main_gui.c +++ b/cmake/test/main_gui.c @@ -15,7 +15,7 @@ int main(int argc, char *argv[]) return 1; } screenSurface = SDL_GetWindowSurface(window); - SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapRGB(screenSurface->format, 0xff, 0xff, 0xff)); + SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapSurfaceRGB(screenSurface, 0xff, 0xff, 0xff)); SDL_UpdateWindowSurface(window); SDL_Delay(100); SDL_DestroyWindow(window); diff --git a/docs/README-migration.md b/docs/README-migration.md index 61411ded21e6e..526b4e15b4435 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1092,19 +1092,22 @@ The following symbols have been renamed: ## SDL_pixels.h -SDL_CalculateGammaRamp has been removed, because SDL_SetWindowGammaRamp has been removed as well due to poor support in modern operating systems (see [SDL_video.h](#sdl_videoh)). +SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types. + +SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value. -The BitsPerPixel and BytesPerPixel fields of SDL_PixelFormat have been renamed bits_per_pixel and bytes_per_pixel. +SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups. -SDL_PixelFormatEnum is used instead of Uint32 for API functions that refer to pixel format by enumerated value. +SDL_GetMasksForPixelFormat() now returns the standard int error code. + +SDL_CalculateGammaRamp has been removed, because SDL_SetWindowGammaRamp has been removed as well due to poor support in modern operating systems (see [SDL_video.h](#sdl_videoh)). The following functions have been renamed: -* SDL_AllocFormat() => SDL_CreatePixelFormat() +* SDL_AllocFormat() => SDL_GetPixelFormatDetails() * SDL_AllocPalette() => SDL_CreatePalette() -* SDL_FreeFormat() => SDL_DestroyPixelFormat() * SDL_FreePalette() => SDL_DestroyPalette() -* SDL_MasksToPixelFormatEnum() => SDL_GetPixelFormatEnumForMasks() -* SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormatEnum() +* SDL_MasksToPixelFormatEnum() => SDL_GetPixelFormatForMasks() +* SDL_PixelFormatEnumToMasks() => SDL_GetMasksForPixelFormat() The following symbols have been renamed: * SDL_PIXELFORMAT_BGR444 => SDL_PIXELFORMAT_XBGR4444 @@ -1114,9 +1117,16 @@ The following symbols have been renamed: * SDL_PIXELFORMAT_RGB555 => SDL_PIXELFORMAT_XRGB1555 * SDL_PIXELFORMAT_RGB888 => SDL_PIXELFORMAT_XRGB8888 +The following functions have been removed: +* SDL_FreeFormat() +* SDL_SetPixelFormatPalette() + The following macros have been removed: * SDL_Colour - use SDL_Color instead +The following structures have been renamed: +* SDL_PixelFormat => SDL_PixelFormatDetails + ## SDL_platform.h The following platform preprocessor macros have been renamed: @@ -1598,19 +1608,23 @@ The following functions have been removed: ## SDL_surface.h +SDL_Surface has been simplified and internal details are no longer in the public structure. + +The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect(). + The userdata member of SDL_Surface has been replaced with a more general properties interface, which can be queried with SDL_GetSurfaceProperties() -Removed unused 'flags' parameter from SDL_ConvertSurface and SDL_ConvertSurfaceFormat. +Removed the unused 'flags' parameter from SDL_ConvertSurface. SDL_CreateRGBSurface() and SDL_CreateRGBSurfaceWithFormat() have been combined into a new function SDL_CreateSurface(). -SDL_CreateRGBSurfaceFrom() and SDL_CreateRGBSurfaceWithFormatFrom() have been combined into a new function SDL_CreateSurfaceFrom(). +SDL_CreateRGBSurfaceFrom() and SDL_CreateRGBSurfaceWithFormatFrom() have been combined into a new function SDL_CreateSurfaceFrom(), and the parameter order has changed for consistency with SDL_CreateSurface(). You can implement the old functions in your own code easily: ```c SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { return SDL_CreateSurface(width, height, - SDL_GetPixelFormatEnumForMasks(depth, Rmask, Gmask, Bmask, Amask)); + SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask)); } SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, int depth, Uint32 format) @@ -1620,13 +1634,14 @@ SDL_Surface *SDL_CreateRGBSurfaceWithFormat(Uint32 flags, int width, int height, SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { - return SDL_CreateSurfaceFrom(pixels, width, height, pitch, - SDL_GetPixelFormatEnumForMasks(depth, Rmask, Gmask, Bmask, Amask)); + return SDL_CreateSurfaceFrom(width, height, + SDL_GetPixelFormatForMasks(depth, Rmask, Gmask, Bmask, Amask), + pixels, pitch); } SDL_Surface *SDL_CreateRGBSurfaceWithFormatFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 format) { - return SDL_CreateSurfaceFrom(pixels, width, height, pitch, format); + return SDL_CreateSurfaceFrom(width, height, format, pixels, pitch); } ``` @@ -1645,10 +1660,15 @@ SDL_BlitSurfaceScaled() and SDL_BlitSurfaceUncheckedScaled() now take a scale pa SDL_SoftStretch() now takes a scale paramater. -SDL_PixelFormatEnum is used instead of Uint32 for API functions that refer to pixel format by enumerated value. +SDL_PixelFormat is used instead of Uint32 for API functions that refer to pixel format by enumerated value. + +SDL_SetSurfaceColorKey() takes an SDL_bool to enable and disable colorkey. RLE acceleration isn't controlled by the parameter, you should use SDL_SetSurfaceRLE() to change that separately. + +SDL_SetSurfaceRLE() takes an SDL_bool to enable and disable RLE acceleration. The following functions have been renamed: * SDL_BlitScaled() => SDL_BlitSurfaceScaled() +* SDL_ConvertSurfaceFormat() => SDL_ConvertSurface() * SDL_FillRect() => SDL_FillSurfaceRect() * SDL_FillRects() => SDL_FillSurfaceRects() * SDL_FreeSurface() => SDL_DestroySurface() @@ -1669,11 +1689,16 @@ The following symbols have been removed: * SDL_SWSURFACE The following functions have been removed: +* SDL_FreeFormat() * SDL_GetYUVConversionMode() * SDL_GetYUVConversionModeForResolution() * SDL_SetYUVConversionMode() - use SDL_SetSurfaceColorspace() to set the surface colorspace and SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER with SDL_CreateTextureWithProperties() to set the texture colorspace. The default colorspace for YUV pixel formats is SDL_COLORSPACE_JPEG. * SDL_SoftStretchLinear() - use SDL_SoftStretch() with SDL_SCALEMODE_LINEAR +The following symbols have been renamed: +* SDL_PREALLOC => SDL_SURFACE_PREALLOCATED +* SDL_SIMD_ALIGNED => SDL_SURFACE_SIMD_ALIGNED + ## SDL_system.h SDL_WindowsMessageHook has changed signatures so the message may be modified and it can block further message processing. @@ -1835,7 +1860,7 @@ The callback passed to SDL_AddTimer() has changed parameters to: Uint32 SDLCALL TimerCallback(void *userdata, SDL_TimerID timerID, Uint32 interval); ```` -The return value of SDL_RemoveTimer() has changed to the standard int error code. +SDL_RemoveTimer() now returns the standard int error code. ## SDL_touch.h diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index de8e1358b96eb..f7468426f4650 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -78,7 +78,7 @@ typedef struct SDL_Camera SDL_Camera; */ typedef struct SDL_CameraSpec { - SDL_PixelFormatEnum format; /**< Frame format */ + SDL_PixelFormat format; /**< Frame format */ SDL_Colorspace colorspace; /**< Frame colorspace */ int width; /**< Frame width */ int height; /**< Frame height */ diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 7d1bf8360e0e4..c9abf8147633e 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -453,19 +453,18 @@ #define SDL_sem SDL_Semaphore /* ##SDL_pixels.h */ -#define SDL_AllocFormat SDL_CreatePixelFormat +#define SDL_AllocFormat SDL_GetPixelFormatDetails #define SDL_AllocPalette SDL_CreatePalette #define SDL_Colour SDL_Color -#define SDL_FreeFormat SDL_DestroyPixelFormat #define SDL_FreePalette SDL_DestroyPalette -#define SDL_MasksToPixelFormatEnum SDL_GetPixelFormatEnumForMasks +#define SDL_MasksToPixelFormatEnum SDL_GetPixelFormatForMasks #define SDL_PIXELFORMAT_BGR444 SDL_PIXELFORMAT_XBGR4444 #define SDL_PIXELFORMAT_BGR555 SDL_PIXELFORMAT_XBGR1555 #define SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_XBGR8888 #define SDL_PIXELFORMAT_RGB444 SDL_PIXELFORMAT_XRGB4444 #define SDL_PIXELFORMAT_RGB555 SDL_PIXELFORMAT_XRGB1555 #define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_XRGB8888 -#define SDL_PixelFormatEnumToMasks SDL_GetMasksForPixelFormatEnum +#define SDL_PixelFormatEnumToMasks SDL_GetMasksForPixelFormat /* ##SDL_rect.h */ #define SDL_EncloseFPoints SDL_GetRectEnclosingPointsFloat @@ -580,6 +579,7 @@ /* ##SDL_surface.h */ #define SDL_BlitScaled SDL_BlitSurfaceScaled +#define SDL_ConvertSurfaceFormat SDL_ConvertSurface #define SDL_FillRect SDL_FillSurfaceRect #define SDL_FillRects SDL_FillSurfaceRects #define SDL_FreeSurface SDL_DestroySurface @@ -590,6 +590,8 @@ #define SDL_LoadBMP_RW SDL_LoadBMP_IO #define SDL_LowerBlit SDL_BlitSurfaceUnchecked #define SDL_LowerBlitScaled SDL_BlitSurfaceUncheckedScaled +#define SDL_PREALLOC SDL_SURFACE_PREALLOCATED +#define SDL_SIMD_ALIGNED SDL_SURFACE_SIMD_ALIGNED #define SDL_SaveBMP_RW SDL_SaveBMP_IO #define SDL_SetClipRect SDL_SetSurfaceClipRect #define SDL_SetColorKey SDL_SetSurfaceColorKey @@ -1048,19 +1050,18 @@ #define SDL_sem SDL_sem_renamed_SDL_Semaphore /* ##SDL_pixels.h */ -#define SDL_AllocFormat SDL_AllocFormat_renamed_SDL_CreatePixelFormat +#define SDL_AllocFormat SDL_AllocFormat_renamed_SDL_GetPixelFormatDetails #define SDL_AllocPalette SDL_AllocPalette_renamed_SDL_CreatePalette #define SDL_Colour SDL_Colour_renamed_SDL_Color -#define SDL_FreeFormat SDL_FreeFormat_renamed_SDL_DestroyPixelFormat #define SDL_FreePalette SDL_FreePalette_renamed_SDL_DestroyPalette -#define SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum_renamed_SDL_GetPixelFormatEnumForMasks +#define SDL_MasksToPixelFormatEnum SDL_MasksToPixelFormatEnum_renamed_SDL_GetPixelFormatForMasks #define SDL_PIXELFORMAT_BGR444 SDL_PIXELFORMAT_BGR444_renamed_SDL_PIXELFORMAT_XBGR4444 #define SDL_PIXELFORMAT_BGR555 SDL_PIXELFORMAT_BGR555_renamed_SDL_PIXELFORMAT_XBGR1555 #define SDL_PIXELFORMAT_BGR888 SDL_PIXELFORMAT_BGR888_renamed_SDL_PIXELFORMAT_XBGR8888 #define SDL_PIXELFORMAT_RGB444 SDL_PIXELFORMAT_RGB444_renamed_SDL_PIXELFORMAT_XRGB4444 #define SDL_PIXELFORMAT_RGB555 SDL_PIXELFORMAT_RGB555_renamed_SDL_PIXELFORMAT_XRGB1555 #define SDL_PIXELFORMAT_RGB888 SDL_PIXELFORMAT_RGB888_renamed_SDL_PIXELFORMAT_XRGB8888 -#define SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks_renamed_SDL_GetMasksForPixelFormatEnum +#define SDL_PixelFormatEnumToMasks SDL_PixelFormatEnumToMasks_renamed_SDL_GetMasksForPixelFormat /* ##SDL_rect.h */ #define SDL_EncloseFPoints SDL_EncloseFPoints_renamed_SDL_GetRectEnclosingPointsFloat @@ -1175,6 +1176,7 @@ /* ##SDL_surface.h */ #define SDL_BlitScaled SDL_BlitScaled_renamed_SDL_BlitSurfaceScaled +#define SDL_ConvertSurfaceFormat SDL_ConvertSurfaceFormat_renamed_SDL_ConvertSurface #define SDL_FillRect SDL_FillRect_renamed_SDL_FillSurfaceRect #define SDL_FillRects SDL_FillRects_renamed_SDL_FillSurfaceRects #define SDL_FreeSurface SDL_FreeSurface_renamed_SDL_DestroySurface @@ -1185,6 +1187,8 @@ #define SDL_LoadBMP_RW SDL_LoadBMP_RW_renamed_SDL_LoadBMP_IO #define SDL_LowerBlit SDL_LowerBlit_renamed_SDL_BlitSurfaceUnchecked #define SDL_LowerBlitScaled SDL_LowerBlitScaled_renamed_SDL_BlitSurfaceUncheckedScaled +#define SDL_PREALLOC SDL_PREALLOC_renamed_SDL_SURFACE_PREALLOCATED +#define SDL_SIMD_ALIGNED SDL_SIMD_ALIGNED_renamed_SDL_SURFACE_SIMD_ALIGNED #define SDL_SaveBMP_RW SDL_SaveBMP_RW_renamed_SDL_SaveBMP_IO #define SDL_SetClipRect SDL_SetClipRect_renamed_SDL_SetSurfaceClipRect #define SDL_SetColorKey SDL_SetColorKey_renamed_SDL_SetSurfaceColorKey diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index ec758d8d82fb1..bdb37f73d5a66 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -133,7 +133,8 @@ typedef enum SDL_PackedLayout #define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F) #define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F) #define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F) -#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF) +#define SDL_BITSPERPIXEL(X) \ + (SDL_ISPIXELFORMAT_FOURCC(X) ? 0 : (((X) >> 8) & 0xFF)) #define SDL_BYTESPERPIXEL(X) \ (SDL_ISPIXELFORMAT_FOURCC(X) ? \ ((((X) == SDL_PIXELFORMAT_YUY2) || \ @@ -222,7 +223,7 @@ typedef enum SDL_PackedLayout * * \since This enum is available since SDL 3.0.0. */ -typedef enum SDL_PixelFormatEnum +typedef enum SDL_PixelFormat { SDL_PIXELFORMAT_UNKNOWN, SDL_PIXELFORMAT_INDEX1LSB = @@ -426,7 +427,7 @@ typedef enum SDL_PixelFormatEnum SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'), SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') -} SDL_PixelFormatEnum; +} SDL_PixelFormat; /** * Pixels are a representation of a color in a particular color space. @@ -721,7 +722,6 @@ typedef struct SDL_FColor * * \since This struct is available since SDL 3.0.0. * - * \sa SDL_PixelFormat * \sa SDL_SetPaletteColors */ typedef struct SDL_Palette @@ -735,15 +735,11 @@ typedef struct SDL_Palette /** * Details about the format of a pixel. * - * Generally this is used with SDL_Surface, and covers many possible - * configurations, including paletted data and various bit patterns. - * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_PixelFormat +typedef struct SDL_PixelFormatDetails { - SDL_PixelFormatEnum format; - SDL_Palette *palette; + SDL_PixelFormat format; Uint8 bits_per_pixel; Uint8 bytes_per_pixel; Uint8 padding[2]; @@ -751,17 +747,15 @@ typedef struct SDL_PixelFormat Uint32 Gmask; Uint32 Bmask; Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; + Uint8 Rbits; + Uint8 Gbits; + Uint8 Bbits; + Uint8 Abits; Uint8 Rshift; Uint8 Gshift; Uint8 Bshift; Uint8 Ashift; - int refcount; - struct SDL_PixelFormat *next; -} SDL_PixelFormat; +} SDL_PixelFormatDetails; /** * Get the human readable name of a pixel format. @@ -772,32 +766,31 @@ typedef struct SDL_PixelFormat * \returns the human readable name of the specified pixel format or * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormatEnum format); +extern SDL_DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat format); /** * Convert one of the enumerated pixel formats to a bpp value and RGBA masks. * - * \param format one of the SDL_PixelFormatEnum values. + * \param format one of the SDL_PixelFormat values. * \param bpp a bits per pixel value; usually 15, 16, or 32. * \param Rmask a pointer filled in with the red mask for the format. * \param Gmask a pointer filled in with the green mask for the format. * \param Bmask a pointer filled in with the blue mask for the format. * \param Amask a pointer filled in with the alpha mask for the format. - * \returns SDL_TRUE on success or SDL_FALSE if the conversion wasn't - * possible; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetPixelFormatEnumForMasks + * \sa SDL_GetPixelFormatForMasks */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, - int *bpp, - Uint32 * Rmask, - Uint32 * Gmask, - Uint32 * Bmask, - Uint32 * Amask); +extern SDL_DECLSPEC int SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask); /** * Convert a bpp value and RGBA masks to an enumerated pixel format. @@ -810,47 +803,33 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetMasksForPixelFormatEnum(SDL_PixelFor * \param Gmask the green mask for the format. * \param Bmask the blue mask for the format. * \param Amask the alpha mask for the format. - * \returns the SDL_PixelFormatEnum value corresponding to the format masks, + * \returns the SDL_PixelFormat value corresponding to the format masks, * or SDL_PIXELFORMAT_UNKNOWN if there isn't a match. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetMasksForPixelFormatEnum + * \sa SDL_GetMasksForPixelFormat */ -extern SDL_DECLSPEC SDL_PixelFormatEnum SDLCALL SDL_GetPixelFormatEnumForMasks(int bpp, - Uint32 Rmask, - Uint32 Gmask, - Uint32 Bmask, - Uint32 Amask); +extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetPixelFormatForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask); /** - * Create an SDL_PixelFormat structure corresponding to a pixel format. + * Create an SDL_PixelFormatDetails structure corresponding to a pixel format. * * Returned structure may come from a shared global cache (i.e. not newly * allocated), and hence should not be modified, especially the palette. Weird * errors such as `Blit combination not supported` may occur. * - * \param pixel_format one of the SDL_PixelFormatEnum values. - * \returns the new SDL_PixelFormat structure or NULL on failure; call + * \param format one of the SDL_PixelFormat values. + * \returns a pointer to a SDL_PixelFormatDetails structure or NULL on failure; call * SDL_GetError() for more information. * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_DestroyPixelFormat - * \sa SDL_SetPixelFormatPalette - */ -extern SDL_DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format); - -/** - * Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat(). - * - * \param format the SDL_PixelFormat structure to free. + * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_CreatePixelFormat */ -extern SDL_DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format); +extern SDL_DECLSPEC const SDL_PixelFormatDetails * SDLCALL SDL_GetPixelFormatDetails(SDL_PixelFormat format); /** * Create a palette structure with the specified number of color entries. @@ -862,27 +841,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format) * there wasn't enough memory); call SDL_GetError() for more * information. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_DestroyPalette * \sa SDL_SetPaletteColors - * \sa SDL_SetPixelFormatPalette + * \sa SDL_SetSurfacePalette */ extern SDL_DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors); -/** - * Set the palette for a pixel format structure. - * - * \param format the SDL_PixelFormat structure that will use the palette. - * \param palette the SDL_Palette structure that will be used. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 3.0.0. - */ -extern SDL_DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format, - SDL_Palette *palette); - /** * Set a range of colors in a palette. * @@ -893,22 +861,24 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * form * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * + * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread. + * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette, - const SDL_Color * colors, - int firstcolor, int ncolors); +extern SDL_DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors); /** * Free a palette created with SDL_CreatePalette(). * * \param palette the SDL_Palette structure to be freed. * + * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_CreatePalette */ -extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette); +extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); /** * Map an RGB triple to an opaque pixel value for a given pixel format. @@ -928,20 +898,22 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette); * format the return value can be assigned to a Uint16, and similarly a Uint8 * for an 8-bpp format). * - * \param format an SDL_PixelFormat structure describing the pixel format. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param palette an optional palette for indexed formats, may be NULL. * \param r the red component of the pixel in the range 0-255. * \param g the green component of the pixel in the range 0-255. * \param b the blue component of the pixel in the range 0-255. * \returns a pixel value. * + * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetRGB - * \sa SDL_GetRGBA * \sa SDL_MapRGBA + * \sa SDL_MapSurfaceRGB */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b); +extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b); /** * Map an RGBA quadruple to a pixel value for a given pixel format. @@ -961,23 +933,23 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format, * format the return value can be assigned to a Uint16, and similarly a Uint8 * for an 8-bpp format). * - * \param format an SDL_PixelFormat structure describing the format of the - * pixel. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param palette an optional palette for indexed formats, may be NULL. * \param r the red component of the pixel in the range 0-255. * \param g the green component of the pixel in the range 0-255. * \param b the blue component of the pixel in the range 0-255. * \param a the alpha component of the pixel in the range 0-255. * \returns a pixel value. * + * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. + * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetRGB * \sa SDL_GetRGBA * \sa SDL_MapRGB + * \sa SDL_MapSurfaceRGBA */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, - Uint8 r, Uint8 g, Uint8 b, - Uint8 a); +extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Get RGB values from a pixel in the specified format. @@ -988,11 +960,13 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). * * \param pixel a pixel value. - * \param format an SDL_PixelFormat structure describing the format of the - * pixel. - * \param r a pointer filled in with the red component. - * \param g a pointer filled in with the green component. - * \param b a pointer filled in with the blue component. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param palette an optional palette for indexed formats, may be NULL. + * \param r a pointer filled in with the red component, may be NULL. + * \param g a pointer filled in with the green component, may be NULL. + * \param b a pointer filled in with the blue component, may be NULL. + * + * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. * * \since This function is available since SDL 3.0.0. * @@ -1000,9 +974,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format, * \sa SDL_MapRGB * \sa SDL_MapRGBA */ -extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b); +extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b); /** * Get RGBA values from a pixel in the specified format. @@ -1016,12 +988,14 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, * (100% opaque). * * \param pixel a pixel value. - * \param format an SDL_PixelFormat structure describing the format of the - * pixel. - * \param r a pointer filled in with the red component. - * \param g a pointer filled in with the green component. - * \param b a pointer filled in with the blue component. - * \param a a pointer filled in with the alpha component. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param palette an optional palette for indexed formats, may be NULL. + * \param r a pointer filled in with the red component, may be NULL. + * \param g a pointer filled in with the green component, may be NULL. + * \param b a pointer filled in with the blue component, may be NULL. + * \param a a pointer filled in with the alpha component, may be NULL. + * + * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. * * \since This function is available since SDL 3.0.0. * @@ -1029,10 +1003,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, * \sa SDL_MapRGB * \sa SDL_MapRGBA */ -extern SDL_DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, - const SDL_PixelFormat * format, - Uint8 * r, Uint8 * g, Uint8 * b, - Uint8 * a); +extern SDL_DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); /* Ends C function definitions when using C++ */ diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index f33cdf906f175..4b08b0b11264e 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -350,8 +350,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetRendererName(SDL_Renderer *render * - `SDL_PROP_RENDERER_VSYNC_NUMBER`: the current vsync setting * - `SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER`: the maximum texture width * and height - * - `SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER`: a (const SDL_PixelFormatEnum - * *) array of pixel formats, terminated with SDL_PIXELFORMAT_UNKNOWN, + * - `SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER`: a (const SDL_PixelFormat *) array of pixel formats, terminated with SDL_PIXELFORMAT_UNKNOWN, * representing the available texture formats for this renderer. * - `SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER`: an SDL_ColorSpace value * describing the colorspace for output to the display, defaults to @@ -485,7 +484,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *ren * Create a texture for a rendering context. * * \param renderer the rendering context. - * \param format one of the enumerated values in SDL_PixelFormatEnum. + * \param format one of the enumerated values in SDL_PixelFormat. * \param access one of the enumerated values in SDL_TextureAccess. * \param w the width of the texture in pixels. * \param h the height of the texture in pixels. @@ -501,7 +500,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *ren * \sa SDL_GetTextureSize * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormatEnum format, int access, int w, int h); +extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, int access, int w, int h); /** * Create a texture from an existing surface. @@ -540,7 +539,7 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Render * SDL_COLORSPACE_SRGB for other RGB textures and SDL_COLORSPACE_JPEG for * YUV textures. * - `SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER`: one of the enumerated values in - * SDL_PixelFormatEnum, defaults to the best RGBA format for the renderer + * SDL_PixelFormat, defaults to the best RGBA format for the renderer * - `SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER`: one of the enumerated values in * SDL_TextureAccess, defaults to SDL_TEXTUREACCESS_STATIC * - `SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER`: the width of the texture in @@ -672,7 +671,7 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Ren * - `SDL_PROP_TEXTURE_COLORSPACE_NUMBER`: an SDL_ColorSpace value describing * the texture colorspace. * - `SDL_PROP_TEXTURE_FORMAT_NUMBER`: one of the enumerated values in - * SDL_PixelFormatEnum. + * SDL_PixelFormat. * - `SDL_PROP_TEXTURE_ACCESS_NUMBER`: one of the enumerated values in * SDL_TextureAccess. * - `SDL_PROP_TEXTURE_WIDTH_NUMBER`: the width of the texture in pixels. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 5df03c465cebb..73a7d368e2d7c 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -45,34 +45,23 @@ extern "C" { /** * The flags on an SDL_Surface. * - * These are generally meant to be considered read-only. + * These are generally considered read-only. * * \since This datatype is available since SDL 3.0.0. */ typedef Uint32 SDL_SurfaceFlags; -#define SDL_PREALLOC 0x00000001u /**< Surface uses preallocated memory */ -#define SDL_RLEACCEL 0x00000002u /**< Surface is RLE encoded */ -#define SDL_DONTFREE 0x00000004u /**< Surface is referenced internally */ -#define SDL_SIMD_ALIGNED 0x00000008u /**< Surface uses aligned memory */ -#define SDL_SURFACE_USES_PROPERTIES 0x00000010u /**< Surface uses properties */ +#define SDL_SURFACE_PREALLOCATED 0x00000001u /**< Surface uses preallocated pixel memory */ +#define SDL_SURFACE_LOCK_NEEDED 0x00000002u /**< Surface needs to be locked to access pixels */ +#define SDL_SURFACE_LOCKED 0x00000004u /**< Surface is currently locked */ +#define SDL_SURFACE_SIMD_ALIGNED 0x00000008u /**< Surface uses pixel memory allocated with SDL_aligned_alloc() */ /** * Evaluates to true if the surface needs to be locked before access. * * \since This macro is available since SDL 3.0.0. */ -#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0) - -/** - * An opaque type used in SDL_Surface. - * - * This is used by SDL to keep track of how blit operations should work - * internally; it is not for use directly by applications. - * - * \since This struct is available since SDL 3.0.0. - */ -typedef struct SDL_BlitMap SDL_BlitMap; +#define SDL_MUSTLOCK(S) (((S)->flags & (SDL_SURFACE_LOCK_NEEDED | SDL_SURFACE_LOCKED)) == SDL_SURFACE_LOCK_NEEDED) /** * The scaling mode. @@ -98,6 +87,9 @@ typedef enum SDL_FlipMode SDL_FLIP_VERTICAL /**< flip vertically */ } SDL_FlipMode; +/* Internal surface data */ +typedef struct SDL_SurfaceData SDL_SurfaceData; + /** * A collection of pixels used in software blitting. * @@ -118,36 +110,24 @@ typedef enum SDL_FlipMode typedef struct SDL_Surface { SDL_SurfaceFlags flags; /**< Read-only */ - SDL_PixelFormat *format; /**< Read-only */ + SDL_PixelFormat format; /**< Read-only */ int w, h; /**< Read-only */ int pitch; /**< Read-only */ - void *pixels; /**< Read-write */ - - void *reserved; /**< Private */ + void *pixels; /**< Read-only pointer, writable pixels if non-NULL */ - /** information needed for surfaces requiring locks */ - int locked; /**< Read-only */ + int refcount; /**< Application reference count, used when freeing surface */ - /** list of BlitMap that hold a reference to this surface */ - void *list_blitmap; /**< Private */ + SDL_SurfaceData *internal; /**< Private */ - /** clipping information */ - SDL_Rect clip_rect; /**< Read-only */ - - /** info for fast blit mapping to other surfaces */ - SDL_BlitMap *map; /**< Private */ - - /** Reference count -- used when freeing surface */ - int refcount; /**< Read-mostly */ } SDL_Surface; /** - * Allocate a new RGB surface with a specific pixel format. + * Allocate a new surface with a specific pixel format. * * \param width the width of the surface. * \param height the height of the surface. - * \param format the SDL_PixelFormatEnum for the new surface's pixel format. + * \param format the SDL_PixelFormat for the new surface's pixel format. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * @@ -156,11 +136,10 @@ typedef struct SDL_Surface * \sa SDL_CreateSurfaceFrom * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format); +extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormat format); /** - * Allocate a new RGB surface with a specific pixel format and existing pixel - * data. + * Allocate a new surface with a specific pixel format and existing pixel data. * * No copy is made of the pixel data. Pixel data is not managed automatically; * you must free the surface before you free the pixel data. @@ -171,11 +150,11 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height * You may pass NULL for pixels and 0 for pitch to create a surface that you * will fill in with valid values later. * - * \param pixels a pointer to existing pixel data. * \param width the width of the surface. * \param height the height of the surface. + * \param format the SDL_PixelFormat for the new surface's pixel format. + * \param pixels a pointer to existing pixel data. * \param pitch the number of bytes between each row, including padding. - * \param format the SDL_PixelFormatEnum for the new surface's pixel format. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * @@ -184,10 +163,10 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height * \sa SDL_CreateSurface * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, SDL_PixelFormatEnum format); +extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, void *pixels, int pitch); /** - * Free an RGB surface. + * Free a surface. * * It is safe to pass NULL to this function. * @@ -195,6 +174,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(void *pixels, int * * \since This function is available since SDL 3.0.0. * + * \sa SDL_CreateStackSurface * \sa SDL_CreateSurface * \sa SDL_CreateSurfaceFrom */ @@ -254,6 +234,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surfac * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_GetSurfaceColorspace */ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace); @@ -265,14 +247,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, S * other RGB surfaces and SDL_COLORSPACE_BT709_FULL for YUV textures. * * \param surface the SDL_Surface structure to query. - * \param colorspace a pointer filled in with an SDL_ColorSpace value - * describing the surface colorspace. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if the surface is NULL. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetSurfaceColorspace */ -extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace *colorspace); +extern SDL_DECLSPEC SDL_Colorspace SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface); /** * Set the palette used by a surface. @@ -285,9 +266,24 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface, S * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_CreatePalette + * \sa SDL_GetSurfacePalette */ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette); +/** + * Get the palette used by a surface. + * + * \param surface the SDL_Surface structure to query. + * \returns a pointer to the palette used by the surface, or NULL if there is no palette used. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetSurfacePalette + */ +extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_GetSurfacePalette(SDL_Surface *surface); + /** * Set up a surface for directly accessing the pixels. * @@ -411,7 +407,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *fi * the surface must be locked before directly accessing the pixels. * * \param surface the SDL_Surface structure to optimize. - * \param flag 0 to disable, non-zero to enable RLE acceleration. + * \param enabled SDL_TRUE to enable RLE acceleration, SDL_FALSE to disable it. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -421,7 +417,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *fi * \sa SDL_LockSurface * \sa SDL_UnlockSurface */ -extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag); +extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled); /** * Returns whether the surface is RLE enabled. @@ -447,11 +443,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); * It is a pixel of the format used by the surface, as generated by * SDL_MapRGB(). * - * RLE acceleration can substantially speed up blitting of images with large - * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details. - * * \param surface the SDL_Surface structure to update. - * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key. + * \param enabled SDL_TRUE to enable color key, SDL_FALSE to disable color key. * \param key the transparent pixel. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. @@ -459,9 +452,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); * \since This function is available since SDL 3.0.0. * * \sa SDL_GetSurfaceColorKey + * \sa SDL_SetSurfaceRLE * \sa SDL_SurfaceHasColorKey */ -extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key); +extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key); /** * Returns whether the surface has a color key. @@ -681,41 +675,19 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surfa * surface. The new, optimized surface can then be used as the source for * future blits, making them faster. * - * \param surface the existing SDL_Surface structure to convert. - * \param format the SDL_PixelFormat structure that the new surface is - * optimized for. - * \returns the new SDL_Surface structure that is created or NULL if it fails; - * call SDL_GetError() for more information. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_ConvertSurfaceFormat - * \sa SDL_ConvertSurfaceFormatAndColorspace - * \sa SDL_CreatePixelFormat - * \sa SDL_DestroySurface - */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format); - -/** - * Copy an existing surface to a new surface of the specified format. - * - * This function operates just like SDL_ConvertSurface(), but accepts an - * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such, - * it might be easier to call but it doesn't have access to palette - * information for the destination surface, in case that would be important. + * If you are converting to an indexed surface and want to map colors to a palette, you can use SDL_ConvertSurfaceAndColorspace() instead. * * \param surface the existing SDL_Surface structure to convert. - * \param pixel_format the new pixel format. + * \param format the new pixel format. * \returns the new SDL_Surface structure that is created or NULL if it fails; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_ConvertSurface - * \sa SDL_ConvertSurfaceFormatAndColorspace + * \sa SDL_ConvertSurfaceAndColorspace * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format); +extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, SDL_PixelFormat format); /** * Copy an existing surface to a new surface of the specified format and @@ -726,7 +698,8 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *s * colorspace conversion needed. * * \param surface the existing SDL_Surface structure to convert. - * \param pixel_format the new pixel format. + * \param format the new pixel format. + * \param palette an optional palette to use for indexed formats, may be NULL. * \param colorspace the new colorspace. * \param props an SDL_PropertiesID with additional color properties, or 0. * \returns the new SDL_Surface structure that is created or NULL if it fails; @@ -735,20 +708,20 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *s * \since This function is available since SDL 3.0.0. * * \sa SDL_ConvertSurface - * \sa SDL_ConvertSurfaceFormat + * \sa SDL_ConvertSurface * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, const SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props); /** * Copy a block of pixels of one format to another format. * * \param width the width of the block to copy, in pixels. * \param height the height of the block to copy, in pixels. - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format. + * \param src_format an SDL_PixelFormat value of the `src` pixels format. * \param src a pointer to the source pixels. * \param src_pitch the pitch of the source pixels, in bytes. - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format. + * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst a pointer to be filled in with new pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. * \returns 0 on success or a negative error code on failure; call @@ -758,7 +731,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormatAndColorspace(S * * \sa SDL_ConvertPixelsAndColorspace */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch); +extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch); /** * Copy a block of pixels of one format and colorspace to another format and @@ -766,14 +739,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_Pix * * \param width the width of the block to copy, in pixels. * \param height the height of the block to copy, in pixels. - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format. + * \param src_format an SDL_PixelFormat value of the `src` pixels format. * \param src_colorspace an SDL_ColorSpace value describing the colorspace of * the `src` pixels. * \param src_properties an SDL_PropertiesID with additional source color * properties, or 0. * \param src a pointer to the source pixels. * \param src_pitch the pitch of the source pixels, in bytes. - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format. + * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst_colorspace an SDL_ColorSpace value describing the colorspace of * the `dst` pixels. * \param dst_properties an SDL_PropertiesID with additional destination color @@ -787,7 +760,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, SDL_Pix * * \sa SDL_ConvertPixels */ -extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); +extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); /** * Premultiply the alpha on a block of pixels. @@ -798,10 +771,10 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int he * * \param width the width of the block to convert, in pixels. * \param height the height of the block to convert, in pixels. - * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format. + * \param src_format an SDL_PixelFormat value of the `src` pixels format. * \param src a pointer to the source pixels. * \param src_pitch the pitch of the source pixels, in bytes. - * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format. + * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst a pointer to be filled in with premultiplied pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. * \returns 0 on success or a negative error code on failure; call @@ -809,7 +782,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int he * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormatEnum src_format, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch); +extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch); /** * Perform a fast fill of a rectangle with a specific color. @@ -1033,6 +1006,67 @@ extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src, const SD */ extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode); +/** + * Map an RGB triple to an opaque pixel value for a surface. + * + * This function maps the RGB color value to the specified pixel format and + * returns the pixel value best approximating the given RGB color value for + * the given pixel format. + * + * If the surface has a palette, the index of the closest matching color + * in the palette will be returned. + * + * If the surface pixel format has an alpha component it will be returned as + * all 1 bits (fully opaque). + * + * If the pixel format bpp (color depth) is less than 32-bpp then the unused + * upper bits of the return value can safely be ignored (e.g., with a 16-bpp + * format the return value can be assigned to a Uint16, and similarly a Uint8 + * for an 8-bpp format). + * + * \param surface the surface to use for the pixel format and palette. + * \param r the red component of the pixel in the range 0-255. + * \param g the green component of the pixel in the range 0-255. + * \param b the blue component of the pixel in the range 0-255. + * \returns a pixel value. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_MapSurfaceRGBA + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b); + +/** + * Map an RGBA quadruple to a pixel value for a surface. + * + * This function maps the RGBA color value to the specified pixel format and + * returns the pixel value best approximating the given RGBA color value for + * the given pixel format. + * + * If the surface pixel format has no alpha component the alpha value will + * be ignored (as it will be in formats with a palette). + * + * If the surface has a palette, the index of the closest matching color + * in the palette will be returned. + * + * If the pixel format bpp (color depth) is less than 32-bpp then the unused + * upper bits of the return value can safely be ignored (e.g., with a 16-bpp + * format the return value can be assigned to a Uint16, and similarly a Uint8 + * for an 8-bpp format). + * + * \param surface the surface to use for the pixel format and palette. + * \param r the red component of the pixel in the range 0-255. + * \param g the green component of the pixel in the range 0-255. + * \param b the blue component of the pixel in the range 0-255. + * \param a the alpha component of the pixel in the range 0-255. + * \returns a pixel value. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_MapSurfaceRGB + */ +extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + /** * Retrieves a single pixel from a surface. * diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index bd0d726dd972d..5dcee6694ddb3 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -88,7 +88,7 @@ typedef enum SDL_SystemTheme typedef struct SDL_DisplayMode { SDL_DisplayID displayID; /**< the display this mode is associated with */ - SDL_PixelFormatEnum format; /**< pixel format */ + SDL_PixelFormat format; /**< pixel format */ int w; /**< width */ int h; /**< height */ float pixel_density; /**< scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) */ diff --git a/src/SDL.c b/src/SDL.c index 2957787244963..9c6cd58cbff78 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -50,6 +50,7 @@ #include "render/SDL_sysrender.h" #include "sensor/SDL_sensor_c.h" #include "stdlib/SDL_getenv_c.h" +#include "video/SDL_pixels_c.h" #include "video/SDL_video_c.h" #define SDL_INIT_EVERYTHING ~0U @@ -549,6 +550,8 @@ void SDL_Quit(void) SDL_ClearHints(); SDL_AssertionsQuit(); + SDL_QuitPixelFormatDetails(); + SDL_QuitCPUInfo(); SDL_QuitProperties(); diff --git a/src/SDL_hashtable.c b/src/SDL_hashtable.c index b57aff267c64e..97b8e2a6d0b12 100644 --- a/src/SDL_hashtable.c +++ b/src/SDL_hashtable.c @@ -317,3 +317,8 @@ SDL_bool SDL_KeyMatchID(const void *a, const void *b, void *unused) } return SDL_FALSE; } + +void SDL_NukeFreeValue(const void *key, const void *value, void *unused) +{ + SDL_free((void *)value); +} diff --git a/src/SDL_hashtable.h b/src/SDL_hashtable.h index ef0945ee0c47b..4c3f74dfa7366 100644 --- a/src/SDL_hashtable.h +++ b/src/SDL_hashtable.h @@ -29,30 +29,32 @@ typedef Uint32 (*SDL_HashTable_HashFn)(const void *key, void *data); typedef SDL_bool (*SDL_HashTable_KeyMatchFn)(const void *a, const void *b, void *data); typedef void (*SDL_HashTable_NukeFn)(const void *key, const void *value, void *data); -SDL_HashTable *SDL_CreateHashTable(void *data, - const Uint32 num_buckets, - const SDL_HashTable_HashFn hashfn, - const SDL_HashTable_KeyMatchFn keymatchfn, - const SDL_HashTable_NukeFn nukefn, - const SDL_bool stackable); - -void SDL_EmptyHashTable(SDL_HashTable *table); -void SDL_DestroyHashTable(SDL_HashTable *table); -SDL_bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const void *value); -SDL_bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key); -SDL_bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const void **_value); -SDL_bool SDL_HashTableEmpty(SDL_HashTable *table); +extern SDL_HashTable *SDL_CreateHashTable(void *data, + const Uint32 num_buckets, + const SDL_HashTable_HashFn hashfn, + const SDL_HashTable_KeyMatchFn keymatchfn, + const SDL_HashTable_NukeFn nukefn, + const SDL_bool stackable); + +extern void SDL_EmptyHashTable(SDL_HashTable *table); +extern void SDL_DestroyHashTable(SDL_HashTable *table); +extern SDL_bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const void *value); +extern SDL_bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key); +extern SDL_bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const void **_value); +extern SDL_bool SDL_HashTableEmpty(SDL_HashTable *table); // iterate all values for a specific key. This only makes sense if the hash is stackable. If not-stackable, just use SDL_FindInHashTable(). -SDL_bool SDL_IterateHashTableKey(const SDL_HashTable *table, const void *key, const void **_value, void **iter); +extern SDL_bool SDL_IterateHashTableKey(const SDL_HashTable *table, const void *key, const void **_value, void **iter); // iterate all key/value pairs in a hash (stackable hashes can have duplicate keys with multiple values). -SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, const void **_value, void **iter); +extern SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, const void **_value, void **iter); -Uint32 SDL_HashString(const void *key, void *unused); -SDL_bool SDL_KeyMatchString(const void *a, const void *b, void *unused); +extern Uint32 SDL_HashString(const void *key, void *unused); +extern SDL_bool SDL_KeyMatchString(const void *a, const void *b, void *unused); -Uint32 SDL_HashID(const void *key, void *unused); -SDL_bool SDL_KeyMatchID(const void *a, const void *b, void *unused); +extern Uint32 SDL_HashID(const void *key, void *unused); +extern SDL_bool SDL_KeyMatchID(const void *a, const void *b, void *unused); + +extern void SDL_NukeFreeValue(const void *key, const void *value, void *unused); #endif /* SDL_hashtable_h_ */ diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index b919948706de6..260323afddc00 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -84,7 +84,7 @@ char *SDL_GetCameraThreadName(SDL_CameraDevice *device, char *buf, size_t buflen return buf; } -int SDL_AddCameraFormat(CameraFormatAddData *data, SDL_PixelFormatEnum format, SDL_Colorspace colorspace, int w, int h, int framerate_numerator, int framerate_denominator) +int SDL_AddCameraFormat(CameraFormatAddData *data, SDL_PixelFormat format, SDL_Colorspace colorspace, int w, int h, int framerate_numerator, int framerate_denominator) { SDL_assert(data != NULL); if (data->allocated_specs <= data->num_specs) { @@ -130,7 +130,7 @@ static size_t GetFrameBufLen(const SDL_CameraSpec *spec) const size_t w = (const size_t) spec->width; const size_t h = (const size_t) spec->height; const size_t wxh = w * h; - const SDL_PixelFormatEnum fmt = spec->format; + const SDL_PixelFormat fmt = spec->format; switch (fmt) { // Some YUV formats have a larger Y plane than their U or V planes. @@ -367,8 +367,8 @@ static int SDLCALL CameraSpecCmp(const void *vpa, const void *vpb) SDL_assert(b->width > 0); SDL_assert(b->height > 0); - const SDL_PixelFormatEnum afmt = a->format; - const SDL_PixelFormatEnum bfmt = b->format; + const SDL_PixelFormat afmt = a->format; + const SDL_PixelFormat bfmt = b->format; if (SDL_ISPIXELFORMAT_FOURCC(afmt) && !SDL_ISPIXELFORMAT_FOURCC(bfmt)) { return -1; } else if (!SDL_ISPIXELFORMAT_FOURCC(afmt) && SDL_ISPIXELFORMAT_FOURCC(bfmt)) { @@ -879,8 +879,8 @@ SDL_bool SDL_CameraThreadIterate(SDL_CameraDevice *device) if (device->needs_conversion) { SDL_Surface *dstsurf = (device->needs_scaling == 1) ? device->conversion_surface : output_surface; SDL_ConvertPixels(srcsurf->w, srcsurf->h, - srcsurf->format->format, srcsurf->pixels, srcsurf->pitch, - dstsurf->format->format, dstsurf->pixels, dstsurf->pitch); + srcsurf->format, srcsurf->pixels, srcsurf->pitch, + dstsurf->format, dstsurf->pixels, dstsurf->pitch); srcsurf = dstsurf; } if (device->needs_scaling == 1) { // upscaling? Do it last. -1: downscale, 0: no scaling, 1: upscale @@ -1005,8 +1005,8 @@ static void ChooseBestCameraSpec(SDL_CameraDevice *device, const SDL_CameraSpec SDL_assert(closest->height > 0); // okay, we have what we think is the best resolution, now we just need the best format that supports it... - const SDL_PixelFormatEnum wantfmt = spec->format; - SDL_PixelFormatEnum best_format = SDL_PIXELFORMAT_UNKNOWN; + const SDL_PixelFormat wantfmt = spec->format; + SDL_PixelFormat best_format = SDL_PIXELFORMAT_UNKNOWN; SDL_Colorspace best_colorspace = SDL_COLORSPACE_UNKNOWN; for (int i = 0; i < num_specs; i++) { const SDL_CameraSpec *thisspec = &device->all_specs[i]; @@ -1124,7 +1124,7 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer device->needs_conversion = (closest.format != device->spec.format); - device->acquire_surface = SDL_CreateSurfaceFrom(NULL, closest.width, closest.height, 0, closest.format); + device->acquire_surface = SDL_CreateSurfaceFrom(closest.width, closest.height, closest.format, NULL, 0); if (!device->acquire_surface) { ClosePhysicalCameraDevice(device); ReleaseCameraDevice(device); @@ -1136,7 +1136,7 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer if (device->needs_scaling && device->needs_conversion) { const SDL_bool downsampling_first = (device->needs_scaling < 0); const SDL_CameraSpec *s = downsampling_first ? &device->spec : &closest; - const SDL_PixelFormatEnum fmt = downsampling_first ? closest.format : device->spec.format; + const SDL_PixelFormat fmt = downsampling_first ? closest.format : device->spec.format; device->conversion_surface = SDL_CreateSurface(s->width, s->height, fmt); if (!device->conversion_surface) { ClosePhysicalCameraDevice(device); @@ -1160,7 +1160,7 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer if (device->needs_scaling || device->needs_conversion) { surf = SDL_CreateSurface(device->spec.width, device->spec.height, device->spec.format); } else { - surf = SDL_CreateSurfaceFrom(NULL, device->spec.width, device->spec.height, 0, device->spec.format); + surf = SDL_CreateSurfaceFrom(device->spec.width, device->spec.height, device->spec.format, NULL, 0); } if (!surf) { ClosePhysicalCameraDevice(device); diff --git a/src/camera/SDL_syscamera.h b/src/camera/SDL_syscamera.h index 6ad966381e49c..40ed83a8aed23 100644 --- a/src/camera/SDL_syscamera.h +++ b/src/camera/SDL_syscamera.h @@ -64,7 +64,7 @@ typedef struct CameraFormatAddData int allocated_specs; } CameraFormatAddData; -int SDL_AddCameraFormat(CameraFormatAddData *data, SDL_PixelFormatEnum format, SDL_Colorspace colorspace, int w, int h, int framerate_numerator, int framerate_denominator); +int SDL_AddCameraFormat(CameraFormatAddData *data, SDL_PixelFormat format, SDL_Colorspace colorspace, int w, int h, int framerate_numerator, int framerate_denominator); typedef struct SurfaceList { diff --git a/src/camera/android/SDL_camera_android.c b/src/camera/android/SDL_camera_android.c index 7dbe251eb6ef0..ad3863f90360e 100644 --- a/src/camera/android/SDL_camera_android.c +++ b/src/camera/android/SDL_camera_android.c @@ -252,7 +252,7 @@ static void DestroyCameraManager(void) } } -static void format_android_to_sdl(Uint32 fmt, SDL_PixelFormatEnum *format, SDL_Colorspace *colorspace) +static void format_android_to_sdl(Uint32 fmt, SDL_PixelFormat *format, SDL_Colorspace *colorspace) { switch (fmt) { #define CASE(x, y, z) case x: *format = y; *colorspace = z; return @@ -274,7 +274,7 @@ static void format_android_to_sdl(Uint32 fmt, SDL_PixelFormatEnum *format, SDL_C *colorspace = SDL_COLORSPACE_UNKNOWN; } -static Uint32 format_sdl_to_android(SDL_PixelFormatEnum fmt) +static Uint32 format_sdl_to_android(SDL_PixelFormat fmt) { switch (fmt) { #define CASE(x, y) case y: return x @@ -632,7 +632,7 @@ static void GatherCameraSpecs(const char *devid, CameraFormatAddData *add_data, const int w = (int) i32ptr[1]; const int h = (int) i32ptr[2]; const int32_t type = i32ptr[3]; - SDL_PixelFormatEnum sdlfmt = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat sdlfmt = SDL_PIXELFORMAT_UNKNOWN; SDL_Colorspace colorspace = SDL_COLORSPACE_UNKNOWN; if (type == ACAMERA_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_INPUT) { diff --git a/src/camera/coremedia/SDL_camera_coremedia.m b/src/camera/coremedia/SDL_camera_coremedia.m index 6e407ea4cdf12..133dc2b45a4e1 100644 --- a/src/camera/coremedia/SDL_camera_coremedia.m +++ b/src/camera/coremedia/SDL_camera_coremedia.m @@ -41,7 +41,7 @@ * com.apple.security.device.camera */ -static void CoreMediaFormatToSDL(FourCharCode fmt, SDL_PixelFormatEnum *pixel_format, SDL_Colorspace *colorspace) +static void CoreMediaFormatToSDL(FourCharCode fmt, SDL_PixelFormat *pixel_format, SDL_Colorspace *colorspace) { switch (fmt) { #define CASE(x, y, z) case x: *pixel_format = y; *colorspace = z; return @@ -260,7 +260,7 @@ static int COREMEDIA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec * NSArray *formats = [avdevice formats]; for (AVCaptureDeviceFormat *format in formats) { CMFormatDescriptionRef formatDescription = [format formatDescription]; - SDL_PixelFormatEnum device_format = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat device_format = SDL_PIXELFORMAT_UNKNOWN; SDL_Colorspace device_colorspace = SDL_COLORSPACE_UNKNOWN; CoreMediaFormatToSDL(CMFormatDescriptionGetMediaSubType(formatDescription), &device_format, &device_colorspace); if (device_format != spec->format || device_colorspace != spec->colorspace) { @@ -384,7 +384,7 @@ static void GatherCameraSpecs(AVCaptureDevice *device, CameraFormatAddData *add_ } //NSLog(@"Available camera format: %@\n", fmt); - SDL_PixelFormatEnum device_format = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat device_format = SDL_PIXELFORMAT_UNKNOWN; SDL_Colorspace device_colorspace = SDL_COLORSPACE_UNKNOWN; CoreMediaFormatToSDL(CMFormatDescriptionGetMediaSubType(fmt.formatDescription), &device_format, &device_colorspace); if (device_format == SDL_PIXELFORMAT_UNKNOWN) { diff --git a/src/camera/mediafoundation/SDL_camera_mediafoundation.c b/src/camera/mediafoundation/SDL_camera_mediafoundation.c index 0421b5b664df8..7776d1e3b3e9f 100644 --- a/src/camera/mediafoundation/SDL_camera_mediafoundation.c +++ b/src/camera/mediafoundation/SDL_camera_mediafoundation.c @@ -85,7 +85,7 @@ SDL_DEFINE_MEDIATYPE_GUID(MFVideoFormat_NV21, FCC('NV21')); static const struct { const GUID *guid; - SDL_PixelFormatEnum format; + SDL_PixelFormat format; SDL_Colorspace colorspace; } fmtmappings[] = { // This is not every possible format, just popular ones that SDL can reasonably handle. @@ -281,7 +281,7 @@ static SDL_Colorspace GetMediaTypeColorspace(IMFMediaType *mediatype, SDL_Colors return colorspace; } -static void MediaTypeToSDLFmt(IMFMediaType *mediatype, SDL_PixelFormatEnum *format, SDL_Colorspace *colorspace) +static void MediaTypeToSDLFmt(IMFMediaType *mediatype, SDL_PixelFormat *format, SDL_Colorspace *colorspace) { HRESULT ret; GUID type; @@ -300,7 +300,7 @@ static void MediaTypeToSDLFmt(IMFMediaType *mediatype, SDL_PixelFormatEnum *form *colorspace = SDL_COLORSPACE_UNKNOWN; } -static const GUID *SDLFmtToMFVidFmtGuid(SDL_PixelFormatEnum format) +static const GUID *SDLFmtToMFVidFmtGuid(SDL_PixelFormat format) { for (size_t i = 0; i < SDL_arraysize(fmtmappings); i++) { if (fmtmappings[i].format == format) { @@ -930,7 +930,7 @@ static void GatherCameraSpecs(IMFMediaSource *source, CameraFormatAddData *add_d GUID type; ret = IMFMediaType_GetGUID(mediatype, &SDL_MF_MT_MAJOR_TYPE, &type); if (SUCCEEDED(ret) && WIN_IsEqualGUID(&type, &SDL_MFMediaType_Video)) { - SDL_PixelFormatEnum sdlfmt = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat sdlfmt = SDL_PIXELFORMAT_UNKNOWN; SDL_Colorspace colorspace = SDL_COLORSPACE_UNKNOWN; MediaTypeToSDLFmt(mediatype, &sdlfmt, &colorspace); if (sdlfmt != SDL_PIXELFORMAT_UNKNOWN) { diff --git a/src/camera/pipewire/SDL_camera_pipewire.c b/src/camera/pipewire/SDL_camera_pipewire.c index 4bf35ec3f404e..3b297c37ba84c 100644 --- a/src/camera/pipewire/SDL_camera_pipewire.c +++ b/src/camera/pipewire/SDL_camera_pipewire.c @@ -357,7 +357,7 @@ static void param_update(struct spa_list *param_list, struct spa_list *pending_l } static struct sdl_video_format { - SDL_PixelFormatEnum format; + SDL_PixelFormat format; SDL_Colorspace colorspace; uint32_t id; } sdl_video_formats[] = { @@ -389,7 +389,7 @@ static struct sdl_video_format { #endif }; -static uint32_t sdl_format_to_id(SDL_PixelFormatEnum format) +static uint32_t sdl_format_to_id(SDL_PixelFormat format) { struct sdl_video_format *f; SPA_FOR_EACH_ELEMENT(sdl_video_formats, f) { @@ -399,7 +399,7 @@ static uint32_t sdl_format_to_id(SDL_PixelFormatEnum format) return SPA_VIDEO_FORMAT_UNKNOWN; } -static void id_to_sdl_format(uint32_t id, SDL_PixelFormatEnum *format, SDL_Colorspace *colorspace) +static void id_to_sdl_format(uint32_t id, SDL_PixelFormat *format, SDL_Colorspace *colorspace) { struct sdl_video_format *f; SPA_FOR_EACH_ELEMENT(sdl_video_formats, f) { @@ -603,7 +603,7 @@ static void PIPEWIRECAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *f PIPEWIRE_pw_thread_loop_unlock(hotplug.loop); } -static void collect_rates(CameraFormatAddData *data, struct param *p, SDL_PixelFormatEnum sdlfmt, SDL_Colorspace colorspace, const struct spa_rectangle *size) +static void collect_rates(CameraFormatAddData *data, struct param *p, SDL_PixelFormat sdlfmt, SDL_Colorspace colorspace, const struct spa_rectangle *size) { const struct spa_pod_prop *prop; struct spa_pod * values; @@ -636,7 +636,7 @@ static void collect_rates(CameraFormatAddData *data, struct param *p, SDL_PixelF } } -static void collect_size(CameraFormatAddData *data, struct param *p, SDL_PixelFormatEnum sdlfmt, SDL_Colorspace colorspace) +static void collect_size(CameraFormatAddData *data, struct param *p, SDL_PixelFormat sdlfmt, SDL_Colorspace colorspace) { const struct spa_pod_prop *prop; struct spa_pod * values; @@ -670,7 +670,7 @@ static void collect_size(CameraFormatAddData *data, struct param *p, SDL_PixelFo static void collect_format(CameraFormatAddData *data, struct param *p) { const struct spa_pod_prop *prop; - SDL_PixelFormatEnum sdlfmt; + SDL_PixelFormat sdlfmt; SDL_Colorspace colorspace; struct spa_pod * values; uint32_t i, n_vals, choice, *ids; diff --git a/src/camera/v4l2/SDL_camera_v4l2.c b/src/camera/v4l2/SDL_camera_v4l2.c index 7debf296761ae..ed320e7deb7e7 100644 --- a/src/camera/v4l2/SDL_camera_v4l2.c +++ b/src/camera/v4l2/SDL_camera_v4l2.c @@ -391,7 +391,7 @@ static int AllocBufferUserPtr(SDL_CameraDevice *device, size_t buffer_size) return 0; } -static void format_v4l2_to_sdl(Uint32 fmt, SDL_PixelFormatEnum *format, SDL_Colorspace *colorspace) +static void format_v4l2_to_sdl(Uint32 fmt, SDL_PixelFormat *format, SDL_Colorspace *colorspace) { switch (fmt) { #define CASE(x, y, z) case x: *format = y; *colorspace = z; return @@ -407,7 +407,7 @@ static void format_v4l2_to_sdl(Uint32 fmt, SDL_PixelFormatEnum *format, SDL_Colo *colorspace = SDL_COLORSPACE_UNKNOWN; } -static Uint32 format_sdl_to_v4l2(SDL_PixelFormatEnum fmt) +static Uint32 format_sdl_to_v4l2(SDL_PixelFormat fmt) { switch (fmt) { #define CASE(y, x) case x: return y @@ -645,7 +645,7 @@ static SDL_bool FindV4L2CameraDeviceByBusInfoCallback(SDL_CameraDevice *device, return (SDL_strcmp(handle->bus_info, (const char *) userdata) == 0); } -static int AddCameraFormat(const int fd, CameraFormatAddData *data, SDL_PixelFormatEnum sdlfmt, SDL_Colorspace colorspace, Uint32 v4l2fmt, int w, int h) +static int AddCameraFormat(const int fd, CameraFormatAddData *data, SDL_PixelFormat sdlfmt, SDL_Colorspace colorspace, Uint32 v4l2fmt, int w, int h) { struct v4l2_frmivalenum frmivalenum; SDL_zero(frmivalenum); @@ -729,7 +729,7 @@ static void MaybeAddDevice(const char *path) SDL_zero(fmtdesc); fmtdesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; while (ioctl(fd, VIDIOC_ENUM_FMT, &fmtdesc) == 0) { - SDL_PixelFormatEnum sdlfmt = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat sdlfmt = SDL_PIXELFORMAT_UNKNOWN; SDL_Colorspace colorspace = SDL_COLORSPACE_UNKNOWN; format_v4l2_to_sdl(fmtdesc.pixelformat, &sdlfmt, &colorspace); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 284d1bda56b16..d42716d85887e 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -58,8 +58,7 @@ SDL3_0.0.0 { SDL_ConvertPixels; SDL_ConvertPixelsAndColorspace; SDL_ConvertSurface; - SDL_ConvertSurfaceFormat; - SDL_ConvertSurfaceFormatAndColorspace; + SDL_ConvertSurfaceAndColorspace; SDL_CopyProperties; SDL_CreateAudioStream; SDL_CreateColorCursor; @@ -330,7 +329,7 @@ SDL3_0.0.0 { SDL_GetKeyboards; SDL_GetLogOutputFunction; SDL_GetLogPriority; - SDL_GetMasksForPixelFormatEnum; + SDL_GetMasksForPixelFormat; SDL_GetMaxHapticEffects; SDL_GetMaxHapticEffectsPlaying; SDL_GetMemoryFunctions; @@ -364,7 +363,8 @@ SDL3_0.0.0 { SDL_GetPens; SDL_GetPerformanceCounter; SDL_GetPerformanceFrequency; - SDL_GetPixelFormatEnumForMasks; + SDL_GetPixelFormatDetails; + SDL_GetPixelFormatForMasks; SDL_GetPixelFormatName; SDL_GetPlatform; SDL_GetPowerInfo; @@ -436,6 +436,7 @@ SDL3_0.0.0 { SDL_GetSurfaceColorKey; SDL_GetSurfaceColorMod; SDL_GetSurfaceColorspace; + SDL_GetSurfacePalette; SDL_GetSurfaceProperties; SDL_GetSystemRAM; SDL_GetSystemTheme; @@ -568,6 +569,8 @@ SDL3_0.0.0 { SDL_LogWarn; SDL_MapRGB; SDL_MapRGBA; + SDL_MapSurfaceRGB; + SDL_MapSurfaceRGBA; SDL_MaximizeWindow; SDL_MemoryBarrierAcquireFunction; SDL_MemoryBarrierReleaseFunction; @@ -724,7 +727,6 @@ SDL3_0.0.0 { SDL_SetModState; SDL_SetNumberProperty; SDL_SetPaletteColors; - SDL_SetPixelFormatPalette; SDL_SetPrimarySelectionText; SDL_SetProperty; SDL_SetPropertyWithCleanup; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 701d5fe3291cc..0c593d688a6e6 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -83,8 +83,7 @@ #define SDL_ConvertPixels SDL_ConvertPixels_REAL #define SDL_ConvertPixelsAndColorspace SDL_ConvertPixelsAndColorspace_REAL #define SDL_ConvertSurface SDL_ConvertSurface_REAL -#define SDL_ConvertSurfaceFormat SDL_ConvertSurfaceFormat_REAL -#define SDL_ConvertSurfaceFormatAndColorspace SDL_ConvertSurfaceFormatAndColorspace_REAL +#define SDL_ConvertSurfaceAndColorspace SDL_ConvertSurfaceAndColorspace_REAL #define SDL_CopyProperties SDL_CopyProperties_REAL #define SDL_CreateAudioStream SDL_CreateAudioStream_REAL #define SDL_CreateColorCursor SDL_CreateColorCursor_REAL @@ -94,7 +93,6 @@ #define SDL_CreateHapticEffect SDL_CreateHapticEffect_REAL #define SDL_CreateMutex SDL_CreateMutex_REAL #define SDL_CreatePalette SDL_CreatePalette_REAL -#define SDL_CreatePixelFormat SDL_CreatePixelFormat_REAL #define SDL_CreatePopupWindow SDL_CreatePopupWindow_REAL #define SDL_CreateProperties SDL_CreateProperties_REAL #define SDL_CreateRWLock SDL_CreateRWLock_REAL @@ -191,8 +189,8 @@ #define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL #define SDL_GetAssertionHandler SDL_GetAssertionHandler_REAL #define SDL_GetAssertionReport SDL_GetAssertionReport_REAL -#define SDL_GetAudioDeviceGain SDL_GetAudioDeviceGain_REAL #define SDL_GetAudioDeviceFormat SDL_GetAudioDeviceFormat_REAL +#define SDL_GetAudioDeviceGain SDL_GetAudioDeviceGain_REAL #define SDL_GetAudioDeviceName SDL_GetAudioDeviceName_REAL #define SDL_GetAudioDriver SDL_GetAudioDriver_REAL #define SDL_GetAudioPlaybackDevices SDL_GetAudioPlaybackDevices_REAL @@ -355,7 +353,7 @@ #define SDL_GetKeyboards SDL_GetKeyboards_REAL #define SDL_GetLogOutputFunction SDL_GetLogOutputFunction_REAL #define SDL_GetLogPriority SDL_GetLogPriority_REAL -#define SDL_GetMasksForPixelFormatEnum SDL_GetMasksForPixelFormatEnum_REAL +#define SDL_GetMasksForPixelFormat SDL_GetMasksForPixelFormat_REAL #define SDL_GetMaxHapticEffects SDL_GetMaxHapticEffects_REAL #define SDL_GetMaxHapticEffectsPlaying SDL_GetMaxHapticEffectsPlaying_REAL #define SDL_GetMemoryFunctions SDL_GetMemoryFunctions_REAL @@ -389,7 +387,8 @@ #define SDL_GetPens SDL_GetPens_REAL #define SDL_GetPerformanceCounter SDL_GetPerformanceCounter_REAL #define SDL_GetPerformanceFrequency SDL_GetPerformanceFrequency_REAL -#define SDL_GetPixelFormatEnumForMasks SDL_GetPixelFormatEnumForMasks_REAL +#define SDL_GetPixelFormatDetails SDL_GetPixelFormatDetails_REAL +#define SDL_GetPixelFormatForMasks SDL_GetPixelFormatForMasks_REAL #define SDL_GetPixelFormatName SDL_GetPixelFormatName_REAL #define SDL_GetPlatform SDL_GetPlatform_REAL #define SDL_GetPowerInfo SDL_GetPowerInfo_REAL @@ -461,6 +460,7 @@ #define SDL_GetSurfaceColorKey SDL_GetSurfaceColorKey_REAL #define SDL_GetSurfaceColorMod SDL_GetSurfaceColorMod_REAL #define SDL_GetSurfaceColorspace SDL_GetSurfaceColorspace_REAL +#define SDL_GetSurfacePalette SDL_GetSurfacePalette_REAL #define SDL_GetSurfaceProperties SDL_GetSurfaceProperties_REAL #define SDL_GetSystemRAM SDL_GetSystemRAM_REAL #define SDL_GetSystemTheme SDL_GetSystemTheme_REAL @@ -593,6 +593,8 @@ #define SDL_LogWarn SDL_LogWarn_REAL #define SDL_MapRGB SDL_MapRGB_REAL #define SDL_MapRGBA SDL_MapRGBA_REAL +#define SDL_MapSurfaceRGB SDL_MapSurfaceRGB_REAL +#define SDL_MapSurfaceRGBA SDL_MapSurfaceRGBA_REAL #define SDL_MaximizeWindow SDL_MaximizeWindow_REAL #define SDL_MemoryBarrierAcquireFunction SDL_MemoryBarrierAcquireFunction_REAL #define SDL_MemoryBarrierReleaseFunction SDL_MemoryBarrierReleaseFunction_REAL @@ -749,7 +751,6 @@ #define SDL_SetModState SDL_SetModState_REAL #define SDL_SetNumberProperty SDL_SetNumberProperty_REAL #define SDL_SetPaletteColors SDL_SetPaletteColors_REAL -#define SDL_SetPixelFormatPalette SDL_SetPixelFormatPalette_REAL #define SDL_SetPrimarySelectionText SDL_SetPrimarySelectionText_REAL #define SDL_SetProperty SDL_SetProperty_REAL #define SDL_SetPropertyWithCleanup SDL_SetPropertyWithCleanup_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 75fd300e19183..7d03e3bf8a78b 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -100,11 +100,10 @@ SDL_DYNAPI_PROC(int,SDL_CloseStorage,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(SDL_BlendMode,SDL_ComposeCustomBlendMode,(SDL_BlendFactor a, SDL_BlendFactor b, SDL_BlendOperation c, SDL_BlendFactor d, SDL_BlendFactor e, SDL_BlendOperation f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_ConvertAudioSamples,(const SDL_AudioSpec *a, const Uint8 *b, int c, const SDL_AudioSpec *d, Uint8 **e, int *f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_ConvertEventToRenderCoordinates,(SDL_Renderer *a, SDL_Event *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_ConvertPixels,(int a, int b, SDL_PixelFormatEnum c, const void *d, int e, SDL_PixelFormatEnum f, void *g, int h),(a,b,c,d,e,f,g,h),return) -SDL_DYNAPI_PROC(int,SDL_ConvertPixelsAndColorspace,(int a, int b, SDL_PixelFormatEnum c, SDL_Colorspace d, SDL_PropertiesID e, const void *f, int g, SDL_PixelFormatEnum h, SDL_Colorspace i, SDL_PropertiesID j, void *k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurface,(SDL_Surface *a, const SDL_PixelFormat *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceFormat,(SDL_Surface *a, SDL_PixelFormatEnum b),(a,b),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceFormatAndColorspace,(SDL_Surface *a, SDL_PixelFormatEnum b, SDL_Colorspace c, SDL_PropertiesID d),(a,b,c,d),return) +SDL_DYNAPI_PROC(int,SDL_ConvertPixels,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h),(a,b,c,d,e,f,g,h),return) +SDL_DYNAPI_PROC(int,SDL_ConvertPixelsAndColorspace,(int a, int b, SDL_PixelFormat c, SDL_Colorspace d, SDL_PropertiesID e, const void *f, int g, SDL_PixelFormat h, SDL_Colorspace i, SDL_PropertiesID j, void *k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) +SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurface,(SDL_Surface *a, SDL_PixelFormat b),(a,b),return) +SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceAndColorspace,(SDL_Surface *a, SDL_PixelFormat b, const SDL_Palette *c, SDL_Colorspace d, SDL_PropertiesID e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_CopyProperties,(SDL_PropertiesID a, SDL_PropertiesID b),(a,b),return) SDL_DYNAPI_PROC(SDL_AudioStream*,SDL_CreateAudioStream,(const SDL_AudioSpec *a, const SDL_AudioSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateColorCursor,(SDL_Surface *a, int b, int c),(a,b,c),return) @@ -114,7 +113,6 @@ SDL_DYNAPI_PROC(int,SDL_CreateDirectory,(const char *a),(a),return) SDL_DYNAPI_PROC(int,SDL_CreateHapticEffect,(SDL_Haptic *a, const SDL_HapticEffect *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Mutex*,SDL_CreateMutex,(void),(),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_CreatePalette,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_PixelFormat*,SDL_CreatePixelFormat,(SDL_PixelFormatEnum a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_CreatePopupWindow,(SDL_Window *a, int b, int c, int d, int e, SDL_WindowFlags f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_CreateProperties,(void),(),return) SDL_DYNAPI_PROC(SDL_RWLock*,SDL_CreateRWLock,(void),(),return) @@ -123,11 +121,11 @@ SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateRendererWithProperties,(SDL_PropertiesID SDL_DYNAPI_PROC(SDL_Semaphore*,SDL_CreateSemaphore,(Uint32 a),(a),return) SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateSoftwareRenderer,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_CreateStorageDirectory,(SDL_Storage *a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, SDL_PixelFormatEnum c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(void *a, int b, int c, int d, SDL_PixelFormatEnum e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, SDL_PixelFormat c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(int a, int b, SDL_PixelFormat c, void *d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateSystemCursor,(SDL_SystemCursor a),(a),return) SDL_DYNAPI_PROC(SDL_TLSID,SDL_CreateTLS,(void),(),return) -SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTexture,(SDL_Renderer *a, SDL_PixelFormatEnum b, int c, int d, int e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTexture,(SDL_Renderer *a, SDL_PixelFormat b, int c, int d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureFromSurface,(SDL_Renderer *a, SDL_Surface *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureWithProperties,(SDL_Renderer *a, SDL_PropertiesID b),(a,b),return) SDL_DYNAPI_PROC(SDL_Thread*,SDL_CreateThreadRuntime,(SDL_ThreadFunction a, const char *b, void *c, SDL_FunctionPointer d, SDL_FunctionPointer e),(a,b,c,d,e),return) @@ -148,7 +146,6 @@ SDL_DYNAPI_PROC(void,SDL_DestroyCursor,(SDL_Cursor *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyHapticEffect,(SDL_Haptic *a, int b),(a,b),) SDL_DYNAPI_PROC(void,SDL_DestroyMutex,(SDL_Mutex *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyPalette,(SDL_Palette *a),(a),) -SDL_DYNAPI_PROC(void,SDL_DestroyPixelFormat,(SDL_PixelFormat *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyProperties,(SDL_PropertiesID a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyRWLock,(SDL_RWLock *a),(a),) SDL_DYNAPI_PROC(void,SDL_DestroyRenderer,(SDL_Renderer *a),(a),) @@ -375,7 +372,7 @@ SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_KeyboardID*,SDL_GetKeyboards,(int *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetLogOutputFunction,(SDL_LogOutputFunction *a, void **b),(a,b),) SDL_DYNAPI_PROC(SDL_LogPriority,SDL_GetLogPriority,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_GetMasksForPixelFormatEnum,(SDL_PixelFormatEnum a, int *b, Uint32 *c, Uint32 *d, Uint32 *e, Uint32 *f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(int,SDL_GetMasksForPixelFormat,(SDL_PixelFormat a, int *b, Uint32 *c, Uint32 *d, Uint32 *e, Uint32 *f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(int,SDL_GetMaxHapticEffects,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetMaxHapticEffectsPlaying,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func *b, SDL_realloc_func *c, SDL_free_func *d),(a,b,c,d),) @@ -409,8 +406,9 @@ SDL_DYNAPI_PROC(SDL_PenSubtype,SDL_GetPenType,(SDL_PenID a),(a),return) SDL_DYNAPI_PROC(SDL_PenID*,SDL_GetPens,(int *a),(a),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceCounter,(void),(),return) SDL_DYNAPI_PROC(Uint64,SDL_GetPerformanceFrequency,(void),(),return) -SDL_DYNAPI_PROC(SDL_PixelFormatEnum,SDL_GetPixelFormatEnumForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return) -SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormatEnum a),(a),return) +SDL_DYNAPI_PROC(const SDL_PixelFormatDetails*,SDL_GetPixelFormatDetails,(SDL_PixelFormat a),(a),return) +SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetPixelFormatForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormat a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) SDL_DYNAPI_PROC(char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) @@ -419,8 +417,8 @@ SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return) SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_GetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormat *b, Uint8 *c, Uint8 *d, Uint8 *e),(a,b,c,d,e),) -SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormat *b, Uint8 *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) +SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) +SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadInstanceType,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadType,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) @@ -480,7 +478,8 @@ SDL_DYNAPI_PROC(int,SDL_GetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode *b),( SDL_DYNAPI_PROC(int,SDL_GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorKey,(SDL_Surface *a, Uint32 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorMod,(SDL_Surface *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_Colorspace,SDL_GetSurfaceColorspace,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(SDL_Palette*,SDL_GetSurfacePalette,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSurfaceProperties,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSystemRAM,(void),(),return) SDL_DYNAPI_PROC(SDL_SystemTheme,SDL_GetSystemTheme,(void),(),return) @@ -602,8 +601,10 @@ SDL_DYNAPI_PROC(int,SDL_LockSurface,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_LockTexture,(SDL_Texture *a, const SDL_Rect *b, void **c, int *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_LockTextureToSurface,(SDL_Texture *a, const SDL_Rect *b, SDL_Surface **c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_LogMessageV,(int a, SDL_LogPriority b, SDL_PRINTF_FORMAT_STRING const char *c, va_list d),(a,b,c,d),) -SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormat *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(Uint32,SDL_MapRGB,(const SDL_PixelFormatDetails *a, const SDL_Palette *b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(Uint32,SDL_MapRGBA,(const SDL_PixelFormatDetails *a, const SDL_Palette *b, Uint8 c, Uint8 d, Uint8 e, Uint8 f),(a,b,c,d,e,f),return) +SDL_DYNAPI_PROC(Uint32,SDL_MapSurfaceRGB,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) +SDL_DYNAPI_PROC(Uint32,SDL_MapSurfaceRGBA,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d, Uint8 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_MaximizeWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_MemoryBarrierAcquireFunction,(void),(),) SDL_DYNAPI_PROC(void,SDL_MemoryBarrierReleaseFunction,(void),(),) @@ -643,7 +644,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_PenConnected,(SDL_PenID a),(a),return) SDL_DYNAPI_PROC(int,SDL_PlayHapticRumble,(SDL_Haptic *a, float b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_PollEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(int,SDL_PostSemaphore,(SDL_Semaphore *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormatEnum c, const void *d, int e, SDL_PixelFormatEnum f, void *g, int h),(a,b,c,d,e,f,g,h),return) +SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h),(a,b,c,d,e,f,g,h),return) SDL_DYNAPI_PROC(void,SDL_PumpEvents,(void),(),) SDL_DYNAPI_PROC(int,SDL_PushEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(int,SDL_PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return) @@ -759,7 +760,6 @@ SDL_DYNAPI_PROC(int,SDL_SetMemoryFunctions,(SDL_malloc_func a, SDL_calloc_func b SDL_DYNAPI_PROC(void,SDL_SetModState,(SDL_Keymod a),(a),) SDL_DYNAPI_PROC(int,SDL_SetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return) -SDL_DYNAPI_PROC(int,SDL_SetPixelFormatPalette,(SDL_PixelFormat *a, SDL_Palette *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetPrimarySelectionText,(const char *a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) @@ -783,7 +783,7 @@ SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorKey,(SDL_Surface *a, int b, Uint32 c),(a, SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, int b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTLS,(SDL_TLSID a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetTextInputArea,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index 13ef1e9a93b7b..d7959f8774dcb 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -1493,8 +1493,8 @@ SDL_Cursor *SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y) return NULL; } - if (surface->format->format != SDL_PIXELFORMAT_ARGB8888) { - temp = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ARGB8888); + if (surface->format != SDL_PIXELFORMAT_ARGB8888) { + temp = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ARGB8888); if (!temp) { return NULL; } diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index b880f6fba5f83..6f21fe0f70b79 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -142,9 +142,9 @@ void SDL_QuitRender(void) } } -int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum format) +int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormat format) { - SDL_PixelFormatEnum *texture_formats = (SDL_PixelFormatEnum *)SDL_realloc((void *)renderer->texture_formats, (renderer->num_texture_formats + 2) * sizeof(SDL_PixelFormatEnum)); + SDL_PixelFormat *texture_formats = (SDL_PixelFormat *)SDL_realloc((void *)renderer->texture_formats, (renderer->num_texture_formats + 2) * sizeof(SDL_PixelFormat)); if (!texture_formats) { return -1; } @@ -1244,7 +1244,7 @@ static SDL_bool IsSupportedBlendMode(SDL_Renderer *renderer, SDL_BlendMode blend } } -static SDL_bool IsSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum format) +static SDL_bool IsSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormat format) { int i; @@ -1256,7 +1256,7 @@ static SDL_bool IsSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum fo return SDL_FALSE; } -static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum format) +static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormat format) { int i; @@ -1297,7 +1297,7 @@ static Uint32 GetClosestSupportedFormat(SDL_Renderer *renderer, SDL_PixelFormatE SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props) { SDL_Texture *texture; - SDL_PixelFormatEnum format = (SDL_PixelFormatEnum)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN); + SDL_PixelFormat format = (SDL_PixelFormat)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN); int access = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STATIC); int w = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, 0); int h = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_HEIGHT_NUMBER, 0); @@ -1451,7 +1451,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert return texture; } -SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormatEnum format, int access, int w, int h) +SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, int access, int w, int h) { SDL_Texture *texture; SDL_PropertiesID props = SDL_CreateProperties(); @@ -1466,56 +1466,53 @@ SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormatEnum forma SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface) { - const SDL_PixelFormat *fmt; SDL_bool needAlpha; SDL_bool direct_update; int i; - SDL_PixelFormatEnum format = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat format = SDL_PIXELFORMAT_UNKNOWN; + SDL_Palette *palette; SDL_Texture *texture; - SDL_PropertiesID surface_props, props; + SDL_PropertiesID props; SDL_Colorspace surface_colorspace = SDL_COLORSPACE_UNKNOWN; SDL_Colorspace texture_colorspace = SDL_COLORSPACE_UNKNOWN; CHECK_RENDERER_MAGIC(renderer, NULL); - if (!surface) { + if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("SDL_CreateTextureFromSurface(): surface"); return NULL; } /* See what the best texture format is */ - fmt = surface->format; - if (fmt->Amask || SDL_SurfaceHasColorKey(surface)) { + if (SDL_ISPIXELFORMAT_ALPHA(surface->format) || SDL_SurfaceHasColorKey(surface)) { needAlpha = SDL_TRUE; } else { needAlpha = SDL_FALSE; } /* If Palette contains alpha values, promotes to alpha format */ - if (fmt->palette) { + palette = SDL_GetSurfacePalette(surface); + if (palette) { SDL_bool is_opaque, has_alpha_channel; - SDL_DetectPalette(fmt->palette, &is_opaque, &has_alpha_channel); + SDL_DetectPalette(palette, &is_opaque, &has_alpha_channel); if (!is_opaque) { needAlpha = SDL_TRUE; } } - if (SDL_GetSurfaceColorspace(surface, &surface_colorspace) < 0) { - return NULL; - } - texture_colorspace = surface_colorspace; + texture_colorspace = SDL_GetSurfaceColorspace(surface); /* Try to have the best pixel format for the texture */ /* No alpha, but a colorkey => promote to alpha */ - if (!fmt->Amask && SDL_SurfaceHasColorKey(surface)) { - if (fmt->format == SDL_PIXELFORMAT_XRGB8888) { + if (!SDL_ISPIXELFORMAT_ALPHA(surface->format) && SDL_SurfaceHasColorKey(surface)) { + if (surface->format == SDL_PIXELFORMAT_XRGB8888) { for (i = 0; i < renderer->num_texture_formats; ++i) { if (renderer->texture_formats[i] == SDL_PIXELFORMAT_ARGB8888) { format = SDL_PIXELFORMAT_ARGB8888; break; } } - } else if (fmt->format == SDL_PIXELFORMAT_XBGR8888) { + } else if (surface->format == SDL_PIXELFORMAT_XBGR8888) { for (i = 0; i < renderer->num_texture_formats; ++i) { if (renderer->texture_formats[i] == SDL_PIXELFORMAT_ABGR8888) { format = SDL_PIXELFORMAT_ABGR8888; @@ -1526,15 +1523,15 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s } else { /* Exact match would be fine */ for (i = 0; i < renderer->num_texture_formats; ++i) { - if (renderer->texture_formats[i] == fmt->format) { - format = fmt->format; + if (renderer->texture_formats[i] == surface->format) { + format = surface->format; break; } } } /* Look for 10-bit pixel formats if needed */ - if (format == SDL_PIXELFORMAT_UNKNOWN && SDL_ISPIXELFORMAT_10BIT(fmt->format)) { + if (format == SDL_PIXELFORMAT_UNKNOWN && SDL_ISPIXELFORMAT_10BIT(surface->format)) { for (i = 0; i < renderer->num_texture_formats; ++i) { if (SDL_ISPIXELFORMAT_10BIT(renderer->texture_formats[i])) { format = renderer->texture_formats[i]; @@ -1545,7 +1542,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s /* Look for floating point pixel formats if needed */ if (format == SDL_PIXELFORMAT_UNKNOWN && - (SDL_ISPIXELFORMAT_10BIT(fmt->format) || SDL_ISPIXELFORMAT_FLOAT(fmt->format))) { + (SDL_ISPIXELFORMAT_10BIT(surface->format) || SDL_ISPIXELFORMAT_FLOAT(surface->format))) { for (i = 0; i < renderer->num_texture_formats; ++i) { if (SDL_ISPIXELFORMAT_FLOAT(renderer->texture_formats[i])) { format = renderer->texture_formats[i]; @@ -1577,8 +1574,8 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s } } - if (format == surface->format->format && texture_colorspace == surface_colorspace) { - if (surface->format->Amask && SDL_SurfaceHasColorKey(surface)) { + if (format == surface->format && texture_colorspace == surface_colorspace) { + if (SDL_ISPIXELFORMAT_ALPHA(surface->format) && SDL_SurfaceHasColorKey(surface)) { /* Surface and Renderer formats are identical. * Intermediate conversion is needed to convert color key to alpha (SDL_ConvertColorkeyToAlpha()). */ direct_update = SDL_FALSE; @@ -1591,12 +1588,6 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s direct_update = SDL_FALSE; } - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - surface_props = SDL_GetSurfaceProperties(surface); - } else { - surface_props = 0; - } - props = SDL_CreateProperties(); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, texture_colorspace); if (surface_colorspace == texture_colorspace) { @@ -1627,7 +1618,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s SDL_Surface *temp = NULL; /* Set up a destination surface for the texture update */ - temp = SDL_ConvertSurfaceFormatAndColorspace(surface, format, texture_colorspace, surface_props); + temp = SDL_ConvertSurfaceAndColorspace(surface, format, NULL, texture_colorspace, surface->internal->props); if (temp) { SDL_UpdateTexture(texture, NULL, temp->pixels, temp->pitch); SDL_DestroySurface(temp); @@ -2283,7 +2274,7 @@ int SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Sur return ret; } - texture->locked_surface = SDL_CreateSurfaceFrom(pixels, real_rect.w, real_rect.h, pitch, texture->format); + texture->locked_surface = SDL_CreateSurfaceFrom(real_rect.w, real_rect.h, texture->format, pixels, pitch); if (!texture->locked_surface) { SDL_UnlockTexture(texture); return -1; diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index 8d7cb758e3674..a33791d8de8ca 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -65,7 +65,7 @@ struct SDL_Texture SDL_Colorspace colorspace; /**< The colorspace of the texture */ float SDR_white_point; /**< The SDR white point for this content */ float HDR_headroom; /**< The HDR headroom needed by this content */ - SDL_PixelFormatEnum format; /**< The pixel format of the texture */ + SDL_PixelFormat format; /**< The pixel format of the texture */ int access; /**< SDL_TextureAccess */ int w; /**< The width of the texture */ int h; /**< The height of the texture */ @@ -217,7 +217,7 @@ struct SDL_Renderer /* The current renderer info */ const char *name; - SDL_PixelFormatEnum *texture_formats; + SDL_PixelFormat *texture_formats; int num_texture_formats; SDL_bool software; @@ -320,7 +320,7 @@ extern SDL_RenderDriver VITA_GXM_RenderDriver; extern void SDL_QuitRender(void); /* Add a supported texture format to a renderer */ -extern int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormatEnum format); +extern int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormat format); /* Setup colorspace conversion */ extern void SDL_SetupRendererColorspace(SDL_Renderer *renderer, SDL_PropertiesID props); diff --git a/src/render/SDL_yuv_sw.c b/src/render/SDL_yuv_sw.c index 8fa532d895ae7..7f8091eaab345 100644 --- a/src/render/SDL_yuv_sw.c +++ b/src/render/SDL_yuv_sw.c @@ -27,7 +27,7 @@ #include "SDL_yuv_sw_c.h" #include "../video/SDL_yuv_c.h" -SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(SDL_PixelFormatEnum format, int w, int h) +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(SDL_PixelFormat format, int w, int h) { SDL_SW_YUVTexture *swdata; @@ -336,7 +336,7 @@ void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata) } int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, - SDL_PixelFormatEnum target_format, int w, int h, void *pixels, + SDL_PixelFormat target_format, int w, int h, void *pixels, int pitch) { int stretch; @@ -365,7 +365,7 @@ int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, swdata->display->pixels = pixels; swdata->display->pitch = pitch; } else { - swdata->display = SDL_CreateSurfaceFrom(pixels, w, h, pitch, target_format); + swdata->display = SDL_CreateSurfaceFrom(w, h, target_format, pixels, pitch); if (!swdata->display) { return -1; } diff --git a/src/render/SDL_yuv_sw_c.h b/src/render/SDL_yuv_sw_c.h index 25972d4ca5742..5d2830ada64f8 100644 --- a/src/render/SDL_yuv_sw_c.h +++ b/src/render/SDL_yuv_sw_c.h @@ -28,8 +28,8 @@ struct SDL_SW_YUVTexture { - SDL_PixelFormatEnum format; - SDL_PixelFormatEnum target_format; + SDL_PixelFormat format; + SDL_PixelFormat target_format; int w, h; Uint8 *pixels; @@ -44,7 +44,7 @@ struct SDL_SW_YUVTexture typedef struct SDL_SW_YUVTexture SDL_SW_YUVTexture; -SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(SDL_PixelFormatEnum format, int w, int h); +SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(SDL_PixelFormat format, int w, int h); int SDL_SW_QueryYUVTexturePixels(SDL_SW_YUVTexture *swdata, void **pixels, int *pitch); int SDL_SW_UpdateYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, @@ -60,7 +60,7 @@ int SDL_SW_LockYUVTexture(SDL_SW_YUVTexture *swdata, const SDL_Rect *rect, void **pixels, int *pitch); void SDL_SW_UnlockYUVTexture(SDL_SW_YUVTexture *swdata); int SDL_SW_CopyYUVToRGB(SDL_SW_YUVTexture *swdata, const SDL_Rect *srcrect, - SDL_PixelFormatEnum target_format, int w, int h, void *pixels, + SDL_PixelFormat target_format, int w, int h, void *pixels, int pitch); void SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture *swdata); diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index b5cf4513d78c7..33fb54e65b091 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -209,7 +209,7 @@ static D3DFORMAT PixelFormatToD3DFMT(Uint32 format) } } -static SDL_PixelFormatEnum D3DFMTToPixelFormat(D3DFORMAT format) +static SDL_PixelFormat D3DFMTToPixelFormat(D3DFORMAT format) { switch (format) { case D3DFMT_R5G6B5: diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 42ae0be1ee17a..07ae882169c55 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -244,7 +244,7 @@ static const GUID SDL_DXGI_DEBUG_ALL = { 0xe48ae283, 0xda80, 0x490b, { 0x87, 0xe #pragma GCC diagnostic pop #endif -SDL_PixelFormatEnum D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) +SDL_PixelFormat D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) { switch (dxgiFormat) { case DXGI_FORMAT_B8G8R8A8_UNORM: diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index c8340cc15853a..a37834a9a802c 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -361,7 +361,7 @@ static UINT D3D12_Align(UINT location, UINT alignment) return (location + (alignment - 1)) & ~(alignment - 1); } -static SDL_PixelFormatEnum D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) +static SDL_PixelFormat D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat) { switch (dxgiFormat) { case DXGI_FORMAT_B8G8R8A8_UNORM: diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 5f09a2dec726e..6c6399ddcf14c 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1450,7 +1450,7 @@ static int GL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo static SDL_Surface *GL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { GL_RenderData *data = (GL_RenderData *)renderer->driverdata; - SDL_PixelFormatEnum format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ARGB8888; + SDL_PixelFormat format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ARGB8888; GLint internalFormat; GLenum targetFormat, type; int w, h; diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 5be26b1763dc7..cdfa9faed7cbc 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1966,7 +1966,7 @@ static void GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) static SDL_Surface *GLES2_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; - SDL_PixelFormatEnum format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_RGBA32; + SDL_PixelFormat format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_RGBA32; int w, h; SDL_Surface *surface; diff --git a/src/render/software/SDL_blendfillrect.c b/src/render/software/SDL_blendfillrect.c index 6ea4821eb0a09..45c32f96bda5a 100644 --- a/src/render/software/SDL_blendfillrect.c +++ b/src/render/software/SDL_blendfillrect.c @@ -128,7 +128,7 @@ static int SDL_BlendFillRect_ARGB8888(SDL_Surface *dst, const SDL_Rect *rect, static int SDL_BlendFillRect_RGB(SDL_Surface *dst, const SDL_Rect *rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned inva = 0xff - a; switch (fmt->bytes_per_pixel) { @@ -178,7 +178,7 @@ static int SDL_BlendFillRect_RGB(SDL_Surface *dst, const SDL_Rect *rect, static int SDL_BlendFillRect_RGBA(SDL_Surface *dst, const SDL_Rect *rect, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned inva = 0xff - a; switch (fmt->bytes_per_pixel) { @@ -211,24 +211,24 @@ int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect, { SDL_Rect clipped; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_BlendFillRect(): dst"); } /* This function doesn't work on surfaces < 8 bpp */ - if (dst->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(dst->format) < 8) { return SDL_SetError("SDL_BlendFillRect(): Unsupported surface format"); } /* If 'rect' == NULL, then fill the whole surface */ if (rect) { /* Perform clipping */ - if (!SDL_GetRectIntersection(rect, &dst->clip_rect, &clipped)) { + if (!SDL_GetRectIntersection(rect, &dst->internal->clip_rect, &clipped)) { return 0; } rect = &clipped; } else { - rect = &dst->clip_rect; + rect = &dst->internal->clip_rect; } if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -237,23 +237,23 @@ int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect, b = DRAW_MUL(b, a); } - switch (dst->format->bits_per_pixel) { + switch (dst->internal->format->bits_per_pixel) { case 15: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x7C00: return SDL_BlendFillRect_RGB555(dst, rect, blendMode, r, g, b, a); } break; case 16: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0xF800: return SDL_BlendFillRect_RGB565(dst, rect, blendMode, r, g, b, a); } break; case 32: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x00FF0000: - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { return SDL_BlendFillRect_XRGB8888(dst, rect, blendMode, r, g, b, a); } else { return SDL_BlendFillRect_ARGB8888(dst, rect, blendMode, r, g, b, a); @@ -265,7 +265,7 @@ int SDL_BlendFillRect(SDL_Surface *dst, const SDL_Rect *rect, break; } - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { return SDL_BlendFillRect_RGB(dst, rect, blendMode, r, g, b, a); } else { return SDL_BlendFillRect_RGBA(dst, rect, blendMode, r, g, b, a); @@ -281,12 +281,12 @@ int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; int status = 0; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_BlendFillRects(): dst"); } /* This function doesn't work on surfaces < 8 bpp */ - if (dst->format->bits_per_pixel < 8) { + if (dst->internal->format->bits_per_pixel < 8) { return SDL_SetError("SDL_BlendFillRects(): Unsupported surface format"); } @@ -297,23 +297,23 @@ int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, } /* FIXME: Does this function pointer slow things down significantly? */ - switch (dst->format->bits_per_pixel) { + switch (dst->internal->format->bits_per_pixel) { case 15: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x7C00: func = SDL_BlendFillRect_RGB555; } break; case 16: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0xF800: func = SDL_BlendFillRect_RGB565; } break; case 32: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x00FF0000: - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { func = SDL_BlendFillRect_XRGB8888; } else { func = SDL_BlendFillRect_ARGB8888; @@ -326,7 +326,7 @@ int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, } if (!func) { - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { func = SDL_BlendFillRect_RGB; } else { func = SDL_BlendFillRect_RGBA; @@ -335,7 +335,7 @@ int SDL_BlendFillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, for (i = 0; i < count; ++i) { /* Perform clipping */ - if (!SDL_GetRectIntersection(&rects[i], &dst->clip_rect, &rect)) { + if (!SDL_GetRectIntersection(&rects[i], &dst->internal->clip_rect, &rect)) { continue; } status = func(dst, &rect, blendMode, r, g, b, a); diff --git a/src/render/software/SDL_blendline.c b/src/render/software/SDL_blendline.c index f3371576540be..4098280797c3b 100644 --- a/src/render/software/SDL_blendline.c +++ b/src/render/software/SDL_blendline.c @@ -30,7 +30,7 @@ static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -343,7 +343,7 @@ static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -448,7 +448,7 @@ static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2 SDL_BlendMode blendMode, Uint8 _r, Uint8 _g, Uint8 _b, Uint8 _a, SDL_bool draw_end) { - const SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned r, g, b, a, inva; if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) { @@ -763,7 +763,7 @@ typedef void (*BlendLineFunc)(SDL_Surface *dst, Uint8 r, Uint8 g, Uint8 b, Uint8 a, SDL_bool draw_end); -static BlendLineFunc SDL_CalculateBlendLineFunc(const SDL_PixelFormat *fmt) +static BlendLineFunc SDL_CalculateBlendLineFunc(const SDL_PixelFormatDetails *fmt) { switch (fmt->bytes_per_pixel) { case 2: @@ -798,18 +798,18 @@ int SDL_BlendLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, { BlendLineFunc func; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_BlendLine(): dst"); } - func = SDL_CalculateBlendLineFunc(dst->format); + func = SDL_CalculateBlendLineFunc(dst->internal->format); if (!func) { return SDL_SetError("SDL_BlendLine(): Unsupported surface format"); } /* Perform clipping */ /* FIXME: We don't actually want to clip, as it may change line slope */ - if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + if (!SDL_GetRectAndLineIntersection(&dst->internal->clip_rect, &x1, &y1, &x2, &y2)) { return 0; } @@ -826,11 +826,11 @@ int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count, SDL_bool draw_end; BlendLineFunc func; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_SetError("SDL_BlendLines(): Passed NULL destination surface"); } - func = SDL_CalculateBlendLineFunc(dst->format); + func = SDL_CalculateBlendLineFunc(dst->internal->format); if (!func) { return SDL_SetError("SDL_BlendLines(): Unsupported surface format"); } @@ -843,7 +843,7 @@ int SDL_BlendLines(SDL_Surface *dst, const SDL_Point *points, int count, /* Perform clipping */ /* FIXME: We don't actually want to clip, as it may change line slope */ - if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + if (!SDL_GetRectAndLineIntersection(&dst->internal->clip_rect, &x1, &y1, &x2, &y2)) { continue; } diff --git a/src/render/software/SDL_blendpoint.c b/src/render/software/SDL_blendpoint.c index 3435f43dfb183..db325ab94a3f9 100644 --- a/src/render/software/SDL_blendpoint.c +++ b/src/render/software/SDL_blendpoint.c @@ -128,7 +128,7 @@ static int SDL_BlendPoint_ARGB8888(SDL_Surface *dst, int x, int y, SDL_BlendMode static int SDL_BlendPoint_RGB(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned inva = 0xff - a; switch (fmt->bytes_per_pixel) { @@ -178,7 +178,7 @@ static int SDL_BlendPoint_RGB(SDL_Surface *dst, int x, int y, SDL_BlendMode blen static int SDL_BlendPoint_RGBA(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - SDL_PixelFormat *fmt = dst->format; + const SDL_PixelFormatDetails *fmt = dst->internal->format; unsigned inva = 0xff - a; switch (fmt->bytes_per_pixel) { @@ -209,19 +209,19 @@ static int SDL_BlendPoint_RGBA(SDL_Surface *dst, int x, int y, SDL_BlendMode ble int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_BlendPoint(): dst"); } /* This function doesn't work on surfaces < 8 bpp */ - if (dst->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(dst->format) < 8) { return SDL_SetError("SDL_BlendPoint(): Unsupported surface format"); } /* Perform clipping */ - if (x < dst->clip_rect.x || y < dst->clip_rect.y || - x >= (dst->clip_rect.x + dst->clip_rect.w) || - y >= (dst->clip_rect.y + dst->clip_rect.h)) { + if (x < dst->internal->clip_rect.x || y < dst->internal->clip_rect.y || + x >= (dst->internal->clip_rect.x + dst->internal->clip_rect.w) || + y >= (dst->internal->clip_rect.y + dst->internal->clip_rect.h)) { return 0; } @@ -231,23 +231,23 @@ int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint b = DRAW_MUL(b, a); } - switch (dst->format->bits_per_pixel) { + switch (dst->internal->format->bits_per_pixel) { case 15: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x7C00: return SDL_BlendPoint_RGB555(dst, x, y, blendMode, r, g, b, a); } break; case 16: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0xF800: return SDL_BlendPoint_RGB565(dst, x, y, blendMode, r, g, b, a); } break; case 32: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x00FF0000: - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { return SDL_BlendPoint_XRGB8888(dst, x, y, blendMode, r, g, b, a); } else { return SDL_BlendPoint_ARGB8888(dst, x, y, blendMode, r, g, b, a); @@ -259,7 +259,7 @@ int SDL_BlendPoint(SDL_Surface *dst, int x, int y, SDL_BlendMode blendMode, Uint break; } - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { return SDL_BlendPoint_RGB(dst, x, y, blendMode, r, g, b, a); } else { return SDL_BlendPoint_RGBA(dst, x, y, blendMode, r, g, b, a); @@ -277,12 +277,12 @@ int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; int status = 0; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_BlendPoints(): dst"); } /* This function doesn't work on surfaces < 8 bpp */ - if (dst->format->bits_per_pixel < 8) { + if (dst->internal->format->bits_per_pixel < 8) { return SDL_SetError("SDL_BlendPoints(): Unsupported surface format"); } @@ -293,25 +293,25 @@ int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count, } /* FIXME: Does this function pointer slow things down significantly? */ - switch (dst->format->bits_per_pixel) { + switch (dst->internal->format->bits_per_pixel) { case 15: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x7C00: func = SDL_BlendPoint_RGB555; break; } break; case 16: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0xF800: func = SDL_BlendPoint_RGB565; break; } break; case 32: - switch (dst->format->Rmask) { + switch (dst->internal->format->Rmask) { case 0x00FF0000: - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { func = SDL_BlendPoint_XRGB8888; } else { func = SDL_BlendPoint_ARGB8888; @@ -324,17 +324,17 @@ int SDL_BlendPoints(SDL_Surface *dst, const SDL_Point *points, int count, } if (!func) { - if (!dst->format->Amask) { + if (!dst->internal->format->Amask) { func = SDL_BlendPoint_RGB; } else { func = SDL_BlendPoint_RGBA; } } - minx = dst->clip_rect.x; - maxx = dst->clip_rect.x + dst->clip_rect.w - 1; - miny = dst->clip_rect.y; - maxy = dst->clip_rect.y + dst->clip_rect.h - 1; + minx = dst->internal->clip_rect.x; + maxx = dst->internal->clip_rect.x + dst->internal->clip_rect.w - 1; + miny = dst->internal->clip_rect.y; + maxy = dst->internal->clip_rect.y + dst->internal->clip_rect.h - 1; for (i = 0; i < count; ++i) { x = points[i].x; diff --git a/src/render/software/SDL_draw.h b/src/render/software/SDL_draw.h index 6e3eb76b27ef3..56df78d364320 100644 --- a/src/render/software/SDL_draw.h +++ b/src/render/software/SDL_draw.h @@ -364,7 +364,7 @@ #define HLINE(type, op, draw_end) \ { \ int length; \ - int pitch = (dst->pitch / dst->format->bytes_per_pixel); \ + int pitch = (dst->pitch / dst->internal->format->bytes_per_pixel); \ type *pixel; \ if (x1 <= x2) { \ pixel = (type *)dst->pixels + y1 * pitch + x1; \ @@ -386,7 +386,7 @@ #define VLINE(type, op, draw_end) \ { \ int length; \ - int pitch = (dst->pitch / dst->format->bytes_per_pixel); \ + int pitch = (dst->pitch / dst->internal->format->bytes_per_pixel); \ type *pixel; \ if (y1 <= y2) { \ pixel = (type *)dst->pixels + y1 * pitch + x1; \ @@ -408,7 +408,7 @@ #define DLINE(type, op, draw_end) \ { \ int length; \ - int pitch = (dst->pitch / dst->format->bytes_per_pixel); \ + int pitch = (dst->pitch / dst->internal->format->bytes_per_pixel); \ type *pixel; \ if (y1 <= y2) { \ pixel = (type *)dst->pixels + y1 * pitch + x1; \ @@ -628,7 +628,7 @@ do { \ int width = rect->w; \ int height = rect->h; \ - int pitch = (dst->pitch / dst->format->bytes_per_pixel); \ + int pitch = (dst->pitch / dst->internal->format->bytes_per_pixel); \ int skip = pitch - width; \ type *pixel = (type *)dst->pixels + rect->y * pitch + rect->x; \ while (height--) { \ diff --git a/src/render/software/SDL_drawline.c b/src/render/software/SDL_drawline.c index 06e099735262d..17943310102f4 100644 --- a/src/render/software/SDL_drawline.c +++ b/src/render/software/SDL_drawline.c @@ -31,7 +31,7 @@ static void SDL_DrawLine1(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint { if (y1 == y2) { int length; - int pitch = (dst->pitch / dst->format->bytes_per_pixel); + int pitch = (dst->pitch / dst->internal->format->bytes_per_pixel); Uint8 *pixel; if (x1 <= x2) { pixel = (Uint8 *)dst->pixels + y1 * pitch + x1; @@ -64,8 +64,8 @@ static void SDL_DrawLine2(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint DLINE(Uint16, DRAW_FASTSETPIXEL2, draw_end); } else { Uint8 _r, _g, _b, _a; - const SDL_PixelFormat *fmt = dst->format; - SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a); + const SDL_PixelFormatDetails *fmt = dst->internal->format; + SDL_GetRGBA(color, fmt, dst->internal->palette, &_r, &_g, &_b, &_a); if (fmt->Rmask == 0x7C00) { AALINE(x1, y1, x2, y2, DRAW_FASTSETPIXELXY2, DRAW_SETPIXELXY_BLEND_RGB555, @@ -93,8 +93,8 @@ static void SDL_DrawLine4(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint DLINE(Uint32, DRAW_FASTSETPIXEL4, draw_end); } else { Uint8 _r, _g, _b, _a; - const SDL_PixelFormat *fmt = dst->format; - SDL_GetRGBA(color, fmt, &_r, &_g, &_b, &_a); + const SDL_PixelFormatDetails *fmt = dst->internal->format; + SDL_GetRGBA(color, fmt, dst->internal->palette, &_r, &_g, &_b, &_a); if (fmt->Rmask == 0x00FF0000) { if (!fmt->Amask) { AALINE(x1, y1, x2, y2, @@ -117,7 +117,7 @@ typedef void (*DrawLineFunc)(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color, SDL_bool draw_end); -static DrawLineFunc SDL_CalculateDrawLineFunc(const SDL_PixelFormat *fmt) +static DrawLineFunc SDL_CalculateDrawLineFunc(const SDL_PixelFormatDetails *fmt) { switch (fmt->bytes_per_pixel) { case 1: @@ -137,18 +137,18 @@ int SDL_DrawLine(SDL_Surface *dst, int x1, int y1, int x2, int y2, Uint32 color) { DrawLineFunc func; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_DrawLine(): dst"); } - func = SDL_CalculateDrawLineFunc(dst->format); + func = SDL_CalculateDrawLineFunc(dst->internal->format); if (!func) { return SDL_SetError("SDL_DrawLine(): Unsupported surface format"); } /* Perform clipping */ /* FIXME: We don't actually want to clip, as it may change line slope */ - if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + if (!SDL_GetRectAndLineIntersection(&dst->internal->clip_rect, &x1, &y1, &x2, &y2)) { return 0; } @@ -165,11 +165,11 @@ int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count, SDL_bool draw_end; DrawLineFunc func; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_DrawLines(): dst"); } - func = SDL_CalculateDrawLineFunc(dst->format); + func = SDL_CalculateDrawLineFunc(dst->internal->format); if (!func) { return SDL_SetError("SDL_DrawLines(): Unsupported surface format"); } @@ -182,7 +182,7 @@ int SDL_DrawLines(SDL_Surface *dst, const SDL_Point *points, int count, /* Perform clipping */ /* FIXME: We don't actually want to clip, as it may change line slope */ - if (!SDL_GetRectAndLineIntersection(&dst->clip_rect, &x1, &y1, &x2, &y2)) { + if (!SDL_GetRectAndLineIntersection(&dst->internal->clip_rect, &x1, &y1, &x2, &y2)) { continue; } diff --git a/src/render/software/SDL_drawpoint.c b/src/render/software/SDL_drawpoint.c index fa272a8798d22..89174487a44c8 100644 --- a/src/render/software/SDL_drawpoint.c +++ b/src/render/software/SDL_drawpoint.c @@ -27,23 +27,23 @@ int SDL_DrawPoint(SDL_Surface *dst, int x, int y, Uint32 color) { - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_DrawPoint(): dst"); } /* This function doesn't work on surfaces < 8 bpp */ - if (dst->format->bits_per_pixel < 8) { + if (dst->internal->format->bits_per_pixel < 8) { return SDL_SetError("SDL_DrawPoint(): Unsupported surface format"); } /* Perform clipping */ - if (x < dst->clip_rect.x || y < dst->clip_rect.y || - x >= (dst->clip_rect.x + dst->clip_rect.w) || - y >= (dst->clip_rect.y + dst->clip_rect.h)) { + if (x < dst->internal->clip_rect.x || y < dst->internal->clip_rect.y || + x >= (dst->internal->clip_rect.x + dst->internal->clip_rect.w) || + y >= (dst->internal->clip_rect.y + dst->internal->clip_rect.h)) { return 0; } - switch (dst->format->bytes_per_pixel) { + switch (dst->internal->format->bytes_per_pixel) { case 1: DRAW_FASTSETPIXELXY1(x, y); break; @@ -67,19 +67,19 @@ int SDL_DrawPoints(SDL_Surface *dst, const SDL_Point *points, int count, int i; int x, y; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_DrawPoints(): dst"); } /* This function doesn't work on surfaces < 8 bpp */ - if (dst->format->bits_per_pixel < 8) { + if (dst->internal->format->bits_per_pixel < 8) { return SDL_SetError("SDL_DrawPoints(): Unsupported surface format"); } - minx = dst->clip_rect.x; - maxx = dst->clip_rect.x + dst->clip_rect.w - 1; - miny = dst->clip_rect.y; - maxy = dst->clip_rect.y + dst->clip_rect.h - 1; + minx = dst->internal->clip_rect.x; + maxx = dst->internal->clip_rect.x + dst->internal->clip_rect.w - 1; + miny = dst->internal->clip_rect.y; + maxy = dst->internal->clip_rect.y + dst->internal->clip_rect.h - 1; for (i = 0; i < count; ++i) { x = points[i].x; @@ -89,7 +89,7 @@ int SDL_DrawPoints(SDL_Surface *dst, const SDL_Point *points, int count, continue; } - switch (dst->format->bytes_per_pixel) { + switch (dst->internal->format->bytes_per_pixel) { case 1: DRAW_FASTSETPIXELXY1(x, y); break; diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 17bddccf87150..cf28b57de4bab 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -104,7 +104,7 @@ static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr SDL_Surface *surface = SDL_CreateSurface(texture->w, texture->h, texture->format); Uint8 r, g, b, a; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_SetError("Cannot create surface"); } texture->driverdata = surface; @@ -119,7 +119,7 @@ static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr /* Only RLE encode textures without an alpha channel since the RLE coder * discards the color values of pixels with an alpha value of zero. */ - if (texture->access == SDL_TEXTUREACCESS_STATIC && !surface->format->Amask) { + if (texture->access == SDL_TEXTUREACCESS_STATIC && !SDL_ISPIXELFORMAT_ALPHA(surface->format)) { SDL_SetSurfaceRLE(surface, 1); } @@ -140,8 +140,8 @@ static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, src = (Uint8 *)pixels; dst = (Uint8 *)surface->pixels + rect->y * surface->pitch + - rect->x * surface->format->bytes_per_pixel; - length = (size_t)rect->w * surface->format->bytes_per_pixel; + rect->x * surface->internal->format->bytes_per_pixel; + length = (size_t)rect->w * surface->internal->format->bytes_per_pixel; for (row = 0; row < rect->h; ++row) { SDL_memcpy(dst, src, length); src += pitch; @@ -160,7 +160,7 @@ static int SW_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, *pixels = (void *)((Uint8 *)surface->pixels + rect->y * surface->pitch + - rect->x * surface->format->bytes_per_pixel); + rect->x * surface->internal->format->bytes_per_pixel); *pitch = surface->pitch; return 0; } @@ -328,7 +328,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex int blitRequired = SDL_FALSE; int isOpaque = SDL_FALSE; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return -1; } @@ -347,7 +347,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex /* Clone the source surface but use its pixel buffer directly. * The original source surface must be treated as read-only. */ - src_clone = SDL_CreateSurfaceFrom(src->pixels, src->w, src->h, src->pitch, src->format->format); + src_clone = SDL_CreateSurfaceFrom(src->w, src->h, src->format, src->pixels, src->pitch); if (!src_clone) { if (SDL_MUSTLOCK(src)) { SDL_UnlockSurface(src); @@ -360,7 +360,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod); /* SDLgfx_rotateSurface only accepts 32-bit surfaces with a 8888 layout. Everything else has to be converted. */ - if (src->format->bits_per_pixel != 32 || SDL_PIXELLAYOUT(src->format->format) != SDL_PACKEDLAYOUT_8888 || !src->format->Amask) { + if (src->internal->format->bits_per_pixel != 32 || SDL_PIXELLAYOUT(src->format) != SDL_PACKEDLAYOUT_8888 || !SDL_ISPIXELFORMAT_ALPHA(src->format)) { blitRequired = SDL_TRUE; } @@ -382,7 +382,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex } /* Opaque surfaces are much easier to handle with the NONE blend mode. */ - if (blendmode == SDL_BLENDMODE_NONE && !src->format->Amask && alphaMod == 255) { + if (blendmode == SDL_BLENDMODE_NONE && !SDL_ISPIXELFORMAT_ALPHA(src->format) && alphaMod == 255) { isOpaque = SDL_TRUE; } @@ -482,15 +482,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex * mode modulates the colors with the alpha channel, a surface without an alpha mask needs * to be created. This makes all source pixels opaque and the colors get copied correctly. */ - SDL_Surface *src_rotated_rgb; - SDL_PixelFormatEnum f = SDL_GetPixelFormatEnumForMasks(src_rotated->format->bits_per_pixel, - src_rotated->format->Rmask, - src_rotated->format->Gmask, - src_rotated->format->Bmask, - 0); - - src_rotated_rgb = SDL_CreateSurfaceFrom(src_rotated->pixels, src_rotated->w, src_rotated->h, - src_rotated->pitch, f); + SDL_Surface *src_rotated_rgb = SDL_CreateSurfaceFrom(src_rotated->w, src_rotated->h, src_rotated->format, src_rotated->pixels, src_rotated->pitch); if (!src_rotated_rgb) { retval = -1; } else { @@ -680,7 +672,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo SDL_Surface *surface = SW_ActivateRenderer(renderer); SW_DrawStateCache drawstate; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return -1; } @@ -725,7 +717,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo const Uint8 a = (Uint8)SDL_roundf(SDL_clamp(cmd->data.color.color.a, 0.0f, 1.0f) * 255.0f); /* By definition the clear ignores the clip rect */ SDL_SetSurfaceClipRect(surface, NULL); - SDL_FillSurfaceRect(surface, NULL, SDL_MapRGBA(surface->format, r, g, b, a)); + SDL_FillSurfaceRect(surface, NULL, SDL_MapSurfaceRGBA(surface, r, g, b, a)); drawstate.surface_cliprect_dirty = SDL_TRUE; break; } @@ -751,7 +743,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo } if (blend == SDL_BLENDMODE_NONE) { - SDL_DrawPoints(surface, verts, count, SDL_MapRGBA(surface->format, r, g, b, a)); + SDL_DrawPoints(surface, verts, count, SDL_MapSurfaceRGBA(surface, r, g, b, a)); } else { SDL_BlendPoints(surface, verts, count, blend, r, g, b, a); } @@ -779,7 +771,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo } if (blend == SDL_BLENDMODE_NONE) { - SDL_DrawLines(surface, verts, count, SDL_MapRGBA(surface->format, r, g, b, a)); + SDL_DrawLines(surface, verts, count, SDL_MapSurfaceRGBA(surface, r, g, b, a)); } else { SDL_BlendLines(surface, verts, count, blend, r, g, b, a); } @@ -807,7 +799,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo } if (blend == SDL_BLENDMODE_NONE) { - SDL_FillSurfaceRects(surface, verts, count, SDL_MapRGBA(surface->format, r, g, b, a)); + SDL_FillSurfaceRects(surface, verts, count, SDL_MapSurfaceRGBA(surface, r, g, b, a)); } else { SDL_BlendFillRects(surface, verts, count, blend, r, g, b, a); } @@ -842,7 +834,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo /* Prevent to do scaling + clipping on viewport boundaries as it may lose proportion */ if (dstrect->x < 0 || dstrect->y < 0 || dstrect->x + dstrect->w > surface->w || dstrect->y + dstrect->h > surface->h) { - SDL_Surface *tmp = SDL_CreateSurface(dstrect->w, dstrect->h, src->format->format); + SDL_Surface *tmp = SDL_CreateSurface(dstrect->w, dstrect->h, src->format); /* Scale to an intermediate surface, then blit */ if (tmp) { SDL_Rect r; @@ -971,7 +963,7 @@ static SDL_Surface *SW_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect * SDL_Surface *surface = SW_ActivateRenderer(renderer); void *pixels; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return NULL; } @@ -987,9 +979,9 @@ static SDL_Surface *SW_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect * pixels = (void *)((Uint8 *)surface->pixels + rect->y * surface->pitch + - rect->x * surface->format->bytes_per_pixel); + rect->x * surface->internal->format->bytes_per_pixel); - return SDL_DuplicatePixels(rect->w, rect->h, surface->format->format, SDL_COLORSPACE_SRGB, pixels, surface->pitch); + return SDL_DuplicatePixels(rect->w, rect->h, surface->format, SDL_COLORSPACE_SRGB, pixels, surface->pitch); } static int SW_RenderPresent(SDL_Renderer *renderer) @@ -1020,7 +1012,7 @@ static void SW_DestroyRenderer(SDL_Renderer *renderer) SDL_free(data); } -static void SW_SelectBestFormats(SDL_Renderer *renderer, SDL_PixelFormatEnum format) +static void SW_SelectBestFormats(SDL_Renderer *renderer, SDL_PixelFormat format) { /* Prefer the format used by the framebuffer by default. */ SDL_AddSupportedTextureFormat(renderer, format); @@ -1119,7 +1111,7 @@ int SW_CreateRendererForSurface(SDL_Renderer *renderer, SDL_Surface *surface, SD { SW_RenderData *data; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } @@ -1160,7 +1152,7 @@ int SW_CreateRendererForSurface(SDL_Renderer *renderer, SDL_Surface *surface, SD renderer->name = SW_RenderDriver.name; - SW_SelectBestFormats(renderer, surface->format->format); + SW_SelectBestFormats(renderer, surface->format); SDL_SetupRendererColorspace(renderer, create_props); @@ -1193,7 +1185,7 @@ static int SW_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Pro SDL_SetHint(SDL_HINT_RENDER_VSYNC, ""); } - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return -1; } diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index 448cfa8dfa937..02382a8e6ffe2 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -36,11 +36,10 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net #include "../../core/windows/SDL_windows.h" #endif -#include -#include - #include "SDL_rotate.h" +#include "../../video/SDL_blit.h" + /* ---- Internally used structures */ /** @@ -491,14 +490,13 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in { SDL_Surface *rz_dst; int is8bit, angle90; - int i; SDL_BlendMode blendmode; Uint32 colorkey = 0; int colorKeyAvailable = SDL_FALSE; double sangleinv, cangleinv; /* Sanity check */ - if (!src) { + if (!SDL_SurfaceValid(src)) { return NULL; } @@ -508,8 +506,8 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in } } /* This function requires a 32-bit surface or 8-bit surface with a colorkey */ - is8bit = src->format->bits_per_pixel == 8 && colorKeyAvailable; - if (!(is8bit || (src->format->bits_per_pixel == 32 && src->format->Amask))) { + is8bit = src->internal->format->bits_per_pixel == 8 && colorKeyAvailable; + if (!(is8bit || (src->internal->format->bits_per_pixel == 32 && SDL_ISPIXELFORMAT_ALPHA(src->format)))) { return NULL; } @@ -521,18 +519,13 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in rz_dst = NULL; if (is8bit) { /* Target surface is 8 bit */ - rz_dst = SDL_CreateSurface(rect_dest->w, rect_dest->h + GUARD_ROWS, src->format->format); + rz_dst = SDL_CreateSurface(rect_dest->w, rect_dest->h + GUARD_ROWS, src->format); if (rz_dst) { - if (src->format->palette) { - for (i = 0; i < src->format->palette->ncolors; i++) { - rz_dst->format->palette->colors[i] = src->format->palette->colors[i]; - } - rz_dst->format->palette->ncolors = src->format->palette->ncolors; - } + SDL_SetSurfacePalette(rz_dst, src->internal->palette); } } else { /* Target surface is 32 bit with source RGBA ordering */ - rz_dst = SDL_CreateSurface(rect_dest->w, rect_dest->h + GUARD_ROWS, src->format->format); + rz_dst = SDL_CreateSurface(rect_dest->w, rect_dest->h + GUARD_ROWS, src->format); } /* Check target */ @@ -555,7 +548,7 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in /* Without a colorkey, the target texture has to be white for the MOD and MUL blend mode so * that the pixels outside the rotated area don't affect the destination surface. */ - colorkey = SDL_MapRGBA(rz_dst->format, 255, 255, 255, 0); + colorkey = SDL_MapSurfaceRGBA(rz_dst, 255, 255, 255, 0); SDL_FillSurfaceRect(rz_dst, NULL, colorkey); /* Setting a white colorkey for the destination surface makes the final blit discard * all pixels outside of the rotated area. This doesn't interfere with anything because diff --git a/src/render/software/SDL_triangle.c b/src/render/software/SDL_triangle.c index 95a5ddd392eb5..fd4350d061e50 100644 --- a/src/render/software/SDL_triangle.c +++ b/src/render/software/SDL_triangle.c @@ -190,7 +190,7 @@ static void bounding_rect(const SDL_Point *a, const SDL_Point *b, const SDL_Poin Uint8 g = (Uint8)(((Sint64)w0 * c0.g + (Sint64)w1 * c1.g + (Sint64)w2 * c2.g) / area); \ Uint8 b = (Uint8)(((Sint64)w0 * c0.b + (Sint64)w1 * c1.b + (Sint64)w2 * c2.b) / area); \ Uint8 a = (Uint8)(((Sint64)w0 * c0.a + (Sint64)w1 * c1.a + (Sint64)w2 * c2.a) / area); \ - Uint32 color = SDL_MapRGBA(format, r, g, b, a); + Uint32 color = SDL_MapRGBA(format, palette, r, g, b, a); #define TRIANGLE_GET_COLOR \ int r = (int)(((Sint64)w0 * c0.r + (Sint64)w1 * c1.r + (Sint64)w2 * c2.r) / area); \ @@ -235,7 +235,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin SDL_Surface *tmp = NULL; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return -1; } @@ -278,10 +278,10 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin } if (blend != SDL_BLENDMODE_NONE) { - SDL_PixelFormatEnum format = dst->format->format; + SDL_PixelFormat format = dst->format; /* need an alpha format */ - if (!dst->format->Amask) { + if (!SDL_ISPIXELFORMAT_ALPHA(format)) { format = SDL_PIXELFORMAT_ARGB8888; } @@ -293,19 +293,19 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin } if (blend == SDL_BLENDMODE_MOD) { - Uint32 c = SDL_MapRGBA(tmp->format, 255, 255, 255, 255); + Uint32 c = SDL_MapSurfaceRGBA(tmp, 255, 255, 255, 255); SDL_FillSurfaceRect(tmp, NULL, c); } SDL_SetSurfaceBlendMode(tmp, blend); - dstbpp = tmp->format->bytes_per_pixel; + dstbpp = tmp->internal->format->bytes_per_pixel; dst_ptr = (Uint8 *)tmp->pixels; dst_pitch = tmp->pitch; } else { /* Write directly to destination surface */ - dstbpp = dst->format->bytes_per_pixel; + dstbpp = dst->internal->format->bytes_per_pixel; dst_ptr = (Uint8 *)dst->pixels + dstrect.x * dstbpp + dstrect.y * dst->pitch; dst_pitch = dst->pitch; } @@ -359,9 +359,9 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin if (is_uniform) { Uint32 color; if (tmp) { - color = SDL_MapRGBA(tmp->format, c0.r, c0.g, c0.b, c0.a); + color = SDL_MapSurfaceRGBA(tmp, c0.r, c0.g, c0.b, c0.a); } else { - color = SDL_MapRGBA(dst->format, c0.r, c0.g, c0.b, c0.a); + color = SDL_MapSurfaceRGBA(dst, c0.r, c0.g, c0.b, c0.a); } if (dstbpp == 4) { @@ -393,9 +393,14 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin TRIANGLE_END_LOOP } } else { - SDL_PixelFormat *format = dst->format; + const SDL_PixelFormatDetails *format; + SDL_Palette *palette; if (tmp) { - format = tmp->format; + format = tmp->internal->format; + palette = tmp->internal->palette; + } else { + format = dst->internal->format; + palette = dst->internal->palette; } if (dstbpp == 4) { TRIANGLE_BEGIN_LOOP @@ -481,10 +486,10 @@ int SDL_SW_BlitTriangle( int has_modulation; - if (!src) { + if (!SDL_SurfaceValid(src)) { return SDL_InvalidParamError("src"); } - if (!src) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("dst"); } @@ -578,7 +583,7 @@ int SDL_SW_BlitTriangle( } /* Set destination pointer */ - dstbpp = dst->format->bytes_per_pixel; + dstbpp = dst->internal->format->bytes_per_pixel; dst_ptr = (Uint8 *)dst->pixels + dstrect.x * dstbpp + dstrect.y * dst->pitch; dst_pitch = dst->pitch; @@ -653,16 +658,16 @@ int SDL_SW_BlitTriangle( goto end; } - if (blend != SDL_BLENDMODE_NONE || src->format->format != dst->format->format || has_modulation || !is_uniform) { + if (blend != SDL_BLENDMODE_NONE || src->format != dst->format || has_modulation || !is_uniform) { /* Use SDL_BlitTriangle_Slow */ - SDL_BlitInfo *info = &src->map->info; + SDL_BlitInfo *info = &src->internal->map.info; SDL_BlitInfo tmp_info; SDL_zero(tmp_info); - tmp_info.src_fmt = src->format; - tmp_info.dst_fmt = dst->format; + tmp_info.src_fmt = src->internal->format; + tmp_info.dst_fmt = dst->internal->format; tmp_info.flags = info->flags; /* tmp_info.r = info->r; @@ -766,7 +771,7 @@ int SDL_SW_BlitTriangle( #define FORMAT_2101010 1 #define FORMAT_HAS_ALPHA(format) format == 0 #define FORMAT_HAS_NO_ALPHA(format) format < 0 -static int detect_format(SDL_PixelFormat *pf) +static int detect_format(const SDL_PixelFormatDetails *pf) { if (pf->format == SDL_PIXELFORMAT_ARGB2101010) { return FORMAT_2101010; @@ -792,8 +797,8 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info, Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - SDL_PixelFormat *src_fmt = info->src_fmt; - SDL_PixelFormat *dst_fmt = info->dst_fmt; + const SDL_PixelFormatDetails *src_fmt = info->src_fmt; + const SDL_PixelFormatDetails *dst_fmt = info->dst_fmt; int srcbpp = src_fmt->bytes_per_pixel; int dstbpp = dst_fmt->bytes_per_pixel; int srcfmt_val; diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 0454e80ad99de..688a0d1d10788 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -367,7 +367,7 @@ typedef struct SDL_bool issueBatch; } VULKAN_RenderData; -static SDL_PixelFormatEnum VULKAN_VkFormatToSDLPixelFormat(VkFormat vkFormat) +static SDL_PixelFormat VULKAN_VkFormatToSDLPixelFormat(VkFormat vkFormat) { switch (vkFormat) { case VK_FORMAT_B8G8R8A8_UNORM: diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 584c06c3777f6..916f64bdab36a 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1038,14 +1038,14 @@ static void SDLTest_PrintRenderer(SDL_Renderer *renderer) int i; char text[1024]; int max_texture_size; - const SDL_PixelFormatEnum *texture_formats; + const SDL_PixelFormat *texture_formats; name = SDL_GetRendererName(renderer); SDL_Log(" Renderer %s:\n", name); SDL_Log(" VSync: %d\n", (int)SDL_GetNumberProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_VSYNC_NUMBER, 0)); - texture_formats = (const SDL_PixelFormatEnum *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); + texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); if (texture_formats) { (void)SDL_snprintf(text, sizeof(text), " Texture formats: "); for (i = 0; texture_formats[i]; ++i) { @@ -1074,7 +1074,7 @@ static SDL_Surface *SDLTest_LoadIcon(const char *file) return NULL; } - if (icon->format->palette) { + if (icon->format == SDL_PIXELFORMAT_INDEX8) { /* Set the colorkey */ SDL_SetSurfaceColorKey(icon, 1, *((Uint8 *)icon->pixels)); } @@ -1218,7 +1218,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) SDL_Log("Usable bounds: %dx%d at %d,%d\n", usablebounds.w, usablebounds.h, usablebounds.x, usablebounds.y); mode = SDL_GetDesktopDisplayMode(displayID); - SDL_GetMasksForPixelFormatEnum(mode->format, &bpp, &Rmask, &Gmask, + SDL_GetMasksForPixelFormat(mode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); SDL_Log(" Desktop mode: %dx%d@%gx %gHz, %d bits-per-pixel (%s)\n", mode->w, mode->h, mode->pixel_density, mode->refresh_rate, bpp, @@ -1240,7 +1240,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) SDL_Log(" Fullscreen video modes:\n"); for (j = 0; j < m; ++j) { mode = modes[j]; - SDL_GetMasksForPixelFormatEnum(mode->format, &bpp, &Rmask, + SDL_GetMasksForPixelFormat(mode->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask); SDL_Log(" Mode %d: %dx%d@%gx %gHz, %d bits-per-pixel (%s)\n", j, mode->w, mode->h, mode->pixel_density, mode->refresh_rate, bpp, diff --git a/src/test/SDL_test_compare.c b/src/test/SDL_test_compare.c index db2fd04772072..1a696ad4ce74d 100644 --- a/src/test/SDL_test_compare.c +++ b/src/test/SDL_test_compare.c @@ -33,17 +33,6 @@ /* Counter for _CompareSurface calls; used for filename creation when comparisons fail */ static int _CompareSurfaceCount = 0; -static void -LogErrorFormat(const char *name, const SDL_PixelFormat *format) -{ - SDLTest_LogError("%s: %08d %s, %u bits/%u bytes per pixel", name, format->format, SDL_GetPixelFormatName(format->format), - format->bits_per_pixel, format->bytes_per_pixel); - SDLTest_LogError("%s: R mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Rmask, format->Rloss, format->Rshift); - SDLTest_LogError("%s: G mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Gmask, format->Gloss, format->Gshift); - SDLTest_LogError("%s: B mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Bmask, format->Bloss, format->Bshift); - SDLTest_LogError("%s: A mask %08" SDL_PRIx32 ", loss %u, shift %u", name, format->Amask, format->Aloss, format->Ashift); -} - /* Compare surfaces */ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error) { @@ -135,8 +124,8 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, _CompareSurfaceCount++; if (ret != 0) { SDLTest_LogError("Comparison of pixels with allowable error of %i failed %i times.", allowable_error, ret); - LogErrorFormat("Reference surface format", referenceSurface->format); - LogErrorFormat("Actual surface format ", surface->format); + SDLTest_LogError("Reference surface format: %s", SDL_GetPixelFormatName(referenceSurface->format)); + SDLTest_LogError("Actual surface format: %s", SDL_GetPixelFormatName(surface->format)); SDLTest_LogError("First detected occurrence at position %i,%i with a squared RGB-difference of %i.", sampleErrorX, sampleErrorY, sampleDist); SDLTest_LogError("Reference pixel: R=%u G=%u B=%u A=%u", sampleReference.r, sampleReference.g, sampleReference.b, sampleReference.a); SDLTest_LogError("Actual pixel : R=%u G=%u B=%u A=%u", sampleActual.r, sampleActual.g, sampleActual.b, sampleActual.a); diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 3d6830408000b..545f85b4ba9f6 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -62,7 +62,7 @@ * * Encoding of surfaces with per-pixel alpha: * - * The sequence begins with a struct RLEDestFormat describing the target + * The sequence begins with a struct SDL_PixelFormatDetails describing the target * pixel format, to provide reliable un-encoding. * * Each scan line is encoded twice: First all completely opaque pixels, @@ -375,9 +375,9 @@ */ #define RLEPIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ { \ - Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ - ((g >> fmt->Gloss) << fmt->Gshift) | \ - ((b >> fmt->Bloss) << fmt->Bshift) | \ + Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ + ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ + ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ (a << 24); \ } @@ -434,7 +434,7 @@ static void RLEClipBlit(int w, Uint8 *srcbuf, SDL_Surface *surf_dst, Uint8 *dstbuf, const SDL_Rect *srcrect, unsigned alpha) { - SDL_PixelFormat *fmt = surf_dst->format; + const SDL_PixelFormatDetails *fmt = surf_dst->internal->format; CHOOSE_BLIT(RLECLIPBLIT, alpha, fmt); } @@ -461,8 +461,8 @@ static int SDLCALL SDL_RLEBlit(SDL_Surface *surf_src, const SDL_Rect *srcrect, /* Set up the source and destination pointers */ x = dstrect->x; y = dstrect->y; - dstbuf = (Uint8 *)surf_dst->pixels + y * surf_dst->pitch + x * surf_src->format->bytes_per_pixel; - srcbuf = (Uint8 *)surf_src->map->data; + dstbuf = (Uint8 *)surf_dst->pixels + y * surf_dst->pitch + x * surf_src->internal->format->bytes_per_pixel; + srcbuf = (Uint8 *)surf_src->internal->map.data + sizeof(SDL_PixelFormat); { /* skip lines at the top if necessary */ @@ -488,7 +488,7 @@ static int SDLCALL SDL_RLEBlit(SDL_Surface *surf_src, const SDL_Rect *srcrect, } \ } - switch (surf_src->format->bytes_per_pixel) { + switch (surf_src->internal->format->bytes_per_pixel) { case 1: RLESKIP(1, Uint8); break; @@ -507,12 +507,12 @@ static int SDLCALL SDL_RLEBlit(SDL_Surface *surf_src, const SDL_Rect *srcrect, } } - alpha = surf_src->map->info.a; + alpha = surf_src->internal->map.info.a; /* if left or right edge clipping needed, call clip blit */ if (srcrect->x || srcrect->w != surf_src->w) { RLEClipBlit(w, srcbuf, surf_dst, dstbuf, srcrect, alpha); } else { - SDL_PixelFormat *fmt = surf_src->format; + const SDL_PixelFormatDetails *fmt = surf_src->internal->format; #define RLEBLIT(bpp, Type, do_blit) \ do { \ @@ -604,31 +604,11 @@ static int SDLCALL SDL_RLEBlit(SDL_Surface *surf_src, const SDL_Rect *srcrect, 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 bytes_per_pixel; - Uint8 padding[3]; - Uint32 Rmask; - Uint32 Gmask; - Uint32 Bmask; - Uint32 Amask; - Uint8 Rloss; - Uint8 Gloss; - Uint8 Bloss; - Uint8 Aloss; - Uint8 Rshift; - Uint8 Gshift; - Uint8 Bshift; - Uint8 Ashift; -} RLEDestFormat; - /* blit a pixel-alpha RLE surface clipped at the right and/or left edges */ static void RLEAlphaClipBlit(int w, Uint8 *srcbuf, SDL_Surface *surf_dst, Uint8 *dstbuf, const SDL_Rect *srcrect) { - SDL_PixelFormat *df = surf_dst->format; + const SDL_PixelFormatDetails *df = surf_dst->internal->format; /* * clipped blitter: Ptype is the destination pixel type, * Ctype the translucent count type, and do_blend the macro @@ -723,7 +703,7 @@ static int SDLCALL SDL_RLEAlphaBlit(SDL_Surface *surf_src, const SDL_Rect *srcre int x, y; int w = surf_src->w; Uint8 *srcbuf, *dstbuf; - SDL_PixelFormat *df = surf_dst->format; + const SDL_PixelFormatDetails *df = surf_dst->internal->format; /* Lock the destination if necessary */ if (SDL_MUSTLOCK(surf_dst)) { @@ -735,7 +715,7 @@ static int SDLCALL SDL_RLEAlphaBlit(SDL_Surface *surf_src, const SDL_Rect *srcre x = dstrect->x; y = dstrect->y; dstbuf = (Uint8 *)surf_dst->pixels + y * surf_dst->pitch + x * df->bytes_per_pixel; - srcbuf = (Uint8 *)surf_src->map->data + sizeof(RLEDestFormat); + srcbuf = (Uint8 *)surf_src->internal->map.data + sizeof(SDL_PixelFormat); { /* skip lines at the top if necessary */ @@ -884,7 +864,7 @@ static int SDLCALL SDL_RLEAlphaBlit(SDL_Surface *surf_src, const SDL_Rect *srcre /* encode 32bpp rgb + a into 16bpp rgb, losing alpha */ static int copy_opaque_16(void *dst, const Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; Uint16 *d = (Uint16 *)dst; @@ -900,7 +880,7 @@ static int copy_opaque_16(void *dst, const Uint32 *src, int n, /* decode opaque pixels from 16bpp to 32bpp rgb + a */ static int uncopy_opaque_16(Uint32 *dst, const void *src, int n, - RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; const Uint16 *s = (const Uint16 *)src; @@ -917,7 +897,7 @@ static int uncopy_opaque_16(Uint32 *dst, const void *src, int n, /* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 565 */ static int copy_transl_565(void *dst, const Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; Uint32 *d = (Uint32 *)dst; @@ -935,7 +915,7 @@ static int copy_transl_565(void *dst, const Uint32 *src, int n, /* encode 32bpp rgb + a into 32bpp G0RAB format for blitting into 555 */ static int copy_transl_555(void *dst, const Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; Uint32 *d = (Uint32 *)dst; @@ -953,7 +933,7 @@ static int copy_transl_555(void *dst, const Uint32 *src, int n, /* decode translucent pixels from 32bpp GORAB to 32bpp rgb + a */ static int uncopy_transl_16(Uint32 *dst, const void *src, int n, - RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; const Uint32 *s = (const Uint32 *)src; @@ -971,7 +951,7 @@ static int uncopy_transl_16(Uint32 *dst, const void *src, int n, /* encode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ static int copy_32(void *dst, const Uint32 *src, int n, - SDL_PixelFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; Uint32 *d = (Uint32 *)dst; @@ -987,7 +967,7 @@ static int copy_32(void *dst, const Uint32 *src, int n, /* decode 32bpp rgba into 32bpp rgba, keeping alpha (dual purpose) */ static int uncopy_32(Uint32 *dst, const void *src, int n, - RLEDestFormat *sfmt, SDL_PixelFormat *dfmt) + const SDL_PixelFormatDetails *sfmt, const SDL_PixelFormatDetails *dfmt) { int i; const Uint32 *s = (const Uint32 *)src; @@ -1011,23 +991,23 @@ static int uncopy_32(Uint32 *dst, const void *src, int n, static int RLEAlphaSurface(SDL_Surface *surface) { SDL_Surface *dest; - SDL_PixelFormat *df; + const SDL_PixelFormatDetails *df; int maxsize = 0; int max_opaque_run; int max_transl_run = 65535; unsigned masksum; Uint8 *rlebuf, *dst; int (*copy_opaque)(void *, const Uint32 *, int, - SDL_PixelFormat *, SDL_PixelFormat *); + const SDL_PixelFormatDetails *, const SDL_PixelFormatDetails *); int (*copy_transl)(void *, const Uint32 *, int, - SDL_PixelFormat *, SDL_PixelFormat *); + const SDL_PixelFormatDetails *, const SDL_PixelFormatDetails *); - dest = surface->map->dst; + dest = surface->internal->map.dst; if (!dest) { return -1; } - df = dest->format; - if (surface->format->bits_per_pixel != 32) { + df = dest->internal->format; + if (surface->internal->format->bits_per_pixel != 32) { return -1; /* only 32bpp source supported */ } @@ -1078,35 +1058,20 @@ static int RLEAlphaSurface(SDL_Surface *surface) return -1; /* anything else unsupported right now */ } - maxsize += sizeof(RLEDestFormat); + maxsize += sizeof(SDL_PixelFormat); rlebuf = (Uint8 *)SDL_malloc(maxsize); if (!rlebuf) { return -1; } - { - /* save the destination format so we can undo the encoding later */ - RLEDestFormat *r = (RLEDestFormat *)rlebuf; - r->bytes_per_pixel = df->bytes_per_pixel; - r->Rmask = df->Rmask; - r->Gmask = df->Gmask; - r->Bmask = df->Bmask; - r->Amask = df->Amask; - r->Rloss = df->Rloss; - r->Gloss = df->Gloss; - r->Bloss = df->Bloss; - r->Aloss = df->Aloss; - r->Rshift = df->Rshift; - r->Gshift = df->Gshift; - r->Bshift = df->Bshift; - r->Ashift = df->Ashift; - } - dst = rlebuf + sizeof(RLEDestFormat); + /* save the destination format so we can undo the encoding later */ + *(SDL_PixelFormat *)rlebuf = df->format; + dst = rlebuf + sizeof(SDL_PixelFormat); /* Do the actual encoding */ { int x, y; int h = surface->h, w = surface->w; - SDL_PixelFormat *sf = surface->format; + const SDL_PixelFormatDetails *sf = surface->internal->format; Uint32 *src = (Uint32 *)surface->pixels; Uint8 *lastline = dst; /* end of last non-blank line */ @@ -1213,10 +1178,10 @@ static int RLEAlphaSurface(SDL_Surface *surface) #undef ADD_TRANSL_COUNTS /* Now that we have it encoded, release the original pixels */ - if (!(surface->flags & SDL_PREALLOC)) { - if (surface->flags & SDL_SIMD_ALIGNED) { + if (!(surface->flags & SDL_SURFACE_PREALLOCATED)) { + if (surface->flags & SDL_SURFACE_SIMD_ALIGNED) { SDL_aligned_free(surface->pixels); - surface->flags &= ~SDL_SIMD_ALIGNED; + surface->flags &= ~SDL_SURFACE_SIMD_ALIGNED; } else { SDL_free(surface->pixels); } @@ -1229,7 +1194,7 @@ static int RLEAlphaSurface(SDL_Surface *surface) if (!p) { p = rlebuf; } - surface->map->data = p; + surface->internal->map.data = p; } return 0; @@ -1272,7 +1237,7 @@ static int RLEColorkeySurface(SDL_Surface *surface) int y; Uint8 *srcbuf, *lastline; int maxsize = 0; - const int bpp = surface->format->bytes_per_pixel; + const int bpp = surface->internal->format->bytes_per_pixel; getpix_func getpix; Uint32 ckey, rgbmask; int w, h; @@ -1307,8 +1272,8 @@ static int RLEColorkeySurface(SDL_Surface *surface) srcbuf = (Uint8 *)surface->pixels; maxn = bpp == 4 ? 65535 : 255; dst = rlebuf; - rgbmask = ~surface->format->Amask; - ckey = surface->map->info.colorkey & rgbmask; + rgbmask = ~surface->internal->format->Amask; + ckey = surface->internal->map.info.colorkey & rgbmask; lastline = dst; getpix = getpixes[bpp - 1]; w = surface->w; @@ -1380,10 +1345,10 @@ static int RLEColorkeySurface(SDL_Surface *surface) #undef ADD_COUNTS /* Now that we have it encoded, release the original pixels */ - if (!(surface->flags & SDL_PREALLOC)) { - if (surface->flags & SDL_SIMD_ALIGNED) { + if (!(surface->flags & SDL_SURFACE_PREALLOCATED)) { + if (surface->flags & SDL_SURFACE_SIMD_ALIGNED) { SDL_aligned_free(surface->pixels); - surface->flags &= ~SDL_SIMD_ALIGNED; + surface->flags &= ~SDL_SURFACE_SIMD_ALIGNED; } else { SDL_free(surface->pixels); } @@ -1397,7 +1362,7 @@ static int RLEColorkeySurface(SDL_Surface *surface) if (!p) { p = rlebuf; } - surface->map->data = p; + surface->internal->map.data = p; } return 0; @@ -1408,12 +1373,12 @@ int SDL_RLESurface(SDL_Surface *surface) int flags; /* Clear any previous RLE conversion */ - if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { - SDL_UnRLESurface(surface, 1); + if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + SDL_UnRLESurface(surface, SDL_TRUE); } /* We don't support RLE encoding of bitmaps */ - if (surface->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(surface->format) < 8) { return -1; } @@ -1422,10 +1387,10 @@ int SDL_RLESurface(SDL_Surface *surface) return -1; } - flags = surface->map->info.flags; + flags = surface->internal->map.info.flags; if (flags & SDL_COPY_COLORKEY) { /* ok */ - } else if ((flags & SDL_COPY_BLEND) && surface->format->Amask) { + } else if ((flags & SDL_COPY_BLEND) && SDL_ISPIXELFORMAT_ALPHA(surface->format)) { /* ok */ } else { /* If we don't have colorkey or blending, nothing to do... */ @@ -1434,32 +1399,33 @@ int SDL_RLESurface(SDL_Surface *surface) /* Pass on combinations not supported */ if ((flags & SDL_COPY_MODULATE_COLOR) || - ((flags & SDL_COPY_MODULATE_ALPHA) && surface->format->Amask) || + ((flags & SDL_COPY_MODULATE_ALPHA) && SDL_ISPIXELFORMAT_ALPHA(surface->format)) || (flags & (SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) || (flags & SDL_COPY_NEAREST)) { return -1; } /* Encode and set up the blit */ - if (!surface->format->Amask || !(flags & SDL_COPY_BLEND)) { - if (!surface->map->identity) { + if (!SDL_ISPIXELFORMAT_ALPHA(surface->format) || !(flags & SDL_COPY_BLEND)) { + if (!surface->internal->map.identity) { return -1; } if (RLEColorkeySurface(surface) < 0) { return -1; } - surface->map->blit = SDL_RLEBlit; - surface->map->info.flags |= SDL_COPY_RLE_COLORKEY; + surface->internal->map.blit = SDL_RLEBlit; + surface->internal->map.info.flags |= SDL_COPY_RLE_COLORKEY; } else { if (RLEAlphaSurface(surface) < 0) { return -1; } - surface->map->blit = SDL_RLEAlphaBlit; - surface->map->info.flags |= SDL_COPY_RLE_ALPHAKEY; + surface->internal->map.blit = SDL_RLEAlphaBlit; + surface->internal->map.info.flags |= SDL_COPY_RLE_ALPHAKEY; } /* The surface is now accelerated */ - surface->flags |= SDL_RLEACCEL; + surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; + SDL_UpdateSurfaceLockFlag(surface); return 0; } @@ -1474,12 +1440,12 @@ static SDL_bool UnRLEAlpha(SDL_Surface *surface) { Uint8 *srcbuf; Uint32 *dst; - SDL_PixelFormat *sf = surface->format; - RLEDestFormat *df = (RLEDestFormat *)surface->map->data; + const SDL_PixelFormatDetails *sf = surface->internal->format; + const SDL_PixelFormatDetails *df = SDL_GetPixelFormatDetails(*(SDL_PixelFormat *)surface->internal->map.data); int (*uncopy_opaque)(Uint32 *, const void *, int, - RLEDestFormat *, SDL_PixelFormat *); + const SDL_PixelFormatDetails *, const SDL_PixelFormatDetails *); int (*uncopy_transl)(Uint32 *, const void *, int, - RLEDestFormat *, SDL_PixelFormat *); + const SDL_PixelFormatDetails *, const SDL_PixelFormatDetails *); int w = surface->w; int bpp = df->bytes_per_pixel; size_t size; @@ -1499,12 +1465,12 @@ static SDL_bool UnRLEAlpha(SDL_Surface *surface) if (!surface->pixels) { return SDL_FALSE; } - surface->flags |= SDL_SIMD_ALIGNED; + surface->flags |= SDL_SURFACE_SIMD_ALIGNED; /* fill background with transparent pixels */ SDL_memset(surface->pixels, 0, (size_t)surface->h * surface->pitch); dst = (Uint32 *)surface->pixels; - srcbuf = (Uint8 *)(df + 1); + srcbuf = (Uint8 *)surface->internal->map.data + sizeof(SDL_PixelFormat); for (;;) { /* copy opaque pixels */ int ofs = 0; @@ -1551,32 +1517,35 @@ static SDL_bool UnRLEAlpha(SDL_Surface *surface) return SDL_TRUE; } -void SDL_UnRLESurface(SDL_Surface *surface, int recode) +void SDL_UnRLESurface(SDL_Surface *surface, SDL_bool recode) { - if (surface->flags & SDL_RLEACCEL) { - surface->flags &= ~SDL_RLEACCEL; + if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + surface->internal->flags &= ~SDL_INTERNAL_SURFACE_RLEACCEL; + SDL_UpdateSurfaceLockFlag(surface); - if (recode && !(surface->flags & SDL_PREALLOC)) { - if (surface->map->info.flags & SDL_COPY_RLE_COLORKEY) { + if (recode && !(surface->flags & SDL_SURFACE_PREALLOCATED)) { + if (surface->internal->map.info.flags & SDL_COPY_RLE_COLORKEY) { SDL_Rect full; size_t size; /* re-create the original surface */ if (SDL_size_mul_overflow(surface->h, surface->pitch, &size)) { /* Memory corruption? */ - surface->flags |= SDL_RLEACCEL; + surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; + SDL_UpdateSurfaceLockFlag(surface); return; } surface->pixels = SDL_aligned_alloc(SDL_GetSIMDAlignment(), size); if (!surface->pixels) { /* Oh crap... */ - surface->flags |= SDL_RLEACCEL; + surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; + SDL_UpdateSurfaceLockFlag(surface); return; } - surface->flags |= SDL_SIMD_ALIGNED; + surface->flags |= SDL_SURFACE_SIMD_ALIGNED; /* fill it with the background color */ - SDL_FillSurfaceRect(surface, NULL, surface->map->info.colorkey); + SDL_FillSurfaceRect(surface, NULL, surface->internal->map.info.colorkey); /* now render the encoded surface */ full.x = full.y = 0; @@ -1586,16 +1555,17 @@ void SDL_UnRLESurface(SDL_Surface *surface, int recode) } else { if (!UnRLEAlpha(surface)) { /* Oh crap... */ - surface->flags |= SDL_RLEACCEL; + surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; + SDL_UpdateSurfaceLockFlag(surface); return; } } } - surface->map->info.flags &= + surface->internal->map.info.flags &= ~(SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY); - SDL_free(surface->map->data); - surface->map->data = NULL; + SDL_free(surface->internal->map.data); + surface->internal->map.data = NULL; } } diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index 4297976312b92..9ab76a1541bbe 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -61,7 +61,7 @@ static int SDLCALL SDL_SoftBlit(SDL_Surface *src, const SDL_Rect *srcrect, /* Set up source and destination buffer pointers, and BLIT! */ if (okay && !SDL_RectEmpty(srcrect)) { SDL_BlitFunc RunBlit; - SDL_BlitInfo *info = &src->map->info; + SDL_BlitInfo *info = &src->internal->map.info; /* Set up the blit information */ info->src = (Uint8 *)src->pixels + @@ -80,7 +80,7 @@ static int SDLCALL SDL_SoftBlit(SDL_Surface *src, const SDL_Rect *srcrect, info->dst_pitch = dst->pitch; info->dst_skip = info->dst_pitch - info->dst_w * info->dst_fmt->bytes_per_pixel; - RunBlit = (SDL_BlitFunc)src->map->data; + RunBlit = (SDL_BlitFunc)src->internal->map.data; /* Run the actual software blit */ RunBlit(info); @@ -122,7 +122,7 @@ static SDL_bool SDL_UseAltivecPrefetch(void) } #endif /* SDL_PLATFORM_MACOS */ -static SDL_BlitFunc SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int flags, +static SDL_BlitFunc SDL_ChooseBlitFunc(SDL_PixelFormat src_format, SDL_PixelFormat dst_format, int flags, SDL_BlitFuncEntry *entries) { int i, flagcheck = (flags & (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_COLORKEY | SDL_COPY_NEAREST)); @@ -179,37 +179,39 @@ static SDL_BlitFunc SDL_ChooseBlitFunc(Uint32 src_format, Uint32 dst_format, int int SDL_CalculateBlit(SDL_Surface *surface) { SDL_BlitFunc blit = NULL; - SDL_BlitMap *map = surface->map; + SDL_BlitMap *map = &surface->internal->map; SDL_Surface *dst = map->dst; - SDL_Colorspace src_colorspace = SDL_COLORSPACE_UNKNOWN; - SDL_Colorspace dst_colorspace = SDL_COLORSPACE_UNKNOWN; + SDL_Colorspace src_colorspace = SDL_GetSurfaceColorspace(surface); + SDL_Colorspace dst_colorspace = SDL_GetSurfaceColorspace(dst); - if (SDL_GetSurfaceColorspace(surface, &src_colorspace) < 0) { + if (src_colorspace == SDL_COLORSPACE_UNKNOWN) { return -1; } - if (SDL_GetSurfaceColorspace(dst, &dst_colorspace) < 0) { + if (dst_colorspace == SDL_COLORSPACE_UNKNOWN) { return -1; } /* We don't currently support blitting to < 8 bpp surfaces */ - if (dst->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(dst->format) < 8) { SDL_InvalidateMap(map); return SDL_SetError("Blit combination not supported"); } #if SDL_HAVE_RLE /* Clean everything out to start */ - if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { - SDL_UnRLESurface(surface, 1); + if (surface->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + SDL_UnRLESurface(surface, SDL_TRUE); } #endif map->blit = SDL_SoftBlit; map->info.src_surface = surface; - map->info.src_fmt = surface->format; + map->info.src_fmt = surface->internal->format; + map->info.src_pal = surface->internal->palette; map->info.src_pitch = surface->pitch; map->info.dst_surface = dst; - map->info.dst_fmt = dst->format; + map->info.dst_fmt = dst->internal->format; + map->info.dst_pal = dst->internal->palette; map->info.dst_pitch = dst->pitch; #if SDL_HAVE_RLE @@ -224,26 +226,27 @@ int SDL_CalculateBlit(SDL_Surface *surface) /* Choose a standard blit function */ if (!blit) { if (src_colorspace != dst_colorspace || - surface->format->bytes_per_pixel > 4 || - dst->format->bytes_per_pixel > 4) { + SDL_BYTESPERPIXEL(surface->format) > 4 || + SDL_BYTESPERPIXEL(dst->format) > 4) { blit = SDL_Blit_Slow_Float; } } if (!blit) { if (map->identity && !(map->info.flags & ~SDL_COPY_RLE_DESIRED)) { blit = SDL_BlitCopy; - } else if (surface->format->Rloss > 8 || dst->format->Rloss > 8) { + } else if (SDL_ISPIXELFORMAT_10BIT(surface->format) || + SDL_ISPIXELFORMAT_10BIT(dst->format)) { blit = SDL_Blit_Slow; } #if SDL_HAVE_BLIT_0 - else if (surface->format->bits_per_pixel < 8 && - SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + else if (SDL_BITSPERPIXEL(surface->format) < 8 && + SDL_ISPIXELFORMAT_INDEXED(surface->format)) { blit = SDL_CalculateBlit0(surface); } #endif #if SDL_HAVE_BLIT_1 - else if (surface->format->bytes_per_pixel == 1 && - SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { + else if (SDL_BYTESPERPIXEL(surface->format) == 1 && + SDL_ISPIXELFORMAT_INDEXED(surface->format)) { blit = SDL_CalculateBlit1(surface); } #endif @@ -260,8 +263,8 @@ int SDL_CalculateBlit(SDL_Surface *surface) } #if SDL_HAVE_BLIT_AUTO if (!blit) { - Uint32 src_format = surface->format->format; - Uint32 dst_format = dst->format->format; + SDL_PixelFormat src_format = surface->format; + SDL_PixelFormat dst_format = dst->format; blit = SDL_ChooseBlitFunc(src_format, dst_format, map->info.flags, @@ -273,8 +276,8 @@ int SDL_CalculateBlit(SDL_Surface *surface) if (!blit) #endif { - Uint32 src_format = surface->format->format; - Uint32 dst_format = dst->format->format; + SDL_PixelFormat src_format = surface->format; + SDL_PixelFormat dst_format = dst->format; if (!SDL_ISPIXELFORMAT_INDEXED(src_format) && !SDL_ISPIXELFORMAT_FOURCC(src_format) && diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 5facdd5159406..0197ca392f9cb 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -61,8 +61,10 @@ typedef struct int dst_w, dst_h; int dst_pitch; int dst_skip; - SDL_PixelFormat *src_fmt; - SDL_PixelFormat *dst_fmt; + const SDL_PixelFormatDetails *src_fmt; + const SDL_Palette *src_pal; + const SDL_PixelFormatDetails *dst_fmt; + const SDL_Palette *dst_pal; Uint8 *table; int flags; Uint32 colorkey; @@ -73,8 +75,8 @@ typedef void (*SDL_BlitFunc)(SDL_BlitInfo *info); typedef struct { - Uint32 src_format; - Uint32 dst_format; + SDL_PixelFormat src_format; + SDL_PixelFormat dst_format; int flags; unsigned int cpu; SDL_BlitFunc func; @@ -83,8 +85,7 @@ typedef struct typedef int (SDLCALL *SDL_Blit) (struct SDL_Surface *src, const SDL_Rect *srcrect, struct SDL_Surface *dst, const SDL_Rect *dstrect); /* Blit mapping definition */ -/* typedef'ed in SDL_surface.h */ -struct SDL_BlitMap +typedef struct SDL_BlitMap { SDL_Surface *dst; int identity; @@ -96,7 +97,7 @@ struct SDL_BlitMap an invalid mapping */ Uint32 dst_palette_version; Uint32 src_palette_version; -}; +} SDL_BlitMap; /* Functions found in SDL_blit.c */ extern int SDL_CalculateBlit(SDL_Surface *surface); @@ -122,9 +123,9 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* Load pixel of the specified format from a buffer and get its R-G-B values */ #define RGB_FROM_PIXEL(Pixel, fmt, r, g, b) \ { \ - r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + r = SDL_expand_byte[fmt->Rbits][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gbits][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bbits][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ } #define RGB_FROM_RGB565(Pixel, r, g, b) \ { \ @@ -216,12 +217,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } while (0) /* Assemble R-G-B values into a specified pixel format and store them */ -#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ - { \ - Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ - ((g >> fmt->Gloss) << fmt->Gshift) | \ - ((b >> fmt->Bloss) << fmt->Bshift) | \ - fmt->Amask; \ +#define PIXEL_FROM_RGB(Pixel, fmt, r, g, b) \ + { \ + Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ + ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ + ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ + fmt->Amask; \ } #define RGB565_FROM_RGB(Pixel, r, g, b) \ { \ @@ -334,10 +335,10 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); /* FIXME: Should we rescale alpha into 0..255 here? */ #define RGBA_FROM_PIXEL(Pixel, fmt, r, g, b, a) \ { \ - r = SDL_expand_byte[fmt->Rloss][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ - g = SDL_expand_byte[fmt->Gloss][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ - b = SDL_expand_byte[fmt->Bloss][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ - a = SDL_expand_byte[fmt->Aloss][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ + r = SDL_expand_byte[fmt->Rbits][((Pixel & fmt->Rmask) >> fmt->Rshift)]; \ + g = SDL_expand_byte[fmt->Gbits][((Pixel & fmt->Gmask) >> fmt->Gshift)]; \ + b = SDL_expand_byte[fmt->Bbits][((Pixel & fmt->Bmask) >> fmt->Bshift)]; \ + a = SDL_expand_byte[fmt->Abits][((Pixel & fmt->Amask) >> fmt->Ashift)]; \ } #define RGBA_FROM_8888(Pixel, fmt, r, g, b, a) \ { \ @@ -444,12 +445,12 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } while (0) /* FIXME: this isn't correct, especially for Alpha (maximum != 255) */ -#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ - { \ - Pixel = ((r >> fmt->Rloss) << fmt->Rshift) | \ - ((g >> fmt->Gloss) << fmt->Gshift) | \ - ((b >> fmt->Bloss) << fmt->Bshift) | \ - ((a >> fmt->Aloss) << fmt->Ashift); \ +#define PIXEL_FROM_RGBA(Pixel, fmt, r, g, b, a) \ + { \ + Pixel = ((r >> (8 - fmt->Rbits)) << fmt->Rshift) | \ + ((g >> (8 - fmt->Gbits)) << fmt->Gshift) | \ + ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ + ((a >> (8 - fmt->Abits)) << fmt->Ashift); \ } #define ASSEMBLE_RGBA(buf, bpp, fmt, r, g, b, a) \ { \ @@ -713,4 +714,6 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); #pragma warning(disable : 4244) /* '=': conversion from 'X' to 'Y', possible loss of data */ #endif +#include "SDL_surface_c.h" + #endif /* SDL_blit_h_ */ diff --git a/src/video/SDL_blit_0.c b/src/video/SDL_blit_0.c index b2b2014e1df5c..a2b18f4acf346 100644 --- a/src/video/SDL_blit_0.c +++ b/src/video/SDL_blit_0.c @@ -615,8 +615,8 @@ SDL_FORCE_INLINE void BlitBtoNAlpha(SDL_BlitInfo *info, const Uint32 srcbpp) Uint8 *dst = info->dst; int srcskip = info->src_skip; int dstskip = info->dst_skip; - const SDL_Color *srcpal = info->src_fmt->palette->colors; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = info->src_pal->colors; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp; int c; Uint32 pixel; @@ -691,9 +691,8 @@ SDL_FORCE_INLINE void BlitBtoNAlphaKey(SDL_BlitInfo *info, const Uint32 srcbpp) Uint8 *dst = info->dst; int srcskip = info->src_skip; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; - const SDL_Color *srcpal = srcfmt->palette->colors; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = info->src_pal->colors; int dstbpp; int c; Uint32 pixel; @@ -920,14 +919,14 @@ SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface) { int which; - if (surface->map->dst->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(surface->internal->map.dst->format) < 8) { which = 0; } else { - which = surface->map->dst->format->bytes_per_pixel; + which = SDL_BYTESPERPIXEL(surface->internal->map.dst->format); } - if (SDL_PIXELTYPE(surface->format->format) == SDL_PIXELTYPE_INDEX1) { - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + if (SDL_PIXELTYPE(surface->format) == SDL_PIXELTYPE_INDEX1) { + switch (surface->internal->map.info.flags & ~SDL_COPY_RLE_MASK) { case 0: return bitmap_blit_1b[which]; @@ -943,8 +942,8 @@ SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface) return NULL; } - if (SDL_PIXELTYPE(surface->format->format) == SDL_PIXELTYPE_INDEX2) { - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + if (SDL_PIXELTYPE(surface->format) == SDL_PIXELTYPE_INDEX2) { + switch (surface->internal->map.info.flags & ~SDL_COPY_RLE_MASK) { case 0: return bitmap_blit_2b[which]; @@ -960,8 +959,8 @@ SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface) return NULL; } - if (SDL_PIXELTYPE(surface->format->format) == SDL_PIXELTYPE_INDEX4) { - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + if (SDL_PIXELTYPE(surface->format) == SDL_PIXELTYPE_INDEX4) { + switch (surface->internal->map.info.flags & ~SDL_COPY_RLE_MASK) { case 0: return bitmap_blit_4b[which]; diff --git a/src/video/SDL_blit_1.c b/src/video/SDL_blit_1.c index 6048dec5dfc56..0ed8b37ddc263 100644 --- a/src/video/SDL_blit_1.c +++ b/src/video/SDL_blit_1.c @@ -431,8 +431,8 @@ static void Blit1toNAlpha(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *dstfmt = info->dst_fmt; - const SDL_Color *srcpal = info->src_fmt->palette->colors; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = info->src_pal->colors; int dstbpp; Uint32 pixel; unsigned sR, sG, sB, sA; @@ -471,8 +471,8 @@ static void Blit1toNAlphaKey(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *dstfmt = info->dst_fmt; - const SDL_Color *srcpal = info->src_fmt->palette->colors; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; + const SDL_Color *srcpal = info->src_pal->colors; Uint32 ckey = info->colorkey; int dstbpp; Uint32 pixel; @@ -517,15 +517,14 @@ static const SDL_BlitFunc one_blitkey[] = { SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface) { int which; - SDL_PixelFormat *dstfmt; - dstfmt = surface->map->dst->format; - if (dstfmt->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(surface->internal->map.dst->format) < 8) { which = 0; } else { - which = dstfmt->bytes_per_pixel; + which = SDL_BYTESPERPIXEL(surface->internal->map.dst->format); } - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + + switch (surface->internal->map.info.flags & ~SDL_COPY_RLE_MASK) { case 0: return one_blit[which]; @@ -533,7 +532,7 @@ SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface) return one_blitkey[which]; case SDL_COPY_COLORKEY | SDL_COPY_BLEND: /* this is not super-robust but handles a specific case we found sdl12-compat. */ - return (surface->map->info.a == 255) ? one_blitkey[which] : + return (surface->internal->map.info.a == 255) ? one_blitkey[which] : which >= 2 ? Blit1toNAlphaKey : (SDL_BlitFunc)NULL; case SDL_COPY_BLEND: diff --git a/src/video/SDL_blit_A.c b/src/video/SDL_blit_A.c index d87e752478a72..7283073df95aa 100644 --- a/src/video/SDL_blit_A.c +++ b/src/video/SDL_blit_A.c @@ -36,8 +36,8 @@ static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info) Uint8 *dst = info->dst; int dstskip = info->dst_skip; Uint8 *palmap = info->table; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_Color *dstpal = info->dst_pal->colors; int srcbpp = srcfmt->bytes_per_pixel; Uint32 Pixel; unsigned sR, sG, sB; @@ -49,9 +49,9 @@ static void BlitNto1SurfaceAlpha(SDL_BlitInfo *info) DUFFS_LOOP4( { 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; + dR = dstpal[*dst].r; + dG = dstpal[*dst].g; + dB = dstpal[*dst].b; ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB); dR &= 0xff; dG &= 0xff; @@ -82,8 +82,8 @@ static void BlitNto1PixelAlpha(SDL_BlitInfo *info) Uint8 *dst = info->dst; int dstskip = info->dst_skip; Uint8 *palmap = info->table; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_Color *dstpal = info->dst_pal->colors; int srcbpp = srcfmt->bytes_per_pixel; Uint32 Pixel; unsigned sR, sG, sB, sA; @@ -94,9 +94,9 @@ static void BlitNto1PixelAlpha(SDL_BlitInfo *info) DUFFS_LOOP4( { 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; + dR = dstpal[*dst].r; + dG = dstpal[*dst].g; + dB = dstpal[*dst].b; ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB); dR &= 0xff; dG &= 0xff; @@ -127,8 +127,8 @@ static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) Uint8 *dst = info->dst; int dstskip = info->dst_skip; Uint8 *palmap = info->table; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_Color *dstpal = info->dst_pal->colors; int srcbpp = srcfmt->bytes_per_pixel; Uint32 ckey = info->colorkey; Uint32 Pixel; @@ -142,9 +142,9 @@ static void BlitNto1SurfaceAlphaKey(SDL_BlitInfo *info) { 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; + dR = dstpal[*dst].r; + dG = dstpal[*dst].g; + dB = dstpal[*dst].b; ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB); dR &= 0xff; dG &= 0xff; @@ -864,8 +864,8 @@ static void BlitNtoNSurfaceAlpha(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int srcbpp = srcfmt->bytes_per_pixel; int dstbpp = dstfmt->bytes_per_pixel; Uint32 Pixel; @@ -902,8 +902,8 @@ static void BlitNtoNSurfaceAlphaKey(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; Uint32 ckey = info->colorkey; int srcbpp = srcfmt->bytes_per_pixel; int dstbpp = dstfmt->bytes_per_pixel; @@ -942,7 +942,7 @@ static void Blit8888to8888PixelAlpha(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; while (height--) { int i = 0; @@ -970,8 +970,8 @@ static void Blit8888to8888PixelAlphaSwizzle(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; while (height--) { int i = 0; @@ -1000,8 +1000,8 @@ static void SDL_TARGETING("sse4.1") Blit8888to8888PixelAlphaSwizzleSSE41(SDL_Bli int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; // The byte offsets for the start of each pixel const __m128i mask_offsets = _mm_set_epi8( @@ -1092,8 +1092,8 @@ static void SDL_TARGETING("avx2") Blit8888to8888PixelAlphaSwizzleAVX2(SDL_BlitIn int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; // The byte offsets for the start of each pixel const __m256i mask_offsets = _mm256_set_epi8( @@ -1183,8 +1183,8 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int srcbpp; int dstbpp; Uint32 Pixel; @@ -1216,15 +1216,15 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info) SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) { - SDL_PixelFormat *sf = surface->format; - SDL_PixelFormat *df = surface->map->dst->format; + const SDL_PixelFormatDetails *sf = surface->internal->format; + const SDL_PixelFormatDetails *df = surface->internal->map.dst->internal->format; - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + switch (surface->internal->map.info.flags & ~SDL_COPY_RLE_MASK) { case SDL_COPY_BLEND: /* Per-pixel alpha blits */ switch (df->bytes_per_pixel) { case 1: - if (df->palette) { + if (surface->internal->map.info.dst_pal) { return BlitNto1PixelAlpha; } else { /* RGB332 has no palette ! */ @@ -1273,7 +1273,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) /* Per-surface alpha blits */ switch (df->bytes_per_pixel) { case 1: - if (df->palette) { + if (surface->internal->map.info.dst_pal) { return BlitNto1SurfaceAlpha; } else { /* RGB332 has no palette ! */ @@ -1281,7 +1281,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) } case 2: - if (surface->map->identity) { + if (surface->internal->map.identity) { if (df->Gmask == 0x7e0) { #ifdef SDL_MMX_INTRINSICS if (SDL_HasMMX()) { @@ -1328,7 +1328,7 @@ SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface) if (sf->Amask == 0) { if (df->bytes_per_pixel == 1) { - if (df->palette) { + if (surface->internal->map.info.dst_pal) { return BlitNto1SurfaceAlphaKey; } else { /* RGB332 has no palette ! */ diff --git a/src/video/SDL_blit_N.c b/src/video/SDL_blit_N.c index 64a051e1489d3..26dbf6c6c7226 100644 --- a/src/video/SDL_blit_N.c +++ b/src/video/SDL_blit_N.c @@ -117,7 +117,7 @@ static size_t GetL3CacheSize(void) : vec_add(vec_lvsl(8, src), vec_splat_u8(8))) /* Calculate the permute vector used for 32->32 swizzling */ -static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt, const SDL_PixelFormat *dstfmt) +static vector unsigned char calc_swizzle32(const SDL_PixelFormatDetails *srcfmt, const SDL_PixelFormatDetails *dstfmt) { /* * We have to assume that the bits that aren't used by other @@ -125,8 +125,8 @@ static vector unsigned char calc_swizzle32(const SDL_PixelFormat *srcfmt, const * leave alpha with a zero mask, but we should still swizzle the bits. */ /* ARGB */ - static const struct SDL_PixelFormat default_pixel_format = { - 0, NULL, 0, 0, { 0, 0 }, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, 0, 0, 0, 0, 16, 8, 0, 24, 0, NULL + static const SDL_PixelFormatDetails default_pixel_format = { + SDL_PIXELFORMAT_ARGB8888, 0, 0, { 0, 0 }, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000, 8, 8, 8, 8, 16, 8, 0, 24 }; const vector unsigned char plus = VECUINT8_LITERAL(0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, @@ -201,7 +201,7 @@ static void Blit_XRGB8888_RGB565Altivec(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = (Uint8 *)info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; vector unsigned char valpha = vec_splat_u8(0); vector unsigned char vpermute = calc_swizzle32(srcfmt, NULL); vector unsigned char vgmerge = VECUINT8_LITERAL(0x00, 0x02, 0x00, 0x06, @@ -302,8 +302,8 @@ static void Blit_RGB565_32Altivec(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = (Uint8 *)info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; unsigned alpha; vector unsigned char valpha; vector unsigned char vpermute; @@ -440,8 +440,8 @@ static void Blit_RGB555_32Altivec(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = (Uint8 *)info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; unsigned alpha; vector unsigned char valpha; vector unsigned char vpermute; @@ -580,9 +580,9 @@ static void Blit32to32KeyAltivec(SDL_BlitInfo *info) int srcskip = info->src_skip / 4; Uint32 *dstp = (Uint32 *)info->dst; int dstskip = info->dst_skip / 4; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; int srcbpp = srcfmt->bytes_per_pixel; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp = dstfmt->bytes_per_pixel; int copy_alpha = (srcfmt->Amask && dstfmt->Amask); unsigned alpha = dstfmt->Amask ? info->a : 0; @@ -702,8 +702,8 @@ static void ConvertAltivec32to32_noprefetch(SDL_BlitInfo *info) int srcskip = info->src_skip / 4; Uint32 *dst = (Uint32 *)info->dst; int dstskip = info->dst_skip / 4; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; vector unsigned int vzero = vec_splat_u32(0); vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt); if (dstfmt->Amask && !srcfmt->Amask) { @@ -788,8 +788,8 @@ static void ConvertAltivec32to32_prefetch(SDL_BlitInfo *info) int srcskip = info->src_skip / 4; Uint32 *dst = (Uint32 *)info->dst; int dstskip = info->dst_skip / 4; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; vector unsigned int vzero = vec_splat_u32(0); vector unsigned char vpermute = calc_swizzle32(srcfmt, dstfmt); if (dstfmt->Amask && !srcfmt->Amask) { @@ -2064,9 +2064,9 @@ static void Blit_RGB555_ARGB1555(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint16 *dst = (Uint16 *)info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; - Uint16 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift; + Uint16 mask = ((Uint32)info->a >> (8 - dstfmt->Abits)) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ @@ -2096,7 +2096,7 @@ static void BlitNto1(SDL_BlitInfo *info) int srcbpp; Uint32 Pixel; int sR, sG, sB; - SDL_PixelFormat *srcfmt; + const SDL_PixelFormatDetails *srcfmt; /* Set up some basic variables */ width = info->dst_w; @@ -2183,12 +2183,12 @@ static void Blit4to4MaskAlpha(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint32 *dst = (Uint32 *)info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; if (dstfmt->Amask) { /* RGB->RGBA, SET_ALPHA */ - Uint32 mask = ((Uint32)info->a >> dstfmt->Aloss) << dstfmt->Ashift; + Uint32 mask = ((Uint32)info->a >> (8 - dstfmt->Abits)) << dstfmt->Ashift; while (height--) { /* *INDENT-OFF* */ /* clang-format off */ @@ -2224,7 +2224,7 @@ static void Blit4to4MaskAlpha(SDL_BlitInfo *info) } /* permutation for mapping srcfmt to dstfmt, overloading or not the alpha channel */ -static void get_permutation(SDL_PixelFormat *srcfmt, SDL_PixelFormat *dstfmt, +static void get_permutation(const SDL_PixelFormatDetails *srcfmt, const SDL_PixelFormatDetails *dstfmt, int *_p0, int *_p1, int *_p2, int *_p3, int *_alpha_channel) { int alpha_channel = 0, p0, p1, p2, p3; @@ -2318,9 +2318,9 @@ static void BlitNtoN(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; int srcbpp = srcfmt->bytes_per_pixel; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp = dstfmt->bytes_per_pixel; unsigned alpha = dstfmt->Amask ? info->a : 0; @@ -2436,9 +2436,9 @@ static void BlitNtoNCopyAlpha(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; int srcbpp = srcfmt->bytes_per_pixel; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp = dstfmt->bytes_per_pixel; int c; @@ -2493,7 +2493,7 @@ static void BlitNto1Key(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; const Uint8 *palmap = info->table; Uint32 ckey = info->colorkey; Uint32 rgbmask = ~srcfmt->Amask; @@ -2592,8 +2592,8 @@ static void BlitNtoNKey(SDL_BlitInfo *info) Uint8 *dst = info->dst; int dstskip = info->dst_skip; Uint32 ckey = info->colorkey; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int srcbpp = srcfmt->bytes_per_pixel; int dstbpp = dstfmt->bytes_per_pixel; unsigned alpha = dstfmt->Amask ? info->a : 0; @@ -2863,8 +2863,8 @@ static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info) Uint8 *dst = info->dst; int dstskip = info->dst_skip; Uint32 ckey = info->colorkey; - SDL_PixelFormat *srcfmt = info->src_fmt; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; Uint32 rgbmask = ~srcfmt->Amask; Uint8 srcbpp; @@ -2965,7 +2965,7 @@ static void Blit2101010toN(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp = dstfmt->bytes_per_pixel; Uint32 Pixel; unsigned sR, sG, sB, sA; @@ -2996,7 +2996,7 @@ static void BlitNto2101010(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; int srcbpp = srcfmt->bytes_per_pixel; Uint32 Pixel; unsigned sR, sG, sB, sA; @@ -3027,9 +3027,9 @@ static void Blit_3or4_to_3or4__same_rgb(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; int srcbpp = srcfmt->bytes_per_pixel; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp = dstfmt->bytes_per_pixel; if (dstfmt->Amask) { @@ -3100,9 +3100,9 @@ static void Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo *info) int srcskip = info->src_skip; Uint8 *dst = info->dst; int dstskip = info->dst_skip; - SDL_PixelFormat *srcfmt = info->src_fmt; + const SDL_PixelFormatDetails *srcfmt = info->src_fmt; int srcbpp = srcfmt->bytes_per_pixel; - SDL_PixelFormat *dstfmt = info->dst_fmt; + const SDL_PixelFormatDetails *dstfmt = info->dst_fmt; int dstbpp = dstfmt->bytes_per_pixel; if (dstfmt->Amask) { @@ -3336,22 +3336,22 @@ static const struct blit_table *const normal_blit[] = { SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface) { - SDL_PixelFormat *srcfmt; - SDL_PixelFormat *dstfmt; + const SDL_PixelFormatDetails *srcfmt; + const SDL_PixelFormatDetails *dstfmt; const struct blit_table *table; int which; SDL_BlitFunc blitfun; /* Set up data for choosing the blit */ - srcfmt = surface->format; - dstfmt = surface->map->dst->format; + srcfmt = surface->internal->format; + dstfmt = surface->internal->map.dst->internal->format; /* We don't support destinations less than 8-bits */ if (dstfmt->bits_per_pixel < 8) { return NULL; } - switch (surface->map->info.flags & ~SDL_COPY_RLE_MASK) { + switch (surface->internal->map.info.flags & ~SDL_COPY_RLE_MASK) { case 0: blitfun = NULL; if (dstfmt->bits_per_pixel == 8) { @@ -3427,7 +3427,7 @@ SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface) 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->bytes_per_pixel == 2 && surface->map->identity != 0) { + if (srcfmt->bytes_per_pixel == 2 && surface->internal->map.identity != 0) { return Blit2to2Key; } else if (dstfmt->bytes_per_pixel == 1) { return BlitNto1Key; diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c index 31eb1ae974dc8..7bdb090dc60a1 100644 --- a/src/video/SDL_blit_slow.c +++ b/src/video/SDL_blit_slow.c @@ -32,13 +32,13 @@ typedef enum SlowBlitPixelAccess_Large, } SlowBlitPixelAccess; -static SlowBlitPixelAccess GetPixelAccessMethod(SDL_PixelFormat *pf) +static SlowBlitPixelAccess GetPixelAccessMethod(SDL_PixelFormat format) { - if (pf->bytes_per_pixel > 4) { + if (SDL_BYTESPERPIXEL(format) > 4) { return SlowBlitPixelAccess_Large; - } else if (SDL_ISPIXELFORMAT_10BIT(pf->format)) { + } else if (SDL_ISPIXELFORMAT_10BIT(format)) { return SlowBlitPixelAccess_10Bit; - } else if (pf->Amask) { + } else if (SDL_ISPIXELFORMAT_ALPHA(format)) { return SlowBlitPixelAccess_RGBA; } else { return SlowBlitPixelAccess_RGB; @@ -62,8 +62,8 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; - SDL_PixelFormat *src_fmt = info->src_fmt; - SDL_PixelFormat *dst_fmt = info->dst_fmt; + const SDL_PixelFormatDetails *src_fmt = info->src_fmt; + const SDL_PixelFormatDetails *dst_fmt = info->dst_fmt; int srcbpp = src_fmt->bytes_per_pixel; int dstbpp = dst_fmt->bytes_per_pixel; SlowBlitPixelAccess src_access; @@ -71,8 +71,8 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) Uint32 rgbmask = ~src_fmt->Amask; Uint32 ckey = info->colorkey & rgbmask; - src_access = GetPixelAccessMethod(src_fmt); - dst_access = GetPixelAccessMethod(dst_fmt); + src_access = GetPixelAccessMethod(src_fmt->format); + dst_access = GetPixelAccessMethod(dst_fmt->format); incy = ((Uint64)info->src_h << 16) / info->dst_h; incx = ((Uint64)info->src_w << 16) / info->dst_w; @@ -370,7 +370,7 @@ static Uint16 float_to_half(float a) return ir; } -static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, SDL_PixelFormat *fmt, SDL_Colorspace colorspace, float SDR_white_point, +static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_PixelFormatDetails *fmt, SDL_Colorspace colorspace, float SDR_white_point, float *outR, float *outG, float *outB, float *outA) { Uint32 pixel; @@ -525,7 +525,7 @@ static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, SDL_PixelF *outA = fA; } -static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, SDL_PixelFormat *fmt, SDL_Colorspace colorspace, float SDR_white_point, +static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_PixelFormatDetails *fmt, SDL_Colorspace colorspace, float SDR_white_point, float fR, float fG, float fB, float fA) { Uint32 R, G, B, A; @@ -755,8 +755,8 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; - SDL_PixelFormat *src_fmt = info->src_fmt; - SDL_PixelFormat *dst_fmt = info->dst_fmt; + const SDL_PixelFormatDetails *src_fmt = info->src_fmt; + const SDL_PixelFormatDetails *dst_fmt = info->dst_fmt; int srcbpp = src_fmt->bytes_per_pixel; int dstbpp = dst_fmt->bytes_per_pixel; SlowBlitPixelAccess src_access; @@ -772,8 +772,10 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) float src_headroom; SDL_TonemapContext tonemap; - if (SDL_GetSurfaceColorspace(info->src_surface, &src_colorspace) < 0 || - SDL_GetSurfaceColorspace(info->dst_surface, &dst_colorspace) < 0) { + src_colorspace = SDL_GetSurfaceColorspace(info->src_surface); + dst_colorspace = SDL_GetSurfaceColorspace(info->dst_surface); + if (src_colorspace == SDL_COLORSPACE_UNKNOWN || + dst_colorspace == SDL_COLORSPACE_UNKNOWN) { return; } src_primaries = SDL_COLORSPACEPRIMARIES(src_colorspace); @@ -821,8 +823,8 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) color_primaries_matrix = SDL_GetColorPrimariesConversionMatrix(src_primaries, dst_primaries); } - src_access = GetPixelAccessMethod(src_fmt); - dst_access = GetPixelAccessMethod(dst_fmt); + src_access = GetPixelAccessMethod(src_fmt->format); + dst_access = GetPixelAccessMethod(dst_fmt->format); incy = ((Uint64)info->src_h << 16) / info->dst_h; incx = ((Uint64)info->src_w << 16) / info->dst_w; diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 1d80cbd13c3d4..02afb3c699a8e 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -427,10 +427,10 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) /* Create a compatible surface, note that the colors are RGB ordered */ { - SDL_PixelFormatEnum format; + SDL_PixelFormat format; /* Get the pixel format */ - format = SDL_GetPixelFormatEnumForMasks(biBitCount, Rmask, Gmask, Bmask, Amask); + format = SDL_GetPixelFormatForMasks(biBitCount, Rmask, Gmask, Bmask, Amask); surface = SDL_CreateSurface(biWidth, biHeight, format); if (!surface) { @@ -439,7 +439,7 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) } /* Load the palette, if any */ - palette = (surface->format)->palette; + palette = SDL_GetSurfacePalette(surface); if (palette) { if (SDL_SeekIO(src, fp_offset + 14 + biSize, SDL_IO_SEEK_SET) < 0) { SDL_SetError("Error seeking in datastream"); @@ -632,42 +632,42 @@ int SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio) /* Make sure we have somewhere to save */ intermediate_surface = NULL; if (dst) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("surface"); goto done; } #ifdef SAVE_32BIT_BMP /* We can save alpha information in a 32-bit BMP */ - if (surface->format->bits_per_pixel >= 8 && - (surface->format->Amask != 0 || - surface->map->info.flags & SDL_COPY_COLORKEY)) { + if (SDL_BITSPERPIXEL(surface->format) >= 8 && + (SDL_ISPIXELFORMAT_ALPHA(surface->format) || + surface->internal->map.info.flags & SDL_COPY_COLORKEY)) { save32bit = SDL_TRUE; } #endif /* SAVE_32BIT_BMP */ - if (surface->format->palette && !save32bit) { - if (surface->format->bits_per_pixel == 8) { + if (surface->internal->palette && !save32bit) { + if (SDL_BITSPERPIXEL(surface->format) == 8) { intermediate_surface = surface; } else { SDL_SetError("%u bpp BMP files not supported", - surface->format->bits_per_pixel); + SDL_BITSPERPIXEL(surface->format)); goto done; } - } else if ((surface->format->bits_per_pixel == 24) && !save32bit && + } else if ((SDL_BITSPERPIXEL(surface->format) == 24) && !save32bit && #if SDL_BYTEORDER == SDL_LIL_ENDIAN - (surface->format->Rmask == 0x00FF0000) && - (surface->format->Gmask == 0x0000FF00) && - (surface->format->Bmask == 0x000000FF) + (surface->internal->format->Rmask == 0x00FF0000) && + (surface->internal->format->Gmask == 0x0000FF00) && + (surface->internal->format->Bmask == 0x000000FF) #else - (surface->format->Rmask == 0x000000FF) && - (surface->format->Gmask == 0x0000FF00) && - (surface->format->Bmask == 0x00FF0000) + (surface->internal->format->Rmask == 0x000000FF) && + (surface->internal->format->Gmask == 0x0000FF00) && + (surface->internal->format->Bmask == 0x00FF0000) #endif ) { intermediate_surface = surface; } else { - SDL_PixelFormatEnum pixel_format; + SDL_PixelFormat pixel_format; /* If the surface has a colorkey or alpha channel we'll save a 32-bit BMP with alpha channel, otherwise save a 24-bit BMP. */ @@ -676,7 +676,7 @@ int SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio) } else { pixel_format = SDL_PIXELFORMAT_BGR24; } - intermediate_surface = SDL_ConvertSurfaceFormat(surface, pixel_format); + intermediate_surface = SDL_ConvertSurface(surface, pixel_format); if (!intermediate_surface) { SDL_SetError("Couldn't convert image to %d bpp", (int)SDL_BITSPERPIXEL(pixel_format)); @@ -694,7 +694,7 @@ int SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio) } if (SDL_LockSurface(intermediate_surface) == 0) { - const size_t bw = intermediate_surface->w * intermediate_surface->format->bytes_per_pixel; + const size_t bw = intermediate_surface->w * intermediate_surface->internal->format->bytes_per_pixel; /* Set the BMP file header values */ bfSize = 0; /* We'll write this when we're done */ @@ -720,13 +720,13 @@ int SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio) biWidth = intermediate_surface->w; biHeight = intermediate_surface->h; biPlanes = 1; - biBitCount = intermediate_surface->format->bits_per_pixel; + biBitCount = intermediate_surface->internal->format->bits_per_pixel; biCompression = BI_RGB; biSizeImage = intermediate_surface->h * intermediate_surface->pitch; biXPelsPerMeter = 0; biYPelsPerMeter = 0; - if (intermediate_surface->format->palette) { - biClrUsed = intermediate_surface->format->palette->ncolors; + if (intermediate_surface->internal->palette) { + biClrUsed = intermediate_surface->internal->palette->ncolors; } else { biClrUsed = 0; } @@ -784,12 +784,12 @@ int SDL_SaveBMP_IO(SDL_Surface *surface, SDL_IOStream *dst, SDL_bool closeio) } /* Write the palette (in BGR color order) */ - if (intermediate_surface->format->palette) { + if (intermediate_surface->internal->palette) { SDL_Color *colors; int ncolors; - colors = intermediate_surface->format->palette->colors; - ncolors = intermediate_surface->format->palette->ncolors; + colors = intermediate_surface->internal->palette->colors; + ncolors = intermediate_surface->internal->palette->ncolors; for (i = 0; i < ncolors; ++i) { if (!SDL_WriteU8(dst, colors[i].b) || !SDL_WriteU8(dst, colors[i].g) || diff --git a/src/video/SDL_fillrect.c b/src/video/SDL_fillrect.c index f47572032405d..f0eb67d108e79 100644 --- a/src/video/SDL_fillrect.c +++ b/src/video/SDL_fillrect.c @@ -231,13 +231,13 @@ static void SDL_FillSurfaceRect4(Uint8 *pixels, int pitch, Uint32 color, int w, */ int SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color) { - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_FillSurfaceRect(): dst"); } /* If 'rect' == NULL, then fill the whole surface */ if (!rect) { - rect = &dst->clip_rect; + rect = &dst->internal->clip_rect; /* Don't attempt to fill if the surface's clip_rect is empty */ if (SDL_RectEmpty(rect)) { return 0; @@ -256,7 +256,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, void (*fill_function)(Uint8 * pixels, int pitch, Uint32 color, int w, int h) = NULL; int i; - if (!dst) { + if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("SDL_FillSurfaceRects(): dst"); } @@ -277,11 +277,11 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, /* This function doesn't usually work on surfaces < 8 bpp * Except: support for 4bits, when filling full size. */ - if (dst->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(dst->format) < 8) { if (count == 1) { const SDL_Rect *r = &rects[0]; if (r->x == 0 && r->y == 0 && r->w == dst->w && r->h == dst->h) { - if (dst->format->bits_per_pixel == 4) { + if (SDL_BITSPERPIXEL(dst->format) == 4) { Uint8 b = (((Uint8)color << 4) | (Uint8)color); SDL_memset(dst->pixels, b, (size_t)dst->h * dst->pitch); return 1; @@ -292,7 +292,7 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, } if (fill_function == NULL) { - switch (dst->format->bytes_per_pixel) { + switch (SDL_BYTESPERPIXEL(dst->format)) { case 1: { color |= (color << 8); @@ -347,13 +347,13 @@ int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, for (i = 0; i < count; ++i) { rect = &rects[i]; /* Perform clipping */ - if (!SDL_GetRectIntersection(rect, &dst->clip_rect, &clipped)) { + if (!SDL_GetRectIntersection(rect, &dst->internal->clip_rect, &clipped)) { continue; } rect = &clipped; pixels = (Uint8 *)dst->pixels + rect->y * dst->pitch + - rect->x * dst->format->bytes_per_pixel; + rect->x * SDL_BYTESPERPIXEL(dst->format); fill_function(pixels, dst->pitch, color, rect->w, rect->h); } diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 0e06737a5d94e..2b40fc714c761 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -26,24 +26,25 @@ #include "SDL_blit.h" #include "SDL_pixels_c.h" #include "SDL_RLEaccel_c.h" +#include "../SDL_hashtable.h" #include "../SDL_list.h" /* Lookup tables to expand partial bytes to the full 0..255 range */ static const Uint8 lookup_0[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + 255 }; static const Uint8 lookup_1[] = { - 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 + 0, 255 }; static const Uint8 lookup_2[] = { - 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 + 0, 85, 170, 255 }; static const Uint8 lookup_3[] = { - 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 + 0, 36, 72, 109, 145, 182, 218, 255 }; static const Uint8 lookup_4[] = { @@ -51,19 +52,19 @@ static const Uint8 lookup_4[] = { }; static const Uint8 lookup_5[] = { - 0, 36, 72, 109, 145, 182, 218, 255 + 0, 8, 16, 24, 32, 41, 49, 57, 65, 74, 82, 90, 98, 106, 115, 123, 131, 139, 148, 156, 164, 172, 180, 189, 197, 205, 213, 222, 230, 238, 246, 255 }; static const Uint8 lookup_6[] = { - 0, 85, 170, 255 + 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125, 129, 133, 137, 141, 145, 149, 153, 157, 161, 165, 170, 174, 178, 182, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 226, 230, 234, 238, 242, 246, 250, 255 }; static const Uint8 lookup_7[] = { - 0, 255 + 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 142, 144, 146, 148, 150, 152, 154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182, 184, 186, 188, 190, 192, 194, 196, 198, 200, 202, 204, 206, 208, 210, 212, 214, 216, 218, 220, 222, 224, 226, 228, 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, 252, 255 }; static const Uint8 lookup_8[] = { - 255 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 }; const Uint8 *SDL_expand_byte[9] = { @@ -91,7 +92,7 @@ SDL_COMPILE_TIME_ASSERT(SDL_expand_byte_10_size, SDL_arraysize(SDL_expand_byte_1 #define CASE(X) \ case X: \ return #X; -const char *SDL_GetPixelFormatName(SDL_PixelFormatEnum format) +const char *SDL_GetPixelFormatName(SDL_PixelFormat format) { switch (format) { @@ -165,8 +166,7 @@ const char *SDL_GetPixelFormatName(SDL_PixelFormatEnum format) } #undef CASE -SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Uint32 *Rmask, - Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) +int SDL_GetMasksForPixelFormat(SDL_PixelFormat format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) { Uint32 masks[4]; @@ -185,12 +185,11 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Ui default: *bpp = 0; // oh well. } - return SDL_TRUE; + return 0; } #else if (SDL_ISPIXELFORMAT_FOURCC(format)) { - SDL_SetError("SDL not built with YUV support"); - return SDL_FALSE; + return SDL_SetError("SDL not built with YUV support"); } #endif @@ -212,7 +211,7 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Ui *Gmask = 0x0000FF00; *Bmask = 0x00FF0000; #endif - return SDL_TRUE; + return 0; } if (format == SDL_PIXELFORMAT_BGR24) { @@ -225,14 +224,14 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Ui *Gmask = 0x0000FF00; *Bmask = 0x000000FF; #endif - return SDL_TRUE; + return 0; } if (SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED8 && SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED16 && SDL_PIXELTYPE(format) != SDL_PIXELTYPE_PACKED32) { /* Not a format that uses masks */ - return SDL_TRUE; + return 0; } switch (SDL_PIXELLAYOUT(format)) { @@ -285,8 +284,7 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Ui masks[3] = 0x00000003; break; default: - SDL_SetError("Unknown pixel format"); - return SDL_FALSE; + return SDL_SetError("Unknown pixel format"); } switch (SDL_PIXELORDER(format)) { @@ -335,13 +333,12 @@ SDL_bool SDL_GetMasksForPixelFormatEnum(SDL_PixelFormatEnum format, int *bpp, Ui *Rmask = masks[3]; break; default: - SDL_SetError("Unknown pixel format"); - return SDL_FALSE; + return SDL_SetError("Unknown pixel format"); } - return SDL_TRUE; + return 0; } -SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) +SDL_PixelFormat SDL_GetPixelFormatForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask) { switch (bpp) { case 1: @@ -579,156 +576,133 @@ SDL_PixelFormatEnum SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 return SDL_PIXELFORMAT_UNKNOWN; } -static SDL_PixelFormat *formats; -static SDL_SpinLock formats_lock = 0; +static SDL_HashTable *SDL_format_details; +static SDL_Mutex *SDL_format_details_lock; -SDL_PixelFormat *SDL_CreatePixelFormat(SDL_PixelFormatEnum pixel_format) -{ - SDL_PixelFormat *format; - - SDL_LockSpinlock(&formats_lock); - - /* Look it up in our list of previously allocated formats */ - for (format = formats; format; format = format->next) { - if (pixel_format == format->format) { - ++format->refcount; - SDL_UnlockSpinlock(&formats_lock); - return format; - } - } - - /* Allocate an empty pixel format structure, and initialize it */ - format = (SDL_PixelFormat *)SDL_malloc(sizeof(*format)); - if (!format) { - SDL_UnlockSpinlock(&formats_lock); - return NULL; - } - if (SDL_InitFormat(format, pixel_format) < 0) { - SDL_UnlockSpinlock(&formats_lock); - SDL_free(format); - return NULL; - } - - if (!SDL_ISPIXELFORMAT_INDEXED(pixel_format)) { - /* Cache the RGB formats */ - format->next = formats; - formats = format; - } - - SDL_UnlockSpinlock(&formats_lock); - - return format; -} - -int SDL_InitFormat(SDL_PixelFormat *format, SDL_PixelFormatEnum pixel_format) +static int SDL_InitPixelFormatDetails(SDL_PixelFormatDetails *details, SDL_PixelFormat format) { int bpp; Uint32 Rmask, Gmask, Bmask, Amask; Uint32 mask; - if (!SDL_GetMasksForPixelFormatEnum(pixel_format, &bpp, - &Rmask, &Gmask, &Bmask, &Amask)) { + if (SDL_GetMasksForPixelFormat(format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) < 0) { return -1; } /* Set up the format */ - SDL_zerop(format); - format->format = pixel_format; - format->bits_per_pixel = (Uint8)bpp; - format->bytes_per_pixel = (Uint8)((bpp + 7) / 8); - - format->Rmask = Rmask; - format->Rshift = 0; - format->Rloss = 8; + SDL_zerop(details); + details->format = format; + details->bits_per_pixel = (Uint8)bpp; + SDL_assert(SDL_BITSPERPIXEL(format) == details->bits_per_pixel); + details->bytes_per_pixel = (Uint8)((bpp + 7) / 8); + SDL_assert(SDL_BYTESPERPIXEL(format) == details->bytes_per_pixel); + + details->Rmask = Rmask; + details->Rshift = 0; + details->Rbits = 0; if (Rmask) { for (mask = Rmask; !(mask & 0x01); mask >>= 1) { - ++format->Rshift; + ++details->Rshift; } - for (; (mask & 0x01) && format->Rloss; mask >>= 1) { - --format->Rloss; + for (; (mask & 0x01); mask >>= 1) { + ++details->Rbits; } } - format->Gmask = Gmask; - format->Gshift = 0; - format->Gloss = 8; + details->Gmask = Gmask; + details->Gshift = 0; + details->Gbits = 0; if (Gmask) { for (mask = Gmask; !(mask & 0x01); mask >>= 1) { - ++format->Gshift; + ++details->Gshift; } - for (; (mask & 0x01) && format->Gloss; mask >>= 1) { - --format->Gloss; + for (; (mask & 0x01); mask >>= 1) { + ++details->Gbits; } } - format->Bmask = Bmask; - format->Bshift = 0; - format->Bloss = 8; + details->Bmask = Bmask; + details->Bshift = 0; + details->Bbits = 0; if (Bmask) { for (mask = Bmask; !(mask & 0x01); mask >>= 1) { - ++format->Bshift; + ++details->Bshift; } - for (; (mask & 0x01) && format->Bloss; mask >>= 1) { - --format->Bloss; + for (; (mask & 0x01); mask >>= 1) { + ++details->Bbits; } } - format->Amask = Amask; - format->Ashift = 0; - format->Aloss = 8; + details->Amask = Amask; + details->Ashift = 0; + details->Abits = 0; if (Amask) { for (mask = Amask; !(mask & 0x01); mask >>= 1) { - ++format->Ashift; + ++details->Ashift; } - for (; (mask & 0x01) && format->Aloss; mask >>= 1) { - --format->Aloss; + for (; (mask & 0x01); mask >>= 1) { + ++details->Abits; } } - format->palette = NULL; - format->refcount = 1; - format->next = NULL; - return 0; } -void SDL_DestroyPixelFormat(SDL_PixelFormat *format) +const SDL_PixelFormatDetails *SDL_GetPixelFormatDetails(SDL_PixelFormat format) { - SDL_PixelFormat *prev; + SDL_PixelFormatDetails *details; - if (!format) { - return; + if (!SDL_format_details_lock) { + SDL_format_details_lock = SDL_CreateMutex(); } - SDL_LockSpinlock(&formats_lock); + SDL_LockMutex(SDL_format_details_lock); - if (--format->refcount > 0) { - SDL_UnlockSpinlock(&formats_lock); - return; + if (!SDL_format_details) { + SDL_format_details = SDL_CreateHashTable(NULL, 8, SDL_HashID, SDL_KeyMatchID, SDL_NukeFreeValue, SDL_FALSE); } - /* Remove this format from our list */ - if (format == formats) { - formats = format->next; - } else if (formats) { - for (prev = formats; prev->next; prev = prev->next) { - if (prev->next == format) { - prev->next = format->next; - break; - } - } + if (SDL_FindInHashTable(SDL_format_details, (const void *)(uintptr_t)format, (const void **)&details)) { + return details; } - SDL_UnlockSpinlock(&formats_lock); + /* Allocate an empty pixel format structure, and initialize it */ + details = (SDL_PixelFormatDetails *)SDL_malloc(sizeof(*details)); + if (!details) { + goto done; + } + + if (SDL_InitPixelFormatDetails(details, format) < 0) { + SDL_free(details); + details = NULL; + goto done; + } - if (format->palette) { - SDL_DestroyPalette(format->palette); + if (!SDL_InsertIntoHashTable(SDL_format_details, (const void *)(uintptr_t)format, (void *)details)) { + SDL_free(details); + details = NULL; + goto done; } - SDL_free(format); - return; + +done: + SDL_UnlockMutex(SDL_format_details_lock); + + return details; } -SDL_Colorspace SDL_GetDefaultColorspaceForFormat(SDL_PixelFormatEnum format) +void SDL_QuitPixelFormatDetails(void) +{ + if (SDL_format_details) { + SDL_DestroyHashTable(SDL_format_details); + SDL_format_details = NULL; + } + if (SDL_format_details_lock) { + SDL_DestroyMutex(SDL_format_details_lock); + SDL_format_details_lock = NULL; + } +} + +SDL_Colorspace SDL_GetDefaultColorspaceForFormat(SDL_PixelFormat format) { if (SDL_ISPIXELFORMAT_FOURCC(format)) { if (format == SDL_PIXELFORMAT_P010) { @@ -1065,33 +1039,6 @@ SDL_Palette *SDL_CreatePalette(int ncolors) return palette; } -int SDL_SetPixelFormatPalette(SDL_PixelFormat *format, SDL_Palette *palette) -{ - if (!format) { - return SDL_InvalidParamError("SDL_SetPixelFormatPalette(): format"); - } - - if (palette && palette->ncolors > (1 << format->bits_per_pixel)) { - return SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format"); - } - - if (format->palette == palette) { - return 0; - } - - if (format->palette) { - SDL_DestroyPalette(format->palette); - } - - format->palette = palette; - - if (format->palette) { - ++format->palette->refcount; - } - - return 0; -} - int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors, int firstcolor, int ncolors) { @@ -1161,7 +1108,7 @@ void SDL_DitherColors(SDL_Color *colors, int bpp) /* * Match an RGB value to a particular palette index */ -Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +Uint8 SDL_FindColor(const SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* Do colorspace distance matching */ unsigned int smallest; @@ -1189,7 +1136,7 @@ Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a) } /* Tell whether palette is opaque, and if it has an alpha_channel */ -void SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel) +void SDL_DetectPalette(const SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel) { int i; @@ -1235,56 +1182,94 @@ void SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alph } /* Find the opaque pixel value corresponding to an RGB triple */ -Uint32 SDL_MapRGB(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b) +Uint32 SDL_MapRGB(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b) { if (!format) { SDL_InvalidParamError("format"); return 0; } - if (format->palette) { - return SDL_FindColor(format->palette, r, g, b, SDL_ALPHA_OPAQUE); - } else if (SDL_ISPIXELFORMAT_10BIT(format->format)) { + + if (SDL_ISPIXELFORMAT_INDEXED(format->format)) { + if (!palette) { + SDL_InvalidParamError("palette"); + return 0; + } + return SDL_FindColor(palette, r, g, b, SDL_ALPHA_OPAQUE); + } + + if (SDL_ISPIXELFORMAT_10BIT(format->format)) { return (((Uint32)SDL_expand_byte_10[r]) << format->Rshift) | (((Uint32)SDL_expand_byte_10[g]) << format->Gshift) | (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | format->Amask; } else { - return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | format->Amask; + return ((Uint32)(r >> (8 - format->Rbits))) << format->Rshift | + ((Uint32)(g >> (8 - format->Gbits))) << format->Gshift | + ((Uint32)(b >> (8 - format->Bbits))) << format->Bshift | + format->Amask; } } /* Find the pixel value corresponding to an RGBA quadruple */ -Uint32 SDL_MapRGBA(const SDL_PixelFormat *format, Uint8 r, Uint8 g, Uint8 b, - Uint8 a) +Uint32 SDL_MapRGBA(const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { if (!format) { SDL_InvalidParamError("format"); return 0; } - if (format->palette) { - return SDL_FindColor(format->palette, r, g, b, a); - } else if (SDL_ISPIXELFORMAT_10BIT(format->format)) { + + if (SDL_ISPIXELFORMAT_INDEXED(format->format)) { + if (!palette) { + SDL_InvalidParamError("palette"); + return 0; + } + return SDL_FindColor(palette, r, g, b, a); + } + + if (SDL_ISPIXELFORMAT_10BIT(format->format)) { return (((Uint32)SDL_expand_byte_10[r]) << format->Rshift) | (((Uint32)SDL_expand_byte_10[g]) << format->Gshift) | (((Uint32)SDL_expand_byte_10[b]) << format->Bshift) | - ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); + ((((Uint32)(a >> (8 - format->Abits))) << format->Ashift) & format->Amask); } else { - return (r >> format->Rloss) << format->Rshift | (g >> format->Gloss) << format->Gshift | (b >> format->Bloss) << format->Bshift | ((Uint32)(a >> format->Aloss) << format->Ashift & format->Amask); + return ((Uint32)(r >> (8 - format->Rbits))) << format->Rshift | + ((Uint32)(g >> (8 - format->Gbits))) << format->Gshift | + ((Uint32)(b >> (8 - format->Bbits))) << format->Bshift | + ((((Uint32)(a >> (8 - format->Abits))) << format->Ashift) & format->Amask); } } -void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, - Uint8 *b) +void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b) { - if (format->palette) { - if (pixel < (unsigned)format->palette->ncolors) { - *r = format->palette->colors[pixel].r; - *g = format->palette->colors[pixel].g; - *b = format->palette->colors[pixel].b; + Uint8 unused; + + if (!r) { + r = &unused; + } + if (!g) { + g = &unused; + } + if (!b) { + b = &unused; + } + + if (!format) { + *r = *g = *b = 0; + return; + } + + if (SDL_ISPIXELFORMAT_INDEXED(format->format)) { + if (palette && pixel < (unsigned)palette->ncolors) { + *r = palette->colors[pixel].r; + *g = palette->colors[pixel].g; + *b = palette->colors[pixel].b; } else { *r = *g = *b = 0; } - } else if (SDL_ISPIXELFORMAT_10BIT(format->format)) { + return; + } + + if (SDL_ISPIXELFORMAT_10BIT(format->format)) { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; *r = (Uint8)(v >> 2); @@ -1295,27 +1280,49 @@ void SDL_GetRGB(Uint32 pixel, const SDL_PixelFormat *format, Uint8 *r, Uint8 *g, } else { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; - *r = SDL_expand_byte[format->Rloss][v]; + *r = SDL_expand_byte[format->Rbits][v]; v = (pixel & format->Gmask) >> format->Gshift; - *g = SDL_expand_byte[format->Gloss][v]; + *g = SDL_expand_byte[format->Gbits][v]; v = (pixel & format->Bmask) >> format->Bshift; - *b = SDL_expand_byte[format->Bloss][v]; + *b = SDL_expand_byte[format->Bbits][v]; } } -void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, - Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) +void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormatDetails *format, const SDL_Palette *palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { - if (format->palette) { - if (pixel < (unsigned)format->palette->ncolors) { - *r = format->palette->colors[pixel].r; - *g = format->palette->colors[pixel].g; - *b = format->palette->colors[pixel].b; - *a = format->palette->colors[pixel].a; + Uint8 unused; + + if (!r) { + r = &unused; + } + if (!g) { + g = &unused; + } + if (!b) { + b = &unused; + } + if (!a) { + a = &unused; + } + + if (!format) { + *r = *g = *b = *a = 0; + return; + } + + if (SDL_ISPIXELFORMAT_INDEXED(format->format)) { + if (palette && pixel < (unsigned)palette->ncolors) { + *r = palette->colors[pixel].r; + *g = palette->colors[pixel].g; + *b = palette->colors[pixel].b; + *a = palette->colors[pixel].a; } else { *r = *g = *b = *a = 0; } - } else if (SDL_ISPIXELFORMAT_10BIT(format->format)) { + return; + } + + if (SDL_ISPIXELFORMAT_10BIT(format->format)) { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; *r = (Uint8)(v >> 2); @@ -1324,22 +1331,22 @@ void SDL_GetRGBA(Uint32 pixel, const SDL_PixelFormat *format, v = (pixel & format->Bmask) >> format->Bshift; *b = (Uint8)(v >> 2); v = (pixel & format->Amask) >> format->Ashift; - *a = SDL_expand_byte[format->Aloss][v]; + *a = SDL_expand_byte[format->Abits][v]; } else { unsigned v; v = (pixel & format->Rmask) >> format->Rshift; - *r = SDL_expand_byte[format->Rloss][v]; + *r = SDL_expand_byte[format->Rbits][v]; v = (pixel & format->Gmask) >> format->Gshift; - *g = SDL_expand_byte[format->Gloss][v]; + *g = SDL_expand_byte[format->Gbits][v]; v = (pixel & format->Bmask) >> format->Bshift; - *b = SDL_expand_byte[format->Bloss][v]; + *b = SDL_expand_byte[format->Bbits][v]; v = (pixel & format->Amask) >> format->Ashift; - *a = SDL_expand_byte[format->Aloss][v]; + *a = SDL_expand_byte[format->Abits][v]; } } /* Map from Palette to Palette */ -static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical) +static Uint8 *Map1to1(const SDL_Palette *src, const SDL_Palette *dst, int *identical) { Uint8 *map; int i; @@ -1369,15 +1376,13 @@ static Uint8 *Map1to1(SDL_Palette *src, SDL_Palette *dst, int *identical) } /* Map from Palette to BitField */ -static Uint8 *Map1toN(SDL_PixelFormat *src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, - SDL_PixelFormat *dst) +static Uint8 *Map1toN(const SDL_Palette *pal, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 Amod, const SDL_PixelFormatDetails *dst) { Uint8 *map; int i; int bpp; - SDL_Palette *pal = src->palette; - bpp = ((dst->bytes_per_pixel == 3) ? 4 : dst->bytes_per_pixel); + bpp = ((SDL_BYTESPERPIXEL(dst->format) == 3) ? 4 : SDL_BYTESPERPIXEL(dst->format)); map = (Uint8 *)SDL_calloc(256, bpp); if (!map) { return NULL; @@ -1389,19 +1394,18 @@ static Uint8 *Map1toN(SDL_PixelFormat *src, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod, Uint8 G = (Uint8)((pal->colors[i].g * Gmod) / 255); Uint8 B = (Uint8)((pal->colors[i].b * Bmod) / 255); Uint8 A = (Uint8)((pal->colors[i].a * Amod) / 255); - ASSEMBLE_RGBA(&map[i * bpp], dst->bytes_per_pixel, dst, (Uint32)R, + ASSEMBLE_RGBA(&map[i * bpp], SDL_BYTESPERPIXEL(dst->format), dst, (Uint32)R, (Uint32)G, (Uint32)B, (Uint32)A); } return map; } /* Map from BitField to Dithered-Palette to Palette */ -static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical) +static Uint8 *MapNto1(const SDL_PixelFormatDetails *src, const SDL_Palette *pal, int *identical) { /* Generate a 256 color dither palette */ SDL_Palette dithered; SDL_Color colors[256]; - SDL_Palette *pal = dst->palette; dithered.ncolors = 256; SDL_DitherColors(colors, 8); @@ -1409,29 +1413,11 @@ static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical return Map1to1(&dithered, pal, identical); } -SDL_BlitMap *SDL_AllocBlitMap(void) -{ - SDL_BlitMap *map; - - /* Allocate the empty map */ - map = (SDL_BlitMap *)SDL_calloc(1, sizeof(*map)); - if (!map) { - return NULL; - } - map->info.r = 0xFF; - map->info.g = 0xFF; - map->info.b = 0xFF; - map->info.a = 0xFF; - - /* It's ready to go */ - return map; -} - void SDL_InvalidateAllBlitMap(SDL_Surface *surface) { - SDL_ListNode *l = (SDL_ListNode *)surface->list_blitmap; + SDL_ListNode *l = surface->internal->list_blitmap; - surface->list_blitmap = NULL; + surface->internal->list_blitmap = NULL; while (l) { SDL_ListNode *tmp = l; @@ -1448,7 +1434,7 @@ void SDL_InvalidateMap(SDL_BlitMap *map) } if (map->dst) { /* Un-register from the destination surface */ - SDL_ListRemove((SDL_ListNode **)&(map->dst->list_blitmap), map); + SDL_ListRemove(&map->dst->internal->list_blitmap, map); } map->dst = NULL; map->src_palette_version = 0; @@ -1459,28 +1445,32 @@ void SDL_InvalidateMap(SDL_BlitMap *map) int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) { - SDL_PixelFormat *srcfmt; - SDL_PixelFormat *dstfmt; + const SDL_PixelFormatDetails *srcfmt; + const SDL_Palette *srcpal; + const SDL_PixelFormatDetails *dstfmt; + const SDL_Palette *dstpal; SDL_BlitMap *map; /* Clear out any previous mapping */ - map = src->map; + map = &src->internal->map; #if SDL_HAVE_RLE - if ((src->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { - SDL_UnRLESurface(src, 1); + if (src->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + SDL_UnRLESurface(src, SDL_TRUE); } #endif SDL_InvalidateMap(map); /* Figure out what kind of mapping we're doing */ map->identity = 0; - srcfmt = src->format; - dstfmt = dst->format; + srcfmt = src->internal->format; + srcpal = src->internal->palette; + dstfmt = dst->internal->format; + dstpal = dst->internal->palette; if (SDL_ISPIXELFORMAT_INDEXED(srcfmt->format)) { if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) { /* Palette --> Palette */ map->info.table = - Map1to1(srcfmt->palette, dstfmt->palette, &map->identity); + Map1to1(srcpal, dstpal, &map->identity); if (!map->identity) { if (!map->info.table) { return -1; @@ -1492,8 +1482,8 @@ int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) } else { /* Palette --> BitField */ map->info.table = - Map1toN(srcfmt, src->map->info.r, src->map->info.g, - src->map->info.b, src->map->info.a, dstfmt); + Map1toN(srcpal, src->internal->map.info.r, src->internal->map.info.g, + src->internal->map.info.b, src->internal->map.info.a, dstfmt); if (!map->info.table) { return -1; } @@ -1501,7 +1491,7 @@ int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) } else { if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) { /* BitField --> Palette */ - map->info.table = MapNto1(srcfmt, dstfmt, &map->identity); + map->info.table = MapNto1(srcfmt, dstpal, &map->identity); if (!map->identity) { if (!map->info.table) { return -1; @@ -1520,17 +1510,17 @@ int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) if (map->dst) { /* Register BlitMap to the destination surface, to be invalidated when needed */ - SDL_ListAdd((SDL_ListNode **)&(map->dst->list_blitmap), map); + SDL_ListAdd(&map->dst->internal->list_blitmap, map); } - if (dstfmt->palette) { - map->dst_palette_version = dstfmt->palette->version; + if (dstpal) { + map->dst_palette_version = dstpal->version; } else { map->dst_palette_version = 0; } - if (srcfmt->palette) { - map->src_palette_version = srcfmt->palette->version; + if (srcpal) { + map->src_palette_version = srcpal->version; } else { map->src_palette_version = 0; } @@ -1539,11 +1529,3 @@ int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) return SDL_CalculateBlit(src); } -void SDL_FreeBlitMap(SDL_BlitMap *map) -{ - if (map) { - SDL_InvalidateMap(map); - SDL_free(map); - } -} - diff --git a/src/video/SDL_pixels_c.h b/src/video/SDL_pixels_c.h index 40eacf8dd3439..90f1905d728f7 100644 --- a/src/video/SDL_pixels_c.h +++ b/src/video/SDL_pixels_c.h @@ -18,20 +18,20 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. */ +#include "SDL_internal.h" #ifndef SDL_pixels_c_h_ #define SDL_pixels_c_h_ -#include "SDL_internal.h" - /* Useful functions and variables from SDL_pixel.c */ #include "SDL_blit.h" + /* Pixel format functions */ -extern int SDL_InitFormat(SDL_PixelFormat *format, SDL_PixelFormatEnum pixel_format); -extern int SDL_CalculateSurfaceSize(SDL_PixelFormatEnum format, int width, int height, size_t *size, size_t *pitch, SDL_bool minimalPitch); -extern SDL_Colorspace SDL_GetDefaultColorspaceForFormat(SDL_PixelFormatEnum pixel_format); +extern int SDL_CalculateSurfaceSize(SDL_PixelFormat format, int width, int height, size_t *size, size_t *pitch, SDL_bool minimalPitch); +extern SDL_Colorspace SDL_GetDefaultColorspaceForFormat(SDL_PixelFormat pixel_format); +extern void SDL_QuitPixelFormatDetails(void); /* Colorspace conversion functions */ extern float SDL_sRGBtoLinear(float v); @@ -43,23 +43,14 @@ extern const float *SDL_GetColorPrimariesConversionMatrix(SDL_ColorPrimaries src extern void SDL_ConvertColorPrimaries(float *fR, float *fG, float *fB, const float *matrix); /* Blit mapping functions */ -extern SDL_BlitMap *SDL_AllocBlitMap(void); extern void SDL_InvalidateMap(SDL_BlitMap *map); extern int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst); -extern void SDL_FreeBlitMap(SDL_BlitMap *map); - extern void SDL_InvalidateAllBlitMap(SDL_Surface *surface); -/* Surface functions */ -extern float SDL_GetDefaultSDRWhitePoint(SDL_Colorspace colorspace); -extern float SDL_GetSurfaceSDRWhitePoint(SDL_Surface *surface, SDL_Colorspace colorspace); -extern float SDL_GetDefaultHDRHeadroom(SDL_Colorspace colorspace); -extern float SDL_GetSurfaceHDRHeadroom(SDL_Surface *surface, SDL_Colorspace colorspace); - /* Miscellaneous functions */ extern void SDL_DitherColors(SDL_Color *colors, int bpp); -extern Uint8 SDL_FindColor(SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -extern void SDL_DetectPalette(SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel); -extern SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormatEnum format, SDL_Colorspace colorspace, void *pixels, int pitch); +extern Uint8 SDL_FindColor(const SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); +extern void SDL_DetectPalette(const SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel); +extern SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormat format, SDL_Colorspace colorspace, void *pixels, int pitch); #endif /* SDL_pixels_c_h_ */ diff --git a/src/video/SDL_stretch.c b/src/video/SDL_stretch.c index 1778ccc0403f2..88e0f49e407e2 100644 --- a/src/video/SDL_stretch.c +++ b/src/video/SDL_stretch.c @@ -42,9 +42,9 @@ int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, return SDL_InvalidParamError("dst"); } - if (src->format->format != dst->format->format) { + if (src->format != dst->format) { // Slow! - SDL_Surface *src_tmp = SDL_ConvertSurfaceFormat(src, dst->format->format); + SDL_Surface *src_tmp = SDL_ConvertSurfaceAndColorspace(src, dst->format, dst->internal->palette, SDL_GetSurfaceColorspace(dst), dst->internal->props); if (!src_tmp) { return -1; } @@ -53,7 +53,7 @@ int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, return ret; } - if (SDL_ISPIXELFORMAT_FOURCC(src->format->format)) { + if (SDL_ISPIXELFORMAT_FOURCC(src->format)) { // Slow! if (!dstrect) { full_dst.x = 0; @@ -63,18 +63,17 @@ int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, dstrect = &full_dst; } - SDL_Surface *src_tmp = SDL_ConvertSurfaceFormat(src, SDL_PIXELFORMAT_XRGB8888); + SDL_Surface *src_tmp = SDL_ConvertSurface(src, SDL_PIXELFORMAT_XRGB8888); SDL_Surface *dst_tmp = SDL_CreateSurface(dstrect->w, dstrect->h, SDL_PIXELFORMAT_XRGB8888); if (src_tmp && dst_tmp) { ret = SDL_SoftStretch(src_tmp, srcrect, dst_tmp, NULL, scaleMode); if (ret == 0) { - SDL_Colorspace dst_colorspace = SDL_COLORSPACE_UNKNOWN; - SDL_GetSurfaceColorspace(dst, &dst_colorspace); + SDL_Colorspace dst_colorspace = SDL_GetSurfaceColorspace(dst); SDL_ConvertPixelsAndColorspace(dstrect->w, dstrect->h, - dst_tmp->format->format, SDL_COLORSPACE_SRGB, 0, + dst_tmp->format, SDL_COLORSPACE_SRGB, 0, dst_tmp->pixels, dst_tmp->pitch, - dst->format->format, dst_colorspace, SDL_GetSurfaceProperties(dst), - (Uint8 *)dst->pixels + dstrect->y * dst->pitch + dstrect->x * dst->format->bytes_per_pixel, dst->pitch); + dst->format, dst_colorspace, SDL_GetSurfaceProperties(dst), + (Uint8 *)dst->pixels + dstrect->y * dst->pitch + dstrect->x * SDL_BYTESPERPIXEL(dst->format), dst->pitch); } } else { ret = -1; @@ -93,7 +92,7 @@ int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, } if (scaleMode == SDL_SCALEMODE_LINEAR) { - if (src->format->bytes_per_pixel != 4 || src->format->format == SDL_PIXELFORMAT_ARGB2101010) { + if (SDL_BYTESPERPIXEL(src->format) != 4 || src->format == SDL_PIXELFORMAT_ARGB2101010) { return SDL_SetError("Wrong format"); } } @@ -972,8 +971,7 @@ int SDL_LowerSoftStretchNearest(SDL_Surface *s, const SDL_Rect *srcrect, int dst_h = dstrect->h; int src_pitch = s->pitch; int dst_pitch = d->pitch; - - const int bpp = d->format->bytes_per_pixel; + int bpp = SDL_BYTESPERPIXEL(d->format); Uint32 *src = (Uint32 *)((Uint8 *)s->pixels + srcrect->x * bpp + srcrect->y * src_pitch); Uint32 *dst = (Uint32 *)((Uint8 *)d->pixels + dstrect->x * bpp + dstrect->y * dst_pitch); diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 24ebf4b3009b1..a92be28cf3bad 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -27,8 +27,9 @@ #include "SDL_pixels_c.h" #include "SDL_yuv_c.h" #include "../render/SDL_sysrender.h" -#include "../video/SDL_pixels_c.h" -#include "../video/SDL_yuv_c.h" + +#include "SDL_surface_c.h" + /* Check to make sure we can safely check multiplication of surface w and pitch and it won't overflow size_t */ SDL_COMPILE_TIME_ASSERT(surface_size_assumptions, @@ -38,6 +39,20 @@ SDL_COMPILE_TIME_ASSERT(can_indicate_overflow, SDL_SIZE_MAX > SDL_MAX_SINT32); /* Public routines */ +SDL_bool SDL_SurfaceValid(SDL_Surface *surface) +{ + return surface && surface->internal; +} + +void SDL_UpdateSurfaceLockFlag(SDL_Surface *surface) +{ + if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + surface->flags |= SDL_SURFACE_LOCK_NEEDED; + } else { + surface->flags &= ~SDL_SURFACE_LOCK_NEEDED; + } +} + /* * Calculate the pad-aligned scanline width of a surface. * Return SDL_SIZE_MAX on overflow. @@ -74,7 +89,7 @@ static int SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size return 0; } -int SDL_CalculateSurfaceSize(SDL_PixelFormatEnum format, int width, int height, size_t *size, size_t *pitch, SDL_bool minimalPitch) +int SDL_CalculateSurfaceSize(SDL_PixelFormat format, int width, int height, size_t *size, size_t *pitch, SDL_bool minimalPitch) { size_t p = 0, sz = 0; @@ -109,49 +124,42 @@ int SDL_CalculateSurfaceSize(SDL_PixelFormatEnum format, int width, int height, return 0; } -/* - * Create an empty RGB surface of the appropriate depth using the given - * enum SDL_PIXELFORMAT_* format - */ -SDL_Surface *SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format) +static SDL_Surface *SDL_InitializeSurface(SDL_InternalSurface *mem, int width, int height, SDL_PixelFormat format, SDL_Colorspace colorspace, SDL_PropertiesID props, void *pixels, int pitch, SDL_bool onstack) { - size_t pitch, size; - SDL_Surface *surface; + SDL_Surface *surface = &mem->surface; - if (width < 0) { - SDL_InvalidParamError("width"); - return NULL; - } + SDL_zerop(mem); - if (height < 0) { - SDL_InvalidParamError("height"); - return NULL; - } - - if (SDL_CalculateSurfaceSize(format, width, height, &size, &pitch, SDL_FALSE /* not minimal pitch */) < 0) { - /* Overflow... */ - return NULL; - } + surface->flags = SDL_SURFACE_PREALLOCATED; + surface->format = format; + surface->w = width; + surface->h = height; + surface->pixels = pixels; + surface->pitch = pitch; - /* Allocate the surface */ - surface = (SDL_Surface *)SDL_calloc(1, sizeof(*surface)); - if (!surface) { - return NULL; + surface->internal = &mem->internal; + if (onstack) { + surface->internal->flags |= SDL_INTERNAL_SURFACE_STACK; } - surface->format = SDL_CreatePixelFormat(format); - if (!surface->format) { + surface->internal->format = SDL_GetPixelFormatDetails(format); + if (!surface->internal->format) { SDL_DestroySurface(surface); return NULL; } - surface->w = width; - surface->h = height; - surface->pitch = (int)pitch; - SDL_SetSurfaceClipRect(surface, NULL); - if (SDL_ISPIXELFORMAT_INDEXED(surface->format->format)) { - SDL_Palette *palette = - SDL_CreatePalette((1 << surface->format->bits_per_pixel)); + /* Initialize the clip rect */ + surface->internal->clip_rect.w = width; + surface->internal->clip_rect.h = height; + + /* Allocate an empty mapping */ + surface->internal->map.info.r = 0xFF; + surface->internal->map.info.g = 0xFF; + surface->internal->map.info.b = 0xFF; + surface->internal->map.info.a = 0xFF; + + if (SDL_ISPIXELFORMAT_INDEXED(surface->format)) { + SDL_Palette *palette = SDL_CreatePalette((1 << SDL_BITSPERPIXEL(surface->format))); if (!palette) { SDL_DestroySurface(surface); return NULL; @@ -169,27 +177,19 @@ SDL_Surface *SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format SDL_DestroyPalette(palette); } - /* Get the pixels */ - if (surface->w && surface->h) { - surface->pixels = SDL_aligned_alloc(SDL_GetSIMDAlignment(), size); - if (!surface->pixels) { - SDL_DestroySurface(surface); - return NULL; - } - surface->flags |= SDL_SIMD_ALIGNED; - /* This is important for bitmaps */ - SDL_memset(surface->pixels, 0, size); + if (colorspace != SDL_COLORSPACE_UNKNOWN && + colorspace != SDL_GetDefaultColorspaceForFormat(format)) { + SDL_SetSurfaceColorspace(surface, colorspace); } - /* Allocate an empty mapping */ - surface->map = SDL_AllocBlitMap(); - if (!surface->map) { - SDL_DestroySurface(surface); - return NULL; + if (props) { + if (SDL_CopyProperties(props, SDL_GetSurfaceProperties(surface)) < 0) { + return NULL; + } } - /* By default surface with an alpha mask are set up for blending */ - if (surface->format->Amask) { + /* By default surfaces with an alpha mask are set up for blending */ + if (SDL_ISPIXELFORMAT_ALPHA(surface->format)) { SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_BLEND); } @@ -198,13 +198,61 @@ SDL_Surface *SDL_CreateSurface(int width, int height, SDL_PixelFormatEnum format return surface; } +/* + * Create an empty surface of the appropriate depth using the given format + */ +SDL_Surface *SDL_CreateSurface(int width, int height, SDL_PixelFormat format) +{ + size_t pitch, size; + SDL_InternalSurface *mem; + SDL_Surface *surface; + + if (width < 0) { + SDL_InvalidParamError("width"); + return NULL; + } + + if (height < 0) { + SDL_InvalidParamError("height"); + return NULL; + } + + if (SDL_CalculateSurfaceSize(format, width, height, &size, &pitch, SDL_FALSE /* not minimal pitch */) < 0) { + /* Overflow... */ + return NULL; + } + + /* Allocate and initialize the surface */ + mem = (SDL_InternalSurface *)SDL_malloc(sizeof(*mem)); + if (!mem) { + return NULL; + } + + surface = SDL_InitializeSurface(mem, width, height, format, SDL_COLORSPACE_UNKNOWN, 0, NULL, (int)pitch, SDL_FALSE); + if (surface) { + if (surface->w && surface->h) { + surface->flags &= ~SDL_SURFACE_PREALLOCATED; + surface->pixels = SDL_aligned_alloc(SDL_GetSIMDAlignment(), size); + if (!surface->pixels) { + SDL_DestroySurface(surface); + return NULL; + } + surface->flags |= SDL_SURFACE_SIMD_ALIGNED; + + /* This is important for bitmaps */ + SDL_memset(surface->pixels, 0, size); + } + } + return surface; +} + /* * Create an RGB surface from an existing memory buffer using the given * enum SDL_PIXELFORMAT_* format */ -SDL_Surface *SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, SDL_PixelFormatEnum format) +SDL_Surface *SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, void *pixels, int pitch) { - SDL_Surface *surface; + SDL_InternalSurface *mem; if (width < 0) { SDL_InvalidParamError("width"); @@ -232,75 +280,53 @@ SDL_Surface *SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitc } } - surface = SDL_CreateSurface(0, 0, format); - if (surface) { - surface->flags |= SDL_PREALLOC; - surface->pixels = pixels; - surface->w = width; - surface->h = height; - surface->pitch = pitch; - SDL_SetSurfaceClipRect(surface, NULL); + /* Allocate and initialize the surface */ + mem = (SDL_InternalSurface *)SDL_malloc(sizeof(*mem)); + if (!mem) { + return NULL; } - return surface; + + return SDL_InitializeSurface(mem, width, height, format, SDL_COLORSPACE_UNKNOWN, 0, pixels, pitch, SDL_FALSE); } SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface *surface) { - SDL_PropertiesID props; - - if (!surface) { + if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("surface"); return 0; } - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - props = (SDL_PropertiesID)(uintptr_t)surface->reserved; - } else { - if (surface->reserved != NULL) { - SDL_SetError("Surface has userdata, incompatible with properties"); - return 0; - } - - props = SDL_CreateProperties(); - if (props) { - surface->reserved = (void *)(uintptr_t)props; - surface->flags |= SDL_SURFACE_USES_PROPERTIES; - } + if (!surface->internal->props) { + surface->internal->props = SDL_CreateProperties(); } - return props; + return surface->internal->props; } int SDL_SetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace colorspace) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - if (colorspace == SDL_GetDefaultColorspaceForFormat(surface->format->format)) { + if (colorspace == SDL_GetDefaultColorspaceForFormat(surface->format)) { return 0; } return SDL_SetNumberProperty(SDL_GetSurfaceProperties(surface), SDL_PROP_SURFACE_COLORSPACE_NUMBER, colorspace); } -int SDL_GetSurfaceColorspace(SDL_Surface *surface, SDL_Colorspace *colorspace) +SDL_Colorspace SDL_GetSurfaceColorspace(SDL_Surface *surface) { - SDL_Colorspace surface_colorspace = SDL_COLORSPACE_UNKNOWN; - - if (!surface) { - return SDL_InvalidParamError("surface"); - } + SDL_Colorspace colorspace; - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - surface_colorspace = (SDL_Colorspace)SDL_GetNumberProperty(SDL_GetSurfaceProperties(surface), SDL_PROP_SURFACE_COLORSPACE_NUMBER, SDL_COLORSPACE_UNKNOWN); - } - if (surface_colorspace == SDL_COLORSPACE_UNKNOWN) { - surface_colorspace = SDL_GetDefaultColorspaceForFormat(surface->format->format); + if (!SDL_SurfaceValid(surface)) { + return SDL_COLORSPACE_UNKNOWN; } - if (colorspace) { - *colorspace = surface_colorspace; + colorspace = (SDL_Colorspace)SDL_GetNumberProperty(surface->internal->props, SDL_PROP_SURFACE_COLORSPACE_NUMBER, SDL_COLORSPACE_UNKNOWN); + if (colorspace == SDL_COLORSPACE_UNKNOWN) { + colorspace = SDL_GetDefaultColorspaceForFormat(surface->format); } - return 0; + return colorspace; } float SDL_GetDefaultSDRWhitePoint(SDL_Colorspace colorspace) @@ -317,8 +343,8 @@ float SDL_GetSurfaceSDRWhitePoint(SDL_Surface *surface, SDL_Colorspace colorspac SDL_PropertiesID props; float default_value = 1.0f; - if (surface && surface->flags & SDL_SURFACE_USES_PROPERTIES) { - props = SDL_GetSurfaceProperties(surface); + if (SDL_SurfaceValid(surface)) { + props = surface->internal->props; } else { props = 0; } @@ -350,8 +376,8 @@ float SDL_GetSurfaceHDRHeadroom(SDL_Surface *surface, SDL_Colorspace colorspace) SDL_PropertiesID props; float default_value = 0.0f; - if (surface && surface->flags & SDL_SURFACE_USES_PROPERTIES) { - props = SDL_GetSurfaceProperties(surface); + if (SDL_SurfaceValid(surface)) { + props = surface->internal->props; } else { props = 0; } @@ -362,75 +388,96 @@ float SDL_GetSurfaceHDRHeadroom(SDL_Surface *surface, SDL_Colorspace colorspace) int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - if (SDL_SetPixelFormatPalette(surface->format, palette) < 0) { - return -1; + + if (palette && palette->ncolors > (1 << SDL_BITSPERPIXEL(surface->format))) { + return SDL_SetError("SDL_SetSurfacePalette() passed a palette that doesn't match the surface format"); + } + + if (palette == surface->internal->palette) { + return 0; + } + + if (surface->internal->palette) { + SDL_DestroyPalette(surface->internal->palette); + } + + surface->internal->palette = palette; + + if (surface->internal->palette) { + ++surface->internal->palette->refcount; } - SDL_InvalidateMap(surface->map); + + SDL_InvalidateMap(&surface->internal->map); return 0; } -int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag) +SDL_Palette *SDL_GetSurfacePalette(SDL_Surface *surface) +{ + if (!SDL_SurfaceValid(surface)) { + return NULL; + } + + return surface->internal->palette; +} + +int SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled) { int flags; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - flags = surface->map->info.flags; - if (flag) { - surface->map->info.flags |= SDL_COPY_RLE_DESIRED; + flags = surface->internal->map.info.flags; + if (enabled) { + surface->internal->map.info.flags |= SDL_COPY_RLE_DESIRED; } else { - surface->map->info.flags &= ~SDL_COPY_RLE_DESIRED; + surface->internal->map.info.flags &= ~SDL_COPY_RLE_DESIRED; } - if (surface->map->info.flags != flags) { - SDL_InvalidateMap(surface->map); + if (surface->internal->map.info.flags != flags) { + SDL_InvalidateMap(&surface->internal->map); } return 0; } SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_FALSE; } - if (!(surface->map->info.flags & SDL_COPY_RLE_DESIRED)) { + if (!(surface->internal->map.info.flags & SDL_COPY_RLE_DESIRED)) { return SDL_FALSE; } return SDL_TRUE; } -int SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key) +int SDL_SetSurfaceColorKey(SDL_Surface *surface, SDL_bool enabled, Uint32 key) { int flags; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - if (surface->format->palette && key >= ((Uint32)surface->format->palette->ncolors)) { + if (surface->internal->palette && key >= ((Uint32)surface->internal->palette->ncolors)) { return SDL_InvalidParamError("key"); } - if (flag & SDL_RLEACCEL) { - SDL_SetSurfaceRLE(surface, 1); - } - - flags = surface->map->info.flags; - if (flag) { - surface->map->info.flags |= SDL_COPY_COLORKEY; - surface->map->info.colorkey = key; + flags = surface->internal->map.info.flags; + if (enabled) { + surface->internal->map.info.flags |= SDL_COPY_COLORKEY; + surface->internal->map.info.colorkey = key; } else { - surface->map->info.flags &= ~SDL_COPY_COLORKEY; + surface->internal->map.info.flags &= ~SDL_COPY_COLORKEY; } - if (surface->map->info.flags != flags) { - SDL_InvalidateMap(surface->map); + if (surface->internal->map.info.flags != flags) { + SDL_InvalidateMap(&surface->internal->map); } return 0; @@ -438,11 +485,11 @@ int SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key) SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_FALSE; } - if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) { + if (!(surface->internal->map.info.flags & SDL_COPY_COLORKEY)) { return SDL_FALSE; } @@ -451,16 +498,16 @@ SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) int SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - if (!(surface->map->info.flags & SDL_COPY_COLORKEY)) { + if (!(surface->internal->map.info.flags & SDL_COPY_COLORKEY)) { return SDL_SetError("Surface doesn't have a colorkey"); } if (key) { - *key = surface->map->info.colorkey; + *key = surface->internal->map.info.colorkey; } return 0; } @@ -471,23 +518,23 @@ static void SDL_ConvertColorkeyToAlpha(SDL_Surface *surface, SDL_bool ignore_alp { int x, y, bpp; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return; } - if (!(surface->map->info.flags & SDL_COPY_COLORKEY) || - !surface->format->Amask) { + if (!(surface->internal->map.info.flags & SDL_COPY_COLORKEY) || + !SDL_ISPIXELFORMAT_ALPHA(surface->format)) { return; } - bpp = surface->format->bytes_per_pixel; + bpp = SDL_BYTESPERPIXEL(surface->format); SDL_LockSurface(surface); if (bpp == 2) { Uint16 *row, *spot; - Uint16 ckey = (Uint16)surface->map->info.colorkey; - Uint16 mask = (Uint16)(~surface->format->Amask); + Uint16 ckey = (Uint16)surface->internal->map.info.colorkey; + Uint16 mask = (Uint16)(~surface->internal->format->Amask); /* Ignore, or not, alpha in colorkey comparison */ if (ignore_alpha) { @@ -518,8 +565,8 @@ static void SDL_ConvertColorkeyToAlpha(SDL_Surface *surface, SDL_bool ignore_alp } } else if (bpp == 4) { Uint32 *row, *spot; - Uint32 ckey = surface->map->info.colorkey; - Uint32 mask = ~surface->format->Amask; + Uint32 ckey = surface->internal->map.info.colorkey; + Uint32 mask = ~surface->internal->format->Amask; /* Ignore, or not, alpha in colorkey comparison */ if (ignore_alpha) { @@ -560,40 +607,40 @@ int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) { int flags; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - surface->map->info.r = r; - surface->map->info.g = g; - surface->map->info.b = b; + surface->internal->map.info.r = r; + surface->internal->map.info.g = g; + surface->internal->map.info.b = b; - flags = surface->map->info.flags; + flags = surface->internal->map.info.flags; if (r != 0xFF || g != 0xFF || b != 0xFF) { - surface->map->info.flags |= SDL_COPY_MODULATE_COLOR; + surface->internal->map.info.flags |= SDL_COPY_MODULATE_COLOR; } else { - surface->map->info.flags &= ~SDL_COPY_MODULATE_COLOR; + surface->internal->map.info.flags &= ~SDL_COPY_MODULATE_COLOR; } - if (surface->map->info.flags != flags) { - SDL_InvalidateMap(surface->map); + if (surface->internal->map.info.flags != flags) { + SDL_InvalidateMap(&surface->internal->map); } return 0; } int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } if (r) { - *r = surface->map->info.r; + *r = surface->internal->map.info.r; } if (g) { - *g = surface->map->info.g; + *g = surface->internal->map.info.g; } if (b) { - *b = surface->map->info.b; + *b = surface->internal->map.info.b; } return 0; } @@ -602,32 +649,32 @@ int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) { int flags; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } - surface->map->info.a = alpha; + surface->internal->map.info.a = alpha; - flags = surface->map->info.flags; + flags = surface->internal->map.info.flags; if (alpha != 0xFF) { - surface->map->info.flags |= SDL_COPY_MODULATE_ALPHA; + surface->internal->map.info.flags |= SDL_COPY_MODULATE_ALPHA; } else { - surface->map->info.flags &= ~SDL_COPY_MODULATE_ALPHA; + surface->internal->map.info.flags &= ~SDL_COPY_MODULATE_ALPHA; } - if (surface->map->info.flags != flags) { - SDL_InvalidateMap(surface->map); + if (surface->internal->map.info.flags != flags) { + SDL_InvalidateMap(&surface->internal->map); } return 0; } int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } if (alpha) { - *alpha = surface->map->info.a; + *alpha = surface->internal->map.info.a; } return 0; } @@ -636,36 +683,35 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) { int flags, status; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } status = 0; - flags = surface->map->info.flags; - surface->map->info.flags &= - ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL); + flags = surface->internal->map.info.flags; + surface->internal->map.info.flags &= ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL); switch (blendMode) { case SDL_BLENDMODE_NONE: break; case SDL_BLENDMODE_BLEND: - surface->map->info.flags |= SDL_COPY_BLEND; + surface->internal->map.info.flags |= SDL_COPY_BLEND; break; case SDL_BLENDMODE_ADD: - surface->map->info.flags |= SDL_COPY_ADD; + surface->internal->map.info.flags |= SDL_COPY_ADD; break; case SDL_BLENDMODE_MOD: - surface->map->info.flags |= SDL_COPY_MOD; + surface->internal->map.info.flags |= SDL_COPY_MOD; break; case SDL_BLENDMODE_MUL: - surface->map->info.flags |= SDL_COPY_MUL; + surface->internal->map.info.flags |= SDL_COPY_MUL; break; default: status = SDL_Unsupported(); break; } - if (surface->map->info.flags != flags) { - SDL_InvalidateMap(surface->map); + if (surface->internal->map.info.flags != flags) { + SDL_InvalidateMap(&surface->internal->map); } return status; @@ -673,7 +719,7 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } @@ -681,7 +727,7 @@ int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) return 0; } - switch (surface->map->info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { + switch (surface->internal->map.info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: *blendMode = SDL_BLENDMODE_BLEND; break; @@ -706,7 +752,7 @@ SDL_bool SDL_SetSurfaceClipRect(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) { + if (!SDL_SurfaceValid(surface)) { return SDL_FALSE; } @@ -718,21 +764,21 @@ SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) /* Set the clipping rectangle */ if (!rect) { - surface->clip_rect = full_rect; + surface->internal->clip_rect = full_rect; return SDL_TRUE; } - return SDL_GetRectIntersection(rect, &full_rect, &surface->clip_rect); + return SDL_GetRectIntersection(rect, &full_rect, &surface->internal->clip_rect); } int SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } if (!rect) { return SDL_InvalidParamError("rect"); } - *rect = surface->clip_rect; + *rect = surface->internal->clip_rect; return 0; } @@ -751,21 +797,21 @@ int SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect) { /* Check to make sure the blit mapping is valid */ - if ((src->map->dst != dst) || - (dst->format->palette && - src->map->dst_palette_version != dst->format->palette->version) || - (src->format->palette && - src->map->src_palette_version != src->format->palette->version)) { + if ((src->internal->map.dst != dst) || + (dst->internal->palette && + src->internal->map.dst_palette_version != dst->internal->palette->version) || + (src->internal->palette && + src->internal->map.src_palette_version != src->internal->palette->version)) { if (SDL_MapSurface(src, dst) < 0) { return -1; } /* just here for debugging */ /* printf */ - /* ("src = 0x%08X src->flags = %08X src->map->info.flags = %08x\ndst = 0x%08X dst->flags = %08X dst->map->info.flags = %08X\nsrc->map->blit = 0x%08x\n", */ - /* src, dst->flags, src->map->info.flags, dst, dst->flags, */ - /* dst->map->info.flags, src->map->blit); */ + /* ("src = 0x%08X src->flags = %08X src->internal->map.info.flags = %08x\ndst = 0x%08X dst->flags = %08X dst->internal->map.info.flags = %08X\nsrc->internal->map.blit = 0x%08x\n", */ + /* src, dst->flags, src->internal->map.info.flags, dst, dst->flags, */ + /* dst->internal->map.info.flags, src->internal->map.blit); */ } - return src->map->blit(src, srcrect, dst, dstrect); + return src->internal->map.blit(src, srcrect, dst, dstrect); } int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, @@ -774,11 +820,11 @@ int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Rect r_src, r_dst; /* Make sure the surfaces aren't locked */ - if (!src) { + if (!SDL_SurfaceValid(src)) { return SDL_InvalidParamError("src"); - } else if (!dst) { + } else if (!SDL_SurfaceValid(dst)) { return SDL_InvalidParamError("dst"); - } else if (src->locked || dst->locked) { + } else if ((src->flags & SDL_SURFACE_LOCKED) || (dst->flags & SDL_SURFACE_LOCKED)) { return SDL_SetError("Surfaces must not be locked during blit"); } @@ -818,7 +864,7 @@ int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, /* clip the destination rectangle against the clip rectangle */ { SDL_Rect tmp; - if (SDL_GetRectIntersection(&r_dst, &dst->clip_rect, &tmp) == SDL_FALSE) { + if (SDL_GetRectIntersection(&r_dst, &dst->internal->clip_rect, &tmp) == SDL_FALSE) { goto end; } @@ -833,9 +879,9 @@ int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, } /* Switch back to a fast blit if we were previously stretching */ - if (src->map->info.flags & SDL_COPY_NEAREST) { - src->map->info.flags &= ~SDL_COPY_NEAREST; - SDL_InvalidateMap(src->map); + if (src->internal->map.info.flags & SDL_COPY_NEAREST) { + src->internal->map.info.flags &= ~SDL_COPY_NEAREST; + SDL_InvalidateMap(&src->internal->map); } if (r_dst.w > 0 && r_dst.h > 0) { @@ -856,6 +902,7 @@ int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode) { + SDL_Rect *clip_rect; double src_x0, src_y0, src_x1, src_y1; double dst_x0, dst_y0, dst_x1, dst_y1; SDL_Rect final_src, final_dst; @@ -864,10 +911,11 @@ int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, int dst_w, dst_h; /* Make sure the surfaces aren't locked */ - if (!src || !dst) { - return SDL_InvalidParamError("SDL_BlitSurfaceScaled(): src/dst"); - } - if (src->locked || dst->locked) { + if (!SDL_SurfaceValid(src)) { + return SDL_InvalidParamError("src"); + } else if (!SDL_SurfaceValid(dst)) { + return SDL_InvalidParamError("dst"); + } else if ((src->flags & SDL_SURFACE_LOCKED) || (dst->flags & SDL_SURFACE_LOCKED)) { return SDL_SetError("Surfaces must not be locked during blit"); } @@ -942,21 +990,22 @@ int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, } /* Clip destination rectangle to the clip rectangle */ + clip_rect = &dst->internal->clip_rect; /* Translate to clip space for easier calculations */ - dst_x0 -= dst->clip_rect.x; - dst_x1 -= dst->clip_rect.x; - dst_y0 -= dst->clip_rect.y; - dst_y1 -= dst->clip_rect.y; + dst_x0 -= clip_rect->x; + dst_x1 -= clip_rect->x; + dst_y0 -= clip_rect->y; + dst_y1 -= clip_rect->y; if (dst_x0 < 0) { src_x0 -= dst_x0 / scaling_w; dst_x0 = 0; } - if (dst_x1 > dst->clip_rect.w) { - src_x1 -= (dst_x1 - dst->clip_rect.w) / scaling_w; - dst_x1 = dst->clip_rect.w; + if (dst_x1 > clip_rect->w) { + src_x1 -= (dst_x1 - clip_rect->w) / scaling_w; + dst_x1 = clip_rect->w; } if (dst_y0 < 0) { @@ -964,16 +1013,16 @@ int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, dst_y0 = 0; } - if (dst_y1 > dst->clip_rect.h) { - src_y1 -= (dst_y1 - dst->clip_rect.h) / scaling_h; - dst_y1 = dst->clip_rect.h; + if (dst_y1 > clip_rect->h) { + src_y1 -= (dst_y1 - clip_rect->h) / scaling_h; + dst_y1 = clip_rect->h; } /* Translate back to surface coordinates */ - dst_x0 += dst->clip_rect.x; - dst_x1 += dst->clip_rect.x; - dst_y0 += dst->clip_rect.y; - dst_y1 += dst->clip_rect.y; + dst_x0 += clip_rect->x; + dst_x1 += clip_rect->x; + dst_y0 += clip_rect->y; + dst_y1 += clip_rect->y; final_src.x = (int)SDL_round(src_x0); final_src.y = (int)SDL_round(src_y0); @@ -996,7 +1045,7 @@ int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, } /* Clip again */ - SDL_GetRectIntersection(&dst->clip_rect, &final_dst, &final_dst); + SDL_GetRectIntersection(clip_rect, &final_dst, &final_dst); if (dstrect) { *dstrect = final_dst; @@ -1036,25 +1085,25 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, return SDL_SetError("Size too large for scaling"); } - if (!(src->map->info.flags & SDL_COPY_NEAREST)) { - src->map->info.flags |= SDL_COPY_NEAREST; - SDL_InvalidateMap(src->map); + if (!(src->internal->map.info.flags & SDL_COPY_NEAREST)) { + src->internal->map.info.flags |= SDL_COPY_NEAREST; + SDL_InvalidateMap(&src->internal->map); } if (scaleMode == SDL_SCALEMODE_NEAREST) { - if (!(src->map->info.flags & complex_copy_flags) && - src->format->format == dst->format->format && - !SDL_ISPIXELFORMAT_INDEXED(src->format->format)) { + if (!(src->internal->map.info.flags & complex_copy_flags) && + src->format == dst->format && + !SDL_ISPIXELFORMAT_INDEXED(src->format)) { return SDL_SoftStretch(src, srcrect, dst, dstrect, SDL_SCALEMODE_NEAREST); } else { return SDL_BlitSurfaceUnchecked(src, srcrect, dst, dstrect); } } else { - if (!(src->map->info.flags & complex_copy_flags) && - src->format->format == dst->format->format && - !SDL_ISPIXELFORMAT_INDEXED(src->format->format) && - src->format->bytes_per_pixel == 4 && - src->format->format != SDL_PIXELFORMAT_ARGB2101010) { + if (!(src->internal->map.info.flags & complex_copy_flags) && + src->format == dst->format && + !SDL_ISPIXELFORMAT_INDEXED(src->format) && + SDL_BYTESPERPIXEL(src->format) == 4 && + src->format != SDL_PIXELFORMAT_ARGB2101010) { /* fast path */ return SDL_SoftStretch(src, srcrect, dst, dstrect, SDL_SCALEMODE_LINEAR); } else { @@ -1062,7 +1111,7 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *tmp1 = NULL; int ret; SDL_Rect srcrect2; - int is_complex_copy_flags = (src->map->info.flags & complex_copy_flags); + int is_complex_copy_flags = (src->internal->map.info.flags & complex_copy_flags); Uint8 r, g, b; Uint8 alpha; @@ -1078,15 +1127,15 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, srcrect2.h = srcrect->h; /* Change source format if not appropriate for scaling */ - if (src->format->bytes_per_pixel != 4 || src->format->format == SDL_PIXELFORMAT_ARGB2101010) { + if (SDL_BYTESPERPIXEL(src->format) != 4 || src->format == SDL_PIXELFORMAT_ARGB2101010) { SDL_Rect tmprect; - SDL_PixelFormatEnum fmt; + SDL_PixelFormat fmt; tmprect.x = 0; tmprect.y = 0; tmprect.w = src->w; tmprect.h = src->h; - if (dst->format->bytes_per_pixel == 4 && dst->format->format != SDL_PIXELFORMAT_ARGB2101010) { - fmt = dst->format->format; + if (SDL_BYTESPERPIXEL(dst->format) == 4 && dst->format != SDL_PIXELFORMAT_ARGB2101010) { + fmt = dst->format; } else { fmt = SDL_PIXELFORMAT_ARGB8888; } @@ -1103,9 +1152,9 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, } /* Intermediate scaling */ - if (is_complex_copy_flags || src->format->format != dst->format->format) { + if (is_complex_copy_flags || src->format != dst->format) { SDL_Rect tmprect; - SDL_Surface *tmp2 = SDL_CreateSurface(dstrect->w, dstrect->h, src->format->format); + SDL_Surface *tmp2 = SDL_CreateSurface(dstrect->w, dstrect->h, src->format); SDL_SoftStretch(src, &srcrect2, tmp2, NULL, SDL_SCALEMODE_LINEAR); SDL_SetSurfaceColorMod(tmp2, r, g, b); @@ -1133,18 +1182,24 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, */ int SDL_LockSurface(SDL_Surface *surface) { - if (!surface->locked) { + if (!SDL_SurfaceValid(surface)) { + return SDL_InvalidParamError("surface"); + } + + if (!surface->internal->locked) { #if SDL_HAVE_RLE /* Perform the lock */ - if (surface->flags & SDL_RLEACCEL) { - SDL_UnRLESurface(surface, 1); - surface->flags |= SDL_RLEACCEL; /* save accel'd state */ + if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + SDL_UnRLESurface(surface, SDL_TRUE); + surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; /* save accel'd state */ + SDL_UpdateSurfaceLockFlag(surface); } #endif } /* Increment the surface lock count, for recursive locks */ - ++surface->locked; + ++surface->internal->locked; + surface->flags |= SDL_SURFACE_LOCKED; /* Ready to go.. */ return 0; @@ -1155,18 +1210,24 @@ int SDL_LockSurface(SDL_Surface *surface) */ void SDL_UnlockSurface(SDL_Surface *surface) { + if (!SDL_SurfaceValid(surface)) { + return; + } + /* Only perform an unlock if we are locked */ - if (!surface->locked || (--surface->locked > 0)) { + if (!surface->internal->locked || (--surface->internal->locked > 0)) { return; } #if SDL_HAVE_RLE /* Update RLE encoded surface with new data */ - if ((surface->flags & SDL_RLEACCEL) == SDL_RLEACCEL) { - surface->flags &= ~SDL_RLEACCEL; /* stop lying */ + if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + surface->internal->flags &= ~SDL_INTERNAL_SURFACE_RLEACCEL; /* stop lying */ SDL_RLESurface(surface); } #endif + + surface->flags &= ~SDL_SURFACE_LOCKED; } static int SDL_FlipSurfaceHorizontal(SDL_Surface *surface) @@ -1175,7 +1236,7 @@ static int SDL_FlipSurfaceHorizontal(SDL_Surface *surface) Uint8 *row, *a, *b, *tmp; int i, j, bpp; - if (surface->format->bits_per_pixel < 8) { + if (SDL_BITSPERPIXEL(surface->format) < 8) { /* We could implement this if needed, but we'd have to flip sets of bits within a byte */ return SDL_Unsupported(); } @@ -1188,7 +1249,7 @@ static int SDL_FlipSurfaceHorizontal(SDL_Surface *surface) return 0; } - bpp = surface->format->bytes_per_pixel; + bpp = SDL_BYTESPERPIXEL(surface->format); row = (Uint8 *)surface->pixels; tmp = SDL_small_alloc(Uint8, surface->pitch, &isstack); for (i = surface->h; i--; ) { @@ -1233,7 +1294,7 @@ static int SDL_FlipSurfaceVertical(SDL_Surface *surface) int SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip) { - if (!surface || !surface->format) { + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } if (!surface->pixels) { @@ -1250,7 +1311,7 @@ int SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip) } } -static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface *surface, const SDL_PixelFormat *format, SDL_Colorspace colorspace, SDL_PropertiesID props) +SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, const SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props) { SDL_Surface *convert; SDL_Colorspace src_colorspace; @@ -1265,41 +1326,35 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * Uint8 *palette_saved_alpha = NULL; int palette_saved_alpha_ncolors = 0; - if (!surface) { + if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("surface"); return NULL; } - if (!format) { + + if (format == SDL_PIXELFORMAT_UNKNOWN) { SDL_InvalidParamError("format"); return NULL; } /* Check for empty destination palette! (results in empty image) */ - if (format->palette) { + if (palette) { int i; - for (i = 0; i < format->palette->ncolors; ++i) { - if ((format->palette->colors[i].r != 0xFF) || (format->palette->colors[i].g != 0xFF) || (format->palette->colors[i].b != 0xFF)) { + for (i = 0; i < palette->ncolors; ++i) { + if ((palette->colors[i].r != 0xFF) || (palette->colors[i].g != 0xFF) || (palette->colors[i].b != 0xFF)) { break; } } - if (i == format->palette->ncolors) { + if (i == palette->ncolors) { SDL_SetError("Empty destination palette"); return NULL; } } - if (SDL_GetSurfaceColorspace(surface, &src_colorspace) < 0) { - return NULL; - } - - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - src_properties = SDL_GetSurfaceProperties(surface); - } else { - src_properties = 0; - } + src_colorspace = SDL_GetSurfaceColorspace(surface); + src_properties = surface->internal->props; /* Create a new surface with the desired format */ - convert = SDL_CreateSurface(surface->w, surface->h, format->format); + convert = SDL_CreateSurface(surface->w, surface->h, format); if (!convert) { return NULL; } @@ -1309,38 +1364,38 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * } SDL_SetSurfaceColorspace(convert, colorspace); - if (SDL_ISPIXELFORMAT_FOURCC(format->format) || SDL_ISPIXELFORMAT_FOURCC(surface->format->format)) { - if (SDL_ConvertPixelsAndColorspace(surface->w, surface->h, surface->format->format, src_colorspace, src_properties, surface->pixels, surface->pitch, convert->format->format, colorspace, props, convert->pixels, convert->pitch) < 0) { + if (SDL_ISPIXELFORMAT_FOURCC(format) || SDL_ISPIXELFORMAT_FOURCC(surface->format)) { + if (SDL_ConvertPixelsAndColorspace(surface->w, surface->h, surface->format, src_colorspace, src_properties, surface->pixels, surface->pitch, convert->format, colorspace, props, convert->pixels, convert->pitch) < 0) { SDL_DestroySurface(convert); return NULL; } /* Save the original copy flags */ - copy_flags = surface->map->info.flags; + copy_flags = surface->internal->map.info.flags; goto end; } /* 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; + if (palette && convert->internal->palette) { + SDL_memcpy(convert->internal->palette->colors, + palette->colors, + palette->ncolors * sizeof(SDL_Color)); + convert->internal->palette->ncolors = palette->ncolors; } /* Save the original copy flags */ - copy_flags = surface->map->info.flags; - copy_color.r = surface->map->info.r; - copy_color.g = surface->map->info.g; - copy_color.b = surface->map->info.b; - copy_color.a = surface->map->info.a; - surface->map->info.r = 0xFF; - surface->map->info.g = 0xFF; - surface->map->info.b = 0xFF; - surface->map->info.a = 0xFF; - surface->map->info.flags = (copy_flags & (SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY)); - SDL_InvalidateMap(surface->map); + copy_flags = surface->internal->map.info.flags; + copy_color.r = surface->internal->map.info.r; + copy_color.g = surface->internal->map.info.g; + copy_color.b = surface->internal->map.info.b; + copy_color.a = surface->internal->map.info.a; + surface->internal->map.info.r = 0xFF; + surface->internal->map.info.g = 0xFF; + surface->internal->map.info.b = 0xFF; + surface->internal->map.info.a = 0xFF; + surface->internal->map.info.flags = (copy_flags & (SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY)); + SDL_InvalidateMap(&surface->internal->map); /* Copy over the image data */ bounds.x = 0; @@ -1351,11 +1406,11 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * /* Source surface has a palette with no real alpha (0 or OPAQUE). * Destination format has alpha. * -> set alpha channel to be opaque */ - if (surface->format->palette && format->Amask) { + if (surface->internal->palette && SDL_ISPIXELFORMAT_ALPHA(format)) { SDL_bool set_opaque = SDL_FALSE; SDL_bool is_opaque, has_alpha_channel; - SDL_DetectPalette(surface->format->palette, &is_opaque, &has_alpha_channel); + SDL_DetectPalette(surface->internal->palette, &is_opaque, &has_alpha_channel); if (is_opaque) { if (!has_alpha_channel) { @@ -1368,12 +1423,12 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * /* Set opaque and backup palette alpha values */ if (set_opaque) { int i; - palette_saved_alpha_ncolors = surface->format->palette->ncolors; + palette_saved_alpha_ncolors = surface->internal->palette->ncolors; if (palette_saved_alpha_ncolors > 0) { palette_saved_alpha = SDL_stack_alloc(Uint8, palette_saved_alpha_ncolors); for (i = 0; i < palette_saved_alpha_ncolors; i++) { - palette_saved_alpha[i] = surface->format->palette->colors[i].a; - surface->format->palette->colors[i].a = SDL_ALPHA_OPAQUE; + palette_saved_alpha[i] = surface->internal->palette->colors[i].a; + surface->internal->palette->colors[i].a = SDL_ALPHA_OPAQUE; } } } @@ -1381,11 +1436,11 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * /* Transform colorkey to alpha. for cases where source palette has duplicate values, and colorkey is one of them */ if (copy_flags & SDL_COPY_COLORKEY) { - if (surface->format->palette && !format->palette) { + if (surface->internal->palette && !palette) { palette_ck_transform = SDL_TRUE; palette_has_alpha = SDL_TRUE; - palette_ck_value = surface->format->palette->colors[surface->map->info.colorkey].a; - surface->format->palette->colors[surface->map->info.colorkey].a = SDL_ALPHA_TRANSPARENT; + palette_ck_value = surface->internal->palette->colors[surface->internal->map.info.colorkey].a; + surface->internal->palette->colors[surface->internal->map.info.colorkey].a = SDL_ALPHA_TRANSPARENT; } } @@ -1393,33 +1448,33 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * /* Restore colorkey alpha value */ if (palette_ck_transform) { - surface->format->palette->colors[surface->map->info.colorkey].a = palette_ck_value; + surface->internal->palette->colors[surface->internal->map.info.colorkey].a = palette_ck_value; } /* Restore palette alpha values */ if (palette_saved_alpha) { int i; for (i = 0; i < palette_saved_alpha_ncolors; i++) { - surface->format->palette->colors[i].a = palette_saved_alpha[i]; + surface->internal->palette->colors[i].a = palette_saved_alpha[i]; } SDL_stack_free(palette_saved_alpha); } /* Clean up the original surface, and update converted surface */ - convert->map->info.r = copy_color.r; - convert->map->info.g = copy_color.g; - convert->map->info.b = copy_color.b; - convert->map->info.a = copy_color.a; - convert->map->info.flags = + convert->internal->map.info.r = copy_color.r; + convert->internal->map.info.g = copy_color.g; + convert->internal->map.info.b = copy_color.b; + convert->internal->map.info.a = copy_color.a; + convert->internal->map.info.flags = (copy_flags & ~(SDL_COPY_COLORKEY | SDL_COPY_BLEND | SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY)); - surface->map->info.r = copy_color.r; - surface->map->info.g = copy_color.g; - surface->map->info.b = copy_color.b; - surface->map->info.a = copy_color.a; - surface->map->info.flags = copy_flags; - SDL_InvalidateMap(surface->map); + surface->internal->map.info.r = copy_color.r; + surface->internal->map.info.g = copy_color.g; + surface->internal->map.info.b = copy_color.b; + surface->internal->map.info.a = copy_color.a; + surface->internal->map.info.flags = copy_flags; + SDL_InvalidateMap(&surface->internal->map); /* SDL_BlitSurfaceUnchecked failed, and so the conversion */ if (ret < 0) { @@ -1431,15 +1486,15 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * SDL_bool set_colorkey_by_color = SDL_FALSE; SDL_bool convert_colorkey = SDL_TRUE; - if (surface->format->palette) { - if (format->palette && - surface->format->palette->ncolors <= format->palette->ncolors && - (SDL_memcmp(surface->format->palette->colors, format->palette->colors, - surface->format->palette->ncolors * sizeof(SDL_Color)) == 0)) { + if (surface->internal->palette) { + if (palette && + surface->internal->palette->ncolors <= palette->ncolors && + (SDL_memcmp(surface->internal->palette->colors, palette->colors, + surface->internal->palette->ncolors * sizeof(SDL_Color)) == 0)) { /* The palette is identical, just set the same colorkey */ - SDL_SetSurfaceColorKey(convert, 1, surface->map->info.colorkey); - } else if (!format->palette) { - if (format->Amask) { + SDL_SetSurfaceColorKey(convert, 1, surface->internal->map.info.colorkey); + } else if (!palette) { + if (SDL_ISPIXELFORMAT_ALPHA(format)) { /* No need to add the colorkey, transparency is in the alpha channel*/ } else { /* Only set the colorkey information */ @@ -1459,23 +1514,23 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * int converted_colorkey = 0; /* Create a dummy surface to get the colorkey converted */ - tmp = SDL_CreateSurface(1, 1, surface->format->format); + tmp = SDL_CreateSurface(1, 1, surface->format); if (!tmp) { SDL_DestroySurface(convert); return NULL; } /* Share the palette, if any */ - if (surface->format->palette) { - SDL_SetSurfacePalette(tmp, surface->format->palette); + if (surface->internal->palette) { + SDL_SetSurfacePalette(tmp, surface->internal->palette); } - SDL_FillSurfaceRect(tmp, NULL, surface->map->info.colorkey); + SDL_FillSurfaceRect(tmp, NULL, surface->internal->map.info.colorkey); - tmp->map->info.flags &= ~SDL_COPY_COLORKEY; + tmp->internal->map.info.flags &= ~SDL_COPY_COLORKEY; /* Conversion of the colorkey */ - tmp2 = SDL_ConvertSurfaceWithPixelFormatAndColorspace(tmp, format, colorspace, props); + tmp2 = SDL_ConvertSurfaceAndColorspace(tmp, format, palette, colorspace, props); if (!tmp2) { SDL_DestroySurface(tmp); SDL_DestroySurface(convert); @@ -1483,7 +1538,7 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * } /* Get the converted colorkey */ - SDL_memcpy(&converted_colorkey, tmp2->pixels, tmp2->format->bytes_per_pixel); + SDL_memcpy(&converted_colorkey, tmp2->pixels, tmp2->internal->format->bytes_per_pixel); SDL_DestroySurface(tmp); SDL_DestroySurface(tmp2); @@ -1500,17 +1555,17 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * end: - SDL_SetSurfaceClipRect(convert, &surface->clip_rect); + SDL_SetSurfaceClipRect(convert, &surface->internal->clip_rect); /* Enable alpha blending by default if the new surface has an * alpha channel or alpha modulation */ - if ((surface->format->Amask && format->Amask) || - (palette_has_alpha && format->Amask) || + if ((SDL_ISPIXELFORMAT_ALPHA(surface->format) && SDL_ISPIXELFORMAT_ALPHA(format)) || + (palette_has_alpha && SDL_ISPIXELFORMAT_ALPHA(format)) || (copy_flags & SDL_COPY_MODULATE_ALPHA)) { SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND); } if (copy_flags & SDL_COPY_RLE_DESIRED) { - SDL_SetSurfaceRLE(convert, SDL_RLEACCEL); + SDL_SetSurfaceRLE(convert, SDL_TRUE); } /* We're ready to go! */ @@ -1519,123 +1574,25 @@ static SDL_Surface *SDL_ConvertSurfaceWithPixelFormatAndColorspace(SDL_Surface * SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("surface"); return NULL; } - return SDL_ConvertSurfaceWithPixelFormatAndColorspace(surface, surface->format, SDL_COLORSPACE_UNKNOWN, 0); + return SDL_ConvertSurfaceAndColorspace(surface, surface->format, surface->internal->palette, SDL_GetSurfaceColorspace(surface), surface->internal->props); } -SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format) +SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, SDL_PixelFormat format) { - SDL_Colorspace colorspace; - - if (!surface) { + if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("surface"); return NULL; } - if (!format) { - SDL_InvalidParamError("format"); - return NULL; - } - - colorspace = SDL_GetDefaultColorspaceForFormat(format->format); - - return SDL_ConvertSurfaceWithPixelFormatAndColorspace(surface, format, colorspace, 0); -} - -SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format) -{ - SDL_Colorspace colorspace; - SDL_PropertiesID props; - - if (!surface) { - SDL_InvalidParamError("surface"); - return NULL; - } - - colorspace = SDL_GetDefaultColorspaceForFormat(pixel_format); - - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - props = SDL_GetSurfaceProperties(surface); - } else { - props = 0; - } - - return SDL_ConvertSurfaceFormatAndColorspace(surface, pixel_format, colorspace, props); + return SDL_ConvertSurfaceAndColorspace(surface, format, NULL, SDL_GetDefaultColorspaceForFormat(format), surface->internal->props); } -SDL_Surface *SDL_ConvertSurfaceFormatAndColorspace(SDL_Surface *surface, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props) -{ - SDL_PixelFormat *format; - SDL_Surface *convert = NULL; - - format = SDL_CreatePixelFormat(pixel_format); - if (format) { - convert = SDL_ConvertSurfaceWithPixelFormatAndColorspace(surface, format, colorspace, props); - SDL_DestroyPixelFormat(format); - } - return convert; -} - -/* - * Create a surface on the stack for quick blit operations - */ -static SDL_bool SDL_CreateSurfaceOnStack(int width, int height, SDL_PixelFormatEnum pixel_format, SDL_Colorspace colorspace, SDL_PropertiesID props, void *pixels, int pitch, SDL_Surface *surface, SDL_PixelFormat *format, SDL_BlitMap *blitmap) -{ - if (SDL_ISPIXELFORMAT_INDEXED(pixel_format)) { - SDL_SetError("Indexed pixel formats not supported"); - return SDL_FALSE; - } - if (SDL_InitFormat(format, pixel_format) < 0) { - return SDL_FALSE; - } - - SDL_zerop(surface); - surface->flags = SDL_PREALLOC; - surface->format = format; - surface->pixels = pixels; - surface->w = width; - surface->h = height; - surface->pitch = pitch; - /* We don't actually need to set up the clip rect for our purposes */ - /* SDL_SetSurfaceClipRect(surface, NULL); */ - - /* Allocate an empty mapping */ - SDL_zerop(blitmap); - blitmap->info.r = 0xFF; - blitmap->info.g = 0xFF; - blitmap->info.b = 0xFF; - blitmap->info.a = 0xFF; - surface->map = blitmap; - - SDL_SetSurfaceColorspace(surface, colorspace); - - if (props) { - SDL_PropertiesID surface_props = SDL_GetSurfaceProperties(surface); - if (SDL_CopyProperties(props, surface_props) < 0) { - return SDL_FALSE; - } - } - - /* The surface is ready to go */ - surface->refcount = 1; - return SDL_TRUE; -} - -static void SDL_DestroySurfaceOnStack(SDL_Surface *surface) -{ - /* Free blitmap reference, after blitting between stack'ed surfaces */ - SDL_InvalidateMap(surface->map); - - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - SDL_DestroyProperties(SDL_GetSurfaceProperties(surface)); - } -} - -SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormatEnum format, SDL_Colorspace colorspace, void *pixels, int pitch) +SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormat format, SDL_Colorspace colorspace, void *pixels, int pitch) { SDL_Surface *surface = SDL_CreateSurface(width, height, format); if (surface) { @@ -1655,12 +1612,12 @@ SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormatEnum form } int SDL_ConvertPixelsAndColorspace(int width, int height, - SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) + SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, + SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) { - SDL_Surface src_surface, dst_surface; - SDL_PixelFormat src_fmt, dst_fmt; - SDL_BlitMap src_blitmap, dst_blitmap; + SDL_InternalSurface src_data, dst_data; + SDL_Surface *src_surface; + SDL_Surface *dst_surface; SDL_Rect rect; void *nonconst_src = (void *)src; int ret; @@ -1712,11 +1669,14 @@ int SDL_ConvertPixelsAndColorspace(int width, int height, return 0; } - if (!SDL_CreateSurfaceOnStack(width, height, src_format, src_colorspace, src_properties, nonconst_src, src_pitch, &src_surface, &src_fmt, &src_blitmap)) { + src_surface = SDL_InitializeSurface(&src_data, width, height, src_format, src_colorspace, src_properties, nonconst_src, src_pitch, SDL_TRUE); + if (!src_surface) { return -1; } + SDL_SetSurfaceBlendMode(src_surface, SDL_BLENDMODE_NONE); - if (!SDL_CreateSurfaceOnStack(width, height, dst_format, dst_colorspace, dst_properties, dst, dst_pitch, &dst_surface, &dst_fmt, &dst_blitmap)) { + dst_surface = SDL_InitializeSurface(&dst_data, width, height, dst_format, dst_colorspace, dst_properties, dst, dst_pitch, SDL_TRUE); + if (!dst_surface) { return -1; } @@ -1725,17 +1685,17 @@ int SDL_ConvertPixelsAndColorspace(int width, int height, rect.y = 0; rect.w = width; rect.h = height; - ret = SDL_BlitSurfaceUnchecked(&src_surface, &rect, &dst_surface, &rect); + ret = SDL_BlitSurfaceUnchecked(src_surface, &rect, dst_surface, &rect); - SDL_DestroySurfaceOnStack(&src_surface); - SDL_DestroySurfaceOnStack(&dst_surface); + SDL_DestroySurface(src_surface); + SDL_DestroySurface(dst_surface); return ret; } int SDL_ConvertPixels(int width, int height, - SDL_PixelFormatEnum src_format, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch) + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch) { return SDL_ConvertPixelsAndColorspace(width, height, src_format, SDL_COLORSPACE_UNKNOWN, 0, src, src_pitch, @@ -1752,8 +1712,8 @@ int SDL_ConvertPixels(int width, int height, * https://developer.arm.com/documentation/101964/0201/Pre-multiplied-alpha-channel-data */ int SDL_PremultiplyAlpha(int width, int height, - SDL_PixelFormatEnum src_format, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch) + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch) { int c; Uint32 srcpixel; @@ -1804,6 +1764,20 @@ int SDL_PremultiplyAlpha(int width, int height, return 0; } +Uint32 SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) +{ + return SDL_MapSurfaceRGBA(surface, r, g, b, SDL_ALPHA_OPAQUE); +} + +Uint32 SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b, Uint8 a) +{ + if (!SDL_SurfaceValid(surface)) { + SDL_InvalidParamError("surface"); + return 0; + } + return SDL_MapRGBA(surface->internal->format, surface->internal->palette, r, g, b, a); +} + /* This function Copyright 2023 Collabora Ltd., contributed to SDL under the ZLib license */ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a) { @@ -1841,7 +1815,7 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, a = &unused; } - bytes_per_pixel = surface->format->bytes_per_pixel; + bytes_per_pixel = SDL_BYTESPERPIXEL(surface->format); if (SDL_MUSTLOCK(surface)) { SDL_LockSurface(surface); @@ -1852,10 +1826,9 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, if (bytes_per_pixel > sizeof(pixel)) { /* This is really slow, but it gets the job done */ Uint8 rgba[4]; - SDL_Colorspace colorspace; + SDL_Colorspace colorspace = SDL_GetSurfaceColorspace(surface); - if (SDL_GetSurfaceColorspace(surface, &colorspace) == 0 && - SDL_ConvertPixelsAndColorspace(1, 1, surface->format->format, colorspace, SDL_GetSurfaceProperties(surface), p, surface->pitch, SDL_PIXELFORMAT_RGBA32, SDL_COLORSPACE_SRGB, 0, rgba, sizeof(rgba)) == 0) { + if (SDL_ConvertPixelsAndColorspace(1, 1, surface->format, colorspace, surface->internal->props, p, surface->pitch, SDL_PIXELFORMAT_RGBA32, SDL_COLORSPACE_SRGB, 0, rgba, sizeof(rgba)) == 0) { *r = rgba[0]; *g = rgba[1]; *b = rgba[2]; @@ -1870,7 +1843,7 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, #else SDL_memcpy(&pixel, p, bytes_per_pixel); #endif - SDL_GetRGBA(pixel, surface->format, r, g, b, a); + SDL_GetRGBA(pixel, surface->internal->format, surface->internal->palette, r, g, b, a); result = 0; } @@ -1885,48 +1858,41 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, */ void SDL_DestroySurface(SDL_Surface *surface) { - if (!surface) { + if (!SDL_SurfaceValid(surface)) { return; } - if (surface->flags & SDL_DONTFREE) { + if (surface->internal->flags & SDL_INTERNAL_SURFACE_DONTFREE) { return; } if (--surface->refcount > 0) { return; } - if (surface->flags & SDL_SURFACE_USES_PROPERTIES) { - SDL_PropertiesID props = (SDL_PropertiesID)(uintptr_t)surface->reserved; - SDL_DestroyProperties(props); - } + SDL_DestroyProperties(surface->internal->props); - SDL_InvalidateMap(surface->map); + SDL_InvalidateMap(&surface->internal->map); SDL_InvalidateAllBlitMap(surface); - while (surface->locked > 0) { + while (surface->internal->locked > 0) { SDL_UnlockSurface(surface); } #if SDL_HAVE_RLE - if (surface->flags & SDL_RLEACCEL) { - SDL_UnRLESurface(surface, 0); + if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + SDL_UnRLESurface(surface, SDL_FALSE); } #endif - if (surface->format) { - SDL_SetSurfacePalette(surface, NULL); - SDL_DestroyPixelFormat(surface->format); - surface->format = NULL; - } - if (surface->flags & SDL_PREALLOC) { + SDL_SetSurfacePalette(surface, NULL); + + if (surface->flags & SDL_SURFACE_PREALLOCATED) { /* Don't free */ - } else if (surface->flags & SDL_SIMD_ALIGNED) { + } else if (surface->flags & SDL_SURFACE_SIMD_ALIGNED) { /* Free aligned */ SDL_aligned_free(surface->pixels); } else { /* Normal */ SDL_free(surface->pixels); } - if (surface->map) { - SDL_FreeBlitMap(surface->map); + if (!(surface->internal->flags & SDL_INTERNAL_SURFACE_STACK)) { + SDL_free(surface); } - SDL_free(surface); } diff --git a/src/video/SDL_surface_c.h b/src/video/SDL_surface_c.h new file mode 100644 index 0000000000000..215387bd64741 --- /dev/null +++ b/src/video/SDL_surface_c.h @@ -0,0 +1,80 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ +#include "SDL_internal.h" + +#ifndef SDL_surface_c_h_ +#define SDL_surface_c_h_ + +/* Useful functions and variables from SDL_surface.c */ + +#include "../SDL_list.h" + +/* Surface internal flags */ +typedef Uint32 SDL_SurfaceDataFlags; + +#define SDL_INTERNAL_SURFACE_DONTFREE 0x00000001u /**< Surface is referenced internally */ +#define SDL_INTERNAL_SURFACE_STACK 0x00000002u /**< Surface is allocated on the stack */ +#define SDL_INTERNAL_SURFACE_RLEACCEL 0x00000004u /**< Surface is RLE encoded */ + +/* Surface internal data definition */ +struct SDL_SurfaceData +{ + /** flags for this surface */ + SDL_SurfaceDataFlags flags; + + /** properties for this surface */ + SDL_PropertiesID props; + + /** detailed format for this surface */ + const SDL_PixelFormatDetails *format; + + /** palette for indexed surfaces */ + SDL_Palette *palette; + + /** information needed for surfaces requiring locks */ + int locked; + + /** clipping information */ + SDL_Rect clip_rect; + + /** info for fast blit mapping to other surfaces */ + SDL_BlitMap map; + + /** list of BlitMap that hold a reference to this surface */ + SDL_ListNode *list_blitmap; +}; + +typedef struct SDL_InternalSurface +{ + SDL_Surface surface; + SDL_SurfaceData internal; + +} SDL_InternalSurface; + +/* Surface functions */ +extern SDL_bool SDL_SurfaceValid(SDL_Surface *surface); +extern void SDL_UpdateSurfaceLockFlag(SDL_Surface *surface); +extern float SDL_GetDefaultSDRWhitePoint(SDL_Colorspace colorspace); +extern float SDL_GetSurfaceSDRWhitePoint(SDL_Surface *surface, SDL_Colorspace colorspace); +extern float SDL_GetDefaultHDRHeadroom(SDL_Colorspace colorspace); +extern float SDL_GetSurfaceHDRHeadroom(SDL_Surface *surface, SDL_Colorspace colorspace); + +#endif /* SDL_surface_c_h_ */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 0a5e7b56b7a1b..f648fd0e222ff 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -268,7 +268,7 @@ struct SDL_VideoDevice int (*SetWindowMouseGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); int (*SetWindowKeyboardGrab)(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed); void (*DestroyWindow)(SDL_VideoDevice *_this, SDL_Window *window); - int (*CreateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); + int (*CreateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); int (*SetWindowFramebufferVSync)(SDL_VideoDevice *_this, SDL_Window *window, int vsync); int (*GetWindowFramebufferVSync)(SDL_VideoDevice *_this, SDL_Window *window, int *vsync); int (*UpdateWindowFramebuffer)(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index e4939cd2da2c0..82de50bd8d384 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -284,14 +284,14 @@ static void SDLCALL SDL_CleanupWindowTextureData(void *userdata, void *value) SDL_free(data); } -static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_PropertiesID props = SDL_GetWindowProperties(window); SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); const SDL_bool transparent = (window->flags & SDL_WINDOW_TRANSPARENT) ? SDL_TRUE : SDL_FALSE; int i; int w, h; - const SDL_PixelFormatEnum *texture_formats; + const SDL_PixelFormat *texture_formats; SDL_GetWindowSizeInPixels(window, &w, &h); @@ -355,7 +355,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S data->renderer = renderer; } - texture_formats = (const SDL_PixelFormatEnum *)SDL_GetProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); + texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); if (!texture_formats) { return -1; } @@ -372,7 +372,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S *format = texture_formats[0]; for (i = 0; texture_formats[i] != SDL_PIXELFORMAT_UNKNOWN; ++i) { - SDL_PixelFormatEnum texture_format = texture_formats[i]; + SDL_PixelFormat texture_format = texture_formats[i]; if (!SDL_ISPIXELFORMAT_FOURCC(texture_format) && !SDL_ISPIXELFORMAT_10BIT(texture_format) && !SDL_ISPIXELFORMAT_FLOAT(texture_format) && @@ -2657,7 +2657,7 @@ int SDL_SetWindowIcon(SDL_Window *window, SDL_Surface *icon) SDL_DestroySurface(window->icon); /* Convert the icon into ARGB8888 */ - window->icon = SDL_ConvertSurfaceFormat(icon, SDL_PIXELFORMAT_ARGB8888); + window->icon = SDL_ConvertSurface(icon, SDL_PIXELFORMAT_ARGB8888); if (!window->icon) { return -1; } @@ -3292,7 +3292,7 @@ static SDL_bool ShouldAttemptTextureFramebuffer(void) static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) { - SDL_PixelFormatEnum format = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat format = SDL_PIXELFORMAT_UNKNOWN; void *pixels = NULL; int pitch = 0; SDL_bool created_framebuffer = SDL_FALSE; @@ -3343,7 +3343,7 @@ static SDL_Surface *SDL_CreateWindowFramebuffer(SDL_Window *window) return window->surface; } - return SDL_CreateSurfaceFrom(pixels, w, h, pitch, format); + return SDL_CreateSurfaceFrom(w, h, format, pixels, pitch); } SDL_bool SDL_WindowHasSurface(SDL_Window *window) @@ -3359,7 +3359,7 @@ SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) if (!window->surface_valid) { if (window->surface) { - window->surface->flags &= ~SDL_DONTFREE; + window->surface->internal->flags &= ~SDL_INTERNAL_SURFACE_DONTFREE; SDL_DestroySurface(window->surface); window->surface = NULL; } @@ -3367,7 +3367,7 @@ SDL_Surface *SDL_GetWindowSurface(SDL_Window *window) window->surface = SDL_CreateWindowFramebuffer(window); if (window->surface) { window->surface_valid = SDL_TRUE; - window->surface->flags |= SDL_DONTFREE; + window->surface->internal->flags |= SDL_INTERNAL_SURFACE_DONTFREE; } } return window->surface; @@ -3425,7 +3425,7 @@ int SDL_DestroyWindowSurface(SDL_Window *window) CHECK_WINDOW_MAGIC(window, -1); if (window->surface) { - window->surface->flags &= ~SDL_DONTFREE; + window->surface->internal->flags &= ~SDL_INTERNAL_SURFACE_DONTFREE; SDL_DestroySurface(window->surface); window->surface = NULL; window->surface_valid = SDL_FALSE; @@ -4949,7 +4949,7 @@ static void CreateMaskFromColorKeyOrAlpha(SDL_Surface *icon, Uint8 *mask, int fl mask[(y * ((icon->w + 7) / 8)) + (x / 8)] &= ~(0x01 << (7 - (x % 8))) colorkey = icon->format->colorkey; - switch (icon->format->bytes_per_pixel) { + switch (SDL_BYTESPERPIXEL(icon->format)) { case 1: { Uint8 *pixels; @@ -5370,7 +5370,7 @@ int SDL_SetWindowShape(SDL_Window *window, SDL_Surface *shape) return -1; } - surface = SDL_ConvertSurfaceFormat(shape, SDL_PIXELFORMAT_ARGB32); + surface = SDL_ConvertSurface(shape, SDL_PIXELFORMAT_ARGB32); if (!surface) { return -1; } diff --git a/src/video/SDL_yuv.c b/src/video/SDL_yuv.c index ca5c14e340f8e..818a661ff9c70 100644 --- a/src/video/SDL_yuv.c +++ b/src/video/SDL_yuv.c @@ -27,7 +27,7 @@ #if SDL_HAVE_YUV -static SDL_bool IsPlanar2x2Format(SDL_PixelFormatEnum format); +static SDL_bool IsPlanar2x2Format(SDL_PixelFormat format); #endif /* @@ -36,7 +36,7 @@ static SDL_bool IsPlanar2x2Format(SDL_PixelFormatEnum format); * * return 0 on success, -1 on error */ -int SDL_CalculateYUVSize(SDL_PixelFormatEnum format, int w, int h, size_t *size, size_t *pitch) +int SDL_CalculateYUVSize(SDL_PixelFormat format, int w, int h, size_t *size, size_t *pitch) { #if SDL_HAVE_YUV int sz_plane = 0, sz_plane_chroma = 0, sz_plane_packed = 0; @@ -187,7 +187,7 @@ static int GetYUVConversionType(SDL_Colorspace colorspace, YCbCrType *yuv_type) return SDL_SetError("Unsupported YUV colorspace"); } -static SDL_bool IsPlanar2x2Format(SDL_PixelFormatEnum format) +static SDL_bool IsPlanar2x2Format(SDL_PixelFormat format) { return format == SDL_PIXELFORMAT_YV12 || format == SDL_PIXELFORMAT_IYUV || format == SDL_PIXELFORMAT_NV12 || format == SDL_PIXELFORMAT_NV21 || format == SDL_PIXELFORMAT_P010; } @@ -197,7 +197,7 @@ static SDL_bool IsPacked4Format(Uint32 format) return format == SDL_PIXELFORMAT_YUY2 || format == SDL_PIXELFORMAT_UYVY || format == SDL_PIXELFORMAT_YVYU; } -static int GetYUVPlanes(int width, int height, SDL_PixelFormatEnum format, const void *yuv, int yuv_pitch, +static int GetYUVPlanes(int width, int height, SDL_PixelFormat format, const void *yuv, int yuv_pitch, const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride) { const Uint8 *planes[3] = { NULL, NULL, NULL }; @@ -304,7 +304,7 @@ static int GetYUVPlanes(int width, int height, SDL_PixelFormatEnum format, const #ifdef SDL_SSE2_INTRINSICS static SDL_bool SDL_TARGETING("sse2") yuv_rgb_sse( - SDL_PixelFormatEnum src_format, SDL_PixelFormatEnum dst_format, + SDL_PixelFormat src_format, SDL_PixelFormat dst_format, Uint32 width, Uint32 height, const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, Uint8 *rgb, Uint32 rgb_stride, @@ -411,7 +411,7 @@ static SDL_bool SDL_TARGETING("sse2") yuv_rgb_sse( } #else static SDL_bool yuv_rgb_sse( - SDL_PixelFormatEnum src_format, SDL_PixelFormatEnum dst_format, + SDL_PixelFormat src_format, SDL_PixelFormat dst_format, Uint32 width, Uint32 height, const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, Uint8 *rgb, Uint32 rgb_stride, @@ -423,7 +423,7 @@ static SDL_bool yuv_rgb_sse( #ifdef SDL_LSX_INTRINSICS static SDL_bool yuv_rgb_lsx( - SDL_PixelFormatEnum src_format, SDL_PixelFormatEnum dst_format, + SDL_PixelFormat src_format, SDL_PixelFormat dst_format, Uint32 width, Uint32 height, const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, Uint8 *rgb, Uint32 rgb_stride, @@ -463,7 +463,7 @@ static SDL_bool yuv_rgb_lsx( } #else static SDL_bool yuv_rgb_lsx( - SDL_PixelFormatEnum src_format, SDL_PixelFormatEnum dst_format, + SDL_PixelFormat src_format, SDL_PixelFormat dst_format, Uint32 width, Uint32 height, const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, Uint8 *rgb, Uint32 rgb_stride, @@ -474,7 +474,7 @@ static SDL_bool yuv_rgb_lsx( #endif static SDL_bool yuv_rgb_std( - SDL_PixelFormatEnum src_format, SDL_PixelFormatEnum dst_format, + SDL_PixelFormat src_format, SDL_PixelFormat dst_format, Uint32 width, Uint32 height, const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, Uint8 *rgb, Uint32 rgb_stride, @@ -587,8 +587,8 @@ static SDL_bool yuv_rgb_std( } int SDL_ConvertPixels_YUV_to_RGB(int width, int height, - SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) + SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, + SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) { const Uint8 *y = NULL; const Uint8 *u = NULL; @@ -709,7 +709,7 @@ static struct RGB2YUVFactors RGB2YUVFactorTables[] = { }, }; -static int SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch, YCbCrType yuv_type) +static int SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, YCbCrType yuv_type) { const int src_pitch_x_2 = src_pitch * 2; const int height_half = height / 2; @@ -1000,7 +1000,7 @@ static int SDL_ConvertPixels_ARGB8888_to_YUV(int width, int height, const void * return 0; } -static int SDL_ConvertPixels_XBGR2101010_to_P010(int width, int height, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch, YCbCrType yuv_type) +static int SDL_ConvertPixels_XBGR2101010_to_P010(int width, int height, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, YCbCrType yuv_type) { const int src_pitch_x_2 = src_pitch * 2; const int height_half = height / 2; @@ -1123,8 +1123,8 @@ static int SDL_ConvertPixels_XBGR2101010_to_P010(int width, int height, const vo } int SDL_ConvertPixels_RGB_to_YUV(int width, int height, - SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) + SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, + SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) { YCbCrType yuv_type = YCBCR_601_LIMITED; @@ -1210,7 +1210,7 @@ int SDL_ConvertPixels_RGB_to_YUV(int width, int height, } } -static int SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, SDL_PixelFormatEnum format, +static int SDL_ConvertPixels_YUV_to_YUV_Copy(int width, int height, SDL_PixelFormat format, const void *src, int src_pitch, void *dst, int dst_pitch) { int i; @@ -1677,8 +1677,8 @@ static int SDL_ConvertPixels_SwapNV(int width, int height, const void *src, int } static int SDL_ConvertPixels_Planar2x2_to_Planar2x2(int width, int height, - SDL_PixelFormatEnum src_format, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch) + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch) { if (src != dst) { /* Copy Y plane */ @@ -2235,8 +2235,8 @@ static int SDL_ConvertPixels_YVYU_to_UYVY(int width, int height, const void *src } static int SDL_ConvertPixels_Packed4_to_Packed4(int width, int height, - SDL_PixelFormatEnum src_format, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch) + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch) { switch (src_format) { case SDL_PIXELFORMAT_YUY2: @@ -2277,8 +2277,8 @@ static int SDL_ConvertPixels_Packed4_to_Packed4(int width, int height, } static int SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, - SDL_PixelFormatEnum src_format, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch) + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch) { int x, y; const Uint8 *srcY1, *srcY2, *srcU, *srcV; @@ -2419,8 +2419,8 @@ static int SDL_ConvertPixels_Planar2x2_to_Packed4(int width, int height, } static int SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, - SDL_PixelFormatEnum src_format, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, void *dst, int dst_pitch) + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch) { int x, y; const Uint8 *srcY1, *srcY2, *srcU1, *srcU2, *srcV1, *srcV2; @@ -2552,8 +2552,8 @@ static int SDL_ConvertPixels_Packed4_to_Planar2x2(int width, int height, #endif /* SDL_HAVE_YUV */ int SDL_ConvertPixels_YUV_to_YUV(int width, int height, - SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, - SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) + SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, + SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch) { #if SDL_HAVE_YUV if (src_colorspace != dst_colorspace) { diff --git a/src/video/SDL_yuv_c.h b/src/video/SDL_yuv_c.h index 1bdf7278b39e4..47dac3b2566c0 100644 --- a/src/video/SDL_yuv_c.h +++ b/src/video/SDL_yuv_c.h @@ -26,11 +26,11 @@ /* YUV conversion functions */ -extern int SDL_ConvertPixels_YUV_to_RGB(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); -extern int SDL_ConvertPixels_RGB_to_YUV(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); -extern int SDL_ConvertPixels_YUV_to_YUV(int width, int height, SDL_PixelFormatEnum src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormatEnum dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); +extern int SDL_ConvertPixels_YUV_to_RGB(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); +extern int SDL_ConvertPixels_RGB_to_YUV(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); +extern int SDL_ConvertPixels_YUV_to_YUV(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch); -extern int SDL_CalculateYUVSize(SDL_PixelFormatEnum format, int w, int h, size_t *size, size_t *pitch); +extern int SDL_CalculateYUVSize(SDL_PixelFormat format, int w, int h, size_t *size, size_t *pitch); #endif /* SDL_yuv_c_h_ */ diff --git a/src/video/android/SDL_androidmouse.c b/src/video/android/SDL_androidmouse.c index 2cc50e279a3d7..afee511d40374 100644 --- a/src/video/android/SDL_androidmouse.c +++ b/src/video/android/SDL_androidmouse.c @@ -84,7 +84,7 @@ static SDL_Cursor *Android_CreateCursor(SDL_Surface *surface, int hot_x, int hot int custom_cursor; SDL_Surface *converted; - converted = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ARGB8888); + converted = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ARGB8888); if (!converted) { return NULL; } diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index c9cb9043d25c9..0a8e1504fe88f 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -256,7 +256,7 @@ SDL_SystemTheme Cocoa_GetSystemTheme(void) int i; NSImage *img; - converted = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_RGBA32); + converted = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_RGBA32); if (!converted) { return nil; } @@ -270,7 +270,7 @@ SDL_SystemTheme Cocoa_GetSystemTheme(void) isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace bytesPerRow:converted->pitch - bitsPerPixel:converted->format->bits_per_pixel]; + bitsPerPixel:SDL_BITSPERPIXEL(converted->format)]; if (imgrep == nil) { SDL_DestroySurface(converted); return nil; diff --git a/src/video/dummy/SDL_nullframebuffer.c b/src/video/dummy/SDL_nullframebuffer.c index 79b29991acf78..862c36c7e3d83 100644 --- a/src/video/dummy/SDL_nullframebuffer.c +++ b/src/video/dummy/SDL_nullframebuffer.c @@ -29,10 +29,10 @@ #define DUMMY_SURFACE "SDL.internal.window.surface" -int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_Surface *surface; - const SDL_PixelFormatEnum surface_format = SDL_PIXELFORMAT_XRGB8888; + const SDL_PixelFormat surface_format = SDL_PIXELFORMAT_XRGB8888; int w, h; /* Create a new framebuffer */ diff --git a/src/video/dummy/SDL_nullframebuffer_c.h b/src/video/dummy/SDL_nullframebuffer_c.h index 78e4ebfa0ade9..01644418f4359 100644 --- a/src/video/dummy/SDL_nullframebuffer_c.h +++ b/src/video/dummy/SDL_nullframebuffer_c.h @@ -24,7 +24,7 @@ #include "SDL_internal.h" -extern int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int SDL_DUMMY_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void SDL_DUMMY_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index 377d6d536d46b..a7cae059def3f 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -27,10 +27,10 @@ #include -int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_Surface *surface; - const SDL_PixelFormatEnum surface_format = SDL_PIXELFORMAT_XBGR8888; + const SDL_PixelFormat surface_format = SDL_PIXELFORMAT_XBGR8888; int w, h; /* Free the old framebuffer surface */ diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.h b/src/video/emscripten/SDL_emscriptenframebuffer.h index 94c84b55cb78f..2e0df3d0d1e07 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.h +++ b/src/video/emscripten/SDL_emscriptenframebuffer.h @@ -23,7 +23,7 @@ #ifndef SDL_emscriptenframebuffer_h_ #define SDL_emscriptenframebuffer_h_ -extern int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/emscripten/SDL_emscriptenmouse.c b/src/video/emscripten/SDL_emscriptenmouse.c index 0593fc6368452..17a5952800cde 100644 --- a/src/video/emscripten/SDL_emscriptenmouse.c +++ b/src/video/emscripten/SDL_emscriptenmouse.c @@ -72,7 +72,7 @@ static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int const char *cursor_url = NULL; SDL_Surface *conv_surf; - conv_surf = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ABGR8888); + conv_surf = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ABGR8888); if (!conv_surf) { return NULL; diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc index ac90d5ab5f853..70bfff7dc1b7b 100644 --- a/src/video/haiku/SDL_bframebuffer.cc +++ b/src/video/haiku/SDL_bframebuffer.cc @@ -44,7 +44,7 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() { } int HAIKU_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, - SDL_PixelFormatEnum * format, + SDL_PixelFormat * format, void ** pixels, int *pitch) { SDL_BWin *bwin = _ToBeWin(window); BScreen bscreen; diff --git a/src/video/haiku/SDL_bframebuffer.h b/src/video/haiku/SDL_bframebuffer.h index 65ce6ce872a10..fcb6bcd811b15 100644 --- a/src/video/haiku/SDL_bframebuffer.h +++ b/src/video/haiku/SDL_bframebuffer.h @@ -31,7 +31,7 @@ extern "C" { #include "../SDL_sysvideo.h" extern int HAIKU_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, - SDL_PixelFormatEnum *format, + SDL_PixelFormat *format, void **pixels, int *pitch); extern int HAIKU_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc index 09e1e84dd015b..c44729e4d0083 100644 --- a/src/video/haiku/SDL_bmodes.cc +++ b/src/video/haiku/SDL_bmodes.cc @@ -132,7 +132,7 @@ void _SpoutModeData(display_mode *bmode) { -SDL_PixelFormatEnum HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace) +SDL_PixelFormat HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace) { switch (colorspace) { case B_CMAP8: diff --git a/src/video/haiku/SDL_bmodes.h b/src/video/haiku/SDL_bmodes.h index d8b4b493a9ce2..bb57a06a24e7d 100644 --- a/src/video/haiku/SDL_bmodes.h +++ b/src/video/haiku/SDL_bmodes.h @@ -28,7 +28,7 @@ extern "C" { #include "../SDL_sysvideo.h" -extern SDL_PixelFormatEnum HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace); +extern SDL_PixelFormat HAIKU_ColorSpaceToSDLPxFormat(uint32 colorspace); extern int HAIKU_InitModes(SDL_VideoDevice *_this); extern int HAIKU_QuitModes(SDL_VideoDevice *_this); diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc index f4ed4c8ba9207..cbbd554bea1ae 100644 --- a/src/video/haiku/SDL_bvideo.cc +++ b/src/video/haiku/SDL_bvideo.cc @@ -179,7 +179,7 @@ static SDL_Cursor * HAIKU_CreateCursor(SDL_Surface * surface, int hot_x, int hot SDL_Cursor *cursor; SDL_Surface *converted; - converted = SDL_ConvertSurfaceFormat(surface, SDL_PIXELFORMAT_ARGB8888); + converted = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ARGB8888); if (!converted) { return NULL; } diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index 516d5148fe080..7b1416a6fa59c 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -266,7 +266,7 @@ static SDL_Cursor *KMSDRM_CreateCursor(SDL_Surface *surface, int hot_x, int hot_ alpha-premultiplied, but the SDL surface we receive has straight-alpha pixels, so we always have to convert. */ SDL_PremultiplyAlpha(surface->w, surface->h, - surface->format->format, surface->pixels, surface->pitch, + surface->format, surface->pixels, surface->pitch, SDL_PIXELFORMAT_ARGB8888, curdata->buffer, surface->w * 4); cursor->driverdata = curdata; diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index 02408e9de582b..37b3a79b49fac 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -42,7 +42,7 @@ static int GetSourceOffset(int x, int y, int source_width); static void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen); -int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_Surface *framebuffer; const SDL_DisplayMode *mode; @@ -82,10 +82,10 @@ int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, framebuffer = gfxGetFramebuffer(drv_data->screen, GFX_LEFT, &width, &height); bufsize = width * height * 4; - if (surface->format->bytes_per_pixel == 2) + if (SDL_BYTESPERPIXEL(surface->format) == 2) CopyFramebuffertoN3DS_16(framebuffer, (Dimensions){ width, height }, surface->pixels, (Dimensions){ surface->w, surface->h }); - else if (surface->format->bytes_per_pixel == 3) + else if (SDL_BYTESPERPIXEL(surface->format) == 3) CopyFramebuffertoN3DS_24(framebuffer, (Dimensions){ width, height }, surface->pixels, (Dimensions){ surface->w, surface->h }); else diff --git a/src/video/n3ds/SDL_n3dsframebuffer_c.h b/src/video/n3ds/SDL_n3dsframebuffer_c.h index f316f92c1d4d0..c471b2d9d6178 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer_c.h +++ b/src/video/n3ds/SDL_n3dsframebuffer_c.h @@ -24,7 +24,7 @@ #include "SDL_internal.h" -int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); void SDL_N3DS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index 69ff218638984..b9e34eb3889b5 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -53,7 +53,7 @@ struct SDL_DisplayModeData static const struct { - SDL_PixelFormatEnum pixfmt; + SDL_PixelFormat pixfmt; GSPGPU_FramebufferFormat gspfmt; } format_map[] = { { SDL_PIXELFORMAT_RGBA8888, GSP_RGBA8_OES }, diff --git a/src/video/ngage/SDL_ngageframebuffer.cpp b/src/video/ngage/SDL_ngageframebuffer.cpp index 143ad50d2a5bf..df42a831763f5 100644 --- a/src/video/ngage/SDL_ngageframebuffer.cpp +++ b/src/video/ngage/SDL_ngageframebuffer.cpp @@ -44,11 +44,11 @@ void DrawBackground(SDL_VideoDevice *_this); void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 *screenBuffer); void RedrawWindowL(SDL_VideoDevice *_this); -int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_VideoData *phdata = _this->driverdata; SDL_Surface *surface; - const SDL_PixelFormatEnum surface_format = SDL_PIXELFORMAT_XRGB4444; + const SDL_PixelFormat surface_format = SDL_PIXELFORMAT_XRGB4444; int w, h; /* Free the old framebuffer surface */ diff --git a/src/video/ngage/SDL_ngageframebuffer_c.h b/src/video/ngage/SDL_ngageframebuffer_c.h index e7fed1327144a..6358ff9bf3f27 100644 --- a/src/video/ngage/SDL_ngageframebuffer_c.h +++ b/src/video/ngage/SDL_ngageframebuffer_c.h @@ -21,7 +21,7 @@ #include "SDL_internal.h" -extern int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int SDL_NGAGE_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void SDL_NGAGE_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/offscreen/SDL_offscreenframebuffer.c b/src/video/offscreen/SDL_offscreenframebuffer.c index 5c17c5c7399b2..89d7e83d7478a 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer.c +++ b/src/video/offscreen/SDL_offscreenframebuffer.c @@ -29,10 +29,10 @@ #define OFFSCREEN_SURFACE "SDL.internal.window.surface" -int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_Surface *surface; - const SDL_PixelFormatEnum surface_format = SDL_PIXELFORMAT_XRGB8888; + const SDL_PixelFormat surface_format = SDL_PIXELFORMAT_XRGB8888; int w, h; /* Create a new framebuffer */ diff --git a/src/video/offscreen/SDL_offscreenframebuffer_c.h b/src/video/offscreen/SDL_offscreenframebuffer_c.h index bccd3649eb7b3..a45f9afe467e0 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer_c.h +++ b/src/video/offscreen/SDL_offscreenframebuffer_c.h @@ -20,6 +20,6 @@ */ #include "SDL_internal.h" -extern int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int SDL_OFFSCREEN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void SDL_OFFSCREEN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/qnx/SDL_qnxvideo.c b/src/video/qnx/SDL_qnxvideo.c index 6a646832b5362..5d6c5efd20a1d 100644 --- a/src/video/qnx/SDL_qnxvideo.c +++ b/src/video/qnx/SDL_qnxvideo.c @@ -152,7 +152,7 @@ static int createWindow(SDL_VideoDevice *_this, SDL_Window *window) * @param[out] pitch Holds the number of bytes per line * @return 0 if successful, -1 on error */ -static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, SDL_PixelFormatEnum * format, +static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, SDL_PixelFormat * format, void ** pixels, int *pitch) { window_impl_t *impl = (window_impl_t *)window->driverdata; diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index aa16a5d36b88f..fd790b86b098f 100644 --- a/src/video/raspberry/SDL_rpimouse.c +++ b/src/video/raspberry/SDL_rpimouse.c @@ -61,7 +61,7 @@ static SDL_Cursor *RPI_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) VC_RECT_T dst_rect; Uint32 dummy; - SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(surface->format == SDL_PIXELFORMAT_ARGB8888); SDL_assert(surface->pitch == surface->w * 4); cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); diff --git a/src/video/riscos/SDL_riscosframebuffer.c b/src/video/riscos/SDL_riscosframebuffer.c index 0bc0ea9095ffc..bef7443bc211e 100644 --- a/src/video/riscos/SDL_riscosframebuffer.c +++ b/src/video/riscos/SDL_riscosframebuffer.c @@ -30,7 +30,7 @@ #include #include -int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_WindowData *driverdata = window->driverdata; const char *sprite_name = "display"; diff --git a/src/video/riscos/SDL_riscosframebuffer_c.h b/src/video/riscos/SDL_riscosframebuffer_c.h index b556a72be8e15..20b9dad59520e 100644 --- a/src/video/riscos/SDL_riscosframebuffer_c.h +++ b/src/video/riscos/SDL_riscosframebuffer_c.h @@ -24,7 +24,7 @@ #include "SDL_internal.h" -extern int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int RISCOS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void RISCOS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index 8640163f94a1c..066dfebe067bd 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -45,7 +45,7 @@ enum static const struct { - SDL_PixelFormatEnum pixel_format; + SDL_PixelFormat pixel_format; int modeflags, ncolour, log2bpp; } mode_to_pixelformat[] = { /* { SDL_PIXELFORMAT_INDEX1LSB, 0, 1, 0 }, */ @@ -70,7 +70,7 @@ static const struct { SDL_PIXELFORMAT_ARGB8888, MODE_FLAG_ARGB, -1, 5 } }; -static SDL_PixelFormatEnum RISCOS_ModeToPixelFormat(int ncolour, int modeflags, int log2bpp) +static SDL_PixelFormat RISCOS_ModeToPixelFormat(int ncolour, int modeflags, int log2bpp) { int i; diff --git a/src/video/vita/SDL_vitaframebuffer.c b/src/video/vita/SDL_vitaframebuffer.c index 5a696d0023fe5..872ede91d2624 100644 --- a/src/video/vita/SDL_vitaframebuffer.c +++ b/src/video/vita/SDL_vitaframebuffer.c @@ -63,7 +63,7 @@ void vita_gpu_free(SceUID uid) sceKernelFreeMemBlock(uid); } -int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_WindowData *data = window->driverdata; SceDisplayFrameBuf framebuf; diff --git a/src/video/vita/SDL_vitaframebuffer.h b/src/video/vita/SDL_vitaframebuffer.h index 9ccdec76964b0..29c10970f0152 100644 --- a/src/video/vita/SDL_vitaframebuffer.h +++ b/src/video/vita/SDL_vitaframebuffer.h @@ -20,6 +20,6 @@ */ #include "SDL_internal.h" -extern int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int VITA_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void VITA_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index f14cd703abb18..bdbb95e156eb9 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -440,7 +440,7 @@ static SDL_Cursor *Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot /* Wayland requires premultiplied alpha for its surfaces. */ SDL_PremultiplyAlpha(surface->w, surface->h, - surface->format->format, surface->pixels, surface->pitch, + surface->format, surface->pixels, surface->pitch, SDL_PIXELFORMAT_ARGB8888, data->cursor_data.custom.shm_data, surface->w * 4); data->surface = wl_compositor_create_surface(wd->compositor); diff --git a/src/video/windows/SDL_windowsframebuffer.c b/src/video/windows/SDL_windowsframebuffer.c index e1ef467eaf232..eb0b06e0f56a2 100644 --- a/src/video/windows/SDL_windowsframebuffer.c +++ b/src/video/windows/SDL_windowsframebuffer.c @@ -24,7 +24,7 @@ #include "SDL_windowsvideo.h" -int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch) +int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_WindowData *data = window->driverdata; SDL_bool isstack; @@ -66,7 +66,7 @@ int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_ bpp = info->bmiHeader.biPlanes * info->bmiHeader.biBitCount; masks = (Uint32 *)((Uint8 *)info + info->bmiHeader.biSize); - *format = SDL_GetPixelFormatEnumForMasks(bpp, masks[0], masks[1], masks[2], 0); + *format = SDL_GetPixelFormatForMasks(bpp, masks[0], masks[1], masks[2], 0); } if (*format == SDL_PIXELFORMAT_UNKNOWN) { /* We'll use RGB format for now */ diff --git a/src/video/windows/SDL_windowsframebuffer.h b/src/video/windows/SDL_windowsframebuffer.h index 092ac8f497f89..e4ab869c6919f 100644 --- a/src/video/windows/SDL_windowsframebuffer.h +++ b/src/video/windows/SDL_windowsframebuffer.h @@ -20,6 +20,6 @@ */ #include "SDL_internal.h" -extern int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, void **pixels, int *pitch); +extern int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch); extern int WIN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); extern void WIN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window); diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 42a5e9923618a..1f46ffb29e482 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -49,7 +49,7 @@ static SDL_bool IsMonochromeSurface(SDL_Surface *surface) int x, y; Uint8 r, g, b, a; - SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(surface->format == SDL_PIXELFORMAT_ARGB8888); for (y = 0; y < surface->h; y++) { for (x = 0; x < surface->w; x++) { @@ -76,7 +76,7 @@ static HBITMAP CreateColorBitmap(SDL_Surface *surface) BITMAPINFO bi; void *pixels; - SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(surface->format == SDL_PIXELFORMAT_ARGB8888); SDL_zero(bi); bi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); @@ -114,7 +114,7 @@ static HBITMAP CreateMaskBitmap(SDL_Surface *surface, SDL_bool is_monochrome) const int size = pitch * surface->h; static const unsigned char masks[] = { 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1 }; - SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(surface->format == SDL_PIXELFORMAT_ARGB8888); pixels = SDL_small_alloc(Uint8, size * (is_monochrome ? 2 : 1), &isstack); if (!pixels) { diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 014a9207ca92b..80901b70cc23a 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -851,7 +851,7 @@ int WIN_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *i bmi->biClrImportant = SDL_Swap32LE(0); /* Write the pixels upside down into the bitmap buffer */ - SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(icon->format == SDL_PIXELFORMAT_ARGB8888); dst = &icon_bmp[sizeof(BITMAPINFOHEADER)]; row_len = icon->w * sizeof(Uint32); y = icon->h; diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index a2d5731845178..6719778732994 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -246,7 +246,7 @@ int WINRT_VideoInit(SDL_VideoDevice *_this) return 0; } -extern "C" SDL_PixelFormatEnum D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat); +extern "C" SDL_PixelFormat D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat); static void WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC *dxgiMode, SDL_DisplayMode *sdlMode) { diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index 58dd86a388a6c..14b870efae771 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -47,7 +47,7 @@ static SDL_bool have_mitshm(Display *dpy) #endif /* !NO_SHARED_MEMORY */ -int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormatEnum *format, +int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_WindowData *data = window->driverdata; diff --git a/src/video/x11/SDL_x11framebuffer.h b/src/video/x11/SDL_x11framebuffer.h index b749495a8bbe3..a96fb223c32bb 100644 --- a/src/video/x11/SDL_x11framebuffer.h +++ b/src/video/x11/SDL_x11framebuffer.h @@ -25,7 +25,7 @@ #include "SDL_internal.h" extern int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, - SDL_PixelFormatEnum *format, + SDL_PixelFormat *format, void **pixels, int *pitch); extern int X11_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects); diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index aabcd34f6cc74..850ba2b0acbfc 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -308,7 +308,7 @@ int X11_GetVisualInfoFromVisual(Display *display, Visual *visual, XVisualInfo *v return -1; } -SDL_PixelFormatEnum X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo) +SDL_PixelFormat X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo) { if (vinfo->class == DirectColor || vinfo->class == TrueColor) { int bpp; @@ -338,7 +338,7 @@ SDL_PixelFormatEnum X11_GetPixelFormatFromVisualInfo(Display *display, XVisualIn } } - return SDL_GetPixelFormatEnumForMasks(bpp, Rmask, Gmask, Bmask, Amask); + return SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask); } if (vinfo->class == PseudoColor || vinfo->class == StaticColor) { diff --git a/src/video/x11/SDL_x11modes.h b/src/video/x11/SDL_x11modes.h index 53e49e8bc059f..113db3957c3e6 100644 --- a/src/video/x11/SDL_x11modes.h +++ b/src/video/x11/SDL_x11modes.h @@ -57,7 +57,7 @@ extern void X11_QuitModes(SDL_VideoDevice *_this); /* Some utility functions for working with visuals */ extern int X11_GetVisualInfoFromVisual(Display *display, Visual *visual, XVisualInfo *vinfo); -extern SDL_PixelFormatEnum X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo); +extern SDL_PixelFormat X11_GetPixelFormatFromVisualInfo(Display *display, XVisualInfo *vinfo); extern int X11_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); extern int X11_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect); diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index f8654c6db03e8..c47eea216ba9d 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -94,7 +94,7 @@ static Cursor X11_CreateXCursorCursor(SDL_Surface *surface, int hot_x, int hot_y image->yhot = hot_y; image->delay = 0; - SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(surface->format == SDL_PIXELFORMAT_ARGB8888); SDL_assert(surface->pitch == surface->w * 4); SDL_memcpy(image->pixels, surface->pixels, (size_t)surface->h * surface->pitch); @@ -130,7 +130,7 @@ static Cursor X11_CreatePixmapCursor(SDL_Surface *surface, int hot_x, int hot_y) } /* Code below assumes ARGB pixel format */ - SDL_assert(surface->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(surface->format == SDL_PIXELFORMAT_ARGB8888); rfg = gfg = bfg = rbg = gbg = bbg = fgBits = bgBits = 0; for (y = 0; y < surface->h; ++y) { diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 85818db8d01b0..9aa47aa5517e9 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -967,7 +967,7 @@ int X11_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *i long *dst; /* Set the _NET_WM_ICON property */ - SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888); + SDL_assert(icon->format == SDL_PIXELFORMAT_ARGB8888); propsize = 2 + (icon->w * icon->h); propdata = SDL_malloc(propsize * sizeof(long)); diff --git a/test/testautomation_blit.c b/test/testautomation_blit.c index d2e7e23d84841..2eec3b19c4c6a 100644 --- a/test/testautomation_blit.c +++ b/test/testautomation_blit.c @@ -58,14 +58,14 @@ Uint32 *getNextRandomBuffer(const int width, const int height) { /* * Generates a small 15 x 15px surface of PRNG pixel data */ -SDL_Surface* getRandomBlitChunk(Uint32 *pixels, SDL_PixelFormatEnum format) { - return SDL_CreateSurfaceFrom(pixels, 15, 15, 15 * 4, format); +SDL_Surface* getRandomBlitChunk(Uint32 *pixels, SDL_PixelFormat format) { + return SDL_CreateSurfaceFrom(15, 15, format, pixels, 15 * 4); } /* * Generates a 800 x 600 surface of PRNG pixel data */ -SDL_Surface* getRandomSVGASurface(Uint32 *pixels, SDL_PixelFormatEnum format) { - return SDL_CreateSurfaceFrom(pixels, 800, 600, 800 * 4, format); +SDL_Surface* getRandomSVGASurface(Uint32 *pixels, SDL_PixelFormat format) { + return SDL_CreateSurfaceFrom(800, 600, format, pixels, 800 * 4); } /* * Calculates the FNV-1a hash of input pixel data @@ -205,4 +205,4 @@ SDLTest_TestSuiteReference blitTestSuite = { blitSetUp, blitTests, NULL -}; \ No newline at end of file +}; diff --git a/test/testautomation_images.c b/test/testautomation_images.c index 9c19ce021449b..0ff7d21edd58d 100644 --- a/test/testautomation_images.c +++ b/test/testautomation_images.c @@ -533,10 +533,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlit = { SDL_Surface *SDLTest_ImageBlit(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlit.pixel_data, SDLTest_imageBlit.width, SDLTest_imageBlit.height, - SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlit.pixel_data, + SDLTest_imageBlit.width * SDLTest_imageBlit.bytes_per_pixel); return surface; } @@ -1005,10 +1006,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitColor = { SDL_Surface *SDLTest_ImageBlitColor(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitColor.pixel_data, SDLTest_imageBlitColor.width, SDLTest_imageBlitColor.height, - SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitColor.pixel_data, + SDLTest_imageBlitColor.width * SDLTest_imageBlitColor.bytes_per_pixel); return surface; } @@ -1640,10 +1642,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = { SDL_Surface *SDLTest_ImageBlitAlpha(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitAlpha.pixel_data, SDLTest_imageBlitAlpha.width, SDLTest_imageBlitAlpha.height, - SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitAlpha.pixel_data, + SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel); return surface; } @@ -2208,10 +2211,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { SDL_Surface *SDLTest_ImageBlitBlendAdd(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitBlendAdd.pixel_data, SDLTest_imageBlitBlendAdd.width, SDLTest_imageBlitBlendAdd.height, - SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlendAdd.pixel_data, + SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel); return surface; } @@ -2797,10 +2801,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { SDL_Surface *SDLTest_ImageBlitBlend(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitBlend.pixel_data, SDLTest_imageBlitBlend.width, SDLTest_imageBlitBlend.height, - SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlend.pixel_data, + SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel); return surface; } @@ -3216,10 +3221,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = { SDL_Surface *SDLTest_ImageBlitBlendMod(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitBlendMod.pixel_data, SDLTest_imageBlitBlendMod.width, SDLTest_imageBlitBlendMod.height, - SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlendMod.pixel_data, + SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel); return surface; } @@ -4018,10 +4024,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = { SDL_Surface *SDLTest_ImageBlitBlendNone(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitBlendNone.pixel_data, SDLTest_imageBlitBlendNone.width, SDLTest_imageBlitBlendNone.height, - SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlendNone.pixel_data, + SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel); return surface; } @@ -4552,10 +4559,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = { SDL_Surface *SDLTest_ImageBlitBlendAll(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageBlitBlendAll.pixel_data, SDLTest_imageBlitBlendAll.width, SDLTest_imageBlitBlendAll.height, - SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlendAll.pixel_data, + SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel); return surface; } @@ -4763,11 +4771,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageFace = { SDL_Surface *SDLTest_ImageFace(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageFace.pixel_data, SDLTest_imageFace.width, SDLTest_imageFace.height, - SDLTest_imageFace.width * SDLTest_imageFace.bytes_per_pixel, - SDL_PIXELFORMAT_RGBA32); + SDL_PIXELFORMAT_RGBA32, + (void *)SDLTest_imageFace.pixel_data, + SDLTest_imageFace.width * SDLTest_imageFace.bytes_per_pixel); return surface; } @@ -5256,10 +5264,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitives = { SDL_Surface *SDLTest_ImagePrimitives(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imagePrimitives.pixel_data, SDLTest_imagePrimitives.width, SDLTest_imagePrimitives.height, - SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imagePrimitives.pixel_data, + SDLTest_imagePrimitives.width * SDLTest_imagePrimitives.bytes_per_pixel); return surface; } @@ -5921,10 +5930,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = { SDL_Surface *SDLTest_ImagePrimitivesBlend(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imagePrimitivesBlend.pixel_data, SDLTest_imagePrimitivesBlend.width, SDLTest_imagePrimitivesBlend.height, - SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel, SDL_PIXELFORMAT_RGB24); + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imagePrimitivesBlend.pixel_data, + SDLTest_imagePrimitivesBlend.width * SDLTest_imagePrimitivesBlend.bytes_per_pixel); return surface; } @@ -6094,11 +6104,11 @@ static const SDLTest_SurfaceImage_t SDLTest_imageRainbowBackground = { SDL_Surface *SDLTest_ImageBlendingBackground(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageRainbowBackground.pixel_data, SDLTest_imageRainbowBackground.width, SDLTest_imageRainbowBackground.height, - SDLTest_imageRainbowBackground.width * SDLTest_imageRainbowBackground.bytes_per_pixel, - SDL_PIXELFORMAT_ARGB8888); + SDL_PIXELFORMAT_ARGB8888, + (void *)SDLTest_imageRainbowBackground.pixel_data, + SDLTest_imageRainbowBackground.width * SDLTest_imageRainbowBackground.bytes_per_pixel); return surface; } @@ -6268,10 +6278,10 @@ static const SDLTest_SurfaceImage_t SDLTest_imageTransparentSprite = { SDL_Surface *SDLTest_ImageBlendingSprite(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - (void *)SDLTest_imageTransparentSprite.pixel_data, SDLTest_imageTransparentSprite.width, SDLTest_imageTransparentSprite.height, - SDLTest_imageTransparentSprite.width * SDLTest_imageTransparentSprite.bytes_per_pixel, - SDL_PIXELFORMAT_ARGB8888); + SDL_PIXELFORMAT_ARGB8888, + (void *)SDLTest_imageTransparentSprite.pixel_data, + SDLTest_imageTransparentSprite.width * SDLTest_imageTransparentSprite.bytes_per_pixel); return surface; } diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c index 6814b66fcc975..6819451fc90e8 100644 --- a/test/testautomation_pixels.c +++ b/test/testautomation_pixels.c @@ -8,7 +8,7 @@ /* Test case functions */ /* Definition of all RGB formats used to test pixel conversions */ -static const SDL_PixelFormatEnum g_AllFormats[] = { +static const SDL_PixelFormat g_AllFormats[] = { SDL_PIXELFORMAT_INDEX1LSB, SDL_PIXELFORMAT_INDEX1MSB, SDL_PIXELFORMAT_INDEX2LSB, @@ -115,28 +115,25 @@ static const char *g_invalidPixelFormatsVerbose[] = { /* Test case functions */ /** - * Call to SDL_CreatePixelFormat and SDL_DestroyPixelFormat - * - * \sa SDL_CreatePixelFormat - * \sa SDL_DestroyPixelFormat + * Call to SDL_GetPixelFormatDetails */ -static int pixels_allocFreeFormat(void *arg) +static int pixels_getPixelFormatDetails(void *arg) { const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; const char *expectedError = "Unknown pixel format"; const char *error; int i; - SDL_PixelFormatEnum format; + SDL_PixelFormat format; Uint32 masks; - SDL_PixelFormat *result; + const SDL_PixelFormatDetails *result; /* Blank/unknown format */ format = SDL_PIXELFORMAT_UNKNOWN; SDLTest_Log("Pixel Format: %s (%d)", unknownFormat, format); /* Allocate format */ - result = SDL_CreatePixelFormat(format); - SDLTest_AssertPass("Call to SDL_CreatePixelFormat()"); + result = SDL_GetPixelFormatDetails(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatDetails()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %d, got %d", format, result->format); @@ -150,7 +147,6 @@ static int pixels_allocFreeFormat(void *arg) SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %" SDL_PRIu32, masks); /* Deallocate again */ - SDL_DestroyPixelFormat(result); SDLTest_AssertPass("Call to SDL_DestroyPixelFormat()"); } @@ -160,8 +156,8 @@ static int pixels_allocFreeFormat(void *arg) SDLTest_Log("Pixel Format: %s (%d)", g_AllFormatsVerbose[i], format); /* Allocate format */ - result = SDL_CreatePixelFormat(format); - SDLTest_AssertPass("Call to SDL_CreatePixelFormat()"); + result = SDL_GetPixelFormatDetails(format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatDetails()"); SDLTest_AssertCheck(result != NULL, "Verify result is not NULL"); if (result != NULL) { SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %d, got %d", format, result->format); @@ -175,12 +171,13 @@ static int pixels_allocFreeFormat(void *arg) if (!SDL_ISPIXELFORMAT_INDEXED(format)) { masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; SDLTest_AssertCheck(masks > 0, "Verify value of result.[RGBA]mask combined; expected: >0, got %" SDL_PRIu32, masks); + if (SDL_ISPIXELFORMAT_10BIT(format)) { + SDLTest_AssertCheck(result->Rbits == 10 && result->Gbits == 10 && result->Bbits == 10, "Verify value of result.[RGB]bits; expected: 10, got %d/%d/%d", result->Rbits, result->Gbits, result->Bbits); + } else if (SDL_BITSPERPIXEL(format) == 32) { + SDLTest_AssertCheck(result->Rbits == 8 && result->Gbits == 8 && result->Bbits == 8, "Verify value of result.[RGB]bits; expected: 8, got %d/%d/%d", result->Rbits, result->Gbits, result->Bbits); + } } } - - /* Deallocate again */ - SDL_DestroyPixelFormat(result); - SDLTest_AssertPass("Call to SDL_DestroyPixelFormat()"); } } @@ -191,7 +188,7 @@ static int pixels_allocFreeFormat(void *arg) SDL_ClearError(); SDLTest_AssertPass("Call to SDL_ClearError()"); format = g_invalidPixelFormats[i]; - result = SDL_CreatePixelFormat(format); + result = SDL_GetPixelFormatDetails(format); SDLTest_AssertPass("Call to SDL_CreatePixelFormat(%d)", format); SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); error = SDL_GetError(); @@ -203,15 +200,6 @@ static int pixels_allocFreeFormat(void *arg) } } - /* Invalid free pointer */ - SDL_ClearError(); - SDLTest_AssertPass("Call to SDL_ClearError()"); - SDL_DestroyPixelFormat(NULL); - SDLTest_AssertPass("Call to SDL_DestroyPixelFormat(NULL)"); - error = SDL_GetError(); - SDLTest_AssertPass("Call to SDL_GetError()"); - SDLTest_AssertCheck(error == NULL || error[0] == '\0', "Validate that error message is empty"); - return TEST_COMPLETED; } @@ -225,7 +213,7 @@ static int pixels_getPixelFormatName(void *arg) const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN"; const char *error; int i; - SDL_PixelFormatEnum format; + SDL_PixelFormat format; const char *result; /* Blank/undefined format */ @@ -371,7 +359,7 @@ static int pixels_allocFreePalette(void *arg) /* Pixels test cases */ static const SDLTest_TestCaseReference pixelsTest1 = { - (SDLTest_TestCaseFp)pixels_allocFreeFormat, "pixels_allocFreeFormat", "Call to SDL_CreatePixelFormat and SDL_DestroyPixelFormat", TEST_ENABLED + (SDLTest_TestCaseFp)pixels_getPixelFormatDetails, "pixels_allocFreeFormat", "Call to SDL_CreatePixelFormat and SDL_DestroyPixelFormat", TEST_ENABLED }; static const SDLTest_TestCaseReference pixelsTest2 = { diff --git a/test/testautomation_render.c b/test/testautomation_render.c index ddbb30913ede9..4afff21c52b0d 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -1335,10 +1335,10 @@ compare(SDL_Surface *referenceSurface, int allowable_error) return; } - testSurface = SDL_ConvertSurfaceFormat(surface, RENDER_COMPARE_FORMAT); + testSurface = SDL_ConvertSurface(surface, RENDER_COMPARE_FORMAT); SDL_DestroySurface(surface); if (!testSurface) { - SDLTest_AssertCheck(testSurface != NULL, "Validate result from SDL_ConvertSurfaceFormat, got NULL, %s", SDL_GetError()); + SDLTest_AssertCheck(testSurface != NULL, "Validate result from SDL_ConvertSurface, got NULL, %s", SDL_GetError()); return; } diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 98c9293c40279..b5def09c1ff87 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -77,8 +77,8 @@ static void clearTestSurface(void) Uint32 color; /* Clear surface. */ - color = SDL_MapRGBA(testSurface->format, 0, 0, 0, 0); - SDLTest_AssertPass("Call to SDL_MapRGBA()"); + color = SDL_MapSurfaceRGBA(testSurface, 0, 0, 0, 0); + SDLTest_AssertPass("Call to SDL_MapSurfaceRGBA()"); ret = SDL_FillSurfaceRect(testSurface, NULL, color); SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillSurfaceRect, expected: 0, got: %i", ret); @@ -280,8 +280,8 @@ static int surface_testSurfaceConversion(void *arg) } /* Set transparent pixel as the pixel at (0,0) */ - if (face->format->palette) { - ret = SDL_SetSurfaceColorKey(face, SDL_RLEACCEL, *(Uint8 *)face->pixels); + if (SDL_GetSurfacePalette(face)) { + ret = SDL_SetSurfaceColorKey(face, SDL_TRUE, *(Uint8 *)face->pixels); SDLTest_AssertPass("Call to SDL_SetSurfaceColorKey()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorKey, expected: 0, got: %i", ret); } @@ -344,7 +344,7 @@ static int surface_testCompleteSurfaceConversion(void *arg) #endif }; SDL_Surface *face = NULL, *cvt1, *cvt2, *final; - SDL_PixelFormat *fmt1, *fmt2; + const SDL_PixelFormatDetails *fmt1, *fmt2; int i, j, ret = 0; /* Create sample surface */ @@ -355,33 +355,33 @@ static int surface_testCompleteSurfaceConversion(void *arg) } /* Set transparent pixel as the pixel at (0,0) */ - if (face->format->palette) { - ret = SDL_SetSurfaceColorKey(face, SDL_RLEACCEL, *(Uint8 *)face->pixels); + if (SDL_GetSurfacePalette(face)) { + ret = SDL_SetSurfaceColorKey(face, SDL_TRUE, *(Uint8 *)face->pixels); SDLTest_AssertPass("Call to SDL_SetSurfaceColorKey()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorKey, expected: 0, got: %i", ret); } for (i = 0; i < SDL_arraysize(pixel_formats); ++i) { for (j = 0; j < SDL_arraysize(pixel_formats); ++j) { - fmt1 = SDL_CreatePixelFormat(pixel_formats[i]); - SDLTest_AssertCheck(fmt1 != NULL, "SDL_CreatePixelFormat(%s[0x%08" SDL_PRIx32 "]) should return a non-null pixel format", + fmt1 = SDL_GetPixelFormatDetails(pixel_formats[i]); + SDLTest_AssertCheck(fmt1 != NULL, "SDL_GetPixelFormatDetails(%s[0x%08" SDL_PRIx32 "]) should return a non-null pixel format", SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]); - cvt1 = SDL_ConvertSurface(face, fmt1); + cvt1 = SDL_ConvertSurface(face, fmt1->format); SDLTest_AssertCheck(cvt1 != NULL, "SDL_ConvertSurface(..., %s[0x%08" SDL_PRIx32 "]) should return a non-null surface", SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]); - fmt2 = SDL_CreatePixelFormat(pixel_formats[j]); - SDLTest_AssertCheck(fmt2 != NULL, "SDL_CreatePixelFormat(%s[0x%08" SDL_PRIx32 "]) should return a non-null pixel format", + fmt2 = SDL_GetPixelFormatDetails(pixel_formats[j]); + SDLTest_AssertCheck(fmt2 != NULL, "SDL_GetPixelFormatDetails(%s[0x%08" SDL_PRIx32 "]) should return a non-null pixel format", SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]); - cvt2 = SDL_ConvertSurface(cvt1, fmt2); + cvt2 = SDL_ConvertSurface(cvt1, fmt2->format); SDLTest_AssertCheck(cvt2 != NULL, "SDL_ConvertSurface(..., %s[0x%08" SDL_PRIx32 "]) should return a non-null surface", SDL_GetPixelFormatName(pixel_formats[i]), pixel_formats[i]); if (fmt1 && fmt2 && - fmt1->bytes_per_pixel == face->format->bytes_per_pixel && - fmt2->bytes_per_pixel == face->format->bytes_per_pixel && - (fmt1->Amask != 0) == (face->format->Amask != 0) && - (fmt2->Amask != 0) == (face->format->Amask != 0)) { + fmt1->bytes_per_pixel == SDL_BYTESPERPIXEL(face->format) && + fmt2->bytes_per_pixel == SDL_BYTESPERPIXEL(face->format) && + SDL_ISPIXELFORMAT_ALPHA(fmt1->format) == SDL_ISPIXELFORMAT_ALPHA(face->format) && + SDL_ISPIXELFORMAT_ALPHA(fmt2->format) == SDL_ISPIXELFORMAT_ALPHA(face->format)) { final = SDL_ConvertSurface(cvt2, face->format); SDL_assert(final != NULL); @@ -392,9 +392,7 @@ static int surface_testCompleteSurfaceConversion(void *arg) } SDL_DestroySurface(cvt1); - SDL_DestroyPixelFormat(fmt1); SDL_DestroySurface(cvt2); - SDL_DestroyPixelFormat(fmt2); } } @@ -605,11 +603,11 @@ static int surface_testOverflow(void *arg) SDLTest_AssertCheck(surface == NULL, "Should detect negative width"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, -1, 1, 4, SDL_PIXELFORMAT_INDEX8); + surface = SDL_CreateSurfaceFrom(-1, 1, SDL_PIXELFORMAT_INDEX8, buf, 4); SDLTest_AssertCheck(surface == NULL, "Should detect negative width"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, -1, 1, 4, SDL_PIXELFORMAT_RGBA8888); + surface = SDL_CreateSurfaceFrom(-1, 1, SDL_PIXELFORMAT_RGBA8888, buf, 4); SDLTest_AssertCheck(surface == NULL, "Should detect negative width"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); @@ -619,29 +617,29 @@ static int surface_testOverflow(void *arg) SDLTest_AssertCheck(surface == NULL, "Should detect negative height"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 1, -1, 4, SDL_PIXELFORMAT_INDEX8); + surface = SDL_CreateSurfaceFrom(1, -1, SDL_PIXELFORMAT_INDEX8, buf, 4); SDLTest_AssertCheck(surface == NULL, "Should detect negative height"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 1, -1, 4, SDL_PIXELFORMAT_RGBA8888); + surface = SDL_CreateSurfaceFrom(1, -1, SDL_PIXELFORMAT_RGBA8888, buf, 4); SDLTest_AssertCheck(surface == NULL, "Should detect negative height"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); expectedError = "Parameter 'pitch' is invalid"; - surface = SDL_CreateSurfaceFrom(buf, 4, 1, -1, SDL_PIXELFORMAT_INDEX8); + surface = SDL_CreateSurfaceFrom(4, 1, SDL_PIXELFORMAT_INDEX8, buf, -1); SDLTest_AssertCheck(surface == NULL, "Should detect negative pitch"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 1, 1, -1, SDL_PIXELFORMAT_RGBA8888); + surface = SDL_CreateSurfaceFrom(1, 1, SDL_PIXELFORMAT_RGBA8888, buf, -1); SDLTest_AssertCheck(surface == NULL, "Should detect negative pitch"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 1, 1, 0, SDL_PIXELFORMAT_RGBA8888); + surface = SDL_CreateSurfaceFrom(1, 1, SDL_PIXELFORMAT_RGBA8888, buf, 0); SDLTest_AssertCheck(surface == NULL, "Should detect zero pitch"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(NULL, 1, 1, 0, SDL_PIXELFORMAT_RGBA8888); + surface = SDL_CreateSurfaceFrom(1, 1, SDL_PIXELFORMAT_RGBA8888, NULL, 0); SDLTest_AssertCheck(surface != NULL, "Allow zero pitch for partially set up surfaces: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); @@ -649,104 +647,104 @@ static int surface_testOverflow(void *arg) /* Less than 1 byte per pixel: the pitch can legitimately be less than * the width, but it must be enough to hold the appropriate number of * bits per pixel. SDL_PIXELFORMAT_INDEX4* needs 1 byte per 2 pixels. */ - surface = SDL_CreateSurfaceFrom(buf, 6, 1, 3, SDL_PIXELFORMAT_INDEX4LSB); + surface = SDL_CreateSurfaceFrom(6, 1, SDL_PIXELFORMAT_INDEX4LSB, buf, 3); SDLTest_AssertCheck(surface != NULL, "6px * 4 bits per px fits in 3 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 6, 1, 3, SDL_PIXELFORMAT_INDEX4MSB); + surface = SDL_CreateSurfaceFrom(6, 1, SDL_PIXELFORMAT_INDEX4MSB, buf, 3); SDLTest_AssertCheck(surface != NULL, "6px * 4 bits per px fits in 3 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 7, 1, 3, SDL_PIXELFORMAT_INDEX4LSB); + surface = SDL_CreateSurfaceFrom(7, 1, SDL_PIXELFORMAT_INDEX4LSB, buf, 3); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 7, 1, 3, SDL_PIXELFORMAT_INDEX4MSB); + surface = SDL_CreateSurfaceFrom(7, 1, SDL_PIXELFORMAT_INDEX4MSB, buf, 3); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 7, 1, 4, SDL_PIXELFORMAT_INDEX4LSB); + surface = SDL_CreateSurfaceFrom(7, 1, SDL_PIXELFORMAT_INDEX4LSB, buf, 4); SDLTest_AssertCheck(surface != NULL, "7px * 4 bits per px fits in 4 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 7, 1, 4, SDL_PIXELFORMAT_INDEX4MSB); + surface = SDL_CreateSurfaceFrom(7, 1, SDL_PIXELFORMAT_INDEX4MSB, buf, 4); SDLTest_AssertCheck(surface != NULL, "7px * 4 bits per px fits in 4 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); /* SDL_PIXELFORMAT_INDEX2* needs 1 byte per 4 pixels. */ - surface = SDL_CreateSurfaceFrom(buf, 12, 1, 3, SDL_PIXELFORMAT_INDEX2LSB); + surface = SDL_CreateSurfaceFrom(12, 1, SDL_PIXELFORMAT_INDEX2LSB, buf, 3); SDLTest_AssertCheck(surface != NULL, "12px * 2 bits per px fits in 3 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 12, 1, 3, SDL_PIXELFORMAT_INDEX2MSB); + surface = SDL_CreateSurfaceFrom(12, 1, SDL_PIXELFORMAT_INDEX2MSB, buf, 3); SDLTest_AssertCheck(surface != NULL, "12px * 2 bits per px fits in 3 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 13, 1, 3, SDL_PIXELFORMAT_INDEX2LSB); + surface = SDL_CreateSurfaceFrom(13, 1, SDL_PIXELFORMAT_INDEX2LSB, buf, 3); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp (%d)", surface ? surface->pitch : 0); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 13, 1, 3, SDL_PIXELFORMAT_INDEX2MSB); + surface = SDL_CreateSurfaceFrom(13, 1, SDL_PIXELFORMAT_INDEX2MSB, buf, 3); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 13, 1, 4, SDL_PIXELFORMAT_INDEX2LSB); + surface = SDL_CreateSurfaceFrom(13, 1, SDL_PIXELFORMAT_INDEX2LSB, buf, 4); SDLTest_AssertCheck(surface != NULL, "13px * 2 bits per px fits in 4 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 13, 1, 4, SDL_PIXELFORMAT_INDEX2MSB); + surface = SDL_CreateSurfaceFrom(13, 1, SDL_PIXELFORMAT_INDEX2MSB, buf, 4); SDLTest_AssertCheck(surface != NULL, "13px * 2 bits per px fits in 4 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); /* SDL_PIXELFORMAT_INDEX1* needs 1 byte per 8 pixels. */ - surface = SDL_CreateSurfaceFrom(buf, 16, 1, 2, SDL_PIXELFORMAT_INDEX1LSB); + surface = SDL_CreateSurfaceFrom(16, 1, SDL_PIXELFORMAT_INDEX1LSB, buf, 2); SDLTest_AssertCheck(surface != NULL, "16px * 1 bit per px fits in 2 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 16, 1, 2, SDL_PIXELFORMAT_INDEX1MSB); + surface = SDL_CreateSurfaceFrom(16, 1, SDL_PIXELFORMAT_INDEX1MSB, buf, 2); SDLTest_AssertCheck(surface != NULL, "16px * 1 bit per px fits in 2 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 17, 1, 2, SDL_PIXELFORMAT_INDEX1LSB); + surface = SDL_CreateSurfaceFrom(17, 1, SDL_PIXELFORMAT_INDEX1LSB, buf, 2); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 17, 1, 2, SDL_PIXELFORMAT_INDEX1MSB); + surface = SDL_CreateSurfaceFrom(17, 1, SDL_PIXELFORMAT_INDEX1MSB, buf, 2); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 17, 1, 3, SDL_PIXELFORMAT_INDEX1LSB); + surface = SDL_CreateSurfaceFrom(17, 1, SDL_PIXELFORMAT_INDEX1LSB, buf, 3); SDLTest_AssertCheck(surface != NULL, "17px * 1 bit per px fits in 3 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 17, 1, 3, SDL_PIXELFORMAT_INDEX1MSB); + surface = SDL_CreateSurfaceFrom(17, 1, SDL_PIXELFORMAT_INDEX1MSB, buf, 3); SDLTest_AssertCheck(surface != NULL, "17px * 1 bit per px fits in 3 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); /* SDL_PIXELFORMAT_INDEX8 and SDL_PIXELFORMAT_RGB332 require 1 byte per pixel. */ - surface = SDL_CreateSurfaceFrom(buf, 5, 1, 5, SDL_PIXELFORMAT_RGB332); + surface = SDL_CreateSurfaceFrom(5, 1, SDL_PIXELFORMAT_RGB332, buf, 5); SDLTest_AssertCheck(surface != NULL, "5px * 8 bits per px fits in 5 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 5, 1, 5, SDL_PIXELFORMAT_INDEX8); + surface = SDL_CreateSurfaceFrom(5, 1, SDL_PIXELFORMAT_INDEX8, buf, 5); SDLTest_AssertCheck(surface != NULL, "5px * 8 bits per px fits in 5 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 6, 1, 5, SDL_PIXELFORMAT_RGB332); + surface = SDL_CreateSurfaceFrom(6, 1, SDL_PIXELFORMAT_RGB332, buf, 5); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 6, 1, 5, SDL_PIXELFORMAT_INDEX8); + surface = SDL_CreateSurfaceFrom(6, 1, SDL_PIXELFORMAT_INDEX8, buf, 5); SDLTest_AssertCheck(surface == NULL, "Should detect pitch < width * bpp"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); @@ -754,20 +752,20 @@ static int surface_testOverflow(void *arg) /* Everything else requires more than 1 byte per pixel, and rounds up * each pixel to an integer number of bytes (e.g. RGB555 is really * XRGB1555, with 1 bit per pixel wasted). */ - surface = SDL_CreateSurfaceFrom(buf, 3, 1, 6, SDL_PIXELFORMAT_XRGB1555); + surface = SDL_CreateSurfaceFrom(3, 1, SDL_PIXELFORMAT_XRGB1555, buf, 6); SDLTest_AssertCheck(surface != NULL, "3px * 15 (really 16) bits per px fits in 6 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 3, 1, 6, SDL_PIXELFORMAT_XRGB1555); + surface = SDL_CreateSurfaceFrom(3, 1, SDL_PIXELFORMAT_XRGB1555, buf, 6); SDLTest_AssertCheck(surface != NULL, "5px * 15 (really 16) bits per px fits in 6 bytes: %s", surface != NULL ? "(success)" : SDL_GetError()); SDL_DestroySurface(surface); - surface = SDL_CreateSurfaceFrom(buf, 4, 1, 6, SDL_PIXELFORMAT_XRGB1555); + surface = SDL_CreateSurfaceFrom(4, 1, SDL_PIXELFORMAT_XRGB1555, buf, 6); SDLTest_AssertCheck(surface == NULL, "4px * 15 (really 16) bits per px doesn't fit in 6 bytes"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); - surface = SDL_CreateSurfaceFrom(buf, 4, 1, 6, SDL_PIXELFORMAT_XRGB1555); + surface = SDL_CreateSurfaceFrom(4, 1, SDL_PIXELFORMAT_XRGB1555, buf, 6); SDLTest_AssertCheck(surface == NULL, "4px * 15 (really 16) bits per px doesn't fit in 6 bytes"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetError(), expectedError) == 0, "Expected \"%s\", got \"%s\"", expectedError, SDL_GetError()); @@ -845,7 +843,7 @@ static int surface_testFlip(void *arg) CHECK_FUNC(SDL_FlipSurface, (surface, SDL_FLIP_HORIZONTAL)); SDLTest_AssertCheck(pixels[offset] == 0x00, "Expected pixels[%d] == 0x00 got 0x%.2X", offset, pixels[offset]); - offset += (surface->w - 1) * surface->format->bytes_per_pixel; + offset += (surface->w - 1) * SDL_BYTESPERPIXEL(surface->format); SDLTest_AssertCheck(pixels[offset] == 0xFF, "Expected pixels[%d] == 0xFF got 0x%.2X", offset, pixels[offset]); diff --git a/test/testcamera.c b/test/testcamera.c index e0b99925292d2..6565edeb88f5c 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -274,12 +274,11 @@ int SDL_AppIterate(void *appstate) SDL_DestroyTexture(texture); } - SDL_Colorspace colorspace = SDL_COLORSPACE_UNKNOWN; - SDL_GetSurfaceColorspace(frame_current, &colorspace); + SDL_Colorspace colorspace = SDL_GetSurfaceColorspace(frame_current); /* Create texture with appropriate format */ SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, frame_current->format->format); + SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER, frame_current->format); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER, colorspace); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_ACCESS_NUMBER, SDL_TEXTUREACCESS_STREAMING); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_CREATE_WIDTH_NUMBER, frame_current->w); diff --git a/test/testcustomcursor.c b/test/testcustomcursor.c index 014640cfe39c5..7b7b650402c7a 100644 --- a/test/testcustomcursor.c +++ b/test/testcustomcursor.c @@ -115,15 +115,15 @@ init_color_cursor(const char *file) SDL_Cursor *cursor = NULL; SDL_Surface *surface = SDL_LoadBMP(file); if (surface) { - if (surface->format->palette) { - const Uint8 bpp = surface->format->bits_per_pixel; + if (SDL_GetSurfacePalette(surface)) { + const Uint8 bpp = SDL_BITSPERPIXEL(surface->format); const Uint8 mask = (1 << bpp) - 1; - if (SDL_PIXELORDER(surface->format->format) == SDL_BITMAPORDER_4321) + if (SDL_PIXELORDER(surface->format) == SDL_BITMAPORDER_4321) SDL_SetSurfaceColorKey(surface, 1, (*(Uint8 *)surface->pixels) & mask); else SDL_SetSurfaceColorKey(surface, 1, ((*(Uint8 *)surface->pixels) >> (8 - bpp)) & mask); } else { - switch (surface->format->bits_per_pixel) { + switch (SDL_BITSPERPIXEL(surface->format)) { case 15: SDL_SetSurfaceColorKey(surface, 1, (*(Uint16 *)surface->pixels) & 0x00007FFF); break; diff --git a/test/testffmpeg.c b/test/testffmpeg.c index 3d9cca6660999..c414bef5690f6 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -236,7 +236,7 @@ static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned surface = SDL_LoadBMP_IO(src, SDL_TRUE); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapRGB(surface->format, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); texture = SDL_CreateTextureFromSurface(r, surface); *w = surface->w; @@ -279,7 +279,7 @@ static void MoveSprite(void) } } -static SDL_PixelFormatEnum GetTextureFormat(enum AVPixelFormat format) +static SDL_PixelFormat GetTextureFormat(enum AVPixelFormat format) { switch (format) { case AV_PIX_FMT_RGB8: @@ -511,7 +511,7 @@ static SDL_Colorspace GetFrameColorspace(AVFrame *frame) return colorspace; } -static SDL_PropertiesID CreateVideoTextureProperties(AVFrame *frame, SDL_PixelFormatEnum format, int access) +static SDL_PropertiesID CreateVideoTextureProperties(AVFrame *frame, SDL_PixelFormat format, int access) { AVFrameSideData *pSideData; SDL_PropertiesID props; @@ -571,12 +571,12 @@ static void SDLCALL FreeSwsContextContainer(void *userdata, void *value) static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) { int texture_width = 0, texture_height = 0; - SDL_PixelFormatEnum texture_format = SDL_PIXELFORMAT_UNKNOWN; - SDL_PixelFormatEnum frame_format = GetTextureFormat(frame->format); + SDL_PixelFormat texture_format = SDL_PIXELFORMAT_UNKNOWN; + SDL_PixelFormat frame_format = GetTextureFormat(frame->format); if (*texture) { SDL_PropertiesID props = SDL_GetTextureProperties(*texture); - texture_format = (SDL_PixelFormatEnum)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN); + texture_format = (SDL_PixelFormat)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_FORMAT_NUMBER, SDL_PIXELFORMAT_UNKNOWN); texture_width = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_WIDTH_NUMBER, 0); texture_height = (int)SDL_GetNumberProperty(props, SDL_PROP_TEXTURE_HEIGHT_NUMBER, 0); } diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index af36324367573..23c11238eada5 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -600,7 +600,7 @@ int main(int argc, char *argv[]) TTF_CloseFont(font); TTF_Quit(); #endif - g_surf_sdf = SDL_ConvertSurfaceFormat(tmp, SDL_PIXELFORMAT_ABGR8888); + g_surf_sdf = SDL_ConvertSurface(tmp, SDL_PIXELFORMAT_ABGR8888); SDL_SetSurfaceBlendMode(g_surf_sdf, SDL_BLENDMODE_BLEND); } diff --git a/test/testoverlay.c b/test/testoverlay.c index d87c292b68bb9..9ef1aaf2e46a8 100644 --- a/test/testoverlay.c +++ b/test/testoverlay.c @@ -499,7 +499,7 @@ int main(int argc, char **argv) } /* Convert to YUV SDL_Surface */ - MooseYUVSurfaces[i] = SDL_ConvertSurfaceFormat(mooseRGBSurface, yuv_format); + MooseYUVSurfaces[i] = SDL_ConvertSurface(mooseRGBSurface, yuv_format); if (MooseYUVSurfaces[i] == NULL) { quit(7); } diff --git a/test/testshape.c b/test/testshape.c index 2f226c83b0d92..c80d1f01737f4 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -86,12 +86,12 @@ int main(int argc, char *argv[]) goto quit; } - if (!SDL_ISPIXELFORMAT_ALPHA(shape->format->format)) { + if (!SDL_ISPIXELFORMAT_ALPHA(shape->format)) { /* Set the colorkey to the top-left pixel */ Uint8 r, g, b, a; SDL_ReadSurfacePixel(shape, 0, 0, &r, &g, &b, &a); - SDL_SetSurfaceColorKey(shape, 1, SDL_MapRGBA(shape->format, r, g, b, a)); + SDL_SetSurfaceColorKey(shape, 1, SDL_MapSurfaceRGBA(shape, r, g, b, a)); } if (!resizable) { diff --git a/test/testspriteminimal.c b/test/testspriteminimal.c index 41704992dece3..4e7de36b88f39 100644 --- a/test/testspriteminimal.c +++ b/test/testspriteminimal.c @@ -42,7 +42,7 @@ static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned surface = SDL_LoadBMP_IO(src, SDL_TRUE); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapRGB(surface->format, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); texture = SDL_CreateTextureFromSurface(r, surface); *w = surface->w; diff --git a/test/testutils.c b/test/testutils.c index 863d05061f834..09dfb726c815c 100644 --- a/test/testutils.c +++ b/test/testutils.c @@ -103,15 +103,15 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent, } else { /* Set transparent pixel as the pixel at (0,0) */ if (transparent) { - if (temp->format->palette) { - const Uint8 bpp = temp->format->bits_per_pixel; + if (SDL_GetSurfacePalette(temp)) { + const Uint8 bpp = SDL_BITSPERPIXEL(temp->format); const Uint8 mask = (1 << bpp) - 1; - if (SDL_PIXELORDER(temp->format->format) == SDL_BITMAPORDER_4321) + if (SDL_PIXELORDER(temp->format) == SDL_BITMAPORDER_4321) SDL_SetSurfaceColorKey(temp, SDL_TRUE, (*(Uint8 *)temp->pixels) & mask); else SDL_SetSurfaceColorKey(temp, SDL_TRUE, ((*(Uint8 *)temp->pixels) >> (8 - bpp)) & mask); } else { - switch (temp->format->bits_per_pixel) { + switch (SDL_BITSPERPIXEL(temp->format)) { case 15: SDL_SetSurfaceColorKey(temp, SDL_TRUE, (*(Uint16 *)temp->pixels) & 0x00007FFF); diff --git a/test/testwaylandcustom.c b/test/testwaylandcustom.c index 38b61f8ff2edb..753c2c88ddd1b 100644 --- a/test/testwaylandcustom.c +++ b/test/testwaylandcustom.c @@ -38,7 +38,7 @@ static SDL_Texture *CreateTexture(SDL_Renderer *r, unsigned char *data, unsigned surface = SDL_LoadBMP_IO(src, SDL_TRUE); if (surface) { /* Treat white as transparent */ - SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapRGB(surface->format, 255, 255, 255)); + SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); texture = SDL_CreateTextureFromSurface(r, surface); *w = surface->w; diff --git a/test/testyuv.c b/test/testyuv.c index 523e82d8c0b6a..cf207119da89f 100644 --- a/test/testyuv.c +++ b/test/testyuv.c @@ -77,7 +77,7 @@ static SDL_bool verify_yuv_data(Uint32 format, SDL_Colorspace colorspace, const return SDL_FALSE; } - if (SDL_ConvertPixelsAndColorspace(surface->w, surface->h, format, colorspace, 0, yuv, yuv_pitch, surface->format->format, SDL_COLORSPACE_SRGB, 0, rgb, surface->pitch) == 0) { + if (SDL_ConvertPixelsAndColorspace(surface->w, surface->h, format, colorspace, 0, yuv, yuv_pitch, surface->format, SDL_COLORSPACE_SRGB, 0, rgb, surface->pitch) == 0) { int x, y; result = SDL_TRUE; for (y = 0; y < surface->h; ++y) { @@ -97,7 +97,7 @@ static SDL_bool verify_yuv_data(Uint32 format, SDL_Colorspace colorspace, const } } } else { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(format), SDL_GetPixelFormatName(surface->format->format), SDL_GetError()); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(format), SDL_GetPixelFormatName(surface->format), SDL_GetError()); } SDL_free(rgb); @@ -151,8 +151,8 @@ static int run_automated_tests(int pattern_size, int extra_pitch) /* Verify conversion to YUV formats */ for (i = 0; i < SDL_arraysize(formats); ++i) { yuv1_pitch = CalculateYUVPitch(formats[i], pattern->w) + extra_pitch; - if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, formats[i], colorspace, 0, yuv1, yuv1_pitch) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format->format), SDL_GetPixelFormatName(formats[i]), SDL_GetError()); + if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, formats[i], colorspace, 0, yuv1, yuv1_pitch) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format), SDL_GetPixelFormatName(formats[i]), SDL_GetError()); goto done; } if (!verify_yuv_data(formats[i], colorspace, yuv1, yuv1_pitch, pattern, tight_tolerance)) { @@ -166,8 +166,8 @@ static int run_automated_tests(int pattern_size, int extra_pitch) for (j = 0; j < SDL_arraysize(formats); ++j) { yuv1_pitch = CalculateYUVPitch(formats[i], pattern->w) + extra_pitch; yuv2_pitch = CalculateYUVPitch(formats[j], pattern->w) + extra_pitch; - if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, formats[i], colorspace, 0, yuv1, yuv1_pitch) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format->format), SDL_GetPixelFormatName(formats[i]), SDL_GetError()); + if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, formats[i], colorspace, 0, yuv1, yuv1_pitch) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format), SDL_GetPixelFormatName(formats[i]), SDL_GetError()); goto done; } if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, formats[i], colorspace, 0, yuv1, yuv1_pitch, formats[j], colorspace, 0, yuv2, yuv2_pitch) < 0) { @@ -191,8 +191,8 @@ static int run_automated_tests(int pattern_size, int extra_pitch) yuv1_pitch = CalculateYUVPitch(formats[i], pattern->w) + extra_pitch; yuv2_pitch = CalculateYUVPitch(formats[j], pattern->w) + extra_pitch; - if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, formats[i], colorspace, 0, yuv1, yuv1_pitch) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format->format), SDL_GetPixelFormatName(formats[i]), SDL_GetError()); + if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, formats[i], colorspace, 0, yuv1, yuv1_pitch) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format), SDL_GetPixelFormatName(formats[i]), SDL_GetError()); goto done; } if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, formats[i], colorspace, 0, yuv1, yuv1_pitch, formats[j], colorspace, 0, yuv1, yuv2_pitch) < 0) { @@ -220,8 +220,8 @@ static int run_automated_tests(int pattern_size, int extra_pitch) /* The pitch needs to be Uint16 aligned for P010 pixels */ yuv1_pitch = CalculateYUVPitch(SDL_PIXELFORMAT_P010, pattern->w) + ((extra_pitch + 1) & ~1); - if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, SDL_PIXELFORMAT_P010, colorspace, 0, yuv1, yuv1_pitch) < 0) { - SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format->format), SDL_GetPixelFormatName(SDL_PIXELFORMAT_P010), SDL_GetError()); + if (SDL_ConvertPixelsAndColorspace(pattern->w, pattern->h, pattern->format, SDL_COLORSPACE_SRGB, 0, pattern->pixels, pattern->pitch, SDL_PIXELFORMAT_P010, colorspace, 0, yuv1, yuv1_pitch) < 0) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't convert %s to %s: %s\n", SDL_GetPixelFormatName(pattern->format), SDL_GetPixelFormatName(SDL_PIXELFORMAT_P010), SDL_GetError()); goto done; } /* Going through XRGB2101010 format during P010 conversion is slightly lossy, so use looser tolerance here */ @@ -418,7 +418,7 @@ int main(int argc, char **argv) filename = GetResourceFilename(filename, "testyuv.bmp"); bmp = SDL_LoadBMP(filename); - original = SDL_ConvertSurfaceFormat(bmp, SDL_PIXELFORMAT_RGB24); + original = SDL_ConvertSurface(bmp, SDL_PIXELFORMAT_RGB24); SDL_DestroySurface(bmp); if (!original) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't load %s: %s\n", filename, SDL_GetError()); From fdc04708f1950ad76eff16fd47ffe67dcdc5ba04 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 10 Jul 2024 07:48:48 +0000 Subject: [PATCH 225/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_pixels.h | 38 ++++++++++++++++++++++++-------------- include/SDL3/SDL_render.h | 3 ++- include/SDL3/SDL_surface.h | 30 ++++++++++++++++++------------ 3 files changed, 44 insertions(+), 27 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index bdb37f73d5a66..360ee955133eb 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -803,8 +803,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetMasksForPixelFormat(SDL_PixelFormat forma * \param Gmask the green mask for the format. * \param Bmask the blue mask for the format. * \param Amask the alpha mask for the format. - * \returns the SDL_PixelFormat value corresponding to the format masks, - * or SDL_PIXELFORMAT_UNKNOWN if there isn't a match. + * \returns the SDL_PixelFormat value corresponding to the format masks, or + * SDL_PIXELFORMAT_UNKNOWN if there isn't a match. * * \threadsafety It is safe to call this function from any thread. * @@ -822,8 +822,8 @@ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetPixelFormatForMasks(int bpp, * errors such as `Blit combination not supported` may occur. * * \param format one of the SDL_PixelFormat values. - * \returns a pointer to a SDL_PixelFormatDetails structure or NULL on failure; call - * SDL_GetError() for more information. + * \returns a pointer to a SDL_PixelFormatDetails structure or NULL on + * failure; call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -861,7 +861,8 @@ extern SDL_DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors); * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * - * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread. + * \threadsafety It is safe to call this function from any thread, as long as + * the palette is not modified or destroyed in another thread. * * \since This function is available since SDL 3.0.0. */ @@ -872,7 +873,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette *palette, const * * \param palette the SDL_Palette structure to be freed. * - * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified or destroyed in another thread. + * \threadsafety It is safe to call this function from any thread, as long as + * the palette is not modified or destroyed in another thread. * * \since This function is available since SDL 3.0.0. * @@ -898,14 +900,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette *palette); * format the return value can be assigned to a Uint16, and similarly a Uint8 * for an 8-bpp format). * - * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel + * format. * \param palette an optional palette for indexed formats, may be NULL. * \param r the red component of the pixel in the range 0-255. * \param g the green component of the pixel in the range 0-255. * \param b the blue component of the pixel in the range 0-255. * \returns a pixel value. * - * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. + * \threadsafety It is safe to call this function from any thread, as long as + * the palette is not modified. * * \since This function is available since SDL 3.0.0. * @@ -933,7 +937,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * format the return value can be assigned to a Uint16, and similarly a Uint8 * for an 8-bpp format). * - * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel + * format. * \param palette an optional palette for indexed formats, may be NULL. * \param r the red component of the pixel in the range 0-255. * \param g the green component of the pixel in the range 0-255. @@ -941,7 +946,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormatDetails *form * \param a the alpha component of the pixel in the range 0-255. * \returns a pixel value. * - * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. + * \threadsafety It is safe to call this function from any thread, as long as + * the palette is not modified. * * \since This function is available since SDL 3.0.0. * @@ -960,13 +966,15 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormatDetails *for * 0xff, 0xff] not [0xf8, 0xfc, 0xf8]). * * \param pixel a pixel value. - * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel + * format. * \param palette an optional palette for indexed formats, may be NULL. * \param r a pointer filled in with the red component, may be NULL. * \param g a pointer filled in with the green component, may be NULL. * \param b a pointer filled in with the blue component, may be NULL. * - * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. + * \threadsafety It is safe to call this function from any thread, as long as + * the palette is not modified. * * \since This function is available since SDL 3.0.0. * @@ -988,14 +996,16 @@ extern SDL_DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel, const SDL_PixelFormatD * (100% opaque). * * \param pixel a pixel value. - * \param format a pointer to SDL_PixelFormatDetails describing the pixel format. + * \param format a pointer to SDL_PixelFormatDetails describing the pixel + * format. * \param palette an optional palette for indexed formats, may be NULL. * \param r a pointer filled in with the red component, may be NULL. * \param g a pointer filled in with the green component, may be NULL. * \param b a pointer filled in with the blue component, may be NULL. * \param a a pointer filled in with the alpha component, may be NULL. * - * \threadsafety It is safe to call this function from any thread, as long as the palette is not modified. + * \threadsafety It is safe to call this function from any thread, as long as + * the palette is not modified. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 4b08b0b11264e..2ff52dc1dffd5 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -350,7 +350,8 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetRendererName(SDL_Renderer *render * - `SDL_PROP_RENDERER_VSYNC_NUMBER`: the current vsync setting * - `SDL_PROP_RENDERER_MAX_TEXTURE_SIZE_NUMBER`: the maximum texture width * and height - * - `SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER`: a (const SDL_PixelFormat *) array of pixel formats, terminated with SDL_PIXELFORMAT_UNKNOWN, + * - `SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER`: a (const SDL_PixelFormat *) + * array of pixel formats, terminated with SDL_PIXELFORMAT_UNKNOWN, * representing the available texture formats for this renderer. * - `SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER`: an SDL_ColorSpace value * describing the colorspace for output to the display, defaults to diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 73a7d368e2d7c..8078a0c88f03c 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -139,7 +139,8 @@ typedef struct SDL_Surface extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormat format); /** - * Allocate a new surface with a specific pixel format and existing pixel data. + * Allocate a new surface with a specific pixel format and existing pixel + * data. * * No copy is made of the pixel data. Pixel data is not managed automatically; * you must free the surface before you free the pixel data. @@ -247,7 +248,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, S * other RGB surfaces and SDL_COLORSPACE_BT709_FULL for YUV textures. * * \param surface the SDL_Surface structure to query. - * \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if the surface is NULL. + * \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if + * the surface is NULL. * * \since This function is available since SDL 3.0.0. * @@ -276,7 +278,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_ * Get the palette used by a surface. * * \param surface the SDL_Surface structure to query. - * \returns a pointer to the palette used by the surface, or NULL if there is no palette used. + * \returns a pointer to the palette used by the surface, or NULL if there is + * no palette used. * * \since This function is available since SDL 3.0.0. * @@ -407,7 +410,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *fi * the surface must be locked before directly accessing the pixels. * * \param surface the SDL_Surface structure to optimize. - * \param enabled SDL_TRUE to enable RLE acceleration, SDL_FALSE to disable it. + * \param enabled SDL_TRUE to enable RLE acceleration, SDL_FALSE to disable + * it. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -444,7 +448,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface); * SDL_MapRGB(). * * \param surface the SDL_Surface structure to update. - * \param enabled SDL_TRUE to enable color key, SDL_FALSE to disable color key. + * \param enabled SDL_TRUE to enable color key, SDL_FALSE to disable color + * key. * \param key the transparent pixel. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. @@ -675,7 +680,8 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surfa * surface. The new, optimized surface can then be used as the source for * future blits, making them faster. * - * If you are converting to an indexed surface and want to map colors to a palette, you can use SDL_ConvertSurfaceAndColorspace() instead. + * If you are converting to an indexed surface and want to map colors to a + * palette, you can use SDL_ConvertSurfaceAndColorspace() instead. * * \param surface the existing SDL_Surface structure to convert. * \param format the new pixel format. @@ -1013,8 +1019,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, * returns the pixel value best approximating the given RGB color value for * the given pixel format. * - * If the surface has a palette, the index of the closest matching color - * in the palette will be returned. + * If the surface has a palette, the index of the closest matching color in + * the palette will be returned. * * If the surface pixel format has an alpha component it will be returned as * all 1 bits (fully opaque). @@ -1043,11 +1049,11 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8 * returns the pixel value best approximating the given RGBA color value for * the given pixel format. * - * If the surface pixel format has no alpha component the alpha value will - * be ignored (as it will be in formats with a palette). + * If the surface pixel format has no alpha component the alpha value will be + * ignored (as it will be in formats with a palette). * - * If the surface has a palette, the index of the closest matching color - * in the palette will be returned. + * If the surface has a palette, the index of the closest matching color in + * the palette will be returned. * * 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 From 3b60ee666e25f61a6c3c60b59162ceddbc5fb6b3 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 10 Jul 2024 10:46:39 -0400 Subject: [PATCH 226/431] wayland: Note that setting the damage region in the frame callback is explicitly to work around a driver bug --- src/video/wayland/SDL_waylandwindow.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 93d9bb3144abf..4176647594ed0 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -637,9 +637,9 @@ static void surface_frame_done(void *data, struct wl_callback *cb, uint32_t time { SDL_WindowData *wind = (SDL_WindowData *)data; - /* - * wl_surface.damage_buffer is the preferred method of setting the damage region - * on compositor version 4 and above. + /* XXX: This is needed to work around an Nvidia egl-wayland bug due to buffer coordinates + * being used with wl_surface_damage, which causes part of the output to not be + * updated when using a viewport with an output region larger than the source region. */ if (wl_compositor_get_version(wind->waylandData->compositor) >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION) { wl_surface_damage_buffer(wind->surface, 0, 0, SDL_MAX_SINT32, SDL_MAX_SINT32); From 1857f57686d792a016e73b662560ead0e74c0937 Mon Sep 17 00:00:00 2001 From: David Gow Date: Wed, 10 Jul 2024 21:01:52 +0800 Subject: [PATCH 227/431] Remove incorrect asserts from SDL_InitPixelFormatDetails() The SDL_Surface rework in #10201 adds some extra checks that the pixel format enum matches the SDL_PixelFormatDetails struct, which is largely filled in with values from SDL_GetMasksForPixelFormat(). However, there are a few cases where these do not match: - Indexed 1-, 2-, and 4-bit formats encode a bytes_per_pixel of 0, but SDL_GetMasksForPixelFormat() gives a value of 1. - Packed formats, like SDL_PIXELFORMAT_XRGB8888 encode a bits_per_pixel of the number of used bits (24), but SDL_GetMasksForPixelFormat() includes the padding byte, giving a total of 32. We could change the encoding of these in the enum, or change what we store in the details struct to match, but I suspect we'd either break something that relies on it, or lose some (_maybe_ useful) information. In the meantime, this gets the tests working again. Signed-off-by: David Gow --- src/video/SDL_pixels.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 2b40fc714c761..3202f13215dba 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -593,9 +593,7 @@ static int SDL_InitPixelFormatDetails(SDL_PixelFormatDetails *details, SDL_Pixel SDL_zerop(details); details->format = format; details->bits_per_pixel = (Uint8)bpp; - SDL_assert(SDL_BITSPERPIXEL(format) == details->bits_per_pixel); details->bytes_per_pixel = (Uint8)((bpp + 7) / 8); - SDL_assert(SDL_BYTESPERPIXEL(format) == details->bytes_per_pixel); details->Rmask = Rmask; details->Rshift = 0; From 001c1b29dfa03c6924aaef0135a7eda3a2dea741 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 10 Jul 2024 13:17:53 +0200 Subject: [PATCH 228/431] cmake: remove SDL_STATIC_VCRT option projects are expected to use CMAKE_MSVC_RUNTIME_LIBRARY to select the runtime library. With current CMake versions, this can be done with: -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=xxx with xxx one of: "MultiThreaded" -> -MT (static non-debug) "MultiThreadedDLL" -> -MD (shared non-debug) "MultiThreadeDebug" -> -MTd (static debug) "MultiThreadedDebugDLL" -> -MDd (shared debug) See CMake documentation for more information: https://cmake.org/cmake/help/latest/policy/CMP0091.html https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html --- CMakeLists.txt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 14be990895425..f5eef6cb109b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -159,20 +159,6 @@ if(WINDOWS OR MACOS OR IOS OR TVOS OR VISIONOS OR WATCHOS) endif() if(MSVC) - dep_option(SDL_STATIC_VCRT "Use /MT for static VC runtimes" ON "NOT WINDOWS_STORE" OFF) - if(SDL_STATIC_VCRT) - if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") - endif() - foreach(flag_var - CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO) - if(${flag_var} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - endif() - endforeach() - endif() - if(NOT SDL_LIBC) # Make sure /RTC1 is disabled, otherwise it will use functions from the CRT foreach(flag_var From 21aba2b19c1297b4b079333142a8695302c713e4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 10 Jul 2024 09:41:28 -0700 Subject: [PATCH 229/431] Don't try to use D3D11 or D3D12 if the window isn't backed with an HWND Fixes https://github.com/libsdl-org/SDL/issues/10196 --- src/render/direct3d11/SDL_render_d3d11.c | 5 +++++ src/render/direct3d12/SDL_render_d3d12.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 07ae882169c55..3056d07e00d5f 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -2783,6 +2783,11 @@ static int D3D11_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ { D3D11_RenderData *data; + HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + if (!hwnd) { + return SDL_SetError("Couldn't get window handle"); + } + SDL_SetupRendererColorspace(renderer, create_props); if (renderer->output_colorspace != SDL_COLORSPACE_SRGB && diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index a37834a9a802c..45c91d87a5ad3 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -960,7 +960,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) D3D_GUID(SDL_IID_IDXGIAdapter4), (void **)&data->dxgiAdapter); if (FAILED(result)) { - WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("D3D12CreateDevice"), result); + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("IDXGIFactory6::EnumAdapterByGpuPreference"), result); goto done; } @@ -3232,6 +3232,11 @@ int D3D12_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propert { D3D12_RenderData *data; + HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + if (!hwnd) { + return SDL_SetError("Couldn't get window handle"); + } + if (SDL_GetWindowFlags(window) & SDL_WINDOW_TRANSPARENT) { /* D3D12 removed the swap effect needed to support transparent windows, use D3D11 instead */ return SDL_SetError("The direct3d12 renderer doesn't work with transparent windows"); From d1eab18de2a00610b7fffe146a89907dd3402532 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 10 Jul 2024 19:07:27 +0200 Subject: [PATCH 230/431] cmake: build ci and and release with static runtime library (The Visual Studio projects do this as well) --- .github/workflows/msvc.yml | 16 +++++++++++++--- CMakeLists.txt | 3 --- build-scripts/build-release.py | 4 ++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 0ce24788928ec..b72a2b85c43c4 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -35,13 +35,23 @@ jobs: builddir = f"{ srcdir }/build" os.makedirs(builddir) cmakelists_txt = textwrap.dedent(f"""\ - # Always build .PDB symbol file + # MSVC debug information format flags are selected by an abstraction set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction") + # MSVC runtime library flags are selected by an abstraction + set(CMAKE_POLICY_DEFAULT_CMP0091 "NEW" CACHE STRING "MSVC runtime library flags are selected by an abstraction") + cmake_minimum_required(VERSION 3.0...3.25) + project(sdl_user) + # Always build .PDB symbol file set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format") set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables") set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries") - cmake_minimum_required(VERSION 3.0...3.25) - project(sdl_user) + if(WINDOWS_STORE) # WINDOWS_STORE is available AFTER project() + # UWP only supports dynamic runtime + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "MSVC runtime libary") + else() + # Use static runtime library + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "MSVC runtime libary") + endif() enable_testing() add_subdirectory("{ srcdir }" SDL) """) diff --git a/CMakeLists.txt b/CMakeLists.txt index f5eef6cb109b0..a2298d806bc8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,9 +4,6 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there") endif() -# MSVC runtime library flags are selected by an abstraction. -set(CMAKE_POLICY_DEFAULT_CMP0091 NEW) - # See docs/release_checklist.md project(SDL3 LANGUAGES C VERSION "3.1.2") diff --git a/build-scripts/build-release.py b/build-scripts/build-release.py index c9cb821711bec..735890005ba9d 100755 --- a/build-scripts/build-release.py +++ b/build-scripts/build-release.py @@ -471,6 +471,10 @@ def build_vs_cmake(self, arch: str, arch_cmake: str): "-DCMAKE_EXE_LINKER_FLAGS=-DEBUG", # Linker flag for shared libraries "-DCMAKE_SHARED_LINKER_FLAGS=-INCREMENTAL:NO -DEBUG -OPT:REF -OPT:ICF", + # MSVC runtime library flags are selected by an abstraction + "-DCMAKE_POLICY_DEFAULT_CMP0091=NEW", + # Use statically linked runtime (-MT) (ideally, should be "MultiThreaded$<$:Debug>") + "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded", ]) with self.section_printer.group(f"Build VC CMake project for {arch}"): From 1664ac4fcb395f14c16b738e071ec3a1b058cd7f Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 8 Jul 2024 21:01:02 +0200 Subject: [PATCH 231/431] hidapi: fix 'conversion from 'size_t' to 'int', possible loss of data' of libusb functions --- src/hidapi/libusb/hid.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 19551e59bc41f..5f204c1896974 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -1171,7 +1171,7 @@ static void *read_thread(void *param) dev->device_handle, dev->input_endpoint, buf, - length, + (int) length, read_callback, dev, 5000/*timeout*/); @@ -1598,7 +1598,7 @@ int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t if (skipped_report_id) length++; - return length; + return (int) length; } else { /* Use the interrupt out endpoint */ @@ -1606,7 +1606,7 @@ int HID_API_EXPORT hid_write(hid_device *dev, const unsigned char *data, size_t res = libusb_interrupt_transfer(dev->device_handle, dev->output_endpoint, (unsigned char*)data, - length, + (int) length, &actual_length, 1000); if (res < 0) @@ -1632,7 +1632,7 @@ static int return_data(hid_device *dev, unsigned char *data, size_t length) dev->input_reports = rpt->next; free(rpt->data); free(rpt); - return len; + return (int) len; } static void cleanup_mutex(void *param) @@ -1765,7 +1765,7 @@ int HID_API_EXPORT hid_send_feature_report(hid_device *dev, const unsigned char if (skipped_report_id) length++; - return length; + return (int) length; } int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length) From 4755055bc3a89b967e903d231bf632526c549488 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 10 Jul 2024 00:10:37 -0400 Subject: [PATCH 232/431] audio: Separate channel maps out of SDL_AudioSpec. --- include/SDL3/SDL_audio.h | 195 +++++++++++++++++++++++++++--- src/audio/SDL_audio.c | 50 ++++++-- src/audio/SDL_audiocvt.c | 188 +++++++++++++++++++++------- src/audio/SDL_audioqueue.c | 38 ++++-- src/audio/SDL_audioqueue.h | 8 +- src/audio/SDL_sysaudio.h | 24 +++- src/audio/alsa/SDL_alsa_audio.c | 46 ++++--- src/dynapi/SDL_dynapi.sym | 5 + src/dynapi/SDL_dynapi_overrides.h | 5 + src/dynapi/SDL_dynapi_procs.h | 5 + test/loopwave.c | 1 + test/testffmpeg.c | 4 +- 12 files changed, 455 insertions(+), 114 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index d8879e2aa9003..92251c92faea7 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -43,7 +43,12 @@ * if you aren't reading from a file) as a basic means to load sound data into * your program. * - * ## Channel layouts as SDL expects them + * ## Channel layouts + * + * Audio data passing through SDL is uncompressed PCM data, interleaved. + * One can provide their own decompression through an MP3, etc, decoder, but + * SDL does not provide this directly. Each interleaved channel of data is + * meant to be in a specific order. * * Abbreviations: * @@ -76,7 +81,7 @@ * platforms; SDL will swizzle the channels as necessary if a platform expects * something different. * - * SDL_AudioStream can also be provided a channel map to change this ordering + * SDL_AudioStream can also be provided channel maps to change this ordering * to whatever is necessary, in other audio processing scenarios. */ @@ -301,18 +306,6 @@ typedef Uint32 SDL_AudioDeviceID; */ #define SDL_AUDIO_DEVICE_DEFAULT_RECORDING ((SDL_AudioDeviceID) 0xFFFFFFFE) -/** - * Maximum channels that an SDL_AudioSpec channel map can handle. - * - * This is (currently) double the number of channels that SDL supports, to - * allow for future expansion while maintaining binary compatibility. - * - * \since This macro is available since SDL 3.0.0. - * - * \sa SDL_AudioSpec - */ -#define SDL_MAX_CHANNEL_MAP_SIZE 16 - /** * Format specifier for audio data. * @@ -325,8 +318,6 @@ typedef struct SDL_AudioSpec SDL_AudioFormat format; /**< Audio data format */ int channels; /**< Number of channels: 1 mono, 2 stereo, etc */ int freq; /**< sample rate: sample frames per second */ - SDL_bool use_channel_map; /**< If SDL_FALSE, ignore `channel_map` and use default order. */ - Uint8 channel_map[SDL_MAX_CHANNEL_MAP_SIZE]; /**< `channels` items of channel order. */ } SDL_AudioSpec; /** @@ -560,6 +551,29 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID */ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames); +/** + * Get the current channel map of an audio device. + * + * Channel maps are optional; most things do not need them, instead passing + * data in the [order that SDL expects](CategoryAudio#channel-layouts). + * + * Audio devices usually have no remapping applied. This is represented by + * returning NULL, and does not signify an error. + * + * The returned array follows the SDL_GetStringRule (even though, strictly + * speaking, it isn't a string, it has the same memory manangement rules). + * + * \param devid the instance ID of the device to query. + * \param count On output, set to number of channels in the map. Can be NULL. + * \returns an array of the current channel mapping, with as many elements as the current output spec's channels, or NULL if default. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioStreamInputChannelMap + */ +extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count); /** * Open a specific audio device. @@ -1081,6 +1095,151 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream */ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain); +/** + * Get the current input channel map of an audio stream. + * + * Channel maps are optional; most things do not need them, instead passing + * data in the [order that SDL expects](CategoryAudio#channel-layouts). + * + * Audio streams default to no remapping applied. This is represented by + * returning NULL, and does not signify an error. + * + * The returned array follows the SDL_GetStringRule (even though, strictly + * speaking, it isn't a string, it has the same memory manangement rules). + * + * \param stream the SDL_AudioStream to query. + * \param count On output, set to number of channels in the map. Can be NULL. + * \returns an array of the current channel mapping, with as many elements as the current output spec's channels, or NULL if default. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioStreamInputChannelMap + */ +extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count); + +/** + * Get the current output channel map of an audio stream. + * + * Channel maps are optional; most things do not need them, instead passing + * data in the [order that SDL expects](CategoryAudio#channel-layouts). + * + * Audio streams default to no remapping applied. This is represented by + * returning NULL, and does not signify an error. + * + * The returned array follows the SDL_GetStringRule (even though, strictly + * speaking, it isn't a string, it has the same memory manangement rules). + * + * \param stream the SDL_AudioStream to query. + * \param count On output, set to number of channels in the map. Can be NULL. + * \returns an array of the current channel mapping, with as many elements as the current output spec's channels, or NULL if default. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioStreamInputChannelMap + */ +extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *count); + +/** + * Set the current input channel map of an audio stream. + * + * Channel maps are optional; most things do not need them, instead passing + * data in the [order that SDL expects](CategoryAudio#channel-layouts). + * + * The input channel map reorders data that is added to a stream via + * SDL_PutAudioStreamData. Future calls to SDL_PutAudioStreamData + * must provide data in the new channel order. + * + * Each item in the array represents an input channel, and its value is the + * channel that it should be remapped to. To reverse a stereo signal's left + * and right values, you'd have an array of `{ 1, 0 }`. It is legal to remap + * multiple channels to the same thing, so `{ 1, 1 }` would duplicate the + * right channel to both channels of a stereo signal. You cannot change the + * number of channels through a channel map, just reorder them. + * + * Data that was previously queued in the stream will still be operated on in + * the order that was current when it was added, which is to say you can put + * the end of a sound file in one order to a stream, change orders for the + * next sound file, and start putting that new data while the previous sound + * file is still queued, and everything will still play back correctly. + * + * Audio streams default to no remapping applied. Passing a NULL channel map + * is legal, and turns off remapping. + * + * SDL will copy the channel map; the caller does not have to save this array + * after this call. + * + * If `count` is not equal to the current number of channels in the audio + * stream's format, this will fail. This is a safety measure to make sure a + * a race condition hasn't changed the format while you this call is setting + * the channel map. + * + * \param stream the SDL_AudioStream to change. + * \param chmap the new channel map, NULL to reset to default. + * \param count The number of channels in the map. + * \returns 0 on success, -1 on error. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. Don't change the + * stream's format to have a different number of channels from a + * a different thread at the same time, though! + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioStreamInputChannelMap + */ +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); + +/** + * Set the current output channel map of an audio stream. + * + * Channel maps are optional; most things do not need them, instead passing + * data in the [order that SDL expects](CategoryAudio#channel-layouts). + * + * The output channel map reorders data that leaving a stream via + * SDL_GetAudioStreamData. + * + * Each item in the array represents an output channel, and its value is the + * channel that it should be remapped to. To reverse a stereo signal's left + * and right values, you'd have an array of `{ 1, 0 }`. It is legal to remap + * multiple channels to the same thing, so `{ 1, 1 }` would duplicate the + * right channel to both channels of a stereo signal. You cannot change the + * number of channels through a channel map, just reorder them. + * + * The output channel map can be changed at any time, as output remapping is + * applied during SDL_GetAudioStreamData. + * + * Audio streams default to no remapping applied. Passing a NULL channel map + * is legal, and turns off remapping. + * + * SDL will copy the channel map; the caller does not have to save this array + * after this call. + * + * If `count` is not equal to the current number of channels in the audio + * stream's format, this will fail. This is a safety measure to make sure a + * a race condition hasn't changed the format while you this call is setting + * the channel map. + * + * \param stream the SDL_AudioStream to change. + * \param chmap the new channel map, NULL to reset to default. + * \param count The number of channels in the map. + * \returns 0 on success, -1 on error. + * + * \threadsafety It is safe to call this function from any thread, as it holds + * a stream-specific mutex while running. Don't change the + * stream's format to have a different number of channels from a + * a different thread at the same time, though! + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetAudioStreamInputChannelMap + */ +extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int count); /** * Add data to the stream. @@ -1505,7 +1664,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream) * Also unlike other functions, the audio device begins paused. This is to map * more closely to SDL2-style behavior, since there is no extra step here to * bind a stream to begin audio flowing. The audio device should be resumed - * with `SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(stream));` + * with `SDL_ResumeAudioStreamDevice(stream);` * * This function works with both playback and recording devices. * @@ -1547,7 +1706,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream) * \since This function is available since SDL 3.0.0. * * \sa SDL_GetAudioStreamDevice - * \sa SDL_ResumeAudioDevice + * \sa SDL_ResumeAudioStreamDevice */ extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata); diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 4a3c7281f6aca..9d63bcfaaf54c 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -167,6 +167,16 @@ static int GetDefaultSampleFramesFromFreq(const int freq) } } +int *SDL_ChannelMapDup(const int *origchmap, int channels) +{ + const size_t chmaplen = sizeof (*origchmap) * channels; + int *chmap = (int *) SDL_malloc(chmaplen); + if (chmap) { + SDL_memcpy(chmap, origchmap, chmaplen); + } + return chmap; +} + void OnAudioStreamCreated(SDL_AudioStream *stream) { SDL_assert(stream != NULL); @@ -243,17 +253,18 @@ static void UpdateAudioStreamFormatsPhysical(SDL_AudioDevice *device) // SDL_SetAudioStreamFormat does a ton of validation just to memcpy an audiospec. SDL_LockMutex(stream->lock); SDL_copyp(&stream->dst_spec, &spec); + SDL_SetAudioStreamOutputChannelMap(stream, device->chmap, spec.channels); // this should be fast for normal cases, though! SDL_UnlockMutex(stream->lock); } } } } -SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b) +SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b, const int *channel_map_a, const int *channel_map_b) { - if ((a->format != b->format) || (a->channels != b->channels) || (a->freq != b->freq) || (a->use_channel_map != b->use_channel_map)) { + if ((a->format != b->format) || (a->channels != b->channels) || (a->freq != b->freq) || ((channel_map_a != NULL) != (channel_map_b != NULL))) { return SDL_FALSE; - } else if (a->use_channel_map && (SDL_memcmp(a->channel_map, b->channel_map, sizeof (a->channel_map[0]) * a->channels) != 0)) { + } else if (channel_map_a && (SDL_memcmp(channel_map_a, channel_map_b, sizeof (*channel_map_a) * a->channels) != 0)) { return SDL_FALSE; } return SDL_TRUE; @@ -533,6 +544,7 @@ static void DestroyPhysicalAudioDevice(SDL_AudioDevice *device) SDL_DestroyMutex(device->lock); SDL_DestroyCondition(device->close_cond); SDL_free(device->work_buffer); + SDL_FreeLater(device->chmap); // this pointer is handed to the app during SDL_GetAudioDeviceChannelMap SDL_FreeLater(device->name); // this pointer is handed to the app during SDL_GetAudioDeviceName SDL_free(device); } @@ -648,7 +660,6 @@ SDL_AudioDevice *SDL_AddAudioDevice(SDL_bool recording, const char *name, const spec.channels = default_channels; spec.freq = default_freq; } else { - SDL_assert(!inspec->use_channel_map); // backends shouldn't set a channel map here! Set it when opening the device! spec.format = (inspec->format != 0) ? inspec->format : default_format; spec.channels = (inspec->channels != 0) ? inspec->channels : default_channels; spec.freq = (inspec->freq != 0) ? inspec->freq : default_freq; @@ -1101,7 +1112,7 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) SDL_AudioStream *stream = logdev->bound_streams; // We should have updated this elsewhere if the format changed! - SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &device->spec)); + SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &device->spec, stream->dst_chmap, device->chmap)); const int br = SDL_AtomicGet(&logdev->paused) ? 0 : SDL_GetAudioStreamDataAdjustGain(stream, device_buffer, buffer_size, logdev->gain); if (br < 0) { // Probably OOM. Kill the audio device; the whole thing is likely dying soon anyhow. @@ -1137,7 +1148,7 @@ SDL_bool SDL_PlaybackAudioThreadIterate(SDL_AudioDevice *device) for (SDL_AudioStream *stream = logdev->bound_streams; stream; stream = stream->next_binding) { // We should have updated this elsewhere if the format changed! - SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &outspec)); + SDL_assert(SDL_AudioSpecsEqual(&stream->dst_spec, &outspec, stream->dst_chmap, device->chmap)); /* this will hold a lock on `stream` while getting. We don't explicitly lock the streams for iterating here because the binding linked list can only change while the device lock is held. @@ -1448,6 +1459,25 @@ int SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int * return retval; } +const int *SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count) +{ + const int *retval = NULL; + int channels = 0; + SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid); + if (device) { + retval = device->chmap; + channels = device->spec.channels; + } + ReleaseAudioDevice(device); + + if (count) { + *count = channels; + } + + return retval; +} + + // this is awkward, but this makes sure we can release the device lock // so the device thread can terminate but also not have two things // race to close or open the device while the lock is unprotected. @@ -1618,7 +1648,6 @@ static int OpenPhysicalAudioDevice(SDL_AudioDevice *device, const SDL_AudioSpec device->spec.format = (SDL_AUDIO_BITSIZE(device->default_spec.format) >= SDL_AUDIO_BITSIZE(spec.format)) ? device->default_spec.format : spec.format; device->spec.freq = SDL_max(device->default_spec.freq, spec.freq); device->spec.channels = SDL_max(device->default_spec.channels, spec.channels); - device->spec.use_channel_map = SDL_FALSE; // all initial channel map requests are denied, since we might have to change channel counts. device->sample_frames = GetDefaultSampleFramesFromFreq(device->spec.freq); SDL_UpdatedAudioDeviceFormat(device); // start this off sane. @@ -1906,6 +1935,7 @@ int SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int if (logdev->postmix) { stream->src_spec.format = SDL_AUDIO_F32; } + SDL_SetAudioStreamInputChannelMap(stream, device->chmap, device->spec.channels); // this should be fast for normal cases, though! } SDL_UnlockMutex(stream->lock); @@ -2208,7 +2238,8 @@ void SDL_DefaultAudioDeviceChanged(SDL_AudioDevice *new_default_device) } if (needs_migration) { - const SDL_bool spec_changed = !SDL_AudioSpecsEqual(¤t_default_device->spec, &new_default_device->spec); + // we don't currently report channel map changes, so we'll leave them as NULL for now. + const SDL_bool spec_changed = !SDL_AudioSpecsEqual(¤t_default_device->spec, &new_default_device->spec, NULL, NULL); SDL_LogicalAudioDevice *next = NULL; for (SDL_LogicalAudioDevice *logdev = current_default_device->logical_devices; logdev; logdev = next) { next = logdev->next; @@ -2288,7 +2319,8 @@ int SDL_AudioDeviceFormatChangedAlreadyLocked(SDL_AudioDevice *device, const SDL { const int orig_work_buffer_size = device->work_buffer_size; - if (SDL_AudioSpecsEqual(&device->spec, newspec) && (new_sample_frames == device->sample_frames)) { + // we don't currently have any place where channel maps change from under you, but we can check that if necessary later. + if (SDL_AudioSpecsEqual(&device->spec, newspec, NULL, NULL) && (new_sample_frames == device->sample_frames)) { return 0; // we're already in that format. } diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 29cd63dc6d4db..3da7543ceb805 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -124,11 +124,12 @@ static SDL_bool SDL_IsSupportedChannelCount(const int channels) return ((channels >= 1) && (channels <= 8)); } -SDL_bool SDL_ChannelMapIsBogus(const Uint8 *map, int channels) +SDL_bool SDL_ChannelMapIsBogus(const int *chmap, int channels) { - if (map) { + if (chmap) { for (int i = 0; i < channels; i++) { - if (map[i] >= ((Uint8) channels)) { + const int mapping = chmap[i]; + if ((mapping < 0) || (mapping >= channels)) { return SDL_TRUE; } } @@ -136,11 +137,11 @@ SDL_bool SDL_ChannelMapIsBogus(const Uint8 *map, int channels) return SDL_FALSE; } -SDL_bool SDL_ChannelMapIsDefault(const Uint8 *map, int channels) +SDL_bool SDL_ChannelMapIsDefault(const int *chmap, int channels) { - if (map) { + if (chmap) { for (int i = 0; i < channels; i++) { - if (map[i] != i) { + if (chmap[i] != i) { return SDL_FALSE; } } @@ -149,7 +150,7 @@ SDL_bool SDL_ChannelMapIsDefault(const Uint8 *map, int channels) } // Swizzle audio channels. src and dst can be the same pointer. It does not change the buffer size. -static void SwizzleAudio(const int num_frames, void *dst, const void *src, int channels, const Uint8 *map, int bitsize) +static void SwizzleAudio(const int num_frames, void *dst, const void *src, int channels, const int *map, int bitsize) { #define CHANNEL_SWIZZLE(bits) { \ Uint##bits *tdst = (Uint##bits *) dst; /* treat as UintX; we only care about moving bits and not the type here. */ \ @@ -161,16 +162,18 @@ static void SwizzleAudio(const int num_frames, void *dst, const void *src, int c } \ } \ } else { \ - Uint##bits tmp[SDL_MAX_CHANNEL_MAP_SIZE]; \ - SDL_zeroa(tmp); \ - SDL_assert(SDL_arraysize(tmp) >= channels); \ - for (int i = 0; i < num_frames; i++, tsrc += channels, tdst += channels) { \ - for (int ch = 0; ch < channels; ch++) { \ - tmp[ch] = tsrc[map[ch]]; \ - } \ - for (int ch = 0; ch < channels; ch++) { \ - tdst[ch] = tmp[ch]; \ + SDL_bool isstack; \ + Uint##bits *tmp = (Uint##bits *) SDL_small_alloc(int, channels, &isstack); /* !!! FIXME: allocate this when setting the channel map instead. */ \ + if (tmp) { \ + for (int i = 0; i < num_frames; i++, tsrc += channels, tdst += channels) { \ + for (int ch = 0; ch < channels; ch++) { \ + tmp[ch] = tsrc[map[ch]]; \ + } \ + for (int ch = 0; ch < channels; ch++) { \ + tdst[ch] = tmp[ch]; \ + } \ } \ + SDL_small_free(tmp, isstack); \ } \ } \ } @@ -199,8 +202,8 @@ static void SwizzleAudio(const int num_frames, void *dst, const void *src, int c // we also handle gain adjustment here, so we don't have to make another pass over the data later. // Strictly speaking, this is also a "conversion". :) void ConvertAudio(int num_frames, - const void *src, SDL_AudioFormat src_format, int src_channels, const Uint8 *src_map, - void *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, + const void *src, SDL_AudioFormat src_format, int src_channels, const int *src_map, + void *dst, SDL_AudioFormat dst_format, int dst_channels, const int *dst_map, void* scratch, float gain) { SDL_assert(src != NULL); @@ -374,9 +377,9 @@ static Sint64 GetAudioStreamResampleRate(SDL_AudioStream* stream, int src_freq, return resample_rate; } -static int UpdateAudioStreamInputSpec(SDL_AudioStream *stream, const SDL_AudioSpec *spec) +static int UpdateAudioStreamInputSpec(SDL_AudioStream *stream, const SDL_AudioSpec *spec, const int *chmap) { - if (SDL_AudioSpecsEqual(&stream->input_spec, spec)) { + if (SDL_AudioSpecsEqual(&stream->input_spec, spec, stream->input_chmap, chmap)) { return 0; } @@ -384,6 +387,14 @@ static int UpdateAudioStreamInputSpec(SDL_AudioStream *stream, const SDL_AudioSp return -1; } + if (!chmap) { + stream->input_chmap = NULL; + } else { + const size_t chmaplen = sizeof (*chmap) * spec->channels; + stream->input_chmap = stream->input_chmap_storage; + SDL_memcpy(stream->input_chmap, chmap, chmaplen); + } + SDL_copyp(&stream->input_spec, spec); return 0; @@ -524,8 +535,6 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s return SDL_SetError("Source rate is too low"); } else if (src_spec->freq > max_freq) { return SDL_SetError("Source rate is too high"); - } else if (src_spec->use_channel_map && SDL_ChannelMapIsBogus(src_spec->channel_map, src_spec->channels)) { - return SDL_SetError("Source channel map is invalid"); } } @@ -540,8 +549,6 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s return SDL_SetError("Destination rate is too low"); } else if (dst_spec->freq > max_freq) { return SDL_SetError("Destination rate is too high"); - } else if (dst_spec->use_channel_map && SDL_ChannelMapIsBogus(dst_spec->channel_map, dst_spec->channels)) { - return SDL_SetError("Destination channel map is invalid"); } } @@ -557,27 +564,114 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s } if (src_spec) { - SDL_copyp(&stream->src_spec, src_spec); - if (src_spec->use_channel_map && SDL_ChannelMapIsDefault(src_spec->channel_map, src_spec->channels)) { - stream->src_spec.use_channel_map = SDL_FALSE; // turn off the channel map, as this is just unnecessary work. + if (src_spec->channels != stream->src_spec.channels) { + SDL_FreeLater(stream->src_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + stream->src_chmap = NULL; } + SDL_copyp(&stream->src_spec, src_spec); } if (dst_spec) { - SDL_copyp(&stream->dst_spec, dst_spec); - if (dst_spec->use_channel_map && !stream->src_spec.use_channel_map && SDL_ChannelMapIsDefault(dst_spec->channel_map, dst_spec->channels)) { - stream->dst_spec.use_channel_map = SDL_FALSE; // turn off the channel map, as this is just unnecessary work. + if (dst_spec->channels != stream->dst_spec.channels) { + SDL_FreeLater(stream->dst_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + stream->dst_chmap = NULL; } + SDL_copyp(&stream->dst_spec, dst_spec); } - // !!! FIXME: decide if the source and dest channel maps would swizzle us back to the starting order and just turn them both off. - // !!! FIXME: (but in this case, you can only do it if the channel count isn't changing, because source order is important to that.) - SDL_UnlockMutex(stream->lock); return 0; } +static int SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec, int **stream_chmap, const int *chmap, int channels, SDL_bool isinput) +{ + if (!stream) { + return SDL_InvalidParamError("stream"); + } + + int retval = 0; + + SDL_LockMutex(stream->lock); + + if (channels != spec->channels) { + retval = SDL_SetError("Wrong number of channels"); + } else if (!*stream_chmap && !chmap) { + // already at default, we're good. + } else if (*stream_chmap && chmap && (SDL_memcmp(*stream_chmap, chmap, sizeof (*chmap) * channels) == 0)) { + // already have this map, don't allocate/copy it again. + } else if (SDL_ChannelMapIsBogus(chmap, channels)) { + retval = SDL_SetError("Invalid channel mapping"); + } else if (stream->bound_device && (!!isinput == !!stream->bound_device->physical_device->recording)) { + // quietly refuse to change the format of the end currently bound to a device. + } else { + if (SDL_ChannelMapIsDefault(chmap, channels)) { + chmap = NULL; // just apply a default mapping. + } + if (chmap) { + int *dupmap = SDL_ChannelMapDup(chmap, channels); + if (!dupmap) { + retval = SDL_SetError("Invalid channel mapping"); + } else { + SDL_FreeLater(*stream_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + *stream_chmap = dupmap; + } + } else { + SDL_FreeLater(*stream_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + *stream_chmap = NULL; + } + } + + SDL_UnlockMutex(stream->lock); + return retval; +} + +int SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels) +{ + return SetAudioStreamChannelMap(stream, &stream->src_spec, &stream->src_chmap, chmap, channels, SDL_TRUE); +} + +int SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels) +{ + return SetAudioStreamChannelMap(stream, &stream->dst_spec, &stream->dst_chmap, chmap, channels, SDL_FALSE); +} + +const int *SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count) +{ + const int *retval = NULL; + int channels = 0; + if (stream) { + SDL_LockMutex(stream->lock); + retval = stream->src_chmap; + channels = stream->src_spec.channels; + SDL_UnlockMutex(stream->lock); + } + + if (count) { + *count = channels; + } + + return retval; +} + +const int *SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *count) +{ + const int *retval = NULL; + int channels = 0; + if (stream) { + SDL_LockMutex(stream->lock); + retval = stream->dst_chmap; + channels = stream->dst_spec.channels; + SDL_UnlockMutex(stream->lock); + } + + if (count) { + *count = channels; + } + + return retval; +} + float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream) { if (!stream) { @@ -676,7 +770,7 @@ static int PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int le SDL_AudioTrack* track = NULL; if (callback) { - track = SDL_CreateAudioTrack(stream->queue, &stream->src_spec, (Uint8 *)buf, len, len, callback, userdata); + track = SDL_CreateAudioTrack(stream->queue, &stream->src_spec, stream->src_chmap, (Uint8 *)buf, len, len, callback, userdata); if (!track) { SDL_UnlockMutex(stream->lock); @@ -691,7 +785,7 @@ static int PutAudioStreamBuffer(SDL_AudioStream *stream, const void *buf, int le if (track) { SDL_AddTrackToAudioQueue(stream->queue, track); } else { - retval = SDL_WriteToAudioQueue(stream->queue, &stream->src_spec, (const Uint8 *)buf, len); + retval = SDL_WriteToAudioQueue(stream->queue, &stream->src_spec, stream->src_chmap, (const Uint8 *)buf, len); } if (retval == 0) { @@ -782,16 +876,21 @@ static Uint8 *EnsureAudioStreamWorkBufferSize(SDL_AudioStream *stream, size_t ne } static Sint64 NextAudioStreamIter(SDL_AudioStream* stream, void** inout_iter, - Sint64* inout_resample_offset, SDL_AudioSpec* out_spec, SDL_bool* out_flushed) + Sint64* inout_resample_offset, SDL_AudioSpec* out_spec, int **out_chmap, SDL_bool* out_flushed) { SDL_AudioSpec spec; SDL_bool flushed; - size_t queued_bytes = SDL_NextAudioQueueIter(stream->queue, inout_iter, &spec, &flushed); + int *chmap; + size_t queued_bytes = SDL_NextAudioQueueIter(stream->queue, inout_iter, &spec, &chmap, &flushed); if (out_spec) { SDL_copyp(out_spec, &spec); } + if (out_chmap) { + *out_chmap = chmap; + } + // There is infinite audio available, whether or not we are resampling if (queued_bytes == SDL_SIZE_MAX) { *inout_resample_offset = 0; @@ -839,7 +938,7 @@ static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out Sint64 output_frames = 0; while (iter) { - output_frames += NextAudioStreamIter(stream, &iter, &resample_offset, NULL, NULL); + output_frames += NextAudioStreamIter(stream, &iter, &resample_offset, NULL, NULL, NULL); // Already got loads of frames. Just clamp it to something reasonable if (output_frames >= SDL_MAX_SINT32) { @@ -855,7 +954,7 @@ static Sint64 GetAudioStreamAvailableFrames(SDL_AudioStream* stream, Sint64* out return output_frames; } -static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spec, SDL_bool* out_flushed) +static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spec, int **out_chmap, SDL_bool* out_flushed) { void* iter = SDL_BeginAudioQueueIter(stream->queue); @@ -866,7 +965,7 @@ static Sint64 GetAudioStreamHead(SDL_AudioStream* stream, SDL_AudioSpec* out_spe } Sint64 resample_offset = stream->resample_offset; - return NextAudioStreamIter(stream, &iter, &resample_offset, out_spec, out_flushed); + return NextAudioStreamIter(stream, &iter, &resample_offset, out_spec, out_chmap, out_flushed); } // You must hold stream->lock and validate your parameters before calling this! @@ -881,7 +980,7 @@ static int GetAudioStreamDataInternal(SDL_AudioStream *stream, void *buf, int ou const SDL_AudioFormat dst_format = dst_spec->format; const int dst_channels = dst_spec->channels; - const Uint8 *dst_map = dst_spec->use_channel_map ? dst_spec->channel_map : NULL; + const int *dst_map = stream->dst_chmap; const int max_frame_size = CalculateMaxFrameSize(src_format, src_channels, dst_format, dst_channels); const Sint64 resample_rate = GetAudioStreamResampleRate(stream, src_spec->freq, stream->resample_offset); @@ -1061,21 +1160,23 @@ int SDL_GetAudioStreamDataAdjustGain(SDL_AudioStream *stream, void *voidbuf, int while (total < len) { // Audio is processed a track at a time. SDL_AudioSpec input_spec; + int *input_chmap; SDL_bool flushed; - const Sint64 available_frames = GetAudioStreamHead(stream, &input_spec, &flushed); + const Sint64 available_frames = GetAudioStreamHead(stream, &input_spec, &input_chmap, &flushed); if (available_frames == 0) { if (flushed) { SDL_PopAudioQueueHead(stream->queue); SDL_zero(stream->input_spec); stream->resample_offset = 0; + stream->input_chmap = NULL; continue; } // There are no frames available, but the track hasn't been flushed, so more might be added later. break; } - if (UpdateAudioStreamInputSpec(stream, &input_spec) != 0) { + if (UpdateAudioStreamInputSpec(stream, &input_spec, input_chmap) != 0) { total = total ? total : -1; break; } @@ -1160,6 +1261,7 @@ int SDL_ClearAudioStream(SDL_AudioStream *stream) SDL_ClearAudioQueue(stream->queue); SDL_zero(stream->input_spec); + stream->input_chmap = NULL; stream->resample_offset = 0; SDL_UnlockMutex(stream->lock); diff --git a/src/audio/SDL_audioqueue.c b/src/audio/SDL_audioqueue.c index e9110b5ac05f2..29b407793038b 100644 --- a/src/audio/SDL_audioqueue.c +++ b/src/audio/SDL_audioqueue.c @@ -36,6 +36,7 @@ struct SDL_MemoryPool struct SDL_AudioTrack { SDL_AudioSpec spec; + int *chmap; SDL_bool flushed; SDL_AudioTrack *next; @@ -46,6 +47,8 @@ struct SDL_AudioTrack size_t head; size_t tail; size_t capacity; + + int chmap_storage[SDL_MAX_CHANNELMAP_CHANNELS]; // !!! FIXME: this needs to grow if SDL ever supports more channels. But if it grows, we should probably be more clever about allocations. }; struct SDL_AudioQueue @@ -226,7 +229,7 @@ void SDL_PopAudioQueueHead(SDL_AudioQueue *queue) } SDL_AudioTrack *SDL_CreateAudioTrack( - SDL_AudioQueue *queue, const SDL_AudioSpec *spec, + SDL_AudioQueue *queue, const SDL_AudioSpec *spec, const int *chmap, Uint8 *data, size_t len, size_t capacity, SDL_ReleaseAudioBufferCallback callback, void *userdata) { @@ -237,6 +240,13 @@ SDL_AudioTrack *SDL_CreateAudioTrack( } SDL_zerop(track); + + if (chmap) { + SDL_assert(SDL_arraysize(track->chmap_storage) >= spec->channels); + SDL_memcpy(track->chmap_storage, chmap, sizeof (*chmap) * spec->channels); + track->chmap = track->chmap_storage; + } + SDL_copyp(&track->spec, spec); track->userdata = userdata; @@ -256,7 +266,7 @@ static void SDLCALL FreeChunkedAudioBuffer(void *userdata, const void *buf, int FreeMemoryPoolBlock(&queue->chunk_pool, (void *)buf); } -static SDL_AudioTrack *CreateChunkedAudioTrack(SDL_AudioQueue *queue, const SDL_AudioSpec *spec) +static SDL_AudioTrack *CreateChunkedAudioTrack(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, const int *chmap) { void *chunk = AllocMemoryPoolBlock(&queue->chunk_pool); @@ -267,7 +277,7 @@ static SDL_AudioTrack *CreateChunkedAudioTrack(SDL_AudioQueue *queue, const SDL_ size_t capacity = queue->chunk_pool.block_size; capacity -= capacity % SDL_AUDIO_FRAMESIZE(*spec); - SDL_AudioTrack *track = SDL_CreateAudioTrack(queue, spec, chunk, 0, capacity, FreeChunkedAudioBuffer, queue); + SDL_AudioTrack *track = SDL_CreateAudioTrack(queue, spec, chmap, chunk, 0, capacity, FreeChunkedAudioBuffer, queue); if (!track) { FreeMemoryPoolBlock(&queue->chunk_pool, chunk); @@ -283,7 +293,7 @@ void SDL_AddTrackToAudioQueue(SDL_AudioQueue *queue, SDL_AudioTrack *track) if (tail) { // If the spec has changed, make sure to flush the previous track - if (!SDL_AudioSpecsEqual(&tail->spec, &track->spec)) { + if (!SDL_AudioSpecsEqual(&tail->spec, &track->spec, tail->chmap, track->chmap)) { FlushAudioTrack(tail); } @@ -308,7 +318,7 @@ static size_t WriteToAudioTrack(SDL_AudioTrack *track, const Uint8 *data, size_t return len; } -int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, const Uint8 *data, size_t len) +int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, const int *chmap, const Uint8 *data, size_t len) { if (len == 0) { return 0; @@ -317,12 +327,12 @@ int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, cons SDL_AudioTrack *track = queue->tail; if (track) { - if (!SDL_AudioSpecsEqual(&track->spec, spec)) { + if (!SDL_AudioSpecsEqual(&track->spec, spec, track->chmap, chmap)) { FlushAudioTrack(track); } } else { SDL_assert(!queue->head); - track = CreateChunkedAudioTrack(queue, spec); + track = CreateChunkedAudioTrack(queue, spec, chmap); if (!track) { return -1; @@ -333,7 +343,7 @@ int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, cons } for (;;) { - size_t written = WriteToAudioTrack(track, data, len); + const size_t written = WriteToAudioTrack(track, data, len); data += written; len -= written; @@ -341,7 +351,7 @@ int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, cons break; } - SDL_AudioTrack *new_track = CreateChunkedAudioTrack(queue, spec); + SDL_AudioTrack *new_track = CreateChunkedAudioTrack(queue, spec, chmap); if (!new_track) { return -1; @@ -360,12 +370,13 @@ void *SDL_BeginAudioQueueIter(SDL_AudioQueue *queue) return queue->head; } -size_t SDL_NextAudioQueueIter(SDL_AudioQueue *queue, void **inout_iter, SDL_AudioSpec *out_spec, SDL_bool *out_flushed) +size_t SDL_NextAudioQueueIter(SDL_AudioQueue *queue, void **inout_iter, SDL_AudioSpec *out_spec, int **out_chmap, SDL_bool *out_flushed) { SDL_AudioTrack *iter = (SDL_AudioTrack *)(*inout_iter); SDL_assert(iter != NULL); SDL_copyp(out_spec, &iter->spec); + *out_chmap = iter->chmap; SDL_bool flushed = SDL_FALSE; size_t queued_bytes = 0; @@ -512,7 +523,7 @@ static const Uint8 *PeekIntoAudioQueueFuture(SDL_AudioQueue *queue, Uint8 *data, } const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, - Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, + Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const int *dst_map, int past_frames, int present_frames, int future_frames, Uint8 *scratch, float gain) { @@ -524,7 +535,7 @@ const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, SDL_AudioFormat src_format = track->spec.format; int src_channels = track->spec.channels; - const Uint8 *src_map = track->spec.use_channel_map ? track->spec.channel_map : NULL; + const int *src_map = track->chmap; size_t src_frame_size = SDL_AUDIO_BYTESIZE(src_format) * src_channels; size_t dst_frame_size = SDL_AUDIO_BYTESIZE(dst_format) * dst_channels; @@ -597,9 +608,10 @@ size_t SDL_GetAudioQueueQueued(SDL_AudioQueue *queue) while (iter) { SDL_AudioSpec src_spec; + int *src_chmap; SDL_bool flushed; - size_t avail = SDL_NextAudioQueueIter(queue, &iter, &src_spec, &flushed); + size_t avail = SDL_NextAudioQueueIter(queue, &iter, &src_spec, &src_chmap, &flushed); if (avail >= SDL_SIZE_MAX - total) { total = SDL_SIZE_MAX; diff --git a/src/audio/SDL_audioqueue.h b/src/audio/SDL_audioqueue.h index 46dce2d19b659..88d6972f1bac8 100644 --- a/src/audio/SDL_audioqueue.h +++ b/src/audio/SDL_audioqueue.h @@ -48,11 +48,11 @@ void SDL_PopAudioQueueHead(SDL_AudioQueue *queue); // Write data to the end of queue // REQUIRES: If the spec has changed, the last track must have been flushed -int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, const Uint8 *data, size_t len); +int SDL_WriteToAudioQueue(SDL_AudioQueue *queue, const SDL_AudioSpec *spec, const int *chmap, const Uint8 *data, size_t len); // Create a track where the input data is owned by the caller SDL_AudioTrack *SDL_CreateAudioTrack(SDL_AudioQueue *queue, - const SDL_AudioSpec *spec, Uint8 *data, size_t len, size_t capacity, + const SDL_AudioSpec *spec, const int *chmap, Uint8 *data, size_t len, size_t capacity, SDL_ReleaseAudioBufferCallback callback, void *userdata); // Add a track to the end of the queue @@ -64,10 +64,10 @@ void *SDL_BeginAudioQueueIter(SDL_AudioQueue *queue); // Query and update the track iterator // REQUIRES: `*inout_iter != NULL` (a valid iterator) -size_t SDL_NextAudioQueueIter(SDL_AudioQueue *queue, void **inout_iter, SDL_AudioSpec *out_spec, SDL_bool *out_flushed); +size_t SDL_NextAudioQueueIter(SDL_AudioQueue *queue, void **inout_iter, SDL_AudioSpec *out_spec, int **out_chmap, SDL_bool *out_flushed); const Uint8 *SDL_ReadFromAudioQueue(SDL_AudioQueue *queue, - Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, + Uint8 *dst, SDL_AudioFormat dst_format, int dst_channels, const int *dst_map, int past_frames, int present_frames, int future_frames, Uint8 *scratch, float gain); diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index b5c2335e2ca07..20ca908574a4f 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -48,6 +48,8 @@ #define DEFAULT_AUDIO_RECORDING_CHANNELS 1 #define DEFAULT_AUDIO_RECORDING_FREQUENCY 44100 +#define SDL_MAX_CHANNELMAP_CHANNELS 8 // !!! FIXME: if SDL ever supports more channels, clean this out and make those parts dynamic. + typedef struct SDL_AudioDevice SDL_AudioDevice; typedef struct SDL_LogicalAudioDevice SDL_LogicalAudioDevice; @@ -111,18 +113,22 @@ extern void ConvertAudioToFloat(float *dst, const void *src, int num_samples, SD extern void ConvertAudioFromFloat(void *dst, const float *src, int num_samples, SDL_AudioFormat dst_fmt); extern void ConvertAudioSwapEndian(void* dst, const void* src, int num_samples, int bitsize); -extern SDL_bool SDL_ChannelMapIsDefault(const Uint8 *map, int channels); -extern SDL_bool SDL_ChannelMapIsBogus(const Uint8 *map, int channels); +extern SDL_bool SDL_ChannelMapIsDefault(const int *map, int channels); +extern SDL_bool SDL_ChannelMapIsBogus(const int *map, int channels); // this gets used from the audio device threads. It has rules, don't use this if you don't know how to use it! extern void ConvertAudio(int num_frames, - const void *src, SDL_AudioFormat src_format, int src_channels, const Uint8 *src_map, - void *dst, SDL_AudioFormat dst_format, int dst_channels, const Uint8 *dst_map, + const void *src, SDL_AudioFormat src_format, int src_channels, const int *src_map, + void *dst, SDL_AudioFormat dst_format, int dst_channels, const int *dst_map, void* scratch, float gain); // Compare two SDL_AudioSpecs, return SDL_TRUE if they match exactly. -// Using SDL_memcmp directly isn't safe, since potential padding (and unused parts of the channel map) might not be initialized. -extern SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b); +// Using SDL_memcmp directly isn't safe, since potential padding might not be initialized. +// either channel maps can be NULL for the default (and both should be if you don't care about them). +extern SDL_bool SDL_AudioSpecsEqual(const SDL_AudioSpec *a, const SDL_AudioSpec *b, const int *channel_map_a, const int *channel_map_b); + +// allocate+copy a channel map. +extern int *SDL_ChannelMapDup(const int *origchmap, int channels); // Special case to let something in SDL_audiocvt.c access something in SDL_audio.c. Don't use this. extern void OnAudioStreamCreated(SDL_AudioStream *stream); @@ -197,12 +203,16 @@ struct SDL_AudioStream SDL_AudioSpec src_spec; SDL_AudioSpec dst_spec; + int *src_chmap; + int *dst_chmap; float freq_ratio; float gain; struct SDL_AudioQueue* queue; SDL_AudioSpec input_spec; // The spec of input data currently being processed + int *input_chmap; + int input_chmap_storage[SDL_MAX_CHANNELMAP_CHANNELS]; // !!! FIXME: this needs to grow if SDL ever supports more channels. But if it grows, we should probably be more clever about allocations. Sint64 resample_offset; Uint8 *work_buffer; // used for scratch space during data conversion/resampling. @@ -288,6 +298,8 @@ struct SDL_AudioDevice SDL_AudioSpec spec; int buffer_size; + int *chmap; + // The device's default audio specification SDL_AudioSpec default_spec; diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c index 07a4849709e30..e2827f418d4b1 100644 --- a/src/audio/alsa/SDL_alsa_audio.c +++ b/src/audio/alsa/SDL_alsa_audio.c @@ -249,13 +249,13 @@ static const char *get_audio_device(void *handle, const int channels) // https://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" -static const Uint8 swizzle_alsa_channels_6[6] = { 0, 1, 4, 5, 2, 3 }; +static const int swizzle_alsa_channels_6[6] = { 0, 1, 4, 5, 2, 3 }; // 7.1 swizzle: // https://docs.microsoft.com/en-us/windows-hardware/drivers/audio/mapping-stream-formats-to-speaker-configurations // For Linux ALSA, this appears to be FL-FR-RL-RR-C-LFE-SL-SR // and for Windows DirectX [and CoreAudio], this is FL-FR-C-LFE-SL-SR-RL-RR" -static const Uint8 swizzle_alsa_channels_8[8] = { 0, 1, 6, 7, 2, 3, 4, 5 }; +static const int swizzle_alsa_channels_8[8] = { 0, 1, 6, 7, 2, 3, 4, 5 }; @@ -533,33 +533,41 @@ static int ALSA_OpenDevice(SDL_AudioDevice *device) device->spec.channels = channels; } - // Validate number of channels and determine if swizzling is necessary. - // Assume original swizzling, until proven otherwise. + const int *swizmap = NULL; if (channels == 6) { - device->spec.use_channel_map = SDL_TRUE; - SDL_memcpy(device->spec.channel_map, swizzle_alsa_channels_6, sizeof (device->spec.channel_map[0]) * channels); + swizmap = swizzle_alsa_channels_6; } else if (channels == 8) { - device->spec.use_channel_map = SDL_TRUE; - SDL_memcpy(device->spec.channel_map, swizzle_alsa_channels_8, sizeof (device->spec.channel_map[0]) * channels); + swizmap = swizzle_alsa_channels_8; } #ifdef SND_CHMAP_API_VERSION - snd_pcm_chmap_t *chmap = ALSA_snd_pcm_get_chmap(pcm_handle); - if (chmap) { - char chmap_str[64]; - if (ALSA_snd_pcm_chmap_print(chmap, sizeof(chmap_str), chmap_str) > 0) { - if ( (channels == 6) && - ((SDL_strcmp("FL FR FC LFE RL RR", chmap_str) == 0) || - (SDL_strcmp("FL FR FC LFE SL SR", chmap_str) == 0)) ) { - device->spec.use_channel_map = SDL_FALSE; - } else if ((channels == 8) && (SDL_strcmp("FL FR FC LFE SL SR RL RR", chmap_str) == 0)) { - device->spec.use_channel_map = SDL_FALSE; + if (swizmap) { + snd_pcm_chmap_t *chmap = ALSA_snd_pcm_get_chmap(pcm_handle); + if (chmap) { + char chmap_str[64]; + if (ALSA_snd_pcm_chmap_print(chmap, sizeof(chmap_str), chmap_str) > 0) { + if ( (channels == 6) && + ((SDL_strcmp("FL FR FC LFE RL RR", chmap_str) == 0) || + (SDL_strcmp("FL FR FC LFE SL SR", chmap_str) == 0)) ) { + swizmap = NULL; + } else if ((channels == 8) && (SDL_strcmp("FL FR FC LFE SL SR RL RR", chmap_str) == 0)) { + swizmap = NULL; + } } + free(chmap); // This should NOT be SDL_free() } - free(chmap); // This should NOT be SDL_free() } #endif // SND_CHMAP_API_VERSION + // Validate number of channels and determine if swizzling is necessary. + // Assume original swizzling, until proven otherwise. + if (swizmap) { + device->chmap = SDL_ChannelMapDup(swizmap, channels); + if (!device->chmap) { + return -1; + } + } + // Set the audio rate unsigned int rate = device->spec.freq; status = ALSA_snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index d42716d85887e..79aec801d97fc 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -165,6 +165,7 @@ SDL3_0.0.0 { SDL_GetAndroidSDKVersion; SDL_GetAssertionHandler; SDL_GetAssertionReport; + SDL_GetAudioDeviceChannelMap; SDL_GetAudioDeviceFormat; SDL_GetAudioDeviceGain; SDL_GetAudioDeviceName; @@ -177,6 +178,8 @@ SDL3_0.0.0 { SDL_GetAudioStreamFormat; SDL_GetAudioStreamFrequencyRatio; SDL_GetAudioStreamGain; + SDL_GetAudioStreamInputChannelMap; + SDL_GetAudioStreamOutputChannelMap; SDL_GetAudioStreamProperties; SDL_GetAudioStreamQueued; SDL_GetBasePath; @@ -693,6 +696,8 @@ SDL3_0.0.0 { SDL_SetAudioStreamFrequencyRatio; SDL_SetAudioStreamGain; SDL_SetAudioStreamGetCallback; + SDL_SetAudioStreamInputChannelMap; + SDL_SetAudioStreamOutputChannelMap; SDL_SetAudioStreamPutCallback; SDL_SetBooleanProperty; SDL_SetClipboardData; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 0c593d688a6e6..6b1a00ae28699 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -189,6 +189,7 @@ #define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL #define SDL_GetAssertionHandler SDL_GetAssertionHandler_REAL #define SDL_GetAssertionReport SDL_GetAssertionReport_REAL +#define SDL_GetAudioDeviceChannelMap SDL_GetAudioDeviceChannelMap_REAL #define SDL_GetAudioDeviceFormat SDL_GetAudioDeviceFormat_REAL #define SDL_GetAudioDeviceGain SDL_GetAudioDeviceGain_REAL #define SDL_GetAudioDeviceName SDL_GetAudioDeviceName_REAL @@ -201,6 +202,8 @@ #define SDL_GetAudioStreamFormat SDL_GetAudioStreamFormat_REAL #define SDL_GetAudioStreamFrequencyRatio SDL_GetAudioStreamFrequencyRatio_REAL #define SDL_GetAudioStreamGain SDL_GetAudioStreamGain_REAL +#define SDL_GetAudioStreamInputChannelMap SDL_GetAudioStreamInputChannelMap_REAL +#define SDL_GetAudioStreamOutputChannelMap SDL_GetAudioStreamOutputChannelMap_REAL #define SDL_GetAudioStreamProperties SDL_GetAudioStreamProperties_REAL #define SDL_GetAudioStreamQueued SDL_GetAudioStreamQueued_REAL #define SDL_GetBasePath SDL_GetBasePath_REAL @@ -717,6 +720,8 @@ #define SDL_SetAudioStreamFrequencyRatio SDL_SetAudioStreamFrequencyRatio_REAL #define SDL_SetAudioStreamGain SDL_SetAudioStreamGain_REAL #define SDL_SetAudioStreamGetCallback SDL_SetAudioStreamGetCallback_REAL +#define SDL_SetAudioStreamInputChannelMap SDL_SetAudioStreamInputChannelMap_REAL +#define SDL_SetAudioStreamOutputChannelMap SDL_SetAudioStreamOutputChannelMap_REAL #define SDL_SetAudioStreamPutCallback SDL_SetAudioStreamPutCallback_REAL #define SDL_SetBooleanProperty SDL_SetBooleanProperty_REAL #define SDL_SetClipboardData SDL_SetClipboardData_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 7d03e3bf8a78b..51be63cac93ff 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -208,6 +208,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorTyp SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return) SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return) SDL_DYNAPI_PROC(const SDL_AssertData*,SDL_GetAssertionReport,(void),(),return) +SDL_DYNAPI_PROC(const int*,SDL_GetAudioDeviceChannelMap,(SDL_AudioDeviceID a, int *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetAudioDeviceFormat,(SDL_AudioDeviceID a, SDL_AudioSpec *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(float,SDL_GetAudioDeviceGain,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDeviceName,(SDL_AudioDeviceID a),(a),return) @@ -220,6 +221,8 @@ SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_GetAudioStreamDevice,(SDL_AudioStream *a), SDL_DYNAPI_PROC(int,SDL_GetAudioStreamFormat,(SDL_AudioStream *a, SDL_AudioSpec *b, SDL_AudioSpec *c),(a,b,c),return) SDL_DYNAPI_PROC(float,SDL_GetAudioStreamFrequencyRatio,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetAudioStreamGain,(SDL_AudioStream *a),(a),return) +SDL_DYNAPI_PROC(const int*,SDL_GetAudioStreamInputChannelMap,(SDL_AudioStream *a, int *b),(a,b),return) +SDL_DYNAPI_PROC(const int*,SDL_GetAudioStreamOutputChannelMap,(SDL_AudioStream *a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetAudioStreamProperties,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamQueued,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_GetBasePath,(void),(),return) @@ -727,6 +730,8 @@ SDL_DYNAPI_PROC(int,SDL_SetAudioStreamFormat,(SDL_AudioStream *a, const SDL_Audi SDL_DYNAPI_PROC(int,SDL_SetAudioStreamFrequencyRatio,(SDL_AudioStream *a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamGain,(SDL_AudioStream *a, float b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamGetCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_SetAudioStreamInputChannelMap,(SDL_AudioStream *a, const int *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_SetAudioStreamOutputChannelMap,(SDL_AudioStream *a, const int *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetAudioStreamPutCallback,(SDL_AudioStream *a, SDL_AudioStreamCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetClipboardData,(SDL_ClipboardDataCallback a, SDL_ClipboardCleanupCallback b, void *c, const char **d, size_t e),(a,b,c,d,e),return) diff --git a/test/loopwave.c b/test/loopwave.c index 9cd24fae9e86e..45bc060c83ff4 100644 --- a/test/loopwave.c +++ b/test/loopwave.c @@ -114,6 +114,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create audio stream: %s\n", SDL_GetError()); return SDL_APP_FAILURE; } + SDL_ResumeAudioStreamDevice(stream); return SDL_APP_CONTINUE; diff --git a/test/testffmpeg.c b/test/testffmpeg.c index c414bef5690f6..0adbb23e3808d 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -1167,7 +1167,7 @@ static AVCodecContext *OpenAudioStream(AVFormatContext *ic, int stream, const AV return NULL; } - SDL_AudioSpec spec = { SDL_AUDIO_F32, codecpar->ch_layout.nb_channels, codecpar->sample_rate, SDL_FALSE }; + SDL_AudioSpec spec = { SDL_AUDIO_F32, codecpar->ch_layout.nb_channels, codecpar->sample_rate }; audio = SDL_OpenAudioDeviceStream(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec, NULL, NULL); if (audio) { SDL_ResumeAudioDevice(SDL_GetAudioStreamDevice(audio)); @@ -1240,7 +1240,7 @@ static void InterleaveAudio(AVFrame *frame, const SDL_AudioSpec *spec) static void HandleAudioFrame(AVFrame *frame) { if (audio) { - SDL_AudioSpec spec = { GetAudioFormat(frame->format), frame->ch_layout.nb_channels, frame->sample_rate, SDL_FALSE }; + SDL_AudioSpec spec = { GetAudioFormat(frame->format), frame->ch_layout.nb_channels, frame->sample_rate }; SDL_SetAudioStreamFormat(audio, &spec, NULL); if (frame->ch_layout.nb_channels > 1 && IsPlanarAudioFormat(frame->format)) { From 29b007665952d7ba91a8787d3ec9c3f49920e71e Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 10 Jul 2024 19:45:01 +0000 Subject: [PATCH 233/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_audio.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 92251c92faea7..772e811a6cc72 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -45,10 +45,10 @@ * * ## Channel layouts * - * Audio data passing through SDL is uncompressed PCM data, interleaved. - * One can provide their own decompression through an MP3, etc, decoder, but - * SDL does not provide this directly. Each interleaved channel of data is - * meant to be in a specific order. + * Audio data passing through SDL is uncompressed PCM data, interleaved. One + * can provide their own decompression through an MP3, etc, decoder, but SDL + * does not provide this directly. Each interleaved channel of data is meant + * to be in a specific order. * * Abbreviations: * @@ -565,7 +565,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid * * \param devid the instance ID of the device to query. * \param count On output, set to number of channels in the map. Can be NULL. - * \returns an array of the current channel mapping, with as many elements as the current output spec's channels, or NULL if default. + * \returns an array of the current channel mapping, with as many elements as + * the current output spec's channels, or NULL if default. * * \threadsafety It is safe to call this function from any thread. * @@ -1109,7 +1110,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. - * \returns an array of the current channel mapping, with as many elements as the current output spec's channels, or NULL if default. + * \returns an array of the current channel mapping, with as many elements as + * the current output spec's channels, or NULL if default. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1134,7 +1136,8 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_Au * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. - * \returns an array of the current channel mapping, with as many elements as the current output spec's channels, or NULL if default. + * \returns an array of the current channel mapping, with as many elements as + * the current output spec's channels, or NULL if default. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1152,8 +1155,8 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_A * data in the [order that SDL expects](CategoryAudio#channel-layouts). * * The input channel map reorders data that is added to a stream via - * SDL_PutAudioStreamData. Future calls to SDL_PutAudioStreamData - * must provide data in the new channel order. + * SDL_PutAudioStreamData. Future calls to SDL_PutAudioStreamData must provide + * data in the new channel order. * * Each item in the array represents an input channel, and its value is the * channel that it should be remapped to. To reverse a stereo signal's left @@ -1175,9 +1178,9 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_A * after this call. * * If `count` is not equal to the current number of channels in the audio - * stream's format, this will fail. This is a safety measure to make sure a - * a race condition hasn't changed the format while you this call is setting - * the channel map. + * stream's format, this will fail. This is a safety measure to make sure a a + * race condition hasn't changed the format while you this call is setting the + * channel map. * * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. @@ -1221,9 +1224,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStrea * after this call. * * If `count` is not equal to the current number of channels in the audio - * stream's format, this will fail. This is a safety measure to make sure a - * a race condition hasn't changed the format while you this call is setting - * the channel map. + * stream's format, this will fail. This is a safety measure to make sure a a + * race condition hasn't changed the format while you this call is setting the + * channel map. * * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. From af2dbf3ff3688828349f5e6b6b2118a63ec04623 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 10 Jul 2024 14:50:57 -0400 Subject: [PATCH 234/431] video: Rename SDL_GL_DeleteContext to SDL_GL_DestroyContext. Turns out that there isn't a strong OpenGL naming convention for "Delete" ... WGL offers "wglDeleteContext" but the GLX equivalent is "glxDestroyContext" and then EGL sealed the deal by going with Destroy as well! Since it matches SDL3 naming conventions (Create/Destroy), we're renaming it. Fixes #10197. --- build-scripts/SDL_migration.cocci | 5 +++++ docs/README-migration.md | 3 +++ include/SDL3/SDL_oldnames.h | 2 ++ include/SDL3/SDL_video.h | 4 ++-- src/dynapi/SDL_dynapi.sym | 2 +- src/dynapi/SDL_dynapi_overrides.h | 2 +- src/dynapi/SDL_dynapi_procs.h | 2 +- src/render/opengl/SDL_render_gl.c | 8 ++++---- src/render/opengles2/SDL_render_gles2.c | 8 ++++---- src/video/SDL_video.c | 2 +- src/video/cocoa/SDL_cocoaopengl.m | 10 +++++----- src/video/uikit/SDL_uikitopengles.m | 2 +- test/testgl.c | 2 +- test/testgles.c | 2 +- test/testgles2.c | 2 +- test/testgles2_sdf.c | 2 +- 16 files changed, 34 insertions(+), 24 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 67fa06af3d87e..8d2eea587dd7d 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3501,3 +3501,8 @@ typedef SDL_PixelFormat, SDL_PackedPixelDetails; @@ - SDL_SIMD_ALIGNED + SDL_SURFACE_SIMD_ALIGNED +@@ +@@ +- SDL_GL_DeleteContext ++ SDL_GL_DestroyContext + (...) diff --git a/docs/README-migration.md b/docs/README-migration.md index 526b4e15b4435..9c9501a266e12 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1977,6 +1977,8 @@ SDL_GL_GetProcAddress() and SDL_EGL_GetProcAddress() now return `SDL_FunctionPoi SDL_GL_SwapWindow() returns 0 if the function succeeds or a negative error code if there was an error. +SDL_GL_DeleteContext() has been renamed to SDL_GL_DestroyContext to match SDL naming conventions (and glX!). It also now returns 0 if the function succeeds or a negative error code if there was an error (it returned void in SDL2). + SDL_GL_GetSwapInterval() takes the interval as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error. SDL_GL_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be used in its place. @@ -1987,6 +1989,7 @@ The SDL_WINDOW_TOOLTIP and SDL_WINDOW_POPUP_MENU window flags are now supported SDL_WindowFlags is used instead of Uint32 for API functions that refer to window flags, and has been extended to 64 bits. The following functions have been renamed: +* SDL_GL_DeleteContext() => SDL_GL_DestroyContext() * SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode() * SDL_GetDisplayOrientation() => SDL_GetCurrentDisplayOrientation() * SDL_GetPointDisplayIndex() => SDL_GetDisplayForPoint() diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index c9abf8147633e..84add35ea3484 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -618,6 +618,7 @@ #define SDL_PATCHLEVEL SDL_MICRO_VERSION /* ##SDL_video.h */ +#define SDL_GL_DeleteContext SDL_GL_DestroyContext #define SDL_GetClosestDisplayMode SDL_GetClosestFullscreenDisplayMode #define SDL_GetDisplayOrientation SDL_GetCurrentDisplayOrientation #define SDL_GetPointDisplayIndex SDL_GetDisplayForPoint @@ -1215,6 +1216,7 @@ #define SDL_PATCHLEVEL SDL_PATCHLEVEL_renamed_SDL_MICRO_VERSION /* ##SDL_video.h */ +#define SDL_GL_DeleteContext SDL_GL_DeleteContext_renamed_SDL_GL_DestroyContext #define SDL_GetClosestDisplayMode SDL_GetClosestDisplayMode_renamed_SDL_GetClosestFullscreenDisplayMode #define SDL_GetDisplayOrientation SDL_GetDisplayOrientation_renamed_SDL_GetCurrentDisplayOrientation #define SDL_GetPointDisplayIndex SDL_GetPointDisplayIndex_renamed_SDL_GetDisplayForPoint diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 5dcee6694ddb3..db54c9f99fa1f 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -2592,7 +2592,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GL_DeleteContext + * \sa SDL_GL_DestroyContext * \sa SDL_GL_MakeCurrent */ extern SDL_DECLSPEC SDL_GLContext SDLCALL SDL_GL_CreateContext(SDL_Window *window); @@ -2769,7 +2769,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_SwapWindow(SDL_Window *window); * * \sa SDL_GL_CreateContext */ -extern SDL_DECLSPEC int SDLCALL SDL_GL_DeleteContext(SDL_GLContext context); +extern SDL_DECLSPEC int SDLCALL SDL_GL_DestroyContext(SDL_GLContext context); /* @} *//* OpenGL support functions */ diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 79aec801d97fc..9e665952b8e01 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -140,7 +140,7 @@ SDL3_0.0.0 { SDL_GDKGetTaskQueue; SDL_GDKSuspendComplete; SDL_GL_CreateContext; - SDL_GL_DeleteContext; + SDL_GL_DestroyContext; SDL_GL_ExtensionSupported; SDL_GL_GetAttribute; SDL_GL_GetCurrentContext; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 6b1a00ae28699..e1107a0e7e99c 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -164,7 +164,7 @@ #define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_REAL #define SDL_GDKSuspendComplete SDL_GDKSuspendComplete_REAL #define SDL_GL_CreateContext SDL_GL_CreateContext_REAL -#define SDL_GL_DeleteContext SDL_GL_DeleteContext_REAL +#define SDL_GL_DestroyContext SDL_GL_DestroyContext_REAL #define SDL_GL_ExtensionSupported SDL_GL_ExtensionSupported_REAL #define SDL_GL_GetAttribute SDL_GL_GetAttribute_REAL #define SDL_GL_GetCurrentContext SDL_GL_GetCurrentContext_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 51be63cac93ff..2399bfc4ff305 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -183,7 +183,7 @@ SDL_DYNAPI_PROC(int,SDL_GDKGetDefaultUser,(XUserHandle *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GDKGetTaskQueue,(XTaskQueueHandle *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GL_DeleteContext,(SDL_GLContext a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GL_ExtensionSupported,(const char *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GL_GetAttribute,(SDL_GLattr a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_GetCurrentContext,(void),(),return) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 6c6399ddcf14c..a4f7cd061a7c7 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1578,7 +1578,7 @@ static void GL_DestroyRenderer(SDL_Renderer *renderer) SDL_free(data->framebuffers); data->framebuffers = nextnode; } - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); } SDL_free(data); } @@ -1686,12 +1686,12 @@ static int GL_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Pro goto error; } if (SDL_GL_MakeCurrent(window, data->context) < 0) { - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); goto error; } if (GL_LoadFunctions(data) < 0) { - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); goto error; } @@ -1807,7 +1807,7 @@ static int GL_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Pro SDL_GL_GetProcAddress("glCheckFramebufferStatusEXT"); } else { SDL_SetError("Can't create render targets, GL_EXT_framebuffer_object not available"); - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); goto error; } diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index cdfa9faed7cbc..b87626dc7a2d5 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1440,7 +1440,7 @@ static void GLES2_DestroyRenderer(SDL_Renderer *renderer) GL_CheckError("", renderer); #endif - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); } SDL_free(data); @@ -2107,17 +2107,17 @@ static int GLES2_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ goto error; } if (SDL_GL_MakeCurrent(window, data->context) < 0) { - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); goto error; } if (GLES2_LoadFunctions(data) < 0) { - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); goto error; } if (GLES2_CacheShaders(data) < 0) { - SDL_GL_DeleteContext(data->context); + SDL_GL_DestroyContext(data->context); goto error; } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 82de50bd8d384..516ac5369c407 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -4920,7 +4920,7 @@ int SDL_GL_SwapWindow(SDL_Window *window) return _this->GL_SwapWindow(_this, window); } -int SDL_GL_DeleteContext(SDL_GLContext context) +int SDL_GL_DestroyContext(SDL_GLContext context) { if (!_this) { return SDL_UninitializedVideo(); \ diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 022d0786ff41e..8b067aa4218a5 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -386,7 +386,7 @@ SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) [context setValues:&opaque forParameter:NSOpenGLCPSurfaceOpacity]; if (Cocoa_GL_MakeCurrent(_this, window, sdlcontext) < 0) { - SDL_GL_DeleteContext(sdlcontext); + SDL_GL_DestroyContext(sdlcontext); SDL_SetError("Failed making OpenGL context current"); return NULL; } @@ -400,27 +400,27 @@ SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) glGetStringFunc = (const GLubyte *(APIENTRY *)(GLenum))SDL_GL_GetProcAddress("glGetString"); if (!glGetStringFunc) { - SDL_GL_DeleteContext(sdlcontext); + SDL_GL_DestroyContext(sdlcontext); SDL_SetError("Failed getting OpenGL glGetString entry point"); return NULL; } glversion = (const char *)glGetStringFunc(GL_VERSION); if (glversion == NULL) { - SDL_GL_DeleteContext(sdlcontext); + SDL_GL_DestroyContext(sdlcontext); SDL_SetError("Failed getting OpenGL context version"); return NULL; } if (SDL_sscanf(glversion, "%d.%d", &glversion_major, &glversion_minor) != 2) { - SDL_GL_DeleteContext(sdlcontext); + SDL_GL_DestroyContext(sdlcontext); SDL_SetError("Failed parsing OpenGL context version"); return NULL; } if ((glversion_major < _this->gl_config.major_version) || ((glversion_major == _this->gl_config.major_version) && (glversion_minor < _this->gl_config.minor_version))) { - SDL_GL_DeleteContext(sdlcontext); + SDL_GL_DestroyContext(sdlcontext); SDL_SetError("Failed creating OpenGL context at version requested"); return NULL; } diff --git a/src/video/uikit/SDL_uikitopengles.m b/src/video/uikit/SDL_uikitopengles.m index afcd900463d8b..1890a33e29c70 100644 --- a/src/video/uikit/SDL_uikitopengles.m +++ b/src/video/uikit/SDL_uikitopengles.m @@ -60,7 +60,7 @@ SDL_FunctionPointer UIKit_GL_GetProcAddress(SDL_VideoDevice *_this, const char * } /* - note that SDL_GL_DeleteContext makes it current without passing the window + note that SDL_GL_DestroyContext makes it current without passing the window */ int UIKit_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { diff --git a/test/testgl.c b/test/testgl.c index abbaa0743a538..cbf44ae02a237 100644 --- a/test/testgl.c +++ b/test/testgl.c @@ -63,7 +63,7 @@ static void quit(int rc) { if (context) { /* SDL_GL_MakeCurrent(0, NULL); */ /* doesn't do anything */ - SDL_GL_DeleteContext(context); + SDL_GL_DestroyContext(context); } SDLTest_CommonQuit(state); /* Let 'main()' return normally */ diff --git a/test/testgles.c b/test/testgles.c index 25829391da6a0..d32015f3a09ce 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -35,7 +35,7 @@ quit(int rc) if (context) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { - SDL_GL_DeleteContext(context[i]); + SDL_GL_DestroyContext(context[i]); } } diff --git a/test/testgles2.c b/test/testgles2.c index c75ea84ab9045..89546ca13d3ea 100644 --- a/test/testgles2.c +++ b/test/testgles2.c @@ -103,7 +103,7 @@ quit(int rc) if (context) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { - SDL_GL_DeleteContext(context[i]); + SDL_GL_DestroyContext(context[i]); } } diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c index 23c11238eada5..da8935b591c79 100644 --- a/test/testgles2_sdf.c +++ b/test/testgles2_sdf.c @@ -95,7 +95,7 @@ quit(int rc) if (context) { for (i = 0; i < state->num_windows; i++) { if (context[i]) { - SDL_GL_DeleteContext(context[i]); + SDL_GL_DestroyContext(context[i]); } } From 60ed914c6656cdafa1f755ce515df7e474acb877 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 10 Jul 2024 13:19:46 -0700 Subject: [PATCH 235/431] Added notes for migrating SDL_GetRGBA()/SDL_MapRGBA() code --- docs/README-migration.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 9c9501a266e12..7f20130596155 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -349,13 +349,13 @@ The SDL_EVENT_WINDOW_SIZE_CHANGED event has been removed, and you can use SDL_EV The keysym field of key events has been removed to remove one level of indirection, and `sym` has been renamed `key`. -Code that looked like this: +Code that used to look like this: ```c SDL_Event event; SDL_Keycode key = event.key.keysym.sym; SDL_Keymod mod = event.key.keysym.mod; ``` -now looks like this: +should be changed to: ```c SDL_Event event; SDL_Keycode key = event.key.key; @@ -1098,6 +1098,24 @@ SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups. +Code that used to look like this: +```c + SDL_GetRGBA(pixel, surface->format, &r, &g, &b, &a); +``` +should be changed to: +```c + SDL_GetRGBA(pixel, SDL_GetPixelFormatDetails(surface->format), SDL_GetSurfacePalette(surface), &r, &g, &b, &a); +``` + +Code that used to look like this: +```c + pixel = SDL_MapRGBA(surface->format, r, g, b, a); +``` +should be changed to: +```c + pixel = SDL_MapSurfaceRGBA(surface, r, g, b, a); +``` + SDL_GetMasksForPixelFormat() now returns the standard int error code. SDL_CalculateGammaRamp has been removed, because SDL_SetWindowGammaRamp has been removed as well due to poor support in modern operating systems (see [SDL_video.h](#sdl_videoh)). From d5e6116f8e0775d94616e67e955705f281407eda Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 5 Jul 2024 17:16:07 -0700 Subject: [PATCH 236/431] Initialize and shutdown clipboard listener on iOS --- src/video/uikit/SDL_uikitvideo.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 916afb1d5d4b4..5b2af6f09a281 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -157,11 +157,15 @@ int UIKit_VideoInit(SDL_VideoDevice *_this) SDL_InitGCKeyboard(); SDL_InitGCMouse(); + UIKit_InitClipboard(_this); + return 0; } void UIKit_VideoQuit(SDL_VideoDevice *_this) { + UIKit_QuitClipboard(_this); + SDL_QuitGCKeyboard(); SDL_QuitGCMouse(); From 9548bba63a5508b0cba5778d3da0036726274de0 Mon Sep 17 00:00:00 2001 From: Substring Date: Wed, 10 Jul 2024 20:23:06 +0200 Subject: [PATCH 237/431] KMSDRM: fix unsupported modifiers --- src/video/kmsdrm/SDL_kmsdrmsym.h | 1 + src/video/kmsdrm/SDL_kmsdrmvideo.c | 17 +++++++++++++++-- src/video/kmsdrm/SDL_kmsdrmvideo.h | 4 ++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmsym.h b/src/video/kmsdrm/SDL_kmsdrmsym.h index 2b4fe4bf35dc6..a9556edaae24d 100644 --- a/src/video/kmsdrm/SDL_kmsdrmsym.h +++ b/src/video/kmsdrm/SDL_kmsdrmsym.h @@ -129,6 +129,7 @@ SDL_KMSDRM_SYM(uint64_t,gbm_bo_get_modifier,(struct gbm_bo *bo)) SDL_KMSDRM_SYM(int,gbm_bo_get_plane_count,(struct gbm_bo *bo)) SDL_KMSDRM_SYM(uint32_t,gbm_bo_get_offset,(struct gbm_bo *bo, int plane)) SDL_KMSDRM_SYM(uint32_t,gbm_bo_get_stride_for_plane,(struct gbm_bo *bo, int plane)) +SDL_KMSDRM_SYM(union gbm_bo_handle,gbm_bo_get_handle_for_plane,(struct gbm_bo *bo, int plane);) #undef SDL_KMSDRM_MODULE #undef SDL_KMSDRM_SYM diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 4a873a32c4a51..cbf68e4bdaedd 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -383,16 +383,29 @@ KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) num_planes = KMSDRM_gbm_bo_get_plane_count(bo); for (int i = 0; i < num_planes; i++) { strides[i] = KMSDRM_gbm_bo_get_stride_for_plane(bo, i); - handles[i] = KMSDRM_gbm_bo_get_handle(bo).u32; + handles[i] = KMSDRM_gbm_bo_get_handle_for_plane(bo, i).u32; offsets[i] = KMSDRM_gbm_bo_get_offset(bo, i); modifiers[i] = modifiers[0]; } - if (modifiers[0]) { + if (modifiers[0] && modifiers[0] != DRM_FORMAT_MOD_INVALID) { flags = DRM_MODE_FB_MODIFIERS; } ret = KMSDRM_drmModeAddFB2WithModifiers(viddata->drm_fd, w, h, format, handles, strides, offsets, modifiers, &fb_info->fb_id, flags); + + if (ret) { + handles[0] = KMSDRM_gbm_bo_get_handle(bo).u32; + strides[0] = KMSDRM_gbm_bo_get_stride(bo); + offsets[0] = 0; + for (int i = 1; i<4; i++) { + handles[i] = 0; + strides[i] = 0; + offsets[i] = 0; + } + ret = KMSDRM_drmModeAddFB2(viddata->drm_fd, w, h, format, handles, strides, offsets, &fb_info->fb_id, 0); + } + if (ret) { SDL_free(fb_info); return NULL; diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.h b/src/video/kmsdrm/SDL_kmsdrmvideo.h index 71d195ac6bab0..3de569189cf70 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.h +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.h @@ -33,6 +33,10 @@ #include #include +#ifndef DRM_FORMAT_MOD_INVALID +#define DRM_FORMAT_MOD_INVALID 0x00ffffffffffffffULL +#endif + #ifndef DRM_MODE_FB_MODIFIERS #define DRM_MODE_FB_MODIFIERS 2 #endif From 628e083e02703c4bbec5de909d17a874fe691880 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 10 Jul 2024 23:28:30 +0200 Subject: [PATCH 238/431] ci: Build SDL3 with libusb support on MSVC --- .../setup-msvc-libusb-action/action.yml | 70 +++++++++++++++++++ .github/workflows/msvc.yml | 11 ++- 2 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 .github/actions/setup-msvc-libusb-action/action.yml diff --git a/.github/actions/setup-msvc-libusb-action/action.yml b/.github/actions/setup-msvc-libusb-action/action.yml new file mode 100644 index 0000000000000..a0e766618141d --- /dev/null +++ b/.github/actions/setup-msvc-libusb-action/action.yml @@ -0,0 +1,70 @@ +name: 'Setup libusb for MSBC' +description: 'Greet someone' +inputs: + version: + description: 'libusb version' + required: true + default: '1.0.27' + arch: + description: "libusb architecture (x86 or x64)" + rqeuired: true +outputs: + root: + description: "libusb root directory" + value: ${{ steps.final.outputs.root }} +runs: + using: 'composite' + steps: + - name: 'Restore cached libusb-${{ inputs.version }}.7z' + id: cache-restore + uses: actions/cache/restore@v4 + with: + path: 'C:\temp\libusb-${{ inputs.version }}.7z' + key: libusb-msvc-${{ inputs.version }} + - name: 'Download libusb ${{ inputs.version }}' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + Invoke-WebRequest "https://github.com/libusb/libusb/releases/download/v${{ inputs.version }}/libusb-${{ inputs.version }}.7z" -OutFile "C:\temp\libusb-${{ inputs.version }}.7z" + - name: 'Cache libusb-${{ inputs.version }}.7z' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + uses: actions/cache/save@v4 + with: + path: 'C:\temp\libusb-${{ inputs.version }}.7z' + key: libusb-msvc-${{ inputs.version }} + - name: 'Extract libusb' + shell: pwsh + run: | + 7z "-oC:\temp\libusb-${{ inputs.version }}" x "C:\temp\libusb-${{ inputs.version }}.7z" + - name: 'Set output vars' + id: final + shell: pwsh + run: | + if ('${{ inputs.arch }}' -eq 'x86') { + $archdir = "MS32"; + } elseif ('${{ inputs.arch }}' -eq 'x64') { + $archdir = "MS64"; + } else { + write-host "Invalid arch=${{ inputs.arch }}" + exit 1 + } + $libusb_incdir = "C:\temp\libusb-${{ inputs.version }}\include"; + $libusb_libdir = "C:\temp\libusb-${{ inputs.version }}\VS2022\${archdir}\dll"; + + $libusb_header = "${libusb_incdir}\libusb.h"; + $libusb_implib = "${libusb_libdir}\libusb-1.0.lib"; + $libusb_dll = "${libusb_libdir}\libusb-1.0.dll"; + + if (!(Test-Path "${libusb_header}")) { + write-host "${libusb_header} does not exist!" + exit 1 + } + if (!(Test-Path "${libusb_implib}")){ + write-host "${libusb_implib} does not exist!" + exit 1 + } + if (!(Test-Path "${libusb_dll}")) { + write-host "${libusb_dll} does not exist!" + exit 1 + } + echo "root=${libusb_incdir};${libusb_libdir}" >> $env:GITHUB_OUTPUT diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index b72a2b85c43c4..fee4a16a60a30 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -15,8 +15,8 @@ jobs: fail-fast: false matrix: platform: - - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64', artifact: 'SDL-VC-x64' } - - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32', artifact: 'SDL-VC-x86' } + - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64', libusb-arch: 'x64', artifact: 'SDL-VC-x64' } + - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32', libusb-arch: 'x86', artifact: 'SDL-VC-x86' } - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64, artifact: 'SDL-clang-cl-x64' } - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32, artifact: 'SDL-clang-cl-x86' } - { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32', notests: true } @@ -26,6 +26,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up libusb + uses: ./.github/actions/setup-msvc-libusb-action + if: ${{ matrix.platform.libusb-arch != '' }} + id: libusb + with: + arch: ${{ matrix.platform.libusb-arch }} - name: Create CMake project using SDL as a subproject shell: python run: | @@ -71,6 +77,7 @@ jobs: -DSDL_DISABLE_INSTALL_CPACK=OFF ` -DSDL_DISABLE_INSTALL_DOCS=OFF ` -DSDLTEST_PROCDUMP=ON ` + -DLibUSB_ROOT="${{ steps.libusb.outputs.root }}" ` ${{ matrix.platform.flags }} ` -DCMAKE_INSTALL_PREFIX=prefix - name: Build (CMake) From 8722c297a468c30f1fc5032a9dc8abb924cb8e3b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 10 Jul 2024 19:16:04 -0700 Subject: [PATCH 239/431] Added a key name for the non-US backslash key --- src/events/SDL_keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index b4a576cd5f99d..6336106816381 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -394,7 +394,7 @@ static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = /* 97 */ "Keypad 9", /* 98 */ "Keypad 0", /* 99 */ "Keypad .", - /* 100 */ NULL, + /* 100 */ "\\", /* 101 */ "Application", /* 102 */ "Power", /* 103 */ "Keypad =", From 5ee88d43f96fda3cae706f5b610280fc81158594 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 10 Jul 2024 20:13:40 -0700 Subject: [PATCH 240/431] Fixed mapping the non-US hash key on European keyboards --- src/events/SDL_keymap.c | 356 +++++++++++++++++++++++- src/video/cocoa/SDL_cocoakeyboard.m | 3 +- src/video/windows/SDL_windowskeyboard.c | 3 +- 3 files changed, 356 insertions(+), 6 deletions(-) diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index 6336106816381..db2861865b99d 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -238,11 +238,359 @@ SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode, SDL_Keymod mods } } - if (scancode == SDL_SCANCODE_DELETE) { + // These scancodes are not mapped to printable keycodes + switch (scancode) { + case SDL_SCANCODE_DELETE: return SDLK_DELETE; + case SDL_SCANCODE_CAPSLOCK: + return SDLK_CAPSLOCK; + case SDL_SCANCODE_F1: + return SDLK_F1; + case SDL_SCANCODE_F2: + return SDLK_F2; + case SDL_SCANCODE_F3: + return SDLK_F3; + case SDL_SCANCODE_F4: + return SDLK_F4; + case SDL_SCANCODE_F5: + return SDLK_F5; + case SDL_SCANCODE_F6: + return SDLK_F6; + case SDL_SCANCODE_F7: + return SDLK_F7; + case SDL_SCANCODE_F8: + return SDLK_F8; + case SDL_SCANCODE_F9: + return SDLK_F9; + case SDL_SCANCODE_F10: + return SDLK_F10; + case SDL_SCANCODE_F11: + return SDLK_F11; + case SDL_SCANCODE_F12: + return SDLK_F12; + case SDL_SCANCODE_PRINTSCREEN: + return SDLK_PRINTSCREEN; + case SDL_SCANCODE_SCROLLLOCK: + return SDLK_SCROLLLOCK; + case SDL_SCANCODE_PAUSE: + return SDLK_PAUSE; + case SDL_SCANCODE_INSERT: + return SDLK_INSERT; + case SDL_SCANCODE_HOME: + return SDLK_HOME; + case SDL_SCANCODE_PAGEUP: + return SDLK_PAGEUP; + case SDL_SCANCODE_END: + return SDLK_END; + case SDL_SCANCODE_PAGEDOWN: + return SDLK_PAGEDOWN; + case SDL_SCANCODE_RIGHT: + return SDLK_RIGHT; + case SDL_SCANCODE_LEFT: + return SDLK_LEFT; + case SDL_SCANCODE_DOWN: + return SDLK_DOWN; + case SDL_SCANCODE_UP: + return SDLK_UP; + case SDL_SCANCODE_NUMLOCKCLEAR: + return SDLK_NUMLOCKCLEAR; + case SDL_SCANCODE_KP_DIVIDE: + return SDLK_KP_DIVIDE; + case SDL_SCANCODE_KP_MULTIPLY: + return SDLK_KP_MULTIPLY; + case SDL_SCANCODE_KP_MINUS: + return SDLK_KP_MINUS; + case SDL_SCANCODE_KP_PLUS: + return SDLK_KP_PLUS; + case SDL_SCANCODE_KP_ENTER: + return SDLK_KP_ENTER; + case SDL_SCANCODE_KP_1: + return SDLK_KP_1; + case SDL_SCANCODE_KP_2: + return SDLK_KP_2; + case SDL_SCANCODE_KP_3: + return SDLK_KP_3; + case SDL_SCANCODE_KP_4: + return SDLK_KP_4; + case SDL_SCANCODE_KP_5: + return SDLK_KP_5; + case SDL_SCANCODE_KP_6: + return SDLK_KP_6; + case SDL_SCANCODE_KP_7: + return SDLK_KP_7; + case SDL_SCANCODE_KP_8: + return SDLK_KP_8; + case SDL_SCANCODE_KP_9: + return SDLK_KP_9; + case SDL_SCANCODE_KP_0: + return SDLK_KP_0; + case SDL_SCANCODE_KP_PERIOD: + return SDLK_KP_PERIOD; + case SDL_SCANCODE_APPLICATION: + return SDLK_APPLICATION; + case SDL_SCANCODE_POWER: + return SDLK_POWER; + case SDL_SCANCODE_KP_EQUALS: + return SDLK_KP_EQUALS; + case SDL_SCANCODE_F13: + return SDLK_F13; + case SDL_SCANCODE_F14: + return SDLK_F14; + case SDL_SCANCODE_F15: + return SDLK_F15; + case SDL_SCANCODE_F16: + return SDLK_F16; + case SDL_SCANCODE_F17: + return SDLK_F17; + case SDL_SCANCODE_F18: + return SDLK_F18; + case SDL_SCANCODE_F19: + return SDLK_F19; + case SDL_SCANCODE_F20: + return SDLK_F20; + case SDL_SCANCODE_F21: + return SDLK_F21; + case SDL_SCANCODE_F22: + return SDLK_F22; + case SDL_SCANCODE_F23: + return SDLK_F23; + case SDL_SCANCODE_F24: + return SDLK_F24; + case SDL_SCANCODE_EXECUTE: + return SDLK_EXECUTE; + case SDL_SCANCODE_HELP: + return SDLK_HELP; + case SDL_SCANCODE_MENU: + return SDLK_MENU; + case SDL_SCANCODE_SELECT: + return SDLK_SELECT; + case SDL_SCANCODE_STOP: + return SDLK_STOP; + case SDL_SCANCODE_AGAIN: + return SDLK_AGAIN; + case SDL_SCANCODE_UNDO: + return SDLK_UNDO; + case SDL_SCANCODE_CUT: + return SDLK_CUT; + case SDL_SCANCODE_COPY: + return SDLK_COPY; + case SDL_SCANCODE_PASTE: + return SDLK_PASTE; + case SDL_SCANCODE_FIND: + return SDLK_FIND; + case SDL_SCANCODE_MUTE: + return SDLK_MUTE; + case SDL_SCANCODE_VOLUMEUP: + return SDLK_VOLUMEUP; + case SDL_SCANCODE_VOLUMEDOWN: + return SDLK_VOLUMEDOWN; + case SDL_SCANCODE_KP_COMMA: + return SDLK_KP_COMMA; + case SDL_SCANCODE_KP_EQUALSAS400: + return SDLK_KP_EQUALSAS400; + case SDL_SCANCODE_ALTERASE: + return SDLK_ALTERASE; + case SDL_SCANCODE_SYSREQ: + return SDLK_SYSREQ; + case SDL_SCANCODE_CANCEL: + return SDLK_CANCEL; + case SDL_SCANCODE_CLEAR: + return SDLK_CLEAR; + case SDL_SCANCODE_PRIOR: + return SDLK_PRIOR; + case SDL_SCANCODE_RETURN2: + return SDLK_RETURN2; + case SDL_SCANCODE_SEPARATOR: + return SDLK_SEPARATOR; + case SDL_SCANCODE_OUT: + return SDLK_OUT; + case SDL_SCANCODE_OPER: + return SDLK_OPER; + case SDL_SCANCODE_CLEARAGAIN: + return SDLK_CLEARAGAIN; + case SDL_SCANCODE_CRSEL: + return SDLK_CRSEL; + case SDL_SCANCODE_EXSEL: + return SDLK_EXSEL; + case SDL_SCANCODE_KP_00: + return SDLK_KP_00; + case SDL_SCANCODE_KP_000: + return SDLK_KP_000; + case SDL_SCANCODE_THOUSANDSSEPARATOR: + return SDLK_THOUSANDSSEPARATOR; + case SDL_SCANCODE_DECIMALSEPARATOR: + return SDLK_DECIMALSEPARATOR; + case SDL_SCANCODE_CURRENCYUNIT: + return SDLK_CURRENCYUNIT; + case SDL_SCANCODE_CURRENCYSUBUNIT: + return SDLK_CURRENCYSUBUNIT; + case SDL_SCANCODE_KP_LEFTPAREN: + return SDLK_KP_LEFTPAREN; + case SDL_SCANCODE_KP_RIGHTPAREN: + return SDLK_KP_RIGHTPAREN; + case SDL_SCANCODE_KP_LEFTBRACE: + return SDLK_KP_LEFTBRACE; + case SDL_SCANCODE_KP_RIGHTBRACE: + return SDLK_KP_RIGHTBRACE; + case SDL_SCANCODE_KP_TAB: + return SDLK_KP_TAB; + case SDL_SCANCODE_KP_BACKSPACE: + return SDLK_KP_BACKSPACE; + case SDL_SCANCODE_KP_A: + return SDLK_KP_A; + case SDL_SCANCODE_KP_B: + return SDLK_KP_B; + case SDL_SCANCODE_KP_C: + return SDLK_KP_C; + case SDL_SCANCODE_KP_D: + return SDLK_KP_D; + case SDL_SCANCODE_KP_E: + return SDLK_KP_E; + case SDL_SCANCODE_KP_F: + return SDLK_KP_F; + case SDL_SCANCODE_KP_XOR: + return SDLK_KP_XOR; + case SDL_SCANCODE_KP_POWER: + return SDLK_KP_POWER; + case SDL_SCANCODE_KP_PERCENT: + return SDLK_KP_PERCENT; + case SDL_SCANCODE_KP_LESS: + return SDLK_KP_LESS; + case SDL_SCANCODE_KP_GREATER: + return SDLK_KP_GREATER; + case SDL_SCANCODE_KP_AMPERSAND: + return SDLK_KP_AMPERSAND; + case SDL_SCANCODE_KP_DBLAMPERSAND: + return SDLK_KP_DBLAMPERSAND; + case SDL_SCANCODE_KP_VERTICALBAR: + return SDLK_KP_VERTICALBAR; + case SDL_SCANCODE_KP_DBLVERTICALBAR: + return SDLK_KP_DBLVERTICALBAR; + case SDL_SCANCODE_KP_COLON: + return SDLK_KP_COLON; + case SDL_SCANCODE_KP_HASH: + return SDLK_KP_HASH; + case SDL_SCANCODE_KP_SPACE: + return SDLK_KP_SPACE; + case SDL_SCANCODE_KP_AT: + return SDLK_KP_AT; + case SDL_SCANCODE_KP_EXCLAM: + return SDLK_KP_EXCLAM; + case SDL_SCANCODE_KP_MEMSTORE: + return SDLK_KP_MEMSTORE; + case SDL_SCANCODE_KP_MEMRECALL: + return SDLK_KP_MEMRECALL; + case SDL_SCANCODE_KP_MEMCLEAR: + return SDLK_KP_MEMCLEAR; + case SDL_SCANCODE_KP_MEMADD: + return SDLK_KP_MEMADD; + case SDL_SCANCODE_KP_MEMSUBTRACT: + return SDLK_KP_MEMSUBTRACT; + case SDL_SCANCODE_KP_MEMMULTIPLY: + return SDLK_KP_MEMMULTIPLY; + case SDL_SCANCODE_KP_MEMDIVIDE: + return SDLK_KP_MEMDIVIDE; + case SDL_SCANCODE_KP_PLUSMINUS: + return SDLK_KP_PLUSMINUS; + case SDL_SCANCODE_KP_CLEAR: + return SDLK_KP_CLEAR; + case SDL_SCANCODE_KP_CLEARENTRY: + return SDLK_KP_CLEARENTRY; + case SDL_SCANCODE_KP_BINARY: + return SDLK_KP_BINARY; + case SDL_SCANCODE_KP_OCTAL: + return SDLK_KP_OCTAL; + case SDL_SCANCODE_KP_DECIMAL: + return SDLK_KP_DECIMAL; + case SDL_SCANCODE_KP_HEXADECIMAL: + return SDLK_KP_HEXADECIMAL; + case SDL_SCANCODE_LCTRL: + return SDLK_LCTRL; + case SDL_SCANCODE_LSHIFT: + return SDLK_LSHIFT; + case SDL_SCANCODE_LALT: + return SDLK_LALT; + case SDL_SCANCODE_LGUI: + return SDLK_LGUI; + case SDL_SCANCODE_RCTRL: + return SDLK_RCTRL; + case SDL_SCANCODE_RSHIFT: + return SDLK_RSHIFT; + case SDL_SCANCODE_RALT: + return SDLK_RALT; + case SDL_SCANCODE_RGUI: + return SDLK_RGUI; + case SDL_SCANCODE_MODE: + return SDLK_MODE; + case SDL_SCANCODE_SLEEP: + return SDLK_SLEEP; + case SDL_SCANCODE_WAKE: + return SDLK_WAKE; + case SDL_SCANCODE_CHANNEL_INCREMENT: + return SDLK_CHANNEL_INCREMENT; + case SDL_SCANCODE_CHANNEL_DECREMENT: + return SDLK_CHANNEL_DECREMENT; + case SDL_SCANCODE_MEDIA_PLAY: + return SDLK_MEDIA_PLAY; + case SDL_SCANCODE_MEDIA_PAUSE: + return SDLK_MEDIA_PAUSE; + case SDL_SCANCODE_MEDIA_RECORD: + return SDLK_MEDIA_RECORD; + case SDL_SCANCODE_MEDIA_FAST_FORWARD: + return SDLK_MEDIA_FAST_FORWARD; + case SDL_SCANCODE_MEDIA_REWIND: + return SDLK_MEDIA_REWIND; + case SDL_SCANCODE_MEDIA_NEXT_TRACK: + return SDLK_MEDIA_NEXT_TRACK; + case SDL_SCANCODE_MEDIA_PREVIOUS_TRACK: + return SDLK_MEDIA_PREVIOUS_TRACK; + case SDL_SCANCODE_MEDIA_STOP: + return SDLK_MEDIA_STOP; + case SDL_SCANCODE_MEDIA_EJECT: + return SDLK_MEDIA_EJECT; + case SDL_SCANCODE_MEDIA_PLAY_PAUSE: + return SDLK_MEDIA_PLAY_PAUSE; + case SDL_SCANCODE_MEDIA_SELECT: + return SDLK_MEDIA_SELECT; + case SDL_SCANCODE_AC_NEW: + return SDLK_AC_NEW; + case SDL_SCANCODE_AC_OPEN: + return SDLK_AC_OPEN; + case SDL_SCANCODE_AC_CLOSE: + return SDLK_AC_CLOSE; + case SDL_SCANCODE_AC_EXIT: + return SDLK_AC_EXIT; + case SDL_SCANCODE_AC_SAVE: + return SDLK_AC_SAVE; + case SDL_SCANCODE_AC_PRINT: + return SDLK_AC_PRINT; + case SDL_SCANCODE_AC_PROPERTIES: + return SDLK_AC_PROPERTIES; + case SDL_SCANCODE_AC_SEARCH: + return SDLK_AC_SEARCH; + case SDL_SCANCODE_AC_HOME: + return SDLK_AC_HOME; + case SDL_SCANCODE_AC_BACK: + return SDLK_AC_BACK; + case SDL_SCANCODE_AC_FORWARD: + return SDLK_AC_FORWARD; + case SDL_SCANCODE_AC_STOP: + return SDLK_AC_STOP; + case SDL_SCANCODE_AC_REFRESH: + return SDLK_AC_REFRESH; + case SDL_SCANCODE_AC_BOOKMARKS: + return SDLK_AC_BOOKMARKS; + case SDL_SCANCODE_SOFTLEFT: + return SDLK_SOFTLEFT; + case SDL_SCANCODE_SOFTRIGHT: + return SDLK_SOFTRIGHT; + case SDL_SCANCODE_CALL: + return SDLK_CALL; + case SDL_SCANCODE_ENDCALL: + return SDLK_ENDCALL; + default: + return SDLK_UNKNOWN; } - - return SDL_SCANCODE_TO_KEYCODE(scancode); } SDL_Scancode SDL_GetDefaultScancodeFromKey(SDL_Keycode key, SDL_Keymod *modstate) @@ -394,7 +742,7 @@ static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = /* 97 */ "Keypad 9", /* 98 */ "Keypad 0", /* 99 */ "Keypad .", - /* 100 */ "\\", + /* 100 */ NULL, /* 101 */ "Application", /* 102 */ "Power", /* 103 */ "Keypad =", diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index c575346f80ff0..463f2c542a57d 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -288,7 +288,8 @@ static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) /* Make sure this scancode is a valid character scancode */ SDL_Scancode scancode = darwin_scancode_table[i]; if (scancode == SDL_SCANCODE_UNKNOWN || - scancode >= SDL_SCANCODE_CAPSLOCK) { + scancode == SDL_SCANCODE_DELETE || + (SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) { continue; } diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index cbb7a40b99eb0..6da493e1b3ae6 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -106,7 +106,8 @@ void WIN_UpdateKeymap(SDL_bool send_event) /* Make sure this scancode is a valid character scancode */ scancode = windows_scancode_table[i]; if (scancode == SDL_SCANCODE_UNKNOWN || - scancode >= SDL_SCANCODE_CAPSLOCK) { + scancode == SDL_SCANCODE_DELETE || + (SDL_GetDefaultKeyFromScancode(scancode, SDL_KMOD_NONE) & SDLK_SCANCODE_MASK)) { continue; } From 9e331d235f676c78bb70a3009e6768d40e848c65 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 10 Jul 2024 20:32:47 -0700 Subject: [PATCH 241/431] Fixed the return value of SDL_Vulkan_CreateSurface() on the Vivante platform --- src/video/SDL_vulkan_internal.h | 8 ++++---- src/video/SDL_vulkan_utils.c | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/video/SDL_vulkan_internal.h b/src/video/SDL_vulkan_internal.h index cd3b6e89080bb..f07e592904986 100644 --- a/src/video/SDL_vulkan_internal.h +++ b/src/video/SDL_vulkan_internal.h @@ -63,10 +63,10 @@ extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList( * using the DisplayKHR extension. * This needs to be passed an instance that was created with the VK_KHR_DISPLAY_EXTENSION_NAME * extension. */ -extern SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface); +extern int SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface); /* Platform independent base function for destroying the Vulkan surface. Unlike surface * creation, surface destruction doesn't require platform specific extensions like diff --git a/src/video/SDL_vulkan_utils.c b/src/video/SDL_vulkan_utils.c index 216cd140501b6..bb42b4933b87a 100644 --- a/src/video/SDL_vulkan_utils.c +++ b/src/video/SDL_vulkan_utils.c @@ -174,10 +174,10 @@ static const VkDisplayPlaneAlphaFlagBitsKHR alphaModes[4] = { VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR, }; -SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, - VkInstance instance, - const struct VkAllocationCallbacks *allocator, - VkSurfaceKHR *surface) +int SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, + VkInstance instance, + const struct VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) { PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)vkGetInstanceProcAddr_; @@ -447,7 +447,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, if (physicalDeviceIndex == physicalDeviceCount) { SDL_SetError("No usable displays found or requested display out of range"); - return SDL_FALSE; + goto error; } createInfo.sType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR; @@ -457,14 +457,14 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_, result = vkCreateDisplayPlaneSurfaceKHR(instance, &createInfo, allocator, surface); if (result != VK_SUCCESS) { SDL_SetError("vkCreateDisplayPlaneSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result)); - return SDL_FALSE; + goto error; } SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Created surface"); - return SDL_TRUE; + return 0; error: SDL_free(physicalDevices); - return SDL_FALSE; + return -1; } void SDL_Vulkan_DestroySurface_Internal(void *vkGetInstanceProcAddr_, From a16ff651e8b631d2d960809f30c24e84f6aa8ed3 Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni <7008900+sinkingsugar@users.noreply.github.com> Date: Thu, 11 Jul 2024 12:56:50 +0800 Subject: [PATCH 242/431] Set Fixed Scale Factor for VisionOS (#10222) --- src/video/uikit/SDL_uikitmetalview.m | 12 ++++++++++-- src/video/uikit/SDL_uikitwindow.m | 8 ++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/video/uikit/SDL_uikitmetalview.m b/src/video/uikit/SDL_uikitmetalview.m index 71be59e49c770..ab7942143d911 100644 --- a/src/video/uikit/SDL_uikitmetalview.m +++ b/src/video/uikit/SDL_uikitmetalview.m @@ -79,16 +79,24 @@ SDL_MetalView UIKit_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window) CGFloat scale = 1.0; SDL_uikitmetalview *metalview; -#ifndef SDL_PLATFORM_VISIONOS if (window->flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) { /* Set the scale to the natural scale factor of the screen - then * the backing dimensions of the Metal view will match the pixel * dimensions of the screen rather than the dimensions in points * yielding high resolution on retine displays. */ +#ifndef SDL_PLATFORM_VISIONOS scale = data.uiwindow.screen.nativeScale; - } +#else + // VisionOS doesn't use the concept of "nativeScale" like other iOS devices. + // We use a fixed scale factor of 2.0 to achieve better pixel density. + // This is because VisionOS presents a virtual 1280x720 "screen", but we need + // to render at a higher resolution for optimal visual quality. + // TODO: Consider making this configurable or determining it dynamically + // based on the specific visionOS device capabilities. + scale = 2.0; #endif + } metalview = [[SDL_uikitmetalview alloc] initWithFrame:data.uiwindow.bounds scale:scale]; diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index b443695d6bd19..395c01322a2ff 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -368,11 +368,15 @@ void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int CGSize size = view.bounds.size; CGFloat scale = 1.0; -#ifndef SDL_PLATFORM_VISIONOS + if (window->flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) { +#ifndef SDL_PLATFORM_VISIONOS scale = windata.uiwindow.screen.nativeScale; - } +#else + scale = 2.0; #endif + } + /* Integer truncation of fractional values matches SDL_uikitmetalview and * SDL_uikitopenglview. */ From 0b2c80557c2ffeac2c9d4b749d75040dc1bd188d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 10 Jul 2024 23:20:51 -0700 Subject: [PATCH 243/431] Update the blit mapping when the palette is set on a surface Make sure you do this even if the palette pointer hasn't changed, as the contents may have. Fixes https://github.com/libsdl-org/SDL/issues/10225 --- src/video/SDL_surface.c | 18 ++++++-------- test/testautomation_surface.c | 46 ++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index a92be28cf3bad..c86f84e722468 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -396,18 +396,16 @@ int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) return SDL_SetError("SDL_SetSurfacePalette() passed a palette that doesn't match the surface format"); } - if (palette == surface->internal->palette) { - return 0; - } - - if (surface->internal->palette) { - SDL_DestroyPalette(surface->internal->palette); - } + if (palette != surface->internal->palette) { + if (surface->internal->palette) { + SDL_DestroyPalette(surface->internal->palette); + } - surface->internal->palette = palette; + surface->internal->palette = palette; - if (surface->internal->palette) { - ++surface->internal->palette->refcount; + if (surface->internal->palette) { + ++surface->internal->palette->refcount; + } } SDL_InvalidateMap(&surface->internal->map); diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index b5def09c1ff87..41284587b19ab 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -852,6 +852,45 @@ static int surface_testFlip(void *arg) return TEST_COMPLETED; } +static int surface_testPalette(void *arg) +{ + SDL_Surface *surface, *output; + SDL_Palette *palette; + Uint8 *pixels; + int offset; + + surface = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_INDEX8); + SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); + + output = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_RGBA32); + SDLTest_AssertCheck(output != NULL, "SDL_CreateSurface()"); + + *(Uint8 *)surface->pixels = 255; + + pixels = (Uint8 *)output->pixels; + offset = 0; + + SDL_BlitSurface(surface, NULL, output, NULL); + SDLTest_AssertCheck(pixels[offset] == 0xFF, + "Expected pixels[%d] == 0xFF got 0x%.2X", offset, pixels[offset]); + + /* Set the palette color and blit again */ + palette = SDL_GetSurfacePalette(surface); + SDLTest_AssertCheck(palette != NULL, "Expected palette != NULL, got %p", palette); + if (palette) { + palette->colors[255].r = 0xAA; + } + SDL_SetSurfacePalette(surface, palette); + SDL_BlitSurface(surface, NULL, output, NULL); + SDLTest_AssertCheck(pixels[offset] == 0xAA, + "Expected pixels[%d] == 0xAA got 0x%.2X", offset, pixels[offset]); + + SDL_DestroySurface(surface); + SDL_DestroySurface(output); + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ @@ -915,11 +954,16 @@ static const SDLTest_TestCaseReference surfaceTestFlip = { surface_testFlip, "surface_testFlip", "Test surface flipping.", TEST_ENABLED }; +static const SDLTest_TestCaseReference surfaceTestPalette = { + surface_testPalette, "surface_testPalette", "Test surface palette operations.", TEST_ENABLED +}; + /* Sequence of Surface test cases */ static const SDLTest_TestCaseReference *surfaceTests[] = { &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, - &surfaceTest11, &surfaceTest12, &surfaceTestOverflow, &surfaceTestFlip, NULL + &surfaceTest11, &surfaceTest12, &surfaceTestOverflow, &surfaceTestFlip, + &surfaceTestPalette, NULL }; /* Surface test suite (global) */ From b5a7b1ca89f4187641aa25e411e69448a56955f3 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 11 Jul 2024 13:51:35 +0200 Subject: [PATCH 244/431] ci: force PDB and runtime variables --- .github/workflows/msvc.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index fee4a16a60a30..0aae792f33e9c 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -41,22 +41,22 @@ jobs: builddir = f"{ srcdir }/build" os.makedirs(builddir) cmakelists_txt = textwrap.dedent(f"""\ - # MSVC debug information format flags are selected by an abstraction - set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction") # MSVC runtime library flags are selected by an abstraction set(CMAKE_POLICY_DEFAULT_CMP0091 "NEW" CACHE STRING "MSVC runtime library flags are selected by an abstraction") + # MSVC debug information format flags are selected by an abstraction + set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction") cmake_minimum_required(VERSION 3.0...3.25) project(sdl_user) # Always build .PDB symbol file - set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format") - set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables") - set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries") + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format" FORCE) + set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables" FORCE) + set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries" FORCE) if(WINDOWS_STORE) # WINDOWS_STORE is available AFTER project() # UWP only supports dynamic runtime - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "MSVC runtime libary") + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "MSVC runtime libary" FORCE) else() # Use static runtime library - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "MSVC runtime libary") + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" CACHE STRING "MSVC runtime libary" FORCE) endif() enable_testing() add_subdirectory("{ srcdir }" SDL) From 540a356199018c286d1bf6dc3cf3628e1c4eef4d Mon Sep 17 00:00:00 2001 From: David Gow Date: Tue, 9 Jul 2024 17:42:24 +0800 Subject: [PATCH 245/431] test: Add testspritesurface This is a cut-down version of testsprite which uses SDL_Surface (and SDL_GetWindowSurface), instead of the Render API. It's useful for quickly validating that blitting works, including some basic format conversion (with a palette). Signed-off-by: David Gow --- test/CMakeLists.txt | 1 + test/testspritesurface.c | 177 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 test/testspritesurface.c diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e98f4c954da12..713b45b3e114e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -405,6 +405,7 @@ add_sdl_test_executable(testshader NEEDS_RESOURCES TESTUTILS SOURCES testshader. add_sdl_test_executable(testshape NEEDS_RESOURCES SOURCES testshape.c ${glass_bmp_header}) add_sdl_test_executable(testsprite MAIN_CALLBACKS NEEDS_RESOURCES TESTUTILS SOURCES testsprite.c) add_sdl_test_executable(testspriteminimal SOURCES testspriteminimal.c ${icon_bmp_header}) +add_sdl_test_executable(testspritesurface SOURCES testspritesurface.c ${icon_bmp_header}) add_sdl_test_executable(teststreaming NEEDS_RESOURCES TESTUTILS SOURCES teststreaming.c) add_sdl_test_executable(testtimer NONINTERACTIVE NONINTERACTIVE_ARGS --no-interactive NONINTERACTIVE_TIMEOUT 60 SOURCES testtimer.c) add_sdl_test_executable(testurl SOURCES testurl.c) diff --git a/test/testspritesurface.c b/test/testspritesurface.c new file mode 100644 index 0000000000000..7b855667b03e5 --- /dev/null +++ b/test/testspritesurface.c @@ -0,0 +1,177 @@ +/* + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely. +*/ +/* Simple program: Test surface blitting. */ + +#include +#include + +#ifdef SDL_PLATFORM_EMSCRIPTEN +#include +#endif + +#include "icon.h" + +#define WINDOW_WIDTH 640 +#define WINDOW_HEIGHT 480 +#define NUM_SPRITES 100 +#define MAX_SPEED 1 + +static SDL_Surface *sprite; +static SDL_Rect positions[NUM_SPRITES]; +static SDL_Rect velocities[NUM_SPRITES]; +static int sprite_w, sprite_h; + +SDL_Window *window; +SDL_Surface *window_surf; +static int done; + +static SDL_Surface *CreateSurface(unsigned char *data, unsigned int len, int *w, int *h) { + SDL_Surface *surface = NULL; + SDL_IOStream *src = SDL_IOFromConstMem(data, len); + if (src) { + surface = SDL_LoadBMP_IO(src, SDL_TRUE); + if (surface) { + /* Treat white as transparent */ + SDL_SetSurfaceColorKey(surface, SDL_TRUE, SDL_MapSurfaceRGB(surface, 255, 255, 255)); + + *w = surface->w; + *h = surface->h; + } + } + return surface; +} + +static void MoveSprites(void) +{ + int i; + int window_w = WINDOW_WIDTH; + int window_h = WINDOW_HEIGHT; + SDL_Rect *position, *velocity; + Uint32 background = SDL_MapSurfaceRGB(window_surf, 0xA0, 0xA0, 0xA0); + SDL_FillSurfaceRect(window_surf, NULL, background); + + /* Move the sprite, bounce at the wall, and draw */ + for (i = 0; i < NUM_SPRITES; ++i) { + position = &positions[i]; + velocity = &velocities[i]; + position->x += velocity->x; + if ((position->x < 0) || (position->x >= (window_w - sprite_w))) { + velocity->x = -velocity->x; + position->x += velocity->x; + } + position->y += velocity->y; + if ((position->y < 0) || (position->y >= (window_h - sprite_h))) { + velocity->y = -velocity->y; + position->y += velocity->y; + } + + /* Blit the sprite onto the screen */ + SDL_BlitSurface(sprite, NULL, window_surf, position); + } + + /* Update the screen! */ + SDL_UpdateWindowSurface(window); +} + +static void loop(void) +{ + SDL_Event event; + + /* Check for events */ + while (SDL_PollEvent(&event)) { + if (event.type == SDL_EVENT_QUIT || event.type == SDL_EVENT_KEY_DOWN) { + done = 1; + } + } + MoveSprites(); +#ifdef SDL_PLATFORM_EMSCRIPTEN + if (done) { + emscripten_cancel_main_loop(); + } +#endif +} + +int main(int argc, char *argv[]) +{ + int return_code = -1; + int i; + + /* Enable standard application logging */ + SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); + + if (argc > 1) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "USAGE: %s\n", argv[0]); + return_code = 1; + goto quit; + } + + if ((window = SDL_CreateWindow("testspritesurface", WINDOW_WIDTH, WINDOW_HEIGHT, 0)) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create window (%s)", SDL_GetError()); + return_code = 2; + goto quit; + } + + if ((window_surf = SDL_GetWindowSurface(window)) == NULL) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't acquire window surface (%s)", SDL_GetError()); + return_code = 3; + goto quit; + } + + sprite = CreateSurface(icon_bmp, icon_bmp_len, &sprite_w, &sprite_h); + + if (!sprite) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't create surface (%s)", SDL_GetError()); + return_code = 4; + goto quit; + } + + /* Initialize the sprite positions */ + for (i = 0; i < NUM_SPRITES; ++i) { + positions[i].x = SDL_rand(WINDOW_WIDTH - sprite_w); + positions[i].y = SDL_rand(WINDOW_HEIGHT - sprite_h); + positions[i].w = sprite_w; + positions[i].h = sprite_h; + velocities[i].x = 0.0f; + velocities[i].y = 0.0f; + while (velocities[i].x == 0.f && velocities[i].y == 0.f) { + velocities[i].x = (SDL_rand(MAX_SPEED * 2 + 1)) - MAX_SPEED; + velocities[i].y = (SDL_rand(MAX_SPEED * 2 + 1)) - MAX_SPEED; + } + } + + /* Main render loop */ + done = 0; + +#ifdef SDL_PLATFORM_EMSCRIPTEN + emscripten_set_main_loop(loop, 0, 1); +#else + while (!done) { + loop(); + } +#endif + return_code = 0; +quit: + if (sprite) { + SDL_DestroySurface(sprite); + sprite = NULL; + } + if (window_surf) { + SDL_DestroyWindowSurface(window); + window_surf = NULL; + } + if (window) { + SDL_DestroyWindow(window); + window = NULL; + } + SDL_Quit(); + return return_code; +} From 9ecc531970acf84f006136cf8ef07643f1cf1418 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Wed, 10 Jul 2024 18:50:05 +0200 Subject: [PATCH 246/431] ci: bump NetBSD and FreeBSD --- .github/workflows/cpactions.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpactions.yml b/.github/workflows/cpactions.yml index cf57a7ec02f00..a401bbf83ab59 100644 --- a/.github/workflows/cpactions.yml +++ b/.github/workflows/cpactions.yml @@ -15,12 +15,12 @@ jobs: fail-fast: false matrix: platform: - - { name: FreeBSD, os: freebsd, os-version: 13.2, os-arch: x86-64, artifact: SDL-freebsd-x64, + - { name: FreeBSD, os: freebsd, os-version: '13.3', os-arch: x86-64, artifact: SDL-freebsd-x64, sdl-cmake-configure-arguments: '-DSDL_CHECK_REQUIRED_INCLUDES="/usr/local/include" -DSDL_CHECK_REQUIRED_LINK_OPTIONS="-L/usr/local/lib"', setup-cmd: 'sudo pkg update', install-cmd: 'sudo pkg install -y cmake ninja pkgconf libXcursor libXext libXinerama libXi libXfixes libXrandr libXScrnSaver libXxf86vm wayland wayland-protocols libxkbcommon mesa-libs libglvnd evdev-proto libinotify alsa-lib jackit pipewire pulseaudio sndio dbus zh-fcitx ibus libudev-devd', } - - { name: NetBSD, os: netbsd, os-version: 9.3, os-arch: x86-64, artifact: SDL-netbsd-x64, + - { name: NetBSD, os: netbsd, os-version: '10.0', os-arch: x86-64, artifact: SDL-netbsd-x64, sdl-cmake-configure-arguments: '', setup-cmd: 'export PATH="/usr/pkg/sbin:/usr/pkg/bin:/sbin:$PATH";export PKG_CONFIG_PATH="/usr/pkg/lib/pkgconfig";export PKG_PATH="https://cdn.netBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f "1 2" -d.)/All/";echo "PKG_PATH=$PKG_PATH";echo "uname -a -> \"$(uname -a)\"";sudo -E sysctl -w security.pax.aslr.enabled=0;sudo -E sysctl -w security.pax.aslr.global=0;sudo -E pkgin clean;sudo -E pkgin update', install-cmd: 'sudo -E pkgin -y install cmake dbus pkgconf ninja-build pulseaudio libxkbcommon wayland wayland-protocols libinotify libusb1', @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build - uses: cross-platform-actions/action@v0.23.0 + uses: cross-platform-actions/action@v0.24.0 with: operating_system: ${{ matrix.platform.os }} architecture: ${{ matrix.platform.os-arch }} From 131108ee4848c254c9d333450ce50f0efc42017e Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 11 Jul 2024 13:29:45 +0200 Subject: [PATCH 247/431] Remove references to SDL_CreatePixelFormat and SDL_DestroyPixelFormat --- src/dynapi/SDL_dynapi.sym | 2 -- test/testautomation_pixels.c | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 9e665952b8e01..7d23d89023d35 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -68,7 +68,6 @@ SDL3_0.0.0 { SDL_CreateHapticEffect; SDL_CreateMutex; SDL_CreatePalette; - SDL_CreatePixelFormat; SDL_CreatePopupWindow; SDL_CreateProperties; SDL_CreateRWLock; @@ -102,7 +101,6 @@ SDL3_0.0.0 { SDL_DestroyHapticEffect; SDL_DestroyMutex; SDL_DestroyPalette; - SDL_DestroyPixelFormat; SDL_DestroyProperties; SDL_DestroyRWLock; SDL_DestroyRenderer; diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c index 6819451fc90e8..5de4c461a124b 100644 --- a/test/testautomation_pixels.c +++ b/test/testautomation_pixels.c @@ -145,9 +145,6 @@ static int pixels_getPixelFormatDetails(void *arg) result->bytes_per_pixel); masks = result->Rmask | result->Gmask | result->Bmask | result->Amask; SDLTest_AssertCheck(masks == 0, "Verify value of result.[RGBA]mask combined; expected: 0, got %" SDL_PRIu32, masks); - - /* Deallocate again */ - SDLTest_AssertPass("Call to SDL_DestroyPixelFormat()"); } /* RGB formats */ @@ -189,7 +186,7 @@ static int pixels_getPixelFormatDetails(void *arg) SDLTest_AssertPass("Call to SDL_ClearError()"); format = g_invalidPixelFormats[i]; result = SDL_GetPixelFormatDetails(format); - SDLTest_AssertPass("Call to SDL_CreatePixelFormat(%d)", format); + SDLTest_AssertPass("Call to SDL_GetPixelFormatDetails(%d)", format); SDLTest_AssertCheck(result == NULL, "Verify result is NULL"); error = SDL_GetError(); SDLTest_AssertPass("Call to SDL_GetError()"); @@ -359,7 +356,7 @@ static int pixels_allocFreePalette(void *arg) /* Pixels test cases */ static const SDLTest_TestCaseReference pixelsTest1 = { - (SDLTest_TestCaseFp)pixels_getPixelFormatDetails, "pixels_allocFreeFormat", "Call to SDL_CreatePixelFormat and SDL_DestroyPixelFormat", TEST_ENABLED + (SDLTest_TestCaseFp)pixels_getPixelFormatDetails, "pixels_allocFreeFormat", "Call to SDL_GetPixelFormatDetails", TEST_ENABLED }; static const SDLTest_TestCaseReference pixelsTest2 = { From 83d4251540a48f50f66a1bca966025e18b82bf24 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 11 Jul 2024 13:34:34 +0200 Subject: [PATCH 248/431] hidapi: netbsd's iconv expects a 'char ** restrict src' --- src/hidapi/netbsd/hid.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hidapi/netbsd/hid.c b/src/hidapi/netbsd/hid.c index d804ed94923cb..82f34d4d1ce08 100644 --- a/src/hidapi/netbsd/hid.c +++ b/src/hidapi/netbsd/hid.c @@ -1060,7 +1060,7 @@ int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index struct usb_string_desc usd; usb_string_descriptor_t *str; iconv_t ic; - const char *src; + char *src; size_t srcleft; char *dst; size_t dstleft; @@ -1104,7 +1104,7 @@ int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index return -1; } - src = (const char *) str->bString; + src = (char *) str->bString; srcleft = str->bLength - 2; dst = (char *) string; dstleft = sizeof(wchar_t[maxlen]); From 875c4f0a4ce2003ee64db6218526664fb718d618 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Jul 2024 00:40:27 -0700 Subject: [PATCH 249/431] Support indexed surfaces without palettes (thanks @sulix!) Currently, all SDL_Surfaces with an indexed pixel format have an associated SDL_Palette. This palette either consists of entirely the colour black, or -- in the special case of 1-bit surfaces, black and white. When an indexed surface is blitted to another indexed surface, a 'map' is generated from the source surface's palette to the destination surfaces palette, in order to preserve the look of the image if the palettes differ. However, in most cases, applications will want to blit the raw index values, rather than translate to make the colours as similar as possible. For instance, the destination surface's palette may have been modified to fade the screen out. This change allows an indexed surface to have no associated palette. If either the source or destination surface of a blit do not have a palette, then the raw indices are copied (assuming both have an indexed format). This mimics better what happens with most other APIs (such as DirectDraw), where most users do not set a palette on any surface but the screen, whose palette is implicitly used for the whole application. --- docs/README-migration.md | 2 ++ src/video/SDL_bmp.c | 22 ++++++++++------ src/video/SDL_pixels.c | 20 ++++++++++++--- src/video/SDL_surface.c | 19 -------------- test/testautomation_surface.c | 47 ++++++++++++++++++++++++----------- 5 files changed, 65 insertions(+), 45 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 7f20130596155..85fab337eb2b7 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1632,6 +1632,8 @@ The `format` member of SDL_Surface is now an enumerated pixel format value. You The userdata member of SDL_Surface has been replaced with a more general properties interface, which can be queried with SDL_GetSurfaceProperties() +Indexed format surfaces no longer have a palette by default. Surfaces without a palette will copy the pixels untranslated between surfaces. You should use SDL_CreatePalette() to create a palette and call SDL_SetSurfacePalette() to associate it with the final indexed surface before copying it to color pixels. + Removed the unused 'flags' parameter from SDL_ConvertSurface. SDL_CreateRGBSurface() and SDL_CreateRGBSurfaceWithFormat() have been combined into a new function SDL_CreateSurface(). diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index 02afb3c699a8e..b726b20382d2a 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -203,7 +203,6 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) Uint32 Gmask = 0; Uint32 Bmask = 0; Uint32 Amask = 0; - SDL_Palette *palette; Uint8 *bits; Uint8 *top, *end; SDL_bool topDown; @@ -439,8 +438,10 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) } /* Load the palette, if any */ - palette = SDL_GetSurfacePalette(surface); - if (palette) { + if (SDL_ISPIXELFORMAT_INDEXED(surface->format)) { + int max_colors = (1 << SDL_BITSPERPIXEL(surface->format)); + SDL_Palette *palette; + if (SDL_SeekIO(src, fp_offset + 14 + biSize, SDL_IO_SEEK_SET) < 0) { SDL_SetError("Error seeking in datastream"); goto done; @@ -455,14 +456,19 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) biClrUsed = 1 << biBitCount; } - if (biClrUsed > (Uint32)palette->ncolors) { + if (biClrUsed > (Uint32)max_colors) { biClrUsed = 1 << biBitCount; /* try forcing it? */ - if (biClrUsed > (Uint32)palette->ncolors) { + if (biClrUsed > (Uint32)max_colors) { SDL_SetError("Unsupported or incorrect biClrUsed field"); goto done; } } + palette = SDL_CreatePalette(biClrUsed); + if (!palette) { + goto done; + } + if (biSize == 12) { for (i = 0; i < (int)biClrUsed; ++i) { if (!SDL_ReadU8(src, &palette->colors[i].b) || @@ -488,7 +494,9 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) palette->colors[i].a = SDL_ALPHA_OPAQUE; } } - palette->ncolors = biClrUsed; + + SDL_SetSurfacePalette(surface, palette); + SDL_DestroyPalette(palette); } /* Read the surface pixels. Note that the bmp image is upside down */ @@ -515,7 +523,7 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) if (SDL_ReadIO(src, bits, surface->pitch) != (size_t)surface->pitch) { goto done; } - if (biBitCount == 8 && palette && biClrUsed < (1u << biBitCount)) { + if (biBitCount == 8 && surface->internal->palette && biClrUsed < (1u << biBitCount)) { for (i = 0; i < surface->w; ++i) { if (bits[i] >= biClrUsed) { SDL_SetError("A BMP image contains a pixel with a color out of the palette"); diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 3202f13215dba..f692bf6fdef64 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -1022,8 +1022,7 @@ SDL_Palette *SDL_CreatePalette(int ncolors) if (!palette) { return NULL; } - palette->colors = - (SDL_Color *)SDL_malloc(ncolors * sizeof(*palette->colors)); + palette->colors = (SDL_Color *)SDL_malloc(ncolors * sizeof(*palette->colors)); if (!palette->colors) { SDL_free(palette); return NULL; @@ -1386,6 +1385,11 @@ static Uint8 *Map1toN(const SDL_Palette *pal, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod return NULL; } + /* An all-zero map for surfaces without a palette. */ + if (!pal) { + return map; + } + /* We memory copy to the pixel map so the endianness is preserved */ for (i = 0; i < pal->ncolors; ++i) { Uint8 R = (Uint8)((pal->colors[i].r * Rmod) / 255); @@ -1405,6 +1409,11 @@ static Uint8 *MapNto1(const SDL_PixelFormatDetails *src, const SDL_Palette *pal, SDL_Palette dithered; SDL_Color colors[256]; + if (!pal) { + *identical = 1; + return NULL; + } + dithered.ncolors = 256; SDL_DitherColors(colors, 8); dithered.colors = colors; @@ -1467,8 +1476,11 @@ int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst) if (SDL_ISPIXELFORMAT_INDEXED(srcfmt->format)) { if (SDL_ISPIXELFORMAT_INDEXED(dstfmt->format)) { /* Palette --> Palette */ - map->info.table = - Map1to1(srcpal, dstpal, &map->identity); + if (srcpal && dstpal) { + map->info.table = Map1to1(srcpal, dstpal, &map->identity); + } else { + map->identity = 1; + } if (!map->identity) { if (!map->info.table) { return -1; diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index c86f84e722468..ab24c3466a542 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -158,25 +158,6 @@ static SDL_Surface *SDL_InitializeSurface(SDL_InternalSurface *mem, int width, i surface->internal->map.info.b = 0xFF; surface->internal->map.info.a = 0xFF; - if (SDL_ISPIXELFORMAT_INDEXED(surface->format)) { - SDL_Palette *palette = SDL_CreatePalette((1 << SDL_BITSPERPIXEL(surface->format))); - if (!palette) { - SDL_DestroySurface(surface); - return NULL; - } - if (palette->ncolors == 2) { - /* Create a black and white bitmap palette */ - palette->colors[0].r = 0xFF; - palette->colors[0].g = 0xFF; - palette->colors[0].b = 0xFF; - palette->colors[1].r = 0x00; - palette->colors[1].g = 0x00; - palette->colors[1].b = 0x00; - } - SDL_SetSurfacePalette(surface, palette); - SDL_DestroyPalette(palette); - } - if (colorspace != SDL_COLORSPACE_UNKNOWN && colorspace != SDL_GetDefaultColorspaceForFormat(format)) { SDL_SetSurfaceColorspace(surface, colorspace); diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 41284587b19ab..878c3a5096aa5 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -854,37 +854,54 @@ static int surface_testFlip(void *arg) static int surface_testPalette(void *arg) { - SDL_Surface *surface, *output; + SDL_Surface *source, *surface, *output; SDL_Palette *palette; Uint8 *pixels; - int offset; + + palette = SDL_CreatePalette(2); + SDLTest_AssertCheck(palette != NULL, "SDL_CreatePalette()"); + + source = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_INDEX8); + SDLTest_AssertCheck(source != NULL, "SDL_CreateSurface()"); surface = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_INDEX8); SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); + pixels = (Uint8 *)surface->pixels; + SDLTest_AssertCheck(*pixels == 0, "Expected *pixels == 0 got %u", *pixels); + + /* Identity copy between indexed surfaces without a palette */ + *(Uint8 *)source->pixels = 1; + SDL_BlitSurface(source, NULL, surface, NULL); + SDLTest_AssertCheck(*pixels == 1, "Expected *pixels == 1 got %u", *pixels); + + /* Identity copy between indexed surfaces where the destination has a palette */ + palette->colors[0].r = 0; + palette->colors[0].g = 0; + palette->colors[0].b = 0; + palette->colors[1].r = 0xFF; + palette->colors[1].g = 0; + palette->colors[1].b = 0; + SDL_SetSurfacePalette(surface, palette); + *pixels = 0; + SDL_BlitSurface(source, NULL, surface, NULL); + SDLTest_AssertCheck(*pixels == 1, "Expected *pixels == 1 got %u", *pixels); + output = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_RGBA32); SDLTest_AssertCheck(output != NULL, "SDL_CreateSurface()"); - *(Uint8 *)surface->pixels = 255; - pixels = (Uint8 *)output->pixels; - offset = 0; - SDL_BlitSurface(surface, NULL, output, NULL); - SDLTest_AssertCheck(pixels[offset] == 0xFF, - "Expected pixels[%d] == 0xFF got 0x%.2X", offset, pixels[offset]); + SDLTest_AssertCheck(*pixels == 0xFF, "Expected *pixels == 0xFF got 0x%.2X", *pixels); /* Set the palette color and blit again */ - palette = SDL_GetSurfacePalette(surface); - SDLTest_AssertCheck(palette != NULL, "Expected palette != NULL, got %p", palette); - if (palette) { - palette->colors[255].r = 0xAA; - } + palette->colors[1].r = 0xAA; SDL_SetSurfacePalette(surface, palette); SDL_BlitSurface(surface, NULL, output, NULL); - SDLTest_AssertCheck(pixels[offset] == 0xAA, - "Expected pixels[%d] == 0xAA got 0x%.2X", offset, pixels[offset]); + SDLTest_AssertCheck(*pixels == 0xAA, "Expected *pixels == 0xAA got 0x%.2X", *pixels); + SDL_DestroyPalette(palette); + SDL_DestroySurface(source); SDL_DestroySurface(surface); SDL_DestroySurface(output); From f437fe75f24d89f3fb1c40d2c30e6a406a00f8db Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 11 Jul 2024 18:56:40 +0300 Subject: [PATCH 250/431] SDL_dynapi_overrides.h: remove left-over SDL_DestroyPixelFormat entry. --- src/dynapi/SDL_dynapi_overrides.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index e1107a0e7e99c..ebd709cb21d05 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -126,7 +126,6 @@ #define SDL_DestroyHapticEffect SDL_DestroyHapticEffect_REAL #define SDL_DestroyMutex SDL_DestroyMutex_REAL #define SDL_DestroyPalette SDL_DestroyPalette_REAL -#define SDL_DestroyPixelFormat SDL_DestroyPixelFormat_REAL #define SDL_DestroyProperties SDL_DestroyProperties_REAL #define SDL_DestroyRWLock SDL_DestroyRWLock_REAL #define SDL_DestroyRenderer SDL_DestroyRenderer_REAL From 186fec256057ff49a1941112580f39f11583dcb0 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Thu, 11 Jul 2024 12:50:21 -0400 Subject: [PATCH 251/431] pipewire: Consolidate registry enumeration instances The preferred Pipewire path requires both devices being available, and that a sufficiently recent underlying core version is running on the host system. These criteria were being checked separately, which required two separate instances of enumerating the Pipewire registry, which is a fairly heavy operation. Move the version info callback to the main hotplug thread to avoid enumerating the registry twice, and check for both the version and required devices at the same time on the preferred path. --- src/audio/pipewire/SDL_pipewire.c | 122 +++++++----------------------- 1 file changed, 27 insertions(+), 95 deletions(-) diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c index 9b943a0665c3e..8fa2363cb9a52 100644 --- a/src/audio/pipewire/SDL_pipewire.c +++ b/src/audio/pipewire/SDL_pipewire.c @@ -179,99 +179,12 @@ static int load_pipewire_syms(void) return 0; } -/* When in a container, the library version can differ from the underlying core version, - * so make sure the underlying Pipewire implementation meets the version requirement. - */ -struct version_data -{ - struct pw_main_loop *loop; - int major, minor, patch; - int seq; -}; - -void version_check_core_info_callback(void *data, const struct pw_core_info *info) -{ - struct version_data *v = data; - - if (SDL_sscanf(info->version, "%d.%d.%d", &v->major, &v->minor, &v->patch) < 3) { - v->major = 0; - v->minor = 0; - v->patch = 0; - } -} - -void version_check_core_done_callback(void *data, uint32_t id, int seq) -{ - struct version_data *v = data; - - if (id == PW_ID_CORE && v->seq == seq) { - PIPEWIRE_pw_main_loop_quit(v->loop); - } -} - -static const struct pw_core_events version_check_core_events = { PW_VERSION_CORE_EVENTS, .info = version_check_core_info_callback, .done = version_check_core_done_callback }; - -SDL_bool pipewire_core_version_at_least(int major, int minor, int patch) -{ - struct pw_main_loop *loop = NULL; - struct pw_context *context = NULL; - struct pw_core *core = NULL; - struct version_data version_data; - struct spa_hook core_listener; - SDL_bool ret = SDL_FALSE; - - loop = PIPEWIRE_pw_main_loop_new(NULL); - if (!loop) { - goto done; - } - - context = PIPEWIRE_pw_context_new(PIPEWIRE_pw_main_loop_get_loop(loop), NULL, 0); - if (!context) { - goto done; - } - - core = PIPEWIRE_pw_context_connect(context, NULL, 0); - if (!core) { - goto done; - } - - /* Attach a core listener and get the version. */ - spa_zero(version_data); - version_data.loop = loop; - pw_core_add_listener(core, &core_listener, &version_check_core_events, &version_data); - version_data.seq = pw_core_sync(core, PW_ID_CORE, 0); - - PIPEWIRE_pw_main_loop_run(loop); - - spa_hook_remove(&core_listener); - - ret = (version_data.major >= major) && - (version_data.major > major || version_data.minor >= minor) && - (version_data.major > major || version_data.minor > minor || version_data.patch >= patch); - -done: - if (core) { - PIPEWIRE_pw_core_disconnect(core); - } - if (context) { - PIPEWIRE_pw_context_destroy(context); - } - if (loop) { - PIPEWIRE_pw_main_loop_destroy(loop); - } - - return ret; -} - -static int init_pipewire_library(SDL_bool check_preferred_version) +static int init_pipewire_library() { if (!load_pipewire_library()) { if (!load_pipewire_syms()) { PIPEWIRE_pw_init(NULL, NULL); - - if (!check_preferred_version || pipewire_core_version_at_least(1, 0, 0)) { - return 0; - } + return 0; } } @@ -335,9 +248,19 @@ static int hotplug_init_seq_val; static SDL_bool hotplug_init_complete; static SDL_bool hotplug_events_enabled; +static int pipewire_version_major; +static int pipewire_version_minor; +static int pipewire_version_patch; static char *pipewire_default_sink_id = NULL; static char *pipewire_default_source_id = NULL; +static SDL_bool pipewire_core_version_at_least(int major, int minor, int patch) +{ + return (pipewire_version_major >= major) && + (pipewire_version_major > major || pipewire_version_minor >= minor) && + (pipewire_version_major > major || pipewire_version_minor > minor || pipewire_version_patch >= patch); +} + // The active node list static SDL_bool io_list_check_add(struct io_node *node) { @@ -484,6 +407,15 @@ static void core_events_hotplug_init_callback(void *object, uint32_t id, int seq } } +static void core_events_hotplug_info_callback(void *data, const struct pw_core_info *info) +{ + if (SDL_sscanf(info->version, "%d.%d.%d", &pipewire_version_major, &pipewire_version_minor, &pipewire_version_patch) < 3) { + pipewire_version_major = 0; + pipewire_version_minor = 0; + pipewire_version_patch = 0; + } +} + static void core_events_interface_callback(void *object, uint32_t id, int seq) { struct node_object *node = object; @@ -511,7 +443,7 @@ static void core_events_metadata_callback(void *object, uint32_t id, int seq) } } -static const struct pw_core_events hotplug_init_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_hotplug_init_callback }; +static const struct pw_core_events hotplug_init_core_events = { PW_VERSION_CORE_EVENTS, .info = core_events_hotplug_info_callback, .done = core_events_hotplug_init_callback }; static const struct pw_core_events interface_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_interface_callback }; static const struct pw_core_events metadata_core_events = { PW_VERSION_CORE_EVENTS, .done = core_events_metadata_callback }; @@ -1292,11 +1224,11 @@ static void PIPEWIRE_Deinitialize(void) } } -static SDL_bool PipewireInitialize(SDL_AudioDriverImpl *impl, SDL_bool check_preferred_version) +static SDL_bool PipewireInitialize(SDL_AudioDriverImpl *impl) { if (!pipewire_initialized) { - if (init_pipewire_library(check_preferred_version) < 0) { + if (init_pipewire_library() < 0) { return SDL_FALSE; } @@ -1326,7 +1258,7 @@ static SDL_bool PipewireInitialize(SDL_AudioDriverImpl *impl, SDL_bool check_pre static SDL_bool PIPEWIRE_PREFERRED_Init(SDL_AudioDriverImpl *impl) { - if (!PipewireInitialize(impl, SDL_TRUE)) { + if (!PipewireInitialize(impl)) { return SDL_FALSE; } @@ -1342,7 +1274,7 @@ static SDL_bool PIPEWIRE_PREFERRED_Init(SDL_AudioDriverImpl *impl) PIPEWIRE_pw_thread_loop_unlock(hotplug_loop); - if (no_devices) { + if (no_devices || !pipewire_core_version_at_least(1, 0, 0)) { PIPEWIRE_Deinitialize(); return SDL_FALSE; } @@ -1352,7 +1284,7 @@ static SDL_bool PIPEWIRE_PREFERRED_Init(SDL_AudioDriverImpl *impl) static SDL_bool PIPEWIRE_Init(SDL_AudioDriverImpl *impl) { - return PipewireInitialize(impl, SDL_FALSE); + return PipewireInitialize(impl); } AudioBootStrap PIPEWIRE_PREFERRED_bootstrap = { From 1993ef664e7dc31e41f8f2bdcdf6746641005863 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 11 Jul 2024 12:58:28 -0400 Subject: [PATCH 252/431] Add SDL_Vulkan_GetPresentationSupport --- include/SDL3/SDL_vulkan.h | 20 ++++++++++ src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/video/SDL_sysvideo.h | 1 + src/video/SDL_video.c | 18 +++++++++ src/video/wayland/SDL_waylandvideo.c | 1 + src/video/wayland/SDL_waylandvulkan.c | 28 ++++++++++++++ src/video/wayland/SDL_waylandvulkan.h | 4 ++ src/video/windows/SDL_windowsvideo.c | 1 + src/video/windows/SDL_windowsvulkan.c | 27 +++++++++++++ src/video/windows/SDL_windowsvulkan.h | 4 ++ src/video/x11/SDL_x11video.c | 1 + src/video/x11/SDL_x11vulkan.c | 55 +++++++++++++++++++++++++++ src/video/x11/SDL_x11vulkan.h | 4 ++ 15 files changed, 167 insertions(+) diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index 7361621297c47..ca4bf7161186d 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -51,6 +51,7 @@ extern "C" { #endif VK_DEFINE_HANDLE(VkInstance) +VK_DEFINE_HANDLE(VkPhysicalDevice) VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR) struct VkAllocationCallbacks; @@ -211,6 +212,25 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_DestroySurface(VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); +/** + * Query support for presentation via a given physical device and queue family. + * + * The `instance` must have been created with extensions returned by + * SDL_Vulkan_GetInstanceExtensions() enabled. + * + * \param instance the Vulkan instance handle. + * \param physicalDevice a valid Vulkan physical device handle. + * \param queueFamilyIndex a valid queue family index for the given physical device. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported or an error occurred. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_Vulkan_GetInstanceExtensions + */ +extern SDL_DECLSPEC SDL_bool SDLCALL SDL_Vulkan_GetPresentationSupport(VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex); + /* @} *//* Vulkan support functions */ /* Ends C function definitions when using C++ */ diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 7d23d89023d35..5339837acecfa 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -1045,6 +1045,7 @@ SDL3_0.0.0 { SDL_wcsnstr; SDL_wcsstr; SDL_wcstol; + SDL_Vulkan_GetPresentationSupport; # extra symbols go here (don't modify this line) local: *; }; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index ebd709cb21d05..6b940e0794bba 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -1070,3 +1070,4 @@ #define SDL_wcsnstr SDL_wcsnstr_REAL #define SDL_wcsstr SDL_wcsstr_REAL #define SDL_wcstol SDL_wcstol_REAL +#define SDL_Vulkan_GetPresentationSupport SDL_Vulkan_GetPresentationSupport_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 2399bfc4ff305..acef1b9813d8f 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -1076,3 +1076,4 @@ SDL_DYNAPI_PROC(size_t,SDL_wcsnlen,(const wchar_t *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(wchar_t*,SDL_wcsnstr,(const wchar_t *a, const wchar_t *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(wchar_t*,SDL_wcsstr,(const wchar_t *a, const wchar_t *b),(a,b),return) SDL_DYNAPI_PROC(long,SDL_wcstol,(const wchar_t *a, wchar_t **b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_GetPresentationSupport,(VkInstance a, VkPhysicalDevice b, Uint32 c),(a,b,c),return) diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index f648fd0e222ff..4a3d039084048 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -304,6 +304,7 @@ struct SDL_VideoDevice char const* const* (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count); int (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface); void (*Vulkan_DestroySurface)(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); + SDL_bool (*Vulkan_GetPresentationSupport)(SDL_VideoDevice *_this, VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex); /* * * */ /* diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 516ac5369c407..9e7026cb37480 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5526,6 +5526,24 @@ void SDL_Vulkan_DestroySurface(VkInstance instance, } } +SDL_bool SDL_Vulkan_GetPresentationSupport(VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex) +{ + if (_this && instance && physicalDevice) { + if (_this->Vulkan_GetPresentationSupport) { + return _this->Vulkan_GetPresentationSupport(_this, instance, physicalDevice, queueFamilyIndex); + } + + /* If the backend does not have this function then it does not have a + * WSI function to query it; in other words it's not necessary to check + * as it is always supported. + */ + return SDL_TRUE; + } + return SDL_FALSE; +} + SDL_MetalView SDL_Metal_CreateView(SDL_Window *window) { CHECK_WINDOW_MAGIC(window, NULL); diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 6f07959e25937..dc7232b09f66d 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -519,6 +519,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) device->Vulkan_GetInstanceExtensions = Wayland_Vulkan_GetInstanceExtensions; device->Vulkan_CreateSurface = Wayland_Vulkan_CreateSurface; device->Vulkan_DestroySurface = Wayland_Vulkan_DestroySurface; + device->Vulkan_GetPresentationSupport = Wayland_Vulkan_GetPresentationSupport; #endif device->free = Wayland_DeleteDevice; diff --git a/src/video/wayland/SDL_waylandvulkan.c b/src/video/wayland/SDL_waylandvulkan.c index 1bcb262dce961..e6d78aa1a9ae5 100644 --- a/src/video/wayland/SDL_waylandvulkan.c +++ b/src/video/wayland/SDL_waylandvulkan.c @@ -175,4 +175,32 @@ void Wayland_Vulkan_DestroySurface(SDL_VideoDevice *_this, } } +SDL_bool Wayland_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, + VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex) +{ + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = + (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; + PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR vkGetPhysicalDeviceWaylandPresentationSupportKHR = + (PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)vkGetInstanceProcAddr( + instance, + "vkGetPhysicalDeviceWaylandPresentationSupportKHR"); + + if (!_this->vulkan_config.loader_handle) { + SDL_SetError("Vulkan is not loaded"); + return SDL_FALSE; + } + + if (!vkGetPhysicalDeviceWaylandPresentationSupportKHR) { + SDL_SetError(VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME + " extension is not enabled in the Vulkan instance."); + return SDL_FALSE; + } + + return vkGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, + queueFamilyIndex, + _this->driverdata->display); +} + #endif diff --git a/src/video/wayland/SDL_waylandvulkan.h b/src/video/wayland/SDL_waylandvulkan.h index 85d2adaee197a..b71433c40bc04 100644 --- a/src/video/wayland/SDL_waylandvulkan.h +++ b/src/video/wayland/SDL_waylandvulkan.h @@ -46,6 +46,10 @@ void Wayland_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); +SDL_bool Wayland_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, + VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex); #endif diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 688bc04b6a9bd..757a3f6bd2b4a 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -263,6 +263,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void) device->Vulkan_GetInstanceExtensions = WIN_Vulkan_GetInstanceExtensions; device->Vulkan_CreateSurface = WIN_Vulkan_CreateSurface; device->Vulkan_DestroySurface = WIN_Vulkan_DestroySurface; + device->Vulkan_GetPresentationSupport = WIN_Vulkan_GetPresentationSupport; #endif #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) diff --git a/src/video/windows/SDL_windowsvulkan.c b/src/video/windows/SDL_windowsvulkan.c index 1584c526b0297..bd774df5f3c56 100644 --- a/src/video/windows/SDL_windowsvulkan.c +++ b/src/video/windows/SDL_windowsvulkan.c @@ -166,4 +166,31 @@ void WIN_Vulkan_DestroySurface(SDL_VideoDevice *_this, } } +SDL_bool WIN_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, + VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex) +{ + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = + (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; + PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR vkGetPhysicalDeviceWin32PresentationSupportKHR = + (PFN_vkGetPhysicalDeviceWin32PresentationSupportKHR)vkGetInstanceProcAddr( + instance, + "vkGetPhysicalDeviceWin32PresentationSupportKHR"); + + if (!_this->vulkan_config.loader_handle) { + SDL_SetError("Vulkan is not loaded"); + return SDL_FALSE; + } + + if (!vkGetPhysicalDeviceWin32PresentationSupportKHR) { + SDL_SetError(VK_KHR_WIN32_SURFACE_EXTENSION_NAME + " extension is not enabled in the Vulkan instance."); + return SDL_FALSE; + } + + return vkGetPhysicalDeviceWin32PresentationSupportKHR(physicalDevice, + queueFamilyIndex); +} + #endif diff --git a/src/video/windows/SDL_windowsvulkan.h b/src/video/windows/SDL_windowsvulkan.h index 474a6fce4c656..ea74856cb39d3 100644 --- a/src/video/windows/SDL_windowsvulkan.h +++ b/src/video/windows/SDL_windowsvulkan.h @@ -46,6 +46,10 @@ void WIN_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); +SDL_bool WIN_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, + VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex); #endif diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 2f87933f15aea..afba879ff024c 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -280,6 +280,7 @@ static SDL_VideoDevice *X11_CreateDevice(void) device->Vulkan_GetInstanceExtensions = X11_Vulkan_GetInstanceExtensions; device->Vulkan_CreateSurface = X11_Vulkan_CreateSurface; device->Vulkan_DestroySurface = X11_Vulkan_DestroySurface; + device->Vulkan_GetPresentationSupport = X11_Vulkan_GetPresentationSupport; #endif #ifdef SDL_USE_LIBDBUS diff --git a/src/video/x11/SDL_x11vulkan.c b/src/video/x11/SDL_x11vulkan.c index 25d4f90f789b5..8aa07221d1f53 100644 --- a/src/video/x11/SDL_x11vulkan.c +++ b/src/video/x11/SDL_x11vulkan.c @@ -232,4 +232,59 @@ void X11_Vulkan_DestroySurface(SDL_VideoDevice *_this, } } +SDL_bool X11_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, + VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex) +{ + SDL_VideoData *videoData = _this->driverdata; + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; + const char *forced_visual_id; + VisualID visualid; + + if (!_this->vulkan_config.loader_handle) { + return SDL_SetError("Vulkan is not loaded"); + } + vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; + + forced_visual_id = SDL_GetHint(SDL_HINT_VIDEO_X11_WINDOW_VISUALID); + if (forced_visual_id) { + visualid = SDL_strtol(forced_visual_id, NULL, 0); + } else { + visualid = X11_XVisualIDFromVisual(DefaultVisual(videoData->display, DefaultScreen(videoData->display))); + } + + if (videoData->vulkan_xlib_xcb_library) { + PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR vkGetPhysicalDeviceXcbPresentationSupportKHR = + (PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)vkGetInstanceProcAddr( + instance, + "vkGetPhysicalDeviceXcbPresentationSupportKHR"); + + if (!vkGetPhysicalDeviceXcbPresentationSupportKHR) { + SDL_SetError(VK_KHR_XCB_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); + return SDL_FALSE; + } + + return vkGetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice, + queueFamilyIndex, + videoData->vulkan_XGetXCBConnection(videoData->display), + visualid); + } else { + PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR vkGetPhysicalDeviceXlibPresentationSupportKHR = + (PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)vkGetInstanceProcAddr( + instance, + "vkGetPhysicalDeviceXlibPresentationSupportKHR"); + + if (!vkGetPhysicalDeviceXlibPresentationSupportKHR) { + SDL_SetError(VK_KHR_XLIB_SURFACE_EXTENSION_NAME " extension is not enabled in the Vulkan instance."); + return SDL_FALSE; + } + + return vkGetPhysicalDeviceXlibPresentationSupportKHR(physicalDevice, + queueFamilyIndex, + videoData->display, + visualid); + } +} + #endif diff --git a/src/video/x11/SDL_x11vulkan.h b/src/video/x11/SDL_x11vulkan.h index 217ea726d9439..23d91616094fa 100644 --- a/src/video/x11/SDL_x11vulkan.h +++ b/src/video/x11/SDL_x11vulkan.h @@ -43,6 +43,10 @@ void X11_Vulkan_DestroySurface(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator); +SDL_bool X11_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, + VkInstance instance, + VkPhysicalDevice physicalDevice, + Uint32 queueFamilyIndex); #endif From 5d506a53a63df41b70a88716a9be7dd24bbd733d Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 11 Jul 2024 14:19:26 -0400 Subject: [PATCH 253/431] testvulkan: Add call to SDL_Vulkan_GetPresentationSupport --- test/testvulkan.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/testvulkan.c b/test/testvulkan.c index e6c7bc432f8e0..2fbac6ce2541f 100644 --- a/test/testvulkan.c +++ b/test/testvulkan.c @@ -307,6 +307,7 @@ static void findPhysicalDevice(void) uint32_t queueFamilyIndex; uint32_t deviceExtensionCount = 0; SDL_bool hasSwapchainExtension = SDL_FALSE; + SDL_bool supportsPresent; uint32_t i; VkPhysicalDevice physicalDevice = physicalDevices[physicalDeviceIndex]; @@ -354,6 +355,22 @@ static void findPhysicalDevice(void) quit(2); } if (supported) { + /* This check isn't necessary if you are able to check a + * VkSurfaceKHR like above, but just as a sanity check we do + * this here as part of testing the API. + * -flibit + */ + supportsPresent = SDL_Vulkan_GetPresentationSupport(vulkanContext->instance, physicalDevice, queueFamilyIndex); + if (!supportsPresent) { + SDL_free(physicalDevices); + SDL_free(queueFamiliesProperties); + SDL_free(deviceExtensions); + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, + "SDL_Vulkan_GetPresentationSupport(): %s\n", + SDL_GetError()); + quit(2); + } + vulkanContext->presentQueueFamilyIndex = queueFamilyIndex; if (queueFamiliesProperties[queueFamilyIndex].queueFlags & VK_QUEUE_GRAPHICS_BIT) { break; // use this queue because it can present and do graphics From 8d24bb8dfc6bfc4b1d5c9952fd74c2b96378264e Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 11 Jul 2024 14:45:46 -0400 Subject: [PATCH 254/431] video: Added parameter checks to SDL_Vulkan_GetPresentationSupport --- src/video/SDL_video.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 9e7026cb37480..be4e42f38fde9 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -5530,18 +5530,30 @@ SDL_bool SDL_Vulkan_GetPresentationSupport(VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex) { - if (_this && instance && physicalDevice) { - if (_this->Vulkan_GetPresentationSupport) { - return _this->Vulkan_GetPresentationSupport(_this, instance, physicalDevice, queueFamilyIndex); - } + if (!_this) { + SDL_UninitializedVideo(); + return SDL_FALSE; + } - /* If the backend does not have this function then it does not have a - * WSI function to query it; in other words it's not necessary to check - * as it is always supported. - */ - return SDL_TRUE; + if (!instance) { + SDL_InvalidParamError("instance"); + return SDL_FALSE; } - return SDL_FALSE; + + if (!physicalDevice) { + SDL_InvalidParamError("physicalDevice"); + return SDL_FALSE; + } + + if (_this->Vulkan_GetPresentationSupport) { + return _this->Vulkan_GetPresentationSupport(_this, instance, physicalDevice, queueFamilyIndex); + } + + /* If the backend does not have this function then it does not have a + * WSI function to query it; in other words it's not necessary to check + * as it is always supported. + */ + return SDL_TRUE; } SDL_MetalView SDL_Metal_CreateView(SDL_Window *window) From f0ceb92dca2b776121a26876bad708d7ab26e928 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Thu, 11 Jul 2024 19:01:27 +0000 Subject: [PATCH 255/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_vulkan.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index ca4bf7161186d..639487ac15415 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -213,15 +213,18 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_DestroySurface(VkInstance instance, const struct VkAllocationCallbacks *allocator); /** - * Query support for presentation via a given physical device and queue family. + * Query support for presentation via a given physical device and queue + * family. * * The `instance` must have been created with extensions returned by * SDL_Vulkan_GetInstanceExtensions() enabled. * * \param instance the Vulkan instance handle. * \param physicalDevice a valid Vulkan physical device handle. - * \param queueFamilyIndex a valid queue family index for the given physical device. - * \returns SDL_TRUE if supported, SDL_FALSE if unsupported or an error occurred. + * \param queueFamilyIndex a valid queue family index for the given physical + * device. + * \returns SDL_TRUE if supported, SDL_FALSE if unsupported or an error + * occurred. * * \since This function is available since SDL 3.0.0. * From b5170439368d1ea6f57220c725bdfeb99ad78e82 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Jul 2024 10:38:40 -0700 Subject: [PATCH 256/431] Added TLS initialization and shutdown functions Fixes https://github.com/libsdl-org/SDL/issues/8576 --- src/SDL.c | 6 +- src/thread/SDL_systhread.h | 6 ++ src/thread/SDL_thread.c | 92 +++++++++++++++++++++-------- src/thread/SDL_thread_c.h | 12 ++-- src/thread/generic/SDL_systls.c | 11 ++++ src/thread/pthread/SDL_systls.c | 42 ++++++++----- src/thread/stdcpp/SDL_systhread.cpp | 25 ++++++-- src/thread/windows/SDL_systls.c | 44 +++++++++----- 8 files changed, 171 insertions(+), 67 deletions(-) diff --git a/src/SDL.c b/src/SDL.c index 9c6cd58cbff78..7e8a5f059f5e9 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -50,6 +50,7 @@ #include "render/SDL_sysrender.h" #include "sensor/SDL_sensor_c.h" #include "stdlib/SDL_getenv_c.h" +#include "thread/SDL_thread_c.h" #include "video/SDL_pixels_c.h" #include "video/SDL_video_c.h" @@ -189,6 +190,7 @@ int SDL_InitSubSystem(Uint32 flags) return SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); } + SDL_InitTLSData(); SDL_InitLog(); SDL_InitProperties(); SDL_GetGlobalProperties(); @@ -563,10 +565,8 @@ void SDL_Quit(void) SDL_memset(SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount)); SDL_FlushEventMemory(0); - - SDL_CleanupTLS(); - SDL_FreeEnvironmentMemory(); + SDL_QuitTLSData(); SDL_bInMainQuit = SDL_FALSE; } diff --git a/src/thread/SDL_systhread.h b/src/thread/SDL_systhread.h index c1c6ba2923ea2..55af6e5f2622c 100644 --- a/src/thread/SDL_systhread.h +++ b/src/thread/SDL_systhread.h @@ -54,12 +54,18 @@ extern void SDL_SYS_WaitThread(SDL_Thread *thread); /* Mark thread as cleaned up as soon as it exits, without joining. */ extern void SDL_SYS_DetachThread(SDL_Thread *thread); +/* Initialize the global TLS data */ +extern void SDL_SYS_InitTLSData(void); + /* Get the thread local storage for this thread */ extern SDL_TLSData *SDL_SYS_GetTLSData(void); /* Set the thread local storage for this thread */ extern int SDL_SYS_SetTLSData(SDL_TLSData *data); +/* Quit the global TLS data */ +extern void SDL_SYS_QuitTLSData(void); + /* A helper function for setting up a thread with a stack size. */ extern SDL_Thread *SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, size_t stacksize, void *data); diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 1589a56ad5f7e..dfb45c8bee735 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -26,6 +26,15 @@ #include "SDL_systhread.h" #include "../SDL_error_c.h" +/* The storage is local to the thread, but the IDs are global for the process */ + +static SDL_AtomicInt SDL_tls_allocated; + +void SDL_InitTLSData(void) +{ + SDL_SYS_InitTLSData(); +} + SDL_TLSID SDL_CreateTLS(void) { static SDL_AtomicInt SDL_tls_id; @@ -51,6 +60,13 @@ int SDL_SetTLS(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destru return SDL_InvalidParamError("id"); } + /* Make sure TLS is initialized. + * There's a race condition here if you are calling this from non-SDL threads + * and haven't called SDL_Init() on your main thread, but such is life. + */ + SDL_InitTLSData(); + + /* Get the storage for the current thread */ storage = SDL_SYS_GetTLSData(); if (!storage || (id > storage->limit)) { unsigned int i, oldlimit, newlimit; @@ -69,8 +85,10 @@ int SDL_SetTLS(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destru storage->array[i].destructor = NULL; } if (SDL_SYS_SetTLSData(storage) != 0) { + SDL_free(storage); return -1; } + SDL_AtomicIncRef(&SDL_tls_allocated); } storage->array[id - 1].data = SDL_const_cast(void *, value); @@ -82,6 +100,7 @@ void SDL_CleanupTLS(void) { SDL_TLSData *storage; + /* Cleanup the storage for the current thread */ storage = SDL_SYS_GetTLSData(); if (storage) { unsigned int i; @@ -92,6 +111,18 @@ void SDL_CleanupTLS(void) } SDL_SYS_SetTLSData(NULL); SDL_free(storage); + (void)SDL_AtomicDecRef(&SDL_tls_allocated); + } +} + +void SDL_QuitTLSData(void) +{ + SDL_CleanupTLS(); + + if (SDL_AtomicGet(&SDL_tls_allocated) == 0) { + SDL_SYS_QuitTLSData(); + } else { + /* Some thread hasn't called SDL_CleanupTLS() */ } } @@ -113,40 +144,27 @@ typedef struct SDL_TLSEntry static SDL_Mutex *SDL_generic_TLS_mutex; static SDL_TLSEntry *SDL_generic_TLS; +void SDL_Generic_InitTLSData(void) +{ + if (!SDL_generic_TLS_mutex) { + SDL_generic_TLS_mutex = SDL_CreateMutex(); + } +} + SDL_TLSData *SDL_Generic_GetTLSData(void) { SDL_ThreadID thread = SDL_GetCurrentThreadID(); SDL_TLSEntry *entry; SDL_TLSData *storage = NULL; -#ifndef SDL_THREADS_DISABLED - if (!SDL_generic_TLS_mutex) { - static SDL_SpinLock tls_lock; - SDL_LockSpinlock(&tls_lock); - if (!SDL_generic_TLS_mutex) { - SDL_Mutex *mutex = SDL_CreateMutex(); - SDL_MemoryBarrierRelease(); - SDL_generic_TLS_mutex = mutex; - if (!SDL_generic_TLS_mutex) { - SDL_UnlockSpinlock(&tls_lock); - return NULL; - } - } - SDL_UnlockSpinlock(&tls_lock); - } - SDL_MemoryBarrierAcquire(); SDL_LockMutex(SDL_generic_TLS_mutex); -#endif /* SDL_THREADS_DISABLED */ - for (entry = SDL_generic_TLS; entry; entry = entry->next) { if (entry->thread == thread) { storage = entry->storage; break; } } -#ifndef SDL_THREADS_DISABLED SDL_UnlockMutex(SDL_generic_TLS_mutex); -#endif return storage; } @@ -155,8 +173,8 @@ int SDL_Generic_SetTLSData(SDL_TLSData *data) { SDL_ThreadID thread = SDL_GetCurrentThreadID(); SDL_TLSEntry *prev, *entry; + int retval = 0; - /* SDL_Generic_GetTLSData() is always called first, so we can assume SDL_generic_TLS_mutex */ SDL_LockMutex(SDL_generic_TLS_mutex); prev = NULL; for (entry = SDL_generic_TLS; entry; entry = entry->next) { @@ -175,18 +193,44 @@ int SDL_Generic_SetTLSData(SDL_TLSData *data) } prev = entry; } - if (!entry) { + if (!entry && data) { entry = (SDL_TLSEntry *)SDL_malloc(sizeof(*entry)); if (entry) { entry->thread = thread; entry->storage = data; entry->next = SDL_generic_TLS; SDL_generic_TLS = entry; + } else { + retval = -1; } } SDL_UnlockMutex(SDL_generic_TLS_mutex); - return entry ? 0 : -1; + return retval; +} + +void SDL_Generic_QuitTLSData(void) +{ + SDL_TLSEntry *entry; + + /* This should have been cleaned up by the time we get here */ + SDL_assert(!SDL_generic_TLS); + if (SDL_generic_TLS) { + SDL_LockMutex(SDL_generic_TLS_mutex); + for (entry = SDL_generic_TLS; entry; ) { + SDL_TLSEntry *next = entry->next; + SDL_free(entry->storage); + SDL_free(entry); + entry = next; + } + SDL_generic_TLS = NULL; + SDL_UnlockMutex(SDL_generic_TLS_mutex); + } + + if (SDL_generic_TLS_mutex) { + SDL_DestroyMutex(SDL_generic_TLS_mutex); + SDL_generic_TLS_mutex = NULL; + } } /* Non-thread-safe global error variable */ @@ -327,6 +371,8 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, return NULL; } + SDL_InitTLSData(); + SDL_Thread *thread = (SDL_Thread *)SDL_calloc(1, sizeof(*thread)); if (!thread) { return NULL; diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index 9ae2720b84bd7..1e94edcfd1abe 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -89,16 +89,16 @@ typedef struct /* This is how many TLS entries we allocate at once */ #define TLS_ALLOC_CHUNKSIZE 4 -/* Get cross-platform, slow, thread local storage for this thread. - This is only intended as a fallback if getting real thread-local - storage fails or isn't supported on this platform. - */ -extern SDL_TLSData *SDL_Generic_GetTLSData(void); +extern void SDL_InitTLSData(void); +extern void SDL_QuitTLSData(void); -/* Set cross-platform, slow, thread local storage for this thread. +/* Generic TLS support. This is only intended as a fallback if getting real thread-local storage fails or isn't supported on this platform. */ +extern void SDL_Generic_InitTLSData(void); +extern SDL_TLSData *SDL_Generic_GetTLSData(void); extern int SDL_Generic_SetTLSData(SDL_TLSData *data); +extern void SDL_Generic_QuitTLSData(void); #endif /* SDL_thread_c_h_ */ diff --git a/src/thread/generic/SDL_systls.c b/src/thread/generic/SDL_systls.c index e439f4d4b69e3..9cd12efa466b2 100644 --- a/src/thread/generic/SDL_systls.c +++ b/src/thread/generic/SDL_systls.c @@ -22,6 +22,11 @@ #include "SDL_internal.h" #include "../SDL_thread_c.h" +void SDL_SYS_InitTLSData(void) +{ + SDL_Generic_InitTLSData(); +} + SDL_TLSData *SDL_SYS_GetTLSData(void) { return SDL_Generic_GetTLSData(); @@ -31,3 +36,9 @@ int SDL_SYS_SetTLSData(SDL_TLSData *data) { return SDL_Generic_SetTLSData(data); } + +void SDL_SYS_QuitTLSData(void) +{ + SDL_Generic_QuitTLSData(); +} + diff --git a/src/thread/pthread/SDL_systls.c b/src/thread/pthread/SDL_systls.c index 15a7dd077a343..7f0c5b5ecc703 100644 --- a/src/thread/pthread/SDL_systls.c +++ b/src/thread/pthread/SDL_systls.c @@ -29,27 +29,27 @@ static pthread_key_t thread_local_storage = INVALID_PTHREAD_KEY; static SDL_bool generic_local_storage = SDL_FALSE; -SDL_TLSData *SDL_SYS_GetTLSData(void) +void SDL_SYS_InitTLSData(void) { if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { - static SDL_SpinLock lock; - SDL_LockSpinlock(&lock); - if (thread_local_storage == INVALID_PTHREAD_KEY && !generic_local_storage) { - pthread_key_t storage; - if (pthread_key_create(&storage, NULL) == 0) { - SDL_MemoryBarrierRelease(); - thread_local_storage = storage; - } else { - generic_local_storage = SDL_TRUE; - } + if (pthread_key_create(&thread_local_storage, NULL) != 0) { + thread_local_storage = INVALID_PTHREAD_KEY; + SDL_Generic_InitTLSData(); + generic_local_storage = SDL_TRUE; } - SDL_UnlockSpinlock(&lock); } +} + +SDL_TLSData *SDL_SYS_GetTLSData(void) +{ if (generic_local_storage) { return SDL_Generic_GetTLSData(); } - SDL_MemoryBarrierAcquire(); - return (SDL_TLSData *)pthread_getspecific(thread_local_storage); + + if (thread_local_storage != INVALID_PTHREAD_KEY) { + return (SDL_TLSData *)pthread_getspecific(thread_local_storage); + } + return NULL; } int SDL_SYS_SetTLSData(SDL_TLSData *data) @@ -57,8 +57,22 @@ int SDL_SYS_SetTLSData(SDL_TLSData *data) if (generic_local_storage) { return SDL_Generic_SetTLSData(data); } + if (pthread_setspecific(thread_local_storage, data) != 0) { return SDL_SetError("pthread_setspecific() failed"); } return 0; } + +void SDL_SYS_QuitTLSData(void) +{ + if (generic_local_storage) { + SDL_Generic_QuitTLSData(); + generic_local_storage = SDL_FALSE; + } else { + if (thread_local_storage != INVALID_PTHREAD_KEY) { + pthread_key_delete(thread_local_storage); + thread_local_storage = INVALID_PTHREAD_KEY; + } + } +} diff --git a/src/thread/stdcpp/SDL_systhread.cpp b/src/thread/stdcpp/SDL_systhread.cpp index a2b6f4a79bc37..0d195f90b6f6f 100644 --- a/src/thread/stdcpp/SDL_systhread.cpp +++ b/src/thread/stdcpp/SDL_systhread.cpp @@ -143,14 +143,27 @@ SDL_SYS_DetachThread(SDL_Thread *thread) } } -extern "C" SDL_TLSData * -SDL_SYS_GetTLSData(void) +static thread_local SDL_TLSData *thread_local_storage; + +extern "C" +void SDL_SYS_InitTLSData(void) { - return SDL_Generic_GetTLSData(); } -extern "C" int -SDL_SYS_SetTLSData(SDL_TLSData *data) +extern "C" +SDL_TLSData * SDL_SYS_GetTLSData(void) +{ + return thread_local_storage; +} + +extern "C" +int SDL_SYS_SetTLSData(SDL_TLSData *data) +{ + thread_local_storage = data; + return 0; +} + +extern "C" +void SDL_SYS_QuitTLSData(void) { - return SDL_Generic_SetTLSData(data); } diff --git a/src/thread/windows/SDL_systls.c b/src/thread/windows/SDL_systls.c index 16393afde4855..9c6dc239fe36b 100644 --- a/src/thread/windows/SDL_systls.c +++ b/src/thread/windows/SDL_systls.c @@ -42,27 +42,27 @@ static DWORD thread_local_storage = TLS_OUT_OF_INDEXES; static SDL_bool generic_local_storage = SDL_FALSE; -SDL_TLSData *SDL_SYS_GetTLSData(void) +void SDL_SYS_InitTLSData(void) { if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { - static SDL_SpinLock lock; - SDL_LockSpinlock(&lock); - if (thread_local_storage == TLS_OUT_OF_INDEXES && !generic_local_storage) { - DWORD storage = TlsAlloc(); - if (storage != TLS_OUT_OF_INDEXES) { - SDL_MemoryBarrierRelease(); - thread_local_storage = storage; - } else { - generic_local_storage = SDL_TRUE; - } + thread_local_storage = TlsAlloc(); + if (thread_local_storage == TLS_OUT_OF_INDEXES) { + SDL_Generic_InitTLSData(); + generic_local_storage = SDL_TRUE; } - SDL_UnlockSpinlock(&lock); } +} + +SDL_TLSData *SDL_SYS_GetTLSData(void) +{ if (generic_local_storage) { return SDL_Generic_GetTLSData(); } - SDL_MemoryBarrierAcquire(); - return (SDL_TLSData *)TlsGetValue(thread_local_storage); + + if (thread_local_storage != TLS_OUT_OF_INDEXES) { + return (SDL_TLSData *)TlsGetValue(thread_local_storage); + } + return NULL; } int SDL_SYS_SetTLSData(SDL_TLSData *data) @@ -70,10 +70,24 @@ int SDL_SYS_SetTLSData(SDL_TLSData *data) if (generic_local_storage) { return SDL_Generic_SetTLSData(data); } + if (!TlsSetValue(thread_local_storage, data)) { - return SDL_SetError("TlsSetValue() failed"); + return WIN_SetError("TlsSetValue()"); } return 0; } +void SDL_SYS_QuitTLSData(void) +{ + if (generic_local_storage) { + SDL_Generic_QuitTLSData(); + generic_local_storage = SDL_FALSE; + } else { + if (thread_local_storage != TLS_OUT_OF_INDEXES) { + TlsFree(thread_local_storage); + thread_local_storage = TLS_OUT_OF_INDEXES; + } + } +} + #endif /* SDL_THREAD_WINDOWS */ From f4f4b453dea653e7627e8dac756ba898e0d6d995 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 11 Jul 2024 12:16:35 -0700 Subject: [PATCH 257/431] Sorted API entry points --- src/dynapi/SDL_dynapi.sym | 2 +- src/dynapi/SDL_dynapi_overrides.h | 2 +- src/dynapi/SDL_dynapi_procs.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 5339837acecfa..c5c332a9babfd 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -841,6 +841,7 @@ SDL3_0.0.0 { SDL_Vulkan_CreateSurface; SDL_Vulkan_DestroySurface; SDL_Vulkan_GetInstanceExtensions; + SDL_Vulkan_GetPresentationSupport; SDL_Vulkan_GetVkGetInstanceProcAddr; SDL_Vulkan_LoadLibrary; SDL_Vulkan_UnloadLibrary; @@ -1045,7 +1046,6 @@ SDL3_0.0.0 { SDL_wcsnstr; SDL_wcsstr; SDL_wcstol; - SDL_Vulkan_GetPresentationSupport; # extra symbols go here (don't modify this line) local: *; }; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 6b940e0794bba..1dc3e3c945a0b 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -866,6 +866,7 @@ #define SDL_Vulkan_CreateSurface SDL_Vulkan_CreateSurface_REAL #define SDL_Vulkan_DestroySurface SDL_Vulkan_DestroySurface_REAL #define SDL_Vulkan_GetInstanceExtensions SDL_Vulkan_GetInstanceExtensions_REAL +#define SDL_Vulkan_GetPresentationSupport SDL_Vulkan_GetPresentationSupport_REAL #define SDL_Vulkan_GetVkGetInstanceProcAddr SDL_Vulkan_GetVkGetInstanceProcAddr_REAL #define SDL_Vulkan_LoadLibrary SDL_Vulkan_LoadLibrary_REAL #define SDL_Vulkan_UnloadLibrary SDL_Vulkan_UnloadLibrary_REAL @@ -1070,4 +1071,3 @@ #define SDL_wcsnstr SDL_wcsnstr_REAL #define SDL_wcsstr SDL_wcsstr_REAL #define SDL_wcstol SDL_wcstol_REAL -#define SDL_Vulkan_GetPresentationSupport SDL_Vulkan_GetPresentationSupport_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index acef1b9813d8f..1d7e09254f333 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -876,6 +876,7 @@ SDL_DYNAPI_PROC(int,SDL_UpdateYUVTexture,(SDL_Texture *a, const SDL_Rect *b, con SDL_DYNAPI_PROC(int,SDL_Vulkan_CreateSurface,(SDL_Window *a, VkInstance b, const struct VkAllocationCallbacks *c, VkSurfaceKHR *d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_Vulkan_DestroySurface,(VkInstance a, VkSurfaceKHR b, const struct VkAllocationCallbacks *c),(a,b,c),) SDL_DYNAPI_PROC(char const* const*,SDL_Vulkan_GetInstanceExtensions,(Uint32 *a),(a),return) +SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_GetPresentationSupport,(VkInstance a, VkPhysicalDevice b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_FunctionPointer,SDL_Vulkan_GetVkGetInstanceProcAddr,(void),(),return) SDL_DYNAPI_PROC(int,SDL_Vulkan_LoadLibrary,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_Vulkan_UnloadLibrary,(void),(),) @@ -1076,4 +1077,3 @@ SDL_DYNAPI_PROC(size_t,SDL_wcsnlen,(const wchar_t *a, size_t b),(a,b),return) SDL_DYNAPI_PROC(wchar_t*,SDL_wcsnstr,(const wchar_t *a, const wchar_t *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(wchar_t*,SDL_wcsstr,(const wchar_t *a, const wchar_t *b),(a,b),return) SDL_DYNAPI_PROC(long,SDL_wcstol,(const wchar_t *a, wchar_t **b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_Vulkan_GetPresentationSupport,(VkInstance a, VkPhysicalDevice b, Uint32 c),(a,b,c),return) From 40f9fd854fd56bbf1ed117879e1f6654276c8ec7 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 11 Jul 2024 23:37:11 +0200 Subject: [PATCH 258/431] test: use SDL_HINT_(AUDIO,VIDEO)_DRIVER macro --- test/testautomation_audio.c | 8 ++++---- test/testoffscreen.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index a505efda738f3..5459243d0a791 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -108,7 +108,7 @@ static int audio_initQuitAudio(void *arg) } /* Call Init */ - SDL_SetHint("SDL_AUDIO_DRIVER", audioDriver); + SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO) with driver='%s'", audioDriver); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); @@ -122,7 +122,7 @@ static int audio_initQuitAudio(void *arg) audioDriver = NULL; /* Call Init */ - SDL_SetHint("SDL_AUDIO_DRIVER", audioDriver); + SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_AudioInit(NULL)"); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); @@ -175,7 +175,7 @@ static int audio_initOpenCloseQuitAudio(void *arg) for (j = 0; j < 2; j++) { /* Call Init */ - SDL_SetHint("SDL_AUDIO_DRIVER", audioDriver); + SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO) with driver='%s'", audioDriver); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); @@ -266,7 +266,7 @@ static int audio_pauseUnpauseAudio(void *arg) for (j = 0; j < 2; j++) { /* Call Init */ - SDL_SetHint("SDL_AUDIO_DRIVER", audioDriver); + SDL_SetHint(SDL_HINT_AUDIO_DRIVER, audioDriver); result = SDL_InitSubSystem(SDL_INIT_AUDIO); SDLTest_AssertPass("Call to SDL_InitSubSystem(SDL_INIT_AUDIO) with driver='%s'", audioDriver); SDLTest_AssertCheck(result == 0, "Validate result value; expected: 0 got: %d", result); diff --git a/test/testoffscreen.c b/test/testoffscreen.c index 613fa1fab9be1..8b03228fcae66 100644 --- a/test/testoffscreen.c +++ b/test/testoffscreen.c @@ -109,7 +109,7 @@ int main(int argc, char *argv[]) } /* Force the offscreen renderer, if it cannot be created then fail out */ - SDL_SetHint("SDL_VIDEO_DRIVER", "offscreen"); + SDL_SetHint(SDL_HINT_VIDEO_DRIVER, "offscreen"); if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { SDL_Log("Couldn't initialize the offscreen video driver: %s\n", SDL_GetError()); From 180b4d7e746e2a853f9b8fa834f800e11a197a8f Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Thu, 11 Jul 2024 21:50:37 -0400 Subject: [PATCH 259/431] x11: Fix a bogus return in Vulkan_GetPresentationSupport --- src/video/x11/SDL_x11vulkan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11vulkan.c b/src/video/x11/SDL_x11vulkan.c index 8aa07221d1f53..c0ef4c45758c1 100644 --- a/src/video/x11/SDL_x11vulkan.c +++ b/src/video/x11/SDL_x11vulkan.c @@ -243,7 +243,8 @@ SDL_bool X11_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, VisualID visualid; if (!_this->vulkan_config.loader_handle) { - return SDL_SetError("Vulkan is not loaded"); + SDL_SetError("Vulkan is not loaded"); + return SDL_FALSE; } vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; From 50589cbff60ce934f2157f579fdc321e40451cad Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 12:33:26 +0000 Subject: [PATCH 260/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_log.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/include/SDL3/SDL_log.h b/include/SDL3/SDL_log.h index 6d7c6d626c899..171cce8449856 100644 --- a/include/SDL3/SDL_log.h +++ b/include/SDL3/SDL_log.h @@ -22,9 +22,14 @@ /** * # CategoryLog * - * Simple log messages with categories and priorities. - * - * By default logs are quiet, but if you're debugging SDL you might want: + * Simple log messages with priorities and categories. A message’s + * SDL_LogPriority signifies how important the message is. A message's + * SDL_LogCategory signifies from what domain it belongs to. Every category + * has a minimum priority specified: when a message belongs to that category, + * it will only be sent out if it has that minimum priority or higher. + * + * SDL's own logs are sent below the default priority threshold, so they are + * quiet by default. If you're debugging SDL you might want: * * SDL_SetLogPriorities(SDL_LOG_PRIORITY_WARN); * From 282cf286fc9e5592b589a436aeb2c61f794a6b5e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 05:59:12 -0700 Subject: [PATCH 261/431] SDL_GetPixelFormatName() returns a string --- include/SDL3/SDL_pixels.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 360ee955133eb..4213cd4c83431 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -764,7 +764,7 @@ typedef struct SDL_PixelFormatDetails * * \param format the pixel format to query. * \returns the human readable name of the specified pixel format or - * `SDL_PIXELFORMAT_UNKNOWN` if the format isn't recognized. + * "SDL_PIXELFORMAT_UNKNOWN" if the format isn't recognized. * * \threadsafety It is safe to call this function from any thread. * From bafbbbf7dd11600c5a27dc8c40259c7141aff493 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 06:47:34 -0700 Subject: [PATCH 262/431] Fixed V4L2 framerate request V4L2 uses time interval instead of framerate Fixes https://github.com/libsdl-org/SDL/issues/10234 --- src/camera/v4l2/SDL_camera_v4l2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/camera/v4l2/SDL_camera_v4l2.c b/src/camera/v4l2/SDL_camera_v4l2.c index ed320e7deb7e7..de8bab62a8eb2 100644 --- a/src/camera/v4l2/SDL_camera_v4l2.c +++ b/src/camera/v4l2/SDL_camera_v4l2.c @@ -546,8 +546,8 @@ static int V4L2_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) if ( (setfps.parm.capture.timeperframe.denominator != spec->framerate_numerator) || (setfps.parm.capture.timeperframe.numerator = spec->framerate_denominator) ) { setfps.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - setfps.parm.capture.timeperframe.numerator = spec->framerate_numerator; - setfps.parm.capture.timeperframe.denominator = spec->framerate_denominator; + setfps.parm.capture.timeperframe.numerator = spec->framerate_denominator; + setfps.parm.capture.timeperframe.denominator = spec->framerate_numerator; if (xioctl(fd, VIDIOC_S_PARM, &setfps) == -1) { return SDL_SetError("Error VIDIOC_S_PARM"); } From 68dfae132224dba786cc3cd308ce770894a25c5a Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 15:35:05 +0000 Subject: [PATCH 263/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_properties.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index fef5725c1c770..294856d4434fa 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -478,7 +478,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_PropertiesID props, const char *name); /** - * Enumerate the properties on a set of properties. + * Enumerate the properties contained in a property set. * * The callback function is called for each property on the set of properties. * The properties are locked during enumeration. From f531003776b0a08082fb442650e8d7d2ed56f996 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 15:37:23 +0000 Subject: [PATCH 264/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_properties.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 294856d4434fa..529b4decc44be 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -22,7 +22,26 @@ /** * # CategoryProperties * - * SDL properties. + * A property is a variable that can be created and retrieved by name at + * runtime. + * + * All properties are part of a property set (SDL_PropertiesID). A property + * set can be created with the SDL_CreateProperties function and destroyed + * with the SDL_DestroyProperties function. + * + * Properties can be added to and retrieved from a property set through the + * following functions: + * + * - SDL_SetProperty and SDL_GetProperty operate on `void*` pointer types. + * - SDL_SetStringProperty and SDL_GetStringProperty operate on string types. + * - SDL_SetNumberProperty and SDL_GetNumberProperty operate on signed 64-bit + * integer types. + * - SDL_SetFloatProperty and SDL_GetFloatProperty operate on floating point + * types. + * - SDL_SetBooleanProperty and SDL_GetBooleanProperty operate on boolean + * types. + * + * Properties can be removed from a set by using SDL_ClearProperty. */ From bd041b4831b4a9862b83dc54ba0c4456161efab1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 08:50:15 -0700 Subject: [PATCH 265/431] Make sure SDL subsystems are initialized before starting threads --- src/SDL.c | 49 ++++++++++++++++++++++++++++------------- src/SDL_internal.h | 3 +++ src/thread/SDL_thread.c | 2 +- 3 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/SDL.c b/src/SDL.c index 7e8a5f059f5e9..d2792904a1f01 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -113,6 +113,7 @@ static SDL_bool SDL_MainIsReady = SDL_FALSE; #else static SDL_bool SDL_MainIsReady = SDL_TRUE; #endif +static SDL_bool SDL_main_thread_initialized = SDL_FALSE; static SDL_bool SDL_bInMainQuit = SDL_FALSE; static Uint8 SDL_SubsystemRefCount[32]; @@ -182,21 +183,45 @@ void SDL_SetMainReady(void) SDL_MainIsReady = SDL_TRUE; } -int SDL_InitSubSystem(Uint32 flags) +/* Initialize all the subsystems that require initialization before threads start */ +void SDL_InitMainThread(void) { - Uint32 flags_initialized = 0; - - if (!SDL_MainIsReady) { - return SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); + if (SDL_main_thread_initialized) { + return; } SDL_InitTLSData(); + SDL_InitTicks(); SDL_InitLog(); SDL_InitProperties(); SDL_GetGlobalProperties(); - /* Clear the error message */ - SDL_ClearError(); + SDL_main_thread_initialized = SDL_TRUE; +} + +static void SDL_QuitMainThread(void) +{ + if (!SDL_main_thread_initialized) { + return; + } + + SDL_QuitProperties(); + SDL_QuitLog(); + SDL_QuitTicks(); + SDL_QuitTLSData(); + + SDL_main_thread_initialized = SDL_FALSE; +} + +int SDL_InitSubSystem(Uint32 flags) +{ + Uint32 flags_initialized = 0; + + if (!SDL_MainIsReady) { + return SDL_SetError("Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?"); + } + + SDL_InitMainThread(); #ifdef SDL_USE_LIBDBUS SDL_DBus_Init(); @@ -210,8 +235,6 @@ int SDL_InitSubSystem(Uint32 flags) } #endif - SDL_InitTicks(); - /* Initialize the event subsystem */ if (flags & SDL_INIT_EVENTS) { if (SDL_ShouldInitSubsystem(SDL_INIT_EVENTS)) { @@ -542,8 +565,6 @@ void SDL_Quit(void) #endif SDL_QuitSubSystem(SDL_INIT_EVERYTHING); - SDL_QuitTicks(); - #ifdef SDL_USE_LIBDBUS SDL_DBus_Quit(); #endif @@ -556,9 +577,6 @@ void SDL_Quit(void) SDL_QuitCPUInfo(); - SDL_QuitProperties(); - SDL_QuitLog(); - /* Now that every subsystem has been quit, we reset the subsystem refcount * and the list of initialized subsystems. */ @@ -566,7 +584,8 @@ void SDL_Quit(void) SDL_FlushEventMemory(0); SDL_FreeEnvironmentMemory(); - SDL_QuitTLSData(); + + SDL_QuitMainThread(); SDL_bInMainQuit = SDL_FALSE; } diff --git a/src/SDL_internal.h b/src/SDL_internal.h index 6a1a3a31384fd..e9749a91b8f7a 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -289,6 +289,9 @@ extern "C" { #endif +/* Do any initialization that needs to happen before threads are started */ +extern void SDL_InitMainThread(void); + extern int SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS); extern int SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS); extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS); diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index dfb45c8bee735..c9be0dc913046 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -371,7 +371,7 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, return NULL; } - SDL_InitTLSData(); + SDL_InitMainThread(); SDL_Thread *thread = (SDL_Thread *)SDL_calloc(1, sizeof(*thread)); if (!thread) { From ca36f6c43bdfb017f580329a7b47827432be37e3 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 12 Jul 2024 12:02:17 +0200 Subject: [PATCH 266/431] sdlprocdump: remove dead code --- test/win32/sdlprocdump.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/win32/sdlprocdump.c b/test/win32/sdlprocdump.c index 08409ab314d6c..675d6175f85dc 100644 --- a/test/win32/sdlprocdump.c +++ b/test/win32/sdlprocdump.c @@ -180,6 +180,7 @@ static const char *exceptionFlags_to_string(DWORD dwFlags, char *buffer, size_t } FOREACH_EXCEPTION_FLAGS(APPEND_OR_STR) +#undef APPEND_OR_STR return buffer; } @@ -224,7 +225,6 @@ static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMAT char child_file_name[64]; EXCEPTION_POINTERS exception_pointers; HANDLE hFile = INVALID_HANDLE_VALUE; - HMODULE dbghelp_module = NULL; MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information; SYSTEMTIME system_time; @@ -280,9 +280,6 @@ static void write_minidump(const char *child_file_path, const LPPROCESS_INFORMAT if (hFile != INVALID_HANDLE_VALUE) { CloseHandle(hFile); } - if (dbghelp_module != NULL) { - FreeLibrary(dbghelp_module); - } } static void print_stacktrace(const LPPROCESS_INFORMATION process_information, PCONTEXT context, LPVOID address) { @@ -533,7 +530,7 @@ int main(int argc, char *argv[]) { DWORD continue_status = DBG_CONTINUE; success = WaitForDebugEvent(&event, INFINITE); if (!success) { - printf_message("Failed to get a debug event"); + printf_windows_message("Failed to get a debug event"); return 1; } switch (event.dwDebugEventCode) { @@ -591,7 +588,6 @@ int main(int argc, char *argv[]) { } break; case EXIT_PROCESS_DEBUG_EVENT: - exit_code = event.u.ExitProcess.dwExitCode; if (event.dwProcessId == process_information.dwProcessId) { process_alive = 0; DebugActiveProcessStop(event.dwProcessId); From 7277d69c0e4deee2c1a6e70a5822087fbaa2a944 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 11 Jul 2024 23:27:13 +0200 Subject: [PATCH 267/431] cmake: verify no undefined versioned symbols exist --- cmake/sdlcompilers.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/sdlcompilers.cmake b/cmake/sdlcompilers.cmake index ac4db40c6b7c1..9db746021b253 100644 --- a/cmake/sdlcompilers.cmake +++ b/cmake/sdlcompilers.cmake @@ -29,6 +29,8 @@ endfunction() function(SDL_AddCommonCompilerFlags TARGET) option(SDL_WERROR "Enable -Werror" OFF) + get_property(TARGET_TYPE TARGET "${TARGET}" PROPERTY TYPE) + if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC) if(MINGW) # See if GCC's -gdwarf-4 is supported @@ -128,6 +130,13 @@ function(SDL_AddCommonCompilerFlags TARGET) if(HAVE_WERROR) sdl_target_compile_option_all_languages(${TARGET} "-Werror") endif() + + if(TARGET_TYPE STREQUAL "SHARED_LIBRARY") + check_linker_flag(C "-Wl,--no-undefined-version" LINKER_SUPPORTS_NO_UNDEFINED_VERSION) + if(LINKER_SUPPORTS_NO_UNDEFINED_VERSION) + target_link_options(${TARGET} PRIVATE "-Wl,--no-undefined-version") + endif() + endif() endif() endif() From bf03dee86609fbed159543446a39584a3cee2141 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 12 Jul 2024 13:25:06 -0400 Subject: [PATCH 268/431] Remove `struct SDL_Camera` predeclare. This is unnecessary and confuses the wiki bridge. --- include/SDL3/SDL_camera.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index f7468426f4650..19798127417a5 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -62,7 +62,6 @@ typedef Uint32 SDL_CameraDeviceID; * * \since This struct is available since SDL 3.0.0. */ -struct SDL_Camera; typedef struct SDL_Camera SDL_Camera; /** From 5bf6bc4d7d30c2c431270ea16dc741f895223d7b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 09:39:58 -0700 Subject: [PATCH 269/431] Renamed SDL_Get/SetProperty() to SDL_Get/SetPointerProperty() This is consistent with the naming for the functions that affect other data types Fixes https://github.com/libsdl-org/SDL/issues/10241 --- docs/README-migration.md | 12 ++-- docs/README-wayland.md | 4 +- include/SDL3/SDL_audio.h | 3 - include/SDL3/SDL_camera.h | 3 - include/SDL3/SDL_gamepad.h | 3 - include/SDL3/SDL_iostream.h | 3 - include/SDL3/SDL_joystick.h | 3 - include/SDL3/SDL_properties.h | 29 ++++----- include/SDL3/SDL_render.h | 6 -- include/SDL3/SDL_sensor.h | 3 - include/SDL3/SDL_surface.h | 3 - include/SDL3/SDL_video.h | 6 -- src/SDL_properties.c | 12 ++-- .../SDL_camera_mediafoundation.c | 6 +- src/core/linux/SDL_fcitx.c | 2 +- src/core/linux/SDL_ibus.c | 2 +- src/dialog/cocoa/SDL_cocoadialog.m | 2 +- src/dialog/windows/SDL_windowsdialog.c | 4 +- src/dynapi/SDL_dynapi.sym | 6 +- src/dynapi/SDL_dynapi_overrides.h | 6 +- src/dynapi/SDL_dynapi_procs.h | 6 +- src/file/SDL_iostream.c | 10 ++-- src/render/SDL_render.c | 24 ++++---- src/render/direct3d/SDL_render_d3d.c | 4 +- src/render/direct3d11/SDL_render_d3d11.c | 16 ++--- src/render/direct3d11/SDL_render_winrt.cpp | 2 +- src/render/direct3d12/SDL_render_d3d12.c | 22 +++---- src/render/metal/SDL_render_metal.m | 6 +- src/render/vulkan/SDL_render_vulkan.c | 12 ++-- src/test/SDL_test_common.c | 2 +- src/thread/SDL_thread.c | 12 ++-- src/video/SDL_video.c | 18 +++--- src/video/android/SDL_androidwindow.c | 4 +- src/video/cocoa/SDL_cocoawindow.m | 10 ++-- src/video/dummy/SDL_nullframebuffer.c | 2 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 2 +- src/video/n3ds/SDL_n3dsframebuffer.c | 2 +- .../offscreen/SDL_offscreenframebuffer.c | 2 +- src/video/uikit/SDL_uikitwindow.m | 2 +- src/video/vivante/SDL_vivantevideo.c | 6 +- src/video/wayland/SDL_waylandvideo.c | 4 +- src/video/wayland/SDL_waylandwindow.c | 34 +++++------ src/video/windows/SDL_windowswindow.c | 10 ++-- src/video/winrt/SDL_winrtvideo.cpp | 2 +- src/video/x11/SDL_x11window.c | 4 +- test/testautomation_iostream.c | 6 +- test/testautomation_properties.c | 60 +++++++++---------- test/testautomation_video.c | 40 ++++++------- test/testcolorspace.c | 2 +- test/testffmpeg.c | 12 ++-- test/testffmpeg_vulkan.c | 6 +- test/testmanymouse.c | 8 +-- test/testnative.c | 2 +- test/testnativewayland.c | 2 +- test/testwaylandcustom.c | 4 +- 55 files changed, 221 insertions(+), 257 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 85fab337eb2b7..08b62fb1fa705 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1800,32 +1800,32 @@ The information previously available in SDL_GetWindowWMInfo() is now available a becomes: ```c #if defined(SDL_PLATFORM_WIN32) - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (hwnd) { ... } #elif defined(SDL_PLATFORM_MACOS) - NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); + NSWindow *nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); if (nswindow) { ... } #elif defined(SDL_PLATFORM_LINUX) if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "x11") == 0) { - Display *xdisplay = (Display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + Display *xdisplay = (Display *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); Window xwindow = (Window)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); if (xdisplay && xwindow) { ... } } else if (SDL_strcmp(SDL_GetCurrentVideoDriver(), "wayland") == 0) { - struct wl_display *display = (struct wl_display *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); - struct wl_surface *surface = (struct wl_surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); + struct wl_display *display = (struct wl_display *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); + struct wl_surface *surface = (struct wl_surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); if (display && surface) { ... } } #elif defined(SDL_PLATFORM_IOS) SDL_PropertiesID props = SDL_GetWindowProperties(window); - UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); + UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); if (uiwindow) { GLuint framebuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_FRAMEBUFFER_NUMBER, 0); GLuint colorbuffer = (GLuint)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_OPENGL_RENDERBUFFER_NUMBER, 0); diff --git a/docs/README-wayland.md b/docs/README-wayland.md index 7f831fe6ed316..aa0f2ccf09bf1 100644 --- a/docs/README-wayland.md +++ b/docs/README-wayland.md @@ -153,7 +153,7 @@ int main(int argc, char *argv[]) } /* Set SDL to use the existing wl_display object from Qt and initialize. */ - SDL_SetProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); + SDL_SetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS); /* Create a basic, frameless QWindow */ @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) * Qt objects should not be flagged as DPI-aware or protocol violations will result. */ props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, surface); SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 640); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 480); diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 772e811a6cc72..a8356ce5e671d 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -953,9 +953,6 @@ extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_Aud * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_AudioStream *stream); diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 19798127417a5..02d2941586861 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -367,9 +367,6 @@ extern SDL_DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camer * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera *camera); diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 9ab90092f7e7d..36282ad5fb2b4 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -725,9 +725,6 @@ extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int playe * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepad *gamepad); diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index 4da92144539bf..c87d203139459 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -395,9 +395,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_CloseIO(SDL_IOStream *context); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetIOProperties(SDL_IOStream *context); diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index c4e713c7c5b62..31c4fc58b82c6 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -654,9 +654,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_SendJoystickVirtualSensorData(SDL_Joystick * * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joystick *joystick); diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 529b4decc44be..d277b5374d4db 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -32,7 +32,7 @@ * Properties can be added to and retrieved from a property set through the * following functions: * - * - SDL_SetProperty and SDL_GetProperty operate on `void*` pointer types. + * - SDL_SetPointerProperty and SDL_GetPointerProperty operate on `void*` pointer types. * - SDL_SetStringProperty and SDL_GetStringProperty operate on string types. * - SDL_SetNumberProperty and SDL_GetNumberProperty operate on signed 64-bit * integer types. @@ -86,9 +86,6 @@ typedef enum SDL_PropertyType * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void); @@ -113,7 +110,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void); * * Copy all the properties from one set of properties to another, with the * exception of properties requiring cleanup (set using - * SDL_SetPropertyWithCleanup()), which will not be copied. Any property that + * SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any property that * already exists on `dst` will be overwritten. * * \param src the properties to copy. @@ -173,7 +170,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * This callback is set per-property. Different properties in the same set can * have different cleanup callbacks. * - * This callback will be called _during_ SDL_SetPropertyWithCleanup if the + * This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if the * function fails for any reason. * * \param userdata an app-defined pointer passed to the callback. @@ -184,7 +181,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * * \since This datatype is available since SDL 3.0.0. * - * \sa SDL_SetPropertyWithCleanup + * \sa SDL_SetPointerPropertyWithCleanup */ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value); @@ -213,11 +210,11 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetProperty - * \sa SDL_SetProperty + * \sa SDL_GetPointerProperty + * \sa SDL_SetPointerProperty * \sa SDL_CleanupPropertyCallback */ -extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); +extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); /** * Set a property on a set of properties. @@ -232,15 +229,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPropertyWithCleanup(SDL_PropertiesID prop * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetProperty + * \sa SDL_GetPointerProperty * \sa SDL_HasProperty * \sa SDL_SetBooleanProperty * \sa SDL_SetFloatProperty * \sa SDL_SetNumberProperty - * \sa SDL_SetPropertyWithCleanup + * \sa SDL_SetPointerPropertyWithCleanup * \sa SDL_SetStringProperty */ -extern SDL_DECLSPEC int SDLCALL SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value); +extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); /** * Set a string property on a set of properties. @@ -360,7 +357,7 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI * * \threadsafety It is safe to call this function from any thread, although * the data returned is not protected and could potentially be - * freed if you call SDL_SetProperty() or SDL_ClearProperty() on + * freed if you call SDL_SetPointerProperty() or SDL_ClearProperty() on * these properties from another thread. If you need to avoid * this, use SDL_LockProperties() and SDL_UnlockProperties(). * @@ -372,9 +369,9 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI * \sa SDL_GetPropertyType * \sa SDL_GetStringProperty * \sa SDL_HasProperty - * \sa SDL_SetProperty + * \sa SDL_SetPointerProperty */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value); +extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); /** * Get a string property on a set of properties. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 2ff52dc1dffd5..38367548da35f 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -413,9 +413,6 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetRendererName(SDL_Renderer *render * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetRendererProperties(SDL_Renderer *renderer); @@ -758,9 +755,6 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Ren * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Texture *texture); diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 13dcd424b2cf4..d5124beee39f1 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -217,9 +217,6 @@ extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor *sensor); diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 8078a0c88f03c..fd5096ac9f4c3 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -211,9 +211,6 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface); diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index db54c9f99fa1f..07c608e89fa39 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -429,9 +429,6 @@ extern SDL_DECLSPEC SDL_DisplayID SDLCALL SDL_GetPrimaryDisplay(void); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_SetProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_DisplayID displayID); @@ -1225,9 +1222,6 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window); * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetProperty - * \sa SDL_GetNumberProperty */ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetWindowProperties(SDL_Window *window); diff --git a/src/SDL_properties.c b/src/SDL_properties.c index 0b584213eedf6..1ac03e72e7cd2 100644 --- a/src/SDL_properties.c +++ b/src/SDL_properties.c @@ -336,7 +336,7 @@ static int SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_ return result; } -int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata) +int SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata) { SDL_Property *property; @@ -362,7 +362,7 @@ int SDL_SetPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *v return SDL_PrivateSetProperty(props, name, property); } -int SDL_SetProperty(SDL_PropertiesID props, const char *name, void *value) +int SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value) { SDL_Property *property; @@ -386,7 +386,7 @@ static void SDLCALL CleanupFreeableProperty(void *userdata, void *value) int SDL_SetFreeableProperty(SDL_PropertiesID props, const char *name, void *value) { - return SDL_SetPropertyWithCleanup(props, name, value, CleanupFreeableProperty, NULL); + return SDL_SetPointerPropertyWithCleanup(props, name, value, CleanupFreeableProperty, NULL); } static void SDLCALL CleanupSurface(void *userdata, void *value) @@ -398,7 +398,7 @@ static void SDLCALL CleanupSurface(void *userdata, void *value) int SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surface *surface) { - return SDL_SetPropertyWithCleanup(props, name, surface, CleanupSurface, NULL); + return SDL_SetPointerPropertyWithCleanup(props, name, surface, CleanupSurface, NULL); } int SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value) @@ -492,7 +492,7 @@ SDL_PropertyType SDL_GetPropertyType(SDL_PropertiesID props, const char *name) return type; } -void *SDL_GetProperty(SDL_PropertiesID props, const char *name, void *default_value) +void *SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value) { SDL_Properties *properties = NULL; void *value = default_value; @@ -775,7 +775,7 @@ static void SDLCALL SDL_DumpPropertiesCallback(void *userdata, SDL_PropertiesID { switch (SDL_GetPropertyType(props, name)) { case SDL_PROPERTY_TYPE_POINTER: - SDL_Log("%s: %p\n", name, SDL_GetProperty(props, name, NULL)); + SDL_Log("%s: %p\n", name, SDL_GetPointerProperty(props, name, NULL)); break; case SDL_PROPERTY_TYPE_STRING: SDL_Log("%s: \"%s\"\n", name, SDL_GetStringProperty(props, name, "")); diff --git a/src/camera/mediafoundation/SDL_camera_mediafoundation.c b/src/camera/mediafoundation/SDL_camera_mediafoundation.c index 7776d1e3b3e9f..c8cbbf34f4441 100644 --- a/src/camera/mediafoundation/SDL_camera_mediafoundation.c +++ b/src/camera/mediafoundation/SDL_camera_mediafoundation.c @@ -468,7 +468,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f } else { frame->pixels = pixels; frame->pitch = (int) pitch; - if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) { + if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer2, NULL) == -1) { retval = -1; } } @@ -480,7 +480,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f } else { frame->pixels = pixels; frame->pitch = (int) pitch; - if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) { + if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMF2DBuffer, NULL) == -1) { retval = -1; } } @@ -497,7 +497,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f } frame->pixels = pixels; frame->pitch = (int) pitch; - if (SDL_SetPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) { + if (SDL_SetPointerPropertyWithCleanup(surfprops, PROP_SURFACE_IMFOBJS_POINTER, objs, CleanupIMFMediaBuffer, NULL) == -1) { retval = -1; } } diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 8efa305561f82..a4f6560da21a3 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -422,7 +422,7 @@ void SDL_Fcitx_UpdateTextInputArea(SDL_Window *window) #ifdef SDL_VIDEO_DRIVER_X11 { SDL_PropertiesID props = SDL_GetWindowProperties(window); - Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0); Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); Window unused; diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c index dfaab70a665c0..7fe5baa65ea62 100644 --- a/src/core/linux/SDL_ibus.c +++ b/src/core/linux/SDL_ibus.c @@ -703,7 +703,7 @@ void SDL_IBus_UpdateTextInputArea(SDL_Window *window) #ifdef SDL_VIDEO_DRIVER_X11 { SDL_PropertiesID props = SDL_GetWindowProperties(window); - Display *x_disp = (Display *)SDL_GetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); + Display *x_disp = (Display *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, NULL); int x_screen = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, 0); Window x_win = SDL_GetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, 0); Window unused; diff --git a/src/dialog/cocoa/SDL_cocoadialog.m b/src/dialog/cocoa/SDL_cocoadialog.m index 3d58aa226ce35..eeddfe75c064b 100644 --- a/src/dialog/cocoa/SDL_cocoadialog.m +++ b/src/dialog/cocoa/SDL_cocoadialog.m @@ -130,7 +130,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback NSWindow *w = NULL; if (window) { - w = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); + w = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); } if (w) { diff --git a/src/dialog/windows/SDL_windowsdialog.c b/src/dialog/windows/SDL_windowsdialog.c index 45bc6418c6e26..5fad1d110ef35 100644 --- a/src/dialog/windows/SDL_windowsdialog.c +++ b/src/dialog/windows/SDL_windowsdialog.c @@ -101,7 +101,7 @@ void windows_ShowFileDialog(void *ptr) HWND window = NULL; if (parent) { - window = (HWND) SDL_GetProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + window = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(parent), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); } wchar_t *filebuffer; /* lpstrFile */ @@ -391,7 +391,7 @@ void windows_ShowFolderDialog(void* ptr) HWND parent = NULL; if (window) { - parent = (HWND) SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + parent = (HWND) SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); } wchar_t buffer[MAX_PATH]; diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index c5c332a9babfd..656b4b1fa2682 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -368,12 +368,12 @@ SDL3_0.0.0 { SDL_GetPixelFormatForMasks; SDL_GetPixelFormatName; SDL_GetPlatform; + SDL_GetPointerProperty; SDL_GetPowerInfo; SDL_GetPrefPath; SDL_GetPreferredLocales; SDL_GetPrimaryDisplay; SDL_GetPrimarySelectionText; - SDL_GetProperty; SDL_GetPropertyType; SDL_GetRGB; SDL_GetRGBA; @@ -730,9 +730,9 @@ SDL3_0.0.0 { SDL_SetModState; SDL_SetNumberProperty; SDL_SetPaletteColors; + SDL_SetPointerProperty; + SDL_SetPointerPropertyWithCleanup; SDL_SetPrimarySelectionText; - SDL_SetProperty; - SDL_SetPropertyWithCleanup; SDL_SetRelativeMouseMode; SDL_SetRenderClipRect; SDL_SetRenderColorScale; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 1dc3e3c945a0b..2cdd9d2485cac 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -393,12 +393,12 @@ #define SDL_GetPixelFormatForMasks SDL_GetPixelFormatForMasks_REAL #define SDL_GetPixelFormatName SDL_GetPixelFormatName_REAL #define SDL_GetPlatform SDL_GetPlatform_REAL +#define SDL_GetPointerProperty SDL_GetPointerProperty_REAL #define SDL_GetPowerInfo SDL_GetPowerInfo_REAL #define SDL_GetPrefPath SDL_GetPrefPath_REAL #define SDL_GetPreferredLocales SDL_GetPreferredLocales_REAL #define SDL_GetPrimaryDisplay SDL_GetPrimaryDisplay_REAL #define SDL_GetPrimarySelectionText SDL_GetPrimarySelectionText_REAL -#define SDL_GetProperty SDL_GetProperty_REAL #define SDL_GetPropertyType SDL_GetPropertyType_REAL #define SDL_GetRGB SDL_GetRGB_REAL #define SDL_GetRGBA SDL_GetRGBA_REAL @@ -755,9 +755,9 @@ #define SDL_SetModState SDL_SetModState_REAL #define SDL_SetNumberProperty SDL_SetNumberProperty_REAL #define SDL_SetPaletteColors SDL_SetPaletteColors_REAL +#define SDL_SetPointerProperty SDL_SetPointerProperty_REAL +#define SDL_SetPointerPropertyWithCleanup SDL_SetPointerPropertyWithCleanup_REAL #define SDL_SetPrimarySelectionText SDL_SetPrimarySelectionText_REAL -#define SDL_SetProperty SDL_SetProperty_REAL -#define SDL_SetPropertyWithCleanup SDL_SetPropertyWithCleanup_REAL #define SDL_SetRelativeMouseMode SDL_SetRelativeMouseMode_REAL #define SDL_SetRenderClipRect SDL_SetRenderClipRect_REAL #define SDL_SetRenderColorScale SDL_SetRenderColorScale_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 1d7e09254f333..66894a98812a4 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -413,12 +413,12 @@ SDL_DYNAPI_PROC(const SDL_PixelFormatDetails*,SDL_GetPixelFormatDetails,(SDL_Pix SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetPixelFormatForMasks,(int a, Uint32 b, Uint32 c, Uint32 d, Uint32 e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormat a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return) +SDL_DYNAPI_PROC(void*,SDL_GetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) SDL_DYNAPI_PROC(char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Locale*,SDL_GetPreferredLocales,(void),(),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return) SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return) -SDL_DYNAPI_PROC(void*,SDL_GetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) @@ -765,9 +765,9 @@ SDL_DYNAPI_PROC(int,SDL_SetMemoryFunctions,(SDL_malloc_func a, SDL_calloc_func b SDL_DYNAPI_PROC(void,SDL_SetModState,(SDL_Keymod a),(a),) SDL_DYNAPI_PROC(int,SDL_SetNumberProperty,(SDL_PropertiesID a, const char *b, Sint64 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetPaletteColors,(SDL_Palette *a, const SDL_Color *b, int c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(int,SDL_SetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_SetPointerPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_SetPrimarySelectionText,(const char *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_SetProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(int,SDL_SetPropertyWithCleanup,(SDL_PropertiesID a, const char *b, void *c, SDL_CleanupPropertyCallback d, void *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_SetRelativeMouseMode,(SDL_bool a),(a),return) SDL_DYNAPI_PROC(int,SDL_SetRenderClipRect,(SDL_Renderer *a, const SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetRenderColorScale,(SDL_Renderer *a, float b),(a,b),return) diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c index 7e052856bc399..ec36dcf9ea87b 100644 --- a/src/file/SDL_iostream.c +++ b/src/file/SDL_iostream.c @@ -431,7 +431,7 @@ static SDL_IOStream *SDL_IOFromFP(FILE *fp, SDL_bool autoclose) } else { const SDL_PropertiesID props = SDL_GetIOProperties(iostr); if (props) { - SDL_SetProperty(props, SDL_PROP_IOSTREAM_STDIO_FILE_POINTER, fp); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_STDIO_FILE_POINTER, fp); } } @@ -615,7 +615,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) } else { const SDL_PropertiesID props = SDL_GetIOProperties(iostr); if (props) { - SDL_SetProperty(props, SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER, iodata); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_ANDROID_AASSET_POINTER, iodata); } } @@ -644,7 +644,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) } else { const SDL_PropertiesID props = SDL_GetIOProperties(iostr); if (props) { - SDL_SetProperty(props, SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER, iodata->h); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER, iodata->h); } } @@ -793,7 +793,7 @@ static int dynamic_mem_realloc(IOStreamDynamicMemData *iodata, size_t size) iodata->data.here = base + here_offset; iodata->data.stop = base + stop_offset; iodata->end = base + length; - return SDL_SetProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, base); + return SDL_SetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, base); } static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t size, SDL_IOStatus *status) @@ -813,7 +813,7 @@ static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t static int SDLCALL dynamic_mem_close(void *userdata) { const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata; - void *mem = SDL_GetProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); + void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); if (mem) { SDL_free(mem); } diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 6f21fe0f70b79..8d050bdb1b5df 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -151,7 +151,7 @@ int SDL_AddSupportedTextureFormat(SDL_Renderer *renderer, SDL_PixelFormat format texture_formats[renderer->num_texture_formats++] = format; texture_formats[renderer->num_texture_formats] = SDL_PIXELFORMAT_UNKNOWN; renderer->texture_formats = texture_formats; - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, texture_formats); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, texture_formats); return 0; } @@ -942,8 +942,8 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props) { #ifndef SDL_RENDER_DISABLED - SDL_Window *window = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL); - SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL); + SDL_Window *window = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, NULL); + SDL_Surface *surface = (SDL_Surface *)SDL_GetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, NULL); const char *name = SDL_GetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, NULL); const int n = SDL_GetNumRenderDrivers(); const char *hint; @@ -1083,16 +1083,16 @@ SDL_Renderer *SDL_CreateRendererWithProperties(SDL_PropertiesID props) new_props = SDL_GetRendererProperties(renderer); SDL_SetStringProperty(new_props, SDL_PROP_RENDERER_NAME_STRING, renderer->name); if (window) { - SDL_SetProperty(new_props, SDL_PROP_RENDERER_WINDOW_POINTER, window); + SDL_SetPointerProperty(new_props, SDL_PROP_RENDERER_WINDOW_POINTER, window); } if (surface) { - SDL_SetProperty(new_props, SDL_PROP_RENDERER_SURFACE_POINTER, surface); + SDL_SetPointerProperty(new_props, SDL_PROP_RENDERER_SURFACE_POINTER, surface); } SDL_SetNumberProperty(new_props, SDL_PROP_RENDERER_OUTPUT_COLORSPACE_NUMBER, renderer->output_colorspace); UpdateHDRProperties(renderer); if (window) { - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, renderer); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, renderer); } SDL_SetRenderViewport(renderer, NULL); @@ -1145,7 +1145,7 @@ SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name) { SDL_Renderer *renderer; SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, name); renderer = SDL_CreateRendererWithProperties(props); SDL_DestroyProperties(props); @@ -1163,7 +1163,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) } SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface); renderer = SDL_CreateRendererWithProperties(props); SDL_DestroyProperties(props); return renderer; @@ -1175,7 +1175,7 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) SDL_Renderer *SDL_GetRenderer(SDL_Window *window) { - return (SDL_Renderer *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, NULL); + return (SDL_Renderer *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_RENDERER_POINTER, NULL); } SDL_Window *SDL_GetRenderWindow(SDL_Renderer *renderer) @@ -1401,7 +1401,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert return NULL; } - SDL_SetProperty(SDL_GetTextureProperties(texture->native), SDL_PROP_TEXTURE_PARENT_POINTER, texture); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture->native), SDL_PROP_TEXTURE_PARENT_POINTER, texture); /* Swap textures to have texture before texture->native in the list */ texture->native->next = texture->next; @@ -2416,7 +2416,7 @@ SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer) if (renderer->target == renderer->logical_target) { return NULL; } else { - return (SDL_Texture *)SDL_GetProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target); + return (SDL_Texture *)SDL_GetPointerProperty(SDL_GetTextureProperties(renderer->target), SDL_PROP_TEXTURE_PARENT_POINTER, renderer->target); } } @@ -4401,7 +4401,7 @@ SDL_Surface *SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) static void SDL_RenderApplyWindowShape(SDL_Renderer *renderer) { - SDL_Surface *shape = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); + SDL_Surface *shape = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); if (shape != renderer->shape_surface) { if (renderer->shape_texture) { SDL_DestroyTexture(renderer->shape_texture); diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 33fb54e65b091..af16dbefa989f 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1604,7 +1604,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie SDL_DisplayID displayID; const SDL_DisplayMode *fullscreen_mode = NULL; - hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { return SDL_SetError("Couldn't get window handle"); } @@ -1752,7 +1752,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie } #endif - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D9_DEVICE_POINTER, data->device); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D9_DEVICE_POINTER, data->device); return 0; } diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 3056d07e00d5f..cca1925d3ec5a 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -800,7 +800,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) ID3D11DeviceContext_VSSetShader(data->d3dContext, data->vertexShader, NULL, 0); ID3D11DeviceContext_VSSetConstantBuffers(data->d3dContext, 0, 1, &data->vertexShaderConstants); - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, data->d3dDevice); done: SAFE_RELEASE(d3dDevice); @@ -975,7 +975,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) #endif } else { #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { SDL_SetError("Couldn't get window handle"); result = E_FAIL; @@ -1031,7 +1031,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) } } - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER, data->swapChain); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_SWAPCHAIN_POINTER, data->swapChain); done: SAFE_RELEASE(swapChain3); @@ -1251,7 +1251,7 @@ static SDL_bool D3D11_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode bl static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D11Texture2D **texture) { - IUnknown *unknown = SDL_GetProperty(props, name, NULL); + IUnknown *unknown = SDL_GetPointerProperty(props, name, NULL); if (unknown) { HRESULT result = IUnknown_QueryInterface(unknown, &SDL_IID_ID3D11Texture2D, (void **)texture); if (FAILED(result)) { @@ -1334,7 +1334,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, textureData->mainTexture); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, textureData->mainTexture); #if SDL_HAVE_YUV if (texture->format == SDL_PIXELFORMAT_YV12 || texture->format == SDL_PIXELFORMAT_IYUV) { @@ -1355,7 +1355,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_U_POINTER, textureData->mainTextureU); if (GetTextureProperty(create_props, "d3d11.texture_v", &textureData->mainTextureV) < 0) { return -1; @@ -1369,7 +1369,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateTexture2D"), result); } } - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER, textureData->mainTextureV); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_V_POINTER, textureData->mainTextureV); textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8); if (!textureData->YCbCr_matrix) { @@ -2783,7 +2783,7 @@ static int D3D11_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ { D3D11_RenderData *data; - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { return SDL_SetError("Couldn't get window handle"); } diff --git a/src/render/direct3d11/SDL_render_winrt.cpp b/src/render/direct3d11/SDL_render_winrt.cpp index a2bfb5ce3e014..36de74eef7a09 100644 --- a/src/render/direct3d11/SDL_render_winrt.cpp +++ b/src/render/direct3d11/SDL_render_winrt.cpp @@ -44,7 +44,7 @@ using namespace Windows::Graphics::Display; extern "C" void * D3D11_GetCoreWindowFromSDLRenderer(SDL_Renderer *renderer) { - IInspectable *window = (IInspectable *)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL); + IInspectable *window = (IInspectable *)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, NULL); ABI::Windows::UI::Core::ICoreWindow *coreWindow = NULL; if (!window || FAILED(window->QueryInterface(&coreWindow))) { return NULL; diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 45c91d87a5ad3..8e3fddd647fc4 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -446,8 +446,8 @@ static void D3D12_ReleaseAll(SDL_Renderer *renderer) SDL_Texture *texture = NULL; SDL_PropertiesID props = SDL_GetRendererProperties(renderer); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, NULL); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, NULL); /* Release all textures */ for (texture = renderer->textures; texture; texture = texture->next) { @@ -1192,8 +1192,8 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) data->srvPoolHead = &data->srvPoolNodes[0]; SDL_PropertiesID props = SDL_GetRendererProperties(renderer); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice); - SDL_SetProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_DEVICE_POINTER, data->d3dDevice); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_D3D12_COMMAND_QUEUE_POINTER, data->commandQueue); done: SAFE_RELEASE(d3dDevice); @@ -1310,7 +1310,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) swapChainDesc.Flags = DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT | /* To support SetMaximumFrameLatency */ DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING; /* To support presenting with allow tearing on */ - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(renderer->window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { SDL_SetError("Couldn't get window handle"); result = E_FAIL; @@ -1376,7 +1376,7 @@ static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) result = DXGI_ERROR_UNSUPPORTED; } - SDL_SetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER, data->swapChain); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D12_SWAPCHAIN_POINTER, data->swapChain); done: SAFE_RELEASE(swapChain); @@ -1600,7 +1600,7 @@ static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index) static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D12Resource **texture) { - IUnknown *unknown = (IUnknown*)SDL_GetProperty(props, name, NULL); + IUnknown *unknown = (IUnknown*)SDL_GetPointerProperty(props, name, NULL); if (unknown) { HRESULT result = D3D_CALL(unknown, QueryInterface, D3D_GUID(SDL_IID_ID3D12Resource), (void **)texture); if (FAILED(result)) { @@ -1685,7 +1685,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } } textureData->mainResourceState = D3D12_RESOURCE_STATE_COPY_DEST; - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER, textureData->mainTexture); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_POINTER, textureData->mainTexture); #if SDL_HAVE_YUV if (texture->format == SDL_PIXELFORMAT_YV12 || texture->format == SDL_PIXELFORMAT_IYUV) { @@ -1711,7 +1711,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } } textureData->mainResourceStateU = D3D12_RESOURCE_STATE_COPY_DEST; - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_U_POINTER, textureData->mainTextureU); if (GetTextureProperty(create_props, "d3d12.texture_v", &textureData->mainTextureV) < 0) { return -1; @@ -1730,7 +1730,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } } textureData->mainResourceStateV = D3D12_RESOURCE_STATE_COPY_DEST; - SDL_SetProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER, textureData->mainTextureV); + SDL_SetPointerProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_D3D12_TEXTURE_V_POINTER, textureData->mainTextureV); textureData->YCbCr_matrix = SDL_GetYCbCRtoRGBConversionMatrix(texture->colorspace, texture->w, texture->h, 8); if (!textureData->YCbCr_matrix) { @@ -3232,7 +3232,7 @@ int D3D12_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propert { D3D12_RenderData *data; - HWND hwnd = (HWND)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); + HWND hwnd = (HWND)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL); if (!hwnd) { return SDL_SetError("Couldn't get window handle"); } diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index 29580af88bf61..e16f391189f03 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -632,7 +632,7 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL CVPixelBufferRef pixelbuffer = nil; IOSurfaceRef surface = nil; - pixelbuffer = SDL_GetProperty(create_props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, nil); + pixelbuffer = SDL_GetPointerProperty(create_props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, nil); if (pixelbuffer) { surface = CVPixelBufferGetIOSurface(pixelbuffer); if (!surface) { @@ -1861,7 +1861,7 @@ static int METAL_SetVSync(SDL_Renderer *renderer, const int vsync) static SDL_MetalView GetWindowView(SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_COCOA - NSWindow *nswindow = (__bridge NSWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); + NSWindow *nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, NULL); NSInteger tag = (NSInteger)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, 0); if (nswindow && tag) { NSView *view = nswindow.contentView; @@ -1875,7 +1875,7 @@ static SDL_MetalView GetWindowView(SDL_Window *window) #endif #ifdef SDL_VIDEO_DRIVER_UIKIT - UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); + UIWindow *uiwindow = (__bridge UIWindow *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, NULL); NSInteger tag = (NSInteger)SDL_GetNumberProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER, 0); if (uiwindow && tag) { UIView *view = uiwindow.rootViewController.view; diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 688a0d1d10788..025cdc084649f 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -1713,7 +1713,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert rendererData->supportsKHRGetPhysicalDeviceProperties2 = VULKAN_InstanceExtensionFound(rendererData, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); /* Create VkInstance */ - rendererData->instance = (VkInstance)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL); + rendererData->instance = (VkInstance)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, NULL); if (rendererData->instance) { rendererData->instance_external = SDL_TRUE; } else { @@ -1769,7 +1769,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } /* Choose Vulkan physical device */ - rendererData->physicalDevice = (VkPhysicalDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, NULL); + rendererData->physicalDevice = (VkPhysicalDevice)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, NULL); if (rendererData->physicalDevice) { vkGetPhysicalDeviceMemoryProperties(rendererData->physicalDevice, &rendererData->physicalDeviceMemoryProperties); vkGetPhysicalDeviceFeatures(rendererData->physicalDevice, &rendererData->physicalDeviceFeatures); @@ -1793,7 +1793,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } /* Create Vulkan device */ - rendererData->device = (VkDevice)SDL_GetProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL); + rendererData->device = (VkDevice)SDL_GetPointerProperty(create_props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, NULL); if (rendererData->device) { rendererData->device_external = SDL_TRUE; } else { @@ -1936,10 +1936,10 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert } SDL_PropertiesID props = SDL_GetRendererProperties(renderer); - SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER, rendererData->instance); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_INSTANCE_POINTER, rendererData->instance); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_SURFACE_NUMBER, (Sint64)rendererData->surface); - SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER, rendererData->physicalDevice); - SDL_SetProperty(props, SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER, rendererData->device); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_PHYSICAL_DEVICE_POINTER, rendererData->physicalDevice); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_VULKAN_DEVICE_POINTER, rendererData->device); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, rendererData->graphicsQueueFamilyIndex); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, rendererData->presentQueueFamilyIndex); diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 916f64bdab36a..159cb49a031c3 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1045,7 +1045,7 @@ static void SDLTest_PrintRenderer(SDL_Renderer *renderer) SDL_Log(" Renderer %s:\n", name); SDL_Log(" VSync: %d\n", (int)SDL_GetNumberProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_VSYNC_NUMBER, 0)); - texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); + texture_formats = (const SDL_PixelFormat *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); if (texture_formats) { (void)SDL_snprintf(text, sizeof(text), " Texture formats: "); for (i = 0; texture_formats[i]; ++i) { diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index c9be0dc913046..fdcfe8f622f0d 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -361,10 +361,10 @@ SDL_Thread *SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, } #endif - SDL_ThreadFunction fn = (SDL_ThreadFunction) SDL_GetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, NULL); + SDL_ThreadFunction fn = (SDL_ThreadFunction) SDL_GetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, NULL); const char *name = SDL_GetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, NULL); const size_t stacksize = (size_t) SDL_GetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, 0); - void *userdata = SDL_GetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, NULL); + void *userdata = SDL_GetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, NULL); if (!fn) { SDL_SetError("Thread entry function is NULL"); @@ -411,9 +411,9 @@ SDL_Thread *SDL_CreateThreadRuntime(SDL_ThreadFunction fn, SDL_FunctionPointer pfnEndThread) { const SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); SDL_SetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, name); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); SDL_Thread *thread = SDL_CreateThreadWithPropertiesRuntime(props, pfnBeginThread, pfnEndThread); SDL_DestroyProperties(props); return thread; @@ -423,9 +423,9 @@ SDL_Thread *SDL_CreateThreadRuntime(SDL_ThreadFunction fn, SDL_Thread *SDL_CreateThreadWithStackSize(SDL_ThreadFunction fn, const char *name, size_t stacksize, void *userdata) { const SDL_PropertiesID props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_ENTRY_FUNCTION_POINTER, (void *) fn); SDL_SetStringProperty(props, SDL_PROP_THREAD_CREATE_NAME_STRING, name); - SDL_SetProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); + SDL_SetPointerProperty(props, SDL_PROP_THREAD_CREATE_USERDATA_POINTER, userdata); SDL_SetNumberProperty(props, SDL_PROP_THREAD_CREATE_STACKSIZE_NUMBER, (Sint64) stacksize); SDL_Thread *thread = SDL_CreateThreadWithProperties(props); SDL_DestroyProperties(props); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index be4e42f38fde9..6618020a3b86f 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -287,7 +287,7 @@ static void SDLCALL SDL_CleanupWindowTextureData(void *userdata, void *value) static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + SDL_WindowTextureData *data = (SDL_WindowTextureData *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); const SDL_bool transparent = (window->flags & SDL_WINDOW_TRANSPARENT) ? SDL_TRUE : SDL_FALSE; int i; int w, h; @@ -347,7 +347,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S SDL_DestroyRenderer(renderer); return -1; } - if (SDL_SetPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL) < 0) { + if (SDL_SetPointerPropertyWithCleanup(props, SDL_PROP_WINDOW_TEXTUREDATA_POINTER, data, SDL_CleanupWindowTextureData, NULL) < 0) { SDL_DestroyRenderer(renderer); return -1; } @@ -355,7 +355,7 @@ static int SDL_CreateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, S data->renderer = renderer; } - texture_formats = (const SDL_PixelFormat *)SDL_GetProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); + texture_formats = (const SDL_PixelFormat *)SDL_GetPointerProperty(SDL_GetRendererProperties(data->renderer), SDL_PROP_RENDERER_TEXTURE_FORMATS_POINTER, NULL); if (!texture_formats) { return -1; } @@ -416,7 +416,7 @@ int SDL_SetWindowTextureVSync(SDL_VideoDevice *_this, SDL_Window *window, int vs { SDL_WindowTextureData *data; - data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); if (!data) { return -1; } @@ -430,7 +430,7 @@ static int SDL_GetWindowTextureVSync(SDL_VideoDevice *_this, SDL_Window *window, { SDL_WindowTextureData *data; - data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); if (!data) { return -1; } @@ -449,7 +449,7 @@ static int SDL_UpdateWindowTexture(SDL_VideoDevice *_this, SDL_Window *window, c SDL_GetWindowSizeInPixels(window, &w, &h); - data = (SDL_WindowTextureData *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); + data = (SDL_WindowTextureData *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_TEXTUREDATA_POINTER, NULL); if (!data || !data->texture) { return SDL_SetError("No window texture data"); } @@ -2155,7 +2155,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props) int y = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, SDL_WINDOWPOS_UNDEFINED); int w = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, 0); int h = (int)SDL_GetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, 0); - SDL_Window *parent = (SDL_Window *)SDL_GetProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, NULL); + SDL_Window *parent = (SDL_Window *)SDL_GetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, NULL); SDL_WindowFlags flags = SDL_GetWindowFlagProperties(props); SDL_WindowFlags type_flags, graphics_flags; SDL_bool undefined_x = SDL_FALSE; @@ -2400,7 +2400,7 @@ SDL_Window *SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y return NULL; } - SDL_SetProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, parent); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_CREATE_PARENT_POINTER, parent); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_X_NUMBER, offset_x); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_Y_NUMBER, offset_y); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, w); @@ -3758,7 +3758,7 @@ void SDL_OnWindowResized(SDL_Window *window) SDL_CheckWindowPixelSizeChanged(window); if ((window->flags & SDL_WINDOW_TRANSPARENT) && _this->UpdateWindowShape) { - SDL_Surface *surface = (SDL_Surface *)SDL_GetProperty(window->props, SDL_PROP_WINDOW_SHAPE_POINTER, NULL); + SDL_Surface *surface = (SDL_Surface *)SDL_GetPointerProperty(window->props, SDL_PROP_WINDOW_SHAPE_POINTER, NULL); if (surface) { _this->UpdateWindowShape(_this, window, surface); } diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index 3186f50c73ac3..ea7a786334014 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -72,7 +72,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert retval = SDL_SetError("Could not fetch native window"); goto endfunction; } - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER, data->native_window); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_WINDOW_POINTER, data->native_window); /* Do not create EGLSurface for Vulkan window since it will then make the window incompatible with vkCreateAndroidSurfaceKHR */ @@ -87,7 +87,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert goto endfunction; } } - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface); #endif window->driverdata = data; diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index f3a17b47686ac..c0f4facb23ffb 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -846,7 +846,7 @@ - (void)clearFocusClickPending:(NSInteger)button - (void)updateIgnoreMouseState:(NSEvent *)theEvent { SDL_Window *window = _data.window; - SDL_Surface *shape = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); + SDL_Surface *shape = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_SHAPE_POINTER, NULL); BOOL ignoresMouseEvents = NO; if (shape) { @@ -2054,7 +2054,7 @@ then immediately ordering out (removing) the window does work. */ } SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, (__bridge void *)data.nswindow); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_COCOA_WINDOW_POINTER, (__bridge void *)data.nswindow); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG); /* All done! */ @@ -2067,7 +2067,7 @@ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie { @autoreleasepool { SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; - const void *data = SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL); + const void *data = SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL); NSWindow *nswindow = nil; NSView *nsview = nil; @@ -2080,8 +2080,8 @@ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie SDL_assert(false); } } else { - nswindow = (__bridge NSWindow *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER, NULL); - nsview = (__bridge NSView *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER, NULL); + nswindow = (__bridge NSWindow *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_WINDOW_POINTER, NULL); + nsview = (__bridge NSView *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_COCOA_VIEW_POINTER, NULL); } if (nswindow && !nsview) { nsview = [nswindow contentView]; diff --git a/src/video/dummy/SDL_nullframebuffer.c b/src/video/dummy/SDL_nullframebuffer.c index 862c36c7e3d83..f1311cfbe4a95 100644 --- a/src/video/dummy/SDL_nullframebuffer.c +++ b/src/video/dummy/SDL_nullframebuffer.c @@ -55,7 +55,7 @@ int SDL_DUMMY_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), DUMMY_SURFACE, NULL); + surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), DUMMY_SURFACE, NULL); if (!surface) { return SDL_SetError("Couldn't find dummy surface for window"); } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index cbf68e4bdaedd..5d231595cfa71 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1578,7 +1578,7 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti SDL_PropertiesID props = SDL_GetWindowProperties(window); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER, viddata->devindex); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd); - SDL_SetProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev); if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */ diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index 37b3a79b49fac..1180e20d6d552 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -73,7 +73,7 @@ int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, void *framebuffer; u32 bufsize; - surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), N3DS_SURFACE, NULL); + surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), N3DS_SURFACE, NULL); if (!surface) { return SDL_SetError("%s: Unable to get the window surface.", __func__); } diff --git a/src/video/offscreen/SDL_offscreenframebuffer.c b/src/video/offscreen/SDL_offscreenframebuffer.c index 89d7e83d7478a..82bb536d8ae51 100644 --- a/src/video/offscreen/SDL_offscreenframebuffer.c +++ b/src/video/offscreen/SDL_offscreenframebuffer.c @@ -56,7 +56,7 @@ int SDL_OFFSCREEN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *wi static int frame_number; SDL_Surface *surface; - surface = (SDL_Surface *)SDL_GetProperty(SDL_GetWindowProperties(window), OFFSCREEN_SURFACE, NULL); + surface = (SDL_Surface *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), OFFSCREEN_SURFACE, NULL); if (!surface) { return SDL_SetError("Couldn't find offscreen surface for window"); } diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 395c01322a2ff..a93f7a29f9dc7 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -146,7 +146,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow [view setSDLWindow:window]; SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, (__bridge void *)data.uiwindow); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_UIKIT_WINDOW_POINTER, (__bridge void *)data.uiwindow); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_UIKIT_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG); return 0; diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c index c808cf8786a7c..ed27b27277d8a 100644 --- a/src/video/vivante/SDL_vivantevideo.c +++ b/src/video/vivante/SDL_vivantevideo.c @@ -256,7 +256,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert window->driverdata = data; SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display); #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK data->native_window = vdkCreateWindow(displaydata->native_display, window->x, window->y, window->w, window->h); @@ -266,7 +266,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert if (!data->native_window) { return SDL_SetError("VIVANTE: Can't create native window"); } - SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER, data->native_window); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_WINDOW_POINTER, data->native_window); #ifdef SDL_VIDEO_OPENGL_EGL if (window->flags & SDL_WINDOW_OPENGL) { @@ -277,7 +277,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert } else { data->egl_surface = EGL_NO_SURFACE; } - SDL_SetProperty(props, SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER, data->egl_surface); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_SURFACE_POINTER, data->egl_surface); #endif /* Window has been successfully created */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index dc7232b09f66d..0745c09161dc9 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -377,7 +377,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) SDL_VideoDevice *device; SDL_VideoData *data; struct SDL_WaylandInput *input; - struct wl_display *display = SDL_GetProperty(SDL_GetGlobalProperties(), + struct wl_display *display = SDL_GetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL); SDL_bool display_is_external = !!display; @@ -441,7 +441,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) } if (!display_is_external) { - SDL_SetProperty(SDL_GetGlobalProperties(), + SDL_SetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); } diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 4176647594ed0..5d5aa97000d6b 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1709,8 +1709,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) zxdg_exported_v2_add_listener(data->exported, &exported_v2_listener, data); } - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame)); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame)); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, libdecor_frame_get_xdg_surface(data->shell_surface.libdecor.frame)); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, libdecor_frame_get_xdg_toplevel(data->shell_surface.libdecor.frame)); } } else #endif @@ -1718,7 +1718,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) data->shell_surface.xdg.surface = xdg_wm_base_get_xdg_surface(c->shell.xdg, data->surface); xdg_surface_set_user_data(data->shell_surface.xdg.surface, data); xdg_surface_add_listener(data->shell_surface.xdg.surface, &shell_surface_listener_xdg, data); - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, data->shell_surface.xdg.surface); if (data->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { SDL_Window *parent = window->parent; @@ -1777,8 +1777,8 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) } } - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, data->shell_surface.xdg.roleobj.popup.popup); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, data->shell_surface.xdg.roleobj.popup.positioner); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, data->shell_surface.xdg.roleobj.popup.popup); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, data->shell_surface.xdg.roleobj.popup.positioner); } else { data->shell_surface.xdg.roleobj.toplevel = xdg_surface_get_toplevel(data->shell_surface.xdg.surface); xdg_toplevel_set_app_id(data->shell_surface.xdg.roleobj.toplevel, data->app_id); @@ -1789,7 +1789,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) zxdg_exported_v2_add_listener(data->exported, &exported_v2_listener, data); } - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, data->shell_surface.xdg.roleobj.toplevel); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, data->shell_surface.xdg.roleobj.toplevel); } } @@ -1929,8 +1929,8 @@ static void Wayland_ReleasePopup(SDL_VideoDevice *_this, SDL_Window *popup) popupdata->shell_surface.xdg.roleobj.popup.positioner = NULL; SDL_PropertiesID props = SDL_GetWindowProperties(popup); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, NULL); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POPUP_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_POSITIONER_POINTER, NULL); } void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) @@ -1983,8 +1983,8 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) libdecor_frame_unref(wind->shell_surface.libdecor.frame); wind->shell_surface.libdecor.frame = NULL; - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); } } else #endif @@ -1993,12 +1993,12 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) } else if (wind->shell_surface.xdg.roleobj.toplevel) { xdg_toplevel_destroy(wind->shell_surface.xdg.roleobj.toplevel); wind->shell_surface.xdg.roleobj.toplevel = NULL; - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_POINTER, NULL); } if (wind->shell_surface.xdg.surface) { xdg_surface_destroy(wind->shell_surface.xdg.surface); wind->shell_surface.xdg.surface = NULL; - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_SURFACE_POINTER, NULL); } wind->show_hide_sync_required = SDL_TRUE; @@ -2315,8 +2315,8 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert { SDL_WindowData *data; SDL_VideoData *c = _this->driverdata; - struct wl_surface *external_surface = (struct wl_surface *)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, - (struct wl_surface *)SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL)); + struct wl_surface *external_surface = (struct wl_surface *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, + (struct wl_surface *)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); const SDL_bool custom_surface_role = (external_surface != NULL) || SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN, SDL_FALSE); const SDL_bool create_egl_window = !!(window->flags & SDL_WINDOW_OPENGL) || SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_CREATE_EGL_WINDOW_BOOLEAN, SDL_FALSE); @@ -2485,9 +2485,9 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert } SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface); - SDL_SetProperty(props, SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER, data->egl_window); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_EGL_WINDOW_POINTER, data->egl_window); data->hit_test_result = SDL_HITTEST_NORMAL; diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 80901b70cc23a..4b9bcb7eeb67f 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -572,9 +572,9 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd #endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ SDL_PropertiesID props = SDL_GetWindowProperties(window); - SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, data->hwnd); - SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_HDC_POINTER, data->hdc); - SDL_SetProperty(props, SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER, data->hinstance); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, data->hwnd); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_HDC_POINTER, data->hdc); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WIN32_INSTANCE_POINTER, data->hinstance); /* All done! */ return 0; @@ -673,7 +673,7 @@ static void WIN_SetKeyboardFocus(SDL_Window *window) int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { - HWND hwnd = (HWND)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER, SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL)); + HWND hwnd = (HWND)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_HWND_POINTER, SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); HWND parent = NULL; if (hwnd) { window->flags |= SDL_WINDOW_EXTERNAL; @@ -755,7 +755,7 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI } } - HWND share_hwnd = (HWND)SDL_GetProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER, NULL); + HWND share_hwnd = (HWND)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WIN32_PIXEL_FORMAT_HWND_POINTER, NULL); if (share_hwnd) { HDC hdc = GetDC(share_hwnd); int pixel_format = GetPixelFormat(hdc); diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 6719778732994..48805d3c73181 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -610,7 +610,7 @@ int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie data->appView = ApplicationView::GetForCurrentView(); #endif } - SDL_SetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast(data->coreWindow.Get())); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WINRT_WINDOW_POINTER, reinterpret_cast(data->coreWindow.Get())); /* Make note of the requested window flags, before they start getting changed. */ const Uint32 requestedFlags = window->flags; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 9aa47aa5517e9..ef12311eae3b7 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -412,7 +412,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, Window w) SDL_PropertiesID props = SDL_GetWindowProperties(window); int screen = (displaydata ? displaydata->screen : 0); - SDL_SetProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, data->videodata->display); + SDL_SetPointerProperty(props, SDL_PROP_WINDOW_X11_DISPLAY_POINTER, data->videodata->display); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_SCREEN_NUMBER, screen); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, data->xwindow); @@ -454,7 +454,7 @@ static void SetWindowBordered(Display *display, int screen, Window window, SDL_b int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { Window w = (Window)SDL_GetNumberProperty(create_props, SDL_PROP_WINDOW_CREATE_X11_WINDOW_NUMBER, - (Window)SDL_GetProperty(create_props, "sdl2-compat.external_window", NULL)); + (Window)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); if (w) { window->flags |= SDL_WINDOW_EXTERNAL; diff --git a/test/testautomation_iostream.c b/test/testautomation_iostream.c index 05595236e7cce..3caa7e2bed9b5 100644 --- a/test/testautomation_iostream.c +++ b/test/testautomation_iostream.c @@ -343,14 +343,14 @@ static int iostrm_testDynamicMem(void *arg) testGenericIOStreamValidations(rw, SDL_TRUE); /* Get the dynamic memory and verify it */ - mem = (char *)SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); - SDLTest_AssertPass("Call to SDL_GetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded"); + mem = (char *)SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); + SDLTest_AssertPass("Call to SDL_GetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL) succeeded"); SDLTest_AssertCheck(mem != NULL, "Verify memory value is not NULL"); mem[SDL_GetIOSize(rw)] = '\0'; SDLTest_AssertCheck(SDL_strcmp(mem, IOStreamHelloWorldTestString) == 0, "Verify memory value is correct"); /* Take the memory and free it ourselves */ - SDL_SetProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); + SDL_SetPointerProperty(props, SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL); SDL_free(mem); /* Close */ diff --git a/test/testautomation_properties.c b/test/testautomation_properties.c index 8373cb36e49c8..1d1ea4f59cf6f 100644 --- a/test/testautomation_properties.c +++ b/test/testautomation_properties.c @@ -43,12 +43,12 @@ static int properties_testBasic(void *arg) for (i = 0; i < 10; ++i) { SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i); - result = SDL_SetProperty(props, key, expected_value); - SDLTest_AssertPass("Call to SDL_SetProperty()"); + result = SDL_SetPointerProperty(props, key, expected_value); + SDLTest_AssertPass("Call to SDL_SetPointerProperty()"); SDLTest_AssertCheck(result == 0, "Verify property value was set, got: %d", result); - value = SDL_GetProperty(props, key, NULL); - SDLTest_AssertPass("Call to SDL_GetProperty()"); + value = SDL_GetPointerProperty(props, key, NULL); + SDLTest_AssertPass("Call to SDL_GetPointerProperty()"); SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, expected_value) == 0, "Verify property value was set, got %s, expected %s", value ? (const char *)value : "NULL", expected_value); } @@ -60,12 +60,12 @@ static int properties_testBasic(void *arg) for (i = 0; i < 10; ++i) { SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); - result = SDL_SetProperty(props, key, NULL); - SDLTest_AssertPass("Call to SDL_SetProperty(NULL)"); + result = SDL_SetPointerProperty(props, key, NULL); + SDLTest_AssertPass("Call to SDL_SetPointerProperty(NULL)"); SDLTest_AssertCheck(result == 0, "Verify property value was set, got: %d", result); - value = SDL_GetProperty(props, key, NULL); - SDLTest_AssertPass("Call to SDL_GetProperty()"); + value = SDL_GetPointerProperty(props, key, NULL); + SDLTest_AssertPass("Call to SDL_GetPointerProperty()"); SDLTest_AssertCheck(value == NULL, "Verify property value was set, got %s, expected NULL", (const char *)value); } @@ -76,7 +76,7 @@ static int properties_testBasic(void *arg) "Verify property count, expected 0, got: %d", count); /* Check default values */ - value = SDL_GetProperty(props, "foo", (void *)0xabcd); + value = SDL_GetPointerProperty(props, "foo", (void *)0xabcd); SDLTest_AssertCheck(value == (void *)0xabcd, "Verify property, expected 0xabcd, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", "abcd"); @@ -93,12 +93,12 @@ static int properties_testBasic(void *arg) "Verify boolean property, expected SDL_TRUE, got: %s", value_bool ? "SDL_TRUE" : "SDL_FALSE"); /* Check data value */ - SDLTest_AssertPass("Call to SDL_SetProperty(\"foo\", 0x01)"); - SDL_SetProperty(props, "foo", (void *)0x01); + SDLTest_AssertPass("Call to SDL_SetPointerProperty(\"foo\", 0x01)"); + SDL_SetPointerProperty(props, "foo", (void *)0x01); type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_POINTER, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_POINTER, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == (void *)0x01, "Verify property, expected 0x01, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -120,7 +120,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_STRING, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_STRING, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -142,7 +142,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_NUMBER, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_NUMBER, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -164,7 +164,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_FLOAT, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_FLOAT, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -186,7 +186,7 @@ static int properties_testBasic(void *arg) type = SDL_GetPropertyType(props, "foo"); SDLTest_AssertCheck(type == SDL_PROPERTY_TYPE_BOOLEAN, "Verify property type, expected %d, got: %d", SDL_PROPERTY_TYPE_BOOLEAN, type); - value = SDL_GetProperty(props, "foo", NULL); + value = SDL_GetPointerProperty(props, "foo", NULL); SDLTest_AssertCheck(value == NULL, "Verify property, expected NULL, got: %p", value); value_string = SDL_GetStringProperty(props, "foo", NULL); @@ -230,8 +230,8 @@ static int properties_testCopy(void *arg) a = SDL_CreateProperties(); SDL_SetNumberProperty(a, "num", 1); SDL_SetStringProperty(a, "string", "foo"); - SDL_SetProperty(a, "data", &a); - SDL_SetPropertyWithCleanup(a, "cleanup", &a, copy_cleanup, &a); + SDL_SetPointerProperty(a, "data", &a); + SDL_SetPointerPropertyWithCleanup(a, "cleanup", &a, copy_cleanup, &a); b = SDL_CreateProperties(); SDL_SetNumberProperty(b, "num", 2); @@ -261,11 +261,11 @@ static int properties_testCopy(void *arg) SDLTest_AssertCheck(string && SDL_strcmp(string, "foo") == 0, "Checking string property, got \"%s\", expected \"foo\"", string); - data = SDL_GetProperty(b, "data", NULL); + data = SDL_GetPointerProperty(b, "data", NULL); SDLTest_AssertCheck(data == &a, "Checking data property, got %p, expected %p", data, &a); - data = SDL_GetProperty(b, "cleanup", NULL); + data = SDL_GetPointerProperty(b, "cleanup", NULL); SDLTest_AssertCheck(data == NULL, "Checking cleanup property, got %p, expected NULL", data); @@ -290,9 +290,9 @@ static int properties_testCleanup(void *arg) props = SDL_CreateProperties(); - SDLTest_AssertPass("Call to SDL_SetProperty(cleanup)"); + SDLTest_AssertPass("Call to SDL_SetPointerProperty(cleanup)"); count = 0; - SDL_SetPropertyWithCleanup(props, "a", "0", cleanup, &count); + SDL_SetPointerPropertyWithCleanup(props, "a", "0", cleanup, &count); SDL_ClearProperty(props, "a"); SDLTest_AssertCheck(count == 1, "Verify cleanup for deleting property, got %d, expected 1", count); @@ -302,7 +302,7 @@ static int properties_testCleanup(void *arg) for (i = 0; i < 10; ++i) { SDL_snprintf(key, SDL_arraysize(key), "%c", 'a' + i); SDL_snprintf(expected_value, SDL_arraysize(expected_value), "%c", 'a' + i); - SDL_SetPropertyWithCleanup(props, key, expected_value, cleanup, &count); + SDL_SetPointerPropertyWithCleanup(props, key, expected_value, cleanup, &count); } SDL_DestroyProperties(props); SDLTest_AssertCheck(count == 10, @@ -325,11 +325,11 @@ static int properties_thread(void *arg) while (!data->done) { SDL_LockProperties(data->props); - SDL_SetProperty(data->props, "a", "thread_loop"); + SDL_SetPointerProperty(data->props, "a", "thread_loop"); SDL_UnlockProperties(data->props); } SDL_LockProperties(data->props); - SDL_SetProperty(data->props, "a", "thread_done"); + SDL_SetPointerProperty(data->props, "a", "thread_done"); SDL_UnlockProperties(data->props); return 0; } @@ -343,7 +343,7 @@ static int properties_testLocking(void *arg) data.done = SDL_FALSE; data.props = SDL_CreateProperties(); SDLTest_AssertPass("Setting property to 'init'"); - SDL_SetProperty(data.props, "a", "init"); + SDL_SetPointerProperty(data.props, "a", "init"); thread = SDL_CreateThread(properties_thread, "properties_thread", &data); if (thread) { SDLTest_AssertPass("Waiting for property to change to 'thread_loop'"); @@ -351,7 +351,7 @@ static int properties_testLocking(void *arg) { SDL_Delay(10); SDL_LockProperties(data.props); - value = SDL_GetProperty(data.props, "a", NULL); + value = SDL_GetPointerProperty(data.props, "a", NULL); SDL_UnlockProperties(data.props); if (!value || SDL_strcmp((const char *)value, "thread_loop") == 0) { @@ -363,9 +363,9 @@ static int properties_testLocking(void *arg) SDLTest_AssertPass("Setting property to 'main'"); SDL_LockProperties(data.props); - SDL_SetProperty(data.props, "a", "main"); + SDL_SetPointerProperty(data.props, "a", "main"); SDL_Delay(100); - value = SDL_GetProperty(data.props, "a", NULL); + value = SDL_GetPointerProperty(data.props, "a", NULL); SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, "main") == 0, "After 100ms sleep, property is %s, expected 'main'", value ? (const char *)value : "NULL"); SDL_UnlockProperties(data.props); @@ -373,7 +373,7 @@ static int properties_testLocking(void *arg) data.done = SDL_TRUE; SDL_WaitThread(thread, NULL); - value = SDL_GetProperty(data.props, "a", NULL); + value = SDL_GetPointerProperty(data.props, "a", NULL); SDLTest_AssertCheck(value && SDL_strcmp((const char *)value, "thread_done") == 0, "After thread complete, property is %s, expected 'thread_done'", value ? (const char *)value : "NULL"); } diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 577e3d7d1101d..b8b995a3ca73b 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -1528,20 +1528,20 @@ static int video_getSetWindowData(void *arg) } /* Get non-existent data */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s)", name, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); /* Get data (twice) */ for (iteration = 1; iteration <= 2; iteration++) { - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [iteration %d]", name, iteration); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); @@ -1549,103 +1549,103 @@ static int video_getSetWindowData(void *arg) /* Set data again twice */ for (iteration = 1; iteration <= 2; iteration++) { - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [iteration %d]", name, userdata, iteration); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); } /* Get data again */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again]", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with new data */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata2); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata2); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Set data with new data again */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata2); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata2); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [new userdata again]", name, userdata2); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Get new data */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata2, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with NULL to clear */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL)", name); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Set data with NULL to clear again */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,NULL) [again]", name); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata2, userdata2) == 0, "Validate that userdata2 was not changed, expected: %s, got: %s", referenceUserdata2, userdata2); /* Get non-existent data */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Get non-existent data new name */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name2, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name2, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s)", name2); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); SDLTest_AssertCheck(SDL_strcmp(referenceName2, name2) == 0, "Validate that name2 was not changed, expected: %s, got: %s", referenceName2, name2); /* Set data (again) */ - SDL_SetProperty(SDL_GetWindowProperties(window), name, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), name, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(...%s,%s) [again, after clear]", name, userdata); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, userdata) == 0, "Validate that userdata was not changed, expected: %s, got: %s", referenceUserdata, userdata); /* Get data (again) */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), name, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), name, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(..,%s) [again, after clear]", name); SDLTest_AssertCheck(SDL_strcmp(referenceUserdata, result) == 0, "Validate that correct result was returned; expected: %s, got: %s", referenceUserdata, result); SDLTest_AssertCheck(SDL_strcmp(referenceName, name) == 0, "Validate that name was not changed, expected: %s, got: %s", referenceName, name); /* Set data with NULL name, valid userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), NULL, userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), NULL, userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL)"); checkInvalidParameterError(); /* Set data with empty name, valid userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), "", userdata); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), "", userdata); SDLTest_AssertPass("Call to SDL_SetWindowData(name='')"); checkInvalidParameterError(); /* Set data with NULL name, NULL userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), NULL, NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), NULL, NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(name=NULL,userdata=NULL)"); checkInvalidParameterError(); /* Set data with empty name, NULL userdata */ - SDL_SetProperty(SDL_GetWindowProperties(window), "", NULL); + SDL_SetPointerProperty(SDL_GetWindowProperties(window), "", NULL); SDLTest_AssertPass("Call to SDL_SetWindowData(name='',userdata=NULL)"); checkInvalidParameterError(); /* Get data with NULL name */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), NULL, NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), NULL, NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(name=NULL)"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); /* Get data with empty name */ - result = (char *)SDL_GetProperty(SDL_GetWindowProperties(window), "", NULL); + result = (char *)SDL_GetPointerProperty(SDL_GetWindowProperties(window), "", NULL); SDLTest_AssertPass("Call to SDL_GetWindowData(name='')"); SDLTest_AssertCheck(result == NULL, "Validate that result is NULL"); diff --git a/test/testcolorspace.c b/test/testcolorspace.c index 6afa0d748cf2c..159049f564c48 100644 --- a/test/testcolorspace.c +++ b/test/testcolorspace.c @@ -78,7 +78,7 @@ static void CreateRenderer(void) SDL_PropertiesID props; props = SDL_CreateProperties(); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, SDL_GetRenderDriver(renderer_index)); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_OUTPUT_COLORSPACE_NUMBER, colorspace); renderer = SDL_CreateRendererWithProperties(props); diff --git a/test/testffmpeg.c b/test/testffmpeg.c index 0adbb23e3808d..71a402a24a377 100644 --- a/test/testffmpeg.c +++ b/test/testffmpeg.c @@ -151,7 +151,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char props = SDL_CreateProperties(); SDL_SetStringProperty(props, SDL_PROP_RENDERER_CREATE_NAME_STRING, driver); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, window); if (useVulkan) { SetupVulkanRenderProperties(vulkan_context, props); } @@ -217,7 +217,7 @@ static SDL_bool CreateWindowAndRenderer(SDL_WindowFlags window_flags, const char #endif /* HAVE_EGL */ #ifdef SDL_PLATFORM_WIN32 - d3d11_device = (ID3D11Device *)SDL_GetProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, NULL); + d3d11_device = (ID3D11Device *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_D3D11_DEVICE_POINTER, NULL); if (d3d11_device) { ID3D11Device_AddRef(d3d11_device); ID3D11Device_GetImmediateContext(d3d11_device, &d3d11_context); @@ -611,13 +611,13 @@ static SDL_bool GetTextureForMemoryFrame(AVFrame *frame, SDL_Texture **texture) case SDL_PIXELFORMAT_UNKNOWN: { SDL_PropertiesID props = SDL_GetTextureProperties(*texture); - struct SwsContextContainer *sws_container = (struct SwsContextContainer *)SDL_GetProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, NULL); + struct SwsContextContainer *sws_container = (struct SwsContextContainer *)SDL_GetPointerProperty(props, SWS_CONTEXT_CONTAINER_PROPERTY, NULL); if (!sws_container) { sws_container = (struct SwsContextContainer *)SDL_calloc(1, sizeof(*sws_container)); if (!sws_container) { return SDL_FALSE; } - SDL_SetPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL); + SDL_SetPointerPropertyWithCleanup(props, SWS_CONTEXT_CONTAINER_PROPERTY, sws_container, FreeSwsContextContainer, NULL); } sws_container->context = sws_getCachedContext(sws_container->context, frame->width, frame->height, frame->format, frame->width, frame->height, AV_PIX_FMT_BGRA, SWS_POINT, NULL, NULL, NULL); if (sws_container->context) { @@ -993,7 +993,7 @@ static SDL_bool GetTextureForD3D11Frame(AVFrame *frame, SDL_Texture **texture) } } - ID3D11Resource *dx11_resource = SDL_GetProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL); + ID3D11Resource *dx11_resource = SDL_GetPointerProperty(SDL_GetTextureProperties(*texture), SDL_PROP_TEXTURE_D3D11_TEXTURE_POINTER, NULL); if (!dx11_resource) { SDL_SetError("Couldn't get texture ID3D11Resource interface"); return SDL_FALSE; @@ -1019,7 +1019,7 @@ static SDL_bool GetTextureForVideoToolboxFrame(AVFrame *frame, SDL_Texture **tex } props = CreateVideoTextureProperties(frame, SDL_PIXELFORMAT_UNKNOWN, SDL_TEXTUREACCESS_STATIC); - SDL_SetProperty(props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, pPixelBuffer); + SDL_SetPointerProperty(props, SDL_PROP_TEXTURE_CREATE_METAL_PIXELBUFFER_POINTER, pPixelBuffer); *texture = SDL_CreateTextureWithProperties(renderer, props); SDL_DestroyProperties(props); if (!*texture) { diff --git a/test/testffmpeg_vulkan.c b/test/testffmpeg_vulkan.c index 36d69dd61f21e..3085733ce0f71 100644 --- a/test/testffmpeg_vulkan.c +++ b/test/testffmpeg_vulkan.c @@ -671,10 +671,10 @@ VulkanVideoContext *CreateVulkanVideoContext(SDL_Window *window) void SetupVulkanRenderProperties(VulkanVideoContext *context, SDL_PropertiesID props) { - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, context->instance); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_INSTANCE_POINTER, context->instance); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_SURFACE_NUMBER, (Sint64)context->surface); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, context->physicalDevice); - SDL_SetProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, context->device); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PHYSICAL_DEVICE_POINTER, context->physicalDevice); + SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_DEVICE_POINTER, context->device); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_PRESENT_QUEUE_FAMILY_INDEX_NUMBER, context->presentQueueFamilyIndex); SDL_SetNumberProperty(props, SDL_PROP_RENDERER_CREATE_VULKAN_GRAPHICS_QUEUE_FAMILY_INDEX_NUMBER, context->graphicsQueueFamilyIndex); } diff --git a/test/testmanymouse.c b/test/testmanymouse.c index 8c7180f7125c9..6f9e418ab3a45 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -479,8 +479,8 @@ static void loop(void) for (i = 0; i < state->num_windows; ++i) { SDL_Window *window = state->windows[i]; SDL_Renderer *renderer = state->renderers[i]; - SDL_Texture *arrow_cursor = (SDL_Texture *)SDL_GetProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, NULL); - SDL_Texture *cross_cursor = (SDL_Texture *)SDL_GetProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, NULL); + SDL_Texture *arrow_cursor = (SDL_Texture *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, NULL); + SDL_Texture *cross_cursor = (SDL_Texture *)SDL_GetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, NULL); SDL_SetRenderDrawColor(renderer, 128, 128, 128, 255); SDL_RenderClear(renderer); @@ -538,8 +538,8 @@ int main(int argc, char *argv[]) SDL_Texture *cursor_arrow = CreateTexture(arrow, renderer); SDL_Texture *cursor_cross = CreateTexture(cross, renderer); - SDL_SetProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, cursor_arrow); - SDL_SetProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_ARROW_CURSOR_TEXTURE, cursor_arrow); + SDL_SetPointerProperty(SDL_GetRendererProperties(renderer), PROP_CROSS_CURSOR_TEXTURE, cursor_cross); } /* We only get mouse motion for distinct devices when relative mode is enabled */ diff --git a/test/testnative.c b/test/testnative.c index 6a0db0757cef1..aee65b3eeec77 100644 --- a/test/testnative.c +++ b/test/testnative.c @@ -151,7 +151,7 @@ int main(int argc, char *argv[]) quit(3); } props = SDL_CreateProperties(); - SDL_SetProperty(props, "sdl2-compat.external_window", native_window); + SDL_SetPointerProperty(props, "sdl2-compat.external_window", native_window); SDL_SetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_OPENGL_BOOLEAN, SDL_TRUE); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_WIDTH_NUMBER, WINDOW_W); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_CREATE_HEIGHT_NUMBER, WINDOW_H); diff --git a/test/testnativewayland.c b/test/testnativewayland.c index f4a9b465cbf75..6f5c00ccda68f 100644 --- a/test/testnativewayland.c +++ b/test/testnativewayland.c @@ -116,7 +116,7 @@ static void *CreateWindowWayland(int w, int h) /* Export the display object from SDL and use it to create a registry object, * which will enumerate the wl_compositor and xdg_wm_base protocols. */ - state.wl_display = SDL_GetProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL); + state.wl_display = SDL_GetPointerProperty(SDL_GetGlobalProperties(), SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, NULL); if (!state.wl_display) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Invalid 'wl_display' object!"); diff --git a/test/testwaylandcustom.c b/test/testwaylandcustom.c index 753c2c88ddd1b..6e6bd37c7c09c 100644 --- a/test/testwaylandcustom.c +++ b/test/testwaylandcustom.c @@ -227,7 +227,7 @@ int main(int argc, char **argv) } /* Get the display object and use it to create a registry object, which will enumerate the xdg_wm_base protocol. */ - state.wl_display = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); + state.wl_display = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, NULL); state.wl_registry = wl_display_get_registry(state.wl_display); wl_registry_add_listener(state.wl_registry, &wl_registry_listener, NULL); @@ -240,7 +240,7 @@ int main(int argc, char **argv) } /* Get the wl_surface object from the SDL_Window, and create a toplevel window with it. */ - state.wl_surface = SDL_GetProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); + state.wl_surface = SDL_GetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, NULL); /* Create the xdg_surface from the wl_surface. */ state.xdg_surface = xdg_wm_base_get_xdg_surface(state.xdg_wm_base, state.wl_surface); From d6fe06bb5d1e5e9d0b350c13b5e0725817ebb7e2 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 17:42:22 +0000 Subject: [PATCH 270/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_properties.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index d277b5374d4db..599dfbfcca520 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -32,7 +32,8 @@ * Properties can be added to and retrieved from a property set through the * following functions: * - * - SDL_SetPointerProperty and SDL_GetPointerProperty operate on `void*` pointer types. + * - SDL_SetPointerProperty and SDL_GetPointerProperty operate on `void*` + * pointer types. * - SDL_SetStringProperty and SDL_GetStringProperty operate on string types. * - SDL_SetNumberProperty and SDL_GetNumberProperty operate on signed 64-bit * integer types. @@ -110,8 +111,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void); * * Copy all the properties from one set of properties to another, with the * exception of properties requiring cleanup (set using - * SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any property that - * already exists on `dst` will be overwritten. + * SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any + * property that already exists on `dst` will be overwritten. * * \param src the properties to copy. * \param dst the destination properties. @@ -170,8 +171,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * This callback is set per-property. Different properties in the same set can * have different cleanup callbacks. * - * This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if the - * function fails for any reason. + * This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if + * the function fails for any reason. * * \param userdata an app-defined pointer passed to the callback. * \param value the pointer assigned to the property to clean up. @@ -357,9 +358,10 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI * * \threadsafety It is safe to call this function from any thread, although * the data returned is not protected and could potentially be - * freed if you call SDL_SetPointerProperty() or SDL_ClearProperty() on - * these properties from another thread. If you need to avoid - * this, use SDL_LockProperties() and SDL_UnlockProperties(). + * freed if you call SDL_SetPointerProperty() or + * SDL_ClearProperty() on these properties from another thread. + * If you need to avoid this, use SDL_LockProperties() and + * SDL_UnlockProperties(). * * \since This function is available since SDL 3.0.0. * From be15d4ae1facb87dec2618e0ccf786d5d4e677d2 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 12 Jul 2024 13:06:24 -0400 Subject: [PATCH 271/431] wayland: Add support for SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH behavior Previously, the Wayland backend did not implement support for this hint and always passed focus clicks through. Obey the hint to match the behavior of other platforms. --- src/video/wayland/SDL_waylandevents.c | 32 +++++++++++++++++++++------ src/video/wayland/SDL_waylandwindow.h | 1 + 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 4a6f4f04c45a6..5b8f76f3c523b 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -78,6 +78,9 @@ #define WAYLAND_DEFAULT_KEYBOARD_NAME "Virtual core keyboard" #define WAYLAND_DEFAULT_POINTER_NAME "Virtual core pointer" +/* Focus clickthrough timeout */ +#define WAYLAND_FOCUS_CLICK_TIMEOUT_NS SDL_MS_TO_NS(10) + struct SDL_WaylandTouchPoint { SDL_TouchID id; @@ -695,6 +698,7 @@ static void pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_ SDL_WindowData *window = input->pointer_focus; enum wl_pointer_button_state state = state_w; uint32_t sdl_button; + SDL_bool ignore_click = SDL_FALSE; if (window) { SDL_VideoData *viddata = window->waylandData; @@ -721,11 +725,21 @@ static void pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_ return; } - /* Wayland won't let you "capture" the mouse, but it will - automatically track the mouse outside the window if you - drag outside of it, until you let go of all buttons (even - if you add or remove presses outside the window, as long - as any button is still down, the capture remains) */ + /* Possibly ignore this click if it was to gain focus. */ + if (window->last_focus_event_time_ns) { + if (state == WL_POINTER_BUTTON_STATE_PRESSED && + (SDL_GetTicksNS() - window->last_focus_event_time_ns) < WAYLAND_FOCUS_CLICK_TIMEOUT_NS) { + ignore_click = !SDL_GetHintBoolean(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, SDL_FALSE); + } + + window->last_focus_event_time_ns = 0; + } + + /* Wayland won't let you "capture" the mouse, but it will automatically track + * the mouse outside the window if you drag outside of it, until you let go + * of all buttons (even if you add or remove presses outside the window, as + * long as any button is still down, the capture remains). + */ if (state) { /* update our mask of currently-pressed buttons */ input->buttons_pressed |= SDL_BUTTON(sdl_button); } else { @@ -745,8 +759,10 @@ static void pointer_handle_button_common(struct SDL_WaylandInput *input, uint32_ Wayland_UpdateImplicitGrabSerial(input, serial); } - SDL_SendMouseButton(Wayland_GetPointerTimestamp(input, time), window->sdlwindow, input->pointer_id, - state ? SDL_PRESSED : SDL_RELEASED, sdl_button); + if (!ignore_click) { + SDL_SendMouseButton(Wayland_GetPointerTimestamp(input, time), window->sdlwindow, input->pointer_id, + state ? SDL_PRESSED : SDL_RELEASED, sdl_button); + } } } @@ -1517,6 +1533,8 @@ static void keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, } #endif + window->last_focus_event_time_ns = SDL_GetTicksNS(); + wl_array_for_each (key, keys) { const SDL_Scancode scancode = Wayland_get_scancode_from_key(input, *key + 8); const SDL_Keycode keycode = SDL_GetKeyFromScancode(scancode, SDL_KMOD_NONE); diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index 489c0edaa42b2..032c4845ba074 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -157,6 +157,7 @@ struct SDL_WindowData SDL_DisplayID last_displayID; int fullscreen_deadline_count; + Uint64 last_focus_event_time_ns; SDL_bool floating; SDL_bool suspended; SDL_bool active; From 0e56f6a3ca808aca7f962152575d9308d5afccb7 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 10:45:32 -0700 Subject: [PATCH 272/431] Clarify property group documentation Fixes https://github.com/libsdl-org/SDL/issues/10241 --- include/SDL3/SDL_properties.h | 58 +++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 599dfbfcca520..f0d6a12e419bb 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -25,11 +25,11 @@ * A property is a variable that can be created and retrieved by name at * runtime. * - * All properties are part of a property set (SDL_PropertiesID). A property - * set can be created with the SDL_CreateProperties function and destroyed + * All properties are part of a property group (SDL_PropertiesID). A property + * group can be created with the SDL_CreateProperties function and destroyed * with the SDL_DestroyProperties function. * - * Properties can be added to and retrieved from a property set through the + * Properties can be added to and retrieved from a property group through the * following functions: * * - SDL_SetPointerProperty and SDL_GetPointerProperty operate on `void*` @@ -42,7 +42,7 @@ * - SDL_SetBooleanProperty and SDL_GetBooleanProperty operate on boolean * types. * - * Properties can be removed from a set by using SDL_ClearProperty. + * Properties can be removed from a group by using SDL_ClearProperty. */ @@ -91,11 +91,11 @@ typedef enum SDL_PropertyType extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void); /** - * Create a set of properties. + * Create a group of properties. * * All properties are automatically destroyed when SDL_Quit() is called. * - * \returns an ID for a new set of properties, or 0 on failure; call + * \returns an ID for a new group of properties, or 0 on failure; call * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. @@ -107,9 +107,9 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGlobalProperties(void); extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void); /** - * Copy a set of properties. + * Copy a group of properties. * - * Copy all the properties from one set of properties to another, with the + * Copy all the properties from one group of properties to another, with the * exception of properties requiring cleanup (set using * SDL_SetPointerPropertyWithCleanup()), which will not be copied. Any * property that already exists on `dst` will be overwritten. @@ -126,7 +126,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_CreateProperties(void); extern SDL_DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst); /** - * Lock a set of properties. + * Lock a group of properties. * * Obtain a multi-threaded lock for these properties. Other threads will wait * while trying to lock these properties until they are unlocked. Properties @@ -150,7 +150,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_CopyProperties(SDL_PropertiesID src, SDL_Pro extern SDL_DECLSPEC int SDLCALL SDL_LockProperties(SDL_PropertiesID props); /** - * Unlock a set of properties. + * Unlock a group of properties. * * \param props the properties to unlock. * @@ -168,7 +168,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * This should release any resources associated with `value` that are no * longer needed. * - * This callback is set per-property. Different properties in the same set can + * This callback is set per-property. Different properties in the same group can * have different cleanup callbacks. * * This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if @@ -187,7 +187,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value); /** - * Set a property on a set of properties with a cleanup function that is + * Set a property on a group of properties with a cleanup function that is * called when the property is deleted. * * The cleanup function is also called if setting the property fails for any @@ -218,7 +218,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); /** - * Set a property on a set of properties. + * Set a property on a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -241,7 +241,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Properties extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); /** - * Set a string property on a set of properties. + * Set a string property on a group of properties. * * This function makes a copy of the string; the caller does not have to * preserve the data after this call completes. @@ -261,7 +261,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, c extern SDL_DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value); /** - * Set an integer property on a set of properties. + * Set an integer property on a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -278,7 +278,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, co extern SDL_DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value); /** - * Set a floating point property on a set of properties. + * Set a floating point property on a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -295,7 +295,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, co extern SDL_DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value); /** - * Set a boolean property on a set of properties. + * Set a boolean property on a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -312,7 +312,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, con extern SDL_DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value); /** - * Return whether a property exists in a set of properties. + * Return whether a property exists in a group of properties. * * \param props the properties to query. * \param name the name of the property to query. @@ -327,7 +327,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, c extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name); /** - * Get the type of a property on a set of properties. + * Get the type of a property on a group of properties. * * \param props the properties to query. * \param name the name of the property to query. @@ -343,7 +343,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, con extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID props, const char *name); /** - * Get a property on a set of properties. + * Get a property on a group of properties. * * By convention, the names of properties that SDL exposes on objects will * start with "SDL.", and properties that SDL uses internally will start with @@ -376,7 +376,7 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); /** - * Get a string property on a set of properties. + * Get a string property on a group of properties. * * The returned string follows the SDL_GetStringRule. * @@ -397,7 +397,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, extern SDL_DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value); /** - * Get a number property on a set of properties. + * Get a number property on a group of properties. * * You can use SDL_GetPropertyType() to query whether the property exists and * is a number property. @@ -419,7 +419,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID p extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 default_value); /** - * Get a floating point property on a set of properties. + * Get a floating point property on a group of properties. * * You can use SDL_GetPropertyType() to query whether the property exists and * is a floating point property. @@ -441,7 +441,7 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float default_value); /** - * Get a boolean property on a set of properties. + * Get a boolean property on a group of properties. * * You can use SDL_GetPropertyType() to query whether the property exists and * is a boolean property. @@ -463,7 +463,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, c extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value); /** - * Clear a property on a set of properties. + * Clear a property on a group of properties. * * \param props the properties to modify. * \param name the name of the property to clear. @@ -477,7 +477,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID pro extern SDL_DECLSPEC int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const char *name); /** - * A callback used to enumerate all properties set in an SDL_PropertiesID. + * A callback used to enumerate all the properties in a group of properties. * * This callback is called from SDL_EnumerateProperties(), and is called once * per property in the set. @@ -496,9 +496,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearProperty(SDL_PropertiesID props, const typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_PropertiesID props, const char *name); /** - * Enumerate the properties contained in a property set. + * Enumerate the properties contained in a group of properties. * - * The callback function is called for each property on the set of properties. + * The callback function is called for each property in the group of properties. * The properties are locked during enumeration. * * \param props the properties to query. @@ -514,7 +514,7 @@ typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_Prop extern SDL_DECLSPEC int SDLCALL SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata); /** - * Destroy a set of properties. + * Destroy a group of properties. * * All properties are deleted and their cleanup functions will be called, if * any. From cf441332c4f2dbe48f810b230ee8b70fc121b140 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 18:21:05 +0000 Subject: [PATCH 273/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_properties.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index f0d6a12e419bb..1474b2091a61a 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -168,8 +168,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); * This should release any resources associated with `value` that are no * longer needed. * - * This callback is set per-property. Different properties in the same group can - * have different cleanup callbacks. + * This callback is set per-property. Different properties in the same group + * can have different cleanup callbacks. * * This callback will be called _during_ SDL_SetPointerPropertyWithCleanup if * the function fails for any reason. @@ -498,8 +498,8 @@ typedef void (SDLCALL *SDL_EnumeratePropertiesCallback)(void *userdata, SDL_Prop /** * Enumerate the properties contained in a group of properties. * - * The callback function is called for each property in the group of properties. - * The properties are locked during enumeration. + * The callback function is called for each property in the group of + * properties. The properties are locked during enumeration. * * \param props the properties to query. * \param callback the function to call for each property. From 4c88ddf86d7e09e155ce55468a0cfd00a015e37e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 11:24:40 -0700 Subject: [PATCH 274/431] More property documentation clarification --- include/SDL3/SDL_properties.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 1474b2091a61a..0cff918247a79 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -187,7 +187,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value); /** - * Set a property on a group of properties with a cleanup function that is + * Set a pointer property in a group of properties with a cleanup function that is * called when the property is deleted. * * The cleanup function is also called if setting the property fails for any @@ -218,7 +218,7 @@ typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value) extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata); /** - * Set a property on a group of properties. + * Set a pointer property in a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -241,7 +241,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPointerPropertyWithCleanup(SDL_Properties extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value); /** - * Set a string property on a group of properties. + * Set a string property in a group of properties. * * This function makes a copy of the string; the caller does not have to * preserve the data after this call completes. @@ -261,7 +261,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPointerProperty(SDL_PropertiesID props, c extern SDL_DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value); /** - * Set an integer property on a group of properties. + * Set an integer property in a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -278,7 +278,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetStringProperty(SDL_PropertiesID props, co extern SDL_DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value); /** - * Set a floating point property on a group of properties. + * Set a floating point property in a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -295,7 +295,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetNumberProperty(SDL_PropertiesID props, co extern SDL_DECLSPEC int SDLCALL SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value); /** - * Set a boolean property on a group of properties. + * Set a boolean property in a group of properties. * * \param props the properties to modify. * \param name the name of the property to modify. @@ -327,7 +327,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetBooleanProperty(SDL_PropertiesID props, c extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, const char *name); /** - * Get the type of a property on a group of properties. + * Get the type of a property in a group of properties. * * \param props the properties to query. * \param name the name of the property to query. @@ -343,7 +343,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasProperty(SDL_PropertiesID props, con extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesID props, const char *name); /** - * Get a property on a group of properties. + * Get a pointer property from a group of properties. * * By convention, the names of properties that SDL exposes on objects will * start with "SDL.", and properties that SDL uses internally will start with @@ -376,7 +376,7 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); /** - * Get a string property on a group of properties. + * Get a string property from a group of properties. * * The returned string follows the SDL_GetStringRule. * @@ -397,7 +397,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, extern SDL_DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value); /** - * Get a number property on a group of properties. + * Get a number property from a group of properties. * * You can use SDL_GetPropertyType() to query whether the property exists and * is a number property. @@ -419,7 +419,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID p extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 default_value); /** - * Get a floating point property on a group of properties. + * Get a floating point property from a group of properties. * * You can use SDL_GetPropertyType() to query whether the property exists and * is a floating point property. @@ -441,7 +441,7 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_GetNumberProperty(SDL_PropertiesID props, extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float default_value); /** - * Get a boolean property on a group of properties. + * Get a boolean property from a group of properties. * * You can use SDL_GetPropertyType() to query whether the property exists and * is a boolean property. @@ -463,7 +463,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, c extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value); /** - * Clear a property on a group of properties. + * Clear a property from a group of properties. * * \param props the properties to modify. * \param name the name of the property to clear. From d949673bc94d01705c3bacb0cf99181dbf1e4e69 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 18:25:57 +0000 Subject: [PATCH 275/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_properties.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 0cff918247a79..e68316162d556 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -187,8 +187,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockProperties(SDL_PropertiesID props); typedef void (SDLCALL *SDL_CleanupPropertyCallback)(void *userdata, void *value); /** - * Set a pointer property in a group of properties with a cleanup function that is - * called when the property is deleted. + * Set a pointer property in a group of properties with a cleanup function + * that is called when the property is deleted. * * The cleanup function is also called if setting the property fails for any * reason. From 8779c95905f935725411b24bbc29f739a0a17920 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 10 Jul 2024 23:47:02 -0400 Subject: [PATCH 276/431] android: Added SDL_AndroidGetCachePath(). Fixes #8408. --- docs/README-android.md | 1 + include/SDL3/SDL_system.h | 36 +++++++++++++++++++++-- src/core/SDL_core_unsupported.c | 8 ++++++ src/core/android/SDL_android.c | 47 +++++++++++++++++++++++++++++++ src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + 7 files changed, 92 insertions(+), 3 deletions(-) diff --git a/docs/README-android.md b/docs/README-android.md index cb46c604f2b05..9eb8ec8de0808 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -172,6 +172,7 @@ useful paths for saving and loading data: * SDL_AndroidGetInternalStoragePath() * SDL_AndroidGetExternalStorageState() * SDL_AndroidGetExternalStoragePath() +* SDL_AndroidGetCachePath() See SDL_system.h for more details on these functions. diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index c7c0ad4210f82..a4c7e325a2dd3 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -395,7 +395,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void); #define SDL_ANDROID_EXTERNAL_STORAGE_WRITE 0x02 /** - * Get the path used for internal storage for this application. + * Get the path used for internal storage for this Android application. * * This path is unique to your application and cannot be written to by other * applications. @@ -403,6 +403,10 @@ extern SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void); * Your internal storage path is typically: * `/data/data/your.app.package/files`. * + * This is a C wrapper over `android.content.Context.getFilesDir()`: + * + * https://developer.android.com/reference/android/content/Context#getFilesDir() + * * The returned string follows the SDL_GetStringRule. * * \returns the path used for internal storage or NULL on failure; call @@ -415,7 +419,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void); extern SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void); /** - * Get the current state of external storage. + * Get the current state of external storage for this Android application. * * The current state of external storage, a bitmask of these values: * `SDL_ANDROID_EXTERNAL_STORAGE_READ`, `SDL_ANDROID_EXTERNAL_STORAGE_WRITE`. @@ -434,7 +438,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void); extern SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state); /** - * Get the path used for external storage for this application. + * Get the path used for external storage for this Android application. * * This path is unique to your application, but is public and can be written * to by other applications. @@ -442,6 +446,10 @@ extern SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state * Your external storage path is typically: * `/storage/sdcard0/Android/data/your.app.package/files`. * + * This is a C wrapper over `android.content.Context.getExternalFilesDir()`: + * + * https://developer.android.com/reference/android/content/Context#getExternalFilesDir() + * * The returned string follows the SDL_GetStringRule. * * \returns the path used for external storage for this application on success @@ -453,6 +461,28 @@ extern SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state */ extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); +/** + * Get the path used for caching data for this Android application. + * + * This path is unique to your application, but is public and can be written + * to by other applications. + * + * Your cache path is typically: + * `/data/data/your.app.package/cache/`. + * + * This is a C wrapper over `android.content.Context.getCacheDir()`: + * + * https://developer.android.com/reference/android/content/Context#getCacheDir() + * + * The returned string follows the SDL_GetStringRule. + * + * \returns the path used for caches for this application on success + * or NULL on failure; call SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetCachePath(void); + typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index eb1370795d6a3..ec909fd3797f2 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -127,6 +127,14 @@ void *SDL_AndroidGetActivity() return NULL; } +SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetCachePath(void); +const char* SDL_AndroidGetCachePath() +{ + SDL_Unsupported(); + return NULL; +} + + SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetExternalStoragePath(void); const char* SDL_AndroidGetExternalStoragePath() { diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index a426506010612..d80c963b50752 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -2598,6 +2598,53 @@ const char *SDL_AndroidGetExternalStoragePath(void) return s_AndroidExternalFilesPath; } +// this caches a string until the process ends, so there's no need to use SDL_FreeLater. +const char *SDL_AndroidGetCachePath(void) +{ + // !!! FIXME: lots of duplication with SDL_AndroidGetExternalStoragePath and SDL_AndroidGetInternalStoragePath; consolidate these functions! + static char *s_AndroidCachePath = NULL; + + if (!s_AndroidCachePath) { + struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); + jmethodID mid; + jobject context; + jobject fileObject; + jstring pathString; + const char *path; + + JNIEnv *env = Android_JNI_GetEnv(); + if (!LocalReferenceHolder_Init(&refs, env)) { + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + /* context = SDLActivity.getContext(); */ + context = (*env)->CallStaticObjectMethod(env, mActivityClass, midGetContext); + + /* fileObj = context.getExternalFilesDir(); */ + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, context), + "getCacheDir", "(Ljava/lang/String;)Ljava/io/File;"); + fileObject = (*env)->CallObjectMethod(env, context, mid, NULL); + if (!fileObject) { + SDL_SetError("Couldn't get cache directory"); + LocalReferenceHolder_Cleanup(&refs); + return NULL; + } + + /* path = fileObject.getAbsolutePath(); */ + mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject), + "getAbsolutePath", "()Ljava/lang/String;"); + pathString = (jstring)(*env)->CallObjectMethod(env, fileObject, mid); + + path = (*env)->GetStringUTFChars(env, pathString, NULL); + s_AndroidCachePath = SDL_strdup(path); + (*env)->ReleaseStringUTFChars(env, pathString, path); + + LocalReferenceHolder_Cleanup(&refs); + } + return s_AndroidCachePath; +} + int SDL_AndroidShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset) { return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 656b4b1fa2682..f0742330d2b03 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -14,6 +14,7 @@ SDL3_0.0.0 { SDL_AllocateEventMemory; SDL_AndroidBackButton; SDL_AndroidGetActivity; + SDL_AndroidGetCachePath; SDL_AndroidGetExternalStoragePath; SDL_AndroidGetExternalStorageState; SDL_AndroidGetInternalStoragePath; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 2cdd9d2485cac..7d15e9819d955 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -39,6 +39,7 @@ #define SDL_AllocateEventMemory SDL_AllocateEventMemory_REAL #define SDL_AndroidBackButton SDL_AndroidBackButton_REAL #define SDL_AndroidGetActivity SDL_AndroidGetActivity_REAL +#define SDL_AndroidGetCachePath SDL_AndroidGetCachePath_REAL #define SDL_AndroidGetExternalStoragePath SDL_AndroidGetExternalStoragePath_REAL #define SDL_AndroidGetExternalStorageState SDL_AndroidGetExternalStorageState_REAL #define SDL_AndroidGetInternalStoragePath SDL_AndroidGetInternalStoragePath_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 66894a98812a4..27a35a97fe76a 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -59,6 +59,7 @@ SDL_DYNAPI_PROC(int,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Si SDL_DYNAPI_PROC(void*,SDL_AllocateEventMemory,(size_t a),(a),return) SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),) SDL_DYNAPI_PROC(void*,SDL_AndroidGetActivity,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_AndroidGetCachePath,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_AndroidGetExternalStoragePath,(void),(),return) SDL_DYNAPI_PROC(int,SDL_AndroidGetExternalStorageState,(Uint32 *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_AndroidGetInternalStoragePath,(void),(),return) From 3f446a12dfbeadde2b391c7bf10fff2e83618ade Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 12 Jul 2024 19:42:55 +0000 Subject: [PATCH 277/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_system.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index a4c7e325a2dd3..01906d954f161 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -467,8 +467,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void) * This path is unique to your application, but is public and can be written * to by other applications. * - * Your cache path is typically: - * `/data/data/your.app.package/cache/`. + * Your cache path is typically: `/data/data/your.app.package/cache/`. * * This is a C wrapper over `android.content.Context.getCacheDir()`: * @@ -476,8 +475,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void) * * The returned string follows the SDL_GetStringRule. * - * \returns the path used for caches for this application on success - * or NULL on failure; call SDL_GetError() for more information. + * \returns the path used for caches for this application on success or NULL + * on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ From 1162a1cb8e7371dcf2828b04057be0f22f273bde Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 15:39:46 -0700 Subject: [PATCH 278/431] Added SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED and SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED --- include/SDL3/SDL_events.h | 3 +++ src/core/android/SDL_android.c | 2 +- src/events/SDL_displayevents.c | 3 ++- src/events/SDL_displayevents_c.h | 2 +- src/events/SDL_events.c | 6 +++-- src/test/SDL_test_common.c | 10 ++++++- src/video/SDL_video.c | 40 +++++++++++++++++++++++++--- src/video/uikit/SDL_uikitmodes.m | 2 +- src/video/wayland/SDL_waylandvideo.c | 2 +- src/video/windows/SDL_windowsmodes.c | 6 ++--- 10 files changed, 61 insertions(+), 15 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 678ce88d19cb1..bd7cea779b046 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -115,6 +115,8 @@ typedef enum SDL_EventType SDL_EVENT_DISPLAY_ADDED, /**< Display has been added to the system */ SDL_EVENT_DISPLAY_REMOVED, /**< Display has been removed from the system */ SDL_EVENT_DISPLAY_MOVED, /**< Display has changed position */ + SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED, /**< Display has changed desktop mode */ + SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED, /**< Display has changed current mode */ SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, /**< Display has changed content scale */ SDL_EVENT_DISPLAY_FIRST = SDL_EVENT_DISPLAY_ORIENTATION, SDL_EVENT_DISPLAY_LAST = SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, @@ -281,6 +283,7 @@ typedef struct SDL_DisplayEvent Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ SDL_DisplayID displayID;/**< The associated display */ Sint32 data1; /**< event dependent data */ + Sint32 data2; /**< event dependent data */ } SDL_DisplayEvent; /** diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index d80c963b50752..4cb6cbd18aa5a 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -991,7 +991,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeRotationChanged)( if (Android_Window) { SDL_VideoDisplay *display = SDL_GetVideoDisplay(SDL_GetPrimaryDisplay()); - SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ORIENTATION, displayCurrentOrientation); + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ORIENTATION, displayCurrentOrientation, 0); } SDL_UnlockMutex(Android_ActivityMutex); diff --git a/src/events/SDL_displayevents.c b/src/events/SDL_displayevents.c index 4b6fb98f20f57..3740ef11481be 100644 --- a/src/events/SDL_displayevents.c +++ b/src/events/SDL_displayevents.c @@ -24,7 +24,7 @@ #include "SDL_events_c.h" -int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, int data1) +int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, int data1, int data2) { int posted; @@ -50,6 +50,7 @@ int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, event.common.timestamp = 0; event.display.displayID = display->id; event.display.data1 = data1; + event.display.data2 = data2; posted = (SDL_PushEvent(&event) > 0); } diff --git a/src/events/SDL_displayevents_c.h b/src/events/SDL_displayevents_c.h index c93d9ffa15e1e..6ccba10eae7f0 100644 --- a/src/events/SDL_displayevents_c.h +++ b/src/events/SDL_displayevents_c.h @@ -23,6 +23,6 @@ #ifndef SDL_displayevents_c_h_ #define SDL_displayevents_c_h_ -extern int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, int data1); +extern int SDL_SendDisplayEvent(SDL_VideoDisplay *display, SDL_EventType displayevent, int data1, int data2); #endif /* SDL_displayevents_c_h_ */ diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 069c8248e2c20..6e617ed8eae04 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -285,13 +285,15 @@ static void SDL_LogEvent(const SDL_Event *event) #define SDL_DISPLAYEVENT_CASE(x) \ case x: \ SDL_strlcpy(name, #x, sizeof(name)); \ - (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u display=%u event=%s data1=%d)", \ - (uint)event->display.timestamp, (uint)event->display.displayID, name, (int)event->display.data1); \ + (void)SDL_snprintf(details, sizeof(details), " (timestamp=%u display=%u event=%s data1=%d, data2=%d)", \ + (uint)event->display.timestamp, (uint)event->display.displayID, name, (int)event->display.data1, (int)event->display.data2); \ break SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_ORIENTATION); SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_ADDED); SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_REMOVED); SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_MOVED); + SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED); + SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED); SDL_DISPLAYEVENT_CASE(SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED); #undef SDL_DISPLAYEVENT_CASE diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 159cb49a031c3..7fc06d86fe514 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1563,7 +1563,7 @@ static void SDLTest_PrintEvent(const SDL_Event *event) { switch (event->type) { case SDL_EVENT_SYSTEM_THEME_CHANGED: - SDL_Log("SDL EVENT: System theme changed to %s\n", SystemThemeName()); + SDL_Log("SDL EVENT: System theme changed to %s", SystemThemeName()); break; case SDL_EVENT_DISPLAY_ADDED: SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " attached", @@ -1576,6 +1576,14 @@ static void SDLTest_PrintEvent(const SDL_Event *event) event->display.displayID, (int)(scale * 100.0f)); } break; + case SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED: + SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " desktop mode changed to %" SDL_PRIs32 "x%" SDL_PRIs32, + event->display.displayID, event->display.data1, event->display.data2); + break; + case SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED: + SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " current mode changed to %" SDL_PRIs32 "x%" SDL_PRIs32, + event->display.displayID, event->display.data1, event->display.data2); + break; case SDL_EVENT_DISPLAY_MOVED: SDL_Log("SDL EVENT: Display %" SDL_PRIu32 " changed position", event->display.displayID); diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 6618020a3b86f..aa43387a69984 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -791,7 +791,7 @@ SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send SDL_UpdateDesktopBounds(); if (send_event) { - SDL_SendDisplayEvent(new_display, SDL_EVENT_DISPLAY_ADDED, 0); + SDL_SendDisplayEvent(new_display, SDL_EVENT_DISPLAY_ADDED, 0, 0); } return id; @@ -823,7 +823,7 @@ void SDL_DelVideoDisplay(SDL_DisplayID displayID, SDL_bool send_event) display = _this->displays[display_index]; if (send_event) { - SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_REMOVED, 0); + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_REMOVED, 0, 0); } SDL_DestroyProperties(display->props); @@ -1044,7 +1044,7 @@ void SDL_SetDisplayContentScale(SDL_VideoDisplay *display, float scale) SDL_Window *window; display->content_scale = scale; - SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, 0); + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_CONTENT_SCALE_CHANGED, 0, 0); /* Check the windows on this display */ for (window = _this->windows; window; window = window->next) { @@ -1310,14 +1310,34 @@ const SDL_DisplayMode *SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID display return closest; } +static SDL_bool DisplayModeChanged(const SDL_DisplayMode *old, const SDL_DisplayMode *new) +{ + return ((old->displayID && old->displayID != new->displayID) || + (old->format && old->format != new->format) || + (old->w && old->h && (old->w != new->w ||old->h != new->h)) || + (old->pixel_density != 0.0f && old->pixel_density != new->pixel_density) || + (old->refresh_rate != 0.0f && old->refresh_rate != new->refresh_rate)); +} + void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { + SDL_DisplayMode last_mode; + + SDL_copyp(&last_mode, &display->desktop_mode); + if (display->desktop_mode.driverdata) { SDL_free(display->desktop_mode.driverdata); } - SDL_memcpy(&display->desktop_mode, mode, sizeof(*mode)); + SDL_copyp(&display->desktop_mode, mode); display->desktop_mode.displayID = display->id; SDL_FinalizeDisplayMode(&display->desktop_mode); + + if (DisplayModeChanged(&last_mode, &display->desktop_mode)) { + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_DESKTOP_MODE_CHANGED, mode->w, mode->h); + if (display->current_mode == &display->desktop_mode) { + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED, mode->w, mode->h); + } + } } const SDL_DisplayMode *SDL_GetDesktopDisplayMode(SDL_DisplayID displayID) @@ -1331,7 +1351,19 @@ const SDL_DisplayMode *SDL_GetDesktopDisplayMode(SDL_DisplayID displayID) void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { + SDL_DisplayMode last_mode; + + if (display->current_mode) { + SDL_copyp(&last_mode, display->current_mode); + } else { + SDL_zero(last_mode); + } + display->current_mode = mode; + + if (DisplayModeChanged(&last_mode, mode)) { + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_CURRENT_MODE_CHANGED, mode->w, mode->h); + } } const SDL_DisplayMode *SDL_GetCurrentDisplayMode(SDL_DisplayID displayID) diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 98b84ae96619e..70e99a3590fb1 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -534,7 +534,7 @@ void SDL_OnApplicationDidChangeStatusBarOrientation(void) default: break; } - SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ORIENTATION, orientation); + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ORIENTATION, orientation, 0); } } #endif /* !SDL_PLATFORM_TVOS */ diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 0745c09161dc9..e7515880c602d 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -905,7 +905,7 @@ static void display_handle_done(void *data, SDL_zero(driverdata->placeholder); } } else { - SDL_SendDisplayEvent(dpy, SDL_EVENT_DISPLAY_ORIENTATION, driverdata->orientation); + SDL_SendDisplayEvent(dpy, SDL_EVENT_DISPLAY_ORIENTATION, driverdata->orientation, 0); } } diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index adc8ed860e1e8..19bea73f6f54c 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -538,9 +538,9 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI SDL_copyp(&driverdata->bounds, &bounds); } if (moved || changed_bounds) { - SDL_SendDisplayEvent(existing_display, SDL_EVENT_DISPLAY_MOVED, 0); + SDL_SendDisplayEvent(existing_display, SDL_EVENT_DISPLAY_MOVED, 0, 0); } - SDL_SendDisplayEvent(existing_display, SDL_EVENT_DISPLAY_ORIENTATION, current_orientation); + SDL_SendDisplayEvent(existing_display, SDL_EVENT_DISPLAY_ORIENTATION, current_orientation, 0); SDL_SetDisplayContentScale(existing_display, content_scale); #ifdef HAVE_DXGI1_6_H SDL_HDROutputProperties HDR; @@ -832,7 +832,7 @@ void WIN_RefreshDisplays(SDL_VideoDevice *_this) SDL_VideoDisplay *display = _this->displays[i]; SDL_DisplayData *driverdata = display->driverdata; if (driverdata->state == DisplayAdded) { - SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ADDED, 0); + SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ADDED, 0, 0); } } } From 730d5cf2f889b553852bd02b2d56dedf8690872a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 17:55:04 -0700 Subject: [PATCH 279/431] Added fractional representation of refresh rate to SDL_DisplayMode --- docs/README-migration.md | 2 +- include/SDL3/SDL_video.h | 16 ++++++++------- src/render/SDL_render.c | 11 +++++------ src/video/SDL_video.c | 10 ++++++++++ src/video/cocoa/SDL_cocoamodes.m | 6 +++--- src/video/haiku/SDL_bmodes.cc | 9 +++++---- src/video/kmsdrm/SDL_kmsdrmvideo.c | 29 ++++++++-------------------- src/video/n3ds/SDL_n3dsvideo.c | 2 +- src/video/raspberry/SDL_rpivideo.c | 16 ++++++++++----- src/video/uikit/SDL_uikitmodes.m | 2 +- src/video/wayland/SDL_waylandvideo.c | 9 ++++++--- src/video/windows/SDL_windowsmodes.c | 12 ++++++++---- src/video/winrt/SDL_winrtvideo.cpp | 6 ++---- src/video/x11/SDL_x11modes.c | 19 ++++++++++-------- 14 files changed, 81 insertions(+), 68 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 08b62fb1fa705..2807be1be8d57 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1962,7 +1962,7 @@ The SDL_WINDOW_SKIP_TASKBAR flag has been replaced by the SDL_WINDOW_UTILITY fla SDL_DisplayMode now includes the pixel density which can be greater than 1.0 for display modes that have a higher pixel size than the mode size. You should use SDL_GetWindowSizeInPixels() to get the actual pixel size of the window back buffer. -The refresh rate in SDL_DisplayMode is now a float. +The refresh rate in SDL_DisplayMode is now a float, as well as being represented as a precise fraction with numerator and denominator. Rather than iterating over display modes using an index, there is a new function SDL_GetFullscreenDisplayModes() to get the list of available fullscreen modes on a display. ```c diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 07c608e89fa39..9a22dbd7d96ad 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -87,13 +87,15 @@ typedef enum SDL_SystemTheme */ typedef struct SDL_DisplayMode { - SDL_DisplayID displayID; /**< the display this mode is associated with */ - SDL_PixelFormat format; /**< pixel format */ - int w; /**< width */ - int h; /**< height */ - float pixel_density; /**< scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) */ - float refresh_rate; /**< refresh rate (or zero for unspecified) */ - void *driverdata; /**< driver-specific data, initialize to 0 */ + SDL_DisplayID displayID; /**< the display this mode is associated with */ + SDL_PixelFormat format; /**< pixel format */ + int w; /**< width */ + int h; /**< height */ + float pixel_density; /**< scale converting size to pixels (e.g. a 1920x1080 mode with 2.0 scale would have 3840x2160 pixels) */ + float refresh_rate; /**< refresh rate (or 0.0f for unspecified) */ + int refresh_rate_numerator; /**< precise refresh rate numerator (or 0 for unspecified) */ + int refresh_rate_denominator; /**< precise refresh rate denominator */ + void *driverdata; /**< driver-specific data, initialize to 0 */ } SDL_DisplayMode; /** diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 8d050bdb1b5df..53a59bfb64e9c 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -918,21 +918,20 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind { SDL_DisplayID displayID = SDL_GetDisplayForWindow(window); const SDL_DisplayMode *mode; - float refresh_rate; int num, den; if (displayID == 0) { displayID = SDL_GetPrimaryDisplay(); } mode = SDL_GetDesktopDisplayMode(displayID); - if (mode && mode->refresh_rate > 0.0f) { - refresh_rate = mode->refresh_rate; + if (mode && mode->refresh_rate_numerator > 0) { + num = mode->refresh_rate_numerator; + den = mode->refresh_rate_denominator; } else { /* Pick a good default refresh rate */ - refresh_rate = 60.0f; + num = 60; + den = 1; } - num = 100; - den = (int)(100 * refresh_rate); renderer->simulate_vsync_interval_ns = (SDL_NS_PER_SECOND * num) / den; } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index aa43387a69984..0d676cc339931 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -725,6 +725,16 @@ static void SDL_FinalizeDisplayMode(SDL_DisplayMode *mode) if (mode->pixel_density <= 0.0f) { mode->pixel_density = 1.0f; } + + if (mode->refresh_rate_numerator > 0) { + if (mode->refresh_rate_denominator <= 0) { + mode->refresh_rate_denominator = 1; + } + mode->refresh_rate = ((100 * (Sint64)mode->refresh_rate_numerator) / mode->refresh_rate_denominator) / 100.0f; + } else { + SDL_CalculateFraction(mode->refresh_rate, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); + mode->refresh_rate = (int)(mode->refresh_rate * 100) / 100.0f; + } } SDL_DisplayID SDL_AddBasicVideoDisplay(const SDL_DisplayMode *desktop_mode) diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index 638e82d6b4f55..b3001aa9793b1 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -99,17 +99,17 @@ static int CG_SetError(const char *prefix, CGDisplayErr result) static float GetDisplayModeRefreshRate(CGDisplayModeRef vidmode, CVDisplayLinkRef link) { - double refreshRate = CGDisplayModeGetRefreshRate(vidmode); + float refreshRate = (float)CGDisplayModeGetRefreshRate(vidmode); /* CGDisplayModeGetRefreshRate can return 0 (eg for built-in displays). */ if (refreshRate == 0 && link != NULL) { CVTime time = CVDisplayLinkGetNominalOutputVideoRefreshPeriod(link); if ((time.flags & kCVTimeIsIndefinite) == 0 && time.timeValue != 0) { - refreshRate = (double)time.timeScale / time.timeValue; + refreshRate = (float)time.timeScale / time.timeValue; } } - return (int)(refreshRate * 100) / 100.0f; + return refreshRate; } static SDL_bool HasValidDisplayModeFlags(CGDisplayModeRef vidmode) diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc index c44729e4d0083..1201d714bb64c 100644 --- a/src/video/haiku/SDL_bmodes.cc +++ b/src/video/haiku/SDL_bmodes.cc @@ -65,9 +65,10 @@ static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) { } /* Copied from haiku/trunk/src/preferences/screen/ScreenMode.cpp */ -static float get_refresh_rate(display_mode &mode) { - return float(mode.timing.pixel_clock * 1000) - / float(mode.timing.h_total * mode.timing.v_total); +static void get_refresh_rate(display_mode &mode, int *numerator, int *denominator) +{ + *numerator = (mode.timing.pixel_clock * 1000); + *denominator = (mode.timing.h_total * mode.timing.v_total); } @@ -169,7 +170,7 @@ static void _BDisplayModeToSdlDisplayMode(display_mode *bmode, SDL_DisplayMode * SDL_zerop(mode); mode->w = bmode->virtual_width; mode->h = bmode->virtual_height; - mode->refresh_rate = get_refresh_rate(*bmode); + get_refresh_rate(*bmode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); #if WRAP_BMODE SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1, diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 5d231595cfa71..a56c39da39f28 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -170,26 +170,22 @@ static int get_driindex(void) return available; } -static float CalculateRefreshRate(drmModeModeInfo *mode) +static void CalculateRefreshRate(drmModeModeInfo *mode, int *numerator, int *denominator) { - unsigned int num, den; - - num = mode->clock * 1000; - den = mode->htotal * mode->vtotal; + *numerator = mode->clock * 1000; + *denominator = mode->htotal * mode->vtotal; if (mode->flags & DRM_MODE_FLAG_INTERLACE) { - num *= 2; + *numerator *= 2; } if (mode->flags & DRM_MODE_FLAG_DBLSCAN) { - den *= 2; + *denominator *= 2; } if (mode->vscan > 1) { - den *= mode->vscan; + *denominator *= mode->vscan; } - - return ((100 * (Sint64)num) / den) / 100.0f; } static int KMSDRM_Available(void) @@ -964,7 +960,7 @@ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connecto display.driverdata = dispdata; display.desktop_mode.w = dispdata->mode.hdisplay; display.desktop_mode.h = dispdata->mode.vdisplay; - display.desktop_mode.refresh_rate = CalculateRefreshRate(&dispdata->mode); + CalculateRefreshRate(&dispdata->mode, &display.desktop_mode.refresh_rate_numerator, &display.desktop_mode.refresh_rate_denominator); display.desktop_mode.format = SDL_PIXELFORMAT_ARGB8888; display.desktop_mode.driverdata = modedata; @@ -1279,15 +1275,6 @@ int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window) */ KMSDRM_GetModeToSet(window, &dispdata->mode); - /* - SDL_zero(current_mode); - current_mode.w = dispdata->mode.hdisplay; - current_mode.h = dispdata->mode.vdisplay; - current_mode.refresh_rate = CalculateRefreshRate(&dispdata->mode); - current_mode.format = SDL_PIXELFORMAT_ARGB8888; - SDL_SetCurrentDisplayMode(display, ¤t_mode); - */ - windata->gs = KMSDRM_gbm_surface_create(viddata->gbm_dev, dispdata->mode.hdisplay, dispdata->mode.vdisplay, surface_fmt, surface_flags); @@ -1433,7 +1420,7 @@ int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) SDL_zero(mode); mode.w = conn->modes[i].hdisplay; mode.h = conn->modes[i].vdisplay; - mode.refresh_rate = CalculateRefreshRate(&conn->modes[i]); + CalculateRefreshRate(&conn->modes[i], &mode.refresh_rate_numerator, &mode.refresh_rate_denominator); mode.format = SDL_PIXELFORMAT_ARGB8888; mode.driverdata = modedata; diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index b9e34eb3889b5..1c1f43204a435 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -194,7 +194,7 @@ static int N3DS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *displa SDL_zero(mode); mode.w = (displaydata->screen == GFX_TOP) ? GSP_SCREEN_HEIGHT_TOP : GSP_SCREEN_HEIGHT_BOTTOM; mode.h = GSP_SCREEN_WIDTH; - mode.refresh_rate = 60; + mode.refresh_rate = 60.0f; mode.format = format_map[i].pixfmt; mode.driverdata = modedata; modedata->fmt = format_map[i].gspfmt; diff --git a/src/video/raspberry/SDL_rpivideo.c b/src/video/raspberry/SDL_rpivideo.c index 222a50fb03753..d9fda949bd9d7 100644 --- a/src/video/raspberry/SDL_rpivideo.c +++ b/src/video/raspberry/SDL_rpivideo.c @@ -51,7 +51,7 @@ static void RPI_Destroy(SDL_VideoDevice *device) SDL_free(device); } -static float RPI_GetRefreshRate() +static void RPI_GetRefreshRate(int *numerator, int *denominator) { TV_DISPLAY_STATE_T tvstate; if (vc_tv_get_display_state(&tvstate) == 0) { @@ -61,12 +61,18 @@ static float RPI_GetRefreshRate() property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; vc_tv_hdmi_get_property(&property); if (property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC) { - return ((100 * tvstate.display.hdmi.frame_rate * 1000) / 1001) / 100.0f; + *numerator = tvstate.display.hdmi.frame_rate * 1000; + *denominator = 1001; } else { - return (float)tvstate.display.hdmi.frame_rate; + *numerator = tvstate.display.hdmi.frame_rate; + *denominator = 1; } + return; } - return 60.0f; /* Failed to get display state, default to 60 */ + + /* Failed to get display state, default to 60 */ + *numerator = 60; + *denominator = 1; } static SDL_VideoDevice *RPI_Create() @@ -158,7 +164,7 @@ static void AddDispManXDisplay(const int display_id) SDL_zero(mode); mode.w = modeinfo.width; mode.h = modeinfo.height; - mode.refresh_rate = RPI_GetRefreshRate(); + RPI_GetRefreshRate(&mode.refresh_rate_numerator, &mode.refresh_rate_denominator); /* 32 bpp for default */ mode.format = SDL_PIXELFORMAT_ABGR8888; diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 70e99a3590fb1..ba65650b261cf 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -285,7 +285,7 @@ int UIKit_AddDisplay(SDL_bool send_event){ mode.h = (int)size.height; mode.pixel_density = 1; mode.format = SDL_PIXELFORMAT_ABGR8888; - mode.refresh_rate = 60; + mode.refresh_rate = 60.0f; display.natural_orientation = SDL_ORIENTATION_LANDSCAPE; diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index e7515880c602d..62fe87036a497 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -666,7 +666,8 @@ static void AddEmulatedModes(SDL_DisplayData *dispdata, int native_width, int na for (i = 0; i < SDL_arraysize(mode_list); ++i) { SDL_zero(mode); mode.format = dpy->desktop_mode.format; - mode.refresh_rate = dpy->desktop_mode.refresh_rate; + mode.refresh_rate_numerator = dpy->desktop_mode.refresh_rate_numerator; + mode.refresh_rate_denominator = dpy->desktop_mode.refresh_rate_denominator; if (rot_90) { mode.w = mode_list[i].h; @@ -809,7 +810,8 @@ static void display_handle_done(void *data, native_mode.w = driverdata->pixel_width; native_mode.h = driverdata->pixel_height; } - native_mode.refresh_rate = ((100 * driverdata->refresh) / 1000) / 100.0f; /* mHz to Hz */ + native_mode.refresh_rate_numerator = driverdata->refresh; + native_mode.refresh_rate_denominator = 1000; if (driverdata->has_logical_size) { /* If xdg-output is present... */ if (native_mode.w != driverdata->screen_width || native_mode.h != driverdata->screen_height) { @@ -851,7 +853,8 @@ static void display_handle_done(void *data, desktop_mode.pixel_density = 1.0f; } - desktop_mode.refresh_rate = ((100 * driverdata->refresh) / 1000) / 100.0f; /* mHz to Hz */ + desktop_mode.refresh_rate_numerator = driverdata->refresh; + desktop_mode.refresh_rate_denominator = 1000; if (driverdata->display > 0) { dpy = SDL_GetVideoDisplay(driverdata->display); diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 19bea73f6f54c..a221779e9696c 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -161,16 +161,20 @@ static SDL_DisplayOrientation WIN_GetDisplayOrientation(DEVMODE *mode) } } -static float WIN_GetRefreshRate(DEVMODE *mode) +static void WIN_GetRefreshRate(DEVMODE *mode, int *numerator, int *denominator) { /* We're not currently using DXGI to query display modes, so fake NTSC timings */ switch (mode->dmDisplayFrequency) { case 119: case 59: case 29: - return ((100 * (mode->dmDisplayFrequency + 1) * 1000) / 1001) / 100.0f; + *numerator = (mode->dmDisplayFrequency + 1) * 1000; + *denominator = 1001; + break; default: - return (float)mode->dmDisplayFrequency; + *numerator = mode->dmDisplayFrequency; + *denominator = 1; + break; } } @@ -223,7 +227,7 @@ static SDL_bool WIN_GetDisplayMode(SDL_VideoDevice *_this, HMONITOR hMonitor, LP mode->format = SDL_PIXELFORMAT_UNKNOWN; mode->w = data->DeviceMode.dmPelsWidth; mode->h = data->DeviceMode.dmPelsHeight; - mode->refresh_rate = WIN_GetRefreshRate(&data->DeviceMode); + WIN_GetRefreshRate(&data->DeviceMode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); /* Fill in the mode information */ WIN_UpdateDisplayMode(_this, deviceName, index, mode); diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 48805d3c73181..3e06e852dce85 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -253,7 +253,8 @@ static void WINRT_DXGIModeToSDLDisplayMode(const DXGI_MODE_DESC *dxgiMode, SDL_D SDL_zerop(sdlMode); sdlMode->w = dxgiMode->Width; sdlMode->h = dxgiMode->Height; - sdlMode->refresh_rate = (((100 * dxgiMode->RefreshRate.Numerator) / dxgiMode->RefreshRate.Denominator) / 100.0f); + sdlMode->refresh_rate_numerator = dxgiMode->RefreshRate.Numerator; + sdlMode->refresh_rate_denominator = dxgiMode->RefreshRate.Denominator; sdlMode->format = D3D11_DXGIFormatToSDLPixelFormat(dxgiMode->Format); } @@ -314,9 +315,6 @@ static int WINRT_AddDisplaysForOutput(SDL_VideoDevice *_this, IDXGIAdapter1 *dxg hr = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, NULL); if (FAILED(hr)) { - if (hr == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { - // TODO, WinRT: make sure display mode(s) are added when using Terminal Services / Windows Simulator - } WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::GetDisplayModeList [get mode list size] failed", hr); goto done; } diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 850ba2b0acbfc..62b6c48610272 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -414,9 +414,9 @@ static SDL_bool CheckXRandR(Display *display, int *major, int *minor) #define XRANDR_ROTATION_LEFT (1 << 1) #define XRANDR_ROTATION_RIGHT (1 << 3) -static float CalculateXRandRRefreshRate(const XRRModeInfo *info) +static void CalculateXRandRRefreshRate(const XRRModeInfo *info, int *numerator, int *denominator) { - float vTotal = info->vTotal; + unsigned int vTotal = info->vTotal; if (info->modeFlags & RR_DoubleScan) { /* doublescan doubles the number of lines */ @@ -429,10 +429,13 @@ static float CalculateXRandRRefreshRate(const XRRModeInfo *info) vTotal /= 2; } - if (info->hTotal && vTotal != 0.f) { - return ((100 * (Sint64)info->dotClock) / (info->hTotal * vTotal)) / 100.0f; + if (info->hTotal && vTotal) { + *numerator = info->dotClock; + *denominator = (info->hTotal * vTotal); + } else { + *numerator = 0; + *denominator = 0; } - return 0.0f; } static SDL_bool SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRCrtc crtc, @@ -465,11 +468,11 @@ static SDL_bool SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRC mode->w = (info->width * scale_w + 0xffff) >> 16; mode->h = (info->height * scale_h + 0xffff) >> 16; } - mode->refresh_rate = CalculateXRandRRefreshRate(info); + CalculateXRandRRefreshRate(info, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); ((SDL_DisplayModeData *)mode->driverdata)->xrandr_mode = modeID; #ifdef X11MODES_DEBUG - printf("XRandR mode %d: %dx%d@%gHz\n", (int)modeID, - mode->screen_w, mode->screen_h, mode->refresh_rate); + printf("XRandR mode %d: %dx%d@%d/%dHz\n", (int)modeID, + mode->screen_w, mode->screen_h, mode->refresh_rate_numerator, mode->refresh_rate_denominator); #endif return SDL_TRUE; } From 00ab33020742f822964935596b4d9007973676e1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 12 Jul 2024 19:28:09 -0700 Subject: [PATCH 280/431] Use DXGI to get precise display mode refresh rate values Fixes https://github.com/libsdl-org/SDL/issues/10185 --- src/video/windows/SDL_windowsmodes.c | 87 ++++++++++++++++++++++++++-- src/video/windows/SDL_windowsvideo.c | 78 ++++++++++--------------- src/video/windows/SDL_windowsvideo.h | 11 ++++ 3 files changed, 122 insertions(+), 54 deletions(-) diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index a221779e9696c..7d7921010d9e9 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -111,6 +111,53 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DW } } +static void *WIN_GetDXGIOutput(SDL_VideoDevice *_this, const WCHAR *DeviceName) +{ + void *retval = NULL; + +#ifdef HAVE_DXGI_H + const SDL_VideoData *videodata = (const SDL_VideoData *)_this->driverdata; + int nAdapter, nOutput; + IDXGIAdapter *pDXGIAdapter; + IDXGIOutput *pDXGIOutput; + + if (!videodata->pDXGIFactory) { + return NULL; + } + + nAdapter = 0; + while (!retval && SUCCEEDED(IDXGIFactory_EnumAdapters(videodata->pDXGIFactory, nAdapter, &pDXGIAdapter))) { + nOutput = 0; + while (!retval && SUCCEEDED(IDXGIAdapter_EnumOutputs(pDXGIAdapter, nOutput, &pDXGIOutput))) { + DXGI_OUTPUT_DESC outputDesc; + if (SUCCEEDED(IDXGIOutput_GetDesc(pDXGIOutput, &outputDesc))) { + if (SDL_wcscmp(outputDesc.DeviceName, DeviceName) == 0) { + retval = pDXGIOutput; + } + } + if (pDXGIOutput != retval) { + IDXGIOutput_Release(pDXGIOutput); + } + nOutput++; + } + IDXGIAdapter_Release(pDXGIAdapter); + nAdapter++; + } +#endif + return retval; +} + +static void WIN_ReleaseDXGIOutput(void *dxgi_output) +{ +#ifdef HAVE_DXGI_H + IDXGIOutput *pDXGIOutput = (IDXGIOutput *)dxgi_output; + + if (pDXGIOutput) { + IDXGIOutput_Release(pDXGIOutput); + } +#endif +} + static SDL_DisplayOrientation WIN_GetNaturalOrientation(DEVMODE *mode) { int width = mode->dmPelsWidth; @@ -161,7 +208,7 @@ static SDL_DisplayOrientation WIN_GetDisplayOrientation(DEVMODE *mode) } } -static void WIN_GetRefreshRate(DEVMODE *mode, int *numerator, int *denominator) +static void WIN_GetRefreshRate(void *dxgi_output, DEVMODE *mode, int *numerator, int *denominator) { /* We're not currently using DXGI to query display modes, so fake NTSC timings */ switch (mode->dmDisplayFrequency) { @@ -176,6 +223,26 @@ static void WIN_GetRefreshRate(DEVMODE *mode, int *numerator, int *denominator) *denominator = 1; break; } + +#ifdef HAVE_DXGI_H + if (dxgi_output) { + IDXGIOutput *pDXGIOutput = (IDXGIOutput *)dxgi_output; + DXGI_MODE_DESC modeToMatch; + DXGI_MODE_DESC closestMatch; + + SDL_zero(modeToMatch); + modeToMatch.Width = mode->dmPelsWidth; + modeToMatch.Height = mode->dmPelsHeight; + modeToMatch.RefreshRate.Numerator = *numerator; + modeToMatch.RefreshRate.Denominator = *denominator; + modeToMatch.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + + if (SUCCEEDED(IDXGIOutput_FindClosestMatchingMode(pDXGIOutput, &modeToMatch, &closestMatch, NULL))) { + *numerator = closestMatch.RefreshRate.Numerator; + *denominator = closestMatch.RefreshRate.Denominator; + } + } +#endif // HAVE_DXGI_H } static float WIN_GetContentScale(SDL_VideoDevice *_this, HMONITOR hMonitor) @@ -204,7 +271,7 @@ static float WIN_GetContentScale(SDL_VideoDevice *_this, HMONITOR hMonitor) return dpi / (float)USER_DEFAULT_SCREEN_DPI; } -static SDL_bool WIN_GetDisplayMode(SDL_VideoDevice *_this, HMONITOR hMonitor, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode, SDL_DisplayOrientation *natural_orientation, SDL_DisplayOrientation *current_orientation) +static SDL_bool WIN_GetDisplayMode(SDL_VideoDevice *_this, void *dxgi_output, HMONITOR hMonitor, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode, SDL_DisplayOrientation *natural_orientation, SDL_DisplayOrientation *current_orientation) { SDL_DisplayModeData *data; DEVMODE devmode; @@ -227,7 +294,7 @@ static SDL_bool WIN_GetDisplayMode(SDL_VideoDevice *_this, HMONITOR hMonitor, LP mode->format = SDL_PIXELFORMAT_UNKNOWN; mode->w = data->DeviceMode.dmPelsWidth; mode->h = data->DeviceMode.dmPelsHeight; - WIN_GetRefreshRate(&data->DeviceMode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); + WIN_GetRefreshRate(dxgi_output, &data->DeviceMode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); /* Fill in the mode information */ WIN_UpdateDisplayMode(_this, deviceName, index, mode); @@ -486,6 +553,7 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI int i, index = *display_index; SDL_VideoDisplay display; SDL_DisplayData *displaydata; + void *dxgi_output = NULL; SDL_DisplayMode mode; SDL_DisplayOrientation natural_orientation; SDL_DisplayOrientation current_orientation; @@ -495,7 +563,10 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI SDL_Log("Display: %s\n", WIN_StringToUTF8W(info->szDevice)); #endif - if (!WIN_GetDisplayMode(_this, hMonitor, info->szDevice, ENUM_CURRENT_SETTINGS, &mode, &natural_orientation, ¤t_orientation)) { + dxgi_output = WIN_GetDXGIOutput(_this, info->szDevice); + SDL_bool found = WIN_GetDisplayMode(_this, dxgi_output, hMonitor, info->szDevice, ENUM_CURRENT_SETTINGS, &mode, &natural_orientation, ¤t_orientation); + WIN_ReleaseDXGIOutput(dxgi_output); + if (!found) { return; } @@ -692,11 +763,14 @@ int WIN_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_DisplayData *data = display->driverdata; + void *dxgi_output; DWORD i; SDL_DisplayMode mode; + dxgi_output = WIN_GetDXGIOutput(_this, data->DeviceName); + for (i = 0;; ++i) { - if (!WIN_GetDisplayMode(_this, data->MonitorHandle, data->DeviceName, i, &mode, NULL, NULL)) { + if (!WIN_GetDisplayMode(_this, dxgi_output, data->MonitorHandle, data->DeviceName, i, &mode, NULL, NULL)) { break; } if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) { @@ -712,6 +786,9 @@ int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) SDL_free(mode.driverdata); } } + + WIN_ReleaseDXGIOutput(dxgi_output); + return 0; } diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 757a3f6bd2b4a..1074d9b629930 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -103,6 +103,14 @@ static void WIN_DeleteDevice(SDL_VideoDevice *device) if (data->shcoreDLL) { SDL_UnloadObject(data->shcoreDLL); } +#endif +#ifndef HAVE_DXGI_H + if (data->pDXGIFactory) { + IDXGIFactory_Release(pDXGIFactory); + } + if (data->dxgiDLL) { + SDL_UnloadObject(pDXGIDLL); + } #endif if (device->wakeup_lock) { SDL_DestroyMutex(device->wakeup_lock); @@ -170,6 +178,22 @@ static SDL_VideoDevice *WIN_CreateDevice(void) } #endif /* #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) */ +#ifdef HAVE_DXGI_H + data->dxgiDLL = SDL_LoadObject("DXGI.DLL"); + if (data->dxgiDLL) { + /* *INDENT-OFF* */ /* clang-format off */ + typedef HRESULT (WINAPI *CreateDXGI_t)(REFIID riid, void **ppFactory); + /* *INDENT-ON* */ /* clang-format on */ + CreateDXGI_t CreateDXGI; + + CreateDXGI = (CreateDXGI_t)SDL_LoadFunction(data->dxgiDLL, "CreateDXGIFactory"); + if (CreateDXGI) { + GUID dxgiGUID = { 0x7b7166ec, 0x21c7, 0x44ae, { 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69 } }; + CreateDXGI(&dxgiGUID, (void **)&data->pDXGIFactory); + } + } +#endif + /* Set the function pointers */ device->VideoInit = WIN_VideoInit; device->VideoQuit = WIN_VideoQuit; @@ -605,41 +629,6 @@ int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID) } #endif /* !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) */ -#ifdef HAVE_DXGI_H -#define CINTERFACE -#define COBJMACROS -#include - -static SDL_bool DXGI_LoadDLL(void **pDXGIDLL, IDXGIFactory **pDXGIFactory) -{ - *pDXGIDLL = SDL_LoadObject("DXGI.DLL"); - if (*pDXGIDLL) { - /* *INDENT-OFF* */ /* clang-format off */ - typedef HRESULT (WINAPI *CreateDXGI_t)(REFIID riid, void **ppFactory); - /* *INDENT-ON* */ /* clang-format on */ - CreateDXGI_t CreateDXGI; - - CreateDXGI = (CreateDXGI_t)SDL_LoadFunction(*pDXGIDLL, "CreateDXGIFactory"); - if (CreateDXGI) { - GUID dxgiGUID = { 0x7b7166ec, 0x21c7, 0x44ae, { 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69 } }; - if (!SUCCEEDED(CreateDXGI(&dxgiGUID, (void **)pDXGIFactory))) { - *pDXGIFactory = NULL; - } - } - if (!*pDXGIFactory) { - SDL_UnloadObject(*pDXGIDLL); - *pDXGIDLL = NULL; - return SDL_FALSE; - } - - return SDL_TRUE; - } else { - *pDXGIFactory = NULL; - return SDL_FALSE; - } -} -#endif - SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) { #ifndef HAVE_DXGI_H @@ -652,11 +641,10 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header"); return SDL_FALSE; #else + const SDL_VideoDevice *videodevice = SDL_GetVideoDevice(); + const SDL_VideoData *videodata = videodevice ? videodevice->driverdata : NULL; SDL_DisplayData *pData = SDL_GetDisplayDriverData(displayID); - void *pDXGIDLL; - char *displayName; int nAdapter, nOutput; - IDXGIFactory *pDXGIFactory = NULL; IDXGIAdapter *pDXGIAdapter; IDXGIOutput *pDXGIOutput; @@ -678,24 +666,21 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * return SDL_FALSE; } - if (!DXGI_LoadDLL(&pDXGIDLL, &pDXGIFactory)) { + if (!videodata || !videodata->pDXGIFactory) { SDL_SetError("Unable to create DXGI interface"); return SDL_FALSE; } - displayName = WIN_StringToUTF8W(pData->DeviceName); nAdapter = 0; - while (*adapterIndex == -1 && SUCCEEDED(IDXGIFactory_EnumAdapters(pDXGIFactory, nAdapter, &pDXGIAdapter))) { + while (*adapterIndex == -1 && SUCCEEDED(IDXGIFactory_EnumAdapters(videodata->pDXGIFactory, nAdapter, &pDXGIAdapter))) { nOutput = 0; while (*adapterIndex == -1 && SUCCEEDED(IDXGIAdapter_EnumOutputs(pDXGIAdapter, nOutput, &pDXGIOutput))) { DXGI_OUTPUT_DESC outputDesc; if (SUCCEEDED(IDXGIOutput_GetDesc(pDXGIOutput, &outputDesc))) { - char *outputName = WIN_StringToUTF8W(outputDesc.DeviceName); - if (SDL_strcmp(outputName, displayName) == 0) { + if (SDL_wcscmp(outputDesc.DeviceName, pData->DeviceName) == 0) { *adapterIndex = nAdapter; *outputIndex = nOutput; } - SDL_free(outputName); } IDXGIOutput_Release(pDXGIOutput); nOutput++; @@ -703,11 +688,6 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * IDXGIAdapter_Release(pDXGIAdapter); nAdapter++; } - SDL_free(displayName); - - /* free up the DXGI factory */ - IDXGIFactory_Release(pDXGIFactory); - SDL_UnloadObject(pDXGIDLL); if (*adapterIndex == -1) { return SDL_FALSE; diff --git a/src/video/windows/SDL_windowsvideo.h b/src/video/windows/SDL_windowsvideo.h index 44b3050ca48e6..c4ceca66af1f0 100644 --- a/src/video/windows/SDL_windowsvideo.h +++ b/src/video/windows/SDL_windowsvideo.h @@ -27,6 +27,12 @@ #include "../SDL_sysvideo.h" +#ifdef HAVE_DXGI_H +#define CINTERFACE +#define COBJMACROS +#include +#endif + #if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) #include #else @@ -406,6 +412,11 @@ struct SDL_VideoData /* *INDENT-ON* */ /* clang-format on */ #endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ +#ifdef HAVE_DXGI_H + void *dxgiDLL; + IDXGIFactory *pDXGIFactory; +#endif + SDL_bool cleared; BYTE *rawinput; From 68cf17d0d4415c0d403926e2137b5a988951fec6 Mon Sep 17 00:00:00 2001 From: ceski <56656010+ceski-1@users.noreply.github.com> Date: Thu, 11 Jul 2024 18:20:29 -0700 Subject: [PATCH 281/431] Add a Windows mapping for SplitFish Game Controller --- src/joystick/SDL_gamepad_db.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/joystick/SDL_gamepad_db.h b/src/joystick/SDL_gamepad_db.h index 1c6304d3d98d2..60914af3b61ed 100644 --- a/src/joystick/SDL_gamepad_db.h +++ b/src/joystick/SDL_gamepad_db.h @@ -296,6 +296,7 @@ static const char *s_GamepadMappings[] = { "030000009b2800000500000000000000,Saturn_Adapter_2.0,a:b1,b:b2,leftshoulder:b6,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:b5,start:b9,x:b0,y:b3,", "030000008f0e00000800000000000000,SpeedLink Strike FX,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", "03000000c01100000591000000000000,Speedlink Torid,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,", + "030000004c0500006802000000000000,SplitFish Game Controller,crc:5628,a:b0,b:b16,dpdown:b6,dpleft:b7,dpright:b5,dpup:b4,leftshoulder:b17,leftstick:b1,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b10,", "03000000de280000ff11000000000000,Steam Virtual Gamepad,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b8,lefttrigger:+a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b9,righttrigger:-a2,rightx:a3,righty:a4,start:b7,x:b2,y:b3,", "03000000110100003114000000000000,SteelSeries Stratus Duo,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b13,lefttrigger:b8,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", "03000000381000001814000000000000,SteelSeries Stratus XL,a:b0,b:b1,back:b18,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,guide:b19,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b2,y:b3,", From f13be049801650774a426f3d0acf1e8747a1ee6d Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 13 Jul 2024 17:06:54 +0200 Subject: [PATCH 282/431] testaudio: use SDL_APP_FAILURE macro to signal failure --- test/testaudio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/testaudio.c b/test/testaudio.c index 728f4b670515c..3509ee7222c8c 100644 --- a/test/testaudio.c +++ b/test/testaudio.c @@ -1119,12 +1119,12 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) SetDefaultTitleBar(); - if ((physdev_texture = CreateTexture("physaudiodev.bmp")) == NULL) { return -1; } - if ((logdev_texture = CreateTexture("logaudiodev.bmp")) == NULL) { return -1; } - if ((audio_texture = CreateTexture("audiofile.bmp")) == NULL) { return -1; } - if ((trashcan_texture = CreateTexture("trashcan.bmp")) == NULL) { return -1; } - if ((soundboard_texture = CreateTexture("soundboard.bmp")) == NULL) { return -1; } - if ((soundboard_levels_texture = CreateTexture("soundboard_levels.bmp")) == NULL) { return -1; } + if ((physdev_texture = CreateTexture("physaudiodev.bmp")) == NULL) { return SDL_APP_FAILURE; } + if ((logdev_texture = CreateTexture("logaudiodev.bmp")) == NULL) { return SDL_APP_FAILURE; } + if ((audio_texture = CreateTexture("audiofile.bmp")) == NULL) { return SDL_APP_FAILURE; } + if ((trashcan_texture = CreateTexture("trashcan.bmp")) == NULL) { return SDL_APP_FAILURE; } + if ((soundboard_texture = CreateTexture("soundboard.bmp")) == NULL) { return SDL_APP_FAILURE; } + if ((soundboard_levels_texture = CreateTexture("soundboard_levels.bmp")) == NULL) { return SDL_APP_FAILURE; } LoadStockWavThings(); CreateTrashcanThing(); From 0506cf18aba91f3d7143154c07bbd2338a83ee62 Mon Sep 17 00:00:00 2001 From: captain0xff Date: Sat, 13 Jul 2024 17:23:53 +0530 Subject: [PATCH 283/431] android: enable vulkan renderer --- CMakeLists.txt | 4 ++++ include/build_config/SDL_build_config_android.h | 3 +++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2298d806bc8c..f75f0654f6b6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1339,6 +1339,10 @@ if(ANDROID) if(VULKAN_PASSED_ANDROID_CHECKS) set(SDL_VIDEO_VULKAN 1) set(HAVE_VULKAN TRUE) + if(SDL_RENDER_VULKAN) + set(SDL_VIDEO_RENDER_VULKAN 1) + set(HAVE_RENDER_VULKAN TRUE) + endif() endif() endif() endif() diff --git a/include/build_config/SDL_build_config_android.h b/include/build_config/SDL_build_config_android.h index 013bd060eebf5..098e2f5052187 100644 --- a/include/build_config/SDL_build_config_android.h +++ b/include/build_config/SDL_build_config_android.h @@ -193,6 +193,9 @@ #define SDL_VIDEO_VULKAN 0 #else #define SDL_VIDEO_VULKAN 1 +#ifndef SDL_VIDEO_RENDER_VULKAN +#define SDL_VIDEO_RENDER_VULKAN 1 +#endif #endif /* Enable system power support */ From 2dcb9440f141bef61fce341ed4b7c099d5bf9c50 Mon Sep 17 00:00:00 2001 From: captain0xff Date: Sat, 13 Jul 2024 17:24:22 +0530 Subject: [PATCH 284/431] android: fix the vulkan renderer --- src/render/vulkan/SDL_render_vulkan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 025cdc084649f..b67280e50fe9b 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -3292,7 +3292,7 @@ static void VULKAN_SetupShaderConstants(SDL_Renderer *renderer, const SDL_Render static VkDescriptorPool VULKAN_AllocateDescriptorPool(VULKAN_RenderData *rendererData) { VkDescriptorPool descriptorPool = VK_NULL_HANDLE; - VkDescriptorPoolSize descriptorPoolSizes[2]; + VkDescriptorPoolSize descriptorPoolSizes[3]; VkResult result; descriptorPoolSizes[0].descriptorCount = SDL_VULKAN_MAX_DESCRIPTOR_SETS; descriptorPoolSizes[0].type = VK_DESCRIPTOR_TYPE_SAMPLER; @@ -3300,6 +3300,9 @@ static VkDescriptorPool VULKAN_AllocateDescriptorPool(VULKAN_RenderData *rendere descriptorPoolSizes[1].descriptorCount = SDL_VULKAN_MAX_DESCRIPTOR_SETS; descriptorPoolSizes[1].type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; + descriptorPoolSizes[2].descriptorCount = SDL_VULKAN_MAX_DESCRIPTOR_SETS; + descriptorPoolSizes[2].type = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER; + VkDescriptorPoolCreateInfo descriptorPoolCreateInfo = { 0 }; descriptorPoolCreateInfo.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO; descriptorPoolCreateInfo.poolSizeCount = SDL_arraysize(descriptorPoolSizes); From 44f06b216aaea780db669c96d3b7bf7fe846599d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jul 2024 08:52:43 -0700 Subject: [PATCH 285/431] Fixed refresh interval calculation --- src/render/SDL_render.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 53a59bfb64e9c..58f8fd0acc31a 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -918,21 +918,22 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind { SDL_DisplayID displayID = SDL_GetDisplayForWindow(window); const SDL_DisplayMode *mode; - int num, den; + int refresh_num, refresh_den; if (displayID == 0) { displayID = SDL_GetPrimaryDisplay(); } mode = SDL_GetDesktopDisplayMode(displayID); - if (mode && mode->refresh_rate_numerator > 0) { - num = mode->refresh_rate_numerator; - den = mode->refresh_rate_denominator; + if (mode && mode->refresh_rate_numerator > 0 && mode->refresh_rate_denominator > 0) { + refresh_num = mode->refresh_rate_numerator; + refresh_den = mode->refresh_rate_denominator; } else { /* Pick a good default refresh rate */ - num = 60; - den = 1; + refresh_num = 60; + refresh_den = 1; } - renderer->simulate_vsync_interval_ns = (SDL_NS_PER_SECOND * num) / den; + /* Flip numerator and denominator to change from framerate to interval */ + renderer->simulate_vsync_interval_ns = (SDL_NS_PER_SECOND * refresh_den) / refresh_num; } #endif /* !SDL_RENDER_DISABLED */ @@ -1156,10 +1157,10 @@ SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface) #if SDL_VIDEO_RENDER_SW SDL_Renderer *renderer; - if (!surface) { + if (!surface) { SDL_InvalidParamError("surface"); - return NULL; - } + return NULL; + } SDL_PropertiesID props = SDL_CreateProperties(); SDL_SetPointerProperty(props, SDL_PROP_RENDERER_CREATE_SURFACE_POINTER, surface); From c6b9b08e9f735635bd7e150133395a6445b2a2b4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jul 2024 08:59:25 -0700 Subject: [PATCH 286/431] Fixed Android build warnings --- src/render/SDL_d3dmath.h | 14 +++++++------- src/render/vulkan/SDL_render_vulkan.c | 4 ++-- src/render/vulkan/VULKAN_PixelShader_Advanced.h | 2 +- src/render/vulkan/VULKAN_PixelShader_Colors.h | 2 +- src/render/vulkan/VULKAN_PixelShader_Textures.h | 2 +- src/render/vulkan/VULKAN_VertexShader.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/render/SDL_d3dmath.h b/src/render/SDL_d3dmath.h index ab8d2895b3f12..5400ce369bd65 100644 --- a/src/render/SDL_d3dmath.h +++ b/src/render/SDL_d3dmath.h @@ -65,13 +65,13 @@ typedef struct }; } Float4X4; -Float4X4 MatrixIdentity(); -Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2); -Float4X4 MatrixScaling(float x, float y, float z); -Float4X4 MatrixTranslation(float x, float y, float z); -Float4X4 MatrixRotationX(float r); -Float4X4 MatrixRotationY(float r); -Float4X4 MatrixRotationZ(float r); +extern Float4X4 MatrixIdentity(void); +extern Float4X4 MatrixMultiply(Float4X4 M1, Float4X4 M2); +extern Float4X4 MatrixScaling(float x, float y, float z); +extern Float4X4 MatrixTranslation(float x, float y, float z); +extern Float4X4 MatrixRotationX(float r); +extern Float4X4 MatrixRotationY(float r); +extern Float4X4 MatrixRotationZ(float r); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index b67280e50fe9b..64d1fb6f031fb 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -2939,7 +2939,7 @@ static int VULKAN_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, * then return: */ *pixels = textureData->stagingBuffer.mappedBufferPtr; - *pitch = length; + *pitch = (int)length; return 0; } @@ -3892,7 +3892,7 @@ static SDL_Surface* VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Re VULKAN_VkFormatToSDLPixelFormat(vkFormat), renderer->target ? renderer->target->colorspace : renderer->output_colorspace, readbackBuffer.mappedBufferPtr, - length); + (int)length); VULKAN_DestroyBuffer(rendererData, &readbackBuffer); diff --git a/src/render/vulkan/VULKAN_PixelShader_Advanced.h b/src/render/vulkan/VULKAN_PixelShader_Advanced.h index f205918c5ce31..0c267cf16348c 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Advanced.h +++ b/src/render/vulkan/VULKAN_PixelShader_Advanced.h @@ -1,6 +1,6 @@ // 1113.1.1 #pragma once -const uint32_t VULKAN_PixelShader_Advanced[] = { +static const uint32_t VULKAN_PixelShader_Advanced[] = { 0x07230203,0x00010000,0x0008000b,0x0000043e,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x000001bb,0x000001be,0x000001c2, diff --git a/src/render/vulkan/VULKAN_PixelShader_Colors.h b/src/render/vulkan/VULKAN_PixelShader_Colors.h index e28a83a1a16ce..bd03f72471d70 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Colors.h +++ b/src/render/vulkan/VULKAN_PixelShader_Colors.h @@ -1,6 +1,6 @@ // 1113.1.1 #pragma once -const uint32_t VULKAN_PixelShader_Colors[] = { +static const uint32_t VULKAN_PixelShader_Colors[] = { 0x07230203,0x00010000,0x0008000b,0x000000a1,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x0007000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x00000048,0x0000004c,0x00030010, diff --git a/src/render/vulkan/VULKAN_PixelShader_Textures.h b/src/render/vulkan/VULKAN_PixelShader_Textures.h index bc750d43372df..3b49aabd3e6fd 100644 --- a/src/render/vulkan/VULKAN_PixelShader_Textures.h +++ b/src/render/vulkan/VULKAN_PixelShader_Textures.h @@ -1,6 +1,6 @@ // 1113.1.1 #pragma once -const uint32_t VULKAN_PixelShader_Textures[] = { +static const uint32_t VULKAN_PixelShader_Textures[] = { 0x07230203,0x00010000,0x0008000b,0x000000a8,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x0008000f,0x00000004,0x00000004,0x6e69616d,0x00000000,0x0000004b,0x0000004e,0x00000052, diff --git a/src/render/vulkan/VULKAN_VertexShader.h b/src/render/vulkan/VULKAN_VertexShader.h index cb95262468418..76c1c7b6962bc 100644 --- a/src/render/vulkan/VULKAN_VertexShader.h +++ b/src/render/vulkan/VULKAN_VertexShader.h @@ -1,6 +1,6 @@ // 1113.1.1 #pragma once -const uint32_t VULKAN_VertexShader[] = { +static const uint32_t VULKAN_VertexShader[] = { 0x07230203,0x00010000,0x0008000b,0x000000af,0x00000000,0x00020011,0x00000001,0x0006000b, 0x00000001,0x4c534c47,0x6474732e,0x3035342e,0x00000000,0x0003000e,0x00000000,0x00000001, 0x000c000f,0x00000000,0x00000004,0x6e69616d,0x00000000,0x0000003f,0x00000043,0x00000047, From 3d86dce673c24ba7fe0bff299a0ac31ceb8e337c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 11 Jul 2024 10:25:21 -0400 Subject: [PATCH 287/431] haiku: No more chdir to executable's directory at startup in SDL3. Use SDL_GetBaseDir() to find this directory instead. Reference Issue #8403. Fixes #7596. --- docs/README-migration.md | 12 ++++++++++++ src/core/haiku/SDL_BeApp.cc | 15 --------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 2807be1be8d57..82910915e8b08 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -798,6 +798,18 @@ The following functions have been removed: ## SDL_init.h +On Haiku OS, SDL no longer sets the current working directory to the executable's path during SDL_Init(). If you need this functionality, the fastest solution is to add this code directly after the call to SDL_Init: + +```c +{ + char *path = SDL_GetBasePath(); + if (path) { + chdir(path); + SDL_free(path); + } +} +``` + The following symbols have been renamed: * SDL_INIT_GAMECONTROLLER => SDL_INIT_GAMEPAD diff --git a/src/core/haiku/SDL_BeApp.cc b/src/core/haiku/SDL_BeApp.cc index ba0f256e3ce2a..cc41c752892ce 100644 --- a/src/core/haiku/SDL_BeApp.cc +++ b/src/core/haiku/SDL_BeApp.cc @@ -117,21 +117,6 @@ static int StartBeLooper() } while ((!be_app) || be_app->IsLaunching()); } - /* Change working 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()); - } - } - } - } - SDL_Looper = new SDL_BLooper("SDLLooper"); SDL_Looper->Run(); return (0); From 1e6119e33505459b42dfe1905ff1e0beb0747b65 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jul 2024 09:26:44 -0700 Subject: [PATCH 288/431] VULKAN_RenderPresent() should return result code 0 on success --- src/render/vulkan/SDL_render_vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 64d1fb6f031fb..264e16c0d07eb 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -4030,7 +4030,7 @@ static int VULKAN_RenderPresent(SDL_Renderer *renderer) VULKAN_AcquireNextSwapchainImage(renderer); } - return (result == VK_SUCCESS); + return 0; } static int VULKAN_SetVSync(SDL_Renderer *renderer, const int vsync) From 9379e2eb8d712fec18c5189fef10a406a384d41d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jul 2024 10:04:15 -0700 Subject: [PATCH 289/431] Don't force vsync on for the software renderer Setting vsync 0 should succeed for the software renderer. --- src/render/SDL_render.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 58f8fd0acc31a..2153c239c8ce9 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -4770,7 +4770,11 @@ int SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync) #if SDL_VIDEO_RENDER_SW if (renderer->software) { if (!renderer->window) { - return SDL_Unsupported(); + if (!vsync) { + return 0; + } else { + return SDL_Unsupported(); + } } if (SDL_SetWindowTextureVSync(NULL, renderer->window, vsync) == 0) { renderer->simulate_vsync = SDL_FALSE; From 650271af46073d69cbb98f4ccb843105537c5b4f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jul 2024 14:18:35 -0700 Subject: [PATCH 290/431] Added SDL_CreateSurfacePalette() --- docs/README-migration.md | 15 +++++++++++- include/SDL3/SDL_surface.h | 18 ++++++++++++++ src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/video/SDL_bmp.c | 23 +++++++----------- src/video/SDL_surface.c | 40 +++++++++++++++++++++++++++++++ test/testautomation_surface.c | 2 ++ test/testmanymouse.c | 4 +--- 9 files changed, 87 insertions(+), 18 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 82910915e8b08..fe767ba96c6d9 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1644,7 +1644,20 @@ The `format` member of SDL_Surface is now an enumerated pixel format value. You The userdata member of SDL_Surface has been replaced with a more general properties interface, which can be queried with SDL_GetSurfaceProperties() -Indexed format surfaces no longer have a palette by default. Surfaces without a palette will copy the pixels untranslated between surfaces. You should use SDL_CreatePalette() to create a palette and call SDL_SetSurfacePalette() to associate it with the final indexed surface before copying it to color pixels. +Indexed format surfaces no longer have a palette by default. Surfaces without a palette will copy the pixels untranslated between surfaces. + +Code that used to look like this: +```c + SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, 32, 32, 8, SDL_PIXELFORMAT_INDEX8); + SDL_Palette *palette = surface->format->palette; + ... +``` +should be changed to: +```c + SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8); + SDL_Palette *palette = SDL_CreateSurfacePalette(surface); + ... +``` Removed the unused 'flags' parameter from SDL_ConvertSurface. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index fd5096ac9f4c3..2f0ee8c510eed 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -254,6 +254,24 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceColorspace(SDL_Surface *surface, S */ extern SDL_DECLSPEC SDL_Colorspace SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface); +/** + * Create a palette and associate it with a surface. + * + * This function creates a palette compatible with the provided surface. The palette is then returned for you to modify, and the surface will automatically use the new palette in future operations. You do not need to destroy the returned palette, it will be freed when the reference count reaches 0, usually when the surface is destroyed. + * + * Bitmap surfaces (with format SDL_PIXELFORMAT_INDEX1LSB or SDL_PIXELFORMAT_INDEX1MSB) will have the palette initialized with 0 as white and 1 as black. Other surfaces will get a palette initialized with white in every entry. + * + * If this function is called for a surface that already has a palette, a new palette will be created to replace it. + * + * \param surface the SDL_Surface structure to update. + * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if the surface didn't have an index format); call SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_SetPaletteColors + */ +extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreateSurfacePalette(SDL_Surface *surface); + /** * Set the palette used by a surface. * diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index f0742330d2b03..e1e0e3432d3a0 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -79,6 +79,7 @@ SDL3_0.0.0 { SDL_CreateStorageDirectory; SDL_CreateSurface; SDL_CreateSurfaceFrom; + SDL_CreateSurfacePalette; SDL_CreateSystemCursor; SDL_CreateTLS; SDL_CreateTexture; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 7d15e9819d955..80eb264dd0853 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -104,6 +104,7 @@ #define SDL_CreateStorageDirectory SDL_CreateStorageDirectory_REAL #define SDL_CreateSurface SDL_CreateSurface_REAL #define SDL_CreateSurfaceFrom SDL_CreateSurfaceFrom_REAL +#define SDL_CreateSurfacePalette SDL_CreateSurfacePalette_REAL #define SDL_CreateSystemCursor SDL_CreateSystemCursor_REAL #define SDL_CreateTLS SDL_CreateTLS_REAL #define SDL_CreateTexture SDL_CreateTexture_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 27a35a97fe76a..63034e6b9a7c8 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -124,6 +124,7 @@ SDL_DYNAPI_PROC(SDL_Renderer*,SDL_CreateSoftwareRenderer,(SDL_Surface *a),(a),re SDL_DYNAPI_PROC(int,SDL_CreateStorageDirectory,(SDL_Storage *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, SDL_PixelFormat c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(int a, int b, SDL_PixelFormat c, void *d, int e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(SDL_Palette*,SDL_CreateSurfacePalette,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateSystemCursor,(SDL_SystemCursor a),(a),return) SDL_DYNAPI_PROC(SDL_TLSID,SDL_CreateTLS,(void),(),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTexture,(SDL_Renderer *a, SDL_PixelFormat b, int c, int d, int e),(a,b,c,d,e),return) diff --git a/src/video/SDL_bmp.c b/src/video/SDL_bmp.c index b726b20382d2a..1f52862033a58 100644 --- a/src/video/SDL_bmp.c +++ b/src/video/SDL_bmp.c @@ -439,8 +439,10 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) /* Load the palette, if any */ if (SDL_ISPIXELFORMAT_INDEXED(surface->format)) { - int max_colors = (1 << SDL_BITSPERPIXEL(surface->format)); - SDL_Palette *palette; + SDL_Palette *palette = SDL_CreateSurfacePalette(surface); + if (!palette) { + goto done; + } if (SDL_SeekIO(src, fp_offset + 14 + biSize, SDL_IO_SEEK_SET) < 0) { SDL_SetError("Error seeking in datastream"); @@ -456,21 +458,17 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) biClrUsed = 1 << biBitCount; } - if (biClrUsed > (Uint32)max_colors) { + if (biClrUsed > (Uint32)palette->ncolors) { biClrUsed = 1 << biBitCount; /* try forcing it? */ - if (biClrUsed > (Uint32)max_colors) { + if (biClrUsed > (Uint32)palette->ncolors) { SDL_SetError("Unsupported or incorrect biClrUsed field"); goto done; } } - - palette = SDL_CreatePalette(biClrUsed); - if (!palette) { - goto done; - } + palette->ncolors = biClrUsed; if (biSize == 12) { - for (i = 0; i < (int)biClrUsed; ++i) { + for (i = 0; i < palette->ncolors; ++i) { if (!SDL_ReadU8(src, &palette->colors[i].b) || !SDL_ReadU8(src, &palette->colors[i].g) || !SDL_ReadU8(src, &palette->colors[i].r)) { @@ -479,7 +477,7 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) palette->colors[i].a = SDL_ALPHA_OPAQUE; } } else { - for (i = 0; i < (int)biClrUsed; ++i) { + for (i = 0; i < palette->ncolors; ++i) { if (!SDL_ReadU8(src, &palette->colors[i].b) || !SDL_ReadU8(src, &palette->colors[i].g) || !SDL_ReadU8(src, &palette->colors[i].r) || @@ -494,9 +492,6 @@ SDL_Surface *SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio) palette->colors[i].a = SDL_ALPHA_OPAQUE; } } - - SDL_SetSurfacePalette(surface, palette); - SDL_DestroyPalette(palette); } /* Read the surface pixels. Note that the bmp image is upside down */ diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index ab24c3466a542..1d8a0326ef8dd 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -367,6 +367,46 @@ float SDL_GetSurfaceHDRHeadroom(SDL_Surface *surface, SDL_Colorspace colorspace) return 1.0f; } +SDL_Palette *SDL_CreateSurfacePalette(SDL_Surface *surface) +{ + SDL_Palette *palette; + + if (!SDL_SurfaceValid(surface)) { + SDL_InvalidParamError("surface"); + return NULL; + } + + if (!SDL_ISPIXELFORMAT_INDEXED(surface->format)) { + SDL_SetError("The surface is not indexed format"); + return NULL; + } + + palette = SDL_CreatePalette((1 << SDL_BITSPERPIXEL(surface->format))); + if (!palette) { + return NULL; + } + + if (palette->ncolors == 2) { + /* Create a black and white bitmap palette */ + palette->colors[0].r = 0xFF; + palette->colors[0].g = 0xFF; + palette->colors[0].b = 0xFF; + palette->colors[1].r = 0x00; + palette->colors[1].g = 0x00; + palette->colors[1].b = 0x00; + } + + if (SDL_SetSurfacePalette(surface, palette) < 0) { + SDL_DestroyPalette(palette); + return NULL; + } + + /* The surface has retained the palette, we can remove the reference here */ + SDL_assert(palette->refcount == 2); + SDL_DestroyPalette(palette); + return palette; +} + int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette) { if (!SDL_SurfaceValid(surface)) { diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 878c3a5096aa5..0d9a81afc5f09 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -863,9 +863,11 @@ static int surface_testPalette(void *arg) source = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_INDEX8); SDLTest_AssertCheck(source != NULL, "SDL_CreateSurface()"); + SDLTest_AssertCheck(SDL_GetSurfacePalette(source) == NULL, "SDL_GetSurfacePalette(source)"); surface = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_INDEX8); SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); + SDLTest_AssertCheck(SDL_GetSurfacePalette(surface) == NULL, "SDL_GetSurfacePalette(surface)"); pixels = (Uint8 *)surface->pixels; SDLTest_AssertCheck(*pixels == 0, "Expected *pixels == 0 got %u", *pixels); diff --git a/test/testmanymouse.c b/test/testmanymouse.c index 6f9e418ab3a45..03c672ce3e385 100644 --- a/test/testmanymouse.c +++ b/test/testmanymouse.c @@ -157,7 +157,7 @@ static SDL_Texture *CreateTexture(const char *image[], SDL_Renderer *renderer) SDL_memcpy((Uint8 *)surface->pixels + row * surface->pitch, image[4 + row], surface->w); } - palette = SDL_CreatePalette(256); + palette = SDL_CreateSurfacePalette(surface); if (!palette) { SDL_DestroySurface(surface); return NULL; @@ -171,8 +171,6 @@ static SDL_Texture *CreateTexture(const char *image[], SDL_Renderer *renderer) palette->colors['X'].r = 0x00; palette->colors['X'].g = 0x00; palette->colors['X'].b = 0x00; - SDL_SetSurfacePalette(surface, palette); - SDL_DestroyPalette(palette); SDL_SetSurfaceColorKey(surface, SDL_TRUE, ' '); From 2596482c3facc427a831dc079c4c1b7e02761406 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sat, 13 Jul 2024 21:32:39 +0000 Subject: [PATCH 291/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_surface.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 2f0ee8c510eed..25cf66da1221c 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -257,14 +257,24 @@ extern SDL_DECLSPEC SDL_Colorspace SDLCALL SDL_GetSurfaceColorspace(SDL_Surface /** * Create a palette and associate it with a surface. * - * This function creates a palette compatible with the provided surface. The palette is then returned for you to modify, and the surface will automatically use the new palette in future operations. You do not need to destroy the returned palette, it will be freed when the reference count reaches 0, usually when the surface is destroyed. + * This function creates a palette compatible with the provided surface. The + * palette is then returned for you to modify, and the surface will + * automatically use the new palette in future operations. You do not need to + * destroy the returned palette, it will be freed when the reference count + * reaches 0, usually when the surface is destroyed. * - * Bitmap surfaces (with format SDL_PIXELFORMAT_INDEX1LSB or SDL_PIXELFORMAT_INDEX1MSB) will have the palette initialized with 0 as white and 1 as black. Other surfaces will get a palette initialized with white in every entry. + * Bitmap surfaces (with format SDL_PIXELFORMAT_INDEX1LSB or + * SDL_PIXELFORMAT_INDEX1MSB) will have the palette initialized with 0 as + * white and 1 as black. Other surfaces will get a palette initialized with + * white in every entry. * - * If this function is called for a surface that already has a palette, a new palette will be created to replace it. + * If this function is called for a surface that already has a palette, a new + * palette will be created to replace it. * * \param surface the SDL_Surface structure to update. - * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if the surface didn't have an index format); call SDL_GetError() for more information. + * \returns a new SDL_Palette structure on success or NULL on failure (e.g. if + * the surface didn't have an index format); call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * From 4e3f35ccbf57c827ab61df0d495e4354030a7b07 Mon Sep 17 00:00:00 2001 From: pixls <135275767+pixls@users.noreply.github.com> Date: Sat, 13 Jul 2024 23:53:29 +0100 Subject: [PATCH 292/431] Unlocking mutex in success case too Without unlocking, we trigger an assertion failure in SDL_sysmutex.c at line 80 (i.e. 'rc == 0'). Each lock-unlock pair should ideally cancel each other out, maintaining a reference count that returns to zero. --- src/video/SDL_pixels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index f692bf6fdef64..79b0eade3ab3d 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -661,6 +661,7 @@ const SDL_PixelFormatDetails *SDL_GetPixelFormatDetails(SDL_PixelFormat format) } if (SDL_FindInHashTable(SDL_format_details, (const void *)(uintptr_t)format, (const void **)&details)) { + SDL_UnlockMutex(SDL_format_details_lock); return details; } From c80665a6968e6274b978846ba77b47c9c61c2618 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 14 Jul 2024 01:20:02 +0200 Subject: [PATCH 293/431] Avoid code duplication in SDL_GetPixelFormatDetails --- src/video/SDL_pixels.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 79b0eade3ab3d..6f00f2aae482d 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -661,8 +661,7 @@ const SDL_PixelFormatDetails *SDL_GetPixelFormatDetails(SDL_PixelFormat format) } if (SDL_FindInHashTable(SDL_format_details, (const void *)(uintptr_t)format, (const void **)&details)) { - SDL_UnlockMutex(SDL_format_details_lock); - return details; + goto done; } /* Allocate an empty pixel format structure, and initialize it */ From 509f3a42d7e67f85b4684ca487e3c166a269e534 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 13 Jul 2024 17:57:46 -0700 Subject: [PATCH 294/431] Fixed crash when pumping events after the window has been destroyed on Android --- src/video/android/SDL_androidevents.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c index 2c3444df2c40e..74a28da330e0e 100644 --- a/src/video/android/SDL_androidevents.c +++ b/src/video/android/SDL_androidevents.c @@ -98,7 +98,7 @@ void Android_PumpEvents_Blocking(SDL_VideoDevice *_this) if (videodata->isPaused) { #ifdef SDL_VIDEO_OPENGL_EGL /* Make sure this is the last thing we do before pausing */ - if (!Android_Window->external_graphics_context) { + if (Android_Window && !Android_Window->external_graphics_context) { SDL_LockMutex(Android_ActivityMutex); android_egl_context_backup(Android_Window); SDL_UnlockMutex(Android_ActivityMutex); @@ -122,7 +122,7 @@ void Android_PumpEvents_Blocking(SDL_VideoDevice *_this) /* Restore the GL Context from here, as this operation is thread dependent */ #ifdef SDL_VIDEO_OPENGL_EGL - if (!Android_Window->external_graphics_context && !SDL_HasEvent(SDL_EVENT_QUIT)) { + if (Android_Window && !Android_Window->external_graphics_context && !SDL_HasEvent(SDL_EVENT_QUIT)) { SDL_LockMutex(Android_ActivityMutex); android_egl_context_restore(Android_Window); SDL_UnlockMutex(Android_ActivityMutex); @@ -130,7 +130,9 @@ void Android_PumpEvents_Blocking(SDL_VideoDevice *_this) #endif /* Make sure SW Keyboard is restored when an app becomes foreground */ - Android_RestoreScreenKeyboardOnResume(_this, Android_Window); + if (Android_Window) { + Android_RestoreScreenKeyboardOnResume(_this, Android_Window); + } SDL_SendAppEvent(SDL_EVENT_DID_ENTER_FOREGROUND); SDL_SendWindowEvent(Android_Window, SDL_EVENT_WINDOW_RESTORED, 0, 0); @@ -168,7 +170,7 @@ void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this) if (backup_context) { #ifdef SDL_VIDEO_OPENGL_EGL - if (!Android_Window->external_graphics_context) { + if (Android_Window && !Android_Window->external_graphics_context) { SDL_LockMutex(Android_ActivityMutex); android_egl_context_backup(Android_Window); SDL_UnlockMutex(Android_ActivityMutex); @@ -199,7 +201,7 @@ void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this) #ifdef SDL_VIDEO_OPENGL_EGL /* Restore the GL Context from here, as this operation is thread dependent */ - if (!Android_Window->external_graphics_context && !SDL_HasEvent(SDL_EVENT_QUIT)) { + if (Android_Window && !Android_Window->external_graphics_context && !SDL_HasEvent(SDL_EVENT_QUIT)) { SDL_LockMutex(Android_ActivityMutex); android_egl_context_restore(Android_Window); SDL_UnlockMutex(Android_ActivityMutex); @@ -207,7 +209,9 @@ void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this) #endif /* Make sure SW Keyboard is restored when an app becomes foreground */ - Android_RestoreScreenKeyboardOnResume(_this, Android_Window); + if (Android_Window) { + Android_RestoreScreenKeyboardOnResume(_this, Android_Window); + } SDL_SendAppEvent(SDL_EVENT_DID_ENTER_FOREGROUND); SDL_SendWindowEvent(Android_Window, SDL_EVENT_WINDOW_RESTORED, 0, 0); From dd08c279e22d9d66f513f85d87633b943bbda4cc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 07:15:26 -0700 Subject: [PATCH 295/431] Fixed coccinelle patching Fixes https://github.com/libsdl-org/SDL/issues/10260 --- build-scripts/SDL_migration.cocci | 5 ----- 1 file changed, 5 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 8d2eea587dd7d..1be44696018b7 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3484,11 +3484,6 @@ typedef SDL_Colour, SDL_Color; - SDLK_z + SDLK_Z @@ -typedef SDL_PixelFormat, SDL_PackedPixelDetails; -@@ -- SDL_PixelFormat -+ SDL_PixelFormatDetails -@@ @@ - SDL_ConvertSurfaceFormat + SDL_ConvertSurface From bfee544685f3fd847a230c5c48f2018e30c7195e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 07:19:20 -0700 Subject: [PATCH 296/431] Changed SDL_GetWindowPixelFormat() to return SDL_PixelFormat Fixes https://github.com/libsdl-org/SDL/issues/10257 Closes https://github.com/libsdl-org/SDL/pull/10258 --- include/SDL3/SDL_video.h | 2 +- src/dynapi/SDL_dynapi_procs.h | 2 +- src/render/psp/SDL_render_psp.c | 2 +- src/video/SDL_video.c | 2 +- test/testautomation_video.c | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 9a22dbd7d96ad..a1e04737f3046 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -781,7 +781,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, si * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window); +extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window *window); /** * Get a list of valid windows. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 63034e6b9a7c8..1212c524ad052 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -525,7 +525,7 @@ SDL_DYNAPI_PROC(const SDL_Rect*,SDL_GetWindowMouseRect,(SDL_Window *a),(a),retur SDL_DYNAPI_PROC(int,SDL_GetWindowOpacity,(SDL_Window *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowParent,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetWindowPixelDensity,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(Uint32,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) +SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowPosition,(SDL_Window *a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetWindowProperties,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 9187b73319ed9..6ba77415d3242 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -192,7 +192,7 @@ static void psp_on_vblank(u32 sub, PSP_RenderData *data) } } -static int PixelFormatToPSPFMT(Uint32 format) +static int PixelFormatToPSPFMT(SDL_PixelFormat format) { switch (format) { case SDL_PIXELFORMAT_BGR565: diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0d676cc339931..a143bbfa533fe 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2012,7 +2012,7 @@ void *SDL_GetWindowICCProfile(SDL_Window *window, size_t *size) return _this->GetWindowICCProfile(_this, window, size); } -Uint32 SDL_GetWindowPixelFormat(SDL_Window *window) +SDL_PixelFormat SDL_GetWindowPixelFormat(SDL_Window *window) { SDL_DisplayID displayID; const SDL_DisplayMode *mode; diff --git a/test/testautomation_video.c b/test/testautomation_video.c index b8b995a3ca73b..50849c8ca9562 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -731,7 +731,7 @@ static int video_getWindowPixelFormat(void *arg) { const char *title = "video_getWindowPixelFormat Test Window"; SDL_Window *window; - Uint32 format; + SDL_PixelFormat format; /* Call against new test window */ window = createVideoSuiteTestWindow(title); From 933f2fc239bcfa7104dd42cb41b1b56880f6189e Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 14 Jul 2024 17:04:27 +0200 Subject: [PATCH 297/431] pthread: timespec.tv_nsec must be less then 1000000000 ns --- src/thread/pthread/SDL_syscond.c | 2 +- src/thread/pthread/SDL_syssem.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thread/pthread/SDL_syscond.c b/src/thread/pthread/SDL_syscond.c index 7583abbd408f9..fbfca4ac774bb 100644 --- a/src/thread/pthread/SDL_syscond.c +++ b/src/thread/pthread/SDL_syscond.c @@ -120,7 +120,7 @@ int SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 tim abstime.tv_sec = delta.tv_sec + (timeoutNS / SDL_NS_PER_SECOND); abstime.tv_nsec = SDL_US_TO_NS(delta.tv_usec) + (timeoutNS % SDL_NS_PER_SECOND); #endif - while (abstime.tv_nsec > 1000000000) { + while (abstime.tv_nsec >= 1000000000) { abstime.tv_sec += 1; abstime.tv_nsec -= 1000000000; } diff --git a/src/thread/pthread/SDL_syssem.c b/src/thread/pthread/SDL_syssem.c index 738bb866f6707..fcc287e800534 100644 --- a/src/thread/pthread/SDL_syssem.c +++ b/src/thread/pthread/SDL_syssem.c @@ -115,7 +115,7 @@ int SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS) #endif /* Wrap the second if needed */ - while (ts_timeout.tv_nsec > 1000000000) { + while (ts_timeout.tv_nsec >= 1000000000) { ts_timeout.tv_sec += 1; ts_timeout.tv_nsec -= 1000000000; } From e90060d07f63fc25add5bc4339afd8d4b4364ccc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 08:46:24 -0700 Subject: [PATCH 298/431] Renamed functions to get information from device IDs Fixes https://github.com/libsdl-org/SDL/issues/10237 --- docs/README-migration.md | 56 ++++++++++++++--------------- include/SDL3/SDL_gamepad.h | 38 ++++++++++---------- include/SDL3/SDL_haptic.h | 6 ++-- include/SDL3/SDL_joystick.h | 38 ++++++++++---------- include/SDL3/SDL_oldnames.h | 8 ++--- include/SDL3/SDL_sensor.h | 14 +++++--- src/dynapi/SDL_dynapi.sym | 50 +++++++++++++------------- src/dynapi/SDL_dynapi_overrides.h | 50 +++++++++++++------------- src/dynapi/SDL_dynapi_procs.h | 50 +++++++++++++------------- src/haptic/SDL_haptic.c | 8 ++--- src/joystick/SDL_gamepad.c | 50 +++++++++++++------------- src/joystick/SDL_joystick.c | 56 ++++++++++++++--------------- src/joystick/SDL_joystick_c.h | 2 +- src/joystick/vita/SDL_sysjoystick.c | 6 ++-- src/sensor/SDL_sensor.c | 8 ++--- test/testautomation_joystick.c | 8 ++--- test/testcontroller.c | 2 +- test/testhaptic.c | 4 +-- test/testrumble.c | 2 +- test/testsensor.c | 8 ++--- 20 files changed, 235 insertions(+), 229 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index fe767ba96c6d9..c80ef9593c431 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -461,7 +461,7 @@ SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been rena The SDL_EVENT_GAMEPAD_ADDED event now provides the joystick instance ID in the which member of the cdevice event structure. -The functions SDL_GetGamepads(), SDL_GetGamepadInstanceName(), SDL_GetGamepadInstancePath(), SDL_GetGamepadInstancePlayerIndex(), SDL_GetGamepadInstanceGUID(), SDL_GetGamepadInstanceVendor(), SDL_GetGamepadInstanceProduct(), SDL_GetGamepadInstanceProductVersion(), and SDL_GetGamepadInstanceType() have been added to directly query the list of available gamepads. +The functions SDL_GetGamepads(), SDL_GetGamepadNameFromID(), SDL_GetGamepadPathFromID(), SDL_GetGamepadPlayerIndexFromID(), SDL_GetGamepadGUIDFromID(), SDL_GetGamepadVendorFromID(), SDL_GetGamepadProductFromID(), SDL_GetGamepadProductVersionFromID(), and SDL_GetGamepadTypeFromID() have been added to directly query the list of available gamepads. The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West to indicate that they are positional rather than hardware-specific. You can use SDL_GetGamepadButtonLabel() to get the labels for the face buttons, e.g. A/B/X/Y or Cross/Circle/Square/Triangle. The hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS is ignored, and mappings that use this hint are translated correctly into positional buttons. Applications should provide a way for users to swap between South/East as their accept/cancel buttons, as this varies based on region and muscle memory. You can use an approach similar to the following to handle this: @@ -624,12 +624,12 @@ The following functions have been removed: * SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN * SDL_GameControllerHasRumble() - replaced with SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN * SDL_GameControllerHasRumbleTriggers() - replaced with SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN -* SDL_GameControllerMappingForDeviceIndex() - replaced with SDL_GetGamepadInstanceMapping() +* SDL_GameControllerMappingForDeviceIndex() - replaced with SDL_GetGamepadMappingFromID() * SDL_GameControllerMappingForIndex() - replaced with SDL_GetGamepadMappings() -* SDL_GameControllerNameForIndex() - replaced with SDL_GetGamepadInstanceName() +* SDL_GameControllerNameForIndex() - replaced with SDL_GetGamepadNameFromID() * SDL_GameControllerNumMappings() - replaced with SDL_GetGamepadMappings() -* SDL_GameControllerPathForIndex() - replaced with SDL_GetGamepadInstancePath() -* SDL_GameControllerTypeForIndex() - replaced with SDL_GetGamepadInstanceType() +* SDL_GameControllerPathForIndex() - replaced with SDL_GetGamepadPathFromID() +* SDL_GameControllerTypeForIndex() - replaced with SDL_GetGamepadTypeFromID() The following symbols have been renamed: * SDL_CONTROLLER_AXIS_INVALID => SDL_GAMEPAD_AXIS_INVALID @@ -700,7 +700,7 @@ Rather than iterating over haptic devices using device index, there is a new fun if (haptics) { for (i = 0; i < num_haptics; ++i) { SDL_HapticID instance_id = haptics[i]; - const char *name = SDL_GetHapticInstanceName(instance_id); + const char *name = SDL_GetHapticNameFromID(instance_id); SDL_Log("Haptic %" SDL_PRIu32 ": %s\n", instance_id, name ? name : "Unknown"); @@ -741,8 +741,8 @@ The following functions have been renamed: * SDL_MouseIsHaptic() => SDL_IsMouseHaptic() The following functions have been removed: -* SDL_HapticIndex() - replaced with SDL_GetHapticInstanceID() -* SDL_HapticName() - replaced with SDL_GetHapticInstanceName() +* SDL_HapticIndex() - replaced with SDL_GetHapticID() +* SDL_HapticName() - replaced with SDL_GetHapticNameFromID() * SDL_HapticOpened() - replaced with SDL_GetHapticFromInstanceID() * SDL_NumHaptics() - replaced with SDL_GetHaptics() @@ -830,11 +830,11 @@ Rather than iterating over joysticks using device index, there is a new function if (joysticks) { for (i = 0; i < num_joysticks; ++i) { SDL_JoystickID instance_id = joysticks[i]; - const char *name = SDL_GetJoystickInstanceName(instance_id); - const char *path = SDL_GetJoystickInstancePath(instance_id); + const char *name = SDL_GetJoystickNameFromID(instance_id); + const char *path = SDL_GetJoystickPathFromID(instance_id); SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n", - instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickInstanceVendor(instance_id), SDL_GetJoystickInstanceProduct(instance_id)); + instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorFromID(instance_id), SDL_GetJoystickProductFromID(instance_id)); } SDL_free(joysticks); } @@ -845,7 +845,7 @@ Rather than iterating over joysticks using device index, there is a new function The SDL_EVENT_JOYSTICK_ADDED event now provides the joystick instance ID in the `which` member of the jdevice event structure. -The functions SDL_GetJoysticks(), SDL_GetJoystickInstanceName(), SDL_GetJoystickInstancePath(), SDL_GetJoystickInstancePlayerIndex(), SDL_GetJoystickInstanceGUID(), SDL_GetJoystickInstanceVendor(), SDL_GetJoystickInstanceProduct(), SDL_GetJoystickInstanceProductVersion(), and SDL_GetJoystickInstanceType() have been added to directly query the list of available joysticks. +The functions SDL_GetJoysticks(), SDL_GetJoystickNameFromID(), SDL_GetJoystickPathFromID(), SDL_GetJoystickPlayerIndexFromID(), SDL_GetJoystickGUIDFromID(), SDL_GetJoystickVendorFromID(), SDL_GetJoystickProductFromID(), SDL_GetJoystickProductVersionFromID(), and SDL_GetJoystickTypeFromID() have been added to directly query the list of available joysticks. SDL_AttachVirtualJoystick() now returns the joystick instance ID instead of a device index, and returns 0 if there was an error. @@ -873,7 +873,7 @@ The following functions have been renamed: * SDL_JoystickGetSerial() => SDL_GetJoystickSerial() * SDL_JoystickGetType() => SDL_GetJoystickType() * SDL_JoystickGetVendor() => SDL_GetJoystickVendor() -* SDL_JoystickInstanceID() => SDL_GetJoystickInstanceID() +* SDL_JoystickInstanceID() => SDL_GetJoystickID() * SDL_JoystickIsVirtual() => SDL_IsJoystickVirtual() * SDL_JoystickName() => SDL_GetJoystickName() * SDL_JoystickNumAxes() => SDL_GetNumJoystickAxes() @@ -899,18 +899,18 @@ The following functions have been removed: * SDL_JoystickAttachVirtual() - replaced with SDL_AttachVirtualJoystick() * SDL_JoystickCurrentPowerLevel() - replaced with SDL_GetJoystickConnectionState() and SDL_GetJoystickPowerInfo() * SDL_JoystickEventState() - replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled() -* SDL_JoystickGetDeviceGUID() - replaced with SDL_GetJoystickInstanceGUID() +* SDL_JoystickGetDeviceGUID() - replaced with SDL_GetJoystickGUIDFromID() * SDL_JoystickGetDeviceInstanceID() -* SDL_JoystickGetDevicePlayerIndex() - replaced with SDL_GetJoystickInstancePlayerIndex() -* SDL_JoystickGetDeviceProduct() - replaced with SDL_GetJoystickInstanceProduct() -* SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickInstanceProductVersion() -* SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickInstanceType() -* SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickInstanceVendor() +* SDL_JoystickGetDevicePlayerIndex() - replaced with SDL_GetJoystickPlayerIndexFromID() +* SDL_JoystickGetDeviceProduct() - replaced with SDL_GetJoystickProductFromID() +* SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickProductVersionFromID() +* SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickTypeFromID() +* SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickVendorFromID() * SDL_JoystickHasLED() - replaced with SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN * SDL_JoystickHasRumble() - replaced with SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN * SDL_JoystickHasRumbleTriggers() - replaced with SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN -* SDL_JoystickNameForIndex() - replaced with SDL_GetJoystickInstanceName() -* SDL_JoystickPathForIndex() - replaced with SDL_GetJoystickInstancePath() +* SDL_JoystickNameForIndex() - replaced with SDL_GetJoystickNameFromID() +* SDL_JoystickPathForIndex() - replaced with SDL_GetJoystickPathFromID() * SDL_NumJoysticks() - replaced with SDL_GetJoysticks() * SDL_VIRTUAL_JOYSTICK_DESC_VERSION - no longer needed, version info has been removed from SDL_VirtualJoystickDesc. @@ -1571,9 +1571,9 @@ Rather than iterating over sensors using device index, there is a new function S for (i = 0; i < num_sensors; ++i) { SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d\n", sensors[i], - SDL_GetSensorInstanceName(sensors[i]), - SDL_GetSensorInstanceType(sensors[i]), - SDL_GetSensorInstanceNonPortableType(sensors[i])); + SDL_GetSensorNameFromID(sensors[i]), + SDL_GetSensorTypeFromID(sensors[i]), + SDL_GetSensorNonPortableTypeFromID(sensors[i])); } SDL_free(sensors); } @@ -1589,7 +1589,7 @@ The following functions have been renamed: * SDL_SensorClose() => SDL_CloseSensor() * SDL_SensorFromInstanceID() => SDL_GetSensorFromInstanceID() * SDL_SensorGetData() => SDL_GetSensorData() -* SDL_SensorGetInstanceID() => SDL_GetSensorInstanceID() +* SDL_SensorGetInstanceID() => SDL_GetSensorID() * SDL_SensorGetName() => SDL_GetSensorName() * SDL_SensorGetNonPortableType() => SDL_GetSensorNonPortableType() * SDL_SensorGetType() => SDL_GetSensorType() @@ -1600,9 +1600,9 @@ The following functions have been removed: * SDL_LockSensors() * SDL_NumSensors() - replaced with SDL_GetSensors() * SDL_SensorGetDeviceInstanceID() -* SDL_SensorGetDeviceName() - replaced with SDL_GetSensorInstanceName() -* SDL_SensorGetDeviceNonPortableType() - replaced with SDL_GetSensorInstanceNonPortableType() -* SDL_SensorGetDeviceType() - replaced with SDL_GetSensorInstanceType() +* SDL_SensorGetDeviceName() - replaced with SDL_GetSensorNameFromID() +* SDL_SensorGetDeviceNonPortableType() - replaced with SDL_GetSensorNonPortableTypeFromID() +* SDL_SensorGetDeviceType() - replaced with SDL_GetSensorTypeFromID() * SDL_UnlockSensors() ## SDL_shape.h diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 36282ad5fb2b4..06d8df1861fc6 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -412,7 +412,7 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceGUID + * \sa SDL_GetJoystickGUIDFromID * \sa SDL_GetJoystickGUID */ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid); @@ -431,7 +431,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID * \since This function is available since SDL 3.0.0. * * \sa SDL_AddGamepadMapping - * \sa SDL_GetGamepadInstanceMapping + * \sa SDL_GetGamepadMappingFromID * \sa SDL_GetGamepadMappingForGUID * \sa SDL_SetGamepadMapping */ @@ -511,7 +511,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); * \sa SDL_GetGamepadName * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameFromID(SDL_JoystickID instance_id); /** * Get the implementation dependent path of a gamepad. @@ -529,7 +529,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadInstanceName(SDL_JoystickI * \sa SDL_GetGamepadPath * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPathFromID(SDL_JoystickID instance_id); /** * Get the player index of a gamepad. @@ -544,7 +544,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadInstancePath(SDL_JoystickI * \sa SDL_GetGamepadPlayerIndex * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id); +extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexFromID(SDL_JoystickID instance_id); /** * Get the implementation-dependent GUID of a gamepad. @@ -561,7 +561,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID * \sa SDL_GetGamepadGUIDString * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadGUIDFromID(SDL_JoystickID instance_id); /** * Get the USB vendor ID of a gamepad, if available. @@ -578,7 +578,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadInstanceGUID(SDL_Joys * \sa SDL_GetGamepadVendor * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendorFromID(SDL_JoystickID instance_id); /** * Get the USB product ID of a gamepad, if available. @@ -595,7 +595,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceVendor(SDL_JoystickID i * \sa SDL_GetGamepadProduct * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductFromID(SDL_JoystickID instance_id); /** * Get the product version of a gamepad, if available. @@ -612,7 +612,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProduct(SDL_JoystickID * \sa SDL_GetGamepadProductVersion * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersionFromID(SDL_JoystickID instance_id); /** * Get the type of a gamepad. @@ -628,7 +628,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadInstanceProductVersion(SDL_Joys * \sa SDL_GetGamepads * \sa SDL_GetRealGamepadInstanceType */ -extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id); /** * Get the type of a gamepad, ignoring any mapping override. @@ -640,7 +640,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadInstanceType(SDL_Joyst * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstanceType + * \sa SDL_GetGamepadTypeFromID * \sa SDL_GetGamepads * \sa SDL_GetRealGamepadType */ @@ -660,7 +660,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_J * \sa SDL_GetGamepads * \sa SDL_GetGamepadMapping */ -extern SDL_DECLSPEC char *SDLCALL SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id); +extern SDL_DECLSPEC char *SDLCALL SDL_GetGamepadMappingFromID(SDL_JoystickID instance_id); /** * Open a gamepad for use. @@ -744,7 +744,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetGamepadProperties(SDL_Gamepa * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad *gamepad); +extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad); /** * Get the implementation-dependent name for an opened gamepad. @@ -758,7 +758,7 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadInstanceID(SDL_Gamepad * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstanceName + * \sa SDL_GetGamepadNameFromID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad); @@ -774,7 +774,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstancePath + * \sa SDL_GetGamepadPathFromID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad); @@ -787,7 +787,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstanceType + * \sa SDL_GetGamepadTypeFromID */ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *gamepad); @@ -843,7 +843,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstanceVendor + * \sa SDL_GetGamepadVendorFromID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad); @@ -857,7 +857,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstanceProduct + * \sa SDL_GetGamepadProductFromID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad); @@ -871,7 +871,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadInstanceProductVersion + * \sa SDL_GetGamepadProductVersionFromID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad); diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 9624e311aa4b3..40fa15a11d40f 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -961,7 +961,7 @@ extern SDL_DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count); * \sa SDL_GetHapticName * \sa SDL_OpenHaptic */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticInstanceName(SDL_HapticID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticNameFromID(SDL_HapticID instance_id); /** * Open a haptic device for use. @@ -1009,7 +1009,7 @@ extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromInstanceID(SDL_HapticID * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticInstanceID(SDL_Haptic *haptic); +extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic); /** * Get the implementation dependent name of a haptic device. @@ -1023,7 +1023,7 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticInstanceID(SDL_Haptic *hap * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetHapticInstanceName + * \sa SDL_GetHapticNameFromID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic); diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 31c4fc58b82c6..480f5a3d953dd 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -112,7 +112,7 @@ typedef Uint32 SDL_JoystickID; * * In some cases, SDL can identify a low-level joystick as being a certain * type of device, and will report it through SDL_GetJoystickType (or - * SDL_GetJoystickInstanceType). + * SDL_GetJoystickTypeFromID). * * This is by no means a complete list of everything that can be plugged into * a computer. @@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count); * \sa SDL_GetJoystickName * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameFromID(SDL_JoystickID instance_id); /** * Get the implementation dependent path of a joystick. @@ -256,7 +256,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickInstanceName(SDL_Joystick * \sa SDL_GetJoystickPath * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPathFromID(SDL_JoystickID instance_id); /** * Get the player index of a joystick. @@ -271,7 +271,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickInstancePath(SDL_Joystick * \sa SDL_GetJoystickPlayerIndex * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID instance_id); +extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexFromID(SDL_JoystickID instance_id); /** * Get the implementation-dependent GUID of a joystick. @@ -287,7 +287,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickInstancePlayerIndex(SDL_JoystickI * \sa SDL_GetJoystickGUID * \sa SDL_GetJoystickGUIDString */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickInstanceGUID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromID(SDL_JoystickID instance_id); /** * Get the USB vendor ID of a joystick, if available. @@ -304,7 +304,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickInstanceGUID(SDL_Joy * \sa SDL_GetJoystickVendor * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendorFromID(SDL_JoystickID instance_id); /** * Get the USB product ID of a joystick, if available. @@ -321,7 +321,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceVendor(SDL_JoystickID * \sa SDL_GetJoystickProduct * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductFromID(SDL_JoystickID instance_id); /** * Get the product version of a joystick, if available. @@ -338,7 +338,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProduct(SDL_JoystickID * \sa SDL_GetJoystickProductVersion * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersionFromID(SDL_JoystickID instance_id); /** * Get the type of a joystick, if available. @@ -355,7 +355,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickInstanceProductVersion(SDL_Joy * \sa SDL_GetJoystickType * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickInstanceType(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeFromID(SDL_JoystickID instance_id); /** * Open a joystick for use. @@ -674,7 +674,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceName + * \sa SDL_GetJoystickNameFromID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick); @@ -689,7 +689,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joysti * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstancePath + * \sa SDL_GetJoystickPathFromID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick); @@ -735,7 +735,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystic * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceGUID + * \sa SDL_GetJoystickGUIDFromID * \sa SDL_GetJoystickGUIDString */ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick); @@ -750,7 +750,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *j * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceVendor + * \sa SDL_GetJoystickVendorFromID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick); @@ -764,7 +764,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceProduct + * \sa SDL_GetJoystickProductFromID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick); @@ -778,7 +778,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceProductVersion + * \sa SDL_GetJoystickProductVersionFromID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick); @@ -818,7 +818,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joy * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceType + * \sa SDL_GetJoystickTypeFromID */ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick); @@ -835,7 +835,7 @@ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *j * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceGUID + * \sa SDL_GetJoystickGUIDFromID * \sa SDL_GetJoystickGUID * \sa SDL_GetJoystickGUIDFromString */ @@ -872,7 +872,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickInstanceGUID + * \sa SDL_GetJoystickGUIDFromID */ extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); @@ -896,7 +896,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_JoystickConnected(SDL_Joystick *joystic * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickInstanceID(SDL_Joystick *joystick); +extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetJoystickID(SDL_Joystick *joystick); /** * Get the number of general axis controls on a joystick. diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 84add35ea3484..de8c59fa8173d 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -325,7 +325,7 @@ #define SDL_JoystickGetSerial SDL_GetJoystickSerial #define SDL_JoystickGetType SDL_GetJoystickType #define SDL_JoystickGetVendor SDL_GetJoystickVendor -#define SDL_JoystickInstanceID SDL_GetJoystickInstanceID +#define SDL_JoystickInstanceID SDL_GetJoystickID #define SDL_JoystickIsVirtual SDL_IsJoystickVirtual #define SDL_JoystickName SDL_GetJoystickName #define SDL_JoystickNumAxes SDL_GetNumJoystickAxes @@ -566,7 +566,7 @@ #define SDL_SensorClose SDL_CloseSensor #define SDL_SensorFromInstanceID SDL_GetSensorFromInstanceID #define SDL_SensorGetData SDL_GetSensorData -#define SDL_SensorGetInstanceID SDL_GetSensorInstanceID +#define SDL_SensorGetInstanceID SDL_GetSensorID #define SDL_SensorGetName SDL_GetSensorName #define SDL_SensorGetNonPortableType SDL_GetSensorNonPortableType #define SDL_SensorGetType SDL_GetSensorType @@ -923,7 +923,7 @@ #define SDL_JoystickGetSerial SDL_JoystickGetSerial_renamed_SDL_GetJoystickSerial #define SDL_JoystickGetType SDL_JoystickGetType_renamed_SDL_GetJoystickType #define SDL_JoystickGetVendor SDL_JoystickGetVendor_renamed_SDL_GetJoystickVendor -#define SDL_JoystickInstanceID SDL_JoystickInstanceID_renamed_SDL_GetJoystickInstanceID +#define SDL_JoystickInstanceID SDL_JoystickInstanceID_renamed_SDL_GetJoystickID #define SDL_JoystickIsVirtual SDL_JoystickIsVirtual_renamed_SDL_IsJoystickVirtual #define SDL_JoystickName SDL_JoystickName_renamed_SDL_GetJoystickName #define SDL_JoystickNumAxes SDL_JoystickNumAxes_renamed_SDL_GetNumJoystickAxes @@ -1164,7 +1164,7 @@ #define SDL_SensorClose SDL_SensorClose_renamed_SDL_CloseSensor #define SDL_SensorFromInstanceID SDL_SensorFromInstanceID_renamed_SDL_GetSensorFromInstanceID #define SDL_SensorGetData SDL_SensorGetData_renamed_SDL_GetSensorData -#define SDL_SensorGetInstanceID SDL_SensorGetInstanceID_renamed_SDL_GetSensorInstanceID +#define SDL_SensorGetInstanceID SDL_SensorGetInstanceID_renamed_SDL_GetSensorID #define SDL_SensorGetName SDL_SensorGetName_renamed_SDL_GetSensorName #define SDL_SensorGetNonPortableType SDL_SensorGetNonPortableType_renamed_SDL_GetSensorNonPortableType #define SDL_SensorGetType SDL_SensorGetType_renamed_SDL_GetSensorType diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index d5124beee39f1..3c89b171c4808 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -158,6 +158,8 @@ extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count); /** * Get the implementation dependent name of a sensor. * + * This can be called before any sensors are opened. + * * The returned string follows the SDL_GetStringRule. * * \param instance_id the sensor instance ID. @@ -165,29 +167,33 @@ extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorInstanceName(SDL_SensorID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorNameFromID(SDL_SensorID instance_id); /** * Get the type of a sensor. * + * This can be called before any sensors are opened. + * * \param instance_id the sensor instance ID. * \returns the SDL_SensorType, or `SDL_SENSOR_INVALID` if `instance_id` is * not valid. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorInstanceType(SDL_SensorID instance_id); +extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorTypeFromID(SDL_SensorID instance_id); /** * Get the platform dependent type of a sensor. * + * This can be called before any sensors are opened. + * * \param instance_id the sensor instance ID. * \returns the sensor platform dependent type, or -1 if `instance_id` is not * valid. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_GetSensorInstanceNonPortableType(SDL_SensorID instance_id); +extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableTypeFromID(SDL_SensorID instance_id); /** * Open a sensor for use. @@ -261,7 +267,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor) * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorInstanceID(SDL_Sensor *sensor); +extern SDL_DECLSPEC SDL_SensorID SDLCALL SDL_GetSensorID(SDL_Sensor *sensor); /** * Get the current state of an opened sensor. diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index e1e0e3432d3a0..f7f7313ea68a4 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -242,26 +242,24 @@ SDL3_0.0.0 { SDL_GetGamepadFirmwareVersion; SDL_GetGamepadFromInstanceID; SDL_GetGamepadFromPlayerIndex; - SDL_GetGamepadInstanceGUID; - SDL_GetGamepadInstanceID; - SDL_GetGamepadInstanceMapping; - SDL_GetGamepadInstanceName; - SDL_GetGamepadInstancePath; - SDL_GetGamepadInstancePlayerIndex; - SDL_GetGamepadInstanceProduct; - SDL_GetGamepadInstanceProductVersion; - SDL_GetGamepadInstanceType; - SDL_GetGamepadInstanceVendor; + SDL_GetGamepadGUIDFromID; + SDL_GetGamepadID; SDL_GetGamepadJoystick; SDL_GetGamepadMapping; SDL_GetGamepadMappingForGUID; + SDL_GetGamepadMappingFromID; SDL_GetGamepadMappings; SDL_GetGamepadName; + SDL_GetGamepadNameFromID; SDL_GetGamepadPath; + SDL_GetGamepadPathFromID; SDL_GetGamepadPlayerIndex; + SDL_GetGamepadPlayerIndexFromID; SDL_GetGamepadPowerInfo; SDL_GetGamepadProduct; + SDL_GetGamepadProductFromID; SDL_GetGamepadProductVersion; + SDL_GetGamepadProductVersionFromID; SDL_GetGamepadProperties; SDL_GetGamepadSensorData; SDL_GetGamepadSensorDataRate; @@ -272,8 +270,10 @@ SDL3_0.0.0 { SDL_GetGamepadStringForType; SDL_GetGamepadTouchpadFinger; SDL_GetGamepadType; + SDL_GetGamepadTypeFromID; SDL_GetGamepadTypeFromString; SDL_GetGamepadVendor; + SDL_GetGamepadVendorFromID; SDL_GetGamepads; SDL_GetGlobalMouseState; SDL_GetGlobalProperties; @@ -281,9 +281,9 @@ SDL3_0.0.0 { SDL_GetHapticEffectStatus; SDL_GetHapticFeatures; SDL_GetHapticFromInstanceID; - SDL_GetHapticInstanceID; - SDL_GetHapticInstanceName; + SDL_GetHapticID; SDL_GetHapticName; + SDL_GetHapticNameFromID; SDL_GetHaptics; SDL_GetHint; SDL_GetHintBoolean; @@ -299,29 +299,29 @@ SDL3_0.0.0 { SDL_GetJoystickFromInstanceID; SDL_GetJoystickFromPlayerIndex; SDL_GetJoystickGUID; + SDL_GetJoystickGUIDFromID; SDL_GetJoystickGUIDFromString; SDL_GetJoystickGUIDInfo; SDL_GetJoystickGUIDString; SDL_GetJoystickHat; - SDL_GetJoystickInstanceGUID; - SDL_GetJoystickInstanceID; - SDL_GetJoystickInstanceName; - SDL_GetJoystickInstancePath; - SDL_GetJoystickInstancePlayerIndex; - SDL_GetJoystickInstanceProduct; - SDL_GetJoystickInstanceProductVersion; - SDL_GetJoystickInstanceType; - SDL_GetJoystickInstanceVendor; + SDL_GetJoystickID; SDL_GetJoystickName; + SDL_GetJoystickNameFromID; SDL_GetJoystickPath; + SDL_GetJoystickPathFromID; SDL_GetJoystickPlayerIndex; + SDL_GetJoystickPlayerIndexFromID; SDL_GetJoystickPowerInfo; SDL_GetJoystickProduct; + SDL_GetJoystickProductFromID; SDL_GetJoystickProductVersion; + SDL_GetJoystickProductVersionFromID; SDL_GetJoystickProperties; SDL_GetJoystickSerial; SDL_GetJoystickType; + SDL_GetJoystickTypeFromID; SDL_GetJoystickVendor; + SDL_GetJoystickVendorFromID; SDL_GetJoysticks; SDL_GetKeyFromName; SDL_GetKeyFromScancode; @@ -419,14 +419,14 @@ SDL3_0.0.0 { SDL_GetSemaphoreValue; SDL_GetSensorData; SDL_GetSensorFromInstanceID; - SDL_GetSensorInstanceID; - SDL_GetSensorInstanceName; - SDL_GetSensorInstanceNonPortableType; - SDL_GetSensorInstanceType; + SDL_GetSensorID; SDL_GetSensorName; + SDL_GetSensorNameFromID; SDL_GetSensorNonPortableType; + SDL_GetSensorNonPortableTypeFromID; SDL_GetSensorProperties; SDL_GetSensorType; + SDL_GetSensorTypeFromID; SDL_GetSensors; SDL_GetSilenceValueForFormat; SDL_GetStorageFileSize; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 80eb264dd0853..9f10794baf3fc 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -267,26 +267,24 @@ #define SDL_GetGamepadFirmwareVersion SDL_GetGamepadFirmwareVersion_REAL #define SDL_GetGamepadFromInstanceID SDL_GetGamepadFromInstanceID_REAL #define SDL_GetGamepadFromPlayerIndex SDL_GetGamepadFromPlayerIndex_REAL -#define SDL_GetGamepadInstanceGUID SDL_GetGamepadInstanceGUID_REAL -#define SDL_GetGamepadInstanceID SDL_GetGamepadInstanceID_REAL -#define SDL_GetGamepadInstanceMapping SDL_GetGamepadInstanceMapping_REAL -#define SDL_GetGamepadInstanceName SDL_GetGamepadInstanceName_REAL -#define SDL_GetGamepadInstancePath SDL_GetGamepadInstancePath_REAL -#define SDL_GetGamepadInstancePlayerIndex SDL_GetGamepadInstancePlayerIndex_REAL -#define SDL_GetGamepadInstanceProduct SDL_GetGamepadInstanceProduct_REAL -#define SDL_GetGamepadInstanceProductVersion SDL_GetGamepadInstanceProductVersion_REAL -#define SDL_GetGamepadInstanceType SDL_GetGamepadInstanceType_REAL -#define SDL_GetGamepadInstanceVendor SDL_GetGamepadInstanceVendor_REAL +#define SDL_GetGamepadGUIDFromID SDL_GetGamepadGUIDFromID_REAL +#define SDL_GetGamepadID SDL_GetGamepadID_REAL #define SDL_GetGamepadJoystick SDL_GetGamepadJoystick_REAL #define SDL_GetGamepadMapping SDL_GetGamepadMapping_REAL #define SDL_GetGamepadMappingForGUID SDL_GetGamepadMappingForGUID_REAL +#define SDL_GetGamepadMappingFromID SDL_GetGamepadMappingFromID_REAL #define SDL_GetGamepadMappings SDL_GetGamepadMappings_REAL #define SDL_GetGamepadName SDL_GetGamepadName_REAL +#define SDL_GetGamepadNameFromID SDL_GetGamepadNameFromID_REAL #define SDL_GetGamepadPath SDL_GetGamepadPath_REAL +#define SDL_GetGamepadPathFromID SDL_GetGamepadPathFromID_REAL #define SDL_GetGamepadPlayerIndex SDL_GetGamepadPlayerIndex_REAL +#define SDL_GetGamepadPlayerIndexFromID SDL_GetGamepadPlayerIndexFromID_REAL #define SDL_GetGamepadPowerInfo SDL_GetGamepadPowerInfo_REAL #define SDL_GetGamepadProduct SDL_GetGamepadProduct_REAL +#define SDL_GetGamepadProductFromID SDL_GetGamepadProductFromID_REAL #define SDL_GetGamepadProductVersion SDL_GetGamepadProductVersion_REAL +#define SDL_GetGamepadProductVersionFromID SDL_GetGamepadProductVersionFromID_REAL #define SDL_GetGamepadProperties SDL_GetGamepadProperties_REAL #define SDL_GetGamepadSensorData SDL_GetGamepadSensorData_REAL #define SDL_GetGamepadSensorDataRate SDL_GetGamepadSensorDataRate_REAL @@ -297,8 +295,10 @@ #define SDL_GetGamepadStringForType SDL_GetGamepadStringForType_REAL #define SDL_GetGamepadTouchpadFinger SDL_GetGamepadTouchpadFinger_REAL #define SDL_GetGamepadType SDL_GetGamepadType_REAL +#define SDL_GetGamepadTypeFromID SDL_GetGamepadTypeFromID_REAL #define SDL_GetGamepadTypeFromString SDL_GetGamepadTypeFromString_REAL #define SDL_GetGamepadVendor SDL_GetGamepadVendor_REAL +#define SDL_GetGamepadVendorFromID SDL_GetGamepadVendorFromID_REAL #define SDL_GetGamepads SDL_GetGamepads_REAL #define SDL_GetGlobalMouseState SDL_GetGlobalMouseState_REAL #define SDL_GetGlobalProperties SDL_GetGlobalProperties_REAL @@ -306,9 +306,9 @@ #define SDL_GetHapticEffectStatus SDL_GetHapticEffectStatus_REAL #define SDL_GetHapticFeatures SDL_GetHapticFeatures_REAL #define SDL_GetHapticFromInstanceID SDL_GetHapticFromInstanceID_REAL -#define SDL_GetHapticInstanceID SDL_GetHapticInstanceID_REAL -#define SDL_GetHapticInstanceName SDL_GetHapticInstanceName_REAL +#define SDL_GetHapticID SDL_GetHapticID_REAL #define SDL_GetHapticName SDL_GetHapticName_REAL +#define SDL_GetHapticNameFromID SDL_GetHapticNameFromID_REAL #define SDL_GetHaptics SDL_GetHaptics_REAL #define SDL_GetHint SDL_GetHint_REAL #define SDL_GetHintBoolean SDL_GetHintBoolean_REAL @@ -324,29 +324,29 @@ #define SDL_GetJoystickFromInstanceID SDL_GetJoystickFromInstanceID_REAL #define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL #define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL +#define SDL_GetJoystickGUIDFromID SDL_GetJoystickGUIDFromID_REAL #define SDL_GetJoystickGUIDFromString SDL_GetJoystickGUIDFromString_REAL #define SDL_GetJoystickGUIDInfo SDL_GetJoystickGUIDInfo_REAL #define SDL_GetJoystickGUIDString SDL_GetJoystickGUIDString_REAL #define SDL_GetJoystickHat SDL_GetJoystickHat_REAL -#define SDL_GetJoystickInstanceGUID SDL_GetJoystickInstanceGUID_REAL -#define SDL_GetJoystickInstanceID SDL_GetJoystickInstanceID_REAL -#define SDL_GetJoystickInstanceName SDL_GetJoystickInstanceName_REAL -#define SDL_GetJoystickInstancePath SDL_GetJoystickInstancePath_REAL -#define SDL_GetJoystickInstancePlayerIndex SDL_GetJoystickInstancePlayerIndex_REAL -#define SDL_GetJoystickInstanceProduct SDL_GetJoystickInstanceProduct_REAL -#define SDL_GetJoystickInstanceProductVersion SDL_GetJoystickInstanceProductVersion_REAL -#define SDL_GetJoystickInstanceType SDL_GetJoystickInstanceType_REAL -#define SDL_GetJoystickInstanceVendor SDL_GetJoystickInstanceVendor_REAL +#define SDL_GetJoystickID SDL_GetJoystickID_REAL #define SDL_GetJoystickName SDL_GetJoystickName_REAL +#define SDL_GetJoystickNameFromID SDL_GetJoystickNameFromID_REAL #define SDL_GetJoystickPath SDL_GetJoystickPath_REAL +#define SDL_GetJoystickPathFromID SDL_GetJoystickPathFromID_REAL #define SDL_GetJoystickPlayerIndex SDL_GetJoystickPlayerIndex_REAL +#define SDL_GetJoystickPlayerIndexFromID SDL_GetJoystickPlayerIndexFromID_REAL #define SDL_GetJoystickPowerInfo SDL_GetJoystickPowerInfo_REAL #define SDL_GetJoystickProduct SDL_GetJoystickProduct_REAL +#define SDL_GetJoystickProductFromID SDL_GetJoystickProductFromID_REAL #define SDL_GetJoystickProductVersion SDL_GetJoystickProductVersion_REAL +#define SDL_GetJoystickProductVersionFromID SDL_GetJoystickProductVersionFromID_REAL #define SDL_GetJoystickProperties SDL_GetJoystickProperties_REAL #define SDL_GetJoystickSerial SDL_GetJoystickSerial_REAL #define SDL_GetJoystickType SDL_GetJoystickType_REAL +#define SDL_GetJoystickTypeFromID SDL_GetJoystickTypeFromID_REAL #define SDL_GetJoystickVendor SDL_GetJoystickVendor_REAL +#define SDL_GetJoystickVendorFromID SDL_GetJoystickVendorFromID_REAL #define SDL_GetJoysticks SDL_GetJoysticks_REAL #define SDL_GetKeyFromName SDL_GetKeyFromName_REAL #define SDL_GetKeyFromScancode SDL_GetKeyFromScancode_REAL @@ -444,14 +444,14 @@ #define SDL_GetSemaphoreValue SDL_GetSemaphoreValue_REAL #define SDL_GetSensorData SDL_GetSensorData_REAL #define SDL_GetSensorFromInstanceID SDL_GetSensorFromInstanceID_REAL -#define SDL_GetSensorInstanceID SDL_GetSensorInstanceID_REAL -#define SDL_GetSensorInstanceName SDL_GetSensorInstanceName_REAL -#define SDL_GetSensorInstanceNonPortableType SDL_GetSensorInstanceNonPortableType_REAL -#define SDL_GetSensorInstanceType SDL_GetSensorInstanceType_REAL +#define SDL_GetSensorID SDL_GetSensorID_REAL #define SDL_GetSensorName SDL_GetSensorName_REAL +#define SDL_GetSensorNameFromID SDL_GetSensorNameFromID_REAL #define SDL_GetSensorNonPortableType SDL_GetSensorNonPortableType_REAL +#define SDL_GetSensorNonPortableTypeFromID SDL_GetSensorNonPortableTypeFromID_REAL #define SDL_GetSensorProperties SDL_GetSensorProperties_REAL #define SDL_GetSensorType SDL_GetSensorType_REAL +#define SDL_GetSensorTypeFromID SDL_GetSensorTypeFromID_REAL #define SDL_GetSensors SDL_GetSensors_REAL #define SDL_GetSilenceValueForFormat SDL_GetSilenceValueForFormat_REAL #define SDL_GetStorageFileSize SDL_GetStorageFileSize_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 1212c524ad052..8c17b541de28d 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -287,26 +287,24 @@ SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetGamepadConnectionState,(SDL_G SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadFirmwareVersion,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromInstanceID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromPlayerIndex,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadInstanceGUID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadInstanceID,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(char*,SDL_GetGamepadInstanceMapping,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetGamepadInstanceName,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetGamepadInstancePath,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetGamepadInstancePlayerIndex,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadInstanceProduct,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadInstanceProductVersion,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadInstanceType,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadInstanceVendor,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadID,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetGamepadJoystick,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_GetGamepadMapping,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForGUID,(SDL_JoystickGUID a),(a),return) +SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(char**,SDL_GetGamepadMappings,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadName,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadNameFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPath,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPathFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGamepadPlayerIndex,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetGamepadPlayerIndexFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetGamepadPowerInfo,(SDL_Gamepad *a, int *b),(a,b),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProduct,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersion,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersionFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGamepadProperties,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGamepadSensorData,(SDL_Gamepad *a, SDL_SensorType b, float *c, int d),(a,b,c,d),return) SDL_DYNAPI_PROC(float,SDL_GetGamepadSensorDataRate,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) @@ -317,8 +315,10 @@ SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForButton,(SDL_GamepadButton a), SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForType,(SDL_GamepadType a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGamepadTouchpadFinger,(SDL_Gamepad *a, int b, int c, Uint8 *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadType,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendor,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendorFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetGamepads,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetGlobalMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGlobalProperties,(void),(),return) @@ -326,9 +326,9 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetHapticEffectStatus,(SDL_Haptic *a, int b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_GetHapticFeatures,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromInstanceID,(SDL_HapticID a),(a),return) -SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticInstanceID,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetHapticInstanceName,(SDL_HapticID a),(a),return) +SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticID,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticName,(SDL_Haptic *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameFromID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID*,SDL_GetHaptics,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHint,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetHintBoolean,(const char *a, SDL_bool b),(a,b),return) @@ -344,29 +344,29 @@ SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),retu SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromInstanceID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetJoystickGUIDInfo,(SDL_JoystickGUID a, Uint16 *b, Uint16 *c, Uint16 *d, Uint16 *e),(a,b,c,d,e),) SDL_DYNAPI_PROC(int,SDL_GetJoystickGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickHat,(SDL_Joystick *a, int b),(a,b),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickInstanceGUID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickInstanceID,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetJoystickInstanceName,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetJoystickInstancePath,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetJoystickInstancePlayerIndex,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickInstanceProduct,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickInstanceProductVersion,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickInstanceType,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickInstanceVendor,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickID,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickName,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetJoystickNameFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPath,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPathFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetJoystickPlayerIndex,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetJoystickPlayerIndexFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetJoystickPowerInfo,(SDL_Joystick *a, int *b),(a,b),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProduct,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductVersion,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductVersionFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetJoystickProperties,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickSerial,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickType,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickTypeFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendorFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetJoysticks,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) @@ -464,14 +464,14 @@ SDL_DYNAPI_PROC(const char*,SDL_GetScancodeName,(SDL_Scancode a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetSemaphoreValue,(SDL_Semaphore *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromInstanceID,(SDL_SensorID a),(a),return) -SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorInstanceID,(SDL_Sensor *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetSensorInstanceName,(SDL_SensorID a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetSensorInstanceNonPortableType,(SDL_SensorID a),(a),return) -SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorInstanceType,(SDL_SensorID a),(a),return) +SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorID,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetSensorName,(SDL_Sensor *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetSensorNameFromID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableType,(SDL_Sensor *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableTypeFromID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSensorProperties,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorType,(SDL_Sensor *a),(a),return) +SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorTypeFromID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_SensorID*,SDL_GetSensors,(int *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetStorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return) diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 371dc342ea017..93a64219ca57e 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -92,7 +92,7 @@ SDL_HapticID *SDL_GetHaptics(int *count) return haptics; } -const char *SDL_GetHapticInstanceName(SDL_HapticID instance_id) +const char *SDL_GetHapticNameFromID(SDL_HapticID instance_id) { int device_index; const char *name = NULL; @@ -178,7 +178,7 @@ SDL_Haptic *SDL_GetHapticFromInstanceID(SDL_HapticID instance_id) return haptic; } -SDL_HapticID SDL_GetHapticInstanceID(SDL_Haptic *haptic) +SDL_HapticID SDL_GetHapticID(SDL_Haptic *haptic) { CHECK_HAPTIC_MAGIC(haptic, 0); @@ -222,7 +222,7 @@ SDL_bool SDL_IsJoystickHaptic(SDL_Joystick *joystick) { /* Must be a valid joystick */ if (SDL_IsJoystickValid(joystick) && - !SDL_IsGamepad(SDL_GetJoystickInstanceID(joystick))) { + !SDL_IsGamepad(SDL_GetJoystickID(joystick))) { result = SDL_SYS_JoystickIsHaptic(joystick); } } @@ -246,7 +246,7 @@ SDL_Haptic *SDL_OpenHapticFromJoystick(SDL_Joystick *joystick) } /* Joystick must be haptic */ - if (SDL_IsGamepad(SDL_GetJoystickInstanceID(joystick)) || + if (SDL_IsGamepad(SDL_GetJoystickID(joystick)) || SDL_SYS_JoystickIsHaptic(joystick) <= 0) { SDL_SetError("Haptic: Joystick isn't a haptic device."); SDL_UnlockJoysticks(); diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index bf1c5b35a6062..d41413b11fed0 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -1778,8 +1778,8 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id SDL_AssertJoysticksLocked(); - name = SDL_GetJoystickInstanceName(instance_id); - guid = SDL_GetJoystickInstanceGUID(instance_id); + name = SDL_GetJoystickNameFromID(instance_id); + guid = SDL_GetJoystickGUIDFromID(instance_id); mapping = SDL_PrivateGetGamepadMappingForNameAndGUID(name, guid); if (!mapping && create_mapping) { SDL_GamepadMapping raw_map; @@ -2246,7 +2246,7 @@ char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) */ int SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping) { - SDL_JoystickGUID guid = SDL_GetJoystickInstanceGUID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); int retval = -1; if (SDL_memcmp(&guid, &s_zeroGUID, sizeof(guid)) == 0) { @@ -2420,7 +2420,7 @@ SDL_JoystickID *SDL_GetGamepads(int *count) return joysticks; } -const char *SDL_GetGamepadInstanceName(SDL_JoystickID instance_id) +const char *SDL_GetGamepadNameFromID(SDL_JoystickID instance_id) { const char *retval = NULL; @@ -2429,7 +2429,7 @@ const char *SDL_GetGamepadInstanceName(SDL_JoystickID instance_id) GamepadMapping_t *mapping = SDL_PrivateGetGamepadMapping(instance_id, SDL_TRUE); if (mapping) { if (SDL_strcmp(mapping->name, "*") == 0) { - retval = SDL_GetJoystickInstanceName(instance_id); + retval = SDL_GetJoystickNameFromID(instance_id); } else { retval = mapping->name; } @@ -2440,37 +2440,37 @@ const char *SDL_GetGamepadInstanceName(SDL_JoystickID instance_id) return retval; } -const char *SDL_GetGamepadInstancePath(SDL_JoystickID instance_id) +const char *SDL_GetGamepadPathFromID(SDL_JoystickID instance_id) { - return SDL_GetJoystickInstancePath(instance_id); + return SDL_GetJoystickPathFromID(instance_id); } -int SDL_GetGamepadInstancePlayerIndex(SDL_JoystickID instance_id) +int SDL_GetGamepadPlayerIndexFromID(SDL_JoystickID instance_id) { - return SDL_GetJoystickInstancePlayerIndex(instance_id); + return SDL_GetJoystickPlayerIndexFromID(instance_id); } -SDL_JoystickGUID SDL_GetGamepadInstanceGUID(SDL_JoystickID instance_id) +SDL_JoystickGUID SDL_GetGamepadGUIDFromID(SDL_JoystickID instance_id) { - return SDL_GetJoystickInstanceGUID(instance_id); + return SDL_GetJoystickGUIDFromID(instance_id); } -Uint16 SDL_GetGamepadInstanceVendor(SDL_JoystickID instance_id) +Uint16 SDL_GetGamepadVendorFromID(SDL_JoystickID instance_id) { - return SDL_GetJoystickInstanceVendor(instance_id); + return SDL_GetJoystickVendorFromID(instance_id); } -Uint16 SDL_GetGamepadInstanceProduct(SDL_JoystickID instance_id) +Uint16 SDL_GetGamepadProductFromID(SDL_JoystickID instance_id) { - return SDL_GetJoystickInstanceProduct(instance_id); + return SDL_GetJoystickProductFromID(instance_id); } -Uint16 SDL_GetGamepadInstanceProductVersion(SDL_JoystickID instance_id) +Uint16 SDL_GetGamepadProductVersionFromID(SDL_JoystickID instance_id) { - return SDL_GetJoystickInstanceProductVersion(instance_id); + return SDL_GetJoystickProductVersionFromID(instance_id); } -SDL_GamepadType SDL_GetGamepadInstanceType(SDL_JoystickID instance_id) +SDL_GamepadType SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id) { SDL_GamepadType type = SDL_GAMEPAD_TYPE_UNKNOWN; @@ -2507,11 +2507,11 @@ SDL_GamepadType SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id) SDL_LockJoysticks(); { - info = SDL_GetJoystickInstanceVirtualGamepadInfo(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); if (info) { type = info->type; } else { - type = SDL_GetGamepadTypeFromGUID(SDL_GetJoystickInstanceGUID(instance_id), SDL_GetJoystickInstanceName(instance_id)); + type = SDL_GetGamepadTypeFromGUID(SDL_GetJoystickGUIDFromID(instance_id), SDL_GetJoystickNameFromID(instance_id)); } } SDL_UnlockJoysticks(); @@ -2519,7 +2519,7 @@ SDL_GamepadType SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id) return type; } -char *SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id) +char *SDL_GetGamepadMappingFromID(SDL_JoystickID instance_id) { char *retval = NULL; @@ -2528,7 +2528,7 @@ char *SDL_GetGamepadInstanceMapping(SDL_JoystickID instance_id) GamepadMapping_t *mapping = SDL_PrivateGetGamepadMapping(instance_id, SDL_TRUE); if (mapping) { char pchGUID[33]; - const SDL_JoystickGUID guid = SDL_GetJoystickInstanceGUID(instance_id); + const SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID)); SDL_asprintf(&retval, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); } @@ -3272,14 +3272,14 @@ int SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *d return SDL_Unsupported(); } -SDL_JoystickID SDL_GetGamepadInstanceID(SDL_Gamepad *gamepad) +SDL_JoystickID SDL_GetGamepadID(SDL_Gamepad *gamepad) { SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad); if (!joystick) { return 0; } - return SDL_GetJoystickInstanceID(joystick); + return SDL_GetJoystickID(joystick); } SDL_PropertiesID SDL_GetGamepadProperties(SDL_Gamepad *gamepad) @@ -3336,7 +3336,7 @@ SDL_GamepadType SDL_GetGamepadType(SDL_Gamepad *gamepad) { CHECK_GAMEPAD_MAGIC(gamepad, SDL_GAMEPAD_TYPE_UNKNOWN); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(gamepad->joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(gamepad->joystick->instance_id); if (info) { type = info->type; } else { diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 15ee1e44f682e..a424b06bd1f42 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -754,7 +754,7 @@ SDL_JoystickID *SDL_GetJoysticks(int *count) return joysticks; } -const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickID instance_id) +const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoFromID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -770,7 +770,7 @@ const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickInstanceVirtualGamepadInfo(SDL /* * Get the implementation dependent name of a joystick */ -const char *SDL_GetJoystickInstanceName(SDL_JoystickID instance_id) +const char *SDL_GetJoystickNameFromID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -778,7 +778,7 @@ const char *SDL_GetJoystickInstanceName(SDL_JoystickID instance_id) const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); if (info) { name = info->name; } else if (SDL_GetDriverAndJoystickIndex(instance_id, &driver, &device_index)) { @@ -792,7 +792,7 @@ const char *SDL_GetJoystickInstanceName(SDL_JoystickID instance_id) /* * Get the implementation dependent path of a joystick */ -const char *SDL_GetJoystickInstancePath(SDL_JoystickID instance_id) +const char *SDL_GetJoystickPathFromID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -813,7 +813,7 @@ const char *SDL_GetJoystickInstancePath(SDL_JoystickID instance_id) /* * Get the player index of a joystick, or -1 if it's not available */ -int SDL_GetJoystickInstancePlayerIndex(SDL_JoystickID instance_id) +int SDL_GetJoystickPlayerIndexFromID(SDL_JoystickID instance_id) { int player_index; @@ -864,14 +864,14 @@ static SDL_bool IsROGAlly(SDL_Joystick *joystick) for (i = 0; sensors[i]; ++i) { SDL_SensorID sensor = sensors[i]; - if (!has_ally_accel && SDL_GetSensorInstanceType(sensor) == SDL_SENSOR_ACCEL) { - const char *sensor_name = SDL_GetSensorInstanceName(sensor); + if (!has_ally_accel && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_ACCEL) { + const char *sensor_name = SDL_GetSensorNameFromID(sensor); if (sensor_name && SDL_strcmp(sensor_name, "Sensor BMI320 Acc") == 0) { has_ally_accel = SDL_TRUE; } } - if (!has_ally_gyro && SDL_GetSensorInstanceType(sensor) == SDL_SENSOR_GYRO) { - const char *sensor_name = SDL_GetSensorInstanceName(sensor); + if (!has_ally_gyro && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_GYRO) { + const char *sensor_name = SDL_GetSensorNameFromID(sensor); if (sensor_name && SDL_strcmp(sensor_name, "Sensor BMI320 Gyr") == 0) { has_ally_gyro = SDL_TRUE; } @@ -966,14 +966,14 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, SDL_bool invert_sensors) for (i = 0; sensors[i]; ++i) { SDL_SensorID sensor = sensors[i]; - if (!joystick->accel_sensor && SDL_GetSensorInstanceType(sensor) == SDL_SENSOR_ACCEL) { + if (!joystick->accel_sensor && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_ACCEL) { /* Increment the sensor subsystem reference count */ SDL_InitSubSystem(SDL_INIT_SENSOR); joystick->accel_sensor = sensor; SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 0.0f); } - if (!joystick->gyro_sensor && SDL_GetSensorInstanceType(sensor) == SDL_SENSOR_GYRO) { + if (!joystick->gyro_sensor && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_GYRO) { /* Increment the sensor subsystem reference count */ SDL_InitSubSystem(SDL_INIT_SENSOR); @@ -1151,7 +1151,7 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id) } /* Get the Steam Input API handle */ - info = SDL_GetJoystickInstanceVirtualGamepadInfo(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); if (info) { joystick->steam_handle = info->handle; } @@ -1567,7 +1567,7 @@ SDL_bool SDL_JoystickConnected(SDL_Joystick *joystick) /* * Get the instance id for this opened joystick */ -SDL_JoystickID SDL_GetJoystickInstanceID(SDL_Joystick *joystick) +SDL_JoystickID SDL_GetJoystickID(SDL_Joystick *joystick) { SDL_JoystickID retval; @@ -1651,7 +1651,7 @@ const char *SDL_GetJoystickName(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, NULL); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); if (info) { retval = info->name; } else { @@ -2362,7 +2362,7 @@ static void SendSteamHandleUpdateEvents(void) continue; } - info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); if (info) { if (joystick->steam_handle != info->handle) { joystick->steam_handle = info->handle; @@ -3258,7 +3258,7 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) } /* return the guid for this index */ -SDL_JoystickGUID SDL_GetJoystickInstanceGUID(SDL_JoystickID instance_id) +SDL_JoystickGUID SDL_GetJoystickGUIDFromID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -3275,17 +3275,17 @@ SDL_JoystickGUID SDL_GetJoystickInstanceGUID(SDL_JoystickID instance_id) return guid; } -Uint16 SDL_GetJoystickInstanceVendor(SDL_JoystickID instance_id) +Uint16 SDL_GetJoystickVendorFromID(SDL_JoystickID instance_id) { Uint16 vendor; const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); if (info) { vendor = info->vendor_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickInstanceGUID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); } @@ -3294,17 +3294,17 @@ Uint16 SDL_GetJoystickInstanceVendor(SDL_JoystickID instance_id) return vendor; } -Uint16 SDL_GetJoystickInstanceProduct(SDL_JoystickID instance_id) +Uint16 SDL_GetJoystickProductFromID(SDL_JoystickID instance_id) { Uint16 product; const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); if (info) { product = info->product_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickInstanceGUID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); } @@ -3313,19 +3313,19 @@ Uint16 SDL_GetJoystickInstanceProduct(SDL_JoystickID instance_id) return product; } -Uint16 SDL_GetJoystickInstanceProductVersion(SDL_JoystickID instance_id) +Uint16 SDL_GetJoystickProductVersionFromID(SDL_JoystickID instance_id) { Uint16 version; - SDL_JoystickGUID guid = SDL_GetJoystickInstanceGUID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL); return version; } -SDL_JoystickType SDL_GetJoystickInstanceType(SDL_JoystickID instance_id) +SDL_JoystickType SDL_GetJoystickTypeFromID(SDL_JoystickID instance_id) { SDL_JoystickType type; - SDL_JoystickGUID guid = SDL_GetJoystickInstanceGUID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); type = SDL_GetJoystickGUIDType(guid); if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { @@ -3362,7 +3362,7 @@ Uint16 SDL_GetJoystickVendor(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, 0); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); if (info) { vendor = info->vendor_id; } else { @@ -3385,7 +3385,7 @@ Uint16 SDL_GetJoystickProduct(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, 0); - info = SDL_GetJoystickInstanceVirtualGamepadInfo(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); if (info) { product = info->product_id; } else { diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index ba99b012c8e2a..ea483aa1d1e4f 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -170,7 +170,7 @@ extern int SDL_SendJoystickSensor(Uint64 timestamp, SDL_Joystick *joystick, SDL_ extern void SDL_SendJoystickPowerInfo(SDL_Joystick *joystick, SDL_PowerState state, int percent); /* Function to get the Steam virtual gamepad info for a joystick */ -extern const struct SDL_SteamVirtualGamepadInfo *SDL_GetJoystickInstanceVirtualGamepadInfo(SDL_JoystickID instance_id); +extern const struct SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoFromID(SDL_JoystickID instance_id); /* Internal sanity checking functions */ extern SDL_bool SDL_IsJoystickValid(SDL_Joystick *joystick); diff --git a/src/joystick/vita/SDL_sysjoystick.c b/src/joystick/vita/SDL_sysjoystick.c index fcd4f26aadaee..0273ded9ee593 100644 --- a/src/joystick/vita/SDL_sysjoystick.c +++ b/src/joystick/vita/SDL_sysjoystick.c @@ -234,7 +234,7 @@ static void VITA_JoystickUpdate(SDL_Joystick *joystick) SceCtrlData *pad = NULL; Uint64 timestamp = SDL_GetTicksNS(); - int index = (int)SDL_GetJoystickInstanceID(joystick) - 1; + int index = (int)SDL_GetJoystickID(joystick) - 1; if (index == 0) pad = &pad0; @@ -327,7 +327,7 @@ static SDL_JoystickGUID VITA_JoystickGetDeviceGUID(int device_index) static int VITA_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble) { - int index = (int)SDL_GetJoystickInstanceID(joystick) - 1; + int index = (int)SDL_GetJoystickID(joystick) - 1; SceCtrlActuator act; if (index < 0 || index > 3) { @@ -349,7 +349,7 @@ static int VITA_JoystickRumbleTriggers(SDL_Joystick *joystick, Uint16 left, Uint static int VITA_JoystickSetLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue) { - int index = (int)SDL_GetJoystickInstanceID(joystick) - 1; + int index = (int)SDL_GetJoystickID(joystick) - 1; if (index < 0 || index > 3) { return -1; } diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index e584788f10e43..85594d8527e34 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -238,7 +238,7 @@ static SDL_bool SDL_GetDriverAndSensorIndex(SDL_SensorID instance_id, SDL_Sensor /* * Get the implementation dependent name of a sensor */ -const char *SDL_GetSensorInstanceName(SDL_SensorID instance_id) +const char *SDL_GetSensorNameFromID(SDL_SensorID instance_id) { SDL_SensorDriver *driver; int device_index; @@ -253,7 +253,7 @@ const char *SDL_GetSensorInstanceName(SDL_SensorID instance_id) return name ? SDL_FreeLater(SDL_strdup(name)) : NULL; } -SDL_SensorType SDL_GetSensorInstanceType(SDL_SensorID instance_id) +SDL_SensorType SDL_GetSensorTypeFromID(SDL_SensorID instance_id) { SDL_SensorDriver *driver; int device_index; @@ -268,7 +268,7 @@ SDL_SensorType SDL_GetSensorInstanceType(SDL_SensorID instance_id) return type; } -int SDL_GetSensorInstanceNonPortableType(SDL_SensorID instance_id) +int SDL_GetSensorNonPortableTypeFromID(SDL_SensorID instance_id) { SDL_SensorDriver *driver; int device_index; @@ -453,7 +453,7 @@ int SDL_GetSensorNonPortableType(SDL_Sensor *sensor) /* * Get the instance id for this opened sensor */ -SDL_SensorID SDL_GetSensorInstanceID(SDL_Sensor *sensor) +SDL_SensorID SDL_GetSensorID(SDL_Sensor *sensor) { SDL_SensorID retval; diff --git a/test/testautomation_joystick.c b/test/testautomation_joystick.c index 9e9fdd297eaf1..a97ce55c7b41c 100644 --- a/test/testautomation_joystick.c +++ b/test/testautomation_joystick.c @@ -61,7 +61,7 @@ static int TestVirtualJoystick(void *arg) SDL_UpdateJoysticks(); SDLTest_AssertCheck(SDL_GetJoystickButton(joystick, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_RELEASED, "SDL_GetJoystickButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_RELEASED"); - gamepad = SDL_OpenGamepad(SDL_GetJoystickInstanceID(joystick)); + gamepad = SDL_OpenGamepad(SDL_GetJoystickID(joystick)); SDLTest_AssertCheck(gamepad != NULL, "SDL_OpenGamepad() succeeded"); if (gamepad) { SDLTest_AssertCheck(SDL_strcmp(SDL_GetGamepadName(gamepad), desc.name) == 0, "SDL_GetGamepadName()"); @@ -69,7 +69,7 @@ static int TestVirtualJoystick(void *arg) SDLTest_AssertCheck(SDL_GetGamepadProduct(gamepad) == desc.product_id, "SDL_GetGamepadProduct()"); /* Set an explicit mapping with a different name */ - SDL_SetGamepadMapping(SDL_GetJoystickInstanceID(joystick), "ff0013db5669727475616c2043007601,Virtual Gamepad,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); + SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual Gamepad,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetGamepadName(gamepad), "Virtual Gamepad") == 0, "SDL_GetGamepadName() == Virtual Gamepad"); SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_A, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_A"); @@ -83,7 +83,7 @@ static int TestVirtualJoystick(void *arg) SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_RELEASED, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_RELEASED"); /* Set an explicit mapping with legacy Nintendo style buttons */ - SDL_SetGamepadMapping(SDL_GetJoystickInstanceID(joystick), "ff0013db5669727475616c2043007601,Virtual Nintendo Gamepad,a:b1,b:b0,x:b3,y:b2,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,"); + SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual Nintendo Gamepad,a:b1,b:b0,x:b3,y:b2,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetGamepadName(gamepad), "Virtual Nintendo Gamepad") == 0, "SDL_GetGamepadName() == Virtual Nintendo Gamepad"); SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_B"); @@ -97,7 +97,7 @@ static int TestVirtualJoystick(void *arg) SDLTest_AssertCheck(SDL_GetGamepadButton(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_RELEASED, "SDL_GetGamepadButton(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_RELEASED"); /* Set an explicit mapping with PS4 style buttons */ - SDL_SetGamepadMapping(SDL_GetJoystickInstanceID(joystick), "ff0013db5669727475616c2043007601,Virtual PS4 Gamepad,type:ps4,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); + SDL_SetGamepadMapping(SDL_GetJoystickID(joystick), "ff0013db5669727475616c2043007601,Virtual PS4 Gamepad,type:ps4,a:b0,b:b1,x:b2,y:b3,back:b4,guide:b5,start:b6,leftstick:b7,rightstick:b8,leftshoulder:b9,rightshoulder:b10,dpup:b11,dpdown:b12,dpleft:b13,dpright:b14,misc1:b15,paddle1:b16,paddle2:b17,paddle3:b18,paddle4:b19,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5,"); SDLTest_AssertCheck(SDL_strcmp(SDL_GetGamepadName(gamepad), "Virtual PS4 Gamepad") == 0, "SDL_GetGamepadName() == Virtual PS4 Gamepad"); SDLTest_AssertCheck(SDL_GetGamepadButtonLabel(gamepad, SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_CROSS, "SDL_GetGamepadButtonLabel(SDL_GAMEPAD_BUTTON_SOUTH) == SDL_GAMEPAD_BUTTON_LABEL_CROSS"); diff --git a/test/testcontroller.c b/test/testcontroller.c index 5c50d21f65fa3..7ab21e94174b8 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -1371,7 +1371,7 @@ static void DrawGamepadInfo(SDL_Renderer *renderer) } if (controller->joystick) { - SDL_snprintf(text, sizeof(text), "(%" SDL_PRIu32 ")", SDL_GetJoystickInstanceID(controller->joystick)); + SDL_snprintf(text, sizeof(text), "(%" SDL_PRIu32 ")", SDL_GetJoystickID(controller->joystick)); x = SCREEN_WIDTH - (FONT_CHARACTER_SIZE * SDL_strlen(text)) - 8.0f; y = 8.0f; SDLTest_DrawString(renderer, x, y, text); diff --git a/test/testhaptic.c b/test/testhaptic.c index 14a085802c753..077383f3bd461 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -86,7 +86,7 @@ int main(int argc, char **argv) haptics = SDL_GetHaptics(&num_haptics); SDL_Log("%d Haptic devices detected.\n", num_haptics); for (i = 0; i < num_haptics; ++i) { - SDL_Log(" %s\n", SDL_GetHapticInstanceName(haptics[i])); + SDL_Log(" %s\n", SDL_GetHapticNameFromID(haptics[i])); } if (haptics) { if (num_haptics == 0) { @@ -108,7 +108,7 @@ int main(int argc, char **argv) /* Try to find matching device */ else { for (i = 0; i < num_haptics; i++) { - if (SDL_strstr(SDL_GetHapticInstanceName(haptics[i]), name) != NULL) { + if (SDL_strstr(SDL_GetHapticNameFromID(haptics[i]), name) != NULL) { break; } } diff --git a/test/testrumble.c b/test/testrumble.c index 44f5b9cbf1737..e2d4c63166263 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -109,7 +109,7 @@ int main(int argc, char **argv) /* Try to find matching device */ else { for (i = 0; i < num_haptics; i++) { - if (SDL_strstr(SDL_GetHapticInstanceName(haptics[i]), name) != NULL) { + if (SDL_strstr(SDL_GetHapticNameFromID(haptics[i]), name) != NULL) { break; } } diff --git a/test/testsensor.c b/test/testsensor.c index a5b715e663e27..c1f81dfa09dfa 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -91,11 +91,11 @@ int main(int argc, char **argv) for (i = 0; i < num_sensors; ++i) { SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %s, platform type %d\n", sensors[i], - SDL_GetSensorInstanceName(sensors[i]), - GetSensorTypeString(SDL_GetSensorInstanceType(sensors[i])), - SDL_GetSensorInstanceNonPortableType(sensors[i])); + SDL_GetSensorNameFromID(sensors[i]), + GetSensorTypeString(SDL_GetSensorTypeFromID(sensors[i])), + SDL_GetSensorNonPortableTypeFromID(sensors[i])); - if (SDL_GetSensorInstanceType(sensors[i]) != SDL_SENSOR_UNKNOWN) { + if (SDL_GetSensorTypeFromID(sensors[i]) != SDL_SENSOR_UNKNOWN) { SDL_Sensor *sensor = SDL_OpenSensor(sensors[i]); if (!sensor) { SDL_Log("Couldn't open sensor %" SDL_PRIu32 ": %s\n", sensors[i], SDL_GetError()); From e290e99d89f0ba776ce73d2a51abca0160ebdc85 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 08:51:43 -0700 Subject: [PATCH 299/431] Fixed error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'unsigned int' --- test/testautomation_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 50849c8ca9562..5a4c32b3e1030 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -742,7 +742,7 @@ static int video_getWindowPixelFormat(void *arg) /* Get format */ format = SDL_GetWindowPixelFormat(window); SDLTest_AssertPass("Call to SDL_GetWindowPixelFormat()"); - SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != %d, got: %" SDL_PRIu32, SDL_PIXELFORMAT_UNKNOWN, format); + SDLTest_AssertCheck(format != SDL_PIXELFORMAT_UNKNOWN, "Verify that returned format is valid; expected: != SDL_PIXELFORMAT_UNKNOWN, got: SDL_PIXELFORMAT_UNKNOWN"); /* Clean up */ destroyVideoSuiteTestWindow(window); From cb395f7e8056ea9445c2b673510b45b8a58a6084 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 09:37:31 -0700 Subject: [PATCH 300/431] Change SDL_AudioFormat into an enum This makes it easier to understand in the debugger, and is consistent with SDL_PixelFormat and SDL_Colorspace --- include/SDL3/SDL_audio.h | 66 ++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index a8356ce5e671d..f1d7b394c756b 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -102,27 +102,19 @@ extern "C" { #endif +/* masks for different parts of SDL_AudioFormat. */ +#define SDL_AUDIO_MASK_BITSIZE (0xFFu) +#define SDL_AUDIO_MASK_FLOAT (1u<<8) +#define SDL_AUDIO_MASK_BIG_ENDIAN (1u<<12) +#define SDL_AUDIO_MASK_SIGNED (1u<<15) + +#define SDL_DEFINE_AUDIO_FORMAT(signed, bigendian, float, size) \ + (((Uint16)(signed) << 15) | ((Uint16)(bigendian) << 12) | ((Uint16)(float) << 8) | ((size) & SDL_AUDIO_MASK_BITSIZE)) + /** - * Audio format flags. - * - * These are what the 16 bits in SDL_AudioFormat currently mean... - * (Unspecified bits are always zero). - * - * ``` - * ++-----------------------sample is signed if set - * || - * || ++-----------sample is bigendian if set - * || || - * || || ++---sample is float if set - * || || || - * || || || +=--sample bit size--++ - * || || || || || - * 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 - * ``` + * Audio format. * - * There are macros to query these bits. - * - * \since This datatype is available since SDL 3.0.0. + * \since This enum is available since SDL 3.0.0. * * \sa SDL_AUDIO_BITSIZE * \sa SDL_AUDIO_BYTESIZE @@ -133,16 +125,25 @@ extern "C" { * \sa SDL_AUDIO_ISSIGNED * \sa SDL_AUDIO_ISUNSIGNED */ -typedef Uint16 SDL_AudioFormat; - -#define SDL_AUDIO_U8 0x0008u /**< Unsigned 8-bit samples */ -#define SDL_AUDIO_S8 0x8008u /**< Signed 8-bit samples */ -#define SDL_AUDIO_S16LE 0x8010u /**< Signed 16-bit samples */ -#define SDL_AUDIO_S16BE 0x9010u /**< As above, but big-endian byte order */ -#define SDL_AUDIO_S32LE 0x8020u /**< 32-bit integer samples */ -#define SDL_AUDIO_S32BE 0x9020u /**< As above, but big-endian byte order */ -#define SDL_AUDIO_F32LE 0x8120u /**< 32-bit floating point samples */ -#define SDL_AUDIO_F32BE 0x9120u /**< As above, but big-endian byte order */ +typedef enum SDL_AudioFormat +{ + SDL_AUDIO_U8 = 0x0008u, /**< Unsigned 8-bit samples */ + /* SDL_DEFINE_AUDIO_FORMAT(0, 0, 0, 8), */ + SDL_AUDIO_S8 = 0x8008u, /**< Signed 8-bit samples */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 8), */ + SDL_AUDIO_S16LE = 0x8010u, /**< Signed 16-bit samples */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 16), */ + SDL_AUDIO_S16BE = 0x9010u, /**< As above, but big-endian byte order */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 1, 0, 16), */ + SDL_AUDIO_S32LE = 0x8020u, /**< 32-bit integer samples */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 0, 0, 32), */ + SDL_AUDIO_S32BE = 0x9020u, /**< As above, but big-endian byte order */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 1, 0, 32), */ + SDL_AUDIO_F32LE = 0x8120u, /**< 32-bit floating point samples */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 0, 1, 32), */ + SDL_AUDIO_F32BE = 0x9120u, /**< As above, but big-endian byte order */ + /* SDL_DEFINE_AUDIO_FORMAT(1, 1, 1, 32), */ +} SDL_AudioFormat; #if SDL_BYTEORDER == SDL_LIL_ENDIAN #define SDL_AUDIO_S16 SDL_AUDIO_S16LE @@ -155,13 +156,6 @@ typedef Uint16 SDL_AudioFormat; #endif -/* masks for different parts of SDL_AudioFormat. */ -#define SDL_AUDIO_MASK_BITSIZE (0xFFu) -#define SDL_AUDIO_MASK_FLOAT (1u<<8) -#define SDL_AUDIO_MASK_BIG_ENDIAN (1u<<12) -#define SDL_AUDIO_MASK_SIGNED (1u<<15) - - /** * Retrieve the size, in bits, from an SDL_AudioFormat. * From 1fecef5e4b8c395a07fbde2ff0bd50e0454ed64f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 10:43:00 -0700 Subject: [PATCH 301/431] Assign numeric values to pixel format enums This makes it easier to generate language bindings for these. --- include/SDL3/SDL_pixels.h | 516 ++++++++++++++++------------------- test/testautomation_pixels.c | 144 ++++++++++ 2 files changed, 376 insertions(+), 284 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 4213cd4c83431..809f29f36b9ca 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -225,210 +225,157 @@ typedef enum SDL_PackedLayout */ typedef enum SDL_PixelFormat { - SDL_PIXELFORMAT_UNKNOWN, - SDL_PIXELFORMAT_INDEX1LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX1MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, - 1, 0), - SDL_PIXELFORMAT_INDEX2LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, - 2, 0), - SDL_PIXELFORMAT_INDEX2MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, - 2, 0), - SDL_PIXELFORMAT_INDEX4LSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX4MSB = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, - 4, 0), - SDL_PIXELFORMAT_INDEX8 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), - SDL_PIXELFORMAT_RGB332 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_332, 8, 1), - SDL_PIXELFORMAT_XRGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_XBGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_4444, 12, 2), - SDL_PIXELFORMAT_XRGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_XBGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_1555, 15, 2), - SDL_PIXELFORMAT_ARGB4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_RGBA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ABGR4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_BGRA4444 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_4444, 16, 2), - SDL_PIXELFORMAT_ARGB1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_RGBA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_ABGR1555 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_1555, 16, 2), - SDL_PIXELFORMAT_BGRA5551 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_5551, 16, 2), - SDL_PIXELFORMAT_RGB565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_BGR565 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_565, 16, 2), - SDL_PIXELFORMAT_RGB24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, - 24, 3), - SDL_PIXELFORMAT_BGR24 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, - 24, 3), - SDL_PIXELFORMAT_XRGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_RGBX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_XBGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_BGRX8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, - SDL_PACKEDLAYOUT_8888, 24, 4), - SDL_PIXELFORMAT_ARGB8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_RGBA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_ABGR8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_BGRA8888 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, - SDL_PACKEDLAYOUT_8888, 32, 4), - SDL_PIXELFORMAT_XRGB2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, - SDL_PACKEDLAYOUT_2101010, 32, 4), - SDL_PIXELFORMAT_XBGR2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, - SDL_PACKEDLAYOUT_2101010, 32, 4), - SDL_PIXELFORMAT_ARGB2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, - SDL_PACKEDLAYOUT_2101010, 32, 4), - SDL_PIXELFORMAT_ABGR2101010 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, - SDL_PACKEDLAYOUT_2101010, 32, 4), - SDL_PIXELFORMAT_RGB48 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGB, 0, - 48, 6), - SDL_PIXELFORMAT_BGR48 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGR, 0, - 48, 6), - SDL_PIXELFORMAT_RGBA64 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGBA, 0, - 64, 8), - SDL_PIXELFORMAT_ARGB64 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ARGB, 0, - 64, 8), - SDL_PIXELFORMAT_BGRA64 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGRA, 0, - 64, 8), - SDL_PIXELFORMAT_ABGR64 = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ABGR, 0, - 64, 8), - SDL_PIXELFORMAT_RGB48_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGB, 0, - 48, 6), - SDL_PIXELFORMAT_BGR48_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGR, 0, - 48, 6), - SDL_PIXELFORMAT_RGBA64_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGBA, 0, - 64, 8), - SDL_PIXELFORMAT_ARGB64_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ARGB, 0, - 64, 8), - SDL_PIXELFORMAT_BGRA64_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGRA, 0, - 64, 8), - SDL_PIXELFORMAT_ABGR64_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ABGR, 0, - 64, 8), - SDL_PIXELFORMAT_RGB96_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGB, 0, - 96, 12), - SDL_PIXELFORMAT_BGR96_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGR, 0, - 96, 12), - SDL_PIXELFORMAT_RGBA128_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGBA, 0, - 128, 16), - SDL_PIXELFORMAT_ARGB128_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ARGB, 0, - 128, 16), - SDL_PIXELFORMAT_BGRA128_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGRA, 0, - 128, 16), - SDL_PIXELFORMAT_ABGR128_FLOAT = - SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ABGR, 0, - 128, 16), - - /* Aliases for RGBA byte arrays of color data, for the current platform */ + SDL_PIXELFORMAT_UNKNOWN = 0, + SDL_PIXELFORMAT_INDEX1LSB = 0x11100100u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, 1, 0), */ + SDL_PIXELFORMAT_INDEX1MSB = 0x11200100u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0), */ + SDL_PIXELFORMAT_INDEX2LSB = 0x1c100200u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, 2, 0), */ + SDL_PIXELFORMAT_INDEX2MSB = 0x1c200200u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, 2, 0), */ + SDL_PIXELFORMAT_INDEX4LSB = 0x12100400u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0), */ + SDL_PIXELFORMAT_INDEX4MSB = 0x12200400u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, 4, 0), */ + SDL_PIXELFORMAT_INDEX8 = 0x13000801u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1), */ + SDL_PIXELFORMAT_RGB332 = 0x14110801u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1), */ + SDL_PIXELFORMAT_XRGB4444 = 0x15120c02u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2), */ + SDL_PIXELFORMAT_XBGR4444 = 0x15520c02u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_4444, 12, 2), */ + SDL_PIXELFORMAT_XRGB1555 = 0x15130f02u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2), */ + SDL_PIXELFORMAT_XBGR1555 = 0x15530f02u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2), */ + SDL_PIXELFORMAT_ARGB4444 = 0x15321002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2), */ + SDL_PIXELFORMAT_RGBA4444 = 0x15421002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_4444, 16, 2), */ + SDL_PIXELFORMAT_ABGR4444 = 0x15721002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_4444, 16, 2), */ + SDL_PIXELFORMAT_BGRA4444 = 0x15821002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_4444, 16, 2), */ + SDL_PIXELFORMAT_ARGB1555 = 0x15331002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_1555, 16, 2), */ + SDL_PIXELFORMAT_RGBA5551 = 0x15441002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_5551, 16, 2), */ + SDL_PIXELFORMAT_ABGR1555 = 0x15731002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1555, 16, 2), */ + SDL_PIXELFORMAT_BGRA5551 = 0x15841002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_5551, 16, 2), */ + SDL_PIXELFORMAT_RGB565 = 0x15151002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_565, 16, 2), */ + SDL_PIXELFORMAT_BGR565 = 0x15551002u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_565, 16, 2), */ + SDL_PIXELFORMAT_RGB24 = 0x17101803u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, 24, 3), */ + SDL_PIXELFORMAT_BGR24 = 0x17401803u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3), */ + SDL_PIXELFORMAT_XRGB8888 = 0x16161804u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4), */ + SDL_PIXELFORMAT_RGBX8888 = 0x16261804u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4), */ + SDL_PIXELFORMAT_XBGR8888 = 0x16561804u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4), */ + SDL_PIXELFORMAT_BGRX8888 = 0x16661804u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4), */ + SDL_PIXELFORMAT_ARGB8888 = 0x16362004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_8888, 32, 4), */ + SDL_PIXELFORMAT_RGBA8888 = 0x16462004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4), */ + SDL_PIXELFORMAT_ABGR8888 = 0x16762004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_8888, 32, 4), */ + SDL_PIXELFORMAT_BGRA8888 = 0x16862004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_8888, 32, 4), */ + SDL_PIXELFORMAT_XRGB2101010 = 0x16172004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_2101010, 32, 4), */ + SDL_PIXELFORMAT_XBGR2101010 = 0x16572004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_2101010, 32, 4), */ + SDL_PIXELFORMAT_ARGB2101010 = 0x16372004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_2101010, 32, 4), */ + SDL_PIXELFORMAT_ABGR2101010 = 0x16772004u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_2101010, 32, 4), */ + SDL_PIXELFORMAT_RGB48 = 0x18103006u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGB, 0, 48, 6), */ + SDL_PIXELFORMAT_BGR48 = 0x18403006u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGR, 0, 48, 6), */ + SDL_PIXELFORMAT_RGBA64 = 0x18204008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGBA, 0, 64, 8), */ + SDL_PIXELFORMAT_ARGB64 = 0x18304008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ARGB, 0, 64, 8), */ + SDL_PIXELFORMAT_BGRA64 = 0x18504008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGRA, 0, 64, 8), */ + SDL_PIXELFORMAT_ABGR64 = 0x18604008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ABGR, 0, 64, 8), */ + SDL_PIXELFORMAT_RGB48_FLOAT = 0x1a103006u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGB, 0, 48, 6), */ + SDL_PIXELFORMAT_BGR48_FLOAT = 0x1a403006u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGR, 0, 48, 6), */ + SDL_PIXELFORMAT_RGBA64_FLOAT = 0x1a204008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGBA, 0, 64, 8), */ + SDL_PIXELFORMAT_ARGB64_FLOAT = 0x1a304008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ARGB, 0, 64, 8), */ + SDL_PIXELFORMAT_BGRA64_FLOAT = 0x1a504008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGRA, 0, 64, 8), */ + SDL_PIXELFORMAT_ABGR64_FLOAT = 0x1a604008u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ABGR, 0, 64, 8), */ + SDL_PIXELFORMAT_RGB96_FLOAT = 0x1b10600cu, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGB, 0, 96, 12), */ + SDL_PIXELFORMAT_BGR96_FLOAT = 0x1b40600cu, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGR, 0, 96, 12), */ + SDL_PIXELFORMAT_RGBA128_FLOAT = 0x1b208010u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGBA, 0, 128, 16), */ + SDL_PIXELFORMAT_ARGB128_FLOAT = 0x1b308010u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ARGB, 0, 128, 16), */ + SDL_PIXELFORMAT_BGRA128_FLOAT = 0x1b508010u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGRA, 0, 128, 16), */ + SDL_PIXELFORMAT_ABGR128_FLOAT = 0x1b608010u, + /* SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ABGR, 0, 128, 16), */ + + SDL_PIXELFORMAT_YV12 = 0x32315659u, /**< Planar mode: Y + V + U (3 planes) */ + /* SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), */ + SDL_PIXELFORMAT_IYUV = 0x56555949u, /**< Planar mode: Y + U + V (3 planes) */ + /* SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), */ + SDL_PIXELFORMAT_YUY2 = 0x32595559u, /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ + /* SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), */ + SDL_PIXELFORMAT_UYVY = 0x59565955u, /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ + /* SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), */ + SDL_PIXELFORMAT_YVYU = 0x55595659u, /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ + /* SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), */ + SDL_PIXELFORMAT_NV12 = 0x3231564eu, /**< Planar mode: Y + U/V interleaved (2 planes) */ + /* SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), */ + SDL_PIXELFORMAT_NV21 = 0x3132564eu, /**< Planar mode: Y + V/U interleaved (2 planes) */ + /* SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), */ + SDL_PIXELFORMAT_P010 = 0x30313050u, /**< Planar mode: Y + U/V interleaved (2 planes) */ + /* SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'), */ + SDL_PIXELFORMAT_EXTERNAL_OES = 0x2053454fu /**< Android video texture format */ + /* SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') */ +} SDL_PixelFormat; + +/* Aliases for RGBA byte arrays of color data, for the current platform */ #if SDL_BYTEORDER == SDL_BIG_ENDIAN - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_XBGR8888, +#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_RGBA8888 +#define SDL_PIXELFORMAT_ARGB32 SDL_PIXELFORMAT_ARGB8888 +#define SDL_PIXELFORMAT_BGRA32 SDL_PIXELFORMAT_BGRA8888 +#define SDL_PIXELFORMAT_ABGR32 SDL_PIXELFORMAT_ABGR8888 +#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_RGBX8888 +#define SDL_PIXELFORMAT_XRGB32 SDL_PIXELFORMAT_XRGB8888 +#define SDL_PIXELFORMAT_BGRX32 SDL_PIXELFORMAT_BGRX8888 +#define SDL_PIXELFORMAT_XBGR32 SDL_PIXELFORMAT_XBGR8888 #else - SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888, - SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888, - SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888, - SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888, - SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888, - SDL_PIXELFORMAT_XRGB32 = SDL_PIXELFORMAT_BGRX8888, - SDL_PIXELFORMAT_BGRX32 = SDL_PIXELFORMAT_XRGB8888, - SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888, +#define SDL_PIXELFORMAT_RGBA32 SDL_PIXELFORMAT_ABGR8888 +#define SDL_PIXELFORMAT_ARGB32 SDL_PIXELFORMAT_BGRA8888 +#define SDL_PIXELFORMAT_BGRA32 SDL_PIXELFORMAT_ARGB8888 +#define SDL_PIXELFORMAT_ABGR32 SDL_PIXELFORMAT_RGBA8888 +#define SDL_PIXELFORMAT_RGBX32 SDL_PIXELFORMAT_XBGR8888 +#define SDL_PIXELFORMAT_XRGB32 SDL_PIXELFORMAT_BGRX8888 +#define SDL_PIXELFORMAT_BGRX32 SDL_PIXELFORMAT_XRGB8888 +#define SDL_PIXELFORMAT_XBGR32 SDL_PIXELFORMAT_RGBX8888 #endif - SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'), - SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */ - SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'), - SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'), - SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'), - SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */ - SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'), - SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'), - SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'), - SDL_PIXELFORMAT_P010 = /**< Planar mode: Y + U/V interleaved (2 planes) */ - SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0'), - SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */ - SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ') -} SDL_PixelFormat; - /** * Pixels are a representation of a color in a particular color space. * @@ -592,99 +539,100 @@ typedef enum SDL_ChromaLocation typedef enum SDL_Colorspace { - SDL_COLORSPACE_UNKNOWN, + SDL_COLORSPACE_UNKNOWN = 0, /* sRGB is a gamma corrected colorspace, and the default colorspace for SDL rendering and 8-bit RGB surfaces */ - SDL_COLORSPACE_SRGB = /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT709, - SDL_TRANSFER_CHARACTERISTICS_SRGB, - SDL_MATRIX_COEFFICIENTS_IDENTITY, - SDL_CHROMA_LOCATION_NONE), + SDL_COLORSPACE_SRGB = 0x120005a0u, /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_SRGB, + SDL_MATRIX_COEFFICIENTS_IDENTITY, + SDL_CHROMA_LOCATION_NONE), */ /* This is a linear colorspace and the default colorspace for floating point surfaces. On Windows this is the scRGB colorspace, and on Apple platforms this is kCGColorSpaceExtendedLinearSRGB for EDR content */ - SDL_COLORSPACE_SRGB_LINEAR = /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT709, - SDL_TRANSFER_CHARACTERISTICS_LINEAR, - SDL_MATRIX_COEFFICIENTS_IDENTITY, - SDL_CHROMA_LOCATION_NONE), + SDL_COLORSPACE_SRGB_LINEAR = 0x12000500u, /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G10_NONE_P709 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_LINEAR, + SDL_MATRIX_COEFFICIENTS_IDENTITY, + SDL_CHROMA_LOCATION_NONE), */ /* HDR10 is a non-linear HDR colorspace and the default colorspace for 10-bit surfaces */ - SDL_COLORSPACE_HDR10 = /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT2020, - SDL_TRANSFER_CHARACTERISTICS_PQ, - SDL_MATRIX_COEFFICIENTS_IDENTITY, - SDL_CHROMA_LOCATION_NONE), - - SDL_COLORSPACE_JPEG = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT709, - SDL_TRANSFER_CHARACTERISTICS_BT601, - SDL_MATRIX_COEFFICIENTS_BT601, - SDL_CHROMA_LOCATION_NONE), - - SDL_COLORSPACE_BT601_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_LIMITED, - SDL_COLOR_PRIMARIES_BT601, - SDL_TRANSFER_CHARACTERISTICS_BT601, - SDL_MATRIX_COEFFICIENTS_BT601, - SDL_CHROMA_LOCATION_LEFT), - - SDL_COLORSPACE_BT601_FULL = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT601, - SDL_TRANSFER_CHARACTERISTICS_BT601, - SDL_MATRIX_COEFFICIENTS_BT601, - SDL_CHROMA_LOCATION_LEFT), - - SDL_COLORSPACE_BT709_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_LIMITED, - SDL_COLOR_PRIMARIES_BT709, - SDL_TRANSFER_CHARACTERISTICS_BT709, - SDL_MATRIX_COEFFICIENTS_BT709, - SDL_CHROMA_LOCATION_LEFT), - - SDL_COLORSPACE_BT709_FULL = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT709, - SDL_TRANSFER_CHARACTERISTICS_BT709, - SDL_MATRIX_COEFFICIENTS_BT709, - SDL_CHROMA_LOCATION_LEFT), - - SDL_COLORSPACE_BT2020_LIMITED = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_LIMITED, - SDL_COLOR_PRIMARIES_BT2020, - SDL_TRANSFER_CHARACTERISTICS_PQ, - SDL_MATRIX_COEFFICIENTS_BT2020_NCL, - SDL_CHROMA_LOCATION_LEFT), - - SDL_COLORSPACE_BT2020_FULL = /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 */ - SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, - SDL_COLOR_RANGE_FULL, - SDL_COLOR_PRIMARIES_BT2020, - SDL_TRANSFER_CHARACTERISTICS_PQ, - SDL_MATRIX_COEFFICIENTS_BT2020_NCL, - SDL_CHROMA_LOCATION_LEFT), - - /* The default colorspace for RGB surfaces if no colorspace is specified */ - SDL_COLORSPACE_RGB_DEFAULT = SDL_COLORSPACE_SRGB, - - /* The default colorspace for YUV surfaces if no colorspace is specified */ - SDL_COLORSPACE_YUV_DEFAULT = SDL_COLORSPACE_JPEG + SDL_COLORSPACE_HDR10 = 0x12002600u, /**< Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G2084_NONE_P2020 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT2020, + SDL_TRANSFER_CHARACTERISTICS_PQ, + SDL_MATRIX_COEFFICIENTS_IDENTITY, + SDL_CHROMA_LOCATION_NONE), */ + + SDL_COLORSPACE_JPEG = 0x220004c6u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_BT601, + SDL_MATRIX_COEFFICIENTS_BT601, + SDL_CHROMA_LOCATION_NONE), */ + + SDL_COLORSPACE_BT601_LIMITED = 0x211018c6u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_LIMITED, + SDL_COLOR_PRIMARIES_BT601, + SDL_TRANSFER_CHARACTERISTICS_BT601, + SDL_MATRIX_COEFFICIENTS_BT601, + SDL_CHROMA_LOCATION_LEFT), */ + + SDL_COLORSPACE_BT601_FULL = 0x221018c6u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT601, + SDL_TRANSFER_CHARACTERISTICS_BT601, + SDL_MATRIX_COEFFICIENTS_BT601, + SDL_CHROMA_LOCATION_LEFT), */ + + SDL_COLORSPACE_BT709_LIMITED = 0x21100421u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_LIMITED, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_BT709, + SDL_MATRIX_COEFFICIENTS_BT709, + SDL_CHROMA_LOCATION_LEFT), */ + + SDL_COLORSPACE_BT709_FULL = 0x22100421u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_BT709, + SDL_MATRIX_COEFFICIENTS_BT709, + SDL_CHROMA_LOCATION_LEFT), */ + + SDL_COLORSPACE_BT2020_LIMITED = 0x21102609u, /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_LIMITED, + SDL_COLOR_PRIMARIES_BT2020, + SDL_TRANSFER_CHARACTERISTICS_PQ, + SDL_MATRIX_COEFFICIENTS_BT2020_NCL, + SDL_CHROMA_LOCATION_LEFT), */ + + SDL_COLORSPACE_BT2020_FULL = 0x22102609u /**< Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020 */ + /* SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT2020, + SDL_TRANSFER_CHARACTERISTICS_PQ, + SDL_MATRIX_COEFFICIENTS_BT2020_NCL, + SDL_CHROMA_LOCATION_LEFT), */ } SDL_Colorspace; + +/* The default colorspace for RGB surfaces if no colorspace is specified */ +#define SDL_COLORSPACE_RGB_DEFAULT SDL_COLORSPACE_SRGB + +/* The default colorspace for YUV surfaces if no colorspace is specified */ +#define SDL_COLORSPACE_YUV_DEFAULT SDL_COLORSPACE_JPEG + /** * A structure that represents a color as RGBA components. * diff --git a/test/testautomation_pixels.c b/test/testautomation_pixels.c index 5de4c461a124b..890af33a120a2 100644 --- a/test/testautomation_pixels.c +++ b/test/testautomation_pixels.c @@ -112,6 +112,150 @@ static const char *g_invalidPixelFormatsVerbose[] = { "SDL_PIXELFORMAT_UNKNOWN" }; +/* Verify the pixel formats are laid out as expected */ +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX1LSB_FORMAT, SDL_PIXELFORMAT_INDEX1LSB == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0, 1, 0)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX1MSB_FORMAT, SDL_PIXELFORMAT_INDEX1MSB == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0, 1, 0)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX2LSB_FORMAT, SDL_PIXELFORMAT_INDEX2LSB == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_4321, 0, 2, 0)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX2MSB_FORMAT, SDL_PIXELFORMAT_INDEX2MSB == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX2, SDL_BITMAPORDER_1234, 0, 2, 0)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX4LSB_FORMAT, SDL_PIXELFORMAT_INDEX4LSB == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0, 4, 0)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX4MSB_FORMAT, SDL_PIXELFORMAT_INDEX4MSB == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0, 4, 0)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_INDEX8_FORMAT, SDL_PIXELFORMAT_INDEX8 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGB332_FORMAT, SDL_PIXELFORMAT_RGB332 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_332, 8, 1)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XRGB4444_FORMAT, SDL_PIXELFORMAT_XRGB4444 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_4444, 12, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XBGR4444_FORMAT, SDL_PIXELFORMAT_XBGR4444 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_4444, 12, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XRGB1555_FORMAT, SDL_PIXELFORMAT_XRGB1555 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_1555, 15, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XBGR1555_FORMAT, SDL_PIXELFORMAT_XBGR1555 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_1555, 15, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB4444_FORMAT, SDL_PIXELFORMAT_ARGB4444 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_4444, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBA4444_FORMAT, SDL_PIXELFORMAT_RGBA4444 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_4444, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR4444_FORMAT, SDL_PIXELFORMAT_ABGR4444 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_4444, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRA4444_FORMAT, SDL_PIXELFORMAT_BGRA4444 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_4444, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB1555_FORMAT, SDL_PIXELFORMAT_ARGB1555 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_1555, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBA5551_FORMAT, SDL_PIXELFORMAT_RGBA5551 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_5551, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR1555_FORMAT, SDL_PIXELFORMAT_ABGR1555 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1555, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRA5551_FORMAT, SDL_PIXELFORMAT_BGRA5551 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_5551, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGB565_FORMAT, SDL_PIXELFORMAT_RGB565 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_565, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGR565_FORMAT, SDL_PIXELFORMAT_BGR565 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_565, 16, 2)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGB24_FORMAT, SDL_PIXELFORMAT_RGB24 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0, 24, 3)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGR24_FORMAT, SDL_PIXELFORMAT_BGR24 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0, 24, 3)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XRGB8888_FORMAT, SDL_PIXELFORMAT_XRGB8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_8888, 24, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBX8888_FORMAT, SDL_PIXELFORMAT_RGBX8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX, SDL_PACKEDLAYOUT_8888, 24, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XBGR8888_FORMAT, SDL_PIXELFORMAT_XBGR8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_8888, 24, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRX8888_FORMAT, SDL_PIXELFORMAT_BGRX8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX, SDL_PACKEDLAYOUT_8888, 24, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB8888_FORMAT, SDL_PIXELFORMAT_ARGB8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_8888, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBA8888_FORMAT, SDL_PIXELFORMAT_RGBA8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR8888_FORMAT, SDL_PIXELFORMAT_ABGR8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_8888, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRA8888_FORMAT, SDL_PIXELFORMAT_BGRA8888 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA, SDL_PACKEDLAYOUT_8888, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XRGB2101010_FORMAT, SDL_PIXELFORMAT_XRGB2101010 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB, SDL_PACKEDLAYOUT_2101010, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_XBGR2101010_FORMAT, SDL_PIXELFORMAT_XBGR2101010 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR, SDL_PACKEDLAYOUT_2101010, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB2101010_FORMAT, SDL_PIXELFORMAT_ARGB2101010 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB, SDL_PACKEDLAYOUT_2101010, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR2101010_FORMAT, SDL_PIXELFORMAT_ABGR2101010 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_2101010, 32, 4)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGB48_FORMAT, SDL_PIXELFORMAT_RGB48 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGB, 0, 48, 6)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGR48_FORMAT, SDL_PIXELFORMAT_BGR48 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGR, 0, 48, 6)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBA64_FORMAT, SDL_PIXELFORMAT_RGBA64 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_RGBA, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB64_FORMAT, SDL_PIXELFORMAT_ARGB64 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ARGB, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRA64_FORMAT, SDL_PIXELFORMAT_BGRA64 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_BGRA, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR64_FORMAT, SDL_PIXELFORMAT_ABGR64 == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_ARRAYORDER_ABGR, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGB48_FLOAT_FORMAT, SDL_PIXELFORMAT_RGB48_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGB, 0, 48, 6)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGR48_FLOAT_FORMAT, SDL_PIXELFORMAT_BGR48_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGR, 0, 48, 6)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBA64_FLOAT_FORMAT, SDL_PIXELFORMAT_RGBA64_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_RGBA, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB64_FLOAT_FORMAT, SDL_PIXELFORMAT_ARGB64_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ARGB, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRA64_FLOAT_FORMAT, SDL_PIXELFORMAT_BGRA64_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_BGRA, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR64_FLOAT_FORMAT, SDL_PIXELFORMAT_ABGR64_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_ARRAYORDER_ABGR, 0, 64, 8)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGB96_FLOAT_FORMAT, SDL_PIXELFORMAT_RGB96_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGB, 0, 96, 12)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGR96_FLOAT_FORMAT, SDL_PIXELFORMAT_BGR96_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGR, 0, 96, 12)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_RGBA128_FLOAT_FORMAT, SDL_PIXELFORMAT_RGBA128_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_RGBA, 0, 128, 16)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ARGB128_FLOAT_FORMAT, SDL_PIXELFORMAT_ARGB128_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ARGB, 0, 128, 16)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_BGRA128_FLOAT_FORMAT, SDL_PIXELFORMAT_BGRA128_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_BGRA, 0, 128, 16)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_ABGR128_FLOAT_FORMAT, SDL_PIXELFORMAT_ABGR128_FLOAT == SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF32, SDL_ARRAYORDER_ABGR, 0, 128, 16)); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_YV12_FORMAT, SDL_PIXELFORMAT_YV12 == SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_IYUV_FORMAT, SDL_PIXELFORMAT_IYUV == SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_YUY2_FORMAT, SDL_PIXELFORMAT_YUY2 == SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_UYVY_FORMAT, SDL_PIXELFORMAT_UYVY == SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_YVYU_FORMAT, SDL_PIXELFORMAT_YVYU == SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_NV12_FORMAT, SDL_PIXELFORMAT_NV12 == SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_NV21_FORMAT, SDL_PIXELFORMAT_NV21 == SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_P010_FORMAT, SDL_PIXELFORMAT_P010 == SDL_DEFINE_PIXELFOURCC('P', '0', '1', '0')); +SDL_COMPILE_TIME_ASSERT(SDL_PIXELFORMAT_EXTERNAL_OES_FORMAT, SDL_PIXELFORMAT_EXTERNAL_OES == SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')); + +/* Verify the colorspaces are laid out as expected */ +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_SRGB_FORMAT, SDL_COLORSPACE_SRGB == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_SRGB, + SDL_MATRIX_COEFFICIENTS_IDENTITY, + SDL_CHROMA_LOCATION_NONE)); +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_SRGB_LINEAR_FORMAT, SDL_COLORSPACE_SRGB_LINEAR == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_LINEAR, + SDL_MATRIX_COEFFICIENTS_IDENTITY, + SDL_CHROMA_LOCATION_NONE)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_HDR10_FORMAT, SDL_COLORSPACE_HDR10 == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_RGB, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT2020, + SDL_TRANSFER_CHARACTERISTICS_PQ, + SDL_MATRIX_COEFFICIENTS_IDENTITY, + SDL_CHROMA_LOCATION_NONE)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_JPEG_FORMAT, SDL_COLORSPACE_JPEG == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_BT601, + SDL_MATRIX_COEFFICIENTS_BT601, + SDL_CHROMA_LOCATION_NONE)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_BT601_LIMITED_FORMAT, SDL_COLORSPACE_BT601_LIMITED == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_LIMITED, + SDL_COLOR_PRIMARIES_BT601, + SDL_TRANSFER_CHARACTERISTICS_BT601, + SDL_MATRIX_COEFFICIENTS_BT601, + SDL_CHROMA_LOCATION_LEFT)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_BT601_FULL_FORMAT, SDL_COLORSPACE_BT601_FULL == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT601, + SDL_TRANSFER_CHARACTERISTICS_BT601, + SDL_MATRIX_COEFFICIENTS_BT601, + SDL_CHROMA_LOCATION_LEFT)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_BT709_LIMITED_FORMAT, SDL_COLORSPACE_BT709_LIMITED == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_LIMITED, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_BT709, + SDL_MATRIX_COEFFICIENTS_BT709, + SDL_CHROMA_LOCATION_LEFT)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_BT709_FULL_FORMAT, SDL_COLORSPACE_BT709_FULL == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT709, + SDL_TRANSFER_CHARACTERISTICS_BT709, + SDL_MATRIX_COEFFICIENTS_BT709, + SDL_CHROMA_LOCATION_LEFT)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_BT2020_LIMITED_FORMAT, SDL_COLORSPACE_BT2020_LIMITED == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_LIMITED, + SDL_COLOR_PRIMARIES_BT2020, + SDL_TRANSFER_CHARACTERISTICS_PQ, + SDL_MATRIX_COEFFICIENTS_BT2020_NCL, + SDL_CHROMA_LOCATION_LEFT)); + +SDL_COMPILE_TIME_ASSERT(SDL_COLORSPACE_BT2020_FULL_FORMAT, SDL_COLORSPACE_BT2020_FULL == + SDL_DEFINE_COLORSPACE(SDL_COLOR_TYPE_YCBCR, + SDL_COLOR_RANGE_FULL, + SDL_COLOR_PRIMARIES_BT2020, + SDL_TRANSFER_CHARACTERISTICS_PQ, + SDL_MATRIX_COEFFICIENTS_BT2020_NCL, + SDL_CHROMA_LOCATION_LEFT)); /* Test case functions */ /** From 6217094c40b2720ff6ae0dac7bef21e17fa2adf2 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 11:02:39 -0700 Subject: [PATCH 302/431] Updated colorspace documentation for the wiki --- include/SDL3/SDL_pixels.h | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 809f29f36b9ca..93e8ddd24269e 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -187,7 +187,7 @@ typedef enum SDL_PackedLayout /* Note: If you modify this enum, update SDL_GetPixelFormatName() */ /** - * All pixel formats known to SDL. + * Pixel format. * * SDL's pixel formats have the following naming convention: * @@ -401,7 +401,7 @@ typedef enum SDL_PixelFormat */ /** - * The color type + * Colorspace color type. * * \since This enum is available since SDL 3.0.0. */ @@ -413,7 +413,7 @@ typedef enum SDL_ColorType } SDL_ColorType; /** - * The color range, as described by + * Colorspace color range, as described by * https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en * * \since This enum is available since SDL 3.0.0. @@ -426,7 +426,7 @@ typedef enum SDL_ColorRange } SDL_ColorRange; /** - * The color primaries, as described by + * Colorspace color primaries, as described by * https://www.itu.int/rec/T-REC-H.273-201612-S/en * * \since This enum is available since SDL 3.0.0. @@ -450,7 +450,7 @@ typedef enum SDL_ColorPrimaries } SDL_ColorPrimaries; /** - * The color transfer characteristics. + * Colorspace transfer characteristics. * * These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en * @@ -480,7 +480,7 @@ typedef enum SDL_TransferCharacteristics } SDL_TransferCharacteristics; /** - * The matrix coefficients. + * Colorspace matrix coefficients. * * These are as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en * @@ -506,7 +506,7 @@ typedef enum SDL_MatrixCoefficients } SDL_MatrixCoefficients; /** - * The chroma sample location. + * Colorspace chroma sample location. * * \since This enum is available since SDL 3.0.0. */ @@ -537,6 +537,13 @@ typedef enum SDL_ChromaLocation #define SDL_ISCOLORSPACE_LIMITED_RANGE(X) (SDL_COLORSPACERANGE(X) != SDL_COLOR_RANGE_FULL) #define SDL_ISCOLORSPACE_FULL_RANGE(X) (SDL_COLORSPACERANGE(X) == SDL_COLOR_RANGE_FULL) +/** + * Colorspace definitions. + * + * Since similar colorspaces may vary in their details (matrix, transfer function, etc.), this is not an exhaustive list, but rather a representative sample of the kinds of colorspaces supported in SDL. + * + * \since This enum is available since SDL 3.0.0. + */ typedef enum SDL_Colorspace { SDL_COLORSPACE_UNKNOWN = 0, From abaef816157a6406d289681caae0369edac1d864 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 14 Jul 2024 18:04:00 +0000 Subject: [PATCH 303/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_pixels.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 93e8ddd24269e..d7dbd24b0c866 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -540,7 +540,9 @@ typedef enum SDL_ChromaLocation /** * Colorspace definitions. * - * Since similar colorspaces may vary in their details (matrix, transfer function, etc.), this is not an exhaustive list, but rather a representative sample of the kinds of colorspaces supported in SDL. + * Since similar colorspaces may vary in their details (matrix, transfer + * function, etc.), this is not an exhaustive list, but rather a + * representative sample of the kinds of colorspaces supported in SDL. * * \since This enum is available since SDL 3.0.0. */ From a17b742e34967daf7b8bf5d4a8be12bd8093b907 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 11:43:39 -0700 Subject: [PATCH 304/431] Added documentation references to the components of a colorspace --- include/SDL3/SDL_pixels.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index d7dbd24b0c866..969d1fe7606f0 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -545,6 +545,12 @@ typedef enum SDL_ChromaLocation * representative sample of the kinds of colorspaces supported in SDL. * * \since This enum is available since SDL 3.0.0. + * + * \sa SDL_ColorPrimaries + * \sa SDL_ColorRange + * \sa SDL_ColorType + * \sa SDL_MatrixCoefficients + * \sa SDL_TransferCharacteristics */ typedef enum SDL_Colorspace { From b9dcc5de6098fcb91486f8c0aa863c103dc69c3d Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 14 Jul 2024 21:09:18 +0200 Subject: [PATCH 305/431] ci: bump cross-platform-actions/action, used by the BSDs --- .github/workflows/cpactions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpactions.yml b/.github/workflows/cpactions.yml index a401bbf83ab59..75f1b712d2103 100644 --- a/.github/workflows/cpactions.yml +++ b/.github/workflows/cpactions.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build - uses: cross-platform-actions/action@v0.24.0 + uses: cross-platform-actions/action@v0.25.0 with: operating_system: ${{ matrix.platform.os }} architecture: ${{ matrix.platform.os-arch }} From 15f850babc4a761e507f834b96a6c60407368f0e Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 14 Jul 2024 15:17:47 -0400 Subject: [PATCH 306/431] SDL_hidapi.h: remove struct predeclaration before typedef. --- include/SDL3/SDL_hidapi.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/SDL3/SDL_hidapi.h b/include/SDL3/SDL_hidapi.h index cd84402a51b99..db3daecd25880 100644 --- a/include/SDL3/SDL_hidapi.h +++ b/include/SDL3/SDL_hidapi.h @@ -67,7 +67,6 @@ extern "C" { * * \since This struct is available since SDL 3.0.0. */ -struct SDL_hid_device; typedef struct SDL_hid_device SDL_hid_device; /**< opaque hidapi structure */ /** From 90e69f81e5f070e6caa2bd039320622954829c47 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 14 Jul 2024 15:20:26 -0400 Subject: [PATCH 307/431] SDL_hidapi.h: Fixed something that apparently upset wikiheaders. --- include/SDL3/SDL_hidapi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_hidapi.h b/include/SDL3/SDL_hidapi.h index db3daecd25880..9fd32f52737e7 100644 --- a/include/SDL3/SDL_hidapi.h +++ b/include/SDL3/SDL_hidapi.h @@ -63,11 +63,11 @@ extern "C" { #endif /** - * A handle representing an open HID device + * An opaque handle representing an open HID device. * * \since This struct is available since SDL 3.0.0. */ -typedef struct SDL_hid_device SDL_hid_device; /**< opaque hidapi structure */ +typedef struct SDL_hid_device SDL_hid_device; /** * HID underlying bus types. From cad9e6ea204c214b0dcd721de018ee64c1fbc2f8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 12:52:50 -0700 Subject: [PATCH 308/431] Fixed SDL_SINT64_C typo Apparently all the platforms we compile on have INT64_C defined? Fixes https://github.com/libsdl-org/SDL/issues/10268 --- include/SDL3/SDL_stdinc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 450a629e715dc..a17306b027144 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -143,13 +143,13 @@ void *alloca(size_t); #define SDL_SINT64_C(c) INT64_C(c) #define SDL_UINT64_C(c) UINT64_C(c) #elif defined(_MSC_VER) -#define SDL_INT64_C(c) c ## i64 +#define SDL_SINT64_C(c) c ## i64 #define SDL_UINT64_C(c) c ## ui64 #elif defined(__LP64__) || defined(_LP64) -#define SDL_INT64_C(c) c ## L +#define SDL_SINT64_C(c) c ## L #define SDL_UINT64_C(c) c ## UL #else -#define SDL_INT64_C(c) c ## LL +#define SDL_SINT64_C(c) c ## LL #define SDL_UINT64_C(c) c ## ULL #endif From d154b37b41c57f09d91ce0483798ffe8b4f008e6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 12:06:35 -0700 Subject: [PATCH 309/431] Renamed *FromInstanceID() to *FromID() --- docs/README-migration.md | 8 ++++---- include/SDL3/SDL_gamepad.h | 8 ++++---- include/SDL3/SDL_haptic.h | 2 +- include/SDL3/SDL_joystick.h | 2 +- include/SDL3/SDL_oldnames.h | 12 ++++++------ include/SDL3/SDL_sensor.h | 2 +- src/dynapi/SDL_dynapi.sym | 10 +++++----- src/dynapi/SDL_dynapi_overrides.h | 10 +++++----- src/dynapi/SDL_dynapi_procs.h | 10 +++++----- src/haptic/SDL_haptic.c | 2 +- src/joystick/SDL_gamepad.c | 12 ++++++------ src/joystick/SDL_joystick.c | 2 +- src/joystick/hidapi/SDL_hidapi_gamecube.c | 4 ++-- src/joystick/hidapi/SDL_hidapi_luna.c | 2 +- src/joystick/hidapi/SDL_hidapi_ps3.c | 6 +++--- src/joystick/hidapi/SDL_hidapi_ps4.c | 2 +- src/joystick/hidapi/SDL_hidapi_ps5.c | 2 +- src/joystick/hidapi/SDL_hidapi_shield.c | 2 +- src/joystick/hidapi/SDL_hidapi_stadia.c | 2 +- src/joystick/hidapi/SDL_hidapi_steam.c | 2 +- src/joystick/hidapi/SDL_hidapi_steamdeck.c | 2 +- src/joystick/hidapi/SDL_hidapi_switch.c | 2 +- src/joystick/hidapi/SDL_hidapi_wii.c | 2 +- src/joystick/hidapi/SDL_hidapi_xbox360.c | 2 +- src/joystick/hidapi/SDL_hidapi_xbox360w.c | 2 +- src/joystick/hidapi/SDL_hidapi_xboxone.c | 2 +- src/joystick/hidapi/SDL_hidapijoystick.c | 6 +++--- src/sensor/SDL_sensor.c | 2 +- test/testsensor.c | 2 +- 29 files changed, 62 insertions(+), 62 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index c80ef9593c431..c3433d39c9411 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -574,7 +574,7 @@ The following functions have been renamed: * SDL_GameControllerAddMappingsFromFile() => SDL_AddGamepadMappingsFromFile() * SDL_GameControllerAddMappingsFromRW() => SDL_AddGamepadMappingsFromIO() * SDL_GameControllerClose() => SDL_CloseGamepad() -* SDL_GameControllerFromInstanceID() => SDL_GetGamepadFromInstanceID() +* SDL_GameControllerFromInstanceID() => SDL_GetGamepadFromID() * SDL_GameControllerFromPlayerIndex() => SDL_GetGamepadFromPlayerIndex() * SDL_GameControllerGetAppleSFSymbolsNameForAxis() => SDL_GetGamepadAppleSFSymbolsNameForAxis() * SDL_GameControllerGetAppleSFSymbolsNameForButton() => SDL_GetGamepadAppleSFSymbolsNameForButton() @@ -743,7 +743,7 @@ The following functions have been renamed: The following functions have been removed: * SDL_HapticIndex() - replaced with SDL_GetHapticID() * SDL_HapticName() - replaced with SDL_GetHapticNameFromID() -* SDL_HapticOpened() - replaced with SDL_GetHapticFromInstanceID() +* SDL_HapticOpened() - replaced with SDL_GetHapticFromID() * SDL_NumHaptics() - replaced with SDL_GetHaptics() ## SDL_hints.h @@ -855,7 +855,7 @@ The following functions have been renamed: * SDL_JoystickAttachVirtualEx() => SDL_AttachVirtualJoystick() * SDL_JoystickClose() => SDL_CloseJoystick() * SDL_JoystickDetachVirtual() => SDL_DetachVirtualJoystick() -* SDL_JoystickFromInstanceID() => SDL_GetJoystickFromInstanceID() +* SDL_JoystickFromInstanceID() => SDL_GetJoystickFromID() * SDL_JoystickFromPlayerIndex() => SDL_GetJoystickFromPlayerIndex() * SDL_JoystickGetAttached() => SDL_JoystickConnected() * SDL_JoystickGetAxis() => SDL_GetJoystickAxis() @@ -1587,7 +1587,7 @@ Removed SDL_SensorGetDataWithTimestamp(), if you want timestamps for the sensor The following functions have been renamed: * SDL_SensorClose() => SDL_CloseSensor() -* SDL_SensorFromInstanceID() => SDL_GetSensorFromInstanceID() +* SDL_SensorFromInstanceID() => SDL_GetSensorFromID() * SDL_SensorGetData() => SDL_GetSensorData() * SDL_SensorGetInstanceID() => SDL_GetSensorID() * SDL_SensorGetName() => SDL_GetSensorName() diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 06d8df1861fc6..08f4af52fb5d2 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -626,7 +626,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersionFromID(SDL_Joysti * * \sa SDL_GetGamepadType * \sa SDL_GetGamepads - * \sa SDL_GetRealGamepadInstanceType + * \sa SDL_GetRealGamepadTypeFromID */ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id); @@ -644,7 +644,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromID(SDL_Joystic * \sa SDL_GetGamepads * \sa SDL_GetRealGamepadType */ -extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeFromID(SDL_JoystickID instance_id); /** * Get the mapping of a gamepad. @@ -686,7 +686,7 @@ extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromInstanceID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromID(SDL_JoystickID instance_id); /** * Get the SDL_Gamepad associated with a player index. @@ -800,7 +800,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *game * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetRealGamepadInstanceType + * \sa SDL_GetRealGamepadTypeFromID */ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *gamepad); diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 40fa15a11d40f..ecdf5c623f07b 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -998,7 +998,7 @@ extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id) * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromInstanceID(SDL_HapticID instance_id); +extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromID(SDL_HapticID instance_id); /** * Get the instance ID of an opened haptic device. diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 480f5a3d953dd..3c22ab2f8e83d 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -382,7 +382,7 @@ extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(SDL_JoystickID instan * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromID(SDL_JoystickID instance_id); /** * Get the SDL_Joystick associated with a player index. diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index de8c59fa8173d..0dfc9826fce14 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -221,7 +221,7 @@ #define SDL_GameControllerBindType SDL_GamepadBindingType #define SDL_GameControllerButton SDL_GamepadButton #define SDL_GameControllerClose SDL_CloseGamepad -#define SDL_GameControllerFromInstanceID SDL_GetGamepadFromInstanceID +#define SDL_GameControllerFromInstanceID SDL_GetGamepadFromID #define SDL_GameControllerFromPlayerIndex SDL_GetGamepadFromPlayerIndex #define SDL_GameControllerGetAppleSFSymbolsNameForAxis SDL_GetGamepadAppleSFSymbolsNameForAxis #define SDL_GameControllerGetAppleSFSymbolsNameForButton SDL_GetGamepadAppleSFSymbolsNameForButton @@ -307,7 +307,7 @@ #define SDL_JoystickAttachVirtualEx SDL_AttachVirtualJoystick #define SDL_JoystickClose SDL_CloseJoystick #define SDL_JoystickDetachVirtual SDL_DetachVirtualJoystick -#define SDL_JoystickFromInstanceID SDL_GetJoystickFromInstanceID +#define SDL_JoystickFromInstanceID SDL_GetJoystickFromID #define SDL_JoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex #define SDL_JoystickGetAttached SDL_JoystickConnected #define SDL_JoystickGetAxis SDL_GetJoystickAxis @@ -564,7 +564,7 @@ /* ##SDL_sensor.h */ #define SDL_SensorClose SDL_CloseSensor -#define SDL_SensorFromInstanceID SDL_GetSensorFromInstanceID +#define SDL_SensorFromInstanceID SDL_GetSensorFromID #define SDL_SensorGetData SDL_GetSensorData #define SDL_SensorGetInstanceID SDL_GetSensorID #define SDL_SensorGetName SDL_GetSensorName @@ -818,7 +818,7 @@ #define SDL_GameControllerBindType SDL_GameControllerBindType_renamed_SDL_GamepadBindingType #define SDL_GameControllerButton SDL_GameControllerButton_renamed_SDL_GamepadButton #define SDL_GameControllerClose SDL_GameControllerClose_renamed_SDL_CloseGamepad -#define SDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_renamed_SDL_GetGamepadFromInstanceID +#define SDL_GameControllerFromInstanceID SDL_GameControllerFromInstanceID_renamed_SDL_GetGamepadFromID #define SDL_GameControllerFromPlayerIndex SDL_GameControllerFromPlayerIndex_renamed_SDL_GetGamepadFromPlayerIndex #define SDL_GameControllerGetAppleSFSymbolsNameForAxis SDL_GameControllerGetAppleSFSymbolsNameForAxis_renamed_SDL_GetGamepadAppleSFSymbolsNameForAxis #define SDL_GameControllerGetAppleSFSymbolsNameForButton SDL_GameControllerGetAppleSFSymbolsNameForButton_renamed_SDL_GetGamepadAppleSFSymbolsNameForButton @@ -905,7 +905,7 @@ #define SDL_JoystickAttachVirtualEx SDL_JoystickAttachVirtualEx_renamed_SDL_AttachVirtualJoystick #define SDL_JoystickClose SDL_JoystickClose_renamed_SDL_CloseJoystick #define SDL_JoystickDetachVirtual SDL_JoystickDetachVirtual_renamed_SDL_DetachVirtualJoystick -#define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_renamed_SDL_GetJoystickFromInstanceID +#define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_renamed_SDL_GetJoystickFromID #define SDL_JoystickFromPlayerIndex SDL_JoystickFromPlayerIndex_renamed_SDL_GetJoystickFromPlayerIndex #define SDL_JoystickGetAttached SDL_JoystickGetAttached_renamed_SDL_JoystickConnected #define SDL_JoystickGetAxis SDL_JoystickGetAxis_renamed_SDL_GetJoystickAxis @@ -1162,7 +1162,7 @@ /* ##SDL_sensor.h */ #define SDL_SensorClose SDL_SensorClose_renamed_SDL_CloseSensor -#define SDL_SensorFromInstanceID SDL_SensorFromInstanceID_renamed_SDL_GetSensorFromInstanceID +#define SDL_SensorFromInstanceID SDL_SensorFromInstanceID_renamed_SDL_GetSensorFromID #define SDL_SensorGetData SDL_SensorGetData_renamed_SDL_GetSensorData #define SDL_SensorGetInstanceID SDL_SensorGetInstanceID_renamed_SDL_GetSensorID #define SDL_SensorGetName SDL_SensorGetName_renamed_SDL_GetSensorName diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 3c89b171c4808..26097a586dcad 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -213,7 +213,7 @@ extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id) * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromInstanceID(SDL_SensorID instance_id); +extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromID(SDL_SensorID instance_id); /** * Get the properties associated with a sensor. diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index f7f7313ea68a4..d1533aab05d92 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -240,7 +240,7 @@ SDL3_0.0.0 { SDL_GetGamepadButtonLabelForType; SDL_GetGamepadConnectionState; SDL_GetGamepadFirmwareVersion; - SDL_GetGamepadFromInstanceID; + SDL_GetGamepadFromID; SDL_GetGamepadFromPlayerIndex; SDL_GetGamepadGUIDFromID; SDL_GetGamepadID; @@ -280,7 +280,7 @@ SDL3_0.0.0 { SDL_GetGrabbedWindow; SDL_GetHapticEffectStatus; SDL_GetHapticFeatures; - SDL_GetHapticFromInstanceID; + SDL_GetHapticFromID; SDL_GetHapticID; SDL_GetHapticName; SDL_GetHapticNameFromID; @@ -296,7 +296,7 @@ SDL3_0.0.0 { SDL_GetJoystickButton; SDL_GetJoystickConnectionState; SDL_GetJoystickFirmwareVersion; - SDL_GetJoystickFromInstanceID; + SDL_GetJoystickFromID; SDL_GetJoystickFromPlayerIndex; SDL_GetJoystickGUID; SDL_GetJoystickGUIDFromID; @@ -379,7 +379,7 @@ SDL3_0.0.0 { SDL_GetPropertyType; SDL_GetRGB; SDL_GetRGBA; - SDL_GetRealGamepadInstanceType; + SDL_GetRealGamepadTypeFromID; SDL_GetRealGamepadType; SDL_GetRectAndLineIntersection; SDL_GetRectAndLineIntersectionFloat; @@ -418,7 +418,7 @@ SDL3_0.0.0 { SDL_GetScancodeName; SDL_GetSemaphoreValue; SDL_GetSensorData; - SDL_GetSensorFromInstanceID; + SDL_GetSensorFromID; SDL_GetSensorID; SDL_GetSensorName; SDL_GetSensorNameFromID; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 9f10794baf3fc..03147740fa247 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -265,7 +265,7 @@ #define SDL_GetGamepadButtonLabelForType SDL_GetGamepadButtonLabelForType_REAL #define SDL_GetGamepadConnectionState SDL_GetGamepadConnectionState_REAL #define SDL_GetGamepadFirmwareVersion SDL_GetGamepadFirmwareVersion_REAL -#define SDL_GetGamepadFromInstanceID SDL_GetGamepadFromInstanceID_REAL +#define SDL_GetGamepadFromID SDL_GetGamepadFromID_REAL #define SDL_GetGamepadFromPlayerIndex SDL_GetGamepadFromPlayerIndex_REAL #define SDL_GetGamepadGUIDFromID SDL_GetGamepadGUIDFromID_REAL #define SDL_GetGamepadID SDL_GetGamepadID_REAL @@ -305,7 +305,7 @@ #define SDL_GetGrabbedWindow SDL_GetGrabbedWindow_REAL #define SDL_GetHapticEffectStatus SDL_GetHapticEffectStatus_REAL #define SDL_GetHapticFeatures SDL_GetHapticFeatures_REAL -#define SDL_GetHapticFromInstanceID SDL_GetHapticFromInstanceID_REAL +#define SDL_GetHapticFromID SDL_GetHapticFromID_REAL #define SDL_GetHapticID SDL_GetHapticID_REAL #define SDL_GetHapticName SDL_GetHapticName_REAL #define SDL_GetHapticNameFromID SDL_GetHapticNameFromID_REAL @@ -321,7 +321,7 @@ #define SDL_GetJoystickButton SDL_GetJoystickButton_REAL #define SDL_GetJoystickConnectionState SDL_GetJoystickConnectionState_REAL #define SDL_GetJoystickFirmwareVersion SDL_GetJoystickFirmwareVersion_REAL -#define SDL_GetJoystickFromInstanceID SDL_GetJoystickFromInstanceID_REAL +#define SDL_GetJoystickFromID SDL_GetJoystickFromID_REAL #define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL #define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL #define SDL_GetJoystickGUIDFromID SDL_GetJoystickGUIDFromID_REAL @@ -404,7 +404,7 @@ #define SDL_GetPropertyType SDL_GetPropertyType_REAL #define SDL_GetRGB SDL_GetRGB_REAL #define SDL_GetRGBA SDL_GetRGBA_REAL -#define SDL_GetRealGamepadInstanceType SDL_GetRealGamepadInstanceType_REAL +#define SDL_GetRealGamepadTypeFromID SDL_GetRealGamepadTypeFromID_REAL #define SDL_GetRealGamepadType SDL_GetRealGamepadType_REAL #define SDL_GetRectAndLineIntersection SDL_GetRectAndLineIntersection_REAL #define SDL_GetRectAndLineIntersectionFloat SDL_GetRectAndLineIntersectionFloat_REAL @@ -443,7 +443,7 @@ #define SDL_GetScancodeName SDL_GetScancodeName_REAL #define SDL_GetSemaphoreValue SDL_GetSemaphoreValue_REAL #define SDL_GetSensorData SDL_GetSensorData_REAL -#define SDL_GetSensorFromInstanceID SDL_GetSensorFromInstanceID_REAL +#define SDL_GetSensorFromID SDL_GetSensorFromID_REAL #define SDL_GetSensorID SDL_GetSensorID_REAL #define SDL_GetSensorName SDL_GetSensorName_REAL #define SDL_GetSensorNameFromID SDL_GetSensorNameFromID_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 8c17b541de28d..1575bfde42995 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -285,7 +285,7 @@ SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabel,(SDL_Gamepad *a SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabelForType,(SDL_GamepadType a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetGamepadConnectionState,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadFirmwareVersion,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromInstanceID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromPlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadID,(SDL_Gamepad *a),(a),return) @@ -325,7 +325,7 @@ SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGlobalProperties,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetHapticEffectStatus,(SDL_Haptic *a, int b),(a,b),return) SDL_DYNAPI_PROC(Uint32,SDL_GetHapticFeatures,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromInstanceID,(SDL_HapticID a),(a),return) +SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticID,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticName,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameFromID,(SDL_HapticID a),(a),return) @@ -341,7 +341,7 @@ SDL_DYNAPI_PROC(int,SDL_GetJoystickBall,(SDL_Joystick *a, int b, int *c, int *d) SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickButton,(SDL_Joystick *a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetJoystickConnectionState,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromInstanceID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromID,(SDL_JoystickID a),(a),return) @@ -424,7 +424,7 @@ SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) -SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadInstanceType,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadType,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersectionFloat,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) @@ -463,7 +463,7 @@ SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetScancodeFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetScancodeName,(SDL_Scancode a),(a),return) SDL_DYNAPI_PROC(Uint32,SDL_GetSemaphoreValue,(SDL_Semaphore *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),return) -SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromInstanceID,(SDL_SensorID a),(a),return) +SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorID,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetSensorName,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetSensorNameFromID,(SDL_SensorID a),(a),return) diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index 93a64219ca57e..df1105c6c1acc 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -166,7 +166,7 @@ SDL_Haptic *SDL_OpenHaptic(SDL_HapticID instance_id) return haptic; } -SDL_Haptic *SDL_GetHapticFromInstanceID(SDL_HapticID instance_id) +SDL_Haptic *SDL_GetHapticFromID(SDL_HapticID instance_id) { SDL_Haptic *haptic; diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index d41413b11fed0..17951c8bd1aa2 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -558,7 +558,7 @@ static void PopMappingChangeTracking(void) for (i = 0; tracker->joysticks[i]; ++i) { /* Looking up the new mapping might create one and associate it with the gamepad (and generate events) */ SDL_JoystickID joystick = tracker->joysticks[i]; - SDL_Gamepad *gamepad = SDL_GetGamepadFromInstanceID(joystick); + SDL_Gamepad *gamepad = SDL_GetGamepadFromID(joystick); GamepadMapping_t *new_mapping = SDL_PrivateGetGamepadMapping(joystick, SDL_FALSE); GamepadMapping_t *old_mapping = gamepad ? gamepad->mapping : tracker->joystick_mappings[i]; @@ -1324,7 +1324,7 @@ static void SDL_UpdateGamepadType(SDL_Gamepad *gamepad) } } if (gamepad->type == SDL_GAMEPAD_TYPE_UNKNOWN) { - gamepad->type = SDL_GetRealGamepadInstanceType(gamepad->joystick->instance_id); + gamepad->type = SDL_GetRealGamepadTypeFromID(gamepad->joystick->instance_id); } } @@ -2497,10 +2497,10 @@ SDL_GamepadType SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id) if (type != SDL_GAMEPAD_TYPE_UNKNOWN) { return type; } - return SDL_GetRealGamepadInstanceType(instance_id); + return SDL_GetRealGamepadTypeFromID(instance_id); } -SDL_GamepadType SDL_GetRealGamepadInstanceType(SDL_JoystickID instance_id) +SDL_GamepadType SDL_GetRealGamepadTypeFromID(SDL_JoystickID instance_id) { SDL_GamepadType type = SDL_GAMEPAD_TYPE_UNKNOWN; const SDL_SteamVirtualGamepadInfo *info; @@ -3506,7 +3506,7 @@ SDL_Joystick *SDL_GetGamepadJoystick(SDL_Gamepad *gamepad) /* * Return the SDL_Gamepad associated with an instance id. */ -SDL_Gamepad *SDL_GetGamepadFromInstanceID(SDL_JoystickID joyid) +SDL_Gamepad *SDL_GetGamepadFromID(SDL_JoystickID joyid) { SDL_Gamepad *gamepad; @@ -3534,7 +3534,7 @@ SDL_Gamepad *SDL_GetGamepadFromPlayerIndex(int player_index) { SDL_Joystick *joystick = SDL_GetJoystickFromPlayerIndex(player_index); if (joystick) { - retval = SDL_GetGamepadFromInstanceID(joystick->instance_id); + retval = SDL_GetGamepadFromID(joystick->instance_id); } } SDL_UnlockJoysticks(); diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index a424b06bd1f42..78104a44e092b 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -1585,7 +1585,7 @@ SDL_JoystickID SDL_GetJoystickID(SDL_Joystick *joystick) /* * Return the SDL_Joystick associated with an instance id. */ -SDL_Joystick *SDL_GetJoystickFromInstanceID(SDL_JoystickID instance_id) +SDL_Joystick *SDL_GetJoystickFromID(SDL_JoystickID instance_id) { SDL_Joystick *joystick; diff --git a/src/joystick/hidapi/SDL_hidapi_gamecube.c b/src/joystick/hidapi/SDL_hidapi_gamecube.c index ec7970d75e589..a61ea0a0c1adb 100644 --- a/src/joystick/hidapi/SDL_hidapi_gamecube.c +++ b/src/joystick/hidapi/SDL_hidapi_gamecube.c @@ -220,7 +220,7 @@ static void HIDAPI_DriverGameCube_HandleJoystickPacket(SDL_HIDAPI_Device *device return; /* How do we handle this packet? */ } - joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]); + joystick = SDL_GetJoystickFromID(ctx->joysticks[i]); if (!joystick) { /* Hasn't been opened yet, skip */ return; @@ -295,7 +295,7 @@ static void HIDAPI_DriverGameCube_HandleNintendoPacket(SDL_HIDAPI_Device *device ResetAxisRange(ctx, i); HIDAPI_JoystickConnected(device, &ctx->joysticks[i]); } - joystick = SDL_GetJoystickFromInstanceID(ctx->joysticks[i]); + joystick = SDL_GetJoystickFromID(ctx->joysticks[i]); /* Hasn't been opened yet, skip */ if (!joystick) { diff --git a/src/joystick/hidapi/SDL_hidapi_luna.c b/src/joystick/hidapi/SDL_hidapi_luna.c index aa2c2fac4debd..6a1c82de409f0 100644 --- a/src/joystick/hidapi/SDL_hidapi_luna.c +++ b/src/joystick/hidapi/SDL_hidapi_luna.c @@ -356,7 +356,7 @@ static SDL_bool HIDAPI_DriverLuna_UpdateDevice(SDL_HIDAPI_Device *device) int size = 0; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_ps3.c b/src/joystick/hidapi/SDL_hidapi_ps3.c index 9d3d50405ec37..422d3c16b1b5a 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps3.c +++ b/src/joystick/hidapi/SDL_hidapi_ps3.c @@ -520,7 +520,7 @@ static SDL_bool HIDAPI_DriverPS3_UpdateDevice(SDL_HIDAPI_Device *device) int size; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } @@ -958,7 +958,7 @@ static SDL_bool HIDAPI_DriverPS3ThirdParty_UpdateDevice(SDL_HIDAPI_Device *devic int size; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } @@ -1297,7 +1297,7 @@ static SDL_bool HIDAPI_DriverPS3SonySixaxis_UpdateDevice(SDL_HIDAPI_Device *devi int size; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_ps4.c b/src/joystick/hidapi/SDL_hidapi_ps4.c index 8818251bc52df..2722c949eac93 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps4.c +++ b/src/joystick/hidapi/SDL_hidapi_ps4.c @@ -1256,7 +1256,7 @@ static SDL_bool HIDAPI_DriverPS4_UpdateDevice(SDL_HIDAPI_Device *device) Uint64 now = SDL_GetTicks(); if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) { diff --git a/src/joystick/hidapi/SDL_hidapi_ps5.c b/src/joystick/hidapi/SDL_hidapi_ps5.c index ecb78c410a90e..5709df92d3445 100644 --- a/src/joystick/hidapi/SDL_hidapi_ps5.c +++ b/src/joystick/hidapi/SDL_hidapi_ps5.c @@ -1492,7 +1492,7 @@ static SDL_bool HIDAPI_DriverPS5_UpdateDevice(SDL_HIDAPI_Device *device) Uint64 now = SDL_GetTicks(); if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) { diff --git a/src/joystick/hidapi/SDL_hidapi_shield.c b/src/joystick/hidapi/SDL_hidapi_shield.c index 77f8b40f7a69a..a146aa9849acf 100644 --- a/src/joystick/hidapi/SDL_hidapi_shield.c +++ b/src/joystick/hidapi/SDL_hidapi_shield.c @@ -471,7 +471,7 @@ static SDL_bool HIDAPI_DriverShield_UpdateDevice(SDL_HIDAPI_Device *device) ShieldCommandReport_t *cmd_resp_report; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_stadia.c b/src/joystick/hidapi/SDL_hidapi_stadia.c index 6115029ba89fe..c66e8b60186d7 100644 --- a/src/joystick/hidapi/SDL_hidapi_stadia.c +++ b/src/joystick/hidapi/SDL_hidapi_stadia.c @@ -266,7 +266,7 @@ static SDL_bool HIDAPI_DriverStadia_UpdateDevice(SDL_HIDAPI_Device *device) int size = 0; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_steam.c b/src/joystick/hidapi/SDL_hidapi_steam.c index 7e2683e46acdb..75f6467509ddb 100644 --- a/src/joystick/hidapi/SDL_hidapi_steam.c +++ b/src/joystick/hidapi/SDL_hidapi_steam.c @@ -1092,7 +1092,7 @@ static SDL_bool HIDAPI_DriverSteam_UpdateDevice(SDL_HIDAPI_Device *device) SDL_Joystick *joystick = NULL; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_steamdeck.c b/src/joystick/hidapi/SDL_hidapi_steamdeck.c index 7ccbca69bf139..abcf0f61c7b59 100644 --- a/src/joystick/hidapi/SDL_hidapi_steamdeck.c +++ b/src/joystick/hidapi/SDL_hidapi_steamdeck.c @@ -317,7 +317,7 @@ static SDL_bool HIDAPI_DriverSteamDeck_UpdateDevice(SDL_HIDAPI_Device *device) ValveInReport_t *pInReport = (ValveInReport_t *)data; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); if (joystick == NULL) { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_switch.c b/src/joystick/hidapi/SDL_hidapi_switch.c index ebf4f3c869152..8d95c46e10869 100644 --- a/src/joystick/hidapi/SDL_hidapi_switch.c +++ b/src/joystick/hidapi/SDL_hidapi_switch.c @@ -2562,7 +2562,7 @@ static SDL_bool HIDAPI_DriverSwitch_UpdateDevice(SDL_HIDAPI_Device *device) Uint64 now = SDL_GetTicks(); if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } while ((size = ReadInput(ctx)) > 0) { diff --git a/src/joystick/hidapi/SDL_hidapi_wii.c b/src/joystick/hidapi/SDL_hidapi_wii.c index bc4819b4c171b..470c9ec49e106 100644 --- a/src/joystick/hidapi/SDL_hidapi_wii.c +++ b/src/joystick/hidapi/SDL_hidapi_wii.c @@ -1517,7 +1517,7 @@ static SDL_bool HIDAPI_DriverWii_UpdateDevice(SDL_HIDAPI_Device *device) Uint64 now; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360.c b/src/joystick/hidapi/SDL_hidapi_xbox360.c index abe527ca72de6..8e4aef3c16c41 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360.c @@ -337,7 +337,7 @@ static SDL_bool HIDAPI_DriverXbox360_UpdateDevice(SDL_HIDAPI_Device *device) int size = 0; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapi_xbox360w.c b/src/joystick/hidapi/SDL_hidapi_xbox360w.c index e0c60221285a7..fc7fe94536ccc 100644 --- a/src/joystick/hidapi/SDL_hidapi_xbox360w.c +++ b/src/joystick/hidapi/SDL_hidapi_xbox360w.c @@ -294,7 +294,7 @@ static SDL_bool HIDAPI_DriverXbox360W_UpdateDevice(SDL_HIDAPI_Device *device) int size; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } while ((size = SDL_hid_read_timeout(device->dev, data, sizeof(data), 0)) > 0) { diff --git a/src/joystick/hidapi/SDL_hidapi_xboxone.c b/src/joystick/hidapi/SDL_hidapi_xboxone.c index 95fa1fb2d7079..8c6d8a40ed226 100644 --- a/src/joystick/hidapi/SDL_hidapi_xboxone.c +++ b/src/joystick/hidapi/SDL_hidapi_xboxone.c @@ -1574,7 +1574,7 @@ static SDL_bool HIDAPI_DriverXboxOne_UpdateDevice(SDL_HIDAPI_Device *device) int size; if (device->num_joysticks > 0) { - joystick = SDL_GetJoystickFromInstanceID(device->joysticks[0]); + joystick = SDL_GetJoystickFromID(device->joysticks[0]); } else { return SDL_FALSE; } diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index 1e240f974eb04..d49ff1b62a54e 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -679,7 +679,7 @@ static void HIDAPI_UpdateJoystickSerial(SDL_HIDAPI_Device *device) SDL_AssertJoysticksLocked(); for (i = 0; i < device->num_joysticks; ++i) { - SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(device->joysticks[i]); + SDL_Joystick *joystick = SDL_GetJoystickFromID(device->joysticks[i]); if (joystick && device->serial) { SDL_free(joystick->serial); joystick->serial = SDL_strdup(device->serial); @@ -834,7 +834,7 @@ void HIDAPI_JoystickDisconnected(SDL_HIDAPI_Device *device, SDL_JoystickID joyst for (i = 0; i < device->num_joysticks; ++i) { if (device->joysticks[i] == joystickID) { - SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(joystickID); + SDL_Joystick *joystick = SDL_GetJoystickFromID(joystickID); if (joystick) { HIDAPI_JoystickClose(joystick); } @@ -899,7 +899,7 @@ void HIDAPI_UpdateDeviceProperties(SDL_HIDAPI_Device *device) SDL_LockJoysticks(); for (i = 0; i < device->num_joysticks; ++i) { - SDL_Joystick *joystick = SDL_GetJoystickFromInstanceID(device->joysticks[i]); + SDL_Joystick *joystick = SDL_GetJoystickFromID(device->joysticks[i]); if (joystick) { HIDAPI_UpdateJoystickProperties(device, joystick); } diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index 85594d8527e34..9a4ddf4e930a3 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -361,7 +361,7 @@ SDL_Sensor *SDL_OpenSensor(SDL_SensorID instance_id) /* * Find the SDL_Sensor that owns this instance id */ -SDL_Sensor *SDL_GetSensorFromInstanceID(SDL_SensorID instance_id) +SDL_Sensor *SDL_GetSensorFromID(SDL_SensorID instance_id) { SDL_Sensor *sensor; diff --git a/test/testsensor.c b/test/testsensor.c index c1f81dfa09dfa..77ad36a935b8c 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -37,7 +37,7 @@ static const char *GetSensorTypeString(SDL_SensorType type) static void HandleSensorEvent(SDL_SensorEvent *event) { - SDL_Sensor *sensor = SDL_GetSensorFromInstanceID(event->which); + SDL_Sensor *sensor = SDL_GetSensorFromID(event->which); if (!sensor) { SDL_Log("Couldn't get sensor for sensor event\n"); return; From 935833328691240a9ec18e53a2808e8bd5ee15a8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 12:30:56 -0700 Subject: [PATCH 310/431] Renamed SDL_GetKeyboardInstanceName() and SDL_GetMouseInstanceName() For consistency with other device APIs --- include/SDL3/SDL_keyboard.h | 4 ++-- include/SDL3/SDL_mouse.h | 4 ++-- src/dynapi/SDL_dynapi.sym | 4 ++-- src/dynapi/SDL_dynapi_overrides.h | 4 ++-- src/dynapi/SDL_dynapi_procs.h | 4 ++-- src/events/SDL_keyboard.c | 2 +- src/events/SDL_mouse.c | 4 ++-- test/testhotplug.c | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 67f3cbb7bd067..1bdfa1a621a3e 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -80,7 +80,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetKeyboardInstanceName + * \sa SDL_GetKeyboardNameFromID * \sa SDL_HasKeyboard */ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); @@ -100,7 +100,7 @@ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); * * \sa SDL_GetKeyboards */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyboardInstanceName(SDL_KeyboardID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyboardNameFromID(SDL_KeyboardID instance_id); /** * Query the window which currently has keyboard focus. diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index e68211caecf35..074cdfcb7176c 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -142,7 +142,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetMouseInstanceName + * \sa SDL_GetMouseNameFromID * \sa SDL_HasMouse */ extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); @@ -162,7 +162,7 @@ extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); * * \sa SDL_GetMice */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetMouseInstanceName(SDL_MouseID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetMouseNameFromID(SDL_MouseID instance_id); /** * Get the window which currently has mouse focus. diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index d1533aab05d92..ed257f0ea04a5 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -327,7 +327,7 @@ SDL3_0.0.0 { SDL_GetKeyFromScancode; SDL_GetKeyName; SDL_GetKeyboardFocus; - SDL_GetKeyboardInstanceName; + SDL_GetKeyboardNameFromID; SDL_GetKeyboardState; SDL_GetKeyboards; SDL_GetLogOutputFunction; @@ -339,7 +339,7 @@ SDL3_0.0.0 { SDL_GetMice; SDL_GetModState; SDL_GetMouseFocus; - SDL_GetMouseInstanceName; + SDL_GetMouseNameFromID; SDL_GetMouseState; SDL_GetNaturalDisplayOrientation; SDL_GetNumAllocations; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 03147740fa247..21b84b26b6772 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -352,7 +352,7 @@ #define SDL_GetKeyFromScancode SDL_GetKeyFromScancode_REAL #define SDL_GetKeyName SDL_GetKeyName_REAL #define SDL_GetKeyboardFocus SDL_GetKeyboardFocus_REAL -#define SDL_GetKeyboardInstanceName SDL_GetKeyboardInstanceName_REAL +#define SDL_GetKeyboardNameFromID SDL_GetKeyboardNameFromID_REAL #define SDL_GetKeyboardState SDL_GetKeyboardState_REAL #define SDL_GetKeyboards SDL_GetKeyboards_REAL #define SDL_GetLogOutputFunction SDL_GetLogOutputFunction_REAL @@ -364,7 +364,7 @@ #define SDL_GetMice SDL_GetMice_REAL #define SDL_GetModState SDL_GetModState_REAL #define SDL_GetMouseFocus SDL_GetMouseFocus_REAL -#define SDL_GetMouseInstanceName SDL_GetMouseInstanceName_REAL +#define SDL_GetMouseNameFromID SDL_GetMouseNameFromID_REAL #define SDL_GetMouseState SDL_GetMouseState_REAL #define SDL_GetNaturalDisplayOrientation SDL_GetNaturalDisplayOrientation_REAL #define SDL_GetNumAllocations SDL_GetNumAllocations_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 1575bfde42995..917e35ad45cc1 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -372,7 +372,7 @@ SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyName,(SDL_Keycode a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardInstanceName,(SDL_KeyboardID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardNameFromID,(SDL_KeyboardID a),(a),return) SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_KeyboardID*,SDL_GetKeyboards,(int *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetLogOutputFunction,(SDL_LogOutputFunction *a, void **b),(a,b),) @@ -384,7 +384,7 @@ SDL_DYNAPI_PROC(void,SDL_GetMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func SDL_DYNAPI_PROC(SDL_MouseID*,SDL_GetMice,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keymod,SDL_GetModState,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetMouseFocus,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetMouseInstanceName,(SDL_MouseID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetMouseNameFromID,(SDL_MouseID a),(a),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetNaturalDisplayOrientation,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetNumAllocations,(void),(),return) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 0b73d154dae5f..e008771ac272c 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -201,7 +201,7 @@ SDL_KeyboardID *SDL_GetKeyboards(int *count) return keyboards; } -const char *SDL_GetKeyboardInstanceName(SDL_KeyboardID instance_id) +const char *SDL_GetKeyboardNameFromID(SDL_KeyboardID instance_id) { int keyboard_index = SDL_GetKeyboardIndex(instance_id); if (keyboard_index < 0) { diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index d7959f8774dcb..c34ee70c10977 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -312,7 +312,7 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, SDL_bool send_event) return; } - SDL_FreeLater(SDL_mice[mouse_index].name); // SDL_GetMouseInstanceName returns this pointer. + SDL_FreeLater(SDL_mice[mouse_index].name); // SDL_GetMouseNameFromID returns this pointer. if (mouse_index != SDL_mouse_count - 1) { SDL_memcpy(&SDL_mice[mouse_index], &SDL_mice[mouse_index + 1], (SDL_mouse_count - mouse_index - 1) * sizeof(SDL_mice[mouse_index])); @@ -370,7 +370,7 @@ SDL_MouseID *SDL_GetMice(int *count) return mice; } -const char *SDL_GetMouseInstanceName(SDL_MouseID instance_id) +const char *SDL_GetMouseNameFromID(SDL_MouseID instance_id) { int mouse_index = SDL_GetMouseIndex(instance_id); if (mouse_index < 0) { diff --git a/test/testhotplug.c b/test/testhotplug.c index adf15ab68394f..d28249b198878 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -103,13 +103,13 @@ int main(int argc, char *argv[]) keepGoing = SDL_FALSE; break; case SDL_EVENT_KEYBOARD_ADDED: - SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardInstanceName(event.kdevice.which), event.kdevice.which); + SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardNameFromID(event.kdevice.which), event.kdevice.which); break; case SDL_EVENT_KEYBOARD_REMOVED: SDL_Log("Keyboard removed: %" SDL_PRIu32 "\n", event.kdevice.which); break; case SDL_EVENT_MOUSE_ADDED: - SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseInstanceName(event.mdevice.which), event.mdevice.which); + SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseNameFromID(event.mdevice.which), event.mdevice.which); break; case SDL_EVENT_MOUSE_REMOVED: SDL_Log("Mouse removed: %" SDL_PRIu32 "\n", event.mdevice.which); From 9797c5d0c0b3d6d325a553e8de3f51db17d997e9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 12:22:42 -0700 Subject: [PATCH 311/431] Renamed CameraDevice to Camera This is consistent with the rest of the SDL API --- include/SDL3/SDL_camera.h | 40 ++-- include/SDL3/SDL_events.h | 2 +- src/camera/SDL_camera.c | 210 +++++++++--------- src/camera/SDL_syscamera.h | 58 ++--- src/camera/android/SDL_camera_android.c | 54 ++--- src/camera/coremedia/SDL_camera_coremedia.m | 32 +-- src/camera/dummy/SDL_camera_dummy.c | 12 +- src/camera/emscripten/SDL_camera_emscripten.c | 20 +- .../SDL_camera_mediafoundation.c | 24 +- src/camera/pipewire/SDL_camera_pipewire.c | 22 +- src/camera/v4l2/SDL_camera_v4l2.c | 32 +-- src/dynapi/SDL_dynapi.sym | 12 +- src/dynapi/SDL_dynapi_overrides.h | 12 +- src/dynapi/SDL_dynapi_procs.h | 12 +- test/testcamera.c | 26 +-- 15 files changed, 284 insertions(+), 284 deletions(-) diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 02d2941586861..5994e9bc6db1f 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -53,9 +53,9 @@ extern "C" { * * \since This datatype is available since SDL 3.0.0. * - * \sa SDL_GetCameraDevices + * \sa SDL_GetCameras */ -typedef Uint32 SDL_CameraDeviceID; +typedef Uint32 SDL_CameraID; /** * The opaque structure used to identify an opened SDL camera. @@ -72,7 +72,7 @@ typedef struct SDL_Camera SDL_Camera; * * \since This struct is available since SDL 3.0.0. * - * \sa SDL_GetCameraDeviceSupportedFormats + * \sa SDL_GetCameraSupportedFormats * \sa SDL_GetCameraFormat */ typedef struct SDL_CameraSpec @@ -90,7 +90,7 @@ typedef struct SDL_CameraSpec * * \since This enum is available since SDL 3.0.0. * - * \sa SDL_GetCameraDevicePosition + * \sa SDL_GetCameraPosition */ typedef enum SDL_CameraPosition { @@ -182,7 +182,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void); * * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count); +extern SDL_DECLSPEC SDL_CameraID *SDLCALL SDL_GetCameras(int *count); /** * Get the list of native formats/sizes a camera supports. @@ -192,7 +192,7 @@ extern SDL_DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count) * and sizes and so want to find the optimal spec that doesn't require * conversion. * - * This function isn't strictly required; if you call SDL_OpenCameraDevice + * This function isn't strictly required; if you call SDL_OpenCamera * with a NULL spec, SDL will choose a native format for you, and if you * instead specify a desired format, it will transparently convert to the * requested format on your behalf. @@ -222,10 +222,10 @@ extern SDL_DECLSPEC SDL_CameraDeviceID *SDLCALL SDL_GetCameraDevices(int *count) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetCameraDevices - * \sa SDL_OpenCameraDevice + * \sa SDL_GetCameras + * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID devid, int *count); +extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count); /** * Get the human-readable device name for a camera. @@ -240,9 +240,9 @@ extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraDeviceSupportedFormats( * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetCameraDevices + * \sa SDL_GetCameras */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraName(SDL_CameraID instance_id); /** * Get the position of the camera in relation to the system. @@ -259,9 +259,9 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDeviceName(SDL_CameraDevic * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetCameraDevices + * \sa SDL_GetCameras */ -extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraDevicePosition(SDL_CameraDeviceID instance_id); +extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraID instance_id); /** * Open a video recording device (a "camera"). @@ -304,10 +304,10 @@ extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraDevicePosition(SDL_C * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetCameraDevices + * \sa SDL_GetCameras * \sa SDL_GetCameraFormat */ -extern SDL_DECLSPEC SDL_Camera *SDLCALL SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_CameraSpec *spec); +extern SDL_DECLSPEC SDL_Camera *SDLCALL SDL_OpenCamera(SDL_CameraID instance_id, const SDL_CameraSpec *spec); /** * Query if camera access has been approved by the user. @@ -337,7 +337,7 @@ extern SDL_DECLSPEC SDL_Camera *SDLCALL SDL_OpenCameraDevice(SDL_CameraDeviceID * * \since This function is available since SDL 3.0.0. * - * \sa SDL_OpenCameraDevice + * \sa SDL_OpenCamera * \sa SDL_CloseCamera */ extern SDL_DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera); @@ -353,14 +353,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCameraPermissionState(SDL_Camera *camera) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_OpenCameraDevice + * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraDeviceID SDLCALL SDL_GetCameraInstanceID(SDL_Camera *camera); +extern SDL_DECLSPEC SDL_CameraID SDLCALL SDL_GetCameraID(SDL_Camera *camera); /** * Get the properties associated with an opened camera. * - * \param camera the SDL_Camera obtained from SDL_OpenCameraDevice(). + * \param camera the SDL_Camera obtained from SDL_OpenCamera(). * \returns a valid property ID on success or 0 on failure; call * SDL_GetError() for more information. * @@ -391,7 +391,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetCameraProperties(SDL_Camera * * \since This function is available since SDL 3.0.0. * - * \sa SDL_OpenCameraDevice + * \sa SDL_OpenCamera */ extern SDL_DECLSPEC int SDLCALL SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec); diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index bd7cea779b046..921bcbad7771a 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -695,7 +695,7 @@ typedef struct SDL_CameraDeviceEvent SDL_EventType type; /**< SDL_EVENT_CAMERA_DEVICE_ADDED, SDL_EVENT_CAMERA_DEVICE_REMOVED, SDL_EVENT_CAMERA_DEVICE_APPROVED, SDL_EVENT_CAMERA_DEVICE_DENIED */ Uint32 reserved; Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */ - SDL_CameraDeviceID which; /**< SDL_CameraDeviceID for the device being added or removed or changing */ + SDL_CameraID which; /**< SDL_CameraID for the device being added or removed or changing */ } SDL_CameraDeviceEvent; /** diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index 260323afddc00..ad061a673fcb5 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -78,7 +78,7 @@ const char *SDL_GetCurrentCameraDriver(void) return camera_driver.name; } -char *SDL_GetCameraThreadName(SDL_CameraDevice *device, char *buf, size_t buflen) +char *SDL_GetCameraThreadName(SDL_Camera *device, char *buf, size_t buflen) { (void)SDL_snprintf(buf, buflen, "SDLCamera%d", (int) device->instance_id); return buf; @@ -115,7 +115,7 @@ int SDL_AddCameraFormat(CameraFormatAddData *data, SDL_PixelFormat format, SDL_C // These get used when a device is disconnected or fails. Apps that ignore the // loss notifications will get black frames but otherwise keep functioning. -static int ZombieWaitDevice(SDL_CameraDevice *device) +static int ZombieWaitDevice(SDL_Camera *device) { if (!SDL_AtomicGet(&device->shutdown)) { // !!! FIXME: this is bad for several reasons (uses double, could be precalculated, doesn't track elasped time). @@ -147,7 +147,7 @@ static size_t GetFrameBufLen(const SDL_CameraSpec *spec) return wxh * SDL_BYTESPERPIXEL(fmt); } -static int ZombieAcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int ZombieAcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { const SDL_CameraSpec *spec = &device->actual_spec; @@ -217,7 +217,7 @@ static int ZombieAcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint return 1; // frame is available. } -static void ZombieReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) // Reclaim frame->pixels and frame->pitch! +static void ZombieReleaseFrame(SDL_Camera *device, SDL_Surface *frame) // Reclaim frame->pixels and frame->pitch! { if (frame->pixels != device->zombie_pixels) { // this was a frame from before the disconnect event; let the backend make an attempt to free it. @@ -226,7 +226,7 @@ static void ZombieReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) // // we just leave zombie_pixels alone, as we'll reuse it for every new frame until the camera is closed. } -static void ClosePhysicalCameraDevice(SDL_CameraDevice *device) +static void ClosePhysicalCamera(SDL_Camera *device) { if (!device) { return; @@ -278,22 +278,22 @@ static void ClosePhysicalCameraDevice(SDL_CameraDevice *device) } // this must not be called while `device` is still in a device list, or while a device's camera thread is still running. -static void DestroyPhysicalCameraDevice(SDL_CameraDevice *device) +static void DestroyPhysicalCamera(SDL_Camera *device) { if (device) { // Destroy any logical devices that still exist... - ClosePhysicalCameraDevice(device); + ClosePhysicalCamera(device); camera_driver.impl.FreeDeviceHandle(device); SDL_DestroyMutex(device->lock); SDL_free(device->all_specs); - SDL_FreeLater(device->name); // this is returned in SDL_GetCameraDeviceName. + SDL_FreeLater(device->name); // this is returned in SDL_GetCameraName. SDL_free(device); } } // Don't hold the device lock when calling this, as we may destroy the device! -void UnrefPhysicalCameraDevice(SDL_CameraDevice *device) +void UnrefPhysicalCamera(SDL_Camera *device) { if (SDL_AtomicDecRef(&device->refcount)) { // take it out of the device list. @@ -302,47 +302,47 @@ void UnrefPhysicalCameraDevice(SDL_CameraDevice *device) SDL_AtomicAdd(&camera_driver.device_count, -1); } SDL_UnlockRWLock(camera_driver.device_hash_lock); - DestroyPhysicalCameraDevice(device); // ...and nuke it. + DestroyPhysicalCamera(device); // ...and nuke it. } } -void RefPhysicalCameraDevice(SDL_CameraDevice *device) +void RefPhysicalCamera(SDL_Camera *device) { SDL_AtomicIncRef(&device->refcount); } -static void ObtainPhysicalCameraDeviceObj(SDL_CameraDevice *device) SDL_NO_THREAD_SAFETY_ANALYSIS // !!! FIXMEL SDL_ACQUIRE +static void ObtainPhysicalCameraObj(SDL_Camera *device) SDL_NO_THREAD_SAFETY_ANALYSIS // !!! FIXMEL SDL_ACQUIRE { if (device) { - RefPhysicalCameraDevice(device); + RefPhysicalCamera(device); SDL_LockMutex(device->lock); } } -static SDL_CameraDevice *ObtainPhysicalCameraDevice(SDL_CameraDeviceID devid) // !!! FIXME: SDL_ACQUIRE +static SDL_Camera *ObtainPhysicalCamera(SDL_CameraID devid) // !!! FIXME: SDL_ACQUIRE { if (!SDL_GetCurrentCameraDriver()) { SDL_SetError("Camera subsystem is not initialized"); return NULL; } - SDL_CameraDevice *device = NULL; + SDL_Camera *device = NULL; SDL_LockRWLockForReading(camera_driver.device_hash_lock); SDL_FindInHashTable(camera_driver.device_hash, (const void *) (uintptr_t) devid, (const void **) &device); SDL_UnlockRWLock(camera_driver.device_hash_lock); if (!device) { SDL_SetError("Invalid camera device instance ID"); } else { - ObtainPhysicalCameraDeviceObj(device); + ObtainPhysicalCameraObj(device); } return device; } -static void ReleaseCameraDevice(SDL_CameraDevice *device) SDL_NO_THREAD_SAFETY_ANALYSIS // !!! FIXME: SDL_RELEASE +static void ReleaseCamera(SDL_Camera *device) SDL_NO_THREAD_SAFETY_ANALYSIS // !!! FIXME: SDL_RELEASE { if (device) { SDL_UnlockMutex(device->lock); - UnrefPhysicalCameraDevice(device); + UnrefPhysicalCamera(device); } } @@ -415,7 +415,7 @@ static int SDLCALL CameraSpecCmp(const void *vpa, const void *vpb) } // The camera backends call this when a new device is plugged in. -SDL_CameraDevice *SDL_AddCameraDevice(const char *name, SDL_CameraPosition position, int num_specs, const SDL_CameraSpec *specs, void *handle) +SDL_Camera *SDL_AddCamera(const char *name, SDL_CameraPosition position, int num_specs, const SDL_CameraSpec *specs, void *handle) { SDL_assert(name != NULL); SDL_assert(num_specs >= 0); @@ -429,7 +429,7 @@ SDL_CameraDevice *SDL_AddCameraDevice(const char *name, SDL_CameraPosition posit return NULL; // we're shutting down, don't add any devices that are hotplugged at the last possible moment. } - SDL_CameraDevice *device = (SDL_CameraDevice *)SDL_calloc(1, sizeof(SDL_CameraDevice)); + SDL_Camera *device = (SDL_Camera *)SDL_calloc(1, sizeof(SDL_Camera)); if (!device) { return NULL; } @@ -492,7 +492,7 @@ SDL_CameraDevice *SDL_AddCameraDevice(const char *name, SDL_CameraPosition posit device->instance_id = SDL_GetNextObjectID(); SDL_AtomicSet(&device->shutdown, 0); SDL_AtomicSet(&device->zombie, 0); - RefPhysicalCameraDevice(device); + RefPhysicalCamera(device); SDL_LockRWLockForWriting(camera_driver.device_hash_lock); if (SDL_InsertIntoHashTable(camera_driver.device_hash, (const void *) (uintptr_t) device->instance_id, device)) { @@ -507,7 +507,7 @@ SDL_CameraDevice *SDL_AddCameraDevice(const char *name, SDL_CameraPosition posit // Add a device add event to the pending list, to be pushed when the event queue is pumped (away from any of our internal threads). if (device) { - SDL_PendingCameraDeviceEvent *p = (SDL_PendingCameraDeviceEvent *) SDL_malloc(sizeof (SDL_PendingCameraDeviceEvent)); + SDL_PendingCameraEvent *p = (SDL_PendingCameraEvent *) SDL_malloc(sizeof (SDL_PendingCameraEvent)); if (p) { // if allocation fails, you won't get an event, but we can't help that. p->type = SDL_EVENT_CAMERA_DEVICE_ADDED; p->devid = device->instance_id; @@ -524,7 +524,7 @@ SDL_CameraDevice *SDL_AddCameraDevice(const char *name, SDL_CameraPosition posit } // Called when a device is removed from the system, or it fails unexpectedly, from any thread, possibly even the camera device's thread. -void SDL_CameraDeviceDisconnected(SDL_CameraDevice *device) +void SDL_CameraDisconnected(SDL_Camera *device) { if (!device) { return; @@ -538,11 +538,11 @@ void SDL_CameraDeviceDisconnected(SDL_CameraDevice *device) // time the event queue pumps, in case something tries to close a device // from an event filter, as this would risk deadlocks and other disasters // if done from the device thread. - SDL_PendingCameraDeviceEvent pending; + SDL_PendingCameraEvent pending; pending.next = NULL; - SDL_PendingCameraDeviceEvent *pending_tail = &pending; + SDL_PendingCameraEvent *pending_tail = &pending; - ObtainPhysicalCameraDeviceObj(device); + ObtainPhysicalCameraObj(device); const SDL_bool first_disconnect = SDL_AtomicCompareAndSwap(&device->zombie, 0, 1); if (first_disconnect) { // if already disconnected this device, don't do it twice. @@ -558,7 +558,7 @@ void SDL_CameraDeviceDisconnected(SDL_CameraDevice *device) device->adjust_timestamp = 0; device->base_timestamp = 0; - SDL_PendingCameraDeviceEvent *p = (SDL_PendingCameraDeviceEvent *) SDL_malloc(sizeof (SDL_PendingCameraDeviceEvent)); + SDL_PendingCameraEvent *p = (SDL_PendingCameraEvent *) SDL_malloc(sizeof (SDL_PendingCameraEvent)); if (p) { // if this failed, no event for you, but you have deeper problems anyhow. p->type = SDL_EVENT_CAMERA_DEVICE_REMOVED; p->devid = device->instance_id; @@ -568,7 +568,7 @@ void SDL_CameraDeviceDisconnected(SDL_CameraDevice *device) } } - ReleaseCameraDevice(device); + ReleaseCamera(device); if (first_disconnect) { if (pending.next) { // NULL if event is disabled or disaster struck. @@ -582,22 +582,22 @@ void SDL_CameraDeviceDisconnected(SDL_CameraDevice *device) } } -void SDL_CameraDevicePermissionOutcome(SDL_CameraDevice *device, SDL_bool approved) +void SDL_CameraPermissionOutcome(SDL_Camera *device, SDL_bool approved) { if (!device) { return; } - SDL_PendingCameraDeviceEvent pending; + SDL_PendingCameraEvent pending; pending.next = NULL; - SDL_PendingCameraDeviceEvent *pending_tail = &pending; + SDL_PendingCameraEvent *pending_tail = &pending; const int permission = approved ? 1 : -1; - ObtainPhysicalCameraDeviceObj(device); + ObtainPhysicalCameraObj(device); if (device->permission != permission) { device->permission = permission; - SDL_PendingCameraDeviceEvent *p = (SDL_PendingCameraDeviceEvent *) SDL_malloc(sizeof (SDL_PendingCameraDeviceEvent)); + SDL_PendingCameraEvent *p = (SDL_PendingCameraEvent *) SDL_malloc(sizeof (SDL_PendingCameraEvent)); if (p) { // if this failed, no event for you, but you have deeper problems anyhow. p->type = approved ? SDL_EVENT_CAMERA_DEVICE_APPROVED : SDL_EVENT_CAMERA_DEVICE_DENIED; p->devid = device->instance_id; @@ -607,7 +607,7 @@ void SDL_CameraDevicePermissionOutcome(SDL_CameraDevice *device, SDL_bool approv } } - ReleaseCameraDevice(device); + ReleaseCamera(device); if (pending.next) { // NULL if event is disabled or disaster struck. SDL_LockRWLockForWriting(camera_driver.device_hash_lock); @@ -620,7 +620,7 @@ void SDL_CameraDevicePermissionOutcome(SDL_CameraDevice *device, SDL_bool approv } -SDL_CameraDevice *SDL_FindPhysicalCameraDeviceByCallback(SDL_bool (*callback)(SDL_CameraDevice *device, void *userdata), void *userdata) +SDL_Camera *SDL_FindPhysicalCameraByCallback(SDL_bool (*callback)(SDL_Camera *device, void *userdata), void *userdata) { if (!SDL_GetCurrentCameraDriver()) { SDL_SetError("Camera subsystem is not initialized"); @@ -633,7 +633,7 @@ SDL_CameraDevice *SDL_FindPhysicalCameraDeviceByCallback(SDL_bool (*callback)(SD SDL_LockRWLockForReading(camera_driver.device_hash_lock); while (SDL_IterateHashTable(camera_driver.device_hash, &key, &value, &iter)) { - SDL_CameraDevice *device = (SDL_CameraDevice *) value; + SDL_Camera *device = (SDL_Camera *) value; if (callback(device, userdata)) { // found it? SDL_UnlockRWLock(camera_driver.device_hash_lock); return device; @@ -648,8 +648,8 @@ SDL_CameraDevice *SDL_FindPhysicalCameraDeviceByCallback(SDL_bool (*callback)(SD void SDL_CloseCamera(SDL_Camera *camera) { - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. - ClosePhysicalCameraDevice(device); + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. + ClosePhysicalCamera(device); } int SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec) @@ -660,42 +660,42 @@ int SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec) return SDL_InvalidParamError("spec"); } - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. - ObtainPhysicalCameraDeviceObj(device); + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. + ObtainPhysicalCameraObj(device); const int retval = (device->permission > 0) ? 0 : SDL_SetError("Camera permission has not been granted"); if (retval == 0) { SDL_copyp(spec, &device->spec); } else { SDL_zerop(spec); } - ReleaseCameraDevice(device); + ReleaseCamera(device); return 0; } -const char *SDL_GetCameraDeviceName(SDL_CameraDeviceID instance_id) +const char *SDL_GetCameraName(SDL_CameraID instance_id) { char *retval = NULL; - SDL_CameraDevice *device = ObtainPhysicalCameraDevice(instance_id); + SDL_Camera *device = ObtainPhysicalCamera(instance_id); if (device) { retval = device->name; - ReleaseCameraDevice(device); + ReleaseCamera(device); } return retval; } -SDL_CameraPosition SDL_GetCameraDevicePosition(SDL_CameraDeviceID instance_id) +SDL_CameraPosition SDL_GetCameraPosition(SDL_CameraID instance_id) { SDL_CameraPosition retval = SDL_CAMERA_POSITION_UNKNOWN; - SDL_CameraDevice *device = ObtainPhysicalCameraDevice(instance_id); + SDL_Camera *device = ObtainPhysicalCamera(instance_id); if (device) { retval = device->position; - ReleaseCameraDevice(device); + ReleaseCamera(device); } return retval; } -SDL_CameraDeviceID *SDL_GetCameraDevices(int *count) +SDL_CameraID *SDL_GetCameras(int *count) { int dummy_count; if (!count) { @@ -708,11 +708,11 @@ SDL_CameraDeviceID *SDL_GetCameraDevices(int *count) return NULL; } - SDL_CameraDeviceID *retval = NULL; + SDL_CameraID *retval = NULL; SDL_LockRWLockForReading(camera_driver.device_hash_lock); int num_devices = SDL_AtomicGet(&camera_driver.device_count); - retval = (SDL_CameraDeviceID *) SDL_malloc((num_devices + 1) * sizeof (SDL_CameraDeviceID)); + retval = (SDL_CameraID *) SDL_malloc((num_devices + 1) * sizeof (SDL_CameraID)); if (!retval) { num_devices = 0; } else { @@ -721,7 +721,7 @@ SDL_CameraDeviceID *SDL_GetCameraDevices(int *count) const void *value; void *iter = NULL; while (SDL_IterateHashTable(camera_driver.device_hash, &key, &value, &iter)) { - retval[devs_seen++] = (SDL_CameraDeviceID) (uintptr_t) key; + retval[devs_seen++] = (SDL_CameraID) (uintptr_t) key; } SDL_assert(devs_seen == num_devices); @@ -734,13 +734,13 @@ SDL_CameraDeviceID *SDL_GetCameraDevices(int *count) return retval; } -SDL_CameraSpec *SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID instance_id, int *count) +SDL_CameraSpec *SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *count) { if (count) { *count = 0; } - SDL_CameraDevice *device = ObtainPhysicalCameraDevice(instance_id); + SDL_Camera *device = ObtainPhysicalCamera(instance_id); if (!device) { return NULL; } @@ -753,7 +753,7 @@ SDL_CameraSpec *SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID instance_ } } - ReleaseCameraDevice(device); + ReleaseCamera(device); return retval; } @@ -761,7 +761,7 @@ SDL_CameraSpec *SDL_GetCameraDeviceSupportedFormats(SDL_CameraDeviceID instance_ // Camera device thread. This is split into chunks, so drivers that need to control this directly can use the pieces they need without duplicating effort. -void SDL_CameraThreadSetup(SDL_CameraDevice *device) +void SDL_CameraThreadSetup(SDL_Camera *device) { //camera_driver.impl.ThreadInit(device); #ifdef SDL_VIDEO_DRIVER_ANDROID @@ -778,7 +778,7 @@ void SDL_CameraThreadSetup(SDL_CameraDevice *device) #endif } -SDL_bool SDL_CameraThreadIterate(SDL_CameraDevice *device) +SDL_bool SDL_CameraThreadIterate(SDL_Camera *device) { SDL_LockMutex(device->lock); @@ -855,7 +855,7 @@ SDL_bool SDL_CameraThreadIterate(SDL_CameraDevice *device) if (failed) { SDL_assert(slist == NULL); SDL_assert(acquired == NULL); - SDL_CameraDeviceDisconnected(device); // doh. + SDL_CameraDisconnected(device); // doh. } else if (acquired) { // we have a new frame, scale/convert if necessary and queue it for the app! SDL_assert(slist != NULL); if (!device->needs_scaling && !device->needs_conversion) { // no conversion needed? Just move the pointer/pitch into the output surface. @@ -905,7 +905,7 @@ SDL_bool SDL_CameraThreadIterate(SDL_CameraDevice *device) return SDL_TRUE; // always go on if not shutting down, even if device failed. } -void SDL_CameraThreadShutdown(SDL_CameraDevice *device) +void SDL_CameraThreadShutdown(SDL_Camera *device) { //device->FlushRecording(device); //camera_driver.impl.ThreadDeinit(device); @@ -915,7 +915,7 @@ void SDL_CameraThreadShutdown(SDL_CameraDevice *device) // Actual thread entry point, if driver didn't handle this itself. static int SDLCALL CameraThread(void *devicep) { - SDL_CameraDevice *device = (SDL_CameraDevice *) devicep; + SDL_Camera *device = (SDL_Camera *) devicep; #if DEBUG_CAMERA SDL_Log("CAMERA: dev[%p] Start thread 'CameraThread'", devicep); @@ -926,7 +926,7 @@ static int SDLCALL CameraThread(void *devicep) do { if (device->WaitDevice(device) < 0) { - SDL_CameraDeviceDisconnected(device); // doh. (but don't break out of the loop, just be a zombie for now!) + SDL_CameraDisconnected(device); // doh. (but don't break out of the loop, just be a zombie for now!) } } while (SDL_CameraThreadIterate(device)); @@ -939,7 +939,7 @@ static int SDLCALL CameraThread(void *devicep) return 0; } -static void ChooseBestCameraSpec(SDL_CameraDevice *device, const SDL_CameraSpec *spec, SDL_CameraSpec *closest) +static void ChooseBestCameraSpec(SDL_Camera *device, const SDL_CameraSpec *spec, SDL_CameraSpec *closest) { // Find the closest available native format/size... // @@ -1056,15 +1056,15 @@ static void ChooseBestCameraSpec(SDL_CameraDevice *device, const SDL_CameraSpec SDL_assert(closest->format != SDL_PIXELFORMAT_UNKNOWN); } -SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_CameraSpec *spec) +SDL_Camera *SDL_OpenCamera(SDL_CameraID instance_id, const SDL_CameraSpec *spec) { - SDL_CameraDevice *device = ObtainPhysicalCameraDevice(instance_id); + SDL_Camera *device = ObtainPhysicalCamera(instance_id); if (!device) { return NULL; } if (device->hidden != NULL) { - ReleaseCameraDevice(device); + ReleaseCamera(device); SDL_SetError("Camera already opened"); // we may remove this limitation at some point. return NULL; } @@ -1086,8 +1086,8 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer #endif if (camera_driver.impl.OpenDevice(device, &closest) < 0) { - ClosePhysicalCameraDevice(device); // in case anything is half-initialized. - ReleaseCameraDevice(device); + ClosePhysicalCamera(device); // in case anything is half-initialized. + ReleaseCamera(device); return NULL; } @@ -1126,8 +1126,8 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer device->acquire_surface = SDL_CreateSurfaceFrom(closest.width, closest.height, closest.format, NULL, 0); if (!device->acquire_surface) { - ClosePhysicalCameraDevice(device); - ReleaseCameraDevice(device); + ClosePhysicalCamera(device); + ReleaseCamera(device); return NULL; } SDL_SetSurfaceColorspace(device->acquire_surface, closest.colorspace); @@ -1139,8 +1139,8 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer const SDL_PixelFormat fmt = downsampling_first ? closest.format : device->spec.format; device->conversion_surface = SDL_CreateSurface(s->width, s->height, fmt); if (!device->conversion_surface) { - ClosePhysicalCameraDevice(device); - ReleaseCameraDevice(device); + ClosePhysicalCamera(device); + ReleaseCamera(device); return NULL; } SDL_SetSurfaceColorspace(device->conversion_surface, closest.colorspace); @@ -1163,8 +1163,8 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer surf = SDL_CreateSurfaceFrom(device->spec.width, device->spec.height, device->spec.format, NULL, 0); } if (!surf) { - ClosePhysicalCameraDevice(device); - ReleaseCameraDevice(device); + ClosePhysicalCamera(device); + ReleaseCamera(device); return NULL; } SDL_SetSurfaceColorspace(surf, closest.colorspace); @@ -1180,14 +1180,14 @@ SDL_Camera *SDL_OpenCameraDevice(SDL_CameraDeviceID instance_id, const SDL_Camer SDL_GetCameraThreadName(device, threadname, sizeof (threadname)); device->thread = SDL_CreateThread(CameraThread, threadname, device); if (!device->thread) { - ClosePhysicalCameraDevice(device); - ReleaseCameraDevice(device); + ClosePhysicalCamera(device); + ReleaseCamera(device); SDL_SetError("Couldn't create camera thread"); return NULL; } } - ReleaseCameraDevice(device); // unlock, we're good to go! + ReleaseCamera(device); // unlock, we're good to go! return (SDL_Camera *) device; // currently there's no separation between physical and logical device. } @@ -1203,12 +1203,12 @@ SDL_Surface *SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS) return NULL; } - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. - ObtainPhysicalCameraDeviceObj(device); + ObtainPhysicalCameraObj(device); if (device->permission <= 0) { - ReleaseCameraDevice(device); + ReleaseCamera(device); SDL_SetError("Camera permission has not been granted"); return NULL; } @@ -1234,7 +1234,7 @@ SDL_Surface *SDL_AcquireCameraFrame(SDL_Camera *camera, Uint64 *timestampNS) device->app_held_output_surfaces.next = slist; } - ReleaseCameraDevice(device); + ReleaseCamera(device); return retval; } @@ -1247,8 +1247,8 @@ int SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame) return SDL_InvalidParamError("frame"); } - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. - ObtainPhysicalCameraDeviceObj(device); + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. + ObtainPhysicalCameraObj(device); SurfaceList *slistprev = &device->app_held_output_surfaces; SurfaceList *slist; @@ -1260,7 +1260,7 @@ int SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame) } if (!slist) { - ReleaseCameraDevice(device); + ReleaseCamera(device); return SDL_SetError("Surface was not acquired from this camera, or was already released"); } @@ -1280,21 +1280,21 @@ int SDL_ReleaseCameraFrame(SDL_Camera *camera, SDL_Surface *frame) slist->next = device->empty_output_surfaces.next; device->empty_output_surfaces.next = slist; - ReleaseCameraDevice(device); + ReleaseCamera(device); return 0; } -SDL_CameraDeviceID SDL_GetCameraInstanceID(SDL_Camera *camera) +SDL_CameraID SDL_GetCameraID(SDL_Camera *camera) { - SDL_CameraDeviceID retval = 0; + SDL_CameraID retval = 0; if (!camera) { SDL_InvalidParamError("camera"); } else { - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. - ObtainPhysicalCameraDeviceObj(device); + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. + ObtainPhysicalCameraObj(device); retval = device->instance_id; - ReleaseCameraDevice(device); + ReleaseCamera(device); } return retval; @@ -1306,13 +1306,13 @@ SDL_PropertiesID SDL_GetCameraProperties(SDL_Camera *camera) if (!camera) { SDL_InvalidParamError("camera"); } else { - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. - ObtainPhysicalCameraDeviceObj(device); + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. + ObtainPhysicalCameraObj(device); if (device->props == 0) { device->props = SDL_CreateProperties(); } retval = device->props; - ReleaseCameraDevice(device); + ReleaseCamera(device); } return retval; @@ -1324,10 +1324,10 @@ int SDL_GetCameraPermissionState(SDL_Camera *camera) if (!camera) { retval = SDL_InvalidParamError("camera"); } else { - SDL_CameraDevice *device = (SDL_CameraDevice *) camera; // currently there's no separation between physical and logical device. - ObtainPhysicalCameraDeviceObj(device); + SDL_Camera *device = (SDL_Camera *) camera; // currently there's no separation between physical and logical device. + ObtainPhysicalCameraObj(device); retval = device->permission; - ReleaseCameraDevice(device); + ReleaseCamera(device); } return retval; @@ -1358,13 +1358,13 @@ void SDL_QuitCamera(void) SDL_AtomicSet(&camera_driver.shutting_down, 1); SDL_HashTable *device_hash = camera_driver.device_hash; camera_driver.device_hash = NULL; - SDL_PendingCameraDeviceEvent *pending_events = camera_driver.pending_events.next; + SDL_PendingCameraEvent *pending_events = camera_driver.pending_events.next; camera_driver.pending_events.next = NULL; SDL_AtomicSet(&camera_driver.device_count, 0); SDL_UnlockRWLock(camera_driver.device_hash_lock); - SDL_PendingCameraDeviceEvent *pending_next = NULL; - for (SDL_PendingCameraDeviceEvent *i = pending_events; i; i = pending_next) { + SDL_PendingCameraEvent *pending_next = NULL; + for (SDL_PendingCameraEvent *i = pending_events; i; i = pending_next) { pending_next = i->next; SDL_free(i); } @@ -1373,7 +1373,7 @@ void SDL_QuitCamera(void) const void *value; void *iter = NULL; while (SDL_IterateHashTable(device_hash, &key, &value, &iter)) { - DestroyPhysicalCameraDevice((SDL_CameraDevice *) value); + DestroyPhysicalCamera((SDL_Camera *) value); } // Free the driver data @@ -1386,18 +1386,18 @@ void SDL_QuitCamera(void) } -static Uint32 HashCameraDeviceID(const void *key, void *data) +static Uint32 HashCameraID(const void *key, void *data) { // The values are unique incrementing integers, starting at 1, so just return minus 1 to start with bucket zero. return ((Uint32) ((uintptr_t) key)) - 1; } -static SDL_bool MatchCameraDeviceID(const void *a, const void *b, void *data) +static SDL_bool MatchCameraID(const void *a, const void *b, void *data) { return (a == b); // simple integers, just compare them as pointer values. } -static void NukeCameraDeviceHashItem(const void *key, const void *value, void *data) +static void NukeCameraHashItem(const void *key, const void *value, void *data) { // no-op, keys and values in this hashtable are treated as Plain Old Data and don't get freed here. } @@ -1413,7 +1413,7 @@ int SDL_CameraInit(const char *driver_name) return -1; } - SDL_HashTable *device_hash = SDL_CreateHashTable(NULL, 8, HashCameraDeviceID, MatchCameraDeviceID, NukeCameraDeviceHashItem, SDL_FALSE); + SDL_HashTable *device_hash = SDL_CreateHashTable(NULL, 8, HashCameraID, MatchCameraID, NukeCameraHashItem, SDL_FALSE); if (!device_hash) { SDL_DestroyRWLock(device_hash_lock); return -1; @@ -1511,7 +1511,7 @@ int SDL_CameraInit(const char *driver_name) void SDL_UpdateCamera(void) { SDL_LockRWLockForReading(camera_driver.device_hash_lock); - SDL_PendingCameraDeviceEvent *pending_events = camera_driver.pending_events.next; + SDL_PendingCameraEvent *pending_events = camera_driver.pending_events.next; SDL_UnlockRWLock(camera_driver.device_hash_lock); if (!pending_events) { @@ -1525,8 +1525,8 @@ void SDL_UpdateCamera(void) camera_driver.pending_events_tail = &camera_driver.pending_events; SDL_UnlockRWLock(camera_driver.device_hash_lock); - SDL_PendingCameraDeviceEvent *pending_next = NULL; - for (SDL_PendingCameraDeviceEvent *i = pending_events; i; i = pending_next) { + SDL_PendingCameraEvent *pending_next = NULL; + for (SDL_PendingCameraEvent *i = pending_events; i; i = pending_next) { pending_next = i->next; if (SDL_EventEnabled(i->type)) { SDL_Event event; diff --git a/src/camera/SDL_syscamera.h b/src/camera/SDL_syscamera.h index 40ed83a8aed23..2e6e95ca261c8 100644 --- a/src/camera/SDL_syscamera.h +++ b/src/camera/SDL_syscamera.h @@ -27,34 +27,34 @@ #define DEBUG_CAMERA 0 -typedef struct SDL_CameraDevice SDL_CameraDevice; +typedef struct SDL_Camera SDL_Camera; /* Backends should call this as devices are added to the system (such as a USB camera being plugged in), and should also be called for for every device found during DetectDevices(). */ -extern SDL_CameraDevice *SDL_AddCameraDevice(const char *name, SDL_CameraPosition position, int num_specs, const SDL_CameraSpec *specs, void *handle); +extern SDL_Camera *SDL_AddCamera(const char *name, SDL_CameraPosition position, int num_specs, const SDL_CameraSpec *specs, void *handle); /* Backends should call this if an opened camera device is lost. This can happen due to i/o errors, or a device being unplugged, etc. */ -extern void SDL_CameraDeviceDisconnected(SDL_CameraDevice *device); +extern void SDL_CameraDisconnected(SDL_Camera *device); -// Find an SDL_CameraDevice, selected by a callback. NULL if not found. DOES NOT LOCK THE DEVICE. -extern SDL_CameraDevice *SDL_FindPhysicalCameraDeviceByCallback(SDL_bool (*callback)(SDL_CameraDevice *device, void *userdata), void *userdata); +// Find an SDL_Camera, selected by a callback. NULL if not found. DOES NOT LOCK THE DEVICE. +extern SDL_Camera *SDL_FindPhysicalCameraByCallback(SDL_bool (*callback)(SDL_Camera *device, void *userdata), void *userdata); // Backends should call this when the user has approved/denied access to a camera. -extern void SDL_CameraDevicePermissionOutcome(SDL_CameraDevice *device, SDL_bool approved); +extern void SDL_CameraPermissionOutcome(SDL_Camera *device, SDL_bool approved); // Backends can call this to get a standardized name for a thread to power a specific camera device. -extern char *SDL_GetCameraThreadName(SDL_CameraDevice *device, char *buf, size_t buflen); +extern char *SDL_GetCameraThreadName(SDL_Camera *device, char *buf, size_t buflen); // Backends can call these to change a device's refcount. -extern void RefPhysicalCameraDevice(SDL_CameraDevice *device); -extern void UnrefPhysicalCameraDevice(SDL_CameraDevice *device); +extern void RefPhysicalCamera(SDL_Camera *device); +extern void UnrefPhysicalCamera(SDL_Camera *device); // These functions are the heart of the camera threads. Backends can call them directly if they aren't using the SDL-provided thread. -extern void SDL_CameraThreadSetup(SDL_CameraDevice *device); -extern SDL_bool SDL_CameraThreadIterate(SDL_CameraDevice *device); -extern void SDL_CameraThreadShutdown(SDL_CameraDevice *device); +extern void SDL_CameraThreadSetup(SDL_Camera *device); +extern SDL_bool SDL_CameraThreadIterate(SDL_Camera *device); +extern void SDL_CameraThreadShutdown(SDL_Camera *device); // common utility functionality to gather up camera specs. Not required! typedef struct CameraFormatAddData @@ -74,7 +74,7 @@ typedef struct SurfaceList } SurfaceList; // Define the SDL camera driver structure -struct SDL_CameraDevice +struct SDL_Camera { // A mutex for locking SDL_Mutex *lock; @@ -89,9 +89,9 @@ struct SDL_CameraDevice SDL_AtomicInt refcount; // These are, initially, set from camera_driver, but we might swap them out with Zombie versions on disconnect/failure. - int (*WaitDevice)(SDL_CameraDevice *device); - int (*AcquireFrame)(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS); - void (*ReleaseFrame)(SDL_CameraDevice *device, SDL_Surface *frame); + int (*WaitDevice)(SDL_Camera *device); + int (*AcquireFrame)(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS); + void (*ReleaseFrame)(SDL_Camera *device, SDL_Surface *frame); // All supported formats/dimensions for this device. SDL_CameraSpec *all_specs; @@ -106,7 +106,7 @@ struct SDL_CameraDevice SDL_CameraSpec spec; // Unique value assigned at creation time. - SDL_CameraDeviceID instance_id; + SDL_CameraID instance_id; // Driver-specific hardware data on how to open device (`hidden` is driver-specific data _when opened_). void *handle; @@ -161,23 +161,23 @@ struct SDL_CameraDevice typedef struct SDL_CameraDriverImpl { void (*DetectDevices)(void); - int (*OpenDevice)(SDL_CameraDevice *device, const SDL_CameraSpec *spec); - void (*CloseDevice)(SDL_CameraDevice *device); - int (*WaitDevice)(SDL_CameraDevice *device); - int (*AcquireFrame)(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS); // set frame->pixels, frame->pitch, and *timestampNS! - void (*ReleaseFrame)(SDL_CameraDevice *device, SDL_Surface *frame); // Reclaim frame->pixels and frame->pitch! - void (*FreeDeviceHandle)(SDL_CameraDevice *device); // SDL is done with this device; free the handle from SDL_AddCameraDevice() + int (*OpenDevice)(SDL_Camera *device, const SDL_CameraSpec *spec); + void (*CloseDevice)(SDL_Camera *device); + int (*WaitDevice)(SDL_Camera *device); + int (*AcquireFrame)(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS); // set frame->pixels, frame->pitch, and *timestampNS! + void (*ReleaseFrame)(SDL_Camera *device, SDL_Surface *frame); // Reclaim frame->pixels and frame->pitch! + void (*FreeDeviceHandle)(SDL_Camera *device); // SDL is done with this device; free the handle from SDL_AddCamera() void (*Deinitialize)(void); SDL_bool ProvidesOwnCallbackThread; } SDL_CameraDriverImpl; -typedef struct SDL_PendingCameraDeviceEvent +typedef struct SDL_PendingCameraEvent { Uint32 type; - SDL_CameraDeviceID devid; - struct SDL_PendingCameraDeviceEvent *next; -} SDL_PendingCameraDeviceEvent; + SDL_CameraID devid; + struct SDL_PendingCameraEvent *next; +} SDL_PendingCameraEvent; typedef struct SDL_CameraDriver { @@ -187,8 +187,8 @@ typedef struct SDL_CameraDriver SDL_RWLock *device_hash_lock; // A rwlock that protects `device_hash` SDL_HashTable *device_hash; // the collection of currently-available camera devices - SDL_PendingCameraDeviceEvent pending_events; - SDL_PendingCameraDeviceEvent *pending_events_tail; + SDL_PendingCameraEvent pending_events; + SDL_PendingCameraEvent *pending_events_tail; SDL_AtomicInt device_count; SDL_AtomicInt shutting_down; // non-zero during SDL_Quit, so we known not to accept any last-minute device hotplugs. diff --git a/src/camera/android/SDL_camera_android.c b/src/camera/android/SDL_camera_android.c index ad3863f90360e..413e773213f93 100644 --- a/src/camera/android/SDL_camera_android.c +++ b/src/camera/android/SDL_camera_android.c @@ -289,12 +289,12 @@ static Uint32 format_sdl_to_android(SDL_PixelFormat fmt) } } -static int ANDROIDCAMERA_WaitDevice(SDL_CameraDevice *device) +static int ANDROIDCAMERA_WaitDevice(SDL_Camera *device) { return 0; // this isn't used atm, since we run our own thread via onImageAvailable callbacks. } -static int ANDROIDCAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int ANDROIDCAMERA_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { int retval = 1; media_status_t res; @@ -358,7 +358,7 @@ static int ANDROIDCAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *fra return retval; } -static void ANDROIDCAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void ANDROIDCAMERA_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { // !!! FIXME: this currently copies the data to the surface, but in theory we could just keep the AImage until ReleaseFrame... SDL_aligned_free(frame->pixels); @@ -369,7 +369,7 @@ static void onImageAvailable(void *context, AImageReader *reader) #if DEBUG_CAMERA SDL_Log("CAMERA: CB onImageAvailable"); #endif - SDL_CameraDevice *device = (SDL_CameraDevice *) context; + SDL_Camera *device = (SDL_Camera *) context; SDL_CameraThreadIterate(device); } @@ -378,7 +378,7 @@ static void onDisconnected(void *context, ACameraDevice *device) #if DEBUG_CAMERA SDL_Log("CAMERA: CB onDisconnected"); #endif - SDL_CameraDeviceDisconnected((SDL_CameraDevice *) context); + SDL_CameraDisconnected((SDL_Camera *) context); } static void onError(void *context, ACameraDevice *device, int error) @@ -386,12 +386,12 @@ static void onError(void *context, ACameraDevice *device, int error) #if DEBUG_CAMERA SDL_Log("CAMERA: CB onError"); #endif - SDL_CameraDeviceDisconnected((SDL_CameraDevice *) context); + SDL_CameraDisconnected((SDL_Camera *) context); } static void onClosed(void* context, ACameraCaptureSession *session) { - // SDL_CameraDevice *_this = (SDL_CameraDevice *) context; + // SDL_Camera *_this = (SDL_Camera *) context; #if DEBUG_CAMERA SDL_Log("CAMERA: CB onClosed"); #endif @@ -399,7 +399,7 @@ static void onClosed(void* context, ACameraCaptureSession *session) static void onReady(void* context, ACameraCaptureSession *session) { - // SDL_CameraDevice *_this = (SDL_CameraDevice *) context; + // SDL_Camera *_this = (SDL_Camera *) context; #if DEBUG_CAMERA SDL_Log("CAMERA: CB onReady"); #endif @@ -407,13 +407,13 @@ static void onReady(void* context, ACameraCaptureSession *session) static void onActive(void* context, ACameraCaptureSession *session) { - // SDL_CameraDevice *_this = (SDL_CameraDevice *) context; + // SDL_Camera *_this = (SDL_Camera *) context; #if DEBUG_CAMERA SDL_Log("CAMERA: CB onActive"); #endif } -static void ANDROIDCAMERA_CloseDevice(SDL_CameraDevice *device) +static void ANDROIDCAMERA_CloseDevice(SDL_Camera *device) { if (device && device->hidden) { struct SDL_PrivateCameraData *hidden = device->hidden; @@ -458,7 +458,7 @@ static void ANDROIDCAMERA_CloseDevice(SDL_CameraDevice *device) } // this is where the "opening" of the camera happens, after permission is granted. -static int PrepareCamera(SDL_CameraDevice *device) +static int PrepareCamera(SDL_Camera *device) { SDL_assert(device->hidden != NULL); @@ -483,7 +483,7 @@ static int PrepareCamera(SDL_CameraDevice *device) imglistener.context = device; imglistener.onImageAvailable = onImageAvailable; - // just in case SDL_OpenCameraDevice is overwriting device->spec as CameraPermissionCallback runs, we work from a different copy. + // just in case SDL_OpenCamera is overwriting device->spec as CameraPermissionCallback runs, we work from a different copy. const SDL_CameraSpec *spec = &device->hidden->requested_spec; if ((res = pACameraManager_openCamera(cameraMgr, (const char *) device->handle, &dev_callbacks, &device->hidden->device)) != ACAMERA_OK) { @@ -517,24 +517,24 @@ static int PrepareCamera(SDL_CameraDevice *device) static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, SDL_bool granted) { - SDL_CameraDevice *device = (SDL_CameraDevice *) userdata; + SDL_Camera *device = (SDL_Camera *) userdata; if (device->hidden != NULL) { // if device was already closed, don't send an event. if (!granted) { - SDL_CameraDevicePermissionOutcome(device, SDL_FALSE); // sorry, permission denied. + SDL_CameraPermissionOutcome(device, SDL_FALSE); // sorry, permission denied. } else if (PrepareCamera(device) < 0) { // permission given? Actually open the camera now. // uhoh, setup failed; since the app thinks we already "opened" the device, mark it as disconnected and don't report the permission. - SDL_CameraDeviceDisconnected(device); + SDL_CameraDisconnected(device); } else { // okay! We have permission to use the camera _and_ opening the hardware worked out, report that the camera is usable! - SDL_CameraDevicePermissionOutcome(device, SDL_TRUE); // go go go! + SDL_CameraPermissionOutcome(device, SDL_TRUE); // go go go! } } - UnrefPhysicalCameraDevice(device); // we ref'd this in OpenDevice, release the extra reference. + UnrefPhysicalCamera(device); // we ref'd this in OpenDevice, release the extra reference. } -static int ANDROIDCAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int ANDROIDCAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { #if 0 // !!! FIXME: for now, we'll just let this fail if it is going to fail, without checking for this /* Cannot open a second camera, while the first one is opened. @@ -555,19 +555,19 @@ static int ANDROIDCAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSp return -1; } - RefPhysicalCameraDevice(device); // ref'd until permission callback fires. + RefPhysicalCamera(device); // ref'd until permission callback fires. - // just in case SDL_OpenCameraDevice is overwriting device->spec as CameraPermissionCallback runs, we work from a different copy. + // just in case SDL_OpenCamera is overwriting device->spec as CameraPermissionCallback runs, we work from a different copy. SDL_copyp(&device->hidden->requested_spec, spec); if (SDL_AndroidRequestPermission("android.permission.CAMERA", CameraPermissionCallback, device) < 0) { - UnrefPhysicalCameraDevice(device); + UnrefPhysicalCamera(device); return -1; } return 0; // we don't open the camera until permission is granted, so always succeed for now. } -static void ANDROIDCAMERA_FreeDeviceHandle(SDL_CameraDevice *device) +static void ANDROIDCAMERA_FreeDeviceHandle(SDL_Camera *device) { if (device) { SDL_free(device->handle); @@ -666,7 +666,7 @@ static void GatherCameraSpecs(const char *devid, CameraFormatAddData *add_data, pACameraMetadata_free(metadata); } -static SDL_bool FindAndroidCameraDeviceByID(SDL_CameraDevice *device, void *userdata) +static SDL_bool FindAndroidCameraByID(SDL_Camera *device, void *userdata) { const char *devid = (const char *) userdata; return (SDL_strcmp(devid, (const char *) device->handle) == 0); @@ -678,7 +678,7 @@ static void MaybeAddDevice(const char *devid) SDL_Log("CAMERA: MaybeAddDevice('%s')", devid); #endif - if (SDL_FindPhysicalCameraDeviceByCallback(FindAndroidCameraDeviceByID, (void *) devid)) { + if (SDL_FindPhysicalCameraByCallback(FindAndroidCameraByID, (void *) devid)) { return; // already have this one. } @@ -689,7 +689,7 @@ static void MaybeAddDevice(const char *devid) if (add_data.num_specs > 0) { char *namecpy = SDL_strdup(devid); if (namecpy) { - SDL_CameraDevice *device = SDL_AddCameraDevice(fullname, position, add_data.num_specs, add_data.specs, namecpy); + SDL_Camera *device = SDL_AddCamera(fullname, position, add_data.num_specs, add_data.specs, namecpy); if (!device) { SDL_free(namecpy); } @@ -725,9 +725,9 @@ static void onCameraUnavailable(void *context, const char *cameraId) // THIS CALLBACK FIRES WHEN YOU OPEN THE DEVICE YOURSELF. :( // Make sure we don't have the device opened, in which case onDisconnected will fire instead if actually lost. - SDL_CameraDevice *device = SDL_FindPhysicalCameraDeviceByCallback(FindAndroidCameraDeviceByID, (void *) cameraId); + SDL_Camera *device = SDL_FindPhysicalCameraByCallback(FindAndroidCameraByID, (void *) cameraId); if (device && !device->hidden) { - SDL_CameraDeviceDisconnected(device); + SDL_CameraDisconnected(device); } } diff --git a/src/camera/coremedia/SDL_camera_coremedia.m b/src/camera/coremedia/SDL_camera_coremedia.m index 133dc2b45a4e1..f6462e7091805 100644 --- a/src/camera/coremedia/SDL_camera_coremedia.m +++ b/src/camera/coremedia/SDL_camera_coremedia.m @@ -83,16 +83,16 @@ @implementation SDLPrivateCameraData @end -static SDL_bool CheckCameraPermissions(SDL_CameraDevice *device) +static SDL_bool CheckCameraPermissions(SDL_Camera *device) { if (device->permission == 0) { // still expecting a permission result. if (@available(macOS 14, *)) { const AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo]; if (status != AVAuthorizationStatusNotDetermined) { // NotDetermined == still waiting for an answer from the user. - SDL_CameraDevicePermissionOutcome(device, (status == AVAuthorizationStatusAuthorized) ? SDL_TRUE : SDL_FALSE); + SDL_CameraPermissionOutcome(device, (status == AVAuthorizationStatusAuthorized) ? SDL_TRUE : SDL_FALSE); } } else { - SDL_CameraDevicePermissionOutcome(device, SDL_TRUE); // always allowed (or just unqueryable...?) on older macOS. + SDL_CameraPermissionOutcome(device, SDL_TRUE); // always allowed (or just unqueryable...?) on older macOS. } } @@ -102,14 +102,14 @@ static SDL_bool CheckCameraPermissions(SDL_CameraDevice *device) // this delegate just receives new video frames on a Grand Central Dispatch queue, and fires off the // main device thread iterate function directly to consume it. @interface SDLCaptureVideoDataOutputSampleBufferDelegate : NSObject - @property SDL_CameraDevice *device; - -(id) init:(SDL_CameraDevice *) dev; + @property SDL_Camera *device; + -(id) init:(SDL_Camera *) dev; -(void) captureOutput:(AVCaptureOutput *)output didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection; @end @implementation SDLCaptureVideoDataOutputSampleBufferDelegate - -(id) init:(SDL_CameraDevice *) dev { + -(id) init:(SDL_Camera *) dev { if ( self = [super init] ) { _device = dev; } @@ -118,7 +118,7 @@ -(id) init:(SDL_CameraDevice *) dev { - (void) captureOutput:(AVCaptureOutput *)output didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { - SDL_CameraDevice *device = self.device; + SDL_Camera *device = self.device; if (!device || !device->hidden) { return; // oh well. } @@ -141,12 +141,12 @@ - (void)captureOutput:(AVCaptureOutput *)output didDropSampleBuffer:(CMSampleBuf } @end -static int COREMEDIA_WaitDevice(SDL_CameraDevice *device) +static int COREMEDIA_WaitDevice(SDL_Camera *device) { return 0; // this isn't used atm, since we run our own thread out of Grand Central Dispatch. } -static int COREMEDIA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int COREMEDIA_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { int retval = 1; SDLPrivateCameraData *hidden = (__bridge SDLPrivateCameraData *) device->hidden; @@ -222,13 +222,13 @@ static int COREMEDIA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, return retval; } -static void COREMEDIA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void COREMEDIA_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { // !!! FIXME: this currently copies the data to the surface, but in theory we could just keep this locked until ReleaseFrame... SDL_aligned_free(frame->pixels); } -static void COREMEDIA_CloseDevice(SDL_CameraDevice *device) +static void COREMEDIA_CloseDevice(SDL_Camera *device) { if (device && device->hidden) { SDLPrivateCameraData *hidden = (SDLPrivateCameraData *) CFBridgingRelease(device->hidden); @@ -248,7 +248,7 @@ static void COREMEDIA_CloseDevice(SDL_CameraDevice *device) } } -static int COREMEDIA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int COREMEDIA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { AVCaptureDevice *avdevice = (__bridge AVCaptureDevice *) device->handle; @@ -367,7 +367,7 @@ static int COREMEDIA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec * return 0; } -static void COREMEDIA_FreeDeviceHandle(SDL_CameraDevice *device) +static void COREMEDIA_FreeDeviceHandle(SDL_Camera *device) { if (device && device->handle) { CFBridgingRelease(device->handle); @@ -408,7 +408,7 @@ static void GatherCameraSpecs(AVCaptureDevice *device, CameraFormatAddData *add_ } } -static SDL_bool FindCoreMediaCameraDeviceByUniqueID(SDL_CameraDevice *device, void *userdata) +static SDL_bool FindCoreMediaCameraByUniqueID(SDL_Camera *device, void *userdata) { NSString *uniqueid = (__bridge NSString *) userdata; AVCaptureDevice *avdev = (__bridge AVCaptureDevice *) device->handle; @@ -421,7 +421,7 @@ static void MaybeAddDevice(AVCaptureDevice *avdevice) return; // not connected. } else if (![avdevice hasMediaType:AVMediaTypeVideo]) { return; // not a camera. - } else if (SDL_FindPhysicalCameraDeviceByCallback(FindCoreMediaCameraDeviceByUniqueID, (__bridge void *) avdevice.uniqueID)) { + } else if (SDL_FindPhysicalCameraByCallback(FindCoreMediaCameraByUniqueID, (__bridge void *) avdevice.uniqueID)) { return; // already have this one. } @@ -434,7 +434,7 @@ static void MaybeAddDevice(AVCaptureDevice *avdevice) } else if (avdevice.position == AVCaptureDevicePositionBack) { position = SDL_CAMERA_POSITION_BACK_FACING; } - SDL_AddCameraDevice(avdevice.localizedName.UTF8String, position, add_data.num_specs, add_data.specs, (void *) CFBridgingRetain(avdevice)); + SDL_AddCamera(avdevice.localizedName.UTF8String, position, add_data.num_specs, add_data.specs, (void *) CFBridgingRetain(avdevice)); } SDL_free(add_data.specs); diff --git a/src/camera/dummy/SDL_camera_dummy.c b/src/camera/dummy/SDL_camera_dummy.c index b93eecbbe1824..1c846b1e891a2 100644 --- a/src/camera/dummy/SDL_camera_dummy.c +++ b/src/camera/dummy/SDL_camera_dummy.c @@ -24,26 +24,26 @@ #include "../SDL_syscamera.h" -static int DUMMYCAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int DUMMYCAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { return SDL_Unsupported(); } -static void DUMMYCAMERA_CloseDevice(SDL_CameraDevice *device) +static void DUMMYCAMERA_CloseDevice(SDL_Camera *device) { } -static int DUMMYCAMERA_WaitDevice(SDL_CameraDevice *device) +static int DUMMYCAMERA_WaitDevice(SDL_Camera *device) { return SDL_Unsupported(); } -static int DUMMYCAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int DUMMYCAMERA_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { return SDL_Unsupported(); } -static void DUMMYCAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void DUMMYCAMERA_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { } @@ -51,7 +51,7 @@ static void DUMMYCAMERA_DetectDevices(void) { } -static void DUMMYCAMERA_FreeDeviceHandle(SDL_CameraDevice *device) +static void DUMMYCAMERA_FreeDeviceHandle(SDL_Camera *device) { } diff --git a/src/camera/emscripten/SDL_camera_emscripten.c b/src/camera/emscripten/SDL_camera_emscripten.c index 39278d8db2e3b..1d8b33aa9d9f7 100644 --- a/src/camera/emscripten/SDL_camera_emscripten.c +++ b/src/camera/emscripten/SDL_camera_emscripten.c @@ -34,13 +34,13 @@ EM_JS_DEPS(sdlcamera, "$dynCall"); -static int EMSCRIPTENCAMERA_WaitDevice(SDL_CameraDevice *device) +static int EMSCRIPTENCAMERA_WaitDevice(SDL_Camera *device) { SDL_assert(!"This shouldn't be called"); // we aren't using SDL's internal thread. return -1; } -static int EMSCRIPTENCAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int EMSCRIPTENCAMERA_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { void *rgba = SDL_malloc(device->actual_spec.width * device->actual_spec.height * 4); if (!rgba) { @@ -76,12 +76,12 @@ static int EMSCRIPTENCAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface * return 1; } -static void EMSCRIPTENCAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void EMSCRIPTENCAMERA_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { SDL_free(frame->pixels); } -static void EMSCRIPTENCAMERA_CloseDevice(SDL_CameraDevice *device) +static void EMSCRIPTENCAMERA_CloseDevice(SDL_Camera *device) { if (device) { MAIN_THREAD_EM_ASM({ @@ -98,16 +98,16 @@ static void EMSCRIPTENCAMERA_CloseDevice(SDL_CameraDevice *device) } } -static void SDLEmscriptenCameraDevicePermissionOutcome(SDL_CameraDevice *device, int approved, int w, int h, int fps) +static void SDLEmscriptenCameraPermissionOutcome(SDL_Camera *device, int approved, int w, int h, int fps) { device->spec.width = device->actual_spec.width = w; device->spec.height = device->actual_spec.height = h; device->spec.framerate_numerator = device->actual_spec.framerate_numerator = fps; device->spec.framerate_denominator = device->actual_spec.framerate_denominator = 1; - SDL_CameraDevicePermissionOutcome(device, approved ? SDL_TRUE : SDL_FALSE); + SDL_CameraPermissionOutcome(device, approved ? SDL_TRUE : SDL_FALSE); } -static int EMSCRIPTENCAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int EMSCRIPTENCAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { MAIN_THREAD_EM_ASM({ // Since we can't get actual specs until we make a move that prompts the user for @@ -199,12 +199,12 @@ static int EMSCRIPTENCAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_Camer console.error("Tried to open camera but it threw an error! " + err.name + ": " + err.message); dynCall('viiiii', outcome, [device, 0, 0, 0, 0]); // we call this a permission error, because it probably is. }); - }, device, spec->width, spec->height, spec->framerate_numerator, spec->framerate_denominator, SDLEmscriptenCameraDevicePermissionOutcome, SDL_CameraThreadIterate); + }, device, spec->width, spec->height, spec->framerate_numerator, spec->framerate_denominator, SDLEmscriptenCameraPermissionOutcome, SDL_CameraThreadIterate); return 0; // the real work waits until the user approves a camera. } -static void EMSCRIPTENCAMERA_FreeDeviceHandle(SDL_CameraDevice *device) +static void EMSCRIPTENCAMERA_FreeDeviceHandle(SDL_Camera *device) { // no-op. } @@ -228,7 +228,7 @@ static void EMSCRIPTENCAMERA_DetectDevices(void) // will pop up a user permission dialog warning them we're trying to access the camera, and we generally // don't want that during SDL_Init(). if (supported) { - SDL_AddCameraDevice("Web browser's camera", SDL_CAMERA_POSITION_UNKNOWN, 0, NULL, (void *) (size_t) 0x1); + SDL_AddCamera("Web browser's camera", SDL_CAMERA_POSITION_UNKNOWN, 0, NULL, (void *) (size_t) 0x1); } } diff --git a/src/camera/mediafoundation/SDL_camera_mediafoundation.c b/src/camera/mediafoundation/SDL_camera_mediafoundation.c index c8cbbf34f4441..e8ab8a2f7d795 100644 --- a/src/camera/mediafoundation/SDL_camera_mediafoundation.c +++ b/src/camera/mediafoundation/SDL_camera_mediafoundation.c @@ -347,7 +347,7 @@ typedef struct SDL_PrivateCameraData int pitch; } SDL_PrivateCameraData; -static int MEDIAFOUNDATION_WaitDevice(SDL_CameraDevice *device) +static int MEDIAFOUNDATION_WaitDevice(SDL_Camera *device) { SDL_assert(device->hidden->current_sample == NULL); @@ -421,7 +421,7 @@ static void SDLCALL CleanupIMFMediaBuffer(void *userdata, void *value) SDL_free(objs); } -static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { SDL_assert(device->hidden->current_sample != NULL); @@ -511,7 +511,7 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f return retval; } -static void MEDIAFOUNDATION_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void MEDIAFOUNDATION_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { const SDL_PropertiesID surfprops = SDL_GetSurfaceProperties(frame); if (surfprops) { @@ -522,7 +522,7 @@ static void MEDIAFOUNDATION_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface * #else -static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int MEDIAFOUNDATION_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { SDL_assert(device->hidden->current_sample != NULL); @@ -627,14 +627,14 @@ static int MEDIAFOUNDATION_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *f return retval; } -static void MEDIAFOUNDATION_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void MEDIAFOUNDATION_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { SDL_aligned_free(frame->pixels); } #endif -static void MEDIAFOUNDATION_CloseDevice(SDL_CameraDevice *device) +static void MEDIAFOUNDATION_CloseDevice(SDL_Camera *device) { if (device && device->hidden) { if (device->hidden->srcreader) { @@ -695,7 +695,7 @@ static HRESULT GetDefaultStride(IMFMediaType *pType, LONG *plStride) } -static int MEDIAFOUNDATION_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int MEDIAFOUNDATION_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { const char *utf8symlink = (const char *) device->handle; IMFAttributes *attrs = NULL; @@ -821,7 +821,7 @@ static int MEDIAFOUNDATION_OpenDevice(SDL_CameraDevice *device, const SDL_Camera IMFMediaSource_Release(source); // srcreader is holding a reference to this. // There is no user permission prompt for camera access (I think?) - SDL_CameraDevicePermissionOutcome(device, SDL_TRUE); + SDL_CameraPermissionOutcome(device, SDL_TRUE); #undef CHECK_HRESULT @@ -864,7 +864,7 @@ static int MEDIAFOUNDATION_OpenDevice(SDL_CameraDevice *device, const SDL_Camera return -1; } -static void MEDIAFOUNDATION_FreeDeviceHandle(SDL_CameraDevice *device) +static void MEDIAFOUNDATION_FreeDeviceHandle(SDL_Camera *device) { if (device) { SDL_free(device->handle); // the device's symlink string. @@ -962,7 +962,7 @@ static void GatherCameraSpecs(IMFMediaSource *source, CameraFormatAddData *add_d IMFPresentationDescriptor_Release(presentdesc); } -static SDL_bool FindMediaFoundationCameraDeviceBySymlink(SDL_CameraDevice *device, void *userdata) +static SDL_bool FindMediaFoundationCameraBySymlink(SDL_Camera *device, void *userdata) { return (SDL_strcmp((const char *) device->handle, (const char *) userdata) == 0); } @@ -971,7 +971,7 @@ static void MaybeAddDevice(IMFActivate *activation) { char *symlink = QueryActivationObjectString(activation, &SDL_MF_DEVSOURCE_ATTRIBUTE_SOURCE_TYPE_VIDCAP_SYMBOLIC_LINK); - if (SDL_FindPhysicalCameraDeviceByCallback(FindMediaFoundationCameraDeviceBySymlink, symlink)) { + if (SDL_FindPhysicalCameraByCallback(FindMediaFoundationCameraBySymlink, symlink)) { SDL_free(symlink); return; // already have this one. } @@ -985,7 +985,7 @@ static void MaybeAddDevice(IMFActivate *activation) CameraFormatAddData add_data; GatherCameraSpecs(source, &add_data); if (add_data.num_specs > 0) { - SDL_AddCameraDevice(name, SDL_CAMERA_POSITION_UNKNOWN, add_data.num_specs, add_data.specs, symlink); + SDL_AddCamera(name, SDL_CAMERA_POSITION_UNKNOWN, add_data.num_specs, add_data.specs, symlink); } SDL_free(add_data.specs); IMFActivate_ShutdownObject(activation); diff --git a/src/camera/pipewire/SDL_camera_pipewire.c b/src/camera/pipewire/SDL_camera_pipewire.c index 3b297c37ba84c..73daf5f567012 100644 --- a/src/camera/pipewire/SDL_camera_pipewire.c +++ b/src/camera/pipewire/SDL_camera_pipewire.c @@ -429,12 +429,12 @@ static void on_process(void *data) static void on_stream_state_changed(void *data, enum pw_stream_state old, enum pw_stream_state state, const char *error) { - SDL_CameraDevice *device = data; + SDL_Camera *device = data; switch (state) { case PW_STREAM_STATE_UNCONNECTED: break; case PW_STREAM_STATE_STREAMING: - SDL_CameraDevicePermissionOutcome(device, SDL_TRUE); + SDL_CameraPermissionOutcome(device, SDL_TRUE); break; default: break; @@ -447,13 +447,13 @@ static void on_stream_param_changed(void *data, uint32_t id, const struct spa_po static void on_add_buffer(void *data, struct pw_buffer *buffer) { - SDL_CameraDevice *device = data; + SDL_Camera *device = data; pw_array_add_ptr(&device->hidden->buffers, buffer); } static void on_remove_buffer(void *data, struct pw_buffer *buffer) { - SDL_CameraDevice *device = data; + SDL_Camera *device = data; struct pw_buffer **p; pw_array_for_each(p, &device->hidden->buffers) { if (*p == buffer) { @@ -472,7 +472,7 @@ static const struct pw_stream_events stream_events = { .process = on_process, }; -static int PIPEWIRECAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int PIPEWIRECAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { struct pw_properties *props; const struct spa_pod *params[3]; @@ -533,7 +533,7 @@ static int PIPEWIRECAMERA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraS return 0; } -static void PIPEWIRECAMERA_CloseDevice(SDL_CameraDevice *device) +static void PIPEWIRECAMERA_CloseDevice(SDL_Camera *device) { if (!device) { return; @@ -550,7 +550,7 @@ static void PIPEWIRECAMERA_CloseDevice(SDL_CameraDevice *device) PIPEWIRE_pw_thread_loop_unlock(hotplug.loop); } -static int PIPEWIRECAMERA_WaitDevice(SDL_CameraDevice *device) +static int PIPEWIRECAMERA_WaitDevice(SDL_Camera *device) { PIPEWIRE_pw_thread_loop_lock(hotplug.loop); PIPEWIRE_pw_thread_loop_wait(hotplug.loop); @@ -558,7 +558,7 @@ static int PIPEWIRECAMERA_WaitDevice(SDL_CameraDevice *device) return 0; } -static int PIPEWIRECAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int PIPEWIRECAMERA_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { struct pw_buffer *b; @@ -590,7 +590,7 @@ static int PIPEWIRECAMERA_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *fr return 1; } -static void PIPEWIRECAMERA_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void PIPEWIRECAMERA_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { struct pw_buffer **p; PIPEWIRE_pw_thread_loop_lock(hotplug.loop); @@ -717,7 +717,7 @@ static void add_device(struct global *g) collect_format(&data, p); } if (data.num_specs > 0) { - SDL_AddCameraDevice(g->name, SDL_CAMERA_POSITION_UNKNOWN, + SDL_AddCamera(g->name, SDL_CAMERA_POSITION_UNKNOWN, data.num_specs, data.specs, g); } SDL_free(data.specs); @@ -747,7 +747,7 @@ static void PIPEWIRECAMERA_DetectDevices(void) PIPEWIRE_pw_thread_loop_unlock(hotplug.loop); } -static void PIPEWIRECAMERA_FreeDeviceHandle(SDL_CameraDevice *device) +static void PIPEWIRECAMERA_FreeDeviceHandle(SDL_Camera *device) { } diff --git a/src/camera/v4l2/SDL_camera_v4l2.c b/src/camera/v4l2/SDL_camera_v4l2.c index de8bab62a8eb2..de904737bab85 100644 --- a/src/camera/v4l2/SDL_camera_v4l2.c +++ b/src/camera/v4l2/SDL_camera_v4l2.c @@ -88,7 +88,7 @@ static int xioctl(int fh, int request, void *arg) return r; } -static int V4L2_WaitDevice(SDL_CameraDevice *device) +static int V4L2_WaitDevice(SDL_Camera *device) { const int fd = device->hidden->fd; @@ -118,7 +118,7 @@ static int V4L2_WaitDevice(SDL_CameraDevice *device) return retval; } -static int V4L2_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint64 *timestampNS) +static int V4L2_AcquireFrame(SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS) { const int fd = device->hidden->fd; const io_method io = device->hidden->io; @@ -232,7 +232,7 @@ static int V4L2_AcquireFrame(SDL_CameraDevice *device, SDL_Surface *frame, Uint6 return 1; } -static void V4L2_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) +static void V4L2_ReleaseFrame(SDL_Camera *device, SDL_Surface *frame) { struct v4l2_buffer buf; const int fd = device->hidden->fd; @@ -289,7 +289,7 @@ static void V4L2_ReleaseFrame(SDL_CameraDevice *device, SDL_Surface *frame) } } -static int EnqueueBuffers(SDL_CameraDevice *device) +static int EnqueueBuffers(SDL_Camera *device) { const int fd = device->hidden->fd; const io_method io = device->hidden->io; @@ -338,14 +338,14 @@ static int EnqueueBuffers(SDL_CameraDevice *device) return 0; } -static int AllocBufferRead(SDL_CameraDevice *device, size_t buffer_size) +static int AllocBufferRead(SDL_Camera *device, size_t buffer_size) { device->hidden->buffers[0].length = buffer_size; device->hidden->buffers[0].start = SDL_calloc(1, buffer_size); return device->hidden->buffers[0].start ? 0 : -1; } -static int AllocBufferMmap(SDL_CameraDevice *device) +static int AllocBufferMmap(SDL_Camera *device) { const int fd = device->hidden->fd; int i; @@ -377,7 +377,7 @@ static int AllocBufferMmap(SDL_CameraDevice *device) return 0; } -static int AllocBufferUserPtr(SDL_CameraDevice *device, size_t buffer_size) +static int AllocBufferUserPtr(SDL_Camera *device, size_t buffer_size) { int i; for (i = 0; i < device->hidden->nb_buffers; ++i) { @@ -419,7 +419,7 @@ static Uint32 format_sdl_to_v4l2(SDL_PixelFormat fmt) } } -static void V4L2_CloseDevice(SDL_CameraDevice *device) +static void V4L2_CloseDevice(SDL_Camera *device) { if (!device) { return; @@ -470,7 +470,7 @@ static void V4L2_CloseDevice(SDL_CameraDevice *device) } } -static int V4L2_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) +static int V4L2_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *spec) { const V4L2DeviceHandle *handle = (const V4L2DeviceHandle *) device->handle; struct stat st; @@ -634,12 +634,12 @@ static int V4L2_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *spec) } // Currently there is no user permission prompt for camera access, but maybe there will be a D-Bus portal interface at some point. - SDL_CameraDevicePermissionOutcome(device, SDL_TRUE); + SDL_CameraPermissionOutcome(device, SDL_TRUE); return 0; } -static SDL_bool FindV4L2CameraDeviceByBusInfoCallback(SDL_CameraDevice *device, void *userdata) +static SDL_bool FindV4L2CameraByBusInfoCallback(SDL_Camera *device, void *userdata) { const V4L2DeviceHandle *handle = (const V4L2DeviceHandle *) device->handle; return (SDL_strcmp(handle->bus_info, (const char *) userdata) == 0); @@ -713,7 +713,7 @@ static void MaybeAddDevice(const char *path) } else if ((vcap.device_caps & V4L2_CAP_VIDEO_CAPTURE) == 0) { close(fd); return; // not a video capture device. - } else if (SDL_FindPhysicalCameraDeviceByCallback(FindV4L2CameraDeviceByBusInfoCallback, vcap.bus_info)) { + } else if (SDL_FindPhysicalCameraByCallback(FindV4L2CameraByBusInfoCallback, vcap.bus_info)) { close(fd); return; // already have it. } @@ -795,7 +795,7 @@ static void MaybeAddDevice(const char *path) if (handle->path) { handle->bus_info = SDL_strdup((char *)vcap.bus_info); if (handle->bus_info) { - if (SDL_AddCameraDevice((const char *) vcap.card, SDL_CAMERA_POSITION_UNKNOWN, add_data.num_specs, add_data.specs, handle)) { + if (SDL_AddCamera((const char *) vcap.card, SDL_CAMERA_POSITION_UNKNOWN, add_data.num_specs, add_data.specs, handle)) { SDL_free(add_data.specs); return; // good to go. } @@ -809,7 +809,7 @@ static void MaybeAddDevice(const char *path) SDL_free(add_data.specs); } -static void V4L2_FreeDeviceHandle(SDL_CameraDevice *device) +static void V4L2_FreeDeviceHandle(SDL_Camera *device) { if (device) { V4L2DeviceHandle *handle = (V4L2DeviceHandle *) device->handle; @@ -820,7 +820,7 @@ static void V4L2_FreeDeviceHandle(SDL_CameraDevice *device) } #ifdef SDL_USE_LIBUDEV -static SDL_bool FindV4L2CameraDeviceByPathCallback(SDL_CameraDevice *device, void *userdata) +static SDL_bool FindV4L2CameraByPathCallback(SDL_Camera *device, void *userdata) { const V4L2DeviceHandle *handle = (const V4L2DeviceHandle *) device->handle; return (SDL_strcmp(handle->path, (const char *) userdata) == 0); @@ -829,7 +829,7 @@ static SDL_bool FindV4L2CameraDeviceByPathCallback(SDL_CameraDevice *device, voi static void MaybeRemoveDevice(const char *path) { if (path) { - SDL_CameraDeviceDisconnected(SDL_FindPhysicalCameraDeviceByCallback(FindV4L2CameraDeviceByPathCallback, (void *) path)); + SDL_CameraDisconnected(SDL_FindPhysicalCameraByCallback(FindV4L2CameraByPathCallback, (void *) path)); } } diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index ed257f0ea04a5..e2a6aa8353296 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -186,13 +186,13 @@ SDL3_0.0.0 { SDL_GetBooleanProperty; SDL_GetCPUCacheLineSize; SDL_GetCPUCount; - SDL_GetCameraDeviceName; - SDL_GetCameraDevicePosition; - SDL_GetCameraDeviceSupportedFormats; - SDL_GetCameraDevices; + SDL_GetCameraName; + SDL_GetCameraPosition; + SDL_GetCameraSupportedFormats; + SDL_GetCameras; SDL_GetCameraDriver; SDL_GetCameraFormat; - SDL_GetCameraInstanceID; + SDL_GetCameraID; SDL_GetCameraPermissionState; SDL_GetCameraProperties; SDL_GetClipboardData; @@ -591,7 +591,7 @@ SDL3_0.0.0 { SDL_OnApplicationWillTerminate; SDL_OpenAudioDevice; SDL_OpenAudioDeviceStream; - SDL_OpenCameraDevice; + SDL_OpenCamera; SDL_OpenFileStorage; SDL_OpenGamepad; SDL_OpenHaptic; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 21b84b26b6772..3b8972f163ddf 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -211,13 +211,13 @@ #define SDL_GetBooleanProperty SDL_GetBooleanProperty_REAL #define SDL_GetCPUCacheLineSize SDL_GetCPUCacheLineSize_REAL #define SDL_GetCPUCount SDL_GetCPUCount_REAL -#define SDL_GetCameraDeviceName SDL_GetCameraDeviceName_REAL -#define SDL_GetCameraDevicePosition SDL_GetCameraDevicePosition_REAL -#define SDL_GetCameraDeviceSupportedFormats SDL_GetCameraDeviceSupportedFormats_REAL -#define SDL_GetCameraDevices SDL_GetCameraDevices_REAL +#define SDL_GetCameraName SDL_GetCameraName_REAL +#define SDL_GetCameraPosition SDL_GetCameraPosition_REAL +#define SDL_GetCameraSupportedFormats SDL_GetCameraSupportedFormats_REAL +#define SDL_GetCameras SDL_GetCameras_REAL #define SDL_GetCameraDriver SDL_GetCameraDriver_REAL #define SDL_GetCameraFormat SDL_GetCameraFormat_REAL -#define SDL_GetCameraInstanceID SDL_GetCameraInstanceID_REAL +#define SDL_GetCameraID SDL_GetCameraID_REAL #define SDL_GetCameraPermissionState SDL_GetCameraPermissionState_REAL #define SDL_GetCameraProperties SDL_GetCameraProperties_REAL #define SDL_GetClipboardData SDL_GetClipboardData_REAL @@ -616,7 +616,7 @@ #define SDL_OnApplicationWillTerminate SDL_OnApplicationWillTerminate_REAL #define SDL_OpenAudioDevice SDL_OpenAudioDevice_REAL #define SDL_OpenAudioDeviceStream SDL_OpenAudioDeviceStream_REAL -#define SDL_OpenCameraDevice SDL_OpenCameraDevice_REAL +#define SDL_OpenCamera SDL_OpenCamera_REAL #define SDL_OpenFileStorage SDL_OpenFileStorage_REAL #define SDL_OpenGamepad SDL_OpenGamepad_REAL #define SDL_OpenHaptic SDL_OpenHaptic_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 917e35ad45cc1..a49a820132080 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -231,13 +231,13 @@ SDL_DYNAPI_PROC(char*,SDL_GetBasePath,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCacheLineSize,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCount,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetCameraDeviceName,(SDL_CameraDeviceID a),(a),return) -SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraDevicePosition,(SDL_CameraDeviceID a),(a),return) -SDL_DYNAPI_PROC(SDL_CameraSpec*,SDL_GetCameraDeviceSupportedFormats,(SDL_CameraDeviceID a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_CameraDeviceID*,SDL_GetCameraDevices,(int *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetCameraName,(SDL_CameraID a),(a),return) +SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraPosition,(SDL_CameraID a),(a),return) +SDL_DYNAPI_PROC(SDL_CameraSpec*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetCameraDriver,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetCameraFormat,(SDL_Camera *a, SDL_CameraSpec *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_CameraDeviceID,SDL_GetCameraInstanceID,(SDL_Camera *a),(a),return) +SDL_DYNAPI_PROC(SDL_CameraID,SDL_GetCameraID,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetCameraPermissionState,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetCameraProperties,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) @@ -627,7 +627,7 @@ SDL_DYNAPI_PROC(void,SDL_OnApplicationWillResignActive,(void),(),) SDL_DYNAPI_PROC(void,SDL_OnApplicationWillTerminate,(void),(),) SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_OpenAudioDevice,(SDL_AudioDeviceID a, const SDL_AudioSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_AudioStream*,SDL_OpenAudioDeviceStream,(SDL_AudioDeviceID a, const SDL_AudioSpec *b, SDL_AudioStreamCallback c, void *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(SDL_Camera*,SDL_OpenCameraDevice,(SDL_CameraDeviceID a, const SDL_CameraSpec *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_Camera*,SDL_OpenCamera,(SDL_CameraID a, const SDL_CameraSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Storage*,SDL_OpenFileStorage,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_OpenGamepad,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Haptic*,SDL_OpenHaptic,(SDL_HapticID a),(a),return) diff --git a/test/testcamera.c b/test/testcamera.c index 6565edeb88f5c..adf3100c74335 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -23,8 +23,8 @@ static SDL_CameraSpec spec; static SDL_Texture *texture = NULL; static SDL_bool texture_updated = SDL_FALSE; static SDL_Surface *frame_current = NULL; -static SDL_CameraDeviceID front_camera = 0; -static SDL_CameraDeviceID back_camera = 0; +static SDL_CameraID front_camera = 0; +static SDL_CameraID back_camera = 0; int SDL_AppInit(void **appstate, int argc, char *argv[]) { @@ -87,19 +87,19 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) return SDL_APP_FAILURE; } - SDL_CameraDeviceID *devices = SDL_GetCameraDevices(&devcount); + SDL_CameraID *devices = SDL_GetCameras(&devcount); if (!devices) { - SDL_Log("SDL_GetCameraDevices failed: %s", SDL_GetError()); + SDL_Log("SDL_GetCameras failed: %s", SDL_GetError()); return SDL_APP_FAILURE; } - SDL_CameraDeviceID camera_id = 0; + SDL_CameraID camera_id = 0; SDL_Log("Saw %d camera devices.", devcount); for (i = 0; i < devcount; i++) { - const SDL_CameraDeviceID device = devices[i]; - const char *name = SDL_GetCameraDeviceName(device); - const SDL_CameraPosition position = SDL_GetCameraDevicePosition(device); + const SDL_CameraID device = devices[i]; + const char *name = SDL_GetCameraName(device); + const SDL_CameraPosition position = SDL_GetCameraPosition(device); const char *posstr = ""; if (position == SDL_CAMERA_POSITION_FRONT_FACING) { front_camera = device; @@ -137,13 +137,13 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) spec.framerate_numerator = 1000; spec.framerate_denominator = 1; - camera = SDL_OpenCameraDevice(camera_id, pspec); + camera = SDL_OpenCamera(camera_id, pspec); if (!camera) { SDL_Log("Failed to open camera device: %s", SDL_GetError()); return SDL_APP_FAILURE; } - SDL_snprintf(window_title, sizeof (window_title), "testcamera: %s (%s)", SDL_GetCameraDeviceName(camera_id), SDL_GetCurrentCameraDriver()); + SDL_snprintf(window_title, sizeof (window_title), "testcamera: %s (%s)", SDL_GetCameraName(camera_id), SDL_GetCurrentCameraDriver()); SDL_SetWindowTitle(window, window_title); return SDL_APP_CONTINUE; @@ -158,8 +158,8 @@ static int FlipCamera(void) } if (camera) { - const SDL_CameraDeviceID current = SDL_GetCameraInstanceID(camera); - SDL_CameraDeviceID nextcam = 0; + const SDL_CameraID current = SDL_GetCameraID(camera); + SDL_CameraID nextcam = 0; if (current == front_camera) { nextcam = back_camera; } else if (current == back_camera) { @@ -181,7 +181,7 @@ static int FlipCamera(void) texture = NULL; /* will rebuild when new camera is approved. */ } - camera = SDL_OpenCameraDevice(nextcam, NULL); + camera = SDL_OpenCamera(nextcam, NULL); if (!camera) { SDL_Log("Failed to open camera device: %s", SDL_GetError()); return SDL_APP_FAILURE; From 5836b880b44fe8802b64365a5e6506b20ad184a4 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 12:33:47 -0700 Subject: [PATCH 312/431] Sorted symbols --- src/dynapi/SDL_dynapi.sym | 10 +++++----- src/dynapi/SDL_dynapi_overrides.h | 10 +++++----- src/dynapi/SDL_dynapi_procs.h | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index e2a6aa8353296..fa463caf03ec5 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -186,15 +186,15 @@ SDL3_0.0.0 { SDL_GetBooleanProperty; SDL_GetCPUCacheLineSize; SDL_GetCPUCount; - SDL_GetCameraName; - SDL_GetCameraPosition; - SDL_GetCameraSupportedFormats; - SDL_GetCameras; SDL_GetCameraDriver; SDL_GetCameraFormat; SDL_GetCameraID; + SDL_GetCameraName; SDL_GetCameraPermissionState; + SDL_GetCameraPosition; SDL_GetCameraProperties; + SDL_GetCameraSupportedFormats; + SDL_GetCameras; SDL_GetClipboardData; SDL_GetClipboardText; SDL_GetClosestFullscreenDisplayMode; @@ -379,8 +379,8 @@ SDL3_0.0.0 { SDL_GetPropertyType; SDL_GetRGB; SDL_GetRGBA; - SDL_GetRealGamepadTypeFromID; SDL_GetRealGamepadType; + SDL_GetRealGamepadTypeFromID; SDL_GetRectAndLineIntersection; SDL_GetRectAndLineIntersectionFloat; SDL_GetRectEnclosingPoints; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 3b8972f163ddf..5899c87846045 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -211,15 +211,15 @@ #define SDL_GetBooleanProperty SDL_GetBooleanProperty_REAL #define SDL_GetCPUCacheLineSize SDL_GetCPUCacheLineSize_REAL #define SDL_GetCPUCount SDL_GetCPUCount_REAL -#define SDL_GetCameraName SDL_GetCameraName_REAL -#define SDL_GetCameraPosition SDL_GetCameraPosition_REAL -#define SDL_GetCameraSupportedFormats SDL_GetCameraSupportedFormats_REAL -#define SDL_GetCameras SDL_GetCameras_REAL #define SDL_GetCameraDriver SDL_GetCameraDriver_REAL #define SDL_GetCameraFormat SDL_GetCameraFormat_REAL #define SDL_GetCameraID SDL_GetCameraID_REAL +#define SDL_GetCameraName SDL_GetCameraName_REAL #define SDL_GetCameraPermissionState SDL_GetCameraPermissionState_REAL +#define SDL_GetCameraPosition SDL_GetCameraPosition_REAL #define SDL_GetCameraProperties SDL_GetCameraProperties_REAL +#define SDL_GetCameraSupportedFormats SDL_GetCameraSupportedFormats_REAL +#define SDL_GetCameras SDL_GetCameras_REAL #define SDL_GetClipboardData SDL_GetClipboardData_REAL #define SDL_GetClipboardText SDL_GetClipboardText_REAL #define SDL_GetClosestFullscreenDisplayMode SDL_GetClosestFullscreenDisplayMode_REAL @@ -404,8 +404,8 @@ #define SDL_GetPropertyType SDL_GetPropertyType_REAL #define SDL_GetRGB SDL_GetRGB_REAL #define SDL_GetRGBA SDL_GetRGBA_REAL -#define SDL_GetRealGamepadTypeFromID SDL_GetRealGamepadTypeFromID_REAL #define SDL_GetRealGamepadType SDL_GetRealGamepadType_REAL +#define SDL_GetRealGamepadTypeFromID SDL_GetRealGamepadTypeFromID_REAL #define SDL_GetRectAndLineIntersection SDL_GetRectAndLineIntersection_REAL #define SDL_GetRectAndLineIntersectionFloat SDL_GetRectAndLineIntersectionFloat_REAL #define SDL_GetRectEnclosingPoints SDL_GetRectEnclosingPoints_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index a49a820132080..705b95747b7eb 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -231,15 +231,15 @@ SDL_DYNAPI_PROC(char*,SDL_GetBasePath,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCacheLineSize,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCount,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetCameraName,(SDL_CameraID a),(a),return) -SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraPosition,(SDL_CameraID a),(a),return) -SDL_DYNAPI_PROC(SDL_CameraSpec*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetCameraDriver,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetCameraFormat,(SDL_Camera *a, SDL_CameraSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_CameraID,SDL_GetCameraID,(SDL_Camera *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetCameraName,(SDL_CameraID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetCameraPermissionState,(SDL_Camera *a),(a),return) +SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraPosition,(SDL_CameraID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetCameraProperties,(SDL_Camera *a),(a),return) +SDL_DYNAPI_PROC(SDL_CameraSpec*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(char*,SDL_GetClipboardText,(void),(),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, SDL_bool e),(a,b,c,d,e),return) @@ -424,8 +424,8 @@ SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) -SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadType,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersectionFloat,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPoints,(const SDL_Point *a, int b, const SDL_Rect *c, SDL_Rect *d),(a,b,c,d),return) From cb854d1bc94e676df47f830529718e919e7cd97b Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 14 Jul 2024 20:02:23 +0000 Subject: [PATCH 313/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_camera.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 5994e9bc6db1f..d91cb898c0cd7 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -192,10 +192,10 @@ extern SDL_DECLSPEC SDL_CameraID *SDLCALL SDL_GetCameras(int *count); * and sizes and so want to find the optimal spec that doesn't require * conversion. * - * This function isn't strictly required; if you call SDL_OpenCamera - * with a NULL spec, SDL will choose a native format for you, and if you - * instead specify a desired format, it will transparently convert to the - * requested format on your behalf. + * This function isn't strictly required; if you call SDL_OpenCamera with a + * NULL spec, SDL will choose a native format for you, and if you instead + * specify a desired format, it will transparently convert to the requested + * format on your behalf. * * If `count` is not NULL, it will be filled with the number of elements in * the returned array. Additionally, the last element of the array has all From f61900465c6a5331f264ec59c37b45ebe728d7aa Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 14 Jul 2024 16:57:02 -0400 Subject: [PATCH 314/431] stdinc: Fixed up documentation details for standard types. --- include/SDL3/SDL_stdinc.h | 53 +++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index a17306b027144..70224c28fcb09 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -136,10 +136,34 @@ void *alloca(size_t); (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (C))) << 16) | \ (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) +#ifdef SDL_WIKI_DOCUMENTATION_SECTION /** - * Append the 64 bit integer suffix to an integer literal. + * Append the 64 bit integer suffix to a signed integer literal. + * + * This helps compilers that might believe a integer literal larger than + * 0xFFFFFFFF is overflowing a 32-bit value. Use `SDL_SINT64_C(0xFFFFFFFF1)` + * instead of `0xFFFFFFFF1` by itself. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_UINT64_C */ -#if defined(INT64_C) +#define SDL_SINT64_C(c) c ## LL /* or whatever the current compiler uses. */ + +/** + * Append the 64 bit integer suffix to an unsigned integer literal. + * + * This helps compilers that might believe a integer literal larger than + * 0xFFFFFFFF is overflowing a 32-bit value. Use `SDL_UINT64_C(0xFFFFFFFF1)` + * instead of `0xFFFFFFFF1` by itself. + * + * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_SINT64_C + */ +#define SDL_UINT64_C(c) c ## ULL /* or whatever the current compiler uses. */ + +#elif defined(INT64_C) #define SDL_SINT64_C(c) INT64_C(c) #define SDL_UINT64_C(c) UINT64_C(c) #elif defined(_MSC_VER) @@ -191,72 +215,76 @@ typedef int SDL_bool; * * \since This macro is available since SDL 3.0.0. */ +typedef int8_t Sint8; #define SDL_MAX_SINT8 ((Sint8)0x7F) /* 127 */ #define SDL_MIN_SINT8 ((Sint8)(~0x7F)) /* -128 */ -typedef int8_t Sint8; /** * An unsigned 8-bit integer type. * * \since This macro is available since SDL 3.0.0. */ +typedef uint8_t Uint8; #define SDL_MAX_UINT8 ((Uint8)0xFF) /* 255 */ #define SDL_MIN_UINT8 ((Uint8)0x00) /* 0 */ -typedef uint8_t Uint8; /** * A signed 16-bit integer type. * * \since This macro is available since SDL 3.0.0. */ +typedef int16_t Sint16; #define SDL_MAX_SINT16 ((Sint16)0x7FFF) /* 32767 */ #define SDL_MIN_SINT16 ((Sint16)(~0x7FFF)) /* -32768 */ -typedef int16_t Sint16; /** * An unsigned 16-bit integer type. * * \since This macro is available since SDL 3.0.0. */ +typedef uint16_t Uint16; #define SDL_MAX_UINT16 ((Uint16)0xFFFF) /* 65535 */ #define SDL_MIN_UINT16 ((Uint16)0x0000) /* 0 */ -typedef uint16_t Uint16; /** * A signed 32-bit integer type. * * \since This macro is available since SDL 3.0.0. */ +typedef int32_t Sint32; #define SDL_MAX_SINT32 ((Sint32)0x7FFFFFFF) /* 2147483647 */ #define SDL_MIN_SINT32 ((Sint32)(~0x7FFFFFFF)) /* -2147483648 */ -typedef int32_t Sint32; /** * An unsigned 32-bit integer type. * * \since This macro is available since SDL 3.0.0. */ +typedef uint32_t Uint32; #define SDL_MAX_UINT32 ((Uint32)0xFFFFFFFFu) /* 4294967295 */ #define SDL_MIN_UINT32 ((Uint32)0x00000000) /* 0 */ -typedef uint32_t Uint32; /** * A signed 64-bit integer type. * * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_SINT64_C */ +typedef int64_t Sint64; #define SDL_MAX_SINT64 SDL_SINT64_C(0x7FFFFFFFFFFFFFFF) /* 9223372036854775807 */ #define SDL_MIN_SINT64 ~SDL_SINT64_C(0x7FFFFFFFFFFFFFFF) /* -9223372036854775808 */ -typedef int64_t Sint64; /** * An unsigned 64-bit integer type. * * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_UINT64_C */ +typedef uint64_t Uint64; #define SDL_MAX_UINT64 SDL_UINT64_C(0xFFFFFFFFFFFFFFFF) /* 18446744073709551615 */ #define SDL_MIN_UINT64 SDL_UINT64_C(0x0000000000000000) /* 0 */ -typedef uint64_t Uint64; /** * SDL times are signed, 64-bit integers representing nanoseconds since the @@ -267,10 +295,13 @@ typedef uint64_t Uint64; * SDL_TimeToWindows() and SDL_TimeFromWindows(). * * \since This macro is available since SDL 3.0.0. + * + * \sa SDL_MAX_SINT64 + * \sa SDL_MIN_SINT64 */ +typedef Sint64 SDL_Time; #define SDL_MAX_TIME SDL_MAX_SINT64 #define SDL_MIN_TIME SDL_MIN_SINT64 -typedef Sint64 SDL_Time; /* @} *//* Basic data types */ From 0cdc60666ba4ef1491dce9a1c014b57817767e75 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 14 Jul 2024 21:04:37 +0000 Subject: [PATCH 315/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_stdinc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 70224c28fcb09..8e04282ba2c91 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -137,6 +137,7 @@ void *alloca(size_t); (SDL_static_cast(Uint32, SDL_static_cast(Uint8, (D))) << 24)) #ifdef SDL_WIKI_DOCUMENTATION_SECTION + /** * Append the 64 bit integer suffix to a signed integer literal. * From 5c875e1183664775d2734219060cafdfe2469d55 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 14 Jul 2024 15:22:03 -0700 Subject: [PATCH 316/431] Renamed *FromID() to *ForID() While it makes sense to get an object pointer from an object ID, you want to get object attributes for an ID, otherwise e.g. GetNameFromID() sounds like it's a name ID, not an object ID. This is also consistent with the function naming convention in SDL2. --- docs/README-migration.md | 50 ++++++++++++++-------------- include/SDL3/SDL_gamepad.h | 42 ++++++++++++------------ include/SDL3/SDL_haptic.h | 4 +-- include/SDL3/SDL_joystick.h | 36 ++++++++++----------- include/SDL3/SDL_keyboard.h | 4 +-- include/SDL3/SDL_mouse.h | 4 +-- include/SDL3/SDL_sensor.h | 6 ++-- src/dynapi/SDL_dynapi.sym | 48 +++++++++++++-------------- src/dynapi/SDL_dynapi_overrides.h | 48 +++++++++++++-------------- src/dynapi/SDL_dynapi_procs.h | 48 +++++++++++++-------------- src/events/SDL_keyboard.c | 2 +- src/events/SDL_mouse.c | 4 +-- src/haptic/SDL_haptic.c | 2 +- src/joystick/SDL_gamepad.c | 52 ++++++++++++++--------------- src/joystick/SDL_joystick.c | 54 +++++++++++++++---------------- src/joystick/SDL_joystick_c.h | 2 +- src/sensor/SDL_sensor.c | 6 ++-- test/testhaptic.c | 4 +-- test/testhotplug.c | 4 +-- test/testrumble.c | 2 +- test/testsensor.c | 8 ++--- 21 files changed, 215 insertions(+), 215 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index c3433d39c9411..fb52626e583e6 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -461,7 +461,7 @@ SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been rena The SDL_EVENT_GAMEPAD_ADDED event now provides the joystick instance ID in the which member of the cdevice event structure. -The functions SDL_GetGamepads(), SDL_GetGamepadNameFromID(), SDL_GetGamepadPathFromID(), SDL_GetGamepadPlayerIndexFromID(), SDL_GetGamepadGUIDFromID(), SDL_GetGamepadVendorFromID(), SDL_GetGamepadProductFromID(), SDL_GetGamepadProductVersionFromID(), and SDL_GetGamepadTypeFromID() have been added to directly query the list of available gamepads. +The functions SDL_GetGamepads(), SDL_GetGamepadNameForID(), SDL_GetGamepadPathForID(), SDL_GetGamepadPlayerIndexForID(), SDL_GetGamepadGUIDForID(), SDL_GetGamepadVendorForID(), SDL_GetGamepadProductForID(), SDL_GetGamepadProductVersionForID(), and SDL_GetGamepadTypeForID() have been added to directly query the list of available gamepads. The gamepad face buttons have been renamed from A/B/X/Y to North/South/East/West to indicate that they are positional rather than hardware-specific. You can use SDL_GetGamepadButtonLabel() to get the labels for the face buttons, e.g. A/B/X/Y or Cross/Circle/Square/Triangle. The hint SDL_HINT_GAMECONTROLLER_USE_BUTTON_LABELS is ignored, and mappings that use this hint are translated correctly into positional buttons. Applications should provide a way for users to swap between South/East as their accept/cancel buttons, as this varies based on region and muscle memory. You can use an approach similar to the following to handle this: @@ -624,12 +624,12 @@ The following functions have been removed: * SDL_GameControllerHasLED() - replaced with SDL_PROP_GAMEPAD_CAP_RGB_LED_BOOLEAN * SDL_GameControllerHasRumble() - replaced with SDL_PROP_GAMEPAD_CAP_RUMBLE_BOOLEAN * SDL_GameControllerHasRumbleTriggers() - replaced with SDL_PROP_GAMEPAD_CAP_TRIGGER_RUMBLE_BOOLEAN -* SDL_GameControllerMappingForDeviceIndex() - replaced with SDL_GetGamepadMappingFromID() +* SDL_GameControllerMappingForDeviceIndex() - replaced with SDL_GetGamepadMappingForID() * SDL_GameControllerMappingForIndex() - replaced with SDL_GetGamepadMappings() -* SDL_GameControllerNameForIndex() - replaced with SDL_GetGamepadNameFromID() +* SDL_GameControllerNameForIndex() - replaced with SDL_GetGamepadNameForID() * SDL_GameControllerNumMappings() - replaced with SDL_GetGamepadMappings() -* SDL_GameControllerPathForIndex() - replaced with SDL_GetGamepadPathFromID() -* SDL_GameControllerTypeForIndex() - replaced with SDL_GetGamepadTypeFromID() +* SDL_GameControllerPathForIndex() - replaced with SDL_GetGamepadPathForID() +* SDL_GameControllerTypeForIndex() - replaced with SDL_GetGamepadTypeForID() The following symbols have been renamed: * SDL_CONTROLLER_AXIS_INVALID => SDL_GAMEPAD_AXIS_INVALID @@ -700,7 +700,7 @@ Rather than iterating over haptic devices using device index, there is a new fun if (haptics) { for (i = 0; i < num_haptics; ++i) { SDL_HapticID instance_id = haptics[i]; - const char *name = SDL_GetHapticNameFromID(instance_id); + const char *name = SDL_GetHapticNameForID(instance_id); SDL_Log("Haptic %" SDL_PRIu32 ": %s\n", instance_id, name ? name : "Unknown"); @@ -742,7 +742,7 @@ The following functions have been renamed: The following functions have been removed: * SDL_HapticIndex() - replaced with SDL_GetHapticID() -* SDL_HapticName() - replaced with SDL_GetHapticNameFromID() +* SDL_HapticName() - replaced with SDL_GetHapticNameForID() * SDL_HapticOpened() - replaced with SDL_GetHapticFromID() * SDL_NumHaptics() - replaced with SDL_GetHaptics() @@ -830,11 +830,11 @@ Rather than iterating over joysticks using device index, there is a new function if (joysticks) { for (i = 0; i < num_joysticks; ++i) { SDL_JoystickID instance_id = joysticks[i]; - const char *name = SDL_GetJoystickNameFromID(instance_id); - const char *path = SDL_GetJoystickPathFromID(instance_id); + const char *name = SDL_GetJoystickNameForID(instance_id); + const char *path = SDL_GetJoystickPathForID(instance_id); SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n", - instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorFromID(instance_id), SDL_GetJoystickProductFromID(instance_id)); + instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorForID(instance_id), SDL_GetJoystickProductForID(instance_id)); } SDL_free(joysticks); } @@ -845,7 +845,7 @@ Rather than iterating over joysticks using device index, there is a new function The SDL_EVENT_JOYSTICK_ADDED event now provides the joystick instance ID in the `which` member of the jdevice event structure. -The functions SDL_GetJoysticks(), SDL_GetJoystickNameFromID(), SDL_GetJoystickPathFromID(), SDL_GetJoystickPlayerIndexFromID(), SDL_GetJoystickGUIDFromID(), SDL_GetJoystickVendorFromID(), SDL_GetJoystickProductFromID(), SDL_GetJoystickProductVersionFromID(), and SDL_GetJoystickTypeFromID() have been added to directly query the list of available joysticks. +The functions SDL_GetJoysticks(), SDL_GetJoystickNameForID(), SDL_GetJoystickPathForID(), SDL_GetJoystickPlayerIndexForID(), SDL_GetJoystickGUIDForID(), SDL_GetJoystickVendorForID(), SDL_GetJoystickProductForID(), SDL_GetJoystickProductVersionForID(), and SDL_GetJoystickTypeForID() have been added to directly query the list of available joysticks. SDL_AttachVirtualJoystick() now returns the joystick instance ID instead of a device index, and returns 0 if there was an error. @@ -899,18 +899,18 @@ The following functions have been removed: * SDL_JoystickAttachVirtual() - replaced with SDL_AttachVirtualJoystick() * SDL_JoystickCurrentPowerLevel() - replaced with SDL_GetJoystickConnectionState() and SDL_GetJoystickPowerInfo() * SDL_JoystickEventState() - replaced with SDL_SetJoystickEventsEnabled() and SDL_JoystickEventsEnabled() -* SDL_JoystickGetDeviceGUID() - replaced with SDL_GetJoystickGUIDFromID() +* SDL_JoystickGetDeviceGUID() - replaced with SDL_GetJoystickGUIDForID() * SDL_JoystickGetDeviceInstanceID() -* SDL_JoystickGetDevicePlayerIndex() - replaced with SDL_GetJoystickPlayerIndexFromID() -* SDL_JoystickGetDeviceProduct() - replaced with SDL_GetJoystickProductFromID() -* SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickProductVersionFromID() -* SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickTypeFromID() -* SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickVendorFromID() +* SDL_JoystickGetDevicePlayerIndex() - replaced with SDL_GetJoystickPlayerIndexForID() +* SDL_JoystickGetDeviceProduct() - replaced with SDL_GetJoystickProductForID() +* SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickProductVersionForID() +* SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickTypeForID() +* SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickVendorForID() * SDL_JoystickHasLED() - replaced with SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN * SDL_JoystickHasRumble() - replaced with SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN * SDL_JoystickHasRumbleTriggers() - replaced with SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN -* SDL_JoystickNameForIndex() - replaced with SDL_GetJoystickNameFromID() -* SDL_JoystickPathForIndex() - replaced with SDL_GetJoystickPathFromID() +* SDL_JoystickNameForIndex() - replaced with SDL_GetJoystickNameForID() +* SDL_JoystickPathForIndex() - replaced with SDL_GetJoystickPathForID() * SDL_NumJoysticks() - replaced with SDL_GetJoysticks() * SDL_VIRTUAL_JOYSTICK_DESC_VERSION - no longer needed, version info has been removed from SDL_VirtualJoystickDesc. @@ -1571,9 +1571,9 @@ Rather than iterating over sensors using device index, there is a new function S for (i = 0; i < num_sensors; ++i) { SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d\n", sensors[i], - SDL_GetSensorNameFromID(sensors[i]), - SDL_GetSensorTypeFromID(sensors[i]), - SDL_GetSensorNonPortableTypeFromID(sensors[i])); + SDL_GetSensorNameForID(sensors[i]), + SDL_GetSensorTypeForID(sensors[i]), + SDL_GetSensorNonPortableTypeForID(sensors[i])); } SDL_free(sensors); } @@ -1600,9 +1600,9 @@ The following functions have been removed: * SDL_LockSensors() * SDL_NumSensors() - replaced with SDL_GetSensors() * SDL_SensorGetDeviceInstanceID() -* SDL_SensorGetDeviceName() - replaced with SDL_GetSensorNameFromID() -* SDL_SensorGetDeviceNonPortableType() - replaced with SDL_GetSensorNonPortableTypeFromID() -* SDL_SensorGetDeviceType() - replaced with SDL_GetSensorTypeFromID() +* SDL_SensorGetDeviceName() - replaced with SDL_GetSensorNameForID() +* SDL_SensorGetDeviceNonPortableType() - replaced with SDL_GetSensorNonPortableTypeForID() +* SDL_SensorGetDeviceType() - replaced with SDL_GetSensorTypeForID() * SDL_UnlockSensors() ## SDL_shape.h diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 08f4af52fb5d2..dea57ca279349 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -412,7 +412,7 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickGUIDFromID + * \sa SDL_GetJoystickGUIDForID * \sa SDL_GetJoystickGUID */ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid); @@ -431,7 +431,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID * \since This function is available since SDL 3.0.0. * * \sa SDL_AddGamepadMapping - * \sa SDL_GetGamepadMappingFromID + * \sa SDL_GetGamepadMappingForID * \sa SDL_GetGamepadMappingForGUID * \sa SDL_SetGamepadMapping */ @@ -511,7 +511,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); * \sa SDL_GetGamepadName * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID instance_id); /** * Get the implementation dependent path of a gamepad. @@ -529,7 +529,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameFromID(SDL_JoystickID * \sa SDL_GetGamepadPath * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPathFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPathForID(SDL_JoystickID instance_id); /** * Get the player index of a gamepad. @@ -544,7 +544,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPathFromID(SDL_JoystickID * \sa SDL_GetGamepadPlayerIndex * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id); /** * Get the implementation-dependent GUID of a gamepad. @@ -561,7 +561,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexFromID(SDL_JoystickID i * \sa SDL_GetGamepadGUIDString * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadGUIDFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id); /** * Get the USB vendor ID of a gamepad, if available. @@ -578,7 +578,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadGUIDFromID(SDL_Joysti * \sa SDL_GetGamepadVendor * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendorFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendorForID(SDL_JoystickID instance_id); /** * Get the USB product ID of a gamepad, if available. @@ -595,7 +595,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendorFromID(SDL_JoystickID ins * \sa SDL_GetGamepadProduct * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductForID(SDL_JoystickID instance_id); /** * Get the product version of a gamepad, if available. @@ -612,7 +612,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductFromID(SDL_JoystickID in * \sa SDL_GetGamepadProductVersion * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersionFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersionForID(SDL_JoystickID instance_id); /** * Get the type of a gamepad. @@ -626,9 +626,9 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersionFromID(SDL_Joysti * * \sa SDL_GetGamepadType * \sa SDL_GetGamepads - * \sa SDL_GetRealGamepadTypeFromID + * \sa SDL_GetRealGamepadTypeForID */ -extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeForID(SDL_JoystickID instance_id); /** * Get the type of a gamepad, ignoring any mapping override. @@ -640,11 +640,11 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromID(SDL_Joystic * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadTypeFromID + * \sa SDL_GetGamepadTypeForID * \sa SDL_GetGamepads * \sa SDL_GetRealGamepadType */ -extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_JoystickID instance_id); /** * Get the mapping of a gamepad. @@ -660,7 +660,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeFromID(SDL_Joy * \sa SDL_GetGamepads * \sa SDL_GetGamepadMapping */ -extern SDL_DECLSPEC char *SDLCALL SDL_GetGamepadMappingFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC char *SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id); /** * Open a gamepad for use. @@ -758,7 +758,7 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadNameFromID + * \sa SDL_GetGamepadNameForID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad); @@ -774,7 +774,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadPathFromID + * \sa SDL_GetGamepadPathForID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad); @@ -787,7 +787,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadTypeFromID + * \sa SDL_GetGamepadTypeForID */ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *gamepad); @@ -800,7 +800,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadType(SDL_Gamepad *game * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetRealGamepadTypeFromID + * \sa SDL_GetRealGamepadTypeForID */ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadType(SDL_Gamepad *gamepad); @@ -843,7 +843,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadVendorFromID + * \sa SDL_GetGamepadVendorForID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad); @@ -857,7 +857,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadVendor(SDL_Gamepad *gamepad); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadProductFromID + * \sa SDL_GetGamepadProductForID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad); @@ -871,7 +871,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProduct(SDL_Gamepad *gamepad); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetGamepadProductVersionFromID + * \sa SDL_GetGamepadProductVersionForID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadProductVersion(SDL_Gamepad *gamepad); diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index ecdf5c623f07b..aa858d3222be0 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -961,7 +961,7 @@ extern SDL_DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count); * \sa SDL_GetHapticName * \sa SDL_OpenHaptic */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticNameFromID(SDL_HapticID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticNameForID(SDL_HapticID instance_id); /** * Open a haptic device for use. @@ -1023,7 +1023,7 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetHapticNameFromID + * \sa SDL_GetHapticNameForID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic); diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 3c22ab2f8e83d..b9d044f3a9492 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -112,7 +112,7 @@ typedef Uint32 SDL_JoystickID; * * In some cases, SDL can identify a low-level joystick as being a certain * type of device, and will report it through SDL_GetJoystickType (or - * SDL_GetJoystickTypeFromID). + * SDL_GetJoystickTypeForID). * * This is by no means a complete list of everything that can be plugged into * a computer. @@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count); * \sa SDL_GetJoystickName * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID instance_id); /** * Get the implementation dependent path of a joystick. @@ -256,7 +256,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameFromID(SDL_JoystickID * \sa SDL_GetJoystickPath * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPathFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPathForID(SDL_JoystickID instance_id); /** * Get the player index of a joystick. @@ -271,7 +271,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPathFromID(SDL_JoystickID * \sa SDL_GetJoystickPlayerIndex * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexForID(SDL_JoystickID instance_id); /** * Get the implementation-dependent GUID of a joystick. @@ -287,7 +287,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexFromID(SDL_JoystickID * \sa SDL_GetJoystickGUID * \sa SDL_GetJoystickGUIDString */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id); /** * Get the USB vendor ID of a joystick, if available. @@ -304,7 +304,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromID(SDL_Joyst * \sa SDL_GetJoystickVendor * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendorFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendorForID(SDL_JoystickID instance_id); /** * Get the USB product ID of a joystick, if available. @@ -321,7 +321,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendorFromID(SDL_JoystickID in * \sa SDL_GetJoystickProduct * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductForID(SDL_JoystickID instance_id); /** * Get the product version of a joystick, if available. @@ -338,7 +338,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductFromID(SDL_JoystickID i * \sa SDL_GetJoystickProductVersion * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersionFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id); /** * Get the type of a joystick, if available. @@ -355,7 +355,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersionFromID(SDL_Joyst * \sa SDL_GetJoystickType * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeForID(SDL_JoystickID instance_id); /** * Open a joystick for use. @@ -674,7 +674,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickNameFromID + * \sa SDL_GetJoystickNameForID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick); @@ -689,7 +689,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joysti * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickPathFromID + * \sa SDL_GetJoystickPathForID */ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick); @@ -735,7 +735,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystic * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickGUIDFromID + * \sa SDL_GetJoystickGUIDForID * \sa SDL_GetJoystickGUIDString */ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick); @@ -750,7 +750,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *j * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickVendorFromID + * \sa SDL_GetJoystickVendorForID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick); @@ -764,7 +764,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickVendor(SDL_Joystick *joystick) * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickProductFromID + * \sa SDL_GetJoystickProductForID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick); @@ -778,7 +778,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProduct(SDL_Joystick *joystick * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickProductVersionFromID + * \sa SDL_GetJoystickProductVersionForID */ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickProductVersion(SDL_Joystick *joystick); @@ -818,7 +818,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joy * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickTypeFromID + * \sa SDL_GetJoystickTypeForID */ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick); @@ -835,7 +835,7 @@ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *j * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickGUIDFromID + * \sa SDL_GetJoystickGUIDForID * \sa SDL_GetJoystickGUID * \sa SDL_GetJoystickGUIDFromString */ @@ -872,7 +872,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickGUIDFromID + * \sa SDL_GetJoystickGUIDForID */ extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 1bdfa1a621a3e..9a5dd5decb871 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -80,7 +80,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetKeyboardNameFromID + * \sa SDL_GetKeyboardNameForID * \sa SDL_HasKeyboard */ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); @@ -100,7 +100,7 @@ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); * * \sa SDL_GetKeyboards */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyboardNameFromID(SDL_KeyboardID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id); /** * Query the window which currently has keyboard focus. diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index 074cdfcb7176c..a3f8f34d53f93 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -142,7 +142,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetMouseNameFromID + * \sa SDL_GetMouseNameForID * \sa SDL_HasMouse */ extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); @@ -162,7 +162,7 @@ extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); * * \sa SDL_GetMice */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetMouseNameFromID(SDL_MouseID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id); /** * Get the window which currently has mouse focus. diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 26097a586dcad..f404b03529d02 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -167,7 +167,7 @@ extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorNameFromID(SDL_SensorID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorNameForID(SDL_SensorID instance_id); /** * Get the type of a sensor. @@ -180,7 +180,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorNameFromID(SDL_SensorID ins * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorTypeFromID(SDL_SensorID instance_id); +extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorTypeForID(SDL_SensorID instance_id); /** * Get the platform dependent type of a sensor. @@ -193,7 +193,7 @@ extern SDL_DECLSPEC SDL_SensorType SDLCALL SDL_GetSensorTypeFromID(SDL_SensorID * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableTypeFromID(SDL_SensorID instance_id); +extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableTypeForID(SDL_SensorID instance_id); /** * Open a sensor for use. diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index fa463caf03ec5..790f08e93959e 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -242,24 +242,24 @@ SDL3_0.0.0 { SDL_GetGamepadFirmwareVersion; SDL_GetGamepadFromID; SDL_GetGamepadFromPlayerIndex; - SDL_GetGamepadGUIDFromID; + SDL_GetGamepadGUIDForID; SDL_GetGamepadID; SDL_GetGamepadJoystick; SDL_GetGamepadMapping; SDL_GetGamepadMappingForGUID; - SDL_GetGamepadMappingFromID; + SDL_GetGamepadMappingForID; SDL_GetGamepadMappings; SDL_GetGamepadName; - SDL_GetGamepadNameFromID; + SDL_GetGamepadNameForID; SDL_GetGamepadPath; - SDL_GetGamepadPathFromID; + SDL_GetGamepadPathForID; SDL_GetGamepadPlayerIndex; - SDL_GetGamepadPlayerIndexFromID; + SDL_GetGamepadPlayerIndexForID; SDL_GetGamepadPowerInfo; SDL_GetGamepadProduct; - SDL_GetGamepadProductFromID; + SDL_GetGamepadProductForID; SDL_GetGamepadProductVersion; - SDL_GetGamepadProductVersionFromID; + SDL_GetGamepadProductVersionForID; SDL_GetGamepadProperties; SDL_GetGamepadSensorData; SDL_GetGamepadSensorDataRate; @@ -270,10 +270,10 @@ SDL3_0.0.0 { SDL_GetGamepadStringForType; SDL_GetGamepadTouchpadFinger; SDL_GetGamepadType; - SDL_GetGamepadTypeFromID; + SDL_GetGamepadTypeForID; SDL_GetGamepadTypeFromString; SDL_GetGamepadVendor; - SDL_GetGamepadVendorFromID; + SDL_GetGamepadVendorForID; SDL_GetGamepads; SDL_GetGlobalMouseState; SDL_GetGlobalProperties; @@ -283,7 +283,7 @@ SDL3_0.0.0 { SDL_GetHapticFromID; SDL_GetHapticID; SDL_GetHapticName; - SDL_GetHapticNameFromID; + SDL_GetHapticNameForID; SDL_GetHaptics; SDL_GetHint; SDL_GetHintBoolean; @@ -299,35 +299,35 @@ SDL3_0.0.0 { SDL_GetJoystickFromID; SDL_GetJoystickFromPlayerIndex; SDL_GetJoystickGUID; - SDL_GetJoystickGUIDFromID; + SDL_GetJoystickGUIDForID; SDL_GetJoystickGUIDFromString; SDL_GetJoystickGUIDInfo; SDL_GetJoystickGUIDString; SDL_GetJoystickHat; SDL_GetJoystickID; SDL_GetJoystickName; - SDL_GetJoystickNameFromID; + SDL_GetJoystickNameForID; SDL_GetJoystickPath; - SDL_GetJoystickPathFromID; + SDL_GetJoystickPathForID; SDL_GetJoystickPlayerIndex; - SDL_GetJoystickPlayerIndexFromID; + SDL_GetJoystickPlayerIndexForID; SDL_GetJoystickPowerInfo; SDL_GetJoystickProduct; - SDL_GetJoystickProductFromID; + SDL_GetJoystickProductForID; SDL_GetJoystickProductVersion; - SDL_GetJoystickProductVersionFromID; + SDL_GetJoystickProductVersionForID; SDL_GetJoystickProperties; SDL_GetJoystickSerial; SDL_GetJoystickType; - SDL_GetJoystickTypeFromID; + SDL_GetJoystickTypeForID; SDL_GetJoystickVendor; - SDL_GetJoystickVendorFromID; + SDL_GetJoystickVendorForID; SDL_GetJoysticks; SDL_GetKeyFromName; SDL_GetKeyFromScancode; SDL_GetKeyName; SDL_GetKeyboardFocus; - SDL_GetKeyboardNameFromID; + SDL_GetKeyboardNameForID; SDL_GetKeyboardState; SDL_GetKeyboards; SDL_GetLogOutputFunction; @@ -339,7 +339,7 @@ SDL3_0.0.0 { SDL_GetMice; SDL_GetModState; SDL_GetMouseFocus; - SDL_GetMouseNameFromID; + SDL_GetMouseNameForID; SDL_GetMouseState; SDL_GetNaturalDisplayOrientation; SDL_GetNumAllocations; @@ -380,7 +380,7 @@ SDL3_0.0.0 { SDL_GetRGB; SDL_GetRGBA; SDL_GetRealGamepadType; - SDL_GetRealGamepadTypeFromID; + SDL_GetRealGamepadTypeForID; SDL_GetRectAndLineIntersection; SDL_GetRectAndLineIntersectionFloat; SDL_GetRectEnclosingPoints; @@ -421,12 +421,12 @@ SDL3_0.0.0 { SDL_GetSensorFromID; SDL_GetSensorID; SDL_GetSensorName; - SDL_GetSensorNameFromID; + SDL_GetSensorNameForID; SDL_GetSensorNonPortableType; - SDL_GetSensorNonPortableTypeFromID; + SDL_GetSensorNonPortableTypeForID; SDL_GetSensorProperties; SDL_GetSensorType; - SDL_GetSensorTypeFromID; + SDL_GetSensorTypeForID; SDL_GetSensors; SDL_GetSilenceValueForFormat; SDL_GetStorageFileSize; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 5899c87846045..eaf1860602295 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -267,24 +267,24 @@ #define SDL_GetGamepadFirmwareVersion SDL_GetGamepadFirmwareVersion_REAL #define SDL_GetGamepadFromID SDL_GetGamepadFromID_REAL #define SDL_GetGamepadFromPlayerIndex SDL_GetGamepadFromPlayerIndex_REAL -#define SDL_GetGamepadGUIDFromID SDL_GetGamepadGUIDFromID_REAL +#define SDL_GetGamepadGUIDForID SDL_GetGamepadGUIDForID_REAL #define SDL_GetGamepadID SDL_GetGamepadID_REAL #define SDL_GetGamepadJoystick SDL_GetGamepadJoystick_REAL #define SDL_GetGamepadMapping SDL_GetGamepadMapping_REAL #define SDL_GetGamepadMappingForGUID SDL_GetGamepadMappingForGUID_REAL -#define SDL_GetGamepadMappingFromID SDL_GetGamepadMappingFromID_REAL +#define SDL_GetGamepadMappingForID SDL_GetGamepadMappingForID_REAL #define SDL_GetGamepadMappings SDL_GetGamepadMappings_REAL #define SDL_GetGamepadName SDL_GetGamepadName_REAL -#define SDL_GetGamepadNameFromID SDL_GetGamepadNameFromID_REAL +#define SDL_GetGamepadNameForID SDL_GetGamepadNameForID_REAL #define SDL_GetGamepadPath SDL_GetGamepadPath_REAL -#define SDL_GetGamepadPathFromID SDL_GetGamepadPathFromID_REAL +#define SDL_GetGamepadPathForID SDL_GetGamepadPathForID_REAL #define SDL_GetGamepadPlayerIndex SDL_GetGamepadPlayerIndex_REAL -#define SDL_GetGamepadPlayerIndexFromID SDL_GetGamepadPlayerIndexFromID_REAL +#define SDL_GetGamepadPlayerIndexForID SDL_GetGamepadPlayerIndexForID_REAL #define SDL_GetGamepadPowerInfo SDL_GetGamepadPowerInfo_REAL #define SDL_GetGamepadProduct SDL_GetGamepadProduct_REAL -#define SDL_GetGamepadProductFromID SDL_GetGamepadProductFromID_REAL +#define SDL_GetGamepadProductForID SDL_GetGamepadProductForID_REAL #define SDL_GetGamepadProductVersion SDL_GetGamepadProductVersion_REAL -#define SDL_GetGamepadProductVersionFromID SDL_GetGamepadProductVersionFromID_REAL +#define SDL_GetGamepadProductVersionForID SDL_GetGamepadProductVersionForID_REAL #define SDL_GetGamepadProperties SDL_GetGamepadProperties_REAL #define SDL_GetGamepadSensorData SDL_GetGamepadSensorData_REAL #define SDL_GetGamepadSensorDataRate SDL_GetGamepadSensorDataRate_REAL @@ -295,10 +295,10 @@ #define SDL_GetGamepadStringForType SDL_GetGamepadStringForType_REAL #define SDL_GetGamepadTouchpadFinger SDL_GetGamepadTouchpadFinger_REAL #define SDL_GetGamepadType SDL_GetGamepadType_REAL -#define SDL_GetGamepadTypeFromID SDL_GetGamepadTypeFromID_REAL +#define SDL_GetGamepadTypeForID SDL_GetGamepadTypeForID_REAL #define SDL_GetGamepadTypeFromString SDL_GetGamepadTypeFromString_REAL #define SDL_GetGamepadVendor SDL_GetGamepadVendor_REAL -#define SDL_GetGamepadVendorFromID SDL_GetGamepadVendorFromID_REAL +#define SDL_GetGamepadVendorForID SDL_GetGamepadVendorForID_REAL #define SDL_GetGamepads SDL_GetGamepads_REAL #define SDL_GetGlobalMouseState SDL_GetGlobalMouseState_REAL #define SDL_GetGlobalProperties SDL_GetGlobalProperties_REAL @@ -308,7 +308,7 @@ #define SDL_GetHapticFromID SDL_GetHapticFromID_REAL #define SDL_GetHapticID SDL_GetHapticID_REAL #define SDL_GetHapticName SDL_GetHapticName_REAL -#define SDL_GetHapticNameFromID SDL_GetHapticNameFromID_REAL +#define SDL_GetHapticNameForID SDL_GetHapticNameForID_REAL #define SDL_GetHaptics SDL_GetHaptics_REAL #define SDL_GetHint SDL_GetHint_REAL #define SDL_GetHintBoolean SDL_GetHintBoolean_REAL @@ -324,35 +324,35 @@ #define SDL_GetJoystickFromID SDL_GetJoystickFromID_REAL #define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL #define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL -#define SDL_GetJoystickGUIDFromID SDL_GetJoystickGUIDFromID_REAL +#define SDL_GetJoystickGUIDForID SDL_GetJoystickGUIDForID_REAL #define SDL_GetJoystickGUIDFromString SDL_GetJoystickGUIDFromString_REAL #define SDL_GetJoystickGUIDInfo SDL_GetJoystickGUIDInfo_REAL #define SDL_GetJoystickGUIDString SDL_GetJoystickGUIDString_REAL #define SDL_GetJoystickHat SDL_GetJoystickHat_REAL #define SDL_GetJoystickID SDL_GetJoystickID_REAL #define SDL_GetJoystickName SDL_GetJoystickName_REAL -#define SDL_GetJoystickNameFromID SDL_GetJoystickNameFromID_REAL +#define SDL_GetJoystickNameForID SDL_GetJoystickNameForID_REAL #define SDL_GetJoystickPath SDL_GetJoystickPath_REAL -#define SDL_GetJoystickPathFromID SDL_GetJoystickPathFromID_REAL +#define SDL_GetJoystickPathForID SDL_GetJoystickPathForID_REAL #define SDL_GetJoystickPlayerIndex SDL_GetJoystickPlayerIndex_REAL -#define SDL_GetJoystickPlayerIndexFromID SDL_GetJoystickPlayerIndexFromID_REAL +#define SDL_GetJoystickPlayerIndexForID SDL_GetJoystickPlayerIndexForID_REAL #define SDL_GetJoystickPowerInfo SDL_GetJoystickPowerInfo_REAL #define SDL_GetJoystickProduct SDL_GetJoystickProduct_REAL -#define SDL_GetJoystickProductFromID SDL_GetJoystickProductFromID_REAL +#define SDL_GetJoystickProductForID SDL_GetJoystickProductForID_REAL #define SDL_GetJoystickProductVersion SDL_GetJoystickProductVersion_REAL -#define SDL_GetJoystickProductVersionFromID SDL_GetJoystickProductVersionFromID_REAL +#define SDL_GetJoystickProductVersionForID SDL_GetJoystickProductVersionForID_REAL #define SDL_GetJoystickProperties SDL_GetJoystickProperties_REAL #define SDL_GetJoystickSerial SDL_GetJoystickSerial_REAL #define SDL_GetJoystickType SDL_GetJoystickType_REAL -#define SDL_GetJoystickTypeFromID SDL_GetJoystickTypeFromID_REAL +#define SDL_GetJoystickTypeForID SDL_GetJoystickTypeForID_REAL #define SDL_GetJoystickVendor SDL_GetJoystickVendor_REAL -#define SDL_GetJoystickVendorFromID SDL_GetJoystickVendorFromID_REAL +#define SDL_GetJoystickVendorForID SDL_GetJoystickVendorForID_REAL #define SDL_GetJoysticks SDL_GetJoysticks_REAL #define SDL_GetKeyFromName SDL_GetKeyFromName_REAL #define SDL_GetKeyFromScancode SDL_GetKeyFromScancode_REAL #define SDL_GetKeyName SDL_GetKeyName_REAL #define SDL_GetKeyboardFocus SDL_GetKeyboardFocus_REAL -#define SDL_GetKeyboardNameFromID SDL_GetKeyboardNameFromID_REAL +#define SDL_GetKeyboardNameForID SDL_GetKeyboardNameForID_REAL #define SDL_GetKeyboardState SDL_GetKeyboardState_REAL #define SDL_GetKeyboards SDL_GetKeyboards_REAL #define SDL_GetLogOutputFunction SDL_GetLogOutputFunction_REAL @@ -364,7 +364,7 @@ #define SDL_GetMice SDL_GetMice_REAL #define SDL_GetModState SDL_GetModState_REAL #define SDL_GetMouseFocus SDL_GetMouseFocus_REAL -#define SDL_GetMouseNameFromID SDL_GetMouseNameFromID_REAL +#define SDL_GetMouseNameForID SDL_GetMouseNameForID_REAL #define SDL_GetMouseState SDL_GetMouseState_REAL #define SDL_GetNaturalDisplayOrientation SDL_GetNaturalDisplayOrientation_REAL #define SDL_GetNumAllocations SDL_GetNumAllocations_REAL @@ -405,7 +405,7 @@ #define SDL_GetRGB SDL_GetRGB_REAL #define SDL_GetRGBA SDL_GetRGBA_REAL #define SDL_GetRealGamepadType SDL_GetRealGamepadType_REAL -#define SDL_GetRealGamepadTypeFromID SDL_GetRealGamepadTypeFromID_REAL +#define SDL_GetRealGamepadTypeForID SDL_GetRealGamepadTypeForID_REAL #define SDL_GetRectAndLineIntersection SDL_GetRectAndLineIntersection_REAL #define SDL_GetRectAndLineIntersectionFloat SDL_GetRectAndLineIntersectionFloat_REAL #define SDL_GetRectEnclosingPoints SDL_GetRectEnclosingPoints_REAL @@ -446,12 +446,12 @@ #define SDL_GetSensorFromID SDL_GetSensorFromID_REAL #define SDL_GetSensorID SDL_GetSensorID_REAL #define SDL_GetSensorName SDL_GetSensorName_REAL -#define SDL_GetSensorNameFromID SDL_GetSensorNameFromID_REAL +#define SDL_GetSensorNameForID SDL_GetSensorNameForID_REAL #define SDL_GetSensorNonPortableType SDL_GetSensorNonPortableType_REAL -#define SDL_GetSensorNonPortableTypeFromID SDL_GetSensorNonPortableTypeFromID_REAL +#define SDL_GetSensorNonPortableTypeForID SDL_GetSensorNonPortableTypeForID_REAL #define SDL_GetSensorProperties SDL_GetSensorProperties_REAL #define SDL_GetSensorType SDL_GetSensorType_REAL -#define SDL_GetSensorTypeFromID SDL_GetSensorTypeFromID_REAL +#define SDL_GetSensorTypeForID SDL_GetSensorTypeForID_REAL #define SDL_GetSensors SDL_GetSensors_REAL #define SDL_GetSilenceValueForFormat SDL_GetSilenceValueForFormat_REAL #define SDL_GetStorageFileSize SDL_GetStorageFileSize_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 705b95747b7eb..dc05b870f79e7 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -287,24 +287,24 @@ SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetGamepadConnectionState,(SDL_G SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadFirmwareVersion,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromPlayerIndex,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadID,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetGamepadJoystick,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_GetGamepadMapping,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForGUID,(SDL_JoystickGUID a),(a),return) -SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(char**,SDL_GetGamepadMappings,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadName,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetGamepadNameFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadNameForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPath,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPathFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPathForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGamepadPlayerIndex,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetGamepadPlayerIndexFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetGamepadPlayerIndexForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetGamepadPowerInfo,(SDL_Gamepad *a, int *b),(a,b),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProduct,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersion,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersionFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadProductVersionForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGamepadProperties,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGamepadSensorData,(SDL_Gamepad *a, SDL_SensorType b, float *c, int d),(a,b,c,d),return) SDL_DYNAPI_PROC(float,SDL_GetGamepadSensorDataRate,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) @@ -315,10 +315,10 @@ SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForButton,(SDL_GamepadButton a), SDL_DYNAPI_PROC(const char*,SDL_GetGamepadStringForType,(SDL_GamepadType a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGamepadTouchpadFinger,(SDL_Gamepad *a, int b, int c, Uint8 *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadType,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendor,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendorFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendorForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetGamepads,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetGlobalMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGlobalProperties,(void),(),return) @@ -328,7 +328,7 @@ SDL_DYNAPI_PROC(Uint32,SDL_GetHapticFeatures,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticID,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticName,(SDL_Haptic *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameFromID,(SDL_HapticID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameForID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID*,SDL_GetHaptics,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHint,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetHintBoolean,(const char *a, SDL_bool b),(a,b),return) @@ -344,35 +344,35 @@ SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),retu SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetJoystickGUIDInfo,(SDL_JoystickGUID a, Uint16 *b, Uint16 *c, Uint16 *d, Uint16 *e),(a,b,c,d,e),) SDL_DYNAPI_PROC(int,SDL_GetJoystickGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickHat,(SDL_Joystick *a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickID,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickName,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetJoystickNameFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetJoystickNameForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPath,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPathFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetJoystickPathForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetJoystickPlayerIndex,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetJoystickPlayerIndexFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetJoystickPlayerIndexForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetJoystickPowerInfo,(SDL_Joystick *a, int *b),(a,b),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProduct,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductVersion,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductVersionFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickProductVersionForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetJoystickProperties,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickSerial,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickType,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickTypeFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickTypeForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendorFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendorForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetJoysticks,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyName,(SDL_Keycode a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardNameFromID,(SDL_KeyboardID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardNameForID,(SDL_KeyboardID a),(a),return) SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_KeyboardID*,SDL_GetKeyboards,(int *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetLogOutputFunction,(SDL_LogOutputFunction *a, void **b),(a,b),) @@ -384,7 +384,7 @@ SDL_DYNAPI_PROC(void,SDL_GetMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func SDL_DYNAPI_PROC(SDL_MouseID*,SDL_GetMice,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keymod,SDL_GetModState,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetMouseFocus,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_GetMouseNameFromID,(SDL_MouseID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetMouseNameForID,(SDL_MouseID a),(a),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_DisplayOrientation,SDL_GetNaturalDisplayOrientation,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetNumAllocations,(void),(),return) @@ -425,7 +425,7 @@ SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadType,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeFromID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetRealGamepadTypeForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersection,(const SDL_Rect *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectAndLineIntersectionFloat,(const SDL_FRect *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetRectEnclosingPoints,(const SDL_Point *a, int b, const SDL_Rect *c, SDL_Rect *d),(a,b,c,d),return) @@ -466,12 +466,12 @@ SDL_DYNAPI_PROC(int,SDL_GetSensorData,(SDL_Sensor *a, float *b, int c),(a,b,c),r SDL_DYNAPI_PROC(SDL_Sensor*,SDL_GetSensorFromID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_SensorID,SDL_GetSensorID,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetSensorName,(SDL_Sensor *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetSensorNameFromID,(SDL_SensorID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetSensorNameForID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableType,(SDL_Sensor *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableTypeFromID,(SDL_SensorID a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableTypeForID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSensorProperties,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorType,(SDL_Sensor *a),(a),return) -SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorTypeFromID,(SDL_SensorID a),(a),return) +SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorTypeForID,(SDL_SensorID a),(a),return) SDL_DYNAPI_PROC(SDL_SensorID*,SDL_GetSensors,(int *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetStorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index e008771ac272c..ec72ce80921f0 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -201,7 +201,7 @@ SDL_KeyboardID *SDL_GetKeyboards(int *count) return keyboards; } -const char *SDL_GetKeyboardNameFromID(SDL_KeyboardID instance_id) +const char *SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id) { int keyboard_index = SDL_GetKeyboardIndex(instance_id); if (keyboard_index < 0) { diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index c34ee70c10977..f6a4d1c5353f4 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -312,7 +312,7 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, SDL_bool send_event) return; } - SDL_FreeLater(SDL_mice[mouse_index].name); // SDL_GetMouseNameFromID returns this pointer. + SDL_FreeLater(SDL_mice[mouse_index].name); // SDL_GetMouseNameForID returns this pointer. if (mouse_index != SDL_mouse_count - 1) { SDL_memcpy(&SDL_mice[mouse_index], &SDL_mice[mouse_index + 1], (SDL_mouse_count - mouse_index - 1) * sizeof(SDL_mice[mouse_index])); @@ -370,7 +370,7 @@ SDL_MouseID *SDL_GetMice(int *count) return mice; } -const char *SDL_GetMouseNameFromID(SDL_MouseID instance_id) +const char *SDL_GetMouseNameForID(SDL_MouseID instance_id) { int mouse_index = SDL_GetMouseIndex(instance_id); if (mouse_index < 0) { diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index df1105c6c1acc..ca4e279afebf1 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -92,7 +92,7 @@ SDL_HapticID *SDL_GetHaptics(int *count) return haptics; } -const char *SDL_GetHapticNameFromID(SDL_HapticID instance_id) +const char *SDL_GetHapticNameForID(SDL_HapticID instance_id) { int device_index; const char *name = NULL; diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 17951c8bd1aa2..4e33db0f32df3 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -1324,7 +1324,7 @@ static void SDL_UpdateGamepadType(SDL_Gamepad *gamepad) } } if (gamepad->type == SDL_GAMEPAD_TYPE_UNKNOWN) { - gamepad->type = SDL_GetRealGamepadTypeFromID(gamepad->joystick->instance_id); + gamepad->type = SDL_GetRealGamepadTypeForID(gamepad->joystick->instance_id); } } @@ -1778,8 +1778,8 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id SDL_AssertJoysticksLocked(); - name = SDL_GetJoystickNameFromID(instance_id); - guid = SDL_GetJoystickGUIDFromID(instance_id); + name = SDL_GetJoystickNameForID(instance_id); + guid = SDL_GetJoystickGUIDForID(instance_id); mapping = SDL_PrivateGetGamepadMappingForNameAndGUID(name, guid); if (!mapping && create_mapping) { SDL_GamepadMapping raw_map; @@ -2246,7 +2246,7 @@ char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) */ int SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping) { - SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); int retval = -1; if (SDL_memcmp(&guid, &s_zeroGUID, sizeof(guid)) == 0) { @@ -2420,7 +2420,7 @@ SDL_JoystickID *SDL_GetGamepads(int *count) return joysticks; } -const char *SDL_GetGamepadNameFromID(SDL_JoystickID instance_id) +const char *SDL_GetGamepadNameForID(SDL_JoystickID instance_id) { const char *retval = NULL; @@ -2429,7 +2429,7 @@ const char *SDL_GetGamepadNameFromID(SDL_JoystickID instance_id) GamepadMapping_t *mapping = SDL_PrivateGetGamepadMapping(instance_id, SDL_TRUE); if (mapping) { if (SDL_strcmp(mapping->name, "*") == 0) { - retval = SDL_GetJoystickNameFromID(instance_id); + retval = SDL_GetJoystickNameForID(instance_id); } else { retval = mapping->name; } @@ -2440,37 +2440,37 @@ const char *SDL_GetGamepadNameFromID(SDL_JoystickID instance_id) return retval; } -const char *SDL_GetGamepadPathFromID(SDL_JoystickID instance_id) +const char *SDL_GetGamepadPathForID(SDL_JoystickID instance_id) { - return SDL_GetJoystickPathFromID(instance_id); + return SDL_GetJoystickPathForID(instance_id); } -int SDL_GetGamepadPlayerIndexFromID(SDL_JoystickID instance_id) +int SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id) { - return SDL_GetJoystickPlayerIndexFromID(instance_id); + return SDL_GetJoystickPlayerIndexForID(instance_id); } -SDL_JoystickGUID SDL_GetGamepadGUIDFromID(SDL_JoystickID instance_id) +SDL_JoystickGUID SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id) { - return SDL_GetJoystickGUIDFromID(instance_id); + return SDL_GetJoystickGUIDForID(instance_id); } -Uint16 SDL_GetGamepadVendorFromID(SDL_JoystickID instance_id) +Uint16 SDL_GetGamepadVendorForID(SDL_JoystickID instance_id) { - return SDL_GetJoystickVendorFromID(instance_id); + return SDL_GetJoystickVendorForID(instance_id); } -Uint16 SDL_GetGamepadProductFromID(SDL_JoystickID instance_id) +Uint16 SDL_GetGamepadProductForID(SDL_JoystickID instance_id) { - return SDL_GetJoystickProductFromID(instance_id); + return SDL_GetJoystickProductForID(instance_id); } -Uint16 SDL_GetGamepadProductVersionFromID(SDL_JoystickID instance_id) +Uint16 SDL_GetGamepadProductVersionForID(SDL_JoystickID instance_id) { - return SDL_GetJoystickProductVersionFromID(instance_id); + return SDL_GetJoystickProductVersionForID(instance_id); } -SDL_GamepadType SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id) +SDL_GamepadType SDL_GetGamepadTypeForID(SDL_JoystickID instance_id) { SDL_GamepadType type = SDL_GAMEPAD_TYPE_UNKNOWN; @@ -2497,21 +2497,21 @@ SDL_GamepadType SDL_GetGamepadTypeFromID(SDL_JoystickID instance_id) if (type != SDL_GAMEPAD_TYPE_UNKNOWN) { return type; } - return SDL_GetRealGamepadTypeFromID(instance_id); + return SDL_GetRealGamepadTypeForID(instance_id); } -SDL_GamepadType SDL_GetRealGamepadTypeFromID(SDL_JoystickID instance_id) +SDL_GamepadType SDL_GetRealGamepadTypeForID(SDL_JoystickID instance_id) { SDL_GamepadType type = SDL_GAMEPAD_TYPE_UNKNOWN; const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); { - info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(instance_id); if (info) { type = info->type; } else { - type = SDL_GetGamepadTypeFromGUID(SDL_GetJoystickGUIDFromID(instance_id), SDL_GetJoystickNameFromID(instance_id)); + type = SDL_GetGamepadTypeFromGUID(SDL_GetJoystickGUIDForID(instance_id), SDL_GetJoystickNameForID(instance_id)); } } SDL_UnlockJoysticks(); @@ -2519,7 +2519,7 @@ SDL_GamepadType SDL_GetRealGamepadTypeFromID(SDL_JoystickID instance_id) return type; } -char *SDL_GetGamepadMappingFromID(SDL_JoystickID instance_id) +char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) { char *retval = NULL; @@ -2528,7 +2528,7 @@ char *SDL_GetGamepadMappingFromID(SDL_JoystickID instance_id) GamepadMapping_t *mapping = SDL_PrivateGetGamepadMapping(instance_id, SDL_TRUE); if (mapping) { char pchGUID[33]; - const SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); + const SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID)); SDL_asprintf(&retval, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); } @@ -3336,7 +3336,7 @@ SDL_GamepadType SDL_GetGamepadType(SDL_Gamepad *gamepad) { CHECK_GAMEPAD_MAGIC(gamepad, SDL_GAMEPAD_TYPE_UNKNOWN); - info = SDL_GetJoystickVirtualGamepadInfoFromID(gamepad->joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(gamepad->joystick->instance_id); if (info) { type = info->type; } else { diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 78104a44e092b..1072b2fc484ef 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -754,7 +754,7 @@ SDL_JoystickID *SDL_GetJoysticks(int *count) return joysticks; } -const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoFromID(SDL_JoystickID instance_id) +const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoForID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -770,7 +770,7 @@ const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoFromID(SDL_J /* * Get the implementation dependent name of a joystick */ -const char *SDL_GetJoystickNameFromID(SDL_JoystickID instance_id) +const char *SDL_GetJoystickNameForID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -778,7 +778,7 @@ const char *SDL_GetJoystickNameFromID(SDL_JoystickID instance_id) const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(instance_id); if (info) { name = info->name; } else if (SDL_GetDriverAndJoystickIndex(instance_id, &driver, &device_index)) { @@ -792,7 +792,7 @@ const char *SDL_GetJoystickNameFromID(SDL_JoystickID instance_id) /* * Get the implementation dependent path of a joystick */ -const char *SDL_GetJoystickPathFromID(SDL_JoystickID instance_id) +const char *SDL_GetJoystickPathForID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -813,7 +813,7 @@ const char *SDL_GetJoystickPathFromID(SDL_JoystickID instance_id) /* * Get the player index of a joystick, or -1 if it's not available */ -int SDL_GetJoystickPlayerIndexFromID(SDL_JoystickID instance_id) +int SDL_GetJoystickPlayerIndexForID(SDL_JoystickID instance_id) { int player_index; @@ -864,14 +864,14 @@ static SDL_bool IsROGAlly(SDL_Joystick *joystick) for (i = 0; sensors[i]; ++i) { SDL_SensorID sensor = sensors[i]; - if (!has_ally_accel && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_ACCEL) { - const char *sensor_name = SDL_GetSensorNameFromID(sensor); + if (!has_ally_accel && SDL_GetSensorTypeForID(sensor) == SDL_SENSOR_ACCEL) { + const char *sensor_name = SDL_GetSensorNameForID(sensor); if (sensor_name && SDL_strcmp(sensor_name, "Sensor BMI320 Acc") == 0) { has_ally_accel = SDL_TRUE; } } - if (!has_ally_gyro && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_GYRO) { - const char *sensor_name = SDL_GetSensorNameFromID(sensor); + if (!has_ally_gyro && SDL_GetSensorTypeForID(sensor) == SDL_SENSOR_GYRO) { + const char *sensor_name = SDL_GetSensorNameForID(sensor); if (sensor_name && SDL_strcmp(sensor_name, "Sensor BMI320 Gyr") == 0) { has_ally_gyro = SDL_TRUE; } @@ -966,14 +966,14 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, SDL_bool invert_sensors) for (i = 0; sensors[i]; ++i) { SDL_SensorID sensor = sensors[i]; - if (!joystick->accel_sensor && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_ACCEL) { + if (!joystick->accel_sensor && SDL_GetSensorTypeForID(sensor) == SDL_SENSOR_ACCEL) { /* Increment the sensor subsystem reference count */ SDL_InitSubSystem(SDL_INIT_SENSOR); joystick->accel_sensor = sensor; SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_ACCEL, 0.0f); } - if (!joystick->gyro_sensor && SDL_GetSensorTypeFromID(sensor) == SDL_SENSOR_GYRO) { + if (!joystick->gyro_sensor && SDL_GetSensorTypeForID(sensor) == SDL_SENSOR_GYRO) { /* Increment the sensor subsystem reference count */ SDL_InitSubSystem(SDL_INIT_SENSOR); @@ -1151,7 +1151,7 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id) } /* Get the Steam Input API handle */ - info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(instance_id); if (info) { joystick->steam_handle = info->handle; } @@ -1651,7 +1651,7 @@ const char *SDL_GetJoystickName(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, NULL); - info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(joystick->instance_id); if (info) { retval = info->name; } else { @@ -2362,7 +2362,7 @@ static void SendSteamHandleUpdateEvents(void) continue; } - info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(joystick->instance_id); if (info) { if (joystick->steam_handle != info->handle) { joystick->steam_handle = info->handle; @@ -3258,7 +3258,7 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) } /* return the guid for this index */ -SDL_JoystickGUID SDL_GetJoystickGUIDFromID(SDL_JoystickID instance_id) +SDL_JoystickGUID SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; @@ -3275,17 +3275,17 @@ SDL_JoystickGUID SDL_GetJoystickGUIDFromID(SDL_JoystickID instance_id) return guid; } -Uint16 SDL_GetJoystickVendorFromID(SDL_JoystickID instance_id) +Uint16 SDL_GetJoystickVendorForID(SDL_JoystickID instance_id) { Uint16 vendor; const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(instance_id); if (info) { vendor = info->vendor_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); } @@ -3294,17 +3294,17 @@ Uint16 SDL_GetJoystickVendorFromID(SDL_JoystickID instance_id) return vendor; } -Uint16 SDL_GetJoystickProductFromID(SDL_JoystickID instance_id) +Uint16 SDL_GetJoystickProductForID(SDL_JoystickID instance_id) { Uint16 product; const SDL_SteamVirtualGamepadInfo *info; SDL_LockJoysticks(); - info = SDL_GetJoystickVirtualGamepadInfoFromID(instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(instance_id); if (info) { product = info->product_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); } @@ -3313,19 +3313,19 @@ Uint16 SDL_GetJoystickProductFromID(SDL_JoystickID instance_id) return product; } -Uint16 SDL_GetJoystickProductVersionFromID(SDL_JoystickID instance_id) +Uint16 SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id) { Uint16 version; - SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL); return version; } -SDL_JoystickType SDL_GetJoystickTypeFromID(SDL_JoystickID instance_id) +SDL_JoystickType SDL_GetJoystickTypeForID(SDL_JoystickID instance_id) { SDL_JoystickType type; - SDL_JoystickGUID guid = SDL_GetJoystickGUIDFromID(instance_id); + SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); type = SDL_GetJoystickGUIDType(guid); if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { @@ -3362,7 +3362,7 @@ Uint16 SDL_GetJoystickVendor(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, 0); - info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(joystick->instance_id); if (info) { vendor = info->vendor_id; } else { @@ -3385,7 +3385,7 @@ Uint16 SDL_GetJoystickProduct(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, 0); - info = SDL_GetJoystickVirtualGamepadInfoFromID(joystick->instance_id); + info = SDL_GetJoystickVirtualGamepadInfoForID(joystick->instance_id); if (info) { product = info->product_id; } else { diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index ea483aa1d1e4f..c8ac9a3591f70 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -170,7 +170,7 @@ extern int SDL_SendJoystickSensor(Uint64 timestamp, SDL_Joystick *joystick, SDL_ extern void SDL_SendJoystickPowerInfo(SDL_Joystick *joystick, SDL_PowerState state, int percent); /* Function to get the Steam virtual gamepad info for a joystick */ -extern const struct SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoFromID(SDL_JoystickID instance_id); +extern const struct SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoForID(SDL_JoystickID instance_id); /* Internal sanity checking functions */ extern SDL_bool SDL_IsJoystickValid(SDL_Joystick *joystick); diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index 9a4ddf4e930a3..141ca0d78ada8 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -238,7 +238,7 @@ static SDL_bool SDL_GetDriverAndSensorIndex(SDL_SensorID instance_id, SDL_Sensor /* * Get the implementation dependent name of a sensor */ -const char *SDL_GetSensorNameFromID(SDL_SensorID instance_id) +const char *SDL_GetSensorNameForID(SDL_SensorID instance_id) { SDL_SensorDriver *driver; int device_index; @@ -253,7 +253,7 @@ const char *SDL_GetSensorNameFromID(SDL_SensorID instance_id) return name ? SDL_FreeLater(SDL_strdup(name)) : NULL; } -SDL_SensorType SDL_GetSensorTypeFromID(SDL_SensorID instance_id) +SDL_SensorType SDL_GetSensorTypeForID(SDL_SensorID instance_id) { SDL_SensorDriver *driver; int device_index; @@ -268,7 +268,7 @@ SDL_SensorType SDL_GetSensorTypeFromID(SDL_SensorID instance_id) return type; } -int SDL_GetSensorNonPortableTypeFromID(SDL_SensorID instance_id) +int SDL_GetSensorNonPortableTypeForID(SDL_SensorID instance_id) { SDL_SensorDriver *driver; int device_index; diff --git a/test/testhaptic.c b/test/testhaptic.c index 077383f3bd461..51017b9b8890b 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -86,7 +86,7 @@ int main(int argc, char **argv) haptics = SDL_GetHaptics(&num_haptics); SDL_Log("%d Haptic devices detected.\n", num_haptics); for (i = 0; i < num_haptics; ++i) { - SDL_Log(" %s\n", SDL_GetHapticNameFromID(haptics[i])); + SDL_Log(" %s\n", SDL_GetHapticNameForID(haptics[i])); } if (haptics) { if (num_haptics == 0) { @@ -108,7 +108,7 @@ int main(int argc, char **argv) /* Try to find matching device */ else { for (i = 0; i < num_haptics; i++) { - if (SDL_strstr(SDL_GetHapticNameFromID(haptics[i]), name) != NULL) { + if (SDL_strstr(SDL_GetHapticNameForID(haptics[i]), name) != NULL) { break; } } diff --git a/test/testhotplug.c b/test/testhotplug.c index d28249b198878..ec635c1bf4fe3 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -103,13 +103,13 @@ int main(int argc, char *argv[]) keepGoing = SDL_FALSE; break; case SDL_EVENT_KEYBOARD_ADDED: - SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardNameFromID(event.kdevice.which), event.kdevice.which); + SDL_Log("Keyboard '%s' added : %" SDL_PRIu32 "\n", SDL_GetKeyboardNameForID(event.kdevice.which), event.kdevice.which); break; case SDL_EVENT_KEYBOARD_REMOVED: SDL_Log("Keyboard removed: %" SDL_PRIu32 "\n", event.kdevice.which); break; case SDL_EVENT_MOUSE_ADDED: - SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseNameFromID(event.mdevice.which), event.mdevice.which); + SDL_Log("Mouse '%s' added : %" SDL_PRIu32 "\n", SDL_GetMouseNameForID(event.mdevice.which), event.mdevice.which); break; case SDL_EVENT_MOUSE_REMOVED: SDL_Log("Mouse removed: %" SDL_PRIu32 "\n", event.mdevice.which); diff --git a/test/testrumble.c b/test/testrumble.c index e2d4c63166263..ee957181cc1c3 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -109,7 +109,7 @@ int main(int argc, char **argv) /* Try to find matching device */ else { for (i = 0; i < num_haptics; i++) { - if (SDL_strstr(SDL_GetHapticNameFromID(haptics[i]), name) != NULL) { + if (SDL_strstr(SDL_GetHapticNameForID(haptics[i]), name) != NULL) { break; } } diff --git a/test/testsensor.c b/test/testsensor.c index 77ad36a935b8c..404c9723bf3c4 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -91,11 +91,11 @@ int main(int argc, char **argv) for (i = 0; i < num_sensors; ++i) { SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %s, platform type %d\n", sensors[i], - SDL_GetSensorNameFromID(sensors[i]), - GetSensorTypeString(SDL_GetSensorTypeFromID(sensors[i])), - SDL_GetSensorNonPortableTypeFromID(sensors[i])); + SDL_GetSensorNameForID(sensors[i]), + GetSensorTypeString(SDL_GetSensorTypeForID(sensors[i])), + SDL_GetSensorNonPortableTypeForID(sensors[i])); - if (SDL_GetSensorTypeFromID(sensors[i]) != SDL_SENSOR_UNKNOWN) { + if (SDL_GetSensorTypeForID(sensors[i]) != SDL_SENSOR_UNKNOWN) { SDL_Sensor *sensor = SDL_OpenSensor(sensors[i]); if (!sensor) { SDL_Log("Couldn't open sensor %" SDL_PRIu32 ": %s\n", sensors[i], SDL_GetError()); From 9406a9d527fc4436ade12ca3ce1e6c2e617e8ead Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Sun, 14 Jul 2024 23:42:33 +0000 Subject: [PATCH 317/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_render.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 38367548da35f..6580f575bcff4 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1963,6 +1963,12 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_RenderReadPixels(SDL_Renderer *ren * starting each new frame's drawing, even if you plan to overwrite every * pixel. * + * Please note, that in case of rendering to a texture - there is **no need** + * to call `SDL_RenderPresent` after drawing needed objects to a texture, you + * are only required to change back the rendering target to default via + * `SDL_SetRenderTarget(renderer, NULL)` afterwards, as textures by themselves + * do not have a concept of backbuffers. + * * \param renderer the rendering context. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. From f099898a66021bfdfc2cfdc904de3f59f45af9da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20=C3=85stholm?= Date: Mon, 15 Jul 2024 13:43:19 +0200 Subject: [PATCH 318/431] Correct ibus include path ibus-1.0.pc adds /usr/include/ibus-1.0 to the search path but not /usr/include, which makes the canonical include path . --- src/core/linux/SDL_ibus.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/linux/SDL_ibus.h b/src/core/linux/SDL_ibus.h index 1a6fc5bb73231..97ce32a71c349 100644 --- a/src/core/linux/SDL_ibus.h +++ b/src/core/linux/SDL_ibus.h @@ -26,7 +26,7 @@ #ifdef HAVE_IBUS_IBUS_H #define SDL_USE_IBUS 1 -#include +#include extern SDL_bool SDL_IBus_Init(void); extern void SDL_IBus_Quit(void); From df573391b156dd53831659b6964fc2d92b797f32 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 08:27:58 -0700 Subject: [PATCH 319/431] Added SDL_BLENDMODE_BLEND_PREMULTIPLIED and SDL_BLENDMODE_ADD_PREMULTIPLIED Fixes https://github.com/libsdl-org/SDL/issues/2485 --- include/SDL3/SDL_blendmode.h | 46 +- src/render/SDL_render.c | 22 + src/render/ps2/SDL_render_ps2.c | 14 + src/render/psp/SDL_render_psp.c | 10 + src/render/software/SDL_blendfillrect.c | 28 + src/render/software/SDL_blendline.c | 126 + src/render/software/SDL_blendpoint.c | 28 + src/render/software/SDL_draw.h | 64 + src/video/SDL_RLEaccel.c | 2 +- src/video/SDL_blit.c | 2 +- src/video/SDL_blit.h | 26 +- src/video/SDL_blit_auto.c | 6315 ++++++++++++++++++----- src/video/SDL_blit_slow.c | 25 +- src/video/SDL_surface.c | 18 +- src/video/sdlgenblit.pl | 66 +- test/testautomation_images.c | 2437 ++++++--- test/testautomation_images.h | 4 +- test/testautomation_render.c | 43 + test/testautomation_surface.c | 60 +- test/testdraw.c | 8 +- test/testintersections.c | 8 +- test/testsprite.c | 8 +- 22 files changed, 7410 insertions(+), 1950 deletions(-) diff --git a/include/SDL3/SDL_blendmode.h b/include/SDL3/SDL_blendmode.h index 159924b4d95a1..9f28ae42c91a6 100644 --- a/include/SDL3/SDL_blendmode.h +++ b/include/SDL3/SDL_blendmode.h @@ -41,8 +41,9 @@ extern "C" { /** * A set of blend modes used in drawing operations. * - * Note that additional values may be obtained from - * SDL_ComposeCustomBlendMode. + * These predefined blend modes are supported everywhere. + * + * Additional values may be obtained from SDL_ComposeCustomBlendMode. * * \since This datatype is available since SDL 3.0.0. * @@ -50,20 +51,25 @@ extern "C" { */ typedef Uint32 SDL_BlendMode; -#define SDL_BLENDMODE_NONE 0x00000000u /**< no blending - dstRGBA = srcRGBA */ -#define SDL_BLENDMODE_BLEND 0x00000001u /**< alpha blending - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) */ -#define SDL_BLENDMODE_ADD 0x00000002u /**< additive blending - dstRGB = (srcRGB * srcA) + dstRGB - dstA = dstA */ -#define SDL_BLENDMODE_MOD 0x00000004u /**< color modulate - dstRGB = srcRGB * dstRGB - dstA = dstA */ -#define SDL_BLENDMODE_MUL 0x00000008u /**< color multiply - dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) - dstA = dstA */ +#define SDL_BLENDMODE_NONE 0x00000000u /**< no blending + dstRGBA = srcRGBA */ +#define SDL_BLENDMODE_BLEND 0x00000001u /**< alpha blending + dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) + dstA = srcA + (dstA * (1-srcA)) */ +#define SDL_BLENDMODE_BLEND_PREMULTIPLIED 0x00000010u /**< pre-multiplied alpha blending + dstRGBA = srcRGBA + (dstRGBA * (1-srcA)) */ +#define SDL_BLENDMODE_ADD 0x00000002u /**< additive blending + dstRGB = (srcRGB * srcA) + dstRGB + dstA = dstA */ +#define SDL_BLENDMODE_ADD_PREMULTIPLIED 0x00000020u /**< pre-multiplied additive blending + dstRGB = srcRGB + dstRGB + dstA = dstA */ +#define SDL_BLENDMODE_MOD 0x00000004u /**< color modulate + dstRGB = srcRGB * dstRGB + dstA = dstA */ +#define SDL_BLENDMODE_MUL 0x00000008u /**< color multiply + dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) + dstA = dstA */ #define SDL_BLENDMODE_INVALID 0x7FFFFFFFu /** @@ -75,10 +81,10 @@ typedef Uint32 SDL_BlendMode; typedef enum SDL_BlendOperation { SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ - SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ - SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D9, D3D11 */ - SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D9, D3D11 */ + SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< src - dst : supported by D3D, OpenGL, OpenGLES, and Vulkan */ + SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< dst - src : supported by D3D, OpenGL, OpenGLES, and Vulkan */ + SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan */ + SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D, OpenGL, OpenGLES, and Vulkan */ } SDL_BlendOperation; /** diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 2153c239c8ce9..64128c79c02a4 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -83,10 +83,18 @@ this should probably be removed at some point in the future. --ryan. */ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD) +#define SDL_BLENDMODE_BLEND_PREMULTIPLIED_FULL \ + SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD, \ + SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, SDL_BLENDOPERATION_ADD) + #define SDL_BLENDMODE_ADD_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_SRC_ALPHA, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) +#define SDL_BLENDMODE_ADD_PREMULTIPLIED_FULL \ + SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD, \ + SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) + #define SDL_BLENDMODE_MOD_FULL \ SDL_COMPOSE_BLENDMODE(SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_SRC_COLOR, SDL_BLENDOPERATION_ADD, \ SDL_BLENDFACTOR_ZERO, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_ADD) @@ -1234,7 +1242,9 @@ static SDL_bool IsSupportedBlendMode(SDL_Renderer *renderer, SDL_BlendMode blend /* These are required to be supported by all renderers */ case SDL_BLENDMODE_NONE: case SDL_BLENDMODE_BLEND: + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: case SDL_BLENDMODE_MOD: case SDL_BLENDMODE_MUL: return SDL_TRUE; @@ -4682,9 +4692,15 @@ static SDL_BlendMode SDL_GetShortBlendMode(SDL_BlendMode blendMode) if (blendMode == SDL_BLENDMODE_BLEND_FULL) { return SDL_BLENDMODE_BLEND; } + if (blendMode == SDL_BLENDMODE_BLEND_PREMULTIPLIED_FULL) { + return SDL_BLENDMODE_BLEND_PREMULTIPLIED; + } if (blendMode == SDL_BLENDMODE_ADD_FULL) { return SDL_BLENDMODE_ADD; } + if (blendMode == SDL_BLENDMODE_ADD_PREMULTIPLIED_FULL) { + return SDL_BLENDMODE_ADD_PREMULTIPLIED; + } if (blendMode == SDL_BLENDMODE_MOD_FULL) { return SDL_BLENDMODE_MOD; } @@ -4702,9 +4718,15 @@ static SDL_BlendMode SDL_GetLongBlendMode(SDL_BlendMode blendMode) if (blendMode == SDL_BLENDMODE_BLEND) { return SDL_BLENDMODE_BLEND_FULL; } + if (blendMode == SDL_BLENDMODE_BLEND_PREMULTIPLIED) { + return SDL_BLENDMODE_BLEND_PREMULTIPLIED_FULL; + } if (blendMode == SDL_BLENDMODE_ADD) { return SDL_BLENDMODE_ADD_FULL; } + if (blendMode == SDL_BLENDMODE_ADD_PREMULTIPLIED) { + return SDL_BLENDMODE_ADD_PREMULTIPLIED_FULL; + } if (blendMode == SDL_BLENDMODE_MOD) { return SDL_BLENDMODE_MOD_FULL; } diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c index 09bdbe901c559..bbb9e5739082e 100644 --- a/src/render/ps2/SDL_render_ps2.c +++ b/src/render/ps2/SDL_render_ps2.c @@ -416,12 +416,26 @@ static void PS2_SetBlendMode(PS2_RenderData *data, int blendMode) data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; break; } + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + { + /* FIXME: What are the settings for this? */ + gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_DEST, A_ALPHA_SOURCE, A_COLOR_DEST, 0), 0); + data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; + break; + } case SDL_BLENDMODE_ADD: { gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_NULL, A_ALPHA_FIX, A_COLOR_DEST, 0x80), 0); data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; break; } + case SDL_BLENDMODE_ADD_PREMULTIPLIED: + { + /* FIXME: What are the settings for this? */ + gsKit_set_primalpha(data->gsGlobal, GS_SETREG_ALPHA(A_COLOR_SOURCE, A_COLOR_NULL, A_ALPHA_FIX, A_COLOR_DEST, 0x80), 0); + data->gsGlobal->PrimAlphaEnable = GS_SETTING_ON; + break; + } case SDL_BLENDMODE_MUL: case SDL_BLENDMODE_MOD: { diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 6ba77415d3242..48959d39eec4a 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -990,11 +990,21 @@ static void PSP_SetBlendState(PSP_RenderData *data, PSP_BlendState *state) sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0); sceGuEnable(GU_BLEND); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + sceGuTexFunc(GU_TFX_MODULATE , GU_TCC_RGBA); + sceGuBlendFunc(GU_ADD, GU_FIX, GU_ONE_MINUS_SRC_ALPHA, 0x00FFFFFF, 0 ); + sceGuEnable(GU_BLEND); + break; case SDL_BLENDMODE_ADD: sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_FIX, 0, 0x00FFFFFF); sceGuEnable(GU_BLEND); break; + case SDL_BLENDMODE_ADD_PREMULTIPLIED: + sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); + sceGuBlendFunc(GU_ADD, GU_FIX, GU_FIX, 0, 0x00FFFFFF); + sceGuEnable(GU_BLEND); + break; case SDL_BLENDMODE_MOD: sceGuTexFunc(GU_TFX_MODULATE, GU_TCC_RGBA); sceGuBlendFunc(GU_ADD, GU_FIX, GU_SRC_COLOR, 0, 0); diff --git a/src/render/software/SDL_blendfillrect.c b/src/render/software/SDL_blendfillrect.c index 45c32f96bda5a..df42f4517fc32 100644 --- a/src/render/software/SDL_blendfillrect.c +++ b/src/render/software/SDL_blendfillrect.c @@ -34,7 +34,11 @@ static int SDL_BlendFillRect_RGB555(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB555); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB555); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB555); break; case SDL_BLENDMODE_MOD: @@ -59,7 +63,11 @@ static int SDL_BlendFillRect_RGB565(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB565); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB565); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB565); break; case SDL_BLENDMODE_MOD: @@ -84,7 +92,11 @@ static int SDL_BlendFillRect_XRGB8888(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_XRGB8888); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint32, DRAW_SETPIXEL_ADD_XRGB8888); break; case SDL_BLENDMODE_MOD: @@ -109,7 +121,11 @@ static int SDL_BlendFillRect_ARGB8888(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_ARGB8888); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint32, DRAW_SETPIXEL_ADD_ARGB8888); break; case SDL_BLENDMODE_MOD: @@ -137,7 +153,11 @@ static int SDL_BlendFillRect_RGB(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_RGB); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint16, DRAW_SETPIXEL_ADD_RGB); break; case SDL_BLENDMODE_MOD: @@ -156,7 +176,11 @@ static int SDL_BlendFillRect_RGB(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGB); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGB); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGB); break; case SDL_BLENDMODE_MOD: @@ -187,7 +211,11 @@ static int SDL_BlendFillRect_RGBA(SDL_Surface *dst, const SDL_Rect *rect, case SDL_BLENDMODE_BLEND: FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_RGBA); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + FILLRECT(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGBA); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: FILLRECT(Uint32, DRAW_SETPIXEL_ADD_RGBA); break; case SDL_BLENDMODE_MOD: diff --git a/src/render/software/SDL_blendline.c b/src/render/software/SDL_blendline.c index 4098280797c3b..8b53d5ca3fd43 100644 --- a/src/render/software/SDL_blendline.c +++ b/src/render/software/SDL_blendline.c @@ -51,7 +51,11 @@ static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, case SDL_BLENDMODE_BLEND: HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end); break; case SDL_BLENDMODE_MOD: @@ -69,7 +73,11 @@ static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, case SDL_BLENDMODE_BLEND: VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end); break; case SDL_BLENDMODE_MOD: @@ -87,7 +95,11 @@ static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, case SDL_BLENDMODE_BLEND: DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB, draw_end); break; case SDL_BLENDMODE_MOD: @@ -107,7 +119,13 @@ static void SDL_BlendLine_RGB2(SDL_Surface *dst, int x1, int y1, int x2, int y2, DRAW_SETPIXELXY2_BLEND_RGB, DRAW_SETPIXELXY2_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY2_BLEND_CLAMPED_RGB, DRAW_SETPIXELXY2_BLEND_CLAMPED_RGB, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY2_ADD_RGB, DRAW_SETPIXELXY2_ADD_RGB, draw_end); @@ -155,7 +173,11 @@ static void SDL_BlendLine_RGB555(SDL_Surface *dst, int x1, int y1, int x2, int y case SDL_BLENDMODE_BLEND: HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB555, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end); break; case SDL_BLENDMODE_MOD: @@ -173,7 +195,11 @@ static void SDL_BlendLine_RGB555(SDL_Surface *dst, int x1, int y1, int x2, int y case SDL_BLENDMODE_BLEND: VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB555, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end); break; case SDL_BLENDMODE_MOD: @@ -191,7 +217,11 @@ static void SDL_BlendLine_RGB555(SDL_Surface *dst, int x1, int y1, int x2, int y case SDL_BLENDMODE_BLEND: DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB555, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB555, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB555, draw_end); break; case SDL_BLENDMODE_MOD: @@ -211,7 +241,13 @@ static void SDL_BlendLine_RGB555(SDL_Surface *dst, int x1, int y1, int x2, int y DRAW_SETPIXELXY_BLEND_RGB555, DRAW_SETPIXELXY_BLEND_RGB555, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_CLAMPED_RGB555, DRAW_SETPIXELXY_BLEND_CLAMPED_RGB555, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB555, DRAW_SETPIXELXY_ADD_RGB555, draw_end); @@ -259,7 +295,11 @@ static void SDL_BlendLine_RGB565(SDL_Surface *dst, int x1, int y1, int x2, int y case SDL_BLENDMODE_BLEND: HLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB565, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end); break; case SDL_BLENDMODE_MOD: @@ -277,7 +317,11 @@ static void SDL_BlendLine_RGB565(SDL_Surface *dst, int x1, int y1, int x2, int y case SDL_BLENDMODE_BLEND: VLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB565, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end); break; case SDL_BLENDMODE_MOD: @@ -295,7 +339,11 @@ static void SDL_BlendLine_RGB565(SDL_Surface *dst, int x1, int y1, int x2, int y case SDL_BLENDMODE_BLEND: DLINE(Uint16, DRAW_SETPIXEL_BLEND_RGB565, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint16, DRAW_SETPIXEL_BLEND_CLAMPED_RGB565, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint16, DRAW_SETPIXEL_ADD_RGB565, draw_end); break; case SDL_BLENDMODE_MOD: @@ -315,7 +363,13 @@ static void SDL_BlendLine_RGB565(SDL_Surface *dst, int x1, int y1, int x2, int y DRAW_SETPIXELXY_BLEND_RGB565, DRAW_SETPIXELXY_BLEND_RGB565, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_CLAMPED_RGB565, DRAW_SETPIXELXY_BLEND_CLAMPED_RGB565, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_RGB565, DRAW_SETPIXELXY_ADD_RGB565, draw_end); @@ -364,7 +418,11 @@ static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, case SDL_BLENDMODE_BLEND: HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGB, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end); break; case SDL_BLENDMODE_MOD: @@ -382,7 +440,11 @@ static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, case SDL_BLENDMODE_BLEND: VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGB, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end); break; case SDL_BLENDMODE_MOD: @@ -400,7 +462,11 @@ static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, case SDL_BLENDMODE_BLEND: DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGB, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint32, DRAW_SETPIXEL_ADD_RGB, draw_end); break; case SDL_BLENDMODE_MOD: @@ -420,7 +486,13 @@ static void SDL_BlendLine_RGB4(SDL_Surface *dst, int x1, int y1, int x2, int y2, DRAW_SETPIXELXY4_BLEND_RGB, DRAW_SETPIXELXY4_BLEND_RGB, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_BLEND_CLAMPED_RGB, DRAW_SETPIXELXY4_BLEND_CLAMPED_RGB, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_ADD_RGB, DRAW_SETPIXELXY4_ADD_RGB, draw_end); @@ -469,7 +541,11 @@ static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2 case SDL_BLENDMODE_BLEND: HLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGBA, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end); break; case SDL_BLENDMODE_MOD: @@ -487,7 +563,11 @@ static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2 case SDL_BLENDMODE_BLEND: VLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGBA, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end); break; case SDL_BLENDMODE_MOD: @@ -505,7 +585,11 @@ static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2 case SDL_BLENDMODE_BLEND: DLINE(Uint32, DRAW_SETPIXEL_BLEND_RGBA, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_RGBA, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint32, DRAW_SETPIXEL_ADD_RGBA, draw_end); break; case SDL_BLENDMODE_MOD: @@ -525,7 +609,13 @@ static void SDL_BlendLine_RGBA4(SDL_Surface *dst, int x1, int y1, int x2, int y2 DRAW_SETPIXELXY4_BLEND_RGBA, DRAW_SETPIXELXY4_BLEND_RGBA, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY4_BLEND_CLAMPED_RGBA, DRAW_SETPIXELXY4_BLEND_CLAMPED_RGBA, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY4_ADD_RGBA, DRAW_SETPIXELXY4_ADD_RGBA, draw_end); @@ -573,7 +663,11 @@ static void SDL_BlendLine_XRGB8888(SDL_Surface *dst, int x1, int y1, int x2, int case SDL_BLENDMODE_BLEND: HLINE(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_XRGB8888, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint32, DRAW_SETPIXEL_ADD_XRGB8888, draw_end); break; case SDL_BLENDMODE_MOD: @@ -591,7 +685,11 @@ static void SDL_BlendLine_XRGB8888(SDL_Surface *dst, int x1, int y1, int x2, int case SDL_BLENDMODE_BLEND: VLINE(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_XRGB8888, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint32, DRAW_SETPIXEL_ADD_XRGB8888, draw_end); break; case SDL_BLENDMODE_MOD: @@ -609,7 +707,11 @@ static void SDL_BlendLine_XRGB8888(SDL_Surface *dst, int x1, int y1, int x2, int case SDL_BLENDMODE_BLEND: DLINE(Uint32, DRAW_SETPIXEL_BLEND_XRGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_XRGB8888, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint32, DRAW_SETPIXEL_ADD_XRGB8888, draw_end); break; case SDL_BLENDMODE_MOD: @@ -629,7 +731,13 @@ static void SDL_BlendLine_XRGB8888(SDL_Surface *dst, int x1, int y1, int x2, int DRAW_SETPIXELXY_BLEND_XRGB8888, DRAW_SETPIXELXY_BLEND_XRGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_CLAMPED_XRGB8888, DRAW_SETPIXELXY_BLEND_CLAMPED_XRGB8888, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_XRGB8888, DRAW_SETPIXELXY_ADD_XRGB8888, draw_end); @@ -677,7 +785,11 @@ static void SDL_BlendLine_ARGB8888(SDL_Surface *dst, int x1, int y1, int x2, int case SDL_BLENDMODE_BLEND: HLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + HLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_ARGB8888, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: HLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end); break; case SDL_BLENDMODE_MOD: @@ -695,7 +807,11 @@ static void SDL_BlendLine_ARGB8888(SDL_Surface *dst, int x1, int y1, int x2, int case SDL_BLENDMODE_BLEND: VLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + VLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_ARGB8888, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: VLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end); break; case SDL_BLENDMODE_MOD: @@ -713,7 +829,11 @@ static void SDL_BlendLine_ARGB8888(SDL_Surface *dst, int x1, int y1, int x2, int case SDL_BLENDMODE_BLEND: DLINE(Uint32, DRAW_SETPIXEL_BLEND_ARGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DLINE(Uint32, DRAW_SETPIXEL_BLEND_CLAMPED_ARGB8888, draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DLINE(Uint32, DRAW_SETPIXEL_ADD_ARGB8888, draw_end); break; case SDL_BLENDMODE_MOD: @@ -733,7 +853,13 @@ static void SDL_BlendLine_ARGB8888(SDL_Surface *dst, int x1, int y1, int x2, int DRAW_SETPIXELXY_BLEND_ARGB8888, DRAW_SETPIXELXY_BLEND_ARGB8888, draw_end); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + AALINE(x1, y1, x2, y2, + DRAW_SETPIXELXY_BLEND_CLAMPED_ARGB8888, DRAW_SETPIXELXY_BLEND_CLAMPED_ARGB8888, + draw_end); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: AALINE(x1, y1, x2, y2, DRAW_SETPIXELXY_ADD_ARGB8888, DRAW_SETPIXELXY_ADD_ARGB8888, draw_end); diff --git a/src/render/software/SDL_blendpoint.c b/src/render/software/SDL_blendpoint.c index db325ab94a3f9..4ccdabe1701c8 100644 --- a/src/render/software/SDL_blendpoint.c +++ b/src/render/software/SDL_blendpoint.c @@ -34,7 +34,11 @@ static int SDL_BlendPoint_RGB555(SDL_Surface *dst, int x, int y, SDL_BlendMode b case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY_BLEND_RGB555(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY_BLEND_CLAMPED_RGB555(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY_ADD_RGB555(x, y); break; case SDL_BLENDMODE_MOD: @@ -59,7 +63,11 @@ static int SDL_BlendPoint_RGB565(SDL_Surface *dst, int x, int y, SDL_BlendMode b case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY_BLEND_RGB565(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY_BLEND_CLAMPED_RGB565(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY_ADD_RGB565(x, y); break; case SDL_BLENDMODE_MOD: @@ -84,7 +92,11 @@ static int SDL_BlendPoint_XRGB8888(SDL_Surface *dst, int x, int y, SDL_BlendMode case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY_BLEND_XRGB8888(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY_BLEND_CLAMPED_XRGB8888(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY_ADD_XRGB8888(x, y); break; case SDL_BLENDMODE_MOD: @@ -109,7 +121,11 @@ static int SDL_BlendPoint_ARGB8888(SDL_Surface *dst, int x, int y, SDL_BlendMode case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY_BLEND_ARGB8888(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY_BLEND_CLAMPED_ARGB8888(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY_ADD_ARGB8888(x, y); break; case SDL_BLENDMODE_MOD: @@ -137,7 +153,11 @@ static int SDL_BlendPoint_RGB(SDL_Surface *dst, int x, int y, SDL_BlendMode blen case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY2_BLEND_RGB(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY2_BLEND_CLAMPED_RGB(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY2_ADD_RGB(x, y); break; case SDL_BLENDMODE_MOD: @@ -156,7 +176,11 @@ static int SDL_BlendPoint_RGB(SDL_Surface *dst, int x, int y, SDL_BlendMode blen case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY4_BLEND_RGB(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY4_BLEND_CLAMPED_RGB(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY4_ADD_RGB(x, y); break; case SDL_BLENDMODE_MOD: @@ -187,7 +211,11 @@ static int SDL_BlendPoint_RGBA(SDL_Surface *dst, int x, int y, SDL_BlendMode ble case SDL_BLENDMODE_BLEND: DRAW_SETPIXELXY4_BLEND_RGBA(x, y); break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + DRAW_SETPIXELXY4_BLEND_CLAMPED_RGBA(x, y); + break; case SDL_BLENDMODE_ADD: + case SDL_BLENDMODE_ADD_PREMULTIPLIED: DRAW_SETPIXELXY4_ADD_RGBA(x, y); break; case SDL_BLENDMODE_MOD: diff --git a/src/render/software/SDL_draw.h b/src/render/software/SDL_draw.h index 56df78d364320..08c8aba8194b8 100644 --- a/src/render/software/SDL_draw.h +++ b/src/render/software/SDL_draw.h @@ -60,6 +60,25 @@ setpixel; \ } while (0) +#define DRAW_SETPIXEL_BLEND_CLAMPED(getpixel, setpixel) \ + do { \ + unsigned sr, sg, sb, sa = 0xFF; \ + getpixel; \ + sr = DRAW_MUL(inva, sr) + r; \ + if (sr > 0xff) \ + sr = 0xff; \ + sg = DRAW_MUL(inva, sg) + g; \ + if (sg > 0xff) \ + sg = 0xff; \ + sb = DRAW_MUL(inva, sb) + b; \ + if (sb > 0xff) \ + sb = 0xff; \ + sa = DRAW_MUL(inva, sa) + a; \ + if (sa > 0xff) \ + sa = 0xff; \ + setpixel; \ + } while (0) + #define DRAW_SETPIXEL_ADD(getpixel, setpixel) \ do { \ unsigned sr, sg, sb, sa; \ @@ -122,6 +141,10 @@ DRAW_SETPIXEL_BLEND(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) +#define DRAW_SETPIXEL_BLEND_CLAMPED_RGB555 \ + DRAW_SETPIXEL_BLEND_CLAMPED(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ + RGB555_FROM_RGB(*pixel, sr, sg, sb)) + #define DRAW_SETPIXEL_ADD_RGB555 \ DRAW_SETPIXEL_ADD(RGB_FROM_RGB555(*pixel, sr, sg, sb), \ RGB555_FROM_RGB(*pixel, sr, sg, sb)) @@ -140,6 +163,9 @@ #define DRAW_SETPIXELXY_BLEND_RGB555(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB555) +#define DRAW_SETPIXELXY_BLEND_CLAMPED_RGB555(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_CLAMPED_RGB555) + #define DRAW_SETPIXELXY_ADD_RGB555(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB555) @@ -160,6 +186,10 @@ DRAW_SETPIXEL_BLEND(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) +#define DRAW_SETPIXEL_BLEND_CLAMPED_RGB565 \ + DRAW_SETPIXEL_BLEND_CLAMPED(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ + RGB565_FROM_RGB(*pixel, sr, sg, sb)) + #define DRAW_SETPIXEL_ADD_RGB565 \ DRAW_SETPIXEL_ADD(RGB_FROM_RGB565(*pixel, sr, sg, sb), \ RGB565_FROM_RGB(*pixel, sr, sg, sb)) @@ -178,6 +208,9 @@ #define DRAW_SETPIXELXY_BLEND_RGB565(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB565) +#define DRAW_SETPIXELXY_BLEND_CLAMPED_RGB565(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_CLAMPED_RGB565) + #define DRAW_SETPIXELXY_ADD_RGB565(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB565) @@ -198,6 +231,10 @@ DRAW_SETPIXEL_BLEND(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \ XRGB8888_FROM_RGB(*pixel, sr, sg, sb)) +#define DRAW_SETPIXEL_BLEND_CLAMPED_XRGB8888 \ + DRAW_SETPIXEL_BLEND_CLAMPED(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \ + XRGB8888_FROM_RGB(*pixel, sr, sg, sb)) + #define DRAW_SETPIXEL_ADD_XRGB8888 \ DRAW_SETPIXEL_ADD(RGB_FROM_XRGB8888(*pixel, sr, sg, sb), \ XRGB8888_FROM_RGB(*pixel, sr, sg, sb)) @@ -216,6 +253,9 @@ #define DRAW_SETPIXELXY_BLEND_XRGB8888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_XRGB8888) +#define DRAW_SETPIXELXY_BLEND_CLAMPED_XRGB8888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_CLAMPED_XRGB8888) + #define DRAW_SETPIXELXY_ADD_XRGB8888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_XRGB8888) @@ -236,6 +276,10 @@ DRAW_SETPIXEL_BLEND(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) +#define DRAW_SETPIXEL_BLEND_CLAMPED_ARGB8888 \ + DRAW_SETPIXEL_BLEND_CLAMPED(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ + ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) + #define DRAW_SETPIXEL_ADD_ARGB8888 \ DRAW_SETPIXEL_ADD(RGBA_FROM_ARGB8888(*pixel, sr, sg, sb, sa), \ ARGB8888_FROM_RGBA(*pixel, sr, sg, sb, sa)) @@ -254,6 +298,9 @@ #define DRAW_SETPIXELXY_BLEND_ARGB8888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_ARGB8888) +#define DRAW_SETPIXELXY_BLEND_CLAMPED_ARGB8888(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_CLAMPED_ARGB8888) + #define DRAW_SETPIXELXY_ADD_ARGB8888(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_ARGB8888) @@ -274,6 +321,10 @@ DRAW_SETPIXEL_BLEND(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) +#define DRAW_SETPIXEL_BLEND_CLAMPED_RGB \ + DRAW_SETPIXEL_BLEND_CLAMPED(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ + PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) + #define DRAW_SETPIXEL_ADD_RGB \ DRAW_SETPIXEL_ADD(RGB_FROM_PIXEL(*pixel, fmt, sr, sg, sb), \ PIXEL_FROM_RGB(*pixel, fmt, sr, sg, sb)) @@ -295,9 +346,15 @@ #define DRAW_SETPIXELXY2_BLEND_RGB(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_RGB) +#define DRAW_SETPIXELXY2_BLEND_CLAMPED_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_BLEND_CLAMPED_RGB) + #define DRAW_SETPIXELXY4_BLEND_RGB(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGB) +#define DRAW_SETPIXELXY4_BLEND_CLAMPED_RGB(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_CLAMPED_RGB) + #define DRAW_SETPIXELXY2_ADD_RGB(x, y) \ DRAW_SETPIXELXY(x, y, Uint16, 2, DRAW_SETPIXEL_ADD_RGB) @@ -327,6 +384,10 @@ DRAW_SETPIXEL_BLEND(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) +#define DRAW_SETPIXEL_BLEND_CLAMPED_RGBA \ + DRAW_SETPIXEL_BLEND_CLAMPED(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ + PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) + #define DRAW_SETPIXEL_ADD_RGBA \ DRAW_SETPIXEL_ADD(RGBA_FROM_PIXEL(*pixel, fmt, sr, sg, sb, sa), \ PIXEL_FROM_RGBA(*pixel, fmt, sr, sg, sb, sa)) @@ -345,6 +406,9 @@ #define DRAW_SETPIXELXY4_BLEND_RGBA(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_RGBA) +#define DRAW_SETPIXELXY4_BLEND_CLAMPED_RGBA(x, y) \ + DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_BLEND_CLAMPED_RGBA) + #define DRAW_SETPIXELXY4_ADD_RGBA(x, y) \ DRAW_SETPIXELXY(x, y, Uint32, 4, DRAW_SETPIXEL_ADD_RGBA) diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 545f85b4ba9f6..6907a281c167d 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -1400,7 +1400,7 @@ int SDL_RLESurface(SDL_Surface *surface) /* Pass on combinations not supported */ if ((flags & SDL_COPY_MODULATE_COLOR) || ((flags & SDL_COPY_MODULATE_ALPHA) && SDL_ISPIXELFORMAT_ALPHA(surface->format)) || - (flags & (SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) || + (flags & (SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) || (flags & SDL_COPY_NEAREST)) { return -1; } diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index 9ab76a1541bbe..ce543e2ee07d3 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -125,7 +125,7 @@ static SDL_bool SDL_UseAltivecPrefetch(void) static SDL_BlitFunc SDL_ChooseBlitFunc(SDL_PixelFormat src_format, SDL_PixelFormat dst_format, int flags, SDL_BlitFuncEntry *entries) { - int i, flagcheck = (flags & (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_COLORKEY | SDL_COPY_NEAREST)); + int i, flagcheck = (flags & (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_COLORKEY | SDL_COPY_NEAREST)); static unsigned int features = 0x7fffffff; /* Get the available CPU features */ diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 0197ca392f9cb..18ceb39d11cc3 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -28,18 +28,20 @@ extern const Uint8 *SDL_expand_byte[9]; extern const Uint16 SDL_expand_byte_10[]; /* SDL blit copy flags */ -#define SDL_COPY_MODULATE_COLOR 0x00000001 -#define SDL_COPY_MODULATE_ALPHA 0x00000002 -#define SDL_COPY_BLEND 0x00000010 -#define SDL_COPY_ADD 0x00000020 -#define SDL_COPY_MOD 0x00000040 -#define SDL_COPY_MUL 0x00000080 -#define SDL_COPY_COLORKEY 0x00000100 -#define SDL_COPY_NEAREST 0x00000200 -#define SDL_COPY_RLE_DESIRED 0x00001000 -#define SDL_COPY_RLE_COLORKEY 0x00002000 -#define SDL_COPY_RLE_ALPHAKEY 0x00004000 -#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY) +#define SDL_COPY_MODULATE_COLOR 0x00000001 +#define SDL_COPY_MODULATE_ALPHA 0x00000002 +#define SDL_COPY_BLEND 0x00000010 +#define SDL_COPY_BLEND_PREMULTIPLIED 0x00000020 +#define SDL_COPY_ADD 0x00000040 +#define SDL_COPY_ADD_PREMULTIPLIED 0x00000080 +#define SDL_COPY_MOD 0x00000100 +#define SDL_COPY_MUL 0x00000200 +#define SDL_COPY_COLORKEY 0x00000400 +#define SDL_COPY_NEAREST 0x00000800 +#define SDL_COPY_RLE_DESIRED 0x00001000 +#define SDL_COPY_RLE_COLORKEY 0x00002000 +#define SDL_COPY_RLE_ALPHAKEY 0x00004000 +#define SDL_COPY_RLE_MASK (SDL_COPY_RLE_DESIRED | SDL_COPY_RLE_COLORKEY | SDL_COPY_RLE_ALPHAKEY) /* SDL blit CPU flags */ #define SDL_CPU_ANY 0x00000000 diff --git a/src/video/SDL_blit_auto.c b/src/video/SDL_blit_auto.c index e3c50e0efe2ba..9b45dda5b01b8 100644 --- a/src/video/SDL_blit_auto.c +++ b/src/video/SDL_blit_auto.c @@ -75,13 +75,19 @@ static void SDL_Blit_XRGB8888_XRGB8888_Blend(SDL_BlitInfo *info) srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -136,13 +142,19 @@ static void SDL_Blit_XRGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -270,14 +282,13 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -286,7 +297,19 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -297,15 +320,19 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -358,14 +385,13 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -374,7 +400,19 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -385,15 +423,19 @@ static void SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -457,13 +499,19 @@ static void SDL_Blit_XRGB8888_XBGR8888_Blend(SDL_BlitInfo *info) srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -518,13 +566,19 @@ static void SDL_Blit_XRGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -652,14 +706,13 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -668,7 +721,19 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -679,15 +744,19 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -740,14 +809,13 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -756,7 +824,19 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -767,15 +847,19 @@ static void SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -838,14 +922,21 @@ static void SDL_Blit_XRGB8888_ARGB8888_Blend(SDL_BlitInfo *info) srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; dstA = 0xFF; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -900,14 +991,21 @@ static void SDL_Blit_XRGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; dstA = 0xFF; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1039,14 +1137,13 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -1057,7 +1154,22 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1068,15 +1180,19 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1129,14 +1245,13 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -1147,7 +1262,22 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1158,15 +1288,19 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -1179,9 +1313,10 @@ static void SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; + const Uint32 A = 0xFF; Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; @@ -1202,8 +1337,8 @@ static void SDL_Blit_XBGR8888_XRGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; - pixel = (R << 16) | (G << 8) | B; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -1213,13 +1348,13 @@ static void SDL_Blit_XBGR8888_XRGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -1227,16 +1362,24 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1252,7 +1395,7 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -1262,13 +1405,13 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -1288,16 +1431,24 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1313,7 +1464,7 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -1323,13 +1474,15 @@ static void SDL_Blit_XBGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; + const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; Uint32 R, G, B; while (info->dst_h--) { @@ -1338,13 +1491,13 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -1354,13 +1507,15 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; + const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; @@ -1381,13 +1536,13 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -1397,7 +1552,7 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -1408,7 +1563,7 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; Uint32 srcR, srcG, srcB; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -1416,23 +1571,22 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -1440,8 +1594,25 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1452,18 +1623,22 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -1473,7 +1648,7 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XRGB8888_ABGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -1484,7 +1659,7 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; Uint32 srcR, srcG, srcB; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -1504,23 +1679,22 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -1528,8 +1702,25 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1540,18 +1731,22 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -1561,8 +1756,10 @@ static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XBGR8888_XRGB8888_Scale(SDL_BlitInfo *info) { + Uint32 pixel; + Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -1581,7 +1778,10 @@ static void SDL_Blit_XBGR8888_XBGR8888_Scale(SDL_BlitInfo *info) while (n--) { srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); - *dst = *src; + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + pixel = (R << 16) | (G << 8) | B; + *dst = pixel; posx += incx; ++dst; } @@ -1590,7 +1790,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_XBGR8888_XRGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -1606,14 +1806,20 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1629,7 +1835,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -1639,7 +1845,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XBGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -1667,14 +1873,20 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: dstR = srcR; dstG = srcG; dstB = srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1690,7 +1902,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -1700,7 +1912,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_XBGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -1721,7 +1933,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; ++src; ++dst; @@ -1731,7 +1943,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -1764,7 +1976,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -1774,7 +1986,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -1795,21 +2007,20 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); MULT_DIV_255(srcB, modulateB, srcB); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -1818,29 +2029,2802 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; - case SDL_COPY_ADD: - dstR = srcR + dstR; if (dstR > 255) dstR = 255; - dstG = srcG + dstG; if (dstG > 255) dstG = 255; - dstB = srcB + dstB; if (dstB > 255) dstB = 255; - break; - case SDL_COPY_MOD: - MULT_DIV_255(srcR, dstR, dstR); - MULT_DIV_255(srcG, dstG, dstG); + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Scale(SDL_BlitInfo *info) +{ + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + *dst = *src; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + Uint32 pixel; + Uint32 R, G, B; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (B << 16) | (G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + Uint32 pixel; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (B << 16) | (G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + const Uint32 A = 0xFF; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + pixel = (A << 24) | (R << 16) | (G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + } + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + } + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 R, G, B; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + const Uint32 A = 0xFF; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + pixel |= (A << 24); + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + } + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR; + dstG = srcG; + dstB = srcB; + dstA = 0xFF; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + } + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 R, G, B; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_XBGR8888_ABGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; + Uint32 srcR, srcG, srcB; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + pixel &= 0xFFFFFF; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + Uint32 pixel; + Uint32 R, G, B; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (R << 16) | (G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + Uint32 pixel; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (R << 16) | (G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Scale(SDL_BlitInfo *info) +{ + Uint32 pixel; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + pixel = (B << 16) | (G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + Uint32 pixel; + Uint32 R, G, B; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (B << 16) | (G << 8) | R; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + Uint32 pixel; + Uint32 R, G, B; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + pixel = (B << 16) | (G << 8) | R; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstB << 16) | (dstG << 8) | dstR; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info) +{ + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + *dst = *src; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); + MULT_DIV_255(srcB, dstB, dstB); + break; + case SDL_COPY_MUL: + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } + break; + } + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + *dst = dstpixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; + *dst = pixel; + ++src; + ++dst; + } + info->src += info->src_pitch; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 pixel; + Uint32 R, G, B, A; + Uint64 srcy, srcx; + Uint64 posy, posx; + Uint64 incy, incx; + + incy = ((Uint64)info->src_h << 16) / info->dst_h; + incx = ((Uint64)info->src_w << 16) / info->dst_w; + posy = incy / 2; + + while (info->dst_h--) { + Uint32 *src = 0; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + posx = incx / 2; + + srcy = posy >> 16; + while (n--) { + srcx = posx >> 16; + src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); + pixel = *src; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(R, modulateR, R); + MULT_DIV_255(G, modulateG, G); + MULT_DIV_255(B, modulateB, B); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; + *dst = pixel; + posx += incx; + ++dst; + } + posy += incy; + info->dst += info->dst_pitch; + } +} + +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +{ + const int flags = info->flags; + const Uint32 modulateR = info->r; + const Uint32 modulateG = info->g; + const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (info->dst_h--) { + Uint32 *src = (Uint32 *)info->src; + Uint32 *dst = (Uint32 *)info->dst; + int n = info->dst_w; + while (n--) { + srcpixel = *src; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + dstpixel = *dst; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & SDL_COPY_MODULATE_COLOR) { + MULT_DIV_255(srcR, modulateR, srcR); + MULT_DIV_255(srcG, modulateG, srcG); + MULT_DIV_255(srcB, modulateB, srcB); + } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { + case SDL_COPY_BLEND: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; + case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: + dstR = srcR + dstR; if (dstR > 255) dstR = 255; + dstG = srcG + dstG; if (dstG > 255) dstG = 255; + dstB = srcB + dstB; if (dstB > 255) dstB = 255; + break; + case SDL_COPY_MOD: + MULT_DIV_255(srcR, dstR, dstR); + MULT_DIV_255(srcG, dstG, dstG); MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -1850,7 +4834,7 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -1858,10 +4842,9 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; const Uint32 modulateA = info->a; Uint32 srcpixel; - const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; - Uint32 srcR, srcG, srcB; + Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -1881,23 +4864,25 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); MULT_DIV_255(srcB, modulateB, srcB); } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -1905,8 +4890,25 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -1917,18 +4919,22 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -1938,11 +4944,10 @@ static void SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - const Uint32 A = 0xFF; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -1962,8 +4967,8 @@ static void SDL_Blit_XBGR8888_ARGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; - pixel = (A << 24) | (R << 16) | (G << 8) | B; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -1973,11 +4978,11 @@ static void SDL_Blit_XBGR8888_ARGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; - Uint32 srcR, srcG, srcB; + Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; @@ -1987,17 +4992,43 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR; - dstG = srcG; - dstB = srcB; - dstA = 0xFF; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2008,12 +5039,22 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(srcR, dstR, dstR); - MULT_DIV_255(srcG, dstG, dstG); - MULT_DIV_255(srcB, dstB, dstB); + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -2023,11 +5064,11 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; - Uint32 srcR, srcG, srcB; + Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; @@ -2049,17 +5090,43 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { + if (srcA < 255) { + MULT_DIV_255(srcR, srcA, srcR); + MULT_DIV_255(srcG, srcA, srcG); + MULT_DIV_255(srcB, srcA, srcB); + } + } + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: - dstR = srcR; - dstG = srcG; - dstB = srcB; - dstA = 0xFF; + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2070,12 +5137,22 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(srcR, dstR, dstR); - MULT_DIV_255(srcG, dstG, dstG); - MULT_DIV_255(srcB, dstB, dstB); + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -2085,7 +5162,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2093,8 +5170,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) const Uint32 modulateB = info->b; const Uint32 modulateA = info->a; Uint32 pixel; - const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; - Uint32 R, G, B; + Uint32 R, G, B, A; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -2102,13 +5178,16 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -2118,7 +5197,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2126,8 +5205,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; const Uint32 modulateA = info->a; Uint32 pixel; - const Uint32 A = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -2147,13 +5225,16 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -2163,7 +5244,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2171,8 +5252,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) const Uint32 modulateB = info->b; const Uint32 modulateA = info->a; Uint32 srcpixel; - const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; - Uint32 srcR, srcG, srcB; + Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; @@ -2182,23 +5262,25 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); MULT_DIV_255(srcB, modulateB, srcB); } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2209,7 +5291,22 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2220,18 +5317,22 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -2241,7 +5342,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ARGB8888_ABGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2249,8 +5350,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) const Uint32 modulateB = info->b; const Uint32 modulateA = info->a; Uint32 srcpixel; - const Uint32 srcA = (flags & SDL_COPY_MODULATE_ALPHA) ? modulateA : 0xFF; - Uint32 srcR, srcG, srcB; + Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; @@ -2272,23 +5372,25 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; + srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); MULT_DIV_255(srcB, modulateB, srcB); } + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(srcA, modulateA, srcA); + } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2299,7 +5401,22 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2310,18 +5427,22 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -2331,7 +5452,7 @@ static void SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint64 srcy, srcx; @@ -2353,7 +5474,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - pixel &= 0xFFFFFF; + pixel >>= 8; *dst = pixel; posx += incx; ++dst; @@ -2363,7 +5484,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -2377,18 +5498,17 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2397,7 +5517,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2408,15 +5540,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2429,7 +5565,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -2455,18 +5591,17 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2475,7 +5610,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2486,15 +5633,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2507,7 +5658,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2522,7 +5673,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); @@ -2538,7 +5689,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2565,7 +5716,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); @@ -2581,7 +5732,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2599,7 +5750,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { @@ -2611,14 +5762,13 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2627,7 +5777,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2638,15 +5800,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2659,7 +5825,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2689,7 +5855,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { @@ -2701,14 +5867,13 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2717,7 +5882,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2728,15 +5905,19 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstR << 16) | (dstG << 8) | dstB; @@ -2749,7 +5930,7 @@ static void SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; @@ -2772,7 +5953,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); pixel = (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; @@ -2783,7 +5964,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -2797,18 +5978,17 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2817,7 +5997,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2828,15 +6020,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -2849,7 +6045,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -2875,18 +6071,17 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -2895,7 +6090,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -2906,15 +6113,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -2927,7 +6138,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2942,7 +6153,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); @@ -2958,7 +6169,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -2985,7 +6196,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); @@ -3001,7 +6212,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3019,7 +6230,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { @@ -3031,14 +6242,13 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3047,7 +6257,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3058,15 +6280,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -3079,7 +6305,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3109,7 +6335,7 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { @@ -3121,14 +6347,13 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3137,7 +6362,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3148,15 +6385,19 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstB << 16) | (dstG << 8) | dstR; @@ -3169,8 +6410,9 @@ static void SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info) { + Uint32 pixel; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -3189,7 +6431,9 @@ static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info) while (n--) { srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); - *dst = *src; + pixel = *src; + pixel = (pixel >> 8) | (pixel << 24); + *dst = pixel; posx += incx; ++dst; } @@ -3198,7 +6442,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -3212,18 +6456,17 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3234,7 +6477,22 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3245,15 +6503,19 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3266,7 +6528,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -3292,18 +6554,17 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3314,7 +6575,22 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3325,15 +6601,19 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3346,7 +6626,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3362,7 +6642,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); @@ -3381,7 +6661,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3409,7 +6689,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = (Uint8)(pixel >> 24); + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); @@ -3428,7 +6708,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3446,7 +6726,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { @@ -3458,14 +6738,13 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3476,7 +6755,22 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3487,15 +6781,19 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3508,7 +6806,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3538,7 +6836,7 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { @@ -3550,14 +6848,13 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3568,7 +6865,22 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3579,15 +6891,19 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; @@ -3600,9 +6916,10 @@ static void SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -3622,7 +6939,8 @@ static void SDL_Blit_RGBA8888_XRGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - pixel >>= 8; + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -3632,13 +6950,13 @@ static void SDL_Blit_RGBA8888_XRGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -3648,16 +6966,15 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3665,8 +6982,25 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3677,18 +7011,22 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -3698,13 +7036,13 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -3726,16 +7064,15 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3743,8 +7080,25 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3755,18 +7109,22 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -3776,14 +7134,15 @@ static void SDL_Blit_RGBA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -3791,13 +7150,16 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -3807,14 +7169,15 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -3834,13 +7197,16 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); + R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -3850,7 +7216,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3860,7 +7226,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -3870,7 +7236,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -3880,14 +7246,13 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3895,8 +7260,25 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3907,18 +7289,22 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -3928,7 +7314,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_RGBA8888_ABGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -3938,7 +7324,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -3960,7 +7346,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -3970,14 +7356,13 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -3985,8 +7370,25 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -3997,18 +7399,22 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -4018,7 +7424,7 @@ static void SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint32 R, G, B; @@ -4041,8 +7447,8 @@ static void SDL_Blit_RGBA8888_XBGR8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); - pixel = (B << 16) | (G << 8) | R; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -4052,7 +7458,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -4066,18 +7472,17 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4086,7 +7491,19 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4097,18 +7514,22 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -4118,7 +7539,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -4144,18 +7565,17 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4164,7 +7584,19 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4175,18 +7607,22 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -4196,7 +7632,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -4211,13 +7647,13 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; ++src; ++dst; @@ -4227,7 +7663,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -4254,13 +7690,13 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -4270,7 +7706,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -4288,9 +7724,9 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -4300,14 +7736,13 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4316,7 +7751,19 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4327,18 +7774,22 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -4348,7 +7799,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -4378,9 +7829,9 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -4390,14 +7841,13 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4406,7 +7856,19 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4417,18 +7879,22 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -4438,7 +7904,7 @@ static void SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; Uint64 srcy, srcx; @@ -4460,7 +7926,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - pixel = (pixel >> 8) | (pixel << 24); + pixel &= 0xFFFFFF; *dst = pixel; posx += incx; ++dst; @@ -4470,13 +7936,13 @@ static void SDL_Blit_RGBA8888_ARGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -4484,18 +7950,17 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4503,10 +7968,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4517,18 +7992,22 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -4538,13 +8017,13 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -4564,18 +8043,17 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4583,10 +8061,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4597,18 +8085,22 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -4618,15 +8110,14 @@ static void SDL_Blit_RGBA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; - const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B, A; + Uint32 R, G, B; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -4634,16 +8125,13 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - if (flags & SDL_COPY_MODULATE_ALPHA) { - MULT_DIV_255(A, modulateA, A); - } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -4653,15 +8141,14 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; - const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B, A; + Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -4681,16 +8168,13 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - R = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); B = (Uint8)(pixel >> 8); A = (Uint8)pixel; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - if (flags & SDL_COPY_MODULATE_ALPHA) { - MULT_DIV_255(A, modulateA, A); - } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -4700,7 +8184,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -4710,7 +8194,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -4718,9 +8202,9 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -4730,14 +8214,13 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4745,10 +8228,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4759,18 +8252,22 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -4780,7 +8277,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -4790,7 +8287,7 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -4810,9 +8307,9 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcR = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcB = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; + srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -4822,14 +8319,13 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4837,10 +8333,20 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4851,18 +8357,22 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -4872,10 +8382,10 @@ static void SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -4895,8 +8405,8 @@ static void SDL_Blit_ABGR8888_XRGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; - pixel = (R << 16) | (G << 8) | B; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); + pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -4906,13 +8416,13 @@ static void SDL_Blit_ABGR8888_XRGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -4922,16 +8432,15 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -4939,8 +8448,25 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -4951,18 +8477,22 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -4972,13 +8502,13 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5000,16 +8530,15 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5017,8 +8546,25 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5029,18 +8575,22 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -5050,14 +8600,15 @@ static void SDL_Blit_ABGR8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5065,13 +8616,16 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; ++src; ++dst; @@ -5081,14 +8635,15 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5108,13 +8663,16 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -5124,7 +8682,7 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -5134,7 +8692,7 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5144,7 +8702,7 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -5154,14 +8712,13 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5169,8 +8726,25 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5181,18 +8755,22 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -5202,7 +8780,7 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -5212,7 +8790,7 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5234,7 +8812,7 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -5244,14 +8822,13 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5259,8 +8836,25 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5271,18 +8865,22 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -5292,9 +8890,8 @@ static void SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Scale(SDL_BlitInfo *info) { - Uint32 pixel; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5313,9 +8910,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Scale(SDL_BlitInfo *info) while (n--) { srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); - pixel = *src; - pixel &= 0xFFFFFF; - *dst = pixel; + *dst = *src; posx += incx; ++dst; } @@ -5324,13 +8919,13 @@ static void SDL_Blit_ABGR8888_XBGR8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5340,16 +8935,15 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5357,8 +8951,25 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5369,18 +8980,22 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -5390,13 +9005,13 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5418,16 +9033,15 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5435,8 +9049,25 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5447,18 +9078,22 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -5468,14 +9103,15 @@ static void SDL_Blit_ABGR8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5483,13 +9119,16 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -5499,14 +9138,15 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5526,13 +9166,16 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; + B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -5542,7 +9185,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -5552,7 +9195,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5562,7 +9205,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -5572,14 +9215,13 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5587,8 +9229,25 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5599,18 +9258,22 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -5620,7 +9283,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_ABGR8888_ABGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -5630,7 +9293,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5652,7 +9315,7 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -5662,14 +9325,13 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5677,8 +9339,25 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5689,18 +9368,22 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -5710,10 +9393,10 @@ static void SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - Uint32 R, G, B, A; + Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5733,8 +9416,8 @@ static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); - pixel = (A << 24) | (R << 16) | (G << 8) | B; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); + pixel = (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -5744,13 +9427,13 @@ static void SDL_Blit_ABGR8888_ARGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5758,18 +9441,17 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5777,10 +9459,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5791,18 +9483,22 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -5812,13 +9508,13 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5838,18 +9534,17 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -5857,10 +9552,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -5871,18 +9576,22 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -5892,15 +9601,14 @@ static void SDL_Blit_ABGR8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; - const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B, A; + Uint32 R, G, B; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5908,16 +9616,13 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - if (flags & SDL_COPY_MODULATE_ALPHA) { - MULT_DIV_255(A, modulateA, A); - } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; ++src; ++dst; @@ -5927,15 +9632,14 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; - const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B, A; + Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -5955,16 +9659,13 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); R = (Uint8)pixel; A = (Uint8)(pixel >> 24); + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - if (flags & SDL_COPY_MODULATE_ALPHA) { - MULT_DIV_255(A, modulateA, A); - } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -5974,7 +9675,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -5984,7 +9685,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -5992,9 +9693,9 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -6004,14 +9705,13 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6019,10 +9719,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6033,18 +9743,22 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -6054,7 +9768,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6064,7 +9778,7 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB, dstA; + Uint32 dstR, dstG, dstB; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -6084,9 +9798,9 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); srcpixel = *src; - srcB = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcR = (Uint8)srcpixel; srcA = (Uint8)(srcpixel >> 24); + srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -6096,14 +9810,13 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6111,10 +9824,20 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; - MULT_DIV_255((255 - srcA), dstA, dstA); - dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6125,18 +9848,22 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -6146,10 +9873,9 @@ static void SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - Uint32 R, G, B; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -6169,8 +9895,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); - pixel = (R << 16) | (G << 8) | B; + pixel >>= 8; *dst = pixel; posx += incx; ++dst; @@ -6180,7 +9905,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -6196,16 +9921,15 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6214,7 +9938,19 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6225,18 +9961,22 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -6246,7 +9986,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -6274,16 +10014,15 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6292,7 +10031,19 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6303,18 +10054,22 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -6324,7 +10079,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6345,7 +10100,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate(SDL_BlitInfo *info) MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + pixel = (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -6355,7 +10110,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6388,7 +10143,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (R << 16) | (G << 8) | B; + pixel = (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -6398,7 +10153,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6418,7 +10173,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -6428,14 +10183,13 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6444,7 +10198,19 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6455,18 +10221,22 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -6476,7 +10246,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6508,7 +10278,7 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -6518,14 +10288,13 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6534,7 +10303,19 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6545,18 +10326,22 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -6566,9 +10351,10 @@ static void SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -6588,7 +10374,8 @@ static void SDL_Blit_BGRA8888_XBGR8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - pixel >>= 8; + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; + pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -6598,13 +10385,13 @@ static void SDL_Blit_BGRA8888_XBGR8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -6614,16 +10401,15 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6631,8 +10417,25 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6643,18 +10446,22 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -6664,13 +10471,13 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -6692,16 +10499,15 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6709,8 +10515,25 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6721,18 +10544,22 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -6742,14 +10569,15 @@ static void SDL_Blit_BGRA8888_XBGR8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -6757,13 +10585,16 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate(SDL_BlitInfo *info) int n = info->dst_w; while (n--) { pixel = *src; - B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; ++src; ++dst; @@ -6773,14 +10604,15 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; const Uint32 modulateG = info->g; const Uint32 modulateB = info->b; + const Uint32 modulateA = info->a; Uint32 pixel; - Uint32 R, G, B; + Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -6800,13 +10632,16 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); + B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(R, modulateR, R); MULT_DIV_255(G, modulateG, G); MULT_DIV_255(B, modulateB, B); } - pixel = (B << 16) | (G << 8) | R; + if (flags & SDL_COPY_MODULATE_ALPHA) { + MULT_DIV_255(A, modulateA, A); + } + pixel = (A << 24) | (R << 16) | (G << 8) | B; *dst = pixel; posx += incx; ++dst; @@ -6816,7 +10651,7 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6826,7 +10661,7 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; while (info->dst_h--) { Uint32 *src = (Uint32 *)info->src; @@ -6836,7 +10671,7 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -6846,14 +10681,13 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6861,8 +10695,25 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6873,18 +10724,22 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; ++src; ++dst; @@ -6894,7 +10749,7 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -6904,7 +10759,7 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) Uint32 srcpixel; Uint32 srcR, srcG, srcB, srcA; Uint32 dstpixel; - Uint32 dstR, dstG, dstB; + Uint32 dstR, dstG, dstB, dstA; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -6926,7 +10781,7 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; + dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -6936,14 +10791,13 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -6951,8 +10805,25 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) dstG += srcG; MULT_DIV_255((255 - srcA), dstB, dstB); dstB += srcB; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -6963,18 +10834,22 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstB << 16) | (dstG << 8) | dstR; + dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; *dst = dstpixel; posx += incx; ++dst; @@ -6984,10 +10859,9 @@ static void SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Scale(SDL_BlitInfo *info) { Uint32 pixel; - Uint32 R, G, B, A; Uint64 srcy, srcx; Uint64 posy, posx; Uint64 incy, incx; @@ -7007,8 +10881,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info) srcx = posx >> 16; src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4)); pixel = *src; - B = (Uint8)(pixel >> 24); G = (Uint8)(pixel >> 16); R = (Uint8)(pixel >> 8); A = (Uint8)pixel; - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (pixel >> 8) | (pixel << 24); *dst = pixel; posx += incx; ++dst; @@ -7018,7 +10891,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Blend(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -7034,16 +10907,15 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -7054,7 +10926,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -7065,18 +10952,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -7086,7 +10977,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; Uint32 srcpixel; @@ -7114,16 +11005,15 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -7134,7 +11024,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -7145,18 +11050,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -7166,7 +11075,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Blend_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Modulate(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -7191,7 +11100,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info) if (flags & SDL_COPY_MODULATE_ALPHA) { MULT_DIV_255(A, modulateA, A); } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; ++src; ++dst; @@ -7201,7 +11110,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Modulate_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -7238,7 +11147,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) if (flags & SDL_COPY_MODULATE_ALPHA) { MULT_DIV_255(A, modulateA, A); } - pixel = (A << 24) | (R << 16) | (G << 8) | B; + pixel = (A << 24) | (B << 16) | (G << 8) | R; *dst = pixel; posx += incx; ++dst; @@ -7248,7 +11157,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Modulate_Blend(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -7268,7 +11177,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -7278,14 +11187,13 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -7296,7 +11204,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -7307,18 +11230,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; ++src; ++dst; @@ -7328,7 +11255,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend(SDL_BlitInfo *info) } } -static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) +static void SDL_Blit_BGRA8888_ABGR8888_Modulate_Blend_Scale(SDL_BlitInfo *info) { const int flags = info->flags; const Uint32 modulateR = info->r; @@ -7360,7 +11287,7 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) srcpixel = *src; srcB = (Uint8)(srcpixel >> 24); srcG = (Uint8)(srcpixel >> 16); srcR = (Uint8)(srcpixel >> 8); srcA = (Uint8)srcpixel; dstpixel = *dst; - dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); + dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = (Uint8)(dstpixel >> 24); if (flags & SDL_COPY_MODULATE_COLOR) { MULT_DIV_255(srcR, modulateR, srcR); MULT_DIV_255(srcG, modulateG, srcG); @@ -7370,14 +11297,13 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcA, modulateA, srcA); } if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { MULT_DIV_255(srcR, srcA, srcR); MULT_DIV_255(srcG, srcA, srcG); MULT_DIV_255(srcB, srcA, srcB); } } - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: MULT_DIV_255((255 - srcA), dstR, dstR); dstR += srcR; @@ -7388,7 +11314,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255((255 - srcA), dstA, dstA); dstA += srcA; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + MULT_DIV_255((255 - srcA), dstR, dstR); + dstR += srcR; + if (dstR > 255) dstR = 255; + MULT_DIV_255((255 - srcA), dstG, dstG); + dstG += srcG; + if (dstG > 255) dstG = 255; + MULT_DIV_255((255 - srcA), dstB, dstB); + dstB += srcB; + if (dstB > 255) dstB = 255; + MULT_DIV_255((255 - srcA), dstA, dstA); + dstA += srcA; + if (dstA > 255) dstA = 255; + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) dstR = 255; dstG = srcG + dstG; if (dstG > 255) dstG = 255; dstB = srcB + dstB; if (dstB > 255) dstB = 255; @@ -7399,18 +11340,22 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) MULT_DIV_255(srcB, dstB, dstB); break; case SDL_COPY_MUL: - MULT_DIV_255(dstR, (255 - srcA), dstR); - dstR += (srcR * dstR); - if (dstR > 255) dstR = 255; - MULT_DIV_255(dstB, (255 - srcA), dstB); - dstB += (srcB * dstB); - if (dstB > 255) dstB = 255; - MULT_DIV_255(dstG, (255 - srcA), dstG); - dstG += (srcG * dstG); - if (dstG > 255) dstG = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(srcR, dstR, tmp1); + MULT_DIV_255(dstR, (255 - srcA), tmp2); + dstR = tmp1 + tmp2; if (dstR > 255) dstR = 255; + MULT_DIV_255(srcG, dstG, tmp1); + MULT_DIV_255(dstG, (255 - srcA), tmp2); + dstG = tmp1 + tmp2; if (dstG > 255) dstG = 255; + MULT_DIV_255(srcB, dstB, tmp1); + MULT_DIV_255(dstB, (255 - srcA), tmp2); + dstB = tmp1 + tmp2; if (dstB > 255) dstB = 255; + } break; } - dstpixel = (dstA << 24) | (dstR << 16) | (dstG << 8) | dstB; + dstpixel = (dstA << 24) | (dstB << 16) | (dstG << 8) | dstR; *dst = dstpixel; posx += incx; ++dst; @@ -7422,131 +11367,173 @@ static void SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale(SDL_BlitInfo *info) SDL_BlitFuncEntry SDL_GeneratedBlitFuncTable[] = { { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Scale }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Blend }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Blend_Scale }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Modulate }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XRGB8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Scale }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Blend }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Blend_Scale }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Modulate }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Modulate_Scale }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_XBGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Scale }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Blend }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Blend_Scale }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Modulate }, { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Modulate }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Modulate_Scale }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XRGB8888_ABGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Scale }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Blend }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Blend_Scale }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Modulate }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XRGB8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Scale }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Blend }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Blend_Scale }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Modulate }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Modulate_Scale }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_XBGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Scale }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Blend }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Blend_Scale }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Modulate }, { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Modulate }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Modulate_Scale }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_XBGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_XBGR8888_ABGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Scale }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Blend }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Blend_Scale }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Modulate }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XRGB8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Scale }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Blend }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Blend_Scale }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Modulate }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Modulate_Scale }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_XBGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Scale }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Blend_Scale }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate }, { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Modulate }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Modulate_Scale }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ARGB8888_ABGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Scale }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Blend }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Blend_Scale }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Modulate }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XRGB8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Scale }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Blend }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Blend_Scale }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Modulate }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Modulate_Scale }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_XBGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Scale }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Blend_Scale }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate }, { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Modulate }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Modulate_Scale }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_RGBA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_RGBA8888_ABGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Scale }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Blend }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Blend_Scale }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Modulate }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XRGB8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Scale }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Blend }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Blend_Scale }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Modulate }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Modulate_Scale }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_XBGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Scale }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Blend_Scale }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate }, { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Modulate }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Modulate_Scale }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_ABGR8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_ABGR8888_ABGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Scale }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Blend }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Blend_Scale }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Modulate }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XRGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XRGB8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Scale }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Blend }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Blend_Scale }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Modulate }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Modulate_Scale }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_XBGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_XBGR8888_Modulate_Blend_Scale }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Scale }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Blend_Scale }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate }, { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Scale }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend }, - { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ARGB8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ARGB8888_Modulate_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Blend_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Modulate }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Modulate_Scale }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Modulate_Blend }, + { SDL_PIXELFORMAT_BGRA8888, SDL_PIXELFORMAT_ABGR8888, (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_NEAREST), SDL_CPU_ANY, SDL_Blit_BGRA8888_ABGR8888_Modulate_Blend_Scale }, { 0, 0, 0, 0, NULL } }; diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c index 7bdb090dc60a1..db675d5421640 100644 --- a/src/video/SDL_blit_slow.c +++ b/src/video/SDL_blit_slow.c @@ -134,7 +134,7 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) continue; } } - if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) { + if ((flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL))) { switch (dst_access) { case SlowBlitPixelAccess_RGB: DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB); @@ -181,14 +181,13 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) srcA = (srcA * modulateA) / 255; } if (flags & (SDL_COPY_BLEND | SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 255) { srcR = (srcR * srcA) / 255; srcG = (srcG * srcA) / 255; srcB = (srcB * srcA) / 255; } } - switch (flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case 0: dstR = srcR; dstG = srcG; @@ -201,7 +200,26 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) dstB = srcB + ((255 - srcA) * dstB) / 255; dstA = srcA + ((255 - srcA) * dstA) / 255; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + dstR = srcR + ((255 - srcA) * dstR) / 255; + if (dstR > 255) { + dstR = 255; + } + dstG = srcG + ((255 - srcA) * dstG) / 255; + if (dstG > 255) { + dstG = 255; + } + dstB = srcB + ((255 - srcA) * dstB) / 255; + if (dstB > 255) { + dstB = 255; + } + dstA = srcA + ((255 - srcA) * dstA) / 255; + if (dstA > 255) { + dstA = 255; + } + break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: dstR = srcR + dstR; if (dstR > 255) { dstR = 255; @@ -869,7 +887,6 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) srcA = (srcA * modulateA) / 255; } if (flags & (SDL_COPY_BLEND | SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (srcA < 1.0f) { srcR = (srcR * srcA); srcG = (srcG * srcA); diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 1d8a0326ef8dd..3cc685c086dfb 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -708,16 +708,22 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) status = 0; flags = surface->internal->map.info.flags; - surface->internal->map.info.flags &= ~(SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL); + surface->internal->map.info.flags &= ~(SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL); switch (blendMode) { case SDL_BLENDMODE_NONE: break; case SDL_BLENDMODE_BLEND: surface->internal->map.info.flags |= SDL_COPY_BLEND; break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + surface->internal->map.info.flags |= SDL_COPY_BLEND_PREMULTIPLIED; + break; case SDL_BLENDMODE_ADD: surface->internal->map.info.flags |= SDL_COPY_ADD; break; + case SDL_BLENDMODE_ADD_PREMULTIPLIED: + surface->internal->map.info.flags |= SDL_COPY_ADD_PREMULTIPLIED; + break; case SDL_BLENDMODE_MOD: surface->internal->map.info.flags |= SDL_COPY_MOD; break; @@ -746,13 +752,19 @@ int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) return 0; } - switch (surface->internal->map.info.flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL)) { + switch (surface->internal->map.info.flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: *blendMode = SDL_BLENDMODE_BLEND; break; + case SDL_COPY_BLEND_PREMULTIPLIED: + *blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; + break; case SDL_COPY_ADD: *blendMode = SDL_BLENDMODE_ADD; break; + case SDL_COPY_ADD_PREMULTIPLIED: + *blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; + break; case SDL_COPY_MOD: *blendMode = SDL_BLENDMODE_MOD; break; @@ -1088,7 +1100,7 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_ScaleMode scaleMode) { static const Uint32 complex_copy_flags = (SDL_COPY_MODULATE_COLOR | SDL_COPY_MODULATE_ALPHA | - SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL | + SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL | SDL_COPY_COLORKEY); if (scaleMode != SDL_SCALEMODE_NEAREST && scaleMode != SDL_SCALEMODE_LINEAR && scaleMode != SDL_SCALEMODE_BEST) { diff --git a/src/video/sdlgenblit.pl b/src/video/sdlgenblit.pl index 001ec2fedd47a..a1c795ea8033d 100755 --- a/src/video/sdlgenblit.pl +++ b/src/video/sdlgenblit.pl @@ -38,6 +38,7 @@ "XRGB8888", "XBGR8888", "ARGB8888", + "ABGR8888", ); my %format_size = ( @@ -327,7 +328,6 @@ sub output_copycore if (!$A_is_const_FF) { print FILE <<__EOF__; if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) { - /* This goes away if we ever use premultiplied alpha */ if (${s}A < 255) { MULT_DIV_255(${s}R, ${s}A, ${s}R); MULT_DIV_255(${s}G, ${s}A, ${s}G); @@ -337,7 +337,7 @@ sub output_copycore __EOF__ } print FILE <<__EOF__; - switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD|SDL_COPY_MUL)) { + switch (flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: __EOF__ if ($A_is_const_FF) { @@ -369,9 +369,47 @@ sub output_copycore } } + print FILE <<__EOF__; + break; + case SDL_COPY_BLEND_PREMULTIPLIED: +__EOF__ + if ($A_is_const_FF) { + print FILE <<__EOF__; + ${d}R = ${s}R; + ${d}G = ${s}G; + ${d}B = ${s}B; +__EOF__ + } else { + print FILE <<__EOF__; + MULT_DIV_255((255 - ${s}A), ${d}R, ${d}R); + ${d}R += ${s}R; + if (${d}R > 255) ${d}R = 255; + MULT_DIV_255((255 - ${s}A), ${d}G, ${d}G); + ${d}G += ${s}G; + if (${d}G > 255) ${d}G = 255; + MULT_DIV_255((255 - ${s}A), ${d}B, ${d}B); + ${d}B += ${s}B; + if (${d}B > 255) ${d}B = 255; +__EOF__ + } + if ( $dst_has_alpha ) { + if ($A_is_const_FF) { + print FILE <<__EOF__; + ${d}A = 0xFF; +__EOF__ + } else { + print FILE <<__EOF__; + MULT_DIV_255((255 - ${s}A), ${d}A, ${d}A); + ${d}A += ${s}A; + if (${d}A > 255) ${d}A = 255; +__EOF__ + } + } + print FILE <<__EOF__; break; case SDL_COPY_ADD: + case SDL_COPY_ADD_PREMULTIPLIED: ${d}R = ${s}R + ${d}R; if (${d}R > 255) ${d}R = 255; ${d}G = ${s}G + ${d}G; if (${d}G > 255) ${d}G = 255; ${d}B = ${s}B + ${d}B; if (${d}B > 255) ${d}B = 255; @@ -391,15 +429,19 @@ sub output_copycore __EOF__ } else { print FILE <<__EOF__; - MULT_DIV_255(${d}R, (255 - ${s}A), ${d}R); - ${d}R += (${s}R * ${d}R); - if (${d}R > 255) ${d}R = 255; - MULT_DIV_255(${d}B, (255 - ${s}A), ${d}B); - ${d}B += (${s}B * ${d}B); - if (${d}B > 255) ${d}B = 255; - MULT_DIV_255(${d}G, (255 - ${s}A), ${d}G); - ${d}G += (${s}G * ${d}G); - if (${d}G > 255) ${d}G = 255; + { + Uint32 tmp1, tmp2; + + MULT_DIV_255(${s}R, ${d}R, tmp1); + MULT_DIV_255(${d}R, (255 - ${s}A), tmp2); + ${d}R = tmp1 + tmp2; if (${d}R > 255) ${d}R = 255; + MULT_DIV_255(${s}G, ${d}G, tmp1); + MULT_DIV_255(${d}G, (255 - ${s}A), tmp2); + ${d}G = tmp1 + tmp2; if (${d}G > 255) ${d}G = 255; + MULT_DIV_255(${s}B, ${d}B, tmp1); + MULT_DIV_255(${d}B, (255 - ${s}A), tmp2); + ${d}B = tmp1 + tmp2; if (${d}B > 255) ${d}B = 255; + } __EOF__ } @@ -624,7 +666,7 @@ sub output_copyfunctable } } if ( $blend ) { - $flag = "SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL"; + $flag = "SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL"; if ( $flags eq "" ) { $flags = $flag; } else { diff --git a/test/testautomation_images.c b/test/testautomation_images.c index 0ff7d21edd58d..478c319a306b7 100644 --- a/test/testautomation_images.c +++ b/test/testautomation_images.c @@ -1652,7 +1652,7 @@ SDL_Surface *SDLTest_ImageBlitAlpha(void) /* GIMP RGB C-Source image dump (alpha.c) */ -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { +static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { 80, 60, 3, @@ -1710,610 +1710,43 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240" + "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" + "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240" + "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" + "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" + "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240" + "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww" + "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305" + "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305" + "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305" + "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305" + "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd" "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" - "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" - "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" - "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" - "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" - "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" - "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" - "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" - "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" - "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" - "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" - "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" - "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" - "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" - "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240" + "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333" + "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333" + "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305" + "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305" + "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww" + "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0" + "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitBlendAdd test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendAdd(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendAdd.width, - SDLTest_imageBlitBlendAdd.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendAdd.pixel_data, - SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240" - "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" - "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240" - "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" - "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" - "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240" - "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww" - "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305" - "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305" - "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305" - "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305" - "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd" - "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240" - "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333" - "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333" - "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305" - "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305" - "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww" - "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0" - "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0" - "00\0PP" - "\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP" - "\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP" - "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0" + "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0" + "00\0PP" + "\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP" + "\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP\0PP\0PP\0" + "00\0PP" + "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0dd\0dd\0dd\0$$\0aa\0\305\305\0\305\305\0``\0\205\205\0\351\351\0" "\351\351\0||\0\222\222\0\321\321\0\321\321\0\177\177\0\225\225\0\324\324" @@ -2639,126 +2072,1678 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { "\0\375\375\0\375\375\0\347\347\0\367\367\0\373\373\0\373\373\0\326\326\0" "\351\351\0\361\361\0\361\361\0\271\271\0\276\276\0\305\305\0\305\305\0aa" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV" - "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253" - "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253" - "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253" - "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253" - "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235" - "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0" - "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305" - "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263" - "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365" - "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365" - "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb" - "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242" - "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee" - "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222" - "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240" - "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261" - "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246" - "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb" - "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242" - "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242" - "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh" - "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0" - "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``" - "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211" - "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0" - "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374" - "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374" - "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0" - "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365" - "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372" - "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0" - "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240" - "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366" - "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0" - "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375" - "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360" - "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0" - "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230" - "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373" - "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0" - "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240" - "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324" - "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0" - "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323" - "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354" - "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0" - "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223" - "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272" - "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0" - "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240" - "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333" - "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222" - "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0" - "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314" - "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305" - "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0" - "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312" - "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210" - "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333" - "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217" - "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0" - "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351" - "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351" - "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0" - "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345" - "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322" - "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd" - "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305" - "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364" - "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0" - "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364" - "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215" - "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0" - "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312" - "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305" - "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa" - "\0" - "11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264" - "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0" - "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264" - "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0" - "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0" - "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0" + "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV" + "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253" + "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253" + "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253" + "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253" + "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235" + "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0" + "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305" + "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263" + "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365" + "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365" + "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb" + "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242" + "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee" + "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222" + "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240" + "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261" + "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246" + "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb" + "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242" + "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242" + "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh" + "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0" + "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``" + "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211" + "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0" + "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374" + "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374" + "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0" + "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365" + "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372" + "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0" + "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240" + "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366" + "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0" + "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375" + "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360" + "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0" + "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230" + "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373" + "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0" + "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240" + "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324" + "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0" + "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323" + "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354" + "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0" + "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223" + "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272" + "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0" + "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240" + "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333" + "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222" + "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0" + "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314" + "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305" + "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0" + "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312" + "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210" + "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333" + "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217" + "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0" + "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351" + "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351" + "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0" + "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345" + "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322" + "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd" + "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305" + "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364" + "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0" + "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364" + "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215" + "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0" + "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312" + "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305" + "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa" + "\0" + "11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264" + "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0" + "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264" + "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0" + "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0" + "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" + "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0" + "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0" + "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0" + "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0" + "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd" + "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210" + "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210" + "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25" + "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210" + "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0" + "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" + "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" + "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240" + "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" + "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240" + "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * Returns the BlitBlend test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlend(void) +{ + SDL_Surface *surface = SDL_CreateSurfaceFrom( + SDLTest_imageBlitBlend.width, + SDLTest_imageBlitBlend.height, + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlend.pixel_data, + SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel); + return surface; +} + +static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendPremultiplied = { + 80, 60, 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the BlitBlendPremultiplied test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlendPremultiplied() +{ + SDL_Surface *surface = SDL_CreateSurfaceFrom( + SDLTest_imageBlitBlendPremultiplied.width, + SDLTest_imageBlitBlendPremultiplied.height, + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlendPremultiplied.pixel_data, + SDLTest_imageBlitBlendPremultiplied.width * SDLTest_imageBlitBlendPremultiplied.bytes_per_pixel); + return surface; +} + +static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" + "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" + "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" + "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" + "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" + "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" + "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" + "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" + "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" + "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" + "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" + "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" + "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" + "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" + "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * Returns the BlitBlendAdd test image as SDL_Surface. + */ +SDL_Surface *SDLTest_ImageBlitBlendAdd(void) +{ + SDL_Surface *surface = SDL_CreateSurfaceFrom( + SDLTest_imageBlitBlendAdd.width, + SDLTest_imageBlitBlendAdd.height, + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageBlitBlendAdd.pixel_data, + SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel); + return surface; +} + +static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAddPremultiplied = { + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" + "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" + "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" + "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0" - "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0" - "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0" - "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0" - "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" + "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" + "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" + "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" + "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" + "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" + "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" + "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" + "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" + "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" + "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" + "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" + "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" + "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" + "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" + "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" + "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd" - "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210" - "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210" - "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25" - "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210" - "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0" - "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" + "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" + "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" + "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" + "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" + "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" - "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" - "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240" - "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" - "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240" - "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" + "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" + "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" + "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" @@ -2792,20 +3777,20 @@ static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", }; /** - * Returns the BlitBlend test image as SDL_Surface. + * Returns the BlitBlendAdd test image as SDL_Surface. */ -SDL_Surface *SDLTest_ImageBlitBlend(void) +SDL_Surface *SDLTest_ImageBlitBlendAddPremultiplied(void) { SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlend.width, - SDLTest_imageBlitBlend.height, + SDLTest_imageBlitBlendAddPremultiplied.width, + SDLTest_imageBlitBlendAddPremultiplied.height, SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlend.pixel_data, - SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel); + (void *)SDLTest_imageBlitBlendAddPremultiplied.pixel_data, + SDLTest_imageBlitBlendAddPremultiplied.width * SDLTest_imageBlitBlendAddPremultiplied.bytes_per_pixel); return surface; } diff --git a/test/testautomation_images.h b/test/testautomation_images.h index f8541dedab8b6..d96698afc8755 100644 --- a/test/testautomation_images.h +++ b/test/testautomation_images.h @@ -26,8 +26,10 @@ typedef struct SDLTest_SurfaceImage_s { SDL_Surface *SDLTest_ImageBlit(void); SDL_Surface *SDLTest_ImageBlitColor(void); SDL_Surface *SDLTest_ImageBlitAlpha(void); -SDL_Surface *SDLTest_ImageBlitBlendAdd(void); SDL_Surface *SDLTest_ImageBlitBlend(void); +SDL_Surface *SDLTest_ImageBlitBlendPremultiplied(void); +SDL_Surface *SDLTest_ImageBlitBlendAdd(void); +SDL_Surface *SDLTest_ImageBlitBlendAddPremultiplied(void); SDL_Surface *SDLTest_ImageBlitBlendMod(void); SDL_Surface *SDLTest_ImageBlitBlendNone(void); SDL_Surface *SDLTest_ImageBlitBlendAll(void); diff --git a/test/testautomation_render.c b/test/testautomation_render.c index 4afff21c52b0d..abc51bb917f5e 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -702,6 +702,17 @@ static int render_testBlitBlend(void *arg) SDL_DestroySurface(referenceSurface); referenceSurface = NULL; + /* Test Blend Premultiplied. */ + testBlitBlendMode(tface, SDL_BLENDMODE_BLEND_PREMULTIPLIED); + referenceSurface = SDLTest_ImageBlitBlendPremultiplied(); + + /* Compare, then Present */ + compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); + SDL_RenderPresent(renderer); + + SDL_DestroySurface(referenceSurface); + referenceSurface = NULL; + /* Test Add. */ testBlitBlendMode(tface, SDL_BLENDMODE_ADD); referenceSurface = SDLTest_ImageBlitBlendAdd(); @@ -713,6 +724,17 @@ static int render_testBlitBlend(void *arg) SDL_DestroySurface(referenceSurface); referenceSurface = NULL; + /* Test Add Premultiplied. */ + testBlitBlendMode(tface, SDL_BLENDMODE_ADD_PREMULTIPLIED); + referenceSurface = SDLTest_ImageBlitBlendAddPremultiplied(); + + /* Compare, then Present */ + compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); + SDL_RenderPresent(renderer); + + SDL_DestroySurface(referenceSurface); + referenceSurface = NULL; + /* Test Mod. */ testBlitBlendMode(tface, SDL_BLENDMODE_MOD); referenceSurface = SDLTest_ImageBlitBlendMod(); @@ -1154,6 +1176,15 @@ hasBlendModes(void) if (!isSupported(ret)) { fail = 1; } + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND_PREMULTIPLIED ); + if (!isSupported(ret)) + fail = 1; + ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); + if (!isSupported(ret)) + fail = 1; + ret = (mode != SDL_BLENDMODE_BLEND_PREMULTIPLIED); + if (!isSupported(ret)) + fail = 1; ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD); if (!isSupported(ret)) { fail = 1; @@ -1166,6 +1197,18 @@ hasBlendModes(void) if (!isSupported(ret)) { fail = 1; } + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD_PREMULTIPLIED); + if (!isSupported(ret)) { + fail = 1; + } + ret = SDL_GetRenderDrawBlendMode(renderer, &mode); + if (!isSupported(ret)) { + fail = 1; + } + ret = (mode != SDL_BLENDMODE_ADD_PREMULTIPLIED); + if (!isSupported(ret)) { + fail = 1; + } ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD); if (!isSupported(ret)) { fail = 1; diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 0d9a81afc5f09..39fd1676421e4 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -523,6 +523,28 @@ static int surface_testBlitBlendBlend(void *arg) return TEST_COMPLETED; } +/** + * @brief Tests some more blitting routines. + */ +static int surface_testBlitBlendPremultiplied(void *arg) +{ + int ret; + SDL_Surface *compareSurface; + + /* Blend premultiplied blitting */ + testBlitBlendMode(SDL_BLENDMODE_BLEND_PREMULTIPLIED); + + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlendPremultiplied(); + ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + + /* Clean up. */ + SDL_DestroySurface(compareSurface); + + return TEST_COMPLETED; +} + /** * Tests some more blitting routines. */ @@ -545,6 +567,28 @@ static int surface_testBlitBlendAdd(void *arg) return TEST_COMPLETED; } +/** + * Tests some more blitting routines. + */ +static int surface_testBlitBlendAddPremultiplied(void *arg) +{ + int ret; + SDL_Surface *compareSurface; + + /* Add blitting */ + testBlitBlendMode(SDL_BLENDMODE_ADD_PREMULTIPLIED); + + /* Verify result by comparing surfaces */ + compareSurface = SDLTest_ImageBlitBlendAddPremultiplied(); + ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); + SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); + + /* Clean up. */ + SDL_DestroySurface(compareSurface); + + return TEST_COMPLETED; +} + /** * Tests some more blitting routines. */ @@ -958,10 +1002,20 @@ static const SDLTest_TestCaseReference surfaceTest10 = { /* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest11 = { - (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED + (SDLTest_TestCaseFp)surface_testBlitBlendPremultiplied, "surface_testBlitBlendPremultiplied", "Tests blitting routines with premultiplied blending mode.", TEST_DISABLED }; +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest12 = { + (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED +}; + +/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ +static const SDLTest_TestCaseReference surfaceTest13 = { + (SDLTest_TestCaseFp)surface_testBlitBlendAddPremultiplied, "surface_testBlitBlendAddPremultiplied", "Tests blitting routines with premultiplied add blending mode.", TEST_DISABLED +}; + +static const SDLTest_TestCaseReference surfaceTest14 = { (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED }; @@ -981,8 +1035,8 @@ static const SDLTest_TestCaseReference surfaceTestPalette = { static const SDLTest_TestCaseReference *surfaceTests[] = { &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, - &surfaceTest11, &surfaceTest12, &surfaceTestOverflow, &surfaceTestFlip, - &surfaceTestPalette, NULL + &surfaceTest11, &surfaceTest12, &surfaceTest13, &surfaceTest14, + &surfaceTestOverflow, &surfaceTestFlip, &surfaceTestPalette, NULL }; /* Surface test suite (global) */ diff --git a/test/testdraw.c b/test/testdraw.c index 242b49ec82bc5..d558bac26bfc1 100644 --- a/test/testdraw.c +++ b/test/testdraw.c @@ -243,9 +243,15 @@ int main(int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) { blendMode = SDL_BLENDMODE_BLEND; consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "blend_premultiplied") == 0) { + blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; + consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) { blendMode = SDL_BLENDMODE_ADD; consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "add_premultiplied") == 0) { + blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; + consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) { blendMode = SDL_BLENDMODE_MOD; consumed = 2; @@ -267,7 +273,7 @@ int main(int argc, char *argv[]) } if (consumed < 0) { static const char *options[] = { - "[--blend none|blend|add|mod|mul]", + "[--blend none|blend|blend_premultiplied|add|add_premultiplied|mod|mul]", "[--cyclecolor]", "[--cyclealpha]", "[num_objects]", diff --git a/test/testintersections.c b/test/testintersections.c index 2ff5f09d1cce2..6223aafa6ab4e 100644 --- a/test/testintersections.c +++ b/test/testintersections.c @@ -312,9 +312,15 @@ int main(int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) { blendMode = SDL_BLENDMODE_BLEND; consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "blend_premultiplied") == 0) { + blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; + consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) { blendMode = SDL_BLENDMODE_ADD; consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "add_premultiplied") == 0) { + blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; + consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) { blendMode = SDL_BLENDMODE_MOD; consumed = 2; @@ -338,7 +344,7 @@ int main(int argc, char *argv[]) } } if (consumed < 0) { - static const char *options[] = { "[--blend none|blend|add|mod|mul]", "[--cyclecolor]", "[--cyclealpha]", "[count]", NULL }; + static const char *options[] = { "[--blend none|blend|blend_premultiplied|add|add_premultiplied|mod|mul]", "[--cyclecolor]", "[--cyclealpha]", "[count]", NULL }; SDLTest_CommonLogUsage(state, argv[0], options); return 1; } diff --git a/test/testsprite.c b/test/testsprite.c index 8fb3531d62ac3..98f6a3276d4e8 100644 --- a/test/testsprite.c +++ b/test/testsprite.c @@ -451,9 +451,15 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i + 1], "blend") == 0) { blendMode = SDL_BLENDMODE_BLEND; consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "blend_premultiplied") == 0) { + blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; + consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "add") == 0) { blendMode = SDL_BLENDMODE_ADD; consumed = 2; + } else if (SDL_strcasecmp(argv[i + 1], "add_premultiplied") == 0) { + blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; + consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "mod") == 0) { blendMode = SDL_BLENDMODE_MOD; consumed = 2; @@ -506,7 +512,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) } if (consumed < 0) { static const char *options[] = { - "[--blend none|blend|add|mod|mul|sub]", + "[--blend none|blend|blend_premultiplied|add|add_premultiplied|mod|mul|sub]", "[--cyclecolor]", "[--cyclealpha]", "[--suspend-when-occluded]", From a419e2c890a90363458b9db300f9f54438661724 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 13:42:06 -0700 Subject: [PATCH 320/431] Updated and re-enabled surface and render blend mode tests --- test/testautomation_images.c | 5204 --------------------------------- test/testautomation_images.h | 9 - test/testautomation_render.c | 856 ++---- test/testautomation_surface.c | 417 ++- 4 files changed, 417 insertions(+), 6069 deletions(-) diff --git a/test/testautomation_images.c b/test/testautomation_images.c index 478c319a306b7..7968be23792c2 100644 --- a/test/testautomation_images.c +++ b/test/testautomation_images.c @@ -1014,4544 +1014,6 @@ SDL_Surface *SDLTest_ImageBlitColor(void) return surface; } -static const SDLTest_SurfaceImage_t SDLTest_imageBlitAlpha = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\20\20\0" - "\20\20\0" - "88\0" - "88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0II\0\224\224\0\224" - "\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302\302\0HH\0HH\0\324" - "\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0" - "00\0" - "00\0\356\356\0\356\356" - "\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16\0\374\374\0\374\374" - "\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\24\24\0\24\24\0\24\24\0\20\20\0" - "88\0" - "88\0" - "88\0**\0ff\0ff\0ff\0FF\0" - "\215\215\0\215\215\0\215\215\0UU\0\255\255\0\255\255\0\255\255\0[[\0\306" - "\306\0\306\306\0\306\306\0YY\0\331\331\0\331\331\0\331\331\0PP\0\350\350" - "\0\350\350\0\350\350\0DD\0\362\362\0\362\362\0\362\362\0" - "44\0\370\370\0" - "\370\370\0\370\370\0\"\"\0\374\374\0\374\374\0\374\374\0\16\16\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\374\374\0" - "\360\360\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\20\20\0" - "88\0" - "" - "88\0" - "88\0**\0ff\0ff\0ff\0FF\0\226\226\0\226\226\0\215\215\0UU\0\271\271" - "\0\271\271\0\255\255\0[[\0\323\323\0\323\323\0\306\306\0YY\0\345\345\0\345" - "\345\0\331\331\0PP\0\360\360\0\360\360\0\350\350\0DD\0\370\370\0\370\370" - "\0\362\362\0" - "44\0\374\374\0\374\374\0\370\370\0\"\"\0\376\376\0\376\376" - "\0\374\374\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" - "\0\24\24\0\24\24\0\20\20\0" - "33\0" - "33\0" - "33\0&&\0OO\0OO\0OO\0" - "55\0``\0``" - "\0``\0::\0``\0``\0``\0" - "22\0WW\0WW\0WW\0''\0II\0II\0II\0\33\33\0" - "99\0" - "9" - "9\0" - "99\0\20\20\0))\0))\0))\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17" - "\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0" - "\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\360\360\0\360\360\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\24\24\0\16\16" - "\0" - "33\0GG\0GG\0" - "00\0``\0\210\210\0\210\210\0TT\0\204\204\0\263\263\0\263" - "\263\0ee\0\222\222\0\315\315\0\312\312\0gg\0\216\216\0\331\331\0\327\327" - "\0cc\0\202\202\0\340\340\0\337\337\0YY\0qq\0\345\345\0\344\344\0NN\0^^\0" - "\352\352\0\352\352\0@@\0JJ\0\357\357\0\357\357\0" - "11\0" - "66\0\364\364\0\364" - "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" - "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" - "\16\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24" - "\24\0\24\24\0\22\22\0\24\24\0" - "88\0" - "88\0//\0BB\0pp\0pp\0UU\0ss\0\242\242" - "\0\242\242\0oo\0\230\230\0\306\306\0\306\306\0ww\0\265\265\0\335\335\0\335" - "\335\0ss\0\313\313\0\353\353\0\353\353\0ii\0\333\333\0\364\364\0\364\364" - "\0ZZ\0\351\351\0\371\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0" - "6" - "6\0\370\370\0\376\376\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16" - "\16\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376" - "\0\376\376\0\360\360\0\360\360\0\360\360\0\360\360\0\16\16\0\360\360\0\360" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\22\22\0\"\"\0" - "88\0" - "" - "88\0//\0OO\0pp\0pp\0WW\0\203\203\0\242\242\0\242\242\0qq\0\256\256\0\312" - "\312\0\301\301\0||\0\313\313\0\342\342\0\325\325\0yy\0\336\336\0\360\360" - "\0\342\342\0mm\0\353\353\0\367\367\0\354\354\0\\\\\0\363\363\0\373\373\0" - "\362\362\0JJ\0\371\371\0\375\375\0\367\367\0" - "66\0\374\374\0\376\376\0\373" - "\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375" - "\0\360\360\0\374\374\0\360\360\0\376\376\0\16\16\0\360\360\0\360\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\22\22\0&&\0\"\"\0" - "88\0//\0PP\0HH\0gg\0NN" - "\0pp\0ee\0}}\0VV\0{{\0oo\0\202\202\0NN\0qq\0jj\0vv\0>>\0``\0\\\\\0cc\0,," - "\0MM\0KK\0OO\0\35\35\0::\0" - "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0" - "\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7" - "\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360" - "\360\0\376\376\0\376\376\0\16\16\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" - "\0&&\0&&\0\"\"\0" - "66\0[[\0oo\0ee\0``\0\220\220\0\270\270\0\250\250\0xx\0" - "\250\250\0\327\327\0\311\311\0zz\0\246\246\0\341\341\0\325\325\0rr\0\230" - "\230\0\343\343\0\334\334\0gg\0\205\205\0\344\344\0\340\340\0[[\0rr\0\346" - "\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" - "" - "11\0" - "66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16" - "\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362\0\376" - "\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\22\22\0&&\0&&\0\37\37\0;;\0``\0``\0HH\0qq\0\237\237" - "\0\237\237\0nn\0\227\227\0\306\306\0\306\306\0}}\0\254\254\0\334\334\0\334" - "\334\0}}\0\275\275\0\347\347\0\347\347\0vv\0\316\316\0\357\357\0\357\357" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0" - "66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0&&\0##\0--\0``\0``\0TT\0cc\0\237\237\0\231\231\0||\0\223\223\0\306\306" - "\0\301\301\0\217\217\0\267\267\0\336\336\0\322\322\0\220\220\0\317\317\0" - "\352\352\0\334\334\0\202\202\0\337\337\0\362\362\0\345\345\0qq\0\353\353" - "\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371\371\0\375" - "\375\0\367\367\0" - "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376\376\0\376" - "\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0\376\376\0" - "\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0##\0" - "77\0--\0``\0PP\0nn\0[[\0\222\222\0kk\0\211\211\0qq\0\231\231\0" - "ff\0\210\210\0uu\0\217\217\0UU\0vv\0ll\0zz\0@@\0aa\0]]\0dd\0,,\0MM\0KK\0" - "OO\0\35\35\0::\0" - "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33\33\0\33\33\0\33" - "\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2" - "\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360\0\360\360\0\376" - "\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0##\0" - "77\0" - "77" - "\0--\0UU\0zz\0\216\216\0ww\0}}\0\254\254\0\324\324\0\264\264\0\207\207\0" - "\266\266\0\345\345\0\316\316\0\177\177\0\254\254\0\346\346\0\326\326\0rr" - "\0\231\231\0\344\344\0\334\334\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr" - "\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352\352\0AA\0JJ\0\357\357\0\357" - "\357\0" - "11\0" - "66\0\364\364\0\364\364\0\40\40\0\"\"\0\371\371\0\371\371\0" - "\16\16\0\16\16\0\375\375\0\375\375\0\376\376\0\376\376\0\362\362\0\362\362" - "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\376\376\0\376\376\0\16\16" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" - "77\0" - "77\0--\0CC\0~~\0~~\0\\\\\0||\0" - "\274\274\0\274\274\0||\0\235\235\0\325\325\0\325\325\0\204\204\0\256\256" - "\0\340\340\0\340\340\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316" - "\0\360\360\0\360\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371" - "\371\0\371\371\0II\0\362\362\0\374\374\0\374\374\0" - "66\0\370\370\0\376\376" - "\0\376\376\0\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0" - "\360\360\0\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0&&\0" - "77\0" - "22\0--\0``\0vv\0pp\0gg\0\243\243\0\255\255" - "\0\225\225\0\231\231\0\311\311\0\314\314\0\235\235\0\271\271\0\337\337\0" - "\326\326\0\224\224\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362" - "\362\0\345\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373" - "\0\362\362\0JJ\0\371\371\0\375\375\0\367\367\0" - "66\0\374\374\0\376\376\0" - "\373\373\0\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0" - "\375\375\0\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376" - "\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0" - "99\0``\0PP\0\200\200\0dd\0\222" - "\222\0kk\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm" - "\0zz\0@@\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" - "99\0;;\0\21\21\0**\0" - "))\0**\0\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0" - "\0\0\7\7\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16" - "\0\16\16\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0##\0" - "77\0" - "77\0" - "99\0^^\0zz\0\216\216\0\201\201\0\203" - "\203\0\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317" - "\0\200\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334" - "\0gg\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0" - "\352\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" - "11\0" - "66\0\364\364\0\364" - "\364\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375" - "\0\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16" - "\16\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22" - "\0" - "77\0" - "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302" - "\302\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341" - "\341\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360" - "\360\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371" - "\0II\0\362\362\0\374\374\0\374\374\0" - "66\0\370\370\0\376\376\0\376\376\0" - "\"\"\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0" - "\360\360\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0&&\0" - "77\0" - "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235" - "\0\234\234\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0" - "\225\225\0\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345" - "\345\0qq\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362" - "\0JJ\0\371\371\0\375\375\0\367\367\0" - "66\0\374\374\0\376\376\0\373\373\0" - "\"\"\0\376\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0" - "\360\360\0\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0&&\0##\0FF\0" - "99\0``\0PP\0\200\200\0dd\0\222\222\0kk" - "\0\222\222\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@" - "\0bb\0]]\0dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" - "99\0;;\0\21\21\0**\0))\0**\0" - "\10\10\0\33\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7" - "\0\7\7\0\7\7\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16" - "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0##\0" - "77\0" - "77\0" - "99\0^^\0zz\0\216\216\0\201\201\0\203\203\0" - "\254\254\0\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200" - "\200\0\254\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg" - "\0\206\206\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352" - "\352\0\352\352\0AA\0JJ\0\357\357\0\357\357\0" - "11\0" - "66\0\364\364\0\364\364" - "\0\40\40\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0" - "\376\376\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16" - "\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" - "" - "77\0" - "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302" - "\0||\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341" - "\0\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0" - "66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0" - "77\0" - "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" - "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" - "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" - "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" - "\371\0\375\375\0\367\367\0" - "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" - "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" - "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&&\0##\0FF\0" - "99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" - "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" - "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" - "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" - "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" - "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" - "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0##\0" - "77\0" - "77\0" - "99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" - "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" - "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" - "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" - "\352\0AA\0JJ\0\357\357\0\357\357\0" - "11\0" - "66\0\364\364\0\364\364\0\40\40" - "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" - "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" - "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" - "77\0" - "" - "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" - "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" - "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0" - "66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0" - "77\0" - "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" - "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" - "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" - "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" - "\371\0\375\375\0\367\367\0" - "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" - "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" - "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&&\0##\0FF\0" - "99\0``\0PP\0\200\200\0dd\0\222\222\0kk\0\222\222" - "\0vv\0\231\231\0ff\0\213\213\0ww\0\217\217\0UU\0xx\0mm\0zz\0@@\0bb\0]]\0" - "dd\0,,\0MM\0KK\0OO\0\35\35\0::\0" - "99\0;;\0\21\21\0**\0))\0**\0\10\10\0\33" - "\33\0\33\33\0\33\33\0\3\3\0\17\17\0\17\17\0\17\17\0\0\0\0\7\7\0\7\7\0\7\7" - "\0\7\7\0\2\2\0\2\2\0\2\2\0\2\2\0\16\16\0\16\16\0\16\16\0\16\16\0\360\360" - "\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0##\0" - "77\0" - "77\0" - "99\0^^\0zz\0\216\216\0\201\201\0\203\203\0\254\254\0" - "\324\324\0\271\271\0\211\211\0\266\266\0\345\345\0\317\317\0\200\200\0\254" - "\254\0\346\346\0\326\326\0ss\0\231\231\0\344\344\0\334\334\0gg\0\206\206" - "\0\344\344\0\340\340\0[[\0rr\0\346\346\0\344\344\0NN\0^^\0\352\352\0\352" - "\352\0AA\0JJ\0\357\357\0\357\357\0" - "11\0" - "66\0\364\364\0\364\364\0\40\40" - "\0\"\"\0\371\371\0\371\371\0\16\16\0\16\16\0\375\375\0\375\375\0\376\376" - "\0\376\376\0\362\362\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376" - "\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" - "77\0" - "" - "77\0--\0MM\0\210\210\0\210\210\0\\\\\0\202\202\0\302\302\0\302\302\0||" - "\0\240\240\0\330\330\0\330\330\0\204\204\0\257\257\0\341\341\0\341\341\0" - "\177\177\0\275\275\0\351\351\0\351\351\0vv\0\316\316\0\360\360\0\360\360" - "\0ii\0\334\334\0\365\365\0\365\365\0ZZ\0\351\351\0\371\371\0\371\371\0II" - "\0\362\362\0\374\374\0\374\374\0" - "66\0\370\370\0\376\376\0\376\376\0\"\"" - "\0\374\374\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\375\375\0\376\376\0\376\376\0\376\376\0\360\360\0\360\360\0\360\360" - "\0\360\360\0\16\16\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "&&\0" - "77\0" - "22\0--\0``\0vv\0xx\0kk\0\245\245\0\257\257\0\235\235\0\234\234" - "\0\312\312\0\315\315\0\241\241\0\272\272\0\337\337\0\326\326\0\225\225\0" - "\320\320\0\352\352\0\336\336\0\204\204\0\337\337\0\362\362\0\345\345\0qq" - "\0\353\353\0\370\370\0\354\354\0^^\0\363\363\0\373\373\0\362\362\0JJ\0\371" - "\371\0\375\375\0\367\367\0" - "66\0\374\374\0\376\376\0\373\373\0\"\"\0\376" - "\376\0\376\376\0\375\375\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\375\375\0\376\376\0\376\376\0\375\375\0\360\360\0" - "\376\376\0\360\360\0\376\376\0\16\16\0\376\376\0\376\376\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0&&\0##\0FF\0" - "99\0``\0PP\0\213\213\0mm\0\237\237\0uu\0\275\275" - "\0\232\232\0\306\306\0\204\204\0\331\331\0\272\272\0\336\336\0\205\205\0" - "\345\345\0\320\320\0\352\352\0{{\0\355\355\0\337\337\0\362\362\0mm\0\363" - "\363\0\353\353\0\370\370\0\\\\\0\367\367\0\363\363\0\373\373\0II\0\373\373" - "\0\371\371\0\375\375\0" - "66\0\375\375\0\374\374\0\376\376\0\"\"\0\376\376" - "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\375\375\0\376\376\0\375\375\0\375\375" - "\0\360\360\0\360\360\0\376\376\0\376\376\0\16\16\0\376\376\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0##\0" - "77\0" - "77\0" - "99\0gg\0\205\205\0\205\205\0ww\0\224\224\0" - "\310\310\0\310\310\0\247\247\0\240\240\0\354\354\0\354\354\0\306\306\0\227" - "\227\0\372\372\0\372\372\0\325\325\0\205\205\0\375\375\0\375\375\0\342\342" - "\0rr\0\376\376\0\376\376\0\354\354\0^^\0\376\376\0\376\376\0\363\363\0JJ" - "\0\376\376\0\376\376\0\370\370\0" - "66\0\376\376\0\376\376\0\374\374\0\"\"" - "\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\375\375" - "\0\376\376\0\376\376\0\376\376\0\362\362\0\376\376\0\376\376\0\376\376\0" - "\16\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\22\22\0" - "77\0" - "77\0" - "11\0>>\0~~\0~~\0bb" - "\0__\0\261\261\0\261\261\0\212\212\0``\0\277\277\0\277\277\0\230\230\0SS" - "\0\275\275\0\275\275\0\233\233\0@@\0\273\273\0\273\273\0\240\240\0//\0\274" - "\274\0\274\274\0\252\252\0!!\0\301\301\0\301\301\0\266\266\0\25\25\0\311" - "\311\0\311\311\0\303\303\0\14\14\0\324\324\0\324\324\0\322\322\0\6\6\0\342" - "\342\0\342\342\0\341\341\0\1\1\0\361\361\0\361\361\0\361\361\0\15\15\0\15" - "\15\0\15\15\0\15\15\0\362\362\0\362\362\0\362\362\0\360\360\0\16\16\0\16" - "\16\0\16\16\0\2\2\0\376\376\0\376\376\0\376\376\0\16\16\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0&&\0" - "77\0" - "77\0\34\34\0SS\0kk\0\206\206\0BB\0\214\214\0\232\232" - "\0\302\302\0YY\0\250\250\0\255\255\0\340\340\0XX\0\264\264\0\264\264\0\355" - "\355\0SS\0\265\265\0\266\266\0\364\364\0JJ\0\270\270\0\272\272\0\371\371" - "\0AA\0\277\277\0\300\300\0\374\374\0" - "66\0\310\310\0\311\311\0\375\375\0" - "**\0\324\324\0\324\324\0\376\376\0\34\34\0\341\341\0\342\342\0\376\376\0" - "\15\15\0\361\361\0\361\361\0\376\376\0\361\361\0\15\15\0\15\15\0\376\376" - "\0\15\15\0\361\361\0\361\361\0\373\373\0\362\362\0\15\15\0\16\16\0\376\376" - "\0\16\16\0\361\361\0\376\376\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0&&\0&&\0" - "77\0))\0SS\0SS\0kk\0DD\0\205\205\0}}\0\222\222\0WW\0\241\241" - "\0\230\230\0\245\245\0XX\0\261\261\0\252\252\0\261\261\0SS\0\264\264\0\263" - "\263\0\265\265\0JJ\0\270\270\0\271\271\0\272\272\0AA\0\276\276\0\300\300" - "\0\300\300\0" - "66\0\310\310\0\311\311\0\311\311\0**\0\324\324\0\324\324\0" - "\324\324\0\34\34\0\341\341\0\342\342\0\342\342\0\15\15\0\361\361\0\361\361" - "\0\361\361\0\361\361\0\15\15\0\15\15\0\15\15\0\15\15\0\361\361\0\361\361" - "\0\361\361\0\362\362\0\15\15\0\16\16\0\16\16\0\16\16\0\361\361\0\376\376" - "\0\376\376\0\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&&\0&&\0&&\0))\0pp\0cc\0cc" - "\0QQ\0\261\261\0\244\244\0\244\244\0ll\0\335\335\0\323\323\0\323\323\0ww" - "\0\364\364\0\356\356\0\356\356\0ss\0\370\370\0\371\371\0\371\371\0ii\0\372" - "\372\0\375\375\0\375\375\0YY\0\374\374\0\376\376\0\376\376\0HH\0\375\375" - "\0\376\376\0\376\376\0" - "66\0\376\376\0\376\376\0\376\376\0\"\"\0\376\376" - "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" - "\376\376\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\40\40\0QQ\0pp\0pp\0KK" - "\0\215\215\0\261\261\0\261\261\0pp\0\274\274\0\337\337\0\337\337\0\200\200" - "\0\332\332\0\364\364\0\364\364\0}}\0\350\350\0\373\373\0\373\373\0oo\0\361" - "\361\0\375\375\0\375\375\0]]\0\367\367\0\376\376\0\376\376\0JJ\0\373\373" - "\0\376\376\0\376\376\0" - "66\0\375\375\0\376\376\0\376\376\0\"\"\0\376\376" - "\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376\0\376\376\0\376\376\0\376" - "\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376" - "\0\375\375\0\376\376\0\376\376\0\376\376\0\361\361\0\376\376\0\376\376\0" - "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0&&\0&&\0\20\20\0" - "88\0WW\0pp\0" - "==\0ss\0\212\212\0\252\252\0dd\0\250\250\0\264\264\0\312\312\0rr\0\313\313" - "\0\315\315\0\331\331\0rr\0\340\340\0\331\331\0\340\340\0hh\0\355\355\0\341" - "\341\0\345\345\0YY\0\366\366\0\350\350\0\352\352\0HH\0\372\372\0\356\356" - "\0\357\357\0" - "66\0\375\375\0\364\364\0\364\364\0\"\"\0\376\376\0\371\371" - "\0\371\371\0\16\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361" - "\361\0\362\362\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\375\375\0" - "\376\376\0\375\375\0\374\374\0\360\360\0\376\376\0\376\376\0\360\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0&&\0\40\40\0" - "88\0" - "88\0WW\0BB\0ff" - "\0ZZ\0}}\0^^\0\226\226\0\201\201\0\241\241\0nn\0\301\301\0\246\246\0\277" - "\277\0rr\0\333\333\0\301\301\0\321\321\0ii\0\353\353\0\323\323\0\335\335" - "\0[[\0\365\365\0\341\341\0\346\346\0II\0\372\372\0\353\353\0\356\356\0" - "6" - "6\0\375\375\0\363\363\0\364\364\0\"\"\0\376\376\0\371\371\0\371\371\0\16" - "\16\0\376\376\0\375\375\0\375\375\0\376\376\0\376\376\0\361\361\0\361\361" - "\0\376\376\0\376\376\0\16\16\0\16\16\0\376\376\0\374\374\0\375\375\0\374" - "\374\0\374\374\0\361\361\0\376\376\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0" - "88\0" - "88\0BB\0~~\0ff\0ff\0" - "^^\0\256\256\0\226\226\0\226\226\0qq\0\325\325\0\277\277\0\277\277\0ss\0" - "\350\350\0\331\331\0\331\331\0jj\0\363\363\0\353\353\0\353\353\0[[\0\371" - "\371\0\365\365\0\365\365\0II\0\374\374\0\372\372\0\372\372\0" - "66\0\375\375" - "\0\375\375\0\375\375\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" - "\376\376\0\376\376\0\376\376\0\376\376\0\374\374\0\374\374\0\374\374\0\376" - "\376\0\361\361\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\24\24\0\24\24\0\24\24\0\40\40\0HH\0HH\0" - "88\0BB\0~~\0~~\0ff\0^^\0\263" - "\263\0\263\263\0\231\231\0nn\0\330\330\0\330\330\0\274\274\0pp\0\353\353" - "\0\353\353\0\324\324\0hh\0\365\365\0\365\365\0\345\345\0ZZ\0\373\373\0\373" - "\373\0\361\361\0II\0\375\375\0\375\375\0\370\370\0" - "66\0\376\376\0\376\376" - "\0\374\374\0\"\"\0\376\376\0\376\376\0\376\376\0\16\16\0\376\376\0\376\376" - "\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0\376\376\0" - "\376\376\0\374\374\0\374\374\0\376\376\0\376\376\0\361\361\0\360\360\0\360" - "\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0" - "\0\0\0\0((\0HH\0\40\40\0\25\25\0QQ\0\207\207\0KK\0--\0}}\0\262\262\0bb\0" - "" - "44\0\235\235\0\320\320\0ff\0" - "00\0\257\257\0\341\341\0cc\0))\0\272\272" - "\0\354\354\0ZZ\0\37\37\0\303\303\0\363\363\0OO\0\26\26\0\314\314\0\370\370" - "\0AA\0\15\15\0\326\326\0\373\373\0" - "22\0\6\6\0\343\343\0\375\375\0!!\0\1" - "\1\0\362\362\0\376\376\0\16\16\0\16\16\0\16\16\0\375\375\0\375\375\0\375" - "\375\0\376\376\0\362\362\0\360\360\0\361\361\0\376\376\0\14\14\0\0\0\0\0" - "\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24" - "\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0PP\0PP\0\10" - "\10\0\4\4\0dd\0dd\0\14\14\0\6\6\0xx\0xx\0\14\14\0\5\5\0\214\214\0\214\214" - "\0\13\13\0\4\4\0\240\240\0\240\240\0\10\10\0\2\2\0\264\264\0\264\264\0\5" - "\5\0\1\1\0\310\310\0\310\310\0\3\3\0\0\0\0\334\334\0\334\334\0\1\1\0\0\0" - "\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\0\0\0\0\0\14" - "\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0\24\24\0\0\0\0\0\0\0((\0((\0\0\0\0\0\0" - "\0<<\0<<\0\0\0\0\0\0\0XX\0XX\0\0\0\0\0\0\0pp\0pp\0\0\0\0\0\0\0\204\204\0" - "\204\204\0\0\0\0\0\0\0\227\227\0\227\227\0\0\0\0\0\0\0\250\250\0\250\250" - "\0\0\0\0\0\0\0\271\271\0\271\271\0\0\0\0\0\0\0\313\313\0\313\313\0\0\0\0" - "\0\0\0\335\335\0\335\335\0\0\0\0\0\0\0\360\360\0\360\360\0\0\0\0\0\0\0\1" - "\1\0\1\1\0\0\0\0\0\0\0\14\14\0\14\14\0\0\0\0\0\0\0\360\360\0\360\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" - "\24\24\0\24\24\0\0\0\0((\0((\0((\0\0\0\0<<\0HH\0HH\0\10\10\0PP\0dd\0dd\0" - "\14\14\0dd\0||\0||\0\14\14\0xx\0\221\221\0\221\221\0\13\13\0\214\214\0\243" - "\243\0\243\243\0\10\10\0\240\240\0\264\264\0\264\264\0\5\5\0\264\264\0\303" - "\303\0\303\303\0\3\3\0\310\310\0\322\322\0\322\322\0\1\1\0\334\334\0\341" - "\341\0\341\341\0\0\0\0\360\360\0\361\361\0\361\361\0\1\1\0\0\0\0\14\14\0" - "\14\14\0\14\14\0\0\0\0\360\360\0\360\360\0\360\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\24\24\0" - "\24\24\0\20\20\0\20\20\0" - "88\0" - "88\0**\0**\0ZZ\0ZZ\0==\0==\0yy\0yy\0II\0" - "II\0\224\224\0\224\224\0NN\0NN\0\254\254\0\254\254\0MM\0MM\0\302\302\0\302" - "\302\0HH\0HH\0\324\324\0\324\324\0>>\0>>\0\343\343\0\343\343\0" - "00\0" - "00" - "\0\356\356\0\356\356\0\40\40\0\40\40\0\367\367\0\367\367\0\16\16\0\16\16" - "\0\374\374\0\374\374\0\374\374\0\374\374\0\360\360\0\360\360\0\360\360\0" - "\360\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitAlpha test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitAlpha(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitAlpha.width, - SDLTest_imageBlitAlpha.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitAlpha.pixel_data, - SDLTest_imageBlitAlpha.width * SDLTest_imageBlitAlpha.bytes_per_pixel); - return surface; -} - -/* GIMP RGB C-Source image dump (alpha.c) */ - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlend = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240" - "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" - "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240" - "\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" - "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" - "\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240\0\240\240\0\240\240" - "\0aa\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww" - "\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305" - "\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305" - "\0\305\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305" - "\305\0\305\305\0ww\0\305\305\0\305\305\0\305\305\0ww\0\305\305\0\305\305" - "\0\305\305\0\305\305\0\240\240\0\240\240\0\240\240\0\240\240\0dd\0dd\0dd" - "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0<<\0\240\240" - "\0\240\240\0\240\240\0aa\0\305\305\0\305\305\0\305\305\0ww\0\333\333\0\333" - "\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333" - "\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305" - "\305\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305" - "\0ww\0\333\333\0\333\333\0\305\305\0ww\0\333\333\0\333\333\0\305\305\0ww" - "\0\333\333\0\333\333\0\305\305\0\305\305\0\305\305\0\305\305\0\240\240\0" - "\240\240\0\240\240\0\240\240\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0dd\0dd\0dd\0<<\0aa\0aa\0aa\0::\0HH\0HH\0HH\0++\0PP\0PP\0PP\0" - "00\0PP" - "\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP" - "\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP\0PP\0PP\0" - "00\0PP" - "\0PP\0PP\0PP\0HH\0HH\0HH\0HH\0aa\0aa\0aa\0aa\0dd\0dd\0dd\0dd\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0dd\0dd\0dd\0$$\0aa\0\305\305\0\305\305\0``\0\205\205\0\351\351\0" - "\351\351\0||\0\222\222\0\321\321\0\321\321\0\177\177\0\225\225\0\324\324" - "\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0" - "\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177\0\225" - "\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0\177\177" - "\0\225\225\0\324\324\0\321\321\0\177\177\0\225\225\0\324\324\0\321\321\0" - "\177\177\0\225\225\0\324\324\0\321\321\0\222\222\0\222\222\0\321\321\0\314" - "\314\0\351\351\0\351\351\0\254\254\0\236\236\0\305\305\0\305\305\0aa\0<<" - "\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0dd\0\240\240\0\240\240\0aa\0\255\255" - "\0\322\322\0\322\322\0\177\177\0\315\315\0\343\343\0\343\343\0\211\211\0" - "\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211" - "\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346" - "\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346\346\0" - "\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\313\313\0\346" - "\346\0\346\346\0\211\211\0\313\313\0\346\346\0\346\346\0\211\211\0\320\320" - "\0\327\327\0\327\327\0\322\322\0\276\276\0\322\322\0\322\322\0\305\305\0" - "yy\0\210\210\0\210\210\0dd\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0<<\0\210\210\0\240" - "\240\0\240\240\0aa\0\266\266\0\322\322\0\322\322\0\205\205\0\327\327\0\343" - "\343\0\343\343\0\215\215\0\346\346\0\357\357\0\331\331\0\222\222\0\347\347" - "\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0" - "\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331\0\222" - "\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0\331\331" - "\0\222\222\0\347\347\0\357\357\0\331\331\0\222\222\0\347\347\0\357\357\0" - "\331\331\0\222\222\0\357\357\0\346\346\0\320\320\0\351\351\0\327\327\0\343" - "\343\0\276\276\0\333\333\0\322\322\0\266\266\0yy\0\240\240\0\210\210\0\240" - "\240\0<<\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0dd\0<<\0\240\240\0\210\210\0\240\240\0aa\0ww\0nn\0\177" - "\177\0MM\0SS\0OO\0SS\0" - "22\0WW\0TT\0XX\0" - "55\0UU\0UU\0XX\0" - "55\0UU\0UU\0" - "XX\0" - "55\0UU\0UU\0XX\0" - "55\0UU\0UU\0XX\0" - "55\0UU\0UU\0XX\0" - "55\0UU\0UU\0" - "XX\0" - "55\0UU\0UU\0XX\0" - "55\0UU\0UU\0XX\0" - "55\0UU\0XX\0TT\0TT\0LL\0OO\0SS" - "\0SS\0ss\0\177\177\0nn\0nn\0yy\0\210\210\0\240\240\0\240\240\0<<\0dd\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<" - "\0\240\240\0\240\240\0\210\210\0HH\0\205\205\0\351\351\0\333\333\0pp\0\225" - "\225\0\371\371\0\363\363\0\202\202\0\231\231\0\330\330\0\325\325\0\203\203" - "\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0" - "\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324" - "\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331" - "\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0" - "\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\325\325\0\231\231\0\231" - "\231\0\330\330\0\323\323\0\371\371\0\371\371\0\274\274\0\257\257\0\351\351" - "\0\351\351\0\205\205\0``\0\240\240\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\240\240" - "\0\240\240\0RR\0\207\207\0\304\304\0\304\304\0nn\0\275\275\0\343\343\0\343" - "\343\0\205\205\0\324\324\0\352\352\0\352\352\0\214\214\0\316\316\0\352\352" - "\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0" - "\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213\0\316" - "\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0\213\213" - "\0\316\316\0\352\352\0\352\352\0\213\213\0\316\316\0\352\352\0\352\352\0" - "\213\213\0\316\316\0\352\352\0\352\352\0\214\214\0\324\324\0\336\336\0\336" - "\336\0\331\331\0\310\310\0\343\343\0\343\343\0\325\325\0\217\217\0\254\254" - "\0\254\254\0\207\207\0aa\0\240\240\0\240\240\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0aa" - "\0\225\225\0\304\304\0\304\304\0\205\205\0\276\276\0\343\343\0\340\340\0" - "\222\222\0\333\333\0\352\352\0\351\351\0\226\226\0\347\347\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\366\366\0\336\336\0\351\351\0\304\304\0\351\351\0\343\343\0\304\304\0\217" - "\217\0\333\333\0\254\254\0\266\266\0aa\0\240\240\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\305\305\0\225\225\0\304\304\0ww\0\205\205\0ss\0\211\211\0RR\0VV\0PP\0" - "VV\0" - "33\0XX\0UU\0YY\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0||\0\217\217\0\254\254\0\266\266\0\305\305\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\225\225\0UU\0\222\222\0\366\366\0\340\340\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0mm\0\266\266\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\214\214\0\321\321\0\321\321\0rr\0\277\277\0\346\346\0\346" - "\346\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\331\331\0\312\312\0\346\346\0\346\346\0\330\330\0\224\224\0\271\271" - "\0\271\271\0\217\217\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\222\222\0\277\277\0\343\343\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\336\336\0\352\352\0\306\306\0\354\354\0\344\344\0\305\305\0\227" - "\227\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0" - "33\0XX\0UU\0YY\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0" - "33\0XX\0UU\0YY\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0" - "33\0XX\0UU\0YY\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\210\210\0tt\0\211\211\0RR\0VV\0PP\0" - "VV\0" - "33\0XX\0UU\0YY\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0UU\0" - "XX\0" - "66\0UU\0UU\0XX\0" - "66\0UU\0YY\0UU\0UU\0MM\0QQ\0UU\0UU\0ww\0\211\211" - "\0ww\0}}\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0XX\0\222\222\0\366\366\0\341\341\0tt\0\231\231" - "\0\375\375\0\364\364\0\203\203\0\231\231\0\331\331\0\326\326\0\203\203\0" - "\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203" - "\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0\324\324" - "\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331\331\0" - "\324\324\0\203\203\0\231\231\0\331\331\0\324\324\0\203\203\0\231\231\0\331" - "\331\0\324\324\0\203\203\0\231\231\0\331\331\0\326\326\0\231\231\0\231\231" - "\0\331\331\0\324\324\0\373\373\0\375\375\0\300\300\0\263\263\0\361\361\0" - "\366\366\0\222\222\0pp\0\276\276\0\305\305\0\305\305\0aa\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<<\0\305\305\0" - "\305\305\0``\0\217\217\0\324\324\0\324\324\0rr\0\300\300\0\347\347\0\347" - "\347\0\206\206\0\324\324\0\353\353\0\353\353\0\215\215\0\316\316\0\353\353" - "\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0" - "\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213\0\316" - "\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0\213\213" - "\0\316\316\0\353\353\0\353\353\0\213\213\0\316\316\0\353\353\0\353\353\0" - "\213\213\0\316\316\0\353\353\0\353\353\0\215\215\0\324\324\0\337\337\0\337" - "\337\0\332\332\0\312\312\0\347\347\0\347\347\0\330\330\0\224\224\0\274\274" - "\0\274\274\0\222\222\0nn\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305\305\0ww" - "\0\225\225\0\304\304\0\314\314\0\225\225\0\300\300\0\344\344\0\342\342\0" - "\226\226\0\333\333\0\352\352\0\351\351\0\227\227\0\350\350\0\362\362\0\333" - "\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361" - "\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351\351\0" - "\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230\0\351" - "\351\0\361\361\0\333\333\0\230\230\0\351\351\0\361\361\0\333\333\0\230\230" - "\0\351\351\0\361\361\0\333\333\0\230\230\0\362\362\0\351\351\0\323\323\0" - "\370\370\0\337\337\0\352\352\0\306\306\0\355\355\0\345\345\0\306\306\0\231" - "\231\0\343\343\0\254\254\0\266\266\0ww\0\305\305\0\240\240\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0aa" - "\0\333\333\0\236\236\0\304\304\0ww\0\340\340\0\300\300\0\343\343\0\210\210" - "\0\354\354\0\333\333\0\352\352\0\215\215\0\361\361\0\350\350\0\362\362\0" - "\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361" - "\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0\351\351" - "\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351\351\0" - "\351\351\0\361\361\0\223\223\0\351\351\0\351\351\0\361\361\0\223\223\0\351" - "\351\0\351\351\0\361\361\0\223\223\0\351\351\0\362\362\0\351\351\0\351\351" - "\0\323\323\0\336\336\0\351\351\0\351\351\0\304\304\0\343\343\0\305\305\0" - "\317\317\0\217\217\0\254\254\0\276\276\0\333\333\0aa\0\240\240\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0aa\0\305" - "\305\0\305\305\0\236\236\0\222\222\0\361\361\0\361\361\0\316\316\0\230\230" - "\0\373\373\0\373\373\0\344\344\0\231\231\0\375\375\0\375\375\0\357\357\0" - "\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347" - "\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375" - "\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375\375\0" - "\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\347\347\0\231\231\0\375" - "\375\0\375\375\0\347\347\0\231\231\0\375\375\0\375\375\0\360\360\0\373\373" - "\0\375\375\0\375\375\0\347\347\0\367\367\0\373\373\0\373\373\0\326\326\0" - "\351\351\0\361\361\0\361\361\0\271\271\0\276\276\0\305\305\0\305\305\0aa" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0<<\0\305\305\0\305\305\0\236\236\0HH\0\271\271\0\271\271\0\224\224\0VV" - "\0\277\277\0\277\277\0\251\251\0DD\0\252\252\0\252\252\0\235\235\0FF\0\253" - "\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253" - "\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253" - "\253\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253" - "\0\224\224\0EE\0\253\253\0\253\253\0\224\224\0EE\0\253\253\0\253\253\0\235" - "\235\0rr\0uu\0uu\0^^\0\272\272\0\277\277\0\277\277\0\230\230\0\205\205\0" - "\222\222\0\222\222\0MM\0\266\266\0\305\305\0\305\305\0<<\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\305" - "\305\0\305\305\0RR\0\236\236\0\254\254\0\361\361\0VV\0\267\267\0\263\263" - "\0\356\356\0ee\0\247\247\0\244\244\0\356\356\0^^\0\251\251\0\247\247\0\365" - "\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365" - "\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb" - "\0\242\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0bb\0\242" - "\242\0\247\247\0\365\365\0bb\0\242\242\0\247\247\0\365\365\0\252\252\0ee" - "\0jj\0\345\345\0tt\0\246\246\0\251\251\0\321\321\0\272\272\0ff\0\222\222" - "\0\322\322\0ww\0\210\210\0\305\305\0\305\305\0\240\240\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240" - "\0\305\305\0``\0\236\236\0\236\236\0\254\254\0VV\0\264\264\0\254\254\0\261" - "\261\0dd\0\246\246\0\240\240\0\243\243\0^^\0\251\251\0\246\246\0\246\246" - "\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb" - "\0\242\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242" - "\242\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0bb\0\242\242" - "\0\246\246\0\246\246\0bb\0\242\242\0\246\246\0\246\246\0\251\251\0dd\0hh" - "\0hh\0pp\0\243\243\0\240\240\0\236\236\0\264\264\0cc\0\177\177\0ww\0ww\0" - "\225\225\0\305\305\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\240\240\0\240\240\0\240\240\0``" - "\0\351\351\0\333\333\0\333\333\0||\0\366\366\0\361\361\0\361\361\0\211\211" - "\0\373\373\0\371\371\0\371\371\0\221\221\0\375\375\0\374\374\0\374\374\0" - "\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374" - "\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0\374\374" - "\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365\365\0" - "\374\374\0\374\374\0\224\224\0\365\365\0\374\374\0\374\374\0\224\224\0\365" - "\365\0\374\374\0\374\374\0\375\375\0\356\356\0\371\371\0\371\371\0\372\372" - "\0\340\340\0\361\361\0\361\361\0\364\364\0\307\307\0\333\333\0\333\333\0" - "\351\351\0\225\225\0\240\240\0\240\240\0\240\240\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240\240" - "\0aa\0\304\304\0\351\351\0\351\351\0\205\205\0\340\340\0\366\366\0\366\366" - "\0\222\222\0\355\355\0\373\373\0\373\373\0\227\227\0\364\364\0\375\375\0" - "\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375" - "\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0\360\360" - "\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230\230\0" - "\360\360\0\375\375\0\375\375\0\230\230\0\360\360\0\375\375\0\375\375\0\230" - "\230\0\360\360\0\375\375\0\375\375\0\373\373\0\356\356\0\373\373\0\373\373" - "\0\367\367\0\340\340\0\364\364\0\364\364\0\354\354\0\304\304\0\351\351\0" - "\351\351\0\322\322\0\210\210\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\240\240\0\240" - "\240\0<<\0\240\240\0\305\305\0\351\351\0ww\0\320\320\0\301\301\0\324\324" - "\0\211\211\0\345\345\0\316\316\0\324\324\0\217\217\0\356\356\0\323\323\0" - "\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323" - "\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0\354\354" - "\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223\223\0" - "\354\354\0\323\323\0\326\326\0\223\223\0\354\354\0\323\323\0\326\326\0\223" - "\223\0\354\354\0\323\323\0\326\326\0\362\362\0\344\344\0\261\261\0\272\272" - "\0\364\364\0\340\340\0\225\225\0\205\205\0\340\340\0\276\276\0\351\351\0" - "\266\266\0\240\240\0dd\0\240\240\0\240\240\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\240\240\0aa\0\240" - "\240\0\240\240\0\305\305\0ww\0\305\305\0\240\240\0\266\266\0\205\205\0\333" - "\333\0\266\266\0\304\304\0\215\215\0\352\352\0\305\305\0\314\314\0\222\222" - "\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0" - "\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305\0\314" - "\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0\305\305" - "\0\314\314\0\222\222\0\352\352\0\305\305\0\314\314\0\222\222\0\352\352\0" - "\305\305\0\314\314\0\361\361\0\335\335\0\242\242\0\236\236\0\333\333\0\312" - "\312\0ii\0aa\0\305\305\0\255\255\0\266\266\0\240\240\0\240\240\0\210\210" - "\0\240\240\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0aa\0\305\305\0\240\240\0\240\240\0ww\0\333" - "\333\0\305\305\0\305\305\0\205\205\0\351\351\0\333\333\0\333\333\0\217\217" - "\0\363\363\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0" - "\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351" - "\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0\351\351" - "\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\223\223\0\357\357\0" - "\351\351\0\351\351\0\223\223\0\357\357\0\351\351\0\351\351\0\363\363\0\345" - "\345\0\333\333\0\333\333\0\340\340\0\312\312\0\305\305\0\305\305\0\322\322" - "\0\255\255\0\240\240\0\240\240\0\305\305\0\210\210\0dd\0dd\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd" - "\0dd\0dd\0aa\0\305\305\0\305\305\0\240\240\0ww\0\333\333\0\333\333\0\305" - "\305\0\205\205\0\355\355\0\355\355\0\336\336\0\215\215\0\364\364\0\364\364" - "\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0" - "\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215\0\364" - "\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0\215\215" - "\0\364\364\0\364\364\0\335\335\0\215\215\0\364\364\0\364\364\0\335\335\0" - "\215\215\0\364\364\0\364\364\0\335\335\0\351\351\0\355\355\0\355\355\0\312" - "\312\0\305\305\0\322\322\0\322\322\0\255\255\0\240\240\0\305\305\0\305\305" - "\0\210\210\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0\305\305\0aa" - "\0" - "11\0\225\225\0\351\351\0\205\205\0HH\0\254\254\0\333\333\0ww\0BB\0\264" - "\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0" - "nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264" - "\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0BB\0\264\264\0\340\340\0nn\0" - "BB\0\264\264\0\340\340\0nn\0nn\0\205\205\0\314\314\0\266\266\0\304\304\0" - "\351\351\0\236\236\0yy\0\210\210\0\305\305\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14\0dd\0dd\0\25\25\0\14\14" - "\0dd\0dd\0\25\25\0\25\25\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0" - "\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0" - "yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0" - "\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0yy\0\0\0\0\0\0\0yy\0" - "yy\0\0\0\0\0\0\0$$\0$$\0\0\0\0\0\0\0<<\0<<\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd" - "\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210" - "\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210" - "\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25" - "\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0\25\25\0dd\0\210" - "\210\0\210\210\0\25\25\0dd\0\210\210\0\210\210\0$$\0\0\0\0<<\0<<\0<<\0\0" - "\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0dd\0dd\0<<\0<<\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0" - "aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240" - "\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240" - "\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0" - "aa\0aa\0\240\240\0\240\240\0aa\0aa\0\240\240\0\240\240\0\240\240\0\240\240" - "\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitBlend test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlend(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlend.width, - SDLTest_imageBlitBlend.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlend.pixel_data, - SDLTest_imageBlitBlend.width * SDLTest_imageBlitBlend.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendPremultiplied = { - 80, 60, 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * \brief Returns the BlitBlendPremultiplied test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendPremultiplied() -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendPremultiplied.width, - SDLTest_imageBlitBlendPremultiplied.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendPremultiplied.pixel_data, - SDLTest_imageBlitBlendPremultiplied.width * SDLTest_imageBlitBlendPremultiplied.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAdd = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" - "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" - "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" - "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" - "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" - "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" - "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" - "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" - "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" - "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" - "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" - "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" - "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" - "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" - "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" - "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitBlendAdd test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendAdd(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendAdd.width, - SDLTest_imageBlitBlendAdd.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendAdd.pixel_data, - SDLTest_imageBlitBlendAdd.width * SDLTest_imageBlitBlendAdd.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAddPremultiplied = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd" - "\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0" - "dd\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310\310\0dd\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310" - "\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\377\377\0\377\377\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\310\310\0\377\377\0\377\377\0\310\310\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310" - "\0\310\310\0\310\310\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0\310\310\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310" - "\310\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0\310\310\0\310\310\0dd\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\310\310\0" - "dd\0\310\310\0\310\310\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\310\310\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\310" - "\310\0\310\310\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\310\310\0\310\310" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0\310\310\0dd" - "\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0dd\0dd\0dd\0\310\310\0\377\377\0\377\377\0\310\310\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\310\310\0\377\377\0\377\377\0\310\310\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd" - "\0\0\0\0\0\0\0dd\0\377\377\0\310\310\0\310\310\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\310\310\0\310\310\0\377\377\0dd\0\0" - "\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0" - "\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0" - "dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0" - "dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0\0\0\0" - "\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0" - "\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310" - "\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310" - "\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0" - "\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0\0\310\310\0\310\310\0\0\0\0\0\0" - "\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0dd\0\310\310\0\310" - "\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310" - "\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0" - "dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310" - "\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0dd\0\310\310\0\310\310\0dd\0" - "\0\0\0dd\0dd\0dd\0\0\0\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0dd\0dd\0dd\0dd\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310" - "\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0" - "\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310\310\0\310" - "\310\0dd\0dd\0dd\0dd\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitBlendAdd test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendAddPremultiplied(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendAddPremultiplied.width, - SDLTest_imageBlitBlendAddPremultiplied.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendAddPremultiplied.pixel_data, - SDLTest_imageBlitBlendAddPremultiplied.width * SDLTest_imageBlitBlendAddPremultiplied.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendMod = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitBlendMod test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendMod(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendMod.width, - SDLTest_imageBlitBlendMod.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendMod.pixel_data, - SDLTest_imageBlitBlendMod.width * SDLTest_imageBlitBlendMod.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendNone = { - 80, - 60, - 3, - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0" - "\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\0\0\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" - "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377\377" - "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\0\0\0\377\377\0\377" - "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" - "\377\377\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" - "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377", -}; - -/** - * Returns the BlitBlendNone test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendNone(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendNone.width, - SDLTest_imageBlitBlendNone.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendNone.pixel_data, - SDLTest_imageBlitBlendNone.width * SDLTest_imageBlitBlendNone.bytes_per_pixel); - return surface; -} - -static const SDLTest_SurfaceImage_t SDLTest_imageBlitBlendAll = { - 80, - 60, - 3, - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\0\0\0\0\0" - "\0\11\0\0\11\0\0\0\0\0\0\0\0\16\0\0\16\0\0\0\0\0\0\0\0\11\0\0\11\0\0\0\0" - "\0\0\0\0\14\0\0\14\0\0\0\0\0\0\0\0\17\0\0\17\0\0\0\0\0\0\0\0\21\0\0\21\0" - "\0\0\0\0\0\0\0K\0\0K\0\0\0\0\0\0\0\0T\0\0T\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0" - "\0\0\0\0g\0\0g\0\0\0\0\0\0\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" - "\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11" - "\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\11\0\0\0\0\0\14\0\0\14" - "\0\0\14\0\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24" - "\0\0\24\0\0K\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0" - "\0g\0\0\0\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" - "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\11\0\0\11\0\0\11\0\0\0\0\0" - "\16\0\0\16\0\0\16\0\0\0\0\0\22\0\0\22\0\0\22\0\0\0\0\0\14\0\0\14\0\0\14\0" - "\0\0\0\0\17\0\0\17\0\0\17\0\0\0\0\0\21\0\0\21\0\0\21\0\0\0\0\0\24\0\0\24" - "\0\0\24\0\0\0\0\0T\0\0T\0\0T\0\0\0\0\0^\0\0^\0\0^\0\0\0\0\0g\0\0g\0\0g\0" - "\0\0\0\0q\0\0q\0\0q\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317\0\0\317" - "\0\0\317\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\4\0\0\4\0\0\4\0\0\0\0\0\10\0\0\10\0\0\10\0\0\0\0\0\15" - "\0\0\15\0\0\15\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0J\0\0J\0\0J\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\317" - "\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1" - "\0\0\4\0\0\4\0\0\0\0\0\0\0\0\7\0\0\7\0\0\0\0\0\0\0\0&\0\0&\0\0\32\0\0\32" - "\0\0&\0\0&\0\0&\0\0&\0\0C\0\0C\0\0\0\0\0\0\0\0^\0\0^\0\0\0\0\0\0\0\17\251" - "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\0\0\0\0" - "\0\0\0\317\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\6\2\0\6\2\0\0\1\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0" - "\17\0\0\0\0\0\4\0\0\11\0\0\11\0\0\0\0\6+\0\6+\0\0&\0\0\32\0\0&\0\0&\0\0&" - "\0\0&\0\0" - "5\0\0" - "5\0\2\210\0\0\0\0\0C\0\0|\0\0|\0\0\0\0\17\251\0\17\251" - "\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251" - "\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1" - "\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\6\2\0\6\2\0\6\2\0\0\0\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1" - "\0\0\1\0\0\0\0\0\17\0\0\17\0\0\4\0\0\0\0\6+\0\6+\0\6+\0\0\32\0\0&\0\0&\0" - "\0&\0\0&\0\0" - "5\0\0" - "5\0\0" - "5\0\0\0\0\2\210\0\2\210\0\0C\0\0\0\0\17\251\0" - "\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0\17\251\0" - "\17\251\0\17\251\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\317\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "$\360\0$\360\0$\360\0$\360\0\0\0\0\0\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0" - "\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\14\1\0\14\1\0\14\1" - "\0\14\1\0\15\1\0\15\1\0\0\0\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16" - "\2\0\0\0\0\0\0\0\14!\0\14!\0\14!\0\14!\0\17(\0\17(\0\0\0\0\0\0\0\14+\0\14" - "+\0\14+\0\14+\0\20" - "9\0\20" - "9\0\0\0\0\0\0\0\36\215\0\36\215\0\36\215\0\36" - "\215\0(\264\0(\264\0\0\0\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251" - "\0\36\251\0\36\251\0\36\251\0\0\0\0\0\0\0$\360\0$\360\0$\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3" - "\0\36\3\0\14\1\0\14\1\0\15\1\0\15\1\0\15\1\0\0\0\0\14\2\0\14\2\0\14\2\0\14" - "\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14\3\0\14!\0\14!\0\17(\0\17(\0\17" - "(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20" - "9\0\20" - "9\0\20" - "9\0\0\0\0\14" - "7\0\14" - "" - "7\0\36\215\0\36\215\0(\264\0(\264\0(\264\0\0\0\0\36\251\0\36\251\0\36\251" - "\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0H\360\0" - "H\360\0\0\0\0$\360\0$\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\36\3\0\36\3\0\36\3\0\14\1\0\15\1\0\15\1\0\15\1" - "\0\0\0\0\14\2\0\14\2\0\14\2\0\14\2\0\16\2\0\16\2\0\16\2\0\0\0\0\14\3\0\14" - "\3\0\14\3\0\14!\0\17(\0\17(\0\17(\0\0\0\0\14+\0\14+\0\14+\0\14+\0\20" - "9\0" - "\20" - "9\0\20" - "9\0\0\0\0\14" - "7\0\14" - "7\0\14" - "7\0\36\215\0(\264\0(\264\0(\264" - "\0\0\0\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36\251\0\36" - "\251\0\36\251\0\36\251\0\36\251\0H\360\0H\360\0H\360\0\0\0\0$\360\0$\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\13\1\0\13\1\0\13\1\0\13\1\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\11!\0" - "\11!\0\11!\0\11!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\23n\0\23n\0\23n\0\23n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0H\360\0H\360\0H\360\0H\360\0\0\0\0$\360\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\1\0\1\1\0\0\0\0\0\0\0\0\0\0\0\0\0\25\0\0\25\0\0\25\0\0\27\0" - "\0\13\0\0\13\0\0\1\0\0\11\0\0\4\0\0\4\0\0\0\0\0\0\0\0\25\3\0\25\3\0\0\0\0" - "\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\3\1\0\3\1\0\2\1\0\7\5\0\7\3\0\7\3\0\0" - "\0\0\0\0\0\25" - "4\0\25" - "4\0\0\0\0\0\0\0\25" - "4\0\25" - "4\0\25" - "4\0\25" - "4\0\20" - "\35\0\20\35\0\11\22\0\23F\0\34" - "6\0\34" - "6\0\0\0\0\0\0\0L\317\0L\317\0L\317" - "\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0\0\0\0" - "2\317\0" - "2\317\0" - "2\317" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\1\0\0\0\0\0\0\0\0\0\0\25\0\0\25" - "\0\0\25\0\0\4\0\0\5\0\0\2\0\0\1\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7\0\37\7" - "\0\25\3\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\15\4\0\11\3\0\7" - "\3\0\14\10\0\14\10\0\0\0\0\25\16\0\25\16\0\25" - "4\0\0\0\0\25" - "4\0\25" - "4\0" - "\25" - "4\0\25" - "4\0&Q\0&Q\0&Q\0\31" - "5\0\34" - "6\0&j\0&j\0\0\0\0" - "5q\0" - "5q\0L\317" - "\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0\0\0\0" - "2" - "\317\0" - "2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\1\1\0\0\0\0\0\0\0\25\0" - "\0\25\0\0\25\0\0\31\1\0\5\0\0\5\0\0\2\0\0\4\0\0\14\0\0\14\0\0\0\0\0\37\7" - "\0\37\7\0\37\7\0\0\0\0\25\3\0\25\3\0\25\3\0\25\3\0\37\6\0\37\6\0\37\6\0\11" - "\3\0\16\6\0\16\6\0\7\3\0\0\0\0\25\16\0\25\16\0\25\16\0\0\0\0\25" - "4\0\25" - "4" - "\0\25" - "4\0\25" - "4\0&Q\0&Q\0&Q\0\31" - "5\0+X\0+X\0\34" - "6\0\0\0\0" - "5q\0" - "5q\0" - "" - "5q\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317\0L\317" - "\0L\317\0\0\0\0" - "2\317\0" - "2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0" - "\0\0\0\0\25\0\0\25\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0L\317\0L\317\0L\317\0L\317" - "\0\0\0\0" - "2\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0e\4\0e\4\0\0\0\0\0\0\0e\11\0e\11\0\0\0\0\0\0\0e\16\0e\16\0\0\0\0\0\0" - "\0G\11\0G\11\0\0\0\0\0\0\0G\14\0G\14\0\0\0\0\0\0\0G\17\0G\17\0\0\0\0\0\0" - "\0G\21\0G\21\0\0\0\0\0\0\0GK\0GK\0\0\0\0\0\0\0GT\0GT\0\0\0\0\0\0\0G^\0G^" - "\0\0\0\0\0\0\0Gg\0Gg\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" - "\0e\317\0e\317\0\0\0\0\0\0\0L\317\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\1\0\0\0\0\0\0\0\0e\4\0e\4\0e\4\0\0\0\0e\11\0e\11\0e\11\0\0\0" - "\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0G\11\0\0\0\0G\14\0G\14\0G\14\0\0\0" - "\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0\0G\24\0G\24\0GK\0\0\0\0" - "GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg\0\0\0\0Gq\0Gq\0e\317\0e\317" - "\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0\0\0\0L\317\0L" - "\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\0\0e\4\0e\4\0e\4\0\0\0" - "\0e\11\0e\11\0e\11\0\0\0\0e\16\0e\16\0e\16\0\0\0\0e\22\0e\22\0e\22\0\0\0" - "\0G\14\0G\14\0G\14\0\0\0\0G\17\0G\17\0G\17\0\0\0\0G\21\0G\21\0G\21\0\0\0" - "\0G\24\0G\24\0G\24\0\0\0\0GT\0GT\0GT\0\0\0\0G^\0G^\0G^\0\0\0\0Gg\0Gg\0Gg" - "\0\0\0\0Gq\0Gq\0Gq\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317\0e\317" - "\0e\317\0e\317\0e\317\0\0\0\0L\317\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0e\4\0e\4\0e\4\0\0\0\0b\10\0b\10\0b\10\0\0\0\0b\15\0b\15\0b\15\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0<\16\0<\16\0<\16\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0" - "2J\0" - "2J\0" - "2J\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0e\317\0e\317\0e\317\0e" - "\317\0\0\0\0L\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0c\0\0c\0\0\0\0\0" - "`\0\0c\0\0c\0\0\2\0\0c\1\0i\0\0i\0\0\0\0\0\0\0\0e\0\0e\0\0\0\0\0\0\0\0{\1" - "\0{\1\0f\0\0f\0\0z\1\0z\1\0z\1\0z\1\0)\4\0)\4\0\0\0\0\0\0\0Q\7\0Q\7\0\0\0" - "\0\0\0\0{&\0{&\0W\32\0W\32\0z&\0z&\0z&\0z&\0IC\0IC\0\0\0\0\0\0\0X^\0X^\0" - "\0\0\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0" - "\261\251\0\261\251\0\0\0\0\0\0\0e\317\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\216\1\0c\0\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0k\1\0i\0\0" - "\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0{\1\0f\0\0z\1\0z\1\0z\1\0z\1" - "\0\221\1\0\221\1\0\221\17\0\0\0\0)\4\0c\11\0c\11\0\0\0\0\256+\0\256+\0{&" - "\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\243\210\0\0\0\0IC\0{|\0{|\0\0\0\0" - "\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261" - "\251\0\261\251\0\261\251\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0`\0\0\2\0\0c\0\0c\0\0c\0\0\12\0\0" - "k\1\0k\1\0\0\0\0\11\0\0i\0\0i\0\0\0\0\0\256\2\0\256\2\0\256\2\0f\0\0z\1\0" - "z\1\0z\1\0z\1\0\221\1\0\221\1\0\221\1\0\0\0\0\221\17\0\221\17\0)\4\0\0\0" - "\0\256+\0\256+\0\256+\0W\32\0z&\0z&\0z&\0z&\0\2415\0\2415\0\2415\0\0\0\0" - "\243\210\0\243\210\0IC\0\0\0\0\261\251\0\261\251\0\261\251\0\261\251\0\261" - "\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\261\251\0\264\360" - "\0\264\360\0\264\360\0\0\0\0e\317\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1" - "\0\211\1\0c\0\0\2\0\0c\0\0c\0\0k\0\0\12\0\0k\1\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\264\360\0\264\360" - "\0\264\360\0\264\360\0\0\0\0e\317\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216\1" - "\0c\0\0\2\0\0c\0\0k\0\0q\0\0\20\0\0\0\0\0\0\0\0\322\1\0\322\1\0\322\1\0\322" - "\1\0\346\1\0\346\1\0\0\0\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0" - "\363\2\0\0\0\0\0\0\0\322!\0\322!\0\322!\0\322!\0\371(\0\371(\0\0\0\0\0\0" - "\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\0\0\0\0\0\0\325\215\0\325\215" - "\0\325\215\0\325\215\0\374\264\0\374\264\0\0\0\0\0\0\0\325\251\0\325\251" - "\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\0\0\0\0\0" - "\0\264\360\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\211\1\0\216" - "\1\0c\0\0\2\0\0f\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\322\1\0\322\1\0\346" - "\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2\0\363\2\0\363\2" - "\0\363\2\0\0\0\0\322\3\0\322\3\0\322!\0\322!\0\371(\0\371(\0\371(\0\0\0\0" - "\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\3227\0\3227\0\325" - "\215\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0\325\251\0" - "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" - "\251\0\330\360\0\330\360\0\0\0\0\264\360\0\264\360\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\216\1\0\216\1\0c\0\0\10\0\0m\0\0m\0\0\0\0\0\325\3\0\325\3\0\325" - "\3\0\322\1\0\346\1\0\346\1\0\346\1\0\0\0\0\322\2\0\322\2\0\322\2\0\322\2" - "\0\363\2\0\363\2\0\363\2\0\0\0\0\322\3\0\322\3\0\322\3\0\322!\0\371(\0\371" - "(\0\371(\0\0\0\0\322+\0\322+\0\322+\0\322+\0\3719\0\3719\0\3719\0\0\0\0\322" - "7\0\3227\0\3227\0\325\215\0\374\264\0\374\264\0\374\264\0\0\0\0\325\251\0" - "\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325\251\0\325" - "\251\0\325\251\0\325\251\0\330\360\0\330\360\0\330\360\0\0\0\0\264\360\0" - "\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\216\1\0i\0\0\10\0\0m\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\275\1\0\275\1\0\275\1\0" - "\275\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\244!\0\244!\0\244!\0\244!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\213n\0\213n\0\213n\0\213n\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0\330" - "\360\0\0\0\0\264\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\216\1\0\224\1\0i\0\0\10\0" - "\0\0\0\0\0\0\0\325\3\0\325\3\0\325\3\0\351\3\0\365\1\0\365\1\0\14\0\0\313" - "\2\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" - "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0\304-\0Y!\0Y!\0\0\0\0\0\0\0\371p\0" - "\371p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0" - "3(\0\247\227\0\211" - "s\0\211s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\330\360\0\330\360\0\330\360\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0\0\224\1\0i\0\0\0\0\0\0\0\0\325\3\0\325" - "\3\0\325\3\0\17\2\0\"\2\0!\0\0\35\0\0#\2\0\342\4\0\342\4\0\0\0\0\371\37\0" - "\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775" - "\0\374%\0\304\34\0Y!\0\373C\0\373C\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371" - "p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\211s\0\375" - "\342\0\375\342\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0" - "\0\0\330\360\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\224\1\0\0\0" - "\0\0\0\0\325\3\0\325\3\0\325\3\0\344\5\0\"\2\0\"\2\0\200\0\0#\2\0\342\4\0" - "\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37" - "\0\371\37\0\3775\0\3775\0\3775\0\304\34\0\3732\0\3732\0Y!\0\0\0\0\371p\0" - "\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377" - "\256\0\247q\0\375\274\0\375\274\0\211s\0\0\0\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\330\360\0\330\360\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\12\0\0\0\0\0i\0\0\0\0\0\325\3\0\325\3\0\344\5\0\344\5" - "\0\"\2\0\36\1\0" - "4\2\0#\2\0\342\4\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0" - "\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\3732\0" - "\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371" - "p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0" - "\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\0\0\0\330\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0" - "\10\0\0\0\0\0\325\3\0\344\5\0\344\5\0\344\5\0\340\4\0\367\11\0\364\3\0#\2" - "\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371" - "\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\3732\0\3732\0\0\0\0\371p\0\371p" - "\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0" - "\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\12\0\0\10\0\0\0\0\0\0\0\0\17\2\0\17" - "\2\0\17\2\0\323\2\0\352\7\0\347\2\0\26\1\0\0\0\0\371\37\0\371\37\0\371\37" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0\0\0\0" - "7\36\0" - "6\25\0" - "" - "6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0" - "O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\12\0" - "\0\10\0\0\0\0\0\17\2\0\17\2\0\344\5\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0" - "\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\362\4\0\0\0\0/\26\0/\26\0" - "\3775\0$\21\0" - "7\36\0" - "7\36\0\3672\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0" - "\0\0\0\0\370A\0\0\0\0O>\0O>\0\377\256\0" - "3(\0VK\0VK\0\372\264\0\0\0\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\341\271\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\343\350\0\0\0\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\10\0\0\0\0" - "\0\17\2\0\17\2\0\17\2\0\15\1\0\352\7\0\352\7\0\347\2\0\0\0\0\371\37\0\371" - "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0/\26\0$\21\0" - "7\36" - "\0" - "7\36\0" - "6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0O>\0O>\0O>\0" - "3(\0VK\0VK\0VK\0\0\0\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\5\0\0\5\0\0\5\0\0\0\0\0\344\5\0\344\5\0\344\5\0\316\4\0\367" - "\11\0\367\11\0\364\3\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371" - "\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0" - "\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377" - "\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5" - "\0\0\5\0\0\5\0\0\17\2\0\344\5\0\344\5\0\316\4\0\345\11\0\367\11\0\364\3\0" - "\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37" - "\0\3775\0\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371" - "p\0\0\0\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q" - "\0\375\274\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\5\0\0\0\0\0\17\2" - "\0\344\5\0\344\5\0\15\1\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37\0\371\37\0" - "\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0\307)\0\376" - "G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371p\0\371p\0" - "\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0" - "\5\0\0\17\2\0\17\2\0\344\5\0\316\4\0$\6\0$\6\0#\2\0\0\0\0\371\37\0\371\37" - "\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0/\26\0/\26\0" - "\307)\0\376G\0[/\0Y!\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" - "p\0\371p\0\377\256\0O>\0O>\0\247q\0\375\274\0\211s\0\211s\0\0\0\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\5\0\0\24\2\0\17\2\0\17\2\0\316\4\0\345\11\0$\6\0#\2\0\0\0\0\371" - "\37\0\371\37\0\371\37\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0" - "\3775\0\3775\0\307)\0\376G\0\376G\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0" - "\0\371p\0\371p\0\371p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274" - "\0\375\274\0\375\274\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0" - "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0\0\24\2\0\24" - "\2\0\17\2\0\316\4\0\345\11\0\342\3\0#\2\0\0\0\0\371\37\0\371\37\0\371\37" - "\0\0\0\0\371\37\0\371\37\0\371\37\0\371\37\0\3775\0\3775\0\3775\0\307)\0" - "\376G\0\3732\0\3732\0\0\0\0\371p\0\371p\0\371p\0\0\0\0\371p\0\371p\0\371" - "p\0\371p\0\377\256\0\377\256\0\377\256\0\247q\0\375\274\0\375\274\0\375\274" - "\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\24\2\0\5\0\0\0\0\0\27\5\0\342\3\0\313" - "\1\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\371\37\0\0\0\0\0\0\0/\26\0" - "\3775\0\371\37\0\302\30\0\3716\0Y!\0#\14\0\0\0\0\371p\0\371p\0\0\0\0\0\0" - "\0\0\0\0\371p\0\0\0\0\0\0\0O>\0\377\256\0\371p\0\243I\0\371\224\0\211s\0" - "" - "3(\0\0\0\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360\0\374" - "\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0" - "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0\0\371" - "\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0\0\0\0" - "\0" - "6\25\0" - "6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374" - "\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\0\0\0\0\0\0\26\1\0\26\1\0\0\0\0\0\0" - "\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0/\26\0\0\0" - "\0\0\0\0" - "6\25\0" - "6\25\0\0\0\0\0\0\0\371p\0\371p\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0O>\0O>\0\0\0\0\0\0\0VK\0VK\0\0\0\0\0\0\0\374\360\0\374\360" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0" - "\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\17\2\0\17\2\0\16\0\0\0\0\0\26\1\0\26\1\0\26" - "\1\0\0\0\0\371\37\0\371\37\0\371\37\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0/\26\0" - "/\26\0.\17\0\0\0\0" - "6\25\0" - "6\25\0" - "6\25\0\0\0\0\371p\0\371p\0\371p\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0O>\0O>\0O>\0\0\0\0VK\0VK\0VK\0\0\0\0\374\360\0" - "\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\374\360\0\374\360" - "\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\16\0\0\16\0\0\14\0\0\14" - "\0\0#\2\0#\2\0\0\0\0\0\0\0\371\37\0\371\37\0\0\0\0\0\0\0\371\37\0\371\37" - "\0\371\37\0\371\37\0.\17\0.\17\0#\14\0#\14\0Y!\0Y!\0\0\0\0\0\0\0\371p\0\371" - "p\0\0\0\0\0\0\0\371p\0\371p\0\371p\0\371p\0O>\0O>\0" - "3(\0" - "3(\0\211s\0\211" - "s\0\0\0\0\0\0\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360\0\374\360" - "\0\374\360\0\374\360\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" - "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", -}; - -/** - * Returns the BlitBlendAll test image as SDL_Surface. - */ -SDL_Surface *SDLTest_ImageBlitBlendAll(void) -{ - SDL_Surface *surface = SDL_CreateSurfaceFrom( - SDLTest_imageBlitBlendAll.width, - SDLTest_imageBlitBlendAll.height, - SDL_PIXELFORMAT_RGB24, - (void *)SDLTest_imageBlitBlendAll.pixel_data, - SDLTest_imageBlitBlendAll.width * SDLTest_imageBlitBlendAll.bytes_per_pixel); - return surface; -} - /* GIMP RGBA C-Source image dump (face.c) */ static const SDLTest_SurfaceImage_t SDLTest_imageFace = { @@ -6257,672 +1719,6 @@ SDL_Surface *SDLTest_ImagePrimitives(void) return surface; } -/* GIMP RGB C-Source image dump (alpha.c) */ - -static const SDLTest_SurfaceImage_t SDLTest_imagePrimitivesBlend = { - 80, - 60, - 3, - "\260e\15\222\356/\37\313\15\36\330\17K\3745D\3471\0\20\0D\3502D\3502<\321" - ",\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0-\0\377\377" - "\377\377\377\377\311\324\311\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\0H\0\377\377\377\377\377\377\256\307\256\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\0c\0\377\377\377\377\377\377" - "\223\300\223\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\0~\0\377\377\377\377\377\377x\277x\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\0\231\0\377\377\377\377\377\377]\303]\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\0\264\0\377\377\377\377\377" - "\377B\316B\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\0" - "\317\0\377\377\377\377\377\377'\335'\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\0\352\0\377\377\377#\262\6\260d\15\260e\15\224\357" - "/&\262\6\34\300\5.\314\22\40\315\12[\3747M\332/\27\331\12\27\331\12K\374" - "5K\3745K\3745D\3471D\3471D\3471D\3471D\3471D\3502D\3502D\3502D\3502D\350" - "2D\3502D\3502D\3502D\3502D\3502\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377,\372\27\273\3465\327" - "Q.\260d\15\213\213\40\241\3601\200\366*=\265\13?\301\25s\375\265\14\177\252+\201\210\16\245\204" - "*\377\314U\312\\,\224'\11\260i\17\244\210\40\232\2211\331\353J\215\2351\377" - "\377\276\200\2521\200\2542\375\377\310u\2661t\2702t\2702\367\377\324\325" - "\355\305h\3021h\3042h\3042\377\377\377\377\377\377\364\377\336\335\364\323" - "\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346" - "\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377" - "\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\3342\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\27\331\12Y\316-h\3021\243\370Cg\230\15\230\224\"\245" - "\204*\377\314U\310J\21\327Q.\260b\21\245\2041\370\343N\230\2242\331\353J" - "\214\2402\377\377\276\200\2521\200\2542\375\377\310\317\344\266u\2661t\270" - "2\377\377\377\367\377\324\325\355\305h\3021h\3042h\3042h\3042\377\377\377" - "\377\377\377\364\377\336\335\364\323\335\364\323\335\364\323\335\364\323" - "\\\3202\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371" - "\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377\377\377" - "\377\377\377\377\377\377\377P\3342P\3342P\3342P\3342P\3342P\3342P\3342P\334" - "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377K\3745!\315\13d\304,p\270)\177\252+\23\13\6\232\2211\245\204" - "1\347\270O\377\277Y\324<\22\265V\24\377\330Q\244\210\40#(\13\230\224\"\331" - "\353Ju\211.\377\377\276\200\2521\210\273:\200\2542\375\377\310\20" - "3\6u\266" - "1t\2702\271\307\271\367\377\324\325\355\305\341\377\321h\3021h\3042\16L\7" - "h\3042\377\377\377\242\300\242\377\377\377\335\364\323\355\377\343\335\364" - "\323\335\364\323\14f\7\\\3202\\\3202>\250*\\\3202\377\377\377\377\377\377" - "\377\377\377\377\377\377$\231$\377\377\377\377\377\377s\303s\377\377\377" - "\346\371\342\376\377\372\346\371\342\346\371\342\40\257\37\346\371\342\346" - "\371\342\\\316\\\377\377\377\377\377\377\377\377\377\377\377\377P\3342\13" - "\262\7P\3342P\3342*\327%P\3342P\3342o\377Q\377\377\377\377\377\377$\352$" - "\377\377\377\377\377\377K\3745]\3749s\375<\212\373@\243\370C\274\363G\331" - "\353J\370\343N\377\330Q\377\314U\377\277Y\377\260\\\224(\11\260|\36\245\204" - "1\377\377\250\232\2211\230\224\"\215\2351\214\2402\377\377\276\312\332\250" - "\200\2521\200\2542\377\377\377\317\344\266u\2661t\2702t\2702\377\377\377" - "\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\3042h\3042\377\377" - "\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364\323\335\364" - "\323\335\364\323\335\364\323\\\3202\\\3202\\\3202\\\3202\\\3202\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\346\371\342\346\371\342" - "\346\371\342\346\371\342\346\371\342\346\371\342\346\371\342\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377P\3342P\3342" - "P\3342P\3342\377\377\377K\3745O\3321\\\3161h\3021t\2702~\254'\214\240%\377" - "\377\262\370\343N\377\330Q\262x1\277l1\312`1\327R.\260X\23\377\330Q\244\210" - "2\377\377\250\230\2242\377\377\262\215\2351\214\2402\377\377\377\312\332" - "\250\200\2521\200\2542\377\377\377\375\377\310\317\344\266u\2661t\2702t\270" - "2\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305h\3042h\304" - "2h\3042h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\\\3202\\\320" - "2\\\3202\\\3202\\\3202\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\346\371\342\346\371\342\346\371\342\346" - "\371\342\346\371\342\346\371\342\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377D\3471O\3321\21\7\11c\304+\367\377\324o\2520\200\252" - "1\214\2402\235\226'\377\377\250\377\330Q!\20\11\277l1\310d2\266?\33\224(" - "\11\260|\36\257\217;\377\377\250\232\2211\34$\11\377\377\262\215\2351q\206" - "0\377\377\377\312\332\250\217\303@\200\2542\200\25420Z0\317\344\266\317\344" - "\266X\2260t\2702t\2702\377\377\377\377\377\377\325\355\305(l%\325\355\305" - "\325\355\305K\2410h\3042h\3042\377\377\377\377\377\377\377\377\3770\2200" - "\377\377\377\377\377\377t\274p\335\364\323\335\364\323\373\377\361\377\377" - "\377\377\377\377\21\213\11\\\3202\\\3202<\274/\\\3202\377\377\377\377\377" - "\377\377\377\377\377\377\3770\3060\377\377\377\377\377\377V\330V\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\3770\3410\346\371\342\346" - "\371\342>\352>\346\371\342\377\377\377D\3471P\3342\364\377\352s\375\3369\\\3202\377\377\377\377\377\377\377\377\377\377\377\377D\3502\371\377" - "\364O\3321\\\3202\364\377\336h\3042\367\377\324u\2661\200\2542\377\377\276" - "\215\2351\230\2242\307\300\213\244\2102\377\377\234\262x1\274p2\377\337\207" - "\312`1\324E\30\327T1\260|2\377\377\234\245\2041\244\2102\377\377\250\232" - "\2211\230\2242\377\377\377\310\316\231\215\2351\214\2402\377\377\377\377" - "\377\377\312\332\250\312\332\250\200\2542\200\2542\377\377\377\377\377\377" - "\317\344\266\317\344\266\317\344\266t\2702t\2702t\2702\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355" - "\305\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\335\364\323\335\364\323\335\364\323\335\364\323\377\377\377\377\377" - "\377\377\377\377\377\377\377\\\3202\\\3202\\\3202\377\377\377D\3502\371\377" - "\364O\3321\377\377\377\\\3161h\3042\367\377\324t\2702\375\377\310\200\252" - "1\377\377\377\215\2351\230\2242\377\377\250\244\2102\377\377\234\262x1\274" - "p2\316\214_\310d2\377\310|\327T1\227/\14\377\377\377\307\260|\244\2102\377" - "\377\377\307\300\213\230\2242\230\2242\377\377\377\310\316\231\214\2402\214" - "\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\2542\377" - "\377\377\377\377\377\377\377\377\317\344\266\317\344\266\317\344\266t\270" - "2t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377h\3042h\3042" - "h\3042\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323\335\364" - "\323\335\364\323\335\364\323\377\377\377\377\377\377\377\377\377\377\377" - "\377D\3502\371\377\364R\3344\364\377\352\\\3161H\22Hh\3021\377\377\377o\244" - "2\200\2542\312\332\250\226\245<\377\377\262\230\2242H-/\245\2041\377\377" - "\377\233i5\274p2\277l1\331sC\377\310|\324X2*\15\3\260|2\377\377\234\206s" - "7\244\2102\377\377\250\340\337\244\230\2242\377\377\377Hc2\310\316\231\214" - "\2402n\211:\377\377\377\377\377\377\353\377\311\312\332\250\200\2542$T\16" - "\377\377\377\377\377\377\236\277\236\377\377\377\317\344\266\367\377\336" - "\377\377\377t\2702\40n\16t\2702\377\377\377\212\303\212\377\377\377\377\377" - "\377\377\377\377\325\355\305\325\355\305<\2477\377\377\377\377\377\377O\276" - "Ah\3042h\3042\237\377i\377\377\377\377\377\377H\317H\377\377\377\377\377" - "\377c\335c\377\377\377\377\377\377\377\377\377\377\377\377\335\364\323>\337" - ";\335\364\323\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\364" - "\377\336h\3042\367\377\324t\2702\375\377\310\200\2542\377\377\276\214\240" - "2\377\377\262\232\2211\377\377\377\245\2041\377\377\377\262x1\377\377\377" - "\277l1\310d2\312`1\324X2\327T1\260|2\377\377\377\307\260|\244\2102\377\377" - "\377\307\300\213\232\2211\230\2242\377\377\377\377\377\262\310\316\231\214" - "\2402\214\2402\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200" - "\2542\200\2542\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266" - "\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\325\355" - "\305\377\377\377\377\377\377h\3042h\3042h\3042h\3042\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371\342\\\3202\335" - "\364\323h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377" - "\377\215\2351\377\377\377\232\2211\377\377\377\245\2041\377\377\377\262x" - "1\377\377\377\277l1\377\377\377\312`1\377\310|\327T1\227/\14\377\377\377" - "\307\260|\244\2102\244\2102\377\377\377\307\300\213\230\2242\230\2242\377" - "\377\377\310\316\231\310\316\231\214\2402\214\2402\377\377\377\377\377\377" - "\312\332\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377" - "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" - "\377t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\325\355\305\325\355\305\325\355\305\377\377" - "\377\377\377\377\377\377\377h\3042h\3042h\3042\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360" - "T\11TO\3321\377\377\377Z\3002\377\377\377h\3042\377\377\334t\2702\375\377" - "\310*\30\20\312\332\250\214\2402\262\260\214\230\2242\307\300\213\377\377" - "\377\245\2041\377\377\377:\35\20\377\377\377\277l1\316\264w\310d2\377\310" - "|\356qL\227/\14\260|2TZ3\307\260|\244\2102\274\302\274\307\300\213\307\300" - "\213\273\301U\377\377\377\377\377\377A^2\310\316\231\214\2402o\216B\377\377" - "\377\377\377\377\366\377\324\312\332\250\312\332\250*a\20\200\2542\377\377" - "\377\230\301\230\377\377\377\377\377\377\377\377\353\317\344\266\317\344" - "\266T\253Tt\2702t\2702]\265I\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377T\306T\377\377\377\325\355\305l\324i\325\355\305\377\377" - "\377\377\377\377\377\377\377h\3042\"\254\20h\3042h\3042b\353b\377\377\377" - "\377\377\377D\3502\362\375\360\377\377\377O\3321\377\377\377\\\3202\364\377" - "\336h\3042\325\355\305t\2702\317\344\266\377\377\377\200\2521\377\377\377" - "\214\2402\377\377\262\230\2242\307\300\213\244\2102\307\260|\377\377\377" - "\262x1\377\377\377\274p2\377\337\207\310d2\377\310|\324X2\333bB\260|2\377" - "\377\377\307\260|\244\2102\244\2102\377\377\377\307\300\213\232\2211\230" - "\2242\377\377\377\377\377\377\310\316\231\310\316\231\214\2402\214\2402\377" - "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\200\2542\200\254" - "2\200\2542\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" - "\344\266\317\344\266\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\325\355\305" - "\325\355\305\325\355\305\325\355\305\377\377\377\377\377\377\377\377\377" - "h\3042h\3042\377\377\377\377\377\377D\3471\377\377\377P\3342\364\377\352" - "\\\3202\335\364\323\377\377\377h\3021\377\377\377t\2702\375\377\310\200\254" - "2\312\332\250\377\377\377\215\2351\377\377\377\230\2242\377\377\250\244\210" - "2\307\260|\377\377\377\262x1\377\377\377\274p2\377\337\207\310d2\323xQ\324" - "X2\327T1\227/\14\260|2\377\377\234\307\260|\244\2102\377\377\377\377\377" - "\377\307\300\213\230\2242\230\2242\377\377\377\377\377\377\310\316\231\310" - "\316\231\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250" - "\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\317\344\266\317\344\266\377\377\377\377\377" - "\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\325\355\305\325\355\305\325" - "\355\305\377\377\377\377\377\377`\0`\377\377\377D\3471\371\366\371P\3342" - "\346\371\342\377\377\377\\\3161\377\377\377'\24\22\325\355\305t\2702\276" - "\310\251\377\377\377\200\2542\377\377\316\214\2402\310\316\231`6`\230\224" - "2\377\377\250\222u<\307\260|\377\377\377\315\214L\377\377\377\274p2M,#\310" - "d2\312`1\306\304\306\324X2\333bB\325\242W\377\377\377\307\260|=9\22\244\210" - "2\377\377\377\227\234w\307\300\213\230\2242\307\322a\377\377\377\377\377" - "\377Km9\310\316\231\214\2402r\226K\377\377\377\377\377\377\377\377\377\312" - "\332\250\312\332\250`\242`\200\2542\200\2542\224\306\224\377\377\377\377" - "\377\377\377\377\377\377\377\377\317\344\266M\250D\317\344\266\377\377\377" - "\203\322\203t\2702t\2702\301\377\177\377\377\377\377\377\377`\330`\377\377" - "\377\377\377\377r\344r\377\377\377\377\377\377\377\377\377\325\355\305\377" - "\377\377\377\377\377D\3502\371\377\364P\3342\346\371\342\377\377\377\\\320" - "2\364\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\200\2542\312" - "\332\250\377\377\377\214\2402\310\316\231\230\2242\307\300\213\377\377\377" - "\244\2102\307\260|\377\377\377\200U0\220^\377\7\4/\227U[\246]\377\255Q1\377" - "\242y\10\3/\306M@\6\4/{^\377mVvmVv\6\5/h\\\377h\\\377\\U\204\12\12\360\5" - "\5/VX\377VX\377\12\12\360LR\221\12\12\360\5\6/\214\2402\377\377\377\377\377" - "\377\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200" - "\2542\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344" - "\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377D\3502\362\375\360P\3342\346\371" - "\342\377\377\377\\\3202\335\364\323\377\377\377h\3042\367\377\324t\2702\317" - "\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402\377\377\262" - "\230\2242\307\300\213\377\377\377\244\2102\307\260|{^\377\200U0\220^\377" - "\7\4/\227U[\246]\377\7\3/\377\242y\236\37" - "2\306M0\210%\14T-2{^\377mVv\6" - "\5/\6\5/h\\\377\\U\204\\U\204\5\5/\5\5/VX\377VX\377LR\221LR\221\377\377\377" - "\214\2402\214\2402\377\377\377\377\377\377\377\377\377\312\332\250\312\332" - "\250\312\332\250\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317\344\266\377" - "\377\377\377\377\377t\2702t\2702t\2702\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377D\3502\365\375\363\377\377" - "\377O\3321l\22l\\\3202\335\364\323\357\346\357h\3042\325\355\305\377\377" - "\377t\2702\317\344\266l-l\200\2521\377\377\377\204\211=\310\316\231\377\377" - "\377\262\243L\307\300\213\377\377\377E&\25mVv{^\377ySB\220^\377\7\4/\275" - "t\201\246]\377\7\3/I\37!\277Z\377\10\3/\237YQ\6\4/{^\377\236\213\247mVv\6" - "\5/,-lh\\\377\\U\204dow\5\5/\5\5/\222\251\377VX\377\310\316\231T{@\377\377" - "\377\214\2402w\240V\377\377\377\377\377\377\377\377\377\377\377\377\312\332" - "\250U\231G\377\377\377\200\2542q\270\\\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377l\317l\317\344\266\317\344\266z\330v\377\377\377" - "\377\377\377\323\377\221t\2702t\2702l\352l\377\377\377\377\377\377\377\377" - "\377D\3502\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\364" - "\377\336h\3042\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200" - "\2542\312\332\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\307" - "\300\213\377\377\377\6\5/mVv{^\377\200U0\220^\377\7\4/\227U[\246]\377\7\3" - "/\255RN\277Z\377\10\3/\306M@\6\4/{^\377{^\377mVv\6\5/\6\5/h\\\377h\\\377" - "\\U\204\12\12\360\5\5/\12\12\360\377\377\377\377\377\377\310\316\231\310" - "\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377" - "\377\377\377\312\332\250\312\332\250\377\377\377\200\2542\200\2542\200\254" - "2\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\317\344\266\317\344\266\317\344\266\377\377\377\377\377\377t\2702t\2702" - "\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\3342\346\371\342" - "\377\377\377\\\3202\335\364\323\377\377\377h\3042\325\355\305\377\377\377" - "t\2702\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\214\2402" - "\310\316\231\377\377\377\230\2242\307\300\213h\\\377\6\5/mVv{^\377\200U0" - "\220^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{" - "^\377mVvmVv\6\5/\12\12\360h\\\377\\U\204\\U\204\5\5/\230\2242\377\377\377" - "\377\377\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214" - "\2402\377\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332" - "\250\377\377\377\377\377\377\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\317\344\266\317" - "\344\266\377\377\377\377\377\377\377\377\377\377\377\377D\3502q\10p\377\377" - "\377P\3342\335\350\332\377\377\377\\\3202\351\366\337\377\377\377h\3042d" - "!\\\377\377\377t\2702\277\302\252\377\377\377\200\2542\343\345\301\377\377" - "\377\214\2402^2H\377\377\377\230\2242\257\235\204h\\\377\6\5/\223o\234{^" - "\377\6\4/<\36" - "1\377\252\215j)2\211XK\377\250\203\202$2\337~c\377\242y\236" - "\37" - "2]#\26\306M@\6\4/ym\274{^\377mVvELn\6\5/h\\\37703x\\U\204\307\300\213" - "\204\226\\\230\2242\377\377\377\377\377\377\377\377\377\310\316\231^\212" - "H\377\377\377\214\2402}\256b\377\377\377\377\377\377\377\377\377\377\377" - "\377\312\332\250_\251O\377\377\377\377\377\377y\310j\200\2542\377\377\377" - "\377\377\377\377\377\377\377\377\377x\341x\377\377\377\377\377\377\177\350" - "|\317\344\266\377\377\377\377\377\377D\3502\362\375\360\377\377\377P\334" - "2\346\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\304" - "2\325\355\305\377\377\377t\2702\317\344\266\377\377\377\200\2542\312\332" - "\250\377\377\377\214\2402\310\316\231\377\377\377\230\2242\\U\204h\\\377" - "\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\255" - "RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377mVvmVv\6\5/\12\12\360h\\\377" - "\377\377\377\307\300\213\377\377\377\230\2242\230\2242\377\377\377\377\377" - "\377\377\377\377\310\316\231\310\316\231\377\377\377\214\2402\214\2402\377" - "\377\377\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\312" - "\332\250\377\377\377\200\2542\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377D\350" - "2\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377\377\377\\\320" - "2\335\364\323\377\377\377h\3042\325\355\305\377\377\377t\2702\317\344\266" - "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\214\2402\310\316" - "\231\377\377\377\5\5/\\U\204h\\\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220" - "^\377\7\4/\227U[\246]\377\7\3/\255RN\277Z\377\10\3/\306M@\6\4/\6\4/{^\377" - "\12\12\360mVv\6\5/\6\5/\377\377\377\377\377\377\307\300\213\307\300\213\377" - "\377\377\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" - "\231\310\316\231\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377" - "\377\377\200\2542\200\2542\377\377\377\377\377\377\377\377\377\377\377\377" - "\204\0\204\377\377\377D\3502\355\364\353\377\377\377\377\377\377Y\335;\346" - "\371\342\377\377\377/\26\31\335\364\323\377\377\377k\255<\325\355\305\377" - "\377\377\377\377\377t\2702\317\344\266\2046\204\200\2542\312\332\250\340" - "\317\340\214\2402\310\316\231\377\377\377VX\377\5\5//\33Dh\\\377\6\5/tVz" - "{^\377\6\4/=0\377\201Vi\220^\377\3\1\30\227U[\246]\377?6U\255RN\277Z\377" - "\337]s\306M0\306M@\3\2\30{^\377{^\377yv}mVv\244\2102\377\377\377\377\377" - "\377\377\377\377gyG\307\300\213\230\2242\212\242h\377\377\377\377\377\377" - "\377\377\377\377\377\377\310\316\231g\230O\377\377\377\214\2402\205\274q" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377h\270V\312\332" - "\250\377\377\377\222\344\222\200\2542\200\2542\377\377\377\377\377\377\377" - "\377\377\377\377\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346" - "\371\342\377\377\377\\\3202\335\364\323\377\377\377\377\377\377h\3042\325" - "\355\305\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" - "\332\250\377\377\377\214\2402\310\316\231VX\377\12\12\360\5\5/\\U\204h\\" - "\377\6\5/mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\246]\377\7\3" - "/\255RN\255RN\277Z\377\10\3/\306M@\6\4/\12\12\360{^\377\12\12\360\307\260" - "|\244\2102\244\2102\377\377\377\377\377\377\377\377\377\307\300\213\377\377" - "\377\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310" - "\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\312\332\250\312\332\250\377\377\377" - "\377\377\377\200\2542\200\2542\377\377\377\377\377\377D\3502\377\377\377" - "\362\375\360\377\377\377P\3342\346\371\342\377\377\377\\\3202\377\377\377" - "\335\364\323\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702" - "\317\344\266\377\377\377\200\2542\312\332\250\377\377\377\377\377\377\214" - "\2402LR\221VX\377\5\5/\\U\204\12\12\360h\\\377\6\5/mVv{^\377\6\4/\12\12\360" - "\201Vi\220^\377\7\4/\227U[\246]\377\7\3/\7\3/\255RN\277Z\377\10\3/\306M@" - "\6\4/\6\4/{^\377\377\377\377\307\260|\377\377\377\244\2102\377\377\377\377" - "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\377\377" - "\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231\377\377" - "\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\312\332\250\312\332\250\377\377\377\377\377\377\377" - "\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377\377-\17\34\346" - "\371\342\377\377\377\363\346\363\\\3202\335\364\323\377\377\377h\3042\377" - "\377\377x)o\377\377\377t\2702\301\276\255\377\377\377\377\377\377\243\273" - "U\312\332\250\377\377\377O-\34\12\12\360LR\221gU\333\5\5/\\U\204<)\377h\\" - "\377\6\5/=!B{^\377\6\4/A2\306\201Vi\220^\377I9q\227U[\246]\377]-\220\7\3" - "/\255RN\245q\304\10\3/\306M0\377\236\221\6\4/\377\377\377\220\231\220\307" - "\260|\307\260|\226\227m\244\2102\377\377\377\377\377\377\377\377\377\307" - "\300\213p\207N\230\2242\230\2242\254\316\254\377\377\377\377\377\377\377" - "\377\377\310\316\231\310\316\231\220\317\220\377\377\377\214\2402\216\316" - "\200\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377r\310^\312" - "\332\250\377\377\377\377\377\377\377\377\377D\3502\362\375\360\377\377\377" - "P\3342\377\377\377\346\371\342\377\377\377\\\3202\335\364\323\377\377\377" - "\377\377\377h\3042\325\355\305\377\377\377\377\377\377t\2702\317\344\266" - "\377\377\377\200\2542\377\377\377\312\332\250\377\377\377\5\6/LR\221\12\12" - "\360VX\377\5\5/\\U\204h\\\377\12\12\360\6\5/mVv{^\377\6\4/\12\12\360\201" - "Vi\220^\377\7\4/\227U[\12\12\360\246]\377\7\3/\255RN\277Z\377\277Z\377\10" - "\3/\306M@\260|2\260|2\377\377\377\377\377\377\307\260|\377\377\377\244\210" - "2\377\377\377\377\377\377\377\377\377\377\377\377\307\300\213\377\377\377" - "\230\2242\230\2242\377\377\377\377\377\377\377\377\377\377\377\377\310\316" - "\231\310\316\231\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377" - "\377\377D\3502\362\375\360\377\377\377P\3342\377\377\377\346\371\342\377" - "\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\325\355\305\377" - "\377\377\377\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312" - "\332\250\377\377\377\12\12\360\5\6/LR\221VX\377\12\12\360\5\5/\\U\204h\\" - "\377\6\5/\12\12\360mVv{^\377\6\4/\12\12\360\201Vi\220^\377\7\4/\227U[\227" - "U[\246]\377\7\3/\255RN\12\12\360\277Z\377\10\3/\333bB\377\377\377\260|2\377" - "\377\377\377\377\377\307\260|\307\260|\244\2102\244\2102\377\377\377\377" - "\377\377\377\377\377\307\300\213\307\300\213\377\377\377\230\2242\230\224" - "2\377\377\377\377\377\377\377\377\377\377\377\377\310\316\231\310\316\231" - "\377\377\377\377\377\377\214\2402\214\2402\377\377\377\377\377\377\377\377" - "\377\377\377\377\377\377\377\377\377\377)\10\36\362\375\360\377\377\377\370" - "\356\370P\3342\346\371\342\377\377\377\377\377\377\\\3202\207\"\201\377\377" - "\377\377\377\377p\250D\325\355\305\377\377\377\377\377\377t\2702\317\344" - "\266\234?\234\200\2542\377\377\377\274\260\244FS\377\5\6/;#\377LR\221VX\377" - "\3\1\34\12\12\360\\U\204{^\330\6\5/\12\12\360\257\203\270{^\377\6\4/\6\4" - "\222\201Vi\220^\377P@d\12\12\360\227U[\370\244\377\7\3/\255RNi./\277Z\377" - "\324X2\264\202w\333bB\260|2\377\377\377\377\377\377\377\377\377yvK\377\377" - "\377\244\2102\236\247|\377\377\377\377\377\377\377\377\377\307\300\213\307" - "\300\213\234\306\234\230\2242\377\377\377\256\330\256\377\377\377\377\377" - "\377\377\377\377\310\316\231\310\316\231\234\341\234\377\377\377\214\240" - "2\232\343\223\377\377\377\377\377\377\377\377\377\377\377\377D\3502\362\375" - "\360\377\377\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\" - "\3202\335\364\323\377\377\377\377\377\377h\3042\325\355\305\377\377\377\377" - "\377\377t\2702\317\344\266\377\377\377\377\377\377\200\2542\312\332\250\12" - "\12\360FS\377\5\6/LR\221\12\12\360RW\255\3\5\35\6\11\224ZT\\d[\261\3\4\35" - "\6\11\224lVTw]\264\4\4\35\6\11\224\200VN\214]\270\4\3\35\6\11\224\226UG\242" - "\\\274\4\3\35\4\3\35\254R@\377\377\311\203U\36\203U\36\323a:my\36my\36\377" - "\377\276\377\377\276\243\255X\243\255X\236\371\236e\204\36\236\371\236\374" - "\377\273\236\371\236\236\371\236\234\275`\236\371\236^\220\36^\220\36\236" - "\371\236\352\377\267\352\377\267\236\371\236\236\371\236\310\316\231\310" - "\316\231\377\377\377\377\377\377\214\2402\377\377\377\377\377\377\377\377" - "\377D\3502\362\375\360\377\377\377\377\377\377P\3342\346\371\342\377\377" - "\377\377\377\377\\\3202\377\377\377\335\364\323\377\377\377h\3042\377\377" - "\377\325\355\305\377\377\377t\2702\377\377\377\317\344\266\377\377\377\377" - "\377\377\200\2542\346\3\4\35lVT\4\4hw]\264\4\4\35aK\244\200VN\214]\270kZ\371\4\3\35" - "\270\212Io\225o\377\377\306{a\36\253\300\253\304wB\377\377\311\377\377\377" - "\203U\36\323a:\224D(my\36\236\371\236\307\316\266\377\377\276\236\371\236" - "\377\377\343\236\371\236e\204\36Gk\25\236\371\236\374\377\273\260\334\260" - "\236\371\236\234\275`\377\377\377\377\377\377\230\2242k\207#\377\377\377" - "\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377\377" - "\377\377\377\377P\3342\346\371\342\377\377\377\377\377\377\\\3202\377\377" - "\377\335\364\323\377\377\377\377\377\377h\3042\377\377\377\325\355\305\377" - "\377\377\377\377\377t\2702\317\344\266\377\377\3778L\377\12\12\360\5\6/<" - "L\237\12\12\360BR\252\3\5\35\6\11\224JQbRW\255\6\11\224\3\5\35ZT\\\6\11\224" - "d[\261\6\11\224\3\4\35lVT\6\11\224w]\264\4\4\35\6\11\224\200VN\214]\270\6" - "\11\224tm\36\270\212I\270\212I\377\377\306{a\36{a\36\304wB\236\371\236\377" - "\377\311\203U\36\236\371\236\323a:my\36my\36\236\371\236\377\377\276\236" - "\371\236\243\255X\243\255X\236\371\236e\204\36\236\371\236\374\377\273\374" - "\377\273\236\371\236\307\300\213\307\300\213\377\377\377\377\377\377\230" - "\2242\377\377\377\377\377\377\377\377\377D\3502\377\377\377\362\375\360\377" - "\377\377\377\377\377P\3342\377\377\377\346\371\342\377\377\377\377\377\377" - "\\\3202\335\364\323\377\377\377\377\377\377\377\377\377h\3042\325\355\305" - "\377\377\377\377\377\377t\2702\377\377\377\317\344\2668L\377\12\12\360\5" - "\6/\12\12\360= 0) { + ret = SDL_SetTextureBlendMode(src, (SDL_BlendMode)mode); + SDLTest_AssertPass("Call to SDL_SetTextureBlendMode()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetTextureBlendMode(..., %i), expected: 0, got: %i", mode, ret); + } else { + ret = SDL_SetTextureBlendMode(src, SDL_BLENDMODE_BLEND); + SDLTest_AssertPass("Call to SDL_SetTextureBlendMode()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetTextureBlendMode(..., %i), expected: 0, got: %i", mode, ret); + } + } else { + /* Set draw color */ + ret = SDL_SetRenderDrawColor(renderer, srcR, srcG, srcB, srcA); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetRenderDrawColor(), expected: 0, got: %i", ret); + + /* Set blend mode. */ + if (mode >= 0) { + ret = SDL_SetRenderDrawBlendMode(renderer, (SDL_BlendMode)mode); + SDLTest_AssertPass("Call to SDL_SetRenderDrawBlendMode()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetRenderDrawBlendMode(..., %i), expected: 0, got: %i", mode, ret); + } else { + ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); + SDLTest_AssertPass("Call to SDL_SetRenderDrawBlendMode()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetRenderDrawBlendMode(..., %i), expected: 0, got: %i", mode, ret); } } - SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount1); - SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderTexture, expected: 0, got: %i", checkFailCount2); - /* See if it's the same. */ - referenceSurface = SDLTest_ImageBlitAlpha(); - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - - /* Make current */ - SDL_RenderPresent(renderer); + /* Test blend mode. */ +#define FLOAT(X) ((float)X / 255.0f) + switch (mode) { + case -1: + mode_name = "color modulation"; + ret = SDL_SetTextureColorMod(src, srcR, srcG, srcB); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", ret); + expectedR = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcR) * FLOAT(srcR)) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcG) * FLOAT(srcG)) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcB) * FLOAT(srcB)) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcA) + FLOAT(dstA) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + break; + case -2: + mode_name = "alpha modulation"; + ret = SDL_SetTextureAlphaMod(src, srcA); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", ret); + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstR) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstG) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstB) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstA) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + break; + case SDL_BLENDMODE_NONE: + mode_name = "SDL_BLENDMODE_NONE"; + expectedR = srcR; + expectedG = srcG; + expectedB = srcB; + expectedA = SDL_ISPIXELFORMAT_ALPHA(dst_format) ? srcA : 255; + break; + case SDL_BLENDMODE_BLEND: + mode_name = "SDL_BLENDMODE_BLEND"; + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcA) + FLOAT(dstA) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + mode_name = "SDL_BLENDMODE_BLEND_PREMULTIPLIED"; + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcA) + FLOAT(dstA) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + break; + case SDL_BLENDMODE_ADD: + mode_name = "SDL_BLENDMODE_ADD"; + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(srcA) + FLOAT(dstR), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(srcA) + FLOAT(dstG), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(srcA) + FLOAT(dstB), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + case SDL_BLENDMODE_ADD_PREMULTIPLIED: + mode_name = "SDL_BLENDMODE_ADD_PREMULTIPLIED"; + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) + FLOAT(dstR), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) + FLOAT(dstG), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) + FLOAT(dstB), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + case SDL_BLENDMODE_MOD: + mode_name = "SDL_BLENDMODE_MOD"; + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(dstR), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(dstG), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(dstB), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + case SDL_BLENDMODE_MUL: + mode_name = "SDL_BLENDMODE_MUL"; + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(dstR) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(dstG) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(dstB) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + default: + SDLTest_LogError("Invalid blending mode: %d", mode); + return; + } - /* Clean up. */ - SDL_DestroyTexture(tface); - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; + switch (op) { + case TEST_RENDER_POINT: + operation = "render point"; + ret = SDL_RenderPoint(renderer, 0.0f, 0.0f); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_RenderPoint, expected: 0, got: %i", ret); + break; + case TEST_RENDER_LINE: + operation = "render line"; + ret = SDL_RenderLine(renderer, 0.0f, 0.0f, 2.0f, 2.0f); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_RenderLine, expected: 0, got: %i", ret); + break; + case TEST_RENDER_RECT: + operation = "render rect"; + ret = SDL_RenderFillRect(renderer, NULL); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_RenderFillRect, expected: 0, got: %i", ret); + break; + case TEST_RENDER_COPY_XRGB: + case TEST_RENDER_COPY_ARGB: + operation = (op == TEST_RENDER_COPY_XRGB) ? "render XRGB" : "render ARGB"; + ret = SDL_RenderTexture(renderer, src, NULL, NULL); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_RenderTexture, expected: 0, got: %i", ret); + break; + default: + SDLTest_LogError("Invalid blending operation: %d", op); + return; + } - return TEST_COMPLETED; + result = SDL_RenderReadPixels(renderer, NULL); + SDL_ReadSurfacePixel(result, 0, 0, &actualR, &actualG, &actualB, &actualA); + deltaR = SDL_abs((int)actualR - expectedR); + deltaG = SDL_abs((int)actualG - expectedG); + deltaB = SDL_abs((int)actualB - expectedB); + deltaA = SDL_abs((int)actualA - expectedA); + SDLTest_AssertCheck( + deltaR <= MAXIMUM_ERROR && + deltaG <= MAXIMUM_ERROR && + deltaB <= MAXIMUM_ERROR && + deltaA <= MAXIMUM_ERROR, + "Checking %s %s operation results, expected %d,%d,%d,%d, got %d,%d,%d,%d", + operation, mode_name, + expectedR, expectedG, expectedB, expectedA, actualR, actualG, actualB, actualA); + + /* Clean up */ + SDL_DestroySurface(result); + SDL_DestroyTexture(src); + SDL_DestroyTexture(dst); } -/** - * Tests a blend mode. - * - * \sa SDL_SetTextureBlendMode - * \sa SDL_RenderTexture - */ -static void -testBlitBlendMode(SDL_Texture *tface, int mode) +static void testBlendMode(int mode) { - int ret; - float tw, th; - float i, j, ni, nj; - SDL_FRect rect; - int checkFailCount1; - int checkFailCount2; - - /* Clear surface. */ - clearScreen(); - - /* Constant values. */ - CHECK_FUNC(SDL_GetTextureSize, (tface, &tw, &th)) - rect.w = tw; - rect.h = th; - ni = TESTRENDER_SCREEN_W - tw; - nj = TESTRENDER_SCREEN_H - th; + const TestRenderOperation operations[] = { + TEST_RENDER_POINT, + TEST_RENDER_LINE, + TEST_RENDER_RECT, + TEST_RENDER_COPY_XRGB, + TEST_RENDER_COPY_ARGB + }; + const SDL_PixelFormat dst_formats[] = { + SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888 + }; + int i, j; - /* Test blend mode. */ - checkFailCount1 = 0; - checkFailCount2 = 0; - for (j = 0; j <= nj; j += 4) { - for (i = 0; i <= ni; i += 4) { - /* Set blend mode. */ - ret = SDL_SetTextureBlendMode(tface, (SDL_BlendMode)mode); - if (ret != 0) { - checkFailCount1++; - } + for (i = 0; i < SDL_arraysize(operations); ++i) { + for (j = 0; j < SDL_arraysize(dst_formats); ++j) { + TestRenderOperation op = operations[i]; - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_RenderTexture(renderer, tface, NULL, &rect); - if (ret != 0) { - checkFailCount2++; + if (mode < 0) { + if (op != TEST_RENDER_COPY_XRGB && op != TEST_RENDER_COPY_ARGB) { + /* Unsupported mode for this operation */ + continue; + } } + testBlendModeOperation(op, mode, dst_formats[j]); } } - SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureBlendMode, expected: 0, got: %i", checkFailCount1); - SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_RenderTexture, expected: 0, got: %i", checkFailCount2); } /** - * Tests some more blitting routines. - * - * \sa SDL_SetTextureColorMod - * \sa SDL_SetTextureAlphaMod - * \sa SDL_SetTextureBlendMode - * \sa SDL_DestroyTexture + * Tests render operations with blend modes */ -static int render_testBlitBlend(void *arg) +static int render_testBlendModes(void *arg) { - int ret; - SDL_FRect rect; - SDL_Texture *tface; - SDL_Surface *referenceSurface = NULL; - float tw, th; - int i, j, ni, nj; - int mode; - int checkFailCount1; - int checkFailCount2; - int checkFailCount3; - int checkFailCount4; - - SDLTest_AssertCheck(hasBlendModes(), "_hasBlendModes"); - SDLTest_AssertCheck(hasTexColor(), "_hasTexColor"); - SDLTest_AssertCheck(hasTexAlpha(), "_hasTexAlpha"); - - /* Create face surface. */ - tface = loadTestFace(); - SDLTest_AssertCheck(tface != NULL, "Verify loadTestFace() result"); - if (tface == NULL) { - return TEST_ABORTED; - } - - /* Constant values. */ - CHECK_FUNC(SDL_GetTextureSize, (tface, &tw, &th)) - rect.w = tw; - rect.h = th; - ni = TESTRENDER_SCREEN_W - (int)tw; - nj = TESTRENDER_SCREEN_H - (int)th; - - /* Set alpha mod. */ - CHECK_FUNC(SDL_SetTextureAlphaMod, (tface, 100)) - - /* Test None. */ - testBlitBlendMode(tface, SDL_BLENDMODE_NONE); - referenceSurface = SDLTest_ImageBlitBlendNone(); - - /* Compare, then Present */ - compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; - - /* Test Blend. */ - testBlitBlendMode(tface, SDL_BLENDMODE_BLEND); - referenceSurface = SDLTest_ImageBlitBlend(); - - /* Compare, then Present */ - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; - - /* Test Blend Premultiplied. */ - testBlitBlendMode(tface, SDL_BLENDMODE_BLEND_PREMULTIPLIED); - referenceSurface = SDLTest_ImageBlitBlendPremultiplied(); - - /* Compare, then Present */ - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; - - /* Test Add. */ - testBlitBlendMode(tface, SDL_BLENDMODE_ADD); - referenceSurface = SDLTest_ImageBlitBlendAdd(); - - /* Compare, then Present */ - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; - - /* Test Add Premultiplied. */ - testBlitBlendMode(tface, SDL_BLENDMODE_ADD_PREMULTIPLIED); - referenceSurface = SDLTest_ImageBlitBlendAddPremultiplied(); - - /* Compare, then Present */ - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; - - /* Test Mod. */ - testBlitBlendMode(tface, SDL_BLENDMODE_MOD); - referenceSurface = SDLTest_ImageBlitBlendMod(); - - /* Compare, then Present */ - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; - - /* Clear surface. */ - clearScreen(); - - /* Loop blit. */ - checkFailCount1 = 0; - checkFailCount2 = 0; - checkFailCount3 = 0; - checkFailCount4 = 0; - for (j = 0; j <= nj; j += 4) { - for (i = 0; i <= ni; i += 4) { - - /* Set color mod. */ - ret = SDL_SetTextureColorMod(tface, (Uint8)((255 / nj) * j), (Uint8)((255 / ni) * i), (Uint8)((255 / nj) * j)); - if (ret != 0) { - checkFailCount1++; - } - - /* Set alpha mod. */ - ret = SDL_SetTextureAlphaMod(tface, (Uint8)((100 / ni) * i)); - if (ret != 0) { - checkFailCount2++; - } - - /* Crazy blending mode magic. */ - mode = (int)(i / 4 * j / 4) % 4; - if (mode == 0) { - mode = SDL_BLENDMODE_NONE; - } else if (mode == 1) { - mode = SDL_BLENDMODE_BLEND; - } else if (mode == 2) { - mode = SDL_BLENDMODE_ADD; - } else if (mode == 3) { - mode = SDL_BLENDMODE_MOD; - } - ret = SDL_SetTextureBlendMode(tface, (SDL_BlendMode)mode); - if (ret != 0) { - checkFailCount3++; - } - - /* Blitting. */ - rect.x = (float)i; - rect.y = (float)j; - ret = SDL_RenderTexture(renderer, tface, NULL, &rect); - if (ret != 0) { - checkFailCount4++; - } - } - } - SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_SetTextureColorMod, expected: 0, got: %i", checkFailCount1); - SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetTextureAlphaMod, expected: 0, got: %i", checkFailCount2); - SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetTextureBlendMode, expected: 0, got: %i", checkFailCount3); - SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_RenderTexture, expected: 0, got: %i", checkFailCount4); - - /* Clean up. */ - SDL_DestroyTexture(tface); - - /* Check to see if final image matches. */ - referenceSurface = SDLTest_ImageBlitBlendAll(); - compare(referenceSurface, ALLOWABLE_ERROR_BLENDED); - - /* Make current */ - SDL_RenderPresent(renderer); - - SDL_DestroySurface(referenceSurface); - referenceSurface = NULL; + testBlendMode(-1); + testBlendMode(-2); + testBlendMode(SDL_BLENDMODE_NONE); + testBlendMode(SDL_BLENDMODE_BLEND); + testBlendMode(SDL_BLENDMODE_BLEND_PREMULTIPLIED); + testBlendMode(SDL_BLENDMODE_ADD); + testBlendMode(SDL_BLENDMODE_ADD_PREMULTIPLIED); + testBlendMode(SDL_BLENDMODE_MOD); + testBlendMode(SDL_BLENDMODE_MUL); return TEST_COMPLETED; } @@ -1149,94 +966,6 @@ hasDrawColor(void) return 1; } -/** - * Test to see if we can vary the blend mode. Helper function. - * - * \sa SDL_SetRenderDrawBlendMode - * \sa SDL_GetRenderDrawBlendMode - */ -static int -hasBlendModes(void) -{ - int fail; - int ret; - SDL_BlendMode mode; - - fail = 0; - - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetRenderDrawBlendMode(renderer, &mode); - if (!isSupported(ret)) { - fail = 1; - } - ret = (mode != SDL_BLENDMODE_BLEND); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_BLEND_PREMULTIPLIED ); - if (!isSupported(ret)) - fail = 1; - ret = SDL_GetRenderDrawBlendMode(renderer, &mode ); - if (!isSupported(ret)) - fail = 1; - ret = (mode != SDL_BLENDMODE_BLEND_PREMULTIPLIED); - if (!isSupported(ret)) - fail = 1; - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetRenderDrawBlendMode(renderer, &mode); - if (!isSupported(ret)) { - fail = 1; - } - ret = (mode != SDL_BLENDMODE_ADD); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_ADD_PREMULTIPLIED); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetRenderDrawBlendMode(renderer, &mode); - if (!isSupported(ret)) { - fail = 1; - } - ret = (mode != SDL_BLENDMODE_ADD_PREMULTIPLIED); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_MOD); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetRenderDrawBlendMode(renderer, &mode); - if (!isSupported(ret)) { - fail = 1; - } - ret = (mode != SDL_BLENDMODE_MOD); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_SetRenderDrawBlendMode(renderer, SDL_BLENDMODE_NONE); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetRenderDrawBlendMode(renderer, &mode); - if (!isSupported(ret)) { - fail = 1; - } - ret = (mode != SDL_BLENDMODE_NONE); - if (!isSupported(ret)) { - fail = 1; - } - - return !fail; -} - /** * Loads the test image 'Face' as texture. Helper function. * @@ -1263,92 +992,6 @@ loadTestFace(void) return tface; } -/** - * Test to see if can set texture color mode. Helper function. - * - * \sa SDL_SetTextureColorMod - * \sa SDL_GetTextureColorMod - * \sa SDL_DestroyTexture - */ -static int -hasTexColor(void) -{ - int fail; - int ret; - SDL_Texture *tface; - Uint8 r, g, b; - - /* Get test face. */ - tface = loadTestFace(); - if (!tface) { - return 0; - } - - /* See if supported. */ - fail = 0; - ret = SDL_SetTextureColorMod(tface, 100, 100, 100); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetTextureColorMod(tface, &r, &g, &b); - if (!isSupported(ret)) { - fail = 1; - } - - /* Clean up. */ - SDL_DestroyTexture(tface); - - if (fail) { - return 0; - } else if ((r != 100) || (g != 100) || (b != 100)) { - return 0; - } - return 1; -} - -/** - * Test to see if we can vary the alpha of the texture. Helper function. - * - * \sa SDL_SetTextureAlphaMod - * \sa SDL_GetTextureAlphaMod - * \sa SDL_DestroyTexture - */ -static int -hasTexAlpha(void) -{ - int fail; - int ret; - SDL_Texture *tface; - Uint8 a; - - /* Get test face. */ - tface = loadTestFace(); - if (!tface) { - return 0; - } - - /* See if supported. */ - fail = 0; - ret = SDL_SetTextureAlphaMod(tface, 100); - if (!isSupported(ret)) { - fail = 1; - } - ret = SDL_GetTextureAlphaMod(tface, &a); - if (!isSupported(ret)) { - fail = 1; - } - - /* Clean up. */ - SDL_DestroyTexture(tface); - - if (fail) { - return 0; - } else if (a != 100) { - return 0; - } - return 1; -} - /** * Compares screen pixels with image pixels. Helper function. * @@ -1438,42 +1081,31 @@ static const SDLTest_TestCaseReference renderTest2 = { (SDLTest_TestCaseFp)render_testPrimitives, "render_testPrimitives", "Tests rendering primitives", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference renderTest3 = { - (SDLTest_TestCaseFp)render_testPrimitivesBlend, "render_testPrimitivesBlend", "Tests rendering primitives with blending", TEST_DISABLED + (SDLTest_TestCaseFp)render_testPrimitivesWithViewport, "render_testPrimitivesWithViewport", "Tests rendering primitives within a viewport", TEST_ENABLED }; static const SDLTest_TestCaseReference renderTest4 = { - (SDLTest_TestCaseFp)render_testPrimitivesWithViewport, "render_testPrimitivesWithViewport", "Tests rendering primitives within a viewport", TEST_ENABLED + (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED }; static const SDLTest_TestCaseReference renderTest5 = { - (SDLTest_TestCaseFp)render_testBlit, "render_testBlit", "Tests blitting", TEST_ENABLED + (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED }; static const SDLTest_TestCaseReference renderTest6 = { - (SDLTest_TestCaseFp)render_testBlitColor, "render_testBlitColor", "Tests blitting with color", TEST_ENABLED + (SDLTest_TestCaseFp)render_testBlendModes, "render_testBlendModes", "Tests rendering blend modes", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference renderTest7 = { - (SDLTest_TestCaseFp)render_testBlitAlpha, "render_testBlitAlpha", "Tests blitting with alpha", TEST_DISABLED -}; - -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ -static const SDLTest_TestCaseReference renderTest8 = { - (SDLTest_TestCaseFp)render_testBlitBlend, "render_testBlitBlend", "Tests blitting with blending", TEST_DISABLED -}; - -static const SDLTest_TestCaseReference renderTest9 = { (SDLTest_TestCaseFp)render_testViewport, "render_testViewport", "Tests viewport", TEST_ENABLED }; -static const SDLTest_TestCaseReference renderTest10 = { +static const SDLTest_TestCaseReference renderTest8 = { (SDLTest_TestCaseFp)render_testClipRect, "render_testClipRect", "Tests clip rect", TEST_ENABLED }; -static const SDLTest_TestCaseReference renderTest11 = { +static const SDLTest_TestCaseReference renderTest9 = { (SDLTest_TestCaseFp)render_testLogicalSize, "render_testLogicalSize", "Tests logical size", TEST_ENABLED }; @@ -1481,7 +1113,7 @@ static const SDLTest_TestCaseReference renderTest11 = { static const SDLTest_TestCaseReference *renderTests[] = { &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, &renderTest8, - &renderTest9, &renderTest10, &renderTest11, NULL + &renderTest9, NULL }; /* Render test suite (global) */ diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 39fd1676421e4..e4c9e2226ef40 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -69,141 +69,201 @@ static void surfaceTearDown(void *arg) } /** - * Helper that clears the test surface + * Helper that blits in a specific blend mode, -1 for color mod, -2 for alpha mod */ -static void clearTestSurface(void) +static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, SDL_PixelFormat dst_format) { + /* Allow up to 1 delta from theoretical value to account for rounding error */ + const int MAXIMUM_ERROR = 1; int ret; + SDL_Surface *src; + SDL_Surface *dst; + int checkFailCount1; + int checkFailCount2; + int checkFailCount3; Uint32 color; + Uint8 srcR = 10, srcG = 128, srcB = 240, srcA = 100; + Uint8 dstR = 128, dstG = 128, dstB = 128, dstA = 128; + Uint8 expectedR, expectedG, expectedB, expectedA; + Uint8 actualR, actualG, actualB, actualA; + int deltaR, deltaG, deltaB, deltaA; + + /* Create dst surface */ + dst = SDL_CreateSurface(1, 1, dst_format); + SDLTest_AssertCheck(dst != NULL, "Verify dst surface is not NULL"); + if (dst == NULL) { + return; + } /* Clear surface. */ - color = SDL_MapSurfaceRGBA(testSurface, 0, 0, 0, 0); + color = SDL_MapSurfaceRGBA(dst, dstR, dstG, dstB, dstA); SDLTest_AssertPass("Call to SDL_MapSurfaceRGBA()"); - ret = SDL_FillSurfaceRect(testSurface, NULL, color); + ret = SDL_FillSurfaceRect(dst, NULL, color); SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillSurfaceRect, expected: 0, got: %i", ret); -} - -/** - * Helper that blits in a specific blend mode, -1 for basic blitting, -2 for color mod, -3 for alpha mod, -4 for mixed blend modes. - */ -static void testBlitBlendMode(int mode) -{ - int ret; - int i, j, ni, nj; - SDL_Surface *face; - SDL_Rect rect; - int nmode; - SDL_BlendMode bmode; - int checkFailCount1; - int checkFailCount2; - int checkFailCount3; - int checkFailCount4; - - /* Check test surface */ - SDLTest_AssertCheck(testSurface != NULL, "Verify testSurface is not NULL"); - if (testSurface == NULL) { - return; - } + SDL_GetRGBA(color, SDL_GetPixelFormatDetails(dst->format), NULL, &dstR, &dstG, &dstB, &dstA); - /* Create sample surface */ - face = SDLTest_ImageFace(); - SDLTest_AssertCheck(face != NULL, "Verify face surface is not NULL"); - if (face == NULL) { + /* Create src surface */ + src = SDL_CreateSurface(1, 1, src_format); + SDLTest_AssertCheck(src != NULL, "Verify src surface is not NULL"); + if (src == NULL) { return; } /* Reset alpha modulation */ - ret = SDL_SetSurfaceAlphaMod(face, 255); + ret = SDL_SetSurfaceAlphaMod(src, 255); SDLTest_AssertPass("Call to SDL_SetSurfaceAlphaMod()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceAlphaMod(), expected: 0, got: %i", ret); /* Reset color modulation */ - ret = SDL_SetSurfaceColorMod(face, 255, 255, 255); + ret = SDL_SetSurfaceColorMod(src, 255, 255, 255); SDLTest_AssertPass("Call to SDL_SetSurfaceColorMod()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorMod(), expected: 0, got: %i", ret); /* Reset color key */ - ret = SDL_SetSurfaceColorKey(face, SDL_FALSE, 0); + ret = SDL_SetSurfaceColorKey(src, SDL_FALSE, 0); SDLTest_AssertPass("Call to SDL_SetSurfaceColorKey()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceColorKey(), expected: 0, got: %i", ret); - /* Clear the test surface */ - clearTestSurface(); - - /* Target rect size */ - rect.w = face->w; - rect.h = face->h; - - /* Steps to take */ - ni = testSurface->w - face->w; - nj = testSurface->h - face->h; + /* Clear surface. */ + color = SDL_MapSurfaceRGBA(src, srcR, srcG, srcB, srcA); + SDLTest_AssertPass("Call to SDL_MapSurfaceRGBA()"); + ret = SDL_FillSurfaceRect(src, NULL, color); + SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillSurfaceRect, expected: 0, got: %i", ret); + SDL_GetRGBA(color, SDL_GetPixelFormatDetails(src->format), NULL, &srcR, &srcG, &srcB, &srcA); - /* Optionally set blend mode. */ + /* Set blend mode. */ if (mode >= 0) { - ret = SDL_SetSurfaceBlendMode(face, (SDL_BlendMode)mode); + ret = SDL_SetSurfaceBlendMode(src, (SDL_BlendMode)mode); + SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret); + } else { + ret = SDL_SetSurfaceBlendMode(src, SDL_BLENDMODE_BLEND); SDLTest_AssertPass("Call to SDL_SetSurfaceBlendMode()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_SetSurfaceBlendMode(..., %i), expected: 0, got: %i", mode, ret); } /* Test blend mode. */ +#define FLOAT(X) ((float)X / 255.0f) checkFailCount1 = 0; checkFailCount2 = 0; checkFailCount3 = 0; - checkFailCount4 = 0; - for (j = 0; j <= nj; j += 4) { - for (i = 0; i <= ni; i += 4) { - if (mode == -2) { - /* Set color mod. */ - ret = SDL_SetSurfaceColorMod(face, (Uint8)((255 / nj) * j), (Uint8)((255 / ni) * i), (Uint8)((255 / nj) * j)); - if (ret != 0) { - checkFailCount2++; - } - } else if (mode == -3) { - /* Set alpha mod. */ - ret = SDL_SetSurfaceAlphaMod(face, (Uint8)((255 / ni) * i)); - if (ret != 0) { - checkFailCount3++; - } - } else if (mode == -4) { - /* Crazy blending mode magic. */ - nmode = (i / 4 * j / 4) % 4; - if (nmode == 0) { - bmode = SDL_BLENDMODE_NONE; - } else if (nmode == 1) { - bmode = SDL_BLENDMODE_BLEND; - } else if (nmode == 2) { - bmode = SDL_BLENDMODE_ADD; - } else if (nmode == 3) { - bmode = SDL_BLENDMODE_MOD; - } else { - /* Should be impossible, but some static checkers are too imprecise and will complain */ - SDLTest_LogError("Invalid: nmode=%d", nmode); - return; - } - ret = SDL_SetSurfaceBlendMode(face, bmode); - if (ret != 0) { - checkFailCount4++; - } - } - - /* Blitting. */ - rect.x = i; - rect.y = j; - ret = SDL_BlitSurface(face, NULL, testSurface, &rect); - if (ret != 0) { - checkFailCount1++; - } + switch (mode) { + case -1: + /* Set color mod. */ + ret = SDL_SetSurfaceColorMod(src, srcR, srcG, srcB); + if (ret != 0) { + checkFailCount2++; + } + expectedR = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcR) * FLOAT(srcR)) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcG) * FLOAT(srcG)) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcB) * FLOAT(srcB)) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcA) + FLOAT(dstA) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + break; + case -2: + /* Set alpha mod. */ + ret = SDL_SetSurfaceAlphaMod(src, srcA); + if (ret != 0) { + checkFailCount3++; } + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstR) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstG) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstB) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstA) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); + break; + case SDL_BLENDMODE_NONE: + expectedR = srcR; + expectedG = srcG; + expectedB = srcB; + expectedA = SDL_ISPIXELFORMAT_ALPHA(dst_format) ? srcA : 255; + break; + case SDL_BLENDMODE_BLEND: + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcA) + FLOAT(dstA) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + break; + case SDL_BLENDMODE_BLEND_PREMULTIPLIED: + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcA) + FLOAT(dstA) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + break; + case SDL_BLENDMODE_ADD: + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(srcA) + FLOAT(dstR), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(srcA) + FLOAT(dstG), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(srcA) + FLOAT(dstB), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + case SDL_BLENDMODE_ADD_PREMULTIPLIED: + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) + FLOAT(dstR), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) + FLOAT(dstG), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) + FLOAT(dstB), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + case SDL_BLENDMODE_MOD: + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(dstR), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(dstG), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(dstB), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + case SDL_BLENDMODE_MUL: + expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * FLOAT(dstR) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * FLOAT(dstG) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * FLOAT(dstB) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); + expectedA = dstA; + break; + default: + SDLTest_LogError("Invalid blending mode: %d", mode); + return; + } + + /* Blitting. */ + ret = SDL_BlitSurface(src, NULL, dst, NULL); + if (ret != 0) { + checkFailCount1++; } + SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1); SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2); SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3); - SDLTest_AssertCheck(checkFailCount4 == 0, "Validate results from calls to SDL_SetSurfaceBlendMode, expected: 0, got: %i", checkFailCount4); + + SDL_ReadSurfacePixel(dst, 0, 0, &actualR, &actualG, &actualB, &actualA); + deltaR = SDL_abs((int)actualR - expectedR); + deltaG = SDL_abs((int)actualG - expectedG); + deltaB = SDL_abs((int)actualB - expectedB); + deltaA = SDL_abs((int)actualA - expectedA); + SDLTest_AssertCheck( + deltaR <= MAXIMUM_ERROR && + deltaG <= MAXIMUM_ERROR && + deltaB <= MAXIMUM_ERROR && + deltaA <= MAXIMUM_ERROR, + "Checking %s -> %s blit results, expected %d,%d,%d,%d, got %d,%d,%d,%d", + SDL_GetPixelFormatName(src_format), + SDL_GetPixelFormatName(dst_format), + expectedR, expectedG, expectedB, expectedA, actualR, actualG, actualB, actualA); /* Clean up */ - SDL_DestroySurface(face); - face = NULL; + SDL_DestroySurface(src); + SDL_DestroySurface(dst); +} + +static void testBlitBlendMode(int mode) +{ + const SDL_PixelFormat src_formats[] = { + SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888 + }; + const SDL_PixelFormat dst_formats[] = { + SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888 + }; + int i, j; + + for (i = 0; i < SDL_arraysize(src_formats); ++i) { + for (j = 0; j < SDL_arraysize(dst_formats); ++j) { + testBlitBlendModeWithFormats(mode, src_formats[i], dst_formats[j]); + } + } } /* Helper to check that a file exists */ @@ -418,19 +478,8 @@ static int surface_testLoadFailure(void *arg) */ static int surface_testBlit(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Basic blitting */ - testBlitBlendMode(-1); - - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlit(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); + testBlitBlendMode(SDL_BLENDMODE_NONE); return TEST_COMPLETED; } @@ -440,19 +489,8 @@ static int surface_testBlit(void *arg) */ static int surface_testBlitColorMod(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Basic blitting with color mod */ - testBlitBlendMode(-2); - - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitColor(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); + testBlitBlendMode(-1); return TEST_COMPLETED; } @@ -462,41 +500,8 @@ static int surface_testBlitColorMod(void *arg) */ static int surface_testBlitAlphaMod(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Basic blitting with alpha mod */ - testBlitBlendMode(-3); - - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitAlpha(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); - - return TEST_COMPLETED; -} - -/** - * Tests some more blitting routines. - */ -static int surface_testBlitBlendNone(void *arg) -{ - int ret; - SDL_Surface *compareSurface; - - /* Basic blitting */ - testBlitBlendMode(SDL_BLENDMODE_NONE); - - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendNone(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); + testBlitBlendMode(-2); return TEST_COMPLETED; } @@ -506,20 +511,9 @@ static int surface_testBlitBlendNone(void *arg) */ static int surface_testBlitBlendBlend(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Blend blitting */ testBlitBlendMode(SDL_BLENDMODE_BLEND); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlend(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); - return TEST_COMPLETED; } @@ -528,20 +522,9 @@ static int surface_testBlitBlendBlend(void *arg) */ static int surface_testBlitBlendPremultiplied(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Blend premultiplied blitting */ testBlitBlendMode(SDL_BLENDMODE_BLEND_PREMULTIPLIED); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendPremultiplied(); - ret = SDLTest_CompareSurfaces( testSurface, compareSurface, 0 ); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); - return TEST_COMPLETED; } @@ -550,20 +533,9 @@ static int surface_testBlitBlendPremultiplied(void *arg) */ static int surface_testBlitBlendAdd(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Add blitting */ testBlitBlendMode(SDL_BLENDMODE_ADD); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendAdd(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); - return TEST_COMPLETED; } @@ -572,20 +544,9 @@ static int surface_testBlitBlendAdd(void *arg) */ static int surface_testBlitBlendAddPremultiplied(void *arg) { - int ret; - SDL_Surface *compareSurface; - - /* Add blitting */ + /* Add premultiplied blitting */ testBlitBlendMode(SDL_BLENDMODE_ADD_PREMULTIPLIED); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendAddPremultiplied(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); - return TEST_COMPLETED; } @@ -594,42 +555,19 @@ static int surface_testBlitBlendAddPremultiplied(void *arg) */ static int surface_testBlitBlendMod(void *arg) { - int ret; - SDL_Surface *compareSurface; - /* Mod blitting */ testBlitBlendMode(SDL_BLENDMODE_MOD); - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendMod(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); - return TEST_COMPLETED; } /** - * Tests some more blitting routines with loop + * Tests some more blitting routines. */ -static int surface_testBlitBlendLoop(void *arg) +static int surface_testBlitBlendMul(void *arg) { - - int ret; - SDL_Surface *compareSurface; - - /* All blitting modes */ - testBlitBlendMode(-4); - - /* Verify result by comparing surfaces */ - compareSurface = SDLTest_ImageBlitBlendAll(); - ret = SDLTest_CompareSurfaces(testSurface, compareSurface, 0); - SDLTest_AssertCheck(ret == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", ret); - - /* Clean up. */ - SDL_DestroySurface(compareSurface); + /* Mod blitting */ + testBlitBlendMode(SDL_BLENDMODE_MUL); return TEST_COMPLETED; } @@ -967,56 +905,47 @@ static const SDLTest_TestCaseReference surfaceTest2 = { }; static const SDLTest_TestCaseReference surfaceTest3 = { - (SDLTest_TestCaseFp)surface_testBlitBlendNone, "surface_testBlitBlendNone", "Tests blitting routines with none blending mode.", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED }; static const SDLTest_TestCaseReference surfaceTest4 = { - (SDLTest_TestCaseFp)surface_testLoadFailure, "surface_testLoadFailure", "Tests sprite loading. A failure case.", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED }; static const SDLTest_TestCaseReference surfaceTest5 = { - (SDLTest_TestCaseFp)surface_testSurfaceConversion, "surface_testSurfaceConversion", "Tests surface conversion.", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testCompleteSurfaceConversion, "surface_testCompleteSurfaceConversion", "Tests surface conversion across all pixel formats", TEST_ENABLED }; static const SDLTest_TestCaseReference surfaceTest6 = { - (SDLTest_TestCaseFp)surface_testCompleteSurfaceConversion, "surface_testCompleteSurfaceConversion", "Tests surface conversion across all pixel formats", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED }; static const SDLTest_TestCaseReference surfaceTest7 = { - (SDLTest_TestCaseFp)surface_testBlitColorMod, "surface_testBlitColorMod", "Tests some blitting routines with color mod.", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED }; static const SDLTest_TestCaseReference surfaceTest8 = { - (SDLTest_TestCaseFp)surface_testBlitAlphaMod, "surface_testBlitAlphaMod", "Tests some blitting routines with alpha mod.", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest9 = { - (SDLTest_TestCaseFp)surface_testBlitBlendLoop, "surface_testBlitBlendLoop", "Test blitting routines with various blending modes", TEST_DISABLED + (SDLTest_TestCaseFp)surface_testBlitBlendPremultiplied, "surface_testBlitBlendPremultiplied", "Tests blitting routines with premultiplied blending mode.", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest10 = { - (SDLTest_TestCaseFp)surface_testBlitBlendBlend, "surface_testBlitBlendBlend", "Tests blitting routines with blend blending mode.", TEST_DISABLED + (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest11 = { - (SDLTest_TestCaseFp)surface_testBlitBlendPremultiplied, "surface_testBlitBlendPremultiplied", "Tests blitting routines with premultiplied blending mode.", TEST_DISABLED + (SDLTest_TestCaseFp)surface_testBlitBlendAddPremultiplied, "surface_testBlitBlendAddPremultiplied", "Tests blitting routines with premultiplied add blending mode.", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest12 = { - (SDLTest_TestCaseFp)surface_testBlitBlendAdd, "surface_testBlitBlendAdd", "Tests blitting routines with add blending mode.", TEST_DISABLED + (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED }; -/* TODO: rewrite test case, define new test data and re-enable; current implementation fails */ static const SDLTest_TestCaseReference surfaceTest13 = { - (SDLTest_TestCaseFp)surface_testBlitBlendAddPremultiplied, "surface_testBlitBlendAddPremultiplied", "Tests blitting routines with premultiplied add blending mode.", TEST_DISABLED -}; - -static const SDLTest_TestCaseReference surfaceTest14 = { - (SDLTest_TestCaseFp)surface_testBlitBlendMod, "surface_testBlitBlendMod", "Tests blitting routines with mod blending mode.", TEST_ENABLED + (SDLTest_TestCaseFp)surface_testBlitBlendMul, "surface_testBlitBlendMul", "Tests blitting routines with mul blending mode.", TEST_ENABLED }; static const SDLTest_TestCaseReference surfaceTestOverflow = { @@ -1035,7 +964,7 @@ static const SDLTest_TestCaseReference surfaceTestPalette = { static const SDLTest_TestCaseReference *surfaceTests[] = { &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, - &surfaceTest11, &surfaceTest12, &surfaceTest13, &surfaceTest14, + &surfaceTest11, &surfaceTest12, &surfaceTest13, &surfaceTestOverflow, &surfaceTestFlip, &surfaceTestPalette, NULL }; From 492e3c1a5410a1ff5c877eb6605625b2ce643fd1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 06:25:56 -0700 Subject: [PATCH 321/431] direct3d11: we don't need to create all the blend states up front --- src/render/direct3d11/SDL_render_d3d11.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index cca1925d3ec5a..9990aecd1267e 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -787,11 +787,8 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) } /* Create blending states: */ - if (!D3D11_CreateBlendState(renderer, SDL_BLENDMODE_BLEND) || - !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_ADD) || - !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_MOD) || - !D3D11_CreateBlendState(renderer, SDL_BLENDMODE_MUL)) { - /* D3D11_CreateBlendMode will set the SDL error, if it fails */ + if (!D3D11_CreateBlendState(renderer, SDL_BLENDMODE_BLEND)) { + /* D3D11_CreateBlendState will set the SDL error, if it fails */ goto done; } From bf501ab2d4e34d009e03ece6b9205a1f6af87392 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 14:46:56 -0700 Subject: [PATCH 322/431] Made the SDL_BlendMode values wiki-friendly --- include/SDL3/SDL_blendmode.h | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/include/SDL3/SDL_blendmode.h b/include/SDL3/SDL_blendmode.h index 9f28ae42c91a6..f5af3dd3f89e3 100644 --- a/include/SDL3/SDL_blendmode.h +++ b/include/SDL3/SDL_blendmode.h @@ -51,25 +51,13 @@ extern "C" { */ typedef Uint32 SDL_BlendMode; -#define SDL_BLENDMODE_NONE 0x00000000u /**< no blending - dstRGBA = srcRGBA */ -#define SDL_BLENDMODE_BLEND 0x00000001u /**< alpha blending - dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) - dstA = srcA + (dstA * (1-srcA)) */ -#define SDL_BLENDMODE_BLEND_PREMULTIPLIED 0x00000010u /**< pre-multiplied alpha blending - dstRGBA = srcRGBA + (dstRGBA * (1-srcA)) */ -#define SDL_BLENDMODE_ADD 0x00000002u /**< additive blending - dstRGB = (srcRGB * srcA) + dstRGB - dstA = dstA */ -#define SDL_BLENDMODE_ADD_PREMULTIPLIED 0x00000020u /**< pre-multiplied additive blending - dstRGB = srcRGB + dstRGB - dstA = dstA */ -#define SDL_BLENDMODE_MOD 0x00000004u /**< color modulate - dstRGB = srcRGB * dstRGB - dstA = dstA */ -#define SDL_BLENDMODE_MUL 0x00000008u /**< color multiply - dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) - dstA = dstA */ +#define SDL_BLENDMODE_NONE 0x00000000u /**< no blending: dstRGBA = srcRGBA */ +#define SDL_BLENDMODE_BLEND 0x00000001u /**< alpha blending: dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)), dstA = srcA + (dstA * (1-srcA)) */ +#define SDL_BLENDMODE_BLEND_PREMULTIPLIED 0x00000010u /**< pre-multiplied alpha blending: dstRGBA = srcRGBA + (dstRGBA * (1-srcA)) */ +#define SDL_BLENDMODE_ADD 0x00000002u /**< additive blending: dstRGB = (srcRGB * srcA) + dstRGB, dstA = dstA */ +#define SDL_BLENDMODE_ADD_PREMULTIPLIED 0x00000020u /**< pre-multiplied additive blending: dstRGB = srcRGB + dstRGB, dstA = dstA */ +#define SDL_BLENDMODE_MOD 0x00000004u /**< color modulate: dstRGB = srcRGB * dstRGB, dstA = dstA */ +#define SDL_BLENDMODE_MUL 0x00000008u /**< color multiply: dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)), dstA = dstA */ #define SDL_BLENDMODE_INVALID 0x7FFFFFFFu /** From 70c8fe61d78c9612c9eafda50fc65addeaba6f22 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 15:00:09 -0700 Subject: [PATCH 323/431] Align SDL_BLENDMODE_INVALID with the other constants --- include/SDL3/SDL_blendmode.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_blendmode.h b/include/SDL3/SDL_blendmode.h index f5af3dd3f89e3..76aa19732c637 100644 --- a/include/SDL3/SDL_blendmode.h +++ b/include/SDL3/SDL_blendmode.h @@ -58,7 +58,7 @@ typedef Uint32 SDL_BlendMode; #define SDL_BLENDMODE_ADD_PREMULTIPLIED 0x00000020u /**< pre-multiplied additive blending: dstRGB = srcRGB + dstRGB, dstA = dstA */ #define SDL_BLENDMODE_MOD 0x00000004u /**< color modulate: dstRGB = srcRGB * dstRGB, dstA = dstA */ #define SDL_BLENDMODE_MUL 0x00000008u /**< color multiply: dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)), dstA = dstA */ -#define SDL_BLENDMODE_INVALID 0x7FFFFFFFu +#define SDL_BLENDMODE_INVALID 0x7FFFFFFFu /** * The blend operation used when combining source and destination pixel From e38f971f463d2a6c077ca558fe1ddf2ee50ff423 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Tue, 16 Jul 2024 01:05:47 +0700 Subject: [PATCH 324/431] Fix typos in cmake --- cmake/macros.cmake | 6 +++--- cmake/sdltargets.cmake | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/macros.cmake b/cmake/macros.cmake index 656f4e0907182..c250400b9850d 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -209,8 +209,8 @@ function(target_get_dynamic_library DEST TARGET) endforeach() else() # 1. find the target library a file might be symbolic linking to - # 2. find all other files in the same folder that symolic link to it - # 3. sort all these files, and select the 1st item on Linux, and last on Macos + # 2. find all other files in the same folder that symbolic link to it + # 3. sort all these files, and select the 1st item on Linux, and last on macOS set(location_properties IMPORTED_LOCATION) if(CMAKE_BUILD_TYPE) list(APPEND location_properties IMPORTED_LOCATION_${CMAKE_BUILD_TYPE}) @@ -226,7 +226,7 @@ function(target_get_dynamic_library DEST TARGET) foreach(location_property ${location_properties}) if(NOT result) get_target_property(library_path "${TARGET}" ${location_property}) - message(DEBUG "get_target_property(${TARGET} ${location_propert}) -> ${library_path}") + message(DEBUG "get_target_property(${TARGET} ${location_property}) -> ${library_path}") if(EXISTS "${library_path}") get_filename_component(library_path "${library_path}" ABSOLUTE) while (IS_SYMLINK "${library_path}") diff --git a/cmake/sdltargets.cmake b/cmake/sdltargets.cmake index d4fe913753c15..e4a870db5e8ae 100644 --- a/cmake/sdltargets.cmake +++ b/cmake/sdltargets.cmake @@ -28,7 +28,7 @@ function(sdl_sources) set_property(TARGET SDL3-collector APPEND PROPERTY INTERFACE_SOURCES ${ARGS_SHARED} ${ARGS_STATIC} ${ARGS_UNPARSED_ARGUMENTS}) endfunction() -# Use sdl_generic_link_dependency to describe a private depency of SDL3. All options are optional. +# Use sdl_generic_link_dependency to describe a private dependency of SDL3. All options are optional. # Users should use sdl_link_dependency and sdl_test_link_dependency instead # - SHARED_TARGETS: shared targets to add this dependency to # - STATIC_TARGETS: static targets to add this dependency to @@ -133,7 +133,7 @@ function(sdl_compile_options) endif() endfunction() -# Use sdl_link_dependency to add incude directories to the SDL3 libraries. +# Use sdl_link_dependency to add include directories to the SDL3 libraries. function(sdl_include_directories) cmake_parse_arguments(ARGS "SYSTEM;BEFORE;AFTER;PRIVATE;PUBLIC;INTERFACE;NO_EXPORT" "" "" ${ARGN}) set(system "") From 54366181c30ae04d5ade1c40db6d5b85923eb9d0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 16:13:23 -0700 Subject: [PATCH 325/431] Rename functions in SDL_system.h to match SDL 3.0 naming convention Fixes https://github.com/libsdl-org/SDL/issues/10277 --- build-scripts/SDL_migration.cocci | 61 ++++++++++++++++++++-- docs/README-android.md | 8 +-- docs/README-gdk.md | 4 +- docs/README-ios.md | 6 +-- docs/README-migration.md | 25 ++++++--- docs/README-winrt.md | 2 +- include/SDL3/SDL_oldnames.h | 34 ++++++++++-- include/SDL3/SDL_system.h | 52 +++++++++--------- src/core/SDL_core_unsupported.c | 44 ++++++++-------- src/core/android/SDL_android.c | 14 ++--- src/core/gdk/SDL_gdk.cpp | 4 +- src/core/linux/SDL_threadprio.c | 4 +- src/core/winrt/SDL_winrtapp_common.cpp | 2 +- src/dynapi/SDL_dynapi.sym | 30 +++++------ src/dynapi/SDL_dynapi_overrides.h | 30 +++++------ src/dynapi/SDL_dynapi_procs.h | 30 +++++------ src/file/SDL_iostream.c | 2 +- src/filesystem/android/SDL_sysfilesystem.c | 2 +- src/filesystem/gdk/SDL_sysfilesystem.cpp | 2 +- src/filesystem/winrt/SDL_sysfilesystem.cpp | 10 ++-- src/joystick/SDL_gamepad.c | 2 +- src/main/gdk/SDL_sysmain_runapp.cpp | 2 +- src/render/direct3d/SDL_render_d3d.c | 2 +- src/test/SDL_test_common.c | 2 +- src/thread/pthread/SDL_systhread.c | 2 +- src/video/SDL_video_unsupported.c | 20 +++---- src/video/gdk/SDL_gdktextinput.cpp | 2 +- src/video/uikit/SDL_uikitappdelegate.m | 4 +- src/video/uikit/SDL_uikitevents.m | 2 +- src/video/uikit/SDL_uikitwindow.m | 2 +- src/video/windows/SDL_windowsvideo.c | 2 +- src/video/winrt/SDL_winrtkeyboard.cpp | 2 +- 32 files changed, 252 insertions(+), 158 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 1be44696018b7..88833085942fc 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3134,17 +3134,17 @@ typedef SDL_Colour, SDL_Color; @@ @@ - SDL_WinRTGetFSPathUTF8 -+ SDL_WinRTGetFSPath ++ SDL_GetWinRTFSPath (...) @@ @@ - SDL_iPhoneSetAnimationCallback -+ SDL_iOSSetAnimationCallback ++ SDL_SetiOSAnimationCallback (...) @@ @@ - SDL_iPhoneSetEventPump -+ SDL_iOSSetEventPump ++ SDL_SetiOSEventPump (...) @@ @@ @@ -3501,3 +3501,58 @@ typedef SDL_Colour, SDL_Color; - SDL_GL_DeleteContext + SDL_GL_DestroyContext (...) +@@ +@@ +- SDL_AndroidGetActivity ++ SDL_GetAndroidActivity + (...) +@@ +@@ +- SDL_AndroidGetExternalStoragePath ++ SDL_GetAndroidExternalStoragePath + (...) +@@ +@@ +- SDL_AndroidGetExternalStorageState ++ SDL_GetAndroidExternalStorageState + (...) +@@ +@@ +- SDL_AndroidGetInternalStoragePath ++ SDL_GetAndroidInternalStoragePath + (...) +@@ +@@ +- SDL_AndroidGetJNIEnv ++ SDL_GetAndroidJNIEnv + (...) +@@ +@@ +- SDL_Direct3D9GetAdapterIndex ++ SDL_GetDirect3D9AdapterIndex + (...) +@@ +@@ +- SDL_GDKGetDefaultUser ++ SDL_GetGDKDefaultUser + (...) +@@ +@@ +- SDL_GDKGetTaskQueue ++ SDL_GetGDKTaskQueue + (...) +@@ +@@ +- SDL_WinRTGetDeviceFamily ++ SDL_GetWinRTDeviceFamily + (...) +@@ +@@ +- SDL_LinuxSetThreadPriority ++ SDL_SetLinuxThreadPriority + (...) +@@ +@@ +- SDL_LinuxSetThreadPriorityAndPolicy ++ SDL_SetLinuxThreadPriorityAndPolicy + (...) diff --git a/docs/README-android.md b/docs/README-android.md index 9eb8ec8de0808..6d6e2e06d4d0a 100644 --- a/docs/README-android.md +++ b/docs/README-android.md @@ -169,10 +169,10 @@ them using the standard functions in SDL_iostream.h. There are also a few Android specific functions that allow you to get other useful paths for saving and loading data: -* SDL_AndroidGetInternalStoragePath() -* SDL_AndroidGetExternalStorageState() -* SDL_AndroidGetExternalStoragePath() -* SDL_AndroidGetCachePath() +* SDL_GetAndroidInternalStoragePath() +* SDL_GetAndroidExternalStorageState() +* SDL_GetAndroidExternalStoragePath() +* SDL_GetAndroidCachePath() See SDL_system.h for more details on these functions. diff --git a/docs/README-gdk.md b/docs/README-gdk.md index fc9797c0ba54d..acba7bc3cce82 100644 --- a/docs/README-gdk.md +++ b/docs/README-gdk.md @@ -28,10 +28,10 @@ The Windows GDK port supports the full set of Win32 APIs, renderers, controllers * An implementation on `WinMain` that performs the above GDK setup that you can use by #include'ing SDL_main.h in the source file that includes your standard main() function. If you are unable to do this, you can instead manually call `SDL_RunApp` from your entry point, passing in your `SDL_main` function and `NULL` as the parameters. To use `SDL_RunApp`, `#define SDL_MAIN_HANDLED` before `#include `. * Global task queue callbacks are dispatched during `SDL_PumpEvents` (which is also called internally if using `SDL_PollEvent`). - * You can get the handle of the global task queue through `SDL_GDKGetTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak). + * You can get the handle of the global task queue through `SDL_GetGDKTaskQueue`, if needed. When done with the queue, be sure to use `XTaskQueueCloseHandle` to decrement the reference count (otherwise it will cause a resource leak). * Single-player games have some additional features available: - * Call `SDL_GDKGetDefaultUser` to get the default XUserHandle pointer. + * Call `SDL_GetGDKDefaultUser` to get the default XUserHandle pointer. * `SDL_GetPrefPath` still works, but only for single-player titles. These functions mostly wrap around async APIs, and thus should be treated as synchronous alternatives. Also note that the single-player functions return on any OS errors, so be sure to validate the return values! diff --git a/docs/README-ios.md b/docs/README-ios.md index d2838acf4f7ae..8b6e0edfb5d6b 100644 --- a/docs/README-ios.md +++ b/docs/README-ios.md @@ -225,7 +225,7 @@ Game Center Game Center integration might require that you break up your main loop in order to yield control back to the system. In other words, instead of running an endless main loop, you run each frame in a callback function, using: - int SDL_iOSSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); + int SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); This will set up the given function to be called back on the animation callback, and then you have to return from main() to let the Cocoa event loop run. @@ -247,7 +247,7 @@ e.g. // Set up the game to run in the window animation callback on iOS // so that Game Center and so forth works correctly. - SDL_iOSSetAnimationCallback(window, 1, ShowFrame, NULL); + SDL_SetiOSAnimationCallback(window, 1, ShowFrame, NULL); #else while ( running ) { ShowFrame(0); @@ -258,7 +258,7 @@ e.g. } -Note that if you are using main callbacks instead of a standard C main() function, your SDL_AppIterate() callback is already doing this and you don't need to use SDL_iOSSetAnimationCallback. +Note that if you are using main callbacks instead of a standard C main() function, your SDL_AppIterate() callback is already doing this and you don't need to use SDL_SetiOSAnimationCallback. Deploying to older versions of iOS diff --git a/docs/README-migration.md b/docs/README-migration.md index fb52626e583e6..571f094546117 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1748,23 +1748,36 @@ The following symbols have been renamed: SDL_WindowsMessageHook has changed signatures so the message may be modified and it can block further message processing. -SDL_AndroidGetExternalStorageState() takes the state as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error. +SDL_GetAndroidExternalStorageState() takes the state as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error. SDL_AndroidRequestPermission is no longer a blocking call; the caller now provides a callback function that fires when a response is available. -SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_iOSSetAnimationCallback() and SDL_iOSSetEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option. +SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_SetiOSAnimationCallback() and SDL_SetiOSEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option. The following functions have been removed: * SDL_RenderGetD3D11Device() - replaced with the "SDL.renderer.d3d11.device" property * SDL_RenderGetD3D12Device() - replaced with the "SDL.renderer.d3d12.device" property * SDL_RenderGetD3D9Device() - replaced with the "SDL.renderer.d3d9.device" property -* SDL_WinRTGetFSPathUNICODE() - Use SDL_WinRTGetFSPath() and SDL_iconv_string to convert from UTF-8 to UTF-16. +* SDL_GetWinRTFSPathUNICODE() - Use SDL_GetWinRTFSPath() and SDL_iconv_string to convert from UTF-8 to UTF-16. The following functions have been renamed: -* SDL_WinRTGetFSPathUTF8() => SDL_WinRTGetFSPath() -* SDL_iPhoneSetAnimationCallback() => SDL_iOSSetAnimationCallback() -* SDL_iPhoneSetEventPump() => SDL_iOSSetEventPump() +* SDL_AndroidGetActivity() => SDL_GetAndroidActivity() +* SDL_AndroidGetExternalStoragePath() => SDL_GetAndroidExternalStoragePath() +* SDL_AndroidGetExternalStorageState() => SDL_GetAndroidExternalStorageState() +* SDL_AndroidGetInternalStoragePath() => SDL_GetAndroidInternalStoragePath() +* SDL_AndroidGetJNIEnv() => SDL_GetAndroidJNIEnv() +* SDL_Direct3D9GetAdapterIndex() => SDL_GetDirect3D9AdapterIndex() +* SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser() +* SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue() +* SDL_LinuxSetThreadPriority() => SDL_SetLinuxThreadPriority() +* SDL_LinuxSetThreadPriorityAndPolicy() => SDL_SetLinuxThreadPriorityAndPolicy() +* SDL_WinRTGetDeviceFamily() => SDL_GetWinRTDeviceFamily() +* SDL_GetWinRTFSPathUTF8() => SDL_GetWinRTFSPath() +* SDL_iOSSetAnimationCallback() => SDL_SetiOSAnimationCallback() +* SDL_iOSSetEventPump() => SDL_SetiOSEventPump() +* SDL_iPhoneSetAnimationCallback() => SDL_SetiOSAnimationCallback() +* SDL_iPhoneSetEventPump() => SDL_SetiOSEventPump() ## SDL_syswm.h diff --git a/docs/README-winrt.md b/docs/README-winrt.md index 460dbc612e9cd..eb20ddad7e66f 100644 --- a/docs/README-winrt.md +++ b/docs/README-winrt.md @@ -129,7 +129,7 @@ SDL_GetPrefPath(), starting with SDL 2.0.4, addresses these by: (and which require less work to use safely, in terms of data integrity). Apps that wish to get their Roaming folder's path can do so either by using -SDL_WinRTGetFSPath(), or directly through the WinRT class, +SDL_GetWinRTFSPath(), or directly through the WinRT class, Windows.Storage.ApplicationData. diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 0dfc9826fce14..d6717d95f79a3 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -599,9 +599,22 @@ #define SDL_UpperBlitScaled SDL_BlitSurfaceScaled /* ##SDL_system.h */ -#define SDL_WinRTGetFSPathUTF8 SDL_WinRTGetFSPath -#define SDL_iPhoneSetAnimationCallback SDL_iOSSetAnimationCallback -#define SDL_iPhoneSetEventPump SDL_iOSSetEventPump +#define SDL_AndroidGetActivity SDL_GetAndroidActivity +#define SDL_AndroidGetExternalStoragePath SDL_GetAndroidExternalStoragePath +#define SDL_AndroidGetExternalStorageState SDL_GetAndroidExternalStorageState +#define SDL_AndroidGetInternalStoragePath SDL_GetAndroidInternalStoragePath +#define SDL_AndroidGetJNIEnv SDL_GetAndroidJNIEnv +#define SDL_Direct3D9GetAdapterIndex SDL_GetDirect3D9AdapterIndex +#define SDL_GDKGetDefaultUser SDL_GetGDKDefaultUser +#define SDL_GDKGetTaskQueue SDL_GetGDKTaskQueue +#define SDL_LinuxSetThreadPriority SDL_SetLinuxThreadPriority +#define SDL_LinuxSetThreadPriorityAndPolicy SDL_SetLinuxThreadPriorityAndPolicy +#define SDL_WinRTGetDeviceFamily SDL_GetWinRTDeviceFamily +#define SDL_GetWinRTFSPathUTF8 SDL_GetWinRTFSPath +#define SDL_iOSSetAnimationCallback SDL_SetiOSAnimationCallback +#define SDL_iOSSetEventPump SDL_SetiOSEventPump +#define SDL_iPhoneSetAnimationCallback SDL_SetiOSAnimationCallback +#define SDL_iPhoneSetEventPump SDL_SetiOSEventPump /* ##SDL_thread.h */ #define SDL_TLSCleanup SDL_CleanupTLS @@ -1197,7 +1210,20 @@ #define SDL_UpperBlitScaled SDL_UpperBlitScaled_renamed_SDL_BlitSurfaceScaled /* ##SDL_system.h */ -#define SDL_WinRTGetFSPathUTF8 SDL_WinRTGetFSPathUTF8_renamed_SDL_WinRTGetFSPath +#define SDL_AndroidGetActivity SDL_AndroidGetActivity_renamed_SDL_GetAndroidActivity +#define SDL_AndroidGetExternalStoragePath SDL_AndroidGetExternalStoragePath_renamed_SDL_GetAndroidExternalStoragePath +#define SDL_AndroidGetExternalStorageState SDL_AndroidGetExternalStorageState_renamed_SDL_GetAndroidExternalStorageState +#define SDL_AndroidGetInternalStoragePath SDL_AndroidGetInternalStoragePath_renamed_SDL_GetAndroidInternalStoragePath +#define SDL_AndroidGetJNIEnv SDL_AndroidGetJNIEnv_renamed_SDL_GetAndroidJNIEnv +#define SDL_Direct3D9GetAdapterIndex SDL_Direct3D9GetAdapterIndex_renamed_SDL_GetDirect3D9AdapterIndex +#define SDL_GDKGetDefaultUser SDL_GDKGetDefaultUser_renamed_SDL_GetGDKDefaultUser +#define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_renamed_SDL_GetGDKTaskQueue +#define SDL_LinuxSetThreadPriority SDL_LinuxSetThreadPriority_renamed_SDL_SetLinuxThreadPriority +#define SDL_LinuxSetThreadPriorityAndPolicy SDL_LinuxSetThreadPriorityAndPolicy_renamed_SDL_SetLinuxThreadPriorityAndPolicy +#define SDL_WinRTGetDeviceFamily SDL_WinRTGetDeviceFamily_renamed_SDL_GetWinRTDeviceFamily +#define SDL_GetWinRTFSPathUTF8 SDL_GetWinRTFSPathUTF8_renamed_SDL_GetWinRTFSPath +#define SDL_iOSSetAnimationCallback SDL_iOSSetAnimationCallback_renamed_SDL_SetiOSAnimationCallback +#define SDL_iOSSetEventPump SDL_iOSSetEventPump_renamed_SDL_SetiOSEventPump #define SDL_iPhoneSetAnimationCallback SDL_iPhoneSetAnimationCallback_renamed_SDL_iOSSetAnimationCallback #define SDL_iPhoneSetEventPump SDL_iPhoneSetEventPump_renamed_SDL_iOSSetEventPump diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 01906d954f161..1a0bcc9698902 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -106,7 +106,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetWindowsMessageHook(SDL_WindowsMessageHoo * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID); +extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID); #endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */ @@ -166,7 +166,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); +extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); /** * Sets the priority (not nice level) and scheduling policy for a thread. @@ -182,7 +182,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); +extern SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); #endif /* SDL_PLATFORM_LINUX */ @@ -197,15 +197,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threa * This datatype is only useful on Apple iOS. * * After passing a function pointer of this type to - * SDL_iOSSetAnimationCallback, the system will call that function pointer at + * SDL_SetiOSAnimationCallback, the system will call that function pointer at * a regular interval. * * \param userdata what was passed as `callbackParam` to - * SDL_iOSSetAnimationCallback as `callbackParam`. + * SDL_SetiOSAnimationCallback as `callbackParam`. * * \since This datatype is available since SDL 3.0.0. * - * \sa SDL_iOSSetAnimationCallback + * \sa SDL_SetiOSAnimationCallback */ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); @@ -219,7 +219,7 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); * ``` * * Where its parameter, `callbackParam`, is what was passed as `callbackParam` - * to SDL_iOSSetAnimationCallback(). + * to SDL_SetiOSAnimationCallback(). * * This function is only available on Apple iOS. * @@ -244,9 +244,9 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_iOSSetEventPump + * \sa SDL_SetiOSEventPump */ -extern SDL_DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); +extern SDL_DECLSPEC int SDLCALL SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); /** * Use this function to enable or disable the SDL event pump on Apple iOS. @@ -257,9 +257,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window * window, * * \since This function is available since SDL 3.0.0. * - * \sa SDL_iOSSetAnimationCallback + * \sa SDL_SetiOSAnimationCallback */ -extern SDL_DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled); +extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled); #endif /* SDL_PLATFORM_IOS */ @@ -286,9 +286,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AndroidGetActivity + * \sa SDL_GetAndroidActivity */ -extern SDL_DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); +extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void); /** * Retrieve the Java instance of the Android activity class. @@ -310,9 +310,9 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AndroidGetJNIEnv(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AndroidGetJNIEnv + * \sa SDL_GetAndroidJNIEnv */ -extern SDL_DECLSPEC void * SDLCALL SDL_AndroidGetActivity(void); +extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidActivity(void); /** * Query Android API level of the current device. @@ -414,9 +414,9 @@ extern SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AndroidGetExternalStorageState + * \sa SDL_GetAndroidExternalStorageState */ -extern SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidInternalStoragePath(void); /** * Get the current state of external storage for this Android application. @@ -433,9 +433,9 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AndroidGetExternalStoragePath + * \sa SDL_GetAndroidExternalStoragePath */ -extern SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state); +extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidExternalStorageState(Uint32 *state); /** * Get the path used for external storage for this Android application. @@ -457,9 +457,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AndroidGetExternalStorageState + * \sa SDL_GetAndroidExternalStorageState */ -extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void); /** * Get the path used for caching data for this Android application. @@ -480,7 +480,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetExternalStoragePath(void) * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char * SDLCALL SDL_AndroidGetCachePath(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void); typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); @@ -636,7 +636,7 @@ typedef enum SDL_WinRT_DeviceFamily * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char * SDLCALL SDL_WinRTGetFSPath(SDL_WinRT_Path pathType); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetWinRTFSPath(SDL_WinRT_Path pathType); /** * Detects the device family of WinRT platform at runtime. @@ -645,7 +645,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_WinRTGetFSPath(SDL_WinRT_Path pathT * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_WinRTGetDeviceFamily(); +extern SDL_DECLSPEC SDL_WinRT_DeviceFamily SDLCALL SDL_GetWinRTDeviceFamily(); #endif /* SDL_PLATFORM_WINRT */ @@ -805,7 +805,7 @@ typedef struct XUser *XUserHandle; * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue); +extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle * outTaskQueue); /** * Gets a reference to the default user handle for GDK. @@ -819,7 +819,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQu * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(XUserHandle * outUserHandle); +extern SDL_DECLSPEC int SDLCALL SDL_GetGDKDefaultUser(XUserHandle * outUserHandle); #endif diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index ec909fd3797f2..6badd4be66416 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -31,16 +31,16 @@ void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata) #ifndef SDL_PLATFORM_LINUX -SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriority(Sint64 threadID, int priority); -int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) +SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority); +int SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) { (void)threadID; (void)priority; return SDL_Unsupported(); } -SDL_DECLSPEC int SDLCALL SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); -int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) +SDL_DECLSPEC int SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy); +int SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) { (void)threadID; (void)sdlPriority; @@ -58,8 +58,8 @@ void SDL_GDKSuspendComplete(void) SDL_Unsupported(); } -SDL_DECLSPEC int SDLCALL SDL_GDKGetDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */ -int SDL_GDKGetDefaultUser(void *outUserHandle) +SDL_DECLSPEC int SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */ +int SDL_GetGDKDefaultUser(void *outUserHandle) { return SDL_Unsupported(); } @@ -96,15 +96,15 @@ void SDL_UnregisterApp(void) #ifndef SDL_PLATFORM_WINRT /* Returns SDL_WinRT_DeviceFamily enum */ -SDL_DECLSPEC int SDLCALL SDL_WinRTGetDeviceFamily(void); -int SDL_WinRTGetDeviceFamily() +SDL_DECLSPEC int SDLCALL SDL_GetWinRTDeviceFamily(void); +int SDL_GetWinRTDeviceFamily() { SDL_Unsupported(); return 0; /* SDL_WINRT_DEVICEFAMILY_UNKNOWN */ } -SDL_DECLSPEC const char *SDLCALL SDL_WinRTGetFSPath(int pathType); /* SDL_WinRT_Path pathType */ -const char *SDL_WinRTGetFSPath(int pathType) +SDL_DECLSPEC const char *SDLCALL SDL_GetWinRTFSPath(int pathType); /* SDL_WinRT_Path pathType */ +const char *SDL_GetWinRTFSPath(int pathType) { (void)pathType; SDL_Unsupported(); @@ -120,43 +120,43 @@ void SDL_AndroidBackButton() SDL_Unsupported(); } -SDL_DECLSPEC void *SDLCALL SDL_AndroidGetActivity(void); -void *SDL_AndroidGetActivity() +SDL_DECLSPEC void *SDLCALL SDL_GetAndroidActivity(void); +void *SDL_GetAndroidActivity() { SDL_Unsupported(); return NULL; } -SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetCachePath(void); -const char* SDL_AndroidGetCachePath() +SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidCachePath(void); +const char* SDL_GetAndroidCachePath() { SDL_Unsupported(); return NULL; } -SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetExternalStoragePath(void); -const char* SDL_AndroidGetExternalStoragePath() +SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidExternalStoragePath(void); +const char* SDL_GetAndroidExternalStoragePath() { SDL_Unsupported(); return NULL; } -SDL_DECLSPEC int SDLCALL SDL_AndroidGetExternalStorageState(Uint32 *state); -int SDL_AndroidGetExternalStorageState(Uint32 *state) +SDL_DECLSPEC int SDLCALL SDL_GetAndroidExternalStorageState(Uint32 *state); +int SDL_GetAndroidExternalStorageState(Uint32 *state) { (void)state; return SDL_Unsupported(); } -SDL_DECLSPEC const char *SDLCALL SDL_AndroidGetInternalStoragePath(void); -const char *SDL_AndroidGetInternalStoragePath(void) +SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidInternalStoragePath(void); +const char *SDL_GetAndroidInternalStoragePath(void) { SDL_Unsupported(); return NULL; } -SDL_DECLSPEC void *SDLCALL SDL_AndroidGetJNIEnv(void); -void *SDL_AndroidGetJNIEnv() +SDL_DECLSPEC void *SDLCALL SDL_GetAndroidJNIEnv(void); +void *SDL_GetAndroidJNIEnv() { SDL_Unsupported(); return NULL; diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 4cb6cbd18aa5a..d9988353fa9e5 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -2392,12 +2392,12 @@ int Android_JNI_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *bu ////////////////////////////////////////////////////////////////////////////// */ -void *SDL_AndroidGetJNIEnv(void) +void *SDL_GetAndroidJNIEnv(void) { return Android_JNI_GetEnv(); } -void *SDL_AndroidGetActivity(void) +void *SDL_GetAndroidActivity(void) { /* See SDL_system.h for caveats on using this function. */ @@ -2453,7 +2453,7 @@ void SDL_AndroidBackButton(void) } // this caches a string until the process ends, so there's no need to use SDL_FreeLater. -const char *SDL_AndroidGetInternalStoragePath(void) +const char *SDL_GetAndroidInternalStoragePath(void) { static char *s_AndroidInternalFilesPath = NULL; @@ -2507,7 +2507,7 @@ const char *SDL_AndroidGetInternalStoragePath(void) return s_AndroidInternalFilesPath; } -int SDL_AndroidGetExternalStorageState(Uint32 *state) +int SDL_GetAndroidExternalStorageState(Uint32 *state) { struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); jmethodID mid; @@ -2553,7 +2553,7 @@ int SDL_AndroidGetExternalStorageState(Uint32 *state) } // this caches a string until the process ends, so there's no need to use SDL_FreeLater. -const char *SDL_AndroidGetExternalStoragePath(void) +const char *SDL_GetAndroidExternalStoragePath(void) { static char *s_AndroidExternalFilesPath = NULL; @@ -2599,9 +2599,9 @@ const char *SDL_AndroidGetExternalStoragePath(void) } // this caches a string until the process ends, so there's no need to use SDL_FreeLater. -const char *SDL_AndroidGetCachePath(void) +const char *SDL_GetAndroidCachePath(void) { - // !!! FIXME: lots of duplication with SDL_AndroidGetExternalStoragePath and SDL_AndroidGetInternalStoragePath; consolidate these functions! + // !!! FIXME: lots of duplication with SDL_GetAndroidExternalStoragePath and SDL_GetAndroidInternalStoragePath; consolidate these functions! static char *s_AndroidCachePath = NULL; if (!s_AndroidCachePath) { diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp index 80166bae3c5ae..58000d6bda6e7 100644 --- a/src/core/gdk/SDL_gdk.cpp +++ b/src/core/gdk/SDL_gdk.cpp @@ -35,7 +35,7 @@ PAPPCONSTRAIN_REGISTRATION hCPLM = {}; HANDLE plmSuspendComplete = nullptr; extern "C" -int SDL_GDKGetTaskQueue(XTaskQueueHandle *outTaskQueue) +int SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue) { /* If this is the first call, first create the global task queue. */ if (!GDK_GlobalTaskQueue) { @@ -82,7 +82,7 @@ void SDL_GDKSuspendComplete() } extern "C" -int SDL_GDKGetDefaultUser(XUserHandle *outUserHandle) +int SDL_GetGDKDefaultUser(XUserHandle *outUserHandle) { XAsyncBlock block = { 0 }; HRESULT result; diff --git a/src/core/linux/SDL_threadprio.c b/src/core/linux/SDL_threadprio.c index 106894947d082..d70d9a7eb2388 100644 --- a/src/core/linux/SDL_threadprio.c +++ b/src/core/linux/SDL_threadprio.c @@ -249,7 +249,7 @@ static SDL_bool rtkit_setpriority_realtime(pid_t thread, int rt_priority) #endif /* threads */ /* this is a public symbol, so it has to exist even if threads are disabled. */ -int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) +int SDL_SetLinuxThreadPriority(Sint64 threadID, int priority) { #ifdef SDL_THREADS_DISABLED return SDL_Unsupported(); @@ -281,7 +281,7 @@ int SDL_LinuxSetThreadPriority(Sint64 threadID, int priority) } /* this is a public symbol, so it has to exist even if threads are disabled. */ -int SDL_LinuxSetThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) +int SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy) { #ifdef SDL_THREADS_DISABLED return SDL_Unsupported(); diff --git a/src/core/winrt/SDL_winrtapp_common.cpp b/src/core/winrt/SDL_winrtapp_common.cpp index 6cdb71d530b08..231d6cf4d99fb 100644 --- a/src/core/winrt/SDL_winrtapp_common.cpp +++ b/src/core/winrt/SDL_winrtapp_common.cpp @@ -25,7 +25,7 @@ int (*WINRT_SDLAppEntryPoint)(int, char **) = NULL; extern "C" -SDL_WinRT_DeviceFamily SDL_WinRTGetDeviceFamily() +SDL_WinRT_DeviceFamily SDL_GetWinRTDeviceFamily() { #if NTDDI_VERSION >= NTDDI_WIN10 /* !!! FIXME: I have no idea if this is the right test. This is a UWP API, I think. Older windows should...just return "mobile"? I don't know. --ryan. */ Platform::String ^ deviceFamily = Windows::System::Profile::AnalyticsInfo::VersionInfo->DeviceFamily; diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 790f08e93959e..72f5f453a035f 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -13,12 +13,6 @@ SDL3_0.0.0 { SDL_AddVulkanRenderSemaphores; SDL_AllocateEventMemory; SDL_AndroidBackButton; - SDL_AndroidGetActivity; - SDL_AndroidGetCachePath; - SDL_AndroidGetExternalStoragePath; - SDL_AndroidGetExternalStorageState; - SDL_AndroidGetInternalStoragePath; - SDL_AndroidGetJNIEnv; SDL_AndroidRequestPermission; SDL_AndroidSendMessage; SDL_AndroidShowToast; @@ -113,7 +107,6 @@ SDL3_0.0.0 { SDL_DestroyWindowSurface; SDL_DetachThread; SDL_DetachVirtualJoystick; - SDL_Direct3D9GetAdapterIndex; SDL_DisableScreenSaver; SDL_DuplicateSurface; SDL_EGL_GetCurrentEGLConfig; @@ -136,8 +129,6 @@ SDL3_0.0.0 { SDL_FlushEvent; SDL_FlushEvents; SDL_FlushRenderer; - SDL_GDKGetDefaultUser; - SDL_GDKGetTaskQueue; SDL_GDKSuspendComplete; SDL_GL_CreateContext; SDL_GL_DestroyContext; @@ -162,6 +153,12 @@ SDL3_0.0.0 { SDL_GamepadHasButton; SDL_GamepadHasSensor; SDL_GamepadSensorEnabled; + SDL_GetAndroidActivity; + SDL_GetAndroidCachePath; + SDL_GetAndroidExternalStoragePath; + SDL_GetAndroidExternalStorageState; + SDL_GetAndroidInternalStoragePath; + SDL_GetAndroidJNIEnv; SDL_GetAndroidSDKVersion; SDL_GetAssertionHandler; SDL_GetAssertionReport; @@ -216,6 +213,7 @@ SDL3_0.0.0 { SDL_GetDefaultKeyFromScancode; SDL_GetDefaultScancodeFromKey; SDL_GetDesktopDisplayMode; + SDL_GetDirect3D9AdapterIndex; SDL_GetDisplayBounds; SDL_GetDisplayContentScale; SDL_GetDisplayForPoint; @@ -229,6 +227,8 @@ SDL3_0.0.0 { SDL_GetEventFilter; SDL_GetFloatProperty; SDL_GetFullscreenDisplayModes; + SDL_GetGDKDefaultUser; + SDL_GetGDKTaskQueue; SDL_GetGamepadAppleSFSymbolsNameForAxis; SDL_GetGamepadAppleSFSymbolsNameForButton; SDL_GetGamepadAxis; @@ -464,6 +464,8 @@ SDL3_0.0.0 { SDL_GetUserFolder; SDL_GetVersion; SDL_GetVideoDriver; + SDL_GetWinRTDeviceFamily; + SDL_GetWinRTFSPath; SDL_GetWindowAspectRatio; SDL_GetWindowBordersSize; SDL_GetWindowDisplayScale; @@ -541,8 +543,6 @@ SDL3_0.0.0 { SDL_IsTablet; SDL_JoystickConnected; SDL_JoystickEventsEnabled; - SDL_LinuxSetThreadPriority; - SDL_LinuxSetThreadPriorityAndPolicy; SDL_LoadBMP; SDL_LoadBMP_IO; SDL_LoadFile; @@ -724,6 +724,8 @@ SDL3_0.0.0 { SDL_SetJoystickVirtualButton; SDL_SetJoystickVirtualHat; SDL_SetJoystickVirtualTouchpad; + SDL_SetLinuxThreadPriority; + SDL_SetLinuxThreadPriorityAndPolicy; SDL_SetLogOutputFunction; SDL_SetLogPriorities; SDL_SetLogPriority; @@ -788,6 +790,8 @@ SDL3_0.0.0 { SDL_SetWindowTitle; SDL_SetWindowsMessageHook; SDL_SetX11EventHook; + SDL_SetiOSAnimationCallback; + SDL_SetiOSEventPump; SDL_ShowCursor; SDL_ShowMessageBox; SDL_ShowOpenFileDialog; @@ -857,8 +861,6 @@ SDL3_0.0.0 { SDL_WarpMouseGlobal; SDL_WarpMouseInWindow; SDL_WasInit; - SDL_WinRTGetDeviceFamily; - SDL_WinRTGetFSPath; SDL_WindowHasSurface; SDL_WriteIO; SDL_WriteS16BE; @@ -933,8 +935,6 @@ SDL3_0.0.0 { SDL_hid_send_feature_report; SDL_hid_set_nonblocking; SDL_hid_write; - SDL_iOSSetAnimationCallback; - SDL_iOSSetEventPump; SDL_iconv; SDL_iconv_close; SDL_iconv_open; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index eaf1860602295..0be1dbbcdda05 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -38,12 +38,6 @@ #define SDL_AddVulkanRenderSemaphores SDL_AddVulkanRenderSemaphores_REAL #define SDL_AllocateEventMemory SDL_AllocateEventMemory_REAL #define SDL_AndroidBackButton SDL_AndroidBackButton_REAL -#define SDL_AndroidGetActivity SDL_AndroidGetActivity_REAL -#define SDL_AndroidGetCachePath SDL_AndroidGetCachePath_REAL -#define SDL_AndroidGetExternalStoragePath SDL_AndroidGetExternalStoragePath_REAL -#define SDL_AndroidGetExternalStorageState SDL_AndroidGetExternalStorageState_REAL -#define SDL_AndroidGetInternalStoragePath SDL_AndroidGetInternalStoragePath_REAL -#define SDL_AndroidGetJNIEnv SDL_AndroidGetJNIEnv_REAL #define SDL_AndroidRequestPermission SDL_AndroidRequestPermission_REAL #define SDL_AndroidSendMessage SDL_AndroidSendMessage_REAL #define SDL_AndroidShowToast SDL_AndroidShowToast_REAL @@ -138,7 +132,6 @@ #define SDL_DestroyWindowSurface SDL_DestroyWindowSurface_REAL #define SDL_DetachThread SDL_DetachThread_REAL #define SDL_DetachVirtualJoystick SDL_DetachVirtualJoystick_REAL -#define SDL_Direct3D9GetAdapterIndex SDL_Direct3D9GetAdapterIndex_REAL #define SDL_DisableScreenSaver SDL_DisableScreenSaver_REAL #define SDL_DuplicateSurface SDL_DuplicateSurface_REAL #define SDL_EGL_GetCurrentEGLConfig SDL_EGL_GetCurrentEGLConfig_REAL @@ -161,8 +154,6 @@ #define SDL_FlushEvent SDL_FlushEvent_REAL #define SDL_FlushEvents SDL_FlushEvents_REAL #define SDL_FlushRenderer SDL_FlushRenderer_REAL -#define SDL_GDKGetDefaultUser SDL_GDKGetDefaultUser_REAL -#define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_REAL #define SDL_GDKSuspendComplete SDL_GDKSuspendComplete_REAL #define SDL_GL_CreateContext SDL_GL_CreateContext_REAL #define SDL_GL_DestroyContext SDL_GL_DestroyContext_REAL @@ -187,6 +178,12 @@ #define SDL_GamepadHasButton SDL_GamepadHasButton_REAL #define SDL_GamepadHasSensor SDL_GamepadHasSensor_REAL #define SDL_GamepadSensorEnabled SDL_GamepadSensorEnabled_REAL +#define SDL_GetAndroidActivity SDL_GetAndroidActivity_REAL +#define SDL_GetAndroidCachePath SDL_GetAndroidCachePath_REAL +#define SDL_GetAndroidExternalStoragePath SDL_GetAndroidExternalStoragePath_REAL +#define SDL_GetAndroidExternalStorageState SDL_GetAndroidExternalStorageState_REAL +#define SDL_GetAndroidInternalStoragePath SDL_GetAndroidInternalStoragePath_REAL +#define SDL_GetAndroidJNIEnv SDL_GetAndroidJNIEnv_REAL #define SDL_GetAndroidSDKVersion SDL_GetAndroidSDKVersion_REAL #define SDL_GetAssertionHandler SDL_GetAssertionHandler_REAL #define SDL_GetAssertionReport SDL_GetAssertionReport_REAL @@ -241,6 +238,7 @@ #define SDL_GetDefaultKeyFromScancode SDL_GetDefaultKeyFromScancode_REAL #define SDL_GetDefaultScancodeFromKey SDL_GetDefaultScancodeFromKey_REAL #define SDL_GetDesktopDisplayMode SDL_GetDesktopDisplayMode_REAL +#define SDL_GetDirect3D9AdapterIndex SDL_GetDirect3D9AdapterIndex_REAL #define SDL_GetDisplayBounds SDL_GetDisplayBounds_REAL #define SDL_GetDisplayContentScale SDL_GetDisplayContentScale_REAL #define SDL_GetDisplayForPoint SDL_GetDisplayForPoint_REAL @@ -254,6 +252,8 @@ #define SDL_GetEventFilter SDL_GetEventFilter_REAL #define SDL_GetFloatProperty SDL_GetFloatProperty_REAL #define SDL_GetFullscreenDisplayModes SDL_GetFullscreenDisplayModes_REAL +#define SDL_GetGDKDefaultUser SDL_GetGDKDefaultUser_REAL +#define SDL_GetGDKTaskQueue SDL_GetGDKTaskQueue_REAL #define SDL_GetGamepadAppleSFSymbolsNameForAxis SDL_GetGamepadAppleSFSymbolsNameForAxis_REAL #define SDL_GetGamepadAppleSFSymbolsNameForButton SDL_GetGamepadAppleSFSymbolsNameForButton_REAL #define SDL_GetGamepadAxis SDL_GetGamepadAxis_REAL @@ -489,6 +489,8 @@ #define SDL_GetUserFolder SDL_GetUserFolder_REAL #define SDL_GetVersion SDL_GetVersion_REAL #define SDL_GetVideoDriver SDL_GetVideoDriver_REAL +#define SDL_GetWinRTDeviceFamily SDL_GetWinRTDeviceFamily_REAL +#define SDL_GetWinRTFSPath SDL_GetWinRTFSPath_REAL #define SDL_GetWindowAspectRatio SDL_GetWindowAspectRatio_REAL #define SDL_GetWindowBordersSize SDL_GetWindowBordersSize_REAL #define SDL_GetWindowDisplayScale SDL_GetWindowDisplayScale_REAL @@ -566,8 +568,6 @@ #define SDL_IsTablet SDL_IsTablet_REAL #define SDL_JoystickConnected SDL_JoystickConnected_REAL #define SDL_JoystickEventsEnabled SDL_JoystickEventsEnabled_REAL -#define SDL_LinuxSetThreadPriority SDL_LinuxSetThreadPriority_REAL -#define SDL_LinuxSetThreadPriorityAndPolicy SDL_LinuxSetThreadPriorityAndPolicy_REAL #define SDL_LoadBMP SDL_LoadBMP_REAL #define SDL_LoadBMP_IO SDL_LoadBMP_IO_REAL #define SDL_LoadFile SDL_LoadFile_REAL @@ -749,6 +749,8 @@ #define SDL_SetJoystickVirtualButton SDL_SetJoystickVirtualButton_REAL #define SDL_SetJoystickVirtualHat SDL_SetJoystickVirtualHat_REAL #define SDL_SetJoystickVirtualTouchpad SDL_SetJoystickVirtualTouchpad_REAL +#define SDL_SetLinuxThreadPriority SDL_SetLinuxThreadPriority_REAL +#define SDL_SetLinuxThreadPriorityAndPolicy SDL_SetLinuxThreadPriorityAndPolicy_REAL #define SDL_SetLogOutputFunction SDL_SetLogOutputFunction_REAL #define SDL_SetLogPriorities SDL_SetLogPriorities_REAL #define SDL_SetLogPriority SDL_SetLogPriority_REAL @@ -813,6 +815,8 @@ #define SDL_SetWindowTitle SDL_SetWindowTitle_REAL #define SDL_SetWindowsMessageHook SDL_SetWindowsMessageHook_REAL #define SDL_SetX11EventHook SDL_SetX11EventHook_REAL +#define SDL_SetiOSAnimationCallback SDL_SetiOSAnimationCallback_REAL +#define SDL_SetiOSEventPump SDL_SetiOSEventPump_REAL #define SDL_ShowCursor SDL_ShowCursor_REAL #define SDL_ShowMessageBox SDL_ShowMessageBox_REAL #define SDL_ShowOpenFileDialog SDL_ShowOpenFileDialog_REAL @@ -882,8 +886,6 @@ #define SDL_WarpMouseGlobal SDL_WarpMouseGlobal_REAL #define SDL_WarpMouseInWindow SDL_WarpMouseInWindow_REAL #define SDL_WasInit SDL_WasInit_REAL -#define SDL_WinRTGetDeviceFamily SDL_WinRTGetDeviceFamily_REAL -#define SDL_WinRTGetFSPath SDL_WinRTGetFSPath_REAL #define SDL_WindowHasSurface SDL_WindowHasSurface_REAL #define SDL_WriteIO SDL_WriteIO_REAL #define SDL_WriteS16BE SDL_WriteS16BE_REAL @@ -958,8 +960,6 @@ #define SDL_hid_send_feature_report SDL_hid_send_feature_report_REAL #define SDL_hid_set_nonblocking SDL_hid_set_nonblocking_REAL #define SDL_hid_write SDL_hid_write_REAL -#define SDL_iOSSetAnimationCallback SDL_iOSSetAnimationCallback_REAL -#define SDL_iOSSetEventPump SDL_iOSSetEventPump_REAL #define SDL_iconv SDL_iconv_REAL #define SDL_iconv_close SDL_iconv_close_REAL #define SDL_iconv_open SDL_iconv_open_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index dc05b870f79e7..90524782d5ea2 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -58,12 +58,6 @@ SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimerNS,(Uint64 a, SDL_NSTimerCallback b, voi SDL_DYNAPI_PROC(int,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Sint64 c, Sint64 d),(a,b,c,d),return) SDL_DYNAPI_PROC(void*,SDL_AllocateEventMemory,(size_t a),(a),return) SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),) -SDL_DYNAPI_PROC(void*,SDL_AndroidGetActivity,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_AndroidGetCachePath,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_AndroidGetExternalStoragePath,(void),(),return) -SDL_DYNAPI_PROC(int,SDL_AndroidGetExternalStorageState,(Uint32 *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_AndroidGetInternalStoragePath,(void),(),return) -SDL_DYNAPI_PROC(void*,SDL_AndroidGetJNIEnv,(void),(),return) SDL_DYNAPI_PROC(int,SDL_AndroidRequestPermission,(const char *a, SDL_AndroidRequestPermissionCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_AndroidSendMessage,(Uint32 a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_AndroidShowToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return) @@ -158,7 +152,6 @@ SDL_DYNAPI_PROC(void,SDL_DestroyWindow,(SDL_Window *a),(a),) SDL_DYNAPI_PROC(int,SDL_DestroyWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_DetachThread,(SDL_Thread *a),(a),) SDL_DYNAPI_PROC(int,SDL_DetachVirtualJoystick,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(int,SDL_Direct3D9GetAdapterIndex,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_DisableScreenSaver,(void),(),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_DuplicateSurface,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_EGLConfig,SDL_EGL_GetCurrentEGLConfig,(void),(),return) @@ -181,8 +174,6 @@ SDL_DYNAPI_PROC(int,SDL_FlushAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_FlushEvent,(Uint32 a),(a),) SDL_DYNAPI_PROC(void,SDL_FlushEvents,(Uint32 a, Uint32 b),(a,b),) SDL_DYNAPI_PROC(int,SDL_FlushRenderer,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GDKGetDefaultUser,(XUserHandle *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GDKGetTaskQueue,(XTaskQueueHandle *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) @@ -207,6 +198,12 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasAxis,(SDL_Gamepad *a, SDL_GamepadAxis b), SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasSensor,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorType b),(a,b),return) +SDL_DYNAPI_PROC(void*,SDL_GetAndroidActivity,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_GetAndroidCachePath,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_GetAndroidExternalStoragePath,(void),(),return) +SDL_DYNAPI_PROC(int,SDL_GetAndroidExternalStorageState,(Uint32 *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetAndroidInternalStoragePath,(void),(),return) +SDL_DYNAPI_PROC(void*,SDL_GetAndroidJNIEnv,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return) SDL_DYNAPI_PROC(SDL_AssertionHandler,SDL_GetAssertionHandler,(void **a),(a),return) SDL_DYNAPI_PROC(const SDL_AssertData*,SDL_GetAssertionReport,(void),(),return) @@ -261,6 +258,7 @@ SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetDefaultCursor,(void),(),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetDefaultKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) SDL_DYNAPI_PROC(SDL_Scancode,SDL_GetDefaultScancodeFromKey,(SDL_Keycode a, SDL_Keymod *b),(a,b),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetDesktopDisplayMode,(SDL_DisplayID a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetDirect3D9AdapterIndex,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetDisplayBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetDisplayContentScale,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForPoint,(const SDL_Point *a),(a),return) @@ -274,6 +272,8 @@ SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return) SDL_DYNAPI_PROC(const SDL_DisplayMode**,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_GetGDKDefaultUser,(XUserHandle *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetGDKTaskQueue,(XTaskQueueHandle *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(Sint16,SDL_GetGamepadAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) @@ -509,6 +509,8 @@ SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),r SDL_DYNAPI_PROC(char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return) +SDL_DYNAPI_PROC(SDL_WinRT_DeviceFamily,SDL_GetWinRTDeviceFamily,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_GetWinRTFSPath,(SDL_WinRT_Path a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowAspectRatio,(SDL_Window *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetWindowBordersSize,(SDL_Window *a, int *b, int *c, int *d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(float,SDL_GetWindowDisplayScale,(SDL_Window *a),(a),return) @@ -585,8 +587,6 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_IsMouseHaptic,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_IsTablet,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickConnected,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_JoystickEventsEnabled,(void),(),return) -SDL_DYNAPI_PROC(int,SDL_LinuxSetThreadPriority,(Sint64 a, int b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_LinuxSetThreadPriorityAndPolicy,(Sint64 a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_LoadBMP_IO,(SDL_IOStream *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(void*,SDL_LoadFile,(const char *a, size_t *b),(a,b),return) @@ -759,6 +759,8 @@ SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualBall,(SDL_Joystick *a, int b, Sint16 c SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualButton,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualHat,(SDL_Joystick *a, int b, Uint8 c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetJoystickVirtualTouchpad,(SDL_Joystick *a, int b, int c, Uint8 d, float e, float f, float g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(int,SDL_SetLinuxThreadPriority,(Sint64 a, int b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_SetLinuxThreadPriorityAndPolicy,(Sint64 a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_SetLogOutputFunction,(SDL_LogOutputFunction a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetLogPriorities,(SDL_LogPriority a),(a),) SDL_DYNAPI_PROC(void,SDL_SetLogPriority,(int a, SDL_LogPriority b),(a,b),) @@ -823,6 +825,8 @@ SDL_DYNAPI_PROC(int,SDL_SetWindowSurfaceVSync,(SDL_Window *a, int b),(a,b),retur SDL_DYNAPI_PROC(int,SDL_SetWindowTitle,(SDL_Window *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_SetX11EventHook,(SDL_X11EventHook a, void *b),(a,b),) +SDL_DYNAPI_PROC(int,SDL_SetiOSAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(void,SDL_SetiOSEventPump,(SDL_bool a),(a),) SDL_DYNAPI_PROC(int,SDL_ShowCursor,(void),(),return) SDL_DYNAPI_PROC(int,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_ShowOpenFileDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const SDL_DialogFileFilter *d, int e, const char *f, SDL_bool g),(a,b,c,d,e,f,g),) @@ -892,8 +896,6 @@ SDL_DYNAPI_PROC(void,SDL_WaitThread,(SDL_Thread *a, int *b),(a,b),) SDL_DYNAPI_PROC(int,SDL_WarpMouseGlobal,(float a, float b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_WarpMouseInWindow,(SDL_Window *a, float b, float c),(a,b,c),) SDL_DYNAPI_PROC(SDL_InitFlags,SDL_WasInit,(SDL_InitFlags a),(a),return) -SDL_DYNAPI_PROC(SDL_WinRT_DeviceFamily,SDL_WinRTGetDeviceFamily,(void),(),return) -SDL_DYNAPI_PROC(const char*,SDL_WinRTGetFSPath,(SDL_WinRT_Path a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_WindowHasSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(size_t,SDL_WriteIO,(SDL_IOStream *a, const void *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_WriteS16BE,(SDL_IOStream *a, Sint16 b),(a,b),return) @@ -967,8 +969,6 @@ SDL_DYNAPI_PROC(int,SDL_hid_read_timeout,(SDL_hid_device *a, unsigned char *b, s SDL_DYNAPI_PROC(int,SDL_hid_send_feature_report,(SDL_hid_device *a, const unsigned char *b, size_t c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_hid_set_nonblocking,(SDL_hid_device *a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_hid_write,(SDL_hid_device *a, const unsigned char *b, size_t c),(a,b,c),return) -SDL_DYNAPI_PROC(int,SDL_iOSSetAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(void,SDL_iOSSetEventPump,(SDL_bool a),(a),) SDL_DYNAPI_PROC(size_t,SDL_iconv,(SDL_iconv_t a, const char **b, size_t *c, char **d, size_t *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_iconv_close,(SDL_iconv_t a),(a),return) SDL_DYNAPI_PROC(SDL_iconv_t,SDL_iconv_open,(const char *a, const char *b),(a,b),return) diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c index ec36dcf9ea87b..cf7821c2555ee 100644 --- a/src/file/SDL_iostream.c +++ b/src/file/SDL_iostream.c @@ -578,7 +578,7 @@ SDL_IOStream *SDL_IOFromFile(const char *file, const char *mode) } else { /* Try opening it from internal storage if it's a relative path */ char *path = NULL; - SDL_asprintf(&path, "%s/%s", SDL_AndroidGetInternalStoragePath(), file); + SDL_asprintf(&path, "%s/%s", SDL_GetAndroidInternalStoragePath(), file); if (path) { FILE *fp = fopen(path, mode); SDL_free(path); diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index 4d5fb5deca031..a59f2bb41d1d1 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -36,7 +36,7 @@ char *SDL_GetBasePath(void) char *SDL_GetPrefPath(const char *org, const char *app) { - const char *path = SDL_AndroidGetInternalStoragePath(); + const char *path = SDL_GetAndroidInternalStoragePath(); if (path) { size_t pathlen = SDL_strlen(path) + 2; char *fullpath = (char *)SDL_malloc(pathlen); diff --git a/src/filesystem/gdk/SDL_sysfilesystem.cpp b/src/filesystem/gdk/SDL_sysfilesystem.cpp index 9f0b35429abb3..0ba16306cfb3c 100644 --- a/src/filesystem/gdk/SDL_sysfilesystem.cpp +++ b/src/filesystem/gdk/SDL_sysfilesystem.cpp @@ -99,7 +99,7 @@ SDL_GetPrefPath(const char *org, const char *app) return SDL_strdup("T:\\"); } - if (SDL_GDKGetDefaultUser(&user) < 0) { + if (SDL_GetGDKDefaultUser(&user) < 0) { /* Error already set, just return */ return NULL; } diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index f253ecb67fcfd..a1378a67406b2 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -35,7 +35,7 @@ extern "C" { using namespace std; using namespace Windows::Storage; -static const wchar_t *SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType) +static const wchar_t *SDL_GetWinRTFSPathUNICODE(SDL_WinRT_Path pathType) { switch (pathType) { case SDL_WINRT_PATH_INSTALLED_LOCATION: @@ -94,7 +94,7 @@ static const wchar_t *SDL_WinRTGetFSPathUNICODE(SDL_WinRT_Path pathType) } // this caches a string until the process ends, so there's no need to use SDL_FreeLater. -extern "C" const char *SDL_WinRTGetFSPath(SDL_WinRT_Path pathType) +extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType) { typedef unordered_map UTF8PathMap; static UTF8PathMap utf8Paths; @@ -104,7 +104,7 @@ extern "C" const char *SDL_WinRTGetFSPath(SDL_WinRT_Path pathType) return searchResult->second.c_str(); } - const wchar_t *ucs2Path = SDL_WinRTGetFSPathUNICODE(pathType); + const wchar_t *ucs2Path = SDL_GetWinRTFSPathUNICODE(pathType); if (!ucs2Path) { return NULL; } @@ -117,7 +117,7 @@ extern "C" const char *SDL_WinRTGetFSPath(SDL_WinRT_Path pathType) extern "C" char *SDL_GetBasePath(void) { - const char *srcPath = SDL_WinRTGetFSPath(SDL_WINRT_PATH_INSTALLED_LOCATION); + const char *srcPath = SDL_GetWinRTFSPath(SDL_WINRT_PATH_INSTALLED_LOCATION); size_t destPathLen; char *destPath = NULL; @@ -160,7 +160,7 @@ extern "C" char *SDL_GetPrefPath(const char *org, const char *app) org = ""; } - srcPath = SDL_WinRTGetFSPathUNICODE(SDL_WINRT_PATH_LOCAL_FOLDER); + srcPath = SDL_GetWinRTFSPathUNICODE(SDL_WINRT_PATH_LOCAL_FOLDER); if (!srcPath) { SDL_SetError("Unable to find a source path"); return NULL; diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 4e33db0f32df3..ce9e614d12fcd 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -2313,7 +2313,7 @@ static SDL_bool SDL_GetGamepadMappingFilePath(char *path, size_t size) } #ifdef SDL_PLATFORM_ANDROID - return SDL_snprintf(path, size, "%s/gamepad_map.txt", SDL_AndroidGetInternalStoragePath()) < size; + return SDL_snprintf(path, size, "%s/gamepad_map.txt", SDL_GetAndroidInternalStoragePath()) < size; #else return SDL_FALSE; #endif diff --git a/src/main/gdk/SDL_sysmain_runapp.cpp b/src/main/gdk/SDL_sysmain_runapp.cpp index 4517b285779b9..6ac6dee603db8 100644 --- a/src/main/gdk/SDL_sysmain_runapp.cpp +++ b/src/main/gdk/SDL_sysmain_runapp.cpp @@ -84,7 +84,7 @@ int SDL_RunApp(int, char**, SDL_main_func mainFunction, void *reserved) hr = XGameRuntimeInitialize(); - if (SUCCEEDED(hr) && SDL_GDKGetTaskQueue(&taskQueue) == 0) { + if (SUCCEEDED(hr) && SDL_GetGDKTaskQueue(&taskQueue) == 0) { Uint32 titleid = 0; char scidBuffer[64]; XblInitArgs xblArgs; diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index af16dbefa989f..6bdeef46751c9 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -1679,7 +1679,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie /* Get the adapter for the display that the window is on */ displayID = SDL_GetDisplayForWindow(window); - data->adapter = SDL_Direct3D9GetAdapterIndex(displayID); + data->adapter = SDL_GetDirect3D9AdapterIndex(displayID); result = IDirect3D9_GetDeviceCaps(data->d3d, data->adapter, D3DDEVTYPE_HAL, &caps); if (FAILED(result)) { diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 7fc06d86fe514..a60896dec4963 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1262,7 +1262,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) #if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) /* Print the D3D9 adapter index */ - adapterIndex = SDL_Direct3D9GetAdapterIndex(displayID); + adapterIndex = SDL_GetDirect3D9AdapterIndex(displayID); SDL_Log("D3D9 Adapter Index: %d", adapterIndex); /* Print the DXGI adapter and output indices */ diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 3f9aa4d05fda0..5f04c9c1af977 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -238,7 +238,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) #ifdef SDL_PLATFORM_LINUX { pid_t linuxTid = syscall(SYS_gettid); - return SDL_LinuxSetThreadPriorityAndPolicy(linuxTid, priority, policy); + return SDL_SetLinuxThreadPriorityAndPolicy(linuxTid, priority, policy); } #else if (priority == SDL_THREAD_PRIORITY_LOW) { diff --git a/src/video/SDL_video_unsupported.c b/src/video/SDL_video_unsupported.c index 23a951f62e9b6..8306816aad26f 100644 --- a/src/video/SDL_video_unsupported.c +++ b/src/video/SDL_video_unsupported.c @@ -52,8 +52,8 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * return SDL_FALSE; } -SDL_DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID); -int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID) +SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID); +int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID) { (void)displayID; return SDL_Unsupported(); @@ -61,8 +61,8 @@ int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID) #elif defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) -SDL_DECLSPEC int SDLCALL SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID); -int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID) +SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID); +int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID) { (void)displayID; return SDL_Unsupported(); @@ -72,8 +72,8 @@ int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID) #ifndef SDL_PLATFORM_GDK -SDL_DECLSPEC int SDLCALL SDL_GDKGetTaskQueue(void *outTaskQueue); -int SDL_GDKGetTaskQueue(void *outTaskQueue) +SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(void *outTaskQueue); +int SDL_GetGDKTaskQueue(void *outTaskQueue) { (void)outTaskQueue; return SDL_Unsupported(); @@ -94,8 +94,8 @@ void SDL_OnApplicationDidChangeStatusBarOrientation(void) #ifndef SDL_VIDEO_DRIVER_UIKIT typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); -SDL_DECLSPEC int SDLCALL SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); -int SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) +SDL_DECLSPEC int SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); +int SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) { (void)window; (void)interval; @@ -104,8 +104,8 @@ int SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimati return SDL_Unsupported(); } -SDL_DECLSPEC void SDLCALL SDL_iOSSetEventPump(SDL_bool enabled); -void SDL_iOSSetEventPump(SDL_bool enabled) +SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled); +void SDL_SetiOSEventPump(SDL_bool enabled) { (void)enabled; SDL_Unsupported(); diff --git a/src/video/gdk/SDL_gdktextinput.cpp b/src/video/gdk/SDL_gdktextinput.cpp index 3f73f66779eab..7af1b381a0409 100644 --- a/src/video/gdk/SDL_gdktextinput.cpp +++ b/src/video/gdk/SDL_gdktextinput.cpp @@ -100,7 +100,7 @@ static void SDLCALL GDK_InternalHintCallback( static int GDK_InternalEnsureTaskQueue(void) { if (!g_TextTaskQueue) { - if (SDL_GDKGetTaskQueue(&g_TextTaskQueue) < 0) { + if (SDL_GetGDKTaskQueue(&g_TextTaskQueue) < 0) { /* SetError will be done for us. */ return -1; } diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 35f697d599241..9375c916aa01c 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -404,9 +404,9 @@ - (void)postFinishLaunch [self performSelector:@selector(hideLaunchScreen) withObject:nil afterDelay:0.0]; /* run the user's application, passing argc and argv */ - SDL_iOSSetEventPump(SDL_TRUE); + SDL_SetiOSEventPump(SDL_TRUE); exit_status = forward_main(forward_argc, forward_argv); - SDL_iOSSetEventPump(SDL_FALSE); + SDL_SetiOSEventPump(SDL_FALSE); if (launchWindow) { launchWindow.hidden = YES; diff --git a/src/video/uikit/SDL_uikitevents.m b/src/video/uikit/SDL_uikitevents.m index 97a1887cb7ee9..eeafc5fb6b233 100644 --- a/src/video/uikit/SDL_uikitevents.m +++ b/src/video/uikit/SDL_uikitevents.m @@ -126,7 +126,7 @@ Uint64 UIKit_GetEventTimestamp(NSTimeInterval nsTimestamp) return timestamp; } -void SDL_iOSSetEventPump(SDL_bool enabled) +void SDL_SetiOSEventPump(SDL_bool enabled) { UIKit_EventPumpEnabled = enabled; diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index a93f7a29f9dc7..740bd05e12158 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -453,7 +453,7 @@ void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int } #endif /* !SDL_PLATFORM_TVOS */ -int SDL_iOSSetAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) +int SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) { if (!window || !window->driverdata) { return SDL_SetError("Invalid window"); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 1074d9b629930..1fe196de6c5aa 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -590,7 +590,7 @@ SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface) return SDL_FALSE; } -int SDL_Direct3D9GetAdapterIndex(SDL_DisplayID displayID) +int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID) { void *pD3DDLL; IDirect3D9 *pD3D; diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp index eece32c6e7153..5598ef56b482a 100644 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/src/video/winrt/SDL_winrtkeyboard.cpp @@ -171,7 +171,7 @@ SDL_bool WINRT_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) using namespace Windows::UI::ViewManagement; InputPane ^ inputPane = InputPane::GetForCurrentView(); if (inputPane) { - switch (SDL_WinRTGetDeviceFamily()) { + switch (SDL_GetWinRTDeviceFamily()) { case SDL_WINRT_DEVICEFAMILY_XBOX: // Documentation recommends using inputPane->Visible // https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.inputpane.visible?view=winrt-22621 From 033df70d4c0f1e3acdbfe246a9133e2d1a721178 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 15 Jul 2024 18:05:31 -0700 Subject: [PATCH 326/431] SDL_DelayNS() will attempt to sleep exactly the requested amount of time This provides a highly accurate sleep function for your application, although you are still subject to being switched out occasionally. Fixes https://github.com/libsdl-org/SDL/issues/10210 --- include/SDL3/SDL_timer.h | 4 ++-- src/timer/SDL_timer.c | 23 ++++++++++++++++++++++- src/timer/SDL_timer_c.h | 2 ++ src/timer/haiku/SDL_systimer.c | 2 +- src/timer/n3ds/SDL_systimer.c | 2 +- src/timer/ngage/SDL_systimer.cpp | 2 +- src/timer/ps2/SDL_systimer.c | 2 +- src/timer/psp/SDL_systimer.c | 2 +- src/timer/unix/SDL_systimer.c | 2 +- src/timer/vita/SDL_systimer.c | 2 +- src/timer/windows/SDL_systimer.c | 2 +- test/testtimer.c | 28 ++++++++++++++++++++++++++++ 12 files changed, 62 insertions(+), 11 deletions(-) diff --git a/include/SDL3/SDL_timer.h b/include/SDL3/SDL_timer.h index c127da1fd1a26..fa40a6f82ca62 100644 --- a/include/SDL3/SDL_timer.h +++ b/include/SDL3/SDL_timer.h @@ -115,8 +115,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); * Wait a specified number of nanoseconds before returning. * * This function waits a specified number of nanoseconds before returning. It - * waits at least the specified time, but possibly longer due to OS - * scheduling. + * will attempt to wait as close to the requested time as possible, busy waiting + * if necessary, but could return later due to OS scheduling. * * \param ns the number of nanoseconds to delay. * diff --git a/src/timer/SDL_timer.c b/src/timer/SDL_timer.c index ca98271d66de1..4c5bd018c614a 100644 --- a/src/timer/SDL_timer.c +++ b/src/timer/SDL_timer.c @@ -643,5 +643,26 @@ Uint64 SDL_GetTicks(void) void SDL_Delay(Uint32 ms) { - SDL_DelayNS(SDL_MS_TO_NS(ms)); + SDL_SYS_DelayNS(SDL_MS_TO_NS(ms)); +} + +void SDL_DelayNS(Uint64 ns) +{ + Uint64 current_value = SDL_GetTicksNS(); + Uint64 target_value = current_value + ns; + + // Sleep for a short number of cycles + // We'll use 1 ms as a scheduling timeslice, it's a good value for modern operating systems + const int SCHEDULING_TIMESLICE_NS = 1 * SDL_NS_PER_MS; + while (current_value < target_value) { + Uint64 remaining_ns = (target_value - current_value); + if (remaining_ns > (SCHEDULING_TIMESLICE_NS + SDL_NS_PER_US)) { + // Sleep for a short time, less than the scheduling timeslice + SDL_SYS_DelayNS(SCHEDULING_TIMESLICE_NS - SDL_NS_PER_US); + } else { + // Spin for any remaining time + SDL_CPUPauseInstruction(); + } + current_value = SDL_GetTicksNS(); + } } diff --git a/src/timer/SDL_timer_c.h b/src/timer/SDL_timer_c.h index 161fb91434c71..9c202a368908c 100644 --- a/src/timer/SDL_timer_c.h +++ b/src/timer/SDL_timer_c.h @@ -34,4 +34,6 @@ extern void SDL_QuitTicks(void); extern int SDL_InitTimers(void); extern void SDL_QuitTimers(void); +extern void SDL_SYS_DelayNS(Uint64 ns); + #endif /* SDL_timer_c_h_ */ diff --git a/src/timer/haiku/SDL_systimer.c b/src/timer/haiku/SDL_systimer.c index 726e4150180fc..8f844b6d30a5e 100644 --- a/src/timer/haiku/SDL_systimer.c +++ b/src/timer/haiku/SDL_systimer.c @@ -35,7 +35,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return SDL_US_PER_SECOND; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { snooze((bigtime_t)SDL_NS_TO_US(ns)); } diff --git a/src/timer/n3ds/SDL_systimer.c b/src/timer/n3ds/SDL_systimer.c index 99389a4c7626d..e90b99dc7cd75 100644 --- a/src/timer/n3ds/SDL_systimer.c +++ b/src/timer/n3ds/SDL_systimer.c @@ -35,7 +35,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return SYSCLOCK_ARM11; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { svcSleepThread(ns); } diff --git a/src/timer/ngage/SDL_systimer.cpp b/src/timer/ngage/SDL_systimer.cpp index f7f11ea3d3202..ce0082a40de88 100644 --- a/src/timer/ngage/SDL_systimer.cpp +++ b/src/timer/ngage/SDL_systimer.cpp @@ -43,7 +43,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return SDL_US_PER_SECOND; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { const Uint64 max_delay = 0x7fffffffLL * SDL_NS_PER_US; if (ns > max_delay) { diff --git a/src/timer/ps2/SDL_systimer.c b/src/timer/ps2/SDL_systimer.c index 7070e17af49ff..8d13c4f599ddd 100644 --- a/src/timer/ps2/SDL_systimer.c +++ b/src/timer/ps2/SDL_systimer.c @@ -39,7 +39,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return kBUSCLK; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { struct timespec tv; tv.tv_sec = (ns / SDL_NS_PER_SECOND); diff --git a/src/timer/psp/SDL_systimer.c b/src/timer/psp/SDL_systimer.c index b91ea244a0d3a..0a33f45822397 100644 --- a/src/timer/psp/SDL_systimer.c +++ b/src/timer/psp/SDL_systimer.c @@ -42,7 +42,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return sceRtcGetTickResolution(); } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { const Uint64 max_delay = 0xffffffffLL * SDL_NS_PER_US; if (ns > max_delay) { diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 0a0c5e807035a..6f9a5c8a4f3a4 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -135,7 +135,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return SDL_US_PER_SECOND; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { int was_error; diff --git a/src/timer/vita/SDL_systimer.c b/src/timer/vita/SDL_systimer.c index a99b8e1c2b359..d9e856ef6d81c 100644 --- a/src/timer/vita/SDL_systimer.c +++ b/src/timer/vita/SDL_systimer.c @@ -39,7 +39,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return SDL_US_PER_SECOND; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { const Uint64 max_delay = 0xffffffffLL * SDL_NS_PER_US; if (ns > max_delay) { diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index d82d6f8bc23bb..5f1ba26bf7f0e 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -66,7 +66,7 @@ Uint64 SDL_GetPerformanceFrequency(void) return (Uint64)frequency.QuadPart; } -void SDL_DelayNS(Uint64 ns) +void SDL_SYS_DelayNS(Uint64 ns) { /* CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag was added in Windows 10 version 1803. * diff --git a/test/testtimer.c b/test/testtimer.c index de38842928061..249b76a7ebcee 100644 --- a/test/testtimer.c +++ b/test/testtimer.c @@ -186,6 +186,34 @@ int main(int argc, char *argv[]) /* Wait for the results to be seen */ SDL_Delay(1 * 1000); + /* Check accuracy of precise delay */ + { + Uint64 desired_delay = SDL_NS_PER_SECOND / 60; + Uint64 actual_delay; + Uint64 total_overslept = 0; + + start = SDL_GetTicksNS(); + SDL_DelayNS(1); + now = SDL_GetTicksNS(); + actual_delay = (now - start); + SDL_Log("Minimum precise delay: %" SDL_PRIu64 " ns\n", actual_delay); + + SDL_Log("Timing 100 frames at 60 FPS\n"); + for (i = 0; i < 100; ++i) { + start = SDL_GetTicksNS(); + SDL_DelayNS(desired_delay); + now = SDL_GetTicksNS(); + actual_delay = (now - start); + if (actual_delay > desired_delay) { + total_overslept += (actual_delay - desired_delay); + } + } + SDL_Log("Overslept %.2f ms\n", (double)total_overslept / SDL_NS_PER_MS); + } + + /* Wait for the results to be seen */ + SDL_Delay(1 * 1000); + /* Test multiple timers */ SDL_Log("Testing multiple timers...\n"); t1 = SDL_AddTimer(100, callback, (void *)1); From 4ac67f5ba64647ae399e81b9ce60deb8e8b952d8 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 16 Jul 2024 01:38:55 +0000 Subject: [PATCH 327/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_timer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_timer.h b/include/SDL3/SDL_timer.h index fa40a6f82ca62..09a6e1c78e720 100644 --- a/include/SDL3/SDL_timer.h +++ b/include/SDL3/SDL_timer.h @@ -115,8 +115,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); * Wait a specified number of nanoseconds before returning. * * This function waits a specified number of nanoseconds before returning. It - * will attempt to wait as close to the requested time as possible, busy waiting - * if necessary, but could return later due to OS scheduling. + * will attempt to wait as close to the requested time as possible, busy + * waiting if necessary, but could return later due to OS scheduling. * * \param ns the number of nanoseconds to delay. * From 199e6929e5284b8573f02dcb655d3803ed436615 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 16 Jul 2024 08:25:38 -0400 Subject: [PATCH 328/431] README-macos: fixed some text. --- docs/README-macos.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README-macos.md b/docs/README-macos.md index 832278fa756b9..e8d21d61e52d1 100644 --- a/docs/README-macos.md +++ b/docs/README-macos.md @@ -228,10 +228,10 @@ Some things that may be of interest about how it all works... ## Working directory In SDL 1.2, the working directory of your SDL app is by default set to its -parent, but this is no longer the case in SDL 2.0. SDL2 does change the -working directory, which means it'll be whatever the command line prompt -that launched the program was using, or if launched by double-clicking in -the finger, it will be "/", the _root of the filesystem_. Plan accordingly! +parent, but this is no longer the case in SDL 2.0 and later. SDL2 does not +change the working directory, which means it'll be whatever the command line +prompt that launched the program was using, or if launched by double-clicking +in the Finder, it will be "/", the _root of the filesystem_. Plan accordingly! You can use SDL_GetBasePath() to find where the program is running from and chdir() there directly. From 58270ef3f25baae5d708b9edd2f9821fa5686a9a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 07:46:08 -0700 Subject: [PATCH 329/431] Finished renaming functions in SDL_system.h --- build-scripts/SDL_migration.cocci | 30 +++++++++++++++++++++++++ docs/README-migration.md | 9 +++++++- include/SDL3/SDL_oldnames.h | 12 ++++++++++ include/SDL3/SDL_system.h | 16 ++++++------- src/audio/aaudio/SDL_aaudio.c | 4 ++-- src/audio/openslES/SDL_openslES.c | 4 ++-- src/camera/android/SDL_camera_android.c | 2 +- src/core/SDL_core_unsupported.c | 18 +++++++-------- src/core/android/SDL_android.c | 10 ++++----- src/dynapi/SDL_dynapi.sym | 10 ++++----- src/dynapi/SDL_dynapi_overrides.h | 10 ++++----- src/dynapi/SDL_dynapi_procs.h | 10 ++++----- src/dynapi/SDL_dynapi_unsupported.h | 2 +- src/hidapi/android/hid.cpp | 4 ++-- src/test/SDL_test_common.c | 2 +- src/video/SDL_video_unsupported.c | 7 +++--- src/video/windows/SDL_windowsvideo.c | 22 +++++++----------- 17 files changed, 107 insertions(+), 65 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 88833085942fc..71e34620a2f10 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -3556,3 +3556,33 @@ typedef SDL_Colour, SDL_Color; - SDL_LinuxSetThreadPriorityAndPolicy + SDL_SetLinuxThreadPriorityAndPolicy (...) +@@ +@@ +- SDL_DXGIGetOutputInfo ++ SDL_GetDXGIOutputInfo + (...) +@@ +@@ +- SDL_AndroidBackButton ++ SDL_TriggerAndroidBackButton + (...) +@@ +@@ +- SDL_AndroidRequestPermission ++ SDL_RequestAndroidPermission + (...) +@@ +@@ +- SDL_AndroidRequestPermissionCallback ++ SDL_RequestAndroidPermissionCallback + (...) +@@ +@@ +- SDL_AndroidShowToast ++ SDL_ShowAndroidToast + (...) +@@ +@@ +- SDL_AndroidSendMessage ++ SDL_SendAndroidMessage + (...) diff --git a/docs/README-migration.md b/docs/README-migration.md index 571f094546117..3e733dcca2977 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1750,10 +1750,11 @@ SDL_WindowsMessageHook has changed signatures so the message may be modified and SDL_GetAndroidExternalStorageState() takes the state as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error. -SDL_AndroidRequestPermission is no longer a blocking call; the caller now provides a callback function that fires when a response is available. +SDL_RequestAndroidPermission is no longer a blocking call; the caller now provides a callback function that fires when a response is available. SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_SetiOSAnimationCallback() and SDL_SetiOSEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option. +SDL_GetDXGIOutputInfo() now returns the standard int error code. The following functions have been removed: * SDL_RenderGetD3D11Device() - replaced with the "SDL.renderer.d3d11.device" property @@ -1762,11 +1763,17 @@ The following functions have been removed: * SDL_GetWinRTFSPathUNICODE() - Use SDL_GetWinRTFSPath() and SDL_iconv_string to convert from UTF-8 to UTF-16. The following functions have been renamed: +* SDL_AndroidBackButton() => SDL_SendAndroidBackButton() * SDL_AndroidGetActivity() => SDL_GetAndroidActivity() * SDL_AndroidGetExternalStoragePath() => SDL_GetAndroidExternalStoragePath() * SDL_AndroidGetExternalStorageState() => SDL_GetAndroidExternalStorageState() * SDL_AndroidGetInternalStoragePath() => SDL_GetAndroidInternalStoragePath() * SDL_AndroidGetJNIEnv() => SDL_GetAndroidJNIEnv() +* SDL_AndroidRequestPermission() => SDL_RequestAndroidPermission() +* SDL_AndroidRequestPermissionCallback() => SDL_RequestAndroidPermissionCallback() +* SDL_AndroidSendMessage() => SDL_SendAndroidMessage() +* SDL_AndroidShowToast() => SDL_ShowAndroidToast() +* SDL_DXGIGetOutputInfo() => SDL_GetDXGIOutputInfo() * SDL_Direct3D9GetAdapterIndex() => SDL_GetDirect3D9AdapterIndex() * SDL_GDKGetDefaultUser() => SDL_GetGDKDefaultUser() * SDL_GDKGetTaskQueue() => SDL_GetGDKTaskQueue() diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index d6717d95f79a3..e714014e27d13 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -599,11 +599,17 @@ #define SDL_UpperBlitScaled SDL_BlitSurfaceScaled /* ##SDL_system.h */ +#define SDL_AndroidBackButton SDL_SendAndroidBackButton #define SDL_AndroidGetActivity SDL_GetAndroidActivity #define SDL_AndroidGetExternalStoragePath SDL_GetAndroidExternalStoragePath #define SDL_AndroidGetExternalStorageState SDL_GetAndroidExternalStorageState #define SDL_AndroidGetInternalStoragePath SDL_GetAndroidInternalStoragePath #define SDL_AndroidGetJNIEnv SDL_GetAndroidJNIEnv +#define SDL_AndroidRequestPermission SDL_RequestAndroidPermission +#define SDL_AndroidRequestPermissionCallback SDL_RequestAndroidPermissionCallback +#define SDL_AndroidSendMessage SDL_SendAndroidMessage +#define SDL_AndroidShowToast SDL_ShowAndroidToast +#define SDL_DXGIGetOutputInfo SDL_GetDXGIOutputInfo #define SDL_Direct3D9GetAdapterIndex SDL_GetDirect3D9AdapterIndex #define SDL_GDKGetDefaultUser SDL_GetGDKDefaultUser #define SDL_GDKGetTaskQueue SDL_GetGDKTaskQueue @@ -1210,11 +1216,17 @@ #define SDL_UpperBlitScaled SDL_UpperBlitScaled_renamed_SDL_BlitSurfaceScaled /* ##SDL_system.h */ +#define SDL_AndroidBackButton SDL_AndroidBackButton_renamed_SDL_SendAndroidBackButton #define SDL_AndroidGetActivity SDL_AndroidGetActivity_renamed_SDL_GetAndroidActivity #define SDL_AndroidGetExternalStoragePath SDL_AndroidGetExternalStoragePath_renamed_SDL_GetAndroidExternalStoragePath #define SDL_AndroidGetExternalStorageState SDL_AndroidGetExternalStorageState_renamed_SDL_GetAndroidExternalStorageState #define SDL_AndroidGetInternalStoragePath SDL_AndroidGetInternalStoragePath_renamed_SDL_GetAndroidInternalStoragePath #define SDL_AndroidGetJNIEnv SDL_AndroidGetJNIEnv_renamed_SDL_GetAndroidJNIEnv +#define SDL_AndroidRequestPermission SDL_AndroidRequestPermission_renamed_SDL_RequestAndroidPermission +#define SDL_AndroidRequestPermissionCallback SDL_AndroidRequestPermissionCallback_renamed_SDL_RequestAndroidPermissionCallback +#define SDL_AndroidSendMessage SDL_AndroidSendMessage_renamed_SDL_SendAndroidMessage +#define SDL_AndroidShowToast SDL_AndroidShowToast_renamed_SDL_ShowAndroidToast +#define SDL_DXGIGetOutputInfo SDL_DXGIGetOutputInfo_renamed_SDL_GetDXGIOutputInfo #define SDL_Direct3D9GetAdapterIndex SDL_Direct3D9GetAdapterIndex_renamed_SDL_GetDirect3D9AdapterIndex #define SDL_GDKGetDefaultUser SDL_GDKGetDefaultUser_renamed_SDL_GetGDKDefaultUser #define SDL_GDKGetTaskQueue SDL_GDKGetTaskQueue_renamed_SDL_GetGDKTaskQueue diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 1a0bcc9698902..3d9c9d9790333 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -122,12 +122,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displ * \param displayID the instance of the display to query. * \param adapterIndex a pointer to be filled in with the adapter index. * \param outputIndex a pointer to be filled in with the output index. - * \returns SDL_TRUE on success or SDL_FALSE on failure; call SDL_GetError() - * for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); +extern SDL_DECLSPEC int SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); #endif /* defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) */ @@ -383,7 +383,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void); +extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); /** * See the official Android developer guide for more information: @@ -483,7 +483,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void) extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidCachePath(void); -typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); +typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); /** * Request permissions at runtime, asynchronously. @@ -515,7 +515,7 @@ typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, con * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata); +extern SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); /** * Shows an Android toast notification. @@ -543,7 +543,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permiss * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset); +extern SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset); /** * Send a user command to SDLActivity. @@ -559,7 +559,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int du * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param); +extern SDL_DECLSPEC int SDLCALL SDL_SendAndroidMessage(Uint32 command, int param); #endif /* SDL_PLATFORM_ANDROID */ diff --git a/src/audio/aaudio/SDL_aaudio.c b/src/audio/aaudio/SDL_aaudio.c index c35b02fe7b497..76080fb58666a 100644 --- a/src/audio/aaudio/SDL_aaudio.c +++ b/src/audio/aaudio/SDL_aaudio.c @@ -382,7 +382,7 @@ static int BuildAAudioStream(SDL_AudioDevice *device) } // !!! FIXME: make this non-blocking! -static void SDLCALL AndroidRequestPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) { SDL_AtomicSet((SDL_AtomicInt *) userdata, granted ? 1 : -1); } @@ -399,7 +399,7 @@ static int AAUDIO_OpenDevice(SDL_AudioDevice *device) // !!! FIXME: make this non-blocking! SDL_AtomicInt permission_response; SDL_AtomicSet(&permission_response, 0); - if (SDL_AndroidRequestPermission("android.permission.RECORD_AUDIO", AndroidRequestPermissionBlockingCallback, &permission_response) == -1) { + if (SDL_RequestAndroidPermission("android.permission.RECORD_AUDIO", RequestAndroidPermissionBlockingCallback, &permission_response) == -1) { return -1; } diff --git a/src/audio/openslES/SDL_openslES.c b/src/audio/openslES/SDL_openslES.c index 63fc8d65482d7..3d1d0b75afd2e 100644 --- a/src/audio/openslES/SDL_openslES.c +++ b/src/audio/openslES/SDL_openslES.c @@ -229,7 +229,7 @@ static void OPENSLES_DestroyPCMRecorder(SDL_AudioDevice *device) } // !!! FIXME: make this non-blocking! -static void SDLCALL AndroidRequestPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) { SDL_AtomicSet((SDL_AtomicInt *) userdata, granted ? 1 : -1); } @@ -251,7 +251,7 @@ static int OPENSLES_CreatePCMRecorder(SDL_AudioDevice *device) { SDL_AtomicInt permission_response; SDL_AtomicSet(&permission_response, 0); - if (SDL_AndroidRequestPermission("android.permission.RECORD_AUDIO", AndroidRequestPermissionBlockingCallback, &permission_response) == -1) { + if (SDL_RequestAndroidPermission("android.permission.RECORD_AUDIO", RequestAndroidPermissionBlockingCallback, &permission_response) == -1) { return -1; } diff --git a/src/camera/android/SDL_camera_android.c b/src/camera/android/SDL_camera_android.c index 413e773213f93..75c6be439a94e 100644 --- a/src/camera/android/SDL_camera_android.c +++ b/src/camera/android/SDL_camera_android.c @@ -559,7 +559,7 @@ static int ANDROIDCAMERA_OpenDevice(SDL_Camera *device, const SDL_CameraSpec *sp // just in case SDL_OpenCamera is overwriting device->spec as CameraPermissionCallback runs, we work from a different copy. SDL_copyp(&device->hidden->requested_spec, spec); - if (SDL_AndroidRequestPermission("android.permission.CAMERA", CameraPermissionCallback, device) < 0) { + if (SDL_RequestAndroidPermission("android.permission.CAMERA", CameraPermissionCallback, device) < 0) { UnrefPhysicalCamera(device); return -1; } diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index 6badd4be66416..32add8afb7001 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -114,8 +114,8 @@ const char *SDL_GetWinRTFSPath(int pathType) #ifndef SDL_PLATFORM_ANDROID -SDL_DECLSPEC void SDLCALL SDL_AndroidBackButton(void); -void SDL_AndroidBackButton() +SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); +void SDL_SendAndroidBackButton() { SDL_Unsupported(); } @@ -162,9 +162,9 @@ void *SDL_GetAndroidJNIEnv() return NULL; } -typedef void (SDLCALL *SDL_AndroidRequestPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); -SDL_DECLSPEC int SDLCALL SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata); -int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata) +typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, SDL_bool granted); +SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata); +int SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata) { (void)permission; (void)cb; @@ -172,16 +172,16 @@ int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermi return SDL_Unsupported(); } -SDL_DECLSPEC int SDLCALL SDL_AndroidSendMessage(Uint32 command, int param); -int SDL_AndroidSendMessage(Uint32 command, int param) +SDL_DECLSPEC int SDLCALL SDL_SendAndroidMessage(Uint32 command, int param); +int SDL_SendAndroidMessage(Uint32 command, int param) { (void)command; (void)param; return SDL_Unsupported(); } -SDL_DECLSPEC int SDLCALL SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset); -int SDL_AndroidShowToast(const char* message, int duration, int gravity, int xoffset, int yoffset) +SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset); +int SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset) { (void)message; (void)duration; diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index d9988353fa9e5..fc0a949da1c68 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -2245,7 +2245,7 @@ void Android_JNI_HapticStop(int device_id) /* See SDLActivity.java for constants. */ #define COMMAND_SET_KEEP_SCREEN_ON 5 -int SDL_AndroidSendMessage(Uint32 command, int param) +int SDL_SendAndroidMessage(Uint32 command, int param) { if (command >= 0x8000) { return Android_JNI_SendMessage(command, param); @@ -2446,7 +2446,7 @@ SDL_bool SDL_IsDeXMode(void) return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode); } -void SDL_AndroidBackButton(void) +void SDL_SendAndroidBackButton(void) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton); @@ -2645,7 +2645,7 @@ const char *SDL_GetAndroidCachePath(void) return s_AndroidCachePath; } -int SDL_AndroidShowToast(const char *message, int duration, int gravity, int xOffset, int yOffset) +int SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset) { return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset); } @@ -2716,7 +2716,7 @@ typedef struct NativePermissionRequestInfo { int request_code; char *permission; - SDL_AndroidRequestPermissionCallback callback; + SDL_RequestAndroidPermissionCallback callback; void *userdata; struct NativePermissionRequestInfo *next; } NativePermissionRequestInfo; @@ -2744,7 +2744,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)( SDL_UnlockMutex(Android_ActivityMutex); } -int SDL_AndroidRequestPermission(const char *permission, SDL_AndroidRequestPermissionCallback cb, void *userdata) +int SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata) { if (!permission) { return SDL_InvalidParamError("permission"); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 72f5f453a035f..81cc006ba21dd 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -12,10 +12,6 @@ SDL3_0.0.0 { SDL_AddTimerNS; SDL_AddVulkanRenderSemaphores; SDL_AllocateEventMemory; - SDL_AndroidBackButton; - SDL_AndroidRequestPermission; - SDL_AndroidSendMessage; - SDL_AndroidShowToast; SDL_AtomicAdd; SDL_AtomicCompareAndSwap; SDL_AtomicCompareAndSwapPointer; @@ -85,7 +81,6 @@ SDL3_0.0.0 { SDL_CreateWindowAndRenderer; SDL_CreateWindowWithProperties; SDL_CursorVisible; - SDL_DXGIGetOutputInfo; SDL_DateTimeToTime; SDL_DelEventWatch; SDL_DelHintCallback; @@ -204,6 +199,7 @@ SDL3_0.0.0 { SDL_GetCurrentTime; SDL_GetCurrentVideoDriver; SDL_GetCursor; + SDL_GetDXGIOutputInfo; SDL_GetDateTimeLocalePreferences; SDL_GetDayOfWeek; SDL_GetDayOfYear; @@ -666,6 +662,7 @@ SDL3_0.0.0 { SDL_RenderTextureRotated; SDL_RenderViewportSet; SDL_ReportAssertion; + SDL_RequestAndroidPermission; SDL_ResetAssertionReport; SDL_ResetHint; SDL_ResetHints; @@ -686,6 +683,8 @@ SDL3_0.0.0 { SDL_ScreenKeyboardShown; SDL_ScreenSaverEnabled; SDL_SeekIO; + SDL_SendAndroidBackButton; + SDL_SendAndroidMessage; SDL_SendGamepadEffect; SDL_SendJoystickEffect; SDL_SendJoystickVirtualSensorData; @@ -792,6 +791,7 @@ SDL3_0.0.0 { SDL_SetX11EventHook; SDL_SetiOSAnimationCallback; SDL_SetiOSEventPump; + SDL_ShowAndroidToast; SDL_ShowCursor; SDL_ShowMessageBox; SDL_ShowOpenFileDialog; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 0be1dbbcdda05..7407e5f55f432 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -37,10 +37,6 @@ #define SDL_AddTimerNS SDL_AddTimerNS_REAL #define SDL_AddVulkanRenderSemaphores SDL_AddVulkanRenderSemaphores_REAL #define SDL_AllocateEventMemory SDL_AllocateEventMemory_REAL -#define SDL_AndroidBackButton SDL_AndroidBackButton_REAL -#define SDL_AndroidRequestPermission SDL_AndroidRequestPermission_REAL -#define SDL_AndroidSendMessage SDL_AndroidSendMessage_REAL -#define SDL_AndroidShowToast SDL_AndroidShowToast_REAL #define SDL_AtomicAdd SDL_AtomicAdd_REAL #define SDL_AtomicCompareAndSwap SDL_AtomicCompareAndSwap_REAL #define SDL_AtomicCompareAndSwapPointer SDL_AtomicCompareAndSwapPointer_REAL @@ -110,7 +106,6 @@ #define SDL_CreateWindowAndRenderer SDL_CreateWindowAndRenderer_REAL #define SDL_CreateWindowWithProperties SDL_CreateWindowWithProperties_REAL #define SDL_CursorVisible SDL_CursorVisible_REAL -#define SDL_DXGIGetOutputInfo SDL_DXGIGetOutputInfo_REAL #define SDL_DateTimeToTime SDL_DateTimeToTime_REAL #define SDL_DelEventWatch SDL_DelEventWatch_REAL #define SDL_DelHintCallback SDL_DelHintCallback_REAL @@ -229,6 +224,7 @@ #define SDL_GetCurrentTime SDL_GetCurrentTime_REAL #define SDL_GetCurrentVideoDriver SDL_GetCurrentVideoDriver_REAL #define SDL_GetCursor SDL_GetCursor_REAL +#define SDL_GetDXGIOutputInfo SDL_GetDXGIOutputInfo_REAL #define SDL_GetDateTimeLocalePreferences SDL_GetDateTimeLocalePreferences_REAL #define SDL_GetDayOfWeek SDL_GetDayOfWeek_REAL #define SDL_GetDayOfYear SDL_GetDayOfYear_REAL @@ -691,6 +687,7 @@ #define SDL_RenderTextureRotated SDL_RenderTextureRotated_REAL #define SDL_RenderViewportSet SDL_RenderViewportSet_REAL #define SDL_ReportAssertion SDL_ReportAssertion_REAL +#define SDL_RequestAndroidPermission SDL_RequestAndroidPermission_REAL #define SDL_ResetAssertionReport SDL_ResetAssertionReport_REAL #define SDL_ResetHint SDL_ResetHint_REAL #define SDL_ResetHints SDL_ResetHints_REAL @@ -711,6 +708,8 @@ #define SDL_ScreenKeyboardShown SDL_ScreenKeyboardShown_REAL #define SDL_ScreenSaverEnabled SDL_ScreenSaverEnabled_REAL #define SDL_SeekIO SDL_SeekIO_REAL +#define SDL_SendAndroidBackButton SDL_SendAndroidBackButton_REAL +#define SDL_SendAndroidMessage SDL_SendAndroidMessage_REAL #define SDL_SendGamepadEffect SDL_SendGamepadEffect_REAL #define SDL_SendJoystickEffect SDL_SendJoystickEffect_REAL #define SDL_SendJoystickVirtualSensorData SDL_SendJoystickVirtualSensorData_REAL @@ -817,6 +816,7 @@ #define SDL_SetX11EventHook SDL_SetX11EventHook_REAL #define SDL_SetiOSAnimationCallback SDL_SetiOSAnimationCallback_REAL #define SDL_SetiOSEventPump SDL_SetiOSEventPump_REAL +#define SDL_ShowAndroidToast SDL_ShowAndroidToast_REAL #define SDL_ShowCursor SDL_ShowCursor_REAL #define SDL_ShowMessageBox SDL_ShowMessageBox_REAL #define SDL_ShowOpenFileDialog SDL_ShowOpenFileDialog_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 90524782d5ea2..53d213fcf81eb 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -57,10 +57,6 @@ SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimer,(Uint32 a, SDL_TimerCallback b, void *c SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimerNS,(Uint64 a, SDL_NSTimerCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Sint64 c, Sint64 d),(a,b,c,d),return) SDL_DYNAPI_PROC(void*,SDL_AllocateEventMemory,(size_t a),(a),return) -SDL_DYNAPI_PROC(void,SDL_AndroidBackButton,(void),(),) -SDL_DYNAPI_PROC(int,SDL_AndroidRequestPermission,(const char *a, SDL_AndroidRequestPermissionCallback b, void *c),(a,b,c),return) -SDL_DYNAPI_PROC(int,SDL_AndroidSendMessage,(Uint32 a, int b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_AndroidShowToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_AtomicAdd,(SDL_AtomicInt *a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCompareAndSwap,(SDL_AtomicInt *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCompareAndSwapPointer,(void **a, void *b, void *c),(a,b,c),return) @@ -130,7 +126,6 @@ SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindow,(const char *a, int b, int c, SDL_W SDL_DYNAPI_PROC(int,SDL_CreateWindowAndRenderer,(const char *a, int b, int c, SDL_WindowFlags d, SDL_Window **e, SDL_Renderer **f),(a,b,c,d,e,f),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindowWithProperties,(SDL_PropertiesID a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_CursorVisible,(void),(),return) -SDL_DYNAPI_PROC(SDL_bool,SDL_DXGIGetOutputInfo,(SDL_DisplayID a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_DateTimeToTime,(const SDL_DateTime *a, SDL_Time *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_DelEventWatch,(SDL_EventFilter a, void *b),(a,b),) SDL_DYNAPI_PROC(void,SDL_DelHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),) @@ -249,6 +244,7 @@ SDL_DYNAPI_PROC(SDL_ThreadID,SDL_GetCurrentThreadID,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetCurrentTime,(SDL_Time *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentVideoDriver,(void),(),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_GetCursor,(void),(),return) +SDL_DYNAPI_PROC(int,SDL_GetDXGIOutputInfo,(SDL_DisplayID a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetDateTimeLocalePreferences,(SDL_DateFormat *a, SDL_TimeFormat *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetDayOfWeek,(int a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetDayOfYear,(int a, int b, int c),(a,b,c),return) @@ -702,6 +698,7 @@ SDL_DYNAPI_PROC(int,SDL_RenderTexture,(SDL_Renderer *a, SDL_Texture *b, const SD SDL_DYNAPI_PROC(int,SDL_RenderTextureRotated,(SDL_Renderer *a, SDL_Texture *b, const SDL_FRect *c, const SDL_FRect *d, const double e, const SDL_FPoint *f, const SDL_FlipMode g),(a,b,c,d,e,f,g),return) SDL_DYNAPI_PROC(SDL_bool,SDL_RenderViewportSet,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(SDL_AssertState,SDL_ReportAssertion,(SDL_AssertData *a, const char *b, const char *c, int d),(a,b,c,d),return) +SDL_DYNAPI_PROC(int,SDL_RequestAndroidPermission,(const char *a, SDL_RequestAndroidPermissionCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(void,SDL_ResetAssertionReport,(void),(),) SDL_DYNAPI_PROC(SDL_bool,SDL_ResetHint,(const char *a),(a),return) SDL_DYNAPI_PROC(void,SDL_ResetHints,(void),(),) @@ -722,6 +719,8 @@ SDL_DYNAPI_PROC(int,SDL_SaveBMP_IO,(SDL_Surface *a, SDL_IOStream *b, SDL_bool c) SDL_DYNAPI_PROC(SDL_bool,SDL_ScreenKeyboardShown,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_ScreenSaverEnabled,(void),(),return) SDL_DYNAPI_PROC(Sint64,SDL_SeekIO,(SDL_IOStream *a, Sint64 b, SDL_IOWhence c),(a,b,c),return) +SDL_DYNAPI_PROC(void,SDL_SendAndroidBackButton,(void),(),) +SDL_DYNAPI_PROC(int,SDL_SendAndroidMessage,(Uint32 a, int b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SendGamepadEffect,(SDL_Gamepad *a, const void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SendJoystickEffect,(SDL_Joystick *a, const void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SendJoystickVirtualSensorData,(SDL_Joystick *a, SDL_SensorType b, Uint64 c, const float *d, int e),(a,b,c,d,e),return) @@ -827,6 +826,7 @@ SDL_DYNAPI_PROC(void,SDL_SetWindowsMessageHook,(SDL_WindowsMessageHook a, void * SDL_DYNAPI_PROC(void,SDL_SetX11EventHook,(SDL_X11EventHook a, void *b),(a,b),) SDL_DYNAPI_PROC(int,SDL_SetiOSAnimationCallback,(SDL_Window *a, int b, SDL_iOSAnimationCallback c, void *d),(a,b,c,d),return) SDL_DYNAPI_PROC(void,SDL_SetiOSEventPump,(SDL_bool a),(a),) +SDL_DYNAPI_PROC(int,SDL_ShowAndroidToast,(const char *a, int b, int c, int d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_ShowCursor,(void),(),return) SDL_DYNAPI_PROC(int,SDL_ShowMessageBox,(const SDL_MessageBoxData *a, int *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_ShowOpenFileDialog,(SDL_DialogFileCallback a, void *b, SDL_Window *c, const SDL_DialogFileFilter *d, int e, const char *f, SDL_bool g),(a,b,c,d,e,f,g),) diff --git a/src/dynapi/SDL_dynapi_unsupported.h b/src/dynapi/SDL_dynapi_unsupported.h index 272cd5e083fad..ce6864c86cc66 100644 --- a/src/dynapi/SDL_dynapi_unsupported.h +++ b/src/dynapi/SDL_dynapi_unsupported.h @@ -46,7 +46,7 @@ typedef struct XUserHandle XUserHandle; #endif #ifndef SDL_PLATFORM_ANDROID -typedef void *SDL_AndroidRequestPermissionCallback; +typedef void *SDL_RequestAndroidPermissionCallback; #endif #ifndef SDL_PLATFORM_IOS diff --git a/src/hidapi/android/hid.cpp b/src/hidapi/android/hid.cpp index b15f8ba5d76e6..c1c2288310b2e 100644 --- a/src/hidapi/android/hid.cpp +++ b/src/hidapi/android/hid.cpp @@ -1030,7 +1030,7 @@ extern "C" { // !!! FIXME: make this non-blocking! -static void SDLCALL AndroidRequestPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) +static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted) { SDL_AtomicSet((SDL_AtomicInt *) userdata, granted ? 1 : -1); } @@ -1040,7 +1040,7 @@ static SDL_bool RequestBluetoothPermissions(const char *permission) // !!! FIXME: make this non-blocking! SDL_AtomicInt permission_response; SDL_AtomicSet(&permission_response, 0); - if (SDL_AndroidRequestPermission(permission, AndroidRequestPermissionBlockingCallback, &permission_response) == -1) { + if (SDL_RequestAndroidPermission(permission, RequestAndroidPermissionBlockingCallback, &permission_response) == -1) { return SDL_FALSE; } diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index a60896dec4963..3c9b9e819dcd9 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1266,7 +1266,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) SDL_Log("D3D9 Adapter Index: %d", adapterIndex); /* Print the DXGI adapter and output indices */ - SDL_DXGIGetOutputInfo(displayID, &adapterIndex, &outputIndex); + SDL_GetDXGIOutputInfo(displayID, &adapterIndex, &outputIndex); SDL_Log("DXGI Adapter Index: %d Output Index: %d", adapterIndex, outputIndex); #endif } diff --git a/src/video/SDL_video_unsupported.c b/src/video/SDL_video_unsupported.c index 8306816aad26f..05ba3c743b74e 100644 --- a/src/video/SDL_video_unsupported.c +++ b/src/video/SDL_video_unsupported.c @@ -42,14 +42,13 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata) #endif /* SDL_PLATFORM_WIN32 || SDL_PLATFORM_GDK */ -SDL_DECLSPEC SDL_bool SDLCALL SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); -SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) +SDL_DECLSPEC int SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex); +SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) { (void)displayID; (void)adapterIndex; (void)outputIndex; - SDL_Unsupported(); - return SDL_FALSE; + return SDL_Unsupported(); } SDL_DECLSPEC int SDLCALL SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID); diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index 1fe196de6c5aa..ba43b36f64943 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -629,7 +629,7 @@ int SDL_GetDirect3D9AdapterIndex(SDL_DisplayID displayID) } #endif /* !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) */ -SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) +int SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex) { #ifndef HAVE_DXGI_H if (adapterIndex) { @@ -638,8 +638,7 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * if (outputIndex) { *outputIndex = -1; } - SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header"); - return SDL_FALSE; + return SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header"); #else const SDL_VideoDevice *videodevice = SDL_GetVideoDevice(); const SDL_VideoData *videodata = videodevice ? videodevice->driverdata : NULL; @@ -649,26 +648,22 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * IDXGIOutput *pDXGIOutput; if (!adapterIndex) { - SDL_InvalidParamError("adapterIndex"); - return SDL_FALSE; + return SDL_InvalidParamError("adapterIndex"); } if (!outputIndex) { - SDL_InvalidParamError("outputIndex"); - return SDL_FALSE; + return SDL_InvalidParamError("outputIndex"); } *adapterIndex = -1; *outputIndex = -1; if (!pData) { - SDL_SetError("Invalid display index"); - return SDL_FALSE; + return SDL_SetError("Invalid display index"); } if (!videodata || !videodata->pDXGIFactory) { - SDL_SetError("Unable to create DXGI interface"); - return SDL_FALSE; + return SDL_SetError("Unable to create DXGI interface"); } nAdapter = 0; @@ -690,10 +685,9 @@ SDL_bool SDL_DXGIGetOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int * } if (*adapterIndex == -1) { - return SDL_FALSE; - } else { - return SDL_TRUE; + return SDL_SetError("Couldn't find matching adapter"); } + return 0; #endif } From 027671bedb7e961016ad418d2f3174e7c9c1ef81 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 07:25:48 -0700 Subject: [PATCH 330/431] SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter. Fixes https://github.com/libsdl-org/SDL/issues/10286 --- docs/README-migration.md | 3 ++- include/SDL3/SDL_video.h | 11 +++-------- src/dynapi/SDL_dynapi_procs.h | 2 +- src/test/SDL_test_common.c | 14 ++++++-------- src/video/SDL_video.c | 10 +++------- 5 files changed, 15 insertions(+), 25 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 3e733dcca2977..7dbc2556c3489 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -2050,9 +2050,10 @@ SDL_GL_GetDrawableSize() has been removed. SDL_GetWindowSizeInPixels() can be us The SDL_WINDOW_TOOLTIP and SDL_WINDOW_POPUP_MENU window flags are now supported on Windows, Mac (Cocoa), X11, and Wayland. Creating windows with these flags must happen via the `SDL_CreatePopupWindow()` function. This function requires passing in the handle to a valid parent window for the popup, and the popup window is positioned relative to the parent. - SDL_WindowFlags is used instead of Uint32 for API functions that refer to window flags, and has been extended to 64 bits. +SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter. + The following functions have been renamed: * SDL_GL_DeleteContext() => SDL_GL_DestroyContext() * SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode() diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index a1e04737f3046..b2549b9ed794b 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -2143,23 +2143,18 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float o /** * Get the opacity of a window. * - * If transparency isn't supported on this platform, opacity will be reported + * If transparency isn't supported on this platform, opacity will be returned * as 1.0f without error. * - * The parameter `opacity` is ignored if it is NULL. - * - * This function also returns -1 if an invalid window was provided. - * * \param window the window to get the current opacity value from. - * \param out_opacity the float filled in (0.0f - transparent, 1.0f - opaque). - * \returns 0 on success or a negative error code on failure; call + * \returns the opacity, (0.0f - transparent, 1.0f - opaque), or a negative error code on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetWindowOpacity */ -extern SDL_DECLSPEC int SDLCALL SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity); +extern SDL_DECLSPEC float SDLCALL SDL_GetWindowOpacity(SDL_Window *window); /** * Set the window as a modal to a parent window. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 53d213fcf81eb..0d344ec469106 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -520,7 +520,7 @@ SDL_DYNAPI_PROC(int,SDL_GetWindowMaximumSize,(SDL_Window *a, int *b, int *c),(a, SDL_DYNAPI_PROC(int,SDL_GetWindowMinimumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowMouseGrab,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(const SDL_Rect*,SDL_GetWindowMouseRect,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetWindowOpacity,(SDL_Window *a, float *b),(a,b),return) +SDL_DYNAPI_PROC(float,SDL_GetWindowOpacity,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowParent,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(float,SDL_GetWindowPixelDensity,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_PixelFormat,SDL_GetWindowPixelFormat,(SDL_Window *a),(a),return) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 3c9b9e819dcd9..03ab26078f161 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2216,15 +2216,13 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event /* Ctrl-O (or Ctrl-Shift-O) changes window opacity. */ SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { - float opacity; - if (SDL_GetWindowOpacity(window, &opacity) == 0) { - if (withShift) { - opacity += 0.20f; - } else { - opacity -= 0.20f; - } - SDL_SetWindowOpacity(window, opacity); + float opacity = SDL_GetWindowOpacity(window); + if (withShift) { + opacity += 0.20f; + } else { + opacity -= 0.20f; } + SDL_SetWindowOpacity(window, opacity); } } break; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index a143bbfa533fe..4633a02878476 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -3504,15 +3504,11 @@ int SDL_SetWindowOpacity(SDL_Window *window, float opacity) return retval; } -int SDL_GetWindowOpacity(SDL_Window *window, float *out_opacity) +float SDL_GetWindowOpacity(SDL_Window *window) { - CHECK_WINDOW_MAGIC(window, -1); - - if (out_opacity) { - *out_opacity = window->opacity; - } + CHECK_WINDOW_MAGIC(window, -1.0f); - return 0; + return window->opacity; } int SDL_SetWindowModalFor(SDL_Window *modal_window, SDL_Window *parent_window) From 70727d36b28d90127049a9c23e10d395a0f39876 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 16 Jul 2024 16:37:08 +0000 Subject: [PATCH 331/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_video.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index b2549b9ed794b..c7f43c8a98a06 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -2147,8 +2147,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowOpacity(SDL_Window *window, float o * as 1.0f without error. * * \param window the window to get the current opacity value from. - * \returns the opacity, (0.0f - transparent, 1.0f - opaque), or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the opacity, (0.0f - transparent, 1.0f - opaque), or a negative + * error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * From 723c1cc5b36a445e5dd9fc2e58f551705be53089 Mon Sep 17 00:00:00 2001 From: huanhuan-jiang Date: Tue, 16 Jul 2024 10:53:57 -0700 Subject: [PATCH 332/431] Print message in summary when a X11 or wayland video driver is not found --- cmake/macros.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/macros.cmake b/cmake/macros.cmake index c250400b9850d..aab621d0d9f49 100644 --- a/cmake/macros.cmake +++ b/cmake/macros.cmake @@ -393,6 +393,14 @@ function(SDL_PrintSummary) message(STATUS " -DSDL_ARMNEON=OFF") message(STATUS "") endif() + + if(UNIX AND NOT (ANDROID OR APPLE)) + if(NOT (HAVE_X11 OR HAVE_WAYLAND)) + message(STATUS "SDL is being built without a X11 or wayland video driver.") + message(STATUS "The library will not be able to create windows on most unix environments.") + message(STATUS "") + endif() + endif() endfunction() function(SDL_install_pdb TARGET DIRECTORY) From 045f0456b1e743657c3eaf6c93401c8aaa928aa1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 16 Jul 2024 14:15:38 -0400 Subject: [PATCH 333/431] dummyvideo: Change a thing using int to use SDL_bool instead. --- src/video/dummy/SDL_nullvideo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c index 961d5b535c123..e4f8efa902701 100644 --- a/src/video/dummy/SDL_nullvideo.c +++ b/src/video/dummy/SDL_nullvideo.c @@ -68,15 +68,15 @@ static void DUMMY_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) /* DUMMY driver bootstrap functions */ -static int DUMMY_Available(const char *enable_hint) +static SDL_bool DUMMY_Available(const char *enable_hint) { const char *hint = SDL_GetHint(SDL_HINT_VIDEO_DRIVER); if (hint) { if (SDL_strcmp(hint, enable_hint) == 0) { - return 1; + return SDL_TRUE; } } - return 0; + return SDL_FALSE; } static void DUMMY_DeleteDevice(SDL_VideoDevice *device) From bc1ceb0883cc7dc973b42a852927395d9f1432a2 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 16 Jul 2024 14:17:02 -0400 Subject: [PATCH 334/431] dummyvideo: Change a thing returning a 0 pointer to return NULL instead. --- src/video/dummy/SDL_nullvideo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/video/dummy/SDL_nullvideo.c b/src/video/dummy/SDL_nullvideo.c index e4f8efa902701..a001433b5542e 100644 --- a/src/video/dummy/SDL_nullvideo.c +++ b/src/video/dummy/SDL_nullvideo.c @@ -89,13 +89,13 @@ static SDL_VideoDevice *DUMMY_InternalCreateDevice(const char *enable_hint) SDL_VideoDevice *device; if (!DUMMY_Available(enable_hint)) { - return 0; + return NULL; } /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } device->is_dummy = SDL_TRUE; From d78ef58b4bc6eb9a28e91d48e151b682075c9481 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 16 Jul 2024 14:19:58 -0400 Subject: [PATCH 335/431] offscreen: Don't ever use this backend unless explicitly requested. Reference PR #10202. --- src/video/offscreen/SDL_offscreenvideo.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/video/offscreen/SDL_offscreenvideo.c b/src/video/offscreen/SDL_offscreenvideo.c index 9d2cec86fcd6b..d9835ab4e8101 100644 --- a/src/video/offscreen/SDL_offscreenvideo.c +++ b/src/video/offscreen/SDL_offscreenvideo.c @@ -51,14 +51,29 @@ static void OFFSCREEN_DeleteDevice(SDL_VideoDevice *device) SDL_free(device); } +static SDL_bool OFFSCREEN_Available(const char *enable_hint) +{ + const char *hint = SDL_GetHint(SDL_HINT_VIDEO_DRIVER); + if (hint) { + if (SDL_strcmp(hint, enable_hint) == 0) { + return SDL_TRUE; + } + } + return SDL_FALSE; +} + static SDL_VideoDevice *OFFSCREEN_CreateDevice(void) { SDL_VideoDevice *device; + if (!OFFSCREEN_Available(OFFSCREENVID_DRIVER_NAME)) { + return NULL; + } + /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } /* General video */ From 1592452cad7f99a45d44956562e5663b23ceb82b Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 16 Jul 2024 14:25:53 -0400 Subject: [PATCH 336/431] video: Fixed remaining `return 0` to use NULL in CreateDevice implementations. --- src/video/emscripten/SDL_emscriptenvideo.c | 2 +- src/video/n3ds/SDL_n3dsvideo.c | 2 +- src/video/ngage/SDL_ngagevideo.cpp | 4 ++-- src/video/ps2/SDL_ps2video.c | 2 +- src/video/riscos/SDL_riscosvideo.c | 2 +- src/video/winrt/SDL_winrtvideo.cpp | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 1ab7391aec014..86fd050b47037 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -62,7 +62,7 @@ static SDL_VideoDevice *Emscripten_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } /* Firefox sends blur event which would otherwise prevent full screen diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index 1c1f43204a435..7f7d5a2a9c945 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -79,7 +79,7 @@ static SDL_VideoDevice *N3DS_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } /* Initialize internal data */ diff --git a/src/video/ngage/SDL_ngagevideo.cpp b/src/video/ngage/SDL_ngagevideo.cpp index a543494c58e89..532403eeaf140 100644 --- a/src/video/ngage/SDL_ngagevideo.cpp +++ b/src/video/ngage/SDL_ngagevideo.cpp @@ -105,14 +105,14 @@ static SDL_VideoDevice *NGAGE_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } /* Initialize internal N-Gage specific data */ phdata = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); if (!phdata) { SDL_free(device); - return 0; + return NULL; } /* General video */ diff --git a/src/video/ps2/SDL_ps2video.c b/src/video/ps2/SDL_ps2video.c index cb29cf0015df8..e470f3ccb7964 100644 --- a/src/video/ps2/SDL_ps2video.c +++ b/src/video/ps2/SDL_ps2video.c @@ -96,7 +96,7 @@ static SDL_VideoDevice *PS2_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } /* Set the function pointers */ diff --git a/src/video/riscos/SDL_riscosvideo.c b/src/video/riscos/SDL_riscosvideo.c index bb4c1c2220942..a4d2208e7daa6 100644 --- a/src/video/riscos/SDL_riscosvideo.c +++ b/src/video/riscos/SDL_riscosvideo.c @@ -58,7 +58,7 @@ static SDL_VideoDevice *RISCOS_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } /* Initialize internal data */ diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 3e06e852dce85..03d3194b09678 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -108,13 +108,13 @@ static SDL_VideoDevice *WINRT_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *)SDL_calloc(1, sizeof(SDL_VideoDevice)); if (!device) { - return 0; + return NULL; } data = (SDL_VideoData *)SDL_calloc(1, sizeof(SDL_VideoData)); if (!data) { SDL_free(device); - return 0; + return NULL; } device->driverdata = data; From ec3bb4c029fccc85b9612d86e017a883a81055cc Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 09:43:07 -0700 Subject: [PATCH 337/431] Removed the need for SDL_CreateTLS() This eliminates the tap dancing needed for allocating TLS slots, we'll automatically allocate them as needed, in a thread-safe way. --- build-scripts/SDL_migration.cocci | 5 -- docs/README-migration.md | 6 ++- include/SDL3/SDL_oldnames.h | 2 - include/SDL3/SDL_thread.h | 39 ++++++-------- src/dynapi/SDL_dynapi.sym | 1 - src/dynapi/SDL_dynapi_overrides.h | 1 - src/dynapi/SDL_dynapi_procs.h | 5 +- src/thread/SDL_thread.c | 88 +++++++++++++------------------ src/thread/SDL_thread_c.h | 2 +- src/timer/windows/SDL_systimer.c | 7 +-- src/video/SDL_video.c | 15 +++--- test/testthread.c | 12 ++--- 12 files changed, 73 insertions(+), 110 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 71e34620a2f10..08615cbc2da70 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -2630,11 +2630,6 @@ typedef SDL_cond, SDL_Condition; + SDL_WINDOW_HIGH_PIXEL_DENSITY @@ @@ -- SDL_TLSCreate -+ SDL_CreateTLS - (...) -@@ -@@ - SDL_TLSGet + SDL_GetTLS (...) diff --git a/docs/README-migration.md b/docs/README-migration.md index 7dbc2556c3489..ee5052dc19fbf 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1886,13 +1886,17 @@ SDL_CreateThreadWithStackSize has been replaced with SDL_CreateThreadWithPropert SDL_CreateThread and SDL_CreateThreadWithProperties now take beginthread/endthread function pointers on all platforms (ignoring them on most), and have been replaced with macros that hide this detail on all platforms. This works the same as before at the source code level, but the actual function signature that is called in SDL has changed. The library's exported symbol is SDL_CreateThreadRuntime, and looking for "SDL_CreateThread" in the DLL/Shared Library/Dylib will fail. You should not call this directly, but instead always use the macro! +SDL_GetTLS() and SDL_SetTLS() take a pointer to a TLS ID, and will automatically initialize it in a thread-safe way as needed. + The following functions have been renamed: * SDL_TLSCleanup() => SDL_CleanupTLS() -* SDL_TLSCreate() => SDL_CreateTLS() * SDL_TLSGet() => SDL_GetTLS() * SDL_TLSSet() => SDL_SetTLS() * SDL_ThreadID() => SDL_GetCurrentThreadID() +The following functions have been removed: +* SDL_TLSCreate() - TLS IDs are automatically allocated as needed. + The following symbols have been renamed: * SDL_threadID => SDL_ThreadID diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index e714014e27d13..92b7da94cb008 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -624,7 +624,6 @@ /* ##SDL_thread.h */ #define SDL_TLSCleanup SDL_CleanupTLS -#define SDL_TLSCreate SDL_CreateTLS #define SDL_TLSGet SDL_GetTLS #define SDL_TLSSet SDL_SetTLS #define SDL_threadID SDL_ThreadID @@ -1241,7 +1240,6 @@ /* ##SDL_thread.h */ #define SDL_TLSCleanup SDL_TLSCleanup_renamed_SDL_CleanupTLS -#define SDL_TLSCreate SDL_TLSCreate_renamed_SDL_CreateTLS #define SDL_TLSGet SDL_TLSGet_renamed_SDL_GetTLS #define SDL_TLSSet SDL_TLSSet_renamed_SDL_SetTLS #define SDL_threadID SDL_threadID_renamed_SDL_ThreadID diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index f15a0f105fdac..906f9cace26dd 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -73,18 +73,17 @@ typedef struct SDL_Thread SDL_Thread; typedef Uint64 SDL_ThreadID; /** - * Thread local storage ID values. + * Thread local storage ID. * * 0 is the invalid ID. An app can create these and then set data for these * IDs that is unique to each thread. * * \since This datatype is available since SDL 3.0.0. * - * \sa SDL_CreateTLS * \sa SDL_GetTLS * \sa SDL_SetTLS */ -typedef Uint32 SDL_TLSID; +typedef SDL_AtomicInt SDL_TLSID; /** * The SDL thread priority. @@ -462,34 +461,20 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status */ extern SDL_DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); -/** - * Create a piece of thread-local storage. - * - * This creates an identifier that is globally visible to all threads but - * refers to data that is thread-specific. - * - * \returns the newly created thread local storage identifier or 0 on error. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetTLS - * \sa SDL_SetTLS - */ -extern SDL_DECLSPEC SDL_TLSID SDLCALL SDL_CreateTLS(void); - /** * Get the current thread's value associated with a thread local storage ID. * - * \param id the thread local storage ID. + * \param id a pointer to the thread local storage ID, may not be NULL. * \returns the value associated with the ID for the current thread or NULL if * no value has been set; call SDL_GetError() for more information. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTLS */ -extern SDL_DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID id); - +extern SDL_DECLSPEC void * SDLCALL SDL_GetTLS(SDL_TLSID *id); /** * The callback used to cleanup data passed to SDL_SetTLS. @@ -507,28 +492,34 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); /** * Set the current thread's value associated with a thread local storage ID. * + * If the thread local storage ID is not initialized (the value is 0), a new ID will be created in a thread-safe way, so all calls using a pointer to the same ID will refer to the same local storage. + * * Note that replacing a value from a previous call to this function on the * same thread does _not_ call the previous value's destructor! * * `destructor` can be NULL; it is assumed that `value` does not need to be * cleaned up if so. * - * \param id the thread local storage ID. + * \param id a pointer to the thread local storage ID, may not be NULL. * \param value the value to associate with the ID for the current thread. * \param destructor a function called when the thread exits, to free the - * value. Can be NULL. + * value, may be NULL. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetTLS */ -extern SDL_DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destructor); +extern SDL_DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor); /** * Cleanup all TLS data for this thread. * + * \threadsafety It is safe to call this function from any thread. + * * \since This function is available since SDL 3.0.0. */ extern SDL_DECLSPEC void SDLCALL SDL_CleanupTLS(void); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 81cc006ba21dd..61461d4e8af46 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -71,7 +71,6 @@ SDL3_0.0.0 { SDL_CreateSurfaceFrom; SDL_CreateSurfacePalette; SDL_CreateSystemCursor; - SDL_CreateTLS; SDL_CreateTexture; SDL_CreateTextureFromSurface; SDL_CreateTextureWithProperties; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 7407e5f55f432..fdf24d66910e4 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -96,7 +96,6 @@ #define SDL_CreateSurfaceFrom SDL_CreateSurfaceFrom_REAL #define SDL_CreateSurfacePalette SDL_CreateSurfacePalette_REAL #define SDL_CreateSystemCursor SDL_CreateSystemCursor_REAL -#define SDL_CreateTLS SDL_CreateTLS_REAL #define SDL_CreateTexture SDL_CreateTexture_REAL #define SDL_CreateTextureFromSurface SDL_CreateTextureFromSurface_REAL #define SDL_CreateTextureWithProperties SDL_CreateTextureWithProperties_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 0d344ec469106..477cd502ba385 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -116,7 +116,6 @@ SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurface,(int a, int b, SDL_PixelFormat c) SDL_DYNAPI_PROC(SDL_Surface*,SDL_CreateSurfaceFrom,(int a, int b, SDL_PixelFormat c, void *d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_CreateSurfacePalette,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateSystemCursor,(SDL_SystemCursor a),(a),return) -SDL_DYNAPI_PROC(SDL_TLSID,SDL_CreateTLS,(void),(),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTexture,(SDL_Renderer *a, SDL_PixelFormat b, int c, int d, int e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureFromSurface,(SDL_Renderer *a, SDL_Surface *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Texture*,SDL_CreateTextureWithProperties,(SDL_Renderer *a, SDL_PropertiesID b),(a,b),return) @@ -484,7 +483,7 @@ SDL_DYNAPI_PROC(SDL_Palette*,SDL_GetSurfacePalette,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSurfaceProperties,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSystemRAM,(void),(),return) SDL_DYNAPI_PROC(SDL_SystemTheme,SDL_GetSystemTheme,(void),(),return) -SDL_DYNAPI_PROC(void*,SDL_GetTLS,(SDL_TLSID a),(a),return) +SDL_DYNAPI_PROC(void*,SDL_GetTLS,(SDL_TLSID *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetTextInputArea,(SDL_Window *a, SDL_Rect *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaMod,(SDL_Texture *a, Uint8 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaModFloat,(SDL_Texture *a, float *b),(a,b),return) @@ -792,7 +791,7 @@ SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Ui SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetSurfaceRLE,(SDL_Surface *a, SDL_bool b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_SetTLS,(SDL_TLSID a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) +SDL_DYNAPI_PROC(int,SDL_SetTLS,(SDL_TLSID *a, const void *b, SDL_TLSDestructorCallback c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetTextInputArea,(SDL_Window *a, const SDL_Rect *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaMod,(SDL_Texture *a, Uint8 b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_SetTextureAlphaModFloat,(SDL_Texture *a, float b),(a,b),return) diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index fdcfe8f622f0d..87132c943a7e5 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -29,34 +29,37 @@ /* The storage is local to the thread, but the IDs are global for the process */ static SDL_AtomicInt SDL_tls_allocated; +static SDL_AtomicInt SDL_tls_id; void SDL_InitTLSData(void) { SDL_SYS_InitTLSData(); } -SDL_TLSID SDL_CreateTLS(void) -{ - static SDL_AtomicInt SDL_tls_id; - return (SDL_TLSID)(SDL_AtomicIncRef(&SDL_tls_id) + 1); -} - -void *SDL_GetTLS(SDL_TLSID id) +void *SDL_GetTLS(SDL_TLSID *id) { SDL_TLSData *storage; + int storage_index; + + if (id == NULL) { + SDL_InvalidParamError("id"); + return NULL; + } + storage_index = SDL_AtomicGet(id) - 1; storage = SDL_SYS_GetTLSData(); - if (!storage || id == 0 || id > storage->limit) { + if (!storage || storage_index < 0 || storage_index >= storage->limit) { return NULL; } - return storage->array[id - 1].data; + return storage->array[storage_index].data; } -int SDL_SetTLS(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destructor) +int SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor) { SDL_TLSData *storage; + int storage_index; - if (id == 0) { + if (id == NULL) { return SDL_InvalidParamError("id"); } @@ -66,14 +69,27 @@ int SDL_SetTLS(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destru */ SDL_InitTLSData(); + /* Get the storage index associated with the ID in a thread-safe way */ + storage_index = SDL_AtomicGet(id) - 1; + if (storage_index < 0) { + int new_id = (SDL_AtomicIncRef(&SDL_tls_id) + 1); + + SDL_AtomicCompareAndSwap(id, 0, new_id); + + /* If there was a race condition we'll have wasted an ID, but every thread + * will have the same storage index for this id. + */ + storage_index = SDL_AtomicGet(id) - 1; + } + /* Get the storage for the current thread */ storage = SDL_SYS_GetTLSData(); - if (!storage || (id > storage->limit)) { + if (!storage || storage_index >= storage->limit) { unsigned int i, oldlimit, newlimit; SDL_TLSData *new_storage; oldlimit = storage ? storage->limit : 0; - newlimit = (id + TLS_ALLOC_CHUNKSIZE); + newlimit = (storage_index + TLS_ALLOC_CHUNKSIZE); new_storage = (SDL_TLSData *)SDL_realloc(storage, sizeof(*storage) + (newlimit - 1) * sizeof(storage->array[0])); if (!new_storage) { return -1; @@ -91,8 +107,8 @@ int SDL_SetTLS(SDL_TLSID id, const void *value, SDL_TLSDestructorCallback destru SDL_AtomicIncRef(&SDL_tls_allocated); } - storage->array[id - 1].data = SDL_const_cast(void *, value); - storage->array[id - 1].destructor = destructor; + storage->array[storage_index].data = SDL_const_cast(void *, value); + storage->array[storage_index].destructor = destructor; return 0; } @@ -103,7 +119,7 @@ void SDL_CleanupTLS(void) /* Cleanup the storage for the current thread */ storage = SDL_SYS_GetTLSData(); if (storage) { - unsigned int i; + int i; for (i = 0; i < storage->limit; ++i) { if (storage->array[i].destructor) { storage->array[i].destructor(storage->array[i].data); @@ -261,42 +277,15 @@ SDL_error *SDL_GetErrBuf(SDL_bool create) #ifdef SDL_THREADS_DISABLED return SDL_GetStaticErrBuf(); #else - static SDL_SpinLock tls_lock; - static SDL_bool tls_being_created; static SDL_TLSID tls_errbuf; - const SDL_error *ALLOCATION_IN_PROGRESS = (SDL_error *)-1; SDL_error *errbuf; - if (!tls_errbuf && !create) { - return NULL; - } - - /* tls_being_created is there simply to prevent recursion if SDL_CreateTLS() fails. - It also means it's possible for another thread to also use SDL_global_errbuf, - but that's very unlikely and hopefully won't cause issues. - */ - if (!tls_errbuf && !tls_being_created) { - SDL_LockSpinlock(&tls_lock); - if (!tls_errbuf) { - SDL_TLSID slot; - tls_being_created = SDL_TRUE; - slot = SDL_CreateTLS(); - tls_being_created = SDL_FALSE; - SDL_MemoryBarrierRelease(); - tls_errbuf = slot; + errbuf = (SDL_error *)SDL_GetTLS(&tls_errbuf); + if (!errbuf) { + if (!create) { + return NULL; } - SDL_UnlockSpinlock(&tls_lock); - } - if (!tls_errbuf) { - return SDL_GetStaticErrBuf(); - } - SDL_MemoryBarrierAcquire(); - errbuf = (SDL_error *)SDL_GetTLS(tls_errbuf); - if (errbuf == ALLOCATION_IN_PROGRESS) { - return SDL_GetStaticErrBuf(); - } - if (!errbuf) { /* Get the original memory functions for this allocation because the lifetime * of the error buffer may span calls to SDL_SetMemoryFunctions() by the app */ @@ -304,17 +293,14 @@ SDL_error *SDL_GetErrBuf(SDL_bool create) SDL_free_func free_func; SDL_GetOriginalMemoryFunctions(NULL, NULL, &realloc_func, &free_func); - /* Mark that we're in the middle of allocating our buffer */ - SDL_SetTLS(tls_errbuf, ALLOCATION_IN_PROGRESS, NULL); errbuf = (SDL_error *)realloc_func(NULL, sizeof(*errbuf)); if (!errbuf) { - SDL_SetTLS(tls_errbuf, NULL, NULL); return SDL_GetStaticErrBuf(); } SDL_zerop(errbuf); errbuf->realloc_func = realloc_func; errbuf->free_func = free_func; - SDL_SetTLS(tls_errbuf, errbuf, SDL_FreeErrBuf); + SDL_SetTLS(&tls_errbuf, errbuf, SDL_FreeErrBuf); } return errbuf; #endif /* SDL_THREADS_DISABLED */ diff --git a/src/thread/SDL_thread_c.h b/src/thread/SDL_thread_c.h index 1e94edcfd1abe..2f4a92daa5992 100644 --- a/src/thread/SDL_thread_c.h +++ b/src/thread/SDL_thread_c.h @@ -78,7 +78,7 @@ extern void SDL_RunThread(SDL_Thread *thread); /* This is the system-independent thread local storage structure */ typedef struct { - SDL_TLSID limit; + int limit; struct { void *data; diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index 5f1ba26bf7f0e..a278e378fcfa0 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -36,14 +36,11 @@ HANDLE SDL_GetWaitableTimer() static SDL_TLSID TLS_timer_handle; HANDLE timer; - if (!TLS_timer_handle) { - TLS_timer_handle = SDL_CreateTLS(); - } - timer = SDL_GetTLS(TLS_timer_handle); + timer = SDL_GetTLS(&TLS_timer_handle); if (!timer) { timer = CreateWaitableTimerExW(NULL, NULL, CREATE_WAITABLE_TIMER_HIGH_RESOLUTION, TIMER_ALL_ACCESS); if (timer) { - SDL_SetTLS(TLS_timer_handle, timer, SDL_CleanupWaitableTimer); + SDL_SetTLS(&TLS_timer_handle, timer, SDL_CleanupWaitableTimer); } } return timer; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 4633a02878476..25e8b97597392 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -611,9 +611,6 @@ int SDL_VideoInit(const char *driver_name) _this->gl_config.dll_handle = NULL; SDL_GL_ResetAttributes(); - _this->current_glwin_tls = SDL_CreateTLS(); - _this->current_glctx_tls = SDL_CreateTLS(); - /* Initialize the video subsystem */ if (_this->VideoInit(_this) < 0) { SDL_VideoQuit(); @@ -4794,8 +4791,8 @@ SDL_GLContext SDL_GL_CreateContext(SDL_Window *window) if (ctx) { _this->current_glwin = window; _this->current_glctx = ctx; - SDL_SetTLS(_this->current_glwin_tls, window, NULL); - SDL_SetTLS(_this->current_glctx_tls, ctx, NULL); + SDL_SetTLS(&_this->current_glwin_tls, window, NULL); + SDL_SetTLS(&_this->current_glctx_tls, ctx, NULL); } return ctx; } @@ -4830,8 +4827,8 @@ int SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLContext context) if (retval == 0) { _this->current_glwin = window; _this->current_glctx = context; - SDL_SetTLS(_this->current_glwin_tls, window, NULL); - SDL_SetTLS(_this->current_glctx_tls, context, NULL); + SDL_SetTLS(&_this->current_glwin_tls, window, NULL); + SDL_SetTLS(&_this->current_glctx_tls, context, NULL); } return retval; } @@ -4842,7 +4839,7 @@ SDL_Window *SDL_GL_GetCurrentWindow(void) SDL_UninitializedVideo(); return NULL; } - return (SDL_Window *)SDL_GetTLS(_this->current_glwin_tls); + return (SDL_Window *)SDL_GetTLS(&_this->current_glwin_tls); } SDL_GLContext SDL_GL_GetCurrentContext(void) @@ -4851,7 +4848,7 @@ SDL_GLContext SDL_GL_GetCurrentContext(void) SDL_UninitializedVideo(); return NULL; } - return (SDL_GLContext)SDL_GetTLS(_this->current_glctx_tls); + return (SDL_GLContext)SDL_GetTLS(&_this->current_glctx_tls); } SDL_EGLDisplay SDL_EGL_GetCurrentEGLDisplay(void) diff --git a/test/testthread.c b/test/testthread.c index 56473415bcb04..dd282e9d4906e 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -58,9 +58,9 @@ ThreadFunc(void *data) { SDL_ThreadPriority prio = SDL_THREAD_PRIORITY_NORMAL; - SDL_SetTLS(tls, "baby thread", NULL); + SDL_SetTLS(&tls, "baby thread", NULL); SDL_Log("Started thread %s: My thread id is %" SDL_PRIu64 ", thread data = %s\n", - (char *)data, SDL_GetCurrentThreadID(), (const char *)SDL_GetTLS(tls)); + (char *)data, SDL_GetCurrentThreadID(), (const char *)SDL_GetTLS(&tls)); while (alive) { SDL_Log("Thread '%s' is alive!\n", (char *)data); @@ -132,10 +132,8 @@ int main(int argc, char *argv[]) return 0; } - tls = SDL_CreateTLS(); - SDL_assert(tls); - SDL_SetTLS(tls, "main thread", NULL); - SDL_Log("Main thread data initially: %s\n", (const char *)SDL_GetTLS(tls)); + SDL_SetTLS(&tls, "main thread", NULL); + SDL_Log("Main thread data initially: %s\n", (const char *)SDL_GetTLS(&tls)); alive = 1; thread = SDL_CreateThread(ThreadFunc, "One", "#1"); @@ -148,7 +146,7 @@ int main(int argc, char *argv[]) alive = 0; SDL_WaitThread(thread, NULL); - SDL_Log("Main thread data finally: %s\n", (const char *)SDL_GetTLS(tls)); + SDL_Log("Main thread data finally: %s\n", (const char *)SDL_GetTLS(&tls)); alive = 1; (void)signal(SIGTERM, killed); From 4aeabb3c3b06ab7f6b6d6a79dc5306e115597949 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 10:15:23 -0700 Subject: [PATCH 338/431] Made event and temporary string memory thread-local and added SDL_FreeEventMemory() Fixes https://github.com/libsdl-org/SDL/issues/10283 --- include/SDL3/SDL_events.h | 19 ++++- src/SDL.c | 1 - src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/events/SDL_events.c | 132 +++++++++++++++++++----------- src/events/SDL_events_c.h | 1 - 7 files changed, 107 insertions(+), 49 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 921bcbad7771a..6109f4c8c8372 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1407,7 +1407,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type); extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); /** - * Allocate dynamic memory for an SDL event. + * Allocate temporary memory for an SDL event. * * You can use this to allocate memory for user events that will be * automatically freed after the event is processed. @@ -1419,9 +1419,26 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. + * + * \sa SDL_FreeEventMemory */ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); +/** + * Free temporary event memory allocated by SDL. + * + * This function frees temporary memory allocated for events and APIs that return temporary strings. This memory is local to the thread that creates it and is automatically freed for the main thread when pumping the event loop. For other threads you may want to call this function periodically to free any temporary memory created by that thread. + * + * Note that if you call SDL_AllocateEventMemory() on one thread and pass it to another thread, e.g. via a user event, then you should be sure the other thread has finished processing it before calling this function. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AllocateEventMemory + */ +extern SDL_DECLSPEC void SDLCALL SDL_FreeEventMemory(void); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/src/SDL.c b/src/SDL.c index d2792904a1f01..8866b0ebc2e6d 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -582,7 +582,6 @@ void SDL_Quit(void) */ SDL_memset(SDL_SubsystemRefCount, 0x0, sizeof(SDL_SubsystemRefCount)); - SDL_FlushEventMemory(0); SDL_FreeEnvironmentMemory(); SDL_QuitMainThread(); diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 61461d4e8af46..d1c53c8725270 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -123,6 +123,7 @@ SDL3_0.0.0 { SDL_FlushEvent; SDL_FlushEvents; SDL_FlushRenderer; + SDL_FreeEventMemory; SDL_GDKSuspendComplete; SDL_GL_CreateContext; SDL_GL_DestroyContext; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index fdf24d66910e4..425bab5f8b3e5 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -148,6 +148,7 @@ #define SDL_FlushEvent SDL_FlushEvent_REAL #define SDL_FlushEvents SDL_FlushEvents_REAL #define SDL_FlushRenderer SDL_FlushRenderer_REAL +#define SDL_FreeEventMemory SDL_FreeEventMemory_REAL #define SDL_GDKSuspendComplete SDL_GDKSuspendComplete_REAL #define SDL_GL_CreateContext SDL_GL_CreateContext_REAL #define SDL_GL_DestroyContext SDL_GL_DestroyContext_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 477cd502ba385..533cc20f5a5c8 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -168,6 +168,7 @@ SDL_DYNAPI_PROC(int,SDL_FlushAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_FlushEvent,(Uint32 a),(a),) SDL_DYNAPI_PROC(void,SDL_FlushEvents,(Uint32 a, Uint32 b),(a,b),) SDL_DYNAPI_PROC(int,SDL_FlushRenderer,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(void,SDL_FreeEventMemory,(void),(),) SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 6e617ed8eae04..da4f0881b46aa 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -97,35 +97,79 @@ typedef struct SDL_EventMemory struct SDL_EventMemory *next; } SDL_EventMemory; -static SDL_Mutex *SDL_event_memory_lock; -static SDL_EventMemory *SDL_event_memory_head; -static SDL_EventMemory *SDL_event_memory_tail; +typedef struct SDL_EventMemoryState +{ + SDL_EventMemory *head; + SDL_EventMemory *tail; +} SDL_EventMemoryState; + +static SDL_TLSID SDL_event_memory; + + +static void SDL_CleanupEventMemory(void *data) +{ + SDL_EventMemoryState *state = (SDL_EventMemoryState *)data; + + while (state->head) { + SDL_EventMemory *entry = state->head; + state->head = entry->next; + SDL_free(entry->memory); + SDL_free(entry); + } + SDL_free(state); +} + +static SDL_EventMemoryState *SDL_GetEventMemoryState(SDL_bool create) +{ + SDL_EventMemoryState *state; + + state = SDL_GetTLS(&SDL_event_memory); + if (!state) { + if (!create) { + return NULL; + } + + state = (SDL_EventMemoryState *)SDL_calloc(1, sizeof(*state)); + if (!state) { + return NULL; + } + + if (SDL_SetTLS(&SDL_event_memory, state, SDL_CleanupEventMemory) < 0) { + SDL_free(state); + return NULL; + } + } + return state; +} void *SDL_FreeLater(void *memory) { + SDL_EventMemoryState *state; + if (memory == NULL) { return NULL; } + state = SDL_GetEventMemoryState(SDL_TRUE); + if (!state) { + return memory; // this is now a leak, but you probably have bigger problems if malloc failed. + } + SDL_EventMemory *entry = (SDL_EventMemory *)SDL_malloc(sizeof(*entry)); if (!entry) { return memory; // this is now a leak, but you probably have bigger problems if malloc failed. We could probably pool up and reuse entries, though. } - SDL_LockMutex(SDL_event_memory_lock); - { - entry->eventID = SDL_last_event_id; - entry->memory = memory; - entry->next = NULL; + entry->eventID = SDL_last_event_id; + entry->memory = memory; + entry->next = NULL; - if (SDL_event_memory_tail) { - SDL_event_memory_tail->next = entry; - } else { - SDL_event_memory_head = entry; - } - SDL_event_memory_tail = entry; + if (state->tail) { + state->tail->next = entry; + } else { + state->head = entry; } - SDL_UnlockMutex(SDL_event_memory_lock); + state->tail = entry; return memory; } @@ -143,31 +187,39 @@ const char *SDL_AllocateEventString(const char *string) return NULL; } -void SDL_FlushEventMemory(Uint32 eventID) +static void SDL_FlushEventMemory(Uint32 eventID) { - SDL_LockMutex(SDL_event_memory_lock); - { - if (SDL_event_memory_head) { - while (SDL_event_memory_head) { - SDL_EventMemory *entry = SDL_event_memory_head; + SDL_EventMemoryState *state; - if (eventID && (Sint32)(eventID - entry->eventID) < 0) { - break; - } + state = SDL_GetEventMemoryState(SDL_FALSE); + if (!state) { + return; + } - /* If you crash here, your application has memory corruption - * or freed memory in an event, which is no longer necessary. - */ - SDL_event_memory_head = entry->next; - SDL_free(entry->memory); - SDL_free(entry); - } - if (!SDL_event_memory_head) { - SDL_event_memory_tail = NULL; + if (state->head) { + while (state->head) { + SDL_EventMemory *entry = state->head; + + if (eventID && (Sint32)(eventID - entry->eventID) < 0) { + break; } + + /* If you crash here, your application has memory corruption + * or freed memory in an event, which is no longer necessary. + */ + state->head = entry->next; + SDL_free(entry->memory); + SDL_free(entry); + } + if (!state->head) { + state->tail = NULL; } } - SDL_UnlockMutex(SDL_event_memory_lock); +} + +void SDL_FreeEventMemory(void) +{ + SDL_FlushEventMemory(0); } #ifndef SDL_JOYSTICK_DISABLED @@ -697,10 +749,6 @@ void SDL_StopEventLoop(void) SDL_disabled_events[i] = NULL; } - if (SDL_event_memory_lock) { - SDL_DestroyMutex(SDL_event_memory_lock); - SDL_event_memory_lock = NULL; - } if (SDL_event_watchers_lock) { SDL_DestroyMutex(SDL_event_watchers_lock); SDL_event_watchers_lock = NULL; @@ -746,14 +794,6 @@ int SDL_StartEventLoop(void) return -1; } } - - if (SDL_event_memory_lock == NULL) { - SDL_event_memory_lock = SDL_CreateMutex(); - if (SDL_event_memory_lock == NULL) { - SDL_UnlockMutex(SDL_EventQ.lock); - return -1; - } - } #endif /* !SDL_THREADS_DISABLED */ SDL_EventQ.active = SDL_TRUE; diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index cc544733c60ed..778af32cadbf0 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -38,7 +38,6 @@ /* Start and stop the event processing loop */ extern int SDL_StartEventLoop(void); extern void SDL_StopEventLoop(void); -extern void SDL_FlushEventMemory(Uint32 eventID); extern void SDL_QuitInterrupt(void); extern const char *SDL_AllocateEventString(const char *string); From d65a8146b950abe31b4fbf779f3e2fea731af9bd Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 16 Jul 2024 19:03:15 +0000 Subject: [PATCH 339/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_events.h | 12 +++++++++--- include/SDL3/SDL_thread.h | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 6109f4c8c8372..3ad5118c4c76c 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1427,9 +1427,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); /** * Free temporary event memory allocated by SDL. * - * This function frees temporary memory allocated for events and APIs that return temporary strings. This memory is local to the thread that creates it and is automatically freed for the main thread when pumping the event loop. For other threads you may want to call this function periodically to free any temporary memory created by that thread. - * - * Note that if you call SDL_AllocateEventMemory() on one thread and pass it to another thread, e.g. via a user event, then you should be sure the other thread has finished processing it before calling this function. + * This function frees temporary memory allocated for events and APIs that + * return temporary strings. This memory is local to the thread that creates + * it and is automatically freed for the main thread when pumping the event + * loop. For other threads you may want to call this function periodically to + * free any temporary memory created by that thread. + * + * Note that if you call SDL_AllocateEventMemory() on one thread and pass it + * to another thread, e.g. via a user event, then you should be sure the other + * thread has finished processing it before calling this function. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 906f9cace26dd..347958b362b93 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -492,7 +492,9 @@ typedef void (SDLCALL *SDL_TLSDestructorCallback)(void *value); /** * Set the current thread's value associated with a thread local storage ID. * - * If the thread local storage ID is not initialized (the value is 0), a new ID will be created in a thread-safe way, so all calls using a pointer to the same ID will refer to the same local storage. + * If the thread local storage ID is not initialized (the value is 0), a new + * ID will be created in a thread-safe way, so all calls using a pointer to + * the same ID will refer to the same local storage. * * Note that replacing a value from a previous call to this function on the * same thread does _not_ call the previous value's destructor! From 3bc81a81f5cc56bf58f02bb78c16d450b6f881d6 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 13 Jul 2024 13:34:46 -0400 Subject: [PATCH 340/431] filesystem: SDL_GetBasePath() now follows the SDL_GetStringRule. It also now caches at the higher level, so the platform-specific bits don't change their interface much. A little code hygiene work was applied to some of the platform bits on top of this. Reference Issue #10229. --- docs/README-migration.md | 3 +- include/SDL3/SDL_filesystem.h | 9 +++-- src/SDL.c | 3 ++ src/dynapi/SDL_dynapi_procs.h | 2 +- src/filesystem/SDL_filesystem.c | 22 +++++++++++++ src/filesystem/SDL_filesystem_c.h | 29 ++++++++++++++++ src/filesystem/SDL_sysfilesystem.h | 3 ++ src/filesystem/android/SDL_sysfilesystem.c | 2 +- src/filesystem/cocoa/SDL_sysfilesystem.m | 2 +- src/filesystem/dummy/SDL_sysfilesystem.c | 2 +- src/filesystem/emscripten/SDL_sysfilesystem.c | 5 ++- src/filesystem/gdk/SDL_sysfilesystem.cpp | 2 +- src/filesystem/haiku/SDL_sysfilesystem.cc | 15 +++++---- src/filesystem/n3ds/SDL_sysfilesystem.c | 2 +- src/filesystem/ps2/SDL_sysfilesystem.c | 33 +++++++++++-------- src/filesystem/psp/SDL_sysfilesystem.c | 26 ++++++++++----- src/filesystem/riscos/SDL_sysfilesystem.c | 2 +- src/filesystem/unix/SDL_sysfilesystem.c | 2 +- src/filesystem/vita/SDL_sysfilesystem.c | 6 ++-- src/filesystem/windows/SDL_sysfilesystem.c | 2 +- src/filesystem/winrt/SDL_sysfilesystem.cpp | 3 +- src/storage/generic/SDL_genericstorage.c | 21 +++++++----- test/testfilesystem.c | 4 +-- test/testutils.c | 6 +--- 24 files changed, 137 insertions(+), 69 deletions(-) create mode 100644 src/filesystem/SDL_filesystem_c.h diff --git a/docs/README-migration.md b/docs/README-migration.md index ee5052dc19fbf..91e8376e7a24a 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -802,10 +802,9 @@ On Haiku OS, SDL no longer sets the current working directory to the executable' ```c { - char *path = SDL_GetBasePath(); + const char *path = SDL_GetBasePath(); if (path) { chdir(path); - SDL_free(path); } } ``` diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index c3bda170faaf9..26d640116354c 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -41,8 +41,8 @@ extern "C" { /** * Get the directory where the application was run from. * - * This is not necessarily a fast call, so you should call this once near - * startup and save the string if you need it. + * SDL caches the result of this call internally, but the first call to this + * function is not necessarily fast, so plan accordingly. * * **macOS and iOS Specific Functionality**: If the application is in a ".app" * bundle, this function returns the Resource directory (e.g. @@ -68,8 +68,7 @@ extern "C" { * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The pointer returned is owned by the caller. Please call SDL_free() on the - * pointer when done with it. + * The returned string follows the SDL_GetStringRule. * * \returns an absolute path in UTF-8 encoding to the application data * directory. NULL will be returned on error or when the platform @@ -80,7 +79,7 @@ extern "C" { * * \sa SDL_GetPrefPath */ -extern SDL_DECLSPEC char *SDLCALL SDL_GetBasePath(void); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetBasePath(void); /** * Get the user-and-app-specific path where files can be written. diff --git a/src/SDL.c b/src/SDL.c index 8866b0ebc2e6d..8b76ef2744dc2 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -53,6 +53,7 @@ #include "thread/SDL_thread_c.h" #include "video/SDL_pixels_c.h" #include "video/SDL_video_c.h" +#include "filesystem/SDL_filesystem_c.h" #define SDL_INIT_EVERYTHING ~0U @@ -192,6 +193,7 @@ void SDL_InitMainThread(void) SDL_InitTLSData(); SDL_InitTicks(); + SDL_InitFilesystem(); SDL_InitLog(); SDL_InitProperties(); SDL_GetGlobalProperties(); @@ -207,6 +209,7 @@ static void SDL_QuitMainThread(void) SDL_QuitProperties(); SDL_QuitLog(); + SDL_QuitFilesystem(); SDL_QuitTicks(); SDL_QuitTLSData(); diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 533cc20f5a5c8..0322906dfcf73 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -219,7 +219,7 @@ SDL_DYNAPI_PROC(const int*,SDL_GetAudioStreamInputChannelMap,(SDL_AudioStream *a SDL_DYNAPI_PROC(const int*,SDL_GetAudioStreamOutputChannelMap,(SDL_AudioStream *a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetAudioStreamProperties,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamQueued,(SDL_AudioStream *a),(a),return) -SDL_DYNAPI_PROC(char*,SDL_GetBasePath,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_GetBasePath,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetBooleanProperty,(SDL_PropertiesID a, const char *b, SDL_bool c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCacheLineSize,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetCPUCount,(void),(),return) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 4310bbb6a69a0..16c59f6e8b18d 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -400,3 +400,25 @@ char **SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags fl return SDL_InternalGlobDirectory(path, pattern, flags, count, GlobDirectoryEnumerator, GlobDirectoryGetPathInfo, NULL); } + +static char *CachedBasePath = NULL; + +const char *SDL_GetBasePath(void) +{ + if (!CachedBasePath) { + CachedBasePath = SDL_SYS_GetBasePath(); + } + return CachedBasePath; +} + +void SDL_InitFilesystem(void) +{ + CachedBasePath = NULL; // just in case. +} + +void SDL_QuitFilesystem(void) +{ + SDL_free(CachedBasePath); + CachedBasePath = NULL; +} + diff --git a/src/filesystem/SDL_filesystem_c.h b/src/filesystem/SDL_filesystem_c.h new file mode 100644 index 0000000000000..4cf8725c219ed --- /dev/null +++ b/src/filesystem/SDL_filesystem_c.h @@ -0,0 +1,29 @@ +/* + Simple DirectMedia Layer + Copyright (C) 1997-2024 Sam Lantinga + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. +*/ + +#ifndef SDL_filesystem_c_h_ +#define SDL_filesystem_c_h_ + +extern void SDL_InitFilesystem(void); +extern void SDL_QuitFilesystem(void); + +#endif + diff --git a/src/filesystem/SDL_sysfilesystem.h b/src/filesystem/SDL_sysfilesystem.h index 1655e69d6458a..b7fe7f6ffb68e 100644 --- a/src/filesystem/SDL_sysfilesystem.h +++ b/src/filesystem/SDL_sysfilesystem.h @@ -22,6 +22,9 @@ #ifndef SDL_sysfilesystem_h_ #define SDL_sysfilesystem_h_ +// return a string that we can SDL_free(). It will be cached at the higher level. +extern char *SDL_SYS_GetBasePath(void); + int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_EnumerateDirectoryCallback cb, void *userdata); int SDL_SYS_RemovePath(const char *path); int SDL_SYS_RenamePath(const char *oldpath, const char *newpath); diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index a59f2bb41d1d1..0170264134326 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -27,7 +27,7 @@ #include -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { /* The current working directory is / on Android */ SDL_Unsupported(); diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m index 7491953bdacfd..308d6756151a8 100644 --- a/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -29,7 +29,7 @@ #include #include -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { @autoreleasepool { NSBundle *bundle = [NSBundle mainBundle]; diff --git a/src/filesystem/dummy/SDL_sysfilesystem.c b/src/filesystem/dummy/SDL_sysfilesystem.c index 442728223e022..cf9ca53d9825b 100644 --- a/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/src/filesystem/dummy/SDL_sysfilesystem.c @@ -25,7 +25,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/emscripten/SDL_sysfilesystem.c b/src/filesystem/emscripten/SDL_sysfilesystem.c index b2ae8c529b992..ea415547f5c57 100644 --- a/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -29,10 +29,9 @@ #include -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { - char *retval = "/"; - return SDL_strdup(retval); + return SDL_strdup("/"); } char *SDL_GetPrefPath(const char *org, const char *app) diff --git a/src/filesystem/gdk/SDL_sysfilesystem.cpp b/src/filesystem/gdk/SDL_sysfilesystem.cpp index 0ba16306cfb3c..c1d9fa98f0fb2 100644 --- a/src/filesystem/gdk/SDL_sysfilesystem.cpp +++ b/src/filesystem/gdk/SDL_sysfilesystem.cpp @@ -31,7 +31,7 @@ #include char * -SDL_GetBasePath(void) +SDL_SYS_GetBasePath(void) { /* NOTE: This function is a UTF8 version of the Win32 SDL_GetBasePath()! * The GDK actually _recommends_ the 'A' functions over the 'W' functions :o diff --git a/src/filesystem/haiku/SDL_sysfilesystem.cc b/src/filesystem/haiku/SDL_sysfilesystem.cc index 0e91b06b00b51..82fc4ea12f93d 100644 --- a/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/src/filesystem/haiku/SDL_sysfilesystem.cc @@ -25,6 +25,10 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +extern "C" { +#include "../SDL_sysfilesystem.h" +} + #include #include #include @@ -32,7 +36,7 @@ #include -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { char name[MAXPATHLEN]; @@ -51,13 +55,12 @@ char *SDL_GetBasePath(void) const size_t len = SDL_strlen(str); char *retval = (char *) SDL_malloc(len + 2); - if (!retval) { - return NULL; + if (retval) { + SDL_memcpy(retval, str, len); + retval[len] = '/'; + retval[len+1] = '\0'; } - SDL_memcpy(retval, str, len); - retval[len] = '/'; - retval[len+1] = '\0'; return retval; } diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index 689a35bbbb72f..897d11a508851 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -32,7 +32,7 @@ static char *MakePrefPath(const char *app); static int CreatePrefPathDir(const char *pref); -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { char *base_path = SDL_strdup("romfs:/"); return base_path; diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index da773eb690330..86d908af73e42 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -28,7 +28,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { char *retval = NULL; size_t len; @@ -37,7 +37,9 @@ char *SDL_GetBasePath(void) getcwd(cwd, sizeof(cwd)); len = SDL_strlen(cwd) + 2; retval = (char *)SDL_malloc(len); - SDL_snprintf(retval, len, "%s/", cwd); + if (retval) { + SDL_snprintf(retval, len, "%s/", cwd); + } return retval; } @@ -46,7 +48,7 @@ char *SDL_GetBasePath(void) static void recursive_mkdir(const char *dir) { char tmp[FILENAME_MAX]; - char *base = SDL_GetBasePath(); + const char *base = SDL_GetBasePath(); char *p = NULL; size_t len; @@ -60,7 +62,7 @@ static void recursive_mkdir(const char *dir) if (*p == '/') { *p = 0; // Just creating subfolders from current path - if (SDL_strstr(tmp, base) != NULL) { + if (base && SDL_strstr(tmp, base) != NULL) { mkdir(tmp, S_IRWXU); } @@ -68,7 +70,6 @@ static void recursive_mkdir(const char *dir) } } - SDL_free(base); mkdir(tmp, S_IRWXU); } @@ -76,26 +77,32 @@ char *SDL_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; - char *base = SDL_GetBasePath(); + if (!app) { SDL_InvalidParamError("app"); return NULL; } + if (!org) { org = ""; } + const char *base = SDL_GetBasePath(); + if (!base) { + return NULL; + } + len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; retval = (char *)SDL_malloc(len); + if (retval) { + if (*org) { + SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); + } else { + SDL_snprintf(retval, len, "%s%s/", base, app); + } - if (*org) { - SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); - } else { - SDL_snprintf(retval, len, "%s%s/", base, app); + recursive_mkdir(retval); } - SDL_free(base); - - recursive_mkdir(retval); return retval; } diff --git a/src/filesystem/psp/SDL_sysfilesystem.c b/src/filesystem/psp/SDL_sysfilesystem.c index 5386cb53a49ee..b29b1b210af51 100644 --- a/src/filesystem/psp/SDL_sysfilesystem.c +++ b/src/filesystem/psp/SDL_sysfilesystem.c @@ -28,7 +28,7 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { char *retval = NULL; size_t len; @@ -37,7 +37,9 @@ char *SDL_GetBasePath(void) getcwd(cwd, sizeof(cwd)); len = SDL_strlen(cwd) + 2; retval = (char *)SDL_malloc(len); - SDL_snprintf(retval, len, "%s/", cwd); + if (retval) { + SDL_snprintf(retval, len, "%s/", cwd); + } return retval; } @@ -46,26 +48,32 @@ char *SDL_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; - char *base = SDL_GetBasePath(); if (!app) { SDL_InvalidParamError("app"); return NULL; } + + const char *base = SDL_GetBasePath(); + if (!base) { + return NULL; + } + if (!org) { org = ""; } len = SDL_strlen(base) + SDL_strlen(org) + SDL_strlen(app) + 4; retval = (char *)SDL_malloc(len); + if (retval) { + if (*org) { + SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); + } else { + SDL_snprintf(retval, len, "%s%s/", base, app); + } - if (*org) { - SDL_snprintf(retval, len, "%s%s/%s/", base, org, app); - } else { - SDL_snprintf(retval, len, "%s%s/", base, app); + mkdir(retval, 0755); } - SDL_free(base); - mkdir(retval, 0755); return retval; } diff --git a/src/filesystem/riscos/SDL_sysfilesystem.c b/src/filesystem/riscos/SDL_sysfilesystem.c index bbbc144b001dd..55f69f3b8f603 100644 --- a/src/filesystem/riscos/SDL_sysfilesystem.c +++ b/src/filesystem/riscos/SDL_sysfilesystem.c @@ -123,7 +123,7 @@ static _kernel_oserror *createDirectoryRecursive(char *path) return _kernel_swi(OS_File, ®s, ®s); } -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { _kernel_swi_regs regs; _kernel_oserror *error; diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index 70a5ee6b414bb..8c62d603fad89 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -119,7 +119,7 @@ static char *search_path_for_binary(const char *bin) } #endif -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { char *retval = NULL; diff --git a/src/filesystem/vita/SDL_sysfilesystem.c b/src/filesystem/vita/SDL_sysfilesystem.c index 11d320ee4bb03..d030da2fdd31e 100644 --- a/src/filesystem/vita/SDL_sysfilesystem.c +++ b/src/filesystem/vita/SDL_sysfilesystem.c @@ -34,11 +34,9 @@ #include #include -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { - const char *basepath = "app0:/"; - char *retval = SDL_strdup(basepath); - return retval; + return SDL_strdup("app0:/"); } char *SDL_GetPrefPath(const char *org, const char *app) diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c index e321b7dc02574..ff30453e02f58 100644 --- a/src/filesystem/windows/SDL_sysfilesystem.c +++ b/src/filesystem/windows/SDL_sysfilesystem.c @@ -41,7 +41,7 @@ DEFINE_GUID(SDL_FOLDERID_Screenshots, 0xb7bede81, 0xdf94, 0x4682, 0xa7, 0xd8, 0x DEFINE_GUID(SDL_FOLDERID_Templates, 0xA63293E8, 0x664E, 0x48DB, 0xA0, 0x79, 0xDF, 0x75, 0x9E, 0x05, 0x09, 0xF7); DEFINE_GUID(SDL_FOLDERID_Videos, 0x18989B1D, 0x99B5, 0x455B, 0x84, 0x1C, 0xAB, 0x7C, 0x74, 0xE4, 0xDD, 0xFC); -char *SDL_GetBasePath(void) +char *SDL_SYS_GetBasePath(void) { DWORD buflen = 128; WCHAR *path = NULL; diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index a1378a67406b2..9f710e71c2cbc 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -27,6 +27,7 @@ extern "C" { #include "../../core/windows/SDL_windows.h" +#include "../SDL_sysfilesystem.h" } #include @@ -115,7 +116,7 @@ extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType) return utf8Paths[pathType].c_str(); } -extern "C" char *SDL_GetBasePath(void) +extern "C" char *SDL_SYS_GetBasePath(void) { const char *srcPath = SDL_GetWinRTFSPath(SDL_WINRT_PATH_INSTALLED_LOCATION); size_t destPathLen; diff --git a/src/storage/generic/SDL_genericstorage.c b/src/storage/generic/SDL_genericstorage.c index e624a541d4b23..c6bfb74fe73cb 100644 --- a/src/storage/generic/SDL_genericstorage.c +++ b/src/storage/generic/SDL_genericstorage.c @@ -181,22 +181,25 @@ static const SDL_StorageInterface GENERIC_title_iface = { static SDL_Storage *GENERIC_Title_Create(const char *override, SDL_PropertiesID props) { - SDL_Storage *result; + SDL_Storage *result = NULL; - char *basepath; + char *basepath = NULL; if (override != NULL) { basepath = SDL_strdup(override); } else { - basepath = SDL_GetBasePath(); - } - if (basepath == NULL) { - return NULL; + const char *sdlbasepath = SDL_GetBasePath(); + if (sdlbasepath) { + basepath = SDL_strdup(sdlbasepath); + } } - result = SDL_OpenStorage(&GENERIC_title_iface, basepath); - if (result == NULL) { - SDL_free(basepath); + if (basepath != NULL) { + result = SDL_OpenStorage(&GENERIC_title_iface, basepath); + if (result == NULL) { + SDL_free(basepath); // otherwise CloseStorage will free it. + } } + return result; } diff --git a/test/testfilesystem.c b/test/testfilesystem.c index e975b19a67f0c..54214d71da924 100644 --- a/test/testfilesystem.c +++ b/test/testfilesystem.c @@ -62,7 +62,7 @@ int main(int argc, char *argv[]) { SDLTest_CommonState *state; char *pref_path; - char *base_path; + const char *base_path; /* Initialize test framework */ state = SDLTest_CommonCreateState(argv, 0); @@ -145,8 +145,6 @@ int main(int argc, char *argv[]) } } - SDL_free(base_path); - SDL_Quit(); SDLTest_CommonDestroyState(state); return 0; diff --git a/test/testutils.c b/test/testutils.c index 09dfb726c815c..c80dd35396b49 100644 --- a/test/testutils.c +++ b/test/testutils.c @@ -23,11 +23,9 @@ char * GetNearbyFilename(const char *file) { - char *base; + const char *base = SDL_GetBasePath(); char *path; - base = SDL_GetBasePath(); - if (base) { SDL_IOStream *rw; size_t len = SDL_strlen(base) + SDL_strlen(file) + 1; @@ -35,12 +33,10 @@ GetNearbyFilename(const char *file) path = SDL_malloc(len); if (!path) { - SDL_free(base); return NULL; } (void)SDL_snprintf(path, len, "%s%s", base, file); - SDL_free(base); rw = SDL_IOFromFile(path, "rb"); if (rw) { From 158fc459f181a99d3d3c993d74e5cade0bab90e7 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 15 Jul 2024 14:00:52 -0400 Subject: [PATCH 341/431] clipboard: SDL_GetClipboardText() now follows the SDL_GetStringRule. Reference Issue #10229. --- include/SDL3/SDL_clipboard.h | 10 +++++----- src/dynapi/SDL_dynapi_procs.h | 2 +- src/test/SDL_test_common.c | 3 +-- src/video/SDL_clipboard.c | 14 ++++++++------ test/testautomation_clipboard.c | 10 +++------- test/testcontroller.c | 7 +++---- 6 files changed, 21 insertions(+), 25 deletions(-) diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 073c309d07cd4..71d0e5c5b9e3f 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -57,22 +57,22 @@ extern "C" { extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); /** - * Get UTF-8 text from the clipboard, which must be freed with SDL_free(). + * Get UTF-8 text from the clipboard. * * This functions returns empty string if there was not enough memory left for * a copy of the clipboard's content. * + * The returned string follows the SDL_GetStringRule. + * * \returns the clipboard text on success or an empty string on failure; call - * SDL_GetError() for more information. Caller must call SDL_free() - * on the returned pointer when done with it (even if there was an - * error). + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasClipboardText * \sa SDL_SetClipboardText */ -extern SDL_DECLSPEC char * SDLCALL SDL_GetClipboardText(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetClipboardText(void); /** * Query whether the clipboard exists and contains a non-empty text string. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 0322906dfcf73..748cc50e89fd8 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -233,7 +233,7 @@ SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetCameraProperties,(SDL_Camera *a),(a),ret SDL_DYNAPI_PROC(SDL_CameraSpec*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) -SDL_DYNAPI_PROC(char*,SDL_GetClipboardText,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_GetClipboardText,(void),(),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, SDL_bool e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentAudioDriver,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentCameraDriver,(void),(),return) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 03ab26078f161..442cb7ef931d5 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2278,13 +2278,12 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event SDLTest_PasteScreenShot(); } else { /* Ctrl-V paste awesome text! */ - char *text = SDL_GetClipboardText(); + const char *text = SDL_GetClipboardText(); if (*text) { SDL_Log("Clipboard: %s\n", text); } else { SDL_Log("Clipboard is empty\n"); } - SDL_free(text); } } break; diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index 4c177227e0b72..ab1c57fc08418 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -282,29 +282,31 @@ int SDL_SetClipboardText(const char *text) return SDL_ClearClipboardData(); } -char *SDL_GetClipboardText(void) +const char *SDL_GetClipboardText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); size_t i, num_mime_types; const char **text_mime_types; size_t length; - char *text = NULL; + const char *text = NULL; if (!_this) { SDL_SetError("Video subsystem must be initialized to get clipboard text"); - return SDL_strdup(""); + return ""; } text_mime_types = SDL_GetTextMimeTypes(_this, &num_mime_types); for (i = 0; i < num_mime_types; ++i) { - text = (char *)SDL_GetClipboardData(text_mime_types[i], &length); - if (text) { + void *clipdata = SDL_GetClipboardData(text_mime_types[i], &length); + if (clipdata) { + text = (const char *) clipdata; + SDL_FreeLater(clipdata); // returned string follows the SDL_GetStringRule. break; } } if (!text) { - text = SDL_strdup(""); + text = ""; } return text; } diff --git a/test/testautomation_clipboard.c b/test/testautomation_clipboard.c index 1b67434f184c5..6b80e44b309db 100644 --- a/test/testautomation_clipboard.c +++ b/test/testautomation_clipboard.c @@ -163,12 +163,11 @@ static int clipboard_testClipboardDataFunctions(void *arg) clipboard_cleanup_count - last_clipboard_cleanup_count); expected_text = "TEST"; - text = SDL_GetClipboardText(); + text = (char *) SDL_GetClipboardText(); SDLTest_AssertCheck( text && SDL_strcmp(text, expected_text) == 0, "Verify clipboard text, expected \"%s\", got \"%s\"", expected_text, text); - SDL_free(text); boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]); SDLTest_AssertCheck( @@ -265,12 +264,11 @@ static int clipboard_testClipboardDataFunctions(void *arg) clipboard_cleanup_count - last_clipboard_cleanup_count); expected_text = "TEST"; - text = SDL_GetClipboardText(); + text = (char *) SDL_GetClipboardText(); SDLTest_AssertCheck( text && SDL_strcmp(text, expected_text) == 0, "Verify clipboard text, expected \"%s\", got \"%s\"", expected_text, text); - SDL_free(text); boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_TEXT]); SDLTest_AssertCheck( @@ -386,7 +384,7 @@ static int clipboard_testClipboardTextFunctions(void *arg) char *text = SDL_strdup(textRef); SDL_bool boolResult; int intResult; - char *charResult; + const char *charResult; int last_clipboard_update_count; SDL_AddEventWatch(ClipboardEventWatch, NULL); @@ -403,7 +401,6 @@ static int clipboard_testClipboardTextFunctions(void *arg) charResult && SDL_strcmp(charResult, "") == 0, "Verify SDL_GetClipboardText returned \"\", got %s", charResult); - SDL_free(charResult); boolResult = SDL_HasClipboardText(); SDLTest_AssertCheck( boolResult == SDL_FALSE, @@ -436,7 +433,6 @@ static int clipboard_testClipboardTextFunctions(void *arg) charResult && SDL_strcmp(textRef, charResult) == 0, "Verify SDL_GetClipboardText returned correct string, expected '%s', got '%s'", textRef, charResult); - SDL_free(charResult); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count + 1, "Verify clipboard update count incremented by 1, got %d", diff --git a/test/testcontroller.c b/test/testcontroller.c index 7ab21e94174b8..7f791e09f05ed 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -680,14 +680,13 @@ static void CopyMapping(void) static void PasteMapping(void) { if (controller) { - char *mapping = SDL_GetClipboardText(); + const char *mapping = SDL_GetClipboardText(); if (MappingHasBindings(mapping)) { StopBinding(); - SetAndFreeGamepadMapping(mapping); + SDL_SetGamepadMapping(controller->id, mapping); RefreshControllerName(); } else { /* Not a valid mapping, ignore it */ - SDL_free(mapping); } } } @@ -743,7 +742,7 @@ static void CopyControllerName(void) static void PasteControllerName(void) { SDL_free(controller_name); - controller_name = SDL_GetClipboardText(); + controller_name = SDL_strdup(SDL_GetClipboardText()); CommitControllerName(); } From d40b89dff633c0f85920243e8fe600b0435dafae Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 15 Jul 2024 14:07:33 -0400 Subject: [PATCH 342/431] clipboard: SDL_GetPrimarySelectionText() now follows the SDL_GetStringRule. Reference Issue #10229. --- include/SDL3/SDL_clipboard.h | 11 +++++------ src/dynapi/SDL_dynapi_procs.h | 2 +- src/test/SDL_test_common.c | 3 +-- src/video/SDL_clipboard.c | 8 ++++---- test/testautomation_clipboard.c | 4 +--- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 71d0e5c5b9e3f..1014481d7f922 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -101,23 +101,22 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); /** - * Get UTF-8 text from the primary selection, which must be freed with - * SDL_free(). + * Get UTF-8 text from the primary selection. * * This functions returns empty string if there was not enough memory left for * a copy of the primary selection's content. * + * The returned string follows the SDL_GetStringRule. + * * \returns the primary selection text on success or an empty string on - * failure; call SDL_GetError() for more information. Caller must - * call SDL_free() on the returned pointer when done with it (even if - * there was an error). + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasPrimarySelectionText * \sa SDL_SetPrimarySelectionText */ -extern SDL_DECLSPEC char * SDLCALL SDL_GetPrimarySelectionText(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetPrimarySelectionText(void); /** * Query whether the primary selection exists and contains a non-empty text diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 748cc50e89fd8..135289933b88b 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -416,7 +416,7 @@ SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) SDL_DYNAPI_PROC(char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Locale*,SDL_GetPreferredLocales,(void),(),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return) -SDL_DYNAPI_PROC(char*,SDL_GetPrimarySelectionText,(void),(),return) +SDL_DYNAPI_PROC(const char*,SDL_GetPrimarySelectionText,(void),(),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_GetRGB,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f),(a,b,c,d,e,f),) SDL_DYNAPI_PROC(void,SDL_GetRGBA,(Uint32 a, const SDL_PixelFormatDetails *b, const SDL_Palette *c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 442cb7ef931d5..dca7e57c2b024 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -2264,13 +2264,12 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event case SDLK_V: if (withAlt) { /* Alt-V paste awesome text from the primary selection! */ - char *text = SDL_GetPrimarySelectionText(); + const char *text = SDL_GetPrimarySelectionText(); if (*text) { SDL_Log("Primary selection: %s\n", text); } else { SDL_Log("Primary selection is empty\n"); } - SDL_free(text); } else if (withControl) { if (withShift) { diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index ab1c57fc08418..77ddc5941fdf7 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -349,7 +349,7 @@ int SDL_SetPrimarySelectionText(const char *text) return -1; } } else { - SDL_free(_this->primary_selection_text); + SDL_FreeLater(_this->primary_selection_text); // this pointer might be given to the app by SDL_GetPrimarySelectionText. _this->primary_selection_text = SDL_strdup(text); } @@ -357,7 +357,7 @@ int SDL_SetPrimarySelectionText(const char *text) return 0; } -char *SDL_GetPrimarySelectionText(void) +const char *SDL_GetPrimarySelectionText(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -367,13 +367,13 @@ char *SDL_GetPrimarySelectionText(void) } if (_this->GetPrimarySelectionText) { - return _this->GetPrimarySelectionText(_this); + return SDL_FreeLater(_this->GetPrimarySelectionText(_this)); // returned pointer follows the SDL_GetStringRule } else { const char *text = _this->primary_selection_text; if (!text) { text = ""; } - return SDL_strdup(text); + return text; } } diff --git a/test/testautomation_clipboard.c b/test/testautomation_clipboard.c index 6b80e44b309db..5568029178b28 100644 --- a/test/testautomation_clipboard.c +++ b/test/testautomation_clipboard.c @@ -466,7 +466,7 @@ static int clipboard_testPrimarySelectionTextFunctions(void *arg) char *text = SDL_strdup(textRef); SDL_bool boolResult; int intResult; - char *charResult; + const char *charResult; int last_clipboard_update_count; SDL_AddEventWatch(ClipboardEventWatch, NULL); @@ -483,7 +483,6 @@ static int clipboard_testPrimarySelectionTextFunctions(void *arg) charResult && SDL_strcmp(charResult, "") == 0, "Verify SDL_GetPrimarySelectionText returned \"\", got %s", charResult); - SDL_free(charResult); boolResult = SDL_HasPrimarySelectionText(); SDLTest_AssertCheck( boolResult == SDL_FALSE, @@ -515,7 +514,6 @@ static int clipboard_testPrimarySelectionTextFunctions(void *arg) charResult && SDL_strcmp(textRef, charResult) == 0, "Verify SDL_GetPrimarySelectionText returned correct string, expected '%s', got '%s'", textRef, charResult); - SDL_free(charResult); SDLTest_AssertCheck( clipboard_update_count == last_clipboard_update_count + 1, "Verify clipboard update count incremented by 1, got %d", From 2321726ff167bbe9d43ea74957c48b54316dbd83 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 15 Jul 2024 20:03:15 -0400 Subject: [PATCH 343/431] filesystem: SDL_GetUserFolder() now follows the SDL_GetStringRule. It also now caches at the higher level, so the platform-specific bits don't change their interface much. Reference Issue #10229. --- include/SDL3/SDL_filesystem.h | 17 +++++-------- src/core/SDL_core_unsupported.c | 3 ++- src/dynapi/SDL_dynapi_procs.h | 2 +- src/filesystem/SDL_filesystem.c | 24 +++++++++++++++++++ src/filesystem/SDL_sysfilesystem.h | 1 + src/filesystem/android/SDL_sysfilesystem.c | 2 +- src/filesystem/cocoa/SDL_sysfilesystem.m | 2 +- src/filesystem/dummy/SDL_sysfilesystem.c | 2 +- src/filesystem/emscripten/SDL_sysfilesystem.c | 2 +- src/filesystem/haiku/SDL_sysfilesystem.cc | 2 +- src/filesystem/n3ds/SDL_sysfilesystem.c | 2 +- src/filesystem/ps2/SDL_sysfilesystem.c | 2 +- src/filesystem/psp/SDL_sysfilesystem.c | 2 +- src/filesystem/riscos/SDL_sysfilesystem.c | 2 +- src/filesystem/unix/SDL_sysfilesystem.c | 2 +- src/filesystem/vita/SDL_sysfilesystem.c | 2 +- src/filesystem/windows/SDL_sysfilesystem.c | 2 +- src/filesystem/winrt/SDL_sysfilesystem.cpp | 2 +- test/testdialog.c | 6 +---- 19 files changed, 48 insertions(+), 31 deletions(-) diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index 26d640116354c..dc083fc903bba 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -204,12 +204,13 @@ typedef enum SDL_Folder SDL_FOLDER_TEMPLATES, /** Video files that can be played using a standard video player (mp4, webm...). */ - SDL_FOLDER_VIDEOS + SDL_FOLDER_VIDEOS, + /** total number of types in this enum, not a folder type by itself. */ + SDL_FOLDER_TOTAL } SDL_Folder; /** - * Finds the most suitable user folder for the specified purpose, and returns - * its path in OS-specific notation. + * Finds the most suitable user folder for a specific purpose. * * Many OSes provide certain standard folders for certain purposes, such as * storing pictures, music or videos for a certain user. This function gives @@ -220,14 +221,10 @@ typedef enum SDL_Folder * data for the application to manage, see SDL_GetBasePath() and * SDL_GetPrefPath(). * - * Note that the function is expensive, and should be called once at the - * beginning of the execution and kept for as long as needed. - * * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned value is owned by the caller and should be freed with - * SDL_free(). + * The returned string follows the SDL_GetStringRule. * * If NULL is returned, the error may be obtained with SDL_GetError(). * @@ -236,10 +233,8 @@ typedef enum SDL_Folder * folder, or NULL if an error happened. * * \since This function is available since SDL 3.0.0. - * - * \sa SDL_Folder */ -extern SDL_DECLSPEC char *SDLCALL SDL_GetUserFolder(SDL_Folder folder); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetUserFolder(SDL_Folder folder); /* Abstract filesystem interface */ diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index 32add8afb7001..883c50452f9d0 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -228,8 +228,9 @@ Sint32 JNI_OnLoad(void *vm, void *reserved) } #endif +// !!! FIXME: this probably belongs in src/filesystem/gdk #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) -char *SDL_GetUserFolder(SDL_Folder folder) +const char *SDL_GetUserFolder(SDL_Folder folder) { (void)folder; SDL_Unsupported(); diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 135289933b88b..12c32e555cc08 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -502,7 +502,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetTouchDeviceName,(SDL_TouchID a),(a),return) SDL_DYNAPI_PROC(SDL_TouchDeviceType,SDL_GetTouchDeviceType,(SDL_TouchID a),(a),return) SDL_DYNAPI_PROC(SDL_TouchID*,SDL_GetTouchDevices,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),return) -SDL_DYNAPI_PROC(char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return) SDL_DYNAPI_PROC(SDL_WinRT_DeviceFamily,SDL_GetWinRTDeviceFamily,(void),(),return) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 16c59f6e8b18d..c714f084ca0a8 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -411,14 +411,38 @@ const char *SDL_GetBasePath(void) return CachedBasePath; } + +static char *CachedUserFolders[SDL_FOLDER_TOTAL]; + +const char *SDL_GetUserFolder(SDL_Folder folder) +{ + const int idx = (int) folder; + if ((idx < 0) || (idx >= SDL_arraysize(CachedUserFolders))) { + SDL_InvalidParamError("folder"); + return NULL; + } + + if (!CachedUserFolders[idx]) { + CachedUserFolders[idx] = SDL_SYS_GetUserFolder(folder); + } + return CachedUserFolders[idx]; +} + + + void SDL_InitFilesystem(void) { CachedBasePath = NULL; // just in case. + SDL_zeroa(CachedUserFolders); } void SDL_QuitFilesystem(void) { SDL_free(CachedBasePath); CachedBasePath = NULL; + for (int i = 0; i < SDL_arraysize(CachedUserFolders); i++) { + SDL_free(CachedUserFolders[i]); + CachedUserFolders[i] = NULL; + } } diff --git a/src/filesystem/SDL_sysfilesystem.h b/src/filesystem/SDL_sysfilesystem.h index b7fe7f6ffb68e..ca190daa2daed 100644 --- a/src/filesystem/SDL_sysfilesystem.h +++ b/src/filesystem/SDL_sysfilesystem.h @@ -24,6 +24,7 @@ // return a string that we can SDL_free(). It will be cached at the higher level. extern char *SDL_SYS_GetBasePath(void); +extern char *SDL_SYS_GetUserFolder(SDL_Folder folder); int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_EnumerateDirectoryCallback cb, void *userdata); int SDL_SYS_RemovePath(const char *path); diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index 0170264134326..95c58efc9a434 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -49,7 +49,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) return NULL; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { /* TODO: see https://developer.android.com/reference/android/os/Environment#lfields and https://stackoverflow.com/questions/39332085/get-path-to-pictures-directory */ diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m index 308d6756151a8..500482c43f5d8 100644 --- a/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -126,7 +126,7 @@ } } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { @autoreleasepool { #ifdef SDL_PLATFORM_TVOS diff --git a/src/filesystem/dummy/SDL_sysfilesystem.c b/src/filesystem/dummy/SDL_sysfilesystem.c index cf9ca53d9825b..067bf15749246 100644 --- a/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/src/filesystem/dummy/SDL_sysfilesystem.c @@ -37,7 +37,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) return NULL; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/emscripten/SDL_sysfilesystem.c b/src/filesystem/emscripten/SDL_sysfilesystem.c index ea415547f5c57..c00107f808cbd 100644 --- a/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -81,7 +81,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) return retval; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { const char *home = NULL; diff --git a/src/filesystem/haiku/SDL_sysfilesystem.cc b/src/filesystem/haiku/SDL_sysfilesystem.cc index 82fc4ea12f93d..af5de0c41ced9 100644 --- a/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/src/filesystem/haiku/SDL_sysfilesystem.cc @@ -97,7 +97,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) return retval; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { const char *home = NULL; char *retval; diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index 897d11a508851..de9040fa05d65 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -60,7 +60,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) } /* TODO */ -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index 86d908af73e42..f50056e30948d 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -108,7 +108,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) } /* TODO */ -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/psp/SDL_sysfilesystem.c b/src/filesystem/psp/SDL_sysfilesystem.c index b29b1b210af51..f903abd7f10be 100644 --- a/src/filesystem/psp/SDL_sysfilesystem.c +++ b/src/filesystem/psp/SDL_sysfilesystem.c @@ -78,7 +78,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) } /* TODO */ -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/riscos/SDL_sysfilesystem.c b/src/filesystem/riscos/SDL_sysfilesystem.c index 55f69f3b8f603..ebb603272be59 100644 --- a/src/filesystem/riscos/SDL_sysfilesystem.c +++ b/src/filesystem/riscos/SDL_sysfilesystem.c @@ -197,7 +197,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) } /* TODO */ -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index 8c62d603fad89..12b40641cb329 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -510,7 +510,7 @@ static char *xdg_user_dir_lookup (const char *type) return NULL; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { const char *param = NULL; char *retval; diff --git a/src/filesystem/vita/SDL_sysfilesystem.c b/src/filesystem/vita/SDL_sysfilesystem.c index d030da2fdd31e..4b56955d929dc 100644 --- a/src/filesystem/vita/SDL_sysfilesystem.c +++ b/src/filesystem/vita/SDL_sysfilesystem.c @@ -81,7 +81,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) } /* TODO */ -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c index ff30453e02f58..5608f0ca6e63e 100644 --- a/src/filesystem/windows/SDL_sysfilesystem.c +++ b/src/filesystem/windows/SDL_sysfilesystem.c @@ -174,7 +174,7 @@ char *SDL_GetPrefPath(const char *org, const char *app) return retval; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { typedef HRESULT (WINAPI *pfnSHGetKnownFolderPath)(REFGUID /* REFKNOWNFOLDERID */, DWORD, HANDLE, PWSTR*); HMODULE lib = LoadLibrary(L"Shell32.dll"); diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index 9f710e71c2cbc..0046899b5c4ba 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -227,7 +227,7 @@ extern "C" char *SDL_GetPrefPath(const char *org, const char *app) return retval; } -char *SDL_GetUserFolder(SDL_Folder folder) +char *SDL_SYS_GetUserFolder(SDL_Folder folder) { wstring wpath; diff --git a/test/testdialog.c b/test/testdialog.c index eff2525524c57..29b3472dd96b8 100644 --- a/test/testdialog.c +++ b/test/testdialog.c @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) { const SDL_FRect save_file_rect = { 50, 290, 220, 140 }; const SDL_FRect open_folder_rect = { 370, 50, 220, 140 }; int i; - char *initial_path = NULL; + const char *initial_path = NULL; const int nfilters = sizeof(filters) / sizeof(*filters); /* Initialize test framework */ @@ -147,10 +147,6 @@ int main(int argc, char *argv[]) { SDL_RenderPresent(r); } - if (initial_path) { - SDL_free(initial_path); - } - SDLTest_CleanupTextDrawing(); SDL_DestroyRenderer(r); SDL_DestroyWindow(w); From 52bf7ff42d3c2fff0c13a1acc923473686e21d8c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 15 Jul 2024 20:21:22 -0400 Subject: [PATCH 344/431] filesystem: SDL_GetPrefPath() now follows the SDL_GetStringRule. Reference Issue #10229. --- include/SDL3/SDL_filesystem.h | 7 +++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/filesystem/SDL_filesystem.c | 9 +++++++++ src/filesystem/SDL_sysfilesystem.h | 1 + src/filesystem/android/SDL_sysfilesystem.c | 2 +- src/filesystem/cocoa/SDL_sysfilesystem.m | 2 +- src/filesystem/dummy/SDL_sysfilesystem.c | 2 +- src/filesystem/emscripten/SDL_sysfilesystem.c | 2 +- src/filesystem/gdk/SDL_sysfilesystem.cpp | 3 +-- src/filesystem/haiku/SDL_sysfilesystem.cc | 2 +- src/filesystem/n3ds/SDL_sysfilesystem.c | 2 +- src/filesystem/ps2/SDL_sysfilesystem.c | 2 +- src/filesystem/psp/SDL_sysfilesystem.c | 2 +- src/filesystem/riscos/SDL_sysfilesystem.c | 2 +- src/filesystem/unix/SDL_sysfilesystem.c | 2 +- src/filesystem/vita/SDL_sysfilesystem.c | 2 +- src/filesystem/windows/SDL_sysfilesystem.c | 2 +- src/filesystem/winrt/SDL_sysfilesystem.cpp | 2 +- src/storage/generic/SDL_genericstorage.c | 9 ++++++--- test/testfilesystem.c | 4 +--- 20 files changed, 35 insertions(+), 26 deletions(-) diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index dc083fc903bba..3520e0aeabdad 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -116,15 +116,14 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetBasePath(void); * your applications that use this function. * - Always use a unique app string for each one, and make sure it never * changes for an app once you've decided on it. - * - Unicode characters are legal, as long as it's UTF-8 encoded, but... + * - Unicode characters are legal, as long as they are UTF-8 encoded, but... * - ...only use letters, numbers, and spaces. Avoid punctuation like "Game * Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. * * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The pointer returned is owned by the caller. Please call SDL_free() on the - * pointer when done with it. + * The returned string follows the SDL_GetStringRule. * * \param org the name of your organization. * \param app the name of your application. @@ -136,7 +135,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetBasePath(void); * * \sa SDL_GetBasePath */ -extern SDL_DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); /** * The type of the OS-provided default folder for a specific purpose. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 12c32e555cc08..345bb35d30645 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -413,7 +413,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetPixelFormatName,(SDL_PixelFormat a),(a),retur SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_GetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) -SDL_DYNAPI_PROC(char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(const char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Locale*,SDL_GetPreferredLocales,(void),(),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetPrimarySelectionText,(void),(),return) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index c714f084ca0a8..324d31c0dd67e 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -429,6 +429,15 @@ const char *SDL_GetUserFolder(SDL_Folder folder) } +const char *SDL_GetPrefPath(const char *org, const char *app) +{ + char *path = SDL_SYS_GetPrefPath(org, app); + if (path) { + SDL_FreeLater(path); + } + return path; +} + void SDL_InitFilesystem(void) { diff --git a/src/filesystem/SDL_sysfilesystem.h b/src/filesystem/SDL_sysfilesystem.h index ca190daa2daed..bd010cac881c0 100644 --- a/src/filesystem/SDL_sysfilesystem.h +++ b/src/filesystem/SDL_sysfilesystem.h @@ -24,6 +24,7 @@ // return a string that we can SDL_free(). It will be cached at the higher level. extern char *SDL_SYS_GetBasePath(void); +extern char *SDL_SYS_GetPrefPath(const char *org, const char *app); extern char *SDL_SYS_GetUserFolder(SDL_Folder folder); int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_EnumerateDirectoryCallback cb, void *userdata); diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index 95c58efc9a434..d1189379b23a0 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -34,7 +34,7 @@ char *SDL_SYS_GetBasePath(void) return NULL; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { const char *path = SDL_GetAndroidInternalStoragePath(); if (path) { diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m index 500482c43f5d8..56542f66276a8 100644 --- a/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -61,7 +61,7 @@ } } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { @autoreleasepool { char *retval = NULL; diff --git a/src/filesystem/dummy/SDL_sysfilesystem.c b/src/filesystem/dummy/SDL_sysfilesystem.c index 067bf15749246..b870efd19062b 100644 --- a/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/src/filesystem/dummy/SDL_sysfilesystem.c @@ -31,7 +31,7 @@ char *SDL_SYS_GetBasePath(void) return NULL; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { SDL_Unsupported(); return NULL; diff --git a/src/filesystem/emscripten/SDL_sysfilesystem.c b/src/filesystem/emscripten/SDL_sysfilesystem.c index c00107f808cbd..37e11c10d2bf5 100644 --- a/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -34,7 +34,7 @@ char *SDL_SYS_GetBasePath(void) return SDL_strdup("/"); } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { const char *append = "/libsdl/"; char *retval; diff --git a/src/filesystem/gdk/SDL_sysfilesystem.cpp b/src/filesystem/gdk/SDL_sysfilesystem.cpp index c1d9fa98f0fb2..961901c72dffb 100644 --- a/src/filesystem/gdk/SDL_sysfilesystem.cpp +++ b/src/filesystem/gdk/SDL_sysfilesystem.cpp @@ -79,8 +79,7 @@ SDL_SYS_GetBasePath(void) return path; } -char * -SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { XUserHandle user = NULL; XAsyncBlock block = { 0 }; diff --git a/src/filesystem/haiku/SDL_sysfilesystem.cc b/src/filesystem/haiku/SDL_sysfilesystem.cc index af5de0c41ced9..3324627b36f0c 100644 --- a/src/filesystem/haiku/SDL_sysfilesystem.cc +++ b/src/filesystem/haiku/SDL_sysfilesystem.cc @@ -65,7 +65,7 @@ char *SDL_SYS_GetBasePath(void) } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { // !!! FIXME: is there a better way to do this? const char *home = SDL_getenv("HOME"); diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index de9040fa05d65..e6ba5454cda36 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -38,7 +38,7 @@ char *SDL_SYS_GetBasePath(void) return base_path; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { char *pref_path = NULL; if (!app) { diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index f50056e30948d..1f9f3eb435ee4 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -73,7 +73,7 @@ static void recursive_mkdir(const char *dir) mkdir(tmp, S_IRWXU); } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; diff --git a/src/filesystem/psp/SDL_sysfilesystem.c b/src/filesystem/psp/SDL_sysfilesystem.c index f903abd7f10be..9019abbd59dac 100644 --- a/src/filesystem/psp/SDL_sysfilesystem.c +++ b/src/filesystem/psp/SDL_sysfilesystem.c @@ -44,7 +44,7 @@ char *SDL_SYS_GetBasePath(void) return retval; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { char *retval = NULL; size_t len; diff --git a/src/filesystem/riscos/SDL_sysfilesystem.c b/src/filesystem/riscos/SDL_sysfilesystem.c index ebb603272be59..6c13ea55c7eda 100644 --- a/src/filesystem/riscos/SDL_sysfilesystem.c +++ b/src/filesystem/riscos/SDL_sysfilesystem.c @@ -150,7 +150,7 @@ char *SDL_SYS_GetBasePath(void) return retval; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { char *canon, *dir, *retval; size_t len; diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index 12b40641cb329..5550b3201c90a 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -253,7 +253,7 @@ char *SDL_SYS_GetBasePath(void) return retval; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { /* * We use XDG's base directory spec, even if you're not on Linux. diff --git a/src/filesystem/vita/SDL_sysfilesystem.c b/src/filesystem/vita/SDL_sysfilesystem.c index 4b56955d929dc..1bcde3a0006bc 100644 --- a/src/filesystem/vita/SDL_sysfilesystem.c +++ b/src/filesystem/vita/SDL_sysfilesystem.c @@ -39,7 +39,7 @@ char *SDL_SYS_GetBasePath(void) return SDL_strdup("app0:/"); } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { const char *envr = "ux0:/data/"; char *retval = NULL; diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c index 5608f0ca6e63e..5d18bf56c2dd4 100644 --- a/src/filesystem/windows/SDL_sysfilesystem.c +++ b/src/filesystem/windows/SDL_sysfilesystem.c @@ -90,7 +90,7 @@ char *SDL_SYS_GetBasePath(void) return retval; } -char *SDL_GetPrefPath(const char *org, const char *app) +char *SDL_SYS_GetPrefPath(const char *org, const char *app) { /* * Vista and later has a new API for this, but SHGetFolderPath works there, diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index 0046899b5c4ba..e63b55bc6dbe8 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -137,7 +137,7 @@ extern "C" char *SDL_SYS_GetBasePath(void) return destPath; } -extern "C" char *SDL_GetPrefPath(const char *org, const char *app) +extern "C" char *SDL_SYS_GetPrefPath(const char *org, const char *app) { /* WinRT note: The 'SHGetFolderPath' API that is used in Windows 7 and * earlier is not available on WinRT or Windows Phone. WinRT provides diff --git a/src/storage/generic/SDL_genericstorage.c b/src/storage/generic/SDL_genericstorage.c index c6bfb74fe73cb..9f174238e1d56 100644 --- a/src/storage/generic/SDL_genericstorage.c +++ b/src/storage/generic/SDL_genericstorage.c @@ -225,15 +225,18 @@ static const SDL_StorageInterface GENERIC_user_iface = { static SDL_Storage *GENERIC_User_Create(const char *org, const char *app, SDL_PropertiesID props) { SDL_Storage *result; - - char *prefpath = SDL_GetPrefPath(org, app); + char *prefpath = NULL; + const char *sdlprefpath = SDL_GetPrefPath(org, app); + if (sdlprefpath) { + prefpath = SDL_strdup(sdlprefpath); + } if (prefpath == NULL) { return NULL; } result = SDL_OpenStorage(&GENERIC_user_iface, prefpath); if (result == NULL) { - SDL_free(prefpath); + SDL_free(prefpath); // otherwise CloseStorage will free it. } return result; } diff --git a/test/testfilesystem.c b/test/testfilesystem.c index 54214d71da924..39c5177ff2b4f 100644 --- a/test/testfilesystem.c +++ b/test/testfilesystem.c @@ -61,7 +61,7 @@ static int SDLCALL enum_callback(void *userdata, const char *origdir, const char int main(int argc, char *argv[]) { SDLTest_CommonState *state; - char *pref_path; + const char *pref_path; const char *base_path; /* Initialize test framework */ @@ -97,7 +97,6 @@ int main(int argc, char *argv[]) SDL_GetError()); } else { SDL_Log("pref path: '%s'\n", pref_path); - SDL_free(pref_path); } pref_path = SDL_GetPrefPath(NULL, "test_filesystem"); @@ -106,7 +105,6 @@ int main(int argc, char *argv[]) SDL_GetError()); } else { SDL_Log("pref path: '%s'\n", pref_path); - SDL_free(pref_path); } if (base_path) { From ed1f93cd11fe7812719553a19a18230d3685439c Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 15 Jul 2024 20:36:33 -0400 Subject: [PATCH 345/431] filesystem: `SDL_Glob*Directory()` functions now follow the SDL_GetStringRule. Reference Issue #10229. --- include/SDL3/SDL_filesystem.h | 4 ++-- include/SDL3/SDL_storage.h | 4 ++-- src/dynapi/SDL_dynapi_procs.h | 4 ++-- src/filesystem/SDL_filesystem.c | 7 ++++--- src/filesystem/SDL_sysfilesystem.h | 2 +- src/storage/SDL_storage.c | 2 +- test/testfilesystem.c | 3 +-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index 3520e0aeabdad..0650dbdeb0a07 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -354,7 +354,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * You must free the returned pointer with SDL_free() when done with it. + * The returned pointer follows the SDL_GetStringRule. * * \param path the path of the directory to enumerate. * \param pattern the pattern that files in the directory must match. Can be @@ -370,7 +370,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC char **SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count); +extern SDL_DECLSPEC const char * const *SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index c98c5201a6e22..7431748941493 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -383,7 +383,7 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * You must free the returned pointer with SDL_free() when done with it. + * The returned pointer follows the SDL_GetStringRule. * * \param storage a storage container. * \param path the path of the directory to enumerate. @@ -401,7 +401,7 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC char **SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count); +extern SDL_DECLSPEC const char * const *SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 345bb35d30645..ac14f04df84ee 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -532,8 +532,8 @@ SDL_DYNAPI_PROC(SDL_Surface*,SDL_GetWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowSurfaceVSync,(SDL_Window *a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetWindowTitle,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Window**,SDL_GetWindows,(int *a),(a),return) -SDL_DYNAPI_PROC(char**,SDL_GlobDirectory,(const char *a, const char *b, SDL_GlobFlags c, int *d),(a,b,c,d),return) -SDL_DYNAPI_PROC(char**,SDL_GlobStorageDirectory,(SDL_Storage *a, const char *b, const char *c, SDL_GlobFlags d, int *e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(const char * const *,SDL_GlobDirectory,(const char *a, const char *b, SDL_GlobFlags c, int *d),(a,b,c,d),return) +SDL_DYNAPI_PROC(const char * const *,SDL_GlobStorageDirectory,(SDL_Storage *a, const char *b, const char *c, SDL_GlobFlags d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HapticEffectSupported,(SDL_Haptic *a, const SDL_HapticEffect *b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HapticRumbleSupported,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HasARMSIMD,(void),(),return) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 324d31c0dd67e..bc3222a64ee8d 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -286,7 +286,7 @@ static int SDLCALL GlobDirectoryCallback(void *userdata, const char *dirname, co return retval; } -char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata) +const char * const *SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata) { int dummycount; if (!count) { @@ -381,7 +381,8 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob SDL_free(folded); SDL_free(pathcpy); - return retval; + SDL_FreeLater(retval); + return (const char * const *) retval; } static int GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata) @@ -394,7 +395,7 @@ static int GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallb return SDL_EnumerateDirectory(path, cb, cbuserdata); } -char **SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count) +const char * const *SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count) { //SDL_Log("SDL_GlobDirectory('%s', '%s') ...", path, pattern); return SDL_InternalGlobDirectory(path, pattern, flags, count, GlobDirectoryEnumerator, GlobDirectoryGetPathInfo, NULL); diff --git a/src/filesystem/SDL_sysfilesystem.h b/src/filesystem/SDL_sysfilesystem.h index bd010cac881c0..9f02a1e8d06ff 100644 --- a/src/filesystem/SDL_sysfilesystem.h +++ b/src/filesystem/SDL_sysfilesystem.h @@ -35,7 +35,7 @@ int SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info); typedef int (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata); typedef int (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata); -char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata); +const char * const *SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata); #endif diff --git a/src/storage/SDL_storage.c b/src/storage/SDL_storage.c index 431110f953bca..b61f1a1ee18ae 100644 --- a/src/storage/SDL_storage.c +++ b/src/storage/SDL_storage.c @@ -335,7 +335,7 @@ static int GlobStorageDirectoryEnumerator(const char *path, SDL_EnumerateDirecto return SDL_EnumerateStorageDirectory((SDL_Storage *) userdata, path, cb, cbuserdata); } -char **SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count) +const char * const *SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count) { CHECK_STORAGE_MAGIC_RET(NULL) return SDL_InternalGlobDirectory(path, pattern, flags, count, GlobStorageDirectoryEnumerator, GlobStorageDirectoryGetPathInfo, storage); diff --git a/test/testfilesystem.c b/test/testfilesystem.c index 39c5177ff2b4f..286de004a1318 100644 --- a/test/testfilesystem.c +++ b/test/testfilesystem.c @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) } if (base_path) { - char **globlist; + const char * const *globlist; if (SDL_EnumerateDirectory(base_path, enum_callback, NULL) < 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Base path enumeration failed!"); @@ -122,7 +122,6 @@ int main(int argc, char *argv[]) for (i = 0; globlist[i]; i++) { SDL_Log("GLOB[%d]: '%s'", i, globlist[i]); } - SDL_free(globlist); } /* !!! FIXME: put this in a subroutine and make it test more thoroughly (and put it in testautomation). */ From 4dda785c697b6c6b32f6d9d2cad31f6147db1959 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 15 Jul 2024 20:41:46 -0400 Subject: [PATCH 346/431] gamepad: Several gamepad mapping functions now follow the SDL_GetStringRule. Reference Issue #10229. --- include/SDL3/SDL_gamepad.h | 23 +++++++++++------------ src/dynapi/SDL_dynapi_procs.h | 8 ++++---- src/joystick/SDL_gamepad.c | 15 ++++++++++----- test/gamepadutils.c | 13 +++++-------- test/testcontroller.c | 10 +++++----- 5 files changed, 35 insertions(+), 34 deletions(-) diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index dea57ca279349..48eda3c2e66f7 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -389,22 +389,20 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void); /** * Get the current gamepad mappings. * - * You must free the returned pointer with SDL_free() when you are done with - * it, but you do _not_ free each string in the array. + * The returned pointer follows the SDL_GetStringRule. * * \param count a pointer filled in with the number of mappings returned, can * be NULL. - * \returns an array of the mapping strings, NULL-terminated. Must be freed - * with SDL_free(). Returns NULL on error. + * \returns an array of the mapping strings, NULL-terminated. Returns NULL on error. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count); +extern SDL_DECLSPEC const char * const * SDLCALL SDL_GetGamepadMappings(int *count); /** * Get the gamepad mapping string for a given GUID. * - * The returned string must be freed with SDL_free(). + * The returned string follows the SDL_GetStringRule. * * \param guid a structure containing the GUID for which a mapping is desired. * \returns a mapping string or NULL on error; call SDL_GetError() for more @@ -415,12 +413,12 @@ extern SDL_DECLSPEC char ** SDLCALL SDL_GetGamepadMappings(int *count); * \sa SDL_GetJoystickGUIDForID * \sa SDL_GetJoystickGUID */ -extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid); /** * Get the current mapping of a gamepad. * - * The returned string must be freed with SDL_free(). + * The returned string follows the SDL_GetStringRule. * * Details about mappings are discussed with SDL_AddGamepadMapping(). * @@ -435,7 +433,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID * \sa SDL_GetGamepadMappingForGUID * \sa SDL_SetGamepadMapping */ -extern SDL_DECLSPEC char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMapping(SDL_Gamepad *gamepad); /** * Set the current mapping of a joystick or gamepad. @@ -651,16 +649,17 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_Joys * * This can be called before any gamepads are opened. * + * The returned string follows the SDL_GetStringRule. + * * \param instance_id the joystick instance ID. - * \returns the mapping string. Must be freed with SDL_free(). Returns NULL if - * no mapping is available. + * \returns the mapping string. Returns NULL if no mapping is available. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetGamepads * \sa SDL_GetGamepadMapping */ -extern SDL_DECLSPEC char *SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id); /** * Open a gamepad for use. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index ac14f04df84ee..2e3f15cef09d7 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -286,10 +286,10 @@ SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromPlayerIndex,(int a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadID,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetGamepadJoystick,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(char*,SDL_GetGamepadMapping,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForGUID,(SDL_JoystickGUID a),(a),return) -SDL_DYNAPI_PROC(char*,SDL_GetGamepadMappingForID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(char**,SDL_GetGamepadMappings,(int *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMapping,(SDL_Gamepad *a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMappingForGUID,(SDL_JoystickGUID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMappingForID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(const char * const *,SDL_GetGamepadMappings,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadName,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadNameForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadPath,(SDL_Gamepad *a),(a),return) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index ce9e614d12fcd..cc2f3eceb5aa2 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -2125,7 +2125,7 @@ static char *CreateMappingString(GamepadMapping_t *mapping, SDL_JoystickGUID gui return pMappingString; } -char **SDL_GetGamepadMappings(int *count) +const char * const *SDL_GetGamepadMappings(int *count) { int num_mappings = 0; char **retval = NULL; @@ -2198,13 +2198,14 @@ char **SDL_GetGamepadMappings(int *count) SDL_free(mappings); } - return retval; + SDL_FreeLater(retval); + return (const char * const *) retval; } /* * Get the mapping string for this GUID */ -char *SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid) +const char *SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid) { char *retval; @@ -2220,13 +2221,14 @@ char *SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid) } SDL_UnlockJoysticks(); + SDL_FreeLater(retval); return retval; } /* * Get the mapping string for this device */ -char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) +const char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) { char *retval; @@ -2238,6 +2240,7 @@ char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) } SDL_UnlockJoysticks(); + SDL_FreeLater(retval); return retval; } @@ -2519,7 +2522,7 @@ SDL_GamepadType SDL_GetRealGamepadTypeForID(SDL_JoystickID instance_id) return type; } -char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) +const char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) { char *retval = NULL; @@ -2534,6 +2537,8 @@ char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) } } SDL_UnlockJoysticks(); + + SDL_FreeLater(retval); return retval; } diff --git a/test/gamepadutils.c b/test/gamepadutils.c index f94da4012e950..887c83fc70b70 100644 --- a/test/gamepadutils.c +++ b/test/gamepadutils.c @@ -416,13 +416,12 @@ void UpdateGamepadImageFromGamepad(GamepadImage *ctx, SDL_Gamepad *gamepad) } ctx->type = SDL_GetGamepadType(gamepad); - char *mapping = SDL_GetGamepadMapping(gamepad); + const char *mapping = SDL_GetGamepadMapping(gamepad); if (mapping) { if (SDL_strstr(mapping, "SDL_GAMECONTROLLER_USE_BUTTON_LABELS")) { /* Just for display purposes */ ctx->type = SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO; } - SDL_free(mapping); } for (i = 0; i < SDL_GAMEPAD_BUTTON_TOUCHPAD; ++i) { @@ -750,7 +749,7 @@ void SetGamepadDisplayArea(GamepadDisplay *ctx, const SDL_FRect *area) SDL_copyp(&ctx->area, area); } -static SDL_bool GetBindingString(const char *label, char *mapping, char *text, size_t size) +static SDL_bool GetBindingString(const char *label, const char *mapping, char *text, size_t size) { char *key; char *value, *end; @@ -791,7 +790,7 @@ static SDL_bool GetBindingString(const char *label, char *mapping, char *text, s return found; } -static SDL_bool GetButtonBindingString(SDL_GamepadButton button, char *mapping, char *text, size_t size) +static SDL_bool GetButtonBindingString(SDL_GamepadButton button, const char *mapping, char *text, size_t size) { char label[32]; SDL_bool baxy_mapping = SDL_FALSE; @@ -839,7 +838,7 @@ static SDL_bool GetButtonBindingString(SDL_GamepadButton button, char *mapping, } } -static SDL_bool GetAxisBindingString(SDL_GamepadAxis axis, int direction, char *mapping, char *text, size_t size) +static SDL_bool GetAxisBindingString(SDL_GamepadAxis axis, int direction, const char *mapping, char *text, size_t size) { char label[32]; @@ -1022,7 +1021,7 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad) const float arrow_extent = 48.0f; SDL_FRect dst, rect, highlight; Uint8 r, g, b, a; - char *mapping = NULL; + const char *mapping = NULL; SDL_bool has_accel; SDL_bool has_gyro; @@ -1286,8 +1285,6 @@ void RenderGamepadDisplay(GamepadDisplay *ctx, SDL_Gamepad *gamepad) } } } - - SDL_free(mapping); } void DestroyGamepadDisplay(GamepadDisplay *ctx) diff --git a/test/testcontroller.c b/test/testcontroller.c index 7f791e09f05ed..e6820ff88bb01 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -973,6 +973,7 @@ static void DelController(SDL_JoystickID id) static void HandleGamepadRemapped(SDL_JoystickID id) { + const char *sdlmapping; char *mapping; int i = FindController(id); @@ -987,7 +988,8 @@ static void HandleGamepadRemapped(SDL_JoystickID id) } /* Get the current mapping */ - mapping = SDL_GetGamepadMapping(controllers[i].gamepad); + sdlmapping = SDL_GetGamepadMapping(controllers[i].gamepad); + mapping = sdlmapping ? SDL_strdup(sdlmapping) : NULL; /* Make sure the mapping has a valid name */ if (mapping && !MappingHasName(mapping)) { @@ -1063,10 +1065,9 @@ static void HandleGamepadAdded(SDL_JoystickID id, SDL_bool verbose) } if (verbose) { - char *mapping = SDL_GetGamepadMapping(gamepad); + const char *mapping = SDL_GetGamepadMapping(gamepad); if (mapping) { SDL_Log("Mapping: %s\n", mapping); - SDL_free(mapping); } } } else { @@ -2053,14 +2054,13 @@ int main(int argc, char *argv[]) if (show_mappings) { int count = 0; - char **mappings = SDL_GetGamepadMappings(&count); + const char * const *mappings = SDL_GetGamepadMappings(&count); int map_i; SDL_Log("Supported mappings:\n"); for (map_i = 0; map_i < count; ++map_i) { SDL_Log("\t%s\n", mappings[map_i]); } SDL_Log("\n"); - SDL_free(mappings); } /* Create a window to display gamepad state */ From fe183872ee1336d33e5f4301cab00872bd22cf06 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Tue, 16 Jul 2024 20:45:34 +0000 Subject: [PATCH 347/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_gamepad.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 48eda3c2e66f7..f8778fcb4fe6d 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -393,7 +393,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void); * * \param count a pointer filled in with the number of mappings returned, can * be NULL. - * \returns an array of the mapping strings, NULL-terminated. Returns NULL on error. + * \returns an array of the mapping strings, NULL-terminated. Returns NULL on + * error. * * \since This function is available since SDL 3.0.0. */ From 9ca179284854b7969137dc0111f5ae6c3cad104a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 11:09:18 -0700 Subject: [PATCH 348/431] Renamed driverdata to internal This was done to SDL_DisplayMode for consistency with SDL_Surface and gives it a type so we don't have to do casts in SDL code. I considered switching to an ID and hashing the driver data, etc. but all of that involved a lot of internal code churn and this solution gives us flexibility in how we handle this in the future. After consideration, I made this renaming global across the project, for consistency. Fixes https://github.com/libsdl-org/SDL/issues/10198 --- include/SDL3/SDL_video.h | 7 +- src/core/android/SDL_android.c | 6 +- src/core/winrt/SDL_winrtapp_direct3d.cpp | 4 +- src/events/SDL_mouse.c | 4 +- src/events/SDL_mouse_c.h | 4 +- src/render/SDL_sysrender.h | 4 +- src/render/direct3d/SDL_render_d3d.c | 66 +++--- src/render/direct3d11/SDL_render_d3d11.c | 86 +++---- src/render/direct3d12/SDL_render_d3d12.c | 90 +++---- src/render/metal/SDL_render_metal.m | 62 ++--- src/render/opengl/SDL_render_gl.c | 58 ++--- src/render/opengles2/SDL_render_gles2.c | 60 ++--- src/render/ps2/SDL_render_ps2.c | 46 ++-- src/render/psp/SDL_render_psp.c | 36 +-- src/render/software/SDL_render_sw.c | 30 +-- src/render/vitagxm/SDL_render_vita_gxm.c | 52 ++--- .../vitagxm/SDL_render_vita_gxm_tools.c | 4 +- src/render/vulkan/SDL_render_vulkan.c | 90 +++---- src/video/SDL_egl_c.h | 6 +- src/video/SDL_sysvideo.h | 6 +- src/video/SDL_video.c | 18 +- src/video/android/SDL_androidevents.c | 8 +- src/video/android/SDL_androidgl.c | 6 +- src/video/android/SDL_androidmouse.c | 8 +- src/video/android/SDL_androidvideo.c | 7 +- src/video/android/SDL_androidvulkan.c | 2 +- src/video/android/SDL_androidwindow.c | 12 +- src/video/cocoa/SDL_cocoaclipboard.m | 2 +- src/video/cocoa/SDL_cocoaevents.m | 8 +- src/video/cocoa/SDL_cocoakeyboard.m | 12 +- src/video/cocoa/SDL_cocoamessagebox.m | 2 +- src/video/cocoa/SDL_cocoametalview.m | 2 +- src/video/cocoa/SDL_cocoamodes.m | 28 +-- src/video/cocoa/SDL_cocoamouse.m | 68 +++--- src/video/cocoa/SDL_cocoaopengl.m | 8 +- src/video/cocoa/SDL_cocoaopengles.m | 10 +- src/video/cocoa/SDL_cocoashape.m | 2 +- src/video/cocoa/SDL_cocoavideo.m | 8 +- src/video/cocoa/SDL_cocoavulkan.m | 2 +- src/video/cocoa/SDL_cocoawindow.m | 100 ++++---- .../emscripten/SDL_emscriptenframebuffer.c | 6 +- src/video/emscripten/SDL_emscriptenmouse.c | 12 +- src/video/emscripten/SDL_emscriptenopengles.c | 6 +- src/video/emscripten/SDL_emscriptenvideo.c | 22 +- src/video/haiku/SDL_bframebuffer.cc | 2 +- src/video/haiku/SDL_bmodes.cc | 16 +- src/video/haiku/SDL_bopengl.cc | 2 +- src/video/haiku/SDL_bvideo.cc | 16 +- src/video/haiku/SDL_bwindow.cc | 6 +- src/video/kmsdrm/SDL_kmsdrmmouse.c | 32 +-- src/video/kmsdrm/SDL_kmsdrmopengles.c | 6 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 92 ++++---- src/video/kmsdrm/SDL_kmsdrmvideo.h | 6 +- src/video/n3ds/SDL_n3dsframebuffer.c | 2 +- src/video/n3ds/SDL_n3dstouch.c | 4 +- src/video/n3ds/SDL_n3dsvideo.c | 28 +-- src/video/ngage/SDL_ngageevents.cpp | 4 +- src/video/ngage/SDL_ngageframebuffer.cpp | 10 +- src/video/ngage/SDL_ngagevideo.cpp | 4 +- src/video/ngage/SDL_ngagewindow.cpp | 10 +- src/video/offscreen/SDL_offscreenopengles.c | 6 +- src/video/offscreen/SDL_offscreenwindow.c | 6 +- src/video/psp/SDL_pspgl.c | 4 +- src/video/psp/SDL_pspvideo.c | 6 +- src/video/qnx/SDL_qnxgl.c | 6 +- src/video/qnx/SDL_qnxvideo.c | 18 +- src/video/raspberry/SDL_rpimouse.c | 16 +- src/video/raspberry/SDL_rpimouse.h | 2 +- src/video/raspberry/SDL_rpiopengles.c | 2 +- src/video/raspberry/SDL_rpivideo.c | 14 +- src/video/riscos/SDL_riscosevents.c | 28 +-- src/video/riscos/SDL_riscosframebuffer.c | 40 ++-- src/video/riscos/SDL_riscosmodes.c | 12 +- src/video/riscos/SDL_riscosmouse.c | 2 +- src/video/riscos/SDL_riscosvideo.c | 6 +- src/video/riscos/SDL_riscoswindow.c | 20 +- src/video/uikit/SDL_uikitappdelegate.m | 2 +- src/video/uikit/SDL_uikitclipboard.m | 4 +- src/video/uikit/SDL_uikitmessagebox.m | 2 +- src/video/uikit/SDL_uikitmetalview.m | 2 +- src/video/uikit/SDL_uikitmodes.m | 32 +-- src/video/uikit/SDL_uikitopengles.m | 4 +- src/video/uikit/SDL_uikitvideo.m | 10 +- src/video/uikit/SDL_uikitview.m | 4 +- src/video/uikit/SDL_uikitviewcontroller.m | 8 +- src/video/uikit/SDL_uikitwindow.m | 36 +-- src/video/vita/SDL_vitaframebuffer.c | 4 +- src/video/vita/SDL_vitagl_pvr.c | 2 +- src/video/vita/SDL_vitagles.c | 4 +- src/video/vita/SDL_vitagles_pvr.c | 8 +- src/video/vita/SDL_vitavideo.c | 18 +- src/video/vivante/SDL_vivantevideo.c | 28 +-- src/video/wayland/SDL_waylandclipboard.c | 12 +- src/video/wayland/SDL_waylandevents.c | 26 +-- src/video/wayland/SDL_waylandkeyboard.c | 32 +-- src/video/wayland/SDL_waylandmouse.c | 36 +-- src/video/wayland/SDL_waylandopengles.c | 18 +- src/video/wayland/SDL_waylandshmbuffer.c | 2 +- src/video/wayland/SDL_waylandvideo.c | 220 +++++++++--------- src/video/wayland/SDL_waylandvulkan.c | 4 +- src/video/wayland/SDL_waylandwindow.c | 164 ++++++------- src/video/windows/SDL_windowsclipboard.c | 4 +- src/video/windows/SDL_windowsevents.c | 16 +- src/video/windows/SDL_windowsframebuffer.c | 6 +- src/video/windows/SDL_windowskeyboard.c | 24 +- src/video/windows/SDL_windowsmessagebox.c | 4 +- src/video/windows/SDL_windowsmodes.c | 60 ++--- src/video/windows/SDL_windowsmouse.c | 16 +- src/video/windows/SDL_windowsopengl.c | 8 +- src/video/windows/SDL_windowsopengles.c | 6 +- src/video/windows/SDL_windowsrawinput.c | 6 +- src/video/windows/SDL_windowsshape.c | 2 +- src/video/windows/SDL_windowsvideo.c | 24 +- src/video/windows/SDL_windowsvulkan.c | 2 +- src/video/windows/SDL_windowswindow.c | 94 ++++---- src/video/winrt/SDL_winrtgamebar.cpp | 16 +- src/video/winrt/SDL_winrtkeyboard.cpp | 2 +- src/video/winrt/SDL_winrtmouse.cpp | 10 +- src/video/winrt/SDL_winrtopengles.cpp | 4 +- src/video/winrt/SDL_winrtpointerinput.cpp | 2 +- src/video/winrt/SDL_winrtvideo.cpp | 40 ++-- src/video/x11/SDL_x11clipboard.c | 12 +- src/video/x11/SDL_x11events.c | 46 ++-- src/video/x11/SDL_x11framebuffer.c | 6 +- src/video/x11/SDL_x11keyboard.c | 18 +- src/video/x11/SDL_x11messagebox.c | 4 +- src/video/x11/SDL_x11modes.c | 38 +-- src/video/x11/SDL_x11mouse.c | 24 +- src/video/x11/SDL_x11opengl.c | 24 +- src/video/x11/SDL_x11opengles.c | 6 +- src/video/x11/SDL_x11pen.c | 8 +- src/video/x11/SDL_x11settings.c | 8 +- src/video/x11/SDL_x11shape.c | 2 +- src/video/x11/SDL_x11video.c | 14 +- src/video/x11/SDL_x11vulkan.c | 12 +- src/video/x11/SDL_x11window.c | 120 +++++----- src/video/x11/SDL_x11xfixes.c | 12 +- src/video/x11/SDL_x11xinput2.c | 20 +- 138 files changed, 1454 insertions(+), 1456 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index c7f43c8a98a06..fdb2a42615720 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -74,6 +74,9 @@ typedef enum SDL_SystemTheme SDL_SYSTEM_THEME_DARK /**< Dark colored system theme */ } SDL_SystemTheme; +/* Internal display mode data */ +typedef struct SDL_DisplayModeData SDL_DisplayModeData; + /** * The structure that defines a display mode. * @@ -95,7 +98,9 @@ typedef struct SDL_DisplayMode float refresh_rate; /**< refresh rate (or 0.0f for unspecified) */ int refresh_rate_numerator; /**< precise refresh rate numerator (or 0 for unspecified) */ int refresh_rate_denominator; /**< precise refresh rate denominator */ - void *driverdata; /**< driver-specific data, initialize to 0 */ + + SDL_DisplayModeData *internal; /**< Private */ + } SDL_DisplayMode; /** diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index fc0a949da1c68..d0c4e1a04edd1 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -1144,7 +1144,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceCreated)(JNIEnv *env, j SDL_LockMutex(Android_ActivityMutex); if (Android_Window) { - SDL_WindowData *data = Android_Window->driverdata; + SDL_WindowData *data = Android_Window->internal; data->native_window = Android_JNI_GetNativeWindow(); if (data->native_window == NULL) { @@ -1163,7 +1163,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(JNIEnv *env, j #ifdef SDL_VIDEO_OPENGL_EGL if (Android_Window) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); - SDL_WindowData *data = Android_Window->driverdata; + SDL_WindowData *data = Android_Window->internal; /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */ if (data->egl_surface == EGL_NO_SURFACE) { @@ -1187,7 +1187,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceDestroyed)(JNIEnv *env, SDL_LockMutex(Android_ActivityMutex); if (Android_Window) { - SDL_WindowData *data = Android_Window->driverdata; + SDL_WindowData *data = Android_Window->internal; /* Wait for Main thread being paused and context un-activated to release 'egl_surface' */ if (!data->backup_done) { diff --git a/src/core/winrt/SDL_winrtapp_direct3d.cpp b/src/core/winrt/SDL_winrtapp_direct3d.cpp index 38cbb08648a6e..65c623bf45c76 100644 --- a/src/core/winrt/SDL_winrtapp_direct3d.cpp +++ b/src/core/winrt/SDL_winrtapp_direct3d.cpp @@ -108,7 +108,7 @@ static void WINRT_ProcessWindowSizeChange() // TODO: Pass an SDL_Window-identify if (coreWindow) { if (WINRT_GlobalSDLWindow) { SDL_Window *window = WINRT_GlobalSDLWindow; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; int x = (int)SDL_lroundf(data->coreWindow->Bounds.Left); int y = (int)SDL_lroundf(data->coreWindow->Bounds.Top); @@ -228,7 +228,7 @@ void SDL_WinRTApp::OnOrientationChanged(Object ^ sender) // TODO, WinRT: do more extensive research into why orientation changes on Win 8.x don't need D3D changes, or if they might, in some cases SDL_Window *window = WINRT_GlobalSDLWindow; if (window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; int w = (int)SDL_floorf(data->coreWindow->Bounds.Width); int h = (int)SDL_floorf(data->coreWindow->Bounds.Height); SDL_SendWindowEvent(WINRT_GlobalSDLWindow, SDL_EVENT_WINDOW_RESIZED, w, h); diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index f6a4d1c5353f4..b87ae49f52070 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -409,7 +409,7 @@ void SDL_SetDefaultCursor(SDL_Cursor *cursor) } } - if (mouse->FreeCursor && default_cursor->driverdata) { + if (mouse->FreeCursor && default_cursor->internal) { mouse->FreeCursor(default_cursor); } else { SDL_free(default_cursor); @@ -1628,7 +1628,7 @@ void SDL_DestroyCursor(SDL_Cursor *cursor) mouse->cursors = curr->next; } - if (mouse->FreeCursor && curr->driverdata) { + if (mouse->FreeCursor && curr->internal) { mouse->FreeCursor(curr); } else { SDL_free(curr); diff --git a/src/events/SDL_mouse_c.h b/src/events/SDL_mouse_c.h index 2641107638ee1..5f950d6cbd41c 100644 --- a/src/events/SDL_mouse_c.h +++ b/src/events/SDL_mouse_c.h @@ -32,7 +32,7 @@ struct SDL_Cursor { struct SDL_Cursor *next; - void *driverdata; + void *internal; }; typedef struct @@ -126,7 +126,7 @@ typedef struct SDL_bool cursor_shown; /* Driver-dependent data. */ - void *driverdata; + void *internal; } SDL_Mouse; /* Initialize the mouse subsystem, called before the main video driver is initialized */ diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index a33791d8de8ca..50fd617d572b5 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -88,7 +88,7 @@ struct SDL_Texture SDL_PropertiesID props; - void *driverdata; /**< Driver specific texture representation */ + void *internal; /**< Driver specific texture representation */ SDL_Texture *prev; SDL_Texture *next; @@ -290,7 +290,7 @@ struct SDL_Renderer SDL_bool destroyed; // already destroyed by SDL_DestroyWindow; just free this struct in SDL_DestroyRenderer. - void *driverdata; + void *internal; SDL_Renderer *next; }; diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 6bdeef46751c9..06bdbbe2c9aba 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -285,7 +285,7 @@ static int D3D_Reset(SDL_Renderer *renderer); static int D3D_ActivateRenderer(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; HRESULT result; if (data->updateSize) { @@ -332,7 +332,7 @@ static int D3D_ActivateRenderer(SDL_Renderer *renderer) static void D3D_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { data->updateSize = SDL_TRUE; @@ -389,7 +389,7 @@ static D3DBLENDOP GetBlendEquation(SDL_BlendOperation operation) static SDL_bool D3D_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode); @@ -523,7 +523,7 @@ static void D3D_DestroyTextureRep(D3D_TextureRep *texture) static int D3D_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; D3D_TextureData *texturedata; DWORD usage; @@ -533,7 +533,7 @@ static int D3D_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P } texturedata->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? D3DTEXF_POINT : D3DTEXF_LINEAR; - texture->driverdata = texturedata; + texture->internal = texturedata; if (texture->access == SDL_TEXTUREACCESS_TARGET) { usage = D3DUSAGE_RENDERTARGET; @@ -569,8 +569,8 @@ static int D3D_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P static int D3D_RecreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return 0; @@ -596,8 +596,8 @@ static int D3D_RecreateTexture(SDL_Renderer *renderer, SDL_Texture *texture) static int D3D_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return SDL_SetError("Texture is not currently available"); @@ -632,8 +632,8 @@ static int D3D_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return SDL_SetError("Texture is not currently available"); @@ -655,8 +655,8 @@ static int D3D_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, static int D3D_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; IDirect3DDevice9 *device = data->device; if (!texturedata) { @@ -706,8 +706,8 @@ static int D3D_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void D3D_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return; @@ -736,7 +736,7 @@ static void D3D_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void D3D_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return; @@ -747,7 +747,7 @@ static void D3D_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture static int D3D_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; D3D_TextureData *texturedata; D3D_TextureRep *texturerep; HRESULT result; @@ -764,7 +764,7 @@ static int D3D_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *text return 0; } - texturedata = (D3D_TextureData *)texture->driverdata; + texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return SDL_SetError("Texture is not currently available"); } @@ -941,7 +941,7 @@ static void UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *textur static int SetupTextureState(D3D_RenderData *data, SDL_Texture *texture, D3D9_Shader *shader, const float **shader_params) { - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; if (!texturedata) { return SDL_SetError("Texture is not currently available"); @@ -978,8 +978,8 @@ static int SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) if (texture != data->drawstate.texture) { #if SDL_HAVE_YUV - D3D_TextureData *oldtexturedata = data->drawstate.texture ? (D3D_TextureData *)data->drawstate.texture->driverdata : NULL; - D3D_TextureData *newtexturedata = texture ? (D3D_TextureData *)texture->driverdata : NULL; + D3D_TextureData *oldtexturedata = data->drawstate.texture ? (D3D_TextureData *)data->drawstate.texture->internal : NULL; + D3D_TextureData *newtexturedata = texture ? (D3D_TextureData *)texture->internal : NULL; #endif D3D9_Shader shader = SHADER_NONE; const float *shader_params = NULL; @@ -1021,7 +1021,7 @@ static int SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) data->drawstate.texture = texture; } else if (texture) { - D3D_TextureData *texturedata = (D3D_TextureData *)texture->driverdata; + D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; UpdateDirtyTexture(data->device, &texturedata->texture); #if SDL_HAVE_YUV if (texturedata->yuv) { @@ -1104,7 +1104,7 @@ static int SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) static void D3D_InvalidateCachedState(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; data->drawstate.viewport_dirty = SDL_TRUE; data->drawstate.cliprect_enabled_dirty = SDL_TRUE; data->drawstate.cliprect_dirty = SDL_TRUE; @@ -1116,7 +1116,7 @@ static void D3D_InvalidateCachedState(SDL_Renderer *renderer) static int D3D_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; const int vboidx = data->currentVertexBuffer; IDirect3DVertexBuffer9 *vbo = NULL; const SDL_bool istarget = renderer->target != NULL; @@ -1315,7 +1315,7 @@ static int D3D_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v static SDL_Surface *D3D_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; D3DSURFACE_DESC desc; LPDIRECT3DSURFACE9 backBuffer; LPDIRECT3DSURFACE9 surface; @@ -1372,7 +1372,7 @@ static SDL_Surface *D3D_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect static int D3D_RenderPresent(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; HRESULT result; if (!data->beginScene) { @@ -1397,8 +1397,8 @@ static int D3D_RenderPresent(SDL_Renderer *renderer) static void D3D_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D_RenderData *renderdata = (D3D_RenderData *)renderer->driverdata; - D3D_TextureData *data = (D3D_TextureData *)texture->driverdata; + D3D_RenderData *renderdata = (D3D_RenderData *)renderer->internal; + D3D_TextureData *data = (D3D_TextureData *)texture->internal; if (renderdata->drawstate.texture == texture) { renderdata->drawstate.texture = NULL; @@ -1425,12 +1425,12 @@ static void D3D_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) SDL_free(data->pixels); #endif SDL_free(data); - texture->driverdata = NULL; + texture->internal = NULL; } static void D3D_DestroyRenderer(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; if (data) { int i; @@ -1473,7 +1473,7 @@ static void D3D_DestroyRenderer(SDL_Renderer *renderer) static int D3D_Reset(SDL_Renderer *renderer) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; const Float4X4 d3dmatrix = MatrixIdentity(); HRESULT result; SDL_Texture *texture; @@ -1551,7 +1551,7 @@ static int D3D_Reset(SDL_Renderer *renderer) static int D3D_SetVSync(SDL_Renderer *renderer, const int vsync) { - D3D_RenderData *data = (D3D_RenderData *)renderer->driverdata; + D3D_RenderData *data = (D3D_RenderData *)renderer->internal; DWORD PresentationInterval; switch (vsync) { @@ -1648,7 +1648,7 @@ int D3D_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propertie renderer->DestroyTexture = D3D_DestroyTexture; renderer->DestroyRenderer = D3D_DestroyRenderer; renderer->SetVSync = D3D_SetVSync; - renderer->driverdata = data; + renderer->internal = data; D3D_InvalidateCachedState(renderer); renderer->name = D3D_RenderDriver.name; diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 9990aecd1267e..159975614561e 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -325,7 +325,7 @@ static void D3D11_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); static void D3D11_ReleaseAll(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; SDL_Texture *texture = NULL; /* Release all textures */ @@ -410,7 +410,7 @@ static void D3D11_ReleaseAll(SDL_Renderer *renderer) static void D3D11_DestroyRenderer(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; D3D11_ReleaseAll(renderer); if (data) { SDL_free(data); @@ -465,7 +465,7 @@ static D3D11_BLEND_OP GetBlendEquation(SDL_BlendOperation operation) static ID3D11BlendState *D3D11_CreateBlendState(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); SDL_BlendOperation colorOperation = SDL_GetBlendModeColorOperation(blendMode); @@ -514,7 +514,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) typedef HRESULT(WINAPI * PFN_CREATE_DXGI_FACTORY2)(UINT flags, REFIID riid, void **ppFactory); PFN_CREATE_DXGI_FACTORY CreateDXGIFactoryFunc = NULL; PFN_CREATE_DXGI_FACTORY2 CreateDXGIFactory2Func = NULL; - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; PFN_D3D11_CREATE_DEVICE D3D11CreateDeviceFunc; ID3D11Device *d3dDevice = NULL; ID3D11DeviceContext *d3dContext = NULL; @@ -829,7 +829,7 @@ static BOOL D3D11_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) static int D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; if (data->currentOffscreenRenderTargetView) { return DXGI_MODE_ROTATION_IDENTITY; } else { @@ -839,7 +839,7 @@ static int D3D11_GetRotationForCurrentRenderTarget(SDL_Renderer *renderer) static int D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rect *sdlRect, D3D11_RECT *outRect, BOOL includeViewportOffset) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; const int rotation = D3D11_GetRotationForCurrentRenderTarget(renderer); const SDL_Rect *viewport = &data->currentViewport; @@ -882,7 +882,7 @@ static int D3D11_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rec static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; #ifdef SDL_PLATFORM_WINRT IUnknown *coreWindow = D3D11_GetCoreWindowFromSDLRenderer(renderer); const BOOL usingXAML = (!coreWindow); @@ -1038,7 +1038,7 @@ static HRESULT D3D11_CreateSwapChain(SDL_Renderer *renderer, int w, int h) static void D3D11_ReleaseMainRenderTargetView(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; ID3D11DeviceContext_OMSetRenderTargets(data->d3dContext, 0, NULL, NULL); SAFE_RELEASE(data->mainRenderTargetView); } @@ -1077,7 +1077,7 @@ static HRESULT D3D11_HandleDeviceLost(SDL_Renderer *renderer) /* Initialize all resources that change when the window's size changes. */ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; ID3D11Texture2D *backBuffer = NULL; HRESULT result = S_OK; int w, h; @@ -1203,7 +1203,7 @@ void D3D11_Trim(SDL_Renderer *renderer) { #ifdef SDL_PLATFORM_WINRT #if NTDDI_VERSION > NTDDI_WIN8 - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; HRESULT result = S_OK; IDXGIDevice3 *dxgiDevice = NULL; @@ -1221,7 +1221,7 @@ void D3D11_Trim(SDL_Renderer *renderer) static void D3D11_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { data->pixelSizeChanged = SDL_TRUE; @@ -1260,7 +1260,7 @@ static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D11Te static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; D3D11_TextureData *textureData; HRESULT result; DXGI_FORMAT textureFormat = SDLPixelFormatToDXGITextureFormat(texture->format, renderer->output_colorspace); @@ -1278,7 +1278,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } textureData->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR; - texture->driverdata = textureData; + texture->internal = textureData; SDL_zero(textureDesc); textureDesc.Width = texture->w; @@ -1465,7 +1465,7 @@ static int D3D11_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL static void D3D11_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D11_TextureData *data = (D3D11_TextureData *)texture->driverdata; + D3D11_TextureData *data = (D3D11_TextureData *)texture->internal; if (!data) { return; @@ -1484,7 +1484,7 @@ static void D3D11_DestroyTexture(SDL_Renderer *renderer, SDL_free(data->pixels); #endif SDL_free(data); - texture->driverdata = NULL; + texture->internal = NULL; } static int D3D11_UpdateTextureInternal(D3D11_RenderData *rendererData, ID3D11Texture2D *texture, int bpp, int x, int y, int w, int h, const void *pixels, int pitch) @@ -1607,8 +1607,8 @@ static int D3D11_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *srcPixels, int srcPitch) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -1649,8 +1649,8 @@ static int D3D11_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -1673,8 +1673,8 @@ static int D3D11_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; ID3D11Texture2D *stagingTexture; const Uint8 *src; Uint8 *dst; @@ -1785,8 +1785,8 @@ static int D3D11_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, static int D3D11_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; HRESULT result = S_OK; D3D11_TEXTURE2D_DESC stagingTextureDesc; D3D11_MAPPED_SUBRESOURCE textureMemory; @@ -1867,8 +1867,8 @@ static int D3D11_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void D3D11_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; if (!textureData) { return; @@ -1904,7 +1904,7 @@ static void D3D11_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void D3D11_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; if (!textureData) { return; @@ -1915,7 +1915,7 @@ static void D3D11_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu static int D3D11_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; D3D11_TextureData *textureData = NULL; if (!texture) { @@ -1923,7 +1923,7 @@ static int D3D11_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) return 0; } - textureData = (D3D11_TextureData *)texture->driverdata; + textureData = (D3D11_TextureData *)texture->internal; if (!textureData->mainTextureRenderTargetView) { return SDL_SetError("specified texture is not a render target"); @@ -1977,7 +1977,7 @@ static int D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, S int count = indices ? num_indices : num_vertices; VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); SDL_bool convert_color = SDL_RenderingLinearSpace(renderer); - D3D11_TextureData *textureData = texture ? (D3D11_TextureData *)texture->driverdata : NULL; + D3D11_TextureData *textureData = texture ? (D3D11_TextureData *)texture->internal : NULL; float u_scale = textureData ? (float)texture->w / textureData->w : 0.0f; float v_scale = textureData ? (float)texture->h / textureData->h : 0.0f; @@ -2027,7 +2027,7 @@ static int D3D11_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, S static int D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, const void *vertexData, size_t dataSizeInBytes) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; HRESULT result = S_OK; const int vbidx = rendererData->currentVertexBuffer; const UINT stride = sizeof(VertexPositionColor); @@ -2095,7 +2095,7 @@ static int D3D11_UpdateVertexBuffer(SDL_Renderer *renderer, static int D3D11_UpdateViewport(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; const SDL_Rect *viewport = &data->currentViewport; Float4X4 projection; Float4X4 view; @@ -2187,7 +2187,7 @@ static int D3D11_UpdateViewport(SDL_Renderer *renderer) static ID3D11RenderTargetView *D3D11_GetCurrentRenderTargetView(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; if (data->currentOffscreenRenderTargetView) { return data->currentOffscreenRenderTargetView; } else { @@ -2205,7 +2205,7 @@ static void D3D11_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC constants->color_scale = cmd->data.draw.color_scale; if (texture) { - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; switch (texture->format) { case SDL_PIXELFORMAT_YV12: @@ -2263,7 +2263,7 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c ID3D11SamplerState *sampler, const Float4X4 *matrix) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; const Float4X4 *newmatrix = matrix ? matrix : &rendererData->identity; ID3D11RasterizerState *rasterizerState; ID3D11RenderTargetView *renderTargetView = D3D11_GetCurrentRenderTargetView(renderer); @@ -2413,8 +2413,8 @@ static int D3D11_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c static int D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix) { SDL_Texture *texture = cmd->data.draw.texture; - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; - D3D11_TextureData *textureData = (D3D11_TextureData *)texture->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; + D3D11_TextureData *textureData = (D3D11_TextureData *)texture->internal; ID3D11SamplerState *textureSampler; PixelShaderConstants constants; @@ -2461,14 +2461,14 @@ static int D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *c static void D3D11_DrawPrimitives(SDL_Renderer *renderer, D3D11_PRIMITIVE_TOPOLOGY primitiveTopology, const size_t vertexStart, const size_t vertexCount) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; ID3D11DeviceContext_IASetPrimitiveTopology(rendererData->d3dContext, primitiveTopology); ID3D11DeviceContext_Draw(rendererData->d3dContext, (UINT)vertexCount, (UINT)vertexStart); } static void D3D11_InvalidateCachedState(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; data->currentRenderTargetView = NULL; data->currentRasterizerState = NULL; data->currentBlendState = NULL; @@ -2481,7 +2481,7 @@ static void D3D11_InvalidateCachedState(SDL_Renderer *renderer) static int D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *rendererData = (D3D11_RenderData *)renderer->internal; const int viewportRotation = D3D11_GetRotationForCurrentRenderTarget(renderer); if (rendererData->pixelSizeChanged) { @@ -2606,7 +2606,7 @@ static int D3D11_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, static SDL_Surface *D3D11_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; ID3D11RenderTargetView *renderTargetView = NULL; ID3D11Texture2D *backBuffer = NULL; ID3D11Texture2D *stagingTexture = NULL; @@ -2698,7 +2698,7 @@ static SDL_Surface *D3D11_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rec static int D3D11_RenderPresent(SDL_Renderer *renderer) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; HRESULT result; DXGI_PRESENT_PARAMETERS parameters; @@ -2744,7 +2744,7 @@ static int D3D11_RenderPresent(SDL_Renderer *renderer) static int D3D11_SetVSync(SDL_Renderer *renderer, const int vsync) { - D3D11_RenderData *data = (D3D11_RenderData *)renderer->driverdata; + D3D11_RenderData *data = (D3D11_RenderData *)renderer->internal; #if SDL_WINAPI_FAMILY_PHONE /* VSync is required in Windows Phone, at least for Win Phone 8.0 and 8.1. @@ -2824,7 +2824,7 @@ static int D3D11_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ renderer->DestroyTexture = D3D11_DestroyTexture; renderer->DestroyRenderer = D3D11_DestroyRenderer; renderer->SetVSync = D3D11_SetVSync; - renderer->driverdata = data; + renderer->internal = data; D3D11_InvalidateCachedState(renderer); renderer->name = D3D11_RenderDriver.name; diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 8e3fddd647fc4..565ff2b25720b 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -442,7 +442,7 @@ static void D3D12_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture); static void D3D12_ReleaseAll(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; SDL_Texture *texture = NULL; SDL_PropertiesID props = SDL_GetRendererProperties(renderer); @@ -556,7 +556,7 @@ static void D3D12_WaitForGPU(D3D12_RenderData *data) static D3D12_CPU_DESCRIPTOR_HANDLE D3D12_GetCurrentRenderTargetView(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; D3D12_CPU_DESCRIPTOR_HANDLE rtvDescriptor; if (data->textureRenderTarget) { @@ -634,7 +634,7 @@ static int D3D12_IssueBatch(D3D12_RenderData *data) static void D3D12_DestroyRenderer(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; D3D12_WaitForGPU(data); D3D12_ReleaseAll(renderer); if (data) { @@ -721,7 +721,7 @@ static D3D12_PipelineState *D3D12_CreatePipelineState(SDL_Renderer *renderer, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 16, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, }; - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; D3D12_GRAPHICS_PIPELINE_STATE_DESC pipelineDesc; ID3D12PipelineState *pipelineState = NULL; D3D12_PipelineState *pipelineStates; @@ -838,7 +838,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) typedef HANDLE(WINAPI * PFN_CREATE_EVENT_EX)(LPSECURITY_ATTRIBUTES lpEventAttributes, LPCWSTR lpName, DWORD dwFlags, DWORD dwDesiredAccess); PFN_CREATE_EVENT_EX CreateEventExFunc; - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; ID3D12Device *d3dDevice = NULL; HRESULT result = S_OK; UINT creationFlags = 0; @@ -1219,7 +1219,7 @@ static BOOL D3D12_IsDisplayRotated90Degrees(DXGI_MODE_ROTATION rotation) static int D3D12_GetRotationForCurrentRenderTarget(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; if (data->textureRenderTarget) { return DXGI_MODE_ROTATION_IDENTITY; } else { @@ -1229,7 +1229,7 @@ static int D3D12_GetRotationForCurrentRenderTarget(SDL_Renderer *renderer) static int D3D12_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rect *sdlRect, D3D12_RECT *outRect, BOOL includeViewportOffset) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; const int rotation = D3D12_GetRotationForCurrentRenderTarget(renderer); const SDL_Rect *viewport = &data->currentViewport; @@ -1273,7 +1273,7 @@ static int D3D12_GetViewportAlignedD3DRect(SDL_Renderer *renderer, const SDL_Rec #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) static HRESULT D3D12_CreateSwapChain(SDL_Renderer *renderer, int w, int h) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; IDXGISwapChain1 *swapChain = NULL; HRESULT result = S_OK; @@ -1419,7 +1419,7 @@ D3D12_HandleDeviceLost(SDL_Renderer *renderer) /* Initialize all resources that change when the window's size changes. */ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; HRESULT result = S_OK; int i, w, h; @@ -1545,7 +1545,7 @@ static HRESULT D3D12_CreateWindowSizeDependentResources(SDL_Renderer *renderer) /* This method is called when the window's size changes. */ static HRESULT D3D12_UpdateForWindowSizeChange(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; /* If the GPU has previous work, wait for it to be done first */ D3D12_WaitForGPU(data); return D3D12_CreateWindowSizeDependentResources(renderer); @@ -1553,7 +1553,7 @@ static HRESULT D3D12_UpdateForWindowSizeChange(SDL_Renderer *renderer) static void D3D12_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { data->pixelSizeChanged = SDL_TRUE; @@ -1580,7 +1580,7 @@ static SDL_bool D3D12_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode bl static SIZE_T D3D12_GetAvailableSRVIndex(SDL_Renderer *renderer) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; if (rendererData->srvPoolHead) { SIZE_T index = rendererData->srvPoolHead->index; rendererData->srvPoolHead = (D3D12_SRVPoolNode *)(rendererData->srvPoolHead->next); @@ -1593,7 +1593,7 @@ static SIZE_T D3D12_GetAvailableSRVIndex(SDL_Renderer *renderer) static void D3D12_FreeSRVIndex(SDL_Renderer *renderer, SIZE_T index) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; rendererData->srvPoolNodes[index].next = rendererData->srvPoolHead; rendererData->srvPoolHead = &rendererData->srvPoolNodes[index]; } @@ -1612,7 +1612,7 @@ static int GetTextureProperty(SDL_PropertiesID props, const char *name, ID3D12Re static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; D3D12_TextureData *textureData; HRESULT result; DXGI_FORMAT textureFormat = SDLPixelFormatToDXGITextureFormat(texture->format, renderer->output_colorspace); @@ -1630,7 +1630,7 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } textureData->scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? D3D12_FILTER_MIN_MAG_MIP_POINT : D3D12_FILTER_MIN_MAG_MIP_LINEAR; - texture->driverdata = textureData; + texture->internal = textureData; textureData->mainTextureFormat = textureFormat; SDL_zero(textureDesc); @@ -1834,8 +1834,8 @@ static int D3D12_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL static void D3D12_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; if (!textureData) { return; @@ -1861,7 +1861,7 @@ static void D3D12_DestroyTexture(SDL_Renderer *renderer, SDL_free(textureData->pixels); #endif SDL_free(textureData); - texture->driverdata = NULL; + texture->internal = NULL; } static int D3D12_UpdateTextureInternal(D3D12_RenderData *rendererData, ID3D12Resource *texture, int plane, int x, int y, int w, int h, const void *pixels, int pitch, D3D12_RESOURCE_STATES *resourceState) @@ -2006,8 +2006,8 @@ static int D3D12_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *srcPixels, int srcPitch) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2056,8 +2056,8 @@ static int D3D12_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2080,8 +2080,8 @@ static int D3D12_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2101,8 +2101,8 @@ static int D3D12_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, static int D3D12_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; HRESULT result = S_OK; D3D12_RESOURCE_DESC textureDesc; @@ -2221,8 +2221,8 @@ static int D3D12_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void D3D12_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; D3D12_RESOURCE_DESC textureDesc; D3D12_SUBRESOURCE_FOOTPRINT pitchedDesc; @@ -2300,7 +2300,7 @@ static void D3D12_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void D3D12_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; if (!textureData) { return; @@ -2311,7 +2311,7 @@ static void D3D12_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu static int D3D12_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; D3D12_TextureData *textureData = NULL; if (!texture) { @@ -2326,7 +2326,7 @@ static int D3D12_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) return 0; } - textureData = (D3D12_TextureData *)texture->driverdata; + textureData = (D3D12_TextureData *)texture->internal; if (!textureData->mainTextureRenderTargetView.ptr) { return SDL_SetError("specified texture is not a render target"); @@ -2385,7 +2385,7 @@ static int D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, S int count = indices ? num_indices : num_vertices; VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); SDL_bool convert_color = SDL_RenderingLinearSpace(renderer); - D3D12_TextureData *textureData = texture ? (D3D12_TextureData *)texture->driverdata : NULL; + D3D12_TextureData *textureData = texture ? (D3D12_TextureData *)texture->internal : NULL; float u_scale = textureData ? (float)texture->w / textureData->w : 0.0f; float v_scale = textureData ? (float)texture->h / textureData->h : 0.0f; @@ -2435,7 +2435,7 @@ static int D3D12_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, S static int D3D12_UpdateVertexBuffer(SDL_Renderer *renderer, const void *vertexData, size_t dataSizeInBytes) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; HRESULT result = S_OK; const int vbidx = rendererData->currentVertexBuffer; UINT8 *vertexBufferData = NULL; @@ -2484,7 +2484,7 @@ static int D3D12_UpdateVertexBuffer(SDL_Renderer *renderer, static int D3D12_UpdateViewport(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; const SDL_Rect *viewport = &data->currentViewport; Float4X4 projection; Float4X4 view; @@ -2583,7 +2583,7 @@ static void D3D12_SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderC constants->color_scale = cmd->data.draw.color_scale; if (texture) { - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; switch (texture->format) { case SDL_PIXELFORMAT_YV12: @@ -2641,7 +2641,7 @@ static int D3D12_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c D3D12_CPU_DESCRIPTOR_HANDLE *sampler, const Float4X4 *matrix) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; const Float4X4 *newmatrix = matrix ? matrix : &rendererData->identity; D3D12_CPU_DESCRIPTOR_HANDLE renderTargetView = D3D12_GetCurrentRenderTargetView(renderer); const SDL_BlendMode blendMode = cmd->data.draw.blend; @@ -2788,8 +2788,8 @@ static int D3D12_SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *c static int D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix) { SDL_Texture *texture = cmd->data.draw.texture; - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; - D3D12_TextureData *textureData = (D3D12_TextureData *)texture->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; + D3D12_TextureData *textureData = (D3D12_TextureData *)texture->internal; D3D12_CPU_DESCRIPTOR_HANDLE *textureSampler; PixelShaderConstants constants; @@ -2842,14 +2842,14 @@ static int D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *c static void D3D12_DrawPrimitives(SDL_Renderer *renderer, D3D12_PRIMITIVE_TOPOLOGY primitiveTopology, const size_t vertexStart, const size_t vertexCount) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; D3D_CALL(rendererData->commandList, IASetPrimitiveTopology, primitiveTopology); D3D_CALL(rendererData->commandList, DrawInstanced, (UINT)vertexCount, 1, (UINT)vertexStart, 0); } static void D3D12_InvalidateCachedState(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; data->currentRenderTargetView.ptr = 0; data->currentShaderResource.ptr = 0; data->currentSampler.ptr = 0; @@ -2859,7 +2859,7 @@ static void D3D12_InvalidateCachedState(SDL_Renderer *renderer) static int D3D12_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *rendererData = (D3D12_RenderData *)renderer->internal; const int viewportRotation = D3D12_GetRotationForCurrentRenderTarget(renderer); if (rendererData->pixelSizeChanged) { @@ -2995,7 +2995,7 @@ static int D3D12_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, static SDL_Surface *D3D12_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; ID3D12Resource *backBuffer = NULL; ID3D12Resource *readbackBuffer = NULL; HRESULT result; @@ -3142,7 +3142,7 @@ static SDL_Surface *D3D12_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rec static int D3D12_RenderPresent(SDL_Renderer *renderer) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; HRESULT result; /* Transition the render target to present state */ @@ -3212,7 +3212,7 @@ static int D3D12_RenderPresent(SDL_Renderer *renderer) static int D3D12_SetVSync(SDL_Renderer *renderer, const int vsync) { - D3D12_RenderData *data = (D3D12_RenderData *)renderer->driverdata; + D3D12_RenderData *data = (D3D12_RenderData *)renderer->internal; if (vsync < 0) { return SDL_Unsupported(); @@ -3281,7 +3281,7 @@ int D3D12_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Propert renderer->DestroyTexture = D3D12_DestroyTexture; renderer->DestroyRenderer = D3D12_DestroyRenderer; renderer->SetVSync = D3D12_SetVSync; - renderer->driverdata = data; + renderer->internal = data; D3D12_InvalidateCachedState(renderer); renderer->name = D3D12_RenderDriver.name; diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index e16f391189f03..e5f1185ba3e2e 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -440,7 +440,7 @@ static void DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count) static SDL_bool METAL_ActivateRenderCommandEncoder(SDL_Renderer *renderer, MTLLoadAction load, MTLClearColor *clear_color, id vertex_buffer) { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; /* Our SetRenderTarget just signals that the next render operation should * set up a new render pass. This is where that work happens. */ @@ -448,7 +448,7 @@ static SDL_bool METAL_ActivateRenderCommandEncoder(SDL_Renderer *renderer, MTLLo id mtltexture = nil; if (renderer->target != NULL) { - METAL_TextureData *texdata = (__bridge METAL_TextureData *)renderer->target->driverdata; + METAL_TextureData *texdata = (__bridge METAL_TextureData *)renderer->target->internal; mtltexture = texdata.mtltexture; } else { if (data.mtlbackbuffer == nil) { @@ -512,7 +512,7 @@ static void METAL_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *eve static int METAL_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; if (w) { *w = (int)data.mtllayer.drawableSize.width; } @@ -624,7 +624,7 @@ size_t GetYCbCRtoRGBConversionMatrix(SDL_Colorspace colorspace, int w, int h, in static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; MTLPixelFormat pixfmt; MTLTextureDescriptor *mtltexdesc; id mtltexture = nil, mtltextureUv = nil; @@ -766,7 +766,7 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL texturedata.conversionBufferOffset = offset; } #endif - texture->driverdata = (void *)CFBridgingRetain(texturedata); + texture->internal = (void *)CFBridgingRetain(texturedata); return 0; } @@ -796,7 +796,7 @@ static int METAL_UpdateTextureInternal(SDL_Renderer *renderer, METAL_TextureData id texture, SDL_Rect rect, int slice, const void *pixels, int pitch) { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; SDL_Rect stagingrect = { 0, 0, rect.w, rect.h }; MTLTextureDescriptor *desc; id stagingtex; @@ -864,7 +864,7 @@ static int METAL_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { @autoreleasepool { - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; if (METAL_UpdateTextureInternal(renderer, texturedata, texturedata.mtltexture, *rect, 0, pixels, pitch) < 0) { return -1; @@ -914,7 +914,7 @@ static int METAL_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Vplane, int Vpitch) { @autoreleasepool { - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; const int Uslice = 0; const int Vslice = 1; SDL_Rect UVrect = { rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2 }; @@ -946,7 +946,7 @@ static int METAL_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *UVplane, int UVpitch) { @autoreleasepool { - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; SDL_Rect UVrect = { rect->x / 2, rect->y / 2, (rect->w + 1) / 2, (rect->h + 1) / 2 }; /* Bail out if we're supposed to update an empty rectangle */ @@ -973,8 +973,8 @@ static int METAL_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; int buffersize = 0; id lockedbuffer = nil; @@ -1008,8 +1008,8 @@ static int METAL_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void METAL_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; id blitcmd; SDL_Rect rect = texturedata.lockedrect; int pitch = SDL_BYTESPERPIXEL(texture->format) * rect.w; @@ -1095,8 +1095,8 @@ static void METAL_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void METAL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; if (scaleMode == SDL_SCALEMODE_NEAREST) { texturedata.mtlsampler = data.mtlsamplernearest; @@ -1109,7 +1109,7 @@ static void METAL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu static int METAL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; if (data.mtlcmdencoder) { /* End encoding for the previous render target so we can set up a new @@ -1399,7 +1399,7 @@ static void SetupShaderConstants(SDL_Renderer *renderer, const SDL_RenderCommand static SDL_bool SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_MetalFragmentFunction shader, PixelShaderConstants *shader_constants, const size_t constants_offset, id mtlbufvertex, METAL_DrawStateCache *statecache) { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; const SDL_BlendMode blend = cmd->data.draw.blend; size_t first = cmd->data.draw.first; id newpipeline; @@ -1491,9 +1491,9 @@ static SDL_bool SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cm static SDL_bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const size_t constants_offset, id mtlbufvertex, METAL_DrawStateCache *statecache) { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; SDL_Texture *texture = cmd->data.draw.texture; - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata; + METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; PixelShaderConstants constants; SetupShaderConstants(renderer, cmd, texture, &constants); @@ -1505,7 +1505,7 @@ static SDL_bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cm if (texture != statecache->texture) { METAL_TextureData *oldtexturedata = NULL; if (statecache->texture) { - oldtexturedata = (__bridge METAL_TextureData *)statecache->texture->driverdata; + oldtexturedata = (__bridge METAL_TextureData *)statecache->texture->internal; } if (!oldtexturedata || (texturedata.mtlsampler != oldtexturedata.mtlsampler)) { [data.mtlcmdencoder setFragmentSamplerState:texturedata.mtlsampler atIndex:0]; @@ -1531,7 +1531,7 @@ static void METAL_InvalidateCachedState(SDL_Renderer *renderer) static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; id mtlbufvertex = nil; METAL_DrawStateCache statecache; SDL_zero(statecache); @@ -1680,7 +1680,7 @@ static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, static SDL_Surface *METAL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; id mtltexture; MTLRegion mtlregion; Uint32 format; @@ -1745,7 +1745,7 @@ static int METAL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, static int METAL_RenderPresent(SDL_Renderer *renderer) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; SDL_bool ready = SDL_TRUE; // If we don't have a command buffer, we can't present, so activate to get one. @@ -1785,16 +1785,16 @@ static int METAL_RenderPresent(SDL_Renderer *renderer) static void METAL_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { @autoreleasepool { - CFBridgingRelease(texture->driverdata); - texture->driverdata = NULL; + CFBridgingRelease(texture->internal); + texture->internal = NULL; } } static void METAL_DestroyRenderer(SDL_Renderer *renderer) { @autoreleasepool { - if (renderer->driverdata) { - METAL_RenderData *data = CFBridgingRelease(renderer->driverdata); + if (renderer->internal) { + METAL_RenderData *data = CFBridgingRelease(renderer->internal); if (data.mtlcmdencoder != nil) { [data.mtlcmdencoder endEncoding]; @@ -1814,7 +1814,7 @@ in case we want to use it later (recreating the renderer) static void *METAL_GetMetalLayer(SDL_Renderer *renderer) { @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; return (__bridge void *)data.mtllayer; } } @@ -1827,7 +1827,7 @@ in case we want to use it later (recreating the renderer) // usable for presentation. Check your return values! METAL_RenderData *data; METAL_ActivateRenderCommandEncoder(renderer, MTLLoadActionLoad, NULL, nil); - data = (__bridge METAL_RenderData *)renderer->driverdata; + data = (__bridge METAL_RenderData *)renderer->internal; return (__bridge void *)data.mtlcmdencoder; } } @@ -1836,7 +1836,7 @@ static int METAL_SetVSync(SDL_Renderer *renderer, const int vsync) { #if (defined(SDL_PLATFORM_MACOS) && defined(MAC_OS_X_VERSION_10_13)) || TARGET_OS_MACCATALYST if (@available(macOS 10.13, *)) { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->driverdata; + METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; switch (vsync) { case 0: data.mtllayer.displaySyncEnabled = NO; @@ -2012,7 +2012,7 @@ in case we want to use it later (recreating the renderer) return SDL_SetError("METAL_RenderData alloc/init failed"); } - renderer->driverdata = (void *)CFBridgingRetain(data); + renderer->internal = (void *)CFBridgingRetain(data); METAL_InvalidateCachedState(renderer); renderer->window = window; diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index a4f7cd061a7c7..e5e8fe99c7b4f 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -173,7 +173,7 @@ static const char *GL_TranslateError(GLenum error) static void GL_ClearErrors(SDL_Renderer *renderer) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; if (!data->debug_enabled) { return; @@ -198,7 +198,7 @@ static void GL_ClearErrors(SDL_Renderer *renderer) static int GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; int ret = 0; if (!data->debug_enabled) { @@ -259,7 +259,7 @@ static int GL_LoadFunctions(GL_RenderData *data) static int GL_ActivateRenderer(SDL_Renderer *renderer) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; if (SDL_GL_GetCurrentContext() != data->context) { if (SDL_GL_MakeCurrent(renderer->window, data->context) < 0) { @@ -275,7 +275,7 @@ static int GL_ActivateRenderer(SDL_Renderer *renderer) static void APIENTRY GL_HandleDebugMessage(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char *message, const void *userParam) { SDL_Renderer *renderer = (SDL_Renderer *)userParam; - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; if (type == GL_DEBUG_TYPE_ERROR_ARB) { /* Record this error */ @@ -329,7 +329,7 @@ static void GL_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) */ if (event->type == SDL_EVENT_WINDOW_RESIZED || event->type == SDL_EVENT_WINDOW_MOVED) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; data->drawstate.viewport_dirty = SDL_TRUE; } } @@ -441,7 +441,7 @@ static SDL_bool convert_format(Uint32 pixel_format, GLint *internalFormat, GLenu static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->internal; const GLenum textype = renderdata->textype; GL_TextureData *data; GLint internalFormat; @@ -510,7 +510,7 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr return -1; } } - texture->driverdata = data; + texture->internal = data; if (renderdata->GL_ARB_texture_non_power_of_two_supported) { texture_w = texture->w; @@ -692,9 +692,9 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr static int GL_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { - GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->internal; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->internal; const int texturebpp = SDL_BYTESPERPIXEL(texture->format); SDL_assert_release(texturebpp != 0); /* otherwise, division by zero later. */ @@ -757,9 +757,9 @@ static int GL_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) { - GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->internal; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->internal; GL_ActivateRenderer(renderer); @@ -792,9 +792,9 @@ static int GL_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) { - GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->internal; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->internal; GL_ActivateRenderer(renderer); @@ -820,7 +820,7 @@ static int GL_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, static int GL_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->internal; data->locked_rect = *rect; *pixels = @@ -832,7 +832,7 @@ static int GL_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void GL_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->internal; const SDL_Rect *rect; void *pixels; @@ -845,9 +845,9 @@ static void GL_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void GL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->internal; const GLenum textype = renderdata->textype; - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_TextureData *data = (GL_TextureData *)texture->internal; GLenum glScaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? GL_NEAREST : GL_LINEAR; renderdata->glBindTexture(textype, data->texture); @@ -877,7 +877,7 @@ static void GL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, static int GL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; GL_TextureData *texturedata; GLenum status; @@ -894,7 +894,7 @@ static int GL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) return 0; } - texturedata = (GL_TextureData *)texture->driverdata; + texturedata = (GL_TextureData *)texture->internal; data->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, texturedata->fbo->FBO); /* TODO: check if texture pixel format allows this operation */ data->glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, data->textype, texturedata->texture, 0); @@ -990,7 +990,7 @@ static int GL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_ } if (texture) { - texturedata = (GL_TextureData *)texture->driverdata; + texturedata = (GL_TextureData *)texture->internal; } cmd->data.draw.count = count; @@ -1144,7 +1144,7 @@ static int SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const static int SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) { SDL_Texture *texture = cmd->data.draw.texture; - const GL_TextureData *texturedata = (GL_TextureData *)texture->driverdata; + const GL_TextureData *texturedata = (GL_TextureData *)texture->internal; SetDrawState(data, cmd, texturedata->shader, texturedata->shader_params); @@ -1182,7 +1182,7 @@ static int SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) static void GL_InvalidateCachedState(SDL_Renderer *renderer) { - GL_DrawStateCache *cache = &((GL_RenderData *)renderer->driverdata)->drawstate; + GL_DrawStateCache *cache = &((GL_RenderData *)renderer->internal)->drawstate; cache->viewport_dirty = SDL_TRUE; cache->texture = NULL; cache->drawablew = 0; @@ -1202,7 +1202,7 @@ static void GL_InvalidateCachedState(SDL_Renderer *renderer) static int GL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { /* !!! FIXME: it'd be nice to use a vertex buffer instead of immediate mode... */ - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; if (GL_ActivateRenderer(renderer) < 0) { return -1; @@ -1449,7 +1449,7 @@ static int GL_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo static SDL_Surface *GL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; SDL_PixelFormat format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_ARGB8888; GLint internalFormat; GLenum targetFormat, type; @@ -1510,8 +1510,8 @@ static int GL_RenderPresent(SDL_Renderer *renderer) static void GL_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GL_RenderData *renderdata = (GL_RenderData *)renderer->driverdata; - GL_TextureData *data = (GL_TextureData *)texture->driverdata; + GL_RenderData *renderdata = (GL_RenderData *)renderer->internal; + GL_TextureData *data = (GL_TextureData *)texture->internal; GL_ActivateRenderer(renderer); @@ -1545,12 +1545,12 @@ static void GL_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) #endif SDL_free(data->pixels); SDL_free(data); - texture->driverdata = NULL; + texture->internal = NULL; } static void GL_DestroyRenderer(SDL_Renderer *renderer) { - GL_RenderData *data = (GL_RenderData *)renderer->driverdata; + GL_RenderData *data = (GL_RenderData *)renderer->internal; if (data) { if (data->context) { @@ -1671,7 +1671,7 @@ static int GL_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Pro renderer->DestroyTexture = GL_DestroyTexture; renderer->DestroyRenderer = GL_DestroyRenderer; renderer->SetVSync = GL_SetVSync; - renderer->driverdata = data; + renderer->internal = data; GL_InvalidateCachedState(renderer); renderer->window = window; diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index b87626dc7a2d5..7d06c97dab358 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -213,7 +213,7 @@ static const char *GL_TranslateError(GLenum error) static void GL_ClearErrors(SDL_Renderer *renderer) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; if (!data->debug_enabled) { return; @@ -225,7 +225,7 @@ static void GL_ClearErrors(SDL_Renderer *renderer) static int GL_CheckAllErrors(const char *prefix, SDL_Renderer *renderer, const char *file, int line, const char *function) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; int ret = 0; if (!data->debug_enabled) { @@ -301,7 +301,7 @@ static GLES2_FBOList *GLES2_GetFBO(GLES2_RenderData *data, Uint32 w, Uint32 h) static int GLES2_ActivateRenderer(SDL_Renderer *renderer) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; if (SDL_GL_GetCurrentContext() != data->context) { /* Null out the current program to ensure we set it again */ @@ -319,7 +319,7 @@ static int GLES2_ActivateRenderer(SDL_Renderer *renderer) static void GLES2_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; if (event->type == SDL_EVENT_WINDOW_MINIMIZED) { /* According to Apple documentation, we need to finish drawing NOW! */ @@ -375,7 +375,7 @@ static GLenum GetBlendEquation(SDL_BlendOperation operation) static SDL_bool GLES2_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode); SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode); @@ -1032,7 +1032,7 @@ static int SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, co static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertices) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; GLES2_ImageSource sourceType = GLES2_IMAGESOURCE_TEXTURE_ABGR; SDL_Texture *texture = cmd->data.draw.texture; int ret; @@ -1156,7 +1156,7 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo ret = SetDrawState(data, cmd, sourceType, vertices); if (texture != data->drawstate.texture) { - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; #if SDL_HAVE_YUV if (tdata->yuv) { data->glActiveTexture(GL_TEXTURE2); @@ -1182,7 +1182,7 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo static void GLES2_InvalidateCachedState(SDL_Renderer *renderer) { - GLES2_DrawStateCache *cache = &((GLES2_RenderData *)renderer->driverdata)->drawstate; + GLES2_DrawStateCache *cache = &((GLES2_RenderData *)renderer->internal)->drawstate; cache->viewport_dirty = SDL_TRUE; cache->texture = NULL; cache->blend = SDL_BLENDMODE_INVALID; @@ -1197,7 +1197,7 @@ static void GLES2_InvalidateCachedState(SDL_Renderer *renderer) static int GLES2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; const SDL_bool colorswap = (renderer->target && (renderer->target->format == SDL_PIXELFORMAT_BGRA32 || renderer->target->format == SDL_PIXELFORMAT_BGRX32)); #if USE_VERTEX_BUFFER_OBJECTS @@ -1399,7 +1399,7 @@ static int GLES2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, static void GLES2_DestroyRenderer(SDL_Renderer *renderer) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; /* Deallocate everything */ if (data) { @@ -1449,7 +1449,7 @@ static void GLES2_DestroyRenderer(SDL_Renderer *renderer) static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->internal; GLES2_TextureData *data; GLenum format; GLenum type; @@ -1618,7 +1618,7 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL return -1; } } - texture->driverdata = data; + texture->internal = data; renderdata->glActiveTexture(GL_TEXTURE0); renderdata->glBindTexture(data->texture_type, data->texture); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode); @@ -1635,7 +1635,7 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL SDL_SetNumberProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_TARGET_NUMBER, data->texture_type); if (texture->access == SDL_TEXTUREACCESS_TARGET) { - data->fbo = GLES2_GetFBO((GLES2_RenderData *)renderer->driverdata, texture->w, texture->h); + data->fbo = GLES2_GetFBO((GLES2_RenderData *)renderer->internal, texture->w, texture->h); } else { data->fbo = NULL; } @@ -1681,8 +1681,8 @@ static int GLES2_TexSubImage2D(GLES2_RenderData *data, GLenum target, GLint xoff static int GLES2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; GLES2_ActivateRenderer(renderer); @@ -1762,8 +1762,8 @@ static int GLES2_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; GLES2_ActivateRenderer(renderer); @@ -1812,8 +1812,8 @@ static int GLES2_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; GLES2_ActivateRenderer(renderer); @@ -1851,7 +1851,7 @@ static int GLES2_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, static int GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; /* Retrieve the buffer/pitch for the specified region */ *pixels = (Uint8 *)tdata->pixel_data + @@ -1864,7 +1864,7 @@ static int GLES2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const static void GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; SDL_Rect rect; /* We do whole texture updates, at least for now */ @@ -1877,8 +1877,8 @@ static void GLES2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void GLES2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->driverdata; - GLES2_TextureData *data = (GLES2_TextureData *)texture->driverdata; + GLES2_RenderData *renderdata = (GLES2_RenderData *)renderer->internal; + GLES2_TextureData *data = (GLES2_TextureData *)texture->internal; GLenum glScaleMode = (scaleMode == SDL_SCALEMODE_NEAREST) ? GL_NEAREST : GL_LINEAR; #if SDL_HAVE_YUV @@ -1908,7 +1908,7 @@ static void GLES2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *textu static int GLES2_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; GLES2_TextureData *texturedata = NULL; GLenum status; @@ -1917,7 +1917,7 @@ static int GLES2_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) if (!texture) { data->glBindFramebuffer(GL_FRAMEBUFFER, data->window_framebuffer); } else { - texturedata = (GLES2_TextureData *)texture->driverdata; + texturedata = (GLES2_TextureData *)texture->internal; data->glBindFramebuffer(GL_FRAMEBUFFER, texturedata->fbo->FBO); /* TODO: check if texture pixel format allows this operation */ data->glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texturedata->texture_type, texturedata->texture, 0); @@ -1932,8 +1932,8 @@ static int GLES2_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) static void GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; - GLES2_TextureData *tdata = (GLES2_TextureData *)texture->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; + GLES2_TextureData *tdata = (GLES2_TextureData *)texture->internal; GLES2_ActivateRenderer(renderer); @@ -1959,13 +1959,13 @@ static void GLES2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) #endif SDL_free(tdata->pixel_data); SDL_free(tdata); - texture->driverdata = NULL; + texture->internal = NULL; } } static SDL_Surface *GLES2_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { - GLES2_RenderData *data = (GLES2_RenderData *)renderer->driverdata; + GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; SDL_PixelFormat format = renderer->target ? renderer->target->format : SDL_PIXELFORMAT_RGBA32; int w, h; SDL_Surface *surface; @@ -2091,7 +2091,7 @@ static int GLES2_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ if (!data) { goto error; } - renderer->driverdata = data; + renderer->internal = data; GLES2_InvalidateCachedState(renderer); renderer->window = window; diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c index bbb9e5739082e..7ebd70f86bf02 100644 --- a/src/render/ps2/SDL_render_ps2.c +++ b/src/render/ps2/SDL_render_ps2.c @@ -145,7 +145,7 @@ static int PS2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P return -1; } - texture->driverdata = ps2_tex; + texture->internal = ps2_tex; return 0; } @@ -153,7 +153,7 @@ static int PS2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P static int PS2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->internal; *pixels = (void *)((Uint8 *)ps2_texture->Mem + rect->y * ps2_texture->Width * SDL_BYTESPERPIXEL(texture->format) + @@ -164,8 +164,8 @@ static int PS2_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void PS2_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->internal; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; gsKit_TexManager_invalidate(data->gsGlobal, ps2_texture); } @@ -197,7 +197,7 @@ static int PS2_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void PS2_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->internal; /* set texture filtering according to scaleMode supported hint values are nearest (0, default) or linear (1) @@ -217,7 +217,7 @@ static int PS2_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) static int PS2_QueueSetViewport(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; const SDL_Rect *viewport = &cmd->data.viewport.rect; data->viewport = (SDL_Rect *)viewport; @@ -235,7 +235,7 @@ static int PS2_QueueNoOp(SDL_Renderer *renderer, SDL_RenderCommand *cmd) static int PS2_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; GSPRIMPOINT *vertices = (GSPRIMPOINT *)SDL_AllocateRenderVertices(renderer, count * sizeof(GSPRIMPOINT), 4, &cmd->data.draw.first); gs_rgbaq rgbaq; int i; @@ -262,7 +262,7 @@ static int PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL { int i; int count = indices ? num_indices : num_vertices; - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; const float color_scale = cmd->data.draw.color_scale; cmd->data.draw.count = count; @@ -270,7 +270,7 @@ static int PS2_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL if (texture) { GSPRIMUVPOINT *vertices = (GSPRIMUVPOINT *) SDL_AllocateRenderVertices(renderer, count * sizeof(GSPRIMUVPOINT), 4, &cmd->data.draw.first); - GSTEXTURE *ps2_tex = (GSTEXTURE *) texture->driverdata; + GSTEXTURE *ps2_tex = (GSTEXTURE *) texture->internal; if (!vertices) { return -1; @@ -343,7 +343,7 @@ static int PS2_RenderSetViewPort(SDL_Renderer *renderer, SDL_RenderCommand *cmd) static int PS2_RenderSetClipRect(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; SDL_Rect *viewport = data->viewport; const SDL_Rect *rect = &cmd->data.cliprect.rect; @@ -362,7 +362,7 @@ static int PS2_RenderSetClipRect(SDL_Renderer *renderer, SDL_RenderCommand *cmd) static int PS2_RenderSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; data->drawColor = float_GS_SETREG_RGBAQ(&cmd->data.color.color, cmd->data.color.color_scale); return 0; @@ -373,7 +373,7 @@ static int PS2_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) int offsetX, offsetY; SDL_Rect *viewport; - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; /* Clear the screen, so let's put default viewport */ gsKit_set_scissor(data->gsGlobal, GS_SCISSOR_RESET); @@ -449,14 +449,14 @@ static void PS2_SetBlendMode(PS2_RenderData *data, int blendMode) static int PS2_RenderGeometry(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; const size_t count = cmd->data.draw.count; PS2_SetBlendMode(data, cmd->data.draw.blend); if (cmd->data.draw.texture) { const GSPRIMUVPOINT *verts = (GSPRIMUVPOINT *) (vertices + cmd->data.draw.first); - GSTEXTURE *ps2_tex = (GSTEXTURE *)cmd->data.draw.texture->driverdata; + GSTEXTURE *ps2_tex = (GSTEXTURE *)cmd->data.draw.texture->internal; gsKit_TexManager_bind(data->gsGlobal, ps2_tex); gsKit_prim_list_triangle_goraud_texture_uv_3d(data->gsGlobal, ps2_tex, count, verts); @@ -470,7 +470,7 @@ static int PS2_RenderGeometry(SDL_Renderer *renderer, void *vertices, SDL_Render int PS2_RenderLines(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; const size_t count = cmd->data.draw.count; const GSPRIMPOINT *verts = (GSPRIMPOINT *)(vertices + cmd->data.draw.first); @@ -483,7 +483,7 @@ int PS2_RenderLines(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *c int PS2_RenderPoints(SDL_Renderer *renderer, void *vertices, SDL_RenderCommand *cmd) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; const size_t count = cmd->data.draw.count; const GSPRIMPOINT *verts = (GSPRIMPOINT *)(vertices + cmd->data.draw.first); @@ -555,7 +555,7 @@ static int PS2_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v static int PS2_RenderPresent(SDL_Renderer *renderer) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; if (data->gsGlobal->DoubleBuffering == GS_SETTING_OFF) { if (data->vsync == -1) { // Dynamic @@ -581,8 +581,8 @@ static int PS2_RenderPresent(SDL_Renderer *renderer) static void PS2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->driverdata; - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + GSTEXTURE *ps2_texture = (GSTEXTURE *)texture->internal; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; if (!data) { return; @@ -597,12 +597,12 @@ static void PS2_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) SDL_aligned_free(ps2_texture->Mem); SDL_free(ps2_texture); - texture->driverdata = NULL; + texture->internal = NULL; } static void PS2_DestroyRenderer(SDL_Renderer *renderer) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; if (data) { gsKit_clear(data->gsGlobal, GS_BLACK); @@ -620,7 +620,7 @@ static void PS2_DestroyRenderer(SDL_Renderer *renderer) static int PS2_SetVSync(SDL_Renderer *renderer, const int vsync) { - PS2_RenderData *data = (PS2_RenderData *)renderer->driverdata; + PS2_RenderData *data = (PS2_RenderData *)renderer->internal; switch (vsync) { case -1: case 0: @@ -709,7 +709,7 @@ static int PS2_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Pr renderer->DestroyTexture = PS2_DestroyTexture; renderer->DestroyRenderer = PS2_DestroyRenderer; renderer->SetVSync = PS2_SetVSync; - renderer->driverdata = data; + renderer->internal = data; PS2_InvalidateCachedState(renderer); renderer->window = window; diff --git a/src/render/psp/SDL_render_psp.c b/src/render/psp/SDL_render_psp.c index 48959d39eec4a..579c600cdee6c 100644 --- a/src/render/psp/SDL_render_psp.c +++ b/src/render/psp/SDL_render_psp.c @@ -483,7 +483,7 @@ static void PSP_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event static int PSP_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - PSP_RenderData *data = renderer->driverdata; + PSP_RenderData *data = renderer->internal; PSP_TextureData *psp_texture = (PSP_TextureData *)SDL_calloc(1, sizeof(*psp_texture)); if (!psp_texture) { @@ -516,7 +516,7 @@ static int PSP_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P psp_texture->pitch = psp_texture->textureWidth * SDL_BYTESPERPIXEL(texture->format); psp_texture->size = psp_texture->textureHeight * psp_texture->pitch; if (texture->access & SDL_TEXTUREACCESS_TARGET) { - if (TextureSpillTargetsForSpace(renderer->driverdata, psp_texture->size) < 0) { + if (TextureSpillTargetsForSpace(renderer->internal, psp_texture->size) < 0) { SDL_free(psp_texture); return -1; } @@ -532,7 +532,7 @@ static int PSP_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_P SDL_free(psp_texture); return -1; } - texture->driverdata = psp_texture; + texture->internal = psp_texture; return 0; } @@ -544,7 +544,7 @@ static int TextureShouldSwizzle(PSP_TextureData *psp_texture, SDL_Texture *textu static void TextureActivate(SDL_Texture *texture) { - PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->internal; int scaleMode = (texture->scaleMode == SDL_SCALEMODE_NEAREST) ? GU_NEAREST : GU_LINEAR; /* Swizzling is useless with small textures. */ @@ -565,7 +565,7 @@ static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static int PSP_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { - /* PSP_TextureData *psp_texture = (PSP_TextureData *) texture->driverdata; */ + /* PSP_TextureData *psp_texture = (PSP_TextureData *) texture->internal; */ const Uint8 *src; Uint8 *dst; int row, length, dpitch; @@ -590,7 +590,7 @@ static int PSP_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->internal; *pixels = (void *)((Uint8 *)psp_texture->data + rect->y * psp_texture->pitch + @@ -601,7 +601,7 @@ static int PSP_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void PSP_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->internal; SDL_Rect rect; /* We do whole texture updates, at least for now */ @@ -695,7 +695,7 @@ static int PSP_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL verts++; } } else { - PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->internal; VertTCV *verts; verts = (VertTCV *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertTCV), 4, &cmd->data.draw.first); if (!verts) { @@ -951,7 +951,7 @@ static void ResetBlendState(PSP_BlendState *state) static void StartDrawing(SDL_Renderer *renderer) { - PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->internal; // Check if we need to start GU displaylist if (!data->displayListAvail) { @@ -964,7 +964,7 @@ static void StartDrawing(SDL_Renderer *renderer) if (renderer->target != data->boundTarget) { SDL_Texture *texture = renderer->target; if (texture) { - PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->internal; // Set target, registering LRU TextureBindAsTarget(data, psp_texture); } else { @@ -1048,7 +1048,7 @@ static void PSP_InvalidateCachedState(SDL_Renderer *renderer) static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->internal; Uint8 *gpumem = NULL; PSP_DrawStateCache drawstate; @@ -1224,7 +1224,7 @@ static int PSP_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, v static int PSP_RenderPresent(SDL_Renderer *renderer) { - PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->internal; if (!data->displayListAvail) { return -1; } @@ -1246,8 +1246,8 @@ static int PSP_RenderPresent(SDL_Renderer *renderer) static void PSP_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - PSP_RenderData *renderdata = (PSP_RenderData *)renderer->driverdata; - PSP_TextureData *psp_texture = (PSP_TextureData *)texture->driverdata; + PSP_RenderData *renderdata = (PSP_RenderData *)renderer->internal; + PSP_TextureData *psp_texture = (PSP_TextureData *)texture->internal; if (!renderdata) { return; @@ -1260,12 +1260,12 @@ static void PSP_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) LRUTargetRemove(renderdata, psp_texture); TextureStorageFree(psp_texture->data); SDL_free(psp_texture); - texture->driverdata = NULL; + texture->internal = NULL; } static void PSP_DestroyRenderer(SDL_Renderer *renderer) { - PSP_RenderData *data = (PSP_RenderData *)renderer->driverdata; + PSP_RenderData *data = (PSP_RenderData *)renderer->internal; if (data) { if (!data->initialized) { return; @@ -1287,7 +1287,7 @@ static void PSP_DestroyRenderer(SDL_Renderer *renderer) static int PSP_SetVSync(SDL_Renderer *renderer, const int vsync) { - PSP_RenderData *data = renderer->driverdata; + PSP_RenderData *data = renderer->internal; data->vsync = vsync; return 0; } @@ -1330,7 +1330,7 @@ static int PSP_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_Pr renderer->DestroyTexture = PSP_DestroyTexture; renderer->DestroyRenderer = PSP_DestroyRenderer; renderer->SetVSync = PSP_SetVSync; - renderer->driverdata = data; + renderer->internal = data; PSP_InvalidateCachedState(renderer); renderer->window = window; diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index cf28b57de4bab..4e462e75dbd0f 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -53,7 +53,7 @@ typedef struct static SDL_Surface *SW_ActivateRenderer(SDL_Renderer *renderer) { - SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->internal; if (!data->surface) { data->surface = data->window; @@ -69,7 +69,7 @@ static SDL_Surface *SW_ActivateRenderer(SDL_Renderer *renderer) static void SW_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->internal; if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { data->surface = NULL; @@ -79,7 +79,7 @@ static void SW_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) static int SW_GetOutputSize(SDL_Renderer *renderer, int *w, int *h) { - SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->internal; if (data->surface) { if (w) { @@ -107,7 +107,7 @@ static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr if (!SDL_SurfaceValid(surface)) { return SDL_SetError("Cannot create surface"); } - texture->driverdata = surface; + texture->internal = surface; r = (Uint8)SDL_roundf(SDL_clamp(texture->color.r, 0.0f, 1.0f) * 255.0f); g = (Uint8)SDL_roundf(SDL_clamp(texture->color.g, 0.0f, 1.0f) * 255.0f); b = (Uint8)SDL_roundf(SDL_clamp(texture->color.b, 0.0f, 1.0f) * 255.0f); @@ -129,7 +129,7 @@ static int SW_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { - SDL_Surface *surface = (SDL_Surface *)texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->internal; Uint8 *src, *dst; int row; size_t length; @@ -156,7 +156,7 @@ static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, static int SW_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - SDL_Surface *surface = (SDL_Surface *)texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->internal; *pixels = (void *)((Uint8 *)surface->pixels + rect->y * surface->pitch + @@ -175,10 +175,10 @@ static void SW_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, static int SW_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->internal; if (texture) { - data->surface = (SDL_Surface *)texture->driverdata; + data->surface = (SDL_Surface *)texture->internal; } else { data->surface = data->window; } @@ -317,7 +317,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex const SDL_Rect *srcrect, const SDL_Rect *final_rect, const double angle, const SDL_FPoint *center, const SDL_FlipMode flip, float scale_x, float scale_y) { - SDL_Surface *src = (SDL_Surface *)texture->driverdata; + SDL_Surface *src = (SDL_Surface *)texture->internal; SDL_Rect tmp_rect; SDL_Surface *src_clone, *src_rotated, *src_scaled; SDL_Surface *mask = NULL, *mask_rotated = NULL; @@ -624,7 +624,7 @@ static void PrepTextureForCopy(const SDL_RenderCommand *cmd, SW_DrawStateCache * const Uint8 a = drawstate->color.a; const SDL_BlendMode blend = cmd->data.draw.blend; SDL_Texture *texture = cmd->data.draw.texture; - SDL_Surface *surface = (SDL_Surface *)texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->internal; const SDL_bool colormod = ((r & g & b) != 0xFF); const SDL_bool alphamod = (a != 0xFF); const SDL_bool blending = ((blend == SDL_BLENDMODE_ADD) || (blend == SDL_BLENDMODE_MOD) || (blend == SDL_BLENDMODE_MUL)); @@ -812,7 +812,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo const SDL_Rect *srcrect = verts; SDL_Rect *dstrect = verts + 1; SDL_Texture *texture = cmd->data.draw.texture; - SDL_Surface *src = (SDL_Surface *)texture->driverdata; + SDL_Surface *src = (SDL_Surface *)texture->internal; SetDrawState(surface, &drawstate); @@ -900,7 +900,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo SetDrawState(surface, &drawstate); if (texture) { - SDL_Surface *src = (SDL_Surface *)texture->driverdata; + SDL_Surface *src = (SDL_Surface *)texture->internal; GeometryCopyData *ptr = (GeometryCopyData *)verts; @@ -996,7 +996,7 @@ static int SW_RenderPresent(SDL_Renderer *renderer) static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - SDL_Surface *surface = (SDL_Surface *)texture->driverdata; + SDL_Surface *surface = (SDL_Surface *)texture->internal; SDL_DestroySurface(surface); } @@ -1004,7 +1004,7 @@ static void SW_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void SW_DestroyRenderer(SDL_Renderer *renderer) { SDL_Window *window = renderer->window; - SW_RenderData *data = (SW_RenderData *)renderer->driverdata; + SW_RenderData *data = (SW_RenderData *)renderer->internal; if (window) { SDL_DestroyWindowSurface(window); @@ -1147,7 +1147,7 @@ int SW_CreateRendererForSurface(SDL_Renderer *renderer, SDL_Surface *surface, SD renderer->RenderPresent = SW_RenderPresent; renderer->DestroyTexture = SW_DestroyTexture; renderer->DestroyRenderer = SW_DestroyRenderer; - renderer->driverdata = data; + renderer->internal = data; SW_InvalidateCachedState(renderer); renderer->name = SW_RenderDriver.name; diff --git a/src/render/vitagxm/SDL_render_vita_gxm.c b/src/render/vitagxm/SDL_render_vita_gxm.c index 457e6237e5a97..440e05ea359ef 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm.c +++ b/src/render/vitagxm/SDL_render_vita_gxm.c @@ -134,7 +134,7 @@ static int PixelFormatToVITAFMT(Uint32 format) void StartDrawing(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; if (data->drawing) { return; } @@ -162,7 +162,7 @@ void StartDrawing(SDL_Renderer *renderer) &data->displaySurface[data->backBufferIndex], &data->depthSurface); } else { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)renderer->target->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)renderer->target->internal; sceGxmBeginScene( data->gxm_context, @@ -182,7 +182,7 @@ void StartDrawing(SDL_Renderer *renderer) static int VITA_GXM_SetVSync(SDL_Renderer *renderer, const int vsync) { - VITA_GXM_RenderData *data = renderer->driverdata; + VITA_GXM_RenderData *data = renderer->internal; if (vsync) { data->displayData.wait_vblank = SDL_TRUE; } else { @@ -231,7 +231,7 @@ static int VITA_GXM_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, S renderer->DestroyRenderer = VITA_GXM_DestroyRenderer; renderer->SetVSync = VITA_GXM_SetVSync; - renderer->driverdata = data; + renderer->internal = data; VITA_GXM_InvalidateCachedState(renderer); renderer->window = window; @@ -273,7 +273,7 @@ static SDL_bool VITA_GXM_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode static int VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)SDL_calloc(1, sizeof(VITA_GXM_TextureData)); if (!vita_texture) { @@ -296,7 +296,7 @@ static int VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, return SDL_OutOfMemory(); } - texture->driverdata = vita_texture; + texture->internal = vita_texture; VITA_GXM_SetTextureScaleMode(renderer, texture, texture->scaleMode); @@ -310,7 +310,7 @@ static int VITA_GXM_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void VITA_GXM_SetYUVProfile(SDL_Renderer *renderer, SDL_Texture *texture) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; int ret = 0; if (SDL_ISCOLORSPACE_MATRIX_BT601(texture->colorspace)) { if (SDL_ISCOLORSPACE_LIMITED_RANGE(texture->colorspace)) { @@ -336,7 +336,7 @@ static void VITA_GXM_SetYUVProfile(SDL_Renderer *renderer, SDL_Texture *texture) static int VITA_GXM_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; Uint8 *dst; int row, length, dpitch; @@ -457,7 +457,7 @@ static int VITA_GXM_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *textur { void *Udst; void *Vdst; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; int uv_pitch = (dpitch + 1) / 2; // skip Y plane @@ -529,7 +529,7 @@ static int VITA_GXM_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture // UV plane { void *UVdst; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; int uv_pitch = 2 * ((dpitch + 1) / 2); // skip Y plane @@ -559,8 +559,8 @@ static int VITA_GXM_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture static int VITA_GXM_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; *pixels = (void *)((Uint8 *)gxm_texture_get_datap(vita_texture->tex) + (rect->y * vita_texture->pitch) + rect->x * SDL_BYTESPERPIXEL(texture->format)); @@ -583,7 +583,7 @@ static void VITA_GXM_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void VITA_GXM_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; /* set texture filtering according to scaleMode @@ -640,7 +640,7 @@ static int VITA_GXM_QueueNoOp(SDL_Renderer *renderer, SDL_RenderCommand *cmd) static int VITA_GXM_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; data->drawstate.color.r = cmd->data.color.color.r * cmd->data.color.color_scale; data->drawstate.color.g = cmd->data.color.color.g * cmd->data.color.color_scale; @@ -652,7 +652,7 @@ static int VITA_GXM_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand static int VITA_GXM_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; SDL_FColor color = data->drawstate.color; @@ -674,7 +674,7 @@ static int VITA_GXM_QueueDrawPoints(SDL_Renderer *renderer, SDL_RenderCommand *c static int VITA_GXM_QueueDrawLines(SDL_Renderer *renderer, SDL_RenderCommand *cmd, const SDL_FPoint *points, int count) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; SDL_FColor color = data->drawstate.color; color_vertex *vertex = (color_vertex *)pool_malloc( @@ -702,7 +702,7 @@ static int VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd int num_vertices, const void *indices, int num_indices, int size_indices, float scale_x, float scale_y) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; int i; int count = indices ? num_indices : num_vertices; const float color_scale = cmd->data.draw.color_scale; @@ -711,7 +711,7 @@ static int VITA_GXM_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd size_indices = indices ? size_indices : 0; if (texture) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; texture_vertex *vertices; vertices = (texture_vertex *)pool_malloc( @@ -801,7 +801,7 @@ static int VITA_GXM_RenderClear(SDL_Renderer *renderer, SDL_RenderCommand *cmd) void *color_buffer; SDL_FColor color; - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; unset_clip_rectangle(data); // set clear shaders @@ -910,7 +910,7 @@ static int SetDrawState(VITA_GXM_RenderData *data, const SDL_RenderCommand *cmd) if (texture != data->drawstate.texture) { if (texture) { - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)cmd->data.draw.texture->driverdata; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)cmd->data.draw.texture->internal; sceGxmSetFragmentTexture(data->gxm_context, 0, &vita_texture->tex->gxm_tex); } data->drawstate.texture = texture; @@ -929,7 +929,7 @@ static void VITA_GXM_InvalidateCachedState(SDL_Renderer *renderer) static int VITA_GXM_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; StartDrawing(renderer); data->drawstate.target = renderer->target; @@ -1123,7 +1123,7 @@ static SDL_Surface *VITA_GXM_RenderReadPixels(SDL_Renderer *renderer, const SDL_ static int VITA_GXM_RenderPresent(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; SceCommonDialogUpdateParam updateParam; data->displayData.address = data->displayBufferData[data->backBufferIndex]; @@ -1165,8 +1165,8 @@ static int VITA_GXM_RenderPresent(SDL_Renderer *renderer) static void VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; - VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; + VITA_GXM_TextureData *vita_texture = (VITA_GXM_TextureData *)texture->internal; if (!data) { return; @@ -1186,12 +1186,12 @@ static void VITA_GXM_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture SDL_free(vita_texture); - texture->driverdata = NULL; + texture->internal = NULL; } static void VITA_GXM_DestroyRenderer(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; if (data) { if (!data->initialized) { return; diff --git a/src/render/vitagxm/SDL_render_vita_gxm_tools.c b/src/render/vitagxm/SDL_render_vita_gxm_tools.c index 1bcfd2f48c77e..4fe1621ace4e0 100644 --- a/src/render/vitagxm/SDL_render_vita_gxm_tools.c +++ b/src/render/vitagxm/SDL_render_vita_gxm_tools.c @@ -374,7 +374,7 @@ int gxm_init(SDL_Renderer *renderer) .colorMask = SCE_GXM_COLOR_MASK_ALL }; - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; SceGxmInitializeParams initializeParams; SDL_memset(&initializeParams, 0, sizeof(SceGxmInitializeParams)); @@ -858,7 +858,7 @@ int gxm_init(SDL_Renderer *renderer) void gxm_finish(SDL_Renderer *renderer) { - VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->driverdata; + VITA_GXM_RenderData *data = (VITA_GXM_RenderData *)renderer->internal; // wait until rendering is done sceGxmFinish(data->gxm_context); diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 264e16c0d07eb..f808a8a92383a 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -459,7 +459,7 @@ static void VULKAN_DestroyAll(SDL_Renderer *renderer) if (renderer == NULL) { return; } - rendererData = (VULKAN_RenderData *)renderer->driverdata; + rendererData = (VULKAN_RenderData *)renderer->internal; if (rendererData == NULL) { return; } @@ -858,7 +858,7 @@ static void VULKAN_RecordPipelineImageBarrier(VULKAN_RenderData *rendererData, V static VkResult VULKAN_AcquireNextSwapchainImage(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = ( VULKAN_RenderData * )renderer->driverdata; + VULKAN_RenderData *rendererData = ( VULKAN_RenderData * )renderer->internal; VkResult result; @@ -956,7 +956,7 @@ static void VULKAN_EnsureCommandBuffer(VULKAN_RenderData *rendererData) static SDL_bool VULKAN_ActivateCommandBuffer(SDL_Renderer *renderer, VkAttachmentLoadOp loadOp, VkClearColorValue *clearColor, VULKAN_DrawStateCache *stateCache) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VULKAN_EnsureCommandBuffer(rendererData); @@ -1061,7 +1061,7 @@ static VkResult VULKAN_IssueBatch(VULKAN_RenderData *rendererData) static void VULKAN_DestroyRenderer(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; if (rendererData) { if (rendererData->device != VK_NULL_HANDLE) { vkDeviceWaitIdle(rendererData->device); @@ -1121,7 +1121,7 @@ static VkBlendOp GetBlendOp(SDL_BlendOperation operation) static VULKAN_PipelineState *VULKAN_CreatePipelineState(SDL_Renderer *renderer, VULKAN_Shader shader, VkPipelineLayout pipelineLayout, VkDescriptorSetLayout descriptorSetLayout, SDL_BlendMode blendMode, VkPrimitiveTopology topology, VkFormat format) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VULKAN_PipelineState *pipelineStates; VkPipeline pipeline = VK_NULL_HANDLE; VkResult result = VK_SUCCESS; @@ -1675,7 +1675,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert VK_KHR_BIND_MEMORY_2_EXTENSION_NAME, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME, }; - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; SDL_VideoDevice *device = SDL_GetVideoDevice(); VkResult result = VK_SUCCESS; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL; @@ -1949,7 +1949,7 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert static VkResult VULKAN_CreateFramebuffersAndRenderPasses(SDL_Renderer *renderer, int w, int h, VkFormat format, int imageViewCount, VkImageView *imageViews, VkFramebuffer *framebuffers, VkRenderPass renderPasses[SDL_VULKAN_NUM_RENDERPASSES]) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *) renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *) renderer->internal; VkResult result; VkAttachmentDescription attachmentDescription = { 0 }; @@ -2034,7 +2034,7 @@ static VkResult VULKAN_CreateFramebuffersAndRenderPasses(SDL_Renderer *renderer, static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VkResult result = vkGetPhysicalDeviceSurfaceCapabilitiesKHR(rendererData->physicalDevice, rendererData->surface, &rendererData->surfaceCapabilities); if (result != VK_SUCCESS) { SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR(): %s\n", SDL_Vulkan_GetResultString(result)); @@ -2419,7 +2419,7 @@ static VkResult VULKAN_CreateSwapChain(SDL_Renderer *renderer, int w, int h) /* Initialize all resources that change when the window's size changes. */ static VkResult VULKAN_CreateWindowSizeDependentResources(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VkResult result = VK_SUCCESS; int w, h; @@ -2445,7 +2445,7 @@ static VkResult VULKAN_CreateWindowSizeDependentResources(SDL_Renderer *renderer /* This method is called when the window's size changes. */ static VkResult VULKAN_UpdateForWindowSizeChange(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; /* If the GPU has previous work, wait for it to be done first */ VULKAN_WaitForGPU(rendererData); @@ -2454,7 +2454,7 @@ static VkResult VULKAN_UpdateForWindowSizeChange(SDL_Renderer *renderer) static void VULKAN_WindowEvent(SDL_Renderer *renderer, const SDL_WindowEvent *event) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; if (event->type == SDL_EVENT_WINDOW_PIXEL_SIZE_CHANGED) { rendererData->recreateSwapchain = SDL_TRUE; @@ -2483,7 +2483,7 @@ static SDL_bool VULKAN_SupportsBlendMode(SDL_Renderer *renderer, SDL_BlendMode b static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_PropertiesID create_props) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VULKAN_TextureData *textureData; VkResult result; VkFormat textureFormat = SDLPixelFormatToVkTextureFormat(texture->format, renderer->output_colorspace); @@ -2498,7 +2498,7 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD if (!textureData) { return -1; } - texture->driverdata = textureData; + texture->internal = textureData; if (SDL_COLORSPACETRANSFER(texture->colorspace) == SDL_TRANSFER_CHARACTERISTICS_SRGB) { textureData->shader = SHADER_RGB; } else { @@ -2665,8 +2665,8 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD static void VULKAN_DestroyTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; if (!textureData) { return; @@ -2711,7 +2711,7 @@ static void VULKAN_DestroyTexture(SDL_Renderer *renderer, } SDL_free(textureData); - texture->driverdata = NULL; + texture->internal = NULL; } static VkResult VULKAN_UpdateTextureInternal(VULKAN_RenderData *rendererData, VkImage image, VkFormat format, int plane, int x, int y, int w, int h, const void *pixels, int pitch, VkImageLayout *imageLayout) @@ -2811,8 +2811,8 @@ static int VULKAN_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *srcPixels, int srcPitch) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2860,8 +2860,8 @@ static int VULKAN_UpdateTextureYUV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2884,8 +2884,8 @@ static int VULKAN_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, const Uint8 *Yplane, int Ypitch, const Uint8 *UVplane, int UVpitch) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2905,8 +2905,8 @@ static int VULKAN_UpdateTextureNV(SDL_Renderer *renderer, SDL_Texture *texture, static int VULKAN_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; VkResult result; if (!textureData) { return SDL_SetError("Texture is not currently available"); @@ -2946,8 +2946,8 @@ static int VULKAN_LockTexture(SDL_Renderer *renderer, SDL_Texture *texture, static void VULKAN_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; if (!textureData) { return; @@ -2999,7 +2999,7 @@ static void VULKAN_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void VULKAN_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; if (!textureData) { return; @@ -3010,7 +3010,7 @@ static void VULKAN_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *text static int VULKAN_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VULKAN_TextureData *textureData = NULL; VULKAN_EnsureCommandBuffer(rendererData); @@ -3031,7 +3031,7 @@ static int VULKAN_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) return 0; } - textureData = (VULKAN_TextureData *)texture->driverdata; + textureData = (VULKAN_TextureData *)texture->internal; if (textureData->mainImage.imageView == VK_NULL_HANDLE) { return SDL_SetError("specified texture is not a render target"); @@ -3089,7 +3089,7 @@ static int VULKAN_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, int count = indices ? num_indices : num_vertices; VertexPositionColor *verts = (VertexPositionColor *)SDL_AllocateRenderVertices(renderer, count * sizeof(VertexPositionColor), 0, &cmd->data.draw.first); SDL_bool convert_color = SDL_RenderingLinearSpace(renderer); - VULKAN_TextureData *textureData = texture ? (VULKAN_TextureData *)texture->driverdata : NULL; + VULKAN_TextureData *textureData = texture ? (VULKAN_TextureData *)texture->internal : NULL; float u_scale = textureData ? (float)texture->w / textureData->width : 0.0f; float v_scale = textureData ? (float)texture->h / textureData->height : 0.0f; @@ -3139,7 +3139,7 @@ static int VULKAN_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, static SDL_bool VULKAN_UpdateVertexBuffer(SDL_Renderer *renderer, const void *vertexData, size_t dataSizeInBytes, VULKAN_DrawStateCache *stateCache) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; const int vbidx = rendererData->currentVertexBuffer; VULKAN_Buffer *vertexBuffer; @@ -3176,7 +3176,7 @@ static SDL_bool VULKAN_UpdateVertexBuffer(SDL_Renderer *renderer, static int VULKAN_UpdateViewport(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; const SDL_Rect *viewport = &rendererData->currentViewport; Float4X4 projection; Float4X4 view; @@ -3220,7 +3220,7 @@ static int VULKAN_UpdateViewport(SDL_Renderer *renderer) static int VULKAN_UpdateClipRect(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; const SDL_Rect *viewport = &rendererData->currentViewport; VkRect2D scissor; @@ -3372,7 +3372,7 @@ static VkResult VULKAN_CreateDescriptorSetAndPipelineLayout(VULKAN_RenderData *r static VkDescriptorSet VULKAN_AllocateDescriptorSet(SDL_Renderer *renderer, VULKAN_Shader shader, VkDescriptorSetLayout descriptorSetLayout, VkSampler sampler, VkBuffer constantBuffer, VkDeviceSize constantBufferOffset, VkImageView imageView) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; uint32_t currentDescriptorPoolIndex = rendererData->currentDescriptorPoolIndex; VkDescriptorPool descriptorPool = rendererData->descriptorPools[rendererData->currentCommandBufferIndex][currentDescriptorPoolIndex]; @@ -3468,7 +3468,7 @@ static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderComm const PixelShaderConstants *shader_constants, VkPrimitiveTopology topology, VkImageView imageView, VkSampler sampler, const Float4X4 *matrix, VULKAN_DrawStateCache *stateCache) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; const SDL_BlendMode blendMode = cmd->data.draw.blend; VkFormat format = rendererData->surfaceFormat.format; const Float4X4 *newmatrix = matrix ? matrix : &rendererData->identity; @@ -3616,8 +3616,8 @@ static SDL_bool VULKAN_SetDrawState(SDL_Renderer *renderer, const SDL_RenderComm static SDL_bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const Float4X4 *matrix, VULKAN_DrawStateCache *stateCache) { SDL_Texture *texture = cmd->data.draw.texture; - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; - VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; + VULKAN_TextureData *textureData = (VULKAN_TextureData *)texture->internal; VkSampler textureSampler = VK_NULL_HANDLE; PixelShaderConstants constants; VkDescriptorSetLayout descriptorSetLayout = (textureData->descriptorSetLayoutYcbcr != VK_NULL_HANDLE) ? textureData->descriptorSetLayoutYcbcr : rendererData->descriptorSetLayout; @@ -3663,20 +3663,20 @@ static SDL_bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderComm static void VULKAN_DrawPrimitives(SDL_Renderer *renderer, VkPrimitiveTopology primitiveTopology, const size_t vertexStart, const size_t vertexCount) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; vkCmdDraw(rendererData->currentCommandBuffer, (uint32_t)vertexCount, 1, (uint32_t)vertexStart, 0); } static void VULKAN_InvalidateCachedState(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; rendererData->currentPipelineState = NULL; rendererData->cliprectDirty = SDL_TRUE; } static int VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VULKAN_DrawStateCache stateCache; SDL_memset(&stateCache, 0, sizeof(stateCache)); @@ -3805,7 +3805,7 @@ static int VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd static SDL_Surface* VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VkImage backBuffer; VkImageLayout *imageLayout; VULKAN_Buffer readbackBuffer; @@ -3901,7 +3901,7 @@ static SDL_Surface* VULKAN_RenderReadPixels(SDL_Renderer *renderer, const SDL_Re static int VULKAN_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; if (wait_semaphore) { if (rendererData->waitRenderSemaphoreCount == rendererData->waitRenderSemaphoreMax) { @@ -3943,7 +3943,7 @@ static int VULKAN_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_ static int VULKAN_RenderPresent(SDL_Renderer *renderer) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; VkResult result = VK_SUCCESS; if (rendererData->currentCommandBuffer) { @@ -4035,7 +4035,7 @@ static int VULKAN_RenderPresent(SDL_Renderer *renderer) static int VULKAN_SetVSync(SDL_Renderer *renderer, const int vsync) { - VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->driverdata; + VULKAN_RenderData *rendererData = (VULKAN_RenderData *)renderer->internal; switch (vsync) { case -1: @@ -4101,7 +4101,7 @@ static int VULKAN_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL renderer->DestroyTexture = VULKAN_DestroyTexture; renderer->DestroyRenderer = VULKAN_DestroyRenderer; renderer->SetVSync = VULKAN_SetVSync; - renderer->driverdata = rendererData; + renderer->internal = rendererData; VULKAN_InvalidateCachedState(renderer); renderer->name = VULKAN_RenderDriver.name; diff --git a/src/video/SDL_egl_c.h b/src/video/SDL_egl_c.h index 6a987b78a6fdc..7477553b20b91 100644 --- a/src/video/SDL_egl_c.h +++ b/src/video/SDL_egl_c.h @@ -150,19 +150,19 @@ extern int SDL_EGL_SetErrorEx(const char *message, const char *eglFunctionName, #define SDL_EGL_SwapWindow_impl(BACKEND) \ int BACKEND##_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) \ { \ - return SDL_EGL_SwapBuffers(_this, window->driverdata->egl_surface); \ + return SDL_EGL_SwapBuffers(_this, window->internal->egl_surface); \ } #define SDL_EGL_MakeCurrent_impl(BACKEND) \ int BACKEND##_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) \ { \ - return SDL_EGL_MakeCurrent(_this, window ? window->driverdata->egl_surface : EGL_NO_SURFACE, context); \ + return SDL_EGL_MakeCurrent(_this, window ? window->internal->egl_surface : EGL_NO_SURFACE, context); \ } #define SDL_EGL_CreateContext_impl(BACKEND) \ SDL_GLContext BACKEND##_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) \ { \ - return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); \ + return SDL_EGL_CreateContext(_this, window->internal->egl_surface); \ } #endif /* SDL_VIDEO_OPENGL_EGL */ diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 4a3d039084048..30a69e45a0114 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -112,7 +112,7 @@ struct SDL_Window SDL_PropertiesID props; - SDL_WindowData *driverdata; + SDL_WindowData *internal; SDL_Window *prev; SDL_Window *next; @@ -154,7 +154,7 @@ struct SDL_VideoDisplay SDL_PropertiesID props; - SDL_DisplayData *driverdata; + SDL_DisplayData *internal; }; /* Video device flags */ @@ -456,7 +456,7 @@ struct SDL_VideoDevice /* * * */ /* Data private to this driver */ - SDL_VideoData *driverdata; + SDL_VideoData *internal; struct SDL_GLDriverData *gl_data; #ifdef SDL_VIDEO_OPENGL_EGL diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 25e8b97597392..f02a036a643c1 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -836,10 +836,10 @@ void SDL_DelVideoDisplay(SDL_DisplayID displayID, SDL_bool send_event) SDL_DestroyProperties(display->props); SDL_free(display->name); SDL_ResetFullscreenDisplayModes(display); - SDL_free(display->desktop_mode.driverdata); - display->desktop_mode.driverdata = NULL; - SDL_free(display->driverdata); - display->driverdata = NULL; + SDL_free(display->desktop_mode.internal); + display->desktop_mode.internal = NULL; + SDL_free(display->internal); + display->internal = NULL; SDL_free(display); if (display_index < (_this->num_displays - 1)) { @@ -929,7 +929,7 @@ SDL_DisplayData *SDL_GetDisplayDriverData(SDL_DisplayID displayID) CHECK_DISPLAY_MAGIC(display, NULL); - return display->driverdata; + return display->internal; } SDL_DisplayData *SDL_GetDisplayDriverDataForWindow(SDL_Window *window) @@ -1213,8 +1213,8 @@ void SDL_ResetFullscreenDisplayModes(SDL_VideoDisplay *display) int i; for (i = display->num_fullscreen_modes; i--;) { - SDL_free(display->fullscreen_modes[i].driverdata); - display->fullscreen_modes[i].driverdata = NULL; + SDL_free(display->fullscreen_modes[i].internal); + display->fullscreen_modes[i].internal = NULL; } SDL_free(display->fullscreen_modes); display->fullscreen_modes = NULL; @@ -1332,8 +1332,8 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode SDL_copyp(&last_mode, &display->desktop_mode); - if (display->desktop_mode.driverdata) { - SDL_free(display->desktop_mode.driverdata); + if (display->desktop_mode.internal) { + SDL_free(display->desktop_mode.internal); } SDL_copyp(&display->desktop_mode, mode); display->desktop_mode.displayID = display->id; diff --git a/src/video/android/SDL_androidevents.c b/src/video/android/SDL_androidevents.c index 74a28da330e0e..75313297ca474 100644 --- a/src/video/android/SDL_androidevents.c +++ b/src/video/android/SDL_androidevents.c @@ -44,7 +44,7 @@ static void android_egl_context_restore(SDL_Window *window) { if (window) { SDL_Event event; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_GL_MakeCurrent(window, NULL); if (SDL_GL_MakeCurrent(window, (SDL_GLContext)data->egl_context) < 0) { /* The context is no longer valid, create a new one */ @@ -68,7 +68,7 @@ static void android_egl_context_backup(SDL_Window *window) if (window) { int interval = 0; /* Keep a copy of the EGL Context so we can try to restore it when we resume */ - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; data->egl_context = SDL_GL_GetCurrentContext(); /* Save/Restore the swap interval / vsync */ @@ -93,7 +93,7 @@ static void android_egl_context_backup(SDL_Window *window) void Android_PumpEvents_Blocking(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; if (videodata->isPaused) { #ifdef SDL_VIDEO_OPENGL_EGL @@ -162,7 +162,7 @@ void Android_PumpEvents_Blocking(SDL_VideoDevice *_this) void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; static int backup_context = 0; if (videodata->isPaused) { diff --git a/src/video/android/SDL_androidgl.c b/src/video/android/SDL_androidgl.c index f3b40c7841390..68c5a5b96f96f 100644 --- a/src/video/android/SDL_androidgl.c +++ b/src/video/android/SDL_androidgl.c @@ -38,7 +38,7 @@ int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (window && context) { - return SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context); + return SDL_EGL_MakeCurrent(_this, window->internal->egl_surface, context); } else { return SDL_EGL_MakeCurrent(_this, NULL, NULL); } @@ -50,7 +50,7 @@ SDL_GLContext Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *win Android_ActivityMutex_Lock_Running(); - ret = SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); + ret = SDL_EGL_CreateContext(_this, window->internal->egl_surface); SDL_UnlockMutex(Android_ActivityMutex); @@ -70,7 +70,7 @@ int Android_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) /*_this->egl_data->eglWaitNative(EGL_CORE_NATIVE_ENGINE); _this->egl_data->eglWaitGL();*/ - retval = SDL_EGL_SwapBuffers(_this, window->driverdata->egl_surface); + retval = SDL_EGL_SwapBuffers(_this, window->internal->egl_surface); SDL_UnlockMutex(Android_ActivityMutex); diff --git a/src/video/android/SDL_androidmouse.c b/src/video/android/SDL_androidmouse.c index afee511d40374..b05dc58e6d9cc 100644 --- a/src/video/android/SDL_androidmouse.c +++ b/src/video/android/SDL_androidmouse.c @@ -64,7 +64,7 @@ static SDL_Cursor *Android_WrapCursor(int custom_cursor, int system_cursor) if (data) { data->custom_cursor = custom_cursor; data->system_cursor = system_cursor; - cursor->driverdata = data; + cursor->internal = data; } else { SDL_free(cursor); cursor = NULL; @@ -104,11 +104,11 @@ static SDL_Cursor *Android_CreateSystemCursor(SDL_SystemCursor id) static void Android_FreeCursor(SDL_Cursor *cursor) { - SDL_AndroidCursorData *data = (SDL_AndroidCursorData *)cursor->driverdata; + SDL_AndroidCursorData *data = (SDL_AndroidCursorData *)cursor->internal; if (data->custom_cursor != 0) { Android_JNI_DestroyCustomCursor(data->custom_cursor); } - SDL_free(cursor->driverdata); + SDL_free(cursor->internal); SDL_free(cursor); } @@ -139,7 +139,7 @@ static int Android_ShowCursor(SDL_Cursor *cursor) cursor = Android_CreateEmptyCursor(); } if (cursor) { - SDL_AndroidCursorData *data = (SDL_AndroidCursorData *)cursor->driverdata; + SDL_AndroidCursorData *data = (SDL_AndroidCursorData *)cursor->internal; if (data->custom_cursor) { if (!Android_JNI_SetCustomCursor(data->custom_cursor)) { return SDL_Unsupported(); diff --git a/src/video/android/SDL_androidvideo.c b/src/video/android/SDL_androidvideo.c index 8e2cae7c00b9d..02302c34ddb61 100644 --- a/src/video/android/SDL_androidvideo.c +++ b/src/video/android/SDL_androidvideo.c @@ -75,7 +75,7 @@ static int Android_SuspendScreenSaver(SDL_VideoDevice *_this) static void Android_DeleteDevice(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -97,7 +97,7 @@ static SDL_VideoDevice *Android_CreateDevice(void) return NULL; } - device->driverdata = data; + device->internal = data; device->system_theme = Android_SystemTheme; /* Set the function pointers */ @@ -167,7 +167,7 @@ VideoBootStrap Android_bootstrap = { int Android_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_DisplayID displayID; SDL_VideoDisplay *display; SDL_DisplayMode mode; @@ -181,7 +181,6 @@ int Android_VideoInit(SDL_VideoDevice *_this) mode.w = Android_DeviceWidth; mode.h = Android_DeviceHeight; mode.refresh_rate = Android_ScreenRate; - mode.driverdata = NULL; displayID = SDL_AddBasicVideoDisplay(&mode); if (displayID == 0) { diff --git a/src/video/android/SDL_androidvulkan.c b/src/video/android/SDL_androidvulkan.c index d177110869cae..da5acfb66c21d 100644 --- a/src/video/android/SDL_androidvulkan.c +++ b/src/video/android/SDL_androidvulkan.c @@ -128,7 +128,7 @@ int Android_Vulkan_CreateSurface(SDL_VideoDevice *_this, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) { - SDL_WindowData *windowData = window->driverdata; + SDL_WindowData *windowData = window->internal; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR = diff --git a/src/video/android/SDL_androidwindow.c b/src/video/android/SDL_androidwindow.c index ea7a786334014..cf43d31302cda 100644 --- a/src/video/android/SDL_androidwindow.c +++ b/src/video/android/SDL_androidwindow.c @@ -90,7 +90,7 @@ int Android_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert SDL_SetPointerProperty(SDL_GetWindowProperties(window), SDL_PROP_WINDOW_ANDROID_SURFACE_POINTER, data->egl_surface); #endif - window->driverdata = data; + window->internal = data; Android_Window = window; endfunction: @@ -128,7 +128,7 @@ int Android_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_ goto endfunction; } - data = window->driverdata; + data = window->internal; if (!data || !data->native_window) { if (data && !data->native_window) { SDL_SetError("Missing native window"); @@ -175,8 +175,8 @@ void Android_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) if (window == Android_Window) { Android_Window = NULL; - if (window->driverdata) { - SDL_WindowData *data = window->driverdata; + if (window->internal) { + SDL_WindowData *data = window->internal; #ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { @@ -187,8 +187,8 @@ void Android_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) if (data->native_window) { ANativeWindow_release(data->native_window); } - SDL_free(window->driverdata); - window->driverdata = NULL; + SDL_free(window->internal); + window->internal = NULL; } } diff --git a/src/video/cocoa/SDL_cocoaclipboard.m b/src/video/cocoa/SDL_cocoaclipboard.m index b51f8307f42f8..3afaef8ba624c 100644 --- a/src/video/cocoa/SDL_cocoaclipboard.m +++ b/src/video/cocoa/SDL_cocoaclipboard.m @@ -93,7 +93,7 @@ void Cocoa_CheckClipboardUpdate(SDL_CocoaVideoData *data) int Cocoa_SetClipboardData(SDL_VideoDevice *_this) { @autoreleasepool { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; NSPasteboardItem *newItem = [NSPasteboardItem new]; NSMutableArray *utiTypes = [NSMutableArray new]; diff --git a/src/video/cocoa/SDL_cocoaevents.m b/src/video/cocoa/SDL_cocoaevents.m index 7bd0a54aed3a4..d06bf0c41c77f 100644 --- a/src/video/cocoa/SDL_cocoaevents.m +++ b/src/video/cocoa/SDL_cocoaevents.m @@ -35,7 +35,7 @@ SDL_VideoDevice *device = SDL_GetVideoDevice(); if (device && device->windows) { for (sdlwindow = device->windows; sdlwindow; sdlwindow = sdlwindow->next) { - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)sdlwindow->driverdata).nswindow; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)sdlwindow->internal).nswindow; if (win == nswindow) { return sdlwindow; } @@ -565,7 +565,7 @@ int Cocoa_PumpEventsUntilDate(SDL_VideoDevice *_this, NSDate *expiration, bool a { /* Run any existing modal sessions. */ for (SDL_Window *w = _this->windows; w; w = w->next) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)w->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)w->internal; if (data.modal_session) { [NSApp runModalSession:data.modal_session]; } @@ -620,7 +620,7 @@ void Cocoa_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) location:NSMakePoint(0, 0) modifierFlags:0 timestamp:0.0 - windowNumber:((__bridge SDL_CocoaWindowData *)window->driverdata).window_number + windowNumber:((__bridge SDL_CocoaWindowData *)window->internal).window_number context:nil subtype:0 data1:0 @@ -633,7 +633,7 @@ void Cocoa_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) int Cocoa_SuspendScreenSaver(SDL_VideoDevice *_this) { @autoreleasepool { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; if (data.screensaver_assertion) { IOPMAssertionRelease(data.screensaver_assertion); diff --git a/src/video/cocoa/SDL_cocoakeyboard.m b/src/video/cocoa/SDL_cocoakeyboard.m index 463f2c542a57d..2ced03b10dbff 100644 --- a/src/video/cocoa/SDL_cocoakeyboard.m +++ b/src/video/cocoa/SDL_cocoakeyboard.m @@ -328,7 +328,7 @@ static void UpdateKeymap(SDL_CocoaVideoData *data, SDL_bool send_event) void Cocoa_InitKeyboard(SDL_VideoDevice *_this) { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; UpdateKeymap(data, SDL_FALSE); @@ -348,8 +348,8 @@ int Cocoa_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { NSView *parentView; - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->internal).nswindow; parentView = [nswindow contentView]; @@ -375,7 +375,7 @@ int Cocoa_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; if (data && data.fieldEdit) { [data.fieldEdit removeFromSuperview]; @@ -387,7 +387,7 @@ int Cocoa_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) int Cocoa_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; if (data.fieldEdit) { [data.fieldEdit setInputRect:&window->text_input_rect]; } @@ -398,7 +398,7 @@ void Cocoa_HandleKeyEvent(SDL_VideoDevice *_this, NSEvent *event) { unsigned short scancode; SDL_Scancode code; - SDL_CocoaVideoData *data = _this ? ((__bridge SDL_CocoaVideoData *)_this->driverdata) : nil; + SDL_CocoaVideoData *data = _this ? ((__bridge SDL_CocoaVideoData *)_this->internal) : nil; if (!data) { return; /* can happen when returning from fullscreen Space on shutdown */ } diff --git a/src/video/cocoa/SDL_cocoamessagebox.m b/src/video/cocoa/SDL_cocoamessagebox.m index 82d29ad2296a6..198a695d00ea1 100644 --- a/src/video/cocoa/SDL_cocoamessagebox.m +++ b/src/video/cocoa/SDL_cocoamessagebox.m @@ -42,7 +42,7 @@ - (id)initWithParentWindow:(SDL_Window *)window /* Retain the NSWindow because we'll show the alert later on the main thread */ if (window) { - nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; + nswindow = ((__bridge SDL_CocoaWindowData *)window->internal).nswindow; } else { nswindow = nil; } diff --git a/src/video/cocoa/SDL_cocoametalview.m b/src/video/cocoa/SDL_cocoametalview.m index 71ede95583d0b..b610bc694e821 100644 --- a/src/video/cocoa/SDL_cocoametalview.m +++ b/src/video/cocoa/SDL_cocoametalview.m @@ -133,7 +133,7 @@ - (NSView *)hitTest:(NSPoint)point SDL_MetalView Cocoa_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSView *view = data.nswindow.contentView; BOOL highDPI = (window->flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) != 0; BOOL opaque = (window->flags & SDL_WINDOW_TRANSPARENT) == 0; diff --git a/src/video/cocoa/SDL_cocoamodes.m b/src/video/cocoa/SDL_cocoamodes.m index b3001aa9793b1..9eecb9d6d0577 100644 --- a/src/video/cocoa/SDL_cocoamodes.m +++ b/src/video/cocoa/SDL_cocoamodes.m @@ -271,7 +271,7 @@ static SDL_bool GetDisplayMode(SDL_VideoDevice *_this, CGDisplayModeRef vidmode, mode->h = (int)height; mode->pixel_density = (float)pixelW / width; mode->refresh_rate = refreshrate; - mode->driverdata = data; + mode->internal = data; return SDL_TRUE; } @@ -386,7 +386,7 @@ void Cocoa_InitModes(SDL_VideoDevice *_this) Cocoa_GetHDRProperties(displaydata->display, &display.HDR); display.desktop_mode = mode; - display.driverdata = displaydata; + display.internal = displaydata; SDL_AddVideoDisplay(&display, SDL_FALSE); SDL_free(display.name); } @@ -402,7 +402,7 @@ void Cocoa_UpdateDisplays(SDL_VideoDevice *_this) for (i = 0; i < _this->num_displays; ++i) { SDL_VideoDisplay *display = _this->displays[i]; - SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->internal; Cocoa_GetHDRProperties(displaydata->display, &HDR); SDL_SetDisplayHDRProperties(display, &HDR); @@ -411,7 +411,7 @@ void Cocoa_UpdateDisplays(SDL_VideoDevice *_this) int Cocoa_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { - SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->internal; CGRect cgrect; cgrect = CGDisplayBounds(displaydata->display); @@ -424,7 +424,7 @@ int Cocoa_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SD int Cocoa_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { - SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->internal; NSScreen *screen = GetNSScreenForDisplayID(displaydata->display); if (screen == nil) { @@ -444,7 +444,7 @@ int Cocoa_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *displ int Cocoa_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { - SDL_DisplayData *data = (SDL_DisplayData *)display->driverdata; + SDL_DisplayData *data = (SDL_DisplayData *)display->internal; CVDisplayLinkRef link = NULL; CFArrayRef modes; CFDictionaryRef dict = NULL; @@ -488,8 +488,8 @@ int Cocoa_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) if (GetDisplayMode(_this, moderef, SDL_FALSE, modes, link, &mode)) { if (!SDL_AddFullscreenDisplayMode(display, &mode)) { - CFRelease(((SDL_DisplayModeData *)mode.driverdata)->modes); - SDL_free(mode.driverdata); + CFRelease(mode.internal->modes); + SDL_free(mode.internal); } } } @@ -521,8 +521,8 @@ static CGError SetDisplayModeForDisplay(CGDirectDisplayID display, SDL_DisplayMo int Cocoa_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { - SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; - SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->internal; + SDL_DisplayModeData *data = mode->internal; CGDisplayFadeReservationToken fade_token = kCGDisplayFadeReservationInvalidToken; CGError result = kCGErrorSuccess; @@ -533,7 +533,7 @@ int Cocoa_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_ CGDisplayFade(fade_token, 0.3, kCGDisplayBlendNormal, kCGDisplayBlendSolidColor, 0.0, 0.0, 0.0, TRUE); } - if (data == display->desktop_mode.driverdata) { + if (data == display->desktop_mode.internal) { /* Restoring desktop mode */ SetDisplayModeForDisplay(displaydata->display, data); } else { @@ -564,15 +564,15 @@ void Cocoa_QuitModes(SDL_VideoDevice *_this) SDL_VideoDisplay *display = _this->displays[i]; SDL_DisplayModeData *mode; - if (display->current_mode->driverdata != display->desktop_mode.driverdata) { + if (display->current_mode->internal != display->desktop_mode.internal) { Cocoa_SetDisplayMode(_this, display, &display->desktop_mode); } - mode = (SDL_DisplayModeData *)display->desktop_mode.driverdata; + mode = display->desktop_mode.internal; CFRelease(mode->modes); for (j = 0; j < display->num_fullscreen_modes; j++) { - mode = (SDL_DisplayModeData *)display->fullscreen_modes[j].driverdata; + mode = display->fullscreen_modes[j].internal; CFRelease(mode->modes); } } diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index 7eb0c9658a216..884eb9e139dd4 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -74,7 +74,7 @@ + (NSCursor *)invisibleCursor if (nscursor) { cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = (void *)CFBridgingRetain(nscursor); + cursor->internal = (void *)CFBridgingRetain(nscursor); } } @@ -97,7 +97,7 @@ + (NSCursor *)invisibleCursor if (nscursor) { cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = (void *)CFBridgingRetain(nscursor); + cursor->internal = (void *)CFBridgingRetain(nscursor); } } @@ -221,7 +221,7 @@ + (NSCursor *)invisibleCursor cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { /* We'll free it later, so retain it here */ - cursor->driverdata = (void *)CFBridgingRetain(nscursor); + cursor->internal = (void *)CFBridgingRetain(nscursor); } } @@ -232,7 +232,7 @@ + (NSCursor *)invisibleCursor static void Cocoa_FreeCursor(SDL_Cursor *cursor) { @autoreleasepool { - CFBridgingRelease(cursor->driverdata); + CFBridgingRelease(cursor->internal); SDL_free(cursor); } } @@ -243,10 +243,10 @@ static int Cocoa_ShowCursor(SDL_Cursor *cursor) SDL_VideoDevice *device = SDL_GetVideoDevice(); SDL_Window *window = (device ? device->windows : NULL); for (; window != NULL; window = window->next) { - SDL_CocoaWindowData *driverdata = (__bridge SDL_CocoaWindowData *)window->driverdata; - if (driverdata) { - [driverdata.nswindow performSelectorOnMainThread:@selector(invalidateCursorRectsForView:) - withObject:[driverdata.nswindow contentView] + SDL_CocoaWindowData *internal = (__bridge SDL_CocoaWindowData *)window->internal; + if (internal) { + [internal.nswindow performSelectorOnMainThread:@selector(invalidateCursorRectsForView:) + withObject:[internal.nswindow contentView] waitUntilDone:NO]; } } @@ -273,7 +273,7 @@ static int Cocoa_WarpMouseGlobal(float x, float y) CGPoint point; SDL_Mouse *mouse = SDL_GetMouse(); if (mouse->focus) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)mouse->focus->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)mouse->focus->internal; if ([data.listener isMovingOrFocusClickPending]) { DLog("Postponing warp, window being moved or focused."); [data.listener setPendingMoveX:x Y:y]; @@ -346,7 +346,7 @@ static int Cocoa_SetRelativeMouseMode(SDL_bool enabled) /* We will re-apply the non-relative mode when the window finishes being moved, * if it is being moved right now. */ - data = (__bridge SDL_CocoaWindowData *)window->driverdata; + data = (__bridge SDL_CocoaWindowData *)window->internal; if ([data.listener isMovingOrFocusClickPending]) { return 0; } @@ -391,12 +391,12 @@ int Cocoa_InitMouse(SDL_VideoDevice *_this) { NSPoint location; SDL_Mouse *mouse = SDL_GetMouse(); - SDL_MouseData *driverdata = (SDL_MouseData *)SDL_calloc(1, sizeof(SDL_MouseData)); - if (driverdata == NULL) { + SDL_MouseData *internal = (SDL_MouseData *)SDL_calloc(1, sizeof(SDL_MouseData)); + if (internal == NULL) { return -1; } - mouse->driverdata = driverdata; + mouse->internal = internal; mouse->CreateCursor = Cocoa_CreateCursor; mouse->CreateSystemCursor = Cocoa_CreateSystemCursor; mouse->ShowCursor = Cocoa_ShowCursor; @@ -410,8 +410,8 @@ int Cocoa_InitMouse(SDL_VideoDevice *_this) SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor()); location = [NSEvent mouseLocation]; - driverdata->lastMoveX = location.x; - driverdata->lastMoveY = location.y; + internal->lastMoveX = location.x; + internal->lastMoveY = location.y; return 0; } @@ -427,7 +427,7 @@ static void Cocoa_HandleTitleButtonEvent(SDL_VideoDevice *_this, NSEvent *event) } for (window = _this->windows; window; window = window->next) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if (data && data.nswindow == nswindow) { switch ([event type]) { case NSEventTypeLeftMouseDown: @@ -452,7 +452,7 @@ void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event) { SDL_MouseID mouseID = SDL_DEFAULT_MOUSE_ID; SDL_Mouse *mouse; - SDL_MouseData *driverdata; + SDL_MouseData *data; NSPoint location; CGFloat lastMoveX, lastMoveY; float deltaX, deltaY; @@ -485,19 +485,19 @@ void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event) } mouse = SDL_GetMouse(); - driverdata = (SDL_MouseData *)mouse->driverdata; - if (!driverdata) { + data = (SDL_MouseData *)mouse->internal; + if (!data) { return; /* can happen when returning from fullscreen Space on shutdown */ } - seenWarp = driverdata->seenWarp; - driverdata->seenWarp = NO; + seenWarp = data->seenWarp; + data->seenWarp = NO; location = [NSEvent mouseLocation]; - lastMoveX = driverdata->lastMoveX; - lastMoveY = driverdata->lastMoveY; - driverdata->lastMoveX = location.x; - driverdata->lastMoveY = location.y; + lastMoveX = data->lastMoveX; + lastMoveY = data->lastMoveY; + data->lastMoveX = location.x; + data->lastMoveY = location.y; DLog("Last seen mouse: (%g, %g)", location.x, location.y); /* Non-relative movement is handled in -[Cocoa_WindowListener mouseMoved:] */ @@ -517,8 +517,8 @@ void Cocoa_HandleMouseEvent(SDL_VideoDevice *_this, NSEvent *event) deltaY = [event deltaY]; if (seenWarp) { - deltaX += (lastMoveX - driverdata->lastWarpX); - deltaY += ((CGDisplayPixelsHigh(kCGDirectMainDisplay) - lastMoveY) - driverdata->lastWarpY); + deltaX += (lastMoveX - data->lastWarpX); + deltaY += ((CGDisplayPixelsHigh(kCGDirectMainDisplay) - lastMoveY) - data->lastWarpY); DLog("Motion was (%g, %g), offset to (%g, %g)", [event deltaX], [event deltaY], deltaX, deltaY); } @@ -563,10 +563,10 @@ void Cocoa_HandleMouseWarp(CGFloat x, CGFloat y) /* This makes Cocoa_HandleMouseEvent ignore the delta caused by the warp, * since it gets included in the next movement event. */ - SDL_MouseData *driverdata = (SDL_MouseData *)SDL_GetMouse()->driverdata; - driverdata->lastWarpX = x; - driverdata->lastWarpY = y; - driverdata->seenWarp = SDL_TRUE; + SDL_MouseData *data = (SDL_MouseData *)SDL_GetMouse()->internal; + data->lastWarpX = x; + data->lastWarpY = y; + data->seenWarp = SDL_TRUE; DLog("(%g, %g)", x, y); } @@ -575,9 +575,9 @@ void Cocoa_QuitMouse(SDL_VideoDevice *_this) { SDL_Mouse *mouse = SDL_GetMouse(); if (mouse) { - if (mouse->driverdata) { - SDL_free(mouse->driverdata); - mouse->driverdata = NULL; + if (mouse->internal) { + SDL_free(mouse->internal); + mouse->internal = NULL; } } } diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 8b067aa4218a5..828e849e7ebc5 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -138,7 +138,7 @@ - (void)update - (void)setWindow:(SDL_Window *)newWindow { if (self->window) { - SDL_CocoaWindowData *oldwindowdata = (__bridge SDL_CocoaWindowData *)self->window->driverdata; + SDL_CocoaWindowData *oldwindowdata = (__bridge SDL_CocoaWindowData *)self->window->internal; /* Make sure to remove us from the old window's context list, or we'll get scheduled updates from it too. */ NSMutableArray *contexts = oldwindowdata.nscontexts; @@ -150,7 +150,7 @@ - (void)setWindow:(SDL_Window *)newWindow self->window = newWindow; if (newWindow) { - SDL_CocoaWindowData *windowdata = (__bridge SDL_CocoaWindowData *)newWindow->driverdata; + SDL_CocoaWindowData *windowdata = (__bridge SDL_CocoaWindowData *)newWindow->internal; NSView *contentview = windowdata.sdlContentView; /* Now sign up for scheduled updates for the new window. */ @@ -258,7 +258,7 @@ SDL_GLContext Cocoa_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata; + SDL_DisplayData *displaydata = (SDL_DisplayData *)display->internal; NSOpenGLPixelFormatAttribute attr[32]; NSOpenGLPixelFormat *fmt; SDLOpenGLContext *context; @@ -490,7 +490,7 @@ int Cocoa_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { SDLOpenGLContext *nscontext = (__bridge SDLOpenGLContext *)SDL_GL_GetCurrentContext(); - SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->internal; const int setting = SDL_AtomicGet(&nscontext->swapIntervalSetting); if (setting == 0) { diff --git a/src/video/cocoa/SDL_cocoaopengles.m b/src/video/cocoa/SDL_cocoaopengles.m index 0cac7dfb98400..04ea386e38c44 100644 --- a/src/video/cocoa/SDL_cocoaopengles.m +++ b/src/video/cocoa/SDL_cocoaopengles.m @@ -61,7 +61,7 @@ SDL_GLContext Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *windo { @autoreleasepool { SDL_GLContext context; - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; #ifdef SDL_VIDEO_OPENGL_CGL if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) { @@ -102,14 +102,14 @@ int Cocoa_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) int Cocoa_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - return SDL_EGL_SwapBuffers(_this, ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface); + return SDL_EGL_SwapBuffers(_this, ((__bridge SDL_CocoaWindowData *)window->internal).egl_surface); } } int Cocoa_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { @autoreleasepool { - return SDL_EGL_MakeCurrent(_this, window ? ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface : EGL_NO_SURFACE, context); + return SDL_EGL_MakeCurrent(_this, window ? ((__bridge SDL_CocoaWindowData *)window->internal).egl_surface : EGL_NO_SURFACE, context); } } @@ -118,7 +118,7 @@ int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) @autoreleasepool { NSView *v; /* The current context is lost in here; save it and reset it. */ - SDL_CocoaWindowData *windowdata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windowdata = (__bridge SDL_CocoaWindowData *)window->internal; SDL_Window *current_win = SDL_GL_GetCurrentWindow(); SDL_GLContext current_ctx = SDL_GL_GetCurrentContext(); @@ -149,7 +149,7 @@ int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) SDL_EGLSurface Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - return ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface; + return ((__bridge SDL_CocoaWindowData *)window->internal).egl_surface; } } diff --git a/src/video/cocoa/SDL_cocoashape.m b/src/video/cocoa/SDL_cocoashape.m index 633db6bd73dc6..5a3dd0125b1e9 100644 --- a/src/video/cocoa/SDL_cocoashape.m +++ b/src/video/cocoa/SDL_cocoashape.m @@ -28,7 +28,7 @@ int Cocoa_UpdateWindowShape(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *shape) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; BOOL ignoresMouseEvents = NO; if (shape) { diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m index 0a8e1504fe88f..edeca11a5732e 100644 --- a/src/video/cocoa/SDL_cocoavideo.m +++ b/src/video/cocoa/SDL_cocoavideo.m @@ -52,7 +52,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device) if (device->wakeup_lock) { SDL_DestroyMutex(device->wakeup_lock); } - CFBridgingRelease(device->driverdata); + CFBridgingRelease(device->internal); SDL_free(device); } } @@ -76,7 +76,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device) SDL_free(device); return NULL; } - device->driverdata = (SDL_VideoData *)CFBridgingRetain(data); + device->internal = (SDL_VideoData *)CFBridgingRetain(data); device->wakeup_lock = SDL_CreateMutex(); device->system_theme = Cocoa_GetSystemTheme(); @@ -195,7 +195,7 @@ static void Cocoa_DeleteDevice(SDL_VideoDevice *device) int Cocoa_VideoInit(SDL_VideoDevice *_this) { @autoreleasepool { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; Cocoa_InitModes(_this); Cocoa_InitKeyboard(_this); @@ -223,7 +223,7 @@ int Cocoa_VideoInit(SDL_VideoDevice *_this) void Cocoa_VideoQuit(SDL_VideoDevice *_this) { @autoreleasepool { - SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *data = (__bridge SDL_CocoaVideoData *)_this->internal; Cocoa_QuitModes(_this); Cocoa_QuitKeyboard(_this); Cocoa_QuitMouse(_this); diff --git a/src/video/cocoa/SDL_cocoavulkan.m b/src/video/cocoa/SDL_cocoavulkan.m index 710d9309cb4ec..cb8236fae0cd3 100644 --- a/src/video/cocoa/SDL_cocoavulkan.m +++ b/src/video/cocoa/SDL_cocoavulkan.m @@ -255,7 +255,7 @@ int Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this, if (window->flags & SDL_WINDOW_EXTERNAL) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if (![data.sdlContentView.layer isKindOfClass:[CAMetalLayer class]]) { [data.sdlContentView setLayer:[CAMetalLayer layer]]; } diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index c0f4facb23ffb..e3cfbf0508b84 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -260,7 +260,7 @@ - (SDL_Window *)findSDLWindow /* !!! FIXME: is there a better way to do this? */ if (_this) { for (sdlwindow = _this->windows; sdlwindow; sdlwindow = sdlwindow->next) { - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)sdlwindow->driverdata).nswindow; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)sdlwindow->internal).nswindow; if (nswindow == self) { break; } @@ -416,7 +416,7 @@ static NSUInteger GetWindowStyle(SDL_Window *window) static SDL_bool SetWindowStyle(SDL_Window *window, NSUInteger style) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = data.nswindow; /* The view responder chain gets messed with during setStyleMask */ @@ -436,7 +436,7 @@ static SDL_bool SetWindowStyle(SDL_Window *window, NSUInteger style) static SDL_bool ShouldAdjustCoordinatesForGrab(SDL_Window *window) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if (!data || [data.listener isMovingOrFocusClickPending]) { return SDL_FALSE; @@ -493,7 +493,7 @@ static SDL_bool AdjustCoordinatesForGrab(SDL_Window *window, float x, float y, C static void Cocoa_UpdateClipCursor(SDL_Window *window) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_13_2) { NSWindow *nswindow = data.nswindow; @@ -561,14 +561,14 @@ static void Cocoa_SetKeyboardFocus(SDL_Window *window) SDL_Window *topmost = GetTopmostWindow(window); SDL_CocoaWindowData *topmost_data; - topmost_data = (__bridge SDL_CocoaWindowData *)topmost->driverdata; + topmost_data = (__bridge SDL_CocoaWindowData *)topmost->internal; topmost_data.keyboard_focus = window; SDL_SetKeyboardFocus(window); } static void Cocoa_SendExposedEventIfVisible(SDL_Window *window) { - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->internal).nswindow; if ([nswindow occlusionState] & NSWindowOcclusionStateVisible) { SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_EXPOSED, 0, 0); } @@ -576,7 +576,7 @@ static void Cocoa_SendExposedEventIfVisible(SDL_Window *window) static void Cocoa_WaitForMiniaturizable(SDL_Window *window) { - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->internal).nswindow; NSButton *button = [nswindow standardWindowButton:NSWindowMiniaturizeButton]; if (button) { int iterations = 0; @@ -590,7 +590,7 @@ static void Cocoa_WaitForMiniaturizable(SDL_Window *window) static SDL_bool Cocoa_IsZoomed(SDL_Window *window) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; data.checking_zoom = YES; const SDL_bool ret = [data.nswindow isZoomed]; @@ -604,7 +604,7 @@ static SDL_bool Cocoa_IsZoomed(SDL_Window *window) SDL_Mouse *mouse = SDL_GetMouse(); if (mouse->cursor_shown && mouse->cur_cursor && !mouse->relative_mode) { - return (__bridge NSCursor *)mouse->cur_cursor->driverdata; + return (__bridge NSCursor *)mouse->cur_cursor->internal; } return [NSCursor invisibleCursor]; @@ -717,7 +717,7 @@ - (BOOL)setFullscreenSpace:(BOOL)state { SDL_Window *window = _data.window; NSWindow *nswindow = _data.nswindow; - SDL_CocoaVideoData *videodata = ((__bridge SDL_CocoaWindowData *)window->driverdata).videodata; + SDL_CocoaVideoData *videodata = ((__bridge SDL_CocoaWindowData *)window->internal).videodata; if (!videodata.allow_spaces) { return NO; /* Spaces are forcibly disabled. */ @@ -1494,7 +1494,7 @@ static int Cocoa_SendMouseButtonClicks(SDL_Mouse *mouse, NSEvent *theEvent, SDL_ // the position in the currently-focused window. We don't (currently) send a mousemove // event for the background window, this just makes sure the button is reported at the // correct position in its own event. - if (focus && ([theEvent window] == ((__bridge SDL_CocoaWindowData *)focus->driverdata).nswindow)) { + if (focus && ([theEvent window] == ((__bridge SDL_CocoaWindowData *)focus->internal).nswindow)) { rc = SDL_SendMouseButtonClicks(Cocoa_GetEventTimestamp([theEvent timestamp]), window, mouseID, state, button, clicks); } else { const float orig_x = mouse->x; @@ -1694,7 +1694,7 @@ - (void)scrollWheel:(NSEvent *)theEvent - (BOOL)isTouchFromTrackpad:(NSEvent *)theEvent { SDL_Window *window = _data.window; - SDL_CocoaVideoData *videodata = ((__bridge SDL_CocoaWindowData *)window->driverdata).videodata; + SDL_CocoaVideoData *videodata = ((__bridge SDL_CocoaWindowData *)window->internal).videodata; /* if this a MacBook trackpad, we'll make input look like a synthesized event. This is backwards from reality, but better matches user @@ -1892,7 +1892,7 @@ - (void)updateLayer BOOL transparent = (_sdlWindow->flags & SDL_WINDOW_TRANSPARENT) != 0; CFStringRef color = transparent ? kCGColorClear : kCGColorBlack; self.layer.backgroundColor = CGColorGetConstantColor(color); - ScheduleContextUpdates((__bridge SDL_CocoaWindowData *)_sdlWindow->driverdata); + ScheduleContextUpdates((__bridge SDL_CocoaWindowData *)_sdlWindow->internal); Cocoa_SendExposedEventIfVisible(_sdlWindow); } @@ -1930,7 +1930,7 @@ - (BOOL)acceptsFirstMouse:(NSEvent *)theEvent static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow *nswindow, NSView *nsview) { @autoreleasepool { - SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->internal; SDL_CocoaWindowData *data; /* Allocate the window data */ @@ -2006,7 +2006,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, NSWindow Cocoa_SetKeyboardFocus(data.window); } } else { - NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->driverdata).nswindow; + NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->internal).nswindow; [nsparent addChildWindow:nswindow ordered:NSWindowAbove]; if (window->flags & SDL_WINDOW_TOOLTIP) { @@ -2058,7 +2058,7 @@ then immediately ordering out (removing) the window does work. */ SDL_SetNumberProperty(props, SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER, SDL_METALVIEW_TAG); /* All done! */ - window->driverdata = (SDL_WindowData *)CFBridgingRetain(data); + window->internal = (SDL_WindowData *)CFBridgingRetain(data); return 0; } } @@ -2066,7 +2066,7 @@ then immediately ordering out (removing) the window does work. */ int Cocoa_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { @autoreleasepool { - SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->driverdata; + SDL_CocoaVideoData *videodata = (__bridge SDL_CocoaVideoData *)_this->internal; const void *data = SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL); NSWindow *nswindow = nil; NSView *nsview = nil; @@ -2225,7 +2225,7 @@ void Cocoa_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { const char *title = window->title ? window->title : ""; - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->internal).nswindow; NSString *string = [[NSString alloc] initWithUTF8String:title]; [nswindow setTitle:string]; } @@ -2249,7 +2249,7 @@ int Cocoa_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface int Cocoa_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = windata.nswindow; NSRect rect = [nswindow contentRectForFrameRect:[nswindow frame]]; BOOL fullscreen = (window->flags & SDL_WINDOW_FULLSCREEN) ? YES : NO; @@ -2302,7 +2302,7 @@ int Cocoa_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = windata.nswindow; if ([windata.listener windowOperationIsPending:(PENDING_OPERATION_ENTER_FULLSCREEN | PENDING_OPERATION_LEAVE_FULLSCREEN)] || @@ -2341,7 +2341,7 @@ void Cocoa_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->internal; NSSize minSize; minSize.width = window->min_w; @@ -2354,7 +2354,7 @@ void Cocoa_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->internal; NSSize maxSize; maxSize.width = window->max_w; @@ -2367,7 +2367,7 @@ void Cocoa_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { @autoreleasepool { - SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->internal; NSView *contentView = windata.sdlContentView; NSRect viewport = [contentView bounds]; @@ -2384,14 +2384,14 @@ void Cocoa_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int void Cocoa_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata); + SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->internal); NSWindow *nswindow = windowData.nswindow; SDL_bool bActivate = SDL_GetHintBoolean(SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN, SDL_TRUE); if (![nswindow isMiniaturized]) { [windowData.listener pauseVisibleObservation]; if (SDL_WINDOW_IS_POPUP(window)) { - NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->driverdata).nswindow; + NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->internal).nswindow; [nsparent addChildWindow:nswindow ordered:NSWindowAbove]; } else { if ((window->flags & SDL_WINDOW_MODAL) && window->parent) { @@ -2416,7 +2416,7 @@ void Cocoa_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->driverdata).nswindow; + NSWindow *nswindow = ((__bridge SDL_CocoaWindowData *)window->internal).nswindow; /* orderOut has no effect on miniaturized windows, so close must be used to remove * the window from the desktop and window list in this case. @@ -2455,7 +2455,7 @@ void Cocoa_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->driverdata); + SDL_CocoaWindowData *windowData = ((__bridge SDL_CocoaWindowData *)window->internal); NSWindow *nswindow = windowData.nswindow; SDL_bool bActivate = SDL_GetHintBoolean(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED, SDL_TRUE); @@ -2465,7 +2465,7 @@ void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) [windowData.listener pauseVisibleObservation]; if (![nswindow isMiniaturized] && [nswindow isVisible]) { if (SDL_WINDOW_IS_POPUP(window)) { - NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->driverdata).nswindow; + NSWindow *nsparent = ((__bridge SDL_CocoaWindowData *)window->parent->internal).nswindow; [nsparent addChildWindow:nswindow ordered:NSWindowAbove]; if (bActivate) { [nswindow makeKeyWindow]; @@ -2486,7 +2486,7 @@ void Cocoa_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *windata = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = windata.nswindow; if ([windata.listener windowOperationIsPending:(PENDING_OPERATION_ENTER_FULLSCREEN | PENDING_OPERATION_LEAVE_FULLSCREEN)] || @@ -2506,7 +2506,7 @@ void Cocoa_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = data.nswindow; [data.listener addPendingWindowOperation:PENDING_OPERATION_MINIMIZE]; @@ -2524,7 +2524,7 @@ void Cocoa_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = data.nswindow; if ([data.listener windowOperationIsPending:(PENDING_OPERATION_ENTER_FULLSCREEN | PENDING_OPERATION_LEAVE_FULLSCREEN)] || @@ -2567,7 +2567,7 @@ void Cocoa_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) void Cocoa_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; /* If the window is in or transitioning to/from fullscreen, this will be set on leave. */ if (!(window->flags & SDL_WINDOW_FULLSCREEN) && ![data.listener isInFullscreenSpaceTransition]) { @@ -2589,7 +2589,7 @@ void Cocoa_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bo * The window will get permanently stuck if resizable is false. * -flibit */ - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; Cocoa_WindowListener *listener = data.listener; NSWindow *nswindow = data.nswindow; SDL_CocoaVideoData *videodata = data.videodata; @@ -2610,7 +2610,7 @@ void Cocoa_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bo void Cocoa_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = data.nswindow; /* If the window is in or transitioning to/from fullscreen, this will be set on leave. */ @@ -2627,7 +2627,7 @@ void Cocoa_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_ int Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = data.nswindow; NSRect rect; @@ -2733,7 +2733,7 @@ int Cocoa_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_Vi void *Cocoa_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; NSWindow *nswindow = data.nswindow; NSScreen *screen = [nswindow screen]; NSData *iccProfileData = nil; @@ -2770,7 +2770,7 @@ SDL_DisplayID Cocoa_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *wind { @autoreleasepool { NSScreen *screen; - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; /* Not recognized via CHECK_WINDOW_MAGIC */ if (data == nil) { @@ -2790,7 +2790,7 @@ SDL_DisplayID Cocoa_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *wind displayid = [[screen.deviceDescription objectForKey:@"NSScreenNumber"] unsignedIntValue]; for (i = 0; i < _this->num_displays; i++) { - SDL_DisplayData *displaydata = _this->displays[i]->driverdata; + SDL_DisplayData *displaydata = _this->displays[i]->internal; if (displaydata != NULL && displaydata->display == displayid) { return _this->displays[i]->id; } @@ -2811,7 +2811,7 @@ int Cocoa_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) int Cocoa_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; Cocoa_UpdateClipCursor(window); @@ -2834,7 +2834,7 @@ int Cocoa_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_boo void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *data = (SDL_CocoaWindowData *)CFBridgingRelease(window->driverdata); + SDL_CocoaWindowData *data = (SDL_CocoaWindowData *)CFBridgingRelease(window->internal); if (data) { #ifdef SDL_VIDEO_OPENGL @@ -2843,7 +2843,7 @@ void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) #endif /* SDL_VIDEO_OPENGL */ SDL_Window *topmost = GetTopmostWindow(window); - SDL_CocoaWindowData *topmost_data = (__bridge SDL_CocoaWindowData *)topmost->driverdata; + SDL_CocoaWindowData *topmost_data = (__bridge SDL_CocoaWindowData *)topmost->internal; /* Reset the input focus of the root window if this window is still set as keyboard focus. * SDL_DestroyWindow will have already taken care of reassigning focus if this is the SDL @@ -2881,14 +2881,14 @@ void Cocoa_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) #endif /* SDL_VIDEO_OPENGL */ } - window->driverdata = NULL; + window->internal = NULL; } } SDL_bool Cocoa_IsWindowInFullscreenSpace(SDL_Window *window) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if ([data.listener isInFullscreenSpace]) { return SDL_TRUE; @@ -2902,7 +2902,7 @@ SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool state, SDL_ { @autoreleasepool { SDL_bool succeeded = SDL_FALSE; - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; data.in_blocking_transition = blocking; if ([data.listener setFullscreenSpace:(state ? YES : NO)]) { @@ -2944,7 +2944,7 @@ take effect properly (e.g. setting the window size, etc.) int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; [data.listener updateHitTest]; return 0; @@ -2953,7 +2953,7 @@ int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if (accept) { [data.nswindow registerForDraggedTypes:[NSArray arrayWithObject:(NSString *)kUTTypeFileURL]]; } else { @@ -2965,7 +2965,7 @@ void Cocoa_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) int Cocoa_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window) { @autoreleasepool { - SDL_CocoaWindowData *modal_data = (__bridge SDL_CocoaWindowData *)modal_window->driverdata; + SDL_CocoaWindowData *modal_data = (__bridge SDL_CocoaWindowData *)modal_window->internal; if (modal_data.modal_session) { [NSApp endModalSession:modal_data.modal_session]; @@ -2984,7 +2984,7 @@ int Cocoa_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOpera { @autoreleasepool { /* Note that this is app-wide and not window-specific! */ - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; if (data.flash_request) { [NSApp cancelUserAttentionRequest:data.flash_request]; @@ -3016,7 +3016,7 @@ int Cocoa_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, SDL_boo int Cocoa_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity) { @autoreleasepool { - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; [data.nswindow setAlphaValue:opacity]; return 0; } @@ -3031,7 +3031,7 @@ int Cocoa_SyncWindow(SDL_VideoDevice *_this, SDL_Window *window) * spaces transitions won't cause it to time out. */ Uint64 timeout = SDL_GetTicksNS() + SDL_MS_TO_NS(2000); - SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata; + SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->internal; while (SDL_TRUE) { SDL_PumpEvents(); diff --git a/src/video/emscripten/SDL_emscriptenframebuffer.c b/src/video/emscripten/SDL_emscriptenframebuffer.c index a7cae059def3f..02f84e34ac436 100644 --- a/src/video/emscripten/SDL_emscriptenframebuffer.c +++ b/src/video/emscripten/SDL_emscriptenframebuffer.c @@ -34,7 +34,7 @@ int Emscripten_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo int w, h; /* Free the old framebuffer surface */ - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; surface = data->surface; SDL_DestroySurface(surface); @@ -58,7 +58,7 @@ int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo { SDL_Surface *surface; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; surface = data->surface; if (!surface) { return SDL_SetError("Couldn't find framebuffer surface for window"); @@ -152,7 +152,7 @@ int Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *windo void Emscripten_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DestroySurface(data->surface); data->surface = NULL; diff --git a/src/video/emscripten/SDL_emscriptenmouse.c b/src/video/emscripten/SDL_emscriptenmouse.c index 17a5952800cde..e060abf27b73d 100644 --- a/src/video/emscripten/SDL_emscriptenmouse.c +++ b/src/video/emscripten/SDL_emscriptenmouse.c @@ -54,7 +54,7 @@ static SDL_Cursor *Emscripten_CreateCursorFromString(const char *cursor_str, SDL curdata->system_cursor = cursor_str; curdata->is_custom = is_custom; - cursor->driverdata = curdata; + cursor->internal = curdata; } return cursor; @@ -127,13 +127,13 @@ static void Emscripten_FreeCursor(SDL_Cursor *cursor) { Emscripten_CursorData *curdata; if (cursor) { - curdata = (Emscripten_CursorData *)cursor->driverdata; + curdata = (Emscripten_CursorData *)cursor->internal; if (curdata) { if (curdata->is_custom) { SDL_free((char *)curdata->system_cursor); } - SDL_free(cursor->driverdata); + SDL_free(cursor->internal); } SDL_free(cursor); @@ -144,8 +144,8 @@ static int Emscripten_ShowCursor(SDL_Cursor *cursor) { Emscripten_CursorData *curdata; if (SDL_GetMouseFocus() != NULL) { - if (cursor && cursor->driverdata) { - curdata = (Emscripten_CursorData *)cursor->driverdata; + if (cursor && cursor->internal) { + curdata = (Emscripten_CursorData *)cursor->internal; if (curdata->system_cursor) { /* *INDENT-OFF* */ /* clang-format off */ @@ -181,7 +181,7 @@ static int Emscripten_SetRelativeMouseMode(SDL_bool enabled) return -1; } - window_data = window->driverdata; + window_data = window->internal; if (emscripten_request_pointerlock(window_data->canvas_id, 1) >= EMSCRIPTEN_RESULT_SUCCESS) { return 0; diff --git a/src/video/emscripten/SDL_emscriptenopengles.c b/src/video/emscripten/SDL_emscriptenopengles.c index c195e0262bf2e..ae187a01e0bd2 100644 --- a/src/video/emscripten/SDL_emscriptenopengles.c +++ b/src/video/emscripten/SDL_emscriptenopengles.c @@ -88,7 +88,7 @@ SDL_GLContext Emscripten_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window * if (_this->gl_config.major_version == 3) attribs.majorVersion = 2; /* WebGL 2.0 ~= GLES 3.0 */ - window_data = window->driverdata; + window_data = window->internal; if (window_data->gl_context) { SDL_SetError("Cannot create multiple webgl contexts per window"); @@ -118,7 +118,7 @@ int Emscripten_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) /* remove the context from its window */ for (window = _this->windows; window; window = window->next) { - SDL_WindowData *window_data = window->driverdata; + SDL_WindowData *window_data = window->internal; if (window_data->gl_context == context) { window_data->gl_context = NULL; @@ -142,7 +142,7 @@ int Emscripten_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_ { /* it isn't possible to reuse contexts across canvases */ if (window && context) { - SDL_WindowData *window_data = window->driverdata; + SDL_WindowData *window_data = window->internal; if (context != window_data->gl_context) { return SDL_SetError("Cannot make context current to another window"); diff --git a/src/video/emscripten/SDL_emscriptenvideo.c b/src/video/emscripten/SDL_emscriptenvideo.c index 86fd050b47037..a629ad4a056d0 100644 --- a/src/video/emscripten/SDL_emscriptenvideo.c +++ b/src/video/emscripten/SDL_emscriptenvideo.c @@ -230,7 +230,7 @@ static int Emscripten_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, S wdata->window = window; /* Setup driver data for this window */ - window->driverdata = wdata; + window->internal = wdata; /* One window, it always has focus */ SDL_SetMouseFocus(window); @@ -246,8 +246,8 @@ static void Emscripten_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; - if (window->driverdata) { - data = window->driverdata; + if (window->internal) { + data = window->internal; /* update pixel ratio */ if (window->flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) { data->pixel_ratio = emscripten_get_device_pixel_ratio(); @@ -266,8 +266,8 @@ static void Emscripten_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) static void Emscripten_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { SDL_WindowData *data; - if (window->driverdata) { - data = window->driverdata; + if (window->internal) { + data = window->internal; *w = SDL_lroundf(window->w * data->pixel_ratio); *h = SDL_lroundf(window->h * data->pixel_ratio); } @@ -277,8 +277,8 @@ static void Emscripten_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; - if (window->driverdata) { - data = window->driverdata; + if (window->internal) { + data = window->internal; Emscripten_UnregisterEventHandlers(data); @@ -286,8 +286,8 @@ static void Emscripten_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) emscripten_set_canvas_element_size(data->canvas_id, 0, 0); SDL_free(data->canvas_id); - SDL_free(window->driverdata); - window->driverdata = NULL; + SDL_free(window->internal); + window->internal = NULL; } } @@ -296,8 +296,8 @@ static int Emscripten_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *wi SDL_WindowData *data; int res = -1; - if (window->driverdata) { - data = window->driverdata; + if (window->internal) { + data = window->internal; if (fullscreen) { EmscriptenFullscreenStrategy strategy; diff --git a/src/video/haiku/SDL_bframebuffer.cc b/src/video/haiku/SDL_bframebuffer.cc index 70bfff7dc1b7b..ffcb1a45e777a 100644 --- a/src/video/haiku/SDL_bframebuffer.cc +++ b/src/video/haiku/SDL_bframebuffer.cc @@ -36,7 +36,7 @@ extern "C" { #endif static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return (SDL_BWin *)(window->driverdata); + return (SDL_BWin *)(window->internal); } static SDL_INLINE SDL_BLooper *_GetBeLooper() { diff --git a/src/video/haiku/SDL_bmodes.cc b/src/video/haiku/SDL_bmodes.cc index 1201d714bb64c..f8d07ccb39c8a 100644 --- a/src/video/haiku/SDL_bmodes.cc +++ b/src/video/haiku/SDL_bmodes.cc @@ -41,7 +41,7 @@ extern "C" { #define WRAP_BMODE 1 /* FIXME: Some debate as to whether this is necessary */ #if WRAP_BMODE -/* This wrapper is here so that the driverdata can be freed without freeing +/* This wrapper is here so that the internal can be freed without freeing the display_mode structure */ struct SDL_DisplayModeData { display_mode *bmode; @@ -49,7 +49,7 @@ struct SDL_DisplayModeData { #endif static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return (SDL_BWin *)(window->driverdata); + return (SDL_BWin *)(window->internal); } static SDL_INLINE SDL_BLooper *_GetBeLooper() { @@ -58,9 +58,9 @@ static SDL_INLINE SDL_BLooper *_GetBeLooper() { static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) { #if WRAP_BMODE - return ((SDL_DisplayModeData *)mode->driverdata)->bmode; + return mode->internal->bmode; #else - return (display_mode *)(mode->driverdata); + return (display_mode *)mode->internal; #endif } @@ -173,14 +173,12 @@ static void _BDisplayModeToSdlDisplayMode(display_mode *bmode, SDL_DisplayMode * get_refresh_rate(*bmode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); #if WRAP_BMODE - SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1, - sizeof(SDL_DisplayModeData)); + SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1, sizeof(SDL_DisplayModeData)); data->bmode = bmode; - mode->driverdata = data; - + mode->internal = data; #else - mode->driverdata = bmode; + mode->internal = bmode; #endif /* Set the format */ diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc index ad47f41a55800..7c2d4b057872a 100644 --- a/src/video/haiku/SDL_bopengl.cc +++ b/src/video/haiku/SDL_bopengl.cc @@ -36,7 +36,7 @@ extern "C" { static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return (SDL_BWin *)(window->driverdata); + return (SDL_BWin *)(window->internal); } static SDL_INLINE SDL_BLooper *_GetBeLooper() { diff --git a/src/video/haiku/SDL_bvideo.cc b/src/video/haiku/SDL_bvideo.cc index cbbd554bea1ae..30e6cc6366daf 100644 --- a/src/video/haiku/SDL_bvideo.cc +++ b/src/video/haiku/SDL_bvideo.cc @@ -44,7 +44,7 @@ extern "C" { #include "../../events/SDL_mouse_c.h" static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return (SDL_BWin *)(window->driverdata); + return (SDL_BWin *)(window->internal); } static SDL_VideoDevice * HAIKU_CreateDevice(void) @@ -54,7 +54,7 @@ static SDL_VideoDevice * HAIKU_CreateDevice(void) /* Initialize all variables that we clean on shutdown */ device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); - device->driverdata = NULL; /* FIXME: Is this the cause of some of the + device->internal = NULL; /* FIXME: Is this the cause of some of the SDL_Quit() errors? */ /* TODO: Figure out if any initialization needs to go here */ @@ -116,7 +116,7 @@ VideoBootStrap HAIKU_bootstrap = { void HAIKU_DeleteDevice(SDL_VideoDevice * device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -155,7 +155,7 @@ static SDL_Cursor * HAIKU_CreateSystemCursor(SDL_SystemCursor id) SDL_Cursor *cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = (void *)new BCursor(cursorId); + cursor->internal = (void *)new BCursor(cursorId); } return cursor; @@ -168,8 +168,8 @@ static SDL_Cursor * HAIKU_CreateDefaultCursor() static void HAIKU_FreeCursor(SDL_Cursor * cursor) { - if (cursor->driverdata) { - delete (BCursor*) cursor->driverdata; + if (cursor->internal) { + delete (BCursor*) cursor->internal; } SDL_free(cursor); } @@ -190,7 +190,7 @@ static SDL_Cursor * HAIKU_CreateCursor(SDL_Surface * surface, int hot_x, int hot cursor = (SDL_Cursor *) SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = (void *)new BCursor(cursorBitmap, BPoint(hot_x, hot_y)); + cursor->internal = (void *)new BCursor(cursorBitmap, BPoint(hot_x, hot_y)); } else { return NULL; } @@ -207,7 +207,7 @@ static int HAIKU_ShowCursor(SDL_Cursor *cursor) } if (cursor) { - BCursor *hCursor = (BCursor*)cursor->driverdata; + BCursor *hCursor = (BCursor*)cursor->internal; be_app->SetCursor(hCursor); } else { BCursor *hCursor = new BCursor(B_CURSOR_ID_NO_CURSOR); diff --git a/src/video/haiku/SDL_bwindow.cc b/src/video/haiku/SDL_bwindow.cc index 3b721569fa8cf..121b9ed8d01d4 100644 --- a/src/video/haiku/SDL_bwindow.cc +++ b/src/video/haiku/SDL_bwindow.cc @@ -32,7 +32,7 @@ extern "C" { #endif static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) { - return (SDL_BWin *)(window->driverdata); + return (SDL_BWin *)(window->internal); } static SDL_INLINE SDL_BLooper *_GetBeLooper() { @@ -69,7 +69,7 @@ static int _InitWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie return -1; } - window->driverdata = (SDL_WindowData *)bwin; + window->internal = (SDL_WindowData *)bwin; int32 winID = _GetBeLooper()->GetID(window); bwin->SetID(winID); @@ -194,7 +194,7 @@ void HAIKU_DestroyWindow(SDL_VideoDevice *_this, SDL_Window * window) { _ToBeWin(window)->LockLooper(); /* This MUST be locked */ _GetBeLooper()->ClearID(_ToBeWin(window)); _ToBeWin(window)->Quit(); - window->driverdata = NULL; + window->internal = NULL; } #ifdef __cplusplus diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index 7b1416a6fa59c..f96dd837def42 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -58,12 +58,12 @@ static SDL_Cursor *KMSDRM_CreateDefaultCursor(void) return SDL_CreateCursor(default_cdata, default_cmask, DEFAULT_CWIDTH, DEFAULT_CHEIGHT, DEFAULT_CHOTX, DEFAULT_CHOTY); } -/* Given a display's driverdata, destroy the cursor BO for it. +/* Given a display's internal, destroy the cursor BO for it. To be called from KMSDRM_DestroyWindow(), as that's where we - destroy the driverdata for the window's display. */ + destroy the internal for the window's display. */ void KMSDRM_DestroyCursorBO(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; /* Destroy the curso GBM BO. */ if (dispdata->cursor_bo) { @@ -73,15 +73,15 @@ void KMSDRM_DestroyCursorBO(SDL_VideoDevice *_this, SDL_VideoDisplay *display) } } -/* Given a display's driverdata, create the cursor BO for it. +/* Given a display's internal, create the cursor BO for it. To be called from KMSDRM_CreateWindow(), as that's where we build a window and assign a display to it. */ int KMSDRM_CreateCursorBO(SDL_VideoDisplay *display) { SDL_VideoDevice *dev = SDL_GetVideoDevice(); - SDL_VideoData *viddata = dev->driverdata; - SDL_DisplayData *dispdata = display->driverdata; + SDL_VideoData *viddata = dev->internal; + SDL_DisplayData *dispdata = display->internal; if (!KMSDRM_gbm_device_is_format_supported(viddata->gbm_dev, GBM_FORMAT_ARGB8888, @@ -116,9 +116,9 @@ int KMSDRM_CreateCursorBO(SDL_VideoDisplay *display) static int KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display) { int ret = 0; - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; SDL_VideoDevice *video_device = SDL_GetVideoDevice(); - SDL_VideoData *viddata = video_device->driverdata; + SDL_VideoData *viddata = video_device->internal; ret = KMSDRM_drmModeSetCursor(viddata->drm_fd, dispdata->crtc->crtc_id, 0, 0, 0); @@ -133,10 +133,10 @@ static int KMSDRM_RemoveCursorFromBO(SDL_VideoDisplay *display) /* Dump a cursor buffer to a display's DRM cursor BO. */ static int KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor) { - SDL_DisplayData *dispdata = display->driverdata; - KMSDRM_CursorData *curdata = (KMSDRM_CursorData *)cursor->driverdata; + SDL_DisplayData *dispdata = display->internal; + KMSDRM_CursorData *curdata = (KMSDRM_CursorData *)cursor->internal; SDL_VideoDevice *video_device = SDL_GetVideoDevice(); - SDL_VideoData *viddata = video_device->driverdata; + SDL_VideoData *viddata = video_device->internal; uint32_t bo_handle; size_t bo_stride; @@ -210,15 +210,15 @@ static void KMSDRM_FreeCursor(SDL_Cursor *cursor) /* Even if the cursor is not ours, free it. */ if (cursor) { - curdata = (KMSDRM_CursorData *)cursor->driverdata; + curdata = (KMSDRM_CursorData *)cursor->internal; /* Free cursor buffer */ if (curdata->buffer) { SDL_free(curdata->buffer); curdata->buffer = NULL; } /* Free cursor itself */ - if (cursor->driverdata) { - SDL_free(cursor->driverdata); + if (cursor->internal) { + SDL_free(cursor->internal); } SDL_free(cursor); } @@ -269,7 +269,7 @@ static SDL_Cursor *KMSDRM_CreateCursor(SDL_Surface *surface, int hot_x, int hot_ surface->format, surface->pixels, surface->pitch, SDL_PIXELFORMAT_ARGB8888, curdata->buffer, surface->w * 4); - cursor->driverdata = curdata; + cursor->internal = curdata; ret = cursor; @@ -383,7 +383,7 @@ static int KMSDRM_WarpMouse(SDL_Window *window, float x, float y) void KMSDRM_InitMouse(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { SDL_Mouse *mouse = SDL_GetMouse(); - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; mouse->CreateCursor = KMSDRM_CreateCursor; mouse->ShowCursor = KMSDRM_ShowCursor; diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c index 7c5841cef606b..a39bad0841117 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c @@ -54,7 +54,7 @@ int KMSDRM_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) so gbm dev isn't yet created when this is called, AND we can't alter the call order in SDL_CreateWindow(). */ #if 0 - NativeDisplayType display = (NativeDisplayType)_this->driverdata->gbm_dev; + NativeDisplayType display = (NativeDisplayType)_this->internal->gbm_dev; return SDL_EGL_LoadLibrary(_this, path, display, EGL_PLATFORM_GBM_MESA); #endif return 0; @@ -86,9 +86,9 @@ SDL_EGL_CreateContext_impl(KMSDRM) int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *windata = window->driverdata; + SDL_WindowData *windata = window->internal; SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; KMSDRM_FBInfo *fb_info; int ret = 0; diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index a56c39da39f28..8de8d77649f06 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -228,9 +228,9 @@ static int KMSDRM_Available(void) static void KMSDRM_DeleteDevice(SDL_VideoDevice *device) { - if (device->driverdata) { - SDL_free(device->driverdata); - device->driverdata = NULL; + if (device->internal) { + SDL_free(device->internal); + device->internal = NULL; } SDL_free(device); @@ -270,7 +270,7 @@ static SDL_VideoDevice *KMSDRM_CreateDevice(void) viddata->devindex = devindex; viddata->drm_fd = -1; - device->driverdata = viddata; + device->internal = viddata; /* Setup all functions which we can handle */ device->VideoInit = KMSDRM_VideoInit; @@ -346,7 +346,7 @@ static void KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data) KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; unsigned w, h; int ret, num_planes = 0; Uint32 format, strides[4] = { 0 }, handles[4] = { 0 }, offsets[4] = { 0 }, flags = 0; @@ -424,7 +424,7 @@ static void KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, uns SDL_bool KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; drmEventContext ev = { 0 }; struct pollfd pfd = { 0 }; int ret; @@ -511,7 +511,7 @@ SDL_bool KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata) static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display, int width, int height) { - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; drmModeConnector *connector = dispdata->connector; const SDL_DisplayMode *closest; @@ -519,7 +519,7 @@ static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display, closest = SDL_GetClosestFullscreenDisplayMode(display->id, width, height, 0.0f, SDL_FALSE); if (closest) { - const SDL_DisplayModeData *modedata = (const SDL_DisplayModeData *)closest->driverdata; + const SDL_DisplayModeData *modedata = closest->internal; drm_mode = &connector->modes[modedata->mode_index]; return drm_mode; } else { @@ -532,7 +532,7 @@ static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display, /* _this is a SDL_VideoDevice * */ /*****************************************************************************/ -/* Deinitializes the driverdata of the SDL Displays in the SDL display list. */ +/* Deinitializes the internal of the SDL Displays in the SDL display list. */ static void KMSDRM_DeinitDisplays(SDL_VideoDevice *_this) { SDL_DisplayID *displays; @@ -544,7 +544,7 @@ static void KMSDRM_DeinitDisplays(SDL_VideoDevice *_this) /* Iterate on the SDL Display list. */ for (i = 0; displays[i]; ++i) { - /* Get the driverdata for this display */ + /* Get the internal for this display */ dispdata = SDL_GetDisplayDriverData(displays[i]); /* Free connector */ @@ -772,7 +772,7 @@ static int KMSDRM_CrtcGetOrientation(uint32_t drm_fd, uint32_t crtc_id) list of SDL Displays in _this->displays[] */ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connector, drmModeRes *resources) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; SDL_DisplayData *dispdata = NULL; SDL_VideoDisplay display = { 0 }; SDL_DisplayModeData *modedata = NULL; @@ -785,14 +785,14 @@ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connecto int i, j; int ret = 0; - /* Reserve memory for the new display's driverdata. */ + /* Reserve memory for the new display's internal. */ dispdata = (SDL_DisplayData *)SDL_calloc(1, sizeof(SDL_DisplayData)); if (!dispdata) { ret = -1; goto cleanup; } - /* Initialize some of the members of the new display's driverdata + /* Initialize some of the members of the new display's internal to sane values. */ dispdata->cursor_bo = NULL; dispdata->cursor_bo_drm_fd = -1; @@ -915,7 +915,7 @@ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connecto /*********************************************/ /*********************************************/ - /* Part 1: setup the SDL_Display driverdata. */ + /* Part 1: setup the SDL_Display internal. */ /*********************************************/ /* Get the mode currently setup for this display, @@ -957,12 +957,12 @@ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connecto modedata->mode_index = mode_index; - display.driverdata = dispdata; + display.internal = dispdata; display.desktop_mode.w = dispdata->mode.hdisplay; display.desktop_mode.h = dispdata->mode.vdisplay; CalculateRefreshRate(&dispdata->mode, &display.desktop_mode.refresh_rate_numerator, &display.desktop_mode.refresh_rate_denominator); display.desktop_mode.format = SDL_PIXELFORMAT_ARGB8888; - display.desktop_mode.driverdata = modedata; + display.desktop_mode.internal = modedata; /* Add the display to the list of SDL displays. */ display_id = SDL_AddVideoDisplay(&display, SDL_FALSE); @@ -1004,7 +1004,7 @@ static void KMSDRM_AddDisplay(SDL_VideoDevice *_this, drmModeConnector *connecto static int KMSDRM_InitDisplays(SDL_VideoDevice *_this) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; drmModeRes *resources = NULL; uint64_t async_pageflip = 0; @@ -1099,7 +1099,7 @@ static int KMSDRM_InitDisplays(SDL_VideoDevice *_this) */ static int KMSDRM_GBMInit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; int ret = 0; /* Reopen the FD! */ @@ -1122,7 +1122,7 @@ static int KMSDRM_GBMInit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata) /* Deinit the Vulkan-incompatible KMSDRM stuff. */ static void KMSDRM_GBMDeinit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; /* Destroy GBM device. GBM surface is destroyed by DestroySurfaces(), already called when we get here. */ @@ -1142,8 +1142,8 @@ static void KMSDRM_GBMDeinit(SDL_VideoDevice *_this, SDL_DisplayData *dispdata) static void KMSDRM_DestroySurfaces(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *viddata = _this->driverdata; - SDL_WindowData *windata = window->driverdata; + SDL_VideoData *viddata = _this->internal; + SDL_WindowData *windata = window->internal; SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); int ret; @@ -1210,7 +1210,7 @@ static void KMSDRM_DestroySurfaces(SDL_VideoDevice *_this, SDL_Window *window) static void KMSDRM_GetModeToSet(SDL_Window *window, drmModeModeInfo *out_mode) { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; if (window->fullscreen_exclusive) { *out_mode = dispdata->fullscreen_mode; @@ -1226,7 +1226,7 @@ static void KMSDRM_GetModeToSet(SDL_Window *window, drmModeModeInfo *out_mode) static void KMSDRM_DirtySurfaces(SDL_Window *window) { - SDL_WindowData *windata = window->driverdata; + SDL_WindowData *windata = window->internal; drmModeModeInfo mode; /* Can't recreate EGL surfaces right now, need to wait until SwapWindow @@ -1244,10 +1244,10 @@ static void KMSDRM_DirtySurfaces(SDL_Window *window) that we create here. */ int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *viddata = _this->driverdata; - SDL_WindowData *windata = window->driverdata; + SDL_VideoData *viddata = _this->internal; + SDL_WindowData *windata = window->internal; SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; uint32_t surface_fmt = GBM_FORMAT_ARGB8888; uint32_t surface_flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING; @@ -1321,7 +1321,7 @@ int KMSDRM_CreateSurfaces(SDL_VideoDevice *_this, SDL_Window *window) static void KMSDRM_ReleaseVT(void *userdata) { SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata; - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; int i; for (i = 0; i < viddata->num_windows; i++) { @@ -1336,7 +1336,7 @@ static void KMSDRM_ReleaseVT(void *userdata) static void KMSDRM_AcquireVT(void *userdata) { SDL_VideoDevice *_this = (SDL_VideoDevice *)userdata; - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; int i; KMSDRM_drmSetMaster(viddata->drm_fd); @@ -1353,7 +1353,7 @@ int KMSDRM_VideoInit(SDL_VideoDevice *_this) { int ret = 0; - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "KMSDRM_VideoInit()"); viddata->video_init = SDL_FALSE; @@ -1379,11 +1379,11 @@ int KMSDRM_VideoInit(SDL_VideoDevice *_this) return ret; } -/* The driverdata pointers, like dispdata, viddata, windata, etc... +/* The internal pointers, like dispdata, viddata, windata, etc... are freed by SDL internals, so not our job. */ void KMSDRM_VideoQuit(SDL_VideoDevice *_this) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; KMSDRM_DeinitDisplays(_this); @@ -1405,7 +1405,7 @@ void KMSDRM_VideoQuit(SDL_VideoDevice *_this) /* Read modes from the connector modes, and store them in display->display_modes. */ int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; drmModeConnector *conn = dispdata->connector; SDL_DisplayMode mode; int i; @@ -1422,7 +1422,7 @@ int KMSDRM_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) mode.h = conn->modes[i].vdisplay; CalculateRefreshRate(&conn->modes[i], &mode.refresh_rate_numerator, &mode.refresh_rate_denominator); mode.format = SDL_PIXELFORMAT_ARGB8888; - mode.driverdata = modedata; + mode.internal = modedata; if (!SDL_AddFullscreenDisplayMode(display, &mode)) { SDL_free(modedata); @@ -1436,9 +1436,9 @@ int KMSDRM_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL /* Set the dispdata->mode to the new mode and leave actual modesetting pending to be done on SwapWindow() via drmModeSetCrtc() */ - SDL_VideoData *viddata = _this->driverdata; - SDL_DisplayData *dispdata = display->driverdata; - SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata; + SDL_VideoData *viddata = _this->internal; + SDL_DisplayData *dispdata = display->internal; + SDL_DisplayModeData *modedata = mode->internal; drmModeConnector *conn = dispdata->connector; int i; @@ -1464,7 +1464,7 @@ int KMSDRM_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *windata = window->driverdata; + SDL_WindowData *windata = window->internal; SDL_DisplayData *dispdata = SDL_GetDisplayDriverDataForWindow(window); SDL_VideoData *viddata; SDL_bool is_vulkan = window->flags & SDL_WINDOW_VULKAN; /* Is this a VK window? */ @@ -1529,10 +1529,10 @@ void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) } /*********************************************************************/ - /* Free the window driverdata. Bye bye, surface and buffer pointers! */ + /* Free the window internal. Bye bye, surface and buffer pointers! */ /*********************************************************************/ - SDL_free(window->driverdata); - window->driverdata = NULL; + SDL_free(window->internal); + window->internal = NULL; } /**********************************************************************/ @@ -1543,9 +1543,9 @@ void KMSDRM_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { SDL_WindowData *windata = NULL; - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_DisplayData *dispdata = display->driverdata; + SDL_DisplayData *dispdata = display->internal; SDL_bool is_vulkan = window->flags & SDL_WINDOW_VULKAN; /* Is this a VK window? */ SDL_bool vulkan_mode = viddata->vulkan_mode; /* Do we have any Vulkan windows? */ NativeDisplayType egl_display; @@ -1560,7 +1560,7 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti /* Setup driver data for this window */ windata->viddata = viddata; - window->driverdata = windata; + window->internal = windata; SDL_PropertiesID props = SDL_GetWindowProperties(window); SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DEVICE_INDEX_NUMBER, viddata->devindex); @@ -1603,7 +1603,7 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti If we let SDL_CreateWindow() load the lib, it would be loaded before we call KMSDRM_GBMInit(), causing all GLES programs to fail. */ if (!_this->egl_data) { - egl_display = (NativeDisplayType)_this->driverdata->gbm_dev; + egl_display = (NativeDisplayType)_this->internal->gbm_dev; if (SDL_EGL_LoadLibrary(_this, NULL, egl_display, EGL_PLATFORM_GBM_MESA) < 0) { /* Try again with OpenGL ES 2.0 */ _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; @@ -1689,14 +1689,14 @@ int KMSDRM_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) } void KMSDRM_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; if (!viddata->vulkan_mode) { KMSDRM_DirtySurfaces(window); } } int KMSDRM_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen) { - SDL_VideoData *viddata = _this->driverdata; + SDL_VideoData *viddata = _this->internal; if (!viddata->vulkan_mode) { KMSDRM_DirtySurfaces(window); } diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.h b/src/video/kmsdrm/SDL_kmsdrmvideo.h index 3de569189cf70..e594df7538ff6 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.h +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.h @@ -110,9 +110,9 @@ struct SDL_DisplayData drmModeCrtc *saved_crtc; /* CRTC to restore on quit */ SDL_bool saved_vrr; - /* DRM & GBM cursor stuff lives here, not in an SDL_Cursor's driverdata struct, + /* DRM & GBM cursor stuff lives here, not in an SDL_Cursor's internal struct, because setting/unsetting up these is done on window creation/destruction, - where we may not have an SDL_Cursor at all (so no SDL_Cursor driverdata). + where we may not have an SDL_Cursor at all (so no SDL_Cursor internal). There's only one cursor GBM BO because we only support one cursor. */ struct gbm_bo *cursor_bo; int cursor_bo_drm_fd; @@ -126,7 +126,7 @@ struct SDL_WindowData SDL_VideoData *viddata; /* SDL internals expect EGL surface to be here, and in KMSDRM the GBM surface is what supports the EGL surface on the driver side, so all these surfaces and buffers - are expected to be here, in the struct pointed by SDL_Window driverdata pointer: + are expected to be here, in the struct pointed by SDL_Window internal pointer: this one. So don't try to move these to dispdata! */ struct gbm_surface *gs; struct gbm_bo *bo; diff --git a/src/video/n3ds/SDL_n3dsframebuffer.c b/src/video/n3ds/SDL_n3dsframebuffer.c index 1180e20d6d552..b1084ad415582 100644 --- a/src/video/n3ds/SDL_n3dsframebuffer.c +++ b/src/video/n3ds/SDL_n3dsframebuffer.c @@ -67,7 +67,7 @@ int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { - SDL_WindowData *drv_data = window->driverdata; + SDL_WindowData *drv_data = window->internal; SDL_Surface *surface; u16 width, height; void *framebuffer; diff --git a/src/video/n3ds/SDL_n3dstouch.c b/src/video/n3ds/SDL_n3dstouch.c index 4661d09429778..1915e30d587f0 100644 --- a/src/video/n3ds/SDL_n3dstouch.c +++ b/src/video/n3ds/SDL_n3dstouch.c @@ -54,7 +54,7 @@ void N3DS_QuitTouch(void) void N3DS_PollTouch(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *internal = (SDL_VideoData *)_this->internal; touchPosition touch; SDL_Window *window; SDL_VideoDisplay *display; @@ -63,7 +63,7 @@ void N3DS_PollTouch(SDL_VideoDevice *_this) hidTouchRead(&touch); pressed = (touch.px != 0 || touch.py != 0); - display = SDL_GetVideoDisplay(driverdata->touch_display); + display = SDL_GetVideoDisplay(internal->touch_display); window = display ? display->fullscreen_window : NULL; if (pressed != was_pressed) { diff --git a/src/video/n3ds/SDL_n3dsvideo.c b/src/video/n3ds/SDL_n3dsvideo.c index 7f7d5a2a9c945..4c168126bbf94 100644 --- a/src/video/n3ds/SDL_n3dsvideo.c +++ b/src/video/n3ds/SDL_n3dsvideo.c @@ -67,7 +67,7 @@ static const struct static void N3DS_DeleteDevice(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -89,7 +89,7 @@ static SDL_VideoDevice *N3DS_CreateDevice(void) return NULL; } - device->driverdata = phdata; + device->internal = phdata; device->VideoInit = N3DS_VideoInit; device->VideoQuit = N3DS_VideoQuit; @@ -122,13 +122,13 @@ VideoBootStrap N3DS_bootstrap = { N3DSVID_DRIVER_NAME, "N3DS Video Driver", N3DS static int N3DS_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *internal = (SDL_VideoData *)_this->internal; gfxInit(GSP_RGBA8_OES, GSP_RGBA8_OES, false); hidInit(); - driverdata->top_display = AddN3DSDisplay(GFX_TOP); - driverdata->touch_display = AddN3DSDisplay(GFX_BOTTOM); + internal->top_display = AddN3DSDisplay(GFX_TOP); + internal->touch_display = AddN3DSDisplay(GFX_BOTTOM); N3DS_InitTouch(); N3DS_SwkbInit(); @@ -160,12 +160,12 @@ static int AddN3DSDisplay(gfxScreen_t screen) mode.h = GSP_SCREEN_WIDTH; mode.refresh_rate = 60.0f; mode.format = SDL_PIXELFORMAT_RGBA8888; - mode.driverdata = modedata; + mode.internal = modedata; modedata->fmt = GSP_RGBA8_OES; display.name = (screen == GFX_TOP) ? "N3DS top screen" : "N3DS bottom screen"; display.desktop_mode = mode; - display.driverdata = display_driver_data; + display.internal = display_driver_data; return SDL_AddVideoDisplay(&display, SDL_FALSE); } @@ -181,7 +181,7 @@ static void N3DS_VideoQuit(SDL_VideoDevice *_this) static int N3DS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { - SDL_DisplayData *displaydata = display->driverdata; + SDL_DisplayData *displaydata = display->internal; SDL_DisplayModeData *modedata; SDL_DisplayMode mode; int i; @@ -196,7 +196,7 @@ static int N3DS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *displa mode.h = GSP_SCREEN_WIDTH; mode.refresh_rate = 60.0f; mode.format = format_map[i].pixfmt; - mode.driverdata = modedata; + mode.internal = modedata; modedata->fmt = format_map[i].gspfmt; if (!SDL_AddFullscreenDisplayMode(display, &mode)) { @@ -209,8 +209,8 @@ static int N3DS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *displa static int N3DS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { - SDL_DisplayData *displaydata = display->driverdata; - SDL_DisplayModeData *modedata = mode->driverdata; + SDL_DisplayData *displaydata = display->internal; + SDL_DisplayModeData *modedata = mode->internal; gfxSetScreenFormat(displaydata->screen, modedata->fmt); return 0; @@ -218,7 +218,7 @@ static int N3DS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display static int N3DS_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { - SDL_DisplayData *driver_data = display->driverdata; + SDL_DisplayData *driver_data = display->internal; if (!driver_data) { return -1; @@ -240,7 +240,7 @@ static int N3DS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Pro } display_data = SDL_GetDisplayDriverDataForWindow(window); window_data->screen = display_data->screen; - window->driverdata = window_data; + window->internal = window_data; SDL_SetKeyboardFocus(window); return 0; } @@ -250,7 +250,7 @@ static void N3DS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) if (!window) { return; } - SDL_free(window->driverdata); + SDL_free(window->internal); } #endif /* SDL_VIDEO_DRIVER_N3DS */ diff --git a/src/video/ngage/SDL_ngageevents.cpp b/src/video/ngage/SDL_ngageevents.cpp index 59a524a8f76dd..91327d4a8f48a 100644 --- a/src/video/ngage/SDL_ngageevents.cpp +++ b/src/video/ngage/SDL_ngageevents.cpp @@ -44,7 +44,7 @@ int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent); void NGAGE_PumpEvents(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; while (data->NGAGE_WsEventStatus != KRequestPending) { data->NGAGE_WsSession.GetEvent(data->NGAGE_WsEvent); @@ -149,7 +149,7 @@ static SDL_Scancode ConvertScancode(SDL_VideoDevice *_this, int key) int HandleWsEvent(SDL_VideoDevice *_this, const TWsEvent &aWsEvent) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int posted = 0; switch (aWsEvent.Type()) { diff --git a/src/video/ngage/SDL_ngageframebuffer.cpp b/src/video/ngage/SDL_ngageframebuffer.cpp index df42a831763f5..181b914ae797c 100644 --- a/src/video/ngage/SDL_ngageframebuffer.cpp +++ b/src/video/ngage/SDL_ngageframebuffer.cpp @@ -46,7 +46,7 @@ void RedrawWindowL(SDL_VideoDevice *_this); int SDL_NGAGE_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; SDL_Surface *surface; const SDL_PixelFormat surface_format = SDL_PIXELFORMAT_XRGB4444; int w, h; @@ -199,7 +199,7 @@ int GetBpp(TDisplayMode displaymode) void DrawBackground(SDL_VideoDevice *_this) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; /* Draw background */ TUint16 *screenBuffer = (TUint16 *)phdata->NGAGE_FrameBuffer; /* Draw black background */ @@ -208,7 +208,7 @@ void DrawBackground(SDL_VideoDevice *_this) void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 *screenBuffer) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); TInt i; @@ -333,7 +333,7 @@ void DirectDraw(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects, TUint16 * void DirectUpdate(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; if (!phdata->NGAGE_IsWindowFocused) { SDL_PauseAudio(1); @@ -368,7 +368,7 @@ void DirectUpdate(SDL_VideoDevice *_this, int numrects, SDL_Rect *rects) void RedrawWindowL(SDL_VideoDevice *_this) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; SDL_Surface *screen = (SDL_Surface *)SDL_GetWindowData(_this->windows, NGAGE_SURFACE); int w = screen->w; diff --git a/src/video/ngage/SDL_ngagevideo.cpp b/src/video/ngage/SDL_ngagevideo.cpp index 532403eeaf140..6bae7de083b2f 100644 --- a/src/video/ngage/SDL_ngagevideo.cpp +++ b/src/video/ngage/SDL_ngagevideo.cpp @@ -54,7 +54,7 @@ static void NGAGE_VideoQuit(SDL_VideoDevice *_this); static void NGAGE_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *phdata = device->driverdata; + SDL_VideoData *phdata = device->internal; if (phdata) { /* Free Epoc resources */ @@ -129,7 +129,7 @@ static SDL_VideoDevice *NGAGE_CreateDevice(void) device->DestroyWindow = NGAGE_DestroyWindow; /* N-Gage specific data */ - device->driverdata = phdata; + device->internal = phdata; return device; } diff --git a/src/video/ngage/SDL_ngagewindow.cpp b/src/video/ngage/SDL_ngagewindow.cpp index 57df58c0ce1e8..0fb8e9e9d8d3d 100644 --- a/src/video/ngage/SDL_ngagewindow.cpp +++ b/src/video/ngage/SDL_ngagewindow.cpp @@ -40,7 +40,7 @@ int NGAGE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie return -1; } - window->driverdata = ngage_window; + window->internal = ngage_window; if (window->x == SDL_WINDOWPOS_UNDEFINED) { window->x = 0; @@ -59,13 +59,13 @@ int NGAGE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie void NGAGE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - NGAGE_Window *ngage_window = (NGAGE_Window *)window->driverdata; + NGAGE_Window *ngage_window = (NGAGE_Window *)window->internal; if (ngage_window) { SDL_free(ngage_window); } - window->driverdata = NULL; + window->internal = NULL; } /*****************************************************************************/ @@ -74,7 +74,7 @@ void NGAGE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) void DisableKeyBlocking(SDL_VideoDevice *_this) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; TRawEvent event; event.Set((TRawEvent::TType) /*EDisableKeyBlock*/ 51); @@ -83,7 +83,7 @@ void DisableKeyBlocking(SDL_VideoDevice *_this) void ConstructWindowL(SDL_VideoDevice *_this) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; TInt error; error = phdata->NGAGE_WsSession.Connect(); diff --git a/src/video/offscreen/SDL_offscreenopengles.c b/src/video/offscreen/SDL_offscreenopengles.c index 98601f1f88226..2de9b88002ce6 100644 --- a/src/video/offscreen/SDL_offscreenopengles.c +++ b/src/video/offscreen/SDL_offscreenopengles.c @@ -56,7 +56,7 @@ int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) SDL_GLContext OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *offscreen_window = window->driverdata; + SDL_WindowData *offscreen_window = window->internal; SDL_GLContext context; context = SDL_EGL_CreateContext(_this, offscreen_window->egl_surface); @@ -67,7 +67,7 @@ SDL_GLContext OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *w int OFFSCREEN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (window) { - EGLSurface egl_surface = window->driverdata->egl_surface; + EGLSurface egl_surface = window->internal->egl_surface; return SDL_EGL_MakeCurrent(_this, egl_surface, context); } else { return SDL_EGL_MakeCurrent(_this, NULL, NULL); @@ -76,7 +76,7 @@ int OFFSCREEN_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_G int OFFSCREEN_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *offscreen_wind = window->driverdata; + SDL_WindowData *offscreen_wind = window->internal; return SDL_EGL_SwapBuffers(_this, offscreen_wind->egl_surface); } diff --git a/src/video/offscreen/SDL_offscreenwindow.c b/src/video/offscreen/SDL_offscreenwindow.c index 5950d0c380409..7796e65e552f6 100644 --- a/src/video/offscreen/SDL_offscreenwindow.c +++ b/src/video/offscreen/SDL_offscreenwindow.c @@ -36,7 +36,7 @@ int OFFSCREEN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Prope return -1; } - window->driverdata = offscreen_window; + window->internal = offscreen_window; if (window->x == SDL_WINDOWPOS_UNDEFINED) { window->x = 0; @@ -71,7 +71,7 @@ int OFFSCREEN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Prope void OFFSCREEN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *offscreen_window = window->driverdata; + SDL_WindowData *offscreen_window = window->internal; if (offscreen_window) { #ifdef SDL_VIDEO_OPENGL_EGL @@ -80,7 +80,7 @@ void OFFSCREEN_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) SDL_free(offscreen_window); } - window->driverdata = NULL; + window->internal = NULL; } void OFFSCREEN_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) diff --git a/src/video/psp/SDL_pspgl.c b/src/video/psp/SDL_pspgl.c index 8d64c430f9826..39f55865aab43 100644 --- a/src/video/psp/SDL_pspgl.c +++ b/src/video/psp/SDL_pspgl.c @@ -70,7 +70,7 @@ static EGLint height = 272; SDL_GLContext PSP_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wdata = window->driverdata; + SDL_WindowData *wdata = window->internal; EGLint attribs[32]; EGLDisplay display; @@ -167,7 +167,7 @@ int PSP_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) int PSP_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; EGLBoolean status; if (phdata->egl_initialized != SDL_TRUE) { diff --git a/src/video/psp/SDL_pspvideo.c b/src/video/psp/SDL_pspvideo.c index 149a4e734e2dd..a2ff1d129a390 100644 --- a/src/video/psp/SDL_pspvideo.c +++ b/src/video/psp/SDL_pspvideo.c @@ -44,7 +44,7 @@ static SDL_bool PSP_initialized = SDL_FALSE; static void PSP_Destroy(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -75,7 +75,7 @@ static SDL_VideoDevice *PSP_Create() } device->gl_data = gldata; - device->driverdata = phdata; + device->internal = phdata; phdata->egl_initialized = SDL_TRUE; @@ -204,7 +204,7 @@ int PSP_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI } /* Setup driver data for this window */ - window->driverdata = wdata; + window->internal = wdata; SDL_SetKeyboardFocus(window); diff --git a/src/video/qnx/SDL_qnxgl.c b/src/video/qnx/SDL_qnxgl.c index 35a4d68ead9c2..8c499aebae998 100644 --- a/src/video/qnx/SDL_qnxgl.c +++ b/src/video/qnx/SDL_qnxgl.c @@ -165,7 +165,7 @@ SDL_FunctionPointer glGetProcAddress(SDL_VideoDevice *_this, const char *proc) */ SDL_GLContext glCreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; EGLContext context; EGLSurface surface; @@ -228,7 +228,7 @@ int glSetSwapInterval(SDL_VideoDevice *_this, int interval) int glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* !!! FIXME: should we migrate this all over to use SDL_egl.c? */ - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; return eglSwapBuffers(egl_disp, impl->surface) == EGL_TRUE ? 0 : -1; } @@ -245,7 +245,7 @@ int glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext cont EGLSurface surface = NULL; if (window) { - impl = (window_impl_t *)window->driverdata; + impl = (window_impl_t *)window->internal; surface = impl->surface; } diff --git a/src/video/qnx/SDL_qnxvideo.c b/src/video/qnx/SDL_qnxvideo.c index 5d6c5efd20a1d..3744d3b1b926a 100644 --- a/src/video/qnx/SDL_qnxvideo.c +++ b/src/video/qnx/SDL_qnxvideo.c @@ -130,7 +130,7 @@ static int createWindow(SDL_VideoDevice *_this, SDL_Window *window) goto fail; } - window->driverdata = impl; + window->internal = impl; return 0; fail: @@ -155,7 +155,7 @@ static int createWindow(SDL_VideoDevice *_this, SDL_Window *window) static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, SDL_PixelFormat * format, void ** pixels, int *pitch) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; screen_buffer_t buffer; // Get a pointer to the buffer's memory. @@ -190,7 +190,7 @@ static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, static int updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; screen_buffer_t buffer; if (screen_get_window_property_pv(impl->window, SCREEN_PROPERTY_BUFFERS, @@ -243,7 +243,7 @@ static void pumpEvents(SDL_VideoDevice *_this) */ static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; int size[2]; size[0] = window->floating.w; @@ -260,7 +260,7 @@ static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window) */ static void showWindow(SDL_VideoDevice *_this, SDL_Window *window) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; const int visible = 1; screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE, @@ -274,7 +274,7 @@ static void showWindow(SDL_VideoDevice *_this, SDL_Window *window) */ static void hideWindow(SDL_VideoDevice *_this, SDL_Window *window) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; const int visible = 0; screen_set_window_property_iv(impl->window, SCREEN_PROPERTY_VISIBLE, @@ -288,11 +288,11 @@ static void hideWindow(SDL_VideoDevice *_this, SDL_Window *window) */ static void destroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - window_impl_t *impl = (window_impl_t *)window->driverdata; + window_impl_t *impl = (window_impl_t *)window->internal; if (impl) { screen_destroy_window(impl->window); - window->driverdata = NULL; + window->internal = NULL; } } @@ -318,7 +318,7 @@ static SDL_VideoDevice *createDevice() return NULL; } - device->driverdata = NULL; + device->internal = NULL; device->VideoInit = videoInit; device->VideoQuit = videoQuit; device->CreateSDLWindow = createWindow; diff --git a/src/video/raspberry/SDL_rpimouse.c b/src/video/raspberry/SDL_rpimouse.c index fd790b86b098f..52ed4203b9ba0 100644 --- a/src/video/raspberry/SDL_rpimouse.c +++ b/src/video/raspberry/SDL_rpimouse.c @@ -92,7 +92,7 @@ static SDL_Cursor *RPI_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) ret = vc_dispmanx_resource_write_data(curdata->resource, VC_IMAGE_ARGB8888, surface->pitch, surface->pixels, &dst_rect); SDL_assert(ret == DISPMANX_SUCCESS); - cursor->driverdata = curdata; + cursor->internal = curdata; return cursor; } @@ -117,7 +117,7 @@ static int RPI_ShowCursor(SDL_Cursor *cursor) if (cursor != global_cursor) { if (global_cursor) { - curdata = (RPI_CursorData *)global_cursor->driverdata; + curdata = (RPI_CursorData *)global_cursor->internal; if (curdata && curdata->element > DISPMANX_NO_HANDLE) { update = vc_dispmanx_update_start(0); SDL_assert(update); @@ -135,7 +135,7 @@ static int RPI_ShowCursor(SDL_Cursor *cursor) return 0; } - curdata = (RPI_CursorData *)cursor->driverdata; + curdata = (RPI_CursorData *)cursor->internal; if (!curdata) { return -1; } @@ -187,7 +187,7 @@ static void RPI_FreeCursor(SDL_Cursor *cursor) RPI_CursorData *curdata; if (cursor) { - curdata = (RPI_CursorData *)cursor->driverdata; + curdata = (RPI_CursorData *)cursor->internal; if (curdata) { if (curdata->element != DISPMANX_NO_HANDLE) { @@ -204,7 +204,7 @@ static void RPI_FreeCursor(SDL_Cursor *cursor) SDL_assert(ret == DISPMANX_SUCCESS); } - SDL_free(cursor->driverdata); + SDL_free(cursor->internal); } SDL_free(cursor); if (cursor == global_cursor) { @@ -222,11 +222,11 @@ static int RPI_WarpMouseGlobalGraphically(float x, float y) VC_RECT_T src_rect; SDL_Mouse *mouse = SDL_GetMouse(); - if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->driverdata) { + if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->internal) { return 0; } - curdata = (RPI_CursorData *)mouse->cur_cursor->driverdata; + curdata = (RPI_CursorData *)mouse->cur_cursor->internal; if (curdata->element == DISPMANX_NO_HANDLE) { return 0; } @@ -271,7 +271,7 @@ static int RPI_WarpMouseGlobal(float x, float y) { SDL_Mouse *mouse = SDL_GetMouse(); - if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->driverdata) { + if (!mouse || !mouse->cur_cursor || !mouse->cur_cursor->internal) { return 0; } diff --git a/src/video/raspberry/SDL_rpimouse.h b/src/video/raspberry/SDL_rpimouse.h index 074b6e189918a..d1872caa85c35 100644 --- a/src/video/raspberry/SDL_rpimouse.h +++ b/src/video/raspberry/SDL_rpimouse.h @@ -33,7 +33,7 @@ struct _RPI_CursorData int w, h; }; -#define SDL_RPI_CURSORDATA(curs) RPI_CursorData *curdata = (RPI_CursorData *)((curs) ? (curs)->driverdata : NULL) +#define SDL_RPI_CURSORDATA(curs) RPI_CursorData *curdata = (RPI_CursorData *)((curs) ? (curs)->internal : NULL) extern void RPI_InitMouse(SDL_VideoDevice *_this); extern void RPI_QuitMouse(SDL_VideoDevice *_this); diff --git a/src/video/raspberry/SDL_rpiopengles.c b/src/video/raspberry/SDL_rpiopengles.c index 6d5718eb6bbde..4f5f004a943f7 100644 --- a/src/video/raspberry/SDL_rpiopengles.c +++ b/src/video/raspberry/SDL_rpiopengles.c @@ -41,7 +41,7 @@ int RPI_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) int RPI_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wdata = window->driverdata; + SDL_WindowData *wdata = window->internal; if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, wdata->egl_surface))) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed."); diff --git a/src/video/raspberry/SDL_rpivideo.c b/src/video/raspberry/SDL_rpivideo.c index d9fda949bd9d7..0806a15735913 100644 --- a/src/video/raspberry/SDL_rpivideo.c +++ b/src/video/raspberry/SDL_rpivideo.c @@ -47,7 +47,7 @@ static void RPI_Destroy(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -93,7 +93,7 @@ static SDL_VideoDevice *RPI_Create() return NULL; } - device->driverdata = phdata; + device->internal = phdata; /* Setup amount of available displays */ device->num_displays = 0; @@ -181,7 +181,7 @@ static void AddDispManXDisplay(const int display_id) data->dispman_display = handle; - display.driverdata = data; + display.internal = data; SDL_AddVideoDisplay(&display, SDL_FALSE); } @@ -244,7 +244,7 @@ int RPI_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI return -1; } display = SDL_GetVideoDisplayForWindow(window); - displaydata = display->driverdata; + displaydata = display->internal; /* Windows have one size for now */ window->w = display->desktop_mode.w; @@ -305,7 +305,7 @@ int RPI_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI } /* Setup driver data for this window */ - window->driverdata = wdata; + window->internal = wdata; /* One window, it always has focus */ SDL_SetMouseFocus(window); @@ -317,7 +317,7 @@ int RPI_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI void RPI_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); if (data) { @@ -339,7 +339,7 @@ void RPI_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) } #endif SDL_free(data); - window->driverdata = NULL; + window->internal = NULL; } } diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c index be05989a6720b..c830747019ee1 100644 --- a/src/video/riscos/SDL_riscosevents.c +++ b/src/video/riscos/SDL_riscosevents.c @@ -50,16 +50,16 @@ static SDL_Scancode SDL_RISCOS_translate_keycode(int keycode) void RISCOS_PollKeyboard(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; + SDL_VideoData *internal = _this->internal; Uint8 key = 2; int i; /* Check for key releases */ for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) { - if (driverdata->key_pressed[i] != 255) { - if ((_kernel_osbyte(129, driverdata->key_pressed[i] ^ 0xff, 0xff) & 0xff) != 255) { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, driverdata->key_pressed[i], SDL_RISCOS_translate_keycode(driverdata->key_pressed[i]), SDL_RELEASED); - driverdata->key_pressed[i] = 255; + if (internal->key_pressed[i] != 255) { + if ((_kernel_osbyte(129, internal->key_pressed[i] ^ 0xff, 0xff) & 0xff) != 255) { + SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, internal->key_pressed[i], SDL_RISCOS_translate_keycode(internal->key_pressed[i]), SDL_RELEASED); + internal->key_pressed[i] = 255; } } } @@ -85,11 +85,11 @@ void RISCOS_PollKeyboard(SDL_VideoDevice *_this) /* Record the press so we can detect release later. */ for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) { - if (driverdata->key_pressed[i] == key) { + if (internal->key_pressed[i] == key) { break; } - if (driverdata->key_pressed[i] == 255) { - driverdata->key_pressed[i] = key; + if (internal->key_pressed[i] == 255) { + internal->key_pressed[i] = key; break; } } @@ -110,7 +110,7 @@ static const Uint8 mouse_button_map[] = { void RISCOS_PollMouse(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; + SDL_VideoData *internal = _this->internal; SDL_Mouse *mouse = SDL_GetMouse(); SDL_Rect rect; _kernel_swi_regs regs; @@ -129,22 +129,22 @@ void RISCOS_PollMouse(SDL_VideoDevice *_this) SDL_SendMouseMotion(0, mouse->focus, SDL_DEFAULT_MOUSE_ID, SDL_FALSE, (float)x, (float)y); } - if (driverdata->last_mouse_buttons != buttons) { + if (internal->last_mouse_buttons != buttons) { for (i = 0; i < SDL_arraysize(mouse_button_map); i++) { SDL_SendMouseButton(0, mouse->focus, SDL_DEFAULT_MOUSE_ID, (buttons & (1 << i)) ? SDL_PRESSED : SDL_RELEASED, mouse_button_map[i]); } - driverdata->last_mouse_buttons = buttons; + internal->last_mouse_buttons = buttons; } } int RISCOS_InitEvents(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; + SDL_VideoData *internal = _this->internal; _kernel_swi_regs regs; int i, status; for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++) { - driverdata->key_pressed[i] = 255; + internal->key_pressed[i] = 255; } status = (_kernel_osbyte(202, 0, 255) & 0xFF); @@ -153,7 +153,7 @@ int RISCOS_InitEvents(SDL_VideoDevice *_this) SDL_ToggleModState(SDL_KMOD_SCROLL, (status & (1 << 1)) ? SDL_TRUE : SDL_FALSE); _kernel_swi(OS_Mouse, ®s, ®s); - driverdata->last_mouse_buttons = regs.r[2]; + internal->last_mouse_buttons = regs.r[2]; /* Disable escape. */ _kernel_osbyte(229, 1, 0); diff --git a/src/video/riscos/SDL_riscosframebuffer.c b/src/video/riscos/SDL_riscosframebuffer.c index bef7443bc211e..d78ecd4a7fcfd 100644 --- a/src/video/riscos/SDL_riscosframebuffer.c +++ b/src/video/riscos/SDL_riscosframebuffer.c @@ -32,7 +32,7 @@ int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { - SDL_WindowData *driverdata = window->driverdata; + SDL_WindowData *internal = window->internal; const char *sprite_name = "display"; unsigned int sprite_mode; _kernel_oserror *error; @@ -50,7 +50,7 @@ int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, S mode = SDL_GetCurrentDisplayMode(SDL_GetDisplayForWindow(window)); if ((SDL_ISPIXELFORMAT_PACKED(mode->format) || SDL_ISPIXELFORMAT_ARRAY(mode->format))) { *format = mode->format; - sprite_mode = (unsigned int)mode->driverdata; + sprite_mode = (unsigned int)mode->internal; } else { *format = SDL_PIXELFORMAT_XBGR8888; sprite_mode = (1 | (90 << 1) | (90 << 14) | (6 << 27)); @@ -61,19 +61,19 @@ int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, S /* Allocate the sprite area */ size = sizeof(sprite_area) + sizeof(sprite_header) + ((*pitch) * h); - driverdata->fb_area = SDL_malloc(size); - if (!driverdata->fb_area) { + internal->fb_area = SDL_malloc(size); + if (!internal->fb_area) { return -1; } - driverdata->fb_area->size = size; - driverdata->fb_area->count = 0; - driverdata->fb_area->start = 16; - driverdata->fb_area->end = 16; + internal->fb_area->size = size; + internal->fb_area->count = 0; + internal->fb_area->start = 16; + internal->fb_area->end = 16; /* Create the actual image */ regs.r[0] = 256 + 15; - regs.r[1] = (int)driverdata->fb_area; + regs.r[1] = (int)internal->fb_area; regs.r[2] = (int)sprite_name; regs.r[3] = 0; regs.r[4] = w; @@ -81,25 +81,25 @@ int RISCOS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, S regs.r[6] = sprite_mode; error = _kernel_swi(OS_SpriteOp, ®s, ®s); if (error) { - SDL_free(driverdata->fb_area); + SDL_free(internal->fb_area); return SDL_SetError("Unable to create sprite: %s (%i)", error->errmess, error->errnum); } - driverdata->fb_sprite = (sprite_header *)(((Uint8 *)driverdata->fb_area) + driverdata->fb_area->start); - *pixels = ((Uint8 *)driverdata->fb_sprite) + driverdata->fb_sprite->image_offset; + internal->fb_sprite = (sprite_header *)(((Uint8 *)internal->fb_area) + internal->fb_area->start); + *pixels = ((Uint8 *)internal->fb_sprite) + internal->fb_sprite->image_offset; return 0; } int RISCOS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { - SDL_WindowData *driverdata = window->driverdata; + SDL_WindowData *internal = window->internal; _kernel_swi_regs regs; _kernel_oserror *error; regs.r[0] = 512 + 52; - regs.r[1] = (int)driverdata->fb_area; - regs.r[2] = (int)driverdata->fb_sprite; + regs.r[1] = (int)internal->fb_area; + regs.r[2] = (int)internal->fb_sprite; regs.r[3] = 0; /* window->x << 1; */ regs.r[4] = 0; /* window->y << 1; */ regs.r[5] = 0x50; @@ -115,13 +115,13 @@ int RISCOS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, c void RISCOS_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *driverdata = window->driverdata; + SDL_WindowData *internal = window->internal; - if (driverdata->fb_area) { - SDL_free(driverdata->fb_area); - driverdata->fb_area = NULL; + if (internal->fb_area) { + SDL_free(internal->fb_area); + internal->fb_area = NULL; } - driverdata->fb_sprite = NULL; + internal->fb_sprite = NULL; } #endif /* SDL_VIDEO_DRIVER_RISCOS */ diff --git a/src/video/riscos/SDL_riscosmodes.c b/src/video/riscos/SDL_riscosmodes.c index 066dfebe067bd..d1ab4728f6d7b 100644 --- a/src/video/riscos/SDL_riscosmodes.c +++ b/src/video/riscos/SDL_riscosmodes.c @@ -218,8 +218,8 @@ int RISCOS_InitModes(SDL_VideoDevice *_this) } size = measure_mode_block(current_mode); - mode.driverdata = copy_memory(current_mode, size, size); - if (!mode.driverdata) { + mode.internal = copy_memory(current_mode, size, size); + if (!mode.internal) { return -1; } @@ -267,14 +267,14 @@ int RISCOS_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) continue; } - mode.driverdata = convert_mode_block(pos + 4); - if (!mode.driverdata) { + mode.internal = convert_mode_block(pos + 4); + if (!mode.internal) { SDL_free(block); return -1; } if (!SDL_AddFullscreenDisplayMode(display, &mode)) { - SDL_free(mode.driverdata); + SDL_free(mode.internal); } } @@ -290,7 +290,7 @@ int RISCOS_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL int i; regs.r[0] = 0; - regs.r[1] = (int)mode->driverdata; + regs.r[1] = (int)mode->internal; error = _kernel_swi(OS_ScreenMode, ®s, ®s); if (error) { return SDL_SetError("Unable to set the current screen mode: %s (%i)", error->errmess, error->errnum); diff --git a/src/video/riscos/SDL_riscosmouse.c b/src/video/riscos/SDL_riscosmouse.c index 32f5d251a3a83..465d754a766a1 100644 --- a/src/video/riscos/SDL_riscosmouse.c +++ b/src/video/riscos/SDL_riscosmouse.c @@ -33,7 +33,7 @@ static SDL_Cursor *RISCOS_CreateDefaultCursor() SDL_Cursor *cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { /* NULL is used to indicate the default cursor */ - cursor->driverdata = NULL; + cursor->internal = NULL; } return cursor; diff --git a/src/video/riscos/SDL_riscosvideo.c b/src/video/riscos/SDL_riscosvideo.c index a4d2208e7daa6..0cba7506d88b8 100644 --- a/src/video/riscos/SDL_riscosvideo.c +++ b/src/video/riscos/SDL_riscosvideo.c @@ -46,7 +46,7 @@ static void RISCOS_VideoQuit(SDL_VideoDevice *_this); static void RISCOS_DeleteDevice(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -68,7 +68,7 @@ static SDL_VideoDevice *RISCOS_CreateDevice(void) return NULL; } - device->driverdata = data; + device->internal = data; /* Set the function pointers */ device->VideoInit = RISCOS_VideoInit; @@ -101,7 +101,7 @@ VideoBootStrap RISCOS_bootstrap = { static int RISCOS_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (RISCOS_InitEvents(_this) < 0) { return -1; diff --git a/src/video/riscos/SDL_riscoswindow.c b/src/video/riscos/SDL_riscoswindow.c index 182026270104d..eab2b3f0d6852 100644 --- a/src/video/riscos/SDL_riscoswindow.c +++ b/src/video/riscos/SDL_riscoswindow.c @@ -30,31 +30,27 @@ int RISCOS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { - SDL_WindowData *driverdata; + SDL_WindowData *data; - driverdata = (SDL_WindowData *)SDL_calloc(1, sizeof(*driverdata)); - if (!driverdata) { + data = (SDL_WindowData *)SDL_calloc(1, sizeof(*data)); + if (!data) { return -1; } - driverdata->window = window; + data->window = window; SDL_SetMouseFocus(window); /* All done! */ - window->driverdata = driverdata; + window->internal = data; return 0; } void RISCOS_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *driverdata = window->driverdata; - - if (!driverdata) { - return; + if (window->internal) { + SDL_free(window->internal); + window->internal = NULL; } - - SDL_free(driverdata); - window->driverdata = NULL; } #endif /* SDL_VIDEO_DRIVER_RISCOS */ diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index 9375c916aa01c..3ed941c7c368a 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -491,7 +491,7 @@ - (UIWindow *)window if (_this) { SDL_Window *window = NULL; for (window = _this->windows; window != NULL; window = window->next) { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; if (data != nil) { return data.uiwindow; } diff --git a/src/video/uikit/SDL_uikitclipboard.m b/src/video/uikit/SDL_uikitclipboard.m index e53e72c84f2c5..2c315f31468dc 100644 --- a/src/video/uikit/SDL_uikitclipboard.m +++ b/src/video/uikit/SDL_uikitclipboard.m @@ -73,7 +73,7 @@ void UIKit_InitClipboard(SDL_VideoDevice *_this) { #ifndef SDL_PLATFORM_TVOS @autoreleasepool { - SDL_UIKitVideoData *data = (__bridge SDL_UIKitVideoData *)_this->driverdata; + SDL_UIKitVideoData *data = (__bridge SDL_UIKitVideoData *)_this->internal; NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; id observer = [center addObserverForName:UIPasteboardChangedNotification @@ -91,7 +91,7 @@ void UIKit_InitClipboard(SDL_VideoDevice *_this) void UIKit_QuitClipboard(SDL_VideoDevice *_this) { @autoreleasepool { - SDL_UIKitVideoData *data = (__bridge SDL_UIKitVideoData *)_this->driverdata; + SDL_UIKitVideoData *data = (__bridge SDL_UIKitVideoData *)_this->internal; if (data.pasteboardObserver != nil) { [[NSNotificationCenter defaultCenter] removeObserver:data.pasteboardObserver]; diff --git a/src/video/uikit/SDL_uikitmessagebox.m b/src/video/uikit/SDL_uikitmessagebox.m index dfb9e4cb8989f..9364f82d7293f 100644 --- a/src/video/uikit/SDL_uikitmessagebox.m +++ b/src/video/uikit/SDL_uikitmessagebox.m @@ -93,7 +93,7 @@ static BOOL UIKit_ShowMessageBoxAlertController(const SDL_MessageBoxData *messag } if (messageboxdata->window) { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)messageboxdata->window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)messageboxdata->window->internal; window = data.uiwindow; } diff --git a/src/video/uikit/SDL_uikitmetalview.m b/src/video/uikit/SDL_uikitmetalview.m index ab7942143d911..a9c0a49d1707a 100644 --- a/src/video/uikit/SDL_uikitmetalview.m +++ b/src/video/uikit/SDL_uikitmetalview.m @@ -75,7 +75,7 @@ - (void)updateDrawableSize SDL_MetalView UIKit_Metal_CreateView(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; CGFloat scale = 1.0; SDL_uikitmetalview *metalview; diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index ba65650b261cf..50d6722016b67 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -114,7 +114,7 @@ static int UIKit_AllocateDisplayModeData(SDL_DisplayMode *mode, data.uiscreenmode = uiscreenmode; } - mode->driverdata = (void *)CFBridgingRetain(data); + mode->internal = (void *)CFBridgingRetain(data); return 0; } @@ -122,9 +122,9 @@ static int UIKit_AllocateDisplayModeData(SDL_DisplayMode *mode, static void UIKit_FreeDisplayModeData(SDL_DisplayMode *mode) { - if (mode->driverdata != NULL) { - CFRelease(mode->driverdata); - mode->driverdata = NULL; + if (mode->internal != NULL) { + CFRelease(mode->internal); + mode->internal = NULL; } } @@ -266,7 +266,7 @@ int UIKit_AddDisplay(UIScreen *uiscreen, SDL_bool send_event) return SDL_OutOfMemory(); } - display.driverdata = (SDL_DisplayData *)CFBridgingRetain(data); + display.internal = (SDL_DisplayData *)CFBridgingRetain(data); if (SDL_AddVideoDisplay(&display, send_event) == 0) { return -1; } @@ -298,7 +298,7 @@ int UIKit_AddDisplay(SDL_bool send_event){ return SDL_OutOfMemory(); } - display.driverdata = (SDL_DisplayData *)CFBridgingRetain(data); + display.internal = (SDL_DisplayData *)CFBridgingRetain(data); if (SDL_AddVideoDisplay(&display, send_event) == 0) { return -1; } @@ -317,11 +317,11 @@ void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event) if (displays) { for (i = 0; displays[i]; ++i) { SDL_VideoDisplay *display = SDL_GetVideoDisplay(displays[i]); - SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->internal; if (data && data.uiscreen == uiscreen) { - CFRelease(display->driverdata); - display->driverdata = NULL; + CFRelease(display->internal); + display->internal = NULL; SDL_DelVideoDisplay(displays[i], send_event); break; } @@ -372,7 +372,7 @@ int UIKit_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { #ifndef SDL_PLATFORM_VISIONOS @autoreleasepool { - SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->internal; SDL_bool isLandscape = UIKit_IsDisplayLandscape(data.uiscreen); SDL_bool addRotation = (data.uiscreen == [UIScreen mainScreen]); @@ -408,10 +408,10 @@ int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_ { #ifndef SDL_PLATFORM_VISIONOS @autoreleasepool { - SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->internal; #ifndef SDL_PLATFORM_TVOS - SDL_UIKitDisplayModeData *modedata = (__bridge SDL_UIKitDisplayModeData *)mode->driverdata; + SDL_UIKitDisplayModeData *modedata = (__bridge SDL_UIKitDisplayModeData *)mode->internal; [data.uiscreen setCurrentMode:modedata.uiscreenmode]; #endif @@ -437,7 +437,7 @@ int UIKit_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_ int UIKit_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { @autoreleasepool { - SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->internal; #ifdef SDL_PLATFORM_VISIONOS CGRect frame = CGRectMake(0, 0, SDL_XR_SCREENWIDTH, SDL_XR_SCREENHEIGHT); #else @@ -477,9 +477,9 @@ void UIKit_QuitModes(SDL_VideoDevice *_this) UIKit_FreeDisplayModeData(mode); } - if (display->driverdata != NULL) { - CFRelease(display->driverdata); - display->driverdata = NULL; + if (display->internal != NULL) { + CFRelease(display->internal); + display->internal = NULL; } } } diff --git a/src/video/uikit/SDL_uikitopengles.m b/src/video/uikit/SDL_uikitopengles.m index 1890a33e29c70..30a6e7c041c67 100644 --- a/src/video/uikit/SDL_uikitopengles.m +++ b/src/video/uikit/SDL_uikitopengles.m @@ -113,7 +113,7 @@ SDL_GLContext UIKit_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) @autoreleasepool { SDLEAGLContext *context = nil; SDL_uikitopenglview *view; - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; CGRect frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen); EAGLSharegroup *sharegroup = nil; CGFloat scale = 1.0; @@ -184,7 +184,7 @@ SDL_GLContext UIKit_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) return NULL; } - /* We return a +1'd context. The window's driverdata owns the view (via + /* We return a +1'd context. The window's internal owns the view (via * MakeCurrent.) */ return (SDL_GLContext)CFBridgingRetain(context); } diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 5b2af6f09a281..90866df1192f0 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -53,8 +53,8 @@ @implementation SDL_UIKitVideoData static void UIKit_DeleteDevice(SDL_VideoDevice *device) { @autoreleasepool { - if (device->driverdata){ - CFRelease(device->driverdata); + if (device->internal){ + CFRelease(device->internal); } SDL_free(device); } @@ -74,7 +74,7 @@ static void UIKit_DeleteDevice(SDL_VideoDevice *device) data = [SDL_UIKitVideoData new]; - device->driverdata = (SDL_VideoData *)CFBridgingRetain(data); + device->internal = (SDL_VideoData *)CFBridgingRetain(data); device->system_theme = UIKit_GetSystemTheme(); /* Set the function pointers */ @@ -212,7 +212,7 @@ CGRect UIKit_ComputeViewFrame(SDL_Window *window){ #else CGRect UIKit_ComputeViewFrame(SDL_Window *window, UIScreen *screen) { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; CGRect frame = screen.bounds; /* Use the UIWindow bounds instead of the UIScreen bounds, when possible. @@ -256,7 +256,7 @@ void UIKit_ForceUpdateHomeIndicator(void) /* Force the main SDL window to re-evaluate home indicator state */ SDL_Window *focus = SDL_GetKeyboardFocus(); if (focus) { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)focus->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)focus->internal; if (data != nil) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunguarded-availability-new" diff --git a/src/video/uikit/SDL_uikitview.m b/src/video/uikit/SDL_uikitview.m index ebae602fc3ec1..4f0c1f4d5c3c5 100644 --- a/src/video/uikit/SDL_uikitview.m +++ b/src/video/uikit/SDL_uikitview.m @@ -103,7 +103,7 @@ - (void)setSDLWindow:(SDL_Window *)window /* Remove ourself from the old window. */ if (sdlwindow) { SDL_uikitview *view = nil; - data = (__bridge SDL_UIKitWindowData *)sdlwindow->driverdata; + data = (__bridge SDL_UIKitWindowData *)sdlwindow->internal; [data.views removeObject:self]; @@ -122,7 +122,7 @@ - (void)setSDLWindow:(SDL_Window *)window /* Add ourself to the new window. */ if (window) { - data = (__bridge SDL_UIKitWindowData *)window->driverdata; + data = (__bridge SDL_UIKitWindowData *)window->internal; /* Make sure the SDL window has a strong reference to this view. */ [data.views addObject:self]; diff --git a/src/video/uikit/SDL_uikitviewcontroller.m b/src/video/uikit/SDL_uikitviewcontroller.m index 4b6cd845a830e..20a3aae0c01cd 100644 --- a/src/video/uikit/SDL_uikitviewcontroller.m +++ b/src/video/uikit/SDL_uikitviewcontroller.m @@ -165,7 +165,7 @@ - (void)startAnimation #ifdef SDL_PLATFORM_VISIONOS displayLink.preferredFramesPerSecond = 90 / animationInterval; //TODO: Get frame max frame rate on visionOS #elif defined(__IPHONE_10_3) - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; if ([displayLink respondsToSelector:@selector(preferredFramesPerSecond)] && data != nil && data.uiwindow != nil && [data.uiwindow.screen respondsToSelector:@selector(maximumFramesPerSecond)]) { displayLink.preferredFramesPerSecond = data.uiwindow.screen.maximumFramesPerSecond / animationInterval; @@ -511,7 +511,7 @@ - (void)textFieldTextDidChange:(NSNotification *)notification - (void)updateKeyboard { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *) window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *) window->internal; CGAffineTransform t = self.view.transform; CGPoint offset = CGPointMake(0.0, 0.0); @@ -581,12 +581,12 @@ - (BOOL)textFieldShouldReturn:(UITextField *)_textField static SDL_uikitviewcontroller *GetWindowViewController(SDL_Window *window) { - if (!window || !window->driverdata) { + if (!window || !window->internal) { SDL_SetError("Invalid window"); return nil; } - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; return data.viewcontroller; } diff --git a/src/video/uikit/SDL_uikitwindow.m b/src/video/uikit/SDL_uikitwindow.m index 740bd05e12158..d105e59051ccb 100644 --- a/src/video/uikit/SDL_uikitwindow.m +++ b/src/video/uikit/SDL_uikitwindow.m @@ -82,7 +82,7 @@ - (void)layoutSubviews static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow *uiwindow, SDL_bool created) { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_UIKitDisplayData *displaydata = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *displaydata = (__bridge SDL_UIKitDisplayData *)display->internal; SDL_uikitview *view; #ifdef SDL_PLATFORM_VISIONOS @@ -99,7 +99,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, UIWindow return SDL_OutOfMemory(); } - window->driverdata = (SDL_WindowData *)CFBridgingRetain(data); + window->internal = (SDL_WindowData *)CFBridgingRetain(data); data.uiwindow = uiwindow; @@ -156,7 +156,7 @@ int UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie { @autoreleasepool { SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *data = (__bridge SDL_UIKitDisplayData *)display->internal; SDL_Window *other; /* We currently only handle a single window per display on iOS */ @@ -179,7 +179,7 @@ int UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie } bestmode = SDL_GetClosestFullscreenDisplayMode(display->id, window->w, window->h, 0.0f, include_high_density_modes); if (bestmode) { - SDL_UIKitDisplayModeData *modedata = (__bridge SDL_UIKitDisplayModeData *)bestmode->driverdata; + SDL_UIKitDisplayModeData *modedata = (__bridge SDL_UIKitDisplayModeData *)bestmode->internal; [data.uiscreen setCurrentMode:modedata.uiscreenmode]; /* desktop_mode doesn't change here (the higher level will @@ -224,7 +224,7 @@ int UIKit_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie void UIKit_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; data.viewcontroller.title = @(window->title); } } @@ -232,12 +232,12 @@ void UIKit_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) void UIKit_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; [data.uiwindow makeKeyAndVisible]; /* Make this window the current mouse focus for touch input */ SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window); - SDL_UIKitDisplayData *displaydata = (__bridge SDL_UIKitDisplayData *)display->driverdata; + SDL_UIKitDisplayData *displaydata = (__bridge SDL_UIKitDisplayData *)display->internal; #ifndef SDL_PLATFORM_VISIONOS if (displaydata.uiscreen == [UIScreen mainScreen]) #endif @@ -251,7 +251,7 @@ void UIKit_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) void UIKit_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; data.uiwindow.hidden = YES; } } @@ -267,7 +267,7 @@ void UIKit_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) static void UIKit_UpdateWindowBorder(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; SDL_uikitviewcontroller *viewcontroller = data.viewcontroller; #if !defined(SDL_PLATFORM_TVOS) && !defined(SDL_PLATFORM_VISIONOS) @@ -320,7 +320,7 @@ void UIKit_UpdatePointerLock(SDL_VideoDevice *_this, SDL_Window *window) #ifndef SDL_PLATFORM_TVOS #if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_14_0 @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; SDL_uikitviewcontroller *viewcontroller = data.viewcontroller; if (@available(iOS 14.0, *)) { [viewcontroller setNeedsUpdateOfPrefersPointerLocked]; @@ -333,8 +333,8 @@ void UIKit_UpdatePointerLock(SDL_VideoDevice *_this, SDL_Window *window) void UIKit_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { @autoreleasepool { - if (window->driverdata != NULL) { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + if (window->internal != NULL) { + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; NSArray *views = nil; [data.viewcontroller stopAnimation]; @@ -354,8 +354,8 @@ void UIKit_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) data.uiwindow.rootViewController = nil; data.uiwindow.hidden = YES; - CFRelease(window->driverdata); - window->driverdata = NULL; + CFRelease(window->internal); + window->internal = NULL; } } } @@ -363,7 +363,7 @@ void UIKit_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { @autoreleasepool { - SDL_UIKitWindowData *windata = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *windata = (__bridge SDL_UIKitWindowData *)window->internal; UIView *view = windata.viewcontroller.view; CGSize size = view.bounds.size; CGFloat scale = 1.0; @@ -394,7 +394,7 @@ void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int NSUInteger orientationMask = 0; @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; UIApplication *app = [UIApplication sharedApplication]; /* Get all possible valid orientations. If the app delegate doesn't tell @@ -455,12 +455,12 @@ void UIKit_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int int SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam) { - if (!window || !window->driverdata) { + if (!window || !window->internal) { return SDL_SetError("Invalid window"); } @autoreleasepool { - SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->driverdata; + SDL_UIKitWindowData *data = (__bridge SDL_UIKitWindowData *)window->internal; [data.viewcontroller setAnimationCallback:interval callback:callback callbackParam:callbackParam]; diff --git a/src/video/vita/SDL_vitaframebuffer.c b/src/video/vita/SDL_vitaframebuffer.c index 872ede91d2624..5c4e5db5f2e97 100644 --- a/src/video/vita/SDL_vitaframebuffer.c +++ b/src/video/vita/SDL_vitaframebuffer.c @@ -65,7 +65,7 @@ void vita_gpu_free(SceUID uid) int VITA_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SceDisplayFrameBuf framebuf; *format = SDL_PIXELFORMAT_ABGR8888; @@ -101,7 +101,7 @@ int VITA_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, con void VITA_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (!data) { /* The window wasn't fully initialized */ diff --git a/src/video/vita/SDL_vitagl_pvr.c b/src/video/vita/SDL_vitagl_pvr.c index a35a94c63e0a3..4f3e7074cb431 100644 --- a/src/video/vita/SDL_vitagl_pvr.c +++ b/src/video/vita/SDL_vitagl_pvr.c @@ -93,7 +93,7 @@ SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) _this->gl_config.minor_version = 0; _this->gl_config.profile_mask = SDL_GL_CONTEXT_PROFILE_ES; - context = SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); + context = SDL_EGL_CreateContext(_this, window->internal->egl_surface); if (context != NULL) { FB_WIDTH = window->w; diff --git a/src/video/vita/SDL_vitagles.c b/src/video/vita/SDL_vitagles.c index da3b6fea33434..b68a267c9c592 100644 --- a/src/video/vita/SDL_vitagles.c +++ b/src/video/vita/SDL_vitagles.c @@ -80,7 +80,7 @@ static EGLint height = 544; SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wdata = window->driverdata; + SDL_WindowData *wdata = window->internal; EGLint attribs[32]; EGLDisplay display; @@ -193,7 +193,7 @@ int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) int VITA_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { - SDL_VideoData *phdata = _this->driverdata; + SDL_VideoData *phdata = _this->internal; EGLBoolean status; if (phdata->egl_initialized != SDL_TRUE) { diff --git a/src/video/vita/SDL_vitagles_pvr.c b/src/video/vita/SDL_vitagles_pvr.c index c79c29ccb7b1a..8e7b446141c34 100644 --- a/src/video/vita/SDL_vitagles_pvr.c +++ b/src/video/vita/SDL_vitagles_pvr.c @@ -69,13 +69,13 @@ int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); + return SDL_EGL_CreateContext(_this, window->internal->egl_surface); } int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { if (window && context) { - return SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context); + return SDL_EGL_MakeCurrent(_this, window->internal->egl_surface, context); } else { return SDL_EGL_MakeCurrent(_this, NULL, NULL); } @@ -83,11 +83,11 @@ int VITA_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLCont int VITA_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; if (videodata->ime_active) { sceImeUpdate(); } - return SDL_EGL_SwapBuffers(_this, window->driverdata->egl_surface); + return SDL_EGL_SwapBuffers(_this, window->internal->egl_surface); } #endif /* SDL_VIDEO_DRIVER_VITA && SDL_VIDEO_VITA_PVR */ diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c index 8a3d669f5838d..1ab7cf69dbdde 100644 --- a/src/video/vita/SDL_vitavideo.c +++ b/src/video/vita/SDL_vitavideo.c @@ -55,7 +55,7 @@ SDL_Window *Vita_Window; static void VITA_Destroy(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -91,7 +91,7 @@ static SDL_VideoDevice *VITA_Create() #endif phdata->ime_active = SDL_FALSE; - device->driverdata = phdata; + device->internal = phdata; /* Setup amount of available displays and current display */ device->num_displays = 0; @@ -234,7 +234,7 @@ int VITA_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properties } /* Setup driver data for this window */ - window->driverdata = wdata; + window->internal = wdata; // Vita can only have one window if (Vita_Window) { @@ -328,13 +328,13 @@ void VITA_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { SDL_WindowData *data; - data = window->driverdata; + data = window->internal; if (data) { // TODO: should we destroy egl context? No one sane should recreate ogl window as non-ogl SDL_free(data); } - window->driverdata = NULL; + window->internal = NULL; Vita_Window = NULL; } @@ -413,7 +413,7 @@ void VITA_ImeEventHandler(void *arg, const SceImeEventData *e) void VITA_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SceInt32 res; #ifdef SDL_VIDEO_VITA_PVR @@ -475,7 +475,7 @@ void VITA_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) void VITA_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { #ifndef SDL_VIDEO_VITA_PVR - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SceCommonDialogStatus dialogStatus = sceImeDialogGetStatus(); @@ -496,7 +496,7 @@ void VITA_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) SDL_bool VITA_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_VITA_PVR - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; return videodata->ime_active; #else SceCommonDialogStatus dialogStatus = sceImeDialogGetStatus(); @@ -507,7 +507,7 @@ SDL_bool VITA_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) void VITA_PumpEvents(SDL_VideoDevice *_this) { #ifndef SDL_VIDEO_VITA_PVR - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; #endif if (_this->suspend_screensaver) { diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c index ed27b27277d8a..f78753ed939f7 100644 --- a/src/video/vivante/SDL_vivantevideo.c +++ b/src/video/vivante/SDL_vivantevideo.c @@ -37,7 +37,7 @@ static void VIVANTE_Destroy(SDL_VideoDevice *device) { - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); } @@ -59,7 +59,7 @@ static SDL_VideoDevice *VIVANTE_Create() return NULL; } - device->driverdata = data; + device->internal = data; /* Setup amount of available displays */ device->num_displays = 0; @@ -116,7 +116,7 @@ VideoBootStrap VIVANTE_bootstrap = { static int VIVANTE_AddVideoDisplays(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_VideoDisplay display; SDL_DisplayMode mode; SDL_DisplayData *data; @@ -156,7 +156,7 @@ static int VIVANTE_AddVideoDisplays(SDL_VideoDevice *_this) SDL_zero(display); display.name = VIVANTE_GetDisplayName(_this); display.desktop_mode = mode; - display.driverdata = data; + display.internal = data; if (SDL_AddVideoDisplay(&display, SDL_FALSE) == 0) { return -1; } @@ -165,7 +165,7 @@ static int VIVANTE_AddVideoDisplays(SDL_VideoDevice *_this) int VIVANTE_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK videodata->vdk_private = vdkInitialize(); @@ -217,7 +217,7 @@ int VIVANTE_VideoInit(SDL_VideoDevice *_this) void VIVANTE_VideoQuit(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; #ifdef SDL_INPUT_LINUXEV SDL_EVDEV_Quit(); @@ -240,7 +240,7 @@ void VIVANTE_VideoQuit(SDL_VideoDevice *_this) int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_DisplayData *displaydata; SDL_WindowData *data; @@ -253,7 +253,7 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert } /* Setup driver data for this window */ - window->driverdata = data; + window->internal = data; SDL_PropertiesID props = SDL_GetWindowProperties(window); SDL_SetPointerProperty(props, SDL_PROP_WINDOW_VIVANTE_DISPLAY_POINTER, displaydata->native_display); @@ -286,10 +286,10 @@ int VIVANTE_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert void VIVANTE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_WindowData *data; - data = window->driverdata; + data = window->internal; if (data) { #ifdef SDL_VIDEO_OPENGL_EGL if (data->egl_surface != EGL_NO_SURFACE) { @@ -307,13 +307,13 @@ void VIVANTE_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) SDL_free(data); } - window->driverdata = NULL; + window->internal = NULL; } void VIVANTE_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; vdkSetWindowTitle(data->native_window, window->title); #endif } @@ -332,7 +332,7 @@ void VIVANTE_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) void VIVANTE_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; vdkShowWindow(data->native_window); #endif SDL_SetMouseFocus(window); @@ -342,7 +342,7 @@ void VIVANTE_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) void VIVANTE_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_VIVANTE_VDK - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; vdkHideWindow(data->native_window); #endif SDL_SetMouseFocus(NULL); diff --git a/src/video/wayland/SDL_waylandclipboard.c b/src/video/wayland/SDL_waylandclipboard.c index c3e23b7808c97..b156fa6d5be2a 100644 --- a/src/video/wayland/SDL_waylandclipboard.c +++ b/src/video/wayland/SDL_waylandclipboard.c @@ -31,7 +31,7 @@ int Wayland_SetClipboardData(SDL_VideoDevice *_this) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; SDL_WaylandDataDevice *data_device = NULL; int status = 0; @@ -56,7 +56,7 @@ int Wayland_SetClipboardData(SDL_VideoDevice *_this) void *Wayland_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, size_t *length) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; SDL_WaylandDataDevice *data_device = NULL; void *buffer = NULL; @@ -74,7 +74,7 @@ void *Wayland_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, si SDL_bool Wayland_HasClipboardData(SDL_VideoDevice *_this, const char *mime_type) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; SDL_WaylandDataDevice *data_device = NULL; SDL_bool result = SDL_FALSE; @@ -105,7 +105,7 @@ const char **Wayland_GetTextMimeTypes(SDL_VideoDevice *_this, size_t *num_mime_t int Wayland_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; int status = -1; @@ -132,7 +132,7 @@ int Wayland_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text) char *Wayland_GetPrimarySelectionText(SDL_VideoDevice *_this) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; char *text = NULL; size_t length = 0; @@ -155,7 +155,7 @@ char *Wayland_GetPrimarySelectionText(SDL_VideoDevice *_this) SDL_bool Wayland_HasPrimarySelectionText(SDL_VideoDevice *_this) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; SDL_WaylandPrimarySelectionDevice *primary_selection_device = NULL; SDL_bool result = SDL_FALSE; diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 5b8f76f3c523b..7ce9b7cb32405 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -346,7 +346,7 @@ static struct wl_callback_listener sync_listener = { void Wayland_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *d = _this->driverdata; + SDL_VideoData *d = _this->internal; /* Queue a sync event to unblock the event queue fd if it's empty and being waited on. * TODO: Maybe use a pipe to avoid the compositor roundtrip? @@ -376,7 +376,7 @@ static int dispatch_queued_events(SDL_VideoData *viddata) int Wayland_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) { - SDL_VideoData *d = _this->driverdata; + SDL_VideoData *d = _this->internal; struct SDL_WaylandInput *input = d->input; SDL_bool key_repeat_active = SDL_FALSE; @@ -452,7 +452,7 @@ int Wayland_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) void Wayland_PumpEvents(SDL_VideoDevice *_this) { - SDL_VideoData *d = _this->driverdata; + SDL_VideoData *d = _this->internal; struct SDL_WaylandInput *input = d->input; int err; @@ -1893,10 +1893,10 @@ SDL_WaylandDataSource *Wayland_data_source_create(SDL_VideoDevice *_this) SDL_VideoData *driver_data = NULL; struct wl_data_source *id = NULL; - if (!_this || !_this->driverdata) { + if (!_this || !_this->internal) { SDL_SetError("Video driver uninitialized"); } else { - driver_data = _this->driverdata; + driver_data = _this->internal; if (driver_data->data_device_manager) { id = wl_data_device_manager_create_data_source( @@ -1926,10 +1926,10 @@ SDL_WaylandPrimarySelectionSource *Wayland_primary_selection_source_create(SDL_V SDL_VideoData *driver_data = NULL; struct zwp_primary_selection_source_v1 *id = NULL; - if (!_this || !_this->driverdata) { + if (!_this || !_this->internal) { SDL_SetError("Video driver uninitialized"); } else { - driver_data = _this->driverdata; + driver_data = _this->internal; if (driver_data->primary_selection_device_manager) { id = zwp_primary_selection_device_manager_v1_create_source( @@ -3129,7 +3129,7 @@ static const struct zwp_locked_pointer_v1_listener locked_pointer_listener = { int Wayland_input_lock_pointer(struct SDL_WaylandInput *input, SDL_Window *window) { - SDL_WindowData *w = window->driverdata; + SDL_WindowData *w = window->internal; SDL_VideoData *d = input->display; if (!d->pointer_constraints || !input->pointer) { @@ -3157,7 +3157,7 @@ int Wayland_input_lock_pointer(struct SDL_WaylandInput *input, SDL_Window *windo int Wayland_input_unlock_pointer(struct SDL_WaylandInput *input, SDL_Window *window) { - SDL_WindowData *w = window->driverdata; + SDL_WindowData *w = window->internal; if (w->locked_pointer) { zwp_locked_pointer_v1_destroy(w->locked_pointer); @@ -3172,7 +3172,7 @@ int Wayland_input_unlock_pointer(struct SDL_WaylandInput *input, SDL_Window *win static void pointer_confine_destroy(SDL_Window *window) { - SDL_WindowData *w = window->driverdata; + SDL_WindowData *w = window->internal; if (w->confined_pointer) { zwp_confined_pointer_v1_destroy(w->confined_pointer); w->confined_pointer = NULL; @@ -3263,7 +3263,7 @@ static const struct zwp_confined_pointer_v1_listener confined_pointer_listener = int Wayland_input_confine_pointer(struct SDL_WaylandInput *input, SDL_Window *window) { - SDL_WindowData *w = window->driverdata; + SDL_WindowData *w = window->internal; SDL_VideoData *d = input->display; struct zwp_confined_pointer_v1 *confined_pointer; struct wl_region *confine_rect; @@ -3337,7 +3337,7 @@ int Wayland_input_unconfine_pointer(struct SDL_WaylandInput *input, SDL_Window * int Wayland_input_grab_keyboard(SDL_Window *window, struct SDL_WaylandInput *input) { - SDL_WindowData *w = window->driverdata; + SDL_WindowData *w = window->internal; SDL_VideoData *d = input->display; if (!d->key_inhibitor_manager) { @@ -3358,7 +3358,7 @@ int Wayland_input_grab_keyboard(SDL_Window *window, struct SDL_WaylandInput *inp int Wayland_input_ungrab_keyboard(SDL_Window *window) { - SDL_WindowData *w = window->driverdata; + SDL_WindowData *w = window->internal; if (w->key_inhibitor) { zwp_keyboard_shortcuts_inhibitor_v1_destroy(w->key_inhibitor); diff --git a/src/video/wayland/SDL_waylandkeyboard.c b/src/video/wayland/SDL_waylandkeyboard.c index 7f8d55e60a8f2..854197e9c4398 100644 --- a/src/video/wayland/SDL_waylandkeyboard.c +++ b/src/video/wayland/SDL_waylandkeyboard.c @@ -31,8 +31,8 @@ int Wayland_InitKeyboard(SDL_VideoDevice *_this) { #ifdef SDL_USE_IME - SDL_VideoData *driverdata = _this->driverdata; - if (!driverdata->text_input_manager) { + SDL_VideoData *internal = _this->internal; + if (!internal->text_input_manager) { SDL_IME_Init(); } #endif @@ -44,8 +44,8 @@ int Wayland_InitKeyboard(SDL_VideoDevice *_this) void Wayland_QuitKeyboard(SDL_VideoDevice *_this) { #ifdef SDL_USE_IME - SDL_VideoData *driverdata = _this->driverdata; - if (!driverdata->text_input_manager) { + SDL_VideoData *internal = _this->internal; + if (!internal->text_input_manager) { SDL_IME_Quit(); } #endif @@ -53,10 +53,10 @@ void Wayland_QuitKeyboard(SDL_VideoDevice *_this) int Wayland_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *driverdata = _this->driverdata; - struct SDL_WaylandInput *input = driverdata->input; + SDL_VideoData *internal = _this->internal; + struct SDL_WaylandInput *input = internal->input; - if (driverdata->text_input_manager) { + if (internal->text_input_manager) { if (input && input->text_input) { const SDL_Rect *rect = &input->text_input->cursor_rect; @@ -88,10 +88,10 @@ int Wayland_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *driverdata = _this->driverdata; - struct SDL_WaylandInput *input = driverdata->input; + SDL_VideoData *internal = _this->internal; + struct SDL_WaylandInput *input = internal->input; - if (driverdata->text_input_manager) { + if (internal->text_input_manager) { if (input && input->text_input) { zwp_text_input_v3_disable(input->text_input->text_input); zwp_text_input_v3_commit(input->text_input->text_input); @@ -112,9 +112,9 @@ int Wayland_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *driverdata = _this->driverdata; - if (driverdata->text_input_manager) { - struct SDL_WaylandInput *input = driverdata->input; + SDL_VideoData *internal = _this->internal; + if (internal->text_input_manager) { + struct SDL_WaylandInput *input = internal->input; if (input && input->text_input) { if (!SDL_RectsEqual(&window->text_input_rect, &input->text_input->cursor_rect)) { SDL_copyp(&input->text_input->cursor_rect, &window->text_input_rect); @@ -142,9 +142,9 @@ SDL_bool Wayland_HasScreenKeyboardSupport(SDL_VideoDevice *_this) * _only_ way to get text input. So, in addition to checking for the text * input protocol, make sure we don't have any physical keyboards either. */ - SDL_VideoData *driverdata = _this->driverdata; - SDL_bool haskeyboard = (driverdata->input != NULL) && (driverdata->input->keyboard != NULL); - SDL_bool hastextmanager = (driverdata->text_input_manager != NULL); + SDL_VideoData *internal = _this->internal; + SDL_bool haskeyboard = (internal->input != NULL) && (internal->input->keyboard != NULL); + SDL_bool hastextmanager = (internal->text_input_manager != NULL); return !haskeyboard && hastextmanager; } diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index bdbb95e156eb9..b2f40d79dc51a 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -346,7 +346,7 @@ static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, struct Wayland_C /* Nothing to see here, bail. */ return SDL_FALSE; } - focusdata = focus->driverdata; + focusdata = focus->internal; /* Cursors use integer scaling. */ *scale = SDL_ceilf(focusdata->windowed_scale_factor); @@ -423,17 +423,17 @@ static SDL_Cursor *Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot SDL_Cursor *cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *wd = vd->driverdata; + SDL_VideoData *wd = vd->internal; struct Wayland_CursorData *data = SDL_calloc(1, sizeof(struct Wayland_CursorData)); if (!data) { SDL_free(cursor); return NULL; } - cursor->driverdata = (void *)data; + cursor->internal = (void *)data; /* Allocate shared memory buffer for this cursor */ if (Wayland_AllocSHMBuffer(surface->w, surface->h, &data->cursor_data.custom) != 0) { - SDL_free(cursor->driverdata); + SDL_free(cursor->internal); SDL_free(cursor); return NULL; } @@ -457,7 +457,7 @@ static SDL_Cursor *Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot static SDL_Cursor *Wayland_CreateSystemCursor(SDL_SystemCursor id) { - SDL_VideoData *data = SDL_GetVideoDevice()->driverdata; + SDL_VideoData *data = SDL_GetVideoDevice()->internal; SDL_Cursor *cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { struct Wayland_CursorData *cdata = SDL_calloc(1, sizeof(struct Wayland_CursorData)); @@ -465,7 +465,7 @@ static SDL_Cursor *Wayland_CreateSystemCursor(SDL_SystemCursor id) SDL_free(cursor); return NULL; } - cursor->driverdata = (void *)cdata; + cursor->internal = (void *)cdata; /* The surface is only necessary if the cursor shape manager is not present. * @@ -514,13 +514,13 @@ static void Wayland_FreeCursor(SDL_Cursor *cursor) } /* Probably not a cursor we own */ - if (!cursor->driverdata) { + if (!cursor->internal) { return; } - Wayland_FreeCursorData((struct Wayland_CursorData *)cursor->driverdata); + Wayland_FreeCursorData((struct Wayland_CursorData *)cursor->internal); - SDL_free(cursor->driverdata); + SDL_free(cursor->internal); SDL_free(cursor); } @@ -600,7 +600,7 @@ static void Wayland_SetSystemCursorShape(struct SDL_WaylandInput *input, SDL_Sys static int Wayland_ShowCursor(SDL_Cursor *cursor) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *d = vd->driverdata; + SDL_VideoData *d = vd->internal; struct SDL_WaylandInput *input = d->input; struct wl_pointer *pointer = d->pointer; float scale = 1.0f; @@ -617,7 +617,7 @@ static int Wayland_ShowCursor(SDL_Cursor *cursor) } if (cursor) { - struct Wayland_CursorData *data = cursor->driverdata; + struct Wayland_CursorData *data = cursor->internal; /* TODO: High-DPI custom cursors? -flibit */ if (data->is_system_cursor) { @@ -684,8 +684,8 @@ static int Wayland_ShowCursor(SDL_Cursor *cursor) static int Wayland_WarpMouse(SDL_Window *window, float x, float y) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *d = vd->driverdata; - SDL_WindowData *wind = window->driverdata; + SDL_VideoData *d = vd->internal; + SDL_WindowData *wind = window->internal; struct SDL_WaylandInput *input = d->input; if (input->cursor_visible || (input->warp_emulation_prohibited && !d->relative_mouse_mode)) { @@ -730,7 +730,7 @@ static int Wayland_WarpMouse(SDL_Window *window, float x, float y) static int Wayland_WarpMouseGlobal(float x, float y) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *d = vd->driverdata; + SDL_VideoData *d = vd->internal; struct SDL_WaylandInput *input = d->input; SDL_WindowData *wind = input->pointer_focus; @@ -746,7 +746,7 @@ static int Wayland_WarpMouseGlobal(float x, float y) static int Wayland_SetRelativeMouseMode(SDL_bool enabled) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *data = vd->driverdata; + SDL_VideoData *data = vd->internal; if (enabled) { /* Disable mouse warp emulation if it's enabled. */ @@ -804,7 +804,7 @@ static SDL_MouseButtonFlags SDLCALL Wayland_GetGlobalMouseState(float *x, float #if 0 /* TODO RECONNECT: See waylandvideo.c for more information! */ static void Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata) { - Wayland_CursorData *cdata = (Wayland_CursorData *) cursor->driverdata; + Wayland_CursorData *cdata = (Wayland_CursorData *) cursor->internal; /* Probably not a cursor we own */ if (cdata == NULL) { @@ -830,7 +830,7 @@ void Wayland_RecreateCursors(void) { SDL_Cursor *cursor; SDL_Mouse *mouse = SDL_GetMouse(); - SDL_VideoData *vdata = SDL_GetVideoDevice()->driverdata; + SDL_VideoData *vdata = SDL_GetVideoDevice()->internal; if (vdata && vdata->cursor_themes) { SDL_free(vdata->cursor_themes); @@ -861,7 +861,7 @@ void Wayland_InitMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *d = vd->driverdata; + SDL_VideoData *d = vd->internal; struct SDL_WaylandInput *input = d->input; mouse->CreateCursor = Wayland_CreateCursor; diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c index c5a3f9dd0aef3..6ee1851ba0612 100644 --- a/src/video/wayland/SDL_waylandopengles.c +++ b/src/video/wayland/SDL_waylandopengles.c @@ -37,7 +37,7 @@ int Wayland_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { int ret; - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; ret = SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)data->display, _this->gl_config.egl_platform); @@ -50,8 +50,8 @@ int Wayland_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) SDL_GLContext Wayland_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; - context = SDL_EGL_CreateContext(_this, window->driverdata->egl_surface); - WAYLAND_wl_display_flush(_this->driverdata->display); + context = SDL_EGL_CreateContext(_this, window->internal->egl_surface); + WAYLAND_wl_display_flush(_this->internal->display); return context; } @@ -104,7 +104,7 @@ int Wayland_GLES_GetSwapInterval(SDL_VideoDevice *_this, int *interval) int Wayland_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; const int swap_interval = _this->egl_data->egl_swapinterval; /* For windows that we know are hidden, skip swaps entirely, if we don't do @@ -122,7 +122,7 @@ int Wayland_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) /* Control swap interval ourselves. See comments on Wayland_GLES_SetSwapInterval */ if (swap_interval != 0 && data->surface_status == WAYLAND_SURFACE_STATUS_SHOWN) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; struct wl_display *display = videodata->display; /* 20hz, so we'll progress even if throttled to zero. */ const Uint64 max_wait = SDL_GetTicksNS() + (SDL_NS_PER_SECOND / 20); @@ -176,12 +176,12 @@ int Wayland_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLC int ret; if (window && context) { - ret = SDL_EGL_MakeCurrent(_this, window->driverdata->egl_surface, context); + ret = SDL_EGL_MakeCurrent(_this, window->internal->egl_surface, context); } else { ret = SDL_EGL_MakeCurrent(_this, NULL, NULL); } - WAYLAND_wl_display_flush(_this->driverdata->display); + WAYLAND_wl_display_flush(_this->internal->display); _this->egl_data->eglSwapInterval(_this->egl_data->egl_display, 0); /* see comments on Wayland_GLES_SetSwapInterval. */ @@ -191,13 +191,13 @@ int Wayland_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLC int Wayland_GLES_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { SDL_EGL_DeleteContext(_this, context); - WAYLAND_wl_display_flush(_this->driverdata->display); + WAYLAND_wl_display_flush(_this->internal->display); return 0; } EGLSurface Wayland_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *windowdata = window->driverdata; + SDL_WindowData *windowdata = window->internal; return windowdata->egl_surface; } diff --git a/src/video/wayland/SDL_waylandshmbuffer.c b/src/video/wayland/SDL_waylandshmbuffer.c index 76d2cf3567633..42666e8045083 100644 --- a/src/video/wayland/SDL_waylandshmbuffer.c +++ b/src/video/wayland/SDL_waylandshmbuffer.c @@ -117,7 +117,7 @@ static struct wl_buffer_listener buffer_listener = { int Wayland_AllocSHMBuffer(int width, int height, struct Wayland_SHMBuffer *shmBuffer) { SDL_VideoDevice *vd = SDL_GetVideoDevice(); - SDL_VideoData *data = vd->driverdata; + SDL_VideoData *data = vd->internal; struct wl_shm_pool *shm_pool; const Uint32 SHM_FMT = WL_SHM_FORMAT_ARGB8888; diff --git a/src/video/wayland/SDL_waylandvideo.c b/src/video/wayland/SDL_waylandvideo.c index 62fe87036a497..db0d40a7a7be6 100644 --- a/src/video/wayland/SDL_waylandvideo.c +++ b/src/video/wayland/SDL_waylandvideo.c @@ -358,7 +358,7 @@ SDL_WindowData *Wayland_GetWindowDataForOwnedSurface(struct wl_surface *surface) static void Wayland_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *data = device->driverdata; + SDL_VideoData *data = device->internal; if (data->display && !data->display_externally_owned) { WAYLAND_wl_display_flush(data->display); WAYLAND_wl_display_disconnect(data->display); @@ -445,7 +445,7 @@ static SDL_VideoDevice *Wayland_CreateDevice(void) SDL_PROP_GLOBAL_VIDEO_WAYLAND_WL_DISPLAY_POINTER, display); } - device->driverdata = data; + device->internal = data; device->wakeup_lock = SDL_CreateMutex(); /* Set the function pointers */ @@ -543,60 +543,60 @@ VideoBootStrap Wayland_bootstrap = { static void xdg_output_handle_logical_position(void *data, struct zxdg_output_v1 *xdg_output, int32_t x, int32_t y) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; - driverdata->x = x; - driverdata->y = y; - driverdata->has_logical_position = SDL_TRUE; + internal->x = x; + internal->y = y; + internal->has_logical_position = SDL_TRUE; } static void xdg_output_handle_logical_size(void *data, struct zxdg_output_v1 *xdg_output, int32_t width, int32_t height) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; - driverdata->screen_width = width; - driverdata->screen_height = height; - driverdata->has_logical_size = SDL_TRUE; + internal->screen_width = width; + internal->screen_height = height; + internal->has_logical_size = SDL_TRUE; } static void xdg_output_handle_done(void *data, struct zxdg_output_v1 *xdg_output) { - SDL_DisplayData *driverdata = (void *)data; + SDL_DisplayData *internal = (void *)data; /* * xdg-output.done events are deprecated and only apply below version 3 of the protocol. * A wl-output.done event will be emitted in version 3 or higher. */ - if (zxdg_output_v1_get_version(driverdata->xdg_output) < 3) { - display_handle_done(data, driverdata->output); + if (zxdg_output_v1_get_version(internal->xdg_output) < 3) { + display_handle_done(data, internal->output); } } static void xdg_output_handle_name(void *data, struct zxdg_output_v1 *xdg_output, const char *name) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; /* Deprecated as of wl_output v4. */ - if (wl_output_get_version(driverdata->output) < WL_OUTPUT_NAME_SINCE_VERSION && - driverdata->display == 0) { - SDL_free(driverdata->wl_output_name); - driverdata->wl_output_name = SDL_strdup(name); + if (wl_output_get_version(internal->output) < WL_OUTPUT_NAME_SINCE_VERSION && + internal->display == 0) { + SDL_free(internal->wl_output_name); + internal->wl_output_name = SDL_strdup(name); } } static void xdg_output_handle_description(void *data, struct zxdg_output_v1 *xdg_output, const char *description) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; /* Deprecated as of wl_output v4. */ - if (wl_output_get_version(driverdata->output) < WL_OUTPUT_DESCRIPTION_SINCE_VERSION && - driverdata->display == 0) { + if (wl_output_get_version(internal->output) < WL_OUTPUT_DESCRIPTION_SINCE_VERSION && + internal->display == 0) { /* xdg-output descriptions, if available, supersede wl-output model names. */ - SDL_free(driverdata->placeholder.name); - driverdata->placeholder.name = SDL_strdup(description); + SDL_free(internal->placeholder.name); + internal->placeholder.name = SDL_strdup(description); } } @@ -697,27 +697,27 @@ static void display_handle_geometry(void *data, int transform) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; /* Apply the change from wl-output only if xdg-output is not supported */ - if (!driverdata->has_logical_position) { - driverdata->x = x; - driverdata->y = y; + if (!internal->has_logical_position) { + internal->x = x; + internal->y = y; } - driverdata->physical_width = physical_width; - driverdata->physical_height = physical_height; + internal->physical_width = physical_width; + internal->physical_height = physical_height; /* The model is only used for the output name if wl_output or xdg-output haven't provided a description. */ - if (driverdata->display == 0 && !driverdata->placeholder.name) { - driverdata->placeholder.name = SDL_strdup(model); + if (internal->display == 0 && !internal->placeholder.name) { + internal->placeholder.name = SDL_strdup(model); } - driverdata->transform = transform; + internal->transform = transform; #define TF_CASE(in, out) \ case WL_OUTPUT_TRANSFORM_##in: \ - driverdata->orientation = SDL_ORIENTATION_##out; \ + internal->orientation = SDL_ORIENTATION_##out; \ break; - if (driverdata->physical_width >= driverdata->physical_height) { + if (internal->physical_width >= internal->physical_height) { switch (transform) { TF_CASE(NORMAL, LANDSCAPE) TF_CASE(90, PORTRAIT) @@ -750,22 +750,22 @@ static void display_handle_mode(void *data, int height, int refresh) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; if (flags & WL_OUTPUT_MODE_CURRENT) { - driverdata->pixel_width = width; - driverdata->pixel_height = height; + internal->pixel_width = width; + internal->pixel_height = height; /* * Don't rotate this yet, wl-output coordinates are transformed in * handle_done and xdg-output coordinates are pre-transformed. */ - if (!driverdata->has_logical_size) { - driverdata->screen_width = width; - driverdata->screen_height = height; + if (!internal->has_logical_size) { + internal->screen_width = width; + internal->screen_height = height; } - driverdata->refresh = refresh; + internal->refresh = refresh; } } @@ -773,8 +773,8 @@ static void display_handle_done(void *data, struct wl_output *output) { const SDL_bool mode_emulation_enabled = SDL_GetHintBoolean(SDL_HINT_VIDEO_WAYLAND_MODE_EMULATION, SDL_TRUE); - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; - SDL_VideoData *video = driverdata->videodata; + SDL_DisplayData *internal = (SDL_DisplayData *)data; + SDL_VideoData *video = internal->videodata; SDL_DisplayMode native_mode, desktop_mode; SDL_VideoDisplay *dpy; @@ -784,16 +784,16 @@ static void display_handle_done(void *data, * * All required events must be received before proceeding. */ - const int event_await_count = 1 + (driverdata->xdg_output != NULL); + const int event_await_count = 1 + (internal->xdg_output != NULL); - driverdata->wl_output_done_count = SDL_min(driverdata->wl_output_done_count + 1, event_await_count + 1); + internal->wl_output_done_count = SDL_min(internal->wl_output_done_count + 1, event_await_count + 1); - if (driverdata->wl_output_done_count < event_await_count) { + if (internal->wl_output_done_count < event_await_count) { return; } /* If the display was already created, reset and rebuild the mode list. */ - dpy = SDL_GetVideoDisplay(driverdata->display); + dpy = SDL_GetVideoDisplay(internal->display); if (dpy) { SDL_ResetFullscreenDisplayModes(dpy); } @@ -803,40 +803,40 @@ static void display_handle_done(void *data, native_mode.format = SDL_PIXELFORMAT_XRGB8888; /* Transform the pixel values, if necessary. */ - if (driverdata->transform & WL_OUTPUT_TRANSFORM_90) { - native_mode.w = driverdata->pixel_height; - native_mode.h = driverdata->pixel_width; + if (internal->transform & WL_OUTPUT_TRANSFORM_90) { + native_mode.w = internal->pixel_height; + native_mode.h = internal->pixel_width; } else { - native_mode.w = driverdata->pixel_width; - native_mode.h = driverdata->pixel_height; + native_mode.w = internal->pixel_width; + native_mode.h = internal->pixel_height; } - native_mode.refresh_rate_numerator = driverdata->refresh; + native_mode.refresh_rate_numerator = internal->refresh; native_mode.refresh_rate_denominator = 1000; - if (driverdata->has_logical_size) { /* If xdg-output is present... */ - if (native_mode.w != driverdata->screen_width || native_mode.h != driverdata->screen_height) { + if (internal->has_logical_size) { /* If xdg-output is present... */ + if (native_mode.w != internal->screen_width || native_mode.h != internal->screen_height) { /* ...and the compositor scales the logical viewport... */ if (video->viewporter) { /* ...and viewports are supported, calculate the true scale of the output. */ - driverdata->scale_factor = (float)native_mode.w / (float)driverdata->screen_width; + internal->scale_factor = (float)native_mode.w / (float)internal->screen_width; } else { /* ...otherwise, the 'native' pixel values are a multiple of the logical screen size. */ - driverdata->pixel_width = driverdata->screen_width * (int)driverdata->scale_factor; - driverdata->pixel_height = driverdata->screen_height * (int)driverdata->scale_factor; + internal->pixel_width = internal->screen_width * (int)internal->scale_factor; + internal->pixel_height = internal->screen_height * (int)internal->scale_factor; } } else { /* ...and the output viewport is not scaled in the global compositing * space, the output dimensions need to be divided by the scale factor. */ - driverdata->screen_width /= (int)driverdata->scale_factor; - driverdata->screen_height /= (int)driverdata->scale_factor; + internal->screen_width /= (int)internal->scale_factor; + internal->screen_height /= (int)internal->scale_factor; } } else { /* Calculate the points from the pixel values, if xdg-output isn't present. * Use the native mode pixel values since they are pre-transformed. */ - driverdata->screen_width = native_mode.w / (int)driverdata->scale_factor; - driverdata->screen_height = native_mode.h / (int)driverdata->scale_factor; + internal->screen_width = native_mode.w / (int)internal->scale_factor; + internal->screen_height = native_mode.h / (int)internal->scale_factor; } /* The scaled desktop mode */ @@ -844,33 +844,33 @@ static void display_handle_done(void *data, desktop_mode.format = SDL_PIXELFORMAT_XRGB8888; if (!video->scale_to_display_enabled) { - desktop_mode.w = driverdata->screen_width; - desktop_mode.h = driverdata->screen_height; - desktop_mode.pixel_density = driverdata->scale_factor; + desktop_mode.w = internal->screen_width; + desktop_mode.h = internal->screen_height; + desktop_mode.pixel_density = internal->scale_factor; } else { desktop_mode.w = native_mode.w; desktop_mode.h = native_mode.h; desktop_mode.pixel_density = 1.0f; } - desktop_mode.refresh_rate_numerator = driverdata->refresh; + desktop_mode.refresh_rate_numerator = internal->refresh; desktop_mode.refresh_rate_denominator = 1000; - if (driverdata->display > 0) { - dpy = SDL_GetVideoDisplay(driverdata->display); + if (internal->display > 0) { + dpy = SDL_GetVideoDisplay(internal->display); } else { - dpy = &driverdata->placeholder; + dpy = &internal->placeholder; } if (video->scale_to_display_enabled) { - SDL_SetDisplayContentScale(dpy, driverdata->scale_factor); + SDL_SetDisplayContentScale(dpy, internal->scale_factor); } /* Set the desktop display mode. */ SDL_SetDesktopDisplayMode(dpy, &desktop_mode); /* Expose the unscaled, native resolution if the scale is 1.0 or viewports are available... */ - if (driverdata->scale_factor == 1.0f || video->viewporter) { + if (internal->scale_factor == 1.0f || video->viewporter) { SDL_AddFullscreenDisplayMode(dpy, &native_mode); } else { /* ...otherwise expose the integer scaled variants of the desktop resolution down to 1. */ @@ -878,9 +878,9 @@ static void display_handle_done(void *data, desktop_mode.pixel_density = 1.0f; - for (i = (int)driverdata->scale_factor; i > 0; --i) { - desktop_mode.w = driverdata->screen_width * i; - desktop_mode.h = driverdata->screen_height * i; + for (i = (int)internal->scale_factor; i > 0; --i) { + desktop_mode.w = internal->screen_width * i; + desktop_mode.h = internal->screen_height * i; SDL_AddFullscreenDisplayMode(dpy, &desktop_mode); } } @@ -888,27 +888,27 @@ static void display_handle_done(void *data, /* Add emulated modes if wp_viewporter is supported and mode emulation is enabled. */ if (video->viewporter && mode_emulation_enabled) { /* The transformed display pixel width/height must be used here. */ - AddEmulatedModes(driverdata, native_mode.w, native_mode.h); + AddEmulatedModes(internal, native_mode.w, native_mode.h); } - if (driverdata->display == 0) { + if (internal->display == 0) { /* First time getting display info, initialize the VideoDisplay */ - if (driverdata->physical_width >= driverdata->physical_height) { - driverdata->placeholder.natural_orientation = SDL_ORIENTATION_LANDSCAPE; + if (internal->physical_width >= internal->physical_height) { + internal->placeholder.natural_orientation = SDL_ORIENTATION_LANDSCAPE; } else { - driverdata->placeholder.natural_orientation = SDL_ORIENTATION_PORTRAIT; + internal->placeholder.natural_orientation = SDL_ORIENTATION_PORTRAIT; } - driverdata->placeholder.current_orientation = driverdata->orientation; - driverdata->placeholder.driverdata = driverdata; + internal->placeholder.current_orientation = internal->orientation; + internal->placeholder.internal = internal; /* During initialization, the displays will be added after enumeration is complete. */ if (!video->initializing) { - driverdata->display = SDL_AddVideoDisplay(&driverdata->placeholder, SDL_TRUE); - SDL_free(driverdata->placeholder.name); - SDL_zero(driverdata->placeholder); + internal->display = SDL_AddVideoDisplay(&internal->placeholder, SDL_TRUE); + SDL_free(internal->placeholder.name); + SDL_zero(internal->placeholder); } } else { - SDL_SendDisplayEvent(dpy, SDL_EVENT_DISPLAY_ORIENTATION, driverdata->orientation, 0); + SDL_SendDisplayEvent(dpy, SDL_EVENT_DISPLAY_ORIENTATION, internal->orientation, 0); } } @@ -916,26 +916,26 @@ static void display_handle_scale(void *data, struct wl_output *output, int32_t factor) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; - driverdata->scale_factor = factor; + SDL_DisplayData *internal = (SDL_DisplayData *)data; + internal->scale_factor = factor; } static void display_handle_name(void *data, struct wl_output *wl_output, const char *name) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; - SDL_free(driverdata->wl_output_name); - driverdata->wl_output_name = SDL_strdup(name); + SDL_free(internal->wl_output_name); + internal->wl_output_name = SDL_strdup(name); } static void display_handle_description(void *data, struct wl_output *wl_output, const char *description) { - SDL_DisplayData *driverdata = (SDL_DisplayData *)data; + SDL_DisplayData *internal = (SDL_DisplayData *)data; - if (driverdata->display == 0) { + if (internal->display == 0) { /* The description, if available, supersedes the model name. */ - SDL_free(driverdata->placeholder.name); - driverdata->placeholder.name = SDL_strdup(description); + SDL_free(internal->placeholder.name); + internal->placeholder.name = SDL_strdup(description); } } @@ -979,13 +979,13 @@ static int Wayland_add_display(SDL_VideoData *d, uint32_t id, uint32_t version) static void Wayland_free_display(SDL_VideoDisplay *display) { if (display) { - SDL_DisplayData *display_data = display->driverdata; + SDL_DisplayData *display_data = display->internal; /* A preceding surface leave event is not guaranteed when an output is removed, * so ensure that no window continues to hold a reference to a removed output. */ for (SDL_Window *window = SDL_GetVideoDevice()->windows; window; window = window->next) { - Wayland_RemoveOutputFromWindow(window->driverdata, display_data); + Wayland_RemoveOutputFromWindow(window->internal, display_data); } SDL_free(display_data->wl_output_name); @@ -1187,7 +1187,7 @@ SDL_bool Wayland_LoadLibdecor(SDL_VideoData *data, SDL_bool ignore_xdg) int Wayland_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; data->xkb_context = WAYLAND_xkb_context_new(0); if (!data->xkb_context) { @@ -1237,15 +1237,15 @@ int Wayland_VideoInit(SDL_VideoDevice *_this) static int Wayland_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { - SDL_VideoData *viddata = _this->driverdata; - SDL_DisplayData *driverdata = display->driverdata; - rect->x = driverdata->x; - rect->y = driverdata->y; + SDL_VideoData *viddata = _this->internal; + SDL_DisplayData *internal = display->internal; + rect->x = internal->x; + rect->y = internal->y; /* When an emulated, exclusive fullscreen window has focus, treat the mode dimensions as the display bounds. */ if (display->fullscreen_window && display->fullscreen_window->fullscreen_exclusive && - display->fullscreen_window->driverdata->active && + display->fullscreen_window->internal->active && display->fullscreen_window->current_fullscreen_mode.w != 0 && display->fullscreen_window->current_fullscreen_mode.h != 0) { rect->w = display->fullscreen_window->current_fullscreen_mode.w; @@ -1254,12 +1254,12 @@ static int Wayland_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *di if (!viddata->scale_to_display_enabled) { rect->w = display->current_mode->w; rect->h = display->current_mode->h; - } else if (driverdata->transform & WL_OUTPUT_TRANSFORM_90) { - rect->w = driverdata->pixel_height; - rect->h = driverdata->pixel_width; + } else if (internal->transform & WL_OUTPUT_TRANSFORM_90) { + rect->w = internal->pixel_height; + rect->h = internal->pixel_width; } else { - rect->w = driverdata->pixel_width; - rect->h = driverdata->pixel_height; + rect->w = internal->pixel_width; + rect->h = internal->pixel_height; } } return 0; @@ -1267,7 +1267,7 @@ static int Wayland_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *di static void Wayland_VideoCleanup(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int i; Wayland_FiniMouse(data); @@ -1411,7 +1411,7 @@ static void Wayland_VideoCleanup(SDL_VideoDevice *_this) SDL_bool Wayland_VideoReconnect(SDL_VideoDevice *_this) { #if 0 /* TODO RECONNECT: Uncomment all when https://invent.kde.org/plasma/kwin/-/wikis/Restarting is completed */ - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDL_Window *window = NULL; @@ -1460,7 +1460,7 @@ void Wayland_VideoQuit(SDL_VideoDevice *_this) Wayland_VideoCleanup(_this); #ifdef HAVE_LIBDECOR_H - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->shell.libdecor) { libdecor_unref(data->shell.libdecor); data->shell.libdecor = NULL; diff --git a/src/video/wayland/SDL_waylandvulkan.c b/src/video/wayland/SDL_waylandvulkan.c index e6d78aa1a9ae5..0a0d3c5c865db 100644 --- a/src/video/wayland/SDL_waylandvulkan.c +++ b/src/video/wayland/SDL_waylandvulkan.c @@ -134,7 +134,7 @@ int Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) { - SDL_WindowData *windowData = window->driverdata; + SDL_WindowData *windowData = window->internal; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; PFN_vkCreateWaylandSurfaceKHR vkCreateWaylandSurfaceKHR = @@ -200,7 +200,7 @@ SDL_bool Wayland_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, return vkGetPhysicalDeviceWaylandPresentationSupportKHR(physicalDevice, queueFamilyIndex, - _this->driverdata->display); + _this->internal->display); } #endif diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 5d5aa97000d6b..7cc83e35bcc3b 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -51,12 +51,12 @@ static int PointToPixel(SDL_Window *window, int point) { /* Rounds halfway away from zero as per the Wayland fractional scaling protocol spec. */ - return (int)SDL_lroundf((float)point * window->driverdata->windowed_scale_factor); + return (int)SDL_lroundf((float)point * window->internal->windowed_scale_factor); } static int PixelToPoint(SDL_Window *window, int pixel) { - return (int)SDL_lroundf((float)pixel / window->driverdata->windowed_scale_factor); + return (int)SDL_lroundf((float)pixel / window->internal->windowed_scale_factor); } static SDL_bool FloatEqual(float a, float b) @@ -114,7 +114,7 @@ static enum WaylandModeScale GetModeScaleMethod() static void GetBufferSize(SDL_Window *window, int *width, int *height) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; int buf_width; int buf_height; @@ -141,7 +141,7 @@ static void GetBufferSize(SDL_Window *window, int *width, int *height) static void SetMinMaxDimensions(SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; int min_width, min_height, max_width, max_height; if ((window->flags & SDL_WINDOW_FULLSCREEN) || wind->fullscreen_deadline_count) { @@ -246,9 +246,9 @@ static void AdjustPopupOffset(SDL_Window *popup, int *x, int *y) { /* Adjust the popup positioning, if necessary */ #ifdef HAVE_LIBDECOR_H - if (popup->parent->driverdata->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { + if (popup->parent->internal->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { int adj_x, adj_y; - libdecor_frame_translate_coordinate(popup->parent->driverdata->shell_surface.libdecor.frame, + libdecor_frame_translate_coordinate(popup->parent->internal->shell_surface.libdecor.frame, *x, *y, &adj_x, &adj_y); *x = adj_x; *y = adj_y; @@ -258,7 +258,7 @@ static void AdjustPopupOffset(SDL_Window *popup, int *x, int *y) static void RepositionPopup(SDL_Window *window, SDL_bool use_current_position) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP && wind->shell_surface.xdg.roleobj.popup.positioner && @@ -272,7 +272,7 @@ static void RepositionPopup(SDL_Window *window, SDL_bool use_current_position) y = PixelToPoint(window->parent, y); } AdjustPopupOffset(window, &x, &y); - xdg_positioner_set_anchor_rect(wind->shell_surface.xdg.roleobj.popup.positioner, 0, 0, window->parent->driverdata->current.logical_width, window->parent->driverdata->current.logical_height); + xdg_positioner_set_anchor_rect(wind->shell_surface.xdg.roleobj.popup.positioner, 0, 0, window->parent->internal->current.logical_width, window->parent->internal->current.logical_height); xdg_positioner_set_size(wind->shell_surface.xdg.roleobj.popup.positioner, wind->current.logical_width, wind->current.logical_height); xdg_positioner_set_offset(wind->shell_surface.xdg.roleobj.popup.positioner, x, y); xdg_popup_reposition(wind->shell_surface.xdg.roleobj.popup.popup, @@ -298,7 +298,7 @@ static void SetSurfaceOpaqueRegion(SDL_WindowData *wind, SDL_bool is_opaque) static void ConfigureWindowGeometry(SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; const int old_pixel_width = data->current.pixel_width; const int old_pixel_height = data->current.pixel_height; int window_width, window_height; @@ -457,7 +457,7 @@ static void ConfigureWindowGeometry(SDL_Window *window) static void CommitLibdecorFrame(SDL_Window *window) { #ifdef HAVE_LIBDECOR_H - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR && wind->shell_surface.libdecor.frame) { struct libdecor_state *state = libdecor_state_new(wind->current.logical_width, wind->current.logical_height); @@ -473,8 +473,8 @@ static void fullscreen_deadline_handler(void *data, struct wl_callback *callback SDL_WindowID windowID = (SDL_WindowID)((uintptr_t)data); SDL_Window *window = SDL_GetWindowFromID(windowID); - if (window && window->driverdata) { - window->driverdata->fullscreen_deadline_count--; + if (window && window->internal) { + window->internal->fullscreen_deadline_count--; } wl_callback_destroy(callback); @@ -486,8 +486,8 @@ static struct wl_callback_listener fullscreen_deadline_listener = { static void FlushFullscreenEvents(SDL_Window *window) { - while (window->driverdata->fullscreen_deadline_count) { - WAYLAND_wl_display_roundtrip(window->driverdata->waylandData->display); + while (window->internal->fullscreen_deadline_count) { + WAYLAND_wl_display_roundtrip(window->internal->waylandData->display); } } @@ -497,7 +497,7 @@ static void FlushFullscreenEvents(SDL_Window *window) */ static void Wayland_move_window(SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; SDL_DisplayData *display; SDL_DisplayID *displays; @@ -548,7 +548,7 @@ static void Wayland_move_window(SDL_Window *window) static void SetFullscreen(SDL_Window *window, struct wl_output *output) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; SDL_VideoData *viddata = wind->waylandData; #ifdef HAVE_LIBDECOR_H @@ -593,7 +593,7 @@ static void SetFullscreen(SDL_Window *window, struct wl_output *output) static void UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; wind->is_fullscreen = fullscreen; @@ -612,7 +612,7 @@ static void UpdateWindowFullscreen(SDL_Window *window, SDL_bool fullscreen) SDL_VideoDisplay *disp = SDL_GetVideoDisplay(window->current_fullscreen_mode.displayID); if (disp) { wind->fullscreen_was_positioned = SDL_TRUE; - SetFullscreen(window, disp->driverdata->output); + SetFullscreen(window, disp->internal->output); } } } @@ -652,9 +652,9 @@ static void surface_frame_done(void *data, struct wl_callback *cb, uint32_t time /* If any child windows are waiting on this window to be shown, show them now */ for (SDL_Window *w = wind->sdlwindow->first_child; w; w = w->next_sibling) { - if (w->driverdata->surface_status == WAYLAND_SURFACE_STATUS_SHOW_PENDING) { + if (w->internal->surface_status == WAYLAND_SURFACE_STATUS_SHOW_PENDING) { Wayland_ShowWindow(SDL_GetVideoDevice(), w); - } else if ((w->flags & SDL_WINDOW_MODAL) && w->driverdata->modal_reparenting_required) { + } else if ((w->flags & SDL_WINDOW_MODAL) && w->internal->modal_reparenting_required) { Wayland_SetWindowModalFor(SDL_GetVideoDevice(), w, w->parent); } } @@ -997,7 +997,7 @@ static void handle_configure_zxdg_decoration(void *data, uint32_t mode) { SDL_Window *window = (SDL_Window *)data; - SDL_WindowData *driverdata = window->driverdata; + SDL_WindowData *internal = window->internal; SDL_VideoDevice *device = SDL_GetVideoDevice(); /* If the compositor tries to force CSD anyway, bail on direct XDG support @@ -1010,15 +1010,15 @@ static void handle_configure_zxdg_decoration(void *data, /* borderless windows do request CSD, so we got what we wanted */ return; } - if (!Wayland_LoadLibdecor(driverdata->waylandData, SDL_TRUE)) { + if (!Wayland_LoadLibdecor(internal->waylandData, SDL_TRUE)) { /* libdecor isn't available, so no borders for you... oh well */ return; } - WAYLAND_wl_display_roundtrip(driverdata->waylandData->display); + WAYLAND_wl_display_roundtrip(internal->waylandData->display); Wayland_HideWindow(device, window); - SDL_zero(driverdata->shell_surface); - driverdata->shell_surface_type = WAYLAND_SURFACE_LIBDECOR; + SDL_zero(internal->shell_surface); + internal->shell_surface_type = WAYLAND_SURFACE_LIBDECOR; Wayland_ShowWindow(device, window); } @@ -1044,10 +1044,10 @@ static void OverrideLibdecorLimits(SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR if (!libdecor_frame_get_min_content_size) { - libdecor_frame_set_min_content_size(window->driverdata->shell_surface.libdecor.frame, window->min_w, window->min_h); + libdecor_frame_set_min_content_size(window->internal->shell_surface.libdecor.frame, window->min_w, window->min_h); } #elif !SDL_LIBDECOR_CHECK_VERSION(0, 2, 0) - libdecor_frame_set_min_content_size(window->driverdata->shell_surface.libdecor.frame, window->min_w, window->min_h); + libdecor_frame_set_min_content_size(window->internal->shell_surface.libdecor.frame, window->min_w, window->min_h); #endif } @@ -1383,8 +1383,8 @@ static void Wayland_MaybeUpdateScaleFactor(SDL_WindowData *window) /* Check every display's factor, use the highest */ factor = 0.0f; for (i = 0; i < window->num_outputs; i++) { - SDL_DisplayData *driverdata = window->outputs[i]; - factor = SDL_max(factor, driverdata->scale_factor); + SDL_DisplayData *internal = window->outputs[i]; + factor = SDL_max(factor, internal->scale_factor); } } else { /* All outputs removed, just fall back. */ @@ -1422,7 +1422,7 @@ void Wayland_RemoveOutputFromWindow(SDL_WindowData *window, SDL_DisplayData *dis static void handle_surface_enter(void *data, struct wl_surface *surface, struct wl_output *output) { SDL_WindowData *window = data; - SDL_DisplayData *driverdata = wl_output_get_user_data(output); + SDL_DisplayData *internal = wl_output_get_user_data(output); SDL_DisplayData **new_outputs; if (!SDL_WAYLAND_own_output(output) || !SDL_WAYLAND_own_surface(surface)) { @@ -1435,7 +1435,7 @@ static void handle_surface_enter(void *data, struct wl_surface *surface, struct return; } window->outputs = new_outputs; - window->outputs[window->num_outputs++] = driverdata; + window->outputs[window->num_outputs++] = internal; /* Update the scale factor after the move so that fullscreen outputs are updated. */ if (!window->is_fullscreen || window->num_outputs == 1) { @@ -1540,7 +1540,7 @@ static void SetKeyboardFocus(SDL_Window *window) topmost = topmost->parent; } - topmost->driverdata->keyboard_focus = window; + topmost->internal->keyboard_focus = window; SDL_SetKeyboardFocus(window); } @@ -1552,9 +1552,9 @@ int Wayland_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) int Wayland_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window) { - SDL_VideoData *viddata = _this->driverdata; - SDL_WindowData *modal_data = modal_window->driverdata; - SDL_WindowData *parent_data = parent_window ? parent_window->driverdata : NULL; + SDL_VideoData *viddata = _this->internal; + SDL_WindowData *modal_data = modal_window->internal; + SDL_WindowData *parent_data = parent_window ? parent_window->internal : NULL; struct xdg_toplevel *modal_toplevel = NULL; struct xdg_toplevel *parent_toplevel = NULL; @@ -1615,8 +1615,8 @@ static void show_hide_sync_handler(void *data, struct wl_callback *callback, uin SDL_WindowID windowID = (SDL_WindowID)((uintptr_t)data); SDL_Window *window = SDL_GetWindowFromID(windowID); - if (window && window->driverdata) { - SDL_WindowData *wind = window->driverdata; + if (window && window->internal) { + SDL_WindowData *wind = window->internal; wind->show_hide_sync_required = SDL_FALSE; } @@ -1641,8 +1641,8 @@ static struct zxdg_exported_v2_listener exported_v2_listener = { void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *c = _this->driverdata; - SDL_WindowData *data = window->driverdata; + SDL_VideoData *c = _this->internal; + SDL_WindowData *data = window->internal; SDL_PropertiesID props = SDL_GetWindowProperties(window); /* Custom surfaces don't get toplevels and are always considered 'shown'; nothing to do here. */ @@ -1659,7 +1659,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) * be shown when the parent is in the shown state. */ if (window->parent) { - if (window->parent->driverdata->surface_status != WAYLAND_SURFACE_STATUS_SHOWN) { + if (window->parent->internal->surface_status != WAYLAND_SURFACE_STATUS_SHOWN) { data->surface_status = WAYLAND_SURFACE_STATUS_SHOW_PENDING; return; } @@ -1722,7 +1722,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) if (data->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { SDL_Window *parent = window->parent; - SDL_WindowData *parent_data = parent->driverdata; + SDL_WindowData *parent_data = parent->internal; struct xdg_surface *parent_xdg_surface = NULL; int position_x = 0, position_y = 0; @@ -1740,7 +1740,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) /* Set up the positioner for the popup and configure the constraints */ data->shell_surface.xdg.roleobj.popup.positioner = xdg_wm_base_create_positioner(c->shell.xdg); xdg_positioner_set_anchor(data->shell_surface.xdg.roleobj.popup.positioner, XDG_POSITIONER_ANCHOR_TOP_LEFT); - xdg_positioner_set_anchor_rect(data->shell_surface.xdg.roleobj.popup.positioner, 0, 0, parent->driverdata->current.logical_width, parent->driverdata->current.logical_width); + xdg_positioner_set_anchor_rect(data->shell_surface.xdg.roleobj.popup.positioner, 0, 0, parent->internal->current.logical_width, parent->internal->current.logical_width); xdg_positioner_set_constraint_adjustment(data->shell_surface.xdg.roleobj.popup.positioner, XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y); xdg_positioner_set_gravity(data->shell_surface.xdg.roleobj.popup.positioner, XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT); @@ -1883,7 +1883,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) } data->show_hide_sync_required = SDL_TRUE; - struct wl_callback *cb = wl_display_sync(_this->driverdata->display); + struct wl_callback *cb = wl_display_sync(_this->internal->display); wl_callback_add_listener(cb, &show_hide_sync_listener, (void*)((uintptr_t)window->id)); /* Send an exposure event to signal that the client should draw. */ @@ -1900,7 +1900,7 @@ static void Wayland_ReleasePopup(SDL_VideoDevice *_this, SDL_Window *popup) if (!SDL_ObjectValid(popup, SDL_OBJECT_TYPE_WINDOW)) { return; } - popupdata = popup->driverdata; + popupdata = popup->internal; if (!popupdata) { return; } @@ -1935,8 +1935,8 @@ static void Wayland_ReleasePopup(SDL_VideoDevice *_this, SDL_Window *popup) void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *data = _this->driverdata; - SDL_WindowData *wind = window->driverdata; + SDL_VideoData *data = _this->internal; + SDL_WindowData *wind = window->internal; SDL_PropertiesID props = SDL_GetWindowProperties(window); /* Custom surfaces have nothing to destroy and are always considered to be 'shown'; nothing to do here. */ @@ -2002,7 +2002,7 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) } wind->show_hide_sync_required = SDL_TRUE; - struct wl_callback *cb = wl_display_sync(_this->driverdata->display); + struct wl_callback *cb = wl_display_sync(_this->internal->display); wl_callback_add_listener(cb, &show_hide_sync_listener, (void*)((uintptr_t)window->id)); } @@ -2048,7 +2048,7 @@ static void Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *target_ { struct SDL_WaylandInput * input = data->input; SDL_Window *focus = SDL_GetKeyboardFocus(); - struct wl_surface *requesting_surface = focus ? focus->driverdata->surface : NULL; + struct wl_surface *requesting_surface = focus ? focus->internal->surface : NULL; if (data->activation_manager) { if (target_wind->activation_token) { @@ -2081,7 +2081,7 @@ static void Wayland_activate_window(SDL_VideoData *data, SDL_WindowData *target_ void Wayland_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { - Wayland_activate_window(_this->driverdata, window->driverdata, SDL_TRUE); + Wayland_activate_window(_this->internal, window->internal, SDL_TRUE); } int Wayland_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation) @@ -2089,15 +2089,15 @@ int Wayland_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOpe /* Not setting the serial will specify 'urgency' without switching focus as per * https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/9#note_854977 */ - Wayland_activate_window(_this->driverdata, window->driverdata, SDL_FALSE); + Wayland_activate_window(_this->internal, window->internal, SDL_FALSE); return 0; } int Wayland_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen) { - SDL_WindowData *wind = window->driverdata; - struct wl_output *output = display->driverdata->output; + SDL_WindowData *wind = window->internal; + struct wl_output *output = display->internal->output; /* Custom surfaces have no toplevel to make fullscreen. */ if (wind->shell_surface_type == WAYLAND_SURFACE_CUSTOM) { @@ -2105,7 +2105,7 @@ int Wayland_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, } if (wind->show_hide_sync_required) { - WAYLAND_wl_display_roundtrip(_this->driverdata->display); + WAYLAND_wl_display_roundtrip(_this->internal->display); } /* Flushing old events pending a new one, ignore this request. */ @@ -2156,7 +2156,7 @@ int Wayland_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, void Wayland_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { @@ -2177,8 +2177,8 @@ void Wayland_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) void Wayland_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { - SDL_WindowData *wind = window->driverdata; - const SDL_VideoData *viddata = (const SDL_VideoData *)_this->driverdata; + SDL_WindowData *wind = window->internal; + const SDL_VideoData *viddata = (const SDL_VideoData *)_this->internal; #ifdef HAVE_LIBDECOR_H if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { @@ -2198,7 +2198,7 @@ void Wayland_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_b void Wayland_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { #ifdef HAVE_LIBDECOR_H - const SDL_WindowData *wind = window->driverdata; + const SDL_WindowData *wind = window->internal; if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) { if (!wind->shell_surface.libdecor.frame) { @@ -2223,10 +2223,10 @@ void Wayland_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_ void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; if (wind->show_hide_sync_required) { - WAYLAND_wl_display_roundtrip(_this->driverdata->display); + WAYLAND_wl_display_roundtrip(_this->internal->display); } #ifdef HAVE_LIBDECOR_H @@ -2247,7 +2247,7 @@ void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) void Wayland_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; /* TODO: Check compositor capabilities to see if minimizing is supported */ #ifdef HAVE_LIBDECOR_H @@ -2270,7 +2270,7 @@ void Wayland_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; /* This may look suspiciously like SetWindowGrab, despite SetMouseRect not * implicitly doing a grab. And you're right! Wayland doesn't let us mess @@ -2289,7 +2289,7 @@ int Wayland_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (grabbed) { return Wayland_input_confine_pointer(data->input, window); @@ -2302,7 +2302,7 @@ int Wayland_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_b int Wayland_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (grabbed) { return Wayland_input_grab_keyboard(window, data->input); @@ -2314,7 +2314,7 @@ int Wayland_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SD int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesID create_props) { SDL_WindowData *data; - SDL_VideoData *c = _this->driverdata; + SDL_VideoData *c = _this->internal; struct wl_surface *external_surface = (struct wl_surface *)SDL_GetPointerProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_WL_SURFACE_POINTER, (struct wl_surface *)SDL_GetPointerProperty(create_props, "sdl2-compat.external_window", NULL)); const SDL_bool custom_surface_role = (external_surface != NULL) || SDL_GetBooleanProperty(create_props, SDL_PROP_WINDOW_CREATE_WAYLAND_SURFACE_ROLE_CUSTOM_BOOLEAN, SDL_FALSE); @@ -2326,7 +2326,7 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert return -1; } - window->driverdata = data; + window->internal = data; if (window->x == SDL_WINDOWPOS_UNDEFINED) { window->x = 0; @@ -2341,12 +2341,12 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert data->windowed_scale_factor = 1.0f; if (SDL_WINDOW_IS_POPUP(window)) { - data->scale_to_display = window->parent->driverdata->scale_to_display; - data->windowed_scale_factor = window->parent->driverdata->windowed_scale_factor; + data->scale_to_display = window->parent->internal->scale_to_display; + data->windowed_scale_factor = window->parent->internal->windowed_scale_factor; EnsurePopupPositionIsValid(window, &window->x, &window->y); } else if ((window->flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) || c->scale_to_display_enabled) { for (int i = 0; i < _this->num_displays; i++) { - float scale = _this->displays[i]->driverdata->scale_factor; + float scale = _this->displays[i]->internal->scale_factor; data->windowed_scale_factor = SDL_max(data->windowed_scale_factor, scale); } } @@ -2508,7 +2508,7 @@ void Wayland_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; /* Only popup windows can be positioned relative to the parent. */ if (wind->shell_surface_type == WAYLAND_SURFACE_XDG_POPUP) { @@ -2546,7 +2546,7 @@ int Wayland_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) if (wind->is_fullscreen) { SDL_VideoDisplay *display = SDL_GetVideoDisplayForFullscreenWindow(window); if (display && wind->last_displayID != display->id) { - struct wl_output *output = display->driverdata->output; + struct wl_output *output = display->internal->output; SetFullscreen(window, output); return 0; @@ -2558,7 +2558,7 @@ int Wayland_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; /* Fullscreen windows do not get explicitly resized, and not strictly * obeying the size of maximized windows is a protocol violation. @@ -2589,7 +2589,7 @@ void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; *w = data->current.pixel_width; *h = data->current.pixel_height; @@ -2597,7 +2597,7 @@ void Wayland_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, i SDL_DisplayID Wayland_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; if (wind) { return wind->last_displayID; @@ -2608,7 +2608,7 @@ SDL_DisplayID Wayland_GetDisplayForWindow(SDL_VideoDevice *_this, SDL_Window *wi int Wayland_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; if (wind->wp_alpha_modifier_surface_v1) { SetSurfaceOpaqueRegion(wind, !(window->flags & SDL_WINDOW_TRANSPARENT) && opacity == 1.0f); @@ -2622,7 +2622,7 @@ int Wayland_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float o void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; const char *title = window->title ? window->title : ""; #ifdef HAVE_LIBDECOR_H @@ -2637,13 +2637,13 @@ void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_SyncWindow(SDL_VideoDevice *_this, SDL_Window *window) { - WAYLAND_wl_display_roundtrip(_this->driverdata->display); + WAYLAND_wl_display_roundtrip(_this->internal->display); return 0; } void Wayland_ShowWindowSystemMenu(SDL_Window *window, int x, int y) { - SDL_WindowData *wind = window->driverdata; + SDL_WindowData *wind = window->internal; if (wind->scale_to_display) { x = PixelToPoint(window, x); @@ -2666,7 +2666,7 @@ void Wayland_ShowWindowSystemMenu(SDL_Window *window, int x, int y) int Wayland_SuspendScreenSaver(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; #ifdef SDL_USE_LIBDBUS if (SDL_DBus_ScreensaverInhibit(_this->suspend_screensaver)) { @@ -2685,7 +2685,7 @@ int Wayland_SuspendScreenSaver(SDL_VideoDevice *_this) if (data->idle_inhibit_manager) { SDL_Window *window = _this->windows; while (window) { - SDL_WindowData *win_data = window->driverdata; + SDL_WindowData *win_data = window->internal; if (_this->suspend_screensaver && !win_data->idle_inhibitor) { win_data->idle_inhibitor = @@ -2705,8 +2705,8 @@ int Wayland_SuspendScreenSaver(SDL_VideoDevice *_this) void Wayland_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *data = _this->driverdata; - SDL_WindowData *wind = window->driverdata; + SDL_VideoData *data = _this->internal; + SDL_WindowData *wind = window->internal; /* Roundtrip before destroying the window to make sure that it has received input leave events, so that * no internal structures are left pointing to the destroyed window. */ @@ -2770,7 +2770,7 @@ void Wayland_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) SDL_free(wind); WAYLAND_wl_display_flush(data->display); } - window->driverdata = NULL; + window->internal = NULL; } #endif /* SDL_VIDEO_DRIVER_WAYLAND */ diff --git a/src/video/windows/SDL_windowsclipboard.c b/src/video/windows/SDL_windowsclipboard.c index 2cd129cd79855..3a23e1ed092dc 100644 --- a/src/video/windows/SDL_windowsclipboard.c +++ b/src/video/windows/SDL_windowsclipboard.c @@ -48,7 +48,7 @@ static BOOL WIN_OpenClipboard(SDL_VideoDevice *_this) HWND hwnd = NULL; if (_this->windows) { - hwnd = _this->windows->driverdata->hwnd; + hwnd = _this->windows->internal->hwnd; } for (attempt = 0; attempt < MAX_ATTEMPTS; ++attempt) { if (OpenClipboard(hwnd)) { @@ -213,7 +213,7 @@ static int WIN_SetClipboardText(SDL_VideoDevice *_this, const char *mime_type) int WIN_SetClipboardData(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; size_t i; int result = 0; diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 32a35076175df..441c6f6329074 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -294,7 +294,7 @@ static void WIN_CheckAsyncMouseRelease(Uint64 timestamp, SDL_WindowData *data) static void WIN_UpdateFocus(SDL_Window *window, SDL_bool expect_focus) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; SDL_bool had_focus = (SDL_GetKeyboardFocus() == window); SDL_bool has_focus = (GetForegroundWindow() == hwnd); @@ -431,7 +431,7 @@ static SDL_WindowData *WIN_GetWindowDataFromHWND(HWND hwnd) if (_this) { for (window = _this->windows; window; window = window->next) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data && data->hwnd == hwnd) { return data; } @@ -445,7 +445,7 @@ LRESULT CALLBACK WIN_KeyboardHookProc(int nCode, WPARAM wParam, LPARAM lParam) { KBDLLHOOKSTRUCT *hookData = (KBDLLHOOKSTRUCT *)lParam; - SDL_VideoData *data = SDL_GetVideoDevice()->driverdata; + SDL_VideoData *data = SDL_GetVideoDevice()->internal; SDL_Scancode scanCode; if (nCode < 0 || nCode != HC_ACTION) { @@ -537,7 +537,7 @@ static void WIN_HandleRawMouseInput(Uint64 timestamp, SDL_VideoData *data, HANDL } SDL_MouseID mouseID = (SDL_MouseID)(uintptr_t)hDevice; - SDL_WindowData *windowdata = window->driverdata; + SDL_WindowData *windowdata = window->internal; if ((rawmouse->usFlags & 0x01) == MOUSE_MOVE_RELATIVE) { if (rawmouse->lLastX || rawmouse->lLastY) { @@ -738,7 +738,7 @@ static void WIN_HandleRawKeyboardInput(Uint64 timestamp, SDL_VideoData *data, HA void WIN_PollRawInput(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; UINT size, i, count, total = 0; RAWINPUT *input; Uint64 now; @@ -2099,7 +2099,7 @@ static void WIN_UpdateClipCursorForWindows() if (_this) { for (window = _this->windows; window; window = window->next) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data) { if (data->skip_update_clipcursor) { data->skip_update_clipcursor = SDL_FALSE; @@ -2117,7 +2117,7 @@ static void WIN_UpdateMouseCapture() SDL_Window *focusWindow = SDL_GetKeyboardFocus(); if (focusWindow && (focusWindow->flags & SDL_WINDOW_MOUSE_CAPTURE)) { - SDL_WindowData *data = focusWindow->driverdata; + SDL_WindowData *data = focusWindow->internal; if (!data->mouse_tracked) { POINT cursorPos; @@ -2201,7 +2201,7 @@ int WIN_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) void WIN_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; PostMessage(data->hwnd, data->videodata->_SDL_WAKEUP, 0, 0); } diff --git a/src/video/windows/SDL_windowsframebuffer.c b/src/video/windows/SDL_windowsframebuffer.c index eb0b06e0f56a2..37dd9197760ff 100644 --- a/src/video/windows/SDL_windowsframebuffer.c +++ b/src/video/windows/SDL_windowsframebuffer.c @@ -26,7 +26,7 @@ int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_bool isstack; size_t size; LPBITMAPINFO info; @@ -100,7 +100,7 @@ int WIN_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_ int WIN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; int i; for (i = 0; i < numrects; ++i) { @@ -112,7 +112,7 @@ int WIN_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, cons void WIN_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (!data) { /* The window wasn't fully initialized */ diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 6da493e1b3ae6..2080c06e928b8 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -58,7 +58,7 @@ static void IME_SetTextInputArea(SDL_VideoData *videodata, HWND hwnd, const SDL_ void WIN_InitKeyboard(SDL_VideoDevice *_this) { #ifndef SDL_DISABLE_WINDOWS_IME - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; data->ime_candlistindexbase = 1; data->ime_composition_length = 32 * sizeof(WCHAR); @@ -154,7 +154,7 @@ void WIN_UpdateKeymap(SDL_bool send_event) void WIN_QuitKeyboard(SDL_VideoDevice *_this) { #ifndef SDL_DISABLE_WINDOWS_IME - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; IME_Quit(data); @@ -201,8 +201,8 @@ int WIN_StartTextInput(SDL_VideoDevice *_this, SDL_Window *window) WIN_ResetDeadKeys(); #ifndef SDL_DISABLE_WINDOWS_IME - HWND hwnd = window->driverdata->hwnd; - SDL_VideoData *videodata = _this->driverdata; + HWND hwnd = window->internal->hwnd; + SDL_VideoData *videodata = _this->internal; IME_Init(videodata, window); IME_Enable(videodata, hwnd); @@ -217,8 +217,8 @@ int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) WIN_ResetDeadKeys(); #ifndef SDL_DISABLE_WINDOWS_IME - HWND hwnd = window->driverdata->hwnd; - SDL_VideoData *videodata = _this->driverdata; + HWND hwnd = window->internal->hwnd; + SDL_VideoData *videodata = _this->internal; IME_Init(videodata, window); IME_Disable(videodata, hwnd); #endif /* !SDL_DISABLE_WINDOWS_IME */ @@ -228,8 +228,8 @@ int WIN_StopTextInput(SDL_VideoDevice *_this, SDL_Window *window) int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; - SDL_WindowData *data = window->driverdata; + SDL_VideoData *videodata = _this->internal; + SDL_WindowData *data = window->internal; IME_SetTextInputArea(videodata, data->hwnd, &window->text_input_rect, window->text_input_cursor); return 0; @@ -238,7 +238,7 @@ int WIN_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) int WIN_ClearComposition(SDL_VideoDevice *_this, SDL_Window *window) { #ifndef SDL_DISABLE_WINDOWS_IME - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; IME_ClearComposition(videodata); #endif @@ -303,7 +303,7 @@ static void IME_SendClearComposition(SDL_VideoData *videodata); static int IME_Init(SDL_VideoData *videodata, SDL_Window *window) { - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; if (videodata->ime_initialized) { return 0; @@ -627,7 +627,7 @@ static void IME_SetupAPI(SDL_VideoData *videodata) static void IME_SetWindow(SDL_VideoData *videodata, SDL_Window *window) { - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; if (hwnd != videodata->ime_hwnd_current) { videodata->ime_hwnd_current = hwnd; @@ -1120,7 +1120,7 @@ SDL_bool WIN_HandleIMEMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam void WIN_UpdateIMECandidates(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; if (videodata->ime_update_candidates) { IME_GetCandidateList(videodata, videodata->ime_hwnd_current); diff --git a/src/video/windows/SDL_windowsmessagebox.c b/src/video/windows/SDL_windowsmessagebox.c index 0b8837ed9a838..2baaf56310deb 100644 --- a/src/video/windows/SDL_windowsmessagebox.c +++ b/src/video/windows/SDL_windowsmessagebox.c @@ -870,7 +870,7 @@ static int WIN_ShowOldMessageBox(const SDL_MessageBoxData *messageboxdata, int * /* If we have a parent window, get the Instance and HWND for them * so that our little dialog gets exclusive focus at all times. */ if (messageboxdata->window) { - ParentWindow = messageboxdata->window->driverdata->hwnd; + ParentWindow = messageboxdata->window->internal->hwnd; } result = DialogBoxIndirectParam(NULL, (DLGTEMPLATE *)dialog->lpDialog, ParentWindow, MessageBoxDialogProc, (LPARAM)messageboxdata); @@ -951,7 +951,7 @@ int WIN_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonID) /* If we have a parent window, get the Instance and HWND for them so that our little dialog gets exclusive focus at all times. */ if (messageboxdata->window) { - ParentWindow = messageboxdata->window->driverdata->hwnd; + ParentWindow = messageboxdata->window->internal->hwnd; } wmessage = WIN_UTF8ToStringW(messageboxdata->message); diff --git a/src/video/windows/SDL_windowsmodes.c b/src/video/windows/SDL_windowsmodes.c index 7d7921010d9e9..54cb9ef71971a 100644 --- a/src/video/windows/SDL_windowsmodes.c +++ b/src/video/windows/SDL_windowsmodes.c @@ -40,7 +40,7 @@ static void WIN_UpdateDisplayMode(SDL_VideoDevice *_this, LPCWSTR deviceName, DWORD index, SDL_DisplayMode *mode) { - SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; + SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->internal; HDC hdc; data->DeviceMode.dmFields = (DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY | DM_DISPLAYFLAGS); @@ -116,7 +116,7 @@ static void *WIN_GetDXGIOutput(SDL_VideoDevice *_this, const WCHAR *DeviceName) void *retval = NULL; #ifdef HAVE_DXGI_H - const SDL_VideoData *videodata = (const SDL_VideoData *)_this->driverdata; + const SDL_VideoData *videodata = (const SDL_VideoData *)_this->internal; int nAdapter, nOutput; IDXGIAdapter *pDXGIAdapter; IDXGIOutput *pDXGIOutput; @@ -247,7 +247,7 @@ static void WIN_GetRefreshRate(void *dxgi_output, DEVMODE *mode, int *numerator, static float WIN_GetContentScale(SDL_VideoDevice *_this, HMONITOR hMonitor) { - const SDL_VideoData *videodata = (const SDL_VideoData *)_this->driverdata; + const SDL_VideoData *videodata = (const SDL_VideoData *)_this->internal; int dpi = 0; if (videodata->GetDpiForMonitor) { @@ -288,7 +288,7 @@ static SDL_bool WIN_GetDisplayMode(SDL_VideoDevice *_this, void *dxgi_output, HM } SDL_zerop(mode); - mode->driverdata = data; + mode->internal = data; data->DeviceMode = devmode; mode->format = SDL_PIXELFORMAT_UNKNOWN; @@ -513,7 +513,7 @@ static SDL_bool WIN_GetMonitorPathInfo(SDL_VideoData *videodata, HMONITOR hMonit static float WIN_GetSDRWhitePoint(SDL_VideoDevice *_this, HMONITOR hMonitor) { DISPLAYCONFIG_PATH_INFO path_info; - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; float SDR_white_level = 1.0f; if (WIN_GetMonitorPathInfo(videodata, hMonitor, &path_info)) { @@ -574,12 +574,12 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI // ready to be added to allow any displays that we can't fully query to be // removed for (i = 0; i < _this->num_displays; ++i) { - SDL_DisplayData *driverdata = _this->displays[i]->driverdata; - if (SDL_wcscmp(driverdata->DeviceName, info->szDevice) == 0) { + SDL_DisplayData *internal = _this->displays[i]->internal; + if (SDL_wcscmp(internal->DeviceName, info->szDevice) == 0) { SDL_bool moved = (index != i); SDL_bool changed_bounds = SDL_FALSE; - if (driverdata->state != DisplayRemoved) { + if (internal->state != DisplayRemoved) { /* We've already enumerated this display, don't move it */ return; } @@ -598,8 +598,8 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI i = index; } - driverdata->MonitorHandle = hMonitor; - driverdata->state = DisplayUnchanged; + internal->MonitorHandle = hMonitor; + internal->state = DisplayUnchanged; if (!_this->setting_display_mode) { SDL_VideoDisplay *existing_display = _this->displays[i]; @@ -608,9 +608,9 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI SDL_ResetFullscreenDisplayModes(existing_display); SDL_SetDesktopDisplayMode(existing_display, &mode); if (WIN_GetDisplayBounds(_this, existing_display, &bounds) == 0 && - SDL_memcmp(&driverdata->bounds, &bounds, sizeof(bounds)) != 0) { + SDL_memcmp(&internal->bounds, &bounds, sizeof(bounds)) != 0) { changed_bounds = SDL_TRUE; - SDL_copyp(&driverdata->bounds, &bounds); + SDL_copyp(&internal->bounds, &bounds); } if (moved || changed_bounds) { SDL_SendDisplayEvent(existing_display, SDL_EVENT_DISPLAY_MOVED, 0, 0); @@ -636,7 +636,7 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI displaydata->state = DisplayAdded; SDL_zero(display); - display.name = WIN_GetDisplayNameVista(_this->driverdata, info->szDevice); + display.name = WIN_GetDisplayNameVista(_this->internal, info->szDevice); if (!display.name) { DISPLAY_DEVICEW device; SDL_zero(device); @@ -651,7 +651,7 @@ static void WIN_AddDisplay(SDL_VideoDevice *_this, HMONITOR hMonitor, const MONI display.current_orientation = current_orientation; display.content_scale = content_scale; display.device = _this; - display.driverdata = displaydata; + display.internal = displaydata; WIN_GetDisplayBounds(_this, &display, &displaydata->bounds); #ifdef HAVE_DXGI1_6_H WIN_GetHDRProperties(_this, hMonitor, &display.HDR); @@ -718,7 +718,7 @@ int WIN_InitModes(SDL_VideoDevice *_this) int WIN_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { - const SDL_DisplayData *data = display->driverdata; + const SDL_DisplayData *data = display->internal; MONITORINFO minfo; BOOL rc; @@ -740,7 +740,7 @@ int WIN_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_ int WIN_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Rect *rect) { - const SDL_DisplayData *data = display->driverdata; + const SDL_DisplayData *data = display->internal; MONITORINFO minfo; BOOL rc; @@ -762,7 +762,7 @@ int WIN_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *display int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) { - SDL_DisplayData *data = display->driverdata; + SDL_DisplayData *data = display->internal; void *dxgi_output; DWORD i; SDL_DisplayMode mode; @@ -775,15 +775,15 @@ int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) } if (SDL_ISPIXELFORMAT_INDEXED(mode.format)) { /* We don't support palettized modes now */ - SDL_free(mode.driverdata); + SDL_free(mode.internal); continue; } if (mode.format != SDL_PIXELFORMAT_UNKNOWN) { if (!SDL_AddFullscreenDisplayMode(display, &mode)) { - SDL_free(mode.driverdata); + SDL_free(mode.internal); } } else { - SDL_free(mode.driverdata); + SDL_free(mode.internal); } } @@ -795,7 +795,7 @@ int WIN_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *display) #ifdef DEBUG_MODES static void WIN_LogMonitor(SDL_VideoDevice *_this, HMONITOR mon) { - const SDL_VideoData *vid_data = (const SDL_VideoData *)_this->driverdata; + const SDL_VideoData *vid_data = (const SDL_VideoData *)_this->internal; MONITORINFOEX minfo; UINT xdpi = 0, ydpi = 0; char *name_utf8; @@ -824,8 +824,8 @@ static void WIN_LogMonitor(SDL_VideoDevice *_this, HMONITOR mon) int WIN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_DisplayMode *mode) { - SDL_DisplayData *displaydata = display->driverdata; - SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->driverdata; + SDL_DisplayData *displaydata = display->internal; + SDL_DisplayModeData *data = (SDL_DisplayModeData *)mode->internal; LONG status; #ifdef DEBUG_MODES @@ -843,7 +843,7 @@ int WIN_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *display, SDL_Di reset the monitor DPI to 192. (200% scaling) NOTE: these are temporary changes in DPI, not modifications to the Control Panel setting. */ - if (mode->driverdata == display->desktop_mode.driverdata) { + if (mode->internal == display->desktop_mode.internal) { #ifdef DEBUG_MODES SDL_Log("WIN_SetDisplayMode: resetting to original resolution"); #endif @@ -890,8 +890,8 @@ void WIN_RefreshDisplays(SDL_VideoDevice *_this) // Mark all displays as potentially invalid to detect // entries that have actually been removed for (i = 0; i < _this->num_displays; ++i) { - SDL_DisplayData *driverdata = _this->displays[i]->driverdata; - driverdata->state = DisplayRemoved; + SDL_DisplayData *internal = _this->displays[i]->internal; + internal->state = DisplayRemoved; } // Enumerate displays to add any new ones and mark still @@ -902,8 +902,8 @@ void WIN_RefreshDisplays(SDL_VideoDevice *_this) // in reverse as each delete takes effect immediately for (i = _this->num_displays - 1; i >= 0; --i) { SDL_VideoDisplay *display = _this->displays[i]; - SDL_DisplayData *driverdata = display->driverdata; - if (driverdata->state == DisplayRemoved) { + SDL_DisplayData *internal = display->internal; + if (internal->state == DisplayRemoved) { SDL_DelVideoDisplay(display->id, SDL_TRUE); } } @@ -911,8 +911,8 @@ void WIN_RefreshDisplays(SDL_VideoDevice *_this) // Send events for any newly added displays for (i = 0; i < _this->num_displays; ++i) { SDL_VideoDisplay *display = _this->displays[i]; - SDL_DisplayData *driverdata = display->driverdata; - if (driverdata->state == DisplayAdded) { + SDL_DisplayData *internal = display->internal; + if (internal->state == DisplayAdded) { SDL_SendDisplayEvent(display, SDL_EVENT_DISPLAY_ADDED, 0, 0); } } diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 1f46ffb29e482..0118048e444ee 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -38,7 +38,7 @@ static SDL_Cursor *WIN_CreateDefaultCursor() { SDL_Cursor *cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = LoadCursor(NULL, IDC_ARROW); + cursor->internal = LoadCursor(NULL, IDC_ARROW); } return cursor; @@ -187,7 +187,7 @@ static SDL_Cursor *WIN_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = hcursor; + cursor->internal = hcursor; } else { DestroyCursor(hcursor); } @@ -283,7 +283,7 @@ static SDL_Cursor *WIN_CreateSystemCursor(SDL_SystemCursor id) hcursor = LoadCursor(NULL, name); - cursor->driverdata = hcursor; + cursor->internal = hcursor; } return cursor; @@ -291,7 +291,7 @@ static SDL_Cursor *WIN_CreateSystemCursor(SDL_SystemCursor id) static void WIN_FreeCursor(SDL_Cursor *cursor) { - HCURSOR hcursor = (HCURSOR)cursor->driverdata; + HCURSOR hcursor = (HCURSOR)cursor->internal; DestroyCursor(hcursor); SDL_free(cursor); @@ -303,7 +303,7 @@ static int WIN_ShowCursor(SDL_Cursor *cursor) cursor = SDL_blank_cursor; } if (cursor) { - SDL_cursor = (HCURSOR)cursor->driverdata; + SDL_cursor = (HCURSOR)cursor->internal; } else { SDL_cursor = NULL; } @@ -336,7 +336,7 @@ void WIN_SetCursorPos(int x, int y) static int WIN_WarpMouse(SDL_Window *window, float x, float y) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; POINT pt; @@ -373,13 +373,13 @@ static int WIN_SetRelativeMouseMode(SDL_bool enabled) static int WIN_CaptureMouse(SDL_Window *window) { if (window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SetCapture(data->hwnd); } else { SDL_Window *focus_window = SDL_GetMouseFocus(); if (focus_window) { - SDL_WindowData *data = focus_window->driverdata; + SDL_WindowData *data = focus_window->internal; if (!data->mouse_tracked) { SDL_SetMouseFocus(NULL); } diff --git a/src/video/windows/SDL_windowsopengl.c b/src/video/windows/SDL_windowsopengl.c index 0c6a2a9ff8f76..7e17e8f83ef95 100644 --- a/src/video/windows/SDL_windowsopengl.c +++ b/src/video/windows/SDL_windowsopengl.c @@ -567,7 +567,7 @@ static int WIN_GL_ChoosePixelFormatARB(SDL_VideoDevice *_this, int *iAttribs, fl /* actual work of WIN_GL_SetupWindow() happens here. */ static int WIN_GL_SetupWindowInternal(SDL_VideoDevice *_this, SDL_Window *window) { - HDC hdc = window->driverdata->hdc; + HDC hdc = window->internal->hdc; PIXELFORMATDESCRIPTOR pfd; int pixel_format = 0; int iAttribs[64]; @@ -705,7 +705,7 @@ SDL_bool WIN_GL_UseEGL(SDL_VideoDevice *_this) SDL_GLContext WIN_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - HDC hdc = window->driverdata->hdc; + HDC hdc = window->internal->hdc; HGLRC context, share_context; if (_this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES && WIN_GL_UseEGL(_this)) { @@ -851,7 +851,7 @@ int WIN_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext } } - hdc = window->driverdata->hdc; + hdc = window->internal->hdc; if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC)context)) { return WIN_SetError("wglMakeCurrent()"); } @@ -884,7 +884,7 @@ int WIN_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) int WIN_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - HDC hdc = window->driverdata->hdc; + HDC hdc = window->internal->hdc; if (!SwapBuffers(hdc)) { return WIN_SetError("SwapBuffers()"); diff --git a/src/video/windows/SDL_windowsopengles.c b/src/video/windows/SDL_windowsopengles.c index 5136bf8d8c181..48ff20d1d6c8d 100644 --- a/src/video/windows/SDL_windowsopengles.c +++ b/src/video/windows/SDL_windowsopengles.c @@ -63,7 +63,7 @@ int WIN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) SDL_GLContext WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; #ifdef SDL_VIDEO_OPENGL_WGL if (_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES && @@ -107,7 +107,7 @@ SDL_EGL_MakeCurrent_impl(WIN) int WIN_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) { /* The current context is lost in here; save it and reset it. */ - SDL_WindowData *windowdata = window->driverdata; + SDL_WindowData *windowdata = window->internal; SDL_Window *current_win = SDL_GL_GetCurrentWindow(); SDL_GLContext current_ctx = SDL_GL_GetCurrentContext(); @@ -136,7 +136,7 @@ int WIN_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window) EGLSurface WIN_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *windowdata = window->driverdata; + SDL_WindowData *windowdata = window->internal; return windowdata->egl_surface; } diff --git a/src/video/windows/SDL_windowsrawinput.c b/src/video/windows/SDL_windowsrawinput.c index f186c281debb8..b9ed5419c3f75 100644 --- a/src/video/windows/SDL_windowsrawinput.c +++ b/src/video/windows/SDL_windowsrawinput.c @@ -181,7 +181,7 @@ static int WIN_SetRawInputEnabled(SDL_VideoDevice *_this, Uint32 flags) static int WIN_UpdateRawInputEnabled(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Uint32 flags = 0; if (data->raw_mouse_enabled) { flags |= ENABLE_RAW_MOUSE_INPUT; @@ -201,14 +201,14 @@ static int WIN_UpdateRawInputEnabled(SDL_VideoDevice *_this) int WIN_SetRawMouseEnabled(SDL_VideoDevice *_this, SDL_bool enabled) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; data->raw_mouse_enabled = enabled; return WIN_UpdateRawInputEnabled(_this); } int WIN_SetRawKeyboardEnabled(SDL_VideoDevice *_this, SDL_bool enabled) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; data->raw_keyboard_enabled = enabled; return WIN_UpdateRawInputEnabled(_this); } diff --git a/src/video/windows/SDL_windowsshape.c b/src/video/windows/SDL_windowsshape.c index ecf502dcf4716..dd86b70d24b95 100644 --- a/src/video/windows/SDL_windowsshape.c +++ b/src/video/windows/SDL_windowsshape.c @@ -69,7 +69,7 @@ static HRGN GenerateSpanListRegion(SDL_Surface *shape, int offset_x, int offset_ int WIN_UpdateWindowShape(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *shape) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HRGN mask = NULL; /* Generate a set of spans for the region */ diff --git a/src/video/windows/SDL_windowsvideo.c b/src/video/windows/SDL_windowsvideo.c index ba43b36f64943..4fd513529653b 100644 --- a/src/video/windows/SDL_windowsvideo.c +++ b/src/video/windows/SDL_windowsvideo.c @@ -93,7 +93,7 @@ extern void D3D12_XBOX_GetResolution(Uint32 *width, Uint32 *height); static void WIN_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *data = device->driverdata; + SDL_VideoData *data = device->internal; SDL_UnregisterApp(); #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) @@ -115,8 +115,8 @@ static void WIN_DeleteDevice(SDL_VideoDevice *device) if (device->wakeup_lock) { SDL_DestroyMutex(device->wakeup_lock); } - SDL_free(device->driverdata->rawinput); - SDL_free(device->driverdata); + SDL_free(device->internal->rawinput); + SDL_free(device->internal); SDL_free(device); } @@ -138,7 +138,7 @@ static SDL_VideoDevice *WIN_CreateDevice(void) SDL_free(device); return NULL; } - device->driverdata = data; + device->internal = data; device->wakeup_lock = SDL_CreateMutex(); device->system_theme = WIN_GetSystemTheme(); @@ -335,7 +335,7 @@ VideoBootStrap WINDOWS_bootstrap = { static BOOL WIN_DeclareDPIAwareUnaware(SDL_VideoDevice *_this) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->SetProcessDpiAwarenessContext) { return data->SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_UNAWARE); @@ -350,7 +350,7 @@ static BOOL WIN_DeclareDPIAwareUnaware(SDL_VideoDevice *_this) static BOOL WIN_DeclareDPIAwareSystem(SDL_VideoDevice *_this) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->SetProcessDpiAwarenessContext) { /* Windows 10, version 1607 */ @@ -369,7 +369,7 @@ static BOOL WIN_DeclareDPIAwareSystem(SDL_VideoDevice *_this) static BOOL WIN_DeclareDPIAwarePerMonitor(SDL_VideoDevice *_this) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->SetProcessDpiAwarenessContext) { /* Windows 10, version 1607 */ @@ -391,7 +391,7 @@ static BOOL WIN_DeclareDPIAwarePerMonitorV2(SDL_VideoDevice *_this) #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) return FALSE; #else - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; /* Declare DPI aware (may have been done in external code or a manifest, as well) */ if (data->SetProcessDpiAwarenessContext) { @@ -427,7 +427,7 @@ static BOOL WIN_DeclareDPIAwarePerMonitorV2(SDL_VideoDevice *_this) #ifdef HIGHDPI_DEBUG static const char *WIN_GetDPIAwareness(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->GetThreadDpiAwarenessContext && data->AreDpiAwarenessContextsEqual) { DPI_AWARENESS_CONTEXT context = data->GetThreadDpiAwarenessContext(); @@ -466,7 +466,7 @@ static void WIN_InitDPIAwareness(SDL_VideoDevice *_this) int WIN_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; WIN_InitDPIAwareness(_this); @@ -641,7 +641,7 @@ int SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outpu return SDL_SetError("SDL was compiled without DXGI support due to missing dxgi.h header"); #else const SDL_VideoDevice *videodevice = SDL_GetVideoDevice(); - const SDL_VideoData *videodata = videodevice ? videodevice->driverdata : NULL; + const SDL_VideoData *videodata = videodevice ? videodevice->internal : NULL; SDL_DisplayData *pData = SDL_GetDisplayDriverData(displayID); int nAdapter, nOutput; IDXGIAdapter *pDXGIAdapter; @@ -714,7 +714,7 @@ SDL_SystemTheme WIN_GetSystemTheme(void) SDL_bool WIN_IsPerMonitorV2DPIAware(SDL_VideoDevice *_this) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->AreDpiAwarenessContextsEqual && data->GetThreadDpiAwarenessContext) { /* Windows 10, version 1607 */ diff --git a/src/video/windows/SDL_windowsvulkan.c b/src/video/windows/SDL_windowsvulkan.c index bd774df5f3c56..abd2d034ac208 100644 --- a/src/video/windows/SDL_windowsvulkan.c +++ b/src/video/windows/SDL_windowsvulkan.c @@ -126,7 +126,7 @@ int WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) { - SDL_WindowData *windowData = window->driverdata; + SDL_WindowData *windowData = window->internal; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr)_this->vulkan_config.vkGetInstanceProcAddr; PFN_vkCreateWin32SurfaceKHR vkCreateWin32SurfaceKHR = diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index 4b9bcb7eeb67f..af8eb417edbe8 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -183,7 +183,7 @@ static DWORD GetWindowStyleEx(SDL_Window *window) */ static int WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, DWORD styleEx, BOOL menu, int *x, int *y, int *width, int *height, SDL_WindowRect rect_type) { - SDL_VideoData *videodata = SDL_GetVideoDevice() ? SDL_GetVideoDevice()->driverdata : NULL; + SDL_VideoData *videodata = SDL_GetVideoDevice() ? SDL_GetVideoDevice()->internal : NULL; RECT rect; /* Client rect, in points */ @@ -229,7 +229,7 @@ static int WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, DWORD AdjustWindowRectEx. */ if (videodata) { UINT frame_dpi; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; frame_dpi = (data && videodata->GetDpiForWindow) ? videodata->GetDpiForWindow(data->hwnd) : USER_DEFAULT_SCREEN_DPI; if (videodata->AdjustWindowRectExForDpi(&rect, style, menu, styleEx, frame_dpi) == 0) { return WIN_SetError("AdjustWindowRectExForDpi()"); @@ -262,7 +262,7 @@ static int WIN_AdjustWindowRectWithStyle(SDL_Window *window, DWORD style, DWORD int WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *height, SDL_WindowRect rect_type) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; DWORD style, styleEx; BOOL menu; @@ -280,7 +280,7 @@ int WIN_AdjustWindowRect(SDL_Window *window, int *x, int *y, int *width, int *he int WIN_AdjustWindowRectForHWND(HWND hwnd, LPRECT lpRect, UINT frame_dpi) { SDL_VideoDevice *videodevice = SDL_GetVideoDevice(); - SDL_VideoData *videodata = videodevice ? videodevice->driverdata : NULL; + SDL_VideoData *videodata = videodevice ? videodevice->internal : NULL; DWORD style, styleEx; BOOL menu; @@ -315,7 +315,7 @@ int WIN_AdjustWindowRectForHWND(HWND hwnd, LPRECT lpRect, UINT frame_dpi) int WIN_SetWindowPositionInternal(SDL_Window *window, UINT flags, SDL_WindowRect rect_type) { SDL_Window *child_window; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; HWND top; int x, y; @@ -378,7 +378,7 @@ static SDL_WindowEraseBackgroundMode GetEraseBackgroundModeHint() static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd, HWND parent) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_WindowData *data; /* Allocate the window data */ @@ -424,7 +424,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd } #endif - window->driverdata = data; + window->internal = data; /* Set up the window proc function */ #ifdef GWLP_WNDPROC @@ -582,7 +582,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, HWND hwnd static void CleanupWindowData(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data) { SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, WIN_MouseRelativeModeCenterChanged, data); @@ -616,7 +616,7 @@ static void CleanupWindowData(SDL_VideoDevice *_this, SDL_Window *window) } SDL_free(data); } - window->driverdata = NULL; + window->internal = NULL; } static void WIN_ConstrainPopup(SDL_Window *window) @@ -667,7 +667,7 @@ static void WIN_SetKeyboardFocus(SDL_Window *window) topmost = topmost->parent; } - topmost->driverdata->keyboard_focus = window; + topmost->internal->keyboard_focus = window; SDL_SetKeyboardFocus(window); } @@ -688,7 +688,7 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI int w, h; if (SDL_WINDOW_IS_POPUP(window)) { - parent = window->parent->driverdata->hwnd; + parent = window->parent->internal->hwnd; } else if (window->flags & SDL_WINDOW_UTILITY) { parent = CreateWindow(SDL_Appname, TEXT(""), STYLE_BASIC, 0, 0, 32, 32, NULL, NULL, SDL_Instance, NULL); } @@ -765,7 +765,7 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI DescribePixelFormat(hdc, pixel_format, sizeof(pfd), &pfd); ReleaseDC(share_hwnd, hdc); - if (!SetPixelFormat(window->driverdata->hdc, pixel_format, &pfd)) { + if (!SetPixelFormat(window->internal->hdc, pixel_format, &pfd)) { WIN_DestroyWindow(_this, window); return WIN_SetError("SetPixelFormat()"); } @@ -811,7 +811,7 @@ int WIN_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI void WIN_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; LPTSTR title = WIN_UTF8ToString(window->title); SetWindowText(hwnd, title); SDL_free(title); @@ -821,7 +821,7 @@ void WIN_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) int WIN_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; HICON hicon = NULL; BYTE *icon_bmp; int icon_len, mask_len, row_len, y; @@ -892,10 +892,10 @@ int WIN_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) if (!(window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) { WIN_ConstrainPopup(window); return WIN_SetWindowPositionInternal(window, - window->driverdata->copybits_flag | SWP_NOZORDER | SWP_NOOWNERZORDER | + window->internal->copybits_flag | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE, SDL_WINDOWRECT_FLOATING); } else { - window->driverdata->floating_rect_pending = SDL_TRUE; + window->internal->floating_rect_pending = SDL_TRUE; } } else { return SDL_UpdateFullscreenMode(window, SDL_TRUE, SDL_TRUE); @@ -907,16 +907,16 @@ int WIN_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) void WIN_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { if (!(window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_MAXIMIZED))) { - WIN_SetWindowPositionInternal(window, window->driverdata->copybits_flag | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE, SDL_WINDOWRECT_FLOATING); + WIN_SetWindowPositionInternal(window, window->internal->copybits_flag | SWP_NOMOVE | SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE, SDL_WINDOWRECT_FLOATING); } else { - window->driverdata->floating_rect_pending = SDL_TRUE; + window->internal->floating_rect_pending = SDL_TRUE; } } int WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right) { #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; RECT rcClient; /* rcClient stores the size of the inner window, while rcWindow stores the outer size relative to the top-left @@ -930,7 +930,7 @@ int WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *to return 0; #else /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; RECT rcClient, rcWindow; POINT ptDiff; @@ -982,7 +982,7 @@ int WIN_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *to void WIN_GetWindowSizeInPixels(SDL_VideoDevice *_this, SDL_Window *window, int *w, int *h) { - const SDL_WindowData *data = window->driverdata; + const SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; RECT rect; @@ -1013,11 +1013,11 @@ void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) if (window->flags & SDL_WINDOW_MODAL) { - EnableWindow(window->parent->driverdata->hwnd, FALSE); + EnableWindow(window->parent->internal->hwnd, FALSE); } #endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ - hwnd = window->driverdata->hwnd; + hwnd = window->internal->hwnd; style = GetWindowLong(hwnd, GWL_EXSTYLE); if (style & WS_EX_NOACTIVATE) { bActivate = SDL_FALSE; @@ -1026,7 +1026,7 @@ void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) ShowWindow(hwnd, SW_SHOW); } else { /* Use SetWindowPos instead of ShowWindow to avoid activating the parent window if this is a child window */ - SetWindowPos(hwnd, NULL, 0, 0, 0, 0, window->driverdata->copybits_flag | SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); + SetWindowPos(hwnd, NULL, 0, 0, 0, 0, window->internal->copybits_flag | SWP_SHOWWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER); } if (window->flags & SDL_WINDOW_POPUP_MENU && bActivate) { @@ -1038,11 +1038,11 @@ void WIN_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) void WIN_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) if (window->flags & SDL_WINDOW_MODAL) { - EnableWindow(window->parent->driverdata->hwnd, TRUE); + EnableWindow(window->parent->internal->hwnd, TRUE); } #endif /*!defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES)*/ @@ -1081,7 +1081,7 @@ void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) DWORD dwMyID = 0u; DWORD dwCurID = 0u; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; if (bForce) { hCurWnd = GetForegroundWindow(); @@ -1114,7 +1114,7 @@ void WIN_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { HWND hwnd = data->hwnd; @@ -1143,13 +1143,13 @@ void WIN_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) void WIN_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { - HWND hwnd = window->driverdata->hwnd; + HWND hwnd = window->internal->hwnd; ShowWindow(hwnd, SW_MINIMIZE); } void WIN_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool bordered) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; DWORD style; @@ -1165,7 +1165,7 @@ void WIN_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool void WIN_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; DWORD style; @@ -1183,7 +1183,7 @@ void WIN_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bo void WIN_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (!(window->flags & SDL_WINDOW_FULLSCREEN)) { HWND hwnd = data->hwnd; data->expected_resize = SDL_TRUE; @@ -1238,8 +1238,8 @@ static COLORREF WIN_UpdateBorderColorForHWND(HWND hwnd, COLORREF colorRef) int WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - SDL_DisplayData *displaydata = display->driverdata; - SDL_WindowData *data = window->driverdata; + SDL_DisplayData *displaydata = display->internal; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; MONITORINFO minfo; DWORD style, styleEx; @@ -1343,7 +1343,7 @@ int WIN_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_Vide #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) void WIN_UpdateWindowICCProfile(SDL_Window *window, SDL_bool send_event) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); if (displaydata) { @@ -1371,7 +1371,7 @@ void WIN_UpdateWindowICCProfile(SDL_Window *window, SDL_bool send_event) void *WIN_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; char *filename_utf8; void *iccProfileData = NULL; @@ -1388,7 +1388,7 @@ void *WIN_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t static void WIN_GrabKeyboard(SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HMODULE module; if (data->keyboard_hook) { @@ -1422,7 +1422,7 @@ static void WIN_GrabKeyboard(SDL_Window *window) void WIN_UngrabKeyboard(SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data->keyboard_hook) { UnhookWindowsHookEx(data->keyboard_hook); @@ -1528,7 +1528,7 @@ void SDL_HelperWindowDestroy(void) #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) void WIN_OnWindowEnter(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (!data || !data->hwnd) { /* The window wasn't fully initialized */ @@ -1550,7 +1550,7 @@ static BOOL GetClientScreenRect(HWND hwnd, RECT *rect) void WIN_UpdateClipCursor(SDL_Window *window) { SDL_VideoDevice *videodevice = SDL_GetVideoDevice(); - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_Mouse *mouse = SDL_GetMouse(); RECT rect, clipped_rect; @@ -1661,7 +1661,7 @@ int WIN_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opaci #if defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) return -1; #else - const SDL_WindowData *data = window->driverdata; + const SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; const LONG style = GetWindowLong(hwnd, GWL_EXSTYLE); @@ -1695,7 +1695,7 @@ int WIN_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opaci #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) void WIN_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) { - const SDL_WindowData *data = window->driverdata; + const SDL_WindowData *data = window->internal; DragAcceptFiles(data->hwnd, accept ? TRUE : FALSE); } @@ -1705,7 +1705,7 @@ int WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperati SDL_zero(desc); desc.cbSize = sizeof(desc); - desc.hwnd = window->driverdata->hwnd; + desc.hwnd = window->internal->hwnd; switch (operation) { case SDL_FLASH_CANCEL: desc.dwFlags = FLASHW_STOP; @@ -1728,7 +1728,7 @@ int WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperati void WIN_ShowWindowSystemMenu(SDL_Window *window, int x, int y) { - const SDL_WindowData *data = window->driverdata; + const SDL_WindowData *data = window->internal; POINT pt; pt.x = x; @@ -1739,7 +1739,7 @@ void WIN_ShowWindowSystemMenu(SDL_Window *window, int x, int y) int WIN_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool focusable) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; HWND hwnd = data->hwnd; const LONG style = GetWindowLong(hwnd, GWL_EXSTYLE); @@ -1780,8 +1780,8 @@ void WIN_UpdateDarkModeForHWND(HWND hwnd) int WIN_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window) { #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) - SDL_WindowData *modal_data = modal_window->driverdata; - const LONG_PTR parent_hwnd = (LONG_PTR)(parent_window ? parent_window->driverdata->hwnd : NULL); + SDL_WindowData *modal_data = modal_window->internal; + const LONG_PTR parent_hwnd = (LONG_PTR)(parent_window ? parent_window->internal->hwnd : NULL); const LONG_PTR old_ptr = GetWindowLongPtr(modal_data->hwnd, GWLP_HWNDPARENT); const DWORD style = GetWindowLong(modal_data->hwnd, GWL_STYLE); diff --git a/src/video/winrt/SDL_winrtgamebar.cpp b/src/video/winrt/SDL_winrtgamebar.cpp index 63d27b6e080f2..18bbbc9c0dd78 100644 --- a/src/video/winrt/SDL_winrtgamebar.cpp +++ b/src/video/winrt/SDL_winrtgamebar.cpp @@ -144,7 +144,7 @@ static void WINRT_HandleGameBarIsInputRedirected_NonMainThread(Platform::Object void WINRT_InitGameBar(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; + SDL_VideoData *data = _this->internal; IGameBarStatics_ *gameBar = WINRT_GetGameBar(); if (gameBar) { /* GameBar.IsInputRedirected events can come in via something other than @@ -157,26 +157,26 @@ void WINRT_InitGameBar(SDL_VideoDevice *_this) Windows::Foundation::EventHandler ^ handler = ref new Windows::Foundation::EventHandler(&WINRT_HandleGameBarIsInputRedirected_NonMainThread); __FIEventHandler_1_IInspectable *pHandler = reinterpret_cast<__FIEventHandler_1_IInspectable *>(handler); - gameBar->add_IsInputRedirectedChanged(pHandler, &driverdata->gameBarIsInputRedirectedToken); + gameBar->add_IsInputRedirectedChanged(pHandler, &data->gameBarIsInputRedirectedToken); gameBar->Release(); } } void WINRT_QuitGameBar(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata; + SDL_VideoData *data; IGameBarStatics_ *gameBar; - if (!_this || !_this->driverdata) { + if (!_this || !_this->internal) { return; } gameBar = WINRT_GetGameBar(); if (!gameBar) { return; } - driverdata = _this->driverdata; - if (driverdata->gameBarIsInputRedirectedToken.Value) { - gameBar->remove_IsInputRedirectedChanged(driverdata->gameBarIsInputRedirectedToken); - driverdata->gameBarIsInputRedirectedToken.Value = 0; + data = _this->internal; + if (data->gameBarIsInputRedirectedToken.Value) { + gameBar->remove_IsInputRedirectedChanged(data->gameBarIsInputRedirectedToken); + data->gameBarIsInputRedirectedToken.Value = 0; } WINRT_MainThreadDispatcher = nullptr; gameBar->Release(); diff --git a/src/video/winrt/SDL_winrtkeyboard.cpp b/src/video/winrt/SDL_winrtkeyboard.cpp index 5598ef56b482a..02a68dc44b851 100644 --- a/src/video/winrt/SDL_winrtkeyboard.cpp +++ b/src/video/winrt/SDL_winrtkeyboard.cpp @@ -88,7 +88,7 @@ void WINRT_ProcessCharacterReceivedEvent(SDL_Window *window, Windows::UI::Core:: return; } - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (SDL_TextInputActive(window)) { /* Characters outside Unicode Basic Multilingual Plane (BMP) diff --git a/src/video/winrt/SDL_winrtmouse.cpp b/src/video/winrt/SDL_winrtmouse.cpp index 6ab9a3d7eaa52..bb9c5dd09efdb 100644 --- a/src/video/winrt/SDL_winrtmouse.cpp +++ b/src/video/winrt/SDL_winrtmouse.cpp @@ -120,12 +120,12 @@ static SDL_Cursor *WINRT_CreateSystemCursor(SDL_SystemCursor id) if (cursor) { /* Create a pointer to a COM reference to a cursor. The extra pointer is used (on top of the COM reference) to allow the cursor - to be referenced by the SDL_cursor's driverdata field, which is + to be referenced by the SDL_cursor's internal field, which is a void pointer. */ CoreCursor ^ *theCursor = new CoreCursor ^ (nullptr); *theCursor = ref new CoreCursor(cursorType, 0); - cursor->driverdata = (void *)theCursor; + cursor->internal = (void *)theCursor; } return cursor; @@ -138,8 +138,8 @@ static SDL_Cursor *WINRT_CreateDefaultCursor() static void WINRT_FreeCursor(SDL_Cursor *cursor) { - if (cursor->driverdata) { - CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->driverdata; + if (cursor->internal) { + CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->internal; *theCursor = nullptr; // Release the COM reference to the CoreCursor delete theCursor; // Delete the pointer to the COM reference } @@ -155,7 +155,7 @@ static int WINRT_ShowCursor(SDL_Cursor *cursor) CoreWindow ^ coreWindow = CoreWindow::GetForCurrentThread(); if (cursor) { - CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->driverdata; + CoreCursor ^ *theCursor = (CoreCursor ^ *)cursor->internal; coreWindow->PointerCursor = *theCursor; } else { // HACK ALERT: TL;DR - Hiding the cursor in WinRT/UWP apps is weird, and diff --git a/src/video/winrt/SDL_winrtopengles.cpp b/src/video/winrt/SDL_winrtopengles.cpp index 4dfba50eef346..ee1de1ee85e66 100644 --- a/src/video/winrt/SDL_winrtopengles.cpp +++ b/src/video/winrt/SDL_winrtopengles.cpp @@ -54,7 +54,7 @@ static const int ANGLE_D3D_FEATURE_LEVEL_ANY = 0; extern "C" int WINRT_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; if (SDL_EGL_LoadLibrary(_this, path, EGL_DEFAULT_DISPLAY, 0) != 0) { return -1; @@ -186,7 +186,7 @@ WINRT_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) extern "C" void WINRT_GLES_UnloadLibrary(SDL_VideoDevice *_this) { - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; /* Release SDL's own COM reference to the ANGLE/WinRT IWinrtEglWindow */ if (video_data->winrtEglWindow) { diff --git a/src/video/winrt/SDL_winrtpointerinput.cpp b/src/video/winrt/SDL_winrtpointerinput.cpp index dd3c9b2b3a7c9..41dc30f307c26 100644 --- a/src/video/winrt/SDL_winrtpointerinput.cpp +++ b/src/video/winrt/SDL_winrtpointerinput.cpp @@ -57,7 +57,7 @@ WINRT_TransformCursorPosition(SDL_Window *window, return rawPosition; } - SDL_WindowData *windowData = window->driverdata; + SDL_WindowData *windowData = window->internal; if (windowData->coreWindow == nullptr) { // For some reason, the window isn't associated with a CoreWindow. // This might end up being the case as XAML support is extended. diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 03d3194b09678..5c7bf0f29222f 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -89,8 +89,8 @@ SDL_Window *WINRT_GlobalSDLWindow = NULL; static void WINRT_DeleteDevice(SDL_VideoDevice *device) { - if (device->driverdata) { - SDL_VideoData *video_data = device->driverdata; + if (device->internal) { + SDL_VideoData *video_data = device->internal; if (video_data->winrtEglWindow) { video_data->winrtEglWindow->Release(); } @@ -116,7 +116,7 @@ static SDL_VideoDevice *WINRT_CreateDevice(void) SDL_free(device); return NULL; } - device->driverdata = data; + device->internal = data; /* Set the function pointers */ device->VideoInit = WINRT_VideoInit; @@ -222,7 +222,7 @@ static void SDLCALL WINRT_SetDisplayOrientationsPreference(void *userdata, const int WINRT_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; + SDL_VideoData *internal = _this->internal; if (WINRT_InitModes(_this) < 0) { return -1; } @@ -234,9 +234,9 @@ int WINRT_VideoInit(SDL_VideoDevice *_this) WINRT_InitMouse(_this); WINRT_InitTouch(_this); WINRT_InitGameBar(_this); - if (driverdata) { + if (internal) { /* Initialize screensaver-disabling support */ - driverdata->displayRequest = WINRT_CreateDisplayRequest(_this); + internal->displayRequest = WINRT_CreateDisplayRequest(_this); } /* Assume we have a mouse and keyboard */ @@ -466,10 +466,10 @@ static int WINRT_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *displa void WINRT_VideoQuit(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; - if (driverdata && driverdata->displayRequest) { - driverdata->displayRequest->Release(); - driverdata->displayRequest = NULL; + SDL_VideoData *internal = _this->internal; + if (internal && internal->displayRequest) { + internal->displayRequest->Release(); + internal->displayRequest = NULL; } WINRT_QuitGameBar(_this); WINRT_QuitMouse(_this); @@ -481,7 +481,7 @@ extern "C" SDL_WindowFlags WINRT_DetectWindowFlags(SDL_Window *window) { SDL_WindowFlags latestFlags = 0; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; bool is_fullscreen = false; #if SDL_WINRT_USE_APPLICATIONVIEW @@ -592,7 +592,7 @@ int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie if (!data) { return SDL_OutOfMemory(); } - window->driverdata = data; + window->internal = data; data->sdlWindow = window; data->high_surrogate = L'\0'; @@ -620,7 +620,7 @@ int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie data->egl_surface = EGL_NO_SURFACE; } else { /* OpenGL ES 2 was requested. Set up an EGL surface. */ - SDL_VideoData *video_data = _this->driverdata; + SDL_VideoData *video_data = _this->internal; /* Call SDL_EGL_ChooseConfig and eglCreateWindowSurface directly, * rather than via SDL_EGL_CreateSurface, as older versions of @@ -735,7 +735,7 @@ int WINRT_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propertie void WINRT_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { #if NTDDI_VERSION >= NTDDI_WIN10 - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; const Windows::Foundation::Size size((float)window->floating.w, (float)window->floating.h); if (data->appView->TryResizeView(size)) { SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_RESIZED, window->floating.w, window->floating.h); @@ -746,7 +746,7 @@ void WINRT_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) int WINRT_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_VideoDisplay *display, SDL_FullscreenOp fullscreen) { #if NTDDI_VERSION >= NTDDI_WIN10 - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; bool isWindowActive = WINRT_IsCoreWindowActive(data->coreWindow.Get()); if (isWindowActive) { if (fullscreen) { @@ -766,7 +766,7 @@ int WINRT_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, SDL_Vi void WINRT_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (WINRT_GlobalSDLWindow == window) { WINRT_GlobalSDLWindow = NULL; @@ -776,7 +776,7 @@ void WINRT_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) // Delete the internal window data: delete data; data = NULL; - window->driverdata = NULL; + window->internal = NULL; } } @@ -826,9 +826,9 @@ static ABI::Windows::System::Display::IDisplayRequest *WINRT_CreateDisplayReques int WINRT_SuspendScreenSaver(SDL_VideoDevice *_this) { - SDL_VideoData *driverdata = _this->driverdata; - if (driverdata && driverdata->displayRequest) { - ABI::Windows::System::Display::IDisplayRequest *displayRequest = (ABI::Windows::System::Display::IDisplayRequest *)driverdata->displayRequest; + SDL_VideoData *internal = _this->internal; + if (internal && internal->displayRequest) { + ABI::Windows::System::Display::IDisplayRequest *displayRequest = (ABI::Windows::System::Display::IDisplayRequest *)internal->displayRequest; if (_this->suspend_screensaver) { displayRequest->RequestActive(); } else { diff --git a/src/video/x11/SDL_x11clipboard.c b/src/video/x11/SDL_x11clipboard.c index a016f2d2cbf32..66316ba5c385e 100644 --- a/src/video/x11/SDL_x11clipboard.c +++ b/src/video/x11/SDL_x11clipboard.c @@ -40,7 +40,7 @@ static const char *text_mime_types[] = { /* Get any application owned window handle for clipboard association */ static Window GetWindow(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; /* We create an unmapped window that exists just to manage the clipboard, since X11 selection data is tied to a specific window and dies with it. @@ -64,7 +64,7 @@ static Window GetWindow(SDL_VideoDevice *_this) static int SetSelectionData(SDL_VideoDevice *_this, Atom selection, SDL_ClipboardDataCallback callback, void *userdata, const char **mime_types, size_t mime_count, Uint32 sequence) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; Window window; SDLX11_ClipboardData *clipboard; @@ -159,7 +159,7 @@ static SDL_bool WaitForSelection(SDL_VideoDevice *_this, Atom selection_type, SD static void *GetSelectionData(SDL_VideoDevice *_this, Atom selection_type, const char *mime_type, size_t *length) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; Window window; Window owner; @@ -267,7 +267,7 @@ const char **X11_GetTextMimeTypes(SDL_VideoDevice *_this, size_t *num_mime_types int X11_SetClipboardData(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Atom XA_CLIPBOARD = X11_XInternAtom(videodata->display, "CLIPBOARD", 0); if (XA_CLIPBOARD == None) { return SDL_SetError("Couldn't access X clipboard"); @@ -277,7 +277,7 @@ int X11_SetClipboardData(SDL_VideoDevice *_this) void *X11_GetClipboardData(SDL_VideoDevice *_this, const char *mime_type, size_t *length) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Atom XA_CLIPBOARD = X11_XInternAtom(videodata->display, "CLIPBOARD", 0); if (XA_CLIPBOARD == None) { SDL_SetError("Couldn't access X clipboard"); @@ -328,7 +328,7 @@ SDL_bool X11_HasPrimarySelectionText(SDL_VideoDevice *_this) void X11_QuitClipboard(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->primary_selection.sequence == 0) { SDL_free(data->primary_selection.userdata); } diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 3831c4fcbf035..7f62f37e84c77 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -221,7 +221,7 @@ void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata) #ifdef SDL_VIDEO_DRIVER_X11_SUPPORTS_GENERIC_EVENTS static void X11_HandleGenericEvent(SDL_VideoDevice *_this, XEvent *xev) { - SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->internal; /* event is a union, so cookie == &event, but this is type safe. */ XGenericEventCookie *cookie = &xev->xcookie; @@ -236,7 +236,7 @@ static void X11_HandleGenericEvent(SDL_VideoDevice *_this, XEvent *xev) static unsigned X11_GetNumLockModifierMask(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; unsigned num_mask = 0; int i, j; @@ -261,7 +261,7 @@ static unsigned X11_GetNumLockModifierMask(SDL_VideoDevice *_this) static unsigned X11_GetScrollLockModifierMask(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; unsigned num_mask = 0; int i, j; @@ -286,7 +286,7 @@ static unsigned X11_GetScrollLockModifierMask(SDL_VideoDevice *_this) void X11_ReconcileKeyboardState(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; char keys[32]; int keycode; @@ -393,7 +393,7 @@ static void X11_DispatchUnmapNotify(SDL_WindowData *data) static void DispatchWindowMove(SDL_VideoDevice *_this, const SDL_WindowData *data, const SDL_Point *point) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_Window *window = data->window; Display *display = videodata->display; XEvent evt; @@ -424,7 +424,7 @@ static void ScheduleWindowMove(SDL_VideoDevice *_this, SDL_WindowData *data, con static void InitiateWindowResize(SDL_VideoDevice *_this, const SDL_WindowData *data, const SDL_Point *point, int direction) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_Window *window = data->window; Display *display = videodata->display; XEvent evt; @@ -527,7 +527,7 @@ static void X11_UpdateUserTime(SDL_WindowData *data, const unsigned long latest) static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xevent) { int i; - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; SDL_assert(videodata->clipboard_window != None); @@ -666,7 +666,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven static void X11_HandleSettingsEvent(SDL_VideoDevice *_this, const XEvent *xevent) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_assert(videodata->xsettings_window != None); SDL_assert(xevent->xany.window == videodata->xsettings_window); @@ -726,7 +726,7 @@ static int XLookupStringAsUTF8(XKeyEvent *event_struct, char *buffer_return, int SDL_WindowData *X11_FindWindow(SDL_VideoDevice *_this, Window window) { - const SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + const SDL_VideoData *videodata = (SDL_VideoData *)_this->internal; int i; if (videodata && videodata->windowlist) { @@ -742,7 +742,7 @@ SDL_WindowData *X11_FindWindow(SDL_VideoDevice *_this, Window window) void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_KeyboardID keyboardID, XEvent *xevent) { - SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->internal; Display *display = videodata->display; KeyCode keycode = xevent->xkey.keycode; KeySym keysym = NoSymbol; @@ -842,7 +842,7 @@ void X11_HandleKeyEvent(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_ void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_MouseID mouseID, int button, const float x, const float y, const unsigned long time) { SDL_Window *window = windowdata->window; - const SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + const SDL_VideoData *videodata = (SDL_VideoData *)_this->internal; Display *display = videodata->display; int xticks = 0, yticks = 0; #ifdef DEBUG_XEVENTS @@ -879,7 +879,7 @@ void X11_HandleButtonPress(SDL_VideoDevice *_this, SDL_WindowData *windowdata, S void X11_HandleButtonRelease(SDL_VideoDevice *_this, SDL_WindowData *windowdata, SDL_MouseID mouseID, int button) { SDL_Window *window = windowdata->window; - const SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + const SDL_VideoData *videodata = (SDL_VideoData *)_this->internal; Display *display = videodata->display; /* The X server sends a Release event for each Press for wheels. Ignore them. */ int xticks = 0, yticks = 0; @@ -927,7 +927,7 @@ void X11_GetBorderValues(SDL_WindowData *data) static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display; SDL_WindowData *data; XClientMessageEvent m; @@ -1097,7 +1097,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) #ifdef SDL_VIDEO_DRIVER_X11_XFIXES { /* Only create the barriers if we have input focus */ - SDL_WindowData *windowdata = data->window->driverdata; + SDL_WindowData *windowdata = data->window->internal; if ((data->pointer_barrier_active == SDL_TRUE) && windowdata->window->flags & SDL_WINDOW_INPUT_FOCUS) { X11_ConfineCursorWithFlags(_this, windowdata->window, &windowdata->barrier_rect, X11_BARRIER_HANDLED_BY_EVENT); } @@ -1800,7 +1800,7 @@ static void X11_DispatchEvent(SDL_VideoDevice *_this, XEvent *xevent) static void X11_HandleFocusChanges(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; int i; if (videodata && videodata->windowlist) { @@ -1837,9 +1837,9 @@ static SDL_bool X11_PollEvent(Display *display, XEvent *event) void X11_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *req_display = data->request_display; - Window xwindow = window->driverdata->xwindow; + Window xwindow = window->internal->xwindow; XClientMessageEvent event; SDL_memset(&event, 0, sizeof(XClientMessageEvent)); @@ -1857,7 +1857,7 @@ void X11_SendWakeupEvent(SDL_VideoDevice *_this, SDL_Window *window) int X11_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display; XEvent xevent; display = videodata->display; @@ -1912,7 +1912,7 @@ int X11_WaitEventTimeout(SDL_VideoDevice *_this, Sint64 timeoutNS) void X11_PumpEvents(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; XEvent xevent; int i; @@ -1920,10 +1920,10 @@ void X11_PumpEvents(SDL_VideoDevice *_this) * fullscreen. If there is no fullscreen window past the elapsed timeout, revert the mode switch. */ for (i = 0; i < _this->num_displays; ++i) { - if (_this->displays[i]->driverdata->mode_switch_deadline_ns) { + if (_this->displays[i]->internal->mode_switch_deadline_ns) { if (_this->displays[i]->fullscreen_window) { - _this->displays[i]->driverdata->mode_switch_deadline_ns = 0; - } else if (SDL_GetTicksNS() >= _this->displays[i]->driverdata->mode_switch_deadline_ns) { + _this->displays[i]->internal->mode_switch_deadline_ns = 0; + } else if (SDL_GetTicksNS() >= _this->displays[i]->internal->mode_switch_deadline_ns) { SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Time out elapsed after mode switch on display %" SDL_PRIu32 " with no window becoming fullscreen; reverting", _this->displays[i]->id); SDL_SetDisplayModeForDisplay(_this->displays[i], NULL); @@ -1993,7 +1993,7 @@ void X11_PumpEvents(SDL_VideoDevice *_this) int X11_SuspendScreenSaver(SDL_VideoDevice *_this) { #ifdef SDL_VIDEO_DRIVER_X11_XSCRNSAVER - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int dummy; int major_version, minor_version; #endif /* SDL_VIDEO_DRIVER_X11_XSCRNSAVER */ diff --git a/src/video/x11/SDL_x11framebuffer.c b/src/video/x11/SDL_x11framebuffer.c index 14b870efae771..e5181f346e70c 100644 --- a/src/video/x11/SDL_x11framebuffer.c +++ b/src/video/x11/SDL_x11framebuffer.c @@ -50,7 +50,7 @@ static SDL_bool have_mitshm(Display *dpy) int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_PixelFormat *format, void **pixels, int *pitch) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; XGCValues gcv; XVisualInfo vinfo; @@ -145,7 +145,7 @@ int X11_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, SDL_ int X11_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects, int numrects) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; int i; int x, y, w, h; @@ -223,7 +223,7 @@ int X11_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, cons void X11_DestroyWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display; if (!data) { diff --git a/src/video/x11/SDL_x11keyboard.c b/src/video/x11/SDL_x11keyboard.c index 5320ef2d5e971..753abb3c83490 100644 --- a/src/video/x11/SDL_x11keyboard.c +++ b/src/video/x11/SDL_x11keyboard.c @@ -83,7 +83,7 @@ static SDL_Scancode X11_KeyCodeToSDLScancode(SDL_VideoDevice *_this, KeyCode key KeySym X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode keycode, unsigned char group, unsigned int mod_mask) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; KeySym keysym; unsigned int mods_ret[16]; @@ -125,7 +125,7 @@ KeySym X11_KeyCodeToSym(SDL_VideoDevice *_this, KeyCode keycode, unsigned char g int X11_InitKeyboard(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int i = 0; int j = 0; int min_keycode, max_keycode; @@ -343,7 +343,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) { SDL_KMOD_MODE | SDL_KMOD_SHIFT | SDL_KMOD_CAPS, Mod5Mask | ShiftMask | LockMask } }; - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int i; SDL_Scancode scancode; SDL_Keymap *keymap; @@ -392,7 +392,7 @@ void X11_UpdateKeymap(SDL_VideoDevice *_this, SDL_bool send_event) void X11_QuitKeyboard(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; #ifdef SDL_VIDEO_DRIVER_X11_HAS_XKBLOOKUPKEYSYM if (data->xkb) { @@ -409,7 +409,7 @@ void X11_QuitKeyboard(SDL_VideoDevice *_this) static void X11_ResetXIM(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef X_HAVE_UTF8_STRING - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data && data->ic) { /* Clear any partially entered dead keys */ @@ -447,13 +447,13 @@ int X11_UpdateTextInputArea(SDL_VideoDevice *_this, SDL_Window *window) SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; return videodata->is_steam_deck; } void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; if (videodata->is_steam_deck) { /* For more documentation of the URL parameters, see: @@ -470,7 +470,7 @@ void X11_ShowScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; if (videodata->is_steam_deck) { SDL_OpenURL("steam://close/keyboard"); @@ -480,7 +480,7 @@ void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window) SDL_bool X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; return videodata->steam_keyboard_open; } diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c index 957e38612c08a..8a97b30068529 100644 --- a/src/video/x11/SDL_x11messagebox.c +++ b/src/video/x11/SDL_x11messagebox.c @@ -410,7 +410,7 @@ static int X11_MessageBoxCreateWindow(SDL_MessageBoxDataX11 *data) if (messageboxdata->window) { SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(messageboxdata->window); - windowdata = messageboxdata->window->driverdata; + windowdata = messageboxdata->window->internal; data->screen = displaydata->screen; } else { data->screen = DefaultScreen(display); @@ -475,7 +475,7 @@ static int X11_MessageBoxCreateWindow(SDL_MessageBoxDataX11 *data) const SDL_VideoDevice *dev = SDL_GetVideoDevice(); if (dev && dev->displays && dev->num_displays > 0) { const SDL_VideoDisplay *dpy = dev->displays[0]; - const SDL_DisplayData *dpydata = dpy->driverdata; + const SDL_DisplayData *dpydata = dpy->internal; x = dpydata->x + ((dpy->current_mode->w - data->dialog_width) / 2); y = dpydata->y + ((dpy->current_mode->h - data->dialog_height) / 3); } else { /* oh well. This will misposition on a multi-head setup. Init first next time. */ diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 62b6c48610272..162deb7439e95 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -207,7 +207,7 @@ static float GetGlobalContentScale(SDL_VideoDevice *_this) /* If that failed, try "Xft.dpi" from the XResourcesDatabase... */ if (scale_factor <= 0.0) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *display = data->display; char *resource_manager; XrmDatabase db; @@ -469,7 +469,7 @@ static SDL_bool SetXRandRModeInfo(Display *display, XRRScreenResources *res, RRC mode->h = (info->height * scale_h + 0xffff) >> 16; } CalculateXRandRRefreshRate(info, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator); - ((SDL_DisplayModeData *)mode->driverdata)->xrandr_mode = modeID; + mode->internal->xrandr_mode = modeID; #ifdef X11MODES_DEBUG printf("XRandR mode %d: %dx%d@%d/%dHz\n", (int)modeID, mode->screen_w, mode->screen_h, mode->refresh_rate_numerator, mode->refresh_rate_denominator); @@ -610,7 +610,7 @@ static int X11_AddXRandRDisplay(SDL_VideoDevice *_this, Display *dpy, int screen } modedata->xrandr_mode = modeID; - mode.driverdata = modedata; + mode.internal = modedata; displaydata->screen = screen; displaydata->visual = vinfo.visual; @@ -630,7 +630,7 @@ static int X11_AddXRandRDisplay(SDL_VideoDevice *_this, Display *dpy, int screen } display.desktop_mode = mode; display.content_scale = GetGlobalContentScale(_this); - display.driverdata = displaydata; + display.internal = displaydata; if (SDL_AddVideoDisplay(&display, send_event) == 0) { return -1; } @@ -651,7 +651,7 @@ static void X11_HandleXRandROutputChange(SDL_VideoDevice *_this, const XRROutput if (displays) { for (i = 0; displays[i]; ++i) { SDL_VideoDisplay *thisdisplay = SDL_GetVideoDisplay(displays[i]); - const SDL_DisplayData *displaydata = thisdisplay->driverdata; + const SDL_DisplayData *displaydata = thisdisplay->internal; if (displaydata->xrandr_output == ev->output) { display = thisdisplay; break; @@ -691,7 +691,7 @@ static void X11_HandleXRandROutputChange(SDL_VideoDevice *_this, const XRROutput void X11_HandleXRandREvent(SDL_VideoDevice *_this, const XEvent *xevent) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_assert(xevent->type == (videodata->xrandr_event_base + RRNotify)); switch (((const XRRNotifyEvent *)xevent)->subtype) { @@ -705,7 +705,7 @@ void X11_HandleXRandREvent(SDL_VideoDevice *_this, const XEvent *xevent) static int X11_InitModes_XRandR(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *dpy = data->display; const int screencount = ScreenCount(dpy); const int default_screen = DefaultScreen(dpy); @@ -772,7 +772,7 @@ static int X11_InitModes_XRandR(SDL_VideoDevice *_this) static int X11_InitModes_StdXlib(SDL_VideoDevice *_this) { /* !!! FIXME: a lot of copy/paste from X11_InitModes_XRandR in this function. */ - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *dpy = data->display; const int default_screen = DefaultScreen(dpy); Screen *screen = ScreenOfDisplay(dpy, default_screen); @@ -811,7 +811,7 @@ static int X11_InitModes_StdXlib(SDL_VideoDevice *_this) SDL_free(displaydata); return -1; } - mode.driverdata = modedata; + mode.internal = modedata; displaydata->screen = default_screen; displaydata->visual = vinfo.visual; @@ -837,7 +837,7 @@ static int X11_InitModes_StdXlib(SDL_VideoDevice *_this) SDL_zero(display); display.name = (char *)"Generic X11 Display"; /* this is just copied and thrown away, it's safe to cast to char* here. */ display.desktop_mode = mode; - display.driverdata = displaydata; + display.internal = displaydata; display.content_scale = GetGlobalContentScale(_this); if (SDL_AddVideoDisplay(&display, SDL_TRUE) == 0) { return -1; @@ -852,7 +852,7 @@ int X11_InitModes(SDL_VideoDevice *_this) desktop size. */ #ifdef SDL_VIDEO_DRIVER_X11_XRANDR { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int xrandr_major, xrandr_minor; /* require at least XRandR v1.3 */ if (CheckXRandR(data->display, &xrandr_major, &xrandr_minor) && @@ -870,7 +870,7 @@ int X11_InitModes(SDL_VideoDevice *_this) int X11_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display) { #ifdef SDL_VIDEO_DRIVER_X11_XRANDR - SDL_DisplayData *data = sdl_display->driverdata; + SDL_DisplayData *data = sdl_display->internal; SDL_DisplayMode mode; /* Unfortunately X11 requires the window to be created with the correct @@ -883,7 +883,7 @@ int X11_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display) mode.format = sdl_display->desktop_mode.format; if (data->use_xrandr) { - Display *display = _this->driverdata->display; + Display *display = _this->internal->display; XRRScreenResources *res; res = X11_XRRGetScreenResources(display, RootWindow(display, data->screen)); @@ -899,7 +899,7 @@ int X11_GetDisplayModes(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display) if (!modedata) { continue; } - mode.driverdata = modedata; + mode.internal = modedata; if (!SetXRandRModeInfo(display, res, output_info->crtc, output_info->modes[i], &mode) || !SDL_AddFullscreenDisplayMode(sdl_display, &mode)) { @@ -933,8 +933,8 @@ static int SDL_XRRSetScreenSizeErrHandler(Display *d, XErrorEvent *e) int X11_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_DisplayMode *mode) { - SDL_VideoData *viddata = _this->driverdata; - SDL_DisplayData *data = sdl_display->driverdata; + SDL_VideoData *viddata = _this->internal; + SDL_DisplayData *data = sdl_display->internal; viddata->last_mode_change_deadline = SDL_GetTicks() + (PENDING_FOCUS_TIME * 2); @@ -950,7 +950,7 @@ int X11_SetDisplayMode(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SD #ifdef SDL_VIDEO_DRIVER_X11_XRANDR if (data->use_xrandr) { Display *display = viddata->display; - SDL_DisplayModeData *modedata = (SDL_DisplayModeData *)mode->driverdata; + SDL_DisplayModeData *modedata = mode->internal; int mm_width, mm_height; XRRScreenResources *res; XRROutputInfo *output_info; @@ -1036,7 +1036,7 @@ void X11_QuitModes(SDL_VideoDevice *_this) int X11_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) { - SDL_DisplayData *data = sdl_display->driverdata; + SDL_DisplayData *data = sdl_display->internal; rect->x = data->x; rect->y = data->y; @@ -1047,7 +1047,7 @@ int X11_GetDisplayBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, int X11_GetDisplayUsableBounds(SDL_VideoDevice *_this, SDL_VideoDisplay *sdl_display, SDL_Rect *rect) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *display = data->display; Atom _NET_WORKAREA; int status, real_format; diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index c47eea216ba9d..2c48b643c2cfa 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -36,7 +36,7 @@ static SDL_Cursor *sys_cursors[SDL_HITTEST_RESIZE_LEFT + 1]; static Display *GetDisplay(void) { - return SDL_GetVideoDevice()->driverdata->display; + return SDL_GetVideoDevice()->internal->display; } static Cursor X11_CreateEmptyCursor(void) @@ -73,7 +73,7 @@ static SDL_Cursor *X11_CreateDefaultCursor(void) SDL_Cursor *cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { /* None is used to indicate the default cursor */ - cursor->driverdata = (void *)(uintptr_t)None; + cursor->internal = (void *)(uintptr_t)None; } return cursor; } @@ -206,7 +206,7 @@ static SDL_Cursor *X11_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) if (x11_cursor == None) { x11_cursor = X11_CreatePixmapCursor(surface, hot_x, hot_y); } - cursor->driverdata = (void *)(uintptr_t)x11_cursor; + cursor->internal = (void *)(uintptr_t)x11_cursor; } return cursor; @@ -263,7 +263,7 @@ static SDL_Cursor *X11_CreateSystemCursor(SDL_SystemCursor id) if (x11_cursor != None) { cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { - cursor->driverdata = (void *)(uintptr_t)x11_cursor; + cursor->internal = (void *)(uintptr_t)x11_cursor; } } @@ -272,7 +272,7 @@ static SDL_Cursor *X11_CreateSystemCursor(SDL_SystemCursor id) static void X11_FreeCursor(SDL_Cursor *cursor) { - Cursor x11_cursor = (Cursor)cursor->driverdata; + Cursor x11_cursor = (Cursor)cursor->internal; if (x11_cursor != None) { X11_XFreeCursor(GetDisplay(), x11_cursor); @@ -285,7 +285,7 @@ static int X11_ShowCursor(SDL_Cursor *cursor) Cursor x11_cursor = 0; if (cursor) { - x11_cursor = (Cursor)cursor->driverdata; + x11_cursor = (Cursor)cursor->internal; } else { x11_cursor = X11_CreateEmptyCursor(); } @@ -297,7 +297,7 @@ static int X11_ShowCursor(SDL_Cursor *cursor) SDL_Window *window; for (window = video->windows; window; window = window->next) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data) { if (x11_cursor != None) { X11_XDefineCursor(display, data->xwindow, x11_cursor); @@ -313,7 +313,7 @@ static int X11_ShowCursor(SDL_Cursor *cursor) static void X11_WarpMouseInternal(Window xwindow, float x, float y) { - SDL_VideoData *videodata = SDL_GetVideoDevice()->driverdata; + SDL_VideoData *videodata = SDL_GetVideoDevice()->internal; Display *display = videodata->display; SDL_Mouse *mouse = SDL_GetMouse(); SDL_bool warp_hack = SDL_FALSE; @@ -354,7 +354,7 @@ static void X11_WarpMouseInternal(Window xwindow, float x, float y) static int X11_WarpMouse(SDL_Window *window, float x, float y) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; #ifdef SDL_VIDEO_DRIVER_X11_XFIXES /* If we have no barrier, we need to warp */ @@ -387,7 +387,7 @@ static int X11_CaptureMouse(SDL_Window *window) SDL_Window *mouse_focus = SDL_GetMouseFocus(); if (window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; /* If XInput2 is handling the pointer input, non-confinement grabs will always fail with 'AlreadyGrabbed', * since the pointer is being grabbed by XInput2. @@ -415,7 +415,7 @@ static int X11_CaptureMouse(SDL_Window *window) static SDL_MouseButtonFlags X11_GetGlobalMouseState(float *x, float *y) { - SDL_VideoData *videodata = SDL_GetVideoDevice()->driverdata; + SDL_VideoData *videodata = SDL_GetVideoDevice()->internal; SDL_DisplayID *displays; Display *display = GetDisplay(); int i; @@ -505,7 +505,7 @@ void X11_InitMouse(SDL_VideoDevice *_this) void X11_QuitMouse(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDL_XInput2DeviceInfo *i; SDL_XInput2DeviceInfo *next; int j; diff --git a/src/video/x11/SDL_x11opengl.c b/src/video/x11/SDL_x11opengl.c index 5eb75a8588cf8..d94205130365b 100644 --- a/src/video/x11/SDL_x11opengl.c +++ b/src/video/x11/SDL_x11opengl.c @@ -232,7 +232,7 @@ int X11_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path) return SDL_SetError("Could not retrieve OpenGL functions"); } - display = _this->driverdata->display; + display = _this->internal->display; if (!_this->gl_data->glXQueryExtension(display, &_this->gl_data->errorBase, &_this->gl_data->eventBase)) { return SDL_SetError("GLX is not supported"); } @@ -337,7 +337,7 @@ static SDL_bool HasExtension(const char *extension, const char *extensions) static void X11_GL_InitExtensions(SDL_VideoDevice *_this) { - Display *display = _this->driverdata->display; + Display *display = _this->internal->display; const int screen = DefaultScreen(display); XVisualInfo *vinfo = NULL; Window w = 0; @@ -711,7 +711,7 @@ SDL_bool X11_GL_UseEGL(SDL_VideoDevice *_this) SDL_GLContext X11_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; int screen = SDL_GetDisplayDriverDataForWindow(window)->screen; XWindowAttributes xattr; @@ -845,9 +845,9 @@ SDL_GLContext X11_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) int X11_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context) { - Display *display = _this->driverdata->display; + Display *display = _this->internal->display; Window drawable = - (context ? window->driverdata->xwindow : None); + (context ? window->internal->xwindow : None); GLXContext glx_context = (GLXContext)context; int rc; @@ -889,8 +889,8 @@ int X11_GL_SetSwapInterval(SDL_VideoDevice *_this, int interval) if ((interval < 0) && (!_this->gl_data->HAS_GLX_EXT_swap_control_tear)) { return SDL_SetError("Negative swap interval unsupported in this GL"); } else if (_this->gl_data->glXSwapIntervalEXT) { - Display *display = _this->driverdata->display; - const SDL_WindowData *windowdata = SDL_GL_GetCurrentWindow()->driverdata; + Display *display = _this->internal->display; + const SDL_WindowData *windowdata = SDL_GL_GetCurrentWindow()->internal; Window drawable = windowdata->xwindow; @@ -937,7 +937,7 @@ static SDL_GLSwapIntervalTearBehavior CheckSwapIntervalTearBehavior(SDL_VideoDev if (!_this->gl_data->HAS_GLX_EXT_swap_control_tear) { _this->gl_data->swap_interval_tear_behavior = SDL_SWAPINTERVALTEAR_UNKNOWN; } else { - Display *display = _this->driverdata->display; + Display *display = _this->internal->display; unsigned int allow_late_swap_tearing = 22; int original_val = (int) current_val; @@ -978,8 +978,8 @@ static SDL_GLSwapIntervalTearBehavior CheckSwapIntervalTearBehavior(SDL_VideoDev int X11_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) { if (_this->gl_data->glXSwapIntervalEXT) { - Display *display = _this->driverdata->display; - const SDL_WindowData *windowdata = SDL_GL_GetCurrentWindow()->driverdata; + Display *display = _this->internal->display; + const SDL_WindowData *windowdata = SDL_GL_GetCurrentWindow()->internal; Window drawable = windowdata->xwindow; unsigned int allow_late_swap_tearing = 0; unsigned int val = 0; @@ -1025,7 +1025,7 @@ int X11_GL_GetSwapInterval(SDL_VideoDevice *_this, int *interval) int X11_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; _this->gl_data->glXSwapBuffers(display, data->xwindow); @@ -1034,7 +1034,7 @@ int X11_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) int X11_GL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context) { - Display *display = _this->driverdata->display; + Display *display = _this->internal->display; GLXContext glx_context = (GLXContext)context; if (!_this->gl_data) { diff --git a/src/video/x11/SDL_x11opengles.c b/src/video/x11/SDL_x11opengles.c index 5bd277d5fdf98..cdf26fe97b1d1 100644 --- a/src/video/x11/SDL_x11opengles.c +++ b/src/video/x11/SDL_x11opengles.c @@ -30,7 +30,7 @@ int X11_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; /* If the profile requested is not GL ES, switch over to X11_GL functions */ if ((_this->gl_config.profile_mask != SDL_GL_CONTEXT_PROFILE_ES) && @@ -107,7 +107,7 @@ XVisualInfo *X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int sc SDL_GLContext X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) { SDL_GLContext context; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; X11_XSync(display, False); @@ -119,7 +119,7 @@ SDL_GLContext X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window) SDL_EGLSurface X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; return data->egl_surface; } diff --git a/src/video/x11/SDL_x11pen.c b/src/video/x11/SDL_x11pen.c index e4f367fd8fbab..acb5170b61979 100644 --- a/src/video/x11/SDL_x11pen.c +++ b/src/video/x11/SDL_x11pen.c @@ -104,7 +104,7 @@ int X11_PenIDFromDeviceID(int deviceid) static void pen_atoms_ensure_initialized(SDL_VideoDevice *_this) { - SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->internal; if (pen_atoms.initialized) { return; @@ -124,7 +124,7 @@ static void pen_atoms_ensure_initialized(SDL_VideoDevice *_this) Returns number of Sint32s written (<= max_words), or 0 on error. */ static size_t xinput2_pen_get_int_property(SDL_VideoDevice *_this, int deviceid, Atom property, Sint32 *dest, size_t max_words) { - const SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + const SDL_VideoData *data = (SDL_VideoData *)_this->internal; Atom type_return; int format_return; unsigned long num_items_return; @@ -222,7 +222,7 @@ static SDL_bool xinput2_wacom_deviceid(SDL_VideoDevice *_this, int deviceid, Uin /* Heuristically determines if device is an eraser */ static SDL_bool xinput2_pen_is_eraser(SDL_VideoDevice *_this, int deviceid, char *devicename) { - SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->internal; char dev_name[PEN_ERASER_ID_MAXLEN]; int k; @@ -415,7 +415,7 @@ static SDL_bool xinput2_device_is_pen(SDL_VideoDevice *_this, const XIDeviceInfo void X11_InitPen(SDL_VideoDevice *_this) { - SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *data = (SDL_VideoData *)_this->internal; int i; XIDeviceInfo *device_info; int num_device_info; diff --git a/src/video/x11/SDL_x11settings.c b/src/video/x11/SDL_x11settings.c index 980386bdb7539..8dbf44f974b12 100644 --- a/src/video/x11/SDL_x11settings.c +++ b/src/video/x11/SDL_x11settings.c @@ -67,7 +67,7 @@ static void X11_XsettingsNotify(const char *name, XSettingsAction action, XSetti void X11_InitXsettings(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDLX11_SettingsData *xsettings_data = &data->xsettings_data; xsettings_data->xsettings = xsettings_client_new(data->display, @@ -77,7 +77,7 @@ void X11_InitXsettings(SDL_VideoDevice *_this) void X11_QuitXsettings(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDLX11_SettingsData *xsettings_data = &data->xsettings_data; if (xsettings_data->xsettings) { @@ -88,7 +88,7 @@ void X11_QuitXsettings(SDL_VideoDevice *_this) void X11_HandleXsettings(SDL_VideoDevice *_this, const XEvent *xevent) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDLX11_SettingsData *xsettings_data = &data->xsettings_data; if (xsettings_data->xsettings) { @@ -100,7 +100,7 @@ void X11_HandleXsettings(SDL_VideoDevice *_this, const XEvent *xevent) } int X11_GetXsettingsIntKey(SDL_VideoDevice *_this, const char *key, int fallback_value) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDLX11_SettingsData *xsettings_data = &data->xsettings_data; XSettingsSetting *setting = NULL; int res = fallback_value; diff --git a/src/video/x11/SDL_x11shape.c b/src/video/x11/SDL_x11shape.c index 0766586b1462b..792937d3bda33 100644 --- a/src/video/x11/SDL_x11shape.c +++ b/src/video/x11/SDL_x11shape.c @@ -58,7 +58,7 @@ int X11_UpdateWindowShape(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surfac int result = -1; #ifdef SDL_VIDEO_DRIVER_X11_XSHAPE - SDL_WindowData *windowdata = window->driverdata; + SDL_WindowData *windowdata = window->internal; /* Generate a set of spans for the region */ if (shape) { diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index afba879ff024c..5024450a9d3a9 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -53,7 +53,7 @@ static int (*orig_x11_errhandler)(Display *, XErrorEvent *) = NULL; static void X11_DeleteDevice(SDL_VideoDevice *device) { - SDL_VideoData *data = device->driverdata; + SDL_VideoData *data = device->internal; if (device->vulkan_config.loader_handle) { device->Vulkan_UnloadLibrary(device); } @@ -68,7 +68,7 @@ static void X11_DeleteDevice(SDL_VideoDevice *device) if (device->wakeup_lock) { SDL_DestroyMutex(device->wakeup_lock); } - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); SDL_X11_UnloadSymbols(); @@ -140,7 +140,7 @@ static SDL_VideoDevice *X11_CreateDevice(void) SDL_free(device); return NULL; } - device->driverdata = data; + device->internal = data; data->global_mouse_changed = SDL_TRUE; @@ -152,7 +152,7 @@ static SDL_VideoDevice *X11_CreateDevice(void) data->request_display = X11_XOpenDisplay(display); if (!data->request_display) { X11_XCloseDisplay(data->display); - SDL_free(device->driverdata); + SDL_free(device->internal); SDL_free(device); SDL_X11_UnloadSymbols(); return NULL; @@ -318,7 +318,7 @@ static int X11_CheckWindowManagerErrorHandler(Display *d, XErrorEvent *e) static void X11_CheckWindowManager(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *display = data->display; Atom _NET_SUPPORTING_WM_CHECK; int status, real_format; @@ -378,7 +378,7 @@ static void X11_CheckWindowManager(SDL_VideoDevice *_this) int X11_VideoInit(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; /* Get the process PID to be associated to the window */ data->pid = getpid(); @@ -465,7 +465,7 @@ int X11_VideoInit(SDL_VideoDevice *_this) void X11_VideoQuit(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (data->clipboard_window) { X11_XDestroyWindow(data->display, data->clipboard_window); diff --git a/src/video/x11/SDL_x11vulkan.c b/src/video/x11/SDL_x11vulkan.c index c0ef4c45758c1..93641b39a7cc8 100644 --- a/src/video/x11/SDL_x11vulkan.c +++ b/src/video/x11/SDL_x11vulkan.c @@ -44,7 +44,7 @@ typedef uint32_t xcb_visualid_t; int X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) { - SDL_VideoData *videoData = _this->driverdata; + SDL_VideoData *videoData = _this->internal; VkExtensionProperties *extensions = NULL; Uint32 extensionCount = 0; SDL_bool hasSurfaceExtension = SDL_FALSE; @@ -132,7 +132,7 @@ int X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path) void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) { - SDL_VideoData *videoData = _this->driverdata; + SDL_VideoData *videoData = _this->internal; if (_this->vulkan_config.loader_handle) { if (videoData->vulkan_xlib_xcb_library) { SDL_UnloadObject(videoData->vulkan_xlib_xcb_library); @@ -145,7 +145,7 @@ void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this) char const* const* X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count) { - SDL_VideoData *videoData = _this->driverdata; + SDL_VideoData *videoData = _this->internal; if (videoData->vulkan_xlib_xcb_library) { static const char *const extensionsForXCB[] = { VK_KHR_SURFACE_EXTENSION_NAME, @@ -173,8 +173,8 @@ int X11_Vulkan_CreateSurface(SDL_VideoDevice *_this, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface) { - SDL_VideoData *videoData = _this->driverdata; - SDL_WindowData *windowData = window->driverdata; + SDL_VideoData *videoData = _this->internal; + SDL_WindowData *windowData = window->internal; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; if (!_this->vulkan_config.loader_handle) { return SDL_SetError("Vulkan is not loaded"); @@ -237,7 +237,7 @@ SDL_bool X11_Vulkan_GetPresentationSupport(SDL_VideoDevice *_this, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex) { - SDL_VideoData *videoData = _this->driverdata; + SDL_VideoData *videoData = _this->internal; PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; const char *forced_visual_id; VisualID visualid; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index ef12311eae3b7..3fe3cd588141c 100644 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -45,7 +45,7 @@ if (!window) { \ return SDL_SetError("Invalid window"); \ } \ - if (!window->driverdata) { \ + if (!window->internal) { \ return SDL_SetError("Invalid window driver data"); \ } @@ -53,7 +53,7 @@ if (!_display) { \ return SDL_SetError("Invalid display"); \ } \ - if (!_display->driverdata) { \ + if (!_display->internal) { \ return SDL_SetError("Invalid display driver data"); \ } @@ -86,8 +86,8 @@ static Bool X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*p static SDL_bool X11_IsWindowMapped(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; - SDL_VideoData *videodata = _this->driverdata; + SDL_WindowData *data = window->internal; + SDL_VideoData *videodata = _this->internal; XWindowAttributes attr; X11_XGetWindowAttributes(videodata->display, data->xwindow, &attr); @@ -101,7 +101,7 @@ static SDL_bool X11_IsWindowMapped(SDL_VideoDevice *_this, SDL_Window *window) #if 0 static SDL_bool X11_IsActionAllowed(SDL_Window *window, Atom action) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Atom _NET_WM_ALLOWED_ACTIONS = data->videodata->_NET_WM_ALLOWED_ACTIONS; Atom type; Display *display = data->videodata->display; @@ -126,7 +126,7 @@ static SDL_bool X11_IsActionAllowed(SDL_Window *window, Atom action) void X11_SetNetWMState(SDL_VideoDevice *_this, Window xwindow, SDL_WindowFlags flags) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; /* !!! FIXME: just dereference videodata below instead of copying to locals. */ Atom _NET_WM_STATE = videodata->_NET_WM_STATE; @@ -230,13 +230,13 @@ static void X11_SetKeyboardFocus(SDL_Window *window) topmost = topmost->parent; } - topmost->driverdata->keyboard_focus = window; + topmost->internal->keyboard_focus = window; SDL_SetKeyboardFocus(window); } Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwindow) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; Display *display = videodata->display; Atom _NET_WM_STATE = videodata->_NET_WM_STATE; Atom _NET_WM_STATE_HIDDEN = videodata->_NET_WM_STATE_HIDDEN; @@ -322,7 +322,7 @@ Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwin static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, Window w) { - SDL_VideoData *videodata = _this->driverdata; + SDL_VideoData *videodata = _this->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); SDL_WindowData *data; int numwindows = videodata->numwindows; @@ -417,7 +417,7 @@ static int SetupWindowData(SDL_VideoDevice *_this, SDL_Window *window, Window w) SDL_SetNumberProperty(props, SDL_PROP_WINDOW_X11_WINDOW_NUMBER, data->xwindow); /* All done! */ - window->driverdata = data; + window->internal = data; return 0; } @@ -464,7 +464,7 @@ int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI return 0; } - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); if (!displaydata) { return SDL_SetError("Could not find display info"); @@ -752,7 +752,7 @@ int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI X11_XDestroyWindow(display, w); return -1; } - windowdata = window->driverdata; + windowdata = window->internal; /* Set the flag if the borders were forced on when creating a fullscreen window for later removal. */ windowdata->fullscreen_borders_forced_on = !!(window->pending_flags & SDL_WINDOW_FULLSCREEN) && @@ -831,7 +831,7 @@ int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_PropertiesI char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; Display *display = data->display; int status, real_format; Atom real_type; @@ -863,7 +863,7 @@ char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow) void X11_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Window xwindow = data->xwindow; Display *display = data->videodata->display; char *title = window->title ? window->title : ""; @@ -884,7 +884,7 @@ static int X11_CatchAnyError(Display *d, XErrorEvent *e) * Send MOVED and RESIZED window events */ static int X11_SyncWindowTimeout(SDL_VideoDevice *_this, SDL_Window *window, Uint64 param_timeout) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; int (*prev_handler)(Display *, XErrorEvent *); Uint64 timeout = 0; @@ -953,7 +953,7 @@ static int X11_SyncWindowTimeout(SDL_VideoDevice *_this, SDL_Window *window, Uin int X11_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *icon) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; Atom _NET_WM_ICON = data->videodata->_NET_WM_ICON; int rc = 0; @@ -1011,7 +1011,7 @@ int X11_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window *window, SDL_Surface *i void X11_UpdateWindowPosition(SDL_Window *window, SDL_bool use_current_position) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; const int rel_x = use_current_position ? window->x : window->floating.x; const int rel_y = use_current_position ? window->y : window->floating.y; @@ -1028,7 +1028,7 @@ void X11_UpdateWindowPosition(SDL_Window *window, SDL_bool use_current_position) int X11_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) { /* Sync any pending fullscreen or maximize events. */ - if (window->driverdata->pending_operation & (X11_PENDING_OP_FULLSCREEN | X11_PENDING_OP_MAXIMIZE)) { + if (window->internal->pending_operation & (X11_PENDING_OP_FULLSCREEN | X11_PENDING_OP_MAXIMIZE)) { X11_SyncWindow(_this, window); } @@ -1050,7 +1050,7 @@ int X11_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) static void X11_SetWMNormalHints(SDL_VideoDevice *_this, SDL_Window *window, XSizeHints *sizehints) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; int dest_x, dest_y; @@ -1083,7 +1083,7 @@ static void X11_SetWMNormalHints(SDL_VideoDevice *_this, SDL_Window *window, XSi void X11_SetWindowMinMax(SDL_Window *window, SDL_bool use_current) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; XSizeHints *sizehints = X11_XAllocSizeHints(); long hint_flags = 0; @@ -1120,7 +1120,7 @@ void X11_SetWindowMinMax(SDL_Window *window, SDL_bool use_current) void X11_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) { - if (window->driverdata->pending_operation & X11_PENDING_OP_FULLSCREEN) { + if (window->internal->pending_operation & X11_PENDING_OP_FULLSCREEN) { X11_SyncWindow(_this, window); } @@ -1131,7 +1131,7 @@ void X11_SetWindowMinimumSize(SDL_VideoDevice *_this, SDL_Window *window) void X11_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) { - if (window->driverdata->pending_operation & X11_PENDING_OP_FULLSCREEN) { + if (window->internal->pending_operation & X11_PENDING_OP_FULLSCREEN) { X11_SyncWindow(_this, window); } @@ -1142,7 +1142,7 @@ void X11_SetWindowMaximumSize(SDL_VideoDevice *_this, SDL_Window *window) void X11_SetWindowAspectRatio(SDL_VideoDevice *_this, SDL_Window *window) { - if (window->driverdata->pending_operation & X11_PENDING_OP_FULLSCREEN) { + if (window->internal->pending_operation & X11_PENDING_OP_FULLSCREEN) { X11_SyncWindow(_this, window); } @@ -1153,7 +1153,7 @@ void X11_SetWindowAspectRatio(SDL_VideoDevice *_this, SDL_Window *window) void X11_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; /* Wait for pending maximize operations to complete, or the window can end up in a weird, @@ -1196,7 +1196,7 @@ void X11_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) int X11_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *top, int *left, int *bottom, int *right) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; *left = data->border_left; *right = data->border_right; @@ -1208,7 +1208,7 @@ int X11_GetWindowBordersSize(SDL_VideoDevice *_this, SDL_Window *window, int *to int X11_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opacity) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; Atom _NET_WM_WINDOW_OPACITY = data->videodata->_NET_WM_WINDOW_OPACITY; @@ -1226,9 +1226,9 @@ int X11_SetWindowOpacity(SDL_VideoDevice *_this, SDL_Window *window, float opaci int X11_SetWindowModalFor(SDL_VideoDevice *_this, SDL_Window *modal_window, SDL_Window *parent_window) { - SDL_WindowData *data = modal_window->driverdata; - SDL_WindowData *parent_data = parent_window ? parent_window->driverdata : NULL; - SDL_VideoData *video_data = _this->driverdata; + SDL_WindowData *data = modal_window->internal; + SDL_WindowData *parent_data = parent_window ? parent_window->internal : NULL; + SDL_VideoData *video_data = _this->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(modal_window); Display *display = video_data->display; Uint32 flags = modal_window->flags; @@ -1271,7 +1271,7 @@ void X11_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool { const SDL_bool focused = (window->flags & SDL_WINDOW_INPUT_FOCUS) ? SDL_TRUE : SDL_FALSE; const SDL_bool visible = (!(window->flags & SDL_WINDOW_HIDDEN)) ? SDL_TRUE : SDL_FALSE; - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); Display *display = data->videodata->display; XEvent event; @@ -1317,7 +1317,7 @@ void X11_SetWindowBordered(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool void X11_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool resizable) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data->pending_operation & X11_PENDING_OP_FULLSCREEN) { X11_SyncWindow(_this, window); @@ -1331,7 +1331,7 @@ void X11_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool void X11_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool on_top) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); Display *display = data->videodata->display; Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; @@ -1360,7 +1360,7 @@ void X11_SetWindowAlwaysOnTop(SDL_VideoDevice *_this, SDL_Window *window, SDL_bo void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; SDL_bool bActivate = SDL_GetHintBoolean(SDL_HINT_WINDOW_ACTIVATE_WHEN_SHOWN, SDL_TRUE); XEvent event; @@ -1435,7 +1435,7 @@ void X11_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window) void X11_HideWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); int screen = (displaydata ? displaydata->screen : 0); Display *display = data->videodata->display; @@ -1472,7 +1472,7 @@ static int X11_SetWindowActive(SDL_VideoDevice *_this, SDL_Window *window) { CHECK_WINDOW_DATA(window); - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); Display *display = data->videodata->display; Atom _NET_ACTIVE_WINDOW = data->videodata->_NET_ACTIVE_WINDOW; @@ -1501,7 +1501,7 @@ static int X11_SetWindowActive(SDL_VideoDevice *_this, SDL_Window *window) void X11_RaiseWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; SDL_bool bActivate = SDL_GetHintBoolean(SDL_HINT_WINDOW_ACTIVATE_WHEN_RAISED, SDL_TRUE); @@ -1516,7 +1516,7 @@ static int X11_SetWindowMaximized(SDL_VideoDevice *_this, SDL_Window *window, SD { CHECK_WINDOW_DATA(window); - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); Display *display = data->videodata->display; Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; @@ -1575,19 +1575,19 @@ static int X11_SetWindowMaximized(SDL_VideoDevice *_this, SDL_Window *window, SD void X11_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { - if (window->driverdata->pending_operation & (X11_PENDING_OP_FULLSCREEN | X11_PENDING_OP_MINIMIZE)) { + if (window->internal->pending_operation & (X11_PENDING_OP_FULLSCREEN | X11_PENDING_OP_MINIMIZE)) { SDL_SyncWindow(window); } if (!(window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_MINIMIZED))) { - window->driverdata->pending_operation |= X11_PENDING_OP_MAXIMIZE; + window->internal->pending_operation |= X11_PENDING_OP_MAXIMIZE; X11_SetWindowMaximized(_this, window, SDL_TRUE); } } void X11_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); Display *display = data->videodata->display; @@ -1599,18 +1599,18 @@ void X11_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) void X11_RestoreWindow(SDL_VideoDevice *_this, SDL_Window *window) { - if (window->driverdata->pending_operation & (X11_PENDING_OP_FULLSCREEN | X11_PENDING_OP_MAXIMIZE | X11_PENDING_OP_MINIMIZE)) { + if (window->internal->pending_operation & (X11_PENDING_OP_FULLSCREEN | X11_PENDING_OP_MAXIMIZE | X11_PENDING_OP_MINIMIZE)) { SDL_SyncWindow(window); } if (window->flags & (SDL_WINDOW_MINIMIZED | SDL_WINDOW_MAXIMIZED) || - (window->driverdata->pending_operation & X11_PENDING_OP_MINIMIZE)) { - window->driverdata->pending_operation |= X11_PENDING_OP_RESTORE; + (window->internal->pending_operation & X11_PENDING_OP_MINIMIZE)) { + window->internal->pending_operation |= X11_PENDING_OP_RESTORE; } /* If the window was minimized while maximized, restore as maximized. */ - const SDL_bool maximize = !!(window->flags & SDL_WINDOW_MINIMIZED) && window->driverdata->window_was_maximized; - window->driverdata->window_was_maximized = SDL_FALSE; + const SDL_bool maximize = !!(window->flags & SDL_WINDOW_MINIMIZED) && window->internal->window_was_maximized; + window->internal->window_was_maximized = SDL_FALSE; X11_SetWindowMaximized(_this, window, maximize); X11_ShowWindow(_this, window); X11_SetWindowActive(_this, window); @@ -1622,8 +1622,8 @@ static int X11_SetWindowFullscreenViaWM(SDL_VideoDevice *_this, SDL_Window *wind CHECK_WINDOW_DATA(window); CHECK_DISPLAY_DATA(_display); - SDL_WindowData *data = window->driverdata; - SDL_DisplayData *displaydata = _display->driverdata; + SDL_WindowData *data = window->internal; + SDL_DisplayData *displaydata = _display->internal; Display *display = data->videodata->display; Atom _NET_WM_STATE = data->videodata->_NET_WM_STATE; Atom _NET_WM_STATE_FULLSCREEN = data->videodata->_NET_WM_STATE_FULLSCREEN; @@ -1777,7 +1777,7 @@ static void X11_ReadProperty(SDL_x11Prop *p, Display *disp, Window w, Atom prop) void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t *size) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; XWindowAttributes attributes; Atom icc_profile_atom; @@ -1825,7 +1825,7 @@ void *X11_GetWindowICCProfile(SDL_VideoDevice *_this, SDL_Window *window, size_t int X11_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display; if (!data) { @@ -1894,7 +1894,7 @@ int X11_SetWindowMouseGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool int X11_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool grabbed) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display; if (!data) { @@ -1923,7 +1923,7 @@ int X11_SetWindowKeyboardGrab(SDL_VideoDevice *_this, SDL_Window *window, SDL_bo void X11_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; if (data) { SDL_VideoData *videodata = data->videodata; @@ -1960,7 +1960,7 @@ void X11_DestroyWindow(SDL_VideoDevice *_this, SDL_Window *window) } #endif /* SDL_VIDEO_DRIVER_X11_XFIXES */ } - window->driverdata = NULL; + window->internal = NULL; } int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) @@ -1970,7 +1970,7 @@ int X11_SetWindowHitTest(SDL_Window *window, SDL_bool enabled) void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; Atom XdndAware = X11_XInternAtom(display, "XdndAware", False); @@ -1985,7 +1985,7 @@ void X11_AcceptDragAndDrop(SDL_Window *window, SDL_bool accept) int X11_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperation operation) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; XWMHints *wmhints; @@ -2063,7 +2063,7 @@ int SDL_X11_SetWindowTitle(Display *display, Window xwindow, char *title) void X11_ShowWindowSystemMenu(SDL_Window *window, int x, int y) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; SDL_DisplayData *displaydata = SDL_GetDisplayDriverDataForWindow(window); Display *display = data->videodata->display; Window root = RootWindow(display, displaydata->screen); @@ -2093,23 +2093,23 @@ int X11_SyncWindow(SDL_VideoDevice *_this, SDL_Window *window) /* Allow time for any pending mode switches to complete. */ for (int i = 0; i < _this->num_displays; ++i) { - if (_this->displays[i]->driverdata->mode_switch_deadline_ns && - current_time < _this->displays[i]->driverdata->mode_switch_deadline_ns) { - timeout = SDL_max(_this->displays[i]->driverdata->mode_switch_deadline_ns - current_time, timeout); + if (_this->displays[i]->internal->mode_switch_deadline_ns && + current_time < _this->displays[i]->internal->mode_switch_deadline_ns) { + timeout = SDL_max(_this->displays[i]->internal->mode_switch_deadline_ns - current_time, timeout); } } /* 100ms is fine for most cases, but, for some reason, maximizing * a window can take a very long time. */ - timeout += window->driverdata->pending_operation & X11_PENDING_OP_MAXIMIZE ? SDL_MS_TO_NS(1000) : SDL_MS_TO_NS(100); + timeout += window->internal->pending_operation & X11_PENDING_OP_MAXIMIZE ? SDL_MS_TO_NS(1000) : SDL_MS_TO_NS(100); return X11_SyncWindowTimeout(_this, window, timeout); } int X11_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool focusable) { - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; XWMHints *wmhints; diff --git a/src/video/x11/SDL_x11xfixes.c b/src/video/x11/SDL_x11xfixes.c index d4fb65e68d8dd..670e1d5582b40 100644 --- a/src/video/x11/SDL_x11xfixes.c +++ b/src/video/x11/SDL_x11xfixes.c @@ -45,7 +45,7 @@ static SDL_bool xfixes_version_atleast(const int version, const int wantmajor, c void X11_InitXfixes(SDL_VideoDevice *_this) { - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int version = 0; int event, error; @@ -93,7 +93,7 @@ int X11_SetWindowMouseRect(SDL_VideoDevice *_this, SDL_Window *window) X11_ConfineCursorWithFlags(_this, window, &window->mouse_rect, 0); } else { /* Save the state for when we get focus again */ - SDL_WindowData *wdata = window->driverdata; + SDL_WindowData *wdata = window->internal; SDL_memcpy(&wdata->barrier_rect, &window->mouse_rect, sizeof(wdata->barrier_rect)); @@ -110,7 +110,7 @@ int X11_ConfineCursorWithFlags(SDL_VideoDevice *_this, SDL_Window *window, const * edges exactly match, a rectangle the cursor 'slips' out of the barrier. * To prevent that the lines for the barriers will span the whole screen. */ - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; SDL_WindowData *wdata; if (!X11_XfixesIsInitialized()) { @@ -123,7 +123,7 @@ int X11_ConfineCursorWithFlags(SDL_VideoDevice *_this, SDL_Window *window, const } SDL_assert(window != NULL); - wdata = window->driverdata; + wdata = window->internal; /* If user did not specify an area to confine, destroy the barrier that was/is assigned to * this window it was assigned */ @@ -196,9 +196,9 @@ int X11_ConfineCursorWithFlags(SDL_VideoDevice *_this, SDL_Window *window, const void X11_DestroyPointerBarrier(SDL_VideoDevice *_this, SDL_Window *window) { int i; - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; if (window) { - SDL_WindowData *wdata = window->driverdata; + SDL_WindowData *wdata = window->internal; for (i = 0; i < 4; i++) { if (wdata->barrier[i] > 0) { diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 98d13e90592a5..24025da12765d 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -122,7 +122,7 @@ static void xinput2_normalize_touch_coordinates(SDL_Window *window, double in_x, SDL_bool X11_InitXinput2(SDL_VideoDevice *_this) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; int version = 0; XIEventMask eventmask; @@ -291,7 +291,7 @@ static void xinput2_pen_ensure_window(SDL_VideoDevice *_this, const SDL_Pen *pen void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 - SDL_VideoData *videodata = (SDL_VideoData *)_this->driverdata; + SDL_VideoData *videodata = (SDL_VideoData *)_this->internal; if (cookie->extension != xinput2_opcode) { return; @@ -512,7 +512,7 @@ void X11_HandleXinput2Event(SDL_VideoDevice *_this, XGenericEventCookie *cookie) if (!mouse->relative_mode || mouse->relative_mode_warp) { SDL_Window *window = xinput2_get_sdlwindow(videodata, xev->event); if (window) { - X11_ProcessHitTest(_this, window->driverdata, (float)xev->event_x, (float)xev->event_y, SDL_FALSE); + X11_ProcessHitTest(_this, window->internal, (float)xev->event_x, (float)xev->event_y, SDL_FALSE); SDL_SendMouseMotion(0, window, (SDL_MouseID)xev->sourceid, SDL_FALSE, (float)xev->event_x, (float)xev->event_y); } } @@ -567,8 +567,8 @@ void X11_Xinput2SelectTouch(SDL_VideoDevice *_this, SDL_Window *window) return; } - data = _this->driverdata; - window_data = window->driverdata; + data = _this->internal; + window_data = window->internal; eventmask.deviceid = XIAllMasterDevices; eventmask.mask_len = sizeof(mask); @@ -594,10 +594,10 @@ int X11_Xinput2IsInitialized(void) SDL_bool X11_Xinput2SelectMouseAndKeyboard(SDL_VideoDevice *_this, SDL_Window *window) { - SDL_WindowData *windowdata = (SDL_WindowData *)window->driverdata; + SDL_WindowData *windowdata = (SDL_WindowData *)window->internal; #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 - const SDL_VideoData *data = (SDL_VideoData *)_this->driverdata; + const SDL_VideoData *data = (SDL_VideoData *)_this->internal; if (X11_Xinput2IsInitialized()) { XIEventMask eventmask; @@ -653,7 +653,7 @@ int X11_Xinput2IsMultitouchSupported(void) void X11_Xinput2GrabTouch(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; unsigned char mask[4] = { 0, 0, 0, 0 }; @@ -683,7 +683,7 @@ void X11_Xinput2GrabTouch(SDL_VideoDevice *_this, SDL_Window *window) void X11_Xinput2UngrabTouch(SDL_VideoDevice *_this, SDL_Window *window) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2_SUPPORTS_MULTITOUCH - SDL_WindowData *data = window->driverdata; + SDL_WindowData *data = window->internal; Display *display = data->videodata->display; XIGrabModifiers mods; @@ -730,7 +730,7 @@ static SDL_bool HasDeviceID(Uint32 deviceID, Uint32 *list, int count) void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) { #ifdef SDL_VIDEO_DRIVER_X11_XINPUT2 - SDL_VideoData *data = _this->driverdata; + SDL_VideoData *data = _this->internal; XIDeviceInfo *info; int ndevices; int old_keyboard_count = 0; From 626bb5377261e8481286cf055af33fe668753bac Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 11:58:31 -0700 Subject: [PATCH 349/431] Fail blits between indexed and RGB surfaces if there is no palette set --- src/video/SDL_pixels.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 6f00f2aae482d..e265f8473c254 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -1379,17 +1379,17 @@ static Uint8 *Map1toN(const SDL_Palette *pal, Uint8 Rmod, Uint8 Gmod, Uint8 Bmod int i; int bpp; + if (!pal) { + SDL_SetError("src does not have a palette set"); + return NULL; + } + bpp = ((SDL_BYTESPERPIXEL(dst->format) == 3) ? 4 : SDL_BYTESPERPIXEL(dst->format)); map = (Uint8 *)SDL_calloc(256, bpp); if (!map) { return NULL; } - /* An all-zero map for surfaces without a palette. */ - if (!pal) { - return map; - } - /* We memory copy to the pixel map so the endianness is preserved */ for (i = 0; i < pal->ncolors; ++i) { Uint8 R = (Uint8)((pal->colors[i].r * Rmod) / 255); @@ -1410,7 +1410,7 @@ static Uint8 *MapNto1(const SDL_PixelFormatDetails *src, const SDL_Palette *pal, SDL_Color colors[256]; if (!pal) { - *identical = 1; + SDL_SetError("dst does not have a palette set"); return NULL; } From b7ec2119dd41041c306d0367c5797eae6621c466 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 12:46:28 -0700 Subject: [PATCH 350/431] Use a dither palette when converting RGB images to indexed formats --- include/SDL3/SDL_surface.h | 2 +- src/dynapi/SDL_dynapi_procs.h | 2 +- src/video/SDL_pixels.c | 18 ++++++------ src/video/SDL_pixels_c.h | 2 +- src/video/SDL_surface.c | 55 +++++++++++++++++++++-------------- 5 files changed, 45 insertions(+), 34 deletions(-) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 25cf66da1221c..6998b12991e48 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -742,7 +742,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface * \sa SDL_ConvertSurface * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, const SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props); /** * Copy a block of pixels of one format to another format. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 2e3f15cef09d7..c33d2779b25d0 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -94,7 +94,7 @@ SDL_DYNAPI_PROC(int,SDL_ConvertEventToRenderCoordinates,(SDL_Renderer *a, SDL_Ev SDL_DYNAPI_PROC(int,SDL_ConvertPixels,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h),(a,b,c,d,e,f,g,h),return) SDL_DYNAPI_PROC(int,SDL_ConvertPixelsAndColorspace,(int a, int b, SDL_PixelFormat c, SDL_Colorspace d, SDL_PropertiesID e, const void *f, int g, SDL_PixelFormat h, SDL_Colorspace i, SDL_PropertiesID j, void *k, int l),(a,b,c,d,e,f,g,h,i,j,k,l),return) SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurface,(SDL_Surface *a, SDL_PixelFormat b),(a,b),return) -SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceAndColorspace,(SDL_Surface *a, SDL_PixelFormat b, const SDL_Palette *c, SDL_Colorspace d, SDL_PropertiesID e),(a,b,c,d,e),return) +SDL_DYNAPI_PROC(SDL_Surface*,SDL_ConvertSurfaceAndColorspace,(SDL_Surface *a, SDL_PixelFormat b, SDL_Palette *c, SDL_Colorspace d, SDL_PropertiesID e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_CopyProperties,(SDL_PropertiesID a, SDL_PropertiesID b),(a,b),return) SDL_DYNAPI_PROC(SDL_AudioStream*,SDL_CreateAudioStream,(const SDL_AudioSpec *a, const SDL_AudioSpec *b),(a,b),return) SDL_DYNAPI_PROC(SDL_Cursor*,SDL_CreateColorCursor,(SDL_Surface *a, int b, int c),(a,b,c),return) diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index e265f8473c254..903a62be999c4 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -1077,28 +1077,28 @@ void SDL_DestroyPalette(SDL_Palette *palette) /* * Calculate an 8-bit (3 red, 3 green, 2 blue) dithered palette of colors */ -void SDL_DitherColors(SDL_Color *colors, int bpp) +void SDL_DitherPalette(SDL_Palette *palette) { int i; - if (bpp != 8) { + if (palette->ncolors != 256) { return; /* only 8bpp supported right now */ } - for (i = 0; i < 256; i++) { + for (i = 0; i < palette->ncolors; 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 = (Uint8)r; + palette->colors[i].r = (Uint8)r; g = (i << 3) & 0xe0; g |= g >> 3 | g >> 6; - colors[i].g = (Uint8)g; + palette->colors[i].g = (Uint8)g; b = i & 0x3; b |= b << 2; b |= b << 4; - colors[i].b = (Uint8)b; - colors[i].a = SDL_ALPHA_OPAQUE; + palette->colors[i].b = (Uint8)b; + palette->colors[i].a = SDL_ALPHA_OPAQUE; } } @@ -1414,9 +1414,9 @@ static Uint8 *MapNto1(const SDL_PixelFormatDetails *src, const SDL_Palette *pal, return NULL; } - dithered.ncolors = 256; - SDL_DitherColors(colors, 8); dithered.colors = colors; + dithered.ncolors = SDL_arraysize(colors); + SDL_DitherPalette(&dithered); return Map1to1(&dithered, pal, identical); } diff --git a/src/video/SDL_pixels_c.h b/src/video/SDL_pixels_c.h index 90f1905d728f7..a4b177efb49e0 100644 --- a/src/video/SDL_pixels_c.h +++ b/src/video/SDL_pixels_c.h @@ -48,7 +48,7 @@ extern int SDL_MapSurface(SDL_Surface *src, SDL_Surface *dst); extern void SDL_InvalidateAllBlitMap(SDL_Surface *surface); /* Miscellaneous functions */ -extern void SDL_DitherColors(SDL_Color *colors, int bpp); +extern void SDL_DitherPalette(SDL_Palette *palette); extern Uint8 SDL_FindColor(const SDL_Palette *pal, Uint8 r, Uint8 g, Uint8 b, Uint8 a); extern void SDL_DetectPalette(const SDL_Palette *pal, SDL_bool *is_opaque, SDL_bool *has_alpha_channel); extern SDL_Surface *SDL_DuplicatePixels(int width, int height, SDL_PixelFormat format, SDL_Colorspace colorspace, void *pixels, int pitch); diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 3cc685c086dfb..f2264ab49dbb1 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1342,9 +1342,10 @@ int SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip) } } -SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, const SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props) +SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props) { - SDL_Surface *convert; + SDL_Palette *temp_palette = NULL; + SDL_Surface *convert = NULL; SDL_Colorspace src_colorspace; SDL_PropertiesID src_properties; Uint32 copy_flags; @@ -1359,12 +1360,12 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm if (!SDL_SurfaceValid(surface)) { SDL_InvalidParamError("surface"); - return NULL; + goto error; } if (format == SDL_PIXELFORMAT_UNKNOWN) { SDL_InvalidParamError("format"); - return NULL; + goto error; } /* Check for empty destination palette! (results in empty image) */ @@ -1377,7 +1378,14 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm } if (i == palette->ncolors) { SDL_SetError("Empty destination palette"); - return NULL; + goto error; + } + } else if (SDL_ISPIXELFORMAT_INDEXED(format)) { + // Create a dither palette for conversion + temp_palette = SDL_CreatePalette(1 << SDL_BITSPERPIXEL(format)); + if (temp_palette) { + SDL_DitherPalette(temp_palette); + palette = temp_palette; } } @@ -1387,7 +1395,10 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm /* Create a new surface with the desired format */ convert = SDL_CreateSurface(surface->w, surface->h, format); if (!convert) { - return NULL; + goto error; + } + if (SDL_ISPIXELFORMAT_INDEXED(format)) { + SDL_SetSurfacePalette(convert, palette); } if (colorspace == SDL_COLORSPACE_UNKNOWN) { @@ -1397,8 +1408,7 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm if (SDL_ISPIXELFORMAT_FOURCC(format) || SDL_ISPIXELFORMAT_FOURCC(surface->format)) { if (SDL_ConvertPixelsAndColorspace(surface->w, surface->h, surface->format, src_colorspace, src_properties, surface->pixels, surface->pitch, convert->format, colorspace, props, convert->pixels, convert->pitch) < 0) { - SDL_DestroySurface(convert); - return NULL; + goto error; } /* Save the original copy flags */ @@ -1407,14 +1417,6 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm goto end; } - /* Copy the palette if any */ - if (palette && convert->internal->palette) { - SDL_memcpy(convert->internal->palette->colors, - palette->colors, - palette->ncolors * sizeof(SDL_Color)); - convert->internal->palette->ncolors = palette->ncolors; - } - /* Save the original copy flags */ copy_flags = surface->internal->map.info.flags; copy_color.r = surface->internal->map.info.r; @@ -1509,8 +1511,7 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm /* SDL_BlitSurfaceUnchecked failed, and so the conversion */ if (ret < 0) { - SDL_DestroySurface(convert); - return NULL; + goto error; } if (copy_flags & SDL_COPY_COLORKEY) { @@ -1547,8 +1548,7 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm /* Create a dummy surface to get the colorkey converted */ tmp = SDL_CreateSurface(1, 1, surface->format); if (!tmp) { - SDL_DestroySurface(convert); - return NULL; + goto error; } /* Share the palette, if any */ @@ -1564,8 +1564,7 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm tmp2 = SDL_ConvertSurfaceAndColorspace(tmp, format, palette, colorspace, props); if (!tmp2) { SDL_DestroySurface(tmp); - SDL_DestroySurface(convert); - return NULL; + goto error; } /* Get the converted colorkey */ @@ -1585,6 +1584,9 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm } end: + if (temp_palette) { + SDL_DestroyPalette(temp_palette); + } SDL_SetSurfaceClipRect(convert, &surface->internal->clip_rect); @@ -1601,6 +1603,15 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm /* We're ready to go! */ return convert; + +error: + if (temp_palette) { + SDL_DestroyPalette(temp_palette); + } + if (convert) { + SDL_DestroySurface(convert); + } + return NULL; } SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface) From e41428d259d326bd1c7588cb209809e9d9007a67 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 16:54:58 -0700 Subject: [PATCH 351/431] Added full blit feature support for 8-bit surfaces Fixes https://github.com/libsdl-org/SDL/issues/8079 --- src/video/SDL_blit.c | 6 ++-- src/video/SDL_blit.h | 4 +++ src/video/SDL_blit_slow.c | 70 +++++++++++++++++++++++++++++++++++---- 3 files changed, 72 insertions(+), 8 deletions(-) diff --git a/src/video/SDL_blit.c b/src/video/SDL_blit.c index ce543e2ee07d3..5965bf3483a58 100644 --- a/src/video/SDL_blit.c +++ b/src/video/SDL_blit.c @@ -279,9 +279,11 @@ int SDL_CalculateBlit(SDL_Surface *surface) SDL_PixelFormat src_format = surface->format; SDL_PixelFormat dst_format = dst->format; - if (!SDL_ISPIXELFORMAT_INDEXED(src_format) && + if ((!SDL_ISPIXELFORMAT_INDEXED(src_format) || + (src_format == SDL_PIXELFORMAT_INDEX8 && surface->internal->palette)) && !SDL_ISPIXELFORMAT_FOURCC(src_format) && - !SDL_ISPIXELFORMAT_INDEXED(dst_format) && + (!SDL_ISPIXELFORMAT_INDEXED(dst_format) || + (dst_format == SDL_PIXELFORMAT_INDEX8 && dst->internal->palette)) && !SDL_ISPIXELFORMAT_FOURCC(dst_format)) { blit = SDL_Blit_Slow; } diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index 18ceb39d11cc3..bd47219b8872c 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -226,6 +226,10 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); ((b >> (8 - fmt->Bbits)) << fmt->Bshift) | \ fmt->Amask; \ } +#define RGB332_FROM_RGB(Pixel, r, g, b) \ + { \ + Pixel = (Uint8)(((r >> 5) << 5) | ((g >> 5) << 2) | (b >> 6)); \ + } #define RGB565_FROM_RGB(Pixel, r, g, b) \ { \ Pixel = (Uint16)(((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3)); \ diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c index db675d5421640..b6c98ef787724 100644 --- a/src/video/SDL_blit_slow.c +++ b/src/video/SDL_blit_slow.c @@ -26,6 +26,8 @@ typedef enum { + SlowBlitPixelAccess_Unknown, + SlowBlitPixelAccess_Index8, SlowBlitPixelAccess_RGB, SlowBlitPixelAccess_RGBA, SlowBlitPixelAccess_10Bit, @@ -38,6 +40,8 @@ static SlowBlitPixelAccess GetPixelAccessMethod(SDL_PixelFormat format) return SlowBlitPixelAccess_Large; } else if (SDL_ISPIXELFORMAT_10BIT(format)) { return SlowBlitPixelAccess_10Bit; + } else if (format == SDL_PIXELFORMAT_INDEX8) { + return SlowBlitPixelAccess_Index8; } else if (SDL_ISPIXELFORMAT_ALPHA(format)) { return SlowBlitPixelAccess_RGBA; } else { @@ -63,7 +67,9 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) Uint64 posy, posx; Uint64 incy, incx; const SDL_PixelFormatDetails *src_fmt = info->src_fmt; + const SDL_Palette *src_pal = info->src_pal; const SDL_PixelFormatDetails *dst_fmt = info->dst_fmt; + const SDL_Palette *dst_pal = info->dst_pal; int srcbpp = src_fmt->bytes_per_pixel; int dstbpp = dst_fmt->bytes_per_pixel; SlowBlitPixelAccess src_access; @@ -89,6 +95,15 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) src = (info->src + (srcy * info->src_pitch) + (srcx * srcbpp)); switch (src_access) { + case SlowBlitPixelAccess_Unknown: + break; + case SlowBlitPixelAccess_Index8: + srcpixel = *src; + srcR = src_pal->colors[srcpixel].r; + srcG = src_pal->colors[srcpixel].g; + srcB = src_pal->colors[srcpixel].b; + srcA = src_pal->colors[srcpixel].a; + break; case SlowBlitPixelAccess_RGB: DISEMBLE_RGB(src, srcbpp, src_fmt, srcpixel, srcR, srcG, srcB); srcA = 0xFF; @@ -136,6 +151,15 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) } if ((flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL))) { switch (dst_access) { + case SlowBlitPixelAccess_Unknown: + break; + case SlowBlitPixelAccess_Index8: + dstpixel = *dst; + dstR = dst_pal->colors[dstpixel].r; + dstG = dst_pal->colors[dstpixel].g; + dstB = dst_pal->colors[dstpixel].b; + dstA = dst_pal->colors[dstpixel].a; + break; case SlowBlitPixelAccess_RGB: DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB); dstA = 0xFF; @@ -255,6 +279,16 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) } switch (dst_access) { + case SlowBlitPixelAccess_Unknown: + break; + case SlowBlitPixelAccess_Index8: + RGB332_FROM_RGB(dstpixel, dstR, dstG, dstB); + if (info->table) { + *dst = info->table[dstpixel]; + } else { + *dst = dstpixel; + } + break; case SlowBlitPixelAccess_RGB: ASSEMBLE_RGB(dst, dstbpp, dst_fmt, dstR, dstG, dstB); break; @@ -388,7 +422,7 @@ static Uint16 float_to_half(float a) return ir; } -static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_PixelFormatDetails *fmt, SDL_Colorspace colorspace, float SDR_white_point, +static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_PixelFormatDetails *fmt, const SDL_Palette *pal, SDL_Colorspace colorspace, float SDR_white_point, float *outR, float *outG, float *outB, float *outA) { Uint32 pixel; @@ -397,6 +431,15 @@ static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_ float v[4]; switch (access) { + case SlowBlitPixelAccess_Unknown: + break; + case SlowBlitPixelAccess_Index8: + pixel = *pixels; + fR = (float)pal->colors[pixel].r / 255.0f; + fG = (float)pal->colors[pixel].g / 255.0f; + fB = (float)pal->colors[pixel].b / 255.0f; + fA = (float)pal->colors[pixel].a / 255.0f; + break; case SlowBlitPixelAccess_RGB: DISEMBLE_RGB(pixels, fmt->bytes_per_pixel, fmt, pixel, R, G, B); fR = (float)R / 255.0f; @@ -543,10 +586,11 @@ static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_ *outA = fA; } -static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_PixelFormatDetails *fmt, SDL_Colorspace colorspace, float SDR_white_point, +static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_PixelFormatDetails *fmt, Uint8 *table, SDL_Colorspace colorspace, float SDR_white_point, float fR, float fG, float fB, float fA) { Uint32 R, G, B, A; + Uint32 pixel; float v[4]; /* We converted to nits so src and dst are guaranteed to be linear and in the same units */ @@ -572,6 +616,19 @@ static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL } switch (access) { + case SlowBlitPixelAccess_Unknown: + break; + case SlowBlitPixelAccess_Index8: + R = (Uint8)SDL_roundf(SDL_clamp(fR, 0.0f, 1.0f) * 7.0f); + G = (Uint8)SDL_roundf(SDL_clamp(fG, 0.0f, 1.0f) * 7.0f); + B = (Uint8)SDL_roundf(SDL_clamp(fB, 0.0f, 1.0f) * 3.0f); + pixel = (R << 5) | (G << 2) | B; + if (table) { + *pixels = table[pixel]; + } else { + *pixels = pixel; + } + break; case SlowBlitPixelAccess_RGB: R = (Uint8)SDL_roundf(SDL_clamp(fR, 0.0f, 1.0f) * 255.0f); G = (Uint8)SDL_roundf(SDL_clamp(fG, 0.0f, 1.0f) * 255.0f); @@ -587,7 +644,6 @@ static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL break; case SlowBlitPixelAccess_10Bit: { - Uint32 pixel; switch (fmt->format) { case SDL_PIXELFORMAT_XRGB2101010: fA = 1.0f; @@ -774,7 +830,9 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) Uint64 posy, posx; Uint64 incy, incx; const SDL_PixelFormatDetails *src_fmt = info->src_fmt; + const SDL_Palette *src_pal = info->src_pal; const SDL_PixelFormatDetails *dst_fmt = info->dst_fmt; + const SDL_Palette *dst_pal = info->dst_pal; int srcbpp = src_fmt->bytes_per_pixel; int dstbpp = dst_fmt->bytes_per_pixel; SlowBlitPixelAccess src_access; @@ -858,7 +916,7 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) srcx = posx >> 16; src = (info->src + (srcy * info->src_pitch) + (srcx * srcbpp)); - ReadFloatPixel(src, src_access, src_fmt, src_colorspace, src_white_point, &srcR, &srcG, &srcB, &srcA); + ReadFloatPixel(src, src_access, src_fmt, src_pal, src_colorspace, src_white_point, &srcR, &srcG, &srcB, &srcA); if (tonemap.op) { ApplyTonemap(&tonemap, &srcR, &srcG, &srcB); @@ -872,7 +930,7 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) /* colorkey isn't supported */ } if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) { - ReadFloatPixel(dst, dst_access, dst_fmt, dst_colorspace, dst_white_point, &dstR, &dstG, &dstB, &dstA); + ReadFloatPixel(dst, dst_access, dst_fmt, dst_pal, dst_colorspace, dst_white_point, &dstR, &dstG, &dstB, &dstA); } else { /* don't care */ dstR = dstG = dstB = dstA = 0.0f; @@ -923,7 +981,7 @@ void SDL_Blit_Slow_Float(SDL_BlitInfo *info) break; } - WriteFloatPixel(dst, dst_access, dst_fmt, dst_colorspace, dst_white_point, dstR, dstG, dstB, dstA); + WriteFloatPixel(dst, dst_access, dst_fmt, info->table, dst_colorspace, dst_white_point, dstR, dstG, dstB, dstA); posx += incx; dst += dstbpp; From b5292bdec901917bb47c68c5d11fc3a22ae9bb35 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 16:56:34 -0700 Subject: [PATCH 352/431] Added blend mode testing for 8-bit surfaces --- test/testautomation_surface.c | 104 ++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 36 deletions(-) diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index e4c9e2226ef40..f3e266baebf64 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -68,6 +68,28 @@ static void surfaceTearDown(void *arg) testSurface = NULL; } +static void DitherPalette(SDL_Palette *palette) +{ + int i; + + for (i = 0; i < palette->ncolors; 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; + palette->colors[i].r = (Uint8)r; + g = (i << 3) & 0xe0; + g |= g >> 3 | g >> 6; + palette->colors[i].g = (Uint8)g; + b = i & 0x3; + b |= b << 2; + b |= b << 4; + palette->colors[i].b = (Uint8)b; + palette->colors[i].a = SDL_ALPHA_OPAQUE; + } +} + /** * Helper that blits in a specific blend mode, -1 for color mod, -2 for alpha mod */ @@ -78,9 +100,6 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S int ret; SDL_Surface *src; SDL_Surface *dst; - int checkFailCount1; - int checkFailCount2; - int checkFailCount3; Uint32 color; Uint8 srcR = 10, srcG = 128, srcB = 240, srcA = 100; Uint8 dstR = 128, dstG = 128, dstB = 128, dstA = 128; @@ -96,12 +115,22 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S } /* Clear surface. */ - color = SDL_MapSurfaceRGBA(dst, dstR, dstG, dstB, dstA); - SDLTest_AssertPass("Call to SDL_MapSurfaceRGBA()"); + if (SDL_ISPIXELFORMAT_INDEXED(dst_format)) { + SDL_Palette *palette = SDL_CreateSurfacePalette(dst); + DitherPalette(palette); + palette->colors[0].r = dstR; + palette->colors[0].g = dstG; + palette->colors[0].b = dstB; + palette->colors[0].a = dstA; + color = 0; + } else { + color = SDL_MapSurfaceRGBA(dst, dstR, dstG, dstB, dstA); + SDLTest_AssertPass("Call to SDL_MapSurfaceRGBA()"); + } ret = SDL_FillSurfaceRect(dst, NULL, color); SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillSurfaceRect, expected: 0, got: %i", ret); - SDL_GetRGBA(color, SDL_GetPixelFormatDetails(dst->format), NULL, &dstR, &dstG, &dstB, &dstA); + SDL_GetRGBA(color, SDL_GetPixelFormatDetails(dst->format), SDL_GetSurfacePalette(dst), &dstR, &dstG, &dstB, &dstA); /* Create src surface */ src = SDL_CreateSurface(1, 1, src_format); @@ -109,6 +138,13 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S if (src == NULL) { return; } + if (SDL_ISPIXELFORMAT_INDEXED(src_format)) { + SDL_Palette *palette = SDL_CreateSurfacePalette(src); + palette->colors[0].r = srcR; + palette->colors[0].g = srcG; + palette->colors[0].b = srcB; + palette->colors[0].a = srcA; + } /* Reset alpha modulation */ ret = SDL_SetSurfaceAlphaMod(src, 255); @@ -131,7 +167,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S ret = SDL_FillSurfaceRect(src, NULL, color); SDLTest_AssertPass("Call to SDL_FillSurfaceRect()"); SDLTest_AssertCheck(ret == 0, "Verify result from SDL_FillSurfaceRect, expected: 0, got: %i", ret); - SDL_GetRGBA(color, SDL_GetPixelFormatDetails(src->format), NULL, &srcR, &srcG, &srcB, &srcA); + SDL_GetRGBA(color, SDL_GetPixelFormatDetails(src->format), SDL_GetSurfacePalette(src), &srcR, &srcG, &srcB, &srcA); /* Set blend mode. */ if (mode >= 0) { @@ -146,16 +182,11 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S /* Test blend mode. */ #define FLOAT(X) ((float)X / 255.0f) - checkFailCount1 = 0; - checkFailCount2 = 0; - checkFailCount3 = 0; switch (mode) { case -1: /* Set color mod. */ ret = SDL_SetSurfaceColorMod(src, srcR, srcG, srcB); - if (ret != 0) { - checkFailCount2++; - } + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", ret); expectedR = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcR) * FLOAT(srcR)) * FLOAT(srcA) + FLOAT(dstR) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); expectedG = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcG) * FLOAT(srcG)) * FLOAT(srcA) + FLOAT(dstG) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); expectedB = (Uint8)SDL_roundf(SDL_clamp((FLOAT(srcB) * FLOAT(srcB)) * FLOAT(srcA) + FLOAT(dstB) * (1.0f - FLOAT(srcA)), 0.0f, 1.0f) * 255.0f); @@ -164,9 +195,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S case -2: /* Set alpha mod. */ ret = SDL_SetSurfaceAlphaMod(src, srcA); - if (ret != 0) { - checkFailCount3++; - } + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", ret); expectedR = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcR) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstR) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); expectedG = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcG) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstG) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); expectedB = (Uint8)SDL_roundf(SDL_clamp(FLOAT(srcB) * (FLOAT(srcA) * FLOAT(srcA)) + FLOAT(dstB) * (1.0f - (FLOAT(srcA) * FLOAT(srcA))), 0.0f, 1.0f) * 255.0f); @@ -219,30 +248,33 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S return; } - /* Blitting. */ - ret = SDL_BlitSurface(src, NULL, dst, NULL); - if (ret != 0) { - checkFailCount1++; + if (SDL_ISPIXELFORMAT_INDEXED(dst_format)) { + SDL_Palette *palette = SDL_GetSurfacePalette(dst); + palette->colors[1].r = expectedR; + palette->colors[1].g = expectedG; + palette->colors[1].b = expectedB; + palette->colors[1].a = expectedA; } - SDLTest_AssertCheck(checkFailCount1 == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i", checkFailCount1); - SDLTest_AssertCheck(checkFailCount2 == 0, "Validate results from calls to SDL_SetSurfaceColorMod, expected: 0, got: %i", checkFailCount2); - SDLTest_AssertCheck(checkFailCount3 == 0, "Validate results from calls to SDL_SetSurfaceAlphaMod, expected: 0, got: %i", checkFailCount3); - - SDL_ReadSurfacePixel(dst, 0, 0, &actualR, &actualG, &actualB, &actualA); - deltaR = SDL_abs((int)actualR - expectedR); - deltaG = SDL_abs((int)actualG - expectedG); - deltaB = SDL_abs((int)actualB - expectedB); - deltaA = SDL_abs((int)actualA - expectedA); - SDLTest_AssertCheck( - deltaR <= MAXIMUM_ERROR && - deltaG <= MAXIMUM_ERROR && - deltaB <= MAXIMUM_ERROR && - deltaA <= MAXIMUM_ERROR, - "Checking %s -> %s blit results, expected %d,%d,%d,%d, got %d,%d,%d,%d", + /* Blitting. */ + ret = SDL_BlitSurface(src, NULL, dst, NULL); + SDLTest_AssertCheck(ret == 0, "Validate results from calls to SDL_BlitSurface, expected: 0, got: %i: %s", ret, (ret < 0) ? SDL_GetError() : "success"); + if (ret == 0) { + SDL_ReadSurfacePixel(dst, 0, 0, &actualR, &actualG, &actualB, &actualA); + deltaR = SDL_abs((int)actualR - expectedR); + deltaG = SDL_abs((int)actualG - expectedG); + deltaB = SDL_abs((int)actualB - expectedB); + deltaA = SDL_abs((int)actualA - expectedA); + SDLTest_AssertCheck( + deltaR <= MAXIMUM_ERROR && + deltaG <= MAXIMUM_ERROR && + deltaB <= MAXIMUM_ERROR && + deltaA <= MAXIMUM_ERROR, + "Checking %s -> %s blit results, expected %d,%d,%d,%d, got %d,%d,%d,%d", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format), expectedR, expectedG, expectedB, expectedA, actualR, actualG, actualB, actualA); + } /* Clean up */ SDL_DestroySurface(src); @@ -252,7 +284,7 @@ static void testBlitBlendModeWithFormats(int mode, SDL_PixelFormat src_format, S static void testBlitBlendMode(int mode) { const SDL_PixelFormat src_formats[] = { - SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888 + SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888 }; const SDL_PixelFormat dst_formats[] = { SDL_PIXELFORMAT_XRGB8888, SDL_PIXELFORMAT_ARGB8888 From 2db57e2678d52cec02a2deaaef672d1dfcb68f43 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 18:43:14 -0700 Subject: [PATCH 353/431] Removed SlowBlitPixelAccess_Unknown This wasn't actually set anywhere, and not needed. --- src/video/SDL_blit_slow.c | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/video/SDL_blit_slow.c b/src/video/SDL_blit_slow.c index b6c98ef787724..365b4cd52b728 100644 --- a/src/video/SDL_blit_slow.c +++ b/src/video/SDL_blit_slow.c @@ -26,7 +26,6 @@ typedef enum { - SlowBlitPixelAccess_Unknown, SlowBlitPixelAccess_Index8, SlowBlitPixelAccess_RGB, SlowBlitPixelAccess_RGBA, @@ -95,8 +94,6 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) src = (info->src + (srcy * info->src_pitch) + (srcx * srcbpp)); switch (src_access) { - case SlowBlitPixelAccess_Unknown: - break; case SlowBlitPixelAccess_Index8: srcpixel = *src; srcR = src_pal->colors[srcpixel].r; @@ -151,8 +148,6 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) } if ((flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL))) { switch (dst_access) { - case SlowBlitPixelAccess_Unknown: - break; case SlowBlitPixelAccess_Index8: dstpixel = *dst; dstR = dst_pal->colors[dstpixel].r; @@ -279,8 +274,6 @@ void SDL_Blit_Slow(SDL_BlitInfo *info) } switch (dst_access) { - case SlowBlitPixelAccess_Unknown: - break; case SlowBlitPixelAccess_Index8: RGB332_FROM_RGB(dstpixel, dstR, dstG, dstB); if (info->table) { @@ -431,8 +424,6 @@ static void ReadFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL_ float v[4]; switch (access) { - case SlowBlitPixelAccess_Unknown: - break; case SlowBlitPixelAccess_Index8: pixel = *pixels; fR = (float)pal->colors[pixel].r / 255.0f; @@ -616,8 +607,6 @@ static void WriteFloatPixel(Uint8 *pixels, SlowBlitPixelAccess access, const SDL } switch (access) { - case SlowBlitPixelAccess_Unknown: - break; case SlowBlitPixelAccess_Index8: R = (Uint8)SDL_roundf(SDL_clamp(fR, 0.0f, 1.0f) * 7.0f); G = (Uint8)SDL_roundf(SDL_clamp(fG, 0.0f, 1.0f) * 7.0f); From 7c0307060d79d2b45cfb1b34623ca5cfd1a44f37 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 18:00:20 -0700 Subject: [PATCH 354/431] Textures with alpha format default to SDL_BLENDMODE_BLEND Fixes https://github.com/libsdl-org/SDL/issues/9941 --- docs/README-migration.md | 2 ++ src/render/SDL_render.c | 1 + test/testautomation_render.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/docs/README-migration.md b/docs/README-migration.md index 91e8376e7a24a..97f1f255a79ee 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1265,6 +1265,8 @@ SDL_CreateWindowAndRenderer() now takes the window title as the first parameter. SDL_GetRendererInfo() has been removed. The name of a renderer can be retrieved using SDL_GetRendererName(), and the other information is available as properties on the renderer. +Textures are created with SDL_SCALEMODE_LINEAR by default, and use SDL_BLENDMODE_BLEND by default if they are created with a format that has an alpha channel. + SDL_QueryTexture() has been removed. The properties of the texture can be queried using SDL_PROP_TEXTURE_FORMAT_NUMBER, SDL_PROP_TEXTURE_ACCESS_NUMBER, SDL_PROP_TEXTURE_WIDTH_NUMBER, and SDL_PROP_TEXTURE_HEIGHT_NUMBER. A function SDL_GetTextureSize() has been added to get the size of the texture as floating point values. Mouse and touch events are no longer filtered to change their coordinates, instead you diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 64128c79c02a4..ed049a5d1a301 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1355,6 +1355,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert texture->color.g = 1.0f; texture->color.b = 1.0f; texture->color.a = 1.0f; + texture->blendMode = SDL_ISPIXELFORMAT_ALPHA(format) ? SDL_BLENDMODE_BLEND : SDL_BLENDMODE_NONE; texture->scaleMode = SDL_SCALEMODE_LINEAR; texture->view.pixel_w = w; texture->view.pixel_h = h; diff --git a/test/testautomation_render.c b/test/testautomation_render.c index e867f8389d60d..aebdb32a0f95b 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -401,6 +401,12 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo if (dst == NULL) { return; } + if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) { + SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; + ret = SDL_GetTextureBlendMode(dst, &blendMode); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_GetTextureBlendMode(), expected: 0, got: %i", ret); + SDLTest_AssertCheck(blendMode == SDL_BLENDMODE_BLEND, "Verify alpha texture blend mode, expected %d, got %" SDL_PRIu32, SDL_BLENDMODE_BLEND, blendMode); + } /* Set as render target */ SDL_SetRenderTarget(renderer, dst); From 98bea25363f21d338e2ff22e1e8622cb7a10fd1b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 18:20:10 -0700 Subject: [PATCH 355/431] Converted surfaces with alpha format default to SDL_BLENDMODE_BLEND Fixes https://github.com/libsdl-org/SDL/pull/4690 --- src/video/SDL_surface.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index f2264ab49dbb1..9a6a7bce9d099 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1354,7 +1354,6 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm int ret; SDL_bool palette_ck_transform = SDL_FALSE; Uint8 palette_ck_value = 0; - SDL_bool palette_has_alpha = SDL_FALSE; Uint8 *palette_saved_alpha = NULL; int palette_saved_alpha_ncolors = 0; @@ -1449,8 +1448,6 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm if (!has_alpha_channel) { set_opaque = SDL_TRUE; } - } else { - palette_has_alpha = SDL_TRUE; } /* Set opaque and backup palette alpha values */ @@ -1471,7 +1468,6 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm if (copy_flags & SDL_COPY_COLORKEY) { if (surface->internal->palette && !palette) { palette_ck_transform = SDL_TRUE; - palette_has_alpha = SDL_TRUE; palette_ck_value = surface->internal->palette->colors[surface->internal->map.info.colorkey].a; surface->internal->palette->colors[surface->internal->map.info.colorkey].a = SDL_ALPHA_TRANSPARENT; } @@ -1592,8 +1588,7 @@ SDL_Surface *SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelForm /* Enable alpha blending by default if the new surface has an * alpha channel or alpha modulation */ - if ((SDL_ISPIXELFORMAT_ALPHA(surface->format) && SDL_ISPIXELFORMAT_ALPHA(format)) || - (palette_has_alpha && SDL_ISPIXELFORMAT_ALPHA(format)) || + if (SDL_ISPIXELFORMAT_ALPHA(format) || (copy_flags & SDL_COPY_MODULATE_ALPHA)) { SDL_SetSurfaceBlendMode(convert, SDL_BLENDMODE_BLEND); } From 1e828eec57cff31731153478823bc411bc0bf82d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 21:14:39 -0700 Subject: [PATCH 356/431] Fixed warning C4244: '=': conversion from 'float' to 'int', possible loss of data --- test/testspritesurface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testspritesurface.c b/test/testspritesurface.c index 7b855667b03e5..4abd7efd70d10 100644 --- a/test/testspritesurface.c +++ b/test/testspritesurface.c @@ -140,8 +140,8 @@ int main(int argc, char *argv[]) positions[i].y = SDL_rand(WINDOW_HEIGHT - sprite_h); positions[i].w = sprite_w; positions[i].h = sprite_h; - velocities[i].x = 0.0f; - velocities[i].y = 0.0f; + velocities[i].x = 0; + velocities[i].y = 0; while (velocities[i].x == 0.f && velocities[i].y == 0.f) { velocities[i].x = (SDL_rand(MAX_SPEED * 2 + 1)) - MAX_SPEED; velocities[i].y = (SDL_rand(MAX_SPEED * 2 + 1)) - MAX_SPEED; From 3d2e5a0b66eca4ade34f2a4fa81c8f4d8d33dac3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 21:15:56 -0700 Subject: [PATCH 357/431] Fixed a few remaining functions to directly return their values instead of an error code. --- docs/README-migration.md | 6 ++-- include/SDL3/SDL_render.h | 24 +++++-------- include/SDL3/SDL_surface.h | 12 +++---- include/SDL3/SDL_system.h | 6 ++-- src/core/SDL_core_unsupported.c | 8 ++--- src/core/android/SDL_android.c | 15 +++----- src/dynapi/SDL_dynapi_procs.h | 14 ++++---- src/render/SDL_render.c | 53 +++++++++++++---------------- src/render/software/SDL_render_sw.c | 4 +-- src/render/software/SDL_rotate.c | 13 +++---- src/render/software/SDL_triangle.c | 2 +- src/video/SDL_surface.c | 46 ++++++++++++------------- test/testautomation_render.c | 5 ++- test/testautomation_surface.c | 4 +-- test/testshader.c | 2 +- 15 files changed, 91 insertions(+), 123 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 97f1f255a79ee..693c3e96398a6 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1269,6 +1269,8 @@ Textures are created with SDL_SCALEMODE_LINEAR by default, and use SDL_BLENDMODE SDL_QueryTexture() has been removed. The properties of the texture can be queried using SDL_PROP_TEXTURE_FORMAT_NUMBER, SDL_PROP_TEXTURE_ACCESS_NUMBER, SDL_PROP_TEXTURE_WIDTH_NUMBER, and SDL_PROP_TEXTURE_HEIGHT_NUMBER. A function SDL_GetTextureSize() has been added to get the size of the texture as floating point values. +SDL_GetRenderDrawBlendMode(), SDL_GetTextureBlendMode(), and SDL_GetTextureScaleMode() have been changed to return the values directly instead of an int error code. + Mouse and touch events are no longer filtered to change their coordinates, instead you can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into the rendering viewport. @@ -1712,6 +1714,8 @@ SDL_SetSurfaceColorKey() takes an SDL_bool to enable and disable colorkey. RLE a SDL_SetSurfaceRLE() takes an SDL_bool to enable and disable RLE acceleration. +SDL_GetSurfaceBlendMode() and SDL_GetSurfaceColorKey() have been changed to return the values directly instead of an int error code. + The following functions have been renamed: * SDL_BlitScaled() => SDL_BlitSurfaceScaled() * SDL_ConvertSurfaceFormat() => SDL_ConvertSurface() @@ -1749,8 +1753,6 @@ The following symbols have been renamed: SDL_WindowsMessageHook has changed signatures so the message may be modified and it can block further message processing. -SDL_GetAndroidExternalStorageState() takes the state as an output parameter and returns 0 if the function succeeds or a negative error code if there was an error. - SDL_RequestAndroidPermission is no longer a blocking call; the caller now provides a callback function that fires when a response is available. SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump() have been renamed to SDL_SetiOSAnimationCallback() and SDL_SetiOSEventPump(), respectively. SDL2 has had macros to provide this new name with the old symbol since the introduction of the iPad, but now the correctly-named symbol is the only option. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 6580f575bcff4..6bd99f4d93da7 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1006,15 +1006,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SD * Get the blend mode used for texture copy operations. * * \param texture the texture to query. - * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the current SDL_BlendMode. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextureBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture); /** * Set the scale mode used for texture scale operations. @@ -1038,15 +1036,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SD * Get the scale mode used for texture scale operations. * * \param texture the texture to query. - * \param scaleMode a pointer filled in with the current scale mode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the current scale mode. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextureScaleMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); +extern SDL_DECLSPEC SDL_ScaleMode SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture); /** * Update the given texture rectangle with new pixel data. @@ -1641,15 +1637,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, * Get the color scale used for render operations. * * \param renderer the rendering context. - * \param scale a pointer filled in with the current color scale value. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the current color scale value. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderColorScale */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); +extern SDL_DECLSPEC float SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1671,15 +1665,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *rendere * Get the blend mode used for drawing operations. * * \param renderer the rendering context. - * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the current SDL_BlendMode. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer); /** * Clear the current rendering target with the drawing color. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 6998b12991e48..e14de0f25eee2 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -511,16 +511,14 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface * If the surface doesn't have color key enabled this function returns -1. * * \param surface the SDL_Surface structure to query. - * \param key a pointer filled in with the transparent pixel. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the transparent pixel. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceColorKey * \sa SDL_SurfaceHasColorKey */ -extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key); +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface); /** * Set an additional color value multiplied into blit operations. @@ -620,15 +618,13 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SD * Get the blend mode used for blit operations. * * \param surface the SDL_Surface structure to query. - * \param blendMode a pointer filled in with the current SDL_BlendMode. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the current SDL_BlendMode. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceBlendMode */ -extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode); +extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface); /** * Set the clipping rectangle for a surface. diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 3d9c9d9790333..4c4a963ea6bf1 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -426,16 +426,14 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidInternalStoragePath(void); * * If external storage is currently unavailable, this will return 0. * - * \param state filled with the current state of external storage. 0 if + * \returns the current state of external storage, or 0 if * external storage is currently unavailable. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetAndroidExternalStoragePath */ -extern SDL_DECLSPEC int SDLCALL SDL_GetAndroidExternalStorageState(Uint32 *state); +extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void); /** * Get the path used for external storage for this Android application. diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index 883c50452f9d0..da1c143270028 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -142,11 +142,11 @@ const char* SDL_GetAndroidExternalStoragePath() return NULL; } -SDL_DECLSPEC int SDLCALL SDL_GetAndroidExternalStorageState(Uint32 *state); -int SDL_GetAndroidExternalStorageState(Uint32 *state) +SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void); +Uint32 SDL_GetAndroidExternalStorageState(void) { - (void)state; - return SDL_Unsupported(); + SDL_Unsupported(); + return 0; } SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidInternalStoragePath(void); const char *SDL_GetAndroidInternalStoragePath(void) diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index d0c4e1a04edd1..3d1e46b68629c 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -2507,22 +2507,19 @@ const char *SDL_GetAndroidInternalStoragePath(void) return s_AndroidInternalFilesPath; } -int SDL_GetAndroidExternalStorageState(Uint32 *state) +Uint32 SDL_GetAndroidExternalStorageState(void) { struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); jmethodID mid; jclass cls; jstring stateString; const char *state_string; - int stateFlags; + Uint32 stateFlags; JNIEnv *env = Android_JNI_GetEnv(); if (!LocalReferenceHolder_Init(&refs, env)) { LocalReferenceHolder_Cleanup(&refs); - if (state) { - *state = 0; - } - return -1; + return 0; } cls = (*env)->FindClass(env, "android/os/Environment"); @@ -2546,10 +2543,8 @@ int SDL_GetAndroidExternalStorageState(Uint32 *state) (*env)->ReleaseStringUTFChars(env, stateString, state_string); LocalReferenceHolder_Cleanup(&refs); - if (state) { - *state = stateFlags; - } - return 0; + + return stateFlags; } // this caches a string until the process ends, so there's no need to use SDL_FreeLater. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index c33d2779b25d0..e2cedea0744dc 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -196,7 +196,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadSensorEnabled,(SDL_Gamepad *a, SDL_SensorTyp SDL_DYNAPI_PROC(void*,SDL_GetAndroidActivity,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetAndroidCachePath,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetAndroidExternalStoragePath,(void),(),return) -SDL_DYNAPI_PROC(int,SDL_GetAndroidExternalStorageState,(Uint32 *a),(a),return) +SDL_DYNAPI_PROC(Uint32,SDL_GetAndroidExternalStorageState,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetAndroidInternalStoragePath,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_GetAndroidJNIEnv,(void),(),return) SDL_DYNAPI_PROC(int,SDL_GetAndroidSDKVersion,(void),(),return) @@ -433,8 +433,8 @@ SDL_DYNAPI_PROC(int,SDL_GetRectUnionFloat,(const SDL_FRect *a, const SDL_FRect * SDL_DYNAPI_PROC(SDL_bool,SDL_GetRelativeMouseMode,(void),(),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetRelativeMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetRenderClipRect,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_GetRenderColorScale,(SDL_Renderer *a, float *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_GetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode *b),(a,b),return) +SDL_DYNAPI_PROC(float,SDL_GetRenderColorScale,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(SDL_BlendMode,SDL_GetRenderDrawBlendMode,(SDL_Renderer *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetRenderDrawColor,(SDL_Renderer *a, Uint8 *b, Uint8 *c, Uint8 *d, Uint8 *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_GetRenderDrawColorFloat,(SDL_Renderer *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetRenderDriver,(int a),(a),return) @@ -475,9 +475,9 @@ SDL_DYNAPI_PROC(int,SDL_GetStoragePathInfo,(SDL_Storage *a, const char *b, SDL_P SDL_DYNAPI_PROC(Uint64,SDL_GetStorageSpaceRemaining,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetStringProperty,(SDL_PropertiesID a, const char *b, const char *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceAlphaMod,(SDL_Surface *a, Uint8 *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_GetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_BlendMode,SDL_GetSurfaceBlendMode,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorKey,(SDL_Surface *a, Uint32 *b),(a,b),return) +SDL_DYNAPI_PROC(Uint32,SDL_GetSurfaceColorKey,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorMod,(SDL_Surface *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_Colorspace,SDL_GetSurfaceColorspace,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_GetSurfacePalette,(SDL_Surface *a),(a),return) @@ -488,11 +488,11 @@ SDL_DYNAPI_PROC(void*,SDL_GetTLS,(SDL_TLSID *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetTextInputArea,(SDL_Window *a, SDL_Rect *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaMod,(SDL_Texture *a, Uint8 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaModFloat,(SDL_Texture *a, float *b),(a,b),return) -SDL_DYNAPI_PROC(int,SDL_GetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_BlendMode,SDL_GetTextureBlendMode,(SDL_Texture *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetTextureColorMod,(SDL_Texture *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_GetTextureColorModFloat,(SDL_Texture *a, float *b, float *c, float *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetTextureProperties,(SDL_Texture *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode *b),(a,b),return) +SDL_DYNAPI_PROC(SDL_ScaleMode,SDL_GetTextureScaleMode,(SDL_Texture *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetTextureSize,(SDL_Texture *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_ThreadID,SDL_GetThreadID,(SDL_Thread *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetThreadName,(SDL_Thread *a),(a),return) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index ed049a5d1a301..6fb1a0ebf98ec 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1641,7 +1641,6 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s { Uint8 r, g, b, a; - SDL_BlendMode blendMode; SDL_GetSurfaceColorMod(surface, &r, &g, &b); SDL_SetTextureColorMod(texture, r, g, b); @@ -1653,8 +1652,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s /* We converted to a texture with alpha format */ SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); } else { - SDL_GetSurfaceBlendMode(surface, &blendMode); - SDL_SetTextureBlendMode(texture, blendMode); + SDL_SetTextureBlendMode(texture, SDL_GetSurfaceBlendMode(surface)); } } return texture; @@ -1799,6 +1797,10 @@ int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) CHECK_TEXTURE_MAGIC(texture, -1); + if (blendMode == SDL_BLENDMODE_INVALID) { + return SDL_InvalidParamError("blendMode"); + } + renderer = texture->renderer; if (!IsSupportedBlendMode(renderer, blendMode)) { return SDL_Unsupported(); @@ -1810,14 +1812,11 @@ int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) return 0; } -int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) +SDL_BlendMode SDL_GetTextureBlendMode(SDL_Texture *texture) { - CHECK_TEXTURE_MAGIC(texture, -1); + CHECK_TEXTURE_MAGIC(texture, SDL_BLENDMODE_INVALID); - if (blendMode) { - *blendMode = texture->blendMode; - } - return 0; + return texture->blendMode; } int SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) @@ -1836,14 +1835,11 @@ int SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) return 0; } -int SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode) +SDL_ScaleMode SDL_GetTextureScaleMode(SDL_Texture *texture) { - CHECK_TEXTURE_MAGIC(texture, -1); + CHECK_TEXTURE_MAGIC(texture, SDL_SCALEMODE_LINEAR); - if (scaleMode) { - *scaleMode = texture->scaleMode; - } - return 0; + return texture->scaleMode; } #if SDL_HAVE_YUV @@ -3069,20 +3065,21 @@ int SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) return 0; } -int SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) +float SDL_GetRenderColorScale(SDL_Renderer *renderer) { - CHECK_RENDERER_MAGIC(renderer, -1); + CHECK_RENDERER_MAGIC(renderer, 1.0f); - if (scale) { - *scale = renderer->color_scale / renderer->SDR_white_point; - } - return 0; + return renderer->color_scale / renderer->SDR_white_point; } int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) { CHECK_RENDERER_MAGIC(renderer, -1); + if (blendMode == SDL_BLENDMODE_INVALID) { + return SDL_InvalidParamError("blendMode"); + } + if (!IsSupportedBlendMode(renderer, blendMode)) { return SDL_Unsupported(); } @@ -3090,20 +3087,18 @@ int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) return 0; } -int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) +SDL_BlendMode SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer) { - CHECK_RENDERER_MAGIC(renderer, -1); + CHECK_RENDERER_MAGIC(renderer, SDL_BLENDMODE_INVALID); - *blendMode = renderer->blendMode; - return 0; + return renderer->blendMode; } int SDL_RenderClear(SDL_Renderer *renderer) { - int retval; CHECK_RENDERER_MAGIC(renderer, -1); - retval = QueueCmdClear(renderer); - return retval; + + return QueueCmdClear(renderer); } int SDL_RenderPoint(SDL_Renderer *renderer, float x, float y) @@ -3970,7 +3965,7 @@ static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, float r = 0, g = 0, b = 0, a = 0; /* Save */ - SDL_GetRenderDrawBlendMode(renderer, &blendMode); + blendMode = SDL_GetRenderDrawBlendMode(renderer); SDL_GetRenderDrawColorFloat(renderer, &r, &g, &b, &a); if (texture) { diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 4e462e75dbd0f..4df9ea7ef3773 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -355,7 +355,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex return -1; } - SDL_GetSurfaceBlendMode(src, &blendmode); + blendmode = SDL_GetSurfaceBlendMode(src); SDL_GetSurfaceAlphaMod(src, &alphaMod); SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod); @@ -841,7 +841,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo SDL_BlendMode blendmode; Uint8 alphaMod, rMod, gMod, bMod; - SDL_GetSurfaceBlendMode(src, &blendmode); + blendmode = SDL_GetSurfaceBlendMode(src); SDL_GetSurfaceAlphaMod(src, &alphaMod); SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod); diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index 02382a8e6ffe2..30ff1e95bc642 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -78,11 +78,7 @@ Returns colorkey info for a surface */ static Uint32 get_colorkey(SDL_Surface *src) { - Uint32 key = 0; - if (SDL_SurfaceHasColorKey(src)) { - SDL_GetSurfaceColorKey(src, &key); - } - return key; + return SDL_GetSurfaceColorKey(src); } /* rotate (sx, sy) by (angle, center) into (dx, dy) */ @@ -501,9 +497,8 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in } if (SDL_SurfaceHasColorKey(src)) { - if (SDL_GetSurfaceColorKey(src, &colorkey) == 0) { - colorKeyAvailable = SDL_TRUE; - } + colorkey = SDL_GetSurfaceColorKey(src); + colorKeyAvailable = SDL_TRUE; } /* This function requires a 32-bit surface or 8-bit surface with a colorkey */ is8bit = src->internal->format->bits_per_pixel == 8 && colorKeyAvailable; @@ -536,7 +531,7 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in /* Adjust for guard rows */ rz_dst->h = rect_dest->h; - SDL_GetSurfaceBlendMode(src, &blendmode); + blendmode = SDL_GetSurfaceBlendMode(src); if (colorKeyAvailable == SDL_TRUE) { /* If available, the colorkey will be used to discard the pixels that are outside of the rotated area. */ diff --git a/src/render/software/SDL_triangle.c b/src/render/software/SDL_triangle.c index fd4350d061e50..048859f54a49e 100644 --- a/src/render/software/SDL_triangle.c +++ b/src/render/software/SDL_triangle.c @@ -524,7 +524,7 @@ int SDL_SW_BlitTriangle( bounding_rect_fixedpoint(d0, d1, d2, &dstrect); - SDL_GetSurfaceBlendMode(src, &blend); + blend = SDL_GetSurfaceBlendMode(src); /* TRIANGLE_GET_TEXTCOORD interpolates up to the max values included, so reduce by 1 */ { diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 9a6a7bce9d099..d973aca691229 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -515,20 +515,13 @@ SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) return SDL_TRUE; } -int SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key) +Uint32 SDL_GetSurfaceColorKey(SDL_Surface *surface) { if (!SDL_SurfaceValid(surface)) { - return SDL_InvalidParamError("surface"); - } - - if (!(surface->internal->map.info.flags & SDL_COPY_COLORKEY)) { - return SDL_SetError("Surface doesn't have a colorkey"); + return 0; } - if (key) { - *key = surface->internal->map.info.colorkey; - } - return 0; + return surface->internal->map.info.colorkey; } /* This is a fairly slow function to switch from colorkey to alpha @@ -706,6 +699,10 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) return SDL_InvalidParamError("surface"); } + if (blendMode == SDL_BLENDMODE_INVALID) { + return SDL_InvalidParamError("blendMode"); + } + status = 0; flags = surface->internal->map.info.flags; surface->internal->map.info.flags &= ~(SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL); @@ -742,40 +739,39 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) return status; } -int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) +SDL_BlendMode SDL_GetSurfaceBlendMode(SDL_Surface *surface) { - if (!SDL_SurfaceValid(surface)) { - return SDL_InvalidParamError("surface"); - } + SDL_BlendMode blendMode; - if (!blendMode) { - return 0; + if (!SDL_SurfaceValid(surface)) { + SDL_InvalidParamError("surface"); + return SDL_BLENDMODE_INVALID; } switch (surface->internal->map.info.flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: - *blendMode = SDL_BLENDMODE_BLEND; + blendMode = SDL_BLENDMODE_BLEND; break; case SDL_COPY_BLEND_PREMULTIPLIED: - *blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; + blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; break; case SDL_COPY_ADD: - *blendMode = SDL_BLENDMODE_ADD; + blendMode = SDL_BLENDMODE_ADD; break; case SDL_COPY_ADD_PREMULTIPLIED: - *blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; + blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; break; case SDL_COPY_MOD: - *blendMode = SDL_BLENDMODE_MOD; + blendMode = SDL_BLENDMODE_MOD; break; case SDL_COPY_MUL: - *blendMode = SDL_BLENDMODE_MUL; + blendMode = SDL_BLENDMODE_MUL; break; default: - *blendMode = SDL_BLENDMODE_NONE; + blendMode = SDL_BLENDMODE_NONE; break; } - return 0; + return blendMode; } SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) @@ -1151,7 +1147,7 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, /* Save source infos */ SDL_GetSurfaceColorMod(src, &r, &g, &b); SDL_GetSurfaceAlphaMod(src, &alpha); - SDL_GetSurfaceBlendMode(src, &blendMode); + blendMode = SDL_GetSurfaceBlendMode(src); srcrect2.x = srcrect->x; srcrect2.y = srcrect->y; srcrect2.w = srcrect->w; diff --git a/test/testautomation_render.c b/test/testautomation_render.c index aebdb32a0f95b..c9057d3b3c2c3 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -402,9 +402,8 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo return; } if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) { - SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; - ret = SDL_GetTextureBlendMode(dst, &blendMode); - SDLTest_AssertCheck(ret == 0, "Verify result from SDL_GetTextureBlendMode(), expected: 0, got: %i", ret); + SDL_BlendMode blendMode = SDL_GetTextureBlendMode(dst); + SDLTest_AssertCheck(blendMode != SDL_BLENDMODE_INVALID, "Verify result from SDL_GetTextureBlendMode(), expected: !SDL_BLENDMODE_INVALID, got: 0x%" SDL_PRIx32, blendMode); SDLTest_AssertCheck(blendMode == SDL_BLENDMODE_BLEND, "Verify alpha texture blend mode, expected %d, got %" SDL_PRIu32, SDL_BLENDMODE_BLEND, blendMode); } diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index f3e266baebf64..6cc29c07e5a4e 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -54,8 +54,8 @@ static void surfaceSetUp(void *arg) /* Disable blend mode for target surface */ result = SDL_SetSurfaceBlendMode(testSurface, blendMode); SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result); - result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode); - SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result); + currentBlendMode = SDL_GetSurfaceBlendMode(testSurface); + SDLTest_AssertCheck(currentBlendMode != SDL_BLENDMODE_INVALID, "Validate result from SDL_GetSurfaceBlendMode, expected: !SDL_BLENDMODE_INVALID, got: 0x%" SDL_PRIx32, currentBlendMode); SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, blendMode, currentBlendMode); } } diff --git a/test/testshader.c b/test/testshader.c index aa299077abd38..d8bc7f441872d 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -332,7 +332,7 @@ SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord) } /* Save the alpha blending attributes */ - SDL_GetSurfaceBlendMode(surface, &saved_mode); + saved_mode = SDL_GetSurfaceBlendMode(surface); SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE); /* Copy the surface into the GL texture image */ From b92ec2514765f65c4ef40d69ca6be3440e02d713 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Wed, 17 Jul 2024 04:33:30 +0000 Subject: [PATCH 358/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_system.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 4c4a963ea6bf1..796cb97a774de 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -426,8 +426,8 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidInternalStoragePath(void); * * If external storage is currently unavailable, this will return 0. * - * \returns the current state of external storage, or 0 if - * external storage is currently unavailable. + * \returns the current state of external storage, or 0 if external storage is + * currently unavailable. * * \since This function is available since SDL 3.0.0. * From 8c25129458a79c8705b99ccc68d2d74d502bde42 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 16 Jul 2024 22:43:02 -0700 Subject: [PATCH 359/431] SDL_EVENT_WINDOW_LAST should be SDL_EVENT_WINDOW_HDR_STATE_CHANGED Fixes https://github.com/libsdl-org/SDL/issues/10299 --- include/SDL3/SDL_events.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 3ad5118c4c76c..97f6a553b6db8 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -153,7 +153,7 @@ typedef enum SDL_EventType SDL_EVENT_WINDOW_PEN_LEAVE, /**< Window has lost focus of the pressure-sensitive pen with ID "data1" */ SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /**< Window HDR properties have changed */ SDL_EVENT_WINDOW_FIRST = SDL_EVENT_WINDOW_SHOWN, - SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_PEN_LEAVE, + SDL_EVENT_WINDOW_LAST = SDL_EVENT_WINDOW_HDR_STATE_CHANGED, /* Keyboard events */ SDL_EVENT_KEY_DOWN = 0x300, /**< Key pressed */ From 2eda7b2c248ff65e7a238ffbcbbe9a9e04119c69 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Wed, 17 Jul 2024 12:30:32 +0300 Subject: [PATCH 360/431] SDL_sysvideo.h: remove SDL_DisplayModeData typedef: Fixes a type redefinition error: In file included from /tmp/SDL3/test/../src/events/SDL_events_c.h:28, from /tmp/SDL3/test/../src/events/SDL_pen.c:26, from /tmp/SDL3/test/testautomation_pen.c:83: /tmp/SDL3/test/../src/events/../video/SDL_sysvideo.h:34: error: redefinition of typedef 'SDL_DisplayModeData' /tmp/SDL3/include/SDL3/SDL_video.h:78: note: previous declaration of 'SDL_DisplayModeData' was here --- src/video/SDL_sysvideo.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 30a69e45a0114..ec2eaba606df3 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -31,7 +31,6 @@ typedef struct SDL_VideoDisplay SDL_VideoDisplay; typedef struct SDL_VideoDevice SDL_VideoDevice; typedef struct SDL_VideoData SDL_VideoData; typedef struct SDL_DisplayData SDL_DisplayData; -typedef struct SDL_DisplayModeData SDL_DisplayModeData; typedef struct SDL_WindowData SDL_WindowData; typedef struct From b3df46e4bc7efd4745f1df8d9267bb0d7eb701a3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 09:09:42 -0700 Subject: [PATCH 361/431] Added missing SDL_sysfilesystem.h includes --- src/filesystem/android/SDL_sysfilesystem.c | 2 ++ src/filesystem/cocoa/SDL_sysfilesystem.m | 2 ++ src/filesystem/dummy/SDL_sysfilesystem.c | 2 ++ src/filesystem/dummy/SDL_sysfsops.c | 3 +++ src/filesystem/emscripten/SDL_sysfilesystem.c | 3 +++ src/filesystem/gdk/SDL_sysfilesystem.cpp | 3 ++- src/filesystem/n3ds/SDL_sysfilesystem.c | 2 ++ src/filesystem/posix/SDL_sysfsops.c | 7 +++++-- src/filesystem/ps2/SDL_sysfilesystem.c | 8 +++++--- src/filesystem/psp/SDL_sysfilesystem.c | 8 +++++--- src/filesystem/riscos/SDL_sysfilesystem.c | 2 ++ src/filesystem/unix/SDL_sysfilesystem.c | 2 ++ src/filesystem/vita/SDL_sysfilesystem.c | 2 ++ src/filesystem/windows/SDL_sysfilesystem.c | 2 ++ src/filesystem/windows/SDL_sysfsops.c | 3 +++ src/filesystem/winrt/SDL_sysfilesystem.cpp | 3 +++ 16 files changed, 45 insertions(+), 9 deletions(-) diff --git a/src/filesystem/android/SDL_sysfilesystem.c b/src/filesystem/android/SDL_sysfilesystem.c index d1189379b23a0..350ee06278a92 100644 --- a/src/filesystem/android/SDL_sysfilesystem.c +++ b/src/filesystem/android/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include char *SDL_SYS_GetBasePath(void) diff --git a/src/filesystem/cocoa/SDL_sysfilesystem.m b/src/filesystem/cocoa/SDL_sysfilesystem.m index 56542f66276a8..e01c52c023157 100644 --- a/src/filesystem/cocoa/SDL_sysfilesystem.m +++ b/src/filesystem/cocoa/SDL_sysfilesystem.m @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include #include #include diff --git a/src/filesystem/dummy/SDL_sysfilesystem.c b/src/filesystem/dummy/SDL_sysfilesystem.c index b870efd19062b..e7d32b3198cdb 100644 --- a/src/filesystem/dummy/SDL_sysfilesystem.c +++ b/src/filesystem/dummy/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + char *SDL_SYS_GetBasePath(void) { SDL_Unsupported(); diff --git a/src/filesystem/dummy/SDL_sysfsops.c b/src/filesystem/dummy/SDL_sysfsops.c index 63bd709a4bcad..cad93bdbf0bc2 100644 --- a/src/filesystem/dummy/SDL_sysfsops.c +++ b/src/filesystem/dummy/SDL_sysfsops.c @@ -23,6 +23,9 @@ #if defined(SDL_FSOPS_DUMMY) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* System dependent filesystem routines */ + #include "../SDL_sysfilesystem.h" int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_EnumerateDirectoryCallback cb, void *userdata) diff --git a/src/filesystem/emscripten/SDL_sysfilesystem.c b/src/filesystem/emscripten/SDL_sysfilesystem.c index 37e11c10d2bf5..4e4d03c996834 100644 --- a/src/filesystem/emscripten/SDL_sysfilesystem.c +++ b/src/filesystem/emscripten/SDL_sysfilesystem.c @@ -24,6 +24,9 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ + +#include "../SDL_sysfilesystem.h" + #include #include diff --git a/src/filesystem/gdk/SDL_sysfilesystem.cpp b/src/filesystem/gdk/SDL_sysfilesystem.cpp index 961901c72dffb..fe9f13e2af8a4 100644 --- a/src/filesystem/gdk/SDL_sysfilesystem.cpp +++ b/src/filesystem/gdk/SDL_sysfilesystem.cpp @@ -20,10 +20,11 @@ */ #include "SDL_internal.h" - /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include "../../core/windows/SDL_windows.h" #include #include diff --git a/src/filesystem/n3ds/SDL_sysfilesystem.c b/src/filesystem/n3ds/SDL_sysfilesystem.c index e6ba5454cda36..c8d3665d17e6a 100644 --- a/src/filesystem/n3ds/SDL_sysfilesystem.c +++ b/src/filesystem/n3ds/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include <3ds.h> #include #include diff --git a/src/filesystem/posix/SDL_sysfsops.c b/src/filesystem/posix/SDL_sysfsops.c index 857782eb6ec63..7f73b29bd0c8c 100644 --- a/src/filesystem/posix/SDL_sysfsops.c +++ b/src/filesystem/posix/SDL_sysfsops.c @@ -23,14 +23,17 @@ #if defined(SDL_FSOPS_POSIX) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* System dependent filesystem routines */ + +#include "../SDL_sysfilesystem.h" + #include #include #include #include #include -#include "../SDL_sysfilesystem.h" - int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_EnumerateDirectoryCallback cb, void *userdata) { int retval = 1; diff --git a/src/filesystem/ps2/SDL_sysfilesystem.c b/src/filesystem/ps2/SDL_sysfilesystem.c index 1f9f3eb435ee4..a1c7e46d0864a 100644 --- a/src/filesystem/ps2/SDL_sysfilesystem.c +++ b/src/filesystem/ps2/SDL_sysfilesystem.c @@ -20,14 +20,16 @@ */ #include "SDL_internal.h" -#include -#include - #ifdef SDL_FILESYSTEM_PS2 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + +#include +#include + char *SDL_SYS_GetBasePath(void) { char *retval = NULL; diff --git a/src/filesystem/psp/SDL_sysfilesystem.c b/src/filesystem/psp/SDL_sysfilesystem.c index 9019abbd59dac..37cc65e44b4af 100644 --- a/src/filesystem/psp/SDL_sysfilesystem.c +++ b/src/filesystem/psp/SDL_sysfilesystem.c @@ -20,14 +20,16 @@ */ #include "SDL_internal.h" -#include -#include - #ifdef SDL_FILESYSTEM_PSP /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + +#include +#include + char *SDL_SYS_GetBasePath(void) { char *retval = NULL; diff --git a/src/filesystem/riscos/SDL_sysfilesystem.c b/src/filesystem/riscos/SDL_sysfilesystem.c index 6c13ea55c7eda..ac5c3c0c70454 100644 --- a/src/filesystem/riscos/SDL_sysfilesystem.c +++ b/src/filesystem/riscos/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include #include #include diff --git a/src/filesystem/unix/SDL_sysfilesystem.c b/src/filesystem/unix/SDL_sysfilesystem.c index 5550b3201c90a..ab7d748cdc87c 100644 --- a/src/filesystem/unix/SDL_sysfilesystem.c +++ b/src/filesystem/unix/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include #include #include diff --git a/src/filesystem/vita/SDL_sysfilesystem.c b/src/filesystem/vita/SDL_sysfilesystem.c index 1bcde3a0006bc..fb6000d3d785b 100644 --- a/src/filesystem/vita/SDL_sysfilesystem.c +++ b/src/filesystem/vita/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include #include #include diff --git a/src/filesystem/windows/SDL_sysfilesystem.c b/src/filesystem/windows/SDL_sysfilesystem.c index 5d18bf56c2dd4..8c591a88fbc7d 100644 --- a/src/filesystem/windows/SDL_sysfilesystem.c +++ b/src/filesystem/windows/SDL_sysfilesystem.c @@ -25,6 +25,8 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* System dependent filesystem routines */ +#include "../SDL_sysfilesystem.h" + #include "../../core/windows/SDL_windows.h" #include #include diff --git a/src/filesystem/windows/SDL_sysfsops.c b/src/filesystem/windows/SDL_sysfsops.c index 04f8090fc4ec6..6fe9e19c2d2c8 100644 --- a/src/filesystem/windows/SDL_sysfsops.c +++ b/src/filesystem/windows/SDL_sysfsops.c @@ -23,6 +23,9 @@ #if defined(SDL_FSOPS_WINDOWS) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* System dependent filesystem routines */ + #include "../../core/windows/SDL_windows.h" #include "../SDL_sysfilesystem.h" diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index e63b55bc6dbe8..2bd7c5bb4490f 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -25,6 +25,9 @@ #ifdef SDL_PLATFORM_WINRT +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +/* System dependent filesystem routines */ + extern "C" { #include "../../core/windows/SDL_windows.h" #include "../SDL_sysfilesystem.h" From 5f5e91eab6d9d0695aa4788847b02f26d2b54868 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 09:40:25 -0700 Subject: [PATCH 362/431] Reverted 3d2e5a0b66eca4ade34f2a4fa81c8f4d8d33dac3 Applying these changes to external code doesn't actually improve anything, and within the context of the other Get* functions for renderers and surfaces, these stand out as outliers, so I'm going to back this change out. --- docs/README-migration.md | 4 --- include/SDL3/SDL_render.h | 24 ++++++++++----- include/SDL3/SDL_surface.h | 12 +++++--- src/dynapi/SDL_dynapi_procs.h | 12 ++++---- src/render/SDL_render.c | 45 +++++++++++++++++++---------- src/render/software/SDL_render_sw.c | 4 +-- src/render/software/SDL_rotate.c | 13 ++++++--- src/render/software/SDL_triangle.c | 2 +- src/video/SDL_surface.c | 42 ++++++++++++++++----------- test/testautomation_render.c | 5 ++-- test/testautomation_surface.c | 4 +-- test/testshader.c | 2 +- 12 files changed, 102 insertions(+), 67 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 693c3e96398a6..737c992f5054a 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1269,8 +1269,6 @@ Textures are created with SDL_SCALEMODE_LINEAR by default, and use SDL_BLENDMODE SDL_QueryTexture() has been removed. The properties of the texture can be queried using SDL_PROP_TEXTURE_FORMAT_NUMBER, SDL_PROP_TEXTURE_ACCESS_NUMBER, SDL_PROP_TEXTURE_WIDTH_NUMBER, and SDL_PROP_TEXTURE_HEIGHT_NUMBER. A function SDL_GetTextureSize() has been added to get the size of the texture as floating point values. -SDL_GetRenderDrawBlendMode(), SDL_GetTextureBlendMode(), and SDL_GetTextureScaleMode() have been changed to return the values directly instead of an int error code. - Mouse and touch events are no longer filtered to change their coordinates, instead you can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into the rendering viewport. @@ -1714,8 +1712,6 @@ SDL_SetSurfaceColorKey() takes an SDL_bool to enable and disable colorkey. RLE a SDL_SetSurfaceRLE() takes an SDL_bool to enable and disable RLE acceleration. -SDL_GetSurfaceBlendMode() and SDL_GetSurfaceColorKey() have been changed to return the values directly instead of an int error code. - The following functions have been renamed: * SDL_BlitScaled() => SDL_BlitSurfaceScaled() * SDL_ConvertSurfaceFormat() => SDL_ConvertSurface() diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 6bd99f4d93da7..6580f575bcff4 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -1006,13 +1006,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture *texture, SD * Get the blend mode used for texture copy operations. * * \param texture the texture to query. - * \returns the current SDL_BlendMode. + * \param blendMode a pointer filled in with the current SDL_BlendMode. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextureBlendMode */ -extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture); +extern SDL_DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode); /** * Set the scale mode used for texture scale operations. @@ -1036,13 +1038,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture *texture, SD * Get the scale mode used for texture scale operations. * * \param texture the texture to query. - * \returns the current scale mode. + * \param scaleMode a pointer filled in with the current scale mode. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetTextureScaleMode */ -extern SDL_DECLSPEC SDL_ScaleMode SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture); +extern SDL_DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode); /** * Update the given texture rectangle with new pixel data. @@ -1637,13 +1641,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderColorScale(SDL_Renderer *renderer, * Get the color scale used for render operations. * * \param renderer the rendering context. - * \returns the current color scale value. + * \param scale a pointer filled in with the current color scale value. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderColorScale */ -extern SDL_DECLSPEC float SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer); +extern SDL_DECLSPEC int SDLCALL SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale); /** * Set the blend mode used for drawing operations (Fill and Line). @@ -1665,13 +1671,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer *rendere * Get the blend mode used for drawing operations. * * \param renderer the rendering context. - * \returns the current SDL_BlendMode. + * \param blendMode a pointer filled in with the current SDL_BlendMode. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetRenderDrawBlendMode */ -extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer); +extern SDL_DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode); /** * Clear the current rendering target with the drawing color. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index e14de0f25eee2..6998b12991e48 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -511,14 +511,16 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface * If the surface doesn't have color key enabled this function returns -1. * * \param surface the SDL_Surface structure to query. - * \returns the transparent pixel. + * \param key a pointer filled in with the transparent pixel. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceColorKey * \sa SDL_SurfaceHasColorKey */ -extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface); +extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key); /** * Set an additional color value multiplied into blit operations. @@ -618,13 +620,15 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SD * Get the blend mode used for blit operations. * * \param surface the SDL_Surface structure to query. - * \returns the current SDL_BlendMode. + * \param blendMode a pointer filled in with the current SDL_BlendMode. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_SetSurfaceBlendMode */ -extern SDL_DECLSPEC SDL_BlendMode SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface); +extern SDL_DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode); /** * Set the clipping rectangle for a surface. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index e2cedea0744dc..fd778f69d438d 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -433,8 +433,8 @@ SDL_DYNAPI_PROC(int,SDL_GetRectUnionFloat,(const SDL_FRect *a, const SDL_FRect * SDL_DYNAPI_PROC(SDL_bool,SDL_GetRelativeMouseMode,(void),(),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetRelativeMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetRenderClipRect,(SDL_Renderer *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(float,SDL_GetRenderColorScale,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(SDL_BlendMode,SDL_GetRenderDrawBlendMode,(SDL_Renderer *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetRenderColorScale,(SDL_Renderer *a, float *b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_GetRenderDrawBlendMode,(SDL_Renderer *a, SDL_BlendMode *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetRenderDrawColor,(SDL_Renderer *a, Uint8 *b, Uint8 *c, Uint8 *d, Uint8 *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_GetRenderDrawColorFloat,(SDL_Renderer *a, float *b, float *c, float *d, float *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetRenderDriver,(int a),(a),return) @@ -475,9 +475,9 @@ SDL_DYNAPI_PROC(int,SDL_GetStoragePathInfo,(SDL_Storage *a, const char *b, SDL_P SDL_DYNAPI_PROC(Uint64,SDL_GetStorageSpaceRemaining,(SDL_Storage *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetStringProperty,(SDL_PropertiesID a, const char *b, const char *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceAlphaMod,(SDL_Surface *a, Uint8 *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_BlendMode,SDL_GetSurfaceBlendMode,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceClipRect,(SDL_Surface *a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(Uint32,SDL_GetSurfaceColorKey,(SDL_Surface *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorKey,(SDL_Surface *a, Uint32 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetSurfaceColorMod,(SDL_Surface *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_Colorspace,SDL_GetSurfaceColorspace,(SDL_Surface *a),(a),return) SDL_DYNAPI_PROC(SDL_Palette*,SDL_GetSurfacePalette,(SDL_Surface *a),(a),return) @@ -488,11 +488,11 @@ SDL_DYNAPI_PROC(void*,SDL_GetTLS,(SDL_TLSID *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetTextInputArea,(SDL_Window *a, SDL_Rect *b, int *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaMod,(SDL_Texture *a, Uint8 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureAlphaModFloat,(SDL_Texture *a, float *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_BlendMode,SDL_GetTextureBlendMode,(SDL_Texture *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetTextureBlendMode,(SDL_Texture *a, SDL_BlendMode *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureColorMod,(SDL_Texture *a, Uint8 *b, Uint8 *c, Uint8 *d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_GetTextureColorModFloat,(SDL_Texture *a, float *b, float *c, float *d),(a,b,c,d),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetTextureProperties,(SDL_Texture *a),(a),return) -SDL_DYNAPI_PROC(SDL_ScaleMode,SDL_GetTextureScaleMode,(SDL_Texture *a),(a),return) +SDL_DYNAPI_PROC(int,SDL_GetTextureScaleMode,(SDL_Texture *a, SDL_ScaleMode *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetTextureSize,(SDL_Texture *a, float *b, float *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_ThreadID,SDL_GetThreadID,(SDL_Thread *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetThreadName,(SDL_Thread *a),(a),return) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 6fb1a0ebf98ec..0866bfcbe96e2 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1641,6 +1641,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s { Uint8 r, g, b, a; + SDL_BlendMode blendMode; SDL_GetSurfaceColorMod(surface, &r, &g, &b); SDL_SetTextureColorMod(texture, r, g, b); @@ -1652,7 +1653,8 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s /* We converted to a texture with alpha format */ SDL_SetTextureBlendMode(texture, SDL_BLENDMODE_BLEND); } else { - SDL_SetTextureBlendMode(texture, SDL_GetSurfaceBlendMode(surface)); + SDL_GetSurfaceBlendMode(surface, &blendMode); + SDL_SetTextureBlendMode(texture, blendMode); } } return texture; @@ -1812,11 +1814,14 @@ int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) return 0; } -SDL_BlendMode SDL_GetTextureBlendMode(SDL_Texture *texture) +int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) { - CHECK_TEXTURE_MAGIC(texture, SDL_BLENDMODE_INVALID); + CHECK_TEXTURE_MAGIC(texture, -1); - return texture->blendMode; + if (blendMode) { + *blendMode = texture->blendMode; + } + return 0; } int SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) @@ -1835,11 +1840,14 @@ int SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) return 0; } -SDL_ScaleMode SDL_GetTextureScaleMode(SDL_Texture *texture) +int SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode) { - CHECK_TEXTURE_MAGIC(texture, SDL_SCALEMODE_LINEAR); + CHECK_TEXTURE_MAGIC(texture, -1); - return texture->scaleMode; + if (scaleMode) { + *scaleMode = texture->scaleMode; + } + return 0; } #if SDL_HAVE_YUV @@ -3065,11 +3073,14 @@ int SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) return 0; } -float SDL_GetRenderColorScale(SDL_Renderer *renderer) +int SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) { - CHECK_RENDERER_MAGIC(renderer, 1.0f); + CHECK_RENDERER_MAGIC(renderer, -1); - return renderer->color_scale / renderer->SDR_white_point; + if (scale) { + *scale = renderer->color_scale / renderer->SDR_white_point; + } + return 0; } int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) @@ -3087,18 +3098,20 @@ int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) return 0; } -SDL_BlendMode SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer) +int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) { - CHECK_RENDERER_MAGIC(renderer, SDL_BLENDMODE_INVALID); + CHECK_RENDERER_MAGIC(renderer, -1); - return renderer->blendMode; + *blendMode = renderer->blendMode; + return 0; } int SDL_RenderClear(SDL_Renderer *renderer) { + int retval; CHECK_RENDERER_MAGIC(renderer, -1); - - return QueueCmdClear(renderer); + retval = QueueCmdClear(renderer); + return retval; } int SDL_RenderPoint(SDL_Renderer *renderer, float x, float y) @@ -3965,7 +3978,7 @@ static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, float r = 0, g = 0, b = 0, a = 0; /* Save */ - blendMode = SDL_GetRenderDrawBlendMode(renderer); + SDL_GetRenderDrawBlendMode(renderer, &blendMode); SDL_GetRenderDrawColorFloat(renderer, &r, &g, &b, &a); if (texture) { diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 4df9ea7ef3773..4e462e75dbd0f 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -355,7 +355,7 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex return -1; } - blendmode = SDL_GetSurfaceBlendMode(src); + SDL_GetSurfaceBlendMode(src, &blendmode); SDL_GetSurfaceAlphaMod(src, &alphaMod); SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod); @@ -841,7 +841,7 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo SDL_BlendMode blendmode; Uint8 alphaMod, rMod, gMod, bMod; - blendmode = SDL_GetSurfaceBlendMode(src); + SDL_GetSurfaceBlendMode(src, &blendmode); SDL_GetSurfaceAlphaMod(src, &alphaMod); SDL_GetSurfaceColorMod(src, &rMod, &gMod, &bMod); diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index 30ff1e95bc642..02382a8e6ffe2 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -78,7 +78,11 @@ Returns colorkey info for a surface */ static Uint32 get_colorkey(SDL_Surface *src) { - return SDL_GetSurfaceColorKey(src); + Uint32 key = 0; + if (SDL_SurfaceHasColorKey(src)) { + SDL_GetSurfaceColorKey(src, &key); + } + return key; } /* rotate (sx, sy) by (angle, center) into (dx, dy) */ @@ -497,8 +501,9 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in } if (SDL_SurfaceHasColorKey(src)) { - colorkey = SDL_GetSurfaceColorKey(src); - colorKeyAvailable = SDL_TRUE; + if (SDL_GetSurfaceColorKey(src, &colorkey) == 0) { + colorKeyAvailable = SDL_TRUE; + } } /* This function requires a 32-bit surface or 8-bit surface with a colorkey */ is8bit = src->internal->format->bits_per_pixel == 8 && colorKeyAvailable; @@ -531,7 +536,7 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in /* Adjust for guard rows */ rz_dst->h = rect_dest->h; - blendmode = SDL_GetSurfaceBlendMode(src); + SDL_GetSurfaceBlendMode(src, &blendmode); if (colorKeyAvailable == SDL_TRUE) { /* If available, the colorkey will be used to discard the pixels that are outside of the rotated area. */ diff --git a/src/render/software/SDL_triangle.c b/src/render/software/SDL_triangle.c index 048859f54a49e..fd4350d061e50 100644 --- a/src/render/software/SDL_triangle.c +++ b/src/render/software/SDL_triangle.c @@ -524,7 +524,7 @@ int SDL_SW_BlitTriangle( bounding_rect_fixedpoint(d0, d1, d2, &dstrect); - blend = SDL_GetSurfaceBlendMode(src); + SDL_GetSurfaceBlendMode(src, &blend); /* TRIANGLE_GET_TEXTCOORD interpolates up to the max values included, so reduce by 1 */ { diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index d973aca691229..5cca66d744038 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -515,13 +515,20 @@ SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) return SDL_TRUE; } -Uint32 SDL_GetSurfaceColorKey(SDL_Surface *surface) +int SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key) { if (!SDL_SurfaceValid(surface)) { - return 0; + return SDL_InvalidParamError("surface"); } - return surface->internal->map.info.colorkey; + if (!(surface->internal->map.info.flags & SDL_COPY_COLORKEY)) { + return SDL_SetError("Surface doesn't have a colorkey"); + } + + if (key) { + *key = surface->internal->map.info.colorkey; + } + return 0; } /* This is a fairly slow function to switch from colorkey to alpha @@ -739,39 +746,40 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) return status; } -SDL_BlendMode SDL_GetSurfaceBlendMode(SDL_Surface *surface) +int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) { - SDL_BlendMode blendMode; - if (!SDL_SurfaceValid(surface)) { - SDL_InvalidParamError("surface"); - return SDL_BLENDMODE_INVALID; + return SDL_InvalidParamError("surface"); + } + + if (!blendMode) { + return 0; } switch (surface->internal->map.info.flags & (SDL_COPY_BLEND | SDL_COPY_BLEND_PREMULTIPLIED | SDL_COPY_ADD | SDL_COPY_ADD_PREMULTIPLIED | SDL_COPY_MOD | SDL_COPY_MUL)) { case SDL_COPY_BLEND: - blendMode = SDL_BLENDMODE_BLEND; + *blendMode = SDL_BLENDMODE_BLEND; break; case SDL_COPY_BLEND_PREMULTIPLIED: - blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; + *blendMode = SDL_BLENDMODE_BLEND_PREMULTIPLIED; break; case SDL_COPY_ADD: - blendMode = SDL_BLENDMODE_ADD; + *blendMode = SDL_BLENDMODE_ADD; break; case SDL_COPY_ADD_PREMULTIPLIED: - blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; + *blendMode = SDL_BLENDMODE_ADD_PREMULTIPLIED; break; case SDL_COPY_MOD: - blendMode = SDL_BLENDMODE_MOD; + *blendMode = SDL_BLENDMODE_MOD; break; case SDL_COPY_MUL: - blendMode = SDL_BLENDMODE_MUL; + *blendMode = SDL_BLENDMODE_MUL; break; default: - blendMode = SDL_BLENDMODE_NONE; + *blendMode = SDL_BLENDMODE_NONE; break; } - return blendMode; + return 0; } SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) @@ -1147,7 +1155,7 @@ int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, /* Save source infos */ SDL_GetSurfaceColorMod(src, &r, &g, &b); SDL_GetSurfaceAlphaMod(src, &alpha); - blendMode = SDL_GetSurfaceBlendMode(src); + SDL_GetSurfaceBlendMode(src, &blendMode); srcrect2.x = srcrect->x; srcrect2.y = srcrect->y; srcrect2.w = srcrect->w; diff --git a/test/testautomation_render.c b/test/testautomation_render.c index c9057d3b3c2c3..aebdb32a0f95b 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -402,8 +402,9 @@ static void testBlendModeOperation(TestRenderOperation op, int mode, SDL_PixelFo return; } if (SDL_ISPIXELFORMAT_ALPHA(dst_format)) { - SDL_BlendMode blendMode = SDL_GetTextureBlendMode(dst); - SDLTest_AssertCheck(blendMode != SDL_BLENDMODE_INVALID, "Verify result from SDL_GetTextureBlendMode(), expected: !SDL_BLENDMODE_INVALID, got: 0x%" SDL_PRIx32, blendMode); + SDL_BlendMode blendMode = SDL_BLENDMODE_NONE; + ret = SDL_GetTextureBlendMode(dst, &blendMode); + SDLTest_AssertCheck(ret == 0, "Verify result from SDL_GetTextureBlendMode(), expected: 0, got: %i", ret); SDLTest_AssertCheck(blendMode == SDL_BLENDMODE_BLEND, "Verify alpha texture blend mode, expected %d, got %" SDL_PRIu32, SDL_BLENDMODE_BLEND, blendMode); } diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index 6cc29c07e5a4e..f3e266baebf64 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -54,8 +54,8 @@ static void surfaceSetUp(void *arg) /* Disable blend mode for target surface */ result = SDL_SetSurfaceBlendMode(testSurface, blendMode); SDLTest_AssertCheck(result == 0, "Validate result from SDL_SetSurfaceBlendMode, expected: 0, got: %i", result); - currentBlendMode = SDL_GetSurfaceBlendMode(testSurface); - SDLTest_AssertCheck(currentBlendMode != SDL_BLENDMODE_INVALID, "Validate result from SDL_GetSurfaceBlendMode, expected: !SDL_BLENDMODE_INVALID, got: 0x%" SDL_PRIx32, currentBlendMode); + result = SDL_GetSurfaceBlendMode(testSurface, ¤tBlendMode); + SDLTest_AssertCheck(result == 0, "Validate result from SDL_GetSurfaceBlendMode, expected: 0, got: %i", result); SDLTest_AssertCheck(currentBlendMode == blendMode, "Validate blendMode, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32, blendMode, currentBlendMode); } } diff --git a/test/testshader.c b/test/testshader.c index d8bc7f441872d..aa299077abd38 100644 --- a/test/testshader.c +++ b/test/testshader.c @@ -332,7 +332,7 @@ SDL_GL_LoadTexture(SDL_Surface *surface, GLfloat *texcoord) } /* Save the alpha blending attributes */ - saved_mode = SDL_GetSurfaceBlendMode(surface); + SDL_GetSurfaceBlendMode(surface, &saved_mode); SDL_SetSurfaceBlendMode(surface, SDL_BLENDMODE_NONE); /* Copy the surface into the GL texture image */ From 761e86e25e0dcfbdffa19e46be4991d78287a062 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 10:10:31 -0700 Subject: [PATCH 363/431] Initialize output parameters to reasonable defaults in case of error --- src/render/SDL_render.c | 126 +++++++++++++++++++++++++++++++++++++--- src/video/SDL_surface.c | 23 ++++++++ 2 files changed, 142 insertions(+), 7 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 0866bfcbe96e2..ed6d6ad0aee2e 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -1211,6 +1211,13 @@ SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer *renderer) int SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) { + if (w) { + *w = 0; + } + if (h) { + *h = 0; + } + CHECK_RENDERER_MAGIC(renderer, -1); if (renderer->GetOutputSize) { @@ -1225,6 +1232,13 @@ int SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) int SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h) { + if (w) { + *w = 0; + } + if (h) { + *h = 0; + } + CHECK_RENDERER_MAGIC(renderer, -1); if (w) { @@ -1663,6 +1677,7 @@ SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *s SDL_Renderer *SDL_GetRendererFromTexture(SDL_Texture *texture) { CHECK_TEXTURE_MAGIC(texture, NULL); + return texture->renderer; } @@ -1678,6 +1693,13 @@ SDL_PropertiesID SDL_GetTextureProperties(SDL_Texture *texture) int SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h) { + if (w) { + *w = 0; + } + if (h) { + *h = 0; + } + CHECK_TEXTURE_MAGIC(texture, -1); if (w) { @@ -1713,9 +1735,18 @@ int SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b) int SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b) { - float fR, fG, fB; + float fR = 1.0f, fG = 1.0f, fB = 1.0f; if (SDL_GetTextureColorModFloat(texture, &fR, &fG, &fB) < 0) { + if (r) { + *r = 255; + } + if (g) { + *g = 255; + } + if (b) { + *b = 255; + } return -1; } @@ -1735,6 +1766,16 @@ int SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float { SDL_FColor color; + if (r) { + *r = 1.0f; + } + if (g) { + *g = 1.0f; + } + if (b) { + *b = 1.0f; + } + CHECK_TEXTURE_MAGIC(texture, -1); color = texture->color; @@ -1774,6 +1815,9 @@ int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) float fA = 1.0f; if (SDL_GetTextureAlphaModFloat(texture, &fA) < 0) { + if (alpha) { + *alpha = 255; + } return -1; } @@ -1785,6 +1829,10 @@ int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha) int SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha) { + if (alpha) { + *alpha = 1.0f; + } + CHECK_TEXTURE_MAGIC(texture, -1); if (alpha) { @@ -1816,6 +1864,10 @@ int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode) int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode) { + if (blendMode) { + *blendMode = SDL_BLENDMODE_INVALID; + } + CHECK_TEXTURE_MAGIC(texture, -1); if (blendMode) { @@ -1842,6 +1894,10 @@ int SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode) int SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode) { + if (scaleMode) { + *scaleMode = SDL_SCALEMODE_LINEAR; + } + CHECK_TEXTURE_MAGIC(texture, -1); if (scaleMode) { @@ -2885,6 +2941,10 @@ int SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect) int SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect) { + if (rect) { + SDL_zerop(rect); + } + CHECK_RENDERER_MAGIC(renderer, -1); if (rect) { @@ -2949,6 +3009,10 @@ int SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect) int SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect) { + if (rect) { + SDL_zerop(rect); + } + CHECK_RENDERER_MAGIC(renderer, -1) if (rect) { @@ -2987,6 +3051,13 @@ int SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY) int SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY) { + if (scaleX) { + *scaleX = 1.0f; + } + if (scaleY) { + *scaleY = 1.0f; + } + CHECK_RENDERER_MAGIC(renderer, -1); if (scaleX) { @@ -3024,6 +3095,18 @@ int SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, float fR, fG, fB, fA; if (SDL_GetRenderDrawColorFloat(renderer, &fR, &fG, &fB, &fA) < 0) { + if (r) { + *r = 0; + } + if (g) { + *g = 0; + } + if (b) { + *b = 0; + } + if (a) { + *a = 0; + } return -1; } @@ -3046,6 +3129,19 @@ int SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, floa { SDL_FColor color; + if (r) { + *r = 0.0f; + } + if (g) { + *g = 0.0f; + } + if (b) { + *b = 0.0f; + } + if (a) { + *a = 0.0f; + } + CHECK_RENDERER_MAGIC(renderer, -1); color = renderer->color; @@ -3075,6 +3171,10 @@ int SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale) int SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale) { + if (scale) { + *scale = 1.0f; + } + CHECK_RENDERER_MAGIC(renderer, -1); if (scale) { @@ -3091,15 +3191,24 @@ int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode) return SDL_InvalidParamError("blendMode"); } + if (blendMode == SDL_BLENDMODE_INVALID) { + return SDL_InvalidParamError("blendMode"); + } + if (!IsSupportedBlendMode(renderer, blendMode)) { return SDL_Unsupported(); } + renderer->blendMode = blendMode; return 0; } int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) { + if (blendMode) { + *blendMode = SDL_BLENDMODE_INVALID; + } + CHECK_RENDERER_MAGIC(renderer, -1); *blendMode = renderer->blendMode; @@ -3108,10 +3217,9 @@ int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode) int SDL_RenderClear(SDL_Renderer *renderer) { - int retval; CHECK_RENDERER_MAGIC(renderer, -1); - retval = QueueCmdClear(renderer); - return retval; + + return QueueCmdClear(renderer); } int SDL_RenderPoint(SDL_Renderer *renderer, float x, float y) @@ -4838,10 +4946,14 @@ int SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync) int SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync) { + if (vsync) { + *vsync = 0; + } + CHECK_RENDERER_MAGIC(renderer, -1); - if (!vsync) { - return SDL_InvalidParamError("vsync"); + + if (vsync) { + *vsync = (int)SDL_GetNumberProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_VSYNC_NUMBER, 0); } - *vsync = (int)SDL_GetNumberProperty(SDL_GetRendererProperties(renderer), SDL_PROP_RENDERER_VSYNC_NUMBER, 0); return 0; } diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 5cca66d744038..2c38eacd24cc7 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -517,6 +517,10 @@ SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface) int SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key) { + if (key) { + *key = 0; + } + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } @@ -649,6 +653,15 @@ int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b) { if (!SDL_SurfaceValid(surface)) { + if (r) { + *r = 255; + } + if (g) { + *g = 255; + } + if (b) { + *b = 255; + } return SDL_InvalidParamError("surface"); } @@ -689,6 +702,9 @@ int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha) int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha) { if (!SDL_SurfaceValid(surface)) { + if (alpha) { + *alpha = 255; + } return SDL_InvalidParamError("surface"); } @@ -748,6 +764,10 @@ int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode) int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode) { + if (blendMode) { + *blendMode = SDL_BLENDMODE_INVALID; + } + if (!SDL_SurfaceValid(surface)) { return SDL_InvalidParamError("surface"); } @@ -808,6 +828,9 @@ SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect) int SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect) { if (!SDL_SurfaceValid(surface)) { + if (rect) { + SDL_zerop(rect); + } return SDL_InvalidParamError("surface"); } if (!rect) { From 94c40fb3c919e3b809612e4db21fbda608b940c3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 11:00:25 -0700 Subject: [PATCH 364/431] Fixed warning: no previous prototype for function 'SDL_InitFilesystem' --- src/filesystem/SDL_filesystem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index bc3222a64ee8d..03b1955ed101a 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -20,6 +20,8 @@ */ #include "SDL_internal.h" + +#include "SDL_filesystem_c.h" #include "SDL_sysfilesystem.h" #include "../stdlib/SDL_sysstdlib.h" From 5db08b86ca20e599556b24bb447ccfb86f227575 Mon Sep 17 00:00:00 2001 From: Amir Date: Wed, 17 Jul 2024 22:09:32 +0400 Subject: [PATCH 365/431] Fix warning for Android NDK compiler: "function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]" https://stackoverflow.com/questions/42125/warning-error-function-declaration-isnt-a-prototype In C int foo() and int foo(void) are different functions. int foo() accepts an arbitrary number of arguments, while int foo(void) accepts 0 arguments. In C++ they mean the same thing. --- src/audio/SDL_audioresample.c | 2 +- src/audio/pipewire/SDL_pipewire.c | 2 +- src/core/SDL_core_unsupported.c | 18 ++++++------- src/core/android/SDL_android.c | 16 ++++++------ src/core/freebsd/SDL_evdev_kbd_freebsd.c | 2 +- src/core/openbsd/SDL_wscons_kbd.c | 6 ++--- src/core/openbsd/SDL_wscons_mouse.c | 2 +- src/core/unix/SDL_appid.c | 4 +-- src/hidapi/libusb/hid.c | 6 ++--- src/hidapi/windows/hid.c | 6 ++--- src/joystick/ps2/SDL_sysjoystick.c | 4 +-- src/joystick/vita/SDL_sysjoystick.c | 4 +-- src/joystick/windows/SDL_rawinputjoystick.c | 12 ++++----- .../windows/SDL_windows_gaming_input.c | 4 +-- src/main/SDL_main_callbacks.c | 4 +-- src/main/ps2/SDL_sysmain_runapp.c | 8 +++--- src/render/SDL_d3dmath.c | 2 +- src/render/direct3d11/SDL_render_d3d11.c | 2 +- src/render/direct3d12/SDL_render_d3d12.c | 2 +- src/render/ps2/SDL_render_ps2.c | 2 +- src/render/vulkan/SDL_render_vulkan.c | 2 +- src/stdlib/SDL_mslibc.c | 26 +++++++++---------- src/test/SDL_test_memory.c | 2 +- src/timer/windows/SDL_systimer.c | 2 +- src/video/SDL_video.c | 2 +- src/video/android/SDL_androidmouse.c | 6 ++--- src/video/emscripten/SDL_emscriptenmouse.c | 6 ++--- src/video/n3ds/SDL_n3dsswkb.c | 6 ++--- src/video/psp/SDL_pspvideo.c | 2 +- src/video/qnx/SDL_qnxvideo.c | 2 +- src/video/raspberry/SDL_rpivideo.c | 2 +- src/video/riscos/SDL_riscosmouse.c | 2 +- src/video/vita/SDL_vitavideo.c | 2 +- src/video/vivante/SDL_vivantevideo.c | 2 +- src/video/wayland/SDL_waylandmouse.c | 2 +- src/video/wayland/SDL_waylandwindow.c | 2 +- src/video/windows/SDL_windowsevents.c | 8 +++--- src/video/windows/SDL_windowskeyboard.c | 2 +- src/video/windows/SDL_windowsmouse.c | 6 ++--- src/video/windows/SDL_windowswindow.c | 2 +- src/video/x11/SDL_x11xfixes.c | 2 +- test/testaudiostreamdynamicresample.c | 2 +- test/testautomation_log.c | 2 +- test/testgles.c | 2 +- 44 files changed, 101 insertions(+), 101 deletions(-) diff --git a/src/audio/SDL_audioresample.c b/src/audio/SDL_audioresample.c index 90d357210f946..968ccd2e874a1 100644 --- a/src/audio/SDL_audioresample.c +++ b/src/audio/SDL_audioresample.c @@ -453,7 +453,7 @@ static float Sinc(float *table, int x, int y) static Cubic ResamplerFilter[RESAMPLER_SAMPLES_PER_ZERO_CROSSING][RESAMPLER_SAMPLES_PER_FRAME]; -static void GenerateResamplerFilter() +static void GenerateResamplerFilter(void) { enum { diff --git a/src/audio/pipewire/SDL_pipewire.c b/src/audio/pipewire/SDL_pipewire.c index 8fa2363cb9a52..272417aed060e 100644 --- a/src/audio/pipewire/SDL_pipewire.c +++ b/src/audio/pipewire/SDL_pipewire.c @@ -179,7 +179,7 @@ static int load_pipewire_syms(void) return 0; } -static int init_pipewire_library() +static int init_pipewire_library(void) { if (!load_pipewire_library()) { if (!load_pipewire_syms()) { diff --git a/src/core/SDL_core_unsupported.c b/src/core/SDL_core_unsupported.c index da1c143270028..d6f324d507b7f 100644 --- a/src/core/SDL_core_unsupported.c +++ b/src/core/SDL_core_unsupported.c @@ -97,7 +97,7 @@ void SDL_UnregisterApp(void) /* Returns SDL_WinRT_DeviceFamily enum */ SDL_DECLSPEC int SDLCALL SDL_GetWinRTDeviceFamily(void); -int SDL_GetWinRTDeviceFamily() +int SDL_GetWinRTDeviceFamily(void) { SDL_Unsupported(); return 0; /* SDL_WINRT_DEVICEFAMILY_UNKNOWN */ @@ -115,20 +115,20 @@ const char *SDL_GetWinRTFSPath(int pathType) #ifndef SDL_PLATFORM_ANDROID SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); -void SDL_SendAndroidBackButton() +void SDL_SendAndroidBackButton(void) { SDL_Unsupported(); } SDL_DECLSPEC void *SDLCALL SDL_GetAndroidActivity(void); -void *SDL_GetAndroidActivity() +void *SDL_GetAndroidActivity(void) { SDL_Unsupported(); return NULL; } SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidCachePath(void); -const char* SDL_GetAndroidCachePath() +const char* SDL_GetAndroidCachePath(void) { SDL_Unsupported(); return NULL; @@ -136,7 +136,7 @@ const char* SDL_GetAndroidCachePath() SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidExternalStoragePath(void); -const char* SDL_GetAndroidExternalStoragePath() +const char* SDL_GetAndroidExternalStoragePath(void) { SDL_Unsupported(); return NULL; @@ -156,7 +156,7 @@ const char *SDL_GetAndroidInternalStoragePath(void) } SDL_DECLSPEC void *SDLCALL SDL_GetAndroidJNIEnv(void); -void *SDL_GetAndroidJNIEnv() +void *SDL_GetAndroidJNIEnv(void) { SDL_Unsupported(); return NULL; @@ -192,20 +192,20 @@ int SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xof } SDL_DECLSPEC int SDLCALL SDL_GetAndroidSDKVersion(void); -int SDL_GetAndroidSDKVersion() +int SDL_GetAndroidSDKVersion(void) { return SDL_Unsupported(); } SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void); -SDL_bool SDL_IsAndroidTV() +SDL_bool SDL_IsAndroidTV(void) { SDL_Unsupported(); return SDL_FALSE; } SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void); -SDL_bool SDL_IsChromebook() +SDL_bool SDL_IsChromebook(void) { SDL_Unsupported(); return SDL_FALSE; diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index 3d1e46b68629c..b97c8c4a962ef 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -898,18 +898,18 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeDropFile)( } /* Lock / Unlock Mutex */ -void Android_ActivityMutex_Lock() +void Android_ActivityMutex_Lock(void) { SDL_LockMutex(Android_ActivityMutex); } -void Android_ActivityMutex_Unlock() +void Android_ActivityMutex_Unlock(void) { SDL_UnlockMutex(Android_ActivityMutex); } /* Lock the Mutex when the Activity is in its 'Running' state */ -void Android_ActivityMutex_Lock_Running() +void Android_ActivityMutex_Lock_Running(void) { int pauseSignaled = 0; int resumeSignaled = 0; @@ -1561,13 +1561,13 @@ void Android_JNI_SetOrientation(int w, int h, int resizable, const char *hint) (*env)->DeleteLocalRef(env, jhint); } -void Android_JNI_MinizeWindow() +void Android_JNI_MinizeWindow(void) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midMinimizeWindow); } -SDL_bool Android_JNI_ShouldMinimizeOnFocusLoss() +SDL_bool Android_JNI_ShouldMinimizeOnFocusLoss(void) { JNIEnv *env = Android_JNI_GetEnv(); return (*env)->CallStaticBooleanMethod(env, mActivityClass, midShouldMinimizeOnFocusLoss); @@ -1947,7 +1947,7 @@ static SDL_bool Android_JNI_ExceptionOccurred(SDL_bool silent) return SDL_FALSE; } -static void Internal_Android_Create_AssetManager() +static void Internal_Android_Create_AssetManager(void) { struct LocalReferenceHolder refs = LocalReferenceHolder_Setup(__FUNCTION__); @@ -1986,7 +1986,7 @@ static void Internal_Android_Create_AssetManager() LocalReferenceHolder_Cleanup(&refs); } -static void Internal_Android_Destroy_AssetManager() +static void Internal_Android_Destroy_AssetManager(void) { JNIEnv *env = Android_JNI_GetEnv(); @@ -2206,7 +2206,7 @@ int Android_JNI_GetPowerInfo(int *plugged, int *charged, int *battery, int *seco } /* Add all touch devices */ -void Android_JNI_InitTouch() +void Android_JNI_InitTouch(void) { JNIEnv *env = Android_JNI_GetEnv(); (*env)->CallStaticVoidMethod(env, mActivityClass, midInitTouch); diff --git a/src/core/freebsd/SDL_evdev_kbd_freebsd.c b/src/core/freebsd/SDL_evdev_kbd_freebsd.c index 22d02bf5452e7..10ee85dcabcd5 100644 --- a/src/core/freebsd/SDL_evdev_kbd_freebsd.c +++ b/src/core/freebsd/SDL_evdev_kbd_freebsd.c @@ -133,7 +133,7 @@ static void kbd_cleanup_signal_action(int signum, siginfo_t *info, void *ucontex SDL_EVDEV_kbd_reraise_signal(signum); } -static void kbd_unregister_emerg_cleanup() +static void kbd_unregister_emerg_cleanup(void) { int tabidx; diff --git a/src/core/openbsd/SDL_wscons_kbd.c b/src/core/openbsd/SDL_wscons_kbd.c index b00e25ec8c4d1..d1bc42bd6853c 100644 --- a/src/core/openbsd/SDL_wscons_kbd.c +++ b/src/core/openbsd/SDL_wscons_kbd.c @@ -452,7 +452,7 @@ static SDL_WSCONS_input_data *SDL_WSCONS_Init_Keyboard(const char *dev) return input; } -void SDL_WSCONS_Init() +void SDL_WSCONS_Init(void) { inputs[0] = SDL_WSCONS_Init_Keyboard("/dev/wskbd0"); inputs[1] = SDL_WSCONS_Init_Keyboard("/dev/wskbd1"); @@ -463,7 +463,7 @@ void SDL_WSCONS_Init() return; } -void SDL_WSCONS_Quit() +void SDL_WSCONS_Quit(void) { int i = 0; SDL_WSCONS_input_data *input = NULL; @@ -924,7 +924,7 @@ static void updateKeyboard(SDL_WSCONS_input_data *input) } } -void SDL_WSCONS_PumpEvents() +void SDL_WSCONS_PumpEvents(void) { int i = 0; for (i = 0; i < 4; i++) { diff --git a/src/core/openbsd/SDL_wscons_mouse.c b/src/core/openbsd/SDL_wscons_mouse.c index 6b0c96261d4c7..13864be9352a7 100644 --- a/src/core/openbsd/SDL_wscons_mouse.c +++ b/src/core/openbsd/SDL_wscons_mouse.c @@ -35,7 +35,7 @@ typedef struct SDL_WSCONS_mouse_input_data SDL_MouseID mouseID; } SDL_WSCONS_mouse_input_data; -SDL_WSCONS_mouse_input_data *SDL_WSCONS_Init_Mouse() +SDL_WSCONS_mouse_input_data *SDL_WSCONS_Init_Mouse(void) { #ifdef WSMOUSEIO_SETVERSION int version = WSMOUSE_EVENT_VERSION; diff --git a/src/core/unix/SDL_appid.c b/src/core/unix/SDL_appid.c index 67a44330dca4e..eb4bb4b139954 100644 --- a/src/core/unix/SDL_appid.c +++ b/src/core/unix/SDL_appid.c @@ -24,7 +24,7 @@ #include "SDL_appid.h" #include -const char *SDL_GetExeName() +const char *SDL_GetExeName(void) { static const char *proc_name = NULL; @@ -57,7 +57,7 @@ const char *SDL_GetExeName() return proc_name; } -const char *SDL_GetAppID() +const char *SDL_GetAppID(void) { /* Always check the hint, as it may have changed */ const char *id_str = SDL_GetHint(SDL_HINT_APP_ID); diff --git a/src/hidapi/libusb/hid.c b/src/hidapi/libusb/hid.c index 5f204c1896974..2094022c842db 100644 --- a/src/hidapi/libusb/hid.c +++ b/src/hidapi/libusb/hid.c @@ -454,7 +454,7 @@ static struct usb_string_cache_entry *usb_string_cache = NULL; static size_t usb_string_cache_size = 0; static size_t usb_string_cache_insert_pos = 0; -static int usb_string_cache_grow() +static int usb_string_cache_grow(void) { struct usb_string_cache_entry *new_cache; size_t allocSize; @@ -472,7 +472,7 @@ static int usb_string_cache_grow() return 0; } -static void usb_string_cache_destroy() +static void usb_string_cache_destroy(void) { size_t i; for (i = 0; i < usb_string_cache_insert_pos; i++) { @@ -486,7 +486,7 @@ static void usb_string_cache_destroy() usb_string_cache_insert_pos = 0; } -static struct usb_string_cache_entry *usb_string_cache_insert() +static struct usb_string_cache_entry *usb_string_cache_insert(void) { struct usb_string_cache_entry *new_entry = NULL; if (usb_string_cache_insert_pos >= usb_string_cache_size) { diff --git a/src/hidapi/windows/hid.c b/src/hidapi/windows/hid.c index 1f052fd68aac7..832878bbc2b9f 100644 --- a/src/hidapi/windows/hid.c +++ b/src/hidapi/windows/hid.c @@ -119,7 +119,7 @@ static HMODULE hid_lib_handle = NULL; static HMODULE cfgmgr32_lib_handle = NULL; static BOOLEAN hidapi_initialized = FALSE; -static void free_library_handles() +static void free_library_handles(void) { if (hid_lib_handle) FreeLibrary(hid_lib_handle); @@ -134,7 +134,7 @@ static void free_library_handles() # pragma GCC diagnostic ignored "-Wcast-function-type" #endif -static int lookup_functions() +static int lookup_functions(void) { hid_lib_handle = LoadLibraryW(L"hid.dll"); if (hid_lib_handle == NULL) { @@ -221,7 +221,7 @@ static BOOL IsWindowsVersionOrGreater(WORD wMajorVersion, WORD wMinorVersion, WO return VerifyVersionInfoW(&osvi, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR, dwlConditionMask) != FALSE; } -static hid_device *new_hid_device() +static hid_device *new_hid_device(void) { hid_device *dev = (hid_device*) calloc(1, sizeof(hid_device)); diff --git a/src/joystick/ps2/SDL_sysjoystick.c b/src/joystick/ps2/SDL_sysjoystick.c index 5042dcda898bb..46933662abc58 100644 --- a/src/joystick/ps2/SDL_sysjoystick.c +++ b/src/joystick/ps2/SDL_sysjoystick.c @@ -131,13 +131,13 @@ static int PS2_JoystickInit(void) } /* Function to return the number of joystick devices plugged in right now */ -static int PS2_JoystickGetCount() +static int PS2_JoystickGetCount(void) { return (int)enabled_pads; } /* Function to cause any queued joystick insertions to be processed */ -static void PS2_JoystickDetect() +static void PS2_JoystickDetect(void) { } diff --git a/src/joystick/vita/SDL_sysjoystick.c b/src/joystick/vita/SDL_sysjoystick.c index 0273ded9ee593..d5625426d1461 100644 --- a/src/joystick/vita/SDL_sysjoystick.c +++ b/src/joystick/vita/SDL_sysjoystick.c @@ -134,12 +134,12 @@ static int VITA_JoystickInit(void) return SDL_numjoysticks; } -static int VITA_JoystickGetCount() +static int VITA_JoystickGetCount(void) { return SDL_numjoysticks; } -static void VITA_JoystickDetect() +static void VITA_JoystickDetect(void) { } diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index f5766ebc81168..0b2509b4b024e 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -326,7 +326,7 @@ static struct static SDL_bool xinput_device_change = SDL_TRUE; static SDL_bool xinput_state_dirty = SDL_TRUE; -static void RAWINPUT_UpdateXInput() +static void RAWINPUT_UpdateXInput(void) { DWORD user_index; if (xinput_device_change) { @@ -366,7 +366,7 @@ static void RAWINPUT_MarkXInputSlotFree(Uint8 xinput_slot) xinput_state[xinput_slot].used = SDL_FALSE; } } -static SDL_bool RAWINPUT_MissingXInputSlot() +static SDL_bool RAWINPUT_MissingXInputSlot(void) { int ii; for (ii = 0; ii < SDL_arraysize(xinput_state); ii++) { @@ -561,7 +561,7 @@ static void RAWINPUT_MarkWindowsGamingInputSlotFree(WindowsGamingInputGamepadSta wgi_slot->correlated_context = NULL; } -static SDL_bool RAWINPUT_MissingWindowsGamingInputSlot() +static SDL_bool RAWINPUT_MissingWindowsGamingInputSlot(void) { int ii; for (ii = 0; ii < wgi_state.per_gamepad_count; ii++) { @@ -572,7 +572,7 @@ static SDL_bool RAWINPUT_MissingWindowsGamingInputSlot() return SDL_FALSE; } -static int RAWINPUT_UpdateWindowsGamingInput() +static int RAWINPUT_UpdateWindowsGamingInput(void) { int ii; if (!wgi_state.gamepad_statics) { @@ -1054,7 +1054,7 @@ static int RAWINPUT_JoystickGetCount(void) return SDL_RAWINPUT_numjoysticks; } -SDL_bool RAWINPUT_IsEnabled() +SDL_bool RAWINPUT_IsEnabled(void) { return SDL_RAWINPUT_inited && !SDL_RAWINPUT_remote_desktop; } @@ -2102,7 +2102,7 @@ int RAWINPUT_RegisterNotifications(HWND hWnd) return 0; } -int RAWINPUT_UnregisterNotifications() +int RAWINPUT_UnregisterNotifications(void) { int i; RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)]; diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c index c1f365f99f874..819241529a334 100644 --- a/src/joystick/windows/SDL_windows_gaming_input.c +++ b/src/joystick/windows/SDL_windows_gaming_input.c @@ -213,7 +213,7 @@ static SDL_bool SDL_IsXInputDevice(Uint16 vendor, Uint16 product) return SDL_FALSE; } -static void WGI_LoadRawGameControllerStatics() +static void WGI_LoadRawGameControllerStatics(void) { HRESULT hr; HSTRING_HEADER class_name_header; @@ -228,7 +228,7 @@ static void WGI_LoadRawGameControllerStatics() } } -static void WGI_LoadOtherControllerStatics() +static void WGI_LoadOtherControllerStatics(void) { HRESULT hr; HSTRING_HEADER class_name_header; diff --git a/src/main/SDL_main_callbacks.c b/src/main/SDL_main_callbacks.c index a87a56b2fcff4..f867b62ba9e60 100644 --- a/src/main/SDL_main_callbacks.c +++ b/src/main/SDL_main_callbacks.c @@ -51,7 +51,7 @@ static void SDL_DispatchMainCallbackEvent(SDL_Event *event) } } -static void SDL_DispatchMainCallbackEvents() +static void SDL_DispatchMainCallbackEvents(void) { SDL_Event events[16]; @@ -81,7 +81,7 @@ static int SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event return 0; } -SDL_bool SDL_HasMainCallbacks() +SDL_bool SDL_HasMainCallbacks(void) { if (SDL_main_iteration_callback) { return SDL_TRUE; diff --git a/src/main/ps2/SDL_sysmain_runapp.c b/src/main/ps2/SDL_sysmain_runapp.c index dff3f84c52b06..9bd627ac22843 100644 --- a/src/main/ps2/SDL_sysmain_runapp.c +++ b/src/main/ps2/SDL_sysmain_runapp.c @@ -36,7 +36,7 @@ #include #include -__attribute__((weak)) void reset_IOP() +__attribute__((weak)) void reset_IOP(void) { SifInitRpc(0); while (!SifIopReset(NULL, 0)) { @@ -45,7 +45,7 @@ __attribute__((weak)) void reset_IOP() } } -static void prepare_IOP() +static void prepare_IOP(void) { reset_IOP(); SifInitRpc(0); @@ -54,12 +54,12 @@ static void prepare_IOP() sbv_patch_fileio(); } -static void init_drivers() +static void init_drivers(void) { init_ps2_filesystem_driver(); } -static void deinit_drivers() +static void deinit_drivers(void) { deinit_ps2_filesystem_driver(); } diff --git a/src/render/SDL_d3dmath.c b/src/render/SDL_d3dmath.c index ade1adebef3d7..f22d3332ff650 100644 --- a/src/render/SDL_d3dmath.c +++ b/src/render/SDL_d3dmath.c @@ -26,7 +26,7 @@ /* Direct3D matrix math functions */ -Float4X4 MatrixIdentity() +Float4X4 MatrixIdentity(void) { Float4X4 m; SDL_zero(m); diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index 159975614561e..e338c89062a9d 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -808,7 +808,7 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_WINGDK) -static DXGI_MODE_ROTATION D3D11_GetCurrentRotation() +static DXGI_MODE_ROTATION D3D11_GetCurrentRotation(void) { /* FIXME */ return DXGI_MODE_ROTATION_IDENTITY; diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 565ff2b25720b..7130c10c1c8e8 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -1200,7 +1200,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) return result; } -static DXGI_MODE_ROTATION D3D12_GetCurrentRotation() +static DXGI_MODE_ROTATION D3D12_GetCurrentRotation(void) { /* FIXME */ return DXGI_MODE_ROTATION_IDENTITY; diff --git a/src/render/ps2/SDL_render_ps2.c b/src/render/ps2/SDL_render_ps2.c index 7ebd70f86bf02..a3944bb3f9f76 100644 --- a/src/render/ps2/SDL_render_ps2.c +++ b/src/render/ps2/SDL_render_ps2.c @@ -60,7 +60,7 @@ typedef struct static int vsync_sema_id = 0; /* PRIVATE METHODS */ -static int vsync_handler() +static int vsync_handler(void) { iSignalSema(vsync_sema_id); diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index f808a8a92383a..5d6084e2e84e2 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -1639,7 +1639,7 @@ static SDL_bool VULKAN_InstanceExtensionFound(VULKAN_RenderData *rendererData, c return SDL_FALSE; } -static SDL_bool VULKAN_ValidationLayersFound() +static SDL_bool VULKAN_ValidationLayersFound(void) { uint32_t instanceLayerCount = 0; uint32_t i; diff --git a/src/stdlib/SDL_mslibc.c b/src/stdlib/SDL_mslibc.c index 43fec09742215..63cd0cefd3f5c 100644 --- a/src/stdlib/SDL_mslibc.c +++ b/src/stdlib/SDL_mslibc.c @@ -36,7 +36,7 @@ __declspec(selectany) int _fltused = 1; #ifdef _M_IX86 /* Float to long */ -void __declspec(naked) _ftol() +void __declspec(naked) _ftol(void) { /* *INDENT-OFF* */ __asm { @@ -85,18 +85,18 @@ void __declspec(naked) _ftol() /* *INDENT-ON* */ } -void _ftol2_sse() +void _ftol2_sse(void) { _ftol(); } -void _ftol2() +void _ftol2(void) { _ftol(); } /* 64-bit math operators for 32-bit systems */ -void __declspec(naked) _allmul() +void __declspec(naked) _allmul(void) { /* *INDENT-OFF* */ __asm { @@ -124,7 +124,7 @@ void __declspec(naked) _allmul() /* *INDENT-ON* */ } -void __declspec(naked) _alldiv() +void __declspec(naked) _alldiv(void) { /* *INDENT-OFF* */ __asm { @@ -210,7 +210,7 @@ void __declspec(naked) _alldiv() /* *INDENT-ON* */ } -void __declspec(naked) _aulldiv() +void __declspec(naked) _aulldiv(void) { /* *INDENT-OFF* */ __asm { @@ -266,7 +266,7 @@ void __declspec(naked) _aulldiv() /* *INDENT-ON* */ } -void __declspec(naked) _allrem() +void __declspec(naked) _allrem(void) { /* *INDENT-OFF* */ __asm { @@ -351,7 +351,7 @@ void __declspec(naked) _allrem() /* *INDENT-ON* */ } -void __declspec(naked) _aullrem() +void __declspec(naked) _aullrem(void) { /* *INDENT-OFF* */ __asm { @@ -408,7 +408,7 @@ void __declspec(naked) _aullrem() /* *INDENT-ON* */ } -void __declspec(naked) _alldvrm() +void __declspec(naked) _alldvrm(void) { /* *INDENT-OFF* */ __asm { @@ -516,7 +516,7 @@ void __declspec(naked) _alldvrm() /* *INDENT-ON* */ } -void __declspec(naked) _aulldvrm() +void __declspec(naked) _aulldvrm(void) { /* *INDENT-OFF* */ __asm { @@ -587,7 +587,7 @@ void __declspec(naked) _aulldvrm() /* *INDENT-ON* */ } -void __declspec(naked) _allshl() +void __declspec(naked) _allshl(void) { /* *INDENT-OFF* */ __asm { @@ -612,7 +612,7 @@ void __declspec(naked) _allshl() /* *INDENT-ON* */ } -void __declspec(naked) _allshr() +void __declspec(naked) _allshr(void) { /* *INDENT-OFF* */ __asm { @@ -637,7 +637,7 @@ void __declspec(naked) _allshr() /* *INDENT-ON* */ } -void __declspec(naked) _aullshr() +void __declspec(naked) _aullshr(void) { /* *INDENT-OFF* */ __asm { diff --git a/src/test/SDL_test_memory.c b/src/test/SDL_test_memory.c index 21371399ba620..2d655a18da213 100644 --- a/src/test/SDL_test_memory.c +++ b/src/test/SDL_test_memory.c @@ -323,7 +323,7 @@ void SDLTest_TrackAllocations(void) SDLTest_TrackedFree); } -void SDLTest_RandFillAllocations() +void SDLTest_RandFillAllocations(void) { SDLTest_TrackAllocations(); diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index a278e378fcfa0..8bf46fb97fc3e 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -31,7 +31,7 @@ static void SDL_CleanupWaitableTimer(void *timer) CloseHandle(timer); } -HANDLE SDL_GetWaitableTimer() +HANDLE SDL_GetWaitableTimer(void) { static SDL_TLSID TLS_timer_handle; HANDLE timer; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index f02a036a643c1..1270ee90cbc34 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -694,7 +694,7 @@ SDL_SystemTheme SDL_GetSystemTheme(void) } } -static void SDL_UpdateDesktopBounds() +static void SDL_UpdateDesktopBounds(void) { SDL_Rect rect; SDL_zero(rect); diff --git a/src/video/android/SDL_androidmouse.c b/src/video/android/SDL_androidmouse.c index b05dc58e6d9cc..d46847033e0b3 100644 --- a/src/video/android/SDL_androidmouse.c +++ b/src/video/android/SDL_androidmouse.c @@ -74,7 +74,7 @@ static SDL_Cursor *Android_WrapCursor(int custom_cursor, int system_cursor) return cursor; } -static SDL_Cursor *Android_CreateDefaultCursor() +static SDL_Cursor *Android_CreateDefaultCursor(void) { return Android_WrapCursor(0, SDL_SYSTEM_CURSOR_DEFAULT); } @@ -112,7 +112,7 @@ static void Android_FreeCursor(SDL_Cursor *cursor) SDL_free(cursor); } -static SDL_Cursor *Android_CreateEmptyCursor() +static SDL_Cursor *Android_CreateEmptyCursor(void) { if (!empty_cursor) { SDL_Surface *empty_surface = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_ARGB8888); @@ -125,7 +125,7 @@ static SDL_Cursor *Android_CreateEmptyCursor() return empty_cursor; } -static void Android_DestroyEmptyCursor() +static void Android_DestroyEmptyCursor(void) { if (empty_cursor) { Android_FreeCursor(empty_cursor); diff --git a/src/video/emscripten/SDL_emscriptenmouse.c b/src/video/emscripten/SDL_emscriptenmouse.c index e060abf27b73d..189e4da180a4a 100644 --- a/src/video/emscripten/SDL_emscriptenmouse.c +++ b/src/video/emscripten/SDL_emscriptenmouse.c @@ -60,7 +60,7 @@ static SDL_Cursor *Emscripten_CreateCursorFromString(const char *cursor_str, SDL return cursor; } -static SDL_Cursor *Emscripten_CreateDefaultCursor() +static SDL_Cursor *Emscripten_CreateDefaultCursor(void) { return Emscripten_CreateCursorFromString("default", SDL_FALSE); } @@ -194,7 +194,7 @@ static int Emscripten_SetRelativeMouseMode(SDL_bool enabled) return -1; } -void Emscripten_InitMouse() +void Emscripten_InitMouse(void) { SDL_Mouse *mouse = SDL_GetMouse(); @@ -207,7 +207,7 @@ void Emscripten_InitMouse() SDL_SetDefaultCursor(Emscripten_CreateDefaultCursor()); } -void Emscripten_FiniMouse() +void Emscripten_FiniMouse(void) { } diff --git a/src/video/n3ds/SDL_n3dsswkb.c b/src/video/n3ds/SDL_n3dsswkb.c index 1140aae0872a2..51c38d8d2ccf4 100644 --- a/src/video/n3ds/SDL_n3dsswkb.c +++ b/src/video/n3ds/SDL_n3dsswkb.c @@ -30,17 +30,17 @@ static SwkbdState sw_keyboard; const static size_t BUFFER_SIZE = 256; -void N3DS_SwkbInit() +void N3DS_SwkbInit(void) { swkbdInit(&sw_keyboard, SWKBD_TYPE_NORMAL, 2, -1); } -void N3DS_SwkbPoll() +void N3DS_SwkbPoll(void) { return; } -void N3DS_SwkbQuit() +void N3DS_SwkbQuit(void) { return; } diff --git a/src/video/psp/SDL_pspvideo.c b/src/video/psp/SDL_pspvideo.c index a2ff1d129a390..bec60d0d14a7e 100644 --- a/src/video/psp/SDL_pspvideo.c +++ b/src/video/psp/SDL_pspvideo.c @@ -48,7 +48,7 @@ static void PSP_Destroy(SDL_VideoDevice *device) SDL_free(device); } -static SDL_VideoDevice *PSP_Create() +static SDL_VideoDevice *PSP_Create(void) { SDL_VideoDevice *device; SDL_VideoData *phdata; diff --git a/src/video/qnx/SDL_qnxvideo.c b/src/video/qnx/SDL_qnxvideo.c index 3744d3b1b926a..16f5c65abd82b 100644 --- a/src/video/qnx/SDL_qnxvideo.c +++ b/src/video/qnx/SDL_qnxvideo.c @@ -309,7 +309,7 @@ static void deleteDevice(SDL_VideoDevice *device) * Creates the QNX video plugin used by SDL. * @return Initialized device if successful, NULL otherwise */ -static SDL_VideoDevice *createDevice() +static SDL_VideoDevice *createDevice(void) { SDL_VideoDevice *device; diff --git a/src/video/raspberry/SDL_rpivideo.c b/src/video/raspberry/SDL_rpivideo.c index 0806a15735913..bab989806d116 100644 --- a/src/video/raspberry/SDL_rpivideo.c +++ b/src/video/raspberry/SDL_rpivideo.c @@ -75,7 +75,7 @@ static void RPI_GetRefreshRate(int *numerator, int *denominator) *denominator = 1; } -static SDL_VideoDevice *RPI_Create() +static SDL_VideoDevice *RPI_Create(void) { SDL_VideoDevice *device; SDL_VideoData *phdata; diff --git a/src/video/riscos/SDL_riscosmouse.c b/src/video/riscos/SDL_riscosmouse.c index 465d754a766a1..90294eabc04e9 100644 --- a/src/video/riscos/SDL_riscosmouse.c +++ b/src/video/riscos/SDL_riscosmouse.c @@ -28,7 +28,7 @@ #include -static SDL_Cursor *RISCOS_CreateDefaultCursor() +static SDL_Cursor *RISCOS_CreateDefaultCursor(void) { SDL_Cursor *cursor = SDL_calloc(1, sizeof(*cursor)); if (cursor) { diff --git a/src/video/vita/SDL_vitavideo.c b/src/video/vita/SDL_vitavideo.c index 1ab7cf69dbdde..6be09fe9a4db4 100644 --- a/src/video/vita/SDL_vitavideo.c +++ b/src/video/vita/SDL_vitavideo.c @@ -59,7 +59,7 @@ static void VITA_Destroy(SDL_VideoDevice *device) SDL_free(device); } -static SDL_VideoDevice *VITA_Create() +static SDL_VideoDevice *VITA_Create(void) { SDL_VideoDevice *device; SDL_VideoData *phdata; diff --git a/src/video/vivante/SDL_vivantevideo.c b/src/video/vivante/SDL_vivantevideo.c index f78753ed939f7..e79caa4987ecf 100644 --- a/src/video/vivante/SDL_vivantevideo.c +++ b/src/video/vivante/SDL_vivantevideo.c @@ -41,7 +41,7 @@ static void VIVANTE_Destroy(SDL_VideoDevice *device) SDL_free(device); } -static SDL_VideoDevice *VIVANTE_Create() +static SDL_VideoDevice *VIVANTE_Create(void) { SDL_VideoDevice *device; SDL_VideoData *data; diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index b2f40d79dc51a..3bf9376690309 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -272,7 +272,7 @@ static void Wayland_DBusInitCursorProperties(SDL_VideoData *vdata) } } -static void Wayland_DBusFinishCursorProperties() +static void Wayland_DBusFinishCursorProperties(void) { SDL_free(dbus_cursor_theme); dbus_cursor_theme = NULL; diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 7cc83e35bcc3b..0f14bfc554e5e 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -89,7 +89,7 @@ enum WaylandModeScale WAYLAND_MODE_SCALE_NONE }; -static enum WaylandModeScale GetModeScaleMethod() +static enum WaylandModeScale GetModeScaleMethod(void) { static enum WaylandModeScale scale_mode = WAYLAND_MODE_SCALE_UNDEFINED; diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 441c6f6329074..048223ffef3aa 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -133,7 +133,7 @@ static void WIN_SetMessageTick(DWORD tick) message_tick = tick; } -static Uint64 WIN_GetEventTimestamp() +static Uint64 WIN_GetEventTimestamp(void) { Uint64 timestamp, now; @@ -2090,7 +2090,7 @@ LRESULT CALLBACK WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara } #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) -static void WIN_UpdateClipCursorForWindows() +static void WIN_UpdateClipCursorForWindows(void) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); SDL_Window *window; @@ -2112,7 +2112,7 @@ static void WIN_UpdateClipCursorForWindows() } } -static void WIN_UpdateMouseCapture() +static void WIN_UpdateMouseCapture(void) { SDL_Window *focusWindow = SDL_GetKeyboardFocus(); @@ -2408,7 +2408,7 @@ int SDL_RegisterApp(const char *name, Uint32 style, void *hInst) } /* Unregisters the windowclass registered in SDL_RegisterApp above. */ -void SDL_UnregisterApp() +void SDL_UnregisterApp(void) { WNDCLASSEX wcex; diff --git a/src/video/windows/SDL_windowskeyboard.c b/src/video/windows/SDL_windowskeyboard.c index 2080c06e928b8..fe141c576bd59 100644 --- a/src/video/windows/SDL_windowskeyboard.c +++ b/src/video/windows/SDL_windowskeyboard.c @@ -165,7 +165,7 @@ void WIN_QuitKeyboard(SDL_VideoDevice *_this) #endif /* !SDL_DISABLE_WINDOWS_IME */ } -void WIN_ResetDeadKeys() +void WIN_ResetDeadKeys(void) { /* if a deadkey has been typed, but not the next character (which the deadkey might modify), diff --git a/src/video/windows/SDL_windowsmouse.c b/src/video/windows/SDL_windowsmouse.c index 0118048e444ee..8c1c1999158a4 100644 --- a/src/video/windows/SDL_windowsmouse.c +++ b/src/video/windows/SDL_windowsmouse.c @@ -34,7 +34,7 @@ DWORD SDL_last_warp_time = 0; HCURSOR SDL_cursor = NULL; static SDL_Cursor *SDL_blank_cursor = NULL; -static SDL_Cursor *WIN_CreateDefaultCursor() +static SDL_Cursor *WIN_CreateDefaultCursor(void) { SDL_Cursor *cursor = (SDL_Cursor *)SDL_calloc(1, sizeof(*cursor)); if (cursor) { @@ -195,7 +195,7 @@ static SDL_Cursor *WIN_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y) return cursor; } -static SDL_Cursor *WIN_CreateBlankCursor() +static SDL_Cursor *WIN_CreateBlankCursor(void) { SDL_Cursor *cursor = NULL; SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_ARGB8888); @@ -522,7 +522,7 @@ static void WIN_SetLinearMouseScale(int mouse_speed) } } -void WIN_UpdateMouseSystemScale() +void WIN_UpdateMouseSystemScale(void) { int mouse_speed; int params[3] = { 0, 0, 0 }; diff --git a/src/video/windows/SDL_windowswindow.c b/src/video/windows/SDL_windowswindow.c index af8eb417edbe8..1b19803bf92bf 100644 --- a/src/video/windows/SDL_windowswindow.c +++ b/src/video/windows/SDL_windowswindow.c @@ -352,7 +352,7 @@ static void SDLCALL WIN_MouseRelativeModeCenterChanged(void *userdata, const cha data->mouse_relative_mode_center = SDL_GetStringBoolean(hint, SDL_TRUE); } -static SDL_WindowEraseBackgroundMode GetEraseBackgroundModeHint() +static SDL_WindowEraseBackgroundMode GetEraseBackgroundModeHint(void) { const char *hint = SDL_GetHint(SDL_HINT_WINDOWS_ERASE_BACKGROUND_MODE); if (!hint) diff --git a/src/video/x11/SDL_x11xfixes.c b/src/video/x11/SDL_x11xfixes.c index 670e1d5582b40..f101dd2f2f1ce 100644 --- a/src/video/x11/SDL_x11xfixes.c +++ b/src/video/x11/SDL_x11xfixes.c @@ -79,7 +79,7 @@ int X11_XfixesIsInitialized(void) return xfixes_initialized; } -int X11_GetXFixesSelectionNotifyEvent() +int X11_GetXFixesSelectionNotifyEvent(void) { return xfixes_selection_notify_event; } diff --git a/test/testaudiostreamdynamicresample.c b/test/testaudiostreamdynamicresample.c index 58aeb4c96f367..f01ca2505d251 100644 --- a/test/testaudiostreamdynamicresample.c +++ b/test/testaudiostreamdynamicresample.c @@ -102,7 +102,7 @@ static void draw_textf(SDL_Renderer* renderer, int x, int y, const char* fmt, .. draw_text(renderer, x, y, text); } -static void queue_audio() +static void queue_audio(void) { Uint8* new_data = NULL; int new_len = 0; diff --git a/test/testautomation_log.c b/test/testautomation_log.c index b2024dc96b5ba..75c767f810d45 100644 --- a/test/testautomation_log.c +++ b/test/testautomation_log.c @@ -21,7 +21,7 @@ static void EnableTestLog(int *message_count) SDL_SetLogOutputFunction(TestLogOutput, message_count); } -static void DisableTestLog() +static void DisableTestLog(void) { SDL_SetLogOutputFunction(original_function, original_userdata); } diff --git a/test/testgles.c b/test/testgles.c index d32015f3a09ce..a69bde8c2fe1d 100644 --- a/test/testgles.c +++ b/test/testgles.c @@ -50,7 +50,7 @@ quit(int rc) } static void -Render() +Render(void) { static GLubyte color[8][4] = { { 255, 0, 0, 0 }, { 255, 0, 0, 255 }, From b99ea1ff75e96354b8cc11387185cd461f6d6279 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Wed, 17 Jul 2024 18:24:47 -0400 Subject: [PATCH 366/431] wayland: Add SDL_VIDEO_DOUBLE_BUFFER support Manual cherry-pick of 9e6b8d56e33f77dab507236d84a3f76b6fea7b2a thanks @vanfanel --- include/SDL3/SDL_hints.h | 1 + src/video/wayland/SDL_waylandopengles.c | 25 ++++++++++++++++++++----- src/video/wayland/SDL_waylandwindow.c | 4 ++++ src/video/wayland/SDL_waylandwindow.h | 1 + 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 4c63c6f735dee..f6c7cf338589c 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -2948,6 +2948,7 @@ extern "C" { * This hint is currently supported on the following drivers: * * - Raspberry Pi (raspberrypi) + * - Wayland (wayland) * * This hint should be set before SDL is initialized. * diff --git a/src/video/wayland/SDL_waylandopengles.c b/src/video/wayland/SDL_waylandopengles.c index 6ee1851ba0612..0fad3bcf3a298 100644 --- a/src/video/wayland/SDL_waylandopengles.c +++ b/src/video/wayland/SDL_waylandopengles.c @@ -120,6 +120,19 @@ int Wayland_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) return 0; } + /* By default, we wait for the Wayland frame callback and then issue the pageflip (eglSwapBuffers), + * but if we want low latency (double buffer scheme), we issue the pageflip and then wait + * immediately for the Wayland frame callback. + */ + if (data->double_buffer) { + /* Feed the frame to Wayland. This will set it so the wl_surface_frame callback can fire again. */ + if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, data->egl_surface)) { + return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); + } + + WAYLAND_wl_display_flush(data->waylandData->display); + } + /* Control swap interval ourselves. See comments on Wayland_GLES_SetSwapInterval */ if (swap_interval != 0 && data->surface_status == WAYLAND_SURFACE_STATUS_SHOWN) { SDL_VideoData *videodata = _this->internal; @@ -161,12 +174,14 @@ int Wayland_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) SDL_AtomicSet(&data->swap_interval_ready, 0); } - /* Feed the frame to Wayland. This will set it so the wl_surface_frame callback can fire again. */ - if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, data->egl_surface)) { - return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); - } + if (!data->double_buffer) { + /* Feed the frame to Wayland. This will set it so the wl_surface_frame callback can fire again. */ + if (!_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, data->egl_surface)) { + return SDL_EGL_SetError("unable to show color buffer in an OS-native window", "eglSwapBuffers"); + } - WAYLAND_wl_display_flush(data->waylandData->display); + WAYLAND_wl_display_flush(data->waylandData->display); + } return 0; } diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 0f14bfc554e5e..853addbd82a9d 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -2484,6 +2484,10 @@ int Wayland_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Propert data->surface_status = WAYLAND_SURFACE_STATUS_SHOWN; } + if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) { + data->double_buffer = SDL_TRUE; + } + SDL_PropertiesID props = SDL_GetWindowProperties(window); SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_DISPLAY_POINTER, data->waylandData->display); SDL_SetPointerProperty(props, SDL_PROP_WINDOW_WAYLAND_SURFACE_POINTER, data->surface); diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index 032c4845ba074..ffe762c37ed5a 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -168,6 +168,7 @@ struct SDL_WindowData SDL_bool show_hide_sync_required; SDL_bool scale_to_display; SDL_bool modal_reparenting_required; + SDL_bool double_buffer; SDL_HitTestResult hit_test_result; From 334962b05691d242c17b21b923602de712568542 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 12:50:56 -0700 Subject: [PATCH 367/431] Enhancements for SDL_PremultiplyAlpha() The function can now convert between pixels of different formats, and takes a parameter to control whether the premultiplication is done in sRGB or linear space. Also added SDL_PremultiplySurfaceAlpha(), which can premultiply the pixels of a surface in-place. --- include/SDL3/SDL_surface.h | 19 ++- src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 3 +- src/video/SDL_surface.c | 213 +++++++++++++++++++++++---- src/video/kmsdrm/SDL_kmsdrmmouse.c | 2 +- src/video/wayland/SDL_waylandmouse.c | 2 +- 7 files changed, 210 insertions(+), 31 deletions(-) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 6998b12991e48..32cb75c3885bf 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -798,8 +798,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int he * * This is safe to use with src == dst, but not for other overlapping areas. * - * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888. - * * \param width the width of the block to convert, in pixels. * \param height the height of the block to convert, in pixels. * \param src_format an SDL_PixelFormat value of the `src` pixels format. @@ -808,12 +806,27 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int he * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst a pointer to be filled in with premultiplied pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. + * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha multiplication, SDL_FALSE to do multiplication in sRGB space. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch, SDL_bool linear); + +/** + * Premultiply the alpha in a surface. + * + * This is safe to use with src == dst, but not for other overlapping areas. + * + * \param surface the surface to modify. + * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha multiplication, SDL_FALSE to do multiplication in sRGB space. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_PixelFormat src_format, const void *src, int src_pitch, SDL_PixelFormat dst_format, void *dst, int dst_pitch); +extern SDL_DECLSPEC int SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear); /** * Perform a fast fill of a rectangle with a specific color. diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index d1c53c8725270..04675387d39ab 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -610,6 +610,7 @@ SDL3_0.0.0 { SDL_PollEvent; SDL_PostSemaphore; SDL_PremultiplyAlpha; + SDL_PremultiplySurfaceAlpha; SDL_PumpEvents; SDL_PushEvent; SDL_PutAudioStreamData; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 425bab5f8b3e5..c25827219b61a 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -635,6 +635,7 @@ #define SDL_PollEvent SDL_PollEvent_REAL #define SDL_PostSemaphore SDL_PostSemaphore_REAL #define SDL_PremultiplyAlpha SDL_PremultiplyAlpha_REAL +#define SDL_PremultiplySurfaceAlpha SDL_PremultiplySurfaceAlpha_REAL #define SDL_PumpEvents SDL_PumpEvents_REAL #define SDL_PushEvent SDL_PushEvent_REAL #define SDL_PutAudioStreamData SDL_PutAudioStreamData_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index fd778f69d438d..a25da1aa1de00 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -645,7 +645,8 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_PenConnected,(SDL_PenID a),(a),return) SDL_DYNAPI_PROC(int,SDL_PlayHapticRumble,(SDL_Haptic *a, float b, Uint32 c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_PollEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(int,SDL_PostSemaphore,(SDL_Semaphore *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h),(a,b,c,d,e,f,g,h),return) +SDL_DYNAPI_PROC(int,SDL_PremultiplyAlpha,(int a, int b, SDL_PixelFormat c, const void *d, int e, SDL_PixelFormat f, void *g, int h, SDL_bool i),(a,b,c,d,e,f,g,h,i),return) +SDL_DYNAPI_PROC(int,SDL_PremultiplySurfaceAlpha,(SDL_Surface *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(void,SDL_PumpEvents,(void),(),) SDL_DYNAPI_PROC(int,SDL_PushEvent,(SDL_Event *a),(a),return) SDL_DYNAPI_PROC(int,SDL_PutAudioStreamData,(SDL_AudioStream *a, const void *b, int c),(a,b,c),return) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 2c38eacd24cc7..e6d5c1f0b6594 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1769,15 +1769,12 @@ int SDL_ConvertPixels(int width, int height, /* * Premultiply the alpha on a block of pixels * - * This is currently only implemented for SDL_PIXELFORMAT_ARGB8888 - * * Here are some ideas for optimization: * https://github.com/Wizermil/premultiply_alpha/tree/master/premultiply_alpha * https://developer.arm.com/documentation/101964/0201/Pre-multiplied-alpha-channel-data */ -int SDL_PremultiplyAlpha(int width, int height, - SDL_PixelFormat src_format, const void *src, int src_pitch, - SDL_PixelFormat dst_format, void *dst, int dst_pitch) + +static void SDL_PremultiplyAlpha_AXYZ8888(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) { int c; Uint32 srcpixel; @@ -1785,25 +1782,6 @@ int SDL_PremultiplyAlpha(int width, int height, Uint32 dstpixel; Uint32 dstR, dstG, dstB, dstA; - if (!src) { - return SDL_InvalidParamError("src"); - } - if (!src_pitch) { - return SDL_InvalidParamError("src_pitch"); - } - if (!dst) { - return SDL_InvalidParamError("dst"); - } - if (!dst_pitch) { - return SDL_InvalidParamError("dst_pitch"); - } - if (src_format != SDL_PIXELFORMAT_ARGB8888) { - return SDL_InvalidParamError("src_format"); - } - if (dst_format != SDL_PIXELFORMAT_ARGB8888) { - return SDL_InvalidParamError("dst_format"); - } - while (height--) { const Uint32 *src_px = (const Uint32 *)src; Uint32 *dst_px = (Uint32 *)dst; @@ -1825,7 +1803,192 @@ int SDL_PremultiplyAlpha(int width, int height, src = (const Uint8 *)src + src_pitch; dst = (Uint8 *)dst + dst_pitch; } - return 0; +} + +static void SDL_PremultiplyAlpha_XYZA8888(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +{ + int c; + Uint32 srcpixel; + Uint32 srcR, srcG, srcB, srcA; + Uint32 dstpixel; + Uint32 dstR, dstG, dstB, dstA; + + while (height--) { + const Uint32 *src_px = (const Uint32 *)src; + Uint32 *dst_px = (Uint32 *)dst; + for (c = width; c; --c) { + /* Component bytes extraction. */ + srcpixel = *src_px++; + RGBA_FROM_RGBA8888(srcpixel, srcR, srcG, srcB, srcA); + + /* Alpha pre-multiplication of each component. */ + dstA = srcA; + dstR = (srcA * srcR) / 255; + dstG = (srcA * srcG) / 255; + dstB = (srcA * srcB) / 255; + + /* RGBA8888 pixel recomposition. */ + RGBA8888_FROM_RGBA(dstpixel, dstR, dstG, dstB, dstA); + *dst_px++ = dstpixel; + } + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; + } +} + +static void SDL_PremultiplyAlpha_AXYZ128(int width, int height, const void *src, int src_pitch, void *dst, int dst_pitch) +{ + int c; + float flR, flG, flB, flA; + + while (height--) { + const float *src_px = (const float *)src; + float *dst_px = (float *)dst; + for (c = width; c; --c) { + flA = *src_px++; + flR = *src_px++; + flG = *src_px++; + flB = *src_px++; + + /* Alpha pre-multiplication of each component. */ + flR *= flA; + flG *= flA; + flB *= flA; + + *dst_px++ = flA; + *dst_px++ = flR; + *dst_px++ = flG; + *dst_px++ = flB; + } + src = (const Uint8 *)src + src_pitch; + dst = (Uint8 *)dst + dst_pitch; + } +} + +static int SDL_PremultiplyAlphaPixelsAndColorspace(int width, int height, SDL_PixelFormat src_format, SDL_Colorspace src_colorspace, SDL_PropertiesID src_properties, const void *src, int src_pitch, SDL_PixelFormat dst_format, SDL_Colorspace dst_colorspace, SDL_PropertiesID dst_properties, void *dst, int dst_pitch, SDL_bool linear) +{ + SDL_Surface *convert = NULL; + void *final_dst = dst; + int final_dst_pitch = dst_pitch; + SDL_PixelFormat format; + SDL_Colorspace colorspace; + int result = -1; + + if (!src) { + return SDL_InvalidParamError("src"); + } + if (!src_pitch) { + return SDL_InvalidParamError("src_pitch"); + } + if (!dst) { + return SDL_InvalidParamError("dst"); + } + if (!dst_pitch) { + return SDL_InvalidParamError("dst_pitch"); + } + + // Use a high precision format if we're converting to linear colorspace or using high precision pixel formats + if (linear || + SDL_ISPIXELFORMAT_10BIT(src_format) || SDL_BITSPERPIXEL(src_format) > 32 || + SDL_ISPIXELFORMAT_10BIT(dst_format) || SDL_BITSPERPIXEL(dst_format) > 32) { + if (src_format == SDL_PIXELFORMAT_ARGB128_FLOAT || + src_format == SDL_PIXELFORMAT_ABGR128_FLOAT) { + format = src_format; + } else { + format = SDL_PIXELFORMAT_ARGB128_FLOAT; + } + } else { + if (src_format == SDL_PIXELFORMAT_ARGB8888 || + src_format == SDL_PIXELFORMAT_ABGR8888 || + src_format == SDL_PIXELFORMAT_RGBA8888 || + src_format == SDL_PIXELFORMAT_BGRA8888) { + format = src_format; + } else { + format = SDL_PIXELFORMAT_ARGB8888; + } + } + if (linear) { + colorspace = SDL_COLORSPACE_SRGB_LINEAR; + } else { + colorspace = SDL_COLORSPACE_SRGB; + } + + if (src_format != format || src_colorspace != colorspace) { + convert = SDL_CreateSurface(width, height, format); + if (!convert) { + goto done; + } + if (SDL_ConvertPixelsAndColorspace(width, height, src_format, src_colorspace, src_properties, src, src_pitch, format, colorspace, 0, convert->pixels, convert->pitch) < 0) { + goto done; + } + + src = convert->pixels; + src_pitch = convert->pitch; + dst = convert->pixels; + dst_pitch = convert->pitch; + + } else if (dst_format != format || dst_colorspace != colorspace) { + convert = SDL_CreateSurface(width, height, format); + if (!convert) { + goto done; + } + dst = convert->pixels; + dst_pitch = convert->pitch; + } + + switch (format) { + case SDL_PIXELFORMAT_ARGB8888: + case SDL_PIXELFORMAT_ABGR8888: + SDL_PremultiplyAlpha_AXYZ8888(width, height, src, src_pitch, dst, dst_pitch); + break; + case SDL_PIXELFORMAT_RGBA8888: + case SDL_PIXELFORMAT_BGRA8888: + SDL_PremultiplyAlpha_XYZA8888(width, height, src, src_pitch, dst, dst_pitch); + break; + case SDL_PIXELFORMAT_ARGB128_FLOAT: + case SDL_PIXELFORMAT_ABGR128_FLOAT: + SDL_PremultiplyAlpha_AXYZ128(width, height, src, src_pitch, dst, dst_pitch); + break; + default: + SDL_SetError("Unexpected internal pixel format"); + goto done; + } + + if (dst != final_dst) { + if (SDL_ConvertPixelsAndColorspace(width, height, format, colorspace, 0, convert->pixels, convert->pitch, dst_format, dst_colorspace, dst_properties, final_dst, final_dst_pitch) < 0) { + goto done; + } + } + result = 0; + +done: + if (convert) { + SDL_DestroySurface(convert); + } + return result; +} + +int SDL_PremultiplyAlpha(int width, int height, + SDL_PixelFormat src_format, const void *src, int src_pitch, + SDL_PixelFormat dst_format, void *dst, int dst_pitch, SDL_bool linear) +{ + SDL_Colorspace src_colorspace = SDL_GetDefaultColorspaceForFormat(src_format); + SDL_Colorspace dst_colorspace = SDL_GetDefaultColorspaceForFormat(dst_format); + + return SDL_PremultiplyAlphaPixelsAndColorspace(width, height, src_format, src_colorspace, 0, src, src_pitch, dst_format, dst_colorspace, 0, dst, dst_pitch, linear); +} + +int SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear) +{ + SDL_Colorspace colorspace; + + if (!SDL_SurfaceValid(surface)) { + return SDL_InvalidParamError("surface"); + } + + colorspace = SDL_GetSurfaceColorspace(surface); + + return SDL_PremultiplyAlphaPixelsAndColorspace(surface->w, surface->h, surface->format, colorspace, surface->internal->props, surface->pixels, surface->pitch, surface->format, colorspace, surface->internal->props, surface->pixels, surface->pitch, linear); } Uint32 SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index f96dd837def42..2b9a796dfbb92 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -267,7 +267,7 @@ static SDL_Cursor *KMSDRM_CreateCursor(SDL_Surface *surface, int hot_x, int hot_ straight-alpha pixels, so we always have to convert. */ SDL_PremultiplyAlpha(surface->w, surface->h, surface->format, surface->pixels, surface->pitch, - SDL_PIXELFORMAT_ARGB8888, curdata->buffer, surface->w * 4); + SDL_PIXELFORMAT_ARGB8888, curdata->buffer, surface->w * 4, SDL_TRUE); cursor->internal = curdata; diff --git a/src/video/wayland/SDL_waylandmouse.c b/src/video/wayland/SDL_waylandmouse.c index 3bf9376690309..6a2640ef1ef71 100644 --- a/src/video/wayland/SDL_waylandmouse.c +++ b/src/video/wayland/SDL_waylandmouse.c @@ -441,7 +441,7 @@ static SDL_Cursor *Wayland_CreateCursor(SDL_Surface *surface, int hot_x, int hot /* Wayland requires premultiplied alpha for its surfaces. */ SDL_PremultiplyAlpha(surface->w, surface->h, surface->format, surface->pixels, surface->pitch, - SDL_PIXELFORMAT_ARGB8888, data->cursor_data.custom.shm_data, surface->w * 4); + SDL_PIXELFORMAT_ARGB8888, data->cursor_data.custom.shm_data, surface->w * 4, SDL_TRUE); data->surface = wl_compositor_create_surface(wd->compositor); wl_surface_set_user_data(data->surface, NULL); From de6595bda635e3d180278625b04b6fc30059daea Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 13:35:18 -0700 Subject: [PATCH 368/431] SDL_MUSTLOCK() should return true if the surface needs locking even if it's currently locked. There's a bunch of code that assumes this in SDL, and presumably in applications as well. --- include/SDL3/SDL_surface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 32cb75c3885bf..2ec66c563942b 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -61,7 +61,7 @@ typedef Uint32 SDL_SurfaceFlags; * * \since This macro is available since SDL 3.0.0. */ -#define SDL_MUSTLOCK(S) (((S)->flags & (SDL_SURFACE_LOCK_NEEDED | SDL_SURFACE_LOCKED)) == SDL_SURFACE_LOCK_NEEDED) +#define SDL_MUSTLOCK(S) ((((S)->flags & SDL_SURFACE_LOCK_NEEDED)) == SDL_SURFACE_LOCK_NEEDED) /** * The scaling mode. From eefcb62588685c4eae4653c5263e2e7c19116414 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 14:03:53 -0700 Subject: [PATCH 369/431] SDL_MUSTLOCK() returns true once a surface has the RLE flag set This more closely matches the mental model of people using SDL, and locking a surface that isn't RLE encoded doesn't cause any issues. Fixes https://github.com/libsdl-org/SDL/issues/5594 --- src/video/SDL_RLEaccel.c | 7 +------ src/video/SDL_surface.c | 4 ++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/video/SDL_RLEaccel.c b/src/video/SDL_RLEaccel.c index 6907a281c167d..14db1a951f372 100644 --- a/src/video/SDL_RLEaccel.c +++ b/src/video/SDL_RLEaccel.c @@ -62,7 +62,7 @@ * * Encoding of surfaces with per-pixel alpha: * - * The sequence begins with a struct SDL_PixelFormatDetails describing the target + * The sequence begins with an SDL_PixelFormat value describing the target * pixel format, to provide reliable un-encoding. * * Each scan line is encoded twice: First all completely opaque pixels, @@ -1425,7 +1425,6 @@ int SDL_RLESurface(SDL_Surface *surface) /* The surface is now accelerated */ surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; - SDL_UpdateSurfaceLockFlag(surface); return 0; } @@ -1521,7 +1520,6 @@ void SDL_UnRLESurface(SDL_Surface *surface, SDL_bool recode) { if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { surface->internal->flags &= ~SDL_INTERNAL_SURFACE_RLEACCEL; - SDL_UpdateSurfaceLockFlag(surface); if (recode && !(surface->flags & SDL_SURFACE_PREALLOCATED)) { if (surface->internal->map.info.flags & SDL_COPY_RLE_COLORKEY) { @@ -1532,14 +1530,12 @@ void SDL_UnRLESurface(SDL_Surface *surface, SDL_bool recode) if (SDL_size_mul_overflow(surface->h, surface->pitch, &size)) { /* Memory corruption? */ surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; - SDL_UpdateSurfaceLockFlag(surface); return; } surface->pixels = SDL_aligned_alloc(SDL_GetSIMDAlignment(), size); if (!surface->pixels) { /* Oh crap... */ surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; - SDL_UpdateSurfaceLockFlag(surface); return; } surface->flags |= SDL_SURFACE_SIMD_ALIGNED; @@ -1556,7 +1552,6 @@ void SDL_UnRLESurface(SDL_Surface *surface, SDL_bool recode) if (!UnRLEAlpha(surface)) { /* Oh crap... */ surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; - SDL_UpdateSurfaceLockFlag(surface); return; } } diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index e6d5c1f0b6594..5714b11b2b026 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -46,7 +46,7 @@ SDL_bool SDL_SurfaceValid(SDL_Surface *surface) void SDL_UpdateSurfaceLockFlag(SDL_Surface *surface) { - if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { + if (SDL_SurfaceHasRLE(surface)) { surface->flags |= SDL_SURFACE_LOCK_NEEDED; } else { surface->flags &= ~SDL_SURFACE_LOCK_NEEDED; @@ -460,6 +460,7 @@ int SDL_SetSurfaceRLE(SDL_Surface *surface, SDL_bool enabled) if (surface->internal->map.info.flags != flags) { SDL_InvalidateMap(&surface->internal->map); } + SDL_UpdateSurfaceLockFlag(surface); return 0; } @@ -1250,7 +1251,6 @@ int SDL_LockSurface(SDL_Surface *surface) if (surface->internal->flags & SDL_INTERNAL_SURFACE_RLEACCEL) { SDL_UnRLESurface(surface, SDL_TRUE); surface->internal->flags |= SDL_INTERNAL_SURFACE_RLEACCEL; /* save accel'd state */ - SDL_UpdateSurfaceLockFlag(surface); } #endif } From cd25cb34359d4ed7ef57125ba1afa866eae9cf69 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 14:07:33 -0700 Subject: [PATCH 370/431] Check SDL_LockSurface() return value --- src/render/software/SDL_render_sw.c | 8 ++++++-- src/render/software/SDL_rotate.c | 5 ++++- src/video/SDL_surface.c | 4 +++- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index 4e462e75dbd0f..a9d2f1252bec4 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -135,7 +135,9 @@ static int SW_UpdateTexture(SDL_Renderer *renderer, SDL_Texture *texture, size_t length; if (SDL_MUSTLOCK(surface)) { - SDL_LockSurface(surface); + if (SDL_LockSurface(surface) < 0) { + return -1; + } } src = (Uint8 *)pixels; dst = (Uint8 *)surface->pixels + @@ -341,7 +343,9 @@ static int SW_RenderCopyEx(SDL_Renderer *renderer, SDL_Surface *surface, SDL_Tex * necessary because this code is going to access the pixel buffer directly. */ if (SDL_MUSTLOCK(src)) { - SDL_LockSurface(src); + if (SDL_LockSurface(src) < 0) { + return -1; + } } /* Clone the source surface but use its pixel buffer directly. diff --git a/src/render/software/SDL_rotate.c b/src/render/software/SDL_rotate.c index 02382a8e6ffe2..35446fd051242 100644 --- a/src/render/software/SDL_rotate.c +++ b/src/render/software/SDL_rotate.c @@ -561,7 +561,10 @@ SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, in /* Lock source surface */ if (SDL_MUSTLOCK(src)) { - SDL_LockSurface(src); + if (SDL_LockSurface(src) < 0) { + SDL_DestroySurface(rz_dst); + return NULL; + } } /* check if the rotation is a multiple of 90 degrees so we can take a fast path and also somewhat reduce diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 5714b11b2b026..50734c06c8e44 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -2045,7 +2045,9 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, bytes_per_pixel = SDL_BYTESPERPIXEL(surface->format); if (SDL_MUSTLOCK(surface)) { - SDL_LockSurface(surface); + if (SDL_LockSurface(surface) < 0) { + return -1; + } } p = (Uint8 *)surface->pixels + y * surface->pitch + x * bytes_per_pixel; From b07bd55baf26ebd1cf3a3f6b52d686cf36f608e8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 15:38:44 -0700 Subject: [PATCH 371/431] Fixed use of SDL_expand_byte after flipping from bit loss to bit count --- src/video/SDL_blit.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index bd47219b8872c..5f29a1cdf8972 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -131,15 +131,15 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); } #define RGB_FROM_RGB565(Pixel, r, g, b) \ { \ - r = SDL_expand_byte[3][((Pixel & 0xF800) >> 11)]; \ - g = SDL_expand_byte[2][((Pixel & 0x07E0) >> 5)]; \ - b = SDL_expand_byte[3][(Pixel & 0x001F)]; \ + r = SDL_expand_byte[5][((Pixel & 0xF800) >> 11)]; \ + g = SDL_expand_byte[6][((Pixel & 0x07E0) >> 5)]; \ + b = SDL_expand_byte[5][(Pixel & 0x001F)]; \ } #define RGB_FROM_RGB555(Pixel, r, g, b) \ { \ - r = SDL_expand_byte[3][((Pixel & 0x7C00) >> 10)]; \ - g = SDL_expand_byte[3][((Pixel & 0x03E0) >> 5)]; \ - b = SDL_expand_byte[3][(Pixel & 0x001F)]; \ + r = SDL_expand_byte[5][((Pixel & 0x7C00) >> 10)]; \ + g = SDL_expand_byte[5][((Pixel & 0x03E0) >> 5)]; \ + b = SDL_expand_byte[5][(Pixel & 0x001F)]; \ } #define RGB_FROM_XRGB8888(Pixel, r, g, b) \ { \ @@ -386,7 +386,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); r = ((Pixel >> 22) & 0xFF); \ g = ((Pixel >> 12) & 0xFF); \ b = ((Pixel >> 2) & 0xFF); \ - a = SDL_expand_byte[6][(Pixel >> 30)]; \ + a = SDL_expand_byte[2][(Pixel >> 30)]; \ } #define RGBAFLOAT_FROM_ARGB2101010(Pixel, r, g, b, a) \ { \ @@ -400,7 +400,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface); r = ((Pixel >> 2) & 0xFF); \ g = ((Pixel >> 12) & 0xFF); \ b = ((Pixel >> 22) & 0xFF); \ - a = SDL_expand_byte[6][(Pixel >> 30)]; \ + a = SDL_expand_byte[2][(Pixel >> 30)]; \ } #define RGBAFLOAT_FROM_ABGR2101010(Pixel, r, g, b, a) \ { \ From 02a072a1b7d7bb7aa74455c31e3b58c850e66186 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 16:25:00 -0700 Subject: [PATCH 372/431] Added SDL_ClearSurface() and SDL_ReadSurfacePixelFloat() --- include/SDL3/SDL_surface.h | 43 ++++++ src/dynapi/SDL_dynapi.sym | 2 + src/dynapi/SDL_dynapi_overrides.h | 2 + src/dynapi/SDL_dynapi_procs.h | 2 + src/video/SDL_surface.c | 219 ++++++++++++++++++++++++++---- 5 files changed, 243 insertions(+), 25 deletions(-) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 2ec66c563942b..a25ba2696100f 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -828,6 +828,25 @@ extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_ */ extern SDL_DECLSPEC int SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear); +/** + * Clear a surface with a specific color, with floating point precision. + * + * This function handles all surface formats, and ignores any clip rectangle. + * + * If the surface is YUV, the color is assumed to be in the sRGB colorspace, otherwise the color is assumed to be in the colorspace of the suface. + * + * \param surface the SDL_Surface to clear. + * \param r the red component of the pixel, normally in the range 0-1 + * \param g the green component of the pixel, normally in the range 0-1 + * \param b the blue component of the pixel, normally in the range 0-1 + * \param a the alpha component of the pixel, normally in the range 0-1 + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC int SDLCALL SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a); + /** * Perform a fast fill of a rectangle with a specific color. * @@ -1138,6 +1157,30 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_MapSurfaceRGBA(SDL_Surface *surface, Uint */ extern SDL_DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a); +/** + * Retrieves a single pixel from a surface. + * + * This function prioritizes correctness over speed: it is suitable for unit + * tests, but is not intended for use in a game engine. + * + * \param surface the surface to read. + * \param x the horizontal coordinate, 0 <= x < width. + * \param y the vertical coordinate, 0 <= y < height. + * \param r a pointer filled in with the red channel, normally in the range 0-1, or NULL to ignore + * this channel. + * \param g a pointer filled in with the green channel, normally in the range 0-1, or NULL to + * ignore this channel. + * \param b a pointer filled in with the blue channel, normally in the range 0-1, or NULL to + * ignore this channel. + * \param a a pointer filled in with the alpha channel, normally in the range 0-1, or NULL to + * ignore this channel. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. + * + * \since This function is available since SDL 3.0.0. + */ +extern SDL_DECLSPEC int SDLCALL SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a); + /* Ends C function definitions when using C++ */ #ifdef __cplusplus } diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 04675387d39ab..8e7734bddb23a 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -35,6 +35,7 @@ SDL3_0.0.0 { SDL_ClearComposition; SDL_ClearError; SDL_ClearProperty; + SDL_ClearSurface; SDL_CloseAudioDevice; SDL_CloseCamera; SDL_CloseGamepad; @@ -627,6 +628,7 @@ SDL3_0.0.0 { SDL_ReadS8; SDL_ReadStorageFile; SDL_ReadSurfacePixel; + SDL_ReadSurfacePixelFloat; SDL_ReadU16BE; SDL_ReadU16LE; SDL_ReadU32BE; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index c25827219b61a..cb95d19ef1061 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -60,6 +60,7 @@ #define SDL_ClearComposition SDL_ClearComposition_REAL #define SDL_ClearError SDL_ClearError_REAL #define SDL_ClearProperty SDL_ClearProperty_REAL +#define SDL_ClearSurface SDL_ClearSurface_REAL #define SDL_CloseAudioDevice SDL_CloseAudioDevice_REAL #define SDL_CloseCamera SDL_CloseCamera_REAL #define SDL_CloseGamepad SDL_CloseGamepad_REAL @@ -652,6 +653,7 @@ #define SDL_ReadS8 SDL_ReadS8_REAL #define SDL_ReadStorageFile SDL_ReadStorageFile_REAL #define SDL_ReadSurfacePixel SDL_ReadSurfacePixel_REAL +#define SDL_ReadSurfacePixelFloat SDL_ReadSurfacePixelFloat_REAL #define SDL_ReadU16BE SDL_ReadU16BE_REAL #define SDL_ReadU16LE SDL_ReadU16LE_REAL #define SDL_ReadU32BE SDL_ReadU32BE_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index a25da1aa1de00..f384bd9839d97 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -80,6 +80,7 @@ SDL_DYNAPI_PROC(int,SDL_ClearClipboardData,(void),(),return) SDL_DYNAPI_PROC(int,SDL_ClearComposition,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ClearError,(void),(),return) SDL_DYNAPI_PROC(int,SDL_ClearProperty,(SDL_PropertiesID a, const char *b),(a,b),return) +SDL_DYNAPI_PROC(int,SDL_ClearSurface,(SDL_Surface *a, float b, float c, float d, float e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(void,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseCamera,(SDL_Camera *a),(a),) SDL_DYNAPI_PROC(void,SDL_CloseGamepad,(SDL_Gamepad *a),(a),) @@ -663,6 +664,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS64LE,(SDL_IOStream *a, Sint64 *b),(a,b),return SDL_DYNAPI_PROC(SDL_bool,SDL_ReadS8,(SDL_IOStream *a, Sint8 *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_ReadStorageFile,(SDL_Storage *a, const char *b, void *c, Uint64 d),(a,b,c,d),return) SDL_DYNAPI_PROC(int,SDL_ReadSurfacePixel,(SDL_Surface *a, int b, int c, Uint8 *d, Uint8 *e, Uint8 *f, Uint8 *g),(a,b,c,d,e,f,g),return) +SDL_DYNAPI_PROC(int,SDL_ReadSurfacePixelFloat,(SDL_Surface *a, int b, int c, float *d, float *e, float *f, float *g),(a,b,c,d,e,f,g),return) SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU16BE,(SDL_IOStream *a, Uint16 *b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU16LE,(SDL_IOStream *a, Uint16 *b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_ReadU32BE,(SDL_IOStream *a, Uint32 *b),(a,b),return) diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 50734c06c8e44..bffa879395eec 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -1991,6 +1991,63 @@ int SDL_PremultiplySurfaceAlpha(SDL_Surface *surface, SDL_bool linear) return SDL_PremultiplyAlphaPixelsAndColorspace(surface->w, surface->h, surface->format, colorspace, surface->internal->props, surface->pixels, surface->pitch, surface->format, colorspace, surface->internal->props, surface->pixels, surface->pitch, linear); } +int SDL_ClearSurface(SDL_Surface *surface, float r, float g, float b, float a) +{ + SDL_Rect clip_rect; + int result = -1; + + if (!SDL_SurfaceValid(surface)) { + return SDL_InvalidParamError("surface"); + } + + SDL_GetSurfaceClipRect(surface, &clip_rect); + SDL_SetSurfaceClipRect(surface, NULL); + + if (!SDL_ISPIXELFORMAT_FOURCC(surface->format) && + SDL_BYTESPERPIXEL(surface->format) <= sizeof(Uint32)) { + Uint32 color; + + color = SDL_MapSurfaceRGBA(surface, + (Uint8)SDL_roundf(SDL_clamp(r, 0.0f, 1.0f) * 255.0f), + (Uint8)SDL_roundf(SDL_clamp(g, 0.0f, 1.0f) * 255.0f), + (Uint8)SDL_roundf(SDL_clamp(b, 0.0f, 1.0f) * 255.0f), + (Uint8)SDL_roundf(SDL_clamp(a, 0.0f, 1.0f) * 255.0f)); + result = SDL_FillSurfaceRect(surface, NULL, color); + } else if (SDL_ISPIXELFORMAT_FOURCC(surface->format)) { + // We can't directly set an RGB value on a YUV surface + SDL_Surface *tmp = SDL_CreateSurface(surface->w, surface->h, SDL_PIXELFORMAT_ARGB8888); + if (!tmp) { + goto done; + } + + if (SDL_ClearSurface(tmp, r, g, b, a) == 0) { + result = SDL_ConvertPixelsAndColorspace(surface->w, surface->h, tmp->format, SDL_GetSurfaceColorspace(tmp), tmp->internal->props, tmp->pixels, tmp->pitch, surface->format, SDL_GetSurfaceColorspace(surface), surface->internal->props, surface->pixels, surface->pitch); + } + SDL_DestroySurface(tmp); + } else { + // Take advantage of blit color conversion + SDL_Surface *tmp = SDL_CreateSurface(1, 1, SDL_PIXELFORMAT_RGBA128_FLOAT); + if (!tmp) { + goto done; + } + SDL_SetSurfaceColorspace(tmp, SDL_GetSurfaceColorspace(surface)); + + float *pixels = (float *)tmp->pixels; + pixels[0] = r; + pixels[1] = g; + pixels[2] = b; + pixels[3] = a; + + result = SDL_BlitSurfaceScaled(tmp, NULL, surface, NULL, SDL_SCALEMODE_NEAREST); + SDL_DestroySurface(tmp); + } + +done: + SDL_SetSurfaceClipRect(surface, &clip_rect); + + return result; +} + Uint32 SDL_MapSurfaceRGB(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b) { return SDL_MapSurfaceRGBA(surface, r, g, b, SDL_ALPHA_OPAQUE); @@ -2014,32 +2071,40 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *p; int result = -1; - if (!surface || !surface->format || !surface->pixels) { - return SDL_InvalidParamError("surface"); + if (r) { + *r = 0; + } else { + r = &unused; } - if (x < 0 || x >= surface->w) { - return SDL_InvalidParamError("x"); + if (g) { + *g = 0; + } else { + g = &unused; } - if (y < 0 || y >= surface->h) { - return SDL_InvalidParamError("y"); + if (b) { + *b = 0; + } else { + b = &unused; } - if (!r) { - r = &unused; + if (a) { + *a = 0; + } else { + a = &unused; } - if (!g) { - g = &unused; + if (!SDL_SurfaceValid(surface) || !surface->format || !surface->pixels) { + return SDL_InvalidParamError("surface"); } - if (!b) { - b = &unused; + if (x < 0 || x >= surface->w) { + return SDL_InvalidParamError("x"); } - if (!a) { - a = &unused; + if (y < 0 || y >= surface->h) { + return SDL_InvalidParamError("y"); } bytes_per_pixel = SDL_BYTESPERPIXEL(surface->format); @@ -2052,7 +2117,24 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, p = (Uint8 *)surface->pixels + y * surface->pitch + x * bytes_per_pixel; - if (bytes_per_pixel > sizeof(pixel)) { + if (bytes_per_pixel <= sizeof(pixel) && !SDL_ISPIXELFORMAT_FOURCC(surface->format)) { + /* Fill the appropriate number of least-significant bytes of pixel, + * leaving the most-significant bytes set to zero */ +#if SDL_BYTEORDER == SDL_BIG_ENDIAN + SDL_memcpy(((Uint8 *)&pixel) + (sizeof(pixel) - bytes_per_pixel), p, bytes_per_pixel); +#else + SDL_memcpy(&pixel, p, bytes_per_pixel); +#endif + SDL_GetRGBA(pixel, surface->internal->format, surface->internal->palette, r, g, b, a); + result = 0; + } else if (SDL_ISPIXELFORMAT_FOURCC(surface->format)) { + // FIXME: We need code to extract a single macroblock from a YUV surface + SDL_Surface *converted = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ARGB8888); + if (converted) { + result = SDL_ReadSurfacePixel(converted, x, y, r, g, b, a); + SDL_DestroySurface(converted); + } + } else { /* This is really slow, but it gets the job done */ Uint8 rgba[4]; SDL_Colorspace colorspace = SDL_GetSurfaceColorspace(surface); @@ -2064,16 +2146,6 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, *a = rgba[3]; result = 0; } - } else { - /* Fill the appropriate number of least-significant bytes of pixel, - * leaving the most-significant bytes set to zero */ -#if SDL_BYTEORDER == SDL_BIG_ENDIAN - SDL_memcpy(((Uint8 *)&pixel) + (sizeof(pixel) - bytes_per_pixel), p, bytes_per_pixel); -#else - SDL_memcpy(&pixel, p, bytes_per_pixel); -#endif - SDL_GetRGBA(pixel, surface->internal->format, surface->internal->palette, r, g, b, a); - result = 0; } if (SDL_MUSTLOCK(surface)) { @@ -2082,6 +2154,103 @@ int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, return result; } +int SDL_ReadSurfacePixelFloat(SDL_Surface *surface, int x, int y, float *r, float *g, float *b, float *a) +{ + float unused; + int result = -1; + + if (r) { + *r = 0.0f; + } else { + r = &unused; + } + + if (g) { + *g = 0.0f; + } else { + g = &unused; + } + + if (b) { + *b = 0.0f; + } else { + b = &unused; + } + + if (a) { + *a = 0.0f; + } else { + a = &unused; + } + + if (!SDL_SurfaceValid(surface) || !surface->format || !surface->pixels) { + return SDL_InvalidParamError("surface"); + } + + if (x < 0 || x >= surface->w) { + return SDL_InvalidParamError("x"); + } + + if (y < 0 || y >= surface->h) { + return SDL_InvalidParamError("y"); + } + + if (SDL_BYTESPERPIXEL(surface->format) <= sizeof(Uint32) && !SDL_ISPIXELFORMAT_FOURCC(surface->format)) { + Uint8 r8, g8, b8, a8; + + if (SDL_ReadSurfacePixel(surface, x, y, &r8, &g8, &b8, &a8) == 0) { + *r = (float)r8 / 255.0f; + *g = (float)g8 / 255.0f; + *b = (float)b8 / 255.0f; + *a = (float)a8 / 255.0f; + result = 0; + } + } else if (SDL_ISPIXELFORMAT_FOURCC(surface->format)) { + // FIXME: We need code to extract a single macroblock from a YUV surface + SDL_Surface *converted = SDL_ConvertSurface(surface, SDL_PIXELFORMAT_ARGB8888); + if (converted) { + result = SDL_ReadSurfacePixelFloat(converted, x, y, r, g, b, a); + SDL_DestroySurface(converted); + } + } else { + /* This is really slow, but it gets the job done */ + float rgba[4]; + Uint8 *p; + + if (SDL_MUSTLOCK(surface)) { + if (SDL_LockSurface(surface) < 0) { + return -1; + } + } + + p = (Uint8 *)surface->pixels + y * surface->pitch + x * SDL_BYTESPERPIXEL(surface->format); + + if (surface->format == SDL_PIXELFORMAT_RGBA128_FLOAT) { + SDL_memcpy(rgba, p, sizeof(rgba)); + result = 0; + } else { + SDL_Colorspace src_colorspace = SDL_GetSurfaceColorspace(surface); + SDL_Colorspace dst_colorspace = (src_colorspace == SDL_COLORSPACE_SRGB_LINEAR ? SDL_COLORSPACE_SRGB_LINEAR : SDL_COLORSPACE_SRGB); + + if (SDL_ConvertPixelsAndColorspace(1, 1, surface->format, src_colorspace, surface->internal->props, p, surface->pitch, SDL_PIXELFORMAT_RGBA128_FLOAT, dst_colorspace, 0, rgba, sizeof(rgba)) == 0) { + result = 0; + } + } + + if (result == 0) { + *r = rgba[0]; + *g = rgba[1]; + *b = rgba[2]; + *a = rgba[3]; + } + + if (SDL_MUSTLOCK(surface)) { + SDL_UnlockSurface(surface); + } + } + return result; +} + /* * Free a surface created by the above function. */ From 38a301a3f93eb8384bd99a0dad2c9eb2c8ccc220 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 16:30:45 -0700 Subject: [PATCH 373/431] Added automated tests to verify SDL_ClearSurface() and SDL_PremultiplySurfaceAlpha() --- test/testautomation_surface.c | 111 +++++++++++++++++++++++++++++++++- 1 file changed, 110 insertions(+), 1 deletion(-) diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index f3e266baebf64..745d89d99139c 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -924,6 +924,106 @@ static int surface_testPalette(void *arg) return TEST_COMPLETED; } +static int surface_testClearSurface(void *arg) +{ + SDL_PixelFormat formats[] = { + SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_ABGR2101010, + SDL_PIXELFORMAT_ARGB64, SDL_PIXELFORMAT_RGBA64, + SDL_PIXELFORMAT_ARGB128_FLOAT, SDL_PIXELFORMAT_RGBA128_FLOAT, + SDL_PIXELFORMAT_YV12, SDL_PIXELFORMAT_UYVY, SDL_PIXELFORMAT_NV12 + }; + SDL_Surface *surface; + SDL_PixelFormat format; + const float MAXIMUM_ERROR_RGB = 0.0001f; + const float MAXIMUM_ERROR_YUV = 0.01f; + float srcR = 10 / 255.0f, srcG = 128 / 255.0f, srcB = 240 / 255.0f, srcA = 1.0f; + float actualR, actualG, actualB, actualA; + float deltaR, deltaG, deltaB, deltaA; + int i, ret; + + for (i = 0; i < SDL_arraysize(formats); ++i) { + const float MAXIMUM_ERROR = SDL_ISPIXELFORMAT_FOURCC(formats[i]) ? MAXIMUM_ERROR_YUV : MAXIMUM_ERROR_RGB; + + format = formats[i]; + + surface = SDL_CreateSurface(1, 1, format); + SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); + ret = SDL_ClearSurface(surface, srcR, srcG, srcB, srcA); + SDLTest_AssertCheck(ret == 0, "SDL_ClearSurface()"); + ret = SDL_ReadSurfacePixelFloat(surface, 0, 0, &actualR, &actualG, &actualB, &actualA); + SDLTest_AssertCheck(ret == 0, "SDL_ReadSurfacePixelFloat()"); + deltaR = SDL_fabsf(actualR - srcR); + deltaG = SDL_fabsf(actualG - srcG); + deltaB = SDL_fabsf(actualB - srcB); + deltaA = SDL_fabsf(actualA - srcA); + SDLTest_AssertCheck( + deltaR <= MAXIMUM_ERROR && + deltaG <= MAXIMUM_ERROR && + deltaB <= MAXIMUM_ERROR && + deltaA <= MAXIMUM_ERROR, + "Checking %s surface clear results, expected %.4f,%.4f,%.4f,%.4f, got %.4f,%.4f,%.4f,%.4f", + SDL_GetPixelFormatName(format), + srcR, srcG, srcB, srcA, actualR, actualG, actualB, actualA); + + SDL_DestroySurface(surface); + } + + return TEST_COMPLETED; +} + +static int surface_testPremultiplyAlpha(void *arg) +{ + SDL_PixelFormat formats[] = { + SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGBA8888, + SDL_PIXELFORMAT_ARGB2101010, SDL_PIXELFORMAT_ABGR2101010, + SDL_PIXELFORMAT_ARGB64, SDL_PIXELFORMAT_RGBA64, + SDL_PIXELFORMAT_ARGB128_FLOAT, SDL_PIXELFORMAT_RGBA128_FLOAT, + }; + SDL_Surface *surface; + SDL_PixelFormat format; + const float MAXIMUM_ERROR_LOW_PRECISION = 1 / 255.0f; + const float MAXIMUM_ERROR_HIGH_PRECISION = 0.0001f; + float srcR = 10 / 255.0f, srcG = 128 / 255.0f, srcB = 240 / 255.0f, srcA = 170 / 255.0f; + float expectedR = srcR * srcA; + float expectedG = srcG * srcA; + float expectedB = srcB * srcA; + float actualR, actualG, actualB; + float deltaR, deltaG, deltaB; + int i, ret; + + for (i = 0; i < SDL_arraysize(formats); ++i) { + const float MAXIMUM_ERROR = (SDL_BITSPERPIXEL(formats[i]) > 32) ? MAXIMUM_ERROR_HIGH_PRECISION : MAXIMUM_ERROR_LOW_PRECISION; + + format = formats[i]; + + surface = SDL_CreateSurface(1, 1, format); + SDLTest_AssertCheck(surface != NULL, "SDL_CreateSurface()"); + ret = SDL_SetSurfaceColorspace(surface, SDL_COLORSPACE_SRGB); + SDLTest_AssertCheck(ret == 0, "SDL_SetSurfaceColorspace()"); + ret = SDL_ClearSurface(surface, srcR, srcG, srcB, srcA); + SDLTest_AssertCheck(ret == 0, "SDL_ClearSurface()"); + ret = SDL_PremultiplySurfaceAlpha(surface, SDL_FALSE); + SDLTest_AssertCheck(ret == 0, "SDL_PremultiplySurfaceAlpha()"); + ret = SDL_ReadSurfacePixelFloat(surface, 0, 0, &actualR, &actualG, &actualB, NULL); + SDLTest_AssertCheck(ret == 0, "SDL_ReadSurfacePixelFloat()"); + deltaR = SDL_fabsf(actualR - expectedR); + deltaG = SDL_fabsf(actualG - expectedG); + deltaB = SDL_fabsf(actualB - expectedB); + SDLTest_AssertCheck( + deltaR <= MAXIMUM_ERROR && + deltaG <= MAXIMUM_ERROR && + deltaB <= MAXIMUM_ERROR, + "Checking %s alpha premultiply results, expected %.4f,%.4f,%.4f, got %.4f,%.4f,%.4f", + SDL_GetPixelFormatName(format), + expectedR, expectedG, expectedB, actualR, actualG, actualB); + + SDL_DestroySurface(surface); + } + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ @@ -992,12 +1092,21 @@ static const SDLTest_TestCaseReference surfaceTestPalette = { surface_testPalette, "surface_testPalette", "Test surface palette operations.", TEST_ENABLED }; +static const SDLTest_TestCaseReference surfaceTestClearSurface = { + surface_testClearSurface, "surface_testClearSurface", "Test clear surface operations.", TEST_ENABLED +}; + +static const SDLTest_TestCaseReference surfaceTestPremultiplyAlpha = { + surface_testPremultiplyAlpha, "surface_testPremultiplyAlpha", "Test alpha premultiply operations.", TEST_ENABLED +}; + /* Sequence of Surface test cases */ static const SDLTest_TestCaseReference *surfaceTests[] = { &surfaceTest1, &surfaceTest2, &surfaceTest3, &surfaceTest4, &surfaceTest5, &surfaceTest6, &surfaceTest7, &surfaceTest8, &surfaceTest9, &surfaceTest10, &surfaceTest11, &surfaceTest12, &surfaceTest13, - &surfaceTestOverflow, &surfaceTestFlip, &surfaceTestPalette, NULL + &surfaceTestOverflow, &surfaceTestFlip, &surfaceTestPalette, + &surfaceTestClearSurface, &surfaceTestPremultiplyAlpha, NULL }; /* Surface test suite (global) */ From e949f12f63cdfcef4bdf456936ee676e0a3f9de6 Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Thu, 18 Jul 2024 01:04:46 +0000 Subject: [PATCH 374/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_surface.h | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index a25ba2696100f..84dca445bbae2 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -806,7 +806,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_ConvertPixelsAndColorspace(int width, int he * \param dst_format an SDL_PixelFormat value of the `dst` pixels format. * \param dst a pointer to be filled in with premultiplied pixel data. * \param dst_pitch the pitch of the destination pixels, in bytes. - * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha multiplication, SDL_FALSE to do multiplication in sRGB space. + * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha + * multiplication, SDL_FALSE to do multiplication in sRGB space. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -820,7 +821,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height, SDL_ * This is safe to use with src == dst, but not for other overlapping areas. * * \param surface the surface to modify. - * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha multiplication, SDL_FALSE to do multiplication in sRGB space. + * \param linear SDL_TRUE to convert from sRGB to linear space for the alpha + * multiplication, SDL_FALSE to do multiplication in sRGB space. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -833,13 +835,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_PremultiplySurfaceAlpha(SDL_Surface *surface * * This function handles all surface formats, and ignores any clip rectangle. * - * If the surface is YUV, the color is assumed to be in the sRGB colorspace, otherwise the color is assumed to be in the colorspace of the suface. + * If the surface is YUV, the color is assumed to be in the sRGB colorspace, + * otherwise the color is assumed to be in the colorspace of the suface. * * \param surface the SDL_Surface to clear. - * \param r the red component of the pixel, normally in the range 0-1 - * \param g the green component of the pixel, normally in the range 0-1 - * \param b the blue component of the pixel, normally in the range 0-1 - * \param a the alpha component of the pixel, normally in the range 0-1 + * \param r the red component of the pixel, normally in the range 0-1. + * \param g the green component of the pixel, normally in the range 0-1. + * \param b the blue component of the pixel, normally in the range 0-1. + * \param a the alpha component of the pixel, normally in the range 0-1. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * @@ -1166,14 +1169,14 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x * \param surface the surface to read. * \param x the horizontal coordinate, 0 <= x < width. * \param y the vertical coordinate, 0 <= y < height. - * \param r a pointer filled in with the red channel, normally in the range 0-1, or NULL to ignore - * this channel. - * \param g a pointer filled in with the green channel, normally in the range 0-1, or NULL to - * ignore this channel. - * \param b a pointer filled in with the blue channel, normally in the range 0-1, or NULL to - * ignore this channel. - * \param a a pointer filled in with the alpha channel, normally in the range 0-1, or NULL to - * ignore this channel. + * \param r a pointer filled in with the red channel, normally in the range + * 0-1, or NULL to ignore this channel. + * \param g a pointer filled in with the green channel, normally in the range + * 0-1, or NULL to ignore this channel. + * \param b a pointer filled in with the blue channel, normally in the range + * 0-1, or NULL to ignore this channel. + * \param a a pointer filled in with the alpha channel, normally in the range + * 0-1, or NULL to ignore this channel. * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * From 9af7a80767a8e69aa919a41102bb7ed30c4e305b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 09:27:16 -0700 Subject: [PATCH 375/431] OpenGL ES is still available on iOS --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f75f0654f6b6d..2745f9761a272 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,7 +288,7 @@ dep_option(SDL_DUMMYAUDIO "Support the dummy audio driver" ON "SDL_AUDI dep_option(SDL_DUMMYVIDEO "Use dummy video driver" ON "SDL_VIDEO" OFF) dep_option(SDL_IBUS "Enable IBus support" ON "${UNIX_SYS}" OFF) dep_option(SDL_OPENGL "Include OpenGL support" ON "SDL_VIDEO;NOT IOS;NOT VISIONOS;NOT TVOS;NOT WATCHOS" OFF) -dep_option(SDL_OPENGLES "Include OpenGL ES support" ON "SDL_VIDEO;NOT IOS;NOT VISIONOS;NOT TVOS;NOT WATCHOS" OFF) +dep_option(SDL_OPENGLES "Include OpenGL ES support" ON "SDL_VIDEO;NOT VISIONOS;NOT TVOS;NOT WATCHOS" OFF) set_option(SDL_PTHREADS "Use POSIX threads for multi-threading" ${SDL_PTHREADS_DEFAULT}) dep_option(SDL_PTHREADS_SEM "Use pthread semaphores" ON "SDL_PTHREADS" OFF) dep_option(SDL_OSS "Support the OSS audio API" ${SDL_OSS_DEFAULT} "UNIX_SYS OR RISCOS;SDL_AUDIO" OFF) From 7d83e03ac2866435d32ef73ccb9fe50eab89f27f Mon Sep 17 00:00:00 2001 From: vanfanel Date: Thu, 18 Jul 2024 21:21:52 +0200 Subject: [PATCH 376/431] Fix KMSDRM double buffering. (cherry picked from commit 5ab1151508ef514b9c5f944da8fc1f3dd6ea0558) --- src/video/kmsdrm/SDL_kmsdrmopengles.c | 2 +- src/video/kmsdrm/SDL_kmsdrmvideo.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c index a39bad0841117..059bd204e8a21 100644 --- a/src/video/kmsdrm/SDL_kmsdrmopengles.c +++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c @@ -192,7 +192,7 @@ int KMSDRM_GLES_SwapWindow(SDL_VideoDevice *_this, SDL_Window *window) we have waited here, there won't be a pending pageflip so the WaitPageflip at the beginning of this function will be a no-op. Just leave it here and don't worry. - Run your SDL program with "SDL_KMSDRM_DOUBLE_BUFFER=1 " + Run your SDL program with "SDL_VIDEO_DOUBLE_BUFFER=1 " to enable this. */ if (windata->double_buffer) { if (!KMSDRM_WaitPageflip(_this, windata)) { diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 8de8d77649f06..224d4cc57ffa3 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -1567,6 +1567,12 @@ int KMSDRM_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti SDL_SetNumberProperty(props, SDL_PROP_WINDOW_KMSDRM_DRM_FD_NUMBER, viddata->drm_fd); SDL_SetPointerProperty(props, SDL_PROP_WINDOW_KMSDRM_GBM_DEVICE_POINTER, viddata->gbm_dev); + /* Do we want a double buffering scheme to get low video lag? */ + windata->double_buffer = SDL_FALSE; + if (SDL_GetHintBoolean(SDL_HINT_VIDEO_DOUBLE_BUFFER, SDL_FALSE)) { + windata->double_buffer = SDL_TRUE; + } + if (!is_vulkan && !vulkan_mode) { /* NON-Vulkan block. */ /* Maybe you didn't ask for an OPENGL window, but that's what you will get. From c59771d7fc3abb82088cc80f2de40a0a9459ef38 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 18 Jul 2024 21:49:32 +0200 Subject: [PATCH 377/431] cmake: detect ARM64EC --- VisualC/pkg-support/cmake/sdl3-config.cmake | 2 +- cmake/sdlcpu.cmake | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/VisualC/pkg-support/cmake/sdl3-config.cmake b/VisualC/pkg-support/cmake/sdl3-config.cmake index a149e6aaf3444..9995847cde2b2 100644 --- a/VisualC/pkg-support/cmake/sdl3-config.cmake +++ b/VisualC/pkg-support/cmake/sdl3-config.cmake @@ -32,7 +32,7 @@ set(SDL3_FOUND TRUE) if(SDL_CPU_X86) set(_sdl_arch_subdir "x86") -elseif(SDL_CPU_X64) +elseif(SDL_CPU_X64 OR SDL_CPU_ARM64EC) set(_sdl_arch_subdir "x64") elseif(SDL_CPU_ARM64) set(_sdl_arch_subdir "arm64") diff --git a/cmake/sdlcpu.cmake b/cmake/sdlcpu.cmake index 3c22b2782c087..b0e75bf48b626 100644 --- a/cmake/sdlcpu.cmake +++ b/cmake/sdlcpu.cmake @@ -34,12 +34,13 @@ function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS) set(arch_check_ARM32 "defined(__arm__) || defined(_M_ARM)") set(arch_check_ARM64 "defined(__aarch64__) || defined(_M_ARM64)") + set(arch_check_ARM64EC "defined(_M_ARM64EC)") set(arch_check_EMSCRIPTEN "defined(__EMSCRIPTEN__)") set(arch_check_LOONGARCH64 "defined(__loongarch64)") set(arch_check_POWERPC32 "(defined(__PPC__) || defined(__powerpc__)) && !defined(__powerpc64__)") set(arch_check_POWERPC64 "defined(__PPC64__) || defined(__powerpc64__)") set(arch_check_X86 "defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) ||defined( __i386) || defined(_M_IX86)") - set(arch_check_X64 "defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)") + set(arch_check_X64 "(defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)") set(src_vars "") set(src_main "") From ccebbb6c6e9e67987902b9cd89bb5dfa1cb18e74 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 19 Jul 2024 00:28:49 +0200 Subject: [PATCH 378/431] Fix UWP build in non-UNICODE mode --- src/audio/wasapi/SDL_wasapi_winrt.cpp | 2 +- src/core/windows/SDL_windows.c | 2 +- src/file/SDL_iostream.c | 8 ++++---- src/filesystem/windows/SDL_sysfsops.c | 14 +++++++------- src/filesystem/winrt/SDL_sysfilesystem.cpp | 10 +++++----- src/loadso/windows/SDL_sysloadso.c | 10 +++++----- src/video/winrt/SDL_winrtmessagebox.cpp | 2 +- src/video/winrt/SDL_winrtvideo.cpp | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/audio/wasapi/SDL_wasapi_winrt.cpp b/src/audio/wasapi/SDL_wasapi_winrt.cpp index d4cafed11f49b..5c954ac80414a 100644 --- a/src/audio/wasapi/SDL_wasapi_winrt.cpp +++ b/src/audio/wasapi/SDL_wasapi_winrt.cpp @@ -145,7 +145,7 @@ void SDL_WasapiDeviceEventHandler::OnDeviceAdded(DeviceWatcher ^ sender, DeviceI available and switch automatically. (!!! FIXME...?) */ SDL_assert(sender == this->watcher); - char *utf8dev = WIN_StringToUTF8(info->Name->Data()); + char *utf8dev = WIN_StringToUTF8W(info->Name->Data()); if (utf8dev) { SDL_AudioSpec spec; SDL_zero(spec); diff --git a/src/core/windows/SDL_windows.c b/src/core/windows/SDL_windows.c index 961d4de801fe9..85d7ba07d2e3e 100644 --- a/src/core/windows/SDL_windows.c +++ b/src/core/windows/SDL_windows.c @@ -266,7 +266,7 @@ WASAPI doesn't need this. This is just for DirectSound/WinMM. char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid) { #if defined(SDL_PLATFORM_WINRT) || defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES) - return WIN_StringToUTF8(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */ + return WIN_StringToUTF8W(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */ #else static const GUID nullguid = { 0 }; const unsigned char *ptr; diff --git a/src/file/SDL_iostream.c b/src/file/SDL_iostream.c index cf7821c2555ee..0b0ecdfe5c861 100644 --- a/src/file/SDL_iostream.c +++ b/src/file/SDL_iostream.c @@ -119,19 +119,19 @@ static int SDLCALL windows_file_open(IOStreamWindowsData *iodata, const char *fi #endif { - LPTSTR tstr = WIN_UTF8ToString(filename); + LPWSTR str = WIN_UTF8ToStringW(filename); #if defined(SDL_PLATFORM_WINRT) CREATEFILE2_EXTENDED_PARAMETERS extparams; SDL_zero(extparams); extparams.dwSize = sizeof(extparams); extparams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL; - h = CreateFile2(tstr, + h = CreateFile2(str, (w_right | r_right), (w_right) ? 0 : FILE_SHARE_READ, (must_exist | truncate | a_mode), &extparams); #else - h = CreateFile(tstr, + h = CreateFileW(str, (w_right | r_right), (w_right) ? 0 : FILE_SHARE_READ, NULL, @@ -139,7 +139,7 @@ static int SDLCALL windows_file_open(IOStreamWindowsData *iodata, const char *fi FILE_ATTRIBUTE_NORMAL, NULL); #endif - SDL_free(tstr); + SDL_free(str); } #if !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) && !defined(SDL_PLATFORM_WINRT) diff --git a/src/filesystem/windows/SDL_sysfsops.c b/src/filesystem/windows/SDL_sysfsops.c index 6fe9e19c2d2c8..70d3c96967289 100644 --- a/src/filesystem/windows/SDL_sysfsops.c +++ b/src/filesystem/windows/SDL_sysfsops.c @@ -53,7 +53,7 @@ int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enumer // also prevent any wildcards inserted by the app from being respected. SDL_snprintf(pattern, patternlen, "%s\\*", path); - WCHAR *wpattern = WIN_UTF8ToString(pattern); + WCHAR *wpattern = WIN_UTF8ToStringW(pattern); SDL_free(pattern); if (!wpattern) { return -1; @@ -75,7 +75,7 @@ int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enumer } } - char *utf8fn = WIN_StringToUTF8(fn); + char *utf8fn = WIN_StringToUTF8W(fn); if (!utf8fn) { retval = -1; } else { @@ -92,7 +92,7 @@ int SDL_SYS_EnumerateDirectory(const char *path, const char *dirname, SDL_Enumer int SDL_SYS_RemovePath(const char *path) { - WCHAR *wpath = WIN_UTF8ToString(path); + WCHAR *wpath = WIN_UTF8ToStringW(path); if (!wpath) { return -1; } @@ -114,12 +114,12 @@ int SDL_SYS_RemovePath(const char *path) int SDL_SYS_RenamePath(const char *oldpath, const char *newpath) { - WCHAR *woldpath = WIN_UTF8ToString(oldpath); + WCHAR *woldpath = WIN_UTF8ToStringW(oldpath); if (!woldpath) { return -1; } - WCHAR *wnewpath = WIN_UTF8ToString(newpath); + WCHAR *wnewpath = WIN_UTF8ToStringW(newpath); if (!wnewpath) { SDL_free(woldpath); return -1; @@ -133,7 +133,7 @@ int SDL_SYS_RenamePath(const char *oldpath, const char *newpath) int SDL_SYS_CreateDirectory(const char *path) { - WCHAR *wpath = WIN_UTF8ToString(path); + WCHAR *wpath = WIN_UTF8ToStringW(path); if (!wpath) { return -1; } @@ -145,7 +145,7 @@ int SDL_SYS_CreateDirectory(const char *path) int SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info) { - WCHAR *wpath = WIN_UTF8ToString(path); + WCHAR *wpath = WIN_UTF8ToStringW(path); if (!wpath) { return -1; } diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index 2bd7c5bb4490f..fce36504832fa 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -113,7 +113,7 @@ extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType) return NULL; } - char *utf8Path = WIN_StringToUTF8(ucs2Path); + char *utf8Path = WIN_StringToUTF8W(ucs2Path); utf8Paths[pathType] = utf8Path; SDL_free(utf8Path); return utf8Paths[pathType].c_str(); @@ -176,12 +176,12 @@ extern "C" char *SDL_SYS_GetPrefPath(const char *org, const char *app) } SDL_wcslcpy(path, srcPath, SDL_arraysize(path)); - worg = WIN_UTF8ToString(org); + worg = WIN_UTF8ToStringW(org); if (!worg) { return NULL; } - wapp = WIN_UTF8ToString(app); + wapp = WIN_UTF8ToStringW(app); if (!wapp) { SDL_free(worg); return NULL; @@ -225,7 +225,7 @@ extern "C" char *SDL_SYS_GetPrefPath(const char *org, const char *app) SDL_wcslcat(path, L"\\", new_wpath_len + 1); - retval = WIN_StringToUTF8(path); + retval = WIN_StringToUTF8W(path); return retval; } @@ -257,7 +257,7 @@ char *SDL_SYS_GetUserFolder(SDL_Folder folder) wpath += L"\\"; - return WIN_StringToUTF8(wpath.c_str()); + return WIN_StringToUTF8W(wpath.c_str()); } #endif /* SDL_PLATFORM_WINRT */ diff --git a/src/loadso/windows/SDL_sysloadso.c b/src/loadso/windows/SDL_sysloadso.c index 6ddfb19bb038e..0c2b3e0d486a6 100644 --- a/src/loadso/windows/SDL_sysloadso.c +++ b/src/loadso/windows/SDL_sysloadso.c @@ -30,23 +30,23 @@ void *SDL_LoadObject(const char *sofile) { void *handle; - LPTSTR tstr; + LPWSTR wstr; if (!sofile) { SDL_InvalidParamError("sofile"); return NULL; } - tstr = WIN_UTF8ToString(sofile); + wstr = WIN_UTF8ToStringW(sofile); #ifdef SDL_PLATFORM_WINRT /* WinRT only publicly supports LoadPackagedLibrary() for loading .dll files. LoadLibrary() is a private API, and not available for apps (that can be published to MS' Windows Store.) */ - handle = (void *)LoadPackagedLibrary(tstr, 0); + handle = (void *)LoadPackagedLibrary(wstr, 0); #else - handle = (void *)LoadLibrary(tstr); + handle = (void *)LoadLibrary(wstr); #endif - SDL_free(tstr); + SDL_free(wstr); /* Generate an error message if all loads failed */ if (!handle) { diff --git a/src/video/winrt/SDL_winrtmessagebox.cpp b/src/video/winrt/SDL_winrtmessagebox.cpp index 4b204e8860dcd..648ce967bcb05 100644 --- a/src/video/winrt/SDL_winrtmessagebox.cpp +++ b/src/video/winrt/SDL_winrtmessagebox.cpp @@ -34,7 +34,7 @@ using namespace Windows::Foundation; using namespace Windows::UI::Popups; static String ^ WINRT_UTF8ToPlatformString(const char *str) { - wchar_t *wstr = WIN_UTF8ToString(str); + wchar_t *wstr = WIN_UTF8ToStringW(str); String ^ rtstr = ref new String(wstr); SDL_free(wstr); return rtstr; diff --git a/src/video/winrt/SDL_winrtvideo.cpp b/src/video/winrt/SDL_winrtvideo.cpp index 5c7bf0f29222f..7ede65be107e3 100644 --- a/src/video/winrt/SDL_winrtvideo.cpp +++ b/src/video/winrt/SDL_winrtvideo.cpp @@ -310,7 +310,7 @@ static int WINRT_AddDisplaysForOutput(SDL_VideoDevice *_this, IDXGIAdapter1 *dxg WIN_SetErrorFromHRESULT(__FUNCTION__ ", IDXGIOutput::FindClosestMatchingMode failed", hr); goto done; } else { - display.name = WIN_StringToUTF8(dxgiOutputDesc.DeviceName); + display.name = WIN_StringToUTF8W(dxgiOutputDesc.DeviceName); WINRT_DXGIModeToSDLDisplayMode(&closestMatch, &display.desktop_mode); hr = dxgiOutput->GetDisplayModeList(DXGI_FORMAT_B8G8R8A8_UNORM, 0, &numModes, NULL); From 2d1d3d9fb228e8f172e3d0bb7fae3e1b0426163f Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 18 Jul 2024 22:32:49 +0200 Subject: [PATCH 379/431] cmake: fix building UWP with non-MSVC generator --- CMakeLists.txt | 35 +++++++++++++++++++++++------------ cmake/test/CMakeLists.txt | 2 +- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2745f9761a272..e2e53b04e2726 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -411,8 +411,8 @@ if (LIBC_IS_GLIBC AND CMAKE_SIZEOF_VOID_P EQUAL 4) endif() if(WINDOWS_STORE) - sdl_compile_definitions(PRIVATE "SDL_BUILDING_WINRT=1") - sdl_compile_options(PRIVATE "-ZW") + sdl_compile_definitions(PRIVATE "SDL_BUILDING_WINRT=1" "WINAPI_FAMILY=WINAPI_FAMILY_APP") + sdl_compile_options(PRIVATE "$<$:/ZW>" "$<$:-EHsc>") endif() check_linker_supports_version_file(HAVE_WL_VERSION_SCRIPT) @@ -1937,16 +1937,27 @@ elseif(WINDOWS) set(SDL_THREAD_GENERIC_COND_SUFFIX 1) set(SDL_THREAD_GENERIC_RWLOCK_SUFFIX 1) set(SDL_THREAD_WINDOWS 1) - sdl_sources( - "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c" - "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syscond_cv.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysrwlock_srw.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syssem.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systhread.c" - "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systls.c" - ) + if(WINDOWS_STORE) + sdl_sources( + "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_syscond.cpp" + "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_sysmutex.cpp" + "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_sysrwlock.cpp" + "${SDL3_SOURCE_DIR}/src/thread/stdcpp/SDL_systhread.cpp" + "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syssem.c" + ) + else() + sdl_sources( + "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_syscond.c" + "${SDL3_SOURCE_DIR}/src/thread/generic/SDL_sysrwlock.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syscond_cv.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysmutex.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_sysrwlock_srw.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_syssem.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systhread.c" + "${SDL3_SOURCE_DIR}/src/thread/windows/SDL_systls.c" + ) + endif() + set(HAVE_SDL_THREADS TRUE) if(SDL_SENSOR AND HAVE_SENSORSAPI_H AND NOT WINDOWS_STORE) diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index caf99e15a7957..066a1ee4a3e4e 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -8,7 +8,7 @@ message(STATUS "CMAKE_SYSTEM_PROCESSOR= ${CMAKE_SYSTEM_PROCESSOR}") if(WINDOWS_STORE) enable_language(CXX) - add_compile_options(/ZW) + add_compile_options("$<$:/ZW>") set_source_files_properties(ain_cli.c main_gui.c PROPERTIES LANGUAGE CXX) endif() From a2a1d2de666d7e8e6c1017343ac42c8ec41a46e6 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 19 Jul 2024 10:04:16 +0200 Subject: [PATCH 380/431] Add HAVE_UNSETENV to preprocessor guard --- src/stdlib/SDL_getenv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stdlib/SDL_getenv.c b/src/stdlib/SDL_getenv.c index 4bcab40eceed9..ddc5ba4918d38 100644 --- a/src/stdlib/SDL_getenv.c +++ b/src/stdlib/SDL_getenv.c @@ -80,7 +80,7 @@ int SDL_setenv(const char *name, const char *value, int overwrite) return 0; } /* We have a real environment table, but no real setenv? Fake it w/ putenv. */ -#elif (defined(HAVE_GETENV) && defined(HAVE_PUTENV) && !defined(HAVE_SETENV)) +#elif (defined(HAVE_GETENV) && defined(HAVE_PUTENV) && defined(HAVE_UNSETENV) && !defined(HAVE_SETENV)) int SDL_setenv(const char *name, const char *value, int overwrite) { size_t len; From f8c1cd6622c0e9dfafa71e2c2d0e5cbca5fd901e Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Thu, 18 Jul 2024 21:56:35 +0200 Subject: [PATCH 381/431] ci: build MSVC workflows using Ninja generator --- .github/actions/setup-ninja/action.yml | 62 ++++++++++++++++++++++++++ .github/workflows/msvc.yml | 47 ++++++++++++------- CMakeLists.txt | 1 + 3 files changed, 95 insertions(+), 15 deletions(-) create mode 100644 .github/actions/setup-ninja/action.yml diff --git a/.github/actions/setup-ninja/action.yml b/.github/actions/setup-ninja/action.yml new file mode 100644 index 0000000000000..bf638eabae32b --- /dev/null +++ b/.github/actions/setup-ninja/action.yml @@ -0,0 +1,62 @@ +name: 'Setup ninja' +description: 'Setup ninja' +inputs: + version: + description: 'Ninja version' + default: '1.12.1' +runs: + using: 'composite' + steps: + - name: 'Calculate variables' + id: calc + shell: sh + run: | + case "${{ runner.os }}-${{ runner.arch }}" in + "Linux-X86" | "Linux-X64") + archive="ninja-linux.zip" + ;; + "Linux-ARM64") + archive="ninja-linux-aarch64.zip" + ;; + "macOS-X86" | "macOS-X64" | "macOS-ARM64") + archive="ninja-mac.zip" + ;; + "Windows-X86" | "Windows-X64") + archive="ninja-win.zip" + ;; + "Windows-ARM64") + archive="ninja-winarm64.zip" + ;; + *) + echo "Unsupported ${{ runner.os }}-${{ runner.arch }}" + exit 1; + ;; + esac + echo "archive=${archive}" >> ${GITHUB_OUTPUT} + echo "cache-key=${archive}-${{ inputs.version }}-${{ runner.os }}-${{ runner.arch }}" >> ${GITHUB_OUTPUT} + - name: 'Restore cached ${{ steps.calc.outputs.archive }}' + id: cache-restore + uses: actions/cache/restore@main + with: + path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Download ninja ${{ inputs.version }} for ${{ runner.os }} (${{ runner.arch }})' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + shell: pwsh + run: | + Invoke-WebRequest "https://github.com/ninja-build/ninja/releases/download/v${{ inputs.version }}/${{ steps.calc.outputs.archive }}" -OutFile "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" + - name: 'Cache ${{ steps.calc.outputs.archive }}' + if: ${{ !steps.cache-restore.outputs.cache-hit }} + uses: actions/cache/save@main + with: + path: '${{ runner.temp }}/${{ steps.calc.outputs.archive }}' + key: ${{ steps.calc.outputs.cache-key }} + - name: 'Extract libusb' + shell: pwsh + run: | + 7z "-o${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" x "${{ runner.temp }}/${{ steps.calc.outputs.archive }}" + - name: 'Set output variables' + id: final + shell: pwsh + run: | + echo "${{ runner.temp }}/ninja-${{ inputs.version }}-${{ runner.arch }}" >> $env:GITHUB_PATH diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 0aae792f33e9c..1bea16d6fbd14 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -15,17 +15,22 @@ jobs: fail-fast: false matrix: platform: - - { name: Windows (x64), flags: -A x64, project: VisualC/SDL.sln, projectflags: '/p:Platform=x64', libusb-arch: 'x64', artifact: 'SDL-VC-x64' } - - { name: Windows (x86), flags: -A Win32, project: VisualC/SDL.sln, projectflags: '/p:Platform=Win32', libusb-arch: 'x86', artifact: 'SDL-VC-x86' } - - { name: Windows (clang-cl x64), flags: -T ClangCL -A x64, artifact: 'SDL-clang-cl-x64' } - - { name: Windows (clang-cl x86), flags: -T ClangCL -A Win32, artifact: 'SDL-clang-cl-x86' } - - { name: Windows (ARM), flags: -A ARM, artifact: 'SDL-VC-arm32', notests: true } - - { name: Windows (ARM64), flags: -A ARM64, artifact: 'SDL-VC-arm64', notests: true } - - { name: UWP (x64), flags: -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0", nowerror: true, notests: true, - project: VisualC-WinRT/SDL-UWP.sln, projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0', artifact: 'SDL-VC-UWP' } + - { name: 'Windows (x64)', vcvars: 'x64', artifact: 'SDL-VC-x64', project: 'VisualC/SDL.sln', projectflags: '/p:Platform=x64', } + - { name: 'Windows (x86)', vcvars: 'x64_x86', artifact: 'SDL-VC-x86', project: 'VisualC/SDL.sln', projectflags: '/p:Platform=Win32', } + - { name: 'Windows (clang-cl x64)', vcvars: 'x64', artifact: 'SDL-clang-cl-x64', cmake-args: '-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl', cppflags: '/clang:-m64', ldflags: '/MACHINE:X64', } + - { name: 'Windows (clang-cl x86)', vcvars: 'x86', artifact: 'SDL-clang-cl-x86', cmake-args: '-DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl', cppflags: '/clang:-m32', ldflags: '/MACHINE:X86', } + - { name: 'Windows (ARM)', vcvars: 'x64_arm', artifact: 'SDL-VC-arm32', notests: true, } + - { name: 'Windows (ARM64)', vcvars: 'x64_arm64', artifact: 'SDL-VC-arm64', notests: true, } + - { name: 'UWP (x64)', vcvars: 'x64', artifact: 'SDL-VC-UWP', notests: true, cmake-args: '-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0" -DSDL_TESTS=OFF', + project: 'VisualC-WinRT/SDL-UWP.sln', projectflags: '/p:Platform=x64 /p:WindowsTargetPlatformVersion=10.0.17763.0', } steps: - uses: actions/checkout@v4 + - name: Set up ninja + uses: ./.github/actions/setup-ninja + - uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.platform.vcvars }} - name: Set up libusb uses: ./.github/actions/setup-msvc-libusb-action if: ${{ matrix.platform.libusb-arch != '' }} @@ -65,12 +70,18 @@ jobs: with open(f"{ builddir }/CMakeLists.txt", "w") as f: f.write(cmakelists_txt) - name: Configure (CMake) - run: cmake -S build -B build ` + run: cmake -S build -B build -GNinja ` -Wdeprecated -Wdev -Werror ` - -DSDL_WERROR=${{ !matrix.platform.nowerror }} ` + -DCMAKE_BUILD_TYPE=Release ` + -DSDL_WERROR=ON ` -DSDL_SHARED=ON ` -DSDL_STATIC=ON ` -DSDL_TESTS=ON ` + -DCMAKE_C_FLAGS="${{ matrix.platform.cppflags }}" ` + -DCMAKE_CXX_FLAGS="${{ matrix.platform.cppflags }}" ` + -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.platform.ldflags }}" ` + -DCMAKE_SHARED_LINKER_FLAGS="${{ matrix.platform.ldflags }}" ` + -DCMAKE_STATIC_LINKER_FLAGS="${{ matrix.platform.ldflags }}" ` -DSDL_INSTALL_TESTS=ON ` -DSDL_VENDOR_INFO="Github Workflow" ` -DSDL_DISABLE_INSTALL=OFF ` @@ -78,12 +89,12 @@ jobs: -DSDL_DISABLE_INSTALL_DOCS=OFF ` -DSDLTEST_PROCDUMP=ON ` -DLibUSB_ROOT="${{ steps.libusb.outputs.root }}" ` - ${{ matrix.platform.flags }} ` + ${{ matrix.platform.cmake-args }} ` -DCMAKE_INSTALL_PREFIX=prefix - name: Build (CMake) id: build run: | - cmake --build build/ --config Release --parallel + cmake --build build/ --config Release --verbose --parallel - name: Run build-time tests id: tests if: ${{ !matrix.platform.notests }} @@ -97,12 +108,18 @@ jobs: - name: Package (CPack) if: ${{ always() && steps.build.outcome == 'success' }} run: | - cmake --build build/ --config Release --target PACKAGE + cmake --build build/ --config Release --target package - name: Verify CMake configuration files run: | - cmake -S cmake/test -B cmake_config_build ` + cmake -S cmake/test -B cmake_config_build -GNinja ` + -DCMAKE_BUILD_TYPE=Release ` -DCMAKE_PREFIX_PATH=${{ env.SDL3_DIR }} ` - ${{ matrix.platform.flags }} + -DCMAKE_C_FLAGS="${{ matrix.platform.cppflags }}" ` + -DCMAKE_CXX_FLAGS="${{ matrix.platform.cppflags }}" ` + -DCMAKE_EXE_LINKER_FLAGS="${{ matrix.platform.ldflags }}" ` + -DCMAKE_SHARED_LINKER_FLAGS="${{ matrix.platform.ldflags }}" ` + -DCMAKE_STATIC_LINKER_FLAGS="${{ matrix.platform.ldflags }}" ` + ${{ matrix.platform.cmake-args }} cmake --build cmake_config_build --config Release - name: Add msbuild to PATH if: ${{ matrix.platform.project != '' }} diff --git a/CMakeLists.txt b/CMakeLists.txt index e2e53b04e2726..6cf1d243ea6f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2101,6 +2101,7 @@ elseif(WINDOWS) endif() endif() + enable_language(RC) sdl_glob_sources(SHARED "${SDL3_SOURCE_DIR}/src/core/windows/*.rc") if(MINGW OR CYGWIN) sdl_pc_link_options("-mwindows") From 25559faaea74318a2a575e6d3483e01f5833c14a Mon Sep 17 00:00:00 2001 From: Charlie Birks Date: Fri, 19 Jul 2024 11:19:59 +0100 Subject: [PATCH 382/431] emscripten: restore key event prevent default behaviour This restores the behaviour before 92215481146f9225a458e9a09abb85a33b52d9ff where we only preventDefault the event if: - the key is recognised - the event is enabled - the event is not filtered (ignoring the KEYPRESS special case, which is unchanged) (cherry picked from commit 6e931bee01b34a9f7a51579bcaf9a95f7f9451ce) --- src/video/emscripten/SDL_emscriptenevents.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/video/emscripten/SDL_emscriptenevents.c b/src/video/emscripten/SDL_emscriptenevents.c index 74fc3f1568e4e..6cfeeaed2cba2 100644 --- a/src/video/emscripten/SDL_emscriptenevents.c +++ b/src/video/emscripten/SDL_emscriptenevents.c @@ -458,7 +458,7 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent SDL_WindowData *window_data = (SDL_WindowData *)userData; SDL_Scancode scancode = Emscripten_MapScanCode(keyEvent->code); SDL_Keycode keycode = SDLK_UNKNOWN; - SDL_bool prevent_default = SDL_TRUE; + SDL_bool prevent_default = SDL_FALSE; SDL_bool is_nav_key = SDL_FALSE; if (scancode == SDL_SCANCODE_UNKNOWN) { @@ -511,9 +511,9 @@ static EM_BOOL Emscripten_HandleKey(int eventType, const EmscriptenKeyboardEvent } if (keycode != SDLK_UNKNOWN) { - SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); + prevent_default = SDL_SendKeyboardKeyAndKeycode(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, keycode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); } else { - SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); + prevent_default = SDL_SendKeyboardKey(0, SDL_DEFAULT_KEYBOARD_ID, 0, scancode, eventType == EMSCRIPTEN_EVENT_KEYDOWN ? SDL_PRESSED : SDL_RELEASED); } /* if TEXTINPUT events are enabled we can't prevent keydown or we won't get keypress From 0d24b6e9f36e8fa2b0c343b9b004f4fb452154e3 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Thu, 18 Jul 2024 16:33:01 -0400 Subject: [PATCH 383/431] wayland: Use the compositor provided size during state transitions Always use the size sent by the compositor when transitioning back to the floating state on the xdg-toplevel path, unless the client explicitly requested a new floating size while the window was in a fixed-size state. If a window is requested to be maximized or made fullscreen while an uncommitted size request is pending, the surface will first be committed so that the compositor will set the new size when the window is restored. Fixes the window being wrongly resized when leaving the maximized state in KDE. --- src/video/wayland/SDL_waylandwindow.c | 82 +++++++++++++++++++-------- src/video/wayland/SDL_waylandwindow.h | 2 + 2 files changed, 59 insertions(+), 25 deletions(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 853addbd82a9d..986275ecdac7f 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -484,9 +484,26 @@ static struct wl_callback_listener fullscreen_deadline_listener = { fullscreen_deadline_handler }; -static void FlushFullscreenEvents(SDL_Window *window) +static void maximized_deadline_handler(void *data, struct wl_callback *callback, uint32_t callback_data) { - while (window->internal->fullscreen_deadline_count) { + /* Get the window from the ID as it may have been destroyed */ + SDL_WindowID windowID = (SDL_WindowID)((uintptr_t)data); + SDL_Window *window = SDL_GetWindowFromID(windowID); + + if (window && window->internal) { + window->internal->maximized_deadline_count--; + } + + wl_callback_destroy(callback); +} + +static struct wl_callback_listener maximized_deadline_listener = { + maximized_deadline_handler +}; + +static void FlushPendingEvents(SDL_Window *window) +{ + while (window->internal->fullscreen_deadline_count || window->internal->maximized_deadline_count) { WAYLAND_wl_display_roundtrip(window->internal->waylandData->display); } } @@ -777,13 +794,14 @@ static void handle_configure_xdg_toplevel(void *data, * Ignore if less than or greater than max/min size. */ if (window->flags & SDL_WINDOW_RESIZABLE) { - if ((floating && !wind->floating) || + if ((floating && wind->pending_restored_size) || width == 0 || height == 0) { - /* This happens when we're being restored from a non-floating state, - * or the compositor indicates that the size is up to the client, so - * used the cached window size here. + /* This happens when we're being restored from a non-floating state + * with a pending floating client size, or the compositor indicates + * that the size is up to the client, so use the cached window size here. */ if (floating) { + wind->pending_restored_size = SDL_FALSE; width = window->floating.w; height = window->floating.h; } else { @@ -1158,27 +1176,22 @@ static void decoration_frame_configure(struct libdecor_frame *frame, OverrideLibdecorLimits(window); } else { - /* - * XXX: libdecor can send bogus content sizes that are +/- the height - * of the title bar when hiding a window or transitioning from - * non-floating to floating state, which distorts the window size. - * - * Ignore any size values from libdecor in these scenarios in - * favor of the cached window size. + /* XXX: The libdecor cairo plugin sends bogus content sizes that add the + * height of the title bar when transitioning from a fixed-size to + * floating state. Ignore the sent window dimensions in this case, + * in favor of the cached value to avoid the window increasing in + * size after every state transition. * - * https://gitlab.gnome.org/jadahl/libdecor/-/issues/40 + * https://gitlab.freedesktop.org/libdecor/libdecor/-/issues/34 */ - const SDL_bool use_cached_size = !maximized && !tiled && - ((floating && !wind->floating) || - (window->is_hiding || (window->flags & SDL_WINDOW_HIDDEN))); - - /* This will never set 0 for width/height unless the function returns false */ - if (use_cached_size || !libdecor_configuration_get_content_size(configuration, frame, &width, &height)) { + if ((floating && (wind->pending_restored_size || (!wind->floating && !(window->flags & SDL_WINDOW_BORDERLESS)))) || + !libdecor_configuration_get_content_size(configuration, frame, &width, &height)) { /* This happens when we're being restored from a non-floating state, * or the compositor indicates that the size is up to the client, so * used the cached window size here. */ if (floating) { + wind->pending_restored_size = SDL_FALSE; width = window->floating.w; height = window->floating.h; } else { @@ -2114,7 +2127,7 @@ int Wayland_SetWindowFullscreen(SDL_VideoDevice *_this, SDL_Window *window, } wind->drop_fullscreen_requests = SDL_TRUE; - FlushFullscreenEvents(window); + FlushPendingEvents(window); wind->drop_fullscreen_requests = SDL_FALSE; /* Nothing to do if the window is not fullscreen, and this isn't an explicit enter request. */ @@ -2223,6 +2236,7 @@ void Wayland_SetWindowResizable(SDL_VideoDevice *_this, SDL_Window *window, SDL_ void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) { + SDL_VideoData *viddata = _this->internal; SDL_WindowData *wind = window->internal; if (wind->show_hide_sync_required) { @@ -2234,6 +2248,9 @@ void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) if (!wind->shell_surface.libdecor.frame) { return; /* Can't do anything yet, wait for ShowWindow */ } + + /* Commit to preserve any pending size data. */ + wl_surface_commit(wind->surface); libdecor_frame_set_maximized(wind->shell_surface.libdecor.frame); } else #endif @@ -2241,8 +2258,15 @@ void Wayland_MaximizeWindow(SDL_VideoDevice *_this, SDL_Window *window) if (wind->shell_surface.xdg.roleobj.toplevel == NULL) { return; /* Can't do anything yet, wait for ShowWindow */ } + + /* Commit to preserve any pending size data. */ + wl_surface_commit(wind->surface); xdg_toplevel_set_maximized(wind->shell_surface.xdg.roleobj.toplevel); } + + ++wind->maximized_deadline_count; + struct wl_callback *cb = wl_display_sync(viddata->display); + wl_callback_add_listener(cb, &maximized_deadline_listener, (void *)((uintptr_t)window->id)); } void Wayland_MinimizeWindow(SDL_VideoDevice *_this, SDL_Window *window) @@ -2531,7 +2555,7 @@ int Wayland_SetWindowPosition(SDL_VideoDevice *_this, SDL_Window *window) * display via a set fullscreen call to make sure the window doesn't have a pending * leave fullscreen event that it might override. */ - FlushFullscreenEvents(window); + FlushPendingEvents(window); /* XXX: Need to restore this after the roundtrip, as the requested coordinates might * have been overwritten by the 'real' coordinates if a display enter/leave event @@ -2565,12 +2589,13 @@ void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) SDL_WindowData *wind = window->internal; /* Fullscreen windows do not get explicitly resized, and not strictly - * obeying the size of maximized windows is a protocol violation. + * obeying the size of maximized windows is a protocol violation, so + * it is necessary to flush any of these pending state operations. * * Calling this on a custom surface is informative, so the size must * always be passed through. */ - FlushFullscreenEvents(window); + FlushPendingEvents(window); if (!(window->flags & (SDL_WINDOW_FULLSCREEN | SDL_WINDOW_MAXIMIZED)) || wind->shell_surface_type == WAYLAND_SURFACE_CUSTOM) { @@ -2585,6 +2610,8 @@ void Wayland_SetWindowSize(SDL_VideoDevice *_this, SDL_Window *window) } ConfigureWindowGeometry(window); + } else { + wind->pending_restored_size = SDL_TRUE; } /* Always commit, as this may be in response to a min/max limit change. */ @@ -2641,7 +2668,12 @@ void Wayland_SetWindowTitle(SDL_VideoDevice *_this, SDL_Window *window) int Wayland_SyncWindow(SDL_VideoDevice *_this, SDL_Window *window) { - WAYLAND_wl_display_roundtrip(_this->internal->display); + SDL_WindowData *wind = window->internal; + + do { + WAYLAND_wl_display_roundtrip(_this->internal->display); + } while (wind->fullscreen_deadline_count || wind->maximized_deadline_count); + return 0; } diff --git a/src/video/wayland/SDL_waylandwindow.h b/src/video/wayland/SDL_waylandwindow.h index ffe762c37ed5a..01c30c767308b 100644 --- a/src/video/wayland/SDL_waylandwindow.h +++ b/src/video/wayland/SDL_waylandwindow.h @@ -157,6 +157,7 @@ struct SDL_WindowData SDL_DisplayID last_displayID; int fullscreen_deadline_count; + int maximized_deadline_count; Uint64 last_focus_event_time_ns; SDL_bool floating; SDL_bool suspended; @@ -168,6 +169,7 @@ struct SDL_WindowData SDL_bool show_hide_sync_required; SDL_bool scale_to_display; SDL_bool modal_reparenting_required; + SDL_bool pending_restored_size; SDL_bool double_buffer; SDL_HitTestResult hit_test_result; From d73c7311d50b7089150bc357cf3f0eff39735f28 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 23:20:23 -0700 Subject: [PATCH 384/431] Clarify that the SDL_GetStringRule means that SDL will automatically free the memory later. --- include/SDL3/SDL_audio.h | 15 ++++++--------- include/SDL3/SDL_camera.h | 6 +++--- include/SDL3/SDL_clipboard.h | 4 ++-- include/SDL3/SDL_events.h | 8 ++++---- include/SDL3/SDL_filesystem.h | 8 ++++---- include/SDL3/SDL_gamepad.h | 30 +++++++++++++++--------------- include/SDL3/SDL_haptic.h | 4 ++-- include/SDL3/SDL_hints.h | 2 +- include/SDL3/SDL_joystick.h | 10 +++++----- include/SDL3/SDL_keyboard.h | 6 +++--- include/SDL3/SDL_mouse.h | 2 +- include/SDL3/SDL_pen.h | 2 +- include/SDL3/SDL_pixels.h | 2 +- include/SDL3/SDL_platform.h | 2 +- include/SDL3/SDL_properties.h | 2 +- include/SDL3/SDL_render.h | 4 ++-- include/SDL3/SDL_sensor.h | 4 ++-- include/SDL3/SDL_storage.h | 2 +- include/SDL3/SDL_system.h | 8 ++++---- include/SDL3/SDL_thread.h | 2 +- include/SDL3/SDL_touch.h | 2 +- include/SDL3/SDL_version.h | 2 +- include/SDL3/SDL_video.h | 8 ++++---- 23 files changed, 66 insertions(+), 69 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index f1d7b394c756b..5eea64363abd5 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -400,7 +400,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); * "coreaudio" or "wasapi". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param index the index of the audio driver; the value ranges from 0 to * SDL_GetNumAudioDrivers() - 1. @@ -423,7 +423,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); * "coreaudio" or "wasapi". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the name of the current audio driver or NULL if no driver has been * initialized. @@ -495,7 +495,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioRecordingDevices(int /** * Get the human-readable name of a specific audio device. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param devid the instance ID of the device to query. * \returns the name of the audio device, or NULL on error. @@ -554,8 +554,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid * Audio devices usually have no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * The returned array follows the SDL_GetStringRule (even though, strictly - * speaking, it isn't a string, it has the same memory manangement rules). + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. * * \param devid the instance ID of the device to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -1096,8 +1095,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, * Audio streams default to no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * The returned array follows the SDL_GetStringRule (even though, strictly - * speaking, it isn't a string, it has the same memory manangement rules). + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -1122,8 +1120,7 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_Au * Audio streams default to no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * The returned array follows the SDL_GetStringRule (even though, strictly - * speaking, it isn't a string, it has the same memory manangement rules). + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index d91cb898c0cd7..96636a5b5ddce 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -134,7 +134,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void); * "coremedia" or "android". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param index the index of the camera driver; the value ranges from 0 to * SDL_GetNumCameraDrivers() - 1. @@ -156,7 +156,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index); * "coremedia" or "android". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the name of the current camera driver or NULL if no driver has * been initialized. @@ -230,7 +230,7 @@ extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraSupportedFormats(SDL_Ca /** * Get the human-readable device name for a camera. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the camera device instance ID. * \returns a human-readable device name, or NULL on error; call diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 1014481d7f922..44fecbec843ca 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -62,7 +62,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); * This functions returns empty string if there was not enough memory left for * a copy of the clipboard's content. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the clipboard text on success or an empty string on failure; call * SDL_GetError() for more information. @@ -106,7 +106,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); * This functions returns empty string if there was not enough memory left for * a copy of the primary selection's content. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the primary selection text on success or an empty string on * failure; call SDL_GetError() for more information. diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 97f6a553b6db8..b4aa0d7c009a4 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -350,7 +350,7 @@ typedef struct SDL_KeyboardEvent * will be inserted into the editing text. The length is the number of UTF-8 * characters that will be replaced by new typing. * - * The text string follows the SDL_GetStringRule. + * The text string follows the SDL_GetStringRule, and will be automatically freed later. * * \since This struct is available since SDL 3.0.0. */ @@ -368,7 +368,7 @@ typedef struct SDL_TextEditingEvent /** * Keyboard IME candidates event structure (event.edit_candidates.*) * - * The candidates follow the SDL_GetStringRule. + * The candidates follow the SDL_GetStringRule, and will be automatically freed later. * * \since This struct is available since SDL 3.0.0. */ @@ -387,7 +387,7 @@ typedef struct SDL_TextEditingCandidatesEvent /** * Keyboard text input event structure (event.text.*) * - * The text string follows the SDL_GetStringRule. + * The text string follows the SDL_GetStringRule, and will be automatically freed later. * * This event will never be delivered unless text input is enabled by calling * SDL_StartTextInput(). Text input is disabled by default! @@ -784,7 +784,7 @@ typedef struct SDL_PenButtonEvent * An event used to drop text or request a file open by the system * (event.drop.*) * - * The source and data strings follow the SDL_GetStringRule. + * The source and data strings follow the SDL_GetStringRule, and will be automatically freed later. * * \since This struct is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index 0650dbdeb0a07..ab8d174399ee4 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -68,7 +68,7 @@ extern "C" { * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns an absolute path in UTF-8 encoding to the application data * directory. NULL will be returned on error or when the platform @@ -123,7 +123,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetBasePath(void); * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param org the name of your organization. * \param app the name of your application. @@ -223,7 +223,7 @@ typedef enum SDL_Folder * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * If NULL is returned, the error may be obtained with SDL_GetError(). * @@ -354,7 +354,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * The returned pointer follows the SDL_GetStringRule. + * The returned pointer follows the SDL_GetStringRule, and will be automatically freed later. * * \param path the path of the directory to enumerate. * \param pattern the pattern that files in the directory must match. Can be diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index f8778fcb4fe6d..386f922cc5bb9 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -389,12 +389,12 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void); /** * Get the current gamepad mappings. * - * The returned pointer follows the SDL_GetStringRule. + * The returned pointer follows the SDL_GetStringRule, and will be automatically freed later. * * \param count a pointer filled in with the number of mappings returned, can * be NULL. * \returns an array of the mapping strings, NULL-terminated. Returns NULL on - * error. + * error; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -403,7 +403,7 @@ extern SDL_DECLSPEC const char * const * SDLCALL SDL_GetGamepadMappings(int *cou /** * Get the gamepad mapping string for a given GUID. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param guid a structure containing the GUID for which a mapping is desired. * \returns a mapping string or NULL on error; call SDL_GetError() for more @@ -419,7 +419,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_Joysti /** * Get the current mapping of a gamepad. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * Details about mappings are discussed with SDL_AddGamepadMapping(). * @@ -499,7 +499,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); * * This can be called before any gamepads are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the joystick instance ID. * \returns the name of the selected gamepad. If no name can be found, this @@ -517,7 +517,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID i * * This can be called before any gamepads are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the joystick instance ID. * \returns the path of the selected gamepad. If no path can be found, this @@ -650,7 +650,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_Joys * * This can be called before any gamepads are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the joystick instance ID. * \returns the mapping string. Returns NULL if no mapping is available. @@ -749,7 +749,7 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad /** * Get the implementation-dependent name for an opened gamepad. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). @@ -765,7 +765,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad) /** * Get the implementation-dependent path for an opened gamepad. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). @@ -892,7 +892,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *ga * * Returns the serial number of the gamepad, or NULL if it is not available. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param gamepad the gamepad object to query. * \returns the serial number, or NULL if unavailable. @@ -1052,7 +1052,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const c /** * Convert from an SDL_GamepadType enum to a string. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param type an enum value for a given SDL_GamepadType. * \returns a string for the given type, or NULL if an invalid type is @@ -1090,7 +1090,7 @@ extern SDL_DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const c /** * Convert from an SDL_GamepadAxis enum to a string. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param axis an enum value for a given SDL_GamepadAxis. * \returns a string for the given axis, or NULL if an invalid axis is @@ -1165,7 +1165,7 @@ extern SDL_DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(con /** * Convert from an SDL_GamepadButton enum to a string. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param button an enum value for a given SDL_GamepadButton. * \returns a string for the given button, or NULL if an invalid button is @@ -1453,7 +1453,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad); * Return the sfSymbolsName for a given button on a gamepad on Apple * platforms. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param gamepad the gamepad to query. * \param button a button on the gamepad. @@ -1468,7 +1468,7 @@ extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButto /** * Return the sfSymbolsName for a given axis on a gamepad on Apple platforms. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param gamepad the gamepad to query. * \param axis an axis on the gamepad. diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index aa858d3222be0..3ce52603e0a89 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -949,7 +949,7 @@ extern SDL_DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count); * * This can be called before any haptic devices are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the haptic device instance ID. * \returns the name of the selected haptic device. If no name can be found, @@ -1014,7 +1014,7 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic); /** * Get the implementation dependent name of a haptic device. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param haptic the SDL_Haptic obtained from SDL_OpenJoystick(). * \returns the name of the selected haptic device. If no name can be found, diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index f6c7cf338589c..bd96fd6af3c5d 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -3883,7 +3883,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); /** * Get the value of a hint. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index b9d044f3a9492..e1e1c7f16ec01 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -227,7 +227,7 @@ extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count); * * This can be called before any joysticks are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the joystick instance ID. * \returns the name of the selected joystick. If no name can be found, this @@ -245,7 +245,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID * * This can be called before any joysticks are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the joystick instance ID. * \returns the path of the selected joystick. If no path can be found, this @@ -666,7 +666,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst /** * Get the implementation dependent name of a joystick. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the name of the selected joystick. If no name can be found, this @@ -681,7 +681,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joysti /** * Get the implementation dependent path of a joystick. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the path of the selected joystick. If no path can be found, this @@ -800,7 +800,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick * * * Returns the serial number of the joystick, or NULL if it is not available. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the serial number of the selected joystick, or NULL if diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 9a5dd5decb871..fe5f7f90ae592 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -90,7 +90,7 @@ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); * * This function returns "" if the keyboard doesn't have a name. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the keyboard instance ID. * \returns the name of the selected keyboard, or NULL on failure; call @@ -280,7 +280,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const /** * Get a human-readable name for a scancode. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * **Warning**: The returned name is by design not stable across platforms, * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left @@ -326,7 +326,7 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam * * If the key doesn't have a name, this function returns an empty string (""). * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param key the desired SDL_Keycode to query. * \returns a UTF-8 encoded string of the key name. diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index a3f8f34d53f93..8c55399bd745f 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -152,7 +152,7 @@ extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); * * This function returns "" if the mouse doesn't have a name. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the mouse instance ID. * \returns the name of the selected mouse, or NULL on failure; call diff --git a/include/SDL3/SDL_pen.h b/include/SDL3/SDL_pen.h index 58031564fc5a9..3dadfb6bf792d 100644 --- a/include/SDL3/SDL_pen.h +++ b/include/SDL3/SDL_pen.h @@ -224,7 +224,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); /** * Retrieves a human-readable description for a SDL_PenID. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the pen to query. * \returns a string that contains the name of the pen, intended for human diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index 969d1fe7606f0..ecb7454958924 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -723,7 +723,7 @@ typedef struct SDL_PixelFormatDetails /** * Get the human readable name of a pixel format. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param format the pixel format to query. * \returns the human readable name of the specified pixel format or diff --git a/include/SDL3/SDL_platform.h b/include/SDL3/SDL_platform.h index b010f43f3200a..a811a6561b28c 100644 --- a/include/SDL3/SDL_platform.h +++ b/include/SDL3/SDL_platform.h @@ -48,7 +48,7 @@ extern "C" { * - "iOS" * - "Android" * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the name of the platform. If the correct platform name is not * available, returns a string beginning with the text "Unknown". diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index e68316162d556..40a128fa4019a 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -378,7 +378,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, /** * Get a string property from a group of properties. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param props the properties to query. * \param name the name of the property to query. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 6580f575bcff4..a1b1f2936c590 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -154,7 +154,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); * "direct3d12" or "metal". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param index the index of the rendering driver; the value ranges from 0 to * SDL_GetNumRenderDrivers() - 1. @@ -324,7 +324,7 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *render /** * Get the name of a renderer. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param renderer the rendering context. * \returns the name of the selected renderer, or NULL if the renderer is diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index f404b03529d02..6835440562d20 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -160,7 +160,7 @@ extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count); * * This can be called before any sensors are opened. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the sensor instance ID. * \returns the sensor name, or NULL if `instance_id` is not valid. @@ -229,7 +229,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor /** * Get the implementation dependent name of a sensor. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param sensor the SDL_Sensor object. * \returns the sensor name, or NULL if `sensor` is NULL. diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index 7431748941493..c3590e500d480 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -383,7 +383,7 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * The returned pointer follows the SDL_GetStringRule. + * The returned pointer follows the SDL_GetStringRule, and will be automatically freed later. * * \param storage a storage container. * \param path the path of the directory to enumerate. diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 796cb97a774de..b4cc310fe03f9 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -407,7 +407,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); * * https://developer.android.com/reference/android/content/Context#getFilesDir() * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the path used for internal storage or NULL on failure; call * SDL_GetError() for more information. @@ -448,7 +448,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void); * * https://developer.android.com/reference/android/content/Context#getExternalFilesDir() * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the path used for external storage for this application on success * or NULL on failure; call SDL_GetError() for more information. @@ -471,7 +471,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void) * * https://developer.android.com/reference/android/content/Context#getCacheDir() * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the path used for caches for this application on success or NULL * on failure; call SDL_GetError() for more information. @@ -625,7 +625,7 @@ typedef enum SDL_WinRT_DeviceFamily * * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param pathType the type of path to retrieve, one of SDL_WinRT_Path. * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 347958b362b93..ff84a81d58f3f 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -330,7 +330,7 @@ extern SDL_DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithPropertiesRuntime(SD /** * Get the thread name as it was specified in SDL_CreateThread(). * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param thread the thread to query. * \returns a pointer to a UTF-8 string that names the specified thread, or diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index c619012a5c89f..68b6aee39d39c 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -96,7 +96,7 @@ extern SDL_DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count); /** * Get the touch device name as reported from the driver. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param touchID the touch device instance ID. * \returns touch device name, or NULL on error; call SDL_GetError() for more diff --git a/include/SDL3/SDL_version.h b/include/SDL3/SDL_version.h index fb3c16c305346..193db108bf4c9 100644 --- a/include/SDL3/SDL_version.h +++ b/include/SDL3/SDL_version.h @@ -163,7 +163,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetVersion(void); * You shouldn't use this function for anything but logging it for debugging * purposes. The string is not intended to be reliable in any way. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns an arbitrary string, uniquely identifying the exact revision of * the SDL library in use. diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index fdb2a42615720..050ec04754d1c 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -349,7 +349,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); * "x11" or "windows". These never have Unicode characters, and are not meant * to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param index the index of a video driver. * \returns the name of the video driver with the given **index**. @@ -367,7 +367,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); * "x11" or "windows". These never have Unicode characters, and are not meant * to be proper names. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \returns the name of the current video driver or NULL if no driver has been * initialized. @@ -445,7 +445,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_Displa /** * Get the name of a display in UTF-8 encoding. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param displayID the instance ID of the display to query. * \returns the name of a display or NULL on failure; call SDL_GetError() for @@ -1304,7 +1304,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const cha /** * Get the title of a window. * - * The returned string follows the SDL_GetStringRule. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param window the window to query. * \returns the title of the window in UTF-8 format or "" if there is no From 217330a7b3e84ec0e2ec507cdc07de20667c2018 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 00:30:33 -0700 Subject: [PATCH 385/431] Made return value descriptions more consistent across the API --- include/SDL3/SDL_audio.h | 63 +++++++++++++++++------------ include/SDL3/SDL_camera.h | 12 +++--- include/SDL3/SDL_error.h | 2 +- include/SDL3/SDL_events.h | 2 +- include/SDL3/SDL_gamepad.h | 20 +++++----- include/SDL3/SDL_haptic.h | 4 +- include/SDL3/SDL_hidapi.h | 30 ++++++++------ include/SDL3/SDL_iostream.h | 74 +++++++++++++++++------------------ include/SDL3/SDL_joystick.h | 8 ++-- include/SDL3/SDL_keyboard.h | 6 +-- include/SDL3/SDL_loadso.h | 5 +-- include/SDL3/SDL_mouse.h | 6 +-- include/SDL3/SDL_pen.h | 2 +- include/SDL3/SDL_properties.h | 2 +- include/SDL3/SDL_render.h | 21 ++++++---- include/SDL3/SDL_sensor.h | 12 +++--- include/SDL3/SDL_storage.h | 6 +-- include/SDL3/SDL_surface.h | 18 ++++----- include/SDL3/SDL_system.h | 8 ++-- include/SDL3/SDL_time.h | 21 ++++------ include/SDL3/SDL_timer.h | 4 +- include/SDL3/SDL_touch.h | 12 +++--- include/SDL3/SDL_video.h | 25 ++++++------ include/SDL3/SDL_vulkan.h | 6 +-- 24 files changed, 194 insertions(+), 175 deletions(-) diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 5eea64363abd5..a5d52e8a4f1b2 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -480,8 +480,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices(int * * \param count a pointer filled in with the number of devices returned. NULL * is allowed. * \returns a 0 terminated array of device instance IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * information. * * \threadsafety It is safe to call this function from any thread. * @@ -498,7 +498,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioRecordingDevices(int * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param devid the instance ID of the device to query. - * \returns the name of the audio device, or NULL on error. + * \returns the name of the audio device, or NULL on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -633,7 +634,7 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioDeviceChannelMap(SDL_AudioDe * default device. * \param spec the requested device configuration. Can be NULL to use * reasonable defaults. - * \returns the device ID on success, 0 on error; call SDL_GetError() for more + * \returns the device ID on success or 0 on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. @@ -738,7 +739,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev * this function will always return -1.0f when used on physical devices. * * \param devid the audio device to query. - * \returns the gain of the device, or -1.0f on error. + * \returns the gain of the device or -1.0f on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -771,7 +773,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid * * \param devid the audio device on which to change gain. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -827,8 +830,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param devid an audio device to bind a stream to. * \param streams an array of audio streams to unbind. * \param num_streams number streams listed in the `streams` array. - * \returns 0 on success, -1 on error; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -848,7 +851,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SD * * \param devid an audio device to bind a stream to. * \param stream an audio stream to bind to a device. - * \returns 0 on success, -1 on error; call SDL_GetError() for more + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. @@ -922,7 +925,8 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_Audio * * \param src_spec the format details of the input audio. * \param dst_spec the format details of the output audio. - * \returns a new audio stream on success, or NULL on failure. + * \returns a new audio stream on success or NULL on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -955,7 +959,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetAudioStreamProperties(SDL_Au * \param stream the SDL_AudioStream to query. * \param src_spec where to store the input audio format; ignored if NULL. * \param dst_spec where to store the output audio format; ignored if NULL. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -986,7 +991,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream * changed. * \param dst_spec the new format of the audio output; if NULL, it is not * changed. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1004,7 +1010,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFormat(SDL_AudioStream *stream * Get the frequency ratio of an audio stream. * * \param stream the SDL_AudioStream to query. - * \returns the frequency ratio of the stream, or 0.0 on error. + * \returns the frequency ratio of the stream or 0.0 on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1030,7 +1037,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamFrequencyRatio(SDL_AudioStre * \param stream the stream the frequency ratio is being changed. * \param ratio the frequency ratio. 1.0 is normal speed. Must be between 0.01 * and 100. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1051,7 +1059,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream * Audio streams default to a gain of 1.0f (no change in output). * * \param stream the SDL_AudioStream to query. - * \returns the gain of the stream, or -1.0f on error. + * \returns the gain of the stream or -1.0f on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1075,7 +1084,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetAudioStreamGain(SDL_AudioStream *stream * * \param stream the stream on which the gain is being changed. * \param gain the gain. 1.0f is no change, 0.0f is silence. - * \returns 0 on success, or -1 on error. + * \returns 0 on successor a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1173,7 +1183,8 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamOutputChannelMap(SDL_A * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success, -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. Don't change the @@ -1219,7 +1230,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamInputChannelMap(SDL_AudioStrea * \param stream the SDL_AudioStream to change. * \param chmap the new channel map, NULL to reset to default. * \param count The number of channels in the map. - * \returns 0 on success, -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. Don't change the @@ -1277,7 +1289,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, * \param stream the stream the audio is being requested from. * \param buf a buffer to fill with audio data. * \param len the maximum number of bytes to fill. - * \returns the number of bytes read from the stream, or -1 on error. + * \returns the number of bytes read from the stream or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, but if the * stream has a callback set, the caller might need to manage @@ -1558,7 +1571,8 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * stream. * \param userdata an opaque pointer provided to the callback for its own * personal use. - * \returns 0 on success, -1 on error. This only fails if `stream` is NULL. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1606,7 +1620,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *s * stream. * \param userdata an opaque pointer provided to the callback for its own * personal use. - * \returns 0 on success, -1 on error. This only fails if `stream` is NULL. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. This only fails if `stream` is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1687,7 +1702,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream) * necessary. * \param userdata app-controlled pointer passed to callback. Can be NULL. * Ignored if callback is NULL. - * \returns an audio stream on success, ready to use. NULL on error; call + * \returns an audio stream on success, ready to use, or NULL on failure; call * SDL_GetError() for more information. When done with this stream, * call SDL_DestroyAudioStream to free resources and close the * device. @@ -1783,8 +1798,8 @@ typedef void (SDLCALL *SDL_AudioPostmixCallback)(void *userdata, const SDL_Audio * \param devid the ID of an opened audio device. * \param callback a callback function to be called. Can be NULL. * \param userdata app-controlled pointer passed to callback. Can be NULL. - * \returns zero on success, -1 on error; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 96636a5b5ddce..5285c7f1c0683 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -173,8 +173,8 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void); * \param count a pointer filled in with the number of camera devices. Can be * NULL. * \returns a 0 terminated array of camera instance IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free() or NULL on failure; call SDL_GetError() for more + * information. * * \threadsafety It is safe to call this function from any thread. * @@ -215,8 +215,8 @@ extern SDL_DECLSPEC SDL_CameraID *SDLCALL SDL_GetCameras(int *count); * \param count a pointer filled in with the number of elements in the list. * Can be NULL. * \returns a 0 terminated array of SDL_CameraSpecs, which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free(), or NULL on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -233,7 +233,7 @@ extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraSupportedFormats(SDL_Ca * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the camera device instance ID. - * \returns a human-readable device name, or NULL on error; call + * \returns a human-readable device name or NULL on failure; call * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. @@ -297,7 +297,7 @@ extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraI * \param instance_id the camera device instance ID. * \param spec the desired format for data the device will provide. Can be * NULL. - * \returns device, or NULL on failure; call SDL_GetError() for more + * \returns an SDL_Camera object or NULL on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. diff --git a/include/SDL3/SDL_error.h b/include/SDL3/SDL_error.h index fced53c021ac6..dc18b527a7d0b 100644 --- a/include/SDL3/SDL_error.h +++ b/include/SDL3/SDL_error.h @@ -56,7 +56,7 @@ extern "C" { * \param fmt a printf()-style message format string. * \param ... additional parameters matching % tokens in the `fmt` string, if * any. - * \returns always -1. + * \returns -1. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index b4aa0d7c009a4..6ed114aaf3444 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1323,7 +1323,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter, * * \param filter an SDL_EventFilter function to call when an event happens. * \param userdata a pointer that is passed to `filter`. - * \returns 0 on success, or a negative error code on failure; call + * \returns 0 on success or a negative error code on failure; call * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 386f922cc5bb9..3aa7de6348b52 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -301,7 +301,7 @@ typedef struct SDL_GamepadBinding * * \param mapping the mapping string. * \returns 1 if a new mapping is added, 0 if an existing mapping is updated, - * -1 on error; call SDL_GetError() for more information. + * -1 on failure; call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -332,7 +332,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMapping(const char *mapping); * \param src the data stream for the mappings to be added. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. - * \returns the number of mappings added or -1 on error; call SDL_GetError() + * \returns the number of mappings added or -1 on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -360,7 +360,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, * Windows, etc). * * \param file the mappings file to load. - * \returns the number of mappings added or -1 on error; call SDL_GetError() + * \returns the number of mappings added or -1 on failure; call SDL_GetError() * for more information. * * \threadsafety It is safe to call this function from any thread. @@ -393,8 +393,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void); * * \param count a pointer filled in with the number of mappings returned, can * be NULL. - * \returns an array of the mapping strings, NULL-terminated. Returns NULL on - * error; call SDL_GetError() for more information. + * \returns an array of the mapping strings, NULL-terminated, or NULL on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -406,7 +406,7 @@ extern SDL_DECLSPEC const char * const * SDLCALL SDL_GetGamepadMappings(int *cou * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param guid a structure containing the GUID for which a mapping is desired. - * \returns a mapping string or NULL on error; call SDL_GetError() for more + * \returns a mapping string or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. @@ -470,7 +470,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void); * * \param count a pointer filled in with the number of gamepads returned. * \returns a 0 terminated array of joystick instance IDs which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for * more details. * * \since This function is available since SDL 3.0.0. @@ -971,7 +971,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad); * SDL to crash. * * \param gamepad the gamepad object that you want to get a joystick from. - * \returns an SDL_Joystick object; call SDL_GetError() for more information. + * \returns an SDL_Joystick object, or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -1013,7 +1013,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void); * \param gamepad a gamepad. * \param count a pointer filled in with the number of bindings returned. * \returns a NULL terminated array of pointers to bindings which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for * more details. * * \since This function is available since SDL 3.0.0. @@ -1199,7 +1199,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadHasButton(SDL_Gamepad *gamepad, * * \param gamepad a gamepad. * \param button a button index (one of the SDL_GamepadButton values). - * \returns 1 for pressed state or 0 for not pressed state or error; call + * \returns 1 for pressed state or 0 for not pressed state or failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 3ce52603e0a89..f99096f653c7e 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -935,8 +935,8 @@ typedef Uint32 SDL_HapticID; * \param count a pointer filled in with the number of haptic devices * returned. * \returns a 0 terminated array of haptic device instance IDs which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for - * more details. + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_hidapi.h b/include/SDL3/SDL_hidapi.h index 9fd32f52737e7..a3c1236df1a2c 100644 --- a/include/SDL3/SDL_hidapi.h +++ b/include/SDL3/SDL_hidapi.h @@ -263,7 +263,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *d * \param serial_number the Serial Number of the device to open (Optionally * NULL). * \returns a pointer to a SDL_hid_device object on success or NULL on - * failure. + * failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -277,7 +278,8 @@ extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_ * * \param path the path name of the device to open. * \returns a pointer to a SDL_hid_device object on success or NULL on - * failure. + * failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -303,7 +305,8 @@ extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open_path(const char *path) * \param data the data to send, including the report number as the first * byte. * \param length the length in bytes of the data to send. - * \returns the actual number of bytes written and -1 on error. + * \returns the actual number of bytes written and -1 on on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -322,7 +325,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigne * reports, make sure to read an extra byte for the report * number. * \param milliseconds timeout in milliseconds or -1 for blocking wait. - * \returns the actual number of bytes read and -1 on error. If no packet was + * \returns the actual number of bytes read and -1 on on failure; call + * SDL_GetError() for more information. If no packet was * available to be read within the timeout period, this function * returns 0. * @@ -342,7 +346,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsign * \param length the number of bytes to read. For devices with multiple * reports, make sure to read an extra byte for the report * number. - * \returns the actual number of bytes read and -1 on error. If no packet was + * \returns the actual number of bytes read and -1 on failure; call + * SDL_GetError() for more information. If no packet was * available to be read and the handle is in non-blocking mode, this * function returns 0. * @@ -387,7 +392,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int * byte. * \param length the length in bytes of the data to send, including the report * number. - * \returns the actual number of bytes written and -1 on error. + * \returns the actual number of bytes written and -1 on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -409,7 +415,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, * \param length the number of bytes to read, including an extra byte for the * report ID. The buffer can be longer than the actual report. * \returns the number of bytes read plus one for the report ID (which is - * still in the first byte), or -1 on error. + * still in the first byte), or -1 on on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -431,7 +438,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, * \param length the number of bytes to read, including an extra byte for the * report ID. The buffer can be longer than the actual report. * \returns the number of bytes read plus one for the report ID (which is - * still in the first byte), or -1 on error. + * still in the first byte), or -1 on on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -505,8 +513,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, * Get the device info from a HID device. * * \param dev a device handle returned from SDL_hid_open(). - * \returns a pointer to the SDL_hid_device_info for this hid_device, or NULL - * in the case of failure; call SDL_GetError() for more information. + * \returns a pointer to the SDL_hid_device_info for this hid_device or NULL + * on failure; call SDL_GetError() for more information. * This struct is valid until the device is closed with * SDL_hid_close(). * @@ -523,7 +531,7 @@ extern SDL_DECLSPEC SDL_hid_device_info * SDLCALL SDL_hid_get_device_info(SDL_hi * \param dev a device handle returned from SDL_hid_open(). * \param buf the buffer to copy descriptor into. * \param buf_size the size of the buffer in bytes. - * \returns the number of bytes actually copied, or -1 on error; call + * \returns the number of bytes actually copied or -1 on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index c87d203139459..fcd661234d284 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -224,7 +224,7 @@ typedef struct SDL_IOStream SDL_IOStream; * \param file a UTF-8 string representing the filename to open. * \param mode an ASCII string representing the mode to be used for opening * the file. - * \returns a pointer to the SDL_IOStream structure that is created, or NULL + * \returns a pointer to the SDL_IOStream structure that is created or NULL * on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -258,7 +258,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromFile(const char *file, const * * \param mem a pointer to a buffer to feed an SDL_IOStream stream. * \param size the buffer size, in bytes. - * \returns a pointer to a new SDL_IOStream structure, or NULL if it fails; + * \returns a pointer to a new SDL_IOStream structure or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -291,7 +291,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromMem(void *mem, size_t size); * * \param mem a pointer to a read-only buffer to feed an SDL_IOStream stream. * \param size the buffer size, in bytes. - * \returns a pointer to a new SDL_IOStream structure, or NULL if it fails; + * \returns a pointer to a new SDL_IOStream structure or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -319,7 +319,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromConstMem(const void *mem, si * - `SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER`: memory will be allocated in * multiples of this size, defaulting to 1024. * - * \returns a pointer to a new SDL_IOStream structure, or NULL if it fails; + * \returns a pointer to a new SDL_IOStream structure or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -354,7 +354,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromDynamicMem(void); * \param iface the function pointers that implement this SDL_IOStream. * \param userdata the app-controlled pointer that is passed to iface's * functions when called. - * \returns a pointer to the allocated memory on success, or NULL on failure; + * \returns a pointer to the allocated memory on success or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -488,7 +488,7 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. * \param size the number of bytes to read from the data source. - * \returns the number of bytes read, or 0 on end of file or other error. + * \returns the number of bytes read, or 0 on end of file or other failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -515,7 +515,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_ReadIO(SDL_IOStream *context, void *ptr, * \param ptr a pointer to a buffer containing data to write. * \param size the number of bytes to write. * \returns the number of bytes written, which will be less than `size` on - * error; call SDL_GetError() for more information. + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -535,7 +535,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_WriteIO(SDL_IOStream *context, const void * \param fmt a printf() style format string. * \param ... additional parameters matching % tokens in the `fmt` string, if * any. - * \returns the number of bytes written, or 0 on error; call SDL_GetError() + * \returns the number of bytes written or 0 on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -553,7 +553,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOprintf(SDL_IOStream *context, SDL_PRINT * \param context a pointer to an SDL_IOStream structure. * \param fmt a printf() style format string. * \param ap a variable argument list. - * \returns the number of bytes written, or 0 on error; call SDL_GetError() + * \returns the number of bytes written or 0 on failure; call SDL_GetError() * for more information. * * \since This function is available since SDL 3.0.0. @@ -576,7 +576,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN * \param datasize if not NULL, will store the number of bytes read. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. - * \returns the data, or NULL if there was an error. + * \returns the data or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -595,7 +595,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *dat * * \param file the path to read all available data from. * \param datasize if not NULL, will store the number of bytes read. - * \returns the data, or NULL if there was an error. + * \returns the data or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -643,7 +643,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS8(SDL_IOStream *src, Sint8 *value) * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -659,7 +659,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16LE(SDL_IOStream *src, Uint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -675,7 +675,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16LE(SDL_IOStream *src, Sint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -691,7 +691,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU16BE(SDL_IOStream *src, Uint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -707,7 +707,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS16BE(SDL_IOStream *src, Sint16 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -723,7 +723,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32LE(SDL_IOStream *src, Uint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -739,7 +739,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32LE(SDL_IOStream *src, Sint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -755,7 +755,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU32BE(SDL_IOStream *src, Uint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -771,7 +771,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS32BE(SDL_IOStream *src, Sint32 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -787,7 +787,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64LE(SDL_IOStream *src, Uint64 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -803,7 +803,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64LE(SDL_IOStream *src, Sint64 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -819,7 +819,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadU64BE(SDL_IOStream *src, Uint64 *va * * \param src the stream from which to read data. * \param value a pointer filled in with the data read. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -839,7 +839,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_ReadS64BE(SDL_IOStream *src, Sint64 *va * * \param dst the SDL_IOStream to write to. * \param value the byte value to write. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -851,7 +851,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU8(SDL_IOStream *dst, Uint8 value) * * \param dst the SDL_IOStream to write to. * \param value the byte value to write. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -868,7 +868,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS8(SDL_IOStream *dst, Sint8 value) * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -885,7 +885,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16LE(SDL_IOStream *dst, Uint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -901,7 +901,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16LE(SDL_IOStream *dst, Sint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -917,7 +917,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU16BE(SDL_IOStream *dst, Uint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -934,7 +934,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS16BE(SDL_IOStream *dst, Sint16 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -951,7 +951,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32LE(SDL_IOStream *dst, Uint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -967,7 +967,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32LE(SDL_IOStream *dst, Sint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -983,7 +983,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU32BE(SDL_IOStream *dst, Uint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1000,7 +1000,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS32BE(SDL_IOStream *dst, Sint32 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1017,7 +1017,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64LE(SDL_IOStream *dst, Uint64 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1033,7 +1033,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteS64LE(SDL_IOStream *dst, Sint64 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -1049,7 +1049,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WriteU64BE(SDL_IOStream *dst, Uint64 va * * \param dst the stream to which data will be written. * \param value the data to be written, in native format. - * \returns SDL_TRUE on successful write, SDL_FALSE on failure; call + * \returns SDL_TRUE on successful write or SDL_FALSE on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index e1e1c7f16ec01..35057d16a4590 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -212,8 +212,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); * * \param count a pointer filled in with the number of joysticks returned. * \returns a 0 terminated array of joystick instance IDs which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for - * more details. + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * @@ -364,7 +364,7 @@ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeForID(SDL_Joysti * for use. * * \param instance_id the joystick instance ID. - * \returns a joystick identifier or NULL if an error occurred; call + * \returns a joystick identifier or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -470,7 +470,7 @@ typedef struct SDL_VirtualJoystickDesc * Attach a new virtual joystick. * * \param desc joystick description. - * \returns the joystick instance ID, or 0 if an error occurred; call + * \returns the joystick instance ID, or 0 on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index fe5f7f90ae592..ae571a785aaad 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -75,8 +75,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * * \param count a pointer filled in with the number of keyboards returned. * \returns a 0 terminated array of keyboards instance IDs which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for - * more details. + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * @@ -93,7 +93,7 @@ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param instance_id the keyboard instance ID. - * \returns the name of the selected keyboard, or NULL on failure; call + * \returns the name of the selected keyboard or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_loadso.h b/include/SDL3/SDL_loadso.h index 097437eb0df93..4d92c55baa6a4 100644 --- a/include/SDL3/SDL_loadso.h +++ b/include/SDL3/SDL_loadso.h @@ -56,8 +56,7 @@ extern "C" { * Dynamically load a shared object. * * \param sofile a system-dependent name of the object file. - * \returns an opaque pointer to the object handle or NULL if there was an - * error; call SDL_GetError() for more information. + * \returns an opaque pointer to the object handle or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -83,7 +82,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); * * \param handle a valid shared object handle returned by SDL_LoadObject(). * \param name the name of the function to look up. - * \returns a pointer to the function or NULL if there was an error; call + * \returns a pointer to the function or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index 8c55399bd745f..ca7aee172fa3a 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -137,8 +137,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * * \param count a pointer filled in with the number of mice returned. * \returns a 0 terminated array of mouse instance IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. * @@ -482,7 +482,7 @@ extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); * You do not have to call SDL_DestroyCursor() on the return value, but it is * safe to do so. * - * \returns the default cursor on success or NULL on failure. + * \returns the default cursor on success or NULL on failuree; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_pen.h b/include/SDL3/SDL_pen.h index 3dadfb6bf792d..92e4c6713ac7a 100644 --- a/include/SDL3/SDL_pen.h +++ b/include/SDL3/SDL_pen.h @@ -156,7 +156,7 @@ typedef enum SDL_PenSubtype * * \param count the number of pens in the array (number of array elements * minus 1, i.e., not counting the terminator 0). - * \returns a 0 terminated array of SDL_PenID values, or NULL on error. The + * \returns a 0 terminated array of SDL_PenID values, or NULL on failure. The * array must be freed with SDL_free(). On a NULL return, * SDL_GetError() is set. * diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 40a128fa4019a..632e9475ed725 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -450,7 +450,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetFloatProperty(SDL_PropertiesID props, c * \param name the name of the property to query. * \param default_value the default value of the property. * \returns the value of the property, or `default_value` if it is not set or - * not a float property. + * not a boolean property. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index a1b1f2936c590..19273e14281d1 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -327,8 +327,7 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *render * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param renderer the rendering context. - * \returns the name of the selected renderer, or NULL if the renderer is - * invalid. + * \returns the name of the selected renderer, or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1705,7 +1704,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer *renderer); * \param renderer the renderer which should draw a point. * \param x the x coordinate of the point. * \param y the y coordinate of the point. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1736,7 +1736,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderPoints(SDL_Renderer *renderer, const S * \param y1 the y coordinate of the start point. * \param x2 the x coordinate of the end point. * \param y2 the y coordinate of the end point. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1766,7 +1767,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param renderer the renderer which should draw a rectangle. * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1797,7 +1799,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param renderer the renderer which should fill a rectangle. * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1831,7 +1834,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * texture. * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1881,7 +1885,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * array, if NULL all vertices will be rendered in sequential * order. * \param num_indices number of indices. - * \returns 0 on success, or -1 if the operation is not supported. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 6835440562d20..40d9b07951113 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -148,8 +148,8 @@ typedef enum SDL_SensorType * * \param count a pointer filled in with the number of sensors returned. * \returns a 0 terminated array of sensor instance IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. */ @@ -199,7 +199,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableTypeForID(SDL_SensorID i * Open a sensor for use. * * \param instance_id the sensor instance ID. - * \returns an SDL_Sensor sensor object, or NULL if an error occurred. + * \returns an SDL_Sensor object or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -209,7 +209,7 @@ extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id) * Return the SDL_Sensor associated with an instance ID. * * \param instance_id the sensor instance ID. - * \returns an SDL_Sensor object. + * \returns an SDL_Sensor object or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -232,7 +232,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param sensor the SDL_Sensor object. - * \returns the sensor name, or NULL if `sensor` is NULL. + * \returns the sensor name or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -263,7 +263,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor) * Get the instance ID of a sensor. * * \param sensor the SDL_Sensor object to inspect. - * \returns the sensor instance ID, or 0 if `sensor` is NULL. + * \returns the sensor instance ID, or 0 on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index c3590e500d480..5ffcd81f67851 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -227,7 +227,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried, a negative value otherwise; call + * \returns 0 if the file could be queried or a negative error code on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -245,7 +245,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetStorageFileSize(SDL_Storage *storage, con * \param path the relative path of the file to read. * \param destination a client-provided buffer to read the file into. * \param length the length of the destination buffer. - * \returns 0 if the file was read, a negative value otherwise; call + * \returns 0 if the file was read or a negative error code on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -263,7 +263,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const * \param path the relative path of the file to write. * \param source a client-provided buffer to write from. * \param length the length of the source buffer. - * \returns 0 if the file was written, a negative value otherwise; call + * \returns 0 if the file was written or a negative error code on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 84dca445bbae2..0bb12269826a5 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -128,7 +128,7 @@ typedef struct SDL_Surface * \param width the width of the surface. * \param height the height of the surface. * \param format the SDL_PixelFormat for the new surface's pixel format. - * \returns the new SDL_Surface structure that is created or NULL if it fails; + * \returns the new SDL_Surface structure that is created or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -156,7 +156,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height * \param format the SDL_PixelFormat for the new surface's pixel format. * \param pixels a pointer to existing pixel data. * \param pitch the number of bytes between each row, including padding. - * \returns the new SDL_Surface structure that is created or NULL if it fails; + * \returns the new SDL_Surface structure that is created or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -355,8 +355,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); * \param src the data stream for the surface. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. - * \returns a pointer to a new SDL_Surface structure or NULL if there was an - * error; call SDL_GetError() for more information. + * \returns a pointer to a new SDL_Surface structure or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -373,8 +373,8 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_b * will result in a memory leak. * * \param file the BMP file to load. - * \returns a pointer to a new SDL_Surface structure or NULL if there was an - * error; call SDL_GetError() for more information. + * \returns a pointer to a new SDL_Surface structure or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -688,7 +688,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMo * The returned surface should be freed with SDL_DestroySurface(). * * \param surface the surface to duplicate. - * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for + * \returns a copy of the surface or NULL on failure; call SDL_GetError() for * more information. * * \since This function is available since SDL 3.0.0. @@ -710,7 +710,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surfa * * \param surface the existing SDL_Surface structure to convert. * \param format the new pixel format. - * \returns the new SDL_Surface structure that is created or NULL if it fails; + * \returns the new SDL_Surface structure that is created or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -733,7 +733,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface * \param palette an optional palette to use for indexed formats, may be NULL. * \param colorspace the new colorspace. * \param props an SDL_PropertiesID with additional color properties, or 0. - * \returns the new SDL_Surface structure that is created or NULL if it fails; + * \returns the new SDL_Surface structure that is created or NULL on failure; * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index b4cc310fe03f9..5bb04de6b695b 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -162,7 +162,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, * * \param threadID the Unix thread ID to change priority of. * \param priority the new, Unix-specific, priority value. - * \returns 0 on success, or -1 on error. + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -280,7 +280,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled); * rationale being that the SDL headers can avoid including jni.h. * * \returns a pointer to Java native interface object (JNIEnv) to which the - * current thread is attached, or 0 on error. + * current thread is attached, or NULL on failure; call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -304,7 +304,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void); * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html * * \returns the jobject representing the instance of the Activity class of the - * Android application, or NULL on error. + * Android application, or NULL on failure; call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -813,7 +813,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle * outTaskQu * * \param outUserHandle a pointer to be filled in with the default user * handle. - * \returns 0 if success, -1 if any error occurs. + * \returns 0 if success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_time.h b/include/SDL3/SDL_time.h index d8b75ca92dea7..f28b68f054150 100644 --- a/include/SDL3/SDL_time.h +++ b/include/SDL3/SDL_time.h @@ -95,8 +95,7 @@ typedef enum SDL_TimeFormat * format, may be NULL. * \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time * format, may be NULL. - * \returns 0 on success or -1 on error; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -107,8 +106,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat * Jan 1, 1970 in Universal Coordinated Time (UTC). * * \param ticks the SDL_Time to hold the returned tick count. - * \returns 0 on success or -1 on error; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -123,8 +121,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentTime(SDL_Time *ticks); * \param localTime the resulting SDL_DateTime will be expressed in local time * if true, otherwise it will be in Universal Coordinated * Time (UTC). - * \returns 0 on success or -1 on error; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -138,8 +135,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime * * \param dt the source SDL_DateTime. * \param ticks the resulting SDL_Time. - * \returns 0 on success or -1 on error; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -181,8 +177,7 @@ extern SDL_DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, U * * \param year the year. * \param month the month [1-12]. - * \returns the number of days in the requested month, otherwise -1; call - * SDL_GetError() for more information. + * \returns the number of days in the requested month or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -194,8 +189,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month); * \param year the year component of the date. * \param month the month component of the date. * \param day the day component of the date. - * \returns the day of year [0-365] if the date is valid, otherwise -1; call - * SDL_GetError() for more information. + * \returns the day of year [0-365] if the date is valid or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -207,8 +201,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day); * \param year the year component of the date. * \param month the month component of the date. * \param day the day component of the date. - * \returns a value between 0 and 6 (0 being Sunday) if the date is valid, - * otherwise -1; call SDL_GetError() for more information. + * \returns a value between 0 and 6 (0 being Sunday) if the date is valid or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_timer.h b/include/SDL3/SDL_timer.h index 09a6e1c78e720..cd3cc3a11dcd5 100644 --- a/include/SDL3/SDL_timer.h +++ b/include/SDL3/SDL_timer.h @@ -182,7 +182,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID, * \param callback the SDL_TimerCallback function to call when the specified * `interval` elapses. * \param userdata a pointer that is passed to `callback`. - * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more + * \returns a timer ID or 0 on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. @@ -245,7 +245,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI * \param callback the SDL_TimerCallback function to call when the specified * `interval` elapses. * \param userdata a pointer that is passed to `callback`. - * \returns a timer ID or 0 if an error occurs; call SDL_GetError() for more + * \returns a timer ID or 0 on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index 68b6aee39d39c..5159dcb5f2921 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -86,8 +86,8 @@ typedef struct SDL_Finger * \param count a pointer filled in with the number of devices returned, can * be NULL. * \returns a 0 terminated array of touch device IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. */ @@ -99,8 +99,8 @@ extern SDL_DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count); * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param touchID the touch device instance ID. - * \returns touch device name, or NULL on error; call SDL_GetError() for more - * details. + * \returns touch device name, or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. */ @@ -123,8 +123,8 @@ extern SDL_DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_Touch * \param count a pointer filled in with the number of fingers returned, can * be NULL. * \returns a NULL terminated array of SDL_Finger pointers which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for - * more details. + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 050ec04754d1c..3819bfbfea14b 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -394,8 +394,8 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); * \param count a pointer filled in with the number of displays returned, may * be NULL. * \returns a 0 terminated array of display instance IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. */ @@ -533,8 +533,8 @@ extern SDL_DECLSPEC SDL_DisplayOrientation SDLCALL SDL_GetCurrentDisplayOrientat * big on this display, to aid in readability. * * \param displayID the instance ID of the display to query. - * \returns the content scale of the display, or 0.0f on error; call - * SDL_GetError() for more details. + * \returns the content scale of the display, or 0.0f on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -557,8 +557,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displ * \param displayID the instance ID of the display to query. * \param count a pointer filled in with the number of display modes returned. * \returns a NULL terminated array of display mode pointers which should be - * freed with SDL_free(), or NULL on error; call SDL_GetError() for - * more details. + * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * @@ -584,7 +584,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode **SDLCALL SDL_GetFullscreenDisplayMode * \param include_high_density_modes boolean to include high density modes in * the search. * \returns a pointer to the closest display mode equal to or larger than the - * desired mode, or NULL on error; call SDL_GetError() for more + * desired mode, or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. @@ -603,7 +603,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetClosestFullscreenDispl * display mode. * * \param displayID the instance ID of the display to query. - * \returns a pointer to the desktop display mode or NULL on error; call + * \returns a pointer to the desktop display mode or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -622,7 +622,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDesktopDisplayMode(SDL * display mode. * * \param displayID the instance ID of the display to query. - * \returns a pointer to the desktop display mode or NULL on error; call + * \returns a pointer to the desktop display mode or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. @@ -2173,8 +2173,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowOpacity(SDL_Window *window); * * \param modal_window the window that should be set modal. * \param parent_window the parent window for the modal window. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -2583,8 +2582,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value) * SDL_GLContext is opaque to the application. * * \param window the window to associate with the context. - * \returns the OpenGL context associated with `window` or NULL on error; call - * SDL_GetError() for more details. + * \returns the OpenGL context associated with `window` or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index 639487ac15415..410329eb92f88 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -119,7 +119,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); * `vkGetInstanceProcAddr = * (PFN_vkGetInstanceProcAddr)SDL_Vulkan_GetVkGetInstanceProcAddr();` * - * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on error. + * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -149,7 +149,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); * You should not free the returned array; it is owned by SDL. * * \param count a pointer filled in with the number of extensions returned. - * \returns an array of extension name strings on success, NULL on error. + * \returns an array of extension name strings on success, NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -173,7 +173,7 @@ extern SDL_DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions( * allocator that creates the surface. Can be NULL. * \param surface a pointer to a VkSurfaceKHR handle to output the newly * created surface. - * \returns 0 on success, -1 on error (check SDL_GetError() for specifics). + * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * From 2816745f48cd4bf415159b5f3ef6578d6d5c8dc0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 10:32:13 -0700 Subject: [PATCH 386/431] Allow passing a pointer to SDL_FreeEventMemory() Also clarify in the documentation that you should not call SDL_FreeEventMemory(NULL) from your main thread. --- include/SDL3/SDL_events.h | 14 +++++++--- include/SDL3/SDL_thread.h | 2 ++ src/dynapi/SDL_dynapi_procs.h | 2 +- src/events/SDL_events.c | 50 ++++++++++++++++++++++++++++------- 4 files changed, 54 insertions(+), 14 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 6ed114aaf3444..da25244f844a0 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1428,14 +1428,20 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); * Free temporary event memory allocated by SDL. * * This function frees temporary memory allocated for events and APIs that - * return temporary strings. This memory is local to the thread that creates + * follow the SDL_GetStringRule. This memory is local to the thread that creates * it and is automatically freed for the main thread when pumping the event - * loop. For other threads you may want to call this function periodically to + * loop. For other threads you may call this function periodically to * free any temporary memory created by that thread. * + * You can free a specific pointer, to provide more fine grained control over memory management, or you can pass NULL to free all pending temporary allocations. You should *NOT* pass NULL on your main event handling thread, as there may be temporary memory being used by events in-flight. For that thread SDL will call this internally when it's safe to do so. + * * Note that if you call SDL_AllocateEventMemory() on one thread and pass it * to another thread, e.g. via a user event, then you should be sure the other - * thread has finished processing it before calling this function. + * thread has finished processing it before calling this function with NULL. + * + * All temporary memory is freed on the main thread in SDL_Quit() and for other threads when they call SDL_CleanupTLS(), which is automatically called at cleanup time for threads created using SDL_CreateThread(). + * + * \param mem a pointer allocated with SDL_AllocateEventMemory(), or NULL to free all pending temporary allocations. * * \threadsafety It is safe to call this function from any thread. * @@ -1443,7 +1449,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); * * \sa SDL_AllocateEventMemory */ -extern SDL_DECLSPEC void SDLCALL SDL_FreeEventMemory(void); +extern SDL_DECLSPEC void SDLCALL SDL_FreeEventMemory(const void *mem); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index ff84a81d58f3f..9f411a93833c4 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -520,6 +520,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL /** * Cleanup all TLS data for this thread. * + * If you are creating your threads outside of SDL and then calling SDL functions, you should call this function before your thread exits, to properly clean up SDL memory. + * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index f384bd9839d97..1a494d81fe37d 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -169,7 +169,7 @@ SDL_DYNAPI_PROC(int,SDL_FlushAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_FlushEvent,(Uint32 a),(a),) SDL_DYNAPI_PROC(void,SDL_FlushEvents,(Uint32 a, Uint32 b),(a,b),) SDL_DYNAPI_PROC(int,SDL_FlushRenderer,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(void,SDL_FreeEventMemory,(void),(),) +SDL_DYNAPI_PROC(void,SDL_FreeEventMemory,(const void *a),(a),) SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index da4f0881b46aa..60bf7d6b18c68 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -110,12 +110,7 @@ static void SDL_CleanupEventMemory(void *data) { SDL_EventMemoryState *state = (SDL_EventMemoryState *)data; - while (state->head) { - SDL_EventMemory *entry = state->head; - state->head = entry->next; - SDL_free(entry->memory); - SDL_free(entry); - } + SDL_FreeEventMemory(NULL); SDL_free(state); } @@ -217,9 +212,46 @@ static void SDL_FlushEventMemory(Uint32 eventID) } } -void SDL_FreeEventMemory(void) +void SDL_FreeEventMemory(const void *mem) { - SDL_FlushEventMemory(0); + SDL_EventMemoryState *state; + + state = SDL_GetEventMemoryState(SDL_FALSE); + if (!state) { + return; + } + + if (mem) { + SDL_EventMemory *prev = NULL, *entry; + + for (entry = state->head; entry; prev = entry, entry = entry->next) { + if (mem == entry->memory) { + if (prev) { + prev->next = entry->next; + } + if (entry == state->head) { + state->head = entry->next; + } + if (entry == state->tail) { + state->tail = prev; + } + SDL_free(entry->memory); + SDL_free(entry); + break; + } + } + } else { + if (state->head) { + while (state->head) { + SDL_EventMemory *entry = state->head; + + state->head = entry->next; + SDL_free(entry->memory); + SDL_free(entry); + } + state->tail = NULL; + } + } } #ifndef SDL_JOYSTICK_DISABLED @@ -741,7 +773,7 @@ void SDL_StopEventLoop(void) SDL_EventQ.free = NULL; SDL_AtomicSet(&SDL_sentinel_pending, 0); - SDL_FlushEventMemory(0); + SDL_FreeEventMemory(NULL); /* Clear disabled event state */ for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) { From f95ecac300be4fda7b337d7c9342215eafaf0dd9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 18:04:49 -0700 Subject: [PATCH 387/431] Added SDL_ClaimEventMemory() --- include/SDL3/SDL_events.h | 22 ++++++++++++++++++++++ src/dynapi/SDL_dynapi.sym | 1 + src/dynapi/SDL_dynapi_overrides.h | 1 + src/dynapi/SDL_dynapi_procs.h | 1 + src/events/SDL_events.c | 27 +++++++++++++++++++++++++++ 5 files changed, 52 insertions(+) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index da25244f844a0..8460609e92375 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1420,10 +1420,32 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); * * \since This function is available since SDL 3.0.0. * + * \sa SDL_ClaimEventMemory * \sa SDL_FreeEventMemory */ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); +/** + * Claim ownership of temporary event memory allocated by SDL. + * + * This function changes ownership of temporary event memory allocated for events and APIs that + * follow the SDL_GetStringRule. If this function succeeds, the memory will no longer be automatically freed by SDL, it must be freed using SDL_free() by the application. + * + * If the memory isn't temporary, or it was allocated on a different thread, this will return NULL, and the application does not have ownership of the memory. + * + * Note that even if a function follows the SDL_GetStringRule it may not be using temporary event memory, and this function will return NULL in that case. + * + * \param mem a pointer allocated with SDL_AllocateEventMemory(). + * \returns a pointer to the memory now owned by the application, which must be freed using SDL_free(), or NULL if the memory is not temporary or was allocated on a different thread. + * + * \threadsafety It is safe to call this function from any thread. + * + * \since This function is available since SDL 3.0.0. + * + * \sa SDL_AllocateEventMemory + */ +extern SDL_DECLSPEC void * SDLCALL SDL_ClaimEventMemory(const void *mem); + /** * Free temporary event memory allocated by SDL. * diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 8e7734bddb23a..5c61c2fe86c67 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -29,6 +29,7 @@ SDL3_0.0.0 { SDL_BlitSurfaceUncheckedScaled; SDL_BroadcastCondition; SDL_CaptureMouse; + SDL_ClaimEventMemory; SDL_CleanupTLS; SDL_ClearAudioStream; SDL_ClearClipboardData; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index cb95d19ef1061..bb2669f022dac 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -54,6 +54,7 @@ #define SDL_BlitSurfaceUncheckedScaled SDL_BlitSurfaceUncheckedScaled_REAL #define SDL_BroadcastCondition SDL_BroadcastCondition_REAL #define SDL_CaptureMouse SDL_CaptureMouse_REAL +#define SDL_ClaimEventMemory SDL_ClaimEventMemory_REAL #define SDL_CleanupTLS SDL_CleanupTLS_REAL #define SDL_ClearAudioStream SDL_ClearAudioStream_REAL #define SDL_ClearClipboardData SDL_ClearClipboardData_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 1a494d81fe37d..acb5eb19b13c0 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -74,6 +74,7 @@ SDL_DYNAPI_PROC(int,SDL_BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rect *b, SDL_DYNAPI_PROC(int,SDL_BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_BroadcastCondition,(SDL_Condition *a),(a),return) SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return) +SDL_DYNAPI_PROC(void*,SDL_ClaimEventMemory,(const void *a),(a),return) SDL_DYNAPI_PROC(void,SDL_CleanupTLS,(void),(),) SDL_DYNAPI_PROC(int,SDL_ClearAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ClearClipboardData,(void),(),return) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 60bf7d6b18c68..8b5923ad27509 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -212,6 +212,33 @@ static void SDL_FlushEventMemory(Uint32 eventID) } } +void *SDL_ClaimEventMemory(const void *mem) +{ + SDL_EventMemoryState *state; + + state = SDL_GetEventMemoryState(SDL_FALSE); + if (state && mem) { + SDL_EventMemory *prev = NULL, *entry; + + for (entry = state->head; entry; prev = entry, entry = entry->next) { + if (mem == entry->memory) { + if (prev) { + prev->next = entry->next; + } + if (entry == state->head) { + state->head = entry->next; + } + if (entry == state->tail) { + state->tail = prev; + } + SDL_free(entry); + return (void *)mem; + } + } + } + return NULL; +} + void SDL_FreeEventMemory(const void *mem) { SDL_EventMemoryState *state; From ef884c8aa6ea69c1b8f353bc29553073dee96487 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 00:19:08 -0700 Subject: [PATCH 388/431] Transfer event memory between the local pool and the event queue This allows threads to free memory from their local pool without affecting events that are queued, and to transfer memory ownership cleanly between threads that are queuing and dequeuing events. --- include/SDL3/SDL_events.h | 13 +- src/events/SDL_events.c | 260 +++++++++++++++++++++-------------- test/testautomation_events.c | 108 ++++++++++++++- 3 files changed, 272 insertions(+), 109 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 8460609e92375..63958e7e441bb 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1431,7 +1431,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); * This function changes ownership of temporary event memory allocated for events and APIs that * follow the SDL_GetStringRule. If this function succeeds, the memory will no longer be automatically freed by SDL, it must be freed using SDL_free() by the application. * - * If the memory isn't temporary, or it was allocated on a different thread, this will return NULL, and the application does not have ownership of the memory. + * If the memory isn't temporary, or it was allocated on a different thread, or if it is associated with an event currently in the event queue, this will return NULL, and the application does not have ownership of the memory. * * Note that even if a function follows the SDL_GetStringRule it may not be using temporary event memory, and this function will return NULL in that case. * @@ -1443,6 +1443,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); * \since This function is available since SDL 3.0.0. * * \sa SDL_AllocateEventMemory + * \sa SDL_free */ extern SDL_DECLSPEC void * SDLCALL SDL_ClaimEventMemory(const void *mem); @@ -1451,15 +1452,11 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ClaimEventMemory(const void *mem); * * This function frees temporary memory allocated for events and APIs that * follow the SDL_GetStringRule. This memory is local to the thread that creates - * it and is automatically freed for the main thread when pumping the event - * loop. For other threads you may call this function periodically to + * it and is automatically freed for the main thread when processing events. + * For other threads you may call this function periodically to * free any temporary memory created by that thread. * - * You can free a specific pointer, to provide more fine grained control over memory management, or you can pass NULL to free all pending temporary allocations. You should *NOT* pass NULL on your main event handling thread, as there may be temporary memory being used by events in-flight. For that thread SDL will call this internally when it's safe to do so. - * - * Note that if you call SDL_AllocateEventMemory() on one thread and pass it - * to another thread, e.g. via a user event, then you should be sure the other - * thread has finished processing it before calling this function with NULL. + * You can free a specific pointer, to provide more fine grained control over memory management, or you can pass NULL to free all pending temporary allocations. * * All temporary memory is freed on the main thread in SDL_Quit() and for other threads when they call SDL_CleanupTLS(), which is automatically called at cleanup time for threads created using SDL_CreateThread(). * diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 8b5923ad27509..bc7f7950de279 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -71,10 +71,25 @@ typedef struct static SDL_DisabledEventBlock *SDL_disabled_events[256]; static Uint32 SDL_userevents = SDL_EVENT_USER; -/* Private data -- event queue */ +typedef struct SDL_EventMemory +{ + void *memory; + struct SDL_EventMemory *prev; + struct SDL_EventMemory *next; +} SDL_EventMemory; + +typedef struct SDL_EventMemoryState +{ + SDL_EventMemory *head; + SDL_EventMemory *tail; +} SDL_EventMemoryState; + +static SDL_TLSID SDL_event_memory; + typedef struct SDL_EventEntry { SDL_Event event; + SDL_EventMemory *memory; struct SDL_EventEntry *prev; struct SDL_EventEntry *next; } SDL_EventEntry; @@ -90,22 +105,6 @@ static struct SDL_EventEntry *free; } SDL_EventQ = { NULL, SDL_FALSE, { 0 }, 0, NULL, NULL, NULL }; -typedef struct SDL_EventMemory -{ - Uint32 eventID; - void *memory; - struct SDL_EventMemory *next; -} SDL_EventMemory; - -typedef struct SDL_EventMemoryState -{ - SDL_EventMemory *head; - SDL_EventMemory *tail; -} SDL_EventMemoryState; - -static SDL_TLSID SDL_event_memory; - - static void SDL_CleanupEventMemory(void *data) { SDL_EventMemoryState *state = (SDL_EventMemoryState *)data; @@ -137,6 +136,130 @@ static SDL_EventMemoryState *SDL_GetEventMemoryState(SDL_bool create) return state; } +static SDL_EventMemory *SDL_GetEventMemoryEntry(SDL_EventMemoryState *state, const void *mem) +{ + SDL_EventMemory *entry; + + // Start from the end, it's likely to have been recently allocated + for (entry = state->tail; entry; entry = entry->prev) { + if (mem == entry->memory) { + return entry; + } + } + return NULL; +} + +static void SDL_LinkEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemory *entry) +{ + entry->prev = state->tail; + entry->next = NULL; + + if (state->tail) { + state->tail->next = entry; + } else { + state->head = entry; + } + state->tail = entry; +} + +static void SDL_UnlinkEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemory *entry) +{ + if (state->head == entry) { + state->head = entry->next; + } + if (state->tail == entry) { + state->tail = entry->prev; + } + + if (entry->prev) { + entry->prev->next = entry->next; + } + if (entry->next) { + entry->next->prev = entry->prev; + } + + entry->prev = NULL; + entry->next = NULL; +} + +static void SDL_FreeEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemory *entry, SDL_bool free_data) +{ + if (free_data) { + SDL_free(entry->memory); + } + SDL_free(entry); +} + +static void SDL_LinkEventMemoryToEvent(SDL_EventEntry *event, const void *mem) +{ + SDL_EventMemoryState *state; + SDL_EventMemory *entry; + + state = SDL_GetEventMemoryState(SDL_FALSE); + if (!state) { + return; + } + + entry = SDL_GetEventMemoryEntry(state, mem); + if (entry) { + SDL_UnlinkEventMemoryEntry(state, entry); + entry->next = event->memory; + event->memory = entry; + } +} + +// Transfer the event memory from the thread-local event memory list to the event +static void SDL_TransferEventMemoryToEvent(SDL_EventEntry *event) +{ + switch (event->event.type) { + case SDL_EVENT_TEXT_EDITING: + SDL_LinkEventMemoryToEvent(event, event->event.edit.text); + break; + case SDL_EVENT_TEXT_EDITING_CANDIDATES: + SDL_LinkEventMemoryToEvent(event, event->event.edit_candidates.candidates); + break; + case SDL_EVENT_TEXT_INPUT: + SDL_LinkEventMemoryToEvent(event, event->event.text.text); + break; + case SDL_EVENT_DROP_BEGIN: + case SDL_EVENT_DROP_FILE: + case SDL_EVENT_DROP_TEXT: + case SDL_EVENT_DROP_COMPLETE: + case SDL_EVENT_DROP_POSITION: + SDL_LinkEventMemoryToEvent(event, event->event.drop.source); + SDL_LinkEventMemoryToEvent(event, event->event.drop.data); + break; + default: + if (event->event.type >= SDL_EVENT_USER && event->event.type <= SDL_EVENT_LAST-1) { + SDL_LinkEventMemoryToEvent(event, event->event.user.data1); + SDL_LinkEventMemoryToEvent(event, event->event.user.data2); + } + break; + } +} + +// Transfer the event memory from the event to the thread-local event memory list +static void SDL_TransferEventMemoryFromEvent(SDL_EventEntry *event) +{ + SDL_EventMemoryState *state; + SDL_EventMemory *entry, *next; + + if (!event->memory) { + return; + } + + state = SDL_GetEventMemoryState(SDL_TRUE); + if (!state) { + return; // this is now a leak, but you probably have bigger problems if malloc failed. + } + + for (entry = event->memory; entry; entry = next) { + next = entry->next; + SDL_LinkEventMemoryEntry(state, entry); + } + event->memory = NULL; +} + void *SDL_FreeLater(void *memory) { SDL_EventMemoryState *state; @@ -155,16 +278,9 @@ void *SDL_FreeLater(void *memory) return memory; // this is now a leak, but you probably have bigger problems if malloc failed. We could probably pool up and reuse entries, though. } - entry->eventID = SDL_last_event_id; entry->memory = memory; - entry->next = NULL; - if (state->tail) { - state->tail->next = entry; - } else { - state->head = entry; - } - state->tail = entry; + SDL_LinkEventMemoryEntry(state, entry); return memory; } @@ -182,58 +298,17 @@ const char *SDL_AllocateEventString(const char *string) return NULL; } -static void SDL_FlushEventMemory(Uint32 eventID) -{ - SDL_EventMemoryState *state; - - state = SDL_GetEventMemoryState(SDL_FALSE); - if (!state) { - return; - } - - if (state->head) { - while (state->head) { - SDL_EventMemory *entry = state->head; - - if (eventID && (Sint32)(eventID - entry->eventID) < 0) { - break; - } - - /* If you crash here, your application has memory corruption - * or freed memory in an event, which is no longer necessary. - */ - state->head = entry->next; - SDL_free(entry->memory); - SDL_free(entry); - } - if (!state->head) { - state->tail = NULL; - } - } -} - void *SDL_ClaimEventMemory(const void *mem) { SDL_EventMemoryState *state; state = SDL_GetEventMemoryState(SDL_FALSE); if (state && mem) { - SDL_EventMemory *prev = NULL, *entry; - - for (entry = state->head; entry; prev = entry, entry = entry->next) { - if (mem == entry->memory) { - if (prev) { - prev->next = entry->next; - } - if (entry == state->head) { - state->head = entry->next; - } - if (entry == state->tail) { - state->tail = prev; - } - SDL_free(entry); - return (void *)mem; - } + SDL_EventMemory *entry = SDL_GetEventMemoryEntry(state, mem); + if (entry) { + SDL_UnlinkEventMemoryEntry(state, entry); + SDL_FreeEventMemoryEntry(state, entry, SDL_FALSE); + return (void *)mem; } } return NULL; @@ -249,34 +324,17 @@ void SDL_FreeEventMemory(const void *mem) } if (mem) { - SDL_EventMemory *prev = NULL, *entry; - - for (entry = state->head; entry; prev = entry, entry = entry->next) { - if (mem == entry->memory) { - if (prev) { - prev->next = entry->next; - } - if (entry == state->head) { - state->head = entry->next; - } - if (entry == state->tail) { - state->tail = prev; - } - SDL_free(entry->memory); - SDL_free(entry); - break; - } + SDL_EventMemory *entry = SDL_GetEventMemoryEntry(state, mem); + if (entry) { + SDL_UnlinkEventMemoryEntry(state, entry); + SDL_FreeEventMemoryEntry(state, entry, SDL_TRUE); } } else { - if (state->head) { - while (state->head) { - SDL_EventMemory *entry = state->head; + while (state->head) { + SDL_EventMemory *entry = state->head; - state->head = entry->next; - SDL_free(entry->memory); - SDL_free(entry); - } - state->tail = NULL; + SDL_UnlinkEventMemoryEntry(state, entry); + SDL_FreeEventMemoryEntry(state, entry, SDL_TRUE); } } } @@ -784,6 +842,7 @@ void SDL_StopEventLoop(void) /* Clean out EventQ */ for (entry = SDL_EventQ.head; entry;) { SDL_EventEntry *next = entry->next; + SDL_TransferEventMemoryFromEvent(entry); SDL_free(entry); entry = next; } @@ -890,6 +949,8 @@ static int SDL_AddEvent(SDL_Event *event) if (event->type == SDL_EVENT_POLL_SENTINEL) { SDL_AtomicAdd(&SDL_sentinel_pending, 1); } + entry->memory = NULL; + SDL_TransferEventMemoryToEvent(entry); if (SDL_EventQ.tail) { SDL_EventQ.tail->next = entry; @@ -917,6 +978,8 @@ static int SDL_AddEvent(SDL_Event *event) /* Remove an event from the queue -- called with the queue locked */ static void SDL_CutEvent(SDL_EventEntry *entry) { + SDL_TransferEventMemoryFromEvent(entry); + if (entry->prev) { entry->prev->next = entry->next; } @@ -1093,10 +1156,7 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel) SDL_VideoDevice *_this = SDL_GetVideoDevice(); /* Free old event memory */ - /*SDL_FlushEventMemory(SDL_last_event_id - SDL_MAX_QUEUED_EVENTS);*/ - if (SDL_AtomicGet(&SDL_EventQ.count) == 0) { - SDL_FlushEventMemory(SDL_last_event_id); - } + SDL_FreeEventMemory(NULL); /* Release any keys held down from last frame */ SDL_ReleaseAutoReleaseKeys(); diff --git a/test/testautomation_events.c b/test/testautomation_events.c index 14418f76ccff2..77d1770455e57 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -175,6 +175,108 @@ static int events_addDelEventWatchWithUserdata(void *arg) return TEST_COMPLETED; } +/** + * Creates and validates temporary event memory + */ +static int events_eventMemory(void *arg) +{ + SDL_Event event; + void *mem, *claimed, *tmp; + SDL_bool found; + + { + /* Create and claim event memory */ + mem = SDL_AllocateEventMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + *(char *)mem = '1'; + + claimed = SDL_ClaimEventMemory(mem); + SDLTest_AssertCheck(claimed != NULL, "SDL_ClaimEventMemory() returned a valid pointer"); + + /* Verify that we can't claim it again */ + tmp = SDL_ClaimEventMemory(mem); + SDLTest_AssertCheck(tmp == NULL, "SDL_ClaimEventMemory() can't claim memory twice"); + + /* Verify that freeing the original pointer does nothing */ + SDL_FreeEventMemory(mem); + SDLTest_AssertCheck(*(char *)mem == '1', "SDL_FreeEventMemory() on claimed memory has no effect"); + + /* Clean up */ + SDL_free(claimed); + } + + { + /* Create and free event memory */ + mem = SDL_AllocateEventMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + *(char *)mem = '1'; + + SDL_FreeEventMemory(mem); + claimed = SDL_ClaimEventMemory(mem); + SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimEventMemory() can't claim memory after it's been freed"); + } + + { + /* Create event memory and queue it */ + mem = SDL_AllocateEventMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + *(char *)mem = '2'; + + SDL_zero(event); + event.type = SDL_EVENT_USER; + event.user.data1 = mem; + SDL_PushEvent(&event); + + /* Verify that we can't claim the memory once it's on the queue */ + claimed = SDL_ClaimEventMemory(mem); + SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimEventMemory() can't claim memory on the event queue"); + + /* Get the event and verify the memory is valid */ + found = SDL_FALSE; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_EVENT_USER && event.user.data1 == mem) { + found = SDL_TRUE; + } + } + SDLTest_AssertCheck(found, "SDL_PollEvent() returned queued event"); + + /* Verify that we can claim the memory now that we've dequeued it */ + claimed = SDL_ClaimEventMemory(mem); + SDLTest_AssertCheck(claimed != NULL, "SDL_ClaimEventMemory() can claim memory after dequeuing event"); + + /* Clean up */ + SDL_free(claimed); + } + + { + /* Create event memory and queue it */ + mem = SDL_AllocateEventMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + *(char *)mem = '3'; + + SDL_zero(event); + event.type = SDL_EVENT_USER; + event.user.data1 = mem; + SDL_PushEvent(&event); + + /* Get the event and verify the memory is valid */ + found = SDL_FALSE; + while (SDL_PollEvent(&event)) { + if (event.type == SDL_EVENT_USER && event.user.data1 == mem) { + found = SDL_TRUE; + } + } + SDLTest_AssertCheck(found, "SDL_PollEvent() returned queued event"); + + /* Verify that pumping the event loop frees event memory */ + SDL_PumpEvents(); + claimed = SDL_ClaimEventMemory(mem); + SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimEventMemory() can't claim memory after pumping the event loop"); + } + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ /* Events test cases */ @@ -190,9 +292,13 @@ static const SDLTest_TestCaseReference eventsTest3 = { (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED }; +static const SDLTest_TestCaseReference eventsTestEventMemory = { + (SDLTest_TestCaseFp)events_eventMemory, "events_eventMemory", "Creates and validates temporary event memory", TEST_ENABLED +}; + /* Sequence of Events test cases */ static const SDLTest_TestCaseReference *eventsTests[] = { - &eventsTest1, &eventsTest2, &eventsTest3, NULL + &eventsTest1, &eventsTest2, &eventsTest3, &eventsTestEventMemory, NULL }; /* Events test suite (global) */ From bb96320cc4380665180a146f3ba8cdf52554b998 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 15:56:41 -0700 Subject: [PATCH 389/431] Make sure we always copy the data returned using SDL_GetStringRule This prevents race conditions where calling an API from one thread returns the data and it's freed by updates on another thread --- src/SDL_internal.h | 2 ++ src/SDL_properties.c | 2 +- src/audio/SDL_audio.c | 10 +++++----- src/audio/SDL_audiocvt.c | 12 ++++++------ src/camera/SDL_camera.c | 6 +++--- src/events/SDL_dropevents.c | 4 ++-- src/events/SDL_events.c | 2 +- src/events/SDL_events_c.h | 2 -- src/events/SDL_keyboard.c | 10 +++++----- src/events/SDL_keymap.c | 2 +- src/events/SDL_mouse.c | 4 ++-- src/events/SDL_touch.c | 9 ++++++--- src/filesystem/SDL_filesystem.c | 8 ++------ src/haptic/SDL_haptic.c | 8 ++++---- src/joystick/SDL_gamepad.c | 20 ++++++++------------ src/joystick/SDL_joystick.c | 24 ++++++++++++------------ src/sensor/SDL_sensor.c | 8 ++++---- src/thread/SDL_thread.c | 2 +- src/video/SDL_clipboard.c | 2 +- 19 files changed, 66 insertions(+), 71 deletions(-) diff --git a/src/SDL_internal.h b/src/SDL_internal.h index e9749a91b8f7a..fe70c124ba688 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -296,6 +296,8 @@ extern int SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeout extern int SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS); extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS); +extern const char *SDL_CreateTemporaryString(const char *string); + /* Queue `memory` to be passed to SDL_free once the event queue is emptied. this manages the list of pointers to SDL_AllocateEventMemory, but you can use it to queue pointers from other subsystems that can die at any diff --git a/src/SDL_properties.c b/src/SDL_properties.c index 1ac03e72e7cd2..164b4ddc660df 100644 --- a/src/SDL_properties.c +++ b/src/SDL_properties.c @@ -65,7 +65,7 @@ static void SDL_FreePropertyWithCleanup(const void *key, const void *value, void } break; case SDL_PROPERTY_TYPE_STRING: - SDL_FreeLater(property->value.string_value); // this pointer might be given to the app by SDL_GetStringProperty. + SDL_FreeLater(property->value.string_value); // SDL_GetStringProperty() returns this pointer break; default: break; diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 9d63bcfaaf54c..311b26f4d7e25 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -170,7 +170,7 @@ static int GetDefaultSampleFramesFromFreq(const int freq) int *SDL_ChannelMapDup(const int *origchmap, int channels) { const size_t chmaplen = sizeof (*origchmap) * channels; - int *chmap = (int *) SDL_malloc(chmaplen); + int *chmap = (int *)SDL_malloc(chmaplen); if (chmap) { SDL_memcpy(chmap, origchmap, chmaplen); } @@ -544,8 +544,8 @@ static void DestroyPhysicalAudioDevice(SDL_AudioDevice *device) SDL_DestroyMutex(device->lock); SDL_DestroyCondition(device->close_cond); SDL_free(device->work_buffer); - SDL_FreeLater(device->chmap); // this pointer is handed to the app during SDL_GetAudioDeviceChannelMap - SDL_FreeLater(device->name); // this pointer is handed to the app during SDL_GetAudioDeviceName + SDL_free(device->chmap); + SDL_free(device->name); SDL_free(device); } @@ -1432,7 +1432,7 @@ const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid) const char *retval = NULL; SDL_AudioDevice *device = ObtainPhysicalAudioDevice(devid); if (device) { - retval = device->name; + retval = SDL_CreateTemporaryString(device->name); } ReleaseAudioDevice(device); @@ -1465,8 +1465,8 @@ const int *SDL_GetAudioDeviceChannelMap(SDL_AudioDeviceID devid, int *count) int channels = 0; SDL_AudioDevice *device = ObtainPhysicalAudioDeviceDefaultAllowed(devid); if (device) { - retval = device->chmap; channels = device->spec.channels; + retval = SDL_FreeLater(SDL_ChannelMapDup(device->chmap, channels)); } ReleaseAudioDevice(device); diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index 3da7543ceb805..a7226dabf99d8 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -565,7 +565,7 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s if (src_spec) { if (src_spec->channels != stream->src_spec.channels) { - SDL_FreeLater(stream->src_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + SDL_free(stream->src_chmap); stream->src_chmap = NULL; } SDL_copyp(&stream->src_spec, src_spec); @@ -573,7 +573,7 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s if (dst_spec) { if (dst_spec->channels != stream->dst_spec.channels) { - SDL_FreeLater(stream->dst_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + SDL_free(stream->dst_chmap); stream->dst_chmap = NULL; } SDL_copyp(&stream->dst_spec, dst_spec); @@ -613,11 +613,11 @@ static int SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec if (!dupmap) { retval = SDL_SetError("Invalid channel mapping"); } else { - SDL_FreeLater(*stream_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + SDL_free(*stream_chmap); *stream_chmap = dupmap; } } else { - SDL_FreeLater(*stream_chmap); // this pointer is handed to the app during SDL_GetAudioStreamInputChannelMap + SDL_free(*stream_chmap); *stream_chmap = NULL; } } @@ -642,8 +642,8 @@ const int *SDL_GetAudioStreamInputChannelMap(SDL_AudioStream *stream, int *count int channels = 0; if (stream) { SDL_LockMutex(stream->lock); - retval = stream->src_chmap; channels = stream->src_spec.channels; + retval = SDL_FreeLater(SDL_ChannelMapDup(stream->src_chmap, channels)); SDL_UnlockMutex(stream->lock); } @@ -660,8 +660,8 @@ const int *SDL_GetAudioStreamOutputChannelMap(SDL_AudioStream *stream, int *coun int channels = 0; if (stream) { SDL_LockMutex(stream->lock); - retval = stream->dst_chmap; channels = stream->dst_spec.channels; + retval = SDL_FreeLater(SDL_ChannelMapDup(stream->dst_chmap, channels)); SDL_UnlockMutex(stream->lock); } diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index ad061a673fcb5..b17906ccfc4f3 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -286,7 +286,7 @@ static void DestroyPhysicalCamera(SDL_Camera *device) camera_driver.impl.FreeDeviceHandle(device); SDL_DestroyMutex(device->lock); SDL_free(device->all_specs); - SDL_FreeLater(device->name); // this is returned in SDL_GetCameraName. + SDL_free(device->name); SDL_free(device); } } @@ -674,10 +674,10 @@ int SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec) const char *SDL_GetCameraName(SDL_CameraID instance_id) { - char *retval = NULL; + const char *retval = NULL; SDL_Camera *device = ObtainPhysicalCamera(instance_id); if (device) { - retval = device->name; + retval = SDL_CreateTemporaryString(device->name); ReleaseCamera(device); } return retval; diff --git a/src/events/SDL_dropevents.c b/src/events/SDL_dropevents.c index 3af2356745a27..41fb629e8d699 100644 --- a/src/events/SDL_dropevents.c +++ b/src/events/SDL_dropevents.c @@ -59,13 +59,13 @@ static int SDL_SendDrop(SDL_Window *window, const SDL_EventType evtype, const ch event.type = evtype; event.common.timestamp = 0; if (source) { - event.drop.source = SDL_AllocateEventString(source); + event.drop.source = SDL_CreateTemporaryString(source); if (!event.drop.source) { return 0; } } if (data) { - event.drop.data = SDL_AllocateEventString(data); + event.drop.data = SDL_CreateTemporaryString(data); if (!event.drop.data) { return 0; } diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index bc7f7950de279..ff08db8d85ab2 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -290,7 +290,7 @@ void *SDL_AllocateEventMemory(size_t size) return SDL_FreeLater(SDL_malloc(size)); } -const char *SDL_AllocateEventString(const char *string) +const char *SDL_CreateTemporaryString(const char *string) { if (string) { return SDL_FreeLater(SDL_strdup(string)); diff --git a/src/events/SDL_events_c.h b/src/events/SDL_events_c.h index 778af32cadbf0..181583d71d07f 100644 --- a/src/events/SDL_events_c.h +++ b/src/events/SDL_events_c.h @@ -40,8 +40,6 @@ extern int SDL_StartEventLoop(void); extern void SDL_StopEventLoop(void); extern void SDL_QuitInterrupt(void); -extern const char *SDL_AllocateEventString(const char *string); - extern int SDL_SendAppEvent(SDL_EventType eventType); extern int SDL_SendKeymapChangedEvent(void); extern int SDL_SendLocaleChangedEvent(void); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index ec72ce80921f0..4ef6a04da4d4d 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -156,7 +156,7 @@ void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, SDL_bool send_event) return; } - SDL_FreeLater(SDL_keyboards[keyboard_index].name); + SDL_free(SDL_keyboards[keyboard_index].name); if (keyboard_index != SDL_keyboard_count - 1) { SDL_memcpy(&SDL_keyboards[keyboard_index], &SDL_keyboards[keyboard_index + 1], (SDL_keyboard_count - keyboard_index - 1) * sizeof(SDL_keyboards[keyboard_index])); @@ -207,7 +207,7 @@ const char *SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id) if (keyboard_index < 0) { return NULL; } - return SDL_keyboards[keyboard_index].name; + return SDL_CreateTemporaryString(SDL_keyboards[keyboard_index].name); } void SDL_ResetKeyboard(void) @@ -719,7 +719,7 @@ int SDL_SendKeyboardText(const char *text) event.type = SDL_EVENT_TEXT_INPUT; event.common.timestamp = 0; event.text.windowID = keyboard->focus ? keyboard->focus->id : 0; - event.text.text = SDL_AllocateEventString(text); + event.text.text = SDL_CreateTemporaryString(text); if (!event.text.text) { return 0; } @@ -751,7 +751,7 @@ int SDL_SendEditingText(const char *text, int start, int length) event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; event.edit.start = start; event.edit.length = length; - event.edit.text = SDL_AllocateEventString(text); + event.edit.text = SDL_CreateTemporaryString(text); if (!event.edit.text) { return 0; } @@ -783,7 +783,7 @@ int SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int sel return 0; } for (int i = 0; i < num_candidates; ++i) { - event_candidates[i] = SDL_AllocateEventString(candidates[i]); + event_candidates[i] = SDL_CreateTemporaryString(candidates[i]); } event_candidates[num_candidates] = NULL; event.edit_candidates.candidates = event_candidates; diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index db2861865b99d..c0ab8a16a8bd1 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -1017,7 +1017,7 @@ const char *SDL_GetKeyName(SDL_Keycode key) end = SDL_UCS4ToUTF8(key, name); *end = '\0'; - return SDL_FreeLater(SDL_strdup(name)); + return SDL_CreateTemporaryString(name); } } diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index b87ae49f52070..b84965280e083 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -312,7 +312,7 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, SDL_bool send_event) return; } - SDL_FreeLater(SDL_mice[mouse_index].name); // SDL_GetMouseNameForID returns this pointer. + SDL_free(SDL_mice[mouse_index].name); if (mouse_index != SDL_mouse_count - 1) { SDL_memcpy(&SDL_mice[mouse_index], &SDL_mice[mouse_index + 1], (SDL_mouse_count - mouse_index - 1) * sizeof(SDL_mice[mouse_index])); @@ -376,7 +376,7 @@ const char *SDL_GetMouseNameForID(SDL_MouseID instance_id) if (mouse_index < 0) { return NULL; } - return SDL_mice[mouse_index].name; + return SDL_CreateTemporaryString(SDL_mice[mouse_index].name); } void SDL_SetDefaultCursor(SDL_Cursor *cursor) diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index 160289bb23406..7d4e4ff19b01a 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -102,7 +102,10 @@ SDL_Touch *SDL_GetTouch(SDL_TouchID id) const char *SDL_GetTouchDeviceName(SDL_TouchID id) { SDL_Touch *touch = SDL_GetTouch(id); - return touch ? touch->name : NULL; + if (!touch) { + return NULL; + } + return SDL_CreateTemporaryString(touch->name); } SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID id) @@ -245,7 +248,7 @@ static int SDL_DelFinger(SDL_Touch *touch, SDL_FingerID fingerid) // Move the deleted finger to just past the end of the active fingers array and shift the active fingers by one. // This ensures that the descriptor for the now-deleted finger is located at `touch->fingers[touch->num_fingers]` // and is ready for use in SDL_AddFinger. - SDL_Finger *deleted_finger = touch->fingers[index]; + SDL_Finger *deleted_finger = touch->fingers[index]; SDL_memmove(&touch->fingers[index], &touch->fingers[index + 1], (touch->num_fingers - index) * sizeof(touch->fingers[index])); touch->fingers[touch->num_fingers] = deleted_finger; } @@ -493,7 +496,7 @@ void SDL_DelTouch(SDL_TouchID id) SDL_free(touch->fingers[i]); } SDL_free(touch->fingers); - SDL_FreeLater(touch->name); // this pointer might be given to the app by SDL_GetTouchDeviceName. + SDL_free(touch->name); SDL_free(touch); SDL_num_touch--; diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c index 03b1955ed101a..b1ba4266f4391 100644 --- a/src/filesystem/SDL_filesystem.c +++ b/src/filesystem/SDL_filesystem.c @@ -383,8 +383,7 @@ const char * const *SDL_InternalGlobDirectory(const char *path, const char *patt SDL_free(folded); SDL_free(pathcpy); - SDL_FreeLater(retval); - return (const char * const *) retval; + return SDL_FreeLater(retval); } static int GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata) @@ -435,10 +434,7 @@ const char *SDL_GetUserFolder(SDL_Folder folder) const char *SDL_GetPrefPath(const char *org, const char *app) { char *path = SDL_SYS_GetPrefPath(org, app); - if (path) { - SDL_FreeLater(path); - } - return path; + return SDL_FreeLater(path); } diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index ca4e279afebf1..a1321bc2def1f 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -100,7 +100,7 @@ const char *SDL_GetHapticNameForID(SDL_HapticID instance_id) if (SDL_GetHapticIndex(instance_id, &device_index)) { name = SDL_SYS_HapticName(device_index); } - return name ? SDL_FreeLater(SDL_strdup(name)) : NULL; + return SDL_CreateTemporaryString(name); } SDL_Haptic *SDL_OpenHaptic(SDL_HapticID instance_id) @@ -187,9 +187,9 @@ SDL_HapticID SDL_GetHapticID(SDL_Haptic *haptic) const char *SDL_GetHapticName(SDL_Haptic *haptic) { - CHECK_HAPTIC_MAGIC(haptic, 0); + CHECK_HAPTIC_MAGIC(haptic, NULL); - return haptic->name; + return SDL_CreateTemporaryString(haptic->name); } SDL_bool SDL_IsMouseHaptic(void) @@ -336,7 +336,7 @@ void SDL_CloseHaptic(SDL_Haptic *haptic) } /* Free the data associated with this device */ - SDL_FreeLater(haptic->name); // this pointer is handed to the app in SDL_GetHapticName() + SDL_free(haptic->name); SDL_free(haptic); } diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index cc2f3eceb5aa2..35961a2e4c7f3 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -1600,7 +1600,7 @@ static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, co /* Only overwrite the mapping if the priority is the same or higher. */ if (pGamepadMapping->priority <= priority) { /* Update existing mapping */ - SDL_FreeLater(pGamepadMapping->name); // this is returned in SDL_GetGamepadName. + SDL_free(pGamepadMapping->name); pGamepadMapping->name = pchName; SDL_free(pGamepadMapping->mapping); pGamepadMapping->mapping = pchMapping; @@ -2198,8 +2198,7 @@ const char * const *SDL_GetGamepadMappings(int *count) SDL_free(mappings); } - SDL_FreeLater(retval); - return (const char * const *) retval; + return SDL_FreeLater(retval); } /* @@ -2221,8 +2220,7 @@ const char *SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid) } SDL_UnlockJoysticks(); - SDL_FreeLater(retval); - return retval; + return SDL_FreeLater(retval); } /* @@ -2240,8 +2238,7 @@ const char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) } SDL_UnlockJoysticks(); - SDL_FreeLater(retval); - return retval; + return SDL_FreeLater(retval); } /* @@ -2434,7 +2431,7 @@ const char *SDL_GetGamepadNameForID(SDL_JoystickID instance_id) if (SDL_strcmp(mapping->name, "*") == 0) { retval = SDL_GetJoystickNameForID(instance_id); } else { - retval = mapping->name; + retval = SDL_CreateTemporaryString(mapping->name); } } } @@ -2538,8 +2535,7 @@ const char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) } SDL_UnlockJoysticks(); - SDL_FreeLater(retval); - return retval; + return SDL_FreeLater(retval); } /* @@ -3314,7 +3310,7 @@ const char *SDL_GetGamepadName(SDL_Gamepad *gamepad) gamepad->joystick->steam_handle != 0) { retval = SDL_GetJoystickName(gamepad->joystick); } else { - retval = gamepad->name; + retval = SDL_CreateTemporaryString(gamepad->name); } } SDL_UnlockJoysticks(); @@ -3707,7 +3703,7 @@ void SDL_QuitGamepadMappings(void) while (s_pSupportedGamepads) { pGamepadMap = s_pSupportedGamepads; s_pSupportedGamepads = s_pSupportedGamepads->next; - SDL_FreeLater(pGamepadMap->name); // this is returned in SDL_GetGamepadName. + SDL_free(pGamepadMap->name); SDL_free(pGamepadMap->mapping); SDL_free(pGamepadMap); } diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 1072b2fc484ef..91fec426128db 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -780,13 +780,13 @@ const char *SDL_GetJoystickNameForID(SDL_JoystickID instance_id) SDL_LockJoysticks(); info = SDL_GetJoystickVirtualGamepadInfoForID(instance_id); if (info) { - name = info->name; + name = SDL_CreateTemporaryString(info->name); } else if (SDL_GetDriverAndJoystickIndex(instance_id, &driver, &device_index)) { - name = driver->GetDeviceName(device_index); + name = SDL_CreateTemporaryString(driver->GetDeviceName(device_index)); } SDL_UnlockJoysticks(); - return name ? SDL_FreeLater(SDL_strdup(name)) : NULL; + return name; } /* @@ -800,14 +800,14 @@ const char *SDL_GetJoystickPathForID(SDL_JoystickID instance_id) SDL_LockJoysticks(); if (SDL_GetDriverAndJoystickIndex(instance_id, &driver, &device_index)) { - path = driver->GetDevicePath(device_index); + path = SDL_CreateTemporaryString(driver->GetDevicePath(device_index)); } SDL_UnlockJoysticks(); if (!path) { SDL_Unsupported(); } - return path ? SDL_FreeLater(SDL_strdup(path)) : NULL; + return path; } /* @@ -1653,9 +1653,9 @@ const char *SDL_GetJoystickName(SDL_Joystick *joystick) info = SDL_GetJoystickVirtualGamepadInfoForID(joystick->instance_id); if (info) { - retval = info->name; + retval = SDL_CreateTemporaryString(info->name); } else { - retval = joystick->name; + retval = SDL_CreateTemporaryString(joystick->name); } } SDL_UnlockJoysticks(); @@ -1675,7 +1675,7 @@ const char *SDL_GetJoystickPath(SDL_Joystick *joystick) CHECK_JOYSTICK_MAGIC(joystick, NULL); if (joystick->path) { - retval = joystick->path; + retval = SDL_CreateTemporaryString(joystick->path); } else { SDL_Unsupported(); retval = NULL; @@ -1884,9 +1884,9 @@ void SDL_CloseJoystick(SDL_Joystick *joystick) } /* Free the data associated with this joystick */ - SDL_FreeLater(joystick->name); // SDL_GetJoystickName returns this pointer. - SDL_FreeLater(joystick->path); // SDL_GetJoystickPath returns this pointer. - SDL_FreeLater(joystick->serial); // SDL_GetJoystickSerial returns this pointer. + SDL_free(joystick->name); + SDL_free(joystick->path); + SDL_free(joystick->serial); SDL_free(joystick->axes); SDL_free(joystick->balls); SDL_free(joystick->hats); @@ -3431,7 +3431,7 @@ const char *SDL_GetJoystickSerial(SDL_Joystick *joystick) { CHECK_JOYSTICK_MAGIC(joystick, NULL); - retval = joystick->serial; + retval = SDL_CreateTemporaryString(joystick->serial); } SDL_UnlockJoysticks(); diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index 141ca0d78ada8..f79debe372015 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -246,11 +246,11 @@ const char *SDL_GetSensorNameForID(SDL_SensorID instance_id) SDL_LockSensors(); if (SDL_GetDriverAndSensorIndex(instance_id, &driver, &device_index)) { - name = driver->GetDeviceName(device_index); + name = SDL_CreateTemporaryString(driver->GetDeviceName(device_index)); } SDL_UnlockSensors(); - return name ? SDL_FreeLater(SDL_strdup(name)) : NULL; + return name; } SDL_SensorType SDL_GetSensorTypeForID(SDL_SensorID instance_id) @@ -407,7 +407,7 @@ const char *SDL_GetSensorName(SDL_Sensor *sensor) { CHECK_SENSOR_MAGIC(sensor, NULL); - retval = sensor->name; + retval = SDL_CreateTemporaryString(sensor->name); } SDL_UnlockSensors(); @@ -526,7 +526,7 @@ void SDL_CloseSensor(SDL_Sensor *sensor) } /* Free the data associated with this sensor */ - SDL_FreeLater(sensor->name); // this pointer gets handed to the app by SDL_GetSensorName(). + SDL_free(sensor->name); SDL_free(sensor); } SDL_UnlockSensors(); diff --git a/src/thread/SDL_thread.c b/src/thread/SDL_thread.c index 87132c943a7e5..d502c02c440f8 100644 --- a/src/thread/SDL_thread.c +++ b/src/thread/SDL_thread.c @@ -329,7 +329,7 @@ void SDL_RunThread(SDL_Thread *thread) if (!SDL_AtomicCompareAndSwap(&thread->state, SDL_THREAD_STATE_ALIVE, SDL_THREAD_STATE_ZOMBIE)) { /* Clean up if something already detached us. */ if (SDL_AtomicCompareAndSwap(&thread->state, SDL_THREAD_STATE_DETACHED, SDL_THREAD_STATE_CLEANED)) { - SDL_FreeLater(thread->name); + SDL_free(thread->name); /* Can't free later, we've already cleaned up TLS */ SDL_free(thread); } } diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index 77ddc5941fdf7..a0bd9e8f7c8ec 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -349,7 +349,7 @@ int SDL_SetPrimarySelectionText(const char *text) return -1; } } else { - SDL_FreeLater(_this->primary_selection_text); // this pointer might be given to the app by SDL_GetPrimarySelectionText. + SDL_FreeLater(_this->primary_selection_text); // SDL_GetPrimarySelectionText() returns this pointer. _this->primary_selection_text = SDL_strdup(text); } From 8ca6caeda5695b4f5fb612c2cc406d6e8ab10c50 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 08:26:29 -0700 Subject: [PATCH 390/431] SDL_GetAudioPlaybackDevices() and SDL_GetAudioRecordingDevices() follow the SDL_GetStringRule --- docs/README-migration.md | 1 - include/SDL3/SDL_audio.h | 22 +++++++++++----------- src/audio/SDL_audio.c | 8 ++++---- src/dynapi/SDL_dynapi_procs.h | 4 ++-- test/testaudioinfo.c | 3 +-- test/testaudiorecording.c | 2 +- test/testautomation_audio.c | 4 +--- test/testmultiaudio.c | 5 ++--- test/testsurround.c | 4 +--- 9 files changed, 23 insertions(+), 30 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 737c992f5054a..d2164c07f811c 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -161,7 +161,6 @@ Rather than iterating over audio devices using a device index, there are new fun const char *name = SDL_GetAudioDeviceName(instance_id); SDL_Log("AudioDevice %" SDL_PRIu32 ": %s\n", instance_id, name); } - SDL_free(devices); } SDL_QuitSubSystem(SDL_INIT_AUDIO); } diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index a5d52e8a4f1b2..30bbbd70116b5 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -448,11 +448,11 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); * If this function returns NULL, to signify an error, `*count` will be set to * zero. * - * \param count a pointer filled in with the number of devices returned. NULL - * is allowed. - * \returns a 0 terminated array of device instance IDs which should be freed - * with SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of devices returned, may be NULL. + * \returns a 0 terminated array of device instance IDs or NULL on error; call SDL_GetError() for more + * information. * * \threadsafety It is safe to call this function from any thread. * @@ -461,7 +461,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); * \sa SDL_OpenAudioDevice * \sa SDL_GetAudioRecordingDevices */ -extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices(int *count); +extern SDL_DECLSPEC const SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices(int *count); /** * Get a list of currently-connected audio recording devices. @@ -477,10 +477,10 @@ extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices(int * * If this function returns NULL, to signify an error, `*count` will be set to * zero. * - * \param count a pointer filled in with the number of devices returned. NULL - * is allowed. - * \returns a 0 terminated array of device instance IDs which should be freed - * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of devices returned, may be NULL. + * \returns a 0 terminated array of device instance IDs, or NULL on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. @@ -490,7 +490,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices(int * * \sa SDL_OpenAudioDevice * \sa SDL_GetAudioPlaybackDevices */ -extern SDL_DECLSPEC SDL_AudioDeviceID *SDLCALL SDL_GetAudioRecordingDevices(int *count); +extern SDL_DECLSPEC const SDL_AudioDeviceID *SDLCALL SDL_GetAudioRecordingDevices(int *count); /** * Get the human-readable name of a specific audio device. diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 311b26f4d7e25..dd6037d279373 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -1330,7 +1330,7 @@ static int SDLCALL RecordingAudioThread(void *devicep) // thread entry point } -static SDL_AudioDeviceID *GetAudioDevices(int *count, SDL_bool recording) +static const SDL_AudioDeviceID *GetAudioDevices(int *count, SDL_bool recording) { SDL_AudioDeviceID *retval = NULL; int num_devices = 0; @@ -1373,15 +1373,15 @@ static SDL_AudioDeviceID *GetAudioDevices(int *count, SDL_bool recording) *count = 0; } } - return retval; + return SDL_FreeLater(retval); } -SDL_AudioDeviceID *SDL_GetAudioPlaybackDevices(int *count) +const SDL_AudioDeviceID *SDL_GetAudioPlaybackDevices(int *count) { return GetAudioDevices(count, SDL_FALSE); } -SDL_AudioDeviceID *SDL_GetAudioRecordingDevices(int *count) +const SDL_AudioDeviceID *SDL_GetAudioRecordingDevices(int *count) { return GetAudioDevices(count, SDL_TRUE); } diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index acb5eb19b13c0..4a633a3c0ee19 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -209,8 +209,8 @@ SDL_DYNAPI_PROC(int,SDL_GetAudioDeviceFormat,(SDL_AudioDeviceID a, SDL_AudioSpec SDL_DYNAPI_PROC(float,SDL_GetAudioDeviceGain,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDeviceName,(SDL_AudioDeviceID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetAudioDriver,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_AudioDeviceID*,SDL_GetAudioPlaybackDevices,(int *a),(a),return) -SDL_DYNAPI_PROC(SDL_AudioDeviceID*,SDL_GetAudioRecordingDevices,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_AudioDeviceID*,SDL_GetAudioPlaybackDevices,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_AudioDeviceID*,SDL_GetAudioRecordingDevices,(int *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamAvailable,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetAudioStreamData,(SDL_AudioStream *a, void *b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_AudioDeviceID,SDL_GetAudioStreamDevice,(SDL_AudioStream *a),(a),return) diff --git a/test/testaudioinfo.c b/test/testaudioinfo.c index a32268761bdde..f389e41b0e25d 100644 --- a/test/testaudioinfo.c +++ b/test/testaudioinfo.c @@ -20,7 +20,7 @@ print_devices(SDL_bool recording) const char *typestr = (recording ? "recording" : "playback"); int n = 0; int frames; - SDL_AudioDeviceID *devices = recording ? SDL_GetAudioRecordingDevices(&n) : SDL_GetAudioPlaybackDevices(&n); + const SDL_AudioDeviceID *devices = recording ? SDL_GetAudioRecordingDevices(&n) : SDL_GetAudioPlaybackDevices(&n); if (!devices) { SDL_Log(" Driver failed to report %s devices: %s\n\n", typestr, SDL_GetError()); @@ -46,7 +46,6 @@ print_devices(SDL_bool recording) } SDL_Log("\n"); } - SDL_free(devices); } int main(int argc, char **argv) diff --git a/test/testaudiorecording.c b/test/testaudiorecording.c index da7f3736d86ce..214d6d040aa68 100644 --- a/test/testaudiorecording.c +++ b/test/testaudiorecording.c @@ -23,7 +23,7 @@ static SDLTest_CommonState *state = NULL; int SDL_AppInit(void **appstate, int argc, char **argv) { - SDL_AudioDeviceID *devices; + const SDL_AudioDeviceID *devices; SDL_AudioSpec outspec; SDL_AudioSpec inspec; SDL_AudioDeviceID device; diff --git a/test/testautomation_audio.c b/test/testautomation_audio.c index 5459243d0a791..a61c58fe40f71 100644 --- a/test/testautomation_audio.c +++ b/test/testautomation_audio.c @@ -366,7 +366,7 @@ static int audio_enumerateAndNameAudioDevices(void *arg) int t; int i, n; const char *name; - SDL_AudioDeviceID *devices = NULL; + const SDL_AudioDeviceID *devices = NULL; /* Iterate over types: t=0 playback device, t=1 recording device */ for (t = 0; t < 2; t++) { @@ -388,8 +388,6 @@ static int audio_enumerateAndNameAudioDevices(void *arg) } } } - - SDL_free(devices); } return TEST_COMPLETED; diff --git a/test/testmultiaudio.c b/test/testmultiaudio.c index 50de78e486284..8c91ca1cd58c6 100644 --- a/test/testmultiaudio.c +++ b/test/testmultiaudio.c @@ -43,7 +43,7 @@ static void loop(void) #endif static void -test_multi_audio(SDL_AudioDeviceID *devices, int devcount) +test_multi_audio(const SDL_AudioDeviceID *devices, int devcount) { int keep_going = 1; SDL_AudioStream **streams = NULL; @@ -135,7 +135,7 @@ test_multi_audio(SDL_AudioDeviceID *devices, int devcount) int main(int argc, char **argv) { - SDL_AudioDeviceID *devices = NULL; + const SDL_AudioDeviceID *devices = NULL; int devcount = 0; int i; char *filename = NULL; @@ -194,7 +194,6 @@ int main(int argc, char **argv) } } - SDL_free(devices); SDL_free(filename); SDL_Quit(); diff --git a/test/testsurround.c b/test/testsurround.c index 9d13de801d9ec..7601bffa93bc5 100644 --- a/test/testsurround.c +++ b/test/testsurround.c @@ -146,7 +146,7 @@ static void SDLCALL fill_buffer(void *userdata, SDL_AudioStream *stream, int len int main(int argc, char *argv[]) { - SDL_AudioDeviceID *devices = NULL; + const SDL_AudioDeviceID *devices = NULL; SDLTest_CommonState *state; int devcount = 0; int i; @@ -234,8 +234,6 @@ int main(int argc, char *argv[]) SDL_DestroyAudioStream(stream); } - SDL_free(devices); - SDL_Quit(); return 0; } From bdafc8e21211abaa5f6e981d78ed183ca8e5f15e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 08:30:50 -0700 Subject: [PATCH 391/431] SDL_GetWindows() follows the SDL_GetStringRule --- include/SDL3/SDL_video.h | 8 ++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/video/SDL_video.c | 4 ++-- test/testautomation_video.c | 3 +-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 3819bfbfea14b..4572a73455260 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -791,15 +791,15 @@ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window /** * Get a list of valid windows. * + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * * \param count a pointer filled in with the number of windows returned, may * be NULL. - * \returns a 0 terminated array of window pointers which should be freed with - * SDL_free(), or NULL on error; call SDL_GetError() for more - * details. + * \returns a NULL terminated array of SDL_Window pointers or NULL on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Window **SDLCALL SDL_GetWindows(int *count); +extern SDL_DECLSPEC SDL_Window * const *SDLCALL SDL_GetWindows(int *count); /** * Create a window with the specified dimensions and flags. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 4a633a3c0ee19..63809573537bf 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -533,7 +533,7 @@ SDL_DYNAPI_PROC(int,SDL_GetWindowSizeInPixels,(SDL_Window *a, int *b, int *c),(a SDL_DYNAPI_PROC(SDL_Surface*,SDL_GetWindowSurface,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowSurfaceVSync,(SDL_Window *a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetWindowTitle,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(SDL_Window**,SDL_GetWindows,(int *a),(a),return) +SDL_DYNAPI_PROC(SDL_Window* const*,SDL_GetWindows,(int *a),(a),return) SDL_DYNAPI_PROC(const char * const *,SDL_GlobDirectory,(const char *a, const char *b, SDL_GlobFlags c, int *d),(a,b,c,d),return) SDL_DYNAPI_PROC(const char * const *,SDL_GlobStorageDirectory,(SDL_Storage *a, const char *b, const char *c, SDL_GlobFlags d, int *e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(SDL_bool,SDL_HapticEffectSupported,(SDL_Haptic *a, const SDL_HapticEffect *b),(a,b),return) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 1270ee90cbc34..0fe87785ed862 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2056,7 +2056,7 @@ void SDL_ToggleDragAndDropSupport(void) } } -SDL_Window **SDLCALL SDL_GetWindows(int *count) +SDL_Window * const *SDLCALL SDL_GetWindows(int *count) { if (count) { *count = 0; @@ -2091,7 +2091,7 @@ SDL_Window **SDLCALL SDL_GetWindows(int *count) if (count) { *count = num_added; } - return windows; + return SDL_FreeLater(windows); } static void ApplyWindowFlags(SDL_Window *window, SDL_WindowFlags flags) diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 5a4c32b3e1030..c044fd5df31f9 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -13,7 +13,7 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) { SDL_Window *window; - SDL_Window **windows; + SDL_Window * const *windows; SDL_Event event; int w, h; int count; @@ -34,7 +34,6 @@ static SDL_Window *createVideoSuiteTestWindow(const char *title) windows = SDL_GetWindows(&count); SDLTest_AssertCheck(windows != NULL, "Validate that returned window list is not NULL"); SDLTest_AssertCheck(windows[0] == window, "Validate that the window is first in the window list"); - SDL_free(windows); /* Wayland and XWayland windows require that a frame be presented before they are fully mapped and visible onscreen. * This is required for the mouse/keyboard grab tests to pass. From 637e9700ddb08982e552c8e95597abdf2814a753 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 08:54:50 -0700 Subject: [PATCH 392/431] Standardize placement of '*' in function declarations Implemented using these sed commands on the headers: sed -E -i'' '/SDLCALL|;/ s,([a-z])\* ,\1 *,g' * sed -E -i'' 's,(\(.*[^\*])\* ([a-z])(.*\)),\1*\2\3,g' * sed -E -i'' 's,\*const,* const,g' * sed -E -i'' 's,\*SDLCALL,* SDLCALL,g' * sed -E -i'' 's,void\(,void (,g' * git checkout *gl* --- include/SDL3/SDL_assert.h | 2 +- include/SDL3/SDL_atomic.h | 4 +-- include/SDL3/SDL_audio.h | 14 ++++---- include/SDL3/SDL_camera.h | 10 +++--- include/SDL3/SDL_clipboard.h | 2 +- include/SDL3/SDL_dialog.h | 2 +- include/SDL3/SDL_error.h | 2 +- include/SDL3/SDL_filesystem.h | 8 ++--- include/SDL3/SDL_gamepad.h | 30 ++++++++-------- include/SDL3/SDL_haptic.h | 14 ++++---- include/SDL3/SDL_iostream.h | 14 ++++---- include/SDL3/SDL_joystick.h | 16 ++++----- include/SDL3/SDL_keyboard.h | 10 +++--- include/SDL3/SDL_loadso.h | 2 +- include/SDL3/SDL_main.h | 4 +-- include/SDL3/SDL_main_impl.h | 4 +-- include/SDL3/SDL_metal.h | 4 +-- include/SDL3/SDL_mouse.h | 18 +++++----- include/SDL3/SDL_mutex.h | 8 ++--- include/SDL3/SDL_pen.h | 4 +-- include/SDL3/SDL_pixels.h | 4 +-- include/SDL3/SDL_properties.h | 4 +-- include/SDL3/SDL_render.h | 24 ++++++------- include/SDL3/SDL_sensor.h | 10 +++--- include/SDL3/SDL_stdinc.h | 64 +++++++++++++++++------------------ include/SDL3/SDL_storage.h | 10 +++--- include/SDL3/SDL_surface.h | 14 ++++---- include/SDL3/SDL_system.h | 12 +++---- include/SDL3/SDL_thread.h | 12 +++---- include/SDL3/SDL_touch.h | 6 ++-- include/SDL3/SDL_version.h | 2 +- include/SDL3/SDL_video.h | 42 +++++++++++------------ include/SDL3/SDL_vulkan.h | 2 +- 33 files changed, 189 insertions(+), 189 deletions(-) diff --git a/include/SDL3/SDL_assert.h b/include/SDL3/SDL_assert.h index 9d11c9d3274d1..346d1e3a45f80 100644 --- a/include/SDL3/SDL_assert.h +++ b/include/SDL3/SDL_assert.h @@ -433,7 +433,7 @@ extern SDL_DECLSPEC SDL_AssertState SDLCALL SDL_ReportAssertion(SDL_AssertData * * \since This datatype is available since SDL 3.0.0. */ typedef SDL_AssertState (SDLCALL *SDL_AssertionHandler)( - const SDL_AssertData* data, void* userdata); + const SDL_AssertData *data, void *userdata); /** * Set an application-defined assertion handler. diff --git a/include/SDL3/SDL_atomic.h b/include/SDL3/SDL_atomic.h index 90594b5ef301e..fbf01c4bc98ac 100644 --- a/include/SDL3/SDL_atomic.h +++ b/include/SDL3/SDL_atomic.h @@ -477,7 +477,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AtomicCompareAndSwapPointer(void **a, v * \sa SDL_AtomicCompareAndSwapPointer * \sa SDL_AtomicGetPtr */ -extern SDL_DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicSetPtr(void **a, void *v); /** * Get the value of a pointer atomically. @@ -495,7 +495,7 @@ extern SDL_DECLSPEC void* SDLCALL SDL_AtomicSetPtr(void **a, void* v); * \sa SDL_AtomicCompareAndSwapPointer * \sa SDL_AtomicSetPtr */ -extern SDL_DECLSPEC void* SDLCALL SDL_AtomicGetPtr(void **a); +extern SDL_DECLSPEC void * SDLCALL SDL_AtomicGetPtr(void **a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 30bbbd70116b5..72563c2a9a961 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -413,7 +413,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); * * \sa SDL_GetNumAudioDrivers */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDriver(int index); /* @} */ /** @@ -432,7 +432,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentAudioDriver(void); /** * Get a list of currently-connected audio playback devices. @@ -461,7 +461,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentAudioDriver(void); * \sa SDL_OpenAudioDevice * \sa SDL_GetAudioRecordingDevices */ -extern SDL_DECLSPEC const SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices(int *count); +extern SDL_DECLSPEC const SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackDevices(int *count); /** * Get a list of currently-connected audio recording devices. @@ -490,7 +490,7 @@ extern SDL_DECLSPEC const SDL_AudioDeviceID *SDLCALL SDL_GetAudioPlaybackDevices * \sa SDL_OpenAudioDevice * \sa SDL_GetAudioPlaybackDevices */ -extern SDL_DECLSPEC const SDL_AudioDeviceID *SDLCALL SDL_GetAudioRecordingDevices(int *count); +extern SDL_DECLSPEC const SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevices(int *count); /** * Get the human-readable name of a specific audio device. @@ -509,7 +509,7 @@ extern SDL_DECLSPEC const SDL_AudioDeviceID *SDLCALL SDL_GetAudioRecordingDevice * \sa SDL_GetAudioRecordingDevices * \sa SDL_GetDefaultAudioInfo */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDeviceName(SDL_AudioDeviceID devid); /** * Get the current audio format of a specific audio device. @@ -940,7 +940,7 @@ extern SDL_DECLSPEC SDL_AudioDeviceID SDLCALL SDL_GetAudioStreamDevice(SDL_Audio * \sa SDL_SetAudioStreamFormat * \sa SDL_DestroyAudioStream */ -extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec); +extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec); /** * Get the properties associated with an audio stream. @@ -1714,7 +1714,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_DestroyAudioStream(SDL_AudioStream *stream) * \sa SDL_GetAudioStreamDevice * \sa SDL_ResumeAudioStreamDevice */ -extern SDL_DECLSPEC SDL_AudioStream *SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata); +extern SDL_DECLSPEC SDL_AudioStream * SDLCALL SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_AudioSpec *spec, SDL_AudioStreamCallback callback, void *userdata); /** * A callback that fires when data is about to be fed to an audio device. diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 5285c7f1c0683..ca13689a0c2b6 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -147,7 +147,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void); * * \sa SDL_GetNumCameraDrivers */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDriver(int index); /** * Get the name of the current camera driver. @@ -165,7 +165,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCameraDriver(int index); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void); /** * Get a list of currently connected camera devices. @@ -182,7 +182,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentCameraDriver(void); * * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraID *SDLCALL SDL_GetCameras(int *count); +extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count); /** * Get the list of native formats/sizes a camera supports. @@ -225,7 +225,7 @@ extern SDL_DECLSPEC SDL_CameraID *SDLCALL SDL_GetCameras(int *count); * \sa SDL_GetCameras * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraSpec *SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count); +extern SDL_DECLSPEC SDL_CameraSpec * SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count); /** * Get the human-readable device name for a camera. @@ -307,7 +307,7 @@ extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraI * \sa SDL_GetCameras * \sa SDL_GetCameraFormat */ -extern SDL_DECLSPEC SDL_Camera *SDLCALL SDL_OpenCamera(SDL_CameraID instance_id, const SDL_CameraSpec *spec); +extern SDL_DECLSPEC SDL_Camera * SDLCALL SDL_OpenCamera(SDL_CameraID instance_id, const SDL_CameraSpec *spec); /** * Query if camera access has been approved by the user. diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 44fecbec843ca..8d7a190873a01 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -227,7 +227,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearClipboardData(void); * \sa SDL_HasClipboardData * \sa SDL_SetClipboardData */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size); +extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size); /** * Query whether there is data in the clipboard for the provided mime type. diff --git a/include/SDL3/SDL_dialog.h b/include/SDL3/SDL_dialog.h index 9acf354bdc34e..8a198a84458ec 100644 --- a/include/SDL3/SDL_dialog.h +++ b/include/SDL3/SDL_dialog.h @@ -93,7 +93,7 @@ typedef struct SDL_DialogFileFilter * \sa SDL_ShowSaveFileDialog * \sa SDL_ShowOpenFolderDialog */ -typedef void(SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * const *filelist, int filter); +typedef void (SDLCALL *SDL_DialogFileCallback)(void *userdata, const char * const *filelist, int filter); /** * Displays a dialog that lets the user select a file on their filesystem. diff --git a/include/SDL3/SDL_error.h b/include/SDL3/SDL_error.h index dc18b527a7d0b..141b8deee979b 100644 --- a/include/SDL3/SDL_error.h +++ b/include/SDL3/SDL_error.h @@ -110,7 +110,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_OutOfMemory(void); * \sa SDL_ClearError * \sa SDL_SetError */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetError(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetError(void); /** * Clear any previous error message for this thread. diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index ab8d174399ee4..b3077b6046ed4 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -79,7 +79,7 @@ extern "C" { * * \sa SDL_GetPrefPath */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetBasePath(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetBasePath(void); /** * Get the user-and-app-specific path where files can be written. @@ -135,7 +135,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetBasePath(void); * * \sa SDL_GetBasePath */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetPrefPath(const char *org, const char *app); /** * The type of the OS-provided default folder for a specific purpose. @@ -233,7 +233,7 @@ typedef enum SDL_Folder * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetUserFolder(SDL_Folder folder); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetUserFolder(SDL_Folder folder); /* Abstract filesystem interface */ @@ -370,7 +370,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char * const *SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count); +extern SDL_DECLSPEC const char * const * SDLCALL SDL_GlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 3aa7de6348b52..f0868df05d0c2 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -478,7 +478,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void); * \sa SDL_HasGamepad * \sa SDL_OpenGamepad */ -extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetGamepads(int *count); +extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count); /** * Check if the given joystick is supported by the gamepad interface. @@ -510,7 +510,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); * \sa SDL_GetGamepadName * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID instance_id); /** * Get the implementation dependent path of a gamepad. @@ -528,7 +528,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID i * \sa SDL_GetGamepadPath * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPathForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadPathForID(SDL_JoystickID instance_id); /** * Get the player index of a gamepad. @@ -660,7 +660,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_Joys * \sa SDL_GetGamepads * \sa SDL_GetGamepadMapping */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickID instance_id); /** * Open a gamepad for use. @@ -674,7 +674,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadMappingForID(SDL_JoystickI * \sa SDL_CloseGamepad * \sa SDL_IsGamepad */ -extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_Gamepad * SDLCALL SDL_OpenGamepad(SDL_JoystickID instance_id); /** * Get the SDL_Gamepad associated with a joystick instance ID, if it has been @@ -686,7 +686,7 @@ extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_OpenGamepad(SDL_JoystickID instance * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_Gamepad * SDLCALL SDL_GetGamepadFromID(SDL_JoystickID instance_id); /** * Get the SDL_Gamepad associated with a player index. @@ -699,7 +699,7 @@ extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromID(SDL_JoystickID ins * \sa SDL_GetGamepadPlayerIndex * \sa SDL_SetGamepadPlayerIndex */ -extern SDL_DECLSPEC SDL_Gamepad *SDLCALL SDL_GetGamepadFromPlayerIndex(int player_index); +extern SDL_DECLSPEC SDL_Gamepad * SDLCALL SDL_GetGamepadFromPlayerIndex(int player_index); /** * Get the properties associated with an opened gamepad. @@ -760,7 +760,7 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad * * \sa SDL_GetGamepadNameForID */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad); /** * Get the implementation-dependent path for an opened gamepad. @@ -776,7 +776,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad) * * \sa SDL_GetGamepadPathForID */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadPath(SDL_Gamepad *gamepad); /** * Get the type of an opened gamepad. @@ -975,7 +975,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepad); +extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetGamepadJoystick(SDL_Gamepad *gamepad); /** * Set the state of gamepad event processing. @@ -1018,7 +1018,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_GamepadBinding **SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count); +extern SDL_DECLSPEC SDL_GamepadBinding ** SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count); /** * Manually pump gamepad updates if not using the loop. @@ -1063,7 +1063,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const c * * \sa SDL_GetGamepadTypeFromString */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType type); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForType(SDL_GamepadType type); /** * Convert a string into SDL_GamepadAxis enum. @@ -1176,7 +1176,7 @@ extern SDL_DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(con * * \sa SDL_GetGamepadButtonFromString */ -extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadStringForButton(SDL_GamepadButton button); /** * Query whether a gamepad has a given button. @@ -1463,7 +1463,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad); * * \sa SDL_GetGamepadAppleSFSymbolsNameForAxis */ -extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButton(SDL_Gamepad *gamepad, SDL_GamepadButton button); /** * Return the sfSymbolsName for a given axis on a gamepad on Apple platforms. @@ -1478,7 +1478,7 @@ extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButto * * \sa SDL_GetGamepadAppleSFSymbolsNameForButton */ -extern SDL_DECLSPEC const char* SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis); /* Ends C function definitions when using C++ */ diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index f99096f653c7e..93c646f57a353 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -942,7 +942,7 @@ typedef Uint32 SDL_HapticID; * * \sa SDL_OpenHaptic */ -extern SDL_DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count); +extern SDL_DECLSPEC SDL_HapticID * SDLCALL SDL_GetHaptics(int *count); /** * Get the implementation dependent name of a haptic device. @@ -961,7 +961,7 @@ extern SDL_DECLSPEC SDL_HapticID *SDLCALL SDL_GetHaptics(int *count); * \sa SDL_GetHapticName * \sa SDL_OpenHaptic */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticNameForID(SDL_HapticID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticNameForID(SDL_HapticID instance_id); /** * Open a haptic device for use. @@ -986,7 +986,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticNameForID(SDL_HapticID inst * \sa SDL_SetHapticAutocenter * \sa SDL_SetHapticGain */ -extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id); +extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id); /** @@ -998,7 +998,7 @@ extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHaptic(SDL_HapticID instance_id) * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_GetHapticFromID(SDL_HapticID instance_id); +extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_GetHapticFromID(SDL_HapticID instance_id); /** * Get the instance ID of an opened haptic device. @@ -1025,7 +1025,7 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic); * * \sa SDL_GetHapticNameForID */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetHapticName(SDL_Haptic *haptic); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetHapticName(SDL_Haptic *haptic); /** * Query whether or not the current mouse has haptic capabilities. @@ -1049,7 +1049,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsMouseHaptic(void); * \sa SDL_CloseHaptic * \sa SDL_IsMouseHaptic */ -extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromMouse(void); +extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_OpenHapticFromMouse(void); /** * Query if a joystick has haptic features. @@ -1083,7 +1083,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsJoystickHaptic(SDL_Joystick *joystick * \sa SDL_CloseHaptic * \sa SDL_IsJoystickHaptic */ -extern SDL_DECLSPEC SDL_Haptic *SDLCALL SDL_OpenHapticFromJoystick(SDL_Joystick *joystick); +extern SDL_DECLSPEC SDL_Haptic * SDLCALL SDL_OpenHapticFromJoystick(SDL_Joystick *joystick); /** * Close a haptic device previously opened with SDL_OpenHaptic(). diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index fcd661234d284..08329082cefc4 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -235,7 +235,7 @@ typedef struct SDL_IOStream SDL_IOStream; * \sa SDL_TellIO * \sa SDL_WriteIO */ -extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromFile(const char *file, const char *mode); +extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromFile(const char *file, const char *mode); #define SDL_PROP_IOSTREAM_WINDOWS_HANDLE_POINTER "SDL.iostream.windows.handle" #define SDL_PROP_IOSTREAM_STDIO_FILE_POINTER "SDL.iostream.stdio.file" @@ -270,7 +270,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromFile(const char *file, const * \sa SDL_TellIO * \sa SDL_WriteIO */ -extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromMem(void *mem, size_t size); +extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromMem(void *mem, size_t size); /** * Use this function to prepare a read-only memory buffer for use with @@ -302,7 +302,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromMem(void *mem, size_t size); * \sa SDL_SeekIO * \sa SDL_TellIO */ -extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromConstMem(const void *mem, size_t size); +extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromConstMem(const void *mem, size_t size); /** * Use this function to create an SDL_IOStream that is backed by dynamically @@ -330,7 +330,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromConstMem(const void *mem, si * \sa SDL_TellIO * \sa SDL_WriteIO */ -extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromDynamicMem(void); +extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromDynamicMem(void); #define SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER "SDL.iostream.dynamic.memory" #define SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER "SDL.iostream.dynamic.chunksize" @@ -364,7 +364,7 @@ extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_IOFromDynamicMem(void); * \sa SDL_IOFromFile * \sa SDL_IOFromMem */ -extern SDL_DECLSPEC SDL_IOStream *SDLCALL SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata); +extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata); /** * Close and free an allocated SDL_IOStream structure. @@ -582,7 +582,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN * * \sa SDL_LoadFile */ -extern SDL_DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio); +extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio); /** * Load all the data from a file path. @@ -601,7 +601,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *dat * * \sa SDL_LoadFile_IO */ -extern SDL_DECLSPEC void *SDLCALL SDL_LoadFile(const char *file, size_t *datasize); +extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile(const char *file, size_t *datasize); /** * \name Read endian functions diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 35057d16a4590..86f43342cffdd 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -220,7 +220,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); * \sa SDL_HasJoystick * \sa SDL_OpenJoystick */ -extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count); +extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count); /** * Get the implementation dependent name of a joystick. @@ -238,7 +238,7 @@ extern SDL_DECLSPEC SDL_JoystickID *SDLCALL SDL_GetJoysticks(int *count); * \sa SDL_GetJoystickName * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID instance_id); /** * Get the implementation dependent path of a joystick. @@ -256,7 +256,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID * \sa SDL_GetJoystickPath * \sa SDL_GetJoysticks */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPathForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickPathForID(SDL_JoystickID instance_id); /** * Get the player index of a joystick. @@ -371,7 +371,7 @@ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeForID(SDL_Joysti * * \sa SDL_CloseJoystick */ -extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_OpenJoystick(SDL_JoystickID instance_id); /** * Get the SDL_Joystick associated with an instance ID, if it has been opened. @@ -382,7 +382,7 @@ extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_OpenJoystick(SDL_JoystickID instan * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetJoystickFromID(SDL_JoystickID instance_id); /** * Get the SDL_Joystick associated with a player index. @@ -396,7 +396,7 @@ extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromID(SDL_JoystickID i * \sa SDL_GetJoystickPlayerIndex * \sa SDL_SetJoystickPlayerIndex */ -extern SDL_DECLSPEC SDL_Joystick *SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index); +extern SDL_DECLSPEC SDL_Joystick * SDLCALL SDL_GetJoystickFromPlayerIndex(int player_index); /** * The structure that describes a virtual joystick touchpad. @@ -676,7 +676,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst * * \sa SDL_GetJoystickNameForID */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *joystick); /** * Get the implementation dependent path of a joystick. @@ -691,7 +691,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickName(SDL_Joystick *joysti * * \sa SDL_GetJoystickPathForID */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickPath(SDL_Joystick *joystick); /** * Get the player index of an opened joystick. diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index ae571a785aaad..cfa6b10f6d378 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -83,7 +83,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * \sa SDL_GetKeyboardNameForID * \sa SDL_HasKeyboard */ -extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); +extern SDL_DECLSPEC SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count); /** * Get the name of a keyboard. @@ -100,7 +100,7 @@ extern SDL_DECLSPEC SDL_KeyboardID *SDLCALL SDL_GetKeyboards(int *count); * * \sa SDL_GetKeyboards */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id); /** * Query the window which currently has keyboard focus. @@ -140,7 +140,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void); * \sa SDL_PumpEvents * \sa SDL_ResetKeyboard */ -extern SDL_DECLSPEC const Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys); +extern SDL_DECLSPEC const Uint8 * SDLCALL SDL_GetKeyboardState(int *numkeys); /** * Clear the state of the keyboard. @@ -301,7 +301,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const * \sa SDL_GetScancodeFromName * \sa SDL_SetScancodeName */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetScancodeName(SDL_Scancode scancode); /** * Get a scancode from a human-readable name. @@ -337,7 +337,7 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam * \sa SDL_GetKeyFromScancode * \sa SDL_GetScancodeFromKey */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetKeyName(SDL_Keycode key); /** * Get a key code from a human-readable name. diff --git a/include/SDL3/SDL_loadso.h b/include/SDL3/SDL_loadso.h index 4d92c55baa6a4..5911b232490fc 100644 --- a/include/SDL3/SDL_loadso.h +++ b/include/SDL3/SDL_loadso.h @@ -63,7 +63,7 @@ extern "C" { * \sa SDL_LoadFunction * \sa SDL_UnloadObject */ -extern SDL_DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); +extern SDL_DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); /** * Look up the address of the named function in a shared object. diff --git a/include/SDL3/SDL_main.h b/include/SDL3/SDL_main.h index cd6a0b332f35a..0985629a9faf9 100644 --- a/include/SDL3/SDL_main.h +++ b/include/SDL3/SDL_main.h @@ -533,7 +533,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetMainReady(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved); +extern SDL_DECLSPEC int SDLCALL SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void *reserved); /** * An entry point for SDL's use in SDL_MAIN_USE_CALLBACKS. @@ -560,7 +560,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RunApp(int argc, char* argv[], SDL_main_func * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char* argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit); +extern SDL_DECLSPEC int SDLCALL SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit); #if defined(SDL_PLATFORM_WIN32) || defined(SDL_PLATFORM_GDK) diff --git a/include/SDL3/SDL_main_impl.h b/include/SDL3/SDL_main_impl.h index b7c7cad3960d9..ad122dfc5bccc 100644 --- a/include/SDL3/SDL_main_impl.h +++ b/include/SDL3/SDL_main_impl.h @@ -75,8 +75,8 @@ #endif typedef struct HINSTANCE__ * HINSTANCE; - typedef char* LPSTR; - typedef wchar_t* PWSTR; + typedef char *LPSTR; + typedef wchar_t *PWSTR; /* The VC++ compiler needs main/wmain defined, but not for GDK */ #if defined(_MSC_VER) && !defined(SDL_PLATFORM_GDK) diff --git a/include/SDL3/SDL_metal.h b/include/SDL3/SDL_metal.h index 4e987086b9b03..7c9aece7a95a4 100644 --- a/include/SDL3/SDL_metal.h +++ b/include/SDL3/SDL_metal.h @@ -66,7 +66,7 @@ typedef void *SDL_MetalView; * \sa SDL_Metal_DestroyView * \sa SDL_Metal_GetLayer */ -extern SDL_DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); +extern SDL_DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window *window); /** * Destroy an existing SDL_MetalView object. @@ -90,7 +90,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void *SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); +extern SDL_DECLSPEC void * SDLCALL SDL_Metal_GetLayer(SDL_MetalView view); /* @} *//* Metal support functions */ diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index ca7aee172fa3a..3a2cda67e2552 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -145,7 +145,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * \sa SDL_GetMouseNameForID * \sa SDL_HasMouse */ -extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); +extern SDL_DECLSPEC SDL_MouseID * SDLCALL SDL_GetMice(int *count); /** * Get the name of a mouse. @@ -162,7 +162,7 @@ extern SDL_DECLSPEC SDL_MouseID *SDLCALL SDL_GetMice(int *count); * * \sa SDL_GetMice */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetMouseNameForID(SDL_MouseID instance_id); /** * Get the window which currently has mouse focus. @@ -406,7 +406,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetRelativeMouseMode(void); * \sa SDL_DestroyCursor * \sa SDL_SetCursor */ -extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, +extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateCursor(const Uint8 * data, const Uint8 * mask, int w, int h, int hot_x, int hot_y); @@ -427,7 +427,7 @@ extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateCursor(const Uint8 * data, * \sa SDL_DestroyCursor * \sa SDL_SetCursor */ -extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, +extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y); @@ -442,7 +442,7 @@ extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateColorCursor(SDL_Surface *surfa * * \sa SDL_DestroyCursor */ -extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); +extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor id); /** * Set the active cursor. @@ -460,7 +460,7 @@ extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_CreateSystemCursor(SDL_SystemCursor * * \sa SDL_GetCursor */ -extern SDL_DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor); +extern SDL_DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor *cursor); /** * Get the active cursor. @@ -474,7 +474,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetCursor(SDL_Cursor * cursor); * * \sa SDL_SetCursor */ -extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); +extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); /** * Get the default cursor. @@ -486,7 +486,7 @@ extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetCursor(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); +extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetDefaultCursor(void); /** * Free a previously-created cursor. @@ -502,7 +502,7 @@ extern SDL_DECLSPEC SDL_Cursor *SDLCALL SDL_GetDefaultCursor(void); * \sa SDL_CreateCursor * \sa SDL_CreateSystemCursor */ -extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor * cursor); +extern SDL_DECLSPEC void SDLCALL SDL_DestroyCursor(SDL_Cursor *cursor); /** * Show the cursor. diff --git a/include/SDL3/SDL_mutex.h b/include/SDL3/SDL_mutex.h index e260340558f98..aed836dc43f5c 100644 --- a/include/SDL3/SDL_mutex.h +++ b/include/SDL3/SDL_mutex.h @@ -164,7 +164,7 @@ typedef struct SDL_Mutex SDL_Mutex; * \sa SDL_TryLockMutex * \sa SDL_UnlockMutex */ -extern SDL_DECLSPEC SDL_Mutex *SDLCALL SDL_CreateMutex(void); +extern SDL_DECLSPEC SDL_Mutex * SDLCALL SDL_CreateMutex(void); /** * Lock the mutex. @@ -331,7 +331,7 @@ typedef struct SDL_RWLock SDL_RWLock; * \sa SDL_TryLockRWLockForWriting * \sa SDL_UnlockRWLock */ -extern SDL_DECLSPEC SDL_RWLock *SDLCALL SDL_CreateRWLock(void); +extern SDL_DECLSPEC SDL_RWLock * SDLCALL SDL_CreateRWLock(void); /** * Lock the read/write lock for _read only_ operations. @@ -550,7 +550,7 @@ typedef struct SDL_Semaphore SDL_Semaphore; * \sa SDL_WaitSemaphore * \sa SDL_WaitSemaphoreTimeout */ -extern SDL_DECLSPEC SDL_Semaphore *SDLCALL SDL_CreateSemaphore(Uint32 initial_value); +extern SDL_DECLSPEC SDL_Semaphore * SDLCALL SDL_CreateSemaphore(Uint32 initial_value); /** * Destroy a semaphore. @@ -694,7 +694,7 @@ typedef struct SDL_Condition SDL_Condition; * \sa SDL_WaitConditionTimeout * \sa SDL_DestroyCondition */ -extern SDL_DECLSPEC SDL_Condition *SDLCALL SDL_CreateCondition(void); +extern SDL_DECLSPEC SDL_Condition * SDLCALL SDL_CreateCondition(void); /** * Destroy a condition variable. diff --git a/include/SDL3/SDL_pen.h b/include/SDL3/SDL_pen.h index 92e4c6713ac7a..b11f6960899ea 100644 --- a/include/SDL3/SDL_pen.h +++ b/include/SDL3/SDL_pen.h @@ -162,7 +162,7 @@ typedef enum SDL_PenSubtype * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_PenID *SDLCALL SDL_GetPens(int *count); +extern SDL_DECLSPEC SDL_PenID * SDLCALL SDL_GetPens(int *count); /** * Retrieves the pen's current status. @@ -237,7 +237,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetPenName(SDL_PenID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetPenName(SDL_PenID instance_id); /** * Pen capabilities, as reported by SDL_GetPenCapabilities() diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index ecb7454958924..b87b6f733a8c6 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -733,7 +733,7 @@ typedef struct SDL_PixelFormatDetails * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat format); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetPixelFormatName(SDL_PixelFormat format); /** * Convert one of the enumerated pixel formats to a bpp value and RGBA masks. @@ -812,7 +812,7 @@ extern SDL_DECLSPEC const SDL_PixelFormatDetails * SDLCALL SDL_GetPixelFormatDet * \sa SDL_SetPaletteColors * \sa SDL_SetSurfacePalette */ -extern SDL_DECLSPEC SDL_Palette *SDLCALL SDL_CreatePalette(int ncolors); +extern SDL_DECLSPEC SDL_Palette * SDLCALL SDL_CreatePalette(int ncolors); /** * Set a range of colors in a palette. diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index 632e9475ed725..cd11eeedf4be6 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -373,7 +373,7 @@ extern SDL_DECLSPEC SDL_PropertyType SDLCALL SDL_GetPropertyType(SDL_PropertiesI * \sa SDL_HasProperty * \sa SDL_SetPointerProperty */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); +extern SDL_DECLSPEC void * SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, const char *name, void *default_value); /** * Get a string property from a group of properties. @@ -394,7 +394,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props, * \sa SDL_HasProperty * \sa SDL_SetStringProperty */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetStringProperty(SDL_PropertiesID props, const char *name, const char *default_value); /** * Get a number property from a group of properties. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index 19273e14281d1..bfff4534ebc81 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -165,7 +165,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); * * \sa SDL_GetNumRenderDrivers */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetRenderDriver(int index); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetRenderDriver(int index); /** * Create a window and default renderer. @@ -297,7 +297,7 @@ extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRendererWithProperties(SDL_ * * \sa SDL_DestroyRenderer */ -extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *surface); +extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface *surface); /** * Get the renderer associated with a window. @@ -308,7 +308,7 @@ extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_GetRenderer(SDL_Window *window); +extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window *window); /** * Get the window associated with a renderer. @@ -319,7 +319,7 @@ extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_GetRenderer(SDL_Window *window); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetRenderWindow(SDL_Renderer *renderer); /** * Get the name of a renderer. @@ -334,7 +334,7 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetRenderWindow(SDL_Renderer *render * \sa SDL_CreateRenderer * \sa SDL_CreateRendererWithProperties */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetRendererName(SDL_Renderer *renderer); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetRendererName(SDL_Renderer *renderer); /** * Get the properties associated with a renderer. @@ -497,7 +497,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentRenderOutputSize(SDL_Renderer *ren * \sa SDL_GetTextureSize * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, int access, int w, int h); +extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer *renderer, SDL_PixelFormat format, int access, int w, int h); /** * Create a texture from an existing surface. @@ -523,7 +523,7 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTexture(SDL_Renderer *rendere * \sa SDL_CreateTextureWithProperties * \sa SDL_DestroyTexture */ -extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface); +extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface); /** * Create a texture for a rendering context with the specified properties. @@ -634,7 +634,7 @@ extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureFromSurface(SDL_Render * \sa SDL_GetTextureSize * \sa SDL_UpdateTexture */ -extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_PropertiesID props); #define SDL_PROP_TEXTURE_CREATE_COLORSPACE_NUMBER "colorspace" #define SDL_PROP_TEXTURE_CREATE_FORMAT_NUMBER "format" @@ -795,7 +795,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetTextureProperties(SDL_Textur * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Renderer *SDLCALL SDL_GetRendererFromTexture(SDL_Texture *texture); +extern SDL_DECLSPEC SDL_Renderer * SDLCALL SDL_GetRendererFromTexture(SDL_Texture *texture); /** * Get the size of a texture, as floating point values. @@ -1262,7 +1262,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_ * * \sa SDL_SetRenderTarget */ -extern SDL_DECLSPEC SDL_Texture *SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); +extern SDL_DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer); /** * Set a device independent resolution and presentation mode for rendering. @@ -2070,7 +2070,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlushRenderer(SDL_Renderer *renderer); * * \sa SDL_GetRenderMetalCommandEncoder */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer); +extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer); /** * Get the Metal command encoder for the current frame. @@ -2091,7 +2091,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_GetRenderMetalLayer(SDL_Renderer *renderer * * \sa SDL_GetRenderMetalLayer */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer); +extern SDL_DECLSPEC void * SDLCALL SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer); /** diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 40d9b07951113..dc43782f1a905 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -153,7 +153,7 @@ typedef enum SDL_SensorType * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count); +extern SDL_DECLSPEC SDL_SensorID * SDLCALL SDL_GetSensors(int *count); /** * Get the implementation dependent name of a sensor. @@ -167,7 +167,7 @@ extern SDL_DECLSPEC SDL_SensorID *SDLCALL SDL_GetSensors(int *count); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorNameForID(SDL_SensorID instance_id); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetSensorNameForID(SDL_SensorID instance_id); /** * Get the type of a sensor. @@ -203,7 +203,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableTypeForID(SDL_SensorID i * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id); +extern SDL_DECLSPEC SDL_Sensor * SDLCALL SDL_OpenSensor(SDL_SensorID instance_id); /** * Return the SDL_Sensor associated with an instance ID. @@ -213,7 +213,7 @@ extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_OpenSensor(SDL_SensorID instance_id) * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Sensor *SDLCALL SDL_GetSensorFromID(SDL_SensorID instance_id); +extern SDL_DECLSPEC SDL_Sensor * SDLCALL SDL_GetSensorFromID(SDL_SensorID instance_id); /** * Get the properties associated with a sensor. @@ -236,7 +236,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetSensorName(SDL_Sensor *sensor); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetSensorName(SDL_Sensor *sensor); /** * Get the type of a sensor. diff --git a/include/SDL3/SDL_stdinc.h b/include/SDL3/SDL_stdinc.h index 8e04282ba2c91..9bda34463a257 100644 --- a/include/SDL3/SDL_stdinc.h +++ b/include/SDL3/SDL_stdinc.h @@ -523,9 +523,9 @@ extern "C" { #define SDL_stack_free(data) SDL_free(data) #endif -extern SDL_DECLSPEC SDL_MALLOC void *SDLCALL SDL_malloc(size_t size); -extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void *SDLCALL SDL_calloc(size_t nmemb, size_t size); -extern SDL_DECLSPEC SDL_ALLOC_SIZE(2) void *SDLCALL SDL_realloc(void *mem, size_t size); +extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_malloc(size_t size); +extern SDL_DECLSPEC SDL_MALLOC SDL_ALLOC_SIZE2(1, 2) void * SDLCALL SDL_calloc(size_t nmemb, size_t size); +extern SDL_DECLSPEC SDL_ALLOC_SIZE(2) void * SDLCALL SDL_realloc(void *mem, size_t size); extern SDL_DECLSPEC void SDLCALL SDL_free(void *mem); typedef void *(SDLCALL *SDL_malloc_func)(size_t size); @@ -630,7 +630,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetMemoryFunctions(SDL_malloc_func malloc_fu * * \sa SDL_aligned_free */ -extern SDL_DECLSPEC SDL_MALLOC void *SDLCALL SDL_aligned_alloc(size_t alignment, size_t size); +extern SDL_DECLSPEC SDL_MALLOC void * SDLCALL SDL_aligned_alloc(size_t alignment, size_t size); /** * Free memory allocated by SDL_aligned_alloc(). @@ -659,7 +659,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_aligned_free(void *mem); */ extern SDL_DECLSPEC int SDLCALL SDL_GetNumAllocations(void); -extern SDL_DECLSPEC char *SDLCALL SDL_getenv(const char *name); +extern SDL_DECLSPEC char * SDLCALL SDL_getenv(const char *name); extern SDL_DECLSPEC int SDLCALL SDL_setenv(const char *name, const char *value, int overwrite); typedef int (SDLCALL *SDL_CompareCallback)(const void *a, const void *b); @@ -916,7 +916,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_tolower(int x); extern SDL_DECLSPEC Uint16 SDLCALL SDL_crc16(Uint16 crc, const void *data, size_t len); extern SDL_DECLSPEC Uint32 SDLCALL SDL_crc32(Uint32 crc, const void *data, size_t len); -extern SDL_DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); +extern SDL_DECLSPEC void * SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); /* Take advantage of compiler optimizations for memcpy */ #ifndef SDL_SLOW_MEMCPY @@ -930,7 +930,7 @@ extern SDL_DECLSPEC void *SDLCALL SDL_memcpy(SDL_OUT_BYTECAP(len) void *dst, SDL { SDL_COMPILE_TIME_ASSERT(SDL_copyp, sizeof (*(dst)) == sizeof (*(src))); } \ SDL_memcpy((dst), (src), sizeof(*(src))) -extern SDL_DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); +extern SDL_DECLSPEC void * SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SDL_IN_BYTECAP(len) const void *src, size_t len); /* Take advantage of compiler optimizations for memmove */ #ifndef SDL_SLOW_MEMMOVE @@ -940,8 +940,8 @@ extern SDL_DECLSPEC void *SDLCALL SDL_memmove(SDL_OUT_BYTECAP(len) void *dst, SD #define SDL_memmove memmove #endif -extern SDL_DECLSPEC void *SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); -extern SDL_DECLSPEC void *SDLCALL SDL_memset4(void *dst, Uint32 val, size_t dwords); +extern SDL_DECLSPEC void * SDLCALL SDL_memset(SDL_OUT_BYTECAP(len) void *dst, int c, size_t len); +extern SDL_DECLSPEC void * SDLCALL SDL_memset4(void *dst, Uint32 val, size_t dwords); /* Take advantage of compiler optimizations for memset */ #ifndef SDL_SLOW_MEMSET @@ -961,9 +961,9 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_wcslen(const wchar_t *wstr); extern SDL_DECLSPEC size_t SDLCALL SDL_wcsnlen(const wchar_t *wstr, size_t maxlen); extern SDL_DECLSPEC size_t SDLCALL SDL_wcslcpy(SDL_OUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); extern SDL_DECLSPEC size_t SDLCALL SDL_wcslcat(SDL_INOUT_Z_CAP(maxlen) wchar_t *dst, const wchar_t *src, size_t maxlen); -extern SDL_DECLSPEC wchar_t *SDLCALL SDL_wcsdup(const wchar_t *wstr); -extern SDL_DECLSPEC wchar_t *SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); -extern SDL_DECLSPEC wchar_t *SDLCALL SDL_wcsnstr(const wchar_t *haystack, const wchar_t *needle, size_t maxlen); +extern SDL_DECLSPEC wchar_t * SDLCALL SDL_wcsdup(const wchar_t *wstr); +extern SDL_DECLSPEC wchar_t * SDLCALL SDL_wcsstr(const wchar_t *haystack, const wchar_t *needle); +extern SDL_DECLSPEC wchar_t * SDLCALL SDL_wcsnstr(const wchar_t *haystack, const wchar_t *needle, size_t maxlen); /** * Compare two null-terminated wide strings. @@ -1094,9 +1094,9 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_strnlen(const char *str, size_t maxlen); extern SDL_DECLSPEC size_t SDLCALL SDL_strlcpy(SDL_OUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strlcpy(SDL_OUT_Z_CAP(dst_bytes) char *dst, const char *src, size_t dst_bytes); extern SDL_DECLSPEC size_t SDLCALL SDL_strlcat(SDL_INOUT_Z_CAP(maxlen) char *dst, const char *src, size_t maxlen); -extern SDL_DECLSPEC SDL_MALLOC char *SDLCALL SDL_strdup(const char *str); -extern SDL_DECLSPEC SDL_MALLOC char *SDLCALL SDL_strndup(const char *str, size_t maxlen); -extern SDL_DECLSPEC char *SDLCALL SDL_strrev(char *str); +extern SDL_DECLSPEC SDL_MALLOC char * SDLCALL SDL_strdup(const char *str); +extern SDL_DECLSPEC SDL_MALLOC char * SDLCALL SDL_strndup(const char *str, size_t maxlen); +extern SDL_DECLSPEC char * SDLCALL SDL_strrev(char *str); /** * Convert a string to uppercase. @@ -1117,7 +1117,7 @@ extern SDL_DECLSPEC char *SDLCALL SDL_strrev(char *str); * * \sa SDL_strlwr */ -extern SDL_DECLSPEC char *SDLCALL SDL_strupr(char *str); +extern SDL_DECLSPEC char * SDLCALL SDL_strupr(char *str); /** * Convert a string to lowercase. @@ -1138,23 +1138,23 @@ extern SDL_DECLSPEC char *SDLCALL SDL_strupr(char *str); * * \sa SDL_strupr */ -extern SDL_DECLSPEC char *SDLCALL SDL_strlwr(char *str); +extern SDL_DECLSPEC char * SDLCALL SDL_strlwr(char *str); -extern SDL_DECLSPEC char *SDLCALL SDL_strchr(const char *str, int c); -extern SDL_DECLSPEC char *SDLCALL SDL_strrchr(const char *str, int c); -extern SDL_DECLSPEC char *SDLCALL SDL_strstr(const char *haystack, const char *needle); -extern SDL_DECLSPEC char *SDLCALL SDL_strnstr(const char *haystack, const char *needle, size_t maxlen); -extern SDL_DECLSPEC char *SDLCALL SDL_strcasestr(const char *haystack, const char *needle); -extern SDL_DECLSPEC char *SDLCALL SDL_strtok_r(char *s1, const char *s2, char **saveptr); +extern SDL_DECLSPEC char * SDLCALL SDL_strchr(const char *str, int c); +extern SDL_DECLSPEC char * SDLCALL SDL_strrchr(const char *str, int c); +extern SDL_DECLSPEC char * SDLCALL SDL_strstr(const char *haystack, const char *needle); +extern SDL_DECLSPEC char * SDLCALL SDL_strnstr(const char *haystack, const char *needle, size_t maxlen); +extern SDL_DECLSPEC char * SDLCALL SDL_strcasestr(const char *haystack, const char *needle); +extern SDL_DECLSPEC char * SDLCALL SDL_strtok_r(char *s1, const char *s2, char **saveptr); extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strlen(const char *str); extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes); -extern SDL_DECLSPEC char *SDLCALL SDL_itoa(int value, char *str, int radix); -extern SDL_DECLSPEC char *SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); -extern SDL_DECLSPEC char *SDLCALL SDL_ltoa(long value, char *str, int radix); -extern SDL_DECLSPEC char *SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); -extern SDL_DECLSPEC char *SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); -extern SDL_DECLSPEC char *SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); +extern SDL_DECLSPEC char * SDLCALL SDL_itoa(int value, char *str, int radix); +extern SDL_DECLSPEC char * SDLCALL SDL_uitoa(unsigned int value, char *str, int radix); +extern SDL_DECLSPEC char * SDLCALL SDL_ltoa(long value, char *str, int radix); +extern SDL_DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *str, int radix); +extern SDL_DECLSPEC char * SDLCALL SDL_lltoa(Sint64 value, char *str, int radix); +extern SDL_DECLSPEC char * SDLCALL SDL_ulltoa(Uint64 value, char *str, int radix); extern SDL_DECLSPEC int SDLCALL SDL_atoi(const char *str); extern SDL_DECLSPEC double SDLCALL SDL_atof(const char *str); @@ -2924,7 +2924,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, +extern SDL_DECLSPEC char * SDLCALL SDL_iconv_string(const char *tocode, const char *fromcode, const char *inbuf, size_t inbytesleft); @@ -2941,12 +2941,12 @@ extern SDL_DECLSPEC char *SDLCALL SDL_iconv_string(const char *tocode, /* The analyzer knows about strlcpy even when the system doesn't provide it */ #if !defined(HAVE_STRLCPY) && !defined(strlcpy) -size_t strlcpy(char* dst, const char* src, size_t size); +size_t strlcpy(char *dst, const char *src, size_t size); #endif /* The analyzer knows about strlcat even when the system doesn't provide it */ #if !defined(HAVE_STRLCAT) && !defined(strlcat) -size_t strlcat(char* dst, const char* src, size_t size); +size_t strlcat(char *dst, const char *src, size_t size); #endif #if !defined(HAVE_WCSLCPY) && !defined(wcslcpy) diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index 5ffcd81f67851..0fa24a20fe03d 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -113,7 +113,7 @@ typedef struct SDL_Storage SDL_Storage; * \sa SDL_OpenUserStorage * \sa SDL_ReadStorageFile */ -extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *override, SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenTitleStorage(const char *override, SDL_PropertiesID props); /** * Opens up a container for a user's unique read/write filesystem. @@ -139,7 +139,7 @@ extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenTitleStorage(const char *overri * \sa SDL_StorageReady * \sa SDL_WriteStorageFile */ -extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenUserStorage(const char *org, const char *app, SDL_PropertiesID props); /** * Opens up a container for local filesystem storage. @@ -163,7 +163,7 @@ extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenUserStorage(const char *org, co * \sa SDL_ReadStorageFile * \sa SDL_WriteStorageFile */ -extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path); +extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenFileStorage(const char *path); /** * Opens up a container using a client-provided storage interface. @@ -187,7 +187,7 @@ extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenFileStorage(const char *path); * \sa SDL_StorageReady * \sa SDL_WriteStorageFile */ -extern SDL_DECLSPEC SDL_Storage *SDLCALL SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata); +extern SDL_DECLSPEC SDL_Storage * SDLCALL SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata); /** * Closes and frees a storage container. @@ -401,7 +401,7 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char * const *SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count); +extern SDL_DECLSPEC const char * const * SDLCALL SDL_GlobStorageDirectory(SDL_Storage *storage, const char *path, const char *pattern, SDL_GlobFlags flags, int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 0bb12269826a5..8b7371ee25c6b 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -136,7 +136,7 @@ typedef struct SDL_Surface * \sa SDL_CreateSurfaceFrom * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormat format); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_CreateSurface(int width, int height, SDL_PixelFormat format); /** * Allocate a new surface with a specific pixel format and existing pixel @@ -164,7 +164,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface(int width, int height * \sa SDL_CreateSurface * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, void *pixels, int pitch); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_CreateSurfaceFrom(int width, int height, SDL_PixelFormat format, void *pixels, int pitch); /** * Free a surface. @@ -364,7 +364,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); * \sa SDL_LoadBMP * \sa SDL_SaveBMP_IO */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_bool closeio); /** * Load a BMP image from a file. @@ -382,7 +382,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_b * \sa SDL_LoadBMP_IO * \sa SDL_SaveBMP */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP(const char *file); /** * Save a surface to a seekable SDL data stream in BMP format. @@ -695,7 +695,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMo * * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_DuplicateSurface(SDL_Surface *surface); /** * Copy an existing surface to a new surface of the specified format. @@ -718,7 +718,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surfa * \sa SDL_ConvertSurfaceAndColorspace * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface, SDL_PixelFormat format); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurface(SDL_Surface *surface, SDL_PixelFormat format); /** * Copy an existing surface to a new surface of the specified format and @@ -742,7 +742,7 @@ extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface * \sa SDL_ConvertSurface * \sa SDL_DestroySurface */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_ConvertSurfaceAndColorspace(SDL_Surface *surface, SDL_PixelFormat format, SDL_Palette *palette, SDL_Colorspace colorspace, SDL_PropertiesID props); /** * Copy a block of pixels of one format to another format. diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 5bb04de6b695b..01561551c3a4b 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -215,7 +215,7 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); * The function prototype for `callback` is: * * ```c - * void callback(void* callbackParam); + * void callback(void *callbackParam); * ``` * * Where its parameter, `callbackParam`, is what was passed as `callbackParam` @@ -246,7 +246,7 @@ typedef void (SDLCALL *SDL_iOSAnimationCallback)(void *userdata); * * \sa SDL_SetiOSEventPump */ -extern SDL_DECLSPEC int SDLCALL SDL_SetiOSAnimationCallback(SDL_Window * window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); +extern SDL_DECLSPEC int SDLCALL SDL_SetiOSAnimationCallback(SDL_Window *window, int interval, SDL_iOSAnimationCallback callback, void *callbackParam); /** * Use this function to enable or disable the SDL event pump on Apple iOS. @@ -416,7 +416,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); * * \sa SDL_GetAndroidExternalStorageState */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetAndroidInternalStoragePath(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidInternalStoragePath(void); /** * Get the current state of external storage for this Android application. @@ -541,7 +541,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RequestAndroidPermission(const char *permiss * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset); +extern SDL_DECLSPEC int SDLCALL SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xoffset, int yoffset); /** * Send a user command to SDLActivity. @@ -803,7 +803,7 @@ typedef struct XUser *XUserHandle; * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle * outTaskQueue); +extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue); /** * Gets a reference to the default user handle for GDK. @@ -817,7 +817,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle * outTaskQu * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC int SDLCALL SDL_GetGDKDefaultUser(XUserHandle * outUserHandle); +extern SDL_DECLSPEC int SDLCALL SDL_GetGDKDefaultUser(XUserHandle *outUserHandle); #endif diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 9f411a93833c4..7bf7b1849a848 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -302,7 +302,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithProperties(SDL_Prop * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadRuntime(SDL_ThreadFunction fn, const char *name, void *data, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread); +extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadRuntime(SDL_ThreadFunction fn, const char *name, void *data, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread); /** * The actual entry point for SDL_CreateThreadWithProperties. @@ -316,7 +316,7 @@ extern SDL_DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadRuntime(SDL_ThreadFuncti * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread); +extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(SDL_PropertiesID props, SDL_FunctionPointer pfnBeginThread, SDL_FunctionPointer pfnEndThread); #define SDL_CreateThread(fn, name, data) SDL_CreateThreadRuntime((fn), (name), (data), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) #define SDL_CreateThreadWithProperties(props) SDL_CreateThreadWithPropertiesRuntime((props), (SDL_FunctionPointer) (SDL_BeginThreadFunction), (SDL_FunctionPointer) (SDL_EndThreadFunction)) @@ -338,7 +338,7 @@ extern SDL_DECLSPEC SDL_Thread *SDLCALL SDL_CreateThreadWithPropertiesRuntime(SD * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetThreadName(SDL_Thread *thread); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetThreadName(SDL_Thread *thread); /** * Get the thread identifier for the current thread. @@ -373,7 +373,7 @@ extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetCurrentThreadID(void); * * \sa SDL_GetCurrentThreadID */ -extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread * thread); +extern SDL_DECLSPEC SDL_ThreadID SDLCALL SDL_GetThreadID(SDL_Thread *thread); /** * Set the priority for the current thread. @@ -423,7 +423,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetThreadPriority(SDL_ThreadPriority priorit * \sa SDL_CreateThread * \sa SDL_DetachThread */ -extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status); +extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread *thread, int *status); /** * Let a thread clean up on exit without intervention. @@ -459,7 +459,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_WaitThread(SDL_Thread * thread, int *status * \sa SDL_CreateThread * \sa SDL_WaitThread */ -extern SDL_DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread * thread); +extern SDL_DECLSPEC void SDLCALL SDL_DetachThread(SDL_Thread *thread); /** * Get the current thread's value associated with a thread local storage ID. diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index 5159dcb5f2921..4e258fca97614 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -91,7 +91,7 @@ typedef struct SDL_Finger * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count); +extern SDL_DECLSPEC SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count); /** * Get the touch device name as reported from the driver. @@ -104,7 +104,7 @@ extern SDL_DECLSPEC SDL_TouchID *SDLCALL SDL_GetTouchDevices(int *count); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetTouchDeviceName(SDL_TouchID touchID); /** * Get the type of the given touch device. @@ -128,7 +128,7 @@ extern SDL_DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_Touch * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Finger **SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count); +extern SDL_DECLSPEC SDL_Finger ** SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/include/SDL3/SDL_version.h b/include/SDL3/SDL_version.h index 193db108bf4c9..516b66ade2b2d 100644 --- a/include/SDL3/SDL_version.h +++ b/include/SDL3/SDL_version.h @@ -172,7 +172,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetVersion(void); * * \sa SDL_GetVersion */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetRevision(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetRevision(void); /* Ends C function definitions when using C++ */ diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 4572a73455260..1b8c8299c7845 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -358,7 +358,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); * * \sa SDL_GetNumVideoDrivers */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetVideoDriver(int index); /** * Get the name of the currently initialized video driver. @@ -377,7 +377,7 @@ extern SDL_DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index); * \sa SDL_GetNumVideoDrivers * \sa SDL_GetVideoDriver */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentVideoDriver(void); /** * Get the current system theme. @@ -399,7 +399,7 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_DisplayID *SDLCALL SDL_GetDisplays(int *count); +extern SDL_DECLSPEC SDL_DisplayID * SDLCALL SDL_GetDisplays(int *count); /** * Return the primary display. @@ -455,7 +455,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_Displa * * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetDisplayName(SDL_DisplayID displayID); /** * Get the desktop area represented by a display. @@ -564,7 +564,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displ * * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC const SDL_DisplayMode **SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count); +extern SDL_DECLSPEC const SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count); /** * Get the closest match to the requested display mode. @@ -592,7 +592,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode **SDLCALL SDL_GetFullscreenDisplayMode * \sa SDL_GetDisplays * \sa SDL_GetFullscreenDisplayModes */ -extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes); +extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes); /** * Get information about the desktop's display mode. @@ -611,7 +611,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetClosestFullscreenDispl * \sa SDL_GetCurrentDisplayMode * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayID displayID); +extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayID displayID); /** * Get information about the current display mode. @@ -630,7 +630,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetDesktopDisplayMode(SDL * \sa SDL_GetDesktopDisplayMode * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayID displayID); +extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayID displayID); /** * Get the display containing a point. @@ -760,7 +760,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowFullscreenMode(SDL_Window *window, * \sa SDL_SetWindowFullscreenMode * \sa SDL_SetWindowFullscreen */ -extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetWindowFullscreenMode(SDL_Window *window); +extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode(SDL_Window *window); /** * Get the raw ICC profile data for the screen the window is currently on. @@ -774,7 +774,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode *SDLCALL SDL_GetWindowFullscreenMode(S * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void *SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size); +extern SDL_DECLSPEC void * SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size); /** * Get the pixel format associated with the window. @@ -799,7 +799,7 @@ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Window * const *SDLCALL SDL_GetWindows(int *count); +extern SDL_DECLSPEC SDL_Window * const * SDLCALL SDL_GetWindows(int *count); /** * Create a window with the specified dimensions and flags. @@ -862,7 +862,7 @@ extern SDL_DECLSPEC SDL_Window * const *SDLCALL SDL_GetWindows(int *count); * \sa SDL_CreateWindowWithProperties * \sa SDL_DestroyWindow */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int w, int h, SDL_WindowFlags flags); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindow(const char *title, int w, int h, SDL_WindowFlags flags); /** * Create a child popup window of the specified parent window. @@ -917,7 +917,7 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreateWindow(const char *title, int * \sa SDL_DestroyWindow * \sa SDL_GetWindowParent */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y, int w, int h, SDL_WindowFlags flags); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreatePopupWindow(SDL_Window *parent, int offset_x, int offset_y, int w, int h, SDL_WindowFlags flags); /** * Create a window with the specified properties. @@ -1033,7 +1033,7 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreatePopupWindow(SDL_Window *parent * \sa SDL_CreateWindow * \sa SDL_DestroyWindow */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_CreateWindowWithProperties(SDL_PropertiesID props); #define SDL_PROP_WINDOW_CREATE_ALWAYS_ON_TOP_BOOLEAN "always_on_top" #define SDL_PROP_WINDOW_CREATE_BORDERLESS_BOOLEAN "borderless" @@ -1099,7 +1099,7 @@ extern SDL_DECLSPEC SDL_WindowID SDLCALL SDL_GetWindowID(SDL_Window *window); * * \sa SDL_GetWindowID */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(SDL_WindowID id); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowFromID(SDL_WindowID id); /** * Get parent of a window. @@ -1112,7 +1112,7 @@ extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowFromID(SDL_WindowID id); * * \sa SDL_CreatePopupWindow */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetWindowParent(SDL_Window *window); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window); /** * Get the properties associated with a window. @@ -1314,7 +1314,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const cha * * \sa SDL_SetWindowTitle */ -extern SDL_DECLSPEC const char *SDLCALL SDL_GetWindowTitle(SDL_Window *window); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetWindowTitle(SDL_Window *window); /** * Set the icon for a window. @@ -1906,7 +1906,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_WindowHasSurface(SDL_Window *window); * \sa SDL_UpdateWindowSurface * \sa SDL_UpdateWindowSurfaceRects */ -extern SDL_DECLSPEC SDL_Surface *SDLCALL SDL_GetWindowSurface(SDL_Window *window); +extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window *window); /** * Toggle VSync for the window surface. @@ -2092,7 +2092,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetWindowMouseGrab(SDL_Window *window); * \sa SDL_SetWindowMouseGrab * \sa SDL_SetWindowKeyboardGrab */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GetGrabbedWindow(void); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetGrabbedWindow(void); /** * Confines the cursor to the specified area of a window. @@ -2124,7 +2124,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowMouseRect(SDL_Window *window, const * * \sa SDL_SetWindowMouseRect */ -extern SDL_DECLSPEC const SDL_Rect *SDLCALL SDL_GetWindowMouseRect(SDL_Window *window); +extern SDL_DECLSPEC const SDL_Rect * SDLCALL SDL_GetWindowMouseRect(SDL_Window *window); /** * Set the opacity for a window. @@ -2616,7 +2616,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_MakeCurrent(SDL_Window *window, SDL_GLCon * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Window *SDLCALL SDL_GL_GetCurrentWindow(void); +extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GL_GetCurrentWindow(void); /** * Get the currently active OpenGL context. diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index 410329eb92f88..61983e178df48 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -155,7 +155,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); * * \sa SDL_Vulkan_CreateSurface */ -extern SDL_DECLSPEC char const* const* SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint32 *count); +extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtensions(Uint32 *count); /** * Create a Vulkan rendering surface for a window. From 0fe660374741b05ca551b93fccc17d475643c74d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 09:44:06 -0700 Subject: [PATCH 393/431] SDL_GetCameraSupportedFormats() follows the SDL_GetStringRule Also changed the function to return an array of pointers and added example usage to testcamera --- include/SDL3/SDL_camera.h | 19 +++++++------------ src/camera/SDL_camera.c | 18 +++++++++++++----- src/dynapi/SDL_dynapi_procs.h | 2 +- test/testcamera.c | 16 ++++++++++++++++ 4 files changed, 37 insertions(+), 18 deletions(-) diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index ca13689a0c2b6..1114043d077d0 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -198,24 +198,19 @@ extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count); * format on your behalf. * * If `count` is not NULL, it will be filled with the number of elements in - * the returned array. Additionally, the last element of the array has all - * fields set to zero (this element is not included in `count`). + * the returned array. * - * The returned list is owned by the caller, and should be released with - * SDL_free() when no longer needed. - * - * Note that it's legal for a camera to supply a list with only the zeroed - * final element and `*count` set to zero; this is what will happen on + * Note that it's legal for a camera to supply an empty list. This is what will happen on * Emscripten builds, since that platform won't tell _anything_ about * available cameras until you've opened one, and won't even tell if there * _is_ a camera until the user has given you permission to check through a * scary warning popup. * + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * * \param devid the camera device instance ID to query. - * \param count a pointer filled in with the number of elements in the list. - * Can be NULL. - * \returns a 0 terminated array of SDL_CameraSpecs, which should be freed - * with SDL_free(), or NULL on failure; call + * \param count a pointer filled in with the number of elements in the list, may be NULL. + * \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on failure; call * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. @@ -225,7 +220,7 @@ extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count); * \sa SDL_GetCameras * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraSpec * SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count); +extern SDL_DECLSPEC const SDL_CameraSpec * const * SDLCALL SDL_GetCameraSupportedFormats(SDL_CameraID devid, int *count); /** * Get the human-readable device name for a camera. diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index b17906ccfc4f3..756f3f7983703 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -734,7 +734,7 @@ SDL_CameraID *SDL_GetCameras(int *count) return retval; } -SDL_CameraSpec *SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *count) +const SDL_CameraSpec * const *SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *count) { if (count) { *count = 0; @@ -745,17 +745,25 @@ SDL_CameraSpec *SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *cou return NULL; } - SDL_CameraSpec *retval = (SDL_CameraSpec *) SDL_calloc(device->num_specs + 1, sizeof (SDL_CameraSpec)); + int i; + int num_specs = device->num_specs; + const SDL_CameraSpec **retval = (const SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(SDL_CameraSpec *)) + (num_specs * sizeof (SDL_CameraSpec))); if (retval) { - SDL_memcpy(retval, device->all_specs, sizeof (SDL_CameraSpec) * device->num_specs); + SDL_CameraSpec *specs = (SDL_CameraSpec *)((Uint8 *)retval + ((num_specs + 1) * sizeof(SDL_CameraSpec *))); + SDL_memcpy(specs, device->all_specs, sizeof (SDL_CameraSpec) * num_specs); + for (i = 0; i < num_specs; ++i) { + retval[i] = specs++; + } + retval[i] = NULL; + if (count) { - *count = device->num_specs; + *count = num_specs; } } ReleaseCamera(device); - return retval; + return SDL_FreeLater(retval); } diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 63809573537bf..54608dff344f3 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -232,7 +232,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetCameraName,(SDL_CameraID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetCameraPermissionState,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraPosition,(SDL_CameraID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetCameraProperties,(SDL_Camera *a),(a),return) -SDL_DYNAPI_PROC(SDL_CameraSpec*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) +SDL_DYNAPI_PROC(const SDL_CameraSpec* const*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetClipboardText,(void),(),return) diff --git a/test/testcamera.c b/test/testcamera.c index adf3100c74335..17fc5d3acd6e0 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -26,6 +26,20 @@ static SDL_Surface *frame_current = NULL; static SDL_CameraID front_camera = 0; static SDL_CameraID back_camera = 0; +static void PrintCameraSpecs(SDL_CameraID camera_id) +{ + const SDL_CameraSpec *const *specs = SDL_GetCameraSupportedFormats(camera_id, NULL); + if (specs) { + int i; + + SDL_Log("Available formats:\n"); + for (i = 0; specs[i]; ++i) { + const SDL_CameraSpec *s = specs[i]; + SDL_Log(" %dx%d %.2f FPS %s\n", s->width, s->height, (float)s->framerate_numerator / s->framerate_denominator, SDL_GetPixelFormatName(s->format)); + } + } +} + int SDL_AppInit(void **appstate, int argc, char *argv[]) { char window_title[128]; @@ -133,6 +147,8 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) return SDL_APP_FAILURE; } + PrintCameraSpecs(camera_id); + SDL_CameraSpec *pspec = &spec; spec.framerate_numerator = 1000; spec.framerate_denominator = 1; From 01199469de4458347a3ec999a14cac72ecaf46b5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 16:33:52 -0700 Subject: [PATCH 394/431] SDL_GetCameras() follows the SDL_GetStringRule --- include/SDL3/SDL_camera.h | 9 +++++---- src/camera/SDL_camera.c | 10 +++++----- src/dynapi/SDL_dynapi_procs.h | 2 +- test/testcamera.c | 4 +--- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 1114043d077d0..04db2eabff740 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -170,10 +170,11 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void); /** * Get a list of currently connected camera devices. * - * \param count a pointer filled in with the number of camera devices. Can be + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of cameras returned, may be * NULL. - * \returns a 0 terminated array of camera instance IDs which should be freed - * with SDL_free() or NULL on failure; call SDL_GetError() for more + * \returns a 0 terminated array of camera instance IDs or NULL on failure; call SDL_GetError() for more * information. * * \threadsafety It is safe to call this function from any thread. @@ -182,7 +183,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void); * * \sa SDL_OpenCamera */ -extern SDL_DECLSPEC SDL_CameraID * SDLCALL SDL_GetCameras(int *count); +extern SDL_DECLSPEC const SDL_CameraID * SDLCALL SDL_GetCameras(int *count); /** * Get the list of native formats/sizes a camera supports. diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index 756f3f7983703..ae1b1f9285664 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -695,7 +695,7 @@ SDL_CameraPosition SDL_GetCameraPosition(SDL_CameraID instance_id) } -SDL_CameraID *SDL_GetCameras(int *count) +const SDL_CameraID *SDL_GetCameras(int *count) { int dummy_count; if (!count) { @@ -731,7 +731,7 @@ SDL_CameraID *SDL_GetCameras(int *count) *count = num_devices; - return retval; + return SDL_FreeLater(retval); } const SDL_CameraSpec * const *SDL_GetCameraSupportedFormats(SDL_CameraID instance_id, int *count) @@ -747,10 +747,10 @@ const SDL_CameraSpec * const *SDL_GetCameraSupportedFormats(SDL_CameraID instanc int i; int num_specs = device->num_specs; - const SDL_CameraSpec **retval = (const SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(SDL_CameraSpec *)) + (num_specs * sizeof (SDL_CameraSpec))); + const SDL_CameraSpec **retval = (const SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(*retval)) + (num_specs * sizeof (**retval))); if (retval) { - SDL_CameraSpec *specs = (SDL_CameraSpec *)((Uint8 *)retval + ((num_specs + 1) * sizeof(SDL_CameraSpec *))); - SDL_memcpy(specs, device->all_specs, sizeof (SDL_CameraSpec) * num_specs); + SDL_CameraSpec *specs = (SDL_CameraSpec *)((Uint8 *)retval + ((num_specs + 1) * sizeof(*retval))); + SDL_memcpy(specs, device->all_specs, num_specs * sizeof(*specs)); for (i = 0; i < num_specs; ++i) { retval[i] = specs++; } diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 54608dff344f3..aec04c3ddab4c 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -233,7 +233,7 @@ SDL_DYNAPI_PROC(int,SDL_GetCameraPermissionState,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraPosition,(SDL_CameraID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetCameraProperties,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(const SDL_CameraSpec* const*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetClipboardText,(void),(),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, SDL_bool e),(a,b,c,d,e),return) diff --git a/test/testcamera.c b/test/testcamera.c index 17fc5d3acd6e0..25dbaa51e65a7 100644 --- a/test/testcamera.c +++ b/test/testcamera.c @@ -101,7 +101,7 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) return SDL_APP_FAILURE; } - SDL_CameraID *devices = SDL_GetCameras(&devcount); + const SDL_CameraID *devices = SDL_GetCameras(&devcount); if (!devices) { SDL_Log("SDL_GetCameras failed: %s", SDL_GetError()); return SDL_APP_FAILURE; @@ -140,8 +140,6 @@ int SDL_AppInit(void **appstate, int argc, char *argv[]) } } - SDL_free(devices); - if (!camera_id) { SDL_Log("No cameras available?"); return SDL_APP_FAILURE; From 9758e102bcd530d3110ad3fcd9225fc6f5d71b9c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 16:44:56 -0700 Subject: [PATCH 395/431] SDL_GetDisplays() follows the SDL_GetStringRule --- docs/README-migration.md | 3 +-- include/SDL3/SDL_video.h | 7 ++++--- src/dynapi/SDL_dynapi_procs.h | 2 +- src/test/SDL_test_common.c | 12 ++++-------- src/video/SDL_video.c | 7 +++---- src/video/kmsdrm/SDL_kmsdrmmouse.c | 3 +-- src/video/kmsdrm/SDL_kmsdrmvideo.c | 3 +-- src/video/uikit/SDL_uikitmodes.m | 3 +-- src/video/wayland/SDL_waylandwindow.c | 3 +-- src/video/x11/SDL_x11modes.c | 3 +-- src/video/x11/SDL_x11mouse.c | 3 +-- test/testautomation_video.c | 13 ++++--------- test/testbounds.c | 3 +-- test/testdisplayinfo.c | 3 +-- test/testwm.c | 15 +++++++-------- 15 files changed, 32 insertions(+), 51 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index d2164c07f811c..6bf247b3e9bbb 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1970,7 +1970,7 @@ Rather than iterating over displays using display index, there is a new function { if (SDL_InitSubSystem(SDL_INIT_VIDEO) == 0) { int i, num_displays = 0; - SDL_DisplayID *displays = SDL_GetDisplays(&num_displays); + const SDL_DisplayID *displays = SDL_GetDisplays(&num_displays); if (displays) { for (i = 0; i < num_displays; ++i) { SDL_DisplayID instance_id = displays[i]; @@ -1978,7 +1978,6 @@ Rather than iterating over displays using display index, there is a new function SDL_Log("Display %" SDL_PRIu32 ": %s\n", instance_id, name ? name : "Unknown"); } - SDL_free(displays); } SDL_QuitSubSystem(SDL_INIT_VIDEO); } diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 1b8c8299c7845..65720549f3ac9 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -391,15 +391,16 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); /** * Get a list of currently connected displays. * + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * * \param count a pointer filled in with the number of displays returned, may * be NULL. - * \returns a 0 terminated array of display instance IDs which should be freed - * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * \returns a 0 terminated array of display instance IDs or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_DisplayID * SDLCALL SDL_GetDisplays(int *count); +extern SDL_DECLSPEC const SDL_DisplayID * SDLCALL SDL_GetDisplays(int *count); /** * Return the primary display. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index aec04c3ddab4c..9190df4a505f4 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -265,7 +265,7 @@ SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetDisplayForWindow,(SDL_Window *a),(a),return SDL_DYNAPI_PROC(const char*,SDL_GetDisplayName,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetDisplayProperties,(SDL_DisplayID a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetDisplayUsableBounds,(SDL_DisplayID a, SDL_Rect *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index dca7e57c2b024..0b96b7fbbd769 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1192,7 +1192,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) } if (state->verbose & VERBOSE_MODES) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; SDL_Rect bounds, usablebounds; const SDL_DisplayMode **modes; const SDL_DisplayMode *mode; @@ -1270,7 +1270,6 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) SDL_Log("DXGI Adapter Index: %d Output Index: %d", adapterIndex, outputIndex); #endif } - SDL_free(displays); } if (state->verbose & VERBOSE_RENDER) { @@ -1287,11 +1286,10 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) state->displayID = SDL_GetPrimaryDisplay(); if (state->display_index > 0) { - SDL_DisplayID *displays = SDL_GetDisplays(&n); + const SDL_DisplayID *displays = SDL_GetDisplays(&n); if (state->display_index < n) { state->displayID = displays[state->display_index]; } - SDL_free(displays); if (SDL_WINDOWPOS_ISUNDEFINED(state->window_x)) { state->window_x = SDL_WINDOWPOS_UNDEFINED_DISPLAY(state->displayID); @@ -2021,7 +2019,7 @@ static void SDLTest_PasteScreenShot(void) static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId) { int num_displays; - SDL_DisplayID *displays; + const SDL_DisplayID *displays; SDL_Window *window; SDL_WindowFlags flags; const SDL_DisplayMode *mode; @@ -2062,7 +2060,6 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId) SDL_SetWindowFullscreen(window, SDL_TRUE); } } - SDL_free(displays); } int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event *event) @@ -2158,7 +2155,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event SDL_Window *window = SDL_GetWindowFromID(event->key.windowID); if (window) { int num_displays; - SDL_DisplayID *displays = SDL_GetDisplays(&num_displays); + const SDL_DisplayID *displays = SDL_GetDisplays(&num_displays); if (displays) { SDL_DisplayID displayID = SDL_GetDisplayForWindow(window); int current_index = -1; @@ -2181,7 +2178,6 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event SDL_WINDOWPOS_CENTERED_DISPLAY(dest), SDL_WINDOWPOS_CENTERED_DISPLAY(dest)); } - SDL_free(displays); } } } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 0fe87785ed862..9105f5996833f 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -699,7 +699,7 @@ static void SDL_UpdateDesktopBounds(void) SDL_Rect rect; SDL_zero(rect); - SDL_DisplayID *displays = SDL_GetDisplays(NULL); + const SDL_DisplayID *displays = SDL_GetDisplays(NULL); if (displays) { for (int i = 0; displays[i]; ++i) { SDL_Rect bounds; @@ -711,7 +711,6 @@ static void SDL_UpdateDesktopBounds(void) } } } - SDL_free(displays); } SDL_copyp(&_this->desktop_bounds, &rect); } @@ -850,7 +849,7 @@ void SDL_DelVideoDisplay(SDL_DisplayID displayID, SDL_bool send_event) SDL_UpdateDesktopBounds(); } -SDL_DisplayID *SDL_GetDisplays(int *count) +const SDL_DisplayID *SDL_GetDisplays(int *count) { int i; SDL_DisplayID *displays; @@ -879,7 +878,7 @@ SDL_DisplayID *SDL_GetDisplays(int *count) *count = 0; } } - return displays; + return SDL_FreeLater(displays); } SDL_VideoDisplay *SDL_GetVideoDisplay(SDL_DisplayID displayID) diff --git a/src/video/kmsdrm/SDL_kmsdrmmouse.c b/src/video/kmsdrm/SDL_kmsdrmmouse.c index 2b9a796dfbb92..16be026e36759 100644 --- a/src/video/kmsdrm/SDL_kmsdrmmouse.c +++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c @@ -315,14 +315,13 @@ static int KMSDRM_ShowCursor(SDL_Cursor *cursor) This happens on video quit, where we get here after the mouse focus has been unset, yet SDL wants to restore the system default cursor (makes no sense here). */ - SDL_DisplayID *displays = SDL_GetDisplays(NULL); + const SDL_DisplayID *displays = SDL_GetDisplays(NULL); if (displays) { /* Iterate on the displays, hiding the cursor. */ for (i = 0; i < displays[i]; i++) { display = SDL_GetVideoDisplay(displays[i]); ret = KMSDRM_RemoveCursorFromBO(display); } - SDL_free(displays); } } else { display = SDL_GetVideoDisplayForWindow(window); diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 224d4cc57ffa3..32adfa28fbd2b 100644 --- a/src/video/kmsdrm/SDL_kmsdrmvideo.c +++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c @@ -535,7 +535,7 @@ static drmModeModeInfo *KMSDRM_GetClosestDisplayMode(SDL_VideoDisplay *display, /* Deinitializes the internal of the SDL Displays in the SDL display list. */ static void KMSDRM_DeinitDisplays(SDL_VideoDevice *_this) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; SDL_DisplayData *dispdata; int i; @@ -559,7 +559,6 @@ static void KMSDRM_DeinitDisplays(SDL_VideoDevice *_this) dispdata->crtc = NULL; } } - SDL_free(displays); } } diff --git a/src/video/uikit/SDL_uikitmodes.m b/src/video/uikit/SDL_uikitmodes.m index 50d6722016b67..80f9c9477d415 100644 --- a/src/video/uikit/SDL_uikitmodes.m +++ b/src/video/uikit/SDL_uikitmodes.m @@ -310,7 +310,7 @@ int UIKit_AddDisplay(SDL_bool send_event){ void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; int i; displays = SDL_GetDisplays(NULL); @@ -326,7 +326,6 @@ void UIKit_DelDisplay(UIScreen *uiscreen, SDL_bool send_event) break; } } - SDL_free(displays); } } diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index 986275ecdac7f..a962f5c43ad28 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -516,7 +516,7 @@ static void Wayland_move_window(SDL_Window *window) { SDL_WindowData *wind = window->internal; SDL_DisplayData *display; - SDL_DisplayID *displays; + const SDL_DisplayID *displays; if (wind->outputs && wind->num_outputs) { display = wind->outputs[wind->num_outputs - 1]; @@ -559,7 +559,6 @@ static void Wayland_move_window(SDL_Window *window) break; } } - SDL_free(displays); } } diff --git a/src/video/x11/SDL_x11modes.c b/src/video/x11/SDL_x11modes.c index 162deb7439e95..b6dc61fcc8f7a 100644 --- a/src/video/x11/SDL_x11modes.c +++ b/src/video/x11/SDL_x11modes.c @@ -639,7 +639,7 @@ static int X11_AddXRandRDisplay(SDL_VideoDevice *_this, Display *dpy, int screen static void X11_HandleXRandROutputChange(SDL_VideoDevice *_this, const XRROutputChangeNotifyEvent *ev) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; SDL_VideoDisplay *display = NULL; int i; @@ -657,7 +657,6 @@ static void X11_HandleXRandROutputChange(SDL_VideoDevice *_this, const XRROutput break; } } - SDL_free(displays); } if (ev->connection == RR_Disconnected) { /* output is going away */ diff --git a/src/video/x11/SDL_x11mouse.c b/src/video/x11/SDL_x11mouse.c index 2c48b643c2cfa..db8e94d5ff7d4 100644 --- a/src/video/x11/SDL_x11mouse.c +++ b/src/video/x11/SDL_x11mouse.c @@ -416,7 +416,7 @@ static int X11_CaptureMouse(SDL_Window *window) static SDL_MouseButtonFlags X11_GetGlobalMouseState(float *x, float *y) { SDL_VideoData *videodata = SDL_GetVideoDevice()->internal; - SDL_DisplayID *displays; + const SDL_DisplayID *displays; Display *display = GetDisplay(); int i; @@ -458,7 +458,6 @@ static SDL_MouseButtonFlags X11_GetGlobalMouseState(float *x, float *y) } } } - SDL_free(displays); } } diff --git a/test/testautomation_video.c b/test/testautomation_video.c index c044fd5df31f9..7d842819a0e0f 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -305,7 +305,7 @@ static int video_getWindowFlags(void *arg) */ static int video_getFullscreenDisplayModes(void *arg) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; const SDL_DisplayMode **modes; int count; int i; @@ -323,7 +323,6 @@ static int video_getFullscreenDisplayModes(void *arg) SDLTest_AssertCheck(count >= 0, "Validate number of modes; expected: >= 0; got: %d", count); SDL_free((void *)modes); } - SDL_free(displays); } return TEST_COMPLETED; @@ -334,7 +333,7 @@ static int video_getFullscreenDisplayModes(void *arg) */ static int video_getClosestDisplayModeCurrentResolution(void *arg) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; const SDL_DisplayMode **modes; SDL_DisplayMode current; const SDL_DisplayMode *closest; @@ -373,7 +372,6 @@ static int video_getClosestDisplayModeCurrentResolution(void *arg) } SDL_free((void *)modes); } - SDL_free(displays); } return TEST_COMPLETED; @@ -384,7 +382,7 @@ static int video_getClosestDisplayModeCurrentResolution(void *arg) */ static int video_getClosestDisplayModeRandomResolution(void *arg) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; SDL_DisplayMode target; int i; int variation; @@ -411,7 +409,6 @@ static int video_getClosestDisplayModeRandomResolution(void *arg) SDLTest_AssertPass("Call to SDL_GetClosestFullscreenDisplayMode(target=random/variation%d)", variation); } } - SDL_free(displays); } return TEST_COMPLETED; @@ -1673,7 +1670,7 @@ static int video_getSetWindowData(void *arg) */ static int video_setWindowCenteredOnDisplay(void *arg) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; SDL_Window *window; const char *title = "video_setWindowCenteredOnDisplay Test Window"; int x, y, w, h; @@ -1869,8 +1866,6 @@ static int video_setWindowCenteredOnDisplay(void *arg) destroyVideoSuiteTestWindow(window); } } - - SDL_free(displays); } return TEST_COMPLETED; diff --git a/test/testbounds.c b/test/testbounds.c index 143f74c6dc4d2..d747822a0031e 100644 --- a/test/testbounds.c +++ b/test/testbounds.c @@ -16,7 +16,7 @@ int main(int argc, char **argv) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; int i; SDLTest_CommonState *state; @@ -47,7 +47,6 @@ int main(int argc, char **argv) bounds.x, bounds.y, bounds.w, bounds.h, usable.x, usable.y, usable.w, usable.h); } - SDL_free(displays); } SDL_Quit(); diff --git a/test/testdisplayinfo.c b/test/testdisplayinfo.c index a7e7e8db8547c..2ce13d86f982f 100644 --- a/test/testdisplayinfo.c +++ b/test/testdisplayinfo.c @@ -33,7 +33,7 @@ print_mode(const char *prefix, const SDL_DisplayMode *mode) int main(int argc, char *argv[]) { - SDL_DisplayID *displays; + const SDL_DisplayID *displays; const SDL_DisplayMode **modes; const SDL_DisplayMode *mode; int num_displays, i; @@ -98,7 +98,6 @@ int main(int argc, char *argv[]) SDL_Log("\n"); } - SDL_free(displays); SDL_Quit(); SDLTest_CommonDestroyState(state); diff --git a/test/testwm.c b/test/testwm.c index dea9d94e7702b..fa3a003e8a74d 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -62,7 +62,7 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport) float x, y; float table_top; SDL_FPoint mouse_pos = { -1.0f, -1.0f }; - SDL_DisplayID *display_ids; + const SDL_DisplayID *displays; /* Get mouse position */ if (SDL_GetMouseFocus() == window) { @@ -98,18 +98,18 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport) highlighted_mode = NULL; } - display_ids = SDL_GetDisplays(NULL); + displays = SDL_GetDisplays(NULL); - if (display_ids) { - for (i = 0; display_ids[i]; ++i) { - const SDL_DisplayID display_id = display_ids[i]; - modes = SDL_GetFullscreenDisplayModes(display_id, NULL); + if (displays) { + for (i = 0; displays[i]; ++i) { + SDL_DisplayID display = displays[i]; + modes = SDL_GetFullscreenDisplayModes(display, NULL); for (j = 0; modes[j]; ++j) { SDL_FRect cell_rect; const SDL_DisplayMode *mode = modes[j]; (void)SDL_snprintf(text, sizeof(text), "%s mode %d: %dx%d@%gx %gHz", - SDL_GetDisplayName(display_id), + SDL_GetDisplayName(display), j, mode->w, mode->h, mode->pixel_density, mode->refresh_rate); /* Update column width */ @@ -145,7 +145,6 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport) } SDL_free((void *)modes); } - SDL_free(display_ids); } } From 9de8cb888a71302ccf603217abd2fd3f996074b8 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 17:02:47 -0700 Subject: [PATCH 396/431] SDL_GetFullscreenDisplayModes() follows the SDL_GetStringRule --- docs/README-migration.md | 3 +-- include/SDL3/SDL_video.h | 9 +++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/test/SDL_test_common.c | 3 +-- src/video/SDL_video.c | 31 ++++++++++++++++--------------- test/testautomation_video.c | 6 ++---- test/testdisplayinfo.c | 3 +-- test/testwm.c | 3 +-- 8 files changed, 28 insertions(+), 32 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 6bf247b3e9bbb..3e19018179e75 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -2015,14 +2015,13 @@ Rather than iterating over display modes using an index, there is a new function { SDL_DisplayID display = SDL_GetPrimaryDisplay(); int num_modes = 0; - SDL_DisplayMode **modes = SDL_GetFullscreenDisplayModes(display, &num_modes); + const SDL_DisplayMode * const *modes = SDL_GetFullscreenDisplayModes(display, &num_modes); if (modes) { for (i = 0; i < num_modes; ++i) { SDL_DisplayMode *mode = modes[i]; SDL_Log("Display %" SDL_PRIu32 " mode %d: %dx%d@%gx %gHz\n", display, i, mode->w, mode->h, mode->pixel_density, mode->refresh_rate); } - SDL_free(modes); } } ``` diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index 65720549f3ac9..c548bee6cc9cc 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -555,17 +555,18 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displ * - refresh rate -> highest to lowest * - pixel density -> lowest to highest * + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * * \param displayID the instance ID of the display to query. - * \param count a pointer filled in with the number of display modes returned. - * \returns a NULL terminated array of display mode pointers which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * \param count a pointer filled in with the number of display modes returned, may be NULL. + * \returns a NULL terminated array of display mode pointers or NULL on failure; call SDL_GetError() for * more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GetDisplays */ -extern SDL_DECLSPEC const SDL_DisplayMode ** SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count); +extern SDL_DECLSPEC const SDL_DisplayMode * const * SDLCALL SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count); /** * Get the closest match to the requested display mode. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 9190df4a505f4..25c0d944b7ef2 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -269,7 +269,7 @@ SDL_DYNAPI_PROC(const SDL_DisplayID*,SDL_GetDisplays,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetError,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetEventFilter,(SDL_EventFilter *a, void **b),(a,b),return) SDL_DYNAPI_PROC(float,SDL_GetFloatProperty,(SDL_PropertiesID a, const char *b, float c),(a,b,c),return) -SDL_DYNAPI_PROC(const SDL_DisplayMode**,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return) +SDL_DYNAPI_PROC(const SDL_DisplayMode* const*,SDL_GetFullscreenDisplayModes,(SDL_DisplayID a, int *b),(a,b),return) SDL_DYNAPI_PROC(int,SDL_GetGDKDefaultUser,(XUserHandle *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetGDKTaskQueue,(XTaskQueueHandle *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 0b96b7fbbd769..307b3b03e67bb 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1194,7 +1194,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) if (state->verbose & VERBOSE_MODES) { const SDL_DisplayID *displays; SDL_Rect bounds, usablebounds; - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; const SDL_DisplayMode *mode; int bpp; Uint32 Rmask, Gmask, Bmask, Amask; @@ -1258,7 +1258,6 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state) } } } - SDL_free((void *)modes); #if defined(SDL_VIDEO_DRIVER_WINDOWS) && !defined(SDL_PLATFORM_XBOXONE) && !defined(SDL_PLATFORM_XBOXSERIES) /* Print the D3D9 adapter index */ diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 9105f5996833f..6122230155c27 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1111,7 +1111,7 @@ void SDL_SetDisplayHDRProperties(SDL_VideoDisplay *display, const SDL_HDROutputP static const SDL_DisplayMode *SDL_GetFullscreenModeMatch(const SDL_DisplayMode *mode) { - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; SDL_DisplayMode fullscreen_mode; if (mode->w <= 0 || mode->h <= 0) { @@ -1150,8 +1150,6 @@ static const SDL_DisplayMode *SDL_GetFullscreenModeMatch(const SDL_DisplayMode * } } } - - SDL_free((void *)modes); } return mode; } @@ -1222,10 +1220,11 @@ void SDL_ResetFullscreenDisplayModes(SDL_VideoDisplay *display) display->current_mode = &display->desktop_mode; } -const SDL_DisplayMode **SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count) +const SDL_DisplayMode * const *SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, int *count) { int i; - const SDL_DisplayMode **modes; + int num_modes; + const SDL_DisplayMode **retval; SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID); if (count) { @@ -1238,27 +1237,30 @@ const SDL_DisplayMode **SDL_GetFullscreenDisplayModes(SDL_DisplayID displayID, i _this->GetDisplayModes(_this, display); } - modes = (const SDL_DisplayMode **)SDL_malloc((display->num_fullscreen_modes + 1) * sizeof(*modes)); - if (modes) { - if (count) { - *count = display->num_fullscreen_modes; + num_modes = display->num_fullscreen_modes; + retval = (const SDL_DisplayMode **)SDL_malloc((num_modes + 1) * sizeof(*retval) + num_modes * sizeof(**retval)); + if (retval) { + SDL_DisplayMode *modes = (SDL_DisplayMode *)((Uint8 *)retval + ((num_modes + 1) * sizeof(*retval))); + SDL_memcpy(modes, display->fullscreen_modes, num_modes * sizeof(*modes)); + for (i = 0; i < num_modes; ++i) { + retval[i] = modes++; } + retval[i] = NULL; - for (i = 0; i < display->num_fullscreen_modes; ++i) { - modes[i] = &display->fullscreen_modes[i]; + if (count) { + *count = num_modes; } - modes[i] = NULL; } else { if (count) { *count = 0; } } - return modes; + return SDL_FreeLater(retval); } const SDL_DisplayMode *SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID displayID, int w, int h, float refresh_rate, SDL_bool include_high_density_modes) { - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; const SDL_DisplayMode *mode, *closest = NULL; float aspect_ratio; int i; @@ -1311,7 +1313,6 @@ const SDL_DisplayMode *SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID display closest = mode; } - SDL_free((void *)modes); } return closest; } diff --git a/test/testautomation_video.c b/test/testautomation_video.c index 7d842819a0e0f..26620a5cc257c 100644 --- a/test/testautomation_video.c +++ b/test/testautomation_video.c @@ -306,7 +306,7 @@ static int video_getWindowFlags(void *arg) static int video_getFullscreenDisplayModes(void *arg) { const SDL_DisplayID *displays; - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; int count; int i; @@ -321,7 +321,6 @@ static int video_getFullscreenDisplayModes(void *arg) SDLTest_AssertPass("Call to SDL_GetFullscreenDisplayModes(%" SDL_PRIu32 ")", displays[i]); SDLTest_AssertCheck(modes != NULL, "Validate returned value from function; expected != NULL; got: %p", modes); SDLTest_AssertCheck(count >= 0, "Validate number of modes; expected: >= 0; got: %d", count); - SDL_free((void *)modes); } } @@ -334,7 +333,7 @@ static int video_getFullscreenDisplayModes(void *arg) static int video_getClosestDisplayModeCurrentResolution(void *arg) { const SDL_DisplayID *displays; - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; SDL_DisplayMode current; const SDL_DisplayMode *closest; int i, num_modes; @@ -370,7 +369,6 @@ static int video_getClosestDisplayModeCurrentResolution(void *arg) current.h, closest->h); } } - SDL_free((void *)modes); } } diff --git a/test/testdisplayinfo.c b/test/testdisplayinfo.c index 2ce13d86f982f..86b9173f9d775 100644 --- a/test/testdisplayinfo.c +++ b/test/testdisplayinfo.c @@ -34,7 +34,7 @@ print_mode(const char *prefix, const SDL_DisplayMode *mode) int main(int argc, char *argv[]) { const SDL_DisplayID *displays; - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; const SDL_DisplayMode *mode; int num_displays, i; SDLTest_CommonState *state; @@ -94,7 +94,6 @@ int main(int argc, char *argv[]) (void)SDL_snprintf(prefix, sizeof(prefix), " MODE %d", m); print_mode(prefix, modes[m]); } - SDL_free((void*)modes); SDL_Log("\n"); } diff --git a/test/testwm.c b/test/testwm.c index fa3a003e8a74d..f0838cccf2238 100644 --- a/test/testwm.c +++ b/test/testwm.c @@ -53,7 +53,7 @@ static const SDL_DisplayMode *highlighted_mode = NULL; static void draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport) { - const SDL_DisplayMode **modes; + const SDL_DisplayMode * const *modes; char text[1024]; const int lineHeight = 10; int i, j; @@ -143,7 +143,6 @@ draw_modes_menu(SDL_Window *window, SDL_Renderer *renderer, SDL_FRect viewport) column_chars = 0; } } - SDL_free((void *)modes); } } } From b32c9615a7486ecce4a53f72599e6b20d8961d2f Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 17:08:30 -0700 Subject: [PATCH 397/431] SDL_GetHaptics() follows the SDL_GetStringRule --- docs/README-migration.md | 3 +-- include/SDL3/SDL_haptic.h | 10 +++++----- src/dynapi/SDL_dynapi_procs.h | 2 +- src/haptic/SDL_haptic.c | 4 ++-- test/testhaptic.c | 7 +------ test/testhotplug.c | 2 +- test/testrumble.c | 7 +------ 7 files changed, 12 insertions(+), 23 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 3e19018179e75..165b44d4b19a2 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -695,7 +695,7 @@ Rather than iterating over haptic devices using device index, there is a new fun { if (SDL_InitSubSystem(SDL_INIT_HAPTIC) == 0) { int i, num_haptics; - SDL_HapticID *haptics = SDL_GetHaptics(&num_haptics); + const SDL_HapticID *haptics = SDL_GetHaptics(&num_haptics); if (haptics) { for (i = 0; i < num_haptics; ++i) { SDL_HapticID instance_id = haptics[i]; @@ -704,7 +704,6 @@ Rather than iterating over haptic devices using device index, there is a new fun SDL_Log("Haptic %" SDL_PRIu32 ": %s\n", instance_id, name ? name : "Unknown"); } - SDL_free(haptics); } SDL_QuitSubSystem(SDL_INIT_HAPTIC); } diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 93c646f57a353..058541cb96c40 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -45,7 +45,6 @@ * SDL_HapticID *haptics = SDL_GetHaptics(NULL); * if (haptics) { * haptic = SDL_OpenHaptic(haptics[0]); - * SDL_free(haptics); * } * if (haptic == NULL) * return -1; @@ -932,17 +931,18 @@ typedef Uint32 SDL_HapticID; /** * Get a list of currently connected haptic devices. * + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * * \param count a pointer filled in with the number of haptic devices - * returned. - * \returns a 0 terminated array of haptic device instance IDs which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * returned, may be NULL. + * \returns a 0 terminated array of haptic device instance IDs or NULL on failure; call SDL_GetError() for * more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_OpenHaptic */ -extern SDL_DECLSPEC SDL_HapticID * SDLCALL SDL_GetHaptics(int *count); +extern SDL_DECLSPEC const SDL_HapticID * SDLCALL SDL_GetHaptics(int *count); /** * Get the implementation dependent name of a haptic device. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 25c0d944b7ef2..f56c24ecc634d 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -327,7 +327,7 @@ SDL_DYNAPI_PROC(SDL_Haptic*,SDL_GetHapticFromID,(SDL_HapticID a),(a),return) SDL_DYNAPI_PROC(SDL_HapticID,SDL_GetHapticID,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticName,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHapticNameForID,(SDL_HapticID a),(a),return) -SDL_DYNAPI_PROC(SDL_HapticID*,SDL_GetHaptics,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_HapticID*,SDL_GetHaptics,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetHint,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetHintBoolean,(const char *a, SDL_bool b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetIOProperties,(SDL_IOStream *a),(a),return) diff --git a/src/haptic/SDL_haptic.c b/src/haptic/SDL_haptic.c index a1321bc2def1f..4d3ced531da10 100644 --- a/src/haptic/SDL_haptic.c +++ b/src/haptic/SDL_haptic.c @@ -63,7 +63,7 @@ static SDL_bool SDL_GetHapticIndex(SDL_HapticID instance_id, int *driver_index) return SDL_FALSE; } -SDL_HapticID *SDL_GetHaptics(int *count) +const SDL_HapticID *SDL_GetHaptics(int *count) { int device_index; int haptic_index = 0, num_haptics = 0; @@ -89,7 +89,7 @@ SDL_HapticID *SDL_GetHaptics(int *count) } } - return haptics; + return SDL_FreeLater(haptics); } const char *SDL_GetHapticNameForID(SDL_HapticID instance_id) diff --git a/test/testhaptic.c b/test/testhaptic.c index 51017b9b8890b..77cb98a16f6c3 100644 --- a/test/testhaptic.c +++ b/test/testhaptic.c @@ -40,7 +40,7 @@ int main(int argc, char **argv) int id[9]; int nefx; unsigned int supported; - SDL_HapticID *haptics; + const SDL_HapticID *haptics; int num_haptics; /* Initialize test framework */ @@ -91,7 +91,6 @@ int main(int argc, char **argv) if (haptics) { if (num_haptics == 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No Haptic devices found!\n"); - SDL_free(haptics); return 1; } @@ -101,7 +100,6 @@ int main(int argc, char **argv) if (i >= num_haptics) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Index out of range, aborting.\n"); - SDL_free(haptics); return 1; } } @@ -115,7 +113,6 @@ int main(int argc, char **argv) if (i >= num_haptics) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find device matching '%s', aborting.\n", name); - SDL_free(haptics); return 1; } } @@ -123,12 +120,10 @@ int main(int argc, char **argv) haptic = SDL_OpenHaptic(haptics[i]); if (!haptic) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", SDL_GetError()); - SDL_free(haptics); return 1; } SDL_Log("Device: %s\n", SDL_GetHapticName(haptic)); HapticPrintSupported(haptic); - SDL_free(haptics); } /* We only want force feedback errors. */ diff --git a/test/testhotplug.c b/test/testhotplug.c index ec635c1bf4fe3..461262c7a3928 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -91,7 +91,7 @@ int main(int argc, char *argv[]) if (enable_haptic) { int num_haptics; - SDL_free(SDL_GetHaptics(&num_haptics)); + SDL_GetHaptics(&num_haptics); SDL_Log("There are %d haptic devices at startup\n", num_haptics); } diff --git a/test/testrumble.c b/test/testrumble.c index ee957181cc1c3..a16fc3bfc3ac8 100644 --- a/test/testrumble.c +++ b/test/testrumble.c @@ -39,7 +39,7 @@ int main(int argc, char **argv) char *name = NULL; int index; SDLTest_CommonState *state; - SDL_HapticID *haptics; + const SDL_HapticID *haptics; int num_haptics; /* Initialize test framework */ @@ -92,7 +92,6 @@ int main(int argc, char **argv) if (haptics) { if (num_haptics == 0) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "No Haptic devices found!\n"); - SDL_free(haptics); return 1; } @@ -102,7 +101,6 @@ int main(int argc, char **argv) if (i >= num_haptics) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Index out of range, aborting.\n"); - SDL_free(haptics); return 1; } } @@ -116,7 +114,6 @@ int main(int argc, char **argv) if (i >= num_haptics) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to find device matching '%s', aborting.\n", name); - SDL_free(haptics); return 1; } } @@ -124,11 +121,9 @@ int main(int argc, char **argv) haptic = SDL_OpenHaptic(haptics[i]); if (!haptic) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to create the haptic device: %s\n", SDL_GetError()); - SDL_free(haptics); return 1; } SDL_Log("Device: %s\n", SDL_GetHapticName(haptic)); - SDL_free(haptics); } /* We only want force feedback errors. */ From 4961af4569eaaec8d2c9cbbd213236e6b7e2f1dd Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 17:13:33 -0700 Subject: [PATCH 398/431] SDL_GetJoysticks() follows the SDL_GetStringRule --- docs/README-migration.md | 3 +-- include/SDL3/SDL_joystick.h | 9 +++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/joystick/SDL_gamepad.c | 9 +++------ src/joystick/SDL_joystick.c | 7 +++---- test/testcontroller.c | 3 +-- test/testhotplug.c | 2 +- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 165b44d4b19a2..0fc2b412a277e 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -823,7 +823,7 @@ Rather than iterating over joysticks using device index, there is a new function { if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) == 0) { int i, num_joysticks; - SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks); + const SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks); if (joysticks) { for (i = 0; i < num_joysticks; ++i) { SDL_JoystickID instance_id = joysticks[i]; @@ -833,7 +833,6 @@ Rather than iterating over joysticks using device index, there is a new function SDL_Log("Joystick %" SDL_PRIu32 ": %s%s%s VID 0x%.4x, PID 0x%.4x\n", instance_id, name ? name : "Unknown", path ? ", " : "", path ? path : "", SDL_GetJoystickVendorForID(instance_id), SDL_GetJoystickProductForID(instance_id)); } - SDL_free(joysticks); } SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index 86f43342cffdd..e68db889132d0 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -210,9 +210,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); /** * Get a list of currently connected joysticks. * - * \param count a pointer filled in with the number of joysticks returned. - * \returns a 0 terminated array of joystick instance IDs which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of joysticks returned, may be NULL. + * \returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for * more information. * * \since This function is available since SDL 3.0.0. @@ -220,7 +221,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); * \sa SDL_HasJoystick * \sa SDL_OpenJoystick */ -extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count); +extern SDL_DECLSPEC const SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count); /** * Get the implementation dependent name of a joystick. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index f56c24ecc634d..8ae9622515bf3 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -365,7 +365,7 @@ SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickType,(SDL_Joystick *a),(a),retur SDL_DYNAPI_PROC(SDL_JoystickType,SDL_GetJoystickTypeForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendor,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickVendorForID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetJoysticks,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_JoystickID*,SDL_GetJoysticks,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromName,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_Keycode,SDL_GetKeyFromScancode,(SDL_Scancode a, SDL_Keymod b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyName,(SDL_Keycode a),(a),return) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 35961a2e4c7f3..d0d3ca9138ec0 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -89,7 +89,7 @@ typedef struct GamepadMapping_t typedef struct { int refcount _guarded; - SDL_JoystickID *joysticks _guarded; + const SDL_JoystickID *joysticks _guarded; GamepadMapping_t **joystick_mappings _guarded; int num_changed_mappings _guarded; @@ -579,7 +579,6 @@ static void PopMappingChangeTracking(void) } } - SDL_free(tracker->joysticks); SDL_free(tracker->joystick_mappings); SDL_free(tracker->changed_mappings); SDL_free(tracker); @@ -2358,7 +2357,7 @@ int SDL_InitGamepadMappings(void) int SDL_InitGamepads(void) { int i; - SDL_JoystickID *joysticks; + const SDL_JoystickID *joysticks; SDL_gamepads_initialized = SDL_TRUE; @@ -2373,7 +2372,6 @@ int SDL_InitGamepads(void) SDL_PrivateGamepadAdded(joysticks[i]); } } - SDL_free(joysticks); } return 0; @@ -2383,7 +2381,7 @@ SDL_bool SDL_HasGamepad(void) { int num_joysticks = 0; int num_gamepads = 0; - SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks); + const SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks); if (joysticks) { int i; for (i = num_joysticks - 1; i >= 0 && num_gamepads == 0; --i) { @@ -2391,7 +2389,6 @@ SDL_bool SDL_HasGamepad(void) ++num_gamepads; } } - SDL_free(joysticks); } if (num_gamepads > 0) { return SDL_TRUE; diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 91fec426128db..d2523d6beadc8 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -714,7 +714,7 @@ SDL_bool SDL_HasJoystick(void) return SDL_FALSE; } -SDL_JoystickID *SDL_GetJoysticks(int *count) +const SDL_JoystickID *SDL_GetJoysticks(int *count) { int i, num_joysticks, device_index; int joystick_index = 0, total_joysticks = 0; @@ -751,7 +751,7 @@ SDL_JoystickID *SDL_GetJoysticks(int *count) } SDL_UnlockJoysticks(); - return joysticks; + return SDL_FreeLater(joysticks); } const SDL_SteamVirtualGamepadInfo *SDL_GetJoystickVirtualGamepadInfoForID(SDL_JoystickID instance_id) @@ -1905,7 +1905,7 @@ void SDL_CloseJoystick(SDL_Joystick *joystick) void SDL_QuitJoysticks(void) { int i; - SDL_JoystickID *joysticks; + const SDL_JoystickID *joysticks; SDL_LockJoysticks(); @@ -1916,7 +1916,6 @@ void SDL_QuitJoysticks(void) for (i = 0; joysticks[i]; ++i) { SDL_PrivateJoystickRemoved(joysticks[i]); } - SDL_free(joysticks); } while (SDL_joysticks) { diff --git a/test/testcontroller.c b/test/testcontroller.c index e6820ff88bb01..daaa86102dabe 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -1187,7 +1187,7 @@ static void OpenVirtualGamepad(void) static void CloseVirtualGamepad(void) { int i; - SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL); + const SDL_JoystickID *joysticks = SDL_GetJoysticks(NULL); if (joysticks) { for (i = 0; joysticks[i]; ++i) { SDL_JoystickID instance_id = joysticks[i]; @@ -1195,7 +1195,6 @@ static void CloseVirtualGamepad(void) SDL_DetachVirtualJoystick(instance_id); } } - SDL_free(joysticks); } if (virtual_joystick) { diff --git a/test/testhotplug.c b/test/testhotplug.c index 461262c7a3928..78e980fea8ce5 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) SDL_free(SDL_GetMice(&num_mice)); SDL_Log("There are %d mice at startup\n", num_mice); - SDL_free(SDL_GetJoysticks(&num_joysticks)); + SDL_GetJoysticks(&num_joysticks); SDL_Log("There are %d joysticks at startup\n", num_joysticks); if (enable_haptic) { From 5ce0aacaa406869ef83fb9e0ae5c7702ab8b3c44 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 17:04:57 -0700 Subject: [PATCH 399/431] SDL_GetGamepads() follows the SDL_GetStringRule --- include/SDL3/SDL_gamepad.h | 11 ++++++----- src/dynapi/SDL_dynapi_procs.h | 2 +- src/joystick/SDL_gamepad.c | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index f0868df05d0c2..f7aa3e8aedb56 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -468,17 +468,18 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void); /** * Get a list of currently connected gamepads. * - * \param count a pointer filled in with the number of gamepads returned. - * \returns a 0 terminated array of joystick instance IDs which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for - * more details. + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of gamepads returned, may be NULL. + * \returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasGamepad * \sa SDL_OpenGamepad */ -extern SDL_DECLSPEC SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count); +extern SDL_DECLSPEC const SDL_JoystickID * SDLCALL SDL_GetGamepads(int *count); /** * Check if the given joystick is supported by the gamepad interface. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 8ae9622515bf3..d1d90589dcb24 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -317,7 +317,7 @@ SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeForID,(SDL_JoystickID a),(a),r SDL_DYNAPI_PROC(SDL_GamepadType,SDL_GetGamepadTypeFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendor,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadVendorForID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickID*,SDL_GetGamepads,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_JoystickID*,SDL_GetGamepads,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_MouseButtonFlags,SDL_GetGlobalMouseState,(float *a, float *b),(a,b),return) SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetGlobalProperties,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetGrabbedWindow,(void),(),return) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index d0d3ca9138ec0..eadc1404c3bac 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -2396,11 +2396,11 @@ SDL_bool SDL_HasGamepad(void) return SDL_FALSE; } -SDL_JoystickID *SDL_GetGamepads(int *count) +const SDL_JoystickID *SDL_GetGamepads(int *count) { int num_joysticks = 0; int num_gamepads = 0; - SDL_JoystickID *joysticks = SDL_GetJoysticks(&num_joysticks); + SDL_JoystickID *joysticks = SDL_ClaimEventMemory(SDL_GetJoysticks(&num_joysticks)); if (joysticks) { int i; for (i = num_joysticks - 1; i >= 0; --i) { @@ -2414,7 +2414,7 @@ SDL_JoystickID *SDL_GetGamepads(int *count) if (count) { *count = num_gamepads; } - return joysticks; + return SDL_FreeLater(joysticks); } const char *SDL_GetGamepadNameForID(SDL_JoystickID instance_id) From 6ca18ed0e5f903b1b6f66b2689480cea90d112e9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 17:18:56 -0700 Subject: [PATCH 400/431] SDL_GetKeyboards() follows the SDL_GetStringRule --- include/SDL3/SDL_keyboard.h | 9 +++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/events/SDL_keyboard.c | 4 ++-- src/video/windows/SDL_windowsevents.c | 5 ++--- src/video/x11/SDL_x11xinput2.c | 5 ++--- test/testhotplug.c | 2 +- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index cfa6b10f6d378..f8c5067f1b4d2 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -73,9 +73,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * power buttons, etc. You should wait for input from a device before you * consider it actively in use. * - * \param count a pointer filled in with the number of keyboards returned. - * \returns a 0 terminated array of keyboards instance IDs which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of keyboards returned, may be NULL. + * \returns a 0 terminated array of keyboards instance IDs or NULL on failure; call SDL_GetError() for * more information. * * \since This function is available since SDL 3.0.0. @@ -83,7 +84,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * \sa SDL_GetKeyboardNameForID * \sa SDL_HasKeyboard */ -extern SDL_DECLSPEC SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count); +extern SDL_DECLSPEC const SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count); /** * Get the name of a keyboard. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index d1d90589dcb24..f63be2b173de6 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -372,7 +372,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetKeyName,(SDL_Keycode a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetKeyboardFocus,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetKeyboardNameForID,(SDL_KeyboardID a),(a),return) SDL_DYNAPI_PROC(const Uint8*,SDL_GetKeyboardState,(int *a),(a),return) -SDL_DYNAPI_PROC(SDL_KeyboardID*,SDL_GetKeyboards,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_KeyboardID*,SDL_GetKeyboards,(int *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetLogOutputFunction,(SDL_LogOutputFunction *a, void **b),(a,b),) SDL_DYNAPI_PROC(SDL_LogPriority,SDL_GetLogPriority,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetMasksForPixelFormat,(SDL_PixelFormat a, int *b, Uint32 *c, Uint32 *d, Uint32 *e, Uint32 *f),(a,b,c,d,e,f),return) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 4ef6a04da4d4d..1a426e0131c44 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -177,7 +177,7 @@ SDL_bool SDL_HasKeyboard(void) return (SDL_keyboard_count > 0); } -SDL_KeyboardID *SDL_GetKeyboards(int *count) +const SDL_KeyboardID *SDL_GetKeyboards(int *count) { int i; SDL_KeyboardID *keyboards; @@ -198,7 +198,7 @@ SDL_KeyboardID *SDL_GetKeyboards(int *count) } } - return keyboards; + return SDL_FreeLater(keyboards); } const char *SDL_GetKeyboardNameForID(SDL_KeyboardID instance_id) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index 048223ffef3aa..ee211f80671af 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -824,7 +824,7 @@ static void AddDeviceID(Uint32 deviceID, Uint32 **list, int *count) *list = new_list; } -static SDL_bool HasDeviceID(Uint32 deviceID, Uint32 *list, int count) +static SDL_bool HasDeviceID(Uint32 deviceID, const Uint32 *list, int count) { for (int i = 0; i < count; ++i) { if (deviceID == list[i]) { @@ -867,7 +867,7 @@ void WIN_CheckKeyboardAndMouseHotplug(SDL_VideoDevice *_this, SDL_bool initial_c PRAWINPUTDEVICELIST raw_devices = NULL; UINT raw_device_count = 0; int old_keyboard_count = 0; - SDL_KeyboardID *old_keyboards = NULL; + const SDL_KeyboardID *old_keyboards = NULL; int new_keyboard_count = 0; SDL_KeyboardID *new_keyboards = NULL; int old_mouse_count = 0; @@ -982,7 +982,6 @@ void WIN_CheckKeyboardAndMouseHotplug(SDL_VideoDevice *_this, SDL_bool initial_c } } - SDL_free(old_keyboards); SDL_free(new_keyboards); SDL_free(old_mice); SDL_free(new_mice); diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 24025da12765d..3b33e6d4b0c53 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -715,7 +715,7 @@ static void AddDeviceID(Uint32 deviceID, Uint32 **list, int *count) *list = new_list; } -static SDL_bool HasDeviceID(Uint32 deviceID, Uint32 *list, int count) +static SDL_bool HasDeviceID(Uint32 deviceID, const Uint32 *list, int count) { for (int i = 0; i < count; ++i) { if (deviceID == list[i]) { @@ -734,7 +734,7 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) XIDeviceInfo *info; int ndevices; int old_keyboard_count = 0; - SDL_KeyboardID *old_keyboards = NULL; + const SDL_KeyboardID *old_keyboards = NULL; int new_keyboard_count = 0; SDL_KeyboardID *new_keyboards = NULL; int old_mouse_count = 0; @@ -839,7 +839,6 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) } } - SDL_free(old_keyboards); SDL_free(new_keyboards); SDL_free(old_mice); SDL_free(new_mice); diff --git a/test/testhotplug.c b/test/testhotplug.c index 78e980fea8ce5..0f51c49e353ab 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) //SDL_CreateWindow("Dummy", 128, 128, 0); */ - SDL_free(SDL_GetKeyboards(&num_keyboards)); + SDL_GetKeyboards(&num_keyboards); SDL_Log("There are %d keyboards at startup\n", num_keyboards); SDL_free(SDL_GetMice(&num_mice)); From 9be73ed7c5d81f5bf5431285ab9a319836adac00 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 17:29:24 -0700 Subject: [PATCH 401/431] SDL_GetMice() follows the SDL_GetStringRule --- include/SDL3/SDL_mouse.h | 9 +++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/events/SDL_mouse.c | 4 ++-- src/video/windows/SDL_windowsevents.c | 3 +-- src/video/x11/SDL_x11xinput2.c | 3 +-- test/testhotplug.c | 2 +- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index 3a2cda67e2552..abcedc30cbd57 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -135,9 +135,10 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * You should wait for input from a device before you consider it actively in * use. * - * \param count a pointer filled in with the number of mice returned. - * \returns a 0 terminated array of mouse instance IDs which should be freed - * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of mice returned, may be NULL. + * \returns a 0 terminated array of mouse instance IDs or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. @@ -145,7 +146,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * \sa SDL_GetMouseNameForID * \sa SDL_HasMouse */ -extern SDL_DECLSPEC SDL_MouseID * SDLCALL SDL_GetMice(int *count); +extern SDL_DECLSPEC const SDL_MouseID * SDLCALL SDL_GetMice(int *count); /** * Get the name of a mouse. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index f63be2b173de6..aa044d90f64d0 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -379,7 +379,7 @@ SDL_DYNAPI_PROC(int,SDL_GetMasksForPixelFormat,(SDL_PixelFormat a, int *b, Uint3 SDL_DYNAPI_PROC(int,SDL_GetMaxHapticEffects,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetMaxHapticEffectsPlaying,(SDL_Haptic *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GetMemoryFunctions,(SDL_malloc_func *a, SDL_calloc_func *b, SDL_realloc_func *c, SDL_free_func *d),(a,b,c,d),) -SDL_DYNAPI_PROC(SDL_MouseID*,SDL_GetMice,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_MouseID*,SDL_GetMice,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Keymod,SDL_GetModState,(void),(),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetMouseFocus,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetMouseNameForID,(SDL_MouseID a),(a),return) diff --git a/src/events/SDL_mouse.c b/src/events/SDL_mouse.c index b84965280e083..9006da3517428 100644 --- a/src/events/SDL_mouse.c +++ b/src/events/SDL_mouse.c @@ -346,7 +346,7 @@ SDL_bool SDL_HasMouse(void) return (SDL_mouse_count > 0); } -SDL_MouseID *SDL_GetMice(int *count) +const SDL_MouseID *SDL_GetMice(int *count) { int i; SDL_MouseID *mice; @@ -367,7 +367,7 @@ SDL_MouseID *SDL_GetMice(int *count) } } - return mice; + return SDL_FreeLater(mice); } const char *SDL_GetMouseNameForID(SDL_MouseID instance_id) diff --git a/src/video/windows/SDL_windowsevents.c b/src/video/windows/SDL_windowsevents.c index ee211f80671af..a05fedca87307 100644 --- a/src/video/windows/SDL_windowsevents.c +++ b/src/video/windows/SDL_windowsevents.c @@ -871,7 +871,7 @@ void WIN_CheckKeyboardAndMouseHotplug(SDL_VideoDevice *_this, SDL_bool initial_c int new_keyboard_count = 0; SDL_KeyboardID *new_keyboards = NULL; int old_mouse_count = 0; - SDL_MouseID *old_mice = NULL; + const SDL_MouseID *old_mice = NULL; int new_mouse_count = 0; SDL_MouseID *new_mice = NULL; SDL_bool send_event = !initial_check; @@ -983,7 +983,6 @@ void WIN_CheckKeyboardAndMouseHotplug(SDL_VideoDevice *_this, SDL_bool initial_c } SDL_free(new_keyboards); - SDL_free(old_mice); SDL_free(new_mice); SetupDiDestroyDeviceInfoList(devinfo); diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 3b33e6d4b0c53..8ef4197cf49d0 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -738,7 +738,7 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) int new_keyboard_count = 0; SDL_KeyboardID *new_keyboards = NULL; int old_mouse_count = 0; - SDL_MouseID *old_mice = NULL; + const SDL_MouseID *old_mice = NULL; int new_mouse_count = 0; SDL_MouseID *new_mice = NULL; int old_touch_count = 0; @@ -840,7 +840,6 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) } SDL_free(new_keyboards); - SDL_free(old_mice); SDL_free(new_mice); SDL_free(old_touch_devices); SDL_free(new_touch_devices); diff --git a/test/testhotplug.c b/test/testhotplug.c index 0f51c49e353ab..328ef76c11602 100644 --- a/test/testhotplug.c +++ b/test/testhotplug.c @@ -83,7 +83,7 @@ int main(int argc, char *argv[]) SDL_GetKeyboards(&num_keyboards); SDL_Log("There are %d keyboards at startup\n", num_keyboards); - SDL_free(SDL_GetMice(&num_mice)); + SDL_GetMice(&num_mice); SDL_Log("There are %d mice at startup\n", num_mice); SDL_GetJoysticks(&num_joysticks); From 4f8c34840257aa83bf37cb19977376c744b0063e Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 22:07:05 -0700 Subject: [PATCH 402/431] SDL_GetPreferredLocales() follows the SDL_GetStringRule --- include/SDL3/SDL_locale.h | 9 ++++--- src/dynapi/SDL_dynapi_procs.h | 2 +- src/locale/SDL_locale.c | 47 ++++++++++++++++++++++------------- test/testlocale.c | 8 +++--- 4 files changed, 41 insertions(+), 25 deletions(-) diff --git a/include/SDL3/SDL_locale.h b/include/SDL3/SDL_locale.h index 81f7e8bca68be..784841a3bfadc 100644 --- a/include/SDL3/SDL_locale.h +++ b/include/SDL3/SDL_locale.h @@ -94,13 +94,16 @@ typedef struct SDL_Locale * if possible, and you can call this function again to get an updated copy of * preferred locales. * - * \returns array of locales, terminated with a locale with a NULL language - * field. Will return NULL on error; call SDL_GetError() for more + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of locales returned, may + * be NULL. + * \returns a NULL terminated array of locale pointers, or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Locale * SDLCALL SDL_GetPreferredLocales(void); +extern SDL_DECLSPEC const SDL_Locale * const * SDLCALL SDL_GetPreferredLocales(int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index aa044d90f64d0..e826ed45797e1 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -416,7 +416,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetPlatform,(void),(),return) SDL_DYNAPI_PROC(void*,SDL_GetPointerProperty,(SDL_PropertiesID a, const char *b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_PowerState,SDL_GetPowerInfo,(int *a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetPrefPath,(const char *a, const char *b),(a,b),return) -SDL_DYNAPI_PROC(SDL_Locale*,SDL_GetPreferredLocales,(void),(),return) +SDL_DYNAPI_PROC(const SDL_Locale* const*,SDL_GetPreferredLocales,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_DisplayID,SDL_GetPrimaryDisplay,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetPrimarySelectionText,(void),(),return) SDL_DYNAPI_PROC(SDL_PropertyType,SDL_GetPropertyType,(SDL_PropertiesID a, const char *b),(a,b),return) diff --git a/src/locale/SDL_locale.c b/src/locale/SDL_locale.c index 5ad0312757a18..ef118cac5c974 100644 --- a/src/locale/SDL_locale.c +++ b/src/locale/SDL_locale.c @@ -22,39 +22,48 @@ #include "SDL_internal.h" #include "SDL_syslocale.h" -static SDL_Locale *build_locales_from_csv_string(char *csv) +static const SDL_Locale * const *build_locales_from_csv_string(char *csv, int *count) { - size_t num_locales = 1; /* at least one */ + int i, num_locales; size_t slen; size_t alloclen; char *ptr; SDL_Locale *loc; - SDL_Locale *retval; + const SDL_Locale **retval; - if (!csv || !csv[0]) { + if (count) { + *count = 0; + } + + while (csv && *csv && SDL_isspace(*csv)) { + ++csv; + } + if (!csv || !*csv) { return NULL; /* nothing to report */ } + num_locales = 1; /* at least one */ for (ptr = csv; *ptr; ptr++) { if (*ptr == ',') { num_locales++; } } - num_locales++; /* one more for terminator */ - slen = ((size_t)(ptr - csv)) + 1; /* SDL_strlen(csv) + 1 */ - alloclen = slen + (num_locales * sizeof(SDL_Locale)); + alloclen = (num_locales * sizeof(SDL_Locale *)) + (num_locales * sizeof(SDL_Locale)) + slen; - loc = retval = (SDL_Locale *)SDL_calloc(1, alloclen); + retval = (const SDL_Locale **)SDL_calloc(1, alloclen); if (!retval) { return NULL; /* oh well */ } - ptr = (char *)(retval + num_locales); - SDL_strlcpy(ptr, csv, slen); + loc = (SDL_Locale *)((Uint8 *)retval + ((num_locales + 1) * sizeof(SDL_Locale *))); + ptr = (char *)(loc + num_locales); + SDL_memcpy(ptr, csv, slen); + i = 0; + retval[i++] = loc; while (SDL_TRUE) { /* parse out the string */ - while (*ptr == ' ') { + while (SDL_isspace(*ptr)) { ptr++; /* skip whitespace. */ } @@ -64,17 +73,17 @@ static SDL_Locale *build_locales_from_csv_string(char *csv) loc->language = ptr++; while (SDL_TRUE) { const char ch = *ptr; - if (ch == '_') { + if (ch == '_' || ch == '-') { *(ptr++) = '\0'; loc->country = ptr; - } else if (ch == ' ') { + } else if (SDL_isspace(ch)) { *(ptr++) = '\0'; /* trim ending whitespace and keep going. */ } else if (ch == ',') { *(ptr++) = '\0'; loc++; + retval[i++] = loc; break; } else if (ch == '\0') { - loc++; break; } else { ptr++; /* just keep going, still a valid string */ @@ -82,10 +91,14 @@ static SDL_Locale *build_locales_from_csv_string(char *csv) } } - return retval; + if (count) { + *count = num_locales; + } + + return SDL_FreeLater(retval); } -SDL_Locale *SDL_GetPreferredLocales(void) +const SDL_Locale * const *SDL_GetPreferredLocales(int *count) { char locbuf[128]; /* enough for 21 "xx_YY," language strings. */ const char *hint = SDL_GetHint(SDL_HINT_PREFERRED_LOCALES); @@ -95,5 +108,5 @@ SDL_Locale *SDL_GetPreferredLocales(void) SDL_zeroa(locbuf); SDL_SYS_GetPreferredLocales(locbuf, sizeof(locbuf)); } - return build_locales_from_csv_string(locbuf); + return build_locales_from_csv_string(locbuf, count); } diff --git a/test/testlocale.c b/test/testlocale.c index d86aead838fec..5a9a53d344509 100644 --- a/test/testlocale.c +++ b/test/testlocale.c @@ -15,20 +15,20 @@ static void log_locales(void) { - SDL_Locale *locales = SDL_GetPreferredLocales(); + const SDL_Locale * const *locales = SDL_GetPreferredLocales(NULL); if (!locales) { SDL_Log("Couldn't determine locales: %s", SDL_GetError()); } else { - SDL_Locale *l; + int i; unsigned int total = 0; SDL_Log("Locales, in order of preference:"); - for (l = locales; l->language; l++) { + for (i = 0; locales[i]; ++i) { + const SDL_Locale *l = locales[i]; const char *c = l->country; SDL_Log(" - %s%s%s", l->language, c ? "_" : "", c ? c : ""); total++; } SDL_Log("%u locales seen.", total); - SDL_free(locales); } } From 856d598d6ec6526d4c4c53f4e6c3e16106c3f1d3 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 22:10:29 -0700 Subject: [PATCH 403/431] SDL_GetSensors() follows the SDL_GetStringRule --- docs/README-migration.md | 3 +-- include/SDL3/SDL_sensor.h | 7 +++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/joystick/SDL_joystick.c | 6 ++---- src/sensor/SDL_sensor.c | 4 ++-- test/testsensor.c | 3 +-- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/docs/README-migration.md b/docs/README-migration.md index 0fc2b412a277e..29c4294678c83 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -1564,7 +1564,7 @@ Rather than iterating over sensors using device index, there is a new function S { if (SDL_InitSubSystem(SDL_INIT_SENSOR) == 0) { int i, num_sensors; - SDL_SensorID *sensors = SDL_GetSensors(&num_sensors); + const SDL_SensorID *sensors = SDL_GetSensors(&num_sensors); if (sensors) { for (i = 0; i < num_sensors; ++i) { SDL_Log("Sensor %" SDL_PRIu32 ": %s, type %d, platform type %d\n", @@ -1573,7 +1573,6 @@ Rather than iterating over sensors using device index, there is a new function S SDL_GetSensorTypeForID(sensors[i]), SDL_GetSensorNonPortableTypeForID(sensors[i])); } - SDL_free(sensors); } SDL_QuitSubSystem(SDL_INIT_SENSOR); } diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index dc43782f1a905..2743f3734b7f8 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -146,14 +146,13 @@ typedef enum SDL_SensorType /** * Get a list of currently connected sensors. * - * \param count a pointer filled in with the number of sensors returned. - * \returns a 0 terminated array of sensor instance IDs which should be freed - * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * \param count a pointer filled in with the number of sensors returned, may be NULL. + * \returns a 0 terminated array of sensor instance IDs or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_SensorID * SDLCALL SDL_GetSensors(int *count); +extern SDL_DECLSPEC const SDL_SensorID * SDLCALL SDL_GetSensors(int *count); /** * Get the implementation dependent name of a sensor. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index e826ed45797e1..64b0d0a4a5cdb 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -470,7 +470,7 @@ SDL_DYNAPI_PROC(int,SDL_GetSensorNonPortableTypeForID,(SDL_SensorID a),(a),retur SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetSensorProperties,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorType,(SDL_Sensor *a),(a),return) SDL_DYNAPI_PROC(SDL_SensorType,SDL_GetSensorTypeForID,(SDL_SensorID a),(a),return) -SDL_DYNAPI_PROC(SDL_SensorID*,SDL_GetSensors,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_SensorID*,SDL_GetSensors,(int *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetSilenceValueForFormat,(SDL_AudioFormat a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetStorageFileSize,(SDL_Storage *a, const char *b, Uint64 *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_GetStoragePathInfo,(SDL_Storage *a, const char *b, SDL_PathInfo *c),(a,b,c),return) diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index d2523d6beadc8..239fb02ca0547 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -858,7 +858,7 @@ static SDL_bool IsROGAlly(SDL_Joystick *joystick) SDL_bool has_ally_gyro = SDL_FALSE; if (SDL_InitSubSystem(SDL_INIT_SENSOR) == 0) { - SDL_SensorID *sensors = SDL_GetSensors(NULL); + const SDL_SensorID *sensors = SDL_GetSensors(NULL); if (sensors) { int i; for (i = 0; sensors[i]; ++i) { @@ -877,7 +877,6 @@ static SDL_bool IsROGAlly(SDL_Joystick *joystick) } } } - SDL_free(sensors); } SDL_QuitSubSystem(SDL_INIT_SENSOR); } @@ -952,7 +951,7 @@ static SDL_bool ShouldAttemptSensorFusion(SDL_Joystick *joystick, SDL_bool *inve static void AttemptSensorFusion(SDL_Joystick *joystick, SDL_bool invert_sensors) { - SDL_SensorID *sensors; + const SDL_SensorID *sensors; unsigned int i, j; SDL_AssertJoysticksLocked(); @@ -981,7 +980,6 @@ static void AttemptSensorFusion(SDL_Joystick *joystick, SDL_bool invert_sensors) SDL_PrivateJoystickAddSensor(joystick, SDL_SENSOR_GYRO, 0.0f); } } - SDL_free(sensors); } SDL_QuitSubSystem(SDL_INIT_SENSOR); diff --git a/src/sensor/SDL_sensor.c b/src/sensor/SDL_sensor.c index f79debe372015..466bf3734c9ac 100644 --- a/src/sensor/SDL_sensor.c +++ b/src/sensor/SDL_sensor.c @@ -170,7 +170,7 @@ SDL_bool SDL_SensorsOpened(void) return opened; } -SDL_SensorID *SDL_GetSensors(int *count) +const SDL_SensorID *SDL_GetSensors(int *count) { int i, num_sensors, device_index; int sensor_index = 0, total_sensors = 0; @@ -207,7 +207,7 @@ SDL_SensorID *SDL_GetSensors(int *count) } SDL_UnlockSensors(); - return sensors; + return SDL_FreeLater(sensors); } /* diff --git a/test/testsensor.c b/test/testsensor.c index 404c9723bf3c4..38bced06ea8db 100644 --- a/test/testsensor.c +++ b/test/testsensor.c @@ -58,7 +58,7 @@ static void HandleSensorEvent(SDL_SensorEvent *event) int main(int argc, char **argv) { - SDL_SensorID *sensors; + const SDL_SensorID *sensors; int i, num_sensors, num_opened; SDLTest_CommonState *state; @@ -104,7 +104,6 @@ int main(int argc, char **argv) } } } - SDL_free(sensors); } SDL_Log("Opened %d sensors\n", num_opened); From eb22fcce358e93e8c8dafb17d24c1fed56dcf5ff Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 22:15:11 -0700 Subject: [PATCH 404/431] SDL_GetTouchDevices() follows the SDL_GetStringRule --- include/SDL3/SDL_touch.h | 9 +++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/events/SDL_touch.c | 4 ++-- src/video/x11/SDL_x11xinput2.c | 3 +-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index 4e258fca97614..808a69ea437b8 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -83,15 +83,16 @@ typedef struct SDL_Finger * Therefore the returned list might be empty, although devices are available. * After using all devices at least once the number will be correct. * - * \param count a pointer filled in with the number of devices returned, can + * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * + * \param count a pointer filled in with the number of devices returned, may * be NULL. - * \returns a 0 terminated array of touch device IDs which should be freed - * with SDL_free(), or NULL on failure; call SDL_GetError() for more + * \returns a 0 terminated array of touch device IDs or NULL on failure; call SDL_GetError() for more * information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count); +extern SDL_DECLSPEC const SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count); /** * Get the touch device name as reported from the driver. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 64b0d0a4a5cdb..769d1e9bb62e3 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -502,7 +502,7 @@ SDL_DYNAPI_PROC(Uint64,SDL_GetTicks,(void),(),return) SDL_DYNAPI_PROC(Uint64,SDL_GetTicksNS,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetTouchDeviceName,(SDL_TouchID a),(a),return) SDL_DYNAPI_PROC(SDL_TouchDeviceType,SDL_GetTouchDeviceType,(SDL_TouchID a),(a),return) -SDL_DYNAPI_PROC(SDL_TouchID*,SDL_GetTouchDevices,(int *a),(a),return) +SDL_DYNAPI_PROC(const SDL_TouchID*,SDL_GetTouchDevices,(int *a),(a),return) SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return) diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index 7d4e4ff19b01a..c2cada05677ba 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -49,7 +49,7 @@ SDL_bool SDL_TouchDevicesAvailable(void) return SDL_num_touch > 0; } -SDL_TouchID *SDL_GetTouchDevices(int *count) +const SDL_TouchID *SDL_GetTouchDevices(int *count) { if (count) { *count = 0; @@ -67,7 +67,7 @@ SDL_TouchID *SDL_GetTouchDevices(int *count) } } - return retval; + return SDL_FreeLater(retval); } static int SDL_GetTouchIndex(SDL_TouchID id) diff --git a/src/video/x11/SDL_x11xinput2.c b/src/video/x11/SDL_x11xinput2.c index 8ef4197cf49d0..9ab979f0f126a 100644 --- a/src/video/x11/SDL_x11xinput2.c +++ b/src/video/x11/SDL_x11xinput2.c @@ -742,7 +742,7 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) int new_mouse_count = 0; SDL_MouseID *new_mice = NULL; int old_touch_count = 0; - SDL_TouchID *old_touch_devices64 = NULL; + const SDL_TouchID *old_touch_devices64 = NULL; Uint32 *old_touch_devices = NULL; int new_touch_count = 0; Uint32 *new_touch_devices = NULL; @@ -765,7 +765,6 @@ void X11_Xinput2UpdateDevices(SDL_VideoDevice *_this, SDL_bool initial_check) } } } - SDL_free(old_touch_devices64); for (int i = 0; i < ndevices; i++) { XIDeviceInfo *dev = &info[i]; From 892df4bf4b38d5867916bd580d0fcaa9b346954c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 18 Jul 2024 22:20:17 -0700 Subject: [PATCH 405/431] SDL_GetWindowICCProfile() follows the SDL_GetStringRule --- include/SDL3/SDL_video.h | 4 ++-- src/dynapi/SDL_dynapi_procs.h | 2 +- src/video/SDL_video.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index c548bee6cc9cc..af7d52a9bab19 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -767,7 +767,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode( /** * Get the raw ICC profile data for the screen the window is currently on. * - * Data returned should be freed with SDL_free. + * The returned data follows the SDL_GetStringRule, and will be automatically freed later. * * \param window the window to query. * \param size the size of the ICC profile. @@ -776,7 +776,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode( * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC void * SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size); +extern SDL_DECLSPEC const void * SDLCALL SDL_GetWindowICCProfile(SDL_Window *window, size_t *size); /** * Get the pixel format associated with the window. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 769d1e9bb62e3..3dec54f509149 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -515,7 +515,7 @@ SDL_DYNAPI_PROC(float,SDL_GetWindowDisplayScale,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_WindowFlags,SDL_GetWindowFlags,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_Window*,SDL_GetWindowFromID,(SDL_WindowID a),(a),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetWindowFullscreenMode,(SDL_Window *a),(a),return) -SDL_DYNAPI_PROC(void*,SDL_GetWindowICCProfile,(SDL_Window *a, size_t *b),(a,b),return) +SDL_DYNAPI_PROC(const void*,SDL_GetWindowICCProfile,(SDL_Window *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(SDL_WindowID,SDL_GetWindowID,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GetWindowKeyboardGrab,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetWindowMaximumSize,(SDL_Window *a, int *b, int *c),(a,b,c),return) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 6122230155c27..8f4ea4910b461 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -2000,13 +2000,13 @@ const SDL_DisplayMode *SDL_GetWindowFullscreenMode(SDL_Window *window) } } -void *SDL_GetWindowICCProfile(SDL_Window *window, size_t *size) +const void *SDL_GetWindowICCProfile(SDL_Window *window, size_t *size) { if (!_this->GetWindowICCProfile) { SDL_Unsupported(); return NULL; } - return _this->GetWindowICCProfile(_this, window, size); + return SDL_FreeLater(_this->GetWindowICCProfile(_this, window, size)); } SDL_PixelFormat SDL_GetWindowPixelFormat(SDL_Window *window) From 61a7a0e579d7eb23e727d107cf676b46636c46e9 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 09:08:17 -0700 Subject: [PATCH 406/431] SDL_GUIDToString() follows the SDL_GetStringRule Also removed the distinction between SDL_GUID and SDL_JoystickGUID --- build-scripts/SDL_migration.cocci | 12 +-- docs/README-migration.md | 7 +- include/SDL3/SDL_gamepad.h | 6 +- include/SDL3/SDL_guid.h | 8 +- include/SDL3/SDL_joystick.h | 54 ++++--------- include/SDL3/SDL_oldnames.h | 8 +- src/SDL_guid.c | 23 ++---- src/dynapi/SDL_dynapi.sym | 2 - src/dynapi/SDL_dynapi_overrides.h | 2 - src/dynapi/SDL_dynapi_procs.h | 14 ++-- src/joystick/SDL_gamepad.c | 54 ++++++------- src/joystick/SDL_gamepad_c.h | 4 +- src/joystick/SDL_joystick.c | 78 ++++++++----------- src/joystick/SDL_joystick_c.h | 30 +++---- src/joystick/SDL_sysjoystick.h | 4 +- src/joystick/android/SDL_sysjoystick.c | 4 +- src/joystick/android/SDL_sysjoystick_c.h | 2 +- src/joystick/apple/SDL_mfijoystick.m | 4 +- src/joystick/apple/SDL_mfijoystick_c.h | 2 +- src/joystick/bsd/SDL_bsdjoystick.c | 6 +- src/joystick/darwin/SDL_iokitjoystick.c | 4 +- src/joystick/darwin/SDL_iokitjoystick_c.h | 2 +- src/joystick/dummy/SDL_sysjoystick.c | 4 +- src/joystick/emscripten/SDL_sysjoystick.c | 2 +- src/joystick/gdk/SDL_gameinputjoystick.c | 4 +- src/joystick/haiku/SDL_haikujoystick.cc | 2 +- src/joystick/hidapi/SDL_hidapijoystick.c | 8 +- src/joystick/hidapi/SDL_hidapijoystick_c.h | 6 +- src/joystick/linux/SDL_sysjoystick.c | 10 +-- src/joystick/linux/SDL_sysjoystick_c.h | 2 +- src/joystick/n3ds/SDL_sysjoystick.c | 4 +- src/joystick/ps2/SDL_sysjoystick.c | 2 +- src/joystick/psp/SDL_sysjoystick.c | 2 +- src/joystick/steam/SDL_steamcontroller.h | 2 +- src/joystick/virtual/SDL_virtualjoystick.c | 4 +- src/joystick/virtual/SDL_virtualjoystick_c.h | 2 +- src/joystick/vita/SDL_sysjoystick.c | 2 +- src/joystick/windows/SDL_rawinputjoystick.c | 4 +- .../windows/SDL_windows_gaming_input.c | 6 +- src/joystick/windows/SDL_windowsjoystick.c | 2 +- src/joystick/windows/SDL_windowsjoystick_c.h | 4 +- test/testautomation_guid.c | 32 +------- test/testcontroller.c | 4 +- test/testpen.c | 4 +- 44 files changed, 182 insertions(+), 260 deletions(-) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 08615cbc2da70..af4b1bc947d9c 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -1353,12 +1353,7 @@ typedef SDL_GameControllerButton, SDL_GamepadButton; @@ @@ - SDL_JoystickGetGUIDFromString -+ SDL_GetJoystickGUIDFromString - (...) -@@ -@@ -- SDL_JoystickGetGUIDString -+ SDL_GetJoystickGUIDString ++ SDL_GUIDFromString (...) @@ @@ @@ -3581,3 +3576,8 @@ typedef SDL_Colour, SDL_Color; - SDL_AndroidSendMessage + SDL_SendAndroidMessage (...) +@@ +typedef SDL_JoystickGUID, SDL_GUID; +@@ +- SDL_JoystickGUID ++ SDL_GUID diff --git a/docs/README-migration.md b/docs/README-migration.md index 29c4294678c83..2d6ea08bb3455 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -860,8 +860,7 @@ The following functions have been renamed: * SDL_JoystickGetButton() => SDL_GetJoystickButton() * SDL_JoystickGetFirmwareVersion() => SDL_GetJoystickFirmwareVersion() * SDL_JoystickGetGUID() => SDL_GetJoystickGUID() -* SDL_JoystickGetGUIDFromString() => SDL_GetJoystickGUIDFromString() -* SDL_JoystickGetGUIDString() => SDL_GetJoystickGUIDString() +* SDL_JoystickGetGUIDFromString() => SDL_GUIDFromString() * SDL_JoystickGetHat() => SDL_GetJoystickHat() * SDL_JoystickGetPlayerIndex() => SDL_GetJoystickPlayerIndex() * SDL_JoystickGetProduct() => SDL_GetJoystickProduct() @@ -902,6 +901,7 @@ The following functions have been removed: * SDL_JoystickGetDeviceProductVersion() - replaced with SDL_GetJoystickProductVersionForID() * SDL_JoystickGetDeviceType() - replaced with SDL_GetJoystickTypeForID() * SDL_JoystickGetDeviceVendor() - replaced with SDL_GetJoystickVendorForID() +* SDL_JoystickGetGUIDString() - replaced with SDL_GUIDToString() * SDL_JoystickHasLED() - replaced with SDL_PROP_JOYSTICK_CAP_RGB_LED_BOOLEAN * SDL_JoystickHasRumble() - replaced with SDL_PROP_JOYSTICK_CAP_RUMBLE_BOOLEAN * SDL_JoystickHasRumbleTriggers() - replaced with SDL_PROP_JOYSTICK_CAP_TRIGGER_RUMBLE_BOOLEAN @@ -913,6 +913,9 @@ The following functions have been removed: The following symbols have been removed: * SDL_JOYBALLMOTION +The following structures have been renamed: +* SDL_JoystickGUID => SDL_GUID + ## SDL_keyboard.h Text input is no longer automatically enabled when initializing video, you should call SDL_StartTextInput() when you want to receive text input and call SDL_StopTextInput() when you are done. Starting text input may shown an input method editor (IME) and cause key up/down events to be skipped, so should only be enabled when the application wants text input. diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index f7aa3e8aedb56..06b259465aa41 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -282,7 +282,7 @@ typedef struct SDL_GamepadBinding * existing gamepad. * * The mapping string has the format "GUID,name,mapping", where GUID is the - * string value from SDL_GetJoystickGUIDString(), name is the human readable + * string value from SDL_GUIDToString(), name is the human readable * string for the device and mappings are gamepad mappings to joystick ones. * Under Windows there is a reserved GUID of "xinput" that covers all XInput * devices. The mapping format for joystick is: @@ -414,7 +414,7 @@ extern SDL_DECLSPEC const char * const * SDLCALL SDL_GetGamepadMappings(int *cou * \sa SDL_GetJoystickGUIDForID * \sa SDL_GetJoystickGUID */ -extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid); +extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_GUID guid); /** * Get the current mapping of a gamepad. @@ -561,7 +561,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGamepadPlayerIndexForID(SDL_JoystickID in * \sa SDL_GetGamepadGUIDString * \sa SDL_GetGamepads */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id); /** * Get the USB vendor ID of a gamepad, if available. diff --git a/include/SDL3/SDL_guid.h b/include/SDL3/SDL_guid.h index b7fdab57c3796..3836a020b8bd4 100644 --- a/include/SDL3/SDL_guid.h +++ b/include/SDL3/SDL_guid.h @@ -66,19 +66,17 @@ typedef struct SDL_GUID { /** * Get an ASCII string representation for a given SDL_GUID. * - * You should supply at least 33 bytes for pszGUID. + * The returned string follows the SDL_GetStringRule, and will be automatically freed later. * * \param guid the SDL_GUID you wish to convert to string. - * \param pszGUID buffer in which to write the ASCII string. - * \param cbGUID the size of pszGUID. - * \returns 0 on success or a negative error code on failure; call + * \returns the string representation of the GUID or NULL on failure; call * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * * \sa SDL_GUIDFromString */ -extern SDL_DECLSPEC int SDLCALL SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID); +extern SDL_DECLSPEC const char * SDLCALL SDL_GUIDToString(SDL_GUID guid); /** * Convert a GUID string into a SDL_GUID structure. diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index e68db889132d0..f6f003a080e82 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -37,8 +37,8 @@ * controller. For XInput controllers this returns the XInput user index. Many * joysticks will not be able to supply this information. * - * The term SDL_JoystickGUID is a stable 128-bit identifier for a joystick - * device that does not change over time, it identifies class of the device (a + * SDL_GUID is used as a stable 128-bit identifier for a joystick + * device that does not change over time. It identifies class of the device (a * X360 wired controller for example). This identifier is platform dependent. * * In order to use these functions, SDL_Init() must have been called with the @@ -85,15 +85,6 @@ extern SDL_Mutex *SDL_joystick_lock; */ typedef struct SDL_Joystick SDL_Joystick; -/** - * A structure that encodes the stable unique id for a joystick device. - * - * This is just a standard SDL_GUID by a different name. - * - * \since This datatype is available since SDL 3.0.0. - */ -typedef SDL_GUID SDL_JoystickGUID; - /** * This is a unique ID for a joystick for the time it is connected to the * system, and is never reused for the lifetime of the application. @@ -286,9 +277,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickPlayerIndexForID(SDL_JoystickID i * \since This function is available since SDL 3.0.0. * * \sa SDL_GetJoystickGUID - * \sa SDL_GetJoystickGUIDString + * \sa SDL_GUIDToString */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id); +extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id); /** * Get the USB vendor ID of a joystick, if available. @@ -737,9 +728,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetJoystickPlayerIndex(SDL_Joystick *joystic * \since This function is available since SDL 3.0.0. * * \sa SDL_GetJoystickGUIDForID - * \sa SDL_GetJoystickGUIDString + * \sa SDL_GUIDToString */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick); +extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GetJoystickGUID(SDL_Joystick *joystick); /** * Get the USB vendor ID of an opened joystick, if available. @@ -824,44 +815,25 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joy extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick); /** - * Get an ASCII string representation for a given SDL_JoystickGUID. - * - * You should supply at least 33 bytes for pszGUID. - * - * \param guid the SDL_JoystickGUID you wish to convert to string. - * \param pszGUID buffer in which to write the ASCII string. - * \param cbGUID the size of pszGUID. - * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GetJoystickGUIDForID - * \sa SDL_GetJoystickGUID - * \sa SDL_GetJoystickGUIDFromString - */ -extern SDL_DECLSPEC int SDLCALL SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID); - -/** - * Convert a GUID string into a SDL_JoystickGUID structure. + * Convert a GUID string into a SDL_GUID structure. * * Performs no error checking. If this function is given a string containing * an invalid GUID, the function will silently succeed, but the GUID generated * will not be useful. * * \param pchGUID string containing an ASCII representation of a GUID. - * \returns a SDL_JoystickGUID structure. + * \returns a SDL_GUID structure. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_GetJoystickGUIDString + * \sa SDL_GUIDToString */ -extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const char *pchGUID); +extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID); /** - * Get the device information encoded in a SDL_JoystickGUID structure. + * Get the device information encoded in a SDL_GUID structure. * - * \param guid the SDL_JoystickGUID you wish to get info about. + * \param guid the SDL_GUID you wish to get info about. * \param vendor a pointer filled in with the device VID, or 0 if not * available. * \param product a pointer filled in with the device PID, or 0 if not @@ -875,7 +847,7 @@ extern SDL_DECLSPEC SDL_JoystickGUID SDLCALL SDL_GetJoystickGUIDFromString(const * * \sa SDL_GetJoystickGUIDForID */ -extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); +extern SDL_DECLSPEC void SDLCALL SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16); /** * Get the status of a specified joystick. diff --git a/include/SDL3/SDL_oldnames.h b/include/SDL3/SDL_oldnames.h index 92b7da94cb008..a34080528e701 100644 --- a/include/SDL3/SDL_oldnames.h +++ b/include/SDL3/SDL_oldnames.h @@ -309,6 +309,7 @@ #define SDL_JoystickDetachVirtual SDL_DetachVirtualJoystick #define SDL_JoystickFromInstanceID SDL_GetJoystickFromID #define SDL_JoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex +#define SDL_JoystickGUID SDL_GUID #define SDL_JoystickGetAttached SDL_JoystickConnected #define SDL_JoystickGetAxis SDL_GetJoystickAxis #define SDL_JoystickGetAxisInitialState SDL_GetJoystickAxisInitialState @@ -316,8 +317,7 @@ #define SDL_JoystickGetButton SDL_GetJoystickButton #define SDL_JoystickGetFirmwareVersion SDL_GetJoystickFirmwareVersion #define SDL_JoystickGetGUID SDL_GetJoystickGUID -#define SDL_JoystickGetGUIDFromString SDL_GetJoystickGUIDFromString -#define SDL_JoystickGetGUIDString SDL_GetJoystickGUIDString +#define SDL_JoystickGetGUIDFromString SDL_GUIDFromString #define SDL_JoystickGetHat SDL_GetJoystickHat #define SDL_JoystickGetPlayerIndex SDL_GetJoystickPlayerIndex #define SDL_JoystickGetProduct SDL_GetJoystickProduct @@ -925,6 +925,7 @@ #define SDL_JoystickDetachVirtual SDL_JoystickDetachVirtual_renamed_SDL_DetachVirtualJoystick #define SDL_JoystickFromInstanceID SDL_JoystickFromInstanceID_renamed_SDL_GetJoystickFromID #define SDL_JoystickFromPlayerIndex SDL_JoystickFromPlayerIndex_renamed_SDL_GetJoystickFromPlayerIndex +#define SDL_JoystickGUID SDL_JoystickGUID_renamed_SDL_GUID #define SDL_JoystickGetAttached SDL_JoystickGetAttached_renamed_SDL_JoystickConnected #define SDL_JoystickGetAxis SDL_JoystickGetAxis_renamed_SDL_GetJoystickAxis #define SDL_JoystickGetAxisInitialState SDL_JoystickGetAxisInitialState_renamed_SDL_GetJoystickAxisInitialState @@ -932,8 +933,7 @@ #define SDL_JoystickGetButton SDL_JoystickGetButton_renamed_SDL_GetJoystickButton #define SDL_JoystickGetFirmwareVersion SDL_JoystickGetFirmwareVersion_renamed_SDL_GetJoystickFirmwareVersion #define SDL_JoystickGetGUID SDL_JoystickGetGUID_renamed_SDL_GetJoystickGUID -#define SDL_JoystickGetGUIDFromString SDL_JoystickGetGUIDFromString_renamed_SDL_GetJoystickGUIDFromString -#define SDL_JoystickGetGUIDString SDL_JoystickGetGUIDString_renamed_SDL_GetJoystickGUIDString +#define SDL_JoystickGetGUIDFromString SDL_JoystickGetGUIDFromString_renamed_SDL_GUIDFromString #define SDL_JoystickGetHat SDL_JoystickGetHat_renamed_SDL_GetJoystickHat #define SDL_JoystickGetPlayerIndex SDL_JoystickGetPlayerIndex_renamed_SDL_GetJoystickPlayerIndex #define SDL_JoystickGetProduct SDL_JoystickGetProduct_renamed_SDL_GetJoystickProduct diff --git a/src/SDL_guid.c b/src/SDL_guid.c index a73852ddcdc9f..3e68961eab785 100644 --- a/src/SDL_guid.c +++ b/src/SDL_guid.c @@ -21,28 +21,21 @@ #include "SDL_internal.h" /* convert the guid to a printable string */ -int SDL_GUIDToString(SDL_GUID guid, char *pszGUID, int cbGUID) +const char *SDL_GUIDToString(SDL_GUID guid) { static const char k_rgchHexToASCII[] = "0123456789abcdef"; int i; + char string[sizeof(guid) * 2 + 1]; - if (!pszGUID) { - return SDL_InvalidParamError("pszGUID"); - } - if (cbGUID <= 0) { - return SDL_InvalidParamError("cbGUID"); - } - - for (i = 0; i < sizeof(guid.data) && i < (cbGUID - 1) / 2; i++) { - /* each input byte writes 2 ascii chars, and might write a null byte. */ - /* If we don't have room for next input byte, stop */ + for (i = 0; i < sizeof(guid.data); ++i) { unsigned char c = guid.data[i]; - *pszGUID++ = k_rgchHexToASCII[c >> 4]; - *pszGUID++ = k_rgchHexToASCII[c & 0x0F]; + string[i * 2 + 0] = k_rgchHexToASCII[c >> 4]; + string[i * 2 + 1] = k_rgchHexToASCII[c & 0x0F]; } - *pszGUID = '\0'; - return 0; + string[sizeof(string) -1] = '\0'; + + return SDL_CreateTemporaryString(string); } /*----------------------------------------------------------------------------- diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 5c61c2fe86c67..1a8ccd51983c3 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -298,9 +298,7 @@ SDL3_0.0.0 { SDL_GetJoystickFromPlayerIndex; SDL_GetJoystickGUID; SDL_GetJoystickGUIDForID; - SDL_GetJoystickGUIDFromString; SDL_GetJoystickGUIDInfo; - SDL_GetJoystickGUIDString; SDL_GetJoystickHat; SDL_GetJoystickID; SDL_GetJoystickName; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index bb2669f022dac..4383671940e30 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -323,9 +323,7 @@ #define SDL_GetJoystickFromPlayerIndex SDL_GetJoystickFromPlayerIndex_REAL #define SDL_GetJoystickGUID SDL_GetJoystickGUID_REAL #define SDL_GetJoystickGUIDForID SDL_GetJoystickGUIDForID_REAL -#define SDL_GetJoystickGUIDFromString SDL_GetJoystickGUIDFromString_REAL #define SDL_GetJoystickGUIDInfo SDL_GetJoystickGUIDInfo_REAL -#define SDL_GetJoystickGUIDString SDL_GetJoystickGUIDString_REAL #define SDL_GetJoystickHat SDL_GetJoystickHat_REAL #define SDL_GetJoystickID SDL_GetJoystickID_REAL #define SDL_GetJoystickName SDL_GetJoystickName_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 3dec54f509149..db6e677a39bcb 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -188,7 +188,7 @@ SDL_DYNAPI_PROC(int,SDL_GL_SetSwapInterval,(int a),(a),return) SDL_DYNAPI_PROC(int,SDL_GL_SwapWindow,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(void,SDL_GL_UnloadLibrary,(void),(),) SDL_DYNAPI_PROC(SDL_GUID,SDL_GUIDFromString,(const char *a),(a),return) -SDL_DYNAPI_PROC(int,SDL_GUIDToString,(SDL_GUID a, char *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(const char *,SDL_GUIDToString,(SDL_GUID a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadConnected,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadEventsEnabled,(void),(),return) SDL_DYNAPI_PROC(SDL_bool,SDL_GamepadHasAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) @@ -285,11 +285,11 @@ SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetGamepadConnectionState,(SDL_G SDL_DYNAPI_PROC(Uint16,SDL_GetGamepadFirmwareVersion,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Gamepad*,SDL_GetGamepadFromPlayerIndex,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetGamepadGUIDForID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(SDL_GUID,SDL_GetGamepadGUIDForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetGamepadID,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetGamepadJoystick,(SDL_Gamepad *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMapping,(SDL_Gamepad *a),(a),return) -SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMappingForGUID,(SDL_JoystickGUID a),(a),return) +SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMappingForGUID,(SDL_GUID a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadMappingForID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(const char * const *,SDL_GetGamepadMappings,(int *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetGamepadName,(SDL_Gamepad *a),(a),return) @@ -341,11 +341,9 @@ SDL_DYNAPI_PROC(SDL_JoystickConnectionState,SDL_GetJoystickConnectionState,(SDL_ SDL_DYNAPI_PROC(Uint16,SDL_GetJoystickFirmwareVersion,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromID,(SDL_JoystickID a),(a),return) SDL_DYNAPI_PROC(SDL_Joystick*,SDL_GetJoystickFromPlayerIndex,(int a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDForID,(SDL_JoystickID a),(a),return) -SDL_DYNAPI_PROC(SDL_JoystickGUID,SDL_GetJoystickGUIDFromString,(const char *a),(a),return) -SDL_DYNAPI_PROC(void,SDL_GetJoystickGUIDInfo,(SDL_JoystickGUID a, Uint16 *b, Uint16 *c, Uint16 *d, Uint16 *e),(a,b,c,d,e),) -SDL_DYNAPI_PROC(int,SDL_GetJoystickGUIDString,(SDL_JoystickGUID a, char *b, int c),(a,b,c),return) +SDL_DYNAPI_PROC(SDL_GUID,SDL_GetJoystickGUID,(SDL_Joystick *a),(a),return) +SDL_DYNAPI_PROC(SDL_GUID,SDL_GetJoystickGUIDForID,(SDL_JoystickID a),(a),return) +SDL_DYNAPI_PROC(void,SDL_GetJoystickGUIDInfo,(SDL_GUID a, Uint16 *b, Uint16 *c, Uint16 *d, Uint16 *e),(a,b,c,d,e),) SDL_DYNAPI_PROC(Uint8,SDL_GetJoystickHat,(SDL_Joystick *a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_JoystickID,SDL_GetJoystickID,(SDL_Joystick *a),(a),return) SDL_DYNAPI_PROC(const char*,SDL_GetJoystickName,(SDL_Joystick *a),(a),return) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index eadc1404c3bac..0e4c42b081e4b 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -79,7 +79,7 @@ typedef enum typedef struct GamepadMapping_t { - SDL_JoystickGUID guid _guarded; + SDL_GUID guid _guarded; char *name _guarded; char *mapping _guarded; SDL_GamepadMappingPriority priority _guarded; @@ -99,7 +99,7 @@ typedef struct #undef _guarded -static SDL_JoystickGUID s_zeroGUID; +static SDL_GUID s_zeroGUID; static GamepadMapping_t *s_pSupportedGamepads SDL_GUARDED_BY(SDL_joystick_lock) = NULL; static GamepadMapping_t *s_pDefaultMapping SDL_GUARDED_BY(SDL_joystick_lock) = NULL; static GamepadMapping_t *s_pXInputMapping SDL_GUARDED_BY(SDL_joystick_lock) = NULL; @@ -150,7 +150,7 @@ static SDL_vidpid_list SDL_ignored_gamepads = { SDL_FALSE }; -static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing, SDL_GamepadMappingPriority priority); +static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_GUID jGUID, const char *mappingString, SDL_bool *existing, SDL_GamepadMappingPriority priority); static void SDL_PrivateLoadButtonMapping(SDL_Gamepad *gamepad, GamepadMapping_t *pGamepadMapping); static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id, SDL_bool create_mapping); static int SDL_SendGamepadAxis(Uint64 timestamp, SDL_Gamepad *gamepad, SDL_GamepadAxis axis, Sint16 value); @@ -588,7 +588,7 @@ static void PopMappingChangeTracking(void) /* * Helper function to guess at a mapping based on the elements reported for this gamepad */ -static GamepadMapping_t *SDL_CreateMappingForAndroidGamepad(SDL_JoystickGUID guid) +static GamepadMapping_t *SDL_CreateMappingForAndroidGamepad(SDL_GUID guid) { const int face_button_mask = ((1 << SDL_GAMEPAD_BUTTON_SOUTH) | (1 << SDL_GAMEPAD_BUTTON_EAST) | @@ -690,7 +690,7 @@ static GamepadMapping_t *SDL_CreateMappingForAndroidGamepad(SDL_JoystickGUID gui /* * Helper function to guess at a mapping for HIDAPI gamepads */ -static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_JoystickGUID guid) +static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_GUID guid) { SDL_bool existing; char mapping_string[1024]; @@ -835,7 +835,7 @@ static GamepadMapping_t *SDL_CreateMappingForHIDAPIGamepad(SDL_JoystickGUID guid /* * Helper function to guess at a mapping for RAWINPUT gamepads */ -static GamepadMapping_t *SDL_CreateMappingForRAWINPUTGamepad(SDL_JoystickGUID guid) +static GamepadMapping_t *SDL_CreateMappingForRAWINPUTGamepad(SDL_GUID guid) { SDL_bool existing; char mapping_string[1024]; @@ -849,7 +849,7 @@ static GamepadMapping_t *SDL_CreateMappingForRAWINPUTGamepad(SDL_JoystickGUID gu /* * Helper function to guess at a mapping for WGI gamepads */ -static GamepadMapping_t *SDL_CreateMappingForWGIGamepad(SDL_JoystickGUID guid) +static GamepadMapping_t *SDL_CreateMappingForWGIGamepad(SDL_GUID guid) { SDL_bool existing; char mapping_string[1024]; @@ -867,7 +867,7 @@ static GamepadMapping_t *SDL_CreateMappingForWGIGamepad(SDL_JoystickGUID guid) /* * Helper function to scan the mappings database for a gamepad with the specified GUID */ -static GamepadMapping_t *SDL_PrivateMatchGamepadMappingForGUID(SDL_JoystickGUID guid, SDL_bool match_version) +static GamepadMapping_t *SDL_PrivateMatchGamepadMappingForGUID(SDL_GUID guid, SDL_bool match_version) { GamepadMapping_t *mapping, *best_match = NULL; Uint16 crc = 0; @@ -884,7 +884,7 @@ static GamepadMapping_t *SDL_PrivateMatchGamepadMappingForGUID(SDL_JoystickGUID } for (mapping = s_pSupportedGamepads; mapping; mapping = mapping->next) { - SDL_JoystickGUID mapping_guid; + SDL_GUID mapping_guid; if (SDL_memcmp(&mapping->guid, &s_zeroGUID, sizeof(mapping->guid)) == 0) { continue; @@ -919,7 +919,7 @@ static GamepadMapping_t *SDL_PrivateMatchGamepadMappingForGUID(SDL_JoystickGUID /* * Helper function to scan the mappings database for a gamepad with the specified GUID */ -static GamepadMapping_t *SDL_PrivateGetGamepadMappingForGUID(SDL_JoystickGUID guid, SDL_bool adding_mapping) +static GamepadMapping_t *SDL_PrivateGetGamepadMappingForGUID(SDL_GUID guid, SDL_bool adding_mapping) { GamepadMapping_t *mapping; @@ -1528,7 +1528,7 @@ static char *SDL_PrivateGetGamepadMappingFromMappingString(const char *pMapping) /* * Helper function to add a mapping for a guid */ -static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, const char *mappingString, SDL_bool *existing, SDL_GamepadMappingPriority priority) +static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_GUID jGUID, const char *mappingString, SDL_bool *existing, SDL_GamepadMappingPriority priority) { char *pchName; char *pchMapping; @@ -1656,7 +1656,7 @@ static GamepadMapping_t *SDL_PrivateAddMappingForGUID(SDL_JoystickGUID jGUID, co /* * Helper function to determine pre-calculated offset to certain joystick mappings */ -static GamepadMapping_t *SDL_PrivateGetGamepadMappingForNameAndGUID(const char *name, SDL_JoystickGUID guid) +static GamepadMapping_t *SDL_PrivateGetGamepadMappingForNameAndGUID(const char *name, SDL_GUID guid) { GamepadMapping_t *mapping; @@ -1713,7 +1713,7 @@ static void SDL_PrivateAppendToMappingString(char *mapping_string, } static GamepadMapping_t *SDL_PrivateGenerateAutomaticGamepadMapping(const char *name, - SDL_JoystickGUID guid, + SDL_GUID guid, SDL_GamepadMapping *raw_map) { SDL_bool existing; @@ -1772,7 +1772,7 @@ static GamepadMapping_t *SDL_PrivateGenerateAutomaticGamepadMapping(const char * static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id, SDL_bool create_mapping) { const char *name; - SDL_JoystickGUID guid; + SDL_GUID guid; GamepadMapping_t *mapping; SDL_AssertJoysticksLocked(); @@ -1926,7 +1926,7 @@ static int SDL_PrivateAddGamepadMapping(const char *mappingString, SDL_GamepadMa { char *remapped = NULL; char *pchGUID; - SDL_JoystickGUID jGUID; + SDL_GUID jGUID; SDL_bool is_default_mapping = SDL_FALSE; SDL_bool is_xinput_mapping = SDL_FALSE; SDL_bool existing = SDL_FALSE; @@ -2028,7 +2028,7 @@ static int SDL_PrivateAddGamepadMapping(const char *mappingString, SDL_GamepadMa } else if (!SDL_strcasecmp(pchGUID, "xinput")) { is_xinput_mapping = SDL_TRUE; } - jGUID = SDL_GetJoystickGUIDFromString(pchGUID); + jGUID = SDL_GUIDFromString(pchGUID); SDL_free(pchGUID); pGamepadMapping = SDL_PrivateAddMappingForGUID(jGUID, mappingString, &existing, priority); @@ -2072,17 +2072,17 @@ int SDL_AddGamepadMapping(const char *mapping) /* * Create a mapping string for a mapping */ -static char *CreateMappingString(GamepadMapping_t *mapping, SDL_JoystickGUID guid) +static char *CreateMappingString(GamepadMapping_t *mapping, SDL_GUID guid) { char *pMappingString, *pPlatformString; - char pchGUID[33]; + const char *pchGUID; size_t needed; SDL_bool need_platform = SDL_FALSE; const char *platform = NULL; SDL_AssertJoysticksLocked(); - SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID)); + pchGUID = SDL_GUIDToString(guid); /* allocate enough memory for GUID + ',' + name + ',' + mapping + \0 */ needed = SDL_strlen(pchGUID) + 1 + SDL_strlen(mapping->name) + 1 + SDL_strlen(mapping->mapping) + 1; @@ -2203,7 +2203,7 @@ const char * const *SDL_GetGamepadMappings(int *count) /* * Get the mapping string for this GUID */ -const char *SDL_GetGamepadMappingForGUID(SDL_JoystickGUID guid) +const char *SDL_GetGamepadMappingForGUID(SDL_GUID guid) { char *retval; @@ -2245,7 +2245,7 @@ const char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad) */ int SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping) { - SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); + SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); int retval = -1; if (SDL_memcmp(&guid, &s_zeroGUID, sizeof(guid)) == 0) { @@ -2447,7 +2447,7 @@ int SDL_GetGamepadPlayerIndexForID(SDL_JoystickID instance_id) return SDL_GetJoystickPlayerIndexForID(instance_id); } -SDL_JoystickGUID SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id) +SDL_GUID SDL_GetGamepadGUIDForID(SDL_JoystickID instance_id) { return SDL_GetJoystickGUIDForID(instance_id); } @@ -2524,9 +2524,9 @@ const char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) { GamepadMapping_t *mapping = SDL_PrivateGetGamepadMapping(instance_id, SDL_TRUE); if (mapping) { - char pchGUID[33]; - const SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); - SDL_GetJoystickGUIDString(guid, pchGUID, sizeof(pchGUID)); + const char *pchGUID; + const SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); + pchGUID = SDL_GUIDToString(guid); SDL_asprintf(&retval, "%s,%s,%s", pchGUID, mapping->name, mapping->mapping); } } @@ -2538,7 +2538,7 @@ const char *SDL_GetGamepadMappingForID(SDL_JoystickID instance_id) /* * Return 1 if the joystick with this name and GUID is a supported gamepad */ -SDL_bool SDL_IsGamepadNameAndGUID(const char *name, SDL_JoystickGUID guid) +SDL_bool SDL_IsGamepadNameAndGUID(const char *name, SDL_GUID guid) { SDL_bool retval; @@ -2588,7 +2588,7 @@ SDL_bool SDL_IsGamepad(SDL_JoystickID instance_id) /* * Return 1 if the gamepad should be ignored by SDL */ -SDL_bool SDL_ShouldIgnoreGamepad(const char *name, SDL_JoystickGUID guid) +SDL_bool SDL_ShouldIgnoreGamepad(const char *name, SDL_GUID guid) { Uint16 vendor; Uint16 product; diff --git a/src/joystick/SDL_gamepad_c.h b/src/joystick/SDL_gamepad_c.h index 0c0614098fe24..d67c611914c4e 100644 --- a/src/joystick/SDL_gamepad_c.h +++ b/src/joystick/SDL_gamepad_c.h @@ -36,10 +36,10 @@ extern void SDL_PrivateGamepadAdded(SDL_JoystickID instance_id); extern void SDL_PrivateGamepadRemoved(SDL_JoystickID instance_id); /* Function to return whether a joystick name and GUID is a gamepad */ -extern SDL_bool SDL_IsGamepadNameAndGUID(const char *name, SDL_JoystickGUID guid); +extern SDL_bool SDL_IsGamepadNameAndGUID(const char *name, SDL_GUID guid); /* Function to return whether a gamepad should be ignored */ -extern SDL_bool SDL_ShouldIgnoreGamepad(const char *name, SDL_JoystickGUID guid); +extern SDL_bool SDL_ShouldIgnoreGamepad(const char *name, SDL_GUID guid); /* Handle delayed guide button on a gamepad */ extern void SDL_GamepadHandleDelayedGuideButton(SDL_Joystick *joystick); diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c index 239fb02ca0547..4a2760a852eb1 100644 --- a/src/joystick/SDL_joystick.c +++ b/src/joystick/SDL_joystick.c @@ -848,7 +848,7 @@ static SDL_bool SDL_JoystickAxesCenteredAtZero(SDL_Joystick *joystick) static SDL_bool IsROGAlly(SDL_Joystick *joystick) { Uint16 vendor, product; - SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick); + SDL_GUID guid = SDL_GetJoystickGUID(joystick); /* The ROG Ally controller spoofs an Xbox 360 controller */ SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL); @@ -917,7 +917,7 @@ static SDL_bool ShouldAttemptSensorFusion(SDL_Joystick *joystick, SDL_bool *inve if (hint) { SDL_vidpid_list gamepads; - SDL_JoystickGUID guid; + SDL_GUID guid; Uint16 vendor, product; SDL_bool enabled; SDL_zero(gamepads); @@ -2491,7 +2491,7 @@ SDL_bool SDL_JoystickEventsEnabled(void) return enabled; } -void SDL_GetJoystickGUIDInfo(SDL_JoystickGUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16) +void SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16) { Uint16 *guid16 = (Uint16 *)guid.data; Uint16 bus = SDL_Swap16LE(guid16[0]); @@ -2708,9 +2708,9 @@ char *SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_n return name; } -SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *vendor_name, const char *product_name, Uint8 driver_signature, Uint8 driver_data) +SDL_GUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *vendor_name, const char *product_name, Uint8 driver_signature, Uint8 driver_data) { - SDL_JoystickGUID guid; + SDL_GUID guid; Uint16 *guid16 = (Uint16 *)guid.data; Uint16 crc = 0; @@ -2752,33 +2752,33 @@ SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 produc return guid; } -SDL_JoystickGUID SDL_CreateJoystickGUIDForName(const char *name) +SDL_GUID SDL_CreateJoystickGUIDForName(const char *name) { return SDL_CreateJoystickGUID(SDL_HARDWARE_BUS_UNKNOWN, 0, 0, 0, NULL, name, 0, 0); } -void SDL_SetJoystickGUIDVendor(SDL_JoystickGUID *guid, Uint16 vendor) +void SDL_SetJoystickGUIDVendor(SDL_GUID *guid, Uint16 vendor) { Uint16 *guid16 = (Uint16 *)guid->data; guid16[2] = SDL_Swap16LE(vendor); } -void SDL_SetJoystickGUIDProduct(SDL_JoystickGUID *guid, Uint16 product) +void SDL_SetJoystickGUIDProduct(SDL_GUID *guid, Uint16 product) { Uint16 *guid16 = (Uint16 *)guid->data; guid16[4] = SDL_Swap16LE(product); } -void SDL_SetJoystickGUIDVersion(SDL_JoystickGUID *guid, Uint16 version) +void SDL_SetJoystickGUIDVersion(SDL_GUID *guid, Uint16 version) { Uint16 *guid16 = (Uint16 *)guid->data; guid16[6] = SDL_Swap16LE(version); } -void SDL_SetJoystickGUIDCRC(SDL_JoystickGUID *guid, Uint16 crc) +void SDL_SetJoystickGUIDCRC(SDL_GUID *guid, Uint16 crc) { Uint16 *guid16 = (Uint16 *)guid->data; @@ -2869,7 +2869,7 @@ SDL_GamepadType SDL_GetGamepadTypeFromVIDPID(Uint16 vendor, Uint16 product, cons return type; } -SDL_GamepadType SDL_GetGamepadTypeFromGUID(SDL_JoystickGUID guid, const char *name) +SDL_GamepadType SDL_GetGamepadTypeFromGUID(SDL_GUID guid, const char *name) { SDL_GamepadType type; Uint16 vendor, product; @@ -2890,7 +2890,7 @@ SDL_GamepadType SDL_GetGamepadTypeFromGUID(SDL_JoystickGUID guid, const char *na return type; } -SDL_bool SDL_JoystickGUIDUsesVersion(SDL_JoystickGUID guid) +SDL_bool SDL_JoystickGUIDUsesVersion(SDL_GUID guid) { Uint16 vendor, product; @@ -3110,32 +3110,32 @@ SDL_bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id) return eType == k_eControllerType_SteamControllerNeptune; } -SDL_bool SDL_IsJoystickXInput(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickXInput(SDL_GUID guid) { return (guid.data[14] == 'x') ? SDL_TRUE : SDL_FALSE; } -SDL_bool SDL_IsJoystickWGI(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickWGI(SDL_GUID guid) { return (guid.data[14] == 'w') ? SDL_TRUE : SDL_FALSE; } -SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickHIDAPI(SDL_GUID guid) { return (guid.data[14] == 'h') ? SDL_TRUE : SDL_FALSE; } -SDL_bool SDL_IsJoystickMFI(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickMFI(SDL_GUID guid) { return (guid.data[14] == 'm') ? SDL_TRUE : SDL_FALSE; } -SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickRAWINPUT(SDL_GUID guid) { return (guid.data[14] == 'r') ? SDL_TRUE : SDL_FALSE; } -SDL_bool SDL_IsJoystickVIRTUAL(SDL_JoystickGUID guid) +SDL_bool SDL_IsJoystickVIRTUAL(SDL_GUID guid) { return (guid.data[14] == 'v') ? SDL_TRUE : SDL_FALSE; } @@ -3160,7 +3160,7 @@ static SDL_bool SDL_IsJoystickThrottle(Uint16 vendor_id, Uint16 product_id) return SDL_VIDPIDInList(vendor_id, product_id, &throttle_devices); } -static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid) +static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid) { Uint16 vendor; Uint16 product; @@ -3230,7 +3230,7 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_JoystickGUID guid) return SDL_JOYSTICK_TYPE_UNKNOWN; } -SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) +SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_GUID guid) { Uint16 vendor; Uint16 product; @@ -3255,11 +3255,11 @@ SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid) } /* return the guid for this index */ -SDL_JoystickGUID SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id) +SDL_GUID SDL_GetJoystickGUIDForID(SDL_JoystickID instance_id) { SDL_JoystickDriver *driver; int device_index; - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_LockJoysticks(); if (SDL_GetDriverAndJoystickIndex(instance_id, &driver, &device_index)) { @@ -3282,7 +3282,7 @@ Uint16 SDL_GetJoystickVendorForID(SDL_JoystickID instance_id) if (info) { vendor = info->vendor_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); + SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); } @@ -3301,7 +3301,7 @@ Uint16 SDL_GetJoystickProductForID(SDL_JoystickID instance_id) if (info) { product = info->product_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); + SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); } @@ -3313,7 +3313,7 @@ Uint16 SDL_GetJoystickProductForID(SDL_JoystickID instance_id) Uint16 SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id) { Uint16 version; - SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); + SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL); return version; @@ -3322,7 +3322,7 @@ Uint16 SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id) SDL_JoystickType SDL_GetJoystickTypeForID(SDL_JoystickID instance_id) { SDL_JoystickType type; - SDL_JoystickGUID guid = SDL_GetJoystickGUIDForID(instance_id); + SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id); type = SDL_GetJoystickGUIDType(guid); if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { @@ -3333,13 +3333,13 @@ SDL_JoystickType SDL_GetJoystickTypeForID(SDL_JoystickID instance_id) return type; } -SDL_JoystickGUID SDL_GetJoystickGUID(SDL_Joystick *joystick) +SDL_GUID SDL_GetJoystickGUID(SDL_Joystick *joystick) { - SDL_JoystickGUID retval; + SDL_GUID retval; SDL_LockJoysticks(); { - static SDL_JoystickGUID emptyGUID; + static SDL_GUID emptyGUID; CHECK_JOYSTICK_MAGIC(joystick, emptyGUID); @@ -3363,7 +3363,7 @@ Uint16 SDL_GetJoystickVendor(SDL_Joystick *joystick) if (info) { vendor = info->vendor_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick); + SDL_GUID guid = SDL_GetJoystickGUID(joystick); SDL_GetJoystickGUIDInfo(guid, &vendor, NULL, NULL, NULL); } @@ -3386,7 +3386,7 @@ Uint16 SDL_GetJoystickProduct(SDL_Joystick *joystick) if (info) { product = info->product_id; } else { - SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick); + SDL_GUID guid = SDL_GetJoystickGUID(joystick); SDL_GetJoystickGUIDInfo(guid, NULL, &product, NULL, NULL); } @@ -3399,7 +3399,7 @@ Uint16 SDL_GetJoystickProduct(SDL_Joystick *joystick) Uint16 SDL_GetJoystickProductVersion(SDL_Joystick *joystick) { Uint16 version; - SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick); + SDL_GUID guid = SDL_GetJoystickGUID(joystick); SDL_GetJoystickGUIDInfo(guid, NULL, NULL, &version, NULL); return version; @@ -3438,7 +3438,7 @@ const char *SDL_GetJoystickSerial(SDL_Joystick *joystick) SDL_JoystickType SDL_GetJoystickType(SDL_Joystick *joystick) { SDL_JoystickType type; - SDL_JoystickGUID guid = SDL_GetJoystickGUID(joystick); + SDL_GUID guid = SDL_GetJoystickGUID(joystick); type = SDL_GetJoystickGUIDType(guid); if (type == SDL_JOYSTICK_TYPE_UNKNOWN) { @@ -3455,18 +3455,6 @@ SDL_JoystickType SDL_GetJoystickType(SDL_Joystick *joystick) return type; } -/* convert the guid to a printable string */ -int SDL_GetJoystickGUIDString(SDL_JoystickGUID guid, char *pszGUID, int cbGUID) -{ - return SDL_GUIDToString(guid, pszGUID, cbGUID); -} - -/* convert the string version of a joystick guid to the struct */ -SDL_JoystickGUID SDL_GetJoystickGUIDFromString(const char *pchGUID) -{ - return SDL_GUIDFromString(pchGUID); -} - void SDL_SendJoystickPowerInfo(SDL_Joystick *joystick, SDL_PowerState state, int percent) { SDL_AssertJoysticksLocked(); diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h index c8ac9a3591f70..3675089989293 100644 --- a/src/joystick/SDL_joystick_c.h +++ b/src/joystick/SDL_joystick_c.h @@ -62,29 +62,29 @@ extern SDL_bool SDL_JoystickHandledByAnotherDriver(struct SDL_JoystickDriver *dr extern char *SDL_CreateJoystickName(Uint16 vendor, Uint16 product, const char *vendor_name, const char *product_name); /* Function to create a GUID for a joystick based on the VID/PID and name */ -extern SDL_JoystickGUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *vendor_name, const char *product_name, Uint8 driver_signature, Uint8 driver_data); +extern SDL_GUID SDL_CreateJoystickGUID(Uint16 bus, Uint16 vendor, Uint16 product, Uint16 version, const char *vendor_name, const char *product_name, Uint8 driver_signature, Uint8 driver_data); /* Function to create a GUID for a joystick based on the name, with no VID/PID information */ -extern SDL_JoystickGUID SDL_CreateJoystickGUIDForName(const char *name); +extern SDL_GUID SDL_CreateJoystickGUIDForName(const char *name); /* Function to set the vendor field of a joystick GUID */ -extern void SDL_SetJoystickGUIDVendor(SDL_JoystickGUID *guid, Uint16 vendor); +extern void SDL_SetJoystickGUIDVendor(SDL_GUID *guid, Uint16 vendor); /* Function to set the product field of a joystick GUID */ -extern void SDL_SetJoystickGUIDProduct(SDL_JoystickGUID *guid, Uint16 product); +extern void SDL_SetJoystickGUIDProduct(SDL_GUID *guid, Uint16 product); /* Function to set the version field of a joystick GUID */ -extern void SDL_SetJoystickGUIDVersion(SDL_JoystickGUID *guid, Uint16 version); +extern void SDL_SetJoystickGUIDVersion(SDL_GUID *guid, Uint16 version); /* Function to set the CRC field of a joystick GUID */ -extern void SDL_SetJoystickGUIDCRC(SDL_JoystickGUID *guid, Uint16 crc); +extern void SDL_SetJoystickGUIDCRC(SDL_GUID *guid, Uint16 crc); /* Function to return the type of a controller */ extern SDL_GamepadType SDL_GetGamepadTypeFromVIDPID(Uint16 vendor, Uint16 product, const char *name, SDL_bool forUI); -extern SDL_GamepadType SDL_GetGamepadTypeFromGUID(SDL_JoystickGUID guid, const char *name); +extern SDL_GamepadType SDL_GetGamepadTypeFromGUID(SDL_GUID guid, const char *name); /* Function to return whether a joystick GUID uses the version field */ -extern SDL_bool SDL_JoystickGUIDUsesVersion(SDL_JoystickGUID guid); +extern SDL_bool SDL_JoystickGUIDUsesVersion(SDL_GUID guid); /* Function to return whether a joystick is an Xbox One controller */ extern SDL_bool SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id); @@ -133,25 +133,25 @@ extern SDL_bool SDL_IsJoystickSteamController(Uint16 vendor_id, Uint16 product_i extern SDL_bool SDL_IsJoystickSteamDeck(Uint16 vendor_id, Uint16 product_id); /* Function to return whether a joystick guid comes from the XInput driver */ -extern SDL_bool SDL_IsJoystickXInput(SDL_JoystickGUID guid); +extern SDL_bool SDL_IsJoystickXInput(SDL_GUID guid); /* Function to return whether a joystick guid comes from the WGI driver */ -extern SDL_bool SDL_IsJoystickWGI(SDL_JoystickGUID guid); +extern SDL_bool SDL_IsJoystickWGI(SDL_GUID guid); /* Function to return whether a joystick guid comes from the HIDAPI driver */ -extern SDL_bool SDL_IsJoystickHIDAPI(SDL_JoystickGUID guid); +extern SDL_bool SDL_IsJoystickHIDAPI(SDL_GUID guid); /* Function to return whether a joystick guid comes from the MFI driver */ -extern SDL_bool SDL_IsJoystickMFI(SDL_JoystickGUID guid); +extern SDL_bool SDL_IsJoystickMFI(SDL_GUID guid); /* Function to return whether a joystick guid comes from the RAWINPUT driver */ -extern SDL_bool SDL_IsJoystickRAWINPUT(SDL_JoystickGUID guid); +extern SDL_bool SDL_IsJoystickRAWINPUT(SDL_GUID guid); /* Function to return whether a joystick guid comes from the Virtual driver */ -extern SDL_bool SDL_IsJoystickVIRTUAL(SDL_JoystickGUID guid); +extern SDL_bool SDL_IsJoystickVIRTUAL(SDL_GUID guid); /* Function to return whether a joystick should be ignored */ -extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_JoystickGUID guid); +extern SDL_bool SDL_ShouldIgnoreJoystick(const char *name, SDL_GUID guid); /* Internal event queueing functions */ extern void SDL_PrivateJoystickAddTouchpad(SDL_Joystick *joystick, int nfingers); diff --git a/src/joystick/SDL_sysjoystick.h b/src/joystick/SDL_sysjoystick.h index e006681f8c6a0..7871412ee1ac5 100644 --- a/src/joystick/SDL_sysjoystick.h +++ b/src/joystick/SDL_sysjoystick.h @@ -80,7 +80,7 @@ struct SDL_Joystick char *name _guarded; /* Joystick name - system dependent */ char *path _guarded; /* Joystick path - system dependent */ char *serial _guarded; /* Joystick serial */ - SDL_JoystickGUID guid _guarded; /* Joystick guid */ + SDL_GUID guid _guarded; /* Joystick guid */ Uint16 firmware_version _guarded; /* Firmware version, if available */ Uint64 steam_handle _guarded; /* Steam controller API handle */ @@ -187,7 +187,7 @@ typedef struct SDL_JoystickDriver void (*SetDevicePlayerIndex)(int device_index, int player_index); /* Function to return the stable GUID for a plugged in device */ - SDL_JoystickGUID (*GetDeviceGUID)(int device_index); + SDL_GUID (*GetDeviceGUID)(int device_index); /* Function to get the current instance id of the joystick located at device_index */ SDL_JoystickID (*GetDeviceInstanceID)(int device_index); diff --git a/src/joystick/android/SDL_sysjoystick.c b/src/joystick/android/SDL_sysjoystick.c index d2c063deeb70f..60e6be04ca7d8 100644 --- a/src/joystick/android/SDL_sysjoystick.c +++ b/src/joystick/android/SDL_sysjoystick.c @@ -304,7 +304,7 @@ int Android_OnHat(int device_id, int hat_id, int x, int y) int Android_AddJoystick(int device_id, const char *name, const char *desc, int vendor_id, int product_id, int button_mask, int naxes, int axis_mask, int nhats, SDL_bool can_rumble) { SDL_joylist_item *item; - SDL_JoystickGUID guid; + SDL_GUID guid; int i; int result = -1; @@ -551,7 +551,7 @@ static void ANDROID_JoystickSetDevicePlayerIndex(int device_index, int player_in { } -static SDL_JoystickGUID ANDROID_JoystickGetDeviceGUID(int device_index) +static SDL_GUID ANDROID_JoystickGetDeviceGUID(int device_index) { return GetJoystickByDevIndex(device_index)->guid; } diff --git a/src/joystick/android/SDL_sysjoystick_c.h b/src/joystick/android/SDL_sysjoystick_c.h index 3639911999115..96a90f5210a37 100644 --- a/src/joystick/android/SDL_sysjoystick_c.h +++ b/src/joystick/android/SDL_sysjoystick_c.h @@ -41,7 +41,7 @@ typedef struct SDL_joylist_item int device_instance; int device_id; /* Android's device id */ char *name; /* "SideWinder 3D Pro" or whatever */ - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_Joystick *joystick; int nbuttons, naxes, nhats; int dpad_state; diff --git a/src/joystick/apple/SDL_mfijoystick.m b/src/joystick/apple/SDL_mfijoystick.m index 7ff49d45035b0..b106225dca4a2 100644 --- a/src/joystick/apple/SDL_mfijoystick.m +++ b/src/joystick/apple/SDL_mfijoystick.m @@ -922,10 +922,10 @@ static void IOS_JoystickSetDevicePlayerIndex(int device_index, int player_index) #endif } -static SDL_JoystickGUID IOS_JoystickGetDeviceGUID(int device_index) +static SDL_GUID IOS_JoystickGetDeviceGUID(int device_index) { SDL_JoystickDeviceItem *device = GetDeviceForIndex(device_index); - SDL_JoystickGUID guid; + SDL_GUID guid; if (device) { guid = device->guid; } else { diff --git a/src/joystick/apple/SDL_mfijoystick_c.h b/src/joystick/apple/SDL_mfijoystick_c.h index 4a974913480b8..72d36a1915416 100644 --- a/src/joystick/apple/SDL_mfijoystick_c.h +++ b/src/joystick/apple/SDL_mfijoystick_c.h @@ -40,7 +40,7 @@ typedef struct joystick_hwdata char *name; SDL_Joystick *joystick; SDL_JoystickID instance_id; - SDL_JoystickGUID guid; + SDL_GUID guid; int naxes; int nbuttons; diff --git a/src/joystick/bsd/SDL_bsdjoystick.c b/src/joystick/bsd/SDL_bsdjoystick.c index eda5e30893fbf..0ffe8d8b89825 100644 --- a/src/joystick/bsd/SDL_bsdjoystick.c +++ b/src/joystick/bsd/SDL_bsdjoystick.c @@ -173,7 +173,7 @@ typedef struct SDL_joylist_item SDL_JoystickID device_instance; char *path; /* "/dev/uhid0" or whatever */ char *name; /* "SideWinder 3D Pro" or whatever */ - SDL_JoystickGUID guid; + SDL_GUID guid; dev_t devnum; struct SDL_joylist_item *next; } SDL_joylist_item; @@ -393,7 +393,7 @@ static int MaybeAddDevice(const char *path) { struct stat sb; char *name = NULL; - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_joylist_item *item; struct joystick_hwdata *hw; @@ -556,7 +556,7 @@ static void BSD_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID BSD_JoystickGetDeviceGUID(int device_index) +static SDL_GUID BSD_JoystickGetDeviceGUID(int device_index) { return GetJoystickByDevIndex(device_index)->guid; } diff --git a/src/joystick/darwin/SDL_iokitjoystick.c b/src/joystick/darwin/SDL_iokitjoystick.c index 9c830a82a6e2a..6e539e6a0afa2 100644 --- a/src/joystick/darwin/SDL_iokitjoystick.c +++ b/src/joystick/darwin/SDL_iokitjoystick.c @@ -743,10 +743,10 @@ static void DARWIN_JoystickSetDevicePlayerIndex(int device_index, int player_ind { } -static SDL_JoystickGUID DARWIN_JoystickGetDeviceGUID(int device_index) +static SDL_GUID DARWIN_JoystickGetDeviceGUID(int device_index) { recDevice *device = GetDeviceForIndex(device_index); - SDL_JoystickGUID guid; + SDL_GUID guid; if (device) { guid = device->guid; } else { diff --git a/src/joystick/darwin/SDL_iokitjoystick_c.h b/src/joystick/darwin/SDL_iokitjoystick_c.h index 756e9b7ab3d9e..899efa8707c77 100644 --- a/src/joystick/darwin/SDL_iokitjoystick_c.h +++ b/src/joystick/darwin/SDL_iokitjoystick_c.h @@ -70,7 +70,7 @@ struct joystick_hwdata SDL_bool runLoopAttached; /* is 'deviceRef' attached to a CFRunLoop? */ int instance_id; - SDL_JoystickGUID guid; + SDL_GUID guid; int steam_virtual_gamepad_slot; struct joystick_hwdata *pNext; /* next device */ diff --git a/src/joystick/dummy/SDL_sysjoystick.c b/src/joystick/dummy/SDL_sysjoystick.c index 9338757507ee2..dcb320ae0af57 100644 --- a/src/joystick/dummy/SDL_sysjoystick.c +++ b/src/joystick/dummy/SDL_sysjoystick.c @@ -70,9 +70,9 @@ static void DUMMY_JoystickSetDevicePlayerIndex(int device_index, int player_inde { } -static SDL_JoystickGUID DUMMY_JoystickGetDeviceGUID(int device_index) +static SDL_GUID DUMMY_JoystickGetDeviceGUID(int device_index) { - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_zero(guid); return guid; } diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c index ffbefa4b65493..1ecd3983b4609 100644 --- a/src/joystick/emscripten/SDL_sysjoystick.c +++ b/src/joystick/emscripten/SDL_sysjoystick.c @@ -378,7 +378,7 @@ static void EMSCRIPTEN_JoystickClose(SDL_Joystick *joystick) } } -static SDL_JoystickGUID EMSCRIPTEN_JoystickGetDeviceGUID(int device_index) +static SDL_GUID EMSCRIPTEN_JoystickGetDeviceGUID(int device_index) { /* the GUID is just the name for now */ const char *name = EMSCRIPTEN_JoystickGetDeviceName(device_index); diff --git a/src/joystick/gdk/SDL_gameinputjoystick.c b/src/joystick/gdk/SDL_gameinputjoystick.c index 21305bf64143c..7cceec9d03575 100644 --- a/src/joystick/gdk/SDL_gameinputjoystick.c +++ b/src/joystick/gdk/SDL_gameinputjoystick.c @@ -35,7 +35,7 @@ typedef struct GAMEINPUT_InternalDevice IGameInputDevice *device; char path[(APP_LOCAL_DEVICE_ID_SIZE * 2) + 1]; char *name; - SDL_JoystickGUID guid; /* generated by SDL */ + SDL_GUID guid; /* generated by SDL */ SDL_JoystickID device_instance; /* generated by SDL */ const GameInputDeviceInfo *info; SDL_bool isAdded; @@ -331,7 +331,7 @@ static void GAMEINPUT_JoystickSetDevicePlayerIndex(int device_index, int player_ { } -static SDL_JoystickGUID GAMEINPUT_JoystickGetDeviceGUID(int device_index) +static SDL_GUID GAMEINPUT_JoystickGetDeviceGUID(int device_index) { return GAMEINPUT_InternalFindByIndex(device_index)->guid; } diff --git a/src/joystick/haiku/SDL_haikujoystick.cc b/src/joystick/haiku/SDL_haikujoystick.cc index 4191acff5deb7..8cf62f9b5e517 100644 --- a/src/joystick/haiku/SDL_haikujoystick.cc +++ b/src/joystick/haiku/SDL_haikujoystick.cc @@ -255,7 +255,7 @@ extern "C" SDL_joyname[0] = NULL; } - static SDL_JoystickGUID HAIKU_JoystickGetDeviceGUID(int device_index) + static SDL_GUID HAIKU_JoystickGetDeviceGUID(int device_index) { /* the GUID is just the name for now */ const char *name = HAIKU_JoystickGetDeviceName(device_index); diff --git a/src/joystick/hidapi/SDL_hidapijoystick.c b/src/joystick/hidapi/SDL_hidapijoystick.c index d49ff1b62a54e..17ec232e7e0f0 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick.c +++ b/src/joystick/hidapi/SDL_hidapijoystick.c @@ -1324,7 +1324,7 @@ SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 vers return result; } -SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) +SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_GUID guid) { SDL_HIDAPI_Device *device; SDL_JoystickType type = SDL_JOYSTICK_TYPE_UNKNOWN; @@ -1341,7 +1341,7 @@ SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid) return type; } -SDL_GamepadType HIDAPI_GetGamepadTypeFromGUID(SDL_JoystickGUID guid) +SDL_GamepadType HIDAPI_GetGamepadTypeFromGUID(SDL_GUID guid) { SDL_HIDAPI_Device *device; SDL_GamepadType type = SDL_GAMEPAD_TYPE_STANDARD; @@ -1455,10 +1455,10 @@ static void HIDAPI_JoystickSetDevicePlayerIndex(int device_index, int player_ind } } -static SDL_JoystickGUID HIDAPI_JoystickGetDeviceGUID(int device_index) +static SDL_GUID HIDAPI_JoystickGetDeviceGUID(int device_index) { SDL_HIDAPI_Device *device; - SDL_JoystickGUID guid; + SDL_GUID guid; device = HIDAPI_GetDeviceByIndex(device_index, NULL); if (device) { diff --git a/src/joystick/hidapi/SDL_hidapijoystick_c.h b/src/joystick/hidapi/SDL_hidapijoystick_c.h index c82421ef3d0b9..42f160d58b42f 100644 --- a/src/joystick/hidapi/SDL_hidapijoystick_c.h +++ b/src/joystick/hidapi/SDL_hidapijoystick_c.h @@ -74,7 +74,7 @@ typedef struct SDL_HIDAPI_Device Uint16 product_id; Uint16 version; char *serial; - SDL_JoystickGUID guid; + SDL_GUID guid; int interface_number; /* Available on Windows and Linux */ int interface_class; int interface_subclass; @@ -158,10 +158,10 @@ extern SDL_bool HIDAPI_IsDeviceTypePresent(SDL_GamepadType type); extern SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name); /* Return the type of a joystick if it's present and supported */ -extern SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid); +extern SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_GUID guid); /* Return the type of a game controller if it's present and supported */ -extern SDL_GamepadType HIDAPI_GetGamepadTypeFromGUID(SDL_JoystickGUID guid); +extern SDL_GamepadType HIDAPI_GetGamepadTypeFromGUID(SDL_GUID guid); extern void HIDAPI_UpdateDevices(void); extern void HIDAPI_SetDeviceName(SDL_HIDAPI_Device *device, const char *name); diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c index d6e5145fa7448..cf45d47321b64 100644 --- a/src/joystick/linux/SDL_sysjoystick.c +++ b/src/joystick/linux/SDL_sysjoystick.c @@ -153,7 +153,7 @@ typedef struct SDL_joylist_item SDL_JoystickID device_instance; char *path; /* "/dev/input/event2" or whatever */ char *name; /* "SideWinder 3D Pro" or whatever */ - SDL_JoystickGUID guid; + SDL_GUID guid; dev_t devnum; int steam_virtual_gamepad_slot; struct joystick_hwdata *hwdata; @@ -276,7 +276,7 @@ static int GuessIsSensor(int fd) return 0; } -static int IsJoystick(const char *path, int *fd, char **name_return, Uint16 *vendor_return, Uint16 *product_return, SDL_JoystickGUID *guid) +static int IsJoystick(const char *path, int *fd, char **name_return, Uint16 *vendor_return, Uint16 *product_return, SDL_GUID *guid) { struct input_id inpid; char *name; @@ -440,7 +440,7 @@ static void MaybeAddDevice(const char *path) int fd = -1; char *name = NULL; Uint16 vendor, product; - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_joylist_item *item; SDL_sensorlist_item *item_sensor; @@ -663,7 +663,7 @@ static void HandlePendingRemovals(void) } } -static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_JoystickGUID guid, SDL_JoystickID *device_instance) +static SDL_bool SteamControllerConnectedCallback(const char *name, SDL_GUID guid, SDL_JoystickID *device_instance) { SDL_joylist_item *item; @@ -1186,7 +1186,7 @@ static void LINUX_JoystickSetDevicePlayerIndex(int device_index, int player_inde { } -static SDL_JoystickGUID LINUX_JoystickGetDeviceGUID(int device_index) +static SDL_GUID LINUX_JoystickGetDeviceGUID(int device_index) { return GetJoystickByDevIndex(device_index)->guid; } diff --git a/src/joystick/linux/SDL_sysjoystick_c.h b/src/joystick/linux/SDL_sysjoystick_c.h index 8e441c0a9aa70..cf9a41f101f11 100644 --- a/src/joystick/linux/SDL_sysjoystick_c.h +++ b/src/joystick/linux/SDL_sysjoystick_c.h @@ -35,7 +35,7 @@ struct joystick_hwdata int fd_sensor; struct SDL_joylist_item *item; struct SDL_sensorlist_item *item_sensor; - SDL_JoystickGUID guid; + SDL_GUID guid; char *fname; /* Used in haptic subsystem */ SDL_bool ff_rumble; diff --git a/src/joystick/n3ds/SDL_sysjoystick.c b/src/joystick/n3ds/SDL_sysjoystick.c index 5837d9166ceea..b6ba9e973b7ff 100644 --- a/src/joystick/n3ds/SDL_sysjoystick.c +++ b/src/joystick/n3ds/SDL_sysjoystick.c @@ -76,9 +76,9 @@ static int N3DS_JoystickGetCount(void) return 1; } -static SDL_JoystickGUID N3DS_JoystickGetDeviceGUID(int device_index) +static SDL_GUID N3DS_JoystickGetDeviceGUID(int device_index) { - SDL_JoystickGUID guid = SDL_CreateJoystickGUIDForName("Nintendo 3DS"); + SDL_GUID guid = SDL_CreateJoystickGUIDForName("Nintendo 3DS"); return guid; } diff --git a/src/joystick/ps2/SDL_sysjoystick.c b/src/joystick/ps2/SDL_sysjoystick.c index 46933662abc58..05d379f7a54db 100644 --- a/src/joystick/ps2/SDL_sysjoystick.c +++ b/src/joystick/ps2/SDL_sysjoystick.c @@ -182,7 +182,7 @@ static void PS2_JoystickSetDevicePlayerIndex(int device_index, int player_index) } /* Function to return the stable GUID for a plugged in device */ -static SDL_JoystickGUID PS2_JoystickGetDeviceGUID(int device_index) +static SDL_GUID PS2_JoystickGetDeviceGUID(int device_index) { /* the GUID is just the name for now */ const char *name = PS2_JoystickGetDeviceName(device_index); diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c index 53f7c081842b2..f10988401db07 100644 --- a/src/joystick/psp/SDL_sysjoystick.c +++ b/src/joystick/psp/SDL_sysjoystick.c @@ -137,7 +137,7 @@ static void PSP_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID PSP_JoystickGetDeviceGUID(int device_index) +static SDL_GUID PSP_JoystickGetDeviceGUID(int device_index) { /* the GUID is just the name for now */ const char *name = PSP_JoystickGetDeviceName(device_index); diff --git a/src/joystick/steam/SDL_steamcontroller.h b/src/joystick/steam/SDL_steamcontroller.h index b53016284aba5..2636740dc1247 100644 --- a/src/joystick/steam/SDL_steamcontroller.h +++ b/src/joystick/steam/SDL_steamcontroller.h @@ -24,7 +24,7 @@ #include "SDL_internal.h" -typedef SDL_bool (*SteamControllerConnectedCallback_t)(const char *name, SDL_JoystickGUID guid, SDL_JoystickID *device_instance); +typedef SDL_bool (*SteamControllerConnectedCallback_t)(const char *name, SDL_GUID guid, SDL_JoystickID *device_instance); typedef void (*SteamControllerDisconnectedCallback_t)(SDL_JoystickID device_instance); void SDL_InitSteamControllers(SteamControllerConnectedCallback_t connectedCallback, diff --git a/src/joystick/virtual/SDL_virtualjoystick.c b/src/joystick/virtual/SDL_virtualjoystick.c index edbc157c87abd..b0d6f6a3758b1 100644 --- a/src/joystick/virtual/SDL_virtualjoystick.c +++ b/src/joystick/virtual/SDL_virtualjoystick.c @@ -534,11 +534,11 @@ static void VIRTUAL_JoystickSetDevicePlayerIndex(int device_index, int player_in } } -static SDL_JoystickGUID VIRTUAL_JoystickGetDeviceGUID(int device_index) +static SDL_GUID VIRTUAL_JoystickGetDeviceGUID(int device_index) { joystick_hwdata *hwdata = VIRTUAL_HWDataForIndex(device_index); if (!hwdata) { - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_zero(guid); return guid; } diff --git a/src/joystick/virtual/SDL_virtualjoystick_c.h b/src/joystick/virtual/SDL_virtualjoystick_c.h index 5e479433924de..cfb4a083f9874 100644 --- a/src/joystick/virtual/SDL_virtualjoystick_c.h +++ b/src/joystick/virtual/SDL_virtualjoystick_c.h @@ -50,7 +50,7 @@ typedef struct joystick_hwdata SDL_bool attached; char *name; SDL_JoystickType type; - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_VirtualJoystickDesc desc; Uint32 changes; Sint16 *axes; diff --git a/src/joystick/vita/SDL_sysjoystick.c b/src/joystick/vita/SDL_sysjoystick.c index d5625426d1461..90257148c5740 100644 --- a/src/joystick/vita/SDL_sysjoystick.c +++ b/src/joystick/vita/SDL_sysjoystick.c @@ -318,7 +318,7 @@ static void VITA_JoystickQuit(void) { } -static SDL_JoystickGUID VITA_JoystickGetDeviceGUID(int device_index) +static SDL_GUID VITA_JoystickGetDeviceGUID(int device_index) { /* the GUID is just the name for now */ const char *name = VITA_JoystickGetDeviceName(device_index); diff --git a/src/joystick/windows/SDL_rawinputjoystick.c b/src/joystick/windows/SDL_rawinputjoystick.c index 0b2509b4b024e..59e48061a52d1 100644 --- a/src/joystick/windows/SDL_rawinputjoystick.c +++ b/src/joystick/windows/SDL_rawinputjoystick.c @@ -111,7 +111,7 @@ typedef struct SDL_RAWINPUT_Device Uint16 vendor_id; Uint16 product_id; Uint16 version; - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_bool is_xinput; SDL_bool is_xboxone; int steam_virtual_gamepad_slot; @@ -1215,7 +1215,7 @@ static void RAWINPUT_JoystickSetDevicePlayerIndex(int device_index, int player_i { } -static SDL_JoystickGUID RAWINPUT_JoystickGetDeviceGUID(int device_index) +static SDL_GUID RAWINPUT_JoystickGetDeviceGUID(int device_index) { return RAWINPUT_GetDeviceByIndex(device_index)->guid; } diff --git a/src/joystick/windows/SDL_windows_gaming_input.c b/src/joystick/windows/SDL_windows_gaming_input.c index 819241529a334..9004441dff7ce 100644 --- a/src/joystick/windows/SDL_windows_gaming_input.c +++ b/src/joystick/windows/SDL_windows_gaming_input.c @@ -56,7 +56,7 @@ typedef struct WindowsGamingInputControllerState SDL_JoystickID instance_id; __x_ABI_CWindows_CGaming_CInput_CIRawGameController *controller; char *name; - SDL_JoystickGUID guid; + SDL_GUID guid; SDL_JoystickType type; int steam_virtual_gamepad_slot; } WindowsGamingInputControllerState; @@ -400,7 +400,7 @@ static HRESULT STDMETHODCALLTYPE IEventHandler_CRawGameControllerVtbl_InvokeAdde hr = __x_ABI_CWindows_CGaming_CInput_CIRawGameController_QueryInterface(e, &IID___x_ABI_CWindows_CGaming_CInput_CIRawGameController, (void **)&controller); if (SUCCEEDED(hr)) { char *name = NULL; - SDL_JoystickGUID guid = { 0 }; + SDL_GUID guid = { 0 }; Uint16 bus = SDL_HARDWARE_BUS_USB; Uint16 vendor = 0; Uint16 product = 0; @@ -703,7 +703,7 @@ static void WGI_JoystickSetDevicePlayerIndex(int device_index, int player_index) { } -static SDL_JoystickGUID WGI_JoystickGetDeviceGUID(int device_index) +static SDL_GUID WGI_JoystickGetDeviceGUID(int device_index) { return wgi.controllers[device_index].guid; } diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index e5dcdbf657ddd..abcbdb0207736 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -522,7 +522,7 @@ static void WINDOWS_JoystickSetDevicePlayerIndex(int device_index, int player_in } /* return the stable device guid for this device index */ -static SDL_JoystickGUID WINDOWS_JoystickGetDeviceGUID(int device_index) +static SDL_GUID WINDOWS_JoystickGetDeviceGUID(int device_index) { JoyStick_DeviceData *device = SYS_Joystick; int index; diff --git a/src/joystick/windows/SDL_windowsjoystick_c.h b/src/joystick/windows/SDL_windowsjoystick_c.h index 1493589e859f5..4c8dcf28dac88 100644 --- a/src/joystick/windows/SDL_windowsjoystick_c.h +++ b/src/joystick/windows/SDL_windowsjoystick_c.h @@ -33,7 +33,7 @@ extern "C" { typedef struct JoyStick_DeviceData { - SDL_JoystickGUID guid; + SDL_GUID guid; char *joystickname; Uint8 send_add_event; SDL_JoystickID nInstanceID; @@ -70,7 +70,7 @@ typedef struct input_t /* The private structure used to keep track of a joystick */ struct joystick_hwdata { - SDL_JoystickGUID guid; + SDL_GUID guid; #ifdef SDL_JOYSTICK_DINPUT LPDIRECTINPUTDEVICE8 InputDevice; diff --git a/test/testautomation_guid.c b/test/testautomation_guid.c index f8576129dc04b..03bc495b83e5f 100644 --- a/test/testautomation_guid.c +++ b/test/testautomation_guid.c @@ -106,40 +106,14 @@ TestGuidToString(void *arg) SDLTest_AssertPass("Call to SDL_GUIDToString"); for (i = 0; i < NUM_TEST_GUIDS; ++i) { - const int guid_str_offset = 4; - char guid_str_buf[64]; - char *guid_str = guid_str_buf + guid_str_offset; + const char *guid_str; SDL_GUID guid; - int size; upper_lower_to_bytestring(guid.data, test_guids[i].upper, test_guids[i].lower); - /* Serialise to limited-length buffers */ - for (size = 0; size <= 36; ++size) { - const Uint8 fill_char = (Uint8)(size + 0xa0); - Uint32 expected_prefix; - Uint32 actual_prefix; - int written_size; - - SDL_memset(guid_str_buf, fill_char, sizeof(guid_str_buf)); - SDL_GUIDToString(guid, guid_str, size); - - /* Check bytes before guid_str_buf */ - expected_prefix = fill_char | (fill_char << 8) | (fill_char << 16) | (((Uint32)fill_char) << 24); - SDL_memcpy(&actual_prefix, guid_str_buf, 4); - SDLTest_AssertCheck(expected_prefix == actual_prefix, "String buffer memory before output untouched, expected: %" SDL_PRIu32 ", got: %" SDL_PRIu32 ", at size=%d", expected_prefix, actual_prefix, size); - - /* Check that we did not overwrite too much */ - written_size = 0; - while ((guid_str[written_size] & 0xff) != fill_char && written_size < 256) { - ++written_size; - } - SDLTest_AssertCheck(written_size <= size, "Output length is within expected bounds, with length %d: wrote %d of %d permitted bytes", size, written_size, size); - if (size >= 33) { - SDLTest_AssertCheck(SDL_strcmp(guid_str, test_guids[i].str) == 0, "GUID string equality, from string: %s", test_guids[i].str); - } - } + guid_str = SDL_GUIDToString(guid); + SDLTest_AssertCheck(SDL_strcmp(guid_str, test_guids[i].str) == 0, "Checking whether strings match, expected %s, got %s\n", test_guids[i].str, guid_str); } return TEST_COMPLETED; diff --git a/test/testcontroller.c b/test/testcontroller.c index daaa86102dabe..5be697c140c30 100644 --- a/test/testcontroller.c +++ b/test/testcontroller.c @@ -918,9 +918,9 @@ static void AddController(SDL_JoystickID id, SDL_bool verbose) if (verbose && !SDL_IsGamepad(id)) { const char *name = SDL_GetJoystickName(joystick); const char *path = SDL_GetJoystickPath(joystick); - char guid[33]; + const char *guid; SDL_Log("Opened joystick %s%s%s\n", name, path ? ", " : "", path ? path : ""); - SDL_GetJoystickGUIDString(SDL_GetJoystickGUID(joystick), guid, sizeof(guid)); + guid = SDL_GUIDToString(SDL_GetJoystickGUID(joystick)); SDL_Log("No gamepad mapping for %s\n", guid); } } else { diff --git a/test/testpen.c b/test/testpen.c index 94c676606582f..b5318b7cf1cc5 100644 --- a/test/testpen.c +++ b/test/testpen.c @@ -222,7 +222,7 @@ static void dump_state(void) for (i = 0; i < pens_nr; ++i) { SDL_PenID penid = pens[i]; SDL_GUID guid = SDL_GetPenGUID(penid); - char guid_str[33]; + const char *guid_str; float axes[SDL_PEN_NUM_AXES]; float x, y; int k; @@ -232,7 +232,7 @@ static void dump_state(void) char *type; char *buttons_str; - SDL_GUIDToString(guid, guid_str, 33); + guid_str = SDL_GUIDToString(guid); switch (SDL_GetPenType(penid)) { case SDL_PEN_TYPE_ERASER: From c4eac60000d6c0a3fdbe09aa8211d7cec66c408d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 11:08:03 -0700 Subject: [PATCH 407/431] SDL_GetClipboardData() follows the SDL_GetStringRule --- include/SDL3/SDL_clipboard.h | 7 ++++--- src/dynapi/SDL_dynapi_procs.h | 2 +- src/test/SDL_test_common.c | 3 +-- src/video/SDL_clipboard.c | 29 ++++++++++++++--------------- test/testautomation_clipboard.c | 12 ++---------- 5 files changed, 22 insertions(+), 31 deletions(-) diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 8d7a190873a01..504f75ffcc590 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -219,15 +219,16 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearClipboardData(void); * \param mime_type the mime type to read from the clipboard. * \param size a pointer filled in with the length of the returned data. * \returns the retrieved data buffer or NULL on failure; call SDL_GetError() - * for more information. Caller must call SDL_free() on the returned - * pointer when done with it. + * for more information. + * + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This function is available since SDL 3.0.0. * * \sa SDL_HasClipboardData * \sa SDL_SetClipboardData */ -extern SDL_DECLSPEC void * SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size); +extern SDL_DECLSPEC const void * SDLCALL SDL_GetClipboardData(const char *mime_type, size_t *size); /** * Query whether there is data in the clipboard for the provided mime type. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index db6e677a39bcb..651e8a4089843 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -234,7 +234,7 @@ SDL_DYNAPI_PROC(SDL_CameraPosition,SDL_GetCameraPosition,(SDL_CameraID a),(a),re SDL_DYNAPI_PROC(SDL_PropertiesID,SDL_GetCameraProperties,(SDL_Camera *a),(a),return) SDL_DYNAPI_PROC(const SDL_CameraSpec* const*,SDL_GetCameraSupportedFormats,(SDL_CameraID a, int *b),(a,b),return) SDL_DYNAPI_PROC(const SDL_CameraID*,SDL_GetCameras,(int *a),(a),return) -SDL_DYNAPI_PROC(void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) +SDL_DYNAPI_PROC(const void*,SDL_GetClipboardData,(const char *a, size_t *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetClipboardText,(void),(),return) SDL_DYNAPI_PROC(const SDL_DisplayMode*,SDL_GetClosestFullscreenDisplayMode,(SDL_DisplayID a, int b, int c, float d, SDL_bool e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(const char*,SDL_GetCurrentAudioDriver,(void),(),return) diff --git a/src/test/SDL_test_common.c b/src/test/SDL_test_common.c index 307b3b03e67bb..2de6b74c98853 100644 --- a/src/test/SDL_test_common.c +++ b/src/test/SDL_test_common.c @@ -1996,7 +1996,7 @@ static void SDLTest_PasteScreenShot(void) for (i = 0; i < SDL_arraysize(image_formats); ++i) { size_t size; - void *data = SDL_GetClipboardData(image_formats[i], &size); + const void *data = SDL_GetClipboardData(image_formats[i], &size); if (data) { char filename[16]; SDL_IOStream *file; @@ -2008,7 +2008,6 @@ static void SDLTest_PasteScreenShot(void) SDL_WriteIO(file, data, size); SDL_CloseIO(file); } - SDL_free(data); return; } } diff --git a/src/video/SDL_clipboard.c b/src/video/SDL_clipboard.c index a0bd9e8f7c8ec..f89ef60f684b3 100644 --- a/src/video/SDL_clipboard.c +++ b/src/video/SDL_clipboard.c @@ -162,7 +162,7 @@ void *SDL_GetInternalClipboardData(SDL_VideoDevice *_this, const char *mime_type return data; } -void *SDL_GetClipboardData(const char *mime_type, size_t *size) +const void *SDL_GetClipboardData(const char *mime_type, size_t *size) { SDL_VideoDevice *_this = SDL_GetVideoDevice(); @@ -184,16 +184,16 @@ void *SDL_GetClipboardData(const char *mime_type, size_t *size) *size = 0; if (_this->GetClipboardData) { - return _this->GetClipboardData(_this, mime_type, size); + return SDL_FreeLater(_this->GetClipboardData(_this, mime_type, size)); } else if (_this->GetClipboardText && SDL_IsTextMimeType(mime_type)) { - void *data = _this->GetClipboardText(_this); - if (data && *(char *)data == '\0') { - SDL_free(data); - data = NULL; + char *text = _this->GetClipboardText(_this); + if (text && *text == '\0') { + SDL_free(text); + text = NULL; } - return data; + return SDL_FreeLater(text); } else { - return SDL_GetInternalClipboardData(_this, mime_type, size); + return SDL_FreeLater(SDL_GetInternalClipboardData(_this, mime_type, size)); } } @@ -297,16 +297,15 @@ const char *SDL_GetClipboardText(void) text_mime_types = SDL_GetTextMimeTypes(_this, &num_mime_types); for (i = 0; i < num_mime_types; ++i) { - void *clipdata = SDL_GetClipboardData(text_mime_types[i], &length); + const void *clipdata = SDL_GetClipboardData(text_mime_types[i], &length); if (clipdata) { - text = (const char *) clipdata; - SDL_FreeLater(clipdata); // returned string follows the SDL_GetStringRule. + text = (const char *)clipdata; break; } } if (!text) { - text = ""; + text = SDL_CreateTemporaryString(""); } return text; } @@ -349,7 +348,7 @@ int SDL_SetPrimarySelectionText(const char *text) return -1; } } else { - SDL_FreeLater(_this->primary_selection_text); // SDL_GetPrimarySelectionText() returns this pointer. + SDL_free(_this->primary_selection_text); _this->primary_selection_text = SDL_strdup(text); } @@ -367,13 +366,13 @@ const char *SDL_GetPrimarySelectionText(void) } if (_this->GetPrimarySelectionText) { - return SDL_FreeLater(_this->GetPrimarySelectionText(_this)); // returned pointer follows the SDL_GetStringRule + return SDL_FreeLater(_this->GetPrimarySelectionText(_this)); } else { const char *text = _this->primary_selection_text; if (!text) { text = ""; } - return text; + return SDL_CreateTemporaryString(text); } } diff --git a/test/testautomation_clipboard.c b/test/testautomation_clipboard.c index 5568029178b28..3af66c645806e 100644 --- a/test/testautomation_clipboard.c +++ b/test/testautomation_clipboard.c @@ -86,9 +86,9 @@ static int clipboard_testClipboardDataFunctions(void *arg) int last_clipboard_update_count; int last_clipboard_callback_count; int last_clipboard_cleanup_count; - void *data; + const void *data; size_t size; - char *text; + const char *text; const char *expected_text; TestClipboardData test_data1 = { @@ -186,7 +186,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == SDL_strlen(expected_text), "Verify test text size, expected %d, got %d", (int)SDL_strlen(expected_text), (int)size); - SDL_free(text); expected_text = "CUSTOM"; boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_CUSTOM_TEXT]); @@ -206,7 +205,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == SDL_strlen(expected_text), "Verify test text size, expected %d, got %d", (int)SDL_strlen(expected_text), (int)size); - SDL_free(text); boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_DATA]); SDLTest_AssertCheck( @@ -220,7 +218,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == test_data1.data_size, "Verify test data size, expected %d, got %d", (int)test_data1.data_size, (int)size); - SDL_free(data); boolResult = SDL_HasClipboardData("test/invalid"); SDLTest_AssertCheck( @@ -235,7 +232,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == 0, "Verify invalid data size, expected 0, got %d", (int)size); - SDL_free(data); #if 0 /* There's no guarantee how or when the callback is called */ SDLTest_AssertCheck( @@ -287,7 +283,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == SDL_strlen(expected_text), "Verify test text size, expected %d, got %d", (int)SDL_strlen(expected_text), (int)size); - SDL_free(text); expected_text = "CUSTOM"; boolResult = SDL_HasClipboardData(test_mime_types[TEST_MIME_TYPE_CUSTOM_TEXT]); @@ -307,7 +302,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == SDL_strlen(expected_text), "Verify test text size, expected %d, got %d", (int)SDL_strlen(expected_text), (int)size); - SDL_free(text); data = SDL_GetClipboardData(test_mime_types[TEST_MIME_TYPE_DATA], &size); SDLTest_AssertCheck( @@ -317,7 +311,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == test_data2.data_size, "Verify test data size, expected %d, got %d", (int)test_data2.data_size, (int)size); - SDL_free(data); data = SDL_GetClipboardData("test/invalid", &size); SDLTest_AssertCheck( @@ -328,7 +321,6 @@ static int clipboard_testClipboardDataFunctions(void *arg) size == 0, "Verify invalid data size, expected 0, got %d", (int)size); - SDL_free(data); #if 0 /* There's no guarantee how or when the callback is called */ SDLTest_AssertCheck( From fd9fe1bb7b3f3c4e13b1bc42e7a5e77cead6c9a0 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 09:50:25 -0700 Subject: [PATCH 408/431] Renamed event memory to temporary memory, since it's not just used for events --- include/SDL3/SDL_events.h | 33 ++++---- src/SDL_internal.h | 6 +- src/dynapi/SDL_dynapi.sym | 6 +- src/dynapi/SDL_dynapi_overrides.h | 6 +- src/dynapi/SDL_dynapi_procs.h | 6 +- src/events/SDL_events.c | 134 +++++++++++++++--------------- src/events/SDL_keyboard.c | 2 +- src/joystick/SDL_gamepad.c | 2 +- test/testautomation_events.c | 54 ++++++------ 9 files changed, 121 insertions(+), 128 deletions(-) diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 63958e7e441bb..2ee69991d5c0a 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -1407,10 +1407,9 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_EventEnabled(Uint32 type); extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); /** - * Allocate temporary memory for an SDL event. + * Allocate temporary memory. * - * You can use this to allocate memory for user events that will be - * automatically freed after the event is processed. + * You can use this to allocate memory that will be automatically freed later, after event processing is complete. * * \param size the amount of memory to allocate. * \returns a pointer to the memory allocated or NULL on failure; call @@ -1420,35 +1419,33 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); * * \since This function is available since SDL 3.0.0. * - * \sa SDL_ClaimEventMemory - * \sa SDL_FreeEventMemory + * \sa SDL_ClaimTemporaryMemory + * \sa SDL_FreeTemporaryMemory */ -extern SDL_DECLSPEC void * SDLCALL SDL_AllocateEventMemory(size_t size); +extern SDL_DECLSPEC void * SDLCALL SDL_AllocateTemporaryMemory(size_t size); /** - * Claim ownership of temporary event memory allocated by SDL. + * Claim ownership of temporary memory allocated by SDL. * - * This function changes ownership of temporary event memory allocated for events and APIs that - * follow the SDL_GetStringRule. If this function succeeds, the memory will no longer be automatically freed by SDL, it must be freed using SDL_free() by the application. + * This function changes ownership of temporary memory allocated for events and APIs that + * return temporary memory. If this function succeeds, the memory will no longer be automatically freed by SDL, it must be freed using SDL_free() by the application. * * If the memory isn't temporary, or it was allocated on a different thread, or if it is associated with an event currently in the event queue, this will return NULL, and the application does not have ownership of the memory. * - * Note that even if a function follows the SDL_GetStringRule it may not be using temporary event memory, and this function will return NULL in that case. - * - * \param mem a pointer allocated with SDL_AllocateEventMemory(). + * \param mem a pointer allocated with SDL_AllocateTemporaryMemory(). * \returns a pointer to the memory now owned by the application, which must be freed using SDL_free(), or NULL if the memory is not temporary or was allocated on a different thread. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AllocateEventMemory + * \sa SDL_AllocateTemporaryMemory * \sa SDL_free */ -extern SDL_DECLSPEC void * SDLCALL SDL_ClaimEventMemory(const void *mem); +extern SDL_DECLSPEC void * SDLCALL SDL_ClaimTemporaryMemory(const void *mem); /** - * Free temporary event memory allocated by SDL. + * Free temporary memory allocated by SDL. * * This function frees temporary memory allocated for events and APIs that * follow the SDL_GetStringRule. This memory is local to the thread that creates @@ -1460,15 +1457,15 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ClaimEventMemory(const void *mem); * * All temporary memory is freed on the main thread in SDL_Quit() and for other threads when they call SDL_CleanupTLS(), which is automatically called at cleanup time for threads created using SDL_CreateThread(). * - * \param mem a pointer allocated with SDL_AllocateEventMemory(), or NULL to free all pending temporary allocations. + * \param mem a pointer allocated with SDL_AllocateTemporaryMemory(), or NULL to free all pending temporary allocations. * * \threadsafety It is safe to call this function from any thread. * * \since This function is available since SDL 3.0.0. * - * \sa SDL_AllocateEventMemory + * \sa SDL_AllocateTemporaryMemory */ -extern SDL_DECLSPEC void SDLCALL SDL_FreeEventMemory(const void *mem); +extern SDL_DECLSPEC void SDLCALL SDL_FreeTemporaryMemory(const void *mem); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/SDL_internal.h b/src/SDL_internal.h index fe70c124ba688..4909e55244ec8 100644 --- a/src/SDL_internal.h +++ b/src/SDL_internal.h @@ -298,11 +298,7 @@ extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutN extern const char *SDL_CreateTemporaryString(const char *string); -/* Queue `memory` to be passed to SDL_free once the event queue is emptied. - this manages the list of pointers to SDL_AllocateEventMemory, but you - can use it to queue pointers from other subsystems that can die at any - moment but definitely need to live long enough for the app to copy them - if they happened to query them in their last moments. */ +/* Add memory to the temporary memory pool, to be freed automatically later */ extern void *SDL_FreeLater(void *memory); /* Ends C function definitions when using C++ */ diff --git a/src/dynapi/SDL_dynapi.sym b/src/dynapi/SDL_dynapi.sym index 1a8ccd51983c3..939a6ad64fe8b 100644 --- a/src/dynapi/SDL_dynapi.sym +++ b/src/dynapi/SDL_dynapi.sym @@ -11,7 +11,7 @@ SDL3_0.0.0 { SDL_AddTimer; SDL_AddTimerNS; SDL_AddVulkanRenderSemaphores; - SDL_AllocateEventMemory; + SDL_AllocateTemporaryMemory; SDL_AtomicAdd; SDL_AtomicCompareAndSwap; SDL_AtomicCompareAndSwapPointer; @@ -29,7 +29,7 @@ SDL3_0.0.0 { SDL_BlitSurfaceUncheckedScaled; SDL_BroadcastCondition; SDL_CaptureMouse; - SDL_ClaimEventMemory; + SDL_ClaimTemporaryMemory; SDL_CleanupTLS; SDL_ClearAudioStream; SDL_ClearClipboardData; @@ -125,7 +125,7 @@ SDL3_0.0.0 { SDL_FlushEvent; SDL_FlushEvents; SDL_FlushRenderer; - SDL_FreeEventMemory; + SDL_FreeTemporaryMemory; SDL_GDKSuspendComplete; SDL_GL_CreateContext; SDL_GL_DestroyContext; diff --git a/src/dynapi/SDL_dynapi_overrides.h b/src/dynapi/SDL_dynapi_overrides.h index 4383671940e30..1a8063b877431 100644 --- a/src/dynapi/SDL_dynapi_overrides.h +++ b/src/dynapi/SDL_dynapi_overrides.h @@ -36,7 +36,7 @@ #define SDL_AddTimer SDL_AddTimer_REAL #define SDL_AddTimerNS SDL_AddTimerNS_REAL #define SDL_AddVulkanRenderSemaphores SDL_AddVulkanRenderSemaphores_REAL -#define SDL_AllocateEventMemory SDL_AllocateEventMemory_REAL +#define SDL_AllocateTemporaryMemory SDL_AllocateTemporaryMemory_REAL #define SDL_AtomicAdd SDL_AtomicAdd_REAL #define SDL_AtomicCompareAndSwap SDL_AtomicCompareAndSwap_REAL #define SDL_AtomicCompareAndSwapPointer SDL_AtomicCompareAndSwapPointer_REAL @@ -54,7 +54,7 @@ #define SDL_BlitSurfaceUncheckedScaled SDL_BlitSurfaceUncheckedScaled_REAL #define SDL_BroadcastCondition SDL_BroadcastCondition_REAL #define SDL_CaptureMouse SDL_CaptureMouse_REAL -#define SDL_ClaimEventMemory SDL_ClaimEventMemory_REAL +#define SDL_ClaimTemporaryMemory SDL_ClaimTemporaryMemory_REAL #define SDL_CleanupTLS SDL_CleanupTLS_REAL #define SDL_ClearAudioStream SDL_ClearAudioStream_REAL #define SDL_ClearClipboardData SDL_ClearClipboardData_REAL @@ -150,7 +150,7 @@ #define SDL_FlushEvent SDL_FlushEvent_REAL #define SDL_FlushEvents SDL_FlushEvents_REAL #define SDL_FlushRenderer SDL_FlushRenderer_REAL -#define SDL_FreeEventMemory SDL_FreeEventMemory_REAL +#define SDL_FreeTemporaryMemory SDL_FreeTemporaryMemory_REAL #define SDL_GDKSuspendComplete SDL_GDKSuspendComplete_REAL #define SDL_GL_CreateContext SDL_GL_CreateContext_REAL #define SDL_GL_DestroyContext SDL_GL_DestroyContext_REAL diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 651e8a4089843..9fdf202d785f7 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -56,7 +56,7 @@ SDL_DYNAPI_PROC(int,SDL_AddHintCallback,(const char *a, SDL_HintCallback b, void SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimer,(Uint32 a, SDL_TimerCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_TimerID,SDL_AddTimerNS,(Uint64 a, SDL_NSTimerCallback b, void *c),(a,b,c),return) SDL_DYNAPI_PROC(int,SDL_AddVulkanRenderSemaphores,(SDL_Renderer *a, Uint32 b, Sint64 c, Sint64 d),(a,b,c,d),return) -SDL_DYNAPI_PROC(void*,SDL_AllocateEventMemory,(size_t a),(a),return) +SDL_DYNAPI_PROC(void*,SDL_AllocateTemporaryMemory,(size_t a),(a),return) SDL_DYNAPI_PROC(int,SDL_AtomicAdd,(SDL_AtomicInt *a, int b),(a,b),return) SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCompareAndSwap,(SDL_AtomicInt *a, int b, int c),(a,b,c),return) SDL_DYNAPI_PROC(SDL_bool,SDL_AtomicCompareAndSwapPointer,(void **a, void *b, void *c),(a,b,c),return) @@ -74,7 +74,7 @@ SDL_DYNAPI_PROC(int,SDL_BlitSurfaceUnchecked,(SDL_Surface *a, const SDL_Rect *b, SDL_DYNAPI_PROC(int,SDL_BlitSurfaceUncheckedScaled,(SDL_Surface *a, const SDL_Rect *b, SDL_Surface *c, const SDL_Rect *d, SDL_ScaleMode e),(a,b,c,d,e),return) SDL_DYNAPI_PROC(int,SDL_BroadcastCondition,(SDL_Condition *a),(a),return) SDL_DYNAPI_PROC(int,SDL_CaptureMouse,(SDL_bool a),(a),return) -SDL_DYNAPI_PROC(void*,SDL_ClaimEventMemory,(const void *a),(a),return) +SDL_DYNAPI_PROC(void*,SDL_ClaimTemporaryMemory,(const void *a),(a),return) SDL_DYNAPI_PROC(void,SDL_CleanupTLS,(void),(),) SDL_DYNAPI_PROC(int,SDL_ClearAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(int,SDL_ClearClipboardData,(void),(),return) @@ -170,7 +170,7 @@ SDL_DYNAPI_PROC(int,SDL_FlushAudioStream,(SDL_AudioStream *a),(a),return) SDL_DYNAPI_PROC(void,SDL_FlushEvent,(Uint32 a),(a),) SDL_DYNAPI_PROC(void,SDL_FlushEvents,(Uint32 a, Uint32 b),(a,b),) SDL_DYNAPI_PROC(int,SDL_FlushRenderer,(SDL_Renderer *a),(a),return) -SDL_DYNAPI_PROC(void,SDL_FreeEventMemory,(const void *a),(a),) +SDL_DYNAPI_PROC(void,SDL_FreeTemporaryMemory,(const void *a),(a),) SDL_DYNAPI_PROC(void,SDL_GDKSuspendComplete,(void),(),) SDL_DYNAPI_PROC(SDL_GLContext,SDL_GL_CreateContext,(SDL_Window *a),(a),return) SDL_DYNAPI_PROC(int,SDL_GL_DestroyContext,(SDL_GLContext a),(a),return) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index ff08db8d85ab2..9f7c70cfda3e9 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -71,25 +71,25 @@ typedef struct static SDL_DisabledEventBlock *SDL_disabled_events[256]; static Uint32 SDL_userevents = SDL_EVENT_USER; -typedef struct SDL_EventMemory +typedef struct SDL_TemporaryMemory { void *memory; - struct SDL_EventMemory *prev; - struct SDL_EventMemory *next; -} SDL_EventMemory; + struct SDL_TemporaryMemory *prev; + struct SDL_TemporaryMemory *next; +} SDL_TemporaryMemory; -typedef struct SDL_EventMemoryState +typedef struct SDL_TemporaryMemoryState { - SDL_EventMemory *head; - SDL_EventMemory *tail; -} SDL_EventMemoryState; + SDL_TemporaryMemory *head; + SDL_TemporaryMemory *tail; +} SDL_TemporaryMemoryState; -static SDL_TLSID SDL_event_memory; +static SDL_TLSID SDL_temporary_memory; typedef struct SDL_EventEntry { SDL_Event event; - SDL_EventMemory *memory; + SDL_TemporaryMemory *memory; struct SDL_EventEntry *prev; struct SDL_EventEntry *next; } SDL_EventEntry; @@ -105,30 +105,30 @@ static struct SDL_EventEntry *free; } SDL_EventQ = { NULL, SDL_FALSE, { 0 }, 0, NULL, NULL, NULL }; -static void SDL_CleanupEventMemory(void *data) +static void SDL_CleanupTemporaryMemory(void *data) { - SDL_EventMemoryState *state = (SDL_EventMemoryState *)data; + SDL_TemporaryMemoryState *state = (SDL_TemporaryMemoryState *)data; - SDL_FreeEventMemory(NULL); + SDL_FreeTemporaryMemory(NULL); SDL_free(state); } -static SDL_EventMemoryState *SDL_GetEventMemoryState(SDL_bool create) +static SDL_TemporaryMemoryState *SDL_GetTemporaryMemoryState(SDL_bool create) { - SDL_EventMemoryState *state; + SDL_TemporaryMemoryState *state; - state = SDL_GetTLS(&SDL_event_memory); + state = SDL_GetTLS(&SDL_temporary_memory); if (!state) { if (!create) { return NULL; } - state = (SDL_EventMemoryState *)SDL_calloc(1, sizeof(*state)); + state = (SDL_TemporaryMemoryState *)SDL_calloc(1, sizeof(*state)); if (!state) { return NULL; } - if (SDL_SetTLS(&SDL_event_memory, state, SDL_CleanupEventMemory) < 0) { + if (SDL_SetTLS(&SDL_temporary_memory, state, SDL_CleanupTemporaryMemory) < 0) { SDL_free(state); return NULL; } @@ -136,9 +136,9 @@ static SDL_EventMemoryState *SDL_GetEventMemoryState(SDL_bool create) return state; } -static SDL_EventMemory *SDL_GetEventMemoryEntry(SDL_EventMemoryState *state, const void *mem) +static SDL_TemporaryMemory *SDL_GetTemporaryMemoryEntry(SDL_TemporaryMemoryState *state, const void *mem) { - SDL_EventMemory *entry; + SDL_TemporaryMemory *entry; // Start from the end, it's likely to have been recently allocated for (entry = state->tail; entry; entry = entry->prev) { @@ -149,7 +149,7 @@ static SDL_EventMemory *SDL_GetEventMemoryEntry(SDL_EventMemoryState *state, con return NULL; } -static void SDL_LinkEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemory *entry) +static void SDL_LinkTemporaryMemoryEntry(SDL_TemporaryMemoryState *state, SDL_TemporaryMemory *entry) { entry->prev = state->tail; entry->next = NULL; @@ -162,7 +162,7 @@ static void SDL_LinkEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemor state->tail = entry; } -static void SDL_UnlinkEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemory *entry) +static void SDL_UnlinkTemporaryMemoryEntry(SDL_TemporaryMemoryState *state, SDL_TemporaryMemory *entry) { if (state->head == entry) { state->head = entry->next; @@ -182,7 +182,7 @@ static void SDL_UnlinkEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMem entry->next = NULL; } -static void SDL_FreeEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemory *entry, SDL_bool free_data) +static void SDL_FreeTemporaryMemoryEntry(SDL_TemporaryMemoryState *state, SDL_TemporaryMemory *entry, SDL_bool free_data) { if (free_data) { SDL_free(entry->memory); @@ -190,102 +190,102 @@ static void SDL_FreeEventMemoryEntry(SDL_EventMemoryState *state, SDL_EventMemor SDL_free(entry); } -static void SDL_LinkEventMemoryToEvent(SDL_EventEntry *event, const void *mem) +static void SDL_LinkTemporaryMemoryToEvent(SDL_EventEntry *event, const void *mem) { - SDL_EventMemoryState *state; - SDL_EventMemory *entry; + SDL_TemporaryMemoryState *state; + SDL_TemporaryMemory *entry; - state = SDL_GetEventMemoryState(SDL_FALSE); + state = SDL_GetTemporaryMemoryState(SDL_FALSE); if (!state) { return; } - entry = SDL_GetEventMemoryEntry(state, mem); + entry = SDL_GetTemporaryMemoryEntry(state, mem); if (entry) { - SDL_UnlinkEventMemoryEntry(state, entry); + SDL_UnlinkTemporaryMemoryEntry(state, entry); entry->next = event->memory; event->memory = entry; } } // Transfer the event memory from the thread-local event memory list to the event -static void SDL_TransferEventMemoryToEvent(SDL_EventEntry *event) +static void SDL_TransferTemporaryMemoryToEvent(SDL_EventEntry *event) { switch (event->event.type) { case SDL_EVENT_TEXT_EDITING: - SDL_LinkEventMemoryToEvent(event, event->event.edit.text); + SDL_LinkTemporaryMemoryToEvent(event, event->event.edit.text); break; case SDL_EVENT_TEXT_EDITING_CANDIDATES: - SDL_LinkEventMemoryToEvent(event, event->event.edit_candidates.candidates); + SDL_LinkTemporaryMemoryToEvent(event, event->event.edit_candidates.candidates); break; case SDL_EVENT_TEXT_INPUT: - SDL_LinkEventMemoryToEvent(event, event->event.text.text); + SDL_LinkTemporaryMemoryToEvent(event, event->event.text.text); break; case SDL_EVENT_DROP_BEGIN: case SDL_EVENT_DROP_FILE: case SDL_EVENT_DROP_TEXT: case SDL_EVENT_DROP_COMPLETE: case SDL_EVENT_DROP_POSITION: - SDL_LinkEventMemoryToEvent(event, event->event.drop.source); - SDL_LinkEventMemoryToEvent(event, event->event.drop.data); + SDL_LinkTemporaryMemoryToEvent(event, event->event.drop.source); + SDL_LinkTemporaryMemoryToEvent(event, event->event.drop.data); break; default: if (event->event.type >= SDL_EVENT_USER && event->event.type <= SDL_EVENT_LAST-1) { - SDL_LinkEventMemoryToEvent(event, event->event.user.data1); - SDL_LinkEventMemoryToEvent(event, event->event.user.data2); + SDL_LinkTemporaryMemoryToEvent(event, event->event.user.data1); + SDL_LinkTemporaryMemoryToEvent(event, event->event.user.data2); } break; } } // Transfer the event memory from the event to the thread-local event memory list -static void SDL_TransferEventMemoryFromEvent(SDL_EventEntry *event) +static void SDL_TransferTemporaryMemoryFromEvent(SDL_EventEntry *event) { - SDL_EventMemoryState *state; - SDL_EventMemory *entry, *next; + SDL_TemporaryMemoryState *state; + SDL_TemporaryMemory *entry, *next; if (!event->memory) { return; } - state = SDL_GetEventMemoryState(SDL_TRUE); + state = SDL_GetTemporaryMemoryState(SDL_TRUE); if (!state) { return; // this is now a leak, but you probably have bigger problems if malloc failed. } for (entry = event->memory; entry; entry = next) { next = entry->next; - SDL_LinkEventMemoryEntry(state, entry); + SDL_LinkTemporaryMemoryEntry(state, entry); } event->memory = NULL; } void *SDL_FreeLater(void *memory) { - SDL_EventMemoryState *state; + SDL_TemporaryMemoryState *state; if (memory == NULL) { return NULL; } - state = SDL_GetEventMemoryState(SDL_TRUE); + state = SDL_GetTemporaryMemoryState(SDL_TRUE); if (!state) { return memory; // this is now a leak, but you probably have bigger problems if malloc failed. } - SDL_EventMemory *entry = (SDL_EventMemory *)SDL_malloc(sizeof(*entry)); + SDL_TemporaryMemory *entry = (SDL_TemporaryMemory *)SDL_malloc(sizeof(*entry)); if (!entry) { return memory; // this is now a leak, but you probably have bigger problems if malloc failed. We could probably pool up and reuse entries, though. } entry->memory = memory; - SDL_LinkEventMemoryEntry(state, entry); + SDL_LinkTemporaryMemoryEntry(state, entry); return memory; } -void *SDL_AllocateEventMemory(size_t size) +void *SDL_AllocateTemporaryMemory(size_t size) { return SDL_FreeLater(SDL_malloc(size)); } @@ -298,43 +298,43 @@ const char *SDL_CreateTemporaryString(const char *string) return NULL; } -void *SDL_ClaimEventMemory(const void *mem) +void *SDL_ClaimTemporaryMemory(const void *mem) { - SDL_EventMemoryState *state; + SDL_TemporaryMemoryState *state; - state = SDL_GetEventMemoryState(SDL_FALSE); + state = SDL_GetTemporaryMemoryState(SDL_FALSE); if (state && mem) { - SDL_EventMemory *entry = SDL_GetEventMemoryEntry(state, mem); + SDL_TemporaryMemory *entry = SDL_GetTemporaryMemoryEntry(state, mem); if (entry) { - SDL_UnlinkEventMemoryEntry(state, entry); - SDL_FreeEventMemoryEntry(state, entry, SDL_FALSE); + SDL_UnlinkTemporaryMemoryEntry(state, entry); + SDL_FreeTemporaryMemoryEntry(state, entry, SDL_FALSE); return (void *)mem; } } return NULL; } -void SDL_FreeEventMemory(const void *mem) +void SDL_FreeTemporaryMemory(const void *mem) { - SDL_EventMemoryState *state; + SDL_TemporaryMemoryState *state; - state = SDL_GetEventMemoryState(SDL_FALSE); + state = SDL_GetTemporaryMemoryState(SDL_FALSE); if (!state) { return; } if (mem) { - SDL_EventMemory *entry = SDL_GetEventMemoryEntry(state, mem); + SDL_TemporaryMemory *entry = SDL_GetTemporaryMemoryEntry(state, mem); if (entry) { - SDL_UnlinkEventMemoryEntry(state, entry); - SDL_FreeEventMemoryEntry(state, entry, SDL_TRUE); + SDL_UnlinkTemporaryMemoryEntry(state, entry); + SDL_FreeTemporaryMemoryEntry(state, entry, SDL_TRUE); } } else { while (state->head) { - SDL_EventMemory *entry = state->head; + SDL_TemporaryMemory *entry = state->head; - SDL_UnlinkEventMemoryEntry(state, entry); - SDL_FreeEventMemoryEntry(state, entry, SDL_TRUE); + SDL_UnlinkTemporaryMemoryEntry(state, entry); + SDL_FreeTemporaryMemoryEntry(state, entry, SDL_TRUE); } } } @@ -842,7 +842,7 @@ void SDL_StopEventLoop(void) /* Clean out EventQ */ for (entry = SDL_EventQ.head; entry;) { SDL_EventEntry *next = entry->next; - SDL_TransferEventMemoryFromEvent(entry); + SDL_TransferTemporaryMemoryFromEvent(entry); SDL_free(entry); entry = next; } @@ -859,7 +859,7 @@ void SDL_StopEventLoop(void) SDL_EventQ.free = NULL; SDL_AtomicSet(&SDL_sentinel_pending, 0); - SDL_FreeEventMemory(NULL); + SDL_FreeTemporaryMemory(NULL); /* Clear disabled event state */ for (i = 0; i < SDL_arraysize(SDL_disabled_events); ++i) { @@ -950,7 +950,7 @@ static int SDL_AddEvent(SDL_Event *event) SDL_AtomicAdd(&SDL_sentinel_pending, 1); } entry->memory = NULL; - SDL_TransferEventMemoryToEvent(entry); + SDL_TransferTemporaryMemoryToEvent(entry); if (SDL_EventQ.tail) { SDL_EventQ.tail->next = entry; @@ -978,7 +978,7 @@ static int SDL_AddEvent(SDL_Event *event) /* Remove an event from the queue -- called with the queue locked */ static void SDL_CutEvent(SDL_EventEntry *entry) { - SDL_TransferEventMemoryFromEvent(entry); + SDL_TransferTemporaryMemoryFromEvent(entry); if (entry->prev) { entry->prev->next = entry->next; @@ -1156,7 +1156,7 @@ static void SDL_PumpEventsInternal(SDL_bool push_sentinel) SDL_VideoDevice *_this = SDL_GetVideoDevice(); /* Free old event memory */ - SDL_FreeEventMemory(NULL); + SDL_FreeTemporaryMemory(NULL); /* Release any keys held down from last frame */ SDL_ReleaseAutoReleaseKeys(); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 1a426e0131c44..e7fbd070c9ad2 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -778,7 +778,7 @@ int SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int sel event.common.timestamp = 0; event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; if (num_candidates > 0) { - const char **event_candidates = (const char **)SDL_AllocateEventMemory((num_candidates + 1) * sizeof(*event_candidates)); + const char **event_candidates = (const char **)SDL_AllocateTemporaryMemory((num_candidates + 1) * sizeof(*event_candidates)); if (!event_candidates) { return 0; } diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 0e4c42b081e4b..5d023396aa25c 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -2400,7 +2400,7 @@ const SDL_JoystickID *SDL_GetGamepads(int *count) { int num_joysticks = 0; int num_gamepads = 0; - SDL_JoystickID *joysticks = SDL_ClaimEventMemory(SDL_GetJoysticks(&num_joysticks)); + SDL_JoystickID *joysticks = SDL_ClaimTemporaryMemory(SDL_GetJoysticks(&num_joysticks)); if (joysticks) { int i; for (i = num_joysticks - 1; i >= 0; --i) { diff --git a/test/testautomation_events.c b/test/testautomation_events.c index 77d1770455e57..708289941a169 100644 --- a/test/testautomation_events.c +++ b/test/testautomation_events.c @@ -178,7 +178,7 @@ static int events_addDelEventWatchWithUserdata(void *arg) /** * Creates and validates temporary event memory */ -static int events_eventMemory(void *arg) +static int events_temporaryMemory(void *arg) { SDL_Event event; void *mem, *claimed, *tmp; @@ -186,20 +186,20 @@ static int events_eventMemory(void *arg) { /* Create and claim event memory */ - mem = SDL_AllocateEventMemory(1); - SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + mem = SDL_AllocateTemporaryMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateTemporaryMemory()"); *(char *)mem = '1'; - claimed = SDL_ClaimEventMemory(mem); - SDLTest_AssertCheck(claimed != NULL, "SDL_ClaimEventMemory() returned a valid pointer"); + claimed = SDL_ClaimTemporaryMemory(mem); + SDLTest_AssertCheck(claimed != NULL, "SDL_ClaimTemporaryMemory() returned a valid pointer"); /* Verify that we can't claim it again */ - tmp = SDL_ClaimEventMemory(mem); - SDLTest_AssertCheck(tmp == NULL, "SDL_ClaimEventMemory() can't claim memory twice"); + tmp = SDL_ClaimTemporaryMemory(mem); + SDLTest_AssertCheck(tmp == NULL, "SDL_ClaimTemporaryMemory() can't claim memory twice"); /* Verify that freeing the original pointer does nothing */ - SDL_FreeEventMemory(mem); - SDLTest_AssertCheck(*(char *)mem == '1', "SDL_FreeEventMemory() on claimed memory has no effect"); + SDL_FreeTemporaryMemory(mem); + SDLTest_AssertCheck(*(char *)mem == '1', "SDL_FreeTemporaryMemory() on claimed memory has no effect"); /* Clean up */ SDL_free(claimed); @@ -207,19 +207,19 @@ static int events_eventMemory(void *arg) { /* Create and free event memory */ - mem = SDL_AllocateEventMemory(1); - SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + mem = SDL_AllocateTemporaryMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateTemporaryMemory()"); *(char *)mem = '1'; - SDL_FreeEventMemory(mem); - claimed = SDL_ClaimEventMemory(mem); - SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimEventMemory() can't claim memory after it's been freed"); + SDL_FreeTemporaryMemory(mem); + claimed = SDL_ClaimTemporaryMemory(mem); + SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimTemporaryMemory() can't claim memory after it's been freed"); } { /* Create event memory and queue it */ - mem = SDL_AllocateEventMemory(1); - SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + mem = SDL_AllocateTemporaryMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateTemporaryMemory()"); *(char *)mem = '2'; SDL_zero(event); @@ -228,8 +228,8 @@ static int events_eventMemory(void *arg) SDL_PushEvent(&event); /* Verify that we can't claim the memory once it's on the queue */ - claimed = SDL_ClaimEventMemory(mem); - SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimEventMemory() can't claim memory on the event queue"); + claimed = SDL_ClaimTemporaryMemory(mem); + SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimTemporaryMemory() can't claim memory on the event queue"); /* Get the event and verify the memory is valid */ found = SDL_FALSE; @@ -241,8 +241,8 @@ static int events_eventMemory(void *arg) SDLTest_AssertCheck(found, "SDL_PollEvent() returned queued event"); /* Verify that we can claim the memory now that we've dequeued it */ - claimed = SDL_ClaimEventMemory(mem); - SDLTest_AssertCheck(claimed != NULL, "SDL_ClaimEventMemory() can claim memory after dequeuing event"); + claimed = SDL_ClaimTemporaryMemory(mem); + SDLTest_AssertCheck(claimed != NULL, "SDL_ClaimTemporaryMemory() can claim memory after dequeuing event"); /* Clean up */ SDL_free(claimed); @@ -250,8 +250,8 @@ static int events_eventMemory(void *arg) { /* Create event memory and queue it */ - mem = SDL_AllocateEventMemory(1); - SDLTest_AssertCheck(mem != NULL, "SDL_AllocateEventMemory()"); + mem = SDL_AllocateTemporaryMemory(1); + SDLTest_AssertCheck(mem != NULL, "SDL_AllocateTemporaryMemory()"); *(char *)mem = '3'; SDL_zero(event); @@ -270,8 +270,8 @@ static int events_eventMemory(void *arg) /* Verify that pumping the event loop frees event memory */ SDL_PumpEvents(); - claimed = SDL_ClaimEventMemory(mem); - SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimEventMemory() can't claim memory after pumping the event loop"); + claimed = SDL_ClaimTemporaryMemory(mem); + SDLTest_AssertCheck(claimed == NULL, "SDL_ClaimTemporaryMemory() can't claim memory after pumping the event loop"); } return TEST_COMPLETED; @@ -292,13 +292,13 @@ static const SDLTest_TestCaseReference eventsTest3 = { (SDLTest_TestCaseFp)events_addDelEventWatchWithUserdata, "events_addDelEventWatchWithUserdata", "Adds and deletes an event watch function with userdata", TEST_ENABLED }; -static const SDLTest_TestCaseReference eventsTestEventMemory = { - (SDLTest_TestCaseFp)events_eventMemory, "events_eventMemory", "Creates and validates temporary event memory", TEST_ENABLED +static const SDLTest_TestCaseReference eventsTestTemporaryMemory = { + (SDLTest_TestCaseFp)events_temporaryMemory, "events_temporaryMemory", "Creates and validates temporary event memory", TEST_ENABLED }; /* Sequence of Events test cases */ static const SDLTest_TestCaseReference *eventsTests[] = { - &eventsTest1, &eventsTest2, &eventsTest3, &eventsTestEventMemory, NULL + &eventsTest1, &eventsTest2, &eventsTest3, &eventsTestTemporaryMemory, NULL }; /* Events test suite (global) */ From 68322ac85199ec2d01c5ff099f2ceefcf7fcca95 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 09:50:54 -0700 Subject: [PATCH 409/431] Ensure that all functions that follow the SDL_GetStringRule return temporary memory --- include/SDL3/SDL_pixels.h | 2 -- include/SDL3/SDL_platform.h | 2 -- include/SDL3/SDL_version.h | 2 -- src/SDL.c | 3 +-- src/audio/SDL_audio.c | 6 ++---- src/camera/SDL_camera.c | 6 ++---- src/core/android/SDL_android.c | 9 +++------ src/events/SDL_keymap.c | 8 +++----- src/filesystem/winrt/SDL_sysfilesystem.cpp | 3 +-- src/render/SDL_render.c | 3 +-- src/video/SDL_pixels.c | 1 - src/video/SDL_video.c | 6 ++---- 12 files changed, 15 insertions(+), 36 deletions(-) diff --git a/include/SDL3/SDL_pixels.h b/include/SDL3/SDL_pixels.h index b87b6f733a8c6..851d5950f95d7 100644 --- a/include/SDL3/SDL_pixels.h +++ b/include/SDL3/SDL_pixels.h @@ -723,8 +723,6 @@ typedef struct SDL_PixelFormatDetails /** * Get the human readable name of a pixel format. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. - * * \param format the pixel format to query. * \returns the human readable name of the specified pixel format or * "SDL_PIXELFORMAT_UNKNOWN" if the format isn't recognized. diff --git a/include/SDL3/SDL_platform.h b/include/SDL3/SDL_platform.h index a811a6561b28c..bfdfa3a414c67 100644 --- a/include/SDL3/SDL_platform.h +++ b/include/SDL3/SDL_platform.h @@ -48,8 +48,6 @@ extern "C" { * - "iOS" * - "Android" * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. - * * \returns the name of the platform. If the correct platform name is not * available, returns a string beginning with the text "Unknown". * diff --git a/include/SDL3/SDL_version.h b/include/SDL3/SDL_version.h index 516b66ade2b2d..c0f518d4a3ee6 100644 --- a/include/SDL3/SDL_version.h +++ b/include/SDL3/SDL_version.h @@ -163,8 +163,6 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetVersion(void); * You shouldn't use this function for anything but logging it for debugging * purposes. The string is not intended to be reliable in any way. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. - * * \returns an arbitrary string, uniquely identifying the exact revision of * the SDL library in use. * diff --git a/src/SDL.c b/src/SDL.c index 8b76ef2744dc2..43bd2c576b5da 100644 --- a/src/SDL.c +++ b/src/SDL.c @@ -601,11 +601,10 @@ int SDL_GetVersion(void) /* Get the library source revision */ const char *SDL_GetRevision(void) { - return SDL_REVISION; // a string literal, no need to SDL_FreeLater it. + return SDL_REVISION; } // Get the name of the platform -// (a string literal, no need to SDL_FreeLater it.) const char *SDL_GetPlatform(void) { #if defined(SDL_PLATFORM_AIX) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index dd6037d279373..3253956c167d7 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -131,19 +131,17 @@ int SDL_GetNumAudioDrivers(void) return num_drivers; } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetAudioDriver(int index) { if (index >= 0 && index < SDL_GetNumAudioDrivers()) { - return deduped_bootstrap[index]->name; + return SDL_CreateTemporaryString(deduped_bootstrap[index]->name); } return NULL; } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetCurrentAudioDriver(void) { - return current_audio.name; + return SDL_CreateTemporaryString(current_audio.name); } static int GetDefaultSampleFramesFromFreq(const int freq) diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index ae1b1f9285664..0247e660f49ed 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -63,19 +63,17 @@ int SDL_GetNumCameraDrivers(void) return SDL_arraysize(bootstrap) - 1; } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetCameraDriver(int index) { if (index >= 0 && index < SDL_GetNumCameraDrivers()) { - return bootstrap[index]->name; + return SDL_CreateTemporaryString(bootstrap[index]->name); } return NULL; } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetCurrentCameraDriver(void) { - return camera_driver.name; + return SDL_CreateTemporaryString(camera_driver.name); } char *SDL_GetCameraThreadName(SDL_Camera *device, char *buf, size_t buflen) diff --git a/src/core/android/SDL_android.c b/src/core/android/SDL_android.c index b97c8c4a962ef..6f5e5ec6a8a3a 100644 --- a/src/core/android/SDL_android.c +++ b/src/core/android/SDL_android.c @@ -2452,7 +2452,6 @@ void SDL_SendAndroidBackButton(void) (*env)->CallStaticVoidMethod(env, mActivityClass, midManualBackButton); } -// this caches a string until the process ends, so there's no need to use SDL_FreeLater. const char *SDL_GetAndroidInternalStoragePath(void) { static char *s_AndroidInternalFilesPath = NULL; @@ -2504,7 +2503,7 @@ const char *SDL_GetAndroidInternalStoragePath(void) LocalReferenceHolder_Cleanup(&refs); } - return s_AndroidInternalFilesPath; + return SDL_CreateTemporaryString(s_AndroidInternalFilesPath); } Uint32 SDL_GetAndroidExternalStorageState(void) @@ -2547,7 +2546,6 @@ Uint32 SDL_GetAndroidExternalStorageState(void) return stateFlags; } -// this caches a string until the process ends, so there's no need to use SDL_FreeLater. const char *SDL_GetAndroidExternalStoragePath(void) { static char *s_AndroidExternalFilesPath = NULL; @@ -2590,10 +2588,9 @@ const char *SDL_GetAndroidExternalStoragePath(void) LocalReferenceHolder_Cleanup(&refs); } - return s_AndroidExternalFilesPath; + return SDL_CreateTemporaryString(s_AndroidExternalFilesPath); } -// this caches a string until the process ends, so there's no need to use SDL_FreeLater. const char *SDL_GetAndroidCachePath(void) { // !!! FIXME: lots of duplication with SDL_GetAndroidExternalStoragePath and SDL_GetAndroidInternalStoragePath; consolidate these functions! @@ -2637,7 +2634,7 @@ const char *SDL_GetAndroidCachePath(void) LocalReferenceHolder_Cleanup(&refs); } - return s_AndroidCachePath; + return SDL_CreateTemporaryString(s_AndroidCachePath); } int SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset) diff --git a/src/events/SDL_keymap.c b/src/events/SDL_keymap.c index c0ab8a16a8bd1..cfa5b213e9029 100644 --- a/src/events/SDL_keymap.c +++ b/src/events/SDL_keymap.c @@ -945,7 +945,6 @@ int SDL_SetScancodeName(SDL_Scancode scancode, const char *name) return 0; } -// these are static memory, so we don't use SDL_FreeLater on them. const char *SDL_GetScancodeName(SDL_Scancode scancode) { const char *name; @@ -955,11 +954,10 @@ const char *SDL_GetScancodeName(SDL_Scancode scancode) } name = SDL_scancode_names[scancode]; - if (name) { - return name; + if (!name) { + name = ""; } - - return ""; + return SDL_CreateTemporaryString(name); } SDL_Scancode SDL_GetScancodeFromName(const char *name) diff --git a/src/filesystem/winrt/SDL_sysfilesystem.cpp b/src/filesystem/winrt/SDL_sysfilesystem.cpp index fce36504832fa..04dacd55fe8d1 100644 --- a/src/filesystem/winrt/SDL_sysfilesystem.cpp +++ b/src/filesystem/winrt/SDL_sysfilesystem.cpp @@ -97,7 +97,6 @@ static const wchar_t *SDL_GetWinRTFSPathUNICODE(SDL_WinRT_Path pathType) return NULL; } -// this caches a string until the process ends, so there's no need to use SDL_FreeLater. extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType) { typedef unordered_map UTF8PathMap; @@ -116,7 +115,7 @@ extern "C" const char *SDL_GetWinRTFSPath(SDL_WinRT_Path pathType) char *utf8Path = WIN_StringToUTF8W(ucs2Path); utf8Paths[pathType] = utf8Path; SDL_free(utf8Path); - return utf8Paths[pathType].c_str(); + return SDL_CreateTemporaryString(utf8Paths[pathType].c_str()); } extern "C" char *SDL_SYS_GetBasePath(void) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index ed6d6ad0aee2e..1f44e833a0b40 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -799,7 +799,6 @@ int SDL_GetNumRenderDrivers(void) #endif } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetRenderDriver(int index) { #ifndef SDL_RENDER_DISABLED @@ -808,7 +807,7 @@ const char *SDL_GetRenderDriver(int index) SDL_GetNumRenderDrivers() - 1); return NULL; } - return render_drivers[index]->name; + return SDL_CreateTemporaryString(render_drivers[index]->name); #else SDL_SetError("SDL not built with rendering support"); return NULL; diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index 903a62be999c4..34c0f35f7d67f 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -88,7 +88,6 @@ SDL_COMPILE_TIME_ASSERT(SDL_expand_byte_10_size, SDL_arraysize(SDL_expand_byte_1 /* Helper functions */ -// This doesn't need SDL_FreeLater since it returns string literals. #define CASE(X) \ case X: \ return #X; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 8f4ea4910b461..70c3660537003 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -515,11 +515,10 @@ int SDL_GetNumVideoDrivers(void) return SDL_arraysize(bootstrap) - 1; } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetVideoDriver(int index) { if (index >= 0 && index < SDL_GetNumVideoDrivers()) { - return bootstrap[index]->name; + return SDL_CreateTemporaryString(bootstrap[index]->name); } return NULL; } @@ -657,14 +656,13 @@ int SDL_VideoInit(const char *driver_name) return -1; } -// this returns string literals, so there's no need to use SDL_FreeLater. const char *SDL_GetCurrentVideoDriver(void) { if (!_this) { SDL_UninitializedVideo(); return NULL; } - return _this->name; + return SDL_CreateTemporaryString(_this->name); } SDL_VideoDevice *SDL_GetVideoDevice(void) From 71a60d4c0e43cf94c9763dafedb009ee19db33ce Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 10:54:27 -0700 Subject: [PATCH 410/431] Updated documentation for functions that return temporary memory --- docs/README-strings.md | 59 ----------------------------------- include/SDL3/SDL_audio.h | 16 +++++----- include/SDL3/SDL_camera.h | 10 +++--- include/SDL3/SDL_clipboard.h | 4 +-- include/SDL3/SDL_error.h | 6 ++-- include/SDL3/SDL_events.h | 18 +++++------ include/SDL3/SDL_filesystem.h | 8 ++--- include/SDL3/SDL_gamepad.h | 30 +++++++++--------- include/SDL3/SDL_guid.h | 2 +- include/SDL3/SDL_haptic.h | 6 ++-- include/SDL3/SDL_hints.h | 2 +- include/SDL3/SDL_joystick.h | 12 +++---- include/SDL3/SDL_keyboard.h | 8 ++--- include/SDL3/SDL_locale.h | 2 +- include/SDL3/SDL_mouse.h | 4 +-- include/SDL3/SDL_pen.h | 2 +- include/SDL3/SDL_properties.h | 2 +- include/SDL3/SDL_render.h | 4 +-- include/SDL3/SDL_sensor.h | 4 +-- include/SDL3/SDL_storage.h | 2 +- include/SDL3/SDL_system.h | 8 ++--- include/SDL3/SDL_thread.h | 2 +- include/SDL3/SDL_touch.h | 4 +-- include/SDL3/SDL_video.h | 16 +++++----- 24 files changed, 85 insertions(+), 146 deletions(-) delete mode 100644 docs/README-strings.md diff --git a/docs/README-strings.md b/docs/README-strings.md deleted file mode 100644 index 58d94f9270af4..0000000000000 --- a/docs/README-strings.md +++ /dev/null @@ -1,59 +0,0 @@ -# String policies in SDL3. - -## Encoding. - -Unless otherwise specified, all strings in SDL, across all platforms, are -UTF-8 encoded and can represent the full range of [Unicode](https://unicode.org). - - -## The SDL Get String Rule. - -Did you see 'SDL_GetStringRule' in the wiki or headers? Here are the details -that aren't worth copying across dozens of functions' documentation. - -tl;dr: If an SDL function returns a `const char *` string, do not modify or -free it, and if you need to save it, make a copy right away. - -In several cases, SDL wants to return a string to the app, and the question -in any library that does this is: _who owns this thing?_ - -The answer in almost all cases, is that SDL does, but not for long. - -The pointer is only guaranteed to be valid until the next time the event -queue is updated, or SDL_Quit is called. - -The reason for this is memory safety. - -There are several strings that SDL provides that could be freed at -any moment. For example, an app calls SDL_GetAudioDeviceName(), which returns -a string that is part of the internal audio device structure. But, while this -function is returning, the user yanks the USB audio device out of the -computer, and SDL decides to deallocate the structure...and the string! -Now the app is holding a pointer that didn't live long enough to be useful, -and could crash if accessed. - -To avoid this, instead of calling SDL_free on a string as soon as it's done -with it, SDL adds the pointer to a list. This list is freed at specific -points: when the event queue is run (for ongoing cleanup) and when SDL_Quit -is called (to catch things that are just hanging around). This allows the -app to use a string without worrying about it becoming bogus in the middle -of a printf() call. If the app needs it for longer, it should copy it. - -When does "the event queue run"? There are several points: - -- If the app calls SDL_PumpEvents() _from any thread_. -- SDL_PumpEvents is also called by several other APIs internally: - SDL_PollEvent(), SDL_PeepEvents(), SDL_WaitEvent(), - SDL_WaitEventTimeout(), and maybe others. -- If you are using [the main callbacks](main-functions#main-callbacks-in-sdl3), - the event queue can run immediately after any of the callback functions - return. - -Note that these are just guaranteed minimum lifespans; any given string -might live much longer--some might even be static memory that is _never_ -deallocated--but this rule promises that the app has a safe window. - -Note that none of this applies if the return value is `char *` instead of -`const char *`. Please see the specific function's documentation for how -to handle those pointers. - diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index 72563c2a9a961..c7966376602f9 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -400,7 +400,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); * "coreaudio" or "wasapi". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of the audio driver; the value ranges from 0 to * SDL_GetNumAudioDrivers() - 1. @@ -423,7 +423,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDriver(int index); * "coreaudio" or "wasapi". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the name of the current audio driver or NULL if no driver has been * initialized. @@ -448,7 +448,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentAudioDriver(void); * If this function returns NULL, to signify an error, `*count` will be set to * zero. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of devices returned, may be NULL. * \returns a 0 terminated array of device instance IDs or NULL on error; call SDL_GetError() for more @@ -477,7 +477,7 @@ extern SDL_DECLSPEC const SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackDevice * If this function returns NULL, to signify an error, `*count` will be set to * zero. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of devices returned, may be NULL. * \returns a 0 terminated array of device instance IDs, or NULL on failure; call SDL_GetError() for more @@ -495,7 +495,7 @@ extern SDL_DECLSPEC const SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevic /** * Get the human-readable name of a specific audio device. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param devid the instance ID of the device to query. * \returns the name of the audio device, or NULL on failure; call @@ -555,7 +555,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid * Audio devices usually have no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param devid the instance ID of the device to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -1105,7 +1105,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, * Audio streams default to no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -1130,7 +1130,7 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_Au * Audio streams default to no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 04db2eabff740..0f3abbbc720e9 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -134,7 +134,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void); * "coremedia" or "android". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of the camera driver; the value ranges from 0 to * SDL_GetNumCameraDrivers() - 1. @@ -156,7 +156,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDriver(int index); * "coremedia" or "android". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the name of the current camera driver or NULL if no driver has * been initialized. @@ -170,7 +170,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void); /** * Get a list of currently connected camera devices. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of cameras returned, may be * NULL. @@ -207,7 +207,7 @@ extern SDL_DECLSPEC const SDL_CameraID * SDLCALL SDL_GetCameras(int *count); * _is_ a camera until the user has given you permission to check through a * scary warning popup. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param devid the camera device instance ID to query. * \param count a pointer filled in with the number of elements in the list, may be NULL. @@ -226,7 +226,7 @@ extern SDL_DECLSPEC const SDL_CameraSpec * const * SDLCALL SDL_GetCameraSupporte /** * Get the human-readable device name for a camera. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the camera device instance ID. * \returns a human-readable device name or NULL on failure; call diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index 504f75ffcc590..a1690f080a32f 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -62,7 +62,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); * This functions returns empty string if there was not enough memory left for * a copy of the clipboard's content. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the clipboard text on success or an empty string on failure; call * SDL_GetError() for more information. @@ -106,7 +106,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); * This functions returns empty string if there was not enough memory left for * a copy of the primary selection's content. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the primary selection text on success or an empty string on * failure; call SDL_GetError() for more information. diff --git a/include/SDL3/SDL_error.h b/include/SDL3/SDL_error.h index 141b8deee979b..4c75829dde735 100644 --- a/include/SDL3/SDL_error.h +++ b/include/SDL3/SDL_error.h @@ -96,10 +96,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_OutOfMemory(void); * Error strings are set per-thread, so an error set in a different thread * will not interfere with the current thread's operation. * - * The returned string does **NOT** follow the SDL_GetStringRule! The pointer - * is valid until the current thread's error string is changed, so the caller - * should make a copy if the string is to be used after calling into SDL - * again. + * The returned value is a thread-local string which will remain valid until the current thread's error string is changed. The caller + * should make a copy if the value is needed after the next SDL API call. * * \returns a message with information about the specific error that occurred, * or an empty string if there hasn't been an error message set since diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 2ee69991d5c0a..54945d3512f26 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -350,7 +350,7 @@ typedef struct SDL_KeyboardEvent * will be inserted into the editing text. The length is the number of UTF-8 * characters that will be replaced by new typing. * - * The text string follows the SDL_GetStringRule, and will be automatically freed later. + * The text string is temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This struct is available since SDL 3.0.0. */ @@ -368,7 +368,7 @@ typedef struct SDL_TextEditingEvent /** * Keyboard IME candidates event structure (event.edit_candidates.*) * - * The candidates follow the SDL_GetStringRule, and will be automatically freed later. + * The candidates are temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This struct is available since SDL 3.0.0. */ @@ -387,7 +387,7 @@ typedef struct SDL_TextEditingCandidatesEvent /** * Keyboard text input event structure (event.text.*) * - * The text string follows the SDL_GetStringRule, and will be automatically freed later. + * The text string is temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * This event will never be delivered unless text input is enabled by calling * SDL_StartTextInput(). Text input is disabled by default! @@ -784,7 +784,7 @@ typedef struct SDL_PenButtonEvent * An event used to drop text or request a file open by the system * (event.drop.*) * - * The source and data strings follow the SDL_GetStringRule, and will be automatically freed later. + * The source and data strings are temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This struct is available since SDL 3.0.0. */ @@ -1425,9 +1425,9 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); extern SDL_DECLSPEC void * SDLCALL SDL_AllocateTemporaryMemory(size_t size); /** - * Claim ownership of temporary memory allocated by SDL. + * Claim ownership of temporary memory. * - * This function changes ownership of temporary memory allocated for events and APIs that + * This function changes ownership of temporary memory allocated for events and functions that * return temporary memory. If this function succeeds, the memory will no longer be automatically freed by SDL, it must be freed using SDL_free() by the application. * * If the memory isn't temporary, or it was allocated on a different thread, or if it is associated with an event currently in the event queue, this will return NULL, and the application does not have ownership of the memory. @@ -1445,10 +1445,10 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateTemporaryMemory(size_t size); extern SDL_DECLSPEC void * SDLCALL SDL_ClaimTemporaryMemory(const void *mem); /** - * Free temporary memory allocated by SDL. + * Free temporary memory. * - * This function frees temporary memory allocated for events and APIs that - * follow the SDL_GetStringRule. This memory is local to the thread that creates + * This function frees temporary memory allocated for events and functions that + * return temporary memory. This memory is local to the thread that creates * it and is automatically freed for the main thread when processing events. * For other threads you may call this function periodically to * free any temporary memory created by that thread. diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index b3077b6046ed4..9c163ca544e43 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -68,7 +68,7 @@ extern "C" { * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns an absolute path in UTF-8 encoding to the application data * directory. NULL will be returned on error or when the platform @@ -123,7 +123,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetBasePath(void); * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param org the name of your organization. * \param app the name of your application. @@ -223,7 +223,7 @@ typedef enum SDL_Folder * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * If NULL is returned, the error may be obtained with SDL_GetError(). * @@ -354,7 +354,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * The returned pointer follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param path the path of the directory to enumerate. * \param pattern the pattern that files in the directory must match. Can be diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 06b259465aa41..ac446d67c6abc 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -389,7 +389,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void); /** * Get the current gamepad mappings. * - * The returned pointer follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of mappings returned, can * be NULL. @@ -403,7 +403,7 @@ extern SDL_DECLSPEC const char * const * SDLCALL SDL_GetGamepadMappings(int *cou /** * Get the gamepad mapping string for a given GUID. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param guid a structure containing the GUID for which a mapping is desired. * \returns a mapping string or NULL on failure; call SDL_GetError() for more @@ -419,7 +419,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_GUID g /** * Get the current mapping of a gamepad. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * Details about mappings are discussed with SDL_AddGamepadMapping(). * @@ -468,7 +468,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void); /** * Get a list of currently connected gamepads. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of gamepads returned, may be NULL. * \returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for @@ -500,7 +500,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); * * This can be called before any gamepads are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the name of the selected gamepad. If no name can be found, this @@ -518,7 +518,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID * * This can be called before any gamepads are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the path of the selected gamepad. If no path can be found, this @@ -651,7 +651,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_Joys * * This can be called before any gamepads are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the mapping string. Returns NULL if no mapping is available. @@ -750,7 +750,7 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad /** * Get the implementation-dependent name for an opened gamepad. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). @@ -766,7 +766,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad /** * Get the implementation-dependent path for an opened gamepad. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). @@ -893,7 +893,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *ga * * Returns the serial number of the gamepad, or NULL if it is not available. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad the gamepad object to query. * \returns the serial number, or NULL if unavailable. @@ -1053,7 +1053,7 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const c /** * Convert from an SDL_GamepadType enum to a string. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param type an enum value for a given SDL_GamepadType. * \returns a string for the given type, or NULL if an invalid type is @@ -1091,7 +1091,7 @@ extern SDL_DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const c /** * Convert from an SDL_GamepadAxis enum to a string. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param axis an enum value for a given SDL_GamepadAxis. * \returns a string for the given axis, or NULL if an invalid axis is @@ -1166,7 +1166,7 @@ extern SDL_DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(con /** * Convert from an SDL_GamepadButton enum to a string. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param button an enum value for a given SDL_GamepadButton. * \returns a string for the given button, or NULL if an invalid button is @@ -1454,7 +1454,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad); * Return the sfSymbolsName for a given button on a gamepad on Apple * platforms. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad the gamepad to query. * \param button a button on the gamepad. @@ -1469,7 +1469,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButt /** * Return the sfSymbolsName for a given axis on a gamepad on Apple platforms. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad the gamepad to query. * \param axis an axis on the gamepad. diff --git a/include/SDL3/SDL_guid.h b/include/SDL3/SDL_guid.h index 3836a020b8bd4..40a7465ec4d77 100644 --- a/include/SDL3/SDL_guid.h +++ b/include/SDL3/SDL_guid.h @@ -66,7 +66,7 @@ typedef struct SDL_GUID { /** * Get an ASCII string representation for a given SDL_GUID. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param guid the SDL_GUID you wish to convert to string. * \returns the string representation of the GUID or NULL on failure; call diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 058541cb96c40..e9d32bbae2c44 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -931,7 +931,7 @@ typedef Uint32 SDL_HapticID; /** * Get a list of currently connected haptic devices. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of haptic devices * returned, may be NULL. @@ -949,7 +949,7 @@ extern SDL_DECLSPEC const SDL_HapticID * SDLCALL SDL_GetHaptics(int *count); * * This can be called before any haptic devices are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the haptic device instance ID. * \returns the name of the selected haptic device. If no name can be found, @@ -1014,7 +1014,7 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic); /** * Get the implementation dependent name of a haptic device. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param haptic the SDL_Haptic obtained from SDL_OpenJoystick(). * \returns the name of the selected haptic device. If no name can be found, diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index bd96fd6af3c5d..58cb8ebe65b39 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -3883,7 +3883,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); /** * Get the value of a hint. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index f6f003a080e82..f999561c67f36 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -201,7 +201,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); /** * Get a list of currently connected joysticks. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of joysticks returned, may be NULL. * \returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for @@ -219,7 +219,7 @@ extern SDL_DECLSPEC const SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count); * * This can be called before any joysticks are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the name of the selected joystick. If no name can be found, this @@ -237,7 +237,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID * * This can be called before any joysticks are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the path of the selected joystick. If no path can be found, this @@ -658,7 +658,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst /** * Get the implementation dependent name of a joystick. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the name of the selected joystick. If no name can be found, this @@ -673,7 +673,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *joyst /** * Get the implementation dependent path of a joystick. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the path of the selected joystick. If no path can be found, this @@ -792,7 +792,7 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick * * * Returns the serial number of the joystick, or NULL if it is not available. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the serial number of the selected joystick, or NULL if diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index f8c5067f1b4d2..70f9fdfde65d7 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -73,7 +73,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * power buttons, etc. You should wait for input from a device before you * consider it actively in use. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of keyboards returned, may be NULL. * \returns a 0 terminated array of keyboards instance IDs or NULL on failure; call SDL_GetError() for @@ -91,7 +91,7 @@ extern SDL_DECLSPEC const SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count); * * This function returns "" if the keyboard doesn't have a name. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the keyboard instance ID. * \returns the name of the selected keyboard or NULL on failure; call @@ -281,7 +281,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const /** * Get a human-readable name for a scancode. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * **Warning**: The returned name is by design not stable across platforms, * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left @@ -327,7 +327,7 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam * * If the key doesn't have a name, this function returns an empty string (""). * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param key the desired SDL_Keycode to query. * \returns a UTF-8 encoded string of the key name. diff --git a/include/SDL3/SDL_locale.h b/include/SDL3/SDL_locale.h index 784841a3bfadc..ec80f6dbb3149 100644 --- a/include/SDL3/SDL_locale.h +++ b/include/SDL3/SDL_locale.h @@ -94,7 +94,7 @@ typedef struct SDL_Locale * if possible, and you can call this function again to get an updated copy of * preferred locales. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of locales returned, may * be NULL. diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index abcedc30cbd57..1a8bcce9d046e 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -135,7 +135,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * You should wait for input from a device before you consider it actively in * use. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of mice returned, may be NULL. * \returns a 0 terminated array of mouse instance IDs or NULL on failure; call SDL_GetError() for more @@ -153,7 +153,7 @@ extern SDL_DECLSPEC const SDL_MouseID * SDLCALL SDL_GetMice(int *count); * * This function returns "" if the mouse doesn't have a name. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the mouse instance ID. * \returns the name of the selected mouse, or NULL on failure; call diff --git a/include/SDL3/SDL_pen.h b/include/SDL3/SDL_pen.h index b11f6960899ea..899c3e3391463 100644 --- a/include/SDL3/SDL_pen.h +++ b/include/SDL3/SDL_pen.h @@ -224,7 +224,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); /** * Retrieves a human-readable description for a SDL_PenID. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the pen to query. * \returns a string that contains the name of the pen, intended for human diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index cd11eeedf4be6..c466b7404344b 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -378,7 +378,7 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props /** * Get a string property from a group of properties. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param props the properties to query. * \param name the name of the property to query. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index bfff4534ebc81..b3dfc8a9933cd 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -154,7 +154,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); * "direct3d12" or "metal". These never have Unicode characters, and are not * meant to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of the rendering driver; the value ranges from 0 to * SDL_GetNumRenderDrivers() - 1. @@ -324,7 +324,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetRenderWindow(SDL_Renderer *rende /** * Get the name of a renderer. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param renderer the rendering context. * \returns the name of the selected renderer, or NULL on failure; call SDL_GetError() for more information. diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 2743f3734b7f8..9984566111de6 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -159,7 +159,7 @@ extern SDL_DECLSPEC const SDL_SensorID * SDLCALL SDL_GetSensors(int *count); * * This can be called before any sensors are opened. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the sensor instance ID. * \returns the sensor name, or NULL if `instance_id` is not valid. @@ -228,7 +228,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor /** * Get the implementation dependent name of a sensor. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param sensor the SDL_Sensor object. * \returns the sensor name or NULL on failure; call SDL_GetError() for more information. diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index 0fa24a20fe03d..6f2308fc3ddb5 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -383,7 +383,7 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * The returned pointer follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param storage a storage container. * \param path the path of the directory to enumerate. diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index 01561551c3a4b..cf88a029f9029 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -407,7 +407,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); * * https://developer.android.com/reference/android/content/Context#getFilesDir() * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the path used for internal storage or NULL on failure; call * SDL_GetError() for more information. @@ -448,7 +448,7 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void); * * https://developer.android.com/reference/android/content/Context#getExternalFilesDir() * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the path used for external storage for this application on success * or NULL on failure; call SDL_GetError() for more information. @@ -471,7 +471,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void) * * https://developer.android.com/reference/android/content/Context#getCacheDir() * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the path used for caches for this application on success or NULL * on failure; call SDL_GetError() for more information. @@ -625,7 +625,7 @@ typedef enum SDL_WinRT_DeviceFamily * * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param pathType the type of path to retrieve, one of SDL_WinRT_Path. * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 7bf7b1849a848..7048cbb070a8c 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -330,7 +330,7 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S /** * Get the thread name as it was specified in SDL_CreateThread(). * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param thread the thread to query. * \returns a pointer to a UTF-8 string that names the specified thread, or diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index 808a69ea437b8..58e6cd0e56784 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -83,7 +83,7 @@ typedef struct SDL_Finger * Therefore the returned list might be empty, although devices are available. * After using all devices at least once the number will be correct. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of devices returned, may * be NULL. @@ -97,7 +97,7 @@ extern SDL_DECLSPEC const SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count); /** * Get the touch device name as reported from the driver. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param touchID the touch device instance ID. * \returns touch device name, or NULL on failure; call SDL_GetError() for more diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index af7d52a9bab19..b1203528d1a42 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -349,7 +349,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); * "x11" or "windows". These never have Unicode characters, and are not meant * to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of a video driver. * \returns the name of the video driver with the given **index**. @@ -367,7 +367,7 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetVideoDriver(int index); * "x11" or "windows". These never have Unicode characters, and are not meant * to be proper names. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the name of the current video driver or NULL if no driver has been * initialized. @@ -391,7 +391,7 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); /** * Get a list of currently connected displays. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of displays returned, may * be NULL. @@ -446,7 +446,7 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_Displa /** * Get the name of a display in UTF-8 encoding. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param displayID the instance ID of the display to query. * \returns the name of a display or NULL on failure; call SDL_GetError() for @@ -555,7 +555,7 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displ * - refresh rate -> highest to lowest * - pixel density -> lowest to highest * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param displayID the instance ID of the display to query. * \param count a pointer filled in with the number of display modes returned, may be NULL. @@ -767,7 +767,7 @@ extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode( /** * Get the raw ICC profile data for the screen the window is currently on. * - * The returned data follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param window the window to query. * \param size the size of the ICC profile. @@ -793,7 +793,7 @@ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window /** * Get a list of valid windows. * - * The returned array follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of windows returned, may * be NULL. @@ -1306,7 +1306,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const cha /** * Get the title of a window. * - * The returned string follows the SDL_GetStringRule, and will be automatically freed later. + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \param window the window to query. * \returns the title of the window in UTF-8 format or "" if there is no From bebde1c4c94157c964d122e22e3fbe8273e79ce6 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 12:06:30 -0700 Subject: [PATCH 411/431] Make sure we're not trying to add temporary memory twice --- src/events/SDL_events.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c index 9f7c70cfda3e9..52da44e730a04 100644 --- a/src/events/SDL_events.c +++ b/src/events/SDL_events.c @@ -268,6 +268,9 @@ void *SDL_FreeLater(void *memory) return NULL; } + // Make sure we're not adding this to the list twice + SDL_assert(!SDL_ClaimTemporaryMemory(memory)); + state = SDL_GetTemporaryMemoryState(SDL_TRUE); if (!state) { return memory; // this is now a leak, but you probably have bigger problems if malloc failed. From a340de6196b43fb8ae22e962c5474b896a47423a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 12:07:19 -0700 Subject: [PATCH 412/431] The candidates in SDL_EVENT_TEXT_EDITING_CANDIDATES should be a single allocation --- src/events/SDL_keyboard.c | 37 ++++++++++++++++++++++++++++++++----- test/testime.c | 29 ++++++++--------------------- 2 files changed, 40 insertions(+), 26 deletions(-) diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index e7fbd070c9ad2..8c4c7c45bcc42 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -760,6 +760,37 @@ int SDL_SendEditingText(const char *text, int start, int length) return posted; } +static const char * const *CreateCandidatesForEvent(char **candidates, int num_candidates) +{ + const char **event_candidates; + int i; + char *ptr; + size_t total_length = (num_candidates + 1) * sizeof(*event_candidates); + + for (i = 0; i < num_candidates; ++i) { + size_t length = SDL_strlen(candidates[i]) + 1; + + total_length += length; + } + + event_candidates = (const char **)SDL_malloc(total_length); + if (!event_candidates) { + return NULL; + } + ptr = (char *)(event_candidates + (num_candidates + 1)); + + for (i = 0; i < num_candidates; ++i) { + size_t length = SDL_strlen(candidates[i]) + 1; + + event_candidates[i] = ptr; + SDL_memcpy(ptr, candidates[i], length); + ptr += length; + } + event_candidates[i] = NULL; + + return SDL_FreeLater(event_candidates); +} + int SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int selected_candidate, SDL_bool horizontal) { SDL_Keyboard *keyboard = &SDL_keyboard; @@ -778,14 +809,10 @@ int SDL_SendEditingTextCandidates(char **candidates, int num_candidates, int sel event.common.timestamp = 0; event.edit.windowID = keyboard->focus ? keyboard->focus->id : 0; if (num_candidates > 0) { - const char **event_candidates = (const char **)SDL_AllocateTemporaryMemory((num_candidates + 1) * sizeof(*event_candidates)); + const char * const *event_candidates = CreateCandidatesForEvent(candidates, num_candidates); if (!event_candidates) { return 0; } - for (int i = 0; i < num_candidates; ++i) { - event_candidates[i] = SDL_CreateTemporaryString(candidates[i]); - } - event_candidates[num_candidates] = NULL; event.edit_candidates.candidates = event_candidates; event.edit_candidates.num_candidates = num_candidates; event.edit_candidates.selected_candidate = selected_candidate; diff --git a/test/testime.c b/test/testime.c index 1427ba5e57633..a49b6ebff1410 100644 --- a/test/testime.c +++ b/test/testime.c @@ -53,7 +53,7 @@ static int cursor_length = 0; static SDL_bool cursor_visible; static Uint64 last_cursor_change; static SDL_BlendMode highlight_mode; -static char **candidates; +static const char **candidates; static int num_candidates; static int selected_candidate; static SDL_bool horizontal_candidates; @@ -431,7 +431,7 @@ static char *utf8_advance(char *p, size_t distance) } #endif -static Uint32 utf8_decode(char *p, size_t len) +static Uint32 utf8_decode(const char *p, size_t len) { Uint32 codepoint = 0; size_t i = 0; @@ -476,11 +476,6 @@ static void InitInput(void) static void ClearCandidates(void) { - int i; - - for (i = 0; i < num_candidates; ++i) { - SDL_free(candidates[i]); - } SDL_free(candidates); candidates = NULL; num_candidates = 0; @@ -488,20 +483,12 @@ static void ClearCandidates(void) static void SaveCandidates(SDL_Event *event) { - int i; - ClearCandidates(); num_candidates = event->edit_candidates.num_candidates; if (num_candidates > 0) { - candidates = (char **)SDL_malloc(num_candidates * sizeof(*candidates)); - if (!candidates) { - num_candidates = 0; - return; - } - for (i = 0; i < num_candidates; ++i) { - candidates[i] = SDL_strdup(event->edit_candidates.candidates[i]); - } + candidates = (const char **)SDL_ClaimTemporaryMemory(event->edit_candidates.candidates); + SDL_assert(candidates); selected_candidate = event->edit_candidates.selected_candidate; horizontal_candidates = event->edit_candidates.horizontal; } @@ -529,7 +516,7 @@ static void DrawCandidates(int rendererID, SDL_FRect *cursorRect) /* FIXME */ #else if (horizontal_candidates) { - char *utext = candidates[i]; + const char *utext = candidates[i]; Uint32 codepoint; size_t len; float advance = 0.0f; @@ -544,7 +531,7 @@ static void DrawCandidates(int rendererID, SDL_FRect *cursorRect) w += advance; h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; } else { - char *utext = candidates[i]; + const char *utext = candidates[i]; Uint32 codepoint; size_t len; float advance = 0.0f; @@ -596,7 +583,7 @@ static void DrawCandidates(int rendererID, SDL_FRect *cursorRect) dstRect.h = UNIFONT_GLYPH_SIZE * UNIFONT_DRAW_SCALE; if (horizontal_candidates) { - char *utext = candidates[i]; + const char *utext = candidates[i]; Uint32 codepoint; size_t len; float start; @@ -621,7 +608,7 @@ static void DrawCandidates(int rendererID, SDL_FRect *cursorRect) SDL_RenderFillRect(renderer, &underlineRect); } } else { - char *utext = candidates[i]; + const char *utext = candidates[i]; Uint32 codepoint; size_t len; float start; From 975457cfb66c22a88620dda680489eee1101b8fc Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 19 Jul 2024 19:23:24 +0000 Subject: [PATCH 413/431] Sync SDL3 wiki -> header --- docs/README-strings.md | 59 ++++++++++++++++++++++++++++++ include/SDL3/SDL_audio.h | 68 ++++++++++++++++++++--------------- include/SDL3/SDL_camera.h | 44 +++++++++++++---------- include/SDL3/SDL_clipboard.h | 9 +++-- include/SDL3/SDL_error.h | 5 +-- include/SDL3/SDL_events.h | 52 ++++++++++++++++++--------- include/SDL3/SDL_filesystem.h | 12 ++++--- include/SDL3/SDL_gamepad.h | 61 +++++++++++++++++++------------ include/SDL3/SDL_guid.h | 3 +- include/SDL3/SDL_haptic.h | 13 ++++--- include/SDL3/SDL_hidapi.h | 32 ++++++++--------- include/SDL3/SDL_hints.h | 3 +- include/SDL3/SDL_iostream.h | 25 +++++++------ include/SDL3/SDL_joystick.h | 53 ++++++++++++--------------- include/SDL3/SDL_keyboard.h | 19 ++++++---- include/SDL3/SDL_loadso.h | 7 ++-- include/SDL3/SDL_locale.h | 7 ++-- include/SDL3/SDL_mouse.h | 16 +++++---- include/SDL3/SDL_pen.h | 3 +- include/SDL3/SDL_properties.h | 3 +- include/SDL3/SDL_render.h | 17 +++++---- include/SDL3/SDL_sensor.h | 25 ++++++++----- include/SDL3/SDL_storage.h | 11 +++--- include/SDL3/SDL_surface.h | 8 ++--- include/SDL3/SDL_system.h | 24 ++++++++----- include/SDL3/SDL_thread.h | 7 ++-- include/SDL3/SDL_time.h | 22 ++++++++---- include/SDL3/SDL_touch.h | 14 ++++---- include/SDL3/SDL_video.h | 45 ++++++++++++++--------- include/SDL3/SDL_vulkan.h | 9 +++-- 30 files changed, 426 insertions(+), 250 deletions(-) create mode 100644 docs/README-strings.md diff --git a/docs/README-strings.md b/docs/README-strings.md new file mode 100644 index 0000000000000..58d94f9270af4 --- /dev/null +++ b/docs/README-strings.md @@ -0,0 +1,59 @@ +# String policies in SDL3. + +## Encoding. + +Unless otherwise specified, all strings in SDL, across all platforms, are +UTF-8 encoded and can represent the full range of [Unicode](https://unicode.org). + + +## The SDL Get String Rule. + +Did you see 'SDL_GetStringRule' in the wiki or headers? Here are the details +that aren't worth copying across dozens of functions' documentation. + +tl;dr: If an SDL function returns a `const char *` string, do not modify or +free it, and if you need to save it, make a copy right away. + +In several cases, SDL wants to return a string to the app, and the question +in any library that does this is: _who owns this thing?_ + +The answer in almost all cases, is that SDL does, but not for long. + +The pointer is only guaranteed to be valid until the next time the event +queue is updated, or SDL_Quit is called. + +The reason for this is memory safety. + +There are several strings that SDL provides that could be freed at +any moment. For example, an app calls SDL_GetAudioDeviceName(), which returns +a string that is part of the internal audio device structure. But, while this +function is returning, the user yanks the USB audio device out of the +computer, and SDL decides to deallocate the structure...and the string! +Now the app is holding a pointer that didn't live long enough to be useful, +and could crash if accessed. + +To avoid this, instead of calling SDL_free on a string as soon as it's done +with it, SDL adds the pointer to a list. This list is freed at specific +points: when the event queue is run (for ongoing cleanup) and when SDL_Quit +is called (to catch things that are just hanging around). This allows the +app to use a string without worrying about it becoming bogus in the middle +of a printf() call. If the app needs it for longer, it should copy it. + +When does "the event queue run"? There are several points: + +- If the app calls SDL_PumpEvents() _from any thread_. +- SDL_PumpEvents is also called by several other APIs internally: + SDL_PollEvent(), SDL_PeepEvents(), SDL_WaitEvent(), + SDL_WaitEventTimeout(), and maybe others. +- If you are using [the main callbacks](main-functions#main-callbacks-in-sdl3), + the event queue can run immediately after any of the callback functions + return. + +Note that these are just guaranteed minimum lifespans; any given string +might live much longer--some might even be static memory that is _never_ +deallocated--but this rule promises that the app has a safe window. + +Note that none of this applies if the return value is `char *` instead of +`const char *`. Please see the specific function's documentation for how +to handle those pointers. + diff --git a/include/SDL3/SDL_audio.h b/include/SDL3/SDL_audio.h index c7966376602f9..6a7d77854e953 100644 --- a/include/SDL3/SDL_audio.h +++ b/include/SDL3/SDL_audio.h @@ -400,7 +400,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void); * "coreaudio" or "wasapi". These never have Unicode characters, and are not * meant to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of the audio driver; the value ranges from 0 to * SDL_GetNumAudioDrivers() - 1. @@ -423,7 +424,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAudioDriver(int index); * "coreaudio" or "wasapi". These never have Unicode characters, and are not * meant to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the name of the current audio driver or NULL if no driver has been * initialized. @@ -448,11 +450,13 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentAudioDriver(void); * If this function returns NULL, to signify an error, `*count` will be set to * zero. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of devices returned, may be NULL. - * \returns a 0 terminated array of device instance IDs or NULL on error; call SDL_GetError() for more - * information. + * \param count a pointer filled in with the number of devices returned, may + * be NULL. + * \returns a 0 terminated array of device instance IDs or NULL on error; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -477,11 +481,13 @@ extern SDL_DECLSPEC const SDL_AudioDeviceID * SDLCALL SDL_GetAudioPlaybackDevice * If this function returns NULL, to signify an error, `*count` will be set to * zero. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of devices returned, may be NULL. - * \returns a 0 terminated array of device instance IDs, or NULL on failure; call SDL_GetError() for more - * information. + * \param count a pointer filled in with the number of devices returned, may + * be NULL. + * \returns a 0 terminated array of device instance IDs, or NULL on failure; + * call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -495,7 +501,8 @@ extern SDL_DECLSPEC const SDL_AudioDeviceID * SDLCALL SDL_GetAudioRecordingDevic /** * Get the human-readable name of a specific audio device. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param devid the instance ID of the device to query. * \returns the name of the audio device, or NULL on failure; call @@ -555,7 +562,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid * Audio devices usually have no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param devid the instance ID of the device to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -634,8 +642,8 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioDeviceChannelMap(SDL_AudioDe * default device. * \param spec the requested device configuration. Can be NULL to use * reasonable defaults. - * \returns the device ID on success or 0 on failure; call SDL_GetError() for more - * information. + * \returns the device ID on success or 0 on failure; call SDL_GetError() for + * more information. * * \threadsafety It is safe to call this function from any thread. * @@ -739,8 +747,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AudioDevicePaused(SDL_AudioDeviceID dev * this function will always return -1.0f when used on physical devices. * * \param devid the audio device to query. - * \returns the gain of the device or -1.0f on failure; call - * SDL_GetError() for more information. + * \returns the gain of the device or -1.0f on failure; call SDL_GetError() + * for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -831,7 +839,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseAudioDevice(SDL_AudioDeviceID devid); * \param streams an array of audio streams to unbind. * \param num_streams number streams listed in the `streams` array. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -851,8 +859,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_BindAudioStreams(SDL_AudioDeviceID devid, SD * * \param devid an audio device to bind a stream to. * \param stream an audio stream to bind to a device. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more - * information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -992,7 +1000,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetAudioStreamFormat(SDL_AudioStream *stream * \param dst_spec the new format of the audio output; if NULL, it is not * changed. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1059,8 +1067,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream * Audio streams default to a gain of 1.0f (no change in output). * * \param stream the SDL_AudioStream to query. - * \returns the gain of the stream or -1.0f on failure; call - * SDL_GetError() for more information. + * \returns the gain of the stream or -1.0f on failure; call SDL_GetError() + * for more information. * * \threadsafety It is safe to call this function from any thread, as it holds * a stream-specific mutex while running. @@ -1105,7 +1113,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGain(SDL_AudioStream *stream, * Audio streams default to no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -1130,7 +1139,8 @@ extern SDL_DECLSPEC const int * SDLCALL SDL_GetAudioStreamInputChannelMap(SDL_Au * Audio streams default to no remapping applied. This is represented by * returning NULL, and does not signify an error. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param stream the SDL_AudioStream to query. * \param count On output, set to number of channels in the map. Can be NULL. @@ -1289,8 +1299,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_PutAudioStreamData(SDL_AudioStream *stream, * \param stream the stream the audio is being requested from. * \param buf a buffer to fill with audio data. * \param len the maximum number of bytes to fill. - * \returns the number of bytes read from the stream or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns the number of bytes read from the stream or a negative error code + * on failure; call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread, but if the * stream has a callback set, the caller might need to manage @@ -1572,7 +1582,8 @@ typedef void (SDLCALL *SDL_AudioStreamCallback)(void *userdata, SDL_AudioStream * \param userdata an opaque pointer provided to the callback for its own * personal use. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. This only fails if `stream` is NULL. + * SDL_GetError() for more information. This only fails if `stream` + * is NULL. * * \threadsafety It is safe to call this function from any thread. * @@ -1621,7 +1632,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetAudioStreamGetCallback(SDL_AudioStream *s * \param userdata an opaque pointer provided to the callback for its own * personal use. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. This only fails if `stream` is NULL. + * SDL_GetError() for more information. This only fails if `stream` + * is NULL. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_camera.h b/include/SDL3/SDL_camera.h index 0f3abbbc720e9..590214ceca8b6 100644 --- a/include/SDL3/SDL_camera.h +++ b/include/SDL3/SDL_camera.h @@ -134,7 +134,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumCameraDrivers(void); * "coremedia" or "android". These never have Unicode characters, and are not * meant to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of the camera driver; the value ranges from 0 to * SDL_GetNumCameraDrivers() - 1. @@ -156,7 +157,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCameraDriver(int index); * "coremedia" or "android". These never have Unicode characters, and are not * meant to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the name of the current camera driver or NULL if no driver has * been initialized. @@ -170,12 +172,13 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetCurrentCameraDriver(void); /** * Get a list of currently connected camera devices. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of cameras returned, may be - * NULL. - * \returns a 0 terminated array of camera instance IDs or NULL on failure; call SDL_GetError() for more - * information. + * \param count a pointer filled in with the number of cameras returned, may + * be NULL. + * \returns a 0 terminated array of camera instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -201,18 +204,20 @@ extern SDL_DECLSPEC const SDL_CameraID * SDLCALL SDL_GetCameras(int *count); * If `count` is not NULL, it will be filled with the number of elements in * the returned array. * - * Note that it's legal for a camera to supply an empty list. This is what will happen on - * Emscripten builds, since that platform won't tell _anything_ about - * available cameras until you've opened one, and won't even tell if there - * _is_ a camera until the user has given you permission to check through a - * scary warning popup. + * Note that it's legal for a camera to supply an empty list. This is what + * will happen on Emscripten builds, since that platform won't tell _anything_ + * about available cameras until you've opened one, and won't even tell if + * there _is_ a camera until the user has given you permission to check + * through a scary warning popup. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param devid the camera device instance ID to query. - * \param count a pointer filled in with the number of elements in the list, may be NULL. - * \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on failure; call - * SDL_GetError() for more information. + * \param count a pointer filled in with the number of elements in the list, + * may be NULL. + * \returns a NULL terminated array of pointers to SDL_CameraSpec or NULL on + * failure; call SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -226,7 +231,8 @@ extern SDL_DECLSPEC const SDL_CameraSpec * const * SDLCALL SDL_GetCameraSupporte /** * Get the human-readable device name for a camera. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the camera device instance ID. * \returns a human-readable device name or NULL on failure; call @@ -293,8 +299,8 @@ extern SDL_DECLSPEC SDL_CameraPosition SDLCALL SDL_GetCameraPosition(SDL_CameraI * \param instance_id the camera device instance ID. * \param spec the desired format for data the device will provide. Can be * NULL. - * \returns an SDL_Camera object or NULL on failure; call SDL_GetError() for more - * information. + * \returns an SDL_Camera object or NULL on failure; call SDL_GetError() for + * more information. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_clipboard.h b/include/SDL3/SDL_clipboard.h index a1690f080a32f..4318b613295dc 100644 --- a/include/SDL3/SDL_clipboard.h +++ b/include/SDL3/SDL_clipboard.h @@ -62,7 +62,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); * This functions returns empty string if there was not enough memory left for * a copy of the clipboard's content. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the clipboard text on success or an empty string on failure; call * SDL_GetError() for more information. @@ -106,7 +107,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetPrimarySelectionText(const char *text); * This functions returns empty string if there was not enough memory left for * a copy of the primary selection's content. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the primary selection text on success or an empty string on * failure; call SDL_GetError() for more information. @@ -221,7 +223,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_ClearClipboardData(void); * \returns the retrieved data buffer or NULL on failure; call SDL_GetError() * for more information. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed + * later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_error.h b/include/SDL3/SDL_error.h index 4c75829dde735..75e8370b143bc 100644 --- a/include/SDL3/SDL_error.h +++ b/include/SDL3/SDL_error.h @@ -96,8 +96,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_OutOfMemory(void); * Error strings are set per-thread, so an error set in a different thread * will not interfere with the current thread's operation. * - * The returned value is a thread-local string which will remain valid until the current thread's error string is changed. The caller - * should make a copy if the value is needed after the next SDL API call. + * The returned value is a thread-local string which will remain valid until + * the current thread's error string is changed. The caller should make a copy + * if the value is needed after the next SDL API call. * * \returns a message with information about the specific error that occurred, * or an empty string if there hasn't been an error message set since diff --git a/include/SDL3/SDL_events.h b/include/SDL3/SDL_events.h index 54945d3512f26..d5624aa0c9419 100644 --- a/include/SDL3/SDL_events.h +++ b/include/SDL3/SDL_events.h @@ -350,7 +350,8 @@ typedef struct SDL_KeyboardEvent * will be inserted into the editing text. The length is the number of UTF-8 * characters that will be replaced by new typing. * - * The text string is temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * The text string is temporary memory which will be automatically freed + * later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This struct is available since SDL 3.0.0. */ @@ -368,7 +369,8 @@ typedef struct SDL_TextEditingEvent /** * Keyboard IME candidates event structure (event.edit_candidates.*) * - * The candidates are temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * The candidates are temporary memory which will be automatically freed + * later, and can be claimed with SDL_ClaimTemporaryMemory(). * * \since This struct is available since SDL 3.0.0. */ @@ -387,7 +389,8 @@ typedef struct SDL_TextEditingCandidatesEvent /** * Keyboard text input event structure (event.text.*) * - * The text string is temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * The text string is temporary memory which will be automatically freed + * later, and can be claimed with SDL_ClaimTemporaryMemory(). * * This event will never be delivered unless text input is enabled by calling * SDL_StartTextInput(). Text input is disabled by default! @@ -784,7 +787,9 @@ typedef struct SDL_PenButtonEvent * An event used to drop text or request a file open by the system * (event.drop.*) * - * The source and data strings are temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * The source and data strings are temporary memory which will be + * automatically freed later, and can be claimed with + * SDL_ClaimTemporaryMemory(). * * \since This struct is available since SDL 3.0.0. */ @@ -1409,7 +1414,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents); /** * Allocate temporary memory. * - * You can use this to allocate memory that will be automatically freed later, after event processing is complete. + * You can use this to allocate memory that will be automatically freed later, + * after event processing is complete. * * \param size the amount of memory to allocate. * \returns a pointer to the memory allocated or NULL on failure; call @@ -1427,13 +1433,20 @@ extern SDL_DECLSPEC void * SDLCALL SDL_AllocateTemporaryMemory(size_t size); /** * Claim ownership of temporary memory. * - * This function changes ownership of temporary memory allocated for events and functions that - * return temporary memory. If this function succeeds, the memory will no longer be automatically freed by SDL, it must be freed using SDL_free() by the application. + * This function changes ownership of temporary memory allocated for events + * and functions that return temporary memory. If this function succeeds, the + * memory will no longer be automatically freed by SDL, it must be freed using + * SDL_free() by the application. * - * If the memory isn't temporary, or it was allocated on a different thread, or if it is associated with an event currently in the event queue, this will return NULL, and the application does not have ownership of the memory. + * If the memory isn't temporary, or it was allocated on a different thread, + * or if it is associated with an event currently in the event queue, this + * will return NULL, and the application does not have ownership of the + * memory. * * \param mem a pointer allocated with SDL_AllocateTemporaryMemory(). - * \returns a pointer to the memory now owned by the application, which must be freed using SDL_free(), or NULL if the memory is not temporary or was allocated on a different thread. + * \returns a pointer to the memory now owned by the application, which must + * be freed using SDL_free(), or NULL if the memory is not temporary + * or was allocated on a different thread. * * \threadsafety It is safe to call this function from any thread. * @@ -1447,17 +1460,22 @@ extern SDL_DECLSPEC void * SDLCALL SDL_ClaimTemporaryMemory(const void *mem); /** * Free temporary memory. * - * This function frees temporary memory allocated for events and functions that - * return temporary memory. This memory is local to the thread that creates - * it and is automatically freed for the main thread when processing events. - * For other threads you may call this function periodically to - * free any temporary memory created by that thread. + * This function frees temporary memory allocated for events and functions + * that return temporary memory. This memory is local to the thread that + * creates it and is automatically freed for the main thread when processing + * events. For other threads you may call this function periodically to free + * any temporary memory created by that thread. * - * You can free a specific pointer, to provide more fine grained control over memory management, or you can pass NULL to free all pending temporary allocations. + * You can free a specific pointer, to provide more fine grained control over + * memory management, or you can pass NULL to free all pending temporary + * allocations. * - * All temporary memory is freed on the main thread in SDL_Quit() and for other threads when they call SDL_CleanupTLS(), which is automatically called at cleanup time for threads created using SDL_CreateThread(). + * All temporary memory is freed on the main thread in SDL_Quit() and for + * other threads when they call SDL_CleanupTLS(), which is automatically + * called at cleanup time for threads created using SDL_CreateThread(). * - * \param mem a pointer allocated with SDL_AllocateTemporaryMemory(), or NULL to free all pending temporary allocations. + * \param mem a pointer allocated with SDL_AllocateTemporaryMemory(), or NULL + * to free all pending temporary allocations. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index 9c163ca544e43..dfaaf544dcb88 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -68,7 +68,8 @@ extern "C" { * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns an absolute path in UTF-8 encoding to the application data * directory. NULL will be returned on error or when the platform @@ -123,7 +124,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetBasePath(void); * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param org the name of your organization. * \param app the name of your application. @@ -223,7 +225,8 @@ typedef enum SDL_Folder * The returned path is guaranteed to end with a path separator ('\\' on * Windows, '/' on most other platforms). * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * If NULL is returned, the error may be obtained with SDL_GetError(). * @@ -354,7 +357,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param path the path of the directory to enumerate. * \param pattern the pattern that files in the directory must match. Can be diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index ac446d67c6abc..3313bd6f7ed5d 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -282,9 +282,9 @@ typedef struct SDL_GamepadBinding * existing gamepad. * * The mapping string has the format "GUID,name,mapping", where GUID is the - * string value from SDL_GUIDToString(), name is the human readable - * string for the device and mappings are gamepad mappings to joystick ones. - * Under Windows there is a reserved GUID of "xinput" that covers all XInput + * string value from SDL_GUIDToString(), name is the human readable string for + * the device and mappings are gamepad mappings to joystick ones. Under + * Windows there is a reserved GUID of "xinput" that covers all XInput * devices. The mapping format for joystick is: * * - `bX`: a joystick button, index X @@ -389,7 +389,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReloadGamepadMappings(void); /** * Get the current gamepad mappings. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of mappings returned, can * be NULL. @@ -403,7 +404,8 @@ extern SDL_DECLSPEC const char * const * SDLCALL SDL_GetGamepadMappings(int *cou /** * Get the gamepad mapping string for a given GUID. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param guid a structure containing the GUID for which a mapping is desired. * \returns a mapping string or NULL on failure; call SDL_GetError() for more @@ -419,7 +421,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadMappingForGUID(SDL_GUID g /** * Get the current mapping of a gamepad. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * Details about mappings are discussed with SDL_AddGamepadMapping(). * @@ -468,11 +471,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasGamepad(void); /** * Get a list of currently connected gamepads. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of gamepads returned, may be NULL. - * \returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for - * more information. + * \param count a pointer filled in with the number of gamepads returned, may + * be NULL. + * \returns a 0 terminated array of joystick instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -500,7 +505,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_IsGamepad(SDL_JoystickID instance_id); * * This can be called before any gamepads are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the name of the selected gamepad. If no name can be found, this @@ -518,7 +524,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadNameForID(SDL_JoystickID * * This can be called before any gamepads are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the path of the selected gamepad. If no path can be found, this @@ -651,7 +658,8 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetRealGamepadTypeForID(SDL_Joys * * This can be called before any gamepads are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the mapping string. Returns NULL if no mapping is available. @@ -750,7 +758,8 @@ extern SDL_DECLSPEC SDL_JoystickID SDLCALL SDL_GetGamepadID(SDL_Gamepad *gamepad /** * Get the implementation-dependent name for an opened gamepad. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). @@ -766,7 +775,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadName(SDL_Gamepad *gamepad /** * Get the implementation-dependent path for an opened gamepad. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad a gamepad identifier previously returned by * SDL_OpenGamepad(). @@ -893,7 +903,8 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetGamepadFirmwareVersion(SDL_Gamepad *ga * * Returns the serial number of the gamepad, or NULL if it is not available. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad the gamepad object to query. * \returns the serial number, or NULL if unavailable. @@ -972,7 +983,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadConnected(SDL_Gamepad *gamepad); * SDL to crash. * * \param gamepad the gamepad object that you want to get a joystick from. - * \returns an SDL_Joystick object, or NULL on failure; call SDL_GetError() for more information. + * \returns an SDL_Joystick object, or NULL on failure; call SDL_GetError() + * for more information. * * \since This function is available since SDL 3.0.0. */ @@ -1053,7 +1065,8 @@ extern SDL_DECLSPEC SDL_GamepadType SDLCALL SDL_GetGamepadTypeFromString(const c /** * Convert from an SDL_GamepadType enum to a string. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param type an enum value for a given SDL_GamepadType. * \returns a string for the given type, or NULL if an invalid type is @@ -1091,7 +1104,8 @@ extern SDL_DECLSPEC SDL_GamepadAxis SDLCALL SDL_GetGamepadAxisFromString(const c /** * Convert from an SDL_GamepadAxis enum to a string. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param axis an enum value for a given SDL_GamepadAxis. * \returns a string for the given axis, or NULL if an invalid axis is @@ -1166,7 +1180,8 @@ extern SDL_DECLSPEC SDL_GamepadButton SDLCALL SDL_GetGamepadButtonFromString(con /** * Convert from an SDL_GamepadButton enum to a string. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param button an enum value for a given SDL_GamepadButton. * \returns a string for the given button, or NULL if an invalid button is @@ -1454,7 +1469,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_CloseGamepad(SDL_Gamepad *gamepad); * Return the sfSymbolsName for a given button on a gamepad on Apple * platforms. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad the gamepad to query. * \param button a button on the gamepad. @@ -1469,7 +1485,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetGamepadAppleSFSymbolsNameForButt /** * Return the sfSymbolsName for a given axis on a gamepad on Apple platforms. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param gamepad the gamepad to query. * \param axis an axis on the gamepad. diff --git a/include/SDL3/SDL_guid.h b/include/SDL3/SDL_guid.h index 40a7465ec4d77..0bac68f46b1a5 100644 --- a/include/SDL3/SDL_guid.h +++ b/include/SDL3/SDL_guid.h @@ -66,7 +66,8 @@ typedef struct SDL_GUID { /** * Get an ASCII string representation for a given SDL_GUID. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param guid the SDL_GUID you wish to convert to string. * \returns the string representation of the GUID or NULL on failure; call diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index e9d32bbae2c44..9a1231df6e601 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -931,12 +931,13 @@ typedef Uint32 SDL_HapticID; /** * Get a list of currently connected haptic devices. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of haptic devices * returned, may be NULL. - * \returns a 0 terminated array of haptic device instance IDs or NULL on failure; call SDL_GetError() for - * more information. + * \returns a 0 terminated array of haptic device instance IDs or NULL on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -949,7 +950,8 @@ extern SDL_DECLSPEC const SDL_HapticID * SDLCALL SDL_GetHaptics(int *count); * * This can be called before any haptic devices are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the haptic device instance ID. * \returns the name of the selected haptic device. If no name can be found, @@ -1014,7 +1016,8 @@ extern SDL_DECLSPEC SDL_HapticID SDLCALL SDL_GetHapticID(SDL_Haptic *haptic); /** * Get the implementation dependent name of a haptic device. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param haptic the SDL_Haptic obtained from SDL_OpenJoystick(). * \returns the name of the selected haptic device. If no name can be found, diff --git a/include/SDL3/SDL_hidapi.h b/include/SDL3/SDL_hidapi.h index a3c1236df1a2c..66bea9da31483 100644 --- a/include/SDL3/SDL_hidapi.h +++ b/include/SDL3/SDL_hidapi.h @@ -263,8 +263,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_hid_free_enumeration(SDL_hid_device_info *d * \param serial_number the Serial Number of the device to open (Optionally * NULL). * \returns a pointer to a SDL_hid_device object on success or NULL on - * failure; call - * SDL_GetError() for more information. + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -278,8 +277,7 @@ extern SDL_DECLSPEC SDL_hid_device * SDLCALL SDL_hid_open(unsigned short vendor_ * * \param path the path name of the device to open. * \returns a pointer to a SDL_hid_device object on success or NULL on - * failure; call - * SDL_GetError() for more information. + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -326,9 +324,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_write(SDL_hid_device *dev, const unsigne * number. * \param milliseconds timeout in milliseconds or -1 for blocking wait. * \returns the actual number of bytes read and -1 on on failure; call - * SDL_GetError() for more information. If no packet was - * available to be read within the timeout period, this function - * returns 0. + * SDL_GetError() for more information. If no packet was available to + * be read within the timeout period, this function returns 0. * * \since This function is available since SDL 3.0.0. */ @@ -347,9 +344,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_read_timeout(SDL_hid_device *dev, unsign * reports, make sure to read an extra byte for the report * number. * \returns the actual number of bytes read and -1 on failure; call - * SDL_GetError() for more information. If no packet was - * available to be read and the handle is in non-blocking mode, this - * function returns 0. + * SDL_GetError() for more information. If no packet was available to + * be read and the handle is in non-blocking mode, this function + * returns 0. * * \since This function is available since SDL 3.0.0. */ @@ -393,7 +390,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_set_nonblocking(SDL_hid_device *dev, int * \param length the length in bytes of the data to send, including the report * number. * \returns the actual number of bytes written and -1 on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -415,8 +412,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_send_feature_report(SDL_hid_device *dev, * \param length the number of bytes to read, including an extra byte for the * report ID. The buffer can be longer than the actual report. * \returns the number of bytes read plus one for the report ID (which is - * still in the first byte), or -1 on on failure; call - * SDL_GetError() for more information. + * still in the first byte), or -1 on on failure; call SDL_GetError() + * for more information. * * \since This function is available since SDL 3.0.0. */ @@ -438,8 +435,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_get_feature_report(SDL_hid_device *dev, * \param length the number of bytes to read, including an extra byte for the * report ID. The buffer can be longer than the actual report. * \returns the number of bytes read plus one for the report ID (which is - * still in the first byte), or -1 on on failure; call - * SDL_GetError() for more information. + * still in the first byte), or -1 on on failure; call SDL_GetError() + * for more information. * * \since This function is available since SDL 3.0.0. */ @@ -514,9 +511,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_hid_get_indexed_string(SDL_hid_device *dev, * * \param dev a device handle returned from SDL_hid_open(). * \returns a pointer to the SDL_hid_device_info for this hid_device or NULL - * on failure; call SDL_GetError() for more information. - * This struct is valid until the device is closed with - * SDL_hid_close(). + * on failure; call SDL_GetError() for more information. This struct + * is valid until the device is closed with SDL_hid_close(). * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 58cb8ebe65b39..373a039a2c0ba 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -3883,7 +3883,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_ResetHints(void); /** * Get the value of a hint. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param name the hint to query. * \returns the string value of a hint or NULL if the hint isn't set. diff --git a/include/SDL3/SDL_iostream.h b/include/SDL3/SDL_iostream.h index 08329082cefc4..430cd3e40bc55 100644 --- a/include/SDL3/SDL_iostream.h +++ b/include/SDL3/SDL_iostream.h @@ -224,8 +224,8 @@ typedef struct SDL_IOStream SDL_IOStream; * \param file a UTF-8 string representing the filename to open. * \param mode an ASCII string representing the mode to be used for opening * the file. - * \returns a pointer to the SDL_IOStream structure that is created or NULL - * on failure; call SDL_GetError() for more information. + * \returns a pointer to the SDL_IOStream structure that is created or NULL on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -258,8 +258,8 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromFile(const char *file, cons * * \param mem a pointer to a buffer to feed an SDL_IOStream stream. * \param size the buffer size, in bytes. - * \returns a pointer to a new SDL_IOStream structure or NULL on failure; - * call SDL_GetError() for more information. + * \returns a pointer to a new SDL_IOStream structure or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -291,8 +291,8 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromMem(void *mem, size_t size) * * \param mem a pointer to a read-only buffer to feed an SDL_IOStream stream. * \param size the buffer size, in bytes. - * \returns a pointer to a new SDL_IOStream structure or NULL on failure; - * call SDL_GetError() for more information. + * \returns a pointer to a new SDL_IOStream structure or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -319,8 +319,8 @@ extern SDL_DECLSPEC SDL_IOStream * SDLCALL SDL_IOFromConstMem(const void *mem, s * - `SDL_PROP_IOSTREAM_DYNAMIC_CHUNKSIZE_NUMBER`: memory will be allocated in * multiples of this size, defaulting to 1024. * - * \returns a pointer to a new SDL_IOStream structure or NULL on failure; - * call SDL_GetError() for more information. + * \returns a pointer to a new SDL_IOStream structure or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -488,7 +488,8 @@ extern SDL_DECLSPEC Sint64 SDLCALL SDL_TellIO(SDL_IOStream *context); * \param context a pointer to an SDL_IOStream structure. * \param ptr a pointer to a buffer to read data into. * \param size the number of bytes to read from the data source. - * \returns the number of bytes read, or 0 on end of file or other failure; call SDL_GetError() for more information. + * \returns the number of bytes read, or 0 on end of file or other failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -576,7 +577,8 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_IOvprintf(SDL_IOStream *context, SDL_PRIN * \param datasize if not NULL, will store the number of bytes read. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. - * \returns the data or NULL on failure; call SDL_GetError() for more information. + * \returns the data or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. * @@ -595,7 +597,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_LoadFile_IO(SDL_IOStream *src, size_t *da * * \param file the path to read all available data from. * \param datasize if not NULL, will store the number of bytes read. - * \returns the data or NULL on failure; call SDL_GetError() for more information. + * \returns the data or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index f999561c67f36..d1327e5743fda 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -37,9 +37,9 @@ * controller. For XInput controllers this returns the XInput user index. Many * joysticks will not be able to supply this information. * - * SDL_GUID is used as a stable 128-bit identifier for a joystick - * device that does not change over time. It identifies class of the device (a - * X360 wired controller for example). This identifier is platform dependent. + * SDL_GUID is used as a stable 128-bit identifier for a joystick device that + * does not change over time. It identifies class of the device (a X360 wired + * controller for example). This identifier is platform dependent. * * 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, @@ -201,11 +201,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasJoystick(void); /** * Get a list of currently connected joysticks. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of joysticks returned, may be NULL. - * \returns a 0 terminated array of joystick instance IDs or NULL on failure; call SDL_GetError() for - * more information. + * \param count a pointer filled in with the number of joysticks returned, may + * be NULL. + * \returns a 0 terminated array of joystick instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -219,7 +221,8 @@ extern SDL_DECLSPEC const SDL_JoystickID * SDLCALL SDL_GetJoysticks(int *count); * * This can be called before any joysticks are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the name of the selected joystick. If no name can be found, this @@ -237,7 +240,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickNameForID(SDL_JoystickID * * This can be called before any joysticks are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the joystick instance ID. * \returns the path of the selected joystick. If no path can be found, this @@ -356,8 +360,8 @@ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickTypeForID(SDL_Joysti * for use. * * \param instance_id the joystick instance ID. - * \returns a joystick identifier or NULL on failure; call - * SDL_GetError() for more information. + * \returns a joystick identifier or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * @@ -462,8 +466,8 @@ typedef struct SDL_VirtualJoystickDesc * Attach a new virtual joystick. * * \param desc joystick description. - * \returns the joystick instance ID, or 0 on failure; call - * SDL_GetError() for more information. + * \returns the joystick instance ID, or 0 on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. * @@ -658,7 +662,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetJoystickProperties(SDL_Joyst /** * Get the implementation dependent name of a joystick. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the name of the selected joystick. If no name can be found, this @@ -673,7 +678,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickName(SDL_Joystick *joyst /** * Get the implementation dependent path of a joystick. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the path of the selected joystick. If no path can be found, this @@ -792,7 +798,8 @@ extern SDL_DECLSPEC Uint16 SDLCALL SDL_GetJoystickFirmwareVersion(SDL_Joystick * * * Returns the serial number of the joystick, or NULL if it is not available. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param joystick the SDL_Joystick obtained from SDL_OpenJoystick(). * \returns the serial number of the selected joystick, or NULL if @@ -814,20 +821,6 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joy */ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick); -/** - * Convert a GUID string into a SDL_GUID structure. - * - * Performs no error checking. If this function is given a string containing - * an invalid GUID, the function will silently succeed, but the GUID generated - * will not be useful. - * - * \param pchGUID string containing an ASCII representation of a GUID. - * \returns a SDL_GUID structure. - * - * \since This function is available since SDL 3.0.0. - * - * \sa SDL_GUIDToString - */ extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID); /** diff --git a/include/SDL3/SDL_keyboard.h b/include/SDL3/SDL_keyboard.h index 70f9fdfde65d7..bb280ce14bce2 100644 --- a/include/SDL3/SDL_keyboard.h +++ b/include/SDL3/SDL_keyboard.h @@ -73,11 +73,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasKeyboard(void); * power buttons, etc. You should wait for input from a device before you * consider it actively in use. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of keyboards returned, may be NULL. - * \returns a 0 terminated array of keyboards instance IDs or NULL on failure; call SDL_GetError() for - * more information. + * \param count a pointer filled in with the number of keyboards returned, may + * be NULL. + * \returns a 0 terminated array of keyboards instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -91,7 +93,8 @@ extern SDL_DECLSPEC const SDL_KeyboardID * SDLCALL SDL_GetKeyboards(int *count); * * This function returns "" if the keyboard doesn't have a name. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the keyboard instance ID. * \returns the name of the selected keyboard or NULL on failure; call @@ -281,7 +284,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetScancodeName(SDL_Scancode scancode, const /** * Get a human-readable name for a scancode. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * **Warning**: The returned name is by design not stable across platforms, * e.g. the name for `SDL_SCANCODE_LGUI` is "Left GUI" under Linux but "Left @@ -327,7 +331,8 @@ extern SDL_DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *nam * * If the key doesn't have a name, this function returns an empty string (""). * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param key the desired SDL_Keycode to query. * \returns a UTF-8 encoded string of the key name. diff --git a/include/SDL3/SDL_loadso.h b/include/SDL3/SDL_loadso.h index 5911b232490fc..ab34a38620beb 100644 --- a/include/SDL3/SDL_loadso.h +++ b/include/SDL3/SDL_loadso.h @@ -56,7 +56,8 @@ extern "C" { * Dynamically load a shared object. * * \param sofile a system-dependent name of the object file. - * \returns an opaque pointer to the object handle or NULL on failure; call SDL_GetError() for more information. + * \returns an opaque pointer to the object handle or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -82,8 +83,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_LoadObject(const char *sofile); * * \param handle a valid shared object handle returned by SDL_LoadObject(). * \param name the name of the function to look up. - * \returns a pointer to the function or NULL on failure; call - * SDL_GetError() for more information. + * \returns a pointer to the function or NULL on failure; call SDL_GetError() + * for more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_locale.h b/include/SDL3/SDL_locale.h index ec80f6dbb3149..eaf27ffd1263d 100644 --- a/include/SDL3/SDL_locale.h +++ b/include/SDL3/SDL_locale.h @@ -94,12 +94,13 @@ typedef struct SDL_Locale * if possible, and you can call this function again to get an updated copy of * preferred locales. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of locales returned, may * be NULL. - * \returns a NULL terminated array of locale pointers, or NULL on failure; call SDL_GetError() for more - * information. + * \returns a NULL terminated array of locale pointers, or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_mouse.h b/include/SDL3/SDL_mouse.h index 1a8bcce9d046e..8ddc3749548d6 100644 --- a/include/SDL3/SDL_mouse.h +++ b/include/SDL3/SDL_mouse.h @@ -135,11 +135,13 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_HasMouse(void); * You should wait for input from a device before you consider it actively in * use. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * - * \param count a pointer filled in with the number of mice returned, may be NULL. - * \returns a 0 terminated array of mouse instance IDs or NULL on failure; call SDL_GetError() for more - * information. + * \param count a pointer filled in with the number of mice returned, may be + * NULL. + * \returns a 0 terminated array of mouse instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -153,7 +155,8 @@ extern SDL_DECLSPEC const SDL_MouseID * SDLCALL SDL_GetMice(int *count); * * This function returns "" if the mouse doesn't have a name. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the mouse instance ID. * \returns the name of the selected mouse, or NULL on failure; call @@ -483,7 +486,8 @@ extern SDL_DECLSPEC SDL_Cursor * SDLCALL SDL_GetCursor(void); * You do not have to call SDL_DestroyCursor() on the return value, but it is * safe to do so. * - * \returns the default cursor on success or NULL on failuree; call SDL_GetError() for more information. + * \returns the default cursor on success or NULL on failuree; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_pen.h b/include/SDL3/SDL_pen.h index 899c3e3391463..8fcad1cc64e41 100644 --- a/include/SDL3/SDL_pen.h +++ b/include/SDL3/SDL_pen.h @@ -224,7 +224,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_PenConnected(SDL_PenID instance_id); /** * Retrieves a human-readable description for a SDL_PenID. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the pen to query. * \returns a string that contains the name of the pen, intended for human diff --git a/include/SDL3/SDL_properties.h b/include/SDL3/SDL_properties.h index c466b7404344b..b649fd1bf673a 100644 --- a/include/SDL3/SDL_properties.h +++ b/include/SDL3/SDL_properties.h @@ -378,7 +378,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetPointerProperty(SDL_PropertiesID props /** * Get a string property from a group of properties. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param props the properties to query. * \param name the name of the property to query. diff --git a/include/SDL3/SDL_render.h b/include/SDL3/SDL_render.h index b3dfc8a9933cd..84e24ac18486f 100644 --- a/include/SDL3/SDL_render.h +++ b/include/SDL3/SDL_render.h @@ -154,7 +154,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void); * "direct3d12" or "metal". These never have Unicode characters, and are not * meant to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of the rendering driver; the value ranges from 0 to * SDL_GetNumRenderDrivers() - 1. @@ -324,10 +325,12 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetRenderWindow(SDL_Renderer *rende /** * Get the name of a renderer. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param renderer the rendering context. - * \returns the name of the selected renderer, or NULL on failure; call SDL_GetError() for more information. + * \returns the name of the selected renderer, or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1768,7 +1771,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderLines(SDL_Renderer *renderer, const SD * \param rect a pointer to the destination rectangle, or NULL to outline the * entire rendering target. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1800,7 +1803,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderRects(SDL_Renderer *renderer, const SD * \param rect a pointer to the destination rectangle, or NULL for the entire * rendering target. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1835,7 +1838,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer *renderer, cons * \param dstrect a pointer to the destination rectangle, or NULL for the * entire rendering target. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -1886,7 +1889,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_RenderTextureRotated(SDL_Renderer *renderer, * order. * \param num_indices number of indices. * \returns 0 on success or a negative error code on failure; call - * SDL_GetError() for more information. + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_sensor.h b/include/SDL3/SDL_sensor.h index 9984566111de6..89b1bfd6dbe3a 100644 --- a/include/SDL3/SDL_sensor.h +++ b/include/SDL3/SDL_sensor.h @@ -146,9 +146,10 @@ typedef enum SDL_SensorType /** * Get a list of currently connected sensors. * - * \param count a pointer filled in with the number of sensors returned, may be NULL. - * \returns a 0 terminated array of sensor instance IDs or NULL on failure; call SDL_GetError() for more - * information. + * \param count a pointer filled in with the number of sensors returned, may + * be NULL. + * \returns a 0 terminated array of sensor instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -159,7 +160,8 @@ extern SDL_DECLSPEC const SDL_SensorID * SDLCALL SDL_GetSensors(int *count); * * This can be called before any sensors are opened. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param instance_id the sensor instance ID. * \returns the sensor name, or NULL if `instance_id` is not valid. @@ -198,7 +200,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableTypeForID(SDL_SensorID i * Open a sensor for use. * * \param instance_id the sensor instance ID. - * \returns an SDL_Sensor object or NULL on failure; call SDL_GetError() for more information. + * \returns an SDL_Sensor object or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. */ @@ -208,7 +211,8 @@ extern SDL_DECLSPEC SDL_Sensor * SDLCALL SDL_OpenSensor(SDL_SensorID instance_id * Return the SDL_Sensor associated with an instance ID. * * \param instance_id the sensor instance ID. - * \returns an SDL_Sensor object or NULL on failure; call SDL_GetError() for more information. + * \returns an SDL_Sensor object or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. */ @@ -228,10 +232,12 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSensorProperties(SDL_Sensor /** * Get the implementation dependent name of a sensor. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param sensor the SDL_Sensor object. - * \returns the sensor name or NULL on failure; call SDL_GetError() for more information. + * \returns the sensor name or NULL on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. */ @@ -262,7 +268,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetSensorNonPortableType(SDL_Sensor *sensor) * Get the instance ID of a sensor. * * \param sensor the SDL_Sensor object to inspect. - * \returns the sensor instance ID, or 0 on failure; call SDL_GetError() for more information. + * \returns the sensor instance ID, or 0 on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_storage.h b/include/SDL3/SDL_storage.h index 6f2308fc3ddb5..bf8138f7bd2dc 100644 --- a/include/SDL3/SDL_storage.h +++ b/include/SDL3/SDL_storage.h @@ -227,8 +227,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_StorageReady(SDL_Storage *storage); * \param storage a storage container to query. * \param path the relative path of the file to query. * \param length a pointer to be filled with the file's length. - * \returns 0 if the file could be queried or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns 0 if the file could be queried or a negative error code on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -263,8 +263,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_ReadStorageFile(SDL_Storage *storage, const * \param path the relative path of the file to write. * \param source a client-provided buffer to write from. * \param length the length of the source buffer. - * \returns 0 if the file was written or a negative error code on failure; call - * SDL_GetError() for more information. + * \returns 0 if the file was written or a negative error code on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -383,7 +383,8 @@ extern SDL_DECLSPEC Uint64 SDLCALL SDL_GetStorageSpaceRemaining(SDL_Storage *sto * convenience, but if `count` is non-NULL, on return it will contain the * number of items in the array, not counting the NULL terminator. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param storage a storage container. * \param path the path of the directory to enumerate. diff --git a/include/SDL3/SDL_surface.h b/include/SDL3/SDL_surface.h index 8b7371ee25c6b..1690551903ea6 100644 --- a/include/SDL3/SDL_surface.h +++ b/include/SDL3/SDL_surface.h @@ -355,8 +355,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface); * \param src the data stream for the surface. * \param closeio if SDL_TRUE, calls SDL_CloseIO() on `src` before returning, * even in the case of an error. - * \returns a pointer to a new SDL_Surface structure or NULL on failure; - * call SDL_GetError() for more information. + * \returns a pointer to a new SDL_Surface structure or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -373,8 +373,8 @@ extern SDL_DECLSPEC SDL_Surface * SDLCALL SDL_LoadBMP_IO(SDL_IOStream *src, SDL_ * will result in a memory leak. * * \param file the BMP file to load. - * \returns a pointer to a new SDL_Surface structure or NULL on failure; - * call SDL_GetError() for more information. + * \returns a pointer to a new SDL_Surface structure or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_system.h b/include/SDL3/SDL_system.h index cf88a029f9029..489101929cf68 100644 --- a/include/SDL3/SDL_system.h +++ b/include/SDL3/SDL_system.h @@ -162,7 +162,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetX11EventHook(SDL_X11EventHook callback, * * \param threadID the Unix thread ID to change priority of. * \param priority the new, Unix-specific, priority value. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -280,7 +281,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SetiOSEventPump(SDL_bool enabled); * rationale being that the SDL headers can avoid including jni.h. * * \returns a pointer to Java native interface object (JNIEnv) to which the - * current thread is attached, or NULL on failure; call SDL_GetError() for more information. + * current thread is attached, or NULL on failure; call + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * @@ -304,7 +306,8 @@ extern SDL_DECLSPEC void * SDLCALL SDL_GetAndroidJNIEnv(void); * https://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html * * \returns the jobject representing the instance of the Activity class of the - * Android application, or NULL on failure; call SDL_GetError() for more information. + * Android application, or NULL on failure; call SDL_GetError() for + * more information. * * \threadsafety It is safe to call this function from any thread. * @@ -407,7 +410,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_SendAndroidBackButton(void); * * https://developer.android.com/reference/android/content/Context#getFilesDir() * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the path used for internal storage or NULL on failure; call * SDL_GetError() for more information. @@ -448,7 +452,8 @@ extern SDL_DECLSPEC Uint32 SDLCALL SDL_GetAndroidExternalStorageState(void); * * https://developer.android.com/reference/android/content/Context#getExternalFilesDir() * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the path used for external storage for this application on success * or NULL on failure; call SDL_GetError() for more information. @@ -471,7 +476,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetAndroidExternalStoragePath(void) * * https://developer.android.com/reference/android/content/Context#getCacheDir() * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the path used for caches for this application on success or NULL * on failure; call SDL_GetError() for more information. @@ -625,7 +631,8 @@ typedef enum SDL_WinRT_DeviceFamily * * https://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param pathType the type of path to retrieve, one of SDL_WinRT_Path. * \returns a UTF-8 string (8-bit, multi-byte) containing the path, or NULL if @@ -813,7 +820,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQue * * \param outUserHandle a pointer to be filled in with the default user * handle. - * \returns 0 if success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 if success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_thread.h b/include/SDL3/SDL_thread.h index 7048cbb070a8c..86aa6cf667328 100644 --- a/include/SDL3/SDL_thread.h +++ b/include/SDL3/SDL_thread.h @@ -330,7 +330,8 @@ extern SDL_DECLSPEC SDL_Thread * SDLCALL SDL_CreateThreadWithPropertiesRuntime(S /** * Get the thread name as it was specified in SDL_CreateThread(). * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param thread the thread to query. * \returns a pointer to a UTF-8 string that names the specified thread, or @@ -520,7 +521,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetTLS(SDL_TLSID *id, const void *value, SDL /** * Cleanup all TLS data for this thread. * - * If you are creating your threads outside of SDL and then calling SDL functions, you should call this function before your thread exits, to properly clean up SDL memory. + * If you are creating your threads outside of SDL and then calling SDL + * functions, you should call this function before your thread exits, to + * properly clean up SDL memory. * * \threadsafety It is safe to call this function from any thread. * diff --git a/include/SDL3/SDL_time.h b/include/SDL3/SDL_time.h index f28b68f054150..de71506f39716 100644 --- a/include/SDL3/SDL_time.h +++ b/include/SDL3/SDL_time.h @@ -95,7 +95,8 @@ typedef enum SDL_TimeFormat * format, may be NULL. * \param timeFormat a pointer to the SDL_TimeFormat to hold the returned time * format, may be NULL. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -106,7 +107,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDateTimeLocalePreferences(SDL_DateFormat * Jan 1, 1970 in Universal Coordinated Time (UTC). * * \param ticks the SDL_Time to hold the returned tick count. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -121,7 +123,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetCurrentTime(SDL_Time *ticks); * \param localTime the resulting SDL_DateTime will be expressed in local time * if true, otherwise it will be in Universal Coordinated * Time (UTC). - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -135,7 +138,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime * * \param dt the source SDL_DateTime. * \param ticks the resulting SDL_Time. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -177,7 +181,8 @@ extern SDL_DECLSPEC SDL_Time SDLCALL SDL_TimeFromWindows(Uint32 dwLowDateTime, U * * \param year the year. * \param month the month [1-12]. - * \returns the number of days in the requested month or a negative error code on failure; call SDL_GetError() for more information. + * \returns the number of days in the requested month or a negative error code + * on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -189,7 +194,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDaysInMonth(int year, int month); * \param year the year component of the date. * \param month the month component of the date. * \param day the day component of the date. - * \returns the day of year [0-365] if the date is valid or a negative error code on failure; call SDL_GetError() for more information. + * \returns the day of year [0-365] if the date is valid or a negative error + * code on failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -201,7 +207,9 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetDayOfYear(int year, int month, int day); * \param year the year component of the date. * \param month the month component of the date. * \param day the day component of the date. - * \returns a value between 0 and 6 (0 being Sunday) if the date is valid or a negative error code on failure; call SDL_GetError() for more information. + * \returns a value between 0 and 6 (0 being Sunday) if the date is valid or a + * negative error code on failure; call SDL_GetError() for more + * information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index 58e6cd0e56784..bb8e3664706b2 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -83,12 +83,13 @@ typedef struct SDL_Finger * Therefore the returned list might be empty, although devices are available. * After using all devices at least once the number will be correct. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of devices returned, may * be NULL. - * \returns a 0 terminated array of touch device IDs or NULL on failure; call SDL_GetError() for more - * information. + * \returns a 0 terminated array of touch device IDs or NULL on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -97,11 +98,12 @@ extern SDL_DECLSPEC const SDL_TouchID * SDLCALL SDL_GetTouchDevices(int *count); /** * Get the touch device name as reported from the driver. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param touchID the touch device instance ID. - * \returns touch device name, or NULL on failure; call SDL_GetError() for more - * information. + * \returns touch device name, or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_video.h b/include/SDL3/SDL_video.h index b1203528d1a42..b6abc2520f753 100644 --- a/include/SDL3/SDL_video.h +++ b/include/SDL3/SDL_video.h @@ -349,7 +349,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetNumVideoDrivers(void); * "x11" or "windows". These never have Unicode characters, and are not meant * to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param index the index of a video driver. * \returns the name of the video driver with the given **index**. @@ -367,7 +368,8 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetVideoDriver(int index); * "x11" or "windows". These never have Unicode characters, and are not meant * to be proper names. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \returns the name of the current video driver or NULL if no driver has been * initialized. @@ -391,12 +393,13 @@ extern SDL_DECLSPEC SDL_SystemTheme SDLCALL SDL_GetSystemTheme(void); /** * Get a list of currently connected displays. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of displays returned, may * be NULL. - * \returns a 0 terminated array of display instance IDs or NULL on failure; call SDL_GetError() for more - * information. + * \returns a 0 terminated array of display instance IDs or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -446,7 +449,8 @@ extern SDL_DECLSPEC SDL_PropertiesID SDLCALL SDL_GetDisplayProperties(SDL_Displa /** * Get the name of a display in UTF-8 encoding. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param displayID the instance ID of the display to query. * \returns the name of a display or NULL on failure; call SDL_GetError() for @@ -555,12 +559,14 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetDisplayContentScale(SDL_DisplayID displ * - refresh rate -> highest to lowest * - pixel density -> lowest to highest * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param displayID the instance ID of the display to query. - * \param count a pointer filled in with the number of display modes returned, may be NULL. - * \returns a NULL terminated array of display mode pointers or NULL on failure; call SDL_GetError() for - * more information. + * \param count a pointer filled in with the number of display modes returned, + * may be NULL. + * \returns a NULL terminated array of display mode pointers or NULL on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -767,7 +773,8 @@ extern SDL_DECLSPEC const SDL_DisplayMode * SDLCALL SDL_GetWindowFullscreenMode( /** * Get the raw ICC profile data for the screen the window is currently on. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param window the window to query. * \param size the size of the ICC profile. @@ -793,11 +800,13 @@ extern SDL_DECLSPEC SDL_PixelFormat SDLCALL SDL_GetWindowPixelFormat(SDL_Window /** * Get a list of valid windows. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param count a pointer filled in with the number of windows returned, may * be NULL. - * \returns a NULL terminated array of SDL_Window pointers or NULL on failure; call SDL_GetError() for more information. + * \returns a NULL terminated array of SDL_Window pointers or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -1306,7 +1315,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_SetWindowTitle(SDL_Window *window, const cha /** * Get the title of a window. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param window the window to query. * \returns the title of the window in UTF-8 format or "" if there is no @@ -2175,7 +2185,8 @@ extern SDL_DECLSPEC float SDLCALL SDL_GetWindowOpacity(SDL_Window *window); * * \param modal_window the window that should be set modal. * \param parent_window the parent window for the modal window. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -2584,8 +2595,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_GL_GetAttribute(SDL_GLattr attr, int *value) * SDL_GLContext is opaque to the application. * * \param window the window to associate with the context. - * \returns the OpenGL context associated with `window` or NULL on failure; call - * SDL_GetError() for more information. + * \returns the OpenGL context associated with `window` or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * diff --git a/include/SDL3/SDL_vulkan.h b/include/SDL3/SDL_vulkan.h index 61983e178df48..6dd05375f69d7 100644 --- a/include/SDL3/SDL_vulkan.h +++ b/include/SDL3/SDL_vulkan.h @@ -119,7 +119,8 @@ extern SDL_DECLSPEC int SDLCALL SDL_Vulkan_LoadLibrary(const char *path); * `vkGetInstanceProcAddr = * (PFN_vkGetInstanceProcAddr)SDL_Vulkan_GetVkGetInstanceProcAddr();` * - * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on failure; call SDL_GetError() for more information. + * \returns the function pointer for `vkGetInstanceProcAddr` or NULL on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ @@ -149,7 +150,8 @@ extern SDL_DECLSPEC void SDLCALL SDL_Vulkan_UnloadLibrary(void); * You should not free the returned array; it is owned by SDL. * * \param count a pointer filled in with the number of extensions returned. - * \returns an array of extension name strings on success, NULL on failure; call SDL_GetError() for more information. + * \returns an array of extension name strings on success, NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * @@ -173,7 +175,8 @@ extern SDL_DECLSPEC char const * const * SDLCALL SDL_Vulkan_GetInstanceExtension * allocator that creates the surface. Can be NULL. * \param surface a pointer to a VkSurfaceKHR handle to output the newly * created surface. - * \returns 0 on success or a negative error code on failure; call SDL_GetError() for more information. + * \returns 0 on success or a negative error code on failure; call + * SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. * From 0079b6d45fcc2ab288249abedab160ee68caffa5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 12:39:34 -0700 Subject: [PATCH 414/431] SDL_GetTouchFingers() follows the SDL_GetStringRule --- include/SDL3/SDL_touch.h | 7 ++++--- src/dynapi/SDL_dynapi_procs.h | 2 +- src/events/SDL_touch.c | 6 +++--- src/video/cocoa/SDL_cocoawindow.m | 5 ++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index bb8e3664706b2..99569026083a7 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -122,16 +122,17 @@ extern SDL_DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_Touch /** * Get a list of active fingers for a given touch device. * + * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * * \param touchID the ID of a touch device. * \param count a pointer filled in with the number of fingers returned, can * be NULL. - * \returns a NULL terminated array of SDL_Finger pointers which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for + * \returns a NULL terminated array of SDL_Finger pointers or NULL on failure; call SDL_GetError() for * more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_Finger ** SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count); +extern SDL_DECLSPEC const SDL_Finger * const * SDLCALL SDL_GetTouchFingers(SDL_TouchID touchID, int *count); /* Ends C function definitions when using C++ */ #ifdef __cplusplus diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index 9fdf202d785f7..e3d288403dc3f 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -501,7 +501,7 @@ SDL_DYNAPI_PROC(Uint64,SDL_GetTicksNS,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetTouchDeviceName,(SDL_TouchID a),(a),return) SDL_DYNAPI_PROC(SDL_TouchDeviceType,SDL_GetTouchDeviceType,(SDL_TouchID a),(a),return) SDL_DYNAPI_PROC(const SDL_TouchID*,SDL_GetTouchDevices,(int *a),(a),return) -SDL_DYNAPI_PROC(SDL_Finger**,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),return) +SDL_DYNAPI_PROC(const SDL_Finger* const*,SDL_GetTouchFingers,(SDL_TouchID a, int *b),(a,b),return) SDL_DYNAPI_PROC(const char*,SDL_GetUserFolder,(SDL_Folder a),(a),return) SDL_DYNAPI_PROC(int,SDL_GetVersion,(void),(),return) SDL_DYNAPI_PROC(const char*,SDL_GetVideoDriver,(int a),(a),return) diff --git a/src/events/SDL_touch.c b/src/events/SDL_touch.c index c2cada05677ba..9bb14ed6446cb 100644 --- a/src/events/SDL_touch.c +++ b/src/events/SDL_touch.c @@ -134,7 +134,7 @@ static SDL_Finger *SDL_GetFinger(const SDL_Touch *touch, SDL_FingerID id) return touch->fingers[index]; } -SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) +const SDL_Finger * const * SDL_GetTouchFingers(SDL_TouchID touchID, int *count) { SDL_Finger **fingers; SDL_Finger *finger_data; @@ -153,7 +153,7 @@ SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) if (!fingers) { return NULL; } - finger_data = (SDL_Finger *)((Uint8 *)fingers + (touch->num_fingers + 1) * sizeof(*fingers)); + finger_data = (SDL_Finger *)(fingers + (touch->num_fingers + 1)); for (int i = 0; i < touch->num_fingers; ++i) { fingers[i] = &finger_data[i]; @@ -164,7 +164,7 @@ SDL_Finger **SDL_GetTouchFingers(SDL_TouchID touchID, int *count) if (count) { *count = touch->num_fingers; } - return fingers; + return SDL_FreeLater(fingers); } int SDL_AddTouch(SDL_TouchID touchID, SDL_TouchDeviceType type, const char *name) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index e3cfbf0508b84..01b46f19bb656 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -1735,11 +1735,11 @@ - (void)touchesBeganWithEvent:(NSEvent *)theEvent } if (existingTouchCount == 0) { int numFingers; - SDL_Finger **fingers = SDL_GetTouchFingers(touchID, &numFingers); + const SDL_Finger * const *fingers = SDL_GetTouchFingers(touchID, &numFingers); if (fingers) { DLog("Reset Lost Fingers: %d", numFingers); for (--numFingers; numFingers >= 0; --numFingers) { - SDL_Finger *finger = fingers[numFingers]; + const SDL_Finger *finger = fingers[numFingers]; /* trackpad touches have no window. If we really wanted one we could * use the window that has mouse or keyboard focus. * Sending a null window currently also prevents synthetic mouse @@ -1748,7 +1748,6 @@ - (void)touchesBeganWithEvent:(NSEvent *)theEvent SDL_Window *window = NULL; SDL_SendTouch(Cocoa_GetEventTimestamp([theEvent timestamp]), touchID, finger->id, window, SDL_FALSE, 0, 0, 0); } - SDL_free(fingers); } } From 93db5ef135700ee97b3d1c8ccac933b326adb61c Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 12:42:37 -0700 Subject: [PATCH 415/431] Fixed documentation for SDL_GlobDirectory() --- include/SDL3/SDL_filesystem.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/SDL3/SDL_filesystem.h b/include/SDL3/SDL_filesystem.h index dfaaf544dcb88..b0a0f19fbe4ac 100644 --- a/include/SDL3/SDL_filesystem.h +++ b/include/SDL3/SDL_filesystem.h @@ -367,8 +367,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_GetPathInfo(const char *path, SDL_PathInfo * * \param count on return, will be set to the number of items in the returned * array. Can be NULL. * \returns an array of strings on success or NULL on failure; call - * SDL_GetError() for more information. The caller should pass the - * returned pointer to SDL_free when done with it. + * SDL_GetError() for more information. * * \threadsafety It is safe to call this function from any thread. * From b80784fcedf81ea4137ae3c1ee6ce70d4f94ae61 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 12:47:04 -0700 Subject: [PATCH 416/431] SDL_GetGamepadBindings() follows the SDL_GetStringRule --- include/SDL3/SDL_gamepad.h | 10 ++++++---- src/dynapi/SDL_dynapi_procs.h | 2 +- src/joystick/SDL_gamepad.c | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 3313bd6f7ed5d..36ad8e1c77793 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -1023,15 +1023,17 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void); /** * Get the SDL joystick layer bindings for a gamepad. * + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). + * * \param gamepad a gamepad. * \param count a pointer filled in with the number of bindings returned. - * \returns a NULL terminated array of pointers to bindings which should be - * freed with SDL_free(), or NULL on failure; call SDL_GetError() for - * more details. + * \returns a NULL terminated array of pointers to bindings or NULL on failure; call SDL_GetError() for + * more information. * * \since This function is available since SDL 3.0.0. */ -extern SDL_DECLSPEC SDL_GamepadBinding ** SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count); +extern SDL_DECLSPEC const SDL_GamepadBinding * const * SDLCALL SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count); /** * Manually pump gamepad updates if not using the loop. diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h index e3d288403dc3f..0eeb706abfa70 100644 --- a/src/dynapi/SDL_dynapi_procs.h +++ b/src/dynapi/SDL_dynapi_procs.h @@ -276,7 +276,7 @@ SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForAxis,(SDL_Gamepad SDL_DYNAPI_PROC(const char*,SDL_GetGamepadAppleSFSymbolsNameForButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(Sint16,SDL_GetGamepadAxis,(SDL_Gamepad *a, SDL_GamepadAxis b),(a,b),return) SDL_DYNAPI_PROC(SDL_GamepadAxis,SDL_GetGamepadAxisFromString,(const char *a),(a),return) -SDL_DYNAPI_PROC(SDL_GamepadBinding**,SDL_GetGamepadBindings,(SDL_Gamepad *a, int *b),(a,b),return) +SDL_DYNAPI_PROC(const SDL_GamepadBinding* const*,SDL_GetGamepadBindings,(SDL_Gamepad *a, int *b),(a,b),return) SDL_DYNAPI_PROC(Uint8,SDL_GetGamepadButton,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) SDL_DYNAPI_PROC(SDL_GamepadButton,SDL_GetGamepadButtonFromString,(const char *a),(a),return) SDL_DYNAPI_PROC(SDL_GamepadButtonLabel,SDL_GetGamepadButtonLabel,(SDL_Gamepad *a, SDL_GamepadButton b),(a,b),return) diff --git a/src/joystick/SDL_gamepad.c b/src/joystick/SDL_gamepad.c index 5d023396aa25c..b2576dc26d862 100644 --- a/src/joystick/SDL_gamepad.c +++ b/src/joystick/SDL_gamepad.c @@ -3543,7 +3543,7 @@ SDL_Gamepad *SDL_GetGamepadFromPlayerIndex(int player_index) /* * Get the SDL joystick layer bindings for this gamepad */ -SDL_GamepadBinding **SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count) +const SDL_GamepadBinding * const*SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count) { SDL_GamepadBinding **bindings = NULL; @@ -3574,7 +3574,7 @@ SDL_GamepadBinding **SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count) } SDL_UnlockJoysticks(); - return bindings; + return SDL_FreeLater(bindings); } int SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms) From 02dceed76093ea183c45086d02d4800da706665b Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 12:51:59 -0700 Subject: [PATCH 417/431] Simpler pointer arithmetic --- src/camera/SDL_camera.c | 2 +- src/locale/SDL_locale.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index 0247e660f49ed..45b35af952a78 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -747,7 +747,7 @@ const SDL_CameraSpec * const *SDL_GetCameraSupportedFormats(SDL_CameraID instanc int num_specs = device->num_specs; const SDL_CameraSpec **retval = (const SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(*retval)) + (num_specs * sizeof (**retval))); if (retval) { - SDL_CameraSpec *specs = (SDL_CameraSpec *)((Uint8 *)retval + ((num_specs + 1) * sizeof(*retval))); + SDL_CameraSpec *specs = (SDL_CameraSpec *)(retval + (num_specs + 1)); SDL_memcpy(specs, device->all_specs, num_specs * sizeof(*specs)); for (i = 0; i < num_specs; ++i) { retval[i] = specs++; diff --git a/src/locale/SDL_locale.c b/src/locale/SDL_locale.c index ef118cac5c974..ca46db56600ba 100644 --- a/src/locale/SDL_locale.c +++ b/src/locale/SDL_locale.c @@ -56,7 +56,7 @@ static const SDL_Locale * const *build_locales_from_csv_string(char *csv, int *c if (!retval) { return NULL; /* oh well */ } - loc = (SDL_Locale *)((Uint8 *)retval + ((num_locales + 1) * sizeof(SDL_Locale *))); + loc = (SDL_Locale *)(retval + (num_locales + 1)); ptr = (char *)(loc + num_locales); SDL_memcpy(ptr, csv, slen); From fc8cd657a5aa741856963a57a7a463cfeaf722ee Mon Sep 17 00:00:00 2001 From: SDL Wiki Bot Date: Fri, 19 Jul 2024 20:08:05 +0000 Subject: [PATCH 418/431] Sync SDL3 wiki -> header --- include/SDL3/SDL_gamepad.h | 4 ++-- include/SDL3/SDL_touch.h | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/include/SDL3/SDL_gamepad.h b/include/SDL3/SDL_gamepad.h index 36ad8e1c77793..52031e02a0d76 100644 --- a/include/SDL3/SDL_gamepad.h +++ b/include/SDL3/SDL_gamepad.h @@ -1028,8 +1028,8 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GamepadEventsEnabled(void); * * \param gamepad a gamepad. * \param count a pointer filled in with the number of bindings returned. - * \returns a NULL terminated array of pointers to bindings or NULL on failure; call SDL_GetError() for - * more information. + * \returns a NULL terminated array of pointers to bindings or NULL on + * failure; call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ diff --git a/include/SDL3/SDL_touch.h b/include/SDL3/SDL_touch.h index 99569026083a7..fac421fded1f8 100644 --- a/include/SDL3/SDL_touch.h +++ b/include/SDL3/SDL_touch.h @@ -122,13 +122,14 @@ extern SDL_DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_Touch /** * Get a list of active fingers for a given touch device. * - * This returns temporary memory which will be automatically freed later, and can be claimed with SDL_ClaimTemporaryMemory(). + * This returns temporary memory which will be automatically freed later, and + * can be claimed with SDL_ClaimTemporaryMemory(). * * \param touchID the ID of a touch device. * \param count a pointer filled in with the number of fingers returned, can * be NULL. - * \returns a NULL terminated array of SDL_Finger pointers or NULL on failure; call SDL_GetError() for - * more information. + * \returns a NULL terminated array of SDL_Finger pointers or NULL on failure; + * call SDL_GetError() for more information. * * \since This function is available since SDL 3.0.0. */ From cc47969a796cff7a0a6f1c8ac4de00218d116d8d Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 19 Jul 2024 20:11:58 +0200 Subject: [PATCH 419/431] cmake: actually check ARM64EC --- cmake/sdlcpu.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/sdlcpu.cmake b/cmake/sdlcpu.cmake index b0e75bf48b626..69142bc8322a8 100644 --- a/cmake/sdlcpu.cmake +++ b/cmake/sdlcpu.cmake @@ -1,6 +1,6 @@ function(SDL_DetectTargetCPUArchitectures DETECTED_ARCHS) - set(known_archs EMSCRIPTEN ARM32 ARM64 LOONGARCH64 POWERPC32 POWERPC64 X86 X64) + set(known_archs EMSCRIPTEN ARM32 ARM64 ARM64EC LOONGARCH64 POWERPC32 POWERPC64 X86 X64) if(APPLE AND CMAKE_OSX_ARCHITECTURES) foreach(known_arch IN LISTS known_archs) From f0a839b9b78390bf9b552e5d585f780de1e212d1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 13:38:41 -0700 Subject: [PATCH 420/431] Removed SDL 2.1 note, we're not going to revisit this for SDL 3.0 Closes https://github.com/libsdl-org/SDL/issues/9480 --- include/SDL3/SDL_haptic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/SDL3/SDL_haptic.h b/include/SDL3/SDL_haptic.h index 9a1231df6e601..05263475ee2e2 100644 --- a/include/SDL3/SDL_haptic.h +++ b/include/SDL3/SDL_haptic.h @@ -126,7 +126,7 @@ extern "C" { #endif /* __cplusplus */ -/* FIXME: For SDL 2.1, adjust all the magnitude variables to be Uint16 (0xFFFF). +/* FIXME: * * At the moment the magnitude variables are mixed between signed/unsigned, and * it is also not made clear that ALL of those variables expect a max of 0x7FFF. From 64cb431ead978035a189edfb7cc0d41946197d2a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 14:45:47 -0700 Subject: [PATCH 421/431] Updated migration documentation for functions that now return temporary memory --- docs/README-migration.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/README-migration.md b/docs/README-migration.md index 2d6ea08bb3455..060bdfb292a51 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -298,6 +298,10 @@ The following symbols have been renamed: The following symbols have been removed: * SDL_MIX_MAXVOLUME - mixer volume is now a float between 0.0 and 1.0 +## SDL_clipboard.h + +SDL_GetClipboardText() and SDL_GetPrimarySelectionText() return a const pointer to temporary memory, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it. + ## SDL_cpuinfo.h The intrinsics headers (mmintrin.h, etc.) have been moved to `` and are no longer automatically included in SDL.h. @@ -454,6 +458,10 @@ The following functions have been removed: The following enums have been renamed: * SDL_eventaction => SDL_EventAction +## SDL_filesystem.h + +SDL_GetBasePath() and SDL_GetPrefPath() return a const pointer to temporary memory, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it. + ## SDL_gamecontroller.h SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match. @@ -686,6 +694,10 @@ be dropped into an SDL3 or SDL2 program, to continue to provide this functionality to your app and aid migration. That is located in the [SDL_gesture GitHub repository](https://github.com/libsdl-org/SDL_gesture). +## SDL_guid.h + +SDL_GUIDToString() returns a const pointer to the string representation of a GUID. + ## SDL_haptic.h Gamepads with simple rumble capability no longer show up in the SDL haptics interface, instead you should use SDL_RumbleGamepad(). @@ -1017,6 +1029,10 @@ The following symbols have been renamed: SDL_LoadFunction() now returns `SDL_FunctionPointer` instead of `void *`, and should be cast to the appropriate function type. You can define SDL_FUNCTION_POINTER_IS_VOID_POINTER in your project to restore the previous behavior. +## SDL_locale.h + +SDL_GetPreferredLocales() returns a const array of locale pointers, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it. + ## SDL_log.h The following macros have been removed: @@ -2054,6 +2070,8 @@ SDL_WindowFlags is used instead of Uint32 for API functions that refer to window SDL_GetWindowOpacity() directly returns the opacity instead of using an out parameter. +SDL_GetWindowICCProfile() returns a const pointer to temporary memory, which does not need to be freed. You can use SDL_ClaimTemporaryMemory() to convert it to a non-const pointer that should be freed when you're done with it. + The following functions have been renamed: * SDL_GL_DeleteContext() => SDL_GL_DestroyContext() * SDL_GetClosestDisplayMode() => SDL_GetClosestFullscreenDisplayMode() From aafbbe4ebc72c3ff2298eb7c30bc256c847bddc5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 19 Jul 2024 15:38:41 -0700 Subject: [PATCH 422/431] Fixed warning C4090: 'function': different 'const' qualifiers --- src/camera/SDL_camera.c | 2 +- src/events/SDL_keyboard.c | 4 ++-- src/locale/SDL_locale.c | 4 ++-- src/video/SDL_video.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/camera/SDL_camera.c b/src/camera/SDL_camera.c index 45b35af952a78..0c5e835f5a3d7 100644 --- a/src/camera/SDL_camera.c +++ b/src/camera/SDL_camera.c @@ -745,7 +745,7 @@ const SDL_CameraSpec * const *SDL_GetCameraSupportedFormats(SDL_CameraID instanc int i; int num_specs = device->num_specs; - const SDL_CameraSpec **retval = (const SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(*retval)) + (num_specs * sizeof (**retval))); + SDL_CameraSpec **retval = (SDL_CameraSpec **) SDL_malloc(((num_specs + 1) * sizeof(*retval)) + (num_specs * sizeof (**retval))); if (retval) { SDL_CameraSpec *specs = (SDL_CameraSpec *)(retval + (num_specs + 1)); SDL_memcpy(specs, device->all_specs, num_specs * sizeof(*specs)); diff --git a/src/events/SDL_keyboard.c b/src/events/SDL_keyboard.c index 8c4c7c45bcc42..b0c3fcb66b5e6 100644 --- a/src/events/SDL_keyboard.c +++ b/src/events/SDL_keyboard.c @@ -762,7 +762,7 @@ int SDL_SendEditingText(const char *text, int start, int length) static const char * const *CreateCandidatesForEvent(char **candidates, int num_candidates) { - const char **event_candidates; + char **event_candidates; int i; char *ptr; size_t total_length = (num_candidates + 1) * sizeof(*event_candidates); @@ -773,7 +773,7 @@ static const char * const *CreateCandidatesForEvent(char **candidates, int num_c total_length += length; } - event_candidates = (const char **)SDL_malloc(total_length); + event_candidates = (char **)SDL_malloc(total_length); if (!event_candidates) { return NULL; } diff --git a/src/locale/SDL_locale.c b/src/locale/SDL_locale.c index ca46db56600ba..341bf682868f9 100644 --- a/src/locale/SDL_locale.c +++ b/src/locale/SDL_locale.c @@ -29,7 +29,7 @@ static const SDL_Locale * const *build_locales_from_csv_string(char *csv, int *c size_t alloclen; char *ptr; SDL_Locale *loc; - const SDL_Locale **retval; + SDL_Locale **retval; if (count) { *count = 0; @@ -52,7 +52,7 @@ static const SDL_Locale * const *build_locales_from_csv_string(char *csv, int *c slen = ((size_t)(ptr - csv)) + 1; /* SDL_strlen(csv) + 1 */ alloclen = (num_locales * sizeof(SDL_Locale *)) + (num_locales * sizeof(SDL_Locale)) + slen; - retval = (const SDL_Locale **)SDL_calloc(1, alloclen); + retval = (SDL_Locale **)SDL_calloc(1, alloclen); if (!retval) { return NULL; /* oh well */ } diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 70c3660537003..d50af934d33dd 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1222,7 +1222,7 @@ const SDL_DisplayMode * const *SDL_GetFullscreenDisplayModes(SDL_DisplayID displ { int i; int num_modes; - const SDL_DisplayMode **retval; + SDL_DisplayMode **retval; SDL_VideoDisplay *display = SDL_GetVideoDisplay(displayID); if (count) { @@ -1236,7 +1236,7 @@ const SDL_DisplayMode * const *SDL_GetFullscreenDisplayModes(SDL_DisplayID displ } num_modes = display->num_fullscreen_modes; - retval = (const SDL_DisplayMode **)SDL_malloc((num_modes + 1) * sizeof(*retval) + num_modes * sizeof(**retval)); + retval = (SDL_DisplayMode **)SDL_malloc((num_modes + 1) * sizeof(*retval) + num_modes * sizeof(**retval)); if (retval) { SDL_DisplayMode *modes = (SDL_DisplayMode *)((Uint8 *)retval + ((num_modes + 1) * sizeof(*retval))); SDL_memcpy(modes, display->fullscreen_modes, num_modes * sizeof(*modes)); From b3b74e8aedb3c7b7c89350a8747b61b203c45f05 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 19 Jul 2024 22:49:18 +0200 Subject: [PATCH 423/431] Fix SDL3ConfigVersion.cmake of VC development package for ARM64EC --- VisualC/pkg-support/cmake/sdl3-config-version.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VisualC/pkg-support/cmake/sdl3-config-version.cmake b/VisualC/pkg-support/cmake/sdl3-config-version.cmake index 77a9541acd74e..3f5167efb3784 100644 --- a/VisualC/pkg-support/cmake/sdl3-config-version.cmake +++ b/VisualC/pkg-support/cmake/sdl3-config-version.cmake @@ -51,7 +51,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/sdlcpu.cmake") SDL_DetectTargetCPUArchitectures(_detected_archs) # check that the installed version has a compatible architecture as the one which is currently searching: -if(NOT(SDL_CPU_X86 OR SDL_CPU_X64 OR SDL_CPU_ARM64)) - set(PACKAGE_VERSION "${PACKAGE_VERSION} (X86,X64,ARM64)") +if(NOT(SDL_CPU_X86 OR SDL_CPU_X64 OR SDL_CPU_ARM64 OR SDL_CPU_ARM64EC)) + set(PACKAGE_VERSION "${PACKAGE_VERSION} (X86,X64,ARM64,ARM64EC)") set(PACKAGE_VERSION_UNSUITABLE TRUE) endif() From 476b987f1b9b8b686b7a3779e7f09e91e9fa93d4 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sat, 20 Jul 2024 00:10:19 +0200 Subject: [PATCH 424/431] intrinsics: avx, avx2 and avx512f are (currently) unsupported on arm64ec --- include/SDL3/SDL_intrin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/SDL3/SDL_intrin.h b/include/SDL3/SDL_intrin.h index 70a156340b1aa..efba11d530d53 100644 --- a/include/SDL3/SDL_intrin.h +++ b/include/SDL3/SDL_intrin.h @@ -136,21 +136,21 @@ _m_prefetch(void *__P) # if defined(__clang__) && (defined(_MSC_VER) || defined(__SCE__)) && !defined(__AVX__) && !defined(SDL_DISABLE_AVX) # define SDL_DISABLE_AVX /* see https://reviews.llvm.org/D20291 and https://reviews.llvm.org/D79194 */ # endif -# if (defined(_MSC_VER) || defined(__AVX__) || defined(SDL_HAS_TARGET_ATTRIBS)) && !defined(SDL_DISABLE_AVX) +# if (defined(_MSC_VER) || defined(__AVX__) || defined(SDL_HAS_TARGET_ATTRIBS)) && !defined(_M_ARM64EC) && !defined(SDL_DISABLE_AVX) # define SDL_AVX_INTRINSICS 1 # include # endif # if defined(__clang__) && (defined(_MSC_VER) || defined(__SCE__)) && !defined(__AVX2__) && !defined(SDL_DISABLE_AVX2) # define SDL_DISABLE_AVX2 /* see https://reviews.llvm.org/D20291 and https://reviews.llvm.org/D79194 */ # endif -# if (defined(_MSC_VER) || defined(__AVX2__) || defined(SDL_HAS_TARGET_ATTRIBS)) && !defined(SDL_DISABLE_AVX2) +# if (defined(_MSC_VER) || defined(__AVX2__) || defined(SDL_HAS_TARGET_ATTRIBS)) && !defined(_M_ARM64EC) && !defined(SDL_DISABLE_AVX2) # define SDL_AVX2_INTRINSICS 1 # include # endif # if defined(__clang__) && (defined(_MSC_VER) || defined(__SCE__)) && !defined(__AVX512F__) && !defined(SDL_DISABLE_AVX512F) # define SDL_DISABLE_AVX512F /* see https://reviews.llvm.org/D20291 and https://reviews.llvm.org/D79194 */ # endif -# if (defined(_MSC_VER) || defined(__AVX512F__) || defined(SDL_HAS_TARGET_ATTRIBS)) && !defined(SDL_DISABLE_AVX512F) +# if (defined(_MSC_VER) || defined(__AVX512F__) || defined(SDL_HAS_TARGET_ATTRIBS)) && !defined(_M_ARM64EC) && !defined(SDL_DISABLE_AVX512F) # define SDL_AVX512F_INTRINSICS 1 # include # endif From 6d39c18dd3fa8ea9e82ca9eef78fd05df3656463 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 19 Jul 2024 19:54:29 +0200 Subject: [PATCH 425/431] ci: test the MSVC development archive for targeting arm64ec --- .github/workflows/release.yml | 77 +++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e9fdc3b13b17c..58f82dc7440f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -282,6 +282,10 @@ jobs: needs: [msvc, src] runs-on: windows-latest steps: + - name: 'Fetch .github/actions/setup-ninja/action.yml' + uses: actions/checkout@v4 + with: + sparse-checkout: '.github/actions/setup-ninja/action.yml' - name: 'Download source archives' uses: actions/download-artifact@v4 with: @@ -306,41 +310,90 @@ jobs: cd '${{ github.workspace }}/vc' unzip "${{ github.workspace }}/${{ needs.msvc.outputs.VC-devel }}" echo "path=${{ github.workspace }}/vc/${{ needs.src.outputs.project }}-${{ needs.src.outputs.version }}" >>$env:GITHUB_OUTPUT + - name: Set up ninja + uses: ./.github/actions/setup-ninja + - name: 'Configure vcvars x86' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64_x86 - name: 'CMake (configure + build + tests) x86' run: | - $env:PATH += ";${{ steps.bin.outputs.path }}/x86" cmake -S "${{ steps.src.outputs.path }}/cmake/test" ` + -B build_x86 ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Debug ` + -Werror=dev ` -DTEST_FULL=TRUE ` -DTEST_STATIC=FALSE ` + -DTEST_SHARED=TRUE ` -DTEST_TEST=TRUE ` - -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" ` - -Werror=dev ` - -B build_x86 -A win32 + -DCMAKE_SUPPRESS_REGENERATION=TRUE ` + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" + Start-Sleep -Seconds 2 cmake --build build_x86 --config Release --verbose ctest --test-dir build_x86 --no-tests=error -C Release --output-on-failure + - name: 'Configure vcvars x64' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 - name: 'CMake (configure + build + tests) x64' run: | - $env:PATH += ";${{ steps.bin.outputs.path }}/x86" cmake -S "${{ steps.src.outputs.path }}/cmake/test" ` + -B build_x64 ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Debug ` + -Werror=dev ` -DTEST_FULL=TRUE ` -DTEST_STATIC=FALSE ` + -DTEST_SHARED=TRUE ` -DTEST_TEST=TRUE ` - -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" ` - -Werror=dev ` - -B build_x64 -A x64 + -DCMAKE_SUPPRESS_REGENERATION=TRUE ` + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" + Start-Sleep -Seconds 2 cmake --build build_x64 --config Release --verbose ctest --test-dir build_x64 --no-tests=error -C Release --output-on-failure + - name: 'Configure vcvars arm64' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64_arm64 - name: 'CMake (configure + build) arm64' run: | - $env:PATH += ";${{ steps.bin.outputs.path }}/x86" cmake -S "${{ steps.src.outputs.path }}/cmake/test" ` + -B build_arm64 ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Debug ` + -Werror=dev ` -DTEST_FULL=TRUE ` -DTEST_STATIC=FALSE ` + -DTEST_SHARED=TRUE ` -DTEST_TEST=TRUE ` - -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" ` - -Werror=dev ` - -B build_arm64 -A ARM64 + -DCMAKE_SUPPRESS_REGENERATION=TRUE ` + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" + Start-Sleep -Seconds 2 cmake --build build_arm64 --config Release --verbose + - name: 'CMake (configure + build) arm64ec' + run: | + cmake -S "${{ steps.src.outputs.path }}/cmake/test" ` + -B build_arm64ec ` + -GNinja ` + -DCMAKE_BUILD_TYPE=Debug ` + -Werror=dev ` + -DTEST_FULL=TRUE ` + -DTEST_STATIC=FALSE ` + -DTEST_SHARED=TRUE ` + -DTEST_TEST=TRUE ` + -DSDL_DISABLE_AVX=TRUE ` + -DSDL_DISABLE_AVX2=TRUE ` + -DSDL_DISABLE_AVX512F=TRUE ` + -DCMAKE_SUPPRESS_REGENERATION=TRUE ` + -DCMAKE_C_FLAGS="/arm64EC" ` + -DCMAKE_CXX_FLAGS="/arm64EC" ` + -DCMAKE_EXE_LINKER_FLAGS="/MACHINE:ARM64EC" ` + -DCMAKE_SHARED_LINKER_FLAGS="/MACHINE:ARM64EC" ` + -DCMAKE_STATIC_LINKER_FLAGS="/MACHINE:ARM64EC" ` + -DCMAKE_PREFIX_PATH="${{ steps.bin.outputs.path }}" + Start-Sleep -Seconds 2 + cmake --build build_arm64ec --config Release --verbose mingw: needs: [src] From 068c7854919cdb67633e7e0ebaff4496226b9659 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 19 Jul 2024 20:25:23 -0400 Subject: [PATCH 426/431] audio: Assigning a device channel map to an audio stream was quietly failing. Fixes #10317. --- src/audio/SDL_audio.c | 2 +- src/audio/SDL_audiocvt.c | 4 ++-- src/audio/SDL_sysaudio.h | 4 ++++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 3253956c167d7..9f3b0160c3c8e 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -251,7 +251,7 @@ static void UpdateAudioStreamFormatsPhysical(SDL_AudioDevice *device) // SDL_SetAudioStreamFormat does a ton of validation just to memcpy an audiospec. SDL_LockMutex(stream->lock); SDL_copyp(&stream->dst_spec, &spec); - SDL_SetAudioStreamOutputChannelMap(stream, device->chmap, spec.channels); // this should be fast for normal cases, though! + SetAudioStreamChannelMap(stream, &stream->dst_spec, &stream->dst_chmap, device->chmap, spec.channels, -1); // this should be fast for normal cases, though! SDL_UnlockMutex(stream->lock); } } diff --git a/src/audio/SDL_audiocvt.c b/src/audio/SDL_audiocvt.c index a7226dabf99d8..d785b14dc37d2 100644 --- a/src/audio/SDL_audiocvt.c +++ b/src/audio/SDL_audiocvt.c @@ -584,7 +584,7 @@ int SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_s return 0; } -static int SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec, int **stream_chmap, const int *chmap, int channels, SDL_bool isinput) +int SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec, int **stream_chmap, const int *chmap, int channels, int isinput) { if (!stream) { return SDL_InvalidParamError("stream"); @@ -602,7 +602,7 @@ static int SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec // already have this map, don't allocate/copy it again. } else if (SDL_ChannelMapIsBogus(chmap, channels)) { retval = SDL_SetError("Invalid channel mapping"); - } else if (stream->bound_device && (!!isinput == !!stream->bound_device->physical_device->recording)) { + } else if ((isinput != -1) && stream->bound_device && (!!isinput == !!stream->bound_device->physical_device->recording)) { // quietly refuse to change the format of the end currently bound to a device. } else { if (SDL_ChannelMapIsDefault(chmap, channels)) { diff --git a/src/audio/SDL_sysaudio.h b/src/audio/SDL_sysaudio.h index 20ca908574a4f..d21a6e3c6a8f4 100644 --- a/src/audio/SDL_sysaudio.h +++ b/src/audio/SDL_sysaudio.h @@ -137,6 +137,10 @@ extern void OnAudioStreamDestroy(SDL_AudioStream *stream); // This just lets audio playback apply logical device gain at the same time as audiostream gain, so it's one multiplication instead of thousands. extern int SDL_GetAudioStreamDataAdjustGain(SDL_AudioStream *stream, void *voidbuf, int len, float extra_gain); +// This is the bulk of `SDL_SetAudioStream*putChannelMap`'s work, but it lets you skip the check about changing the device end of a stream if isinput==-1. +extern int SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec, int **stream_chmap, const int *chmap, int channels, int isinput); + + typedef struct SDL_AudioDriverImpl { void (*DetectDevices)(SDL_AudioDevice **default_playback, SDL_AudioDevice **default_recording); From e1aa99573270eac053b428cc899eebf499b44eca Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Fri, 19 Jul 2024 20:35:18 -0400 Subject: [PATCH 427/431] audio: recording devices also need to update their streams' channel maps. --- src/audio/SDL_audio.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/audio/SDL_audio.c b/src/audio/SDL_audio.c index 9f3b0160c3c8e..d9c6093158ba1 100644 --- a/src/audio/SDL_audio.c +++ b/src/audio/SDL_audio.c @@ -234,7 +234,15 @@ static SDL_bool AudioDeviceCanUseSimpleCopy(SDL_AudioDevice *device) // should hold device->lock before calling. static void UpdateAudioStreamFormatsPhysical(SDL_AudioDevice *device) { - if (!device->recording) { // for recording devices, we only want to move to float32 for postmix, which we'll handle elsewhere. + if (device->recording) { // for recording devices, we only want to move to float32 for postmix and gain, which we'll handle elsewhere. + // we _do_ need to make sure the channel map is correct, though... + for (SDL_LogicalAudioDevice *logdev = device->logical_devices; logdev; logdev = logdev->next) { + for (SDL_AudioStream *stream = logdev->bound_streams; stream; stream = stream->next_binding) { + // set the proper end of the stream to the device's channel map. This will obtain stream->lock itself. + SetAudioStreamChannelMap(stream, &stream->src_spec, &stream->src_chmap, device->chmap, device->spec.channels, -1); + } + } + } else { const SDL_bool simple_copy = AudioDeviceCanUseSimpleCopy(device); SDL_AudioSpec spec; From 6a62c54b9356da0fb14fdc59091eb0f4eafad967 Mon Sep 17 00:00:00 2001 From: hwsmm Date: Sat, 20 Jul 2024 16:02:33 +0900 Subject: [PATCH 428/431] Remove a duplicate definition that is already in SDL_guid.h --- include/SDL3/SDL_joystick.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/SDL3/SDL_joystick.h b/include/SDL3/SDL_joystick.h index d1327e5743fda..df874b89fbf75 100644 --- a/include/SDL3/SDL_joystick.h +++ b/include/SDL3/SDL_joystick.h @@ -821,8 +821,6 @@ extern SDL_DECLSPEC const char * SDLCALL SDL_GetJoystickSerial(SDL_Joystick *joy */ extern SDL_DECLSPEC SDL_JoystickType SDLCALL SDL_GetJoystickType(SDL_Joystick *joystick); -extern SDL_DECLSPEC SDL_GUID SDLCALL SDL_GUIDFromString(const char *pchGUID); - /** * Get the device information encoded in a SDL_GUID structure. * From 6a74ade73dd3c7f91bd6331fedcbdce574e92062 Mon Sep 17 00:00:00 2001 From: Frank Praznik Date: Fri, 19 Jul 2024 11:42:53 -0400 Subject: [PATCH 429/431] Make SDL_URIToLocal available to multiple platforms Moves the functions out of core/unix into SDL_utils.c --- src/SDL_utils.c | 114 ++++++++++++++++++++++++ src/SDL_utils_c.h | 13 +++ src/core/unix/SDL_uri_decode.c | 123 -------------------------- src/core/unix/SDL_uri_decode.h | 56 ------------ src/dialog/unix/SDL_portaldialog.c | 1 - src/video/wayland/SDL_waylandevents.c | 1 - src/video/x11/SDL_x11events.c | 1 - 7 files changed, 127 insertions(+), 182 deletions(-) delete mode 100644 src/core/unix/SDL_uri_decode.c delete mode 100644 src/core/unix/SDL_uri_decode.h diff --git a/src/SDL_utils.c b/src/SDL_utils.c index 222cf49a3ed13..26b838258d10f 100644 --- a/src/SDL_utils.c +++ b/src/SDL_utils.c @@ -22,6 +22,10 @@ #include "SDL_hashtable.h" +#if defined(SDL_PLATFORM_UNIX) || defined(SDL_PLATFORM_APPLE) +#include +#endif + /* Common utility functions that aren't in the public API */ int SDL_powerof2(int x) @@ -206,3 +210,113 @@ void SDL_SetObjectsInvalid(void) SDL_objects = NULL; } } + +static int SDL_URIDecode(const char *src, char *dst, int len) +{ + int ri, wi, di; + char decode = '\0'; + if (!src || !dst || len < 0) { + return -1; + } + if (len == 0) { + len = SDL_strlen(src); + } + for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) { + if (di == 0) { + /* start decoding */ + if (src[ri] == '%') { + decode = '\0'; + di += 1; + continue; + } + /* normal write */ + dst[wi] = src[ri]; + wi += 1; + } else if (di == 1 || di == 2) { + char off = '\0'; + char isa = src[ri] >= 'a' && src[ri] <= 'f'; + char isA = src[ri] >= 'A' && src[ri] <= 'F'; + char isn = src[ri] >= '0' && src[ri] <= '9'; + if (!(isa || isA || isn)) { + /* not a hexadecimal */ + int sri; + for (sri = ri - di; sri <= ri; sri += 1) { + dst[wi] = src[sri]; + wi += 1; + } + di = 0; + continue; + } + /* itsy bitsy magicsy */ + if (isn) { + off = 0 - '0'; + } else if (isa) { + off = 10 - 'a'; + } else if (isA) { + off = 10 - 'A'; + } + decode |= (src[ri] + off) << (2 - di) * 4; + if (di == 2) { + dst[wi] = decode; + wi += 1; + di = 0; + } else { + di += 1; + } + } + } + dst[wi] = '\0'; + return wi; +} + +int SDL_URIToLocal(const char *src, char *dst) +{ + if (SDL_memcmp(src, "file:/", 6) == 0) { + src += 6; /* local file? */ + } else if (SDL_strstr(src, ":/") != NULL) { + return -1; /* wrong scheme */ + } + + SDL_bool local = src[0] != '/' || (src[0] != '\0' && src[1] == '/'); + + /* Check the hostname, if present. RFC 3986 states that the hostname component of a URI is not case-sensitive. */ + if (!local && src[0] == '/' && src[2] != '/') { + char *hostname_end = SDL_strchr(src + 1, '/'); + if (hostname_end) { + const size_t src_len = hostname_end - (src + 1); + size_t hostname_len; + +#if defined(SDL_PLATFORM_UNIX) || defined(SDL_PLATFORM_APPLE) + char hostname[257]; + if (gethostname(hostname, 255) == 0) { + hostname[256] = '\0'; + hostname_len = SDL_strlen(hostname); + if (hostname_len == src_len && SDL_strncasecmp(src + 1, hostname, src_len) == 0) { + src = hostname_end + 1; + local = SDL_TRUE; + } + } +#endif + + if (!local) { + static const char *localhost = "localhost"; + hostname_len = SDL_strlen(localhost); + if (hostname_len == src_len && SDL_strncasecmp(src + 1, localhost, src_len) == 0) { + src = hostname_end + 1; + local = SDL_TRUE; + } + } + } + } + + if (local) { + /* Convert URI escape sequences to real characters */ + if (src[0] == '/') { + src++; + } else { + src--; + } + return SDL_URIDecode(src, dst, 0); + } + return -1; +} diff --git a/src/SDL_utils_c.h b/src/SDL_utils_c.h index 35d8543e8a04f..5e41da3e7a656 100644 --- a/src/SDL_utils_c.h +++ b/src/SDL_utils_c.h @@ -32,6 +32,19 @@ extern void SDL_CalculateFraction(float x, int *numerator, int *denominator); extern SDL_bool SDL_endswith(const char *string, const char *suffix); +/** Convert URI to a local filename, stripping the "file://" + * preamble and hostname if present, and writes the result + * to the dst buffer. Since URI-encoded characters take + * three times the space of normal characters, src and dst + * can safely point to the same buffer for in situ conversion. + * + * Returns the number of decoded bytes that wound up in + * the destination buffer, excluding the terminating NULL byte. + * + * On error, -1 is returned. + */ +extern int SDL_URIToLocal(const char *src, char *dst); + typedef enum { SDL_OBJECT_TYPE_UNKNOWN, diff --git a/src/core/unix/SDL_uri_decode.c b/src/core/unix/SDL_uri_decode.c deleted file mode 100644 index dd60595864d42..0000000000000 --- a/src/core/unix/SDL_uri_decode.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "SDL_internal.h" - -#include "SDL_uri_decode.h" -#include -#include - -int SDL_URIDecode(const char *src, char *dst, int len) -{ - int ri, wi, di; - char decode = '\0'; - if (!src || !dst || len < 0) { - errno = EINVAL; - return -1; - } - if (len == 0) { - len = SDL_strlen(src); - } - for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) { - if (di == 0) { - /* start decoding */ - if (src[ri] == '%') { - decode = '\0'; - di += 1; - continue; - } - /* normal write */ - dst[wi] = src[ri]; - wi += 1; - continue; - } else if (di == 1 || di == 2) { - char off = '\0'; - char isa = src[ri] >= 'a' && src[ri] <= 'f'; - char isA = src[ri] >= 'A' && src[ri] <= 'F'; - char isn = src[ri] >= '0' && src[ri] <= '9'; - if (!(isa || isA || isn)) { - /* not a hexadecimal */ - int sri; - for (sri = ri - di; sri <= ri; sri += 1) { - dst[wi] = src[sri]; - wi += 1; - } - di = 0; - continue; - } - /* itsy bitsy magicsy */ - if (isn) { - off = 0 - '0'; - } else if (isa) { - off = 10 - 'a'; - } else if (isA) { - off = 10 - 'A'; - } - decode |= (src[ri] + off) << (2 - di) * 4; - if (di == 2) { - dst[wi] = decode; - wi += 1; - di = 0; - } else { - di += 1; - } - continue; - } - } - dst[wi] = '\0'; - return wi; -} - -int SDL_URIToLocal(const char *src, char *dst) -{ - if (SDL_memcmp(src, "file:/", 6) == 0) { - src += 6; /* local file? */ - } else if (SDL_strstr(src, ":/") != NULL) { - return -1; /* wrong scheme */ - } - - SDL_bool local = src[0] != '/' || (src[0] != '\0' && src[1] == '/'); - - /* got a hostname? */ - if (!local && src[0] == '/' && src[2] != '/') { - char *hostname_end = SDL_strchr(src + 1, '/'); - if (hostname_end) { - char hostname[257]; - if (gethostname(hostname, 255) == 0) { - hostname[256] = '\0'; - if (SDL_memcmp(src + 1, hostname, hostname_end - (src + 1)) == 0) { - src = hostname_end + 1; - local = SDL_TRUE; - } - } - } - } - if (local) { - /* Convert URI escape sequences to real characters */ - if (src[0] == '/') { - src++; - } else { - src--; - } - return SDL_URIDecode(src, dst, 0); - } - return -1; -} diff --git a/src/core/unix/SDL_uri_decode.h b/src/core/unix/SDL_uri_decode.h deleted file mode 100644 index fbe33f12b8dd9..0000000000000 --- a/src/core/unix/SDL_uri_decode.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - Simple DirectMedia Layer - Copyright (C) 1997-2024 Sam Lantinga - - This software is provided 'as-is', without any express or implied - warranty. In no event will the authors be held liable for any damages - arising from the use of this software. - - Permission is granted to anyone to use this software for any purpose, - including commercial applications, and to alter it and redistribute it - freely, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - 3. This notice may not be removed or altered from any source distribution. -*/ - -#include "SDL_internal.h" - -#ifndef SDL_uri_decode_h_ -#define SDL_uri_decode_h_ - -/* Decodes URI escape sequences in string src of len bytes - * (excluding the terminating NULL byte) into the dst buffer. - * Since URI-encoded characters take three times the space of - * normal characters, src and dst can safely point to the same - * buffer for in situ conversion. - * - * The buffer is guaranteed to be NULL-terminated, but - * may contain embedded NULL bytes. - * - * Returns the number of decoded bytes that wound up in - * the destination buffer, excluding the terminating NULL byte. - * - * On error, -1 is returned. - */ -int SDL_URIDecode(const char *src, char *dst, int len); - -/* Convert URI to a local filename, stripping the "file://" - * preamble and hostname if present, and writes the result - * to the dst buffer. Since URI-encoded characters take - * three times the space of normal characters, src and dst - * can safely point to the same buffer for in situ conversion. - * - * Returns the number of decoded bytes that wound up in - * the destination buffer, excluding the terminating NULL byte. - * - * On error, -1 is returned; - */ -int SDL_URIToLocal(const char *src, char *dst); - -#endif /* SDL_uri_decode_h_ */ diff --git a/src/dialog/unix/SDL_portaldialog.c b/src/dialog/unix/SDL_portaldialog.c index de75719eb84f3..b5e7348c20ad0 100644 --- a/src/dialog/unix/SDL_portaldialog.c +++ b/src/dialog/unix/SDL_portaldialog.c @@ -22,7 +22,6 @@ #include "../SDL_dialog_utils.h" #include "../../core/linux/SDL_dbus.h" -#include "../../core/unix/SDL_uri_decode.h" #ifdef SDL_USE_LIBDBUS diff --git a/src/video/wayland/SDL_waylandevents.c b/src/video/wayland/SDL_waylandevents.c index 7ce9b7cb32405..7c77bee7e09e9 100644 --- a/src/video/wayland/SDL_waylandevents.c +++ b/src/video/wayland/SDL_waylandevents.c @@ -24,7 +24,6 @@ #ifdef SDL_VIDEO_DRIVER_WAYLAND #include "../../core/unix/SDL_poll.h" -#include "../../core/unix/SDL_uri_decode.h" #include "../../events/SDL_events_c.h" #include "../../events/SDL_scancode_tables_c.h" #include "../../core/linux/SDL_system_theme.h" diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index 7f62f37e84c77..e4650c32c89f4 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -36,7 +36,6 @@ #include "SDL_x11settings.h" #include "../SDL_clipboard_c.h" #include "../../core/unix/SDL_poll.h" -#include "../../core/unix/SDL_uri_decode.h" #include "../../events/SDL_events_c.h" #include "../../events/SDL_mouse_c.h" #include "../../events/SDL_touch_c.h" From 03bb2c17ed10d25c199b7bdab6e5adab8bc593be Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 17 Jul 2024 22:49:05 -0700 Subject: [PATCH 430/431] Enable texture wrapping for SDL_RenderGeometry() Currently wrapping is based on whether texture coordinates are outside of [0,1], but the code is structured so it's easy to add an API to set it and add additional wrapping modes if we want. Fixes https://github.com/libsdl-org/SDL/issues/9238 Closes https://github.com/libsdl-org/SDL/pull/5369 --- src/render/SDL_render.c | 27 +- src/render/SDL_sysrender.h | 9 + src/render/direct3d/SDL_render_d3d.c | 42 +- src/render/direct3d11/SDL_render_d3d11.c | 80 +- src/render/direct3d12/SDL_render_d3d12.c | 65 +- src/render/metal/SDL_render_metal.m | 91 ++- src/render/opengl/SDL_render_gl.c | 54 +- src/render/opengles2/SDL_render_gles2.c | 42 +- src/render/software/SDL_render_sw.c | 3 +- src/render/software/SDL_triangle.c | 43 +- src/render/software/SDL_triangle.h | 5 +- src/render/vulkan/SDL_render_vulkan.c | 85 +- test/testautomation_images.c | 948 +++++++++++++++++------ test/testautomation_images.h | 13 +- test/testautomation_render.c | 109 ++- 15 files changed, 1198 insertions(+), 418 deletions(-) diff --git a/src/render/SDL_render.c b/src/render/SDL_render.c index 1f44e833a0b40..6bacccddc8976 100644 --- a/src/render/SDL_render.c +++ b/src/render/SDL_render.c @@ -576,6 +576,7 @@ static SDL_RenderCommand *PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_Ren cmd->data.draw.color = *color; cmd->data.draw.blend = blendMode; cmd->data.draw.texture = texture; + cmd->data.draw.texture_address_mode = SDL_TEXTURE_ADDRESS_CLAMP; } } return cmd; @@ -715,12 +716,14 @@ static int QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture, const float *uv, int uv_stride, int num_vertices, const void *indices, int num_indices, int size_indices, - float scale_x, float scale_y) + float scale_x, float scale_y, SDL_TextureAddressMode texture_address_mode) { SDL_RenderCommand *cmd; int retval = -1; cmd = PrepQueueCmdDraw(renderer, SDL_RENDERCMD_GEOMETRY, texture); if (cmd) { + cmd->data.draw.texture_address_mode = texture_address_mode; + retval = renderer->QueueGeometry(renderer, cmd, texture, xy, xy_stride, color, color_stride, uv, uv_stride, @@ -3602,7 +3605,7 @@ int SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count) retval = QueueCmdGeometry(renderer, NULL, xy, xy_stride, &renderer->color, 0 /* color_stride */, NULL, 0, num_vertices, indices, num_indices, size_indices, - 1.0f, 1.0f); + 1.0f, 1.0f, SDL_TEXTURE_ADDRESS_CLAMP); } SDL_small_free(xy, isstack1); @@ -3818,7 +3821,7 @@ int SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FR num_vertices, indices, num_indices, size_indices, renderer->view->scale.x, - renderer->view->scale.y); + renderer->view->scale.y, SDL_TEXTURE_ADDRESS_CLAMP); } else { real_dstrect.x *= renderer->view->scale.x; @@ -3976,7 +3979,7 @@ int SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture, num_vertices, indices, num_indices, size_indices, renderer->view->scale.x, - renderer->view->scale.y); + renderer->view->scale.y, SDL_TEXTURE_ADDRESS_CLAMP); } else { retval = QueueCmdCopyEx(renderer, texture, &real_srcrect, &real_dstrect, angle, &real_center, flip, @@ -4340,7 +4343,7 @@ static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, prev, 3, 4, renderer->view->scale.x, - renderer->view->scale.y); + renderer->view->scale.y, SDL_TEXTURE_ADDRESS_CLAMP); if (retval < 0) { goto end; } @@ -4361,7 +4364,7 @@ static int SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, prev, 3, 4, renderer->view->scale.x, - renderer->view->scale.y); + renderer->view->scale.y, SDL_TEXTURE_ADDRESS_CLAMP); if (retval < 0) { goto end; } @@ -4386,6 +4389,7 @@ int SDL_RenderGeometryRaw(SDL_Renderer *renderer, { int i; int count = indices ? num_indices : num_vertices; + SDL_TextureAddressMode texture_address_mode; CHECK_RENDERER_MAGIC(renderer, -1); @@ -4440,13 +4444,16 @@ int SDL_RenderGeometryRaw(SDL_Renderer *renderer, texture = texture->native; } - if (texture) { + texture_address_mode = renderer->texture_address_mode; + if (texture_address_mode == SDL_TEXTURE_ADDRESS_AUTO && texture) { + texture_address_mode = SDL_TEXTURE_ADDRESS_CLAMP; for (i = 0; i < num_vertices; ++i) { const float *uv_ = (const float *)((const char *)uv + i * uv_stride); float u = uv_[0]; float v = uv_[1]; if (u < 0.0f || v < 0.0f || u > 1.0f || v > 1.0f) { - return SDL_SetError("Values of 'uv' out of bounds %f %f at %d/%d", u, v, i, num_vertices); + texture_address_mode = SDL_TEXTURE_ADDRESS_WRAP; + break; } } } @@ -4473,7 +4480,7 @@ int SDL_RenderGeometryRaw(SDL_Renderer *renderer, /* For the software renderer, try to reinterpret triangles as SDL_Rect */ #if SDL_VIDEO_RENDER_SW - if (renderer->software) { + if (renderer->software && texture_address_mode == SDL_TEXTURE_ADDRESS_CLAMP) { return SDL_SW_RenderGeometryRaw(renderer, texture, xy, xy_stride, color, color_stride, uv, uv_stride, num_vertices, indices, num_indices, size_indices); @@ -4485,7 +4492,7 @@ int SDL_RenderGeometryRaw(SDL_Renderer *renderer, num_vertices, indices, num_indices, size_indices, renderer->view->scale.x, - renderer->view->scale.y); + renderer->view->scale.y, texture_address_mode); } SDL_Surface *SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect) diff --git a/src/render/SDL_sysrender.h b/src/render/SDL_sysrender.h index 50fd617d572b5..d7dd2169e9d88 100644 --- a/src/render/SDL_sysrender.h +++ b/src/render/SDL_sysrender.h @@ -30,6 +30,13 @@ extern "C" { #endif +typedef enum SDL_TextureAddressMode +{ + SDL_TEXTURE_ADDRESS_AUTO, + SDL_TEXTURE_ADDRESS_CLAMP, + SDL_TEXTURE_ADDRESS_WRAP, +} SDL_TextureAddressMode; + /** * A rectangle, with the origin at the upper left (double precision). */ @@ -132,6 +139,7 @@ typedef struct SDL_RenderCommand SDL_FColor color; SDL_BlendMode blend; SDL_Texture *texture; + SDL_TextureAddressMode texture_address_mode; } draw; struct { @@ -262,6 +270,7 @@ struct SDL_Renderer float color_scale; SDL_FColor color; /**< Color for drawing operations values */ SDL_BlendMode blendMode; /**< The drawing blend mode */ + SDL_TextureAddressMode texture_address_mode; SDL_RenderCommand *render_commands; SDL_RenderCommand *render_commands_tail; diff --git a/src/render/direct3d/SDL_render_d3d.c b/src/render/direct3d/SDL_render_d3d.c index 06bdbbe2c9aba..9e2e67670abf6 100644 --- a/src/render/direct3d/SDL_render_d3d.c +++ b/src/render/direct3d/SDL_render_d3d.c @@ -62,7 +62,8 @@ typedef struct SDL_bool updateSize; SDL_bool beginScene; SDL_bool enableSeparateAlphaBlend; - D3DTEXTUREFILTERTYPE scaleMode[8]; + D3DTEXTUREFILTERTYPE scaleMode[3]; + SDL_TextureAddressMode addressMode[3]; IDirect3DSurface9 *defaultRenderTarget; IDirect3DSurface9 *currentRenderTarget; void *d3dxDLL; @@ -277,6 +278,9 @@ static void D3D_InitRenderState(D3D_RenderData *data) /* Reset our current scale mode */ SDL_memset(data->scaleMode, 0xFF, sizeof(data->scaleMode)); + /* Reset our current address mode */ + SDL_zeroa(data->addressMode); + /* Start the render with beginScene */ data->beginScene = SDL_TRUE; } @@ -927,19 +931,32 @@ static int BindTextureRep(IDirect3DDevice9 *device, D3D_TextureRep *texture, DWO static void UpdateTextureScaleMode(D3D_RenderData *data, D3D_TextureData *texturedata, unsigned index) { if (texturedata->scaleMode != data->scaleMode[index]) { - IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MINFILTER, - texturedata->scaleMode); - IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MAGFILTER, - texturedata->scaleMode); - IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSU, - D3DTADDRESS_CLAMP); - IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSV, - D3DTADDRESS_CLAMP); + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MINFILTER, texturedata->scaleMode); + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_MAGFILTER, texturedata->scaleMode); data->scaleMode[index] = texturedata->scaleMode; } } -static int SetupTextureState(D3D_RenderData *data, SDL_Texture *texture, D3D9_Shader *shader, const float **shader_params) +static void UpdateTextureAddressMode(D3D_RenderData *data, SDL_TextureAddressMode addressMode, unsigned index) +{ + if (addressMode != data->addressMode[index]) { + switch (addressMode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); + break; + case SDL_TEXTURE_ADDRESS_WRAP: + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); + IDirect3DDevice9_SetSamplerState(data->device, index, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); + break; + default: + break; + } + data->addressMode[index] = addressMode; + } +} + +static int SetupTextureState(D3D_RenderData *data, SDL_Texture *texture, SDL_TextureAddressMode addressMode, D3D9_Shader *shader, const float **shader_params) { D3D_TextureData *texturedata = (D3D_TextureData *)texture->internal; @@ -948,6 +965,7 @@ static int SetupTextureState(D3D_RenderData *data, SDL_Texture *texture, D3D9_Sh } UpdateTextureScaleMode(data, texturedata, 0); + UpdateTextureAddressMode(data, addressMode, 0); *shader = texturedata->shader; *shader_params = texturedata->shader_params; @@ -959,6 +977,8 @@ static int SetupTextureState(D3D_RenderData *data, SDL_Texture *texture, D3D9_Sh if (texturedata->yuv) { UpdateTextureScaleMode(data, texturedata, 1); UpdateTextureScaleMode(data, texturedata, 2); + UpdateTextureAddressMode(data, addressMode, 1); + UpdateTextureAddressMode(data, addressMode, 2); if (BindTextureRep(data->device, &texturedata->utexture, 1) < 0) { return -1; @@ -994,7 +1014,7 @@ static int SetDrawState(D3D_RenderData *data, const SDL_RenderCommand *cmd) IDirect3DDevice9_SetTexture(data->device, 2, NULL); } #endif - if (texture && SetupTextureState(data, texture, &shader, &shader_params) < 0) { + if (texture && SetupTextureState(data, texture, cmd->data.draw.texture_address_mode, &shader, &shader_params) < 0) { return -1; } diff --git a/src/render/direct3d11/SDL_render_d3d11.c b/src/render/direct3d11/SDL_render_d3d11.c index e338c89062a9d..e18301d0d9c09 100644 --- a/src/render/direct3d11/SDL_render_d3d11.c +++ b/src/render/direct3d11/SDL_render_d3d11.c @@ -68,6 +68,16 @@ extern ISwapChainBackgroundPanelNative *WINRT_GlobalSwapChainBackgroundPanelNati /* !!! FIXME: vertex buffer bandwidth could be lower; only use UV coords when !!! FIXME: textures are needed. */ +/* Sampler types */ +typedef enum +{ + SDL_D3D11_SAMPLER_NEAREST_CLAMP, + SDL_D3D11_SAMPLER_NEAREST_WRAP, + SDL_D3D11_SAMPLER_LINEAR_CLAMP, + SDL_D3D11_SAMPLER_LINEAR_WRAP, + SDL_NUM_D3D11_SAMPLERS +} SDL_D3D11_sampler_type; + /* Vertex shader, common values */ typedef struct { @@ -181,8 +191,7 @@ typedef struct ID3D11PixelShader *pixelShaders[NUM_SHADERS]; int blendModesCount; D3D11_BlendMode *blendModes; - ID3D11SamplerState *nearestPixelSampler; - ID3D11SamplerState *linearSampler; + ID3D11SamplerState *samplers[SDL_NUM_D3D11_SAMPLERS]; D3D_FEATURE_LEVEL featureLevel; SDL_bool pixelSizeChanged; @@ -346,8 +355,9 @@ static void D3D11_ReleaseAll(SDL_Renderer *renderer) SAFE_RELEASE(data->vertexShaderConstants); SAFE_RELEASE(data->clippedRasterizer); SAFE_RELEASE(data->mainRasterizer); - SAFE_RELEASE(data->linearSampler); - SAFE_RELEASE(data->nearestPixelSampler); + for (i = 0; i < SDL_arraysize(data->samplers); ++i) { + SAFE_RELEASE(data->samplers[i]); + } if (data->blendModesCount > 0) { for (i = 0; i < data->blendModesCount; ++i) { @@ -734,31 +744,35 @@ static HRESULT D3D11_CreateDeviceResources(SDL_Renderer *renderer) } /* Create samplers to use when drawing textures: */ + static struct + { + D3D11_FILTER filter; + D3D11_TEXTURE_ADDRESS_MODE address; + } samplerParams[] = { + { D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_CLAMP }, + { D3D11_FILTER_MIN_MAG_MIP_POINT, D3D11_TEXTURE_ADDRESS_WRAP }, + { D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_CLAMP }, + { D3D11_FILTER_MIN_MAG_MIP_LINEAR, D3D11_TEXTURE_ADDRESS_WRAP }, + }; + SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_NUM_D3D11_SAMPLERS); SDL_zero(samplerDesc); - samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; - samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; - samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; samplerDesc.MipLODBias = 0.0f; samplerDesc.MaxAnisotropy = 1; samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; samplerDesc.MinLOD = 0.0f; samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; - result = ID3D11Device_CreateSamplerState(data->d3dDevice, - &samplerDesc, - &data->nearestPixelSampler); - if (FAILED(result)) { - WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateSamplerState [nearest-pixel filter]"), result); - goto done; - } - - samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; - result = ID3D11Device_CreateSamplerState(data->d3dDevice, - &samplerDesc, - &data->linearSampler); - if (FAILED(result)) { - WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateSamplerState [linear filter]"), result); - goto done; + for (int i = 0; i < SDL_arraysize(samplerParams); ++i) { + samplerDesc.Filter = samplerParams[i].filter; + samplerDesc.AddressU = samplerParams[i].address; + samplerDesc.AddressV = samplerParams[i].address; + result = ID3D11Device_CreateSamplerState(data->d3dDevice, + &samplerDesc, + &data->samplers[i]); + if (FAILED(result)) { + WIN_SetErrorFromHRESULT(SDL_COMPOSE_ERROR("ID3D11Device1::CreateSamplerState [nearest-pixel filter]"), result); + goto done; + } } /* Setup Direct3D rasterizer states */ @@ -2426,10 +2440,28 @@ static int D3D11_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *c switch (textureData->scaleMode) { case D3D11_FILTER_MIN_MAG_MIP_POINT: - textureSampler = rendererData->nearestPixelSampler; + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_NEAREST_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_NEAREST_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } break; case D3D11_FILTER_MIN_MAG_MIP_LINEAR: - textureSampler = rendererData->linearSampler; + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_LINEAR_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + textureSampler = rendererData->samplers[SDL_D3D11_SAMPLER_LINEAR_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } break; default: return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode); diff --git a/src/render/direct3d12/SDL_render_d3d12.c b/src/render/direct3d12/SDL_render_d3d12.c index 7130c10c1c8e8..26a21e5a3e68f 100644 --- a/src/render/direct3d12/SDL_render_d3d12.c +++ b/src/render/direct3d12/SDL_render_d3d12.c @@ -134,6 +134,16 @@ extern "C" { /* !!! FIXME: vertex buffer bandwidth could be lower; only use UV coords when !!! FIXME: textures are needed. */ +/* Sampler types */ +typedef enum +{ + SDL_D3D12_SAMPLER_NEAREST_CLAMP, + SDL_D3D12_SAMPLER_NEAREST_WRAP, + SDL_D3D12_SAMPLER_LINEAR_CLAMP, + SDL_D3D12_SAMPLER_LINEAR_WRAP, + SDL_D3D12_NUM_SAMPLERS +} SDL_D3D12_sampler_type; + /* Vertex shader, common values */ typedef struct { @@ -294,8 +304,7 @@ typedef struct D3D12_PipelineState *currentPipelineState; D3D12_VertexBuffer vertexBuffers[SDL_D3D12_NUM_VERTEX_BUFFERS]; - D3D12_CPU_DESCRIPTOR_HANDLE nearestPixelSampler; - D3D12_CPU_DESCRIPTOR_HANDLE linearSampler; + D3D12_CPU_DESCRIPTOR_HANDLE samplers[SDL_D3D12_NUM_SAMPLERS]; /* Data for staging/allocating textures */ ID3D12Resource *uploadBuffers[SDL_D3D12_NUM_UPLOAD_BUFFERS]; @@ -1057,7 +1066,7 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) data->srvDescriptorSize = D3D_CALL(d3dDevice, GetDescriptorHandleIncrementSize, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV); SDL_zero(descriptorHeapDesc); - descriptorHeapDesc.NumDescriptors = 2; + descriptorHeapDesc.NumDescriptors = 4; descriptorHeapDesc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER; descriptorHeapDesc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE; result = D3D_CALL(data->d3dDevice, CreateDescriptorHeap, @@ -1165,22 +1174,32 @@ static HRESULT D3D12_CreateDeviceResources(SDL_Renderer *renderer) } /* Create samplers to use when drawing textures: */ + static struct + { + D3D12_FILTER filter; + D3D12_TEXTURE_ADDRESS_MODE address; + } samplerParams[] = { + { D3D12_FILTER_MIN_MAG_MIP_POINT, D3D12_TEXTURE_ADDRESS_MODE_CLAMP }, + { D3D12_FILTER_MIN_MAG_MIP_POINT, D3D12_TEXTURE_ADDRESS_MODE_WRAP }, + { D3D12_FILTER_MIN_MAG_MIP_LINEAR, D3D12_TEXTURE_ADDRESS_MODE_CLAMP }, + { D3D12_FILTER_MIN_MAG_MIP_LINEAR, D3D12_TEXTURE_ADDRESS_MODE_WRAP }, + }; + SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_D3D12_NUM_SAMPLERS); SDL_zero(samplerDesc); - samplerDesc.Filter = D3D12_FILTER_MIN_MAG_MIP_POINT; - samplerDesc.AddressU = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; - samplerDesc.AddressV = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; samplerDesc.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; samplerDesc.MipLODBias = 0.0f; samplerDesc.MaxAnisotropy = 1; samplerDesc.ComparisonFunc = D3D12_COMPARISON_FUNC_ALWAYS; samplerDesc.MinLOD = 0.0f; samplerDesc.MaxLOD = D3D12_FLOAT32_MAX; - D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(data->samplerDescriptorHeap, &data->nearestPixelSampler); - D3D_CALL(data->d3dDevice, CreateSampler, &samplerDesc, data->nearestPixelSampler); - - samplerDesc.Filter = D3D12_FILTER_MIN_MAG_MIP_LINEAR; - data->linearSampler.ptr = data->nearestPixelSampler.ptr + data->samplerDescriptorSize; - D3D_CALL(data->d3dDevice, CreateSampler, &samplerDesc, data->linearSampler); + D3D_CALL_RET_ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(data->samplerDescriptorHeap, &data->samplers[0]); + for (i = 0; i < SDL_arraysize(samplerParams); ++i) { + samplerDesc.Filter = samplerParams[i].filter; + samplerDesc.AddressU = samplerParams[i].address; + samplerDesc.AddressV = samplerParams[i].address; + data->samplers[i].ptr = data->samplers[0].ptr + i * data->samplerDescriptorSize; + D3D_CALL(data->d3dDevice, CreateSampler, &samplerDesc, data->samplers[i]); + } /* Initialize the pool allocator for SRVs */ for (i = 0; i < SDL_D3D12_MAX_NUM_TEXTURES; ++i) { @@ -2797,10 +2816,28 @@ static int D3D12_SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *c switch (textureData->scaleMode) { case D3D12_FILTER_MIN_MAG_MIP_POINT: - textureSampler = &rendererData->nearestPixelSampler; + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_NEAREST_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_NEAREST_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } break; case D3D12_FILTER_MIN_MAG_MIP_LINEAR: - textureSampler = &rendererData->linearSampler; + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_LINEAR_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + textureSampler = &rendererData->samplers[SDL_D3D12_SAMPLER_LINEAR_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } break; default: return SDL_SetError("Unknown scale mode: %d\n", textureData->scaleMode); diff --git a/src/render/metal/SDL_render_metal.m b/src/render/metal/SDL_render_metal.m index e5f1185ba3e2e..4b8386edb0914 100644 --- a/src/render/metal/SDL_render_metal.m +++ b/src/render/metal/SDL_render_metal.m @@ -80,6 +80,16 @@ static const size_t CONSTANTS_OFFSET_DECODE_BT2020_FULL = ALIGN_CONSTANTS(16, CONSTANTS_OFFSET_DECODE_BT2020_LIMITED + sizeof(float) * 4 * 4); static const size_t CONSTANTS_LENGTH = CONSTANTS_OFFSET_DECODE_BT2020_FULL + sizeof(float) * 4 * 4; +/* Sampler types */ +typedef enum +{ + SDL_METAL_SAMPLER_NEAREST_CLAMP, + SDL_METAL_SAMPLER_NEAREST_WRAP, + SDL_METAL_SAMPLER_LINEAR_CLAMP, + SDL_METAL_SAMPLER_LINEAR_WRAP, + SDL_NUM_METAL_SAMPLERS +} SDL_METAL_sampler_type; + typedef enum SDL_MetalVertexFunction { SDL_METAL_VERTEX_SOLID, @@ -130,8 +140,7 @@ @interface METAL_RenderData : NSObject @property(nonatomic, retain) id mtlcmdencoder; @property(nonatomic, retain) id mtllibrary; @property(nonatomic, retain) id mtlbackbuffer; -@property(nonatomic, retain) id mtlsamplernearest; -@property(nonatomic, retain) id mtlsamplerlinear; +@property(nonatomic, retain) NSMutableArray> *mtlsamplers; @property(nonatomic, retain) id mtlbufconstants; @property(nonatomic, retain) id mtlbufquadindices; @property(nonatomic, assign) SDL_MetalView mtlview; @@ -148,7 +157,6 @@ @implementation METAL_RenderData @interface METAL_TextureData : NSObject @property(nonatomic, retain) id mtltexture; @property(nonatomic, retain) id mtltextureUv; -@property(nonatomic, retain) id mtlsampler; @property(nonatomic, assign) SDL_MetalFragmentFunction fragmentFunction; #if SDL_HAVE_YUV @property(nonatomic, assign) BOOL yuv; @@ -739,11 +747,6 @@ static int METAL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL } #endif /* SDL_HAVE_YUV */ texturedata = [[METAL_TextureData alloc] init]; - if (texture->scaleMode == SDL_SCALEMODE_NEAREST) { - texturedata.mtlsampler = data.mtlsamplernearest; - } else { - texturedata.mtlsampler = data.mtlsamplerlinear; - } if (SDL_COLORSPACETRANSFER(texture->colorspace) == SDL_TRANSFER_CHARACTERISTICS_SRGB) { texturedata.fragmentFunction = SDL_METAL_FRAGMENT_COPY; #if SDL_HAVE_YUV @@ -1094,16 +1097,6 @@ static void METAL_UnlockTexture(SDL_Renderer *renderer, SDL_Texture *texture) static void METAL_SetTextureScaleMode(SDL_Renderer *renderer, SDL_Texture *texture, SDL_ScaleMode scaleMode) { - @autoreleasepool { - METAL_RenderData *data = (__bridge METAL_RenderData *)renderer->internal; - METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->internal; - - if (scaleMode == SDL_SCALEMODE_NEAREST) { - texturedata.mtlsampler = data.mtlsamplernearest; - } else { - texturedata.mtlsampler = data.mtlsamplerlinear; - } - } } static int METAL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture) @@ -1503,13 +1496,32 @@ static SDL_bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cm } if (texture != statecache->texture) { - METAL_TextureData *oldtexturedata = NULL; - if (statecache->texture) { - oldtexturedata = (__bridge METAL_TextureData *)statecache->texture->internal; - } - if (!oldtexturedata || (texturedata.mtlsampler != oldtexturedata.mtlsampler)) { - [data.mtlcmdencoder setFragmentSamplerState:texturedata.mtlsampler atIndex:0]; + id mtlsampler; + + if (texture->scaleMode == SDL_SCALEMODE_NEAREST) { + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_NEAREST_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_NEAREST_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } + } else { + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_LINEAR_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + mtlsampler = data.mtlsamplers[SDL_METAL_SAMPLER_LINEAR_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } } + [data.mtlcmdencoder setFragmentSamplerState:mtlsampler atIndex:0]; [data.mtlcmdencoder setFragmentTexture:texturedata.mtltexture atIndex:0]; #if SDL_HAVE_YUV @@ -1904,7 +1916,6 @@ static int METAL_CreateRenderer(SDL_Renderer *renderer, SDL_Window *window, SDL_ MTLSamplerDescriptor *samplerdesc; id mtlcmdqueue; id mtllibrary; - id mtlsamplernearest, mtlsamplerlinear; id mtlbufconstantstaging, mtlbufquadindicesstaging, mtlbufconstants, mtlbufquadindices; id cmdbuffer; id blitcmd; @@ -2066,17 +2077,27 @@ in case we want to use it later (recreating the renderer) data.allpipelines = NULL; ChooseShaderPipelines(data, MTLPixelFormatBGRA8Unorm); - samplerdesc = [[MTLSamplerDescriptor alloc] init]; - - samplerdesc.minFilter = MTLSamplerMinMagFilterNearest; - samplerdesc.magFilter = MTLSamplerMinMagFilterNearest; - mtlsamplernearest = [data.mtldevice newSamplerStateWithDescriptor:samplerdesc]; - data.mtlsamplernearest = mtlsamplernearest; + static struct + { + MTLSamplerMinMagFilter filter; + MTLSamplerAddressMode address; + } samplerParams[] = { + { MTLSamplerMinMagFilterNearest, MTLSamplerAddressModeClampToEdge }, + { MTLSamplerMinMagFilterNearest, MTLSamplerAddressModeRepeat }, + { MTLSamplerMinMagFilterLinear, MTLSamplerAddressModeClampToEdge }, + { MTLSamplerMinMagFilterLinear, MTLSamplerAddressModeRepeat }, + }; + SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_NUM_METAL_SAMPLERS); - samplerdesc.minFilter = MTLSamplerMinMagFilterLinear; - samplerdesc.magFilter = MTLSamplerMinMagFilterLinear; - mtlsamplerlinear = [data.mtldevice newSamplerStateWithDescriptor:samplerdesc]; - data.mtlsamplerlinear = mtlsamplerlinear; + data.mtlsamplers = [[NSMutableArray> alloc] init]; + samplerdesc = [[MTLSamplerDescriptor alloc] init]; + for (int i = 0; i < SDL_arraysize(samplerParams); ++i) { + samplerdesc.minFilter = samplerParams[i].filter; + samplerdesc.magFilter = samplerParams[i].filter; + samplerdesc.sAddressMode = samplerParams[i].address; + samplerdesc.tAddressMode = samplerParams[i].address; + [data.mtlsamplers addObject:[data.mtldevice newSamplerStateWithDescriptor:samplerdesc]]; + } mtlbufconstantstaging = [data.mtldevice newBufferWithLength:CONSTANTS_LENGTH options:MTLResourceStorageModeShared]; diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index e5e8fe99c7b4f..baaebfb3c5e75 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -541,15 +541,6 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr renderdata->glBindTexture(textype, data->texture); renderdata->glTexParameteri(textype, GL_TEXTURE_MIN_FILTER, scaleMode); renderdata->glTexParameteri(textype, GL_TEXTURE_MAG_FILTER, scaleMode); - /* According to the spec, CLAMP_TO_EDGE is the default for TEXTURE_RECTANGLE - and setting it causes an INVALID_ENUM error in the latest NVidia drivers. - */ - if (textype != GL_TEXTURE_RECTANGLE_ARB) { - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE); - } #ifdef SDL_PLATFORM_MACOS #ifndef GL_TEXTURE_STORAGE_HINT_APPLE #define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC @@ -609,10 +600,6 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr scaleMode); renderdata->glTexParameteri(textype, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE); renderdata->glTexImage2D(textype, 0, internalFormat, (texture_w + 1) / 2, (texture_h + 1) / 2, 0, format, type, NULL); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_OPENGL_TEXTURE_U_NUMBER, data->utexture); @@ -622,10 +609,6 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr scaleMode); renderdata->glTexParameteri(textype, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE); renderdata->glTexImage2D(textype, 0, internalFormat, (texture_w + 1) / 2, (texture_h + 1) / 2, 0, format, type, NULL); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_OPENGL_TEXTURE_V_NUMBER, data->vtexture); @@ -646,10 +629,6 @@ static int GL_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL_Pr scaleMode); renderdata->glTexParameteri(textype, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_S, - GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(textype, GL_TEXTURE_WRAP_T, - GL_CLAMP_TO_EDGE); renderdata->glTexImage2D(textype, 0, GL_LUMINANCE_ALPHA, (texture_w + 1) / 2, (texture_h + 1) / 2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); SDL_SetNumberProperty(props, SDL_PROP_TEXTURE_OPENGL_TEXTURE_UV_NUMBER, data->utexture); @@ -1141,6 +1120,23 @@ static int SetDrawState(GL_RenderData *data, const SDL_RenderCommand *cmd, const return 0; } +static int SetTextureAddressMode(GL_RenderData *data, GLenum textype, SDL_TextureAddressMode addressMode) +{ + switch (addressMode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + data->glTexParameteri(textype, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + break; + case SDL_TEXTURE_ADDRESS_WRAP: + data->glTexParameteri(textype, GL_TEXTURE_WRAP_S, GL_REPEAT); + data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT); + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", addressMode); + } + return 0; +} + static int SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) { SDL_Texture *texture = cmd->data.draw.texture; @@ -1157,16 +1153,28 @@ static int SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) } data->glBindTexture(textype, texturedata->vtexture); + if (SetTextureAddressMode(data, textype, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } + if (data->GL_ARB_multitexture_supported) { data->glActiveTextureARB(GL_TEXTURE1_ARB); } data->glBindTexture(textype, texturedata->utexture); + + if (SetTextureAddressMode(data, textype, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } } if (texturedata->nv12) { if (data->GL_ARB_multitexture_supported) { data->glActiveTextureARB(GL_TEXTURE1_ARB); } data->glBindTexture(textype, texturedata->utexture); + + if (SetTextureAddressMode(data, textype, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } } #endif if (data->GL_ARB_multitexture_supported) { @@ -1174,6 +1182,10 @@ static int SetCopyState(GL_RenderData *data, const SDL_RenderCommand *cmd) } data->glBindTexture(textype, texturedata->texture); + if (SetTextureAddressMode(data, textype, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } + data->drawstate.texture = texture; } diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index 7d06c97dab358..8df52b1f15879 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -1030,6 +1030,23 @@ static int SetDrawState(GLES2_RenderData *data, const SDL_RenderCommand *cmd, co return 0; } +static int SetTextureAddressMode(GLES2_RenderData *data, GLenum textype, SDL_TextureAddressMode addressMode) +{ + switch (addressMode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + data->glTexParameteri(textype, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + break; + case SDL_TEXTURE_ADDRESS_WRAP: + data->glTexParameteri(textype, GL_TEXTURE_WRAP_S, GL_REPEAT); + data->glTexParameteri(textype, GL_TEXTURE_WRAP_T, GL_REPEAT); + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", addressMode); + } + return 0; +} + static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, void *vertices) { GLES2_RenderData *data = (GLES2_RenderData *)renderer->internal; @@ -1162,18 +1179,35 @@ static int SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, vo data->glActiveTexture(GL_TEXTURE2); data->glBindTexture(tdata->texture_type, tdata->texture_v); + if (SetTextureAddressMode(data, tdata->texture_type, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } + data->glActiveTexture(GL_TEXTURE1); data->glBindTexture(tdata->texture_type, tdata->texture_u); + if (SetTextureAddressMode(data, tdata->texture_type, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } + data->glActiveTexture(GL_TEXTURE0); } else if (tdata->nv12) { data->glActiveTexture(GL_TEXTURE1); data->glBindTexture(tdata->texture_type, tdata->texture_u); + if (SetTextureAddressMode(data, tdata->texture_type, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } + data->glActiveTexture(GL_TEXTURE0); } #endif data->glBindTexture(tdata->texture_type, tdata->texture); + + if (SetTextureAddressMode(data, tdata->texture_type, cmd->data.draw.texture_address_mode) < 0) { + return -1; + } + data->drawstate.texture = texture; } @@ -1552,8 +1586,6 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL renderdata->glBindTexture(data->texture_type, data->texture_v); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); renderdata->glTexImage2D(data->texture_type, 0, format, (texture->w + 1) / 2, (texture->h + 1) / 2, 0, format, type, NULL); SDL_SetNumberProperty(SDL_GetTextureProperties(texture), SDL_PROP_TEXTURE_OPENGLES2_TEXTURE_V_NUMBER, data->texture_v); @@ -1570,8 +1602,6 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL renderdata->glBindTexture(data->texture_type, data->texture_u); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); renderdata->glTexImage2D(data->texture_type, 0, format, (texture->w + 1) / 2, (texture->h + 1) / 2, 0, format, type, NULL); if (GL_CheckError("glTexImage2D()", renderer) < 0) { return -1; @@ -1595,8 +1625,6 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL renderdata->glBindTexture(data->texture_type, data->texture_u); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); renderdata->glTexImage2D(data->texture_type, 0, GL_LUMINANCE_ALPHA, (texture->w + 1) / 2, (texture->h + 1) / 2, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, NULL); if (GL_CheckError("glTexImage2D()", renderer) < 0) { return -1; @@ -1623,8 +1651,6 @@ static int GLES2_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SDL renderdata->glBindTexture(data->texture_type, data->texture); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MIN_FILTER, scaleMode); renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_MAG_FILTER, scaleMode); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - renderdata->glTexParameteri(data->texture_type, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); if (texture->format != SDL_PIXELFORMAT_EXTERNAL_OES) { renderdata->glTexImage2D(data->texture_type, 0, format, texture->w, texture->h, 0, format, type, NULL); if (GL_CheckError("glTexImage2D()", renderer) < 0) { diff --git a/src/render/software/SDL_render_sw.c b/src/render/software/SDL_render_sw.c index a9d2f1252bec4..1225e756ac3b3 100644 --- a/src/render/software/SDL_render_sw.c +++ b/src/render/software/SDL_render_sw.c @@ -928,7 +928,8 @@ static int SW_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd, vo &(ptr[0].src), &(ptr[1].src), &(ptr[2].src), surface, &(ptr[0].dst), &(ptr[1].dst), &(ptr[2].dst), - ptr[0].color, ptr[1].color, ptr[2].color); + ptr[0].color, ptr[1].color, ptr[2].color, + cmd->data.draw.texture_address_mode); } } else { GeometryFillData *ptr = (GeometryFillData *)verts; diff --git a/src/render/software/SDL_triangle.c b/src/render/software/SDL_triangle.c index fd4350d061e50..4abc01a7b28ce 100644 --- a/src/render/software/SDL_triangle.c +++ b/src/render/software/SDL_triangle.c @@ -42,7 +42,7 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info, SDL_Point s2_x_area, SDL_Rect dstrect, int area, int bias_w0, int bias_w1, int bias_w2, int d2d1_y, int d1d2_x, int d0d2_y, int d2d0_x, int d1d0_y, int d0d1_x, int s2s0_x, int s2s1_x, int s2s0_y, int s2s1_y, int w0_row, int w1_row, int w2_row, - SDL_Color c0, SDL_Color c1, SDL_Color c2, int is_uniform); + SDL_Color c0, SDL_Color c1, SDL_Color c2, SDL_bool is_uniform, SDL_TextureAddressMode texture_address_mode); #if 0 int SDL_BlitTriangle(SDL_Surface *src, const SDL_Point srcpoints[3], SDL_Surface *dst, const SDL_Point dstpoints[3]) @@ -183,7 +183,17 @@ static void bounding_rect(const SDL_Point *a, const SDL_Point *b, const SDL_Poin /* Use 64 bits precision to prevent overflow when interpolating color / texture with wide triangles */ #define TRIANGLE_GET_TEXTCOORD \ int srcx = (int)(((Sint64)w0 * s2s0_x + (Sint64)w1 * s2s1_x + s2_x_area.x) / area); \ - int srcy = (int)(((Sint64)w0 * s2s0_y + (Sint64)w1 * s2s1_y + s2_x_area.y) / area); + int srcy = (int)(((Sint64)w0 * s2s0_y + (Sint64)w1 * s2s1_y + s2_x_area.y) / area); \ + if (texture_address_mode == SDL_TEXTURE_ADDRESS_WRAP) { \ + srcx %= src_surface->w; \ + if (srcx < 0) { \ + srcx += (src_surface->w - 1); \ + } \ + srcy %= src_surface->h; \ + if (srcy < 0) { \ + srcy += (src_surface->h - 1); \ + } \ + } #define TRIANGLE_GET_MAPPED_COLOR \ Uint8 r = (Uint8)(((Sint64)w0 * c0.r + (Sint64)w1 * c1.r + (Sint64)w2 * c2.r) / area); \ @@ -231,7 +241,7 @@ int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Poin Sint64 w0_row, w1_row, w2_row; int bias_w0, bias_w1, bias_w2; - int is_uniform; + SDL_bool is_uniform; SDL_Surface *tmp = NULL; @@ -454,8 +464,10 @@ int SDL_SW_BlitTriangle( SDL_Point *s0, SDL_Point *s1, SDL_Point *s2, SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, - SDL_Color c0, SDL_Color c1, SDL_Color c2) + SDL_Color c0, SDL_Color c1, SDL_Color c2, + SDL_TextureAddressMode texture_address_mode) { + SDL_Surface *src_surface = src; int ret = 0; int src_locked = 0; int dst_locked = 0; @@ -482,9 +494,9 @@ int SDL_SW_BlitTriangle( Sint64 w0_row, w1_row, w2_row; int bias_w0, bias_w1, bias_w2; - int is_uniform; + SDL_bool is_uniform; - int has_modulation; + SDL_bool has_modulation; if (!SDL_SurfaceValid(src)) { return SDL_InvalidParamError("src"); @@ -527,7 +539,7 @@ int SDL_SW_BlitTriangle( SDL_GetSurfaceBlendMode(src, &blend); /* TRIANGLE_GET_TEXTCOORD interpolates up to the max values included, so reduce by 1 */ - { + if (texture_address_mode == SDL_TEXTURE_ADDRESS_CLAMP) { SDL_Rect srcrect; int maxx, maxy; bounding_rect(s0, s1, s2, &srcrect); @@ -564,17 +576,6 @@ int SDL_SW_BlitTriangle( has_modulation = SDL_TRUE; } - { - /* Clip triangle rect with surface rect */ - SDL_Rect rect; - rect.x = 0; - rect.y = 0; - rect.w = dst->w; - rect.h = dst->h; - - SDL_GetRectIntersection(&dstrect, &rect, &dstrect); - } - { /* Clip triangle with surface clip rect */ SDL_Rect rect; @@ -695,6 +696,7 @@ int SDL_SW_BlitTriangle( tmp_info.colorkey = info->colorkey; /* src */ + tmp_info.src_surface = src_surface; tmp_info.src = (Uint8 *)src_ptr; tmp_info.src_pitch = src_pitch; @@ -714,7 +716,7 @@ int SDL_SW_BlitTriangle( SDL_BlitTriangle_Slow(&tmp_info, s2_x_area, dstrect, (int)area, bias_w0, bias_w1, bias_w2, d2d1_y, d1d2_x, d0d2_y, d2d0_x, d1d0_y, d0d1_x, s2s0_x, s2s1_x, s2s0_y, s2s1_y, (int)w0_row, (int)w1_row, (int)w2_row, - c0, c1, c2, is_uniform); + c0, c1, c2, is_uniform, texture_address_mode); goto end; } @@ -786,8 +788,9 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info, SDL_Point s2_x_area, SDL_Rect dstrect, int area, int bias_w0, int bias_w1, int bias_w2, int d2d1_y, int d1d2_x, int d0d2_y, int d2d0_x, int d1d0_y, int d0d1_x, int s2s0_x, int s2s1_x, int s2s0_y, int s2s1_y, int w0_row, int w1_row, int w2_row, - SDL_Color c0, SDL_Color c1, SDL_Color c2, int is_uniform) + SDL_Color c0, SDL_Color c1, SDL_Color c2, SDL_bool is_uniform, SDL_TextureAddressMode texture_address_mode) { + SDL_Surface *src_surface = info->src_surface; const int flags = info->flags; Uint32 modulateR = info->r; Uint32 modulateG = info->g; diff --git a/src/render/software/SDL_triangle.h b/src/render/software/SDL_triangle.h index f5af0aad1b3fc..d9703506740c1 100644 --- a/src/render/software/SDL_triangle.h +++ b/src/render/software/SDL_triangle.h @@ -24,6 +24,8 @@ #include "SDL_internal.h" +#include "../SDL_sysrender.h" // For SDL_TextureAddressMode + extern int SDL_SW_FillTriangle(SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, SDL_BlendMode blend, SDL_Color c0, SDL_Color c1, SDL_Color c2); @@ -33,7 +35,8 @@ extern int SDL_SW_BlitTriangle( SDL_Point *s0, SDL_Point *s1, SDL_Point *s2, SDL_Surface *dst, SDL_Point *d0, SDL_Point *d1, SDL_Point *d2, - SDL_Color c0, SDL_Color c1, SDL_Color c2); + SDL_Color c0, SDL_Color c1, SDL_Color c2, + SDL_TextureAddressMode texture_address_mode); extern void trianglepoint_2_fixedpoint(SDL_Point *a); diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c index 5d6084e2e84e2..a3b63d2d67a2c 100644 --- a/src/render/vulkan/SDL_render_vulkan.c +++ b/src/render/vulkan/SDL_render_vulkan.c @@ -158,9 +158,12 @@ typedef enum { } SDL_vulkan_renderpass_type; /* Sampler types */ -typedef enum { - SDL_VULKAN_SAMPLER_NEAREST = 0, - SDL_VULKAN_SAMPLER_LINEAR = 1, +typedef enum +{ + SDL_VULKAN_SAMPLER_NEAREST_CLAMP, + SDL_VULKAN_SAMPLER_NEAREST_WRAP, + SDL_VULKAN_SAMPLER_LINEAR_CLAMP, + SDL_VULKAN_SAMPLER_LINEAR_WRAP, SDL_VULKAN_NUM_SAMPLERS } SDL_vulkan_sampler_type; @@ -181,6 +184,15 @@ static const float INPUTTYPE_SRGB = 1; static const float INPUTTYPE_SCRGB = 2; static const float INPUTTYPE_HDR10 = 3; +typedef enum +{ + SAMPLER_POINT_CLAMP, + SAMPLER_POINT_WRAP, + SAMPLER_LINEAR_CLAMP, + SAMPLER_LINEAR_WRAP, + NUM_SAMPLERS +} Sampler; + /* Pixel shader constants, common values */ typedef struct { @@ -1904,34 +1916,37 @@ static VkResult VULKAN_CreateDeviceResources(SDL_Renderer *renderer, SDL_Propert /* Create samplers */ { + static struct + { + VkFilter filter; + VkSamplerAddressMode address; + } samplerParams[] = { + { VK_FILTER_NEAREST, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE }, + { VK_FILTER_NEAREST, VK_SAMPLER_ADDRESS_MODE_REPEAT }, + { VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE }, + { VK_FILTER_LINEAR, VK_SAMPLER_ADDRESS_MODE_REPEAT }, + }; + SDL_COMPILE_TIME_ASSERT(samplerParams_SIZE, SDL_arraysize(samplerParams) == SDL_VULKAN_NUM_SAMPLERS); VkSamplerCreateInfo samplerCreateInfo = { 0 }; samplerCreateInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; - samplerCreateInfo.magFilter = VK_FILTER_NEAREST; - samplerCreateInfo.minFilter = VK_FILTER_NEAREST; samplerCreateInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; - samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; samplerCreateInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; samplerCreateInfo.mipLodBias = 0.0f; samplerCreateInfo.anisotropyEnable = VK_FALSE; samplerCreateInfo.maxAnisotropy = 1.0f; samplerCreateInfo.minLod = 0.0f; samplerCreateInfo.maxLod = 1000.0f; - result = vkCreateSampler(rendererData->device, &samplerCreateInfo, NULL, &rendererData->samplers[SDL_VULKAN_SAMPLER_NEAREST]); - if (result != VK_SUCCESS) { - VULKAN_DestroyAll(renderer); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateSampler(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; - } - - samplerCreateInfo.magFilter = VK_FILTER_LINEAR; - samplerCreateInfo.minFilter = VK_FILTER_LINEAR; - samplerCreateInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; - result = vkCreateSampler(rendererData->device, &samplerCreateInfo, NULL, &rendererData->samplers[SDL_VULKAN_SAMPLER_LINEAR]); - if (result != VK_SUCCESS) { - VULKAN_DestroyAll(renderer); - SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateSampler(): %s\n", SDL_Vulkan_GetResultString(result)); - return result; + for (int i = 0; i < SDL_arraysize(samplerParams); ++i) { + samplerCreateInfo.magFilter = samplerParams[i].filter; + samplerCreateInfo.minFilter = samplerParams[i].filter; + samplerCreateInfo.addressModeU = samplerParams[i].address; + samplerCreateInfo.addressModeV = samplerParams[i].address; + result = vkCreateSampler(rendererData->device, &samplerCreateInfo, NULL, &rendererData->samplers[i]); + if (result != VK_SUCCESS) { + VULKAN_DestroyAll(renderer); + SDL_LogError(SDL_LOG_CATEGORY_RENDER, "vkCreateSampler(): %s\n", SDL_Vulkan_GetResultString(result)); + return result; + } } } @@ -2602,8 +2617,8 @@ static int VULKAN_CreateTexture(SDL_Renderer *renderer, SDL_Texture *texture, SD samplerCreateInfo.magFilter = VK_FILTER_NEAREST; samplerCreateInfo.minFilter = VK_FILTER_NEAREST; samplerCreateInfo.mipmapMode = VK_SAMPLER_MIPMAP_MODE_NEAREST; - samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + samplerCreateInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT; + samplerCreateInfo.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT; samplerCreateInfo.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; samplerCreateInfo.mipLodBias = 0.0f; samplerCreateInfo.anisotropyEnable = VK_FALSE; @@ -3627,10 +3642,28 @@ static SDL_bool VULKAN_SetCopyState(SDL_Renderer *renderer, const SDL_RenderComm switch (textureData->scaleMode) { case VK_FILTER_NEAREST: - textureSampler = rendererData->samplers[SDL_VULKAN_SAMPLER_NEAREST]; + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + textureSampler = rendererData->samplers[SDL_VULKAN_SAMPLER_NEAREST_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + textureSampler = rendererData->samplers[SDL_VULKAN_SAMPLER_NEAREST_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } break; case VK_FILTER_LINEAR: - textureSampler = rendererData->samplers[SDL_VULKAN_SAMPLER_LINEAR]; + switch (cmd->data.draw.texture_address_mode) { + case SDL_TEXTURE_ADDRESS_CLAMP: + textureSampler = rendererData->samplers[SDL_VULKAN_SAMPLER_LINEAR_CLAMP]; + break; + case SDL_TEXTURE_ADDRESS_WRAP: + textureSampler = rendererData->samplers[SDL_VULKAN_SAMPLER_LINEAR_WRAP]; + break; + default: + return SDL_SetError("Unknown texture address mode: %d\n", cmd->data.draw.texture_address_mode); + } break; default: return SDL_SetError("Unknown scale mode: %d", textureData->scaleMode); diff --git a/test/testautomation_images.c b/test/testautomation_images.c index 7968be23792c2..f3706e7ac14f0 100644 --- a/test/testautomation_images.c +++ b/test/testautomation_images.c @@ -1725,158 +1725,158 @@ static const SDLTest_SurfaceImage_t SDLTest_imageRainbowBackground = { 32, 32, 4, - "\000\016\377\377\000\031\377\377\000\045\377\377\000\061\377\377\000\075\377\377\000\111\377\377\000\125\377" - "\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250" - "\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000" - "\374\377\377\000\377\356\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\216\377\000\377\167\377" - "\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\000\031\377\377\000\045\377" - "\377\000\061\377\377\000\075\377\377\000\111\377\377\000\125\377\377\000\141\377\377\000\155\377\377\000\170" - "\377\377\000\204\377\377\000\220\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000" - "\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\373\377\377\000\377\357\377\000\377\326\377" - "\000\377\276\377\000\377\247\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\110\377\000\377\060" - "\377\000\377\030\377\003\377\003\377\027\377\000\377\000\045\377\377\000\061\377\377\000\075\377\377\000\111" - "\377\377\000\125\377\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000" - "\235\377\377\000\251\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377" - "\000\360\377\377\000\374\377\377\000\377\357\377\000\377\325\377\000\377\276\377\000\377\246\377\000\377\216" - "\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\002\377\002\377\030\377" - "\000\377\060\377\000\377\000\061\377\377\000\075\377\377\000\111\377\377\000\125\377\377\000\141\377\377\000" - "\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377" - "\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357" - "\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377" - "\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\061\377\000\377\110\377\000\377\000" - "\075\377\377\000\111\377\377\000\125\377\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377" - "\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377" - "\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377" - "\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003" - "\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\000\111\377\377\000\125\377\377" - "\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377" - "\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374" - "\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000" - "\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377" - "\107\377\000\377\140\377\000\377\167\377\000\377\000\125\377\377\000\141\377\377\000\155\377\377\000\171\377" - "\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314" - "\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000" - "\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377" - "\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\137\377\000\377\170\377\000" - "\377\217\377\000\377\000\141\377\377\000\155\377\377\000\171\377\377\000\205\377\377\000\221\377\377\000\234" - "\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000" - "\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377" - "\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000" - "\377\060\377\000\377\110\377\000\377\140\377\000\377\167\377\000\377\220\377\000\377\247\377\000\377\000\155" - "\377\377\000\170\377\377\000\205\377\377\000\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000" - "\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377" - "\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107" - "\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377" - "\000\377\170\377\000\377\217\377\000\377\250\377\000\377\277\377\000\377\000\171\377\377\000\204\377\377\000" - "\221\377\377\000\234\377\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377" - "\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246" - "\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377" - "\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247" - "\377\000\377\300\377\000\377\327\377\000\377\000\205\377\377\000\220\377\377\000\235\377\377\000\250\377\377" - "\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377" - "\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377" - "\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110" - "\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377" - "\357\377\000\377\000\221\377\377\000\234\377\377\000\251\377\377\000\264\377\377\000\300\377\377\000\314\377" - "\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377" - "\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000" - "\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377" - "\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\000\234\377" - "\377\000\250\377\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360" - "\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000" - "\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377" - "\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000" - "\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\000\250\377\377\000\264\377\377\000\300" - "\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000" - "\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377" - "\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000" - "\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367" - "\000\377\377\337\000\377\377\307\000\377\000\264\377\377\000\300\377\377\000\314\377\377\000\330\377\377\000" - "\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377" - "\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003" - "\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377" - "\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\340\000\377\377\307\000\377\377" - "\260\000\377\000\300\377\377\000\314\377\377\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377" - "\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137" - "\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377" - "\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360" - "\377\000\377\377\367\000\377\377\337\000\377\377\310\000\377\377\257\000\377\377\230\000\377\000\314\377\377" - "\000\330\377\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276" - "\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377" - "\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217" - "\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377" - "\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\000\330\377\377\000\344\377\377\000\360\377" - "\377\000\374\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377" - "\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060" - "\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377" - "\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000" - "\377\377\200\000\377\377\151\000\377\000\344\377\377\000\360\377\377\000\374\377\377\000\377\357\377\000\377" - "\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000" - "\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377" - "\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000" - "\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\201\000\377\377\150\000\377\377\121" - "\000\377\000\360\377\377\000\373\377\377\000\377\357\377\000\377\326\377\000\377\276\377\000\377\246\377\000" - "\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377" - "\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000" - "\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260" - "\000\377\377\230\000\377\377\200\000\377\377\151\000\377\377\120\000\377\377\071\000\377\000\374\377\377\000" - "\377\357\377\000\377\325\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377" - "\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000" - "\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377" - "\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377" - "\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\000\377\356\377\000\377\326\377\000\377\276\377" - "\000\377\246\377\000\377\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027" - "\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377" - "\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377" - "\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377" - "\377\041\000\377\377\012\000\377\000\377\326\377\000\377\276\377\000\377\246\377\000\377\217\377\000\377\167" - "\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377" - "\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327" - "\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377" - "\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015" - "\377\000\377\276\377\000\377\247\377\000\377\216\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377" - "\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170" - "\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377" - "\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000" - "\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\016\377\377\000\046\377\000\377\246\377\000\377" - "\217\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027" - "\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377" - "\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000" - "\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011" - "\000\377\377\000\015\377\377\000\047\377\377\000\076\377\000\377\216\377\000\377\167\377\000\377\137\377\000" - "\377\107\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377" - "\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000" - "\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150" - "\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015\377\377\000\046\377\377" - "\000\076\377\377\000\126\377\000\377\167\377\000\377\137\377\000\377\107\377\000\377\060\377\000\377\027\377" - "\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000" - "\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307" - "\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377" - "\041\000\377\377\011\000\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\126\377\377\000\155\377" - "\000\377\137\377\000\377\110\377\000\377\060\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000" - "\377\110\377\000\377\140\377\000\377\170\377\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377" - "\000\377\360\377\000\377\377\367\000\377\377\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377" - "\200\000\377\377\150\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015\377" - "\377\000\046\377\377\000\076\377\377\000\125\377\377\000\156\377\377\000\205\377\000\377\107\377\000\377\060" - "\377\000\377\027\377\003\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\170\377" - "\000\377\217\377\000\377\247\377\000\377\277\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377" - "\337\000\377\377\307\000\377\377\260\000\377\377\230\000\377\377\200\000\377\377\150\000\377\377\121\000\377" - "\377\071\000\377\377\041\000\377\377\011\000\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\126" - "\377\377\000\155\377\377\000\206\377\377\000\235\377\000\377\060\377\000\377\030\377\002\377\002\377\027\377" - "\000\377\060\377\000\377\107\377\000\377\137\377\000\377\167\377\000\377\217\377\000\377\247\377\000\377\277" - "\377\000\377\327\377\000\377\360\377\000\377\377\367\000\377\377\340\000\377\377\310\000\377\377\260\000\377" - "\377\230\000\377\377\201\000\377\377\151\000\377\377\121\000\377\377\071\000\377\377\041\000\377\377\011\000" - "\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\125\377\377\000\155\377\377\000\205\377\377\000" - "\235\377\377\000\264\377\000\377\027\377\003\377\003\377\030\377\000\377\061\377\000\377\110\377\000\377\140" - "\377\000\377\170\377\000\377\220\377\000\377\250\377\000\377\300\377\000\377\327\377\000\377\360\377\000\377" - "\377\367\000\377\377\337\000\377\377\307\000\377\377\257\000\377\377\230\000\377\377\200\000\377\377\150\000" - "\377\377\120\000\377\377\071\000\377\377\041\000\377\377\011\000\377\377\000\016\377\377\000\047\377\377\000" - "\076\377\377\000\126\377\377\000\156\377\377\000\206\377\377\000\235\377\377\000\266\377\377\000\315\377\003" - "\377\003\377\027\377\000\377\060\377\000\377\110\377\000\377\140\377\000\377\167\377\000\377\217\377\000\377" - "\247\377\000\377\277\377\000\377\327\377\000\377\357\377\000\377\377\367\000\377\377\337\000\377\377\307\000" - "\377\377\260\000\377\377\230\000\377\377\200\000\377\377\151\000\377\377\121\000\377\377\071\000\377\377\041" - "\000\377\377\012\000\377\377\000\015\377\377\000\046\377\377\000\076\377\377\000\126\377\377\000\155\377\377" - "\000\205\377\377\000\235\377\377\000\264\377\377\000\315\377\377\000\344\377" + "\0\016\377\377\0\031\377\377\0\045\377\377\0\061\377\377\0\075\377\377\0\111\377\377\0\125\377" + "\377\0\141\377\377\0\155\377\377\0\171\377\377\0\205\377\377\0\221\377\377\0\234\377\377\0\250" + "\377\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0" + "\374\377\377\0\377\356\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\216\377\0\377\167\377" + "\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\0\031\377\377\0\045\377" + "\377\0\061\377\377\0\075\377\377\0\111\377\377\0\125\377\377\0\141\377\377\0\155\377\377\0\170" + "\377\377\0\204\377\377\0\220\377\377\0\234\377\377\0\250\377\377\0\264\377\377\0\300\377\377\0" + "\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\373\377\377\0\377\357\377\0\377\326\377" + "\0\377\276\377\0\377\247\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\110\377\0\377\060" + "\377\0\377\030\377\003\377\003\377\027\377\0\377\0\045\377\377\0\061\377\377\0\075\377\377\0\111" + "\377\377\0\125\377\377\0\141\377\377\0\155\377\377\0\171\377\377\0\205\377\377\0\221\377\377\0" + "\235\377\377\0\251\377\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377" + "\0\360\377\377\0\374\377\377\0\377\357\377\0\377\325\377\0\377\276\377\0\377\246\377\0\377\216" + "\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\002\377\002\377\030\377" + "\0\377\060\377\0\377\0\061\377\377\0\075\377\377\0\111\377\377\0\125\377\377\0\141\377\377\0" + "\155\377\377\0\171\377\377\0\205\377\377\0\221\377\377\0\234\377\377\0\250\377\377\0\264\377\377" + "\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357" + "\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377" + "\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\061\377\0\377\110\377\0\377\0" + "\075\377\377\0\111\377\377\0\125\377\377\0\141\377\377\0\155\377\377\0\171\377\377\0\205\377\377" + "\0\221\377\377\0\234\377\377\0\250\377\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377" + "\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377" + "\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003" + "\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\0\111\377\377\0\125\377\377" + "\0\141\377\377\0\155\377\377\0\171\377\377\0\205\377\377\0\221\377\377\0\234\377\377\0\250\377" + "\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374" + "\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0" + "\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377" + "\107\377\0\377\140\377\0\377\167\377\0\377\0\125\377\377\0\141\377\377\0\155\377\377\0\171\377" + "\377\0\205\377\377\0\221\377\377\0\234\377\377\0\250\377\377\0\264\377\377\0\300\377\377\0\314" + "\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0" + "\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377" + "\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\137\377\0\377\170\377\0" + "\377\217\377\0\377\0\141\377\377\0\155\377\377\0\171\377\377\0\205\377\377\0\221\377\377\0\234" + "\377\377\0\250\377\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0" + "\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377" + "\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0" + "\377\060\377\0\377\110\377\0\377\140\377\0\377\167\377\0\377\220\377\0\377\247\377\0\377\0\155" + "\377\377\0\170\377\377\0\205\377\377\0\221\377\377\0\234\377\377\0\250\377\377\0\264\377\377\0" + "\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377" + "\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107" + "\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377" + "\0\377\170\377\0\377\217\377\0\377\250\377\0\377\277\377\0\377\0\171\377\377\0\204\377\377\0" + "\221\377\377\0\234\377\377\0\250\377\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377" + "\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246" + "\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377" + "\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247" + "\377\0\377\300\377\0\377\327\377\0\377\0\205\377\377\0\220\377\377\0\235\377\377\0\250\377\377" + "\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377" + "\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377" + "\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110" + "\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377" + "\357\377\0\377\0\221\377\377\0\234\377\377\0\251\377\377\0\264\377\377\0\300\377\377\0\314\377" + "\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377" + "\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0" + "\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377" + "\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\0\234\377" + "\377\0\250\377\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360" + "\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0" + "\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377" + "\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0" + "\377\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\0\250\377\377\0\264\377\377\0\300" + "\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0" + "\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377" + "\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0" + "\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367" + "\0\377\377\337\0\377\377\307\0\377\0\264\377\377\0\300\377\377\0\314\377\377\0\330\377\377\0" + "\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377" + "\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003" + "\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377" + "\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\340\0\377\377\307\0\377\377" + "\260\0\377\0\300\377\377\0\314\377\377\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377" + "\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137" + "\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377" + "\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360" + "\377\0\377\377\367\0\377\377\337\0\377\377\310\0\377\377\257\0\377\377\230\0\377\0\314\377\377" + "\0\330\377\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276" + "\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377" + "\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217" + "\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377" + "\377\307\0\377\377\260\0\377\377\230\0\377\377\200\0\377\0\330\377\377\0\344\377\377\0\360\377" + "\377\0\374\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377" + "\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060" + "\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377" + "\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0" + "\377\377\200\0\377\377\151\0\377\0\344\377\377\0\360\377\377\0\374\377\377\0\377\357\377\0\377" + "\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0" + "\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377" + "\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0" + "\377\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377\377\201\0\377\377\150\0\377\377\121" + "\0\377\0\360\377\377\0\373\377\377\0\377\357\377\0\377\326\377\0\377\276\377\0\377\246\377\0" + "\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377" + "\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0" + "\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260" + "\0\377\377\230\0\377\377\200\0\377\377\151\0\377\377\120\0\377\377\071\0\377\0\374\377\377\0" + "\377\357\377\0\377\325\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377" + "\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0" + "\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377" + "\0\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377\377\200\0\377\377" + "\150\0\377\377\121\0\377\377\071\0\377\377\041\0\377\0\377\356\377\0\377\326\377\0\377\276\377" + "\0\377\246\377\0\377\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027" + "\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377" + "\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377" + "\307\0\377\377\260\0\377\377\230\0\377\377\200\0\377\377\150\0\377\377\121\0\377\377\071\0\377" + "\377\041\0\377\377\012\0\377\0\377\326\377\0\377\276\377\0\377\246\377\0\377\217\377\0\377\167" + "\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377" + "\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327" + "\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377" + "\377\200\0\377\377\150\0\377\377\121\0\377\377\071\0\377\377\041\0\377\377\011\0\377\377\0\015" + "\377\0\377\276\377\0\377\247\377\0\377\216\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377" + "\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170" + "\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377" + "\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377\377\200\0\377\377\150\0\377\377\121\0" + "\377\377\071\0\377\377\041\0\377\377\011\0\377\377\0\016\377\377\0\046\377\0\377\246\377\0\377" + "\217\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027" + "\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377" + "\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260\0" + "\377\377\230\0\377\377\200\0\377\377\150\0\377\377\121\0\377\377\071\0\377\377\041\0\377\377\011" + "\0\377\377\0\015\377\377\0\047\377\377\0\076\377\0\377\216\377\0\377\167\377\0\377\137\377\0" + "\377\107\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377" + "\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0" + "\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377\377\200\0\377\377\150" + "\0\377\377\121\0\377\377\071\0\377\377\041\0\377\377\011\0\377\377\0\015\377\377\0\046\377\377" + "\0\076\377\377\0\126\377\0\377\167\377\0\377\137\377\0\377\107\377\0\377\060\377\0\377\027\377" + "\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0" + "\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377\307" + "\0\377\377\260\0\377\377\230\0\377\377\200\0\377\377\150\0\377\377\121\0\377\377\071\0\377\377" + "\041\0\377\377\011\0\377\377\0\015\377\377\0\046\377\377\0\076\377\377\0\126\377\377\0\155\377" + "\0\377\137\377\0\377\110\377\0\377\060\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0" + "\377\110\377\0\377\140\377\0\377\170\377\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377" + "\0\377\360\377\0\377\377\367\0\377\377\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377\377" + "\200\0\377\377\150\0\377\377\121\0\377\377\071\0\377\377\041\0\377\377\011\0\377\377\0\015\377" + "\377\0\046\377\377\0\076\377\377\0\125\377\377\0\156\377\377\0\205\377\0\377\107\377\0\377\060" + "\377\0\377\027\377\003\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\170\377" + "\0\377\217\377\0\377\247\377\0\377\277\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377" + "\337\0\377\377\307\0\377\377\260\0\377\377\230\0\377\377\200\0\377\377\150\0\377\377\121\0\377" + "\377\071\0\377\377\041\0\377\377\011\0\377\377\0\015\377\377\0\046\377\377\0\076\377\377\0\126" + "\377\377\0\155\377\377\0\206\377\377\0\235\377\0\377\060\377\0\377\030\377\002\377\002\377\027\377" + "\0\377\060\377\0\377\107\377\0\377\137\377\0\377\167\377\0\377\217\377\0\377\247\377\0\377\277" + "\377\0\377\327\377\0\377\360\377\0\377\377\367\0\377\377\340\0\377\377\310\0\377\377\260\0\377" + "\377\230\0\377\377\201\0\377\377\151\0\377\377\121\0\377\377\071\0\377\377\041\0\377\377\011\0" + "\377\377\0\015\377\377\0\046\377\377\0\076\377\377\0\125\377\377\0\155\377\377\0\205\377\377\0" + "\235\377\377\0\264\377\0\377\027\377\003\377\003\377\030\377\0\377\061\377\0\377\110\377\0\377\140" + "\377\0\377\170\377\0\377\220\377\0\377\250\377\0\377\300\377\0\377\327\377\0\377\360\377\0\377" + "\377\367\0\377\377\337\0\377\377\307\0\377\377\257\0\377\377\230\0\377\377\200\0\377\377\150\0" + "\377\377\120\0\377\377\071\0\377\377\041\0\377\377\011\0\377\377\0\016\377\377\0\047\377\377\0" + "\076\377\377\0\126\377\377\0\156\377\377\0\206\377\377\0\235\377\377\0\266\377\377\0\315\377\003" + "\377\003\377\027\377\0\377\060\377\0\377\110\377\0\377\140\377\0\377\167\377\0\377\217\377\0\377" + "\247\377\0\377\277\377\0\377\327\377\0\377\357\377\0\377\377\367\0\377\377\337\0\377\377\307\0" + "\377\377\260\0\377\377\230\0\377\377\200\0\377\377\151\0\377\377\121\0\377\377\071\0\377\377\041" + "\0\377\377\012\0\377\377\0\015\377\377\0\046\377\377\0\076\377\377\0\126\377\377\0\155\377\377" + "\0\205\377\377\0\235\377\377\0\264\377\377\0\315\377\377\0\344\377" }; /** @@ -1899,59 +1899,59 @@ static const SDLTest_SurfaceImage_t SDLTest_imageTransparentSprite = { 32, 32, 4, - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\101\205\101\000\143\152\143\000\143\151\143\003\145\151\145\034\146\150\146\111\146\150\146\132\145\150" - "\146\014\146\150\146\000\146\150\146\000\147\147\147\000\145\150\145\042\146\147\146\137\146\150\146\111\145" - "\151\145\056\144\152\144\017\151\145\151\000\067\215\076\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\125\166\126\000\177\120" - "\176\000\147\147\147\117\147\147\147\230\147\147\147\242\147\147\147\233\147\147\147\111\377\000\377\000\143" - "\152\143\000\143\152\143\005\146\147\146\120\147\147\147\155\147\147\147\144\147\147\147\135\144\151\144\057" - "\176\126\174\000\110\200\113\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\126\164\127\000\205\115\204\000\146\147\146\154\147" - "\147\147\260\147\147\147\243\147\147\147\234\147\147\147\211\146\150\146\047\335\017\335\000\146\150\146\052" - "\147\147\147\160\147\147\147\154\147\147\147\144\147\147\147\135\146\150\146\064\203\123\201\000\132\161\134" - "\000\135\156\136\000\146\151\145\000\150\146\150\000\135\155\135\000\144\151\144\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\144\152\144\000\126\165\131\000\147\147\147\000\146" - "\147\146\000\143\152\143\000\204\120\203\000\156\142\156\000\146\147\146\135\147\147\147\256\147\147\147\243" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\101\205\101\0\143\152\143\0\143\151\143\003\145\151\145\034\146\150\146\111\146\150\146\132\145\150" + "\146\014\146\150\146\0\146\150\146\0\147\147\147\0\145\150\145\042\146\147\146\137\146\150\146\111\145" + "\151\145\056\144\152\144\017\151\145\151\0\067\215\076\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\125\166\126\0\177\120" + "\176\0\147\147\147\117\147\147\147\230\147\147\147\242\147\147\147\233\147\147\147\111\377\0\377\0\143" + "\152\143\0\143\152\143\005\146\147\146\120\147\147\147\155\147\147\147\144\147\147\147\135\144\151\144\057" + "\176\126\174\0\110\200\113\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\126\164\127\0\205\115\204\0\146\147\146\154\147" + "\147\147\260\147\147\147\243\147\147\147\234\147\147\147\211\146\150\146\047\335\017\335\0\146\150\146\052" + "\147\147\147\160\147\147\147\154\147\147\147\144\147\147\147\135\146\150\146\064\203\123\201\0\132\161\134" + "\0\135\156\136\0\146\151\145\0\150\146\150\0\135\155\135\0\144\151\144\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\144\152\144\0\126\165\131\0\147\147\147\0\146" + "\147\146\0\143\152\143\0\204\120\203\0\156\142\156\0\146\147\146\135\147\147\147\256\147\147\147\243" "\147\147\147\233\147\147\147\224\147\147\147\171\146\150\146\134\147\147\147\155\147\147\147\164\147\147\147" - "\154\147\147\147\144\147\147\147\135\146\150\146\065\161\140\161\000\143\152\143\000\120\165\123\001\143\153" - "\143\014\143\152\143\013\152\146\153\000\145\147\145\000\146\146\146\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\133\161\133\000\101\207\104\000\150\146\150\000\146\150\146\045\146\150\146\046\141\154\141\003" - "\147\147\147\000\150\146\150\000\146\150\146\126\147\147\147\256\147\147\147\243\147\147\147\233\147\147\147" + "\154\147\147\147\144\147\147\147\135\146\150\146\065\161\140\161\0\143\152\143\0\120\165\123\001\143\153" + "\143\014\143\152\143\013\152\146\153\0\145\147\145\0\146\146\146\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\133\161\133\0\101\207\104\0\150\146\150\0\146\150\146\045\146\150\146\046\141\154\141\003" + "\147\147\147\0\150\146\150\0\146\150\146\126\147\147\147\256\147\147\147\243\147\147\147\233\147\147\147" "\223\147\147\147\214\147\147\147\206\147\147\147\174\147\147\147\163\147\147\147\154\147\147\147\144\147\147" "\147\135\146\150\146\101\142\153\142\014\143\152\143\013\145\150\145\043\147\150\147\060\147\147\147\050\147" - "\147\147\013\147\152\147\000\143\150\143\000\133\161\134\000\000\000\000\000\000\000\000\000\150\146\150\000" - "\147\147\147\000\147\147\147\046\147\147\147\264\147\147\147\301\147\147\147\202\146\150\146\072\146\150\146" + "\147\147\013\147\152\147\0\143\150\143\0\133\161\134\0\0\0\0\0\0\0\0\0\150\146\150\0" + "\147\147\147\0\147\147\147\046\147\147\147\264\147\147\147\301\147\147\147\202\146\150\146\072\146\150\146" "\071\147\147\147\222\147\147\147\255\147\147\147\243\147\147\147\234\147\147\147\225\147\147\147\216\147\147" "\147\206\147\147\147\176\147\147\147\165\147\147\147\155\147\147\147\144\147\147\147\134\147\147\147\123\146" "\150\146\103\146\147\146\074\147\147\147\074\147\147\147\064\147\147\147\054\147\147\147\040\146\150\146\011" - "\152\145\152\000\132\162\133\000\000\000\000\000\000\000\000\000\147\147\147\000\146\150\146\024\147\147\147" + "\152\145\152\0\132\162\133\0\0\0\0\0\0\0\0\0\147\147\147\0\146\150\146\024\147\147\147" "\243\147\147\147\336\147\147\147\325\147\147\147\316\147\147\147\275\147\147\147\264\147\147\147\265\147\147" "\147\254\147\147\147\246\147\147\147\227\147\147\147\174\147\147\147\137\146\150\146\120\146\150\146\113\146" "\147\146\117\146\147\146\132\147\147\147\141\147\147\147\135\147\147\147\124\147\147\147\114\147\146\147\104" - "\147\147\147\074\147\147\147\064\147\147\147\054\147\147\147\044\145\151\145\015\154\144\153\000\125\166\130" - "\000\000\000\000\000\000\000\000\000\147\147\147\000\146\150\146\057\147\147\147\320\147\147\147\335\147\147" + "\147\147\147\074\147\147\147\064\147\147\147\054\147\147\147\044\145\151\145\015\154\144\153\0\125\166\130" + "\0\0\0\0\0\0\0\0\0\147\147\147\0\146\150\146\057\147\147\147\320\147\147\147\335\147\147" "\147\323\147\147\147\313\147\147\147\304\147\147\147\274\147\147\147\265\147\147\147\250\147\147\147\163\146" - "\150\146\061\144\151\145\016\137\155\140\002\170\133\212\000\170\127\213\000\134\160\134\002\143\152\143\012" + "\150\146\061\144\151\145\016\137\155\140\002\170\133\212\0\170\127\213\0\134\160\134\002\143\152\143\012" "\145\150\146\037\146\150\146\100\147\147\147\122\147\147\147\114\147\147\147\104\147\147\147\074\147\147\147" - "\064\147\147\147\054\146\150\146\035\141\154\141\003\142\152\142\000\134\161\135\000\000\000\000\000\000\000" - "\000\000\146\150\146\000\144\152\144\001\147\147\147\151\147\147\147\330\147\147\147\324\147\147\147\313\147" - "\147\147\303\147\147\147\275\147\147\147\244\147\147\146\110\143\150\133\006\163\162\231\000\202\204\275\000" - "\236\240\375\000\140\144\231\002\144\145\237\003\245\252\377\000\166\167\255\000\152\152\174\000\141\154\141" + "\064\147\147\147\054\146\150\146\035\141\154\141\003\142\152\142\0\134\161\135\0\0\0\0\0\0\0" + "\0\0\146\150\146\0\144\152\144\001\147\147\147\151\147\147\147\330\147\147\147\324\147\147\147\313\147" + "\147\147\303\147\147\147\275\147\147\147\244\147\147\146\110\143\150\133\006\163\162\231\0\202\204\275\0" + "\236\240\375\0\140\144\231\002\144\145\237\003\245\252\377\0\166\167\255\0\152\152\174\0\141\154\141" "\004\146\150\146\042\147\147\147\105\147\147\147\104\147\147\147\074\147\147\147\064\147\147\147\052\144\151" - "\144\014\150\146\147\000\162\130\162\000\000\000\000\000\000\000\000\000\000\000\000\000\146\150\146\000\146" - "\147\146\000\146\150\146\012\147\147\147\215\147\147\147\325\147\147\147\313\147\147\147\305\147\147\147\253" - "\146\150\146\071\161\152\222\000\162\162\274\011\174\173\311\053\177\176\314\110\201\201\321\115\202\202\322" - "\127\202\202\322\126\173\172\307\101\167\167\300\041\170\167\302\010\213\217\320\000\157\143\213\000\146\147" - "\146\026\147\147\147\075\147\147\147\074\147\147\147\064\147\150\147\050\142\153\142\006\150\147\150\000\146" - "\150\146\000\144\151\144\000\135\151\135\000\150\145\147\000\133\160\133\000\142\153\142\000\147\147\147\000" - "\146\147\146\130\147\147\147\323\147\147\147\314\147\147\147\277\147\147\147\117\166\161\240\000\163\161\271" + "\144\014\150\146\147\0\162\130\162\0\0\0\0\0\0\0\0\0\0\0\0\0\146\150\146\0\146" + "\147\146\0\146\150\146\012\147\147\147\215\147\147\147\325\147\147\147\313\147\147\147\305\147\147\147\253" + "\146\150\146\071\161\152\222\0\162\162\274\011\174\173\311\053\177\176\314\110\201\201\321\115\202\202\322" + "\127\202\202\322\126\173\172\307\101\167\167\300\041\170\167\302\010\213\217\320\0\157\143\213\0\146\147" + "\146\026\147\147\147\075\147\147\147\074\147\147\147\064\147\150\147\050\142\153\142\006\150\147\150\0\146" + "\150\146\0\144\151\144\0\135\151\135\0\150\145\147\0\133\160\133\0\142\153\142\0\147\147\147\0" + "\146\147\146\130\147\147\147\323\147\147\147\314\147\147\147\277\147\147\147\117\166\161\240\0\163\161\271" "\032\202\201\321\163\176\176\314\216\200\200\320\217\204\204\326\214\201\201\321\203\177\177\316\173\203\203" - "\324\165\200\200\320\150\175\175\312\120\175\174\313\054\147\144\245\007\164\155\237\000\145\150\145\033\147" + "\324\165\200\200\320\150\175\175\312\120\175\174\313\054\147\144\245\007\164\155\237\0\145\150\145\033\147" "\147\147\072\147\147\147\064\147\147\147\054\145\151\145\031\143\152\144\014\142\152\142\010\134\157\134\004" - "\131\154\131\001\150\146\150\000\155\143\155\000\143\152\143\006\145\150\145\033\147\147\147\237\147\147\147" + "\131\154\131\001\150\146\150\0\155\143\155\0\143\152\143\006\145\150\145\033\147\147\147\237\147\147\147" "\326\147\147\147\316\147\147\147\212\137\143\116\007\165\163\276\032\174\173\310\173\206\206\331\243\176\176" "\314\222\177\177\315\214\203\203\324\210\201\201\321\200\205\205\330\173\202\202\323\163\176\176\313\154\176" "\176\314\144\177\177\315\134\172\171\304\073\172\167\306\011\130\150\106\002\146\150\146\051\147\147\147\065" @@ -1974,83 +1974,83 @@ static const SDLTest_SurfaceImage_t SDLTest_imageTransparentSprite = { "\147\147\146\176\171\172\305\015\203\203\325\227\202\202\323\260\210\210\334\250\202\202\323\231\205\205\327" "\234\204\204\327\223\204\204\325\212\204\204\326\201\203\203\323\173\200\200\317\164\177\177\316\153\201\201" "\320\143\205\205\327\134\205\205\327\124\176\176\313\115\174\173\310\063\142\146\237\002\146\150\145\037\147" - "\147\147\055\147\147\147\044\147\150\147\032\144\152\144\014\140\152\140\002\036\233\036\000\146\150\146\054" + "\147\147\055\147\147\147\044\147\150\147\032\144\152\144\014\140\152\140\002\036\233\036\0\146\150\146\054" "\147\147\147\150\147\147\147\254\147\147\147\331\147\147\147\334\147\147\147\327\147\147\147\177\150\156\255" "\003\201\201\321\176\177\177\315\261\206\206\330\251\203\203\323\234\202\202\323\233\203\203\324\223\205\205" "\330\213\203\203\325\203\206\206\331\174\200\200\316\163\177\177\316\153\203\203\324\144\200\200\316\134\201" "\201\321\124\200\200\316\114\202\202\323\067\153\154\254\004\145\150\145\037\147\147\147\055\147\147\147\044" - "\145\152\145\025\067\212\073\000\136\155\136\000\105\177\105\000\147\147\146\000\151\146\150\000\144\151\145" + "\145\152\145\025\067\212\073\0\136\155\136\0\105\177\105\0\147\147\146\0\151\146\150\0\144\151\145" "\010\147\147\147\171\147\147\147\335\147\147\147\326\147\147\147\221\104\124\011\003\177\176\315\103\206\206" "\332\244\206\206\331\254\202\202\323\234\206\206\331\230\202\202\323\223\205\205\327\213\202\202\323\202\203" "\203\324\171\205\205\327\163\201\201\320\154\176\176\314\144\201\201\320\134\205\205\330\124\201\201\320\115" "\202\201\322\053\072\132\047\001\145\151\145\044\147\147\147\055\147\147\147\044\146\152\146\026\134\160\135" - "\002\145\154\144\000\072\203\072\000\136\157\137\000\154\143\153\000\147\147\147\000\146\147\146\103\147\147" - "\147\327\147\147\147\325\147\147\147\256\145\150\145\025\143\170\000\000\177\176\315\057\203\203\324\231\205" + "\002\145\154\144\0\072\203\072\0\136\157\137\0\154\143\153\0\147\147\147\0\146\147\146\103\147\147" + "\147\327\147\147\147\325\147\147\147\256\145\150\145\025\143\170\0\0\177\176\315\057\203\203\324\231\205" "\205\327\240\176\176\313\217\201\201\321\220\174\174\310\211\174\174\311\201\200\200\320\170\176\176\314\162" "\200\200\317\153\207\207\333\143\202\202\323\134\176\176\314\124\174\174\310\103\173\173\310\020\134\151\124" "\005\146\150\146\054\147\147\147\054\147\147\147\044\150\150\150\034\144\147\144\017\140\151\140\003\227\076" - "\227\000\147\147\147\000\146\147\146\000\143\151\144\003\147\147\147\155\147\147\147\332\147\147\147\324\147" - "\147\147\307\147\147\147\103\150\147\161\000\137\133\225\003\174\173\307\163\202\202\322\246\203\203\324\227" + "\227\0\147\147\147\0\146\147\146\0\143\151\144\003\147\147\147\155\147\147\147\332\147\147\147\324\147" + "\147\147\307\147\147\147\103\150\147\161\0\137\133\225\003\174\173\307\163\202\202\322\246\203\203\324\227" "\202\202\322\220\202\202\322\210\177\177\316\202\177\177\316\172\200\200\317\163\205\205\327\153\177\177\316" - "\142\201\201\320\134\175\174\311\120\162\160\266\036\166\166\233\000\144\151\144\023\147\147\147\063\147\147" - "\147\054\147\147\147\044\150\150\150\034\146\146\146\024\144\147\144\013\142\153\142\002\146\147\146\000\146" + "\142\201\201\320\134\175\174\311\120\162\160\266\036\166\166\233\0\144\151\144\023\147\147\147\063\147\147" + "\147\054\147\147\147\044\150\150\150\034\146\146\146\024\144\147\144\013\142\153\142\002\146\147\146\0\146" "\150\146\007\147\147\147\160\147\147\147\332\147\147\147\334\147\147\147\323\147\147\147\316\147\147\147\216" - "\145\150\145\012\155\155\223\000\163\162\271\045\203\202\323\202\204\204\326\201\205\205\330\152\211\211\336" + "\145\150\145\012\155\155\223\0\163\162\271\045\203\202\323\202\204\204\326\201\205\205\330\152\211\211\336" "\212\203\203\324\203\200\200\316\173\203\203\324\163\201\201\320\154\200\200\316\144\176\176\314\134\172\171" "\304\060\126\111\235\001\140\154\134\003\146\150\146\052\147\147\147\065\147\147\147\054\147\147\147\044\150" - "\150\150\034\146\146\146\024\146\146\146\014\142\150\142\003\222\076\212\000\147\147\147\157\147\147\147\346" + "\150\150\034\146\146\146\024\146\146\146\014\142\150\142\003\222\076\212\0\147\147\147\157\147\147\147\346" "\147\147\147\344\147\147\147\333\147\147\147\323\147\147\147\314\147\147\147\300\147\147\147\124\155\143\156" - "\000\202\204\302\000\172\167\304\020\165\163\275\017\166\164\277\013\203\203\324\123\204\203\325\172\205\205" - "\327\175\200\200\317\164\176\176\314\155\166\166\276\142\164\164\273\074\152\151\254\006\170\145\246\000\145" + "\0\202\204\302\0\172\167\304\020\165\163\275\017\166\164\277\013\203\203\324\123\204\203\325\172\205\205" + "\327\175\200\200\317\164\176\176\314\155\166\166\276\142\164\164\273\074\152\151\254\006\170\145\246\0\145" "\150\145\035\147\147\147\073\147\147\147\064\147\147\147\054\147\147\147\044\150\150\150\034\147\146\147\024" - "\145\146\145\013\135\152\135\001\151\145\151\000\147\147\147\162\147\147\147\354\147\147\147\343\147\147\147" - "\334\147\147\147\325\147\147\147\314\147\147\147\304\147\147\147\255\146\150\147\076\155\142\155\000\161\161" - "\233\000\167\165\301\000\173\171\306\000\142\140\233\004\173\172\307\041\203\203\324\104\200\177\317\110\201" - "\200\320\102\176\175\313\046\170\164\306\005\172\147\252\000\143\151\144\031\146\147\146\076\147\147\147\074" + "\145\146\145\013\135\152\135\001\151\145\151\0\147\147\147\162\147\147\147\354\147\147\147\343\147\147\147" + "\334\147\147\147\325\147\147\147\314\147\147\147\304\147\147\147\255\146\150\147\076\155\142\155\0\161\161" + "\233\0\167\165\301\0\173\171\306\0\142\140\233\004\173\172\307\041\203\203\324\104\200\177\317\110\201" + "\200\320\102\176\175\313\046\170\164\306\005\172\147\252\0\143\151\144\031\146\147\146\076\147\147\147\074" "\147\147\147\064\146\150\146\047\145\151\146\031\146\151\146\026\145\147\145\021\144\151\145\010\074\205\103" - "\000\147\147\147\000\147\147\147\034\147\147\147\304\147\147\147\347\147\147\147\323\147\147\147\271\147\147" - "\147\274\147\147\147\305\147\147\147\275\147\147\147\246\147\147\147\115\144\151\145\011\150\147\150\000\145" - "\150\145\000\146\152\212\000\200\200\315\000\257\261\377\000\000\000\011\000\257\306\304\000\167\166\237\000" + "\0\147\147\147\0\147\147\147\034\147\147\147\304\147\147\147\347\147\147\147\323\147\147\147\271\147\147" + "\147\274\147\147\147\305\147\147\147\275\147\147\147\246\147\147\147\115\144\151\145\011\150\147\150\0\145" + "\150\145\0\146\152\212\0\200\200\315\0\257\261\377\0\0\0\011\0\257\306\304\0\167\166\237\0" "\140\152\131\004\146\151\146\045\147\147\147\106\147\147\147\104\147\147\147\074\147\147\147\060\144\152\144" - "\015\056\226\063\000\132\163\132\001\134\160\134\002\137\156\137\001\150\143\150\000\141\154\141\000\151\144" - "\151\000\147\147\147\111\147\147\147\147\146\147\146\072\146\150\146\031\147\147\147\074\147\147\147\254\147" + "\015\056\226\063\0\132\163\132\001\134\160\134\002\137\156\137\001\150\143\150\0\141\154\141\0\151\144" + "\151\0\147\147\147\111\147\147\147\147\146\147\146\072\146\150\146\031\147\147\147\074\147\147\147\254\147" "\147\147\274\147\147\147\264\147\147\147\251\147\147\147\170\146\150\146\066\145\150\145\021\141\154\141\004" - "\036\243\037\000\017\276\022\000\137\156\137\003\144\152\144\014\145\150\145\043\146\150\146\102\147\147\147" - "\122\147\147\147\114\147\147\147\104\147\147\147\074\146\150\146\053\140\154\140\004\136\155\137\000\131\164" - "\131\000\134\160\134\000\137\155\137\000\153\141\153\000\145\151\145\000\144\152\144\000\151\145\151\000\150" - "\146\150\000\147\147\147\000\146\150\146\000\147\147\147\000\147\150\146\130\147\147\147\274\147\147\147\263" + "\036\243\037\0\017\276\022\0\137\156\137\003\144\152\144\014\145\150\145\043\146\150\146\102\147\147\147" + "\122\147\147\147\114\147\147\147\104\147\147\147\074\146\150\146\053\140\154\140\004\136\155\137\0\131\164" + "\131\0\134\160\134\0\137\155\137\0\153\141\153\0\145\151\145\0\144\152\144\0\151\145\151\0\150" + "\146\150\0\147\147\147\0\146\150\146\0\147\147\147\0\147\150\146\130\147\147\147\274\147\147\147\263" "\147\147\147\254\147\147\147\245\147\147\147\231\147\147\147\177\147\147\146\145\147\147\147\122\147\147\147" "\115\146\147\146\123\147\147\147\135\147\147\147\142\147\147\147\135\147\147\147\124\147\147\147\114\147\147" - "\147\104\147\147\147\074\147\147\147\062\145\151\145\015\146\147\146\000\137\153\140\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\134\160\135\000\133\161\134\000\127\163\130\000\131\162\132\000" - "\075\206\100\000\152\145\152\000\147\147\147\141\147\147\147\276\147\147\147\263\147\147\147\253\147\147\147" + "\147\104\147\147\147\074\147\147\147\062\145\151\145\015\146\147\146\0\137\153\140\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\134\160\135\0\133\161\134\0\127\163\130\0\131\162\132\0" + "\075\206\100\0\152\145\152\0\147\147\147\141\147\147\147\276\147\147\147\263\147\147\147\253\147\147\147" "\243\147\147\147\234\147\147\147\225\147\147\147\216\147\147\147\206\147\147\147\176\147\147\147\165\147\147" "\147\154\147\147\147\144\147\147\147\135\147\147\147\125\147\147\147\114\146\146\146\104\147\147\147\074\147" - "\147\147\064\145\150\146\034\106\176\114\000\134\156\135\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\144\151\144\000\144\151\144" + "\147\147\064\145\150\146\034\106\176\114\0\134\156\135\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\144\151\144\0\144\151\144" "\006\147\147\147\214\147\147\147\276\147\147\147\263\147\147\147\254\147\147\147\243\147\147\147\221\147\147" "\147\220\147\147\147\214\147\147\147\203\147\147\147\173\147\147\147\164\147\147\147\154\147\147\147\137\146" "\150\146\100\146\150\146\057\146\147\146\104\147\147\147\105\147\147\147\074\147\147\147\065\145\150\146\042" - "\135\155\136\002\136\155\137\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\146\150\146\000\146\150\146\027\147\147\147\251\147\147" + "\135\155\136\002\136\155\137\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\146\150\146\0\146\150\146\027\147\147\147\251\147\147" "\147\277\147\147\147\264\147\147\147\254\147\147\147\152\145\151\145\037\146\150\146\054\147\147\147\145\147" - "\147\147\205\147\147\147\173\147\147\147\164\147\147\147\155\146\150\146\070\132\160\134\002\172\130\171\000" - "\145\150\145\023\146\147\146\067\147\147\147\074\146\150\146\046\143\152\144\011\175\141\167\000\133\155\136" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\146\150\146\000\145\150\146\007\147\147\147\116\147\147\147\234\147\147\147\263\147" - "\147\147\160\145\151\145\015\146\150\146\000\147\147\147\000\146\150\146\052\147\147\147\200\147\147\147\174" - "\147\147\147\164\147\147\147\152\145\150\145\040\146\150\146\000\134\160\134\000\147\146\147\000\143\152\143" - "\013\144\152\144\031\142\154\142\005\145\150\146\000\067\200\077\000\131\156\135\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\146" - "\150\146\000\146\150\146\000\152\145\152\000\146\150\146\030\147\147\147\103\145\150\145\017\146\147\146\000" - "\150\146\150\000\144\151\145\000\144\151\144\015\147\147\147\155\147\147\147\175\147\147\147\165\147\147\147" - "\143\144\151\144\021\144\151\145\000\131\162\131\000\375\000\374\000\146\147\146\000\155\142\154\000\143\152" - "\144\000\150\147\150\000\116\176\116\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\142\153\142\000" - "\124\166\124\000\147\150\147\000\150\146\150\000\146\147\146\000\150\146\150\000\120\170\120\000\136\156\136" - "\000\115\167\115\000\146\150\146\115\146\147\146\170\146\147\146\151\146\150\146\110\143\152\143\005\142\152" - "\143\000\000\000\000\000\072\212\100\000\073\213\077\000\073\213\076\000\076\220\070\000\000\000\000\000\000" - "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" + "\147\147\205\147\147\147\173\147\147\147\164\147\147\147\155\146\150\146\070\132\160\134\002\172\130\171\0" + "\145\150\145\023\146\147\146\067\147\147\147\074\146\150\146\046\143\152\144\011\175\141\167\0\133\155\136" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\146\150\146\0\145\150\146\007\147\147\147\116\147\147\147\234\147\147\147\263\147" + "\147\147\160\145\151\145\015\146\150\146\0\147\147\147\0\146\150\146\052\147\147\147\200\147\147\147\174" + "\147\147\147\164\147\147\147\152\145\150\145\040\146\150\146\0\134\160\134\0\147\146\147\0\143\152\143" + "\013\144\152\144\031\142\154\142\005\145\150\146\0\067\200\077\0\131\156\135\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\146" + "\150\146\0\146\150\146\0\152\145\152\0\146\150\146\030\147\147\147\103\145\150\145\017\146\147\146\0" + "\150\146\150\0\144\151\145\0\144\151\144\015\147\147\147\155\147\147\147\175\147\147\147\165\147\147\147" + "\143\144\151\144\021\144\151\145\0\131\162\131\0\375\0\374\0\146\147\146\0\155\142\154\0\143\152" + "\144\0\150\147\150\0\116\176\116\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\142\153\142\0" + "\124\166\124\0\147\150\147\0\150\146\150\0\146\147\146\0\150\146\150\0\120\170\120\0\136\156\136" + "\0\115\167\115\0\146\150\146\115\146\147\146\170\146\147\146\151\146\150\146\110\143\152\143\005\142\152" + "\143\0\0\0\0\0\072\212\100\0\073\213\077\0\073\213\076\0\076\220\070\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" }; /** @@ -2066,3 +2066,471 @@ SDL_Surface *SDLTest_ImageBlendingSprite(void) SDLTest_imageTransparentSprite.width * SDLTest_imageTransparentSprite.bytes_per_pixel); return surface; } + +static const SDLTest_SurfaceImage_t SDLTest_imageWrappingSprite = { + 80, + 60, + 3, + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0" + "\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0" + "\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\377\377\0\377\377\0\377" + "\377\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377" + "\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377" + "\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377" + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" + "\0\0\0\0\0\0\0\377\377\0\377\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\377" + "\377\0\377\377\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", +}; + +/** + * \brief Returns the blending rendering sprite test image as an SDL_Surface. + */ +SDL_Surface *SDLTest_ImageWrappingSprite(void) +{ + SDL_Surface *surface = SDL_CreateSurfaceFrom( + SDLTest_imageWrappingSprite.width, + SDLTest_imageWrappingSprite.height, + SDL_PIXELFORMAT_RGB24, + (void *)SDLTest_imageWrappingSprite.pixel_data, + SDLTest_imageWrappingSprite.width * SDLTest_imageWrappingSprite.bytes_per_pixel); + return surface; +} + diff --git a/test/testautomation_images.h b/test/testautomation_images.h index 659a7528d9075..abce7ebd136d7 100644 --- a/test/testautomation_images.h +++ b/test/testautomation_images.h @@ -23,9 +23,10 @@ typedef struct SDLTest_SurfaceImage_s { } SDLTest_SurfaceImage_t; /* Test images */ -SDL_Surface *SDLTest_ImageBlit(void); -SDL_Surface *SDLTest_ImageBlitColor(void); -SDL_Surface *SDLTest_ImageFace(void); -SDL_Surface *SDLTest_ImagePrimitives(void); -SDL_Surface *SDLTest_ImageBlendingBackground(void); -SDL_Surface *SDLTest_ImageBlendingSprite(void); +extern SDL_Surface *SDLTest_ImageBlit(void); +extern SDL_Surface *SDLTest_ImageBlitColor(void); +extern SDL_Surface *SDLTest_ImageFace(void); +extern SDL_Surface *SDLTest_ImagePrimitives(void); +extern SDL_Surface *SDLTest_ImageBlendingBackground(void); +extern SDL_Surface *SDLTest_ImageBlendingSprite(void); +extern SDL_Surface *SDLTest_ImageWrappingSprite(void); diff --git a/test/testautomation_render.c b/test/testautomation_render.c index aebdb32a0f95b..3284b5421eb3c 100644 --- a/test/testautomation_render.c +++ b/test/testautomation_render.c @@ -1076,6 +1076,109 @@ clearScreen(void) return 0; } +/** + * Tests geometry UV wrapping + */ +static int render_testUVWrapping(void *arg) +{ + SDL_Vertex vertices[6]; + SDL_Vertex *verts = vertices; + SDL_FColor color = { 1.0f, 1.0f, 1.0f, 1.0f }; + float tw, th; + SDL_FRect rect; + float min_U = -0.5f; + float max_U = 1.5f; + float min_V = -0.5f; + float max_V = 1.5f; + SDL_Texture *tface; + SDL_Surface *referenceSurface = NULL; + + /* Clear surface. */ + clearScreen(); + + /* Create face surface. */ + tface = loadTestFace(); + SDLTest_AssertCheck(tface != NULL, "Verify loadTestFace() result"); + if (tface == NULL) { + return TEST_ABORTED; + } + + CHECK_FUNC(SDL_GetTextureSize, (tface, &tw, &th)) + rect.w = tw * 2; + rect.h = th * 2; + rect.x = (TESTRENDER_SCREEN_W - rect.w) / 2; + rect.y = (TESTRENDER_SCREEN_H - rect.h) / 2; + + /* + * 0--1 + * | /| + * |/ | + * 3--2 + * + * Draw sprite2 as triangles that can be recombined as rect by software renderer + */ + + /* 0 */ + verts->position.x = rect.x; + verts->position.y = rect.y; + verts->color = color; + verts->tex_coord.x = min_U; + verts->tex_coord.y = min_V; + verts++; + /* 1 */ + verts->position.x = rect.x + rect.w; + verts->position.y = rect.y; + verts->color = color; + verts->tex_coord.x = max_U; + verts->tex_coord.y = min_V; + verts++; + /* 2 */ + verts->position.x = rect.x + rect.w; + verts->position.y = rect.y + rect.h; + verts->color = color; + verts->tex_coord.x = max_U; + verts->tex_coord.y = max_V; + verts++; + /* 0 */ + verts->position.x = rect.x; + verts->position.y = rect.y; + verts->color = color; + verts->tex_coord.x = min_U; + verts->tex_coord.y = min_V; + verts++; + /* 2 */ + verts->position.x = rect.x + rect.w; + verts->position.y = rect.y + rect.h; + verts->color = color; + verts->tex_coord.x = max_U; + verts->tex_coord.y = max_V; + verts++; + /* 3 */ + verts->position.x = rect.x; + verts->position.y = rect.y + rect.h; + verts->color = color; + verts->tex_coord.x = min_U; + verts->tex_coord.y = max_V; + verts++; + + /* Blit sprites as triangles onto the screen */ + SDL_RenderGeometry(renderer, tface, vertices, 6, NULL, 0); + + /* See if it's the same */ + referenceSurface = SDLTest_ImageWrappingSprite(); + compare(referenceSurface, ALLOWABLE_ERROR_OPAQUE); + + /* Make current */ + SDL_RenderPresent(renderer); + + /* Clean up. */ + SDL_DestroyTexture(tface); + SDL_DestroySurface(referenceSurface); + referenceSurface = NULL; + + return TEST_COMPLETED; +} + /* ================= Test References ================== */ /* Render test cases */ @@ -1115,11 +1218,15 @@ static const SDLTest_TestCaseReference renderTest9 = { (SDLTest_TestCaseFp)render_testLogicalSize, "render_testLogicalSize", "Tests logical size", TEST_ENABLED }; +static const SDLTest_TestCaseReference renderTestUVWrapping = { + (SDLTest_TestCaseFp)render_testUVWrapping, "render_testUVWrapping", "Tests geometry UV wrapping", TEST_ENABLED +}; + /* Sequence of Render test cases */ static const SDLTest_TestCaseReference *renderTests[] = { &renderTest1, &renderTest2, &renderTest3, &renderTest4, &renderTest5, &renderTest6, &renderTest7, &renderTest8, - &renderTest9, NULL + &renderTest9, &renderTestUVWrapping, NULL }; /* Render test suite (global) */ From 71d2662a39fd3ad7a729616e26c5a81e4f4968df Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 20 Jul 2024 11:16:53 -0700 Subject: [PATCH 431/431] Fixed warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data --- src/SDL_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SDL_utils.c b/src/SDL_utils.c index 26b838258d10f..26a25bec4cdf7 100644 --- a/src/SDL_utils.c +++ b/src/SDL_utils.c @@ -219,7 +219,7 @@ static int SDL_URIDecode(const char *src, char *dst, int len) return -1; } if (len == 0) { - len = SDL_strlen(src); + len = (int)SDL_strlen(src); } for (ri = 0, wi = 0, di = 0; ri < len && wi < len; ri += 1) { if (di == 0) {