mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
platform fixes
* fix black cursor on win32 * fix front buffer refresh on some x11 platforms * fix outfit framebuffer glitch * display entergame by default * change some icons
This commit is contained in:
@@ -687,16 +687,12 @@ void WIN32Window::setMouseCursor(const std::string& file, const Point& hotSpot)
|
||||
std::vector<uchar> xorMask(numbytes, 0);
|
||||
|
||||
for(int i=0;i<numbits;++i) {
|
||||
uchar r = apng.pdata[i*4+0];
|
||||
uchar g = apng.pdata[i*4+1];
|
||||
uchar b = apng.pdata[i*4+2];
|
||||
uchar a = apng.pdata[i*4+3];
|
||||
Color color(r,g,b,a);
|
||||
if(color == Color::white) { //white
|
||||
uint32 rgba = Fw::readLE32(apng.pdata + i*4);
|
||||
if(rgba == 0xffffffff) { //white
|
||||
HSB_BIT_SET(xorMask, i);
|
||||
} else if(color == Color::alpha) { //alpha
|
||||
} else if(rgba == 0x00000000) { //alpha
|
||||
HSB_BIT_SET(andMask, i);
|
||||
} //otherwise black
|
||||
} // otherwise 0xff000000 => black
|
||||
}
|
||||
free_apng(&apng);
|
||||
|
||||
|
@@ -632,7 +632,7 @@ void X11Window::poll()
|
||||
XFree(propertyValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// updates window pos
|
||||
if(m_visible)
|
||||
m_position = newPos;
|
||||
@@ -794,6 +794,7 @@ void X11Window::poll()
|
||||
void X11Window::swapBuffers()
|
||||
{
|
||||
#ifndef OPENGL_ES2
|
||||
glFinish();
|
||||
glXSwapBuffers(m_display, m_window);
|
||||
#else
|
||||
eglSwapBuffers(m_eglDisplay, m_eglSurface);
|
||||
@@ -872,17 +873,13 @@ void X11Window::setMouseCursor(const std::string& file, const Point& hotSpot)
|
||||
std::vector<uchar> maskBits(numbytes, 0);
|
||||
|
||||
for(int i=0;i<numbits;++i) {
|
||||
uchar r = apng.pdata[i*4+0];
|
||||
uchar g = apng.pdata[i*4+1];
|
||||
uchar b = apng.pdata[i*4+2];
|
||||
uchar a = apng.pdata[i*4+3];
|
||||
Color color(r,g,b,a);
|
||||
if(color == Color::white) { //background
|
||||
uint32 rgba = Fw::readLE32(apng.pdata + i*4);
|
||||
if(rgba == 0xffffffff) { //white, background
|
||||
LSB_BIT_SET(maskBits, i);
|
||||
} else if(color == Color::black) { //foreground
|
||||
} else if(rgba == 0xff000000) { //black, foreground
|
||||
LSB_BIT_SET(mapBits, i);
|
||||
LSB_BIT_SET(maskBits, i);
|
||||
} //otherwise alpha
|
||||
} //otherwise 0x00000000 => alpha
|
||||
}
|
||||
free_apng(&apng);
|
||||
|
||||
|
Reference in New Issue
Block a user