aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/celobj32.cpp
AgeCommit message (Collapse)Author
2019-06-30SCI32: Extend scaler sanity checks to all SCI32 versionsFilippos Karapetis
Fixes QFG4 bug #10765. It's preferable to have sanity checks in the code, rather than crashing due to invalid draw rectangles from buggy game scripts. It's no use checking which specific interpreter versions had sanity checks and trust the game scripts of the other interpreters. Thus, it's easier and safer to always enable these sanity checks.
2018-06-29SCI: Use LarryScale in games that support it, not just LSL7Torbjörn Andersson
This is the solution discussed in bug #10568 ("SCI: PHANT1: Crash on startup"). I believe that it's the correct solution, and that ScummVM will do the right thing, but I'm not 100% sure.
2018-06-15SCI32: Only enable larry scaler for LSL7David Fioramonti
Fixes Trac#10568.
2018-03-16SCI: Add game option for enabling/disabling LarryScale in LSL7Daniel Wolf
All other SCI games continue using the default scaler.
2018-03-16SCI: Use LarryScale cel scaler instead of nearest-neighborDaniel Wolf
2017-10-06SCI32: Clean up scriptWidth/scriptHeight/screenWidth/screenHeightColin Snover
This removes the unnecessary Buffer subclass and stops most places where the output buffer was being interrogated about dimensions instead of GfxFrameout.
2017-10-06SCI32: Clean up CelObjColin Snover
* Rewrap comments to 80 columns * Clarify comments where possible * Use smart pointers where appropriate * Change view/pic flags detection to always use word-size (byte-size check for flag 0x80 was a compiler optimisation)
2017-09-15SCI32: Fix clipping of inventory items in Phant2Colin Snover
This fixes overlapping of the left arrow in all cases, but the scroll delta and initial offset of inventory items will only be fixed in new games because the affected objects are global objects whose bad properties get persisted into save games. Fixes Trac#10037.
2017-09-03SCI32: Implement kCelLinkColin Snover
kCelLink exists in SSCI since 2.1mid, but it is only known to be used in Lighthouse, during the weapon creation puzzle near the end of the game.
2017-07-13SCI32: Ignore chest view palette in PhantasmagoriaColin Snover
This fixes the 3-frame glitch that was also present in the original game when moving in the chapel from room 6500 to 6400 in chapter 7. Fixes Trac#9788.
2017-04-23SCI32: Fix out-of-bounds reads of truncated uncompressed celsColin Snover
This happens e.g. on the About page in LSL7 because of an interpreter problem where bitmap handles are destroyed and then reused without a kFrameOut call to remove old screen items from the visible plane list before a kIsOnMe call that causes the engine to try to read from reused bitmap handles with different contents and dimensions. This replaces bad memory reads on the About page in LSL7 with an assertion failure, until the problem with the About page can be properly addressed.
2017-03-27SCI: Implement bounds-checked reads of game resourcesColin Snover
2017-01-12SCI32: "Fix" renderer for PQ4CDColin Snover
PQ4CD and several other games contain a hack in two renderer methods to avoid rendering invalid screen items with zero or negative-dimension target rects. This prevents PQ4CD from crashing during the fifth phase of target practice.
2016-12-19SCI32: Add support for alternate graphics selectorsColin Snover
Used by at least Phantasmagoria 2.
2016-11-02SCI32: Automate kNumCels workaroundColin Snover
2016-10-09SCI32: Clarify some identifiersColin Snover
transparentColor -> skipColor displace -> origin scaledWidth -> xResolution scaledHeight -> yResolution
2016-10-01SCI32: Make kNumCels error more detailedColin Snover
2016-09-29SCI32: Clean up and document GfxPalette32Colin Snover
2016-09-29SCI: Deduplicate call origin formattingColin Snover
2016-09-29SCI32: Add workaround for kNumCelsColin Snover
This workaround may be able to be vastly simplified in the future since, so far, simply returning the number of cels in loop 0 is enough to make all the scripts with this bug work as expected.
2016-09-29SCI32: Extra bounds checking in CelObj rendererColin Snover
2016-09-29SCI32: Always build scaler tables to the maximum possible sizeColin Snover
This fixes rendering errors in Torin caused by the scaler table being cut off early when cels larger than the dimensions of the screen are scaled.
2016-09-29SCI32: Fix CelObj scaling in games with hi-res scriptsColin Snover
2016-09-29SCI32: Add a trap for invalid calls to kNumCelsColin Snover
2016-08-24SCI32: Remove extra ! in error messageColin Snover
2016-08-24SCI32: Fix incorrect boolean operatorColin Snover
2016-08-24SCI32: Remove error check for negative celNoColin Snover
Negative cel numbers are exploited by at least the hi-res mode of PQ4CD.
2016-08-19SCI32: Increase maximum line width for graphicsColin Snover
Torin renders pics that are wider than 1024px; SCI3 bumps the maximum line width to 4k.
2016-08-19SCI32: Add some bounds checking, const-correctness, and errors to CelObjColin Snover
2016-08-19SCI32: Remove GfxScreen from SCI32Colin Snover
2016-08-01SCI32: Add bitmap segment and remove GC option from hunk segmentColin Snover
2016-07-27SCI32: Remove dead placeholder rendering codeColin Snover
2016-07-11SCI32: Split GfxPalette and GfxPalette32 + HunkPaletteColin Snover
2016-07-10SCI32: Add support for blacklined videoColin Snover
Ow. My eyeballs.
2016-07-01SCI32: Fix bad rendering of subtitle backgrounds in TorinColin Snover
The way dimensions of scaled screen items are calculated changed over the lifetime of SSCI. In early low-resolution and mixed-resolution games, scaled drawing needed to use at a global cadence across the entire screen to ensure proper alignment, but in later games (like Torin), local scaling of individual screen items seems to be the way scaling is performed.
2016-06-30SCI32: Add low resolution constantsColin Snover
In a few places in the graphics system, fixed low-resolution values are used instead of the game script resolution.
2016-06-26SCI32: Fix broken Remap implementationColin Snover
Remap would crash SCI2.1early games with 19 remap slots, and did not actually work in most cases in SCI2.1mid+ games. The SCI16 implementation was moved to its own separate file but was otherwise touched as little as possible, so may still have similar problems to the SCI32 code. 1. Split SCI16 and SCI32 code into separate files 2. Use -32 prefixes for SCI32 code and no prefix for SCI16 code, where possible, to match other existing code 3. Avoid accidental corruption of values from the VM that may be valid when signed or larger than 8 bits 4. Added documentation 5. Add missing remap CelObj calls 6. Inline where possible in performance-critical code paths 7. Fix bad `matchColor` function, and move it from GfxPalette to GfxRemap32 since it is only used by GfxRemap32 8. Fix bad capitalisation in getCycleMap 9. Remove unnecessary initialisation of SingleRemaps 10. Update architecture to more closely mirror how SSCI worked 11. Clarify the purpose of each type of remap type (and associated variable names) 12. Split large `apply` function into smaller units 13. Fix buffer overrun when loading a SCI2.1early game with remap 14. Remove use of `#define` constants 15. Warn instead of crashing with an error on invalid input (to match SSCI more closely) 16. Change the collision avoidance mechanism between the RemapType enum and remap kernel functions 17. Add save/load function
2016-05-27SCI32: Add explicit checks for null pointersColin Snover
CID 1351617, 1351618, 1351619, 1351620, 1351621, 1351622, 1354791.
2016-05-27SCI32: Initialise pointers in CelObj scalerColin Snover
This ensures that if there is a bug in the drawing code that causes the row to be unset, it will not result in silently reading garbage out of random memory. CID 1354802
2016-05-27SCI32: Fix CelObj cacheColin Snover
The previous implementation did not work properly, assigning the next insertion index to the oldest object instead of filling empty cache slots on a cache miss.
2016-03-16SCI32: Implement analyzeForRemap()Filippos Karapetis
2016-03-16SCI32: Implement the remapping drawing functionsFilippos Karapetis
2016-03-16SCI32: Implement analyzeUncompressedForRemap()Filippos Karapetis
2016-03-16SCI32: SpacingFilippos Karapetis
2016-03-16SCI32: Remove dead code related to priority map handlingFilippos Karapetis
The priority map is not used at all in SCI32 at the engine level by design, so all the relevant code that handles picture priority is pretty much dead
2016-03-15SCI32: More work on remappingFilippos Karapetis
Still not working
2016-03-13SCI32: Fix scaler drawing pixels at the wrong positionsColin Snover
In order for scaling ratios to apply equally across objects that start at different positions on the screen, the pixels that are read from the source bitmap must all use the same pattern of division. In other words, cels must follow the same scaling pattern as if they were drawn starting at an even multiple of the scaling ratio, even if they were not.
2016-03-13Revert "SCI32: Fix small inaccuracy in the scaling drawing code"Colin Snover
This reverts commit d85eb8ded68a20de383d84064aacd1a4c81db4e9. This patch did not correctly fix the scaler to follow the same rules as SSCI and only worked on the y-axis.
2016-03-13SCI32: Fix small inaccuracy in the scaling drawing codeMartin Kiewitz
Previously sourcePos was always originating from plain 0, 0 which made some pixels not always getting drawn at the right spot when uneven scaling was used (for example 5:12). Seems to fix gabriel knight 1 hires graphic issues
2016-03-08SCI: Slight template formatting fixes.Johannes Schickel