diff --git a/CMakeLists.txt b/CMakeLists.txt index edc0254..96e6c5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) cmake_minimum_required(VERSION 3.0) -project(Athena) +project(athena) endif() ################## @@ -33,84 +33,84 @@ list(APPEND CORE_EXTRA src/gekko_support.c include/gekko_support.h) endif() endif() -add_library(AthenaCore - src/Athena/Utility.cpp - src/Athena/FileReader.cpp - src/Athena/FileWriter.cpp - src/Athena/MemoryReader.cpp - src/Athena/MemoryWriter.cpp - src/Athena/Global.cpp - src/Athena/Checksums.cpp - src/Athena/Compression.cpp +add_library(athena-core + src/athena/Utility.cpp + src/athena/FileReader.cpp + src/athena/FileWriter.cpp + src/athena/MemoryReader.cpp + src/athena/MemoryWriter.cpp + src/athena/Global.cpp + src/athena/Checksums.cpp + src/athena/Compression.cpp src/LZ77/LZLookupTable.cpp src/LZ77/LZType10.cpp src/LZ77/LZType11.cpp src/LZ77/LZBase.cpp - src/Athena/FileInfo.cpp - src/Athena/Dir.cpp - src/Athena/DNAYaml.cpp + src/athena/FileInfo.cpp + src/athena/Dir.cpp + src/athena/DNAYaml.cpp ${CORE_EXTRA} - include/Athena/IStream.hpp - include/Athena/IStreamReader.hpp - include/Athena/IStreamWriter.hpp - include/Athena/Types.hpp - include/Athena/Utility.hpp - include/Athena/Global.hpp - include/Athena/FileReader.hpp - include/Athena/FileWriter.hpp - include/Athena/MemoryReader.hpp - include/Athena/MemoryWriter.hpp - include/Athena/Checksums.hpp - include/Athena/Compression.hpp + include/athena/IStream.hpp + include/athena/IStreamReader.hpp + include/athena/IStreamWriter.hpp + include/athena/Types.hpp + include/athena/Utility.hpp + include/athena/Global.hpp + include/athena/FileReader.hpp + include/athena/FileWriter.hpp + include/athena/MemoryReader.hpp + include/athena/MemoryWriter.hpp + include/athena/Checksums.hpp + include/athena/Compression.hpp include/LZ77/LZBase.hpp include/LZ77/LZLookupTable.hpp include/LZ77/LZType10.hpp include/LZ77/LZType11.hpp - include/Athena/FileInfo.hpp - include/Athena/Dir.hpp - include/Athena/DNA.hpp - include/Athena/DNAYaml.hpp + include/athena/FileInfo.hpp + include/athena/Dir.hpp + include/athena/DNA.hpp + include/athena/DNAYaml.hpp include/yaml.h include/utf8proc.h ) -add_library(AthenaSakura EXCLUDE_FROM_ALL - src/Athena/Sprite.cpp - src/Athena/SpriteFile.cpp - src/Athena/SpriteFileReader.cpp - src/Athena/SpriteFileWriter.cpp - src/Athena/SpriteFrame.cpp - src/Athena/SpritePart.cpp +add_library(athena-sakura EXCLUDE_FROM_ALL + src/athena/Sprite.cpp + src/athena/SpriteFile.cpp + src/athena/SpriteFileReader.cpp + src/athena/SpriteFileWriter.cpp + src/athena/SpriteFrame.cpp + src/athena/SpritePart.cpp - include/Athena/SakuraGlobal.hpp - include/Athena/Sprite.hpp - include/Athena/SpriteFile.hpp - include/Athena/SpriteFileReader.hpp - include/Athena/SpriteFileWriter.hpp - include/Athena/SpriteFrame.hpp - include/Athena/SpritePart.hpp + include/athena/SakuraGlobal.hpp + include/athena/Sprite.hpp + include/athena/SpriteFile.hpp + include/athena/SpriteFileReader.hpp + include/athena/SpriteFileWriter.hpp + include/athena/SpriteFrame.hpp + include/athena/SpritePart.hpp ) -add_library(AthenaWiiSave EXCLUDE_FROM_ALL - src/Athena/WiiBanner.cpp - src/Athena/WiiFile.cpp - src/Athena/WiiImage.cpp - src/Athena/WiiSave.cpp - src/Athena/WiiSaveReader.cpp - src/Athena/WiiSaveWriter.cpp +add_library(athena-wiisave EXCLUDE_FROM_ALL + src/athena/WiiBanner.cpp + src/athena/WiiFile.cpp + src/athena/WiiImage.cpp + src/athena/WiiSave.cpp + src/athena/WiiSaveReader.cpp + src/athena/WiiSaveWriter.cpp src/bn.cpp src/ec.cpp src/md5.cpp src/sha1.cpp src/aes.cpp - include/Athena/WiiBanner.hpp - include/Athena/WiiFile.hpp - include/Athena/WiiImage.hpp - include/Athena/WiiSave.hpp - include/Athena/WiiSaveReader.hpp - include/Athena/WiiSaveWriter.hpp + include/athena/WiiBanner.hpp + include/athena/WiiFile.hpp + include/athena/WiiImage.hpp + include/athena/WiiSave.hpp + include/athena/WiiSaveReader.hpp + include/athena/WiiSaveWriter.hpp include/aes.hpp include/bn.h include/ec.h @@ -121,36 +121,36 @@ if(NOT MSVC AND NOT GEKKO) set_source_files_properties(src/aes.cpp PROPERTIES COMPILE_FLAGS -maes) endif() -add_library(AthenaZelda EXCLUDE_FROM_ALL - src/Athena/ALTTPFile.cpp - src/Athena/ALTTPFileReader.cpp - src/Athena/ALTTPFileWriter.cpp - src/Athena/ALTTPQuest.cpp - src/Athena/MCFile.cpp - src/Athena/MCFileReader.cpp - src/Athena/MCFileWriter.cpp - src/Athena/MCSlot.cpp - src/Athena/SkywardSwordFile.cpp - src/Athena/SkywardSwordFileReader.cpp - src/Athena/SkywardSwordFileWriter.cpp - src/Athena/SkywardSwordQuest.cpp - src/Athena/ZQuestFile.cpp - src/Athena/ZQuestFileReader.cpp - src/Athena/ZQuestFileWriter.cpp +add_library(athena-zelda EXCLUDE_FROM_ALL + src/athena/ALTTPFile.cpp + src/athena/ALTTPFileReader.cpp + src/athena/ALTTPFileWriter.cpp + src/athena/ALTTPQuest.cpp + src/athena/MCFile.cpp + src/athena/MCFileReader.cpp + src/athena/MCFileWriter.cpp + src/athena/MCSlot.cpp + src/athena/SkywardSwordFile.cpp + src/athena/SkywardSwordFileReader.cpp + src/athena/SkywardSwordFileWriter.cpp + src/athena/SkywardSwordQuest.cpp + src/athena/ZQuestFile.cpp + src/athena/ZQuestFileReader.cpp + src/athena/ZQuestFileWriter.cpp - include/Athena/ALTTPEnums.hpp - include/Athena/ALTTPFile.hpp - include/Athena/ALTTPFileReader.hpp - include/Athena/ALTTPFileWriter.hpp - include/Athena/ALTTPQuest.hpp - include/Athena/ALTTPStructs.hpp - include/Athena/MCFile.hpp - include/Athena/MCFileReader.hpp - include/Athena/MCFileWriter.hpp - include/Athena/SkywardSwordFile.hpp - include/Athena/SkywardSwordFileReader.hpp - include/Athena/SkywardSwordFileWriter.hpp - include/Athena/SkywardSwordQuest.hpp + include/athena/ALTTPEnums.hpp + include/athena/ALTTPFile.hpp + include/athena/ALTTPFileReader.hpp + include/athena/ALTTPFileWriter.hpp + include/athena/ALTTPQuest.hpp + include/athena/ALTTPStructs.hpp + include/athena/MCFile.hpp + include/athena/MCFileReader.hpp + include/athena/MCFileWriter.hpp + include/athena/SkywardSwordFile.hpp + include/athena/SkywardSwordFileReader.hpp + include/athena/SkywardSwordFileWriter.hpp + include/athena/SkywardSwordQuest.hpp ) # Icon @@ -162,7 +162,7 @@ set(INSTALL_INCLUDE_DIR include CACHE PATH "Installation directory for header fi if(WIN32 AND NOT CYGWIN) set(INSTALL_CMAKE_DIR cmake) else() - set(INSTALL_CMAKE_DIR lib/cmake/Athena) + set(INSTALL_CMAKE_DIR lib/cmake/athena) endif() # Make relative paths absolute (needed later on) @@ -176,16 +176,16 @@ foreach(p LIB INCLUDE CMAKE) endforeach() # Define installs -install(DIRECTORY include/ DESTINATION ${INSTALL_INCLUDE_DIR}/Athena COMPONENT Athena) -install(TARGETS AthenaCore - DESTINATION ${INSTALL_LIB_DIR} EXPORT AthenaTargets COMPONENT Athena) +install(DIRECTORY include/ DESTINATION ${INSTALL_INCLUDE_DIR}/athena COMPONENT athena) +install(TARGETS athena-core + DESTINATION ${INSTALL_LIB_DIR} EXPORT AthenaTargets COMPONENT athena) if(WIN32 AND NOT CYGWIN) -install(FILES Athena.ico DESTINATION ${INSTALL_LIB_DIR} COMPONENT Athena) +install(FILES Athena.ico DESTINATION ${INSTALL_LIB_DIR} COMPONENT athena) elseif(UNIX) configure_file(libAthena.pc.in libAthena.pc @ONLY) configure_file(PKGBUILD.in ${CMAKE_CURRENT_SOURCE_DIR}/PKGBUILD @ONLY) install(FILES ${PROJECT_BINARY_DIR}/libAthena.pc - DESTINATION ${INSTALL_LIB_DIR}/pkgconfig COMPONENT Athena) + DESTINATION ${INSTALL_LIB_DIR}/pkgconfig COMPONENT athena) endif() ################## @@ -193,22 +193,21 @@ endif() ################## # Add all targets to the build-tree export set -export(TARGETS AthenaCore - FILE "${PROJECT_BINARY_DIR}/AthenaTargets.cmake") +export(TARGETS athena-core FILE "${PROJECT_BINARY_DIR}/AthenaTargets.cmake") # Export the package for use from the build-tree # (this registers the build-tree with a global CMake-registry) -export(PACKAGE Athena) +export(PACKAGE athena) # Create the AthenaConfig.cmake # ... for the build tree -set(CONF_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include/Athena") +set(CONF_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include/athena") set(CONF_ICON_DIR "${PROJECT_SOURCE_DIR}/Athena.ico") configure_file(AthenaConfig.cmake.in "${PROJECT_BINARY_DIR}/AthenaConfig.cmake" @ONLY) # ... for the install tree file(RELATIVE_PATH REL_INCLUDE_DIR "${ABS_INSTALL_CMAKE_DIR}" "${ABS_INSTALL_INCLUDE_DIR}") file(RELATIVE_PATH REL_ICON_DIR "${ABS_INSTALL_CMAKE_DIR}" "${ABS_INSTALL_LIB_DIR}/Athena.ico") -set(CONF_INCLUDE_DIR "\${ATHENA_CMAKE_DIR}/${REL_INCLUDE_DIR}/Athena") +set(CONF_INCLUDE_DIR "\${ATHENA_CMAKE_DIR}/${REL_INCLUDE_DIR}/athena") set(CONF_ICON_DIR "\${ATHENA_CMAKE_DIR}/${REL_ICON_DIR}") configure_file(AthenaConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/AthenaConfig.cmake" @ONLY) # ... for both @@ -218,10 +217,10 @@ configure_file(AthenaConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/AthenaConfigV install(FILES "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/AthenaConfig.cmake" "${PROJECT_BINARY_DIR}/AthenaConfigVersion.cmake" - DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Athena) + DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT athena) # Install the export set for use with the install-tree -install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT Athena) +install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT athena) ################ # atdna import # @@ -243,11 +242,11 @@ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE") set(CPACK_PACKAGE_VERSION_MAJOR ${ATHENA_MAJOR_VERSION}) set(CPACK_PACKAGE_VERSION_MINOR ${ATHENA_MINOR_VERSION}) set(CPACK_PACKAGE_VERSION_PATCH ${ATHENA_PATCH_VERSION}) -set(CPACK_PACKAGE_INSTALL_DIRECTORY "Athena") +set(CPACK_PACKAGE_INSTALL_DIRECTORY "athena") if(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make # sure there is at least one set of four (4) backlasshes. - set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "Athena") + set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "athena") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\AthenaNSIS.bmp") set(CPACK_NSIS_MODIFY_PATH ON) set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}\\\\Athena.ico") diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index 6c52e4b..20f247b 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -10,7 +10,7 @@ add_executable(Example if(GEKKO) include_directories(${LIBOGCDIR}/include) link_directories(${LIGOGCDIR}/lib/wii) -target_link_libraries(Example AthenaCore z wiiuse bte ogc m) +target_link_libraries(Example athena-core z wiiuse bte ogc m) else() #TODO: add normal link libraries endif() diff --git a/Example/main.cpp b/Example/main.cpp index 7101442..5314176 100644 --- a/Example/main.cpp +++ b/Example/main.cpp @@ -10,7 +10,7 @@ static GXRModeObj* rmode = nullptr; #endif -#include +#include int main() { @@ -36,7 +36,7 @@ int main() if (rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); - Athena::io::MemoryCopyReader test("sd:/test.dat"); + athena::io::MemoryCopyReader test("sd:/test.dat"); while(true) { #if HW_RVL diff --git a/atdna/CMakeLists.txt b/atdna/CMakeLists.txt index 1ac279c..3030307 100644 --- a/atdna/CMakeLists.txt +++ b/atdna/CMakeLists.txt @@ -86,7 +86,7 @@ endif() # Define installs install(TARGETS atdna DESTINATION ${INSTALL_BIN_DIR} EXPORT atdnaTargets COMPONENT atdna) -install(DIRECTORY ${CLANG_INCLUDE_DIR}/ DESTINATION ${INSTALL_INCLUDE_DIR}/Athena/clang COMPONENT atdna) +install(DIRECTORY ${CLANG_INCLUDE_DIR}/ DESTINATION ${INSTALL_INCLUDE_DIR}/athena/clang COMPONENT atdna) ################## # Package Export # diff --git a/atdna/main.cpp b/atdna/main.cpp index ab537ff..11520a0 100644 --- a/atdna/main.cpp +++ b/atdna/main.cpp @@ -15,8 +15,8 @@ #include "llvm/Support/CommandLine.h" static unsigned AthenaError = 0; -#define ATHENA_DNA_BASETYPE "struct Athena::io::DNA" -#define ATHENA_DNA_YAMLTYPE "struct Athena::io::DNAYaml" +#define ATHENA_DNA_BASETYPE "struct athena::io::DNA" +#define ATHENA_DNA_YAMLTYPE "struct athena::io::DNAYaml" #define ATHENA_DNA_READER "__dna_reader" #define ATHENA_DNA_WRITER "__dna_writer" #define ATHENA_YAML_READER "__dna_docin" @@ -1148,9 +1148,9 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor for (int p=0 ; p<2 ; ++p) { if (p) - fileOut << "void " << decl->getQualifiedNameAsString() << "::write(Athena::io::IStreamWriter& " ATHENA_DNA_WRITER ") const\n{\n"; + fileOut << "void " << decl->getQualifiedNameAsString() << "::write(athena::io::IStreamWriter& " ATHENA_DNA_WRITER ") const\n{\n"; else - fileOut << "void " << decl->getQualifiedNameAsString() << "::read(Athena::io::IStreamReader& " ATHENA_DNA_READER ")\n{\n"; + fileOut << "void " << decl->getQualifiedNameAsString() << "::read(athena::io::IStreamReader& " ATHENA_DNA_READER ")\n{\n"; if (baseDNA.size()) { @@ -1823,23 +1823,23 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor if (directionVal == 0) { if (!p) - fileOut << " " ATHENA_DNA_READER ".seek(" << offsetExprStr << ", Athena::Begin);\n"; + fileOut << " " ATHENA_DNA_READER ".seek(" << offsetExprStr << ", athena::Begin);\n"; else - fileOut << " " ATHENA_DNA_WRITER ".seek(" << offsetExprStr << ", Athena::Begin);\n"; + fileOut << " " ATHENA_DNA_WRITER ".seek(" << offsetExprStr << ", athena::Begin);\n"; } else if (directionVal == 1) { if (!p) - fileOut << " " ATHENA_DNA_READER ".seek(" << offsetExprStr << ", Athena::Current);\n"; + fileOut << " " ATHENA_DNA_READER ".seek(" << offsetExprStr << ", athena::Current);\n"; else - fileOut << " " ATHENA_DNA_WRITER ".seek(" << offsetExprStr << ", Athena::Current);\n"; + fileOut << " " ATHENA_DNA_WRITER ".seek(" << offsetExprStr << ", athena::Current);\n"; } else if (directionVal == 2) { if (!p) - fileOut << " " ATHENA_DNA_READER ".seek(" << offsetExprStr << ", Athena::End);\n"; + fileOut << " " ATHENA_DNA_READER ".seek(" << offsetExprStr << ", athena::End);\n"; else - fileOut << " " ATHENA_DNA_WRITER ".seek(" << offsetExprStr << ", Athena::End);\n"; + fileOut << " " ATHENA_DNA_WRITER ".seek(" << offsetExprStr << ", athena::End);\n"; } } @@ -1882,16 +1882,16 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor else if (align.isPowerOf2()) { if (!p) - fileOut << " " ATHENA_DNA_READER ".seek((" ATHENA_DNA_READER ".position() + " << alignVal-1 << ") & ~" << alignVal-1 << ", Athena::Begin);\n"; + fileOut << " " ATHENA_DNA_READER ".seek((" ATHENA_DNA_READER ".position() + " << alignVal-1 << ") & ~" << alignVal-1 << ", athena::Begin);\n"; else - fileOut << " " ATHENA_DNA_WRITER ".seek((" ATHENA_DNA_WRITER ".position() + " << alignVal-1 << ") & ~" << alignVal-1 << ", Athena::Begin);\n"; + fileOut << " " ATHENA_DNA_WRITER ".seek((" ATHENA_DNA_WRITER ".position() + " << alignVal-1 << ") & ~" << alignVal-1 << ", athena::Begin);\n"; } else { if (!p) - fileOut << " " ATHENA_DNA_READER ".seek((" ATHENA_DNA_READER ".position() + " << alignVal-1 << ") / " << alignVal << " * " << alignVal << ", Athena::Begin);\n"; + fileOut << " " ATHENA_DNA_READER ".seek((" ATHENA_DNA_READER ".position() + " << alignVal-1 << ") / " << alignVal << " * " << alignVal << ", athena::Begin);\n"; else - fileOut << " " ATHENA_DNA_WRITER ".seek((" ATHENA_DNA_WRITER ".position() + " << alignVal-1 << ") / " << alignVal << " * " << alignVal << ", Athena::Begin);\n"; + fileOut << " " ATHENA_DNA_WRITER ".seek((" ATHENA_DNA_WRITER ".position() + " << alignVal-1 << ") / " << alignVal << " * " << alignVal << ", athena::Begin);\n"; } } } @@ -1926,9 +1926,9 @@ class ATDNAEmitVisitor : public clang::RecursiveASTVisitor for (int p=0 ; p<2 ; ++p) { if (p) - fileOut << "void " << decl->getQualifiedNameAsString() << "::write(Athena::io::YAMLDocWriter& " ATHENA_YAML_WRITER ") const\n{\n"; + fileOut << "void " << decl->getQualifiedNameAsString() << "::write(athena::io::YAMLDocWriter& " ATHENA_YAML_WRITER ") const\n{\n"; else - fileOut << "void " << decl->getQualifiedNameAsString() << "::read(Athena::io::YAMLDocReader& " ATHENA_YAML_READER ")\n{\n"; + fileOut << "void " << decl->getQualifiedNameAsString() << "::read(athena::io::YAMLDocReader& " ATHENA_YAML_READER ")\n{\n"; if (baseDNA.size()) { @@ -2274,7 +2274,7 @@ public: if (!decl->getNumBases()) return true; - /* First ensure this inherits from struct Athena::io::DNA */ + /* First ensure this inherits from struct athena::io::DNA */ std::string baseDNA; bool isYAML = false; if (!isDNARecord(decl, baseDNA, isYAML)) @@ -2333,9 +2333,9 @@ public: { /* Write file head */ fileOut << "/* Auto generated atdna implementation */\n" - "#include \n" - "#include \n" - "#include \n\n"; + "#include \n" + "#include \n" + "#include \n\n"; for (const std::string& inputf : InputFilenames) fileOut << "#include \"" << inputf << "\"\n"; fileOut << "\n"; diff --git a/atdna/test.hpp b/atdna/test.hpp index 351dda3..9866493 100644 --- a/atdna/test.hpp +++ b/atdna/test.hpp @@ -1,6 +1,6 @@ -#include +#include -using namespace Athena; +using namespace athena; typedef io::DNAYaml BigDNA; struct TESTSubFile : public BigDNA diff --git a/extern/yaml/CMakeLists.txt b/extern/yaml/CMakeLists.txt index 5c90e88..a7a2ffc 100644 --- a/extern/yaml/CMakeLists.txt +++ b/extern/yaml/CMakeLists.txt @@ -6,6 +6,6 @@ set(YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERS file(GLOB SRC src/*.c) include_directories(../../include) -add_library(AthenaLibYaml STATIC ${SRC}) +add_library(athena-libyaml STATIC ${SRC}) -install(TARGETS AthenaLibYaml DESTINATION lib COMPONENT yaml) +install(TARGETS athena-libyaml DESTINATION lib COMPONENT yaml) diff --git a/include/LZ77/LZLookupTable.hpp b/include/LZ77/LZLookupTable.hpp index 8d24ae2..a0955e9 100644 --- a/include/LZ77/LZLookupTable.hpp +++ b/include/LZ77/LZLookupTable.hpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include struct LZLengthOffset { diff --git a/include/aes.hpp b/include/aes.hpp index 77d4dd1..4b6c514 100644 --- a/include/aes.hpp +++ b/include/aes.hpp @@ -5,7 +5,7 @@ #include #include -namespace Athena +namespace athena { class IAES diff --git a/include/Athena/ALTTPEnums.hpp b/include/athena/ALTTPEnums.hpp similarity index 98% rename from include/Athena/ALTTPEnums.hpp rename to include/athena/ALTTPEnums.hpp index c7cc0ef..8536bb3 100644 --- a/include/Athena/ALTTPEnums.hpp +++ b/include/athena/ALTTPEnums.hpp @@ -3,7 +3,7 @@ #include "Types.hpp" -namespace Athena +namespace athena { enum BowType : char diff --git a/include/Athena/ALTTPFile.hpp b/include/athena/ALTTPFile.hpp similarity index 93% rename from include/Athena/ALTTPFile.hpp rename to include/athena/ALTTPFile.hpp index a9c8af3..2f52842 100644 --- a/include/Athena/ALTTPFile.hpp +++ b/include/athena/ALTTPFile.hpp @@ -1,10 +1,10 @@ #ifndef ALTTP_FILE_HPP #define ALTTP_FILE_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" #include -namespace Athena +namespace athena { class ALTTPQuest; diff --git a/include/Athena/ALTTPFileReader.hpp b/include/athena/ALTTPFileReader.hpp similarity index 87% rename from include/Athena/ALTTPFileReader.hpp rename to include/athena/ALTTPFileReader.hpp index b6ddce5..a256ad4 100644 --- a/include/Athena/ALTTPFileReader.hpp +++ b/include/athena/ALTTPFileReader.hpp @@ -2,11 +2,11 @@ #define ALTTP_FILE_READER_HPP #include -#include "Athena/Types.hpp" -#include "Athena/MemoryReader.hpp" -#include "Athena/ALTTPQuest.hpp" +#include "athena/Types.hpp" +#include "athena/MemoryReader.hpp" +#include "athena/ALTTPQuest.hpp" -namespace Athena +namespace athena { class ALTTPFile; diff --git a/include/Athena/ALTTPFileWriter.hpp b/include/athena/ALTTPFileWriter.hpp similarity index 90% rename from include/Athena/ALTTPFileWriter.hpp rename to include/athena/ALTTPFileWriter.hpp index 501ae87..65a80d5 100644 --- a/include/Athena/ALTTPFileWriter.hpp +++ b/include/athena/ALTTPFileWriter.hpp @@ -2,10 +2,10 @@ #define ALTTP_FILE_WRITER_HPP #include -#include "Athena/MemoryWriter.hpp" -#include "Athena/ALTTPQuest.hpp" +#include "athena/MemoryWriter.hpp" +#include "athena/ALTTPQuest.hpp" -namespace Athena +namespace athena { class ALTTPFile; diff --git a/include/Athena/ALTTPQuest.hpp b/include/athena/ALTTPQuest.hpp similarity index 94% rename from include/Athena/ALTTPQuest.hpp rename to include/athena/ALTTPQuest.hpp index e5cd3ac..6bd8a58 100644 --- a/include/Athena/ALTTPQuest.hpp +++ b/include/athena/ALTTPQuest.hpp @@ -1,13 +1,13 @@ #ifndef ALTTP_QUEST_HPP #define ALTTP_QUEST_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" #include #include -#include "Athena/ALTTPStructs.hpp" -#include "Athena/ALTTPEnums.hpp" +#include "athena/ALTTPStructs.hpp" +#include "athena/ALTTPEnums.hpp" -namespace Athena +namespace athena { /*! \class ALTTPQuest diff --git a/include/Athena/ALTTPStructs.hpp b/include/athena/ALTTPStructs.hpp similarity index 93% rename from include/Athena/ALTTPStructs.hpp rename to include/athena/ALTTPStructs.hpp index 58fc1c1..7c50263 100644 --- a/include/Athena/ALTTPStructs.hpp +++ b/include/athena/ALTTPStructs.hpp @@ -2,9 +2,9 @@ #define ALTTP_STRUCTS_HPP #include -#include "Athena/Types.hpp" +#include "athena/Types.hpp" -namespace Athena +namespace athena { struct ALTTPRoomFlags diff --git a/include/Athena/Checksums.hpp b/include/athena/Checksums.hpp similarity index 88% rename from include/Athena/Checksums.hpp rename to include/athena/Checksums.hpp index 137348c..9a79207 100644 --- a/include/Athena/Checksums.hpp +++ b/include/athena/Checksums.hpp @@ -1,9 +1,9 @@ #ifndef CHECKSUMS_HPP #define CHECKSUMS_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { namespace Checksums { diff --git a/include/Athena/Compression.hpp b/include/athena/Compression.hpp similarity index 94% rename from include/Athena/Compression.hpp rename to include/athena/Compression.hpp index a2caa4a..ce5b29e 100644 --- a/include/Athena/Compression.hpp +++ b/include/athena/Compression.hpp @@ -1,9 +1,9 @@ #ifndef COMPRESSION_HPP #define COMPRESSION_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/include/Athena/DNA.hpp b/include/athena/DNA.hpp similarity index 94% rename from include/Athena/DNA.hpp rename to include/athena/DNA.hpp index ea9c88b..3b8a033 100644 --- a/include/Athena/DNA.hpp +++ b/include/athena/DNA.hpp @@ -13,7 +13,7 @@ #include #include -namespace Athena +namespace athena { namespace io { @@ -84,7 +84,7 @@ struct DNA * @tparam sizeVar C++ expression wrapped in DNA_COUNT macro to determine number of bytes for buffer */ template - using Buffer = struct Athena::io::Buffer; + using Buffer = struct athena::io::Buffer; /** * @brief Template type wrapping std::string and signaling atdna to read string data where it's used @@ -92,7 +92,7 @@ struct DNA * -1 literal indicates null-terminated string */ template - using String = struct Athena::io::String; + using String = struct athena::io::String; /** * @brief Template type wrapping std::wstring and signaling atdna to read wstring data where it's used @@ -100,7 +100,7 @@ struct DNA * -1 literal indicates null-terminated wstring */ template - using WString = struct Athena::io::WString; + using WString = struct athena::io::WString; /** * @brief Template type wrapping std::string and signaling atdna to read wstring data where it's used @@ -108,7 +108,7 @@ struct DNA * -1 literal indicates null-terminated string */ template - using WStringAsString = struct Athena::io::WStringAsString; + using WStringAsString = struct athena::io::WStringAsString; /** * @brief Meta Template signaling atdna to insert a stream seek where it's used @@ -232,14 +232,14 @@ struct WStringAsString : public DNA, public std::string /** Macro to automatically declare read/write methods in subclasses */ #define DECL_DNA \ - void read(Athena::io::IStreamReader&); \ - void write(Athena::io::IStreamWriter&) const; \ + void read(athena::io::IStreamReader&); \ + void write(athena::io::IStreamWriter&) const; \ size_t binarySize(size_t __isz) const; /** Macro to automatically declare read/write methods and prevent outputting implementation */ #define DECL_EXPLICIT_DNA \ - void read(Athena::io::IStreamReader&); \ - void write(Athena::io::IStreamWriter&) const; \ + void read(athena::io::IStreamReader&); \ + void write(athena::io::IStreamWriter&) const; \ size_t binarySize(size_t __isz) const; \ Delete __dna_delete; diff --git a/include/Athena/DNAYaml.hpp b/include/athena/DNAYaml.hpp similarity index 97% rename from include/Athena/DNAYaml.hpp rename to include/athena/DNAYaml.hpp index b5c98d7..84138ea 100644 --- a/include/Athena/DNAYaml.hpp +++ b/include/athena/DNAYaml.hpp @@ -13,7 +13,7 @@ #include "DNA.hpp" #include "FileReader.hpp" -namespace Athena +namespace athena { namespace io { @@ -1143,16 +1143,16 @@ struct DNAYaml : DNA virtual const char* DNATypeV() const {return nullptr;} template - using Buffer = struct Athena::io::BufferYaml; + using Buffer = struct athena::io::BufferYaml; template - using String = struct Athena::io::StringYaml; + using String = struct athena::io::StringYaml; template - using WString = struct Athena::io::WStringYaml; + using WString = struct athena::io::WStringYaml; template - using WStringAsString = struct Athena::io::WStringAsStringYaml; + using WStringAsString = struct athena::io::WStringAsStringYaml; std::string toYAMLString() const { @@ -1228,7 +1228,7 @@ struct DNAYaml : DNA } template - static bool ValidateFromYAMLFile(Athena::io::FileReader& fin) + static bool ValidateFromYAMLFile(athena::io::FileReader& fin) { return ValidateFromYAMLFile(fin._fileHandle()); } @@ -1251,9 +1251,9 @@ struct BufferYaml : public DNAYaml, public std::unique_ptr { return __isz + sizeVar; } - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {*this = reader.readUBytes(nullptr);} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeUBytes(nullptr, *this, sizeVar);} }; @@ -1267,9 +1267,9 @@ struct StringYaml : public DNAYaml, public std::string {writer.writeString(*this, sizeVar);} size_t binarySize(size_t __isz) const {return __isz + ((sizeVar<0)?(this->size()+1):sizeVar);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {this->assign(std::move(reader.readString(nullptr)));} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeString(nullptr, *this);} std::string& operator=(const std::string& __str) {return this->assign(__str);} @@ -1293,9 +1293,9 @@ struct WStringYaml : public DNAYaml, public std::wstring } size_t binarySize(size_t __isz) const {return __isz + (((sizeVar<0)?(this->size()+1):sizeVar)*2);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {this->assign(std::move(reader.readWString(nullptr)));} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeWString(nullptr, *this);} std::wstring& operator=(const std::wstring& __str) {return this->assign(__str);} @@ -1313,9 +1313,9 @@ struct WStringAsStringYaml : public DNAYaml, public std::string {writer.writeStringAsWString(*this, sizeVar);} size_t binarySize(size_t __isz) const {return __isz + (((sizeVar<0)?(this->size()+1):sizeVar)*2);} - void read(Athena::io::YAMLDocReader& reader) + void read(athena::io::YAMLDocReader& reader) {this->assign(std::move(reader.readString(nullptr)));} - void write(Athena::io::YAMLDocWriter& writer) const + void write(athena::io::YAMLDocWriter& writer) const {writer.writeString(nullptr, *this);} std::string& operator=(const std::string& __str) {return this->assign(__str);} @@ -1326,15 +1326,15 @@ struct WStringAsStringYaml : public DNAYaml, public std::string /** Macro to automatically declare YAML read/write methods in subclasses */ #define DECL_YAML \ DECL_DNA \ - void read(Athena::io::YAMLDocReader&); \ - void write(Athena::io::YAMLDocWriter&) const; \ + void read(athena::io::YAMLDocReader&); \ + void write(athena::io::YAMLDocWriter&) const; \ static const char* DNAType(); \ const char* DNATypeV() const {return DNAType();} \ /** Macro to automatically declare YAML read/write methods with client-code's definition */ #define DECL_EXPLICIT_YAML \ - void read(Athena::io::YAMLDocReader&); \ - void write(Athena::io::YAMLDocWriter&) const; \ + void read(athena::io::YAMLDocReader&); \ + void write(athena::io::YAMLDocWriter&) const; \ static const char* DNAType(); \ const char* DNATypeV() const {return DNAType();} \ diff --git a/include/Athena/Dir.hpp b/include/athena/Dir.hpp similarity index 93% rename from include/Athena/Dir.hpp rename to include/athena/Dir.hpp index 9e9a5a3..154b6b5 100644 --- a/include/Athena/Dir.hpp +++ b/include/athena/Dir.hpp @@ -1,14 +1,14 @@ #ifndef DIR_HPP #define DIR_HPP -#include "Athena/FileInfo.hpp" +#include "athena/FileInfo.hpp" #include #if _WIN32 typedef int mode_t; #endif -namespace Athena +namespace athena { class Dir { diff --git a/include/Athena/FileInfo.hpp b/include/athena/FileInfo.hpp similarity index 97% rename from include/Athena/FileInfo.hpp rename to include/athena/FileInfo.hpp index 28515e4..11f46d0 100644 --- a/include/Athena/FileInfo.hpp +++ b/include/athena/FileInfo.hpp @@ -3,9 +3,9 @@ #include -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { class FileInfo { diff --git a/include/Athena/FileReader.hpp b/include/athena/FileReader.hpp similarity index 94% rename from include/Athena/FileReader.hpp rename to include/athena/FileReader.hpp index 8ae4feb..70aa67b 100644 --- a/include/Athena/FileReader.hpp +++ b/include/athena/FileReader.hpp @@ -4,9 +4,9 @@ #include #include #include -#include "Athena/IStreamReader.hpp" +#include "athena/IStreamReader.hpp" -namespace Athena +namespace athena { namespace io { @@ -66,7 +66,7 @@ protected: #ifndef FILEREADER_BASE #define FILEREADER_BASE() \ private: \ - typedef Athena::io::FileReader base + typedef athena::io::FileReader base #endif // FILEREADER_BASE diff --git a/include/Athena/FileWriter.hpp b/include/athena/FileWriter.hpp similarity index 93% rename from include/Athena/FileWriter.hpp rename to include/athena/FileWriter.hpp index ffaa566..f1222c7 100644 --- a/include/Athena/FileWriter.hpp +++ b/include/athena/FileWriter.hpp @@ -1,10 +1,10 @@ #ifndef FILEWRITER_HPP #define FILEWRITER_HPP -#include "Athena/IStreamWriter.hpp" +#include "athena/IStreamWriter.hpp" #include -namespace Athena +namespace athena { namespace io { @@ -59,7 +59,7 @@ private: #ifndef FILEWRITER_BASE #define FILEWRITER_BASE() \ private: \ - typedef Athena::io::FileWriter base; + typedef athena::io::FileWriter base; #endif // FILEWRITER_BASE #endif // FILEWRITER_HPP diff --git a/include/Athena/Global.hpp b/include/athena/Global.hpp similarity index 84% rename from include/Athena/Global.hpp rename to include/athena/Global.hpp index 75543ee..d3c6c7c 100644 --- a/include/Athena/Global.hpp +++ b/include/athena/Global.hpp @@ -2,8 +2,8 @@ #define GLOBAL_HPP #include -#include "Athena/Types.hpp" -#include "Athena/Utility.hpp" +#include "athena/Types.hpp" +#include "athena/Utility.hpp" #ifdef _MSC_VER #pragma warning(disable : 4996) @@ -100,7 +100,7 @@ inline type operator~(const type& key)\ } #endif -namespace Athena +namespace athena { namespace error { @@ -126,7 +126,7 @@ enum Endian }; } // Athena -typedef void (*atEXCEPTION_HANDLER)(Athena::error::Level level, const char* file, const char* function, int line, const char* fmt, ...); +typedef void (*atEXCEPTION_HANDLER)(athena::error::Level level, const char* file, const char* function, int line, const char* fmt, ...); atEXCEPTION_HANDLER atGetExceptionHandler(); /** @@ -135,15 +135,15 @@ atEXCEPTION_HANDLER atGetExceptionHandler(); */ void atSetExceptionHandler(atEXCEPTION_HANDLER func); -std::ostream& operator<<(std::ostream& os, const Athena::SeekOrigin& origin); -std::ostream& operator<<(std::ostream& os, const Athena::Endian& endian); +std::ostream& operator<<(std::ostream& os, const athena::SeekOrigin& origin); +std::ostream& operator<<(std::ostream& os, const athena::Endian& endian); #ifdef _MSC_VER #ifndef NDEBUG #define atDebug(fmt, ...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ + __handler(athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ } while(0) #else #define atDebug(fmt, ...) @@ -152,25 +152,25 @@ std::ostream& operator<<(std::ostream& os, const Athena::Endian& endian); #define atMessage(fmt, ...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ + __handler(athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ } while(0) #define atWarning(fmt, ...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Warning, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ + __handler(athena::error::Level::Warning, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ } while(0) #define atError(fmt, ...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Error, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ + __handler(athena::error::Level::Error, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ } while(0) #define atFatal(fmt, ...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Fatal, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ + __handler(athena::error::Level::Fatal, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt, ##__VA_ARGS__); \ } while(0) #elif defined(__GNUC__) @@ -178,7 +178,7 @@ std::ostream& operator<<(std::ostream& os, const Athena::Endian& endian); #define atDebug(fmt...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ + __handler(athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ } while(0) #else // _MSC_VER #define atDebug(fmt, ...) @@ -187,25 +187,25 @@ std::ostream& operator<<(std::ostream& os, const Athena::Endian& endian); #define atMessage(fmt...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ + __handler(athena::error::Level::Message, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ } while(0) #define atWarning(fmt...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Warning, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ + __handler(athena::error::Level::Warning, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ } while(0) #define atError(fmt...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Error, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ + __handler(athena::error::Level::Error, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ } while(0) #define atFatal(fmt...) \ do { atEXCEPTION_HANDLER __handler = atGetExceptionHandler(); \ if (__handler) \ - __handler(Athena::error::Level::Fatal, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ + __handler(athena::error::Level::Fatal, __FILE__, AT_PRETTY_FUNCTION, __LINE__, fmt); \ } while(0) #endif // defined(__GNUC__) diff --git a/include/Athena/IStream.hpp b/include/athena/IStream.hpp similarity index 97% rename from include/Athena/IStream.hpp rename to include/athena/IStream.hpp index e08541a..e61e1fe 100644 --- a/include/Athena/IStream.hpp +++ b/include/athena/IStream.hpp @@ -3,7 +3,7 @@ #include "Global.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/include/Athena/IStreamReader.hpp b/include/athena/IStreamReader.hpp similarity index 99% rename from include/Athena/IStreamReader.hpp rename to include/athena/IStreamReader.hpp index 1540f64..d8d9dae 100644 --- a/include/Athena/IStreamReader.hpp +++ b/include/athena/IStreamReader.hpp @@ -6,7 +6,7 @@ #include "utf8proc.h" #include "IStream.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/include/Athena/IStreamWriter.hpp b/include/athena/IStreamWriter.hpp similarity index 99% rename from include/Athena/IStreamWriter.hpp rename to include/athena/IStreamWriter.hpp index 0db42f3..afabd68 100644 --- a/include/Athena/IStreamWriter.hpp +++ b/include/athena/IStreamWriter.hpp @@ -4,7 +4,7 @@ #include "utf8proc.h" #include "IStream.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/include/Athena/MCFile.hpp b/include/athena/MCFile.hpp similarity index 92% rename from include/Athena/MCFile.hpp rename to include/athena/MCFile.hpp index c5fc93a..04fff6e 100644 --- a/include/Athena/MCFile.hpp +++ b/include/athena/MCFile.hpp @@ -1,9 +1,9 @@ #ifndef MCFILE_HPP #define MCFILE_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { class MCSlot; diff --git a/include/Athena/MCFileReader.hpp b/include/athena/MCFileReader.hpp similarity index 95% rename from include/Athena/MCFileReader.hpp rename to include/athena/MCFileReader.hpp index 739de6d..a80c35d 100644 --- a/include/Athena/MCFileReader.hpp +++ b/include/athena/MCFileReader.hpp @@ -1,9 +1,9 @@ #ifndef MCFILEREADER_HPP #define MCFILEREADER_HPP -#include "Athena/MemoryReader.hpp" +#include "athena/MemoryReader.hpp" -namespace Athena +namespace athena { class MCFile; diff --git a/include/Athena/MCFileWriter.hpp b/include/athena/MCFileWriter.hpp similarity index 93% rename from include/Athena/MCFileWriter.hpp rename to include/athena/MCFileWriter.hpp index c2987cd..023fc2e 100644 --- a/include/Athena/MCFileWriter.hpp +++ b/include/athena/MCFileWriter.hpp @@ -1,10 +1,10 @@ #ifndef MCFILEWRITER_HPP #define MCFILEWRITER_HPP -#include "Athena/Types.hpp" -#include "Athena/MemoryWriter.hpp" +#include "athena/Types.hpp" +#include "athena/MemoryWriter.hpp" -namespace Athena +namespace athena { class MCFile; diff --git a/include/Athena/MCSlot.hpp b/include/athena/MCSlot.hpp similarity index 70% rename from include/Athena/MCSlot.hpp rename to include/athena/MCSlot.hpp index dbfc6d8..deac5ff 100644 --- a/include/Athena/MCSlot.hpp +++ b/include/athena/MCSlot.hpp @@ -1,10 +1,10 @@ #ifndef MCSLOT_HPP #define MCSLOT_HPP -#include "Athena/Global.hpp" -#include "Athena/ZQuestFile.hpp" +#include "athena/Global.hpp" +#include "athena/ZQuestFile.hpp" -namespace Athena +namespace athena { class MCSlot : public ZQuestFile { diff --git a/include/Athena/MemoryReader.hpp b/include/athena/MemoryReader.hpp similarity index 96% rename from include/Athena/MemoryReader.hpp rename to include/athena/MemoryReader.hpp index d1ee4eb..d676f05 100644 --- a/include/Athena/MemoryReader.hpp +++ b/include/athena/MemoryReader.hpp @@ -4,9 +4,9 @@ #include #include #include -#include "Athena/IStreamReader.hpp" +#include "athena/IStreamReader.hpp" -namespace Athena +namespace athena { namespace io { @@ -123,14 +123,14 @@ protected: #ifndef MEMORYREADER_BASE #define MEMORYREADER_BASE() \ private: \ - typedef Athena::io::MemoryReader base + typedef athena::io::MemoryReader base #endif // MEMORYREADER_BASE #ifndef MEMORYCOPYREADER_BASE #define MEMORYCOPYREADER_BASE() \ private: \ - typedef Athena::io::MemoryCopyReader base + typedef athena::io::MemoryCopyReader base #endif // MEMORYCOPYREADER_BASE diff --git a/include/Athena/MemoryWriter.hpp b/include/athena/MemoryWriter.hpp similarity index 97% rename from include/Athena/MemoryWriter.hpp rename to include/athena/MemoryWriter.hpp index 836341c..ee757e2 100644 --- a/include/Athena/MemoryWriter.hpp +++ b/include/athena/MemoryWriter.hpp @@ -4,9 +4,9 @@ #include #include #include -#include "Athena/IStreamWriter.hpp" +#include "athena/IStreamWriter.hpp" -namespace Athena +namespace athena { namespace io { @@ -166,13 +166,13 @@ private: #ifndef MEMORYWRITER_BASE #define MEMORYWRITER_BASE() \ private: \ - typedef Athena::io::MemoryWriter base + typedef athena::io::MemoryWriter base #endif // BINARYWRITER_BASE #ifndef MEMORYCOPYWRITER_BASE #define MEMORYCOPYWRITER_BASE() \ private: \ - typedef Athena::io::MemoryCopyWriter base + typedef athena::io::MemoryCopyWriter base #endif // BINARYWRITER_BASE #endif // MEMORYWRITER_HPP diff --git a/include/Athena/PHYSFSFileReader.hpp b/include/athena/PHYSFSFileReader.hpp similarity index 92% rename from include/Athena/PHYSFSFileReader.hpp rename to include/athena/PHYSFSFileReader.hpp index 819fe87..4a139c2 100644 --- a/include/Athena/PHYSFSFileReader.hpp +++ b/include/athena/PHYSFSFileReader.hpp @@ -2,10 +2,10 @@ #ifndef PHYSFSSTREAM_HPP #define PHYSFSSTREAM_HPP -#include "Athena/Stream.hpp" +#include "athena/Stream.hpp" #include -namespace Athena +namespace athena { namespace io { @@ -55,7 +55,7 @@ private: #ifndef PHYSFSFILEREADER_BASE #define PHYSFSFILEREADER_BASE() \ - typedef Athena::io::PHYSFSFileReader base + typedef athena::io::PHYSFSFileReader base #endif #endif // PHYSFSSTREAM_HPP #endif // ATHENA_ENABLE_PHYSFS diff --git a/include/Athena/SakuraGlobal.hpp b/include/athena/SakuraGlobal.hpp similarity index 89% rename from include/Athena/SakuraGlobal.hpp rename to include/athena/SakuraGlobal.hpp index 51a7a76..afe440a 100644 --- a/include/Athena/SakuraGlobal.hpp +++ b/include/athena/SakuraGlobal.hpp @@ -1,9 +1,9 @@ #ifndef SAKURAGLOBAL_HPP #define SAKURAGLOBAL_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { namespace Sakura { diff --git a/include/Athena/SkywardSwordFile.hpp b/include/athena/SkywardSwordFile.hpp similarity index 94% rename from include/Athena/SkywardSwordFile.hpp rename to include/athena/SkywardSwordFile.hpp index 93a1a15..b04fc1e 100644 --- a/include/Athena/SkywardSwordFile.hpp +++ b/include/athena/SkywardSwordFile.hpp @@ -1,12 +1,12 @@ #ifndef SSFILE_HPP #define SSFILE_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" // standard lib #include -namespace Athena +namespace athena { class SkywardSwordQuest; diff --git a/include/Athena/SkywardSwordFileReader.hpp b/include/athena/SkywardSwordFileReader.hpp similarity index 88% rename from include/Athena/SkywardSwordFileReader.hpp rename to include/athena/SkywardSwordFileReader.hpp index 8290f39..1b46f5c 100644 --- a/include/Athena/SkywardSwordFileReader.hpp +++ b/include/athena/SkywardSwordFileReader.hpp @@ -1,9 +1,9 @@ #ifndef SSFILEREADER_HPP #define SSFILEREADER_HPP -#include "Athena/MemoryReader.hpp" +#include "athena/MemoryReader.hpp" -namespace Athena +namespace athena { class SkywardSwordFile; namespace io diff --git a/include/Athena/SkywardSwordFileWriter.hpp b/include/athena/SkywardSwordFileWriter.hpp similarity index 87% rename from include/Athena/SkywardSwordFileWriter.hpp rename to include/athena/SkywardSwordFileWriter.hpp index 5af7f0c..77c2ac8 100644 --- a/include/Athena/SkywardSwordFileWriter.hpp +++ b/include/athena/SkywardSwordFileWriter.hpp @@ -1,9 +1,9 @@ #ifndef SSFILEWRITER_HPP #define SSFILEWRITER_HPP -#include "Athena/MemoryWriter.hpp" +#include "athena/MemoryWriter.hpp" -namespace Athena +namespace athena { class SkywardSwordFile; diff --git a/include/Athena/SkywardSwordQuest.hpp b/include/athena/SkywardSwordQuest.hpp similarity index 93% rename from include/Athena/SkywardSwordQuest.hpp rename to include/athena/SkywardSwordQuest.hpp index fb22434..c415834 100644 --- a/include/Athena/SkywardSwordQuest.hpp +++ b/include/athena/SkywardSwordQuest.hpp @@ -1,10 +1,10 @@ #ifndef SKYWARDSWORDQUEST_HPP #define SKYWARDSWORDQUEST_HPP -#include "Athena/Global.hpp" -#include "Athena/ZQuestFile.hpp" +#include "athena/Global.hpp" +#include "athena/ZQuestFile.hpp" -namespace Athena +namespace athena { // TODO: Handle game specific data diff --git a/include/Athena/Sprite.hpp b/include/athena/Sprite.hpp similarity index 96% rename from include/Athena/Sprite.hpp rename to include/athena/Sprite.hpp index fefa07f..a9e9d57 100644 --- a/include/Athena/Sprite.hpp +++ b/include/athena/Sprite.hpp @@ -10,9 +10,9 @@ #include #include #endif -#include "Athena/SakuraGlobal.hpp" +#include "athena/SakuraGlobal.hpp" -namespace Athena +namespace athena { namespace Sakura { @@ -124,7 +124,7 @@ private: #ifdef ATHENA_USE_QT Q_DECLARE_METATYPE(Uint32) -Q_DECLARE_METATYPE(Athena::Sakura::Sprite*) +Q_DECLARE_METATYPE(athena::Sakura::Sprite*) #endif #endif // SSPRITE_HPP diff --git a/include/Athena/SpriteFile.hpp b/include/athena/SpriteFile.hpp similarity index 96% rename from include/Athena/SpriteFile.hpp rename to include/athena/SpriteFile.hpp index 84f9308..b383152 100644 --- a/include/Athena/SpriteFile.hpp +++ b/include/athena/SpriteFile.hpp @@ -13,9 +13,9 @@ #endif #include -#include "Athena/SakuraGlobal.hpp" +#include "athena/SakuraGlobal.hpp" -namespace Athena +namespace athena { namespace Sakura { @@ -259,7 +259,7 @@ private: } // Zelda #ifdef ATHENA_USE_QT -Q_DECLARE_METATYPE(Athena::Sakura::SpriteFile*) -Q_DECLARE_METATYPE(Athena::Sakura::STexture*) +Q_DECLARE_METATYPE(athena::Sakura::SpriteFile*) +Q_DECLARE_METATYPE(athena::Sakura::STexture*) #endif #endif // SSPRITE_HPP diff --git a/include/Athena/SpriteFileReader.hpp b/include/athena/SpriteFileReader.hpp similarity index 88% rename from include/Athena/SpriteFileReader.hpp rename to include/athena/SpriteFileReader.hpp index 7b2e6fd..071b462 100644 --- a/include/Athena/SpriteFileReader.hpp +++ b/include/athena/SpriteFileReader.hpp @@ -1,9 +1,9 @@ #ifndef SSPRITEFILEREADER_HPP #define SSPRITEFILEREADER_HPP -#include "Athena/MemoryReader.hpp" +#include "athena/MemoryReader.hpp" -namespace Athena +namespace athena { namespace Sakura { diff --git a/include/Athena/SpriteFileWriter.hpp b/include/athena/SpriteFileWriter.hpp similarity index 89% rename from include/Athena/SpriteFileWriter.hpp rename to include/athena/SpriteFileWriter.hpp index eb138d7..9f174bd 100644 --- a/include/Athena/SpriteFileWriter.hpp +++ b/include/athena/SpriteFileWriter.hpp @@ -1,9 +1,9 @@ #ifndef SSPRITEFILEWRITER_HPP #define SSPRITEFILEWRITER_HPP -#include "Athena/MemoryWriter.hpp" +#include "athena/MemoryWriter.hpp" -namespace Athena +namespace athena { namespace Sakura { diff --git a/include/Athena/SpriteFrame.hpp b/include/athena/SpriteFrame.hpp similarity index 92% rename from include/Athena/SpriteFrame.hpp rename to include/athena/SpriteFrame.hpp index 7e46cac..965741e 100644 --- a/include/Athena/SpriteFrame.hpp +++ b/include/athena/SpriteFrame.hpp @@ -2,7 +2,7 @@ #define SSPRITEFRAME_HPP -#include "Athena/SakuraGlobal.hpp" +#include "athena/SakuraGlobal.hpp" #ifndef ATHENA_USE_QT #include @@ -11,7 +11,7 @@ #include #endif -namespace Athena +namespace athena { namespace Sakura { @@ -78,7 +78,7 @@ private: } // zelda #ifdef ATHENA_USE_QT -Q_DECLARE_METATYPE(Athena::Sakura::SpriteFrame*); +Q_DECLARE_METATYPE(athena::Sakura::SpriteFrame*); #endif #endif // SSPRITEFRAME_HPP diff --git a/include/Athena/SpritePart.hpp b/include/athena/SpritePart.hpp similarity index 97% rename from include/Athena/SpritePart.hpp rename to include/athena/SpritePart.hpp index 02af17d..0b84d54 100644 --- a/include/Athena/SpritePart.hpp +++ b/include/athena/SpritePart.hpp @@ -1,7 +1,7 @@ #ifndef SSPRITEPART_HPP #define SSPRITEPART_HPP -#include "Athena/SakuraGlobal.hpp" +#include "athena/SakuraGlobal.hpp" #ifndef ATHENA_USE_QT # include #else @@ -13,7 +13,7 @@ #include -namespace Athena +namespace athena { namespace Sakura { @@ -194,7 +194,7 @@ private: } } #ifdef ATHENA_USE_QT -Q_DECLARE_METATYPE(Athena::Sakura::SpritePart*) +Q_DECLARE_METATYPE(athena::Sakura::SpritePart*) #endif #endif // SSPRITEPART_HPP diff --git a/include/Athena/Types.hpp b/include/athena/Types.hpp similarity index 100% rename from include/Athena/Types.hpp rename to include/athena/Types.hpp diff --git a/include/Athena/Utility.hpp b/include/athena/Utility.hpp similarity index 81% rename from include/Athena/Utility.hpp rename to include/athena/Utility.hpp index 9702b87..6c3e0f5 100644 --- a/include/Athena/Utility.hpp +++ b/include/athena/Utility.hpp @@ -5,10 +5,10 @@ #include #include #include -#include "Athena/Global.hpp" -#include "Athena/Types.hpp" +#include "athena/Global.hpp" +#include "athena/Types.hpp" -namespace Athena +namespace athena { namespace utility { @@ -69,8 +69,8 @@ inline double swapDouble(double val) } inline atInt16 LittleInt16(atInt16& val) { - if (Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap16(val); + if (athena::utility::isSystemBigEndian()) + val = athena::utility::swap16(val); return val; } @@ -84,8 +84,8 @@ inline atUint16 LittleUint16(atUint16& val) } inline atInt16 BigInt16(atInt16& val) { - if (!Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap16(val); + if (!athena::utility::isSystemBigEndian()) + val = athena::utility::swap16(val); return val; } @@ -99,8 +99,8 @@ inline atUint16 BigUint16(atUint16& val) } inline atInt32 LittleInt32(atInt32& val) { - if (Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap32(val); + if (athena::utility::isSystemBigEndian()) + val = athena::utility::swap32(val); return val; } @@ -114,8 +114,8 @@ inline atUint32 LittleUint32(atUint32& val) } inline atInt32 BigInt32(atInt32& val) { - if (!Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap32(val); + if (!athena::utility::isSystemBigEndian()) + val = athena::utility::swap32(val); return val; } @@ -129,8 +129,8 @@ inline atUint32 BigUint32(atUint32& val) } inline atInt64 LittleInt64(atInt64& val) { - if (Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap64(val); + if (athena::utility::isSystemBigEndian()) + val = athena::utility::swap64(val); return val; } @@ -144,8 +144,8 @@ inline atUint64 LittleUint64(atUint64& val) } inline atInt64 BigInt64(atInt64& val) { - if (!Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap64(val); + if (!athena::utility::isSystemBigEndian()) + val = athena::utility::swap64(val); return val; } @@ -160,29 +160,29 @@ inline atUint64 BigUint64(atUint64& val) inline float LittleFloat(float& val) { - if (Athena::utility::isSystemBigEndian()) - val = Athena::utility::swapFloat(val); + if (athena::utility::isSystemBigEndian()) + val = athena::utility::swapFloat(val); return val; } inline float BigFloat(float& val) { - if (!Athena::utility::isSystemBigEndian()) - val = Athena::utility::swapFloat(val); + if (!athena::utility::isSystemBigEndian()) + val = athena::utility::swapFloat(val); return val; } inline double LittleDouble(double& val) { - if (Athena::utility::isSystemBigEndian()) - val = Athena::utility::swapDouble(val); + if (athena::utility::isSystemBigEndian()) + val = athena::utility::swapDouble(val); return val; } inline double BigDouble(double& val) { - if (!Athena::utility::isSystemBigEndian()) - val = Athena::utility::swapDouble(val); + if (!athena::utility::isSystemBigEndian()) + val = athena::utility::swapDouble(val); return val; } diff --git a/include/Athena/WiiBanner.hpp b/include/athena/WiiBanner.hpp similarity index 93% rename from include/Athena/WiiBanner.hpp rename to include/athena/WiiBanner.hpp index f96694f..bb58882 100644 --- a/include/Athena/WiiBanner.hpp +++ b/include/athena/WiiBanner.hpp @@ -3,9 +3,9 @@ #include #include -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { class WiiImage; /*! \class WiiBanner diff --git a/include/Athena/WiiFile.hpp b/include/athena/WiiFile.hpp similarity index 94% rename from include/Athena/WiiFile.hpp rename to include/athena/WiiFile.hpp index 84612fa..bfaba32 100644 --- a/include/Athena/WiiFile.hpp +++ b/include/athena/WiiFile.hpp @@ -3,9 +3,9 @@ #include #include -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { const atUint8 SD_KEY [16] = {0xab, 0x01, 0xb9, 0xd8, 0xe1, 0x62, 0x2b, 0x08, 0xaf, 0xba, 0xd8, 0x4d, 0xbf, 0xc2, 0xa5, 0x5d}; diff --git a/include/Athena/WiiImage.hpp b/include/athena/WiiImage.hpp similarity index 96% rename from include/Athena/WiiImage.hpp rename to include/athena/WiiImage.hpp index 4343787..434296d 100644 --- a/include/Athena/WiiImage.hpp +++ b/include/athena/WiiImage.hpp @@ -2,9 +2,9 @@ #define WIIIMAGE_HPP #include -#include "Athena/Types.hpp" +#include "athena/Types.hpp" -namespace Athena +namespace athena { /*! diff --git a/include/Athena/WiiSave.hpp b/include/athena/WiiSave.hpp similarity index 90% rename from include/Athena/WiiSave.hpp rename to include/athena/WiiSave.hpp index e86d6e0..a6dfcf2 100644 --- a/include/Athena/WiiSave.hpp +++ b/include/athena/WiiSave.hpp @@ -3,9 +3,9 @@ #include #include -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { class WiiFile; diff --git a/include/Athena/WiiSaveReader.hpp b/include/athena/WiiSaveReader.hpp similarity index 93% rename from include/Athena/WiiSaveReader.hpp rename to include/athena/WiiSaveReader.hpp index b6cbb7a..f68685d 100644 --- a/include/Athena/WiiSaveReader.hpp +++ b/include/athena/WiiSaveReader.hpp @@ -1,10 +1,10 @@ #ifndef WIISAVEREADER_HPP #define WIISAVEREADER_HPP -#include "Athena/Global.hpp" -#include "Athena/MemoryReader.hpp" +#include "athena/Global.hpp" +#include "athena/MemoryReader.hpp" -namespace Athena +namespace athena { class WiiSave; class WiiBanner; diff --git a/include/Athena/WiiSaveWriter.hpp b/include/athena/WiiSaveWriter.hpp similarity index 96% rename from include/Athena/WiiSaveWriter.hpp rename to include/athena/WiiSaveWriter.hpp index 0621400..db4e43d 100644 --- a/include/Athena/WiiSaveWriter.hpp +++ b/include/athena/WiiSaveWriter.hpp @@ -1,9 +1,9 @@ #ifndef WIISAVEWRITER_HPP #define WIISAVEWRITER_HPP -#include "Athena/MemoryWriter.hpp" +#include "athena/MemoryWriter.hpp" -namespace Athena +namespace athena { class WiiSave; class WiiBanner; diff --git a/include/Athena/ZQuestFile.hpp b/include/athena/ZQuestFile.hpp similarity index 98% rename from include/Athena/ZQuestFile.hpp rename to include/athena/ZQuestFile.hpp index d9a27a1..8c87fdb 100644 --- a/include/Athena/ZQuestFile.hpp +++ b/include/athena/ZQuestFile.hpp @@ -18,7 +18,7 @@ #define ZQUEST_HPP -#include "Athena/Global.hpp" +#include "athena/Global.hpp" #include #include #include @@ -26,7 +26,7 @@ #define ZQUEST_VERSION_CHECK(major, minor, revision) \ (major | (minor << 8) | (revision << 16)) -namespace Athena +namespace athena { /*! * \brief ZQuestFile is an export format for save data. diff --git a/include/Athena/ZQuestFileReader.hpp b/include/athena/ZQuestFileReader.hpp similarity index 96% rename from include/Athena/ZQuestFileReader.hpp rename to include/athena/ZQuestFileReader.hpp index e6bf11e..273d6fd 100644 --- a/include/Athena/ZQuestFileReader.hpp +++ b/include/athena/ZQuestFileReader.hpp @@ -17,9 +17,9 @@ #ifndef __ZQUESTFILEREADER_HPP__ #define __ZQUESTFILEREADER_HPP__ -#include "Athena/MemoryReader.hpp" +#include "athena/MemoryReader.hpp" -namespace Athena +namespace athena { class ZQuestFile; diff --git a/include/Athena/ZQuestFileWriter.hpp b/include/athena/ZQuestFileWriter.hpp similarity index 96% rename from include/Athena/ZQuestFileWriter.hpp rename to include/athena/ZQuestFileWriter.hpp index 7d7b9fe..e33a424 100644 --- a/include/Athena/ZQuestFileWriter.hpp +++ b/include/athena/ZQuestFileWriter.hpp @@ -17,9 +17,9 @@ #ifndef __ZQUESTFILEWRITER_HPP__ #define __ZQUESTFILEWRITER_HPP__ -#include "Athena/MemoryWriter.hpp" +#include "athena/MemoryWriter.hpp" -namespace Athena +namespace athena { class ZQuestFile; diff --git a/include/bn.h b/include/bn.h index a5140d9..a93a2a5 100644 --- a/include/bn.h +++ b/include/bn.h @@ -3,7 +3,7 @@ #ifndef __DOXYGEN_IGNORE__ -#include "Athena/Types.hpp" +#include "athena/Types.hpp" int bn_compare(atUint8* a, atUint8* b, atUint32 n); void bn_sub_modulus(atUint8* a, atUint8* N, atUint32 n); void bn_add(atUint8* d, atUint8* a, atUint8* b, atUint8* N, atUint32 n); diff --git a/include/ec.h b/include/ec.h index 19d4d2f..e37cc4f 100644 --- a/include/ec.h +++ b/include/ec.h @@ -1,6 +1,6 @@ #ifndef EC_H #define EC_H -#include "Athena/Types.hpp" +#include "athena/Types.hpp" bool check_ec(atUint8* ng, atUint8* ap, atUint8* sig, atUint8* sig_hash); void make_ec_cert(atUint8* cert, atUint8* sig, char* signer, char* name, atUint8* priv, atUint32 key_id); diff --git a/include/sha1.h b/include/sha1.h index 480c317..eb9e360 100644 --- a/include/sha1.h +++ b/include/sha1.h @@ -1,7 +1,7 @@ #ifndef _SHA1_H_ #define _SHA1_H_ -#include "Athena/Types.hpp" +#include "athena/Types.hpp" #ifndef __DOXYGEN_IGNORE__ #ifdef __cplusplus diff --git a/src/LZ77/LZType10.cpp b/src/LZ77/LZType10.cpp index 8b2d694..3f2c70d 100644 --- a/src/LZ77/LZType10.cpp +++ b/src/LZ77/LZType10.cpp @@ -1,6 +1,6 @@ #include "LZ77/LZLookupTable.hpp" #include "LZ77/LZType10.hpp" -#include +#include #include LZType10::LZType10(atInt32 MinimumOffset, atInt32 SlidingWindow, atInt32 MinimumMatch, atInt32 BlockSize) @@ -14,9 +14,9 @@ LZType10::LZType10(atInt32 MinimumOffset, atInt32 SlidingWindow, atInt32 Minimum atUint32 LZType10::compress(const atUint8* src, atUint8** dstBuf, atUint32 srcLength) { atUint32 encodeSize = (srcLength << 8) | (0x10); - encodeSize = Athena::utility::LittleUint32(encodeSize); //File size needs to be written as little endian always + encodeSize = athena::utility::LittleUint32(encodeSize); //File size needs to be written as little endian always - Athena::io::MemoryCopyWriter outbuf("tmp"); + athena::io::MemoryCopyWriter outbuf("tmp"); outbuf.writeUint32(encodeSize); atUint8* ptrStart = (atUint8*)src; @@ -42,7 +42,7 @@ atUint32 LZType10::compress(const atUint8* src, atUint8** dstBuf, atUint32 srcLe { //Gotta swap the bytes since system is wii is big endian and most computers are little endian atUint16 lenOff = (((searchResult.length - m_minMatch) & 0xF) << 12) | ((searchResult.offset - 1) & 0xFFF); - Athena::utility::BigUint16(lenOff); + athena::utility::BigUint16(lenOff); memcpy(ptrBytes, &lenOff, sizeof(atUint16)); @@ -81,7 +81,7 @@ atUint32 LZType10::decompress(const atUint8* src, atUint8** dst, atUint32 srcLen return 0; atUint32 uncompressedSize = *(atUint32*)(src); //Size of data when it is uncompressed - Athena::utility::LittleUint32(uncompressedSize); //The compressed file has the filesize encoded in little endian + athena::utility::LittleUint32(uncompressedSize); //The compressed file has the filesize encoded in little endian uncompressedSize = uncompressedSize >> 8;//first byte is the encode flag atUint8* uncompressedData = new atUint8[uncompressedSize]; @@ -104,7 +104,7 @@ atUint32 LZType10::decompress(const atUint8* src, atUint8** dst, atUint32 srcLen { atUint16 lenOff; memcpy(&lenOff, inputPtr, sizeof(atUint16)); - Athena::utility::BigUint16(lenOff); + athena::utility::BigUint16(lenOff); inputPtr += sizeof(atUint16); //Move forward two bytes //length offset pair has been decoded. LZLengthOffset decoding; diff --git a/src/LZ77/LZType11.cpp b/src/LZ77/LZType11.cpp index 0c7a9e0..6223d05 100644 --- a/src/LZ77/LZType11.cpp +++ b/src/LZ77/LZType11.cpp @@ -1,6 +1,6 @@ #include "LZ77/LZLookupTable.hpp" #include "LZ77/LZType11.hpp" -#include +#include #include @@ -13,13 +13,13 @@ LZType11::LZType11(atInt32 minimumOffset, atInt32 slidingWindow, atInt32 minimum atUint32 LZType11::compress(const atUint8* src, atUint8** dst, atUint32 srcLength) { - Athena::io::MemoryCopyWriter outbuff("tmp"); + athena::io::MemoryCopyWriter outbuff("tmp"); if (srcLength > 0xFFFFFF) // If length is greater than 24 bits or 16 Megs { atUint32 encodeFlag = 0x11; - Athena::utility::LittleUint32(encodeFlag); - Athena::utility::LittleUint32(srcLength);//Filesize data is little endian + athena::utility::LittleUint32(encodeFlag); + athena::utility::LittleUint32(srcLength);//Filesize data is little endian outbuff.writeUint32(encodeFlag); outbuff.writeUint32(srcLength); @@ -27,7 +27,7 @@ atUint32 LZType11::compress(const atUint8* src, atUint8** dst, atUint32 srcLengt else { atUint32 encodeSize = (srcLength << 8) | (0x11); - Athena::utility::LittleUint32(encodeSize); + athena::utility::LittleUint32(encodeSize); outbuff.writeUint32(encodeSize); } @@ -79,7 +79,7 @@ atUint32 LZType11::compress(const atUint8* src, atUint8** dst, atUint32 srcLengt atUint16 lenOff = ((((searchResult.length - 1) & 0xF) << 12) | //Bits 15-12 ((searchResult.offset - 1) & 0xFFF) //Bits 11-0 ); - Athena::utility::BigUint16(lenOff); + athena::utility::BigUint16(lenOff); memcpy(ptrBytes, &lenOff, 2); ptrBytes += 2; } @@ -88,7 +88,7 @@ atUint32 LZType11::compress(const atUint8* src, atUint8** dst, atUint32 srcLengt atUint32 lenOff = ((((searchResult.length - minThreeByteMatch) & 0xFF) << 12) | //Bits 20-12 ((searchResult.offset - 1) & 0xFFF) //Bits 11-0 ); - Athena::utility::BigUint32(lenOff); + athena::utility::BigUint32(lenOff); memcpy(ptrBytes, (atUint8*)&lenOff + 1, 3); //Make sure to copy the lower 24 bits. 0x12345678- This statement copies 0x123456 ptrBytes += 3; } @@ -98,7 +98,7 @@ atUint32 LZType11::compress(const atUint8* src, atUint8** dst, atUint32 srcLengt (((searchResult.length - minFourByteMatch) & 0xFFFF) << 12) | //Bits 28-12 ((searchResult.offset - 1) & 0xFFF) //Bits 11-0 ); - Athena::utility::BigUint32(lenOff); + athena::utility::BigUint32(lenOff); memcpy(ptrBytes, &lenOff, 4); ptrBytes += 4; } @@ -136,14 +136,14 @@ atUint32 LZType11::decompress(const atUint8* src, atUint8** dst, atUint32 srcLen return 0; atUint32 uncompressedLen = *(atUint32*)(src); - Athena::utility::LittleUint32(uncompressedLen);//The compressed file has the filesize encoded in little endian + athena::utility::LittleUint32(uncompressedLen);//The compressed file has the filesize encoded in little endian uncompressedLen = uncompressedLen >> 8; //First byte is the encode flag atUint32 currentOffset = 4; if (uncompressedLen == 0) //If the filesize var is zero then the true filesize is over 14MB and must be read in from the next 4 bytes { atUint32 filesize = *(atUint32*)(src + 4); - filesize = Athena::utility::LittleUint32(filesize); + filesize = athena::utility::LittleUint32(filesize); currentOffset += 4; } @@ -178,7 +178,7 @@ atUint32 LZType11::decompress(const atUint8* src, atUint8** dst, atUint32 srcLen atUint16 lenOff = 0; memcpy(&lenOff, inputPtr, 2); inputPtr += 2; - Athena::utility::BigUint16(lenOff); + athena::utility::BigUint16(lenOff); decoding.length = (lenOff >> 12) + 1; decoding.offset = (lenOff & 0xFFF) + 1; } @@ -187,7 +187,7 @@ atUint32 LZType11::decompress(const atUint8* src, atUint8** dst, atUint32 srcLen atUint32 lenOff = 0; memcpy((atUint8*)&lenOff + 1, inputPtr, 3); inputPtr += 3; - Athena::utility::BigUint32(lenOff); + athena::utility::BigUint32(lenOff); decoding.length = (lenOff >> 12) + threeByteDenorm; decoding.offset = (lenOff & 0xFFF) + 1; } @@ -196,7 +196,7 @@ atUint32 LZType11::decompress(const atUint8* src, atUint8** dst, atUint32 srcLen atUint32 lenOff = 0; memcpy(&lenOff, inputPtr, 4); inputPtr += 4; - Athena::utility::BigUint32(lenOff); + athena::utility::BigUint32(lenOff); decoding.length = ((lenOff >> 12) & 0xFFFF) + fourByteDenorm; //Gets rid of the Four byte flag decoding.offset = (lenOff & 0xFFF) + 1; diff --git a/src/aes.cpp b/src/aes.cpp index 470d723..119e7fe 100644 --- a/src/aes.cpp +++ b/src/aes.cpp @@ -7,7 +7,7 @@ #include #endif -namespace Athena +namespace athena { /* rotates x one bit to the left */ diff --git a/src/Athena/ALTTPFile.cpp b/src/athena/ALTTPFile.cpp similarity index 84% rename from src/Athena/ALTTPFile.cpp rename to src/athena/ALTTPFile.cpp index ea15555..3893ec2 100644 --- a/src/Athena/ALTTPFile.cpp +++ b/src/athena/ALTTPFile.cpp @@ -1,7 +1,7 @@ -#include "Athena/ALTTPFile.hpp" -#include "Athena/ALTTPQuest.hpp" +#include "athena/ALTTPFile.hpp" +#include "athena/ALTTPQuest.hpp" -namespace Athena +namespace athena { ALTTPFile::ALTTPFile() {} diff --git a/src/Athena/ALTTPFileReader.cpp b/src/athena/ALTTPFileReader.cpp similarity index 95% rename from src/Athena/ALTTPFileReader.cpp rename to src/athena/ALTTPFileReader.cpp index 50cee9f..8d4068a 100644 --- a/src/Athena/ALTTPFileReader.cpp +++ b/src/athena/ALTTPFileReader.cpp @@ -1,10 +1,10 @@ -#include "Athena/ALTTPFileReader.hpp" -#include "Athena/ALTTPFile.hpp" -#include "Athena/ALTTPQuest.hpp" +#include "athena/ALTTPFileReader.hpp" +#include "athena/ALTTPFile.hpp" +#include "athena/ALTTPQuest.hpp" #include -#include "Athena/Global.hpp" +#include "athena/Global.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/ALTTPFileWriter.cpp b/src/athena/ALTTPFileWriter.cpp similarity index 95% rename from src/Athena/ALTTPFileWriter.cpp rename to src/athena/ALTTPFileWriter.cpp index 42c8d50..a555e35 100644 --- a/src/Athena/ALTTPFileWriter.cpp +++ b/src/athena/ALTTPFileWriter.cpp @@ -1,9 +1,9 @@ -#include "Athena/ALTTPFileWriter.hpp" -#include "Athena/ALTTPFile.hpp" -#include "Athena/ALTTPQuest.hpp" +#include "athena/ALTTPFileWriter.hpp" +#include "athena/ALTTPFile.hpp" +#include "athena/ALTTPQuest.hpp" #include -namespace Athena +namespace athena { namespace io diff --git a/src/Athena/ALTTPQuest.cpp b/src/athena/ALTTPQuest.cpp similarity index 94% rename from src/Athena/ALTTPQuest.cpp rename to src/athena/ALTTPQuest.cpp index b45f3ba..3301403 100644 --- a/src/Athena/ALTTPQuest.cpp +++ b/src/athena/ALTTPQuest.cpp @@ -1,7 +1,7 @@ -#include "Athena/ALTTPQuest.hpp" +#include "athena/ALTTPQuest.hpp" #include -namespace Athena +namespace athena { ALTTPQuest::ALTTPQuest() diff --git a/src/Athena/Checksums.cpp b/src/athena/Checksums.cpp similarity index 99% rename from src/Athena/Checksums.cpp rename to src/athena/Checksums.cpp index f725888..eea6c75 100644 --- a/src/Athena/Checksums.cpp +++ b/src/athena/Checksums.cpp @@ -1,9 +1,9 @@ -#include "Athena/Checksums.hpp" -#include "Athena/FileReader.hpp" +#include "athena/Checksums.hpp" +#include "athena/FileReader.hpp" #include #include -namespace Athena +namespace athena { namespace Checksums { diff --git a/src/Athena/Compression.cpp b/src/athena/Compression.cpp similarity index 99% rename from src/Athena/Compression.cpp rename to src/athena/Compression.cpp index 433841a..55b4e99 100644 --- a/src/Athena/Compression.cpp +++ b/src/athena/Compression.cpp @@ -1,11 +1,11 @@ -#include "Athena/Compression.hpp" +#include "athena/Compression.hpp" #include #include #include #include "LZ77/LZType10.hpp" #include "LZ77/LZType11.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/DNAYaml.cpp b/src/athena/DNAYaml.cpp similarity index 99% rename from src/Athena/DNAYaml.cpp rename to src/athena/DNAYaml.cpp index d590889..c2bacf8 100644 --- a/src/Athena/DNAYaml.cpp +++ b/src/athena/DNAYaml.cpp @@ -1,6 +1,6 @@ -#include "Athena/DNAYaml.hpp" +#include "athena/DNAYaml.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/Dir.cpp b/src/athena/Dir.cpp similarity index 97% rename from src/Athena/Dir.cpp rename to src/athena/Dir.cpp index e9a77f1..4d11d0d 100644 --- a/src/Athena/Dir.cpp +++ b/src/athena/Dir.cpp @@ -1,4 +1,4 @@ -#include "Athena/Dir.hpp" +#include "athena/Dir.hpp" #include #include #include @@ -18,7 +18,7 @@ #define realpath(__name, __resolved) _fullpath((__name), (__resolved), 4096) #endif -namespace Athena +namespace athena { Dir::Dir(const std::string &path) : m_path(path) diff --git a/src/Athena/FileInfo.cpp b/src/athena/FileInfo.cpp similarity index 93% rename from src/Athena/FileInfo.cpp rename to src/athena/FileInfo.cpp index eefe124..a7af385 100644 --- a/src/Athena/FileInfo.cpp +++ b/src/athena/FileInfo.cpp @@ -1,7 +1,7 @@ -#include "Athena/FileInfo.hpp" -#include "Athena/Utility.hpp" -#include "Athena/FileWriter.hpp" -#include "Athena/FileReader.hpp" +#include "athena/FileInfo.hpp" +#include "athena/Utility.hpp" +#include "athena/FileWriter.hpp" +#include "athena/FileReader.hpp" #include #include #include @@ -30,7 +30,7 @@ #define realpath(__name, __resolved) _fullpath((__resolved), (__name), 4096) #endif -namespace Athena +namespace athena { FileInfo::FileInfo(const std::string& path) @@ -117,7 +117,7 @@ bool FileInfo::touch() const #if defined(__GNUC__) && !(defined(HW_DOL) || defined(HW_RVL) || defined(GEKKO)) stat64_t st; if (stat64(m_path.c_str(), &st) < 0) { - (void)Athena::io::FileWriter(m_path); + (void)athena::io::FileWriter(m_path); return true; } if (utimes(m_path.c_str(), NULL) < 0) { @@ -173,13 +173,13 @@ bool FileInfo::touch() const // Generic portable version, not extremely reliable but does work atUint64 val = 0xCDCDCDCDCD; { - Athena::io::FileReader reader(m_path.c_str()); + athena::io::FileReader reader(m_path.c_str()); if (reader.isOpen()) val = reader.readUint64(); } { - Athena::io::FileWriter writer(m_path, false); + athena::io::FileWriter writer(m_path, false); if (val != 0xCDCDCDCDCD && writer.isOpen()) writer.writeUint64(val); else if (!writer.isOpen()) diff --git a/src/Athena/FileReader.cpp b/src/athena/FileReader.cpp similarity index 98% rename from src/Athena/FileReader.cpp rename to src/athena/FileReader.cpp index b7313bc..c6459f4 100644 --- a/src/Athena/FileReader.cpp +++ b/src/athena/FileReader.cpp @@ -1,4 +1,4 @@ -#include "Athena/FileReader.hpp" +#include "athena/FileReader.hpp" #if _WIN32 #include "win32_largefilewrapper.h" @@ -9,7 +9,7 @@ #include "osx_largefilewrapper.h" #endif -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/FileWriter.cpp b/src/athena/FileWriter.cpp similarity index 98% rename from src/Athena/FileWriter.cpp rename to src/athena/FileWriter.cpp index caace1f..02857af 100644 --- a/src/Athena/FileWriter.cpp +++ b/src/athena/FileWriter.cpp @@ -1,4 +1,4 @@ -#include "Athena/FileWriter.hpp" +#include "athena/FileWriter.hpp" #if _WIN32 #include "win32_largefilewrapper.h" @@ -9,7 +9,7 @@ #include "osx_largefilewrapper.h" #endif -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/Global.cpp b/src/athena/Global.cpp similarity index 67% rename from src/Athena/Global.cpp rename to src/athena/Global.cpp index 8699423..6626b86 100644 --- a/src/Athena/Global.cpp +++ b/src/athena/Global.cpp @@ -1,21 +1,21 @@ -#include "Athena/Global.hpp" +#include "athena/Global.hpp" #include #include #include -std::ostream& operator<<(std::ostream& os, const Athena::SeekOrigin& origin) +std::ostream& operator<<(std::ostream& os, const athena::SeekOrigin& origin) { switch (origin) { - case Athena::SeekOrigin::Begin: + case athena::SeekOrigin::Begin: os << "Begin"; break; - case Athena::SeekOrigin::Current: + case athena::SeekOrigin::Current: os << "Current"; break; - case Athena::SeekOrigin::End: + case athena::SeekOrigin::End: os << "End"; break; } @@ -24,15 +24,15 @@ std::ostream& operator<<(std::ostream& os, const Athena::SeekOrigin& origin) } -std::ostream& operator<<(std::ostream& os, const Athena::Endian& endian) +std::ostream& operator<<(std::ostream& os, const athena::Endian& endian) { switch (endian) { - case Athena::Endian::LittleEndian: + case athena::Endian::LittleEndian: os << "LittleEndian"; break; - case Athena::Endian::BigEndian: + case athena::Endian::BigEndian: os << "BigEndian"; break; } @@ -41,18 +41,18 @@ std::ostream& operator<<(std::ostream& os, const Athena::Endian& endian) } -static void __defaultExceptionHandler(Athena::error::Level level, const char* file, const char* function, int line, const char* fmt, ...) +static void __defaultExceptionHandler(athena::error::Level level, const char* file, const char* function, int line, const char* fmt, ...) { std::string levelStr; switch (level) { - case Athena::error::Level::Warning: + case athena::error::Level::Warning: levelStr = "[WARNING] "; break; - case Athena::error::Level::Error: + case athena::error::Level::Error: levelStr = "[ERROR ] "; break; - case Athena::error::Level::Fatal: + case athena::error::Level::Fatal: levelStr = "[FATAL ] "; break; default: break; @@ -60,7 +60,7 @@ static void __defaultExceptionHandler(Athena::error::Level level, const char* fi va_list vl; va_start(vl, fmt); - std::string msg = Athena::utility::vsprintf(fmt, vl); + std::string msg = athena::utility::vsprintf(fmt, vl); va_end(vl); std::cerr << levelStr << " " << file << " " << function << "(" << line << "): " << msg << std::endl; } diff --git a/src/Athena/MCFile.cpp b/src/athena/MCFile.cpp similarity index 95% rename from src/Athena/MCFile.cpp rename to src/athena/MCFile.cpp index 1ebf34e..71b6462 100644 --- a/src/Athena/MCFile.cpp +++ b/src/athena/MCFile.cpp @@ -1,6 +1,6 @@ -#include "Athena/MCFile.hpp" +#include "athena/MCFile.hpp" -namespace Athena +namespace athena { const char MCFile::VERSION_EU_JP[33] = "AGBZELDA:THE MINISH CAP:ZELDA 3\0"; diff --git a/src/Athena/MCFileReader.cpp b/src/athena/MCFileReader.cpp similarity index 85% rename from src/Athena/MCFileReader.cpp rename to src/athena/MCFileReader.cpp index df16207..43eb862 100644 --- a/src/Athena/MCFileReader.cpp +++ b/src/athena/MCFileReader.cpp @@ -1,6 +1,6 @@ -#include "Athena/MCFileReader.hpp" -#include "Athena/MCFile.hpp" -namespace Athena +#include "athena/MCFileReader.hpp" +#include "athena/MCFile.hpp" +namespace athena { namespace io diff --git a/src/Athena/MCFileWriter.cpp b/src/athena/MCFileWriter.cpp similarity index 95% rename from src/Athena/MCFileWriter.cpp rename to src/athena/MCFileWriter.cpp index 21c5474..968084f 100644 --- a/src/Athena/MCFileWriter.cpp +++ b/src/athena/MCFileWriter.cpp @@ -1,6 +1,6 @@ -#include "Athena/MCFileWriter.hpp" +#include "athena/MCFileWriter.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/MCSlot.cpp b/src/athena/MCSlot.cpp similarity index 78% rename from src/Athena/MCSlot.cpp rename to src/athena/MCSlot.cpp index 3db618c..e870f28 100644 --- a/src/Athena/MCSlot.cpp +++ b/src/athena/MCSlot.cpp @@ -1,6 +1,6 @@ -#include "Athena/MCSlot.hpp" +#include "athena/MCSlot.hpp" -namespace Athena +namespace athena { MCSlot::MCSlot(std::unique_ptr&& data, atUint32 length) diff --git a/src/Athena/MemoryReader.cpp b/src/athena/MemoryReader.cpp similarity index 97% rename from src/Athena/MemoryReader.cpp rename to src/athena/MemoryReader.cpp index 0ab3890..b8c34dd 100644 --- a/src/Athena/MemoryReader.cpp +++ b/src/athena/MemoryReader.cpp @@ -1,4 +1,4 @@ -#include "Athena/MemoryReader.hpp" +#include "athena/MemoryReader.hpp" #include #include @@ -10,7 +10,7 @@ #include #endif // HW_RVL -namespace Athena +namespace athena { namespace io { @@ -104,8 +104,8 @@ void MemoryReader::seek(atInt64 position, SeekOrigin origin) void MemoryReader::setData(const atUint8* data, atUint64 length, bool takeOwnership) { - if (m_owns && m_data) - delete[] m_data; + if (m_owns) + delete[] static_cast(m_data); m_data = (atUint8*)data; m_length = length; m_position = 0; diff --git a/src/Athena/MemoryWriter.cpp b/src/athena/MemoryWriter.cpp similarity index 99% rename from src/Athena/MemoryWriter.cpp rename to src/athena/MemoryWriter.cpp index 8fec07f..7b87502 100644 --- a/src/Athena/MemoryWriter.cpp +++ b/src/athena/MemoryWriter.cpp @@ -1,4 +1,4 @@ -#include "Athena/MemoryWriter.hpp" +#include "athena/MemoryWriter.hpp" #include #include @@ -9,7 +9,7 @@ #include #endif // HW_RVL -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/PHYSFSFileReader.cpp b/src/athena/PHYSFSFileReader.cpp similarity index 96% rename from src/Athena/PHYSFSFileReader.cpp rename to src/athena/PHYSFSFileReader.cpp index 2d6e58a..b39ab63 100644 --- a/src/Athena/PHYSFSFileReader.cpp +++ b/src/athena/PHYSFSFileReader.cpp @@ -1,9 +1,9 @@ #ifdef ATHENA_ENABLE_PHYSFS -#include "Athena/PHYSFSFileReader.hpp" -#include "Athena/FileNotFoundException.hpp" -#include "Athena/IOException.hpp" +#include "athena/PHYSFSFileReader.hpp" +#include "athena/FileNotFoundException.hpp" +#include "athena/IOException.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/SkywardSwordFile.cpp b/src/athena/SkywardSwordFile.cpp similarity index 83% rename from src/Athena/SkywardSwordFile.cpp rename to src/athena/SkywardSwordFile.cpp index 160808d..daa7c5b 100644 --- a/src/Athena/SkywardSwordFile.cpp +++ b/src/athena/SkywardSwordFile.cpp @@ -1,7 +1,7 @@ -#include "Athena/SkywardSwordFile.hpp" -#include "Athena/SkywardSwordQuest.hpp" +#include "athena/SkywardSwordFile.hpp" +#include "athena/SkywardSwordQuest.hpp" -namespace Athena +namespace athena { SkywardSwordFile::SkywardSwordFile() @@ -19,7 +19,7 @@ SkywardSwordFile::~SkywardSwordFile() { } -void SkywardSwordFile::addQuest(Athena::SkywardSwordQuest* q) +void SkywardSwordFile::addQuest(athena::SkywardSwordQuest* q) { // Do not allow more than 3 quests if (m_quests.size() >= 3) diff --git a/src/Athena/SkywardSwordFileReader.cpp b/src/athena/SkywardSwordFileReader.cpp similarity index 92% rename from src/Athena/SkywardSwordFileReader.cpp rename to src/athena/SkywardSwordFileReader.cpp index 26c527d..9a65489 100644 --- a/src/Athena/SkywardSwordFileReader.cpp +++ b/src/athena/SkywardSwordFileReader.cpp @@ -1,9 +1,9 @@ -#include "Athena/SkywardSwordFileReader.hpp" -#include "Athena/SkywardSwordFile.hpp" -#include "Athena/SkywardSwordQuest.hpp" +#include "athena/SkywardSwordFileReader.hpp" +#include "athena/SkywardSwordFile.hpp" +#include "athena/SkywardSwordQuest.hpp" #include -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/SkywardSwordFileWriter.cpp b/src/athena/SkywardSwordFileWriter.cpp similarity index 91% rename from src/Athena/SkywardSwordFileWriter.cpp rename to src/athena/SkywardSwordFileWriter.cpp index 1506147..9d5d869 100644 --- a/src/Athena/SkywardSwordFileWriter.cpp +++ b/src/athena/SkywardSwordFileWriter.cpp @@ -1,8 +1,8 @@ -#include "Athena/SkywardSwordFileWriter.hpp" -#include "Athena/SkywardSwordFile.hpp" -#include "Athena/SkywardSwordQuest.hpp" +#include "athena/SkywardSwordFileWriter.hpp" +#include "athena/SkywardSwordFile.hpp" +#include "athena/SkywardSwordQuest.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/SkywardSwordQuest.cpp b/src/athena/SkywardSwordQuest.cpp similarity index 98% rename from src/Athena/SkywardSwordQuest.cpp rename to src/athena/SkywardSwordQuest.cpp index 2a0d4a8..71267b3 100644 --- a/src/Athena/SkywardSwordQuest.cpp +++ b/src/athena/SkywardSwordQuest.cpp @@ -1,9 +1,9 @@ -#include "Athena/SkywardSwordQuest.hpp" -#include "Athena/Checksums.hpp" +#include "athena/SkywardSwordQuest.hpp" +#include "athena/Checksums.hpp" #include "utf8proc.h" #include -namespace Athena +namespace athena { namespace priv diff --git a/src/Athena/Sprite.cpp b/src/athena/Sprite.cpp similarity index 97% rename from src/Athena/Sprite.cpp rename to src/athena/Sprite.cpp index 203f51e..697aec2 100644 --- a/src/Athena/Sprite.cpp +++ b/src/athena/Sprite.cpp @@ -1,13 +1,13 @@ -#include "Athena/Sprite.hpp" -#include "Athena/SpriteFrame.hpp" -#include "Athena/SpriteFile.hpp" +#include "athena/Sprite.hpp" +#include "athena/SpriteFrame.hpp" +#include "athena/SpriteFile.hpp" #include #ifdef ATHENA_USE_QT #include #endif -namespace Athena +namespace athena { namespace Sakura { diff --git a/src/Athena/SpriteFile.cpp b/src/athena/SpriteFile.cpp similarity index 96% rename from src/Athena/SpriteFile.cpp rename to src/athena/SpriteFile.cpp index 42f48c7..5b0f59b 100644 --- a/src/Athena/SpriteFile.cpp +++ b/src/athena/SpriteFile.cpp @@ -1,9 +1,9 @@ -#include "Athena/SpriteFile.hpp" -#include "Athena/Sprite.hpp" -#include "Athena/Utility.hpp" +#include "athena/SpriteFile.hpp" +#include "athena/Sprite.hpp" +#include "athena/Utility.hpp" #include -namespace Athena +namespace athena { namespace Sakura { @@ -192,7 +192,7 @@ void SpriteFile::addSprite(Sprite* sprite) { #ifndef ATHENA_USE_QT std::string name(sprite->name()); - Athena::utility::tolower(name); + athena::utility::tolower(name); if (m_sprites.find(name) != m_sprites.end()) return; @@ -212,7 +212,7 @@ void SpriteFile::addSprite(Sprite* sprite) void SpriteFile::removeSprite(const std::string& name) { std::string tmpName(name); - Athena::utility::tolower(tmpName); + athena::utility::tolower(tmpName); std::unordered_map::iterator iterator = m_sprites.find(tmpName); if (iterator != m_sprites.end()) @@ -264,7 +264,7 @@ void SpriteFile::setSprites(QMap sprites) Sprite* SpriteFile::sprite(const std::string& name) { std::string nameLow(name); - Athena::utility::tolower(nameLow); + athena::utility::tolower(nameLow); if (m_sprites.find(nameLow) == m_sprites.end()) return NULL; diff --git a/src/Athena/SpriteFileReader.cpp b/src/athena/SpriteFileReader.cpp similarity index 96% rename from src/Athena/SpriteFileReader.cpp rename to src/athena/SpriteFileReader.cpp index 6ed6be6..764fdf7 100644 --- a/src/Athena/SpriteFileReader.cpp +++ b/src/athena/SpriteFileReader.cpp @@ -1,11 +1,11 @@ -#include "Athena/SpriteFileReader.hpp" -#include "Athena/SpriteFile.hpp" -#include "Athena/Sprite.hpp" -#include "Athena/SpritePart.hpp" -#include "Athena/SpriteFrame.hpp" -#include "Athena/Utility.hpp" +#include "athena/SpriteFileReader.hpp" +#include "athena/SpriteFile.hpp" +#include "athena/Sprite.hpp" +#include "athena/SpritePart.hpp" +#include "athena/SpriteFrame.hpp" +#include "athena/Utility.hpp" -namespace Athena +namespace athena { namespace io { @@ -183,7 +183,7 @@ Sakura::SpriteFile* SpriteFileReader::readFile() if (sprite->name() != std::string()) { std::string nameLow(sprite->name()); - Athena::utility::tolower(nameLow); + athena::utility::tolower(nameLow); sprites[nameLow] = sprite; } diff --git a/src/Athena/SpriteFileWriter.cpp b/src/athena/SpriteFileWriter.cpp similarity index 93% rename from src/Athena/SpriteFileWriter.cpp rename to src/athena/SpriteFileWriter.cpp index a0cae2f..d5c380e 100644 --- a/src/Athena/SpriteFileWriter.cpp +++ b/src/athena/SpriteFileWriter.cpp @@ -1,10 +1,10 @@ -#include "Athena/SpriteFileWriter.hpp" -#include "Athena/SpriteFile.hpp" -#include "Athena/Sprite.hpp" -#include "Athena/SpritePart.hpp" -#include "Athena/SpriteFrame.hpp" +#include "athena/SpriteFileWriter.hpp" +#include "athena/SpriteFile.hpp" +#include "athena/Sprite.hpp" +#include "athena/SpritePart.hpp" +#include "athena/SpriteFrame.hpp" -namespace Athena +namespace athena { namespace io { diff --git a/src/Athena/SpriteFrame.cpp b/src/athena/SpriteFrame.cpp similarity index 89% rename from src/Athena/SpriteFrame.cpp rename to src/athena/SpriteFrame.cpp index 2a7ad13..adfd244 100644 --- a/src/Athena/SpriteFrame.cpp +++ b/src/athena/SpriteFrame.cpp @@ -1,8 +1,8 @@ -#include "Athena/SpriteFrame.hpp" -#include "Athena/SpritePart.hpp" -#include "Athena/Sprite.hpp" +#include "athena/SpriteFrame.hpp" +#include "athena/SpritePart.hpp" +#include "athena/Sprite.hpp" -namespace Athena +namespace athena { namespace Sakura { diff --git a/src/Athena/SpritePart.cpp b/src/athena/SpritePart.cpp similarity index 96% rename from src/Athena/SpritePart.cpp rename to src/athena/SpritePart.cpp index f4dae05..508aaa4 100644 --- a/src/Athena/SpritePart.cpp +++ b/src/athena/SpritePart.cpp @@ -1,9 +1,9 @@ -#include "Athena/SpritePart.hpp" -#include "Athena/SpritePart.hpp" -#include "Athena/Sprite.hpp" +#include "athena/SpritePart.hpp" +#include "athena/SpritePart.hpp" +#include "athena/Sprite.hpp" #include -namespace Athena +namespace athena { namespace Sakura { diff --git a/src/Athena/Utility.cpp b/src/athena/Utility.cpp similarity index 99% rename from src/Athena/Utility.cpp rename to src/athena/Utility.cpp index 6851aee..19c0a6b 100644 --- a/src/Athena/Utility.cpp +++ b/src/athena/Utility.cpp @@ -1,4 +1,4 @@ -#include "Athena/Utility.hpp" +#include "athena/Utility.hpp" #include #include #include @@ -18,7 +18,7 @@ #define stat64 __stat64 #endif -namespace Athena +namespace athena { namespace utility { diff --git a/src/Athena/WiiBanner.cpp b/src/athena/WiiBanner.cpp similarity index 89% rename from src/Athena/WiiBanner.cpp rename to src/athena/WiiBanner.cpp index 5a65e3b..875edf3 100644 --- a/src/Athena/WiiBanner.cpp +++ b/src/athena/WiiBanner.cpp @@ -1,10 +1,10 @@ -#include "Athena/WiiBanner.hpp" -#include "Athena/WiiImage.hpp" +#include "athena/WiiBanner.hpp" +#include "athena/WiiImage.hpp" -#include "Athena/Utility.hpp" +#include "athena/Utility.hpp" #include -namespace Athena +namespace athena { WiiBanner::WiiBanner() : diff --git a/src/Athena/WiiFile.cpp b/src/athena/WiiFile.cpp similarity index 93% rename from src/Athena/WiiFile.cpp rename to src/athena/WiiFile.cpp index 906a398..ce80199 100644 --- a/src/Athena/WiiFile.cpp +++ b/src/athena/WiiFile.cpp @@ -1,7 +1,7 @@ -#include "Athena/WiiFile.hpp" +#include "athena/WiiFile.hpp" #include -namespace Athena +namespace athena { //! TODO: Remove this? @@ -138,7 +138,7 @@ void WiiFile::addChild(WiiFile* file) // Lets figure out it's place std::string tmpName(file->filename()); // Since we only support *NIX paths this is simple - atUint32 depth = Athena::utility::countChar(tmpName, '/'); + atUint32 depth = athena::utility::countChar(tmpName, '/'); bool owned = false; while ((depth--) > 0) diff --git a/src/Athena/WiiImage.cpp b/src/athena/WiiImage.cpp similarity index 96% rename from src/Athena/WiiImage.cpp rename to src/athena/WiiImage.cpp index 067997a..4630f9c 100644 --- a/src/Athena/WiiImage.cpp +++ b/src/athena/WiiImage.cpp @@ -1,9 +1,9 @@ -#include "Athena/WiiImage.hpp" -#include "Athena/Utility.hpp" +#include "athena/WiiImage.hpp" +#include "athena/Utility.hpp" #include #include -namespace Athena +namespace athena { WiiImage::WiiImage(atUint32 width, atUint32 height, std::unique_ptr&& data) : diff --git a/src/Athena/WiiSave.cpp b/src/athena/WiiSave.cpp similarity index 84% rename from src/Athena/WiiSave.cpp rename to src/athena/WiiSave.cpp index b46ce0a..8f45da0 100644 --- a/src/Athena/WiiSave.cpp +++ b/src/athena/WiiSave.cpp @@ -1,9 +1,9 @@ -#include "Athena/WiiSave.hpp" -#include "Athena/WiiFile.hpp" -#include "Athena/WiiBanner.hpp" -#include "Athena/MemoryReader.hpp" -#include "Athena/MemoryWriter.hpp" -#include "Athena/Utility.hpp" +#include "athena/WiiSave.hpp" +#include "athena/WiiFile.hpp" +#include "athena/WiiBanner.hpp" +#include "athena/MemoryReader.hpp" +#include "athena/MemoryWriter.hpp" +#include "athena/Utility.hpp" #include "aes.hpp" #include "ec.h" #include "md5.h" @@ -17,7 +17,7 @@ #include -namespace Athena +namespace athena { WiiSave::WiiSave() diff --git a/src/Athena/WiiSaveReader.cpp b/src/athena/WiiSaveReader.cpp similarity index 97% rename from src/Athena/WiiSaveReader.cpp rename to src/athena/WiiSaveReader.cpp index ad8c282..c25cb56 100644 --- a/src/Athena/WiiSaveReader.cpp +++ b/src/athena/WiiSaveReader.cpp @@ -1,10 +1,10 @@ -#include "Athena/WiiSaveReader.hpp" -#include "Athena/WiiSave.hpp" -#include "Athena/WiiFile.hpp" -#include "Athena/WiiImage.hpp" -#include "Athena/WiiBanner.hpp" -#include "Athena/Utility.hpp" -#include "Athena/FileWriter.hpp" +#include "athena/WiiSaveReader.hpp" +#include "athena/WiiSave.hpp" +#include "athena/WiiFile.hpp" +#include "athena/WiiImage.hpp" +#include "athena/WiiBanner.hpp" +#include "athena/Utility.hpp" +#include "athena/FileWriter.hpp" #include "md5.h" #include "aes.hpp" #include "ec.h" @@ -13,7 +13,7 @@ #include #include -namespace Athena +namespace athena { namespace io diff --git a/src/Athena/WiiSaveWriter.cpp b/src/athena/WiiSaveWriter.cpp similarity index 95% rename from src/Athena/WiiSaveWriter.cpp rename to src/athena/WiiSaveWriter.cpp index bc65fd7..0f8bc6d 100644 --- a/src/Athena/WiiSaveWriter.cpp +++ b/src/athena/WiiSaveWriter.cpp @@ -1,13 +1,13 @@ -#include "Athena/WiiSaveWriter.hpp" -#include "Athena/WiiSave.hpp" -#include "Athena/WiiFile.hpp" -#include "Athena/WiiBanner.hpp" -#include "Athena/WiiImage.hpp" -#include "Athena/WiiSave.hpp" -#include "Athena/WiiFile.hpp" -#include "Athena/WiiBanner.hpp" -#include "Athena/MemoryWriter.hpp" -#include "Athena/Utility.hpp" +#include "athena/WiiSaveWriter.hpp" +#include "athena/WiiSave.hpp" +#include "athena/WiiFile.hpp" +#include "athena/WiiBanner.hpp" +#include "athena/WiiImage.hpp" +#include "athena/WiiSave.hpp" +#include "athena/WiiFile.hpp" +#include "athena/WiiBanner.hpp" +#include "athena/MemoryWriter.hpp" +#include "athena/Utility.hpp" #include "aes.hpp" #include "ec.h" @@ -21,7 +21,7 @@ #include #include -namespace Athena +namespace athena { namespace io diff --git a/src/Athena/ZQuestFile.cpp b/src/athena/ZQuestFile.cpp similarity index 98% rename from src/Athena/ZQuestFile.cpp rename to src/athena/ZQuestFile.cpp index 67b2311..6c133c9 100644 --- a/src/Athena/ZQuestFile.cpp +++ b/src/athena/ZQuestFile.cpp @@ -1,8 +1,8 @@ -#include "Athena/ZQuestFile.hpp" +#include "athena/ZQuestFile.hpp" #include -namespace Athena +namespace athena { std::vector GameStrings; void initGameStrings() diff --git a/src/Athena/ZQuestFileReader.cpp b/src/athena/ZQuestFileReader.cpp similarity index 89% rename from src/Athena/ZQuestFileReader.cpp rename to src/athena/ZQuestFileReader.cpp index a8442c4..a88ec2e 100644 --- a/src/Athena/ZQuestFileReader.cpp +++ b/src/athena/ZQuestFileReader.cpp @@ -1,13 +1,13 @@ -#include "Athena/ZQuestFileReader.hpp" -#include "Athena/ZQuestFile.hpp" -#include "Athena/Compression.hpp" -#include "Athena/Checksums.hpp" -#include "Athena/Utility.hpp" +#include "athena/ZQuestFileReader.hpp" +#include "athena/ZQuestFile.hpp" +#include "athena/Compression.hpp" +#include "athena/Checksums.hpp" +#include "athena/Utility.hpp" #include #include -namespace Athena +namespace athena { namespace io { @@ -77,7 +77,7 @@ ZQuestFile* ZQuestFileReader::read() if (version >= ZQUEST_VERSION_CHECK(2, 0, 0)) { - if (checksum != Athena::Checksums::crc32(data.get(), compressedLen)) + if (checksum != athena::Checksums::crc32(data.get(), compressedLen)) { atError("Checksum mismatch, data corrupt"); return nullptr; @@ -85,7 +85,7 @@ ZQuestFile* ZQuestFileReader::read() } else { - std::clog << "ZQuest version 0x" << std::uppercase << std::setw(8) << std::setfill('0') << std::hex << Athena::utility::swapU32(version); + std::clog << "ZQuest version 0x" << std::uppercase << std::setw(8) << std::setfill('0') << std::hex << athena::utility::swapU32(version); std::clog << " has no checksum field" << std::endl; } diff --git a/src/Athena/ZQuestFileWriter.cpp b/src/athena/ZQuestFileWriter.cpp similarity index 89% rename from src/Athena/ZQuestFileWriter.cpp rename to src/athena/ZQuestFileWriter.cpp index 7c0df19..ed118ae 100644 --- a/src/Athena/ZQuestFileWriter.cpp +++ b/src/athena/ZQuestFileWriter.cpp @@ -1,9 +1,9 @@ -#include "Athena/ZQuestFileWriter.hpp" -#include "Athena/ZQuestFile.hpp" -#include "Athena/Compression.hpp" -#include "Athena/Checksums.hpp" +#include "athena/ZQuestFileWriter.hpp" +#include "athena/ZQuestFile.hpp" +#include "athena/Compression.hpp" +#include "athena/Checksums.hpp" -namespace Athena +namespace athena { namespace io { @@ -62,7 +62,7 @@ void ZQuestFileWriter::write(ZQuestFile* quest, bool compress) base::writeUint32(quest->length()); base::writeBytes((atInt8*)quest->gameString().substr(0, 0x0A).c_str(), 0x0A); base::writeUint16(quest->endian() == Endian::BigEndian ? 0xFFFE : 0xFEFF); - base::writeUint32(Athena::Checksums::crc32(questData, compLen)); + base::writeUint32(athena::Checksums::crc32(questData, compLen)); base::writeUBytes(questData, compLen); base::save(); diff --git a/src/ec.cpp b/src/ec.cpp index 0258d6b..066f9d8 100644 --- a/src/ec.cpp +++ b/src/ec.cpp @@ -8,7 +8,7 @@ // Not all of these headers are necessary, figure out which ones are actually used and prune those that are irrelevant. #include -#include "Athena/Utility.hpp" +#include "athena/Utility.hpp" #include "bn.h" #include "ec.h" @@ -351,7 +351,7 @@ void generate_ecdsa(atUint8* R, atUint8* S, atUint8* k, atUint8* hash) elt_zero(e); memcpy(e + 10, hash, 20); - Athena::utility::fillRandom(m, sizeof(m)); + athena::utility::fillRandom(m, sizeof(m)); m[0] = 0; // R = (mG).x @@ -431,21 +431,21 @@ void make_ec_cert(atUint8* cert, atUint8* sig, char* signer, char* name, atUint8 memset(cert, 0, 0x180); *(atUint32*)(cert) = 0x10002; - if (!Athena::utility::isSystemBigEndian()) - *(atUint32*)(cert) = Athena::utility::swapU32(*(atUint32*)(cert)); + if (!athena::utility::isSystemBigEndian()) + *(atUint32*)(cert) = athena::utility::swapU32(*(atUint32*)(cert)); memcpy((char*)cert + 4, sig, 60); strcpy((char*)cert + 0x80, signer); *(atUint32*)(cert + 0xc0) = 2; - if (!Athena::utility::isSystemBigEndian()) - *(atUint32*)(cert + 0xc0) = Athena::utility::swapU32(*(atUint32*)(cert + 0xc0)); + if (!athena::utility::isSystemBigEndian()) + *(atUint32*)(cert + 0xc0) = athena::utility::swapU32(*(atUint32*)(cert + 0xc0)); strcpy((char*)cert + 0xc4, name); *(atUint32*)(cert + 0x104) = key_id; - if (!Athena::utility::isSystemBigEndian()) - *(atUint32*)(cert + 0x104) = Athena::utility::swapU32(*(atUint32*)(cert + 0x104)); + if (!athena::utility::isSystemBigEndian()) + *(atUint32*)(cert + 0x104) = athena::utility::swapU32(*(atUint32*)(cert + 0x104)); ec_priv_to_pub(priv, cert + 0x108); } diff --git a/src/sha1.cpp b/src/sha1.cpp index b6b6ef2..6bb81ed 100644 --- a/src/sha1.cpp +++ b/src/sha1.cpp @@ -40,7 +40,7 @@ #include "sha1.h" #include -#include "Athena/Utility.hpp" +#include "athena/Utility.hpp" /* * Define the circular shift macro @@ -392,8 +392,8 @@ atUint8* getSha1(atUint8* stuff, atUint32 stuff_size) { int val = sha.Message_Digest[ i ]; - if (!Athena::utility::isSystemBigEndian()) - val = Athena::utility::swap32(val); + if (!athena::utility::isSystemBigEndian()) + val = athena::utility::swap32(val); memcpy((char*)ret + (i * 4), &val, 4); }