From 106cb940d391097e72f187b9b04024df2dff1803 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 4 Jan 2016 16:48:10 -0800 Subject: [PATCH] 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__