53 Commits

Author SHA1 Message Date
Eugene Sandulenko
b438f6fb07 DIRECTOR: Fix warnings 2020-08-23 01:23:28 +02:00
Eugene Sandulenko
e27d5ac7fc DIRECTOR: JANITORIAL: Code formatting and unified the namespace end comments 2020-08-21 00:36:19 +02:00
Eugene Sandulenko
b2030d9e1c DIRECTOR: Code reshuffling for readability 2020-08-21 00:21:32 +02:00
Eugene Sandulenko
afc972f584 DIRECTOR: Split out static data from graphics.cpp
Actually, we'd better move it to director.dat file
2020-08-21 00:18:30 +02:00
Eugene Sandulenko
3f160561d6 DIRECTOR: Fixed for 32bpp mode, things work 2020-08-16 23:08:33 +02:00
Eugene Sandulenko
7370a946e3 DIRECTOR: Make ink drawing 32bpp-compatible 2020-08-16 00:59:05 +02:00
Eugene Sandulenko
e604c97607 GRAPHICS: MACGUI: Made MacDrawPixel bpp-aware 2020-08-15 16:09:20 +02:00
Eugene Sandulenko
5ea23f666f DIRECTOR: Make rendering tests work in 32bpp 2020-08-15 14:50:26 +02:00
Eugene Sandulenko
66f5aadf4e DIRECTOR: Do not set palette in 32bpp mode 2020-08-14 10:47:33 +02:00
Nathanael Gentry
68d2852e90 DIRECTOR: Permit reassigning palette IDs 2020-08-03 11:01:49 -04:00
Nathanael Gentry
d92a3f33b0 DIRECTOR: Implement basic alpha transparency
This finishes the implementation for blend of sprite, as well.
2020-07-29 00:47:26 -04:00
Nathanael Gentry
ea75044ae1 DIRECTOR: Load palette castmembers
The loadPalette is also turned into a value-returning function.
2020-07-27 18:04:12 -04:00
Nathanael Gentry
74454b0434 DIRECTOR: Properly initialize current palette id 2020-07-27 09:07:02 -04:00
Nathanael Gentry
b3b7ed19a4 DIRECTOR: Rework palette handling
Now there is no static for default palettes. All the defaults have negative ids
anyway, so those are just protected by the new setter method.
2020-07-26 23:46:06 -04:00
Nathanael Gentry
c98cea16b4 DIRECTOR: Keep track of loaded palettes 2020-07-26 17:45:40 -04:00
djsrv
a67e4bee50 DIRECTOR: Update screen in DirectorEngine::draw 2020-07-21 17:34:22 -04:00
Scott Percival
8af755c7e3 DIRECTOR: Fix b_updateStage to redraw the screen 2020-07-11 12:30:58 +08:00
Nathanael Gentry
9a4aeffc25 DIRECTOR: Refactoring for implementing stretch of sprite 2020-07-09 15:53:59 -04:00
Nathanael Gentry
e672c8a844 DIRECTOR: Remove some hardcoded colours 2020-07-09 13:38:25 -04:00
Nathanael Gentry
0bffd5d616 DIRECTOR: Reorganize control of DirectorPlotData
The Channel is also made into a class.
2020-07-09 13:31:32 -04:00
Nathanael Gentry
9652a17acf DIRECTOR: Make invert-on-click faster 2020-07-09 13:31:27 -04:00
Nathanael Gentry
ea48193089 DIRECTOR: Add manual ink fixup mode
This is necessary because texts and shapes, in particular, come already
colourized and we need to adjust the colourization to match the ink style before
we get to the blitting step. This seems faster than copying the surface or just
keeping the text as a mask and colourizing the chunks as we go.
2020-07-09 09:40:14 -04:00
Nathanael Gentry
3b4c416fbf DIRECTOR: Apply fore/back colours to basic inks
Note that the colourization of copy-family inks is very inefficient.
2020-07-08 12:50:32 -04:00
Nathanael Gentry
fbc201ef90 DIRECTOR: Condition arithmetic inks all at once 2020-07-06 21:23:02 -04:00
Nathanael Gentry
558156c54f DIRECTOR: Render implicit mattes with not* inks 2020-07-06 21:23:02 -04:00
Nathanael Gentry
47fba684d9 DIRECTOR: Make source pixel not a pointer 2020-07-06 21:23:02 -04:00
Nathanael Gentry
bf785fc8f4 DIRECTOR: Selectively invert sprites on click 2020-07-06 11:37:35 -04:00
Nathanael Gentry
664acb795d DIRECTOR: Refactor missing surface warning 2020-07-06 11:37:35 -04:00
Nathanael Gentry
fc4478930b DIRECTOR: Only decompose colours for inks that need them 2020-07-03 17:04:03 -04:00
Nathanael Gentry
a8b779ee0e DIRECTOR: Lazily load ink masks
This is for mask and matte inks. Now, rather than a bitmap sprite requiring a
flood fill every time (for mask ink) the matte is created and cached when matte
ink is first requested on that cast. Mask ink does not require a new surface to
be created, but it uses the same new channel interface.
2020-07-03 13:19:06 -04:00
Nathanael Gentry
9f24eabcf8 DIRECTOR: Move to bitwise rendering of reverse sprites
Some functionality may be lost here, as the old drawReverseSprite seems to have
dealt with more edge cases, but these can be reimplemented as they are needed.
With my bitwise method, reverse ink issues in Warlock and our colour testing
movie are fixed.
2020-07-03 10:40:24 -04:00
Nathanael Gentry
bc38519523 DIRECTOR: Fix bitwise reverse ink 2020-07-03 09:00:06 -04:00
Nathanael Gentry
d04934a54f DIRECTOR: Move rendering to a Stage class
This commit introduces several changes to the rendering pipeline.

 - Rather than having a window for each score that is played, there is a Stage
   in g_director that is only cleared when the upcoming stage has a different
   size. This permits transitions still clean transitions between movies.

 - Rather than relying upon general surface blitting functions, there is
   progress toward a custom blitter than makes working with inks much easier. A
	 pixelwise function, inkDrawPixel, has been introduced.

 - The mask-based approach to incremental rendering has been abandoned, as it
   caused performance issues and strange rendering bugs. Now the renderer
	 operates on a traditional list of dirty rects that must be redrawn.

 - QuickDraw shapes are more closely integrated with the renderer, and they do
    not require a temporary surface to draw.
