Commit Graph
482 Commits
Author SHA1 Message Date
Paweł Kołodziejski 4e34da3746 TINYGL: Eliminate passing context 2021-12-07 09:54:19 +01:00
D G Turner b9ef0b49f4 TINYGL: Fix GCC Compiler Pedantic Warning 2021-12-07 00:31:48 +00:00
Paweł Kołodziejski c1512a5c40 TINYGL: Eliminate passing context where possible 2021-12-07 00:58:14 +01:00
Paweł Kołodziejski d80bd265d2 TINYGL: Rearrange visibility various functions 2021-12-06 13:57:41 +01:00
Paweł Kołodziejski 8ed00821ac TINYGL: Attempt to fix compilation 2021-12-05 23:00:15 +01:00
Paweł Kołodziejski 9f7a903b10 TINYGL: Mark private/public entries in FrameBuffer class 2021-12-05 22:30:52 +01:00
Paweł Kołodziejski 31421a4504 TINYGL: Drop BGRA pixel format 2021-12-04 22:16:22 +01:00
Paweł Kołodziejski dff981f90b TINYGL: Implement internal format argument handling for tglTexImage2D 2021-12-04 14:39:07 +01:00
Paweł Kołodziejski 44b4b2f740 TINYGL: Fixed multi texture generation calls 2021-12-04 14:29:25 +01:00
Paweł Kołodziejski 86dc65250e TINYGL: Cleanup code 2021-12-04 14:27:35 +01:00
Paweł Kołodziejski bb340c3b2b TINYGL: Moved static global array to dynamic array 2021-12-04 11:47:03 +01:00
Paweł Kołodziejski e5b055d064 TINYGL: Cleanup texture pixel formats 2021-12-04 01:09:12 +01:00
Paweł Kołodziejski dd50e1a6bc TINYGL: Formatting 2021-12-04 01:06:37 +01:00
Paweł Kołodziejski 6f3b535752 GRIM,STARK,TINYGL: Fixed BE drawing issues. 2021-11-29 22:34:13 +01:00
Paweł Kołodziejski 0c59f5a673 TINYGL: Moved PixelBuffer to TinyGL 2021-11-27 21:29:02 +01:00
Paweł Kołodziejski af37825be3 ENGINES: Replace PixelBuffer with Surface 2021-11-27 20:14:44 +01:00
Paweł Kołodziejski d42e8dba6c TINYGL: Fixed mismatch malloc/new 2021-11-27 18:32:10 +01:00
Paweł Kołodziejski 8422a9720e TINYGL: Fixed reading outside of buffer 2021-11-27 01:09:40 +01:00
Paweł Kołodziejski ff7f542846 TINYGL: Fixed normal array element 2021-11-09 19:49:42 +01:00
Paweł Kołodziejski a8dcf7dbbd TINYGL: Added check if texture is uploaded 2021-11-09 17:09:13 +01:00
Paweł Kołodziejski 41cc63588d TINYGL: Fixed vertex arrays 2021-11-09 08:04:08 +01:00
Paweł Kołodziejski 82e405a4ac TINYGL: Fixed tglViewport transformation 2021-11-08 08:57:19 +01:00
Paweł Kołodziejski 760699ab0f TINYGL: Added check if texture is selected to avoid textured triangle path 2021-11-07 15:44:45 +01:00
Paweł Kołodziejski 318c40b0f7 TINYGL: Added check for tglTexImage2D if texture is selected before 2021-11-07 15:42:32 +01:00
Paweł Kołodziejski 06b5c259d6 TINYGL: Fixed index in arrays and expanded to other data types. 2021-10-27 22:11:59 +02:00
Paweł Kołodziejski eab1fe4097 TINYGL: Implemented tglPolygonOffset function 2021-10-26 21:59:04 +02:00
Paweł Kołodziejski d5c1d52198 TINYGL: Added tglDrawElements 2021-10-20 22:20:28 +02:00
Fiodar Stryzhniou 894f4916f5 GRAPHICS: Fix warnings for header search failure.
WARNING: Can't find following headers in User or System Include Paths "opinfo.h"
2021-06-26 08:46:07 +03:00
Orgad Shaneh a05e54f00c JANITORIAL: Remove trailing whitespaces 2021-05-04 11:46:30 +03:00
Eugene Sandulenko 5e7fe2dc57 JANITORIAL: Replace spaces in indentation with tabs 2021-04-15 21:20:36 +02:00
Orgad Shaneh ce5b27f82f TINYGL: Implement a real operator=
With logic similar to the copy ctor.
2021-03-15 13:25:01 +00:00
D G Turner 7beaae25ba TINYGL: Fix Compilation with pre-C++-11 Compilers 2021-03-13 19:42:56 +00:00
D G Turner 4a5e96ce6f TINYGL: Fix GCC Warning for Implicit Copy Operator
This is emitted when -Wdeprecated-copy is enabled. The fix implemented
is to explicitly declare this to be the default copy operator.

