mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
*** Merged Code from Multiplayer Branch Revision 2960 ***
- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-) - Multiplayer Version 1.1 + some additional features and bugfixes * INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory * git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+13
-1
@@ -51,6 +51,8 @@
|
||||
#include "fresh_header.h"
|
||||
#include "Encrypted File.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
//
|
||||
//****** Defines ******
|
||||
//
|
||||
@@ -1252,7 +1254,17 @@ BOOLEAN DisplayMercsInventory(UINT8 ubMercID)
|
||||
|
||||
pItem = &Item[ usItem ];
|
||||
GetVideoObject( &hVObject, GetInterfaceGraphicForItem( pItem ) );
|
||||
pTrav = &(hVObject->pETRLEObject[ pItem->ubGraphicNum ] );
|
||||
if(pItem->ubGraphicNum < hVObject->usNumberOfObjects)
|
||||
{
|
||||
pTrav = &(hVObject->pETRLEObject[ pItem->ubGraphicNum ] );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstringstream wss;
|
||||
wss << L"Number of images in VObject [" << hVObject->usNumberOfObjects
|
||||
<< L"] is smaller than the requested index [" << (int)pItem->ubGraphicNum << L"]";
|
||||
THROWEXCEPTION(wss.str().c_str());
|
||||
}
|
||||
|
||||
usHeight = (UINT32)pTrav->usHeight;
|
||||
usWidth = (UINT32)pTrav->usWidth;
|
||||
|
||||
@@ -186,7 +186,6 @@ extern MOUSE_REGION *gSelectedScrollAreaDropDownRegion;
|
||||
extern void BobbyRDeliveryCallback(RefToCShipmentManipulator ShipmentManipulator);
|
||||
//End Dealtar's Airport Externalization.
|
||||
|
||||
|
||||
//Bobby's Sign menu mouse regions
|
||||
MOUSE_REGION gSelectedBobbiesSignMenuRegion[ BOBBIES_NUMBER_SIGNS ];
|
||||
void SelectBobbiesSignMenuRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
@@ -254,8 +253,6 @@ BOOLEAN EnterBobbyR()
|
||||
//gDestinationTable.resize(gPostalService.LookupDestinationList().size());
|
||||
}
|
||||
//End Dealtar's Airport Externalization.
|
||||
|
||||
|
||||
// an array of mouse regions for the bobbies signs. Top Left corner, bottom right corner
|
||||
UINT16 usMouseRegionPosArray[] = {BOBBIES_USED_SIGN_X, BOBBIES_USED_SIGN_Y, BOBBIES_USED_SIGN_X+BOBBIES_USED_SIGN_WIDTH, BOBBIES_USED_SIGN_Y+BOBBIES_USED_SIGN_HEIGHT,
|
||||
BOBBIES_MISC_SIGN_X, BOBBIES_MISC_SIGN_Y, BOBBIES_MISC_SIGN_X+BOBBIES_MISC_SIGN_WIDTH, BOBBIES_MISC_SIGN_Y+BOBBIES_MISC_SIGN_HEIGHT,
|
||||
|
||||
@@ -342,6 +342,7 @@ void BobbyRDeliveryCallback(RefToCShipmentManipulator ShipmentManipulator)
|
||||
{
|
||||
// ScreenMsg(FONT_MCOLOR_RED, MSG_DEBUG, L"Shipment from Bobby Ray has arrived at %s!", ShipmentManipulator.GetDestination().wstrName.c_str());
|
||||
gusCurShipmentDestinationID = ShipmentManipulator.GetDestination().usID;
|
||||
|
||||
// WANNE - MP: Do not send email notification from Bobby Ray in a multiplayer game
|
||||
if (!is_networked)
|
||||
AddEmail( BOBBYR_SHIPMENT_ARRIVED, BOBBYR_SHIPMENT_ARRIVED_LENGTH, BOBBY_R, GetWorldTotalMin(), -1 );
|
||||
@@ -1143,7 +1144,6 @@ void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16
|
||||
default:
|
||||
usStandardCost = 0;
|
||||
}
|
||||
|
||||
iShippingCost = (INT32)( ( gpNewBobbyrShipments[ iOrderNum ].uiPackageWeight / (FLOAT)10 ) * usStandardCost + .5 );
|
||||
* Dealtar's Code: */
|
||||
UINT32 uiPackageWeight=0;
|
||||
@@ -1621,7 +1621,6 @@ void DrawSelectedCity( UINT8 ubCityNumber )
|
||||
*/
|
||||
if( gubCityAtTopOfList+guiNumOfDisplayedCities > (UINT8)gPostalService.LookupDestinationList().size() )
|
||||
gubCityAtTopOfList = gPostalService.LookupDestinationList().size() - guiNumOfDisplayedCities - 1;
|
||||
|
||||
|
||||
|
||||
//Display the list of cities
|
||||
@@ -1659,7 +1658,6 @@ void DrawSelectedCity( UINT8 ubCityNumber )
|
||||
DrawTextToScreen( (STR16)gDestinationTable[0]->wstrName.c_str(), BOBBYR_CITY_START_LOCATION_X+BOBBYR_CITY_NAME_OFFSET, (UINT16)(usPosY+5), 0, BOBBYR_DROPDOWN_FONT, BOBBYR_FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
else
|
||||
DrawTextToScreen( (STR16)gDestinationTable[ubCityNumber]->wstrName.c_str(), BOBBYR_CITY_START_LOCATION_X+BOBBYR_CITY_NAME_OFFSET, (UINT16)(usPosY+5), 0, BOBBYR_DROPDOWN_FONT, BOBBYR_FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
|
||||
|
||||
SetFontShadow(DEFAULT_SHADOW);
|
||||
|
||||
@@ -2028,7 +2026,6 @@ UINT32 CalcCostFromWeightOfPackage( UINT8 ubTypeOfService )
|
||||
}
|
||||
*/
|
||||
usStandardCost = gPostalService.GetDestinationFee(ubTypeOfService, gDestinationTable[gbSelectedCity]->usID);
|
||||
|
||||
|
||||
//Get the actual weight ( either in lbs or metric )
|
||||
/// usStandardCost = (UINT16) GetWeightBasedOnMetricOption( usStandardCost );
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "text.h"
|
||||
#include "GameSettings.h"
|
||||
#include "IMP Disability Trait.h" // Added this one - SANDRO
|
||||
|
||||
#endif
|
||||
|
||||
#define STARTING_LEVEL_BOX_POS_X ( 51 )
|
||||
|
||||
@@ -4491,9 +4491,6 @@
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\PostalService.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="sirtech.cpp">
|
||||
<FileConfiguration
|
||||
@@ -4644,12 +4641,6 @@
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_DeliveryMethods.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\XML_ShippingDestinations.cpp">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
@@ -4798,9 +4789,6 @@
|
||||
<File
|
||||
RelativePath="personnel.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\PostalService.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="sirtech.h">
|
||||
</File>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// WANNE - MP: Used for multiplayer
|
||||
#include "connect.h"
|
||||
#include "Strategic Event Handler.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/************************************************************************************/
|
||||
@@ -85,6 +86,7 @@ OBJECTTYPE CPostalService::tempObject;
|
||||
CPostalService::CPostalService()
|
||||
{
|
||||
}
|
||||
|
||||
void CPostalService::Clear()
|
||||
{
|
||||
_Shipments.clear();
|
||||
@@ -95,6 +97,7 @@ void CPostalService::Clear()
|
||||
_DeliveryMethods.clear();
|
||||
}
|
||||
|
||||
|
||||
UINT16 CPostalService::CreateNewShipment(UINT16 usDestinationID, UINT8 ubDeliveryMethodIndex, INT16 sSenderID)
|
||||
{
|
||||
if( usDestinationID > _UsedDestinationIDList.size() ||
|
||||
@@ -212,7 +215,7 @@ BOOLEAN CPostalService::SendShipment(UINT16 usShipmentID)
|
||||
}
|
||||
|
||||
SHIPMENT(sli).ShipmentStatus = SHIPMENT_INTRANSIT;
|
||||
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
if (is_client)
|
||||
@@ -548,6 +551,7 @@ BOOLEAN CPostalService::DeliverShipmentForMultiplayer(UINT16 usShipmentID)
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN CPostalService::RegisterDeliveryCallback(INT16 sSenderID, PtrToDeliveryCallbackFunc DeliveryCallbackFunc)
|
||||
{
|
||||
if(sSenderID < - 1 || !DeliveryCallbackFunc)
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "PostalService.h"
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
|
||||
//static EmailPtr pEmailList;
|
||||
|
||||
+7
-4
@@ -424,7 +424,7 @@ void GameInitFinances()
|
||||
if( (FileExists( FINANCES_DATA_FILE ) ) )
|
||||
{
|
||||
FileClearAttributes( FINANCES_DATA_FILE );
|
||||
FileDelete( FINANCES_DATA_FILE );
|
||||
FileDelete( FINANCES_DATA_FILE );
|
||||
}
|
||||
GetBalanceFromDisk( );
|
||||
}
|
||||
@@ -1612,6 +1612,9 @@ void GetBalanceFromDisk( void )
|
||||
HWFILE hFileHandle;
|
||||
INT32 iBytesRead=0;
|
||||
|
||||
if(!FileExists(FINANCES_DATA_FILE))
|
||||
return;
|
||||
|
||||
// open file
|
||||
hFileHandle=FileOpen( FINANCES_DATA_FILE,( FILE_OPEN_EXISTING | FILE_ACCESS_READ ), FALSE );
|
||||
|
||||
@@ -1620,7 +1623,7 @@ void GetBalanceFromDisk( void )
|
||||
{
|
||||
LaptopSaveInfo.iCurrentBalance = 0;
|
||||
// close file
|
||||
FileClose( hFileHandle );
|
||||
FileClose( hFileHandle );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1708,8 +1711,8 @@ UINT32 ReadInLastElementOfFinanceListAndReturnIdNumber( void )
|
||||
// make sure file is more than balance size + length of 1 record - 1 byte
|
||||
if ( FileGetSize( hFileHandle ) < sizeof( INT32 ) + sizeof( UINT32 ) + sizeof( UINT8 )+ sizeof(UINT8) + sizeof( INT32 ) )
|
||||
{
|
||||
FileClose( hFileHandle );
|
||||
return 0;
|
||||
FileClose( hFileHandle );
|
||||
return 0;
|
||||
}
|
||||
|
||||
// size is?
|
||||
|
||||
@@ -487,8 +487,8 @@ void ExitFloristOrderForm()
|
||||
RemoveButton( guiFlowerOrderGalleryButton );
|
||||
|
||||
//Store the text fields
|
||||
Get16BitStringFromField( 1, gsSentimentTextField );
|
||||
Get16BitStringFromField( 2, gsNameTextField );
|
||||
Get16BitStringFromField( 1, gsSentimentTextField, 75 );
|
||||
Get16BitStringFromField( 2, gsNameTextField, 35 );
|
||||
gbCurrentlySelectedCard = -1;
|
||||
|
||||
|
||||
@@ -1039,12 +1039,12 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode )
|
||||
//if its the personel sentiment field
|
||||
if( ubTextFieldID == 1 )
|
||||
{
|
||||
Get16BitStringFromField( ubTextFieldID, gsSentimentTextField );
|
||||
Get16BitStringFromField( ubTextFieldID, gsSentimentTextField, 75 );
|
||||
}
|
||||
else if( ubTextFieldID == 2 )
|
||||
{
|
||||
//else its the name field
|
||||
Get16BitStringFromField( ubTextFieldID, gsNameTextField );
|
||||
Get16BitStringFromField( ubTextFieldID, gsNameTextField, 35 );
|
||||
}
|
||||
|
||||
SetActiveField(0);
|
||||
@@ -1074,7 +1074,7 @@ BOOLEAN CreateDestroyFlowerOrderDestDropDown( UINT8 ubDropDownMode )
|
||||
|
||||
//disable the text entry fields
|
||||
// DisableAllTextFields();
|
||||
Get16BitStringFromField( 1, gsSentimentTextField );
|
||||
Get16BitStringFromField( 1, gsSentimentTextField, 75 );
|
||||
KillTextInputMode();
|
||||
|
||||
//disable the clear order and accept order buttons, (their rendering interferes with the drop down graphics)
|
||||
@@ -1267,12 +1267,12 @@ void HandleFloristOrderKeyBoardInput()
|
||||
//if its the personel sentiment field
|
||||
if( ubTextFieldID == 1 )
|
||||
{
|
||||
Get16BitStringFromField( ubTextFieldID, gsSentimentTextField );
|
||||
Get16BitStringFromField( ubTextFieldID, gsSentimentTextField, 75 );
|
||||
}
|
||||
else if( ubTextFieldID == 2 )
|
||||
{
|
||||
//else its the name field
|
||||
Get16BitStringFromField( ubTextFieldID, gsNameTextField );
|
||||
Get16BitStringFromField( ubTextFieldID, gsNameTextField, 35 );
|
||||
}
|
||||
|
||||
SetActiveField(0);
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@
|
||||
#include "LaptopSave.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#define TOP_X LAPTOP_SCREEN_UL_X
|
||||
#define TOP_Y LAPTOP_SCREEN_UL_Y
|
||||
@@ -226,8 +226,8 @@ void GameInitHistory()
|
||||
FileDelete( HISTORY_DATA_FILE );
|
||||
}
|
||||
|
||||
AddHistoryToPlayersLog(HISTORY_ACCEPTED_ASSIGNMENT_FROM_ENRICO, 0, GetWorldTotalMin( ), -1, -1);
|
||||
|
||||
if (!is_networked)
|
||||
AddHistoryToPlayersLog(HISTORY_ACCEPTED_ASSIGNMENT_FROM_ENRICO, 0, GetWorldTotalMin( ), -1, -1);
|
||||
}
|
||||
|
||||
void EnterHistory()
|
||||
|
||||
@@ -578,7 +578,7 @@ void EnterPersonnel( void )
|
||||
InitVariables();
|
||||
|
||||
// Clear out the current team list
|
||||
for (unsigned idx=0; idx < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; idx++) {
|
||||
for (unsigned idx=0; idx < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; idx++) {
|
||||
currentTeamList[idx] = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user