summaryrefslogtreecommitdiff
path: root/src/client.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-23 21:49:42 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-24 21:08:16 +0300
commite8a4474319aca4a32869fa1ebb8b5ebbd98237f6 (patch)
tree889a347ac3fb3998566fe07d2c170ad5748aa1f3 /src/client.cpp
parent1a59946dd91a9de55f114413a520bf36204222ff (diff)
downloadplus-e8a4474319aca4a32869fa1ebb8b5ebbd98237f6.tar.gz
plus-e8a4474319aca4a32869fa1ebb8b5ebbd98237f6.tar.bz2
plus-e8a4474319aca4a32869fa1ebb8b5ebbd98237f6.tar.xz
plus-e8a4474319aca4a32869fa1ebb8b5ebbd98237f6.zip
save Client object into global variable.
Diffstat (limited to 'src/client.cpp')
-rw-r--r--src/client.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 2d1a2d82b..6cb9ac028 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -155,6 +155,7 @@ Configuration serverConfig; // XML file server configuration reader
Configuration features; // XML file features
Configuration branding; // XML branding information reader
Configuration paths; // XML default paths information reader
+Client *client = nullptr;
Logger *logger = nullptr; // Log object
ChatLogger *chatLogger = nullptr; // Chat log object
KeyboardConfig keyboard;
@@ -1000,16 +1001,7 @@ int Client::gameExec()
#ifdef USE_SDL2
case SDL_WINDOWEVENT:
{
- switch (event.window.event)
- {
- // +++ need add other window events
- case SDL_WINDOWEVENT_RESIZED:
- resizeVideo(event.window.data1,
- event.window.data2, false);
- break;
- default:
- break;
- }
+ handleSDL2WindowEvent(event);
break;
}
#else
@@ -3165,3 +3157,18 @@ void Client::setIcon()
}
#endif
}
+
+#ifdef USE_SDL2
+void Client::handleSDL2WindowEvent(const SDL_Event &event)
+{
+ switch (event.window.event)
+ {
+ // +++ need add other window events
+ case SDL_WINDOWEVENT_RESIZED:
+ resizeVideo(event.window.data1, event.window.data2, false);
+ break;
+ default:
+ break;
+ }
+}
+#endif