Since this may be a latent bug, this is marked with a FIXME.
2021-03-13 11:28:46 +00:00
Vincent Pelletier f8c72b5967 TINYGL: Move texture resampling from create time to render time
Thanks to pixel repacking using cpu data cache, this has a low runtime
cost even for TGL_LINEAR.
Adds support for TGL_NEAREST.
Adds support for TGL_MIRRORED_REPEAT, TGL_CLAMP_TO_EDGE and TGL_REPEAT.
Also, add support for more texture clamping and resampling options.

Mipmaps are not supported, although their sampling modes will be
applied - but to the full-size texture instead of selected mipmap.

Note: Texture sampler is still chosen at texture creation time.
2020-11-12 08:15:39 +01:00
Vincent Pelletier bd37cd3012 TINYGL: Make gl_resizeImage* pixel-format-independent 2020-11-12 08:13:49 +01:00
Vincent Pelletier 0108c11d98 TINYGL: Add support for more texture color formats 2020-11-12 08:03:48 +01:00
Vincent Pelletier b7b797d74d TINYGL: Use PixelBuffer for texture pixel format conversion
Instead of duplicating pixel-unpacking logic.
2020-11-12 07:49:15 +01:00
Pawel Kolodziejski b321938c7b TINYGL: Restored ability to create internal buffer based on pixel format 2020-10-05 08:09:20 +02:00
Pawel Kolodziejski 27e12d8a96 ALL: Eliminate LOCAL_PI macro 2020-09-23 23:20:23 +02:00
Mathias Parnaudeau 2cad855184 TINYGL: Fix wrong access to the list of dirty rects
The function end() of a list does not return the last element but a fake element
after the last one, for the need of the iterator.
Trying to access to the data of the element returned by end() and that has no
such field, that caused a stack buffer overflow, reading uninitialized data.

Called function back() instead, to get the last element of the list.
2020-02-21 07:20:11 +01:00
Bastien Bouclet fc67541742 ALL: Silence some GCC7 fall through warnings 2017-09-02 15:24:01 +02:00
Vincent Pelletier bcd1066540 TINYGL: Move initialisation code outside of loop
Readability-only change.
Clarifies that these variables will be initialised before they get
accessed in the loop.
Also, initialise update_left and update_right to true, and only clear the
one needed for given triangle.
2017-07-20 01:56:35 +00:00
Vincent Pelletier 218d3214d7 TINYGL: Move remaining line counter decrement near y increment
Readability-only change.
Both represent the same notion, and nb_lines is only accessed as loop
condition.
2017-07-20 01:53:34 +00:00
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 92130c138e TINYGL: Obey current shade model also when clipping lines.
The code was only interpolating color (in TGL_SMOOTH mode) when clipping
faces, extend it to lines.
Also, factorise color interpolation code.
No visual difference is expected in normal use, but it fixes wireframe
rendering when used for debugging.
2017-07-20 01:48:58 +00: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 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