Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rendermodel.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "inexor/shared/cube_types.hpp" // for string
3 #include "inexor/shared/cube_vector.hpp" // for vector
4 #include "inexor/model/model.hpp"
5 
6 struct model;
7 struct occludequery;
8 
9 struct mapmodelinfo { string name; model *m; };
10 
11 extern void findanims(const char *pattern, vector<int> &anims);
12 extern mapmodelinfo *getmminfo(int i);
13 extern void startmodelquery(occludequery *query);
14 extern void endmodelquery();
15 
16 extern void preloadusedmapmodels(bool msg = false, bool bih = false);
17 
18 static inline model *loadmapmodel(int n)
19 {
21  if(mapmodels.inrange(n))
22  {
23  model *m = mapmodels[n].m;
24  return m ? m : loadmodel(nullptr, n);
25  }
26  return nullptr;
27 }
Definition: model.hpp:40
void endmodelquery()
Definition: rendermodel.cpp:755
vector< mapmodelinfo > mapmodels
Definition: rendermodel.cpp:383
void startmodelquery(occludequery *query)
Definition: rendermodel.cpp:750
bool inrange(size_t i) const
safety check: tests if index i exists in this vector
Definition: cube_vector.hpp:123
Definition: octree.hpp:101
Definition: rendermodel.hpp:9
mapmodelinfo * getmminfo(int i)
Definition: rendermodel.cpp:403
string name
Definition: rendermodel.hpp:9
model * loadmodel(const char *name, int i=-1, bool msg=false)
Definition: rendermodel.cpp:468
void preloadusedmapmodels(bool msg=false, bool bih=false)
Definition: rendermodel.cpp:440
static model * loadmapmodel(int n)
Definition: rendermodel.hpp:18
model * m
Definition: rendermodel.hpp:9
void findanims(const char *pattern, vector< int > &anims)
Definition: rendermodel.cpp:1066