From 7b70d415d1acf162e6fe6f136148cf30ba4e3daa Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 26 May 2009 21:13:18 +0000 Subject: Set appropriate vim 'tags' variable for ctags files. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1531 --- .lvimrc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.lvimrc b/.lvimrc index e37c50f9..cc2893d9 100644 --- a/.lvimrc +++ b/.lvimrc @@ -4,3 +4,28 @@ set tabstop=8 set softtabstop=4 set shiftwidth=4 +" Add all tag files to tags path. + +let topdir = findfile("configure.in", ".;") +let topdir = substitute(topdir, "configure.in", "", "") + +" Check tags file in current dir: +set tags+=tags + +" Add tag files in parent directories: +let tagfiles = findfile("tags", ".;", -1) + +" Add tag files for libraries: +call add(tagfiles, topdir . "textscreen/tags") +call add(tagfiles, topdir . "pcsound/tags") + +for tagfile in tagfiles + " Don't go beyond the project top level when adding parent dirs: + if stridx(tagfile, topdir) >= 0 + exec "set tags+=" . tagfile + endif +endfor + +unlet topdir +unlet tagfiles + -- cgit v1.2.3 From 0be19fa1fe7fabc04b8fbd593a660fdc85f57d87 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 26 May 2009 22:14:24 +0000 Subject: Fix tags for functions using TXT_UNCAST_ARG. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1532 --- textscreen/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/textscreen/Makefile.am b/textscreen/Makefile.am index 5d177111..b8904520 100644 --- a/textscreen/Makefile.am +++ b/textscreen/Makefile.am @@ -1,6 +1,8 @@ AM_CFLAGS = -I../src +CTAGS_ARGS=-I TXT_UNCAST_ARG+ + # build this directory before the examples directory. SUBDIRS= . examples -- cgit v1.2.3 From 0794d30b63dbdb3eeb8c2cbed67316a1b4e7c885 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 19:37:19 +0000 Subject: Add key_ variables for the keys used to control the menu. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1542 --- src/m_menu.c | 232 ++++++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 152 insertions(+), 80 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index aab2afce..dc182569 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -71,6 +71,35 @@ extern boolean message_dontfuckwithme; extern boolean chat_on; // in heads-up code +// +// menu keys: +// + +int key_menu_activate = KEY_ESCAPE; +int key_menu_up = KEY_UPARROW; +int key_menu_down = KEY_DOWNARROW; +int key_menu_left = KEY_LEFTARROW; +int key_menu_right = KEY_RIGHTARROW; +int key_menu_back = KEY_BACKSPACE; +int key_menu_forward = KEY_ENTER; +int key_menu_confirm = 'y'; +int key_menu_abort = 'n'; + +int key_menu_help = KEY_F1; +int key_menu_save = KEY_F2; +int key_menu_load = KEY_F3; +int key_menu_volume = KEY_F4; +int key_menu_detail = KEY_F5; +int key_menu_qsave = KEY_F6; +int key_menu_endgame = KEY_F7; +int key_menu_messages = KEY_F8; +int key_menu_qload = KEY_F9; +int key_menu_quit = KEY_F10; +int key_menu_gamma = KEY_F11; + +int key_menu_incscreen = KEY_EQUALS; +int key_menu_decscreen = KEY_MINUS; + // // defaulted values // @@ -672,9 +701,9 @@ void M_SaveGame (int choice) // char tempstring[80]; -void M_QuickSaveResponse(int ch) +void M_QuickSaveResponse(int key) { - if (ch == 'y') + if (key == key_menu_confirm) { M_DoSave(quickSaveSlot); S_StartSound(NULL,sfx_swtchx); @@ -709,9 +738,9 @@ void M_QuickSave(void) // // M_QuickLoad // -void M_QuickLoadResponse(int ch) +void M_QuickLoadResponse(int key) { - if (ch == 'y') + if (key == key_menu_confirm) { M_LoadSelect(quickSaveSlot); S_StartSound(NULL,sfx_swtchx); @@ -924,9 +953,9 @@ void M_DrawEpisode(void) V_DrawPatchDirect (54,38,0,W_CacheLumpName(DEH_String("M_EPISOD"),PU_CACHE)); } -void M_VerifyNightmare(int ch) +void M_VerifyNightmare(int key) { - if (ch != 'y') + if (key != key_menu_confirm) return; G_DeferedInitNew(nightmare,epi+1,1); @@ -1024,9 +1053,9 @@ void M_ChangeMessages(int choice) // // M_EndGame // -void M_EndGameResponse(int ch) +void M_EndGameResponse(int key) { - if (ch != 'y') + if (key != key_menu_confirm) return; currentMenu->lastOn = itemOn; @@ -1120,9 +1149,9 @@ int quitsounds2[8] = -void M_QuitResponse(int ch) +void M_QuitResponse(int key) { - if (ch != 'y') + if (key != key_menu_confirm) return; if (!netgame) { @@ -1421,34 +1450,34 @@ boolean M_Responder (event_t* ev) { if (ev->data3 == -1) { - key = KEY_UPARROW; + key = key_menu_up; joywait = I_GetTime() + 5; } else if (ev->data3 == 1) { - key = KEY_DOWNARROW; + key = key_menu_down; joywait = I_GetTime() + 5; } if (ev->data2 == -1) { - key = KEY_LEFTARROW; + key = key_menu_left; joywait = I_GetTime() + 2; } else if (ev->data2 == 1) { - key = KEY_RIGHTARROW; + key = key_menu_right; joywait = I_GetTime() + 2; } if (ev->data1&1) { - key = KEY_ENTER; + key = key_menu_forward; joywait = I_GetTime() + 5; } if (ev->data1&2) { - key = KEY_BACKSPACE; + key = key_menu_back; joywait = I_GetTime() + 5; } } @@ -1459,13 +1488,13 @@ boolean M_Responder (event_t* ev) mousey += ev->data3; if (mousey < lasty-30) { - key = KEY_DOWNARROW; + key = key_menu_down; mousewait = I_GetTime() + 5; mousey = lasty -= 30; } else if (mousey > lasty+30) { - key = KEY_UPARROW; + key = key_menu_up; mousewait = I_GetTime() + 5; mousey = lasty += 30; } @@ -1473,26 +1502,26 @@ boolean M_Responder (event_t* ev) mousex += ev->data2; if (mousex < lastx-30) { - key = KEY_LEFTARROW; + key = key_menu_left; mousewait = I_GetTime() + 5; mousex = lastx -= 30; } else if (mousex > lastx+30) { - key = KEY_RIGHTARROW; + key = key_menu_right; mousewait = I_GetTime() + 5; mousex = lastx += 30; } if (ev->data1&1) { - key = KEY_ENTER; + key = key_menu_forward; mousewait = I_GetTime() + 15; } if (ev->data1&2) { - key = KEY_BACKSPACE; + key = key_menu_back; mousewait = I_GetTime() + 15; } } @@ -1514,7 +1543,7 @@ boolean M_Responder (event_t* ev) if (testcontrols) { - if (key == KEY_ESCAPE || key == KEY_F10) + if (key == key_menu_activate || key == key_menu_quit) { I_Quit(); return true; @@ -1574,121 +1603,136 @@ boolean M_Responder (event_t* ev) // Take care of any messages that need input if (messageToPrint) { - if (messageNeedsInput == true && - !(ch == ' ' || ch == 'n' || ch == 'y' || key == KEY_ESCAPE)) - return false; - + if (messageNeedsInput) + { + if (ch != ' ' && ch != KEY_ESCAPE + && ch != key_menu_confirm && ch != key_menu_abort) + { + return false; + } + } + menuactive = messageLastMenuActive; messageToPrint = 0; if (messageRoutine) messageRoutine(ch); - + menuactive = false; S_StartSound(NULL,sfx_swtchx); return true; } - - if (devparm && key == KEY_F1) + + if (devparm && key == key_menu_help) { G_ScreenShot (); return true; } - - + // F-Keys if (!menuactive) - switch(key) - { - case KEY_MINUS: // Screen size down + { + if (key == key_menu_decscreen) // Screen size down + { if (automapactive || chat_on) return false; M_SizeDisplay(0); S_StartSound(NULL,sfx_stnmov); return true; - - case KEY_EQUALS: // Screen size up + } + else if (key == key_menu_incscreen) // Screen size up + { if (automapactive || chat_on) return false; M_SizeDisplay(1); S_StartSound(NULL,sfx_stnmov); return true; - - case KEY_F1: // Help key + } + else if (key == key_menu_help) // Help key + { M_StartControlPanel (); if ( gamemode == retail ) currentMenu = &ReadDef2; else currentMenu = &ReadDef1; - + itemOn = 0; S_StartSound(NULL,sfx_swtchn); return true; - - case KEY_F2: // Save + } + else if (key == key_menu_save) // Save + { M_StartControlPanel(); S_StartSound(NULL,sfx_swtchn); M_SaveGame(0); return true; - - case KEY_F3: // Load + } + else if (key == key_menu_load) // Load + { M_StartControlPanel(); S_StartSound(NULL,sfx_swtchn); M_LoadGame(0); return true; - - case KEY_F4: // Sound Volume + } + else if (key == key_menu_volume) // Sound Volume + { M_StartControlPanel (); currentMenu = &SoundDef; itemOn = sfx_vol; S_StartSound(NULL,sfx_swtchn); return true; - - case KEY_F5: // Detail toggle + } + else if (key == key_menu_detail) // Detail toggle + { M_ChangeDetail(0); S_StartSound(NULL,sfx_swtchn); return true; - - case KEY_F6: // Quicksave + } + else if (key == key_menu_qsave) // Quicksave + { S_StartSound(NULL,sfx_swtchn); M_QuickSave(); return true; - - case KEY_F7: // End game + } + else if (key == key_menu_endgame) // End game + { S_StartSound(NULL,sfx_swtchn); M_EndGame(0); return true; - - case KEY_F8: // Toggle messages + } + else if (key == key_menu_messages) // Toggle messages + { M_ChangeMessages(0); S_StartSound(NULL,sfx_swtchn); return true; - - case KEY_F9: // Quickload + } + else if (key == key_menu_qload) // Quickload + { S_StartSound(NULL,sfx_swtchn); M_QuickLoad(); return true; - - case KEY_F10: // Quit DOOM + } + else if (key == key_menu_quit) // Quit DOOM + { S_StartSound(NULL,sfx_swtchn); M_QuitDOOM(0); return true; - - case KEY_F11: // gamma toggle + } + else if (key == key_menu_gamma) // gamma toggle + { usegamma++; if (usegamma > 4) usegamma = 0; players[consoleplayer].message = DEH_String(gammamsg[usegamma]); I_SetPalette (W_CacheLumpName (DEH_String("PLAYPAL"),PU_CACHE)); return true; - } + } - // Pop-up menu? if (!menuactive) { - if (key == KEY_ESCAPE) + if (key == key_menu_activate) { M_StartControlPanel (); S_StartSound(NULL,sfx_swtchn); @@ -1699,19 +1743,25 @@ boolean M_Responder (event_t* ev) // Keys usable within menu - switch (key) + + if (key == key_menu_down) { - case KEY_DOWNARROW: - do + // Move down to next item + + do { if (itemOn+1 > currentMenu->numitems-1) itemOn = 0; else itemOn++; S_StartSound(NULL,sfx_pstop); } while(currentMenu->menuitems[itemOn].status==-1); + return true; - - case KEY_UPARROW: + } + else if (key == key_menu_up) + { + // Move back up to previous item + do { if (!itemOn) @@ -1719,9 +1769,13 @@ boolean M_Responder (event_t* ev) else itemOn--; S_StartSound(NULL,sfx_pstop); } while(currentMenu->menuitems[itemOn].status==-1); + return true; + } + else if (key == key_menu_left) + { + // Slide slider left - case KEY_LEFTARROW: if (currentMenu->menuitems[itemOn].routine && currentMenu->menuitems[itemOn].status == 2) { @@ -1729,8 +1783,11 @@ boolean M_Responder (event_t* ev) currentMenu->menuitems[itemOn].routine(0); } return true; - - case KEY_RIGHTARROW: + } + else if (key == key_menu_right) + { + // Slide slider right + if (currentMenu->menuitems[itemOn].routine && currentMenu->menuitems[itemOn].status == 2) { @@ -1738,8 +1795,11 @@ boolean M_Responder (event_t* ev) currentMenu->menuitems[itemOn].routine(1); } return true; + } + else if (key == key_menu_forward) + { + // Activate menu item - case KEY_ENTER: if (currentMenu->menuitems[itemOn].routine && currentMenu->menuitems[itemOn].status) { @@ -1756,14 +1816,20 @@ boolean M_Responder (event_t* ev) } } return true; - - case KEY_ESCAPE: + } + else if (key == key_menu_activate) + { + // Deactivate menu + currentMenu->lastOn = itemOn; M_ClearMenus (); S_StartSound(NULL,sfx_swtchx); return true; - - case KEY_BACKSPACE: + } + else if (key == key_menu_back) + { + // Go back to previous menu + currentMenu->lastOn = itemOn; if (currentMenu->prevMenu) { @@ -1772,24 +1838,30 @@ boolean M_Responder (event_t* ev) S_StartSound(NULL,sfx_swtchn); } return true; - - default: + } + else + { + // Keyboard shortcut? + for (i = itemOn+1;i < currentMenu->numitems;i++) + { if (currentMenu->menuitems[i].alphaKey == ch) { itemOn = i; S_StartSound(NULL,sfx_pstop); return true; } + } + for (i = 0;i <= itemOn;i++) + { if (currentMenu->menuitems[i].alphaKey == ch) { itemOn = i; S_StartSound(NULL,sfx_pstop); return true; } - break; - + } } return false; -- cgit v1.2.3 From 5a19f1d85430f2cb3a4812842c834f2d6e41e0f4 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 19:55:50 +0000 Subject: Add configuration file entries for menu key bindings. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1543 --- src/m_config.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/src/m_config.c b/src/m_config.c index 4066cb3c..8acdf415 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -87,6 +87,33 @@ extern int key_use; extern int key_strafe; extern int key_speed; +// Menu control keys: + +extern int key_menu_activate; +extern int key_menu_up; +extern int key_menu_down; +extern int key_menu_left; +extern int key_menu_right; +extern int key_menu_back; +extern int key_menu_forward; +extern int key_menu_confirm; +extern int key_menu_abort; + +extern int key_menu_help; +extern int key_menu_save; +extern int key_menu_load; +extern int key_menu_volume; +extern int key_menu_detail; +extern int key_menu_qsave; +extern int key_menu_endgame; +extern int key_menu_messages; +extern int key_menu_qload; +extern int key_menu_quit; +extern int key_menu_gamma; + +extern int key_menu_incscreen; +extern int key_menu_decscreen; + extern int mousebfire; extern int mousebstrafe; extern int mousebforward; @@ -710,6 +737,127 @@ static default_t extra_defaults_list[] = // CONFIG_VARIABLE_INT(use_libsamplerate, use_libsamplerate), + + //! + // Key that activates the menu when pressed. + // + + CONFIG_VARIABLE_KEY(key_menu_activate, key_menu_activate), + + //! + // Key that moves the cursor up on the menu. + // + + CONFIG_VARIABLE_KEY(key_menu_up, key_menu_up), + + //! + // Key that moves the cursor down on the menu. + // + + CONFIG_VARIABLE_KEY(key_menu_down, key_menu_down), + + //! + // Key that moves the currently selected slider on the menu left. + // + + CONFIG_VARIABLE_KEY(key_menu_left, key_menu_left), + + //! + // Key that moves the currently selected slider on the menu right. + // + + CONFIG_VARIABLE_KEY(key_menu_right, key_menu_right), + + //! + // Key to go back to the previous menu. + // + + CONFIG_VARIABLE_KEY(key_menu_back, key_menu_back), + + //! + // Key to activate the currently selected menu item. + // + + CONFIG_VARIABLE_KEY(key_menu_forward, key_menu_forward), + + //! + // Key to answer 'yes' to a question in the menu. + // + + CONFIG_VARIABLE_KEY(key_menu_confirm, key_menu_confirm), + + //! + // Key to answer 'no' to a question in the menu. + // + + CONFIG_VARIABLE_KEY(key_menu_abort, key_menu_abort), + + //! + // Keyboard shortcut to bring up the help screen. + // + + CONFIG_VARIABLE_KEY(key_menu_help, key_menu_help), + + //! + // Keyboard shortcut to bring up the save game menu. + // + + CONFIG_VARIABLE_KEY(key_menu_save, key_menu_save), + + //! + // Keyboard shortcut to bring up the load game menu. + // + + CONFIG_VARIABLE_KEY(key_menu_load, key_menu_load), + + //! + // Keyboard shortcut to bring up the sound volume menu. + // + + CONFIG_VARIABLE_KEY(key_menu_volume, key_menu_volume), + + //! + // Keyboard shortcut to toggle the detail level. + // + + CONFIG_VARIABLE_KEY(key_menu_detail, key_menu_detail), + + //! + // Keyboard shortcut to quicksave the current game. + // + + CONFIG_VARIABLE_KEY(key_menu_qsave, key_menu_qsave), + + //! + // Keyboard shortcut to end the game. + // + + CONFIG_VARIABLE_KEY(key_menu_endgame, key_menu_endgame), + + //! + // Keyboard shortcut to toggle heads-up messages. + // + + CONFIG_VARIABLE_KEY(key_menu_messages, key_menu_messages), + + //! + // Keyboard shortcut to load the last quicksave. + // + + CONFIG_VARIABLE_KEY(key_menu_qload, key_menu_qload), + + //! + // Keyboard shortcut to quit the game. + // + + CONFIG_VARIABLE_KEY(key_menu_quit, key_menu_quit), + + //! + // Keyboard shortcut to toggle the gamma correction level. + // + + CONFIG_VARIABLE_KEY(key_menu_gamma, key_menu_gamma), + }; static default_collection_t extra_defaults = -- cgit v1.2.3 From b3a03a40660e7bc4cbc2720aeb5c9c35c5de030a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 19:59:26 +0000 Subject: Fix shortcut keys for menu items. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1544 --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index dc182569..6809e6c0 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1839,7 +1839,7 @@ boolean M_Responder (event_t* ev) } return true; } - else + else if (ch != 0) { // Keyboard shortcut? -- cgit v1.2.3 From 334af5fd565c261f070a42d17a1429cfca1b6651 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 20:18:04 +0000 Subject: Add config file variables to increase/decrease screen size. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1545 --- src/m_config.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/m_config.c b/src/m_config.c index 8acdf415..251588a1 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -858,6 +858,18 @@ static default_t extra_defaults_list[] = CONFIG_VARIABLE_KEY(key_menu_gamma, key_menu_gamma), + //! + // Keyboard shortcut to increase the screen size. + // + + CONFIG_VARIABLE_KEY(key_menu_incscreen, key_menu_incscreen), + + //! + // Keyboard shortcut to decrease the screen size. + // + + CONFIG_VARIABLE_KEY(key_menu_decscreen, key_menu_decscreen), + }; static default_collection_t extra_defaults = -- cgit v1.2.3 From adcd838e72854528dec15016b32b6e0bfa292fcd Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 20:45:54 +0000 Subject: Add dialog to setup tool for editing menu shortcuts. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1546 --- setup/configfile.c | 23 +++++++++++++++ setup/keyboard.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++- setup/keyboard.h | 25 ++++++++++++++++ 3 files changed, 134 insertions(+), 1 deletion(-) diff --git a/setup/configfile.c b/setup/configfile.c index 3f75d7f1..97e06744 100644 --- a/setup/configfile.c +++ b/setup/configfile.c @@ -239,6 +239,7 @@ static default_t doom_defaults_list[] = {"chatmacro7", &chat_macros[7], DEFAULT_STRING, 0, 0 }, {"chatmacro8", &chat_macros[8], DEFAULT_STRING, 0, 0 }, {"chatmacro9", &chat_macros[9], DEFAULT_STRING, 0, 0 }, + }; static default_collection_t doom_defaults = @@ -282,6 +283,28 @@ static default_t extra_defaults_list[] = {"mouseb_use", &mousebuse, DEFAULT_INT, 0, 0}, {"mouseb_backward", &mousebbackward, DEFAULT_INT, 0, 0}, {"use_libsamplerate", &use_libsamplerate, DEFAULT_INT, 0, 0}, + {"key_menu_activate", &key_menu_activate, DEFAULT_KEY, 0, 0}, + {"key_menu_up", &key_menu_up, DEFAULT_KEY, 0, 0}, + {"key_menu_down", &key_menu_down, DEFAULT_KEY, 0, 0}, + {"key_menu_left", &key_menu_left, DEFAULT_KEY, 0, 0}, + {"key_menu_right", &key_menu_right, DEFAULT_KEY, 0, 0}, + {"key_menu_back", &key_menu_back, DEFAULT_KEY, 0, 0}, + {"key_menu_forward", &key_menu_forward, DEFAULT_KEY, 0, 0}, + {"key_menu_confirm", &key_menu_confirm, DEFAULT_KEY, 0, 0}, + {"key_menu_abort", &key_menu_abort, DEFAULT_KEY, 0, 0}, + {"key_menu_help", &key_menu_help, DEFAULT_KEY, 0, 0}, + {"key_menu_save", &key_menu_save, DEFAULT_KEY, 0, 0}, + {"key_menu_load", &key_menu_load, DEFAULT_KEY, 0, 0}, + {"key_menu_volume", &key_menu_volume, DEFAULT_KEY, 0, 0}, + {"key_menu_detail", &key_menu_detail, DEFAULT_KEY, 0, 0}, + {"key_menu_qsave", &key_menu_qsave, DEFAULT_KEY, 0, 0}, + {"key_menu_endgame", &key_menu_endgame, DEFAULT_KEY, 0, 0}, + {"key_menu_messages", &key_menu_messages, DEFAULT_KEY, 0, 0}, + {"key_menu_qload", &key_menu_qload, DEFAULT_KEY, 0, 0}, + {"key_menu_quit", &key_menu_quit, DEFAULT_KEY, 0, 0}, + {"key_menu_gamma", &key_menu_gamma, DEFAULT_KEY, 0, 0}, + {"key_menu_incscreen", &key_menu_incscreen, DEFAULT_KEY, 0, 0}, + {"key_menu_decscreen", &key_menu_decscreen, DEFAULT_KEY, 0, 0}, }; static default_collection_t extra_defaults = diff --git a/setup/keyboard.c b/setup/keyboard.c index 3a7ccb8f..c4d4fbec 100644 --- a/setup/keyboard.c +++ b/setup/keyboard.c @@ -18,6 +18,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. // + #include "textscreen.h" #include "doomtype.h" @@ -38,6 +39,33 @@ int key_use = ' '; int key_strafe = KEY_RALT; int key_speed = KEY_RSHIFT; +// Menu keys: + +int key_menu_activate = KEY_ESCAPE; +int key_menu_up = KEY_UPARROW; +int key_menu_down = KEY_DOWNARROW; +int key_menu_left = KEY_LEFTARROW; +int key_menu_right = KEY_RIGHTARROW; +int key_menu_back = KEY_BACKSPACE; +int key_menu_forward = KEY_ENTER; +int key_menu_confirm = 'y'; +int key_menu_abort = 'n'; + +int key_menu_help = KEY_F1; +int key_menu_save = KEY_F2; +int key_menu_load = KEY_F3; +int key_menu_volume = KEY_F4; +int key_menu_detail = KEY_F5; +int key_menu_qsave = KEY_F6; +int key_menu_endgame = KEY_F7; +int key_menu_messages = KEY_F8; +int key_menu_qload = KEY_F9; +int key_menu_quit = KEY_F10; +int key_menu_gamma = KEY_F11; + +int key_menu_incscreen = KEY_EQUALS; +int key_menu_decscreen = KEY_MINUS; + int vanilla_keyboard_mapping = 1; static int always_run = 0; @@ -86,16 +114,72 @@ static void KeySetCallback(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(variable)) } } -static void AddKeyControl(txt_table_t *table, char *name, int *var) +// Add a label and keyboard input to the specified table. + +static txt_key_input_t *AddKeyInput(txt_table_t *table, char *name, int *var) { txt_key_input_t *key_input; TXT_AddWidget(table, TXT_NewLabel(name)); key_input = TXT_NewKeyInput(var); TXT_AddWidget(table, key_input); + + return key_input; +} + +// Add a keyboard input for a game control. Each key can only be bound +// to one game control at a time. + +static void AddKeyControl(txt_table_t *table, char *name, int *var) +{ + txt_key_input_t *key_input; + + key_input = AddKeyInput(table, name, var); TXT_SignalConnect(key_input, "set", KeySetCallback, var); } +static void MenuKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) +{ + txt_window_t *window; + txt_table_t *table; + txt_scrollpane_t *scrollpane; + + window = TXT_NewWindow("Menu keys"); + + table = TXT_NewTable(2); + + TXT_SetColumnWidths(table, 25, 10); + + AddKeyInput(table, "Activate menu", &key_menu_activate); + AddKeyInput(table, "Move cursor up", &key_menu_up); + AddKeyInput(table, "Move cursor down", &key_menu_down); + AddKeyInput(table, "Move slider left", &key_menu_left); + AddKeyInput(table, "Move slider right", &key_menu_right); + AddKeyInput(table, "Go to previous menu", &key_menu_back); + AddKeyInput(table, "Activate menu item", &key_menu_forward); + AddKeyInput(table, "Confirm action", &key_menu_confirm); + AddKeyInput(table, "Cancel action", &key_menu_abort); + + AddKeyInput(table, "Help screen", &key_menu_help); + AddKeyInput(table, "Save game", &key_menu_save); + AddKeyInput(table, "Load game", &key_menu_load); + AddKeyInput(table, "Sound volume", &key_menu_volume); + AddKeyInput(table, "Toggle detail", &key_menu_detail); + AddKeyInput(table, "Quick save", &key_menu_qsave); + AddKeyInput(table, "End game", &key_menu_endgame); + AddKeyInput(table, "Toggle messages", &key_menu_messages); + AddKeyInput(table, "Quick load", &key_menu_qload); + AddKeyInput(table, "Quit game", &key_menu_quit); + AddKeyInput(table, "Toggle gamma", &key_menu_gamma); + + AddKeyInput(table, "Increase screen size", &key_menu_incscreen); + AddKeyInput(table, "Decrease screen size", &key_menu_decscreen); + + scrollpane = TXT_NewScrollPane(0, 10, table); + + TXT_AddWidget(window, scrollpane); +} + void ConfigKeyboard(void) { txt_window_t *window; @@ -113,6 +197,7 @@ void ConfigKeyboard(void) TXT_NewSeparator("Action"), action_table = TXT_NewTable(2), + TXT_NewButton2("Menu keys...", MenuKeysDialog, NULL), TXT_NewSeparator("Misc."), run_control = TXT_NewCheckBox("Always run", &always_run), diff --git a/setup/keyboard.h b/setup/keyboard.h index 6442e1e4..19ce7147 100644 --- a/setup/keyboard.h +++ b/setup/keyboard.h @@ -35,6 +35,31 @@ extern int key_speed; extern int joybspeed; extern int vanilla_keyboard_mapping; +extern int key_menu_activate; +extern int key_menu_up; +extern int key_menu_down; +extern int key_menu_left; +extern int key_menu_right; +extern int key_menu_back; +extern int key_menu_forward; +extern int key_menu_confirm; +extern int key_menu_abort; + +extern int key_menu_help; +extern int key_menu_save; +extern int key_menu_load; +extern int key_menu_volume; +extern int key_menu_detail; +extern int key_menu_qsave; +extern int key_menu_endgame; +extern int key_menu_messages; +extern int key_menu_qload; +extern int key_menu_quit; +extern int key_menu_gamma; + +extern int key_menu_incscreen; +extern int key_menu_decscreen; + void ConfigKeyboard(void); #endif /* #ifndef SETUP_KEYBOARD_H */ -- cgit v1.2.3 From 500bcb6919887185f4f98763a36c5c243e11bae5 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 23:20:06 +0000 Subject: Use key for confirming menu messages, not typed char. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1547 --- src/m_menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 6809e6c0..1ced1d16 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1605,8 +1605,8 @@ boolean M_Responder (event_t* ev) { if (messageNeedsInput) { - if (ch != ' ' && ch != KEY_ESCAPE - && ch != key_menu_confirm && ch != key_menu_abort) + if (key != ' ' && key != KEY_ESCAPE + && key != key_menu_confirm && key != key_menu_abort) { return false; } @@ -1615,7 +1615,7 @@ boolean M_Responder (event_t* ev) menuactive = messageLastMenuActive; messageToPrint = 0; if (messageRoutine) - messageRoutine(ch); + messageRoutine(key); menuactive = false; S_StartSound(NULL,sfx_swtchx); -- cgit v1.2.3 From 3c2e7735a0134c5ce6af9624b65b7f3d27c752f1 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 3 Jun 2009 23:20:37 +0000 Subject: Add unique key groups for menu navigation and shortcuts. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1548 --- setup/keyboard.c | 137 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 85 insertions(+), 52 deletions(-) diff --git a/setup/keyboard.c b/setup/keyboard.c index c4d4fbec..2e791c7a 100644 --- a/setup/keyboard.c +++ b/setup/keyboard.c @@ -70,9 +70,21 @@ int vanilla_keyboard_mapping = 1; static int always_run = 0; -static int *allkeys[] = {&key_left, &key_right, &key_up, &key_down, - &key_strafeleft, &key_straferight, &key_fire, - &key_use, &key_strafe, &key_speed}; +// Keys within these groups cannot have the same value. + +static int *controls[] = { &key_left, &key_right, &key_up, &key_down, + &key_strafeleft, &key_straferight, &key_fire, + &key_use, &key_strafe, &key_speed, NULL }; + +static int *menu_nav[] = { &key_menu_activate, &key_menu_up, &key_menu_down, + &key_menu_left, &key_menu_right, &key_menu_back, + &key_menu_forward, NULL }; + +static int *shortcuts[] = { &key_menu_help, &key_menu_save, &key_menu_load, + &key_menu_volume, &key_menu_detail, &key_menu_qsave, + &key_menu_endgame, &key_menu_messages, + &key_menu_qload, &key_menu_quit, &key_menu_gamma, + &key_menu_incscreen, &key_menu_decscreen, NULL }; static void UpdateJoybSpeed(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(var)) { @@ -94,47 +106,68 @@ static void UpdateJoybSpeed(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(var)) } } -// Callback invoked when a key control is set +static int VarInGroup(int *variable, int **group) +{ + unsigned int i; -static void KeySetCallback(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(variable)) + for (i=0; group[i] != NULL; ++i) + { + if (group[i] == variable) + { + return 1; + } + } + + return 0; +} + +static void CheckKeyGroup(int *variable, int **group) { - TXT_CAST_ARG(int, variable); unsigned int i; - for (i=0; itype == ev_keydown && ev->data1 == AM_STARTKEY) + if (ev->type == ev_keydown && ev->data1 == key_map_toggle) { AM_Start (); viewactive = false; rc = true; } } - else if (ev->type == ev_keydown) { - rc = true; - switch(ev->data1) - { - case AM_PANRIGHTKEY: // pan right - if (!followplayer) m_paninc.x = FTOM(F_PANINC); - else rc = false; - break; - case AM_PANLEFTKEY: // pan left - if (!followplayer) m_paninc.x = -FTOM(F_PANINC); - else rc = false; - break; - case AM_PANUPKEY: // pan up - if (!followplayer) m_paninc.y = FTOM(F_PANINC); - else rc = false; - break; - case AM_PANDOWNKEY: // pan down - if (!followplayer) m_paninc.y = -FTOM(F_PANINC); - else rc = false; - break; - case AM_ZOOMOUTKEY: // zoom out - mtof_zoommul = M_ZOOMOUT; - ftom_zoommul = M_ZOOMIN; - break; - case AM_ZOOMINKEY: // zoom in - mtof_zoommul = M_ZOOMIN; - ftom_zoommul = M_ZOOMOUT; - break; - case AM_ENDKEY: - bigstate = 0; - viewactive = true; - AM_Stop (); - break; - case AM_GOBIGKEY: - bigstate = !bigstate; - if (bigstate) - { - AM_saveScaleAndLoc(); - AM_minOutWindowScale(); - } - else AM_restoreScaleAndLoc(); - break; - case AM_FOLLOWKEY: - followplayer = !followplayer; - f_oldloc.x = INT_MAX; + key = ev->data1; + + if (key == key_map_east) // pan right + { + if (!followplayer) m_paninc.x = FTOM(F_PANINC); + else rc = false; + } + else if (key == key_map_west) // pan left + { + if (!followplayer) m_paninc.x = -FTOM(F_PANINC); + else rc = false; + } + else if (key == key_map_north) // pan up + { + if (!followplayer) m_paninc.y = FTOM(F_PANINC); + else rc = false; + } + else if (key == key_map_south) // pan down + { + if (!followplayer) m_paninc.y = -FTOM(F_PANINC); + else rc = false; + } + else if (key == key_map_zoomout) // zoom out + { + mtof_zoommul = M_ZOOMOUT; + ftom_zoommul = M_ZOOMIN; + } + else if (key == key_map_zoomin) // zoom in + { + mtof_zoommul = M_ZOOMIN; + ftom_zoommul = M_ZOOMOUT; + } + else if (key == key_map_toggle) + { + bigstate = 0; + viewactive = true; + AM_Stop (); + } + else if (key == key_map_maxzoom) + { + bigstate = !bigstate; + if (bigstate) + { + AM_saveScaleAndLoc(); + AM_minOutWindowScale(); + } + else AM_restoreScaleAndLoc(); + } + else if (key == key_map_follow) + { + followplayer = !followplayer; + f_oldloc.x = INT_MAX; if (followplayer) plr->message = DEH_String(AMSTR_FOLLOWON); else plr->message = DEH_String(AMSTR_FOLLOWOFF); - break; - case AM_GRIDKEY: - grid = !grid; + } + else if (key == key_map_grid) + { + grid = !grid; if (grid) plr->message = DEH_String(AMSTR_GRIDON); else plr->message = DEH_String(AMSTR_GRIDOFF); - break; - case AM_MARKKEY: - sprintf(buffer, "%s %d", DEH_String(AMSTR_MARKEDSPOT), markpointnum); - plr->message = buffer; - AM_addMark(); - break; - case AM_CLEARMARKKEY: - AM_clearMarks(); - plr->message = DEH_String(AMSTR_MARKSCLEARED); - break; - default: - cheatstate=0; - rc = false; - } + } + else if (key == key_map_mark) + { + sprintf(buffer, "%s %d", DEH_String(AMSTR_MARKEDSPOT), markpointnum); + plr->message = buffer; + AM_addMark(); + } + else if (key == key_map_clearmark) + { + AM_clearMarks(); + plr->message = DEH_String(AMSTR_MARKSCLEARED); + } + else + { + cheatstate=0; + rc = false; + } + if (!deathmatch && cht_CheckCheat(&cheat_amap, ev->data2)) { rc = false; cheating = (cheating+1) % 3; } } - else if (ev->type == ev_keyup) { - rc = false; - switch (ev->data1) - { - case AM_PANRIGHTKEY: - if (!followplayer) m_paninc.x = 0; - break; - case AM_PANLEFTKEY: - if (!followplayer) m_paninc.x = 0; - break; - case AM_PANUPKEY: - if (!followplayer) m_paninc.y = 0; - break; - case AM_PANDOWNKEY: - if (!followplayer) m_paninc.y = 0; - break; - case AM_ZOOMOUTKEY: - case AM_ZOOMINKEY: - mtof_zoommul = FRACUNIT; - ftom_zoommul = FRACUNIT; - break; - } + rc = false; + key = ev->data1; + + if (key == key_map_east) + { + if (!followplayer) m_paninc.x = 0; + } + else if (key == key_map_west) + { + if (!followplayer) m_paninc.x = 0; + } + else if (key == key_map_north) + { + if (!followplayer) m_paninc.y = 0; + } + else if (key == key_map_south) + { + if (!followplayer) m_paninc.y = 0; + } + else if (key == key_map_zoomout || key == key_map_zoomin) + { + mtof_zoommul = FRACUNIT; + ftom_zoommul = FRACUNIT; + } } return rc; diff --git a/src/g_game.c b/src/g_game.c index 44e77a74..cd070884 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -173,6 +173,15 @@ int key_fire = KEY_RCTRL; int key_use = ' '; int key_strafe = KEY_RALT; int key_speed = KEY_RSHIFT; + +int key_weapon1 = '1'; +int key_weapon2 = '2'; +int key_weapon3 = '3'; +int key_weapon4 = '4'; +int key_weapon5 = '5'; +int key_weapon6 = '6'; +int key_weapon7 = '7'; +int key_weapon8 = '8'; int mousebfire = 0; int mousebstrafe = 1; @@ -211,6 +220,17 @@ fixed_t forwardmove[2] = {0x19, 0x32}; fixed_t sidemove[2] = {0x18, 0x28}; fixed_t angleturn[3] = {640, 1280, 320}; // + slow turn +static int *weapon_keys[] = { + &key_weapon1, + &key_weapon2, + &key_weapon3, + &key_weapon4, + &key_weapon5, + &key_weapon6, + &key_weapon7, + &key_weapon8 +}; + #define SLOWTURNTICS 6 #define NUMKEYS 256 @@ -501,13 +521,18 @@ void G_BuildTiccmd (ticcmd_t* cmd) } // chainsaw overrides - for (i=0 ; ibuttons |= BT_CHANGE; cmd->buttons |= i< @@ -487,7 +487,7 @@ static void BuildIWADDirList(void) AddDoomWadPath(); -#ifdef _WIN32 +#if defined(_WIN32) && !defined(_WIN32_WCE) // Search the registry and find where IWADs have been installed. -- cgit v1.2.3 From 6d0bf9181121b4c117c80d05a7f097363c531774 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 00:56:23 +0000 Subject: Add Windows CE implementations of some ANSI C functions that are missing. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1553 --- wince/Makefile.am | 8 ++++++ wince/env.c | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ wince/env.h | 13 ++++++++++ wince/errno.c | 20 +++++++++++++++ wince/errno.h | 15 +++++++++++ wince/fileops.c | 49 +++++++++++++++++++++++++++++++++++ wince/fileops.h | 14 ++++++++++ 7 files changed, 196 insertions(+) create mode 100644 wince/Makefile.am create mode 100644 wince/env.c create mode 100644 wince/env.h create mode 100644 wince/errno.c create mode 100644 wince/errno.h create mode 100644 wince/fileops.c create mode 100644 wince/fileops.h diff --git a/wince/Makefile.am b/wince/Makefile.am new file mode 100644 index 00000000..f6c87759 --- /dev/null +++ b/wince/Makefile.am @@ -0,0 +1,8 @@ + +noinst_LIBRARIES=libc_wince.a + +libc_wince_a_SOURCES = \ + env.c env.h \ + errno.c errno.h \ + fileops.c fileops.h + diff --git a/wince/env.c b/wince/env.c new file mode 100644 index 00000000..ceba6402 --- /dev/null +++ b/wince/env.c @@ -0,0 +1,77 @@ +// +// "Extension" implementation of getenv for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#include +#include + +#include +#include +#include + +#include "env.h" + +static int buffers_loaded = 0; +static char username_buf[UNLEN + 1]; +static char temp_buf[MAX_PATH + 1]; +static char home_buf[MAX_PATH + 1]; + +static void WCharToChar(wchar_t *src, char *dest, int buf_len) +{ + unsigned int len; + + len = wcslen(src); + + WideCharToMultiByte(CP_OEMCP, 0, src, len, dest, buf_len, NULL, NULL); +} + +static void LoadBuffers(void) +{ + wchar_t temp[MAX_PATH]; + DWORD buf_len; + + // Username: + + buf_len = UNLEN; + GetUserNameW(temp, &buf_len); + WCharToChar(temp, temp_buf, MAX_PATH); + + // Temp dir: + + GetTempPathW(MAX_PATH, temp); + WCharToChar(temp, temp_buf, MAX_PATH); + + // Use My Documents dir as home: + + SHGetSpecialFolderPath(NULL, temp, CSIDL_PERSONAL, 0); + WCharToChar(temp, home_buf, MAX_PATH); +} + +char *getenv(const char *name) +{ + if (!buffers_loaded) + { + LoadBuffers(); + buffers_loaded = 1; + } + + if (!strcmp(name, "USER") || !strcmp(name, "USERNAME")) + { + return username_buf; + } + else if (!strcmp(name, "TEMP")) + { + return temp_buf; + } + else if (!strcmp(name, "HOME")) + { + return home_buf; + } + else + { + return NULL; + } +} + diff --git a/wince/env.h b/wince/env.h new file mode 100644 index 00000000..c2cb4243 --- /dev/null +++ b/wince/env.h @@ -0,0 +1,13 @@ +// +// "Extension" implementation of getenv for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#ifndef WINCE_ENV_H +#define WINCE_ENV_H + +extern char *getenv(const char *name); + +#endif /* #ifndef WINCE_ENV_H */ + diff --git a/wince/errno.c b/wince/errno.c new file mode 100644 index 00000000..28cd0899 --- /dev/null +++ b/wince/errno.c @@ -0,0 +1,20 @@ +// +// "Extension" implementation of errno.h for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#include + +#include "errno.h" + +// This should really be a thread-local variable. Oh well. + +static int my_errno; + +int *_GetErrno() +{ + my_errno = GetLastError(); + return &my_errno; +} + diff --git a/wince/errno.h b/wince/errno.h new file mode 100644 index 00000000..e9b4721a --- /dev/null +++ b/wince/errno.h @@ -0,0 +1,15 @@ +// +// "Extension" implementation of errno.h for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#ifndef WINCE_ERRNO_H +#define WINCE_ERRNO_H + +extern int *_GetErrno(); + +#define errno (*_GetErrno()) + +#endif /* #ifndef WINCE_ERROR_H */ + diff --git a/wince/fileops.c b/wince/fileops.c new file mode 100644 index 00000000..b0617bd3 --- /dev/null +++ b/wince/fileops.c @@ -0,0 +1,49 @@ +// +// "Extension" implementation of ANSI C file functions for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#include +#include +#include + +#include + +#include "fileops.h" + +int remove(const char *pathname) +{ + wchar_t temp[MAX_PATH + 1]; + + MultiByteToWideChar(CP_OEMCP, + 0, + pathname, + strlen(pathname) + 1, + temp, + MAX_PATH); + + return DeleteFileW(temp) != 0; +} + +int rename(const char *oldpath, const char *newpath) +{ + wchar_t oldpath1[MAX_PATH + 1]; + wchar_t newpath1[MAX_PATH + 1]; + + MultiByteToWideChar(CP_OEMCP, + 0, + oldpath, + strlen(oldpath) + 1, + oldpath1, + MAX_PATH); + MultiByteToWideChar(CP_OEMCP, + 0, + newpath, + strlen(newpath) + 1, + newpath1, + MAX_PATH); + + return MoveFileW(oldpath1, newpath1); +} + diff --git a/wince/fileops.h b/wince/fileops.h new file mode 100644 index 00000000..757a34fd --- /dev/null +++ b/wince/fileops.h @@ -0,0 +1,14 @@ +// +// "Extension" implementation of ANSI C file functions for Windows CE. +// +// I (Simon Howard) release this file to the public domain. +// + +#ifndef WINCE_FILEOPS_H +#define WINCE_FILEOPS_H + +int remove(const char *pathname); +int rename(const char *oldpath, const char *newpath); + +#endif /* #ifndef WINCE_FILEOPS_H */ + -- cgit v1.2.3 From 8a262fb95d8f335cf7930a8ae667fe5e01552cf4 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:24:40 +0000 Subject: Fix compile with FEATURE_SOUND disabled. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1554 --- src/m_config.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/m_config.c b/src/m_config.c index cca4bec1..be329cba 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -747,6 +747,8 @@ static default_t extra_defaults_list[] = CONFIG_VARIABLE_INT(dclick_use, dclick_use), +#ifdef FEATURE_SOUND + //! // Controls whether libsamplerate support is used for performing // sample rate conversions of sound effects. Support for this @@ -762,6 +764,8 @@ static default_t extra_defaults_list[] = CONFIG_VARIABLE_INT(use_libsamplerate, use_libsamplerate), +#endif + //! // Key that activates the menu when pressed. // -- cgit v1.2.3 From 2df46868ae68060f3eb681a5dd1943ee522a88b4 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:26:45 +0000 Subject: Fix compile with FEATURE_MULTIPLAYER disabled. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1555 --- src/d_net.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/d_net.c b/src/d_net.c index 4e87a813..f5890769 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -429,6 +429,7 @@ static int GetLowTic(void) int i; int lowtic; +#ifdef FEATURE_MULTIPLAYER if (net_client_connected) { lowtic = INT_MAX; @@ -443,6 +444,7 @@ static int GetLowTic(void) } } else +#endif { lowtic = maketic; } -- cgit v1.2.3 From 52c831999bddb7b68b855d0fec644240863cbee2 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:27:30 +0000 Subject: Use GetUserNameExW, not GetUserName (doesn't exist on WinCE) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1556 --- wince/env.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wince/env.c b/wince/env.c index ceba6402..a678de2d 100644 --- a/wince/env.c +++ b/wince/env.c @@ -9,6 +9,7 @@ #include #include +#include #include #include "env.h" @@ -35,7 +36,7 @@ static void LoadBuffers(void) // Username: buf_len = UNLEN; - GetUserNameW(temp, &buf_len); + GetUserNameExW(NameDisplay, temp, &buf_len); WCharToChar(temp, temp_buf, MAX_PATH); // Temp dir: -- cgit v1.2.3 From 203e7e79a1a20b83fea8a91b46c8241c056a23b1 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:27:58 +0000 Subject: Add libc_wince.h header, and EISDIR error value. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1557 --- wince/errno.h | 2 ++ wince/libc_wince.h | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 wince/libc_wince.h diff --git a/wince/errno.h b/wince/errno.h index e9b4721a..a2149b45 100644 --- a/wince/errno.h +++ b/wince/errno.h @@ -7,6 +7,8 @@ #ifndef WINCE_ERRNO_H #define WINCE_ERRNO_H +#define EISDIR 21 /* Is a directory */ + extern int *_GetErrno(); #define errno (*_GetErrno()) diff --git a/wince/libc_wince.h b/wince/libc_wince.h new file mode 100644 index 00000000..0d6fac05 --- /dev/null +++ b/wince/libc_wince.h @@ -0,0 +1,4 @@ + +#include "env.h" +#include "fileops.h" + -- cgit v1.2.3 From 7f9b5d41173c7db6465a5f7666fe7913106a8c1c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:32:15 +0000 Subject: Add CPU affinity function for Windows CE. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1558 --- src/i_main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/i_main.c b/src/i_main.c index 3a9ec696..e1de5881 100644 --- a/src/i_main.c +++ b/src/i_main.c @@ -34,7 +34,15 @@ #include "m_argv.h" #include "d_main.h" -#if defined(_WIN32) +#if defined(_WIN32_WCE) + +// Windows CE? I doubt it even supports SMP.. + +static void LockCPUAffinity(void) +{ +} + +#elif defined(_WIN32) #define WIN32_LEAN_AND_MEAN #include -- cgit v1.2.3 From 3831ece14e28284302cc1a49f568b5c0b6858f90 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:33:58 +0000 Subject: Include libc_wince.h when on Windows CE. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1559 --- src/doomtype.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/doomtype.h b/src/doomtype.h index 2c9680b3..0a5b5e38 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -29,6 +29,13 @@ #ifndef __DOOMTYPE__ #define __DOOMTYPE__ +// Windows CE is missing some vital ANSI C functions. We have to +// use our own replacements. + +#ifdef _WIN32_WCE +#include "libc_wince.h" +#endif + // C99 integer types; with gcc we just use this. Other compilers // should add conditional statements that define the C99 types. -- cgit v1.2.3 From abc69c7cf92181461612d7126f2bdc8da6b9eb76 Mon Sep 17 00:00:00 2001 From: Russell Rice Date: Sun, 7 Jun 2009 01:50:47 +0000 Subject: - Update textscreen codeblocks project to include txt_scrollpane.* and txt_smallfont.h Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1560 --- codeblocks/textscreen.cbp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codeblocks/textscreen.cbp b/codeblocks/textscreen.cbp index bee3040a..8db957b1 100644 --- a/codeblocks/textscreen.cbp +++ b/codeblocks/textscreen.cbp @@ -81,6 +81,10 @@