Ejemplo n.º 1
0
	T* newObject()
	{
		if(!nextFree)
			return 0;
			
		return getFreeObject();
	}
Ejemplo n.º 2
0
	T* newObjectReuse()
	{
		if(!nextFree)
			return &arr[Limit - 1];
		
		return getFreeObject();
	}
Ejemplo n.º 3
0
    T* newObject()
    {
        if(count == limit)
            return 0;

        T* ret = getFreeObject();
        return ret;
    }
Ejemplo n.º 4
0
	T* newObject()
	{
		if(!nextFree)
			return 0;
			
		T* ret = getFreeObject();
		assert(ret->used);
		return ret;
	}
Ejemplo n.º 5
0
    T* newObjectReuse()
    {
        T* ret;
        if(count == limit)
            ret = &arr[limit - 1];
        else
            ret = getFreeObject();

        return ret;
    }
Ejemplo n.º 6
0
	T* newObjectReuse()
	{
		T* ret;
		if(!nextFree)
			ret = &arr[Limit - 1];
		else
			ret = getFreeObject();
			
		assert(ret->used);
		return ret;
	}
Ejemplo n.º 7
0
Object *cloneObject(Object *obj){
    object_t od = getFreeObject();
    if(0 != od){
        Object *o = get_free_object();        /*! panic bug !*/
        if(o){
            memcpy(o,obj,PAGE_SIZE);
            object_table[od] = o;
            o->id = od;
            return o;
        }
    }
    return NULL;
}
Ejemplo n.º 8
0
void MinigameBbAnt::insertSmokeObj(int x, int y) {
	Obj *obj = getFreeObject();
	if (obj) {
		obj->kind = 7;
		obj->x = x;
		obj->y = y;
		obj->priority = 950;
		obj->xIncr = 0x2000;
		obj->yIncr = -0xC000;
		obj->anim = getAnimation(158);
		obj->frameIndex = 0;
		obj->ticks = obj->anim->frameTicks[0];
	}
}
Ejemplo n.º 9
0
void MinigameBbAnt::insertStompObj(int x, int y) {
	Obj *obj = getFreeObject();
	if (obj) {
		obj->kind = 9;
		obj->x = x;
		obj->y = y;
		obj->priority = 2000;
		obj->xIncr = (0x1E0000 * _stompCount - x + 0x140000) / 15;
		obj->yIncr = (0xE60000 - y) / 15;
		obj->anim = getAnimation(130);
		obj->frameIndex = 0;
		obj->ticks = 15;
		_lastStompObj = obj;
		_hasLastStompObj = true;
	}
}
Ejemplo n.º 10
0
void MinigameBbAnt::insertBugSmokeObj(int x, int y, int bugObjIndex) {
	Obj *obj = getFreeObject();
	if (obj) {
		Obj *bugObj = &_objects[bugObjIndex];
		bugObj->hasSmoke = true;
		obj->kind = 7;
		obj->x = x;
		obj->y = y;
		obj->priority = 950;
		if (bugObj->status >= 4 && (bugObj->status <= 6 || bugObj->status == 8)) {
			obj->xIncr = 0;
			obj->yIncr = (-1 << 16);
		} else {
			obj->xIncr = bugObj->xIncr / 8;
			obj->yIncr = bugObj->yIncr / 8;
		}
		obj->anim = getAnimation(158);
		obj->frameIndex = 0;
		obj->ticks = obj->anim->frameTicks[0];
	}
}
Ejemplo n.º 11
0
void MinigameBbAnt::insertBugObj(int kind, int animIndexIncr, int always0, int x, int y, int field30, int always1) {
	Obj *obj = getFreeObject();
	if (obj) {
		const ObjAnimation * const *objKindAnimTable = getObjKindAnimTable(kind);
		obj->field30 = field30;
		obj->animIndexIncr = animIndexIncr;
		obj->kind = kind;
		obj->x = x << 16;
		obj->y = y << 16;
		obj->priority = 610;
		obj->xIncr = kPosIncrTbl1[0].x << 16;
		obj->yIncr = kPosIncrTbl1[0].y << 16;
		obj->anim = objKindAnimTable[0];
		obj->frameIndex = 0;
		obj->ticks = obj->anim->frameTicks[0];
		obj->animIndex = 0;
		obj->status = 1;
		obj->damageCtr = 0;
		obj->hasSmoke = false;
		obj->flag = 0;
		++_bugsCountByKind[kind];
		++_totalBugsCount;
	}
}