diff --git a/assets/games/liminal/prefabs/EthPrefab.xml b/assets/games/liminal/prefabs/EthPrefab.xml
index afcc99b2..f706c104 100644
--- a/assets/games/liminal/prefabs/EthPrefab.xml
+++ b/assets/games/liminal/prefabs/EthPrefab.xml
@@ -2,38 +2,48 @@
+ -
-
+
+
-
+
TilesetGrid gridFace;
TilesetGrid gridBody;
+ StateProperty<float_t> alpha;
+ alpha = 0.0f;
+
this->gridFace = TilesetGrid(
1, 9,
faceTexture->texture.getWidth(), faceTexture->texture.getHeight(),
0, 0,
0, 0
);
- faceSprite->tileset = &gridFace;
+ faceSprite->tileset = &gridFace;
this->gridBody = TilesetGrid(
- 1, 9,
+ 1, 5,
bodyTexture->texture.getWidth(), bodyTexture->texture.getHeight(),
0, 0,
0, 0
);
- //bodySprite->tileset = &gridBody;
+ bodySprite->tileset = &gridBody;
+
+ useEffect([&]{
+ this->faceMaterial->color.a = alpha;
+ this->bodyMaterial->color.a = alpha;
+ }, alpha);
\ No newline at end of file
diff --git a/assets/games/liminal/scenes/Scene1Prologue0.xml b/assets/games/liminal/scenes/Scene1Prologue0.xml
index 3bdf0e1b..6188d913 100644
--- a/assets/games/liminal/scenes/Scene1Prologue0.xml
+++ b/assets/games/liminal/scenes/Scene1Prologue0.xml
@@ -4,14 +4,21 @@
There is a bucket.
+
+
It sways above your head like the mouth of a god. You are on Angelwood's best stage, and they are cheering for you, calling you their Queen, their Prom Queen.
+
+
And you are dead soon.
+
+
It's Prom Day. The metal bucket is swaying. Over you. Drenching your white pristine dress in guts and gore red. They aren't cheering anymore. They're gasping. But not screaming: oh, no, not in respectable Angelwood.
diff --git a/assets/games/liminal/scenes/SceneBase.xml b/assets/games/liminal/scenes/SceneBase.xml
index fa781177..51ae2f00 100644
--- a/assets/games/liminal/scenes/SceneBase.xml
+++ b/assets/games/liminal/scenes/SceneBase.xml
@@ -5,10 +5,10 @@
-
- -
-
-
+
-
+
+
+
@@ -33,7 +33,7 @@
- useEvent([&]{
+ useEvent([&]{
assertNotNull(camTexture);
assertNotNull(image);
camTexture->renderTarget.setSize(image->getWidth(), image->getHeight());
diff --git a/assets/games/liminal/textures/eth/poses_night.png b/assets/games/liminal/textures/eth/poses_night.png
index f0ae6dac..3ab96855 100644
Binary files a/assets/games/liminal/textures/eth/poses_night.png and b/assets/games/liminal/textures/eth/poses_night.png differ
diff --git a/assets/games/liminal/textures/eth/test.png b/assets/games/liminal/textures/eth/test.png
new file mode 100644
index 00000000..6b51cac4
Binary files /dev/null and b/assets/games/liminal/textures/eth/test.png differ
diff --git a/src/dawn/games/vn/events/VNSetEvent.hpp b/src/dawn/games/vn/events/VNSetEvent.hpp
index bd9b1e50..9f82c272 100644
--- a/src/dawn/games/vn/events/VNSetEvent.hpp
+++ b/src/dawn/games/vn/events/VNSetEvent.hpp
@@ -10,18 +10,18 @@ namespace Dawn {
template
class VNSetEvent : public VNAnimateEvent {
public:
- T *modifies = nullptr;
+ StateProperty *modifies = nullptr;
protected:
void onStart() override {
assertNotNull(this->modifies);
- this->from = *modifies;
+ this->from = modifies->getValue();
VNAnimateEvent::onStart();
}
void setValue(T value) override {
- *modifies = value;
+ modifies->setValue(value);
}
};
}
\ No newline at end of file
diff --git a/src/dawn/state/StateProperty.hpp b/src/dawn/state/StateProperty.hpp
index b0dd1abf..10627531 100644
--- a/src/dawn/state/StateProperty.hpp
+++ b/src/dawn/state/StateProperty.hpp
@@ -110,6 +110,26 @@ namespace Dawn {
return this->_realValue;
}
+ /**
+ * Provides an alternate way to set the value, e.g. if using the equals
+ * operator is not possible.
+ *
+ * @param val Value to set on this property.
+ */
+ void setValue(V val) {
+ this->setInternal(val);
+ }
+
+ /**
+ * Provides an alternate way to get the value, e.g. if using the equals
+ * operator is not possible.
+ *
+ * @return The value of this property.
+ */
+ V getValue() {
+ return this->_realValue;
+ }
+
/**
* Destructor for StateProperty.
*/
diff --git a/src/dawnliminal/CMakeLists.txt b/src/dawnliminal/CMakeLists.txt
index ea6f66a0..8efb7dbe 100644
--- a/src/dawnliminal/CMakeLists.txt
+++ b/src/dawnliminal/CMakeLists.txt
@@ -19,14 +19,22 @@ add_subdirectory(save)
# Assets
set(LIMINAL_ASSETS_DIR ${DAWN_ASSETS_DIR}/games/liminal)
+set(LIMINIAL_CHARACTER_SCALE 0.2)
tool_texture(texture_eth_faces_day
FILE="${LIMINAL_ASSETS_DIR}/textures/eth/faces_day.png"
+ SCALE=${LIMINIAL_CHARACTER_SCALE}
)
tool_texture(texture_eth_faces_night
FILE="${LIMINAL_ASSETS_DIR}/textures/eth/faces_night.png"
+ SCALE=${LIMINIAL_CHARACTER_SCALE}
)
tool_texture(texture_eth_poses_day
FILE="${LIMINAL_ASSETS_DIR}/textures/eth/poses_day.png"
+ SCALE=${LIMINIAL_CHARACTER_SCALE}
+)
+tool_texture(texture_eth_poses_night
+ FILE="${LIMINAL_ASSETS_DIR}/textures/eth/test.png"
+ SCALE=${LIMINIAL_CHARACTER_SCALE}
)
diff --git a/src/dawnopengl/display/Texture.cpp b/src/dawnopengl/display/Texture.cpp
index 6530dd22..64f3c1e6 100644
--- a/src/dawnopengl/display/Texture.cpp
+++ b/src/dawnopengl/display/Texture.cpp
@@ -46,6 +46,14 @@ void Texture::setSize(
glDeleteTextures(1, &this->id);
this->id = -1;
}
+
+ #if DAWN_DEBUG_BUILD
+ int32_t maxSize;
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize);
+
+ assertTrue(width > 0 && width <= maxSize);
+ assertTrue(height > 0 && height <= maxSize);
+ #endif
this->width = width;
this->height = height;
diff --git a/src/dawnopengl/scene/components/display/material/SimpleBillboardedMaterial.cpp b/src/dawnopengl/scene/components/display/material/SimpleBillboardedMaterial.cpp
index fecc984c..58d6a31f 100644
--- a/src/dawnopengl/scene/components/display/material/SimpleBillboardedMaterial.cpp
+++ b/src/dawnopengl/scene/components/display/material/SimpleBillboardedMaterial.cpp
@@ -38,8 +38,7 @@ std::vector SimpleBillboardedMaterial::getRenderPasses(IR
onlyPass.parameterBuffers[shader->bufferRenderPipeline] = &context.renderPipeline->shaderBuffer;
onlyPass.renderFlags = (
- RENDER_MANAGER_RENDER_FLAG_BLEND |
- RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST
+ RENDER_MANAGER_RENDER_FLAG_BLEND
);
if(this->texture != nullptr) {
diff --git a/src/dawnshared/util/Xml.cpp b/src/dawnshared/util/Xml.cpp
index bcbe7870..cb5fa183 100644
--- a/src/dawnshared/util/Xml.cpp
+++ b/src/dawnshared/util/Xml.cpp
@@ -174,7 +174,41 @@ void Xml::load(Xml *xml, std::string data, size_t *j) {
buffer += bufferWhitespaces;
valueIsInWhitespace = false;
}
- buffer += c;
+
+ if(c == '&') {
+ // Handle special characters. First read ahead to nearest semicolon OR
+ // nearest closing tag.
+ std::string sc;
+ while(c = data[i++]) {
+ xml->innerXml += c;
+ if(c == ';') break;
+ if(c == '<') assertUnreachable();//Invalid XML
+ sc += c;
+ }
+
+ if(valueIsInWhitespace) {
+ buffer += bufferWhitespaces;
+ valueIsInWhitespace = false;
+ }
+
+ if(sc == "lt") {
+ buffer += '<';
+ } else if(sc == "gt") {
+ buffer += '>';
+ } else if(sc == "amp") {
+ buffer += '&';
+ } else if(sc == "apos") {
+ buffer += '\'';
+ } else if(sc == "quot") {
+ buffer += '"';
+ } else {
+ // Unknown special char?
+ std::cout << "Unknown Special character: " << sc << std::endl;
+ assertUnreachable();
+ }
+ } else {
+ buffer += c;
+ }
}
break;
diff --git a/src/dawntools/texturetool/CMakeLists.txt b/src/dawntools/texturetool/CMakeLists.txt
index 31744395..8c57f20e 100644
--- a/src/dawntools/texturetool/CMakeLists.txt
+++ b/src/dawntools/texturetool/CMakeLists.txt
@@ -45,6 +45,7 @@ function(tool_texture target)
set(FILTER_MAG "")
set(WRAP_X "")
set(WRAP_Y "")
+ set(SCALE "")
# Parse Args
foreach(_PAIR IN LISTS ARGN)
@@ -73,6 +74,7 @@ function(tool_texture target)
--wrapY="${WRAP_Y}"
--filterMin="${FILTER_MIN}"
--filterMag="${FILTER_MIN}"
+ --scale="${SCALE}"
COMMENT "Generating texture ${target} from ${FILE}"
DEPENDS ${DEPS}
)
diff --git a/src/dawntools/texturetool/TextureTool.cpp b/src/dawntools/texturetool/TextureTool.cpp
index 9d78dd86..7d129010 100644
--- a/src/dawntools/texturetool/TextureTool.cpp
+++ b/src/dawntools/texturetool/TextureTool.cpp
@@ -16,7 +16,8 @@ std::map TextureTool::getOptionalFlags() {
{ "wrapX", "clamp" },
{ "wrapY", "clamp" },
{ "filterMin", "linear" },
- { "filterMax", "linear" }
+ { "filterMax", "linear" },
+ { "scale", "" }
};
}
@@ -40,13 +41,19 @@ int32_t TextureTool::start() {
}
in.close();
- // Convert to floating points
+ // Buffer to output
size_t len = STBI_rgb_alpha * w * h;
uint8_t *dataImage = (uint8_t*)malloc(sizeof(uint8_t) * len);
- for(size_t i = 0; i < len; i++) {
- auto dataIn = imageRaw[i];
- dataImage[i] = dataIn;
+
+ if(!flags["scale"].empty()) {
+ float_t scale = std::stof(flags["scale"]);
+ stbir_resize_uint8(imageRaw, w, h, 0, dataImage, w * scale, h * scale, 0, STBI_rgb_alpha);
+ w = w * scale;
+ h = h * scale;
+ } else {
+ memcpy(dataImage, imageRaw, len);
}
+
stbi_image_free(imageRaw);
std::function wrapFromString = [&](std::string wr) {