mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- 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
57 lines
2.2 KiB
C++
57 lines
2.2 KiB
C++
#ifndef __EXIT_GRIDS_H
|
|
#define __EXIT_GRIDS_H
|
|
|
|
#include "Fileman.h"
|
|
#include "Worlddef.h"
|
|
|
|
//dnl ch42 250909
|
|
typedef struct
|
|
{
|
|
INT16 sMapIndex;//dnl ch86 170214 not exist in v1.12, add to simplify load
|
|
INT16 usGridNo;
|
|
UINT8 ubGotoSectorX;
|
|
UINT8 ubGotoSectorY;
|
|
UINT8 ubGotoSectorZ;
|
|
}_OLD_EXITGRID;
|
|
|
|
class EXITGRID// For exit grids (object level)
|
|
{
|
|
// If an item pool is also in same gridno, then this would be a separate levelnode in the object level list
|
|
public:
|
|
INT32 iMapIndex;//dnl ch86 170214
|
|
INT32 usGridNo;// Sweet spot for placing mercs in new sector.
|
|
UINT8 ubGotoSectorX;
|
|
UINT8 ubGotoSectorY;
|
|
UINT8 ubGotoSectorZ;
|
|
public:
|
|
EXITGRID() : iMapIndex(-1), usGridNo(0), ubGotoSectorX(1), ubGotoSectorY(1), ubGotoSectorZ(0) {}//dnl ch86 180214
|
|
EXITGRID& operator=(const _OLD_EXITGRID& src);
|
|
BOOLEAN Load(INT8** hBuffer, FLOAT dMajorMapVersion);
|
|
BOOLEAN Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion);
|
|
BOOLEAN Equal(EXITGRID &ExitGrid) { return(!memcmp(&this->usGridNo, &ExitGrid.usGridNo, sizeof(usGridNo)+sizeof(ubGotoSectorX)+sizeof(ubGotoSectorY)+sizeof(ubGotoSectorZ))); }
|
|
};
|
|
|
|
BOOLEAN ExitGridAtGridNo( UINT32 usMapIndex );
|
|
BOOLEAN GetExitGridLevelNode( UINT32 usMapIndex, LEVELNODE **ppLevelNode );
|
|
BOOLEAN GetExitGrid( UINT32 usMapIndex, EXITGRID *pExitGrid );
|
|
|
|
void AddExitGridToWorld( INT32 iMapIndex, EXITGRID *pExitGrid );
|
|
void RemoveExitGridFromWorld( INT32 iMapIndex );
|
|
void TrashExitGridTable(void);//dnl ch86 170214
|
|
//dnl ch42 250909
|
|
void SaveExitGrids(HWFILE hFile, UINT16 usNumExitGrids, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion);
|
|
void LoadExitGrids(INT8** hBuffer, FLOAT dMajorMapVersion);
|
|
|
|
void AttemptToChangeFloorLevel( INT8 bRelativeZLevel );
|
|
|
|
extern EXITGRID gExitGrid;
|
|
extern BOOLEAN gfOverrideInsertionWithExitGrid;
|
|
extern BOOLEAN gfShowExitGrids;//dnl ch86 190214
|
|
|
|
// Finds closest ExitGrid of same type as is at gridno, within a radius. Checks
|
|
// valid paths, destinations, etc.
|
|
INT32 FindGridNoFromSweetSpotCloseToExitGrid( SOLDIERTYPE *pSoldier, INT32 sSweetGridNo, INT8 ubRadius, UINT8 *pubDirection );
|
|
INT32 FindClosestExitGrid( SOLDIERTYPE *pSoldier, INT32 sSrcGridNo, INT8 ubRadius );
|
|
|
|
#endif
|