From f080508d6c16397ef03438604db2c59786349bdc Mon Sep 17 00:00:00 2001 From: Kp Date: Fri, 10 Mar 2017 01:22:25 +0000 Subject: [PATCH] Cache canvas in movie.cpp --- d2x-rebirth/main/movie.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/d2x-rebirth/main/movie.cpp b/d2x-rebirth/main/movie.cpp index 584678714..928c0f8d0 100644 --- a/d2x-rebirth/main/movie.cpp +++ b/d2x-rebirth/main/movie.cpp @@ -299,15 +299,15 @@ static window_event_result show_pause_message(window *, const d_event &event, co int y; gr_set_current_canvas(NULL); - gr_set_curfont(*grd_curcanv, GAME_FONT); - - gr_get_string_size(*grd_curcanv->cv_font, msg, nullptr, &h, nullptr); + auto &canvas = *grd_curcanv; + gr_set_curfont(canvas, GAME_FONT); + gr_get_string_size(*canvas.cv_font, msg, nullptr, &h, nullptr); y = (grd_curscreen->get_screen_height() - h) / 2; - gr_set_fontcolor(*grd_curcanv, 255, -1); + gr_set_fontcolor(canvas, 255, -1); - gr_ustring(*grd_curcanv, 0x8000, y, msg); + gr_ustring(canvas, 0x8000, y, msg); break; }