mirror of
https://github.com/blupi-games/planetblupi
synced 2024-12-30 10:15:36 +01:00
Merge branch 'master' into wip/landscape
This commit is contained in:
commit
e56b83e87c
@ -875,7 +875,7 @@ DoInit (int argc, char * argv[], bool & exit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Load all cursors
|
// Load all cursors
|
||||||
g_pPixmap->LoadCursors ();
|
g_pPixmap->LoadCursors (g_windowScale);
|
||||||
g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison
|
g_pPixmap->ChangeSprite (SPRITE_WAIT); // met le sablier maison
|
||||||
|
|
||||||
// Create the sound manager.
|
// Create the sound manager.
|
||||||
|
@ -1657,6 +1657,7 @@ CEvent::SetFullScreen (bool bFullScreen)
|
|||||||
SDL_SetWindowPosition (
|
SDL_SetWindowPosition (
|
||||||
g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
||||||
|
|
||||||
|
m_pPixmap->LoadCursors (m_WindowScale);
|
||||||
m_pPixmap->ReloadTargetTextures ();
|
m_pPixmap->ReloadTargetTextures ();
|
||||||
|
|
||||||
/* Force this update before otherwise the coordinates retrieved with
|
/* Force this update before otherwise the coordinates retrieved with
|
||||||
@ -1715,6 +1716,7 @@ CEvent::SetWindowSize (Uint8 prevScale, Uint8 newScale)
|
|||||||
SDL_SetWindowPosition (
|
SDL_SetWindowPosition (
|
||||||
g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
g_window, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
|
||||||
|
|
||||||
|
m_pPixmap->LoadCursors (newScale);
|
||||||
m_pPixmap->ReloadTargetTextures ();
|
m_pPixmap->ReloadTargetTextures ();
|
||||||
|
|
||||||
/* Force this update before otherwise the coordinates retrieved with
|
/* Force this update before otherwise the coordinates retrieved with
|
||||||
|
@ -821,7 +821,7 @@ CPixmap::GetCursorRect (MouseSprites sprite)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CPixmap::LoadCursors ()
|
CPixmap::LoadCursors (Uint8 scale)
|
||||||
{
|
{
|
||||||
Uint32 rmask, gmask, bmask, amask;
|
Uint32 rmask, gmask, bmask, amask;
|
||||||
|
|
||||||
@ -842,16 +842,20 @@ on the endianness (byte order) of the machine */
|
|||||||
for (int i = SPRITE_BEGIN; i <= SPRITE_END; ++i)
|
for (int i = SPRITE_BEGIN; i <= SPRITE_END; ++i)
|
||||||
{
|
{
|
||||||
MouseSprites sprite = static_cast<MouseSprites> (i);
|
MouseSprites sprite = static_cast<MouseSprites> (i);
|
||||||
|
|
||||||
|
if (m_lpSDLCursors[sprite - 1])
|
||||||
|
SDL_FreeCursor (m_lpSDLCursors[sprite - 1]);
|
||||||
|
|
||||||
SDL_Point hotspot = this->GetCursorHotSpot (sprite);
|
SDL_Point hotspot = this->GetCursorHotSpot (sprite);
|
||||||
SDL_Rect rect = this->GetCursorRect (sprite);
|
SDL_Rect rect = this->GetCursorRect (sprite);
|
||||||
|
|
||||||
SDL_Surface * surface =
|
SDL_Surface * surface = SDL_CreateRGBSurface (
|
||||||
SDL_CreateRGBSurface (0, rect.w, rect.h, 32, rmask, gmask, bmask, amask);
|
0, rect.w * scale, rect.h * scale, 32, rmask, gmask, bmask, amask);
|
||||||
SDL_BlitSurface (m_lpSDLBlupi, &rect, surface, nullptr);
|
SDL_BlitScaled (m_lpSDLBlupi, &rect, surface, nullptr);
|
||||||
|
|
||||||
// FIXME: change cursor first value to 0
|
// FIXME: change cursor first value to 0
|
||||||
m_lpSDLCursors[sprite - 1] =
|
m_lpSDLCursors[sprite - 1] =
|
||||||
SDL_CreateColorCursor (surface, hotspot.x, hotspot.y);
|
SDL_CreateColorCursor (surface, hotspot.x * scale, hotspot.y * scale);
|
||||||
SDL_FreeSurface (surface);
|
SDL_FreeSurface (surface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ public:
|
|||||||
|
|
||||||
void SetMouseSprite (MouseSprites sprite);
|
void SetMouseSprite (MouseSprites sprite);
|
||||||
void MouseShow (bool bShow);
|
void MouseShow (bool bShow);
|
||||||
void LoadCursors ();
|
void LoadCursors (Uint8 scale);
|
||||||
void ChangeSprite (MouseSprites sprite);
|
void ChangeSprite (MouseSprites sprite);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user