modmdlpickupN - load custom pickup models via cubescript (plz review/test)

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7201 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2013-02-14 12:54:12 +00:00
parent d17be6e153
commit 5be04a9c06
3 changed files with 46 additions and 25 deletions
+15 -11
View File
@@ -5,18 +5,22 @@
vector<entity> ents;
vector<int> eh_ents; // edithide entities
const char *entmdlnames[] =
{
"pickups/pistolclips", "pickups/ammobox", "pickups/nade", "pickups/health", "pickups/helmet", "pickups/kevlar", "pickups/akimbo", "pickups/nades", //FIXME
};
{
"pistolclips", "ammobox", "nade", "health", "helmet", "kevlar", "akimbo", "nades", //FIXME
};
void renderent(entity &e)
{
/* FIXME: if the item list change, this hack will be messed */
const char *mdlname = entmdlnames[e.type-I_CLIPS+(m_lss && e.type==I_GRENADE ? 5:0)];
float z = (float)(1+sinf(lastmillis/100.0f+e.x+e.y)/20),
yaw = lastmillis/10.0f;
rendermodel(mdlname, ANIM_MAPMODEL|ANIM_LOOP|ANIM_DYNALLOC, 0, 0, vec(e.x, e.y, z+S(e.x, e.y)->floor+e.attr1), yaw, 0);
}
void renderent(entity &e)
{
/* FIXME: if the item list change, this hack will be messed */
defformatstring(widn)("modmdlpickup%d", e.type-3);
defformatstring(mdlname)("pickups/%s", identexists(widn)?getalias(widn):
entmdlnames[e.type-I_CLIPS+(m_lss && e.type==I_GRENADE ? 5:0)]);
float z = (float)(1+sinf(lastmillis/100.0f+e.x+e.y)/20), yaw = lastmillis/10.0f;
rendermodel(mdlname, ANIM_MAPMODEL|ANIM_LOOP|ANIM_DYNALLOC, 0, 0, vec(e.x, e.y, z+S(e.x, e.y)->floor+e.attr1), yaw, 0);
}
void renderclip(entity &e)
{