From 106cb940d391097e72f187b9b04024df2dff1803 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 4 Jan 2016 16:48:10 -0800 Subject: [PATCH 1/3] Change how GIT revision information is handled Add Cook to SCAN Prelim CCharAnimTime --- CMakeLists.txt | 12 +++++-- DataSpec/DNAMP1/SCAN.hpp | 12 +++++++ Runtime/Character/CCharAnimTime.hpp | 51 ++++++++++++++++++++++++++++- 3 files changed, 71 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 009d40b00..3fd163e5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,7 +78,7 @@ endif() unset(GIT_EXECUTABLE CACHE) find_package(Git) if(GIT_FOUND) - message("git found: ${GIT_EXECUTABLE}") + message(STATUS "Found GIT: ${GIT_EXECUTABLE}") # Get the current working branch execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --abbrev-ref HEAD WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -86,6 +86,12 @@ if(GIT_FOUND) execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_HASH_FULL OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --format=%ad WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_COMMIT_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) - - configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_SOURCE_DIR}/version.h) +else() + message(STATUS "Unable to find GIT, commit information will not be available") + set(GIT_BRANCH "") + set(GIT_COMMIT_HASH "") + set(GIT_COMMIT_HASH_FULL "") + set(GIT_COMMIT_DATE "") endif() + +configure_file(${CMAKE_SOURCE_DIR}/version.h.in ${CMAKE_SOURCE_DIR}/version.h) diff --git a/DataSpec/DNAMP1/SCAN.hpp b/DataSpec/DNAMP1/SCAN.hpp index 4482752a1..42d2da579 100644 --- a/DataSpec/DNAMP1/SCAN.hpp +++ b/DataSpec/DNAMP1/SCAN.hpp @@ -1,6 +1,7 @@ #ifndef _DNAMP1_SCAN_HPP_ #define _DNAMP1_SCAN_HPP_ +#include #include "../DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" @@ -195,6 +196,17 @@ struct SCAN : BigYAML return true; } + static bool Cook(const HECL::ProjectPath& inPath, const HECL::ProjectPath& outPath) + { + SCAN scan; + FILE* fp = HECL::Fopen(inPath.getAbsolutePath().c_str(), _S("rb")); + scan.fromYAMLFile(fp); + fclose(fp); + Athena::io::FileWriter ws(outPath.getAbsolutePath()); + scan.write(ws); + return true; + } + static void Name(const SpecBase& dataSpec, PAKEntryReadStream& rs, PAKRouter& pakRouter, diff --git a/Runtime/Character/CCharAnimTime.hpp b/Runtime/Character/CCharAnimTime.hpp index ca5ff5762..25cbe108e 100644 --- a/Runtime/Character/CCharAnimTime.hpp +++ b/Runtime/Character/CCharAnimTime.hpp @@ -6,8 +6,57 @@ namespace Retro class CCharAnimTime { -}; + float m_time; + int m_unk; // enum? +public: + CCharAnimTime(float time) + : m_time(time), + m_unk(m_time != 0.0 ? 0 : 2) + { + } + bool EqualsZero() + { + if (m_unk == 1 || m_unk == 2 || m_unk == 3) + return false; + + return (m_time == 0.0); + } + + bool GreaterThanZero() + { + if (EqualsZero()) + return false; + return (m_time != 0.0); + } +#if 0 + bool operator>=(const CCharAnimTime& other) + { + if (*this == other) + return true; + + return (*this > other); + } + + bool operator<=(const CCharAnimTime& other) + { + if (*this == other) + return true; + + return (*this < other); + } + + void operator*=(const CCharAnimTime& other) + { *this = *this * other; } + + void operator+=(const CCharAnimTime& other) + { *this = *this + other; } + + void operator+(const CCharAnimTime& other) + { + } +#endif +}; } #endif // __RETRO_CCHARANIMTIME_HPP__ From eddeaabbe3c8603c4fdf584eb14f786b6463a8b9 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 4 Jan 2016 17:24:09 -0800 Subject: [PATCH 2/3] Quick saveProject fix --- Editor/ProjectManager.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Editor/ProjectManager.cpp b/Editor/ProjectManager.cpp index 0e0231a05..78cd4823c 100644 --- a/Editor/ProjectManager.cpp +++ b/Editor/ProjectManager.cpp @@ -123,11 +123,11 @@ bool ProjectManager::saveProject() #ifdef RUDE_BINARY_CONFIGS HECL::ProjectPath rudeSpacesPath(*m_proj, _S(".hecl/rude_spaces.bin")); - Athena::io::FileReader r(rudeSpacesPath.getAbsolutePath(), 32 * 1024, false); - if (r.hasError()) + Athena::io::FileWriter w(rudeSpacesPath.getAbsolutePath(), true, false); + if (w.hasError()) return false; - m_vm.SetupEditorView(r); + m_vm.SaveEditorView(w); #else HECL::ProjectPath oldSpacesPath(*m_proj, _S(".hecl/~rude_spaces.yaml")); From 6e0240921f3dc588bf058cdbbdbfb01cbb015d46 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 4 Jan 2016 18:48:05 -0800 Subject: [PATCH 3/3] Update submodules --- hecl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hecl b/hecl index 02d87ba68..8c25ff6ab 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 02d87ba687d00d987f531e676829494678041ebe +Subproject commit 8c25ff6ab6428cb37977987b3e8f46d120d508c4