Commit Graph
294 Commits
Author SHA1 Message Date
Paul Gilbert 07ff61ea8d GUI: Amiga compilation fix 2021-07-04 19:34:08 -07:00
Paul Gilbert 1c3e7fb4e9 COMMON: Change Rect and Point to have int32 fields 2021-07-04 18:24:26 -07:00
Le Philousophe e62e9e84d5 GUI: Don't draw text when the rect planned for it is too small
Rect is not valid anymore and we get assertion failures
2021-06-20 11:48:19 +02:00
Martin Gerhardy 5af1192580 BACKENDS: fixed segfault in EventRecorder with buffer out of bounds writes
==3124361== Invalid write of size 8
==3124361==    at 0x483F803: memmove (vg_replace_strmem.c:1270)
==3124361==    by 0x4DBF61: SurfaceSdlGraphicsManager::grabOverlay(void*, int) const (surfacesdl-graphics.cpp:1753)
==3124361==    by 0x482051: ModularGraphicsBackend::grabOverlay(void*, int) (modular-backend.cpp:215)
==3124361==    by 0x434EE1: GUI::ThemeEngine::clearAll() (ThemeEngine.cpp:376)
==3124361==    by 0x40128E: GUI::EventRecorder::preDrawOverlayGui() (EventRecorder.cpp:558)
==3124361==    by 0x481DB2: ModularGraphicsBackend::updateScreen() (modular-backend.cpp:173)
==3124361==    by 0x559967: Graphics::Screen::updateScreen() (screen.cpp:62)
==3124361==    by 0x55991C: Graphics::Screen::update() (screen.cpp:56)
==3124361==    by 0x38AFC7: TwinE::TwineScreen::update() (twine.cpp:126)
==3124361==    by 0x3B8759: TwinE::Screens::adjustPalette(unsigned char, unsigned char, unsigned char, unsigned int const*, int) (screens.cpp:150)
==3124361==    by 0x3B8A89: TwinE::Screens::fadeToPal(unsigned int const*) (screens.cpp:207)
==3124361==    by 0x3B8403: TwinE::Screens::loadImage(int, int, bool) (screens.cpp:80)
==3124361==  Address 0x31453050 is 16 bytes after a block of size 512,000 alloc'd
==3124361==    at 0x483AB65: calloc (vg_replace_malloc.c:760)
==3124361==    by 0x55B38C: Graphics::Surface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (surface.cpp:75)
==3124361==    by 0x551111: Graphics::ManagedSurface::create(unsigned short, unsigned short, Graphics::PixelFormat const&) (managed_surface.cpp:153)
==3124361==    by 0x4352D5: GUI::ThemeEngine::setGraphicsMode(GUI::ThemeEngine::GraphicsMode) (ThemeEngine.cpp:453)
==3124361==    by 0x434A52: GUI::ThemeEngine::init() (ThemeEngine.cpp:324)
==3124361==    by 0x43501B: GUI::ThemeEngine::refresh() (ThemeEngine.cpp:394)
==3124361==    by 0x405780: GUI::GuiManager::screenChange() (gui-manager.cpp:603)
==3124361==    by 0x405C6B: GUI::GuiManager::processEvent(Common::Event const&, GUI::Dialog*) (gui-manager.cpp:677)
==3124361==    by 0x404EBA: GUI::GuiManager::runLoop() (gui-manager.cpp:429)
==3124361==    by 0x3FD847: GUI::Dialog::runModal() (dialog.cpp:77)
==3124361==    by 0x36D747: launcherDialog() (main.cpp:106)
==3124361==    by 0x36FF92: scummvm_main (main.cpp:552)

It looks like the _videoMode.overlayHeight in SurfaceSdlGraphicsManager::grabOverlay and ThemeEngine::_backBuffer::h are somehow out of sync after
starting the game in a different resolution as the gui was started with. So the overlayHeight is updated - but the backbuffer (Surface) is not resized.

