Skip to content

Commit

Permalink
VTXNORMS chunk (on 'normals' branch without other changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
floxay committed Jun 25, 2022
1 parent c444911 commit 9ecbbfe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion Exporters/ExportPsk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static void ExportCommonMeshData
guard(ExportCommonMeshData);

// using 'static' here to avoid zero-filling unused fields
static VChunkHeader MainHdr, PtsHdr, WedgHdr, FacesHdr, MatrHdr;
static VChunkHeader MainHdr, PtsHdr, WedgHdr, FacesHdr, MatrHdr, NormHdr;
int i;

#define SECT(n) (Sections + n)
Expand Down Expand Up @@ -247,6 +247,22 @@ static void ExportCommonMeshData
}
unguard;

guard(Normals);
NormHdr.DataCount = Share.Normals.Num();
NormHdr.DataSize = sizeof(CVec3);
SAVE_CHUNK(NormHdr, "VTXNORMS");
for (i = 0; i < Share.Normals.Num(); i++)
{
CVec3 Normal;
Unpack(Normal, Share.Normals[i]);
Normal.Normalize();
#if MIRROR_MESH
Normal.Y = -Normal.Y;
#endif
Ar << Normal.X << Normal.Y << Normal.Z;
}
unguard;

unguard;
}

Expand Down
2 changes: 1 addition & 1 deletion Exporters/Psk.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define __PSK_H__


#define PSK_VERSION 20100422
#define PSK_VERSION 20210917 // VTXNORMS chunk
#define PSA_VERSION 20100422

/******************************************************************************
Expand Down

0 comments on commit 9ecbbfe

Please sign in to comment.