mirror of
https://github.com/huderlem/porymap.git
synced 2026-08-13 04:15:45 -05:00
Allow editing border dimensions
This commit is contained in:
@@ -6,9 +6,12 @@
|
||||
class HistoryItem {
|
||||
public:
|
||||
Blockdata *metatiles;
|
||||
Blockdata *border;
|
||||
int layoutWidth;
|
||||
int layoutHeight;
|
||||
HistoryItem(Blockdata *metatiles, int layoutWidth, int layoutHeight);
|
||||
int borderWidth;
|
||||
int borderHeight;
|
||||
HistoryItem(Blockdata *metatiles, Blockdata *border, int layoutWidth, int layoutHeight, int borderWidth, int borderHeight);
|
||||
~HistoryItem();
|
||||
};
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#define DEFAULT_BORDER_WIDTH 2
|
||||
#define DEFAULT_BORDER_HEIGHT 2
|
||||
|
||||
// Number of metatiles to draw out from edge of map. Could allow modification of this in the future.
|
||||
// porymap will reflect changes to it, but the value is hard-coded in the projects at the moment
|
||||
#define BORDER_DISTANCE 6
|
||||
|
||||
class Map : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -65,7 +69,8 @@ public:
|
||||
int getBorderHeight();
|
||||
QPixmap render(bool ignoreCache, MapLayout * fromLayout = nullptr);
|
||||
QPixmap renderCollision(qreal opacity, bool ignoreCache);
|
||||
bool blockChanged(int, Blockdata*);
|
||||
bool mapBlockChanged(int i, Blockdata * cache);
|
||||
bool borderBlockChanged(int i, Blockdata * cache);
|
||||
void cacheBlockdata();
|
||||
void cacheCollision();
|
||||
Block *getBlock(int x, int y);
|
||||
@@ -82,12 +87,14 @@ public:
|
||||
void addEvent(Event*);
|
||||
QPixmap renderConnection(MapConnection, MapLayout *);
|
||||
QPixmap renderBorder();
|
||||
void setDimensions(int newWidth, int newHeight, bool setNewBlockData = true);
|
||||
void setDimensions(int newWidth, int newHeight, bool setNewBlockdata = true);
|
||||
void setBorderDimensions(int newWidth, int newHeight, bool setNewBlockdata = true);
|
||||
void cacheBorder();
|
||||
bool hasUnsavedChanges();
|
||||
|
||||
private:
|
||||
void setNewDimensionsBlockdata(int newWidth, int newHeight);
|
||||
void setNewBorderDimensionsBlockdata(int newWidth, int newHeight);
|
||||
|
||||
signals:
|
||||
void mapChanged(Map *map);
|
||||
|
||||
Reference in New Issue
Block a user