Compare commits
33 Commits
1600fd62a1
...
release-d2
| Author | SHA1 | Date | |
|---|---|---|---|
| 65df731abb | |||
| a098cb5ce7 | |||
| 8c0b0263db | |||
| 7f6c453345 | |||
| 261e324acd | |||
| f5573e06da | |||
| df87832324 | |||
| d585794cbe | |||
| 209658549c | |||
| 02383a4aed | |||
| 185a76282a | |||
| b722b4f701 | |||
| 459ab5aad9 | |||
| 565f621cfc | |||
| 9589ca9148 | |||
| 164db5007b | |||
| cbfb167d29 | |||
| e7b83be867 | |||
| 649da5fca8 | |||
| aa095f7680 | |||
| bb99c99f01 | |||
| 7f0dcdd280 | |||
| 6029ad5d47 | |||
| 26fe266b09 | |||
| 091eda7b44 | |||
| 9676ea5978 | |||
| de8ac10653 | |||
| 88a6cd59f3 | |||
| cd43fb7f38 | |||
| 136f422401 | |||
| e773d6f0ee | |||
| ac29f7a0f2 | |||
| eef51a6d2b |
4
Makefile
4
Makefile
@@ -17,6 +17,10 @@ PROJECT_PLAYER=./build/${BC_VAR_CURRENT_BUILD}/bin/${BC_VAR_PROJECT_NAME_CAP}
|
|||||||
pkg-gba: build
|
pkg-gba: build
|
||||||
${BC_CMD_ENVRUN} ${BC_PY3} ./util/scripts/pkg-gba.py sample_project ${BC_VAR_PROJECT_NAME_CAP}
|
${BC_CMD_ENVRUN} ${BC_PY3} ./util/scripts/pkg-gba.py sample_project ${BC_VAR_PROJECT_NAME_CAP}
|
||||||
|
|
||||||
|
.PHONY: pkg-mac
|
||||||
|
pkg-mac: install
|
||||||
|
${BC_CMD_ENVRUN} ${BC_PY3} ./util/scripts/pkg-dmg.py
|
||||||
|
|
||||||
.PHONY: generate-studio-rsrc
|
.PHONY: generate-studio-rsrc
|
||||||
generate-studio-rsrc:
|
generate-studio-rsrc:
|
||||||
${BC_CMD_ENVRUN} ${BC_PY3} ./util/scripts/file-to-cpp.py --rsrc src/olympic/studio/applib/src/rsrc.json
|
${BC_CMD_ENVRUN} ${BC_PY3} ./util/scripts/file-to-cpp.py --rsrc src/olympic/studio/applib/src/rsrc.json
|
||||||
|
|||||||
7
deps/buildcore/scripts/pybb.py
vendored
7
deps/buildcore/scripts/pybb.py
vendored
@@ -11,6 +11,7 @@
|
|||||||
# "Python Busy Box" - adds cross-platform equivalents to Unix commands that
|
# "Python Busy Box" - adds cross-platform equivalents to Unix commands that
|
||||||
# don't translate well to that other operating system
|
# don't translate well to that other operating system
|
||||||
|
|
||||||
|
import multiprocessing
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
import shutil
|
import shutil
|
||||||
@@ -57,7 +58,11 @@ def cmake_build(base_path: str, target: Optional[str]) -> int:
|
|||||||
path = os.path.join(base_path, d)
|
path = os.path.join(base_path, d)
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
continue
|
continue
|
||||||
args = ['cmake', '--build', path]
|
args = ['cmake', '--build', path, f'-j{multiprocessing.cpu_count()}']
|
||||||
|
if path.endswith('release'):
|
||||||
|
args.append('--config=release')
|
||||||
|
elif path.endswith('debug'):
|
||||||
|
args.append('--config=debug')
|
||||||
if target is not None:
|
if target is not None:
|
||||||
args.extend(['--target', target])
|
args.extend(['--target', target])
|
||||||
err = subprocess.run(args).returncode
|
err = subprocess.run(args).returncode
|
||||||
|
|||||||
@@ -24,9 +24,6 @@ enum class FileAddressType: int8_t {
|
|||||||
Inode,
|
Inode,
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
constexpr Error model(T *h, CommonPtrWith<class FileAddress> auto *fa) noexcept;
|
|
||||||
|
|
||||||
class FileAddress {
|
class FileAddress {
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
|||||||
7
deps/ox/src/ox/mc/write.hpp
vendored
7
deps/ox/src/ox/mc/write.hpp
vendored
@@ -211,11 +211,14 @@ constexpr Error MetalClawWriter<Writer>::field(const char *name, const IString<L
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<Writer_c Writer>
|
template<Writer_c Writer>
|
||||||
constexpr Error MetalClawWriter<Writer>::fieldCString(const char*, const char *const*val, std::size_t buffLen) noexcept {
|
constexpr Error MetalClawWriter<Writer>::fieldCString(const char*, const char *const*val, std::size_t) noexcept {
|
||||||
bool fieldSet = false;
|
bool fieldSet = false;
|
||||||
if (!m_unionIdx.has_value() || *m_unionIdx == m_field) {
|
if (!m_unionIdx.has_value() || *m_unionIdx == m_field) {
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||||
const auto strLen = *val ? ox::strnlen_s(*val, buffLen) : 0;
|
// this strlen is tolerated because sometimes 0 gets passed to
|
||||||
|
// the size param, which is a lie
|
||||||
|
// this code should be cleaned up at some point...
|
||||||
|
const auto strLen = *val ? ox::strlen(*val) : 0;
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_END
|
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||||
// write the length
|
// write the length
|
||||||
const auto strLenBuff = mc::encodeInteger(strLen);
|
const auto strLenBuff = mc::encodeInteger(strLen);
|
||||||
|
|||||||
8
deps/ox/src/ox/std/string.hpp
vendored
8
deps/ox/src/ox/std/string.hpp
vendored
@@ -213,22 +213,22 @@ class BasicString {
|
|||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr const char *c_str() const noexcept {
|
constexpr const char *c_str() const noexcept {
|
||||||
return static_cast<const char*>(m_buff.data());
|
return m_buff.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
inline explicit operator const char*() const {
|
constexpr explicit operator const char*() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __has_include(<string>)
|
#if __has_include(<string>)
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
inline std::string toStdString() const {
|
std::string toStdString() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
inline explicit operator std::string() const {
|
explicit operator std::string() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"length" : 4,
|
|
||||||
"primitiveType" : 1,
|
|
||||||
"typeName" : "B.int32"
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"length" : 1,
|
|
||||||
"primitiveType" : 1,
|
|
||||||
"typeName" : "B.int8"
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"primitiveType" : 4,
|
|
||||||
"typeName" : "B.string"
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"length" : 2,
|
|
||||||
"typeName" : "B.uint16"
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"length" : 8,
|
|
||||||
"typeName" : "B.uint64"
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"length" : 1,
|
|
||||||
"typeName" : "B.uint8"
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "bpp",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "rows",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "columns",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "defaultPalette",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pal",
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.Palette;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pixels",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.NostalgiaGraphic",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.Palette.ColorInfo",
|
|
||||||
"typeVersion" : 3
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "colors",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.PaletteColor;1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.Palette.PalettePage",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "colors",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.Palette",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "pages",
|
|
||||||
"subscriptLevels" : 2,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.Palette",
|
|
||||||
"typeVersion" : 2
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "colorInfo",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.Palette.ColorInfo;3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pages",
|
|
||||||
"subscriptLevels" : 2,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.Palette",
|
|
||||||
"typeVersion" : 3
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "colorNames",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pages",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.Palette.PalettePage;1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.Palette",
|
|
||||||
"typeVersion" : 4
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "r",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "g",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "b",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "a",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.PaletteColor",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "rows",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "columns",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheets",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pixels",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "rows",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "columns",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheets",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet;3"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pixels",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet",
|
|
||||||
"typeVersion" : 3
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "id",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "rows",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "columns",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheets",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet;4"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pixels",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet",
|
|
||||||
"typeVersion" : 4
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "bpp",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "defaultPalette",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheet",
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet;1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.TileSheet",
|
|
||||||
"typeVersion" : 2
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "bpp",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "idIt",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "defaultPalette",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheet",
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet;3"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.TileSheet",
|
|
||||||
"typeVersion" : 3
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "bpp",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "idIt",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "defaultPalette",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheet",
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.core.TileSheet.SubSheet;4"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.core.TileSheet",
|
|
||||||
"typeVersion" : 4
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "pages",
|
|
||||||
"subscriptLevels" : 2,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.CompactPalette",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "bpp",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "defaultPalette",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pixels",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.CompactTileSheet",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "colors",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.gfx.PaletteColor;2"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.Palette.PalettePage",
|
|
||||||
"typeVersion" : 2
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "colorNames",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pages",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.gfx.Palette.PalettePage;2"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.Palette",
|
|
||||||
"typeVersion" : 5
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "r",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "g",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "b",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "a",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.PaletteColor",
|
|
||||||
"typeVersion" : 2
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "id",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "name",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "rows",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "columns",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheets",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.gfx.TileSheet.SubSheet;5"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "pixels",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.TileSheet.SubSheet",
|
|
||||||
"typeVersion" : 5
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "bpp",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "idIt",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "defaultPalette",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheet",
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.gfx.TileSheet.SubSheet;5"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.gfx.TileSheet",
|
|
||||||
"typeVersion" : 5
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "tilesheet",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "palettes",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "tiles",
|
|
||||||
"subscriptLevels" : 3,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.nostalgia.scene.TileDoc;1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.scene.SceneDoc",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "tilesheet",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "palettes",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "columns",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "rows",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "tileMapIdx",
|
|
||||||
"subscriptLevels" : 2,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint16;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "tileType",
|
|
||||||
"subscriptLevels" : 2,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "layerAttachments",
|
|
||||||
"subscriptLevels" : 2,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"subscriptType" : 4
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.scene.SceneStatic",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheet_id",
|
|
||||||
"typeId" : "B.int32;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "subsheet_path",
|
|
||||||
"typeId" : "net.drinkingtea.ox.BasicString#8#;1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "type",
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "layer_attachments",
|
|
||||||
"subscriptLevels" : 1,
|
|
||||||
"subscriptStack" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"length" : 4,
|
|
||||||
"subscriptType" : 3
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"typeId" : "B.uint8;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"preloadable" : true,
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.nostalgia.scene.TileDoc",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"primitiveType" : 4,
|
|
||||||
"typeName" : "net.drinkingtea.ox.BasicString",
|
|
||||||
"typeParams" :
|
|
||||||
[
|
|
||||||
"8"
|
|
||||||
],
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "path",
|
|
||||||
"typeId" : "B.string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "constPath",
|
|
||||||
"typeId" : "B.string"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "inode",
|
|
||||||
"typeId" : "B.uint64;0"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 6,
|
|
||||||
"typeName" : "net.drinkingtea.ox.FileAddress.Data",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
|
||||||
"fieldList" :
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"fieldName" : "type",
|
|
||||||
"typeId" : "B.int8;0"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldName" : "data",
|
|
||||||
"typeId" : "net.drinkingtea.ox.FileAddress.Data"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"primitiveType" : 5,
|
|
||||||
"typeName" : "net.drinkingtea.ox.FileAddress",
|
|
||||||
"typeVersion" : 1
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,26 @@
|
|||||||
# d2025.04.0
|
# d2025.05.1
|
||||||
|
|
||||||
|
* TileSheetEditor: Fix overrun errors when switching subsheets, clear selection
|
||||||
|
on switch (261e324acd)
|
||||||
|
* Fix new build error that occurs in MSVC (26d5048e6720c4c2d52508a6ee44c67dd9fe3ee5)
|
||||||
|
|
||||||
|
# d2025.05.0
|
||||||
|
|
||||||
* Add app icon for both window and file
|
* Add app icon for both window and file
|
||||||
* Fix selection clearing in TileSheet editor to work when clicking outside
|
* Change application font to Roboto Medium
|
||||||
|
* Closing application will now confirm with user if any files have unsaved
|
||||||
|
changes.
|
||||||
|
* UUID duplicates will now be reported when opening a project
|
||||||
|
* Deleting a directory now closes files in that directory
|
||||||
|
* Delete key now initiates deletion of selected directory
|
||||||
|
* Remove ability to re-order tabs. There were bugs associated with that.
|
||||||
|
* TileSheetEditor: Fix selection clearing in to work when clicking outside
|
||||||
image.
|
image.
|
||||||
* Fix color number key range in PalettEditor. Previously, pressing A caused the
|
* TileSheetEditor: Fix Delete Tile functionality, which was completely broken
|
||||||
editor to jump to the last color.
|
* PaletteEditor: Fix color number key range in. Previously, pressing A caused
|
||||||
|
the editor to jump to the last color.
|
||||||
|
* PaletteEditor: page rename will now take effect upon pressing enter if the
|
||||||
|
text input has focus
|
||||||
|
|
||||||
# d2025.02.1
|
# d2025.02.1
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -68,7 +68,7 @@ void PaletteEditorImGui::PageRenameDialog::draw(turbine::Context &tctx) noexcept
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PaletteEditorImGui::PaletteEditorImGui(studio::StudioContext &sctx, ox::StringParam path):
|
PaletteEditorImGui::PaletteEditorImGui(studio::Context &sctx, ox::StringParam path):
|
||||||
Editor(sctx, std::move(path)),
|
Editor(sctx, std::move(path)),
|
||||||
m_sctx(sctx),
|
m_sctx(sctx),
|
||||||
m_tctx(sctx.tctx),
|
m_tctx(sctx.tctx),
|
||||||
@@ -77,7 +77,7 @@ PaletteEditorImGui::PaletteEditorImGui(studio::StudioContext &sctx, ox::StringPa
|
|||||||
m_pageRenameDlg.inputSubmitted.connect(this, &PaletteEditorImGui::renamePage);
|
m_pageRenameDlg.inputSubmitted.connect(this, &PaletteEditorImGui::renamePage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PaletteEditorImGui::draw(studio::StudioContext&) noexcept {
|
void PaletteEditorImGui::draw(studio::Context&) noexcept {
|
||||||
auto const paneSize = ImGui::GetContentRegionAvail();
|
auto const paneSize = ImGui::GetContentRegionAvail();
|
||||||
{
|
{
|
||||||
ImGui::BeginChild("Pages", {280, paneSize.y}, true);
|
ImGui::BeginChild("Pages", {280, paneSize.y}, true);
|
||||||
|
|||||||
@@ -31,16 +31,16 @@ class PaletteEditorImGui: public studio::Editor {
|
|||||||
constexpr bool isOpen() const noexcept { return m_show; }
|
constexpr bool isOpen() const noexcept { return m_show; }
|
||||||
void draw(turbine::Context &tctx) noexcept;
|
void draw(turbine::Context &tctx) noexcept;
|
||||||
} m_pageRenameDlg;
|
} m_pageRenameDlg;
|
||||||
studio::StudioContext &m_sctx;
|
studio::Context &m_sctx;
|
||||||
turbine::Context &m_tctx;
|
turbine::Context &m_tctx;
|
||||||
Palette m_pal;
|
Palette m_pal;
|
||||||
size_t m_selectedColorRow = 0;
|
size_t m_selectedColorRow = 0;
|
||||||
size_t m_page = 0;
|
size_t m_page = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PaletteEditorImGui(studio::StudioContext &sctx, ox::StringParam path);
|
PaletteEditorImGui(studio::Context &sctx, ox::StringParam path);
|
||||||
|
|
||||||
void draw(studio::StudioContext&) noexcept final;
|
void draw(studio::Context&) noexcept final;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ox::Error saveItem() noexcept final;
|
ox::Error saveItem() noexcept final;
|
||||||
|
|||||||
@@ -12,14 +12,14 @@
|
|||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
static class: public studio::Module {
|
static class: public studio::Module {
|
||||||
ox::Vector<studio::EditorMaker> editors(studio::StudioContext &ctx) const noexcept final {
|
ox::Vector<studio::EditorMaker> editors(studio::Context &ctx) const noexcept final {
|
||||||
return {
|
return {
|
||||||
studio::editorMaker<TileSheetEditorImGui>(ctx, {FileExt_ng, FileExt_nts}),
|
studio::editorMaker<TileSheetEditorImGui>(ctx, {FileExt_ng, FileExt_nts}),
|
||||||
studio::editorMaker<PaletteEditorImGui>(ctx, FileExt_npal),
|
studio::editorMaker<PaletteEditorImGui>(ctx, FileExt_npal),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(studio::StudioContext&) const noexcept final {
|
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(studio::Context&) const noexcept final {
|
||||||
ox::Vector<ox::UPtr<studio::ItemMaker>> out;
|
ox::Vector<ox::UPtr<studio::ItemMaker>> out;
|
||||||
out.emplace_back(ox::make<studio::ItemMakerT<TileSheet>>("Tile Sheet", "TileSheets", FileExt_nts));
|
out.emplace_back(ox::make<studio::ItemMakerT<TileSheet>>("Tile Sheet", "TileSheets", FileExt_nts));
|
||||||
out.emplace_back(ox::make<studio::ItemMakerT<Palette>>("Palette", "Palettes", FileExt_npal, Palette{
|
out.emplace_back(ox::make<studio::ItemMakerT<Palette>>("Palette", "Palettes", FileExt_npal, Palette{
|
||||||
|
|||||||
@@ -27,11 +27,14 @@ CutPasteCommand::CutPasteCommand(
|
|||||||
TileSheet::SubSheetIdx subSheetIdx,
|
TileSheet::SubSheetIdx subSheetIdx,
|
||||||
ox::Point const&dstStart,
|
ox::Point const&dstStart,
|
||||||
ox::Point dstEnd,
|
ox::Point dstEnd,
|
||||||
TileSheetClipboard const&cb) noexcept:
|
TileSheetClipboard const&cb):
|
||||||
m_commandId(commandId),
|
m_commandId(commandId),
|
||||||
m_img(img),
|
m_img(img),
|
||||||
m_subSheetIdx(std::move(subSheetIdx)) {
|
m_subSheetIdx(std::move(subSheetIdx)) {
|
||||||
auto const&ss = getSubSheet(m_img, m_subSheetIdx);
|
auto const&ss = getSubSheet(m_img, m_subSheetIdx);
|
||||||
|
if (dstStart.x >= ss.columns * TileWidth || dstStart.y >= ss.rows * TileHeight) {
|
||||||
|
throw ox::Exception{1, "paste starts beyond the bounds of target"};
|
||||||
|
}
|
||||||
dstEnd.x = std::min(ss.columns * TileWidth - 1, dstEnd.x);
|
dstEnd.x = std::min(ss.columns * TileWidth - 1, dstEnd.x);
|
||||||
dstEnd.y = std::min(ss.rows * TileHeight - 1, dstEnd.y);
|
dstEnd.y = std::min(ss.rows * TileHeight - 1, dstEnd.y);
|
||||||
for (auto const&p : cb.pixels()) {
|
for (auto const&p : cb.pixels()) {
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ class CutPasteCommand: public TileSheetCommand {
|
|||||||
TileSheet::SubSheetIdx subSheetIdx,
|
TileSheet::SubSheetIdx subSheetIdx,
|
||||||
ox::Point const&dstStart,
|
ox::Point const&dstStart,
|
||||||
ox::Point dstEnd,
|
ox::Point dstEnd,
|
||||||
TileSheetClipboard const&cb) noexcept;
|
TileSheetClipboard const&cb);
|
||||||
|
|
||||||
ox::Error redo() noexcept final;
|
ox::Error redo() noexcept final;
|
||||||
|
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
|
|
||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
gfx::DeleteTilesCommand::DeleteTilesCommand(
|
DeleteTilesCommand::DeleteTilesCommand(
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
std::size_t tileIdx,
|
std::size_t const tileIdx,
|
||||||
std::size_t tileCnt) noexcept:
|
std::size_t const tileCnt) noexcept:
|
||||||
m_img(img),
|
m_img(img),
|
||||||
m_idx(std::move(idx)) {
|
m_idx(std::move(idx)) {
|
||||||
const unsigned bytesPerTile = m_img.bpp == 4 ? PixelsPerTile / 2 : PixelsPerTile;
|
constexpr unsigned bytesPerTile = PixelsPerTile;
|
||||||
m_deletePos = tileIdx * bytesPerTile;
|
m_deletePos = tileIdx * bytesPerTile;
|
||||||
m_deleteSz = tileCnt * bytesPerTile;
|
m_deleteSz = tileCnt * bytesPerTile;
|
||||||
m_deletedPixels.resize(m_deleteSz);
|
m_deletedPixels.resize(m_deleteSz);
|
||||||
@@ -28,16 +28,20 @@ gfx::DeleteTilesCommand::DeleteTilesCommand(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error gfx::DeleteTilesCommand::redo() noexcept {
|
ox::Error DeleteTilesCommand::redo() noexcept {
|
||||||
auto &s = getSubSheet(m_img, m_idx);
|
auto &s = getSubSheet(m_img, m_idx);
|
||||||
auto &p = s.pixels;
|
auto &p = s.pixels;
|
||||||
auto srcPos = m_deletePos + m_deleteSz;
|
auto const srcPos = m_deletePos + m_deleteSz;
|
||||||
auto const src = &p[srcPos];
|
|
||||||
auto const dst1 = &p[m_deletePos];
|
auto const dst1 = &p[m_deletePos];
|
||||||
auto const dst2 = &p[(p.size() - m_deleteSz)];
|
auto const dst2 = &p[(p.size() - m_deleteSz)];
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||||
|
if (srcPos < p.size()) {
|
||||||
|
auto const src = &p[srcPos];
|
||||||
ox::memmove(dst1, src, p.size() - srcPos);
|
ox::memmove(dst1, src, p.size() - srcPos);
|
||||||
ox::memset(dst2, 0, m_deleteSz * sizeof(decltype(p[0])));
|
ox::memset(dst2, 0, m_deleteSz * sizeof(decltype(p[0])));
|
||||||
|
} else {
|
||||||
|
ox::memset(dst1, 0, p.size() - m_deletePos);
|
||||||
|
}
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_END
|
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@@ -46,11 +50,14 @@ ox::Error DeleteTilesCommand::undo() noexcept {
|
|||||||
auto &s = getSubSheet(m_img, m_idx);
|
auto &s = getSubSheet(m_img, m_idx);
|
||||||
auto &p = s.pixels;
|
auto &p = s.pixels;
|
||||||
auto const src = &p[m_deletePos];
|
auto const src = &p[m_deletePos];
|
||||||
auto const dst1 = &p[m_deletePos + m_deleteSz];
|
|
||||||
auto const dst2 = src;
|
|
||||||
auto const sz = p.size() - m_deletePos - m_deleteSz;
|
auto const sz = p.size() - m_deletePos - m_deleteSz;
|
||||||
|
auto const srcPos = m_deletePos + m_deleteSz;
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||||
|
if (srcPos < p.size()) {
|
||||||
|
auto const dst1 = &p[m_deletePos + m_deleteSz];
|
||||||
ox::memmove(dst1, src, sz);
|
ox::memmove(dst1, src, sz);
|
||||||
|
}
|
||||||
|
auto const dst2 = src;
|
||||||
ox::memcpy(dst2, m_deletedPixels.data(), m_deletedPixels.size());
|
ox::memcpy(dst2, m_deletedPixels.data(), m_deletedPixels.size());
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_END
|
OX_ALLOW_UNSAFE_BUFFERS_END
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -9,20 +9,19 @@ namespace nostalgia::gfx {
|
|||||||
InsertTilesCommand::InsertTilesCommand(
|
InsertTilesCommand::InsertTilesCommand(
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
std::size_t tileIdx,
|
std::size_t const tileIdx,
|
||||||
std::size_t tileCnt) noexcept:
|
std::size_t const tileCnt) noexcept:
|
||||||
m_img(img),
|
m_img{img},
|
||||||
m_idx(std::move(idx)) {
|
m_idx{std::move(idx)} {
|
||||||
const unsigned bytesPerTile = m_img.bpp == 4 ? PixelsPerTile / 2 : PixelsPerTile;
|
m_insertPos = tileIdx * PixelsPerTile;
|
||||||
m_insertPos = tileIdx * bytesPerTile;
|
m_insertCnt = tileCnt * PixelsPerTile;
|
||||||
m_insertCnt = tileCnt * bytesPerTile;
|
|
||||||
m_deletedPixels.resize(m_insertCnt);
|
m_deletedPixels.resize(m_insertCnt);
|
||||||
// copy pixels to be erased
|
// copy pixels to be erased
|
||||||
{
|
{
|
||||||
auto &s = getSubSheet(m_img, m_idx);
|
auto &s = getSubSheet(m_img, m_idx);
|
||||||
auto &p = s.pixels;
|
auto &p = s.pixels;
|
||||||
auto dst = m_deletedPixels.begin();
|
auto const dst = m_deletedPixels.begin();
|
||||||
auto src = p.begin() + p.size() - m_insertCnt;
|
auto const src = p.begin() + p.size() - m_insertCnt;
|
||||||
ox::copy_n(src, m_insertCnt, dst);
|
ox::copy_n(src, m_insertCnt, dst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +31,7 @@ OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
|||||||
ox::Error InsertTilesCommand::redo() noexcept {
|
ox::Error InsertTilesCommand::redo() noexcept {
|
||||||
auto &s = getSubSheet(m_img, m_idx);
|
auto &s = getSubSheet(m_img, m_idx);
|
||||||
auto &p = s.pixels;
|
auto &p = s.pixels;
|
||||||
auto dstPos = m_insertPos + m_insertCnt;
|
auto const dstPos = m_insertPos + m_insertCnt;
|
||||||
auto const src = &p[m_insertPos];
|
auto const src = &p[m_insertPos];
|
||||||
if (dstPos < p.size()) {
|
if (dstPos < p.size()) {
|
||||||
auto const dst = &p[dstPos];
|
auto const dst = &p[dstPos];
|
||||||
|
|||||||
@@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
gfx::PaletteChangeCommand::PaletteChangeCommand(
|
PaletteChangeCommand::PaletteChangeCommand(
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
ox::StringViewCR newPalette) noexcept:
|
ox::StringViewCR newPalette) noexcept:
|
||||||
m_img(img),
|
m_img{img},
|
||||||
m_idx(std::move(idx)),
|
m_idx{std::move(idx)},
|
||||||
m_oldPalette(m_img.defaultPalette),
|
m_oldPalette{m_img.defaultPalette},
|
||||||
m_newPalette(ox::sfmt<ox::IString<43>>("uuid://{}", newPalette)) {
|
m_newPalette{ox::sfmt<ox::IString<43>>("uuid://{}", newPalette)} {
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error PaletteChangeCommand::redo() noexcept {
|
ox::Error PaletteChangeCommand::redo() noexcept {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
gfx::UpdateSubSheetCommand::UpdateSubSheetCommand(
|
UpdateSubSheetCommand::UpdateSubSheetCommand(
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
ox::StringParam name,
|
ox::StringParam name,
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ static ox::Error toPngFile(
|
|||||||
8)));
|
8)));
|
||||||
}
|
}
|
||||||
|
|
||||||
TileSheetEditorImGui::TileSheetEditorImGui(studio::StudioContext &sctx, ox::StringParam path):
|
TileSheetEditorImGui::TileSheetEditorImGui(studio::Context &sctx, ox::StringParam path):
|
||||||
Editor(sctx, std::move(path)),
|
Editor(sctx, std::move(path)),
|
||||||
m_sctx{sctx},
|
m_sctx{sctx},
|
||||||
m_tctx{m_sctx.tctx},
|
m_tctx{m_sctx.tctx},
|
||||||
@@ -188,7 +188,7 @@ void TileSheetEditorImGui::keyStateChanged(turbine::Key const key, bool const do
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditorImGui::draw(studio::StudioContext&) noexcept {
|
void TileSheetEditorImGui::draw(studio::Context&) noexcept {
|
||||||
if (ig::mainWinHasFocus() && m_tool == TileSheetTool::Select) {
|
if (ig::mainWinHasFocus() && m_tool == TileSheetTool::Select) {
|
||||||
if (ImGui::IsKeyDown(ImGuiKey_ModCtrl) && !m_palPathFocused) {
|
if (ImGui::IsKeyDown(ImGuiKey_ModCtrl) && !m_palPathFocused) {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_A)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_A)) {
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ class TileSheetEditorImGui: public studio::Editor {
|
|||||||
constexpr bool isOpen() const noexcept { return m_show; }
|
constexpr bool isOpen() const noexcept { return m_show; }
|
||||||
};
|
};
|
||||||
static constexpr float s_palViewWidth = 335;
|
static constexpr float s_palViewWidth = 335;
|
||||||
studio::StudioContext &m_sctx;
|
studio::Context &m_sctx;
|
||||||
turbine::Context &m_tctx;
|
turbine::Context &m_tctx;
|
||||||
ox::Vector<ox::String> m_paletteList;
|
ox::Vector<ox::String> m_paletteList;
|
||||||
SubSheetEditor m_subsheetEditor;
|
SubSheetEditor m_subsheetEditor;
|
||||||
@@ -60,7 +60,7 @@ class TileSheetEditorImGui: public studio::Editor {
|
|||||||
ox::Vector<ox::UPtr<studio::UndoCommand>, 1> m_deferredCmds;
|
ox::Vector<ox::UPtr<studio::UndoCommand>, 1> m_deferredCmds;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TileSheetEditorImGui(studio::StudioContext &sctx, ox::StringParam path);
|
TileSheetEditorImGui(studio::Context &sctx, ox::StringParam path);
|
||||||
|
|
||||||
~TileSheetEditorImGui() override = default;
|
~TileSheetEditorImGui() override = default;
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ class TileSheetEditorImGui: public studio::Editor {
|
|||||||
|
|
||||||
void keyStateChanged(turbine::Key key, bool down) override;
|
void keyStateChanged(turbine::Key key, bool down) override;
|
||||||
|
|
||||||
void draw(studio::StudioContext&) noexcept override;
|
void draw(studio::Context&) noexcept override;
|
||||||
|
|
||||||
void drawSubsheetSelector(TileSheet::SubSheet&, TileSheet::SubSheetIdx &path);
|
void drawSubsheetSelector(TileSheet::SubSheet&, TileSheet::SubSheetIdx &path);
|
||||||
|
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ Palette const TileSheetEditorModel::s_defaultPalette = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
TileSheetEditorModel::TileSheetEditorModel(
|
TileSheetEditorModel::TileSheetEditorModel(
|
||||||
studio::StudioContext &sctx, ox::StringParam path, studio::UndoStack &undoStack):
|
studio::Context &sctx, ox::StringParam path, studio::UndoStack &undoStack):
|
||||||
m_sctx(sctx),
|
m_sctx{sctx},
|
||||||
m_tctx(m_sctx.tctx),
|
m_tctx{m_sctx.tctx},
|
||||||
m_path(std::move(path)),
|
m_path{std::move(path)},
|
||||||
m_img(*readObj<TileSheet>(keelCtx(m_tctx), m_path).unwrapThrow()),
|
m_img{*readObj<TileSheet>(keelCtx(m_tctx), m_path).unwrapThrow()},
|
||||||
// ignore failure to load palette
|
// ignore failure to load palette
|
||||||
m_pal(readObj<Palette>(keelCtx(m_tctx), m_img.defaultPalette).value),
|
m_pal{readObj<Palette>(keelCtx(m_tctx), m_img.defaultPalette).value},
|
||||||
m_undoStack(undoStack) {
|
m_undoStack{undoStack} {
|
||||||
normalizeSubsheets(m_img.subsheet);
|
normalizeSubsheets(m_img.subsheet);
|
||||||
m_pal.updated.connect(this, &TileSheetEditorModel::markUpdated);
|
m_pal.updated.connect(this, &TileSheetEditorModel::markUpdated);
|
||||||
m_undoStack.changeTriggered.connect(this, &TileSheetEditorModel::markUpdatedCmdId);
|
m_undoStack.changeTriggered.connect(this, &TileSheetEditorModel::markUpdatedCmdId);
|
||||||
@@ -67,19 +67,27 @@ void TileSheetEditorModel::cut() {
|
|||||||
TileSheetClipboard blankCb;
|
TileSheetClipboard blankCb;
|
||||||
auto cb = ox::make_unique<TileSheetClipboard>();
|
auto cb = ox::make_unique<TileSheetClipboard>();
|
||||||
auto const&s = activeSubSheet();
|
auto const&s = activeSubSheet();
|
||||||
iterateSelectionRows(*m_selection, [&](int const x, int const y) {
|
if (iterateSelectionRows(*m_selection, [&](int const x, int const y) {
|
||||||
auto pt = ox::Point{x, y};
|
auto pt = ox::Point{x, y};
|
||||||
auto const idx = gfx::idx(s, pt);
|
auto const idx = gfx::idx(s, pt);
|
||||||
auto const c = getPixel(s, idx);
|
if (idx >= s.pixels.size()) {
|
||||||
|
return ox::Error{1, "invalid idx"};
|
||||||
|
}
|
||||||
|
auto const c = s.pixels[idx];
|
||||||
pt -= m_selection->a;
|
pt -= m_selection->a;
|
||||||
cb->addPixel(pt, c);
|
cb->addPixel(pt, c);
|
||||||
blankCb.addPixel(pt, 0);
|
blankCb.addPixel(pt, 0);
|
||||||
});
|
return ox::Error{};
|
||||||
|
})) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
auto const pt1 = m_selection->a;
|
auto const pt1 = m_selection->a;
|
||||||
auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight};
|
auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight};
|
||||||
turbine::setClipboardObject(m_tctx, std::move(cb));
|
turbine::setClipboardObject(m_tctx, std::move(cb));
|
||||||
std::ignore = pushCommand(ox::make<CutPasteCommand>(
|
if (auto const cmd = ox::makeCatch<CutPasteCommand>(
|
||||||
CommandId::Cut, m_img, m_activeSubsSheetIdx, pt1, pt2, blankCb));
|
CommandId::Cut, m_img, m_activeSubsSheetIdx, pt1, pt2, blankCb); cmd.ok()) {
|
||||||
|
std::ignore = pushCommand(cmd.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditorModel::copy() {
|
void TileSheetEditorModel::copy() {
|
||||||
@@ -87,14 +95,20 @@ void TileSheetEditorModel::copy() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto cb = ox::make_unique<TileSheetClipboard>();
|
auto cb = ox::make_unique<TileSheetClipboard>();
|
||||||
iterateSelectionRows(*m_selection, [&](int const x, int const y) {
|
if (iterateSelectionRows(*m_selection, [&](int const x, int const y) {
|
||||||
auto pt = ox::Point{x, y};
|
auto pt = ox::Point{x, y};
|
||||||
auto const&s = activeSubSheet();
|
auto const&s = activeSubSheet();
|
||||||
auto const idx = gfx::idx(s, pt);
|
auto const idx = gfx::idx(s, pt);
|
||||||
auto const c = getPixel(s, idx);
|
if (idx >= s.pixels.size()) {
|
||||||
|
return ox::Error{1, "invalid idx"};
|
||||||
|
}
|
||||||
|
auto const c = s.pixels[idx];
|
||||||
pt -= m_selection->a;
|
pt -= m_selection->a;
|
||||||
cb->addPixel(pt, c);
|
cb->addPixel(pt, c);
|
||||||
});
|
return ox::Error{};
|
||||||
|
})) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
turbine::setClipboardObject(m_tctx, std::move(cb));
|
turbine::setClipboardObject(m_tctx, std::move(cb));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,8 +125,10 @@ void TileSheetEditorModel::paste() {
|
|||||||
auto const&s = activeSubSheet();
|
auto const&s = activeSubSheet();
|
||||||
auto const pt1 = m_selection->a;
|
auto const pt1 = m_selection->a;
|
||||||
auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight};
|
auto const pt2 = ox::Point{s.columns * TileWidth, s.rows * TileHeight};
|
||||||
std::ignore = pushCommand(ox::make<CutPasteCommand>(
|
if (auto const cmd = ox::makeCatch<CutPasteCommand>(
|
||||||
CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb));
|
CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb); cmd.ok()) {
|
||||||
|
std::ignore = pushCommand(cmd.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TileSheetEditorModel::acceptsClipboardPayload() const noexcept {
|
bool TileSheetEditorModel::acceptsClipboardPayload() const noexcept {
|
||||||
@@ -152,7 +168,7 @@ void TileSheetEditorModel::drawCommand(ox::Point const &pt, std::size_t const pa
|
|||||||
auto const idx = gfx::idx(activeSubSheet, pt);
|
auto const idx = gfx::idx(activeSubSheet, pt);
|
||||||
if (m_ongoingDrawCommand) {
|
if (m_ongoingDrawCommand) {
|
||||||
m_updated = m_updated || m_ongoingDrawCommand->append(idx);
|
m_updated = m_updated || m_ongoingDrawCommand->append(idx);
|
||||||
} else if (getPixel(activeSubSheet, idx) != palIdx) {
|
} else if (activeSubSheet.pixels[idx] != palIdx) {
|
||||||
std::ignore = pushCommand(ox::make<DrawCommand>(
|
std::ignore = pushCommand(ox::make<DrawCommand>(
|
||||||
m_img, m_activeSubsSheetIdx, idx, static_cast<int>(palIdx)));
|
m_img, m_activeSubsSheetIdx, idx, static_cast<int>(palIdx)));
|
||||||
}
|
}
|
||||||
@@ -213,6 +229,7 @@ ox::Error TileSheetEditorModel::updateSubsheet(
|
|||||||
void TileSheetEditorModel::setActiveSubsheet(TileSheet::SubSheetIdx const&idx) noexcept {
|
void TileSheetEditorModel::setActiveSubsheet(TileSheet::SubSheetIdx const&idx) noexcept {
|
||||||
m_activeSubsSheetIdx = idx;
|
m_activeSubsSheetIdx = idx;
|
||||||
this->activeSubsheetChanged.emit(m_activeSubsSheetIdx);
|
this->activeSubsheetChanged.emit(m_activeSubsSheetIdx);
|
||||||
|
clearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditorModel::fill(ox::Point const&pt, int const palIdx) noexcept {
|
void TileSheetEditorModel::fill(ox::Point const&pt, int const palIdx) noexcept {
|
||||||
@@ -381,7 +398,7 @@ void TileSheetEditorModel::getFillPixels(
|
|||||||
int const oldColor) const noexcept {
|
int const oldColor) const noexcept {
|
||||||
auto const idx = ptToIdx(pt, activeSubSheet.columns);
|
auto const idx = ptToIdx(pt, activeSubSheet.columns);
|
||||||
auto const relIdx = idx % PixelsPerTile;
|
auto const relIdx = idx % PixelsPerTile;
|
||||||
if (pixels[relIdx] || getPixel(activeSubSheet, idx) != oldColor) {
|
if (pixels[relIdx] || activeSubSheet.pixels[idx] != oldColor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// mark pixels to update
|
// mark pixels to update
|
||||||
@@ -419,7 +436,7 @@ void TileSheetEditorModel::setPalPath() noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ox::Error TileSheetEditorModel::pushCommand(studio::UndoCommand *cmd) noexcept {
|
ox::Error TileSheetEditorModel::pushCommand(studio::UndoCommand *cmd) noexcept {
|
||||||
std::ignore = m_undoStack.push(ox::UPtr<studio::UndoCommand>{cmd});
|
std::ignore = m_undoStack.push(ox::UPtr{cmd});
|
||||||
m_ongoingDrawCommand = dynamic_cast<DrawCommand*>(cmd);
|
m_ongoingDrawCommand = dynamic_cast<DrawCommand*>(cmd);
|
||||||
m_updated = true;
|
m_updated = true;
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static Palette const s_defaultPalette;
|
static Palette const s_defaultPalette;
|
||||||
studio::StudioContext &m_sctx;
|
studio::Context &m_sctx;
|
||||||
turbine::Context &m_tctx;
|
turbine::Context &m_tctx;
|
||||||
ox::String m_path;
|
ox::String m_path;
|
||||||
ox::String m_palPath;
|
ox::String m_palPath;
|
||||||
@@ -39,7 +39,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
bool m_updated = false;
|
bool m_updated = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TileSheetEditorModel(studio::StudioContext &sctx, ox::StringParam path, studio::UndoStack &undoStack);
|
TileSheetEditorModel(studio::Context &sctx, ox::StringParam path, studio::UndoStack &undoStack);
|
||||||
|
|
||||||
~TileSheetEditorModel() override = default;
|
~TileSheetEditorModel() override = default;
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
TileSheetEditorView::TileSheetEditorView(
|
TileSheetEditorView::TileSheetEditorView(
|
||||||
studio::StudioContext &sctx, ox::StringViewCR path, studio::UndoStack &undoStack):
|
studio::Context &sctx, ox::StringViewCR path, studio::UndoStack &undoStack):
|
||||||
m_model(sctx, path, undoStack),
|
m_model(sctx, path, undoStack),
|
||||||
m_pixelsDrawer(m_model) {
|
m_pixelsDrawer(m_model) {
|
||||||
glBindVertexArray(0);
|
glBindVertexArray(0);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ class TileSheetEditorView: public ox::SignalHandler {
|
|||||||
std::size_t m_palIdx = 0;
|
std::size_t m_palIdx = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TileSheetEditorView(studio::StudioContext &sctx, ox::StringViewCR path, studio::UndoStack &undoStack);
|
TileSheetEditorView(studio::Context &sctx, ox::StringViewCR path, studio::UndoStack &undoStack);
|
||||||
|
|
||||||
~TileSheetEditorView() override = default;
|
~TileSheetEditorView() override = default;
|
||||||
|
|
||||||
|
|||||||
@@ -9,12 +9,12 @@
|
|||||||
namespace nostalgia::sound {
|
namespace nostalgia::sound {
|
||||||
|
|
||||||
static class: public studio::Module {
|
static class: public studio::Module {
|
||||||
ox::Vector<studio::EditorMaker> editors(studio::StudioContext&) const noexcept final {
|
ox::Vector<studio::EditorMaker> editors(studio::Context&) const noexcept final {
|
||||||
return {
|
return {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(studio::StudioContext&) const noexcept final {
|
ox::Vector<ox::UPtr<studio::ItemMaker>> itemMakers(studio::Context&) const noexcept final {
|
||||||
ox::Vector<ox::UPtr<studio::ItemMaker>> out;
|
ox::Vector<ox::UPtr<studio::ItemMaker>> out;
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ target_link_libraries(
|
|||||||
|
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
NostalgiaStudio PUBLIC
|
NostalgiaStudio PUBLIC
|
||||||
OLYMPIC_APP_VERSION="dev build"
|
OLYMPIC_APP_VERSION="d2025.05.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
|
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>dev build</string>
|
<string>d2025.05.1</string>
|
||||||
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>12.0.0</string>
|
<string>12.0.0</string>
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
|
|
||||||
namespace keel {
|
namespace keel {
|
||||||
|
|
||||||
class Context;
|
|
||||||
|
|
||||||
class Context {
|
class Context {
|
||||||
public:
|
public:
|
||||||
ox::UPtr<ox::FileSystem> rom;
|
ox::UPtr<ox::FileSystem> rom;
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ ox::Result<ox::CStringView> uuidToPath(Context &ctx, ox::UUID const&uuid) noexce
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error reloadAsset(keel::Context &ctx, ox::StringViewCR assetId) noexcept {
|
ox::Error reloadAsset(Context &ctx, ox::StringViewCR assetId) noexcept {
|
||||||
if (beginsWith(assetId, "uuid://")) {
|
if (beginsWith(assetId, "uuid://")) {
|
||||||
return ctx.assetManager.reloadAsset(substr(assetId, 7));
|
return ctx.assetManager.reloadAsset(substr(assetId, 7));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -13,23 +13,11 @@ extern ox::String appVersion;
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept {
|
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept: Popup("About") {
|
||||||
m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::appVersion);
|
m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::appVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AboutPopup::open() noexcept {
|
void AboutPopup::draw(Context &sctx) noexcept {
|
||||||
m_stage = Stage::Opening;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AboutPopup::close() noexcept {
|
|
||||||
m_stage = Stage::Closed;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AboutPopup::isOpen() const noexcept {
|
|
||||||
return m_stage == Stage::Open;
|
|
||||||
}
|
|
||||||
|
|
||||||
void AboutPopup::draw(StudioContext &sctx) noexcept {
|
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
@@ -47,7 +35,7 @@ void AboutPopup::draw(StudioContext &sctx) noexcept {
|
|||||||
ig::centerNextWindow(sctx.tctx);
|
ig::centerNextWindow(sctx.tctx);
|
||||||
auto open = true;
|
auto open = true;
|
||||||
if (ImGui::BeginPopupModal("About", &open, modalFlags)) {
|
if (ImGui::BeginPopupModal("About", &open, modalFlags)) {
|
||||||
ImGui::Text("%s", m_text.c_str());
|
ImGui::Text("%s\n\nBuild date: %s", m_text.c_str(), __DATE__);
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::Dummy({148.0f, 0.0f});
|
ImGui::Dummy({148.0f, 0.0f});
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|||||||
@@ -13,29 +13,14 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
class AboutPopup: public studio::Popup {
|
class AboutPopup final: public ig::Popup {
|
||||||
public:
|
|
||||||
enum class Stage {
|
|
||||||
Closed,
|
|
||||||
Opening,
|
|
||||||
Open,
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Stage m_stage = Stage::Closed;
|
|
||||||
ox::String m_text;
|
ox::String m_text;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AboutPopup(turbine::Context &ctx) noexcept;
|
explicit AboutPopup(turbine::Context &ctx) noexcept;
|
||||||
|
|
||||||
void open() noexcept override;
|
void draw(Context &sctx) noexcept override;
|
||||||
|
|
||||||
void close() noexcept override;
|
|
||||||
|
|
||||||
[[nodiscard]]
|
|
||||||
bool isOpen() const noexcept override;
|
|
||||||
|
|
||||||
void draw(studio::StudioContext &sctx) noexcept override;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class StudioUIDrawer: public turbine::gl::Drawer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static void keyEventHandler(turbine::Context &ctx, turbine::Key key, bool down) noexcept {
|
static void keyEventHandler(turbine::Context &ctx, turbine::Key key, bool down) noexcept {
|
||||||
auto sctx = turbine::applicationData<studio::StudioContext>(ctx);
|
auto sctx = turbine::applicationData<studio::Context>(ctx);
|
||||||
sctx->ui.handleKeyEvent(key, down);
|
sctx->ui.handleKeyEvent(key, down);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,12 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
ClawEditor::ClawEditor(StudioContext &sctx, ox::StringParam path):
|
ClawEditor::ClawEditor(Context &sctx, ox::StringParam path):
|
||||||
Editor(sctx, std::move(path)),
|
Editor(sctx, std::move(path)),
|
||||||
m_obj(sctx.project->loadObj<ox::ModelObject>(itemPath()).unwrapThrow()) {
|
m_obj(sctx.project->loadObj<ox::ModelObject>(itemPath()).unwrapThrow()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClawEditor::draw(StudioContext&) noexcept {
|
void ClawEditor::draw(Context&) noexcept {
|
||||||
ImGui::BeginChild("PaletteEditor");
|
ImGui::BeginChild("PaletteEditor");
|
||||||
static constexpr auto flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
|
static constexpr auto flags = ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
|
||||||
if (ImGui::BeginTable("ObjTree", 3, flags)) {
|
if (ImGui::BeginTable("ObjTree", 3, flags)) {
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ class ClawEditor: public Editor {
|
|||||||
using ObjPath = ox::Vector<ox::StringView, 8>;
|
using ObjPath = ox::Vector<ox::StringView, 8>;
|
||||||
ox::ModelObject m_obj;
|
ox::ModelObject m_obj;
|
||||||
public:
|
public:
|
||||||
ClawEditor(StudioContext &sctx, ox::StringParam path);
|
ClawEditor(Context &sctx, ox::StringParam path);
|
||||||
|
|
||||||
void draw(StudioContext&) noexcept final;
|
void draw(Context&) noexcept final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void drawRow(ox::ModelValue const&value) noexcept;
|
static void drawRow(ox::ModelValue const&value) noexcept;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ bool DeleteConfirmation::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeleteConfirmation::draw(StudioContext &ctx) noexcept {
|
void DeleteConfirmation::draw(Context &ctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class DeleteConfirmation final: public Popup {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept override;
|
bool isOpen() const noexcept override;
|
||||||
|
|
||||||
void draw(StudioContext &ctx) noexcept override;
|
void draw(Context &ctx) noexcept override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ bool MakeCopyPopup::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeCopyPopup::draw(StudioContext &ctx) noexcept {
|
void MakeCopyPopup::draw(Context &ctx) noexcept {
|
||||||
switch (m_stage) {
|
switch (m_stage) {
|
||||||
case Stage::Closed:
|
case Stage::Closed:
|
||||||
break;
|
break;
|
||||||
@@ -70,7 +70,7 @@ void MakeCopyPopup::draw(StudioContext &ctx) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeCopyPopup::accept(StudioContext const &ctx) noexcept {
|
void MakeCopyPopup::accept(Context const &ctx) noexcept {
|
||||||
auto const p = sfmt("{}{}", m_dirPath, m_fileName);
|
auto const p = sfmt("{}{}", m_dirPath, m_fileName);
|
||||||
if (!ctx.project->exists(p)) {
|
if (!ctx.project->exists(p)) {
|
||||||
makeCopy.emit(m_srcPath, p);
|
makeCopy.emit(m_srcPath, p);
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ class MakeCopyPopup: public Widget {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept;
|
bool isOpen() const noexcept;
|
||||||
|
|
||||||
void draw(StudioContext &ctx) noexcept override;
|
void draw(Context &ctx) noexcept override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void accept(StudioContext const &ctx) noexcept;
|
void accept(Context const &ctx) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ bool NewDir::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewDir::draw(StudioContext &ctx) noexcept {
|
void NewDir::draw(Context &ctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ class NewDir final: public Popup {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept override;
|
bool isOpen() const noexcept override;
|
||||||
|
|
||||||
void draw(StudioContext &ctx) noexcept override;
|
void draw(Context &ctx) noexcept override;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr ox::CStringView value() const noexcept {
|
constexpr ox::CStringView value() const noexcept {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ bool NewMenu::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMenu::draw(StudioContext &sctx) noexcept {
|
void NewMenu::draw(Context &sctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
@@ -88,7 +88,7 @@ void NewMenu::installItemTemplate(ox::UPtr<ItemTemplate> &tmplt) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMenu::drawNewItemType(StudioContext const&sctx) noexcept {
|
void NewMenu::drawNewItemType(Context const&sctx) noexcept {
|
||||||
setSize({280, 180});
|
setSize({280, 180});
|
||||||
drawWindow(sctx.tctx, m_open, [this] {
|
drawWindow(sctx.tctx, m_open, [this] {
|
||||||
ig::ListBox("Item Type", [&](size_t const i) -> ox::CStringView {
|
ig::ListBox("Item Type", [&](size_t const i) -> ox::CStringView {
|
||||||
@@ -105,7 +105,7 @@ void NewMenu::drawNewItemType(StudioContext const&sctx) noexcept {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMenu::drawNewItemTemplate(StudioContext const&sctx) noexcept {
|
void NewMenu::drawNewItemTemplate(Context const&sctx) noexcept {
|
||||||
setSize({280, 180});
|
setSize({280, 180});
|
||||||
drawWindow(sctx.tctx, m_open, [this] {
|
drawWindow(sctx.tctx, m_open, [this] {
|
||||||
auto const&templates =
|
auto const&templates =
|
||||||
@@ -117,7 +117,7 @@ void NewMenu::drawNewItemTemplate(StudioContext const&sctx) noexcept {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMenu::drawNewItemPath(StudioContext &sctx) noexcept {
|
void NewMenu::drawNewItemPath(Context &sctx) noexcept {
|
||||||
setSize({380, 340});
|
setSize({380, 340});
|
||||||
drawWindow(sctx.tctx, m_open, [this, &sctx] {
|
drawWindow(sctx.tctx, m_open, [this, &sctx] {
|
||||||
if (m_stage == Stage::NewItemTransitioningToPath) [[unlikely]] {
|
if (m_stage == Stage::NewItemTransitioningToPath) [[unlikely]] {
|
||||||
@@ -170,7 +170,7 @@ void NewMenu::drawFirstPageButtons(Stage const next) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMenu::drawLastPageButtons(StudioContext &sctx) noexcept {
|
void NewMenu::drawLastPageButtons(Context &sctx) noexcept {
|
||||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 198);
|
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 198);
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 20);
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 20);
|
||||||
constexpr ImVec2 btnSz{60, 20};
|
constexpr ImVec2 btnSz{60, 20};
|
||||||
@@ -191,7 +191,7 @@ void NewMenu::drawLastPageButtons(StudioContext &sctx) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewMenu::finish(StudioContext &sctx) noexcept {
|
void NewMenu::finish(Context &sctx) noexcept {
|
||||||
if (m_itemName.len() == 0) {
|
if (m_itemName.len() == 0) {
|
||||||
oxLogError(ox::Error{1, "New file error: no file name"});
|
oxLogError(ox::Error{1, "New file error: no file name"});
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class NewMenu final: public Popup {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept override;
|
bool isOpen() const noexcept override;
|
||||||
|
|
||||||
void draw(StudioContext &sctx) noexcept override;
|
void draw(Context &sctx) noexcept override;
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void addItemType(
|
void addItemType(
|
||||||
@@ -75,19 +75,19 @@ class NewMenu final: public Popup {
|
|||||||
void installItemTemplate(ox::UPtr<ItemTemplate> &tmplt) noexcept;
|
void installItemTemplate(ox::UPtr<ItemTemplate> &tmplt) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void drawNewItemType(StudioContext const&sctx) noexcept;
|
void drawNewItemType(Context const&sctx) noexcept;
|
||||||
|
|
||||||
void drawNewItemPath(StudioContext &sctx) noexcept;
|
void drawNewItemPath(Context &sctx) noexcept;
|
||||||
|
|
||||||
void drawNewItemTemplate(StudioContext const &sctx) noexcept;
|
void drawNewItemTemplate(Context const &sctx) noexcept;
|
||||||
|
|
||||||
void drawButtons(Stage next) noexcept;
|
void drawButtons(Stage next) noexcept;
|
||||||
|
|
||||||
void drawFirstPageButtons(Stage next) noexcept;
|
void drawFirstPageButtons(Stage next) noexcept;
|
||||||
|
|
||||||
void drawLastPageButtons(StudioContext &sctx) noexcept;
|
void drawLastPageButtons(Context &sctx) noexcept;
|
||||||
|
|
||||||
void finish(StudioContext &sctx) noexcept;
|
void finish(Context &sctx) noexcept;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ bool NewProject::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewProject::draw(StudioContext &ctx) noexcept {
|
void NewProject::draw(Context &ctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
@@ -53,7 +53,7 @@ void NewProject::draw(StudioContext &ctx) noexcept {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewProject::drawNewProjectName(StudioContext &sctx) noexcept {
|
void NewProject::drawNewProjectName(Context &sctx) noexcept {
|
||||||
drawWindow(sctx.tctx, m_open, [this, &sctx] {
|
drawWindow(sctx.tctx, m_open, [this, &sctx] {
|
||||||
ig::InputText("Name", m_projectName);
|
ig::InputText("Name", m_projectName);
|
||||||
ImGui::Text("Path: %s", m_projectPath.c_str());
|
ImGui::Text("Path: %s", m_projectPath.c_str());
|
||||||
@@ -64,7 +64,7 @@ void NewProject::drawNewProjectName(StudioContext &sctx) noexcept {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void NewProject::drawLastPageButtons(StudioContext&) noexcept {
|
void NewProject::drawLastPageButtons(Context&) noexcept {
|
||||||
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 110);
|
ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetContentRegionAvail().x - 110);
|
||||||
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22);
|
ImGui::SetCursorPosY(ImGui::GetCursorPosY() + ImGui::GetContentRegionAvail().y - 22);
|
||||||
if (ig::PushButton("Finish")) {
|
if (ig::PushButton("Finish")) {
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ class NewProject: public studio::Popup {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept override;
|
bool isOpen() const noexcept override;
|
||||||
|
|
||||||
void draw(studio::StudioContext &ctx) noexcept override;
|
void draw(studio::Context &ctx) noexcept override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void drawNewProjectName(studio::StudioContext &ctx) noexcept;
|
void drawNewProjectName(studio::Context &ctx) noexcept;
|
||||||
|
|
||||||
void drawLastPageButtons(studio::StudioContext &ctx) noexcept;
|
void drawLastPageButtons(studio::Context &ctx) noexcept;
|
||||||
|
|
||||||
void finish() noexcept;
|
void finish() noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ bool RenameFile::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenameFile::draw(StudioContext &ctx) noexcept {
|
void RenameFile::draw(Context &ctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ class RenameFile: public Popup {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept override;
|
bool isOpen() const noexcept override;
|
||||||
|
|
||||||
void draw(StudioContext &ctx) noexcept override;
|
void draw(Context &ctx) noexcept override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
static bool shutdownHandler(turbine::Context &ctx) {
|
static bool shutdownHandler(turbine::Context &ctx) {
|
||||||
auto sctx = turbine::applicationData<StudioContext>(ctx);
|
auto sctx = turbine::applicationData<Context>(ctx);
|
||||||
return sctx->ui.handleShutdown();
|
return sctx->ui.handleShutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
void navigateTo(StudioContext &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept {
|
void navigateTo(Context &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept {
|
||||||
ctx.ui.navigateTo(std::move(filePath), std::move(navArgs));
|
ctx.ui.navigateTo(std::move(filePath), std::move(navArgs));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,10 +65,7 @@ OX_MODEL_END()
|
|||||||
StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexcept:
|
StudioUI::StudioUI(turbine::Context &ctx, ox::StringParam projectDataDir) noexcept:
|
||||||
m_sctx{*this, ctx},
|
m_sctx{*this, ctx},
|
||||||
m_tctx{ctx},
|
m_tctx{ctx},
|
||||||
m_projectDataDir{std::move(projectDataDir)},
|
m_projectDataDir{std::move(projectDataDir)} {
|
||||||
m_projectExplorer{keelCtx(m_tctx)},
|
|
||||||
m_newProject{m_projectDataDir},
|
|
||||||
m_aboutPopup{m_tctx} {
|
|
||||||
{
|
{
|
||||||
ImFontConfig fontCfg;
|
ImFontConfig fontCfg;
|
||||||
fontCfg.FontDataOwnedByAtlas = false;
|
fontCfg.FontDataOwnedByAtlas = false;
|
||||||
@@ -255,7 +252,7 @@ void StudioUI::drawMenu() noexcept {
|
|||||||
void StudioUI::drawTabBar() noexcept {
|
void StudioUI::drawTabBar() noexcept {
|
||||||
auto const viewport = ImGui::GetContentRegionAvail();
|
auto const viewport = ImGui::GetContentRegionAvail();
|
||||||
ImGui::BeginChild("TabWindow##MainWindow##Studio", ImVec2(viewport.x, viewport.y));
|
ImGui::BeginChild("TabWindow##MainWindow##Studio", ImVec2(viewport.x, viewport.y));
|
||||||
constexpr auto tabBarFlags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_TabListPopupButton;
|
constexpr auto tabBarFlags = ImGuiTabBarFlags_TabListPopupButton;
|
||||||
if (ImGui::BeginTabBar("TabBar##TabWindow##MainWindow##Studio", tabBarFlags)) {
|
if (ImGui::BeginTabBar("TabBar##TabWindow##MainWindow##Studio", tabBarFlags)) {
|
||||||
drawTabs();
|
drawTabs();
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
@@ -478,6 +475,18 @@ ox::Error StudioUI::handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR ne
|
|||||||
return m_projectExplorer.refreshProjectTreeModel();
|
return m_projectExplorer.refreshProjectTreeModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ox::Error StudioUI::handleDeleteDir(ox::StringViewCR path) noexcept {
|
||||||
|
auto const p = sfmt("{}/", path);
|
||||||
|
for (auto &e : m_editors) {
|
||||||
|
if (beginsWith(e->itemPath(), p)) {
|
||||||
|
oxLogError(closeFile(path));
|
||||||
|
m_closeActiveTab = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return m_projectExplorer.refreshProjectTreeModel();
|
||||||
|
}
|
||||||
|
|
||||||
ox::Error StudioUI::handleDeleteFile(ox::StringViewCR path) noexcept {
|
ox::Error StudioUI::handleDeleteFile(ox::StringViewCR path) noexcept {
|
||||||
for (auto &e : m_editors) {
|
for (auto &e : m_editors) {
|
||||||
if (path == e->itemPath()) {
|
if (path == e->itemPath()) {
|
||||||
@@ -523,6 +532,7 @@ ox::Error StudioUI::openProjectPath(ox::StringParam path) noexcept {
|
|||||||
m_newDirDialog.newDir.connect(m_sctx.project, &Project::mkdir);
|
m_newDirDialog.newDir.connect(m_sctx.project, &Project::mkdir);
|
||||||
m_project->dirAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
m_project->dirAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
||||||
m_project->fileAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
m_project->fileAdded.connect(&m_projectExplorer, &ProjectExplorer::refreshProjectTreeModel);
|
||||||
|
m_project->dirDeleted.connect(this, &StudioUI::handleDeleteDir);
|
||||||
m_project->fileDeleted.connect(this, &StudioUI::handleDeleteFile);
|
m_project->fileDeleted.connect(this, &StudioUI::handleDeleteFile);
|
||||||
m_project->fileMoved.connect(this, &StudioUI::handleMoveFile);
|
m_project->fileMoved.connect(this, &StudioUI::handleMoveFile);
|
||||||
m_openFiles.clear();
|
m_openFiles.clear();
|
||||||
@@ -588,7 +598,7 @@ ox::Error StudioUI::makeCopyDlg(ox::StringViewCR path) noexcept {
|
|||||||
|
|
||||||
ox::Error StudioUI::handleCloseAppResponse(ig::PopupResponse const response) noexcept {
|
ox::Error StudioUI::handleCloseAppResponse(ig::PopupResponse const response) noexcept {
|
||||||
if (response == ig::PopupResponse::OK && m_activeEditor) {
|
if (response == ig::PopupResponse::OK && m_activeEditor) {
|
||||||
turbine::requestShutdown(m_tctx);
|
turbine::requestShutdown(m_tctx, true);
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,14 +29,14 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
friend class StudioUIDrawer;
|
friend class StudioUIDrawer;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
StudioContext m_sctx;
|
Context m_sctx;
|
||||||
turbine::Context &m_tctx;
|
turbine::Context &m_tctx;
|
||||||
ox::String m_projectDataDir;
|
ox::String m_projectDataDir;
|
||||||
ox::UPtr<Project> m_project;
|
ox::UPtr<Project> m_project;
|
||||||
TaskRunner m_taskRunner;
|
TaskRunner m_taskRunner;
|
||||||
ox::Vector<ox::UPtr<BaseEditor>> m_editors;
|
ox::Vector<ox::UPtr<BaseEditor>> m_editors;
|
||||||
ox::HashMap<ox::String, EditorMaker::Func> m_editorMakers;
|
ox::HashMap<ox::String, EditorMaker::Func> m_editorMakers;
|
||||||
ProjectExplorer m_projectExplorer;
|
ProjectExplorer m_projectExplorer{keelCtx(m_tctx)};
|
||||||
ox::Vector<ox::String> m_openFiles;
|
ox::Vector<ox::String> m_openFiles;
|
||||||
BaseEditor *m_activeEditorOnLastDraw = nullptr;
|
BaseEditor *m_activeEditorOnLastDraw = nullptr;
|
||||||
BaseEditor *m_activeEditor = nullptr;
|
BaseEditor *m_activeEditor = nullptr;
|
||||||
@@ -45,6 +45,7 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
ox::Vector<ox::Pair<ox::String>> m_queuedMoves;
|
ox::Vector<ox::Pair<ox::String>> m_queuedMoves;
|
||||||
ox::Vector<ox::Pair<ox::String>> m_queuedDirMoves;
|
ox::Vector<ox::Pair<ox::String>> m_queuedDirMoves;
|
||||||
NewMenu m_newMenu{keelCtx(m_tctx)};
|
NewMenu m_newMenu{keelCtx(m_tctx)};
|
||||||
|
AboutPopup m_aboutPopup{m_tctx};
|
||||||
DeleteConfirmation m_deleteConfirmation;
|
DeleteConfirmation m_deleteConfirmation;
|
||||||
NewDir m_newDirDialog;
|
NewDir m_newDirDialog;
|
||||||
ig::QuestionPopup m_closeFileConfirm{"Close File?", "This file has unsaved changes. Close?"};
|
ig::QuestionPopup m_closeFileConfirm{"Close File?", "This file has unsaved changes. Close?"};
|
||||||
@@ -55,8 +56,7 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
ig::MessagePopup m_messagePopup{"Message", ""};
|
ig::MessagePopup m_messagePopup{"Message", ""};
|
||||||
MakeCopyPopup m_copyFilePopup;
|
MakeCopyPopup m_copyFilePopup;
|
||||||
RenameFile m_renameFile;
|
RenameFile m_renameFile;
|
||||||
NewProject m_newProject;
|
NewProject m_newProject{m_projectDataDir};
|
||||||
AboutPopup m_aboutPopup;
|
|
||||||
ox::Array<Widget*, 10> const m_widgets {
|
ox::Array<Widget*, 10> const m_widgets {
|
||||||
&m_closeFileConfirm,
|
&m_closeFileConfirm,
|
||||||
&m_closeAppConfirm,
|
&m_closeAppConfirm,
|
||||||
@@ -126,6 +126,8 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
|
|
||||||
ox::Error handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept;
|
ox::Error handleMoveFile(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id) noexcept;
|
||||||
|
|
||||||
|
ox::Error handleDeleteDir(ox::StringViewCR path) noexcept;
|
||||||
|
|
||||||
ox::Error handleDeleteFile(ox::StringViewCR path) noexcept;
|
ox::Error handleDeleteFile(ox::StringViewCR path) noexcept;
|
||||||
|
|
||||||
ox::Error createOpenProject(ox::StringViewCR path) noexcept;
|
ox::Error createOpenProject(ox::StringViewCR path) noexcept;
|
||||||
|
|||||||
@@ -14,19 +14,19 @@ namespace studio {
|
|||||||
|
|
||||||
class StudioUI;
|
class StudioUI;
|
||||||
|
|
||||||
struct StudioContext {
|
struct Context {
|
||||||
StudioUI &ui;
|
StudioUI &ui;
|
||||||
Project *project = nullptr;
|
Project *project = nullptr;
|
||||||
turbine::Context &tctx;
|
turbine::Context &tctx;
|
||||||
StudioContext(StudioUI &pUi, turbine::Context &pTctx) noexcept:
|
Context(StudioUI &pUi, turbine::Context &pTctx) noexcept:
|
||||||
ui(pUi), tctx(pTctx) {}
|
ui(pUi), tctx(pTctx) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
inline keel::Context &keelCtx(StudioContext &ctx) noexcept {
|
inline keel::Context &keelCtx(Context &ctx) noexcept {
|
||||||
return keelCtx(ctx.tctx);
|
return keelCtx(ctx.tctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void navigateTo(StudioContext &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept;
|
void navigateTo(Context &ctx, ox::StringParam filePath, ox::StringParam navArgs) noexcept;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class Editor: public studio::BaseEditor {
|
|||||||
ox::String m_itemName;
|
ox::String m_itemName;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Editor(StudioContext &ctx, ox::StringParam itemPath) noexcept;
|
Editor(Context &ctx, ox::StringParam itemPath) noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
ox::CStringView itemPath() const noexcept final;
|
ox::CStringView itemPath() const noexcept final;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class FilePickerPopup {
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
bool isOpen() const noexcept;
|
bool isOpen() const noexcept;
|
||||||
|
|
||||||
ox::Optional<ox::String> draw(StudioContext &ctx) noexcept;
|
ox::Optional<ox::String> draw(Context &ctx) noexcept;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class FileExplorer: public ox::SignalHandler {
|
|||||||
m_kctx{kctx},
|
m_kctx{kctx},
|
||||||
m_fileDraggable{fileDraggable} {}
|
m_fileDraggable{fileDraggable} {}
|
||||||
|
|
||||||
void draw(StudioContext &ctx, ImVec2 const &sz) const noexcept;
|
void draw(Context &ctx, ImVec2 const &sz) const noexcept;
|
||||||
|
|
||||||
void setModel(ox::UPtr<FileTreeModel> &&model, bool selectRoot = false) noexcept;
|
void setModel(ox::UPtr<FileTreeModel> &&model, bool selectRoot = false) noexcept;
|
||||||
|
|
||||||
|
|||||||
@@ -272,7 +272,7 @@ bool ComboBox(
|
|||||||
|
|
||||||
bool FileComboBox(
|
bool FileComboBox(
|
||||||
ox::CStringViewCR lbl,
|
ox::CStringViewCR lbl,
|
||||||
StudioContext &sctx,
|
Context &sctx,
|
||||||
ox::StringViewCR fileExt,
|
ox::StringViewCR fileExt,
|
||||||
size_t &selectedIdx) noexcept;
|
size_t &selectedIdx) noexcept;
|
||||||
|
|
||||||
@@ -295,7 +295,7 @@ bool ListBox(ox::CStringViewCR name, ox::SpanView<ox::String> const&list, size_t
|
|||||||
class FilePicker {
|
class FilePicker {
|
||||||
private:
|
private:
|
||||||
bool m_show{};
|
bool m_show{};
|
||||||
StudioContext &m_sctx;
|
Context &m_sctx;
|
||||||
ox::String const m_title;
|
ox::String const m_title;
|
||||||
ox::String const m_fileExt;
|
ox::String const m_fileExt;
|
||||||
ImVec2 const m_size;
|
ImVec2 const m_size;
|
||||||
@@ -303,7 +303,7 @@ class FilePicker {
|
|||||||
ox::Signal<ox::Error(ox::StringView)> filePicked;
|
ox::Signal<ox::Error(ox::StringView)> filePicked;
|
||||||
|
|
||||||
FilePicker(
|
FilePicker(
|
||||||
studio::StudioContext &sctx,
|
studio::Context &sctx,
|
||||||
ox::StringParam title,
|
ox::StringParam title,
|
||||||
ox::StringParam fileExt,
|
ox::StringParam fileExt,
|
||||||
ImVec2 const&size = {}) noexcept;
|
ImVec2 const&size = {}) noexcept;
|
||||||
@@ -348,7 +348,7 @@ class QuestionPopup: public Popup {
|
|||||||
|
|
||||||
QuestionPopup(ox::StringParam title, ox::StringParam question) noexcept;
|
QuestionPopup(ox::StringParam title, ox::StringParam question) noexcept;
|
||||||
|
|
||||||
void draw(StudioContext &ctx) noexcept override;
|
void draw(Context &ctx) noexcept override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -363,7 +363,7 @@ class MessagePopup: public Popup {
|
|||||||
|
|
||||||
void show(ox::StringParam msg) noexcept;
|
void show(ox::StringParam msg) noexcept;
|
||||||
|
|
||||||
void draw(StudioContext &ctx) noexcept override;
|
void draw(Context &ctx) noexcept override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ class ItemMaker {
|
|||||||
* @return path of file or error in Result
|
* @return path of file or error in Result
|
||||||
*/
|
*/
|
||||||
ox::Error write(
|
ox::Error write(
|
||||||
StudioContext &ctx,
|
Context &ctx,
|
||||||
ox::StringViewCR pPath,
|
ox::StringViewCR pPath,
|
||||||
size_t pTemplateIdx) const noexcept {
|
size_t pTemplateIdx) const noexcept {
|
||||||
return writeItem(ctx, pPath, pTemplateIdx);
|
return writeItem(ctx, pPath, pTemplateIdx);
|
||||||
@@ -177,7 +177,7 @@ class ItemMaker {
|
|||||||
* @return path of file or error in Result
|
* @return path of file or error in Result
|
||||||
*/
|
*/
|
||||||
ox::Error write(
|
ox::Error write(
|
||||||
StudioContext &ctx,
|
Context &ctx,
|
||||||
ox::StringViewCR pPath,
|
ox::StringViewCR pPath,
|
||||||
ox::StringViewCR pName,
|
ox::StringViewCR pName,
|
||||||
size_t pTemplateIdx) const noexcept {
|
size_t pTemplateIdx) const noexcept {
|
||||||
@@ -187,7 +187,7 @@ class ItemMaker {
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ox::Error writeItem(
|
virtual ox::Error writeItem(
|
||||||
StudioContext &ctx,
|
Context &ctx,
|
||||||
ox::StringViewCR pPath,
|
ox::StringViewCR pPath,
|
||||||
size_t pTemplateIdx) const noexcept = 0;
|
size_t pTemplateIdx) const noexcept = 0;
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ class ItemMakerT final: public ItemMaker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ox::Error writeItem(
|
ox::Error writeItem(
|
||||||
StudioContext &ctx,
|
Context &ctx,
|
||||||
ox::StringViewCR pPath,
|
ox::StringViewCR pPath,
|
||||||
size_t const pTemplateIdx) const noexcept override {
|
size_t const pTemplateIdx) const noexcept override {
|
||||||
createUuidMapping(keelCtx(ctx.tctx), pPath, ox::UUID::generate().unwrap());
|
createUuidMapping(keelCtx(ctx.tctx), pPath, ox::UUID::generate().unwrap());
|
||||||
|
|||||||
@@ -27,17 +27,17 @@ class Module {
|
|||||||
public:
|
public:
|
||||||
virtual ~Module() noexcept = default;
|
virtual ~Module() noexcept = default;
|
||||||
|
|
||||||
virtual ox::Vector<EditorMaker> editors(studio::StudioContext &ctx) const;
|
virtual ox::Vector<EditorMaker> editors(studio::Context &ctx) const;
|
||||||
|
|
||||||
virtual ox::Vector<ox::UPtr<ItemMaker>> itemMakers(studio::StudioContext&) const;
|
virtual ox::Vector<ox::UPtr<ItemMaker>> itemMakers(studio::Context&) const;
|
||||||
|
|
||||||
virtual ox::Vector<ox::UPtr<ItemTemplate>> itemTemplates(studio::StudioContext&) const;
|
virtual ox::Vector<ox::UPtr<ItemTemplate>> itemTemplates(studio::Context&) const;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename Editor>
|
template<typename Editor>
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
EditorMaker editorMaker(StudioContext &ctx, ox::StringParam ext) noexcept {
|
EditorMaker editorMaker(Context &ctx, ox::StringParam ext) noexcept {
|
||||||
return {
|
return {
|
||||||
{std::move(ext)},
|
{std::move(ext)},
|
||||||
[&ctx](ox::StringViewCR path) -> ox::Result<BaseEditor*> {
|
[&ctx](ox::StringViewCR path) -> ox::Result<BaseEditor*> {
|
||||||
@@ -48,7 +48,7 @@ EditorMaker editorMaker(StudioContext &ctx, ox::StringParam ext) noexcept {
|
|||||||
|
|
||||||
template<typename Editor>
|
template<typename Editor>
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
EditorMaker editorMaker(StudioContext &ctx, std::initializer_list<ox::StringView> exts) noexcept {
|
EditorMaker editorMaker(Context &ctx, std::initializer_list<ox::StringView> exts) noexcept {
|
||||||
return {
|
return {
|
||||||
[&exts] {
|
[&exts] {
|
||||||
ox::Vector<ox::String> fileTypes;
|
ox::Vector<ox::String> fileTypes;
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ enum class ProjectEvent {
|
|||||||
// FileRecognized is triggered for all matching files upon a new
|
// FileRecognized is triggered for all matching files upon a new
|
||||||
// subscription to a section of the project and upon the addition of a file.
|
// subscription to a section of the project and upon the addition of a file.
|
||||||
FileRecognized,
|
FileRecognized,
|
||||||
|
DirDeleted,
|
||||||
FileDeleted,
|
FileDeleted,
|
||||||
FileUpdated,
|
FileUpdated,
|
||||||
FileMoved,
|
FileMoved,
|
||||||
@@ -134,6 +135,7 @@ class Project: public ox::SignalHandler {
|
|||||||
// file.
|
// file.
|
||||||
ox::Signal<ox::Error(ox::StringViewCR)> fileRecognized;
|
ox::Signal<ox::Error(ox::StringViewCR)> fileRecognized;
|
||||||
ox::Signal<ox::Error(ox::StringViewCR)> fileDeleted;
|
ox::Signal<ox::Error(ox::StringViewCR)> fileDeleted;
|
||||||
|
ox::Signal<ox::Error(ox::StringViewCR)> dirDeleted;
|
||||||
ox::Signal<ox::Error(ox::StringViewCR path, ox::UUID const&id)> fileUpdated;
|
ox::Signal<ox::Error(ox::StringViewCR path, ox::UUID const&id)> fileUpdated;
|
||||||
ox::Signal<ox::Error(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id)> fileMoved;
|
ox::Signal<ox::Error(ox::StringViewCR oldPath, ox::StringViewCR newPath, ox::UUID const&id)> fileMoved;
|
||||||
|
|
||||||
@@ -201,6 +203,9 @@ ox::Error Project::subscribe(ProjectEvent e, ox::SignalHandler *tgt, Functor &&s
|
|||||||
connect(this, &Project::fileRecognized, tgt, slot);
|
connect(this, &Project::fileRecognized, tgt, slot);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ProjectEvent::DirDeleted:
|
||||||
|
connect(this, &Project::dirDeleted, tgt, slot);
|
||||||
|
break;
|
||||||
case ProjectEvent::FileDeleted:
|
case ProjectEvent::FileDeleted:
|
||||||
connect(this, &Project::fileDeleted, tgt, slot);
|
connect(this, &Project::fileDeleted, tgt, slot);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace studio {
|
|||||||
class Widget: public ox::SignalHandler {
|
class Widget: public ox::SignalHandler {
|
||||||
public:
|
public:
|
||||||
~Widget() noexcept override = default;
|
~Widget() noexcept override = default;
|
||||||
virtual void draw(StudioContext&) noexcept = 0;
|
virtual void draw(Context&) noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ UndoStack *BaseEditor::undoStack() noexcept {
|
|||||||
void BaseEditor::navigateTo(ox::StringViewCR) noexcept {}
|
void BaseEditor::navigateTo(ox::StringViewCR) noexcept {}
|
||||||
|
|
||||||
|
|
||||||
Editor::Editor(StudioContext &ctx, ox::StringParam itemPath) noexcept:
|
Editor::Editor(Context &ctx, ox::StringParam itemPath) noexcept:
|
||||||
m_itemPath(std::move(itemPath)),
|
m_itemPath(std::move(itemPath)),
|
||||||
m_itemName(m_itemPath.substr(std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset() + 1)) {
|
m_itemName(m_itemPath.substr(std::find(m_itemPath.rbegin(), m_itemPath.rend(), '/').offset() + 1)) {
|
||||||
m_undoStack.changeTriggered.connect(this, &Editor::markUnsavedChanges);
|
m_undoStack.changeTriggered.connect(this, &Editor::markUnsavedChanges);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ bool FilePickerPopup::isOpen() const noexcept {
|
|||||||
return m_open;
|
return m_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Optional<ox::String> FilePickerPopup::draw(StudioContext &ctx) noexcept {
|
ox::Optional<ox::String> FilePickerPopup::draw(Context &ctx) noexcept {
|
||||||
ox::Optional<ox::String> out;
|
ox::Optional<ox::String> out;
|
||||||
if (!m_open) {
|
if (!m_open) {
|
||||||
return out;
|
return out;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
void FileExplorer::draw(StudioContext &ctx, ImVec2 const &sz) const noexcept {
|
void FileExplorer::draw(Context &ctx, ImVec2 const &sz) const noexcept {
|
||||||
ImGui::BeginChild("ProjectExplorer", sz, true);
|
ImGui::BeginChild("ProjectExplorer", sz, true);
|
||||||
ImGui::SetNextItemOpen(true);
|
ImGui::SetNextItemOpen(true);
|
||||||
if (m_treeModel) {
|
if (m_treeModel) {
|
||||||
@@ -93,6 +93,9 @@ void FileTreeModel::draw(turbine::Context &tctx) const noexcept {
|
|||||||
if (ImGui::IsItemActivated() || ImGui::IsItemClicked(1)) {
|
if (ImGui::IsItemActivated() || ImGui::IsItemClicked(1)) {
|
||||||
m_explorer.setSelectedNode(this);
|
m_explorer.setSelectedNode(this);
|
||||||
}
|
}
|
||||||
|
if (ImGui::IsItemFocused() && ImGui::IsKeyPressed(ImGuiKey_Delete)) {
|
||||||
|
m_explorer.fileDeleted(m_fullPath);
|
||||||
|
}
|
||||||
ig::IDStackItem const idStackItem{m_name};
|
ig::IDStackItem const idStackItem{m_name};
|
||||||
m_explorer.drawDirContextMenu(m_fullPath);
|
m_explorer.drawDirContextMenu(m_fullPath);
|
||||||
if (m_explorer.fileDraggable()) {
|
if (m_explorer.fileDraggable()) {
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ bool ComboBox(
|
|||||||
|
|
||||||
bool FileComboBox(
|
bool FileComboBox(
|
||||||
ox::CStringViewCR lbl,
|
ox::CStringViewCR lbl,
|
||||||
StudioContext &sctx,
|
Context &sctx,
|
||||||
ox::StringViewCR fileExt,
|
ox::StringViewCR fileExt,
|
||||||
size_t &selectedIdx) noexcept {
|
size_t &selectedIdx) noexcept {
|
||||||
auto const&list = sctx.project->fileList(fileExt);
|
auto const&list = sctx.project->fileList(fileExt);
|
||||||
@@ -213,7 +213,7 @@ bool ListBox(ox::CStringViewCR name, ox::SpanView<ox::CStringView> const&list, s
|
|||||||
|
|
||||||
|
|
||||||
FilePicker::FilePicker(
|
FilePicker::FilePicker(
|
||||||
StudioContext &sctx,
|
Context &sctx,
|
||||||
ox::StringParam title,
|
ox::StringParam title,
|
||||||
ox::StringParam fileExt,
|
ox::StringParam fileExt,
|
||||||
ImVec2 const&size) noexcept:
|
ImVec2 const&size) noexcept:
|
||||||
@@ -267,7 +267,7 @@ QuestionPopup::QuestionPopup(ox::StringParam title, ox::StringParam question) no
|
|||||||
m_question{std::move(question)} {
|
m_question{std::move(question)} {
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestionPopup::draw(StudioContext &ctx) noexcept {
|
void QuestionPopup::draw(Context &ctx) noexcept {
|
||||||
switch (m_stage) {
|
switch (m_stage) {
|
||||||
case Stage::Closed:
|
case Stage::Closed:
|
||||||
break;
|
break;
|
||||||
@@ -312,7 +312,7 @@ void MessagePopup::show(ox::StringParam msg) noexcept {
|
|||||||
open();
|
open();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagePopup::draw(StudioContext &ctx) noexcept {
|
void MessagePopup::draw(Context &ctx) noexcept {
|
||||||
switch (m_stage) {
|
switch (m_stage) {
|
||||||
case Stage::Closed:
|
case Stage::Closed:
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -6,15 +6,15 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
ox::Vector<EditorMaker> Module::editors(StudioContext&) const {
|
ox::Vector<EditorMaker> Module::editors(Context&) const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Vector<ox::UPtr<ItemMaker>> Module::itemMakers(StudioContext&) const {
|
ox::Vector<ox::UPtr<ItemMaker>> Module::itemMakers(Context&) const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Vector<ox::UPtr<ItemTemplate>> Module::itemTemplates(StudioContext&) const {
|
ox::Vector<ox::UPtr<ItemTemplate>> Module::itemTemplates(Context&) const {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ ox::Error Project::deleteItem(ox::StringViewCR path) noexcept {
|
|||||||
}
|
}
|
||||||
auto const err = m_fs.remove(path);
|
auto const err = m_fs.remove(path);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
fileDeleted.emit(path);
|
dirDeleted.emit(path);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ ox::Error run(Context &ctx) noexcept;
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TimeMs ticksMs(Context const&ctx) noexcept;
|
TimeMs ticksMs(Context const&ctx) noexcept;
|
||||||
|
|
||||||
void requestShutdown(Context &ctx) noexcept;
|
void requestShutdown(Context &ctx, bool force = false) noexcept;
|
||||||
|
|
||||||
using ShutdownHandler = bool (*)(Context&);
|
using ShutdownHandler = bool (*)(Context&);
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ bool buttonDown(Context const&, Key k) noexcept {
|
|||||||
return k <= Key::GamePad_L && !(REG_GAMEPAD & (1 << static_cast<int>(k)));
|
return k <= Key::GamePad_L && !(REG_GAMEPAD & (1 << static_cast<int>(k)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void requestShutdown(Context &ctx) noexcept {
|
void requestShutdown(Context &ctx, bool) noexcept {
|
||||||
ctx.running = false;
|
ctx.running = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,14 @@ static void handleGlfwKeyEvent(GLFWwindow *window, int key, int, int action, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handleGlfwWindowCloseEvent(GLFWwindow *window) noexcept {
|
||||||
|
auto &ctx = *static_cast<Context*>(glfwGetWindowUserPointer(window));
|
||||||
|
ctx.mandatoryRefreshPeriodEnd = ticksMs(ctx) + config::MandatoryRefreshPeriod;
|
||||||
|
ctx.running = ctx.shutdownHandler ? !ctx.shutdownHandler(ctx) : false;
|
||||||
|
glfwSetWindowShouldClose(window, !ctx.running);
|
||||||
|
glfwPostEmptyEvent();
|
||||||
|
}
|
||||||
|
|
||||||
#if TURBINE_USE_IMGUI
|
#if TURBINE_USE_IMGUI
|
||||||
static void themeImgui() noexcept {
|
static void themeImgui() noexcept {
|
||||||
// Dark Ruda style by Raikiri from ImThemes
|
// Dark Ruda style by Raikiri from ImThemes
|
||||||
@@ -210,6 +218,7 @@ ox::Error initGfx(Context &ctx) noexcept {
|
|||||||
glfwSetCursorPosCallback(ctx.window, handleGlfwCursorPosEvent);
|
glfwSetCursorPosCallback(ctx.window, handleGlfwCursorPosEvent);
|
||||||
glfwSetMouseButtonCallback(ctx.window, handleGlfwMouseButtonEvent);
|
glfwSetMouseButtonCallback(ctx.window, handleGlfwMouseButtonEvent);
|
||||||
glfwSetKeyCallback(ctx.window, handleGlfwKeyEvent);
|
glfwSetKeyCallback(ctx.window, handleGlfwKeyEvent);
|
||||||
|
glfwSetWindowCloseCallback(ctx.window, handleGlfwWindowCloseEvent);
|
||||||
glfwSetWindowUserPointer(ctx.window, &ctx);
|
glfwSetWindowUserPointer(ctx.window, &ctx);
|
||||||
glfwMakeContextCurrent(ctx.window);
|
glfwMakeContextCurrent(ctx.window);
|
||||||
if (!gladLoadGLES2Loader(reinterpret_cast<GLADloadproc>(glfwGetProcAddress))) {
|
if (!gladLoadGLES2Loader(reinterpret_cast<GLADloadproc>(glfwGetProcAddress))) {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ ox::Error run(Context &ctx) noexcept {
|
|||||||
ctx.wakeupTime = ticks + static_cast<unsigned>(st);
|
ctx.wakeupTime = ticks + static_cast<unsigned>(st);
|
||||||
sleepTime = static_cast<uint64_t>(st);
|
sleepTime = static_cast<uint64_t>(st);
|
||||||
} else {
|
} else {
|
||||||
ctx.wakeupTime = ~uint64_t(0);
|
ctx.wakeupTime = ~uint64_t{0};
|
||||||
sleepTime = ctx.wakeupTime - ticks;
|
sleepTime = ctx.wakeupTime - ticks;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -104,12 +104,6 @@ ox::Error run(Context &ctx) noexcept {
|
|||||||
if (realSleepTime && ctx.mandatoryRefreshPeriodEnd <= ticks) {
|
if (realSleepTime && ctx.mandatoryRefreshPeriodEnd <= ticks) {
|
||||||
glfwWaitEventsTimeout(static_cast<double>(realSleepTime) / 1000);
|
glfwWaitEventsTimeout(static_cast<double>(realSleepTime) / 1000);
|
||||||
}
|
}
|
||||||
if (glfwWindowShouldClose(ctx.window)) {
|
|
||||||
if (ctx.shutdownHandler(ctx)) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
glfwSetWindowShouldClose(ctx.window, false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
shutdown(ctx);
|
shutdown(ctx);
|
||||||
return {};
|
return {};
|
||||||
@@ -125,8 +119,13 @@ bool buttonDown(Context const&ctx, Key const key) noexcept {
|
|||||||
return (ctx.keysDown >> static_cast<int>(key)) & 1;
|
return (ctx.keysDown >> static_cast<int>(key)) & 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void requestShutdown(Context &ctx) noexcept {
|
void requestShutdown(Context &ctx, bool const force) noexcept {
|
||||||
|
glfwSetWindowShouldClose(ctx.window, true);
|
||||||
|
if (force) {
|
||||||
ctx.running = false;
|
ctx.running = false;
|
||||||
|
} else {
|
||||||
|
ctx.running = ctx.shutdownHandler ? !ctx.shutdownHandler(ctx) : false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void setShutdownHandler(Context &ctx, ShutdownHandler const handler) noexcept {
|
void setShutdownHandler(Context &ctx, ShutdownHandler const handler) noexcept {
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import pathlib
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
tool_name = 'file-to-cpp'
|
||||||
|
|
||||||
|
|
||||||
def write_txt_file(path: str, txt: str):
|
def write_txt_file(path: str, txt: str):
|
||||||
with open(path, "w") as f:
|
with open(path, "w") as f:
|
||||||
f.write(txt)
|
f.write(txt)
|
||||||
@@ -22,6 +25,7 @@ def write_txt_file(path: str, txt: str):
|
|||||||
|
|
||||||
|
|
||||||
def file_to_hex(path: str, line_prefix: str) -> tuple[str, int]:
|
def file_to_hex(path: str, line_prefix: str) -> tuple[str, int]:
|
||||||
|
try:
|
||||||
with open(path, 'rb') as f:
|
with open(path, 'rb') as f:
|
||||||
out = line_prefix
|
out = line_prefix
|
||||||
data = f.read()
|
data = f.read()
|
||||||
@@ -31,6 +35,9 @@ def file_to_hex(path: str, line_prefix: str) -> tuple[str, int]:
|
|||||||
out += '\n\t' if i % 10 == 0 else ' '
|
out += '\n\t' if i % 10 == 0 else ' '
|
||||||
i += 1
|
i += 1
|
||||||
return out[:-1], len(data)
|
return out[:-1], len(data)
|
||||||
|
except FileNotFoundError:
|
||||||
|
print(f'{tool_name}: included file not found: {path}', file=sys.stderr)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def file_to_cpp(path: str, cpp_name: str) -> tuple[str, str]:
|
def file_to_cpp(path: str, cpp_name: str) -> tuple[str, str]:
|
||||||
@@ -67,11 +74,11 @@ def proc_rsrc_file(rsrc_path: str):# Open and read the JSON file
|
|||||||
all_files_func += f'\nox::Vector<ox::SpanView<uint8_t>> {all_files}() noexcept {{\n\treturn {{\n'
|
all_files_func += f'\nox::Vector<ox::SpanView<uint8_t>> {all_files}() noexcept {{\n\treturn {{\n'
|
||||||
for f in data['files']:
|
for f in data['files']:
|
||||||
if 'path' not in f:
|
if 'path' not in f:
|
||||||
print('src file path missing', file=sys.stderr)
|
print(f'{tool_name}: src file path missing', file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
path = f['path']
|
path = f['path']
|
||||||
if 'cpp_name' not in f:
|
if 'cpp_name' not in f:
|
||||||
print('var name missing', file=sys.stderr)
|
print(f'{tool_name}: var name missing', file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
cpp_name = f['cpp_name']
|
cpp_name = f['cpp_name']
|
||||||
c, h = file_to_cpp(os.path.join(base_path, path), cpp_name)
|
c, h = file_to_cpp(os.path.join(base_path, path), cpp_name)
|
||||||
|
|||||||
37
util/scripts/pkg-dmg.py
Executable file
37
util/scripts/pkg-dmg.py
Executable file
@@ -0,0 +1,37 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def rm(path: str):
|
||||||
|
file_exists = os.path.exists(path)
|
||||||
|
is_link = os.path.islink(path)
|
||||||
|
is_dir = os.path.isdir(path)
|
||||||
|
if (file_exists or is_link) and not is_dir:
|
||||||
|
os.remove(path)
|
||||||
|
elif os.path.isdir(path):
|
||||||
|
shutil.rmtree(path)
|
||||||
|
|
||||||
|
|
||||||
|
def mkdir_p(path: str):
|
||||||
|
if not os.path.exists(path):
|
||||||
|
os.mkdir(path)
|
||||||
|
|
||||||
|
|
||||||
|
def run(args: list[str]):
|
||||||
|
if subprocess.run(args).returncode != 0:
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dmg_dir = 'dist/darwin-arm64-release/NostalgiaStudio'
|
||||||
|
dmg = f'{dmg_dir}.dmg'
|
||||||
|
rm(dmg)
|
||||||
|
rm(dmg_dir)
|
||||||
|
mkdir_p(dmg_dir)
|
||||||
|
shutil.copytree('dist/darwin-arm64-release/NostalgiaStudio.app', f'{dmg_dir}/NostalgiaStudio.app')
|
||||||
|
os.symlink('/Applications', f'{dmg_dir}/Applications')
|
||||||
|
run(['hdiutil', 'create', '-srcfolder', dmg_dir, dmg])
|
||||||
|
rm(dmg_dir)
|
||||||
Reference in New Issue
Block a user