diff --git a/NazaraModuleTemplate/build/scripts/modules/modulename.lua b/NazaraModuleTemplate/build/scripts/modules/modulename.lua deleted file mode 100644 index 7f954dd6a..000000000 --- a/NazaraModuleTemplate/build/scripts/modules/modulename.lua +++ /dev/null @@ -1,15 +0,0 @@ -MODULE.Name = "ModuleName" - -MODULE.Libraries = { - "NazaraCore" -} - -MODULE.OsFiles.Windows = { - "../src/Nazara/ModuleName/Win32/**.hpp", - "../src/Nazara/ModuleName/Win32/**.cpp" -} - -MODULE.OsFiles.Posix = { - "../src/Nazara/ModuleName/Posix/**.hpp", - "../src/Nazara/ModuleName/Posix/**.cpp" -} diff --git a/NazaraModuleTemplate/include/Nazara/ModuleName/ClassName.hpp b/NazaraModuleTemplate/include/Nazara/ModuleName/ClassName.hpp deleted file mode 100644 index e4866c2bc..000000000 --- a/NazaraModuleTemplate/include/Nazara/ModuleName/ClassName.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_CLASSNAME_HPP -#define NAZARA_CLASSNAME_HPP - -#include - -namespace Nz -{ - class NAZARA_MODULENAME_API ClassName - { - public: - ClassName(); - - int GetAttribute() const; - - void SetAttribute(int attribute); - - private: - int m_attribute; - }; -} - -#endif // NAZARA_CLASSNAME_HPP diff --git a/NazaraModuleTemplate/include/Nazara/ModuleName/Config.hpp b/NazaraModuleTemplate/include/Nazara/ModuleName/Config.hpp deleted file mode 100644 index d311f8991..000000000 --- a/NazaraModuleTemplate/include/Nazara/ModuleName/Config.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - Nazara Engine - Module name - - Copyright (C) YEAR AUTHORS (EMAIL) - - Permission is hereby granted, free of charge, to any person obtaining a copy of - this software and associated documentation files (the "Software"), to deal in - the Software without restriction, including without limitation the rights to - use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies - of the Software, and to permit persons to whom the Software is furnished to do - so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -#pragma once - -#ifndef NAZARA_CONFIG_MODULENAME_HPP -#define NAZARA_CONFIG_MODULENAME_HPP - -/// Each modification of a parameter needs a recompilation of the module - -// Use the MemoryManager to manage dynamic allocations (can detect memory leak but allocations/frees are slower) -#define NAZARA_MODULENAME_MANAGE_MEMORY 0 - -// Activate the security tests based on the code (Advised for development) -#define NAZARA_MODULENAME_SAFE 1 - -/// Each modification of a parameter following implies a modification (often minor) of the code - -/// Checking the values and types of certain constants -#include - -#if !defined(NAZARA_STATIC) - #ifdef NAZARA_MODULENAME_BUILD - #define NAZARA_MODULENAME_API NAZARA_EXPORT - #else - #define NAZARA_MODULENAME_API NAZARA_IMPORT - #endif -#else - #define NAZARA_MODULENAME_API -#endif - -#endif // NAZARA_CONFIG_MODULENAME_HPP diff --git a/NazaraModuleTemplate/include/Nazara/ModuleName/ConfigCheck.hpp b/NazaraModuleTemplate/include/Nazara/ModuleName/ConfigCheck.hpp deleted file mode 100644 index 723b9ac02..000000000 --- a/NazaraModuleTemplate/include/Nazara/ModuleName/ConfigCheck.hpp +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_CONFIG_CHECK_MODULENAME_HPP -#define NAZARA_CONFIG_CHECK_MODULENAME_HPP - -/// This file is used to check the constant values defined in Config.hpp - -#include -#define CheckType(name, type, err) static_assert(std::is_ ##type ::value, #type err) -#define CheckTypeAndVal(name, type, op, val, err) static_assert(std::is_ ##type ::value && name op val, #type err) - -// We force the value of MANAGE_MEMORY in debug -#if defined(NAZARA_DEBUG) && !NAZARA_MODULENAME_MANAGE_MEMORY - #undef NAZARA_MODULENAME_MANAGE_MEMORY - #define NAZARA_MODULENAME_MANAGE_MEMORY 0 -#endif - -#endif // NAZARA_CONFIG_CHECK_MODULENAME_HPP diff --git a/NazaraModuleTemplate/include/Nazara/ModuleName/Debug.hpp b/NazaraModuleTemplate/include/Nazara/ModuleName/Debug.hpp deleted file mode 100644 index d225798df..000000000 --- a/NazaraModuleTemplate/include/Nazara/ModuleName/Debug.hpp +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#if NAZARA_MODULENAME_MANAGE_MEMORY - #include -#endif diff --git a/NazaraModuleTemplate/include/Nazara/ModuleName/DebugOff.hpp b/NazaraModuleTemplate/include/Nazara/ModuleName/DebugOff.hpp deleted file mode 100644 index 29147254e..000000000 --- a/NazaraModuleTemplate/include/Nazara/ModuleName/DebugOff.hpp +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -// We suppose that Debug.hpp is already included, same goes for Config.hpp -#if NAZARA_MODULENAME_MANAGE_MEMORY - #undef delete - #undef new -#endif diff --git a/NazaraModuleTemplate/include/Nazara/ModuleName/ModuleName.hpp b/NazaraModuleTemplate/include/Nazara/ModuleName/ModuleName.hpp deleted file mode 100644 index c018f899f..000000000 --- a/NazaraModuleTemplate/include/Nazara/ModuleName/ModuleName.hpp +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#pragma once - -#ifndef NAZARA_MODULENAME_HPP -#define NAZARA_MODULENAME_HPP - -#include -#include -#include - -namespace Nz -{ - class NAZARA_MODULENAME_API ModuleName - { - public: - ModuleName() = delete; - ~ModuleName() = delete; - - static bool Initialize(); - - static bool IsInitialized(); - - static void Uninitialize(); - - private: - static unsigned int s_moduleReferenceCounter; - }; -} - -#endif // NAZARA_MODULENAME_HPP diff --git a/NazaraModuleTemplate/src/Nazara/ModuleName/ClassName.cpp b/NazaraModuleTemplate/src/Nazara/ModuleName/ClassName.cpp deleted file mode 100644 index 636cb270c..000000000 --- a/NazaraModuleTemplate/src/Nazara/ModuleName/ClassName.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#include - -namespace Nz -{ - ClassName::ClassName() : - m_attribute(42) - { - } - - int ClassName::GetAttribute() const - { - return m_attribute; - } - - void ClassName::SetAttribute(int attribute) - { - m_attribute = attribute; - } -} - diff --git a/NazaraModuleTemplate/src/Nazara/ModuleName/Debug/NewOverload.cpp b/NazaraModuleTemplate/src/Nazara/ModuleName/Debug/NewOverload.cpp deleted file mode 100644 index a9a767c1d..000000000 --- a/NazaraModuleTemplate/src/Nazara/ModuleName/Debug/NewOverload.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2014 AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#if NAZARA_MODULENAME_MANAGE_MEMORY - -#include -#include // Nécessaire ? - -void* operator new(std::size_t size) -{ - return Nz::MemoryManager::Allocate(size, false); -} - -void* operator new[](std::size_t size) -{ - return Nz::MemoryManager::Allocate(size, true); -} - -void operator delete(void* pointer) noexcept -{ - Nz::MemoryManager::Free(pointer, false); -} - -void operator delete[](void* pointer) noexcept -{ - Nz::MemoryManager::Free(pointer, true); -} - -#endif // NAZARA_MODULENAME_MANAGE_MEMORY diff --git a/NazaraModuleTemplate/src/Nazara/ModuleName/ModuleName.cpp b/NazaraModuleTemplate/src/Nazara/ModuleName/ModuleName.cpp deleted file mode 100644 index e286520f8..000000000 --- a/NazaraModuleTemplate/src/Nazara/ModuleName/ModuleName.cpp +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (C) YEAR AUTHORS -// This file is part of the "Nazara Engine - Module name" -// For conditions of distribution and use, see copyright notice in Config.hpp - -#include -#include -#include -#include -#include -#include -#include - -namespace Nz -{ - bool ModuleName::Initialize() - { - if (s_moduleReferenceCounter > 0) - { - s_moduleReferenceCounter++; - return true; // Already initialized - } - - // Initialize module dependencies - if (!Core::Initialize()) - { - NazaraError("Failed to initialize core module"); - return false; - } - - s_moduleReferenceCounter++; - - CallOnExit onExit(ModuleName::Uninitialize); - - // Initialize module here - - onExit.Reset(); - - NazaraNotice("Initialized: ModuleName module"); - return true; - } - - bool ModuleName::IsInitialized() - { - return s_moduleReferenceCounter != 0; - } - - void ModuleName::Uninitialize() - { - if (s_moduleReferenceCounter != 1) - { - // Either the module is not initialized, either it was initialized multiple times - if (s_moduleReferenceCounter > 1) - s_moduleReferenceCounter--; - - return; - } - - s_moduleReferenceCounter = 0; - - // Uninitialize module here - - NazaraNotice("Uninitialized: ModuleName module"); - - // Free module dependencies - Core::Uninitialize(); - } - - unsigned int ModuleName::s_moduleReferenceCounter = 0; -} -