]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/models/model.qh
Merge remote-tracking branch 'origin/terencehill/count_fill_optimization'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / models / model.qh
1 #ifndef MODEL_H
2 #define MODEL_H
3
4 #define setmodel(e, m) _setmodel((e), (m).model_str())
5
6 CLASS(Model, Object)
7     ATTRIB(Model, m_id, int, 0)
8     ATTRIB(Model, model_str, string(), func_null)
9     CONSTRUCTOR(Model, string() path)
10     {
11         CONSTRUCT(Model);
12         this.model_str = path;
13     }
14     METHOD(Model, model_precache, void(Model this))
15     {
16         TC(Model, this);
17         string s = this.model_str();
18         if (s != "" && s != "null" && !fexists(s)) {
19             LOG_WARNINGF("Missing model: \"%s\"\n", s);
20             return;
21         }
22         profile(sprintf("precache_model(\"%s\")\n", s));
23         precache_model(s);
24     }
25 ENDCLASS(Model)
26
27 #endif