Skip to content

Commit

Permalink
Merge branch 'release/1.4.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bam4d committed Jul 20, 2022
2 parents da7b68c + 799ed38 commit 669dd18
Show file tree
Hide file tree
Showing 23 changed files with 57 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. mac/linux/windows]
- Version [e.g. 1.4.1]
- Version [e.g. 1.4.2]

**Additional context**
Add any other context about the problem here.
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10.0)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Minimum OS X deployment version")
project(Griddly VERSION 1.4.1)
project(Griddly VERSION 1.4.2)

set(BINARY ${CMAKE_PROJECT_NAME})

Expand Down Expand Up @@ -106,16 +106,11 @@ endif()
if(NOT WASM)
message(STATUS "Compiling shaders...")
find_package(Vulkan REQUIRED FATAL_ERROR)
set(VULKAN_SHADER_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Griddly/Core/Observers/Vulkan/resources/shaders)

if(MSVC)
execute_process ( COMMAND ${VULKAN_SHADER_DIR}/compile_shaders.bat
WORKING_DIRECTORY ${VULKAN_SHADER_DIR}
RESULT_VARIABLE rv)
execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile_shaders.bat RESULT_VARIABLE rv)
else()
execute_process ( COMMAND bash ${VULKAN_SHADER_DIR}/compile_shaders.sh
WORKING_DIRECTORY ${VULKAN_SHADER_DIR}
RESULT_VARIABLE rv)
execute_process(COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/compile_shaders.sh RESULT_VARIABLE rv)
endif()
endif()