This is with event recorder being active - right after starting the game and switching the resolution.
2021-06-19 14:34:52 +02:00
Cameron Cawley 03b9943ec0 Revert "GUI: Convert the cursor bitmap to the overlay format"
This reverts commit 26dc725ed2.
2021-05-15 00:20:00 +01:00
Cameron Cawley 26dc725ed2 GUI: Convert the cursor bitmap to the overlay format 2021-05-14 22:37:24 +02:00
Martin Gerhardy 9d82fa51df COMMON: removed USE_TTS check from engines
OSystem now just returns a nullptr if there is no text to speech manager instance
(because none is compiled into the binary, or the system doesn't provide support
for it). This removed the need for the engine authors to add scummvm osystem compile
time options checks into their engine code
2021-05-03 14:13:41 +03:00
Eugene Sandulenko 12f107af67 GUI: Gracefully process broken images 2021-05-01 01:49:47 +02:00
Eugene Sandulenko ad50a1471a GUI: Initialize class variables 2021-05-01 01:49:47 +02:00
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Eugene Sandulenko b2be9bb2e1 GUI: If SVG file is present, do not bother with loading BMPs 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 3f1ee55268 GUI: Cleanup not needed code 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 0fc5c4c391 GUI: Keep SVGs in 32-bit format until very rendering 2021-04-11 21:21:44 +02:00
Eugene Sandulenko f88a622e9a GUI: Prerender SVG on theme loading
We know the resolution and we do reread everything on the resolution
change anyway. This simplifies everything: we just draw transparent
surfaces everywhere, regardless of their source format.
2021-04-11 21:21:44 +02:00
Eugene Sandulenko d3f5d34b62 GRAPHICS: Unify VectorRenderer blitting routines 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 2839715a45 GUI: Remove TransparentSurface remnants aka alphabitmaps from themes 2021-04-11 21:21:44 +02:00
Eugene Sandulenko bd083c7fa7 GUI: Switch GUI to ManagedSurface 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 3021f34060 GUI: Add support for specified dimensions for bitmaps in theme file
When we are using SVG, there is no reliable way to get the proper
dimensions. The original code was relying on the dimensions of
the BMP file, and then was using those for understanding the
rendering positions e.g. for PicButtons.
2021-04-11 21:21:44 +02:00
Eugene Sandulenko 09f11bd37e GRAPHICS: Fix transparency in ManagedSurface bitmaps 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 7fe0073823 GUI: Render ManagedSurface widget with transparency 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 5f80a79871 GUI: Fix crash when requested 0 x 0 SVG rendering 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 4a58f08a37 GUI: Load SVGs from theme 2021-04-11 21:21:44 +02:00
Eugene Sandulenko 04f040afce GUI: Reload all bitmaps on theme reload
Since now we are scaling them, it is essential to scale the originals,
otherwise we have double scaling
2021-04-11 21:21:44 +02:00
Eugene Sandulenko 9e746e04f2 GUI: Always scale padding 2021-04-11 21:21:44 +02:00
Eugene Sandulenko fad56e39d1 GUI: Scale theme images 2021-04-11 21:21:44 +02:00
Eugene Sandulenko b29f457548 GUI: Scale theme on loading 2021-04-11 21:21:44 +02:00
Eugene Sandulenko a0d4162a2b GUI: Compute base scale factor and set it for ThemeParser 2021-04-11 21:21:44 +02:00
Le Philousophe 577322f3fe GUI: Don't leak theme and TextDrawData when loading fails 2021-02-17 12:57:23 +00:00
Zvika Haramaty 606eeae46f COMMON: move convertBiDiString out of TranslationManager 2020-11-04 22:27:24 +00:00
athrxx e7476495ab GUI: prevent unloading of extra font on refresh
When hitting pause in a CJK SCUMM game and then switching to fullscreen the call to ThemeEngine::refresh() would kill the required extra font.
2020-10-31 20:47:02 +01:00
Thierry Crozat 49a36e6828 GUI: Fix compilation with some compilers 2020-10-30 23:04:40 +00:00
Thierry Crozat 7a1b3983a2 GUI: Remove unused functions in ThemeEngine
They were leftovers from the transition to U32String.
2020-10-30 22:54:09 +00:00
athrxx 5b6ffeaa3d GUI: allow ingame CJK dialogs regardless of the launcher language
This allows a text widget to be expressly marked as Japanese, Korean or Chinese, so that the theme engine may use an appropriate font.
2020-10-30 21:36:23 +01:00
Eugene Sandulenko 76ec66bfa6 Revert "GUI: Properly load fonts when translations are disabled"
This reverts commit 62c4d6cc0a.

This broke non-Latin fonts loading.
2020-10-01 02:08:39 +02:00
Cameron Cawley 81f989be63 GUI: Use RGB cursors on supported platforms 2020-09-17 22:21:23 +02:00
Eugene Sandulenko 62c4d6cc0a GUI: Properly load fonts when translations are disabled 2020-09-17 16:14:01 +02:00
Eugene Sandulenko 65e38680dd GUI: Added XML theme setting for overriding the fonts depending on the selected language.
- Added Japanese, Korean and Traditional Chinese fonts to fonts.dat
- Bumped fonts.dat file version to 1.4
- Bumped theme version to 0.8.39
- Regenerated built-in theme
2020-09-17 02:00:33 +02:00
aryanrawlani28 d12c6c4338 GUI: U32: Code cleanup
- Remove extra parantheses leftover from temp code
- SaveLoadDialog - do not encode when setting labels
- Remove mapping variable from ThemeEngine::loadScalableFont (and use default 0)
- Remove incorrect u32 constructor wrapper from confman.set in eventrecorder.cpp
2020-08-30 14:43:41 +02:00
aryanrawlani28 3d97be2559 GUI: U32: Remove redundant code
Because po files now (should) use UTF-8, a bunch of code in ScummVM is redundant. This commit addresses that.

- Remove charsetMapping and related variables.
- Remove the code that used these functions.
- Remove cp_parser.cpp. This is removed because the use of codepages is no longer needed.
- Remove iso-8859-x codepages (see above message)
- Always set mapping as 0 in ThemeEngine::loadScalableFont
- Check if ascii or not by getting charset in about dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28 a1a4e0c2d7 GUI: U32: Overload getStringWidth to accept U32 strings as params 2020-08-30 14:43:41 +02:00
aryanrawlani28 aafade4507 GUI: U32: Shift most widgets to draw with u32
- ButtonWidgets (Button, Radio, Checkbox, dropdown)
- StaticTextWidgets
- PopUpWidgets
- Tabs
- Add a temporary overloaded drawDDText function to make other widgets draw normally
2020-08-30 14:43:41 +02:00
aryanrawlani28 51d95f8978 GRAPHICS: move start + end to Graphics::TextAlign 2020-06-22 00:03:02 +02:00
BLooperZ e6e32aeb75 GUI: use start + end for horizontal align 2020-06-22 00:03:02 +02:00
aryanrawlani28 1ae2de366b GUI: RTL: Improve tab drawing for rtl 2020-06-22 00:03:02 +02:00
aryanrawlani28 12a4af77bd GUI: Code cleanup 2020-06-22 00:03:02 +02:00
aryanrawlani28 e50463f11f GUI: JANITORIAL: Improve readability - remove nested ternary op 2020-06-22 00:03:02 +02:00
aryanrawlani28 312862b541 GUI: RTL: Correctly draw backgrounds of Tabs 2020-06-22 00:03:02 +02:00
aryanrawlani28 4699880c99 GUI: RTL: Support internal flipping of Sliders 2020-06-22 00:03:02 +02:00
aryanrawlani28 50aa421bf3 GUI: RTL: Fix display issues with some widgets
- Fix missing DD for disabled dropdownbutton
- Fix scrollbar drawing issue
- Fix eating last chars in popup
- Fix tooltip alignment
2020-06-22 00:03:02 +02:00
aryanrawlani28 f55654f1bc GUI: RTL: Popup RTL Layout and Correctly draw them
GUI: RTL: Correctly draw popups
2020-06-22 00:03:02 +02:00