From f0b01681684ae771b28201dc95e8e1b27aeac332 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 16 Jul 2020 11:01:14 +0200 Subject: Fix /tmp/vr-video-player_ file not being written to when using Q key --- src/main.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 84ac666..cbd5dbc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1007,26 +1007,20 @@ bool CMainApplication::HandleInput() zoom -= 0.01f; window_resized = true; - std::ofstream zoomstate; std::stringstream strstr; - strstr << "/tmp/vr-video-player_" << src_window_id << ".txt"; - std::string s = strstr.str(); + strstr << "/tmp/vr-video-player_" << src_window_id; + std::ofstream zoomstate(strstr.str()); zoomstate << zoom; - zoomstate.close(); } if( sdlEvent.key.keysym.sym == SDLK_e ) { zoom += 0.01f; window_resized = true; - std::ofstream zoomstate; std::stringstream strstr; - strstr << "/tmp/vr-video-player_" << src_window_id << ".txt"; - std::string s = strstr.str(); - zoomstate.open (s); - + strstr << "/tmp/vr-video-player_" << src_window_id; + std::ofstream zoomstate(strstr.str()); zoomstate << zoom; - zoomstate.close(); } } } -- cgit v1.2.3