summaryrefslogtreecommitdiff
path: root/src/resources/ambientlayer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2024-03-07Fixed ambient layers "keepratio" optionThorbjørn Lindeijer1-8/+19
I had broken this in 264be2108c51837fa92085f6c839e66aebbcfc9e by no longer reading out the property. Made some further simplifications and two more fixes: * When the original image's size was not 800x600, it wouldn't get scaled as expected due to the integer division being performed before the multiplication. * I had changed the default resolution to 1280x720, while mKeepRatio expects to scale the original image as if it was displayed on an 800x600 screen. So now it's hardcoded on 800x600 rather than using the defaultScreenWidth/Height variables. * Removed the confusing x/y parameters from AmbientLayer::draw, which were actually set to the graphics width/height. * Changed SDLGraphics::drawRescaledImagePattern to not repeatedly set the source origin.
2024-02-27Added VSync and windowed fullscreen optionsThorbjørn Lindeijer1-0/+1
The configuration and setup UI were adjusted to the new options. This also fixes issues in applying new video settings. Default resolution was changed from 800x600 to 1280x720. VSync is enabled by default while FPS limit was disabled. Display aspect ratio for the resolution options. I had to work around some macOS issues: * Don't change window size when it appears to be "maximized", since it just changes the rendering area while leaving the window maximized. * Unset fullscreen display mode temporarily to allow changing resolutions, otherwise the rendering area no longer matches the screen and mouse input is also off. * Removed SDL_WINDOW_ALLOW_HIGHDPI for now because it causes issues on macOS, since we're not actually handling the scaling factor. A Video class and an SDLGraphics subclass were split off from Graphics. This setup has Less duplication and leaves the OpenGLGraphics and SDLGraphics better separated. Fixes #57 Fixes #58
2024-01-28Added support for map/layer maskThorbjørn Lindeijer1-12/+4
A custom "Mask" property on a layer or a "foregroundXmask" property on a map can now be used in combination with the SMSG_MAP_MASK to dynamically disable certain map layers from the server. Feature previously seen on ManaPlus and implemented for Mana client for compatibility. Also added a ResourceRef class for automating the Resource reference counting. Closes #44
2024-01-25Ported to SDL2Thorbjørn Lindeijer1-21/+1
2012-02-09Fixed wallpaper prescaling issuesThorbjørn Lindeijer1-8/+2
Image::SDLgetScaledImage was changed so that it tries to find an existing scaled version of the image first, and generates it when none exists. When it needs to generate one, this resource is added to the resource manager, partly to avoid duplicating the work later but mainly to keep memory management straightforward. This function also used to leak the scaled SDL_Surface since it wrongly assumed that Image::load would free it. To avoid filling up the memory with scaled wallpapers that are waiting 30 seconds until they will be deleted, the Resource::decRef function was extended with a parameter that allows telling it what to do with orphans. Calling decRef with Resource::DeleteImmediately will delete the resource immediately in case the resource is orphaned. Reviewed-by: Yohann Ferreira
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2010-10-22Turned the OpenGL and disable transparency options as static members.Yohann Ferreira1-2/+2
- Now OpenGL and the transparency disabling are set at startup and not read again for displaying graphics, preventing graphic errors before startup. - We also agreed long time ago that SDL specific functions should have a SDL prefix. The header has been rearranged a bit to do so. - Also fixed a possible discrepancy in the hasAlphaChannel() function. Reviewed-by: CodyMartin. Resolves: Mana-Mantis: #260.
2010-05-21Fix a crash dealing with rescaled overlays under SDLJared Adams1-0/+1
Reviewed-by: Philipp Sehmisch
2010-02-21Do some more copyright header cleanupsJared Adams1-1/+0
Fix "(C) 2009-2009" to just "(C) 2009" Fix "(C) 2010 TMW" to "(C) 2010 Mana" Remove TMW compyright on (hopefully all) files added after 0.0.29.1
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2010-01-12Standardize header orderJared Adams1-1/+2
Also remove some extra new lines and fix eAthena's PartyTab define guards.
2009-12-25Added support for map background images which work exactly like overlays, ↵Philipp Sehmisch1-0/+103
just that they are drawn before the tiles instead of afterwards. Renamed overlays to foregrounds (but kept backward compatibility intact)