display: Move GraphicsPipe::_detected_display_zoom to class member

This commit is contained in:
rdb 2020-12-28 16:31:23 +01:00
parent b38e9d552a
commit e9c7d345df
3 changed files with 12 additions and 13 deletions

View File

@ -81,3 +81,11 @@ INLINE GraphicsDevice *GraphicsPipe::
get_device() const { get_device() const {
return _device; return _device;
} }
/**
* Called by derived class to set the display zoom factor.
*/
INLINE void GraphicsPipe::
set_detected_display_zoom(PN_stdfloat zoom) {
_detected_display_zoom = zoom;
}

View File

@ -97,9 +97,6 @@ static void update_memory_info(DisplayInformation *info) {
} }
#endif #endif
// Temporarily declared as global float.
static PN_stdfloat detected_display_zoom = 1.0;
TypeHandle GraphicsPipe::_type_handle; TypeHandle GraphicsPipe::_type_handle;
/** /**
@ -119,6 +116,7 @@ GraphicsPipe() :
_display_width = 0; _display_width = 0;
_display_height = 0; _display_height = 0;
_detected_display_zoom = 1.0;
_display_information = new DisplayInformation(); _display_information = new DisplayInformation();
@ -287,15 +285,7 @@ get_display_zoom() const {
return override; return override;
} }
} }
return detected_display_zoom; return _detected_display_zoom;
}
/**
* Called by derived class to set the display zoom factor.
*/
void GraphicsPipe::
set_detected_display_zoom(PN_stdfloat zoom) {
detected_display_zoom = zoom;
} }
/** /**

View File

@ -117,7 +117,7 @@ public:
virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine); virtual PT(GraphicsStateGuardian) make_callback_gsg(GraphicsEngine *engine);
protected: protected:
void set_detected_display_zoom(PN_stdfloat zoom); INLINE void set_detected_display_zoom(PN_stdfloat zoom);
virtual void close_gsg(GraphicsStateGuardian *gsg); virtual void close_gsg(GraphicsStateGuardian *gsg);
@ -137,6 +137,7 @@ protected:
int _supported_types; int _supported_types;
int _display_width; int _display_width;
int _display_height; int _display_height;
PN_stdfloat _detected_display_zoom;
PT(GraphicsDevice) _device; PT(GraphicsDevice) _device;
DisplayInformation *_display_information; DisplayInformation *_display_information;