Commit Graph
3567 Commits
Author SHA1 Message Date
VelocityRa f2f420e15f GRAPHICS: Skeleton of MacTextWindow
Needed to add 2 helper methods to MacWindowManager to make it cleaner
2017-07-17 23:45:22 +02:00
VelocityRa b28a4a8c3d GRAPHICS: Fix MacText::appendText by resizing _textLines
Also fix an off-by-one error
2017-07-17 23:45:22 +02:00
Eugene Sandulenko 940b2a20f1 Revert "COMMON: Change way the Singleton instances are instantiated"
This reverts commit eefa72afa1.

With this patch ConfigManager is broken.
2017-07-10 21:17:41 +02:00
Thierry Crozat eefa72afa1 COMMON: Change way the Singleton instances are instantiated
This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
2017-07-10 21:11:20 +02:00
Colin Snover 7ce2e4cf08 GRAPHICS: Allow nearest neighbor scaling of 1Bpp and 2Bpp TransparentSurfaces
This is one small step toward allowing more shared usage of
existing scaling code.
2017-07-06 19:12:36 -05:00
Vincent Pelletier 57eda6aef0 GRAPHICS: Include bytesPerPixel in toString representation 2017-05-27 09:39:08 +02:00
Vincent Pelletier 009d3320b3 TINYGL: Compute surface pixel count once only in BlitImage::loadData
Cartesian coordinates are not actually needed here, so simplify
computations by just using a pixel offset.
2017-05-15 10:31:25 +00:00
Vincent Pelletier 241114cbd0 GRAPHICS: Make PixelBuffer::clear take pixel format into account 2017-05-13 14:00:50 +00:00
Vincent Pelletier a1bc91c906 GRAPHICS: Preserve alpha component in PixelBuffer::copyBuffer 2017-05-13 14:00:50 +00:00
Tobia Tesan 6a741a88c9 GRAPHICS: Pass interlinear as constructor argument to MacText 2017-05-02 21:01:23 +01:00
Vincent Pelletier 77a4672530 TINYGL: Enable dirty rectangle by default. 2017-05-02 09:57:09 +00:00
Vincent Pelletier d797461fa9 TINYGL: Clip dirty rectangle to render rectangle.
As all dirty rectangles are inflated by 1 pixel to the right and one to the
bottom, they may exceed render rectangle. So clip them again. There should
be very few rectangles at this point, so this should be cheap.
2017-05-02 09:57:09 +00:00
Vincent Pelletier 290d6a3b6d TINYGL: Initialise a1 in fillTriangleFlat code path
fillTriangleFlat has kDrawLogic == DRAW_FLAT and interpRGB == false,
causing this variable to be used uninitialised.
Found by removing default values on all locals.
2017-05-02 09:42:06 +00:00
Vincent Pelletier 7988c696d9 TINYGL: Drop unused Framebuffer pixelbits property 2017-05-01 08:34:53 +00:00
Vincent Pelletier eeedf4de06 TINYGL: Deduplicate PixelFormat retrieval in zblit
For some reason, loadData hardcodes a pixel format.
At least avoid duplicating it in Line constructor.
Likewise, avoid duplicating access to framebuffer's pixel format when
constructing a Line from another.
Also, avoid over-allocating Line, as its size argument is counted in pixel,
not in bytes.
2017-05-01 08:34:53 +00:00
Vincent Pelletier 4bcc95f217 TINYGL: Fix ARGBST scaling.
I based ARGB scaling on ST scaling without giving it enough thought.
It accidentally uncovered an older bug in glopClear, which made me recheck
these formulas.
ST scaling maps [0.0, 1.0] to [0x01.0000, 0xff.0000], meaning the first and
last texture rows and columns are never shown.
Treating s and t as proportions of ST_MAX fixes this by mapping to
[0x00.0000, 0xff.fffc] (last two fractional bits being off-precision, as
there are only 14 bits), covering the whole available range.
2017-05-01 08:34:25 +00:00
Vincent Pelletier 8c1954359e TINYGL: Fix glopClear
ClearBufferDrawCall expects 0..255 color values, not the internal 16-bits
fixed-point format.
Also, fix a typo in glopClear on Z scaling.
2017-05-01 08:32:25 +00:00
Vincent Pelletier 92a54a5969 fixup! TINYGL: Fix line color
These shifts are now handled in zline (only user of this macri),
consistently with ztriangle.
I have removed this macro from my working copy, but I missed the breakage
while resolving the conflict.
2017-05-01 04:45:11 +00:00
Vincent Pelletier 39656ce5c5 TINYGL: Store colors with 8-bits integer part
Before this change vertex data (post-shading) was limited to 6 (green) or
5 (all others) bits of precision.
Interpolation happened with 8-bits precision, so the visual effect is
minor: about 4 off at vertices.
2017-05-01 02:22:17 +00:00
Vincent Pelletier 054a2bd920 TINYGL: Fix line color
As in ztriangle, vertex color must be shifted from internal 16-bits
fixed-point format to 8-bits colors.
To do so, define values similar to the ones describing for ST fixed-point
format.
Also, use these in tglClear instead of hard-coded multiplicands, as is
done in tglColor4f and gl_transform_to_viewport.
Also, make tglClear take into account requested clear depth.
2017-05-01 02:21:40 +00:00
Vincent Pelletier 1d3d581870 TINYGL: Use same default clear depth as OpenGL 2017-05-01 02:19:42 +00:00
Tobia Tesan ed2f09b13f GRAPHICS: Delete MacFont in MacText 2017-04-30 09:48:08 +02:00
Tobia Tesan af664fe757 GRAPHICS: Use MacFont in lieu of Graphics::Font in MacText 2017-04-30 09:48:08 +02:00
Vincent Pelletier df62c19a88 TINYGL: const-ify all vector API parameters 2017-04-29 14:04:13 +00:00
Vincent Pelletier 5f993ac66f TINYGL: TGL_LINE_STRIP and TGL_LINE_LOOP are one line appart 2017-04-28 21:54:11 +00:00
Vincent Pelletier 5ab94de318 TINYGL: Avoid unneeded calls in writePixel. 2017-04-26 13:11:00 +00:00
Vincent Pelletier fc37fabf0d TINYGL: Fix assertion failure during EMI intro video.
This is a regression introduced by
commit 6a63f544f0
    TINYGL: Avoid duplicating gl_transform_to_viewport.
