Commit graph

1882 commits

Author SHA1 Message Date
Bill Currie
abe471110c Make inc/dec_users return the the expression.
Just for convenience.
2011-01-11 08:44:43 +09:00
Bill Currie
18ae178eaf Make new_vector_expr and new_quaternion_expr const-correct. 2011-01-11 08:43:34 +09:00
Bill Currie
4da2657bfe Fix most of the notice spam (hacky).
The implementation and declaration of OP_DONE disagree (not sure what to do
about it yet), so give it special treatment when emitting.
2011-01-11 08:07:04 +09:00
Bill Currie
ded741430b Add some missing static declarations. 2011-01-10 13:23:39 +09:00
Bill Currie
5f70e27613 Quaternions use quaternion_val, not vector_val :P 2011-01-10 13:23:12 +09:00
Bill Currie
cd38bd71fa Swap the order of scale and base for calculating the array index.
fold_constants doesn't like dags very much, but it can do the right thing
if the expressions are in the right order. This is merely a workaround
until I get to work on the code generator itself.
2011-01-10 12:26:11 +09:00
Bill Currie
5864c198cc Property list tests are working. 2011-01-10 12:26:11 +09:00
Bill Currie
d327c860cb Get messages working again. 2011-01-10 12:26:11 +09:00
Bill Currie
cb0bc7229a Resurect the debugging messages in rua_obj.c
Yet another debug flag: SYS_RUA_OBJ
2011-01-10 12:26:10 +09:00
Bill Currie
aac8185e4e Print some addresses in hex. 2011-01-10 12:25:31 +09:00
Bill Currie
6ebee4ad0e Get the type of Method right.
It's a direct structure rather than a pointer.
2011-01-10 12:25:31 +09:00
Bill Currie
ba27db6b93 Use some math identities to eliminate operations on non-constants. 2011-01-10 12:25:31 +09:00
Bill Currie
75ec6bf244 Clean out some unnecessary types from the progs engine and clean up the mess.
This is a nasty commit, sorry, but 99% of the commit is interdependent.
2011-01-10 12:25:31 +09:00
Bill Currie
c69ac1f56f Don't segfault when build_builtin_function detects an error. 2011-01-10 12:25:31 +09:00
Bill Currie
806d9110a2 Support both (* *) and // style comments. 2011-01-10 12:25:31 +09:00
Bill Currie
a17e73c863 Generate code.
It's now time to work on the revamp of the symbols, trees, etc.
2011-01-10 12:25:31 +09:00
Bill Currie
e34f7caeb0 Use op instead of integer_val for ADDOP etc. 2011-01-10 12:25:31 +09:00
Bill Currie
edaa6235e7 Get functions/procedures emitted.
No actual code is emitted, though.
2011-01-10 12:25:31 +09:00
Bill Currie
74016573b4 Need frame grabbing after all. 2011-01-10 12:25:31 +09:00
Bill Currie
129a36064f Fix a typo that broke procedure declarations. 2011-01-10 12:25:31 +09:00
Bill Currie
7971b0868e Break out the begin_function code into its own function. 2011-01-10 12:25:31 +09:00
Bill Currie
c5d0acf0fa Allow arrays to have ranges (not fully implmented) 2011-01-10 12:25:31 +09:00
Bill Currie
25c36a51a8 -f and -F were reversed in the usage. 2011-01-10 12:25:31 +09:00
Bill Currie
fed82466cc The first stages of Quake-Pascal.
At present, this parses a subset of the pascal language with a few type
extensions. There is already work on the type system.
2011-01-10 12:25:31 +09:00
Bill Currie
ae4ca52661 Make function.h more independent. 2011-01-10 12:25:31 +09:00
Bill Currie
66ac56063f Break out the frame macro code from qc-lex.l 2011-01-10 12:25:31 +09:00
Bill Currie
a09f02db1a Break out the debug and string functions from qc-lex.l. 2011-01-10 12:25:30 +09:00
Bill Currie
695f71eeb6 Get clost to the look I wanted for symtab_flat_copy's graph. 2011-01-10 12:25:30 +09:00
Bill Currie
782a4c9a8d New symbol table code. 2011-01-10 12:25:30 +09:00
Jeff Teunissen
dfbbda37af New tool: qflmp
Stupid little lump tool, converts from lmp to pcx and back.

