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:
+59
-59
@@ -96,13 +96,13 @@ INT16 gbSmoothWaterStruct[] =
|
||||
-1
|
||||
};
|
||||
|
||||
BOOLEAN HigherLevel( INT32 gridno, UINT8 NewLevel );
|
||||
BOOLEAN ContainsWater( INT32 gridno );
|
||||
BOOLEAN HigherLevel( INT32 GridNo, UINT8 NewLevel );
|
||||
BOOLEAN ContainsWater( INT32 GridNo );
|
||||
|
||||
void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
void SmoothTerrain(INT32 GridNo, INT32 origType, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
{
|
||||
int temp=0;
|
||||
int FullTile = FALSE;
|
||||
INT32 temp=0,type=0;
|
||||
INT32 FullTile = FALSE;
|
||||
UINT16 usOldIndex;
|
||||
UINT16 usTempIndex;
|
||||
UINT32 cnt;
|
||||
@@ -118,13 +118,13 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
// SmoothWaterTerrain rather than the proceeding method
|
||||
if( origType==REGWATERTEXTURE)
|
||||
{
|
||||
SmoothWaterTerrain( gridno, origType, piNewTile, TRUE);
|
||||
SmoothWaterTerrain( GridNo, origType, piNewTile, TRUE);
|
||||
return;
|
||||
}
|
||||
pSmoothStruct = gbSmoothStruct;
|
||||
|
||||
// Get land index value for given level and adjust according to type
|
||||
if ( TypeExistsInLandLayer( gridno, origType, &usTileIndex ) )
|
||||
if ( TypeExistsInLandLayer( GridNo, origType, &usTileIndex ) )
|
||||
{
|
||||
GetTypeSubIndexFromTileIndex( origType, usTileIndex, &usOldIndex );
|
||||
}
|
||||
@@ -147,9 +147,9 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
}
|
||||
|
||||
// is land height one tile above not the same type?
|
||||
if ( (gridno- WORLD_COLS ) >= 0 )
|
||||
if ( (GridNo - WORLD_COLS ) >= 0 )
|
||||
{
|
||||
if ( !TypeExistsInLandLayer( gridno - WORLD_COLS, origType, &usTempIndex ) )
|
||||
if ( !TypeExistsInLandLayer( GridNo - WORLD_COLS, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=3;
|
||||
@@ -157,9 +157,9 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
}
|
||||
// is land height one tile to the right not the same type?
|
||||
// (make sure there IS a tile to the right, i.e. check for border)
|
||||
if ((gridno+1)% WORLD_COLS !=0)
|
||||
if ((GridNo+1)% WORLD_COLS !=0)
|
||||
{
|
||||
if ( !TypeExistsInLandLayer( gridno+1, origType, &usTempIndex ) )
|
||||
if ( !TypeExistsInLandLayer( GridNo+1, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=5;
|
||||
@@ -167,9 +167,9 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
}
|
||||
|
||||
// is land height one tile down not the same type?
|
||||
if ( (gridno + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
if ( (GridNo + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
{
|
||||
if ( !TypeExistsInLandLayer( gridno + WORLD_COLS, origType, &usTempIndex ) )
|
||||
if ( !TypeExistsInLandLayer( GridNo + WORLD_COLS, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=7;
|
||||
@@ -177,9 +177,9 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
}
|
||||
|
||||
// is land height one tile to left not the same type?
|
||||
if (gridno % WORLD_COLS!=0)
|
||||
if (GridNo % WORLD_COLS!=0)
|
||||
{
|
||||
if ( !TypeExistsInLandLayer( gridno-1, origType, &usTempIndex ) )
|
||||
if ( !TypeExistsInLandLayer( GridNo-1, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=11;
|
||||
@@ -193,7 +193,7 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
cnt = 0;
|
||||
fFound = FALSE;
|
||||
|
||||
GetLandHeadType( gridno, &uiTopType );
|
||||
GetLandHeadType( GridNo, &uiTopType );
|
||||
|
||||
while( pSmoothStruct[ cnt ] != -1 )
|
||||
{
|
||||
@@ -245,7 +245,7 @@ void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSm
|
||||
*piNewTile = usTileIndex;
|
||||
}
|
||||
|
||||
void SmoothExitGridRadius( INT16 sMapIndex, UINT8 ubRadius )
|
||||
void SmoothExitGridRadius( INT32 sMapIndex, UINT8 ubRadius )
|
||||
{
|
||||
LEVELNODE* pShadow;
|
||||
INT16 x, y;
|
||||
@@ -275,10 +275,10 @@ void SmoothExitGridRadius( INT16 sMapIndex, UINT8 ubRadius )
|
||||
}
|
||||
}
|
||||
|
||||
void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
void SmoothExitGrid(INT32 GridNo, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
{
|
||||
int temp=0;
|
||||
int FullTile = FALSE;
|
||||
INT32 temp=0,type=0;
|
||||
INT32 FullTile = FALSE;
|
||||
UINT16 usOldIndex;
|
||||
UINT16 usTempIndex;
|
||||
UINT32 cnt;
|
||||
@@ -293,7 +293,7 @@ void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
pSmoothStruct = gbSmoothStruct;
|
||||
|
||||
// Get Object index value for given level and adjust according to type
|
||||
if ( TypeExistsInShadowLayer( gridno, EXITTEXTURE, &usTileIndex ) )
|
||||
if ( TypeExistsInShadowLayer( GridNo, EXITTEXTURE, &usTileIndex ) )
|
||||
{
|
||||
GetTypeSubIndexFromTileIndex( EXITTEXTURE, usTileIndex, &usOldIndex );
|
||||
}
|
||||
@@ -316,9 +316,9 @@ void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
}
|
||||
|
||||
// is Object height one tile above not the same type?
|
||||
if ( (gridno- WORLD_COLS ) >= 0 )
|
||||
if ( (GridNo - WORLD_COLS ) >= 0 )
|
||||
{
|
||||
if ( !TypeExistsInShadowLayer( gridno - WORLD_COLS, EXITTEXTURE, &usTempIndex ) )
|
||||
if ( !TypeExistsInShadowLayer( GridNo - WORLD_COLS, EXITTEXTURE, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=3;
|
||||
@@ -326,9 +326,9 @@ void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
}
|
||||
// is Object height one tile to the right not the same type?
|
||||
// (make sure there IS a tile to the right, i.e. check for border)
|
||||
if ((gridno+1)% WORLD_COLS !=0)
|
||||
if ((GridNo+1)% WORLD_COLS !=0)
|
||||
{
|
||||
if ( !TypeExistsInShadowLayer( gridno+1, EXITTEXTURE, &usTempIndex ) )
|
||||
if ( !TypeExistsInShadowLayer( GridNo+1, EXITTEXTURE, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=5;
|
||||
@@ -336,9 +336,9 @@ void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
}
|
||||
|
||||
// is Object height one tile down not the same type?
|
||||
if ( (gridno + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
if ( (GridNo + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
{
|
||||
if ( !TypeExistsInShadowLayer( gridno + WORLD_COLS, EXITTEXTURE, &usTempIndex ) )
|
||||
if ( !TypeExistsInShadowLayer( GridNo + WORLD_COLS, EXITTEXTURE, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=7;
|
||||
@@ -346,9 +346,9 @@ void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
}
|
||||
|
||||
// is Object height one tile to left not the same type?
|
||||
if (gridno % WORLD_COLS!=0)
|
||||
if (GridNo % WORLD_COLS!=0)
|
||||
{
|
||||
if ( !TypeExistsInShadowLayer( gridno-1, EXITTEXTURE, &usTempIndex ) )
|
||||
if ( !TypeExistsInShadowLayer( GridNo-1, EXITTEXTURE, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp+=11;
|
||||
@@ -414,7 +414,7 @@ void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
|
||||
void SmoothTerrainWorld( UINT32 uiCheckType )
|
||||
{
|
||||
int cnt;
|
||||
INT32 cnt;
|
||||
UINT16 usIndex;
|
||||
UINT16 NewTile;
|
||||
// Smooth out entire world surrounding tiles
|
||||
@@ -436,7 +436,7 @@ void SmoothTerrainWorld( UINT32 uiCheckType )
|
||||
|
||||
void SmoothAllTerrainWorld( void )
|
||||
{
|
||||
int cnt;
|
||||
INT32 cnt;
|
||||
UINT16 usIndex;
|
||||
UINT16 NewTile;
|
||||
UINT32 uiCheckType;
|
||||
@@ -459,7 +459,7 @@ void SmoothAllTerrainWorld( void )
|
||||
}
|
||||
}
|
||||
|
||||
void SmoothTerrainRadius( UINT32 iMapIndex, UINT32 uiCheckType, UINT8 ubRadius, BOOLEAN fForceSmooth )
|
||||
void SmoothTerrainRadius( INT32 iMapIndex, UINT32 uiCheckType, UINT8 ubRadius, BOOLEAN fForceSmooth )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
@@ -501,7 +501,7 @@ void SmoothTerrainRadius( UINT32 iMapIndex, UINT32 uiCheckType, UINT8 ubRadius,
|
||||
}
|
||||
}
|
||||
|
||||
void SmoothAllTerrainTypeRadius( UINT32 iMapIndex, UINT8 ubRadius, BOOLEAN fForceSmooth )
|
||||
void SmoothAllTerrainTypeRadius( INT32 iMapIndex, UINT8 ubRadius, BOOLEAN fForceSmooth )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
@@ -541,13 +541,13 @@ void SmoothAllTerrainTypeRadius( UINT32 iMapIndex, UINT8 ubRadius, BOOLEAN fForc
|
||||
}
|
||||
}
|
||||
|
||||
void SmoothWaterTerrain( int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
void SmoothWaterTerrain( INT32 GridNo, INT32 origType, UINT16 *piNewTile, BOOLEAN fForceSmooth )
|
||||
{
|
||||
// This procedure will calculate the approriate smooth texture for a water texture
|
||||
// based on the surrounding water textures. This is done via masking bits within
|
||||
// a temp variable, then searching for the right texture and inserting it
|
||||
int temp=0;
|
||||
int FullTile = FALSE;
|
||||
INT32 temp=0,type=0;
|
||||
INT32 FullTile = FALSE;
|
||||
UINT16 usOldIndex;
|
||||
UINT16 usTempIndex;
|
||||
UINT32 cnt;
|
||||
@@ -561,7 +561,7 @@ void SmoothWaterTerrain( int gridno, int origType, UINT16 *piNewTile, BOOLEAN fF
|
||||
|
||||
pSmoothStruct = gbSmoothWaterStruct;
|
||||
// Get land index value for given level and adjust according to type
|
||||
if ( TypeExistsInLandLayer( gridno, origType, &usTileIndex ) )
|
||||
if ( TypeExistsInLandLayer( GridNo, origType, &usTileIndex ) )
|
||||
{
|
||||
GetTypeSubIndexFromTileIndex( origType, usTileIndex, &usOldIndex );
|
||||
}
|
||||
@@ -582,9 +582,9 @@ void SmoothWaterTerrain( int gridno, int origType, UINT16 *piNewTile, BOOLEAN fF
|
||||
}
|
||||
}
|
||||
// Mask approriate bits in temp for the lookup in the SmoothWaterStruct list
|
||||
if ( (gridno- WORLD_COLS ) >= 0 )
|
||||
if ( (GridNo - WORLD_COLS ) >= 0 )
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno - WORLD_COLS, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo - WORLD_COLS, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=4;
|
||||
@@ -592,79 +592,79 @@ void SmoothWaterTerrain( int gridno, int origType, UINT16 *piNewTile, BOOLEAN fF
|
||||
}
|
||||
// is land height one tile to the right not the same type?
|
||||
// (make sure there IS a tile to the right, i.e. check for border)
|
||||
if ((gridno+1)% WORLD_COLS !=0)
|
||||
if ((GridNo+1)% WORLD_COLS !=0)
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno + 1, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo + 1, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=64;
|
||||
}
|
||||
}
|
||||
// is land height one tile down not the same type?
|
||||
if ( (gridno + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
if ( (GridNo + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno + WORLD_COLS, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo + WORLD_COLS, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=256;
|
||||
}
|
||||
}
|
||||
// is land height one tile to left not the same type?
|
||||
if (gridno % WORLD_COLS!=0)
|
||||
if (GridNo % WORLD_COLS!=0)
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno - 1, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo - 1, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=16;
|
||||
}
|
||||
}
|
||||
if ((gridno+1)% WORLD_COLS !=0)
|
||||
if ((GridNo+1)% WORLD_COLS !=0)
|
||||
{
|
||||
|
||||
if ( (gridno- WORLD_COLS ) >= 0 )
|
||||
if ( (GridNo - WORLD_COLS ) >= 0 )
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno - WORLD_COLS + 1, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo - WORLD_COLS + 1, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gridno % WORLD_COLS!=0)
|
||||
if (GridNo % WORLD_COLS!=0)
|
||||
{
|
||||
if ( (gridno- WORLD_COLS ) >= 0 )
|
||||
if ( (GridNo- WORLD_COLS ) >= 0 )
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno - WORLD_COLS - 1, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo - WORLD_COLS - 1, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((gridno+1)% WORLD_COLS !=0)
|
||||
if ((GridNo+1)% WORLD_COLS !=0)
|
||||
{
|
||||
if ( (gridno + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
if ( (GridNo + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
{
|
||||
if ( TypeRangeExistsInLandLayer( gridno + WORLD_COLS + 1, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo + WORLD_COLS + 1, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=512;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (gridno % WORLD_COLS!=0)
|
||||
if (GridNo % WORLD_COLS!=0)
|
||||
{
|
||||
if ( (gridno + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
if ( (GridNo + WORLD_COLS ) < ( WORLD_COLS * WORLD_ROWS ) )
|
||||
{
|
||||
|
||||
if ( TypeRangeExistsInLandLayer( gridno + WORLD_COLS - 1, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo + WORLD_COLS - 1, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=128;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( TypeRangeExistsInLandLayer( gridno, origType, origType, &usTempIndex ) )
|
||||
if ( TypeRangeExistsInLandLayer( GridNo, origType, origType, &usTempIndex ) )
|
||||
{
|
||||
// no it's not
|
||||
temp|=32;
|
||||
@@ -672,7 +672,7 @@ void SmoothWaterTerrain( int gridno, int origType, UINT16 *piNewTile, BOOLEAN fF
|
||||
// Loop through smooth struct
|
||||
cnt = 0;
|
||||
fFound = FALSE;
|
||||
GetLandHeadType( gridno, &uiTopType );
|
||||
GetLandHeadType( GridNo, &uiTopType );
|
||||
// Speed up of this while loop using double/quick search will result
|
||||
// in an incorrect solution due to multiple instances of bitvalues in the list of
|
||||
// smoothed water textures
|
||||
|
||||
Reference in New Issue
Block a user