mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
nilrider:: textures invalidating should be fixed
This commit is contained in:
parent
dc375ade49
commit
a0058eed72
@ -10,6 +10,7 @@ void level::init_textures() {
|
||||
for(int stepped: {0, 1}) {
|
||||
|
||||
auto& target = stepped ? unil_texture_stepped : unil_texture;
|
||||
if(target) return;
|
||||
|
||||
target = new texture::texture_data;
|
||||
|
||||
@ -446,6 +447,7 @@ void level::draw_level(const shiftmatrix& V) {
|
||||
|
||||
queuepoly(V, shField, 0xFFFF00FF);
|
||||
|
||||
curlev->init_textures();
|
||||
if(!stepped_display) {
|
||||
auto& poly = queuepoly(V, shFloor, 0xFFFFFFFF); // 0xFFFFFFFF);
|
||||
poly.tinf = &uniltinf;
|
||||
@ -458,4 +460,12 @@ void level::draw_level(const shiftmatrix& V) {
|
||||
}
|
||||
}
|
||||
|
||||
void cleanup_textures() {
|
||||
for(auto l: all_levels) {
|
||||
if(l->unil_texture) delete(l->unil_texture);
|
||||
l->unil_texture = nullptr;
|
||||
if(l->unil_texture_stepped) delete(l->unil_texture_stepped);
|
||||
l->unil_texture_stepped = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -428,6 +428,7 @@ void initialize() {
|
||||
|
||||
rv_hook(hooks_frame, 100, frame);
|
||||
rv_hook(shmup::hooks_turn, 100, turn);
|
||||
rv_hook(hooks_resetGL, 100, cleanup_textures);
|
||||
on = true;
|
||||
on_cleanup_or_next([] { on = false; });
|
||||
pushScreen(run);
|
||||
|
Loading…
Reference in New Issue
Block a user