]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/common/models/model.qh
#includes: cleanup client
[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(entity this)) {
15         string s = this.model_str();
16         if (s != "" && s != "null" && !fexists(s)) {
17             LOG_WARNINGF("Missing model: \"%s\"\n", s);
18             return;
19         }
20         LOG_TRACEF("precache_model(\"%s\")\n", s);
21         precache_model(s);
22     }
23 ENDCLASS(Model)
24
25 #endif