diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-03-28 21:01:44 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-03-28 21:01:44 (GMT) |
| commit | e9770d8ee7a44d5680c23749c786a03c0d5b41ff (patch) | |
| tree | b63b4bb60ab0262724a01cb5bc21b116b035748f /src/simulation | |
| parent | 63af6abd29a161f6d1aa257aeb76f6891f512f74 (diff) | |
| download | powder-e9770d8ee7a44d5680c23749c786a03c0d5b41ff.zip powder-e9770d8ee7a44d5680c23749c786a03c0d5b41ff.tar.gz | |
Clipboard and Stamp from selection (no way to paste/place yet)
Diffstat (limited to 'src/simulation')
| -rw-r--r-- | src/simulation/Simulation.cpp | 5 | ||||
| -rw-r--r-- | src/simulation/Simulation.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 3f82f1b..ceaae07 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -18,6 +18,11 @@ unsigned char * Simulation::Save(int & dataLength) return SaveLoader::BuildSave(dataLength, this, 0, 0, XRES, YRES); } +unsigned char * Simulation::Save(int x1, int y1, int x2, int y2, int & dataLength) +{ + return SaveLoader::BuildSave(dataLength, this, x1, y1, x2-x1, y2-y1); +} + void Simulation::clear_area(int area_x, int area_y, int area_w, int area_h) { int cx = 0; diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index 007f3c2..b33b349 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -208,6 +208,7 @@ public: int Load(unsigned char * data, int dataLength); unsigned char * Save(int & dataLength); + unsigned char * Save(int x1, int y1, int x2, int y2, int & dataLength); 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); |
