Commit graph

9690 commits

Author SHA1 Message Date
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
4bd82eb2b8 Add some documentation.
Nowhere near adequate.
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
b133e9a092 Remove a stray -e from bootstrap's error report.
Not sure it was there, unless I had intended -n.
2014-01-17 15:47:29 +09:00
Bill Currie
7de0317a22 Avoid a segfault at the end of hipnotic.
This is based on ccr's patch, but a little more thorough (he missed some
potential problems) and probably more readable (the original code wasn't
the greatest (still isn't, but...))..
2013-11-27 16:08:30 +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
6c0f271783 Fix some more automake warnings. 2013-11-24 13:26:12 +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
6996e7295a Add a getLine method to Script.
It returns the rest of the line (minus // style comments) as the token. I
needed it in another project but this is my central repository for
script.py.
2013-11-24 11:21:40 +09:00
Bill Currie
eeaf2bc43f Return None instead of False from parse_entity.
Don't remember how I found that one, but None makes much more sense.
2013-11-24 11:19:50 +09:00
Bill Currie
c88d1987a1 Add warnings for empty blocks in if/else/do.
Saw a discussion of such in #qc and that gcc implemented it. I realized it
would be pretty easy to detect and very useful (I've made such mistakes at
times).
2013-09-30 18:09:04 +09:00
Bill Currie
db460155e9 Fix multiple function calls in expressions. 2013-09-27 23:15:57 +09:00
Bill Currie
70d18ecfa1 Add a test for functions in binary expressions.
As expected, the binary_expr() cleanup broke multiple function calls in a
single expression.
2013-09-27 23:15:57 +09:00
Bill Currie
4bc40b3917 Rewrite binary_expr().
It is now in its own file and uses table lookups to check for valid type
and operator combinations, and also the resulting type of the expression.

This probably breaks multiple function calls in the one expression.
2013-09-27 23:15:57 +09:00
Bill Currie
ec98954dfc Remove the small struct optimization.
It might cause trouble for the binary_expr() cleanup.
2013-09-27 23:15:57 +09:00
Bill Currie
3295370328 Expose and use field_expr().
This may cause problems later on, but it is needed for the binary_expr()
cleanup.
2013-09-27 23:15:57 +09:00
Bill Currie
ca9693d9cd Expose convert_from_bool(). 2013-09-27 23:15:57 +09:00
Bill Currie
b66cbeeb57 Run fold_constants on comparison operands.
This is a bit of a workaround to ensure the operands have their types
setup correctly. Really, binary_expr needs to handle expression types
properly.

This fixes the bogus error for comparing the result of pointer subtraction
with an integer.
2013-09-27 23:15:57 +09:00
Bill Currie
c13f2c2c23 Fix the support for [s, v] for quaterions. 2013-09-27 23:15:57 +09:00
Bill Currie
7f50333b2c Add support for constant [] vector expressions. 2013-09-27 23:15:57 +09:00
Bill Currie
7a7a685105 Add support for actual vector expressions.
Currently, they can represent either vectors or quaternions, and the
quaternions can be in either [s, v] form or [w, x, y, z] form.

Many things will not actual work yet as the vector expression needs to be
converted into the appropriate form for assigning the elements to the
components of the "vector" type.
2013-09-27 23:15:57 +09:00
Bill Currie
2572811bf4 Add support for quaternion.w/x/y/z.
It's sometimes more useful to have direct access to each individual
component of the imaginary part of the quaternion, and then for
consistency, alias w and s.
2013-09-27 23:15:57 +09:00
Bill Currie
c197d6a4f9 Ignore the new test-driver link.
It seems to have come with automake 1.13.
2013-09-27 23:15:57 +09:00
Bill Currie
a6cdc8735a Start implementing vec = [x,y,z].
This is a nice feature found in fteqcc (also a bit of a challenge from
Spike). Getting bison to accept the new expression required rewriting the
state expression grammar, so this is mostly for the state expression. A
test to ensure the state expression doesn't break is included.
2013-09-27 23:15:56 +09:00
Bill Currie
35de42aeac Catch bogus comparison types.
This fixes an ICE when trying to compare a function with a float.
2013-09-27 23:15:56 +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
03fb47d7ba Fix some sizeof goofs.
Yay for continually improving gcc warnings :)
2013-09-26 17:45:30 +09:00
Bill Currie
16d899ace5 Remove the string:string concatentation TODO item.
I think it may have been for compatibility with a certain qcc variant (no
idea which one, though). While the shift/reduce conflict is fixable using
"%prec IFX" on the const:string rule, the colon breaks test?"a":"b".
Putting parentheses around "a" allows such a construct, requiring them
breaks comatibility with C. I think this feature just isn't worth that.
2013-06-26 23:04:35 +09:00
Bill Currie
257597fd38 Update ifstring in TODO
It seems to be done, but...
2013-06-26 23:04:35 +09:00
Bill Currie
cef2136050 Implement "not" logic for while and do-while.
This goes towards complementing the "if not" logic extension. I need to
check if fteqcc supports "not" with "while" (the version I have access to
at the moment does not), and also whether it would be good  to support
"not" with "for", and if so, what form the syntax should take.
2013-06-26 23:04:35 +09:00
Bill Currie
45a09e195e Add more TODO items (strings stuff) 2013-06-26 23:04:35 +09:00
Bill Currie
6fa63f6c54 Implement the basics of fteqcc's -Fifstring.
It's -Cifstring in qfcc, but otherwise the intent is the same. More testing
and investigation into what fteqcc does is required.
2013-06-26 23:02:55 +09:00
Bill Currie
8d34d33055 Implement "if not (foo)" syntax.
It is syntactic sugar for if (!(foo)), but is useful for avoiding
inconsistencies between such things as if (string) and if (!string), even
though qcc can't parse if not (string). It also makes for easier to read
code when the logic in the condition is complex.
2013-06-26 23:02:55 +09:00
Bill Currie
77337e2402 Separate "" and nil.
It turns out this is required for compatibility with qcc (and C, really).
Once string to boolean conversions are sorted out completely (not that
simple as qcc is inconsistent with if (string) vs if (!string)), Qgets can
be implemented :)
2013-06-26 23:02:55 +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