mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 20:57:18 +01:00
Remvoed the PropagationEntry struct.
This commit is contained in:
parent
cc921370ce
commit
e7b3819103
@ -230,13 +230,11 @@ void WaveFormCollapse::propagate() {
|
|||||||
while (propagating.size() != 0) {
|
while (propagating.size() != 0) {
|
||||||
// The cell and pattern that has been set to false.
|
// The cell and pattern that has been set to false.
|
||||||
|
|
||||||
const PropagatingEntry &e = propagating[propagating.size() - 1];
|
uint32_t y1 = propagating[propagating.size() - 1];
|
||||||
|
uint32_t x1 = propagating[propagating.size() - 2];
|
||||||
|
uint32_t pattern = propagating[propagating.size() - 3];
|
||||||
|
|
||||||
uint32_t y1 = e.data[0];
|
propagating.resize(propagating.size() - 3);
|
||||||
uint32_t x1 = e.data[1];
|
|
||||||
uint32_t pattern = e.data[2];
|
|
||||||
|
|
||||||
propagating.resize(propagating.size() - 1);
|
|
||||||
|
|
||||||
// We propagate the information in all 4 directions.
|
// We propagate the information in all 4 directions.
|
||||||
for (uint32_t direction = 0; direction < 4; direction++) {
|
for (uint32_t direction = 0; direction < 4; direction++) {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "array_2d.h"
|
#include "array_2d.h"
|
||||||
#include "array_3d.h"
|
#include "array_3d.h"
|
||||||
#include "core/vector.h"
|
#include "core/vector.h"
|
||||||
|
#include "core/pool_vector.h"
|
||||||
|
|
||||||
#include "core/reference.h"
|
#include "core/reference.h"
|
||||||
|
|
||||||
@ -24,22 +25,6 @@ public:
|
|||||||
Vector<uint32_t> directions[4];
|
Vector<uint32_t> directions[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PropagatingEntry {
|
|
||||||
uint32_t data[3];
|
|
||||||
|
|
||||||
PropagatingEntry() {
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
|
||||||
data[i] = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PropagatingEntry(uint32_t x, uint32_t y, uint32_t z) {
|
|
||||||
data[0] = x;
|
|
||||||
data[1] = y;
|
|
||||||
data[2] = z;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
struct CompatibilityEntry {
|
struct CompatibilityEntry {
|
||||||
int direction[4];
|
int direction[4];
|
||||||
|
|
||||||
@ -105,7 +90,9 @@ public:
|
|||||||
CompatibilityEntry temp;
|
CompatibilityEntry temp;
|
||||||
compatible.get(y, x, pattern) = temp;
|
compatible.get(y, x, pattern) = temp;
|
||||||
|
|
||||||
propagating.push_back(PropagatingEntry(y, x, pattern));
|
propagating.push_back(pattern);
|
||||||
|
propagating.push_back(x);
|
||||||
|
propagating.push_back(y);
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr uint32_t get_opposite_direction(uint32_t direction) {
|
constexpr uint32_t get_opposite_direction(uint32_t direction) {
|
||||||
@ -172,7 +159,7 @@ private:
|
|||||||
|
|
||||||
// All the tuples (y, x, pattern) that should be propagated.
|
// All the tuples (y, x, pattern) that should be propagated.
|
||||||
// The tuple should be propagated when wave.get(y, x, pattern) is set to false.
|
// The tuple should be propagated when wave.get(y, x, pattern) is set to false.
|
||||||
Vector<PropagatingEntry> propagating;
|
Vector<uint32_t> propagating;
|
||||||
|
|
||||||
// compatible.get(y, x, pattern)[direction] contains the number of patterns
|
// compatible.get(y, x, pattern)[direction] contains the number of patterns
|
||||||
// present in the wave that can be placed in the cell next to (y,x) in the
|
// present in the wave that can be placed in the cell next to (y,x) in the
|
||||||
|
Loading…
Reference in New Issue
Block a user