From 462cb9fc40ae7fec26615c652e95991be89ea8ae Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 7 Jun 2019 20:18:04 +0300 Subject: [PATCH] Put everything in namespace Msp::DemoScene --- source/action.cpp | 6 +++++- source/action.h | 6 ++++++ source/animate.cpp | 7 ++++++- source/animate.h | 6 ++++++ source/beatcounter.cpp | 6 +++++- source/beatcounter.h | 6 ++++++ source/colorfade.cpp | 6 +++++- source/colorfade.h | 6 ++++++ source/demo.cpp | 7 ++++++- source/demo.h | 6 ++++++ source/fadeoverlay.cpp | 7 ++++++- source/fadeoverlay.h | 6 ++++++ source/launcher.cpp | 7 ++++++- source/launcher.h | 6 ++++++ source/launchscreen.cpp | 6 +++++- source/launchscreen.h | 6 ++++++ source/resources.cpp | 7 ++++++- source/resources.h | 6 ++++++ source/sequencer.cpp | 7 ++++++- source/sequencer.h | 6 ++++++ source/stage.cpp | 7 ++++++- source/stage.h | 6 ++++++ 22 files changed, 128 insertions(+), 11 deletions(-) diff --git a/source/action.cpp b/source/action.cpp index 16201aa..de3b08a 100644 --- a/source/action.cpp +++ b/source/action.cpp @@ -1,6 +1,7 @@ #include "action.h" -using namespace Msp; +namespace Msp { +namespace DemoScene { InterpolationAction::InterpolationAction(Mode m): mode(m), @@ -43,3 +44,6 @@ Action::Loader::Loader(Action &a, Demo &d): DataFile::ObjectLoader(a), demo(d) { } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/action.h b/source/action.h index f43d4e1..dacf788 100644 --- a/source/action.h +++ b/source/action.h @@ -3,6 +3,9 @@ #include +namespace Msp { +namespace DemoScene { + class Demo; class Action @@ -51,4 +54,7 @@ public: virtual void interpolate(float, float) { } }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/animate.cpp b/source/animate.cpp index d74c239..f30281d 100644 --- a/source/animate.cpp +++ b/source/animate.cpp @@ -2,7 +2,9 @@ #include "demo.h" using namespace std; -using namespace Msp; + +namespace Msp { +namespace DemoScene { Animate::Animate(): target(0), @@ -50,3 +52,6 @@ void Animate::Loader::target(const string &n) { obj.target = &demo.get_thing(n); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/animate.h b/source/animate.h index d386a7a..31d1641 100644 --- a/source/animate.h +++ b/source/animate.h @@ -5,6 +5,9 @@ #include #include "action.h" +namespace Msp { +namespace DemoScene { + class Animate: public Action { public: @@ -32,4 +35,7 @@ public: virtual void start(float, float); }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/beatcounter.cpp b/source/beatcounter.cpp index e984034..d914c20 100644 --- a/source/beatcounter.cpp +++ b/source/beatcounter.cpp @@ -1,7 +1,8 @@ #include #include "beatcounter.h" -using namespace Msp; +namespace Msp { +namespace DemoScene { BeatCounter::BeatCounter(Resources &resources): text(resources.get_ui_font(), &resources.get_ui_text_technique()), @@ -20,3 +21,6 @@ void BeatCounter::render(GL::Renderer &renderer, const GL::Tag &tag) const { instance.render(renderer, tag); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/beatcounter.h b/source/beatcounter.h index 2a12e52..98af61b 100644 --- a/source/beatcounter.h +++ b/source/beatcounter.h @@ -8,6 +8,9 @@ #include "resources.h" #include "action.h" +namespace Msp { +namespace DemoScene { + class BeatCounter: public Msp::GL::Renderable, public Action { private: @@ -24,4 +27,7 @@ public: virtual void render(Msp::GL::Renderer &, const Msp::GL::Tag &) const; }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/colorfade.cpp b/source/colorfade.cpp index edfd1e0..bebc980 100644 --- a/source/colorfade.cpp +++ b/source/colorfade.cpp @@ -1,6 +1,7 @@ #include "colorfade.h" -using namespace Msp; +namespace Msp { +namespace DemoScene { ColorFadeAction::ColorFadeAction(const GL::Color &c): InterpolationAction(HERMITE), @@ -23,3 +24,6 @@ void ColorFadeAction::interpolate(float t, float) c.a = start_color.a*(1-t)+end_color.a*t; set_color(c); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/colorfade.h b/source/colorfade.h index 3b87513..7ddd9b5 100644 --- a/source/colorfade.h +++ b/source/colorfade.h @@ -4,6 +4,9 @@ #include #include "action.h" +namespace Msp { +namespace DemoScene { + class ColorFadeAction: public InterpolationAction { protected: @@ -19,4 +22,7 @@ public: virtual void set_color(const Msp::GL::Color &) = 0; }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/demo.cpp b/source/demo.cpp index c545685..c15d513 100644 --- a/source/demo.cpp +++ b/source/demo.cpp @@ -3,7 +3,9 @@ #include "stage.h" using namespace std; -using namespace Msp; + +namespace Msp { +namespace DemoScene { Demo::Demo(Graphics::Window &window, Graphics::GLContext &gl_ctx, DataFile::Collection &r): resources(r), @@ -96,3 +98,6 @@ void Demo::AnimationAction::tick(float, float d) { player.tick(d*Time::sec); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/demo.h b/source/demo.h index 35be624..b4adb37 100644 --- a/source/demo.h +++ b/source/demo.h @@ -13,6 +13,9 @@ #include "action.h" #include "sequencer.h" +namespace Msp { +namespace DemoScene { + class Stage; class Demo @@ -79,4 +82,7 @@ T &Demo::get_thing(const std::string &name) return *get_item(things, name).value(); } +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/fadeoverlay.cpp b/source/fadeoverlay.cpp index ab069c3..ee7ca7f 100644 --- a/source/fadeoverlay.cpp +++ b/source/fadeoverlay.cpp @@ -4,9 +4,11 @@ #include "demo.h" #include "fadeoverlay.h" -using namespace Msp; using namespace std; +namespace Msp { +namespace DemoScene { + FadeOverlay::FadeOverlay(DataFile::Collection &resources): mesh(get_fullscreen_quad()), shprog(resources.get("fade.glsl")), @@ -63,3 +65,6 @@ void FadeOverlay::Fade::Loader::color(float r, float g, float b, float a) { obj.end_color = GL::Color(r, g, b, a); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/fadeoverlay.h b/source/fadeoverlay.h index e427c4e..a0b365b 100644 --- a/source/fadeoverlay.h +++ b/source/fadeoverlay.h @@ -9,6 +9,9 @@ #include "colorfade.h" #include "sequencer.h" +namespace Msp { +namespace DemoScene { + class FadeOverlay: public Msp::GL::PostProcessor { public: @@ -52,4 +55,7 @@ public: virtual void render(Msp::GL::Renderer &, const Msp::GL::Texture2D &, const Msp::GL::Texture2D &); }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/launcher.cpp b/source/launcher.cpp index 2b53c18..bad077d 100644 --- a/source/launcher.cpp +++ b/source/launcher.cpp @@ -10,7 +10,9 @@ #include "launchscreen.h" using namespace std; -using namespace Msp; + +namespace Msp { +namespace DemoScene { LauncherBase::Options::Options(Graphics::Display &dpy, int argc, char **argv): start_fullscreen(-1), @@ -214,3 +216,6 @@ void LauncherBase::key_press(unsigned key) else if(key==Input::KEY_ESC) exit(0); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/launcher.h b/source/launcher.h index c1dc33a..54e6eda 100644 --- a/source/launcher.h +++ b/source/launcher.h @@ -13,6 +13,9 @@ #include #include "resources.h" +namespace Msp { +namespace DemoScene { + class Demo; class LaunchScreen; @@ -81,4 +84,7 @@ protected: virtual void exit(int c) { Msp::Application::exit(c); } }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/launchscreen.cpp b/source/launchscreen.cpp index 972b311..ccf2101 100644 --- a/source/launchscreen.cpp +++ b/source/launchscreen.cpp @@ -4,7 +4,8 @@ #include #include "launchscreen.h" -using namespace Msp; +namespace Msp { +namespace DemoScene { LaunchScreen::LaunchScreen(Resources &resources): font(resources.get_ui_font()), @@ -47,3 +48,6 @@ void LaunchScreen::render() renderer.transform(GL::Matrix::translation(0, -1.2, 0)); esc_prompt.render(renderer); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/launchscreen.h b/source/launchscreen.h index e4c737f..2571012 100644 --- a/source/launchscreen.h +++ b/source/launchscreen.h @@ -7,6 +7,9 @@ #include #include "resources.h" +namespace Msp { +namespace DemoScene { + class LaunchScreen { private: @@ -26,4 +29,7 @@ public: void render(); }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/resources.cpp b/source/resources.cpp index e5e893d..1742f06 100644 --- a/source/resources.cpp +++ b/source/resources.cpp @@ -3,7 +3,9 @@ #include "resources.h" using namespace std; -using namespace Msp; + +namespace Msp { +namespace DemoScene { Resources::Resources(const string &pack_name): ui_font(0), @@ -46,3 +48,6 @@ void Resources::set_ui_text_resources(const string &font, const string &tech) ui_font = &get(font); ui_text_technique = &get(tech); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/resources.h b/source/resources.h index 63dee76..bb86933 100644 --- a/source/resources.h +++ b/source/resources.h @@ -7,6 +7,9 @@ #include #include +namespace Msp { +namespace DemoScene { + class Resources: public Msp::GL::Resources { private: @@ -24,4 +27,7 @@ public: void set_ui_text_resources(const std::string &, const std::string &); }; +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/sequencer.cpp b/source/sequencer.cpp index 0297c43..5aa0823 100644 --- a/source/sequencer.cpp +++ b/source/sequencer.cpp @@ -7,7 +7,9 @@ #include "stage.h" using namespace std; -using namespace Msp; + +namespace Msp { +namespace DemoScene { Sequencer::Sequencer(float bpm): started(false), @@ -194,3 +196,6 @@ void Sequencer::SegmentLoader::apply(const string &n) { obj.add_action(*get_item(obj.named_actions, n), start_beat, end_beat); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/sequencer.h b/source/sequencer.h index f813717..6e98402 100644 --- a/source/sequencer.h +++ b/source/sequencer.h @@ -10,6 +10,9 @@ #include #include "action.h" +namespace Msp { +namespace DemoScene { + class Demo; class Sequencer @@ -179,4 +182,7 @@ void Sequencer::SegmentLoader::action() obj.anonymous_actions.push_back(act.release()); } +} // namespace DemoScene +} // namespace Msp + #endif diff --git a/source/stage.cpp b/source/stage.cpp index 0ca5c5e..b6c456e 100644 --- a/source/stage.cpp +++ b/source/stage.cpp @@ -3,7 +3,9 @@ #include "stage.h" using namespace std; -using namespace Msp; + +namespace Msp { +namespace DemoScene { Stage::Stage(): pipeline(0), @@ -120,3 +122,6 @@ void Stage::SetCamera::Loader::camera(const string &n) { obj.camera = &demo.get_resources().get(n); } + +} // namespace DemoScene +} // namespace Msp diff --git a/source/stage.h b/source/stage.h index 7d4664f..1d20bda 100644 --- a/source/stage.h +++ b/source/stage.h @@ -6,6 +6,9 @@ #include "action.h" #include "demo.h" +namespace Msp { +namespace DemoScene { + class Stage { public: @@ -79,4 +82,7 @@ protected: virtual void create_pipeline(Msp::GL::View &) = 0; }; +} // namespace DemoScene +} // namespace Msp + #endif -- 2.45.2