X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fmain.h;h=d794d2372f7cfe5e89b93d1e52e42912194dc7a8;hb=2357c391b4a587709627cc30316734b3c83c8134;hp=ef25edc87996da6e09ab7e8bea0fb3d8067699c1;hpb=c4b26cf489dcc65a00bfcc05f7898700d2f0c9e4;p=rocksndiamonds.git diff --git a/src/main.h b/src/main.h index ef25edc8..d794d237 100644 --- a/src/main.h +++ b/src/main.h @@ -35,9 +35,9 @@ #ifdef XPM_INCLUDE_FILE #include XPM_INCLUDE_FILE #endif -#else +#else /* MSDOS */ #include "msdos.h" -#endif /* #ifndef MSDOS */ +#endif /* MSDOS */ typedef unsigned char boolean; typedef unsigned char byte; @@ -52,10 +52,10 @@ typedef unsigned char byte; #ifndef MSDOS #define WIN_XPOS 0 #define WIN_YPOS 0 -#else +#else /* MSDOS */ #define WIN_XPOS ((XRES - WIN_XSIZE) / 2) #define WIN_YPOS ((YRES - WIN_YSIZE) / 2) -#endif +#endif /* MSDOS */ #define SCR_FIELDX 17 #define SCR_FIELDY 17 #define MAX_BUF_XSIZE (SCR_FIELDX + 2) @@ -82,6 +82,7 @@ typedef unsigned char byte; #ifndef SIGN #define SIGN(a) ((a) < 0 ? -1 : ((a)>0 ? 1 : 0)) #endif + #define SCREENX(a) ((a) - scroll_x) #define SCREENY(a) ((a) - scroll_y) #define LEVELX(a) ((a) + scroll_x) @@ -219,6 +220,9 @@ struct OptionInfo struct SetupJoystickInfo { + char device_name[MAX_FILENAME_LEN]; + int xleft, xmiddle, xright; + int yupper, ymiddle, ylower; int snap; int bomb; }; @@ -233,26 +237,32 @@ struct SetupKeyboardInfo KeySym bomb; }; +struct SetupInputInfo +{ + boolean use_joystick; + struct SetupJoystickInfo joy; + struct SetupKeyboardInfo key; +}; + struct SetupInfo { - boolean sound_on; - boolean sound_loops_on; - boolean sound_music_on; - boolean sound_simple_on; - boolean toons_on; - boolean direct_draw_on; - boolean scroll_delay_on; - boolean soft_scrolling_on; - boolean fading_on; - boolean autorecord_on; + boolean sound; + boolean sound_loops; + boolean sound_music; + boolean sound_simple; + boolean toons; + boolean double_buffering; + boolean direct_draw; /* !double_buffering (redundant!) */ + boolean scroll_delay; + boolean soft_scrolling; + boolean fading; + boolean autorecord; boolean quick_doors; - struct - { - boolean use_joystick; - int joystick_nr; - struct SetupJoystickInfo joy; - struct SetupKeyboardInfo key; - } input[MAX_PLAYERS]; + + char login_name[MAX_NAMELEN]; + char alias_name[MAX_NAMELEN]; + + struct SetupInputInfo input[MAX_PLAYERS]; }; struct SetupFileList @@ -265,26 +275,15 @@ struct SetupFileList struct PlayerInfo { boolean present; /* player present in level playfield */ - boolean connected; /* player connected locally or via network */ - boolean local; /* player connected locally */ + boolean connected; /* player connected (locally or via network) */ boolean active; /* player (present && connected) */ int index_nr, client_nr, element_nr; - byte action; - - char login_name[MAX_NAMELEN]; - char alias_name[MAX_NAMELEN]; - - -#if 0 - int handicap; - unsigned int setup; -#endif + byte action; /* action from server or for local playing */ + byte potential_action; /* must go to network server first */ - - int leveldir_nr; - int level_nr; + int joystick_fd; /* file descriptor of player's joystick */ int jx,jy, last_jx,last_jy; int MovDir, MovPos, GfxPos; @@ -357,12 +356,6 @@ struct RecordingInfo } pos[MAX_TAPELEN]; }; -struct JoystickInfo -{ - int xleft, xright, xmiddle; - int yupper, ylower, ymiddle; -}; - extern Display *display; extern Visual *visual; extern int screen; @@ -382,7 +375,7 @@ extern int sound_pipe[2]; extern int sound_device; extern char *sound_device_name; extern int joystick_device; -extern char *joystick_device_name[2]; +extern char *joystick_device_name[]; extern char *level_directory; extern int width, height; @@ -1243,4 +1236,4 @@ extern int num_bg_loops; #define ANIM_OSCILLATE 1 #define ANIM_REVERSE 2 -#endif +#endif /* MAIN_H */