Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Toggle main menu visibility
Loading...
Searching...
No Matches
savefile_autoport.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 <QtCore/qglobal.h>
18
#include <QMetaType>
19
30
35
#if defined(SAVEFILE_LIBRARY)
36
# define SAVEFILE_AUTOPORT Q_DECL_EXPORT
37
#else
38
# define SAVEFILE_AUTOPORT Q_DECL_IMPORT
39
#endif
40
41
42
// -- Opaque pointer declarations ----------------------------------------------
43
// CAUTION: Q_DECLARE_OPAQUE_POINTER(T*) forces
44
// QtPrivate::IsPointerToTypeDerivedFromQObject<T*> = false. For a *real* QObject
45
// type that makes Qt store the pointer as a plain opaque value, so any QML read
46
// of `obj.thatProperty.subProperty` returns `undefined` even though the C++
47
// object is valid. This is why the whole brg.file.data.dataExpanded.* chain used
48
// to read as undefined.
49
//
50
// The fix for QObject types is to fully #include their headers wherever their
51
// pointers appear in a Q_PROPERTY / signal / slot / Q_INVOKABLE (see the
52
// expanded/*.h headers). With the full definition visible, Qt correctly detects
53
// them as QObject pointers and QML can traverse the chain -- no opaque decl
54
// needed. See notes/reference/qt6-patterns.md.
55
//
56
// The types below are kept opaque ON PURPOSE: nothing in QML traverses them
57
// (verified by grepping the .qml for dataExpanded.* chains). Keeping them opaque
58
// + forward-declared means the widely-included headers (savefileexpanded.h /
59
// area.h / world.h) do NOT have to pull these sub-trees into every translation
60
// unit -- that fan-out was making the build very slow. If you later traverse one
61
// of these in QML, remove it here and #include its full header at the
62
// declaration site instead. See notes/reference/qt6-patterns.md.
63
64
class
Daycare
;
65
class
HallOfFame
;
66
class
Rival
;
67
class
WorldCompleted
;
68
class
WorldEvents
;
69
class
WorldGeneral
;
70
class
WorldHidden
;
71
class
WorldMissables
;
72
class
WorldScripts
;
73
class
WorldTowns
;
74
class
WorldTrades
;
75
class
WorldLocal
;
76
77
Q_DECLARE_OPAQUE_POINTER(
Daycare
*)
78
Q_DECLARE_OPAQUE_POINTER(
HallOfFame
*)
79
Q_DECLARE_OPAQUE_POINTER(
Rival
*)
80
Q_DECLARE_OPAQUE_POINTER(
WorldCompleted
*)
81
Q_DECLARE_OPAQUE_POINTER(
WorldEvents
*)
82
Q_DECLARE_OPAQUE_POINTER(
WorldGeneral
*)
83
Q_DECLARE_OPAQUE_POINTER(
WorldHidden
*)
84
Q_DECLARE_OPAQUE_POINTER(
WorldMissables
*)
85
Q_DECLARE_OPAQUE_POINTER(
WorldScripts
*)
86
Q_DECLARE_OPAQUE_POINTER(
WorldTowns
*)
87
Q_DECLARE_OPAQUE_POINTER(
WorldTrades
*)
88
Q_DECLARE_OPAQUE_POINTER(
WorldLocal
*)
Daycare
The Day Care: at most one deposited Pokemon.
Definition
daycare.h:42
HallOfFame
The Hall of Fame: a rolling list of up to 50 winning-team records.
Definition
halloffame.h:38
Rival
The rival: their name and chosen starter.
Definition
rival.h:34
WorldCompleted
A handful of one-off "have you done X yet" milestone flags.
Definition
worldcompleted.h:35
WorldEvents
The game's story-event flags – a flat array of 508 booleans.
Definition
worldevents.h:39
WorldGeneral
General world settings: last maps plus the Options / LetterDelay objects.
Definition
worldgeneral.h:75
WorldHidden
"Already collected" flags for hidden items and hidden Game Corner coins.
Definition
worldhidden.h:42
WorldLocal
A few map-specific puzzle/minigame state values.
Definition
worldlocal.h:34
WorldMissables
Visibility flags for "missable" sprites (one-time NPCs/items on maps).
Definition
worldmissables.h:40
WorldScripts
Per-map script progress values (the in-progress state of each map's script).
Definition
worldscripts.h:38
WorldTowns
"Visited" flags for towns – which fly destinations are unlocked.
Definition
worldtowns.h:36
WorldTrades
"Done" flags for the game's in-game (NPC) trades.
Definition
worldtrades.h:36
projects
savefile
src
pse-savefile
savefile_autoport.h
Generated by
1.17.0