mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
Updated SDL, Bullet and OpenAL soft libs
Fixed case sensitivity problem Fixed clang compiler problem with having the class namespace used in an inline for the == operator Tweaked some theme stuff to be more consistent. Added initial test of no-pie for linux test sidestep of getTexCoord in shadergen hlsl feature so we don't assert when getting the terrain's shaderstuffs(which uses float3 instead of normal float2)
This commit is contained in:
parent
a1ecc98c87
commit
370161cfb1
1102 changed files with 205083 additions and 62836 deletions
|
|
@ -73,6 +73,24 @@ init_color_cursor(const char *file)
|
|||
SDL_Cursor *cursor = NULL;
|
||||
SDL_Surface *surface = SDL_LoadBMP(file);
|
||||
if (surface) {
|
||||
if (surface->format->palette) {
|
||||
SDL_SetColorKey(surface, 1, *(Uint8 *) surface->pixels);
|
||||
} else {
|
||||
switch (surface->format->BitsPerPixel) {
|
||||
case 15:
|
||||
SDL_SetColorKey(surface, 1, (*(Uint16 *)surface->pixels) & 0x00007FFF);
|
||||
break;
|
||||
case 16:
|
||||
SDL_SetColorKey(surface, 1, *(Uint16 *)surface->pixels);
|
||||
break;
|
||||
case 24:
|
||||
SDL_SetColorKey(surface, 1, (*(Uint32 *)surface->pixels) & 0x00FFFFFF);
|
||||
break;
|
||||
case 32:
|
||||
SDL_SetColorKey(surface, 1, *(Uint32 *)surface->pixels);
|
||||
break;
|
||||
}
|
||||
}
|
||||
cursor = SDL_CreateColorCursor(surface, 0, 0);
|
||||
SDL_FreeSurface(surface);
|
||||
}
|
||||
|
|
@ -116,7 +134,9 @@ init_system_cursor(const char *image[])
|
|||
|
||||
static SDLTest_CommonState *state;
|
||||
int done;
|
||||
SDL_Cursor *cursor = NULL;
|
||||
static SDL_Cursor *cursors[1+SDL_NUM_SYSTEM_CURSORS];
|
||||
static int current_cursor;
|
||||
static int show_cursor;
|
||||
|
||||
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||
static void
|
||||
|
|
@ -134,6 +154,18 @@ loop()
|
|||
/* Check for events */
|
||||
while (SDL_PollEvent(&event)) {
|
||||
SDLTest_CommonEvent(state, &event, &done);
|
||||
if (event.type == SDL_MOUSEBUTTONDOWN) {
|
||||
if (event.button.button == SDL_BUTTON_LEFT) {
|
||||
++current_cursor;
|
||||
if (current_cursor == SDL_arraysize(cursors)) {
|
||||
current_cursor = 0;
|
||||
}
|
||||
SDL_SetCursor(cursors[current_cursor]);
|
||||
} else {
|
||||
show_cursor = !show_cursor;
|
||||
SDL_ShowCursor(show_cursor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
|
|
@ -188,15 +220,22 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (color_cursor) {
|
||||
cursor = init_color_cursor(color_cursor);
|
||||
cursors[0] = init_color_cursor(color_cursor);
|
||||
} else {
|
||||
cursor = init_system_cursor(arrow);
|
||||
cursors[0] = init_system_cursor(arrow);
|
||||
}
|
||||
if (!cursor) {
|
||||
if (!cursors[0]) {
|
||||
SDL_Log("Error, couldn't create cursor\n");
|
||||
quit(2);
|
||||
}
|
||||
SDL_SetCursor(cursor);
|
||||
for (i = 0; i < SDL_NUM_SYSTEM_CURSORS; ++i) {
|
||||
cursors[1+i] = SDL_CreateSystemCursor((SDL_SystemCursor)i);
|
||||
if (!cursors[1+i]) {
|
||||
SDL_Log("Error, couldn't create system cursor %d\n", i);
|
||||
quit(2);
|
||||
}
|
||||
}
|
||||
SDL_SetCursor(cursors[0]);
|
||||
|
||||
/* Main render loop */
|
||||
done = 0;
|
||||
|
|
@ -208,9 +247,13 @@ main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
SDL_FreeCursor(cursor);
|
||||
for (i = 0; i < SDL_arraysize(cursors); ++i) {
|
||||
SDL_FreeCursor(cursors[i]);
|
||||
}
|
||||
quit(0);
|
||||
|
||||
/* keep the compiler happy ... */
|
||||
return(0);
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue