mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+26
-23
@@ -32,8 +32,10 @@ BOOLEAN CaveAtGridNo( INT32 iMapIndex )
|
||||
{
|
||||
STRUCTURE *pStruct;
|
||||
LEVELNODE* pLevel;
|
||||
if( iMapIndex < 0 || iMapIndex >= NOWHERE )
|
||||
return TRUE;
|
||||
|
||||
if( TileIsOutOfBounds(iMapIndex))
|
||||
return FALSE;
|
||||
|
||||
pStruct = gpWorldLevelData[ iMapIndex ].pStructureHead;
|
||||
while( pStruct )
|
||||
{
|
||||
@@ -263,8 +265,9 @@ void AddCave( INT32 iMapIndex, UINT16 usIndex )
|
||||
{
|
||||
LEVELNODE *pStruct;
|
||||
|
||||
if( iMapIndex < 0 || iMapIndex >= NOWHERE )
|
||||
if(TileIsOutOfBounds(iMapIndex))
|
||||
return;
|
||||
|
||||
//First toast any existing wall (caves)
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTWALL, LASTWALL );
|
||||
//Now, add this piece
|
||||
@@ -337,12 +340,12 @@ INT8 gbWallTileLUT[NUM_WALL_TYPES][7] =
|
||||
// existing respective type.
|
||||
void BuildSlantRoof( INT32 iLeft, INT32 iTop, INT32 iRight, INT32 iBottom, UINT16 usWallType, UINT16 usRoofType, BOOLEAN fVertical );
|
||||
|
||||
void BulldozeNature( UINT32 iMapIndex );
|
||||
void EraseRoof( UINT32 iMapIndex );
|
||||
void EraseFloor( UINT32 iMapIndex );
|
||||
void EraseBuilding( UINT32 iMapIndex );
|
||||
void EraseFloorOwnedBuildingPieces( UINT32 iMapIndex );
|
||||
void ConsiderEffectsOfNewWallPiece( UINT32 iMapIndex, UINT8 usWallOrientation );
|
||||
void BulldozeNature( INT32 iMapIndex );
|
||||
void EraseRoof( INT32 iMapIndex );
|
||||
void EraseFloor( INT32 iMapIndex );
|
||||
void EraseBuilding( INT32 iMapIndex );
|
||||
void EraseFloorOwnedBuildingPieces( INT32 iMapIndex );
|
||||
void ConsiderEffectsOfNewWallPiece( INT32 iMapIndex, UINT8 usWallOrientation );
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
//BEGIN IMPLEMENTATION OF PRIVATE FUNCTIONS
|
||||
@@ -437,7 +440,7 @@ UINT16 PickAWallPiece( UINT16 usWallPieceType )
|
||||
//NOTE: Passing NULL for usWallType will force it to calculate the closest existing wall type, and
|
||||
// use that for building this new wall. It is necessary for restructuring a building, but not for
|
||||
// adding on to an existing building, where the type is already known.
|
||||
void BuildWallPiece( UINT32 iMapIndex, UINT8 ubWallPiece, UINT16 usWallType )
|
||||
void BuildWallPiece( INT32 iMapIndex, UINT8 ubWallPiece, UINT16 usWallType )
|
||||
{
|
||||
INT16 sIndex;
|
||||
UINT16 usTileIndex;
|
||||
@@ -650,7 +653,7 @@ void RebuildRoofUsingFloorInfo( INT32 iMapIndex, UINT16 usRoofType )
|
||||
//wall orientions giving priority to the top and left walls before anything else.
|
||||
//NOTE: passing NULL for usRoofType will force the function to calculate the nearest roof type,
|
||||
// and use that for the new roof. This is needed when erasing parts of multiple buildings simultaneously.
|
||||
void RebuildRoof( UINT32 iMapIndex, UINT16 usRoofType )
|
||||
void RebuildRoof( INT32 iMapIndex, UINT16 usRoofType )
|
||||
{
|
||||
UINT16 usRoofIndex, usTileIndex;
|
||||
BOOLEAN fTop, fBottom, fLeft, fRight;
|
||||
@@ -687,7 +690,7 @@ void RebuildRoof( UINT32 iMapIndex, UINT16 usRoofType )
|
||||
}
|
||||
}
|
||||
|
||||
void BulldozeNature( UINT32 iMapIndex )
|
||||
void BulldozeNature( INT32 iMapIndex )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTISTRUCT,LASTISTRUCT );
|
||||
@@ -699,7 +702,7 @@ void BulldozeNature( UINT32 iMapIndex )
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, ANOTHERDEBRIS, ANOTHERDEBRIS );
|
||||
}
|
||||
|
||||
void EraseRoof( UINT32 iMapIndex )
|
||||
void EraseRoof( INT32 iMapIndex )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
RemoveAllRoofsOfTypeRange( iMapIndex, FIRSTTEXTURE, LASTITEM );
|
||||
@@ -707,13 +710,13 @@ void EraseRoof( UINT32 iMapIndex )
|
||||
RemoveAllShadowsOfTypeRange( iMapIndex, FIRSTROOF, LASTSLANTROOF );
|
||||
}
|
||||
|
||||
void EraseFloor( UINT32 iMapIndex )
|
||||
void EraseFloor( INT32 iMapIndex )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
RemoveAllLandsOfTypeRange( iMapIndex, FIRSTFLOOR, LASTFLOOR );
|
||||
}
|
||||
|
||||
void EraseWalls( UINT32 iMapIndex )
|
||||
void EraseWalls( INT32 iMapIndex )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTTEXTURE, LASTITEM );
|
||||
@@ -725,7 +728,7 @@ void EraseWalls( UINT32 iMapIndex )
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, ANOTHERDEBRIS, ANOTHERDEBRIS );
|
||||
}
|
||||
|
||||
void EraseBuilding( UINT32 iMapIndex )
|
||||
void EraseBuilding( INT32 iMapIndex )
|
||||
{
|
||||
EraseRoof( iMapIndex );
|
||||
EraseFloor( iMapIndex );
|
||||
@@ -736,7 +739,7 @@ void EraseBuilding( UINT32 iMapIndex )
|
||||
//Specialized function that will delete only the TOP_RIGHT oriented wall in the gridno to the left
|
||||
//and the TOP_LEFT oriented wall in the gridno up one as well as the other building information at this
|
||||
//gridno.
|
||||
void EraseFloorOwnedBuildingPieces( UINT32 iMapIndex )
|
||||
void EraseFloorOwnedBuildingPieces( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pStruct = NULL;
|
||||
UINT32 uiTileType;
|
||||
@@ -803,7 +806,7 @@ void AddCave( INT32 iMapIndex, UINT16 usIndex );
|
||||
void RemoveCaveSectionFromWorld( SGPRect *pSelectRegion )
|
||||
{
|
||||
UINT32 top, left, right, bottom, x, y;
|
||||
UINT32 iMapIndex;
|
||||
INT32 iMapIndex;
|
||||
UINT16 usIndex;
|
||||
UINT8 ubPerimeterValue;
|
||||
top = pSelectRegion->iTop;
|
||||
@@ -839,7 +842,7 @@ void RemoveCaveSectionFromWorld( SGPRect *pSelectRegion )
|
||||
void AddCaveSectionToWorld( SGPRect *pSelectRegion )
|
||||
{
|
||||
INT32 top, left, right, bottom, x, y;
|
||||
UINT32 uiMapIndex;
|
||||
INT32 uiMapIndex;
|
||||
UINT16 usIndex;
|
||||
UINT8 ubPerimeterValue;
|
||||
top = pSelectRegion->iTop;
|
||||
@@ -850,7 +853,7 @@ void AddCaveSectionToWorld( SGPRect *pSelectRegion )
|
||||
for( y = top; y <= bottom; y++ ) for( x = left; x <= right; x++ )
|
||||
{
|
||||
uiMapIndex = y * WORLD_COLS + x;
|
||||
if( uiMapIndex < NOWHERE )
|
||||
if (!TileIsOutOfBounds(uiMapIndex))
|
||||
{
|
||||
usIndex = GetCaveTileIndexFromPerimeterValue( 0xff );
|
||||
AddToUndoList( uiMapIndex );
|
||||
@@ -861,7 +864,7 @@ void AddCaveSectionToWorld( SGPRect *pSelectRegion )
|
||||
for( y = top - 1; y <= bottom + 1; y++ ) for( x = left - 1; x <= right + 1; x++ )
|
||||
{
|
||||
uiMapIndex = y * WORLD_COLS + x;
|
||||
if( uiMapIndex < NOWHERE )
|
||||
if(!TileIsOutOfBounds(uiMapIndex))
|
||||
{
|
||||
if( CaveAtGridNo( uiMapIndex ) )
|
||||
{
|
||||
@@ -895,7 +898,7 @@ void AddCaveSectionToWorld( SGPRect *pSelectRegion )
|
||||
void RemoveBuildingSectionFromWorld( SGPRect *pSelectRegion )
|
||||
{
|
||||
UINT32 top, left, right, bottom, x, y;
|
||||
UINT32 iMapIndex;
|
||||
INT32 iMapIndex;
|
||||
UINT16 usTileIndex;
|
||||
UINT16 usFloorType;
|
||||
BOOLEAN fFloor;
|
||||
@@ -970,7 +973,7 @@ void RemoveBuildingSectionFromWorld( SGPRect *pSelectRegion )
|
||||
void AddBuildingSectionToWorld( SGPRect *pSelectRegion )
|
||||
{
|
||||
INT32 top, left, right, bottom, x, y;
|
||||
UINT32 iMapIndex;
|
||||
INT32 iMapIndex;
|
||||
UINT16 usFloorType, usWallType, usRoofType;
|
||||
UINT16 usTileIndex;
|
||||
BOOLEAN fNewBuilding;
|
||||
|
||||
Reference in New Issue
Block a user