]> git.tdb.fi Git - libs/game.git/commitdiff
Adjust Bassteroids for the lighting changes
authorMikko Rasa <tdb@tdb.fi>
Sat, 28 Jan 2023 20:54:12 +0000 (22:54 +0200)
committerMikko Rasa <tdb@tdb.fi>
Sat, 28 Jan 2023 20:55:12 +0000 (22:55 +0200)
examples/bassteroids/data/main.camera.setup
examples/bassteroids/data/space.lightn [deleted file]
examples/bassteroids/data/space.seq [deleted file]
examples/bassteroids/data/sun.light [deleted file]
examples/bassteroids/data/sun.light.setup [new file with mode: 0644]
examples/bassteroids/source/bassteroids.cpp
examples/bassteroids/source/bassteroids.h

index b8020f286b32bd16a83771a9ac5c296b5aeca62f..5012d2c69d5b5306ca884ed054081504c4c20895 100644 (file)
@@ -2,4 +2,3 @@ field_of_view_y 0;
 size 80 45;
 near_clip -30;
 far_clip 30;
-sequence_name "space.seq";
diff --git a/examples/bassteroids/data/space.lightn b/examples/bassteroids/data/space.lightn
deleted file mode 100644 (file)
index a7342bf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-light "sun.light";
diff --git a/examples/bassteroids/data/space.seq b/examples/bassteroids/data/space.seq
deleted file mode 100644 (file)
index 730a3fd..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-hdr true;
-clear;
-renderable "content";
-step "" "content"
-{
-       depth_test LEQUAL;
-       lighting "space.lightn";
-};
-postprocessor
-{
-       type bloom;
-};
-postprocessor
-{
-       type colorcurve;
-       srgb;
-};
diff --git a/examples/bassteroids/data/sun.light b/examples/bassteroids/data/sun.light
deleted file mode 100644 (file)
index 822e8da..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-type directional;
-direction 0.1 -0.1 -1.0;
-color 2.0 2.0 2.0;
diff --git a/examples/bassteroids/data/sun.light.setup b/examples/bassteroids/data/sun.light.setup
new file mode 100644 (file)
index 0000000..8edd131
--- /dev/null
@@ -0,0 +1,2 @@
+type DIRECTIONAL;
+intensity 2.0;
index e443d5e35cc830bd28d570001452ef1eae8ccea8..709b1a1c30be79936787e8bbb298f5ab386b2a6b 100644 (file)
@@ -25,7 +25,9 @@ Bassteroids::Bassteroids(int, char **):
        pf_setup({ .size={ 80, 45 }}),
        playfield(game_stage.get_root(), pf_setup),
        cam_entity(game_stage.get_root(), Game::TransformValues()),
-       camera(cam_entity, resources.get<Game::CameraSetup>("main.camera.setup"))
+       camera(cam_entity, resources.get<Game::CameraSetup>("main.camera.setup")),
+       sun_entity(game_stage.get_root(), Game::TransformValues()),
+       sun(sun_entity, resources.get<Game::LightSetup>("sun.light.setup"))
 {
        game_stage.add_system<GameController>();
        game_stage.add_system<Physics>();
@@ -36,6 +38,9 @@ Bassteroids::Bassteroids(int, char **):
 
        player_input.set_control_scheme_type<Controls>(GameView::PlayerInput::ONE_LOCAL_PLAYER);
 
+       sun_entity->get_transform()->set_rotation(Geometry::Quaternion<float>::rotation(
+               LinAl::Vector<float, 3>(0.0f, 0.0f, -1.0f), LinAl::Vector<float, 3>(0.1f, -0.1f, -1.0f)));
+
        director.activate_stage(game_stage);
 }
 
index f3eabdd0858fc39a9f2cbdfa7b6ae70e33d09ed5..4e742cab1e57a3b80cdb153ea0621dad8d730ea0 100644 (file)
@@ -2,6 +2,7 @@
 #define BASSTEROIDS_H_
 
 #include <msp/game/camera.h>
+#include <msp/game/light.h>
 #include <msp/game/owned.h>
 #include <msp/game/resources.h>
 #include <msp/gameview/application.h>
@@ -28,6 +29,8 @@ private:
 
        Msp::Game::Owned<Msp::Game::Entity> cam_entity;
        Msp::Game::Owned<Msp::Game::Camera> camera;
+       Msp::Game::Owned<Msp::Game::Entity> sun_entity;
+       Msp::Game::Owned<Msp::Game::Light> sun;
 
 public:
        Bassteroids(int, char **);