void Scene_AddSkyObj (sceneobj_t *skyobj) { scenelist_t *newobj; newobj = (scenelist_t*)Scene_FramePool_Alloc(sizeof(scenelist_t)); if (!newobj) return; // Case: if the is a uniform scale, we will use that instead. (to maintain compatibility) if (skyobj->scale != 1.f) M_SetVec3(skyobj->scaleVec, skyobj->scale, skyobj->scale, skyobj->scale); Mem_Copy(newobj, skyobj, sizeof(sceneobj_t)); newobj->next = skylist; newobj->obj.flags |= SCENEOBJ_SKYBOX; //Vid_NormalizeColor(skyobj->color, newobj->obj.color); if (!(skyobj->flags & SCENEOBJ_USE_AXIS)) { //fill in axis M_GetAxis(skyobj->angle[0], skyobj->angle[1], skyobj->angle[2], newobj->obj.axis); } skylist = newobj; }
void Scene_AddFxObject (sceneobj_t *scobj) { scenelist_t *newobj; OVERHEAD_INIT; newobj = (scenelist_t*)Scene_FramePool_Alloc(sizeof(scenelist_t)); if (!newobj) return; // Case: if the is a uniform scale, we will use that instead. (to maintain compatibility) if (scobj->scale != 1.f) M_SetVec3(scobj->scaleVec, scobj->scale, scobj->scale, scobj->scale); memcpy(&newobj->obj, scobj, sizeof(sceneobj_t)); if (!(scobj->flags & SCENEOBJ_USE_AXIS)) M_GetAxis(scobj->angle[0], scobj->angle[1], scobj->angle[2], newobj->obj.axis); newobj->cull = false; newobj->next = NULL; switch(scobj->objtype) { case OBJTYPE_BILLBOARD: case OBJTYPE_BILLBOARDLIT: case OBJTYPE_HELIX: case OBJTYPE_BEAM: case OBJTYPE_BEAMLIGHTNING: /*if(spriteListShader[newobj->obj.shader]) { newobj->next = spriteListShader[newobj->obj.shader]->next; spriteListShader[newobj->obj.shader]->next = newobj; } else { spritefxlist.push_front(newobj); spriteListShader[newobj->obj.shader] = newobj; }*/ spritefxlist.push_front(newobj); break; default: /* if (sceneListShader[newobj->obj.shader]) { newobj->next = sceneListShader[newobj->obj.shader]->next; sceneListShader[newobj->obj.shader]->next = newobj; } */ newobj->next = scenefxlist; scenefxlist = newobj; break; } OVERHEAD_COUNT(OVERHEAD_ADD_SCENEOBJ); }
void Scene_AddStaticObject(sceneobj_t *scobj) { if(staticObjectCount<MAX_STATICOBJECTS) { if (scobj->scale != 1.f) M_SetVec3(scobj->scaleVec, scobj->scale, scobj->scale, scobj->scale); memcpy(&staticObjectPool[staticObjectCount], scobj, sizeof(sceneobj_t)); if (!(scobj->flags & SCENEOBJ_USE_AXIS)) M_GetAxis(scobj->angle[0], scobj->angle[1], scobj->angle[2], staticObjectPool[staticObjectCount].axis); staticObjectCount++; } }
void M_ConvertVec3FixedToVec3(v3double_t *dest, const v3fixed_t *src) { M_SetVec3(dest, src->x, src->y, src->z); }