cleanup
This commit is contained in:
parent
80015a530e
commit
45a3c1a7c2
@ -32,24 +32,6 @@ else()
|
||||
FetchContent_MakeAvailable(raylib)
|
||||
endif()
|
||||
|
||||
if (EXISTS ${IMGUI_DIR})
|
||||
set(imgui_SOURCE_DIR ${IMGUI_DIR})
|
||||
else()
|
||||
message(STATUS "Downloading imgui library")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(imgui URL ${IMGUI_LINK})
|
||||
FetchContent_MakeAvailable(imgui)
|
||||
endif()
|
||||
|
||||
if (EXISTS ${RLIMGUI_DIR})
|
||||
set(rlimgui_SOURCE_DIR ${RLIMGUI_DIR})
|
||||
else()
|
||||
message(STATUS "Downloading rlImGui library")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(rlimgui URL ${RLIMGUI_LINK})
|
||||
FetchContent_MakeAvailable(rlimgui)
|
||||
endif()
|
||||
|
||||
if (EXISTS ${INIFILE_DIR})
|
||||
set(inifile-cpp_SOURCE_DIR ${INIFILE_DIR})
|
||||
else()
|
||||
@ -63,16 +45,8 @@ endif()
|
||||
# yes... im using glob... dont judge me....
|
||||
file(GLOB_RECURSE PROJECT_SOURCES CONFIGURE_DEPENDS "src/*.cpp")
|
||||
|
||||
file(GLOB VENDOR_SOURCES CONFIGURE_DEPENDS
|
||||
"${imgui_SOURCE_DIR}/*.cpp"
|
||||
"${imgui_SOURCE_DIR}/misc/cpp/*.cpp"
|
||||
"${rlimgui_SOURCE_DIR}/*.cpp")
|
||||
|
||||
set(PROJECT_INCLUDE
|
||||
set(PROJECT_INCLUDE
|
||||
"src"
|
||||
${imgui_SOURCE_DIR}
|
||||
${imgui_SOURCE_DIR}/backends
|
||||
${rlimgui_SOURCE_DIR}
|
||||
${inifile-cpp_SOURCE_DIR}/include)
|
||||
|
||||
set(PROJECT_LIBRARY raylib)
|
||||
@ -81,7 +55,50 @@ set(PROJECT_DEFINITION "_PANDA_CORE_")
|
||||
|
||||
##############################################################
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${PROJECT_SOURCES} ${VENDOR_SOURCES})
|
||||
if(NOT DEFINED PANDA_INCLUDE_IMGUI)
|
||||
set(PANDA_INCLUDE_IMGUI "true")
|
||||
message(STATUS "PANDA_INCLUDE_IMGUI not defined, default to true")
|
||||
endif()
|
||||
|
||||
if(DEFINED PANDA_INCLUDE_IMGUI AND PANDA_INCLUDE_IMGUI STREQUAL "true")
|
||||
set(PROJECT_DEFINITION ${PROJECT_DEFINITION} PANDA_INCLUDE_IMGUI)
|
||||
|
||||
if (EXISTS ${IMGUI_DIR})
|
||||
set(imgui_SOURCE_DIR ${IMGUI_DIR})
|
||||
else()
|
||||
message(STATUS "Downloading imgui library")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(imgui URL ${IMGUI_LINK})
|
||||
FetchContent_MakeAvailable(imgui)
|
||||
endif()
|
||||
|
||||
if (EXISTS ${RLIMGUI_DIR})
|
||||
set(rlimgui_SOURCE_DIR ${RLIMGUI_DIR})
|
||||
else()
|
||||
message(STATUS "Downloading rlImGui library")
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(rlimgui URL ${RLIMGUI_LINK})
|
||||
FetchContent_MakeAvailable(rlimgui)
|
||||
endif()
|
||||
|
||||
file(GLOB IMGUI_SOURCES CONFIGURE_DEPENDS
|
||||
"${imgui_SOURCE_DIR}/*.cpp"
|
||||
"${imgui_SOURCE_DIR}/misc/cpp/*.cpp"
|
||||
"${rlimgui_SOURCE_DIR}/*.cpp")
|
||||
|
||||
set (PROJECT_SOURCES ${PROJECT_SOURCES} ${IMGUI_SOURCES})
|
||||
|
||||
set(PROJECT_INCLUDE
|
||||
${PROJECT_INCLUDE}
|
||||
${imgui_SOURCE_DIR}
|
||||
${imgui_SOURCE_DIR}/backends
|
||||
${rlimgui_SOURCE_DIR})
|
||||
endif()
|
||||
|
||||
|
||||
##############################################################
|
||||
|
||||
add_library(${PROJECT_NAME} STATIC ${PROJECT_SOURCES})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDE})
|
||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_LIBRARY})
|
||||
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_DEFINITION})
|
||||
|
@ -146,15 +146,13 @@ namespace panda
|
||||
|
||||
// ### GUI
|
||||
#ifdef PANDA_INCLUDE_IMGUI
|
||||
|
||||
void GuiInit();
|
||||
void GuiDestroy();
|
||||
void GuiBegin();
|
||||
void GuiEnd();
|
||||
void GuiThemeSetup();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
// ### atlas
|
||||
bool LoadTextureAtlas(const char *image_path, const char *ini_path, std::string AtlasKey);
|
||||
bool UnloadTextureAtlas(std::string AtlasKey);
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <cmath>
|
||||
#include <raylib.h>
|
||||
|
||||
#include "Panda.hpp"
|
||||
#include <raylib.h>
|
||||
#include <cmath>
|
||||
|
||||
double panda::distance(const Vector2 &p1, const Vector2 &p2)
|
||||
{
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "utils/Easing.hpp"
|
||||
#include <cmath>
|
||||
|
||||
namespace cur = easing;
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "GridMap.hpp"
|
||||
#include "Panda.hpp"
|
||||
#include <raylib.h>
|
||||
|
||||
void panda::DrawGridMap(Texture texture, Camera2D cam)
|
||||
{
|
||||
|
@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "utils/RaylibDeprecated.hpp"
|
||||
#include <raylib.h>
|
||||
|
||||
/**
|
||||
* Draw GridMap using cam, use this inside BeginMode2D
|
||||
* @param {Texture} texture :
|
||||
* @param {Camera2D} cam :
|
||||
*/
|
||||
void DrawGridMap(Texture texture, Camera2D cam);
|
||||
|
||||
/**
|
||||
* This is quick version without cam, does not support zoom
|
||||
* @param {Texture} texture :
|
||||
* @param {Camera2D} cam :
|
||||
*/
|
||||
void DrawGridMapQuick(Texture texture, Vector2 offset);
|
||||
|
||||
Texture LoadDefaultGridMap();
|
@ -1,6 +1,5 @@
|
||||
#include <cmath>
|
||||
|
||||
#include "Panda.hpp"
|
||||
#include <cmath>
|
||||
|
||||
namespace panda {
|
||||
void Matrix::identity()
|
||||
|
@ -1,54 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
#include "utils/Random.hpp"
|
||||
|
||||
namespace panda
|
||||
{
|
||||
|
||||
// template<typename T>
|
||||
// class Pool
|
||||
// {
|
||||
// public:
|
||||
// Pool(int size) : container(size) { }
|
||||
|
||||
// T &get()
|
||||
// {
|
||||
// if (activeIndex != container.size())
|
||||
// {
|
||||
// activeIndex++;
|
||||
// return container[activeIndex-1];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (custom)
|
||||
// {
|
||||
// return container[custom()];
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// int r = Random::getInstance().UNI() * (container.size()-1);
|
||||
// return container[r];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// void put(int index)
|
||||
// {
|
||||
// activeIndex--;
|
||||
// std::swap(container[activeIndex], container[index]);
|
||||
// }
|
||||
|
||||
// // int countActive() { return activeIndex; }
|
||||
// int activeIndex;
|
||||
// std::vector<T> container;
|
||||
// std::function<int()> custom;
|
||||
// };
|
||||
|
||||
template<typename T, size_t SIZE>
|
||||
class PoolPointer {
|
||||
private:
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "utils/Random.hpp"
|
||||
#include "Panda.hpp"
|
||||
|
||||
static inline uint64_t splitmix64(uint64_t &x) {
|
||||
uint64_t z = (x += 0x9e3779b97f4a7c15);
|
||||
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
|
||||
namespace panda
|
||||
{
|
||||
class Random {
|
||||
public:
|
||||
Random(uint64_t seed = 521288629);
|
||||
void SetSeed(uint64_t seed);
|
||||
|
||||
uint64_t Next();
|
||||
double Next_UNI();
|
||||
double Range(double min, double max);
|
||||
|
||||
private:
|
||||
uint64_t s[4];
|
||||
};
|
||||
}
|
@ -1,8 +1,8 @@
|
||||
#include "Panda.hpp"
|
||||
#include <raylib.h>
|
||||
#include <sstream>
|
||||
#include <inicpp.h>
|
||||
#include <raylib.h>
|
||||
|
||||
#include "Panda.hpp"
|
||||
#include <unordered_map>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user