Fix Indentation

This commit is contained in:
Jaylon Gowie 2021-09-10 21:02:22 -05:00 committed by Sam Lantinga
parent 5fa8a042ac
commit f162d9ee23

View file

@ -267,7 +267,7 @@ VITA_CreateWindow(_THIS, SDL_Window * window)
#if defined(SDL_VIDEO_VITA_PVR) #if defined(SDL_VIDEO_VITA_PVR)
win.type = PSP2_DRAWABLE_TYPE_WINDOW; win.type = PSP2_DRAWABLE_TYPE_WINDOW;
win.numFlipBuffers = 2; win.numFlipBuffers = 2;
win.flipChainThrdAffinity = 0x20000; win.flipChainThrdAffinity = 0x20000;
/* 1088i for PSTV (Or Sharpscale) */ /* 1088i for PSTV (Or Sharpscale) */
if (window->w == 1920) { if (window->w == 1920) {
@ -279,7 +279,7 @@ VITA_CreateWindow(_THIS, SDL_Window * window)
} }
/* 544p */ /* 544p */
else { else {
win.windowSize = PSP2_WINDOW_960X544; win.windowSize = PSP2_WINDOW_960X544;
} }
if ((window->flags & SDL_WINDOW_OPENGL) != 0) { if ((window->flags & SDL_WINDOW_OPENGL) != 0) {
wdata->egl_surface = SDL_EGL_CreateSurface(_this, &win); wdata->egl_surface = SDL_EGL_CreateSurface(_this, &win);
@ -425,37 +425,37 @@ void VITA_ImeEventHandler(void *arg, const SceImeEventData *e)
SDL_VideoData *videodata = (SDL_VideoData *)arg; SDL_VideoData *videodata = (SDL_VideoData *)arg;
SDL_Scancode scancode; SDL_Scancode scancode;
uint8_t utf8_buffer[SCE_IME_MAX_TEXT_LENGTH]; uint8_t utf8_buffer[SCE_IME_MAX_TEXT_LENGTH];
switch (e->id) { switch (e->id) {
case SCE_IME_EVENT_UPDATE_TEXT: case SCE_IME_EVENT_UPDATE_TEXT:
if (e->param.text.caretIndex == 0) { if (e->param.text.caretIndex == 0) {
scancode = SDL_GetScancodeFromKey(0x08); scancode = SDL_GetScancodeFromKey(0x08);
SDL_SendKeyboardKeyAutoRelease(scancode); SDL_SendKeyboardKeyAutoRelease(scancode);
sceImeSetText((SceWChar16 *)libime_initval, 4); sceImeSetText((SceWChar16 *)libime_initval, 4);
} }
else { else {
scancode = SDL_GetScancodeFromKey(*(SceWChar16 *)&libime_out[1]); scancode = SDL_GetScancodeFromKey(*(SceWChar16 *)&libime_out[1]);
if (scancode == SDL_SCANCODE_SPACE) { if (scancode == SDL_SCANCODE_SPACE) {
SDL_SendKeyboardKeyAutoRelease(SDL_SCANCODE_SPACE); SDL_SendKeyboardKeyAutoRelease(SDL_SCANCODE_SPACE);
} }
else { else {
utf16_to_utf8((SceWChar16 *)&libime_out[1], utf8_buffer); utf16_to_utf8((SceWChar16 *)&libime_out[1], utf8_buffer);
SDL_SendKeyboardText((const char*)utf8_buffer); SDL_SendKeyboardText((const char*)utf8_buffer);
} }
SDL_memset(&caret_rev, 0, sizeof(SceImeCaret)); SDL_memset(&caret_rev, 0, sizeof(SceImeCaret));
SDL_memset(libime_out, 0, ((SCE_IME_MAX_PREEDIT_LENGTH + SCE_IME_MAX_TEXT_LENGTH + 1) * sizeof(SceWChar16))); SDL_memset(libime_out, 0, ((SCE_IME_MAX_PREEDIT_LENGTH + SCE_IME_MAX_TEXT_LENGTH + 1) * sizeof(SceWChar16)));
caret_rev.index = 1; caret_rev.index = 1;
sceImeSetCaret(&caret_rev); sceImeSetCaret(&caret_rev);
sceImeSetText((SceWChar16 *)libime_initval, 4); sceImeSetText((SceWChar16 *)libime_initval, 4);
} }
break; break;
case SCE_IME_EVENT_PRESS_ENTER: case SCE_IME_EVENT_PRESS_ENTER:
scancode = SDL_GetScancodeFromKey(0x0D); scancode = SDL_GetScancodeFromKey(0x0D);
SDL_SendKeyboardKeyAutoRelease(scancode); SDL_SendKeyboardKeyAutoRelease(scancode);
case SCE_IME_EVENT_PRESS_CLOSE: case SCE_IME_EVENT_PRESS_CLOSE:
sceImeClose(); sceImeClose();
videodata->ime_active = SDL_FALSE; videodata->ime_active = SDL_FALSE;
break; break;
} }
} }
#endif #endif
@ -474,22 +474,22 @@ void VITA_ShowScreenKeyboard(_THIS, SDL_Window *window)
SDL_memset(libime_out, 0, ((SCE_IME_MAX_PREEDIT_LENGTH + SCE_IME_MAX_TEXT_LENGTH + 1) * sizeof(SceWChar16))); SDL_memset(libime_out, 0, ((SCE_IME_MAX_PREEDIT_LENGTH + SCE_IME_MAX_TEXT_LENGTH + 1) * sizeof(SceWChar16)));
param.supportedLanguages = SCE_IME_LANGUAGE_ENGLISH_US; param.supportedLanguages = SCE_IME_LANGUAGE_ENGLISH_US;
param.languagesForced = SCE_FALSE; param.languagesForced = SCE_FALSE;
param.type = SCE_IME_TYPE_DEFAULT; param.type = SCE_IME_TYPE_DEFAULT;
param.option = SCE_IME_OPTION_NO_ASSISTANCE; param.option = SCE_IME_OPTION_NO_ASSISTANCE;
param.inputTextBuffer = libime_out; param.inputTextBuffer = libime_out;
param.maxTextLength = SCE_IME_MAX_TEXT_LENGTH; param.maxTextLength = SCE_IME_MAX_TEXT_LENGTH;
param.handler = VITA_ImeEventHandler; param.handler = VITA_ImeEventHandler;
param.filter = NULL; param.filter = NULL;
param.initialText = (SceWChar16 *)libime_initval; param.initialText = (SceWChar16 *)libime_initval;
param.arg = videodata; param.arg = videodata;
param.work = libime_work; param.work = libime_work;
res = sceImeOpen(&param); res = sceImeOpen(&param);
if (res < 0) { if (res < 0) {
SDL_SetError("Failed to init IME"); SDL_SetError("Failed to init IME");
return; return;
} }
#elif #elif
SceWChar16 *title = u""; SceWChar16 *title = u"";