From bcd7c4573dd09a36ad6d4fa6f1caf8702f1e4730 Mon Sep 17 00:00:00 2001 From: Taylor Richards Date: Sun, 25 May 2003 02:30:44 +0000 Subject: [PATCH] Freespace 1 support --- Makefile | 13 +- include/asteroid.h | 14 + include/bmpman.h | 5 +- include/debris.h | 5 +- include/eventmusic.h | 50 ++- include/font.h | 11 +- include/freespace.h | 24 +- include/medals.h | 10 + include/missionbriefcommon.h | 11 + include/missioncampaign.h | 8 +- include/missionparse.h | 7 +- include/modelsinc.h | 7 +- include/multi.h | 8 + include/multiui.h | 10 + include/object.h | 5 +- include/scoring.h | 8 +- include/sexp.h | 5 +- include/ship.h | 5 +- include/starfield.h | 8 + include/systemvars.h | 9 + include/version.h | 13 +- include/weapon.h | 5 +- src/asteroid/asteroid.cpp | 24 +- src/cfile/cfile.cpp | 7 + src/controlconfig/controlsconfig.cpp | 78 +++- src/controlconfig/controlsconfigcommon.cpp | 18 + src/cutscene/cutscenes.cpp | 37 +- src/debris/debris.cpp | 5 + src/freespace2/freespace.cpp | 313 +++++++++++++-- src/gamehelp/contexthelp.cpp | 57 +++ src/gamehelp/gameplayhelp.cpp | 38 +- src/gamesnd/gamesnd.cpp | 5 + src/globalincs/alphacolors.cpp | 5 +- src/globalincs/systemvars.cpp | 15 + src/graphics/font.cpp | 5 + src/hud/hud.cpp | 5 + src/hud/hudconfig.cpp | 217 +++++++++-- src/hud/hudlock.cpp | 27 +- src/hud/hudmessage.cpp | 42 +- src/hud/hudreticle.cpp | 125 ++++-- src/hud/hudtarget.cpp | 13 +- src/hud/hudtargetbox.cpp | 7 +- src/io/joy.cpp | 5 +- src/io/keycontrol.cpp | 74 +++- src/io/mouse.cpp | 5 +- src/menuui/barracks.cpp | 153 +++++++- src/menuui/credits.cpp | 82 +++- src/menuui/mainhallmenu.cpp | 42 +- src/menuui/optionsmenu.cpp | 148 +++++++- src/menuui/optionsmenumulti.cpp | 176 +++++++++ src/menuui/playermenu.cpp | 85 ++++- src/menuui/readyroom.cpp | 150 +++++++- src/menuui/techmenu.cpp | 421 +++++++++++++++++++-- src/mission/missionbriefcommon.cpp | 67 +++- src/mission/missioncampaign.cpp | 39 +- src/mission/missiongoals.cpp | 12 +- src/mission/missionhotkey.cpp | 36 +- src/mission/missionmessage.cpp | 9 +- src/mission/missionparse.cpp | 51 ++- src/missionui/chatbox.cpp | 42 ++ src/missionui/missionbrief.cpp | 146 ++++++- src/missionui/missioncmdbrief.cpp | 56 ++- src/missionui/missiondebrief.cpp | 233 +++++++++++- src/missionui/missionpause.cpp | 15 + src/missionui/missionscreencommon.cpp | 52 ++- src/missionui/missionshipchoice.cpp | 43 ++- src/missionui/missionweaponchoice.cpp | 102 ++++- src/missionui/redalert.cpp | 50 ++- src/model/modelinterp.cpp | 7 + src/nebula/neb.cpp | 5 + src/nebula/neblightning.cpp | 5 + src/network/multi_options.cpp | 5 + src/network/multi_pinfo.cpp | 32 +- src/network/multiteamselect.cpp | 23 +- src/network/multiui.cpp | 388 ++++++++++++++++++- src/network/multiutil.cpp | 11 + src/object/collidedebrisship.cpp | 5 +- src/object/collidedebrisweapon.cpp | 5 +- src/object/collideshipship.cpp | 5 +- src/object/objcollide.cpp | 5 +- src/osapi/osregistry-unix.cpp | 18 +- src/parse/encrypt.cpp | 7 +- src/parse/parselo.cpp | 25 +- src/parse/sexp.cpp | 10 +- src/particle/particle.cpp | 5 +- src/playerman/managepilot.cpp | 47 ++- src/playerman/playercontrol.cpp | 7 + src/popup/popup.cpp | 57 +++ src/popup/popupdead.cpp | 33 ++ src/ship/aicode.cpp | 5 +- src/ship/ship.cpp | 15 +- src/ship/shipfx.cpp | 9 +- src/starfield/nebula.cpp | 6 + src/starfield/starfield.cpp | 24 ++ src/stats/medals.cpp | 202 +++++++++- src/stats/scoring.cpp | 7 + src/ui/gadget.cpp | 12 +- src/weapon/beam.cpp | 5 +- src/weapon/weapons.cpp | 50 ++- 99 files changed, 4240 insertions(+), 378 deletions(-) diff --git a/Makefile b/Makefile index 69f8bf9..eb63584 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ # for that freespace 2 thing MACOSX=false +FS1=false DEMO=false MVE=false @@ -25,9 +26,19 @@ else LDFLAGS+= -lGL endif +ifeq ($(strip $(FS1)), true) + FS_BINARY=freespace + FS_DEMO_BINARY=freespace_demo + CFLAGS += -DMAKE_FS1 +endif + ifeq ($(strip $(DEMO)), true) FS_BINARY=$(FS_DEMO_BINARY) - CFLAGS += -DFS2_DEMO + ifeq ($(strip $(FS1)), true) + CFLAGS += -DFS1_DEMO -DDEMO + else + CFLAGS += -DFS2_DEMO + endif else CFLAGS += -DRELEASE_REAL endif diff --git a/include/asteroid.h b/include/asteroid.h index 088cb30..088b743 100644 --- a/include/asteroid.h +++ b/include/asteroid.h @@ -15,6 +15,9 @@ * Header file for asteroids * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:12 relnev * added copyright header * @@ -131,6 +134,12 @@ struct collision_info_struct; #define MAX_ASTEROIDS 256 // DEBRIS TYPES +#ifdef MAKE_FS1 +#define MAX_DEBRIS_TYPES 3 +#define ASTEROID_TYPE_SMALL 0 +#define ASTEROID_TYPE_MEDIUM 1 +#define ASTEROID_TYPE_BIG 2 +#else #define MAX_DEBRIS_TYPES 12 #define ASTEROID_TYPE_SMALL 0 #define ASTEROID_TYPE_MEDIUM 1 @@ -147,6 +156,7 @@ struct collision_info_struct; #define DEBRIS_SHIVAN_SMALL 9 #define DEBRIS_SHIVAN_MEDIUM 10 #define DEBRIS_SHIVAN_LARGE 11 +#endif // END DEBRIS TYPES typedef struct debris_struct { @@ -164,7 +174,11 @@ extern asteroid_obj Asteroid_obj_list; extern debris_struct Field_debris_info[]; +#ifdef MAKE_FS1 +#define MAX_ASTEROID_POFS 2 +#else #define MAX_ASTEROID_POFS 3 // Max number of POFs per asteroid type +#endif #define AF_USED (1<<0) // Set means used. diff --git a/include/bmpman.h b/include/bmpman.h index 158715b..7e7b502 100644 --- a/include/bmpman.h +++ b/include/bmpman.h @@ -15,6 +15,9 @@ * Prototypes for Bitmap Manager functions * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:12 relnev * added copyright header * @@ -158,7 +161,7 @@ #include "pstypes.h" -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_BITMAPS 3500 #else #define MAX_BITMAPS 3500 // How many bitmaps the game can handle diff --git a/include/debris.h b/include/debris.h index 3a42715..0cf37de 100644 --- a/include/debris.h +++ b/include/debris.h @@ -15,6 +15,9 @@ * Code for the pieces of exploding object debris. * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:12 relnev * added copyright header * @@ -179,7 +182,7 @@ typedef struct debris { #define DEBRIS_EXPIRE (1<<1) // debris can expire (ie hull chunks from small ships) -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_DEBRIS_PIECES 48 #else #define MAX_DEBRIS_PIECES 64 diff --git a/include/eventmusic.h b/include/eventmusic.h index 14b0a42..efdfea2 100644 --- a/include/eventmusic.h +++ b/include/eventmusic.h @@ -15,6 +15,9 @@ * Header file for high-level control of event driven music * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -127,20 +130,39 @@ // Identifies songs in the Soundtrack_filenames[] structure. The order matches up with // what is in music.tbl. Do not modify without synching music.tbl. -#define SONG_NRML_1 0 // Normal Song 1 -#define SONG_AARV_1 1 // Allied Arrival 1 -#define SONG_EARV_1 2 // Enemy Arrival 1 -#define SONG_BTTL_1 3 // Battle Song 1 -#define SONG_BTTL_2 4 // Battle Song 2 -#define SONG_BTTL_3 5 // Battle Song 3 -#define SONG_AARV_2 6 // Allied Arrival 2 -#define SONG_EARV_2 7 // Enemy Arrival 2 -#define SONG_VICT_1 8 // Victory Song 1 -#define SONG_VICT_2 9 // Victory Song 2 -#define SONG_FAIL_1 10 // Goal Failed -#define SONG_DEAD_1 11 // Death Song 1 - -#define MAX_PATTERNS 12 +#ifdef MAKE_FS1 + #define SONG_NRML_1 0 // Normal Song 1 + #define SONG_NRML_2 1 // Normal Song 2 + #define SONG_NRML_3 2 // Normal Song 3 + #define SONG_AARV_1 3 // Allied Arrival 1 + #define SONG_EARV_1 4 // Enemy Arrival 1 + #define SONG_BTTL_1 5 // Battle Song 1 + #define SONG_BTTL_2 6 // Battle Song 2 + #define SONG_BTTL_3 7 // Battle Song 3 + #define SONG_AARV_2 8 // Allied Arrival 2 + #define SONG_EARV_2 9 // Enemy Arrival 2 + #define SONG_VICT_1 10 // Victory Song 1 + #define SONG_VICT_2 11 // Victory Song 2 + #define SONG_FAIL_1 12 // Goal Failed + #define SONG_DEAD_1 13 // Death Song 1 + + #define MAX_PATTERNS 14 +#else + #define SONG_NRML_1 0 // Normal Song 1 + #define SONG_AARV_1 1 // Allied Arrival 1 + #define SONG_EARV_1 2 // Enemy Arrival 1 + #define SONG_BTTL_1 3 // Battle Song 1 + #define SONG_BTTL_2 4 // Battle Song 2 + #define SONG_BTTL_3 5 // Battle Song 3 + #define SONG_AARV_2 6 // Allied Arrival 2 + #define SONG_EARV_2 7 // Enemy Arrival 2 + #define SONG_VICT_1 8 // Victory Song 1 + #define SONG_VICT_2 9 // Victory Song 2 + #define SONG_FAIL_1 10 // Goal Failed + #define SONG_DEAD_1 11 // Death Song 1 + + #define MAX_PATTERNS 12 +#endif // if player targets a hostile ship at less than this range, switch to battle track #define BATTLE_START_MIN_TARGET_DIST 500 diff --git a/include/font.h b/include/font.h index 96cf6c6..6d547fd 100644 --- a/include/font.h +++ b/include/font.h @@ -15,6 +15,9 @@ * header file for font stuff * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -90,7 +93,11 @@ #include "pstypes.h" -#define MAX_FONTS 3 +#ifdef MAKE_FS1 + #define MAX_FONTS 2 +#else + #define MAX_FONTS 3 +#endif #define FONT_VERSION 0 #define WIDEST_DIGIT "4" // the widest number character @@ -141,7 +148,9 @@ extern font *Current_font; #define FONT1 0 // font01.vf #define FONT2 1 // font02.vf +#ifndef MAKE_FS1 #define FONT3 2 // font03.vf +#endif // extern definitions for basic font functions extern void grx_set_font(int fontnum); diff --git a/include/freespace.h b/include/freespace.h index 89c4b79..43a3911 100644 --- a/include/freespace.h +++ b/include/freespace.h @@ -15,6 +15,9 @@ * FreeSpace, the game, not the project, header information. * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -158,8 +161,13 @@ // // filename extensions -#define FS_MISSION_FILE_EXT NOX(".fs2") -#define FS_CAMPAIGN_FILE_EXT NOX(".fc2") +#ifdef MAKE_FS1 + #define FS_MISSION_FILE_EXT NOX(".fsm") + #define FS_CAMPAIGN_FILE_EXT NOX(".fsc") +#else + #define FS_MISSION_FILE_EXT NOX(".fs2") + #define FS_CAMPAIGN_FILE_EXT NOX(".fc2") +#endif // CDROM volume names #ifdef MULTIPLAYER_BETA_BUILD @@ -172,10 +180,15 @@ #define FS_CDROM_VOLUME_1 NOX("FS2_OEM") #define FS_CDROM_VOLUME_2 NOX("FS2_OEM") #define FS_CDROM_VOLUME_3 NOX("FS2_OEM") +#else +#ifdef MAKE_FS1 + #define FS_CDROM_VOLUME_1 NOX("FREESPACE_1") + #define FS_CDROM_VOLUME_2 NOX("FREESPACE_2") #else #define FS_CDROM_VOLUME_1 NOX("FREESPACE2_1") #define FS_CDROM_VOLUME_2 NOX("FREESPACE2_2") #define FS_CDROM_VOLUME_3 NOX("FREESPACE2_3") +#endif // old volume names // #define FS_CDROM_VOLUME_1 NOX("FREESPACE_1") @@ -218,12 +231,19 @@ extern int Game_weapons_tbl_valid; // this is a mission actually designed at Volition +#ifdef MAKE_FS1 +#define MAX_BUILTIN_MISSIONS 130 // for SilentThreat +#else #define MAX_BUILTIN_MISSIONS 100 +#endif #define FSB_FROM_VOLITION (1<<0) // we made it in-house #define FSB_MULTI (1<<1) // is a multiplayer mission #define FSB_TRAINING (1<<2) // is a training mission #define FSB_CAMPAIGN (1<<3) // is a campaign mission #define FSB_CAMPAIGN_FILE (1<<4) // is actually a campaign file +#ifdef MAKE_FS1 +#define FSB_FROM_MDISK (1<<5) // is from FS1 mdisk (SilentThreat) +#endif typedef struct fs_builtin_mission { char filename[MAX_FILENAME_LEN]; diff --git a/include/medals.h b/include/medals.h index d498167..471206c 100644 --- a/include/medals.h +++ b/include/medals.h @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -80,6 +83,9 @@ typedef struct medal_stuff { typedef struct badge_stuff { char voice_base[MAX_FILENAME_LEN + 1]; +#ifdef MAKE_FS1 + char voice_base2[MAX_FILENAME_LEN + 1]; +#endif char *promotion_text; } badge_stuff; @@ -104,7 +110,11 @@ void medal_main_close(); void init_medal_bitmaps(); void init_snazzy_regions(); void blit_medals(); +#ifdef MAKE_FS1 +void blit_label(char *label,int *coordsx,int *coordsy); +#else void blit_label(char *label,int *coords); +#endif void blit_callsign(); // individual medals diff --git a/include/missionbriefcommon.h b/include/missionbriefcommon.h index 9f4c925..67f4310 100644 --- a/include/missionbriefcommon.h +++ b/include/missionbriefcommon.h @@ -15,6 +15,9 @@ * Header file for briefing stuff common to FreeSpace and FRED * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -168,7 +171,11 @@ // names for the icons that can appear in the briefing. If you modify this list, // update the Icons_names[] string array located in MissionParse.cpp // ------------------------------------------------------------------------ +#ifdef MAKE_FS1 +#define MAX_BRIEF_ICONS 27 +#else #define MAX_BRIEF_ICONS 35 // keep up to date +#endif #define ICON_FIGHTER 0 #define ICON_FIGHTER_WING 1 @@ -196,6 +203,9 @@ #define ICON_FIGHTERW_PLAYER 23 #define ICON_BOMBER_PLAYER 24 #define ICON_BOMBERW_PLAYER 25 +#ifdef MAKE_FS1 +#define ICON_JUMP_NODE 26 +#else #define ICON_KNOSSOS_DEVICE 26 #define ICON_TRANSPORT_WING 27 #define ICON_CORVETTE 28 @@ -205,6 +215,7 @@ #define ICON_SENTRYGUN 32 #define ICON_JUMP_NODE 33 #define ICON_TRANSPORT 34 +#endif // ------------------------------------------------------------------------ // Structures to hold briefing data diff --git a/include/missioncampaign.h b/include/missioncampaign.h index 42b8f4c..a707132 100644 --- a/include/missioncampaign.h +++ b/include/missioncampaign.h @@ -15,6 +15,9 @@ * header file for dealing with campaigns * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -267,7 +270,7 @@ #include "scoring.h" // name of the builtin campaign. -#if defined(FS2_DEMO) +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define BUILTIN_CAMPAIGN "demo" #define BUILTIN_CAMPAIGN_NAME "DEMO Campaign" #elif defined(OEM_BUILD) @@ -276,6 +279,9 @@ #elif defined(E3_BUILD) #define BUILTIN_CAMPAIGN "E3" #define BUILTIN_CAMPAIGN_NAME "E3 Campaign" +#elif defined(MAKE_FS1) + #define BUILTIN_CAMPAIGN "FreeSpace" + #define BUILTIN_CAMPAIGN_NAME "The Main Freespace Campaign" #else #define BUILTIN_CAMPAIGN "FreeSpace2" #define BUILTIN_CAMPAIGN_NAME "The Main Freespace2 Campaign" diff --git a/include/missionparse.h b/include/missionparse.h index 6381899..a4e47cd 100644 --- a/include/missionparse.h +++ b/include/missionparse.h @@ -15,6 +15,9 @@ * main header file for parsing code * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * @@ -298,7 +301,7 @@ extern int Mission_alt_type_count; #define SPECIES_SHIVAN 2 #define SPECIES_NONE 3 -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_SUBSYS_STATUS 125 #else #define MAX_SUBSYS_STATUS 250 @@ -457,7 +460,7 @@ typedef struct p_object { extern p_object ship_arrival_list; // used by sexpression parser -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_SHIP_ARRIVALS 45 #define MAX_WING_ARRIVALS 10 #else diff --git a/include/modelsinc.h b/include/modelsinc.h index 3741cc8..e134343 100644 --- a/include/modelsinc.h +++ b/include/modelsinc.h @@ -23,8 +23,11 @@ #define OP_BOUNDBOX 5 // change header for freespace2 -//#define FREESPACE1_FORMAT -#define FREESPACE2_FORMAT +#ifdef MAKE_FS1 + #define FREESPACE1_FORMAT +#else + #define FREESPACE2_FORMAT +#endif #if defined( FREESPACE1_FORMAT ) #elif defined ( FREESPACE2_FORMAT ) #else diff --git a/include/multi.h b/include/multi.h index 3a16c45..d529332 100644 --- a/include/multi.h +++ b/include/multi.h @@ -16,6 +16,9 @@ * multiplayer functions. * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/09 04:41:14 relnev * added copyright header * @@ -332,8 +335,13 @@ struct CFILE; // version 43 - 7/30/99 // version 44 - 8/24/99 // version 46 - 8/30/99 +// version 70+ for FS1 - 1/16/03 // STANDALONE_ONLY +#ifdef MAKE_FS1 +#define MULTI_FS_SERVER_VERSION 70 +#else #define MULTI_FS_SERVER_VERSION 46 +#endif #define MULTI_FS_SERVER_COMPATIBLE_VERSION MULTI_FS_SERVER_VERSION // version defines (i.e. demo, full version, special OEM version diff --git a/include/multiui.h b/include/multiui.h index 16fcfa0..2fc5aa2 100644 --- a/include/multiui.h +++ b/include/multiui.h @@ -15,6 +15,9 @@ * Header file for the UI of the various multiplayer screens * * $Log$ + * Revision 1.4 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:14 relnev * added copyright header * @@ -349,7 +352,11 @@ typedef struct { } multi_create_info; // load all common icons +#ifdef MAKE_FS1 +#define MULTI_NUM_COMMON_ICONS 13 +#else #define MULTI_NUM_COMMON_ICONS 12 +#endif #define MICON_VOICE_DENIED 0 #define MICON_VOICE_RECORDING 1 #define MICON_TEAM0 2 @@ -362,6 +369,9 @@ typedef struct { #define MICON_VOLITION 9 #define MICON_VALID 10 #define MICON_CD 11 +#ifdef MAKE_FS1 +#define MICON_MDISK 12 +#endif // common icon stuff extern int Multi_common_icons[MULTI_NUM_COMMON_ICONS]; diff --git a/include/object.h b/include/object.h index 3035637..69fed3b 100644 --- a/include/object.h +++ b/include/object.h @@ -15,6 +15,9 @@ * * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:14 relnev * added copyright header * @@ -324,7 +327,7 @@ * CONSTANTS */ -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_OBJECTS 300 #else #define MAX_OBJECTS 1000 diff --git a/include/scoring.h b/include/scoring.h index 1c25df8..5bdc296 100644 --- a/include/scoring.h +++ b/include/scoring.h @@ -15,6 +15,9 @@ * Scoring system structures, medals, rank, etc. * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:14 relnev * added copyright header * @@ -184,7 +187,10 @@ struct player; #ifdef FS2_DEMO #define NUM_MEDALS 16 #define NUM_MEDALS_FS1 16 -#else +#elif MAKE_FS1 + #define NUM_MEDALS 16 + #define NUM_MEDALS_FS1 16 +#else #define NUM_MEDALS 18 #define NUM_MEDALS_FS1 16 #endif diff --git a/include/sexp.h b/include/sexp.h index d5888e1..0a53b3b 100644 --- a/include/sexp.h +++ b/include/sexp.h @@ -15,6 +15,9 @@ * header for sexpression parsing * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:14 relnev * added copyright header * @@ -294,7 +297,7 @@ #define OPERATOR_LENGTH 24 // if this ever exceeds TOKEN_LENGTH, let JasonH know! #define TOKEN_LENGTH 32 -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_SEXP_NODES 1600 #else #define MAX_SEXP_NODES 2200 // Reduced from 2000 to 1200 by MK on 4/1/98. diff --git a/include/ship.h b/include/ship.h index 24de94c..fe2c143 100644 --- a/include/ship.h +++ b/include/ship.h @@ -15,6 +15,9 @@ * all sorts of cool stuff about ships * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:14 relnev * added copyright header * @@ -884,7 +887,7 @@ extern engine_wash_info Engine_wash_info[MAX_ENGINE_WASH_TYPES]; #define MAX_SHIPS_PER_WING 6 -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_WINGS 15 #else #define MAX_WINGS 25 diff --git a/include/starfield.h b/include/starfield.h index 354a137..4bf184b 100644 --- a/include/starfield.h +++ b/include/starfield.h @@ -16,6 +16,9 @@ * debris, etc. * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:15 relnev * added copyright header * @@ -141,6 +144,11 @@ typedef struct starfield_bitmap_instance { float scale_x, scale_y; // x and y scale int div_x, div_y; // # of x and y divisions angles ang; // angles from fred +#ifdef MAKE_FS1 + matrix m; // straight matrix instead of angles to matrix + int sun_light; // FIXME: not sure what this is supposed to do + float rot; // rotation rate - always 0? +#endif } starfield_bitmap_instance; // background bitmaps diff --git a/include/systemvars.h b/include/systemvars.h index c7631e4..666bbae 100644 --- a/include/systemvars.h +++ b/include/systemvars.h @@ -15,6 +15,9 @@ * Variables and constants common to FreeSpace and Fred. * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:15 relnev * added copyright header * @@ -269,6 +272,9 @@ extern int Game_detail_level; #define DETAIL_FLAG_HUD (1<<7) // draw hud stuff #define DETAIL_FLAG_FIREBALLS (1<<8) // draw fireballs #define DETAIL_FLAG_COLLISION (1<<9) // use good collision detection +#ifdef MAKE_FS1 +#define DETAIL_FLAG_ENGINE_GLOWS (1<<10) // engine glows +#endif extern uint Game_detail_flags; @@ -325,6 +331,9 @@ typedef struct detail_levels { int targetview_model; // 0=off, 1=on int planets_suns; // 0=off, 1=on int weapon_extras; // extra weapon details. trails, glows +#ifdef MAKE_FS1 + int engine_glows; // 0=off, 1=on +#endif } detail_levels; // Global values used to access detail levels in game and libs diff --git a/include/version.h b/include/version.h index 80e24e5..2a793d4 100644 --- a/include/version.h +++ b/include/version.h @@ -14,6 +14,9 @@ * * * $Log$ + * Revision 1.4 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.3 2003/05/06 07:21:43 taylor * add version number for linux/unix client * @@ -119,14 +122,22 @@ // 1.01 Patch for Win95 volume label bug // 1.20 German release version -#if defined (FS2_DEMO) +#if defined(FS2_DEMO) #define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release #define FS_VERSION_MINOR 10 // Increase by 1 for minor revs, 10 for major. #define FS_VERSION_BUILD 00 // Build version +#elif defined(FS1_DEMO) + #define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release + #define FS_VERSION_MINOR 20 // Increase by 1 for minor revs, 10 for major. + #define FS_VERSION_BUILD 00 // Build version #elif defined(OEM_BUILD) #define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release #define FS_VERSION_MINOR 00 // Increase by 1 for minor revs, 10 for major. #define FS_VERSION_BUILD 00 // Build version +#elif defined(MAKE_FS1) + #define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release + #define FS_VERSION_MINOR 06 // Increase by 1 for minor revs, 10 for major. + #define FS_VERSION_BUILD 00 // Build version #else #define FS_VERSION_MAJOR 01 // Major is 0 for pre-release and 1 for 1.0 release #define FS_VERSION_MINOR 20 // Increase by 1 for minor revs, 10 for major. diff --git a/include/weapon.h b/include/weapon.h index 23d1b22..566a86d 100644 --- a/include/weapon.h +++ b/include/weapon.h @@ -15,6 +15,9 @@ * * * $Log$ + * Revision 1.3 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:15 relnev * added copyright header * @@ -401,7 +404,7 @@ typedef struct weapon { } weapon; -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_WEAPONS 100 #else // upped 5/6/98 from 200 - DB diff --git a/src/asteroid/asteroid.cpp b/src/asteroid/asteroid.cpp index c50b779..c50df46 100644 --- a/src/asteroid/asteroid.cpp +++ b/src/asteroid/asteroid.cpp @@ -15,6 +15,9 @@ * C module for asteroid code * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/18 08:58:53 relnev * last few struct changes * @@ -285,7 +288,7 @@ #include "localize.h" #include "multi.h" -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) #define ASTEROID_OBJ_USED (1<<0) // flag used in asteroid_obj struct #define MAX_ASTEROID_OBJS MAX_ASTEROIDS // max number of asteroids tracked in asteroid list @@ -296,10 +299,17 @@ asteroid_obj Asteroid_obj_list; // head of linked list of asteroid_obj stru // Any changes to this will require changes to the asteroid editor debris_struct Field_debris_info[] = { { -1, "None", }, +#ifdef MAKE_FS1 + { ASTEROID_TYPE_SMALL, "Small Asteroid", }, + { ASTEROID_TYPE_MEDIUM, "Medium Asteroid", }, + { ASTEROID_TYPE_BIG, "Large Asteroid",}, +#else { ASTEROID_TYPE_SMALL, "Asteroid Small", }, { ASTEROID_TYPE_MEDIUM, "Asteroid Medium", }, { ASTEROID_TYPE_BIG, "Asteroid Large", }, +#endif +#ifndef MAKE_FS1 { DEBRIS_TERRAN_SMALL, "Terran Small", }, { DEBRIS_TERRAN_MEDIUM, "Terran Medium", }, { DEBRIS_TERRAN_LARGE, "Terran Large", }, @@ -311,6 +321,7 @@ debris_struct Field_debris_info[] = { { DEBRIS_SHIVAN_SMALL, "Shivan Small", }, { DEBRIS_SHIVAN_MEDIUM, "Shivan Medium", }, { DEBRIS_SHIVAN_LARGE, "Shivan Large" }, +#endif }; // used for randomly generating debris type when there are multiple sizes. @@ -736,6 +747,7 @@ int get_debris_from_same_group(int index) { int get_debris_weight(int ship_debris_index) { switch (ship_debris_index) { +#ifndef MAKE_FS1 case DEBRIS_TERRAN_SMALL: case DEBRIS_VASUDAN_SMALL: case DEBRIS_SHIVAN_SMALL: @@ -753,6 +765,7 @@ int get_debris_weight(int ship_debris_index) case DEBRIS_SHIVAN_LARGE: return LARGE_DEBRIS_WEIGHT; break; +#endif default: Int3(); @@ -1488,20 +1501,24 @@ void asteriod_explode_sound(object *objp, int type, int play_loud) switch (type) { case ASTEROID_TYPE_SMALL: case ASTEROID_TYPE_MEDIUM: +#ifndef MAKE_FS1 case DEBRIS_TERRAN_SMALL: case DEBRIS_TERRAN_MEDIUM: case DEBRIS_VASUDAN_SMALL: case DEBRIS_VASUDAN_MEDIUM: case DEBRIS_SHIVAN_SMALL: case DEBRIS_SHIVAN_MEDIUM: +#endif sound_index = SND_ASTEROID_EXPLODE_SMALL; range_factor = 5.0f; break; case ASTEROID_TYPE_BIG: +#ifndef MAKE_FS1 case DEBRIS_TERRAN_LARGE: case DEBRIS_VASUDAN_LARGE: case DEBRIS_SHIVAN_LARGE: +#endif sound_index = SND_ASTEROID_EXPLODE_BIG; range_factor = 10.0f; break; @@ -1744,6 +1761,7 @@ void asteroid_maybe_break_up(object *asteroid_obj) break; // ship debris does not break up +#ifndef MAKE_FS1 case DEBRIS_TERRAN_SMALL: case DEBRIS_TERRAN_MEDIUM: case DEBRIS_TERRAN_LARGE: @@ -1754,6 +1772,7 @@ void asteroid_maybe_break_up(object *asteroid_obj) case DEBRIS_SHIVAN_MEDIUM: case DEBRIS_SHIVAN_LARGE: break; +#endif default: Int3(); @@ -1976,11 +1995,12 @@ void asteroid_parse_section() required_string( "$POF file2:" ); stuff_string_white( asip->pof_files[1] ); +#ifndef MAKE_FS1 if ( (strstr(asip->name,"Asteroid") != NULL) || (strstr(asip->name, "asteroid") != NULL) ) { required_string( "$POF file3:" ); stuff_string_white( asip->pof_files[2] ); } - +#endif asip->num_detail_levels = 0; required_string("$Detail distance:"); diff --git a/src/cfile/cfile.cpp b/src/cfile/cfile.cpp index feca69f..1374271 100644 --- a/src/cfile/cfile.cpp +++ b/src/cfile/cfile.cpp @@ -15,6 +15,9 @@ * Utilities for operating on files * * $Log$ + * Revision 1.9 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.8 2003/02/20 17:41:07 theoddone33 * Userdir patch from Taylor Richards * @@ -231,7 +234,11 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = { #ifdef PLAT_UNIX { CF_TYPE_MAPS, "Data/Maps", ".pcx .ani .tga", CF_TYPE_DATA }, { CF_TYPE_TEXT, "Data/Text", ".txt .net", CF_TYPE_DATA }, +#ifdef MAKE_FS1 + { CF_TYPE_MISSIONS, "Data/Missions", ".fsm .fsc .ntl .ssv", CF_TYPE_DATA }, +#else { CF_TYPE_MISSIONS, "Data/Missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA }, +#endif { CF_TYPE_MODELS, "Data/Models", ".pof", CF_TYPE_DATA }, { CF_TYPE_TABLES, "Data/Tables", ".tbl", CF_TYPE_DATA }, { CF_TYPE_SOUNDS, "Data/Sounds", ".wav", CF_TYPE_DATA }, diff --git a/src/controlconfig/controlsconfig.cpp b/src/controlconfig/controlsconfig.cpp index 1c814b7..bacaea0 100644 --- a/src/controlconfig/controlsconfig.cpp +++ b/src/controlconfig/controlsconfig.cpp @@ -15,6 +15,9 @@ * C module for keyboard, joystick and mouse configuration * * $Log$ + * Revision 1.4 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:15 relnev * added copyright header * @@ -345,7 +348,11 @@ char* Conflict_background_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = { // control list area int Control_list_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 34, 85, 198, 219 +#else 32, 58, 198, 259 // GR_640 +#endif }, { 32, 94, 904, 424 // GR_1024 @@ -373,7 +380,11 @@ int Control_list_key_w[GR_NUM_RESOLUTIONS] = { // display the "more..." text under the control list int Control_more_coords[GR_NUM_RESOLUTIONS][2] = { { +#ifdef MAKE_FS1 + 320, 316 +#else 320, 326 // GR_640 +#endif }, { 500, 542 // GR_1024 @@ -383,7 +394,11 @@ int Control_more_coords[GR_NUM_RESOLUTIONS][2] = { // area to display "conflicts with..." text int Conflict_wnd_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 34, 364, 175, 19 +#else 32, 313, 250, 32 // GR_640 +#endif }, { 48, 508, 354, 46 // GR_1024 @@ -393,7 +408,11 @@ int Conflict_wnd_coords[GR_NUM_RESOLUTIONS][4] = { // conflict warning anim coords int Conflict_warning_coords[GR_NUM_RESOLUTIONS][2] = { { +#ifdef MAKE_FS1 + 274, 352 +#else -1, 420 // GR_640 +#endif }, { -1, 669 // GR_1024 @@ -473,6 +492,10 @@ static struct { int Conflicts_axes[NUM_JOY_AXIS_ACTIONS]; +#ifdef MAKE_FS1 +static hud_anim Conflict_warning_anim; +#endif + #define TARGET_TAB 0 #define SHIP_TAB 1 #define WEAPON_TAB 2 @@ -495,6 +518,27 @@ int Conflicts_axes[NUM_JOY_AXIS_ACTIONS]; ui_button_info CC_Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("CCB_00", 35, 30, -1, -1, 0), // target tab + ui_button_info("CCB_01", 121, 30, -1, -1, 1), // ship tab + ui_button_info("CCB_02", 176, 30, -1, -1, 2), // weapon tab + ui_button_info("CCB_03", 254, 30, -1, -1, 3), // computer/misc tab + ui_button_info("CCB_04", 598, 168, -1, -1, 4), // scroll up + ui_button_info("CCB_05", 598, 219, -1, -1, 5), // scroll down + ui_button_info("CCB_06", 13, 394, -1, -1, 6), // alt toggle + ui_button_info("CCB_07", 58, 394, -1, -1, 7), // shift toggle + ui_button_info("CCB_09", 168, 394, -1, -1, 9), // invert + ui_button_info("CCB_10", 456, 341, -1, -1, 10), // cancel + ui_button_info("CCB_11", 394, 404, -1, -1, 11), // undo + ui_button_info("CCB_12", 501, 26, -1, -1, 12), // default + ui_button_info("CCB_13", 513, 331, -1, -1, 13), // search + ui_button_info("CCB_14", 572, 331, -1, -1, 14), // bind + ui_button_info("CCB_15", 469, 429, -1, -1, 15), // help + ui_button_info("CCB_16", 562, 411, -1, -1, 16), // accept + ui_button_info("CCB_18", 223, 404, -1, -1, 18), // clear other + ui_button_info("CCB_19", 289, 404, -1, -1, 19), // clear all + ui_button_info("CCB_20", 333, 404, -1, -1, 20), // clear button +#else ui_button_info("CCB_00", 32, 348, 17, 384, 0), // target tab ui_button_info("CCB_01", 101, 348, 103, 384, 1), // ship tab ui_button_info("CCB_02", 173, 352, 154, 384, 2), // weapon tab @@ -514,6 +558,7 @@ ui_button_info CC_Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { ui_button_info("CCB_18", 420, 346, 417, 386, 18), // clear other ui_button_info("CCB_19", 476, 346, 474, 386, 19), // clear all ui_button_info("CCB_20", 524, 346, 529, 386, 20), // clear button +#endif }, { // GR_1024 ui_button_info("2_CCB_00", 51, 557, 27, 615, 0), // target tab @@ -539,9 +584,15 @@ ui_button_info CC_Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { }; // strings -#define CC_NUM_TEXT 20 +#ifdef MAKE_FS1 + #define CC_NUM_TEXT 0 +#else + #define CC_NUM_TEXT 20 +#endif UI_XSTR CC_text[GR_NUM_RESOLUTIONS][CC_NUM_TEXT] = { { // GR_640 + // nothing needed for FS1 +#ifndef MAKE_FS1 { "Targeting", 1340, 17, 384, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[0][TARGET_TAB].button }, { "Ship", 1341, 103, 384, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[0][SHIP_TAB].button }, { "Weapons", 1065, 154, 384, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[0][WEAPON_TAB].button }, @@ -562,8 +613,11 @@ UI_XSTR CC_text[GR_NUM_RESOLUTIONS][CC_NUM_TEXT] = { { "All", 1349, 483, 396, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[0][CLEAR_ALL_BUTTON].button }, { "Clear", 1414, 529, 388, UI_XSTR_COLOR_PINK, -1, &CC_Buttons[0][CLEAR_BUTTON].button }, { "Selected", 1350, 517, 396, UI_XSTR_COLOR_PINK, -1, &CC_Buttons[0][CLEAR_BUTTON].button }, +#endif }, { // GR_1024 + // nothing needed for FS1 +#ifndef MAKE_FS1 { "Targeting", 1340, 47, 615, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[1][TARGET_TAB].button }, { "Ship", 1341, 176, 615, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[1][SHIP_TAB].button }, { "Weapons", 1065, 266, 615, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[1][WEAPON_TAB].button }, @@ -584,6 +638,7 @@ UI_XSTR CC_text[GR_NUM_RESOLUTIONS][CC_NUM_TEXT] = { { "All", 1349, 772, 634, UI_XSTR_COLOR_GREEN, -1, &CC_Buttons[1][CLEAR_ALL_BUTTON].button }, { "Clear", 1414, 871, 619, UI_XSTR_COLOR_PINK, -1, &CC_Buttons[1][CLEAR_BUTTON].button }, { "Selected", 1350, 852, 634, UI_XSTR_COLOR_PINK, -1, &CC_Buttons[1][CLEAR_BUTTON].button }, +#endif } }; @@ -634,7 +689,7 @@ int Config_allowed[] = { }; -/* +#ifdef FS1_DEMO // old invalid demo keys #define INVALID_DEMO_KEYS_MAX 14 int Invalid_demo_keys[] = { @@ -653,10 +708,10 @@ int Invalid_demo_keys[] = { MULTI_MESSAGE_TARGET, MULTI_OBSERVER_ZOOM_TO }; -*/ +#else #define INVALID_DEMO_KEYS_MAX 0 int Invalid_demo_keys[INVALID_DEMO_KEYS_MAX+1]; // +1 is only to prevent a 0-size array; - +#endif #ifndef NDEBUG int Show_controls_info = 0; @@ -690,7 +745,7 @@ int control_config_detect_axis() int control_config_valid_action(int n) { -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) int i; for (i=0; in_models; } +#ifndef MAKE_FS1 Debris_vaporize_model = model_load( NOX("debris02.pof"), 0, NULL ); +#endif for (i=0; i= 0 ); - // Assert( HUD_config.color <= 2 ); +#ifdef MAKE_FS1 + Assert( HUD_config.main_color >= 0 ); + Assert( HUD_config.main_color <= 2 ); +#endif Assert( Mission_palette >= 0 ); Assert( Mission_palette <= 98 ); - // if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) { +#ifdef MAKE_FS1 + if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) { strcpy( palette_filename, NOX("gamepalette-subspace") ); - // } else { - // sprintf( palette_filename, NOX("gamepalette%d-%02d"), HUD_config.color+1, Mission_palette+1 ); - // } + } else { + sprintf( palette_filename, NOX("gamepalette%d-%02d"), HUD_config.main_color+1, Mission_palette+1 ); + } mprintf(( "Loading palette %s\n", palette_filename )); - // palette_load_table(palette_filename); + palette_load_table(palette_filename); +#else + strcpy( palette_filename, NOX("gamepalette-subspace") ); + + mprintf(( "Loading palette %s\n", palette_filename )); +#endif } void game_post_level_init() @@ -1695,7 +1880,13 @@ int Game_loading_frame=-1; static int Game_loading_ani_coords[GR_NUM_RESOLUTIONS][2] = { { +#if defined(FS1_DEMO) + 133, 337 +#elif defined(MAKE_FS1) + 118, 316 +#else 63, 316 // GR_640 +#endif }, { 101, 505 // GR_1024 @@ -1747,7 +1938,9 @@ void game_loading_callback_init() Assert( Game_loading_callback_inited==0 ); Game_loading_background = bm_load(Game_loading_bground_fname[gr_screen.res]); - //common_set_interface_palette("InterfacePalette"); // set the interface palette +#ifdef MAKE_FS1 + common_set_interface_palette("InterfacePalette"); // set the interface palette +#endif Game_loading_ani = anim_load( Game_loading_ani_fname[gr_screen.res]); @@ -1918,7 +2111,9 @@ int game_start_mission() // the standalone server in multiplayer doesn't do any rendering, so we will not even bother loading the palette if ( !(Game_mode & GM_STANDALONE_SERVER) ) { mprintf(( "=================== LOADING GAME PALETTE ================\n" )); - // game_load_palette(); +#ifdef MAKE_FS1 + game_load_palette(); +#endif } load_post_level_init = time(NULL); @@ -2210,7 +2405,7 @@ void game_init() Show_framerate = os_config_read_uint( NULL, NOX("ShowFPS"), 0 ); #endif -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) Asteroids_enabled = 1; #endif @@ -2290,6 +2485,7 @@ void game_init() int has_sparky_hi = 0; // check if sparky_hi exists -- access mode 0 means does file exist +#ifndef MAKE_FS1 // shoudn't have it so don't check char dir[128]; _getcwd(dir, 128); if ( _access("sparky_hi_fs2.vp", 0) == 0) { @@ -2297,6 +2493,7 @@ void game_init() } else { mprintf(("No sparky_hi_fs2.vp in directory %s\n", dir)); } +#endif // see if we've got 32 bit in the string if(strstr(ptr, "32 bit")){ @@ -2401,7 +2598,7 @@ void game_init() gr_set_gamma(Freespace_gamma); -#if defined(FS2_DEMO) || defined(OEM_BUILD) +#if defined(FS2_DEMO) || defined(OEM_BUILD) || defined(FS1_DEMO) // add title screen if(!Is_standalone){ display_title_screen(); @@ -4670,7 +4867,7 @@ int game_check_key() return k; } -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define DEMO_TRAILER_TIMEOUT_MS 45000 // 45 seconds of no input, play trailer static int Demo_show_trailer_timestamp = 0; @@ -4749,7 +4946,7 @@ int game_poll() k = key_inkey(); -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) demo_maybe_show_trailer(k); #endif @@ -4836,12 +5033,12 @@ int game_poll() // hotkey selection screen -- only valid from briefing and beyond. case KEY_F3: - #ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) if ( (state == GS_STATE_TEAM_SELECT) || (state == GS_STATE_BRIEFING) || (state == GS_STATE_SHIP_SELECT) || (state == GS_STATE_WEAPON_SELECT) || (state == GS_STATE_GAME_PLAY) || (state == GS_STATE_GAME_PAUSED) ) { gameseq_post_event( GS_EVENT_HOTKEY_SCREEN ); k = 0; } - #endif +#endif break; case KEY_DEBUGGED + KEY_F3: @@ -5008,7 +5205,7 @@ void camera_move() void end_demo_campaign_do() { -#if defined(FS2_DEMO) +#if defined(FS2_DEMO) || defined(FS1_DEMO) // show upsell screens demo_upsell_show_screens(); #elif defined(OEM_BUILD) @@ -5063,7 +5260,11 @@ void game_process_event( int current_state, int event ) case GS_EVENT_DEBRIEF: // did we end the campaign in the main freespace 2 single player campaign? +#ifdef MAKE_FS1 + if(Campaign_ended_in_mission && (Game_mode & GM_CAMPAIGN_MODE) && !stricmp(Campaign.filename, "freespace")) { +#else if(Campaign_ended_in_mission && (Game_mode & GM_CAMPAIGN_MODE) && !stricmp(Campaign.filename, "freespace2")) { +#endif gameseq_post_event(GS_EVENT_END_CAMPAIGN); } else { gameseq_set_state(GS_STATE_DEBRIEF); @@ -5412,9 +5613,9 @@ void game_process_event( int current_state, int event ) break; case GS_EVENT_GAME_INIT: - #if defined(FS2_DEMO) || defined(OEM_BUILD) +#if defined(FS2_DEMO) || defined(OEM_BUILD) || defined(FS1_DEMO) gameseq_set_state(GS_STATE_INITIAL_PLAYER_SELECT); - #else +#else // see if the command line option has been set to use the last pilot, and act acoordingly if( player_select_get_last_pilot() ) { // always enter the main menu -- do the automatic network startup stuff elsewhere @@ -5423,7 +5624,7 @@ void game_process_event( int current_state, int event ) } else { gameseq_set_state(GS_STATE_INITIAL_PLAYER_SELECT); } - #endif +#endif break; case GS_EVENT_MULTI_MISSION_SYNC: @@ -6928,8 +7129,8 @@ int PASCAL WinMainSub(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int nCm } // non-demo, non-standalone, play the intro movie - if(!Is_standalone){ #ifndef DEMO + if(!Is_standalone){ #ifdef RELEASE_REAL char *plist[5]; if( (cf_get_file_list(2, plist, CF_TYPE_MULTI_PLAYERS, NOX("*.plr")) <= 0) && (cf_get_file_list(2, plist, CF_TYPE_SINGLE_PLAYERS, NOX("*.plr")) <= 0) ){ @@ -6982,7 +7183,7 @@ int PASCAL WinMainSub(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int nCm } } -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) if(!Is_standalone){ demo_upsell_show_screens(); } @@ -7723,7 +7924,7 @@ if ( FS_VERSION_BUILD == 0 ) { sprintf(str,"v%d.%02d.%02d",FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD ); } -#if defined (FS2_DEMO) +#if defined (FS2_DEMO) || defined(FS1_DEMO) strcat(str, " D"); #elif defined (OEM_BUILD) strcat(str, " (OEM)"); @@ -7955,11 +8156,13 @@ void oem_upsell_show_screens() // // ---------------------------------------------------------------- -#ifdef FS2_DEMO - -//#define NUM_DEMO_UPSELL_SCREENS 4 +#if defined(FS2_DEMO) || defined(FS1_DEMO) +#ifdef FS2_DEMO #define NUM_DEMO_UPSELL_SCREENS 2 +#elif FS1_DEMO +#define NUM_DEMO_UPSELL_SCREENS 4 +#endif #define DEMO_UPSELL_SCREEN_DELAY 3000 static int Demo_upsell_bitmaps_loaded = 0; @@ -7970,12 +8173,25 @@ static int Demo_upsell_show_next_bitmap_time; //XSTR:OFF static char *Demo_upsell_bitmap_filenames[GR_NUM_RESOLUTIONS][NUM_DEMO_UPSELL_SCREENS] = { +#ifdef FS1_DEMO + { "DemoUpsell1", + "DemoUpsell2", + "DemoUpsell3", + "DemoUpsell4" + }, + { "DemoUpsell1", + "DemoUpsell2", + "DemoUpsell3", + "DemoUpsell4" + }, +#else { "UpSell02", "UpSell01", }, { "2_UpSell02", "2_UpSell01", }, +#endif // "DemoUpsell3", // "DemoUpsell4", }; @@ -8548,8 +8764,10 @@ int game_do_cd_mission_check(char *filename) cd_num = 1; } else if(!stricmp(m->cd_volume, FS_CDROM_VOLUME_2)){ cd_num = 2; +#ifndef MAKE_FS1 } else if(!stricmp(m->cd_volume, FS_CDROM_VOLUME_3)){ cd_num = 3; +#endif } else { return game_do_cd_check(); } @@ -8615,7 +8833,11 @@ int game_do_cd_mission_check(char *filename) // this layout order must match Lcl_languages in localize.cpp in order for the // correct language to be detected int Lang_auto_detect_checksums[LCL_NUM_LANGUAGES] = { +#ifdef MAKE_FS1 + 1366105450, // English +#else 589986744, // English +#endif -1132430286, // German 0, // French }; @@ -8667,12 +8889,26 @@ int detect_lang() // // checksums, just keep a list of all valid ones, if it matches any of them, keep it -#define NUM_SHIPS_TBL_CHECKSUMS 1 +#if defined(MAKE_FS1) && !defined(FS1_DEMO) + #define NUM_SHIPS_TBL_CHECKSUMS 3 +#else + #define NUM_SHIPS_TBL_CHECKSUMS 1 +#endif #ifdef FS2_DEMO int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { 1696074201, // FS2 demo }; +#elif FS1_DEMO +int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { + 1603375034, // FS1 DEMO +}; +#elif MAKE_FS1 +int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { + -129679197, // FS1 Full 1.06 (US) + 7762567, // FS1 SilentThreat + 1555372475 // FS1 Full 1.06 (German) +}; #else /* int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = { @@ -8741,12 +8977,26 @@ DCF(shipspew, "display the checksum for the current ships.tbl") // // checksums, just keep a list of all valid ones, if it matches any of them, keep it -#define NUM_WEAPONS_TBL_CHECKSUMS 1 +#if defined(MAKE_FS1) && !defined(FS1_DEMO) + #define NUM_WEAPONS_TBL_CHECKSUMS 3 +#else + #define NUM_WEAPONS_TBL_CHECKSUMS 1 +#endif #ifdef FS2_DEMO int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { -266420030, // demo 1 }; +#elif FS1_DEMO +int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { + -1246928725, // FS1 DEMO +}; +#elif MAKE_FS1 +int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { + -834598107, // FS1 1.06 Full (US) + -1652231417, // FS1 SilentThreat + 720209793 // FS1 1.06 Full (German) +}; #else /* int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = { @@ -8824,7 +9074,7 @@ int game_hacked_data() void display_title_screen() { -#if defined(FS2_DEMO) || defined(OEM_BUILD) +#if defined(FS2_DEMO) || defined(OEM_BUILD) || defined(FS1_DEMO) ///int title_bitmap; // load bitmap @@ -8859,7 +9109,7 @@ void display_title_screen() gr_flip(); bm_unload(title_bitmap); -#endif // FS2_DEMO || OEM_BUILD +#endif // FS2_DEMO || OEM_BUILD || FS1_DEMO } // return true if the game is running with "low memory", which is less than 48MB @@ -8871,4 +9121,3 @@ bool game_using_low_mem() return true; } } - diff --git a/src/gamehelp/contexthelp.cpp b/src/gamehelp/contexthelp.cpp index 4c509f6..829c5d5 100644 --- a/src/gamehelp/contexthelp.cpp +++ b/src/gamehelp/contexthelp.cpp @@ -15,6 +15,9 @@ * Functions to drive the context-sensitive help * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -171,6 +174,32 @@ typedef struct { int rbracketcount; } help_overlay; +// Added for FS1 +char *Help_overlays[MAX_HELP_OVERLAYS] = { + "ship_help_over", + "weapon_help_over", +#ifndef FS1_DEMO + "brief_help_over", + "main_help_overlay", +#else + "Briefing_Help_Overlay_Demo", + "main_help_overlay_demo", +#endif + "barracks_help", + "control_help", + "debrief_help", + "multicreate_help", + "multistart_help", + "multijoin_help", + "main_help_overlay2", + "hotkey_help", + "campaign_help", + "simulator_help", + "tech_help", +// "tech_help2", + "command_help" +}; + // new help.tbl file way char *help_overlay_section_names[MAX_HELP_OVERLAYS] = { "$ship", // ship_help @@ -199,14 +228,20 @@ shader Grey_shader; //////////////////////////////////////////////////////////////////// // Module globals //////////////////////////////////////////////////////////////////// +#ifndef MAKE_FS1 static int help_left_bracket_bitmap; static int help_right_bracket_bitmap; +#endif static help_overlay help_overlaylist[MAX_HELP_OVERLAYS]; static int current_helpid = -1; // the currently active overlay_id, only really used for the debug console funxions int Help_overlay_flags; static int Source_game_state; // state from where F1 was pressed +#ifdef MAKE_FS1 +static int Overlay = -1; +#endif + //////////////////////////////////////////////////////////////////// // Public Functions //////////////////////////////////////////////////////////////////// @@ -245,7 +280,13 @@ void help_overlay_load(int overlay_id) // FIXME - leftover from the old bitmap overlay days - prune this out sometime void help_overlay_unload(int overlay_id) { +#ifdef MAKE_FS1 + if (Overlay >= 0) { + bm_unload(Overlay); + } +#else return; +#endif } // maybe blit a bitmap of a help overlay to the screen @@ -458,6 +499,7 @@ void launch_context_help() // Called once at the beginning of the game to load help bitmaps & data void help_overlay_init() { +#ifndef MAKE_FS1 // load right_bracket bitmap help_right_bracket_bitmap = bm_load("right_bracket"); if(help_right_bracket_bitmap < 0){ @@ -474,12 +516,14 @@ void help_overlay_init() // parse help.tbl parse_helptbl(); +#endif } // parses help.tbl and populates help_overlaylist[] void parse_helptbl() { +#ifndef MAKE_FS1 int overlay_id, currcount; char buf[HELP_MAX_STRING_LENGTH + 1]; int i; @@ -600,6 +644,7 @@ void parse_helptbl() // close localization lcl_ext_close(); +#endif } @@ -607,6 +652,17 @@ void parse_helptbl() // draw overlay on the screen void help_overlay_blit(int overlay_id) { +#ifdef MAKE_FS1 + Overlay = bm_load(Help_overlays[overlay_id]); + if (Overlay < 0){ + Int3(); + } + + if (Overlay >= 0){ + gr_set_bitmap(Overlay); + gr_bitmap(0, 0); + } +#else int idx, width, height; int plinecount = help_overlaylist[overlay_id].plinecount; int textcount = help_overlaylist[overlay_id].textcount; @@ -642,6 +698,7 @@ void help_overlay_blit(int overlay_id) for (idx = 0; idx= 0){ HC_color_sliders[HCS_RED].force_currentItem( HCS_CONV(HUD_config.clr[i].red) ); HC_color_sliders[HCS_GREEN].force_currentItem( HCS_CONV(HUD_config.clr[i].green) ); HC_color_sliders[HCS_BLUE].force_currentItem( HCS_CONV(HUD_config.clr[i].blue) ); HC_color_sliders[HCS_ALPHA].force_currentItem( HCS_CONV(HUD_config.clr[i].alpha) ); } +#endif } // reset some ui components based on HUD config data void hud_config_synch_ui() { - // game_load_palette(); +#ifdef MAKE_FS1 + game_load_palette(); +#endif HUD_init_hud_color_array(); - // HC_sliders[gr_screen.res][HC_BRIGHTNESS_SLIDER].slider.pos = HUD_color_alpha-3; // convert to value from 0-10 +#ifdef MAKE_FS1 + HC_sliders[gr_screen.res][HC_BRIGHTNESS_SLIDER].slider.pos = HUD_color_alpha -3; // convert to value from 0-10 +#else // sync sliders to currently selected gauge hud_config_synch_sliders(HC_gauge_selected); +#endif } // Init the UI components @@ -912,7 +1012,9 @@ void hud_config_init_ui() struct HC_gauge_region *hg; struct ui_button_info *hb; -// common_set_interface_palette("HUDConfigPalette"); // set the interface palette +#ifdef MAKE_FS1 + common_set_interface_palette("HUDConfigPalette"); // set the interface palette +#endif hud_config_synch_ui(); HC_background_bitmap = bm_load(Hud_config_fname[gr_screen.res]); @@ -930,12 +1032,17 @@ void hud_config_init_ui() hg->button.hide(); hg->button.link_hotspot(hg->hotspot); - // if ( hg->use_iff ) { -// hg->bitmap = bm_load_animation(hg->filename, &hg->nframes); - // } else { +#ifdef MAKE_FS1 + if ( hg->use_iff ) { + hg->bitmap = bm_load_animation(hg->filename, &hg->nframes); + } else { + hg->bitmap = bm_load(hg->filename); + hg->nframes = 1; + } +#else hg->bitmap = bm_load(hg->filename); hg->nframes = 1; - // } +#endif } // add text @@ -943,6 +1050,7 @@ void hud_config_init_ui() HC_ui_window.add_XSTR(&HC_text[gr_screen.res][i]); } +#ifndef MAKE_FS1 // initialize sliders HC_color_sliders[HCS_RED].create(&HC_ui_window, HC_slider_coords[gr_screen.res][HCS_RED][0], HC_slider_coords[gr_screen.res][HCS_RED][1], HC_slider_coords[gr_screen.res][HCS_RED][2], HC_slider_coords[gr_screen.res][HCS_RED][3], 255, HC_slider_fname[gr_screen.res], hud_config_red_slider, hud_config_red_slider, hud_config_red_slider); @@ -955,6 +1063,7 @@ void hud_config_init_ui() HC_color_sliders[HCS_ALPHA].create(&HC_ui_window, HC_slider_coords[gr_screen.res][HCS_ALPHA][0], HC_slider_coords[gr_screen.res][HCS_ALPHA][1], HC_slider_coords[gr_screen.res][HCS_ALPHA][2], HC_slider_coords[gr_screen.res][HCS_ALPHA][3], 255, HC_slider_fname[gr_screen.res], hud_config_alpha_slider_up, hud_config_alpha_slider_down, NULL); +#endif hud_config_color_init(); @@ -971,14 +1080,12 @@ void hud_config_init_ui() HC_fname_input.create(&HC_ui_window, HC_fname_coords[gr_screen.res][0], HC_fname_coords[gr_screen.res][1], HC_fname_coords[gr_screen.res][2], MAX_FILENAME_LEN, "", UI_INPUTBOX_FLAG_INVIS | UI_INPUTBOX_FLAG_ESC_FOC); HC_fname_input.set_text(""); - /* +#ifdef MAKE_FS1 for (i=0; i= 0 ) { + Assert(offset < HC_gauge_regions[gr_screen.res][i].nframes); + gr_set_bitmap(HC_gauge_regions[gr_screen.res][i].bitmap+offset); + gr_bitmap(HC_gauge_regions[gr_screen.res][i].x, HC_gauge_regions[gr_screen.res][i].y); + } + } + } +#endif } else { // if its off, make it dark gray gr_init_alphacolor(&use_color, 127, 127, 127, 64); @@ -1159,6 +1293,7 @@ void hud_config_check_regions() hud_config_select_all_toggle(0); // maybe setup rgb sliders +#ifndef MAKE_FS1 if(HC_gauge_regions[gr_screen.res][i].use_iff){ HC_color_sliders[HCS_RED].hide(); HC_color_sliders[HCS_GREEN].hide(); @@ -1185,6 +1320,7 @@ void hud_config_check_regions() HC_color_sliders[HCS_BLUE].force_currentItem( HCS_CONV(HUD_config.clr[i].blue) ); HC_color_sliders[HCS_ALPHA].force_currentItem( HCS_CONV(HUD_config.clr[i].alpha) ); } +#endif // recalc alpha slider hud_config_recalc_alpha_slider(); @@ -1223,7 +1359,9 @@ void hud_config_set_color(int color) hud_config_record_color(color); - // game_load_palette(); +#ifdef MAKE_FS1 + game_load_palette(); +#endif HUD_init_hud_color_array(); @@ -1304,8 +1442,10 @@ void hud_config_handle_keypresses(int k) // Handlers for when buttons get pressed void hud_config_button_do(int n) { +#ifndef MAKE_FS1 int idx; char name[256] = ""; +#endif switch (n) { case HCB_AMBER: @@ -1352,6 +1492,7 @@ void hud_config_button_do(int n) break; // new stuff +#ifndef MAKE_FS1 case HCB_RED_UP: if( HCS_CONV(HC_color_sliders[HCS_RED].get_currentItem()) >= 255){ gamesnd_play_iface(SND_GENERAL_FAIL); @@ -1513,6 +1654,7 @@ void hud_config_button_do(int n) case HCB_SELECT_ALL: hud_config_select_all_toggle(!HC_select_all); break; +#endif // MAKE_FS1 default: Int3(); @@ -1638,7 +1780,7 @@ void hud_config_render_description() void hud_config_render_special_bitmaps() { - /* +#ifdef MAKE_FS1 int i; for (i=1; i= 0) { @@ -1646,15 +1788,17 @@ void hud_config_render_special_bitmaps() gr_bitmap(HC_special_bitmaps[i].x, HC_special_bitmaps[i].y); } } - */ +#endif } // update HUD_color_alpha based on brightness slider void hud_config_update_brightness() { - // HUD_color_alpha = HC_sliders[gr_screen.res][HC_BRIGHTNESS_SLIDER].slider.pos+3; - // Assert(HUD_color_alpha >= HUD_COLOR_ALPHA_USER_MIN); - // Assert(HUD_color_alpha <= HUD_COLOR_ALPHA_USER_MAX); +#ifdef MAKE_FS1 + HUD_color_alpha = HC_sliders[gr_screen.res][HC_BRIGHTNESS_SLIDER].slider.pos+3; + Assert(HUD_color_alpha >= HUD_COLOR_ALPHA_USER_MIN); + Assert(HUD_color_alpha <= HUD_COLOR_ALPHA_USER_MAX); +#endif } // redraw any pressed buttons, needed since the glow on pressed buttons might get clipped off by @@ -1710,18 +1854,20 @@ void hud_config_do_frame(float frametime) hud_config_draw_gauge_status(); hud_config_draw_color_status(); - /* +#ifdef MAKE_FS1 if (HC_special_bitmaps[HC_SPECIAL_RETICLE].bitmap >= 0) { hud_set_default_color(); gr_set_bitmap(HC_special_bitmaps[HC_SPECIAL_RETICLE].bitmap); gr_aabitmap(HC_special_bitmaps[HC_SPECIAL_RETICLE].x, HC_special_bitmaps[HC_SPECIAL_RETICLE].y); } - */ +#endif // maybe force draw the select all button +#ifndef MAKE_FS1 if(HC_select_all){ HC_buttons[gr_screen.res][HCB_SELECT_ALL].button.draw_forced(2); } +#endif hud_config_render_gauges(); hud_config_render_special_bitmaps(); @@ -1753,7 +1899,9 @@ void hud_config_unload_gauges() // void hud_config_close() { -// common_free_interface_palette(); // restore game palette +#ifdef MAKE_FS1 + common_free_interface_palette(); // restore game palette +#endif hud_config_unload_gauges(); hud_init_popup_timers(); // ensure no popup gauges are active @@ -1881,6 +2029,7 @@ void hud_config_color_load(char *name) void hud_config_alpha_slider_up() { +#ifndef MAKE_FS1 int pos = HCS_CONV(HC_color_sliders[HCS_ALPHA].get_currentItem()); int max = max(max( HCS_CONV(HC_color_sliders[HCS_RED].get_currentItem()), HCS_CONV(HC_color_sliders[HCS_GREEN].get_currentItem()) ), HCS_CONV(HC_color_sliders[HCS_BLUE].get_currentItem()) ); @@ -1901,10 +2050,12 @@ void hud_config_alpha_slider_up() } else { gr_init_alphacolor(&HUD_config.clr[HC_gauge_selected], HCS_CONV(HC_color_sliders[HCS_RED].get_currentItem()), HCS_CONV(HC_color_sliders[HCS_GREEN].get_currentItem()), HCS_CONV(HC_color_sliders[HCS_BLUE].get_currentItem()), 255); } +#endif } void hud_config_alpha_slider_down() { +#ifndef MAKE_FS1 int pos = HCS_CONV(HC_color_sliders[HCS_ALPHA].get_currentItem()); int min = min(min( HCS_CONV(HC_color_sliders[HCS_RED].get_currentItem()), HCS_CONV(HC_color_sliders[HCS_GREEN].get_currentItem()) ), HCS_CONV(HC_color_sliders[HCS_BLUE].get_currentItem()) ); @@ -1925,17 +2076,21 @@ void hud_config_alpha_slider_down() } else { gr_init_alphacolor(&HUD_config.clr[HC_gauge_selected], HCS_CONV(HC_color_sliders[HCS_RED].get_currentItem()), HCS_CONV(HC_color_sliders[HCS_GREEN].get_currentItem()), HCS_CONV(HC_color_sliders[HCS_BLUE].get_currentItem()), 255); } +#endif } void hud_config_recalc_alpha_slider() { +#ifndef MAKE_FS1 int avg =HC_color_sliders[HCS_RED].get_currentItem() + HC_color_sliders[HCS_GREEN].get_currentItem() + HC_color_sliders[HCS_BLUE].get_currentItem(); avg /= 3; HC_color_sliders[HCS_ALPHA].force_currentItem( avg ); +#endif } void hud_config_red_slider() { +#ifndef MAKE_FS1 int idx; int pos = HCS_CONV(HC_color_sliders[HCS_RED].get_currentItem()) ; @@ -1956,10 +2111,12 @@ void hud_config_red_slider() } hud_config_recalc_alpha_slider(); +#endif } void hud_config_green_slider() { +#ifndef MAKE_FS1 int idx; int pos = HCS_CONV(HC_color_sliders[HCS_GREEN].get_currentItem()) ; @@ -1980,10 +2137,12 @@ void hud_config_green_slider() } hud_config_recalc_alpha_slider(); +#endif } void hud_config_blue_slider() { +#ifndef MAKE_FS1 int idx; int pos = HCS_CONV(HC_color_sliders[HCS_BLUE].get_currentItem()); @@ -2004,6 +2163,7 @@ void hud_config_blue_slider() } hud_config_recalc_alpha_slider(); +#endif } void hud_config_process_colors() @@ -2034,6 +2194,7 @@ void hud_config_color_close() void hud_config_select_all_toggle(int toggle) { +#ifndef MAKE_FS1 int r, g, b, a; // if we're turning off @@ -2087,5 +2248,5 @@ void hud_config_select_all_toggle(int toggle) HC_select_all = 1; } +#endif } - diff --git a/src/hud/hudlock.cpp b/src/hud/hudlock.cpp index 6396dee..8ad5fdb 100644 --- a/src/hud/hudlock.cpp +++ b/src/hud/hudlock.cpp @@ -15,6 +15,9 @@ * C module that controls missile locking * * $Log$ + * Revision 1.6 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -325,7 +328,11 @@ float Lock_triangle_height[GR_NUM_RESOLUTIONS] = { }; int Lock_gauge_half_w[GR_NUM_RESOLUTIONS] = { - 17, +#ifdef MAKE_FS1 + 15, +#else + 17, +#endif 28 }; int Lock_gauge_half_h[GR_NUM_RESOLUTIONS] = { @@ -341,11 +348,19 @@ int Lock_gauge_draw_stamp = -1; #define LOCK_GAUGE_BLINK_RATE 5 // blinks/sec int Lockspin_half_w[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 16, +#else 31, +#endif 50 }; int Lockspin_half_h[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 16, +#else 32, +#endif 52 }; hud_anim Lock_anim; @@ -835,7 +850,12 @@ void hud_draw_lock_triangles(int center_x, int center_y, float frametime) // if its still animating if(Lock_anim.time_elapsed < Lock_anim.total_time){ +#ifdef MAKE_FS1 + // loop it + hud_anim_render(&Lock_anim, frametime, 1, 1, 0); +#else hud_anim_render(&Lock_anim, frametime, 1, 0, 1); +#endif } else { // if the timestamp is unset or expired if((Lock_gauge_draw_stamp < 0) || timestamp_elapsed(Lock_gauge_draw_stamp)){ @@ -849,7 +869,12 @@ void hud_draw_lock_triangles(int center_x, int center_y, float frametime) // maybe draw the anim Lock_gauge.time_elapsed = 0.0f; if(Lock_gauge_draw){ +#ifdef MAKE_FS1 + // loop it + hud_anim_render(&Lock_anim, frametime, 1, 1, 0); +#else hud_anim_render(&Lock_anim, frametime, 1, 0, 1); +#endif } } } diff --git a/src/hud/hudmessage.cpp b/src/hud/hudmessage.cpp index 7464366..b991819 100644 --- a/src/hud/hudmessage.cpp +++ b/src/hud/hudmessage.cpp @@ -15,6 +15,9 @@ * C module that controls and manages the message window on the HUD * * $Log$ + * Revision 1.7 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.6 2002/07/28 05:05:08 relnev * removed some old stuff * @@ -505,7 +508,8 @@ static int Hud_mission_log_time2_coords[GR_NUM_RESOLUTIONS][2] = { //#define HUD_MSG_MAX_PIXEL_W 439 // maximum number of pixels wide message display area is //#define HUD_MSG_MAX_PIXEL_W 619 // maximum number of pixels wide message display area is -/* // No Longer Used - DDOI +#ifdef MAKE_FS1 +// No Longer Used - DDOI static int Hud_mission_log_status_coords[GR_NUM_RESOLUTIONS][2] = { { 170, 339 // GR_640 @@ -514,7 +518,7 @@ static int Hud_mission_log_status_coords[GR_NUM_RESOLUTIONS][2] = { 361, 542 // GR_1024 } }; -*/ +#endif struct scrollback_buttons { char *filename; @@ -570,7 +574,9 @@ static int Num_obj_lines; static int Scroll_offset; static int Scroll_max; static int Scrollback_mode = SCROLLBACK_MODE_OBJECTIVES; -// static int Status_bitmap; +#ifdef MAKE_FS1 +static int Status_bitmap; +#endif static int Background_bitmap; static UI_WINDOW Ui_window; @@ -579,12 +585,13 @@ static char* Hud_mission_log_fname[GR_NUM_RESOLUTIONS] = { "2_MissionLog" // GR_1024 }; -/* // No longer used - DDOI +#ifdef MAKE_FS1 +// No longer used - DDOI static char* Hud_mission_log_status_fname[GR_NUM_RESOLUTIONS] = { "MLStatus", // GR_640 "MLStatus" // GR_1024 }; -*/ +#endif static char* Hud_mission_log_mask_fname[GR_NUM_RESOLUTIONS] = { "MissionLog-m", // GR_640 @@ -594,12 +601,21 @@ static char* Hud_mission_log_mask_fname[GR_NUM_RESOLUTIONS] = { static scrollback_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 //XSTR:OFF +#ifdef MAKE_FS1 + scrollback_buttons("LB_00", 7, 89, -1, -1, 0), // scroll up + scrollback_buttons("LB_01", 7, 133, -1, -1, 1), // scroll down + scrollback_buttons("LB_02", 294, 362, -1, -1, 2), // messages + scrollback_buttons("LB_03", 402, 362, -1, -1, 3), // events + scrollback_buttons("LB_04", 193, 362, -1, -1, 4), // objectives + scrollback_buttons("LB_05", 554, 411, -1, -1, 5) // continue +#else scrollback_buttons("LB_00", 1, 67, -1, -1, 0), scrollback_buttons("LB_01", 1, 307, -1, -1, 1), scrollback_buttons("LB_02", 111, 376, 108, 413, 2), scrollback_buttons("LB_03", 209, 376, 205, 413, 3), scrollback_buttons("LB_04", 12, 376, 7, 413, 4), scrollback_buttons("CB_05a", 571, 425, 564, 413, 5) +#endif //XSTR:ON }, { // GR_1024 @@ -1346,17 +1362,21 @@ void hud_scrollback_init() } // add all strings +#ifndef MAKE_FS1 Ui_window.add_XSTR("Continue", 1069, Buttons[gr_screen.res][ACCEPT_BUTTON].xt, Buttons[gr_screen.res][ACCEPT_BUTTON].yt, &Buttons[gr_screen.res][ACCEPT_BUTTON].button, UI_XSTR_COLOR_PINK); Ui_window.add_XSTR("Events", 1070, Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].xt, Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].yt, &Buttons[gr_screen.res][SHOW_EVENTS_BUTTON].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Objectives", 1071, Buttons[gr_screen.res][SHOW_OBJS_BUTTON].xt, Buttons[gr_screen.res][SHOW_OBJS_BUTTON].yt, &Buttons[gr_screen.res][SHOW_OBJS_BUTTON].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Messages", 1072, Buttons[gr_screen.res][SHOW_MSGS_BUTTON].xt, Buttons[gr_screen.res][SHOW_MSGS_BUTTON].yt, &Buttons[gr_screen.res][SHOW_MSGS_BUTTON].button, UI_XSTR_COLOR_GREEN); +#endif // set up hotkeys for buttons so we draw the correct animation frame when a key is pressed Buttons[gr_screen.res][SCROLL_UP_BUTTON].button.set_hotkey(KEY_UP); Buttons[gr_screen.res][SCROLL_DOWN_BUTTON].button.set_hotkey(KEY_DOWN); Background_bitmap = bm_load(Hud_mission_log_fname[gr_screen.res]); - // Status_bitmap = bm_load(Hud_mission_log_status_fname[gr_screen.res]); +#ifdef MAKE_FS1 + Status_bitmap = bm_load(Hud_mission_log_status_fname[gr_screen.res]); +#endif message_log_init_scrollback(Hud_mission_log_list_coords[gr_screen.res][2]); if (Scrollback_mode == SCROLLBACK_MODE_EVENT_LOG) @@ -1376,8 +1396,10 @@ void hud_scrollback_close() message_log_shutdown_scrollback(); if (Background_bitmap >= 0) bm_unload(Background_bitmap); - //if (Status_bitmap >= 0) - // bm_unload(Status_bitmap); +#ifdef MAKE_FS1 + if (Status_bitmap >= 0) + bm_unload(Status_bitmap); +#endif Ui_window.destroy(); common_free_interface_palette(); // restore game palette @@ -1470,12 +1492,12 @@ void hud_scrollback_do_frame(float frametime) gr_bitmap(0, 0); } - /* +#ifdef MAKE_FS1 if ((Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) && (Status_bitmap >= 0)) { gr_set_bitmap(Status_bitmap); gr_bitmap(Hud_mission_log_status_coords[gr_screen.res][0], Hud_mission_log_status_coords[gr_screen.res][1]); } - */ +#endif // draw the objectives key at the bottom of the ingame objectives screen if (Scrollback_mode == SCROLLBACK_MODE_OBJECTIVES) { diff --git a/src/hud/hudreticle.cpp b/src/hud/hudreticle.cpp index 4adba9b..22d52d2 100644 --- a/src/hud/hudreticle.cpp +++ b/src/hud/hudreticle.cpp @@ -15,6 +15,9 @@ * C module to draw and manage the recticle * * $Log$ + * Revision 1.6 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.5 2003/05/22 15:58:44 taylor * fix missed German build option for auto-lang * @@ -211,20 +214,28 @@ static int Reticle_inited = 0; -#define NUM_RETICLE_ANIS 6 // keep up to date when modifying the number of reticle ani files +#ifdef MAKE_FS1 + #define NUM_RETICLE_ANIS 11 +#else + #define NUM_RETICLE_ANIS 6 // keep up to date when modifying the number of reticle ani files +#endif #define RETICLE_TOP_ARC 0 #define RETICLE_LASER_WARN 1 #define RETICLE_LOCK_WARN 2 #define RETICLE_LEFT_ARC 3 #define RETICLE_RIGHT_ARC 4 -//#define RETICLE_ONE_PRIMARY 5 -//#define RETICLE_TWO_PRIMARY 6 -//#define RETICLE_ONE_SECONDARY 7 -//#define RETICLE_TWO_SECONDARY 8 -//#define RETICLE_THREE_SECONDARY 9 -// #define RETICLE_LAUNCH_LABEL 5 -#define RETICLE_CENTER 5 +#ifdef MAKE_FS1 +#define RETICLE_ONE_PRIMARY 5 +#define RETICLE_TWO_PRIMARY 6 +#define RETICLE_ONE_SECONDARY 7 +#define RETICLE_TWO_SECONDARY 8 +#define RETICLE_THREE_SECONDARY 9 +#define RETICLE_CENTER 10 +// #define RETICLE_LAUNCH_LABEL 11 +#else +#define RETICLE_CENTER 5 +#endif int Hud_throttle_frame_h[GR_NUM_RESOLUTIONS] = { 85, @@ -235,15 +246,27 @@ int Hud_throttle_frame_w[GR_NUM_RESOLUTIONS] = { 78 }; int Hud_throttle_frame_bottom_y[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 330, +#else 325, +#endif 520 }; int Hud_throttle_h[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 49, +#else 50, +#endif 80 }; int Hud_throttle_bottom_y[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 312, +#else 307, +#endif 491 }; int Hud_throttle_aburn_h[GR_NUM_RESOLUTIONS] = { @@ -273,18 +296,27 @@ char Reticle_frame_names[GR_NUM_RESOLUTIONS][NUM_RETICLE_ANIS][MAX_FILENAME_LEN] { //XSTR:OFF { // GR_640 +#ifdef MAKE_FS1 "toparc1", "toparc2", "toparc3", "leftarc", "rightarc1", -/* "rightarc2", + "rightarc2", "rightarc3", "rightarc4", "rightarc5", - "rightarc6", - "toparc4", */ - "reticle1", + "rightarc6", +// "toparc4", + "reticle1", +#else + "toparc1", + "toparc2", + "toparc3", + "leftarc", + "rightarc1", + "reticle1", +#endif }, { // GR_1024 "2_toparc1", @@ -292,12 +324,14 @@ char Reticle_frame_names[GR_NUM_RESOLUTIONS][NUM_RETICLE_ANIS][MAX_FILENAME_LEN] "2_toparc3", "2_leftarc", "2_rightarc1", -/* "2_rightarc2", +#ifdef MAKE_FS1 + "2_rightarc2", "2_rightarc3", "2_rightarc4", "2_rightarc5", "2_rightarc6", - "2_toparc4", */ + // "2_toparc4", +#endif "2_reticle1", } //XSTR:ON @@ -306,18 +340,27 @@ char Reticle_frame_names[GR_NUM_RESOLUTIONS][NUM_RETICLE_ANIS][MAX_FILENAME_LEN] // reticle frame coords int Reticle_frame_coords[GR_NUM_RESOLUTIONS][NUM_RETICLE_ANIS][2] = { { // GR_640 - {241, 137}, - {400, 245}, - {394, 261}, - {216, 168}, - {359, 168}, -// {406, 253}, -// {406, 253}, -// {391, 276}, -// {391, 276}, -// {391, 276}, -// {297, 161}, - {308, 235} +#ifdef MAKE_FS1 + {241, 139}, // toparc1 + {300, 139}, // toparc2 + {320, 139}, // toparc3 + {220, 246}, // leftarc + {374, 244}, // rightarc1 + {406, 255}, // rightarc2 + {406, 255}, // rightarc3 + {391, 278}, // rightarc4 + {391, 278}, // rightarc5 + {391, 278}, // rightarc6 + // {297, 162}, // toparc4 + {308, 233} // reticle1 +#else + {241, 137}, // toparc1 + {400, 245}, // toparc2 + {394, 261}, // toparc3 + {216, 168}, // leftarc + {359, 168}, // rightarc1 + {308, 235} // reticle1 +#endif }, { // GR_1024 {386, 219}, @@ -325,12 +368,14 @@ int Reticle_frame_coords[GR_NUM_RESOLUTIONS][NUM_RETICLE_ANIS][2] = { {631, 419}, {346, 269}, {574, 269}, -// {649, 401}, -// {649, 401}, -// {625, 438}, -// {625, 438}, -// {625, 438}, +#ifdef MAKE_FS1 + {649, 401}, + {649, 401}, + {625, 438}, + {625, 438}, + {625, 438}, // {475, 258}, +#endif {493, 370} } }; @@ -578,7 +623,9 @@ void hud_show_throttle() } // draw left arc (the dark portion of the throttle gauge) - // hud_render_throttle_background(y_end); +#ifdef MAKE_FS1 + hud_render_throttle_background(y_end); +#endif // draw throttle speed number hud_render_throttle_speed(current_speed, y_end); @@ -593,7 +640,7 @@ void hud_show_throttle() gr_printf(Zero_speed_coords[gr_screen.res][0], Zero_speed_coords[gr_screen.res][1], XSTR( "0", 292)); } -/* +#ifdef MAKE_FS1 // Draw the primary and secondary weapon indicators along the right arc of the reticle void hud_show_reticle_weapons() { @@ -682,7 +729,7 @@ void hud_show_reticle_weapons() GR_AABITMAP(Reticle_gauges[gauge_index].first_frame+frame_offset, Reticle_frame_coords[gr_screen.res][gauge_index][0], Reticle_frame_coords[gr_screen.res][gauge_index][1]); } } -*/ +#endif // Draw the lock threat gauge on the HUD. Use Threat_flags to determine if a // threat exists, and draw flashing frames. @@ -794,30 +841,32 @@ void hud_show_right_arc() { hud_set_gauge_color(HUD_CENTER_RETICLE); +#ifndef MAKE_FS1 GR_AABITMAP(Reticle_gauges[RETICLE_RIGHT_ARC].first_frame+1, Reticle_frame_coords[gr_screen.res][RETICLE_RIGHT_ARC][0], Reticle_frame_coords[gr_screen.res][RETICLE_RIGHT_ARC][1]); +#else // draw the weapons indicators in the holes along the right arc - /* if ( hud_gauge_active(HUD_WEAPON_LINKING_GAUGE) ) { // draw right arc with holes in it GR_AABITMAP(Reticle_gauges[RETICLE_RIGHT_ARC].first_frame+1, Reticle_frame_coords[gr_screen.res][RETICLE_RIGHT_ARC][0], Reticle_frame_coords[gr_screen.res][RETICLE_RIGHT_ARC][1]); - // the following line was removed by Jasen to get rid of "undeclared identifier" // hehe - DB -// hud_show_reticle_weapons(); + hud_show_reticle_weapons(); } else { // draw right arc without any holes GR_AABITMAP(Reticle_gauges[RETICLE_RIGHT_ARC].first_frame, Reticle_frame_coords[gr_screen.res][RETICLE_RIGHT_ARC][0], Reticle_frame_coords[gr_screen.res][RETICLE_RIGHT_ARC][1]); } - */ +#endif } // Draw the left portion of the reticle void hud_show_left_arc() { +#ifndef MAKE_FS1 // FS1: is drawn another way // draw left arc (the dark portion of the throttle gauge) hud_set_gauge_color(HUD_CENTER_RETICLE); GR_AABITMAP(Reticle_gauges[RETICLE_LEFT_ARC].first_frame, Reticle_frame_coords[gr_screen.res][RETICLE_LEFT_ARC][0], Reticle_frame_coords[gr_screen.res][RETICLE_LEFT_ARC][1]); +#endif // draw the throttle if ( hud_gauge_active(HUD_THROTTLE_GAUGE) ) { diff --git a/src/hud/hudtarget.cpp b/src/hud/hudtarget.cpp index 347d5b9..e7cba7e 100644 --- a/src/hud/hudtarget.cpp +++ b/src/hud/hudtarget.cpp @@ -15,6 +15,9 @@ * C module to provide HUD targeting functions * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -450,6 +453,7 @@ char Toggle_fname[GR_NUM_RESOLUTIONS][MAX_FILENAME_LEN] = { #define TOGGLE_TEXT_TARGET 1 #define TOGGLE_TEXT_AUTOS 2 #define TOGGLE_TEXT_SPEED 3 +#ifndef MAKE_FS1 static int Hud_toggle_coords[GR_NUM_RESOLUTIONS][4][2] = { { // GR_640 { 590, 382 }, @@ -464,6 +468,7 @@ static int Hud_toggle_coords[GR_NUM_RESOLUTIONS][4][2] = { { 970, 682 } } }; +#endif static int Toggle_text_alpha = 255; @@ -2499,7 +2504,7 @@ void hud_target_in_reticle_new() break; case OBJ_ASTEROID: { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) int subtype = 0; subtype = Asteroids[A->instance].asteroid_subtype; mc.model_num = Asteroid_info[Asteroids[A->instance].type].model_num[subtype]; @@ -3433,7 +3438,7 @@ void hud_show_brackets(object *targetp, vertex *projected_v) bound_rc = model_find_2d_bound_min( modelnum, &targetp->orient, &targetp->pos,&x1,&y1,&x2,&y2 ); break; -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) case OBJ_ASTEROID: { int subtype = 0; @@ -5079,6 +5084,7 @@ void hud_auto_target_icon() hud_set_gauge_color(HUD_AUTO_TARGET); GR_AABITMAP(Toggle_gauge.first_frame+frame_offset, Toggle_target_gauge_coords[gr_screen.res][0], Toggle_target_gauge_coords[gr_screen.res][1]); +#ifndef MAKE_FS1 // Text already on bitmap // draw the text on top if (frame_offset == 1) { color text_color; @@ -5088,6 +5094,7 @@ void hud_auto_target_icon() } gr_string(Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_AUTOT][0], Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_AUTOT][1], XSTR("auto", 1463)); gr_string(Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_TARGET][0], Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_TARGET][1], XSTR("target", 1465)); +#endif } // draw auto-speed match icon @@ -5105,6 +5112,7 @@ void hud_auto_speed_match_icon() GR_AABITMAP(Toggle_gauge.first_frame+frame_offset, Toggle_speed_gauge_coords[gr_screen.res][0], Toggle_speed_gauge_coords[gr_screen.res][1]); +#ifndef MAKE_FS1 // Text already on bitmap // draw the text on top if (frame_offset == 3) { color text_color; @@ -5113,6 +5121,7 @@ void hud_auto_speed_match_icon() } gr_string(Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_AUTOS][0], Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_AUTOS][1], XSTR("auto", 1463)); gr_string(Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_SPEED][0], Hud_toggle_coords[gr_screen.res][TOGGLE_TEXT_SPEED][1], XSTR("speed", 1464)); +#endif } // display the auto-targeting and auto-speed-matching icons on the HUD diff --git a/src/hud/hudtargetbox.cpp b/src/hud/hudtargetbox.cpp index 368d112..4e1046e 100644 --- a/src/hud/hudtargetbox.cpp +++ b/src/hud/hudtargetbox.cpp @@ -15,6 +15,9 @@ * C module for drawing the target monitor box on the HUD * * $Log$ + * Revision 1.6 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/18 08:58:53 relnev * last few struct changes * @@ -786,7 +789,7 @@ void hud_render_target_jump_node(object *target_objp) // void hud_render_target_asteroid(object *target_objp) { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) vector obj_pos = {0.0f,0.0f,0.0f}; vector camera_eye = {0.0f,0.0f,0.0f}; matrix camera_orient = IDENTITY_MATRIX; @@ -838,6 +841,7 @@ void hud_render_target_asteroid(object *target_objp) strcpy(hud_name, NOX("asteroid")); break; +#ifndef MAKE_FS1 case DEBRIS_TERRAN_SMALL: case DEBRIS_TERRAN_MEDIUM: case DEBRIS_TERRAN_LARGE: @@ -855,6 +859,7 @@ void hud_render_target_asteroid(object *target_objp) case DEBRIS_SHIVAN_LARGE: strcpy(hud_name, NOX("shivan debris")); break; +#endif default: Int3(); diff --git a/src/io/joy.cpp b/src/io/joy.cpp index 681ccd2..71eca42 100644 --- a/src/io/joy.cpp +++ b/src/io/joy.cpp @@ -15,6 +15,9 @@ * Code to read the joystick * * $Log$ + * Revision 1.4 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:21 relnev * added copyright header * @@ -383,7 +386,7 @@ DWORD joy_process(DWORD lparam) /// I DON'T WANT TO CALL CRITICAL SECTION CODE EACH FRAME TO CHECK ALL THE JOYSTICK BUTTONS. /// PLEASE SEE ALAN FOR MORE INFORMATION. //////////////////////////// -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) { extern void demo_reset_trailer_timer(); demo_reset_trailer_timer(); diff --git a/src/io/keycontrol.cpp b/src/io/keycontrol.cpp index 8108446..c816463 100644 --- a/src/io/keycontrol.cpp +++ b/src/io/keycontrol.cpp @@ -15,6 +15,9 @@ * Routines to read and deal with keyboard input. * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2002/07/28 05:05:08 relnev * removed some old stuff * @@ -339,6 +342,7 @@ #include "missionmessage.h" #include "mainhallmenu.h" #include "aigoals.h" +#include "localize.h" // -------------------------------------------------------------- // Global to file @@ -360,8 +364,12 @@ typedef struct asteroid_field { char CheatBuffer[CHEAT_BUFFER_LEN+1]; -#ifdef FS2_DEMO +#if defined(FS2_DEMO) char *Cheat_code_demo = NOX("33BE^(8]C01(:=BHt"); +#elif defined(MAKE_FS1) + char *Cheat_code_gr = NOX("BNdEgDB\\s?0XD1?0)"); // de:www.volition-inc.com + char *Cheat_code = NOX("E5B?(\"=H'5UTE$o%D"); // www.volition-inc.com + char *Cheat_code_movies = NOX("iC:1C06,'00SoXyY6"); // freespacestandsalone #else char *Cheat_code = NOX("33BE^(8]C01(:=BHt"); // www.freespace2.com char *Cheat_code_fish = NOX("bDc9y+$;#AIDRoouM"); // vasudanswuvfishes @@ -983,7 +991,9 @@ void process_debug_keys(int k) break; case KEY_DEBUGGED + KEY_O: - // case KEY_DEBUGGED1 + KEY_O: +#ifdef MAKE_FS1 + case KEY_DEBUGGED1 + KEY_O: +#endif toggle_player_object(); break; @@ -1028,17 +1038,23 @@ void process_debug_keys(int k) break; case KEY_DEBUGGED + KEY_G: - // case KEY_DEBUGGED1 + KEY_G: +#ifdef MAKE_FS1 + case KEY_DEBUGGED1 + KEY_G: +#endif mission_goal_mark_all_true( PRIMARY_GOAL ); break; case KEY_DEBUGGED + KEY_G + KEY_SHIFTED: - // case KEY_DEBUGGED1 + KEY_G + KEY_SHIFTED: +#ifdef MAKE_FS1 + case KEY_DEBUGGED1 + KEY_G + KEY_SHIFTED: +#endif mission_goal_mark_all_true( SECONDARY_GOAL ); break; case KEY_DEBUGGED + KEY_G + KEY_ALTED: - // case KEY_DEBUGGED1 + KEY_G + KEY_ALTED: +#ifdef MAKE_FS1 + case KEY_DEBUGGED1 + KEY_G + KEY_ALTED: +#endif mission_goal_mark_all_true( BONUS_GOAL ); break; @@ -1055,7 +1071,7 @@ void process_debug_keys(int k) break; } - /* +#ifdef MAKE_FS1 case KEY_DEBUGGED + KEY_SHIFTED + KEY_9: { case KEY_DEBUGGED1 + KEY_SHIFTED + KEY_9: ship* shipp; @@ -1068,9 +1084,9 @@ void process_debug_keys(int k) HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Secondary Weapon forced to %s", 18), Weapon_info[shipp->weapons.secondary_bank_weapons[shipp->weapons.current_secondary_bank]].name); break; } - */ +#endif -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) case KEY_DEBUGGED + KEY_U: { case KEY_DEBUGGED1 + KEY_U: // launch asteroid @@ -1260,9 +1276,11 @@ void process_debug_keys(int k) case KEY_DEBUGGED + KEY_SHIFTED + KEY_8: beam_test(8); break; +#ifndef MAKE_FS1 case KEY_DEBUGGED + KEY_SHIFTED + KEY_9: beam_test(9); break; +#endif case KEY_DEBUGGED + KEY_CTRLED + KEY_1: beam_test_new(1); @@ -1358,7 +1376,7 @@ void process_debug_keys(int k) void ppsk_hotkeys(int k) { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) // use k to check for keys that can have Shift,Ctrl,Alt,Del status int hotkey_set; @@ -1627,7 +1645,7 @@ void game_process_cheats(int k) cryptstring=jcrypt(&CheatBuffer[CHEAT_BUFFER_LEN - CRYPT_STRING_LENGTH]); -#ifdef FS2_DEMO +#if defined(FS2_DEMO) if ( !strcmp(Cheat_code_demo, cryptstring) ) { HUD_printf(XSTR( "Cheats enabled.", 31)); Cheats_enabled = 1; @@ -1636,11 +1654,29 @@ void game_process_cheats(int k) } } +#else + +#ifdef MAKE_FS1 + // two possible cheat codes for FS1, German and English + if (Lcl_gr) { + if( !strcmp(Cheat_code_gr, cryptstring) && !(Game_mode & GM_MULTIPLAYER)){ + Cheats_enabled = 1; + HUD_printf("Cheats enabled"); + } + } else { + if( !strcmp(Cheat_code, cryptstring) && !(Game_mode & GM_MULTIPLAYER)){ + Cheats_enabled = 1; + HUD_printf("Cheats enabled"); + } + } #else if( !strcmp(Cheat_code, cryptstring) && !(Game_mode & GM_MULTIPLAYER)){ Cheats_enabled = 1; HUD_printf("Cheats enabled"); } +#endif + +#ifndef MAKE_FS1 if( !strcmp(Cheat_code_fish, cryptstring) ){ // only enable in the main hall if((gameseq_get_state() == GS_STATE_MAIN_MENU) && (main_hall_id() == 1)){ @@ -1717,8 +1753,20 @@ void game_process_cheats(int k) } } } +#endif // !MAKE_FS1 #endif - /* + +#if defined(MAKE_FS1) && !defined(FS1_DEMO) + if ( !strcmp(Cheat_code_movies, cryptstring) ) { + HUD_printf(XSTR( "All movies available in Tech Room", 32)); + All_movies_enabled = 1; + if (Player->flags & PLAYER_FLAGS_MSG_MODE){ + hud_squadmsg_toggle(); + } + } +#endif + +/* //#ifdef INTERPLAYQA if ( !strcmp(Cheat_code_in_game, cryptstring) ) { HUD_printf(XSTR( "Cheats enabled.", 31)); @@ -2867,6 +2915,4 @@ void button_strip_noncritical_keys(button_info *bi) for(idx=0;idxadd_XSTR("Create", 1034, Buttons[gr_screen.res][0].text_x, Buttons[gr_screen.res][0].text_y, &Buttons[gr_screen.res][0].button, UI_XSTR_COLOR_GREEN); w->add_XSTR("Accept", 1035, Buttons[gr_screen.res][5].text_x, Buttons[gr_screen.res][5].text_y, &Buttons[gr_screen.res][5].button, UI_XSTR_COLOR_PINK); w->add_XSTR("Help", 928, Buttons[gr_screen.res][6].text_x, Buttons[gr_screen.res][6].text_y, &Buttons[gr_screen.res][6].button, UI_XSTR_COLOR_GREEN); @@ -1374,6 +1465,7 @@ void barracks_init() for(int i=0; iadd_XSTR(&Barracks_text[gr_screen.res][i]); } +#endif // button for selecting pilot List_region.create(&Ui_window, "", Barracks_list_coords[gr_screen.res][BARRACKS_X_COORD], Barracks_list_coords[gr_screen.res][BARRACKS_Y_COORD], Barracks_list_coords[gr_screen.res][BARRACKS_W_COORD], Barracks_list_coords[gr_screen.res][BARRACKS_H_COORD], 0, 1); @@ -1395,6 +1487,7 @@ void barracks_init() Cur_pilot = &Players[Player_num]; // disable squad logo selection buttons in single player +#ifndef MAKE_FS1 if(!(Cur_pilot->flags & PLAYER_FLAGS_IS_MULTI)){ // squad logo picture buttons Buttons[gr_screen.res][B_SQUAD_PREV_BUTTON].button.hide(); @@ -1408,12 +1501,15 @@ void barracks_init() Buttons[gr_screen.res][B_SQUAD_NEXT_BUTTON].button.enable(); Buttons[gr_screen.res][B_SQUAD_NEXT_BUTTON].button.unhide(); } +#endif // set up hotkeys for buttons so we draw the correct animation frame when a key is pressed barracks_set_hotkeys(1); // load ramp pips +#ifndef FS1_DEMO Rank_pips_bitmaps = bm_load_animation("IconRankMini.ani", &Rank_pips_count); +#endif // load up the pilot pic list pilot_load_pic_list(); @@ -1447,7 +1543,7 @@ void barracks_init() Buttons[gr_screen.res][B_PILOT_MULTI_MODE_BUTTON].button.hide(); Buttons[gr_screen.res][B_PILOT_MULTI_MODE_BUTTON].button.disable(); #endif - + // base the mode we're in (single or multi) on the status of the currently selected pilot #ifdef MULTIPLAYER_BETA_BUILD barracks_init_player_stuff(1); @@ -1456,6 +1552,13 @@ void barracks_init() #else barracks_init_player_stuff(is_pilot_multi(Player)); #endif + +#if defined(MAKE_FS1) && !defined(FS1_DEMO) + PilotWin01 = bm_load(NOX("PilotWin01")); + PilotWin02 = bm_load(NOX("PilotWin02")); + PilotWin03 = bm_load(NOX("PilotWin03")); + PilotWin04 = bm_load(NOX("PilotWin04")); +#endif } // ----------------------------------------------------------------------------- @@ -1624,6 +1727,29 @@ void barracks_do_frame(float frametime) barracks_draw_pilot_pic(); barracks_draw_squad_pic(); +#if defined(MAKE_FS1) && !defined(FS1_DEMO) + if (PilotWin01 != -1) { + gr_set_bitmap(PilotWin01); + gr_bitmap(447, 18); + } + + if (PilotWin02 != -1) { + gr_set_bitmap(PilotWin02); + gr_bitmap(620, 38); + } + + if (PilotWin03 != -1) { + gr_set_bitmap(PilotWin03); + gr_bitmap(447, 137); + } + + if (PilotWin04 != -1) { + gr_set_bitmap(PilotWin04); + gr_bitmap(447, 36); + } +#endif + + // draw the window Ui_window.draw(); @@ -1650,6 +1776,25 @@ void barracks_do_frame(float frametime) // ----------------------------------------------------------------------------- void barracks_close() { +#if defined(MAKE_FS1) && !defined(FS1_DEMO) + if (PilotWin01 != -1){ + bm_unload(PilotWin01); + PilotWin01 = -1; + } + if (PilotWin02 != -1){ + bm_unload(PilotWin02); + PilotWin02 = -1; + } + if (PilotWin03 != -1){ + bm_unload(PilotWin03); + PilotWin03 = -1; + } + if (PilotWin04 != -1){ + bm_unload(PilotWin04); + PilotWin04 = -1; + } +#endif + // destroy window Ui_window.destroy(); diff --git a/src/menuui/credits.cpp b/src/menuui/credits.cpp index 3ccfb92..d0657d1 100644 --- a/src/menuui/credits.cpp +++ b/src/menuui/credits.cpp @@ -15,6 +15,9 @@ * C source file for displaying game credits * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/09 04:41:22 relnev * added copyright header * @@ -196,7 +199,11 @@ static char* Credits_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = { int Credits_image_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 225, 15, 400, 292 +#else 219, 15, 394, 286 // GR_640 +#endif }, { 351, 25, 629, 455 // GR_1024 @@ -206,7 +213,11 @@ int Credits_image_coords[GR_NUM_RESOLUTIONS][4] = { // x, y, w, h int Credits_text_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 46, 321, 450, 134 +#else 26, 316, 482, 157 // GR_640 +#endif }, { 144, 507, 568, 249 // GR_640 @@ -223,16 +234,39 @@ struct credits_screen_buttons { }; static int Background_bitmap; -/* +#ifdef MAKE_FS1 static int CreditsWin01 = -1; static int CreditsWin02 = -1; static int CreditsWin03 = -1; static int CreditsWin04 = -1; -*/ +#endif + static UI_WINDOW Ui_window; static credits_screen_buttons Buttons[NUM_BUTTONS][GR_NUM_RESOLUTIONS] = { //XSTR:OFF +#ifdef MAKE_FS1 + { + credits_screen_buttons("TDB_00", 0, 0, -1, -1, 0), // GR_640 + credits_screen_buttons("2_TDB_00", 12, 5, 59, 12, 0) // GR_1024 + }, + { + credits_screen_buttons("TDB_01", 0, 19, -1, -1, 1), // GR_640 + credits_screen_buttons("2_TDB_01", 12, 31, 59, 37, 1) // GR_1024 + }, + { + credits_screen_buttons("TDB_02", 0, 35, -1, -1, 2), // GR_640 + credits_screen_buttons("2_TDB_02", 12, 56, 59, 62, 2) // GR_1024 + }, + { + credits_screen_buttons("TDB_03", 0, 56, -1, -1, 3), // GR_640 + credits_screen_buttons("2_TDB_03", 12, 81, 59, 88, 3) // GR_1024 + }, + { + credits_screen_buttons("CRB_04", 561, 411, -1, -1, 4), // GR_640 + credits_screen_buttons("2_CRB_04", 914, 681, 953, 68, 4) // GR_1024 + } +#else { credits_screen_buttons("TDB_00", 7, 3, 37, 7, 0), // GR_640 credits_screen_buttons("2_TDB_00", 12, 5, 59, 12, 0) // GR_1024 @@ -253,6 +287,7 @@ static credits_screen_buttons Buttons[NUM_BUTTONS][GR_NUM_RESOLUTIONS] = { credits_screen_buttons("CRB_04", 571, 425, 588, 413, 4), // GR_640 credits_screen_buttons("2_CRB_04", 914, 681, 953, 668, 4) // GR_1024 } +#endif //XSTR:ON }; @@ -368,7 +403,28 @@ void credits_init() // keep reading everything in strcpy(Credit_text,""); - while(!check_for_string_raw("#end")){ +#ifndef MAKE_FS1 + while(!check_for_string_raw("#end")){ +#else + char *ugh = Mp; + char ch; + int line_count = 0; + + // get the line count, probably a crappy way to do it but it's the best way i've + // found to step through the credits without crashing problems since there's no + // definite end line in FS1 + while (*ugh && *ugh != EOF_CHAR) { + ch = *ugh; + + if (ch == '\n'){ + line_count++; + } + ugh++; + } + + while(line_count > 0){ + line_count--; +#endif stuff_string_line(line, 511); linep1 = line; @@ -513,12 +569,14 @@ void credits_init() b->button.link_hotspot(b->hotspot); } +#ifndef MAKE_FS1 // add some text Ui_window.add_XSTR("Technical Database", 1055, Buttons[TECH_DATABASE_BUTTON][gr_screen.res].xt, Buttons[TECH_DATABASE_BUTTON][gr_screen.res].yt, &Buttons[TECH_DATABASE_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Mission Simulator", 1056, Buttons[SIMULATOR_BUTTON][gr_screen.res].xt, Buttons[SIMULATOR_BUTTON][gr_screen.res].yt, &Buttons[SIMULATOR_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Cutscenes", 1057, Buttons[CUTSCENES_BUTTON][gr_screen.res].xt, Buttons[CUTSCENES_BUTTON][gr_screen.res].yt, &Buttons[CUTSCENES_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Credits", 1058, Buttons[CREDITS_BUTTON][gr_screen.res].xt, Buttons[CREDITS_BUTTON][gr_screen.res].yt, &Buttons[CREDITS_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Exit", 1420, Buttons[EXIT_BUTTON][gr_screen.res].xt, Buttons[EXIT_BUTTON][gr_screen.res].yt, &Buttons[EXIT_BUTTON][gr_screen.res].button, UI_XSTR_COLOR_PINK); +#endif if (Player->flags & PLAYER_FLAGS_IS_MULTI) { Buttons[SIMULATOR_BUTTON][gr_screen.res].button.disable(); @@ -533,17 +591,19 @@ void credits_init() Credits_bmps[i] = -1; } - // CreditsWin01 = bm_load(NOX("CreditsWin01")); - // CreditsWin02 = bm_load(NOX("CreditsWin02")); - // CreditsWin03 = bm_load(NOX("CreditsWin03")); - // CreditsWin04 = bm_load(NOX("CreditsWin04")); +#ifdef MAKE_FS1 + CreditsWin01 = bm_load(NOX("CreditsWin01")); + CreditsWin02 = bm_load(NOX("CreditsWin02")); + CreditsWin03 = bm_load(NOX("CreditsWin03")); + CreditsWin04 = bm_load(NOX("CreditsWin04")); +#endif } void credits_close() { int i; - /* +#ifdef MAKE_FS1 if (CreditsWin01 != -1){ bm_unload(CreditsWin01); CreditsWin01 = -1; @@ -560,7 +620,7 @@ void credits_close() bm_unload(CreditsWin04); CreditsWin04 = -1; } - */ +#endif for (i=0; i= 0){ @@ -689,7 +749,7 @@ void credits_do_frame(float frametime) gr_cross_fade(bm1, bm2, bx1, by1, bx2, by2, (float)percent / 100.0f); } - /* +#ifdef MAKE_FS1 if (CreditsWin01 != -1) { gr_set_bitmap(CreditsWin01); gr_bitmap(233, 5); @@ -709,7 +769,7 @@ void credits_do_frame(float frametime) gr_set_bitmap(CreditsWin04); gr_bitmap(215, 8); } - */ +#endif Ui_window.draw(); diff --git a/src/menuui/mainhallmenu.cpp b/src/menuui/mainhallmenu.cpp index 2c88bf8..8e4109e 100644 --- a/src/menuui/mainhallmenu.cpp +++ b/src/menuui/mainhallmenu.cpp @@ -15,6 +15,9 @@ * Header file for main-hall menu code * * $Log$ + * Revision 1.7 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.6 2002/07/24 00:20:42 relnev * nothing interesting * @@ -816,6 +819,15 @@ void main_hall_init(int main_hall_num) Main_hall = &Main_hall_defines[gr_screen.res][main_hall_num]; // tooltip strings +#ifdef MAKE_FS1 + Main_hall->region_descript[0] = XSTR( "Exit Freespace", 353); + Main_hall->region_descript[1] = XSTR( "Barracks - Manage your Freespace pilots", 354); + Main_hall->region_descript[2] = XSTR( "Ready room - Start or continue a campaign", 355); + Main_hall->region_descript[3] = XSTR( "Tech room - View specifications of Freespace ships and weaponry", 356); + Main_hall->region_descript[4] = XSTR( "Options - Change your Freespace options", 357); + Main_hall->region_descript[5] = XSTR( "Campaign Room - View all available campaigns", 358); + Main_hall->region_descript[6] = XSTR( "Multiplayer - Start or join a multiplayer game", 359); +#else Main_hall->region_descript[0] = XSTR( "Exit FreeSpace 2", 353); Main_hall->region_descript[1] = XSTR( "Barracks - Manage your FreeSpace 2 pilots", 354); Main_hall->region_descript[2] = XSTR( "Ready room - Start or continue a campaign", 355); @@ -823,11 +835,14 @@ void main_hall_init(int main_hall_num) Main_hall->region_descript[4] = XSTR( "Options - Change your FreeSpace 2 options", 357); Main_hall->region_descript[5] = XSTR( "Campaign Room - View all available campaigns", 358); Main_hall->region_descript[6] = XSTR( "Multiplayer - Start or join a multiplayer game", 359); +#endif // init tooltip shader +#ifndef MAKE_FS1 float gray_intensity = 0.02f; // nearly black float c = (gr_screen.mode == GR_DIRECT3D || gr_screen.mode == GR_OPENGL) ? 0.11f : 0.07f; // adjust for renderer differences gr_create_shader(&Main_hall_tooltip_shader, gray_intensity, gray_intensity, gray_intensity, c); +#endif // load the background bitmap Main_hall_bitmap = bm_load(Main_hall->bitmap); @@ -1080,7 +1095,7 @@ void main_hall_do(float frametime) // clicked on the tech room region case TECH_ROOM_REGION: -#if defined(FS2_DEMO) +#if defined(FS2_DEMO) || defined(FS1_DEMO) gamesnd_play_iface(SND_IFACE_MOUSE_CLICK); game_feature_not_in_demo_popup(); #else @@ -1099,7 +1114,7 @@ void main_hall_do(float frametime) case CAMPAIGN_ROOM_REGION: #if !defined(MULTIPLAYER_BETA_BUILD) && !defined(E3_BUILD) && !defined(PRESS_TOUR_BUILD) -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) gamesnd_play_iface(SND_IFACE_MOUSE_CLICK); { //game_feature_not_in_demo_popup(); @@ -1142,7 +1157,7 @@ void main_hall_do(float frametime) case LOAD_MISSION_REGION: #ifdef RELEASE_REAL #else - #if !(defined(MULTIPLAYER_BETA_BUILD) || defined(FS2_DEMO)) + #if !(defined(MULTIPLAYER_BETA_BUILD) || defined(FS2_DEMO) || defined(FS1_DEMO)) //#if !defined(NDEBUG) || defined(INTERPLAYQA) if (Player->flags & PLAYER_FLAGS_IS_MULTI){ gamesnd_play_iface(SND_IFACE_MOUSE_CLICK); @@ -1163,7 +1178,7 @@ void main_hall_do(float frametime) // quick start a game region case QUICK_START_REGION: -#if !defined(NDEBUG) && !defined(FS2_DEMO) +#if !defined(NDEBUG) && !(defined(FS2_DEMO) || defined(FS1_DEMO)) if (Player->flags & PLAYER_FLAGS_IS_MULTI){ main_hall_set_notify_string(XSTR( "Quick Start not valid for multiplayer pilots", 369)); } else { @@ -1905,14 +1920,21 @@ void main_hall_maybe_blit_tooltips() // set the color and blit the string if(!help_overlay_active(Main_hall_overlay_id)) { +#ifndef MAKE_FS1 int shader_y = (Main_hall->region_yval) - Main_hall_tooltip_padding[gr_screen.res]; // subtract more to pull higher +#endif // get the width of the string gr_get_string_size(&w, NULL, Main_hall->region_descript[text_index]); +#ifndef MAKE_FS1 gr_set_shader(&Main_hall_tooltip_shader); gr_shade(0, shader_y, gr_screen.clip_width, (gr_screen.clip_height - shader_y)); - +#endif +#ifdef MAKE_FS1 + gr_set_color_fast(&Color_white); +#else gr_set_color_fast(&Color_bright_white); +#endif gr_string((gr_screen.max_w - w)/2, Main_hall->region_yval, Main_hall->region_descript[text_index]); } } @@ -1948,9 +1970,15 @@ void main_hall_process_help_stuff() } // set the color and print out text and shader +#ifndef MAKE_FS1 gr_set_color_fast(&Color_bright_white); gr_shade(0, 0, gr_screen.max_w, (2*Main_hall_tooltip_padding[gr_screen.res]) + h - y_anim_offset); gr_string((gr_screen.max_w - w)/2, Main_hall_tooltip_padding[gr_screen.res] - y_anim_offset, str); +#else + gr_set_color_fast(&Color_white); + // no shading, no roll off screen + gr_string((gr_screen.max_w - w)/2, Main_hall_tooltip_padding[gr_screen.res], str); +#endif } // what main hall we're on (should be 0 or 1) @@ -1979,7 +2007,11 @@ void main_hall_read_table() while(!optional_string("#end")){ // read in 2 resolutions +#ifndef MAKE_FS1 for(m_idx=0; m_idx= NUM_MAIN_HALLS){ m = &temp; diff --git a/src/menuui/optionsmenu.cpp b/src/menuui/optionsmenu.cpp index 11da9ce..20b2319 100644 --- a/src/menuui/optionsmenu.cpp +++ b/src/menuui/optionsmenu.cpp @@ -15,6 +15,9 @@ * C module that contains functions to drive the Options user interface * * $Log$ + * Revision 1.4 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:22 relnev * added copyright header * @@ -245,7 +248,11 @@ #define OPTIONS_NOTIFY_TIME 3500 #define OPTIONS_NOTIFY_Y 450 +#ifdef MAKE_FS1 +#define NUM_BUTTONS 26 +#else #define NUM_BUTTONS 24 +#endif #define NUM_ANIS 4 #define NUM_TABS 3 #define NUM_COMMONS 10 @@ -275,6 +282,11 @@ #define WEAPON_EXTRAS_ON 17 #define WEAPON_EXTRAS_OFF 18 +#ifdef MAKE_FS1 +#define ENGINE_GLOWS_ON 24 +#define ENGINE_GLOWS_OFF 25 +#endif + #define LOW_DETAIL_N 19 #define MEDIUM_DETAIL_N 20 #define HIGH_DETAIL_N 21 @@ -303,6 +315,38 @@ struct options_buttons { static options_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + options_buttons("OPa_00", 84, 25, 0, -1), // options tab + options_buttons("OPa_01", 173, 25, 1, -1), // multiplayer tab + options_buttons("OPa_02", 256, 25, 2, -1), // detail levels tab + options_buttons("OPa_03", 6, 380, 3, -1), // abort game button + options_buttons("OPa_05", 448, 335, 5, -1), // control config button + options_buttons("OPa_06", 541, 335, 6, -1), // hud config + options_buttons("OPa_07", 560, 411, 7, -1), // accept button + + options_buttons("OPa_58", 39, 99, 58, OPTIONS_TAB, 2), // Briefing / debriefing voice toggle off + options_buttons("OPa_59", 104, 99, 59, OPTIONS_TAB, 2), // Briefing / debriefing voice toggle on + options_buttons("OPa_62", 359, 274, 62, OPTIONS_TAB, 2), // Mouse off + options_buttons("OPa_63", 424, 274, 63, OPTIONS_TAB, 2), // Mouse on + options_buttons("OPa_56", 451, 79, 56, OPTIONS_TAB, 1), // Gamma Down + options_buttons("OPa_57", 484, 79, 57, OPTIONS_TAB, 1), // Gamma Up + + options_buttons("OPc_40", 321, 237, 40, DETAIL_LEVELS_TAB, 2), // Planets On (Nebula) + options_buttons("OPc_39", 264, 237, 39, DETAIL_LEVELS_TAB, 2), // Planets Off (Nebula) + options_buttons("OPc_42", 321, 284, 42, DETAIL_LEVELS_TAB, 2), // Target View Rendering On + options_buttons("OPc_41", 264, 284, 41, DETAIL_LEVELS_TAB, 2), // Target View Rendering Off + options_buttons("OPc_44", 321, 331, 44, DETAIL_LEVELS_TAB, 2), // Weapon Extras On + options_buttons("OPc_43", 264, 331, 43, DETAIL_LEVELS_TAB, 2), // Weapon Extras Off + + options_buttons("OPc_50", 516, 194, 50, DETAIL_LEVELS_TAB, 2), // Low Preset Detail + options_buttons("OPc_51", 516, 213, 51, DETAIL_LEVELS_TAB, 2), // Medium Preset Detail + options_buttons("OPc_52", 516, 232, 52, DETAIL_LEVELS_TAB, 2), // High Preset Detail + options_buttons("OPc_53", 498, 251, 53, DETAIL_LEVELS_TAB, 2), // Highest Preset Detail + options_buttons("OPc_54", 516, 270, 54, DETAIL_LEVELS_TAB, 2), // Custom Detail + + options_buttons("OPc_38", 321, 190, 38, DETAIL_LEVELS_TAB, 2), // Engine Glow On + options_buttons("OPc_37", 264, 190, 37, DETAIL_LEVELS_TAB, 2), // Engine Glow Off +#else options_buttons("OPT_00", 17, 2, 0, -1), // options tab options_buttons("OPT_01", 102, 2, 1, -1), // multiplayer tab options_buttons("OPT_02", 170, 2, 2, -1), // detail levels tab @@ -330,6 +374,7 @@ static options_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { options_buttons("ODB_16", 614, 114, 16, DETAIL_LEVELS_TAB, 2), // High Preset Detail options_buttons("ODB_17", 614, 133, 17, DETAIL_LEVELS_TAB, 2), // Highest Preset Detail options_buttons("ODB_18", 614, 152, 18, DETAIL_LEVELS_TAB, 2), // Custom Detail +#endif }, { // GR_1024 options_buttons("2_OPT_00", 27, 4, 0, -1), // options tab @@ -359,6 +404,10 @@ static options_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { options_buttons("2_ODB_16", 983, 183, 16, DETAIL_LEVELS_TAB, 2), // High Preset Detail options_buttons("2_ODB_17", 983, 213, 17, DETAIL_LEVELS_TAB, 2), // Highest Preset Detail options_buttons("2_ODB_18", 983, 243, 18, DETAIL_LEVELS_TAB, 2), // Custom Detail +#ifdef MAKE_FS1 // just filler + options_buttons("OPc_38", 321, 290, 38, DETAIL_LEVELS_TAB, 2), // Engine Glow On + options_buttons("OPc_37", 264, 290, 37, DETAIL_LEVELS_TAB, 2), // Engine Glow Off +#endif } }; @@ -373,6 +422,23 @@ static options_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { op_sliders Options_sliders[GR_NUM_RESOLUTIONS][NUM_OPTIONS_SLIDERS] = { { // GR_640 +#ifdef MAKE_FS1 +// slider, right arrow, left arrow +// s(name), s(x), s(y), s(?), s(?), s(h), s(?), s(?), ra(name), ra(h), ra(x), ra(y), la(name), la(h), la(x), la(y) + op_sliders("OPa_09", 53, 160, -1, -1, 9, 20, 10, + "OPa_10", 10, 245, 159, + "OPa_08", 8, 29, 159), // sound fx volume slider + op_sliders("OPa_17", 53, 195, -1, -1, 17, 20, 10, + "OPa_18", 18, 245, 194, + "OPa_16", 16, 29, 194), // music volume slider + op_sliders("OPa_20", 53, 229, -1, -1, 20, 20, 10, + "OPa_21", 21, 245, 228, + "OPa_19", 19, 29, 228), // voice volume slider + op_sliders("OPa_64", 358, 301, -1, -1, 64, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // mouse sensitivity + op_sliders("OPa_60", 358, 194, -1, -1, 60, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick sensitivity + op_sliders("OPa_61", 358, 226, -1, -1, 61, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick deadzone + op_sliders("OPa_11", 28, 285, -1, -1, 11, 42, 5, NULL, -1, -1, -1, NULL, -1, -1, -1) // skill +#else op_sliders("OMB_10", 31, 139, -1, -1, 10, 20, 10, "OMB_11", 11, 226, 137, "OMB_09", 9, 4, 137 ), // sound fx volume slider @@ -386,6 +452,7 @@ op_sliders Options_sliders[GR_NUM_RESOLUTIONS][NUM_OPTIONS_SLIDERS] = { op_sliders("OMB_28", 440, 259, -1, -1, 28, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick sensitivity op_sliders("OMB_29", 440, 290, -1, -1, 29, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // joystick deadzone op_sliders("OMB_21", 440, 75, -1, -1, 21, 36, 5, NULL, -1, -1, -1, NULL, -1, -1, -1) +#endif // MAKE_FS1 }, { // GR_1024 op_sliders("2_OMB_10", 50, 223, -1, -1, 10, 32, 10, @@ -462,7 +529,11 @@ void options_notify_do_frame(); int Options_gamma_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 376, 116, 203, 34 +#else 435, 179, 195, 28 // GR_640 +#endif // MAKE_FS1 }, { 692, 287, 308, 44 // GR_1024 @@ -473,7 +544,11 @@ int Options_gamma_coords[GR_NUM_RESOLUTIONS][4] = { int Options_gamma_num_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 390, 87, 45, 10 +#else 489, 159, 65, 17 // GR_640 +#endif // MAKE_FS1 }, { 779, 254, 65, 17 // GR_1024 @@ -482,7 +557,11 @@ int Options_gamma_num_coords[GR_NUM_RESOLUTIONS][4] = { int Options_skills_text_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 41, 326, 186, 10 +#else 468, 104, 155, 10 // GR_640 +#endif }, { 750, 169, 246, 21 // GR_1024 @@ -494,7 +573,11 @@ int Options_skills_text_coords[GR_NUM_RESOLUTIONS][4] = { // DETAIL LEVEL OPTIONS definitions BEGIN // -#define NUM_DETAIL_SLIDERS 8 +#ifdef MAKE_FS1 + #define NUM_DETAIL_SLIDERS 9 +#else + #define NUM_DETAIL_SLIDERS 8 +#endif /* #define DETAIL_DISTANCE_SLIDER 0 @@ -514,8 +597,22 @@ int Options_skills_text_coords[GR_NUM_RESOLUTIONS][4] = { #define SHIELD_DETAIL_SLIDER 5 #define NUM_STARS_SLIDER 6 #define LIGHTING_SLIDER 7 +#ifdef MAKE_FS1 +#define WEAPON_REDNERING_SLIDER 8 +#endif op_sliders Detail_sliders[GR_NUM_RESOLUTIONS][NUM_DETAIL_SLIDERS] = { { // GR_640 +#ifdef MAKE_FS1 + op_sliders("OPc_29", 38, 96, -1, -1, 29, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // model detail + op_sliders("OPc_30", 38, 143, -1, -1, 30, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // nebula detail + op_sliders("OPc_31", 38, 176, -1, -1, 31, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // textures + op_sliders("OPc_36", 273, 143, -1, -1, 36, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // particles + op_sliders("Opc_33", 38, 284, -1, -1, 33, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // impact effects + op_sliders("OPc_34", 38, 333, -1, -1, 34, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // shield hit + op_sliders("OPc_35", 273, 96, -1, -1, 35, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // stars + op_sliders("OPc_45", 496, 96, -1, -1, 45, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // lighting + op_sliders("OPc_32", 38, 223, -1, -1, 32, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // weapon rendering - doesn't actually do anything +#else op_sliders("ODB_07", 21, 71, -1, -1, 7, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // model detail op_sliders("ODB_08", 21, 119, -1, -1, 8, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // nebula detail op_sliders("ODB_09", 21, 166, -1, -1, 9, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // textures @@ -524,6 +621,7 @@ op_sliders Detail_sliders[GR_NUM_RESOLUTIONS][NUM_DETAIL_SLIDERS] = { op_sliders("ODB_12", 21, 307, -1, -1, 12, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // shield hit op_sliders("ODB_13", 21, 354, -1, -1, 13, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // stars op_sliders("ODB_19", 518, 212, -1, -1, 19, 20, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // lighting +#endif }, { // GR_1024 op_sliders("2_ODB_07", 34, 114, -1, -1, 7, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // model detail @@ -534,6 +632,9 @@ op_sliders Detail_sliders[GR_NUM_RESOLUTIONS][NUM_DETAIL_SLIDERS] = { op_sliders("2_ODB_12", 34, 492, -1, -1, 12, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // shield hit op_sliders("2_ODB_13", 34, 567, -1, -1, 13, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // stars op_sliders("2_ODB_19", 829, 340, -1, -1, 19, 32, 5, NULL, -1, -1, -1, NULL, -1, -1, -1), // lighting +#ifdef MAKE_FS1 // filler + op_sliders("none", -1, -1, -1, -1, -1, -1, -1, NULL, -1, -1, -1, NULL, -1, -1, -1), +#endif } }; int Detail_slider_pos[NUM_DETAIL_SLIDERS]; @@ -546,9 +647,15 @@ void options_detail_do_frame(); void options_detail_set_level(int level); // text -#define OPTIONS_NUM_TEXT 49 +#ifdef MAKE_FS1 + #define OPTIONS_NUM_TEXT 0 +#else + #define OPTIONS_NUM_TEXT 49 +#endif UI_XSTR Options_text[GR_NUM_RESOLUTIONS][OPTIONS_NUM_TEXT] = { { // GR_640 + // nothing needed +#ifndef MAKE_FS1 // common text { "Options", 1036, 10, 35, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][OPTIONS_TAB].button }, { "Multi", 1042, 97, 35, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][MULTIPLAYER_TAB].button }, @@ -603,9 +710,12 @@ UI_XSTR Options_text[GR_NUM_RESOLUTIONS][OPTIONS_NUM_TEXT] = { { "Joystick", 1376, 556, 231, UI_XSTR_COLOR_GREEN, -1, &Options_bogus }, { "Sensitivity", 1374, 538, 250, UI_XSTR_COLOR_GREEN, -1, &Options_bogus }, { "Deadzone", 1377, 538, 281, UI_XSTR_COLOR_GREEN, -1, &Options_bogus }, +#endif }, { // GR_1024 - // common text + // nothing needed +#ifndef MAKE_FS1 + // common text { "Options", 1036, 16, 57, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][OPTIONS_TAB].button }, { "Multi", 1042, 172, 57, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][MULTIPLAYER_TAB].button }, { "Detail", 1351, 283, 57, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][DETAIL_LEVELS_TAB].button }, @@ -659,6 +769,7 @@ UI_XSTR Options_text[GR_NUM_RESOLUTIONS][OPTIONS_NUM_TEXT] = { { "Joystick", 1376, 891, 370, UI_XSTR_COLOR_GREEN, -1, &Options_bogus }, { "Sensitivity", 1374, 861, 400, UI_XSTR_COLOR_GREEN, -1, &Options_bogus }, { "Deadzone", 1377, 861, 451, UI_XSTR_COLOR_GREEN, -1, &Options_bogus }, +#endif } }; @@ -764,10 +875,11 @@ void options_tab_setup(int set_palette) case MULTIPLAYER_TAB: #if !defined(DEMO) && !defined(OEM_BUILD) // not for FS2_DEMO options_multi_select(); - +#ifdef MAKE_FS1 // need to hide the hud config and control config buttons - // Buttons[gr_screen.res][CONTROL_CONFIG_BUTTON].button.hide(); - // Buttons[gr_screen.res][HUD_CONFIG_BUTTON].button.hide(); + Buttons[gr_screen.res][CONTROL_CONFIG_BUTTON].button.hide(); + Buttons[gr_screen.res][HUD_CONFIG_BUTTON].button.hide(); +#endif // MAKE_FS1 #endif // DEMO break; @@ -945,7 +1057,7 @@ void options_button_pressed(int n) break; case HUD_CONFIG_BUTTON: -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) game_feature_not_in_demo_popup(); #else // can't go to the hud config screen when a multiplayer observer @@ -996,6 +1108,18 @@ void options_button_pressed(int n) gamesnd_play_iface(SND_USER_SELECT); break; +#ifdef MAKE_FS1 + case ENGINE_GLOWS_ON: + Detail.engine_glows = 1; + gamesnd_play_iface(SND_USER_SELECT); + break; + + case ENGINE_GLOWS_OFF: + Detail.engine_glows = 0; + gamesnd_play_iface(SND_USER_SELECT); + break; +#endif + case LOW_DETAIL_N: options_detail_set_level(0); gamesnd_play_iface(SND_USER_SELECT); @@ -1695,6 +1819,16 @@ void options_detail_do_frame() options_force_button_frame(WEAPON_EXTRAS_ON, 0); } +#ifdef MAKE_FS1 + if ( Detail.engine_glows) { + options_force_button_frame(ENGINE_GLOWS_ON, 2); + options_force_button_frame(ENGINE_GLOWS_OFF, 0); + } else { + options_force_button_frame(ENGINE_GLOWS_OFF, 2); + options_force_button_frame(ENGINE_GLOWS_ON, 0); + } +#endif + int current_detail; if ( Detail.setting >= 0 ) { diff --git a/src/menuui/optionsmenumulti.cpp b/src/menuui/optionsmenumulti.cpp index 8c09445..e015c94 100644 --- a/src/menuui/optionsmenumulti.cpp +++ b/src/menuui/optionsmenumulti.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.6 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/09 04:41:22 relnev * added copyright header * @@ -229,10 +232,12 @@ #include "osregistry.h" #include "alphacolors.h" #include "timer.h" +#include "gamesequence.h" // needed for FS1 // general data section ------------------------------------------------ UI_WINDOW *Om_window = NULL; +#ifndef FS1_DEMO static char* Om_background_0_fname[GR_NUM_RESOLUTIONS] = { "OptionsMultiGen", // GR_640 "2_OptionsMultiGen" // GR_1024 @@ -258,6 +263,7 @@ int Om_mask_0 = -1; int Om_background_1 = -1; int Om_mask_1 = -1; +#endif // FS1_DEMO // screen modes #define OM_MODE_NONE -1 // no mode (unintialized) @@ -286,6 +292,22 @@ void options_multi_notify_process(); // protocol options section ------------------------------------------- +#ifdef MAKE_FS1 +#define OM_PRO_NUM_BUTTONS 12 + +#define ABORT_GAME_BUTTON 0 +#define CONTROL_CONFIG_BUTTON 1 +#define HUD_CONFIG_BUTTON 2 +#define OM_PRO_SCROLL_IP_UP 3 +#define OM_PRO_SCROLL_IP_DOWN 4 +#define OM_PRO_ADD_IP 5 +#define OM_PRO_DELETE_IP 6 +#define OM_PRO_LOCAL_BROADCAST_YES 7 +#define OM_PRO_LOCAL_BROADCAST_NO 8 +#define OM_PRO_VMT 9 +#define OM_PRO_VOX_TAB 10 +#define OM_PRO_GEN_TAB 11 +#else #define OM_PRO_NUM_BUTTONS 10 #define OM_PRO_TCP 0 @@ -298,9 +320,25 @@ void options_multi_notify_process(); #define OM_PRO_VMT 7 #define OM_PRO_VOX_TAB 8 #define OM_PRO_GEN_TAB 9 +#endif ui_button_info Om_pro_buttons[GR_NUM_RESOLUTIONS][OM_PRO_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("OPb_04", 6, 377, -1, -1, 4), // Exit Game + ui_button_info("OPb_05", 448, 335, -1, -1, 5), // Control Config + ui_button_info("OPb_06", 541, 335, -1, -1, 6), // HUD Config + + ui_button_info("OPb_87", 252, 129, -1, -1, 87), // Scroll IP Up + ui_button_info("OPb_88", 252, 166, -1, -1, 88), // Scroll IP Down + ui_button_info("OPb_85", 26, 131, -1, -1, 85), // Add IP + ui_button_info("OPb_86", 26, 166, -1, -1, 86), // Remove IP + ui_button_info("OPb_89", 26, 221, -1, -1, 89), // Local Broadcast Yes + ui_button_info("OPb_90", 104, 221, -1, -1, 90), // Local Broadcast No + ui_button_info("OPb_91", 26, 243, -1, -1, 91), // Parallax Online + ui_button_info("OPb_92", 402, 72, -1, -1, 92), // Voice Tab + ui_button_info("OPb_93", 487, 72, -1, -1, 93), // General Tab +#else ui_button_info("OMuB_07", 7, 66, -1, -1, 7), ui_button_info("OMuB_08", 7, 84, -1, -1, 8), ui_button_info("OMuB_09", 1, 124, -1, -1, 9), @@ -311,6 +349,7 @@ ui_button_info Om_pro_buttons[GR_NUM_RESOLUTIONS][OM_PRO_NUM_BUTTONS] = { ui_button_info("OMuB_14", 9, 282, -1, -1, 14), ui_button_info("OMuB_15", 610, 53, -1, -1, 15), ui_button_info("OMuB_16", 610, 72, -1, -1, 16), +#endif }, { // GR_1024 ui_button_info("2_OMuB_07", 12, 105, -1, -1, 7), @@ -323,15 +362,26 @@ ui_button_info Om_pro_buttons[GR_NUM_RESOLUTIONS][OM_PRO_NUM_BUTTONS] = { ui_button_info("2_OMuB_14", 14, 452, -1, -1, 14), ui_button_info("2_OMuB_15", 976, 85, -1, -1, 15), ui_button_info("2_OMuB_16", 976, 114, -1, -1, 16), +#ifdef MAKE_FS1 + // filler for extra FS1 buttons + ui_button_info("none", -1, -1, -1, -1, -1), + ui_button_info("none", -1, -1, -1, -1, -1), +#endif } }; UI_GADGET Om_pro_bogus; // test +#ifdef MAKE_FS1 +#define OM_PRO_NUM_TEXT 0 +#else #define OM_PRO_NUM_TEXT 12 +#endif UI_XSTR Om_pro_text[GR_NUM_RESOLUTIONS][OM_PRO_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "TCP", 1378, 38, 70, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[0][OM_PRO_TCP].button }, { "IPX", 1379, 38, 88, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[0][OM_PRO_IPX].button }, { "IP Address", 1380, 30, 128, UI_XSTR_COLOR_GREEN, -1, &Om_pro_bogus }, @@ -344,8 +394,11 @@ UI_XSTR Om_pro_text[GR_NUM_RESOLUTIONS][OM_PRO_NUM_TEXT] = { { "Squadron", 1386, 14, 363, UI_XSTR_COLOR_GREEN, -1, &Om_pro_bogus }, { "Voice", 1528, 557, 60, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[0][OM_PRO_VOX_TAB].button }, { "General", 1388, 542, 77, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[0][OM_PRO_GEN_TAB].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "TCP", 1378, 61, 113, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[1][OM_PRO_TCP].button }, { "IPX", 1379, 61, 141, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[1][OM_PRO_IPX].button }, { "IP Address", 1380, 47, 206, UI_XSTR_COLOR_GREEN, -1, &Om_pro_bogus }, @@ -358,13 +411,18 @@ UI_XSTR Om_pro_text[GR_NUM_RESOLUTIONS][OM_PRO_NUM_TEXT] = { { "Squadron", 1386, 23, 582, UI_XSTR_COLOR_GREEN, -1, &Om_pro_bogus }, { "Voice", 1528, 921, 96, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[1][OM_PRO_VOX_TAB].button }, { "General", 1388, 902, 123, UI_XSTR_COLOR_GREEN, -1, &Om_pro_buttons[1][OM_PRO_GEN_TAB].button }, +#endif } }; // defines for the tracker input boxes int Om_tracker_login_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 62, 284, 175, -1 +#else 19, 322, 226, -1 // GR_640 +#endif }, { 31, 518, 361, -1 // GR_1024 @@ -372,7 +430,11 @@ int Om_tracker_login_coords[GR_NUM_RESOLUTIONS][4] = { }; int Om_tracker_passwd_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 62, 328, 175, -1 +#else 19, 350, 226, -1 // GR_640 +#endif }, { 31, 562, 361, -1 // GR_1024 @@ -410,7 +472,11 @@ static int Om_tracker_focus = 0; int Ip_list_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 106, 147, 141, 48 +#else 29, 137, 227, 67 // GR_640 +#endif }, { 46, 220, 364, 106 // GR_1024 @@ -425,7 +491,11 @@ int Ip_list_max_display[GR_NUM_RESOLUTIONS] = { static int Ip_input_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 107, 138, 140, -1 +#else 109, 128, 140, -1 // GR_640 +#endif }, { 132, 206, 261, -1 // GR_640 @@ -511,6 +581,18 @@ void options_multi_protocol_add_current_ip(); ui_button_info Om_gen_buttons[GR_NUM_RESOLUTIONS][OM_GEN_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("OPb_94", 410, 121, -1, -1, 94), + ui_button_info("OPb_95", 410, 143, -1, -1, 95), + ui_button_info("OPb_96", 410, 165, -1, -1, 96), + ui_button_info("none", -1, -1, -1, -1, -1), // no LAN setting in FS1 + ui_button_info("OPb_97", 410, 199, -1, -1, 97), + ui_button_info("OPb_98", 496, 199, -1, -1, 98), + ui_button_info("OPb_99", 410, 233, -1, -1, 99), + ui_button_info("OPb_100", 410, 256, -1, -1, 100), + ui_button_info("OPb_101", 410, 290, -1, -1, 101), + ui_button_info("OPb_102", 410, 313, -1, -1, 102), +#else ui_button_info("OGB_17", 598, 117, -1, -1, 17), ui_button_info("OGB_18", 598, 139, -1, -1, 18), ui_button_info("OGB_19", 598, 161, -1, -1, 19), @@ -521,6 +603,7 @@ ui_button_info Om_gen_buttons[GR_NUM_RESOLUTIONS][OM_GEN_NUM_BUTTONS] = { ui_button_info("OGB_24", 598, 307, -1, -1, 24), ui_button_info("OGB_25", 598, 347, -1, -1, 25), ui_button_info("OGB_26", 598, 368, -1, -1, 26), +#endif }, { // GR_1024 ui_button_info("2_OGB_17", 957, 188, -1, -1, 17), @@ -539,9 +622,15 @@ ui_button_info Om_gen_buttons[GR_NUM_RESOLUTIONS][OM_GEN_NUM_BUTTONS] = { UI_GADGET Om_gen_bogus; // text +#ifdef MAKE_FS1 +#define OM_GEN_NUM_TEXT 0 +#else #define OM_GEN_NUM_TEXT 14 +#endif UI_XSTR Om_gen_text[GR_NUM_RESOLUTIONS][OM_GEN_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Object Update", 1391, 511, 104, UI_XSTR_COLOR_GREEN, -1, &Om_gen_bogus }, { "Low", 1160, 558, 127, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[0][OM_GEN_OBJ_LOW].button }, { "Medium", 1161, 538, 149, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[0][OM_GEN_OBJ_MED].button }, @@ -556,8 +645,11 @@ UI_XSTR Om_gen_text[GR_NUM_RESOLUTIONS][OM_GEN_NUM_TEXT] = { { "Flush Cache", 1399, 529, 334, UI_XSTR_COLOR_GREEN, -1, &Om_gen_bogus }, { "Never", 1400, 548, 355, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[0][OM_GEN_FLUSH_NO].button }, { "Before Game", 1401, 502, 377, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[0][OM_GEN_FLUSH_YES].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Object Update", 1391, 818, 166, UI_XSTR_COLOR_GREEN, -1, &Om_gen_bogus }, { "Low", 1160, 913, 204, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[1][OM_GEN_OBJ_LOW].button }, { "Medium", 1161, 892, 239, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[1][OM_GEN_OBJ_MED].button }, @@ -572,6 +664,7 @@ UI_XSTR Om_gen_text[GR_NUM_RESOLUTIONS][OM_GEN_NUM_TEXT] = { { "Flush Cache", 1399, 886, 533, UI_XSTR_COLOR_GREEN, -1, &Om_gen_bogus }, { "Never", 1400, 897, 568, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[1][OM_GEN_FLUSH_NO].button }, { "Before Game", 1401, 849, 603, UI_XSTR_COLOR_GREEN, -1, &Om_gen_buttons[1][OM_GEN_FLUSH_YES].button }, +#endif } }; @@ -620,12 +713,21 @@ UI_GADGET Om_vox_bogus; ui_button_info Om_vox_buttons[GR_NUM_RESOLUTIONS][OM_VOX_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("OPb_103", 413, 110, -1, -1, 103), + ui_button_info("OPb_105", 413, 186, -1, -1, 105), + ui_button_info("OPb_106", 491, 186, -1, -1, 106), + ui_button_info("OPb_108", 413, 253, -1, -1, 108), + ui_button_info("OPb_109", 413, 291, -1, -1, 109), + ui_button_info("OPb_107", 413, 229, -1, -1, 107), +#else ui_button_info("OVB_17", 562, 118, -1, -1, 17), ui_button_info("OVB_19", 551, 208, -1, -1, 19), ui_button_info("OVB_20", 599, 208, -1, -1, 20), ui_button_info("OVB_21", 614, 256, -1, -1, 21), ui_button_info("OVB_22", 614, 290, -1, -1, 22), ui_button_info("OVB_23", 599, 354, -1, -1, 23), +#endif }, { // GR_640 ui_button_info("2_OVB_17", 900, 189, -1, -1, 17), @@ -638,23 +740,33 @@ ui_button_info Om_vox_buttons[GR_NUM_RESOLUTIONS][OM_VOX_NUM_BUTTONS] = { }; // text +#ifdef MAKE_FS1 +#define OM_VOX_NUM_TEXT 0 +#else #define OM_VOX_NUM_TEXT 6 +#endif UI_XSTR Om_vox_text[GR_NUM_RESOLUTIONS][OM_VOX_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Mic test", 1389, 567, 104, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[0][OM_VOX_VOICE_TEST].button }, { "Voice Quality", 1531, 439, 149, UI_XSTR_COLOR_GREEN, -1, &Om_vox_bogus }, { "Voice Transmission", 1530, 439, 193, UI_XSTR_COLOR_GREEN, -1, &Om_vox_bogus }, { "On", 1285, 556, 233, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[0][OM_VOX_VOICE_YES].button }, { "Off", 1286, 604, 233, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[0][OM_VOX_VOICE_NO].button }, { "Mute", 1390, 594, 381, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[0][OM_VOX_VOICE_MUTE].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "mic test", 1389, 908, 166, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[1][OM_VOX_VOICE_TEST].button }, { "Voice Quality", 1531, 703, 239, UI_XSTR_COLOR_GREEN, -1, &Om_vox_bogus }, { "Voice Transmission", 1530, 783, 310, UI_XSTR_COLOR_GREEN, -1, &Om_vox_bogus }, { "On", 1285, 890, 373, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[1][OM_VOX_VOICE_YES].button }, { "Off", 1286, 967, 373, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[1][OM_VOX_VOICE_NO].button }, { "Mute", 1390, 950, 609, UI_XSTR_COLOR_GREEN, -1, &Om_vox_buttons[1][OM_VOX_VOICE_MUTE].button }, +#endif } }; @@ -663,7 +775,11 @@ UI_XSTR Om_vox_text[GR_NUM_RESOLUTIONS][OM_VOX_NUM_TEXT] = { op_sliders Om_vox_sliders[GR_NUM_RESOLUTIONS][NUM_OM_VOX_SLIDERS] = { { // GR_640 +#ifdef MAKE_FS1 + op_sliders("OPb_104", 413, 151, -1, -1, 104, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), +#else op_sliders("OVB_18", 429, 162, -1, -1, 18, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // voice QOS +#endif }, { // GR_1024 op_sliders("2_OVB_18", 686, 259, -1, -1, 18, 20, 10, NULL, -1, -1, -1, NULL, -1, -1, -1), // voice QOS @@ -673,7 +789,11 @@ op_sliders Om_vox_sliders[GR_NUM_RESOLUTIONS][NUM_OM_VOX_SLIDERS] = { // player list area int Om_vox_plist_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 445, 260, 142, 61 +#else 377, 270, 232, 79 +#endif }, { // GR_1024 604, 432, 371, 127 @@ -770,6 +890,7 @@ int options_multi_vox_plist_get(net_player *pl); // load all background bitmaps void options_multi_load_bmaps() { +#ifndef FS1_DEMO // load both background bitmaps Om_background_0 = bm_load(Om_background_0_fname[gr_screen.res]); if(Om_background_0 == -1){ @@ -791,11 +912,13 @@ void options_multi_load_bmaps() if(Om_mask_1 == -1){ nprintf(("Network","Error loading options background mask %s\n",Om_background_1_mask_fname[gr_screen.res])); } +#endif } // unload all the background bitmaps void options_multi_unload_bmaps() { +#ifndef FS1_DEMO // unload all background bitmaps if(Om_background_0 != -1){ bm_release(Om_background_0); @@ -815,6 +938,7 @@ void options_multi_unload_bmaps() bm_release(Om_mask_1); Om_mask_1 = -1; } +#endif } // add a notification message @@ -1017,7 +1141,13 @@ void options_multi_protocol_do(int key) // force draw the correct "local broadcast" button if(Om_local_broadcast){ +#ifdef MAKE_FS1 + Om_pro_buttons[gr_screen.res][OM_PRO_LOCAL_BROADCAST_YES].button.draw_forced(2); + } else { + Om_pro_buttons[gr_screen.res][OM_PRO_LOCAL_BROADCAST_NO].button.draw_forced(2); +#else Om_pro_buttons[gr_screen.res][OM_PRO_LOCAL_BROADCAST].button.draw_forced(2); +#endif } // draw the "vmt" button if it is selected @@ -1084,11 +1214,13 @@ void options_multi_protocol_do(int key) } // force draw the proper protocol +#ifndef MAKE_FS1 // not in FS1 menu if (Om_protocol == NET_IPX) { Om_pro_buttons[gr_screen.res][OM_PRO_IPX].button.draw_forced(2); } else { Om_pro_buttons[gr_screen.res][OM_PRO_TCP].button.draw_forced(2); } +#endif // force draw the proper tab button switch (Om_mode) { @@ -1173,6 +1305,10 @@ void options_multi_protocol_check_buttons() // if a button was pressed void options_multi_protocol_button_pressed(int n) { +#ifdef MAKE_FS1 + int choice; +#endif + switch(n){ // add an ip address case OM_PRO_ADD_IP: @@ -1202,6 +1338,28 @@ void options_multi_protocol_button_pressed(int n) break; // the "local" broadcast button - toggle +#ifdef MAKE_FS1 + // Yes and No buttons in FS1 + case OM_PRO_LOCAL_BROADCAST_YES: + if(Om_input_mode){ + break; + } + + Om_local_broadcast = 1; + + gamesnd_play_iface(SND_USER_SELECT); + break; + + case OM_PRO_LOCAL_BROADCAST_NO: + if(Om_input_mode){ + break; + } + + Om_local_broadcast = 0; + + gamesnd_play_iface(SND_USER_SELECT); + break; +#else case OM_PRO_LOCAL_BROADCAST: // don't process if we're in input mode if(Om_input_mode){ @@ -1216,6 +1374,7 @@ void options_multi_protocol_button_pressed(int n) gamesnd_play_iface(SND_USER_SELECT); break; +#endif // scroll ips down case OM_PRO_SCROLL_IP_DOWN: @@ -1268,6 +1427,7 @@ void options_multi_protocol_button_pressed(int n) break; // general tab button +#ifndef FS1_DEMO case OM_PRO_GEN_TAB: if(Om_mode != OM_MODE_GENERAL){ // set the general tab @@ -1309,8 +1469,10 @@ void options_multi_protocol_button_pressed(int n) gamesnd_play_iface(SND_USER_SELECT); break; +#endif // FS1_DEMO // tcp mode +#ifndef MAKE_FS1 // not in FS1 option menu case OM_PRO_TCP: Om_protocol = NET_TCP; gamesnd_play_iface(SND_USER_SELECT); @@ -1323,6 +1485,16 @@ void options_multi_protocol_button_pressed(int n) gamesnd_play_iface(SND_USER_SELECT); #endif break; +#endif + +#ifdef MAKE_FS1 + case ABORT_GAME_BUTTON: + gamesnd_play_iface(SND_USER_SELECT); + choice = popup( PF_NO_NETWORKING | PF_BODY_BIG, 2, POPUP_NO, POPUP_YES, XSTR("Exit Game?", 374)); + if ( choice == 1 ) + gameseq_post_event(GS_EVENT_QUIT_GAME); + break; +#endif } } @@ -2459,6 +2631,7 @@ void options_multi_accept() // NOTE : this is different from the initialization function, which is called only when the options menu is started void options_multi_select() { +#ifndef FS1_DEMO // set the windows mask bitmap Assert(Om_mask_0 >= 0); Om_window->set_mask_bmap(Om_mask_0, Om_background_0_mask_fname[gr_screen.res]); @@ -2474,11 +2647,13 @@ void options_multi_select() // enable the general tab controls options_multi_enable_gen_controls(); +#endif } // return the bitmap handle of the current background bitmap, or -1 if the multiplayer tab is not active int options_multi_background_bitmap() { +#ifndef FS1_DEMO // return the background bitmap mode based upon the current mode switch(Om_mode){ case OM_MODE_GENERAL: @@ -2490,6 +2665,7 @@ int options_multi_background_bitmap() // unknown mode of some kind return -1; +#endif } // called when the multiplayer tab has been switched from diff --git a/src/menuui/playermenu.cpp b/src/menuui/playermenu.cpp index 4a2803a..e72d2e4 100644 --- a/src/menuui/playermenu.cpp +++ b/src/menuui/playermenu.cpp @@ -15,6 +15,9 @@ * Code to drive the Player Select initial screen * * $Log$ + * Revision 1.5 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.4 2003/05/22 16:13:35 taylor * fix missed German build option for auto-lang * @@ -203,7 +206,7 @@ // -------------------------------------------------------------------------------------------------------- // Demo title screen -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) static int Demo_title_active = 0; static int Demo_title_bitmap = -1; static int Demo_title_expire_timestamp = 0; @@ -236,7 +239,11 @@ int Player_select_max_lines[GR_NUM_RESOLUTIONS] = { // max # of pilots display // list text display area int Choose_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 130, 140, 379, 68 +#else 114, 117, 400, 87 +#endif }, { // GR_1024 183, 186, 640, 139 @@ -267,6 +274,16 @@ struct barracks_buttons { static barracks_buttons Player_select_buttons[GR_NUM_RESOLUTIONS][NUM_PLAYER_SELECT_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + barracks_buttons("CHP_00", 126, 211, -1, -1, 0), // create + barracks_buttons("CHP_13", 181, 211, -1, -1, 13), // clone + barracks_buttons("CHP_11", 228, 211, -1, -1, 11), // delete + barracks_buttons("CHP_01", 423, 232, -1, -1, 1), // scroll up + barracks_buttons("CHP_02", 452, 232, -1, -1, 2), // scroll down + barracks_buttons("CHP_12", 475, 213, -1, -1, 12), // accept + barracks_buttons("CHP_14", 438, 104, -1, -1, 14), // single + barracks_buttons("CHP_15", 485, 104, -1, -1, 15) // multi +#else // create, clone and delete (respectively) barracks_buttons("CPB_00", 114, 205, 117, 240, 0), barracks_buttons("CPB_01", 172, 205, 175, 240, 1), @@ -280,6 +297,7 @@ static barracks_buttons Player_select_buttons[GR_NUM_RESOLUTIONS][NUM_PLAYER_SEL // single player select and multiplayer select, respectively barracks_buttons("CPB_06", 428, 82, 430, 108, 6), barracks_buttons("CPB_07", 477, 82, 481, 108, 7) +#endif }, { // GR_1024 // create, clone and delete (respectively) @@ -299,13 +317,23 @@ static barracks_buttons Player_select_buttons[GR_NUM_RESOLUTIONS][NUM_PLAYER_SEL }; // FIXME add to strings.tbl -#define PLAYER_SELECT_NUM_TEXT 1 +#ifdef MAKE_FS1 + #define PLAYER_SELECT_NUM_TEXT 0 +#else + #define PLAYER_SELECT_NUM_TEXT 1 +#endif UI_XSTR Player_select_text[GR_NUM_RESOLUTIONS][PLAYER_SELECT_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Choose Pilot", 1436, 122, 90, UI_XSTR_COLOR_GREEN, -1, NULL } +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Choose Pilot", 1436, 195, 143, UI_XSTR_COLOR_GREEN, -1, NULL } +#endif } }; @@ -343,12 +371,20 @@ int Player_select_force_bastion = 0; // notification text areas static int Player_select_bottom_text_y[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 280, +#else 314, // GR_640 +#endif 502 // GR_1024 }; static int Player_select_middle_text_y[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 280, +#else 253, // GR_640 +#endif 404 // GR_1024 }; @@ -399,7 +435,9 @@ void player_select_init() { int i; barracks_buttons *b; +#ifndef MAKE_FS1 UI_WINDOW *w; +#endif // start a looping ambient sound main_hall_start_ambient(); @@ -425,7 +463,11 @@ void player_select_init() // create the UI window Player_select_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0); Player_select_window.set_mask_bmap(Player_select_background_mask_bitmap[gr_screen.res]); - + +#ifdef MAKE_FS1 + common_set_interface_palette("ChoosePilotPalette"); +#endif + // initialize the control buttons for (i=0; ibutton.link_hotspot(b->hotspot); } +#ifndef MAKE_FS1 // add some text w = &Player_select_window; w->add_XSTR("Create", 1034, Player_select_buttons[gr_screen.res][CREATE_PILOT_BUTTON].xt, Player_select_buttons[gr_screen.res][CREATE_PILOT_BUTTON].yt, &Player_select_buttons[gr_screen.res][CREATE_PILOT_BUTTON].button, UI_XSTR_COLOR_GREEN); @@ -458,7 +501,7 @@ void player_select_init() for(i=0; iadd_XSTR(&Player_select_text[gr_screen.res][i]); } - +#endif // create the list button text select region Player_select_list_region.create(&Player_select_window, "", Choose_list_coords[gr_screen.res][0], Choose_list_coords[gr_screen.res][1], Choose_list_coords[gr_screen.res][2], Choose_list_coords[gr_screen.res][3], 0, 1); @@ -530,7 +573,7 @@ void player_select_init() } } -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) // Display the demo title screen void demo_title_blit() { @@ -613,7 +656,11 @@ void player_select_do() // play a little sound gamesnd_play_iface(SND_USER_SELECT); if(Player_select_mode == PLAYER_SELECT_MODE_MULTI){ +#ifdef MAKE_FS1 + player_select_set_bottom_text(XSTR( "Single Player Mode", 376)); +#else player_select_set_bottom_text(XSTR( "Single-Player Mode", 376)); +#endif // reinitialize as single player mode player_select_init_player_stuff(PLAYER_SELECT_MODE_SINGLE); @@ -707,6 +754,10 @@ void player_select_close() // bm_release(Player_select_palette); //Player_select_palette = -1; // } + +#ifdef MAKE_FS1 + common_free_interface_palette(); +#endif // setup the player struct Player_num = 0; @@ -916,7 +967,7 @@ int player_select_create_new_pilot() int play_scroll_sound = 1; -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) if ( Demo_title_active ) { play_scroll_sound = 0; } @@ -1322,8 +1373,17 @@ void player_select_display_copyright() { int sx, sy, w; char Copyright_msg1[256], Copyright_msg2[256]; - -// strcpy(Copyright_msg1, XSTR("Descent: FreeSpace - The Great War, Copyright c 1998, Volition, Inc.", -1)); + +#ifdef MAKE_FS1 + gr_set_color_fast(&Color_bright); + + if (Lcl_gr) { + sprintf(Copyright_msg1, XSTR("Descent: FreeSpace - The Great War, Copyright %c 1998, Volition, Inc.", 384), '\xA8'); + } else { + sprintf(Copyright_msg1, XSTR("Descent: FreeSpace - The Great War, Copyright %c 1998, Volition, Inc.", 384), '\x83'); + } + sprintf(Copyright_msg2, XSTR("All Rights Reserved", 385)); +#else gr_set_color_fast(&Color_white); sprintf(Copyright_msg1, NOX("FreeSpace 2")); @@ -1332,6 +1392,7 @@ void player_select_display_copyright() } else { sprintf(Copyright_msg2, XSTR("Copyright %c 1999, Volition, Inc. All rights reserved.", 385), '\x83'); } +#endif // MAKE_FS1 gr_get_string_size(&w, NULL, Copyright_msg1); sx = fl2i((gr_screen.max_w / 2) - w/2.0f + 0.5f); @@ -1353,7 +1414,11 @@ void player_select_display_all_text() gr_get_string_size(&w, &h, Player_select_bottom_text); w = (gr_screen.max_w - w) / 2; +#ifdef MAKE_FS1 + gr_set_color_fast(&Color_bright); +#else gr_set_color_fast(&Color_bright_white); +#endif gr_printf(w, Player_select_bottom_text_y[gr_screen.res], Player_select_bottom_text); } @@ -1469,6 +1534,7 @@ int Player_tips_shown = 0; // tooltips void player_tips_init() { +#ifndef MAKE_FS1 Num_player_tips = 0; // begin external localization stuff @@ -1488,9 +1554,11 @@ void player_tips_init() // stop externalizing, homey lcl_ext_close(); +#endif } void player_tips_popup() { +#ifndef MAKE_FS1 int tip, ret; // player has disabled tips @@ -1531,4 +1599,5 @@ void player_tips_popup() break; } } while(ret > 0); +#endif } diff --git a/src/menuui/readyroom.cpp b/src/menuui/readyroom.cpp index 497579b..5219347 100644 --- a/src/menuui/readyroom.cpp +++ b/src/menuui/readyroom.cpp @@ -15,6 +15,9 @@ * Ready Room code, which is the UI screen for selecting Campaign/mission to play next mainly. * * $Log$ + * Revision 1.4 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:22 relnev * added copyright header * @@ -107,7 +110,11 @@ int Mission_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 82, 108, 409, 277 +#else 33, 108, 402, 279 +#endif }, { // GR_1024 43, 175, 402, 279 @@ -116,7 +123,11 @@ int Mission_list_coords[GR_NUM_RESOLUTIONS][4] = { int Campaign_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 491, 108, 113, 277 +#else 491, 108, 115, 279 +#endif }, { // GR_1024 491, 175, 115, 279 @@ -165,6 +176,20 @@ struct sim_room_buttons { static sim_room_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { //XSTR:OFF { // GR_640 +#ifdef MAKE_FS1 + sim_room_buttons("LMB_04", 7, 135, -1, -1, 4), // up arrows + sim_room_buttons("LMB_05", 7, 182, -1, -1, 5), // down arrows + sim_room_buttons("LMB_06", 23, 396, -1, -1, 6), // single missions + sim_room_buttons("LMB_07", 198, 396, -1, -1, 7), // campaign missions + sim_room_buttons("LMB_08", 469, 427, -1, -1, 8), // help + sim_room_buttons("LMB_09", 554, 411, -1, -1, 9), // commit + sim_room_buttons("LMB_10", 447, 452, -1, -1, 10), // options + + sim_room_buttons("TDB_00", 0, 0, -1, -1, 0), // technical database + sim_room_buttons("TDB_01", 0, 19, -1, -1, 1), // mission simulator + sim_room_buttons("TDB_02", 0, 35, -1, -1, 2), // cutscenes + sim_room_buttons("TDB_03", 0, 56, -1, -1, 3), // credits +#else sim_room_buttons("LMB_04", 1, 99, -1, -1, 4), sim_room_buttons("LMB_05", 1, 381, -1, -1, 5), sim_room_buttons("LMB_06", 6, 438, 40, 445, 6), @@ -177,6 +202,7 @@ static sim_room_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { sim_room_buttons("TDB_01", 7, 18, 37, 23, 1), sim_room_buttons("TDB_02", 7, 34, 37, 38, 2), sim_room_buttons("TDB_03", 7, 49, 37, 54, 3), +#endif }, { // GR_1024 sim_room_buttons("2_LMB_04", 2, 159, -1, -1, 4), @@ -214,17 +240,27 @@ char *Campaign_mask_filename[GR_NUM_RESOLUTIONS] = { }; // misc text. ("Mission" and "Filename" -#define NUM_SIM_MISC_TEXT 2 +#ifdef MAKE_FS1 + #define NUM_SIM_MISC_TEXT 0 +#else + #define NUM_SIM_MISC_TEXT 2 +#endif #define SIM_MISC_TEXT_MISSION 0 #define SIM_MISC_TEXT_FILENAME 1 int Sim_misc_text_coords[GR_NUM_RESOLUTIONS][NUM_SIM_MISC_TEXT][2] = { { // GR_640 + // nothing needed for FS1 +#ifndef MAKE_FS1 {33, 95}, {491, 95} +#endif }, { // GR_1024 + // nothing needed for FS1 +#ifndef MAKE_FS1 {43, 155}, {491, 155} +#endif } }; @@ -234,6 +270,9 @@ int Sim_misc_text_coords[GR_NUM_RESOLUTIONS][NUM_SIM_MISC_TEXT][2] = { #define READYROOM_LINE_MISSION 3 #define READYROOM_FLAG_FROM_VOLITION (1<<0) // volition made +#ifdef MAKE_FS1 +#define READYROOM_FLAG_FROM_MDISK (1<<1) // mission disk +#endif static struct { int type; // see READYROOM_LINE_* defines above char *name; @@ -282,24 +321,50 @@ static hash_node *Campaign_mission_hash_table[CAMPAIGN_MISSION_HASH_SIZE]; static int Hash_table_inited; // special icons (1.04 + stuff) +#ifdef MAKE_FS1 +#define NUM_MISSION_ICONS 2 +#else #define NUM_MISSION_ICONS 1 +#endif #define MISSION_ICON_VOLITION 0 // mini volition death's head :) +#ifdef MAKE_FS1 +#define MISSION_ICON_MDISK 1 // Silent Threat mini icon +#endif // icon offsets (see LIST_ defines above //#define MISSION_ICON_VOLITION_X (46) #define MISSION_ICON_VOLITION_Y_OFFSET (-1) +#ifdef MAKE_FS1 +#define MISSION_ICON_MDISK_Y_OFFSET (0) +#endif // icon offsets static int Sim_volition_icon_x[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 45, +#else 38, +#endif 49 }; +#ifdef MAKE_FS1 +static int Sim_silent_icon_x[GR_NUM_RESOLUTIONS] = { + 58, + 58 +}; +#endif + // special icons themselves int Mission_icon_bitmaps[NUM_MISSION_ICONS]; //XSTR:OFF char *Mission_icon_bitmap_filenames[NUM_MISSION_ICONS] = { +#ifdef MAKE_FS1 + "icon-volition", + "icon-silent" +#else "icon-volition" +#endif }; //XSTR:ON void sim_room_load_mission_icons(); @@ -548,6 +613,11 @@ int build_standalone_mission_list_do_frame() if((fb != NULL) && (fb->flags & FSB_FROM_VOLITION)){ flags |= READYROOM_FLAG_FROM_VOLITION; } +#ifdef MAKE_FS1 + if((fb != NULL) && (fb->flags & FSB_FROM_MDISK)){ + flags |= READYROOM_FLAG_FROM_MDISK; + } +#endif // add the line sim_room_line_add(READYROOM_LINE_MISSION, Standalone_mission_names[Num_standalone_missions_with_info], Mission_filenames[Num_standalone_missions_with_info], list_x1 + M_TEXT_X, y, flags); @@ -604,6 +674,12 @@ int build_campaign_mission_list_do_frame() if((fb != NULL) && (fb->flags & FSB_FROM_VOLITION)){ flags |= READYROOM_FLAG_FROM_VOLITION; } + +#ifdef MAKE_FS1 + if((fb != NULL) && (fb->flags & FSB_FROM_MDISK)){ + flags |= READYROOM_FLAG_FROM_MDISK; + } +#endif sim_room_line_add(READYROOM_LINE_CMISSION, Campaign_mission_names[Num_campaign_missions_with_info], Campaign.missions[Num_campaign_missions_with_info].name, list_x1 + C_SUBTEXT_X, y, flags); } @@ -648,6 +724,12 @@ void sim_room_build_listing() if((fb != NULL) && (fb->flags & FSB_FROM_VOLITION)){ flags |= READYROOM_FLAG_FROM_VOLITION; } + +#ifdef MAKE_FS1 + if((fb != NULL) && (fb->flags & FSB_FROM_MDISK)){ + flags |= READYROOM_FLAG_FROM_MDISK; + } +#endif sim_room_line_add(READYROOM_LINE_MISSION, Standalone_mission_names[i], Mission_filenames[i], list_x1 + M_TEXT_X, y, flags); y += font_height + 2; @@ -675,6 +757,12 @@ void sim_room_build_listing() flags |= READYROOM_FLAG_FROM_VOLITION; } +#ifdef MAKE_FS1 + if((fb != NULL) && (fb->flags & FSB_FROM_MDISK)){ + flags |= READYROOM_FLAG_FROM_MDISK; + } +#endif + sim_room_line_add(READYROOM_LINE_CMISSION, Campaign_mission_names[i], Campaign.missions[i].name, list_x1 + C_SUBTEXT_X, y, flags); y += font_height; } @@ -880,7 +968,7 @@ int readyroom_continue_campaign() { if (mission_campaign_next_mission()) { // is campaign and next mission valid? -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) int reset_campaign = 0; reset_campaign = popup(PF_BODY_BIG, 2, POPUP_NO, POPUP_YES, XSTR( "Demo Campaign Is Over. Would you like to play the campaign again?", 111) ); if ( reset_campaign == 1 ) { @@ -892,7 +980,12 @@ int readyroom_continue_campaign() } #else gamesnd_play_iface(SND_GENERAL_FAIL); +#ifdef MAKE_FS1 + // make it the bottom button so that the graphic looks right + popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "The campaign is over. To replay the campaign, either create a new pilot or restart the campaign in the campaign room.", 112) ); +#else popup(0, 1, POPUP_OK, XSTR( "The campaign is over. To replay the campaign, either create a new pilot or restart the campaign in the campaign room.", 112) ); +#endif return -1; #endif } @@ -1030,6 +1123,7 @@ void sim_room_init() b->button.link_hotspot(b->hotspot); } +#ifndef MAKE_FS1 // screen/button specific text Ui_window.add_XSTR("Single Missions", 1060, Buttons[gr_screen.res][MISSION_TAB].xt, Buttons[gr_screen.res][MISSION_TAB].yt, &Buttons[gr_screen.res][MISSION_TAB].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Campaign Missions", 1061, Buttons[gr_screen.res][CAMPAIGN_TAB].xt, Buttons[gr_screen.res][CAMPAIGN_TAB].yt, &Buttons[gr_screen.res][CAMPAIGN_TAB].button, UI_XSTR_COLOR_GREEN); @@ -1046,6 +1140,7 @@ void sim_room_init() // misc text - not associated with any buttons Ui_window.add_XSTR("Mission", 1063, Sim_misc_text_coords[gr_screen.res][SIM_MISC_TEXT_MISSION][0], Sim_misc_text_coords[gr_screen.res][SIM_MISC_TEXT_MISSION][1], NULL, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Filename", 1064, Sim_misc_text_coords[gr_screen.res][SIM_MISC_TEXT_FILENAME][0], Sim_misc_text_coords[gr_screen.res][SIM_MISC_TEXT_FILENAME][1], NULL, UI_XSTR_COLOR_GREEN); +#endif for (i=0; iflags & FSB_FROM_VOLITION) ? 1 : 0; +#ifdef MAKE_FS1 + is_md = (fb->flags & FSB_FROM_MDISK) ? 1 : 0; +#endif } // if the line is flagged as a volition file @@ -1362,12 +1463,23 @@ void sim_room_blit_icons(int line_index, int y_start, fs_builtin_mission *fb, in gr_set_bitmap(Mission_icon_bitmaps[MISSION_ICON_VOLITION]); gr_bitmap(Sim_volition_icon_x[gr_screen.res], y_start + MISSION_ICON_VOLITION_Y_OFFSET); } + +#ifdef MAKE_FS1 + if(is_md && (Mission_icon_bitmaps[MISSION_ICON_MDISK] >= 0)){ + gr_set_bitmap(Mission_icon_bitmaps[MISSION_ICON_MDISK]); + gr_bitmap(Sim_silent_icon_x[gr_screen.res], y_start + MISSION_ICON_MDISK_Y_OFFSET); + } +#endif } /// Campaign room stuff below int Cr_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 47, 55, 561, 195 +#else 47, 21, 565, 233 +#endif }, { // GR_1024 64, 34, 916, 373 @@ -1376,7 +1488,11 @@ int Cr_list_coords[GR_NUM_RESOLUTIONS][4] = { int Cr_info_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 64, 280, 407, 75 +#else 28, 267, 476, 103 +#endif }, { // GR_1024 45, 427, 761, 165 @@ -1398,12 +1514,21 @@ int Cr_info_coords[GR_NUM_RESOLUTIONS][4] = { ui_button_info Cr_buttons[GR_NUM_RESOLUTIONS][CR_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("CAB_00", 0, 95, -1, -1, 0), // scroll up + ui_button_info("CAB_01", 0, 142, -1, -1, 1), // scroll down + ui_button_info("CAB_02", 17, 259, -1, -1, 2), // info scroll up + ui_button_info("CAB_03", 17, 307, -1, -1, 3), // info scroll down + ui_button_info("CAB_07", 545, 323, -1, -1, 7), // reset + ui_button_info("CAB_04", 561, 411, -1, -1, 4), // select +#else ui_button_info("CAB_00", 2, 42, -1, -1, 0), ui_button_info("CAB_01", 2, 89, -1, -1, 1), ui_button_info("CAB_02", 2, 279, -1, -1, 2), ui_button_info("CAB_03", 2, 325, -1, -1, 3), ui_button_info("CAB_04", 579, 353, -1, -1, 4), ui_button_info("CAB_05", 575, 434, -1, -1, 5), +#endif }, { // GR_1024 ui_button_info("2_CAB_00", 3, 68, -1, -1, 0), @@ -1416,17 +1541,27 @@ ui_button_info Cr_buttons[GR_NUM_RESOLUTIONS][CR_NUM_BUTTONS] = { }; // text -#define CR_NUM_TEXT 3 +#ifdef MAKE_FS1 + #define CR_NUM_TEXT 0 +#else + #define CR_NUM_TEXT 3 +#endif UI_XSTR Cr_text[GR_NUM_RESOLUTIONS][CR_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Restart", 1403, 569, 326, UI_XSTR_COLOR_GREEN, -1, &Cr_buttons[0][CR_RESET_BUTTON].button }, { "Campaign", 1404, 569, 337, UI_XSTR_COLOR_GREEN, -1, &Cr_buttons[0][CR_RESET_BUTTON].button }, { "Select", 1409, 568, 413, UI_XSTR_COLOR_PINK, -1, &Cr_buttons[0][CR_COMMIT_BUTTON].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Restart", 1403, 922, 523, UI_XSTR_COLOR_GREEN, -1, &Cr_buttons[1][CR_RESET_BUTTON].button }, { "Campaign", 1404, 922, 538, UI_XSTR_COLOR_GREEN, -1, &Cr_buttons[1][CR_RESET_BUTTON].button }, { "Select", 1409, 921, 665, UI_XSTR_COLOR_PINK, -1, &Cr_buttons[1][CR_COMMIT_BUTTON].button }, +#endif } }; @@ -1476,6 +1611,11 @@ void campaign_room_build_listing() if(fb->flags & FSB_FROM_VOLITION){ flags |= READYROOM_FLAG_FROM_VOLITION; } +#ifdef MAKE_FS1 + if(fb->flags & FSB_FROM_MDISK){ + flags |= READYROOM_FLAG_FROM_MDISK; + } +#endif } sim_room_line_add(READYROOM_LINE_CAMPAIGN, Campaign_names[c], Campaign_file_names[c], Cr_list_coords[gr_screen.res][0], y, flags); @@ -1625,7 +1765,9 @@ void campaign_room_init() list_h = Mission_list_coords[gr_screen.res][3]; - // common_set_interface_palette("InterfacePalette"); // set the interface palette +#ifdef MAKE_FS1 + common_set_interface_palette("InterfacePalette"); // set the interface palette +#endif Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0); Ui_window.set_mask_bmap(Campaign_mask_filename[gr_screen.res]); diff --git a/src/menuui/techmenu.cpp b/src/menuui/techmenu.cpp index 92d3495..6b2ea2b 100644 --- a/src/menuui/techmenu.cpp +++ b/src/menuui/techmenu.cpp @@ -15,6 +15,9 @@ * C module that contains functions to drive the Tech Menu user interface * * $Log$ + * Revision 1.6 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -259,7 +262,11 @@ #define REVOLUTION_RATE 5.2f -#define NUM_BUTTONS 16 +#ifdef MAKE_FS1 + #define NUM_BUTTONS 18 +#else + #define NUM_BUTTONS 16 +#endif #define NUM_TABS 3 #define LIST_BUTTONS_MAX 41 @@ -288,8 +295,10 @@ #define OPTIONS_BUTTON 14 #define EXIT_BUTTON 15 -//#define PREV_ENTRY_BUTTON2 16 -//#define NEXT_ENTRY_BUTTON2 17 +#ifdef MAKE_FS1 +#define PREV_ENTRY_BUTTON2 16 +#define NEXT_ENTRY_BUTTON2 17 +#endif #define REPEAT (1<<0) @@ -311,14 +320,30 @@ char *Tech_mask_filename[GR_NUM_RESOLUTIONS] = { "TechShipData-M", "2_TechShipData-M" }; +#ifndef MAKE_FS1 char *Tech_slider_filename[GR_NUM_RESOLUTIONS] = { "slider", "2_slider" }; +#endif + +#ifdef MAKE_FS1 +// need the second background for FS1 +char *Tech_data_background_filename = { + "TechData" +}; +char *Tech_data_mask_filename = { + "TechData-M" +}; +#endif int Tech_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 35, 131, 178, 198 +#else 27, 98, 161, 234 +#endif }, { // GR_1024 43, 157, 253, 374 @@ -327,7 +352,11 @@ int Tech_list_coords[GR_NUM_RESOLUTIONS][4] = { int Tech_ship_display_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 234, 115, 390, 229 +#else 239, 98, 393, 222 +#endif }, { // GR_1024 382, 158, 629, 355 @@ -336,7 +365,11 @@ int Tech_ship_display_coords[GR_NUM_RESOLUTIONS][4] = { int Tech_desc_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 22, 362, 382, 64 +#else 29, 347, 365, 125 +#endif }, { // GR_1024 47, 555, 584, 200 @@ -345,22 +378,29 @@ int Tech_desc_coords[GR_NUM_RESOLUTIONS][4] = { int Tech_ani_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 424, 140 +#else 196, 115 +#endif }, { // GR_1024 449, 245 } }; -/*int Tech_desc_coords[GR_NUM_RESOLUTIONS][4] = { +#ifdef MAKE_FS1 +int Tech_data_desc_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 24, 139, 376, 281 }, { // GR_1024 24, 182, 638, 528 } -};*/ +}; +#endif +#ifndef MAKE_FS1 int Tech_slider_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 2, 118, 20, 194 @@ -369,6 +409,7 @@ int Tech_slider_coords[GR_NUM_RESOLUTIONS][4] = { 3, 190, 32, 310 } }; +#endif // detail backup int Tech_detail_backup; @@ -390,6 +431,28 @@ struct techroom_buttons { static techroom_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + techroom_buttons("TDB_04", 20, 429, -1, -1, 4, -1), // ship data tab + techroom_buttons("TDB_05", 70, 429, -1, -1, 5, -1), // weapons data tab + techroom_buttons("TDB_06", 147, 429, -1, -1, 6, -1), // species data tab + techroom_buttons("TDB_00", 0, 0, -1, -1, 0, -1), // technical database tab + techroom_buttons("TDB_01", 0, 19, -1, -1, 1, -1), // mission simulator tab + techroom_buttons("TDB_02", 0, 35, -1, -1, 2, -1), // cutscenes tab + techroom_buttons("TDB_03", 0, 56, -1, -1, 3, -1), // credits tab + techroom_buttons("TSB_16", 0, 206, -1, -1, 16, SHIPS_DATA_MODE), // list up + techroom_buttons("TSB_17", 0, 254, -1, -1, 17, SHIPS_DATA_MODE), // list down + techroom_buttons("TSB_18", 411, 351, -1, -1, 18, SHIPS_DATA_MODE), // description up + techroom_buttons("TSB_19", 411, 397, -1, -1, 19, SHIPS_DATA_MODE), // description down +// techroom_buttons("TDB_11", 558, 272, -1, -1, 11, WEAPONS_SPECIES_DATA_MODE), // prev data entry +// techroom_buttons("TDB_12", 606, 272, -1, -1, 12, WEAPONS_SPECIES_DATA_MODE), // next data entry + techroom_buttons("TSB_22", 477, 338, -1, -1, 22, SHIPS_DATA_MODE), // prev data entry + techroom_buttons("TSB_23", 524, 338, -1, -1, 23, SHIPS_DATA_MODE), // next data entry + techroom_buttons("TDB_13", 469, 425, -1, -1, 13, -1), // help + techroom_buttons("TDB_14", 448, 452, -1, -1, 14, -1), // options + techroom_buttons("TDB_15", 552, 411, -1, -1, 15, -1), // exit + techroom_buttons("TDB_11", 477, 291, -1, -1, 11, WEAPONS_SPECIES_DATA_MODE), // prev data entry + techroom_buttons("TDB_12", 524, 291, -1, -1, 12, WEAPONS_SPECIES_DATA_MODE), // next data entry +#else techroom_buttons("TDB_04", 406, 384, 447, 393, 4, -1), // ship data tab techroom_buttons("TDB_05", 404, 418, 447, 429, 5, -1), // weapons data tab techroom_buttons("TDB_06", 404, 447, 447, 461, 6, -1), // species data tab @@ -408,6 +471,7 @@ static techroom_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { techroom_buttons("TDB_13", 533, 425, 500, 440, 13, -1), // help techroom_buttons("TDB_14", 533, 455, 479, 464, 14, -1), // options techroom_buttons("TDB_15a",571, 425, 588, 413, 15, -1), // exit +#endif }, { // GR_1024 techroom_buttons("2_TDB_04", 649, 614, 717, 630, 4, -1), // ship data tab @@ -421,8 +485,11 @@ static techroom_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { techroom_buttons("2_TDB_08", 1, 507, -1, -1, 8, SHIPS_DATA_MODE, REPEAT), // next data entry techroom_buttons("2_TDB_09", 1, 649, -1, -1, 9, SHIPS_DATA_MODE, REPEAT), // prev data entry techroom_buttons("2_TDB_10", 1, 716, -1, -1, 10, SHIPS_DATA_MODE, REPEAT), // next data entry - //techroom_buttons("2_TDB_11", 893, 436, -1, -1, 11, WEAPONS_SPECIES_DATA_MODE), // prev data entry - //techroom_buttons("2_TDB_12", 970, 436, -1, -1, 12, WEAPONS_SPECIES_DATA_MODE), // next data entry +#ifdef MAKE_FS1 + // filler + techroom_buttons("2_TDB_11", 893, 436, -1, -1, 11, WEAPONS_SPECIES_DATA_MODE), // prev data entry + techroom_buttons("2_TDB_12", 970, 436, -1, -1, 12, WEAPONS_SPECIES_DATA_MODE), // next data entry +#endif techroom_buttons("2_TDB_11a", 895, 518, -1, -1, 11, SHIPS_DATA_MODE, REPEAT), // prev data entry techroom_buttons("2_TDB_12a", 974, 518, -1, -1, 12, SHIPS_DATA_MODE, REPEAT), // next data entry techroom_buttons("2_TDB_13", 854, 681, 800, 704, 13, -1), // help @@ -434,6 +501,9 @@ static techroom_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { static UI_WINDOW Ui_window; static UI_BUTTON View_window; //static int Background_bitmap; +#ifdef MAKE_FS1 +static int Tech_data_background_bitmap; +#endif static int Tech_background_bitmap; static int Tab = 0; // static int List_size; @@ -456,11 +526,13 @@ static float Techroom_ship_rot; static UI_BUTTON List_buttons[LIST_BUTTONS_MAX]; // buttons for each line of text in list static int Anim_playing_id = -1; static anim_instance *Cur_anim_instance = NULL; -static int Palette_bmp; -//static int ShipWin01; -//static int ShipWin02; -//static int ShipWin03; -//static int ShipWin04; +//static int Palette_bmp; +#ifdef MAKE_FS1 +static int ShipWin01; +static int ShipWin02; +static int ShipWin03; +static int ShipWin04; +#endif static ubyte Palette[768]; static char Palette_name[128]; @@ -487,18 +559,19 @@ static int Intel_list_size = 0; static tech_list_entry *Current_list; // points to currently valid display list static int Current_list_size = 0; - +#ifndef MAKE_FS1 // slider stuff static UI_SLIDER2 Tech_slider; +#endif //XSTR:OFF -/* +#ifdef MAKE_FS1 static char *Intel_anim_filenames[MAX_INTEL_ENTRIES] = { "tech_tpilot.ani", "tech_vasudan.ani", "tech_shivan.ani", }; -*/ +#endif //XSTR:ON // Intelligence master data structs (these get inited @ game startup from species.tbl) @@ -511,6 +584,10 @@ void tech_common_render(); void techroom_start_anim(); void tech_scroll_list_up(); void tech_scroll_list_down(); +#ifdef MAKE_FS1 +void techroom_data_init(); +void techroom_tab_setup(int set_palette); +#endif @@ -563,7 +640,15 @@ void techroom_select_new_entry() // Techroom_ship_rot = PI; +#ifdef MAKE_FS1 + if (Tab == (WEAPONS_DATA_TAB || INTEL_DATA_TAB)){ + techroom_init_desc(Current_list[Cur_entry].desc, Tech_data_desc_coords[gr_screen.res][SHIP_W_COORD]); + } else { + techroom_init_desc(Current_list[Cur_entry].desc, Tech_desc_coords[gr_screen.res][SHIP_W_COORD]); + } +#else techroom_init_desc(Current_list[Cur_entry].desc, Tech_desc_coords[gr_screen.res][SHIP_W_COORD]); +#endif techroom_start_anim(); } @@ -596,6 +681,7 @@ void techroom_render_desc(int xo, int yo, int h) } // maybe output 'more' indicator +#ifndef MAKE_FS1 // not used in original if ( z < Text_size ) { // can be scrolled down int more_txt_x = Tech_desc_coords[gr_screen.res][0] + (Tech_desc_coords[gr_screen.res][2]/2) - 10; // FIXME should move these to constants since they dont move @@ -607,6 +693,7 @@ void techroom_render_desc(int xo, int yo, int h) gr_set_color_fast(&Color_red); gr_string(more_txt_x, more_txt_y, XSTR("more", 1469)); // base location on the input x and y? } +#endif } @@ -614,7 +701,13 @@ void techroom_render_desc(int xo, int yo, int h) void techroom_weapons_render2(float frametime) { // render common stuff +#ifndef MAKE_FS1 tech_common_render(); +#else + // render description in its box + gr_set_color_fast(&Color_text_normal); + techroom_render_desc(Tech_data_desc_coords[gr_screen.res][SHIP_X_COORD], Tech_data_desc_coords[gr_screen.res][SHIP_Y_COORD], Tech_data_desc_coords[gr_screen.res][SHIP_H_COORD]); +#endif // render the animation { @@ -803,12 +896,16 @@ void tech_prev_entry() // this happens when there are not enough items to scroll List_offset = 0; } +#ifndef MAKE_FS1 Tech_slider.force_currentItem(Tech_slider.get_numberItems()); +#endif } else { // maybe adjust list position by 1 if (List_offset > Cur_entry) { tech_scroll_list_up(); +#ifndef MAKE_FS1 Tech_slider.forceUp(); +#endif } } @@ -825,12 +922,16 @@ void tech_next_entry() // scroll to beginning of list List_offset = 0; +#ifndef MAKE_FS1 Tech_slider.force_currentItem(Cur_entry); +#endif } else { // maybe adjust list position by 1 if (List_offset + Tech_list_coords[gr_screen.res][SHIP_H_COORD] / gr_get_font_height() <= Cur_entry) { tech_scroll_list_down(); +#ifndef MAKE_FS1 Tech_slider.forceDown(); +#endif } } @@ -919,7 +1020,13 @@ void techroom_weapons_render(float frametime) void techroom_intel_render(float frametime) { +#ifndef MAKE_FS1 tech_common_render(); +#else + // render description in its box + gr_set_color_fast(&Color_text_normal); + techroom_render_desc(Tech_data_desc_coords[gr_screen.res][SHIP_X_COORD], Tech_data_desc_coords[gr_screen.res][SHIP_Y_COORD], Tech_data_desc_coords[gr_screen.res][SHIP_H_COORD]); +#endif { // JAS: This code is hacked to allow the animation to use all 256 colors @@ -1013,7 +1120,12 @@ void techroom_change_tab(int num) if (Ships_loaded == 0) { Ship_list_size = 0; for (i=0; i max_num_entries_viewable ? Current_list_size-max_num_entries_viewable : 0); +#endif // no anim to start here break; case WEAPONS_DATA_TAB: - +#ifdef MAKE_FS1 + techroom_data_init(); +#endif // load weapon info & anims if necessary if (Weapons_loaded == 0) { Weapon_list_size = 0; @@ -1046,8 +1162,13 @@ void techroom_change_tab(int num) for (i=0; i 0) && (!strcmp(Weapon_info[i].tech_desc, Weapon_list[Weapon_list_size-1].desc))) { +#else + // exclude entries with no description, basically the same as above but helps get rid of special cases as well + if ((Weapon_list_size > 0) && (!Weapon_info[i].tech_desc)) { +#endif continue; } @@ -1061,6 +1182,53 @@ void techroom_change_tab(int num) Weapon_list[Weapon_list_size].name = Weapon_info[i].name; } +#ifdef MAKE_FS1 + // figure out the animation based on weapon name + if (!strcmp(Weapon_info[i].name, "ML-16 Laser")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_ML16.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Disruptor")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Disruptor.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "D-Advanced")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_DAdvanced.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Avenger")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Avenger.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Flail")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Flail.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Prometheus")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Prometheus.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Banshee")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Banshee.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "MX-50")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_MX50.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "D-Missile")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_DisruptorMissile.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Fury")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Fury.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Hornet")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Hornet.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Interceptor")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Interceptor.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Phoenix V")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Phoenix.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Synaptic")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Synaptic.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Stiletto")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Stiletto.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Tsunami")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Tsunami.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Harbinger")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_Harbinger.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Leech Cannon")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_leech.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "EM Pulse")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_empulse.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "S-Breaker")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_sbreaker.ani", NAME_LENGTH); + } else if (!strcmp(Weapon_info[i].name, "Cluster Bomb")) { + strncpy(Weapon_info[i].tech_anim_filename, "CB_cluster.ani", NAME_LENGTH); + } +#endif + // load the weapon animation if(!techroom_load_ani(&Weapon_list[Weapon_list_size].animation, Weapon_info[i].tech_anim_filename)){ Weapon_list[Weapon_list_size].has_anim = 0; @@ -1082,13 +1250,18 @@ void techroom_change_tab(int num) font_height = gr_get_font_height(); max_num_entries_viewable = Tech_list_coords[gr_screen.res][SHIP_H_COORD] / font_height; +#ifndef MAKE_FS1 Tech_slider.set_numberItems(Current_list_size > max_num_entries_viewable ? Current_list_size-max_num_entries_viewable : 0); +#endif techroom_start_anim(); break; case INTEL_DATA_TAB: +#ifdef MAKE_FS1 + techroom_data_init(); +#endif // load intel if necessary if ( Intel_loaded == 0 ) { // now populate the entry structs @@ -1127,7 +1300,9 @@ void techroom_change_tab(int num) font_height = gr_get_font_height(); max_num_entries_viewable = Tech_list_coords[gr_screen.res][SHIP_H_COORD] / font_height; +#ifndef MAKE_FS1 Tech_slider.set_numberItems(Current_list_size > max_num_entries_viewable ? Current_list_size-max_num_entries_viewable : 0); +#endif techroom_start_anim(); break; @@ -1137,6 +1312,9 @@ void techroom_change_tab(int num) Cur_entry = 0; techroom_select_new_entry(); +#ifdef MAKE_FS1 + techroom_tab_setup(1); +#endif } int techroom_button_pressed(int num) @@ -1183,14 +1361,28 @@ int techroom_button_pressed(int num) tech_next_entry(); break; +#ifdef MAKE_FS1 + case PREV_ENTRY_BUTTON2: + tech_prev_entry(); + break; + + case NEXT_ENTRY_BUTTON2: + tech_next_entry(); + break; +#endif + case SCROLL_LIST_UP: tech_scroll_list_up(); +#ifndef MAKE_FS1 Tech_slider.forceUp(); +#endif break; case SCROLL_LIST_DOWN: tech_scroll_list_down(); +#ifndef MAKE_FS1 Tech_slider.forceDown(); +#endif break; case SCROLL_INFO_UP: @@ -1284,6 +1476,7 @@ void techroom_intel_init() Intel_info_size = 0; +#ifndef MAKE_FS1 while (optional_string("$Entry:")) { Assert(Intel_info_size < MAX_INTEL_ENTRIES); if (Intel_info_size >= MAX_INTEL_ENTRIES) break; @@ -1300,6 +1493,38 @@ void techroom_intel_init() Intel_info_size++; } +#else + if (optional_string("$Terran Tech Description:")) { + stuff_string(Intel_info[Intel_info_size].desc, F_MULTITEXT, NULL, TECH_INTEL_DESC_LEN); + strcpy(Intel_info[Intel_info_size].name, "Terran"); + strcpy(Intel_info[Intel_info_size].anim_filename, Intel_anim_filenames[0]); + Intel_info[Intel_info_size].in_tech_db = 1; + + Intel_info_size++; + } + + if (optional_string("$Vasudan Tech Description:")) { + + stuff_string(Intel_info[Intel_info_size].desc, F_MULTITEXT, NULL, TECH_INTEL_DESC_LEN); + strcpy(Intel_info[Intel_info_size].name, "Vasudan"); + strcpy(Intel_info[Intel_info_size].anim_filename, Intel_anim_filenames[1]); + Intel_info[Intel_info_size].in_tech_db = 1; + + Intel_info_size++; + } + + if (optional_string("$Shivan Tech Description:")) { + + stuff_string(Intel_info[Intel_info_size].desc, F_MULTITEXT, NULL, TECH_INTEL_DESC_LEN); + strcpy(Intel_info[Intel_info_size].name, "Shivan"); + strcpy(Intel_info[Intel_info_size].anim_filename, Intel_anim_filenames[2]); + // FIXME: shouldn't always be in the intel database but no choice at this point + // there are only about 4 missions before they show up anyway so it may not be worth it + Intel_info[Intel_info_size].in_tech_db = 1; + + Intel_info_size++; + } +#endif inited = 1; } } @@ -1338,12 +1563,18 @@ void techroom_init() gr_set_palette(Palette_name, Palette, 1); */ +#ifdef MAKE_FS1 + common_set_interface_palette("TechDataPalette"); +#endif + // unflag fullneb The_mission.flags &= ~MISSION_FLAG_FULLNEB; // set up UI stuff Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0); +#ifndef MAKE_FS1 // do this with techroom_tab_setup() Ui_window.set_mask_bmap(Tech_mask_filename[gr_screen.res]); +#endif Tech_background_bitmap = bm_load(Tech_background_filename[gr_screen.res]); if (Tech_background_bitmap < 0) { @@ -1351,7 +1582,20 @@ void techroom_init() Int3(); } +#ifdef MAKE_FS1 // for weapons/species tab + Tech_data_background_bitmap = bm_load(Tech_data_background_filename); + if (Tech_data_background_bitmap < 0) { + // failed to load bitmap, not a good thing + Int3(); + } + + techroom_tab_setup(0); + + // don't draw buttons that are only on other tabs + for (i=0; ibutton.create(&Ui_window, "", b->x, b->y, 60, 30, b->flags & REPEAT, 1); @@ -1368,7 +1612,8 @@ void techroom_init() b->button.link_hotspot(b->hotspot); } - + +#ifndef MAKE_FS1 // common tab button text Ui_window.add_XSTR("Technical Database", 1055, Buttons[gr_screen.res][TECH_DATABASE_TAB].xt, Buttons[gr_screen.res][TECH_DATABASE_TAB].yt, &Buttons[gr_screen.res][TECH_DATABASE_TAB].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Mission Simulator", 1056, Buttons[gr_screen.res][SIMULATOR_TAB].xt, Buttons[gr_screen.res][SIMULATOR_TAB].yt, &Buttons[gr_screen.res][SIMULATOR_TAB].button, UI_XSTR_COLOR_GREEN); @@ -1386,6 +1631,7 @@ void techroom_init() // Ui_window.add_XSTR("Help", 928, Buttons[gr_screen.res][HELP_BUTTON].xt, Buttons[gr_screen.res][HELP_BUTTON].yt, &Buttons[gr_screen.res][HELP_BUTTON].button, UI_XSTR_COLOR_GREEN); // Ui_window.add_XSTR("Options", 1036, Buttons[gr_screen.res][OPTIONS_BUTTON].xt, Buttons[gr_screen.res][OPTIONS_BUTTON].yt, &Buttons[gr_screen.res][OPTIONS_BUTTON].button, UI_XSTR_COLOR_GREEN); Ui_window.add_XSTR("Exit", 1418, Buttons[gr_screen.res][EXIT_BUTTON].xt, Buttons[gr_screen.res][EXIT_BUTTON].yt, &Buttons[gr_screen.res][EXIT_BUTTON].button, UI_XSTR_COLOR_PINK); +#endif if (Player->flags & PLAYER_FLAGS_IS_MULTI) { Buttons[gr_screen.res][SIMULATOR_TAB].button.disable(); @@ -1395,8 +1641,10 @@ void techroom_init() // set some hotkeys Buttons[gr_screen.res][PREV_ENTRY_BUTTON].button.set_hotkey(KEY_LEFT); Buttons[gr_screen.res][NEXT_ENTRY_BUTTON].button.set_hotkey(KEY_RIGHT); +#ifndef MAKE_FS1 // set per tab Buttons[gr_screen.res][SCROLL_INFO_UP].button.set_hotkey(KEY_UP); Buttons[gr_screen.res][SCROLL_INFO_DOWN].button.set_hotkey(KEY_DOWN); +#endif for (i=0; ibutton.create(&Ui_window, "", b->x, b->y, 60, 30, b->flags & REPEAT, 1); + // set up callback for when a mouse first goes over a button + if (b->filename) { + b->button.set_bmaps(b->filename); + b->button.set_highlight_action(common_play_highlight_sound); + } else { + b->button.hide(); + } + + b->button.link_hotspot(b->hotspot); + } +} + +void techroom_tab_setup(int set_palette) +{ + // char *pal; + int i; + int flags[256]; + + for (i=0; i<256; i++){ + flags[i] = 0; + } + + // activate, deactivate any necessary controls + for (i=0; i= 0) { gr_set_bitmap(Tech_background_bitmap); gr_bitmap(0, 0); } +#endif // render switch (Tab) { case SHIPS_DATA_TAB: +#ifdef MAKE_FS1 + // clear & draw bg bitmap + GR_MAYBE_CLEAR_RES(Tech_background_bitmap); + if (Tech_background_bitmap >= 0) { + gr_set_bitmap(Tech_background_bitmap); + gr_bitmap(0, 0); + } +#endif techroom_ships_render(frametime); - /* +#ifdef MAKE_FS1 if (ShipWin01) { gr_set_bitmap(ShipWin01); gr_bitmap(223, 104); @@ -1642,16 +1999,34 @@ void techroom_do_frame(float frametime) gr_set_bitmap(ShipWin04); gr_bitmap(218, 124); } - */ +#endif break; case WEAPONS_DATA_TAB: +#ifdef MAKE_FS1 + // clear & draw bg bitmap + GR_MAYBE_CLEAR_RES(Tech_data_background_bitmap); + if (Tech_data_background_bitmap >= 0) { + gr_set_bitmap(Tech_data_background_bitmap); + gr_bitmap(0, 0); + } +#endif techroom_weapons_render2(frametime); + break; case INTEL_DATA_TAB: +#ifdef MAKE_FS1 + // clear & draw bg bitmap + GR_MAYBE_CLEAR_RES(Tech_data_background_bitmap); + if (Tech_data_background_bitmap >= 0) { + gr_set_bitmap(Tech_data_background_bitmap); + gr_bitmap(0, 0); + } +#endif techroom_intel_render(frametime); + break; } diff --git a/src/mission/missionbriefcommon.cpp b/src/mission/missionbriefcommon.cpp index 896df62..c35c4fc 100644 --- a/src/mission/missionbriefcommon.cpp +++ b/src/mission/missionbriefcommon.cpp @@ -15,6 +15,9 @@ * C module for briefing code common to FreeSpace and FRED * * $Log$ + * Revision 1.7 2003/05/25 02:30:42 taylor + * Freespace 1 support + * * Revision 1.6 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -214,7 +217,11 @@ char *Brief_static_name[GR_NUM_RESOLUTIONS] = { int Brief_static_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 42, 122 +#else 10, 130 +#endif }, { // GR_1024 15, 208 @@ -223,7 +230,11 @@ int Brief_static_coords[GR_NUM_RESOLUTIONS][2] = { int Brief_bmap_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 42, 122 +#else 0, 115 +#endif }, { // GR_1024 0, 184 @@ -232,7 +243,11 @@ int Brief_bmap_coords[GR_NUM_RESOLUTIONS][2] = { int Brief_grid_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 54, 133, 530, 239 +#else 19, 147, 555, 232 +#endif }, { // GR_1024 30, 235, 888, 371 @@ -241,7 +256,11 @@ int Brief_grid_coords[GR_NUM_RESOLUTIONS][4] = { int Brief_text_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 49, 415, 374, 56 +#else 28, 399, 395, 74 +#endif }, { // GR_1024 46, 637, 630, 120 @@ -250,7 +269,11 @@ int Brief_text_coords[GR_NUM_RESOLUTIONS][4] = { int Brief_stage_text_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 61, 387 +#else 138, 117 +#endif }, { // GR_1024 227, 194 @@ -259,7 +282,11 @@ int Brief_stage_text_coords[GR_NUM_RESOLUTIONS][2] = { int Brief_stage_text_coords_multi[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 61, 387 +#else 479, 385 +#endif }, { // GR_1024 821, 616 @@ -668,13 +695,22 @@ void brief_init_icons() // Reset the highlight and fade anims... call before brief_parse_icon_tbl(); void brief_init_anims() { - int i, idx; +#ifndef MAKE_FS1 + int idx; +#endif + int i; for (i=0; ifade_anim.first_frame >= 0 ) { fi->fade_anim.sx = bx; fi->fade_anim.sy = by; +#ifdef MAKE_FS1 + // FS1 has the anis reversed from FS2 so play them backwards + hud_anim_render(&fi->fade_anim, frametime, 1, 0, 0, 1); +#else hud_anim_render(&fi->fade_anim, frametime, 1, 0, 0, 0); +#endif } } } @@ -1162,7 +1203,12 @@ void brief_render_icon(int stage_num, int icon_num, float frametime, int selecte // hud_set_iff_color(bi->team); brief_set_icon_color(bi->team); +#ifdef MAKE_FS1 + // FS1 has the anims backwards from FS2 so play in reverse + if ( hud_anim_render(ha, frametime, 1, 0, 0, 0) == 0 ) { +#else if ( hud_anim_render(ha, frametime, 1, 0, 0, 1) == 0 ) { +#endif bi->flags &= ~BI_FADEIN; } } else { @@ -1287,7 +1333,9 @@ void brief_render_map(int stage_num, float frametime) gr_set_clip(bscreen.map_x1 + 1, bscreen.map_y1 + 1, bscreen.map_x2 - bscreen.map_x1 - 1, bscreen.map_y2 - bscreen.map_y1 - 2); // REMOVED by neilk: removed gr_clear for FS2 because interface no longer calls for black background on grid - // gr_clear(); +#ifdef MAKE_FS1 + gr_clear(); +#endif if (stage_num >= Briefing->num_stages) { gr_reset_clip(); @@ -1364,7 +1412,11 @@ void brief_blit_stage_num(int stage_num, int stage_max) // int w; Assert( Briefing != NULL ); +#ifdef MAKE_FS1 + gr_set_color_fast(&Color_bright_blue); +#else gr_set_color_fast(&Color_text_heading); +#endif sprintf(buf, XSTR( "Stage %d of %d", 394), stage_num + 1, stage_max); if (Game_mode & GM_MULTIPLAYER) { gr_printf(Brief_stage_text_coords_multi[gr_screen.res][0], Brief_stage_text_coords_multi[gr_screen.res][1], buf); @@ -2379,13 +2431,22 @@ void brief_modify_grid(grid *gridp) void brief_unload_anims() { - int i, idx; +#ifndef MAKE_FS1 + int idx; +#endif + int i; for (i=0; i 0 ){ - free ( Campaign.missions[i].goals ); + free ( Campaign.missions[i].goals ); } if ( Campaign.missions[i].num_events > 0 ){ - free ( Campaign.missions[i].events ); + free ( Campaign.missions[i].events ); } if ( !Fred_running ){ @@ -1822,17 +1831,23 @@ void mission_campaign_end_do() scoring_level_close(); mission_campaign_mission_over(); +#ifdef MAKE_FS1 + movie_play("endgame.mve"); +#else // eventually we'll want to play one of two options (good ending or bad ending) // did the supernova blow? if(Supernova_status == SUPERNOVA_HIT){ movie_play_two("endpart1.mve", "endprt2b.mve"); // good ending } else { movie_play_two("endpart1.mve", "endprt2a.mve"); // good ending - } + } +#endif -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) gameseq_post_event( GS_EVENT_END_DEMO ); -#else +#elif defined(MAKE_FS1) + gameseq_post_event( GS_STATE_END_OF_CAMPAIGN ); +#else gameseq_post_event( GS_EVENT_MAIN_MENU ); #endif } @@ -1913,9 +1928,15 @@ void mission_campaign_jump_to_mission(char *name) // load in the campaign junk mission_load_up_campaign(); +#ifdef MAKE_FS1 + // tack the .fsm onto the input name + strcpy(dest_name, name); + strcat(name, ".fsm"); +#else // tack the .fs2 onto the input name strcpy(dest_name, name); strcat(name, ".fs2"); +#endif // search for our mission for (i=0; icloseup_label, XSTR( "asteroid", 431)); vm_vec_make(&Closeup_cam_pos, 0.0f, 0.0f, -334.0f); @@ -1699,7 +1798,7 @@ void brief_maybe_flash_button() if ( Current_brief_stage == (Num_brief_stages-1) ) { // AL 4-4-98: Don't flash ship selection button on briefing in demo build -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) return; #else // AL 30-3-98: Don't flash ship selection button if in a training mission, @@ -2073,6 +2172,28 @@ void brief_unload_bitmaps() Brief_background_bitmap = -1; } +#ifdef MAKE_FS1 + if (MapWin01 != -1){ + bm_unload(MapWin01); + MapWin01 = -1; + } + + if (MapWin02 != -1){ + bm_unload(MapWin02); + MapWin02 = -1; + } + + if (MapWin03 != -1){ + bm_unload(MapWin03); + MapWin03 = -1; + } + + if (MapWin04 != -1){ + bm_unload(MapWin04); + MapWin04 = -1; + } +#endif + help_overlay_unload(BR_OVERLAY); } @@ -2094,7 +2215,7 @@ void brief_close() // unload the audio streams used for voice playback brief_voice_unload_all(); -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) hud_anim_release(&Fade_anim); #endif @@ -2103,6 +2224,11 @@ void brief_close() Brief_ui_window.destroy(); +#ifdef MAKE_FS1 + // restore palette + common_free_interface_palette(); +#endif + // unload the bitmaps brief_unload_bitmaps(); @@ -2152,7 +2278,7 @@ void brief_maybe_blit_scene_cut(float frametime) { if ( Start_fade_up_anim ) { -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) Fade_anim.time_elapsed = 0.0f; Start_fade_up_anim = 0; Start_fade_down_anim = 1; @@ -2205,7 +2331,7 @@ void brief_maybe_blit_scene_cut(float frametime) Fade_down_anim_start: if ( Start_fade_down_anim ) { -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) Fade_anim.time_elapsed = 0.0f; Start_fade_up_anim = 0; Start_fade_down_anim = 0; diff --git a/src/missionui/missioncmdbrief.cpp b/src/missionui/missioncmdbrief.cpp index b3a165d..c43adae 100644 --- a/src/missionui/missioncmdbrief.cpp +++ b/src/missionui/missioncmdbrief.cpp @@ -15,6 +15,9 @@ * Mission Command Briefing Screen * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:23 relnev * added copyright header * @@ -257,7 +260,11 @@ char *Cmd_brief_mask[GR_NUM_RESOLUTIONS] = { int Cmd_text_wnd_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 30, 165, 362, 271 +#else 17, 109, 606, 108 // GR_640 +#endif }, { 28, 174, 969, 174 // GR_1024 @@ -266,13 +273,21 @@ int Cmd_text_wnd_coords[GR_NUM_RESOLUTIONS][4] = { int Cmd_stage_y[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 147, +#else 90, // GR_640 +#endif 145 // GR_1024 }; int Cmd_image_wnd_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 424, 140, 197, 148 +#else 26, 258, 441, 204 // GR_640 +#endif }, { 155, 475, 706, 327 // GR_1024 @@ -281,6 +296,16 @@ int Cmd_image_wnd_coords[GR_NUM_RESOLUTIONS][4] = { #define NUM_BUTTONS 8 +#ifdef MAKE_FS1 +#define FIRST_STAGE_BUTTON 0 +#define PREV_STAGE_BUTTON 1 +#define NEXT_STAGE_BUTTON 2 +#define LAST_STAGE_BUTTON 3 +#define HELP_BUTTON 4 +#define OPTIONS_BUTTON 5 +#define ACCEPT_BUTTON 6 +#define PAUSE_BUTTON 7 +#else #define FIRST_STAGE_BUTTON 0 #define PREV_STAGE_BUTTON 1 #define PAUSE_BUTTON 2 @@ -289,10 +314,21 @@ int Cmd_image_wnd_coords[GR_NUM_RESOLUTIONS][4] = { #define HELP_BUTTON 5 #define OPTIONS_BUTTON 6 #define ACCEPT_BUTTON 7 +#endif // buttons ui_button_info Cmd_brief_buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("CBB_00", 144, 442, -1, -1, 0), // vcr - beginning + ui_button_info("CBB_01", 169, 442, -1, -1, 1), // vcr - reverse + ui_button_info("CBB_02", 221, 442, -1, -1, 2), // vcr - play + ui_button_info("CBB_03", 247, 442, -1, -1, 3), // vcr - end + ui_button_info("CBB_04", 469, 424, -1, -1, 4), // help + ui_button_info("CBB_05", 447, 452, -1, -1, 5), // options + ui_button_info("CBB_06", 552, 411, -1, -1, 6), // continue + ui_button_info("CBB_07", 195, 442, -1, -1, 7), // vcr - pause +#else ui_button_info("CBB_00", 504, 221, -1, -1, 0), ui_button_info("CBB_01", 527, 221, -1, -1, 1), ui_button_info("CBB_02", 555, 221, -1, -1, 2), @@ -301,6 +337,7 @@ ui_button_info Cmd_brief_buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { ui_button_info("CBB_05", 539, 431, -1, -1, 5), ui_button_info("CBB_06", 538, 455, -1, -1, 6), ui_button_info("CBB_07", 575, 432, -1, -1, 7), +#endif }, { // GR_1024 ui_button_info("2_CBB_00", 806, 354, -1, -1, 0), @@ -315,17 +352,27 @@ ui_button_info Cmd_brief_buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { }; // text -#define CMD_BRIEF_NUM_TEXT 3 +#ifdef MAKE_FS1 + #define CMD_BRIEF_NUM_TEXT 0 +#else + #define CMD_BRIEF_NUM_TEXT 3 +#endif UI_XSTR Cmd_brief_text[GR_NUM_RESOLUTIONS][CMD_BRIEF_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Help", 928, 500, 440, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[0][HELP_BUTTON].button }, { "Options", 1036, 479, 464, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[0][OPTIONS_BUTTON].button }, { "Continue", 1069, 564, 413, UI_XSTR_COLOR_PINK, -1, &Cmd_brief_buttons[0][ACCEPT_BUTTON].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Help", 928, 800, 704, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[1][HELP_BUTTON].button }, { "Options", 1036, 797, 743, UI_XSTR_COLOR_GREEN, -1, &Cmd_brief_buttons[1][OPTIONS_BUTTON].button }, { "Continue", 1069, 917, 661, UI_XSTR_COLOR_PINK, -1, &Cmd_brief_buttons[1][ACCEPT_BUTTON].button }, +#endif } }; @@ -650,6 +697,10 @@ void cmd_brief_init(int team) gr_set_palette(Palette_name, Palette, 1); */ +#ifdef MAKE_FS1 + common_set_interface_palette("BarracksPalette"); +#endif + Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0); Ui_window.set_mask_bmap(Cmd_brief_mask[gr_screen.res]); @@ -725,6 +776,9 @@ void cmd_brief_close() bm_unload(Palette_bmp); } */ +#ifdef MAKE_FS1 + common_free_interface_palette(); +#endif game_flush(); Cmd_brief_inited = 0; diff --git a/src/missionui/missiondebrief.cpp b/src/missionui/missiondebrief.cpp index 379b137..c508aa4 100644 --- a/src/missionui/missiondebrief.cpp +++ b/src/missionui/missiondebrief.cpp @@ -15,6 +15,9 @@ * C module for running the debriefing * * $Log$ + * Revision 1.7 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.6 2002/07/13 06:46:48 theoddone33 * Warning cleanups * @@ -380,7 +383,11 @@ // 3rd coord is max width in pixels int Debrief_title_coords[GR_NUM_RESOLUTIONS][3] = { { // GR_640 +#ifdef MAKE_FS1 + 38, 120, 161 +#else 18, 118, 174 +#endif }, { // GR_1024 28, 193, 280 @@ -389,7 +396,11 @@ int Debrief_title_coords[GR_NUM_RESOLUTIONS][3] = { int Debrief_text_wnd_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 38, 156, 342, 260 +#else 43, 140, 339, 303 +#endif }, { // GR_1024 69, 224, 535, 485 @@ -403,7 +414,11 @@ int Debrief_text_x2[GR_NUM_RESOLUTIONS] = { int Debrief_stage_info_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 379, 156 +#else 379, 137 +#endif }, { // GR_1024 578, 224 @@ -412,7 +427,11 @@ int Debrief_stage_info_coords[GR_NUM_RESOLUTIONS][2] = { int Debrief_more_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 323, 418 +#else 323, 453 +#endif }, { // GR_1024 323, 453 @@ -437,23 +456,41 @@ int Debrief_list_coords[GR_NUM_RESOLUTIONS][4] = { int Debrief_award_wnd_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 391, 134 +#else 411, 126 +#endif }, { // GR_1024 658, 203 } }; - int Debrief_award_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 448, 145 +#else 416, 140 +#endif }, { // GR_1024 666, 224 } }; +#ifdef MAKE_FS1 +int Debrief_rank_coords[2] = { + 448, 168 +}; + +int Debrief_badge_coords[2] = { + 405, 166 +}; +#endif + +#ifndef MAKE_FS1 // 0=x, 1=y, 2=width of the field int Debrief_medal_text_coords[GR_NUM_RESOLUTIONS][3] = { { // GR_640 @@ -473,6 +510,35 @@ int Debrief_award_text_coords[GR_NUM_RESOLUTIONS][3] = { 666, 333, 67 } }; +#else +// the medal text in FS1 is a bitmap +int Debrief_medal_text_coords[GR_NUM_RESOLUTIONS][2] = { + { + 402, 211 + }, + { + 402, 211 + } +}; + +int Debrief_rank_text_coords[GR_NUM_RESOLUTIONS][2] = { + { + 409, 231 + }, + { + 409, 231 + } +}; + +int Debrief_badge_text_coords[GR_NUM_RESOLUTIONS][2] = { + { + 401, 243 + }, + { + 401, 243 + } +}; +#endif // 0 = with medal // 1 = without medal (text will use medal space) @@ -545,6 +611,26 @@ typedef struct { static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("DB_00", 0, 2, -1, -1, 0), // debriefing + ui_button_info("DB_01", 0, 20, -1, -1, 1), // statistics + ui_button_info("DB_02", 0, 195, -1, -1, 2), // scroll stats up + ui_button_info("DB_03", 0, 232, -1, -1, 3), // scroll stats down + ui_button_info("DB_04", 24, 424, -1, -1, 4), // replay mission + ui_button_info("DB_05", 30, 451, -1, -1, 5), // recommendations + ui_button_info("DB_06", 211, 445, -1, -1, 6), // first page + ui_button_info("DB_07", 234, 445, -1, -1, 7), // prev page + ui_button_info("DB_08", 259, 445, -1, -1, 8), // next page + ui_button_info("DB_09", 283, 445, -1, -1, 9), // last page + ui_button_info("DB_21", 441, 384, -1, -1, 21), // pilot info + ui_button_info("DB_25", 511, 384, -1, -1, 25), // kick + ui_button_info("DB_15", 604, 224, -1, -1, 15), // medals + ui_button_info("DB_16", 615, 329, -1, -1, 16), // scroll pilots up + ui_button_info("DB_17", 615, 371, -1, -1, 17), // scroll pilots down + ui_button_info("DB_10", 469, 428, -1, -1, 10), // help + ui_button_info("DB_11", 447, 452, -1, -1, 11), // options + ui_button_info("DB_12", 562, 410, -1, -1, 12), // accept +#else ui_button_info("DB_00", 6, 1, 37, 7, 0), // debriefing ui_button_info("DB_01", 6, 21, 37, 23, 1), // statistics ui_button_info("DB_02", 1, 195, -1, -1, 2), // scroll stats up @@ -563,6 +649,7 @@ static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { ui_button_info("DB_15", 538, 431, 500, 440, 15), // help ui_button_info("DB_16", 538, 455, 479, 464, 16), // options ui_button_info("DB_17", 573, 432, 572, 413, 17), // accept +#endif }, { // GR_1024 ui_button_info("2_DB_00", 10, 1, 59, 12, 0), // debriefing @@ -587,12 +674,18 @@ static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { }; // text -#define NUM_DEBRIEF_TEXT 10 +#ifdef MAKE_FS1 + #define NUM_DEBRIEF_TEXT 0 +#else + #define NUM_DEBRIEF_TEXT 10 +#endif #define MP_TEXT_INDEX_1 4 #define MP_TEXT_INDEX_2 5 #define MP_TEXT_INDEX_3 6 UI_XSTR Debrief_strings[GR_NUM_RESOLUTIONS][NUM_DEBRIEF_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Debriefing", 804, 37, 7, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][DEBRIEF_TAB].button }, { "Statistics", 1333, 37, 26, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][STATS_TAB].button }, { "Replay Mission", 444, 49, 447, UI_XSTR_COLOR_PINK, -1, &Buttons[0][REPLAY_MISSION].button }, @@ -603,8 +696,11 @@ UI_XSTR Debrief_strings[GR_NUM_RESOLUTIONS][NUM_DEBRIEF_TEXT] = { { "Help", 928, 500, 440, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][HELP_BUTTON].button }, { "Options", 1036, 479, 464, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][OPTIONS_BUTTON].button }, { "Accept", 1035, 572, 413, UI_XSTR_COLOR_PINK, -1, &Buttons[0][ACCEPT_BUTTON].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Debriefing", 804, 59, 12, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][DEBRIEF_TAB].button }, { "Statistics", 1333, 59, 47, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][STATS_TAB].button }, { "Replay Mission", 444, 79, 715, UI_XSTR_COLOR_PINK, -1, &Buttons[1][REPLAY_MISSION].button }, @@ -615,6 +711,7 @@ UI_XSTR Debrief_strings[GR_NUM_RESOLUTIONS][NUM_DEBRIEF_TEXT] = { { "Help", 928, 801, 705, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][HELP_BUTTON].button }, { "Options", 1036, 780, 744, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][OPTIONS_BUTTON].button }, { "Accept", 1035, 917, 672, UI_XSTR_COLOR_PINK, -1, &Buttons[1][ACCEPT_BUTTON].button }, +#endif } }; @@ -632,9 +729,11 @@ static int Medal_bitmap; static int Badge_bitmap; static int Wings_bitmap; static int Crest_bitmap; -//static int Rank_text_bitmap; -//static int Medal_text_bitmap; -//static int Badge_text_bitmap; +#ifdef MAKE_FS1 +static int Rank_text_bitmap; +static int Medal_text_bitmap; +static int Badge_text_bitmap; +#endif static int Promoted; static int Debrief_accepted; static int Turned_traitor; @@ -756,6 +855,27 @@ voice_map Debrief_promotion_voice_mapping[NUM_VOLITION_CAMPAIGNS][MAX_CAMPAIGN_M #define DB_AWARD_WINGS 0 #define DB_AWARD_MEDAL 1 +#ifdef MAKE_FS1 +#define DB_AWARD_RANK 2 +#define DB_AWARD_BADGE 3 +#define DB_AWARD_BG 4 +static char* Debrief_award_filename[GR_NUM_RESOLUTIONS][5] = { + { + "DebriefWings", + "DebriefMedal", + "DebriefRank", + "DebriefBadge", + "DebriefAward" + }, + { + "2_DebriefWings", + "2_DebriefMedal", + "2_DebriefRank", + "2_DebriefBadge", + "2_DebriefAward" + } +}; +#else #define DB_AWARD_SOC 2 #define DB_AWARD_RANK 3 #define DB_AWARD_BADGE 4 @@ -778,6 +898,7 @@ static char* Debrief_award_filename[GR_NUM_RESOLUTIONS][6] = { "2_DebriefAward" } }; +#endif #define AWARD_TEXT_MAX_LINES 5 #define AWARD_TEXT_MAX_LINE_LENGTH 128 @@ -1203,14 +1324,30 @@ void debrief_choose_promotion_voice() // this is an ugly, nasty, hateful way of doing this, but it saves us changing the missions at this point void debrief_choose_badge_voice() { +#ifndef MAKE_FS1 int i, j; +#endif if(Campaign.current_mission < 0){ +#ifndef MAKE_FS1 // default to petrarch sprintf(Badge_stage.voice, NOX("9_%s"), Badge_info[Player->stats.m_badge_earned].voice_base); +#else + // default to FS1 guy + sprintf(Badge_stage.voice, NOX("%s"), Badge_info[Player->stats.m_badge_earned].voice_base); +#endif } if ((Campaign.missions[Campaign.current_mission].name) && (Campaign.filename)) { +#ifdef MAKE_FS1 + if ( Player->on_bastion ) { + sprintf(Badge_stage.voice, NOX("%s"), Badge_info[Player->stats.m_badge_earned].voice_base2); + return; + } else { + sprintf(Badge_stage.voice, NOX("%s"), Badge_info[Player->stats.m_badge_earned].voice_base); + return; + } +#else // search thru all official campaigns for our current campaign for (i=0; istats.m_badge_earned].voice_base); +#else + // default to FS1 guy + sprintf(Badge_stage.voice, NOX("%s"), Badge_info[Player->stats.m_badge_earned].voice_base); +#endif } @@ -1244,7 +1387,9 @@ void debrief_award_init() Promoted = -1; // be sure there are no old award texts floating around +#ifndef MAKE_FS1 debrief_award_text_clear(); +#endif // handle medal earned if (Player->stats.m_medal_earned != -1) { @@ -1257,15 +1402,18 @@ void debrief_award_init() } sprintf(buf, NOX("%s%.2d"), Debrief_award_filename[gr_screen.res][DB_AWARD_WINGS], ver); Wings_bitmap = bm_load(buf); - +#ifndef MAKE_FS1 } else if (Player->stats.m_medal_earned == 17) { // special hack for the soc crest Crest_bitmap = bm_load(Debrief_award_filename[gr_screen.res][DB_AWARD_SOC]); +#endif } else { sprintf(buf, NOX("%s%.2d"), Debrief_award_filename[gr_screen.res][DB_AWARD_MEDAL], Player->stats.m_medal_earned); Medal_bitmap = bm_load(buf); } +#ifndef MAKE_FS1 debrief_add_award_text(Medals[Player->stats.m_medal_earned].name); +#endif } // handle promotions @@ -1280,7 +1428,9 @@ void debrief_award_init() // choose appropriate promotion voice for this mission debrief_choose_promotion_voice(); +#ifndef MAKE_FS1 debrief_add_award_text(Ranks[Promoted].name); +#endif } // handle badge earned @@ -1296,7 +1446,9 @@ void debrief_award_init() // choose appropriate voice debrief_choose_badge_voice(); +#ifndef MAKE_FS1 debrief_add_award_text(Medals[Badge_index[i]].name); +#endif } if ((Rank_bitmap >= 0) || (Medal_bitmap >= 0) || (Badge_bitmap >= 0) || (Wings_bitmap >= 0) || (Crest_bitmap >= 0)) { @@ -1351,12 +1503,14 @@ void debrief_traitor_init() char traitor_voice_file[NAME_LENGTH]; stuff_string(traitor_voice_file, F_FILESPEC, NULL); -// DKA 9/13/99 Only 1 traitor msg for FS2 -// if ( Player->on_bastion ) { -// strcpy(stagep->voice, NOX("3_")); -// } else { -// strcpy(stagep->voice, NOX("1_")); -// } +// DKA 9/13/99 Only 1 traitor msg for FS2 +#ifdef MAKE_FS1 + if ( Player->on_bastion ) { + strcpy(stagep->voice, NOX("3_")); + } else { + strcpy(stagep->voice, NOX("1_")); + } +#endif strcat(stagep->voice, traitor_voice_file); @@ -1658,7 +1812,7 @@ void debrief_accept(int ok_to_post_start_game_event) // check if campaign is over if ( Campaign.next_mission == -1 ) { - #if defined(FS2_DEMO) || defined(OEM_BUILD) + #if defined(FS2_DEMO) || defined(OEM_BUILD) || defined(FS1_DEMO) gameseq_post_event(GS_EVENT_END_DEMO); #else gameseq_post_event(GS_EVENT_MAIN_MENU); @@ -2219,6 +2373,12 @@ void debrief_init() Debrief_multi_voice_loaded = 0; +#ifdef MAKE_FS1 + Medal_text_bitmap = bm_load(NOX("DebriefText01")); + Rank_text_bitmap = bm_load(NOX("DebriefText02")); + Badge_text_bitmap = bm_load(NOX("DebriefText03")); +#endif + if ( (Game_mode & GM_CAMPAIGN_MODE) && ( !MULTIPLAYER_CLIENT ) ) { // MUST store goals and events first - may be used to evaluate next mission // store goals and events @@ -2370,7 +2530,9 @@ void debrief_close() } // unload the overlay bitmap -// help_overlay_unload(DEBRIEFING_OVERLAY); +#ifdef MAKE_FS1 + help_overlay_unload(DEBRIEFING_OVERLAY); +#endif // clear out award text Debrief_award_text_num_lines = 0; @@ -2410,6 +2572,20 @@ void debrief_close() bm_unload(Crest_bitmap); } +#ifdef MAKE_FS1 + if (Medal_text_bitmap >= 0) { + bm_unload(Medal_text_bitmap); + } + + if (Badge_text_bitmap >= 0) { + bm_unload(Badge_text_bitmap); + } + + if (Rank_text_bitmap >= 0) { + bm_unload(Rank_text_bitmap); + } +#endif + Debrief_ui_window.destroy(); common_free_interface_palette(); // restore game palette show_stats_close(); @@ -2473,6 +2649,7 @@ void debrief_do_keys(int new_k) } // end switch } +#ifndef MAKE_FS1 // uuuuuugly void debrief_draw_award_text() { @@ -2542,6 +2719,7 @@ void debrief_add_award_text(char *str) Debrief_award_text_num_lines++; // leave blank line even if it all fits into 1 } } +#endif // !MAKE_FS1: No text for FS1, it's all bitmaps // called once per frame to drive all the input reading and rendering void debrief_do_frame(float frametime) @@ -2673,7 +2851,11 @@ void debrief_do_frame(float frametime) gr_bitmap(Debrief_award_wnd_coords[gr_screen.res][0], Debrief_award_wnd_coords[gr_screen.res][1]); if (Rank_bitmap >= 0) { gr_set_bitmap(Rank_bitmap); +#ifdef MAKE_FS1 + gr_bitmap(Debrief_rank_coords[0], Debrief_rank_coords[1]); +#else gr_bitmap(Debrief_award_coords[gr_screen.res][0], Debrief_award_coords[gr_screen.res][1]); +#endif } if (Medal_bitmap >= 0) { @@ -2683,38 +2865,47 @@ void debrief_do_frame(float frametime) if (Badge_bitmap >= 0) { gr_set_bitmap(Badge_bitmap); +#ifdef MAKE_FS1 + gr_bitmap(Debrief_badge_coords[0], Debrief_badge_coords[1]); +#else gr_bitmap(Debrief_award_coords[gr_screen.res][0], Debrief_award_coords[gr_screen.res][1]); +#endif } if (Wings_bitmap >= 0) { gr_set_bitmap(Wings_bitmap); +#ifdef MAKE_FS1 + gr_bitmap(Debrief_badge_coords[0], Debrief_badge_coords[1]); +#else gr_bitmap(Debrief_award_coords[gr_screen.res][0], Debrief_award_coords[gr_screen.res][1]); +#endif } + // this isn't used in FS1 but doesn't hurt to leave it if (Crest_bitmap >= 0) { gr_set_bitmap(Crest_bitmap); gr_bitmap(Debrief_award_coords[gr_screen.res][0], Debrief_award_coords[gr_screen.res][1]); } // draw medal/badge/rank labels +#ifndef MAKE_FS1 debrief_draw_award_text(); - -/* if (Rank_text_bitmap >= 0) { +#else + if (Rank_text_bitmap >= 0) { gr_set_bitmap(Rank_text_bitmap); - gr_bitmap(Debrief_award_coords[gr_screen.res][0], Debrief_award_coords[gr_screen.res][1]); + gr_bitmap(Debrief_rank_text_coords[gr_screen.res][0], Debrief_rank_text_coords[gr_screen.res][1]); } - if (Medal_text_bitmap >= 0) { gr_set_bitmap(Medal_text_bitmap); - gr_bitmap(Debrief_award_text_coords[gr_screen.res][0], Debrief_award_text_coords[gr_screen.res][1]); + gr_bitmap(Debrief_medal_text_coords[gr_screen.res][0], Debrief_medal_text_coords[gr_screen.res][1]); } if (Badge_text_bitmap >= 0) { gr_set_bitmap(Badge_text_bitmap); - gr_bitmap(Debrief_award_text_coords[gr_screen.res][0], Debrief_award_text_coords[gr_screen.res][1]); + gr_bitmap(Debrief_badge_text_coords[gr_screen.res][0], Debrief_badge_text_coords[gr_screen.res][1]); } -*/ +#endif } Debrief_ui_window.draw(); diff --git a/src/missionui/missionpause.cpp b/src/missionui/missionpause.cpp index f370620..415c6ea 100644 --- a/src/missionui/missionpause.cpp +++ b/src/missionui/missionpause.cpp @@ -14,6 +14,9 @@ * * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:23 relnev * added copyright header * @@ -59,14 +62,22 @@ // pause bitmap name char *Pause_bmp_name[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + "Pause", +#else "PleaseWait", +#endif "2_PleaseWait" }; // pause bitmap display stuff int Please_wait_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 96, 205, 447, 70 +#else 152, 217, 316, 26 +#endif }, { // GR_1024 247, 346, 510, 36 @@ -157,7 +168,11 @@ void pause_init(int multi) void pause_do(int multi) { int k; +#ifdef MAKE_FS1 + char *pause_str = XSTR(" ", -1); +#else char *pause_str = XSTR("Paused", 767); +#endif int str_w, str_h; if(Game_mode & GM_STANDALONE_SERVER){ diff --git a/src/missionui/missionscreencommon.cpp b/src/missionui/missionscreencommon.cpp index d95db61..929aa35 100644 --- a/src/missionui/missionscreencommon.cpp +++ b/src/missionui/missionscreencommon.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/09 04:41:23 relnev * added copyright header * @@ -346,14 +349,24 @@ static int InterfacePaletteBitmap = -1; // PCX file that holds the interface pal UI_WINDOW *Active_ui_window; brief_common_buttons Common_buttons[3][GR_NUM_RESOLUTIONS][NUM_COMMON_BUTTONS] = { +// icons for briefing, ship selection, weapon selection screens { // UGH { // GR_640 +#ifdef MAKE_FS1 + brief_common_buttons("CB_00", 0, 0, -1, -1, 0), // briefing + brief_common_buttons("CB_01", 0, 19, -1, -1, 1), // ship selection + brief_common_buttons("CB_02", 0, 33, -1, -1, 2), // weapons loadout + brief_common_buttons("CB_05", 562, 411, -1, -1, 5), // commit + brief_common_buttons("CB_06", 469, 424, -1, -1, 6), // help + brief_common_buttons("CB_07", 447, 452, -1, -1, 7), // options +#else brief_common_buttons("CB_00", 7, 3, 37, 7, 0), brief_common_buttons("CB_01", 7, 19, 37, 23, 1), brief_common_buttons("CB_02", 7, 35, 37, 39, 2), brief_common_buttons("CB_05", 571, 425, 572, 413, 5), brief_common_buttons("CB_06", 533, 425, 500, 440, 6), brief_common_buttons("CB_07", 533, 455, 479, 464, 7), +#endif }, { // GR_1024 brief_common_buttons("2_CB_00", 12, 5, 59, 12, 0), @@ -366,12 +379,21 @@ brief_common_buttons Common_buttons[3][GR_NUM_RESOLUTIONS][NUM_COMMON_BUTTONS] = }, { // UGH { // GR_640 +#ifdef MAKE_FS1 + brief_common_buttons("CB_00", 0, 0, -1, -1, 0), // briefing + brief_common_buttons("CB_01", 0, 19, -1, -1, 1), // ship selection + brief_common_buttons("CB_02", 0, 33, -1, -1, 2), // weapons loadout + brief_common_buttons("CB_05", 562, 411, -1, -1, 5), // commit + brief_common_buttons("CB_06", 469, 424, -1, -1, 6), // help + brief_common_buttons("CB_07", 447, 452, -1, -1, 7), // options +#else brief_common_buttons("CB_00", 7, 3, 37, 7, 0), brief_common_buttons("CB_01", 7, 19, 37, 23, 1), brief_common_buttons("CB_02", 7, 35, 37, 39, 2), brief_common_buttons("CB_05", 571, 425, 572, 413, 5), brief_common_buttons("CB_06", 533, 425, 500, 440, 6), brief_common_buttons("CB_07", 533, 455, 479, 464, 7), +#endif }, { // GR_1024 brief_common_buttons("2_CB_00", 12, 5, 59, 12, 0), @@ -384,12 +406,21 @@ brief_common_buttons Common_buttons[3][GR_NUM_RESOLUTIONS][NUM_COMMON_BUTTONS] = }, { // UGH { // GR_640 +#ifdef MAKE_FS1 + brief_common_buttons("CB_00", 0, 0, -1, -1, 0), // briefing + brief_common_buttons("CB_01", 0, 19, -1, -1, 1), // ship selection + brief_common_buttons("CB_02", 0, 33, -1, -1, 2), // weapons loadout + brief_common_buttons("CB_05", 562, 411, -1, -1, 5), // commit + brief_common_buttons("CB_06", 469, 424, -1, -1, 6), // help + brief_common_buttons("CB_07", 447, 452, -1, -1, 7), // options +#else brief_common_buttons("CB_00", 7, 3, 37, 7, 0), brief_common_buttons("CB_01", 7, 19, 37, 23, 1), brief_common_buttons("CB_02", 7, 35, 37, 39, 2), brief_common_buttons("CB_05", 571, 425, 572, 413, 5), brief_common_buttons("CB_06", 533, 425, 500, 440, 6), brief_common_buttons("CB_07", 533, 455, 479, 464, 7), +#endif }, { // GR_1024 brief_common_buttons("2_CB_00", 12, 5, 59, 12, 0), @@ -399,7 +430,7 @@ brief_common_buttons Common_buttons[3][GR_NUM_RESOLUTIONS][NUM_COMMON_BUTTONS] = brief_common_buttons("2_CB_06", 854, 681, 822, 704, 6), brief_common_buttons("2_CB_07", 854, 724, 800, 743, 7), } - } + } }; #define COMMON_BRIEFING_BUTTON 0 @@ -498,6 +529,7 @@ void common_buttons_init(UI_WINDOW *ui_window) b->link_hotspot(Common_buttons[Current_screen-1][gr_screen.res][i].hotspot); } +#ifndef MAKE_FS1 // add some text ui_window->add_XSTR("Briefing", 1504, Common_buttons[Current_screen-1][gr_screen.res][COMMON_BRIEFING_BUTTON].xt, Common_buttons[Current_screen-1][gr_screen.res][COMMON_BRIEFING_BUTTON].yt, &Common_buttons[Current_screen-1][gr_screen.res][COMMON_BRIEFING_BUTTON].button, UI_XSTR_COLOR_GREEN); ui_window->add_XSTR("Ship Selection", 1067, Common_buttons[Current_screen-1][gr_screen.res][COMMON_SS_BUTTON].xt, Common_buttons[Current_screen-1][gr_screen.res][COMMON_SS_BUTTON].yt, &Common_buttons[Current_screen-1][gr_screen.res][COMMON_SS_BUTTON].button, UI_XSTR_COLOR_GREEN); @@ -505,6 +537,7 @@ void common_buttons_init(UI_WINDOW *ui_window) ui_window->add_XSTR("Commit", 1062, Common_buttons[Current_screen-1][gr_screen.res][COMMON_COMMIT_BUTTON].xt, Common_buttons[Current_screen-1][gr_screen.res][COMMON_COMMIT_BUTTON].yt, &Common_buttons[Current_screen-1][gr_screen.res][COMMON_COMMIT_BUTTON].button, UI_XSTR_COLOR_PINK); ui_window->add_XSTR("Help", 928, Common_buttons[Current_screen-1][gr_screen.res][COMMON_HELP_BUTTON].xt, Common_buttons[Current_screen-1][gr_screen.res][COMMON_HELP_BUTTON].yt, &Common_buttons[Current_screen-1][gr_screen.res][COMMON_HELP_BUTTON].button, UI_XSTR_COLOR_GREEN); ui_window->add_XSTR("Options", 1036, Common_buttons[Current_screen-1][gr_screen.res][COMMON_OPTIONS_BUTTON].xt, Common_buttons[Current_screen-1][gr_screen.res][COMMON_OPTIONS_BUTTON].yt, &Common_buttons[Current_screen-1][gr_screen.res][COMMON_OPTIONS_BUTTON].button, UI_XSTR_COLOR_GREEN); +#endif common_reset_buttons(); @@ -601,12 +634,12 @@ void common_set_interface_palette(char *filename) } // ugh - we don't need this anymore - /* +#ifdef MAKE_FS1 InterfacePaletteBitmap = bm_load(filename); if (InterfacePaletteBitmap < 0) { Error(LOCATION, "Could not load in \"%s\"!", filename); } - */ +#endif #ifndef HARDWARE_ONLY palette_use_bm_palette(InterfacePaletteBitmap); @@ -668,7 +701,7 @@ void common_select_init() #ifndef DEMO // not for FS2_DEMO - /* +#ifdef MAKE_FS1 if ( current_detail_level() >= (NUM_DEFAULT_DETAIL_LEVELS-2) ) { anim_play_struct aps; @@ -687,7 +720,8 @@ void common_select_init() Background_anim_instance = anim_play(&aps); Background_playing = 1; // start playing the Background anim } - */ +#endif + Current_screen = Next_screen = ON_BRIEFING_SELECT; // load in the icons for the wing slots @@ -815,7 +849,7 @@ int common_select_do(float frametime) common_music_do(); - /* +#ifdef MAKE_FS1 if ( Background_playing ) { if ( Background_anim_instance->frame_num == BUTTON_SLIDE_IN_FRAME ) { @@ -831,7 +865,7 @@ int common_select_do(float frametime) Current_screen = Next_screen = ON_BRIEFING_SELECT; } } - */ +#endif if ( Current_screen != Next_screen ) { switch( Next_screen ) { @@ -1135,12 +1169,12 @@ void common_select_close() anim_release_all_instances(); // free the anim's that were loaded into memory - /* +#ifdef MAKE_FS1 if ( Background_anim ) { anim_free(Background_anim); Background_anim = NULL; } - */ +#endif common_music_close(); Common_select_inited = 0; diff --git a/src/missionui/missionshipchoice.cpp b/src/missionui/missionshipchoice.cpp index efa69ed..60b55bd 100644 --- a/src/missionui/missionshipchoice.cpp +++ b/src/missionui/missionshipchoice.cpp @@ -15,6 +15,9 @@ * C module to allow player ship selection for the mission * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -476,13 +479,18 @@ UI_WINDOW Ship_select_ui_window; static int Ship_anim_coords[GR_NUM_RESOLUTIONS][2] = { { +#ifdef MAKE_FS1 + 10, 77 +#else 257, 84 // GR_640 +#endif }, { 412, 135 // GR_1024 } }; +#ifndef MAKE_FS1 static int Ship_info_coords[GR_NUM_RESOLUTIONS][2] = { { 28, 78 // GR_640 @@ -491,6 +499,7 @@ static int Ship_info_coords[GR_NUM_RESOLUTIONS][2] = { 45, 125 // GR_1024 } }; +#endif // coordinate lookup indicies #define SHIP_SELECT_X_COORD 0 @@ -500,8 +509,10 @@ static int Ship_info_coords[GR_NUM_RESOLUTIONS][2] = { // NK: changed from 37 to 51 for new FS2 animations -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define SHIP_ANIM_LOOP_FRAME 0 +#elif MAKE_FS1 +#define SHIP_ANIM_LOOP_FRAME 36 #else #define SHIP_ANIM_LOOP_FRAME 51 #endif @@ -581,8 +592,13 @@ static int SS_active_list_size; // Background bitmaps data for ship_select ////////////////////////////////////////////////////// static char* Ship_select_background_fname[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + "Brief", + "Brief" +#else "ShipSelect", "2_ShipSelect" +#endif }; static char* Ship_select_background_mask_fname[GR_NUM_RESOLUTIONS] = { @@ -614,10 +630,17 @@ struct ss_buttons { static ss_buttons Ship_select_buttons[GR_NUM_RESOLUTIONS][NUM_SS_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ss_buttons("ssb_08", 0, 301, -1, -1, 8, 0), // SCROLL UP + ss_buttons("ssb_09", 0, 453, -1, -1, 9, 0), // SCROLL DOWN + ss_buttons("ssb_39", 566, 317, -1, -1, 39, 0), // RESET + ss_buttons("ssb_39", 0, 0, -1, -1, 99, 0) // dummy for drag n' drop +#else ss_buttons("ssb_08", 5, 303, -1, -1, 8, 0), // SCROLL UP ss_buttons("ssb_09", 5, 454, -1, -1, 9, 0), // SCROLL DOWN ss_buttons("ssb_39", 571, 347, -1, -1, 39,0), // RESET ss_buttons("ssb_39", 0, 0, -1, -1, 99,0) // dummy for drag n' drop +#endif }, { // GR_1024 ss_buttons("2_ssb_08", 8, 485, -1, -1, 8, 0), // SCROLL UP @@ -628,13 +651,23 @@ static ss_buttons Ship_select_buttons[GR_NUM_RESOLUTIONS][NUM_SS_BUTTONS] = { }; // ship select text -#define SHIP_SELECT_NUM_TEXT 1 +#ifdef MAKE_FS1 + #define SHIP_SELECT_NUM_TEXT 0 +#else + #define SHIP_SELECT_NUM_TEXT 1 +#endif UI_XSTR Ship_select_text[GR_NUM_RESOLUTIONS][SHIP_SELECT_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Reset", 1337, 580, 337, UI_XSTR_COLOR_GREEN, -1, &Ship_select_buttons[0][SS_BUTTON_RESET].button } +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Reset", 1337, 938, 546, UI_XSTR_COLOR_GREEN, -1, &Ship_select_buttons[1][SS_BUTTON_RESET].button } +#endif } }; @@ -1300,6 +1333,7 @@ void ship_select_render(float frametime) // blit any active ship information text void ship_select_blit_ship_info() { +#ifndef MAKE_FS1 int y_start; ship_info *sip; char str[100]; @@ -1425,6 +1459,7 @@ void ship_select_blit_ship_info() y_start += 10; } */ +#endif } @@ -1720,6 +1755,10 @@ void ship_select_close() Ship_select_ui_window.destroy(); +#ifdef MAKE_FS1 + common_free_interface_palette(); +#endif + Ship_anim_class = -1; Ship_select_open = 0; // This game-wide global flag is set to 0 to indicate that the ship // select screen has been closed and memory freed. This flag diff --git a/src/missionui/missionweaponchoice.cpp b/src/missionui/missionweaponchoice.cpp index 821c1a5..8a6533e 100644 --- a/src/missionui/missionweaponchoice.cpp +++ b/src/missionui/missionweaponchoice.cpp @@ -15,6 +15,9 @@ * C module for the weapon loadout screen * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/16 01:43:23 relnev * fixed demo dogfight multiplayer mission * @@ -516,8 +519,10 @@ typedef struct wl_bitmap_group int num_frames; } wl_bitmap_group; -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define WEAPON_ANIM_LOOP_FRAME 1 +#elif MAKE_FS1 +#define WEAPON_ANIM_LOOP_FRAME 32 #else #define WEAPON_ANIM_LOOP_FRAME 52 // frame (from 0) to loop weapon anim #endif @@ -556,13 +561,23 @@ static char *Wl_loadout_select_mask[GR_NUM_RESOLUTIONS] = { static char *Weapon_select_background_fname[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + "Brief", + "Brief" +#else "WeaponLoadout", "2_WeaponLoadout" +#endif }; static char *Weapon_select_multi_background_fname[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + "Brief", + "Brief" +#else "WeaponLoadoutMulti", "2_WeaponLoadoutMulti" +#endif }; int Weapon_select_background_bitmap; // bitmap for weapon select brackground @@ -589,6 +604,15 @@ struct wl_buttons { static wl_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_WEAPON_BUTTONS] = { { +#ifdef MAKE_FS1 + wl_buttons("WLB_26", 0, 123, -1, -1, 26), + wl_buttons("WLB_27", 0, 272, -1, -1, 27), + wl_buttons("WLB_26", 0, 302, -1, -1, 8), + wl_buttons("WLB_27", 0, 452, -1, -1, 9), + wl_buttons("ssb_39", 566, 317, -1, -1, 39), + wl_buttons("ssb_39", 0, 0, -1, -1, 99), + wl_buttons("TSB_34", 601, 344, -1, -1, 50) +#else wl_buttons("WLB_26", 24, 125, -1, -1, 26), wl_buttons("WLB_27", 24, 276, -1, -1, 27), wl_buttons("WLB_08", 24, 303, -1, -1, 8), @@ -596,6 +620,7 @@ static wl_buttons Buttons[GR_NUM_RESOLUTIONS][NUM_WEAPON_BUTTONS] = { wl_buttons("ssb_39", 571, 347, -1, -1, 39), wl_buttons("ssb_39", 0, 0, -1, -1, 99), wl_buttons("TSB_34", 603, 374, -1, -1, 34) +#endif }, { wl_buttons("2_WLB_26", 39, 200, -1, -1, 26), @@ -643,6 +668,15 @@ static int Wl_weapon_icon_coords[GR_NUM_RESOLUTIONS][MAX_WEAPON_ICONS_ON_SCREEN] static int Wl_bank_coords[GR_NUM_RESOLUTIONS][MAX_WL_WEAPONS][2] = { { +#ifdef MAKE_FS1 + {106,127}, + {106,154}, + {106,181}, + {324,127}, + {324,154}, + {324,181}, + {324,208}, +#else {106,127}, {106,158}, {106,189}, @@ -650,6 +684,7 @@ static int Wl_bank_coords[GR_NUM_RESOLUTIONS][MAX_WL_WEAPONS][2] = { {322,158}, {322,189}, {322,220}, +#endif }, { {170,203}, @@ -674,7 +709,11 @@ static int Last_wl_ship_class; static int Wl_overhead_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 93, 117 +#else 91, 117 +#endif }, { // GR_1024 @@ -684,7 +723,11 @@ static int Wl_overhead_coords[GR_NUM_RESOLUTIONS][2] = { static int Wl_weapon_ani_coords[GR_NUM_RESOLUTIONS][2] = { { +#ifdef MAKE_FS1 + 384, 116 +#else 408, 82 // GR_640 +#endif }, { 648, 128 // GR_1024 @@ -693,7 +736,11 @@ static int Wl_weapon_ani_coords[GR_NUM_RESOLUTIONS][2] = { static int Wl_weapon_ani_coords_multi[GR_NUM_RESOLUTIONS][2] = { { +#ifdef MAKE_FS1 + 385, 118 +#else 408, 143 // GR_640 +#endif }, { 648, 226 // GR_1024 @@ -763,6 +810,7 @@ static int Wl_mouse_down_on_region = -1; // weapon desc stuff +#ifndef MAKE_FS1 #define WEAPON_DESC_WIPE_TIME 1.5f // time in seconds for wipe to occur (over WEAPON_DESC_MAX_LENGTH number of chars) #define WEAPON_DESC_MAX_LINES 7 // max lines in the description incl. title #define WEAPON_DESC_MAX_LENGTH 50 // max chars per line of description text @@ -808,17 +856,30 @@ static int Wl_new_weapon_desc_coords_multi[GR_NUM_RESOLUTIONS][2] = { 648, 493 // GR_1024 } }; +#endif // ship select text -#define WEAPON_SELECT_NUM_TEXT 2 +#ifdef MAKE_FS1 + #define WEAPON_SELECT_NUM_TEXT 0 +#else + #define WEAPON_SELECT_NUM_TEXT 2 +#endif UI_XSTR Weapon_select_text[GR_NUM_RESOLUTIONS][WEAPON_SELECT_NUM_TEXT] = { { // GR_640 +#ifdef MAKE_FS1 + // nothing needed +#else { "Reset", 1337, 580, 337, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][WL_BUTTON_RESET].button }, { "Lock", 1270, 602, 364, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][WL_BUTTON_MULTI_LOCK].button } +#endif }, { // GR_1024 +#ifdef MAKE_FS1 + // nothing needed +#else { "Reset", 1337, 938, 546, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][WL_BUTTON_RESET].button }, { "Lock", 1270, 964, 584, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][WL_BUTTON_MULTI_LOCK].button } +#endif } }; @@ -1211,7 +1272,7 @@ int weapon_allowed_for_game_type(int weapon_flags) int rval = 0; /* disable check for demo since it doesn't have "$Allowed Dogfight PBanks" */ -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) if ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)) { if (weapon_flags & (1 << 1)) rval = 1; @@ -1653,16 +1714,15 @@ void wl_maybe_reset_selected_weapon_class() // start an overhead animation, since selected slot has changed void wl_start_slot_animation(int n) { - #ifndef DEMO // not for FS2_DEMO +#ifndef DEMO // not for FS2_DEMO // don't use ani's // fallback code in wl_render_overhead_view() will // use the .pcx files // should prolly scrub out the 1e06 lines of dead code this leaves +#ifndef MAKE_FS1 return; - - /* - +#else int ship_class; wl_ship_class_info *wl_ship; anim_play_struct aps; @@ -1700,8 +1760,8 @@ void wl_start_slot_animation(int n) aps.framerate_independent = 1; aps.skip_frames = 0; wl_ship->anim_instance = anim_play(&aps); -*/ - #endif +#endif // !MAKE_FS1 +#endif // !DEMO } // Call when Selected_wl_slot needs to be changed @@ -2415,6 +2475,7 @@ void weapon_select_render(float frametime) // this wipes in void wl_render_weapon_desc(float frametime) { +#ifndef MAKE_FS1 int *weapon_desc_coords; int *weapon_title_coords; @@ -2510,6 +2571,7 @@ void wl_render_weapon_desc(float frametime) gr_string(weapon_desc_coords[0], weapon_desc_coords[1] + 20, Weapon_desc_lines[4]); gr_string(weapon_desc_coords[0], weapon_desc_coords[1] + 30, Weapon_desc_lines[5]); } +#endif } @@ -2517,6 +2579,7 @@ void wl_render_weapon_desc(float frametime) // re-inits wiping vars and causes the current text to wipe in again void wl_weapon_desc_start_wipe() { +#ifndef MAKE_FS1 int currchar_src = 0, currline_dest = 2, currchar_dest = 0, i; int w, h; int title_len = strlen(Weapon_info[Selected_wl_class].title); @@ -2573,6 +2636,7 @@ void wl_weapon_desc_start_wipe() for (i=currline_dest+1; i 3 ) { + wl_render_icon_count(num, x-9, y); + } else { + wl_render_icon_count(num, x, y); + } +#else wl_render_icon_count(num, x, y); +#endif } } diff --git a/src/missionui/redalert.cpp b/src/missionui/redalert.cpp index a6591b6..5d8b562 100644 --- a/src/missionui/redalert.cpp +++ b/src/missionui/redalert.cpp @@ -15,6 +15,9 @@ * Module for Red Alert mission interface and code * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/09 04:41:23 relnev * added copyright header * @@ -238,8 +241,13 @@ static int Ra_flash_coords[GR_NUM_RESOLUTIONS][2] = { static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("RAB_05", 0, 435, -1, -1, 5), // Replay + ui_button_info("RAB_04", 553, 411, -1, -1, 4), // Exit +#else ui_button_info("RAB_00", 2, 445, -1, -1, 0), ui_button_info("RAB_01", 575, 432, -1, -1, 1), +#endif }, { // GR_1024 ui_button_info("2_RAB_00", 4, 712, -1, -1, 0), @@ -247,17 +255,27 @@ static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = { } }; -#define RED_ALERT_NUM_TEXT 3 +#ifdef MAKE_FS1 + #define RED_ALERT_NUM_TEXT 0 +#else + #define RED_ALERT_NUM_TEXT 3 +#endif UI_XSTR Red_alert_text[GR_NUM_RESOLUTIONS][RED_ALERT_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Replay", 1405, 46, 451, UI_XSTR_COLOR_PINK, -1, &Buttons[0][RA_REPLAY_MISSION].button }, { "Previous Mission", 1452, 46, 462, UI_XSTR_COLOR_PINK, -1, &Buttons[0][RA_REPLAY_MISSION].button }, { "Continue", 1069, 564, 413, UI_XSTR_COLOR_PINK, -1, &Buttons[0][RA_CONTINUE].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Replay", 1405, 75, 722, UI_XSTR_COLOR_PINK, -1, &Buttons[1][RA_REPLAY_MISSION].button }, { "Previous Mission", 1452, 75, 733, UI_XSTR_COLOR_PINK, -1, &Buttons[1][RA_REPLAY_MISSION].button }, { "Continue", 1069, 902, 661, UI_XSTR_COLOR_PINK, -1, &Buttons[1][RA_CONTINUE].button }, +#endif } }; @@ -272,7 +290,11 @@ static int Text_delay; int Ra_brief_text_wnd_coords[GR_NUM_RESOLUTIONS][4] = { { +#ifdef MAKE_FS1 + 117, 169, 406, 283 +#else 14, 151, 522, 289 +#endif }, { 52, 241, 785, 463 @@ -280,7 +302,9 @@ int Ra_brief_text_wnd_coords[GR_NUM_RESOLUTIONS][4] = { }; static UI_WINDOW Ui_window; -// static hud_anim Flash_anim; +#ifdef MAKE_FS1 +static hud_anim Flash_anim; +#endif static int Background_bitmap; static int Red_alert_inited = 0; @@ -388,9 +412,11 @@ void red_alert_blit_title() } // draw +#ifndef MAKE_FS1 gr_set_color_fast(&flash_color); gr_string(Ra_brief_text_wnd_coords[gr_screen.res][0] + ((Ra_brief_text_wnd_coords[gr_screen.res][2] - w) / 2), Ra_flash_y[gr_screen.res] - h - 5, str); gr_set_color_fast(&Color_normal); +#endif // increment flash time Ra_flash_time += flFrametime; @@ -413,7 +439,9 @@ void red_alert_init() return; } - // common_set_interface_palette("ControlConfigPalette"); // set the interface palette +#ifdef MAKE_FS1 + common_set_interface_palette("ControlConfigPalette"); // set the interface palette +#endif Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0); Ui_window.set_mask_bmap(Red_alert_mask[gr_screen.res]); @@ -437,9 +465,11 @@ void red_alert_init() // load in background image and flashing red alert animation Background_bitmap = bm_load(Red_alert_fname[gr_screen.res]); - - // hud_anim_init(&Flash_anim, Ra_flash_coords[gr_screen.res][RA_X_COORD], Ra_flash_coords[gr_screen.res][RA_Y_COORD], NOX("AlertFlash")); - // hud_anim_load(&Flash_anim); + +#ifdef MAKE_FS1 + hud_anim_init(&Flash_anim, Ra_flash_coords[gr_screen.res][RA_X_COORD], Ra_flash_coords[gr_screen.res][RA_Y_COORD], NOX("AlertFlash")); + hud_anim_load(&Flash_anim); +#endif Red_alert_voice = -1; @@ -473,7 +503,9 @@ void red_alert_close() } Ui_window.destroy(); - // hud_anim_release(&Flash_anim); +#ifdef MAKE_FS1 + hud_anim_release(&Flash_anim); +#endif common_free_interface_palette(); // restore game palette game_flush(); } @@ -513,7 +545,9 @@ void red_alert_do_frame(float frametime) } Ui_window.draw(); - // hud_anim_render(&Flash_anim, frametime); +#ifdef MAKE_FS1 + hud_anim_render(&Flash_anim, frametime); +#endif gr_set_font(FONT1); diff --git a/src/model/modelinterp.cpp b/src/model/modelinterp.cpp index 8580b40..d9ff9ae 100644 --- a/src/model/modelinterp.cpp +++ b/src/model/modelinterp.cpp @@ -15,6 +15,9 @@ * Rendering models, I think. * * $Log$ + * Revision 1.6 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -2777,7 +2780,11 @@ void model_really_render(int model_num, matrix *orient, vector * pos, uint flags } // Draw the thruster glow +#ifndef MAKE_FS1 if ( (Interp_thrust_glow_bitmap != -1) && (Interp_flags & MR_SHOW_THRUSTERS) /*&& (Detail.engine_glows)*/ ) { +#else + if ( (Interp_thrust_glow_bitmap != -1) && (Interp_flags & MR_SHOW_THRUSTERS) && (Detail.engine_glows) ) { +#endif for (i = 0; i < pm->n_thrusters; i++ ) { thruster_bank *bank = &pm->thrusters[i]; diff --git a/src/nebula/neb.cpp b/src/nebula/neb.cpp index cb6fcb1..effb959 100644 --- a/src/nebula/neb.cpp +++ b/src/nebula/neb.cpp @@ -15,6 +15,9 @@ * Nebula effect * * $Log$ + * Revision 1.8 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.7 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -331,6 +334,7 @@ void neb2_regen(); // initialize neb2 stuff at game startup void neb2_init() { +#ifndef MAKE_FS1 char name[255] = ""; // read in the nebula.tbl @@ -363,6 +367,7 @@ void neb2_init() // should always have 6 neb poofs Assert(Neb2_poof_count == 6); +#endif } // set detail level diff --git a/src/nebula/neblightning.cpp b/src/nebula/neblightning.cpp index 7181b86..1fde264 100644 --- a/src/nebula/neblightning.cpp +++ b/src/nebula/neblightning.cpp @@ -15,6 +15,9 @@ * Nebula effect * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/17 06:33:09 relnev * ryan's struct patch for gcc 2.95 * @@ -337,6 +340,7 @@ int nebl_get_storm_index(char *name); // initialize nebula lightning at game startup void nebl_init() { +#ifndef MAKE_FS1 char name[NAME_LENGTH+10] = ""; bolt_type bogus_lightning, *l; storm_type bogus_storm, *s; @@ -483,6 +487,7 @@ void nebl_init() Num_storm_types++; } } +#endif } // initialize lightning before entering a level diff --git a/src/network/multi_options.cpp b/src/network/multi_options.cpp index 3e98648..fa28b36 100644 --- a/src/network/multi_options.cpp +++ b/src/network/multi_options.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:23 relnev * added copyright header * @@ -503,9 +506,11 @@ void multi_options_local_load(multi_local_options *options, net_player *pxo_pl) } // stuff pxo squad info +#ifndef MAKE_FS1 if(pxo_pl != NULL){ strcpy(pxo_pl->p_info.pxo_squad_name, Multi_tracker_squad_name); } +#endif } // update everyone on the current netgame options diff --git a/src/network/multi_pinfo.cpp b/src/network/multi_pinfo.cpp index fd6951c..ccf6751 100644 --- a/src/network/multi_pinfo.cpp +++ b/src/network/multi_pinfo.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:23 relnev * added copyright header * @@ -123,7 +126,11 @@ char *Multi_pinfo_bitmap_mask[GR_NUM_RESOLUTIONS] = { // pilot image area defs int Multi_pinfo_pilot_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 22, 165, 154, 122 +#else 22, 159, 160, 120 +#endif }, { // GR_1024 35, 254, 256, 192 @@ -151,10 +158,17 @@ UI_BUTTON Multi_pinfo_select_button; // for selecting list items int Multi_pinfo_bitmap; // the background bitmap ui_button_info Multi_pinfo_buttons[GR_NUM_RESOLUTIONS][MULTI_PINFO_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("PIB_00", 180, 209, -1, -1, 0), + ui_button_info("PIB_01", 180, 252, -1, -1, 1), + ui_button_info("PIB_02", 136, 295, -1, -1, 2), + ui_button_info("PIB_03", 583, 326, -1, -1, 3), +#else ui_button_info("PIB_00", 617, 256, -1, -1, 0), ui_button_info("PIB_01", 617, 298, -1, -1, 1), ui_button_info("PIB_02", 172, 322, -1, -1, 2), ui_button_info("PIB_03", 219, 332, 217, 318, 3) +#endif }, { // GR_1024 ui_button_info("2_PIB_00", 988, 410, -1, -1, 0), @@ -164,13 +178,23 @@ ui_button_info Multi_pinfo_buttons[GR_NUM_RESOLUTIONS][MULTI_PINFO_NUM_BUTTONS] } }; +#ifdef MAKE_FS1 +#define MULTI_PINFO_NUM_TEXT 0 +#else #define MULTI_PINFO_NUM_TEXT 1 +#endif UI_XSTR Multi_pinfo_text[GR_NUM_RESOLUTIONS][MULTI_PINFO_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Close", 428, 217, 318, UI_XSTR_COLOR_PINK, -1, &Multi_pinfo_buttons[0][MPI_EXIT].button }, +#endif }, { // GR_1024 + // not needed for fS1 +#ifndef MAKE_FS1 { "Close", 428, 348, 510, UI_XSTR_COLOR_PINK, -1, &Multi_pinfo_buttons[1][MPI_EXIT].button }, +#endif } }; @@ -202,7 +226,11 @@ int Multi_pinfo_stats_label_offsets[MULTI_PINFO_NUM_STATS_LABELS] = { // stats area defs int Multi_pinfo_stats_area_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 213, 177, 404, 145 +#else 215, 163, 414, 155 +#endif }, { // GR_1024 335, 261, 662, 248 @@ -419,7 +447,7 @@ void multi_pinfo_popup_init(net_player *np) } // disable medals button for the demo -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) Multi_pinfo_buttons[gr_screen.res][MPI_MEDALS].button.hide(); Multi_pinfo_buttons[gr_screen.res][MPI_MEDALS].button.disable(); #endif @@ -586,6 +614,7 @@ void multi_pinfo_blit_pilot_image() // blit the pilot squadron logo void multi_pinfo_blit_squadron_logo() { +#ifndef MAKE_FS1 // no squads in FS1 char place_text[100]; int w; player *p = Multi_pinfo_popup_player->player; @@ -628,6 +657,7 @@ void multi_pinfo_blit_squadron_logo() Multi_pinfo_squad_coords[gr_screen.res][1] + ((Multi_pinfo_squad_coords[gr_screen.res][3] - h)/2)); // g3_draw_2d_poly_bitmap(Multi_pinfo_squad_coords[gr_screen.res][0], Multi_pinfo_squad_coords[gr_screen.res][1], Multi_pinfo_squad_coords[gr_screen.res][2], Multi_pinfo_squad_coords[gr_screen.res][3]); } +#endif } // blit the player statistics diff --git a/src/network/multiteamselect.cpp b/src/network/multiteamselect.cpp index b14a8af..567cf37 100644 --- a/src/network/multiteamselect.cpp +++ b/src/network/multiteamselect.cpp @@ -15,6 +15,9 @@ * Multiplayer Team Selection Code * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -237,6 +240,15 @@ char *Multi_ts_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = { ui_button_info Multi_ts_buttons[GR_NUM_RESOLUTIONS][MULTI_TS_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("CB_00", 0, 0, -1, -1, 0), + ui_button_info("CB_01", 0, 19, -1, -1, 1), + ui_button_info("CB_02", 0, 33, -1, -1, 2), + ui_button_info("TSB_03", 0, 302, -1, -1, 3), + ui_button_info("TSB_04", 0, 453, -1, -1, 4), + ui_button_info("TSB_09", 559, 409, -1, -1, 9), + ui_button_info("TSB_34", 601, 344, -1, -1, 50), +#else ui_button_info("CB_00", 7, 3, 37, 7, 0), ui_button_info("CB_01", 7, 19, 37, 23, 1), ui_button_info("CB_02", 7, 35, 37, 39, 2), @@ -244,6 +256,7 @@ ui_button_info Multi_ts_buttons[GR_NUM_RESOLUTIONS][MULTI_TS_NUM_BUTTONS] = { ui_button_info("TSB_04", 5, 454, -1, -1, 4), ui_button_info("TSB_09", 571, 425, 572, 413, 9), ui_button_info("TSB_34", 603, 374, 602, 364, 34) +#endif }, { // GR_1024 @@ -658,7 +671,9 @@ void multi_ts_init() multi_common_set_palette(); // set the interface palette - // common_set_interface_palette(MULTI_TS_PALETTE); +#ifdef MAKE_FS1 + common_set_interface_palette(MULTI_TS_PALETTE); +#endif Net_player->state = NETPLAYER_STATE_SHIP_SELECT; @@ -852,6 +867,10 @@ void multi_ts_close() // destroy the UI_WINDOW Multi_ts_window.destroy(); + +#ifdef MAKE_FS1 + common_free_interface_palette(); +#endif } // is the given slot disabled for the specified player @@ -1354,12 +1373,14 @@ void multi_ts_init_graphics() Multi_ts_buttons[gr_screen.res][idx].button.link_hotspot(Multi_ts_buttons[gr_screen.res][idx].hotspot); } +#ifndef MAKE_FS1 // add some text Multi_ts_window.add_XSTR("Briefing", 765, Multi_ts_buttons[gr_screen.res][MULTI_TS_BRIEFING].xt, Multi_ts_buttons[gr_screen.res][MULTI_TS_BRIEFING].yt, &Multi_ts_buttons[gr_screen.res][MULTI_TS_BRIEFING].button, UI_XSTR_COLOR_GREEN); Multi_ts_window.add_XSTR("Ship Selection", 1067, Multi_ts_buttons[gr_screen.res][MULTI_TS_SHIP_SELECT].xt, Multi_ts_buttons[gr_screen.res][MULTI_TS_SHIP_SELECT].yt, &Multi_ts_buttons[gr_screen.res][MULTI_TS_SHIP_SELECT].button, UI_XSTR_COLOR_GREEN); Multi_ts_window.add_XSTR("Weapon Loadout", 1068, Multi_ts_buttons[gr_screen.res][MULTI_TS_WEAPON_SELECT].xt, Multi_ts_buttons[gr_screen.res][MULTI_TS_WEAPON_SELECT].yt, &Multi_ts_buttons[gr_screen.res][MULTI_TS_WEAPON_SELECT].button, UI_XSTR_COLOR_GREEN); Multi_ts_window.add_XSTR("Commit", 1062, Multi_ts_buttons[gr_screen.res][MULTI_TS_COMMIT].xt, Multi_ts_buttons[gr_screen.res][MULTI_TS_COMMIT].yt, &Multi_ts_buttons[gr_screen.res][MULTI_TS_COMMIT].button, UI_XSTR_COLOR_PINK); Multi_ts_window.add_XSTR("Lock", 1270, Multi_ts_buttons[gr_screen.res][MULTI_TS_LOCK].xt, Multi_ts_buttons[gr_screen.res][MULTI_TS_LOCK].yt, &Multi_ts_buttons[gr_screen.res][MULTI_TS_LOCK].button, UI_XSTR_COLOR_GREEN); +#endif // Multi_ts_window.add_XSTR("Help", 928, Multi_ts_buttons[Current_screen-1][gr_screen.res][COMMON_HELP_BUTTON].xt, Multi_ts_buttons[Current_screen-1][gr_screen.res][COMMON_HELP_BUTTON].yt, &Multi_ts_buttons[Current_screen-1][gr_screen.res][COMMON_HELP_BUTTON].button, UI_XSTR_COLOR_GREEN); // Multi_ts_window.add_XSTR("Options", 1036, Multi_ts_buttons[Current_screen-1][gr_screen.res][COMMON_OPTIONS_BUTTON].xt, Multi_ts_buttons[Current_screen-1][gr_screen.res][COMMON_OPTIONS_BUTTON].yt, &Multi_ts_buttons[Current_screen-1][gr_screen.res][COMMON_OPTIONS_BUTTON].button, UI_XSTR_COLOR_GREEN); diff --git a/src/network/multiui.cpp b/src/network/multiui.cpp index a6956db..03df44c 100644 --- a/src/network/multiui.cpp +++ b/src/network/multiui.cpp @@ -15,6 +15,9 @@ * C file for all the UI controls of the mulitiplayer screens * * $Log$ + * Revision 1.8 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.7 2002/06/09 04:41:24 relnev * added copyright header * @@ -518,7 +521,11 @@ // text crap :) int Multi_common_text_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 47, 405, 374, 58 +#else 29, 396, 393, 76 +#endif }, { // GR_1024 47, 634, 630, 122 @@ -526,7 +533,11 @@ int Multi_common_text_coords[GR_NUM_RESOLUTIONS][4] = { }; int Multi_common_text_max_display[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 6, +#else 8, // GR_640 +#endif 12, // GR_1024 }; @@ -753,7 +764,12 @@ char *Multi_common_icon_names[MULTI_NUM_COMMON_ICONS] = { "mp_furball", // furball mission "icon-volition", // volition mission "icon-valid", // mission is valid +#ifndef MAKE_FS1 "cd" // cd icon +#else + "cd", // cd icon + "icon-silent" // SilentThreat +#endif }; //XSTR:ON // width and height of the icons @@ -769,7 +785,12 @@ int Multi_common_icon_dims[MULTI_NUM_COMMON_ICONS][2] = { {18, 11}, // mp furball {9, 9}, // volition mission {8, 8}, // mission is valid +#ifndef MAKE_FS1 {8, 8} // cd icon +#else + {8, 8}, // cd icon + {16, 7} // silent threat +#endif }; void multi_load_common_icons() @@ -879,7 +900,11 @@ void multi_common_verify_cd() #ifdef GAME_CD_CHECK // otherwise, call the freespace function to determine if we have a cd Multi_has_cd = 0; +#ifdef MAKE_FS1 + if((find_freespace_cd(FS_CDROM_VOLUME_1) >= 0) || (find_freespace_cd(FS_CDROM_VOLUME_2) >= 0) ){ +#else if((find_freespace_cd(FS_CDROM_VOLUME_1) >= 0) || (find_freespace_cd(FS_CDROM_VOLUME_2) >= 0) || (find_freespace_cd(FS_CDROM_VOLUME_3) >= 0) ){ +#endif Multi_has_cd = 1; } #else @@ -911,6 +936,7 @@ static char *Multi_join_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = { //XSTR:ON // slider +#ifndef MAKE_FS1 char *Mj_slider_name[GR_NUM_RESOLUTIONS] = { "slider", "2_slider" @@ -923,6 +949,7 @@ int Mj_slider_coords[GR_NUM_RESOLUTIONS][4] = { 8, 147, 30, 322 } }; +#endif // button defs #define MJ_SCROLL_UP 0 @@ -944,11 +971,26 @@ int Multi_join_glr_stamp; int Multi_join_ping_stamp; UI_WINDOW Multi_join_window; // the window object for the join screen UI_BUTTON Multi_join_select_button; // for selecting list items +#ifndef MAKE_FS1 UI_SLIDER2 Multi_join_slider; // handy dandy slider +#endif int Multi_join_bitmap; // the background bitmap ui_button_info Multi_join_buttons[GR_NUM_RESOLUTIONS][MULTI_JOIN_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("MJ_00", 0, 85, -1, -1, 0), + ui_button_info("MJ_01", 0, 125, -1, -1, 1), + ui_button_info("MJ_03", 20, 324, -1, -1, 3), + ui_button_info("MJ_04", 0, 399, -1, -1, 4), + ui_button_info("MJ_05", 0, 436, -1, -1, 5), + ui_button_info("MJ_15", 450, 323, -1, -1, 15), + ui_button_info("MJ_10", 519, 323, -1, -1, 10), + ui_button_info("MJ_06", 574, 323, -1, -1, 6), + ui_button_info("MJ_08", 470, 427, -1, -1, 8), + ui_button_info("MJ_09", 448, 454, -1, -1, 9), + ui_button_info("MJ_07", 563, 411, -1, -1, 7), +#else ui_button_info( "MJ_00", 1, 57, -1, -1, 0 ), // scroll up ui_button_info( "MJ_02", 1, 297, -1, -1, 2 ), // scroll down ui_button_info( "MJ_03", 10, 338, 65, 364, 3 ), // refresh @@ -960,6 +1002,7 @@ ui_button_info Multi_join_buttons[GR_NUM_RESOLUTIONS][MULTI_JOIN_NUM_BUTTONS] = ui_button_info( "MJ_09", 534, 426, -1, -1, 9 ), // help ui_button_info( "MJ_10", 534, 454, -1, -1, 10 ), // options ui_button_info( "MJ_11", 571, 426, 589, 416, 11 ), // join +#endif }, { // GR_1024 ui_button_info( "2_MJ_00", 2, 92, -1, -1, 0 ), // scroll up @@ -976,10 +1019,16 @@ ui_button_info Multi_join_buttons[GR_NUM_RESOLUTIONS][MULTI_JOIN_NUM_BUTTONS] = } }; +#ifdef MAKE_FS1 +#define MULTI_JOIN_NUM_TEXT 0 +#else #define MULTI_JOIN_NUM_TEXT 13 +#endif UI_XSTR Multi_join_text[GR_NUM_RESOLUTIONS][MULTI_JOIN_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 {"Refresh", 1299, 65, 364, UI_XSTR_COLOR_GREEN, -1, &Multi_join_buttons[0][MJ_REFRESH].button}, {"Join as", 1300, 476, 376, UI_XSTR_COLOR_GREEN, -1, &Multi_join_buttons[0][MJ_JOIN_OBSERVER].button}, {"Observer", 1301, 467, 385, UI_XSTR_COLOR_GREEN, -1, &Multi_join_buttons[0][MJ_JOIN_OBSERVER].button}, @@ -993,8 +1042,11 @@ UI_XSTR Multi_join_text[GR_NUM_RESOLUTIONS][MULTI_JOIN_NUM_TEXT] = { {"Server", 1305, 116, 37, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Players", 1306, 471, 37, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Ping", 1307, 555, 37, UI_XSTR_COLOR_GREEN, -1, NULL} +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 {"Refresh", 1299, 104, 582, UI_XSTR_COLOR_GREEN, -1, &Multi_join_buttons[1][MJ_REFRESH].button}, {"Join as", 1300, 783, 602, UI_XSTR_COLOR_GREEN, -1, &Multi_join_buttons[1][MJ_JOIN_OBSERVER].button}, {"Observer", 1301, 774, 611, UI_XSTR_COLOR_GREEN, -1, &Multi_join_buttons[1][MJ_JOIN_OBSERVER].button}, @@ -1008,6 +1060,7 @@ UI_XSTR Multi_join_text[GR_NUM_RESOLUTIONS][MULTI_JOIN_NUM_TEXT] = { {"Server", 1305, 186, 60, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Players", 1306, 753, 60, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Ping", 1307, 888, 60, UI_XSTR_COLOR_GREEN, -1, NULL} +#endif } }; @@ -1209,9 +1262,11 @@ DCF(mj_make, "") void multi_join_notify_new_game() { +#ifndef MAKE_FS1 // reset the # of items Multi_join_slider.set_numberItems(Active_game_count > Mj_max_game_items[gr_screen.res] ? Active_game_count - Mj_max_game_items[gr_screen.res] : 0); Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif } int multi_join_autojoin_do() @@ -1274,7 +1329,9 @@ void multi_join_game_init() game_flush(); // set the palette - // common_set_interface_palette(MULTI_JOIN_PALETTE); +#ifdef MAKE_FS1 + common_set_interface_palette(MULTI_JOIN_PALETTE); +#endif // destroy any chatbox contents which previously existed (from another game) chatbox_clear(); @@ -1356,8 +1413,10 @@ void multi_join_game_init() Multi_join_select_button.create(&Multi_join_window, "", Mj_list_area_coords[gr_screen.res][MJ_X_COORD], Mj_list_area_coords[gr_screen.res][MJ_Y_COORD], Mj_list_area_coords[gr_screen.res][MJ_W_COORD], Mj_list_area_coords[gr_screen.res][MJ_H_COORD], 0, 1); Multi_join_select_button.hide(); +#ifndef MAKE_FS1 // slider Multi_join_slider.create(&Multi_join_window, Mj_slider_coords[gr_screen.res][MJ_X_COORD], Mj_slider_coords[gr_screen.res][MJ_Y_COORD], Mj_slider_coords[gr_screen.res][MJ_W_COORD], Mj_slider_coords[gr_screen.res][MJ_H_COORD], 0, Mj_slider_name[gr_screen.res], &multi_join_list_scroll_up, &multi_join_list_scroll_down, NULL); +#endif // if starting a network game, then go to the create game screen if ( Cmdline_start_netgame ) { @@ -1467,7 +1526,9 @@ void multi_join_game_do_frame() // page up the game list case KEY_PAGEUP: multi_join_list_page_up(); +#ifndef MAKE_FS1 Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif break; case KEY_T: @@ -1477,7 +1538,9 @@ void multi_join_game_do_frame() // page down the game list case KEY_PAGEDOWN: multi_join_list_page_down(); +#ifndef MAKE_FS1 Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif break; // send out a ping-all @@ -1494,13 +1557,17 @@ void multi_join_game_do_frame() // scroll the game list up case KEY_UP: multi_join_list_scroll_up(); +#ifndef MAKE_FS1 Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif break; // scroll the game list down case KEY_DOWN: multi_join_list_scroll_down(); +#ifndef MAKE_FS1 Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif break; } @@ -1569,6 +1636,10 @@ void multi_join_game_close() // destroy the UI_WINDOW Multi_join_window.destroy(); + +#ifdef MAKE_FS1 + common_free_interface_palette(); +#endif } void multi_join_check_buttons() @@ -1634,13 +1705,17 @@ void multi_join_button_pressed(int n) // scroll the game list up case MJ_SCROLL_UP: multi_join_list_scroll_up(); +#ifndef MAKE_FS1 Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif break; // scroll the game list down case MJ_SCROLL_DOWN: multi_join_list_scroll_down(); +#ifndef MAKE_FS1 Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif break; // scroll the info text box up @@ -1821,12 +1896,14 @@ void multi_join_blit_game_status(active_game *game, int y) break; // dogfight game +#ifndef MAKE_FS1 case AG_FLAG_DOGFIGHT: if(Multi_common_icons[MICON_DOGFIGHT] != -1){ gr_set_bitmap(Multi_common_icons[MICON_DOGFIGHT]); draw = 1; } break; +#endif } // if we're supposed to draw a bitmap if(draw){ @@ -2224,8 +2301,10 @@ void multi_join_handle_item_cull(active_game *item, int item_index) if(item->next == item){ Multi_join_list_selected = -1; Multi_join_selected_item = NULL; - + +#ifndef MAKE_FS1 Multi_join_slider.set_numberItems(0); +#endif MJ_LIST_START_SET(-1); Multi_join_list_start_item = NULL; @@ -2286,8 +2365,10 @@ void multi_join_handle_item_cull(active_game *item, int item_index) } // set slider location +#ifndef MAKE_FS1 Multi_join_slider.set_numberItems(Active_game_count > Mj_max_game_items[gr_screen.res] ? Active_game_count - Mj_max_game_items[gr_screen.res] : 0); Multi_join_slider.force_currentItem(Multi_join_list_start); +#endif } void multi_join_send_join_request(int as_observer) @@ -2319,9 +2400,11 @@ void multi_join_send_join_request(int as_observer) if(strlen(Player->image_filename) > 0){ strcpy(Multi_join_request.image_filename, Player->image_filename); } +#ifndef MAKE_FS1 if(strlen(Player->squad_filename) > 0){ strcpy(Multi_join_request.squad_filename, Player->squad_filename); } +#endif // tracker id (if any) Multi_join_request.tracker_id = Multi_tracker_id; @@ -2341,7 +2424,9 @@ void multi_join_send_join_request(int as_observer) } // pxo squad info +#ifndef MAKE_FS1 strncpy(Multi_join_request.pxo_squad_name, Multi_tracker_squad_name, LOGIN_LEN); +#endif // version of this server Multi_join_request.version = MULTI_FS_SERVER_VERSION; @@ -2539,7 +2624,11 @@ int Multi_sg_rank_max_display[GR_NUM_RESOLUTIONS] = { // input password field int Msg_passwd_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 247, 179, 285, 9 +#else 36, 236, 408, 20 +#endif }, { // GR_1024 58, 377, 652, 32 @@ -2549,7 +2638,11 @@ int Msg_passwd_coords[GR_NUM_RESOLUTIONS][4] = { // input game title field int Msg_title_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 178, 66, 354, 9 +#else 29, 49, 415, 23 +#endif }, { // GR_1024 46, 78, 664, 36 @@ -2559,7 +2652,11 @@ int Msg_title_coords[GR_NUM_RESOLUTIONS][4] = { // rank selected field int Msg_rank_sel_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 241, 253, 129, 10 +#else 242, 254, 126, 12 +#endif }, { // GR_1024 242, 254, 126, 12 @@ -2569,7 +2666,11 @@ int Msg_rank_sel_coords[GR_NUM_RESOLUTIONS][4] = { // rank list field int Msg_rank_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 241, 285, 129, 51 +#else 37, 297, 131, 16 +#endif }, { // GR_1024 60, 469, 652, 32 @@ -2578,6 +2679,21 @@ int Msg_rank_list_coords[GR_NUM_RESOLUTIONS][4] = { // button defs +#ifdef MAKE_FS1 +#define MULTI_SG_NUM_BUTTONS 12 +#define MSG_OPEN_GAME 0 +#define MSG_CLOSED_GAME 1 +#define MSG_PASSWD_GAME 2 +#define MSG_RESTRICTED_GAME 3 +#define MSG_RANK_SET_GAME 4 +#define MSG_RANK_SCROLL_UP 5 +#define MSG_RANK_SCROLL_DOWN 6 +#define MSG_RANK_ABOVE 7 +#define MSG_RANK_BELOW 8 +#define MSG_HELP 9 +#define MSG_OPTIONS 10 +#define MSG_ACCEPT 11 +#else #define MULTI_SG_NUM_BUTTONS 10 #define MSG_OPEN_GAME 0 //#define MSG_CLOSED_GAME 1 @@ -2591,6 +2707,7 @@ int Msg_rank_list_coords[GR_NUM_RESOLUTIONS][4] = { #define MSG_HELP 7 #define MSG_OPTIONS 8 #define MSG_ACCEPT 9 +#endif UI_WINDOW Multi_sg_window; // the window object for the join screen UI_BUTTON Multi_sg_rank_button; // for selecting the rank marker @@ -2600,6 +2717,20 @@ int Multi_sg_bitmap; // the background bitmap ui_button_info Multi_sg_buttons[GR_NUM_RESOLUTIONS][MULTI_SG_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("MSG_00", 75, 111, -1, -1, 0), + ui_button_info("MSG_01", 75, 139, -1, -1, 1), + ui_button_info("MSG_02", 75, 164, -1, -1, 2), + ui_button_info("MSG_03", 75, 199, -1, -1, 3), + ui_button_info("MSG_04", 75, 243, -1, -1, 4), + ui_button_info("MSG_05", 376, 231, -1, -1, 5), + ui_button_info("MSG_06", 376, 258, -1, -1, 6), + ui_button_info("MSG_07", 376, 291, -1, -1, 7), + ui_button_info("MSG_08", 376, 320, -1, -1, 8), + ui_button_info("MSG_09", 469, 427, -1, -1, 9), + ui_button_info("MSG_10", 447, 452, -1, -1, 10), + ui_button_info("MSG_11", 561, 411, -1, -1, 11), +#else ui_button_info("MSG_00", 1, 184, 34, 191, 2), // open // ui_button_info("MSG_01", 1, 159, 34, 166, 1), // closed // ui_button_info("MSG_02", 1, 184, 34, 191, 2), // restricted @@ -2612,6 +2743,7 @@ ui_button_info Multi_sg_buttons[GR_NUM_RESOLUTIONS][MULTI_SG_NUM_BUTTONS] = { ui_button_info("MSG_09", 536, 429, 500, 440, 9), // help ui_button_info("MSG_10", 536, 454, 479, 464, 10), // options ui_button_info("MSG_11", 576, 432, 571, 415, 11), // accept +#endif }, { // GR_1024 ui_button_info("2_MSG_00", 2, 295, 51, 307, 2), // open @@ -2626,12 +2758,22 @@ ui_button_info Multi_sg_buttons[GR_NUM_RESOLUTIONS][MULTI_SG_NUM_BUTTONS] = { ui_button_info("2_MSG_09", 858, 687, 817, 706, 9), // help ui_button_info("2_MSG_10", 858, 728, 797, 743, 10), // options ui_button_info("2_MSG_11", 921, 692, 921, 664, 11), // accept +#ifdef MAKE_FS1 // filler for extra FS1 buttons + ui_button_info("none", -1, -1, -1, -1, -1), + ui_button_info("none", -1, -1, -1, -1, -1), +#endif }, }; +#ifdef MAKE_FS1 +#define MULTI_SG_NUM_TEXT 0 +#else #define MULTI_SG_NUM_TEXT 11 +#endif UI_XSTR Multi_sg_text[GR_NUM_RESOLUTIONS][MULTI_SG_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 {"Open", 1322, 34, 191, UI_XSTR_COLOR_GREEN, -1, &Multi_sg_buttons[0][MSG_OPEN_GAME].button}, // {"Closed", 1323, 34, 166, UI_XSTR_COLOR_GREEN, -1, &Multi_sg_buttons[0][MSG_CLOSED_GAME].button}, // {"Restricted", 1324, 34, 191, UI_XSTR_COLOR_GREEN, -1, &Multi_sg_buttons[0][MSG_RESTRICTED_GAME].button}, @@ -2645,8 +2787,11 @@ UI_XSTR Multi_sg_text[GR_NUM_RESOLUTIONS][MULTI_SG_NUM_TEXT] = { {"Start Game", 1329, 26, 10, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Title", 1330, 26, 31, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Game Type", 1331, 12, 165, UI_XSTR_COLOR_GREEN, -1, NULL}, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 {"Open", 1322, 51, 307, UI_XSTR_COLOR_GREEN, -1, &Multi_sg_buttons[1][MSG_OPEN_GAME].button}, // {"Closed", 1323, 51, 267, UI_XSTR_COLOR_GREEN, -1, &Multi_sg_buttons[1][MSG_CLOSED_GAME].button}, // {"Restricted", 1324, 51, 307, UI_XSTR_COLOR_GREEN, -1, &Multi_sg_buttons[1][MSG_RESTRICTED_GAME].button}, @@ -2660,6 +2805,7 @@ UI_XSTR Multi_sg_text[GR_NUM_RESOLUTIONS][MULTI_SG_NUM_TEXT] = { {"Start Game", 1329, 42, 22, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Title", 1330, 42, 50, UI_XSTR_COLOR_GREEN, -1, NULL}, {"Game Type", 1331, 20, 264, UI_XSTR_COLOR_GREEN, -1, NULL}, +#endif } }; @@ -2695,7 +2841,11 @@ void multi_sg_select_rank_default(); int multi_start_game_rank_from_name( char *rank ) { int i; +#ifdef MAKE_FS1 + for ( i = 0; i <= MAX_FREESPACE1_RANK; i++ ) { +#else for ( i = 0; i <= MAX_FREESPACE2_RANK; i++ ) { +#endif if ( !stricmp(Ranks[i].name, rank) ) { return i; } @@ -2959,7 +3109,7 @@ void multi_sg_button_pressed(int n) } break; - /* +#ifdef MAKE_FS1 // the open button was pressed case MSG_CLOSED_GAME: // if the closed option is selected @@ -2976,7 +3126,8 @@ void multi_sg_button_pressed(int n) gamesnd_play_iface(SND_GENERAL_FAIL); } break; -*/ +#endif + // toggle password protection case MSG_PASSWD_GAME: // if we selected it @@ -2996,7 +3147,7 @@ void multi_sg_button_pressed(int n) } break; -/* +#ifdef MAKE_FS1 // toggle "restricted" on or off case MSG_RESTRICTED_GAME: if(Multi_sg_netgame->mode != NG_MODE_RESTRICTED){ @@ -3009,7 +3160,8 @@ void multi_sg_button_pressed(int n) gamesnd_play_iface(SND_GENERAL_FAIL); } break; -*/ +#endif + // turn off all rank requirements case MSG_RANK_SET_GAME: // if either is set, then turn then both off @@ -3213,18 +3365,23 @@ void multi_sg_draw_radio_buttons() case NG_MODE_OPEN: Multi_sg_buttons[gr_screen.res][MSG_OPEN_GAME].button.draw_forced(2); break; -/* + +#ifdef MAKE_FS1 case NG_MODE_CLOSED: Multi_sg_buttons[gr_screen.res][MSG_CLOSED_GAME].button.draw_forced(2); break; - */ +#endif + case NG_MODE_PASSWORD: Multi_sg_buttons[gr_screen.res][MSG_PASSWD_GAME].button.draw_forced(2); break; -/* case NG_MODE_RESTRICTED: + +#ifdef MAKE_FS1 + case NG_MODE_RESTRICTED: Multi_sg_buttons[gr_screen.res][MSG_RESTRICTED_GAME].button.draw_forced(2); break; - */ +#endif + case NG_MODE_RANK_ABOVE: Multi_sg_buttons[gr_screen.res][MSG_RANK_SET_GAME].button.draw_forced(2); Multi_sg_buttons[gr_screen.res][MSG_RANK_ABOVE].button.draw_forced(2); @@ -3299,11 +3456,11 @@ void multi_sg_rank_display_stuff() } // display the selected rank - /* +#ifdef MAKE_FS1 gr_set_color_fast(&Color_bright); multi_sg_rank_build_name(Ranks[Multi_sg_netgame->rank_base].name,rank_name); gr_string(Msg_rank_sel_coords[gr_screen.res][MSG_X_COORD],Msg_rank_sel_coords[gr_screen.res][MSG_Y_COORD],rank_name); - */ +#endif } void multi_sg_rank_process_select() @@ -3490,6 +3647,32 @@ UI_SLIDER2 Multi_create_slider; // for create list ui_button_info Multi_create_buttons[GR_NUM_RESOLUTIONS][MULTI_CREATE_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("MC_18", 34, 131, -1, -1, 18), // all + ui_button_info("MC_19", 72, 131, -1, -1, 19), // coop + ui_button_info("MC_20", 120, 131, -1, -1, 20), // team +// ui_button_info("MC_21", 166, 131, -1, -1, 21), // dogfight + ui_button_info("none", -1, -1, -1, -1, -1), // dogfight (not used) + ui_button_info("none", -1, -1, -1, -1, -1), // pxo? + ui_button_info("MC_26", 540, 114, -1, -1, 26), // pilot info + ui_button_info("MC_03", 0, 187, -1, -1, 2), // scroll list up + ui_button_info("MC_02", 0, 227, -1, -1, 3), // scroll list down + ui_button_info("MC_04", 611, 182, -1, -1, 4), // scroll players up + ui_button_info("MC_05", 611, 221, -1, -1, 5), // scroll players down + ui_button_info("MC_06", 18, 322, -1, -1, 6), // mission filter + ui_button_info("MC_07", 18, 344, -1, -1, 7), // campaign filter + ui_button_info("MC_10", 317, 339, -1, -1, 10), // cancel + ui_button_info("MC_14", 464, 350, -1, -1, 14), // team 1 + ui_button_info("MC_15", 498, 350, -1, -1, 15), // team 2 + ui_button_info("MC_16", 527, 346, -1, -1, 16), // kick + ui_button_info("MC_17", 572, 346, -1, -1, 17), // close + ui_button_info("MC_08", 0, 398, -1, -1, 8), // scroll mission info up + ui_button_info("MC_09", 0, 435, -1, -1, 9), // scroll mission info down + ui_button_info("MC_27", 447, 402, -1, -1, 27), // host options + ui_button_info("MC_11", 510, 428, -1, -1, 11), // help + ui_button_info("MC_12", 510, 453, -1, -1, 12), // options + ui_button_info("Mc_13", 562, 412, -1, -1, 13), // commit +#else ui_button_info("MC_00", 32, 129, 36, 158, 0), // show all missions ui_button_info("MC_01", 76, 129, 71, 158, 1), // show coop missions ui_button_info("MC_02", 121, 129, 119, 158, 2), // show team missions @@ -3513,6 +3696,7 @@ ui_button_info Multi_create_buttons[GR_NUM_RESOLUTIONS][MULTI_CREATE_NUM_BUTTONS ui_button_info("MC_21", 534, 426, -1, -1, 21), // help ui_button_info("MC_22", 534, 452, -1, -1, 22), // options ui_button_info("MC_23", 571, 426, 572, 413, 23), // commit +#endif }, { // GR_1024 ui_button_info("2_MC_00", 51, 207, 61, 253, 0), // show all missions @@ -3541,9 +3725,15 @@ ui_button_info Multi_create_buttons[GR_NUM_RESOLUTIONS][MULTI_CREATE_NUM_BUTTONS }, }; +#ifdef MAKE_FS1 +#define MULTI_CREATE_NUM_TEXT 0 +#else #define MULTI_CREATE_NUM_TEXT 15 +#endif UI_XSTR Multi_create_text[GR_NUM_RESOLUTIONS][MULTI_CREATE_NUM_BUTTONS] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 {"All", 1256, 36, 158, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[0][MC_SHOW_ALL].button}, {"Coop", 1257, 71, 158, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[0][MC_SHOW_COOP].button}, {"Team", 1258, 119, 158, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[0][MC_SHOW_TEAM].button}, @@ -3559,8 +3749,11 @@ UI_XSTR Multi_create_text[GR_NUM_RESOLUTIONS][MULTI_CREATE_NUM_BUTTONS] = { {"Close", 1508, 582, 381, UI_XSTR_COLOR_PINK, -1, &Multi_create_buttons[0][MC_CLOSE].button}, {"Host Options", 1267, 436, 423, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[0][MC_HOST_OPTIONS].button}, {"Commit", 1062, 572, 413, UI_XSTR_COLOR_PINK, -1, &Multi_create_buttons[0][MC_ACCEPT].button} +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 {"All", 1256, 61, 253, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[1][MC_SHOW_ALL].button}, {"Coop", 1257, 124, 253, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[1][MC_SHOW_COOP].button}, {"Team", 1258, 194, 253, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[1][MC_SHOW_TEAM].button}, @@ -3576,6 +3769,7 @@ UI_XSTR Multi_create_text[GR_NUM_RESOLUTIONS][MULTI_CREATE_NUM_BUTTONS] = { {"Close", 1508, 949, 610, UI_XSTR_COLOR_PINK, -1, &Multi_create_buttons[1][MC_CLOSE].button}, {"Host Options", 1267, 755, 683, UI_XSTR_COLOR_GREEN, -1, &Multi_create_buttons[1][MC_HOST_OPTIONS].button}, {"Commit", 1062, 932, 667, UI_XSTR_COLOR_PINK, -1, &Multi_create_buttons[1][MC_ACCEPT].button} +#endif }, }; @@ -3605,7 +3799,11 @@ int Multi_create_sw_checkbox_text[GR_NUM_RESOLUTIONS][2] = { // game information text areas int Mc_list_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 105, 170, 315, 146 +#else 105, 173, 311, 152 +#endif }, { // GR_1024 62, 275, 600, 262 @@ -3614,7 +3812,11 @@ int Mc_list_coords[GR_NUM_RESOLUTIONS][4] = { int Mc_players_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 465, 163, 138, 172 +#else 463, 164, 144, 180 +#endif }, { // GR_1024 741, 262, 144, 180 @@ -3623,7 +3825,11 @@ int Mc_players_coords[GR_NUM_RESOLUTIONS][4] = { int Mc_info_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 49, 407, 372, 56 +#else 47, 405, 363, 59 +#endif }, { // GR_1024 75, 648, 363, 59 @@ -3880,8 +4086,10 @@ void multi_create_setup_list_data(int mode) qsort(Multi_create_file_list, Multi_create_list_count, sizeof(multi_create_info), multi_create_sort_func); } +#ifndef MAKE_FS1 // reset the slider Multi_create_slider.set_numberItems(Multi_create_list_count > Multi_create_list_max_display[gr_screen.res] ? Multi_create_list_count-Multi_create_list_max_display[gr_screen.res] : 0); +#endif } void multi_create_game_init() @@ -3985,7 +4193,9 @@ void multi_create_game_init() Multi_create_list_select = -1; Multi_create_list_count = 0; +#ifndef MAKE_FS1 Multi_create_slider.create(&Multi_create_window, Mc_slider_coords[gr_screen.res][MC_X_COORD], Mc_slider_coords[gr_screen.res][MC_Y_COORD], Mc_slider_coords[gr_screen.res][MC_W_COORD],Mc_slider_coords[gr_screen.res][MC_H_COORD], MULTI_CREATE_MAX_LIST_ITEMS, Mc_slider_bitmap[gr_screen.res], &multi_create_list_scroll_up, &multi_create_list_scroll_down, NULL); +#endif // create the player list select button Multi_create_player_select_button.create(&Multi_create_window, "", Mc_players_coords[gr_screen.res][MC_X_COORD], Mc_players_coords[gr_screen.res][MC_Y_COORD], Mc_players_coords[gr_screen.res][MC_W_COORD], Mc_players_coords[gr_screen.res][MC_H_COORD], 0, 1); @@ -4017,8 +4227,10 @@ void multi_create_game_init() void multi_create_game_do() { int player_index; +#ifndef MAKE_FS1 char *loading_str = XSTR("Loading", 1336); int str_w, str_h; +#endif // set this if we want to show the pilot info popup Multi_create_should_show_popup = 0; @@ -4047,11 +4259,13 @@ void multi_create_game_do() gr_bitmap( Please_wait_coords[gr_screen.res][MC_X_COORD], Please_wait_coords[gr_screen.res][MC_Y_COORD] ); // draw "Loading" on it +#ifndef MAKE_FS1 gr_set_color_fast(&Color_normal); gr_set_font(FONT2); gr_get_string_size(&str_w, &str_h, loading_str); gr_string((gr_screen.max_w - str_w) / 2, (gr_screen.max_h - str_h) / 2, loading_str); gr_set_font(FONT1); +#endif gr_flip(); @@ -4131,6 +4345,7 @@ void multi_create_game_do() gr_set_color_fast(&Color_normal); +#ifndef MAKE_FS1 // draw Create Game text gr_string(Mc_create_game_text[gr_screen.res][MC_X_COORD], Mc_create_game_text[gr_screen.res][MC_Y_COORD], XSTR("Create Game", 1268)); @@ -4139,6 +4354,7 @@ void multi_create_game_do() // draw players text gr_string(Mc_team_text[gr_screen.res][MC_X_COORD], Mc_team_text[gr_screen.res][MC_Y_COORD], XSTR("Team", 1258)); +#endif // process and display the player list // NOTE : this must be done before the buttons are checked to insure that a player hasn't dropped @@ -4299,13 +4515,17 @@ void multi_create_button_pressed(int n) // scroll the game/campaign list up case MC_SCROLL_LIST_UP: multi_create_list_scroll_up(); +#ifndef MAKE_FS1 Multi_create_slider.forceUp(); // move slider up +#endif break; // scroll the game/campaign list down case MC_SCROLL_LIST_DOWN: multi_create_list_scroll_down(); +#ifndef MAKE_FS1 Multi_create_slider.forceDown(); // move slider down +#endif break; // go to the options screen @@ -4348,6 +4568,7 @@ void multi_create_button_pressed(int n) break; // show dogfight missions +#ifndef MAKE_FS1 case MC_SHOW_DOGFIGHT: if (Multi_create_filter != MISSION_TYPE_MULTI_DOGFIGHT){ gamesnd_play_iface(SND_USER_SELECT); @@ -4357,6 +4578,7 @@ void multi_create_button_pressed(int n) gamesnd_play_iface(SND_GENERAL_FAIL); } break; +#endif // toggle temporary netgame closed on/off case MC_CLOSE: @@ -4809,7 +5031,9 @@ void multi_create_list_load_missions() } } +#ifndef MAKE_FS1 Multi_create_slider.set_numberItems(Multi_create_mission_count > Multi_create_list_max_display[gr_screen.res] ? Multi_create_mission_count-Multi_create_list_max_display[gr_screen.res] : 0); +#endif // maybe create a standalone dialog if(Game_mode & GM_STANDALONE_SERVER){ @@ -5165,6 +5389,17 @@ void multi_create_list_blit_icons(int list_index, int y_start) gr_bitmap(Mc_icon_volition_coords[gr_screen.res][MC_X_COORD],y_start + Mc_icon_volition_coords[gr_screen.res][MC_Y_COORD]); } } + +#ifdef MAKE_FS1 + // check for mdisk mission + fb = game_find_builtin_mission(mcip->filename); + if((fb != NULL) && (fb->flags & FSB_FROM_MDISK)){ + if(Multi_common_icons[MICON_MDISK] >= 0){ + gr_set_bitmap(Multi_common_icons[MICON_MDISK]); + gr_bitmap(Mc_icon_silent_coords[gr_screen.res][MC_X_COORD],y_start + Mc_icon_silent_coords[gr_screen.res][MC_Y_COORD]); + } + } +#endif } void multi_create_accept_hit() @@ -5766,6 +6001,29 @@ int Multi_ho_bitmap; // the background bitmap ui_button_info Multi_ho_buttons[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + // who is allowed to message + ui_button_info("MH_00", 13, 157, -1, -1, 0), // highest rank + ui_button_info("MH_01", 13, 179, -1, -1, 1), // team/wing leader + ui_button_info("MH_02", 13, 200, -1, -1, 2), // any + ui_button_info("MH_03", 13, 223, -1, -1, 3), // host + + // who is allowed to end the mission + ui_button_info("MH_09", 13, 273, -1, -1, 9), // highest rank + ui_button_info("MH_10", 13, 295, -1, -1, 10), // team/wing leader + ui_button_info("MH_11", 13, 317, -1, -1, 11), // any + ui_button_info("MH_12", 13, 339, -1, -1, 12), // host + + // voice on/off button + ui_button_info("MH_14", 396, 156, -1, -1, 14), + ui_button_info("MH_15", 453, 156, -1, -1, 15), + + // host modifies ships + ui_button_info("MH_19", 215, 410, -1, -1, 19), + + // exit + ui_button_info("MH_18", 560, 411, -1, -1, 18), +#else // who is allowed to message ui_button_info("MH_00", 3, 160, 46, 166, 0), // highest rank ui_button_info("MH_01", 3, 179, 46, 185, 1), // team/wing leader @@ -5787,6 +6045,7 @@ ui_button_info Multi_ho_buttons[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_BUTTONS] = { // exit ui_button_info("MH_14", 572, 428, 580, 414, 14), +#endif }, { // GR_1024 // who is allowed to message @@ -5814,6 +6073,8 @@ ui_button_info Multi_ho_buttons[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_BUTTONS] = { }; UI_XSTR Multi_ho_text[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_BUTTONS] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 {"Highest rank", 1280, 46, 166, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[0][MULTI_HO_MSG_RANK].button}, {"Team / wing-leader", 1281, 46, 185, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[0][MULTI_HO_MSG_LEADER].button}, {"Any", 1282, 46, 203, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[0][MULTI_HO_MSG_ANY].button}, @@ -5826,8 +6087,11 @@ UI_XSTR Multi_ho_text[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_BUTTONS] = { {"Off", 1286, 604, 185, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[0][MULTI_HO_VOICE_OFF].button}, {"Host modifies ships", 1287, 437, 363, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[0][MULTI_HO_HOST_MODIFIES].button}, {"Exit", 1417, 572, 418, UI_XSTR_COLOR_PINK, -1, &Multi_ho_buttons[0][MULTI_HO_ACCEPT].button}, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 {"Highest rank", 1280, 62, 269, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[1][MULTI_HO_MSG_RANK].button}, {"Team / wing-leader", 1281, 62, 297, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[1][MULTI_HO_MSG_LEADER].button}, {"Any", 1282, 62, 325, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[1][MULTI_HO_MSG_ANY].button}, @@ -5840,6 +6104,7 @@ UI_XSTR Multi_ho_text[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_BUTTONS] = { {"Off", 1286, 967, 293, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[1][MULTI_HO_VOICE_OFF].button}, {"Host modifies ships", 1287, 869, 589, UI_XSTR_COLOR_GREEN, -1, &Multi_ho_buttons[1][MULTI_HO_HOST_MODIFIES].button}, {"Exit", 1417, 953, 672, UI_XSTR_COLOR_PINK, -1, &Multi_ho_buttons[1][MULTI_HO_ACCEPT].button}, +#endif } }; @@ -5882,9 +6147,15 @@ struct ho_sliders { }; ho_sliders Multi_ho_sliders[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_SLIDERS] = { { // GR_640 +#ifdef MAKE_FS1 + ho_sliders("MH_16", 396, 210, -1, -1, 16, 19, 10), // voice qos + ho_sliders("MH_17", 396, 263, -1, -1, 17, 19, 10), // voice duration + ho_sliders("MH_13", 10, 387, -1, -1, 13, 36, 5), // skill level +#else ho_sliders("MH_11", 428, 214, 437, 199, 11, 19, 10), // voice qos ho_sliders("MH_12", 428, 261, 437, 246, 12, 19, 10), // voice duration ho_sliders("MH_08", 237, 454, 230, 411, 8, 36, 5), // skill level +#endif }, { // GR_1024 ho_sliders("2_MH_11", 684, 343, 690, 323, 11, 32, 10), // voice qos @@ -5903,9 +6174,15 @@ int Multi_ho_lastframe_input = 0; // game information text areas // ho titles +#ifdef MAKE_FS1 +#define MULTI_HO_NUM_TITLES 0 +#else #define MULTI_HO_NUM_TITLES 14 +#endif UI_XSTR Multi_ho_titles[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_TITLES] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "AI Orders", 1289, 32, 144, UI_XSTR_COLOR_GREEN, -1, NULL }, { "End Mission", 1290, 32, 242, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Time Limit", 1291, 32, 347, UI_XSTR_COLOR_GREEN, -1, NULL }, @@ -5920,8 +6197,11 @@ UI_XSTR Multi_ho_titles[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_TITLES] = { { "sec", 1522, 523, 292, UI_XSTR_COLOR_GREEN, -1, NULL }, { "sec", 1523, 523, 332, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Voice Wait", 1298, 437, 313, UI_XSTR_COLOR_GREEN, -1, NULL }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "AI Orders", 1289, 48, 238, UI_XSTR_COLOR_GREEN, -1, NULL }, { "End Mission", 1290, 48, 394, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Time Limit", 1291, 50, 568, UI_XSTR_COLOR_GREEN, -1, NULL }, @@ -5936,13 +6216,18 @@ UI_XSTR Multi_ho_titles[GR_NUM_RESOLUTIONS][MULTI_HO_NUM_TITLES] = { { "sec", 1522, 837, 467, UI_XSTR_COLOR_GREEN, -1, NULL }, { "sec", 1523, 837, 534, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Voice Wait", 1298, 742, 510, UI_XSTR_COLOR_GREEN, -1, NULL }, +#endif } }; // mission time limit input box int Ho_time_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 217, 239, 41, 9 +#else 36, 362, 36, 17 +#endif }, { // GR_1024 58, 581, 57, 27 @@ -5952,7 +6237,11 @@ int Ho_time_coords[GR_NUM_RESOLUTIONS][4] = { // furball kill limit input box int Ho_kill_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 217, 364, 70, 9 +#else 36, 425, 45, 17 +#endif }, { // GR_1024 58, 684, 72, 27 @@ -5962,7 +6251,11 @@ int Ho_kill_coords[GR_NUM_RESOLUTIONS][4] = { // voice recording duration text display area int Ho_vd_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 419, 300, 39, 9 +#else 467, 292, 55, 15 +#endif }, { // GR_1024 750, 467, 85, 28 @@ -5972,7 +6265,11 @@ int Ho_vd_coords[GR_NUM_RESOLUTIONS][4] = { // voice token wait input box int Ho_vw_coords[GR_NUM_RESOLUTIONS][6] = { { // GR_640 +#ifdef MAKE_FS1 + 419, 366, 39, 9 +#else 467, 332, 55, 15 +#endif }, { // GR_1024 750, 534, 85, 28 @@ -5982,7 +6279,11 @@ int Ho_vw_coords[GR_NUM_RESOLUTIONS][6] = { // observer count input box int Ho_obs_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 217, 176, 70, 9 +#else 36, 457, 45, 17 +#endif }, { // GR_1024 58, 733, 72, 27 @@ -5992,7 +6293,11 @@ int Ho_obs_coords[GR_NUM_RESOLUTIONS][4] = { // skill text description area int Ho_st_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 40, 426, 167, 9 +#else 249, 435, 172, 10 +#endif }, { // GR_1024 403, 699, 172, 10 @@ -6002,7 +6307,11 @@ int Ho_st_coords[GR_NUM_RESOLUTIONS][4] = { // respawn input box int Ho_rsp_coords[GR_NUM_RESOLUTIONS][6] = { { // GR_640 +#ifdef MAKE_FS1 + 217, 301, 70, 9, +#else 36, 394, 45, 17, +#endif }, { // GR_1024 58, 632, 72, 27 @@ -6012,7 +6321,11 @@ int Ho_rsp_coords[GR_NUM_RESOLUTIONS][6] = { // respawn max text area int Ho_max_rsp_coords[GR_NUM_RESOLUTIONS][2] = { { // GR_640 +#ifdef MAKE_FS1 + 305, 301 +#else 150, 378 +#endif }, { // GR_1024 190, 618 @@ -6074,7 +6387,9 @@ void multi_host_options_init() Multi_ho_buttons[gr_screen.res][idx].button.link_hotspot(Multi_ho_buttons[gr_screen.res][idx].hotspot); // add xstr text +#ifndef MAKE_FS1 Multi_ho_window.add_XSTR(&Multi_ho_text[gr_screen.res][idx]); +#endif } // create misc text @@ -6788,10 +7103,16 @@ ui_button_info Multi_jw_buttons[GR_NUM_RESOLUTIONS][MULTI_JW_NUM_BUTTONS] = { } }; +#ifdef MAKE_FS1 +#define MULTI_JW_NUM_TEXT 0 +#else #define MULTI_JW_NUM_TEXT 7 +#endif UI_XSTR Multi_jw_text[GR_NUM_RESOLUTIONS][MULTI_JW_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Team 1", 1308, 20, 272, UI_XSTR_COLOR_GREEN, -1, &Multi_jw_buttons[0][MJW_TEAM0].button }, { "Team 2", 1309, 73, 272, UI_XSTR_COLOR_GREEN, -1, &Multi_jw_buttons[0][MJW_TEAM1].button }, { "Pilot", 1310, 134, 272, UI_XSTR_COLOR_GREEN, -1, &Multi_jw_buttons[0][MJW_PILOT_INFO].button }, @@ -6799,8 +7120,11 @@ UI_XSTR Multi_jw_text[GR_NUM_RESOLUTIONS][MULTI_JW_NUM_TEXT] = { { "Cancel", 387, 570, 414, UI_XSTR_COLOR_PINK, -1, &Multi_jw_buttons[0][MJW_CANCEL].button }, { "Players", 1269, 38, 8, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Choose Team", 1312, 27, 231, UI_XSTR_COLOR_GREEN, -1, NULL }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Team 1", 1308, 47, 435, UI_XSTR_COLOR_GREEN, -1, &Multi_jw_buttons[1][MJW_TEAM0].button }, { "Team 2", 1309, 133, 435, UI_XSTR_COLOR_GREEN, -1, &Multi_jw_buttons[1][MJW_TEAM1].button }, { "Pilot", 1310, 225, 435, UI_XSTR_COLOR_GREEN, -1, &Multi_jw_buttons[1][MJW_PILOT_INFO].button }, @@ -6808,6 +7132,7 @@ UI_XSTR Multi_jw_text[GR_NUM_RESOLUTIONS][MULTI_JW_NUM_TEXT] = { { "Cancel", 387, 931, 667, UI_XSTR_COLOR_PINK, -1, &Multi_jw_buttons[1][MJW_CANCEL].button }, { "Players", 1269, 165, 12, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Choose Team", 1312, 45, 373, UI_XSTR_COLOR_GREEN, -1, NULL }, +#endif } }; @@ -7487,11 +7812,19 @@ int Multi_sync_bitmap; // the background bitmap #define MS_LAUNCH 4 ui_button_info Multi_sync_buttons[GR_NUM_RESOLUTIONS][MULTI_SYNC_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("MS_00", 0, 396, -1, -1, 0), + ui_button_info("MS_01", 0, 435, -1, -1, 1), + ui_button_info("MS_02", 496, 411, -1, -1, 2), + ui_button_info("MS_04", 436, 403, -1, -1, 4), + ui_button_info("MS_03", 556, 398, -1, -1, 3), +#else ui_button_info("MS_00", 1, 404, -1, -1, 0), ui_button_info("MS_01", 1, 446, -1, -1, 1), ui_button_info("MS_03", 518, 426, 519, 416, 3), ui_button_info("MS_02", 469, 426, 479, 416, 2), ui_button_info("MS_04", 571, 420, 577, 416, 4), +#endif }, { // GR_1024 ui_button_info("2_MS_00", 2, 647, -1, -1, 0), @@ -7503,23 +7836,33 @@ ui_button_info Multi_sync_buttons[GR_NUM_RESOLUTIONS][MULTI_SYNC_NUM_BUTTONS] = }; // text +#ifdef MAKE_FS1 +#define MULTI_SYNC_NUM_TEXT 0 +#else #define MULTI_SYNC_NUM_TEXT 5 +#endif #define MST_KICK 0 #define MST_LAUNCH 2 UI_XSTR Multi_sync_text[GR_NUM_RESOLUTIONS][MULTI_SYNC_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Kick", 1266, 479, 416, UI_XSTR_COLOR_PINK, -1, &Multi_sync_buttons[0][MS_KICK].button }, { "Cancel", 387, 519, 416, UI_XSTR_COLOR_PINK, -1, &Multi_sync_buttons[0][MS_CANCEL].button }, { "Launch", 801, 577, 416, UI_XSTR_COLOR_PINK, -1, &Multi_sync_buttons[0][MS_LAUNCH].button }, { "Players", 1269, 23, 133, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Status", 1304, 228, 133, UI_XSTR_COLOR_GREEN, -1, NULL } +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Kick", 1266, 766, 667, UI_XSTR_COLOR_PINK, -1, &Multi_sync_buttons[1][MS_KICK].button }, { "Cancel", 387, 831, 667, UI_XSTR_COLOR_PINK, -1, &Multi_sync_buttons[1][MS_CANCEL].button }, { "Launch", 801, 924, 667, UI_XSTR_COLOR_PINK, -1, &Multi_sync_buttons[1][MS_LAUNCH].button }, { "Players", 1269, 38, 214, UI_XSTR_COLOR_GREEN, -1, NULL }, { "Status", 1304, 366, 214, UI_XSTR_COLOR_GREEN, -1, NULL } +#endif } }; @@ -8780,8 +9123,10 @@ void multi_sync_create_launch_button() // hotkey Multi_sync_buttons[gr_screen.res][MS_LAUNCH].button.set_hotkey(KEY_CTRLED+KEY_ENTER); +#ifndef MAKE_FS1 // create the text for the button Multi_sync_window.add_XSTR(&Multi_sync_text[gr_screen.res][MST_LAUNCH]); +#endif // increment the button count so we start checking this one Multi_sync_button_count++; @@ -9279,7 +9624,11 @@ static char *Multi_pwd_bitmap_mask_fname[GR_NUM_RESOLUTIONS] = { // password area defs int Mpwd_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 147, 114, 343, 13 +#else 134, 112, 367, 15 +#endif }, { // GR_1024 215, 190, 587, 24 @@ -9296,8 +9645,13 @@ int Multi_passwd_running = 0; // password buttons ui_button_info Multi_pwd_buttons[GR_NUM_RESOLUTIONS][MULTI_PWD_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("PWB_00", 402, 134, -1, -1, 0), + ui_button_info("PWB_01", 450, 134, -1, -1, 1), +#else ui_button_info("PWB_00", 411, 151, 405, 141, 0), ui_button_info("PWB_01", 460, 151, 465, 141, 1), +#endif }, { // GR_1024 ui_button_info("2_PWB_00", 659, 242, 649, 225, 0), @@ -9306,17 +9660,27 @@ ui_button_info Multi_pwd_buttons[GR_NUM_RESOLUTIONS][MULTI_PWD_NUM_BUTTONS] = { }; // text +#ifdef MAKE_FS1 +#define MULTI_PWD_NUM_TEXT 0 +#else #define MULTI_PWD_NUM_TEXT 3 +#endif UI_XSTR Multi_pwd_text[GR_NUM_RESOLUTIONS][MULTI_PWD_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 { "Cancel", 387, 400, 141, UI_XSTR_COLOR_GREEN, -1, &Multi_pwd_buttons[0][MPWD_CANCEL].button}, { "Commit", 1062, 455, 141, UI_XSTR_COLOR_GREEN, -1, &Multi_pwd_buttons[0][MPWD_COMMIT].button}, { "Enter Password", 1332, 149, 92, UI_XSTR_COLOR_GREEN, -1, NULL}, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 { "Cancel", 387, 649, 225, UI_XSTR_COLOR_GREEN, -1, &Multi_pwd_buttons[1][MPWD_CANCEL].button}, { "Commit", 1062, 736, 225, UI_XSTR_COLOR_GREEN, -1, &Multi_pwd_buttons[1][MPWD_COMMIT].button}, { "Enter Password", 1332, 239, 148, UI_XSTR_COLOR_GREEN, -1, NULL}, +#endif } }; diff --git a/src/network/multiutil.cpp b/src/network/multiutil.cpp index b7a6576..c048d00 100644 --- a/src/network/multiutil.cpp +++ b/src/network/multiutil.cpp @@ -15,6 +15,9 @@ * C file that contains misc. functions to support multiplayer * * $Log$ + * Revision 1.9 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.8 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -2563,8 +2566,10 @@ void multi_process_valid_join_request(join_request *jr, net_addr_t *who_from, in } // copy his pilot squad filename +#ifndef MAKE_FS1 Net_players[net_player_num].player->insignia_texture = -1; player_set_squad_bitmap(Net_players[net_player_num].player, jr->squad_filename); +#endif // clear his multi_data info multi_data_handle_join(net_player_num); @@ -2579,11 +2584,13 @@ void multi_process_valid_join_request(join_request *jr, net_addr_t *who_from, in Net_players[net_player_num].tracker_player_id = jr->tracker_id; // store pxo info +#ifndef MAKE_FS1 if(strlen(jr->pxo_squad_name) > 0){ strcpy(Net_players[net_player_num].p_info.pxo_squad_name, jr->pxo_squad_name); } else { strcpy(Net_players[net_player_num].p_info.pxo_squad_name, ""); } +#endif // if he's using hacked data if(jr->flags & JOIN_FLAG_HAXOR){ @@ -2609,8 +2616,10 @@ void multi_process_valid_join_request(join_request *jr, net_addr_t *who_from, in } // copy his pilot squad filename +#ifndef MAKE_FS1 Net_players[net_player_num].player->insignia_texture = -1; player_set_squad_bitmap(Net_players[net_player_num].player, jr->squad_filename); +#endif // clear his multi_data info multi_data_handle_join(net_player_num); @@ -2625,11 +2634,13 @@ void multi_process_valid_join_request(join_request *jr, net_addr_t *who_from, in Net_players[net_player_num].player_id = id_num; // store pxo info +#ifndef MAKE_FS1 if(strlen(jr->pxo_squad_name) > 0){ strcpy(Net_players[net_player_num].p_info.pxo_squad_name, jr->pxo_squad_name); } else { strcpy(Net_players[net_player_num].p_info.pxo_squad_name, ""); } +#endif // if he's using hacked data if(jr->flags & JOIN_FLAG_HAXOR){ diff --git a/src/object/collidedebrisship.cpp b/src/object/collidedebrisship.cpp index 83ea93e..3bb0356 100644 --- a/src/object/collidedebrisship.cpp +++ b/src/object/collidedebrisship.cpp @@ -15,6 +15,9 @@ * Routines to detect collisions and do physics, damage, etc for ships and debris * * $Log$ + * Revision 1.6 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/18 08:58:53 relnev * last few struct changes * @@ -315,7 +318,7 @@ int collide_debris_ship( obj_pair * pair ) // Returns 1 if all future collisions between these can be ignored int collide_asteroid_ship( obj_pair * pair ) { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) if (!Asteroids_enabled) return 0; diff --git a/src/object/collidedebrisweapon.cpp b/src/object/collidedebrisweapon.cpp index fe6c716..3f94604 100644 --- a/src/object/collidedebrisweapon.cpp +++ b/src/object/collidedebrisweapon.cpp @@ -15,6 +15,9 @@ * Routines to detect collisions and do physics, damage, etc for weapons and debris * * $Log$ + * Revision 1.3 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.2 2002/06/09 04:41:24 relnev * added copyright header * @@ -110,7 +113,7 @@ int collide_debris_weapon( obj_pair * pair ) // Returns 1 if all future collisions between these can be ignored int collide_asteroid_weapon( obj_pair * pair ) { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) if (!Asteroids_enabled) return 0; diff --git a/src/object/collideshipship.cpp b/src/object/collideshipship.cpp index 6964131..ed75255 100644 --- a/src/object/collideshipship.cpp +++ b/src/object/collideshipship.cpp @@ -15,6 +15,9 @@ * Routines to detect collisions and do physics, damage, etc for ships and ships * * $Log$ + * Revision 1.6 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -1064,7 +1067,7 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vector // returns 1 if modified mass is larger than given mass, 0 otherwise int check_special_cruiser_asteroid_collision(object *heavy, object *light, float *cruiser_mass, int *cruiser_light) { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) int asteroid_type; if (heavy->type == OBJ_ASTEROID) { diff --git a/src/object/objcollide.cpp b/src/object/objcollide.cpp index b0f7e16..ad0a4ce 100644 --- a/src/object/objcollide.cpp +++ b/src/object/objcollide.cpp @@ -16,6 +16,9 @@ * Also keeps track of all the object pairs. * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -243,7 +246,7 @@ #include "multi.h" #include "beam.h" -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_PAIRS 3000 #else #define MAX_PAIRS 8000 // Reduced from 10,000 to 6,000 by MK on 4/1/98. diff --git a/src/osapi/osregistry-unix.cpp b/src/osapi/osregistry-unix.cpp index 19ef9cd..ed0b740 100644 --- a/src/osapi/osregistry-unix.cpp +++ b/src/osapi/osregistry-unix.cpp @@ -11,16 +11,30 @@ #include char *Osreg_company_name = "Volition"; +#if defined(MAKE_FS1) +char *Osreg_class_name = "FreespaceClass"; +#else char *Osreg_class_name = "Freespace2Class"; -#if defined(FS2_DEMO) +#endif +#if defined(FS1_DEMO) +char *Osreg_app_name = "FreeSpaceDemo"; +char *Osreg_title = "Freespace Demo"; +char *Osreg_user_dir = ".freespace_demo"; +#define PROFILE_NAME "FreeSpaceDemo.ini" +#elif defined(FS2_DEMO) char *Osreg_app_name = "FreeSpace2Demo"; char *Osreg_title = "Freespace 2 Demo"; -char *Osreg_user_dir = ".freespace_demo"; +char *Osreg_user_dir = ".freespace2_demo"; #define PROFILE_NAME "FreeSpace2Demo.ini" #elif defined(OEM_BUILD) char *Osreg_app_name = "FreeSpace2OEM"; char *Osreg_title = "Freespace 2 OEM"; #define PROFILE_NAME "FreeSpace2OEM.ini" +#elif defined(MAKE_FS1) +char *Osreg_app_name = "FreeSpace"; +char *Osreg_title = "FreeSpace"; +char *Osreg_user_dir = ".freespace"; +#define PROFILE_NAME "FreeSpace.ini" #else char *Osreg_app_name = "FreeSpace2"; char *Osreg_title = "Freespace 2"; diff --git a/src/parse/encrypt.cpp b/src/parse/encrypt.cpp index 901702a..b1be834 100644 --- a/src/parse/encrypt.cpp +++ b/src/parse/encrypt.cpp @@ -15,6 +15,9 @@ * Module for encryption code common to FreeSpace and related tools * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:25 relnev * added copyright header * @@ -61,7 +64,9 @@ #include #include -#define ENCRYPT_NEW // new, better encryption scheme +#ifndef MAKE_FS1 + #define ENCRYPT_NEW // new, better encryption scheme +#endif #include "pstypes.h" #include "encrypt.h" diff --git a/src/parse/parselo.cpp b/src/parse/parselo.cpp index 6de6166..bc76770 100644 --- a/src/parse/parselo.cpp +++ b/src/parse/parselo.cpp @@ -15,6 +15,9 @@ * low level parse routines common to all types of parsers * * $Log$ + * Revision 1.7 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.6 2002/06/17 06:15:25 relnev * ryan's struct patch (and cr removal) * @@ -292,6 +295,11 @@ int get_line_num() incomment = 0; } +#ifdef MAKE_FS1 + if ( !incomment && (*p == '/') && (*(p+1) == '/') ) + incomment = 1; +#endif + if (*p++ == EOLN) { if ( !multiline && incomment ) incomment = 0; @@ -940,6 +948,13 @@ int strip_comments(char *readp, int in_comment) return in_comment; } +#ifdef MAKE_FS1 + if (!in_comment && (*readp == '/') && (*(readp+1) == '/')) { + *writep = 0; + return in_comment; + } +#endif + if (!in_comment) { // time to do some special foreign character conversion switch (ch) { @@ -1057,13 +1072,13 @@ int strip_comments(char *readp, int in_comment) return in_comment; } -#if 0 +#ifdef MAKE_FS1 void strip_all_comments( char *readp, char *writep ) { int ch; //char *writep = readp; - while ( *readp != EOF_CHAR ) { + while ( *readp && *readp != EOF_CHAR ) { ch = *readp; if ( ch == COMMENT_CHAR ) { while ( *readp != EOLN ) @@ -1089,7 +1104,7 @@ void strip_all_comments( char *readp, char *writep ) } } else { *writep = (char)ch; - *writep++; + writep++; readp++; } } @@ -1180,7 +1195,11 @@ void read_file_text(char *filename, int mode) int num_chars_read = 0; +#ifndef MAKE_FS1 mp2 = Mission_text_raw; +#else + strip_all_comments(Mission_text_raw, mp2); +#endif while ( (num_chars_read = parse_get_line(outbuf, BUF_SIZE, Mission_text_raw, file_len, mp2)) != 0 ) { mp2 += num_chars_read; diff --git a/src/parse/sexp.cpp b/src/parse/sexp.cpp index 1abd87f..db9cc5e 100644 --- a/src/parse/sexp.cpp +++ b/src/parse/sexp.cpp @@ -15,6 +15,9 @@ * main sexpression generator * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/17 06:15:25 relnev * ryan's struct patch (and cr removal) * @@ -4711,10 +4714,13 @@ void sexp_end_campaign( int n ) { // post and event to move us to the end-of-campaign state. There we will play a movie, then // go to debriefing. - // gameseq_post_event( GS_EVENT_END_CAMPAIGN ); - +#ifdef MAKE_FS1 + // needed to actually end the game + gameseq_post_event( GS_EVENT_END_CAMPAIGN ); +#else // in FS2 our ending is a bit wacky. we'll just flag the mission as having ended the campaign Campaign_ended_in_mission = 1; +#endif } // sabotage subsystem reduces the strength of a subsystem by the given percentage. If it is reduced to diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index a62764f..4dbd034 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -15,6 +15,9 @@ * Code for particle system * * $Log$ + * Revision 1.6 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/17 06:33:10 relnev * ryan's struct patch for gcc 2.95 * @@ -206,7 +209,7 @@ typedef struct particle { ubyte reverse; // play any animations in reverse } particle; -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_PARTICLES 500 #else #define MAX_PARTICLES 2000 // Reduced from 2000 to 800 by MK on 4/1/98. Most I ever saw was 400 and the system recovers diff --git a/src/playerman/managepilot.cpp b/src/playerman/managepilot.cpp index 2c645f2..eada09d 100644 --- a/src/playerman/managepilot.cpp +++ b/src/playerman/managepilot.cpp @@ -16,6 +16,9 @@ * manage the pilot * * $Log$ + * Revision 1.5 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.4 2002/06/09 04:41:25 relnev * added copyright header * @@ -230,9 +233,20 @@ #include "bmpman.h" // update this when altering data that is read/written to .PLR file -#define CURRENT_PLAYER_FILE_VERSION 140 +#ifndef MAKE_FS1 +#define CURRENT_PLAYER_FILE_VERSION 140 +#else +// 141: add more FS1 detail settings +// 142: HUD config settings (brightness) +#define CURRENT_PLAYER_FILE_VERSION 142 +#define PREVIOUS_PLAYER_FILE_VERSION 140 +#endif #define FS2_DEMO_PLAYER_FILE_VERSION 135 +#ifndef MAKE_FS1 #define LOWEST_COMPATIBLE_PLAYER_FILE_VERSION CURRENT_PLAYER_FILE_VERSION // demo plr files should work in final +#else +#define LOWEST_COMPATIBLE_PLAYER_FILE_VERSION PREVIOUS_PLAYER_FILE_VERSION +#endif // keep track of pilot file changes here // version 2 : Added squad logo filename @@ -653,12 +667,16 @@ int read_pilot_file(char *callsign, int single, player *p) HUD_config.num_msg_window_lines = cfread_ubyte(file); HUD_config.rp_flags = cfread_int(file); HUD_config.rp_dist = cfread_int(file); - // HUD_config.color = cfread_int( file ); - // HUD_color_alpha = cfread_int( file ); - // if ( HUD_color_alpha < HUD_COLOR_ALPHA_USER_MIN ) { - // HUD_color_alpha = HUD_COLOR_ALPHA_DEFAULT; - // } - // hud_config_record_color(HUD_config.color); +#ifdef MAKE_FS1 + if(Player_file_version >= 142){ + HUD_config.main_color = cfread_int(file); + HUD_color_alpha = cfread_int(file); + } + if ( HUD_color_alpha < HUD_COLOR_ALPHA_USER_MIN ) { + HUD_color_alpha = HUD_COLOR_ALPHA_DEFAULT; + } + hud_config_record_color(HUD_config.main_color); +#endif // added 2 gauges with version 137 if(Player_file_version < 137){ @@ -691,7 +709,16 @@ int read_pilot_file(char *callsign, int single, player *p) Event_music_enabled = 0; } +#ifdef MAKE_FS1 + // add in extra detail settings + if(Player_file_version < 141){ + cfread( &Detail, sizeof(detail_levels) - sizeof(Detail.engine_glows), 1, file ); + } else { + cfread( &Detail, sizeof(detail_levels), 1, file ); + } +#else cfread( &Detail, sizeof(detail_levels), 1, file ); +#endif // restore list of most recently played missions Num_recent_missions = cfread_int( file ); @@ -942,8 +969,10 @@ int write_pilot_file_core(player *p) cfwrite_ubyte( (ubyte) HUD_config.num_msg_window_lines, file ); cfwrite_int( HUD_config.rp_flags, file ); cfwrite_int( HUD_config.rp_dist, file ); - // cfwrite_int( HUD_config.color, file ); - // cfwrite_int( HUD_color_alpha, file ); +#ifdef MAKE_FS1 + cfwrite_int( HUD_config.main_color, file ); + cfwrite_int( HUD_color_alpha, file ); +#endif for(idx=0; idxinstance]; cargo_sip = &Ship_info[cargo_sp->ship_info_index]; +#ifndef MAKE_FS1 + // causes a FS1 mission not to finish since the subsytems and not + // the ship are scanned if (cargo_sip->flags & SIF_HUGE_SHIP) { return player_inspect_cap_subsys_cargo(frametime, outstr); } +#endif // check if target is ship class that can be inspected // MWA -- 1/27/98 -- added fighters/bombers to this list. For multiplayer, we diff --git a/src/popup/popup.cpp b/src/popup/popup.cpp index a4fa16e..5b7f88a 100644 --- a/src/popup/popup.cpp +++ b/src/popup/popup.cpp @@ -15,6 +15,9 @@ * Code for displaying pop-up dialog boxes * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:25 relnev * added copyright header * @@ -218,10 +221,12 @@ int Popup_max_display[GR_NUM_RESOLUTIONS] = { 19 }; +#ifndef MAKE_FS1 // to avoid trying to find the interface tool char *Popup_slider_name[GR_NUM_RESOLUTIONS] = { "slider", "2_slider" }; +#endif int Popup_slider_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 @@ -262,12 +267,18 @@ UI_WINDOW Popup_window; UI_BUTTON Popup_buttons[POPUP_MAX_CHOICES]; // actual lit buttons UI_BUTTON Popup_button_regions[POPUP_MAX_CHOICES]; // fake buttons used for mouse detection over text UI_INPUTBOX Popup_input; // input box for the popup +#ifndef MAKE_FS1 UI_SLIDER2 Popup_slider; // if we have more text in the popup than can be displayed at once +#endif // extents for message portion of popup int Popup_text_coords[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + 154, 144, 331, 105 +#else 137, 106, 343, 113 +#endif }, { // GR_1024 219, 169, 558, 182 @@ -305,11 +316,19 @@ static int Popup_flags; static int Title_coords[GR_NUM_RESOLUTIONS][5] = { { // GR_640 +#ifdef MAKE_FS1 + 154, // x-left + 144, // y-top + 331, // width + 26, // height + 320 // center +#else 137, // x-left 106, // y-top 343, // width 26, // height 308 // center +#endif }, { // GR_1024 220, // x-left @@ -322,9 +341,15 @@ static int Title_coords[GR_NUM_RESOLUTIONS][5] = static int Button_regions[GR_NUM_RESOLUTIONS][3][4] = { { // GR_640 +#ifdef MAKE_FS1 + {464, 269, 505, 290}, // upper right pixel of text, lower right pixel of button + {464, 297, 505, 320}, + {464, 323, 505, 342} +#else {464, 232, 510, 250}, // upper right pixel of text, lower right pixel of button {464, 262, 510, 279}, {464, 292, 510, 308} +#endif }, { // GR_1024 {752, 373, 806, 406}, // upper right pixel of text, lower right pixel of button @@ -336,9 +361,15 @@ static int Button_regions[GR_NUM_RESOLUTIONS][3][4] = { static int Button_coords[GR_NUM_RESOLUTIONS][3][2] = { { // GR_640 +#ifdef MAKE_FS1 + {474, 257}, // upper left pixel + {474, 291}, + {474, 318} +#else {474, 224}, // upper left pixel {474, 258}, {474, 286} +#endif }, { // GR_1024 {758, 358}, // upper left pixel @@ -350,9 +381,15 @@ static int Button_coords[GR_NUM_RESOLUTIONS][3][2] = static popup_background Popup_background[GR_NUM_RESOLUTIONS][4] = { { // GR_640 +#ifdef MAKE_FS1 + {"Pop2a", 131, 122}, + {"Pop2a", 131, 122}, + {"Pop3", 131, 122}, +#else {"Pop2", 129, 99}, {"Pop2", 129, 99}, {"Pop3", 129, 99}, +#endif }, { // GR_1024 {"2_Pop2", 206, 158}, @@ -369,6 +406,19 @@ static popup_background Popup_background[GR_NUM_RESOLUTIONS][4] = static char *Popup_button_filenames[GR_NUM_RESOLUTIONS][2][5] = { { // GR_640 +#ifdef MAKE_FS1 + {"Pop2a_00", // negative + "Pop2a_01", // positive + "Pop2a_02", // first generic + "Pop2a_03", // second generic + "Pop2a_04"}, // third generic + + {"Pop2a_00", // negative + "Pop2a_01", // positive + "PopD_00", // first generic + "PopD_01", // second generic + "PopD_02"}, // third generic +#else {"Pop_00", // negative "Pop_01", // positive "Pop_02", // first generic @@ -380,6 +430,7 @@ static char *Popup_button_filenames[GR_NUM_RESOLUTIONS][2][5] = "PopD_00", // first generic "PopD_01", // second generic "PopD_02"}, // third generic +#endif }, { // GR_1024 {"2_Pop_00", // negative @@ -719,9 +770,11 @@ int popup_init(popup_info *pi, int flags) popup_split_lines(pi, flags); +#ifndef MAKE_FS1 // create the popup slider (which we may not need to use Popup_slider.create(&Popup_window, Popup_slider_coords[gr_screen.res][0], Popup_slider_coords[gr_screen.res][1], Popup_slider_coords[gr_screen.res][2], Popup_slider_coords[gr_screen.res][3], pi->nlines > Popup_max_display[gr_screen.res] ? pi->nlines - Popup_max_display[gr_screen.res] : 0, Popup_slider_name[gr_screen.res], popup_slider_bogus, popup_slider_bogus, NULL); +#endif return 0; } @@ -828,8 +881,12 @@ int popup_calc_starting_index(popup_info *pi) return 0; } +#ifndef MAKE_FS1 // otherwise, we want to see what item index the slider is on return Popup_slider.get_currentItem(); +#else + return 0; +#endif } // Figure out the y-coord to start drawing the popup text. The text diff --git a/src/popup/popupdead.cpp b/src/popup/popupdead.cpp index 39771dc..0fb7767 100644 --- a/src/popup/popupdead.cpp +++ b/src/popup/popupdead.cpp @@ -15,6 +15,9 @@ * C module for the death popup * * $Log$ + * Revision 1.4 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:25 relnev * added copyright header * @@ -114,10 +117,18 @@ #define POPUPDEAD_NUM_CHOICES 3 // normal +#ifdef MAKE_FS1 +#define POPUPDEAD_NUM_CHOICES_RA 3 // Theres on 3 possible in FS1 +#else #define POPUPDEAD_NUM_CHOICES_RA 4 // red alert +#endif #define POPUPDEAD_NUM_CHOICES_SKIP 3 // skip mission menu +#ifdef MAKE_FS1 +#define POPUPDEAD_NUM_CHOICES_MAX 3 +#else #define POPUPDEAD_NUM_CHOICES_MAX 4 +#endif #include "ui.h" #include "key.h" @@ -140,32 +151,48 @@ UI_BUTTON Popupdead_button_regions[POPUPDEAD_NUM_CHOICES_MAX]; // fake buttons u int Popupdead_region_coords[GR_NUM_RESOLUTIONS][POPUPDEAD_NUM_CHOICES_MAX][4] = { { // GR_640 +#ifdef MAKE_FS1 + {464, 402, 505, 421}, // upper right pixel of text, lower right pixel of button (for tiny popup) + {464, 422, 505, 442}, + {464, 442, 505, 462}, +#else {464, 389, 497, 403}, // upper right pixel of text, lower right pixel of button (for tiny popup) {464, 413, 497, 427}, {464, 435, 497, 446}, {464, 457, 497, 466}, +#endif }, { // GR_1024 {745, 627, 809, 664}, {745, 663, 809, 700}, // upper right pixel of text, lower right pixel of button (for tiny popup) {745, 699, 809, 736}, +#ifndef MAKE_FS1 {745, 735, 809, 772}, +#endif }, }; int Popupdead_button_coords[GR_NUM_RESOLUTIONS][POPUPDEAD_NUM_CHOICES_MAX][2] = { { // GR_640 +#ifdef MAKE_FS1 + {474, 394}, // upper left pixel (tiny popup) + {474, 415}, + {474, 435}, +#else {478, 387}, // upper left pixel (tiny popup) {478, 410}, {478, 432}, {478, 455}, +#endif }, { // GR_1024 {760, 620}, // upper left pixel (tiny popup) {760, 656}, {760, 692}, +#ifndef MAKE_FS1 {760, 728}, +#endif } }; @@ -190,13 +217,17 @@ char *Popupdead_button_filenames[GR_NUM_RESOLUTIONS][POPUPDEAD_NUM_CHOICES_MAX] "PopD_00", // first choice "PopD_01", // second choice "PopD_02", // third choice +#ifndef MAKE_FS1 "PopD_03", // fourth choice +#endif }, { // GR_1024 "2_PopD_00", // first choice "2_PopD_01", // second choice "2_PopD_02", // third choice +#ifndef MAKE_FS1 "2_PopD_03", // fourth choice +#endif } }; @@ -258,7 +289,9 @@ void popupdead_start() Popupdead_button_text[0] = XSTR( "Quick Start Mission", 105); Popupdead_button_text[1] = XSTR( "Return To Flight Deck", 106); Popupdead_button_text[2] = XSTR( "Return To Briefing", 107); +#ifndef MAKE_FS1 Popupdead_button_text[3] = XSTR( "Replay previous mission", 1432); +#endif Popupdead_num_choices = POPUPDEAD_NUM_CHOICES_RA; } else { Popupdead_button_text[0] = XSTR( "Quick Start Mission", 105); diff --git a/src/ship/aicode.cpp b/src/ship/aicode.cpp index ca60fb1..4f6f5a3 100644 --- a/src/ship/aicode.cpp +++ b/src/ship/aicode.cpp @@ -15,6 +15,9 @@ * AI code that does interesting stuff * * $Log$ + * Revision 1.7 2003/05/25 02:30:43 taylor + * Freespace 1 support + * * Revision 1.6 2002/07/13 19:47:02 theoddone33 * Fix some more warnings * @@ -2868,7 +2871,7 @@ int get_nearest_turret_objnum(int turret_parent_objnum, ship_subsys *turret_subs } -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) asteroid_obj *ao; // Asteroid_obj_list for( ao = GET_FIRST(&Asteroid_obj_list); ao != END_OF_LIST(&Asteroid_obj_list); ao = GET_NEXT(ao) ) { diff --git a/src/ship/ship.cpp b/src/ship/ship.cpp index c742d13..eef4be1 100644 --- a/src/ship/ship.cpp +++ b/src/ship/ship.cpp @@ -15,6 +15,9 @@ * Ship (and other object) handling functions * * $Log$ + * Revision 1.6 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.5 2002/06/17 06:33:11 relnev * ryan's struct patch for gcc 2.95 * @@ -728,7 +731,7 @@ #include "staticrand.h" #include "missionshipchoice.h" -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) #define MAX_SHIP_SUBOBJECTS 360 #else #define MAX_SHIP_SUBOBJECTS 700 // Reduced from 1000 to 400 by MK on 4/1/98. @@ -1496,6 +1499,7 @@ int parse_ship() sip->flags |= SIF_STEALTH; } +#ifndef MAKE_FS1 // parse contrail info char trail_name[MAX_FILENAME_LEN] = ""; trail_info *ci; @@ -1532,6 +1536,7 @@ int parse_ship() stuff_string(trail_name, F_NAME, NULL); ci->bitmap = bm_load(trail_name); } +#endif while (cont_flag) { int r = required_string_3("#End", "$Subsystem:", "$Name" ); @@ -1673,15 +1678,20 @@ void parse_shiptbl() read_file_text("ships.tbl"); reset_parse(); +#ifndef MAKE_FS1 // parse default ship required_string("#Default Player Ship"); required_string("$Name:"); stuff_string(default_player_ship, F_NAME, NULL, 254); required_string("#End"); +#endif +#ifndef MAKE_FS1 Num_engine_wash_types = 0; +#endif Num_ship_types = 0; +#ifndef MAKE_FS1 required_string("#Engine Wash Info"); while (required_string_either("#End", "$Name:")) { Assert( Num_engine_wash_types < MAX_ENGINE_WASH_TYPES ); @@ -1691,6 +1701,7 @@ void parse_shiptbl() } required_string("#End"); +#endif required_string("#Ship Classes"); while (required_string_either("#End","$Name:")) { @@ -9276,7 +9287,7 @@ DCF(art, "") } void ship_update_artillery_lock() { -#if defined(MULTIPLAYER_BETA_BUILD) || defined(FS2_DEMO) +#if defined(MULTIPLAYER_BETA_BUILD) || defined(FS2_DEMO) || defined(FS1_DEMO) return; #else ai_info *aip = NULL; diff --git a/src/ship/shipfx.cpp b/src/ship/shipfx.cpp index df572a1..9f74325 100644 --- a/src/ship/shipfx.cpp +++ b/src/ship/shipfx.cpp @@ -15,6 +15,9 @@ * Routines for ship effects (as in special) * * $Log$ + * Revision 1.6 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.5 2002/09/04 01:12:11 relnev * changes to screen backup/mouse drawing code. removed a few warnings. * @@ -2224,13 +2227,13 @@ static void maybe_fireball_wipe(clip_ship* half_ship, int* sound_handle) pe.pos = model_clip_plane_pt; // Where the particles emit from pe.vel = half_ship->phys_info.vel; // Initial velocity of all the particles -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) float range = 1.0f + 0.002f*half_ship->parent_obj->radius * 5.0f; #else float range = 1.0f + 0.002f*half_ship->parent_obj->radius; #endif -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) pe.min_life = 2.0f*range; // How long the particles live pe.max_life = 10.0f*range; // How long the particles live #else @@ -2242,7 +2245,7 @@ static void maybe_fireball_wipe(clip_ship* half_ship, int* sound_handle) pe.min_vel = 0.0f; // How fast the slowest particle can move pe.max_vel = half_ship->explosion_vel; // How fast the fastest particle can move -#ifdef FS2_DEMO +#if defined(FS2_DEMO) || defined(FS1_DEMO) float scale = half_ship->parent_obj->radius * 0.02f; #else float scale = half_ship->parent_obj->radius * 0.01f; diff --git a/src/starfield/nebula.cpp b/src/starfield/nebula.cpp index 78e1456..05bc3ca 100644 --- a/src/starfield/nebula.cpp +++ b/src/starfield/nebula.cpp @@ -15,6 +15,9 @@ * Code to load & display nebulas * * $Log$ + * Revision 1.7 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.6 2002/06/17 06:33:11 relnev * ryan's struct patch for gcc 2.95 * @@ -303,12 +306,15 @@ void nebula_render() // int r, g, b; // no nebula for you! +#ifndef MAKE_FS1 return; +#endif if ( !Nebula_loaded ) { return; } + // in FS1 this is nebula on/off if ( !Detail.planets_suns ) { return; } diff --git a/src/starfield/starfield.cpp b/src/starfield/starfield.cpp index cf13d07..47933ac 100644 --- a/src/starfield/starfield.cpp +++ b/src/starfield/starfield.cpp @@ -16,6 +16,9 @@ * debris, etc. * * $Log$ + * Revision 1.7 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.6 2002/06/22 23:57:39 relnev * remove writable strings. * @@ -489,7 +492,9 @@ void stars_init() strcpy(debris_vclips_nebula[count++].name, filename); } } +#ifndef MAKE_FS1 // string not used in FS1 Assert(count == 4); +#endif } // call this in game_post_level_init() so we know whether we're running in full nebula mode or not @@ -538,6 +543,7 @@ void stars_level_init() last_stars_filled = 0; +#ifndef MAKE_FS1 // some FS1 missions don't have a sun // if we have no sun instances, create one if(Num_suns <= 0){ mprintf(("Adding default sun\n")); @@ -554,6 +560,7 @@ void stars_level_init() // one sun Num_suns = 1; } +#endif } @@ -701,7 +708,9 @@ extern float Viewer_zoom; void stars_get_sun_pos(int sun_n, vector *pos) { vector temp; +#ifndef MAKE_FS1 matrix rot; +#endif // sanity Assert(sun_n < Num_suns); @@ -714,8 +723,13 @@ void stars_get_sun_pos(int sun_n, vector *pos) temp.xyz.z = 1.0f; // rotation matrix +#ifdef MAKE_FS1 + // we aleady know what the matrix is so just rotate + vm_vec_rotate(pos, &temp, &Suns[sun_n].m); +#else vm_angles_2_matrix(&rot, &Suns[sun_n].ang); vm_vec_rotate(pos, &temp, &rot); +#endif } // draw sun @@ -759,7 +773,12 @@ void stars_draw_sun( int show_sun ) // draw the sun itself, keep track of how many we drew gr_set_bitmap(bm->bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.999f); g3_rotate_faraway_vertex(&sun_vex, &sun_pos); +#ifdef MAKE_FS1 + // divide by 10 to make normal size + if(!g3_draw_bitmap(&sun_vex, 0, 0.05f * (Suns[idx].scale_x / 10) * local_scale, TMAP_FLAG_TEXTURED)){ +#else if(!g3_draw_bitmap(&sun_vex, 0, 0.05f * Suns[idx].scale_x * local_scale, TMAP_FLAG_TEXTURED)){ +#endif Sun_drew++; } } @@ -802,7 +821,12 @@ void stars_draw_sun_glow(int sun_n) // draw the sun itself, keep track of how many we drew gr_set_bitmap(bm->glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.5f); g3_rotate_faraway_vertex(&sun_vex, &sun_pos); +#ifdef MAKE_FS1 + // divide by 10 to make normal size + g3_draw_bitmap(&sun_vex, 0, 0.10f * (Suns[sun_n].scale_x / 10) * local_scale, TMAP_FLAG_TEXTURED); +#else g3_draw_bitmap(&sun_vex, 0, 0.10f * Suns[sun_n].scale_x * local_scale, TMAP_FLAG_TEXTURED); +#endif } // draw bitmaps diff --git a/src/stats/medals.cpp b/src/stats/medals.cpp index b8b7e7a..61c50ab 100644 --- a/src/stats/medals.cpp +++ b/src/stats/medals.cpp @@ -13,6 +13,9 @@ * $Author$ * * $Log$ + * Revision 1.8 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.7 2002/06/09 04:41:27 relnev * added copyright header * @@ -177,6 +180,7 @@ #include "gamesnd.h" #include "alphacolors.h" #include "localize.h" +#include "missionscreencommon.h" // for common_set_interface_palette //#define MAX_MEDAL_TYPES 63 // the # of medals which exist so far @@ -195,12 +199,38 @@ badge_stuff Badge_info[MAX_BADGES]; int Badge_index[MAX_BADGES]; // the rank section of the screen -#define RANK_MEDAL_REGION 12 // region number of the rank medal +#ifdef MAKE_FS1 + // not in Medal_coords but needs to be set + // to not interfere with other medals + #define RANK_MEDAL_REGION 16 // region number of the rank medal +#else + #define RANK_MEDAL_REGION 12 // region number of the rank medal +#endif #warning Find real FS2_DEMO spot for medals // coords for indiv medal bitmaps int Medal_coords[GR_NUM_RESOLUTIONS][NUM_MEDALS][2] = { { // GR_640 +#ifdef MAKE_FS1 + { 108, 74 }, // Conspicuous Gallantry + { 473, 73 }, // Vasudan Alliance + { 146, 150 }, // Distinguished Flying Cross + { 219, 152 }, // Commendation Medal + { 360, 150 }, // Galatea Survivor + { 432, 150 }, // Legion of Merit + { 88, 243 }, // Meritorious Unit + { 168, 243 }, // Medal of Honor + { 248, 250 }, // Galactic Service + { 328, 250 }, // Military Defense + { 406, 244 }, // Good Conduct + { 483, 243 }, // Distinguished Service Cross + { 340, 109 }, // Ace + { 373, 109 }, // Double Ace +#ifndef FS1_DEMO + { 403, 109 }, // Triple Ace +#endif // FS1_DEMO + { 287, 186 }, // Wings +#else { 89, 47 }, // eps. peg. lib { 486, 47 }, // imp. order o' vasuda { 129, 130 }, // dist flying cross @@ -220,7 +250,8 @@ int Medal_coords[GR_NUM_RESOLUTIONS][NUM_MEDALS][2] = { #ifndef FS2_DEMO { 435, 76 }, // gold kills badge { 300, 152 }, // SOC unit crest -#endif +#endif // !FS2_DEMO +#endif // MAKE_FS1 }, { // GR_1024 { 143, 75 }, // eps. peg. lib @@ -239,37 +270,89 @@ int Medal_coords[GR_NUM_RESOLUTIONS][NUM_MEDALS][2] = { { 453, 146 }, // wings { 595, 121 }, // bronze kills badge { 646, 121 }, // silver kills badge -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(MAKE_FS1)) { 696, 121 }, // gold kills badge { 480, 244 }, // SOC unit crest #endif } }; +#ifdef MAKE_FS1 +// coords for the medal/rank title +static int Rank_label_coords[2] = { + 240, 126 // Rank +}; + +static int Rank_coords[2] = { + 208, 113 // Rank +}; + +// I couldn't think of a better way to do this so define +// the base center point for each medal to center the label on +// +// x = the horizontal center point of the bitmap +// y = the base of the medal bitmap itself +static int Medals_label_coords[NUM_MEDALS][2] = { + // x, y + { 137, 158 }, // Conspicuous Gallantry + { 502, 154 }, // Vasudan Alliance + { 176, 238 }, // Distinguished Flying Cross + { 249, 244 }, // Commendation Medal + { 390, 238 }, // Galatea Survivor + { 462, 237 }, // Legion of Merit + { 121, 345 }, // Meritorious Unit + { 199, 346 }, // Medal of Honor + { 280, 349 }, // Galactic Service + { 360, 350 }, // Military Defense + { 438, 349 }, // Good Conduct + { 517, 353 }, // Distinguished Service Cross + { 352, 129 }, // Ace + { 385, 129 }, // Double Ace +#ifndef FS1_DEMO + { 415, 129 }, // Triple Ace +#endif + { 319, 216 }, // Wings +}; +#else // coords for the medal title static int Medals_label_coords[GR_NUM_RESOLUTIONS][3] = { { 241, 458, 300 }, // GR_640 x, y, w { 386, 734, 480 } // GR_1024 x, y, w }; +#endif #define MEDALS_NUM_BUTTONS 1 #define MEDALS_EXIT 0 ui_button_info Medals_buttons[GR_NUM_RESOLUTIONS][MEDALS_NUM_BUTTONS] = { { // GR_640 +#ifdef MAKE_FS1 + ui_button_info("MX_17", 561, 411, -1, -1, 17), +#else ui_button_info("MEB_18", 574, 432, -1, -1, 18), +#endif }, { // GR_1024 ui_button_info("2_MEB_18", 919, 691, -1, -1, 18), } }; -#define MEDALS_NUM_TEXT 1 +#ifdef MAKE_FS1 + #define MEDALS_NUM_TEXT 0 +#else + #define MEDALS_NUM_TEXT 1 +#endif UI_XSTR Medals_text[GR_NUM_RESOLUTIONS][MEDALS_NUM_TEXT] = { { // GR_640 + // not needed for FS1 +#ifndef MAKE_FS1 {"Exit", 1466, 587, 416, UI_XSTR_COLOR_PINK, -1, &Medals_buttons[GR_640][MEDALS_EXIT].button }, +#endif }, { // GR_1024 + // not needed for FS1 +#ifndef MAKE_FS1 {"Exit", 1466, 943, 673, UI_XSTR_COLOR_PINK, -1, &Medals_buttons[GR_1024][MEDALS_EXIT].button }, +#endif }, }; @@ -284,7 +367,11 @@ static char* Medals_mask_filename[GR_NUM_RESOLUTIONS] = { }; static int Medals_callsign_y[GR_NUM_RESOLUTIONS] = { +#ifdef MAKE_FS1 + 79, 89 +#else 54, 89 +#endif }; scoring_struct *Player_score=NULL; @@ -370,7 +457,12 @@ void parse_medal_tbl() Assert( bi < MAX_BADGES ); stuff_int( &Medals[num_medals].kills_needed ); Badge_index[bi] = num_medals; -#ifdef FS2_DEMO +#ifdef MAKE_FS1 + required_string("$Wavefile 1:"); + stuff_string(Badge_info[bi].voice_base, F_NAME, NULL, MAX_FILENAME_LEN); + required_string("$Wavefile 2:"); + stuff_string(Badge_info[bi].voice_base2, F_NAME, NULL, MAX_FILENAME_LEN); +#elif FS2_DEMO #warning FS2_DEMO HACK: Wavefile 1/2: wave1? wave2? required_string("$Wavefile 1:"); stuff_string(Badge_info[bi].voice_base, F_NAME, NULL, MAX_FILENAME_LEN); @@ -415,14 +507,14 @@ void medal_main_init(player *pl, int mode) Player_score = &Medals_player->stats; - #ifndef NDEBUG +#ifndef NDEBUG if(Cmdline_gimme_all_medals){ //int idx; for(idx=0; idx < NUM_MEDALS; idx++){ Medals_player->stats.medals[idx] = 1; } } - #endif +#endif Medals_mode = mode; @@ -453,6 +545,9 @@ void medal_main_init(player *pl, int mode) Init_flags = 0; //init_medal_palette(); +#ifdef MAKE_FS1 + common_set_interface_palette("MedalsPalette"); +#endif Medals_bitmap = bm_load(Medals_background_filename[gr_screen.res]); if (Medals_bitmap < 0) { @@ -484,6 +579,59 @@ void medal_main_init(player *pl, int mode) // which would break stuff void medals_translate_name(char *name, int max_len) { +#ifdef MAKE_FS1 + if (!strcmp(name, "Conspicuous Gallantry")) { + strncpy(name, "Tapferkeitsmedaille", max_len); + + } else if (!strcmp(name, "Vasudan Alliance")) { + strncpy(name, "Vasudanischen Allianz", max_len); + + } else if (!strcmp(name, "Distinguished Flying Cross")) { + strncpy(name, "Kreuz f\x81r Fliegerleistungen", max_len); + + } else if (!strcmp(name, "Commendation Medal")) { + strncpy(name, "Anerkennungsmedaille", max_len); + + } else if (!strcmp(name, "Galatea Survivor")) { + strncpy(name, "Galatea-\x9A""berlebender", max_len); + + } else if (!strcmp(name, "Legion of Merit")) { + strncpy(name, "Verdienstlegion", max_len); + + } else if (!strcmp(name, "Meritorious Unit")) { + strncpy(name, "Verdienstmedaille", max_len); + + } else if (!strcmp(name, "Medal of Honor")) { + strncpy(name, "Ehrenmedaille", max_len); + + } else if (!strcmp(name, "Galactic Service")) { + strncpy(name, "Galaktischer Dienst", max_len); + + } else if (!strcmp(name, "Military Defense")) { + strncpy(name, "Verteidigungsmedaille", max_len); + + } else if (!strcmp(name, "Good Conduct")) { + strncpy(name, "Medaille f\x81r gute F\x81hrung", max_len); + + } else if (!strcmp(name, "Distinguished Service Cross")) { + strncpy(name, "Kreuz f\x81r Einsatz", max_len); + + } else if (!strcmp(name, "Ace")) { + strncpy(name, "Bronzener Stern", max_len); + + } else if (!strcmp(name, "Double Ace")) { + strncpy(name, "Silberner Stern", max_len); + + } else if (!strcmp(name, "Triple Ace")) { + strncpy(name, "Goldener Stern", max_len); + + } else if (!strcmp(name, "Wings")) { + strncpy(name, "Pilotenabzeichen", max_len); + + } else if (!strcmp(name, "Rank")) { + strncpy(name, "Dienstgrad", max_len); + } +#else if (!strcmp(name, "Epsilon Pegasi Liberation")) { strncpy(name, "Epsilon Pegasi Befreiungsmedaille", max_len); @@ -527,20 +675,25 @@ void medals_translate_name(char *name, int max_len) strncpy(name, "Fliegerspange", max_len); } else if (!strcmp(name, "Ace")) { - strncpy(name, "Flieger-As", max_len); + strncpy(name, "Flieger-As", max_len); } else if (!strcmp(name, "Double Ace")) { strncpy(name, "Doppel-As ", max_len); } else if (!strcmp(name, "Triple Ace")) { strncpy(name, "Dreifach-As ", max_len); - + } else if (!strcmp(name, "SOC Unit Crest")) { - strncpy(name, "SEK-Abzeichen ", max_len); + strncpy(name, "SEK-Abzeichen ", max_len); } +#endif } +#ifdef MAKE_FS1 +void blit_label(char *label, int *coordsx, int *coordsy, int num) +#else void blit_label(char *label, int *coords, int num) +#endif { int x, y, sw; char text[256]; @@ -559,7 +712,7 @@ void blit_label(char *label, int *coords, int num) sprintf( text, NOX("%s (%d)"), translated_label, num ); } else { sprintf( text, "%s", translated_label ); - } + } } else { // set correct string if ( num > 1 ) { @@ -571,8 +724,13 @@ void blit_label(char *label, int *coords, int num) // find correct coords gr_get_string_size(&sw, NULL, text); +#ifdef MAKE_FS1 + x = *coordsx - sw / 2; + y = *coordsy + 8; +#else x = Medals_label_coords[gr_screen.res][0] + (Medals_label_coords[gr_screen.res][2] - sw) / 2; y = Medals_label_coords[gr_screen.res][1]; +#endif // do it gr_string(x, y, text); @@ -580,7 +738,11 @@ void blit_label(char *label, int *coords, int num) void blit_callsign() { +#ifdef MAKE_FS1 + gr_set_color_fast(&Color_bright_blue); +#else gr_set_color_fast(&Color_normal); +#endif // nothing special, just do it. gr_string(0x8000, Medals_callsign_y[gr_screen.res], Medals_player->callsign); @@ -632,7 +794,11 @@ int medal_main_do() break; case RANK_MEDAL_REGION : +#ifdef MAKE_FS1 + blit_label(Ranks[Player_score->rank].name, &Rank_label_coords[0], &Rank_label_coords[1], 1); +#else blit_label(Ranks[Player_score->rank].name, &Medal_coords[gr_screen.res][region][0], 1); +#endif break; case -1: @@ -640,7 +806,11 @@ int medal_main_do() default : if (Player_score->medals[region] > 0){ +#ifdef MAKE_FS1 + blit_label(Medals[region].name, &Medals_label_coords[region][0], &Medals_label_coords[region][1], Player_score->medals[region] ); +#else blit_label(Medals[region].name, &Medal_coords[gr_screen.res][region][0], Player_score->medals[region] ); +#endif } break; } // end switch @@ -671,6 +841,11 @@ void medal_main_close() Player_score = NULL; Medals_window.destroy(); + +#ifdef MAKE_FS1 + common_free_interface_palette(); +#endif + snazzy_menu_close(); palette_restore_palette(); } @@ -775,6 +950,9 @@ void blit_medals() // now blit rank, since that "medal" doesnt get loaded (or drawn) the normal way gr_set_bitmap(Rank_bm); +#ifdef MAKE_FS1 + gr_bitmap(Rank_coords[0], Rank_coords[1]); +#else gr_bitmap(Medal_coords[gr_screen.res][RANK_MEDAL_REGION][0], Medal_coords[gr_screen.res][RANK_MEDAL_REGION][1]); +#endif } - diff --git a/src/stats/scoring.cpp b/src/stats/scoring.cpp index 8a913ea..a6b732b 100644 --- a/src/stats/scoring.cpp +++ b/src/stats/scoring.cpp @@ -15,6 +15,9 @@ * Scoring system code, medals, rank, etc. * * $Log$ + * Revision 1.4 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.3 2002/06/09 04:41:27 relnev * added copyright header * @@ -404,7 +407,11 @@ void scoring_eval_rank( scoring_struct *sc ) // if the player does indeed get promoted, we should change his mission score // to reflect the differce between all time and new rank score +#ifdef MAKE_FS1 + if ( sc->rank < MAX_FREESPACE1_RANK ) { +#else if ( sc->rank < MAX_FREESPACE2_RANK ) { +#endif new_rank = sc->rank + 1; if ( (sc->m_score + sc->score) < Ranks[new_rank].points ) sc->m_score = (Ranks[new_rank].points - sc->score); diff --git a/src/ui/gadget.cpp b/src/ui/gadget.cpp index 142851c..db9a972 100644 --- a/src/ui/gadget.cpp +++ b/src/ui/gadget.cpp @@ -15,6 +15,9 @@ * Functions for the base gadget class * * $Log$ + * Revision 1.7 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.6 2002/06/09 04:41:29 relnev * added copyright header * @@ -220,11 +223,14 @@ void UI_GADGET::link_hotspot(int num) int UI_GADGET::set_bmaps(char *ani_fname, int nframes, int start_frame) { int first_frame, i; +#ifndef MAKE_FS1 char full_name[MAX_FILENAME_LEN] = ""; char tmp[10]; - int idx, s_idx; int num_digits; int its_all_good = 0; + int s_idx; +#endif + int idx; // clear out all frames for(idx=0; idxinstance].model_num; -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) case OBJ_ASTEROID: subtype = Asteroids[objp->instance].asteroid_subtype; Assert(Asteroids[objp->instance].type >= 0); diff --git a/src/weapon/weapons.cpp b/src/weapon/weapons.cpp index fbdf877..8b5a6e7 100644 --- a/src/weapon/weapons.cpp +++ b/src/weapon/weapons.cpp @@ -15,6 +15,9 @@ * Code to handle the weapon systems * * $Log$ + * Revision 1.9 2003/05/25 02:30:44 taylor + * Freespace 1 support + * * Revision 1.8 2002/06/21 03:04:12 relnev * nothing important * @@ -658,6 +661,16 @@ int weapon_info_lookup(char *name) { int i; +#ifdef MAKE_FS1 + // fix the stupid table stuff - it's non-fatal but annoying error messages + if (!strcmp(name, "Disruptor Missile")) { + strncpy(name, "D-Missile", MAX_FILENAME_LENGTH); + // this one fixes the same issue with a SilentThreat mission + } else if (!strcmp(name, "Shield Breaker")) { + strncpy(name, "S-Breaker", MAX_FILENAME_LENGTH); + } +#endif + for (i=0; iwi_flags |= WIF_STREAM; else if (!stricmp(NOX("supercap"), weapon_strings[i])) weaponp->wi_flags |= WIF_SUPERCAP; +#ifdef MAKE_FS1 + else if (!stricmp(NOX("Swarm"), weapon_strings[i])) + weaponp->wi_flags |= WIF_SWARM; + else if (!stricmp(NOX("No Ship"), weapon_strings[i])) + weaponp->wi_flags |= WIF_CHILD; +#endif else Warning(LOCATION, "Bogus string in weapon flags: %s\n", weapon_strings[i]); } @@ -1073,6 +1092,7 @@ int parse_weapon() char trail_name[MAX_FILENAME_LEN] = ""; trail_info *ti = &wip->tr_info; memset(ti, 0, sizeof(trail_info)); +#ifndef MAKE_FS1 if(optional_string("$Trail:")){ wip->wi_flags |= WIF_TRAIL; // missile leaves a trail @@ -1098,6 +1118,34 @@ int parse_weapon() ti->bitmap = bm_load(trail_name); // wip->delta_time = fl2i(1000.0f*wip->max_life)/(NUM_TRAIL_SECTIONS+1); // time between sections. max_life / num_sections basically. } +#else + // seemed easier to separate this out from above + int has_trail=0; + required_string("$Trail:"); + stuff_boolean(&has_trail); + + if (has_trail == 1) { + wip->wi_flags |= WIF_TRAIL; // missile leaves a trail + + required_string("+Head Width:"); + stuff_float(&ti->w_start); + + required_string("+Tail Width:"); + stuff_float(&ti->w_end); + + ti->a_start = 1.0; + ti->a_end = 0.0; + + required_string("+Life:"); + stuff_float(&ti->max_life); + + ti->stamp = fl2i(1000.0f*ti->max_life)/(NUM_TRAIL_SECTIONS+1); + + required_string("+Bitmap:"); + stuff_string(trail_name, F_NAME, NULL); + ti->bitmap = bm_load(trail_name); + } +#endif // read in filename for icon that is used in weapons selection wip->icon_filename[0] = 0; @@ -1463,7 +1511,7 @@ void weapon_init() int rval; if ( !Weapons_inited ) { -#ifndef FS2_DEMO +#if !(defined(FS2_DEMO) || defined(FS1_DEMO)) // parse weapon_exp.tbl parse_weapon_expl_tbl(); #endif -- 2.39.2