mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Brief: //dnl ch86
- Fixing mapeditor move building and improving some related mapeditor stuff. Details: - Change the way exit grids are add, remove, save and load through editor, also add undo option for exit grids and you can place unlimited number of them. - Fix incorrect gridno save in temporary map file for bigmap exit grids. - Increase maximum number of light sprite from 256 to 4096 per map. - Using DEL key for QuickEraseMapTile will now erase ItemPool too, and with improved function DeleteStuffFromMapTile will erase light sprites, exit grids and door locks. - Cliff hang tiles used for middle cliffs are now possible to erase with when erase button is on. - Add support for undo door locks, also you can now erase them if erase button is on. - Move building function is completely rewrite and will properly move exit grids, door locks, lights and items too. - Removing unnecessary tiles during copy building is improved too. - Fix undo function for light sprites which now will also store all three types and undo them properly. - Fix CTD situation if tile elements are deleted and after that items too, then undo will crash mapeditor. - Fix spawning of item pool cursors during when adding items. - Fix text glitches over door locks form. - Fix sticky tooltip when loadsave screen or door locks form is active. - High ground marking cursors will not be drawn in invisible map tiles anymore to increase speed and maybe fix some render problems but I doubt it. - Move GLOCK_17_ForUseWithLOS item generation from init.cpp to los.cpp to avoid potential problems if global world items array not set. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7004 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+33
-20
@@ -28,6 +28,10 @@
|
||||
#include "environment.h"
|
||||
#include "Simple Render Utils.h"
|
||||
#include "Road Smoothing.h"
|
||||
//dnl ch86 140214
|
||||
#include "Keys.h"
|
||||
#include "EditorMapInfo.h"
|
||||
#include "EditorItems.h"
|
||||
#endif
|
||||
|
||||
BOOLEAN PasteHigherTextureFromRadius( INT32 iMapIndex, UINT32 uiNewType, UINT8 ubRadius );
|
||||
@@ -60,6 +64,9 @@ void QuickEraseMapTile( INT32 iMapIndex )
|
||||
{
|
||||
if ( iMapIndex >= 0x80000000 )
|
||||
return;
|
||||
if(GetItemPoolFromGround(iMapIndex, &gpItemPool))//dnl ch86 220214
|
||||
while(gpItemPool)
|
||||
DeleteSelectedItem();
|
||||
AddToUndoList( iMapIndex );
|
||||
DeleteStuffFromMapTile( iMapIndex );
|
||||
MarkWorldDirty();
|
||||
@@ -71,26 +78,24 @@ void QuickEraseMapTile( INT32 iMapIndex )
|
||||
//
|
||||
// Common delete function for both QuickEraseMapTile and EraseMapTile
|
||||
//
|
||||
void DeleteStuffFromMapTile( INT32 iMapIndex )
|
||||
void DeleteStuffFromMapTile(INT32 iMapIndex)//dnl ch86 140214
|
||||
{
|
||||
//UINT16 usUseIndex;
|
||||
//UINT16 usType;
|
||||
//UINT32 uiCheckType;
|
||||
//UINT16 usDummy;
|
||||
|
||||
//GetTileType( gpWorldLevelData[ iMapIndex ].pLandHead->usIndex, &uiCheckType );
|
||||
//RemoveLand( iMapIndex, gpWorldLevelData[ iMapIndex ].pLandHead->usIndex );
|
||||
//SmoothTerrainRadius( iMapIndex, uiCheckType, 1, TRUE );
|
||||
|
||||
RemoveExitGridFromWorld( iMapIndex );
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
RemoveAllShadowsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
RemoveAllLandsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
RemoveAllRoofsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
RemoveAllOnRoofsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
RemoveAllTopmostsOfTypeRange( iMapIndex, FIRSTTEXTURE, WIREFRAMES );
|
||||
PasteRoomNumber( iMapIndex, 0 );
|
||||
INT16 sX, sY;
|
||||
ConvertGridNoToXY(iMapIndex, &sX, &sY);
|
||||
for(INT8 bLightType=PRIMETIME_LIGHT; bLightType<ANY_LIGHT; bLightType++)
|
||||
RemoveLight(sX, sY, bLightType);
|
||||
RemoveAllTopmostsOfTypeRange(iMapIndex, ROTATINGKEY, ROTATINGKEY);
|
||||
RemoveDoorInfoFromTable(iMapIndex);
|
||||
RemoveTopmost(iMapIndex, FIRSTPOINTERS8);
|
||||
RemoveExitGridFromWorld(iMapIndex);
|
||||
RemoveAllStructsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
RemoveAllObjectsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
RemoveAllShadowsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
RemoveAllLandsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
RemoveAllRoofsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
RemoveAllOnRoofsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
RemoveAllTopmostsOfTypeRange(iMapIndex, FIRSTTEXTURE, WIREFRAMES);
|
||||
PasteRoomNumber(iMapIndex, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -164,7 +169,7 @@ void EraseMapTile( INT32 iMapIndex )
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, FIRSTROAD, LASTROAD );
|
||||
// Note, for this routine, cliffs are considered a subset of banks
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, ANIOSTRUCT, ANIOSTRUCT );
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTCLIFF, LASTBANKS );
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FIRSTCLIFFHANG, LASTBANKS );//dnl ch86 190214
|
||||
RemoveAllShadowsOfTypeRange( iMapIndex, FIRSTCLIFFSHADOW, LASTCLIFFSHADOW );
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, FIRSTCLIFFHANG, LASTCLIFFHANG );
|
||||
RemoveAllStructsOfTypeRange( iMapIndex, FENCESTRUCT, FENCESTRUCT );
|
||||
@@ -212,6 +217,14 @@ void EraseMapTile( INT32 iMapIndex )
|
||||
case DRAW_MODE_ROADS:
|
||||
RemoveAllObjectsOfTypeRange( iMapIndex, ROADPIECES, ROADPIECES );
|
||||
break;
|
||||
case DRAW_MODE_DOORKEYS://dnl ch86 220214
|
||||
if(FindDoorInfoAtGridNo(iMapIndex))
|
||||
{
|
||||
AddToUndoList(iMapIndex);
|
||||
RemoveDoorInfoFromTable(iMapIndex);
|
||||
RemoveAllTopmostsOfTypeRange(iMapIndex, ROTATINGKEY, ROTATINGKEY);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//DeleteStuffFromMapTile( iMapIndex );
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user