Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
VReaperV committed Jan 7, 2025
1 parent dc1a501 commit de64f25
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/engine/client/cg_msgdef.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,14 @@ namespace Util {
template<> struct SerializeTraits<std::vector<BoneMod>> {
static void Write( Writer& stream, const std::vector<BoneMod>& boneMods ) {
stream.WriteSize( boneMods.size() );
// stream.Write<float>( skel.scale );
// size_t length = sizeof( refBone_t ) * skel.numBones;
stream.WriteData( boneMods.data(), boneMods.size() );
stream.WriteData( boneMods.data(), boneMods.size() * sizeof( BoneMod ) );
}

static std::vector<BoneMod> Read( Reader& stream ) {
std::vector<BoneMod> boneMods;
boneMods.reserve( stream.ReadSize<BoneMod>() );
size_t length = sizeof( refBone_t ) * boneMods.size();
stream.ReadData( boneMods.data(), length );
const size_t size = stream.ReadSize<BoneMod>();
boneMods.resize( size );
stream.ReadData( boneMods.data(), size * sizeof( BoneMod ) );
return boneMods;
}
};
Expand All @@ -120,6 +119,7 @@ namespace Util {
stream.Write<std::vector<BoneMod>>( ent.boneMods );
// stream.Write<refSkeleton_t>(ent.skeleton);
}

static refEntity_t Read(Reader& stream)
{
refEntity_t ent;
Expand Down
8 changes: 8 additions & 0 deletions src/engine/renderer/tr_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,10 @@ void R_AddEntitySurfaces()
ent->e.lerp2, ent->e.clearOrigin2 );
RE_BlendSkeleton( &ent->e.skeleton, &skel, ent->e.blendLerp );
}

for ( const BoneMod& boneMod : ent->e.boneMods ) {
QuatMultiply2( ent->e.skeleton.bones[boneMod.index].t.rot, boneMod.rotation );
}
R_AddMD5Surfaces( ent );
break;

Expand Down Expand Up @@ -2152,6 +2156,10 @@ void R_AddEntitySurfaces()
RE_BlendSkeleton( &ent->e.skeleton, &skel, ent->e.blendLerp );
}
R_TransformSkeleton( &ent->e.skeleton, ent->e.scale );

for ( const BoneMod& boneMod : ent->e.boneMods ) {
QuatMultiply2( ent->e.skeleton.bones[boneMod.index].t.rot, boneMod.rotation );
}
R_AddIQMSurfaces( ent );
break;
}
Expand Down

0 comments on commit de64f25

Please sign in to comment.