Skip to content

Commit

Permalink
use jLog as a submodule (#142)
Browse files Browse the repository at this point in the history
* use jLog as a submodule

* with submodules in workflow checkouts

* update android
  • Loading branch information
Jerboa-app authored Jan 1, 2024
1 parent 143c671 commit c748a94
Show file tree
Hide file tree
Showing 21 changed files with 66 additions and 260 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev
Expand Down Expand Up @@ -55,6 +57,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev build-essential mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev g++-mingw-w64-x86-64-posix gcc-mingw-w64-x86-64-posix libxinerama-dev libxcursor-dev
Expand Down Expand Up @@ -161,6 +165,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
submodules: 'true'

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y build-essential xorg-dev mesa-common-dev libx11-dev libxrandr-dev libgl1-mesa-dev libglu1-mesa-dev libfreetype6-dev libopenal-dev libsndfile1-dev libudev-dev libxinerama-dev libxcursor-dev
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "include/jLog"]
path = include/jLog
url = https://github.com/JerboaBurrow/jLog.git
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ target_link_libraries(Miniaudio vorbisfile ogg ${CMAKE_DL_LIBS})
include_directories(include include/vendored ${OPENGL_INCLUDE_DIRS} ${GLEW_INCLUDE} ${ZLIB_DEPS_DIR})

include_directories(src)
include_directories(include/jLog)

