Skip to content

Commit

Permalink
Initial implementation of machine markers
Browse files Browse the repository at this point in the history
  • Loading branch information
tatjam committed Sep 20, 2020
1 parent b8e1254 commit 22abfad
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 213 deletions.
21 changes: 2 additions & 19 deletions src/Main.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
#include "util/Timer.h"

#include "renderer/camera/SimpleCamera.h"

#include <imgui/imgui.h>



#include "universe/vehicle/Vehicle.h"
#include "assets/Model.h"

#include "physics/ground/GroundShape.h"
#include "renderer/lighting/SunLight.h"

#include "OSP.h"

#include "universe/vehicle/VehicleLoader.h"
#include "game/scenes/flight/FlightScene.h"
#include "game/scenes/editor/EditorScene.h"

#include <util/fmt/glm.h>

#include <game/input/JoystickDebug.h>

#include <util/Profiler.h>

static int iteration = 0;
Expand All @@ -38,12 +21,12 @@ int main(int argc, char** argv)

PROFILE_FUNC();

osp.game_state.load_scene(new FlightScene());
osp.game_state.load_scene(new EditorScene());

while (osp.should_loop())
{
PROFILE_BLOCK("frame");

osp.start_frame();
osp.update();
osp.render();
Expand Down
4 changes: 3 additions & 1 deletion src/assets/Model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ void Model::process_mesh(aiMesh* mesh, const aiScene* scene, Node* to, bool draw
ai_mat->GetTexture(type_t, 0, &path);

std::string path_s = std::string(path.C_Str());
logger->info("Loading texture: {}", path_s);
// Sanitize the path
replace_all(path_s, "\\", "/");
// We find 'res/', after it is the package name, and then the name, pretty easy
size_t pos = path_s.find("res/");
if (pos == std::string::npos)
{
logger->warn("Invalid path '{}' given in texture, ignoring!", path_s);
// It may be a relative path
logger->warn("Invalid path '{}' given in texture, ignoring! Make sure you enable absolute path mode", path_s);
}
else
{
Expand Down
Loading

1 comment on commit 22abfad

@tatjam
Copy link
Collaborator Author

@tatjam tatjam commented on 22abfad Sep 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Progress towards #27

Please sign in to comment.