qflmp -h for help.
2011-01-09 04:33:51 -05:00
Bill Currie
fbdbcfada4 Remove deprecated @argc and @argv 2011-01-05 13:10:57 +09:00
Bill Currie
a27ea057c4 Add a test for calling class methods. 2011-01-03 18:11:46 +09:00
Bill Currie
02f78e46f8 More expression docs. 2011-01-03 16:25:59 +09:00
Bill Currie
5627e43465 Use the method's selector rather than its def name in error messages. 2011-01-03 16:25:29 +09:00
Bill Currie
a1f36a9944 Make new_function take a def rather than a name.
Moves into new_function some code that should have been there in the first
place.
2011-01-03 16:25:29 +09:00
Bill Currie
4c69a97ac7 Allow normal declarations within a class implementation.
I had always been under the assumption that such was illegal in
Objective-C, but after working on Forge, I now know otherwise.
2011-01-03 16:25:29 +09:00
Bill Currie
dc5bafb8fb Minimal error recovery.
No more bailing on the first syntax error. While the recovery is not
perfect (things can get right twisted), qfcc will now continue parsing
after a syntax error.
2011-01-03 16:25:29 +09:00
Bill Currie
a4635d79e8 Slightly more informative error locations.
Inside a class or protocol definition is not "at top level" ;)
2011-01-03 16:25:29 +09:00
Bill Currie
530e8fae34 Rework class_type_t to be more useful.
This allows current_class to refer to procols as well (for error
reporting).
2011-01-03 16:25:29 +09:00
Bill Currie
f738ef5dba Remove redundant RETURN statement rule.
The same effect can be achieved with one rule using opt_expr.
2011-01-03 16:19:28 +09:00
Bill Currie
58042719e5 A little more documentation for expressions. 2011-01-03 16:19:28 +09:00
Bill Currie
7946fec523 More cString cleanups.
I don't know that fileSystemRepresentation is any better than cString for
general usage (due to wchar on windows).
2010-12-28 07:42:08 +09:00
Bill Currie
d29e8deb0a Use Qprintf for writing maps, and fileSystemRepresentation to get the path. 2010-12-27 23:18:43 +09:00
Bill Currie
97e8ab7f3a A bunch more NSString and NSFileManager usage.
It does make for cleaner could, though it would have been nice if NSData
was null terminated :P
2010-12-26 22:33:04 +09:00
Bill Currie
8e13a8327d Use NSFileManager methods instead of access().
This even fixes a bug where an inaccessible bspSound was being opened.
2010-12-26 21:07:55 +09:00
Bill Currie
f105fbd6a0 Use NS* classes for QUAKED directory scanning.
The scanning of actual files is still done using normal C strings, but now
everything up to (but not including) opening the file is handled by *step.
2010-12-26 20:45:01 +09:00
Bill Currie
232c67640c Get the QUAKED text for nullclass right.
? is not a character that's lexed out by the script class.
This fixes the segfault when loading a map when no entities are defined
(ie, the mod's source code could not be found for QUAKED).
2010-12-26 19:06:39 +09:00
Jeff Teunissen
8653f9d9a7 Add a man page for zpak
It's lame, but so is zpak :)
2010-12-24 16:23:52 -05:00
Bill Currie
526f132517 Minor tweaks. 2010-12-24 20:08:24 +09:00
Bill Currie
22072ee606 Update for the new qfcc headers/libs location. 2010-12-24 20:07:40 +09:00
Bill Currie
1a767849ab Sort the options in the switch.
Should make finding them a little easier.
2010-12-24 17:35:33 +09:00
Bill Currie
d6b3d4891a Finally, help output for qfprogs.
Nothing great, but better than nothing.
2010-12-24 17:33:57 +09:00
Bill Currie
f4d8b82115 Rearrange the options into alpha order. 2010-12-24 17:08:48 +09:00
Bill Currie
51b98ee758 Correct some errors. 2010-12-24 11:07:47 +09:00
Bill Currie
33e9fbba32 Win32 packaging improvements. 2010-12-24 10:41:09 +09:00
Bill Currie
a57717e2ab Update my release script. 2010-12-24 09:51:07 +09:00
Bill Currie
28740bb57f Add unsigned integer constant support. 2010-12-23 19:32:28 +09:00
Bill Currie
7934e29473 Fix up my big build script. 2010-12-23 16:51:02 +09:00
Bill Currie
32f7cd8b22 Get HTTP support (libcurl) working with mingw. 2010-12-23 13:18:43 +09:00
Bill Currie
2229c7557d Update cross-build scripts.
They're hard-coded for my current setup, but easy to fix.
2010-12-23 11:45:08 +09:00
Bill Currie
de04e1b602 Lots of win32 (mingw cross) build fixes.
HTTP (curl) support is missing, but everything else builds.
2010-12-23 11:40:16 +09:00
Bill Currie
6c631c6d5d Start documenting qfcc. 2010-12-19 11:35:18 +09:00
Bill Currie
52e844ee48 Produce slightly better v6 modulo code for complex inputs.
I'm having problems with temp defs, but I imagine this code is rarely used
so I won't worry about it for now. It will, however, make a good test case
for when I rework emit.c after I do some reading.
2010-12-19 11:23:33 +09:00
Bill Currie
b90833d86f v6 modulo test 2010-12-19 11:19:23 +09:00
Bill Currie
fa08e4afb7 Print users info when dumping statements. 2010-12-19 11:16:04 +09:00
Bill Currie
f5706f9c44 Make control of expression dumping less of a hassle. 2010-12-19 11:15:13 +09:00
Bill Currie
d981968208 v6 modulo implementation now produces good code.
At least for simple inputs, anyway. That needs to be tested next.
2010-12-18 22:21:55 +09:00
Bill Currie
00e50c0ad3 Rewrite the v6 modulo implementation.
While trying to understand bind expressions, I discovered that the v6
modulo code was incorrect. This version is correct but uses one too many
temps. That's next.
2010-12-18 22:21:55 +09:00
Bill Currie
8197d34eda Objective-C warnings documentation from gcc. 2010-12-16 20:12:24 +09:00
Bill Currie
699799bfc8 Don't warn when adding a new method to an implementation.
Methods defined in the implementation but not declared in the interface are
just fine.
2010-12-16 20:04:08 +09:00
Bill Currie
eace5b3c81 Get message checking working properly. 2010-12-16 16:41:16 +09:00
Bill Currie
a87ba3d0ea Fix qwaq for the recent Array(Private) tweaks. 2010-12-13 19:10:05 +09:00
Bill Currie
4481ba9b0d Allow explicit references to classes and categories.
Use "@reference ClassName;" or "@reference ClassName(CategoryName);" to
create a refence to the class or category, forcing the defining object file
to be linked into the program when the object file is part of a library.
2010-12-12 20:27:56 +09:00
Bill Currie
2c84ae4898 Don't let casting in constfold increment users.
This fixes Deek's temp notice. No new notices have shown up, so this should
be the correct fix. The constant folding code no longer calls cast_expr
directly, but rather uses an internal wrapper that decrements users after
cast_expr increments it, resulting in a no-op.
2010-12-12 15:37:26 +09:00
Bill Currie
d470094a55 Flip the nodes when flipping the plane. 2010-12-10 18:13:48 +09:00
Bill Currie
9ba70884c5 Prefer positive Z axis for 45 degree canonical planes. 2010-12-10 17:17:30 +09:00
Bill Currie
ba2a5838fd Normalize the clip plane before adding it to the bsp. 2010-12-10 17:17:30 +09:00
Bill Currie
a0828ddd06 Clean up bsp limits.
Delete all bogus bsp limits, fixing the code that depended on them.
Document those limits that are dictated by the format.
2010-12-07 17:58:09 +09:00
Bill Currie
478ef21de0 Add some view opacity. 2010-11-28 15:31:40 +09:00
Bill Currie
83dc8c2a7a Remove some unused files. 2010-11-28 15:31:40 +09:00
Bill Currie
0e8d6d896f Do a bit of comment cleanup. 2010-11-28 15:31:40 +09:00
Bill Currie
ff41feb76e Allow entity copying too. 2010-11-28 15:31:40 +09:00
Bill Currie
cb970bddce Can now copy brushes.
Implement SetBrush's copyWithZone:
2010-11-28 15:31:40 +09:00
Jeff Teunissen
74d959ec64 Cope gracefully with wadfiles we can't handle
This is a weird little diff. We're doing a lot of gymnastics here so that
we don't have to crash (killing any loaded unsaved work!) when we find a
wadfile we don't know how to deal with.
2010-11-28 15:31:40 +09:00
Bill Currie
6702f04b46 Fix key resetting.
Make sure we don't add a new key-pair when the key already exists, and if
the existing value has the same pointer as the "new" value, do nothing.
2010-11-28 15:31:40 +09:00
Bill Currie
ff94a0f76a Can now select textures. 2010-11-28 15:31:39 +09:00
Jeff Teunissen
47117f1762 return the actual string
Oops. I returned a text field instead of the string in it. :)
2010-11-28 15:31:39 +09:00
Jeff Teunissen
877067de61 Export the base directory of the open project
Project -baseDirectoryPath returns the absolute path to the directory from
which the .qpr file was loaded.
2010-11-28 15:31:39 +09:00
Bill Currie
22885a48ad Correctly initialize the path variables.
Use the current project file, not the default.
2010-11-28 15:31:39 +09:00
Jeff Teunissen
0d0e7bfe18 TexturePalette.m: microscopic update
remove a bogus comment, clarify a printf call, add parens around a ternary
test.
2010-11-28 15:31:39 +09:00
Jeff Teunissen
ba508fa3e0 TexturePalette: Prevent NULL dereference
Keep the app from crashing on a wad that doesn't have any palette at all.
2010-11-28 15:31:39 +09:00
Bill Currie
d75f5f3f79 Fix brush selection.
The great cleanup caused a few vital returns to disappear (they probably
went to the same place a lot of my lego did).
2010-11-28 15:31:39 +09:00
Bill Currie
946a06b264 Don't crash if the palette entry is not first.
Instead, swap the palette entry and the first entry (only in memory).
2010-11-28 15:31:39 +09:00
Bill Currie
78a816dbdf Correct miptex byte-count scaling factor. 2010-11-28 15:31:39 +09:00
Bill Currie
1928780af6 Support Quests' map format.
This is mostly because I have a few maps in this format.
2010-11-28 15:31:39 +09:00
Bill Currie
ae1d5245ad Got the value/key backwards. 2010-11-28 15:31:39 +09:00
Bill Currie
c2644699a4 Even more conversions to NSString 2010-11-28 15:31:39 +09:00
Bill Currie
12d79ba28d More conversions to NSString 2010-11-28 15:31:39 +09:00
Bill Currie
fd000b880d Do a lot of conversions to NSString. 2010-11-28 15:31:38 +09:00
Bill Currie
2ac2f5fab5 Change path_projectinfo to NSString. 2010-11-28 15:31:38 +09:00