2017-04-25 00:58:24 +00:00
Vincent Pelletier 2a1ab0a622 TINYGL: Do not queue invisible draw calls.
When dirty rectangles are enabled, we know at this point whether a draw
operation will have any effect on screen. Do not queue it if it will not.
2017-04-23 12:30:00 +00:00
Vincent Pelletier bf319b5437 TINYGL: Cache and clip dirty rect on all DrawCall subclasses.
getDirtyRegion will be called twice on each DrawCall instance, so make
repeated work as short as possible.
2017-04-23 12:30:00 +00:00
Vincent Pelletier 6a63f544f0 TINYGL: Avoid duplicating gl_transform_to_viewport.
Replace local implementation by always setting GLVertex zp property.
Replace pointInsideVolume by clip_code, allowing to properly handle
polygons whose vertices are all off-screen but still have a part visible.
Also, replace 2-pixels offset with a more accurate bounding box
computation.
2017-04-23 12:30:00 +00:00
Vincent Pelletier 50c5aef6e5 Revert "TINYGL: Reuse renderRect instead of accessing fb size."
This reverts commit ec418a9769.
2017-04-23 12:25:58 +00:00
Vincent Pelletier ec418a9769 TINYGL: Reuse renderRect instead of accessing fb size. 2017-04-23 12:03:52 +00:00
Vincent Pelletier 064bd1d47b fixup! TINYGL: ClearBufferDrawCall should obey its parameters.
Fixes an undeclared property error.
2017-04-23 11:54:53 +00:00
Vincent Pelletier 6087492dbd TINYGL: Simplify setting & disabling scissors. 2017-04-23 10:35:04 +00:00
Vincent Pelletier e1de3407f1 TINYGL: Make scissors follow Common::Rect semantics.
As per Common::Rect data model, right and bottom border are excluded, so:
- Make FrameBuffer::scissorPixel reject bottom & right borders.
- Update bounding rectangle definition for dirty rectangle operations
  ClearBufferDrawCall::getDirtyRegion is already correct.
- zblit was almost following, except for an off-by-one mistake.
2017-04-23 10:35:04 +00:00
Vincent Pelletier 3acde7d900 TINYGL: static-ify zdirtyrect.cpp 2017-04-23 10:35:04 +00:00
Vincent Pelletier 2fb2d87dc9 TINYGL: Skip drawing when there is no dirty rectangle 2017-04-23 10:35:04 +00:00
Vincent Pelletier 72389d23df TINYGL: Simplify _drawCallAllocator switch & reset. 2017-04-23 10:35:04 +00:00
Vincent Pelletier 580578fa20 TINYGL: Containment is just a special case of intersection. 2017-04-23 10:35:04 +00:00
Vincent Pelletier 3f4a22354e TINYGL: Remove redundant condition.
Empty call queue condition is tested in contained "for" loop already.
2017-04-23 10:35:04 +00:00
Vincent Pelletier 5cbdabb69d TINYGL: Continue comparing past first divergence
It is common that the same number of calls are done in the same order, so
do not stop comparing after the first divergence. This saves a significant
number of dirty rectangle in crowded scenes, like sets cn and bi where a few
calls may differ in the middle of call sequence, but later calls would stay
the same.
As a consequence, move current-frame-has-fewer-calls handling to its own
loop.
Also, factorise and extend code appending dirty rectangles.
Also, skip conseutive identical rectangles.
2017-04-23 10:35:04 +00:00
Vincent Pelletier ce97ff4e8f TINYGL: ClearBufferDrawCall should obey its parameters.
Given dirty rectangle may cover more buffer area than what it was told to
clear.
2017-04-23 10:35:04 +00:00
Vincent Pelletier cc42d5cb24 TINYGL: Fix scissor testing in ztriangle.
When dirty rectangles are enabled, fixes drawing outside (below) set scissor
rectangle.
y and pp1 must stay consistent for scissor testing to be relevant. y is
already incremented along with pp1, and pp1 does not get re-assigned on
part == 2, so do not set y either.
2017-04-23 10:35:04 +00:00
Vincent Pelletier 500803fc38 TINYGL: Implement tglDrawArrays. 2017-04-22 16:42:14 +00:00
Vincent Pelletier 0b823ac2e9 TINYGL: Expose array functions outside of TinyGL namespace.
And prefix them with "tgl" instead of "gl", as in header.
2017-04-22 16:42:14 +00:00
Eugene Sandulenko 319bbcfbf1 GRAPHICS: Hid noisy warning in MacFontManager 2017-03-12 16:20:00 +01:00
Paul Gilbert 1a25abbd73 GRAPHICS: Apply eriktorbjorn's fix for non-origin transBlitFrom calls 2017-02-21 20:41:35 -05:00
stevenhoefel 7d044c570c GRAPHICS: Recalculate text area sizing if interLinear is changed. 2017-02-07 16:26:59 +11:00
Eugene Sandulenko 6ea020d5f1 GRAPHICS: Cleanup MacText code 2017-02-06 08:41:09 +01:00
stevenhoefel c48273d913 GRAPHICS: Return line count of formatted MacText. 2017-02-06 12:47:41 +11:00