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(-) (limited to 'src') 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(+) (limited to 'src') 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(-) (limited to 'src') 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(+) (limited to 'src') 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 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(-) (limited to 'src') 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 e3e71290f86c785a29ec6b9eeb609c7625776255 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Fri, 5 Jun 2009 16:58:48 +0000 Subject: Add key binding variables for automap and weapon keys. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1551 --- src/am_map.c | 210 ++++++++++++++++++++++++++++++--------------------------- src/g_game.c | 33 +++++++-- src/m_config.c | 143 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 284 insertions(+), 102 deletions(-) (limited to 'src') diff --git a/src/am_map.c b/src/am_map.c index 5fbe748a..9a81d62c 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -90,19 +90,18 @@ // drawing stuff #define FB 0 -#define AM_PANDOWNKEY KEY_DOWNARROW -#define AM_PANUPKEY KEY_UPARROW -#define AM_PANRIGHTKEY KEY_RIGHTARROW -#define AM_PANLEFTKEY KEY_LEFTARROW -#define AM_ZOOMINKEY '=' -#define AM_ZOOMOUTKEY '-' -#define AM_STARTKEY KEY_TAB -#define AM_ENDKEY KEY_TAB -#define AM_GOBIGKEY '0' -#define AM_FOLLOWKEY 'f' -#define AM_GRIDKEY 'g' -#define AM_MARKKEY 'm' -#define AM_CLEARMARKKEY 'c' +int key_map_north = KEY_UPARROW; +int key_map_south = KEY_DOWNARROW; +int key_map_east = KEY_RIGHTARROW; +int key_map_west = KEY_LEFTARROW; +int key_map_zoomin = '='; +int key_map_zoomout = '-'; +int key_map_toggle = KEY_TAB; +int key_map_maxzoom = '0'; +int key_map_follow = 'f'; +int key_map_grid = 'g'; +int key_map_mark = 'm'; +int key_map_clearmark = 'c'; #define AM_NUMMARKPOINTS 10 @@ -632,121 +631,136 @@ AM_Responder static int cheatstate=0; static int bigstate=0; static char buffer[20]; + int key; rc = false; if (!automapactive) { - if (ev->type == 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 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(+) (limited to 'src') 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(+) (limited to 'src') 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 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(-) (limited to 'src') 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(+) (limited to 'src') 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 61d40373640c0cabdaef4d4381ac5ae636fab642 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 01:56:21 +0000 Subject: Detect Windows CE target and build/include libc_wince files as necessary. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1561 --- src/Makefile.am | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 63ddc98f..64e23b79 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -170,6 +170,7 @@ chocolate_doom_SOURCES=$(SOURCE_FILES) endif chocolate_doom_LDADD = \ + ../wince/libc_wince.a \ ../textscreen/libtextscreen.a \ ../pcsound/libpcsound.a \ @LDFLAGS@ \ -- cgit v1.2.3 From 45359954fe5054f27637962a272177d9c8115b90 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 02:10:21 +0000 Subject: Use MessageBoxW instead of MessageBox (doesn't exist on Windows CE) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1563 --- src/i_system.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/i_system.c b/src/i_system.c index fe596a60..07218142 100644 --- a/src/i_system.c +++ b/src/i_system.c @@ -246,13 +246,18 @@ void I_Error (char *error, ...) // On Windows, pop up a dialog box with the error message. { char msgbuf[512]; + wchar_t wmsgbuf[512]; va_start(argptr, error); memset(msgbuf, 0, sizeof(msgbuf)); vsnprintf(msgbuf, sizeof(msgbuf) - 1, error, argptr); va_end(argptr); - MessageBox(NULL, msgbuf, "Error", MB_OK); + MultiByteToWideChar(CP_ACP, 0, + msgbuf, strlen(msgbuf) + 1, + wmsgbuf, sizeof(wmsgbuf)); + + MessageBoxW(NULL, wmsgbuf, L"Error", MB_OK); } #endif -- cgit v1.2.3 From 5a1443a3685eb02b3b97b0be74ebf5936546d02b Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 14:20:46 +0000 Subject: Exit with an error on failure to allocate zone memory. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1564 --- src/i_system.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/i_system.c b/src/i_system.c index 07218142..714f63cc 100644 --- a/src/i_system.c +++ b/src/i_system.c @@ -95,6 +95,11 @@ byte *I_ZoneBase (int *size) *size = I_GetHeapSize(); zonemem = malloc(*size); + + if (zonemem == NULL) + { + I_Error("Failed to allocate %i bytes for zone memory", *size); + } printf("zone memory: %p, %x allocated for zone\n", zonemem, *size); -- cgit v1.2.3 From 7b7076a20c7042b2f71c82317bfbc48e8854dd32 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 14:35:27 +0000 Subject: Add IWAD search dirs for Windows CE. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1565 --- src/d_iwad.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/d_iwad.c b/src/d_iwad.c index 8794e9be..d1c2f0bf 100644 --- a/src/d_iwad.c +++ b/src/d_iwad.c @@ -487,7 +487,14 @@ static void BuildIWADDirList(void) AddDoomWadPath(); -#if defined(_WIN32) && !defined(_WIN32_WCE) +#if defined(_WIN32_WCE) + + // Windows CE locations: + + AddIWADDir("\\Storage Card"); + AddIWADDir(getenv("HOME")); + +#elif defined(_WIN32) // Search the registry and find where IWADs have been installed. -- cgit v1.2.3 From fdfff2b9e72c8a1d3975277cad80b9d3afec032f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 15:15:40 +0000 Subject: Remove call to setbuf. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1566 --- src/d_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/d_main.c b/src/d_main.c index 849897fe..29a366a1 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -878,8 +878,7 @@ void D_DoomMain (void) I_Error("Game mode indeterminate. No IWAD file was found. Try\n" "specifying one with the '-iwad' command line parameter.\n"); } - - setbuf (stdout, NULL); + modifiedgame = false; //! -- cgit v1.2.3 From ad9f8107f4d9d4ea636eb238205f31270cc1514a Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 16:35:43 +0000 Subject: Don't try to use the SDL DirectX driver under Windows CE. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1568 --- src/i_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/i_video.c b/src/i_video.c index 0ed4d716..fa7dfff9 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1353,7 +1353,7 @@ static void SetSDLVideoDriver(void) free(env_string); } -#ifdef _WIN32 +#if defined(_WIN32) && !defined(_WIN32_WCE) // Allow -gdi as a shortcut for using the windib driver. -- cgit v1.2.3 From 5d99eee5a4509f42d635156bfb1d6c495d8de221 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 17:10:05 +0000 Subject: Make auto-adjust code switch to windowed mode if no fullscreen modes are available. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1571 --- src/i_video.c | 196 +++++++++++++++++++++++++++++++++------------------------- 1 file changed, 113 insertions(+), 83 deletions(-) (limited to 'src') diff --git a/src/i_video.c b/src/i_video.c index fa7dfff9..c3055b5d 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -964,125 +964,155 @@ static screen_mode_t *I_FindScreenMode(int w, int h) return best_mode; } -// If the video mode set in the configuration file is not available, -// try to choose a different mode. +// Adjust to an appropriate fullscreen mode. +// Returns true if successful. -static void I_AutoAdjustSettings(void) +static boolean AutoAdjustFullscreen(void) { - if (fullscreen) - { - SDL_Rect **modes; - SDL_Rect *best_mode; - screen_mode_t *screen_mode; - int target_pixels, diff, best_diff; - int i; - - modes = SDL_ListModes(NULL, SDL_FULLSCREEN); - - // Find the best mode that matches the mode specified in the - // configuration file - - best_mode = NULL; - best_diff = INT_MAX; - target_pixels = screen_width * screen_height; + SDL_Rect **modes; + SDL_Rect *best_mode; + screen_mode_t *screen_mode; + int target_pixels, diff, best_diff; + int i; - for (i=0; modes[i] != NULL; ++i) - { - //printf("%ix%i?\n", modes[i]->w, modes[i]->h); + modes = SDL_ListModes(NULL, SDL_FULLSCREEN); - // What screen_mode_t would be used for this video mode? + // No fullscreen modes available at all? - screen_mode = I_FindScreenMode(modes[i]->w, modes[i]->h); + if (modes == NULL || modes == (SDL_Rect **) -1 || *modes == NULL) + { + return false; + } - // Never choose a screen mode that we cannot run in, or - // is poor quality for fullscreen + // Find the best mode that matches the mode specified in the + // configuration file - if (screen_mode == NULL || screen_mode->poor_quality) - { - // printf("\tUnsupported / poor quality\n"); - continue; - } + best_mode = NULL; + best_diff = INT_MAX; + target_pixels = screen_width * screen_height; - // Do we have the exact mode? - // If so, no autoadjust needed + for (i=0; modes[i] != NULL; ++i) + { + //printf("%ix%i?\n", modes[i]->w, modes[i]->h); - if (screen_width == modes[i]->w && screen_height == modes[i]->h) - { - // printf("\tExact mode!\n"); - return; - } + // What screen_mode_t would be used for this video mode? - // Is this mode better than the current mode? + screen_mode = I_FindScreenMode(modes[i]->w, modes[i]->h); - diff = (screen_width - modes[i]->w) - * (screen_width - modes[i]->w) - + (screen_height - modes[i]->h) - * (screen_height - modes[i]->h); + // Never choose a screen mode that we cannot run in, or + // is poor quality for fullscreen - if (diff < best_diff) - { - // printf("\tA valid mode\n"); - best_mode = modes[i]; - best_diff = diff; - } + if (screen_mode == NULL || screen_mode->poor_quality) + { + // printf("\tUnsupported / poor quality\n"); + continue; } - if (best_mode == NULL) - { - // Unable to find a valid mode! + // Do we have the exact mode? + // If so, no autoadjust needed - I_Error("Unable to find any valid video mode at all!"); + if (screen_width == modes[i]->w && screen_height == modes[i]->h) + { + // printf("\tExact mode!\n"); + return true; } - printf("I_InitGraphics: %ix%i mode not supported on this machine.\n", - screen_width, screen_height); + // Is this mode better than the current mode? - screen_width = best_mode->w; - screen_height = best_mode->h; + diff = (screen_width - modes[i]->w) * (screen_width - modes[i]->w) + + (screen_height - modes[i]->h) * (screen_height - modes[i]->h); + if (diff < best_diff) + { + // printf("\tA valid mode\n"); + best_mode = modes[i]; + best_diff = diff; + } } - else + + if (best_mode == NULL) { - screen_mode_t *best_mode; + // Unable to find a valid mode! - // - // Windowed mode. - // - // Find a screen_mode_t to fit within the current settings - // + return false; + } - best_mode = I_FindScreenMode(screen_width, screen_height); + printf("I_InitGraphics: %ix%i mode not supported on this machine.\n", + screen_width, screen_height); - if (best_mode == NULL) - { - // Nothing fits within the current settings. - // Pick the closest to 320x200 possible. + screen_width = best_mode->w; + screen_height = best_mode->h; - best_mode = I_FindScreenMode(SCREENWIDTH, SCREENHEIGHT_4_3); - } + return true; +} - // Do we have the exact mode already? +// Auto-adjust to a valid windowed mode. - if (best_mode->width == screen_width - && best_mode->height == screen_height) - { - return; - } +static void AutoAdjustWindowed(void) +{ + screen_mode_t *best_mode; + // Find a screen_mode_t to fit within the current settings + + best_mode = I_FindScreenMode(screen_width, screen_height); + + if (best_mode == NULL) + { + // Nothing fits within the current settings. + // Pick the closest to 320x200 possible. + + best_mode = I_FindScreenMode(SCREENWIDTH, SCREENHEIGHT_4_3); + } + + // Switch to the best mode if necessary. + + if (best_mode->width != screen_width || best_mode->height != screen_height) + { printf("I_InitGraphics: Cannot run at specified mode: %ix%i\n", screen_width, screen_height); screen_width = best_mode->width; screen_height = best_mode->height; } +} - printf("I_InitGraphics: Auto-adjusted to %ix%i.\n", - screen_width, screen_height); +// If the video mode set in the configuration file is not available, +// try to choose a different mode. + +static void I_AutoAdjustSettings(void) +{ + int old_screen_w, old_screen_h; + + old_screen_w = screen_width; + old_screen_h = screen_height; + + // If we are running fullscreen, try to autoadjust to a valid fullscreen + // mode. If this is impossible, switch to windowed. + + if (fullscreen && !AutoAdjustFullscreen()) + { + fullscreen = 0; + } - printf("NOTE: Your video settings have been adjusted. " - "To disable this behavior,\n" - "set autoadjust_video_settings to 0 in your " - "configuration file.\n"); + // If we are running windowed, pick a valid window size. + + if (!fullscreen) + { + AutoAdjustWindowed(); + } + + // Have the settings changed? Show a message. + + if (screen_width != old_screen_w || screen_height != old_screen_h) + { + printf("I_InitGraphics: Auto-adjusted to %ix%i.\n", + screen_width, screen_height); + + printf("NOTE: Your video settings have been adjusted. " + "To disable this behavior,\n" + "set autoadjust_video_settings to 0 in your " + "configuration file.\n"); + } } // Set video size to a particular scale factor (1x, 2x, 3x, etc.) -- cgit v1.2.3 From 0e3e4653f8df775fdd41e18e956f465fd334f275 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 17:53:25 +0000 Subject: Use home dir to store configuration and savegames under Windows CE. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1573 --- src/m_config.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/m_config.c b/src/m_config.c index be329cba..5bc46ca3 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -1313,9 +1313,11 @@ void M_LoadDefaults (void) void M_SetConfigDir(void) { -#ifndef _WIN32 - // Ignore the HOME environment variable on Windows - just behave - // like Vanilla Doom. +#if !defined(_WIN32) || defined(_WIN32_WCE) + + // Configuration settings are stored in ~/.chocolate-doom/, + // except on Windows, where we behave like Vanilla Doom and + // save in the current directory. char *homedir; @@ -1338,7 +1340,7 @@ void M_SetConfigDir(void) else #endif /* #ifndef _WIN32 */ { -#ifdef _WIN32 +#if defined(_WIN32) && !defined(_WIN32_WCE) //! // @platform windows // @vanilla -- cgit v1.2.3 From bdeaec12d0f79c5cd15b49105a11988ac5ec545c Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 7 Jun 2009 23:41:10 +0000 Subject: Use CreateFileW instead of OpenFile (doesn't exist on Windows CE) Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1576 --- src/w_file_win32.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/w_file_win32.c b/src/w_file_win32.c index d5e60579..ec17cf6c 100644 --- a/src/w_file_win32.c +++ b/src/w_file_win32.c @@ -94,12 +94,24 @@ unsigned int GetFileLength(HANDLE handle) static wad_file_t *W_Win32_OpenFile(char *path) { win32_wad_file_t *result; + wchar_t wpath[MAX_PATH + 1]; HANDLE handle; - OFSTRUCT fileinfo; - handle = (HANDLE) OpenFile(path, &fileinfo, OF_READ); + // Open the file: - if (handle == (HANDLE) HFILE_ERROR) + MultiByteToWideChar(CP_OEMCP, 0, + path, strlen(path) + 1, + wpath, sizeof(wpath)); + + handle = CreateFileW(wpath, + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); + + if (handle == INVALID_HANDLE_VALUE) { return NULL; } -- cgit v1.2.3 From a91a1c60f544d26195c2df9dd9cd1ef042deacf9 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Mon, 8 Jun 2009 18:15:57 +0000 Subject: Use SDL's getenv/putenv implementation, and populate at startup. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1577 --- src/i_main.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/i_main.c b/src/i_main.c index e1de5881..03f8a5ac 100644 --- a/src/i_main.c +++ b/src/i_main.c @@ -133,6 +133,15 @@ int main(int argc, char **argv) myargc = argc; myargv = argv; +#ifdef _WIN32_WCE + + // Windows CE has no environment, but SDL provides an implementation. + // Populate the environment with the values we normally find. + + PopulateEnvironment(); + +#endif + // Only schedule on a single core, if we have multiple // cores. This is to work around a bug in SDL_mixer. -- cgit v1.2.3