Commit Graph

8915 Commits

Author SHA1 Message Date
Bill Currie 7e293a38e8 Check for double-chaining of types.
Chaining a type twice will form a loop in the type list, causing find_type
to go into an infinite loop.
2012-11-08 17:14:33 +09:00
Bill Currie 950a3aa83d Avoid infinite recursion when encoding struct types.
Structures (especially hard-coded ones) can be really nasty as they can
refer to themselves. Avoid the recursion by setting the type_def field of
the type before doing the recursive encodings in the structure encoder.
2012-11-08 17:06:38 +09:00
Bill Currie 7a25283beb Clear out the type encoding def from all types.
The encodings of static types were getting corrupted because their defs
were not necessarily in the same places between compilations when compiling
multiple files.
2012-11-08 17:06:38 +09:00
Bill Currie a3a22f2a1b Add the ability to dump qfo type encoding. 2012-11-08 17:06:38 +09:00
Bill Currie 09d1cd61f3 Don't convert a qfo to progs unnecessarily.
This avoids segfaults on reloctions for external defs.
2012-11-08 17:06:29 +09:00
Bill Currie 61ef901254 Tweak some FIXMEs. 2012-11-08 17:03:02 +09:00
Bill Currie ed4018fd8d Clear out the function overloading tables between compiles.
Fixes some issues with multiple compiles (especially mixed languages!).
2012-11-01 20:53:33 +09:00
Bill Currie ea34a5b753 Fix some nasty memory errors.
Three cheers for valgrind!!!
2012-11-01 20:53:28 +09:00
Bill Currie 5c79953a7e Put quotes around strings for statement operands.
This makes reading output a bit easier (especially if the string is empty
or just whitespace).
2012-10-30 12:31:28 +09:00
Bill Currie f8bdd909cc Separate out C and html quoting into separate functions.
Dot sometimes wants normal C quotes, othertimes html. Quite annoying,
really, but this is cleaner anyway.
2012-10-30 12:31:22 +09:00
Bill Currie f680521e0f Escape unprintable chars. 2012-10-27 11:45:51 +09:00
Bill Currie 1f9735d0cb Correct the dump format for conj.q. 2012-10-27 11:45:10 +09:00
Bill Currie ec42bde527 Make hash tables more const correct.
And clean up the resulting mess :/
2012-10-27 11:44:31 +09:00
Bill Currie 034139b806 Move some code around so it's more accessible. 2012-10-27 11:43:29 +09:00
Bill Currie 7519ec7bbd Fix the bogus missing return warning.
Pascal's return mechanism is such that void return is always used.
2012-10-26 20:11:38 +09:00
Bill Currie 3f351a5c88 Fix a printf format goof.
Forgot to compile test :/
2012-10-26 19:38:59 +09:00
Bill Currie 52b9721027 Add the COMMA token to the pascal parser.
I guess I forgot I needed to keep token numbers in sync between pascal and
qc/ruamoko.
2012-10-26 19:06:10 +09:00
Bill Currie 72045f1a5b Delay storage setting for pascal functions.
The function def must not be local. This fixes the null function call in
gcd.pas.
2012-10-26 19:03:00 +09:00
Bill Currie 27b83a8d65 Clean up all extra aborts, using internal_error instead.
Some internal_error calls have no message, but at least things will be more
consistent.
2012-10-26 19:02:02 +09:00
Bill Currie 5530e84ada Call find_type for pascal functions/procedures.
The result of parse_params needs to be passed through find_type before
actually being used. I guess I'd missed this back when I got things working
for qc.
2012-10-26 16:20:57 +09:00
Bill Currie 144387c3e3 Add shared.h to the dist files. 2012-10-26 16:16:46 +09:00
Bill Currie f14d8060e0 Merge qfpc into qfcc.
Since gnu bison and flex are required anyway, no harm in using their api
prefix options. Now, qfcc can compile both QC/Ruamoko and Pascal files
(Pascal is (currently?) NOT supported in progs.src mode), selecting the
language based on the extension: .r, .qc and .c select QC/Ruamoko, .pas and
.p select Pascal, while anything else is treated as an object file (as
before).
2012-10-26 16:01:41 +09:00
Ozkan Sezer 6e04fd5ff6 signed int viddef_t members
The attached patch (against quakeforge git) changes the [con]width,
[con]height, and most importantly the rowbytes members of viddef_t
from unsigned to signed int, like in q2.  This allows for a properly
negative vid.rowbytes which may be needed in, e.g. a DIB sections
windows driver if needed.  Along with it, I changed a few places
where unsigned int is used along with comparisons against the relevant
vid.* members.
One thing I am not 100% sure is the signedness requirements of
d_zrowbytes and d_zwidth: q2 has them as unsigned but I am not sure
whether that is because they are needed as unsigned or it was just an
oversight of the id developers. They do look like they should be OK
as signed int to me, though: comments?

==
Note from Bill Currie: I had to do some extra changes as many
signed/unsigned comparisons were somehow missed.
2012-10-21 09:00:50 +09:00
Bill Currie eccc1b5b51 Put the over-size range back to its original value.
This fixes the horribly different results between optimized and unoptimized
qfbsp (there is still a difference of 1 brushface). Unfortunately, it also
severely limits the maximum size of a map.
2012-09-18 09:25:10 +09:00
Bill Currie 50b22ab163 Fix a rather silly snafu with smart-leak.
I blame this fever :P

