Format like smack-a-brother, and write comments as sentences
Four-space indents, braces on their own lines, and one-statement bodies without braces. Semicolons in comments became full stops. Designated initializers may leave fields out without a warning.
This commit is contained in:
1 parent
40f6b554b5
commit
7afdf709c3
176 files changed
+20500
-19048
No files matched your search
+40
-42
@@ -20,29 +20,29 @@
|
||||
|
||||
#include "shader.h"
|
||||
|
||||
class Manager;
|
||||
struct Command;
|
||||
class Manager;
|
||||
struct Command;
|
||||
|
||||
// Ids and labels for a combo box of content items.
|
||||
struct Choices
|
||||
{
|
||||
// Ids and labels for a combo box of content items.
|
||||
struct Choices
|
||||
{
|
||||
std::vector<int> ids;
|
||||
std::vector<std::string> labels;
|
||||
};
|
||||
};
|
||||
|
||||
// A linked .anm2, loaded read-only: its document, its spritesheets' images and its sounds.
|
||||
struct LibraryData
|
||||
{
|
||||
// A linked .anm2, loaded read-only: its document, its spritesheets' images and its sounds.
|
||||
struct LibraryData
|
||||
{
|
||||
Model model = {};
|
||||
std::map<int, Image> images;
|
||||
std::map<int, AudioData> sounds;
|
||||
std::filesystem::file_time_type writeTime;
|
||||
};
|
||||
};
|
||||
|
||||
// A step into an animation layer's child: the parent's tab, animation, time and layer track it was taken from,
|
||||
// and the animation it led to (in this tab, or a library's).
|
||||
struct ChildStep
|
||||
{
|
||||
// A step into an animation layer's child: the parent's tab, animation, time and layer track it was taken from,
|
||||
// and the animation it led to (in this tab, or a library's).
|
||||
struct ChildStep
|
||||
{
|
||||
std::uint64_t tabId = 0;
|
||||
int animationIndex = -1;
|
||||
float frameTime = 0;
|
||||
@@ -50,10 +50,10 @@
|
||||
std::string animationName;
|
||||
std::string layerName;
|
||||
int childAnimationIndex = -1;
|
||||
};
|
||||
};
|
||||
|
||||
struct DocumentData
|
||||
{
|
||||
struct DocumentData
|
||||
{
|
||||
std::filesystem::path path;
|
||||
uint64_t tabId = 0;
|
||||
Snapshots snapshots = {};
|
||||
@@ -77,8 +77,8 @@
|
||||
bool isOpen = true;
|
||||
bool isForceDirty = false;
|
||||
bool isVectorKept = false;
|
||||
std::vector<ChildStep>
|
||||
childSteps{}; // the steps that led to the animation being edited (the breadcrumb) // asked this session to keep SVG spritesheets in a Rebirth document
|
||||
std::vector<ChildStep> childSteps{}; // the steps that led to the animation being edited (the breadcrumb) // asked
|
||||
// this session to keep SVG spritesheets in a Rebirth document
|
||||
std::unordered_map<int, uint64_t> spritesheetHashes;
|
||||
std::unordered_map<int, uint64_t> spritesheetSaveHashes;
|
||||
std::unordered_map<int, uint64_t> spritesheetAutosaveHashes;
|
||||
@@ -96,23 +96,23 @@
|
||||
mutable std::map<std::pair<std::uint64_t, int>, Image> vectorImages;
|
||||
bool isAnimationPreviewSet = false;
|
||||
bool isSpritesheetEditorSet = false;
|
||||
};
|
||||
};
|
||||
|
||||
class Document : public DocumentData
|
||||
{
|
||||
public:
|
||||
class Document : public DocumentData
|
||||
{
|
||||
public:
|
||||
enum class FrameReferenceFallback
|
||||
{
|
||||
NONE,
|
||||
CURRENT,
|
||||
NONE,
|
||||
CURRENT,
|
||||
};
|
||||
|
||||
enum class EditTarget
|
||||
{
|
||||
NONE,
|
||||
FRAME,
|
||||
REGION,
|
||||
SPRITESHEET
|
||||
NONE,
|
||||
FRAME,
|
||||
REGION,
|
||||
SPRITESHEET
|
||||
};
|
||||
|
||||
Snapshot& current = snapshots.current;
|
||||
@@ -162,20 +162,18 @@
|
||||
void edit_begin(StringType);
|
||||
Uids edit_run(StringType, const std::function<Uids(Model&)>&);
|
||||
|
||||
// Snapshots for undo, runs the operation on the model, then commits; void operations select nothing.
|
||||
// Snapshots for undo, runs the operation on the model, then commits. Void operations select nothing.
|
||||
template <class Operation> Uids edit_apply(StringType label, Operation&& operation)
|
||||
{
|
||||
return edit_run(label,
|
||||
[&](Model& model) -> Uids
|
||||
{
|
||||
if constexpr (std::is_void_v<std::invoke_result_t<Operation&, Model&>>)
|
||||
{
|
||||
operation(model);
|
||||
return {};
|
||||
}
|
||||
else
|
||||
return operation(model);
|
||||
});
|
||||
return edit_run(label, [&](Model& model) -> Uids {
|
||||
if constexpr (std::is_void_v<std::invoke_result_t<Operation&, Model&>>)
|
||||
{
|
||||
operation(model);
|
||||
return {};
|
||||
}
|
||||
else
|
||||
return operation(model);
|
||||
});
|
||||
}
|
||||
std::vector<Reference> references_get(const Uids&) const;
|
||||
bool is_dirty() const;
|
||||
@@ -235,4 +233,4 @@
|
||||
void redo();
|
||||
bool is_able_to_undo();
|
||||
bool is_able_to_redo();
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user