file(GLOB SRC
"src/*.cpp"
Expand Down Expand Up @@ -173,7 +174,9 @@ endif()

add_library(FreeType ALIAS freetype)

add_subdirectory(tools/)
if (NOT ANDROID)
add_subdirectory(tools/)
endif ()

IF (BUILD_DEMOS)

Expand Down
10 changes: 5 additions & 5 deletions demo/android/perlinWorld/app/src/main/cpp/hopAndroid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <Util/util.h>

#include <log.h>
#include <jLog/jLog.h>

using Hop::Object::Component::cTransform;
using Hop::Object::Component::cPhysics;
Expand Down Expand Up @@ -59,8 +59,8 @@ using Hop::World::AbstractWorld;
using Hop::World::TileWorld;
using Hop::World::MarchingWorld;

using Hop::Logging::INFO;
using Hop::Logging::WARN;
using jLog::INFO;
using jLog::WARN;

static Boundary * boundary = nullptr;
static PerlinSource * perlin = nullptr;
Expand All @@ -69,7 +69,7 @@ static MarchingWorld * world = nullptr;

static EntityComponentSystem * manager = nullptr;

static Hop::Logging::Log * hopLog = nullptr;
static jLog::Log * hopLog = nullptr;

static sPhysics * physics = nullptr;
static sCollision * collisions = nullptr;
Expand Down Expand Up @@ -133,7 +133,7 @@ extern "C"
textRenderer = new Hop::System::Rendering::TextRenderer(glm::ortho(0.0,double(resX),0.0,double(resY)));
font = new Hop::System::Rendering::Type(48);

hopLog = new Hop::Logging::Log;
hopLog = new jLog::Log;

manager = new EntityComponentSystem;

Expand Down
8 changes: 4 additions & 4 deletions demo/desktop/perlinWorld/sfml/sfmlPerlinWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace std::chrono;
#include <Console/console.h>

#include <Util/util.h>
#include <log.h>
#include <jLog/jLog.h>

#include <Debug/collisionMeshDebug.h>

Expand Down Expand Up @@ -83,8 +83,8 @@ using Hop::World::AbstractWorld;
using Hop::World::TileWorld;
using Hop::World::MarchingWorld;

using Hop::Logging::INFO;
using Hop::Logging::WARN;
using jLog::INFO;
using jLog::WARN;

using Hop::Util::fixedLengthNumber;

Expand Down Expand Up @@ -116,7 +116,7 @@ int main(int argc, char ** argv)

EntityComponentSystem manager;

Hop::Logging::Log log;
jLog::Log log;

Hop::Console console(log);

Expand Down
8 changes: 4 additions & 4 deletions demo/desktop/perlinWorld/standalone/perlinWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace std::chrono;
#include <Console/console.h>

#include <Util/util.h>
#include <log.h>
#include <jLog/jLog.h>

const int resX = 1000;
const int resY = 1000;
Expand Down Expand Up @@ -72,8 +72,8 @@ using Hop::World::AbstractWorld;
using Hop::World::TileWorld;
using Hop::World::MarchingWorld;

using Hop::Logging::INFO;
using Hop::Logging::WARN;
using jLog::INFO;
using jLog::WARN;

using Hop::Util::fixedLengthNumber;

Expand All @@ -88,7 +88,7 @@ int main(int argc, char ** argv)

EntityComponentSystem manager;

Hop::Logging::Log log;
jLog::Log log;

Hop::Console console(log);

Expand Down
2 changes: 1 addition & 1 deletion demo/desktop/softBodyTetris/sfml/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(int argc, char ** argv)

EntityComponentSystem manager;

Hop::Logging::Log log;
jLog::Log log;

Hop::Console console(log);

Expand Down
6 changes: 3 additions & 3 deletions demo/desktop/softBodyTetris/sfml/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ using namespace std::chrono;
#include <Console/console.h>

#include <Util/util.h>
#include <log.h>
#include <jLog/jLog.h>

#include <Debug/collisionMeshDebug.h>

Expand Down Expand Up @@ -84,8 +84,8 @@ using Hop::World::Boundary;
using Hop::World::AbstractWorld;
using Hop::World::TileWorld;

using Hop::Logging::INFO;
using Hop::Logging::WARN;
using jLog::INFO;
using jLog::WARN;

using Hop::Util::fixedLengthNumber;

Expand Down
2 changes: 1 addition & 1 deletion demo/desktop/softBodyTetris/standalone/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ int main(int argc, char ** argv)

EntityComponentSystem manager;

Hop::Logging::Log log;
jLog::Log log;

Hop::Console console(log);

Expand Down
6 changes: 3 additions & 3 deletions demo/desktop/softBodyTetris/standalone/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ using namespace std::chrono;
#include <Debug/collisionMeshDebug.h>

#include <Util/util.h>
#include <log.h>
#include <jLog/jLog.h>

const int resX = 1000;
const int resY = 1000;
Expand Down Expand Up @@ -77,8 +77,8 @@ using Hop::World::MapSource;
using Hop::World::Boundary;
using Hop::World::AbstractWorld;
using Hop::World::TileWorld;
using Hop::Logging::INFO;
using Hop::Logging::WARN;
using jLog::INFO;
using jLog::WARN;

using Hop::Util::fixedLengthNumber;

Expand Down
12 changes: 6 additions & 6 deletions include/Console/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <Console/LuaTable.h>
#include <System/Physics/sPhysics.h>
#include <System/Physics/sCollision.h>
#include <log.h>
#include <jLog/jLog.h>
#include <Object/id.h>

#include <memory>
Expand All @@ -24,11 +24,11 @@ namespace Hop
using Hop::System::Physics::sPhysics;
using Hop::System::Physics::sCollision;

using Hop::Logging::INFO;
using Hop::Logging::WARN;
using Hop::Logging::ERROR;
using Hop::Logging::Log;
using Hop::Logging::ERRORCODE;
using jLog::INFO;
using jLog::WARN;
using jLog::ERROR;
using jLog::Log;
using jLog::ERRORCODE;

struct Routine
{
Expand Down
8 changes: 4 additions & 4 deletions include/Shader/shaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <fstream>
#include <exception>
#include <memory>
#include <log.h>
#include <jLog/jLog.h>

namespace Hop::System::Rendering
{
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace Hop::System::Rendering
return this->vertex == s.vertex && this->fragment == s.fragment;
}

bool lint(Hop::Logging::Log & log);
bool lint(jLog::Log & log);

private:

Expand All @@ -91,13 +91,13 @@ namespace Hop::System::Rendering

Shaders(){}

void defaultShaders(Hop::Logging::Log & log);
void defaultShaders(jLog::Log & log);

void makeShader(
const char * v,
const char * f,
std::string n,
Hop::Logging::Log & log
jLog::Log & log
);

void remove(std::string n);
Expand Down
10 changes: 5 additions & 5 deletions include/System/Rendering/sRender.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef SRENDER
#define SRENDER
#ifndef SRENDER_H
#define SRENDER_H

#include <System/system.h>
#include <System/Rendering/sSpriteRender.h>
#include <Shader/shaders.h>
#include <Object/entityComponentSystem.h>
#include <World/world.h>
#include <log.h>
#include <jLog/jLog.h>

namespace Hop::Object
{
Expand All @@ -16,7 +16,7 @@ namespace Hop::Object
namespace Hop::System::Rendering
{
using Hop::Object::EntityComponentSystem;
using Hop::Logging::Log;
using jLog::Log;
using Hop::World::AbstractWorld;

class sRender : public System
Expand Down Expand Up @@ -55,4 +55,4 @@ namespace Hop::System::Rendering
};
}

#endif /* SRENDER */
#endif /* SRENDER_H */
6 changes: 3 additions & 3 deletions include/System/Sound/sSound.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <miniaudio/miniaudio.h>
#include <System/Sound/vorbis.h>

#include <log.h>
#include <jLog/jLog.h>
#include <sstream>

#include <Object/entityComponentSystem.h>
Expand Down Expand Up @@ -83,10 +83,10 @@ namespace Hop::System::Sound

if (result != MA_SUCCESS)
{
Hop::Logging::Log log;
jLog::Log log;
std::stringstream ss;
ss << "Could not decode audio file: " << filename << ", got error: " << to_string(result);
Hop::Logging::ERROR(ss.str()) >> log;
jLog::ERROR(ss.str()) >> log;
}

if (decoderInUse == DECODER::MA)
Expand Down
1 change: 1 addition & 0 deletions include/jLog
Submodule jLog added at 632081
Loading

0 comments on commit c748a94

Please sign in to comment.