Compare commits
1 Commits
release-d2
...
833ce33015
Author | SHA1 | Date | |
---|---|---|---|
833ce33015 |
7
deps/buildcore/scripts/pybb.py
vendored
7
deps/buildcore/scripts/pybb.py
vendored
@@ -11,7 +11,6 @@
|
|||||||
# "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
|
||||||
@@ -58,11 +57,7 @@ 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, f'-j{multiprocessing.cpu_count()}']
|
args = ['cmake', '--build', path]
|
||||||
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,6 +24,9 @@ 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>
|
||||||
|
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 m_buff.data();
|
return static_cast<const char*>(m_buff.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr explicit operator const char*() const {
|
inline explicit operator const char*() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if __has_include(<string>)
|
#if __has_include(<string>)
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
std::string toStdString() const {
|
inline std::string toStdString() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
explicit operator std::string() const {
|
inline explicit operator std::string() const {
|
||||||
return c_str();
|
return c_str();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
5
project/.nostalgia/type_descriptors/B.int32;0
Normal file
5
project/.nostalgia/type_descriptors/B.int32;0
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"length" : 4,
|
||||||
|
"primitiveType" : 1,
|
||||||
|
"typeName" : "B.int32"
|
||||||
|
}
|
5
project/.nostalgia/type_descriptors/B.int8;0
Normal file
5
project/.nostalgia/type_descriptors/B.int8;0
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"length" : 1,
|
||||||
|
"primitiveType" : 1,
|
||||||
|
"typeName" : "B.int8"
|
||||||
|
}
|
4
project/.nostalgia/type_descriptors/B.string;0
Normal file
4
project/.nostalgia/type_descriptors/B.string;0
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"primitiveType" : 4,
|
||||||
|
"typeName" : "B.string"
|
||||||
|
}
|
4
project/.nostalgia/type_descriptors/B.uint16;0
Normal file
4
project/.nostalgia/type_descriptors/B.uint16;0
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"length" : 2,
|
||||||
|
"typeName" : "B.uint16"
|
||||||
|
}
|
4
project/.nostalgia/type_descriptors/B.uint64;0
Normal file
4
project/.nostalgia/type_descriptors/B.uint64;0
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"length" : 8,
|
||||||
|
"typeName" : "B.uint64"
|
||||||
|
}
|
4
project/.nostalgia/type_descriptors/B.uint8;0
Normal file
4
project/.nostalgia/type_descriptors/B.uint8;0
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"length" : 1,
|
||||||
|
"typeName" : "B.uint8"
|
||||||
|
}
|
@@ -0,0 +1,39 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,12 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,19 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,34 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,31 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,42 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,42 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,46 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,20 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,28 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,31 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,46 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,24 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,41 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,88 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,33 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,9 @@
|
|||||||
|
O1;net.drinkingtea.ox.TypeDescriptor;1;{
|
||||||
|
"primitiveType" : 4,
|
||||||
|
"typeName" : "net.drinkingtea.ox.BasicString",
|
||||||
|
"typeParams" :
|
||||||
|
[
|
||||||
|
"8"
|
||||||
|
],
|
||||||
|
"typeVersion" : 1
|
||||||
|
}
|
@@ -0,0 +1,20 @@
|
|||||||
|
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
|
||||||
|
}
|
@@ -0,0 +1,16 @@
|
|||||||
|
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,35 +1,14 @@
|
|||||||
# d2025.06.0
|
|
||||||
|
|
||||||
* Add ability to remember recent projects in config
|
|
||||||
* PaletteEditor: Add RGB key shortcuts for focusing color channels
|
|
||||||
|
|
||||||
# d2025.05.2
|
|
||||||
|
|
||||||
* TileSheetEditor: Fix manual redo of draw actions, fix drawing to pixel 0, 0 as first action (cce5f52f96511694afd98f0b9b6b1f19c06ecd20)
|
|
||||||
* TileSheetEditor: Fix draw command to work on same pixel after switching subsheets (514cb978351ee4b0a5335c22a506a6d9f608f0a7)
|
|
||||||
|
|
||||||
# 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
|
# d2025.05.0
|
||||||
|
|
||||||
* Add app icon for both window and file
|
* Add app icon for both window and file
|
||||||
* Change application font to Roboto Medium
|
|
||||||
* Closing application will now confirm with user if any files have unsaved
|
* Closing application will now confirm with user if any files have unsaved
|
||||||
changes.
|
changes.
|
||||||
* UUID duplicates will now be reported when opening a project
|
* Fix selection clearing in TileSheet editor to work when clicking outside
|
||||||
* 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.
|
||||||
* TileSheetEditor: Fix Delete Tile functionality, which was completely broken
|
* Fix color number key range in PalettEditor. Previously, pressing A caused the
|
||||||
* PaletteEditor: Fix color number key range in. Previously, pressing A caused
|
editor to jump to the last color.
|
||||||
the editor to jump to the last color.
|
* UUID duplicates will now be reported when opening a project
|
||||||
* PaletteEditor: page rename will now take effect upon pressing enter if the
|
* PalettEditor: page rename will now take effect upon pressing enter if the
|
||||||
text input has focus
|
text input has focus
|
||||||
|
|
||||||
# d2025.02.1
|
# d2025.02.1
|
||||||
|
BIN
sample_project/Scenes/Chester.nscn
Normal file
BIN
sample_project/Scenes/Chester.nscn
Normal file
Binary file not shown.
@@ -27,14 +27,11 @@ 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):
|
TileSheetClipboard const&cb) noexcept:
|
||||||
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);
|
TileSheetClipboard const&cb) noexcept;
|
||||||
|
|
||||||
ox::Error redo() noexcept final;
|
ox::Error redo() noexcept final;
|
||||||
|
|
||||||
|
@@ -8,14 +8,14 @@
|
|||||||
|
|
||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
DeleteTilesCommand::DeleteTilesCommand(
|
gfx::DeleteTilesCommand::DeleteTilesCommand(
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
std::size_t const tileIdx,
|
std::size_t tileIdx,
|
||||||
std::size_t const tileCnt) noexcept:
|
std::size_t tileCnt) noexcept:
|
||||||
m_img(img),
|
m_img(img),
|
||||||
m_idx(std::move(idx)) {
|
m_idx(std::move(idx)) {
|
||||||
constexpr unsigned bytesPerTile = PixelsPerTile;
|
const unsigned bytesPerTile = m_img.bpp == 4 ? PixelsPerTile / 2 : 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,20 +28,16 @@ DeleteTilesCommand::DeleteTilesCommand(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ox::Error DeleteTilesCommand::redo() noexcept {
|
ox::Error gfx::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 const srcPos = m_deletePos + m_deleteSz;
|
auto 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 {};
|
||||||
}
|
}
|
||||||
@@ -50,14 +46,11 @@ 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 sz = p.size() - m_deletePos - m_deleteSz;
|
|
||||||
auto const srcPos = m_deletePos + m_deleteSz;
|
|
||||||
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
|
||||||
if (srcPos < p.size()) {
|
|
||||||
auto const dst1 = &p[m_deletePos + m_deleteSz];
|
auto const dst1 = &p[m_deletePos + m_deleteSz];
|
||||||
ox::memmove(dst1, src, sz);
|
|
||||||
}
|
|
||||||
auto const dst2 = src;
|
auto const dst2 = src;
|
||||||
|
auto const sz = p.size() - m_deletePos - m_deleteSz;
|
||||||
|
OX_ALLOW_UNSAFE_BUFFERS_BEGIN
|
||||||
|
ox::memmove(dst1, src, sz);
|
||||||
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,19 +9,20 @@ namespace nostalgia::gfx {
|
|||||||
InsertTilesCommand::InsertTilesCommand(
|
InsertTilesCommand::InsertTilesCommand(
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
std::size_t const tileIdx,
|
std::size_t tileIdx,
|
||||||
std::size_t const tileCnt) noexcept:
|
std::size_t tileCnt) noexcept:
|
||||||
m_img{img},
|
m_img(img),
|
||||||
m_idx{std::move(idx)} {
|
m_idx(std::move(idx)) {
|
||||||
m_insertPos = tileIdx * PixelsPerTile;
|
const unsigned bytesPerTile = m_img.bpp == 4 ? PixelsPerTile / 2 : PixelsPerTile;
|
||||||
m_insertCnt = tileCnt * PixelsPerTile;
|
m_insertPos = tileIdx * bytesPerTile;
|
||||||
|
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 const dst = m_deletedPixels.begin();
|
auto dst = m_deletedPixels.begin();
|
||||||
auto const src = p.begin() + p.size() - m_insertCnt;
|
auto src = p.begin() + p.size() - m_insertCnt;
|
||||||
ox::copy_n(src, m_insertCnt, dst);
|
ox::copy_n(src, m_insertCnt, dst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,7 +32,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 const dstPos = m_insertPos + m_insertCnt;
|
auto 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 {
|
||||||
|
|
||||||
PaletteChangeCommand::PaletteChangeCommand(
|
gfx::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 {
|
||||||
|
|
||||||
UpdateSubSheetCommand::UpdateSubSheetCommand(
|
gfx::UpdateSubSheetCommand::UpdateSubSheetCommand(
|
||||||
TileSheet &img,
|
TileSheet &img,
|
||||||
TileSheet::SubSheetIdx idx,
|
TileSheet::SubSheetIdx idx,
|
||||||
ox::StringParam name,
|
ox::StringParam name,
|
||||||
|
@@ -46,13 +46,13 @@ Palette const TileSheetEditorModel::s_defaultPalette = {
|
|||||||
|
|
||||||
TileSheetEditorModel::TileSheetEditorModel(
|
TileSheetEditorModel::TileSheetEditorModel(
|
||||||
studio::Context &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,27 +67,19 @@ 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();
|
||||||
if (iterateSelectionRows(*m_selection, [&](int const x, int const y) {
|
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);
|
||||||
if (idx >= s.pixels.size()) {
|
auto const c = getPixel(s, idx);
|
||||||
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));
|
||||||
if (auto const cmd = ox::makeCatch<CutPasteCommand>(
|
std::ignore = pushCommand(ox::make<CutPasteCommand>(
|
||||||
CommandId::Cut, m_img, m_activeSubsSheetIdx, pt1, pt2, blankCb); cmd.ok()) {
|
CommandId::Cut, m_img, m_activeSubsSheetIdx, pt1, pt2, blankCb));
|
||||||
std::ignore = pushCommand(cmd.value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditorModel::copy() {
|
void TileSheetEditorModel::copy() {
|
||||||
@@ -95,20 +87,14 @@ void TileSheetEditorModel::copy() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto cb = ox::make_unique<TileSheetClipboard>();
|
auto cb = ox::make_unique<TileSheetClipboard>();
|
||||||
if (iterateSelectionRows(*m_selection, [&](int const x, int const y) {
|
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);
|
||||||
if (idx >= s.pixels.size()) {
|
auto const c = getPixel(s, idx);
|
||||||
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));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,10 +111,8 @@ 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};
|
||||||
if (auto const cmd = ox::makeCatch<CutPasteCommand>(
|
std::ignore = pushCommand(ox::make<CutPasteCommand>(
|
||||||
CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb); cmd.ok()) {
|
CommandId::Paste, m_img, m_activeSubsSheetIdx, pt1, pt2, *cb));
|
||||||
std::ignore = pushCommand(cmd.value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TileSheetEditorModel::acceptsClipboardPayload() const noexcept {
|
bool TileSheetEditorModel::acceptsClipboardPayload() const noexcept {
|
||||||
@@ -168,7 +152,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 (activeSubSheet.pixels[idx] != palIdx) {
|
} else if (getPixel(activeSubSheet, 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)));
|
||||||
}
|
}
|
||||||
@@ -198,7 +182,6 @@ void TileSheetEditorModel::endDrawCommand() noexcept {
|
|||||||
if (m_ongoingDrawCommand) {
|
if (m_ongoingDrawCommand) {
|
||||||
m_ongoingDrawCommand->finish();
|
m_ongoingDrawCommand->finish();
|
||||||
m_ongoingDrawCommand = nullptr;
|
m_ongoingDrawCommand = nullptr;
|
||||||
m_lastDrawUpdatePt = {-1, -1};
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,8 +213,6 @@ 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();
|
|
||||||
m_lastDrawUpdatePt = {-1, -1};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TileSheetEditorModel::fill(ox::Point const&pt, int const palIdx) noexcept {
|
void TileSheetEditorModel::fill(ox::Point const&pt, int const palIdx) noexcept {
|
||||||
@@ -400,7 +381,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] || activeSubSheet.pixels[idx] != oldColor) {
|
if (pixels[relIdx] || getPixel(activeSubSheet, idx) != oldColor) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// mark pixels to update
|
// mark pixels to update
|
||||||
@@ -438,7 +419,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{cmd});
|
std::ignore = m_undoStack.push(ox::UPtr<studio::UndoCommand>{cmd});
|
||||||
m_ongoingDrawCommand = dynamic_cast<DrawCommand*>(cmd);
|
m_ongoingDrawCommand = dynamic_cast<DrawCommand*>(cmd);
|
||||||
m_updated = true;
|
m_updated = true;
|
||||||
return {};
|
return {};
|
||||||
|
@@ -35,7 +35,7 @@ class TileSheetEditorModel: public ox::SignalHandler {
|
|||||||
studio::SelectionTracker m_selTracker;
|
studio::SelectionTracker m_selTracker;
|
||||||
ox::Optional<studio::Selection> m_selection;
|
ox::Optional<studio::Selection> m_selection;
|
||||||
ox::Point m_lineStartPt;
|
ox::Point m_lineStartPt;
|
||||||
ox::Point m_lastDrawUpdatePt{-1, -1};
|
ox::Point m_lastDrawUpdatePt;
|
||||||
bool m_updated = false;
|
bool m_updated = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@@ -15,7 +15,7 @@ target_link_libraries(
|
|||||||
|
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
NostalgiaStudio PUBLIC
|
NostalgiaStudio PUBLIC
|
||||||
OLYMPIC_APP_VERSION="d2025.05.1"
|
OLYMPIC_APP_VERSION="dev build"
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
|
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>d2025.05.1</string>
|
<string>dev build</string>
|
||||||
|
|
||||||
<key>LSMinimumSystemVersion</key>
|
<key>LSMinimumSystemVersion</key>
|
||||||
<string>12.0.0</string>
|
<string>12.0.0</string>
|
||||||
|
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
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(Context &ctx, ox::StringViewCR assetId) noexcept {
|
ox::Error reloadAsset(keel::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,10 +13,22 @@ extern ox::String appVersion;
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept: Popup("About") {
|
AboutPopup::AboutPopup(turbine::Context &ctx) noexcept {
|
||||||
m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::appVersion);
|
m_text = ox::sfmt("{} - {}", keelCtx(ctx).appName, olympic::appVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AboutPopup::open() 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(Context &sctx) noexcept {
|
void AboutPopup::draw(Context &sctx) noexcept {
|
||||||
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
if (ImGui::IsKeyPressed(ImGuiKey_Escape)) {
|
||||||
close();
|
close();
|
||||||
@@ -35,7 +47,7 @@ void AboutPopup::draw(Context &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\n\nBuild date: %s", m_text.c_str(), __DATE__);
|
ImGui::Text("%s", m_text.c_str());
|
||||||
ImGui::NewLine();
|
ImGui::NewLine();
|
||||||
ImGui::Dummy({148.0f, 0.0f});
|
ImGui::Dummy({148.0f, 0.0f});
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
@@ -13,14 +13,29 @@
|
|||||||
|
|
||||||
namespace studio {
|
namespace studio {
|
||||||
|
|
||||||
class AboutPopup final: public ig::Popup {
|
class AboutPopup: public studio::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 draw(Context &sctx) noexcept override;
|
void open() noexcept override;
|
||||||
|
|
||||||
|
void close() noexcept override;
|
||||||
|
|
||||||
|
[[nodiscard]]
|
||||||
|
bool isOpen() const noexcept override;
|
||||||
|
|
||||||
|
void draw(studio::Context &sctx) noexcept override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -65,7 +65,10 @@ 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;
|
||||||
@@ -252,7 +255,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_TabListPopupButton;
|
constexpr auto tabBarFlags = ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_TabListPopupButton;
|
||||||
if (ImGui::BeginTabBar("TabBar##TabWindow##MainWindow##Studio", tabBarFlags)) {
|
if (ImGui::BeginTabBar("TabBar##TabWindow##MainWindow##Studio", tabBarFlags)) {
|
||||||
drawTabs();
|
drawTabs();
|
||||||
ImGui::EndTabBar();
|
ImGui::EndTabBar();
|
||||||
@@ -475,18 +478,6 @@ 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()) {
|
||||||
@@ -532,7 +523,6 @@ 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();
|
||||||
|
@@ -36,7 +36,7 @@ class StudioUI: public ox::SignalHandler {
|
|||||||
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{keelCtx(m_tctx)};
|
ProjectExplorer m_projectExplorer;
|
||||||
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,7 +45,6 @@ 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?"};
|
||||||
@@ -56,7 +55,8 @@ 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{m_projectDataDir};
|
NewProject m_newProject;
|
||||||
|
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,8 +126,6 @@ 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;
|
||||||
|
@@ -23,7 +23,6 @@ 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,
|
||||||
@@ -135,7 +134,6 @@ 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;
|
||||||
|
|
||||||
@@ -203,9 +201,6 @@ 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;
|
||||||
|
@@ -93,9 +93,6 @@ 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()) {
|
||||||
|
@@ -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) {
|
||||||
dirDeleted.emit(path);
|
fileDeleted.emit(path);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -31,7 +31,6 @@ dmg = f'{dmg_dir}.dmg'
|
|||||||
rm(dmg)
|
rm(dmg)
|
||||||
rm(dmg_dir)
|
rm(dmg_dir)
|
||||||
mkdir_p(dmg_dir)
|
mkdir_p(dmg_dir)
|
||||||
shutil.copytree('dist/darwin-arm64-release/NostalgiaStudio.app', f'{dmg_dir}/NostalgiaStudio.app')
|
shutil.copytree('dist/darwin-arm64-release/NostalgiaStudio.app', f'{dmg_dir}/Nostalgia Studio.app')
|
||||||
os.symlink('/Applications', f'{dmg_dir}/Applications')
|
os.symlink('/Applications', f'{dmg_dir}/Applications')
|
||||||
run(['hdiutil', 'create', '-srcfolder', dmg_dir, dmg])
|
run(['hdiutil', 'create', '-srcfolder', dmg_dir, dmg])
|
||||||
rm(dmg_dir)
|
|
||||||
|
Reference in New Issue
Block a user