mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +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:
@@ -102,6 +102,8 @@ enum
|
||||
OPTIONS_SAVE_MAP,
|
||||
OPTIONS_CHANGE_TILESET,
|
||||
OPTIONS_LEAVE_EDITOR,
|
||||
OPTIONS_RADAR_MAP,//dnl ch9 071009
|
||||
OPTIONS_VANILLA_MODE,//dnl ch33 160909
|
||||
OPTIONS_QUIT_GAME, LAST_OPTIONS_BUTTON = OPTIONS_QUIT_GAME,
|
||||
//Mercs menu
|
||||
MERCS_PLAYER, FIRST_MERCS_BUTTON = MERCS_PLAYER,
|
||||
|
||||
+10
-7
@@ -34,7 +34,7 @@ UINT16 gusSavedSelectionType = SMALLSELECTION;
|
||||
UINT16 gusSavedBuildingSelectionType = AREASELECTION;
|
||||
extern INT16 sGridX; // symbol already declared globally in editscreen.cpp (jonathanl)
|
||||
extern INT16 sGridY; // symbol already declared globally in editscreen.cpp (jonathanl)
|
||||
INT16 sBadMarker = -1;
|
||||
INT32 sBadMarker = -1;
|
||||
|
||||
STR16 wszSelType[6]= { L"Small", L"Medium", L"Large", L"XLarge", L"Width: xx", L"Area" };
|
||||
|
||||
@@ -90,6 +90,8 @@ void DecreaseSelectionDensity()
|
||||
|
||||
void RemoveCursors()
|
||||
{
|
||||
if((gSelectRegion.iRight + gSelectRegion.iBottom * WORLD_COLS) >= WORLD_MAX)//dnl ch43 280909 Prevent CTD when world size is changed
|
||||
return;
|
||||
INT32 x, y, iMapIndex;
|
||||
if( gpBuildingLayoutList )
|
||||
{
|
||||
@@ -203,12 +205,12 @@ void UpdateCursorAreas()
|
||||
if( gfRoofPlacement && FlatRoofAboveGridNo( iMapIndex ) )
|
||||
{
|
||||
AddTopmostToTail( iMapIndex + ROOF_OFFSET, BADMARKER1 );
|
||||
sBadMarker = (INT16)(iMapIndex + ROOF_OFFSET );
|
||||
sBadMarker = iMapIndex + ROOF_OFFSET ;
|
||||
}
|
||||
else
|
||||
{
|
||||
AddTopmostToTail( (iMapIndex), BADMARKER1 );
|
||||
sBadMarker = (INT16)(iMapIndex);
|
||||
sBadMarker = iMapIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -338,12 +340,13 @@ BOOLEAN HandleAreaSelection()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//dnl ch43 280909
|
||||
void ValidateSelectionRegionBoundaries()
|
||||
{
|
||||
gSelectRegion.iLeft = max( min( 159, gSelectRegion.iLeft ) , 0 );
|
||||
gSelectRegion.iRight = max( min( 159, gSelectRegion.iRight ), 0 );
|
||||
gSelectRegion.iTop = max( min( 159, gSelectRegion.iTop ) , 0 );
|
||||
gSelectRegion.iBottom = max( min( 159, gSelectRegion.iBottom ), 0 );
|
||||
gSelectRegion.iLeft = max(min(WORLD_COLS-1, gSelectRegion.iLeft), 0);
|
||||
gSelectRegion.iRight = max(min(WORLD_COLS-1, gSelectRegion.iRight), 0);
|
||||
gSelectRegion.iTop = max(min(WORLD_ROWS-1, gSelectRegion.iTop), 0);
|
||||
gSelectRegion.iBottom = max(min(WORLD_ROWS-1, gSelectRegion.iBottom), 0);
|
||||
}
|
||||
|
||||
void EnsureSelectionType()
|
||||
|
||||
@@ -16,6 +16,8 @@ void BtnLoadCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
void BtnSaveCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
void BtnCancelCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
void BtnQuitCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
void BtnRadarMapCallback( GUI_BUTTON *btn, INT32 reason );//dnl ch9 071009
|
||||
void VanillaModeCallback(GUI_BUTTON *btn, INT32 reason);//dnl ch33 160909
|
||||
void BtnNewMapCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
void BtnNewBasementCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
void BtnNewCavesCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
|
||||
@@ -532,7 +532,7 @@ void MapInfoEntryPointsCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
{
|
||||
if( reason & (MSYS_CALLBACK_REASON_LBUTTON_UP | MSYS_CALLBACK_REASON_RBUTTON_UP) )
|
||||
{
|
||||
INT16 x, sGridNo;
|
||||
INT32 x, sGridNo;
|
||||
for( x = MAPINFO_NORTH_POINT; x <= MAPINFO_ISOLATED_POINT; x++ )
|
||||
{
|
||||
if( btn == ButtonList[ iEditorButton[ x ] ] )
|
||||
@@ -669,6 +669,20 @@ void BtnQuitCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
}
|
||||
}
|
||||
|
||||
void BtnRadarMapCallback( GUI_BUTTON *btn, INT32 reason )//dnl ch9 071009
|
||||
{
|
||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
||||
{
|
||||
iEditorToolbarState = TBAR_MODE_RADAR_MAP;
|
||||
}
|
||||
}
|
||||
|
||||
void VanillaModeCallback(GUI_BUTTON *btn, INT32 reason)//dnl ch33 160909
|
||||
{
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||
(btn->uiFlags & BUTTON_CLICKED_ON) ? (gfVanillaMode = TRUE) : (gfVanillaMode = FALSE);
|
||||
}
|
||||
|
||||
//ITEMS
|
||||
void MouseMovedInItemsRegion( MOUSE_REGION *reg, INT32 reason )
|
||||
{
|
||||
|
||||
@@ -256,7 +256,7 @@ void SetEditorTerrainTaskbarMode( UINT16 usNewMode )
|
||||
|
||||
void ShowExitGrids()
|
||||
{
|
||||
UINT16 i;
|
||||
INT32 i;
|
||||
LEVELNODE *pLevelNode;
|
||||
if( gfShowExitGrids )
|
||||
return;
|
||||
@@ -272,7 +272,7 @@ void ShowExitGrids()
|
||||
|
||||
void HideExitGrids()
|
||||
{
|
||||
UINT16 i;
|
||||
INT32 i;
|
||||
LEVELNODE *pLevelNode;
|
||||
if( !gfShowExitGrids )
|
||||
return;
|
||||
|
||||
@@ -699,6 +699,16 @@ void InitEditorOptionsToolbar()
|
||||
iEditorButton[OPTIONS_QUIT_GAME] =
|
||||
CreateEasyNoToggleButton( iScreenWidthOffset + 281,SCREEN_HEIGHT - 79,"EDITOR//cancel.sti", BtnQuitCallback);
|
||||
SetButtonFastHelpText(iEditorButton[OPTIONS_QUIT_GAME],L"Exit game.");
|
||||
|
||||
//dnl ch9 071009
|
||||
iEditorButton[OPTIONS_RADAR_MAP] =
|
||||
CreateEasyNoToggleButton( iScreenWidthOffset + 311,SCREEN_HEIGHT - 79,"EDITOR//tileset.sti", BtnRadarMapCallback);
|
||||
SetButtonFastHelpText(iEditorButton[OPTIONS_RADAR_MAP],L"Create radar map");
|
||||
|
||||
//dnl ch33 160909
|
||||
iEditorButton[OPTIONS_VANILLA_MODE] =
|
||||
CreateCheckBoxButton(iScreenWidthOffset+71, SCREEN_HEIGHT-119, "EDITOR//smcheckbox.sti", MSYS_PRIORITY_NORMAL, VanillaModeCallback);
|
||||
SetButtonFastHelpText(iEditorButton[OPTIONS_VANILLA_MODE],L"Set save map as v1.12");
|
||||
}
|
||||
|
||||
void InitEditorTerrainToolbar()
|
||||
|
||||
@@ -45,11 +45,13 @@
|
||||
#include "Soldier Find.h"
|
||||
#include "lighting.h"
|
||||
#include "Keys.h"
|
||||
|
||||
#include "InterfaceItemImages.h"
|
||||
#endif
|
||||
|
||||
void RenderEditorInfo();
|
||||
|
||||
extern ITEM_POOL *gpItemPool;
|
||||
//extern ITEM_POOL *gpItemPool;//dnl ch26 210909
|
||||
|
||||
//editor icon storage vars
|
||||
INT32 giEditMercDirectionIcons[2];
|
||||
@@ -324,6 +326,7 @@ void DoTaskbar(void)
|
||||
break;
|
||||
case TASK_OPTIONS:
|
||||
UnclickEditorButton( TAB_OPTIONS );
|
||||
KillTextInputMode();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -392,8 +395,12 @@ void DoTaskbar(void)
|
||||
SetupTextInputForMapInfo();
|
||||
break;
|
||||
case TASK_OPTIONS:
|
||||
iDrawMode = DRAW_MODE_NOTHING;//dnl ch22 210909
|
||||
ClickEditorButton( TAB_OPTIONS );
|
||||
TerrainTileDrawMode = TERRAIN_TILES_NODRAW;
|
||||
if(gfVanillaMode)//dnl ch33 160909
|
||||
ClickEditorButton(OPTIONS_VANILLA_MODE);
|
||||
SetupTextInputForOptions();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -609,7 +616,7 @@ void EnableEditorButtons( INT32 iFirstEditorButtonID, INT32 iLastEditorButtonID
|
||||
|
||||
void RenderMapEntryPointsAndLights()
|
||||
{
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
INT16 sScreenX, sScreenY;
|
||||
INT32 i;
|
||||
if( gfSummaryWindowActive )
|
||||
@@ -767,7 +774,11 @@ void RenderDoorLockInfo()
|
||||
case SUPER_ELECTRIC:
|
||||
swprintf( str, L"Super Electric Trap" );
|
||||
break;
|
||||
|
||||
// WANNE: Fix a vanilla glitch in the editor: The text for the brothel siren trap was missing.
|
||||
// Fixed by Tron (Stracciatella): Revision: 6253
|
||||
case BROTHEL_SIREN:
|
||||
swprintf( str, L"Brothel Siren Trap" );
|
||||
break;
|
||||
}
|
||||
xp = sScreenX + 20 - StringPixLength( str, FONT10ARIAL ) / 2;
|
||||
yp = sScreenY;
|
||||
@@ -798,15 +809,16 @@ void RenderSelectedItemBlownUp()
|
||||
uiVideoObjectIndex = GetInterfaceGraphicForItem( &Item[ gpItem->usItem ] );
|
||||
GetVideoObject( &hVObject, uiVideoObjectIndex );
|
||||
|
||||
sWidth = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].usWidth;
|
||||
sOffsetX = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].sOffsetX;
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : Item[ gpItem->usItem ].ubGraphicNum;
|
||||
sWidth = hVObject->pETRLEObject[ usGraphicNum ].usWidth;
|
||||
sOffsetX = hVObject->pETRLEObject[ usGraphicNum ].sOffsetX;
|
||||
xp = sScreenX + (40 - sWidth - sOffsetX*2) / 2;
|
||||
|
||||
sHeight = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].usHeight;
|
||||
sOffsetY = hVObject->pETRLEObject[ Item[ gpItem->usItem ].ubGraphicNum ].sOffsetY;
|
||||
sHeight = hVObject->pETRLEObject[ usGraphicNum ].usHeight;
|
||||
sOffsetY = hVObject->pETRLEObject[ usGraphicNum ].sOffsetY;
|
||||
yp = sScreenY + (20 - sHeight - sOffsetY*2) / 2;
|
||||
|
||||
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, Item[ gpItem->usItem ].ubGraphicNum, xp, yp, Get16BPPColor(FROMRGB(0, 140, 170)), TRUE );
|
||||
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, xp, yp, Get16BPPColor(FROMRGB(0, 140, 170)), TRUE );
|
||||
|
||||
//Display the item name above it
|
||||
SetFont( FONT10ARIAL );
|
||||
@@ -871,27 +883,36 @@ void RenderEditorInfo( )
|
||||
{
|
||||
CHAR16 FPSText[ 50 ];
|
||||
static INT32 iSpewWarning = 0;
|
||||
INT16 iMapIndex;
|
||||
INT32 iMapIndexD;
|
||||
|
||||
SetFont( FONT12POINT1 );
|
||||
SetFontForeground( FONT_BLACK );
|
||||
SetFontBackground( FONT_BLACK );
|
||||
//dnl ch52 091009
|
||||
SetFont(FONT12ARIAL);
|
||||
SetFontShadow(NO_SHADOW);
|
||||
SetFontForeground(FONT_BLACK);
|
||||
SetFontBackground(FONT_BLACK);
|
||||
|
||||
//Display the mapindex position
|
||||
if( GetMouseMapPos( &iMapIndex ) )
|
||||
swprintf( FPSText, L" (%d) ", iMapIndex );
|
||||
//dnl ch1 101009 Display the mapindex position
|
||||
if(GetMouseMapPos(&iMapIndexD))
|
||||
{
|
||||
INT16 sGridX, sGridY;
|
||||
GetMouseXY(&sGridX, &sGridY);
|
||||
swprintf(FPSText, L"%4d %4d %6d", sGridX, sGridY, iMapIndexD);
|
||||
}
|
||||
else
|
||||
swprintf( FPSText, L" " );
|
||||
swprintf(FPSText, L" ");
|
||||
|
||||
mprintfEditor( (UINT16)(iScreenWidthOffset + 50-StringPixLength( FPSText, FONT12POINT1 )/2), 2 * iScreenHeightOffset + 463, FPSText );
|
||||
|
||||
switch( iCurrentTaskbar )
|
||||
{
|
||||
case TASK_OPTIONS:
|
||||
mprintf(iScreenWidthOffset+71+15, SCREEN_HEIGHT-117, L"v1.12");//dnl ch33 160909
|
||||
if( !gfWorldLoaded || giCurrentTilesetID < 0 )
|
||||
mprintf( iScreenWidthOffset + 260, 2 * iScreenHeightOffset + 445, L"No map currently loaded." );
|
||||
else
|
||||
mprintf( iScreenWidthOffset + 260, 2 * iScreenHeightOffset + 445, L"File: %S, Current Tileset: %s",
|
||||
gubFilename, gTilesets[ giCurrentTilesetID ].zName );
|
||||
UpdateOptions();
|
||||
break;
|
||||
case TASK_TERRAIN:
|
||||
|
||||
@@ -941,6 +962,15 @@ void ProcessEditorRendering()
|
||||
BOOLEAN fSaveBuffer = FALSE;
|
||||
if( gfRenderTaskbar ) //do a full taskbar render.
|
||||
{
|
||||
if(iCurrentTaskbar == TASK_OPTIONS && !gfSummaryWindowActive)//dnl ch52 091009
|
||||
{
|
||||
CHAR8 szNewText[4+1];
|
||||
sprintf(szNewText, "%d", iNewMapWorldRows=WORLD_ROWS);
|
||||
SetInputFieldStringWith8BitString(1, szNewText);
|
||||
sprintf(szNewText, "%d", iNewMapWorldCols=WORLD_COLS);
|
||||
SetInputFieldStringWith8BitString(2, szNewText);
|
||||
DisableTextField(2);
|
||||
}
|
||||
ClearTaskbarRegion( 0, SCREEN_HEIGHT - 120, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
RenderTerrainTileButtons();
|
||||
MarkButtonsDirty();
|
||||
@@ -952,7 +982,7 @@ void ProcessEditorRendering()
|
||||
}
|
||||
if( gfRenderDrawingMode )
|
||||
{
|
||||
if( iCurrentTaskbar == TASK_BUILDINGS || iCurrentTaskbar == TASK_TERRAIN || iCurrentTaskbar == TASK_ITEMS )
|
||||
if( iCurrentTaskbar == TASK_BUILDINGS || iCurrentTaskbar == TASK_TERRAIN || iCurrentTaskbar == TASK_ITEMS )
|
||||
{
|
||||
ShowCurrentDrawingMode();
|
||||
gfRenderDrawingMode = FALSE;
|
||||
|
||||
+20
-20
@@ -113,13 +113,13 @@ BOOLEAN gfIgnoreUndoCmdsForLights = FALSE;
|
||||
typedef struct MapIndexBinaryTree
|
||||
{
|
||||
struct MapIndexBinaryTree *left, *right;
|
||||
INT16 sMapIndex;
|
||||
UINT32 usMapIndex;
|
||||
}MapIndexBinaryTree;
|
||||
|
||||
MapIndexBinaryTree *top = NULL;
|
||||
void ClearUndoMapIndexTree();
|
||||
BOOLEAN AddMapIndexToTree( INT16 sMapIndex );
|
||||
void CheckMapIndexForMultiTileStructures( INT16 sMapIndex );
|
||||
BOOLEAN AddMapIndexToTree( UINT32 usMapIndex );
|
||||
void CheckMapIndexForMultiTileStructures( UINT32 usMapIndex );
|
||||
void CheckForMultiTilesInTreeAndAddToUndoList( MapIndexBinaryTree *node );
|
||||
|
||||
|
||||
@@ -141,14 +141,14 @@ void ClearUndoMapIndexTree()
|
||||
DeleteTreeNode( &top );
|
||||
}
|
||||
|
||||
BOOLEAN AddMapIndexToTree( INT16 sMapIndex )
|
||||
BOOLEAN AddMapIndexToTree( UINT32 usMapIndex )
|
||||
{
|
||||
MapIndexBinaryTree *curr, *parent;
|
||||
if( !top )
|
||||
{
|
||||
top = (MapIndexBinaryTree*)MemAlloc( sizeof( MapIndexBinaryTree ) );
|
||||
Assert( top );
|
||||
top->sMapIndex = sMapIndex;
|
||||
top->usMapIndex = usMapIndex;
|
||||
top->left = NULL;
|
||||
top->right = NULL;
|
||||
return TRUE;
|
||||
@@ -161,21 +161,21 @@ BOOLEAN AddMapIndexToTree( INT16 sMapIndex )
|
||||
while( curr )
|
||||
{
|
||||
parent = curr;
|
||||
if( curr->sMapIndex == sMapIndex ) //found a match, so stop
|
||||
if( curr->usMapIndex == usMapIndex ) //found a match, so stop
|
||||
return FALSE;
|
||||
//if the mapIndex is < node's mapIndex, then go left, else right
|
||||
curr = ( sMapIndex < curr->sMapIndex ) ? curr->left : curr->right;
|
||||
curr = ( usMapIndex < curr->usMapIndex ) ? curr->left : curr->right;
|
||||
}
|
||||
//if we made it this far, then curr is null and parent is pointing
|
||||
//directly above.
|
||||
//Create the new node and fill in the information.
|
||||
curr = (MapIndexBinaryTree*)MemAlloc( sizeof( MapIndexBinaryTree ) );
|
||||
Assert( curr );
|
||||
curr->sMapIndex = sMapIndex;
|
||||
curr->usMapIndex = usMapIndex;
|
||||
curr->left = NULL;
|
||||
curr->right = NULL;
|
||||
//Now link the new node to the parent.
|
||||
if( curr->sMapIndex < parent->sMapIndex )
|
||||
if( curr->usMapIndex < parent->usMapIndex )
|
||||
parent->left = curr;
|
||||
else
|
||||
parent->right = curr;
|
||||
@@ -420,7 +420,7 @@ BOOLEAN AddToUndoList( INT32 iMapIndex )
|
||||
//Check to see if the tile in question is even on the visible map, then
|
||||
//if that is true, then check to make sure we don't already have the mapindex
|
||||
//saved in the new binary tree (which only holds unique mapindex values).
|
||||
if( GridNoOnVisibleWorldTile( (INT16)iMapIndex ) && AddMapIndexToTree( (INT16)iMapIndex ) )
|
||||
if( GridNoOnVisibleWorldTile( iMapIndex ) && AddMapIndexToTree( iMapIndex ) )//dnl ch56 141009
|
||||
|
||||
{
|
||||
if( AddToUndoListCmd( iMapIndex, ++iCount ) )
|
||||
@@ -519,13 +519,13 @@ BOOLEAN AddToUndoListCmd( INT32 iMapIndex, INT32 iCmdCount )
|
||||
}
|
||||
|
||||
|
||||
void CheckMapIndexForMultiTileStructures( INT16 sMapIndex )
|
||||
void CheckMapIndexForMultiTileStructures( UINT32 usMapIndex )
|
||||
{
|
||||
STRUCTURE * pStructure;
|
||||
UINT8 ubLoop;
|
||||
INT32 iCoveredMapIndex;
|
||||
|
||||
pStructure = gpWorldLevelData[sMapIndex].pStructureHead;
|
||||
pStructure = gpWorldLevelData[usMapIndex].pStructureHead;
|
||||
while (pStructure)
|
||||
{
|
||||
if (pStructure->pDBStructureRef->pDBStructure->ubNumberOfTiles > 1)
|
||||
@@ -535,7 +535,7 @@ void CheckMapIndexForMultiTileStructures( INT16 sMapIndex )
|
||||
// for multi-tile structures we have to add, to the undo list, all the other tiles covered by the structure
|
||||
if (pStructure->fFlags & STRUCTURE_BASE_TILE)
|
||||
{
|
||||
iCoveredMapIndex = sMapIndex + pStructure->pDBStructureRef->ppTile[ubLoop]->sPosRelToBase;
|
||||
iCoveredMapIndex = usMapIndex + pStructure->pDBStructureRef->ppTile[ubLoop]->sPosRelToBase;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -550,7 +550,7 @@ void CheckMapIndexForMultiTileStructures( INT16 sMapIndex )
|
||||
|
||||
void CheckForMultiTilesInTreeAndAddToUndoList( MapIndexBinaryTree *node )
|
||||
{
|
||||
CheckMapIndexForMultiTileStructures( node->sMapIndex );
|
||||
CheckMapIndexForMultiTileStructures( node->usMapIndex );
|
||||
if( node->left )
|
||||
CheckForMultiTilesInTreeAndAddToUndoList( node->left );
|
||||
if( node->right )
|
||||
@@ -590,7 +590,7 @@ BOOLEAN ExecuteUndoList( void )
|
||||
{
|
||||
iUndoMapIndex = gpTileUndoStack->pData->iMapIndex;
|
||||
|
||||
fExitGrid = ExitGridAtGridNo( (INT16)iUndoMapIndex );
|
||||
fExitGrid = ExitGridAtGridNo( iUndoMapIndex );
|
||||
|
||||
// Find which map tile we are to "undo"
|
||||
if( gpTileUndoStack->pData->fLightSaved )
|
||||
@@ -599,7 +599,7 @@ BOOLEAN ExecuteUndoList( void )
|
||||
//Turn on this flag so that the following code, when executed, doesn't attempt to
|
||||
//add lights to the undo list. That would cause problems...
|
||||
gfIgnoreUndoCmdsForLights = TRUE;
|
||||
ConvertGridNoToXY( (INT16)iUndoMapIndex, &sX, &sY );
|
||||
ConvertGridNoToXY( iUndoMapIndex, &sX, &sY );
|
||||
if( !gpTileUndoStack->pData->ubLightRadius )
|
||||
RemoveLight( sX, sY );
|
||||
else
|
||||
@@ -632,13 +632,13 @@ BOOLEAN ExecuteUndoList( void )
|
||||
//hacking around this by erasing all cursors here.
|
||||
RemoveAllTopmostsOfTypeRange( iUndoMapIndex, FIRSTPOINTERS, FIRSTPOINTERS );
|
||||
|
||||
if( fExitGrid && !ExitGridAtGridNo( (INT16)iUndoMapIndex ) )
|
||||
if( fExitGrid && !ExitGridAtGridNo( iUndoMapIndex ) )
|
||||
{ //An exitgrid has been removed, so get rid of the associated indicator.
|
||||
RemoveTopmost( (UINT16)iUndoMapIndex, FIRSTPOINTERS8 );
|
||||
RemoveTopmost( iUndoMapIndex, FIRSTPOINTERS8 );
|
||||
}
|
||||
else if( !fExitGrid && ExitGridAtGridNo( (INT16)iUndoMapIndex ) )
|
||||
else if( !fExitGrid && ExitGridAtGridNo( iUndoMapIndex ) )
|
||||
{ //An exitgrid has been added, so add the associated indicator
|
||||
AddTopmostToTail( (UINT16)iUndoMapIndex, FIRSTPOINTERS8 );
|
||||
AddTopmostToTail( iUndoMapIndex, FIRSTPOINTERS8 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,147 +0,0 @@
|
||||
# Microsoft Developer Studio Generated Dependency File, included by Editor.mak
|
||||
|
||||
".\Cursor Modes.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\edit_sys.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Editor Callbacks.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Editor Modes.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Editor Taskbar Creation.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Editor Taskbar Utils.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Editor Undo.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\EditorBuildings.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\EditorItems.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\EditorMapInfo.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\EditorMercs.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\EditorTerrain.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\editscreen.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
"..\screenids.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Item Statistics.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\LoadScreen.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
"..\screenids.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\messagebox.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\newsmooth.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\popupmenu.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Road Smoothing.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Sector Summary.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\selectwin.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\SmartMethod.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
.\smooth.cpp : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
|
||||
".\Smoothing Utils.cpp" : \
|
||||
"..\builddefines.h"\
|
||||
"..\Language Defines.h"\
|
||||
".\Editor All.h"\
|
||||
|
||||
@@ -1,450 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="Editor" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=Editor - Win32 Demo Bounds Checker
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Editor.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Editor.mak" CFG="Editor - Win32 Demo Bounds Checker"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Editor - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Debug Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Release Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Demo Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Editor - Win32 Demo Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/Jagged Alliance 2/Development/Programming/Jagged Alliance 2/Build", AVAAAAAA"
|
||||
# PROP Scc_LocalPath "..\..\..\ja2\build"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Editor - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /Ob2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Release with Debug Info"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Editor__"
|
||||
# PROP BASE Intermediate_Dir "Editor__"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release with Debug"
|
||||
# PROP Intermediate_Dir "Release with Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "JA2" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\TileEngine" /I "..\Utils" /I "..\TacticalAI" /I "..\Tactical" /I "..\strategic" /I ".\\" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Bounds Checker"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Editor_1"
|
||||
# PROP BASE Intermediate_Dir "Editor_1"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Bounds Checker"
|
||||
# PROP Intermediate_Dir "Bounds Checker"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Debug Demo"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Editor_0"
|
||||
# PROP BASE Intermediate_Dir "Editor_0"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug Demo"
|
||||
# PROP Intermediate_Dir "Debug Demo"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "JA2DEMO" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Release Demo"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Editor_2"
|
||||
# PROP BASE Intermediate_Dir "Editor_2"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release Demo"
|
||||
# PROP Intermediate_Dir "Release Demo"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Demo Release with Debug Info"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Editor_3"
|
||||
# PROP BASE Intermediate_Dir "Editor_3"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Demo Release with Debug"
|
||||
# PROP Intermediate_Dir "Demo Release with Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\TileEngine" /I "..\Utils" /I "..\TacticalAI" /I "..\Tactical" /I "..\strategic" /I ".\\" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Editor - Win32 Demo Bounds Checker"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Editor_4"
|
||||
# PROP BASE Intermediate_Dir "Editor_4"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Demo Bounds Checker"
|
||||
# PROP Intermediate_Dir "Demo Bounds Checker"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "BOUNDS_CHECKER" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\strategic" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"Editor All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Editor - Win32 Release"
|
||||
# Name "Editor - Win32 Debug"
|
||||
# Name "Editor - Win32 Release with Debug Info"
|
||||
# Name "Editor - Win32 Bounds Checker"
|
||||
# Name "Editor - Win32 Debug Demo"
|
||||
# Name "Editor - Win32 Release Demo"
|
||||
# Name "Editor - Win32 Demo Release with Debug Info"
|
||||
# Name "Editor - Win32 Demo Bounds Checker"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Cursor Modes.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\edit_sys.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Callbacks.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Modes.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Taskbar Creation.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Taskbar Utils.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Undo.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorBuildings.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorItems.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorMapInfo.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorMercs.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorTerrain.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\editscreen.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Item Statistics.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LoadScreen.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\messagebox.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\newsmooth.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\popupmenu.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Road Smoothing.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Sector Summary.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\selectwin.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\SmartMethod.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\smooth.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Smoothing Utils.cpp"
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Button Defines.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Cursor Modes.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\edit_sys.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor All.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Callback Prototypes.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Modes.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Taskbar Creation.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Taskbar Utils.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Editor Undo.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorBuildings.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorDefines.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorItems.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorMapInfo.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorMercs.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\EditorTerrain.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\editscreen.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Item Statistics.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LoadScreen.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\messagebox.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\newsmooth.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\popupmenu.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Road Smoothing.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Sector Summary.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\selectwin.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\SmartMethod.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\smooth.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Smoothing Utils.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Summary Info.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
-1274
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+18
-14
@@ -67,11 +67,11 @@ void UpdateWallsView()
|
||||
{
|
||||
if ( fBuildingShowWalls )
|
||||
{
|
||||
RemoveWallLevelnodeFlags( (INT16)cnt, LEVELNODE_HIDDEN );
|
||||
RemoveWallLevelnodeFlags( cnt, LEVELNODE_HIDDEN );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetWallLevelnodeFlags( (INT16)cnt, LEVELNODE_HIDDEN );
|
||||
SetWallLevelnodeFlags( cnt, LEVELNODE_HIDDEN );
|
||||
}
|
||||
}
|
||||
gfRenderWorld = TRUE;
|
||||
@@ -102,7 +102,7 @@ void UpdateBuildingsInfo()
|
||||
//4) KillBuilding at x , y-1.
|
||||
//5) KillBuilding at x+1, y.
|
||||
//6) KillBuilding at x , y+1.
|
||||
void KillBuilding( UINT32 iMapIndex )
|
||||
void KillBuilding( INT32 iMapIndex )
|
||||
{
|
||||
BOOLEAN fFound = FALSE;
|
||||
|
||||
@@ -120,13 +120,13 @@ void KillBuilding( UINT32 iMapIndex )
|
||||
return;
|
||||
}
|
||||
|
||||
if( GridNoOnVisibleWorldTile( (INT16)( iMapIndex - WORLD_COLS ) ) )
|
||||
if( GridNoOnVisibleWorldTile( iMapIndex - WORLD_COLS ) )
|
||||
KillBuilding( iMapIndex - WORLD_COLS );
|
||||
if( GridNoOnVisibleWorldTile( (INT16)( iMapIndex + WORLD_COLS ) ) )
|
||||
if( GridNoOnVisibleWorldTile( iMapIndex + WORLD_COLS ) )
|
||||
KillBuilding( iMapIndex + WORLD_COLS );
|
||||
if( GridNoOnVisibleWorldTile( (INT16)( iMapIndex + 1 ) ) )
|
||||
if( GridNoOnVisibleWorldTile( iMapIndex + 1 ) )
|
||||
KillBuilding( iMapIndex + 1 );
|
||||
if( GridNoOnVisibleWorldTile( (INT16)( iMapIndex - 1 ) ) )
|
||||
if( GridNoOnVisibleWorldTile( iMapIndex - 1 ) )
|
||||
KillBuilding( iMapIndex - 1 );
|
||||
|
||||
if( gfBasement )
|
||||
@@ -134,7 +134,7 @@ void KillBuilding( UINT32 iMapIndex )
|
||||
}
|
||||
|
||||
BUILDINGLAYOUTNODE *gpBuildingLayoutList = NULL;
|
||||
INT16 gsBuildingLayoutAnchorGridNo = -1;
|
||||
INT32 gsBuildingLayoutAnchorGridNo = -1;
|
||||
extern void RemoveBuildingLayout();
|
||||
|
||||
void DeleteBuildingLayout()
|
||||
@@ -175,14 +175,14 @@ void BuildLayout( INT32 iMapIndex, INT32 iOffset )
|
||||
curr = gpBuildingLayoutList;
|
||||
while( curr )
|
||||
{
|
||||
if( (INT16)iMapIndex == curr->sGridNo )
|
||||
if( iMapIndex == curr->sGridNo )
|
||||
return;
|
||||
curr = curr->next;
|
||||
}
|
||||
//Good, it hasn't, so process it and add it to the head of the list.
|
||||
curr = (BUILDINGLAYOUTNODE*)MemAlloc( sizeof( BUILDINGLAYOUTNODE ) );
|
||||
Assert( curr );
|
||||
curr->sGridNo = (INT16)iMapIndex;
|
||||
curr->sGridNo = iMapIndex;
|
||||
curr->next = gpBuildingLayoutList;
|
||||
gpBuildingLayoutList = curr;
|
||||
|
||||
@@ -205,11 +205,11 @@ void CopyBuilding( INT32 iMapIndex )
|
||||
//Allocate the basic structure, then calculate the layout. The head node is
|
||||
gpBuildingLayoutList = (BUILDINGLAYOUTNODE*)MemAlloc( sizeof( BUILDINGLAYOUTNODE ) );
|
||||
Assert( gpBuildingLayoutList );
|
||||
gpBuildingLayoutList->sGridNo = (INT16)iMapIndex;
|
||||
gpBuildingLayoutList->sGridNo = iMapIndex;
|
||||
gpBuildingLayoutList->next = NULL;
|
||||
|
||||
//Set the anchor point for this building -- this is where the user clicked.
|
||||
gsBuildingLayoutAnchorGridNo = (INT16)iMapIndex;
|
||||
gsBuildingLayoutAnchorGridNo = iMapIndex;
|
||||
|
||||
//Now, recursively expand out while adding unique gridnos to our list. The recursion will
|
||||
//terminate when complete.
|
||||
@@ -363,6 +363,8 @@ void MoveBuilding( INT32 iMapIndex )
|
||||
return;
|
||||
SortBuildingLayout( iMapIndex );
|
||||
iOffset = iMapIndex - gsBuildingLayoutAnchorGridNo;
|
||||
if(iOffset == 0)//dnl ch32 080909
|
||||
return;
|
||||
//First time, set the undo gridnos to everything effected.
|
||||
curr = gpBuildingLayoutList;
|
||||
while( curr )
|
||||
@@ -390,6 +392,8 @@ void PasteBuilding( INT32 iMapIndex )
|
||||
return;
|
||||
SortBuildingLayout( iMapIndex );
|
||||
iOffset = iMapIndex - gsBuildingLayoutAnchorGridNo;
|
||||
if(iOffset == 0)//dnl ch32 080909
|
||||
return;
|
||||
curr = gpBuildingLayoutList;
|
||||
//First time, set the undo gridnos to everything effected.
|
||||
while( curr )
|
||||
@@ -500,7 +504,7 @@ void DoorOkayCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
void DoorCancelCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
void DoorToggleLockedCallback( GUI_BUTTON *btn, INT32 reason );
|
||||
|
||||
extern BOOLEAN OpenableAtGridNo( UINT32 iMapIndex );
|
||||
extern BOOLEAN OpenableAtGridNo( INT32 iMapIndex );
|
||||
|
||||
void InitDoorEditing( INT32 iMapIndex )
|
||||
{
|
||||
@@ -558,7 +562,7 @@ void ExtractAndUpdateDoorInfo()
|
||||
|
||||
memset( &door, 0, sizeof( DOOR ) );
|
||||
|
||||
door.sGridNo = (INT16)iDoorMapIndex;
|
||||
door.sGridNo = iDoorMapIndex;
|
||||
|
||||
num = min( GetNumericStrictValueFromField( 0 ), NUM_LOCKS-1 );
|
||||
door.ubLockID = (UINT8)num;
|
||||
|
||||
@@ -21,17 +21,17 @@ void InitEditorBuildingsToolbar();
|
||||
//Selection method callbacks
|
||||
//Building utility functions
|
||||
void UpdateBuildingsInfo();
|
||||
void KillBuilding( UINT32 iMapIndex );
|
||||
void KillBuilding( INT32 iMapIndex );
|
||||
|
||||
|
||||
typedef struct BUILDINGLAYOUTNODE
|
||||
{
|
||||
struct BUILDINGLAYOUTNODE *next;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
}BUILDINGLAYOUTNODE;
|
||||
|
||||
extern BUILDINGLAYOUTNODE *gpBuildingLayoutList;
|
||||
extern INT16 gsBuildingLayoutAnchorGridNo;
|
||||
extern INT32 gsBuildingLayoutAnchorGridNo;
|
||||
|
||||
//The first step is copying a building. After that, it either must be pasted or moved.
|
||||
void CopyBuilding( INT32 iMapIndex );
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Types.h"
|
||||
#include "Button Defines.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
TBAR_MODE_NONE,
|
||||
@@ -81,6 +82,8 @@ enum
|
||||
TBAR_MODE_ITEM_EQUIPMENT3,
|
||||
TBAR_MODE_ITEM_TRIGGERS,
|
||||
TBAR_MODE_ITEM_KEYS,
|
||||
|
||||
TBAR_MODE_RADAR_MAP,//dnl ch9 071009
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -158,6 +161,7 @@ enum
|
||||
|
||||
ACTION_COPY_MERC_PLACEMENT,
|
||||
ACTION_PASTE_MERC_PLACEMENT,
|
||||
ACTION_RADAR_MAP,//dnl ch9 071009
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -166,6 +170,7 @@ enum
|
||||
//Terrain
|
||||
DRAW_MODE_GROUND,
|
||||
DRAW_MODE_NEW_GROUND,
|
||||
DRAW_MODE_HIGH_GROUND,//dnl ch1 210909
|
||||
DRAW_MODE_DEBRIS,
|
||||
DRAW_MODE_BANKS,
|
||||
DRAW_MODE_ROADS,
|
||||
|
||||
+33
-24
@@ -42,6 +42,7 @@
|
||||
#include "random.h"
|
||||
#include "Pits.h"
|
||||
#include "keys.h"
|
||||
#include "InterfaceItemImages.h"
|
||||
#endif
|
||||
|
||||
#include "VFS/Tools/Log.h"
|
||||
@@ -70,7 +71,7 @@ INT32 giDefaultExistChance = 100;
|
||||
|
||||
typedef struct IPListNode
|
||||
{
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
struct IPListNode *next;
|
||||
}IPListNode;
|
||||
|
||||
@@ -83,7 +84,7 @@ void BuildItemPoolList()
|
||||
{
|
||||
ITEM_POOL *temp;
|
||||
IPListNode *tail = NULL;
|
||||
UINT16 i;
|
||||
INT32 i;
|
||||
KillItemPoolList();
|
||||
for( i = 0; i < WORLD_MAX; i++ )
|
||||
{
|
||||
@@ -116,7 +117,8 @@ void KillItemPoolList()
|
||||
pIPCurr = pIPHead;
|
||||
while( pIPCurr )
|
||||
{
|
||||
HideItemCursor( pIPCurr->sGridNo );
|
||||
if(pIPCurr->sGridNo < WORLD_MAX)//dnl ch43 280909 Prevent CTD when world size is changed
|
||||
HideItemCursor(pIPCurr->sGridNo);
|
||||
pIPHead = pIPHead->next;
|
||||
MemFree( pIPCurr );
|
||||
pIPCurr = pIPHead;
|
||||
@@ -379,14 +381,15 @@ void InitEditorItemsInfo(UINT32 uiItemType)
|
||||
swprintf( pStr, L"%S", LockTable[ i ].ubEditorName );
|
||||
DisplayWrappedString(x, (UINT16)(y+25), 60, 2, SMALLCOMPFONT, FONT_WHITE, pStr, FONT_BLACK, TRUE, CENTER_JUSTIFIED );
|
||||
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
|
||||
//Calculate the center position of the graphic in a 60 pixel wide area.
|
||||
sWidth = hVObject->pETRLEObject[item->ubGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[item->ubGraphicNum].sOffsetX;
|
||||
sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
|
||||
sStart = x + (60 - sWidth - sOffset*2) / 2;
|
||||
|
||||
BltVideoObjectOutlineFromIndex( eInfo.uiBuffer, uiVideoObjectIndex, item->ubGraphicNum, sStart, y+2, 0, FALSE );
|
||||
//cycle through the various slot positions (0,0), (0,40), (60,0), (60,40), (120,0)...
|
||||
BltVideoObjectOutlineFromIndex( eInfo.uiBuffer, uiVideoObjectIndex, usGraphicNum, sStart, y+2, 0, FALSE );
|
||||
|
||||
//cycle through the various slot positions (0,0), (0,40), (60,0), (60,40), (120,0)...
|
||||
if( y == 0 )
|
||||
{
|
||||
y = 40;
|
||||
@@ -528,16 +531,17 @@ void InitEditorItemsInfo(UINT32 uiItemType)
|
||||
|
||||
DisplayWrappedString(x, (UINT16)(y+25), 60, 2, SMALLCOMPFONT, FONT_WHITE, pStr, FONT_BLACK, TRUE, CENTER_JUSTIFIED );
|
||||
|
||||
if(item->ubGraphicNum < hVObject->usNumberOfObjects)
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
|
||||
if(usGraphicNum < hVObject->usNumberOfObjects)
|
||||
{
|
||||
//Calculate the center position of the graphic in a 60 pixel wide area.
|
||||
sWidth = hVObject->pETRLEObject[item->ubGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[item->ubGraphicNum].sOffsetX;
|
||||
sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
|
||||
sStart = x + (60 - sWidth - sOffset*2) / 2;
|
||||
|
||||
if( sWidth && sWidth > 0 )
|
||||
{
|
||||
BltVideoObjectOutlineFromIndex( eInfo.uiBuffer, uiVideoObjectIndex, item->ubGraphicNum, sStart, y+2, 0, FALSE );
|
||||
BltVideoObjectOutlineFromIndex( eInfo.uiBuffer, uiVideoObjectIndex, usGraphicNum, sStart, y+2, 0, FALSE );
|
||||
}
|
||||
|
||||
//cycle through the various slot positions (0,0), (0,40), (60,0), (60,40), (120,0)...
|
||||
@@ -553,10 +557,10 @@ void InitEditorItemsInfo(UINT32 uiItemType)
|
||||
}
|
||||
else
|
||||
{
|
||||
static CLog& editorLog = *CLog::Create(L"EditorItems.log");
|
||||
static CLog& editorLog = *CLog::create(L"EditorItems.log");
|
||||
editorLog << L"Tried to access item ["
|
||||
<< item->ubGraphicNum << L"/" << hVObject->usNumberOfObjects
|
||||
<< L"]" << CLog::endl;
|
||||
<< L"]" << CLog::ENDL;
|
||||
}
|
||||
}
|
||||
usCounter++;
|
||||
@@ -629,12 +633,14 @@ void RenderEditorItemsInfo()
|
||||
|
||||
x = iScreenWidthOffset + (eInfo.sHilitedItemIndex/2 - eInfo.sScrollIndex)*60 + 110;
|
||||
y = 2 * iScreenHeightOffset + 360 + (eInfo.sHilitedItemIndex % 2) * 40;
|
||||
sWidth = hVObject->pETRLEObject[item->ubGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[item->ubGraphicNum].sOffsetX;
|
||||
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
|
||||
sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
|
||||
sStart = x + (60 - sWidth - sOffset*2) / 2;
|
||||
if( sWidth )
|
||||
{
|
||||
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, item->ubGraphicNum, sStart, y+2, Get16BPPColor(FROMRGB(250, 250, 0)), TRUE );
|
||||
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, sStart, y+2, Get16BPPColor(FROMRGB(250, 250, 0)), TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -649,12 +655,14 @@ void RenderEditorItemsInfo()
|
||||
|
||||
x = iScreenWidthOffset + (eInfo.sSelItemIndex/2 - eInfo.sScrollIndex)*60 + 110;
|
||||
y = 2 * iScreenHeightOffset + 360 + (eInfo.sSelItemIndex % 2) * 40;
|
||||
sWidth = hVObject->pETRLEObject[item->ubGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[item->ubGraphicNum].sOffsetX;
|
||||
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
|
||||
sWidth = hVObject->pETRLEObject[usGraphicNum].usWidth;
|
||||
sOffset = hVObject->pETRLEObject[usGraphicNum].sOffsetX;
|
||||
sStart = x + (60 - sWidth - sOffset*2) / 2;
|
||||
if( sWidth )
|
||||
{
|
||||
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, item->ubGraphicNum, sStart, y+2, Get16BPPColor(FROMRGB(250, 0, 0)), TRUE );
|
||||
BltVideoObjectOutlineFromIndex( FRAME_BUFFER, uiVideoObjectIndex, usGraphicNum, sStart, y+2, Get16BPPColor(FROMRGB(250, 0, 0)), TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -821,7 +829,7 @@ void HideItemCursor( INT32 iMapIndex )
|
||||
RemoveTopmost( iMapIndex, SELRING1 );
|
||||
}
|
||||
|
||||
BOOLEAN TriggerAtGridNo( INT16 sGridNo )
|
||||
BOOLEAN TriggerAtGridNo( INT32 sGridNo )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
if( !GetItemPoolFromGround( sGridNo, &pItemPool ) )
|
||||
@@ -840,7 +848,7 @@ BOOLEAN TriggerAtGridNo( INT16 sGridNo )
|
||||
}
|
||||
|
||||
|
||||
void AddSelectedItemToWorld( INT16 sGridNo )
|
||||
void AddSelectedItemToWorld( INT32 sGridNo )
|
||||
{
|
||||
OBJECTTYPE *pObject;
|
||||
INVTYPE *pItem;
|
||||
@@ -955,7 +963,8 @@ void AddSelectedItemToWorld( INT16 sGridNo )
|
||||
}
|
||||
else
|
||||
{
|
||||
(*pObject)[0]->data.objectStatus = (INT8)(70 + Random( 26 ));
|
||||
if(gTempObject.usItem != OWNERSHIP)//dnl ch35 110909
|
||||
(*pObject)[0]->data.objectStatus = (INT8)(70 + Random( 26 ));
|
||||
}
|
||||
if( pItem->usItemClass & IC_GUN )
|
||||
{
|
||||
@@ -1023,7 +1032,7 @@ void AddSelectedItemToWorld( INT16 sGridNo )
|
||||
}
|
||||
}
|
||||
|
||||
void HandleRightClickOnItem( INT16 sGridNo )
|
||||
void HandleRightClickOnItem( INT32 sGridNo )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
IPListNode *pIPCurr;
|
||||
@@ -1074,7 +1083,7 @@ void DeleteSelectedItem()
|
||||
}
|
||||
if( gpItemPool )
|
||||
{ //Okay, we have a selected item...
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
//save the mapindex
|
||||
if( gpItemPool->pNext )
|
||||
{
|
||||
|
||||
@@ -12,7 +12,7 @@ typedef struct{
|
||||
UINT16 *pusItemIndex; //a dynamic array of Item indices
|
||||
UINT32 uiBuffer; //index of buffer
|
||||
UINT32 uiItemType; //Weapons, ammo, armour, explosives, equipment
|
||||
INT32 sWidth, sHeight; //width and height of buffer
|
||||
INT16 sWidth, sHeight; //width and height of buffer
|
||||
//Kaiden: was previously INT16 - Fix for number of items capped by class
|
||||
INT16 sNumItems; //total number of items in the current class of item.
|
||||
INT16 sSelItemIndex; //currently selected item index.
|
||||
@@ -39,8 +39,8 @@ void DisplayItemStatistics();
|
||||
void DetermineItemsScrolling();
|
||||
|
||||
//User actions
|
||||
void AddSelectedItemToWorld( INT16 sGridNo );
|
||||
void HandleRightClickOnItem( INT16 sGridNo );
|
||||
void AddSelectedItemToWorld( INT32 sGridNo );
|
||||
void HandleRightClickOnItem( INT32 sGridNo );
|
||||
void DeleteSelectedItem();
|
||||
void ShowSelectedItem();
|
||||
void HideSelectedItem();
|
||||
|
||||
@@ -67,6 +67,45 @@ INT8 gbDefaultLightType = PRIMETIME_LIGHT;
|
||||
SGPPaletteEntry gEditorLightColor;
|
||||
|
||||
BOOLEAN gfEditorForceShadeTableRebuild = FALSE;
|
||||
//dnl ch43 290909
|
||||
INT32 iNewMapWorldRows = OLD_WORLD_ROWS;
|
||||
INT32 iNewMapWorldCols = OLD_WORLD_COLS;
|
||||
|
||||
void SetupTextInputForOptions(void)//dnl ch52 091009
|
||||
{
|
||||
CHAR16 str[10];
|
||||
InitTextInputModeWithScheme(DEFAULT_SCHEME);
|
||||
AddUserInputField(NULL); // Just so we can use short cut keys while not typing.
|
||||
swprintf(str, L"%d", WORLD_ROWS);
|
||||
AddTextInputField( iScreenWidthOffset+5, 2*iScreenHeightOffset+394, 30, 18, MSYS_PRIORITY_NORMAL, str, 4, INPUTTYPE_NUMERICSTRICT);
|
||||
swprintf(str, L"%d", WORLD_COLS);
|
||||
AddTextInputField(iScreenWidthOffset+5, 2*iScreenHeightOffset+414, 30, 18, MSYS_PRIORITY_NORMAL, str, 4, INPUTTYPE_NUMERICSTRICT);
|
||||
DisableTextField(2);
|
||||
}
|
||||
|
||||
void UpdateOptions()
|
||||
{
|
||||
SetFont( FONT10ARIAL );
|
||||
SetFontShadow( FONT_NEARBLACK );
|
||||
|
||||
SetFontForeground( FONT_YELLOW );
|
||||
mprintf( iScreenWidthOffset + 38, 2 * iScreenHeightOffset + 399, L"Rows");
|
||||
SetFontForeground( FONT_YELLOW );
|
||||
mprintf( iScreenWidthOffset + 38, 2 * iScreenHeightOffset + 419, L"Cols");
|
||||
|
||||
SetFontForeground( FONT_RED );
|
||||
}
|
||||
|
||||
void ExtractAndUpdateOptions(void)//dnl ch52 091009
|
||||
{
|
||||
iNewMapWorldRows = max(min(GetNumericStrictValueFromField(1), 9600), OLD_WORLD_ROWS);
|
||||
iNewMapWorldRows /= 4;
|
||||
iNewMapWorldRows *= 4;
|
||||
iNewMapWorldCols = iNewMapWorldRows;
|
||||
//iNewMapWorldCols = max(min(GetNumericStrictValueFromField(2), 9600), OLD_WORLD_COLS);
|
||||
//iNewMapWorldCols /= 4;
|
||||
//iNewMapWorldCols *= 4;
|
||||
}
|
||||
|
||||
void SetupTextInputForMapInfo()
|
||||
{
|
||||
@@ -101,7 +140,7 @@ void SetupTextInputForMapInfo()
|
||||
AddTextInputField( iScreenWidthOffset + 338, 2 * iScreenHeightOffset + 363, 30, 18, MSYS_PRIORITY_NORMAL, str, 3, INPUTTYPE_EXCLUSIVE_COORDINATE );
|
||||
swprintf( str, L"%d", gExitGrid.ubGotoSectorZ );
|
||||
AddTextInputField( iScreenWidthOffset + 338, 2 * iScreenHeightOffset + 383, 30, 18, MSYS_PRIORITY_NORMAL, str, 1, INPUTTYPE_NUMERICSTRICT );
|
||||
swprintf( str, L"%d", gExitGrid.sGridNo );
|
||||
swprintf( str, L"%d", gExitGrid.usGridNo );
|
||||
AddTextInputField( iScreenWidthOffset + 338, 2 * iScreenHeightOffset + 403, 40, 18, MSYS_PRIORITY_NORMAL, str, 5, INPUTTYPE_NUMERICSTRICT );
|
||||
}
|
||||
|
||||
@@ -241,7 +280,7 @@ void ExtractAndUpdateMapInfo()
|
||||
gExitGrid.ubGotoSectorY = (UINT8)max( min( gExitGrid.ubGotoSectorY, 16 ), 1 );
|
||||
}
|
||||
gExitGrid.ubGotoSectorZ = (UINT8)max( min( GetNumericStrictValueFromField( 8 ), 3 ), 0 );
|
||||
gExitGrid.sGridNo = (INT16)max( min( GetNumericStrictValueFromField( 9 ), 25600 ), 0 );
|
||||
gExitGrid.usGridNo = max( min( GetNumericStrictValueFromField( 9 ), 25600 ), 0 );
|
||||
|
||||
UpdateMapInfoFields();
|
||||
}
|
||||
@@ -256,17 +295,17 @@ BOOLEAN ApplyNewExitGridValuesToTextFields()
|
||||
SetInputFieldStringWith16BitString( 7, str );
|
||||
swprintf( str, L"%d", gExitGrid.ubGotoSectorZ );
|
||||
SetInputFieldStringWith16BitString( 8, str );
|
||||
swprintf( str, L"%d", gExitGrid.sGridNo );
|
||||
swprintf( str, L"%d", gExitGrid.usGridNo );
|
||||
SetInputFieldStringWith16BitString( 9, str );
|
||||
SetActiveField( 0 );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
INT16 usCurrentExitGridNo = 0;
|
||||
INT32 usCurrentExitGridNo = 0;
|
||||
void LocateNextExitGrid()
|
||||
{
|
||||
EXITGRID ExitGrid;
|
||||
UINT16 i;
|
||||
INT32 i;
|
||||
for( i = usCurrentExitGridNo + 1; i < WORLD_MAX; i++ )
|
||||
{
|
||||
if( GetExitGrid( i, &ExitGrid ) )
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
#ifndef __EDITORMAPINFO_H
|
||||
#define __EDITORMAPINFO_H
|
||||
|
||||
extern INT32 iNewMapWorldRows;
|
||||
extern INT32 iNewMapWorldCols;
|
||||
|
||||
void SetupTextInputForOptions();
|
||||
void UpdateOptions();
|
||||
void ExtractAndUpdateOptions();
|
||||
void SetupTextInputForMapInfo();
|
||||
void UpdateMapInfo();
|
||||
void ExtractAndUpdateMapInfo();
|
||||
|
||||
+72
-73
@@ -62,6 +62,7 @@
|
||||
#include "Scheduling.h"
|
||||
#include "Timer Control.h"
|
||||
#include "message.h"
|
||||
#include "InterfaceItemImages.h"
|
||||
#endif
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -195,7 +196,7 @@ BASIC_SOLDIERCREATE_STRUCT gTempBasicPlacement;
|
||||
SOLDIERCREATE_STRUCT gTempDetailedPlacement;
|
||||
|
||||
INT16 gsSelectedMercID;
|
||||
INT16 gsSelectedMercGridNo;
|
||||
INT32 gsSelectedMercGridNo;
|
||||
SOLDIERINITNODE *gpSelected;
|
||||
|
||||
UINT8 gubCurrMercMode = MERC_TEAMMODE;
|
||||
@@ -320,8 +321,8 @@ void GameInitEditorMercsInfo()
|
||||
for( i = 0; i < 4; i++ )
|
||||
{
|
||||
gCurrSchedule.usTime[i] = 0xffff;
|
||||
gCurrSchedule.usData1[i] = 0xffff;
|
||||
gCurrSchedule.usData2[i] = 0xffff;
|
||||
gCurrSchedule.usData1[i] = 0xffffffff;
|
||||
gCurrSchedule.usData2[i] = 0xffffffff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +526,7 @@ void AddMercToWorld( INT32 iMapIndex )
|
||||
//Set up some general information.
|
||||
gTempBasicPlacement.fDetailedPlacement = FALSE;
|
||||
gTempBasicPlacement.fPriorityExistance = FALSE;
|
||||
gTempBasicPlacement.sStartingGridNo = (INT16)iMapIndex;
|
||||
gTempBasicPlacement.usStartingGridNo = iMapIndex;
|
||||
gTempBasicPlacement.bOrders = gbDefaultOrders;
|
||||
gTempBasicPlacement.bAttitude = gbDefaultAttitude;
|
||||
gTempBasicPlacement.bRelativeAttributeLevel = gbDefaultRelativeAttributeLevel;
|
||||
@@ -577,7 +578,7 @@ void HandleRightClickOnMerc( INT32 iMapIndex )
|
||||
INT16 sThisMercID;
|
||||
INT16 sCellX, sCellY;
|
||||
|
||||
ConvertGridNoToCellXY( (INT16)iMapIndex, &sCellX, &sCellY );
|
||||
ConvertGridNoToCellXY( iMapIndex, &sCellX, &sCellY );
|
||||
|
||||
sThisMercID = (INT16)IsMercHere( iMapIndex );
|
||||
|
||||
@@ -610,8 +611,8 @@ void HandleRightClickOnMerc( INT32 iMapIndex )
|
||||
gpSelected->pDetailedPlacement->fOnRoof = FALSE;
|
||||
gpSelected->pSoldier->SetSoldierHeight( 0.0 );
|
||||
}
|
||||
gsSelectedMercGridNo = (INT16)iMapIndex;
|
||||
gpSelected->pBasicPlacement->sStartingGridNo = gsSelectedMercGridNo;
|
||||
gsSelectedMercGridNo = iMapIndex;
|
||||
gpSelected->pBasicPlacement->usStartingGridNo = gsSelectedMercGridNo;
|
||||
if( gpSelected->pDetailedPlacement )
|
||||
gpSelected->pDetailedPlacement->sInsertionGridNo = gsSelectedMercGridNo;
|
||||
AddObjectToHead( gsSelectedMercGridNo, CONFIRMMOVE1 );
|
||||
@@ -640,7 +641,7 @@ void ResetAllMercPositions()
|
||||
TacticalRemoveSoldier( curr->pSoldier->ubID );
|
||||
curr->pSoldier = NULL;
|
||||
}
|
||||
//sMapIndex = gpSelected->pBasicPlacement->sStartingGridNo;
|
||||
//usMapIndex = gpSelected->pBasicPlacement->usStartingGridNo;
|
||||
//ConvertGridNoToCellXY( sMapIndex, &sCellX, &sCellY );
|
||||
//if( gpSelected->pSoldier )
|
||||
//{
|
||||
@@ -659,7 +660,7 @@ void ResetAllMercPositions()
|
||||
gsSelectedMercID = -1;
|
||||
}
|
||||
|
||||
void AddMercWaypoint( UINT32 iMapIndex )
|
||||
void AddMercWaypoint( INT32 iMapIndex )
|
||||
{
|
||||
INT32 iNum;
|
||||
// index 0 isn't used
|
||||
@@ -674,10 +675,10 @@ void AddMercWaypoint( UINT32 iMapIndex )
|
||||
// Fill up missing waypoints with same value as new one
|
||||
for(iNum = gpSelected->pSoldier->aiData.bPatrolCnt + 1; iNum <= iActionParam; iNum++)
|
||||
{
|
||||
gpSelected->pBasicPlacement->sPatrolGrid[iNum] = (INT16)iMapIndex;
|
||||
gpSelected->pBasicPlacement->sPatrolGrid[iNum] = iMapIndex;
|
||||
if( gpSelected->pDetailedPlacement )
|
||||
gpSelected->pDetailedPlacement->sPatrolGrid[iNum] = (INT16)iMapIndex;
|
||||
gpSelected->pSoldier->aiData.sPatrolGrid[iNum] = (INT16)iMapIndex;
|
||||
gpSelected->pDetailedPlacement->sPatrolGrid[iNum] = iMapIndex;
|
||||
gpSelected->pSoldier->aiData.sPatrolGrid[iNum] = iMapIndex;
|
||||
}
|
||||
|
||||
gpSelected->pBasicPlacement->bPatrolCnt = (INT8)iActionParam;
|
||||
@@ -689,10 +690,10 @@ void AddMercWaypoint( UINT32 iMapIndex )
|
||||
else
|
||||
{
|
||||
// Set this way point
|
||||
gpSelected->pBasicPlacement->sPatrolGrid[iActionParam] = (INT16)iMapIndex;
|
||||
gpSelected->pBasicPlacement->sPatrolGrid[iActionParam] = iMapIndex;
|
||||
if( gpSelected->pDetailedPlacement )
|
||||
gpSelected->pDetailedPlacement->sPatrolGrid[iActionParam] = (INT16)iMapIndex;
|
||||
gpSelected->pSoldier->aiData.sPatrolGrid[iActionParam] = (INT16)iMapIndex;
|
||||
gpSelected->pDetailedPlacement->sPatrolGrid[iActionParam] = iMapIndex;
|
||||
gpSelected->pSoldier->aiData.sPatrolGrid[iActionParam] = iMapIndex;
|
||||
}
|
||||
gfRenderWorld = TRUE;
|
||||
}
|
||||
@@ -881,7 +882,7 @@ INT32 IsMercHere( INT32 iMapIndex )
|
||||
{
|
||||
if ( GetSoldier( &pSoldier, (INT16)IDNumber ) )
|
||||
{
|
||||
if ( pSoldier->sGridNo == (INT16)iMapIndex )
|
||||
if ( pSoldier->sGridNo == iMapIndex )
|
||||
{
|
||||
fSoldierFound = TRUE;
|
||||
RetIDNumber = IDNumber;
|
||||
@@ -1294,7 +1295,7 @@ void DisplayWayPoints(void)
|
||||
FLOAT ScrnX,ScrnY,dOffsetX,dOffsetY;
|
||||
INT8 bPoint;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
|
||||
if ( gsSelectedMercID == -1 || (gsSelectedMercID <= (INT32)gTacticalStatus.Team[ OUR_TEAM ].bLastID) || gsSelectedMercID >= MAXMERCS )
|
||||
@@ -1308,7 +1309,7 @@ void DisplayWayPoints(void)
|
||||
for ( bPoint = 1; bPoint <= pSoldier->aiData.bPatrolCnt; bPoint++ )
|
||||
{
|
||||
// Get the next point
|
||||
sGridNo = (INT16)pSoldier->aiData.sPatrolGrid[bPoint];
|
||||
sGridNo = pSoldier->aiData.sPatrolGrid[bPoint];
|
||||
|
||||
// Can we see it?
|
||||
if ( !GridNoOnVisibleWorldTile( sGridNo ) )
|
||||
@@ -1835,7 +1836,7 @@ void ExtractAndUpdateMercProfile()
|
||||
|
||||
//if the string is blank, returning -1, then set the value to NO_PROFILE
|
||||
//because ubProfile is unsigned.
|
||||
sNum = (INT16)min( GetNumericStrictValueFromField( 0 ), NUM_PROFILES );
|
||||
sNum = (INT16)min( GetNumericStrictValueFromField( 0 ), NUM_PROFILES-1 );//dnl ch54 101009
|
||||
if( sNum == -1 )
|
||||
{
|
||||
gpSelected->pDetailedPlacement->ubProfile = NO_PROFILE;
|
||||
@@ -2119,48 +2120,41 @@ void SetMercEditability( BOOLEAN fEditable )
|
||||
//points together. If one of the points is isolated, then the map will be rejected. It
|
||||
//isn't necessary to specify all four points. You wouldn't want to specify a north point if
|
||||
//there isn't going to be any traversing to adjacent maps from that side.
|
||||
void SpecifyEntryPoint( UINT32 iMapIndex )
|
||||
//dnl ch41 210909 undo is never implemented for entry points and deletion never work
|
||||
void SpecifyEntryPoint(INT32 iMapIndex)
|
||||
{
|
||||
INT16 *psEntryGridNo;
|
||||
BOOLEAN fErasing = FALSE;
|
||||
if( iDrawMode >= DRAW_MODE_ERASE )
|
||||
INT32 *psEntryGridNo;
|
||||
switch((iDrawMode>=DRAW_MODE_ERASE ? iDrawMode-DRAW_MODE_ERASE : iDrawMode))
|
||||
{
|
||||
iDrawMode -= DRAW_MODE_ERASE;
|
||||
fErasing = TRUE;
|
||||
case DRAW_MODE_NORTHPOINT:
|
||||
psEntryGridNo = &gMapInformation.sNorthGridNo;
|
||||
break;
|
||||
case DRAW_MODE_WESTPOINT:
|
||||
psEntryGridNo = &gMapInformation.sWestGridNo;
|
||||
break;
|
||||
case DRAW_MODE_EASTPOINT:
|
||||
psEntryGridNo = &gMapInformation.sEastGridNo;
|
||||
break;
|
||||
case DRAW_MODE_SOUTHPOINT:
|
||||
psEntryGridNo = &gMapInformation.sSouthGridNo;
|
||||
break;
|
||||
case DRAW_MODE_CENTERPOINT:
|
||||
psEntryGridNo = &gMapInformation.sCenterGridNo;
|
||||
break;
|
||||
case DRAW_MODE_ISOLATEDPOINT:
|
||||
psEntryGridNo = &gMapInformation.sIsolatedGridNo;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
switch( iDrawMode )
|
||||
if(iDrawMode >= DRAW_MODE_ERASE)
|
||||
{
|
||||
case DRAW_MODE_NORTHPOINT: psEntryGridNo = &gMapInformation.sNorthGridNo; break;
|
||||
case DRAW_MODE_WESTPOINT: psEntryGridNo = &gMapInformation.sWestGridNo; break;
|
||||
case DRAW_MODE_EASTPOINT: psEntryGridNo = &gMapInformation.sEastGridNo; break;
|
||||
case DRAW_MODE_SOUTHPOINT: psEntryGridNo = &gMapInformation.sSouthGridNo; break;
|
||||
case DRAW_MODE_CENTERPOINT: psEntryGridNo = &gMapInformation.sCenterGridNo; break;
|
||||
case DRAW_MODE_ISOLATEDPOINT: psEntryGridNo = &gMapInformation.sIsolatedGridNo; break;
|
||||
default: return;
|
||||
}
|
||||
if( !fErasing )
|
||||
{
|
||||
if( *psEntryGridNo >= 0 )
|
||||
{
|
||||
AddToUndoList( *psEntryGridNo );
|
||||
RemoveAllTopmostsOfTypeRange( *psEntryGridNo, FIRSTPOINTERS, FIRSTPOINTERS );
|
||||
}
|
||||
*psEntryGridNo = (INT16)iMapIndex;
|
||||
ValidateEntryPointGridNo( psEntryGridNo );
|
||||
AddToUndoList( *psEntryGridNo );
|
||||
AddTopmostToTail( *psEntryGridNo, FIRSTPOINTERS2 );
|
||||
*psEntryGridNo = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT16 usDummy;
|
||||
if( TypeExistsInTopmostLayer( iMapIndex, FIRSTPOINTERS, &usDummy ) )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
RemoveAllTopmostsOfTypeRange( iMapIndex, FIRSTPOINTERS, FIRSTPOINTERS );
|
||||
*psEntryGridNo = -1;
|
||||
}
|
||||
//restore the drawmode
|
||||
iDrawMode += DRAW_MODE_ERASE;
|
||||
*psEntryGridNo = iMapIndex;
|
||||
ValidateEntryPointGridNo(psEntryGridNo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2816,10 +2810,12 @@ void AddNewItemToSelectedMercsInventory( BOOLEAN fCreate )
|
||||
item = &Item[ gusMercsNewItemIndex ];
|
||||
uiVideoObjectIndex = GetInterfaceGraphicForItem( item );
|
||||
GetVideoObject( &hVObject, uiVideoObjectIndex );
|
||||
BltVideoObjectOutlineFromIndex( uiSrcID, uiVideoObjectIndex, item->ubGraphicNum, 0, 0, 0, FALSE );
|
||||
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : item->ubGraphicNum;
|
||||
BltVideoObjectOutlineFromIndex( uiSrcID, uiVideoObjectIndex, usGraphicNum, 0, 0, 0, FALSE );
|
||||
|
||||
//crop the source image
|
||||
pObject = &hVObject->pETRLEObject[ item->ubGraphicNum ];
|
||||
pObject = &hVObject->pETRLEObject[ usGraphicNum ];
|
||||
iSrcWidth = pObject->usWidth;
|
||||
iSrcHeight = pObject->usHeight;
|
||||
SrcRect.iLeft += pObject->sOffsetX;
|
||||
@@ -3045,10 +3041,13 @@ void SetEnemyColorCode( UINT8 ubColorCode )
|
||||
break;
|
||||
case SOLDIER_CLASS_MINER:
|
||||
//will probably never get called
|
||||
gpSelected->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_ELITE;
|
||||
|
||||
// WANNE: Fix a vanilla bug in the editor: When selecting a miner, he was turned into an elite soldier.
|
||||
// Fixed by Tron (Straciatella): Revision: 6650
|
||||
gpSelected->pBasicPlacement->ubSoldierClass = SOLDIER_CLASS_MINER;
|
||||
gubSoldierClass = SOLDIER_CLASS_MINER;
|
||||
if( gpSelected->pDetailedPlacement )
|
||||
gpSelected->pDetailedPlacement->ubSoldierClass = SOLDIER_CLASS_ELITE;
|
||||
gpSelected->pDetailedPlacement->ubSoldierClass = SOLDIER_CLASS_MINER;
|
||||
SET_PALETTEREP_ID( gpSelected->pSoldier->VestPal, "greyVEST" );
|
||||
SET_PALETTEREP_ID( gpSelected->pSoldier->PantsPal, "BEIGEPANTS" );
|
||||
break;
|
||||
@@ -3311,7 +3310,7 @@ void RegisterCurrentScheduleAction( INT32 iMapIndex )
|
||||
if( gfSingleAction )
|
||||
return;
|
||||
iDrawMode = DRAW_MODE_PLAYER + gpSelected->pBasicPlacement->bTeam;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = (INT16)iMapIndex;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = iMapIndex;
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_DATA1B + gubCurrentScheduleActionIndex ], str );
|
||||
DetermineScheduleEditability();
|
||||
gubScheduleInstructions = SCHEDULE_INSTRUCTIONS_NONE;
|
||||
@@ -3354,7 +3353,7 @@ void RegisterCurrentScheduleAction( INT32 iMapIndex )
|
||||
case SCHEDULE_ACTION_NONE:
|
||||
break;
|
||||
}
|
||||
gCurrSchedule.usData1[ gubCurrentScheduleActionIndex ] = (INT16)iMapIndex;
|
||||
gCurrSchedule.usData1[ gubCurrentScheduleActionIndex ] = iMapIndex;
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_DATA1A + gubCurrentScheduleActionIndex ], str );
|
||||
}
|
||||
}
|
||||
@@ -3368,8 +3367,8 @@ void StartScheduleAction()
|
||||
EnableTextFields( 1, 4 );
|
||||
gubScheduleInstructions = SCHEDULE_INSTRUCTIONS_NONE;
|
||||
gfRenderTaskbar = TRUE;
|
||||
gCurrSchedule.usData1[ gubCurrentScheduleActionIndex ] = 0xffff;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = 0xffff;
|
||||
gCurrSchedule.usData1[ gubCurrentScheduleActionIndex ] = 0xffffffff;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = 0xffffffff;
|
||||
break;
|
||||
case SCHEDULE_ACTION_LOCKDOOR:
|
||||
case SCHEDULE_ACTION_UNLOCKDOOR:
|
||||
@@ -3398,14 +3397,14 @@ void StartScheduleAction()
|
||||
iDrawMode = DRAW_MODE_SCHEDULEACTION;
|
||||
gubScheduleInstructions = SCHEDULE_INSTRUCTIONS_GRIDNO;
|
||||
gfRenderTaskbar = TRUE;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = 0xffff;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = 0xffffffff;
|
||||
break;
|
||||
case SCHEDULE_ACTION_LEAVESECTOR:
|
||||
case SCHEDULE_ACTION_STAYINSECTOR:
|
||||
gubScheduleInstructions = SCHEDULE_INSTRUCTIONS_NONE;
|
||||
gfRenderTaskbar = TRUE;
|
||||
gCurrSchedule.usData1[ gubCurrentScheduleActionIndex ] = 0xffff;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = 0xffff;
|
||||
gCurrSchedule.usData1[ gubCurrentScheduleActionIndex ] = 0xffffffff;
|
||||
gCurrSchedule.usData2[ gubCurrentScheduleActionIndex ] = 0xffffffff;
|
||||
break;
|
||||
}
|
||||
MarkWorldDirty();
|
||||
@@ -3425,7 +3424,7 @@ void UpdateScheduleAction( UINT8 ubNewAction )
|
||||
// 0:1A, 1:1B, 2:2A, 3:2B, ...
|
||||
void FindScheduleGridNo( UINT8 ubScheduleData )
|
||||
{
|
||||
INT32 iMapIndex;
|
||||
INT32 iMapIndex = 0xffffffff;
|
||||
switch( ubScheduleData )
|
||||
{
|
||||
case 0: //1a
|
||||
@@ -3455,7 +3454,7 @@ void FindScheduleGridNo( UINT8 ubScheduleData )
|
||||
default:
|
||||
AssertMsg( 0, "FindScheduleGridNo passed incorrect dataID." );
|
||||
}
|
||||
if( iMapIndex != 0xffff )
|
||||
if( iMapIndex != 0xffffffff )
|
||||
{
|
||||
CenterScreenAtMapIndex( iMapIndex );
|
||||
}
|
||||
@@ -3471,9 +3470,9 @@ void ClearCurrentSchedule()
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_ACTION1 + i ], L"No action" );
|
||||
gCurrSchedule.usTime[i] = 0xffff;
|
||||
SetExclusive24HourTimeValue( (UINT8)(i+1), gCurrSchedule.usTime[ i ] ); //blanks the field
|
||||
gCurrSchedule.usData1[i] = 0xffff;
|
||||
gCurrSchedule.usData1[i] = 0xffffffff;
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_DATA1A + i ], L"" );
|
||||
gCurrSchedule.usData2[i] = 0xffff;
|
||||
gCurrSchedule.usData2[i] = 0xffffffff;
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_DATA1B + i ], L"" );
|
||||
}
|
||||
//Remove the variance stuff
|
||||
@@ -3507,7 +3506,7 @@ void RenderCurrentSchedule()
|
||||
continue;
|
||||
|
||||
// Convert it's location to screen coordinates
|
||||
ConvertGridNoToXY( (INT16)iMapIndex, &sXMapPos, &sYMapPos );
|
||||
ConvertGridNoToXY( iMapIndex, &sXMapPos, &sYMapPos );
|
||||
|
||||
dOffsetX = (FLOAT)(sXMapPos * CELL_X_SIZE) - gsRenderCenterX;
|
||||
dOffsetY = (FLOAT)(sYMapPos * CELL_Y_SIZE) - gsRenderCenterY;
|
||||
@@ -3552,11 +3551,11 @@ void UpdateScheduleInfo()
|
||||
MSYS_SetBtnUserData( iEditorButton[ MERCS_SCHEDULE_ACTION1 + i ], 0, pSchedule->ubAction[i] );
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_ACTION1 + i ], gszScheduleActions[ pSchedule->ubAction[i] ] );
|
||||
swprintf( str, L"" );
|
||||
if( pSchedule->usData1[i] != 0xffff )
|
||||
if( pSchedule->usData1[i] != 0xffffffff )
|
||||
swprintf( str, L"%d", pSchedule->usData1[i] );
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_DATA1A + i ], str );
|
||||
swprintf( str, L"" );
|
||||
if( pSchedule->usData2[i] != 0xffff )
|
||||
if( pSchedule->usData2[i] != 0xffffffff )
|
||||
swprintf( str, L"%d", pSchedule->usData2[i] );
|
||||
SpecifyButtonText( iEditorButton[ MERCS_SCHEDULE_DATA1B + i ], str );
|
||||
if( gubCurrMercMode == MERC_SCHEDULEMODE )
|
||||
@@ -3658,7 +3657,7 @@ void PasteMercPlacement( INT32 iMapIndex )
|
||||
|
||||
//Set up some general information.
|
||||
//gTempBasicPlacement.fDetailedPlacement = TRUE;
|
||||
gTempBasicPlacement.sStartingGridNo = (INT16)iMapIndex;
|
||||
gTempBasicPlacement.usStartingGridNo = iMapIndex;
|
||||
|
||||
//Generate detailed placement information given the temp placement information.
|
||||
if( gTempBasicPlacement.fDetailedPlacement )
|
||||
|
||||
@@ -52,7 +52,7 @@ extern UINT8 gubCurrMercMode, gubPrevMercMode;
|
||||
extern STR16 zDiffNames[NUM_DIFF_LVLS];
|
||||
extern INT16 sCurBaseDiff;
|
||||
extern INT16 gsSelectedMercID;
|
||||
extern INT16 gsSelectedMercGridNo;
|
||||
extern INT32 gsSelectedMercGridNo;
|
||||
extern UINT8 gubCurrMercMode;
|
||||
|
||||
enum _ForUseWithIndicateSelectedMerc
|
||||
@@ -82,11 +82,11 @@ void SetMercEditingMode( UINT8 ubNewMode );
|
||||
void ResetAllMercPositions();
|
||||
|
||||
void EraseMercWaypoint();
|
||||
void AddMercWaypoint( UINT32 iMapIndex );
|
||||
void AddMercWaypoint( INT32 iMapIndex );
|
||||
|
||||
void SetEnemyColorCode( UINT8 ubColorCode );
|
||||
|
||||
void SpecifyEntryPoint( UINT32 iMapIndex );
|
||||
void SpecifyEntryPoint(INT32 iMapIndex);//dnl ch41 290909
|
||||
|
||||
//Modify stats of current soldiers
|
||||
void SetMercOrders( INT8 bOrders );
|
||||
|
||||
@@ -231,7 +231,7 @@ void Fill( INT32 x, INT32 y )
|
||||
maxCount = Count;
|
||||
|
||||
iMapIndex = y * WORLD_COLS + x;
|
||||
if( !GridNoOnVisibleWorldTile( (INT16)iMapIndex ) )
|
||||
if( !GridNoOnVisibleWorldTile( iMapIndex ) )
|
||||
{
|
||||
Count--;
|
||||
return;
|
||||
@@ -266,7 +266,7 @@ void Fill( INT32 x, INT32 y )
|
||||
}
|
||||
|
||||
|
||||
void TerrainFill( UINT32 iMapIndex )
|
||||
void TerrainFill( INT32 iMapIndex )
|
||||
{
|
||||
INT16 sX, sY;
|
||||
//determine what we should be looking for to replace...
|
||||
@@ -276,7 +276,7 @@ void TerrainFill( UINT32 iMapIndex )
|
||||
if( guiSearchType == CurrentPaste )
|
||||
return;
|
||||
|
||||
ConvertGridNoToXY( (INT16)iMapIndex, &sX, &sY );
|
||||
ConvertGridNoToXY( iMapIndex, &sX, &sY );
|
||||
|
||||
Count = 0;
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ void HideTerrainTileButtons();
|
||||
|
||||
void ChooseWeightedTerrainTile();
|
||||
|
||||
void TerrainFill( UINT32 iMapIndex );
|
||||
void TerrainFill( INT32 iMapIndex );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -267,6 +267,68 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_WithDebugInfo|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_2005Express.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
@@ -268,6 +268,70 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_WithDebugInfo|Win32"
|
||||
OutputDirectory="..\lib\VS2008\$(ConfigurationName)"
|
||||
IntermediateDirectory="..\build\VS2008\$(ProjectName)_$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_VS2008.vsprops"
|
||||
CharacterSet="0"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
@@ -178,7 +178,7 @@ INT8 gbEditingMode = EDITING_NOTHING;
|
||||
|
||||
OBJECTTYPE *gpItem = NULL;
|
||||
BOOLEAN gfShowItemStatsPanel;
|
||||
INT16 gsItemGridNo;
|
||||
INT32 gsItemGridNo;
|
||||
|
||||
ITEM_POOL *gpEditingItemPool = NULL;
|
||||
extern ITEM_POOL *gpItemPool;
|
||||
@@ -355,7 +355,7 @@ void SpecifyItemToEdit( OBJECTTYPE *pItem, INT32 iMapIndex )
|
||||
{
|
||||
gpEditingItemPool = gpItemPool;
|
||||
}
|
||||
gsItemGridNo = (INT16)iMapIndex;
|
||||
gsItemGridNo = iMapIndex;
|
||||
}
|
||||
else
|
||||
RemoveItemGUI();
|
||||
|
||||
@@ -43,7 +43,7 @@ enum
|
||||
void ExecuteItemStatsCmd( UINT8 ubAction );
|
||||
|
||||
extern OBJECTTYPE *gpItem;
|
||||
extern INT16 gsItemGridNo;
|
||||
extern INT32 gsItemGridNo;
|
||||
|
||||
//enumerations for all of the different action items. Used by the popup menu for
|
||||
//changing the type of action item. When modified, an equivalent text array must be
|
||||
|
||||
+249
-137
@@ -43,6 +43,7 @@
|
||||
#include "Item Statistics.h"
|
||||
#include "Scheduling.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "VFS/vfs.h"//dnl ch37 110909
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
@@ -77,7 +78,8 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult();
|
||||
BOOLEAN RemoveFromFDlgList( FDLG_LIST **head, FDLG_LIST *node );
|
||||
|
||||
void DrawFileDialog();
|
||||
void HandleMainKeyEvents( InputAtom *pEvent );
|
||||
void HandleMainKeyEvents( InputAtom *pEvent );
|
||||
void HandleMouseWheelEvents(void);//dnl ch36 150909
|
||||
void SetTopFileToLetter( UINT16 usLetter );
|
||||
|
||||
INT32 iTotalFiles;
|
||||
@@ -86,7 +88,7 @@ INT32 iCurrFileShown;
|
||||
INT32 iLastFileClicked;
|
||||
INT32 iLastClickTime;
|
||||
|
||||
CHAR16 gzFilename[31];
|
||||
CHAR16 gzFilename[FILENAME_BUFLEN];//dnl ch39 190909
|
||||
extern INT16 gsSelSectorX;
|
||||
extern INT16 gsSelSectorY;
|
||||
|
||||
@@ -102,6 +104,7 @@ BOOLEAN gfFileExists;
|
||||
BOOLEAN gfIllegalName;
|
||||
BOOLEAN gfDeleteFile;
|
||||
BOOLEAN gfNoFiles;
|
||||
BOOLEAN gfSaveError;//dnl ch37 200909
|
||||
|
||||
CHAR16 zOrigName[60];
|
||||
GETFILESTRUCT FileInfo;
|
||||
@@ -148,6 +151,7 @@ void LoadSaveScreenEntry()
|
||||
gfIllegalName = FALSE;
|
||||
gfDeleteFile = FALSE;
|
||||
gfNoFiles = FALSE;
|
||||
gfSaveError = FALSE;//dnl ch37 200909
|
||||
|
||||
// setup filename dialog box
|
||||
// (*.dat and *.map) as file filter
|
||||
@@ -155,22 +159,86 @@ void LoadSaveScreenEntry()
|
||||
// If user clicks on a filename in the window, then turn off string focus and re-init the string with the new name.
|
||||
// If user hits ENTER or presses OK, then continue with the file loading/saving
|
||||
|
||||
if( FileList )
|
||||
TrashFDlgList( FileList );
|
||||
if(FileList)
|
||||
{
|
||||
TrashFDlgList(FileList);
|
||||
FileList = NULL;
|
||||
}
|
||||
|
||||
iTopFileShown = iTotalFiles = 0;
|
||||
if( GetFileFirst("MAPS\\*.dat", &FileInfo) )
|
||||
#ifdef USE_VFS//dnl ch37 300909
|
||||
FDLG_LIST* TempFileList = NULL;
|
||||
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
||||
vfs::CProfileStack::Iterator it = st->begin();
|
||||
while(!it.end())
|
||||
{
|
||||
FileList = AddToFDlgList( FileList, &FileInfo );
|
||||
iTotalFiles++;
|
||||
while( GetFileNext(&FileInfo) )
|
||||
TempFileList = NULL;
|
||||
vfs::CVirtualProfile* prof = it.value();
|
||||
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
||||
strcpy(FileInfo.zFileName, "< ");
|
||||
strcat(FileInfo.zFileName, prof->cName.utf8().c_str());
|
||||
strcat(FileInfo.zFileName, " >");
|
||||
FileInfo.zFileName[FILENAME_BUFLEN] = 0;
|
||||
FileInfo.uiFileAttribs = FILE_IS_DIRECTORY;
|
||||
if(iCurrentAction == ACTION_SAVE_MAP && prof->cWritable == false)
|
||||
{
|
||||
FileList = AddToFDlgList( FileList, &FileInfo );
|
||||
it.next();
|
||||
continue;
|
||||
}
|
||||
TempFileList = AddToFDlgList(TempFileList, &FileInfo);
|
||||
iTotalFiles++;
|
||||
vfs::CVirtualProfile::FileIterator fit = prof->files(L"MAPS/*");
|
||||
while(!fit.end())
|
||||
{
|
||||
utf8string fname = fit.value()->getName().c_str();
|
||||
memset(&FileInfo, 0, sizeof(GETFILESTRUCT));
|
||||
strcpy(FileInfo.zFileName, fname.utf8().c_str());
|
||||
FileInfo.uiFileSize = fname.length();
|
||||
FileInfo.uiFileAttribs = (fit.value()->implementsWritable() ? FILE_IS_NORMAL : FILE_IS_READONLY);
|
||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
||||
{
|
||||
TempFileList = AddToFDlgList(TempFileList, &FileInfo);
|
||||
iTotalFiles++;
|
||||
}
|
||||
fit.next();
|
||||
}
|
||||
if(TempFileList)
|
||||
{
|
||||
while(TempFileList->pPrev)
|
||||
TempFileList = TempFileList->pPrev;
|
||||
if(FileList)
|
||||
{
|
||||
while(FileList->pNext)
|
||||
FileList = FileList->pNext;
|
||||
FileList->pNext = TempFileList;
|
||||
TempFileList->pPrev = FileList;
|
||||
}
|
||||
else
|
||||
FileList = TempFileList;
|
||||
}
|
||||
it.next();
|
||||
}
|
||||
while(FileList->pPrev)
|
||||
FileList = FileList->pPrev;
|
||||
#else
|
||||
if(GetFileFirst("MAPS\\*.dat", &FileInfo))
|
||||
{
|
||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
||||
{
|
||||
FileList = AddToFDlgList(FileList, &FileInfo);
|
||||
iTotalFiles++;
|
||||
}
|
||||
while(GetFileNext(&FileInfo))
|
||||
{
|
||||
if(strlen(FileInfo.zFileName) < FILENAME_BUFLEN)
|
||||
{
|
||||
FileList = AddToFDlgList(FileList, &FileInfo);
|
||||
iTotalFiles++;
|
||||
}
|
||||
}
|
||||
GetFileClose(&FileInfo);
|
||||
}
|
||||
|
||||
#endif
|
||||
swprintf( zOrigName, L"%s Map (*.dat)", iCurrentAction == ACTION_SAVE_MAP ? L"Save" : L"Load" );
|
||||
|
||||
swprintf( gzFilename, L"%S", gubFilename );
|
||||
@@ -260,10 +328,12 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult()
|
||||
iFDlgState = DIALOG_NONE;
|
||||
return LOADSAVE_SCREEN;
|
||||
}
|
||||
if( gfLoadError )
|
||||
if(gfLoadError || gfSaveError)//dnl ch37 200909
|
||||
{
|
||||
MarkWorldDirty();
|
||||
RenderWorld();
|
||||
fEnteringLoadSaveScreen = TRUE;
|
||||
return gfMessageBoxResult ? LOADSAVE_SCREEN : EDIT_SCREEN;
|
||||
return(gfMessageBoxResult ? LOADSAVE_SCREEN : EDIT_SCREEN);
|
||||
}
|
||||
if( gfReadOnly )
|
||||
{ //file is readonly. Result will determine if the file dialog stays up.
|
||||
@@ -281,7 +351,7 @@ UINT32 ProcessLoadSaveScreenMessageBoxResult()
|
||||
}
|
||||
fEnteringLoadSaveScreen = TRUE;
|
||||
RemoveFileDialog();
|
||||
return EDIT_SCREEN ;
|
||||
return(LOADSAVE_SCREEN);//dnl ch36 210909
|
||||
}
|
||||
// Assert( 0 );
|
||||
return LOADSAVE_SCREEN;
|
||||
@@ -313,16 +383,18 @@ UINT32 LoadSaveScreenHandle(void)
|
||||
return ProcessLoadSaveScreenMessageBoxResult();
|
||||
return LOADSAVE_SCREEN;
|
||||
}
|
||||
|
||||
|
||||
//handle all key input.
|
||||
while( DequeueEvent(&DialogEvent) )
|
||||
{
|
||||
if( !HandleTextInput(&DialogEvent) && (DialogEvent.usEvent == KEY_DOWN || DialogEvent.usEvent == KEY_REPEAT) )
|
||||
{
|
||||
{
|
||||
HandleMainKeyEvents( &DialogEvent );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HandleMouseWheelEvents();//dnl ch36 150909
|
||||
|
||||
DrawFileDialog();
|
||||
|
||||
// Skip to first filename to show
|
||||
@@ -385,34 +457,66 @@ UINT32 LoadSaveScreenHandle(void)
|
||||
CreateMessageBox( str );
|
||||
}
|
||||
return LOADSAVE_SCREEN;
|
||||
case DIALOG_SAVE:
|
||||
if( !ExtractFilenameFromFields() )
|
||||
case DIALOG_SAVE://dnl ch37 230909
|
||||
{
|
||||
if(!ExtractFilenameFromFields())
|
||||
{
|
||||
CreateMessageBox( L" Illegal filename. Try another filename? " );
|
||||
CreateMessageBox(L" Illegal filename. Try another filename? ");
|
||||
gfIllegalName = TRUE;
|
||||
iFDlgState = DIALOG_NONE;
|
||||
return LOADSAVE_SCREEN;
|
||||
return(LOADSAVE_SCREEN);
|
||||
}
|
||||
sprintf( gszCurrFilename, "MAPS\\%S", gzFilename );
|
||||
if ( FileExists( gszCurrFilename ) )
|
||||
sprintf(gszCurrFilename, "MAPS\\%S", gzFilename);
|
||||
gfFileExists = FALSE;
|
||||
#ifndef USE_VFS
|
||||
gfReadOnly = FALSE;
|
||||
if(FileExists(gszCurrFilename))
|
||||
{
|
||||
gfFileExists = TRUE;
|
||||
gfReadOnly = FALSE;
|
||||
if( GetFileFirst(gszCurrFilename, &FileInfo) )
|
||||
if(GetFileFirst(gszCurrFilename, &FileInfo))
|
||||
{
|
||||
if( FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY) )
|
||||
if(FileInfo.uiFileAttribs & (FILE_IS_READONLY|FILE_IS_DIRECTORY|FILE_IS_HIDDEN|FILE_IS_SYSTEM|FILE_IS_OFFLINE|FILE_IS_TEMPORARY))
|
||||
gfReadOnly = TRUE;
|
||||
GetFileClose(&FileInfo);
|
||||
}
|
||||
if( gfReadOnly )
|
||||
CreateMessageBox( L" File is read only! Choose a different name? " );
|
||||
else
|
||||
CreateMessageBox( L" File exists, Overwrite? " );
|
||||
return( LOADSAVE_SCREEN );
|
||||
}
|
||||
}
|
||||
#else
|
||||
gfReadOnly = TRUE;
|
||||
vfs::CProfileStack* st = getVFS()->getProfileStack();
|
||||
vfs::CProfileStack::Iterator it = st->begin();
|
||||
while(!it.end())
|
||||
{
|
||||
vfs::CVirtualProfile* prof = it.value();
|
||||
if(prof->cWritable == true)
|
||||
{
|
||||
gfReadOnly = FALSE;
|
||||
vfs::Path const& path = gszCurrFilename;
|
||||
vfs::IBaseFile *file = prof->getFile(path);
|
||||
if(file)
|
||||
{
|
||||
gfFileExists = TRUE;
|
||||
if(file->implementsWritable() == false)
|
||||
gfReadOnly = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
it.next();
|
||||
}
|
||||
#endif
|
||||
if(gfReadOnly)
|
||||
{
|
||||
CreateMessageBox(L" File is read only! Choose a different name? ");
|
||||
return( LOADSAVE_SCREEN);
|
||||
}
|
||||
else if(gfFileExists)
|
||||
{
|
||||
CreateMessageBox(L" File exists, Overwrite? ");
|
||||
return(LOADSAVE_SCREEN);
|
||||
}
|
||||
RemoveFileDialog();
|
||||
gbCurrentFileIOStatus = INITIATE_MAP_SAVE;
|
||||
return LOADSAVE_SCREEN ;
|
||||
return(LOADSAVE_SCREEN);
|
||||
}
|
||||
case DIALOG_LOAD:
|
||||
if( !ExtractFilenameFromFields() )
|
||||
{
|
||||
@@ -451,14 +555,11 @@ void CreateFileDialog( STR16 zTitle )
|
||||
iFileDlgButtons[1] = CreateTextButton( L"Cancel", FONT12POINT1, FONT_BLACK, FONT_BLACK,
|
||||
BUTTON_USE_DEFAULT, iScreenWidthOffset + 406, iScreenHeightOffset + 225, 50, 30, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgCancelCallback );
|
||||
|
||||
//Scroll buttons
|
||||
iFileDlgButtons[2] = CreateSimpleButton( iScreenWidthOffset + 426, iScreenHeightOffset + 92,"EDITOR//uparrow.sti", BUTTON_NO_TOGGLE,
|
||||
MSYS_PRIORITY_HIGH, FDlgUpCallback );
|
||||
iFileDlgButtons[3] = CreateSimpleButton( iScreenWidthOffset + 426, iScreenHeightOffset + 182,"EDITOR//downarrow.sti", BUTTON_NO_TOGGLE,
|
||||
MSYS_PRIORITY_HIGH, FDlgDwnCallback );
|
||||
//dnl ch36 150909 Scroll buttons
|
||||
iFileDlgButtons[2] = CreateSimpleButton(iScreenWidthOffset+426, iScreenHeightOffset+92-19, "EDITOR//uparrow.sti", BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, FDlgUpCallback);
|
||||
iFileDlgButtons[3] = CreateSimpleButton(iScreenWidthOffset+426, iScreenHeightOffset+182-19, "EDITOR//downarrow.sti", BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, FDlgDwnCallback);
|
||||
|
||||
//File list window
|
||||
|
||||
iFileDlgButtons[4] = CreateHotSpot( (iScreenWidthOffset + 179+4), (iScreenHeightOffset + 69+3), (179+4+240), (69+120+3), MSYS_PRIORITY_HIGH-1, BUTTON_NO_CALLBACK, FDlgNamesCallback);
|
||||
//Title button
|
||||
iFileDlgButtons[5] = CreateTextButton(zTitle, HUGEFONT, FONT_LTKHAKI, FONT_DKKHAKI,
|
||||
@@ -478,8 +579,8 @@ void CreateFileDialog( STR16 zTitle )
|
||||
|
||||
//Add the text input fields
|
||||
InitTextInputModeWithScheme( DEFAULT_SCHEME );
|
||||
//field 1 (filename)
|
||||
AddTextInputField( /*233*/iScreenWidthOffset + 183, iScreenHeightOffset + 195, 190, 20, MSYS_PRIORITY_HIGH, gzFilename, 30, INPUTTYPE_EXCLUSIVE_DOSFILENAME );
|
||||
//dnl ch36 150909 field 1 (filename)
|
||||
AddTextInputField(iScreenWidthOffset+183, iScreenHeightOffset+195, 240, 20, MSYS_PRIORITY_HIGH, gzFilename, (FILENAME_BUFLEN-1), INPUTTYPE_EXCLUSIVE_DOSFILENAME);
|
||||
//field 2 -- user field that allows mouse/key interaction with the filename list
|
||||
AddUserInputField( FileDialogModeCallback );
|
||||
|
||||
@@ -537,6 +638,7 @@ void RemoveFileDialog(void)
|
||||
}
|
||||
|
||||
TrashFDlgList( FileList );
|
||||
|
||||
FileList = NULL;
|
||||
|
||||
InvalidateScreen( );
|
||||
@@ -550,13 +652,13 @@ void RemoveFileDialog(void)
|
||||
|
||||
void DrawFileDialog(void)
|
||||
{
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset + 179, iScreenHeightOffset + 69, (iScreenWidthOffset + 179+281), iScreenHeightOffset + 261, Get16BPPColor(FROMRGB(136, 138, 135)) );
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset + 180, 70, (iScreenWidthOffset + 179+281), iScreenHeightOffset + 261, Get16BPPColor(FROMRGB(24, 61, 81)) );
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset + 180, 70, (iScreenWidthOffset + 179+280), iScreenHeightOffset + 260, Get16BPPColor(FROMRGB(65, 79, 94)) );
|
||||
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, (iScreenWidthOffset + 179+4), (iScreenHeightOffset + 69+3), (iScreenWidthOffset + 179+4+240), (iScreenHeightOffset + 69+123), Get16BPPColor(FROMRGB(24, 61, 81)) );
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, (iScreenWidthOffset + 179+5), (iScreenHeightOffset + 69+4), (iScreenWidthOffset + 179+4+240), (iScreenHeightOffset + 69+123), Get16BPPColor(FROMRGB(136, 138, 135)) );
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, (iScreenWidthOffset + 179+5), (iScreenHeightOffset + 69+4), (iScreenWidthOffset + 179+3+240), (iScreenHeightOffset + 69+122), Get16BPPColor(FROMRGB(250, 240, 188)) );
|
||||
//dnl ch36 150909
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179, iScreenHeightOffset+69, iScreenWidthOffset+179+281, iScreenHeightOffset+261, Get16BPPColor(FROMRGB(136, 138, 135)));
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+180, iScreenHeightOffset+70, iScreenWidthOffset+179+281, iScreenHeightOffset+261, Get16BPPColor(FROMRGB(24, 61, 81)));
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+180, iScreenHeightOffset+70, iScreenWidthOffset+179+280, iScreenHeightOffset+260, Get16BPPColor(FROMRGB(65, 79, 94)));
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179+4, iScreenHeightOffset+69+3, iScreenWidthOffset+179+4+240, iScreenHeightOffset+69+123, Get16BPPColor(FROMRGB(24, 61, 81)));
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179+5, iScreenHeightOffset+69+4, iScreenWidthOffset+179+4+240, iScreenHeightOffset+69+123, Get16BPPColor(FROMRGB(136, 138, 135)));
|
||||
ColorFillVideoSurfaceArea(FRAME_BUFFER, iScreenWidthOffset+179+5, iScreenHeightOffset+69+4, iScreenWidthOffset+179+3+240, iScreenHeightOffset+69+122, Get16BPPColor(FROMRGB(250, 240, 188)));
|
||||
|
||||
MarkButtonsDirty();
|
||||
RenderButtons();
|
||||
@@ -687,6 +789,13 @@ void TrashFDlgList(FDLG_LIST *pList)
|
||||
{
|
||||
FDLG_LIST *pNode;
|
||||
|
||||
while(pList)//dnl ch49 061009 Rewind, just to be sure
|
||||
{
|
||||
if(pList->pPrev)
|
||||
pList = pList->pPrev;
|
||||
else
|
||||
break;
|
||||
}
|
||||
while(pList != NULL)
|
||||
{
|
||||
pNode = pList;
|
||||
@@ -821,36 +930,25 @@ void HandleMainKeyEvents( InputAtom *pEvent )
|
||||
}
|
||||
}
|
||||
|
||||
//editor doesn't care about the z value. It uses it's own methods.
|
||||
void SetGlobalSectorValues( STR16 szFilename )
|
||||
void HandleMouseWheelEvents(void)//dnl ch36 150909
|
||||
{
|
||||
STR16 pStr;
|
||||
if( ValidCoordinate() )
|
||||
if(_WheelValue > 0)
|
||||
{
|
||||
//convert the coordinate string into into the actual global sector coordinates.
|
||||
if( gzFilename[0] >= 'A' && gzFilename[0] <= 'P' )
|
||||
gWorldSectorY = gzFilename[0] - 'A' + 1;
|
||||
else
|
||||
gWorldSectorY = gzFilename[0] - 'a' + 1;
|
||||
if( gzFilename[1] == '1' && gzFilename[2] >= '0' && gzFilename[2] <= '6' )
|
||||
gWorldSectorX = ( gzFilename[1] - 0x30 ) * 10 + ( gzFilename[2] - 0x30 );
|
||||
else
|
||||
gWorldSectorX = ( gzFilename[1] - 0x30 );
|
||||
pStr = wcsstr( gzFilename, L"_b" );
|
||||
if( pStr )
|
||||
while(_WheelValue--)
|
||||
{
|
||||
if( pStr[ 2 ] >= '1' && pStr[ 2 ] <= '3' )
|
||||
{
|
||||
gbWorldSectorZ = (INT8)(pStr[ 2 ] - 0x30);
|
||||
}
|
||||
if(iTopFileShown > 0)
|
||||
iTopFileShown--;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(_WheelValue < 0)
|
||||
{
|
||||
gWorldSectorX = -1;
|
||||
gWorldSectorY = -1;
|
||||
gbWorldSectorZ = 0;
|
||||
while(_WheelValue++)
|
||||
{
|
||||
if((iTopFileShown+7) < iTotalFiles)
|
||||
iTopFileShown++;
|
||||
}
|
||||
}
|
||||
_WheelValue = 0;
|
||||
}
|
||||
|
||||
void InitErrorCatchDialog()
|
||||
@@ -873,6 +971,7 @@ UINT32 ProcessFileIO()
|
||||
{
|
||||
INT16 usStartX, usStartY;
|
||||
CHAR8 ubNewFilename[50];
|
||||
BOOLEAN fAltMap;//dnl ch31 150909
|
||||
switch( gbCurrentFileIOStatus )
|
||||
{
|
||||
case INITIATE_MAP_SAVE: //draw save message
|
||||
@@ -897,23 +996,34 @@ UINT32 ProcessFileIO()
|
||||
if( gfShowPits )
|
||||
RemoveAllPits();
|
||||
OptimizeSchedules();
|
||||
if ( !SaveWorld( ubNewFilename ) )
|
||||
ShowHighGround(4);//dnl ch41 210909
|
||||
//dnl ch33 091009
|
||||
BOOLEAN fRet;
|
||||
if(gfVanillaMode && iNewMapWorldRows == OLD_WORLD_ROWS && iNewMapWorldCols == OLD_WORLD_COLS)
|
||||
fRet = SaveWorld(ubNewFilename, VANILLA_MAJOR_MAP_VERSION, VANILLA_MINOR_MAP_VERSION);
|
||||
else
|
||||
fRet = SaveWorld(ubNewFilename);
|
||||
if(!fRet)
|
||||
{
|
||||
if( gfErrorCatch )
|
||||
//dnl ch37 150909
|
||||
gfSaveError = TRUE;
|
||||
if(gfErrorCatch)
|
||||
{
|
||||
InitErrorCatchDialog();
|
||||
return EDIT_SCREEN;
|
||||
return(EDIT_SCREEN);
|
||||
}
|
||||
return ERROR_SCREEN;
|
||||
gbCurrentFileIOStatus = IOSTATUS_NONE;
|
||||
utf8string msg = utf8string(" Error saving ") + ubNewFilename + utf8string(" file. Try another filename? ");
|
||||
CreateMessageBox((STR16)msg.c_wcs().c_str());
|
||||
return(guiCurrentScreen);
|
||||
}
|
||||
if( gfShowPits )
|
||||
AddAllPits();
|
||||
|
||||
SetGlobalSectorValues( gzFilename );
|
||||
|
||||
GetSectorFromFileName(gzFilename, gWorldSectorX, gWorldSectorY, gbWorldSectorZ, fAltMap);//dnl ch31 140909
|
||||
if( gfGlobalSummaryExists )
|
||||
UpdateSectorSummary( gzFilename, gfUpdateSummaryInfo );
|
||||
|
||||
else//dnl ch30 150909
|
||||
ReEvaluateWorld(ubNewFilename);
|
||||
iCurrentAction = ACTION_NULL;
|
||||
gbCurrentFileIOStatus = IOSTATUS_NONE;
|
||||
gfRenderWorld = TRUE;
|
||||
@@ -925,8 +1035,6 @@ UINT32 ProcessFileIO()
|
||||
InitErrorCatchDialog();
|
||||
return EDIT_SCREEN;
|
||||
}
|
||||
if( gMapInformation.ubMapVersion != gubMinorMapVersion )
|
||||
ScreenMsg( FONT_MCOLOR_RED, MSG_ERROR, L"Map data has just been corrupted!!! What did you just do? KM : 0" );
|
||||
return EDIT_SCREEN;
|
||||
case INITIATE_MAP_LOAD: //draw load message
|
||||
SaveFontSettings();
|
||||
@@ -941,22 +1049,20 @@ UINT32 ProcessFileIO()
|
||||
|
||||
RemoveMercsInSector( );
|
||||
|
||||
//CHRISL: What happens if we EvaluateWorld at this point?
|
||||
if( !ReEvaluateWorld( ubNewFilename ) || !LoadWorld( ubNewFilename ) )
|
||||
{ //Want to override crash, so user can do something else.
|
||||
// Want to override crash, so user can do something else.
|
||||
if(!ReEvaluateWorld(ubNewFilename) || !LoadWorld(ubNewFilename))//dnl ch36 140909
|
||||
{
|
||||
EnableUndo();
|
||||
SetPendingNewScreen( LOADSAVE_SCREEN );
|
||||
gbCurrentFileIOStatus = IOSTATUS_NONE;
|
||||
gfGlobalError = FALSE;
|
||||
gfLoadError = TRUE;
|
||||
//RemoveButton( iTempButton );
|
||||
CreateMessageBox( L" Error loading file. Try another filename?" );
|
||||
return LOADSAVE_SCREEN;
|
||||
utf8string msg = utf8string(" Error loading ") + ubNewFilename + utf8string(" file. Try another filename? ");
|
||||
CreateMessageBox((STR16)msg.c_wcs().c_str());
|
||||
return(guiCurrentScreen);
|
||||
}
|
||||
//ADB these are NOT set yet! but they need to be, duh
|
||||
CompileWorldMovementCosts();
|
||||
SetGlobalSectorValues( gzFilename );
|
||||
|
||||
GetSectorFromFileName(gzFilename, gWorldSectorX, gWorldSectorY, gbWorldSectorZ, fAltMap);//dnl ch31 140909
|
||||
RestoreFontSettings();
|
||||
|
||||
//Load successful, update necessary information.
|
||||
@@ -1003,6 +1109,11 @@ UINT32 ProcessFileIO()
|
||||
SetMercTeamVisibility( MILITIA_TEAM, gfShowRebels );
|
||||
SetMercTeamVisibility( CIV_TEAM, gfShowCivilians );
|
||||
BuildItemPoolList();
|
||||
gpItemPool = NULL;//dnl ch26 210909
|
||||
fShowHighGround = FALSE;//dnl ch2 210909
|
||||
fRaiseWorld = FALSE;//dnl ch3 210909
|
||||
ShowHighGround(4);//dnl ch41 210909
|
||||
SetRenderCenter(WORLD_COLS/2, WORLD_ROWS/2);//dnl ch43 280909
|
||||
if( gfShowPits )
|
||||
AddAllPits();
|
||||
|
||||
@@ -1066,72 +1177,73 @@ void FDlgDwnCallback( GUI_BUTTON *butn, INT32 reason )
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN ExtractFilenameFromFields()
|
||||
//dnl ch36 200909
|
||||
BOOLEAN ExtractFilenameFromFields(void)
|
||||
{
|
||||
Get16BitStringFromField( 0, gzFilename, 31 );
|
||||
return ValidFilename();
|
||||
Get16BitStringFromField(0, gzFilename, FILENAME_BUFLEN);
|
||||
size_t len = wcslen(gzFilename);
|
||||
if(gzFilename[len-4] != L'.' && len < (FILENAME_BUFLEN-4))
|
||||
wcscat(gzFilename, L".dat");
|
||||
return(ValidFilename());
|
||||
}
|
||||
|
||||
BOOLEAN ValidCoordinate()
|
||||
//dnl ch31 140909
|
||||
BOOLEAN ValidMapFileName(STR16 szFileName)
|
||||
{
|
||||
CHAR16 sectorY = 0;
|
||||
UINT16 sectorX = 0;
|
||||
swscanf( gzFilename, L"%c%2hd", §orY, §orX);
|
||||
|
||||
sectorY = towupper( sectorY);
|
||||
return ( sectorY >= 'A' && sectorY <= 'P' &&
|
||||
sectorX >= 1 && sectorX <= 16);
|
||||
}
|
||||
|
||||
BOOLEAN ValidFilename()
|
||||
{
|
||||
STR16 pDest;
|
||||
if( gzFilename[0] != '\0' )// ; <----- I really think they didn't mean this!! (jonathanl)
|
||||
CHAR16 szFileExt[4+1];
|
||||
size_t len = wcslen(szFileName);
|
||||
if(len >= 5)
|
||||
{
|
||||
pDest = wcsstr( gzFilename, L".dat" );
|
||||
if( !pDest )
|
||||
pDest = wcsstr( gzFilename, L".DAT" );
|
||||
if( pDest && pDest != gzFilename && pDest[4] == '\0' )
|
||||
return TRUE;
|
||||
wcscpy(szFileExt, szFileName+len-4);
|
||||
for(int i=0; i<4; i++)
|
||||
szFileExt[i] = towupper(szFileExt[i]);
|
||||
if(wcscmp(szFileExt, L".DAT") == 0)
|
||||
return(TRUE);
|
||||
}
|
||||
return FALSE;
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
BOOLEAN ExternalLoadMap( STR16 szFilename )
|
||||
//dnl ch37 200909
|
||||
BOOLEAN ExternalLoadMap(STR16 szFilename)
|
||||
{
|
||||
Assert( szFilename );
|
||||
if( !wcslen( szFilename ) )
|
||||
return FALSE;
|
||||
wcscpy( gzFilename, szFilename );
|
||||
if( !ValidFilename() )
|
||||
return FALSE;
|
||||
gfLoadError = FALSE;
|
||||
Assert(szFilename);
|
||||
if(!wcslen( szFilename))
|
||||
return(FALSE);
|
||||
wcscpy(gzFilename, szFilename);
|
||||
if(!ValidFilename())
|
||||
return(FALSE);
|
||||
gbCurrentFileIOStatus = INITIATE_MAP_LOAD;
|
||||
ProcessFileIO(); //always returns loadsave_screen and changes iostatus to loading_map.
|
||||
ProcessFileIO();
|
||||
ExecuteBaseDirtyRectQueue();
|
||||
EndFrameBufferRender();
|
||||
RefreshScreen( NULL );
|
||||
if( ProcessFileIO() == EDIT_SCREEN )
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
RefreshScreen(NULL);
|
||||
ProcessFileIO();
|
||||
if(gfLoadError)
|
||||
return(FALSE);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN ExternalSaveMap( STR16 szFilename )
|
||||
BOOLEAN ExternalSaveMap(STR16 szFilename)
|
||||
{
|
||||
Assert( szFilename );
|
||||
if( !wcslen( szFilename ) )
|
||||
return FALSE;
|
||||
wcscpy( gzFilename, szFilename );
|
||||
if( !ValidFilename() )
|
||||
return FALSE;
|
||||
gfSaveError = FALSE;
|
||||
Assert(szFilename);
|
||||
if(!wcslen(szFilename))
|
||||
return(FALSE);
|
||||
wcscpy(gzFilename, szFilename);
|
||||
if(!ValidFilename())
|
||||
return(FALSE);
|
||||
gbCurrentFileIOStatus = INITIATE_MAP_SAVE;
|
||||
if( ProcessFileIO() == ERROR_SCREEN )
|
||||
return FALSE;
|
||||
ProcessFileIO();
|
||||
if(gfSaveError)
|
||||
return(FALSE);
|
||||
ExecuteBaseDirtyRectQueue();
|
||||
EndFrameBufferRender();
|
||||
RefreshScreen( NULL );
|
||||
if( ProcessFileIO() == EDIT_SCREEN )
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
RefreshScreen(NULL);
|
||||
ProcessFileIO();
|
||||
if(gfSaveError)
|
||||
return(FALSE);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
#else //non-editor version
|
||||
|
||||
+10
-6
@@ -33,16 +33,20 @@ void SelectFileDialogYPos( UINT16 usRelativeYPos );
|
||||
|
||||
void BuildFilenameWithCoordinate();
|
||||
void BuildCoordinateWithFilename();
|
||||
BOOLEAN ExtractFilenameFromFields();
|
||||
BOOLEAN ValidCoordinate();
|
||||
BOOLEAN ValidFilename();
|
||||
|
||||
BOOLEAN ExternalLoadMap( STR16 szFilename );
|
||||
BOOLEAN ExternalSaveMap( STR16 szFilename );
|
||||
//dnl ch36 200909
|
||||
BOOLEAN ExtractFilenameFromFields(void);
|
||||
//dnl ch31 150909
|
||||
#define ValidFilename() ValidMapFileName(gzFilename)
|
||||
BOOLEAN ValidMapFileName(STR16 szFilename);
|
||||
//dnl ch37 200909
|
||||
BOOLEAN ExternalLoadMap(STR16 szFilename);
|
||||
BOOLEAN ExternalSaveMap(STR16 szFilename);
|
||||
|
||||
extern BOOLEAN gfErrorCatch;
|
||||
extern CHAR16 gzErrorCatchString[ 256 ];
|
||||
|
||||
#define FILENAME_BUFLEN (20 + 4 + 1)//dnl ch39 190909 +4 is for ".dat", +1 is for '\0'
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
+358
-290
@@ -90,7 +90,8 @@ BOOLEAN gfMustForceUpdateAllMaps = FALSE;
|
||||
UINT16 gusNumberOfMapsToBeForceUpdated = 0;
|
||||
BOOLEAN gfMajorUpdate = FALSE;
|
||||
|
||||
void LoadSummary( STR8 pSector, UINT8 ubLevel, FLOAT dMajorMapVersion );
|
||||
BOOLEAN LoadSummary(STR8 pSector, UINT8 ubLevel, FLOAT dMajorMapVersion);//dnl ch28 240909
|
||||
|
||||
void RegenerateSummaryInfoForAllOutdatedMaps();
|
||||
|
||||
void SetupItemDetailsMode( BOOLEAN fAllowRecursion );
|
||||
@@ -102,6 +103,7 @@ BOOLEAN gfGlobalSummaryLoaded = FALSE;
|
||||
|
||||
SUMMARYFILE *gpSectorSummary[16][16][8] = {};
|
||||
SUMMARYFILE *gpCurrentSectorSummary;
|
||||
SUMMARYFILE gCustomFileSectorSummary;//dnl ch30 150909
|
||||
|
||||
MOUSE_REGION MapRegion;
|
||||
|
||||
@@ -219,9 +221,10 @@ extern INT16 gsSelSectorY; // symbol already declared globally in AI Viewer.cpp
|
||||
//summary is going to be persistant or not.
|
||||
UINT32 giInitTimer;
|
||||
|
||||
CHAR16 gszFilename[40];
|
||||
CHAR16 gszTempFilename[21];
|
||||
CHAR16 gszDisplayName[21];
|
||||
//dnl ch39 190909
|
||||
CHAR16 gszFilename[FILENAME_BUFLEN];
|
||||
CHAR16 gszTempFilename[FILENAME_BUFLEN];
|
||||
CHAR16 gszDisplayName[FILENAME_BUFLEN];
|
||||
|
||||
void CalculateOverrideStatus();
|
||||
|
||||
@@ -286,9 +289,7 @@ void CreateSummaryWindow()
|
||||
DisableButton( iSummaryButton[ SUMMARY_BACKGROUND ] );
|
||||
|
||||
iSummaryButton[ SUMMARY_OKAY ] =
|
||||
CreateTextButton(L"Okay", FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT,
|
||||
iScreenWidthOffset + 585, iScreenHeightOffset + 325, 50, 30, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK,
|
||||
SummaryOkayCallback );
|
||||
CreateTextButton(L"Okay", FONT12POINT1, FONT_BLACK, FONT_BLACK, BUTTON_USE_DEFAULT, MAP_LEFT+160, MAP_BOTTOM+99, 50, 30, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, SummaryOkayCallback);//dnl ch36 190909
|
||||
//GiveButtonDefaultStatus( iSummaryButton[ SUMMARY_OKAY ], DEFAULT_STATUS_WINDOWS95 );
|
||||
|
||||
iSummaryButton[ SUMMARY_GRIDCHECKBOX ] =
|
||||
@@ -392,8 +393,7 @@ void CreateSummaryWindow()
|
||||
//Init the textinput field.
|
||||
InitTextInputModeWithScheme( DEFAULT_SCHEME );
|
||||
AddUserInputField( NULL ); //just so we can use short cut keys while not typing.
|
||||
AddTextInputField( MAP_LEFT+112, MAP_BOTTOM+75, 100, 18, MSYS_PRIORITY_HIGH, L"", 20, INPUTTYPE_EXCLUSIVE_DOSFILENAME );
|
||||
|
||||
AddTextInputField(MAP_LEFT+110, MAP_BOTTOM+75, 100, 18, MSYS_PRIORITY_HIGH, L"", (FILENAME_BUFLEN-4-1), INPUTTYPE_EXCLUSIVE_DOSFILENAME);//dnl ch39 190909
|
||||
for( i = 1; i < NUM_SUMMARY_BUTTONS; i++ )
|
||||
HideButton( iSummaryButton[ i ] );
|
||||
|
||||
@@ -426,6 +426,7 @@ void CreateSummaryWindow()
|
||||
void AutoLoadMap()
|
||||
{
|
||||
SummaryLoadMapCallback( ButtonList[ iSummaryButton[ SUMMARY_LOAD ] ], MSYS_CALLBACK_REASON_LBUTTON_UP );
|
||||
ButtonList[ iSummaryButton[ SUMMARY_LOAD ] ]->uiFlags &= ~BUTTON_CLICKED_ON;//dnl ch36 210909
|
||||
if( gfWorldLoaded )
|
||||
DestroySummaryWindow();
|
||||
gfAutoLoadA9 = FALSE;
|
||||
@@ -470,7 +471,7 @@ void DestroySummaryWindow()
|
||||
}
|
||||
|
||||
MSYS_RemoveRegion( &MapRegion );
|
||||
|
||||
gfRenderTaskbar = TRUE;//dnl ch52 091009
|
||||
gfSummaryWindowActive = FALSE;
|
||||
gfPersistantSummary = FALSE;
|
||||
MarkWorldDirty();
|
||||
@@ -534,7 +535,7 @@ void RenderSectorInformation()
|
||||
mprintf( iScreenWidthOffset + 10, iScreenHeightOffset + 32, L"Tileset: %s", gTilesets[ s->ubTilesetID ].zName );
|
||||
if( m->ubMapVersion < 10 )
|
||||
SetFontForeground( FONT_RED );
|
||||
mprintf( iScreenWidthOffset + 10, iScreenHeightOffset + 42, L"Version Info: Summary: 1.%02d, Map: %d.%02d", s->ubSummaryVersion, (INT32)s->dMajorMapVersion, m->ubMapVersion );
|
||||
mprintf(iScreenWidthOffset+10, iScreenHeightOffset+42, L"Version Info: Summary: 1.%02d, Map: %1.2f / %02d", s->ubSummaryVersion, s->dMajorMapVersion, m->ubMapVersion);//dnl ch30 240909
|
||||
SetFontForeground( FONT_GRAY2 );
|
||||
mprintf( iScreenWidthOffset + 10, iScreenHeightOffset + 55, L"Number of items: %d", s->usNumItems );
|
||||
mprintf( iScreenWidthOffset + 10, iScreenHeightOffset + 65, L"Number of lights: %d", s->usNumLights );
|
||||
@@ -1058,6 +1059,11 @@ void RenderSummaryWindow()
|
||||
mprintf( iScreenWidthOffset + 10, iScreenHeightOffset + 30, L"You need to either load an existing map or create a new map before being" );
|
||||
mprintf( iScreenWidthOffset + 10, iScreenHeightOffset + 40, L"able to enter the editor, or you can quit (ESC or Alt+x).");
|
||||
}
|
||||
else if(gCustomFileSectorSummary.ubSummaryVersion)//dnl ch30 150909
|
||||
{
|
||||
gpCurrentSectorSummary = &gCustomFileSectorSummary;
|
||||
RenderSectorInformation();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1529,90 +1535,131 @@ void RenderSummaryWindow()
|
||||
}
|
||||
}
|
||||
|
||||
//dnl ch30 150909
|
||||
void ResetCustomFileSectorSummary(void)
|
||||
{
|
||||
memset(&gCustomFileSectorSummary, 0, sizeof(SUMMARYFILE));
|
||||
}
|
||||
|
||||
//dnl ch31 150909
|
||||
void GetSectorFromFileName(STR16 szFileName, INT16& sSectorX, INT16& sSectorY, INT8& bSectorZ, BOOLEAN& fAltMap)
|
||||
{
|
||||
const int strsz = 16;
|
||||
CHAR16 str[strsz] = L"";
|
||||
if(szFileName[2] == L'.' || szFileName[2] == L'_')
|
||||
{
|
||||
str[0] = szFileName[0];
|
||||
str[1] = L'0';
|
||||
wmemcpy(str+2, szFileName+1, strsz-2);
|
||||
}
|
||||
else if(szFileName[1] == L'1')
|
||||
wmemcpy(str, szFileName, strsz);
|
||||
for(int i=0; i<strsz; i++)
|
||||
str[i] = towupper(str[i]);
|
||||
if((str[0] >= L'A' && str[0] <= L'P') && (str[1] >= L'0' && str[1] <= L'9') && (str[2] >= L'0' && str[2] <= L'9'))
|
||||
{
|
||||
sSectorX = (str[1] - L'0') * 10 + str[2] - L'0';
|
||||
sSectorY = str[0] - L'A' + 1;
|
||||
bSectorZ = 0;
|
||||
fAltMap = FALSE;
|
||||
if(!(sSectorX < 1 || sSectorX > 16 || sSectorY < 1 || sSectorY > 16))
|
||||
{
|
||||
if(wcscmp(&str[3], L".DAT") == 0)
|
||||
return;
|
||||
else if(wcscmp(&str[3], L"_A.DAT") == 0)
|
||||
{
|
||||
fAltMap = TRUE;// Alternate Ground Map
|
||||
return;
|
||||
}
|
||||
else if(str[3] == L'_' && str[4] == L'B' && str[5] >= L'1' && str[5] <= L'3')
|
||||
{
|
||||
bSectorZ = str[5] - L'0';
|
||||
if(wcscmp(&str[6], L".DAT") == 0)
|
||||
return;
|
||||
else if(wcscmp(&str[6], L"_A.DAT") == 0)
|
||||
{
|
||||
fAltMap = TRUE;// Alternate Underground Map
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sSectorX = 0;
|
||||
sSectorY = 0;
|
||||
bSectorZ = 0;
|
||||
fAltMap = FALSE;
|
||||
}
|
||||
|
||||
void UpdateSectorSummary( STR16 gszFilename, BOOLEAN fUpdate )
|
||||
{
|
||||
CHAR16 str[50];
|
||||
CHAR8 szCoord[40];
|
||||
STR16 ptr;
|
||||
INT16 x, y;
|
||||
|
||||
//dnl ch31 130909
|
||||
INT8 bSectorZ;
|
||||
BOOLEAN fAltMap;
|
||||
GetSectorFromFileName(gszFilename, gsSelSectorX, gsSelSectorY, bSectorZ, fAltMap);
|
||||
gfRenderSummary = TRUE;
|
||||
//Extract the sector
|
||||
if( gszFilename[2] < L'0' || gszFilename[2] > L'9' )
|
||||
x = gszFilename[1] - L'0';
|
||||
else
|
||||
x = (gszFilename[1] - L'0') * 10 + gszFilename[2] - L'0';
|
||||
if( gszFilename[0] >= 'a' )
|
||||
y = gszFilename[0] - L'a' + 1;
|
||||
else
|
||||
y = gszFilename[0] - L'A' + 1;
|
||||
gfMapFileDirty = FALSE;
|
||||
|
||||
//Validate that the values extracted are in fact a sector
|
||||
if( x < 1 || x > 16 || y < 1 || y > 16 )
|
||||
return;
|
||||
gsSectorX = gsSelSectorX = x;
|
||||
gsSectorY = gsSelSectorY = y;
|
||||
|
||||
//The idea here is to get a pointer to the filename's period, then
|
||||
//focus on the character previous to it. If it is a 1, 2, or 3, then
|
||||
//the filename was in a basement level. Otherwise, it is a ground level.
|
||||
ptr = wcsstr( gszFilename, L"_a.dat" );
|
||||
if( ptr )
|
||||
gsSectorX = gsSelSectorX;
|
||||
gsSectorY = gsSelSectorY;
|
||||
if(!gsSectorX)
|
||||
{
|
||||
ptr = wcsstr( gszFilename, L"_b" );
|
||||
if( ptr && ptr[2] >= '1' && ptr[2] <= '3' && ptr[5] == '.' )
|
||||
{ //it's a alternate basement map
|
||||
switch( ptr[2] )
|
||||
{
|
||||
case '1':
|
||||
gsSectorLayer = ALTERNATE_B1_MASK;
|
||||
giCurrLevel = 5;
|
||||
break;
|
||||
case '2':
|
||||
gsSectorLayer = ALTERNATE_B2_MASK;
|
||||
giCurrLevel = 6;
|
||||
break;
|
||||
case '3':
|
||||
gsSectorLayer = ALTERNATE_B3_MASK;
|
||||
giCurrLevel = 7;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
CHAR8 ubNewFilename[50];
|
||||
sprintf(ubNewFilename, "%S", gszFilename);
|
||||
ReEvaluateWorld(ubNewFilename);//dnl ch30 150909
|
||||
return;
|
||||
}
|
||||
switch(bSectorZ)
|
||||
{
|
||||
case 0:
|
||||
if(fAltMap)
|
||||
{
|
||||
gsSectorLayer = ALTERNATE_GROUND_MASK;
|
||||
giCurrLevel = 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr = wcsstr( gszFilename, L"_b" );
|
||||
if( ptr && ptr[2] >= '1' && ptr[2] <= '3' && ptr[3] == '.' )
|
||||
{ //it's a alternate basement map
|
||||
switch( ptr[2] )
|
||||
{
|
||||
case '1':
|
||||
gsSectorLayer = BASEMENT1_LEVEL_MASK;
|
||||
giCurrLevel = 1;
|
||||
break;
|
||||
case '2':
|
||||
gsSectorLayer = BASEMENT2_LEVEL_MASK;
|
||||
giCurrLevel = 2;
|
||||
break;
|
||||
case '3':
|
||||
gsSectorLayer = BASEMENT3_LEVEL_MASK;
|
||||
giCurrLevel = 3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gsSectorLayer = GROUND_LEVEL_MASK;
|
||||
giCurrLevel = 0;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if(fAltMap)
|
||||
{
|
||||
gsSectorLayer = ALTERNATE_B1_MASK;
|
||||
giCurrLevel = 5;
|
||||
}
|
||||
else
|
||||
{
|
||||
gsSectorLayer = BASEMENT1_LEVEL_MASK;
|
||||
giCurrLevel = 1;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if(fAltMap)
|
||||
{
|
||||
gsSectorLayer = ALTERNATE_B2_MASK;
|
||||
giCurrLevel = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
gsSectorLayer = BASEMENT2_LEVEL_MASK;
|
||||
giCurrLevel = 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if(fAltMap)
|
||||
{
|
||||
gsSectorLayer = ALTERNATE_B3_MASK;
|
||||
giCurrLevel = 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
gsSectorLayer = BASEMENT3_LEVEL_MASK;
|
||||
giCurrLevel = 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
giCurrentViewLevel = gsSectorLayer;
|
||||
if( !(gbSectorLevels[gsSectorX-1][gsSectorY-1] & gsSectorLayer) )
|
||||
{
|
||||
@@ -1918,8 +1965,7 @@ void CreateGlobalSummary()
|
||||
vfs::COpenWriteFile wfile(L"DevInfo\\readme.txt",true,true);
|
||||
std::string str = "This information is used in conjunction with the editor.\n";
|
||||
str += "This directory or it's contents shouldn't be included with final release.\n";
|
||||
vfs::UInt32 io;
|
||||
wfile.file().Write(str.c_str(), str.length(), io);
|
||||
TRYCATCH_RETHROW( wfile.file().write(str.c_str(), str.length()), L"" );
|
||||
#endif
|
||||
|
||||
// Snap: Restore the data directory once we are finished.
|
||||
@@ -2301,7 +2347,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2327,7 +2377,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_b1.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2353,7 +2407,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_b2.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2379,7 +2437,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_b3.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2405,7 +2467,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_a.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2431,7 +2497,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_b1_a.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2457,7 +2527,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_b2_a.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2483,7 +2557,11 @@ void LoadGlobalSummary()
|
||||
SetFileManCurrentDirectory( DevInfoDir );
|
||||
#else
|
||||
sprintf( szFilename, "Maps\\%c%d_b3_a.dat", 'A' + y, x + 1 );
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
hfile = NULL;
|
||||
if(FileExists(szFilename))
|
||||
{
|
||||
hfile = FileOpen( szFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
}
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
@@ -2562,8 +2640,7 @@ void GenerateSummaryList()
|
||||
vfs::COpenWriteFile wfile(L"DevInfo/readme.txt",true,true);
|
||||
std::string str = "This information is used in conjunction with the editor.\n";
|
||||
str += "This directory or it's contents shouldn't be included with final release.\n";
|
||||
vfs::UInt32 io;
|
||||
wfile.file().Write(str.c_str(), str.length(),io);
|
||||
TRYCATCH_RETHROW( wfile.file().write(str.c_str(), str.length()), L"");
|
||||
}
|
||||
catch(CBasicException &ex)
|
||||
{
|
||||
@@ -2572,79 +2649,37 @@ void GenerateSummaryList()
|
||||
#endif
|
||||
}
|
||||
|
||||
void WriteSectorSummaryUpdate( STR8 puiFilename, UINT8 ubLevel, SUMMARYFILE *pSummaryFileInfo )
|
||||
//dnl ch28 260909
|
||||
void WriteSectorSummaryUpdate(STR8 sFileName, UINT8 ubLevel, SUMMARYFILE* pSummaryFileInfo)
|
||||
{
|
||||
#ifndef USE_VFS
|
||||
FILE *fp;
|
||||
STRING512 DataDir;
|
||||
STRING512 ExecDir;
|
||||
STRING512 Dir;
|
||||
CHAR8 *ptr;
|
||||
#endif
|
||||
INT8 x, y;
|
||||
#ifndef USE_VFS
|
||||
// Snap: save current directory
|
||||
GetFileManCurrentDirectory( DataDir );
|
||||
|
||||
//Set current directory to JA2\DevInfo which contains all of the summary data
|
||||
GetExecutableDirectory( ExecDir );
|
||||
sprintf( Dir, "%s\\DevInfo", ExecDir );
|
||||
if( !SetFileManCurrentDirectory( Dir ) )
|
||||
//AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");//dnl lead to assertion if you don't have Dir and never create summary info
|
||||
{//dnl
|
||||
//Directory doesn't exist, so create it, and continue.
|
||||
if( !MakeFileManDirectory( Dir ) )
|
||||
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information update." );
|
||||
if( !SetFileManCurrentDirectory( Dir ) )
|
||||
AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");
|
||||
}
|
||||
ptr = strstr( (CHAR8 *)puiFilename, ".dat" );
|
||||
if( !ptr )
|
||||
AssertMsg( 0, "Illegal sector summary filename.");
|
||||
sprintf( ptr, ".sum" );
|
||||
|
||||
//write the summary information
|
||||
fp = fopen( puiFilename, "wb" );
|
||||
Assert( fp );
|
||||
fwrite( pSummaryFileInfo, 1, sizeof( SUMMARYFILE ), fp );
|
||||
fclose( fp );
|
||||
#else
|
||||
vfs::Path fname(puiFilename);
|
||||
THROWIFFALSE(MatchPattern(L"*.dat", fname()), L"Illegal sector summary filename");
|
||||
vfs::COpenWriteFile wfile(vfs::Path(L"DevInfo")+vfs::Path(puiFilename),true,true);
|
||||
vfs::UInt32 io;
|
||||
wfile.file().Write((vfs::Byte*)pSummaryFileInfo,sizeof(SUMMARYFILE), io);
|
||||
wfile.file().Close();
|
||||
#endif
|
||||
|
||||
//CHRISL:
|
||||
if(gusNumEntriesWithOutdatedOrNoSummaryInfo > 0)
|
||||
gusNumEntriesWithOutdatedOrNoSummaryInfo--;
|
||||
CHAR8 cFileName[2*FILENAME_BUFLEN];
|
||||
sprintf(cFileName, "DevInfo\\%s", sFileName);
|
||||
// Presumption is that file came with dat extension
|
||||
strcpy(cFileName+strlen(cFileName)-4, ".sum");
|
||||
if(!pSummaryFileInfo->Save(cFileName))
|
||||
return;
|
||||
UpdateMasterProgress();
|
||||
|
||||
//extract the sector information out of the filename.
|
||||
if( puiFilename[0] >= 'a' )
|
||||
y = puiFilename[0] - 'a';
|
||||
INT16 sSectorX, sSectorY;
|
||||
INT8 x, y, bSectorZ;
|
||||
BOOLEAN fAltMap;
|
||||
CHAR16 szFileName[FILENAME_BUFLEN];
|
||||
swprintf(szFileName, L"%S", sFileName);
|
||||
GetSectorFromFileName(szFileName, sSectorX, sSectorY, bSectorZ, fAltMap);
|
||||
if(!sSectorX)
|
||||
gCustomFileSectorSummary = *pSummaryFileInfo;//dnl ch30 150909
|
||||
else
|
||||
y = puiFilename[0] - 'A';
|
||||
if( puiFilename[2] < '0' || puiFilename[2] > '9' )
|
||||
x = puiFilename[ 1 ] - '0' - 1;
|
||||
else
|
||||
x = (puiFilename[ 1 ] - '0') * 10 + puiFilename[ 2 ] - '0' - 1;
|
||||
|
||||
if( gpSectorSummary[x][y][ubLevel] )
|
||||
{
|
||||
MemFree( gpSectorSummary[x][y][ubLevel] );
|
||||
gpSectorSummary[x][y][ubLevel] = NULL;
|
||||
if(gusNumEntriesWithOutdatedOrNoSummaryInfo > 0)
|
||||
gusNumEntriesWithOutdatedOrNoSummaryInfo--;
|
||||
x = sSectorX - 1;
|
||||
y = sSectorY - 1;
|
||||
if(gpSectorSummary[x][y][ubLevel])
|
||||
{
|
||||
MemFree(gpSectorSummary[x][y][ubLevel]);
|
||||
gpSectorSummary[x][y][ubLevel] = NULL;
|
||||
}
|
||||
gpSectorSummary[x][y][ubLevel] = pSummaryFileInfo;
|
||||
}
|
||||
gpSectorSummary[x][y][ubLevel] = pSummaryFileInfo;
|
||||
#ifndef USE_VFS
|
||||
// Snap: Restore the data directory once we are finished.
|
||||
SetFileManCurrentDirectory( DataDir );
|
||||
//Set current directory back to data directory!
|
||||
//sprintf( Dir, "%s\\Data", ExecDir );
|
||||
//SetFileManCurrentDirectory( Dir );
|
||||
#endif
|
||||
}
|
||||
|
||||
void SummaryNewGroundLevelCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
@@ -2680,88 +2715,143 @@ void SummaryNewCaveLevelCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
}
|
||||
}
|
||||
|
||||
void LoadSummary( STR8 pSector, UINT8 ubLevel, FLOAT dMajorMapVersion )
|
||||
//dnl ch28 260909
|
||||
SUMMARYFILE& SUMMARYFILE::operator=(const _OLD_SUMMARYFILE& src)
|
||||
{
|
||||
if((void*)this != (void*)&src)
|
||||
{
|
||||
ubSummaryVersion = src.ubSummaryVersion;
|
||||
ubSpecial = src.ubSpecial;
|
||||
ubNumRooms = src.ubNumRooms;
|
||||
dMajorMapVersion = src.dMajorMapVersion;
|
||||
ubTilesetID = src.ubTilesetID;
|
||||
usNumItems = src.usNumItems;
|
||||
usNumLights = src.usNumLights;
|
||||
ubNumDoors = src.ubNumDoors;
|
||||
ubNumDoorsLocked = src.ubNumDoorsLocked;
|
||||
ubNumDoorsTrapped = src.ubNumDoorsTrapped;
|
||||
ubNumDoorsLockedAndTrapped = src.ubNumDoorsLockedAndTrapped;
|
||||
ubNumElites = src.ubNumElites;
|
||||
ubNumAdmins = src.ubNumAdmins;
|
||||
ubNumTroops = src.ubNumTroops;
|
||||
ubEliteDetailed = src.ubEliteDetailed;
|
||||
ubAdminDetailed = src.ubAdminDetailed;
|
||||
ubTroopDetailed = src.ubTroopDetailed;
|
||||
ubEliteProfile = src.ubEliteProfile;
|
||||
ubAdminProfile = src.ubAdminProfile;
|
||||
ubTroopProfile = src.ubTroopProfile;
|
||||
ubEliteExistance = src.ubEliteExistance;
|
||||
ubAdminExistance = src.ubAdminExistance;
|
||||
ubTroopExistance = src.ubTroopExistance;
|
||||
ubCivSchedules = src.ubCivSchedules;
|
||||
ubCivCows = src.ubCivCows;
|
||||
ubCivBloodcats = src.ubCivBloodcats;
|
||||
ubEnemiesReqWaypoints = src.ubEnemiesReqWaypoints;
|
||||
usWarningRoomNums = src.usWarningRoomNums;
|
||||
ubEnemiesHaveWaypoints = src.ubEnemiesHaveWaypoints;
|
||||
uiNumItemsPosition = src.uiNumItemsPosition;
|
||||
uiEnemyPlacementPosition = src.uiEnemyPlacementPosition;
|
||||
EnemyTeam = src.EnemyTeam;
|
||||
CreatureTeam = src.CreatureTeam;
|
||||
RebelTeam = src.RebelTeam;
|
||||
CivTeam = src.CivTeam;
|
||||
MapInfo = src.MapInfo;
|
||||
for(int i=0; i<4; i++)
|
||||
ExitGrid[i] = src.ExitGrid[i];
|
||||
TranslateArrayFields(usExitGridSize, src.usExitGridSize, 4, UINT16_UINT16);
|
||||
TranslateArrayFields(fInvalidDest, src.fInvalidDest, 4, UINT8_UINT8);
|
||||
ubNumExitGridDests = src.ubNumExitGridDests;
|
||||
fTooManyExitGridDests = src.fTooManyExitGridDests;
|
||||
}
|
||||
return(*this);
|
||||
}
|
||||
|
||||
BOOLEAN SUMMARYFILE::Load(STR sFileName)
|
||||
{
|
||||
if(!FileExists(sFileName))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
HWFILE hFile = FileOpen(sFileName, FILE_ACCESS_READ, FALSE);
|
||||
if(!hFile)
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
UINT8 ubSummaryVersion = 0;
|
||||
UINT32 uiBytesRead = 0;
|
||||
FileRead(hFile, &ubSummaryVersion, sizeof(ubSummaryVersion), &uiBytesRead);
|
||||
if(ubSummaryVersion < 14 || ubSummaryVersion > GLOBAL_SUMMARY_VERSION)
|
||||
{
|
||||
FileClose(hFile);
|
||||
return(FALSE);
|
||||
}
|
||||
FileSeek(hFile, 0L, FILE_SEEK_FROM_START);
|
||||
if(ubSummaryVersion == 14)
|
||||
{
|
||||
_OLD_SUMMARYFILE OldSummaryFile;
|
||||
FileRead(hFile, &OldSummaryFile, sizeof(_OLD_SUMMARYFILE), &uiBytesRead);
|
||||
*this = OldSummaryFile;
|
||||
}
|
||||
else
|
||||
{
|
||||
FileRead(hFile, this, sizeof(SUMMARYFILE), &uiBytesRead);
|
||||
}
|
||||
FileClose(hFile);
|
||||
if(uiBytesRead == sizeof(_OLD_SUMMARYFILE) || uiBytesRead == sizeof(SUMMARYFILE))
|
||||
{
|
||||
return(TRUE);
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
BOOLEAN SUMMARYFILE::Save(STR sFileName)
|
||||
{
|
||||
HWFILE hFile = FileOpen(sFileName, FILE_ACCESS_WRITE|FILE_CREATE_ALWAYS, FALSE);
|
||||
if(!hFile)
|
||||
return(FALSE);
|
||||
UINT32 uiBytesWritten = 0;
|
||||
FileWrite(hFile, this, sizeof(SUMMARYFILE), &uiBytesWritten);
|
||||
FileClose(hFile);
|
||||
if(uiBytesWritten != sizeof(SUMMARYFILE))
|
||||
return(FALSE);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN LoadSummary(STR8 pSector, UINT8 ubLevel, FLOAT dMajorMapVersion)
|
||||
{
|
||||
CHAR8 filename[40];
|
||||
SUMMARYFILE temp;
|
||||
INT32 x, y;
|
||||
#ifndef USE_VFS
|
||||
FILE *fp;
|
||||
sprintf( filename, pSector );
|
||||
#else
|
||||
sprintf( filename, "DevInfo\\%s", pSector );
|
||||
#endif
|
||||
if( ubLevel % 4 )
|
||||
CHAR8 sFileName[2*FILENAME_BUFLEN];
|
||||
SUMMARYFILE SummaryFile;
|
||||
sprintf(sFileName, "DevInfo\\%s", pSector);
|
||||
if(ubLevel % 4)
|
||||
{
|
||||
CHAR8 str[4];
|
||||
sprintf( str, "_b%d", ubLevel % 4 );
|
||||
strcat( filename, str );
|
||||
sprintf(str, "_b%d", ubLevel%4);
|
||||
strcat(sFileName, str);
|
||||
}
|
||||
if( ubLevel >= 4 )
|
||||
{
|
||||
strcat( filename, "_a" );
|
||||
}
|
||||
strcat( filename, ".sum" );
|
||||
#ifndef USE_VFS
|
||||
fp = fopen( filename, "rb" );
|
||||
if( !fp )
|
||||
{
|
||||
gusNumEntriesWithOutdatedOrNoSummaryInfo++;
|
||||
//CHRISL: Maybe take things a step further. Rather then doing a version update, why not wait to do the update until
|
||||
// we actually try to access the map? After all, there is really no need to update the maps if we don't make any
|
||||
// changes to them.
|
||||
//CHRISL: These will force an update basically every time the editor is loaded. What's the point of that?
|
||||
// instead, we should look at the dMajorMapVersion for this map and only load if we need to
|
||||
//ADB don't forget that these might need to be updated!!!
|
||||
/* if(dMajorMapVersion < gdMajorMapVersion)
|
||||
{
|
||||
gusNumberOfMapsToBeForceUpdated++;
|
||||
gfMustForceUpdateAllMaps = TRUE;
|
||||
}*/
|
||||
return;
|
||||
}
|
||||
fread( &temp, 1, sizeof( SUMMARYFILE ), fp );
|
||||
#else
|
||||
if(!GetVFS()->FileExists(filename))
|
||||
{
|
||||
return;
|
||||
}
|
||||
vfs::COpenReadFile rfile(filename);
|
||||
vfs::UInt32 io;
|
||||
rfile.file().Read((vfs::Byte*)&temp,sizeof(SUMMARYFILE),io);
|
||||
#endif
|
||||
//CHRISL: Again, this basically forces the maps to be updated whether we actually access the map or not. Why don't we just
|
||||
// update the map when the map actually needs to be loaded?
|
||||
/* if( temp.ubSummaryVersion < MINIMUMVERSION || dMajorMapVersion < gdMajorMapVersion )
|
||||
{
|
||||
gusNumberOfMapsToBeForceUpdated++;
|
||||
gfMustForceUpdateAllMaps = TRUE;
|
||||
}*/
|
||||
temp.dMajorMapVersion = dMajorMapVersion;
|
||||
UpdateSummaryInfo( &temp );
|
||||
//even if the info is outdated (but existing), allocate the structure, but indicate that the info
|
||||
//is bad.
|
||||
if(ubLevel >= 4)
|
||||
strcat(sFileName, "_a");
|
||||
strcat(sFileName, ".sum");
|
||||
if(!SummaryFile.Load(sFileName))
|
||||
return(FALSE);
|
||||
y = pSector[0] - 'A';
|
||||
if( pSector[2] >= '0' && pSector[2] <= '9' )
|
||||
if(pSector[2] >= '0' && pSector[2] <= '9')
|
||||
x = (pSector[1] - '0') * 10 + pSector[2] - '0' - 1;
|
||||
else
|
||||
x = pSector[1] - '0' - 1;
|
||||
if( gpSectorSummary[x][y][ubLevel] )
|
||||
if(gpSectorSummary[x][y][ubLevel])
|
||||
{
|
||||
MemFree( gpSectorSummary[x][y][ubLevel] );
|
||||
MemFree(gpSectorSummary[x][y][ubLevel]);
|
||||
gpSectorSummary[x][y][ubLevel] = NULL;
|
||||
}
|
||||
gpSectorSummary[x][y][ubLevel] = (SUMMARYFILE*)MemAlloc( sizeof( SUMMARYFILE ) );
|
||||
if( gpSectorSummary[x][y][ubLevel] )
|
||||
memcpy( gpSectorSummary[x][y][ubLevel], &temp, sizeof( SUMMARYFILE ) );
|
||||
if( gpSectorSummary[x][y][ubLevel]->ubSummaryVersion < GLOBAL_SUMMARY_VERSION )
|
||||
gpSectorSummary[x][y][ubLevel] = (SUMMARYFILE*)MemAlloc(sizeof(SUMMARYFILE));
|
||||
if(gpSectorSummary[x][y][ubLevel])
|
||||
memcpy(gpSectorSummary[x][y][ubLevel], &SummaryFile, sizeof(SUMMARYFILE));
|
||||
if(gpSectorSummary[x][y][ubLevel]->ubSummaryVersion < GLOBAL_SUMMARY_VERSION)
|
||||
gusNumEntriesWithOutdatedOrNoSummaryInfo++;
|
||||
#ifndef USE_VFS
|
||||
fclose( fp );
|
||||
#endif
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
double MasterStart, MasterEnd;
|
||||
|
||||
void UpdateMasterProgress()
|
||||
@@ -2919,8 +3009,9 @@ void SummaryUpdateCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
|
||||
void ExtractTempFilename()
|
||||
{
|
||||
CHAR16 str[40];
|
||||
Get16BitStringFromField( 1, str, 40 );
|
||||
//dnl ch39 190909
|
||||
CHAR16 str[FILENAME_BUFLEN-4];
|
||||
Get16BitStringFromField(1, str, FILENAME_BUFLEN-4);
|
||||
if( wcscmp( gszTempFilename, str ) )
|
||||
{
|
||||
wcscpy( gszTempFilename, str );
|
||||
@@ -2931,75 +3022,52 @@ void ExtractTempFilename()
|
||||
swprintf( gszDisplayName, L"test.dat" );
|
||||
}
|
||||
|
||||
BOOLEAN ReEvaluateWorld( const STR8 puiFilename )
|
||||
//dnl ch30 170909
|
||||
BOOLEAN ReEvaluateWorld(const STR8 puiFilename)
|
||||
{
|
||||
#ifndef USE_VFS
|
||||
STRING512 DataDir;
|
||||
#endif
|
||||
STRING512 MapsDir;
|
||||
FLOAT dMajorVersion;
|
||||
UINT8 dMinorVersion;
|
||||
UINT8 ubLevel = 0;
|
||||
CHAR8 name[50];
|
||||
HWFILE hfile;
|
||||
UINT32 uiNumBytesRead;
|
||||
#ifndef USE_VFS
|
||||
GetFileManCurrentDirectory( DataDir );
|
||||
sprintf( MapsDir, "%s\\Maps", DataDir );
|
||||
#endif
|
||||
|
||||
if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & GROUND_LEVEL_MASK )
|
||||
ubLevel = 0;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & BASEMENT1_LEVEL_MASK )
|
||||
UINT8 ubLevel;
|
||||
CHAR8 name[50];
|
||||
INT16 sSectorX, sSectorY;
|
||||
INT8 bSectorZ;
|
||||
BOOLEAN fAltMap;
|
||||
CHAR16 szFileName[50];
|
||||
swprintf(szFileName, L"%S", puiFilename);
|
||||
GetSectorFromFileName(szFileName, sSectorX, sSectorY, bSectorZ, fAltMap);
|
||||
/*
|
||||
switch(bSector)
|
||||
{
|
||||
case 1:
|
||||
ubLevel = 1;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & BASEMENT2_LEVEL_MASK )
|
||||
if(fAltMap)
|
||||
ubLevel = 5;
|
||||
break;
|
||||
case 2:
|
||||
ubLevel = 2;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & BASEMENT3_LEVEL_MASK )
|
||||
if(fAltMap)
|
||||
ubLevel = 6;
|
||||
break;
|
||||
case 3:
|
||||
ubLevel = 3;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & ALTERNATE_GROUND_MASK )
|
||||
ubLevel = 4;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & ALTERNATE_B1_MASK )
|
||||
ubLevel = 5;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & ALTERNATE_B2_MASK )
|
||||
ubLevel = 6;
|
||||
else if( gbSectorLevels[gsSelSectorX-1][gsSelSectorY-1] & ALTERNATE_B3_MASK )
|
||||
ubLevel = 7;
|
||||
#ifndef USE_VFS
|
||||
SetFileManCurrentDirectory( MapsDir );
|
||||
hfile = FileOpen( puiFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
#else
|
||||
sprintf( MapsDir, "Maps\\%s", puiFilename );
|
||||
hfile = FileOpen( MapsDir, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
|
||||
#endif
|
||||
if( hfile )
|
||||
{
|
||||
FileRead( hfile, &dMajorVersion, sizeof( FLOAT ), &uiNumBytesRead );
|
||||
FileRead( hfile, &dMinorVersion, sizeof( UINT8 ), &uiNumBytesRead );
|
||||
FileClose( hfile );
|
||||
if(fAltMap)
|
||||
ubLevel = 7;
|
||||
break;
|
||||
default:
|
||||
ubLevel = 0;
|
||||
if(fAltMap)
|
||||
ubLevel = 4;
|
||||
break;
|
||||
}
|
||||
#ifndef USE_VFS
|
||||
SetFileManCurrentDirectory( DataDir );
|
||||
#endif
|
||||
|
||||
if(dMajorVersion < gdMajorMapVersion || dMinorVersion < gubMinorMapVersion)
|
||||
gfMajorUpdate = TRUE;
|
||||
*/
|
||||
ubLevel = bSectorZ;
|
||||
if(fAltMap)
|
||||
ubLevel += 4;
|
||||
if(sSectorX)
|
||||
sprintf(name, "%c%d", (sSectorY-1+'A'), sSectorX);
|
||||
else
|
||||
gfMajorUpdate = FALSE;
|
||||
|
||||
//CHRISL: If gfMajorUpdate is ever set TRUE, the code will load a map, update it, then save the map... THEN it will
|
||||
// reload the map so you can look at it. But I'm thinking the only time we should actually update the actual map
|
||||
// file is when we intentionally save the file. So, for now, make sure this flag is always FALSE.
|
||||
gfMajorUpdate = FALSE;
|
||||
|
||||
sprintf( name, "%c%d", (gsSelSectorY-1) + 'A', gsSelSectorX );
|
||||
if( !EvaluateWorld( name, ubLevel ) )
|
||||
{
|
||||
gfMajorUpdate = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gfMajorUpdate = FALSE;
|
||||
return TRUE;
|
||||
strcpy(name, puiFilename);
|
||||
if(!EvaluateWorld(name, ubLevel))
|
||||
return(FALSE);
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
void ApologizeOverrideAndForceUpdateEverything()
|
||||
|
||||
@@ -31,5 +31,8 @@ extern BOOLEAN gfUpdateSummaryInfo;
|
||||
|
||||
extern UINT8 GetCurrentSummaryVersion();
|
||||
|
||||
void GetSectorFromFileName(STR16 szFileName, INT16& sSectorX, INT16& sSectorY, INT8& bSectorZ, BOOLEAN& fAltMap);//dnl ch31 140909
|
||||
void ResetCustomFileSectorSummary(void);//dnl ch30 150909
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -133,12 +133,12 @@ void DecSmartBrokenWallUIValue()
|
||||
gubBrokenWallUIValue -= gubBrokenWallUIValue > 0 ? 1 : -4;
|
||||
}
|
||||
|
||||
BOOLEAN CalcWallInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex )
|
||||
BOOLEAN CalcWallInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN CalcDoorInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusDoorType, UINT16 *pusIndex )
|
||||
BOOLEAN CalcDoorInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusDoorType, UINT16 *pusIndex )
|
||||
{
|
||||
LEVELNODE *pWall = NULL;
|
||||
UINT16 usWallOrientation;
|
||||
@@ -161,7 +161,7 @@ BOOLEAN CalcDoorInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusDoorType, UIN
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN CalcWindowInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex )
|
||||
BOOLEAN CalcWindowInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex )
|
||||
{
|
||||
LEVELNODE *pWall = NULL;
|
||||
UINT32 uiTileType;
|
||||
@@ -200,7 +200,7 @@ BOOLEAN CalcWindowInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, U
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN CalcBrokenWallInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex )
|
||||
BOOLEAN CalcBrokenWallInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex )
|
||||
{
|
||||
LEVELNODE *pWall = NULL;
|
||||
UINT32 uiTileType;
|
||||
@@ -267,10 +267,10 @@ BOOLEAN CalcBrokenWallInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallTyp
|
||||
// type, there are two more cases. When there is a bottom wall in the y+1 position or a right wall in
|
||||
// the x+1 position. If there are matching walls, there, then we draw two pieces to connect the current
|
||||
// gridno with the respective position.
|
||||
void PasteSmartWall( UINT32 iMapIndex )
|
||||
void PasteSmartWall( INT32 iMapIndex )
|
||||
{
|
||||
static BOOLEAN fWallAlone = FALSE;
|
||||
static UINT32 iAloneMapIndex = 0x8000;
|
||||
static UINT32 iAloneMapIndex = 0x80000000;
|
||||
UINT16 usWallType;
|
||||
|
||||
//These are the counters for the walls of each type
|
||||
@@ -481,7 +481,7 @@ void PasteSmartWall( UINT32 iMapIndex )
|
||||
//Check for the highest weight value.
|
||||
}
|
||||
|
||||
void PasteSmartDoor( UINT32 iMapIndex )
|
||||
void PasteSmartDoor( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall = NULL;
|
||||
UINT16 usTileIndex;
|
||||
@@ -509,7 +509,7 @@ void PasteSmartDoor( UINT32 iMapIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void PasteSmartWindow( UINT32 iMapIndex )
|
||||
void PasteSmartWindow( INT32 iMapIndex )
|
||||
{
|
||||
UINT16 usNewWallIndex;
|
||||
|
||||
@@ -558,7 +558,7 @@ void PasteSmartWindow( UINT32 iMapIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void PasteSmartBrokenWall( UINT32 iMapIndex )
|
||||
void PasteSmartBrokenWall( INT32 iMapIndex )
|
||||
{
|
||||
UINT16 usNewWallIndex;
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@ void DecSmartWindowUIValue();
|
||||
void IncSmartBrokenWallUIValue();
|
||||
void DecSmartBrokenWallUIValue();
|
||||
|
||||
BOOLEAN CalcWallInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcDoorInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusDoorType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcWindowInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcBrokenWallInfoUsingSmartMethod( UINT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcWallInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcDoorInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusDoorType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcWindowInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex );
|
||||
BOOLEAN CalcBrokenWallInfoUsingSmartMethod( INT32 iMapIndex, UINT16 *pusWallType, UINT16 *pusIndex );
|
||||
|
||||
void PasteSmartWall( UINT32 iMapIndex );
|
||||
void PasteSmartDoor( UINT32 iMapIndex );
|
||||
void PasteSmartWindow( UINT32 iMapIndex );
|
||||
void PasteSmartBrokenWall( UINT32 iMapIndex );
|
||||
void PasteSmartWall( INT32 iMapIndex );
|
||||
void PasteSmartDoor( INT32 iMapIndex );
|
||||
void PasteSmartWindow( INT32 iMapIndex );
|
||||
void PasteSmartBrokenWall( INT32 iMapIndex );
|
||||
|
||||
extern UINT8 gubDoorUIValue;
|
||||
extern UINT8 gubWindowUIValue;
|
||||
|
||||
+20
-20
@@ -24,7 +24,7 @@ extern UINT16 PickAWallPiece( UINT16 usWallPieceType );
|
||||
//This method isn't foolproof, but because erasing large areas of buildings could result in
|
||||
//multiple wall types for each building. When processing the region, it is necessary to
|
||||
//calculate the roof type by searching for the nearest roof tile.
|
||||
UINT16 SearchForWallType( UINT32 iMapIndex )
|
||||
UINT16 SearchForWallType( INT32 iMapIndex )
|
||||
{
|
||||
UINT32 uiTileType;
|
||||
LEVELNODE *pWall;
|
||||
@@ -47,7 +47,7 @@ UINT16 SearchForWallType( UINT32 iMapIndex )
|
||||
if( abs(x) == abs(sRadius) || abs(y) == abs(sRadius) )
|
||||
{
|
||||
sOffset = y * WORLD_COLS + x;
|
||||
if( !GridNoOnVisibleWorldTile( (INT16)(iMapIndex + sOffset) ) )
|
||||
if( !GridNoOnVisibleWorldTile( iMapIndex + sOffset ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ UINT16 SearchForWallType( UINT32 iMapIndex )
|
||||
//This method isn't foolproof, but because erasing large areas of buildings could result in
|
||||
//multiple roof types for each building. When processing the region, it is necessary to
|
||||
//calculate the roof type by searching for the nearest roof tile.
|
||||
UINT16 SearchForRoofType( UINT32 iMapIndex )
|
||||
UINT16 SearchForRoofType( INT32 iMapIndex )
|
||||
{
|
||||
UINT32 uiTileType;
|
||||
LEVELNODE *pRoof;
|
||||
@@ -88,7 +88,7 @@ UINT16 SearchForRoofType( UINT32 iMapIndex )
|
||||
if( abs(x) == abs(sRadius) || abs(y) == abs(sRadius) )
|
||||
{
|
||||
sOffset = y * WORLD_COLS + x;
|
||||
if( !GridNoOnVisibleWorldTile( (INT16)(iMapIndex + sOffset) ) )
|
||||
if( !GridNoOnVisibleWorldTile( iMapIndex + sOffset ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ UINT16 SearchForRoofType( UINT32 iMapIndex )
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
BOOLEAN RoofAtGridNo( UINT32 iMapIndex )
|
||||
BOOLEAN RoofAtGridNo( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pRoof;
|
||||
UINT32 uiTileType;
|
||||
@@ -128,7 +128,7 @@ BOOLEAN RoofAtGridNo( UINT32 iMapIndex )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN BuildingAtGridNo( UINT32 iMapIndex )
|
||||
BOOLEAN BuildingAtGridNo( INT32 iMapIndex )
|
||||
{
|
||||
if( RoofAtGridNo( iMapIndex ) )
|
||||
return TRUE;
|
||||
@@ -137,7 +137,7 @@ BOOLEAN BuildingAtGridNo( UINT32 iMapIndex )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN ValidDecalPlacement( UINT32 iMapIndex )
|
||||
BOOLEAN ValidDecalPlacement( INT32 iMapIndex )
|
||||
{
|
||||
if( GetVerticalWall( iMapIndex ) || GetHorizontalWall( iMapIndex )
|
||||
|| GetVerticalFence( iMapIndex ) || GetHorizontalFence( iMapIndex ) )
|
||||
@@ -145,7 +145,7 @@ BOOLEAN ValidDecalPlacement( UINT32 iMapIndex )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LEVELNODE* GetVerticalWall( UINT32 iMapIndex )
|
||||
LEVELNODE* GetVerticalWall( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pStruct;
|
||||
UINT32 uiTileType;
|
||||
@@ -171,7 +171,7 @@ LEVELNODE* GetVerticalWall( UINT32 iMapIndex )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LEVELNODE* GetHorizontalWall( UINT32 iMapIndex )
|
||||
LEVELNODE* GetHorizontalWall( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pStruct;
|
||||
UINT32 uiTileType;
|
||||
@@ -197,7 +197,7 @@ LEVELNODE* GetHorizontalWall( UINT32 iMapIndex )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UINT16 GetVerticalWallType( UINT32 iMapIndex )
|
||||
UINT16 GetVerticalWallType( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
UINT32 uiTileType;
|
||||
@@ -212,7 +212,7 @@ UINT16 GetVerticalWallType( UINT32 iMapIndex )
|
||||
return 0;
|
||||
}
|
||||
|
||||
UINT16 GetHorizontalWallType( UINT32 iMapIndex )
|
||||
UINT16 GetHorizontalWallType( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
UINT32 uiTileType;
|
||||
@@ -227,7 +227,7 @@ UINT16 GetHorizontalWallType( UINT32 iMapIndex )
|
||||
return 0;
|
||||
}
|
||||
|
||||
LEVELNODE* GetVerticalFence( UINT32 iMapIndex )
|
||||
LEVELNODE* GetVerticalFence( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pStruct;
|
||||
UINT32 uiTileType;
|
||||
@@ -252,7 +252,7 @@ LEVELNODE* GetVerticalFence( UINT32 iMapIndex )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LEVELNODE* GetHorizontalFence( UINT32 iMapIndex )
|
||||
LEVELNODE* GetHorizontalFence( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pStruct;
|
||||
UINT32 uiTileType;
|
||||
@@ -277,7 +277,7 @@ LEVELNODE* GetHorizontalFence( UINT32 iMapIndex )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void EraseHorizontalWall( UINT32 iMapIndex )
|
||||
void EraseHorizontalWall( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
pWall = GetHorizontalWall( iMapIndex );
|
||||
@@ -289,7 +289,7 @@ void EraseHorizontalWall( UINT32 iMapIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void EraseVerticalWall( UINT32 iMapIndex )
|
||||
void EraseVerticalWall( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
pWall = GetVerticalWall( iMapIndex );
|
||||
@@ -301,7 +301,7 @@ void EraseVerticalWall( UINT32 iMapIndex )
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeHorizontalWall( UINT32 iMapIndex, UINT16 usNewPiece )
|
||||
void ChangeHorizontalWall( INT32 iMapIndex, UINT16 usNewPiece )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
UINT32 uiTileType;
|
||||
@@ -321,7 +321,7 @@ void ChangeHorizontalWall( UINT32 iMapIndex, UINT16 usNewPiece )
|
||||
}
|
||||
}
|
||||
|
||||
void ChangeVerticalWall( UINT32 iMapIndex, UINT16 usNewPiece )
|
||||
void ChangeVerticalWall( INT32 iMapIndex, UINT16 usNewPiece )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
UINT32 uiTileType;
|
||||
@@ -341,7 +341,7 @@ void ChangeVerticalWall( UINT32 iMapIndex, UINT16 usNewPiece )
|
||||
}
|
||||
}
|
||||
|
||||
void RestoreWalls( UINT32 iMapIndex )
|
||||
void RestoreWalls( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall = NULL;
|
||||
UINT32 uiTileType;
|
||||
@@ -450,7 +450,7 @@ UINT16 GetWallClass( LEVELNODE *pWall )
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
UINT16 GetVerticalWallClass( UINT16 iMapIndex )
|
||||
UINT16 GetVerticalWallClass( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
if( pWall = GetVerticalWall( iMapIndex ) )
|
||||
@@ -458,7 +458,7 @@ UINT16 GetVerticalWallClass( UINT16 iMapIndex )
|
||||
return 0xffff;
|
||||
}
|
||||
|
||||
UINT16 GetHorizontalWallClass( UINT16 iMapIndex )
|
||||
UINT16 GetHorizontalWallClass( INT32 iMapIndex )
|
||||
{
|
||||
LEVELNODE *pWall;
|
||||
if( pWall = GetVerticalWall( iMapIndex ) )
|
||||
|
||||
+20
-20
@@ -38,28 +38,28 @@ enum {
|
||||
|
||||
//in newsmooth.c
|
||||
extern INT8 gbWallTileLUT[NUM_WALL_TYPES][7];
|
||||
extern void EraseWalls( UINT32 iMapIndex );
|
||||
extern void BuildWallPiece( UINT32 iMapIndex, UINT8 ubWallPiece, UINT16 usWallType );
|
||||
extern void EraseWalls( INT32 iMapIndex );
|
||||
extern void BuildWallPiece( INT32 iMapIndex, UINT8 ubWallPiece, UINT16 usWallType );
|
||||
//in Smoothing Utils
|
||||
void RestoreWalls( UINT32 iMapIndex );
|
||||
UINT16 SearchForRoofType( UINT32 iMapIndex );
|
||||
UINT16 SearchForWallType( UINT32 iMapIndex );
|
||||
BOOLEAN RoofAtGridNo( UINT32 iMapIndex );
|
||||
BOOLEAN BuildingAtGridNo( UINT32 iMapIndex );
|
||||
LEVELNODE* GetHorizontalWall( UINT32 iMapIndex );
|
||||
LEVELNODE* GetVerticalWall( UINT32 iMapIndex );
|
||||
LEVELNODE* GetVerticalFence( UINT32 iMapIndex );
|
||||
LEVELNODE* GetHorizontalFence( UINT32 iMapIndex );
|
||||
UINT16 GetHorizontalWallType( UINT32 iMapIndex );
|
||||
UINT16 GetVerticalWallType( UINT32 iMapIndex );
|
||||
void EraseHorizontalWall( UINT32 iMapIndex );
|
||||
void EraseVerticalWall( UINT32 iMapIndex );
|
||||
void ChangeHorizontalWall( UINT32 iMapIndex, UINT16 usNewPiece );
|
||||
void ChangeVerticalWall( UINT32 iMapIndex, UINT16 usNewPiece );
|
||||
void RestoreWalls( INT32 iMapIndex );
|
||||
UINT16 SearchForRoofType( INT32 iMapIndex );
|
||||
UINT16 SearchForWallType( INT32 iMapIndex );
|
||||
BOOLEAN RoofAtGridNo( INT32 iMapIndex );
|
||||
BOOLEAN BuildingAtGridNo( INT32 iMapIndex );
|
||||
LEVELNODE* GetHorizontalWall( INT32 iMapIndex );
|
||||
LEVELNODE* GetVerticalWall( INT32 iMapIndex );
|
||||
LEVELNODE* GetVerticalFence( INT32 iMapIndex );
|
||||
LEVELNODE* GetHorizontalFence( INT32 iMapIndex );
|
||||
UINT16 GetHorizontalWallType( INT32 iMapIndex );
|
||||
UINT16 GetVerticalWallType( INT32 iMapIndex );
|
||||
void EraseHorizontalWall( INT32 iMapIndex );
|
||||
void EraseVerticalWall( INT32 iMapIndex );
|
||||
void ChangeHorizontalWall( INT32 iMapIndex, UINT16 usNewPiece );
|
||||
void ChangeVerticalWall( INT32 iMapIndex, UINT16 usNewPiece );
|
||||
UINT16 GetWallClass( LEVELNODE *pWall );
|
||||
UINT16 GetVerticalWallClass( UINT16 iMapIndex );
|
||||
UINT16 GetHorizontalWallClass( UINT16 iMapIndex );
|
||||
BOOLEAN ValidDecalPlacement( UINT32 iMapIndex );
|
||||
UINT16 GetVerticalWallClass( INT32 iMapIndex );
|
||||
UINT16 GetHorizontalWallClass( INT32 iMapIndex );
|
||||
BOOLEAN ValidDecalPlacement( INT32 iMapIndex );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
+59
-9
@@ -6,8 +6,9 @@
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
#define GLOBAL_SUMMARY_VERSION 14
|
||||
#define MINIMUMVERSION 7
|
||||
//dnl ch28
|
||||
#define GLOBAL_SUMMARY_VERSION 15
|
||||
#define MINIMUMVERSION 7
|
||||
|
||||
typedef struct TEAMSUMMARY
|
||||
{
|
||||
@@ -20,14 +21,14 @@ typedef struct TEAMSUMMARY
|
||||
UINT8 ubBadE, ubPoorE, ubAvgE, ubGoodE, ubGreatE; //equipment
|
||||
}TEAMSUMMARY; //15 bytes
|
||||
|
||||
typedef struct SUMMARYFILE
|
||||
typedef struct
|
||||
{
|
||||
//start version 1
|
||||
UINT8 ubSummaryVersion;
|
||||
UINT8 ubSpecial;
|
||||
UINT16 usNumItems;
|
||||
UINT16 usNumLights;
|
||||
MAPCREATE_STRUCT MapInfo;
|
||||
_OLD_MAPCREATE_STRUCT MapInfo;
|
||||
TEAMSUMMARY EnemyTeam;
|
||||
TEAMSUMMARY CreatureTeam;
|
||||
TEAMSUMMARY RebelTeam;
|
||||
@@ -65,7 +66,7 @@ typedef struct SUMMARYFILE
|
||||
// //-----
|
||||
// 190
|
||||
//start version 10
|
||||
EXITGRID ExitGrid[4]; //5*4 // 20
|
||||
_OLD_EXITGRID ExitGrid[4]; //5*4 // 20
|
||||
UINT16 usExitGridSize[4]; //2*4 // 8
|
||||
BOOLEAN fInvalidDest[4]; // 4
|
||||
UINT8 ubNumExitGridDests; // 1
|
||||
@@ -93,13 +94,62 @@ typedef struct SUMMARYFILE
|
||||
UINT8 ubPadding[164]; // 164
|
||||
// //-----
|
||||
// 400 total bytes
|
||||
}SUMMARYFILE;
|
||||
}_OLD_SUMMARYFILE;//dnl ch28 240909
|
||||
|
||||
class SUMMARYFILE//dnl ch28 260909
|
||||
{
|
||||
public:
|
||||
UINT8 ubSummaryVersion;//This byte in all versions must be first
|
||||
UINT8 ubSpecial;
|
||||
UINT16 ubNumRooms;
|
||||
UINT32 usNumItems;
|
||||
UINT32 usNumLights;
|
||||
UINT16 ubNumDoors;
|
||||
UINT16 ubNumDoorsLocked;
|
||||
UINT16 ubNumDoorsTrapped;
|
||||
UINT16 ubNumDoorsLockedAndTrapped;
|
||||
UINT16 ubNumElites;
|
||||
UINT16 ubNumAdmins;
|
||||
UINT16 ubNumTroops;
|
||||
UINT16 ubEliteDetailed;
|
||||
UINT16 ubAdminDetailed;
|
||||
UINT16 ubTroopDetailed;
|
||||
UINT16 ubEliteProfile;
|
||||
UINT16 ubAdminProfile;
|
||||
UINT16 ubTroopProfile;
|
||||
UINT16 ubEliteExistance;
|
||||
UINT16 ubAdminExistance;
|
||||
UINT16 ubTroopExistance;
|
||||
UINT16 ubCivSchedules;
|
||||
UINT16 ubCivCows;
|
||||
UINT16 ubCivBloodcats;
|
||||
UINT16 ubEnemiesReqWaypoints;
|
||||
UINT16 usWarningRoomNums;
|
||||
UINT16 ubEnemiesHaveWaypoints;
|
||||
UINT32 ubTilesetID;
|
||||
UINT32 uiNumItemsPosition;
|
||||
UINT32 uiEnemyPlacementPosition;
|
||||
FLOAT dMajorMapVersion;
|
||||
TEAMSUMMARY EnemyTeam;
|
||||
TEAMSUMMARY CreatureTeam;
|
||||
TEAMSUMMARY RebelTeam;
|
||||
TEAMSUMMARY CivTeam;
|
||||
MAPCREATE_STRUCT MapInfo;
|
||||
EXITGRID ExitGrid[4];
|
||||
BOOLEAN fInvalidDest[4];
|
||||
UINT16 usExitGridSize[4];
|
||||
UINT16 ubNumExitGridDests;
|
||||
BOOLEAN fTooManyExitGridDests;
|
||||
public:
|
||||
SUMMARYFILE& operator=(const _OLD_SUMMARYFILE& src);
|
||||
BOOLEAN Load(STR sFileName);
|
||||
BOOLEAN Save(STR sFileName);
|
||||
};
|
||||
|
||||
extern BOOLEAN gfAutoLoadA9;
|
||||
|
||||
extern BOOLEAN EvaluateWorld( STR8 pSector, UINT8 ubLevel );
|
||||
|
||||
extern void WriteSectorSummaryUpdate( STR8 puiFilename, UINT8 ubLevel, SUMMARYFILE *pSummaryFileInfo );
|
||||
BOOLEAN EvaluateWorld(STR8 pSector, UINT8 ubLevel);//dnl ch42 260909
|
||||
void WriteSectorSummaryUpdate(STR8 sFileName, UINT8 ubLevel, SUMMARYFILE* pSummaryFileInfo);//dnl ch28 260909
|
||||
|
||||
extern BOOLEAN gfMustForceUpdateAllMaps;
|
||||
extern BOOLEAN gfMajorUpdate;
|
||||
|
||||
+450
-78
@@ -31,12 +31,12 @@
|
||||
#endif
|
||||
|
||||
BOOLEAN PasteHigherTextureFromRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ubRadius );
|
||||
BOOLEAN PasteExistingTexture( UINT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN PasteExistingTexture( INT32 iMapIndex, UINT16 usIndex );
|
||||
BOOLEAN PasteExistingTextureFromRadius( INT32 iMapIndex, UINT16 usIndex, UINT8 ubRadius );
|
||||
BOOLEAN SetLowerLandIndexWithRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ubRadius, BOOLEAN fReplace );
|
||||
|
||||
void PasteTextureEx( INT16 sGridNo, UINT16 usType );
|
||||
void PasteTextureFromRadiusEx( INT16 sGridNo, UINT16 usType, UINT8 ubRadius );
|
||||
void PasteTextureEx( INT32 sGridNo, UINT16 usType );
|
||||
void PasteTextureFromRadiusEx( INT32 sGridNo, UINT16 usType, UINT8 ubRadius );
|
||||
|
||||
|
||||
BOOLEAN gfWarning = FALSE;
|
||||
@@ -56,9 +56,9 @@ UINT32 gDoCliffs = NO_CLIFFS;
|
||||
//
|
||||
// Performs ersing operation when the DEL key is hit in the editor
|
||||
//
|
||||
void QuickEraseMapTile( UINT32 iMapIndex )
|
||||
void QuickEraseMapTile( INT32 iMapIndex )
|
||||
{
|
||||
if ( iMapIndex >= 0x8000 )
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return;
|
||||
AddToUndoList( iMapIndex );
|
||||
DeleteStuffFromMapTile( iMapIndex );
|
||||
@@ -71,7 +71,7 @@ void QuickEraseMapTile( UINT32 iMapIndex )
|
||||
//
|
||||
// Common delete function for both QuickEraseMapTile and EraseMapTile
|
||||
//
|
||||
void DeleteStuffFromMapTile( UINT32 iMapIndex )
|
||||
void DeleteStuffFromMapTile( INT32 iMapIndex )
|
||||
{
|
||||
//UINT16 usUseIndex;
|
||||
//UINT16 usType;
|
||||
@@ -99,11 +99,11 @@ void DeleteStuffFromMapTile( UINT32 iMapIndex )
|
||||
//
|
||||
// Generic tile erasing function. Erases things from the world depending on the current drawing mode
|
||||
//
|
||||
void EraseMapTile( UINT32 iMapIndex )
|
||||
void EraseMapTile( INT32 iMapIndex )
|
||||
{
|
||||
INT32 iEraseMode;
|
||||
UINT32 uiCheckType;
|
||||
if ( iMapIndex >= 0x8000 )
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return;
|
||||
|
||||
// Figure out what it is we are trying to erase
|
||||
@@ -122,7 +122,7 @@ void EraseMapTile( UINT32 iMapIndex )
|
||||
case DRAW_MODE_EXITGRID:
|
||||
AddToUndoList( iMapIndex );
|
||||
RemoveExitGridFromWorld( iMapIndex );
|
||||
RemoveTopmost( (INT16)iMapIndex, FIRSTPOINTERS8 );
|
||||
RemoveTopmost( iMapIndex, FIRSTPOINTERS8 );
|
||||
break;
|
||||
case DRAW_MODE_GROUND:
|
||||
// Is there ground on this tile? if not, get out o here
|
||||
@@ -137,6 +137,10 @@ void EraseMapTile( UINT32 iMapIndex )
|
||||
RemoveLand( iMapIndex, gpWorldLevelData[ iMapIndex ].pLandHead->usIndex );
|
||||
SmoothTerrainRadius( iMapIndex, uiCheckType, 1, TRUE );
|
||||
break;
|
||||
case DRAW_MODE_HIGH_GROUND://dnl ch1 210909
|
||||
gpWorldLevelData[iMapIndex].sHeight = 0;
|
||||
RemoveTopmost(iMapIndex, FIRSTPOINTERS6);
|
||||
break;
|
||||
case DRAW_MODE_OSTRUCTS:
|
||||
case DRAW_MODE_OSTRUCTS1:
|
||||
case DRAW_MODE_OSTRUCTS2:
|
||||
@@ -221,7 +225,7 @@ void EraseMapTile( UINT32 iMapIndex )
|
||||
// Place some "debris" on the map at the current mouse coordinates. This function is called repeatedly if
|
||||
// the current brush size is larger than 1 tile.
|
||||
//
|
||||
void PasteDebris( UINT32 iMapIndex )
|
||||
void PasteDebris( INT32 iMapIndex )
|
||||
{
|
||||
UINT16 usUseIndex;
|
||||
UINT16 usUseObjIndex;
|
||||
@@ -231,7 +235,7 @@ void PasteDebris( UINT32 iMapIndex )
|
||||
pSelList = SelDebris;
|
||||
pNumSelList = &iNumDebrisSelected;
|
||||
|
||||
if ( iMapIndex < 0x8000 )
|
||||
if ( iMapIndex < 0x80000000 )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
|
||||
@@ -255,35 +259,35 @@ void PasteDebris( UINT32 iMapIndex )
|
||||
}
|
||||
|
||||
|
||||
void PasteSingleWall( UINT32 iMapIndex )
|
||||
void PasteSingleWall( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleWall;
|
||||
pNumSelList = &iNumWallsSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleDoor( UINT32 iMapIndex )
|
||||
void PasteSingleDoor( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleDoor;
|
||||
pNumSelList = &iNumDoorsSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleWindow( UINT32 iMapIndex )
|
||||
void PasteSingleWindow( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleWindow;
|
||||
pNumSelList = &iNumWindowsSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleRoof( UINT32 iMapIndex )
|
||||
void PasteSingleRoof( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleRoof;
|
||||
pNumSelList = &iNumRoofsSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteRoomNumber( UINT32 iMapIndex, UINT8 ubRoomNumber )
|
||||
void PasteRoomNumber( INT32 iMapIndex, UINT8 ubRoomNumber )
|
||||
{
|
||||
if( gubWorldRoomInfo[ iMapIndex ] != ubRoomNumber )
|
||||
{
|
||||
@@ -292,7 +296,7 @@ void PasteRoomNumber( UINT32 iMapIndex, UINT8 ubRoomNumber )
|
||||
}
|
||||
}
|
||||
|
||||
void PasteSingleBrokenWall( UINT32 iMapIndex )
|
||||
void PasteSingleBrokenWall( INT32 iMapIndex )
|
||||
{
|
||||
UINT16 usIndex, usObjIndex, usTileIndex, usWallOrientation;
|
||||
|
||||
@@ -311,28 +315,28 @@ void PasteSingleBrokenWall( UINT32 iMapIndex )
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleDecoration( UINT32 iMapIndex )
|
||||
void PasteSingleDecoration( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleDecor;
|
||||
pNumSelList = &iNumDecorSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleDecal( UINT32 iMapIndex )
|
||||
void PasteSingleDecal( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleDecal;
|
||||
pNumSelList = &iNumDecalsSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleFloor( UINT32 iMapIndex )
|
||||
void PasteSingleFloor( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleFloor;
|
||||
pNumSelList = &iNumFloorsSelected;
|
||||
PasteSingleWallCommon( iMapIndex );
|
||||
}
|
||||
|
||||
void PasteSingleToilet( UINT32 iMapIndex )
|
||||
void PasteSingleToilet( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelSingleToilet;
|
||||
pNumSelList = &iNumToiletsSelected;
|
||||
@@ -345,13 +349,13 @@ void PasteSingleToilet( UINT32 iMapIndex )
|
||||
// Common paste routine for PasteSingleWall, PasteSingleDoor, PasteSingleDecoration, and
|
||||
// PasteSingleDecor (above).
|
||||
//
|
||||
void PasteSingleWallCommon( UINT32 iMapIndex )
|
||||
void PasteSingleWallCommon( INT32 iMapIndex )
|
||||
{
|
||||
UINT16 usUseIndex;
|
||||
UINT16 usUseObjIndex;
|
||||
UINT16 usTempIndex;
|
||||
|
||||
if ( iMapIndex < 0x8000 )
|
||||
if ( iMapIndex < 0x80000000 )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
|
||||
@@ -501,7 +505,7 @@ UINT16 GetRandomTypeByRange( UINT16 usRangeStart, UINT16 usRangeEnd )
|
||||
//
|
||||
// Puts a structure (trees, trucks, etc.) into the world
|
||||
//
|
||||
void PasteStructure( UINT32 iMapIndex )
|
||||
void PasteStructure( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelOStructs;
|
||||
pNumSelList = &iNumOStructsSelected;
|
||||
@@ -514,7 +518,7 @@ void PasteStructure( UINT32 iMapIndex )
|
||||
//
|
||||
// Puts a structure (trees, trucks, etc.) into the world
|
||||
//
|
||||
void PasteStructure1( UINT32 iMapIndex )
|
||||
void PasteStructure1( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelOStructs1;
|
||||
pNumSelList = &iNumOStructs1Selected;
|
||||
@@ -527,7 +531,7 @@ void PasteStructure1( UINT32 iMapIndex )
|
||||
//
|
||||
// Puts a structure (trees, trucks, etc.) into the world
|
||||
//
|
||||
void PasteStructure2( UINT32 iMapIndex )
|
||||
void PasteStructure2( INT32 iMapIndex )
|
||||
{
|
||||
pSelList = SelOStructs2;
|
||||
pNumSelList = &iNumOStructs2Selected;
|
||||
@@ -542,7 +546,7 @@ void PasteStructure2( UINT32 iMapIndex )
|
||||
// This is the main (common) structure pasting function. The above three wrappers are only required because they
|
||||
// each use different selection lists. Other than that, they are COMPLETELY identical.
|
||||
//
|
||||
void PasteStructureCommon( UINT32 iMapIndex )
|
||||
void PasteStructureCommon( INT32 iMapIndex )
|
||||
{
|
||||
UINT32 fHeadType;
|
||||
UINT16 usUseIndex;
|
||||
@@ -550,7 +554,7 @@ void PasteStructureCommon( UINT32 iMapIndex )
|
||||
INT32 iRandSelIndex;
|
||||
BOOLEAN fOkayToAdd;
|
||||
|
||||
if ( iMapIndex < 0x8000 )
|
||||
if ( iMapIndex < 0x80000000 )
|
||||
{
|
||||
/*
|
||||
if ( gpWorldLevelData[ iMapIndex ].pStructHead != NULL )
|
||||
@@ -563,7 +567,7 @@ void PasteStructureCommon( UINT32 iMapIndex )
|
||||
fDoPaste = TRUE;
|
||||
}
|
||||
*/
|
||||
if ( /*fDoPaste &&*/ iMapIndex < 0x8000 )
|
||||
if ( /*fDoPaste &&*/ iMapIndex < 0x80000000 )
|
||||
{
|
||||
iRandSelIndex = GetRandomSelection( );
|
||||
if ( iRandSelIndex == -1 )
|
||||
@@ -577,7 +581,7 @@ void PasteStructureCommon( UINT32 iMapIndex )
|
||||
usUseObjIndex = (UINT16)pSelList[ iRandSelIndex ].uiObject;
|
||||
|
||||
// Check with Structure Database (aka ODB) if we can put the object here!
|
||||
fOkayToAdd = OkayToAddStructureToWorld( (INT16)iMapIndex, 0, gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef, INVALID_STRUCTURE_ID );
|
||||
fOkayToAdd = OkayToAddStructureToWorld( iMapIndex, 0, gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef, INVALID_STRUCTURE_ID );
|
||||
if ( fOkayToAdd || (gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef == NULL) )
|
||||
{
|
||||
//dnl Remove existing structure before adding the same, seems to solve problem with stacking but still need test to be sure that is not removed something what should stay
|
||||
@@ -591,7 +595,7 @@ void PasteStructureCommon( UINT32 iMapIndex )
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( CurrentStruct == ERASE_TILE && iMapIndex < 0x8000 )
|
||||
else if ( CurrentStruct == ERASE_TILE && iMapIndex < 0x80000000 )
|
||||
{
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTOSTRUCT, LASTOSTRUCT );
|
||||
RemoveAllShadowsOfTypeRange( iMapIndex, FIRSTSHADOW, LASTSHADOW );
|
||||
@@ -604,7 +608,7 @@ void PasteStructureCommon( UINT32 iMapIndex )
|
||||
//
|
||||
// Places a river bank or cliff into the world
|
||||
//
|
||||
void PasteBanks( UINT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace)
|
||||
void PasteBanks( INT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace)
|
||||
{
|
||||
BOOLEAN fDoPaste = FALSE;
|
||||
UINT16 usUseIndex;
|
||||
@@ -617,7 +621,7 @@ void PasteBanks( UINT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace)
|
||||
usUseIndex = pSelList[ iCurBank ].usIndex;
|
||||
usUseObjIndex = (UINT16)pSelList[ iCurBank ].uiObject;
|
||||
|
||||
if ( iMapIndex < 0x8000 )
|
||||
if ( iMapIndex < 0x80000000 )
|
||||
{
|
||||
fDoPaste = TRUE;
|
||||
|
||||
@@ -663,7 +667,7 @@ void PasteBanks( UINT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace)
|
||||
}
|
||||
}
|
||||
|
||||
void PasteRoads( UINT32 iMapIndex )
|
||||
void PasteRoads( INT32 iMapIndex )
|
||||
{
|
||||
UINT16 usUseIndex;
|
||||
|
||||
@@ -681,7 +685,7 @@ void PasteRoads( UINT32 iMapIndex )
|
||||
// Puts a ground texture in the world. Ground textures are then "smoothed" in order to blend the edges with one
|
||||
// another. The current drawing brush also affects this function.
|
||||
//
|
||||
void PasteTexture( UINT32 iMapIndex )
|
||||
void PasteTexture( INT32 iMapIndex )
|
||||
{
|
||||
ChooseWeightedTerrainTile(); //Kris
|
||||
PasteTextureCommon( iMapIndex );
|
||||
@@ -694,13 +698,13 @@ void PasteTexture( UINT32 iMapIndex )
|
||||
// one tile, then the above function will call this one and indicate that they should all be placed into the undo
|
||||
// stack as the same undo command.
|
||||
//
|
||||
void PasteTextureCommon( UINT32 iMapIndex )
|
||||
void PasteTextureCommon( INT32 iMapIndex )
|
||||
{
|
||||
UINT8 ubLastHighLevel;
|
||||
UINT16 usTileIndex;
|
||||
//UINT16 Dummy;
|
||||
|
||||
if ( CurrentPaste != NO_TILE && iMapIndex < 0x8000 )
|
||||
if ( CurrentPaste != NO_TILE && iMapIndex < 0x80000000 )
|
||||
{
|
||||
|
||||
// Set undo, then set new
|
||||
@@ -743,7 +747,7 @@ void PasteTextureCommon( UINT32 iMapIndex )
|
||||
}
|
||||
else
|
||||
{
|
||||
PasteTextureEx( (INT16)iMapIndex, CurrentPaste );
|
||||
PasteTextureEx( iMapIndex, CurrentPaste );
|
||||
SmoothTerrainRadius( iMapIndex, CurrentPaste, 1, TRUE );
|
||||
}
|
||||
}
|
||||
@@ -756,7 +760,7 @@ void PasteTextureCommon( UINT32 iMapIndex )
|
||||
// Some ground textures should be placed "above" others. That is, grass needs to be placed "above" sand etc.
|
||||
// This function performs the appropriate actions.
|
||||
//
|
||||
void PasteHigherTexture( UINT32 iMapIndex, UINT32 fNewType )
|
||||
void PasteHigherTexture( INT32 iMapIndex, UINT32 fNewType )
|
||||
{
|
||||
UINT16 NewTile;
|
||||
UINT8 ubLastHighLevel;
|
||||
@@ -776,7 +780,7 @@ void PasteHigherTexture( UINT32 iMapIndex, UINT32 fNewType )
|
||||
//return;
|
||||
|
||||
|
||||
if ( iMapIndex < 0x8000 && AnyHeigherLand( iMapIndex, fNewType, &ubLastHighLevel ))
|
||||
if ( iMapIndex < 0x80000000 && AnyHeigherLand( iMapIndex, fNewType, &ubLastHighLevel ))
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
|
||||
@@ -795,7 +799,7 @@ void PasteHigherTexture( UINT32 iMapIndex, UINT32 fNewType )
|
||||
MemFree( puiDeletedTypes );
|
||||
|
||||
}
|
||||
else if ( iMapIndex < 0x8000 )
|
||||
else if ( iMapIndex < 0x80000000 )
|
||||
{
|
||||
AddToUndoList( iMapIndex );
|
||||
|
||||
@@ -821,9 +825,9 @@ void PasteHigherTexture( UINT32 iMapIndex, UINT32 fNewType )
|
||||
//
|
||||
BOOLEAN PasteHigherTextureFromRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ubRadius )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT32 sTop, sBottom;
|
||||
INT32 sLeft, sRight;
|
||||
INT32 cnt1, cnt2;
|
||||
INT32 iNewIndex;
|
||||
INT32 iXPos,iYPos;
|
||||
|
||||
@@ -836,19 +840,19 @@ BOOLEAN PasteHigherTextureFromRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 u
|
||||
iXPos = (iMapIndex % WORLD_COLS);
|
||||
iYPos = (iMapIndex - iXPos) / WORLD_COLS;
|
||||
|
||||
if ( (iXPos + (INT32)sLeft) < 0 )
|
||||
sLeft = (INT16)(-iXPos);
|
||||
if ( (iXPos + sLeft) < 0 )
|
||||
sLeft = (-iXPos);
|
||||
|
||||
if ( (iXPos + (INT32)sRight) >= WORLD_COLS )
|
||||
sRight = (INT16)(WORLD_COLS - iXPos - 1);
|
||||
if ( (iXPos + sRight) >= WORLD_COLS )
|
||||
sRight = (WORLD_COLS - iXPos - 1);
|
||||
|
||||
if ( (iYPos + (INT32)sTop) >= WORLD_ROWS )
|
||||
sTop = (INT16)(WORLD_ROWS - iYPos - 1);
|
||||
if ( (iYPos + sTop) >= WORLD_ROWS )
|
||||
sTop = (WORLD_ROWS - iYPos - 1);
|
||||
|
||||
if ( (iYPos + (INT32)sBottom) < 0 )
|
||||
sBottom = (INT16)(-iYPos);
|
||||
if ( (iYPos + sBottom) < 0 )
|
||||
sBottom = (-iYPos);
|
||||
|
||||
if ( iMapIndex >= 0x8000 )
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return (FALSE);
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
@@ -868,7 +872,7 @@ BOOLEAN PasteHigherTextureFromRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 u
|
||||
//---------------------------------------------------------------------------------------------------------------
|
||||
// PasteExistingTexture
|
||||
//
|
||||
BOOLEAN PasteExistingTexture( UINT32 iMapIndex, UINT16 usIndex )
|
||||
BOOLEAN PasteExistingTexture( INT32 iMapIndex, UINT16 usIndex )
|
||||
{
|
||||
UINT32 uiNewType;
|
||||
UINT16 usNewIndex;
|
||||
@@ -880,7 +884,7 @@ BOOLEAN PasteExistingTexture( UINT32 iMapIndex, UINT16 usIndex )
|
||||
// - remove what was top-most
|
||||
// - re-adjust the world to reflect missing top-most peice
|
||||
|
||||
if ( iMapIndex >= 0x8000 )
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return ( FALSE );
|
||||
|
||||
//if ( TypeRangeExistsInLandLayer( iMapIndex, FIRSTFLOOR, LASTFLOOR, &Dummy ) )
|
||||
@@ -917,9 +921,9 @@ BOOLEAN PasteExistingTexture( UINT32 iMapIndex, UINT16 usIndex )
|
||||
//
|
||||
BOOLEAN PasteExistingTextureFromRadius( INT32 iMapIndex, UINT16 usIndex, UINT8 ubRadius )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT32 sTop, sBottom;
|
||||
INT32 sLeft, sRight;
|
||||
INT32 cnt1, cnt2;
|
||||
INT32 iNewIndex;
|
||||
INT32 leftmost;
|
||||
|
||||
@@ -929,7 +933,7 @@ BOOLEAN PasteExistingTextureFromRadius( INT32 iMapIndex, UINT16 usIndex, UINT8 u
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
if ( iMapIndex >= 0x8000 )
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return ( FALSE );
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
@@ -963,9 +967,9 @@ BOOLEAN PasteExistingTextureFromRadius( INT32 iMapIndex, UINT16 usIndex, UINT8 u
|
||||
BOOLEAN SetLowerLandIndexWithRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ubRadius, BOOLEAN fReplace )
|
||||
{
|
||||
UINT16 usTempIndex;
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT32 sTop, sBottom;
|
||||
INT32 sLeft, sRight;
|
||||
INT32 cnt1, cnt2;
|
||||
INT32 iNewIndex;
|
||||
BOOLEAN fDoPaste = FALSE;
|
||||
INT32 leftmost;
|
||||
@@ -981,7 +985,7 @@ BOOLEAN SetLowerLandIndexWithRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ub
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
if ( iMapIndex >= 0x8000 )
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return ( FALSE );
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
@@ -1064,7 +1068,7 @@ BOOLEAN SetLowerLandIndexWithRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ub
|
||||
}
|
||||
|
||||
// ATE FIXES
|
||||
void PasteTextureEx( INT16 sGridNo, UINT16 usType )
|
||||
void PasteTextureEx( INT32 sGridNo, UINT16 usType )
|
||||
{
|
||||
UINT16 usIndex;
|
||||
UINT8 ubTypeLevel;
|
||||
@@ -1094,11 +1098,11 @@ void PasteTextureEx( INT16 sGridNo, UINT16 usType )
|
||||
}
|
||||
|
||||
|
||||
void PasteTextureFromRadiusEx( INT16 sGridNo, UINT16 usType, UINT8 ubRadius )
|
||||
void PasteTextureFromRadiusEx( INT32 sGridNo, UINT16 usType, UINT8 ubRadius )
|
||||
{
|
||||
INT16 sTop, sBottom;
|
||||
INT16 sLeft, sRight;
|
||||
INT16 cnt1, cnt2;
|
||||
INT32 sTop, sBottom;
|
||||
INT32 sLeft, sRight;
|
||||
INT32 cnt1, cnt2;
|
||||
INT32 iNewIndex;
|
||||
INT32 leftmost;
|
||||
|
||||
@@ -1108,7 +1112,7 @@ void PasteTextureFromRadiusEx( INT16 sGridNo, UINT16 usType, UINT8 ubRadius )
|
||||
sLeft = - ubRadius;
|
||||
sRight = ubRadius;
|
||||
|
||||
if ( sGridNo >= 0x8000 )
|
||||
if ( sGridNo >= 0x80000000 )
|
||||
return;
|
||||
|
||||
for( cnt1 = sBottom; cnt1 <= sTop; cnt1++ )
|
||||
@@ -1132,6 +1136,377 @@ void PasteTextureFromRadiusEx( INT16 sGridNo, UINT16 usType, UINT8 ubRadius )
|
||||
return;
|
||||
}
|
||||
|
||||
/************** Start of New Definition for Cliff tiles **************/
|
||||
//dnl ch3 210909
|
||||
#define FIRSTCLIFFSNUMBER (FIRSTCLIFF17-FIRSTCLIFF1+1)
|
||||
#define FIRSTCLIFFSHANGNUMBER (FIRSTCLIFFHANG17-FIRSTCLIFFHANG1+1)
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubNumberOfTiles;
|
||||
RelTileLoc TileLocData[256];
|
||||
}CLIFF_OFFSET_DATA;
|
||||
|
||||
CLIFF_OFFSET_DATA CliffOffsetData[FIRSTCLIFFSNUMBER]=
|
||||
{
|
||||
{11, -6,-7, -5,-7, -6,-6, -4,-6, -3,-5, -2,-4, -1,-3, -1,-2, -1,-1, -1, 0, 0, 0 },//FIRSTCLIFF1
|
||||
{10, -7,-6, -7,-5, -6,-4, -5,-3, -4,-2, -3,-1, -2,-1, -1,-1, 0,-1, 0, 0 },//FIRSTCLIFF2
|
||||
{ 6, 3,-3, 2,-2, 0,-1, 1,-1, 2,-1, 0, 0 },//FIRSTCLIFF3
|
||||
{ 6, 2,-3, 3,-3, 0,-2, 1,-2, 0,-1, 0, 0 },//FIRSTCLIFF4
|
||||
{ 5, 0,-4, 0,-3, 0,-2, 0,-1, 0, 0 },//FIRSTCLIFF5
|
||||
{ 7, 0,-4, 1,-3, 1,-2, 0,-1, 1,-1, 0, 0, 1, 0 },//FIRSTCLIFF6
|
||||
{ 8, -4,-1, -3,-1, -2,-1, -1,-1, -4,0, -3, 0, -2, 0, -1, 0 },//FIRSTCLIFF7
|
||||
{ 6, -4,-1, -3,-1, -2,-1, -1,-1, -4, 0, 0, 0 },//FIRSTCLIFF8
|
||||
{ 7, 2,-3, 3,-3, 1,-2, 2,-2, 0,-1, 1,-1, 0, 0 },//FIRSTCLIFF9
|
||||
{ 5, -4, 0, -3, 0, -2, 0, -1, 0, 0, 0 },//FIRSTCLIFF10
|
||||
{ 7, -2,-5, -2,-4, -1,-4, 0,-3, 0,-2, 0,-1, 0, 0 },//FIRSTCLIFF11
|
||||
{ 4, -2,-2, -2,-1, -1, 0, 0, 0 },//FIRSTCLIFF12
|
||||
{ 6, -5,-2, -4,-2, -3,-1, -2, 0, -1, 0, 0, 0 },//FIRSTCLIFF13
|
||||
{ 4, -2,-2, -1,-2, 0,-1, 0, 0 },//FIRSTCLIFF14
|
||||
{10, -6,-7, -5,-7, -6,-6, -4,-6, -3,-5, -2,-4, -1,-3, -1,-2, -1,-1, -1, 0 },//FIRSTCLIFF15
|
||||
{10, -7,-6, -7,-5, -6,-4, -5,-3, -4,-2, -3,-1, -2,-1, -1,-1, 0,-1, 0, 0 },//FIRSTCLIFF16
|
||||
{ 5, 0,-4, 0,-3, 0,-2, 0,-1, 0, 0 },//FIRSTCLIFF17
|
||||
};
|
||||
|
||||
UINT8 GetNumberOfCliffTiles(UINT16 fType, UINT16 usIndex)
|
||||
{
|
||||
if(fType == FIRSTCLIFF)
|
||||
return(CliffOffsetData[usIndex-FIRSTCLIFF1].ubNumberOfTiles);
|
||||
else if(fType == FIRSTCLIFFHANG)
|
||||
return(CliffOffsetData[usIndex-FIRSTCLIFFHANG1].ubNumberOfTiles);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
|
||||
INT16 CountCliffOffset(UINT16 fType, UINT16 usIndex, UINT8 ubLoop)
|
||||
{
|
||||
if(fType == FIRSTCLIFF)
|
||||
return(CliffOffsetData[usIndex-FIRSTCLIFF1].TileLocData[ubLoop].bTileOffsetX + CliffOffsetData[usIndex-FIRSTCLIFF1].TileLocData[ubLoop].bTileOffsetY * WORLD_COLS);
|
||||
else if(fType == FIRSTCLIFFHANG)
|
||||
return(CliffOffsetData[usIndex-FIRSTCLIFFHANG1].TileLocData[ubLoop].bTileOffsetX + CliffOffsetData[usIndex-FIRSTCLIFFHANG1].TileLocData[ubLoop].bTileOffsetY * WORLD_COLS);
|
||||
else
|
||||
return(0);
|
||||
}
|
||||
|
||||
enum CliffRaise
|
||||
{
|
||||
RAISE_NONE, //MAPELEMENT_RAISE_LAND_NONE
|
||||
RAISE_START,//MAPELEMENT_RAISE_LAND_START
|
||||
RAISE_END, //MAPELEMENT_RAISE_LAND_END
|
||||
RAISE_BOTH, //(MAPELEMENT_RAISE_LAND_START | MAPELEMENT_RAISE_LAND_END)
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubNumberOfTiles;
|
||||
UINT8 ubTileRaise[256];
|
||||
}CLIFF_RAISE_DATA;
|
||||
|
||||
CLIFF_RAISE_DATA CliffRaiseData[FIRSTCLIFFSNUMBER+FIRSTCLIFFSHANGNUMBER]=
|
||||
{
|
||||
{11, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2 },//FIRSTCLIFF1
|
||||
{10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF2
|
||||
{ 6, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF3
|
||||
{ 6, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF4
|
||||
{ 5, 1, 1, 1, 1, 1 },//FIRSTCLIFF5
|
||||
{ 7, 1, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF6
|
||||
{ 7, 1, 1, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF7
|
||||
{ 6, 1, 1, 1, 2/*1*/, 1, 2 },//FIRSTCLIFF8
|
||||
{ 7, 1, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF9
|
||||
{ 5, 2/*1*/, 1, 1, 1, 1 },//FIRSTCLIFF10
|
||||
{ 7, 2, 2, 2, 2, 2, 2, 2 },//FIRSTCLIFF11
|
||||
{ 4, 2, 2, 2, 2 },//FIRSTCLIFF12
|
||||
{ 6, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF13
|
||||
{ 4, 1, 1, 1, 1 },//FIRSTCLIFF14
|
||||
{10, 1, 2, 1, 2, 2, 2, 2, 2, 2, 2 },//FIRSTCLIFF15
|
||||
{10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 },//FIRSTCLIFF16
|
||||
{ 5, 1, 1, 1, 1, 1 },//FIRSTCLIFF17
|
||||
|
||||
{11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },//FIRSTCLIFFHANG1
|
||||
{10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },//FIRSTCLIFFHANG2
|
||||
{ 6, 2, 2, 2, 2, 2, 2 },//FIRSTCLIFFHANG3
|
||||
{ 6, 2, 2, 2, 2, 2, 2 },//FIRSTCLIFFHANG4
|
||||
{ 5, 2, 2, 2, 2, 2 },//FIRSTCLIFFHANG5
|
||||
{ 7, 2, 2, 2, 2, 2, 2, 2 },//FIRSTCLIFFHANG6
|
||||
{ 7, 0, 0, 0, 0, 2, 2, 2 },//FIRSTCLIFFHANG7
|
||||
{ 6, 2, 2, 2, 2, 2, 0 },//FIRSTCLIFFHANG8
|
||||
{ 7, 2, 2, 2, 2, 2, 2, 0 },//FIRSTCLIFFHANG9
|
||||
{ 5, 2, 2, 2, 2, 2 },//FIRSTCLIFFHANG10
|
||||
{ 7, 0, 0, 0, 0, 0, 0, 0 },//FIRSTCLIFFHANG11
|
||||
{ 4, 0, 0, 0, 0 },//FIRSTCLIFFHANG12
|
||||
{ 6, 0, 0, 0, 0, 0, 0 },//FIRSTCLIFFHANG13
|
||||
{ 4, 0, 0, 0, 0 },//FIRSTCLIFFHANG14
|
||||
{10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },//FIRSTCLIFFHANG15
|
||||
{10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },//FIRSTCLIFFHANG16
|
||||
{ 5, 2, 2, 2, 2, 2 },//FIRSTCLIFFHANG17
|
||||
};
|
||||
|
||||
UINT16 GetCliffRaiseData(UINT16 fType, UINT16 usIndex, UINT8 ubLoop)
|
||||
{
|
||||
UINT8 ubTileRaise;
|
||||
UINT16 uiFlags;
|
||||
|
||||
if(fType == FIRSTCLIFF)
|
||||
ubTileRaise = CliffRaiseData[usIndex-FIRSTCLIFF1].ubTileRaise[ubLoop];//return(CliffRaiseData[usIndex].ubTileRaise[ubLoop]);
|
||||
else if(fType == FIRSTCLIFFHANG)
|
||||
ubTileRaise = CliffRaiseData[FIRSTCLIFFSNUMBER+usIndex-FIRSTCLIFFHANG1].ubTileRaise[ubLoop];//return(CliffRaiseData[FIRSTCLIFFSNUMBER+usIndex].ubTileRaise[ubLoop]);
|
||||
else
|
||||
return(0);
|
||||
switch(ubTileRaise)
|
||||
{
|
||||
case RAISE_START:
|
||||
uiFlags = MAPELEMENT_RAISE_LAND_START;
|
||||
break;
|
||||
case RAISE_END:
|
||||
uiFlags = MAPELEMENT_RAISE_LAND_END;
|
||||
break;
|
||||
case RAISE_BOTH:
|
||||
uiFlags = MAPELEMENT_RAISE_LAND_START | MAPELEMENT_RAISE_LAND_END;
|
||||
break;
|
||||
default:
|
||||
uiFlags = 0;
|
||||
}
|
||||
return(uiFlags);
|
||||
}
|
||||
|
||||
void CreateCliffsDefinition(void)
|
||||
{
|
||||
INT32 i;
|
||||
UINT32 uiBytesRead, uiBytesWrite;
|
||||
HWFILE hFile;
|
||||
STR8 szFileName = "TILESETS\\0\\l_cliff.JSD";
|
||||
STRUCTURE_FILE_HEADER CliffHeader;
|
||||
AuxObjectData CliffData[FIRSTCLIFFSNUMBER];
|
||||
hFile = FileOpen(szFileName, FILE_ACCESS_READ, FALSE);
|
||||
Assert(hFile);
|
||||
FileRead(hFile, &CliffHeader, sizeof(STRUCTURE_FILE_HEADER), &uiBytesRead);
|
||||
FileRead(hFile, &CliffData, FIRSTCLIFFSNUMBER*sizeof(AuxObjectData), &uiBytesRead);
|
||||
FileClose(hFile);
|
||||
hFile = FileOpen(szFileName, FILE_ACCESS_WRITE, FALSE);
|
||||
Assert(hFile);
|
||||
for(i=0; i<FIRSTCLIFFSNUMBER; i++)
|
||||
{
|
||||
CliffData[i].ubNumberOfTiles = CliffOffsetData[i].ubNumberOfTiles;
|
||||
if(i == 0)
|
||||
CliffData[i].usTileLocIndex = 0;
|
||||
else
|
||||
CliffData[i].usTileLocIndex = CliffData[i-1].ubNumberOfTiles + CliffData[i-1].usTileLocIndex;
|
||||
}
|
||||
CliffHeader.usNumberOfImageTileLocsStored = CliffData[i-1].ubNumberOfTiles + CliffData[i-1].usTileLocIndex;
|
||||
FileWrite(hFile, &CliffHeader, sizeof(STRUCTURE_FILE_HEADER), &uiBytesWrite);
|
||||
FileWrite(hFile, &CliffData, FIRSTCLIFFSNUMBER*sizeof(AuxObjectData), &uiBytesWrite);
|
||||
for(int i=0; i<FIRSTCLIFFSNUMBER; i++)
|
||||
FileWrite(hFile, CliffOffsetData[i].TileLocData, CliffOffsetData[i].ubNumberOfTiles*sizeof(RelTileLoc), &uiBytesWrite);
|
||||
FileClose(hFile);
|
||||
}
|
||||
|
||||
void RaiseWorldLand(void)
|
||||
{
|
||||
//dnl ch56 141009
|
||||
INT32 cnt, sTempGridNo, iNumberOfRaises;
|
||||
LEVELNODE *pStruct;
|
||||
TILE_ELEMENT *pTileElement;
|
||||
UINT16 usIndex;
|
||||
UINT16 fType;
|
||||
UINT8 ubLoop;
|
||||
|
||||
for(cnt=0; cnt<WORLD_MAX; cnt++)
|
||||
{
|
||||
L02: //remove any FIRSTCLIFFHANG if on same tile already exist FIRSTCLIFF
|
||||
pStruct = gpWorldLevelData[cnt].pStructHead;
|
||||
fType = FIRSTTEXTURE;
|
||||
usIndex = FIRSTTEXTURE1;
|
||||
while(pStruct)
|
||||
{
|
||||
pTileElement = &gTileDatabase[pStruct->usIndex];
|
||||
if(pTileElement->fType == FIRSTCLIFF)
|
||||
fType = pTileElement->fType;
|
||||
else
|
||||
if(pTileElement->fType == FIRSTCLIFFHANG)
|
||||
usIndex = pStruct->usIndex;
|
||||
pStruct = pStruct->pNext;
|
||||
}
|
||||
if(fType != FIRSTTEXTURE && usIndex != FIRSTTEXTURE1)
|
||||
{
|
||||
RemoveStruct(cnt, usIndex);
|
||||
goto L02;
|
||||
}
|
||||
gpWorldLevelData[cnt].uiFlags &= (~MAPELEMENT_RAISE_LAND_START);
|
||||
gpWorldLevelData[cnt].uiFlags &= (~MAPELEMENT_RAISE_LAND_END);
|
||||
// Get Structure levelnode
|
||||
pStruct = gpWorldLevelData[cnt].pStructHead;
|
||||
gpWorldLevelData[cnt].sHeight=0;
|
||||
while(pStruct)
|
||||
{
|
||||
// Skip cached tiles
|
||||
if(pStruct->usIndex >= NUMBEROFTILES)
|
||||
{
|
||||
pStruct = pStruct->pNext;
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
// Old way which requires new "TILESETS\\0\\l_cliff.JSD" created with CreateCliffsDefinition()
|
||||
pTileElement = &gTileDatabase[pStruct->usIndex];
|
||||
fType = pTileElement->fType;
|
||||
if(pTileElement->fType == FIRSTCLIFFHANG)// for use in middle cliff construction
|
||||
{
|
||||
pTileElement = &gTileDatabase[pStruct->usIndex+(FIRSTCLIFF17-FIRSTCLIFF1+1)];// to get FIRSTCLIFF data, because there are no definition for FIRSTCLIFFHANG data (each FIRSTCLIFF has proper FIRSTCLIFFHANG and FIRSTCLIFFSHADOW)
|
||||
goto L01;
|
||||
}
|
||||
if(pTileElement->fType == FIRSTCLIFF)
|
||||
{
|
||||
L01:
|
||||
usIndex = pStruct->usIndex;
|
||||
// DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("Cliff found at count=%d",cnt));
|
||||
if(pTileElement->ubNumberOfTiles > 1)
|
||||
{
|
||||
// DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("Cliff has %d children", pTileElement->ubNumberOfTiles));
|
||||
for(ubLoop=0; ubLoop<pTileElement->ubNumberOfTiles; ubLoop++)
|
||||
{
|
||||
sTempGridNo = cnt + pTileElement->pTileLocData[ubLoop].bTileOffsetX + pTileElement->pTileLocData[ubLoop].bTileOffsetY * WORLD_COLS;
|
||||
// Check for valid gridno
|
||||
if(OutOfBounds(cnt, sTempGridNo))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
gpWorldLevelData[sTempGridNo].uiFlags |= GetCliffRaiseData(fType, usIndex, ubLoop);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
if(pStruct->usIndex >= FIRSTCLIFFHANG1 && pStruct->usIndex <= FIRSTCLIFF17)
|
||||
{
|
||||
usIndex = pStruct->usIndex;
|
||||
fType = FIRSTCLIFFHANG;
|
||||
if(pStruct->usIndex >= FIRSTCLIFF1)
|
||||
fType = FIRSTCLIFF;
|
||||
for(ubLoop=0; ubLoop<GetNumberOfCliffTiles(fType, usIndex); ubLoop++)
|
||||
{
|
||||
sTempGridNo = cnt + CountCliffOffset(fType, usIndex, ubLoop);
|
||||
if(OutOfBounds(cnt, sTempGridNo))// Check for valid gridno
|
||||
continue;
|
||||
gpWorldLevelData[sTempGridNo].uiFlags |= GetCliffRaiseData(fType, usIndex, ubLoop);
|
||||
}
|
||||
}
|
||||
pStruct = pStruct->pNext;
|
||||
}
|
||||
}
|
||||
//HighGroundDebug();
|
||||
|
||||
// Edge conditions for eastern region of map
|
||||
// Visible y have values from 4 to 79, so correction +0 for SE corner, and +4 for NE corner, visible x goes from 82 to 157
|
||||
for(int y=(WORLD_ROWS/2-1 +0); y>=0 +4; y--)
|
||||
{
|
||||
// -2 correction because there are maps where cliffs are not place exactly on maps edges, but maybe this condition is not quite precise
|
||||
for(int x=y+ WORLD_COLS/2 -2; x<WORLD_COLS; x++)
|
||||
{
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START) || (gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
{
|
||||
// If on (x-1, y-1) exist rised element then skip this one becasue he will rise map
|
||||
if((gpWorldLevelData[x-1+(y-1)*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START) || (gpWorldLevelData[x-1+(y-1)*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
break;
|
||||
for(int yy=0; yy<y; yy++)
|
||||
for(int xx=x; xx<WORLD_COLS; xx++)
|
||||
gpWorldLevelData[xx+yy*WORLD_COLS].uiFlags = gpWorldLevelData[xx+y*WORLD_COLS].uiFlags;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//HighGroundDebug();
|
||||
|
||||
// Edge conditions for northern region of map
|
||||
// Visible x,y have values from 4 to 81, so correction +2 for NW corner, and +4 for NE corner
|
||||
for(int y=(WORLD_ROWS/2-1 +2); y>=0 +4; y--)
|
||||
{
|
||||
// x depends on current y, and extra +4 because visible area begins from 4, x>=0 because copy goes from visible map edge to the end of northern part of map
|
||||
for(int x=(WORLD_COLS/2-1 +2 -y) +4; x>=0; x--)
|
||||
{
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START) || (gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
{
|
||||
// If on (x-1, y-1) exist rised element then skip this one becasue he will rise map
|
||||
if((gpWorldLevelData[x+1+(y-1)*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START) || (gpWorldLevelData[x+1+(y-1)*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
break;
|
||||
// Find first appearance of MAPELEMENT_RAISE_LAND_END and from them goes copy entire unvisible row
|
||||
for(x; x>=0; x--)
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
break;
|
||||
for(int yy=0; yy<y; yy++)
|
||||
for(int xx=x; xx>=0; xx--)
|
||||
gpWorldLevelData[xx+yy*WORLD_COLS].uiFlags = gpWorldLevelData[xx+y*WORLD_COLS].uiFlags;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//HighGroundDebug();
|
||||
|
||||
//RaiseLevelDebug(0);
|
||||
for(int y=0; y<WORLD_ROWS; y++)
|
||||
{
|
||||
iNumberOfRaises=0;
|
||||
for(int x=0; x<WORLD_COLS; x++)// Scaning from left to right
|
||||
{
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
{
|
||||
if(x>0 && !(gpWorldLevelData[(x-1)+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
{
|
||||
if(iNumberOfRaises < 3)
|
||||
iNumberOfRaises++;
|
||||
}
|
||||
}
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START))
|
||||
{
|
||||
//RaiseLevelDebug(1, (x+y*WORLD_COLS), iNumberOfRaises);
|
||||
gpWorldLevelData[x+y*WORLD_COLS].sHeight = iNumberOfRaises * WORLD_CLIFF_HEIGHT;
|
||||
if(x>0 && !(gpWorldLevelData[(x-1)+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START))
|
||||
{
|
||||
if(iNumberOfRaises)
|
||||
{
|
||||
iNumberOfRaises--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(iNumberOfRaises)
|
||||
{
|
||||
//RaiseLevelDebug(1, (x+y*WORLD_COLS), iNumberOfRaises);
|
||||
gpWorldLevelData[x+y*WORLD_COLS].sHeight = iNumberOfRaises * WORLD_CLIFF_HEIGHT;
|
||||
}
|
||||
}
|
||||
for(int x=WORLD_COLS-1; x>=0; x--)
|
||||
{
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START))
|
||||
{
|
||||
if(x<WORLD_ROWS-1 && !(gpWorldLevelData[(x+1)+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_START))
|
||||
{
|
||||
if(iNumberOfRaises < 3)
|
||||
iNumberOfRaises++;
|
||||
}
|
||||
}
|
||||
if((gpWorldLevelData[x+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
{
|
||||
//RaiseLevelDebug(1, (x+y*WORLD_COLS), iNumberOfRaises);
|
||||
gpWorldLevelData[x+y*WORLD_COLS].sHeight = iNumberOfRaises * WORLD_CLIFF_HEIGHT;
|
||||
if(x<WORLD_ROWS-1 && !(gpWorldLevelData[(x-1)+y*WORLD_COLS].uiFlags & MAPELEMENT_RAISE_LAND_END))
|
||||
{
|
||||
if(iNumberOfRaises)
|
||||
{
|
||||
iNumberOfRaises--;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(iNumberOfRaises)
|
||||
{
|
||||
//RaiseLevelDebug(1, (x+y*WORLD_COLS), iNumberOfRaises);
|
||||
gpWorldLevelData[x+y*WORLD_COLS].sHeight = iNumberOfRaises * WORLD_CLIFF_HEIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
//HighGroundDebug();
|
||||
//RaiseLevelDebug(2);
|
||||
|
||||
fRaiseWorld = TRUE;
|
||||
}
|
||||
/*************** End of New Definition for Cliff tiles ***************/
|
||||
|
||||
// FUNCTION TO GIVE NEAREST GRIDNO OF A CLIFF
|
||||
#define LAND_DROP_1 FIRSTCLIFF1
|
||||
@@ -1139,10 +1514,10 @@ void PasteTextureFromRadiusEx( INT16 sGridNo, UINT16 usType, UINT8 ubRadius )
|
||||
#define LAND_DROP_3 FIRSTCLIFF12
|
||||
#define LAND_DROP_4 FIRSTCLIFF15
|
||||
#define LAND_DROP_5 FIRSTCLIFF8
|
||||
void RaiseWorldLand( )
|
||||
void RaiseWorldLandOld(void)//dnl ch3 230909
|
||||
{
|
||||
INT32 cnt;
|
||||
UINT32 sTempGridNo;
|
||||
INT32 sTempGridNo;
|
||||
LEVELNODE *pStruct;
|
||||
TILE_ELEMENT *pTileElement;
|
||||
BOOLEAN fRaise;
|
||||
@@ -1150,6 +1525,8 @@ void RaiseWorldLand( )
|
||||
BOOLEAN fSomethingRaised = FALSE;
|
||||
UINT8 ubLoop;
|
||||
UINT16 usIndex;
|
||||
BOOLEAN fStopRaise = FALSE;
|
||||
INT32 iCounterA = 0, iCounterB = 0;
|
||||
INT32 iStartNumberOfRaises = 0;
|
||||
INT32 iNumberOfRaises = 0;
|
||||
BOOLEAN fAboutToRaise = FALSE;
|
||||
@@ -1199,7 +1576,7 @@ void RaiseWorldLand( )
|
||||
|
||||
sTempGridNo = cnt + pTileElement->pTileLocData[ubLoop].bTileOffsetX + pTileElement->pTileLocData[ubLoop].bTileOffsetY * WORLD_COLS;
|
||||
// Check for valid gridno
|
||||
if ( OutOfBounds( (INT16)cnt, (INT16)sTempGridNo ) )
|
||||
if ( OutOfBounds( cnt, sTempGridNo ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1398,7 +1775,7 @@ void RaiseWorldLand( )
|
||||
}
|
||||
|
||||
//*/
|
||||
|
||||
fRaiseWorld = TRUE;//dnl ch3 210909
|
||||
}
|
||||
|
||||
void EliminateObjectLayerRedundancy()
|
||||
@@ -1449,8 +1826,3 @@ void EliminateObjectLayerRedundancy()
|
||||
#endif //JA2EDITOR
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+29
-27
@@ -27,45 +27,47 @@ extern UINT16 CurrentStruct;
|
||||
extern UINT32 gDoBanks;
|
||||
extern UINT32 gDoCliffs;
|
||||
|
||||
void EraseMapTile( UINT32 iMapIndex );
|
||||
void QuickEraseMapTile( UINT32 iMapIndex );
|
||||
void DeleteStuffFromMapTile( UINT32 iMapIndex );
|
||||
void EraseMapTile( INT32 iMapIndex );
|
||||
void QuickEraseMapTile( INT32 iMapIndex );
|
||||
void DeleteStuffFromMapTile( INT32 iMapIndex );
|
||||
|
||||
void PasteDebris( UINT32 iMapIndex );
|
||||
void PasteDebris( INT32 iMapIndex );
|
||||
|
||||
void PasteStructure( UINT32 iMapIndex );
|
||||
void PasteStructure1( UINT32 iMapIndex );
|
||||
void PasteStructure2( UINT32 iMapIndex );
|
||||
void PasteStructureCommon( UINT32 iMapIndex );
|
||||
void PasteStructure( INT32 iMapIndex );
|
||||
void PasteStructure1( INT32 iMapIndex );
|
||||
void PasteStructure2( INT32 iMapIndex );
|
||||
void PasteStructureCommon( INT32 iMapIndex );
|
||||
|
||||
void PasteSingleWall( UINT32 iMapIndex );
|
||||
void PasteSingleDoor( UINT32 iMapIndex );
|
||||
void PasteSingleWindow( UINT32 iMapIndex );
|
||||
void PasteSingleRoof( UINT32 iMapIndex );
|
||||
void PasteSingleBrokenWall( UINT32 iMapIndex );
|
||||
void PasteSingleDecoration( UINT32 iMapIndex );
|
||||
void PasteSingleDecal( UINT32 iMapIndex );
|
||||
void PasteSingleFloor( UINT32 iMapIndex );
|
||||
void PasteSingleToilet( UINT32 iMapIndex );
|
||||
void PasteRoomNumber( UINT32 iMapIndex, UINT8 ubRoomNumber );
|
||||
void PasteSingleWall( INT32 iMapIndex );
|
||||
void PasteSingleDoor( INT32 iMapIndex );
|
||||
void PasteSingleWindow( INT32 iMapIndex );
|
||||
void PasteSingleRoof( INT32 iMapIndex );
|
||||
void PasteSingleBrokenWall( INT32 iMapIndex );
|
||||
void PasteSingleDecoration( INT32 iMapIndex );
|
||||
void PasteSingleDecal( INT32 iMapIndex );
|
||||
void PasteSingleFloor( INT32 iMapIndex );
|
||||
void PasteSingleToilet( INT32 iMapIndex );
|
||||
void PasteRoomNumber( INT32 iMapIndex, UINT8 ubRoomNumber );
|
||||
|
||||
void PasteSingleWallCommon( UINT32 iMapIndex );
|
||||
void PasteSingleWallCommon( INT32 iMapIndex );
|
||||
|
||||
UINT16 GetRandomIndexByRange( UINT16 usRangeStart, UINT16 usRangeEnd );
|
||||
UINT16 GetRandomTypeByRange( UINT16 usRangeStart, UINT16 usRangeEnd );
|
||||
|
||||
void PasteFloor( UINT32 iMapIndex, UINT16 usFloorIndex , BOOLEAN fReplace);
|
||||
void PasteFloor( INT32 iMapIndex, UINT16 usFloorIndex , BOOLEAN fReplace);
|
||||
|
||||
void PasteBanks( UINT32 iMapIndex, UINT16 usStructIndex, BOOLEAN fReplace );
|
||||
void PasteRoads( UINT32 iMapIndex );
|
||||
void PasteCliffs( UINT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace);
|
||||
void PasteBanks( INT32 iMapIndex, UINT16 usStructIndex, BOOLEAN fReplace );
|
||||
void PasteRoads( INT32 iMapIndex );
|
||||
void PasteCliffs( INT32 iMapIndex, UINT16 usStructIndex , BOOLEAN fReplace);
|
||||
|
||||
void PasteTexture( UINT32 iMapIndex );
|
||||
void PasteTextureCommon( UINT32 iMapIndex );
|
||||
void PasteTexture( INT32 iMapIndex );
|
||||
void PasteTextureCommon( INT32 iMapIndex );
|
||||
|
||||
void PasteHigherTexture( UINT32 iMapIndex, UINT32 fNewType );
|
||||
void PasteHigherTexture( INT32 iMapIndex, UINT32 fNewType );
|
||||
|
||||
void RaiseWorldLand();
|
||||
//dnl ch3 230909
|
||||
void RaiseWorldLand(void);
|
||||
void RaiseWorldLandOld(void);
|
||||
|
||||
void EliminateObjectLayerRedundancy();
|
||||
|
||||
|
||||
+763
-45
File diff suppressed because it is too large
Load Diff
@@ -73,6 +73,11 @@ extern BOOLEAN gfConfirmExitFirst;
|
||||
extern BOOLEAN gfConfirmExitPending;
|
||||
extern BOOLEAN gfIntendOnEnteringEditor;
|
||||
|
||||
extern BOOLEAN gfVanillaMode;//dnl ch33 160909
|
||||
extern BOOLEAN fRaiseWorld;//dnl ch3 210909
|
||||
extern BOOLEAN fShowHighGround;//dnl ch2 210909
|
||||
void ShowHighGround(INT32 iShowHighGroundCommand);//dnl ch2 210909
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
+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;
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ void RemoveBuildingSectionFromWorld( SGPRect *pSelectRegion );
|
||||
void AddCaveSectionToWorld( SGPRect *pSelectRegion );
|
||||
void RemoveCaveSectionFromWorld( SGPRect *pSelectRegion );
|
||||
|
||||
void EraseBuilding( UINT32 iMapIndex );
|
||||
void RebuildRoof( UINT32 iMapIndex, UINT16 usRoofType );
|
||||
void EraseBuilding( INT32 iMapIndex );
|
||||
void RebuildRoof( INT32 iMapIndex, UINT16 usRoofType );
|
||||
void RebuildRoofUsingFloorInfo( INT32 iMapIndex, UINT16 usRoofType );
|
||||
|
||||
void AddCave( INT32 iMapIndex, UINT16 usIndex );
|
||||
|
||||
@@ -231,9 +231,7 @@ void InitPopupMenu( INT32 iButtonID, UINT8 ubPopupMenuID, UINT8 ubDirection )
|
||||
gPopup.usBottom = usY + usMenuHeight + 1;
|
||||
break;
|
||||
}
|
||||
MSYS_DefineRegion( &popupRegion, 0, 0, 640, 480, MSYS_PRIORITY_HIGHEST,
|
||||
CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
|
||||
MSYS_DefineRegion(&popupRegion, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGHEST, CURSOR_NORMAL, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK);//dnl ch34 090909
|
||||
RenderPopupMenu();
|
||||
}
|
||||
|
||||
|
||||
@@ -1211,7 +1211,7 @@ INT32 GetRandomSelection( void )
|
||||
|
||||
if ( fDontUseRandom )
|
||||
{
|
||||
fDontUseRandom = FALSE;
|
||||
//fDontUseRandom = FALSE;//dnl ch8 210909 this was old way when random was almost always selected, new way is enable/disable through switching with key 'R'
|
||||
return( iCurBank );
|
||||
}
|
||||
|
||||
|
||||
+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
|
||||
|
||||
+6
-6
@@ -14,15 +14,15 @@
|
||||
|
||||
|
||||
void SmoothAllTerrainWorld( void );
|
||||
void SmoothTerrain(int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSmooth );
|
||||
void SmoothTerrain(INT32 GridNo, INT32 origType, UINT16 *piNewTile, BOOLEAN fForceSmooth );
|
||||
|
||||
void SmoothTerrainRadius( UINT32 iMapIndex, UINT32 uiCheckType, UINT8 ubRadius, BOOLEAN fForceSmooth );
|
||||
void SmoothTerrainRadius( INT32 iMapIndex, UINT32 uiCheckType, UINT8 ubRadius, BOOLEAN fForceSmooth );
|
||||
void SmoothTerrainWorld( UINT32 uiCheckType );
|
||||
void SmoothWaterTerrain( int gridno, int origType, UINT16 *piNewTile, BOOLEAN fForceSmooth );
|
||||
void SmoothAllTerrainTypeRadius( UINT32 iMapIndex, UINT8 ubRadius, BOOLEAN fForceSmooth );
|
||||
void SmoothWaterTerrain( INT32 GridNo, INT32 origType, UINT16 *piNewTile, BOOLEAN fForceSmooth );
|
||||
void SmoothAllTerrainTypeRadius( INT32 iMapIndex, UINT8 ubRadius, BOOLEAN fForceSmooth );
|
||||
|
||||
void SmoothExitGrid(int gridno, UINT16 *piNewTile, BOOLEAN fForceSmooth );
|
||||
void SmoothExitGridRadius( INT16 sMapIndex, UINT8 ubRadius );
|
||||
void SmoothExitGrid(INT32 GridNo, UINT16 *piNewTile, BOOLEAN fForceSmooth );
|
||||
void SmoothExitGridRadius( INT32 sMapIndex, UINT8 ubRadius );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user