Commit graph

3737 commits

Author SHA1 Message Date
Bill Currie
e5148493db Prepend qfs_ to file_from_pak.
A little better name-spacing.
2014-01-28 16:22:05 +09:00
Bill Currie
82ded3fbe5 Fix some bitrot resulting from a rebase. 2014-01-28 16:22:05 +09:00
Bill Currie
5560696a65 Fix some unused variables. 2014-01-28 16:22:05 +09:00
Bill Currie
4b18501b00 Fix an uninitialized variable. 2014-01-28 16:22:05 +09:00
Bill Currie
40206904ba Reimplement _QFS_FOpenFile using QFS_FindFile's internals.
_QFS_FOpenFile does a full search, however.
2014-01-28 16:22:05 +09:00
Bill Currie
6b87ddbb7c Add QFS_FindFile.
QFS_FindFile's search can be constrained to begin or end at a certain
vpath.
2014-01-28 16:22:04 +09:00
Bill Currie
8bc2f7f6df Print the vpath name when dumping the paths. 2014-01-28 16:22:04 +09:00
Bill Currie
098821e35d Fix QFS_FilelistFill to work with vpaths. 2014-01-28 16:22:04 +09:00
Bill Currie
f05c7179c3 Split up the search paths into vpath chunks.
A vpath is the union of all locations searched for a file in a single
gamedir (eg, shadows, id1 etc). This is a necessary step to preventing
problems like id1/maps/start.lit being used for shadows/maps/start.bsp.

However, QFS_FilelistFill still needs to be reworked as it does not compile
yet (testing was done with a gutted QFS_FilelistFill).
2014-01-28 16:22:04 +09:00
Bill Currie
6910c50a43 Clean up the #ifdef mess in _QFS_FOpenFile
With proper initialization, only the one chunk of #ifdefs is needed. Now
the code is much easier to read.
2014-01-28 16:22:04 +09:00
Bill Currie
4d59282641 Find the remaining vertex attribute order issues.
I hope. I do need to figure out why I made sprite blend an attribute
rather than a uniform.
2014-01-28 16:22:04 +09:00
Bill Currie
a5db0b1a65 Remove the now unnecessary GLSL_CompileShaderS().
Now that the transition to using shader effects is comlete, there's no
need for the wrapper.
2014-01-28 16:22:04 +09:00
Bill Currie
57d2198140 Use the new shader system for iqm models. 2014-01-28 16:22:04 +09:00
Bill Currie
385175ca65 Use the new shader system for 2d drawing. 2014-01-28 16:22:04 +09:00
Bill Currie
c89e612cd4 Remove redundant fog and palette shader code. 2014-01-28 16:22:04 +09:00
Bill Currie
50bb40be29 Use the new shader system for sprites. 2014-01-28 16:22:04 +09:00
Bill Currie
68bd7e643d Remove the long dead text vertex shader. 2014-01-28 16:22:04 +09:00
Bill Currie
1d67f8f0c3 Use the new shader system for textured particles. 2014-01-28 16:22:04 +09:00
Bill Currie
1a7b532927 Use the new shader system for point particles. 2014-01-28 16:22:04 +09:00
Bill Currie
3af6a640fe Missed the old turb frag shader. 2014-01-28 16:22:04 +09:00
Bill Currie
a419fb2c92 Ensure the vertex coord attribute is attribute 0.
It seems mesa still has the bug where non-array attributes don't work
when set as attribute 0, and that the allocation order changed sometime
since I last tested with mesa. This fixes the black world and flickering
alias models on my eeepc.
2014-01-28 16:22:04 +09:00
Bill Currie
042d6e5728 Remove a couple of stale files.
Missed these in the bsp related commit.
2014-01-28 16:22:04 +09:00
Bill Currie
26fc0b74e6 Fix bsp water surfaces.
Everything seems to be working for the bsp renderer.
2014-01-28 16:22:04 +09:00
Bill Currie
f43592589d Use the new shader system in the bsp renderer.
It mostly works. Skybox is untested, and water surfaces are broken.
2014-01-28 16:22:04 +09:00
Bill Currie
b269338947 Start using the new shader system.
So far, alias model rendering is the only victim, but things are working,
even if only color map lookup and fog blending are broken out at this
stage.

