]> git.localhorst.tv Git - blobs.git/blobdiff - src/app/app.cpp
varying material and schlick/fresnel
[blobs.git] / src / app / app.cpp
index 950eda8cb3610c08e779ea478c578a68abc90c2b..582e62260475f161a583c6a28f85f81078214614 100644 (file)
@@ -39,6 +39,7 @@ void Application::PushState(State *s) {
        ++s->ref_count;
        if (s->ref_count == 1) {
                s->OnEnter();
+               s->OnResize(viewport.Width(), viewport.Height());
        }
        s->OnResume();
 }
@@ -66,6 +67,7 @@ State *Application::SwitchState(State *s_new) {
        }
        if (s_new->ref_count == 1) {
                s_new->OnEnter();
+               s_new->OnResize(viewport.Width(), viewport.Height());
        }
        s_new->OnResume();
        return s_old;
@@ -329,6 +331,12 @@ void Assets::ReadTileTypes(io::TokenStreamReader &in) {
                                in.ReadString(data.tile_types[id].label);
                        } else if (name == "texture") {
                                data.tile_types[id].texture = in.GetInt();
+                       } else if (name == "shiny") {
+                               data.tile_types[id].shiny = in.GetDouble();
+                       } else if (name == "glossy") {
+                               data.tile_types[id].glossy = in.GetDouble();
+                       } else if (name == "metallic") {
+                               data.tile_types[id].metallic = in.GetDouble();
                        } else if (name == "yield") {
                                in.Skip(io::Token::BRACKET_OPEN);
                                while (in.Peek().type != io::Token::BRACKET_CLOSE) {