New feature (by DepressivesBrot): Molle Items

- individual LBE gear can be created via MOLLE items. For each LBE item, there's a definition which pockets may be changed and how much space the new pockets may take up in total.
- If there's a free pocket slot and enough space -> attach item and enable pocket.
- for further description, see Doc/Design Document- MOLLE.txt

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5441 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-08-02 22:30:15 +00:00
parent 832335d904
commit 3077e27d9f
65 changed files with 766 additions and 294 deletions
+2 -2
View File
@@ -164,7 +164,7 @@ void GenerateBuildings( void )
// for each location in a room try to find building info
for ( uiLoop = 0; uiLoop < WORLD_MAX; uiLoop++ )
{
if ( (gubWorldRoomInfo[ uiLoop ] != NO_ROOM) && (gubBuildingInfo[ uiLoop ] == NO_BUILDING) && (FindStructure( uiLoop, STRUCTURE_NORMAL_ROOF ) != NULL) )
if ( (gusWorldRoomInfo[ uiLoop ] != NO_ROOM) && (gubBuildingInfo[ uiLoop ] == NO_BUILDING) && (FindStructure( uiLoop, STRUCTURE_NORMAL_ROOF ) != NULL) )
{
GenerateBuilding( uiLoop );
}
@@ -646,7 +646,7 @@ void GenerateBuildings( void )
// for each location in a room try to find building info
for ( uiLoop = 0; uiLoop < WORLD_MAX; uiLoop++ )
{
if ( (gubWorldRoomInfo[ uiLoop ] != NO_ROOM) && (gubBuildingInfo[ uiLoop ] == NO_BUILDING) && (FindStructure( uiLoop, STRUCTURE_NORMAL_ROOF ) != NULL) )
if ( (gusWorldRoomInfo[ uiLoop ] != NO_ROOM) && (gubBuildingInfo[ uiLoop ] == NO_BUILDING) && (FindStructure( uiLoop, STRUCTURE_NORMAL_ROOF ) != NULL) )
{
GenerateBuilding( uiLoop );
}
+25 -16
View File
@@ -93,8 +93,9 @@
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
class SOLDIERTYPE;
BOOLEAN HookerInRoom( UINT8 ubRoom );
//DBrot: More Rooms
//BOOLEAN HookerInRoom( UINT8 ubRoom );
BOOLEAN HookerInRoom( UINT16 usRoom );
// MODULE FOR EXPLOSIONS
@@ -1175,22 +1176,24 @@ BOOLEAN ExplosiveDamageStructureAtGridNo( STRUCTURE * pCurrent, STRUCTURE **ppNe
// CJC, Sept 16: if we destroy any wall of the brothel, make Kingpin's men hostile!
if ( gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_C && gbWorldSectorZ == 0 )
{
UINT8 ubRoom;
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
BOOLEAN fInRoom;
fInRoom = InARoom( sGridNo, &ubRoom );
fInRoom = InARoom( sGridNo, &usRoom );
if ( !fInRoom )
{
// try to south
fInRoom = InARoom( sGridNo + DirectionInc( SOUTH ) , &ubRoom );
fInRoom = InARoom( sGridNo + DirectionInc( SOUTH ) , &usRoom );
if ( !fInRoom )
{
// try to east
fInRoom = InARoom( sGridNo + DirectionInc( EAST ) , &ubRoom );
fInRoom = InARoom( sGridNo + DirectionInc( EAST ) , &usRoom );
}
}
if ( fInRoom && IN_BROTHEL( ubRoom ) )
if ( fInRoom && IN_BROTHEL( usRoom ) )
{
CivilianGroupChangesSides( KINGPIN_CIV_GROUP );
}
@@ -3092,9 +3095,11 @@ void BillyBlocksDoorCallback( void )
TriggerNPCRecord( BILLY, 6 );
}
BOOLEAN HookerInRoom( UINT8 ubRoom )
BOOLEAN HookerInRoom( UINT16 usRoom )
{
UINT8 ubLoop, ubTempRoom;
//DBrot: More Rooms
UINT8 ubLoop;//, ubTempRoom;
UINT16 usTempRoom;
SOLDIERTYPE * pSoldier;
for ( ubLoop = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ubLoop++ )
@@ -3103,7 +3108,7 @@ BOOLEAN HookerInRoom( UINT8 ubRoom )
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE && pSoldier->aiData.bNeutral && pSoldier->ubBodyType == MINICIV )
{
if ( InARoom( pSoldier->sGridNo, &ubTempRoom ) && ubTempRoom == ubRoom )
if ( InARoom( pSoldier->sGridNo, &usTempRoom ) && usTempRoom == usRoom )
{
return( TRUE );
}
@@ -3418,15 +3423,17 @@ void PerformItemAction( INT32 sGridNo, OBJECTTYPE * pObj )
INT16 sTeleportSpot;
INT16 sDoorSpot;
UINT8 ubDirection;
UINT8 ubRoom, ubOldRoom;
//DBrot: More Rooms
//UINT8 ubRoom, ubOldRoom;
UINT16 usRoom, usOldRoom;
ubID = WhoIsThere2( sGridNo, 0 );
if ( (ubID != NOBODY) && (MercPtrs[ ubID ]->bTeam == gbPlayerNum) )
{
if ( InARoom( sGridNo, &ubRoom ) && InARoom( MercPtrs[ ubID ]->sOldGridNo, &ubOldRoom ) && ubOldRoom != ubRoom )
if ( InARoom( sGridNo, &usRoom ) && InARoom( MercPtrs[ ubID ]->sOldGridNo, &usOldRoom ) && usOldRoom != usRoom )
{
// also require there to be a miniskirt civ in the room
if ( HookerInRoom( ubRoom ) )
if ( HookerInRoom( usRoom ) )
{
// stop the merc...
@@ -3487,10 +3494,12 @@ void PerformItemAction( INT32 sGridNo, OBJECTTYPE * pObj )
break;
case ACTION_ITEM_REVEAL_ROOM:
{
UINT8 ubRoom;
if ( InAHiddenRoom( sGridNo, &ubRoom ) )
//DBrot: More Rooms
//UINT8 ubRoom;
UINT16 usRoom;
if ( InAHiddenRoom( sGridNo, &usRoom ) )
{
RemoveRoomRoof( sGridNo, ubRoom, NULL );
RemoveRoomRoof( sGridNo, usRoom, NULL );
}
}
break;
+3 -2
View File
@@ -145,8 +145,9 @@ extern BOOLEAN gfExplosionQueueMayHaveChangedSight;
extern void TogglePressureActionItemsInGridNo( INT32 sGridNo );
extern BOOLEAN DoesSAMExistHere( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ, INT32 sGridNo );
extern BOOLEAN HookerInRoom( UINT8 ubRoom );
//DBrot: More Rooms
//extern BOOLEAN HookerInRoom( UINT8 ubRoom );
extern BOOLEAN HookerInRoom( UINT16 usRoom );
#ifdef JA2UB
extern void HavePersonAtGridnoStop( UINT32 sGridNo );
+16 -16
View File
@@ -583,10 +583,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x<WORLD_COLS/2+i; x++, y--)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stNorthEdgepointArraySize++] = sGridNo;
++sGridNo;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stNorthEdgepointArraySize++] = sGridNo;
}
}
@@ -607,10 +607,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x<WORLD_COLS-i; x++, y++)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stEastEdgepointArraySize++] = sGridNo;
sGridNo += WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stEastEdgepointArraySize++] = sGridNo;
}
}
@@ -631,10 +631,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x>=WORLD_COLS/2-i; x--, y++)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stSouthEdgepointArraySize++] = sGridNo;
--sGridNo;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stSouthEdgepointArraySize++] = sGridNo;
}
}
@@ -655,10 +655,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x>=0+i; x--, y--)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stWestEdgepointArraySize++] = sGridNo;
sGridNo -= WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus1stWestEdgepointArraySize++] = sGridNo;
}
}
@@ -684,10 +684,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x<WORLD_COLS/2+i; x++, y--)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndNorthEdgepointArraySize++] = sGridNo;
++sGridNo;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndNorthEdgepointArraySize++] = sGridNo;
}
}
@@ -708,10 +708,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x<WORLD_COLS-i; x++, y++)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndEastEdgepointArraySize++] = sGridNo;
sGridNo += WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndEastEdgepointArraySize++] = sGridNo;
}
}
@@ -732,10 +732,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x>=WORLD_COLS/2-i; x--, y++)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndSouthEdgepointArraySize++] = sGridNo;
--sGridNo;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndSouthEdgepointArraySize++] = sGridNo;
}
}
@@ -756,10 +756,10 @@ void GenerateMapEdgepoints(BOOLEAN fValidate)
for(x, y; x>=0+i; x--, y--)
{
sGridNo = x + y * WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndWestEdgepointArraySize++] = sGridNo;
sGridNo -= WORLD_COLS;
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gubWorldRoomInfo[sGridNo] || gfBasement))
if(gpWorldLevelData[sGridNo].uiFlags & MAPELEMENT_REACHABLE && (!gusWorldRoomInfo[sGridNo] || gfBasement))
sVGridNo[gus2ndWestEdgepointArraySize++] = sGridNo;
}
}
+24 -22
View File
@@ -26,7 +26,9 @@
// Room Information
//UINT8 gubWorldRoomInfo[ WORLD_MAX ];
UINT8* gubWorldRoomInfo = NULL;
//DBrot: More Rooms
//UINT8* gubWorldRoomInfo = NULL;
UINT16* gusWorldRoomInfo = NULL;
UINT8 gubWorldRoomHidden[ MAX_ROOMS ];
@@ -41,14 +43,14 @@ void ShutdownRoomDatabase( )
{
}
void SetTileRoomNum( INT32 sGridNo, UINT8 ubRoomNum )
//DBrot: More Rooms
void SetTileRoomNum( INT32 sGridNo, UINT16 usRoomNum )
{
// Add to global room list
gubWorldRoomInfo[ sGridNo ] = ubRoomNum;
gusWorldRoomInfo[ sGridNo ] = usRoomNum;
}
void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 ubRoomNum )
//DBrot: More Rooms
void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 usRoomNum )
{
INT32 cnt1, cnt2;
@@ -56,20 +58,20 @@ void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 ubRoomNum )
{
for ( cnt2 = pSelectRegion->iLeft; cnt2 <= pSelectRegion->iRight; cnt2++ )
{
gubWorldRoomInfo[ MAPROWCOLTOPOS( cnt1, cnt2 ) ] = ubRoomNum;
gusWorldRoomInfo[ MAPROWCOLTOPOS( cnt1, cnt2 ) ] = usRoomNum;
}
}
}
BOOLEAN InARoom( INT32 sGridNo, UINT8 *pubRoomNo )
//DBrot: More Rooms
BOOLEAN InARoom( INT32 sGridNo, UINT16 *pusRoomNo )
{
// WANNE: Bugzilla #360: Crash when moving via helicopter from museum sector
if ( sGridNo >= 0 && gubWorldRoomInfo[ sGridNo ] != NO_ROOM )
if ( sGridNo >= 0 && gusWorldRoomInfo[ sGridNo ] != NO_ROOM )
{
if ( pubRoomNo )
if ( pusRoomNo )
{
*pubRoomNo = gubWorldRoomInfo[ sGridNo ];
*pusRoomNo = gusWorldRoomInfo[ sGridNo ];
}
return( TRUE );
}
@@ -77,14 +79,14 @@ BOOLEAN InARoom( INT32 sGridNo, UINT8 *pubRoomNo )
return( FALSE );
}
BOOLEAN InAHiddenRoom( INT32 sGridNo, UINT8 *pubRoomNo )
//DBrot: More Rooms
BOOLEAN InAHiddenRoom( INT32 sGridNo, UINT16 *pusRoomNo )
{
if ( sGridNo >= 0 && gubWorldRoomInfo[ sGridNo ] != NO_ROOM )
if ( sGridNo >= 0 && gusWorldRoomInfo[ sGridNo ] != NO_ROOM )
{
if ( (gubWorldRoomHidden[ gubWorldRoomInfo[ sGridNo ] ] ) )
if ( (gubWorldRoomHidden[ gusWorldRoomInfo[ sGridNo ] ] ) )
{
*pubRoomNo = gubWorldRoomInfo[ sGridNo ];
*pusRoomNo = gusWorldRoomInfo[ sGridNo ];
return( TRUE );
}
}
@@ -124,7 +126,7 @@ void SetGridNoRevealedFlag( INT32 sGridNo )
SetRoofIndexFlagsFromTypeRange( sGridNo, FIRSTROOF, FOURTHROOF, LEVELNODE_HIDDEN );
// ATE: Do this only if we are in a room...
if ( gubWorldRoomInfo[ sGridNo ] != NO_ROOM )
if ( gusWorldRoomInfo[ sGridNo ] != NO_ROOM )
{
SetStructAframeFlags( sGridNo, LEVELNODE_HIDDEN );
// Find gridno one east as well...
@@ -186,7 +188,7 @@ void SetGridNoRevealedFlag( INT32 sGridNo )
pStructure = pStructure->pNext;
}
gubWorldRoomHidden[ gubWorldRoomInfo[ sGridNo ] ] = FALSE;
gubWorldRoomHidden[ gusWorldRoomInfo[ sGridNo ] ] = FALSE;
}
@@ -259,8 +261,8 @@ void ExamineGridNoForSlantRoofExtraGraphic( INT32 sCheckGridNo )
}
void RemoveRoomRoof( INT32 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
//DBrot: More Rooms
void RemoveRoomRoof( INT32 sGridNo, UINT16 usRoomNum, SOLDIERTYPE *pSoldier )
{
INT32 cnt;
ITEM_POOL *pItemPool;
@@ -272,7 +274,7 @@ void RemoveRoomRoof( INT32 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier )
// LOOP THORUGH WORLD AND CHECK ROOM INFO
for ( cnt = 0; cnt < WORLD_MAX; cnt++ )
{
if ( gubWorldRoomInfo[ cnt ] == bRoomNum )
if ( gusWorldRoomInfo[ cnt ] == usRoomNum )
{
SetGridNoRevealedFlag( cnt );//dnl ch56 141009
+16 -9
View File
@@ -5,22 +5,29 @@
#include "worlddef.h"
#define NO_ROOM 0
#define MAX_ROOMS 250
//DBrot: More Rooms
//#define MAX_ROOMS 250
#define MAX_ROOMS 65530
extern UINT8 gubWorldRoomHidden[ MAX_ROOMS ];
extern UINT8* gubWorldRoomInfo;
//extern UINT8* gubWorldRoomInfo;
extern UINT16* gusWorldRoomInfo;
BOOLEAN InitRoomDatabase( );
void ShutdownRoomDatabase( );
void SetTileRoomNum( INT32 sGridNo, UINT8 ubRoomNum );
void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 ubRoomNum );
//void SetTileRoomNum( INT32 sGridNo, UINT8 ubRoomNum );
//void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT8 ubRoomNum );
void RemoveRoomRoof( INT32 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier );
BOOLEAN InARoom( INT32 sGridNo, UINT8 *pubRoomNo );
BOOLEAN InAHiddenRoom( INT32 sGridNo, UINT8 *pubRoomNo );
//void RemoveRoomRoof( INT32 sGridNo, UINT8 bRoomNum, SOLDIERTYPE *pSoldier );
//BOOLEAN InARoom( INT32 sGridNo, UINT8 *pubRoomNo );
//BOOLEAN InAHiddenRoom( INT32 sGridNo, UINT8 *pubRoomNo );
void SetTileRoomNum( INT32 sGridNo, UINT16 usRoomNum );
void SetTileRangeRoomNum( SGPRect *pSelectRegion, UINT16 usRoomNum );
void RemoveRoomRoof( INT32 sGridNo, UINT16 usRoomNum, SOLDIERTYPE *pSoldier );
BOOLEAN InARoom( INT32 sGridNo, UINT16 *pusRoomNo );
BOOLEAN InAHiddenRoom( INT32 sGridNo, UINT16 *pusRoomNo );
void SetGridNoRevealedFlag( INT32 sGridNo );
+53 -13
View File
@@ -751,15 +751,26 @@ void RenderTacticalPlacementGUI()
usHatchColor = Get16BPPColor( FROMRGB( 63, 31, 31 ) );
}
gfValidLocationsChanged--;
//DBrot bigger map code
if(gfUseBiggerOverview){
BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, iOffsetHorizontal, iOffsetVertical, 1434, 716 );
InvalidateRegion( iOffsetHorizontal, iOffsetVertical, iOffsetHorizontal + 1434, iOffsetVertical + 716 );
gTPClipRect.iLeft = iOffsetHorizontal + 1;
gTPClipRect.iTop = iOffsetVertical + 1;
gTPClipRect.iBottom = iOffsetVertical + 716;// 318;
gTPClipRect.iRight = iOffsetHorizontal + 1434; //634;
}else{
BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, iOffsetHorizontal, iOffsetVertical, 640, 320 );
InvalidateRegion( iOffsetHorizontal, iOffsetVertical, iOffsetHorizontal + 640, iOffsetVertical + 320 );
//dnl ch45 051009
gTPClipRect.iLeft = iOffsetHorizontal + 1;
gTPClipRect.iTop = iOffsetVertical + 1;
gTPClipRect.iBottom = iOffsetVertical + 318;
gTPClipRect.iRight = iOffsetHorizontal + 634;
}
if( gbCursorMercID == -1 )
{
// WANNE - MP: Center
@@ -805,37 +816,66 @@ void RenderTacticalPlacementGUI()
GetWorldXYAbsoluteScreenXY(sX, sY, &sWorldScreenX, &sWorldScreenY);
sWorldScreenX += 20;// Correction from invisible area X
sWorldScreenY += 35;// Correction from invisible area Y
switch(gMercPlacement[gbCursorMercID].ubStrategicInsertionCode)
{
//DBrot: adjust offsets for big maps
if(gfUseBiggerOverview){
switch(gMercPlacement[gbCursorMercID].ubStrategicInsertionCode){
case INSERTION_CODE_NORTH:
if(sWorldScreenY <= PLACEMENT_OFFSET)
{
//if(sWorldScreenY <= PLACEMENT_OFFSET){
//sY = (PLACEMENT_OFFSET - sWorldScreenY) / 5;
//gTPClipRect.iTop += sY;
gTPClipRect.iTop += PLACEMENT_OFFSET/5;
//}
break;
case INSERTION_CODE_EAST:
//if((sWorldScreenX + NORMAL_MAP_SCREEN_WIDTH) >= (MAPWIDTH - PLACEMENT_OFFSET)){
//sX = ((sWorldScreenX + NORMAL_MAP_SCREEN_WIDTH) - (MAPWIDTH - PLACEMENT_OFFSET)) / 5;
//gTPClipRect.iRight -= sX;
gTPClipRect.iRight -= PLACEMENT_OFFSET/5;
//}
break;
case INSERTION_CODE_SOUTH:
//if((sWorldScreenY + NORMAL_MAP_SCREEN_HEIGHT) >= (MAPHEIGHT - PLACEMENT_OFFSET)){
//sY = ((sWorldScreenY + NORMAL_MAP_SCREEN_HEIGHT) - (MAPHEIGHT - PLACEMENT_OFFSET)) / 5;
//gTPClipRect.iBottom -= sY;
gTPClipRect.iBottom -= PLACEMENT_OFFSET/5;
//}
break;
case INSERTION_CODE_WEST:
//if(sWorldScreenX <= PLACEMENT_OFFSET){
//sX = (PLACEMENT_OFFSET - sWorldScreenX) / 5;
//gTPClipRect.iLeft += sX;
gTPClipRect.iLeft += PLACEMENT_OFFSET/5;
//}
break;
}
}else{
switch(gMercPlacement[gbCursorMercID].ubStrategicInsertionCode){
case INSERTION_CODE_NORTH:
if(sWorldScreenY <= PLACEMENT_OFFSET){
sY = (PLACEMENT_OFFSET - sWorldScreenY) / 5;
gTPClipRect.iTop += sY;
}
break;
case INSERTION_CODE_EAST:
if((sWorldScreenX + NORMAL_MAP_SCREEN_WIDTH) >= (MAPWIDTH - PLACEMENT_OFFSET))
{
if((sWorldScreenX + NORMAL_MAP_SCREEN_WIDTH) >= (MAPWIDTH - PLACEMENT_OFFSET)){
sX = ((sWorldScreenX + NORMAL_MAP_SCREEN_WIDTH) - (MAPWIDTH - PLACEMENT_OFFSET)) / 5;
gTPClipRect.iRight -= sX;
}
break;
case INSERTION_CODE_SOUTH:
if((sWorldScreenY + NORMAL_MAP_SCREEN_HEIGHT) >= (MAPHEIGHT - PLACEMENT_OFFSET))
{
if((sWorldScreenY + NORMAL_MAP_SCREEN_HEIGHT) >= (MAPHEIGHT - PLACEMENT_OFFSET)){
sY = ((sWorldScreenY + NORMAL_MAP_SCREEN_HEIGHT) - (MAPHEIGHT - PLACEMENT_OFFSET)) / 5;
gTPClipRect.iBottom -= sY;
}
break;
case INSERTION_CODE_WEST:
if(sWorldScreenX <= PLACEMENT_OFFSET)
{
if(sWorldScreenX <= PLACEMENT_OFFSET){
sX = (PLACEMENT_OFFSET - sWorldScreenX) / 5;
gTPClipRect.iLeft += sX;
}
break;
}
}
// WANNE - MP: Center
if (is_networked && gfCenter)
@@ -1063,7 +1103,7 @@ void TacticalPlacementHandle()
}
gfValidCursor = FALSE;
if(gbSelectedMercID != -1 && gusMouseYPos < (iOffsetVertical + 320) && gusMouseYPos > iOffsetVertical && gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 640))
if(gbSelectedMercID != -1 && ((gusMouseYPos < (iOffsetVertical + 320) && gusMouseYPos > iOffsetVertical && gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 640))||(gfUseBiggerOverview && (gusMouseYPos < (iOffsetVertical + 716) && gusMouseYPos > iOffsetVertical && gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 1432) ))))
{
//dnl ch45 051009
INT16 sWorldScreenX = (gusMouseXPos - iOffsetHorizontal) * 5;
+81 -14
View File
@@ -39,6 +39,7 @@
#include "gameloop.h"
#include "sysutil.h"
#include "tile surface.h"
#include "GameSettings.h"
#include <vector>
#endif
@@ -83,7 +84,15 @@ INT32 gsOveritemPoolGridNo;
UINT16 iOffsetHorizontal; // Horizontal start postion of the overview map
UINT16 iOffsetVertical; // Vertical start position of the overview map
//DBrot: keep track if we should use a bigger version of the overview map for big maps
//for now, this is a custom solution applicable in 1920x1080
BOOLEAN gfUseBiggerOverview = FALSE;
UINT8 ubResolutionTable[6] = {2, 3, 4, 6, 8, 12};
UINT8 gubGridDivisor;
#define HORGRIDFRAME 1440
#define VERGRIDFRAME 720
#define SHARPBORDER 1
#define HATCHED 2
//dnl ch45 021009 Current position of map displayed in overhead map, (A=TopLeft, B=BottomLeft, C=TopRight)
#define MAXSCROLL 4
INT32 giXA = 0, giYA = WORLD_ROWS/2;
@@ -431,8 +440,12 @@ void HandleOverheadMap( )
RestoreBackgroundRects( );
// Render the overhead map
//DBrot: use a bigger overhead map if we have the space
if(gfUseBiggerOverview){
RenderOverheadMap(giXA, giYA, iOffsetHorizontal, iOffsetVertical, 1438+iOffsetHorizontal, 718+iOffsetVertical, FALSE);//dnl ch45 011009
}else{
RenderOverheadMap(giXA, giYA, iOffsetHorizontal, iOffsetVertical, 640+iOffsetHorizontal, 320+iOffsetVertical, FALSE);//dnl ch45 011009
}
HandleTalkingAutoFaces( );
if( !gfEditMode )
@@ -570,15 +583,27 @@ void GoIntoOverheadMap( )
HVOBJECT hVObject;
gfInOverheadMap = TRUE;
//dnl??? ch45 021009 Add here moving overhead map cords to your current position on big map
//RestoreExternBackgroundRect( INTERFACE_START_X, INTERFACE_START_Y, SCREEN_WIDTH, INTERFACE_HEIGHT );
// Overview map should be centered in the middle of the tactical screen.
//DBrot: Allow bigger overview if possible
if((iResolution >= _1680x1050) && WORLD_MAX == 129600){
iOffsetHorizontal = (SCREEN_WIDTH / 2) - (1440 / 2); // Horizontal start postion of the overview map
iOffsetVertical = 98;//(SCREEN_HEIGHT - 160) / 2 - 160; // Vertical start position of the overview map
gfUseBiggerOverview = TRUE;
}else{
iOffsetHorizontal = (SCREEN_WIDTH / 2) - (640 / 2); // Horizontal start postion of the overview map
iOffsetVertical = (SCREEN_HEIGHT - 160) / 2 - 160; // Vertical start position of the overview map
}
if(NightTime()){
gubGridDivisor = ubResolutionTable[gGameExternalOptions.ubGridResolutionNight];
}else{
gubGridDivisor = ubResolutionTable[gGameExternalOptions.ubGridResolutionDay];
}
MSYS_DefineRegion( &OverheadBackgroundRegion, 0, 0 , SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH,
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
@@ -606,8 +631,12 @@ void GoIntoOverheadMap( )
FilenameForBPP("INTERFACE\\MAP_BORD_800x600.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiOVERMAP ) )
AssertMsg(0, "Missing INTERFACE\\MAP_BORD_800x600.sti" );
}
else
}else if(iResolution >= _1680x1050){
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\MAP_BORD_1920x1080.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiOVERMAP ) )
AssertMsg(0, "Missing INTERFACE\\MAP_BORD_1920x1080.sti" );
}else
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\MAP_BORD_1024x768.sti", VObjectDesc.ImageFile);
@@ -700,7 +729,7 @@ void HandleOverheadUI(void)
void ScrollOverheadMap(void)
{
if(WORLD_MAX == OLD_WORLD_MAX)
if(WORLD_MAX == OLD_WORLD_MAX || gfUseBiggerOverview)
return;
UINT32 uiFlags = 0;
INT32 i;
@@ -1224,10 +1253,14 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
CalculateRestrictedMapCoords( WEST, &sX1, &sY1, &sX2, &sY2, sEndXS, sEndYS );
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
}
if(!fFromMapUtility) //LJDOldSM
//DBrot: bigger overview code
if(!fFromMapUtility){//LJDOldSM
if(gfUseBiggerOverview && iResolution >= _1680x1050){
BltVideoObjectFromIndex(FRAME_BUFFER, uiOVERMAP, 0, ((SCREEN_WIDTH / 2) - (1432 / 2) - 40), 60, VO_BLT_SRCTRANSPARENCY, NULL);// Render border!
}else{
BltVideoObjectFromIndex(FRAME_BUFFER, uiOVERMAP, 0, xResOffset, yResOffset, VO_BLT_SRCTRANSPARENCY, NULL);// Render border!
}
}
// Update the save buffer
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
UINT8 *pDestBuf, *pSrcBuf;
@@ -1261,8 +1294,6 @@ void RenderOverheadOverlays()
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
GetVideoObject( &hVObject, uiPERSONS );
//SOLDIER OVERLAY
if( gfTacticalPlacementGUIActive )
{ //loop through only the player soldiers
@@ -1274,6 +1305,10 @@ void RenderOverheadOverlays()
}
if(is_networked)end = MAX_NUM_SOLDIERS;
SGPRect HostileArea = {0,0,0,0};
for( i = 0; i < end; i++ )
{
//First, check to see if the soldier exists and is in the sector.
@@ -1284,7 +1319,29 @@ void RenderOverheadOverlays()
if(!GetOverheadScreenXYFromGridNo(pSoldier->sGridNo, &sX, &sY))//dnl ch45 041009
continue;
//DBrot: mark his general area as hostile
if(!gfEditMode && gGameSettings.fOptions[TOPTION_SHOW_LAST_ENEMY] && gfUseBiggerOverview && gGameExternalOptions.ubMarkerMode && gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector <= gGameExternalOptions.ubSoldiersLeft){
if(pSoldier->bTeam == ENEMY_TEAM){
UINT8 ubGridSquareX, ubGridSquareY;
ubGridSquareX = sX / (HORGRIDFRAME / gubGridDivisor); //( pSoldier->sGridNo / WORLD_COLS ) / ( WORLD_COLS / ubResolutionTable[gGameExternalOptions.ubGridResolution]);
ubGridSquareY = sY / (VERGRIDFRAME / gubGridDivisor); //( pSoldier->sGridNo - ( ( pSoldier->sGridNo / WORLD_COLS ) * WORLD_COLS ) ) / ( WORLD_COLS / ubResolutionTable[gGameExternalOptions.ubGridResolution]);
HostileArea.iLeft = iOffsetHorizontal + (((HORGRIDFRAME / gubGridDivisor) * ubGridSquareX));
HostileArea.iTop = iOffsetVertical + (((VERGRIDFRAME / gubGridDivisor) * ubGridSquareY));
HostileArea.iRight = iOffsetHorizontal + (((HORGRIDFRAME / gubGridDivisor) * (ubGridSquareX + 1)));
HostileArea.iBottom = iOffsetVertical + (((VERGRIDFRAME / gubGridDivisor) * (ubGridSquareY + 1)));
if(gGameExternalOptions.ubMarkerMode == SHARPBORDER)
RectangleDraw(TRUE, HostileArea.iLeft, HostileArea.iTop, HostileArea.iRight, HostileArea.iBottom, 255, pDestBuf);
if(gGameExternalOptions.ubMarkerMode == HATCHED){
RectangleDraw(TRUE, HostileArea.iLeft, HostileArea.iTop, HostileArea.iRight, HostileArea.iBottom, 0xF000, pDestBuf);
Blt16BPPBufferLooseHatchRectWithColor( (UINT16*)pDestBuf, uiDestPitchBYTES, &HostileArea, 0xF000 );
}
}
}
//Now, draw his "doll"
//adjust for position.
@@ -1292,6 +1349,9 @@ void RenderOverheadOverlays()
sY -= 5;
//sScreenY -= 7; //height of doll
if( !gfTacticalPlacementGUIActive && pSoldier->bLastRenderVisibleValue == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) )
{
continue;// ie dont render
@@ -1439,7 +1499,6 @@ void RenderOverheadOverlays()
}
}
//ITEMS OVERLAY
if( !gfTacticalPlacementGUIActive )
{
@@ -1782,8 +1841,16 @@ BOOLEAN GetOverheadScreenXYFromGridNo(INT32 sGridNo, INT16* psScreenX, INT16* ps
sX -= ((giXA - 0) * CELL_X_SIZE);
sY -= ((giYA - WORLD_ROWS/2) * CELL_Y_SIZE);
GetWorldXYAbsoluteScreenXY((sX/CELL_X_SIZE), (sY/CELL_Y_SIZE), &sWorldScreenX, &sWorldScreenY);
//DBrot: big maps
if(gfUseBiggerOverview){
//there must be proper values to check for a 360² map, but I have no idea what they are
//for now, we just pray that it works and only catch negatives
if(sWorldScreenX < 0 || /*sWorldScreenX > NORMAL_MAP_SCREEN_WIDTH ||*/ sWorldScreenY < 0 /*|| sWorldScreenY > NORMAL_MAP_SCREEN_HEIGHT*/)
return(FALSE);
}else{
if(sWorldScreenX < 0 || sWorldScreenX > NORMAL_MAP_SCREEN_WIDTH || sWorldScreenY < 0 || sWorldScreenY > NORMAL_MAP_SCREEN_HEIGHT)
return(FALSE);
}
*psScreenX = sWorldScreenX;
*psScreenY = sWorldScreenY;
+2 -1
View File
@@ -35,4 +35,5 @@ void ResetScrollOverheadMap(void);
#define FASTMAPROWCOLTOPOS( r, c ) ( (r) * WORLD_COLS + (c) )
#endif
extern BOOLEAN gfUseBiggerOverview;
#endif
+3 -3
View File
@@ -6485,11 +6485,11 @@ void RenderRoomInfo( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStartPoi
sY -= gpWorldLevelData[ usTileIndex ].sHeight;
//sY += gsRenderHeight;
if ( gubWorldRoomInfo[ usTileIndex ] != NO_ROOM )
if ( gusWorldRoomInfo[ usTileIndex ] != NO_ROOM )
{
SetFont( SMALLCOMPFONT );
SetFontDestBuffer( FRAME_BUFFER , 0, 0, SCREEN_WIDTH, gsVIEWPORT_END_Y, FALSE );
switch( gubWorldRoomInfo[ usTileIndex ] % 5 )
switch( gusWorldRoomInfo[ usTileIndex ] % 5 )
{
case 0: SetFontForeground( FONT_GRAY3 ); break;
case 1: SetFontForeground( FONT_YELLOW ); break;
@@ -6497,7 +6497,7 @@ void RenderRoomInfo( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStartPoi
case 3: SetFontForeground( FONT_LTBLUE ); break;
case 4: SetFontForeground( FONT_LTGREEN );break;
}
mprintf_buffer( pDestBuf, uiDestPitchBYTES, TINYFONT1, sX, sY , L"%d", gubWorldRoomInfo[ usTileIndex ] );
mprintf_buffer( pDestBuf, uiDestPitchBYTES, TINYFONT1, sX, sY , L"%d", gusWorldRoomInfo[ usTileIndex ] );
SetFontDestBuffer( FRAME_BUFFER , 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
}
}
+42 -15
View File
@@ -346,8 +346,8 @@ void DeinitializeWorld()
MemFree(gsCoverValue);
if(gubBuildingInfo)
MemFree(gubBuildingInfo);
if(gubWorldRoomInfo)
MemFree(gubWorldRoomInfo);
if(gusWorldRoomInfo)
MemFree(gusWorldRoomInfo);
if(gubWorldMovementCosts)
MemFree(gubWorldMovementCosts);
if(gpWorldLevelData)
@@ -2217,7 +2217,7 @@ BOOLEAN SaveWorld(const STR8 puiFilename, FLOAT dMajorMapVersion, UINT8 ubMinorM
for ( cnt = 0; cnt < WORLD_MAX; cnt++ )
{
// Write out room information
FileWrite( hfile, &gubWorldRoomInfo[ cnt ], sizeof( INT8 ), &uiBytesWritten );
FileWrite( hfile, &gusWorldRoomInfo[ cnt ], sizeof( UINT16 ), &uiBytesWritten );
}
@@ -2494,13 +2494,24 @@ BOOLEAN EvaluateWorld(STR8 pSector, UINT8 ubLevel)
pBuffer += bCounts[cnt][1];
}
// Extract highest room number
//DBrot: More Rooms
UINT8 ubRoomNum;
UINT16 usRoomNum;
if(ubMinorMapVersion < 29){
for(cnt=0; cnt<WORLD_MAX; cnt++)
{
LOADDATA(&ubRoomNum, pBuffer, sizeof(ubRoomNum));
if(ubRoomNum > pSummary->ubNumRooms)
pSummary->ubNumRooms = ubRoomNum;
}
}else{
for(cnt=0; cnt<WORLD_MAX; cnt++)
{
LOADDATA(&usRoomNum, pBuffer, sizeof(usRoomNum));
if(usRoomNum > pSummary->ubNumRooms)
pSummary->ubNumRooms = usRoomNum;
}
}
if(uiFlags & MAP_WORLDITEMS_SAVED)
{
@@ -3078,20 +3089,35 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
SetRelativeStartAndEndPercentage(0, 58, 59, L"Loading room information...");
RenderProgressBar(0, 100);
#ifdef JA2EDITOR
gubMaxRoomNumber = 0;
gusMaxRoomNumber = 0;
//DBrot: More Rooms
for(i=0; i<iWorldSize; i++)
{
gMapTrn.GetTrnCnt(cnt=i);
// Read room information
LOADDATA(&gubWorldRoomInfo[cnt], pBuffer, sizeof(INT8));
// Read room information, 2 byte for new files
if(ubMinorMapVersion < 29){
LOADDATA(&gusWorldRoomInfo[cnt], pBuffer, sizeof(INT8));
}else{
LOADDATA(&gusWorldRoomInfo[cnt], pBuffer, sizeof(UINT16));
}
// Got to set the max room number
if(gubWorldRoomInfo[cnt] > gubMaxRoomNumber)
gubMaxRoomNumber = gubWorldRoomInfo[cnt];
if(gusWorldRoomInfo[cnt] > gusMaxRoomNumber)
gusMaxRoomNumber = gusWorldRoomInfo[cnt];
}
if(gubMaxRoomNumber < 255)
gubMaxRoomNumber++;
if(gusMaxRoomNumber < 65535)
gusMaxRoomNumber++;
#else
LOADDATA(gubWorldRoomInfo, pBuffer, sizeof(INT8)*WORLD_MAX);
for(i=0; i<iWorldSize; i++){
gMapTrn.GetTrnCnt(cnt=i);
// Read room information, 2 byte for new files
if(ubMinorMapVersion < 29){
LOADDATA(&gusWorldRoomInfo[cnt], pBuffer, sizeof(INT8));
}else{
LOADDATA(&gusWorldRoomInfo[cnt], pBuffer, sizeof(UINT16));
}
}
//LOADDATA(gubWorldRoomInfo, pBuffer, sizeof(INT8)*WORLD_MAX);
#endif
memset(gubWorldRoomHidden, TRUE, sizeof(gubWorldRoomHidden));
@@ -4247,10 +4273,11 @@ void SetWorldSize(INT32 nWorldRows, INT32 nWorldCols)
memset(gubBuildingInfo, 0, sizeof(UINT8)*WORLD_MAX);
// Init room numbers
if(gubWorldRoomInfo)
MemFree(gubWorldRoomInfo);
gubWorldRoomInfo = (UINT8*)MemAlloc(WORLD_MAX);
memset(gubWorldRoomInfo, 0, sizeof(UINT8)*WORLD_MAX);
//DBrot: More Rooms
if(gusWorldRoomInfo)
MemFree(gusWorldRoomInfo);
gusWorldRoomInfo = (UINT16*)MemAlloc(sizeof(UINT16)*WORLD_MAX);
memset(gusWorldRoomInfo, 0, sizeof(UINT16)*WORLD_MAX);
if(gubWorldMovementCosts)
MemFree(gubWorldMovementCosts);
+2 -2
View File
@@ -41,8 +41,8 @@ class SOLDIERTYPE;
// SB: new map version, with map dimensions added
#define MAJOR_MAP_VERSION 7.0
//Current minor map version updater.
#define MINOR_MAP_VERSION 28 // 27 -> 28: increased to 28 because of included weapon overheated and tripwire feature. See ObjectClass for the new Tags!
//#define MINOR_MAP_VERSION 28 // 27 -> 28: increased to 28 because of included weapon overheated and tripwire feature. See ObjectClass for the new Tags!
#define MINOR_MAP_VERSION 29 // 28 -> 29: increased range of roomnumbers to full UINT16 by DBrot
//dnl ch33 230909
#define VANILLA_MAJOR_MAP_VERSION 5.00
#define VANILLA_MINOR_MAP_VERSION 25