Skip to content

Commit

Permalink
Fix crash when loading ASE model surfaces with *MESH_NUMTVERTEX == 0
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Feb 2, 2017
1 parent 2d2ea45 commit 1f3de7d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/version.h
Expand Up @@ -2,7 +2,7 @@
#include <config.h>
#define RADIANT_VERSION PACKAGE_VERSION
#else
#define RADIANT_VERSION "2.2.0pre3"
#define RADIANT_VERSION "2.2.0pre4"
#endif

#define RADIANT_APPNAME "DarkRadiant"
Expand Down
9 changes: 4 additions & 5 deletions libs/picomodel/pm_ase.c
Expand Up @@ -497,15 +497,14 @@ static void _ase_submit_triangles( picoModel_t* model , aseMaterial_t* materials
{
xyz[j] = &vertices[(*i).indices[j]].xyz;
normal[j] = &vertices[(*i).indices[j]].normal;

/* Old code
st[j][0] = texcoords[(*i).indices[j + 3]].texcoord[0];
st[j][1] = texcoords[(*i).indices[j + 3]].texcoord[1];
st[j] = &texcoords[(*i).indices[j + 3]].texcoord;
*/

/* greebo: Apply shift, scale and rotation */
u = texcoords[(*i).indices[j + 3]].texcoord[0] * subMtl->uScale + subMtl->uOffset;
v = texcoords[(*i).indices[j + 3]].texcoord[1] * subMtl->vScale + subMtl->vOffset;
/* Also check for NULL texcoords pointer, some models surfaces don't have any tverts */
u = texcoords != NULL ? texcoords[(*i).indices[j + 3]].texcoord[0] * subMtl->uScale + subMtl->uOffset : 0.0;
v = texcoords != NULL ? texcoords[(*i).indices[j + 3]].texcoord[1] * subMtl->vScale + subMtl->vOffset : 0.0;

st[j][0] = u * materialCos + v * materialSin;
st[j][1] = u * -materialSin + v * materialCos;
Expand Down
6 changes: 3 additions & 3 deletions tools/innosetup/darkradiant.iss
Expand Up @@ -3,15 +3,15 @@

[Setup]
AppName=DarkRadiant
AppVerName=DarkRadiant 2.2.0pre3 x86
AppVerName=DarkRadiant 2.2.0pre4 x86
AppPublisher=The Dark Mod
AppPublisherURL=http://www.thedarkmod.com
AppSupportURL=http://www.thedarkmod.com
AppUpdatesURL=http://www.thedarkmod.com
DefaultDirName={pf}\DarkRadiant
DefaultGroupName=DarkRadiant 2.2.0pre3 x86
DefaultGroupName=DarkRadiant 2.2.0pre4 x86
OutputDir=.
OutputBaseFilename=darkradiant-2.2.0pre3-x86
OutputBaseFilename=darkradiant-2.2.0pre4-x86
Compression=lzma
SolidCompression=yes
;ArchitecturesAllowed=x64
Expand Down
6 changes: 3 additions & 3 deletions tools/innosetup/darkradiant.x64.iss
Expand Up @@ -3,15 +3,15 @@

[Setup]
AppName=DarkRadiant
AppVerName=DarkRadiant 2.2.0pre3 x64
AppVerName=DarkRadiant 2.2.0pre4 x64
AppPublisher=The Dark Mod
AppPublisherURL=http://www.thedarkmod.com
AppSupportURL=http://www.thedarkmod.com
AppUpdatesURL=http://www.thedarkmod.com
DefaultDirName={pf}\DarkRadiant
DefaultGroupName=DarkRadiant 2.2.0pre3 x64
DefaultGroupName=DarkRadiant 2.2.0pre4 x64
OutputDir=.
OutputBaseFilename=darkradiant-2.2.0pre3-x64
OutputBaseFilename=darkradiant-2.2.0pre4-x64
Compression=lzma
SolidCompression=yes
ArchitecturesAllowed=x64
Expand Down

0 comments on commit 1f3de7d

Please sign in to comment.