summaryrefslogtreecommitdiff
path: root/src/game/decos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/decos.cpp')
-rw-r--r--src/game/decos.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/game/decos.cpp b/src/game/decos.cpp
index ae103ef..7f81bbb 100644
--- a/src/game/decos.cpp
+++ b/src/game/decos.cpp
@@ -31,27 +31,17 @@ static const struct {
}
};
-deco_t::deco_t(game::state_t *game_, deco_type_t type_) : entity_t(ET_DECO)
+deco_t::deco_t(game::state_t *game_, deco_type_t type_) : game::entity_t(game_, ET_DECO)
{
- game = game_;
type = type_;
-}
-
-void deco_t::spawn(world::world_t *world, v2f_t x)
-{
- v2f_t center, offset;
- offset[0] = world->perlin.get(x, 0.17331f);
- offset[1] = world->perlin.get(x, 0.19571f);
- center = x + v2f_t(0.5f, 0.5f) + offset.norm() * 0.1;
-
- cmodel.bounds[0] = center + decos[type].mins;
- cmodel.bounds[1] = center + decos[type].maxs;
+ size[0] = decos[type].mins;
+ size[1] = decos[type].maxs;
+ render_size[0] = decos[type].render_mins;
+ render_size[1] = decos[type].render_maxs;
cmodel.cflags = decos[type].cflags;
- render_bounds[0] = center + decos[type].render_mins;
- render_bounds[1] = center + decos[type].render_maxs;
- link(world);
}
+
void deco_t::render_to(render::state_t *render)
{
render->render(game->now * decos[type].fps + phase_shift,