Commit Graph

17 Commits

Author SHA1 Message Date
Jonathan Li 286e7293fa gsdx:windows: Fix screenshot/GS dump path issues
Fixes an issue with screenshots/GS dumps not saving if the path contains
characters not present in the current codepage.
2018-07-23 00:51:02 +01:00
Jonathan Li d57b812f36 gsdx: Prefix std:: to string and to_string 2017-09-08 09:56:28 +02:00
Gregory Hainaut f5fbfe98bd gsdx: fix warning: variable ‘success’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] 2017-01-11 18:23:34 +01:00
Jonathan Li 61669d1f3f gsdx:png: Fix accidental resource leak
Oops.

Unfortunately it'll reintroduce the clobbering warning on gcc 4.9.
2016-12-12 23:08:30 +00:00
Jonathan Li d4a6e18c01 gsdx:png: Fix gcc clobber warnings
Don't adjust 'image' and just use an additional offset.
'success' was kinda unnecessary when true or false could just be
directly returned.
Move 'compression' clamping out to GSPng::Save instead.

And throw in a whole bunch of const for good measure.
2016-12-12 17:39:05 +00:00
Jonathan Li ac78688a32 gsdx: Make GSJobQueue non-inheritable
In the previous code, the threads were created and destroyed in the base
class constructor and destructor, so the threads could potentially be
active while the object is in a partially constructed or destroyed state.
The thread however, relies on a virtual function to process the queue
items, and the vtable might not be in the desired state when the object
is partially constructed or destroyed.

This probably only matters during object destruction - no items are in
the queue during object construction so the virtual function won't be
called, but items may still be queued up when the destructor is called,
so the virtual function can be called. It wasn't an issue because all
uses of the thread explicitly waited for the queues to be empty before
invoking the destructor.

Adjust the constructor to take a std::function parameter, which the
thread will use instead to process queue items, and avoid inheriting
from the GSJobQueue class. This will also eliminate the need to
explicitly wait for all jobs to finish (unless there are other external
factors, of course), which would probably make future code safer.
2016-12-08 01:18:17 +00:00
Gregory Hainaut 88b7470c07 gsdx: use const qualifier to avoid gcc (false positive) warning
variable  might be clobbered by ‘longjmp’ or ‘vfork’

Only remains warning for 2 variables: success & image
2016-08-12 19:30:14 +02:00
Jonathan Li 6b950d0408 gsdx: Allow dump and capture PNG compression to be changed
Valid values for png_compression_level are from 0 (no compression) to 9
(max compression). The default is 1.

v2: Use zlib Z_BEST_SPEED (1) and Z_BEST_COMPRESSION (9) defines.
2016-03-02 22:58:45 +00:00
Jonathan Li cf939620ea gsdx-ogl: Save depth image as RGB and alpha images 2016-03-02 22:57:16 +00:00
Jonathan Li ee5861efc8 gsdx: Remove non-PNG code
It's no longer in use.
2016-03-02 22:57:12 +00:00
Jonathan Li 87dcfbc645 gsdx-png: Use libpng directly instead of via png++
v2: Increase compression to maximum
v3: Add zlib to GSdx build dependencies
v4: Reduce memory usage
2016-03-02 22:48:54 +00:00
Gregory Hainaut c01686d252 gsdx-png: add a fixme message for 16 bits by channel image 2015-05-24 12:51:20 +02:00
Gregory Hainaut 388f46b577 gsdx-png: use array interface instead of set_pixel
Doc says it is "non-checking equivalent of set_pixel". Still slow as ass

At least syntax is nicer
2015-05-18 17:25:14 +02:00
Gregory Hainaut cff168e002 gsdx-linux-recorder: implement multithread to save the image
Currently only a dedicated thread. It is still too slow!
2015-05-18 16:56:44 +02:00
Gregory Hainaut 98dde32dc0 gsdx-replayer-linux: use new code to allow loading of .gs.xz dump
A bit slower at startup but it saves a lots of disk space!

Reduce the size of my gs collection of 11GB :)
2015-05-17 22:08:10 +02:00
Gregory Hainaut 2165c68938 oups forget a couple of break 2015-05-16 13:26:55 +02:00
Gregory Hainaut cab59587e8 gsdx: add a PNG wrapper
Normally it supports all formats but I didn't have luck with 16 bits depth gray
2015-05-16 12:32:05 +02:00