*** MERGED source code from development trunk revision 4890 up to latest current revision 5105 ***

Development Trunk (now obsolete): https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP
A detailed list of all the features (changes) is visible in the history log of the development trunk:

INFO: There will be no further development in the development source trunk, so is obsolete from now on!

This commit contains the following features (bugfixes are not listed):

- New Feature: Show merc ranks in Strategy Screen before merc name
o Toggle on/off in the ingame options screen
o For each experience level (0-10) there are defined rank names in the language specific text files
o Additional language text that is not translated yet is marked with // TODO.Translate

- New Feature: Faster Bobby Ray Shipments
o This feature is selectable in the ja2_options.ini
o When activated Bobby Ray shipments will be really fast
-> Overnight Express: 5 - 7 hours
-> Air Service: 10, 12 or 14 hours
-> Standard Service: 15, 18 or 21 hours
o In a multiplayer game, this feature is disabled (because shipment arrive immediately in the destination sector)

- New Feature: AP cost for manipulating the merc inventory
o This feature is selectable in the start new game screen
o For example, putting a weapon from hand in the backpack costs APs
o The AP costs are defined in the APBPConstants.ini
o In a multiplayer game, this feature is disabled

- New Feature: Added possibility to set individual Gear Kit names
o Set individual names in the optional new tag <mGearKitName> inside the <GEARKIT> root element (File: TableData\MercStartingGear.xml)

- New Feature: Externalized the maximum purchase amount (JA2 vanilla: 10) for Bobby Rays purchases per shipment
o Define the max. amount in the ja2_options.ini: BOBBY_RAY_MAX_PURCHASE_AMOUNT, Range: 10 - 100)
o Nice scrolling bars to scroll through all the purchases

- New Feature: Now it is possible to walk on "water" tiles or handle those tiles like "normal" tiles 
o (instead of showing the swimming animation and counting the APs for swimming), when the soldier is located on the second level (level > 0)

- New Feature: Externalized AIM Veterans laptop site
o Add maximum of 4 pages
o Add  new AIM to veterans page, and remove AIM from veterans page.
o New XML file: OldAIMArchive.xml (language specific XML files: *.OldAIMArchive.xml)

- New Feature: Added possibility to choose from 254 IMP faces
o Modified IMPPortraits.xml
o Added new GameDir folder "IMPFaces" which contains the IMP face portraits
o Moved IMP faces in the new "IMPFaces" folder

- New Feature: ARSP - All Resolution Support Project
o See here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298698&page=1
o Support any kind of screen resolution. This works by choosing the matching full supported resolution (640x480, 800x600, 1024x768) and then centering the graphics
o See ja2.ini for defining the screen resolution

- New Feature: AI Turn Speed Up (FF-MOD)
o see here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=298699#Post298699
o When this feature is activated it allows fast enemy turns
o New entry in ja2.ini to enable this feature: HIGHSPEED_TIMER = TRUE
o Turn on/off auto fast turns in ingame options
o New ja2_options.ini settings for fine tuning: [Clock Settings] ini block

- New Feature: "Lock" / "Release" mouse cursor in tactical windowed mode, so the mouse can stay within window boundary
o This is very helpful for doing scrolling with the mouse (by moving the mouse to the window edge) in windowed mode
o You can toggle on/off the feature by pressing CTRL + Z. It is also possible to press CTRL + Y. So the user can decide which fits better :)
o Whenever you toggle on/off a screen message appears on the tactical log to notify the player

- New Feature: Weapon overheating
o Basically, every shot fired from a gun increases its temperature. On higher temperatures, the gun jams more frequently
o On/off toggle in the ingame options
o Graphical thermometer indication on the weapon picture
o New ja2_options.ini section with a few options, Section: [Tactical Weapon Overheating Settings]
o XML changes (New Tags)
--> AmmoTypes.xml: <temperatureModificator>
--> Items.xml: <barrel>, <usOverheatingCooldownFactor>
--> Weapons.xml: <usOverheatingJamThreshold>, <usOverheatingDamageThreshold>, <usOverheatingSingleShotTemperature>
o Added a few barells to Items.xml (end of the file)
o more infos: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=301059&page=1

- New Feature: Resting weapons on a surfaces
o You can now rest your weapon on crates, low walls, rocks, debris, open windows etc. while you are crouched. Resting will give yu the superior gun handling modifiers from PRONE position.
o A little 'A' on your gun indicates if you are resting it or not.
o Both settings can be turned on and off in Ja2_Options.ini under 'Tactical Gameplay Settings'

- New Feature: Externalized option on whether mercs can exit sector using grid exit in turn based mode
o new ja2_options.ini property: GRID_EXIT_IN_TURNBASED
o This ini setting does not affect leaving sectors on map edges

