2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Code for handling robots
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-07-07 18:35:06 +00:00
|
|
|
#include "dxxerror.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
#include "inferno.h"
|
|
|
|
#include "robot.h"
|
|
|
|
#include "object.h"
|
|
|
|
#include "polyobj.h"
|
2014-07-20 01:09:55 +00:00
|
|
|
#include "physfsx.h"
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2014-10-26 22:51:27 +00:00
|
|
|
#include "compiler-range_for.h"
|
|
|
|
#include "partial_range.h"
|
|
|
|
|
2016-06-25 23:21:36 +00:00
|
|
|
namespace dcx {
|
2014-12-18 04:12:38 +00:00
|
|
|
unsigned N_robot_joints;
|
2016-06-25 23:21:36 +00:00
|
|
|
}
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-02-02 03:10:53 +00:00
|
|
|
#if 0
|
2016-01-09 16:38:14 +00:00
|
|
|
static inline void PHYSFSX_writeAngleVec(PHYSFS_File *fp, const vms_angvec &v)
|
2014-12-18 04:12:38 +00:00
|
|
|
{
|
|
|
|
PHYSFS_writeSLE16(fp, v.p);
|
|
|
|
PHYSFS_writeSLE16(fp, v.b);
|
|
|
|
PHYSFS_writeSLE16(fp, v.h);
|
|
|
|
}
|
2016-02-02 03:10:53 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-06-25 23:21:36 +00:00
|
|
|
namespace dsx {
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
//given an object and a gun number, return position in 3-space of gun
|
|
|
|
//fills in gun_point
|
2016-04-09 21:40:27 +00:00
|
|
|
void calc_gun_point(vms_vector &gun_point, const object_base &obj, unsigned gun_num)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2016-04-09 21:40:27 +00:00
|
|
|
Assert(obj.render_type == RT_POLYOBJ || obj.render_type == RT_MORPH);
|
2018-12-30 00:43:59 +00:00
|
|
|
assert(get_robot_id(obj) < LevelSharedRobotInfoState.N_robot_types);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2018-12-30 00:43:59 +00:00
|
|
|
auto &Robot_info = LevelSharedRobotInfoState.Robot_info;
|
2016-04-09 21:40:27 +00:00
|
|
|
const auto &r = Robot_info[get_robot_id(obj)];
|
2018-12-30 00:43:59 +00:00
|
|
|
auto &Polygon_models = LevelSharedPolygonModelState.Polygon_models;
|
2016-04-09 21:40:27 +00:00
|
|
|
const auto &pm = Polygon_models[r.model_num];
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-04-09 21:40:27 +00:00
|
|
|
if (gun_num >= r.n_guns)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
|
|
|
gun_num = 0;
|
|
|
|
}
|
|
|
|
|
2016-04-09 21:40:27 +00:00
|
|
|
auto pnt = r.gun_points[gun_num];
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
//instance up the tree for this gun
|
2016-04-09 21:40:27 +00:00
|
|
|
auto &anim_angles = obj.rtype.pobj_info.anim_angles;
|
|
|
|
for (unsigned mn = r.gun_submodels[gun_num]; mn != 0; mn = pm.submodel_parents[mn])
|
|
|
|
{
|
|
|
|
const auto &&m = vm_transposed_matrix(vm_angles_2_matrix(anim_angles[mn]));
|
2014-11-04 01:31:22 +00:00
|
|
|
const auto tpnt = vm_vec_rotate(pnt,m);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-04-09 21:40:27 +00:00
|
|
|
vm_vec_add(pnt, tpnt, pm.submodel_offsets[mn]);
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//now instance for the entire object
|
|
|
|
|
2016-04-09 21:40:27 +00:00
|
|
|
const auto &&m = vm_transposed_matrix(obj.orient);
|
2014-11-02 03:41:01 +00:00
|
|
|
vm_vec_rotate(gun_point,pnt,m);
|
2016-04-09 21:40:27 +00:00
|
|
|
vm_vec_add2(gun_point, obj.pos);
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//fills in ptr to list of joints, and returns the number of joints in list
|
|
|
|
//takes the robot type (object id), gun number, and desired state
|
2018-12-30 00:43:59 +00:00
|
|
|
partial_range_t<const jointpos *> robot_get_anim_state(const d_level_shared_robot_info_state::d_robot_info_array &robot_info, const array<jointpos, MAX_ROBOT_JOINTS> &robot_joints, const unsigned robot_type, const unsigned gun_num, const unsigned state)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2018-01-29 01:56:40 +00:00
|
|
|
auto &rirt = robot_info[robot_type];
|
|
|
|
assert(gun_num <= rirt.n_guns);
|
|
|
|
auto &as = rirt.anim_states[gun_num][state];
|
|
|
|
const unsigned o = as.offset;
|
|
|
|
return partial_range(robot_joints, o, o + as.n_joints);
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
|
|
|
|
2013-10-27 22:43:07 +00:00
|
|
|
#ifndef NDEBUG
|
2006-03-20 17:12:09 +00:00
|
|
|
//for test, set a robot to a specific state
|
2018-06-24 05:06:15 +00:00
|
|
|
static void set_robot_state(object_base &obj, const unsigned state) __attribute_used;
|
|
|
|
static void set_robot_state(object_base &obj, const unsigned state)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2018-12-30 00:43:59 +00:00
|
|
|
auto &Robot_joints = LevelSharedRobotJointState.Robot_joints;
|
2006-03-20 17:12:09 +00:00
|
|
|
int g,j,jo;
|
|
|
|
jointlist *jl;
|
|
|
|
|
2018-06-24 05:06:15 +00:00
|
|
|
assert(obj.type == OBJ_ROBOT);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2018-12-30 00:43:59 +00:00
|
|
|
auto &Robot_info = LevelSharedRobotInfoState.Robot_info;
|
2017-08-26 19:47:51 +00:00
|
|
|
auto &ri = Robot_info[get_robot_id(obj)];
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2017-08-26 19:47:51 +00:00
|
|
|
for (g = 0; g < ri.n_guns + 1; g++)
|
|
|
|
{
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2017-08-26 19:47:51 +00:00
|
|
|
jl = &ri.anim_states[g][state];
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
jo = jl->offset;
|
|
|
|
|
|
|
|
for (j=0;j<jl->n_joints;j++,jo++) {
|
|
|
|
int jn;
|
|
|
|
|
|
|
|
jn = Robot_joints[jo].jointnum;
|
|
|
|
|
2018-06-24 05:06:15 +00:00
|
|
|
obj.rtype.pobj_info.anim_angles[jn] = Robot_joints[jo].angles;
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-10-27 22:43:07 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
//set the animation angles for this robot. Gun fields of robot info must
|
|
|
|
//be filled in.
|
2015-04-02 02:36:52 +00:00
|
|
|
void robot_set_angles(robot_info *r,polymodel *pm,array<array<vms_angvec, MAX_SUBMODELS>, N_ANIM_STATES> &angs)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2018-12-30 00:43:59 +00:00
|
|
|
auto &Robot_joints = LevelSharedRobotJointState.Robot_joints;
|
2016-02-12 04:02:28 +00:00
|
|
|
int g,state;
|
2014-10-26 22:51:27 +00:00
|
|
|
array<int, MAX_SUBMODELS> gun_nums; //which gun each submodel is part of
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2016-02-12 04:02:28 +00:00
|
|
|
range_for (auto &m, partial_range(gun_nums, 1u, pm->n_models))
|
2014-10-26 22:51:27 +00:00
|
|
|
m = r->n_guns; //assume part of body...
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
gun_nums[0] = -1; //body never animates, at least for now
|
|
|
|
|
|
|
|
for (g=0;g<r->n_guns;g++) {
|
2016-02-12 04:02:28 +00:00
|
|
|
auto m = r->gun_submodels[g];
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
while (m != 0) {
|
|
|
|
gun_nums[m] = g; //...unless we find it in a gun
|
|
|
|
m = pm->submodel_parents[m];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (g=0;g<r->n_guns+1;g++) {
|
|
|
|
|
|
|
|
for (state=0;state<N_ANIM_STATES;state++) {
|
|
|
|
|
|
|
|
r->anim_states[g][state].n_joints = 0;
|
|
|
|
r->anim_states[g][state].offset = N_robot_joints;
|
|
|
|
|
2016-02-12 04:02:28 +00:00
|
|
|
for (unsigned m = 0; m < pm->n_models; ++m)
|
|
|
|
{
|
2006-03-20 17:12:09 +00:00
|
|
|
if (gun_nums[m] == g) {
|
|
|
|
Robot_joints[N_robot_joints].jointnum = m;
|
|
|
|
Robot_joints[N_robot_joints].angles = angs[state][m];
|
|
|
|
r->anim_states[g][state].n_joints++;
|
|
|
|
N_robot_joints++;
|
|
|
|
Assert(N_robot_joints < MAX_ROBOT_JOINTS);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-06-25 23:21:36 +00:00
|
|
|
}
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2016-01-09 16:38:14 +00:00
|
|
|
* reads n jointlist structs from a PHYSFS_File
|
2006-03-20 17:12:09 +00:00
|
|
|
*/
|
2015-02-14 22:48:30 +00:00
|
|
|
static void jointlist_read(PHYSFS_File *fp, array<jointlist, N_ANIM_STATES> &jl)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2015-02-14 22:48:30 +00:00
|
|
|
range_for (auto &i, jl)
|
|
|
|
{
|
|
|
|
i.n_joints = PHYSFSX_readShort(fp);
|
|
|
|
i.offset = PHYSFSX_readShort(fp);
|
2020-01-08 04:32:39 +00:00
|
|
|
if (!i.n_joints)
|
|
|
|
/* The custom campaign `Descent 2: Enemy Vignettes` has
|
|
|
|
* custom robots with invalid joints. These joints have
|
|
|
|
* invalid offsets, but `n_joints` of 0. This makes the
|
|
|
|
* invalid data easy to detect and clean.
|
|
|
|
*
|
|
|
|
* When the number of joints is zero, discard the loaded
|
|
|
|
* offset and set it to 0, which will always be in range.
|
|
|
|
*/
|
|
|
|
i.offset = 0;
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-06 19:55:24 +00:00
|
|
|
namespace dsx {
|
2019-03-03 00:31:09 +00:00
|
|
|
|
|
|
|
imobjptridx_t robot_create(const unsigned id, const vmsegptridx_t segnum, const vms_vector &pos, const vms_matrix *const orient, const fix size, const ai_behavior behavior, const imsegidx_t hide_segment)
|
|
|
|
{
|
|
|
|
const auto &&objp = obj_create(OBJ_ROBOT, id, segnum, pos, orient, size, CT_AI, MT_PHYSICS, RT_POLYOBJ);
|
|
|
|
if (objp)
|
|
|
|
init_ai_object(objp, behavior, hide_segment);
|
|
|
|
return objp;
|
|
|
|
}
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2016-01-09 16:38:14 +00:00
|
|
|
* reads n robot_info structs from a PHYSFS_File
|
2006-03-20 17:12:09 +00:00
|
|
|
*/
|
2015-01-23 03:55:04 +00:00
|
|
|
void robot_info_read(PHYSFS_File *fp, robot_info &ri)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.model_num = PHYSFSX_readInt(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.n_guns = PHYSFSX_readInt(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2015-01-23 03:55:04 +00:00
|
|
|
range_for (auto &j, ri.gun_points)
|
|
|
|
PHYSFSX_readVector(fp, j);
|
|
|
|
range_for (auto &j, ri.gun_submodels)
|
|
|
|
j = PHYSFSX_readByte(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.exp1_vclip_num = PHYSFSX_readShort(fp);
|
|
|
|
ri.exp1_sound_num = PHYSFSX_readShort(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.exp2_vclip_num = PHYSFSX_readShort(fp);
|
|
|
|
ri.exp2_sound_num = PHYSFSX_readShort(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-12-03 03:26:49 +00:00
|
|
|
ri.weapon_type = static_cast<weapon_id_type>(PHYSFSX_readShort(fp));
|
2013-03-03 01:03:33 +00:00
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2015-12-03 03:26:49 +00:00
|
|
|
ri.weapon_type = static_cast<weapon_id_type>(PHYSFSX_readByte(fp));
|
|
|
|
ri.weapon_type2 = static_cast<weapon_id_type>(PHYSFSX_readByte(fp));
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.n_guns = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.contains_id = PHYSFSX_readByte(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.contains_count = PHYSFSX_readByte(fp);
|
|
|
|
ri.contains_prob = PHYSFSX_readByte(fp);
|
|
|
|
ri.contains_type = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.score_value = PHYSFSX_readInt(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#elif defined(DXX_BUILD_DESCENT_II)
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.kamikaze = PHYSFSX_readByte(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.score_value = PHYSFSX_readShort(fp);
|
|
|
|
ri.badass = PHYSFSX_readByte(fp);
|
|
|
|
ri.energy_drain = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.lighting = PHYSFSX_readFix(fp);
|
|
|
|
ri.strength = PHYSFSX_readFix(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.mass = PHYSFSX_readFix(fp);
|
|
|
|
ri.drag = PHYSFSX_readFix(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
range_for (auto &j, ri.field_of_view)
|
|
|
|
j = PHYSFSX_readFix(fp);
|
|
|
|
range_for (auto &j, ri.firing_wait)
|
|
|
|
j = PHYSFSX_readFix(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
2015-01-23 03:55:04 +00:00
|
|
|
range_for (auto &j, ri.firing_wait2)
|
|
|
|
j = PHYSFSX_readFix(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2015-01-23 03:55:04 +00:00
|
|
|
range_for (auto &j, ri.turn_time)
|
|
|
|
j = PHYSFSX_readFix(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-01-23 03:55:04 +00:00
|
|
|
for (unsigned j = 0; j < NDL * 2; j++)
|
2013-03-03 01:03:33 +00:00
|
|
|
PHYSFSX_readFix(fp);
|
|
|
|
#endif
|
2015-01-23 03:55:04 +00:00
|
|
|
range_for (auto &j, ri.max_speed)
|
|
|
|
j = PHYSFSX_readFix(fp);
|
|
|
|
range_for (auto &j, ri.circle_distance)
|
|
|
|
j = PHYSFSX_readFix(fp);
|
|
|
|
range_for (auto &j, ri.rapidfire_count)
|
|
|
|
j = PHYSFSX_readByte(fp);
|
|
|
|
range_for (auto &j, ri.evade_speed)
|
|
|
|
j = PHYSFSX_readByte(fp);
|
|
|
|
|
|
|
|
ri.cloak_type = PHYSFSX_readByte(fp);
|
|
|
|
ri.attack_type = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_I)
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.boss_flag = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.see_sound = PHYSFSX_readByte(fp);
|
|
|
|
ri.attack_sound = PHYSFSX_readByte(fp);
|
|
|
|
ri.claw_sound = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.taunt_sound = PHYSFSX_readByte(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.boss_flag = PHYSFSX_readByte(fp);
|
|
|
|
ri.companion = PHYSFSX_readByte(fp);
|
|
|
|
ri.smart_blobs = PHYSFSX_readByte(fp);
|
|
|
|
ri.energy_blobs = PHYSFSX_readByte(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.thief = PHYSFSX_readByte(fp);
|
|
|
|
ri.pursuit = PHYSFSX_readByte(fp);
|
|
|
|
ri.lightcast = PHYSFSX_readByte(fp);
|
|
|
|
ri.death_roll = PHYSFSX_readByte(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.flags = PHYSFSX_readByte(fp);
|
2015-04-19 04:18:49 +00:00
|
|
|
array<char, 3> pad;
|
|
|
|
PHYSFS_read(fp, pad, pad.size(), 1);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.deathroll_sound = PHYSFSX_readByte(fp);
|
|
|
|
ri.glow = PHYSFSX_readByte(fp);
|
2015-04-26 20:15:51 +00:00
|
|
|
ri.behavior = static_cast<ai_behavior>(PHYSFSX_readByte(fp));
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.aim = PHYSFSX_readByte(fp);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
range_for (auto &j, ri.anim_states)
|
2015-02-14 22:48:30 +00:00
|
|
|
jointlist_read(fp, j);
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-01-23 03:55:04 +00:00
|
|
|
ri.always_0xabcd = PHYSFSX_readInt(fp);
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
2016-08-06 19:55:24 +00:00
|
|
|
}
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
/*
|
2016-01-09 16:38:14 +00:00
|
|
|
* reads n jointpos structs from a PHYSFS_File
|
2006-03-20 17:12:09 +00:00
|
|
|
*/
|
2016-01-09 16:38:14 +00:00
|
|
|
void jointpos_read(PHYSFS_File *fp, jointpos &jp)
|
2006-03-20 17:12:09 +00:00
|
|
|
{
|
2014-12-18 04:12:38 +00:00
|
|
|
jp.jointnum = PHYSFSX_readShort(fp);
|
|
|
|
PHYSFSX_readAngleVec(&jp.angles, fp);
|
|
|
|
}
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2015-12-04 03:36:31 +00:00
|
|
|
#if 0
|
2016-01-09 16:38:14 +00:00
|
|
|
void jointpos_write(PHYSFS_File *fp, const jointpos &jp)
|
2014-12-18 04:12:38 +00:00
|
|
|
{
|
|
|
|
PHYSFS_writeSLE16(fp, jp.jointnum);
|
|
|
|
PHYSFSX_writeAngleVec(fp, jp.angles);
|
2006-03-20 17:12:09 +00:00
|
|
|
}
|
2015-12-04 03:36:31 +00:00
|
|
|
#endif
|