Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
mapconndata.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 Twilight
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15*/
16#pragma once
17#include <QObject>
18#include <pse-common/types.h>
20
21class SaveFile;
22struct MapDBEntry;
24
36class SAVEFILE_AUTOPORT MapConnData : public QObject
37{
38 Q_OBJECT
39
40 Q_PROPERTY(int mapPtr MEMBER mapPtr NOTIFY mapPtrChanged)
41 Q_PROPERTY(int stripSrc MEMBER stripSrc NOTIFY stripSrcChanged)
42 Q_PROPERTY(int stripDst MEMBER stripDst NOTIFY stripDstChanged)
43 Q_PROPERTY(int stripWidth MEMBER stripWidth NOTIFY stripWidthChanged)
44 Q_PROPERTY(int width MEMBER width NOTIFY widthChanged)
45 Q_PROPERTY(int yAlign MEMBER yAlign NOTIFY yAlignChanged)
46 Q_PROPERTY(int xAlign MEMBER xAlign NOTIFY xAlignChanged)
47 Q_PROPERTY(int viewPtr MEMBER viewPtr NOTIFY viewPtrChanged)
48
49public:
50 MapConnData(SaveFile* saveFile = nullptr, var16 offset = 0);
51 virtual ~MapConnData();
52
53 void load(SaveFile* saveFile = nullptr, var16 offset = 0);
54 void save(SaveFile* saveFile, var16 offset);
55 void loadFromData(MapDBEntryConnect* connect);
56
57 MapDBEntry* toMap();
58
59signals:
68
69public slots:
70 void reset();
71
72public:
73 int mapPtr;
77 int width;
78 int yAlign;
79 int xAlign;
80 int viewPtr;
81};
void loadFromData(MapDBEntryConnect *connect)
Populate from a map-defined connection.
void xAlignChanged()
void stripDstChanged()
void widthChanged()
void stripSrcChanged()
void stripWidthChanged()
void reset()
Blank this connection.
MapDBEntry * toMap()
The connected map's DB entry.
protected::void mapPtrChanged()
void load(SaveFile *saveFile=nullptr, var16 offset=0)
Expand a connection block from the save.
void save(SaveFile *saveFile, var16 offset)
Flatten a connection block to the save.
void yAlignChanged()
MapConnData(SaveFile *saveFile=nullptr, var16 offset=0)
< Pointer to the connected map's data.
void viewPtrChanged()
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
Definition savefile.h:46
Project-wide fixed-width integer aliases (var8, var16, ...).
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
Definition types.h:125
Import/export macro for the savefile library, plus the central list of QObject types kept deliberatel...
#define SAVEFILE_AUTOPORT
Expands to the correct dllexport/dllimport decoration for this library.
One edge connection of a map (the seam to a neighbouring map).
One map's complete static definition – the root of the MapDBEntry family.
Definition mapdbentry.h:56