Commit Graph

2462 Commits

Author SHA1 Message Date
Bill Currie af4a91accf Do a tiny bit of cleanup. 2011-09-20 19:32:49 +09:00
Bill Currie b00e865d4c Make the importer work in both 2.58 and svn blender. 2011-09-20 18:58:45 +09:00
Bill Currie 67ba9129ed Report bad mdl files. 2011-09-20 13:34:12 +09:00
Bill Currie 9a4e5aef53 Read strings as strings rather than bytes. 2011-09-20 13:33:41 +09:00
Bill Currie a32e45d2d5 Refactor the import code.
This should make things a little more maintainable.
2011-09-20 12:44:37 +09:00
Bill Currie d90fd4cee9 Fix a mistake found by a debug build of blender. 2011-09-18 18:49:16 +09:00
Bill Currie c65522b5cf Add key frames for all shape keys. 2011-09-18 15:37:17 +09:00
Bill Currie 94ac2fa675 Remove a debug print 2011-09-18 10:37:28 +09:00
Bill Currie b57e098e93 Rewrite the frame group to action conversion.
Now it works :) Mostly :/ Need to figure out how to "finalize" the action.
Also, blender occasionally loses my skin texture :(
2011-09-18 09:58:59 +09:00
Bill Currie dbb1df70b5 Fix frame merging for mdlv3 files.
v3 files have no name fields in the frames, so we need to store the
generated name.
2011-09-18 09:18:49 +09:00
Bill Currie ad8afec84c Merge multiple frames into a single frame group.
But only if they seem to be related (ie, the frame name is the same up to
the number). This will later become optional, but it allows me to test
some of the frame group code.
2011-09-17 23:41:35 +09:00
Bill Currie dc76ad6556 Create actions for frames and frame groups.
Simple frames get a one key action, groups get an action with a key per
subframe.
2011-09-17 23:13:21 +09:00
Bill Currie 644f4db9d1 Add support for v3 (qtest) mdl files.
Finally, I can see the dragon in all its... glory?
2011-09-17 09:05:07 +09:00
Bill Currie f7de55ed5e Create a shape key for every frame and subframe.
Shammy has no frame groups :(. Need to find a model with groups.
2011-09-16 20:59:39 +09:00
Bill Currie b0af18478b Be a little more direct in object linking and materal adding. 2011-09-16 19:14:31 +09:00
Bill Currie de24fa99a8 Break out the skin/material setup code. 2011-09-16 17:57:07 +09:00
Bill Currie 41213f2c30 Make the skin show in blender's 3d view.
Much thanks to ideasman_42 for showing me which code I needed to grok to
get it working.
2011-09-15 22:45:23 +09:00
Bill Currie 320f613263 Give the uvlayer texture a name. 2011-09-15 20:39:26 +09:00
Bill Currie 257fefca38 Link the first skin to the imported object.
The texture doesn't display properly in 3d space in texture mode yet.
2011-09-15 19:52:18 +09:00
Bill Currie 7489d5646b Convert all skins.
Skin groups are now partially supported.
2011-09-15 19:51:52 +09:00
Bill Currie f8e1e3d4ec Fix incorrect bracket/parens 2011-09-15 19:18:31 +09:00
Bill Currie 11f37298be Reveres the face windings.
Blender's vertex order and quake's vertex order seem to be opposed.
2011-09-15 17:23:40 +09:00
Bill Currie 0569e0ebd3 Build the uv layout. 2011-09-15 13:21:08 +09:00
Bill Currie 99ff91e341 Load the skins into blender images.
Skin groups are not yet supported (skipped).
2011-09-15 11:29:54 +09:00
Bill Currie 9d025e0058 Begin working on an mdl import/export plugin for blender.
This is only preliminary at this stage:
  o No export yet.
  o Only the first frame is converte4d.
  o Skins are not yet converted
2011-09-14 19:33:51 +09:00
Bill Currie 3de5575def Move the menu files into the QF directory for win32. 2011-09-11 17:13:20 +09:00
Bill Currie a71acc9ae5 Move the essential init code into Sys_Init(). 2011-09-11 14:56:47 +09:00
Bill Currie b9401fe7c6 Fix incomplete removal of old files. 2011-09-10 18:10:51 +09:00
Bill Currie 505660dffe Nuke another buffer.
Though snprintf was used, not having a buffer just makes things cleaner.
2011-09-07 09:41:06 +09:00
Bill Currie f75b0a611b Some compile fixes for OpenBSD 2011-08-25 22:35:20 +09:00
Bill Currie 70d42cc838 Allow light entities to specify a named light property. 2011-08-21 14:40:18 +09:00
Bill Currie 73a280f86a Handle all light types in the switch.
Even though nothing is down for those types.
2011-08-21 14:40:18 +09:00
Bill Currie 2d8b011bc8 Support negative lights. 2011-08-21 14:40:18 +09:00
Bill Currie efce040d48 Document the fields qflight uses to control lighting. 2011-08-21 14:40:18 +09:00
Bill Currie e42c5a4272 More tests and fix vector/quaternion global dumps. 2011-08-11 14:58:13 +09:00
Bill Currie c6e0e094d8 Fix an unterminated array.
That was sneaky. It took building qfcc on an arm to trigger that bug.
2011-07-30 15:01:16 +09:00
Bill Currie d910c14935 Clean up some doxygen warnings. 2011-07-10 19:12:07 +09:00
Bill Currie 617e70c8e3 Clean up a bunch of bison unused warnings. 2011-06-21 19:52:47 +09:00
Bill Currie 0f7390dd60 Clean up all the "set but not used" warnings.
gcc on my system is failing to treat this specific warning as an error :/
2011-06-19 10:48:02 +09:00
Bill Currie dedda7596d Just for fun :) 2011-06-15 17:33:03 +09:00
Bill Currie d638fdce83 Add a PlaneFlip macro. 2011-05-07 19:29:03 +09:00
Bill Currie b9d21cbe9a Catch resizes in the camera view.
Avoids a segfault when resizing the window.
2011-04-16 18:58:05 +09:00
Bill Currie 3337dc609f Fix a buffer error. 2011-04-16 13:05:28 +09:00
Bill Currie fb65cd2b44 Cache needed fonts.
Obtaining a font has become rather expensive in recent gnustep, so cache
fonts, obtaining new ones only when needed rather than every redraw. Makes
things snappy again :)
2011-04-16 12:17:23 +09:00
Bill Currie 36ec375893 Support resizing the window.
The resized layout isn't perfect, but at least the usable real estate for
the xy window grows nicely.
2011-04-10 14:34:34 +09:00
Bill Currie 9e15e2cd76 Remove a debug print. 2011-04-10 09:14:28 +09:00
Bill Currie c7612dcd99 Make statement dumps a little more informative. 2011-04-10 09:08:46 +09:00
Bill Currie fd6e341e06 Clean up cast_expr() a little bit. 2011-04-10 00:29:27 +09:00
Bill Currie 6cb3d18fc4 Use a hash table for finding entities.
This gives a major speed boost :)
2011-04-09 18:32:29 +09:00
Bill Currie 32f3f5c06b Use a hash table for epair lookup.
This gives a very minor speedup to drawing large maps.
2011-04-09 14:47:36 +09:00
Bill Currie 57ed603658 Extract values from constant defs. 2011-04-09 12:42:41 +09:00
Bill Currie cc714864a8 Support converting to/from unsigned values. 2011-04-09 11:32:33 +09:00
Bill Currie 55cc0f9206 Bring back the unsigned type (PROGS version bump)
This is only low-level support (the unsigned keyword still does not work),
but sufficient to make switch statements using jump tables work.
2011-04-09 10:07:47 +09:00
Bill Currie b522853765 Ensure the target of def_op relocs gets updated.
These occur only when switch statements use jump tables, thus why the
problem went unnoticed :/
2011-04-08 17:09:40 +09:00
Bill Currie 237f11c472 Fix cast expressions.
Casting between ints and floats needs special treatment to get the
conversion operator, but other casts need to be aliases.
2011-04-08 13:55:26 +09:00
Bill Currie c4a398850a Fix defs as constants for vectors and quaternions. 2011-04-04 21:31:59 +09:00
Bill Currie 38b25e0c38 Do not double-allocate space for immediates.
Caused by changed semantics in def creation.
2011-04-03 13:11:50 +09:00
Bill Currie 92ba110a87 Ensure a field def is emitted for @this. 2011-04-03 13:03:48 +09:00
Bill Currie 7f67e6eb17 Refactor the def handling code a little. 2011-04-03 13:03:22 +09:00
Bill Currie 6d0b13dbf0 Resolve types whenever possible. 2011-04-03 13:02:04 +09:00
Bill Currie 2c9c1bd968 Ensure defs for @self and @this are generated. 2011-04-03 13:00:48 +09:00
Bill Currie 2de7733b6a Fix initialized variable type handling.
Same problem as initialized constants :P
2011-03-30 21:21:38 +09:00
Bill Currie 8e18c76bde Make initialized variables defs rather than immediate constants. 2011-03-30 19:58:09 +09:00
Bill Currie 7dbd2ec172 Allow field aliasing.
Initializing a field variable to another field will set the new field to
point to the same location. No type checking is done.

