mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-24 23:10:09 +00:00
memory clearing in inverse
This commit is contained in:
parent
224a02d086
commit
9da8dac45b
1
cell.cpp
1
cell.cpp
@ -342,6 +342,7 @@ EX void clearcell(cell *c) {
|
||||
}
|
||||
DEBB(DF_MEMORY, (format("DEL %p\n", hr::voidp(c))));
|
||||
destroy_cell(c);
|
||||
gp::delete_mapped(c);
|
||||
}
|
||||
|
||||
EX heptagon deletion_marker;
|
||||
|
@ -1262,6 +1262,13 @@ EX namespace gp {
|
||||
EX hrmap* get_underlying_map() { return inv_map()->underlying_map; }
|
||||
EX cell* get_mapped(cell *c) { return inv_map()->get_mapped(c, 0); }
|
||||
EX int untruncated_shift(cell *c) { return inv_map()->shift[c]; }
|
||||
|
||||
EX void delete_mapped(cell *c) {
|
||||
if(!pmap) return;
|
||||
auto i = (hrmap_inverse*) pmap;
|
||||
if(i->mapping.count(c))
|
||||
destroy_cell(i->mapping[c]);
|
||||
}
|
||||
|
||||
EX cell *inverse_move(cell *c, int d) { return inv_map()->create_move(c, d); }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user