Updated structure and field names for consistency
Type names are camel case and field names are snake case except for fields ending in id, which are capitalized. Fixes https://github.com/libsdl-org/SDL/issues/6955
This commit is contained in:
@@ -1168,7 +1168,7 @@ int SDL_AppEvent(const SDL_Event *event)
|
||||
break;
|
||||
|
||||
case SDL_EVENT_MOUSE_WHEEL:
|
||||
UpdateMouseOver(event->wheel.mouseX, event->wheel.mouseY);
|
||||
UpdateMouseOver(event->wheel.mouse_x, event->wheel.mouse_y);
|
||||
break;
|
||||
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
|
||||
@@ -140,8 +140,12 @@ static int pixels_allocFreeFormat(void *arg)
|
||||
SDLTest_AssertCheck(result != NULL, "Verify result is not NULL");
|
||||
if (result != NULL) {
|
||||
SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
|
||||
SDLTest_AssertCheck(result->BitsPerPixel == 0, "Verify value of result.BitsPerPixel; expected: 0, got %u", result->BitsPerPixel);
|
||||
SDLTest_AssertCheck(result->BytesPerPixel == 0, "Verify value of result.BytesPerPixel; expected: 0, got %u", result->BytesPerPixel);
|
||||
SDLTest_AssertCheck(result->bits_per_pixel == 0,
|
||||
"Verify value of result.bits_per_pixel; expected: 0, got %u",
|
||||
result->bits_per_pixel);
|
||||
SDLTest_AssertCheck(result->bytes_per_pixel == 0,
|
||||
"Verify value of result.bytes_per_pixel; expected: 0, got %u",
|
||||
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);
|
||||
|
||||
@@ -162,8 +166,12 @@ static int pixels_allocFreeFormat(void *arg)
|
||||
if (result != NULL) {
|
||||
SDLTest_AssertCheck(result->format == format, "Verify value of result.format; expected: %" SDL_PRIu32 ", got %" SDL_PRIu32, format, result->format);
|
||||
if (!SDL_ISPIXELFORMAT_FOURCC(format)) {
|
||||
SDLTest_AssertCheck(result->BitsPerPixel > 0, "Verify value of result.BitsPerPixel; expected: >0, got %u", result->BitsPerPixel);
|
||||
SDLTest_AssertCheck(result->BytesPerPixel > 0, "Verify value of result.BytesPerPixel; expected: >0, got %u", result->BytesPerPixel);
|
||||
SDLTest_AssertCheck(result->bits_per_pixel > 0,
|
||||
"Verify value of result.bits_per_pixel; expected: >0, got %u",
|
||||
result->bits_per_pixel);
|
||||
SDLTest_AssertCheck(result->bytes_per_pixel > 0,
|
||||
"Verify value of result.bytes_per_pixel; expected: >0, got %u",
|
||||
result->bytes_per_pixel);
|
||||
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);
|
||||
|
||||
@@ -209,7 +209,7 @@ static int platform_testHasFunctions(void *arg)
|
||||
*/
|
||||
static int platform_testGetVersion(void *arg)
|
||||
{
|
||||
SDL_version linked;
|
||||
SDL_Version linked;
|
||||
int major = SDL_MAJOR_VERSION;
|
||||
int minor = SDL_MINOR_VERSION;
|
||||
|
||||
@@ -231,7 +231,7 @@ static int platform_testGetVersion(void *arg)
|
||||
*/
|
||||
static int platform_testSDLVersion(void *arg)
|
||||
{
|
||||
SDL_version compiled;
|
||||
SDL_Version compiled;
|
||||
int major = SDL_MAJOR_VERSION;
|
||||
int minor = SDL_MINOR_VERSION;
|
||||
|
||||
|
||||
@@ -373,8 +373,8 @@ static int surface_testCompleteSurfaceConversion(void *arg)
|
||||
cvt2 = SDL_ConvertSurface(cvt1, fmt2);
|
||||
SDL_assert(cvt2 != NULL);
|
||||
|
||||
if (fmt1->BytesPerPixel == face->format->BytesPerPixel &&
|
||||
fmt2->BytesPerPixel == face->format->BytesPerPixel &&
|
||||
if (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)) {
|
||||
final = SDL_ConvertSurface(cvt2, face->format);
|
||||
@@ -840,7 +840,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->BytesPerPixel;
|
||||
offset += (surface->w - 1) * surface->format->bytes_per_pixel;
|
||||
SDLTest_AssertCheck(pixels[offset] == 0xFF,
|
||||
"Expected pixels[%d] == 0xFF got 0x%.2X", offset, pixels[offset]);
|
||||
|
||||
|
||||
@@ -117,14 +117,14 @@ init_color_cursor(const char *file)
|
||||
SDL_Surface *surface = SDL_LoadBMP(file);
|
||||
if (surface) {
|
||||
if (surface->format->palette) {
|
||||
const Uint8 bpp = surface->format->BitsPerPixel;
|
||||
const Uint8 bpp = surface->format->bits_per_pixel;
|
||||
const Uint8 mask = (1 << bpp) - 1;
|
||||
if (SDL_PIXELORDER(surface->format->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->BitsPerPixel) {
|
||||
switch (surface->format->bits_per_pixel) {
|
||||
case 15:
|
||||
SDL_SetSurfaceColorKey(surface, 1, (*(Uint16 *)surface->pixels) & 0x00007FFF);
|
||||
break;
|
||||
|
||||
@@ -104,14 +104,14 @@ LoadTexture(SDL_Renderer *renderer, const char *file, SDL_bool transparent,
|
||||
/* Set transparent pixel as the pixel at (0,0) */
|
||||
if (transparent) {
|
||||
if (temp->format->palette) {
|
||||
const Uint8 bpp = temp->format->BitsPerPixel;
|
||||
const Uint8 bpp = temp->format->bits_per_pixel;
|
||||
const Uint8 mask = (1 << bpp) - 1;
|
||||
if (SDL_PIXELORDER(temp->format->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->BitsPerPixel) {
|
||||
switch (temp->format->bits_per_pixel) {
|
||||
case 15:
|
||||
SDL_SetSurfaceColorKey(temp, SDL_TRUE,
|
||||
(*(Uint16 *)temp->pixels) & 0x00007FFF);
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
SDL_version compiled;
|
||||
SDL_version linked;
|
||||
SDL_Version compiled;
|
||||
SDL_Version linked;
|
||||
|
||||
/* Enable standard application logging */
|
||||
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||
|
||||
Reference in New Issue
Block a user