Expand Down
8 changes: 8 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ jobs:
PythonVersion: 3.9
PyBin: cp39-cp39
PLAT: manylinux2014_x86_64
ManyLinux_p310:
PythonVersion: 3.10
PyBin: cp310-cp310
PLAT: manylinux2014_x86_64
steps:
- task: InstallSSHKey@0
inputs:
Expand Down Expand Up @@ -208,6 +212,8 @@ jobs:
PythonVersion: 3.8
Windows_p39:
PythonVersion: 3.9
Windows_p310:
PythonVersion: 3.10
steps:
- task: InstallSSHKey@0
inputs:
Expand Down Expand Up @@ -332,6 +338,8 @@ jobs:
PythonVersion: 3.8
MacOS_p39:
PythonVersion: 3.9
MacOS_p310:
PythonVersion: 3.10
steps:
- task: InstallSSHKey@0
inputs:
Expand Down
2 changes: 1 addition & 1 deletion bindings/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace griddly {

PYBIND11_MODULE(python_griddly, m) {
m.doc() = "Griddly python bindings";
m.attr("version") = "1.4.1";
m.attr("version") = "1.4.2";

#ifndef NDEBUG
spdlog::set_level(spdlog::level::debug);
Expand Down
12 changes: 12 additions & 0 deletions compile_shaders.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cd /D "%~dp0"

CALL :compile_shaders_in_dir .\resources\shaders
CALL :compile_shaders_in_dir .\tests\resources\observer\block\shaders\global_lighting
CALL :compile_shaders_in_dir .\tests\resources\observer\isometric\shaders\lighting
CALL :compile_shaders_in_dir .\tests\resources\observer\sprite\shaders\health_bars

EXIT /B 0

:compile_shaders_in_dir
glslc %~1\triangle-textured.frag -o %~1\triangle-textured.frag.spv
glslc %~1\triangle-textured.vert -o %~1\triangle-textured.vert.spv
13 changes: 13 additions & 0 deletions compile_shaders.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

cd "$(dirname "$0")"

compile_shaders_in_dir () {
glslc $1/triangle-textured.frag -o $1/triangle-textured.frag.spv
glslc $1/triangle-textured.vert -o $1/triangle-textured.vert.spv
}

compile_shaders_in_dir ./resources/shaders
compile_shaders_in_dir ./tests/resources/observer/block/shaders/global_lighting
compile_shaders_in_dir ./tests/resources/observer/isometric/shaders/lighting
compile_shaders_in_dir ./tests/resources/observer/sprite/shaders/health_bars
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Chris Bamford'

# The full version, including alpha/beta/rc tags
release = '1.4.1'
release = '1.4.2'


# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions js/griddlyjs-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/griddlyjs-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "griddlyjs-app",
"version": "1.4.1",
"version": "1.4.2",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def griddly_package_data(config='Debug'):

setup(
name='griddly',
version="1.4.1",
version="1.4.2",
author_email="[email protected]",
description="Griddly Python Libraries",
long_description=long_description,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Griddly/Core/Observers/SpriteObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ vk::SpriteData SpriteObserver::loadImage(std::string imageFilename) {
stbi_uc* pixels = stbi_load(absoluteFilePath.c_str(), &width, &height, &channels, STBI_rgb_alpha);

if (!pixels) {
throw std::runtime_error(fmt::format("Failed to load texture image {0}.", imageFilename));
throw std::runtime_error(fmt::format("Failed to load texture image {0}.", absoluteFilePath));
}

int outputWidth = config_.tileSize.x;
Expand Down
2 changes: 1 addition & 1 deletion src/Griddly/Core/Observers/Vulkan/VulkanDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,4 +1203,4 @@ uint8_t* VulkanDevice::renderFrame() {
return imageRGBA_;
}

} // namespace vk
} // namespace vk

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions tests/src/Griddly/Core/Observers/BlockObserverTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ TEST(BlockObserverTest, global_variable_lighting) {
{},
};

config.resourceConfig = {"resources/images", "tests/resources/observer/block/shaders/global_lighting"};
config.resourceConfig = {"resources/games", "resources/images", "tests/resources/observer/block/shaders/global_lighting"};

runBlockObserverTest(config, Direction::LEFT, {3, 100, 100}, {1, 4, 4 * 100}, "tests/resources/observer/block/global_variable_lighting.png");
}
Expand Down Expand Up @@ -542,7 +542,7 @@ TEST(BlockObserverTest, reset) {
BlockObserverConfig observerConfig;
observerConfig.tileSize = glm::ivec2(20, 20);

observerConfig.resourceConfig = {"resources/images", "resources/shaders"};
observerConfig.resourceConfig = {"resources/games", "resources/images", "resources/shaders"};
observerConfig.shaderVariableConfig = ShaderVariableConfig();

observerConfig.blockDefinitions = getMockBlockDefinitions();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void runIsometricSpriteObserverRTSTest(IsometricSpriteObserverConfig observerCon
observerConfig.isoTileDepth = 4;
observerConfig.highlightPlayers = true;

observerConfig.resourceConfig = {"resources/images", "resources/shaders"};
observerConfig.resourceConfig = {"resources/games", "resources/images", "resources/shaders"};
observerConfig.shaderVariableConfig = ShaderVariableConfig();

observerConfig.spriteDefinitions = getMockRTSIsometricSpriteDefinitions();
Expand Down Expand Up @@ -477,7 +477,7 @@ TEST(IsometricSpriteObserverTest, object_variable_fragment_lighting) {
{"light"},
};

config.resourceConfig = {"resources/images", "tests/resources/observer/isometric/shaders/lighting"};
config.resourceConfig = {"resources/games", "resources/images", "tests/resources/observer/isometric/shaders/lighting"};

runIsometricSpriteObserverTest(config, Direction::LEFT, {3, 160, 128}, {1, 4, 4 * 160}, "tests/resources/observer/isometric/object_variable_fragment_lighting.png");
}
Expand Down Expand Up @@ -520,7 +520,7 @@ TEST(IsometricSpriteObserverTest, reset) {
observerConfig.isoTileHeight = 16;
observerConfig.isoTileDepth = 4;

observerConfig.resourceConfig = {"resources/images", "resources/shaders"};
observerConfig.resourceConfig = {"resources/games", "resources/images", "resources/shaders"};
observerConfig.shaderVariableConfig = ShaderVariableConfig();

observerConfig.spriteDefinitions = getMockIsometricSpriteDefinitions();
Expand Down
4 changes: 2 additions & 2 deletions tests/src/Griddly/Core/Observers/SpriteObserverTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void runSpriteObserverRTSTest(SpriteObserverConfig observerConfig,
observerConfig.tileSize = glm::ivec2(50, 50);
observerConfig.highlightPlayers = true;

observerConfig.resourceConfig = {"resources/images", "resources/shaders"};
observerConfig.resourceConfig = {"resources/games", "resources/images", "resources/shaders"};
observerConfig.shaderVariableConfig = ShaderVariableConfig();

observerConfig.spriteDefinitions = getMockRTSSpriteDefinitions();
Expand Down Expand Up @@ -503,7 +503,7 @@ TEST(SpriteObserverTest, object_variable_health_bars) {
{"health", "max_health"},
};

config.resourceConfig = {"resources/images", "tests/resources/observer/sprite/shaders/health_bars"};
config.resourceConfig = {"resources/games", "resources/images", "tests/resources/observer/sprite/shaders/health_bars"};

runSpriteObserverTest(config, Direction::LEFT, {3, 120, 120}, {1, 4, 4 * 100}, "tests/resources/observer/sprite/object_variable_health_bars.png");
}
Expand Down
7 changes: 5 additions & 2 deletions tests/src/Griddly/Core/Observers/VulkanObserverTest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ MATCHER_P3(ObservationResultMatcher, shape, strides, imageData, "") {
for (int c = 0; c < 4; c++) {
uint8_t srcImageBit = *(arg + y * strides[1] * shape[1] + x * strides[1] + c);
uint8_t dstImageBit = *(imageData + y * strides[2] + x * strides[1] + c * strides[0]);
if (srcImageBit != dstImageBit) {

// Tolerate error of 1 bit in the src and dst images as rendering
// deviates a little on different devices.
if (!(dstImageBit - 1 <= srcImageBit && srcImageBit <= dstImageBit + 1)) {
spdlog::debug("source x: {0} y: {1} c: {2} ({3} != {4})",
x, y, c, srcImageBit, dstImageBit);
return false;
Expand All @@ -49,4 +52,4 @@ MATCHER_P3(ObservationResultMatcher, shape, strides, imageData, "") {
return true;
}

} // namespace griddly
} // namespace griddly

0 comments on commit 669dd18

Please sign in to comment.