Commit graph

22 commits

Author SHA1 Message Date
Bill Currie
790f62a209 [image] Make WritePNG take settings from tex_t
This means that a tex_t object is passed in instead of just raw bytes
and width and height, but it means the texture can specify whether it's
flipped or uses BGR instead of RGB. This fixes the upside down
screenshots for vulkan.
2022-04-01 01:01:53 +09:00
Bill Currie
a29836cc2c [quakefs] Return QFile pointer from QFS_NextFile(name)
QFS_NextFilename was renamed to QFS_NextFile to reflect the fact it now
returns a QFile pointer for the newly created file (as well as the
name). This necessitated updating WritePNG to take a file pointer
instead of a file name, with the advantage that WritePNGqfs is no longer
necessary and callers have much more control over the creation of the
file.

This makes QFS_NextFile much more secure against file system race
conditions and attacks (at least in theory). If nothing else, it will
make it more robust in a multi-threaded environment.
2022-03-31 17:27:04 +09:00
Bill Currie
54604d9aa2 [util] Make hunk (optionally) thread-safe
For now, the functions check for a null hunk pointer and use the global
hunk (initialized via Memory_Init) if necessary. However, Hunk_Init is
available (and used by Memory_Init) to create a hunk from any arbitrary
memory block. So long as that block is 64-byte aligned, allocations
within the hunk will remain 64-byte aligned.
2021-07-29 11:43:27 +09:00
Bill Currie
63eaf9e823 [image] Correct disabled LoadPNG declaration
Fixes #14
2021-06-13 10:05:51 +09:00
Bill Currie
7a19be7265 [image] Change tex_t data from array to pointer
This makes tex_t more generally useable and probably more portable. The
goal was to be able to use tex_t with data that is in a separate chunk
of memory.
2021-01-25 00:54:41 +09:00
Bill Currie
e50430e00c [image] Add parameter to load only the header
I want to be able to calculate texture sizes without actually loading
the images.
2021-01-19 10:15:57 +09:00
Bill Currie
bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie
4bd6bca6f2 Fix a prototype/definition mismatch. 2012-02-05 14:27:48 +09:00
Bill Currie
d8dbfa9c24 Create WritePNGqfs so screenshots can be written as png. 2011-12-31 17:23:32 +09:00
Bill Currie
99c0954b47 the big dso visibility patch :). Sure, we have to have unique names for static builds, but with controlled visibitly we should get faster program loads (although this isn't C++, so it's not as bad) and complex plugins are cleaner. 2007-03-10 12:00:59 +00:00
Bill Currie
3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Bill Currie
201252c1c0 FIXME cleanup and a missed win32 compile fix
This is an imperfect revision of history.
2004-11-06 02:21:00 +00:00
Bill Currie
ca46503607 add -Wsign-compare (default for -Wall only in C++) and fix up the warnings 2004-07-13 19:14:01 +00:00
Bill Currie
c3e7832d85 correct gamma test thanks to Grievre 2003-12-07 04:21:58 +00:00
Bill Currie
4ce44cf9eb PNG write support from DrSpliff 2003-09-09 16:18:13 +00:00
Ragnvald Maartmann-Moe IV
387f6a6f64 Clean out silly typedef bloat, clean up whitespace. 2003-09-08 20:07:51 +00:00
Bill Currie
2ea7ca1efd windows has a LoadImage #define, so kill it :) 2003-09-08 15:49:21 +00:00
Bill Currie
61a2840870 autoconfiscate the png support 2003-09-08 14:32:54 +00:00
Bill Currie
92b6550fe3 correction pointed out by DrSpliff 2003-09-05 04:07:19 +00:00
Bill Currie
a0875ea909 eliminate the global variables 2003-09-04 21:24:20 +00:00
Bill Currie
2b5a3753ca nuke QF/texture.h moving it's contents into QF/image.h (yay, finally, a
real home for tex_t:)
2003-09-04 18:59:39 +00:00
Bill Currie
3305c0f51f PNG reading support, much thanks to DrSpliff 2003-09-04 05:24:05 +00:00