GL - Call by reference instead
This commit is contained in:
parent
06ddb86b17
commit
484b055338
|
@ -58,10 +58,10 @@ namespace GameLogic
|
||||||
Oyster::Math::Float3 GetScale() override;
|
Oyster::Math::Float3 GetScale() override;
|
||||||
Oyster::Math::Float4x4 GetOrientation() override;
|
Oyster::Math::Float4x4 GetOrientation() override;
|
||||||
int GetID() const override;
|
int GetID() const override;
|
||||||
ObjectSpecialType GetObjectType() const override;
|
ObjectSpecialType GetObjectType() const override;
|
||||||
int getNrOfDynamicObj()const override;
|
int getNrOfDynamicObj()const override;
|
||||||
IObjectData* GetObjectAt(int ID) const override;
|
IObjectData* GetObjectAt(int ID) const override;
|
||||||
Utility::DynamicMemory::DynamicArray<IObjectData*> GetAllDynamicObjects() const override;
|
void GetAllDynamicObjects(Utility::DynamicMemory::DynamicArray<IObjectData*>& mem) const override;
|
||||||
|
|
||||||
Level *level;
|
Level *level;
|
||||||
};
|
};
|
||||||
|
|
|
@ -108,7 +108,7 @@ namespace GameLogic
|
||||||
public:
|
public:
|
||||||
virtual int getNrOfDynamicObj()const = 0;
|
virtual int getNrOfDynamicObj()const = 0;
|
||||||
virtual IObjectData* GetObjectAt(int ID) const = 0;
|
virtual IObjectData* GetObjectAt(int ID) const = 0;
|
||||||
virtual Utility::DynamicMemory::DynamicArray<IObjectData*> GetAllDynamicObjects() const = 0;
|
virtual void GetAllDynamicObjects(Utility::DynamicMemory::DynamicArray<IObjectData*>& destMem) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
class DANBIAS_GAMELOGIC_DLL GameAPI
|
class DANBIAS_GAMELOGIC_DLL GameAPI
|
||||||
|
|
|
@ -52,14 +52,10 @@ IObjectData* Game::LevelData::GetObjectAt(int ID) const
|
||||||
return this->level->GetObj(ID);
|
return this->level->GetObj(ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utility::DynamicMemory::DynamicArray<IObjectData*> Game::LevelData::GetAllDynamicObjects() const
|
void Game::LevelData::GetAllDynamicObjects(Utility::DynamicMemory::DynamicArray<IObjectData*>& mem) const
|
||||||
{
|
{
|
||||||
Utility::DynamicMemory::DynamicArray<IObjectData*> objects(level->dynamicObjects.Size());
|
|
||||||
|
|
||||||
for(int i = 0; i < level->dynamicObjects.Size(); i++)
|
for(int i = 0; i < level->dynamicObjects.Size(); i++)
|
||||||
{
|
{
|
||||||
objects[i] = level->dynamicObjects[i];
|
mem[i] = level->dynamicObjects[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return objects;
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue