Commit Graph
87 Commits
Author SHA1 Message Date
D G Turner 78db82f6e1 SCI: Fix Undefined Macro Compiler Warnings
These warnings are emitted by GCC if -Wundef is passed.
2022-03-15 10:17:12 +00:00
Eugene Sandulenko abea37c9bb ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Filippos Karapetis bd7e708fc3 SCI: Move resource related functionality into a separate folder 2020-11-29 14:34:55 +02:00
Cameron Cawley c877097b49 ALL: Remove use of "" in Common::U32String constructors 2020-11-16 16:56:58 +00:00
aryanrawlani28 12e4f871a3 GUI: U32: Improve u32 in all engine subsystems
- Common: add wordWrap function to ustr.cpp
- Bladerunner: Explicitly state we have a U32String in subs (same as Subtitles::loadOuttakeSubsText)
- Don't use translations for engine specific "put strings", because they might not support.
- SCI: Use const references for showScummVMDialog
- SCUMM:
-- Don't use translation in md5 warning. left comments with the translated version.
-- Remove some redundant headers in help.cpp
-- Don't use translation in handleSaveload when printing to console
-- Also, display success transaction correctly via u32::format
- TESTBED: Use fake constructor when setting label of button
- SKY: Correctly use translation when using SaveStateDescription
- ULTIMA: Don't use translations when display_string
- ENGINES:
-- GenerateUnknownGameReport correctly, with proper translations.
-- There was an error, where a function had been declared twice, in a header file. Correct this.
2020-08-30 14:43:41 +02:00
aryanrawlani28 e22b32abfe GUI: U32: Use Common::U32String::format where necessary and GUIError to u32
- Where necessary as in, where translated messages are used.
- GUIErrorMessage now takes in U32String
- error messages across some engines use U32Strings. they are changed because they show a message dialog.
2020-08-30 14:43:41 +02:00
aryanrawlani28 bed05ea134 GUI: U32: Fix compilation errors across entire project
After the initial changes just to scummvm/gui for u32, this commit includes the whole project

- Widget creations now always have u32 descriptions, labels, or tooltips
- Message dialogs make use of default arguments instead of providing the same argument explicitly
- encode String::format properly before passing on as argument where necessary
- Modify hugo utils (yesNoBox and notify box) to use u32
- Also provide fake constructors for the above which redirect to the u32 constructor
- Convert all keymap descriptions to u32 across all engines
- showConfirmationDialog in mohawk now uses u32
- showScummVMDialog also uses u32
- Scumm engine has dialogs now which use u32
- General fixes and wrapping convertToU32String for setLabels and related functions
- Add a fake constructor to MesssageDialog which redirects to the u32 constructor
2020-08-30 14:43:41 +02:00
Cameron Cawley ad722f31cc SCI32: Allow using HQ video with pixel formats other than RGBA8888
This should fix Trac #11332.
2020-07-18 12:16:52 +02:00
Cameron Cawley 352653b8a2 GRAPHICS: Add a function for scaling a standard Graphics::Surface
This also makes use of it in the SCI and Wintermute engines
2020-07-18 12:16:52 +02:00
Cameron Cawley 00e3c03755 ALL: Remove unnecessary graphics/colormasks.h includes 2020-06-15 16:59:34 +01:00
Eugene Sandulenko 7a152e9af4 JANITORIAL: #include "engine.h" -> "engines/engine.h" 2020-05-10 23:45:43 +02:00
sluicebox 3deabc9873 SCI32: Add QuickTime support for KQ7 Mac movies 2020-04-20 15:59:32 -07:00
Eugene Sandulenko 8ef27002cb SCI: Fix compilation on platforms without RGB colors 2020-02-12 00:40:28 +01:00
Eugene Sandulenko c2778705d5 SCI: Fix compilation 2020-02-12 00:28:54 +01:00
sluicebox 3c8e5d75c5 SCI32: Fix VMDPlayer not leaving last frame
Applies _leaveLastFrame logic from VMDPlayer::closeComposited() to
VMDPlayer::closeOverlay() where it was missing.

Fixes bug #11299 in GK2
2020-01-05 00:45:25 -08:00
sluicebox 05b21ace68 SCI32: Implement VMD Censorship Blobs
Phantasmagoria 1's censorship mode is now supported

Trac #11229
2019-12-04 09:11:21 -08:00
sluicebox da9c7d3d5b SCI32: Fix VMDPlayer yielding when frames skipped 2019-12-04 09:11:21 -08:00
sluicebox b6692ac783 SCI32: Fix kPlayVMDPlayUntilEvent when passed zero
Fixes VMD playback in Phantasmagoria 1 while in censored mode.
kPlayVMDPlayUntilEvent is supposed to play until the last frame
when passed zero as the frame number to wait for.
2019-12-01 15:09:57 -08:00
Filippos Karapetis 9da3d22703 SCI: Fix MSVC warnings
- Remove unused parameters
- Initialize potentially uninitialized variables
- Use Common::String instead of a fixed buffer
- Remove redundant parentheses
- Change float suffix to be uppercase
- Fix spacing
- Fix integer left shifts with boolean variables
- Fix potential division by zero
- Fix missing breaks
2019-05-27 14:53:41 +03:00
Filippos Karapetis 27699a2e71 SCI32: Fix regression in VMD player 2018-12-27 15:03:22 +02:00
Filippos Karapetis 6a32f07ee8 SCI32: Add support for upscaling VMD videos
This feature can be used for the Windows version of KQ7, as well as
PQ:SWAT
2018-10-25 02:55:35 +03:00
Colin Snover c7c5f28bdb SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeight
This removes the unnecessary Buffer subclass and stops most places
where the output buffer was being interrogated about dimensions
instead of GfxFrameout.
2017-10-06 22:56:26 -05:00
Colin Snover c413030be3 SCI32: Clean up Video32
* Rewrap comments to 80 columns
* Clarify comments where appropriate
2017-10-06 22:10:51 -05:00
Colin Snover f46fa18006 SCI32: Stop trying to clean up uninitialized VMDs
Fixes Trac#10252.
2017-09-30 11:35:08 -05:00
Colin Snover 9a8070da3c SCI: Do some clean-up of event handling system
Convert macros and vars to enums, rename keyboard events in
preparation for adding key up events, clean up unnecessary nested
conditionals, add TODOs for potential future work.
2017-09-27 20:27:33 -05:00
Colin Snover 53dd55ebf2 SCI32: Fix bad palettes in Lighthouse when HQ video is enabled
In a couple of places, Lighthouse updates the renderer with screen
items for the next room before the room transition video plays.
This is normally fine when using the compositing video renderer
because the videos are drawn into new planes which occlude the
screen items, so the screen items are culled from the draw list
and do not submit their palettes. However, when in HQ video mode,
we currently force the overlay renderer, which was not blocking
screen items before forcing a frameOut, so the screen items'
palettes got submitted prematurely in this case and caused bad
rendering after the video finished playback.

Now, if we are forcing into the overlay code path, we still create
a blank plane behind the overlay before the forced frameOut in
order to correctly occlude screen items and keep them from
participating in rendering before they normally would.

Fixes Trac#10233, Trac#10235.
2017-09-24 16:22:40 -05:00
Colin Snover d363234129 SCI32: Fix GfxFrameout::addPlane from causing possible leaks 2017-09-19 19:54:30 -05:00
Colin Snover 533bb5b257 SCI32: Improve chance of rendering non-8bpp AVIs
OpenGL backends don't always support the pixel format that is
returned by the Indeo 3 decoder when playing the GK2A.AVI from the
GK2 demo. If this happens, use the backend's preferred pixel format
and convert in software.

If a backend doesn't support any 16-bit or 32-bit format, the
playback code will error out. This is probably fine, since there
are not really any of those any more.

Fixes Trac#9994.
2017-09-12 11:03:15 -05:00
Colin Snover 7545bb7133 SCI32: Clip videos to the screen
This is needed for 8.VMD in Lighthouse (room 380, the credits
room), which is rendered partially off the bottom of the screen.
OSystem does not accept rects that are offscreen.

Technically this video probably should not have been doubled
vertically by game scripts, but there is not enough space to fix
the rendering with a regular script patch, and it is a very
unimportant video.
2017-09-03 20:58:07 -05:00
Bastien Bouclet ec49730711 VIDEO: Allow setting the mixer sound type used to play audio tracks 2017-07-27 06:40:07 +02:00
Colin Snover 8d32353394 SCI32: Stop throttling of kFrameOut during interactive VMD playback
Refs Trac#9974, Trac#9975.
2017-07-23 10:35:13 -05:00
Colin Snover 2004aecb05 SCI32: Make stop flag condition more explicit 2017-07-23 10:35:13 -05:00
Colin Snover 2ed18b86db SCI32: Check for stop events before rendering the next frame
This should make things slightly more responsive and avoids
unnecessary rendering of frames that are just going to disappear
in a moment.
2017-07-23 10:35:13 -05:00
Colin Snover 0beb259278 SCI32: Improve performance when flushing events during video playback
Calling through EventManager::getSciEvent to flush events is
pretty inefficient and created stalls that lead to dropped
frames during the chapter 7 chase in Phantasmagoria 1.

If necessary, performance could be improved further by extending
Common::EventManager to expose SDL_FlushEvents, but this seems to
finish in 0-1ms so should be OK for now.

Refs Trac#9974, Trac#9975.
2017-07-23 10:35:13 -05:00
Colin Snover 3f0e061eaa SCI32: Refactor DuckPlayer to use common video playback code
This lets DuckPlayer support configurable black-lined video and
configurable high-quality scaling.
2017-07-06 19:12:39 -05:00
Colin Snover f15f9e3b7c SCI32: Refactor Video32 code to reduce code & feature duplication 2017-07-06 19:12:39 -05:00
Colin Snover 71256a0d3c SCI32: Improve playback quality of SEQ videos 2017-07-06 19:12:39 -05:00
Colin Snover 7057f232d7 SCI32: Improve kPlayVMD rendering
1. Added a new game option for linear interpolation when scaling
   overlay-mode video in ScummVM builds with USE_RGB_COLOR;
2. Implemented SCI2.1-variant of the VMD player renderer (fixes
   Trac#9857), which bypasses the engine's normal rendering
   pipeline;
3. Improved accuracy of the SCI3-variant of the VMD player by
   writing HunkPalettes into the VMD's CelObjMem instead of
   submitting palettes directly to GfxPalette32.
2017-07-06 19:12:38 -05:00
Colin Snover 8cb35442c0 SCI32: Improve kShowMovieWin (AVI) rendering
1. Added a new game option for linear interpolation when scaling
   video in ScummVM builds with USE_RGB_COLOR;
2. 8bpp videos that put black in a palette index other than 0
   (KQ7) should now always render correctly without the earlier
   game-specific workarounds which did not work very well;
3. Data from game scripts regarding video size and position are
   now ignored, since games always just try to show videos in the
   middle of the screen, but frequently get this a little bit
   wrong, causing either bad aspect ratios or off-center videos;
4. Builds without USE_RGB_COLOR support will not crash when
   attempting to play >8bpp AVIs, like those from KQ7 2.00b.

Fixes Trac#9843, Trac#9762.
2017-07-06 19:12:38 -05:00
Colin Snover 1fbee2f51e SCI32: Allow skipping SEQ animations
In SSCI, SEQ animations cannot be skipped.
2017-07-06 19:12:36 -05:00
Colin Snover 9f910535c9 SCI32: Centralise OSystem screen updates 2017-07-06 19:12:35 -05:00
Colin Snover f40ea8c2e7 SCI32: Stop setting unused palette timestamp property 2017-07-06 19:12:35 -05:00
Colin Snover 85105294f2 SCI32: Add some missing onFrame hooks for the debugger 2017-05-06 10:38:59 -05:00
Colin Snover 8a590e600f SCI32: Disable VMD kPlayFlagBlackPalette flag
Videos in GK2 use this flag (e.g. the chapter 6 intro).

Now that GfxPalette32::updateHardware no longer calls
OSystem::updateScreen (only GfxFrameout::frameOut does this now),
every time a palette swap occurs during playback, there is a frame
of blackness that should not exist. This is because the order of
operation is:

1. Send black palette
2. Call frameOut (which updates the screen)
3. Send new, correct palette
4. No frameOut (so the screen is not updated with the correct
   palette)

OSystem::updateScreen cannot be called multiple times for the same
frame due to vsync, but also, there does not appear to be any
reason to send a black palette, since it seems to be intended to
avoid temporarily rendering video frames with the wrong palette on
a hardware device that cannot guarantee simultaneous application
of a new palette and new pixel data. ScummVM does not have such
a problem, so this feature appears to be unnecessary for us.

For the moment, this 'feature' remains hidden behind an ifdef,
instead of being removed entirely, to avoid potential confusion
when comparing VMD code from SSCI.
2017-05-06 10:38:58 -05:00
Colin Snover 575ed98da1 SCI32: Centralize handling of pixel format switches 2017-05-06 10:38:58 -05:00
Colin Snover 09fea5f108 SCI32: Fix bad draw rectangle size in Duck video player
This was causing uninitialised garbage data from the scale buffer
to be drawn to the screen.
2017-04-23 13:07:25 -05:00
Colin Snover b8f0224b62 SCI32: Remove unused SegManager from DuckPlayer 2017-04-23 13:07:25 -05:00
Colin Snover 168774c3c6 SCI32: Add kPlayVMD subop 27 (SetPlane)
Used by RAMA, when playing a video at the Hub Camp computer at the
beginning of the game (room 1004).
2017-04-23 13:07:25 -05:00
Colin Snover 78fd8d39c5 SCI32: Disable brightness boost when black-lined video is disabled
The boost is intended to compensate for the darkness caused by the
black lines, so should not be applied when there are no black
lines. This fixes too-bright videos in at least LSL7.
2017-04-22 19:38:13 -05:00
Colin Snover 16fe6d3cb1 SCI32: Store handle to VMD bitmap separately from ScreenItem
In at least RAMA, when using the pocket computer to view a mail
and then pressing the "return" button, the ScreenItem containing
the VMD will be destroyed before the VMD player is told to close
the video, resulting in a use-after-free trying to access the
bitmap ID through the deleted ScreenItem.
2017-04-22 19:38:13 -05:00