I expect the effect naming scheme will go through some changes until I'm
happy with it.
2014-01-28 16:22:04 +09:00
Bill Currie
323fbe1927 Fix an allocation oopsie.
I must have been tired when I wrote that line.
2014-01-28 16:22:04 +09:00
Bill Currie
550f1ae788 Fix some bitrot.
Just updating for the changes to the ALLOC/FREE macros.
2014-01-28 16:22:03 +09:00
Bill Currie
96c40cb9a1 Add basic support for shader "effects".
Again, based on The OpenGL Shader Wrangler. The wrangling part is not used
yet, but the shader compiler has been modified to take the built up shader.
Just to keep things compiling, a wrapper has been temporarily created.
2014-01-28 16:22:03 +09:00
Bill Currie
3b56f0e3bf Advance src with next_line.
This fixes the double counting of the \n at the end of the chunk separator
line.
2014-01-28 16:22:03 +09:00
Bill Currie
d1848a93c8 Add tests for chunk line numbers.
Which happen to find errors :P
2014-01-28 16:22:03 +09:00
Bill Currie
d912970cd3 Add support for segmented text files.
The idea comes from The OpenGL Shader Wrangler
(http://prideout.net/blog/?p=11). Text files are broken up into chunks via
lines beginning with -- (^-- in regex). The chunks are optionally named
with tags of the form: [0-9A-Za-z._]+. Unnamed chunks cannot be found.
Searching for chunks looks for the longest tag that matches the beginning
of the search tag (eg, a chunk named "Vertex" will be found with a search
tag of "Vertex.foo"). Note that '.' forms the units for the searc
("Vertex.foo" will not find "Vertex.f").

Unlike glsw, this implementation does not have the concept of effects keys
as that will be separate. Also, this implementation takes strings rather
than file names (thus is more generally useful).
2014-01-28 16:22:03 +09:00
Bill Currie
4c6478c77f Strip trailing spaces from field names.
A certain mod (glare at rogue) has a space at the end of a field name in
the bsp entity data causing a crash. Thanks to ccr for the report.
2013-11-26 14:27:49 +09:00
Bill Currie
f5501fbf24 Fix a pile of automake deprecation warnings.
s/INCLUDES/AM_CPPFLAGS/g

I <3 sed :)
2013-11-24 13:11:50 +09:00
Bill Currie
6288684fa2 Fix more gcc 4.8 errors.
More actual bugs found, too.
2013-09-27 23:09:37 +09:00
Bill Currie
99a8e8f228 Fix the jump instruction.
The offset to compensate for st++ was missing.

Obviously, the code has never been tested.  Found while looking at the
jump code and thinking about using 32-bit addresses for the jump tables.
2013-06-26 09:59:19 +09:00
Bill Currie
88692f92d9 Fix the calls for Draw_Init in the gl renderers.
While namehack.h took care of the symbol mangling, I do prefer the calls to
be correct as it reduces confusion.
2013-05-09 17:58:33 +09:00
Bill Currie
0f75bdce17 Set the default joystick preamp to 0.01.
At the request of johnnyonflame. I probably should have done this when I
removed the builtin 1/100 scaling from the joystick code.
2013-04-19 13:54:30 +09:00
Bill Currie
247f3be0c0 Create reentrant versions of the set functions that need it.
Only the functions that allocate or delete sets or iterators.
2013-03-18 13:20:39 +09:00
Bill Currie
27bb337a60 Use set_bits_t for holding set elements.
set_bits_t is now 64 bits for x86_64 machines (in linux, anyway). This gave
qfvis a huge speed boost: from ~815s to ~720s.

Also, expose some of the set internals so custom set operators can be
created.
2013-03-16 21:26:49 +09:00
Bill Currie
7753583bfd Catch accuracy errors.
I'd forgotten to set the result flag. Unfortunately, the errors can get
very bad (1e-3) it seems :(
2013-03-13 17:16:34 +09:00
Bill Currie
6eec76dd49 Implement Fischer's SEB algorithm (for 3d).
Now we can get tight (<1e-6 * radius_squared error) bounding spheres. More
importantly (for qfvis, anyway) very quickly: 1.7Mspheres/second for a 5
point cloud on my 2.33GHz Core 2 :)
2013-03-13 17:10:55 +09:00
Bill Currie
9bbf1a9110 test the right cs function (oops) 2013-03-13 16:38:56 +09:00
Bill Currie
3193ffd9cc Better (-1..1) random numbers.
Now the distribution should be more even as the rng doesn't affect the
exponent.
2013-03-13 14:41:04 +09:00
Bill Currie
b6d4766201 Add a function to find the circumsphere of up to 4 points.
It seems to be a little sloppy (an error of a bit less than 1e-4). This
might be why I'm having trouble with my SEB code.
2013-03-13 14:35:30 +09:00
Bill Currie
0cd6d93030 Add a function to get the barycentric coords of a point.
It "works" for lines, triangles and tetrahedrons. For lines and triangles,
it gives the barycentric coordinates of the perpendicular projection of the
point onto to features. Only tetrahedrons are guaranteed to reproduce the
original point.
2013-03-12 14:16:42 +09:00
Bill Currie
ca0b03687f Change the naming of ALLOC's free-list.
Rather than prefixing free_ to the supplied name, suffix _freelist to the
supplied name. The biggest advantage of this is it allows the free-list to
be a structure member. It also cleans up the name-space a little.
2013-03-08 22:16:31 +09:00
Bill Currie
eb2828e11c Add a function to pre-allocate space for a large set.
When the maximum set size is large but constant, and members will be added
one at a time, growing the set dynamically is not very efficient.
2013-03-07 10:27:30 +09:00
Bill Currie
7c1d9d2b84 Make the angle and light hacks optional.
I'd forgotten that ED_ConvertToPlist mangled light into light_lev and
single component angle values into a vector. This fixes much of the
breakage in qflight (but not the light levels)
2013-03-07 09:11:23 +09:00
Bill Currie
675db274a6 Use Sys_Error instead of PR_Error in ED_ConvertToPlist.
ED_ConvertToPlist is now independent of the progs engine as its only use
for the progs_t * param was for PR_Error.
2013-03-07 09:11:22 +09:00
Bill Currie
7d2e938d37 Correct some error messages.
ED_ParseEntity has been ED_ConvertToPlist for a long time now.
2013-03-07 09:11:22 +09:00