mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Merged Multi Player Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2144 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
extern INT32 iCurrentMapSectorZ;
|
||||
|
||||
@@ -377,7 +377,9 @@ void RenderRadarScreen( )
|
||||
SetObjectHandleShade( gusRadarImage, 0 );
|
||||
|
||||
//If night time and on surface, darken the radarmap.
|
||||
if( NightTime() )
|
||||
|
||||
// WANNE - MP: Only darken the radarmap in single player mode
|
||||
if( NightTime() && !is_networked )//hayden
|
||||
{
|
||||
if( guiCurrentScreen == MAP_SCREEN && !iCurrentMapSectorZ ||
|
||||
guiCurrentScreen == GAME_SCREEN && !gbWorldSectorZ )
|
||||
@@ -559,7 +561,14 @@ void RenderRadarScreen( )
|
||||
// Don't place guys in radar until visible!
|
||||
if ( pSoldier->bVisible == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) && !(pSoldier->ubMiscSoldierFlags & SOLDIER_MISC_XRAYED) )
|
||||
{
|
||||
continue;
|
||||
//hayden
|
||||
if(is_networked && pSoldier->bSide==0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;// ie dont render
|
||||
}
|
||||
}
|
||||
|
||||
// Don't render guys if they are dead!
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#include "builddefines.h"
|
||||
|
||||
// WANNE 2 <changed some lines>
|
||||
|
||||
#ifdef PRECOMPILEDHEADERS
|
||||
#include "TileEngine All.h"
|
||||
#include "PreBattle Interface.h"
|
||||
@@ -43,6 +45,9 @@
|
||||
#include "WordWrap.h"
|
||||
#include "Game Clock.h"
|
||||
#endif
|
||||
#include "connect.h"
|
||||
#include "saveloadscreen.h"
|
||||
|
||||
|
||||
typedef struct MERCPLACEMENT
|
||||
{
|
||||
@@ -70,6 +75,7 @@ extern BOOLEAN GetOverheadMouseGridNo( INT16 *psGridNo );
|
||||
|
||||
extern UINT16 iOffsetHorizontal;
|
||||
extern UINT16 iOffsetVertical;
|
||||
int islocked;
|
||||
|
||||
UINT8 gubDefaultButton = CLEAR_BUTTON;
|
||||
BOOLEAN gfTacticalPlacementGUIActive = FALSE;
|
||||
@@ -119,6 +125,8 @@ void SelectNextUnplacedUnit();
|
||||
BOOLEAN gfNorthValid, gfEastValid, gfSouthValid, gfWestValid;
|
||||
BOOLEAN gfChangedEntrySide = FALSE;
|
||||
|
||||
|
||||
|
||||
void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
|
||||
{
|
||||
if( gMapInformation.sNorthGridNo == -1 &&
|
||||
@@ -216,6 +224,7 @@ void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
|
||||
|
||||
void InitTacticalPlacementGUI()
|
||||
{
|
||||
islocked=0;//hayden
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
INT32 i, xp, yp;
|
||||
UINT8 ubFaceIndex;
|
||||
@@ -414,7 +423,8 @@ void InitTacticalPlacementGUI()
|
||||
MSYS_DefineRegion( &gMercPlacement[ i ].region, (UINT16)xp, (UINT16)yp, (UINT16)(xp + 54), (UINT16)(yp + 62), MSYS_PRIORITY_HIGH, 0, MercMoveCallback, MercClickCallback );
|
||||
}
|
||||
|
||||
PlaceMercs();
|
||||
|
||||
if(!is_client)PlaceMercs();//hayden
|
||||
|
||||
if( gubDefaultButton == GROUP_BUTTON )
|
||||
{
|
||||
@@ -662,6 +672,39 @@ void EnsureDoneButtonStatus()
|
||||
}
|
||||
}
|
||||
|
||||
void lockui (bool unlock) //lock onluck ui for lan //hayden
|
||||
{
|
||||
if(unlock==0 && islocked==0 && is_client)
|
||||
{
|
||||
islocked=1;
|
||||
DisableButton( iTPButtons[ DONE_BUTTON ] );
|
||||
DisableButton( iTPButtons[ SPREAD_BUTTON ] );
|
||||
DisableButton( iTPButtons[ GROUP_BUTTON ] );
|
||||
DisableButton( iTPButtons[ CLEAR_BUTTON ] );
|
||||
|
||||
SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, MPServerMessage[8], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
|
||||
|
||||
//send loaded
|
||||
send_loaded();
|
||||
}
|
||||
|
||||
if(unlock) //oh yeah ! :)
|
||||
{
|
||||
islocked=3;
|
||||
EnableButton( iTPButtons[ SPREAD_BUTTON ] );
|
||||
EnableButton( iTPButtons[ GROUP_BUTTON ] );
|
||||
EnableButton( iTPButtons[ CLEAR_BUTTON ] );
|
||||
|
||||
ButtonList[ iTPButtons[ GROUP_BUTTON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
|
||||
ButtonList[ iTPButtons[ GROUP_BUTTON ] ]->uiFlags |= BUTTON_DIRTY;
|
||||
gubDefaultButton = CLEAR_BUTTON;
|
||||
PlaceMercs();
|
||||
gMsgBox.bHandled = MSG_BOX_RETURN_OK; //close if still open
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void TacticalPlacementHandle()
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
@@ -669,6 +712,9 @@ void TacticalPlacementHandle()
|
||||
EnsureDoneButtonStatus();
|
||||
|
||||
RenderTacticalPlacementGUI();
|
||||
|
||||
if (is_networked)
|
||||
lockui(0);//lockui before placement while clients loading //hayden
|
||||
|
||||
if( gfRightButtonState )
|
||||
{
|
||||
@@ -691,24 +737,42 @@ void TacticalPlacementHandle()
|
||||
case ENTER:
|
||||
if( ButtonList[ iTPButtons[ DONE_BUTTON ] ]->uiFlags & BUTTON_ENABLED )
|
||||
{
|
||||
KillTacticalPlacementGUI();
|
||||
if(!is_client)KillTacticalPlacementGUI();
|
||||
//if(is_client)send_donegui(0); only by mouse //hayden
|
||||
}
|
||||
break;
|
||||
case 'c':
|
||||
ClearPlacementsCallback( ButtonList[ iTPButtons[ CLEAR_BUTTON ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
break;
|
||||
if(islocked!=1)ClearPlacementsCallback( ButtonList[ iTPButtons[ CLEAR_BUTTON ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
break;
|
||||
case 'g':
|
||||
GroupPlacementsCallback( ButtonList[ iTPButtons[ GROUP_BUTTON ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
break;
|
||||
if(islocked!=1)GroupPlacementsCallback( ButtonList[ iTPButtons[ GROUP_BUTTON ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
break;
|
||||
case 's':
|
||||
SpreadPlacementsCallback( ButtonList[ iTPButtons[ SPREAD_BUTTON ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
break;
|
||||
if(islocked!=1)SpreadPlacementsCallback( ButtonList[ iTPButtons[ SPREAD_BUTTON ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
break;
|
||||
case 'x':
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
HandleShortCutExitState();
|
||||
}
|
||||
break;
|
||||
case 'l'://hayden
|
||||
if( InputEvent.usKeyState & ALT_DOWN )
|
||||
{
|
||||
if (is_networked)
|
||||
{
|
||||
KillTacticalPlacementGUI();
|
||||
DoQuickLoad();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case '7':
|
||||
if (is_networked)
|
||||
{
|
||||
if(is_server)
|
||||
manual_overide();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -765,7 +829,12 @@ void TacticalPlacementHandle()
|
||||
}
|
||||
if( gfKillTacticalGUI == 1 )
|
||||
{
|
||||
KillTacticalPlacementGUI();
|
||||
if(is_client)
|
||||
{
|
||||
gfKillTacticalGUI = FALSE;
|
||||
send_donegui(0);
|
||||
}
|
||||
if(!is_client)KillTacticalPlacementGUI();
|
||||
}
|
||||
else if( gfKillTacticalGUI == 2 )
|
||||
{
|
||||
@@ -966,6 +1035,8 @@ void MercMoveCallback( MOUSE_REGION *reg, INT32 reason )
|
||||
|
||||
void MercClickCallback( MOUSE_REGION *reg, INT32 reason )
|
||||
{
|
||||
if(islocked != 1)//hayden
|
||||
{
|
||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
INT8 i;
|
||||
@@ -984,6 +1055,7 @@ void MercClickCallback( MOUSE_REGION *reg, INT32 reason )
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1178,11 +1250,26 @@ void PutDownMercPiece( INT32 iPlacement )
|
||||
if( sGridNo != NOWHERE )
|
||||
{
|
||||
ConvertGridNoToCellXY( sGridNo, &sCellX, &sCellY );
|
||||
pSoldier->EVENT_SetSoldierPosition( (FLOAT)sCellX, (FLOAT)sCellY );
|
||||
|
||||
FLOAT scX = (FLOAT)sCellX;
|
||||
FLOAT scY = (FLOAT)sCellY;//hayden
|
||||
if (is_networked)
|
||||
{
|
||||
pSoldier->EVENT_SetSoldierPosition( scX, scY );
|
||||
}
|
||||
else
|
||||
{
|
||||
pSoldier->EVENT_SetSoldierPosition( (FLOAT)sCellX, (FLOAT)sCellY );
|
||||
}
|
||||
|
||||
|
||||
pSoldier->EVENT_SetSoldierDirection( ubDirection );
|
||||
pSoldier->ubInsertionDirection = pSoldier->ubDirection;
|
||||
gMercPlacement[ iPlacement ].fPlaced = TRUE;
|
||||
gMercPlacement[ iPlacement ].pSoldier->bInSector = TRUE;
|
||||
//hayden
|
||||
if(is_client)send_gui_pos(pSoldier, scX, scY);
|
||||
if(is_client)send_gui_dir(pSoldier, ubDirection);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
FavorSizeOrSpeed="1"
|
||||
OptimizeForProcessor="3"
|
||||
OptimizeForWindowsApplication="TRUE"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic;..\Laptop;.\"
|
||||
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;NDEBUG;WIN32;_WINDOWS;JA2;XML_STATIC;CINTERFACE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
@@ -287,7 +287,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""..\Standard Gaming Platform";..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic;..\lua;..\Laptop;.\"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;"..\Standard Gaming Platform";..\;..\Tactical;..\Utils;..\tacticalai;..\Editor;..\strategic;..\lua;..\Laptop;.\"
|
||||
PreprocessorDefinitions="CALLBACKTIMER;PRECOMPILEDHEADERS;_DEBUG;WIN32;_WINDOWS;JA2;_VTUNE_PROFILING;XML_STATIC;CINTERFACE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Version="8.00"
|
||||
Name="TileEngine_2005Express"
|
||||
ProjectGUID="{FC1938E8-9253-49A8-AA99-4639BBB46C1B}"
|
||||
RootNamespace="TileEngine_2005Express"
|
||||
@@ -41,6 +41,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -104,6 +105,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#ifdef JA2EDITOR
|
||||
#include "Soldier Init List.h"
|
||||
extern SOLDIERINITNODE *gpSelected;
|
||||
@@ -1180,6 +1182,7 @@ void RenderOverheadOverlays()
|
||||
{ //loop through all soldiers.
|
||||
end = MAX_NUM_SOLDIERS;
|
||||
}
|
||||
if(is_networked)end = MAX_NUM_SOLDIERS;
|
||||
|
||||
for( i = 0; i < end; i++ )
|
||||
{
|
||||
@@ -1200,7 +1203,14 @@ void RenderOverheadOverlays()
|
||||
|
||||
if( !gfTacticalPlacementGUIActive && pSoldier->bLastRenderVisibleValue == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) )
|
||||
{
|
||||
continue;
|
||||
//hayden
|
||||
if(is_networked && pSoldier->bSide==0)
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;// ie dont render
|
||||
}
|
||||
}
|
||||
|
||||
if ( pSoldier->sGridNo == NOWHERE )
|
||||
@@ -1263,6 +1273,16 @@ void RenderOverheadOverlays()
|
||||
#endif
|
||||
if( !gfTacticalPlacementGUIActive )
|
||||
{ //normal
|
||||
if(is_networked)
|
||||
{
|
||||
if(pSoldier->bTeam!=0)
|
||||
{
|
||||
if(pSoldier->bSide==1)Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 1 );
|
||||
if(pSoldier->bSide==0)Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 3 );
|
||||
}
|
||||
else Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
}
|
||||
else
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 3), (INT16)(sY + 9));
|
||||
}
|
||||
@@ -1287,6 +1307,16 @@ void RenderOverheadOverlays()
|
||||
}
|
||||
else
|
||||
{ //normal
|
||||
if(is_networked)
|
||||
{
|
||||
if(pSoldier->bTeam!=0)
|
||||
{
|
||||
if(pSoldier->bSide==1)continue;//dont render enemy
|
||||
if(pSoldier->bSide==0)Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, 3 );
|
||||
}
|
||||
else Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
}
|
||||
else
|
||||
Blt8BPPDataTo16BPPBufferTransparent((UINT16*)pDestBuf, uiDestPitchBYTES, hVObject, sX, sY, pSoldier->bTeam );
|
||||
RegisterBackgroundRect(BGND_FLAG_SINGLE, NULL, sX, sY, (INT16)(sX + 3), (INT16)(sY + 9));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user