eg:
.SEL thinkMethod = think;
2011-03-30 09:33:47 +09:00
Bill Currie 550fff5467 Allow assignments between any field types. 2011-03-30 08:14:17 +09:00
Bill Currie 75c3653be4 Implement some missed relocs. 2011-03-30 08:13:13 +09:00
Bill Currie 2bddcefafe Allow up to 64 faces on a brush.
This is temporary until unlimited faces can be supported, but it's
sufficient to load mappi.map.
2011-03-29 12:46:49 +09:00
Bill Currie 1911cc1472 Mingw build fixes. 2011-03-27 08:26:42 +09:00
Bill Currie 896791b209 Correct the spelling of "int" and clean up the mess. 2011-03-25 16:53:04 +09:00
Bill Currie 1617f0765e Support the default type without segfaulting. 2011-03-25 09:59:48 +09:00
Bill Currie a7cfe3b215 Preserve the current class across protocol defs.
It seems that protocol defs are allowed in class implementations, so don't
let the protocol def kill the current class for the class implementation.
2011-03-24 11:55:17 +09:00
Bill Currie 71af121665 Detect missing @end tags.
Give a warning when @end is forgotten in class implementations.
2011-03-24 11:44:22 +09:00
Bill Currie 8d3508cf20 Allocate space for temp defs using size rather than type.
Statement operands throw away the high level type information, so store
type size in the operand and use this size for allocating space for temps
rather than using the low-level type.
2011-03-23 21:32:14 +09:00
Bill Currie 9b62c8c126 Rename ty_type_e to ty_meta_e and type_t.ty to type_t.meta 2011-03-22 16:06:47 +09:00
Bill Currie d4be914019 Fix initialized vector variables.
The whole initialized variable system is wonky, but it will do for now.
2011-03-22 15:10:06 +09:00
Bill Currie a9eb793a5e Yay, even more tests :P 2011-03-22 15:00:46 +09:00
Bill Currie 6a49861b49 Fix the bogus source file for "redefined" functions. 2011-03-22 13:45:44 +09:00
Bill Currie 7dbd5f656c Fix traditional vector component access. 2011-03-22 13:05:42 +09:00
Bill Currie f1d9570dc8 Fix constant value type handling.
Rename immediate.[ch] to value.[ch] and clean up the mess.

