Skip to content

Commit

Permalink
lint werrors fix, gltf widget params, small fixes and features, camer…
Browse files Browse the repository at this point in the history
…a fix
  • Loading branch information
tomcypher89 committed Jul 13, 2024
1 parent 5b75542 commit cd06953
Show file tree
Hide file tree
Showing 25 changed files with 363 additions and 597 deletions.
2 changes: 1 addition & 1 deletion config/rel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ include $(config_dir)base/base.mk

this_cxxflags += -O3

#this_lint_cmd = $(prorab_lint_cmd_clang_tidy)
this_lint_cmd = $(prorab_lint_cmd_clang_tidy)

# WORKAROUND: on ubuntu jammy dpkg-buildpackage passes -ffat-lto-objects compilation flag
# which is not supported by clang and clang-tidy complains about it:
Expand Down
17 changes: 15 additions & 2 deletions res/main.res
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,24 @@ texture_default_normal{
tex_cube_env_hata{
file_px{envs/hata/px.png}
file_nx{envs/hata/nx.png}
file_py{envs/hata/py.png}
file_ny{envs/hata/ny.png}
file_py{envs/hata/ny.png}
file_ny{envs/hata/py.png}
file_pz{envs/hata/pz.png}
file_nz{envs/hata/nz.png}

min_filter{linear}
mag_filter{linear}
mipmap{nearest}
}

tex_cube_env_castle{
file_px{envs/castle/px.jpg}
file_nx{envs/castle/nx.jpg}
file_py{envs/castle/ny.jpg}
file_ny{envs/castle/py.jpg}
file_pz{envs/castle/pz.jpg}
file_nz{envs/castle/nz.jpg}

min_filter{linear}
mag_filter{linear}
mipmap{nearest}
Expand Down
Binary file added res/samples_gltf/ball.glb
Binary file not shown.
Binary file added res/samples_gltf/ball_bb.glb
Binary file not shown.
Binary file removed res/test/bake.jpg
Binary file not shown.
143 changes: 0 additions & 143 deletions res/test/bake.obj

This file was deleted.

10 changes: 5 additions & 5 deletions src/carcockpit/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ application::application(bool window, std::string_view res_path) :
if (e.combo.key == ruis::key::escape) {
this->quit();
} else if (e.combo.key == ruis::key::space) {
this->toggleCamera();
this->toggle_camera();
} else if (e.combo.key == ruis::key::n) {
this->toggleNormalMapping();
this->toggle_normal_mapping();
}
}
return false;
Expand All @@ -62,16 +62,16 @@ application::application(bool window, std::string_view res_path) :
this->gui.set_root(std::move(kp));
}

void application::toggleCamera()
void application::toggle_camera()
{
cam_toggle = !cam_toggle;
auto car_w = this->gui.get_root().try_get_widget_as<carcockpit::gltf_viewer_widget>("gltf_viewer_widget");
if (car_w) {
car_w->toggleCamera(cam_toggle);
car_w->toggle_camera(cam_toggle);
}
}

void application::toggleNormalMapping()
void application::toggle_normal_mapping()
{
nm_toggle = !nm_toggle;
auto car_w = this->gui.get_root().try_get_widget_as<carcockpit::gltf_viewer_widget>("gltf_viewer_widget");
Expand Down
6 changes: 3 additions & 3 deletions src/carcockpit/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class application : public ruisapp::application
public:
application(bool window, std::string_view res_path);

void toggleCamera();
void toggleNormalMapping();
void toggle_camera();
void toggle_normal_mapping();

static constexpr std::string_view app_name = "carcockpit"sv;

static application& inst()
{
return static_cast<application&>(ruisapp::application::inst());
return dynamic_cast<application&>(ruisapp::application::inst());
}

ruis::render::shader_skybox shader_skybox_v;
Expand Down
Loading

0 comments on commit cd06953

Please sign in to comment.