Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 955 vs 978 for /trunk/Source Code/GUI/GUIInterface.cpp

Diff revisions: vs.
  @@ -10,14 +10,14 @@
10 10 #include "Headers/GUIMessageBox.h"
11 11
12 12 #include "Scenes/Headers/Scene.h"
13 + #include "Core/Headers/PlatformContext.h"
13 14 #include "Core/Resources/Headers/ResourceCache.h"
14 15 #include "Platform/Headers/PlatformRuntime.h"
15 16
16 17 namespace Divide {
17 18
18 - GUIInterface::GUIInterface(GUI& context, const vec2<U16>& resolution)
19 - : _context(&context),
20 - _resolutionCache(resolution)
19 + GUIInterface::GUIInterface(GUI& context)
20 + : _context(&context)
21 21 {
22 22 Locale::addChangeLanguageCallback([this](const char* newLanguage) {
23 23 onLanguageChange(newLanguage);
  @@ -33,13 +33,12 @@
33 33 }
34 34 }
35 35
36 - void GUIInterface::onChangeResolution(U16 w, U16 h) {
36 + void GUIInterface::onSizeChange(const SizeChangeParams& params) {
37 37 for (U8 i = 0; i < to_base(GUIType::COUNT); ++i) {
38 38 for (const GUIMap::value_type& guiStackIterator : _guiElements[i]) {
39 - guiStackIterator.second.first->onChangeResolution(w, h);
39 + guiStackIterator.second.first->onSizeChange(params);
40 40 }
41 41 }
42 - _resolutionCache.set(w, h);
43 42 }
44 43
45 44 void GUIInterface::onLanguageChange(const char* newLanguage) {
  @@ -157,7 +156,7 @@
157 156 const stringImpl& rootSheetID) {
158 157 assert(getGUIElement(guiID) == nullptr);
159 158
160 - const vec2<U16>& resolution = getDisplayResolution();
159 + const vec2<U16>& resolution = _context->parent().platformContext().gfx().renderingResolution();
161 160
162 161 vec2<F32> relOffset((position.x * 100.0f) / resolution.width,
163 162 (position.y * 100.0f) / resolution.height);
  @@ -251,8 +250,4 @@
251 250 return textElement;
252 251 }
253 252
254 - const vec2<U16>& GUIInterface::getDisplayResolution() const {
255 - return _resolutionCache;
256 - }
257 -
258 253 }; //namespace Divide