Now smart-leak actually makes sense.
2012-09-18 07:48:39 +09:00
Bill Currie 45fd312133 Merge branch 'master' into mapedit 2012-09-17 07:52:42 +09:00
Bill Currie 156f3382a5 Emit the points in the expected order.
Associating p1 with n2 and p2 with n1 was a bit confusing. Makes for a
more-sensible points output file, too.
2012-09-16 13:51:42 +09:00
Bill Currie 0ed535214e Import leak points files. 2012-09-16 12:57:17 +09:00
Bill Currie d6476d4f93 Make some improvements to the leak files.
smart leak files now produce many points, not just one per portal. Normal
leak files now center the trail on the portal (instead of some weird
weighted average).
2012-09-16 12:38:55 +09:00
Bill Currie 4fc9316320 Add very preliminary support for map exporting.
There is no error checking, texture alignment or support for non-point
lights, but it's a start. Also, it's assumed all brushes are convex and
manifold.
2012-09-16 10:59:47 +09:00
Bill Currie 6b8df7f42a Give EntityClassDict mapping access functions.
They just redirect to the actual entity class dictionary, but it saves a
lot of unnecessary code elsewhere.
2012-09-16 10:55:06 +09:00
Bill Currie 8416276cee Remove a debug print. 2012-09-13 18:14:29 +09:00
Bill Currie 2760055a0f Try to speed up entity relationship drawing a little. 2012-09-13 13:14:32 +09:00
Bill Currie 559add50cb Fix some snafus. 2012-09-13 12:22:05 +09:00
Bill Currie f18a926616 Add support for RMQs QUAKED comments.
RMQ just leaves out the entity size instead of using ? for brush entities.
2012-09-13 12:21:06 +09:00
Bill Currie 225cb4b364 Create an idquake character encoding.
It just does a 1:1 charmap conversion of quake text, purely to allow python
to read arbitrary qc code.
2012-09-13 12:19:26 +09:00
Bill Currie 709da6e7d7 Rotate the skybox -90 degrees on the z axis (gl)
Now gl and glsl match again, and quake's skies are now "correct" (assuming
fitzquake is the standard).
2012-09-13 08:36:28 +09:00
Bill Currie 14f089d08e Correct the orientation of the skybox (for glsl).
It turns out the expected orientation of the sky cube is exactly that of
Blender's default cube looked at from the front view (num-1) and the front
face being the nearest face. This put's Marcher's sun nicely in the view
when exiting the cave.
2012-09-12 19:06:07 +09:00
Bill Currie 536ee48a97 Some minor skybox improvements suggested by mh.
Rearrange the sky_suffix and sky_coords arrays and remove the sky_target
array such that the faces can be loaded using
GL_TEXTURE_CUBE_MAP_POSITIVE_X + i (apparently certain drivers break if
the faces aren't loaded in the correct order).

Also, the nomalization of the direction vector in the fragment isn't
necessary.
2012-09-12 15:20:35 +09:00
Bill Currie 433d9d138b Hook up the pointfile loader in glsl.
I was always wondering what that was for (never bothered looking at the
command registration, I guess :P).
2012-09-12 09:54:24 +09:00
Bill Currie bcda96a445 Report the source line of the entity in messages.
For now, just when PrintEntity is used to print the message, but having the
first line of the entity sure makes life easier.
2012-09-12 08:33:44 +09:00
Bill Currie db25d5597d Handle quest format brushes.
Bah, I forgot I needed to fix the vertex count parsing when I did the
script lexing change.
2012-09-12 08:24:17 +09:00
Bill Currie b764cad483 Add buttons to re-scan or re-parse entity class data. 2012-09-12 08:14:10 +09:00
Bill Currie 592222aba8 Don't attempt to draw a connecting line to a missing target. 2012-09-11 15:01:43 +09:00
Bill Currie 154d08a9c7 Gracefully handle unknown entity classes.
Unfortunately, the classname gets lost to blender at this stage, but I have
an idea for how to handle that.
2012-09-11 14:58:56 +09:00
Bill Currie 54832740c8 Gracefully handle missing textures.
The texinfo still gets a material, but just an untextured one. The idea is
such textures can be fixed up at a later date.
2012-09-11 14:57:24 +09:00
Bill Currie 41004fd7c2 Remove specularity from the brush materials.
Specularity looks ghastly when there's nothing for it to highlight.
2012-09-10 19:24:47 +09:00
Bill Currie 7204f8d90d Minor robustness improvements to map importing.
Allow map parse errors to be reported propertly (the raise was for
debugging) and give up gracefully when the wad file can't be found.
2012-09-10 19:23:15 +09:00
Bill Currie 995547ae6f Display a message for entity class parsing errors.
It's hacky, but at least something shows up.
2012-09-10 16:14:32 +09:00
Bill Currie 25e545616a Create EntityClassError exception.
Much more useful than Python's SyntaxError (and much less confusing).
2012-09-10 15:57:50 +09:00