From 74b5b6c19587f93c45b72b1153154030dc99b50d Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 15 Aug 2000 15:18:44 +0200 Subject: [PATCH] rnd-20000815-1-src --- src/editor.c | 15 +++++--- src/events.c | 2 +- src/files.c | 30 ++++++++++++++- src/files.h | 2 +- src/game.c | 12 +++--- src/init.c | 33 ++++++++++------ src/main.h | 6 +-- src/misc.c | 103 ++++++++++++++++++++++++++++++++++++++++---------- src/netserv.c | 4 +- src/network.c | 4 +- src/screens.c | 8 +++- src/sdl.c | 6 +-- src/sdl.h | 5 ++- src/sound.c | 34 +++++++++++------ src/system.c | 17 +++++++-- src/tape.c | 2 +- src/tools.c | 4 +- src/x11.h | 3 ++ 18 files changed, 213 insertions(+), 77 deletions(-) diff --git a/src/editor.c b/src/editor.c index bb729811..669991b7 100644 --- a/src/editor.c +++ b/src/editor.c @@ -3511,7 +3511,8 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) { CopyAreaToBrush(start_sx, start_sy, sx, sy, button); CopyBrushToCursor(sx, sy); - ClickOnGadget(level_editor_gadget[GADGET_ID_SINGLE_ITEMS],MB_LEFT); + ClickOnGadget(level_editor_gadget[GADGET_ID_SINGLE_ITEMS], + MB_LEFTBUTTON); draw_with_brush = TRUE; } else if (drawing_function == GADGET_ID_TEXT) @@ -3540,7 +3541,8 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) case GADGET_ID_PICK_ELEMENT: if (button_release_event) - ClickOnGadget(level_editor_gadget[last_drawing_function], MB_LEFT); + ClickOnGadget(level_editor_gadget[last_drawing_function], + MB_LEFTBUTTON); else PickDrawingElement(button, Feld[lx][ly]); @@ -3943,7 +3945,8 @@ static void HandleControlButtons(struct GadgetInfo *gi) } if (drawing_function == GADGET_ID_PICK_ELEMENT) - ClickOnGadget(level_editor_gadget[last_drawing_function], MB_LEFT); + ClickOnGadget(level_editor_gadget[last_drawing_function], + MB_LEFTBUTTON); } #ifdef DEBUG else if (gi->event.type == GD_EVENT_PRESSED) @@ -3962,7 +3965,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) void HandleLevelEditorKeyInput(Key key) { char letter = getCharFromKey(key); - int button = MB_LEFT; + int button = MB_LEFTBUTTON; if (drawing_function == GADGET_ID_TEXT && DrawLevelText(0, 0, 0, TEXT_QUERY_TYPING) == TRUE) @@ -3994,11 +3997,11 @@ void HandleLevelEditorKeyInput(Key key) break; case KEY_Page_Up: id = GADGET_ID_SCROLL_LIST_UP; - button = 3; + button = MB_RIGHTBUTTON; break; case KEY_Page_Down: id = GADGET_ID_SCROLL_LIST_DOWN; - button = 3; + button = MB_RIGHTBUTTON; break; default: diff --git a/src/events.c b/src/events.c index e2f9db8e..d7466911 100644 --- a/src/events.c +++ b/src/events.c @@ -714,7 +714,7 @@ void HandleNoXEvent() return; } -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) HandleNetworking(); #endif diff --git a/src/files.c b/src/files.c index 9870c828..f1872c68 100644 --- a/src/files.c +++ b/src/files.c @@ -63,9 +63,33 @@ #define LEVELFILE_EXTENSION "lvl" #define TAPEFILE_EXTENSION "tap" #define SCOREFILE_EXTENSION "sco" +#endif + +#if defined(MSDOS) || defined(WIN32) #define ERROR_FILENAME "error.out" #endif +#ifdef WIN32 +#ifndef S_IRGRP +#define S_IRGRP S_IRUSR +#endif +#ifndef S_IROTH +#define S_IROTH S_IRUSR +#endif +#ifndef S_IWGRP +#define S_IWGRP S_IWUSR +#endif +#ifndef S_IWOTH +#define S_IWOTH S_IWUSR +#endif +#ifndef S_IXGRP +#define S_IXGRP S_IXUSR +#endif +#ifndef S_IXOTH +#define S_IXOTH S_IXUSR +#endif +#endif + /* file permissions for newly written files */ #define MODE_R_ALL (S_IRUSR | S_IRGRP | S_IROTH) #define MODE_W_ALL (S_IWUSR | S_IWGRP | S_IWOTH) @@ -323,7 +347,11 @@ static char *getScoreFilename(int nr) static void createDirectory(char *dir, char *text) { if (access(dir, F_OK) != 0) +#ifdef WIN32 + if (mkdir(dir) != 0) +#else if (mkdir(dir, USERDATA_DIR_MODE) != 0) +#endif Error(ERR_WARN, "cannot create %s directory '%s'", text, dir); } @@ -2185,7 +2213,7 @@ void SaveLevelSetup_SeriesInfo() chmod(filename, SETUP_PERMS); } -#ifdef MSDOS +#if defined(MSDOS) || defined(WIN32) void initErrorFile() { char *filename; diff --git a/src/files.h b/src/files.h index 35fa3f10..c87b3309 100644 --- a/src/files.h +++ b/src/files.h @@ -33,7 +33,7 @@ void SaveLevelSetup_LastSeries(void); void LoadLevelSetup_SeriesInfo(void); void SaveLevelSetup_SeriesInfo(void); -#ifdef MSDOS +#if defined(MSDOS) || defined(WIN32) void initErrorFile(); FILE *openErrorFile(); void dumpErrorFile(); diff --git a/src/game.c b/src/game.c index 7c6cf159..fa5942ff 100644 --- a/src/game.c +++ b/src/game.c @@ -502,7 +502,7 @@ void InitGame() network_player_action_received = FALSE; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) /* initial null action */ if (network_playing) SendToServer_MovePlayer(MV_NO_MOVING); @@ -4240,7 +4240,7 @@ void GameActions() #endif */ -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) /* last chance to get network player actions without main loop delay */ HandleNetworking(); #endif @@ -4277,7 +4277,7 @@ void GameActions() stored_player[i].effective_action = stored_player[i].action; } -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (network_playing) SendToServer_MovePlayer(summarized_player_action); #endif @@ -6162,7 +6162,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) Request("Do you really want to quit the game ?", REQ_ASK | REQ_STAY_CLOSED)) { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) SendToServer_StopPlaying(); else @@ -6179,7 +6179,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) case GAME_CTRL_ID_PAUSE: if (options.network) { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (tape.pausing) SendToServer_ContinuePlaying(); else @@ -6193,7 +6193,7 @@ static void HandleGameButtons(struct GadgetInfo *gi) case GAME_CTRL_ID_PLAY: if (tape.pausing) { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) SendToServer_ContinuePlaying(); else diff --git a/src/init.c b/src/init.c index 64f74801..114f61c0 100644 --- a/src/init.c +++ b/src/init.c @@ -41,7 +41,9 @@ struct IconFileInfo char *picturemask_filename; }; +#ifndef USE_SDL_LIBRARY static int sound_process_id = 0; +#endif static void InitLevelAndPlayerInfo(void); static void InitNetworkServer(void); @@ -56,13 +58,17 @@ static void InitElementProperties(void); void OpenAll(int argc, char *argv[]) { -#ifdef MSDOS +#if defined(MSDOS) || defined(WIN32) initErrorFile(); #endif if (options.serveronly) { +#ifdef WIN32 + Error(ERR_WARN, "networking not supported in Windows version"); +#else NetworkServer(options.server_port, options.serveronly); +#endif /* never reached */ exit(0); @@ -119,14 +125,14 @@ void InitLevelAndPlayerInfo() void InitNetworkServer() { -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) int nr_wanted; #endif if (!options.network) return; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) nr_wanted = Request("Choose player", REQ_PLAYER | REQ_STAY_CLOSED); if (!ConnectToServer(options.server_host, options.server_port)) @@ -172,7 +178,7 @@ void InitSound() #else /* !USE_SDL_LIBRARY */ -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (access(sound_device_name, W_OK) != 0) { Error(ERR_WARN, "cannot access sound device - no sounds"); @@ -198,14 +204,14 @@ void InitSound() */ #endif -#else /* MSDOS */ +#else /* MSDOS || WIN32 */ sound_loops_allowed = TRUE; /* setup.sound_loops_on = TRUE; */ -#endif /* MSDOS */ +#endif /* MSDOS || WIN32 */ #endif /* !USE_SDL_LIBRARY */ for(i=0; i #include #include -#include #include #include #include +#ifndef WIN32 +#include +#include +#endif + #include "misc.h" #include "init.h" #include "tools.h" @@ -39,11 +42,31 @@ END_OF_FUNCTION(increment_counter); #endif - /* maximal allowed length of a command line option */ #define MAX_OPTION_LEN 256 +#ifdef USE_SDL_LIBRARY + +static unsigned long mainCounter(int mode) +{ + static unsigned long base_ms = 0; + unsigned long current_ms; + unsigned long counter_ms; + + current_ms = SDL_GetTicks(); + + /* reset base time in case of counter initializing or wrap-around */ + if (mode == INIT_COUNTER || current_ms < base_ms) + base_ms = current_ms; + + counter_ms = current_ms - base_ms; + + return counter_ms; /* return milliseconds since last init */ +} + +#else /* !USE_SDL_LIBRARY */ #ifndef MSDOS + static unsigned long mainCounter(int mode) { static struct timeval base_time = { 0, 0 }; @@ -52,6 +75,7 @@ static unsigned long mainCounter(int mode) gettimeofday(¤t_time, NULL); + /* reset base time in case of counter initializing or wrap-around */ if (mode == INIT_COUNTER || current_time.tv_sec < base_time.tv_sec) base_time = current_time; @@ -60,7 +84,9 @@ static unsigned long mainCounter(int mode) return counter_ms; /* return milliseconds since last init */ } -#endif + +#endif /* !MSDOS */ +#endif /* !USE_SDL_LIBRARY */ void InitCounter() /* set counter back to zero */ { @@ -87,7 +113,7 @@ static void sleep_milliseconds(unsigned long milliseconds_delay) boolean do_busy_waiting = (milliseconds_delay < 5 ? TRUE : FALSE); #ifdef MSDOS - /* donĂ¯t use select() to perform waiting operations under DOS/Windows + /* don't use select() to perform waiting operations under DOS/Windows environment; always use a busy loop for waiting instead */ do_busy_waiting = TRUE; #endif @@ -107,6 +133,9 @@ static void sleep_milliseconds(unsigned long milliseconds_delay) } else { +#ifdef USE_SDL_LIBRARY + SDL_Delay(milliseconds_delay); +#else /* !USE_SDL_LIBRARY */ struct timeval delay; delay.tv_sec = milliseconds_delay / 1000; @@ -114,6 +143,7 @@ static void sleep_milliseconds(unsigned long milliseconds_delay) if (select(0, NULL, NULL, NULL, &delay) != 0) Error(ERR_WARN, "sleep_milliseconds(): select() failed"); +#endif /* !USE_SDL_LIBRARY */ } } @@ -198,12 +228,25 @@ char *int2str(int number, int size) unsigned int SimpleRND(unsigned int max) { +#ifdef USE_SDL_LIBRARY + + static unsigned long root = 654321; + unsigned long current_ms; + + current_ms = SDL_GetTicks(); + root = root * 4253261 + current_ms; + return (root % max); + +#else /* !USE_SDL_LIBRARY */ + static unsigned long root = 654321; struct timeval current_time; - gettimeofday(¤t_time,NULL); + gettimeofday(¤t_time, NULL); root = root * 4253261 + current_time.tv_sec + current_time.tv_usec; return (root % max); + +#endif /* !USE_SDL_LIBRARY */ } #ifdef DEBUG @@ -226,34 +269,56 @@ unsigned int RND(unsigned int max) unsigned int InitRND(long seed) { +#ifdef USE_SDL_LIBRARY + unsigned long current_ms; + + if (seed == NEW_RANDOMIZE) + { + current_ms = SDL_GetTicks(); + srandom_linux_libc((unsigned int) current_ms); + return (unsigned int) current_ms; + } + else + { + srandom_linux_libc((unsigned int) seed); + return (unsigned int) seed; + } +#else /* !USE_SDL_LIBRARY */ struct timeval current_time; if (seed == NEW_RANDOMIZE) { - gettimeofday(¤t_time,NULL); + gettimeofday(¤t_time, NULL); srandom_linux_libc((unsigned int) current_time.tv_usec); - return (unsigned int)current_time.tv_usec; + return (unsigned int) current_time.tv_usec; } else { srandom_linux_libc((unsigned int) seed); - return (unsigned int)seed; + return (unsigned int) seed; } +#endif /* !USE_SDL_LIBRARY */ } char *getLoginName() { +#ifdef WIN32 + return ANONYMOUS_NAME; +#else struct passwd *pwd; if ((pwd = getpwuid(getuid())) == NULL) return ANONYMOUS_NAME; else return pwd->pw_name; +#endif } char *getRealName() { -#ifndef MSDOS +#if defined(MSDOS) || defined(WIN32) + return ANONYMOUS_NAME; +#else struct passwd *pwd; if ((pwd = getpwuid(getuid())) == NULL || strlen(pwd->pw_gecos) == 0) @@ -283,14 +348,14 @@ char *getRealName() return real_name; } -#else - return ANONYMOUS_NAME; #endif } char *getHomeDir() { -#ifndef MSDOS +#if defined(MSDOS) || defined(WIN32) + return "."; +#else static char *home_dir = NULL; if (!home_dir) @@ -307,8 +372,6 @@ char *getHomeDir() } return home_dir; -#else - return "."; #endif } @@ -524,7 +587,7 @@ void Error(int mode, char *format, ...) if (mode & ERR_WARN && !options.verbose) return; -#ifdef MSDOS +#if defined(MSDOS) || defined(WIN32) if ((error = openErrorFile()) == NULL) { printf("Cannot write to error output file!\n"); @@ -722,8 +785,10 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode) { KEY_Meta_R, "XK_Meta_R", "right meta" }, { KEY_Alt_L, "XK_Alt_L", "left alt" }, { KEY_Alt_R, "XK_Alt_R", "right alt" }, - { KEY_Mode_switch, "XK_Mode_switch", "mode switch" }, - { KEY_Multi_key, "XK_Multi_key", "multi key" }, + { KEY_Super_L, "XK_Super_L", "left super" }, /* Win-L */ + { KEY_Super_R, "XK_Super_R", "right super" }, /* Win-R */ + { KEY_Mode_switch, "XK_Mode_switch", "mode switch" }, /* Alt-R */ + { KEY_Multi_key, "XK_Multi_key", "multi key" }, /* Ctrl-R */ /* some special keys */ { KEY_BackSpace, "XK_BackSpace", "backspace" }, @@ -734,7 +799,7 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode) { KEY_End, "XK_End", "end" }, { KEY_Page_Up, "XK_Page_Up", "page up" }, { KEY_Page_Down, "XK_Page_Down", "page down" }, - + { KEY_Menu, "XK_Menu", "menu" }, /* Win-Menu */ /* ASCII 0x20 to 0x40 keys (except numbers) */ { KEY_space, "XK_space", "space" }, diff --git a/src/netserv.c b/src/netserv.c index ac142763..10b0ab50 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -11,7 +11,7 @@ * network.c * ***********************************************************/ -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) #include #include @@ -661,4 +661,4 @@ void NetworkServer(int port, int serveronly) } } -#endif /* !MSDOS */ +#endif /* !MSDOS && !WIN32 */ diff --git a/src/network.c b/src/network.c index 5534c56f..70720ea2 100644 --- a/src/network.c +++ b/src/network.c @@ -11,7 +11,7 @@ * network.c * ***********************************************************/ -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) #include #include @@ -615,4 +615,4 @@ void HandleNetworking() } } -#endif /* !MSDOS */ +#endif /* !MSDOS && !WIN32 */ diff --git a/src/screens.c b/src/screens.c index eb550cb9..2e206e21 100644 --- a/src/screens.c +++ b/src/screens.c @@ -327,7 +327,7 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) if (setup.autorecord) TapeStartRecording(); -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) SendToServer_StartPlaying(); else @@ -1904,8 +1904,12 @@ void CustomizeKeyboard(int player_nr) break; } + /* all keys configured -- wait for "Escape" or "Return" key */ + if (step_nr == 6) + break; + /* press 'Enter' to keep the existing key binding */ - if (key == KEY_Return || step_nr == 6) + if (key == KEY_Return) key = *customize_step[step_nr].key; /* check if key already used */ diff --git a/src/sdl.c b/src/sdl.c index f782961d..c37cbff1 100644 --- a/src/sdl.c +++ b/src/sdl.c @@ -35,9 +35,9 @@ inline void SDLCopyArea(SDL_Surface *src_surface, SDL_Surface *dst_surface, dst_rect.h = height; SDL_BlitSurface(src_surface, &src_rect, dst_surface, &dst_rect); -#if 1 - SDL_UpdateRect(dst_surface, dst_x, dst_y, width, height); -#endif + + if (dst_surface == window) + SDL_UpdateRect(dst_surface, dst_x, dst_y, width, height); } inline void SDLFillRectangle(SDL_Surface *surface, int x, int y, diff --git a/src/sdl.h b/src/sdl.h index d6800fa9..0b39620d 100644 --- a/src/sdl.h +++ b/src/sdl.h @@ -96,8 +96,10 @@ typedef int Colormap; #define KEY_Meta_R SDLK_RMETA #define KEY_Alt_L SDLK_LALT #define KEY_Alt_R SDLK_RALT +#define KEY_Super_L SDLK_LSUPER +#define KEY_Super_R SDLK_RSUPER #define KEY_Mode_switch SDLK_MODE -#define KEY_Multi_key KEY_UNDEFINED /* undefined */ +#define KEY_Multi_key SDLK_RCTRL #define KEY_BackSpace SDLK_BACKSPACE #define KEY_Delete SDLK_DELETE @@ -107,6 +109,7 @@ typedef int Colormap; #define KEY_End SDLK_END #define KEY_Page_Up SDLK_PAGEUP #define KEY_Page_Down SDLK_PAGEDOWN +#define KEY_Menu SDLK_MENU #define KEY_space SDLK_SPACE #define KEY_exclam SDLK_EXCLAIM diff --git a/src/sound.c b/src/sound.c index d2cdbc72..6db2f633 100644 --- a/src/sound.c +++ b/src/sound.c @@ -23,7 +23,7 @@ static struct SoundControl emptySoundControl = -1,0,0, FALSE,FALSE,FALSE,FALSE,FALSE, 0,0L,0L,NULL }; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) static int stereo_volume[PSND_MAX_LEFT2RIGHT+1]; static char premix_first_buffer[SND_BLOCKSIZE]; #ifdef VOXWARE @@ -32,21 +32,22 @@ static char premix_right_buffer[SND_BLOCKSIZE]; static int premix_last_buffer[SND_BLOCKSIZE]; #endif /* VOXWARE */ static unsigned char playing_buffer[SND_BLOCKSIZE]; -#endif /* MSDOS */ +#endif /* !MSDOS && !WIN32 */ /* forward declaration of internal functions */ #ifdef VOXWARE static void SoundServer_InsertNewSound(struct SoundControl); #endif -#ifndef VOXWARE -#ifndef MSDOS + +#if !defined(VOXWARE) && !defined(MSDOS) && !defined(WIN32) static unsigned char linear_to_ulaw(int); static int ulaw_to_linear(unsigned char); #endif -#endif + #ifdef HPUX_AUDIO static void HPUX_Audio_Control(); #endif + #ifdef MSDOS static void SoundServer_InsertNewSound(struct SoundControl); static void SoundServer_StopSound(int); @@ -56,7 +57,7 @@ static void SoundServer_StopAllSounds(); void SoundServer() { int i; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) struct SoundControl snd_ctrl; fd_set sound_fdset; @@ -67,7 +68,7 @@ void SoundServer() playlist[i] = emptySoundControl; playing_sounds = 0; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) stereo_volume[PSND_MAX_LEFT2RIGHT] = 0; for(i=0;i=0) { @@ -347,7 +352,9 @@ void SoundServer() #endif /* !VOXWARE */ } -#endif /* !MSDOS */ + +#endif /* !MSDOS && !WIN32 */ + } #ifdef MSDOS @@ -403,6 +410,7 @@ static void sound_handler(struct SoundControl snd_ctrl) } #endif /* MSDOS */ +#ifndef WIN32 static void SoundServer_InsertNewSound(struct SoundControl snd_ctrl) { int i, k; @@ -511,6 +519,7 @@ static void SoundServer_InsertNewSound(struct SoundControl snd_ctrl) } } } +#endif /* !WIN32 */ /* void SoundServer_FadeSound(int nr) @@ -526,6 +535,7 @@ void SoundServer_FadeSound(int nr) } */ +#ifndef WIN32 #ifdef MSDOS static void SoundServer_StopSound(int nr) { @@ -570,6 +580,7 @@ static void SoundServer_StopAllSounds() #endif } #endif /* MSDOS */ +#endif /* !WIN32 */ #ifdef HPUX_AUDIO static void HPUX_Audio_Control() @@ -594,8 +605,8 @@ static void HPUX_Audio_Control() } #endif /* HPUX_AUDIO */ -#ifndef VOXWARE -#ifndef MSDOS +#if !defined(VOXWARE) && !defined(MSDOS) && !defined(WIN32) + /* these two are stolen from "sox"... :) */ /* @@ -699,8 +710,7 @@ static int ulaw_to_linear(unsigned char ulawbyte) return(sample); } -#endif /* !MSDOS */ -#endif /* !VOXWARE */ +#endif /* !VOXWARE && !MSDOS && !WIN32 */ /*** THE STUFF ABOVE IS ONLY USED BY THE SOUND SERVER CHILD PROCESS ***/ diff --git a/src/system.c b/src/system.c index ac337545..cd713c97 100644 --- a/src/system.c +++ b/src/system.c @@ -88,10 +88,6 @@ inline void FlushDisplay() { #ifndef USE_SDL_LIBRARY XFlush(display); -#else -#if 0 - SDL_UpdateRect(window, 0, 0, 0, 0); -#endif #endif } @@ -162,11 +158,24 @@ inline void NextEvent(Event *event) inline Key GetEventKey(KeyEvent *event, boolean with_modifiers) { #ifdef USE_SDL_LIBRARY + /* + printf("unicode == '%d', sym == '%d', mod == '0x%04x'\n", + (int)event->keysym.unicode, + (int)event->keysym.sym, + (int)SDL_GetModState()); + */ + if (with_modifiers && event->keysym.unicode != 0) return event->keysym.unicode; else return event->keysym.sym; #else + /* + printf("with modifiers == '0x%04x', without modifiers == '0x%04x'\n", + (int)XLookupKeysym(event, event->state), + (int)XLookupKeysym(event, 0)); + */ + if (with_modifiers) return XLookupKeysym(event, event->state); else diff --git a/src/tape.c b/src/tape.c index f778c715..4007a147 100644 --- a/src/tape.c +++ b/src/tape.c @@ -416,7 +416,7 @@ static void HandleTapeButtons(struct GadgetInfo *gi) { TapeStartRecording(); -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) if (options.network) SendToServer_StartPlaying(); else diff --git a/src/tools.c b/src/tools.c index 559e06bf..685323c8 100644 --- a/src/tools.c +++ b/src/tools.c @@ -1783,7 +1783,7 @@ boolean Request(char *text, unsigned int req_state) int mx, my, ty, result = -1; unsigned int old_door_state; -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) /* pause network game while waiting for request to answer */ if (options.network && game_status == PLAYING && @@ -2007,7 +2007,7 @@ boolean Request(char *text, unsigned int req_state) RemapAllGadgets(); -#ifndef MSDOS +#if !defined(MSDOS) && !defined(WIN32) /* continue network game after request */ if (options.network && game_status == PLAYING && diff --git a/src/x11.h b/src/x11.h index ae68e343..e0e32dbb 100644 --- a/src/x11.h +++ b/src/x11.h @@ -93,6 +93,8 @@ typedef XClientMessageEvent ClientMessageEvent; #define KEY_Meta_R XK_Meta_R #define KEY_Alt_L XK_Alt_L #define KEY_Alt_R XK_Alt_R +#define KEY_Super_L XK_Super_L +#define KEY_Super_R XK_Super_R #define KEY_Mode_switch XK_Mode_switch #define KEY_Multi_key XK_Multi_key @@ -104,6 +106,7 @@ typedef XClientMessageEvent ClientMessageEvent; #define KEY_End XK_End #define KEY_Page_Up XK_Page_Up #define KEY_Page_Down XK_Page_Down +#define KEY_Menu XK_Menu #define KEY_space XK_space #define KEY_exclam XK_exclam -- 2.34.1