Replaced objlist_class with std::vector.

Fixed minor bug in TLightGroup.
Cleaned up some warnings.
This commit is contained in:
Muzychenko Andrey committed 2021-10-01 18:55:44 +03:00
1 parent 8a421a2623
commit 81c2034a16
54 files changed
+249 -453

No files matched your search

+5 -14
View File
@@ -2,17 +2,15 @@
#include "TCollisionComponent.h"
#include "loader.h"
#include "maths.h"
#include "objlist_class.h"
#include "TEdgeSegment.h"
#include "TPinballTable.h"
TCollisionComponent::TCollisionComponent(TPinballTable* table, int groupIndex, bool createWall) : TPinballComponent(
table, groupIndex, true)
TCollisionComponent::TCollisionComponent(TPinballTable* table, int groupIndex, bool createWall) :
TPinballComponent(table, groupIndex, true)
{
visualStruct visual{};
EdgeList = new objlist_class<TEdgeSegment>(4, 4);
ActiveFlag = 1;
if (GroupName != nullptr)
UnusedBaseFlag = 1;
@@ -42,22 +40,15 @@ TCollisionComponent::TCollisionComponent(TPinballTable* table, int groupIndex, b
TCollisionComponent::~TCollisionComponent()
{
for (TEdgeSegment* edge; EdgeList->GetCount() > 0;)
{
edge = EdgeList->Get(0);
EdgeList->Delete(edge);
for (auto edge : EdgeList)
delete edge;
}
delete EdgeList;
}
void TCollisionComponent::port_draw()
{
for (int index = EdgeList->GetCount() - 1; index >= 0; index--)
{
EdgeList->Get(index)->port_draw();
}
for (auto edge : EdgeList)
edge->port_draw();
}
int TCollisionComponent::DefaultCollision(TBall* ball, vector_type* nextPosition, vector_type* direction)