- Rework/Update: Ammo boxes and Ammo crates
o Ammo crate items added for remaining calibers.  Tweaked prices to correspond to magazines, tweaked capacities and weights to be reasonable (~800 or less).
o Shift-R reload now looks at both boxes and crates in sector items and merc's inventory to reload, and tops off magazines in inventory as well.  Only possible outside of combat.
o Ctrl-Shift-A still creates crates as per usual, with some fixes to ensure all ammo is caught on the first press.
o Shift-A now creates ammo boxes in the same loop.  They mostly behave like crates, but fit in mercs inventories.
o Ammo boxes are available to purchase at BR and tony, sam, etc.  Individual magazines/drums/etc are no longer available.
o Removed ammo crate xml tag.  Added ubMagType tag to Magazines array.  This allows us to differentiate between magazines, bullets, boxes and crates.
o Changed ammo filtering in BR's to display boxes appropriately.  Added back the "Mag:" display (changed text to "Size:")
o Added ja2set.dat.xml file (WF map version in WF maps folder) to be used instead of ja2set.dat file (ja2.ini setting added) For now, if you want to play vanilla instead, just change the setting in the ini (see comments in file).
o Added P4-P9Items image files (up to 5k images each) and tileslots.  1.13 core items will continue to use Guns and P1-P3Items for the foreseeable future.  P4-P9 can be used by customizers/modders to avoid conflicts with Guns/P1-P3 items.  TODO: Need to discuss a strategy for this in the forums.
o Added in Ambient/0.bad and 32.bad to avoid an exception in the code.
o Updated the XML Editor
o Standardized the text on all the ammo items.

- New Multiplayer Feature: Sharing same FOV (field of view) in a coop/team-dm (for friendly teams) game
o You will also see enemies, that your teammate sees

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5108 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-03-23 18:46:54 +00:00
parent ab80b4e191
commit 7ca53fadc7
177 changed files with 9625 additions and 3428 deletions
+97 -421
View File
@@ -28,13 +28,9 @@
#include "Random.h"
#endif
//externals
extern HVSURFACE ghFrameBuffer;
//local Defines
enum
{
@@ -42,32 +38,22 @@ enum
CRDT_RENDER_ALL,
};
//nnn
typedef struct _CRDT_NODE
{
UINT32 uiType; //the type of node
CHAR16 *pString; //string for the node if the node contains a string
UINT32 uiFlags; //various flags
UINT32 uiType; //the type of node
CHAR16 *pString; //string for the node if the node contains a string
UINT32 uiFlags; //various flags
INT16 sPosX; //position of the node on the screen if the node is displaying stuff
INT16 sPosY;
INT16 sOldPosX; //position of the node on the screen if the node is displaying stuff
INT16 sOldPosY;
INT16 sHeightOfString; //The height of the displayed string
BOOLEAN fDelete; //Delete this loop
UINT32 uiLastTime; // The last time the node was udated
UINT32 uiVideoSurfaceImage;
BOOLEAN fDelete; //Delete this loop
UINT32 uiLastTime; // The last time the node was udated
UINT32 uiVideoSurfaceImage;
struct _CRDT_NODE *pPrev;
struct _CRDT_NODE *pNext;
struct _CRDT_NODE *pNext;
} CRDT_NODE;
//type of credits
@@ -79,92 +65,52 @@ enum
//flags for the credits
//Flags:
#define CRDT_FLAG__TITLE 0x00000001
#define CRDT_FLAG__TITLE 0x00000001
#define CRDT_FLAG__START_SECTION 0x00000002
#define CRDT_FLAG__END_SECTION 0x00000004
#define CRDT_NAME_OF_CREDIT_FILE "BINARYDATA\\Credits.edt"
#define CRDT_NAME_OF_MOD_CREDIT_FILE "BINARYDATA\\Credits_Mod.edt"
//#define CRDT_NAME_OF_CREDIT_FILE "BINARYDATA\\Credits.txt"
#define CRDT_NAME_OF_CREDIT_FILE "BINARYDATA\\Credits.edt"
#define CRDT_NAME_OF_MOD_CREDIT_FILE "BINARYDATA\\Credits_Mod.edt"
#define CREDITS_LINESIZE 80 * 2
#define CREDITS_LINESIZE (80 * 2)
//
// Code tokens
//
//new codes:
#define CRDT_START_CODE '@'
#define CRDT_SEPARATION_CODE L","
#define CRDT_END_CODE L";"
#define CRDT_START_CODE '@'
#define CRDT_SEPARATION_CODE L","
#define CRDT_END_CODE L";"
#define CRDT_DELAY_BN_STRINGS_CODE 'D'
#define CRDT_DELAY_BN_SECTIONS_CODE 'B'
#define CRDT_SCROLL_SPEED 'S'
#define CRDT_FONT_JUSTIFICATION 'J'
#define CRDT_TITLE_FONT_COLOR 'C'
#define CRDT_ACTIVE_FONT_COLOR 'R'
#define CRDT_SCROLL_SPEED 'S'
#define CRDT_FONT_JUSTIFICATION 'J'
#define CRDT_TITLE_FONT_COLOR 'C'
#define CRDT_ACTIVE_FONT_COLOR 'R'
//Flags:
#define CRDT_TITLE 'T'
#define CRDT_START_OF_SECTION '{'
#define CRDT_END_OF_SECTION '}'
#define CRDT_TITLE 'T'
#define CRDT_START_OF_SECTION '{'
#define CRDT_END_OF_SECTION '}'
#define CRDT_NAME_FONT FONT12ARIAL
#define CRDT_LINE_NODE_DISAPPEARS_AT 0
#define CRDT_NAME_LOC_X 375
#define CRDT_NAME_LOC_Y 420
#define CRDT_NAME_TITLE_LOC_Y 435
#define CRDT_NAME_FUNNY_LOC_Y 450
#define CRDT_NAME_LOC_WIDTH 260
#define CRDT_NAME_LOC_HEIGHT ( CRDT_NAME_FUNNY_LOC_Y - CRDT_NAME_LOC_Y + GetFontHeight( CRDT_NAME_FONT ) )
#define CRDT_NAME_FONT FONT12ARIAL
#define CRDT_LINE_NODE_DISAPPEARS_AT 0//20
/*
//new codes:
enum
{
CRDT_ERROR,
CRDT_CODE_DELAY_BN_STRINGS,
CRDT_CODE_SCROLL_SPEED,
CRDT_CODE_FONT_JUSIFICATION,
CRDT_CODE_FONT_COLOR,
CRDT_NUM_CODES,
};
*/
#define CRDT_WIDTH_OF_TEXT_AREA 210
#define CRDT_TEXT_START_LOC 10
#define CRDT_SCROLL_PIXEL_AMOUNT 1
#define CRDT_NODE_DELAY_AMOUNT 25
#define CRDT_DELAY_BN_NODES 750
#define CRDT_DELAY_BN_SECTIONS 2500
#define CRDT_SPACE_BN_SECTIONS 50
#define CRDT_SPACE_BN_NODES 12
#define CRDT_START_POS_Y (SCREEN_HEIGHT - 1) //479
#define CRDT_EYE_WIDTH 30
#define CRDT_EYE_HEIGHT 12
#define CRDT_EYES_CLOSED_TIME 150
#define CRDT_WIDTH_OF_TEXT_AREA 210
#define CRDT_SCROLL_PIXEL_AMOUNT 1
#define CRDT_NODE_DELAY_AMOUNT 25
#define CRDT_DELAY_BN_NODES 750
#define CRDT_DELAY_BN_SECTIONS 2500
#define CRDT_SPACE_BN_SECTIONS 50
#define CRDT_SPACE_BN_NODES 12
#define CRDT_START_POS_Y (SCREEN_HEIGHT - 1)
#define CRDT_EYE_WIDTH 30
#define CRDT_EYE_HEIGHT 12
#define CRDT_EYES_CLOSED_TIME 150
//ddd
typedef struct
{
INT16 sX;
@@ -179,8 +125,8 @@ typedef struct
INT16 sMouthY;
INT16 sBlinkFreq;
UINT32 uiLastBlinkTime;
UINT32 uiEyesClosedTime;
UINT32 uiLastBlinkTime;
UINT32 uiEyesClosedTime;
} CDRT_FACE;
@@ -204,189 +150,66 @@ CDRT_FACE gCreditFaces[] =
585, 196, 39, 49, 593, 218, 593, 228, 3500, 0, 0, //Joey
};
/*
enum
{
CRDT_CAMFIELD,
CRDT_SHAWN,
CRDT_KRIS,
CRDT_IAN,
CRDT_LINDA,
CRDT_ERIC,
CRDT_LYNN,
CRDT_NORM,
CRDT_GEORGE,
CRDT_STACEY,
CRDT_SCOTT,
CRDT_EMMONS,
CRDT_DAVE,
CRDT_ALEX,
CRDT_JOEY,
NUM_PEOPLE_IN_CREDITS,
};
STR16 gzCreditNames[]=
{
L"Chris Camfield",
L"Shaun Lyng",
L"Kris Maernes",
L"Ian Currie",
L"Linda Currie",
L"Eric \"WTF\" Cheng",
L"Lynn Holowka",
L"Norman \"NRG\" Olsen",
L"George Brooks",
L"Andrew Stacey",
L"Scot Loving",
L"Andrew \"Big Cheese\" Emmons",
L"Dave \"The Feral\" French",
L"Alex Meduna",
L"Joey \"Joeker\" Whelan",
};
STR16 gzCreditNameTitle[]=
{
L"Game Internals Programmer", // Chris Camfield
L"Co-designer/Writer", // Shaun Lyng
L"Strategic Systems & Editor Programmer", //Kris \"The Cow Rape Man\" Marnes
L"Producer/Co-designer", // Ian Currie
L"Co-designer/Map Designer", // Linda Currie
L"Artist", // Eric \"WTF\" Cheng
L"Beta Coordinator, Support", // Lynn Holowka
L"Artist Extraordinaire", // Norman \"NRG\" Olsen
L"Sound Guru", // George Brooks
L"Screen Designer/Artist", // Andrew Stacey
L"Lead Artist/Animator", // Scot Loving
L"Lead Programmer", // Andrew \"Big Cheese Doddle\" Emmons
L"Programmer", // Dave French
L"Strategic Systems & Game Balance Programmer", // Alex Meduna
L"Portraits Artist", // Joey \"Joeker\" Whelan",
};
STR16 gzCreditNameFunny[]=
{
L"", // Chris Camfield
L"(still learning punctuation)", // Shaun Lyng
L"(\"It's done. I'm just fixing it\")", //Kris \"The Cow Rape Man\" Marnes
L"(getting much too old for this)", // Ian Currie
L"(and working on Wizardry 8)", // Linda Currie
L"(forced at gunpoint to also do QA)", // Eric \"WTF\" Cheng
L"(Left us for the CFSA - go figure...)", // Lynn Holowka
L"", // Norman \"NRG\" Olsen
L"", // George Brooks
L"(Dead Head and jazz lover)", // Andrew Stacey
L"(his real name is Robert)", // Scot Loving
L"(the only responsible person)", // Andrew \"Big Cheese Doddle\" Emmons
L"(can now get back to motocrossing)", // Dave French
L"(stolen from Wizardry 8)", // Alex Meduna
L"(did items and loading screens too!)", // Joey \"Joeker\" Whelan",
};
*/
//Global Variables
MOUSE_REGION gCrdtMouseRegions[ NUM_PEOPLE_IN_CREDITS ];
void SelectCreditFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectCreditFaceMovementRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
UINT32 guiCreditBackGroundImage;
UINT32 guiCreditFaces;
BOOLEAN gfCreditsScreenEntry = TRUE;
BOOLEAN gfCreditsScreenExit = FALSE;
UINT32 guiCreditsExitScreen;
UINT32 guiCreditBackGroundImage;
UINT32 guiCreditFaces;
BOOLEAN gfCreditsScreenEntry = TRUE;
BOOLEAN gfCreditsScreenExit = FALSE;
UINT32 guiCreditsExitScreen;
UINT8 gubCreditScreenRenderFlags = CRDT_RENDER_ALL;
CRDT_NODE *gCrdtRootNode=NULL;
CRDT_NODE *gCrdtLastAddedNode=NULL;
CRDT_NODE *gCrdtRootNode=NULL;
CRDT_NODE *gCrdtLastAddedNode=NULL;
BOOLEAN gfCrdtHaveRenderedFirstFrameToSaveBuffer; // need to render background image to save buffer once
BOOLEAN gfCrdtHaveRenderedFirstFrameToSaveBuffer; // need to render background image to save buffer once
INT32 giCurrentlySelectedFace = -1;
//
//VAriables needed for processing of the nodes:
//
UINT32 guiCreditScreenActiveFont; // the font that is used
UINT32 guiCreditScreenTitleFont; // the font that is used
UINT8 gubCreditScreenActiveColor; // color of the font
UINT8 gubCreditScreenTitleColor; // color of a Title node
//UINT32 guiCreditScreenActiveDisplayFlags; //
UINT8 gubCreditScreenActiveColor; // color of the font
UINT8 gubCreditScreenTitleColor; // color of a Title node
UINT32 guiCrdtNodeScrollSpeed = CRDT_NODE_DELAY_AMOUNT; //speed credits go up at
//UINT32 guiCrdtTimeTillReadNextCredit = CRDT_DELAY_BN_SECTIONS; //the delay before reading the next credit ( normall = guiCrdtDelayBetweenCreditSection or guiCrdtDelayBetweenNodes )
//UINT32 guiCrdtDelayBetweenCreditSection = CRDT_DELAY_BN_SECTIONS; //delay between major credits sections ( programming and art ) appearing on the screen
//UINT32 guiCrdtDelayBetweenNodes = CRDT_DELAY_BN_NODES; //delay between credits appearing on the screen
UINT32 guiCrdtLastTimeUpdatingNode=0; // the last time a node was read from the file
UINT8 gubCrdtJustification = CENTER_JUSTIFIED; // the current justification
UINT8 gubCrdtJustification = CENTER_JUSTIFIED; // the current justification
UINT32 guiGapBetweenCreditSections = CRDT_SPACE_BN_SECTIONS;
UINT32 guiGapBetweenCreditNodes = CRDT_SPACE_BN_NODES;
UINT32 guiGapTillReadNextCredit = CRDT_SPACE_BN_NODES;
UINT32 guiCurrentCreditRecord = 0;
BOOLEAN gfPauseCreditScreen = FALSE;
BOOLEAN gfModCredits = TRUE;
HWFILE ghFile;
//ggg
//Function Prototypes
BOOLEAN EnterCreditsScreen();
BOOLEAN ExitCreditScreen();
void HandleCreditScreen();
void HandleCreditScreen();
BOOLEAN RenderCreditScreen();
void GetCreditScreenUserInput();
void SetCreditsExitScreen( UINT32 uiScreenToGoTo );
void GetCreditScreenUserInput();
void SetCreditsExitScreen( UINT32 uiScreenToGoTo );
BOOLEAN ShutDownCreditList();
BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString );
BOOLEAN InitCreditNode( );
BOOLEAN DisplayCreditNode( CRDT_NODE *pCurrent );
void HandleCreditNodes();
void HandleNode_Default( CRDT_NODE *pCurrent );
void HandleCurrentCreditNode( CRDT_NODE *pCurrent );
void HandleCreditNodes();
void HandleNode_Default( CRDT_NODE *pCurrent );
void HandleCurrentCreditNode( CRDT_NODE *pCurrent );
BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete );
UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode );
BOOLEAN GetNextCreditFromTextFile();
UINT32 CountNumberOfCreditNodes();
STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode );
void HandleCreditFlags( UINT32 uiFlags );
void HandleCreditEyeBlinking();
void InitCreditEyeBlinking();
//ppp
// VSURFACE_DESC vs_desc;
// HVSURFACE hVSurface;
STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode );
void HandleCreditFlags( UINT32 uiFlags );
void HandleCreditEyeBlinking();
void InitCreditEyeBlinking();
UINT32 CreditScreenInit( void )
{
@@ -394,8 +217,6 @@ UINT32 CreditScreenInit( void )
return( 1 );
}
UINT32 CreditScreenHandle( void )
{
StartFrameBufferRender();
@@ -412,27 +233,17 @@ UINT32 CreditScreenHandle( void )
gfCreditsScreenEntry = FALSE;
gfCreditsScreenExit = FALSE;
}
gubCreditScreenRenderFlags = CRDT_RENDER_ALL;
}
GetCreditScreenUserInput();
HandleCreditScreen();
// render buttons marked dirty
// MarkButtonsDirty( );
// RenderButtons( );
// render help
// RenderFastHelp( );
// RenderButtonsFastHelp( );
ExecuteBaseDirtyRectQueue();
EndFrameBufferRender();
if( gfCreditsScreenExit )
{
ExitCreditScreen();
@@ -440,7 +251,6 @@ UINT32 CreditScreenHandle( void )
gfCreditsScreenExit = FALSE;
}
return( guiCreditsExitScreen );
}
@@ -450,48 +260,25 @@ UINT32 CreditScreenShutdown( void )
return( 1 );
}
//eee
BOOLEAN EnterCreditsScreen()
{
UINT32 uiCnt;
VOBJECT_DESC VObjectDesc;
/*
VSURFACE_DESC vs_desc;
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
strcpy(vs_desc.ImageFile, "INTERFACE\\Credits.sti");
if( !AddVideoSurface( &vs_desc, &guiCreditBackGroundImage ) )
{
return( FALSE );
}
*/
gfModCredits = TRUE;
ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0 );
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
if (iResolution == 0)
if (iResolution >= _640x480 && iResolution < _800x600)
{
FilenameForBPP("INTERFACE\\Credits.sti", VObjectDesc.ImageFile);
FilenameForBPP("INTERFACE\\Credits.sti", VObjectDesc.ImageFile);
}
else if (iResolution == 1)
else if (iResolution < _1024x768)
{
FilenameForBPP("INTERFACE\\Credits_800x600.sti", VObjectDesc.ImageFile);
}
else if (iResolution == 2)
else
{
FilenameForBPP("INTERFACE\\Credits_1024x768.sti", VObjectDesc.ImageFile);
}
@@ -502,43 +289,31 @@ BOOLEAN EnterCreditsScreen()
FilenameForBPP("INTERFACE\\Credit Faces.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiCreditFaces ));
//Initialize the root credit node
InitCreditNode( );
guiCreditsExitScreen = CREDIT_SCREEN;
gfCrdtHaveRenderedFirstFrameToSaveBuffer = FALSE;
guiCreditScreenActiveFont = FONT12ARIAL;
gubCreditScreenActiveColor = FONT_MCOLOR_DKWHITE;
//gubCreditScreenActiveColor = FONT_MCOLOR_LTBLUE;
guiCreditScreenTitleFont = FONT14ARIAL;
gubCreditScreenTitleColor = FONT_MCOLOR_RED;
// guiCreditScreenActiveDisplayFlags = LEFT_JUSTIFIED;
guiCrdtNodeScrollSpeed = CRDT_NODE_DELAY_AMOUNT;
gubCrdtJustification = CENTER_JUSTIFIED;
guiCurrentCreditRecord = 0;
// guiCrdtTimeTillReadNextCredit = CRDT_DELAY_BN_SECTIONS;
// guiCrdtDelayBetweenCreditSection = CRDT_DELAY_BN_SECTIONS;
// guiCrdtDelayBetweenNodes = CRDT_DELAY_BN_NODES;
guiCrdtLastTimeUpdatingNode = GetJA2Clock();
guiGapBetweenCreditSections = CRDT_SPACE_BN_SECTIONS;
guiGapBetweenCreditNodes = CRDT_SPACE_BN_NODES;
guiGapTillReadNextCredit = CRDT_SPACE_BN_NODES;
for( uiCnt=0; uiCnt < NUM_PEOPLE_IN_CREDITS; uiCnt++)
{
// Make a mouse region
MSYS_DefineRegion( &gCrdtMouseRegions[uiCnt], gCreditFaces[uiCnt].sX, gCreditFaces[uiCnt].sY, (INT16)(gCreditFaces[uiCnt].sX + gCreditFaces[uiCnt].sWidth), (INT16)(gCreditFaces[uiCnt].sY + gCreditFaces[uiCnt].sHeight), MSYS_PRIORITY_NORMAL,
CURSOR_WWW, SelectCreditFaceMovementRegionCallBack, SelectCreditFaceRegionCallBack );
MSYS_DefineRegion( &gCrdtMouseRegions[uiCnt], gCreditFaces[uiCnt].sX + xResOffset, gCreditFaces[uiCnt].sY + yResOffset, (INT16)(gCreditFaces[uiCnt].sX + gCreditFaces[uiCnt].sWidth + xResOffset), (INT16)(gCreditFaces[uiCnt].sY + gCreditFaces[uiCnt].sHeight + yResOffset), MSYS_PRIORITY_NORMAL,
CURSOR_WWW, SelectCreditFaceMovementRegionCallBack, SelectCreditFaceRegionCallBack );
// Add region
MSYS_AddRegion( &gCrdtMouseRegions[uiCnt] );
@@ -546,38 +321,21 @@ BOOLEAN EnterCreditsScreen()
MSYS_SetRegionUserData( &gCrdtMouseRegions[uiCnt], 0, uiCnt );
}
/*
//open the credit text file
ghFile = FileOpen( CRDT_NAME_OF_CREDIT_FILE, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
if( !ghFile )
{
return( FALSE );
}
*/
giCurrentlySelectedFace = -1;
gfPauseCreditScreen = FALSE;
InitCreditEyeBlinking();
return( TRUE );
}
BOOLEAN ExitCreditScreen()
{
UINT32 uiCnt;
//Blit the background image
// DeleteVideoSurfaceFromIndex( guiCreditBackGroundImage );
DeleteVideoObjectFromIndex( guiCreditBackGroundImage );
DeleteVideoObjectFromIndex( guiCreditFaces );
//ShutDown Credit link list
ShutDownCreditList();
@@ -586,20 +344,20 @@ BOOLEAN ExitCreditScreen()
MSYS_RemoveRegion( &gCrdtMouseRegions[uiCnt] );
}
/*
//close the text file
FileClose( ghFile );
ghFile = 0;
*/
return( TRUE );
}
//hhh
void HandleCreditScreen()
void HandleCreditScreen()
{
// UINT32 uiTime = GetJA2Clock();
UINT16 CRDT_NAME_LOC_X = 375 + xResOffset;
UINT16 CRDT_NAME_LOC_Y = 420 + yResOffset;
UINT16 CRDT_NAME_TITLE_LOC_Y = 435 + yResOffset;
UINT16 CRDT_NAME_FUNNY_LOC_Y = 450 + yResOffset;
UINT16 CRDT_NAME_LOC_WIDTH = 260;
UINT16 CRDT_NAME_LOC_HEIGHT = ( CRDT_NAME_FUNNY_LOC_Y - CRDT_NAME_LOC_Y + GetFontHeight( CRDT_NAME_FONT ) );
if( gubCreditScreenRenderFlags == CRDT_RENDER_ALL )
{
@@ -607,14 +365,12 @@ void HandleCreditScreen()
gubCreditScreenRenderFlags = CRDT_RENDER_NONE;
}
//Handle the Credit linked list
HandleCreditNodes();
//Handle the blinkng eyes
HandleCreditEyeBlinking();
//is it time to get a new node
if( gCrdtLastAddedNode == NULL || ( CRDT_START_POS_Y - ( gCrdtLastAddedNode->sPosY + gCrdtLastAddedNode->sHeightOfString - 16 ) ) >= (INT16)guiGapTillReadNextCredit )
{
@@ -625,8 +381,6 @@ void HandleCreditScreen()
}
}
RestoreExternBackgroundRect( CRDT_NAME_LOC_X, CRDT_NAME_LOC_Y, CRDT_NAME_LOC_WIDTH, (INT16)CRDT_NAME_LOC_HEIGHT );
if( giCurrentlySelectedFace != -1 )
@@ -637,21 +391,14 @@ void HandleCreditScreen()
}
}
//rrr
BOOLEAN RenderCreditScreen()
{
HVOBJECT hPixHandle;
GetVideoObject(&hPixHandle, guiCreditBackGroundImage );
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL);
/*
HVSURFACE hVSurface;
BltVideoObject( FRAME_BUFFER, hPixHandle, 0, xResOffset, yResOffset, VO_BLT_SRCTRANSPARENCY, NULL);
GetVideoSurface( &hVSurface, guiCreditBackGroundImage );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, 0, 0, 0, NULL );
*/
if( !gfCrdtHaveRenderedFirstFrameToSaveBuffer )
{
gfCrdtHaveRenderedFirstFrameToSaveBuffer = TRUE;
@@ -666,12 +413,11 @@ BOOLEAN RenderCreditScreen()
return( TRUE );
}
void GetCreditScreenUserInput()
{
InputAtom Event;
while( DequeueEvent( &Event ) )
while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( Event.usEvent == KEY_DOWN )
{
@@ -683,7 +429,6 @@ void GetCreditScreenUserInput()
SetCreditsExitScreen( MAINMENU_SCREEN );
break;
//#ifdef JA2TESTVERSION
case 'r':
gubCreditScreenRenderFlags = CRDT_RENDER_ALL;
break;
@@ -707,7 +452,6 @@ void GetCreditScreenUserInput()
else
gfPauseCreditScreen = TRUE;
break;
//#endif
}
}
}
@@ -792,7 +536,6 @@ BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete )
pTempNode->pString = NULL;
}
//if the node had something to display, delete a surface for it
if( pTempNode->uiType == CRDT_NODE_DEFAULT )
{
@@ -800,7 +543,6 @@ BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete )
pTempNode->uiVideoSurfaceImage = 0;
}
//Free the node
MemFree( pTempNode );
pTempNode = NULL;
@@ -808,7 +550,6 @@ BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete )
return( TRUE );
}
//aaa
BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
{
@@ -818,6 +559,8 @@ BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
UINT32 uiFontToUse;
UINT8 uiColorToUse;
UINT16 CRDT_TEXT_START_LOC = xResOffset + 10;
//if
if( uiType == CRDT_NODE_NONE)
{
@@ -839,18 +582,6 @@ BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
uiFontToUse = guiCreditScreenTitleFont;
uiColorToUse = gubCreditScreenTitleColor;
}
/*
else if ( uiFlags & CRDT_FLAG__START_SECTION )
{
uiFontToUse = ;
uiColorToUse = ;
}
else if ( uiFlags & CRDT_FLAG__END_SECTION )
{
uiFontToUse = ;
uiColorToUse = ;
}
*/
else
{
uiFontToUse = guiCreditScreenActiveFont;
@@ -918,9 +649,6 @@ BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
SetFontDestBuffer(FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE);
}
//
// Insert the node into the list
//
@@ -968,7 +696,6 @@ void HandleCreditNodes()
if( gfPauseCreditScreen )
return;
pCurrent = gCrdtRootNode;
if( !( GetJA2Clock() - guiCrdtLastTimeUpdatingNode > guiCrdtNodeScrollSpeed ) )
@@ -992,8 +719,6 @@ void HandleCreditNodes()
}
}
// RestoreExternBackgroundRect( CRDT_TEXT_START_LOC, 0, CRDT_WIDTH_OF_TEXT_AREA, CRDT_LINE_NODE_DISAPPEARS_AT );
guiCrdtLastTimeUpdatingNode = GetJA2Clock();
}
@@ -1002,7 +727,6 @@ void HandleCurrentCreditNode( CRDT_NODE *pCurrent )
//switch on the type of node
switch( pCurrent->uiType )
{
//new codes:
case CRDT_NODE_DEFAULT:
HandleNode_Default( pCurrent );
break;
@@ -1015,33 +739,24 @@ void HandleCurrentCreditNode( CRDT_NODE *pCurrent )
void HandleNode_Default( CRDT_NODE *pCurrent )
{
//if it is time to update the current node
// if( ( uiCurrentTime - pCurrent->uiLastTime ) > guiCrdtNodeScrollSpeed )
//Display the Current Node
DisplayCreditNode( pCurrent );
//Save the old position
pCurrent->sOldPosX = pCurrent->sPosX;
pCurrent->sOldPosY = pCurrent->sPosY;
//Move the current node up
pCurrent->sPosY -= CRDT_SCROLL_PIXEL_AMOUNT;
//if the node is entirely off the screen
if( ( pCurrent->sPosY + pCurrent->sHeightOfString ) < CRDT_LINE_NODE_DISAPPEARS_AT )
{
//Display the Current Node
DisplayCreditNode( pCurrent );
//Save the old position
pCurrent->sOldPosX = pCurrent->sPosX;
pCurrent->sOldPosY = pCurrent->sPosY;
//Move the current node up
pCurrent->sPosY -= CRDT_SCROLL_PIXEL_AMOUNT;
//if the node is entirely off the screen
if( ( pCurrent->sPosY + pCurrent->sHeightOfString ) < CRDT_LINE_NODE_DISAPPEARS_AT )
{
//mark the node to be deleted this frame
pCurrent->fDelete = TRUE;
}
//Update the last time to be the current time
// pCurrent->uiLastTime = uiCurrentTime + ( uiCurrentTime - ( pCurrent->uiLastTime + guiCrdtNodeScrollSpeed ) );
// pCurrent->uiLastTime = ( uiCurrentTime - ( uiCurrentTime - pCurrent->uiLastTime - guiCrdtNodeScrollSpeed) );
pCurrent->uiLastTime = GetJA2Clock();
//mark the node to be deleted this frame
pCurrent->fDelete = TRUE;
}
pCurrent->uiLastTime = GetJA2Clock();
}
@@ -1058,7 +773,6 @@ BOOLEAN DisplayCreditNode( CRDT_NODE *pCurrent )
//if the node is new and we havent displayed it yet
if( pCurrent->uiLastTime == 0 )
{
}
//else we have to restore were the string was
@@ -1091,7 +805,6 @@ BOOLEAN DisplayCreditNode( CRDT_NODE *pCurrent )
GetVideoSurface( &hVSurface, pCurrent->uiVideoSurfaceImage );
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, pCurrent->sPosX, pCurrent->sPosY, VS_BLT_CLIPPED | VS_BLT_USECOLORKEY, NULL );
return( TRUE );
@@ -1376,7 +1089,6 @@ BOOLEAN GetNextCreditFromTextFile()
//Increment to the next crdit record
guiCurrentCreditRecord++;
//if there are no codes in the string
if( zOriginalString[0] != CRDT_START_CODE )
{
@@ -1394,7 +1106,6 @@ BOOLEAN GetNextCreditFromTextFile()
//Retrive all the codes from the string
pzEndCode = wcsstr( zOriginalString, CRDT_END_CODE );
//Make a string for the codes
wcscpy( zCodes, zOriginalString );
@@ -1466,10 +1177,6 @@ BOOLEAN GetNextCreditFromTextFile()
//return any flags that need to be set in the node
UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
{
//new codes:
//if the code is to change the delay between strings
if( pzCode[0] == CRDT_DELAY_BN_STRINGS_CODE )
{
@@ -1477,13 +1184,10 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
//Get the delay from the string
swscanf( &pzCode[1], L"%d%*s", &uiNewDelay );
// guiCrdtDelayBetweenNodes = uiNewDelay;
guiGapBetweenCreditNodes = uiNewDelay;
return( CRDT_NODE_NONE );
}
//if the code is to change the delay between sections strings
else if( pzCode[0] == CRDT_DELAY_BN_SECTIONS_CODE )
{
@@ -1491,14 +1195,10 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
//Get the delay from the string
swscanf( &pzCode[1], L"%d%*s", &uiNewDelay );
// guiCrdtDelayBetweenCreditSection = uiNewDelay;
guiGapBetweenCreditSections = uiNewDelay;
return( CRDT_NODE_NONE );
}
else if( pzCode[0] == CRDT_SCROLL_SPEED )
{
UINT32 uiScrollSpeed=0;
@@ -1510,7 +1210,6 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
return( CRDT_NODE_NONE );
}
else if( pzCode[0] == CRDT_FONT_JUSTIFICATION )
{
UINT32 uiJustification=0;
@@ -1536,45 +1235,30 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
return( CRDT_NODE_NONE );
}
else if( pzCode[0] == CRDT_TITLE_FONT_COLOR )
{
//Get the new color for the title
//SB: memory corruption fix
// swscanf( &pzCode[1], L"%d%*s", &gubCreditScreenTitleColor );
UINT uiBuffer = 0;
swscanf( &pzCode[1], L"%d%*s", &uiBuffer );
gubCreditScreenTitleColor = (UINT8)uiBuffer;
return( CRDT_NODE_NONE );
}
else if( pzCode[0] == CRDT_ACTIVE_FONT_COLOR )
{
//Get the new color for the active text
//SB: memory corruption fix
// swscanf( &pzCode[1], L"%d%*s", &gubCreditScreenActiveColor );
UINT uiBuffer = 0;
swscanf( &pzCode[1], L"%d%*s", &uiBuffer );
gubCreditScreenActiveColor = (UINT8)uiBuffer;
return( CRDT_NODE_NONE );
}
//else its the title code
else if( pzCode[0] == CRDT_TITLE )
{
return( CRDT_FLAG__TITLE );
}
//else its the title code
else if( pzCode[0] == CRDT_START_OF_SECTION )
{
return( CRDT_FLAG__START_SECTION );
}
//else its the title code
else if( pzCode[0] == CRDT_END_OF_SECTION )
{
return( CRDT_FLAG__END_SECTION );
@@ -1609,8 +1293,6 @@ STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode )
//if there is no separation code, then there must be an end code
if( pzNewCode == NULL )
{
//pzNewCode = wcsstr( pString, CRDT_END_CODE );
//we are done
pzNewCode = NULL;
}
@@ -1619,7 +1301,6 @@ STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode )
//get rid of separeation code
pzNewCode++;
//calc size of sub string
uiSizeOfCode = pzNewCode - pString;
}
@@ -1628,7 +1309,6 @@ STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode )
return( pzNewCode );
}
//Flags:
void HandleCreditFlags( UINT32 uiFlags )
{
@@ -1638,19 +1318,15 @@ void HandleCreditFlags( UINT32 uiFlags )
if( uiFlags & CRDT_FLAG__START_SECTION )
{
// guiCrdtTimeTillReadNextCredit = guiCrdtDelayBetweenNodes;
guiGapTillReadNextCredit = guiGapBetweenCreditNodes;
}
if( uiFlags & CRDT_FLAG__END_SECTION )
{
// guiCrdtTimeTillReadNextCredit = guiCrdtDelayBetweenCreditSection;
guiGapTillReadNextCredit = guiGapBetweenCreditSections;
}
}
void SelectCreditFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
@@ -1700,9 +1376,9 @@ void HandleCreditEyeBlinking()
{
if( ( GetJA2Clock() - gCreditFaces[ubCnt].uiLastBlinkTime ) > (UINT32)gCreditFaces[ubCnt].sBlinkFreq )
{
BltVideoObject( FRAME_BUFFER, hPixHandle, (UINT8)(ubCnt*3), gCreditFaces[ubCnt].sEyeX, gCreditFaces[ubCnt].sEyeY, VO_BLT_SRCTRANSPARENCY, NULL);
BltVideoObject( FRAME_BUFFER, hPixHandle, (UINT8)(ubCnt*3), gCreditFaces[ubCnt].sEyeX + xResOffset, gCreditFaces[ubCnt].sEyeY + yResOffset, VO_BLT_SRCTRANSPARENCY, NULL);
InvalidateRegion( gCreditFaces[ubCnt].sEyeX, gCreditFaces[ubCnt].sEyeY, gCreditFaces[ubCnt].sEyeX + CRDT_EYE_WIDTH, gCreditFaces[ubCnt].sEyeY + CRDT_EYE_HEIGHT );
InvalidateRegion( gCreditFaces[ubCnt].sEyeX + xResOffset, gCreditFaces[ubCnt].sEyeY + yResOffset, gCreditFaces[ubCnt].sEyeX + CRDT_EYE_WIDTH + xResOffset, gCreditFaces[ubCnt].sEyeY + CRDT_EYE_HEIGHT + yResOffset );
gCreditFaces[ubCnt].uiLastBlinkTime = GetJA2Clock();
@@ -1712,7 +1388,7 @@ void HandleCreditEyeBlinking()
{
gCreditFaces[ubCnt].uiEyesClosedTime = 0;
RestoreExternBackgroundRect( gCreditFaces[ubCnt].sEyeX, gCreditFaces[ubCnt].sEyeY, CRDT_EYE_WIDTH, CRDT_EYE_HEIGHT );
RestoreExternBackgroundRect( gCreditFaces[ubCnt].sEyeX + xResOffset, gCreditFaces[ubCnt].sEyeY + yResOffset, CRDT_EYE_WIDTH, CRDT_EYE_HEIGHT );
}
}
}