diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-05 19:08:35 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-06-05 19:08:35 (GMT) |
| commit | 49dafbfd263957631116557ac4fa59429390ebaa (patch) | |
| tree | d33a60331bf704db792e481d81e6bf8229e7493e /src/simulation/Particle.h | |
| parent | bc35d622adb0965652955b6517c17b19f41fd41f (diff) | |
| download | powder-49dafbfd263957631116557ac4fa59429390ebaa.zip powder-49dafbfd263957631116557ac4fa59429390ebaa.tar.gz | |
Use a different method for decoding saves with uncompressed object in memory for stamps and clipboard, also allows for transformation (rotation), missing failure states and code for loading it into a Simulation
Diffstat (limited to 'src/simulation/Particle.h')
| -rw-r--r-- | src/simulation/Particle.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/simulation/Particle.h b/src/simulation/Particle.h new file mode 100644 index 0000000..91a1315 --- /dev/null +++ b/src/simulation/Particle.h @@ -0,0 +1,46 @@ +// +// Particle.h +// The Powder Toy +// +// Created by Simon Robertshaw on 04/06/2012. +// Copyright (c) 2012 __MyCompanyName__. All rights reserved. +// + +#ifndef The_Powder_Toy_Particle_h +#define The_Powder_Toy_Particle_h + +#include "StructProperty.h" + +struct Particle +{ + int type; + int life, ctype; + float x, y, vx, vy; + float temp; + float pavg[2]; + int flags; + int tmp; + int tmp2; + unsigned int dcolour; + /** Returns a list of properties, their type and offset within the structure that can be changed + by higher-level processes refering to them by name such as Lua or the property tool **/ + static std::vector<StructProperty> GetProperties() + { + std::vector<StructProperty> properties; + properties.push_back(StructProperty("type", StructProperty::ParticleType, offsetof(Particle, type))); + properties.push_back(StructProperty("life", StructProperty::ParticleType, offsetof(Particle, life))); + properties.push_back(StructProperty("ctype", StructProperty::ParticleType, offsetof(Particle, ctype))); + properties.push_back(StructProperty("x", StructProperty::Float, offsetof(Particle, x))); + properties.push_back(StructProperty("y", StructProperty::Float, offsetof(Particle, y))); + properties.push_back(StructProperty("vx", StructProperty::Float, offsetof(Particle, vx))); + properties.push_back(StructProperty("vy", StructProperty::Float, offsetof(Particle, vy))); + properties.push_back(StructProperty("temp", StructProperty::Float, offsetof(Particle, temp))); + properties.push_back(StructProperty("flags", StructProperty::UInteger, offsetof(Particle, flags))); + properties.push_back(StructProperty("tmp", StructProperty::Integer, offsetof(Particle, tmp))); + properties.push_back(StructProperty("tmp2", StructProperty::Integer, offsetof(Particle, tmp2))); + properties.push_back(StructProperty("dcolour", StructProperty::UInteger, offsetof(Particle, dcolour))); + return properties; + } +}; + +#endif |
