Merge branch 'next' into fix-1248

This commit is contained in:
Lactozilla 2024-05-22 23:16:49 -03:00
commit 6e4eb6292f
11 changed files with 209 additions and 30 deletions

View file

@ -922,8 +922,6 @@ static void CON_InputDelChar(void)
// //
boolean CON_Responder(event_t *ev) boolean CON_Responder(event_t *ev)
{ {
static UINT8 consdown = false; // console is treated differently due to rare usage
// sequential completions a la 4dos // sequential completions a la 4dos
static char completioncmd[80 + sizeof("find ")] = "find "; static char completioncmd[80 + sizeof("find ")] = "find ";
static char *completion = &completioncmd[sizeof("find ")-1]; static char *completion = &completioncmd[sizeof("find ")-1];
@ -943,32 +941,28 @@ boolean CON_Responder(event_t *ev)
// let go keyup events, don't eat them // let go keyup events, don't eat them
if (ev->type != ev_keydown && ev->type != ev_text && ev->type != ev_console) if (ev->type != ev_keydown && ev->type != ev_text && ev->type != ev_console)
{ {
if (ev->key == gamecontrol[GC_CONSOLE][0] || ev->key == gamecontrol[GC_CONSOLE][1])
consdown = false;
return false; return false;
} }
key = ev->key; key = ev->key;
// check for console toggle key // check for console toggle key
if (ev->type != ev_console) if (ev->type == ev_keydown)
{ {
if (modeattacking || metalrecording || marathonmode) if (modeattacking || metalrecording || marathonmode)
return false; return false;
if (ev->type == ev_keydown && ((key == gamecontrol[GC_CONSOLE][0] || key == gamecontrol[GC_CONSOLE][1]) && !shiftdown)) if ((key == gamecontrol[GC_CONSOLE][0] || key == gamecontrol[GC_CONSOLE][1]) && !shiftdown)
{ {
if (consdown) // ignore repeat I_SetTextInputMode(con_destlines == 0); // inverse, since this is changed next tic.
return true;
consoletoggle = true; consoletoggle = true;
consdown = true;
return true; return true;
} }
// check other keys only if console prompt is active // check other keys only if console prompt is active
if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!! if (!consoleready && key < NUMINPUTS) // metzgermeister: boundary check!!
{ {
if (ev->type == ev_keydown && !menuactive && bindtable[key]) if (!menuactive && bindtable[key])
{ {
COM_BufAddText(bindtable[key]); COM_BufAddText(bindtable[key]);
COM_BufAddText("\n"); COM_BufAddText("\n");
@ -980,14 +974,14 @@ boolean CON_Responder(event_t *ev)
// escape key toggle off console // escape key toggle off console
if (key == KEY_ESCAPE) if (key == KEY_ESCAPE)
{ {
I_SetTextInputMode(false);
consoletoggle = true; consoletoggle = true;
return true; return true;
} }
} }
else if (ev->type == ev_text)
if (ev->type == ev_text)
{ {
if (!consoletoggle) if (!consoletoggle && consoleready)
CON_InputAddChar(key); CON_InputAddChar(key);
return true; return true;
} }
@ -1036,7 +1030,7 @@ boolean CON_Responder(event_t *ev)
} }
else if (key == KEY_BACKSPACE) else if (key == KEY_BACKSPACE)
{ {
if (ctrldown) if (ctrldown && input_cur != 0)
{ {
input_sel = M_JumpWordReverse(inputlines[inputline], input_cur); input_sel = M_JumpWordReverse(inputlines[inputline], input_cur);
CON_InputDelSelection(); CON_InputDelSelection();
@ -1094,7 +1088,9 @@ boolean CON_Responder(event_t *ev)
if (key == 'x' || key == 'X') if (key == 'x' || key == 'X')
{ {
if (input_sel > input_cur) if (input_sel == input_cur) // Don't replace the clipboard without a text selection
return true;
else if (input_sel > input_cur)
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur); I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
else else
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel); I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);
@ -1104,7 +1100,9 @@ boolean CON_Responder(event_t *ev)
} }
else if (key == 'c' || key == 'C') else if (key == 'c' || key == 'C')
{ {
if (input_sel > input_cur) if (input_sel == input_cur) // Don't replace the clipboard without a text selection
return true;
else if (input_sel > input_cur)
I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur); I_ClipboardCopy(&inputlines[inputline][input_cur], input_sel-input_cur);
else else
I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel); I_ClipboardCopy(&inputlines[inputline][input_sel], input_cur-input_sel);

View file

@ -1585,5 +1585,15 @@ void I_GetCursorPosition(INT32 *x, INT32 *y)
(void)y; (void)y;
} }
void I_SetTextInputMode(boolean active)
{
(void)active;
}
boolean I_GetTextInputMode(void)
{
return false;
}
#include "../sdl/dosstr.c" #include "../sdl/dosstr.c"

View file

@ -211,5 +211,15 @@ const char *I_GetSysName(void)
return NULL; return NULL;
} }
void I_SetTextInputMode(boolean active)
{
(void)active;
}
boolean I_GetTextInputMode(void)
{
return false;
}
#include "../sdl/dosstr.c" #include "../sdl/dosstr.c"

View file

@ -999,6 +999,7 @@ static void HU_sendChatMessage(void)
void HU_clearChatChars(void) void HU_clearChatChars(void)
{ {
memset(w_chat, '\0', sizeof(w_chat)); memset(w_chat, '\0', sizeof(w_chat));
I_SetTextInputMode(false);
chat_on = false; chat_on = false;
c_input = 0; c_input = 0;
@ -1048,6 +1049,7 @@ boolean HU_Responder(event_t *ev)
if ((ev->key == gamecontrol[GC_TALKKEY][0] || ev->key == gamecontrol[GC_TALKKEY][1]) if ((ev->key == gamecontrol[GC_TALKKEY][0] || ev->key == gamecontrol[GC_TALKKEY][1])
&& netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise. && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise.
{ {
I_SetTextInputMode(true);
chat_on = true; chat_on = true;
chat_on_first_event = false; chat_on_first_event = false;
w_chat[0] = 0; w_chat[0] = 0;
@ -1059,6 +1061,7 @@ boolean HU_Responder(event_t *ev)
if ((ev->key == gamecontrol[GC_TEAMKEY][0] || ev->key == gamecontrol[GC_TEAMKEY][1]) if ((ev->key == gamecontrol[GC_TEAMKEY][0] || ev->key == gamecontrol[GC_TEAMKEY][1])
&& netgame && !OLD_MUTE) && netgame && !OLD_MUTE)
{ {
I_SetTextInputMode(true);
chat_on = true; chat_on = true;
chat_on_first_event = false; chat_on_first_event = false;
w_chat[0] = 0; w_chat[0] = 0;
@ -1133,6 +1136,7 @@ boolean HU_Responder(event_t *ev)
if (!CHAT_MUTE) if (!CHAT_MUTE)
HU_sendChatMessage(); HU_sendChatMessage();
I_SetTextInputMode(false);
chat_on = false; chat_on = false;
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :) chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :)
@ -1143,6 +1147,7 @@ boolean HU_Responder(event_t *ev)
|| c == gamecontrol[GC_TEAMKEY][0] || c == gamecontrol[GC_TEAMKEY][1]) || c == gamecontrol[GC_TEAMKEY][0] || c == gamecontrol[GC_TEAMKEY][1])
&& c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle. && c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle.
{ {
I_SetTextInputMode(false);
chat_on = false; chat_on = false;
c_input = 0; // reset input cursor c_input = 0; // reset input cursor
I_UpdateMouseGrab(); I_UpdateMouseGrab();

View file

@ -339,4 +339,12 @@ void I_SetMouseGrab(boolean grab);
*/ */
const char *I_GetSysName(void); const char *I_GetSysName(void);
/** \brief Sets text input mode. When enabled, keyboard inputs will respect dead keys.
*/
void I_SetTextInputMode(boolean active);
/** \brief Retrieves current text input mode.
*/
boolean I_GetTextInputMode(void);
#endif #endif

View file

@ -2102,6 +2102,12 @@ menu_t OP_PlaystyleDef = {
0, 0, 0, NULL 0, 0, 0, NULL
}; };
static void M_UpdateItemOn(void)
{
I_SetTextInputMode((currentMenu->menuitems[itemOn].status & IT_CVARTYPE) == IT_CV_STRING ||
(currentMenu->menuitems[itemOn].status & IT_TYPE) == IT_KEYHANDLER);
}
static void M_VideoOptions(INT32 choice) static void M_VideoOptions(INT32 choice)
{ {
(void)choice; (void)choice;
@ -2329,6 +2335,7 @@ void Nextmap_OnChange(void)
{ {
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
itemOn = nastart; itemOn = nastart;
M_UpdateItemOn();
} }
} }
else if (currentMenu == &SP_TimeAttackDef) else if (currentMenu == &SP_TimeAttackDef)
@ -2378,6 +2385,7 @@ void Nextmap_OnChange(void)
{ {
currentMenu->lastOn = itemOn; currentMenu->lastOn = itemOn;
itemOn = tastart; itemOn = tastart;
M_UpdateItemOn();
} }
if (mapheaderinfo[cv_nextmap.value-1] && mapheaderinfo[cv_nextmap.value-1]->forcecharacter[0] != '\0') if (mapheaderinfo[cv_nextmap.value-1] && mapheaderinfo[cv_nextmap.value-1]->forcecharacter[0] != '\0')
@ -3128,6 +3136,7 @@ static void M_NextOpt(void)
else else
itemOn++; itemOn++;
} while (oldItemOn != itemOn && ( (currentMenu->menuitems[itemOn].status & IT_TYPE) & IT_SPACE )); } while (oldItemOn != itemOn && ( (currentMenu->menuitems[itemOn].status & IT_TYPE) & IT_SPACE ));
M_UpdateItemOn();
} }
static void M_PrevOpt(void) static void M_PrevOpt(void)
@ -3140,6 +3149,7 @@ static void M_PrevOpt(void)
else else
itemOn--; itemOn--;
} while (oldItemOn != itemOn && ( (currentMenu->menuitems[itemOn].status & IT_TYPE) & IT_SPACE )); } while (oldItemOn != itemOn && ( (currentMenu->menuitems[itemOn].status & IT_TYPE) & IT_SPACE ));
M_UpdateItemOn();
} }
// lock out further input in a tic when important buttons are pressed // lock out further input in a tic when important buttons are pressed
@ -3651,12 +3661,14 @@ void M_StartControlPanel(void)
currentMenu = &MainDef; currentMenu = &MainDef;
itemOn = singleplr; itemOn = singleplr;
M_UpdateItemOn();
} }
else if (modeattacking) else if (modeattacking)
{ {
currentMenu = &MAPauseDef; currentMenu = &MAPauseDef;
MAPauseMenu[mapause_hints].status = (M_SecretUnlocked(SECRET_EMBLEMHINTS, clientGamedata)) ? (IT_STRING | IT_CALL) : (IT_DISABLED); MAPauseMenu[mapause_hints].status = (M_SecretUnlocked(SECRET_EMBLEMHINTS, clientGamedata)) ? (IT_STRING | IT_CALL) : (IT_DISABLED);
itemOn = mapause_continue; itemOn = mapause_continue;
M_UpdateItemOn();
} }
else if (!(netgame || multiplayer)) // Single Player else if (!(netgame || multiplayer)) // Single Player
{ {
@ -3703,6 +3715,7 @@ void M_StartControlPanel(void)
currentMenu = &SPauseDef; currentMenu = &SPauseDef;
itemOn = spause_continue; itemOn = spause_continue;
M_UpdateItemOn();
} }
else // multiplayer else // multiplayer
{ {
@ -3744,6 +3757,7 @@ void M_StartControlPanel(void)
currentMenu = &MPauseDef; currentMenu = &MPauseDef;
itemOn = mpause_continue; itemOn = mpause_continue;
M_UpdateItemOn();
} }
CON_ToggleOff(); // move away console CON_ToggleOff(); // move away console
@ -3837,6 +3851,7 @@ void M_SetupNextMenu(menu_t *menudef)
} }
} }
} }
M_UpdateItemOn();
hidetitlemap = false; hidetitlemap = false;
} }
@ -6109,6 +6124,7 @@ void M_StartMessage(const char *string, void *routine, menumessagetype_t itemtyp
currentMenu = &MessageDef; currentMenu = &MessageDef;
itemOn = 0; itemOn = 0;
M_UpdateItemOn();
} }
static void M_DrawMessageMenu(void) static void M_DrawMessageMenu(void)
@ -6183,6 +6199,7 @@ static void M_HandleImageDef(INT32 choice)
if (itemOn >= (INT16)(currentMenu->numitems-1)) if (itemOn >= (INT16)(currentMenu->numitems-1))
itemOn = 0; itemOn = 0;
else itemOn++; else itemOn++;
M_UpdateItemOn();
break; break;
case KEY_LEFTARROW: case KEY_LEFTARROW:
@ -6193,6 +6210,7 @@ static void M_HandleImageDef(INT32 choice)
if (!itemOn) if (!itemOn)
itemOn = currentMenu->numitems - 1; itemOn = currentMenu->numitems - 1;
else itemOn--; else itemOn--;
M_UpdateItemOn();
break; break;
case KEY_ESCAPE: case KEY_ESCAPE:
@ -7389,6 +7407,7 @@ static void M_EmblemHints(INT32 choice)
SR_EmblemHintDef.prevMenu = currentMenu; SR_EmblemHintDef.prevMenu = currentMenu;
M_SetupNextMenu(&SR_EmblemHintDef); M_SetupNextMenu(&SR_EmblemHintDef);
itemOn = 2; // always start on back. itemOn = 2; // always start on back.
M_UpdateItemOn();
} }
static void M_DrawEmblemHints(void) static void M_DrawEmblemHints(void)
@ -10050,6 +10069,7 @@ static void M_TimeAttack(INT32 choice)
Nextmap_OnChange(); Nextmap_OnChange();
itemOn = tastart; // "Start" is selected. itemOn = tastart; // "Start" is selected.
M_UpdateItemOn();
} }
// Drawing function for Nights Attack // Drawing function for Nights Attack
@ -10288,6 +10308,7 @@ static void M_NightsAttack(INT32 choice)
Nextmap_OnChange(); Nextmap_OnChange();
itemOn = nastart; // "Start" is selected. itemOn = nastart; // "Start" is selected.
M_UpdateItemOn();
} }
// Player has selected the "START" from the nights attack screen // Player has selected the "START" from the nights attack screen
@ -10607,6 +10628,7 @@ static void M_ModeAttackEndGame(INT32 choice)
break; break;
} }
itemOn = currentMenu->lastOn; itemOn = currentMenu->lastOn;
M_UpdateItemOn();
G_SetGamestate(GS_TIMEATTACK); G_SetGamestate(GS_TIMEATTACK);
modeattacking = ATTACKING_NONE; modeattacking = ATTACKING_NONE;
M_ChangeMenuMusic("_title", true); M_ChangeMenuMusic("_title", true);
@ -10688,6 +10710,7 @@ static void M_Marathon(INT32 choice)
titlemapinaction = TITLEMAP_OFF; // Nope don't give us HOMs please titlemapinaction = TITLEMAP_OFF; // Nope don't give us HOMs please
M_SetupNextMenu(&SP_MarathonDef); M_SetupNextMenu(&SP_MarathonDef);
itemOn = marathonstart; // "Start" is selected. itemOn = marathonstart; // "Start" is selected.
M_UpdateItemOn();
recatkdrawtimer = (50-8) * FRACUNIT; recatkdrawtimer = (50-8) * FRACUNIT;
char_scroll = 0; char_scroll = 0;
} }
@ -11401,6 +11424,7 @@ static void M_ConnectMenu(INT32 choice)
else else
M_SetupNextMenu(&MP_ConnectDef); M_SetupNextMenu(&MP_ConnectDef);
itemOn = 0; itemOn = 0;
M_UpdateItemOn();
M_Refresh(0); M_Refresh(0);
} }
@ -11660,6 +11684,7 @@ static void M_StartServerMenu(INT32 choice)
Newgametype_OnChange(); Newgametype_OnChange();
M_SetupNextMenu(&MP_ServerDef); M_SetupNextMenu(&MP_ServerDef);
itemOn = 1; itemOn = 1;
M_UpdateItemOn();
} }
// ============== // ==============
@ -11842,15 +11867,21 @@ static void M_HandleConnectIP(INT32 choice)
case KEY_INS: case KEY_INS:
case 'c': case 'c':
case 'C': // ctrl+c, ctrl+insert, copying case 'C': // ctrl+c, ctrl+insert, copying
I_ClipboardCopy(setupm_ip, l); if (l != 0) // Don't replace the clipboard without any text
S_StartSound(NULL,sfx_menu1); // Tails {
I_ClipboardCopy(setupm_ip, l);
S_StartSound(NULL,sfx_menu1); // Tails
}
break; break;
case 'x': case 'x':
case 'X': // ctrl+x, cutting case 'X': // ctrl+x, cutting
I_ClipboardCopy(setupm_ip, l); if (l != 0) // Don't replace the clipboard without any text
S_StartSound(NULL,sfx_menu1); // Tails {
setupm_ip[0] = 0; I_ClipboardCopy(setupm_ip, l);
S_StartSound(NULL,sfx_menu1); // Tails
setupm_ip[0] = 0;
}
break; break;
default: // otherwise do nothing default: // otherwise do nothing
@ -11874,9 +11905,12 @@ static void M_HandleConnectIP(INT32 choice)
break; break;
} }
case KEY_DEL: // shift+delete, cutting case KEY_DEL: // shift+delete, cutting
I_ClipboardCopy(setupm_ip, l); if (l != 0) // Don't replace the clipboard without any text
S_StartSound(NULL,sfx_menu1); // Tails {
setupm_ip[0] = 0; I_ClipboardCopy(setupm_ip, l);
S_StartSound(NULL,sfx_menu1); // Tails
setupm_ip[0] = 0;
}
break; break;
default: // otherwise do nothing. default: // otherwise do nothing.
break; break;
@ -13071,7 +13105,10 @@ static void M_SetupScreenshotMenu(void)
{ {
item->status = IT_GRAYEDOUT; item->status = IT_GRAYEDOUT;
if ((currentMenu == &OP_ScreenshotOptionsDef) && (itemOn == op_screenshot_colorprofile)) // Can't select that if ((currentMenu == &OP_ScreenshotOptionsDef) && (itemOn == op_screenshot_colorprofile)) // Can't select that
{
itemOn = op_screenshot_storagelocation; itemOn = op_screenshot_storagelocation;
M_UpdateItemOn();
}
} }
else else
#endif #endif

