mirror of
https://github.com/edubart/otclient.git
synced 2025-10-18 21:43:26 +02:00
rework map rendering
This commit is contained in:
@@ -38,7 +38,7 @@ PlatformWindow& g_window = window;
|
||||
void PlatformWindow::updateUnmaximizedCoords()
|
||||
{
|
||||
if(!isMaximized() && !isFullscreen()) {
|
||||
m_unmaximizedPos = m_pos;
|
||||
m_unmaximizedPos = m_position;
|
||||
m_unmaximizedSize = m_size;
|
||||
}
|
||||
}
|
||||
|
@@ -73,9 +73,9 @@ public:
|
||||
int getWidth() { return m_size.width(); }
|
||||
int getHeight() { return m_size.height(); }
|
||||
Point getUnmaximizedPos() { return m_unmaximizedPos; }
|
||||
Point getPos() { return m_pos; }
|
||||
int getX() { return m_pos.x; }
|
||||
int getY() { return m_pos.y; }
|
||||
Point getPosition() { return m_position; }
|
||||
int getX() { return m_position.x; }
|
||||
int getY() { return m_position.y; }
|
||||
Point getMousePos() { return m_inputEvent.mousePos; }
|
||||
int getKeyboardModifiers() { return m_inputEvent.keyboardModifiers; }
|
||||
bool isKeyPressed(Fw::Key keyCode) { return m_keysState[keyCode]; }
|
||||
@@ -104,7 +104,7 @@ protected:
|
||||
Timer m_keyPressTimer;
|
||||
|
||||
Size m_size;
|
||||
Point m_pos;
|
||||
Point m_position;
|
||||
Size m_unmaximizedSize;
|
||||
Point m_unmaximizedPos;
|
||||
InputEvent m_inputEvent;
|
||||
|
@@ -278,7 +278,7 @@ void WIN32Window::internalCreateWindow()
|
||||
DWORD dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
|
||||
DWORD dwStyle = WS_OVERLAPPEDWINDOW;
|
||||
|
||||
RECT windowRect = {m_pos.x, m_pos.y, m_pos.x + m_size.width(), m_pos.y + m_size.height()};
|
||||
RECT windowRect = {m_position.x, m_position.y, m_position.x + m_size.width(), m_position.y + m_size.height()};
|
||||
AdjustWindowRectEx(&windowRect, dwStyle, FALSE, dwExStyle);
|
||||
|
||||
updateUnmaximizedCoords();
|
||||
@@ -361,14 +361,14 @@ void *WIN32Window::getExtensionProcAddress(const char *ext)
|
||||
|
||||
void WIN32Window::move(const Point& pos)
|
||||
{
|
||||
RECT windowRect = {pos.x, pos.y, m_pos.x + m_size.width(), m_pos.y + m_size.height()};
|
||||
RECT windowRect = {pos.x, pos.y, m_position.x + m_size.width(), m_position.y + m_size.height()};
|
||||
AdjustWindowRectEx(&windowRect, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
|
||||
MoveWindow(m_window, windowRect.left, windowRect.top, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, TRUE);
|
||||
}
|
||||
|
||||
void WIN32Window::resize(const Size& size)
|
||||
{
|
||||
RECT windowRect = {m_pos.x, m_pos.y, m_pos.x + size.width(), m_pos.y + size.height()};
|
||||
RECT windowRect = {m_position.x, m_position.y, m_position.x + size.width(), m_position.y + size.height()};
|
||||
AdjustWindowRectEx(&windowRect, WS_OVERLAPPEDWINDOW, FALSE, WS_EX_APPWINDOW | WS_EX_WINDOWEDGE);
|
||||
MoveWindow(m_window, windowRect.left, windowRect.top, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, TRUE);
|
||||
}
|
||||
@@ -503,8 +503,8 @@ LRESULT WIN32Window::windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||
break;
|
||||
}
|
||||
case WM_MOVE: {
|
||||
m_pos.x = LOWORD(lParam);
|
||||
m_pos.y = HIWORD(lParam);
|
||||
m_position.x = LOWORD(lParam);
|
||||
m_position.y = HIWORD(lParam);
|
||||
break;
|
||||
}
|
||||
case WM_SIZE: {
|
||||
|
@@ -284,7 +284,7 @@ void X11Window::internalCreateWindow()
|
||||
|
||||
updateUnmaximizedCoords();
|
||||
m_window = XCreateWindow(m_display, m_rootWindow,
|
||||
m_pos.x, m_pos.y, m_size.width(), m_size.height(),
|
||||
m_position.x, m_position.y, m_size.width(), m_size.height(),
|
||||
0,
|
||||
depth,
|
||||
InputOutput,
|
||||
@@ -300,7 +300,7 @@ void X11Window::internalCreateWindow()
|
||||
XSetWMHints(m_display, m_window, &hints);
|
||||
|
||||
// ensure window position
|
||||
XMoveWindow(m_display, m_window, m_pos.x, m_pos.y);
|
||||
XMoveWindow(m_display, m_window, m_position.x, m_position.y);
|
||||
|
||||
// handle wm_delete events
|
||||
m_wmDelete = XInternAtom(m_display, "WM_DELETE_WINDOW", True);
|
||||
@@ -580,7 +580,7 @@ void X11Window::poll()
|
||||
}
|
||||
|
||||
// updates window pos
|
||||
m_pos = newPos;
|
||||
m_position = newPos;
|
||||
updateUnmaximizedCoords();
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user