New textures
@ -1,43 +1,65 @@
|
||||
<prefab name="EthPrefab" type="">
|
||||
<asset type="texture" name="texture_eth_face_day_happy" ref="faceDayHappy" />
|
||||
<prefab name="EthPrefab" extend="prefabs/EthPrefabBase" type="">
|
||||
<item>
|
||||
<MeshRenderer />
|
||||
<QuadMeshHost xy0="-0.78236397748, 1" xy1="0.78236397748, -1" />
|
||||
<SimpleTexturedMaterial ref="faceMaterial" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<MeshRenderer />
|
||||
<QuadMeshHost xy0="-0.78236397748, 1" xy1="0.78236397748, -1" />
|
||||
<SimpleTexturedMaterial ref="bodyMaterial" />
|
||||
</item>
|
||||
|
||||
<asset type="texture" name="texture_eth_face_day_anger" ref="faceDayAnger" />
|
||||
<asset type="texture" name="texture_eth_face_day_confused" ref="faceDayConfused" />
|
||||
<asset type="texture" name="texture_eth_face_day_eyeroll" ref="faceDayEyeroll" />
|
||||
<asset type="texture" name="texture_eth_face_day_fear" ref="faceDayFear" />
|
||||
<asset type="texture" name="texture_eth_face_day_happy" ref="faceDayHappy" />
|
||||
<asset type="texture" name="texture_eth_face_day_haughty" ref="faceDayHaughty" />
|
||||
<asset type="texture" name="texture_eth_face_day_neutral" ref="faceDayNeutral" />
|
||||
<asset type="texture" name="texture_eth_face_day_sad" ref="faceDaySad" />
|
||||
<asset type="texture" name="texture_eth_face_day_surprised" ref="faceDaySurprised" />
|
||||
|
||||
<asset type="texture" name="texture_eth_pose_day_front" ref="poseDayFront" />
|
||||
<asset type="texture" name="texture_eth_pose_day_back" ref="poseDayBack" />
|
||||
|
||||
<item>
|
||||
<MeshRenderer />
|
||||
<QuadMeshHost />
|
||||
<SimpleTexturedMaterial texture="faceDayHappy" ref="faceMaterial" />
|
||||
<TiledSprite ref="faceSprite" tile="0" size="0.5" sizeType="TILED_SPRITE_SIZE_TYPE_HEIGHT_RATIO" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<MeshRenderer />
|
||||
<QuadMeshHost ref="bodyMesh" />
|
||||
<SimpleTexturedMaterial texture="poseDayFront" ref="bodyMaterial" />
|
||||
<TiledSprite ref="bodySprite" tile="0" size="0.5" sizeType="TILED_SPRITE_SIZE_TYPE_HEIGHT_RATIO" />
|
||||
</item>
|
||||
<asset type="texture" name="texture_eth_pose_day_cross" ref="poseDayCross" />
|
||||
<asset type="texture" name="texture_eth_pose_day_front" ref="poseDayFront" />
|
||||
<asset type="texture" name="texture_eth_pose_day_hips" ref="poseDayHips" />
|
||||
<asset type="texture" name="texture_eth_pose_day_neutral" ref="poseDayNeutral" />
|
||||
|
||||
<code type="properties">
|
||||
TilesetGrid gridFace;
|
||||
TilesetGrid gridBody;
|
||||
StateProperty<int32_t> faceTile;
|
||||
StateProperty<int32_t> poseTile;
|
||||
</code>
|
||||
|
||||
<code type="init">
|
||||
gridFace = TilesetGrid(faceDayHappy->texture, 1, 1);
|
||||
faceSprite->tileset = &gridFace;
|
||||
|
||||
gridBody = TilesetGrid(poseDayBack->texture, 1, 1);
|
||||
bodySprite->tileset = &gridBody;
|
||||
faceTile = 0;
|
||||
poseTile = 0;
|
||||
|
||||
useEffect([&]{
|
||||
faceMaterial->texture = (
|
||||
faceTile == 0 ? &faceDayHappy->texture :
|
||||
faceTile == 1 ? &faceDayAnger->texture :
|
||||
nullptr
|
||||
faceMaterial->texture = &(
|
||||
faceTile == 0 ? faceDayHappy->texture :
|
||||
faceTile == 1 ? faceDayAnger->texture :
|
||||
faceTile == 2 ? faceDayConfused->texture :
|
||||
faceTile == 3 ? faceDayEyeroll->texture :
|
||||
faceTile == 4 ? faceDayFear->texture :
|
||||
faceTile == 5 ? faceDayHaughty->texture :
|
||||
faceTile == 6 ? faceDayNeutral->texture :
|
||||
faceTile == 7 ? faceDaySad->texture :
|
||||
faceTile == 8 ? faceDaySurprised->texture :
|
||||
faceDayHappy->texture
|
||||
);
|
||||
}, faceTile)();
|
||||
|
||||
useEffect([&]{
|
||||
bodyMaterial->texture = &(
|
||||
poseTile == 0 ? poseDayBack->texture :
|
||||
poseTile == 1 ? poseDayCross->texture :
|
||||
poseTile == 2 ? poseDayFront->texture :
|
||||
poseTile == 3 ? poseDayHips->texture :
|
||||
poseTile == 4 ? poseDayNeutral->texture :
|
||||
poseDayBack->texture
|
||||
);
|
||||
}, poseTile)();
|
||||
</code>
|
||||
</prefab>
|
@ -1,14 +1,19 @@
|
||||
<scene name="SceneBase">
|
||||
<item lookAt="10, 10, 10, 0, 0, 0">
|
||||
<item lookAt="9999, 9999, 9999, 9999, 9999, 0">
|
||||
<Camera ref="backCamera" />
|
||||
</item>
|
||||
|
||||
<item position="0, 0, -10">
|
||||
<MeshRenderer />
|
||||
<QuadMeshHost xy0="-500, -500" xy1="500, 500" />
|
||||
<SimpleTexturedMaterial color="COLOR_BLACK" />
|
||||
</item>
|
||||
|
||||
<item ref="eth" prefab="prefabs/EthPrefab" />
|
||||
|
||||
<item lookAt="0, 0, 5, 0, 0, 0" >
|
||||
<!-- <item lookAt="3, 3, 3, 0, 0, 0" > -->
|
||||
<Camera ref="camera" type="CAMERA_TYPE_ORTHONOGRAPHIC" />
|
||||
<CameraTexture ref="camTexture" />
|
||||
<item lookAt="0, 0.075, 2.5, 0, 0.075, 0">
|
||||
<Camera ref="camera" />
|
||||
<CameraTexture ref="camTexture" camera="camera" />
|
||||
</item>
|
||||
|
||||
<item>
|
||||
|
@ -3,7 +3,7 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
set(LIMINIAL_CHARACTER_SCALE 1.0)
|
||||
set(LIMINIAL_CHARACTER_SCALE 1.00)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/eth/CMakeLists.txt")
|
||||
|
||||
|
@ -3,48 +3,5 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
tool_texture(texture_eth_face_day_anger
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/anger.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_confused
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/confused.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_eyeroll
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/eyeroll.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_fear
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/fear.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_happy
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/happy.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_haughty
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/haughty.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_neutral
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/neutral.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_sad
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/sad.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_surprised
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/surprised.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/day/CMakeLists.txt)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/night/CMakeLists.txt)
|
68
assets/games/liminal/textures/eth/faces/day/CMakeLists.txt
Normal file
@ -0,0 +1,68 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
tool_texture(texture_eth_face_day_anger
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/anger.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_confused
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/confused.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_eyeroll
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/eyeroll.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_fear
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/fear.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_happy
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/happy.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_haughty
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/haughty.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_neutral
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/neutral.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_sad
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/sad.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_day_surprised
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/surprised.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 3.0 MiB After Width: | Height: | Size: 3.0 MiB |
Before Width: | Height: | Size: 3.4 MiB After Width: | Height: | Size: 3.4 MiB |
Before Width: | Height: | Size: 3.2 MiB After Width: | Height: | Size: 3.2 MiB |
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 3.5 MiB After Width: | Height: | Size: 3.5 MiB |
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 3.3 MiB |
68
assets/games/liminal/textures/eth/faces/night/CMakeLists.txt
Normal file
@ -0,0 +1,68 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
|
||||
tool_texture(texture_eth_face_night_anger
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/anger.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_confused
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/confused.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_eyeroll
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/eyeroll.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_fear
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/fear.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_happy
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/happy.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_haughty
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/haughty.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_neutral
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/neutral.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_sad
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/sad.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_face_night_surprised
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/surprised.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
BIN
assets/games/liminal/textures/eth/faces/night/anger.png
Normal file
After Width: | Height: | Size: 3.4 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/confused.png
Normal file
After Width: | Height: | Size: 3.3 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/eyeroll.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/fear.png
Normal file
After Width: | Height: | Size: 3.2 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/happy.png
Normal file
After Width: | Height: | Size: 3.4 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/haughty.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/neutral.png
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/sad.png
Normal file
After Width: | Height: | Size: 3.5 MiB |
BIN
assets/games/liminal/textures/eth/faces/night/surprised.png
Normal file
After Width: | Height: | Size: 3.3 MiB |
@ -3,11 +3,5 @@
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
tool_texture(texture_eth_pose_day_front
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/day_front.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
tool_texture(texture_eth_pose_day_back
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/day_back.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/day/CMakeLists.txt)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/night/CMakeLists.txt)
|
39
assets/games/liminal/textures/eth/poses/day/CMakeLists.txt
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
tool_texture(texture_eth_pose_day_back
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/back.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_day_cross
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/cross.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_day_front
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/front.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_day_hips
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/hips.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_day_neutral
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/neutral.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 12 MiB |
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 12 MiB |
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 11 MiB |
Before Width: | Height: | Size: 13 MiB After Width: | Height: | Size: 13 MiB |
Before Width: | Height: | Size: 12 MiB After Width: | Height: | Size: 12 MiB |
39
assets/games/liminal/textures/eth/poses/night/CMakeLists.txt
Normal file
@ -0,0 +1,39 @@
|
||||
# Copyright (c) 2023 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
tool_texture(texture_eth_pose_night_back
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/back.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_night_cross
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/cross.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_night_front
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/front.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_night_hips
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/hips.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
||||
|
||||
tool_texture(texture_eth_pose_night_neutral
|
||||
FILE="${CMAKE_CURRENT_LIST_DIR}/neutral.png"
|
||||
SCALE=${LIMINIAL_CHARACTER_SCALE}
|
||||
FILTER_MIN=nearest
|
||||
FILTER_MAG=nearest
|
||||
)
|
BIN
assets/games/liminal/textures/eth/poses/night/back.png
Normal file
After Width: | Height: | Size: 11 MiB |
BIN
assets/games/liminal/textures/eth/poses/night/cross.png
Normal file
After Width: | Height: | Size: 11 MiB |
BIN
assets/games/liminal/textures/eth/poses/night/front.png
Normal file
After Width: | Height: | Size: 11 MiB |
BIN
assets/games/liminal/textures/eth/poses/night/hips.png
Normal file
After Width: | Height: | Size: 13 MiB |
BIN
assets/games/liminal/textures/eth/poses/night/neutral.png
Normal file
After Width: | Height: | Size: 12 MiB |
@ -10,34 +10,15 @@ using namespace Dawn;
|
||||
CameraTexture::CameraTexture(SceneItem *item) :
|
||||
SceneItemComponent(item),
|
||||
camera(nullptr),
|
||||
renderTarget(32.0f, 32.0f),
|
||||
updateOrtho(true)
|
||||
renderTarget(32.0f, 32.0f)
|
||||
{
|
||||
}
|
||||
|
||||
void CameraTexture::onStart() {
|
||||
if(this->camera == nullptr) this->camera = item->getComponent<Camera>();
|
||||
|
||||
auto effectCamera = [&]{
|
||||
if(this->camera == nullptr) return teardown = [&]{};
|
||||
useEffect([&]{
|
||||
if(this->camera == nullptr) return;
|
||||
this->camera->renderTarget = &this->renderTarget;
|
||||
|
||||
if(!this->updateOrtho) return teardown = [&]{};
|
||||
|
||||
this->updateOrthoValues();
|
||||
return teardown = useEvent([&](float_t w, float_t h){
|
||||
this->updateOrthoValues();
|
||||
}, this->camera->eventRenderTargetResized);
|
||||
};
|
||||
|
||||
useEffectWithTeardown(effectCamera, this->camera);
|
||||
useEffectWithTeardown(effectCamera, this->updateOrtho)();
|
||||
}
|
||||
|
||||
void CameraTexture::updateOrthoValues() {
|
||||
assertNotNull(this->camera);
|
||||
float_t wr = this->camera->renderTarget->getWidth() / this->camera->renderTarget->getHeight();
|
||||
wr *= 0.5f;//TODO: allow this to be editable
|
||||
this->camera->orthoLeft = -wr;
|
||||
this->camera->orthoRight = wr;
|
||||
}, camera)();
|
||||
}
|
@ -9,22 +9,12 @@
|
||||
|
||||
namespace Dawn {
|
||||
class CameraTexture : public SceneItemComponent {
|
||||
protected:
|
||||
std::function<void()> teardown;
|
||||
|
||||
void updateOrthoValues();
|
||||
|
||||
public:
|
||||
// @optional
|
||||
StateProperty<Camera*> camera;
|
||||
|
||||
// @optional
|
||||
StateProperty<bool_t> updateOrtho;
|
||||
|
||||
TextureRenderTarget renderTarget;
|
||||
|
||||
CameraTexture(SceneItem *item);
|
||||
|
||||
void onStart() override;
|
||||
};
|
||||
}
|
@ -10,20 +10,16 @@ using namespace Dawn;
|
||||
|
||||
PixelPerfectCamera::PixelPerfectCamera(SceneItem *i) :
|
||||
SceneItemComponent(i),
|
||||
scale(1.0f)
|
||||
scale(1.0f),
|
||||
camera(nullptr)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::vector<SceneItemComponent*> PixelPerfectCamera::getDependencies() {
|
||||
return std::vector<SceneItemComponent*>{
|
||||
(this->camera = this->item->getComponent<Camera>())
|
||||
};
|
||||
}
|
||||
|
||||
void PixelPerfectCamera::updateDimensions() {
|
||||
if(this->camera == nullptr) return;
|
||||
|
||||
float_t w, h;
|
||||
assertNotNull(this->camera);
|
||||
|
||||
auto target = this->camera->getRenderTarget();
|
||||
switch(this->camera->type) {
|
||||
@ -52,14 +48,23 @@ void PixelPerfectCamera::updateDimensions() {
|
||||
}
|
||||
|
||||
void PixelPerfectCamera::onStart() {
|
||||
assertNotNull(this->camera);
|
||||
this->updateDimensions();
|
||||
|
||||
useEvent([&](float_t w, float_t h){
|
||||
this->updateDimensions();
|
||||
}, this->camera->eventRenderTargetResized);
|
||||
|
||||
if(camera == nullptr) camera = item->getComponent<Camera>();
|
||||
|
||||
useEffect([&]{
|
||||
this->updateDimensions();
|
||||
}, scale);
|
||||
|
||||
useEffectWithTeardown([&]{
|
||||
if(!camera) {
|
||||
return teardown = [&]{};
|
||||
}
|
||||
|
||||
this->updateDimensions();
|
||||
|
||||
return teardown = [&]{
|
||||
useEvent([&](float_t w, float_t h){
|
||||
this->updateDimensions();
|
||||
}, this->camera->eventRenderTargetResized);
|
||||
};
|
||||
}, camera)();
|
||||
}
|
@ -9,14 +9,17 @@
|
||||
namespace Dawn {
|
||||
class PixelPerfectCamera : public SceneItemComponent {
|
||||
protected:
|
||||
Camera *camera = nullptr;
|
||||
|
||||
std::function<void()> teardown;
|
||||
|
||||
/**
|
||||
* Updates the underlying camera's projection information.
|
||||
*/
|
||||
void updateDimensions();
|
||||
|
||||
public:
|
||||
// @optional
|
||||
StateProperty<Camera*> camera;
|
||||
|
||||
// @optional
|
||||
StateProperty<float_t> scale;
|
||||
|
||||
@ -27,7 +30,6 @@ namespace Dawn {
|
||||
*/
|
||||
PixelPerfectCamera(SceneItem *item);
|
||||
|
||||
std::vector<SceneItemComponent*> getDependencies() override;
|
||||
void onStart() override;
|
||||
};
|
||||
}
|
@ -122,34 +122,36 @@ void Texture::updateTextureProperties() {
|
||||
) {
|
||||
switch(filter) {
|
||||
case TEXTURE_FILTER_MODE_NEAREST: {
|
||||
switch(mapFilterMode) {
|
||||
case TEXTURE_FILTER_MODE_NEAREST:
|
||||
glTexParameteri(GL_TEXTURE_2D, minMag, GL_NEAREST_MIPMAP_NEAREST);
|
||||
break;
|
||||
glTexParameteri(GL_TEXTURE_2D, minMag, GL_NEAREST);
|
||||
// switch(mapFilterMode) {
|
||||
// case TEXTURE_FILTER_MODE_NEAREST:
|
||||
// glTexParameteri(GL_TEXTURE_2D, minMag, GL_NEAREST_MIPMAP_NEAREST);
|
||||
// break;
|
||||
|
||||
case TEXTURE_FILTER_MODE_LINEAR:
|
||||
glTexParameteri(GL_TEXTURE_2D, minMag, GL_LINEAR_MIPMAP_NEAREST);
|
||||
break;
|
||||
// case TEXTURE_FILTER_MODE_LINEAR:
|
||||
// glTexParameteri(GL_TEXTURE_2D, minMag, GL_LINEAR_MIPMAP_NEAREST);
|
||||
// break;
|
||||
|
||||
default:
|
||||
assertUnreachable();
|
||||
}
|
||||
// default:
|
||||
// assertUnreachable();
|
||||
// }
|
||||
break;
|
||||
}
|
||||
|
||||
case TEXTURE_FILTER_MODE_LINEAR: {
|
||||
switch(mapFilterMode) {
|
||||
case TEXTURE_FILTER_MODE_NEAREST:
|
||||
glTexParameteri(GL_TEXTURE_2D, minMag, GL_NEAREST_MIPMAP_LINEAR);
|
||||
break;
|
||||
glTexParameteri(GL_TEXTURE_2D, minMag, GL_LINEAR);
|
||||
// switch(mapFilterMode) {
|
||||
// case TEXTURE_FILTER_MODE_NEAREST:
|
||||
// glTexParameteri(GL_TEXTURE_2D, minMag, GL_NEAREST_MIPMAP_LINEAR);
|
||||
// break;
|
||||
|
||||
case TEXTURE_FILTER_MODE_LINEAR:
|
||||
glTexParameteri(GL_TEXTURE_2D, minMag, GL_LINEAR_MIPMAP_LINEAR);
|
||||
break;
|
||||
// case TEXTURE_FILTER_MODE_LINEAR:
|
||||
// glTexParameteri(GL_TEXTURE_2D, minMag, GL_LINEAR_MIPMAP_LINEAR);
|
||||
// break;
|
||||
|
||||
default:
|
||||
assertUnreachable();
|
||||
}
|
||||
// default:
|
||||
// assertUnreachable();
|
||||
// }
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,6 @@ std::vector<struct ShaderPassItem> SimpleTexturedMaterial::getRenderPasses(IRend
|
||||
|
||||
onlyPass.renderFlags = (
|
||||
RENDER_MANAGER_RENDER_FLAG_BLEND
|
||||
// RENDER_MANAGER_RENDER_FLAG_DEPTH_TEST
|
||||
);
|
||||
|
||||
if(this->texture != nullptr) {
|
||||
|
@ -17,7 +17,11 @@ std::map<std::string, std::string> TextureTool::getOptionalFlags() {
|
||||
{ "wrapY", "clamp" },
|
||||
{ "filterMin", "linear" },
|
||||
{ "filterMax", "linear" },
|
||||
{ "scale", "" }
|
||||
{ "scale", "" },
|
||||
{ "scaleWrapX", "clamp" },
|
||||
{ "scaleWrapY", "clamp" },
|
||||
{ "scaleFilterX", "nearest" },
|
||||
{ "scaleFilterY", "nearest" }
|
||||
};
|
||||
}
|
||||
|
||||
@ -45,11 +49,22 @@ int32_t TextureTool::start() {
|
||||
size_t len = STBI_rgb_alpha * w * h;
|
||||
uint8_t *dataImage = (uint8_t*)malloc(sizeof(uint8_t) * len);
|
||||
|
||||
float_t scale = 1;
|
||||
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);
|
||||
scale = std::stof(flags["scale"]);
|
||||
}
|
||||
|
||||
if(scale != 1) {
|
||||
stbir_resize_uint8_generic(
|
||||
imageRaw, w, h, 0,
|
||||
dataImage, w * scale, h * scale, 0,
|
||||
STBI_rgb_alpha, -1, 0,
|
||||
STBIR_EDGE_CLAMP, STBIR_FILTER_TRIANGLE, STBIR_COLORSPACE_LINEAR,
|
||||
NULL
|
||||
);
|
||||
w = w * scale;
|
||||
h = h * scale;
|
||||
printf("Changing size to %ix%i\n", w, h);
|
||||
} else {
|
||||
memcpy(dataImage, imageRaw, len);
|
||||
}
|
||||
|
@ -55,6 +55,11 @@ void CodeGen::classGen(
|
||||
}
|
||||
|
||||
line(out, "namespace Dawn {", "");
|
||||
auto itTemplates = info.classTemplates.begin();
|
||||
while(itTemplates != info.classTemplates.end()) {
|
||||
line(out, "template<" + itTemplates->second + " " + itTemplates->first + ">", " ");
|
||||
++itTemplates;
|
||||
}
|
||||
line(out, "class " + info.clazz + (info.extend.size() == 0 ? "{" : " : public " + info.extend + " {" ), " ");
|
||||
if(info.protectedCode.size() > 0) {
|
||||
line(out, "protected:", " ");
|
||||
|
@ -14,6 +14,8 @@ namespace Dawn {
|
||||
std::string constructorArgs = "";
|
||||
std::string extendArgs = "";
|
||||
|
||||
std::map<std::string, std::string> classTemplates;
|
||||
|
||||
std::vector<std::string> constructorCode;
|
||||
|
||||
std::vector<std::string> protectedCode;
|
||||
|