4 #define setmodel(e, m) _setmodel((e), (m).model_str())
7 REGISTER_REGISTRY(RegisterModels)
10 ATTRIB(Model, m_id, int, 0)
11 ATTRIB(Model, model_str, string(), func_null)
12 CONSTRUCTOR(Model, string() path)
15 this.model_str = path;
17 METHOD(Model, model_precache, void(entity this)) {
18 string s = this.model_str();
19 if (s != "" && s != "null" && !fexists(s)) {
20 LOG_WARNINGF("Missing model: \"%s\"\n", s);
23 LOG_TRACEF("precache_model(\"%s\")\n", s);
28 #define MODEL(name, path) \
29 string MDL_##name##_get() { return path; } \
30 REGISTER(RegisterModels, MDL, Models, Models_COUNT, name, m_id, NEW(Model, MDL_##name##_get))
32 STATIC_INIT(RegisterModels_precache) {
33 FOREACH(Models, true, LAMBDA({
34 it.model_precache(it);