View file

@ -2208,6 +2208,8 @@ int M_JumpWordReverse(const char *line, int offset)
{ {
int (*is)(int); int (*is)(int);
int c; int c;
if (offset == 0) // Don't let "--offset" later result in a negative value
return 0;
c = line[--offset]; c = line[--offset];
if (isspace(c)) if (isspace(c))
is = isspace; is = isspace;

View file

@ -3684,7 +3684,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec)
case 466: // Set level failure state case 466: // Set level failure state
{ {
if (line->args[1]) if (line->args[0])
{ {
stagefailed = false; stagefailed = false;
CONS_Debug(DBG_GAMELOGIC, "Stage can be completed successfully!\n"); CONS_Debug(DBG_GAMELOGIC, "Stage can be completed successfully!\n");

View file

@ -821,8 +821,8 @@ Rloadflats (INT32 i, INT32 w)
UINT8 *flatlump = W_CacheLumpNumPwad(wadnum, lumpnum, PU_CACHE); UINT8 *flatlump = W_CacheLumpNumPwad(wadnum, lumpnum, PU_CACHE);
if (Picture_PNGDimensions((UINT8 *)flatlump, &texw, &texh, NULL, NULL, lumplength)) if (Picture_PNGDimensions((UINT8 *)flatlump, &texw, &texh, NULL, NULL, lumplength))
{ {
width = (INT16)width; width = (INT16)texw;
height = (INT16)height; height = (INT16)texh;
} }
else else
{ {
@ -1068,6 +1068,98 @@ void R_LoadTexturesPwad(UINT16 wadnum)
R_FinishLoadingTextures(newtextures); R_FinishLoadingTextures(newtextures);
} }
static lumpnum_t W_GetTexPatchLumpNum(const char *name)
{
// Flats as a texture patch crashes horribly, and flats
// can share the same name as textures.
// But even if they worked, we want to prioritize:
// Patches -> Textures -> anything else
enum
{
USE_PATCHES,
USE_TEXTURES,
USE__MAX,
};
lumpnum_t lump = LUMPERROR;
INT32 lump_type_it;
for (lump_type_it = 0; lump_type_it < USE__MAX; lump_type_it++)
{
INT32 i;
for (i = numwadfiles - 1; i >= 0; i--) // Scan wad files backwards so patched lumps take precedent
{
lumpnum_t start = LUMPERROR;
lumpnum_t end = LUMPERROR;
switch (wadfiles[i]->type)
{
case RET_WAD:
if (lump_type_it == USE_PATCHES)
{
if ((start = W_CheckNumForMarkerStartPwad("P_START", (UINT16)i, 0)) == INT16_MAX)
continue;
else if ((end = W_CheckNumForNamePwad("P_END", (UINT16)i, start)) == INT16_MAX)
continue;
}
else if (lump_type_it == USE_TEXTURES)
{
if ((start = W_CheckNumForMarkerStartPwad("TX_START", (UINT16)i, 0)) == INT16_MAX)
continue;
else if ((end = W_CheckNumForNamePwad("TX_END", (UINT16)i, start)) == INT16_MAX)
continue;
}
break;
case RET_PK3:
case RET_FOLDER:
if (lump_type_it == USE_PATCHES)
{
if ((start = W_CheckNumForFolderStartPK3("Patches/", i, 0)) == INT16_MAX)
continue;
if ((end = W_CheckNumForFolderEndPK3("Patches/", i, start)) == INT16_MAX)
continue;
}
else if (lump_type_it == USE_TEXTURES)
{
if ((start = W_CheckNumForFolderStartPK3("Textures/", i, 0)) == INT16_MAX)
continue;
if ((end = W_CheckNumForFolderEndPK3("Textures/", i, start)) == INT16_MAX)
continue;
}
break;
default:
continue;
}
// Now find lump with specified name in that range.
lump = W_CheckNumForNamePwad(name, (UINT16)i, start);
if (lump < end)
{
lump += (i<<16); // found it, in our constraints
break;
}
lump = LUMPERROR;
}
if (lump != LUMPERROR)
{
break;
}
}
if (lump == LUMPERROR)
{
// Use whatever else you can find.
return W_GetNumForName(name);
}
return lump;
}
static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch) static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
{ {
char *texturesToken; char *texturesToken;
@ -1240,13 +1332,13 @@ static texpatch_t *R_ParsePatch(boolean actuallyLoadPatch)
if (actuallyLoadPatch == true) if (actuallyLoadPatch == true)
{ {
// Check lump exists // Check lump exists
patchLumpNum = W_GetNumForName(patchName); patchLumpNum = W_GetTexPatchLumpNum(patchName);
// If so, allocate memory for texpatch_t and fill 'er up // If so, allocate memory for texpatch_t and fill 'er up
resultPatch = (texpatch_t *)Z_Malloc(sizeof(texpatch_t),PU_STATIC,NULL); resultPatch = (texpatch_t *)Z_Malloc(sizeof(texpatch_t),PU_STATIC,NULL);
resultPatch->originx = patchXPos; resultPatch->originx = patchXPos;
resultPatch->originy = patchYPos; resultPatch->originy = patchYPos;
resultPatch->lump = patchLumpNum & 65535; resultPatch->lump = LUMPNUM(patchLumpNum);
resultPatch->wad = patchLumpNum>>16; resultPatch->wad = WADFILENUM(patchLumpNum);
resultPatch->flip = flip; resultPatch->flip = flip;
resultPatch->alpha = alpha; resultPatch->alpha = alpha;
resultPatch->style = style; resultPatch->style = style;

View file

@ -186,6 +186,9 @@ int main(int argc, char **argv)
#endif #endif
#endif #endif
// disable text input right off the bat, since we don't need it at the start.
I_SetTextInputMode(false);
#ifdef LOGMESSAGES #ifdef LOGMESSAGES
if (!M_CheckParm("-nolog")) if (!M_CheckParm("-nolog"))
InitLogging(); InitLogging();

View file

@ -3275,4 +3275,18 @@ const char *I_GetSysName(void)
return SDL_GetPlatform(); return SDL_GetPlatform();
} }
void I_SetTextInputMode(boolean active)
{
if (active)
SDL_StartTextInput();
else
SDL_StopTextInput();
}
boolean I_GetTextInputMode(void)
{
return SDL_IsTextInputActive();
}
#endif #endif