diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-07 23:11:21 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-07 23:11:21 (GMT) |
| commit | c88079d084f2f3b7ec891da22f8c497cd2652853 (patch) | |
| tree | ba24b70fb653b24a23e51c18a1d8d876233f71a5 /src/simulation | |
| parent | bbfbb81086897d50b67bf1494ac150eb607add72 (diff) | |
| download | powder-c88079d084f2f3b7ec891da22f8c497cd2652853.zip powder-c88079d084f2f3b7ec891da22f8c497cd2652853.tar.gz | |
Element sampling HUD thingy (No very good with MVC)
Diffstat (limited to 'src/simulation')
| -rw-r--r-- | src/simulation/Simulation.cpp | 9 | ||||
| -rw-r--r-- | src/simulation/Simulation.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 7b1dca8..b52907b 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -120,6 +120,15 @@ int Simulation::flood_prop(int x, int y, size_t propoffset, void * propvalue, in return 0; } +Particle Simulation::Get(int x, int y) +{ + if(pmap[y][x]) + return parts[pmap[y][x]>>8]; + if(photons[y][x]) + return parts[photons[y][x]>>8]; + return Particle(); +} + int Simulation::flood_parts(int x, int y, int fullc, int cm, int bm, int flags) { int c = fullc&0xFF; diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index dd86953..3139b77 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -210,6 +210,7 @@ public: int Load(int x, int y, unsigned char * data, int dataLength); unsigned char * Save(int & dataLength); unsigned char * Save(int x1, int y1, int x2, int y2, int & dataLength); + Particle Get(int x, int y); inline int is_blocking(int t, int x, int y); inline int is_boundary(int pt, int x, int y); inline int find_next_boundary(int pt, int *x, int *y, int dm, int *em); |
