From 415cbb44d031e0a348d937c917c629913da0afce Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Fri, 18 Jul 2008 10:59:23 +0000 Subject: parse engine sound from .map model --- src/model/map.cc | 13 ++++++++++++- src/model/model.cc | 1 + src/model/model.h | 5 +++++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'src/model') diff --git a/src/model/map.cc b/src/model/map.cc index 39e2b9c..972ae82 100644 --- a/src/model/map.cc +++ b/src/model/map.cc @@ -39,14 +39,25 @@ Model * Map::load(std::string const &name) if (mapfile.got_classname("worldspawn")) { + // new wordspawn + + } else if (mapfile.classname().compare("worldspawn") == 0 ) { + + // worldspawn attributes + if (mapfile.got_key_int("enginesound", u)) { + model->model_enginesound = u; + continue; + } + } else if (mapfile.got_classname("light")) { + // new light light = new Light(); model->add_light(light); } else if (mapfile.classname().compare("light") == 0 ) { - // light attributes + // light attributes if (mapfile.got_key_vector3f("origin", light->light_location)) { light->light_location *= SCALE; continue; diff --git a/src/model/model.cc b/src/model/model.cc index 6508fdf..2e9f0ba 100644 --- a/src/model/model.cc +++ b/src/model/model.cc @@ -29,6 +29,7 @@ Model::Model(std::string const & name) : model_lvertex_countdetail = 0; model_radius = 0.5f; + model_enginesound = 0; } Model::~Model() diff --git a/src/model/model.h b/src/model/model.h index cb1352f..d2b7d65 100644 --- a/src/model/model.h +++ b/src/model/model.h @@ -70,6 +70,9 @@ public: /// number of detail evertices in this model inline size_t lvertex_detail() const { return model_lvertex_countdetail; } + /// engine sound loop for this model + inline unsigned int enginesound() const { return model_enginesound; } + /// total number of triangles in this model size_t tris() const; @@ -115,6 +118,8 @@ public: size_t model_lvertex_count; size_t model_lvertex_countdetail; + unsigned int model_enginesound; + /* ---- static functions for the Model registry -------------------- */ /// the Model registry -- cgit v1.2.3