You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(34) |
Sep
(99) |
Oct
(110) |
Nov
(21) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(117) |
Feb
(90) |
Mar
(1) |
Apr
(22) |
May
(96) |
Jun
(25) |
Jul
(22) |
Aug
|
Sep
|
Oct
(18) |
Nov
(43) |
Dec
(71) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(60) |
Nov
(63) |
Dec
(35) |
2007 |
Jan
(18) |
Feb
(40) |
Mar
(14) |
Apr
(18) |
May
(33) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(25) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rene S. <sa...@us...> - 2005-01-16 21:21:52
|
Update of /cvsroot/jake2/jake2/src/jake2/sound In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/sound Modified Files: Tag: RST S.java Log Message: This has vec3-optimize and the OAK bot. Index: S.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/sound/S.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** S.java 16 Dec 2004 21:11:56 -0000 1.5 --- S.java 16 Jan 2005 21:21:07 -0000 1.5.2.1 *************** *** 48,57 **** Class.forName("jake2.sound.DummyDriver"); try { - Class.forName("net.java.games.joal.AL"); - Class.forName("jake2.sound.joal.JOALSoundImpl"); - } catch (ClassNotFoundException e) { - // ignore the joal driver if runtime not in classpath - } - try { Class.forName("org.lwjgl.openal.AL"); Class.forName("jake2.sound.lwjgl.LWJGLSoundImpl"); --- 48,51 ---- *************** *** 59,62 **** --- 53,63 ---- // ignore the lwjgl driver if runtime not in classpath } + // prefered driver + try { + Class.forName("net.java.games.joal.AL"); + Class.forName("jake2.sound.joal.JOALSoundImpl"); + } catch (ClassNotFoundException e) { + // ignore the joal driver if runtime not in classpath + } } catch (Throwable e) { *************** *** 84,88 **** } // if driver not found use dummy ! impl = (Sound)drivers.get(0); } --- 85,89 ---- } // if driver not found use dummy ! impl = (Sound)drivers.firstElement(); } *************** *** 98,105 **** } ! // set the first driver after dummy as default String defaultDriver = "dummy"; if (drivers.size() > 1){ ! defaultDriver = ((Sound)drivers.elementAt(1)).getName(); } --- 99,106 ---- } ! // set the last registered driver as default String defaultDriver = "dummy"; if (drivers.size() > 1){ ! defaultDriver = ((Sound)drivers.lastElement()).getName(); } *************** *** 206,208 **** --- 207,217 ---- return impl.getName(); } + + public static String[] getDriverNames() { + String[] names = new String[drivers.size()]; + for (int i = 0; i < names.length; i++) { + names[i] = ((Sound)drivers.get(i)).getName(); + } + return names; + } } \ No newline at end of file |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:51
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/server Modified Files: Tag: RST moveclip_t.java Log Message: This has vec3-optimize and the OAK bot. Index: moveclip_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/moveclip_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.10.1 diff -C2 -d -r1.1.1.1 -r1.1.1.1.10.1 *** moveclip_t.java 7 Jul 2004 19:59:50 -0000 1.1.1.1 --- moveclip_t.java 16 Jan 2005 21:21:10 -0000 1.1.1.1.10.1 *************** *** 31,34 **** --- 31,35 ---- import jake2.render.*; import jake2.server.*; + import jake2.util.Math3D; public class moveclip_t *************** *** 42,44 **** --- 43,58 ---- edict_t passedict; int contentmask; + + public void clear() { + Math3D.VectorClear(boxmins); + Math3D.VectorClear(boxmaxs); + Math3D.VectorClear(mins); + Math3D.VectorClear(maxs); + Math3D.VectorClear(mins2); + Math3D.VectorClear(maxs2); + start = end = null; + trace.clear(); + passedict = null; + contentmask = 0; + } } |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:25
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/lib/lwjgl/linux Modified Files: Tag: RST liblwjgl.so libopenal.so Log Message: This has vec3-optimize and the OAK bot. Index: liblwjgl.so =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/linux/liblwjgl.so,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 Binary files /tmp/cvsVmcssJ and /tmp/cvsD3fQUL differ Index: libopenal.so =================================================================== RCS file: /cvsroot/jake2/jake2/lib/lwjgl/linux/libopenal.so,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 Binary files /tmp/cvsudryzv and /tmp/cvsjwh4sy differ |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:25
|
Update of /cvsroot/jake2/jake2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339 Modified Files: Tag: RST build.xml Log Message: This has vec3-optimize and the OAK bot. Index: build.xml =================================================================== RCS file: /cvsroot/jake2/jake2/build.xml,v retrieving revision 1.17 retrieving revision 1.17.2.1 diff -C2 -d -r1.17 -r1.17.2.1 *** build.xml 3 Nov 2004 16:16:15 -0000 1.17 --- build.xml 16 Jan 2005 21:21:14 -0000 1.17.2.1 *************** *** 24,27 **** --- 24,29 ---- <pathelement location="lib/jogl/jogl.jar"/> <pathelement location="lib/joal/linux/joal.jar"/> + <pathelement location="lib/lwjgl/lwjgl.jar"/> + <pathelement location="lib/lwjgl/lwjgl_util.jar"/> </path> *************** *** 48,52 **** <!-- compile --> <target name="compile" depends="init"> ! <javac destdir="${build}" optimize="on" debug="off" source="1.4"> <src path="${src}"/> <include name="jake2/**"/> --- 50,54 ---- <!-- compile --> <target name="compile" depends="init"> ! <javac destdir="${build}" optimize="off" debug="on" source="1.4"> <src path="${src}"/> <include name="jake2/**"/> *************** *** 69,73 **** <fileset dir="lib/jogl"> <include name="*.jar"/> ! </fileset> </copy> <copy todir="${dist}/lib/linux"> --- 71,78 ---- <fileset dir="lib/jogl"> <include name="*.jar"/> ! </fileset> ! <fileset dir="lib/lwjgl"> ! <include name="*.jar"/> ! </fileset> </copy> <copy todir="${dist}/lib/linux"> *************** *** 79,82 **** --- 84,92 ---- </fileset> </copy> + <copy todir="${dist}/lib/linux/lwjgl"> + <fileset dir="lib/lwjgl/linux"> + <include name="*"/> + </fileset> + </copy> <copy todir="${dist}/lib/windows"> <fileset dir="lib/jogl/windows"> *************** *** 85,88 **** --- 95,101 ---- <fileset dir="lib/joal/windows"> <include name="*"/> + </fileset> + <fileset dir="lib/lwjgl/windows"> + <include name="*"/> </fileset> </copy> *************** *** 90,94 **** <fileset dir="lib/joal/osx"> <include name="*"/> ! </fileset> </copy> <copy todir="${dist}"> --- 103,110 ---- <fileset dir="lib/joal/osx"> <include name="*"/> ! </fileset> ! <fileset dir="lib/lwjgl/osx"> ! <include name="*"/> ! </fileset> </copy> <copy todir="${dist}"> *************** *** 215,221 **** --- 231,239 ---- <fileset dir="${dist}/lib"> <include name="**/*.jar"/> + <exclude name="jake2.jar"/> </fileset> <fileset dir="."> <include name="patch.jar"/> + <include name="jake2.jar"/> </fileset> </copy> *************** *** 226,229 **** --- 244,250 ---- <include name="libjoal.so"/> </jar> + <jar destfile="webstart/lib/linux/lwjgl-native.jar" basedir="${dist}/lib/linux/lwjgl"> + <include name="*.so"/> + </jar> <jar destfile="webstart/lib/linux/openal.jar" basedir="${dist}/lib/linux"> <include name="libopenal.so"/> *************** *** 231,235 **** <jar destfile="webstart/lib/osx/joal-native.jar" basedir="${dist}/lib/osx"> <include name="libjoal.jnilib"/> ! </jar> <jar destfile="webstart/lib/windows/jogl-native.jar" basedir="${dist}/lib/windows"> <include name="jogl*.dll"/> --- 252,260 ---- <jar destfile="webstart/lib/osx/joal-native.jar" basedir="${dist}/lib/osx"> <include name="libjoal.jnilib"/> ! </jar> ! <jar destfile="webstart/lib/osx/lwjgl-native.jar" basedir="${dist}/lib/osx"> ! <include name="liblwjgl.jnilib"/> ! <include name="openal.dylib"/> ! </jar> <jar destfile="webstart/lib/windows/jogl-native.jar" basedir="${dist}/lib/windows"> <include name="jogl*.dll"/> *************** *** 239,242 **** --- 264,271 ---- <include name="OpenAL32.dll"/> </jar> + <jar destfile="webstart/lib/windows/lwjgl-native.jar" basedir="${dist}/lib/windows"> + <include name="lwjgl.dll"/> + <include name="lwjglaudio.dll"/> + </jar> <signjar keystore="${user.home}/bytonic" alias="hoz" storepass="${bytonic.pass}"> <fileset dir="webstart/lib"> |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:19
|
Update of /cvsroot/jake2/jake2/lib/lwjgl/osx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/lib/lwjgl/osx Added Files: Tag: RST openal.dylib liblwjgl.jnilib Log Message: This has vec3-optimize and the OAK bot. --- NEW FILE: liblwjgl.jnilib --- (This appears to be a binary file; contents omitted.) --- NEW FILE: openal.dylib --- (This appears to be a binary file; contents omitted.) |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:18
|
Update of /cvsroot/jake2/jake2/info In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/info Added Files: Tag: RST ent_structure.txt Log Message: This has vec3-optimize and the OAK bot. --- NEW FILE: ent_structure.txt --- ... found in the internet... These are the attributes which all entities have. This is an explanation of the type 'edict_t'. Attributes are referenced by the format 'entity_name->attribute' (eg self->angle) Many of these will be familiar to QuakeC programers. NOTE - Not all of these are relevant to all entities (infact there are no entities for which all of these are relevant). name type notes absmin, absmax vec3_t position of min and max points of entity relative to the world's origin accel float acceleration of platforms activator edict_t * entity which activated the current entity air_finished float time when air will run out (when underwater) angle float entity yaw set by level editor (-1 = up; -2 = down) area link_t ? areanum, areanum2 int area where you currently are used when checking if monsters can hear sounds attenuation float attenuation of above sound (set at level edit) avelocity vec3_t angular velocity (see note for velocity) blocked void function to call when blocked? (optional) chain editc_t * used when creating a list of entities classname char * type of entity (eg 'player','monster_soldier') client struct gclient_s* points to the player controling it, NULL if not player controled clipmask int type of objects the entity will not pass through can be any of MASK_* or CONTENTS_* listed at bottom of this document clusternums[] int ? combattarget char * name of entity to attack (used once) count int general purpose 'amount' variable, often set in level editor damage_debounce_time float time when lava/slime can do more damage to player deadflag int state of deadness : DEAD_NO, DEAD_DYING, DEAD_DEAD, DEAD_RESPAWNABLE deathtarget char * name of entity to use when current entity dies decel float deceleration of platforms delay float time between triggering switch and effect activating die void function to call when health <= 0 (MUST be present if the entity can take damage) dmg int damage done by entity dmg_radius float area to do radius damage enemy edict_t * entity to attack flags int various attributes : FL_FLY -flying FL_SWIM -swimming, won't drown FL_IMMUNE_LASER -not hurt by laser FL_INWATER -set when entering water, cleared when leaving FL_GODMODE -god-mode on FL_NOTARGET -will not be targeted by monsters FL_IMMUNE_SLIME -not hurt by slime FL_IMMUNE_LAVA -not hurt by lava FL_PARTIAL_GROUND -ground pulled out from under monster FL_WATERJUMP -player jumping from water FL_TEAMSLAVE -not first member of a team FL_NO_KNOCKBACK -entity not thrown back by damage FL_POWER_ARMOR -active power armor FL_RESPAWN -entity waiting before re-spawning fly_sound_debounce_time float used with looping sound when pushing player (in_trigger.c) freetime float time when entity was freed-up in memory gib_health int health at which to gib :) goalentity edict_t * entity currently moving towards gravity float not used by any entites, but can be used to define reduced/ increased gravity for individual entities (normal=1.0) groundentity edict_t * what the entity is standing on groundentity_linkcount int used in conjunction with linkcount to see if the current entity is still standing on the groundentity headnode int ? health int health of entity, increased and set in many places, but should only be reduced by t_damage() ideal_yaw float yaw the entity wants to face inuse qboolean the entity exists in the world item gitem_t * info about item (see below) killtarget char * name of entity to remove when current entity triggered last_move_time float time to play earthquake sound again light_level int player's light level, used by monsters when checking if player can be seen linkcount int changed by the gi.linkentity function ? map char * filename of the next map, part of entity target_changelevel mass int used when pushing entites and calculating knock-back for weapons (eg rocket hits) max_health int maximum health message char * message when entity activated (set by level editor) mins, maxs vec3_t position of min and max points of entity relative to its origin model char * filename of entitie's model monsterinfo monsterinfo_t info about the monster (see below) move_angles vec3_t the angle that the gun turret is facing move_origin vec3_t the origin of the gun turret movedir vec3_t direction currently moving in moveinfo moveinfo_t used by the ships flying overhead movetarget edict_t * entity to wark towards when not got anything better to do (such as killing the player) movetype int how the entity moves : MOVETYPE_NONE -never moves MOVETYPE_NOCLIP -ignores walls, entities, etc. MOVETYPE_PUSH -ignores walls, pushes entities MOVETYPE_STOP -ignores walls, stops on entities MOVETYPE_WALK -affected by gravity MOVETYPE_STEP -gravity, special edge handling, used by monsters MOVETYPE_FLY -no gravity, used by flying monsters MOVETYPE_TOSS -gravity, hits ground and stops MOVETYPE_FLYMISSILE -weapons, extra clip size when hitting monsters MOVETYPE_BOUNCE -bounces (eg grenade) mynoise,mynoise2 edict_t * spawned when player makes a noise, monsters can home in on them nextthink float time at which entity should call function 'ent->think' noise_index int index of sound to play when entity is triggered noise_index2 int not used anywhere num_clusters int ? oldenemy edict_t * player they were attacking before distracted (by anither monster hitting them) pain void function to call when hurt (optional) pain_debounce_time float prevent pain sounds/anims playing to often pathtarget char * name of entity to move towards pos1 vec3_t top position of lift pos2 vec3_t bottom position of lift powerarmor_time float time to stop showing translucent shield effects prethink void function to call before each frame (optional) owner edict_t * usually the entity that spawned this entity (eg bullet is 'owned' by the monster that fired it) radius_dmg int amount of radius damage done by entity random float used to add a bit of time variation to func_timer s entity_state_t has several subtypes (see below) show_hostile qboolean any monsters seeing this one will inherit its enemy size vec3_t size of entity (vector from mins to maxs) solid solid_t solidity of entity : SOLID_NOT -no interaction with other objects SOLID_TOUCH -touch inside after moving (used for triggers) SOLID_BBOX -touch on side (monsters, etc) SOLID_BDP -bsp clip, touch on edge (for solid walls, blocks, etc) sounds int type of sounds to play - used by doors, lifts, etc spawnflags int set by level editor, some values are :SPAWNFLAG_NOT_EASY, SPAWNFLAG_NOT_MEDIUM, SPAWNFLAG_NOT_HARD, SPAWNFLAG_NOT_DEATHMATCH, SPAWNFLAG_NOT_COOP There are other possible settings, which I have not yet looked at in detail. speed float speed of misc entities, including moving buttons, the gun turret and the fly-by ships style int type of entities (eg type of health box) also used as areaportal number (something to do with separating areas) svflags int either : SVF_NOCLIENT - don't send to clients SVF_DEADMONSTER - a dead monster SVF_MONSTER - same, a bit earlier takedamgage int can the entity be damaged? : DAMAGE_NO -will not take damage DAMAGE_YES -will take damage DAMAGE_AIM -will take damage + weapons 'auto-aim' at it target char * name of entity to trigger or move towards target_ent editc_t * entity that platform/lift is moving towards targetname char * name pointed to by target team char * name of team which entity is part of teamchain edict_t * the next entity in the team teammaster edict_t * the master entity in the team teleport_time float time when monster teleported into level think void sets the function that should be called at time nextthink timestamp float used by various functions to mark the spawn time of an entity or the start of a change (eg a light ramp) touch void function to call when it touches another entity/the world (optional) touch_debounce_time float prevent touch function from being called again too quickly use void function to call when used (optional) viewheight int height above origin where eyes are found velocity vec3_t current velocity. I think this is used in the external c code to change the entity's position. Can anyone confirm whether this is internal or external? volume float volume when playing above sound (set at level edit) wait float time to wait before platform moves to the next point on its path waterlevel int height of liquid : 0 - not in liquid 1 - feet in liquid 2 - on surface of liquid 3 - surrounded by liquid watertype int type of water the entity is in (see the CONTENTS_* list at bottom of document) yaw_speed float speed to turn towards ideal yaw gitem_t referenced by 'entity_name->item.attribute' Name Type Notes ammo char * type of ammo to use classname char * name when spawning it count_width int number of digits to display by icon drop void function called when entity dropped flags int type of pickup : IT_WEAPON, IT_AMMO, IT_ARMOR icon char * filename of icon info void * ? unused pickup qboolean function called when entity picked up pickup_name char * displayed onscreen when item picked up pickup_sound char * filename of sound to play when picked up precaches char * string containing all models, sounds etc. needed by this item quantity int ammo gained by item/ammo used per shot by item tag int ? unused use void function called when entity used view_model char * filename of model when being held weaponthink void unused function world_model char * filename of model when item is sitting on level world_model_flags int copied to 'ent->s.effects' (see s.effects for values) monsterinfo_t referenced by 'entity_name->monsterinfo.attribute' Name Type Notes aiflags int controls how the monster will behave : AI_STAND_GROUND -don't move AI_TEMP_STAND_GROUND -stand ground for a short time (don't get too close to enemy?) AI_SOUND_TARGET -look for source of a sound AI_LOST_SIGHT -just lost sight of player AI_PURSUIT_LAST_SEEN - AI_PURSUE_NEXT -able to get to last sighting point this frame AI_PURSUE_TEMP -continue to persue for a bit AI_HOLD_FRAME -entity will hold the same frame (eg machine gun firing) AI_GOOD_GUY -don't attack you (prisoners) AI_BRUTAL -keep attacking until enemy's health < -80 (usualy stop at 0) AI_NOSTEP -used by exploding box AI_DUKED -monster's (pathetic) attempts to evade your shots AI_COMBAT_POINT -ignores everything else until it reaches it's destination AI_MEDIC -healing something (stop when the 'enemy's health > 0 ) AI_RESURRECTING -it's ALIVE!!! (almost) show resurection effects attack_finished float time when attack will be finished (prevents further attacks before monster is ready) attack_state int attack method the monster is using : AS_STRAIGHT -moving forwards to firing position AS_SLIDING -moving sideways to firing position AS_MELEE -close range attack AS_MISSILE -long range attack currentmove mmove_t * current set of frames cycling between idle_time float time until which the idle animation should be played last_sighting vec3_t last point where the player was seen lefty int if and attack_state is AS_SLIDING, the monster will go left otherwise it'll go right. this is swapped each time linkcount int changed by gi.linkentity? nextframe int next frame to display pausetime float time to stop at a particular path_corner power_armor_power int energy the armor has left power_armor_type int type of power armor: POWER_ARMOR_NONE, POWER_ARMOR_SCREEN, POWER_ARMOR_SHIELD 2 saved_goal vec3_t if the monster can't get to where it wants to this frame, that position is saved here scale float adjusts the running speed of the monster search_time float time to keep looking for player trail_time float timestamp of last section of player's trail found The following functions are called when certain conditions are met: attack void ranged attack (optional) checkattack qboolean function called to see if the monster will attack this frame dodge void !!INCOMING!! so just duck 'cos they wouldn't aim for your feet, would they? (optional) idle void animation to 'spice up' the standing around (optional) melee void close-up attack (optional) run void has an enemy, getting ready to attack search void searching for player animation (optional) sight void just spotted someone (optional) stand void function to call when just standing around walk void moving towards movetarget entity_state_t attributes here are referenced by 'entity_name->s.attribute' Name Type Notes angles vec3_t angles of the entity : ...angles[0] = pitch ...angles[1] = yaw ...angles[2] = roll (not really used) frame int current frame effects int special effects to apply to entity can be one or more of: EF_ROTATE -rotates (bonus items) EF_GIB -leave a blood trail EF_BLASTER -coloured light + trail EF_ROCKET -coloured light + trail EF_GRENADE -smoke trail? EF_HYPERBLASTER -light + trail EF_BFG -light + particles? EF_COLOR_SHELL -coloured glow around the entity EF_POWERSCREEN -green screen EF_ANIM01 -automatically cycle between frames 0 and 1 at 2 hz EF_ANIM23 -automatically cycle between frames 2 and 3 at 2 hz EF_ANIM_ALL -automatically cycle through all frames at 2hz EF_ANIM_ALLFAST -automatically cycle through all frames at 10hz EF_FLIES -flies effect EF_QUAD -quad damage 'glow' EF_PENT -invincibility 'glow' event int effects that last one frame : EV_NONE -no effect EV_ITEM_RESPAWN -item respawning EV_FOOTSTEP -footstep noise EV_FALLSHORT -noise from small fall EV_MALE_FALL -noise from male falling EV_MALE_FALLFAR -noise from male falling a long way EV_FEMALE_FALL -noise from female falling EV_FEMALE_FALLFAR -noise from female falling a long way EV_PLAYER_TELEPORT-teleportation effects modelindex int index of precached model modelindex2 int for when one modelindex just isn't enough ;). Used with the final 2-stage boss (oops, sorry if that's a spolier) and to show separate player weapons modelindex3,4 int not used number int entity index number old_origin vec3_t last position of entity (used in a few odd places) origin vec3_t origin of the entity renderfx int various drawing effects : RF_MINLIGHT -can always see the entity RF_VIEWERMODEL -don't let the player see this (himself) RF_WEAPONMODEL -only let the current player see this RF_FULLBRIGHT -entity always fully lit RF_DEPTHHACK -for view weapon Z crunching (?!) RF_TRANSLUCENT -entity is see through RF_FRAMELERP -? used by monsters and bodies RF_BEAM -laser beam RF_CUSTOMSKIN -skin is an index in image_precache RF_GLOW -pulse lighting for bonus items RF_SHELL_RED -red glow, when monsters are resurrecting RF_SHELL_GREEN -green glow, from power shield RF_SHELL_BLUE -blue glow, not currently used skinnum int current skin number solid int set by gi.linkentity, for client-side prediction sound int to gaurentee shut-off of looping sounds CONTENTS_SOLID solid wall (not windows) CONTENTS_WINDOW windows CONTENTS_AUX ? CONTENTS_LAVA err.. lava CONTENTS_SLIME slime CONTENTS_WATER water CONTENTS_MIST !!Unused!! LAST_VISIBLE_CONTENTS ? CONTENTS_AREAPORTAL portals to conserve memory used in map designing, also dont allow sounds to pass //kami0 CONTENTS_PLAYERCLIP brush which player may not pass through //kami0 CONTENTS_MONSTERCLIP brush where monsters may not pass through //kami0 CONTENTS_CURRENT_0 flowing current moving at angle 0 //kami0 CONTENTS_CURRENT_90 flowing current moving at angle 90 //kami0 CONTENTS_CURRENT_180 flowing current moving at angle 180 //kami0 CONTENTS_CURRENT_270 flowing current moving at angle 270 //kami0 CONTENTS_CURRENT_UP flowing current moving up //kami0 CONTENTS_CURRENT_DOWN flowing current moving down //kami0 CONTENTS_ORIGIN used for rotation, invisible //kami0 CONTENTS_MONSTER non-solid monster? CONTENTS_DEADMONSTER dead monster CONTENTS_DETAIL brush that is not passed to vis - not in final BSP ? CONTENTS_TRANSLUCENT see through CONTENTS_LADDER ladder MASK_ALL -stop on anything MASK_SOLID -walls/windows MASK_PLAYERSOLID -anything you'd expect a player to stop on MASK_DEADSOLID -same as above, can go through monsters MASK_MONSTERSOLID -anything you'd expect a monster to stop on MASK_WATER -any liquid MASK_OPAQUE -walls and liquid except water (which is see-through) MASK_SHOT -walls, monsters and dead monsters MASK_CURRENT -flowing brush Written by Davo (sm...@cs...) (parts marked //kami0 supplied by Michael 'kami0' DiGiovanni (ka...@co...)) If there are any corrections, bugs etc, please e-mail me. Please also note that this has been the result of searching through the c files supplied by iD, and I don't have reference to any official documents or anything, so don't assume I know what I'm talking about ;). |
From: Rene S. <sa...@us...> - 2005-01-16 21:21:14
|
Update of /cvsroot/jake2/jake2/src/jake2/game/bots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/game/bots Added Files: Tag: RST OAK.java Log Message: This has vec3-optimize and the OAK bot. --- NEW FILE: OAK.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * * Author: John Crickett dl...@cr... * */ // Java Version created on 31.12.2004 by RST. // $Id: OAK.java,v 1.1.2.1 2005/01/16 21:21:05 salomo Exp $ package jake2.game.bots; import jake2.*; import jake2.client.*; import jake2.game.*; import jake2.game.monsters.*; import jake2.qcommon.*; import jake2.render.*; import jake2.server.*; import jake2.util.Math3D; public class OAK extends M_Player { static float OAK_FIND_RANGE = 700.00f; static float OAK_WALK = 16; static float OAK_RUN = 36; public static void OAK_Check_SP(edict_t ent) { // only spawn a bot in deathmatch if (GameBase.deathmatch.value != 0) { SP_Oak(); } else { GameBase.gi.cprintf(ent, Defines.PRINT_HIGH, "Sorry Oak II is a deathmatch only bot.\n"); } } /*************************************************************************** * * Function: oak_die * * Description: how to die * * Arguements: self inflictor attacker damage point * * Returns: void * **************************************************************************/ public static EntDieAdapter oak_die = new EntDieAdapter() { public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { int i; // throw the weapon GameBase.gi.sound(self, Defines.CHAN_BODY, GameBase.gi .soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); for (i = 0; i < 4; i++) GameAI.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); self.takedamage = Defines.DAMAGE_NO; // respawn the bot OAK_Respawn(self); } }; /*************************************************************************** * * Function: oak_pain * * Description: what to do when hurt * * Arguements: self other - who hurt you kick damage * * Returns: void * **************************************************************************/ public static EntPainAdapter oak_pain = new EntPainAdapter() { public void pain(edict_t self, edict_t other, float kick, int damage) { GameBase.gi.bprintf(Defines.PRINT_HIGH, "Oak: in oak_pain ouch!\n"); OakAI_RunFrames(self, FRAME_pain101, FRAME_pain104); self.enemy = other; self.think = oak_painthink; self.nextthink = GameBase.level.time + 0.1f; self.monsterinfo.idle_time = GameBase.level.time + 0.3f; } }; /*************************************************************************** * * Function: SP_Oak * * Description: spawns a oak bot * * Arguements: void * * Returns: void * **************************************************************************/ public static void SP_Oak() { edict_t newOak; float spawn_origin[] = { 0, 0, 0 }, spawn_angles[] = { 0, 0, 0 }; // spawn the bot on a spawn spot newOak = GameUtil.G_Spawn(); PlayerClient.SelectSpawnPoint(newOak, spawn_origin, spawn_angles); Math3D.VectorCopy(spawn_origin, newOak.s.origin); newOak.s.origin[2] += 1; // make sure off ground newOak.classname = "bot"; newOak.takedamage = Defines.DAMAGE_AIM; newOak.movetype = Defines.MOVETYPE_STEP; newOak.mass = 200; newOak.solid = Defines.SOLID_BBOX; newOak.deadflag = Defines.DEAD_NO; newOak.clipmask = Defines.MASK_PLAYERSOLID; newOak.model = "players/male/tris.md2"; newOak.s.modelindex = 255; newOak.s.modelindex2 = 255; // custom gun model newOak.s.frame = 0; newOak.waterlevel = 0; newOak.watertype = 0; newOak.health = 100; newOak.max_health = 100; newOak.gib_health = -40; /* * FIXME err we need to set these!!! newOak.max_bullets = 200; * newOak.max_shells = 100; newOak.max_rockets = 50; newOak.max_grenades = * 50; newOak.max_cells = 200; newOak.max_slugs = 50; newOak.inuse = * true; */ // think functions? newOak.pain = oak_pain; newOak.die = oak_die; newOak.monsterinfo.stand = oak_stand; /* * FIXME err add these :) newOak.monsterinfo.walk = * newOak.monsterinfo.run = newOak.monsterinfo.dodge = * newOak.monsterinfo.attack = newOak.monsterinfo.melee = * newOak.monsterinfo.sight = newOak.monsterinfo.idle = */ newOak.monsterinfo.idle_time = 0; newOak.think = oak_stand; newOak.nextthink = GameBase.level.time + 1f; newOak.yaw_speed = 20; newOak.s.angles[Defines.PITCH] = 0; newOak.s.angles[Defines.YAW] = spawn_angles[Defines.YAW]; newOak.s.angles[Defines.ROLL] = 0; Math3D.VectorSet(newOak.mins, -16, -16, -32); Math3D.VectorSet(newOak.maxs, 16, 16, 32); Math3D.VectorClear(newOak.velocity); GameUtil.KillBox(newOak); GameBase.gi.linkentity(newOak); GameBase.gi.bprintf(Defines.PRINT_HIGH, "A Oak bot has entered the game\n"); } public static void OAK_Respawn(edict_t self) { float spawn_origin[] = { 0, 0, 0 }, spawn_angles[] = { 0, 0, 0 }; // spawn the bot on a spawn spot PlayerClient.SelectSpawnPoint(self, spawn_origin, spawn_angles); Math3D.VectorCopy(spawn_origin, self.s.origin); self.s.origin[2] += 1; // make sure off ground self.deadflag = Defines.DEAD_NO; self.takedamage = Defines.DAMAGE_AIM; self.model = "players/male/tris.md2"; self.s.modelindex = 255; self.s.modelindex2 = 255; // custom gun model self.s.frame = 0; self.waterlevel = 0; self.watertype = 0; self.health = 100; self.max_health = 100; self.gib_health = -40; self.pain = oak_pain; self.die = oak_die; self.monsterinfo.stand = oak_stand; Math3D.VectorSet(self.mins, -16, -16, -32); Math3D.VectorSet(self.maxs, 16, 16, 32); Math3D.VectorClear(self.velocity); self.think = oak_stand; self.nextthink = GameBase.level.time + 0.1f; GameUtil.KillBox(self); GameBase.gi.linkentity(self); GameBase.gi.bprintf(Defines.PRINT_HIGH, "A Oak bot has respawned\n"); } public static EntThinkAdapter oak_stand = new EntThinkAdapter() { public boolean think(edict_t self) { edict_t target; // gi.bprintf(PRINT_HIGH, "Oak: in oak_stand\n"); self.enemy = null; // look for a target EdictIterator edit = null; while (null != (edit = GameBase.findradius(edit, self.s.origin, OAK_FIND_RANGE))) { target = edit.o; if (GameUtil.visible(self, target)) { if (GameUtil.infront(self, target)) { if (target.classname.equals("player")) { GameBase.gi .bprintf(Defines.PRINT_HIGH, "Oak: in oak_stand selecting you as target\n"); self.enemy = target; } } } // next taget } if (self.enemy != null) { //gi.bprintf(PRINT_HIGH, "Oak: in oak_stand turning to face // you\n"); OakAI_FaceEnemy(self); OakAI_RunFrames(self, FRAME_run1, FRAME_run6); self.think = oak_run; } else { // run the anim frames OakAI_RunFrames(self, FRAME_stand01, FRAME_stand40); } self.nextthink = GameBase.level.time + 0.1f; return true; } }; /*************************************************************************** * * Function: oak_run * * Description: the general runaround think function * * Arguements: self * * Returns: void * **************************************************************************/ public static EntThinkAdapter oak_run = new EntThinkAdapter() { public boolean think(edict_t self) { OakAI_RunFrames(self, FRAME_run1, FRAME_run6); OakAI_FaceEnemy(self); OakAI_MoveToEnemy(self, OAK_RUN); self.nextthink = GameBase.level.time + 0.1f; return true; } }; public static EntThinkAdapter oak_painthink = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.bprintf(Defines.PRINT_HIGH, "Oak: in oak_painthink running anim\n"); if (self.monsterinfo.idle_time >= GameBase.level.time) { OakAI_RunFrames(self, FRAME_pain101, FRAME_pain104); } else { self.think = oak_run; } self.nextthink = GameBase.level.time + 0.1f; return true; } }; /*************************************************************************** * * Function: OakAI_FaceEnemy * * Description: turn to face a enemy * * Arguements: self * * Returns: void * **************************************************************************/ public static void OakAI_FaceEnemy(edict_t self) { float v[] = { 0, 0, 0 }; Math3D.VectorSubtract(self.enemy.s.origin, self.s.origin, v); self.ideal_yaw = Math3D.vectoyaw(v); M.M_ChangeYaw(self); } /*************************************************************************** * * Function: OakAI_MoveToEnemy * * Description: moves bot towards a enemy assumes enemy dead ahead * * Arguements: self dist * * Returns: void * **************************************************************************/ public static void OakAI_MoveToEnemy(edict_t self, float dist) { OakAI_MoveToGoal(self, dist); } public static EntThinkAdapter oak_standclose = new EntThinkAdapter() { public boolean think(edict_t self) { double i; if (self.enemy != null && SV.SV_CloseEnough(self, self.enemy, OAK_RUN)) { if (((i = Math.random()) < 0.9) && (self.monsterinfo.idle_time < GameBase.level.time)) { OakAI_RunFrames(self, FRAME_stand01, FRAME_stand40); } else { if (self.monsterinfo.idle_time < GameBase.level.time) { self.monsterinfo.idle_time = GameBase.level.time + 1.0f; } OakAI_Wave(self); } } else { self.think = oak_stand; } self.nextthink = GameBase.level.time + 0.1f; return true; } }; public static void OakAI_MoveToGoal(edict_t ent, float dist) { edict_t goal; goal = ent.goalentity; if (ent.groundentity == null && 0 == (ent.flags & (Defines.FL_FLY | Defines.FL_SWIM))) return; if (ent.enemy != null && SV.SV_CloseEnough(ent, ent.enemy, dist)) { ent.think = oak_standclose; ent.nextthink = GameBase.level.time + 0.1f; return; } M.M_walkmove(ent, ent.ideal_yaw, dist); } /*************************************************************************** * * Animation Functions * **************************************************************************/ /*************************************************************************** * * Function: OakAI_RunFrames * * Description: runs the anim frames * * Arguements: start end * * Returns: void * **************************************************************************/ public static void OakAI_RunFrames(edict_t self, int start, int end) { if ((self.s.frame < end) && (self.s.frame >= start)) { self.s.frame++; } else { self.s.frame = start; } } /*************************************************************************** * * Function: OakAI_Finger * * Description: runs the anim frames * * Arguements: start end * * Returns: void * **************************************************************************/ public static void OakAI_Finger(edict_t self) { OakAI_RunFrames(self, FRAME_flip01, FRAME_flip12); } /*************************************************************************** * * Function: OakAI_Taunt * * Description: runs the anim frames * * Arguements: start end * * Returns: void * **************************************************************************/ public static void OakAI_Taunt(edict_t self) { OakAI_RunFrames(self, FRAME_taunt01, FRAME_taunt17); } /*************************************************************************** * * Function: OakAI_Wave * * Description: runs the anim frames * * Arguements: start end * * Returns: void * **************************************************************************/ public static void OakAI_Wave(edict_t self) { OakAI_RunFrames(self, FRAME_wave01, FRAME_wave11); } /*************************************************************************** * * Function: OakAI_Salute * * Description: runs the anim frames * * Arguements: start end * * Returns: void * **************************************************************************/ public static void OakAI_Salute(edict_t self) { OakAI_RunFrames(self, FRAME_salute01, FRAME_salute11); } /*************************************************************************** * * Function: OakAI_Point * * Description: runs the anim frames * * Arguements: start end * * Returns: void * **************************************************************************/ public static void OakAI_Point(edict_t self) { OakAI_RunFrames(self, FRAME_point01, FRAME_point12); } } |
Update of /cvsroot/jake2/jake2/src/jake2/game/monsters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29339/src/jake2/game/monsters Added Files: Tag: RST M_Gunner.java M_Float.java M_Player.java M_Tank.java M_Soldier.java M_Infantry.java M_Insane.java M_Gladiator.java M_Boss31.java M_Chick.java M_Boss3.java M_Flash.java M_Supertank.java M_Boss2.java M_Mutant.java M_Hover.java M_Brain.java M_Boss32.java M_Parasite.java M_Berserk.java M_Flipper.java M_Flyer.java M_Actor.java M_Medic.java Log Message: This has vec3-optimize and the OAK bot. --- NEW FILE: M_Gunner.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1056 lines suppressed...] self.pain = gunner_pain; self.die = gunner_die; self.monsterinfo.stand = gunner_stand; self.monsterinfo.walk = gunner_walk; self.monsterinfo.run = gunner_run; self.monsterinfo.dodge = gunner_dodge; self.monsterinfo.attack = gunner_attack; self.monsterinfo.melee = null; self.monsterinfo.sight = gunner_sight; self.monsterinfo.search = gunner_search; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = gunner_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); } } --- NEW FILE: M_Soldier.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...2203 lines suppressed...] if (r > 0.33) self.monsterinfo.currentmove = soldier_move_duck; else self.monsterinfo.currentmove = soldier_move_attack3; return; } if (GameBase.skill.value >= 2) { if (r > 0.66) self.monsterinfo.currentmove = soldier_move_duck; else self.monsterinfo.currentmove = soldier_move_attack3; return; } self.monsterinfo.currentmove = soldier_move_attack3; } }; } --- NEW FILE: M_Parasite.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ // Created on 13.11.2003 by RST. // $Id: M_Parasite.java,v 1.1.2.1 2005/01/16 21:20:55 salomo Exp $ package jake2.game.monsters; import jake2.Defines; import jake2.Globals; import jake2.game.EntDieAdapter; import jake2.game.EntInteractAdapter; import jake2.game.EntPainAdapter; import jake2.game.EntThinkAdapter; import jake2.game.GameAI; import jake2.game.GameBase; import jake2.game.GameUtil; import jake2.game.edict_t; import jake2.game.mframe_t; import jake2.game.mmove_t; import jake2.game.trace_t; import jake2.util.Lib; import jake2.util.Math3D; public class M_Parasite { // This file generated by ModelGen - Do NOT Modify public final static int FRAME_break01 = 0; public final static int FRAME_break02 = 1; public final static int FRAME_break03 = 2; public final static int FRAME_break04 = 3; public final static int FRAME_break05 = 4; public final static int FRAME_break06 = 5; public final static int FRAME_break07 = 6; public final static int FRAME_break08 = 7; public final static int FRAME_break09 = 8; public final static int FRAME_break10 = 9; public final static int FRAME_break11 = 10; public final static int FRAME_break12 = 11; public final static int FRAME_break13 = 12; public final static int FRAME_break14 = 13; public final static int FRAME_break15 = 14; public final static int FRAME_break16 = 15; public final static int FRAME_break17 = 16; public final static int FRAME_break18 = 17; public final static int FRAME_break19 = 18; public final static int FRAME_break20 = 19; public final static int FRAME_break21 = 20; public final static int FRAME_break22 = 21; public final static int FRAME_break23 = 22; public final static int FRAME_break24 = 23; public final static int FRAME_break25 = 24; public final static int FRAME_break26 = 25; public final static int FRAME_break27 = 26; public final static int FRAME_break28 = 27; public final static int FRAME_break29 = 28; public final static int FRAME_break30 = 29; public final static int FRAME_break31 = 30; public final static int FRAME_break32 = 31; public final static int FRAME_death101 = 32; public final static int FRAME_death102 = 33; public final static int FRAME_death103 = 34; public final static int FRAME_death104 = 35; public final static int FRAME_death105 = 36; public final static int FRAME_death106 = 37; public final static int FRAME_death107 = 38; public final static int FRAME_drain01 = 39; public final static int FRAME_drain02 = 40; public final static int FRAME_drain03 = 41; public final static int FRAME_drain04 = 42; public final static int FRAME_drain05 = 43; public final static int FRAME_drain06 = 44; public final static int FRAME_drain07 = 45; public final static int FRAME_drain08 = 46; public final static int FRAME_drain09 = 47; public final static int FRAME_drain10 = 48; public final static int FRAME_drain11 = 49; public final static int FRAME_drain12 = 50; public final static int FRAME_drain13 = 51; public final static int FRAME_drain14 = 52; public final static int FRAME_drain15 = 53; public final static int FRAME_drain16 = 54; public final static int FRAME_drain17 = 55; public final static int FRAME_drain18 = 56; public final static int FRAME_pain101 = 57; public final static int FRAME_pain102 = 58; public final static int FRAME_pain103 = 59; public final static int FRAME_pain104 = 60; public final static int FRAME_pain105 = 61; public final static int FRAME_pain106 = 62; public final static int FRAME_pain107 = 63; public final static int FRAME_pain108 = 64; public final static int FRAME_pain109 = 65; public final static int FRAME_pain110 = 66; public final static int FRAME_pain111 = 67; public final static int FRAME_run01 = 68; public final static int FRAME_run02 = 69; public final static int FRAME_run03 = 70; public final static int FRAME_run04 = 71; public final static int FRAME_run05 = 72; public final static int FRAME_run06 = 73; public final static int FRAME_run07 = 74; public final static int FRAME_run08 = 75; public final static int FRAME_run09 = 76; public final static int FRAME_run10 = 77; public final static int FRAME_run11 = 78; public final static int FRAME_run12 = 79; public final static int FRAME_run13 = 80; public final static int FRAME_run14 = 81; public final static int FRAME_run15 = 82; public final static int FRAME_stand01 = 83; public final static int FRAME_stand02 = 84; public final static int FRAME_stand03 = 85; public final static int FRAME_stand04 = 86; public final static int FRAME_stand05 = 87; public final static int FRAME_stand06 = 88; public final static int FRAME_stand07 = 89; public final static int FRAME_stand08 = 90; public final static int FRAME_stand09 = 91; public final static int FRAME_stand10 = 92; public final static int FRAME_stand11 = 93; public final static int FRAME_stand12 = 94; public final static int FRAME_stand13 = 95; public final static int FRAME_stand14 = 96; public final static int FRAME_stand15 = 97; public final static int FRAME_stand16 = 98; public final static int FRAME_stand17 = 99; public final static int FRAME_stand18 = 100; public final static int FRAME_stand19 = 101; public final static int FRAME_stand20 = 102; public final static int FRAME_stand21 = 103; public final static int FRAME_stand22 = 104; public final static int FRAME_stand23 = 105; public final static int FRAME_stand24 = 106; public final static int FRAME_stand25 = 107; public final static int FRAME_stand26 = 108; public final static int FRAME_stand27 = 109; public final static int FRAME_stand28 = 110; public final static int FRAME_stand29 = 111; public final static int FRAME_stand30 = 112; public final static int FRAME_stand31 = 113; public final static int FRAME_stand32 = 114; public final static int FRAME_stand33 = 115; public final static int FRAME_stand34 = 116; public final static int FRAME_stand35 = 117; public final static float MODEL_SCALE = 1.000000f; static int sound_pain1; static int sound_pain2; static int sound_die; static int sound_launch; static int sound_impact; static int sound_suck; static int sound_reelin; static int sound_sight; static int sound_tap; static int sound_scratch; static int sound_search; static EntThinkAdapter parasite_launch = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_launch, 1, Defines.ATTN_NORM, 0); return true; } }; static EntThinkAdapter parasite_reel_in = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_reelin, 1, Defines.ATTN_NORM, 0); return true; } }; static EntInteractAdapter parasite_sight = new EntInteractAdapter() { public boolean interact(edict_t self, edict_t other) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_sight, 1, Defines.ATTN_NORM, 0); return true; } }; static EntThinkAdapter parasite_tap = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_tap, 1, Defines.ATTN_IDLE, 0); return true; } }; static EntThinkAdapter parasite_scratch = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_scratch, 1, Defines.ATTN_IDLE, 0); return true; } }; static EntThinkAdapter parasite_search = new EntThinkAdapter() { public boolean think(edict_t self) { GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_search, 1, Defines.ATTN_IDLE, 0); return true; } }; static EntThinkAdapter parasite_start_walk = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_start_walk; return true; } }; static EntThinkAdapter parasite_walk = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_walk; return true; } }; static EntThinkAdapter parasite_stand = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_stand; return true; } }; static EntThinkAdapter parasite_end_fidget = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_end_fidget; return true; } }; static EntThinkAdapter parasite_do_fidget = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_fidget; return true; } }; static EntThinkAdapter parasite_refidget = new EntThinkAdapter() { public boolean think(edict_t self) { if (Lib.random() <= 0.8) self.monsterinfo.currentmove = parasite_move_fidget; else self.monsterinfo.currentmove = parasite_move_end_fidget; return true; } }; static EntThinkAdapter parasite_idle = new EntThinkAdapter() { public boolean think(edict_t self) { self.monsterinfo.currentmove = parasite_move_start_fidget; return true; } }; static EntThinkAdapter parasite_start_run = new EntThinkAdapter() { public boolean think(edict_t self) { if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) self.monsterinfo.currentmove = parasite_move_stand; else self.monsterinfo.currentmove = parasite_move_start_run; return true; } }; static EntThinkAdapter parasite_run = new EntThinkAdapter() { public boolean think(edict_t self) { if ((self.monsterinfo.aiflags & Defines.AI_STAND_GROUND) != 0) self.monsterinfo.currentmove = parasite_move_stand; else self.monsterinfo.currentmove = parasite_move_run; return true; } }; static mframe_t parasite_frames_start_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t parasite_move_start_fidget = new mmove_t(FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget); static mframe_t parasite_frames_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, parasite_scratch), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_scratch), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t parasite_move_fidget = new mmove_t(FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget); static mframe_t parasite_frames_end_fidget[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, parasite_scratch), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null) }; static mmove_t parasite_move_end_fidget = new mmove_t(FRAME_stand28, FRAME_stand35, parasite_frames_end_fidget, parasite_stand); static mframe_t parasite_frames_stand[] = new mframe_t[] { new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap), new mframe_t(GameAI.ai_stand, 0, null), new mframe_t(GameAI.ai_stand, 0, parasite_tap) }; static mmove_t parasite_move_stand = new mmove_t(FRAME_stand01, FRAME_stand17, parasite_frames_stand, parasite_stand); static mframe_t parasite_frames_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 30, null), new mframe_t(GameAI.ai_run, 30, null), new mframe_t(GameAI.ai_run, 22, null), new mframe_t(GameAI.ai_run, 19, null), new mframe_t(GameAI.ai_run, 24, null), new mframe_t(GameAI.ai_run, 28, null), new mframe_t(GameAI.ai_run, 25, null) }; static mmove_t parasite_move_run = new mmove_t(FRAME_run03, FRAME_run09, parasite_frames_run, null); static mframe_t parasite_frames_start_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 0, null), new mframe_t(GameAI.ai_run, 30, null), }; static mmove_t parasite_move_start_run = new mmove_t(FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run); static mframe_t parasite_frames_stop_run[] = new mframe_t[] { new mframe_t(GameAI.ai_run, 20, null), new mframe_t(GameAI.ai_run, 20, null), new mframe_t(GameAI.ai_run, 12, null), new mframe_t(GameAI.ai_run, 10, null), new mframe_t(GameAI.ai_run, 0, null), new mframe_t(GameAI.ai_run, 0, null) }; static mmove_t parasite_move_stop_run = new mmove_t(FRAME_run10, FRAME_run15, parasite_frames_stop_run, null); static mframe_t parasite_frames_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 30, null), new mframe_t(GameAI.ai_walk, 30, null), new mframe_t(GameAI.ai_walk, 22, null), new mframe_t(GameAI.ai_walk, 19, null), new mframe_t(GameAI.ai_walk, 24, null), new mframe_t(GameAI.ai_walk, 28, null), new mframe_t(GameAI.ai_walk, 25, null) }; static mmove_t parasite_move_walk = new mmove_t(FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk); static mframe_t parasite_frames_start_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 0, null), new mframe_t(GameAI.ai_walk, 30, parasite_walk) }; static mmove_t parasite_move_start_walk = new mmove_t(FRAME_run01, FRAME_run02, parasite_frames_start_walk, null); static mframe_t parasite_frames_stop_walk[] = new mframe_t[] { new mframe_t(GameAI.ai_walk, 20, null), new mframe_t(GameAI.ai_walk, 20, null), new mframe_t(GameAI.ai_walk, 12, null), new mframe_t(GameAI.ai_walk, 10, null), new mframe_t(GameAI.ai_walk, 0, null), new mframe_t(GameAI.ai_walk, 0, null) }; static mmove_t parasite_move_stop_walk = new mmove_t(FRAME_run10, FRAME_run15, parasite_frames_stop_walk, null); static mframe_t parasite_frames_pain1[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 6, null), new mframe_t(GameAI.ai_move, 16, null), new mframe_t(GameAI.ai_move, -6, null), new mframe_t(GameAI.ai_move, -7, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t parasite_move_pain1 = new mmove_t(FRAME_pain101, FRAME_pain111, parasite_frames_pain1, parasite_start_run); static EntPainAdapter parasite_pain = new EntPainAdapter() { public void pain(edict_t self, edict_t other, float kick, int damage) { if (self.health < (self.max_health / 2)) self.s.skinnum = 1; if (GameBase.level.time < self.pain_debounce_time) return; self.pain_debounce_time = GameBase.level.time + 3; if (GameBase.skill.value == 3) return; // no pain anims in nightmare if (Lib.random() < 0.5) GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain1, 1, Defines.ATTN_NORM, 0); else GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_pain2, 1, Defines.ATTN_NORM, 0); self.monsterinfo.currentmove = parasite_move_pain1; } }; static EntThinkAdapter parasite_drain_attack = new EntThinkAdapter() { public boolean think(edict_t self) { float[] offset = { 0, 0, 0 }, start = { 0, 0, 0 }, f = { 0, 0, 0 }, r = { 0, 0, 0 }, end = { 0, 0, 0 }, dir = { 0, 0, 0 }; trace_t tr; int damage; Math3D.AngleVectors(self.s.angles, f, r, null); Math3D.VectorSet(offset, 24, 0, 6); Math3D.G_ProjectSource(self.s.origin, offset, f, r, start); Math3D.VectorCopy(self.enemy.s.origin, end); if (!parasite_drain_attack_ok(start, end)) { end[2] = self.enemy.s.origin[2] + self.enemy.maxs[2] - 8; if (!parasite_drain_attack_ok(start, end)) { end[2] = self.enemy.s.origin[2] + self.enemy.mins[2] + 8; if (!parasite_drain_attack_ok(start, end)) return true; } } Math3D.VectorCopy(self.enemy.s.origin, end); tr = GameBase.gi.trace(start, null, null, end, self, Defines.MASK_SHOT); if (tr.ent != self.enemy) return true; if (self.s.frame == FRAME_drain03) { damage = 5; GameBase.gi.sound(self.enemy, Defines.CHAN_AUTO, sound_impact, 1, Defines.ATTN_NORM, 0); } else { if (self.s.frame == FRAME_drain04) GameBase.gi.sound(self, Defines.CHAN_WEAPON, sound_suck, 1, Defines.ATTN_NORM, 0); damage = 2; } GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.TE_PARASITE_ATTACK); //gi.WriteShort(self - g_edicts); GameBase.gi.WriteShort(self.index); GameBase.gi.WritePosition(start); GameBase.gi.WritePosition(end); GameBase.gi.multicast(self.s.origin, Defines.MULTICAST_PVS); Math3D.VectorSubtract(start, end, dir); GameUtil.T_Damage(self.enemy, self, self, dir, self.enemy.s.origin, Globals.vec3_origin, damage, 0, Defines.DAMAGE_NO_KNOCKBACK, Defines.MOD_UNKNOWN); return true; } }; static mframe_t parasite_frames_drain[] = new mframe_t[] { new mframe_t(GameAI.ai_charge, 0, parasite_launch), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 15, parasite_drain_attack), // Target hits) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -2, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -2, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -3, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -2, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, -1, parasite_drain_attack), // drain) new mframe_t(GameAI.ai_charge, 0, parasite_reel_in), // let go) new mframe_t(GameAI.ai_charge, -2, null), new mframe_t(GameAI.ai_charge, -2, null), new mframe_t(GameAI.ai_charge, -3, null), new mframe_t(GameAI.ai_charge, 0, null) }; static mmove_t parasite_move_drain = new mmove_t(FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run); static mframe_t parasite_frames_break[] = new mframe_t[] { new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -3, null), new mframe_t(GameAI.ai_charge, 1, null), new mframe_t(GameAI.ai_charge, 2, null), new mframe_t(GameAI.ai_charge, -3, null), new mframe_t(GameAI.ai_charge, 1, null), new mframe_t(GameAI.ai_charge, 1, null), new mframe_t(GameAI.ai_charge, 3, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -18, null), new mframe_t(GameAI.ai_charge, 3, null), new mframe_t(GameAI.ai_charge, 9, null), new mframe_t(GameAI.ai_charge, 6, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -18, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 8, null), new mframe_t(GameAI.ai_charge, 9, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, -18, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 0, null), new mframe_t(GameAI.ai_charge, 0, null), /* airborne */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 0, null), /* slides */ new mframe_t(GameAI.ai_charge, 4, null), new mframe_t(GameAI.ai_charge, 11, null), new mframe_t(GameAI.ai_charge, -2, null), new mframe_t(GameAI.ai_charge, -5, null), new mframe_t(GameAI.ai_charge, 1, null) }; static mmove_t parasite_move_break = new mmove_t(FRAME_break01, FRAME_break32, parasite_frames_break, parasite_start_run); /* * === Break Stuff Ends === */ static EntThinkAdapter parasite_attack = new EntThinkAdapter() { public boolean think(edict_t self) { // if (random() <= 0.2) // self.monsterinfo.currentmove = ¶site_move_break; // else self.monsterinfo.currentmove = parasite_move_drain; return true; } }; /* * === Death Stuff Starts === */ static EntThinkAdapter parasite_dead = new EntThinkAdapter() { public boolean think(edict_t self) { Math3D.VectorSet(self.mins, -16, -16, -24); Math3D.VectorSet(self.maxs, 16, 16, -8); self.movetype = Defines.MOVETYPE_TOSS; self.svflags |= Defines.SVF_DEADMONSTER; self.nextthink = 0; GameBase.gi.linkentity(self); return true; } }; static mframe_t parasite_frames_death[] = new mframe_t[] { new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null), new mframe_t(GameAI.ai_move, 0, null) }; static mmove_t parasite_move_death = new mmove_t(FRAME_death101, FRAME_death107, parasite_frames_death, parasite_dead); static EntDieAdapter parasite_die = new EntDieAdapter() { public void die(edict_t self, edict_t inflictor, edict_t attacker, int damage, float[] point) { int n; // check for gib if (self.health <= self.gib_health) { GameBase.gi .sound(self, Defines.CHAN_VOICE, GameBase.gi .soundindex("misc/udeath.wav"), 1, Defines.ATTN_NORM, 0); for (n = 0; n < 2; n++) GameAI.ThrowGib(self, "models/objects/gibs/bone/tris.md2", damage, Defines.GIB_ORGANIC); for (n = 0; n < 4; n++) GameAI.ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, Defines.GIB_ORGANIC); GameAI.ThrowHead(self, "models/objects/gibs/head2/tris.md2", damage, Defines.GIB_ORGANIC); self.deadflag = Defines.DEAD_DEAD; return; } if (self.deadflag == Defines.DEAD_DEAD) return; // regular death GameBase.gi.sound(self, Defines.CHAN_VOICE, sound_die, 1, Defines.ATTN_NORM, 0); self.deadflag = Defines.DEAD_DEAD; self.takedamage = Defines.DAMAGE_YES; self.monsterinfo.currentmove = parasite_move_death; } }; /* * === End Death Stuff === */ /* * QUAKED monster_parasite (1 .5 0) (-16 -16 -24) (16 16 32) Ambush * Trigger_Spawn Sight */ public static EntThinkAdapter SP_monster_parasite = new EntThinkAdapter() { public boolean think(edict_t self) { if (GameBase.deathmatch.value != 0) { GameUtil.G_FreeEdict(self); return true; } sound_pain1 = GameBase.gi.soundindex("parasite/parpain1.wav"); sound_pain2 = GameBase.gi.soundindex("parasite/parpain2.wav"); sound_die = GameBase.gi.soundindex("parasite/pardeth1.wav"); sound_launch = GameBase.gi.soundindex("parasite/paratck1.wav"); sound_impact = GameBase.gi.soundindex("parasite/paratck2.wav"); sound_suck = GameBase.gi.soundindex("parasite/paratck3.wav"); sound_reelin = GameBase.gi.soundindex("parasite/paratck4.wav"); sound_sight = GameBase.gi.soundindex("parasite/parsght1.wav"); sound_tap = GameBase.gi.soundindex("parasite/paridle1.wav"); sound_scratch = GameBase.gi.soundindex("parasite/paridle2.wav"); sound_search = GameBase.gi.soundindex("parasite/parsrch1.wav"); self.s.modelindex = GameBase.gi .modelindex("models/monsters/parasite/tris.md2"); Math3D.VectorSet(self.mins, -16, -16, -24); Math3D.VectorSet(self.maxs, 16, 16, 24); self.movetype = Defines.MOVETYPE_STEP; self.solid = Defines.SOLID_BBOX; self.health = 175; self.gib_health = -50; self.mass = 250; self.pain = parasite_pain; self.die = parasite_die; self.monsterinfo.stand = parasite_stand; self.monsterinfo.walk = parasite_start_walk; self.monsterinfo.run = parasite_start_run; self.monsterinfo.attack = parasite_attack; self.monsterinfo.sight = parasite_sight; self.monsterinfo.idle = parasite_idle; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = parasite_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); return true; } }; static boolean parasite_drain_attack_ok(float[] start, float[] end) { float[] dir = { 0, 0, 0 }, angles = { 0, 0, 0 }; // check for max distance Math3D.VectorSubtract(start, end, dir); if (Math3D.VectorLength(dir) > 256) return false; // check for min/max pitch Math3D.vectoangles(dir, angles); if (angles[0] < -180) angles[0] += 360; if (Math.abs(angles[0]) > 30) return false; return true; } } --- NEW FILE: M_Player.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ // Created on 11.11.2003 by RST. // $Id: M_Player.java,v 1.1.2.1 2005/01/16 21:20:54 salomo Exp $ package jake2.game.monsters; public class M_Player { // This file generated by qdata - Do NOT Modify public final static int FRAME_stand01 = 0; public final static int FRAME_stand02 = 1; public final static int FRAME_stand03 = 2; public final static int FRAME_stand04 = 3; public final static int FRAME_stand05 = 4; public final static int FRAME_stand06 = 5; public final static int FRAME_stand07 = 6; public final static int FRAME_stand08 = 7; public final static int FRAME_stand09 = 8; public final static int FRAME_stand10 = 9; public final static int FRAME_stand11 = 10; public final static int FRAME_stand12 = 11; public final static int FRAME_stand13 = 12; public final static int FRAME_stand14 = 13; public final static int FRAME_stand15 = 14; public final static int FRAME_stand16 = 15; public final static int FRAME_stand17 = 16; public final static int FRAME_stand18 = 17; public final static int FRAME_stand19 = 18; public final static int FRAME_stand20 = 19; public final static int FRAME_stand21 = 20; public final static int FRAME_stand22 = 21; public final static int FRAME_stand23 = 22; public final static int FRAME_stand24 = 23; public final static int FRAME_stand25 = 24; public final static int FRAME_stand26 = 25; public final static int FRAME_stand27 = 26; public final static int FRAME_stand28 = 27; public final static int FRAME_stand29 = 28; public final static int FRAME_stand30 = 29; public final static int FRAME_stand31 = 30; public final static int FRAME_stand32 = 31; public final static int FRAME_stand33 = 32; public final static int FRAME_stand34 = 33; public final static int FRAME_stand35 = 34; public final static int FRAME_stand36 = 35; public final static int FRAME_stand37 = 36; public final static int FRAME_stand38 = 37; public final static int FRAME_stand39 = 38; public final static int FRAME_stand40 = 39; public final static int FRAME_run1 = 40; public final static int FRAME_run2 = 41; public final static int FRAME_run3 = 42; public final static int FRAME_run4 = 43; public final static int FRAME_run5 = 44; public final static int FRAME_run6 = 45; public final static int FRAME_attack1 = 46; public final static int FRAME_attack2 = 47; public final static int FRAME_attack3 = 48; public final static int FRAME_attack4 = 49; public final static int FRAME_attack5 = 50; public final static int FRAME_attack6 = 51; public final static int FRAME_attack7 = 52; public final static int FRAME_attack8 = 53; public final static int FRAME_pain101 = 54; public final static int FRAME_pain102 = 55; public final static int FRAME_pain103 = 56; public final static int FRAME_pain104 = 57; public final static int FRAME_pain201 = 58; public final static int FRAME_pain202 = 59; public final static int FRAME_pain203 = 60; public final static int FRAME_pain204 = 61; public final static int FRAME_pain301 = 62; public final static int FRAME_pain302 = 63; public final static int FRAME_pain303 = 64; public final static int FRAME_pain304 = 65; public final static int FRAME_jump1 = 66; public final static int FRAME_jump2 = 67; public final static int FRAME_jump3 = 68; public final static int FRAME_jump4 = 69; public final static int FRAME_jump5 = 70; public final static int FRAME_jump6 = 71; public final static int FRAME_flip01 = 72; public final static int FRAME_flip02 = 73; public final static int FRAME_flip03 = 74; public final static int FRAME_flip04 = 75; public final static int FRAME_flip05 = 76; public final static int FRAME_flip06 = 77; public final static int FRAME_flip07 = 78; public final static int FRAME_flip08 = 79; public final static int FRAME_flip09 = 80; public final static int FRAME_flip10 = 81; public final static int FRAME_flip11 = 82; public final static int FRAME_flip12 = 83; public final static int FRAME_salute01 = 84; public final static int FRAME_salute02 = 85; public final static int FRAME_salute03 = 86; public final static int FRAME_salute04 = 87; public final static int FRAME_salute05 = 88; public final static int FRAME_salute06 = 89; public final static int FRAME_salute07 = 90; public final static int FRAME_salute08 = 91; public final static int FRAME_salute09 = 92; public final static int FRAME_salute10 = 93; public final static int FRAME_salute11 = 94; public final static int FRAME_taunt01 = 95; public final static int FRAME_taunt02 = 96; public final static int FRAME_taunt03 = 97; public final static int FRAME_taunt04 = 98; public final static int FRAME_taunt05 = 99; public final static int FRAME_taunt06 = 100; public final static int FRAME_taunt07 = 101; public final static int FRAME_taunt08 = 102; public final static int FRAME_taunt09 = 103; public final static int FRAME_taunt10 = 104; public final static int FRAME_taunt11 = 105; public final static int FRAME_taunt12 = 106; public final static int FRAME_taunt13 = 107; public final static int FRAME_taunt14 = 108; public final static int FRAME_taunt15 = 109; public final static int FRAME_taunt16 = 110; public final static int FRAME_taunt17 = 111; public final static int FRAME_wave01 = 112; public final static int FRAME_wave02 = 113; public final static int FRAME_wave03 = 114; public final static int FRAME_wave04 = 115; public final static int FRAME_wave05 = 116; public final static int FRAME_wave06 = 117; public final static int FRAME_wave07 = 118; public final static int FRAME_wave08 = 119; public final static int FRAME_wave09 = 120; public final static int FRAME_wave10 = 121; public final static int FRAME_wave11 = 122; public final static int FRAME_point01 = 123; public final static int FRAME_point02 = 124; public final static int FRAME_point03 = 125; public final static int FRAME_point04 = 126; public final static int FRAME_point05 = 127; public final static int FRAME_point06 = 128; public final static int FRAME_point07 = 129; public final static int FRAME_point08 = 130; public final static int FRAME_point09 = 131; public final static int FRAME_point10 = 132; public final static int FRAME_point11 = 133; public final static int FRAME_point12 = 134; public final static int FRAME_crstnd01 = 135; public final static int FRAME_crstnd02 = 136; public final static int FRAME_crstnd03 = 137; public final static int FRAME_crstnd04 = 138; public final static int FRAME_crstnd05 = 139; public final static int FRAME_crstnd06 = 140; public final static int FRAME_crstnd07 = 141; public final static int FRAME_crstnd08 = 142; public final static int FRAME_crstnd09 = 143; public final static int FRAME_crstnd10 = 144; public final static int FRAME_crstnd11 = 145; public final static int FRAME_crstnd12 = 146; public final static int FRAME_crstnd13 = 147; public final static int FRAME_crstnd14 = 148; public final static int FRAME_crstnd15 = 149; public final static int FRAME_crstnd16 = 150; public final static int FRAME_crstnd17 = 151; public final static int FRAME_crstnd18 = 152; public final static int FRAME_crstnd19 = 153; public final static int FRAME_crwalk1 = 154; public final static int FRAME_crwalk2 = 155; public final static int FRAME_crwalk3 = 156; public final static int FRAME_crwalk4 = 157; public final static int FRAME_crwalk5 = 158; public final static int FRAME_crwalk6 = 159; public final static int FRAME_crattak1 = 160; public final static int FRAME_crattak2 = 161; public final static int FRAME_crattak3 = 162; public final static int FRAME_crattak4 = 163; public final static int FRAME_crattak5 = 164; public final static int FRAME_crattak6 = 165; public final static int FRAME_crattak7 = 166; public final static int FRAME_crattak8 = 167; public final static int FRAME_crattak9 = 168; public final static int FRAME_crpain1 = 169; public final static int FRAME_crpain2 = 170; public final static int FRAME_crpain3 = 171; public final static int FRAME_crpain4 = 172; public final static int FRAME_crdeath1 = 173; public final static int FRAME_crdeath2 = 174; public final static int FRAME_crdeath3 = 175; public final static int FRAME_crdeath4 = 176; public final static int FRAME_crdeath5 = 177; public final static int FRAME_death101 = 178; public final static int FRAME_death102 = 179; public final static int FRAME_death103 = 180; public final static int FRAME_death104 = 181; public final static int FRAME_death105 = 182; public final static int FRAME_death106 = 183; public final static int FRAME_death201 = 184; public final static int FRAME_death202 = 185; public final static int FRAME_death203 = 186; public final static int FRAME_death204 = 187; public final static int FRAME_death205 = 188; public final static int FRAME_death206 = 189; public final static int FRAME_death301 = 190; public final static int FRAME_death302 = 191; public final static int FRAME_death303 = 192; public final static int FRAME_death304 = 193; public final static int FRAME_death305 = 194; public final static int FRAME_death306 = 195; public final static int FRAME_death307 = 196; public final static int FRAME_death308 = 197; public final static float MODEL_SCALE = 1.000000f; } --- NEW FILE: M_Insane.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1255 lines suppressed...] GameBase.gi.linkentity(self); if ((self.spawnflags & 16) != 0) // Stand Ground self.monsterinfo.aiflags |= Defines.AI_STAND_GROUND; self.monsterinfo.currentmove = insane_move_stand_normal; self.monsterinfo.scale = MODEL_SCALE; if ((self.spawnflags & 8) != 0) // Crucified ? { Math3D.VectorSet(self.mins, -16, 0, 0); Math3D.VectorSet(self.maxs, 16, 8, 32); self.flags |= Defines.FL_NO_KNOCKBACK; GameAI.flymonster_start.think(self); } else { GameAI.walkmonster_start.think(self); self.s.skinnum = Lib.rand() % 3; } } } --- NEW FILE: M_Float.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1185 lines suppressed...] self.monsterinfo.walk = floater_walk; self.monsterinfo.run = floater_run; // self.monsterinfo.dodge = floater_dodge; self.monsterinfo.attack = floater_attack; self.monsterinfo.melee = floater_melee; self.monsterinfo.sight = floater_sight; self.monsterinfo.idle = floater_idle; GameBase.gi.linkentity(self); if (Lib.random() <= 0.5) self.monsterinfo.currentmove = floater_move_stand1; else self.monsterinfo.currentmove = floater_move_stand2; self.monsterinfo.scale = MODEL_SCALE; GameAI.flymonster_start.think(self); } } --- NEW FILE: M_Actor.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1559 lines suppressed...] self.solid = Defines.SOLID_TRIGGER; self.touch = target_actor_touch; Math3D.VectorSet(self.mins, -8, -8, -8); Math3D.VectorSet(self.maxs, 8, 8, 8); self.svflags = Defines.SVF_NOCLIENT; if ((self.spawnflags & 1) != 0) { if (0 == self.speed) self.speed = 200; if (0 == GameBase.st.height) GameBase.st.height = 200; if (self.s.angles[Defines.YAW] == 0) self.s.angles[Defines.YAW] = 360; GameBase.G_SetMovedir(self.s.angles, self.movedir); self.movedir[2] = GameBase.st.height; } GameBase.gi.linkentity(self); } } --- NEW FILE: M_Tank.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1482 lines suppressed...] self.monsterinfo.dodge = null; self.monsterinfo.attack = tank_attack; self.monsterinfo.melee = null; self.monsterinfo.sight = tank_sight; self.monsterinfo.idle = tank_idle; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = tank_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); if (Lib.strcmp(self.classname, "monster_tank_commander") == 0) self.s.skinnum = 2; return true; } }; } --- NEW FILE: M_Supertank.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1224 lines suppressed...] for (n = 0; n < 8; n++) GameAI.ThrowGib(self, "models/objects/gibs/sm_metal/tris.md2", 500, Defines.GIB_METALLIC); GameAI.ThrowGib(self, "models/objects/gibs/chest/tris.md2", 500, Defines.GIB_ORGANIC); GameAI.ThrowHead(self, "models/objects/gibs/gear/tris.md2", 500, Defines.GIB_METALLIC); self.deadflag = Defines.DEAD_DEAD; return; } GameBase.gi.WriteByte(Defines.svc_temp_entity); GameBase.gi.WriteByte(Defines.TE_EXPLOSION1); GameBase.gi.WritePosition(org); GameBase.gi.multicast(self.s.origin, Defines.MULTICAST_PVS); self.nextthink = GameBase.level.time + 0.1f; } } --- NEW FILE: M_Chick.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ [...1276 lines suppressed...] self.pain = chick_pain; self.die = chick_die; self.monsterinfo.stand = chick_stand; self.monsterinfo.walk = chick_walk; self.monsterinfo.run = chick_run; self.monsterinfo.dodge = chick_dodge; self.monsterinfo.attack = chick_attack; self.monsterinfo.melee = chick_melee; self.monsterinfo.sight = chick_sight; GameBase.gi.linkentity(self); self.monsterinfo.currentmove = chick_move_stand; self.monsterinfo.scale = MODEL_SCALE; GameAI.walkmonster_start.think(self); } } --- NEW FILE: M_Flipper.java --- /* * Copyright (C) 1997-2001 Id Software, Inc. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. * * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA. * */ // Created on 13.11.2003 by RST. // $Id: M_Flipper.java,v 1.1.2.1 2005/01/16 21:20:55 salomo Exp $ package jake2.game.monsters; import jake2.Defines; import jake2.game.EntDieAdapter; import jake2.game.EntInteractAdapter; import jake2.game.EntPainAdapter; import jake2.game.EntThinkAdapter; import jake2.game.Fire; import jake2.game.GameAI; import jake2.game.GameBase; import jake2.game.GameUtil; import jake2.game.edict_t; import jake2.game.mframe_t; import jake2.game.mmove_t; import jake2.util.Lib; import jake2.util.Math3D; public class M_Flipper { // This file generated by ModelGen - Do NOT Modify public final static int FRAME_flpbit01 = 0; public final static int FRAME_flpbit02 = 1; public final static int FRAME_flpbit03 = 2; public final static int FRAME_flpbit04 = 3; public final static int FRAME_flpbit05 = 4; public final static int FRAME_flpbit06 = 5; public final static int FRAME_flpbit07 = 6; public final static int FRAME_flpbit08 = 7; public final static int FRAME_flpbit09 = 8; public final static int FRAME_flpbit10 = 9; public final static int FRAME_flpbit11 = 10; public final static int FRAME_flpbit12 = 11; public final static int FRAME_flpbit13 = 12; public final static int FRAME_flpbit14 = 13; public final static int FRAME_flpbit15 = 14; public final static int FRAME_flpbit16 = 15; public final static int FRAME_flpbit17 = 16; public final static int FRAME_flpbit18 = 17; public final static int FRAME_flpbit19 = 18; public final static int FRAME_flpbit20 = 19; public final static int FRAME_flptal01 = 20; public final static int FRAME_flptal02 = 21; public final static int FRAME_flptal03 = 22; public final static int FRAME_flptal04 = 23; public final static int FRAME_flptal05 = 24; public final static int FRAME_flptal06 = 25; public final static int FRAME_flptal07 = 26; public final static int FRAME_flptal08 = 27; public final static int FRAME_flptal09 = 28; public final static int FRAME_flptal10 = 29; public final static int FRAME_flptal11 = 30; public final static int FRAME_flptal12 = 31; public final static int FRAME_flptal13 = 32; public final static int FRAME_flptal14 = 33; public final static int FRAME_flptal15 = 34; public final static int FRAME_flptal16 = 35; public final static int FRAME_flptal17 = 36; public final static int FRAME_flptal18 = 37; public final static int FRAME_flptal19 = 38; public final static int FRAME_flptal20 = 39; public final static int FRAME_flptal21 = 40; public final static int FRAME_flphor01 = 41; public final static int FRAME_flphor02 = 42; public final static int FRAME_flphor03 = 43; public final static int FRAME_flphor04 = 44; public final static int FRAME_flphor05 = 45; public final static int FRAME_flphor06 = 46; public final static int FRAME_flphor07 = 47; public final static int FRAME_flphor08 = 48; public final static int FRAME_flphor09 = 49; public final static int FRAME_flphor10 = 50; public final static int FRAME_flphor11 = 51; public final static int FRAME_flphor12 = 52; public final static int FRAME_flphor13 = 53; public final static int FRAME_flphor14 = 54; public final static int FRAME_flphor15 = 55; public final static int FRAME_flphor16 = 56; public final static int FRAME_flphor17 = 57; public final static int FRAME_flphor18 = 58; public final static int FRAME_flphor19 = 59; public final static int FRAME_flphor20 = 60; public final static int FRAME_flphor21 = 61; public final static int FRAME_flphor22 = 62; public final static int FRAME_flphor23 = 63; public final static int FRAME_flphor24 = 64; public final static int FRAME_flpver01 = 65; public final static int FRAME_flpver02 = 66; public final static int FRAME_flpver03 = 67; public final static int FRAME_flpver04 = 68; public final static int FRAME_flpver05 = 69; public final static int FRAME_flpver06 = 70; public final static int FRAME_flpver07 = 71; public final static int FRAME_flpver08 = 72; public final static int FRAME_flpver09 = 73; public final static int FRAME_flpver10 = 74; public final static int FRAME_flpver11 = 75; public final static int FRAME_flpver12 = 76; public final static int FRAME_flpver13 = 77; public final static int FRAME_flpver14 = 78; public final static int FRAME_flpver15 = 79; public final static int FRAME_flpver16 = 80; public final static int FRAME_flpver17 = 81; public final static int FRAME_flpver18 = 82; public final static int FRAME_flpver19 = 83; public final static int FRAME_flpver20 = 84; public final static int FRAME_flpver21 = 85; public final static int FRAME_flpver22 = 86; public final static int FRAME_flpver23 = 87; public final static int FRAME_flpver24 = 88; public final static int FRAME_flpver25 = 89; public final static int FRAME_flpver26 = 90; public final static int FRAME_flpver27 = 91; public final static int FRAME_flpver28 = 92; public final static int FRAME_flpver29 = 93; public final static int FRAME_flppn101 = 94; public final static int FRAME_flppn102 = 95; public final static int FRAME_flppn103 = 96; public final static int FRAME_flppn104 = 97; public final static int FRAME_flppn105 = 98; public final static int FRAME_flppn201 = 99; public final static int FRAME_flppn202 = 100; public final static int FRAME_flppn203 = 101; public final static int FRAME_flppn204 = 102; public final static int FRAME_flppn205 = 103; public final static int FRAME_flpdth01 = 104; public final static int FRAME_flpdth02 = 105; public final static int FRAME_flpdth03 = 106; public final static int FRAME_flpdth04 = 107; public final static int FRAME_flpdth05 = 108; ... [truncated message content] |
From: Rene S. <sa...@us...> - 2005-01-16 21:14:07
|
Update of /cvsroot/jake2/jake2/src/jake2/game/bots In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29234/src/jake2/game/bots Log Message: Directory /cvsroot/jake2/jake2/src/jake2/game/bots added to the repository --> Using per-directory sticky tag `RST' |
From: Rene S. <sa...@us...> - 2005-01-16 21:14:06
|
Update of /cvsroot/jake2/jake2/src/jake2/game/monsters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29234/src/jake2/game/monsters Log Message: Directory /cvsroot/jake2/jake2/src/jake2/game/monsters added to the repository --> Using per-directory sticky tag `RST' |
From: Rene S. <sa...@us...> - 2005-01-16 21:13:42
|
Update of /cvsroot/jake2/jake2/info In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29234/info Log Message: Directory /cvsroot/jake2/jake2/info added to the repository --> Using per-directory sticky tag `RST' |
From: Carsten W. <ca...@us...> - 2005-01-16 17:09:06
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14087/src/jake2/render/fastjogl Modified Files: Main.java Log Message: reduces the garbage Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Main.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Main.java 8 Dec 2004 09:58:34 -0000 1.5 --- Main.java 16 Jan 2005 17:08:57 -0000 1.6 *************** *** 29,38 **** import jake2.Globals; import jake2.client.*; ! import jake2.game.*; import jake2.game.cplane_t; import jake2.game.cvar_t; import jake2.qcommon.*; - import jake2.qcommon.qfiles; - import jake2.qcommon.xcommand_t; import jake2.render.*; import jake2.util.Math3D; --- 29,36 ---- import jake2.Globals; import jake2.client.*; ! import jake2.game.Cmd; import jake2.game.cplane_t; import jake2.game.cvar_t; import jake2.qcommon.*; import jake2.render.*; import jake2.util.Math3D; *************** *** 640,643 **** --- 638,644 ---- =============== */ + + private final float[] temp = { 0, 0, 0 }; + void R_SetupFrame() { int i; *************** *** 660,665 **** // check above and below so crossing solid water doesn't draw wrong if (leaf.contents == 0) { // look down a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] -= 16; --- 661,664 ---- *************** *** 669,674 **** } else { // look up a bit - float[] temp = { 0, 0, 0 }; - Math3D.VectorCopy(r_origin, temp); temp[2] += 16; --- 668,671 ---- *************** *** 898,904 **** ==================== */ void R_SetLightLevel() { - float[] shadelight = { 0, 0, 0 }; - if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; --- 895,901 ---- ==================== */ + private final float[] shadelight = { 0, 0, 0 }; + void R_SetLightLevel() { if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) return; |
From: Carsten W. <ca...@us...> - 2005-01-16 17:05:00
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13207/src/jake2/util Modified Files: Math3D.java Log Message: small optimizations Index: Math3D.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/util/Math3D.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Math3D.java 22 Sep 2004 19:22:13 -0000 1.7 --- Math3D.java 16 Jan 2005 17:04:50 -0000 1.8 *************** *** 175,184 **** private static float tmpmat[][] = new float[3][3]; private static float zrot[][] = new float[3][3]; ! public static void RotatePointAroundVector(float[] dst, float[] dir, float[] point, float degrees) { ! ! float[] vr = { 0.0f, 0.0f, 0.0f }; ! float[] vup = { 0.0f, 0.0f, 0.0f }; ! float[] vf = { 0.0f, 0.0f, 0.0f }; vf[0] = dir[0]; vf[1] = dir[1]; --- 175,185 ---- private static float tmpmat[][] = new float[3][3]; private static float zrot[][] = new float[3][3]; ! ! // to reduce garbage ! private static final float[] vr = {0, 0, 0}; ! private static final float[] vup = {0, 0, 0}; ! private static final float[] vf = {0, 0, 0}; + public static void RotatePointAroundVector(float[] dst, float[] dir, float[] point, float degrees) { vf[0] = dir[0]; vf[1] = dir[1]; *************** *** 225,228 **** --- 226,230 ---- } } + public static void MakeNormalVectors(float[] forward, float[] right, float[] up) { // this rotate and negat guarantees a vector *************** *** 287,290 **** --- 289,295 ---- dst[2] = p[2] - d * dst[2]; } + + private static final float[][] PLANE_XYZ = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}; + /** assumes "src" is normalized */ public static void PerpendicularVector(float[] dst, float[] src) { *************** *** 300,308 **** } } - float tempvec[] = { 0.0f, 0.0f, 0.0f }; - tempvec[pos] = 1.0F; - // project the point onto the plane defined by src ! ProjectPointOnPlane(dst, tempvec, src); //normalize the result --- 305,310 ---- } } // project the point onto the plane defined by src ! ProjectPointOnPlane(dst, PLANE_XYZ[pos], src); //normalize the result |
From: Carsten W. <ca...@us...> - 2005-01-16 16:56:02
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11476/src/jake2/client Modified Files: SCR.java Log Message: reduces the garbage Index: SCR.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/SCR.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** SCR.java 22 Sep 2004 19:22:08 -0000 1.8 --- SCR.java 16 Jan 2005 16:55:52 -0000 1.9 *************** *** 1176,1184 **** * text to the screen. ================== */ static void UpdateScreen2() { int numframes; int i; - float[] separation = { 0, 0 }; - // if the screen is disabled (loading plaque is up, or vid mode // changing) --- 1176,1184 ---- * text to the screen. ================== */ + private static final float[] separation = { 0, 0 }; + static void UpdateScreen2() { int numframes; int i; // if the screen is disabled (loading plaque is up, or vid mode // changing) |
From: Carsten W. <ca...@us...> - 2005-01-16 15:25:01
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26647/src/jake2/render/fastjogl Modified Files: Mesh.java Warp.java Surf.java Light.java Log Message: changes to use the Vec3Cache instead of new float[3] (faster) Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Light.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Light.java 12 Jan 2005 12:14:27 -0000 1.10 --- Light.java 16 Jan 2005 15:24:50 -0000 1.11 *************** *** 32,39 **** import jake2.qcommon.Com; import jake2.qcommon.longjmpException; ! import jake2.render.mnode_t; ! import jake2.render.msurface_t; ! import jake2.render.mtexinfo_t; import jake2.util.Math3D; import java.nio.ByteBuffer; --- 32,38 ---- import jake2.qcommon.Com; import jake2.qcommon.longjmpException; ! import jake2.render.*; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import java.nio.ByteBuffer; *************** *** 64,74 **** void R_RenderDlight(dlight_t light) { ! int i, j; ! float a; ! float[] v = { 0, 0, 0 }; ! float rad; ! ! rad = light.intensity * 0.35f; ! Math3D.VectorSubtract(light.origin, r_origin, v); --- 63,68 ---- void R_RenderDlight(dlight_t light) { ! float rad = light.intensity * 0.35f; ! float[] v = Vec3Cache.get(); Math3D.VectorSubtract(light.origin, r_origin, v); *************** *** 76,86 **** gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f, light.color[2] * 0.2f); ! for (i = 0; i < 3; i++) v[i] = light.origin[i] - vpn[i] * rad; gl.glVertex3f(v[0], v[1], v[2]); gl.glColor3f(0, 0, 0); ! for (i = 16; i >= 0; i--) { a = (float) (i / 16.0f * Math.PI * 2); ! for (j = 0; j < 3; j++) v[j] = (float) (light.origin[j] + vright[j] * Math.cos(a) * rad + vup[j] * Math.sin(a) * rad); --- 70,82 ---- gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f, light.color[2] * 0.2f); ! for (int i = 0; i < 3; i++) v[i] = light.origin[i] - vpn[i] * rad; + gl.glVertex3f(v[0], v[1], v[2]); gl.glColor3f(0, 0, 0); ! float a; ! for (int i = 16; i >= 0; i--) { a = (float) (i / 16.0f * Math.PI * 2); ! for (int j = 0; j < 3; j++) v[j] = (float) (light.origin[j] + vright[j] * Math.cos(a) * rad + vup[j] * Math.sin(a) * rad); *************** *** 88,91 **** --- 84,88 ---- } gl.glEnd(); + Vec3Cache.release(); } *************** *** 128,142 **** */ void R_MarkLights(dlight_t light, int bit, mnode_t node) { - cplane_t splitplane; - float dist; - msurface_t surf; - int i; - int sidebit; - if (node.contents != -1) return; ! splitplane = node.plane; ! dist = Math3D.DotProduct(light.origin, splitplane.normal) - splitplane.dist; --- 125,133 ---- */ void R_MarkLights(dlight_t light, int bit, mnode_t node) { if (node.contents != -1) return; ! cplane_t splitplane = node.plane; ! float dist = Math3D.DotProduct(light.origin, splitplane.normal) - splitplane.dist; *************** *** 150,155 **** } // mark the polygons ! for (i = 0; i < node.numsurfaces; i++) { surf = r_worldmodel.surfaces[node.firstsurface + i]; --- 141,148 ---- } + msurface_t surf; + int sidebit; // mark the polygons ! for (int i = 0; i < node.numsurfaces; i++) { surf = r_worldmodel.surfaces[node.firstsurface + i]; *************** *** 182,194 **** */ void R_PushDlights() { - int i; - dlight_t l; - if (gl_flashblend.value != 0) return; r_dlightframecount = r_framecount + 1; // because the count hasn't // advanced yet for this frame ! for (i = 0; i < r_newrefdef.num_dlights; i++) { l = r_newrefdef.dlights[i]; R_MarkLights(l, 1 << i, r_worldmodel.nodes[0]); --- 175,186 ---- */ void R_PushDlights() { if (gl_flashblend.value != 0) return; r_dlightframecount = r_framecount + 1; // because the count hasn't + // advanced yet for this frame ! dlight_t l; ! for (int i = 0; i < r_newrefdef.num_dlights; i++) { l = r_newrefdef.dlights[i]; R_MarkLights(l, 1 << i, r_worldmodel.nodes[0]); *************** *** 216,225 **** return -1; // didn't hit anything ! msurface_t surf; ! int s, t, ds, dt; ! int i; ! mtexinfo_t tex; ! ByteBuffer lightmap; ! int maps; // calculate mid point --- 208,213 ---- return -1; // didn't hit anything ! // ByteBuffer lightmap; ! // int maps; // calculate mid point *************** *** 236,240 **** float frac = front / (front - back); ! float[] mid = { 0, 0, 0 }; mid[0] = start[0] + (end[0] - start[0]) * frac; mid[1] = start[1] + (end[1] - start[1]) * frac; --- 224,228 ---- float frac = front / (front - back); ! float[] mid = Vec3Cache.get(); mid[0] = start[0] + (end[0] - start[0]) * frac; mid[1] = start[1] + (end[1] - start[1]) * frac; *************** *** 243,251 **** // go down front side int r = RecursiveLightPoint(node.children[sideIndex], start, mid); ! if (r >= 0) return r; // hit something ! if ((back < 0) == side) return -1; // didn't hit anuthing // check for impact on this node --- 231,243 ---- // go down front side int r = RecursiveLightPoint(node.children[sideIndex], start, mid); ! if (r >= 0) { ! Vec3Cache.release(); return r; // hit something + } ! if ((back < 0) == side) { ! Vec3Cache.release(); return -1; // didn't hit anuthing + } // check for impact on this node *************** *** 254,261 **** int surfIndex = node.firstsurface; float scale0; float scale1; float scale2; ! for (i = 0; i < node.numsurfaces; i++, surfIndex++) { surf = r_worldmodel.surfaces[surfIndex]; --- 246,260 ---- int surfIndex = node.firstsurface; + + msurface_t surf; + mtexinfo_t tex; float scale0; float scale1; float scale2; ! int s, t, ds, dt; ! ByteBuffer lightmap; ! int maps; ! ! for (int i = 0; i < node.numsurfaces; i++, surfIndex++) { surf = r_worldmodel.surfaces[surfIndex]; *************** *** 308,316 **** } } return 1; } // go down back side ! return RecursiveLightPoint(node.children[1 - sideIndex], mid, end); } --- 307,318 ---- } } + Vec3Cache.release(); return 1; } // go down back side ! r = RecursiveLightPoint(node.children[1 - sideIndex], mid, end); ! Vec3Cache.release(); ! return r; } *************** *** 327,331 **** } ! float[] end = { 0, 0, 0 }; end[0] = p[0]; end[1] = p[1]; --- 329,333 ---- } ! float[] end = Vec3Cache.get(); end[0] = p[0]; end[1] = p[1]; *************** *** 357,360 **** --- 359,363 ---- Math3D.VectorScale(color, gl_modulate.value, color); + Vec3Cache.release(); } *************** *** 370,374 **** int sd, td; float fdist, frad, fminlight; ! float[] impact = { 0, 0, 0 }; int s, t; dlight_t dl; --- 373,377 ---- int sd, td; float fdist, frad, fminlight; ! float[] impact = Vec3Cache.get(); int s, t; dlight_t dl; *************** *** 433,436 **** --- 436,440 ---- } } + Vec3Cache.release(); } Index: Warp.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Warp.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Warp.java 10 Jan 2005 00:05:23 -0000 1.6 --- Warp.java 16 Jan 2005 15:24:50 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- import jake2.render.*; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import net.java.games.jogl.GL; *************** *** 348,353 **** void DrawSkyPolygon(int nump, float[][] vecs) { int i, j; - float[] v = { 0, 0, 0 }; - float[] av = { 0, 0, 0 }; float s, t, dv; int axis; --- 349,352 ---- *************** *** 356,363 **** --- 355,364 ---- c_sky++; // decide which face it maps to + float[] v = Vec3Cache.get(); Math3D.VectorCopy(Globals.vec3_origin, v); for (i = 0; i < nump; i++) { Math3D.VectorAdd(vecs[i], v, v); } + float[] av = Vec3Cache.get(); av[0] = Math.abs(v[0]); av[1] = Math.abs(v[1]); *************** *** 379,382 **** --- 380,385 ---- axis = 4; } + + Vec3Cache.release(2); // v, av // project new texture coords *************** *** 527,533 **** */ void R_ClearSkyBox() { ! int i; ! ! for (i = 0; i < 6; i++) { skymins[0][i] = skymins[1][i] = 9999; skymaxs[0][i] = skymaxs[1][i] = -9999; --- 530,534 ---- */ void R_ClearSkyBox() { ! for (int i = 0; i < 6; i++) { skymins[0][i] = skymins[1][i] = 9999; skymaxs[0][i] = skymaxs[1][i] = -9999; *************** *** 536,548 **** void MakeSkyVec(float s, float t, int axis) { ! float[] v = { 0, 0, 0 }; ! float[] b = { 0, 0, 0 }; ! int j, k; ! b[0] = s * 2300; b[1] = t * 2300; b[2] = 2300; ! for (j = 0; j < 3; j++) { k = st_to_vec[axis][j]; if (k < 0) --- 537,549 ---- void MakeSkyVec(float s, float t, int axis) { ! float[] b = Vec3Cache.get(); b[0] = s * 2300; b[1] = t * 2300; b[2] = 2300; ! float[] v = Vec3Cache.get(); ! int k; ! ! for (int j = 0; j < 3; j++) { k = st_to_vec[axis][j]; if (k < 0) *************** *** 568,571 **** --- 569,574 ---- gl.glTexCoord2f(s, t); gl.glVertex3f(v[0], v[1], v[2]); + + Vec3Cache.release(2); // b, v } *************** *** 577,581 **** void R_DrawSkyBox() { int i; ! if (skyrotate != 0) { // check for no sky at all for (i = 0; i < 6; i++) --- 580,584 ---- void R_DrawSkyBox() { int i; ! if (skyrotate != 0) { // check for no sky at all for (i = 0; i < 6; i++) Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Mesh.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Mesh.java 22 Sep 2004 19:22:11 -0000 1.6 --- Mesh.java 16 Jan 2005 15:24:50 -0000 1.7 *************** *** 32,35 **** --- 32,36 ---- import jake2.render.image_t; import jake2.util.Math3D; + import jake2.util.Vec3Cache; import java.nio.FloatBuffer; *************** *** 138,144 **** float alpha; - float[] move = { 0, 0, 0 }; // vec3_t - float[] frontv = { 0, 0, 0 }; // vec3_t - float[] backv = { 0, 0, 0 }; // vec3_t qfiles.daliasframe_t frame = paliashdr.aliasFrames[currententity.frame]; --- 139,142 ---- *************** *** 163,166 **** --- 161,165 ---- float frontlerp = 1.0f - backlerp; + float[] frontv = Vec3Cache.get(); // vec3_t // move should be the delta back to the previous frame * backlerp Math3D.VectorSubtract(currententity.oldorigin, currententity.origin, *************** *** 169,172 **** --- 168,172 ---- vectors[2]); + float[] move = Vec3Cache.get(); // vec3_t move[0] = Math3D.DotProduct(frontv, vectors[0]); // forward move[1] = -Math3D.DotProduct(frontv, vectors[1]); // left *************** *** 175,178 **** --- 175,179 ---- Math3D.VectorAdd(move, oldframe.translate, move); + float[] backv = Vec3Cache.get(); // vec3_t for (int i = 0; i < 3; i++) { move[i] = backlerp * move[i] + frontlerp * frame.translate[i]; *************** *** 184,187 **** --- 185,190 ---- GL_LerpVerts(paliashdr.num_xyz, ov, verts, move, frontv, backv); + + Vec3Cache.release(3); // frontv, move, backv //gl.glEnableClientState( GL.GL_VERTEX_ARRAY ); *************** *** 273,277 **** qfiles.dtrivertx_t[] verts; int[] order; - float[] point = { 0, 0, 0 }; float height, lheight; int count; --- 276,279 ---- *************** *** 295,298 **** --- 297,301 ---- // TODO shadow drawing with vertex arrays + float[] point = Vec3Cache.get(); while (true) { // get the vertex count and primitive type *************** *** 323,326 **** --- 326,330 ---- gl.glEnd(); } + Vec3Cache.release(); // point } *************** *** 330,336 **** // TODO sync with jogl renderer. hoz boolean R_CullAliasModel(entity_t e) { - float[] mins = { 0, 0, 0 }; - float[] maxs = { 0, 0, 0 }; - qfiles.dmdl_t paliashdr = (qfiles.dmdl_t) currentmodel.extradata; --- 334,337 ---- *************** *** 353,356 **** --- 354,360 ---- * * compute axially aligned mins and maxs */ + float[] mins = Vec3Cache.get(); + float[] maxs = Vec3Cache.get(); + if (pframe == poldframe) { for (int i = 0; i < 3; i++) { *************** *** 416,419 **** --- 420,425 ---- Math3D.VectorAdd(e.origin, bbox[i], bbox[i]); } + + Vec3Cache.release(2); // mins, maxs int f, mask; Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Surf.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Surf.java 10 Jan 2005 00:14:33 -0000 1.7 --- Surf.java 16 Jan 2005 15:24:50 -0000 1.8 *************** *** 31,34 **** --- 31,35 ---- import jake2.qcommon.Com; import jake2.render.*; + import jake2.util.*; import jake2.util.Lib; import jake2.util.Math3D; *************** *** 611,619 **** */ void R_DrawBrushModel(entity_t e) { - float[] mins = { 0, 0, 0 }; - float[] maxs = { 0, 0, 0 }; - int i; - boolean rotated; - if (currentmodel.nummodelsurfaces == 0) return; --- 612,615 ---- *************** *** 622,628 **** gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (i = 0; i < 3; i++) { mins[i] = e.origin[i] - currentmodel.radius; maxs[i] = e.origin[i] + currentmodel.radius; --- 618,627 ---- gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; + float[] mins = Vec3Cache.get(); + float[] maxs = Vec3Cache.get(); + boolean rotated; if (e.angles[0] != 0 || e.angles[1] != 0 || e.angles[2] != 0) { rotated = true; ! for (int i = 0; i < 3; i++) { mins[i] = e.origin[i] - currentmodel.radius; maxs[i] = e.origin[i] + currentmodel.radius; *************** *** 634,639 **** } ! if (R_CullBox(mins, maxs)) return; gl.glColor3f(1, 1, 1); --- 633,642 ---- } ! if (R_CullBox(mins, maxs)) { ! Vec3Cache.release(2); // mins, maxs return; + } + + Vec3Cache.release(2); // mins, maxs gl.glColor3f(1, 1, 1); *************** *** 647,654 **** Math3D.VectorSubtract(r_newrefdef.vieworg, e.origin, modelorg); if (rotated) { ! float[] temp = { 0, 0, 0 }; ! float[] forward = { 0, 0, 0 }; ! float[] right = { 0, 0, 0 }; ! float[] up = { 0, 0, 0 }; Math3D.VectorCopy(modelorg, temp); --- 650,657 ---- Math3D.VectorSubtract(r_newrefdef.vieworg, e.origin, modelorg); if (rotated) { ! float[] temp = Vec3Cache.get(); ! float[] forward = Vec3Cache.get(); ! float[] right = Vec3Cache.get(); ! float[] up = Vec3Cache.get(); Math3D.VectorCopy(modelorg, temp); *************** *** 657,660 **** --- 660,665 ---- modelorg[1] = -Math3D.DotProduct(temp, right); modelorg[2] = Math3D.DotProduct(temp, up); + + Vec3Cache.release(4); // temp, forward, right, up } *************** *** 813,821 **** * ============= R_DrawWorld ============= */ void R_DrawWorld() { - entity_t ent = new entity_t(); - // auto cycle the world frame for texture animation - ent.frame = (int) (r_newrefdef.time * 2); - currententity = ent; if (r_drawworld.value == 0) --- 818,824 ---- * ============= R_DrawWorld ============= */ + entity_t worldEnt = new entity_t(); + void R_DrawWorld() { if (r_drawworld.value == 0) *************** *** 828,831 **** --- 831,840 ---- Math3D.VectorCopy(r_newrefdef.vieworg, modelorg); + + entity_t ent = worldEnt; + // auto cycle the world frame for texture animation + ent.clear(); + ent.frame = (int) (r_newrefdef.time * 2); + currententity = ent; gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; *************** *** 1042,1053 **** float[] vec; float s, t; ! float[] total = { 0, 0, 0 }; ! ! // reconstruct the polygon pedges = currentmodel.edges; lnumverts = fa.numedges; vertpage = 0; - Math3D.VectorClear(total); // // draw texture --- 1051,1059 ---- float[] vec; float s, t; ! // reconstruct the polygon pedges = currentmodel.edges; lnumverts = fa.numedges; vertpage = 0; // // draw texture *************** *** 1077,1082 **** t /= fa.texinfo.image.height; ! Math3D.VectorAdd(total, vec, total); ! poly.x(i, vec[0]); poly.y(i, vec[1]); poly.z(i, vec[2]); --- 1083,1087 ---- t /= fa.texinfo.image.height; ! poly.x(i, vec[0]); poly.y(i, vec[1]); poly.z(i, vec[2]); *************** *** 1157,1166 **** void GL_BeginBuildingLightmaps(model_t m) { // static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; ! int i; ! ! // init lightstyles if (lightstyles == null) { lightstyles = new lightstyle_t[Defines.MAX_LIGHTSTYLES]; ! for (i = 0; i < lightstyles.length; i++) { lightstyles[i] = new lightstyle_t(); } --- 1162,1169 ---- void GL_BeginBuildingLightmaps(model_t m) { // static lightstyle_t lightstyles[MAX_LIGHTSTYLES]; ! // init lightstyles if (lightstyles == null) { lightstyles = new lightstyle_t[Defines.MAX_LIGHTSTYLES]; ! for (int i = 0; i < lightstyles.length; i++) { lightstyles[i] = new lightstyle_t(); } *************** *** 1179,1183 **** * regenerated * the first time they're seen */ ! for (i = 0; i < Defines.MAX_LIGHTSTYLES; i++) { lightstyles[i].rgb[0] = 1; lightstyles[i].rgb[1] = 1; --- 1182,1186 ---- * regenerated * the first time they're seen */ ! for (int i = 0; i < Defines.MAX_LIGHTSTYLES; i++) { lightstyles[i].rgb[0] = 1; lightstyles[i].rgb[1] = 1; |
From: Carsten W. <ca...@us...> - 2005-01-16 15:16:53
|
Update of /cvsroot/jake2/jake2/src/jake2/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24972/src/jake2/util Added Files: Vec3Cache.java Log Message: Simple cache to reduce the garbage of float[3] vectors. --- NEW FILE: Vec3Cache.java --- /* * Vec3Cache.java * Copyright (C) 2003 * * $Id: Vec3Cache.java,v 1.1 2005/01/16 15:16:44 cawe Exp $ */ package jake2.util; /** * Vec3Cache contains float[3] for temporary usage. * The usage can reduce the garbage at runtime. * * @author cwei */ public final class Vec3Cache { //private static Stack cache = new Stack(); private static final float[][] cache = new float[64][3]; private static int index = 0; private static int max = 0; public static final float[] get() { //max = Math.max(index, max); return cache[index++]; } public static final void release() { index--; } public static final void release(int count) { index-=count; } public static final void debug() { System.err.println("Vec3Cache: max. " + (max + 1) + " vectors used."); } } |
From: Carsten W. <ca...@us...> - 2005-01-16 13:56:59
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11281/src/jake2/client Modified Files: entity_t.java Log Message: clear() added; enderer package wiil use this. Index: entity_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/entity_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** entity_t.java 7 Jul 2004 19:58:52 -0000 1.1.1.1 --- entity_t.java 16 Jan 2005 13:56:49 -0000 1.2 *************** *** 73,76 **** --- 73,91 ---- this.flags = src.flags; } + + public void clear() { + model = null; + Math3D.VectorClear(angles); + Math3D.VectorClear(origin); + frame = 0; + Math3D.VectorClear(oldorigin); + oldframe = 0; + backlerp = 0; + skinnum = 0; + lightstyle = 0; + alpha = 0; + skin = null; + flags = 0; + } } |
From: Carsten W. <ca...@us...> - 2005-01-14 21:15:44
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9591/src/jake2/qcommon Modified Files: CM.java Log Message: sorry ;-) muss nochmal schauen Index: CM.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CM.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** CM.java 14 Jan 2005 16:11:36 -0000 1.7 --- CM.java 14 Jan 2005 21:15:34 -0000 1.8 *************** *** 1504,1508 **** // fill in a default trace //was: memset(& trace_trace, 0, sizeof(trace_trace)); ! trace_trace.clear(); trace_trace.fraction = 1; --- 1504,1508 ---- // fill in a default trace //was: memset(& trace_trace, 0, sizeof(trace_trace)); ! trace_trace = new trace_t(); trace_trace.fraction = 1; |
From: Carsten W. <ca...@us...> - 2005-01-14 16:14:11
|
Update of /cvsroot/jake2/jake2/src/jake2/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7350/src/jake2/server Modified Files: moveclip_t.java Log Message: clear() added Index: moveclip_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/server/moveclip_t.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** moveclip_t.java 7 Jul 2004 19:59:50 -0000 1.1.1.1 --- moveclip_t.java 14 Jan 2005 16:14:02 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- import jake2.render.*; import jake2.server.*; + import jake2.util.Math3D; public class moveclip_t *************** *** 42,44 **** --- 43,58 ---- edict_t passedict; int contentmask; + + public void clear() { + Math3D.VectorClear(boxmins); + Math3D.VectorClear(boxmaxs); + Math3D.VectorClear(mins); + Math3D.VectorClear(maxs); + Math3D.VectorClear(mins2); + Math3D.VectorClear(maxs2); + start = end = null; + trace.clear(); + passedict = null; + contentmask = 0; + } } |
From: Carsten W. <ca...@us...> - 2005-01-14 16:13:24
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7134/src/jake2/render Modified Files: msurface_t.java Log Message: the cplane_t.clear() is used (no garbage) Index: msurface_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/msurface_t.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** msurface_t.java 9 Jul 2004 06:50:47 -0000 1.3 --- msurface_t.java 14 Jan 2005 16:13:07 -0000 1.4 *************** *** 69,74 **** public void clear() { visframe = 0; ! plane = null; ! plane = new cplane_t(); flags = 0; --- 69,73 ---- public void clear() { visframe = 0; ! plane.clear(); flags = 0; |
From: Carsten W. <ca...@us...> - 2005-01-14 16:11:47
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6794/src/jake2/qcommon Modified Files: CM.java Log Message: the new trace_t() removed with clear() (no garbage) Index: CM.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/CM.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CM.java 22 Sep 2004 19:22:09 -0000 1.6 --- CM.java 14 Jan 2005 16:11:36 -0000 1.7 *************** *** 1504,1508 **** // fill in a default trace //was: memset(& trace_trace, 0, sizeof(trace_trace)); ! trace_trace = new trace_t(); trace_trace.fraction = 1; --- 1504,1508 ---- // fill in a default trace //was: memset(& trace_trace, 0, sizeof(trace_trace)); ! trace_trace.clear(); trace_trace.fraction = 1; |
From: Carsten W. <ca...@us...> - 2005-01-14 16:10:03
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6247/src/jake2/game Modified Files: trace_t.java Log Message: clear() added Index: trace_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/trace_t.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trace_t.java 12 Jul 2004 20:47:01 -0000 1.4 --- trace_t.java 14 Jan 2005 16:09:42 -0000 1.5 *************** *** 27,31 **** //a trace is returned when a box is swept through the world ! public class trace_t implements Cloneable { public boolean allsolid; // if true, plane is not valid public boolean startsolid; // if true, the initial point was in a solid area --- 27,31 ---- //a trace is returned when a box is swept through the world ! public class trace_t { public boolean allsolid; // if true, plane is not valid public boolean startsolid; // if true, the initial point was in a solid area *************** *** 39,45 **** // pointer public edict_t ent; // not set by CM_*() functions ! ! public void set(trace_t from) ! { allsolid = from.allsolid; startsolid = from.allsolid; --- 39,44 ---- // pointer public edict_t ent; // not set by CM_*() functions ! ! public void set(trace_t from) { allsolid = from.allsolid; startsolid = from.allsolid; *************** *** 51,53 **** --- 50,63 ---- ent = from.ent; } + + public void clear() { + allsolid = false; + startsolid = false; + fraction = 0; + Math3D.VectorClear(endpos); + plane.clear(); + surface = null; + contents = 0; + ent = null; + } } |
From: Carsten W. <ca...@us...> - 2005-01-14 16:08:24
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5862/src/jake2/game Modified Files: cplane_t.java Log Message: clear() added Index: cplane_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/cplane_t.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cplane_t.java 8 Jul 2004 20:24:29 -0000 1.3 --- cplane_t.java 14 Jan 2005 16:08:12 -0000 1.4 *************** *** 34,54 **** public byte signbits; // signx + (signy<<1) + (signz<<1) public byte pad[] = { 0, 0 }; ! ! // public cplane_t getClone() ! // { ! // cplane_t out = new cplane_t(); ! // Math3D.set(out.normal, normal); ! // out.dist = dist; ! // out.type = type; ! // out.signbits = signbits; ! // out.pad[0] = pad[0]; ! // out.pad[1] = pad[1]; ! // ! // return out; ! // } ! ! public void set(cplane_t c) ! { ! Math3D.set(normal, c.normal); dist = c.dist; --- 34,39 ---- public byte signbits; // signx + (signy<<1) + (signz<<1) public byte pad[] = { 0, 0 }; ! ! public void set(cplane_t c) { Math3D.set(normal, c.normal); dist = c.dist; *************** *** 58,60 **** --- 43,54 ---- pad[1] = c.pad[1]; } + + public void clear() { + Math3D.VectorClear(normal); + dist = 0; + type = 0; + signbits = 0; + pad[0] = 0; + pad[1] = 0; + } } |
From: Holger Z. <hz...@us...> - 2005-01-12 12:14:58
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6887/src/jake2/qcommon Modified Files: PMove.java Com.java Log Message: small performance improvements Index: PMove.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/PMove.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PMove.java 22 Sep 2004 19:22:09 -0000 1.5 --- PMove.java 12 Jan 2005 12:14:16 -0000 1.6 *************** *** 23,31 **** package jake2.qcommon; ! import jake2.*; ! import jake2.client.*; import jake2.game.*; - import jake2.render.*; - import jake2.server.*; import jake2.util.Math3D; --- 23,29 ---- package jake2.qcommon; ! import jake2.Defines; ! import jake2.Globals; import jake2.game.*; import jake2.util.Math3D; *************** *** 48,53 **** public csurface_t groundsurface; - public cplane_t groundplane = new cplane_t(); - public int groundcontents; --- 46,49 ---- *************** *** 619,623 **** trace = PMove.pm.trace.trace(PMove.pml.origin, PMove.pm.mins, PMove.pm.maxs, point); - PMove.pml.groundplane = trace.plane; PMove.pml.groundsurface = trace.surface; PMove.pml.groundcontents = trace.contents; --- 615,618 ---- *************** *** 1070,1075 **** PMove.pm.waterlevel = 0; ! // clear all pmove local vars ! PMove.pml = new PMove.pml_t(); // convert origin and velocity to float values --- 1065,1070 ---- PMove.pm.waterlevel = 0; ! PMove.pml.groundsurface = null; ! PMove.pml.groundcontents = 0; // convert origin and velocity to float values Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Com.java 22 Aug 2004 18:30:15 -0000 1.6 --- Com.java 12 Jan 2005 12:14:16 -0000 1.7 *************** *** 92,99 **** --- 92,101 ---- { data= null; + length = 0; } else { data= in.toCharArray(); + length = data.length; } index= 0; *************** *** 109,127 **** data= in; index= offset; } public char getchar() { ! // faster than if ! try ! { ! return data[index]; ! } ! catch (Exception e) ! { ! data= null; ! // last char ! return 0; ! } } --- 111,135 ---- data= in; index= offset; + if (data != null) length = data.length; + else length = 0; } public char getchar() { ! if (index < length) { ! return data[index]; ! } ! return 0; ! // // faster than if ! // try ! // { ! // return data[index]; ! // } ! // catch (Exception e) ! // { ! // data= null; ! // // last char ! // return 0; ! // } } *************** *** 129,145 **** { // faster than if ! try ! { ! index++; ! return data[index]; ! } ! catch (Exception e) ! { ! data= null; ! // avoid int wraps; ! index--; ! // last char ! return 0; ! } } --- 137,158 ---- { // faster than if ! index++; ! if (index < length) { ! return data[index]; ! } ! return 0; ! // try ! // { ! // index++; ! // return data[index]; ! // } ! // catch (Exception e) ! // { ! // data= null; ! // // avoid int wraps; ! // index--; ! // // last char ! // return 0; ! // } } *************** *** 155,168 **** public boolean isEof() { ! return data == null; } public int index; public char data[]; public char skipwhites() { ! char c; ! while (((c= getchar()) <= ' ') && c != 0) index++; return c; --- 168,182 ---- public boolean isEof() { ! return index >= length; } public int index; public char data[]; + private int length; public char skipwhites() { ! char c = 0; ! while ( index < length && ((c= data[index]) <= ' ') && c != 0) index++; return c; *************** *** 171,176 **** public char skipwhitestoeol() { ! char c; ! while (((c= getchar()) <= ' ') && c != '\n' && c != 0) index++; return c; --- 185,190 ---- public char skipwhitestoeol() { ! char c = 0; ! while ( index < length &&((c= data[index]) <= ' ') && c != '\n' && c != 0) index++; return c; *************** *** 179,184 **** public char skiptoeol() { ! char c; ! while ((c= getchar()) != '\n' && c != 0) index++; return c; --- 193,198 ---- public char skiptoeol() { ! char c = 0; ! while ( index < length &&(c= data[index]) != '\n' && c != 0) index++; return c; *************** *** 408,419 **** public static void Println(String fmt) { ! Printf(fmt); ! Printf("\n"); ! } ! ! public static void p(String fmt) ! { ! Printf(fmt); ! Printf("\n"); } --- 422,426 ---- public static void Println(String fmt) { ! Printf(fmt + "\n"); } |
From: Holger Z. <hz...@us...> - 2005-01-12 12:14:37
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6887/src/jake2/render/fastjogl Modified Files: Light.java Log Message: small performance improvements Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Light.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Light.java 22 Sep 2004 19:22:11 -0000 1.9 --- Light.java 12 Jan 2005 12:14:27 -0000 1.10 *************** *** 209,213 **** float[] lightspot = { 0, 0, 0 }; // vec3_t ! int RecursiveLightPoint(mnode_t node, float[] start, float[] end) { if (node.contents != -1) --- 209,215 ---- float[] lightspot = { 0, 0, 0 }; // vec3_t ! ! float scalef = 1.0f/255; ! int RecursiveLightPoint(mnode_t node, float[] start, float[] end) { if (node.contents != -1) *************** *** 220,224 **** ByteBuffer lightmap; int maps; - float[] mid = { 0, 0, 0 }; // calculate mid point --- 222,225 ---- *************** *** 235,238 **** --- 236,240 ---- float frac = front / (front - back); + float[] mid = { 0, 0, 0 }; mid[0] = start[0] + (end[0] - start[0]) * frac; mid[1] = start[1] + (end[1] - start[1]) * frac; *************** *** 252,256 **** int surfIndex = node.firstsurface; ! float[] scale = { 0, 0, 0 }; for (i = 0; i < node.numsurfaces; i++, surfIndex++) { surf = r_worldmodel.surfaces[surfIndex]; --- 254,260 ---- int surfIndex = node.firstsurface; ! float scale0; ! float scale1; ! float scale2; for (i = 0; i < node.numsurfaces; i++, surfIndex++) { surf = r_worldmodel.surfaces[surfIndex]; *************** *** 284,288 **** Math3D.VectorCopy(Globals.vec3_origin, pointcolor); if (lightmap != null) { - //float[] scale = {0, 0, 0}; float[] rgb; lightmapIndex += 3 * (dt * ((surf.extents[0] >> 4) + 1) + ds); --- 288,291 ---- *************** *** 291,304 **** && surf.styles[maps] != (byte) 255; maps++) { rgb = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb; ! scale[0] = gl_modulate.value * rgb[0]; ! scale[1] = gl_modulate.value * rgb[1]; ! scale[2] = gl_modulate.value * rgb[2]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) ! * scale[0] * (1.0f / 255); pointcolor[1] += (lightmap.get(lightmapIndex + 1) & 0xFF) ! * scale[1] * (1.0f / 255); pointcolor[2] += (lightmap.get(lightmapIndex + 2) & 0xFF) ! * scale[2] * (1.0f / 255); lightmapIndex += 3 * ((surf.extents[0] >> 4) + 1) * ((surf.extents[1] >> 4) + 1); --- 294,307 ---- && surf.styles[maps] != (byte) 255; maps++) { rgb = r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb; ! scale0 = gl_modulate.value * rgb[0]; ! scale1 = gl_modulate.value * rgb[1]; ! scale2 = gl_modulate.value * rgb[2]; pointcolor[0] += (lightmap.get(lightmapIndex + 0) & 0xFF) ! * scale0 * scalef; pointcolor[1] += (lightmap.get(lightmapIndex + 1) & 0xFF) ! * scale1 * scalef; pointcolor[2] += (lightmap.get(lightmapIndex + 2) & 0xFF) ! * scale2 * scalef; lightmapIndex += 3 * ((surf.extents[0] >> 4) + 1) * ((surf.extents[1] >> 4) + 1); *************** *** 319,331 **** assert (color.length == 3) : "rgb bug"; - float[] end = { 0, 0, 0 }; - dlight_t dl; - float add; - if (r_worldmodel.lightdata == null) { color[0] = color[1] = color[2] = 1.0f; return; } ! end[0] = p[0]; end[1] = p[1]; --- 322,331 ---- assert (color.length == 3) : "rgb bug"; if (r_worldmodel.lightdata == null) { color[0] = color[1] = color[2] = 1.0f; return; } ! ! float[] end = { 0, 0, 0 }; end[0] = p[0]; end[1] = p[1]; *************** *** 343,354 **** // add dynamic lights // for (int lnum = 0; lnum < r_newrefdef.num_dlights; lnum++) { dl = r_newrefdef.dlights[lnum]; Math3D.VectorSubtract(currententity.origin, dl.origin, end); ! add = dl.intensity - Math3D.VectorLength(end); ! add *= (1.0f / 256); if (add > 0) { ! Math3D.VectorMA(color, add, dl.color, color); } } --- 343,356 ---- // add dynamic lights // + float add; + dlight_t dl; for (int lnum = 0; lnum < r_newrefdef.num_dlights; lnum++) { dl = r_newrefdef.dlights[lnum]; Math3D.VectorSubtract(currententity.origin, dl.origin, end); ! add = (dl.intensity - Math3D.VectorLength(end)); ! if (add > 0) { ! Math3D.VectorMA(color, add * scalef, dl.color, color); } } *************** *** 369,373 **** float fdist, frad, fminlight; float[] impact = { 0, 0, 0 }; - float[] local = { 0, 0, 0 }; int s, t; dlight_t dl; --- 371,374 ---- *************** *** 379,382 **** --- 380,385 ---- mtexinfo_t tex = surf.texinfo; + float local0; + float local1; for (int lnum = 0; lnum < r_newrefdef.num_dlights; lnum++) { if ((surf.dlightbits & (1 << lnum)) == 0) *************** *** 399,405 **** } ! local[0] = Math3D.DotProduct(impact, tex.vecs[0]) + tex.vecs[0][3] - surf.texturemins[0]; ! local[1] = Math3D.DotProduct(impact, tex.vecs[1]) + tex.vecs[1][3] - surf.texturemins[1]; --- 402,408 ---- } ! local0 = Math3D.DotProduct(impact, tex.vecs[0]) + tex.vecs[0][3] - surf.texturemins[0]; ! local1 = Math3D.DotProduct(impact, tex.vecs[1]) + tex.vecs[1][3] - surf.texturemins[1]; *************** *** 407,416 **** int pfBLindex = 0; for (t = 0, ftacc = 0; t < tmax; t++, ftacc += 16) { ! td = (int) (local[1] - ftacc); if (td < 0) td = -td; for (s = 0, fsacc = 0; s < smax; s++, fsacc += 16, pfBLindex += 3) { ! sd = (int) (local[0] - fsacc); if (sd < 0) --- 410,419 ---- int pfBLindex = 0; for (t = 0, ftacc = 0; t < tmax; t++, ftacc += 16) { ! td = (int) (local1 - ftacc); if (td < 0) td = -td; for (s = 0, fsacc = 0; s < smax; s++, fsacc += 16, pfBLindex += 3) { ! sd = (int) (local0 - fsacc); if (sd < 0) *************** *** 452,457 **** int r, g, b, a, max; int i, j; - ByteBuffer lightmap; - float[] scale = { 0, 0, 0 }; int nummaps; float[] bl; --- 455,458 ---- *************** *** 493,500 **** ; ! lightmap = surf.samples; int lightmapIndex = 0; // add all the lightmaps if (nummaps == 1) { int maps; --- 494,504 ---- ; ! ByteBuffer lightmap = surf.samples; int lightmapIndex = 0; // add all the lightmaps + float scale0; + float scale1; + float scale2; if (nummaps == 1) { int maps; *************** *** 505,514 **** int blp = 0; ! for (i = 0; i < 3; i++) ! scale[i] = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! if (scale[0] == 1.0F && scale[1] == 1.0F ! && scale[2] == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] = lightmap.get(lightmapIndex++) & 0xFF; --- 509,521 ---- int blp = 0; ! // for (i = 0; i < 3; i++) ! // scale[i] = gl_modulate.value ! // * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! scale0 = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[0]; ! scale1 = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[1]; ! scale2 = gl_modulate.value * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[2]; ! if (scale0 == 1.0F && scale1 == 1.0F ! && scale2 == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] = lightmap.get(lightmapIndex++) & 0xFF; *************** *** 519,527 **** for (i = 0; i < size; i++) { bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[0]; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[1]; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[2]; } } --- 526,534 ---- for (i = 0; i < size; i++) { bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale0; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale1; bl[blp++] = (lightmap.get(lightmapIndex++) & 0xFF) ! * scale2; } } *************** *** 541,550 **** int blp = 0; ! for (i = 0; i < 3; i++) ! scale[i] = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! if (scale[0] == 1.0F && scale[1] == 1.0F ! && scale[2] == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] += lightmap.get(lightmapIndex++) & 0xFF; --- 548,566 ---- int blp = 0; ! // for (i = 0; i < 3; i++) ! // scale[i] = gl_modulate.value ! // * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[i]; ! scale0 = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[0]; ! scale1 = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[1]; ! scale2 = gl_modulate.value ! * r_newrefdef.lightstyles[surf.styles[maps] & 0xFF].rgb[2]; ! ! ! ! if (scale0 == 1.0F && scale1 == 1.0F ! && scale2 == 1.0F) { for (i = 0; i < size; i++) { bl[blp++] += lightmap.get(lightmapIndex++) & 0xFF; *************** *** 555,563 **** for (i = 0; i < size; i++) { bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[0]; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[1]; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale[2]; } } --- 571,579 ---- for (i = 0; i < size; i++) { bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale0; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale1; bl[blp++] += (lightmap.get(lightmapIndex++) & 0xFF) ! * scale2; } } *************** *** 631,636 **** } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) ! | (r << 0)); } } --- 647,651 ---- } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | r); } } *************** *** 697,703 **** // try faking colored lighting a = 255 - ((r + g + b) / 3); ! r *= a / 255.0f; ! g *= a / 255.0f; ! b *= a / 255.0f; break; case 'A': --- 712,719 ---- // try faking colored lighting a = 255 - ((r + g + b) / 3); ! float af = a / 255.0f; ! r *= af; ! g *= af; ! b *= af; break; case 'A': *************** *** 708,713 **** } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) ! | (r << 0)); } } --- 724,728 ---- } //r &= 0xFF; g &= 0xFF; b &= 0xFF; a &= 0xFF; ! dest.put(destp++, (a << 24) | (b << 16) | (g << 8) | r); } } |