2020-06-30 12:38:46 -04:00
Eugene Sandulenko
38a5b8e9ef DIRECTOR: Moved all director test-related code to tests.cpp 2020-06-04 00:07:34 +02:00
Roland van Laar
4ee354545b DIRECTOR: Grammer fix in transformColor's comment. 2020-03-28 13:09:11 +01:00
Eugene Sandulenko
4158e73b4d DIRECTOR: Added mouseUp and mouseDown cursors 2020-03-27 02:01:06 +01:00
Roland van Laar
124b9ecc31 DIRECTOR: transformColor in non _vm places
- future proofing transformColor by using an uint32 instead of a byte
- handling cases where there is no reference to _vm by using
g_director->.
2020-03-21 14:45:08 +01:00
Roland van Laar
6bfcb9197d DIRECTOR: implement transformColor function
The palettes are reversed by default. This is useful when rendering
sprites, as they use reversed ids as well.
When a color is read directly as an int, it is in the original
unreversed order.
So, reverse it by hand when it's coming from lingo or other sources.
This was done in multiple places by subtracting the color id from 255.
The function transformColor handles this now.

Reversing the color means: 255 - color_id.
2020-03-21 14:35:17 +01:00
Scott Percival
91f7d856af DIRECTOR: Add V4 builtin palettes, support for loading the movie default 2020-01-11 23:30:40 +08:00
Eugene Sandulenko
b0d31a2afa DIRECTOR: Improve error messages 2020-01-09 18:10:11 +01:00
Eugene Sandulenko
d5687eb222 DIRECTOR: Simplify palette transformations 2019-12-25 02:12:55 +01:00
Eugene Sandulenko
85b67d8771 DIRECTOR: Added palette transformation routine 2019-12-25 02:00:17 +01:00
Eugene Sandulenko
1cf7fd9196 DIRECTOR: Added test routine for drawing palette 2019-12-25 01:50:30 +01:00
Eugene Sandulenko
8c59f07951 DIRECTOR: Replace palette data with hex numbers 2019-12-25 01:35:04 +01:00
Eugene Sandulenko
1e6ec8f3ac DIRECTOR: Finish work on reducing header dependency 2019-12-24 00:42:30 +01:00
Eugene Sandulenko
f37f24e8c0 DIRECTOR: Added comments to screen update calls 2019-12-11 12:04:27 +01:00
Eugene Sandulenko
57b9a08a20 DIRECTOR: Plug MacWindowManager in 2019-12-11 11:53:54 +01:00
Colin Snover
432fd522d2 ENGINES: Remove default1x scaler flag
This flag is removed for a few reasons:

* Engines universally set this flag to true for widths > 320,
  which made it redundant everywhere;
* This flag functioned primarily as a "force 1x scaler" flag,
  since its behaviour was almost completely undocumented and users
  would need to figure out that they'd need an explicit non-default
  scaler set to get a scaler to operate at widths > 320;
* (Most importantly) engines should not be in the business of
  deciding how the backend may choose to render its virtual screen.
  The choice of rendering behaviour belongs to the user, and the
  backend, in that order.

A nearby future commit restores the default1x scaler behaviour in
the SDL backend code for the moment, but in the future it is my
hope that there will be a better configuration UI to allow users
to specify how they want scaling to work for high resolutions.
2017-10-07 12:30:29 -05:00
Eugene Sandulenko
db67feba5b JANITORIAL: Whitespace optimisations 2017-03-12 11:15:13 +01:00
Eugene Sandulenko
415bd56444 DIRECTOR: Janitorial: Fix code formatting 2017-03-02 23:12:42 +01:00