25 Commits

Author SHA1 Message Date
Vincent Pelletier
a6af3a38a3 TINYGL: Fix vertice color when clipped and lighting is disabled
longcurrent_color is assigned per vertex, but it is not saved on each
vertex on creation (unlike their "color" attribute, used when lighting
is enabled).
As a consequence, and because rendering happens asynchronously (rather,
following the draw call queue managed by zdirtyrect.cpp when requested
to flip current buffer), longcurrent_color at clipping time can be
different to the one at vertex declaration time, causing color artifacts.

The effect is most noticeable in EMI set shi, in the grog dispenser +
shipyard manager closeup angle, when Guybrush exits the screen by
crossing its right border: dark triangles become visible on his face.

Instead, always use the color attribute, which is already properly
initialised on vertex creation.
2017-07-20 01:51:07 +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
df62c19a88 TINYGL: const-ify all vector API parameters 2017-04-29 14:04:13 +00:00
Vincent Pelletier
4ff03d060e TINYGL: Call tglColor4f from tglColor4fv. 2016-07-21 16:40:07 +02:00
Vincent Pelletier
6f1e46d6b4 TINYGL: Implement tglColor3ub. 2016-07-11 00:00:30 +00:00
Dries Harnie
06d077d00d TINYGL: Rename glColor3fv to tglColor3fv
Linking TinyGL and OpenGL into the same binary could cause conflicts
because both have a glColor3fv function.
It is currently not used in ResidualVM, so it is safe to change this.
2014-09-28 12:14:44 +02:00
Stefano Musumeci
974f47fa42 TINYGL: Added a way to disable or enable dirty rectangles at runtime. 2014-08-16 16:04:10 +02:00
Pawel Kolodziejski
1b48414d7e TINYGL: cleanup license headers 2014-08-13 18:52:52 +02:00
Pawel Kolodziejski
7be4ec6800 TINYGL: remove GLU leftovers 2014-07-10 07:29:49 +02:00
Pawel Kolodziejski
1b8dd28bc7 TINYGL: implemented tglDepthFunc 2014-07-04 23:14:44 +02:00
Pawel Kolodziejski
b4962f645e TINYGL: added tglAlphaTest stubs 2014-07-04 08:43:19 +02:00
Stefano Musumeci
a77ebef942 MYST3: Fixed incorrect viewport issues. 2014-07-03 12:33:06 +02:00
Stefano Musumeci
bceb1a7516 TINYGL: Added a few utility functions in TinyGL 2014-07-03 12:33:03 +02:00
Stefano Musumeci
63fd685589 TINYGL: Implemented alpha interpolation in triangle rasterization routine. 2014-07-01 14:29:44 +02:00
Stefano Musumeci
10c25d49d4 TINYGL: Added external interface for tglBlendFunc 2014-07-01 14:25:36 +02:00
Stefano Musumeci
1a5b6272fc TINYGL: Refactored the name of FrameBuffer instance from zb to fb 2014-06-28 20:39:09 +02:00
Einar Johan Trøan Sømåen
698ef4a37c TINYGL: Use astyle to (semi-selectively) apply the code-formatting conventions to TinyGL. 2014-02-20 18:46:49 +01:00
Einar Johan Trøan Sømåen
b21271bd82 TINYGL: Put declaration of counting variable inside for-construct. 2014-02-20 18:06:04 +01:00
Dries Harnie
6bd38b1801 TINYGL: Support ColorMask
Note, this is just basic support, it is either all or nothing.
Disabling select channels is not possible.
2013-07-02 00:22:59 +02:00
Einar Johan T. Sømåen
3394bd15ef TINYGL: Add tglColor4ub, to have less diff between tgl-code and gl-code 2012-01-10 09:10:16 +01:00
Vincent Pelletier
e3cd3286cd Add some missing gl_add_op.
Found by gcc 3.6 -Wunused-but-set-variable .
2011-05-05 05:08:34 +08:00
Giulio Camuffo
66bba94bcf Fixed some warnings. Patch by Torbjorn Andersson. 2011-04-05 21:45:20 +02:00
Pawel Kolodziejski
49b578ec6a put tinygl internals into namespace, left only api 2009-05-25 13:19:29 +00:00
Pawel Kolodziejski
110527019b make compilable after latest change 2009-05-08 07:32:33 +00:00
Pawel Kolodziejski
f85c21fa4c moved tinygl 2009-05-08 07:17:43 +00:00