From b001514ccc52971534a912b5be93ddce2d4187e9 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 19 May 2025 14:13:10 +0200 Subject: [PATCH] rogueviz::nilrider:: added missing updates to nilrider.h, using hr::lerp and BRICK guard --- rogueviz/nilrider/nilrider.h | 8 ++++++-- rogueviz/nilrider/statues.cpp | 2 ++ rogueviz/nilrider/timestamp.cpp | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rogueviz/nilrider/nilrider.h b/rogueviz/nilrider/nilrider.h index 97bc30d5..b1166d30 100644 --- a/rogueviz/nilrider/nilrider.h +++ b/rogueviz/nilrider/nilrider.h @@ -115,12 +115,15 @@ struct checkerparam { using goalchecker = std::function; +using star_awarder = std::function; + struct goal { color_t color; string desc; goalchecker check; string achievement_name; string leaderboard_name; + star_awarder sa; }; using surface_fun = std::function; @@ -136,6 +139,7 @@ struct level { char hotkey; string longdesc; flagtype flags; + int stars_needed; ld minx, miny, maxx, maxy; vector map_tiles; ld startx, starty; @@ -145,8 +149,8 @@ struct level { bool initialized; - level(string name, char hotkey, flagtype flags, string longdesc, ld minx, ld miny, ld maxx, ld maxy, const vector& mt, ld sx, ld sy, const vector subs, const std::function& surf, vector g) : - name(name), hotkey(hotkey), longdesc(longdesc), flags(flags), minx(minx), miny(miny), maxx(maxx), maxy(maxy), map_tiles(mt), startx(sx), starty(sy), sublevels(subs), surface(surf), goals(g) { + level(string name, char hotkey, flagtype flags, int sneed, string longdesc, ld minx, ld miny, ld maxx, ld maxy, const vector& mt, ld sx, ld sy, const vector subs, const std::function& surf, vector g) : + name(name), hotkey(hotkey), longdesc(longdesc), flags(flags), stars_needed(sneed), minx(minx), miny(miny), maxx(maxx), maxy(maxy), map_tiles(mt), startx(sx), starty(sy), sublevels(subs), surface(surf), goals(g) { initialized = false; unil_texture = nullptr; unil_texture_stepped = nullptr; diff --git a/rogueviz/nilrider/statues.cpp b/rogueviz/nilrider/statues.cpp index 45b354da..ed706452 100644 --- a/rogueviz/nilrider/statues.cpp +++ b/rogueviz/nilrider/statues.cpp @@ -6,6 +6,7 @@ namespace bricks { extern void build(bool in_pair); #if !NILRIDER + #ifndef BRICK struct brick { euc::coord co; color_t col; @@ -14,6 +15,7 @@ namespace bricks { hpcshape shRotWall[6]; }; #endif + #endif extern vector bricks; } diff --git a/rogueviz/nilrider/timestamp.cpp b/rogueviz/nilrider/timestamp.cpp index 5b27ca83..1638df1d 100644 --- a/rogueviz/nilrider/timestamp.cpp +++ b/rogueviz/nilrider/timestamp.cpp @@ -1,5 +1,7 @@ namespace nilrider { +using hr::lerp; + ld timestamp::energy_in_squares() { return vel * vel / (2 * gravity); } /** convert rotationally symmetric to internal model */