Add convert_value() to convert the type of a value (only scalar types).
2011-03-22 12:24:39 +09:00
Bill Currie 1219df0872 Fix field immediates.
Field immediates need to be treated the same way as pointer immediates when
merging values.
2011-03-21 18:11:46 +09:00
Bill Currie 46093c0937 Use the correct meta type for spacial types.
Although vector and quaternion types have symbol tables, they are not
really structs, so set the meta type to "none", allowing the types to be
encoded correctly.
2011-03-21 17:26:49 +09:00
Bill Currie cefe7e2e94 Use the correct source of defs for field defs. 2011-03-21 17:07:40 +09:00
Bill Currie 0c0f4360da Make field defs "nosave".
The engine treats fielddefs with DEF_SAVEGLOBAL set as bogus.
2011-03-21 17:06:45 +09:00
Bill Currie f5ce9e2004 Fix a merge induced error in overloaded functions. 2011-03-20 19:04:18 +09:00
Bill Currie 1ada2a96cf Merge branch 'master' into qfcc-codegen
Conflicts:
	tools/qfcc/source/expr.c
	tools/qfcc/source/function.c
	tools/qwaq/test.r
2011-03-20 15:58:31 +09:00
Bill Currie a919e5f619 Make class_check_ivars() use class_add_ivars() to add the ivars.
This avoids implementation ivar blocks trashing the ivar offsets in
derived classes.
2011-03-20 13:35:59 +09:00
Bill Currie 8c8a6a4d63 The function return type is the address of the type descriptor... 2011-03-17 20:31:20 +09:00
Bill Currie 01144d23cf Add a new gcc warning option and fix the two bugs it found. 2011-03-17 19:58:56 +09:00
Bill Currie 5aa0b34570 Add the cast statement to the statement block.
*sob*
2011-03-10 20:43:53 +09:00
Bill Currie f663f587fe Fix the missing local defs for builtin functions. 2011-03-10 20:16:35 +09:00
Bill Currie 899af3119b Use the correct type when generating a move expression. 2011-03-10 19:30:21 +09:00
Bill Currie 2129eaaf20 Dereference moves need movepi rather than movei. 2011-03-10 19:29:23 +09:00
Bill Currie 8d69c5c898 More tests 2011-03-09 20:34:23 +09:00
Bill Currie cbbbf87e20 Resurrect the stats output. 2011-03-09 15:51:17 +09:00
Bill Currie 8368f57fbf Close a potential buffer overflow. 2011-03-09 11:09:46 +09:00
Bill Currie 4d90eba2ad Remove some unused globals. 2011-03-09 11:08:30 +09:00
Bill Currie 2464a89d37 Preserve relocs across def churning.
Freeing then re-allocating a def to change its storage from external is
really not the right way to do it, but for now this fixes the loss of the
relocs. With this, the menus seem to work :)
2011-03-09 10:52:29 +09:00
Bill Currie 39278ba8cc Explicitly select between direct and indirect moves. 2011-03-09 10:30:57 +09:00
Bill Currie b95cdc33d9 Set instace_size to the correct size. 2011-03-08 22:45:34 +09:00
Bill Currie 55eed1ae07 Make module dumping a little more informative. 2011-03-08 22:43:53 +09:00