Brief: //dnl ch80

- Polishing and fixing mapeditor.
Details:
- Add scroll map editor items for mouse wheel.
- Fix selection of mapinfo light and smoothing buttons when switching between taskbars.
- UpdateRoofsView now will hide/show onroof tiles and back roof walls too.
- Fix fake light toggle which now will remain after switching to another taskbar also fix incorrect ambient light saving during toggling fake light with HOME key.
- Finish work on HandleMouseClicksInGameScreen function so most draw functions now are single clicked on same tile element instead rapid burst of events which in some situation create stacking tiles problem during save game.
- Fix incorrect value for exit grids if right click on map element without exit grid, also if changing same exit grid then will update same instead to define next available slot from exit grid array.
- Restricted scroll will now disable scrolling when enter in textbox at mapinfo taskbar for basement levels and for proper radar map creation.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6673 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Kriplo
2013-12-01 22:27:03 +00:00
parent 38be6a389b
commit b2dbc3123b
13 changed files with 371 additions and 394 deletions
+1 -11
View File
@@ -74,10 +74,6 @@ BOOLEAN GetExitGrid( UINT32 usMapIndex, EXITGRID *pExitGrid )
}
pShadow = pShadow->pNext;
}
pExitGrid->ubGotoSectorX = 0;
pExitGrid->ubGotoSectorY = 0;
pExitGrid->ubGotoSectorZ = 0;
pExitGrid->usGridNo = 0;
return FALSE;
}
@@ -126,13 +122,7 @@ void AddExitGridToWorld( INT32 iMapIndex, EXITGRID *pExitGrid )
tail = pShadow;
if( pShadow->uiFlags & LEVELNODE_EXITGRID )
{ //we have found an existing exitgrid in this node, so replace it with the new information.
//<SB>
// pShadow->iExitGridInfo = ConvertExitGridToINT32( pExitGrid );
memcpy(gpExitGrids + guiExitGridsCount, pExitGrid, sizeof(EXITGRID));
pShadow->pExitGridInfo = gpExitGrids + guiExitGridsCount;
guiExitGridsCount++;
//</SB>
//SmoothExitGridRadius( (INT16)iMapIndex, 0 );
memcpy(pShadow->pExitGridInfo, pExitGrid, sizeof(EXITGRID));//dnl ch80 011213
return;
}
pShadow = pShadow->pNext;
+1
View File
@@ -3474,6 +3474,7 @@ extern INT32 giNumberOfTileTypes; //Madd: for variable number of PItems
#define LASTPOINTERS (SELRING - 1)
#define LASTUIELEM (WIREFRAMES - 1) // Change this entry if adding new types to the end
#define LASTTIELSETELEM (GUNS - 1)
#define LASTONROOF (MOCKFLOOR - 1)//dnl ch80 011213
//===========================================================================
+47 -9
View File
@@ -1779,25 +1779,29 @@ void SetStructIndexFlagsFromTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT3
}
BOOLEAN HideStructOfGivenType( INT32 iMapIndex, UINT32 fType, BOOLEAN fHide )
BOOLEAN HideStructOfGivenType(INT32 iMapIndex, UINT32 fType, BOOLEAN fHide)//dnl ch80 011213
{
if ( fHide )
if(fHide)
{
SetRoofIndexFlagsFromTypeRange( iMapIndex, fType, fType, LEVELNODE_HIDDEN );
if(fType >= FIRSTONROOF && fType <= LASTONROOF)
SetOnRoofIndexFlagsFromTypeRange(iMapIndex, fType, fType, LEVELNODE_HIDDEN);
else
SetRoofIndexFlagsFromTypeRange(iMapIndex, fType, fType, LEVELNODE_HIDDEN);
}
else
{
// ONLY UNHIDE IF NOT REAVEALED ALREADY
if ( !(gpWorldLevelData[ iMapIndex ].uiFlags & MAPELEMENT_REVEALED ) )
if(!(gpWorldLevelData[iMapIndex].uiFlags & MAPELEMENT_REVEALED))
{
RemoveRoofIndexFlagsFromTypeRange( iMapIndex, fType, fType, LEVELNODE_HIDDEN );
if(fType >= FIRSTONROOF && fType <= LASTONROOF)
RemoveOnRoofIndexFlagsFromTypeRange(iMapIndex, fType, fType, LEVELNODE_HIDDEN);
else
RemoveRoofIndexFlagsFromTypeRange(iMapIndex, fType, fType, LEVELNODE_HIDDEN);
}
}
return( TRUE );
return(TRUE);
}
void RemoveStructIndexFlagsFromTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags )
{
LEVELNODE *pStruct = NULL;
@@ -1938,7 +1942,10 @@ BOOLEAN RemoveShadow( INT32 iMapIndex, UINT16 usIndex )
{
pOldShadow->pNext = pShadow->pNext;
}
#ifdef JA2EDITOR//dnl ch80 011213
if(pShadow->uiFlags & LEVELNODE_EXITGRID && pShadow->pExitGridInfo)
memset(pShadow->pExitGridInfo, 0, sizeof(EXITGRID));
#endif
// Delete memory assosiated with item
MemFree( pShadow );
guiLevelNodes--;
@@ -3018,6 +3025,37 @@ BOOLEAN RemoveAllOnRoofsOfTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32
return fRetVal;
}
void RemoveOnRoofIndexFlagsFromTypeRange(INT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags)//dnl ch80 011213
{
LEVELNODE *pOnRoof, *pOldOnRoof;
UINT32 fTileType;
pOnRoof = gpWorldLevelData[iMapIndex].pOnRoofHead;
while(pOnRoof && pOnRoof->usIndex != NO_TILE)
{
GetTileType(pOnRoof->usIndex, &fTileType);
pOldOnRoof = pOnRoof;
pOnRoof = pOnRoof->pNext;
if(fTileType >= fStartType && fTileType <= fEndType)
pOldOnRoof->uiFlags &= (~uiFlags);
}
}
void SetOnRoofIndexFlagsFromTypeRange(INT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags)//dnl ch80 011213
{
LEVELNODE *pOnRoof, *pOldOnRoof;
UINT32 fTileType;
pOnRoof = gpWorldLevelData[iMapIndex].pOnRoofHead;
while(pOnRoof && pOnRoof->usIndex != NO_TILE)
{
GetTileType(pOnRoof->usIndex, &fTileType);
pOldOnRoof = pOnRoof;
pOnRoof = pOnRoof->pNext;
if(fTileType >= fStartType && fTileType <= fEndType)
pOldOnRoof->uiFlags |= uiFlags;
}
}
// Topmost layer
// #################################################################
+3 -1
View File
@@ -41,6 +41,8 @@ BOOLEAN RemoveAllOnRoofsOfTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32
void SetAllOnRoofShadeLevels( INT32 iMapIndex, UINT8 ubShadeLevel );
void AdjustAllOnRoofShadeLevels( INT32 iMapIndex, INT8 bShadeDiff );
BOOLEAN RemoveOnRoofFromLevelNode( INT32 iMapIndex, LEVELNODE *pNode );
void RemoveOnRoofIndexFlagsFromTypeRange(INT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags);//dnl ch80 011213
void SetOnRoofIndexFlagsFromTypeRange(INT32 iMapIndex, UINT32 fStartType, UINT32 fEndType, UINT32 uiFlags);//dnl ch80 011213
// Land manipulation functions
@@ -76,7 +78,7 @@ BOOLEAN TypeExistsInStructLayer( INT32 iMapIndex, UINT32 fType, UINT16 *pusStruc
BOOLEAN RemoveAllStructsOfTypeRange( INT32 iMapIndex, UINT32 fStartType, UINT32 fEndType );
BOOLEAN AddWallToStructLayer( INT32 iMapIndex, UINT16 usIndex, BOOLEAN fReplace );
BOOLEAN ReplaceStructIndex( INT32 iMapIndex, UINT16 usOldIndex, UINT16 usNewIndex );
BOOLEAN HideStructOfGivenType( INT32 iMapIndex, UINT32 fType, BOOLEAN fHide );
BOOLEAN HideStructOfGivenType(INT32 iMapIndex, UINT32 fType, BOOLEAN fHide);//dnl ch80 011213
BOOLEAN InsertStructIndex( INT32 iMapIndex, UINT16 usIndex, UINT8 ubLevel );
void SetAllStructShadeLevels( INT32 iMapIndex, UINT8 ubShadeLevel );
void AdjustAllStructShadeLevels( INT32 iMapIndex, INT8 bShadeDiff );