Skip to content

Commit

Permalink
Fixes for earlier versions of max.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheHologram committed Oct 12, 2015
1 parent bc4a756 commit 3698ade
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion NifCommon/niutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ TSTR GetFileVersion(const wchar_t *fileName)
TSTR GetFileVersion(const char *fileName)
{
USES_CONVERSION;
return GetFileVersion(A2T(fileName));
return GetFileVersion(A2W(fileName));
}

// Calculate bounding sphere using minimum-volume axis-align bounding box. Its fast but not a very good fit.
Expand Down
2 changes: 1 addition & 1 deletion NifExport/MtlTex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ bool Exporter::exportNiftoolsShader(NiAVObjectRef parent, Mtl* mtl)
//texProp->SetSpecularStrength(m->GetShinStr(t) < 1.0f ? 3.0f : 0.0f);
texProp->SetSpecularColor(TOCOLOR3(m->GetSpecular(t)));
texProp->SetEmissiveColor(TOCOLOR3(emittance));
texProp->SetAlpha(m->GetOpacity(t));
texProp->SetAlpha(m->GetOpacity(t) / 100.0f);
texProp->SetEnvironmentMapScale(envmapscale);
texProp->SetSpecularStrength(specularStrength);
texProp->SetRefractionStrength(refractionStrength);
Expand Down
4 changes: 2 additions & 2 deletions NifImport/ImportAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ bool NifImporter::ImportMaterialAnimation( int paramBlockID, int subAnimID, Nifl
if( Control* tmpCtrl = (Control*) gi->CreateInstance( CTRL_FLOAT_CLASS_ID, Class_ID( HYBRIDINTERP_FLOAT_CLASS_ID, 0 ) ) )
{
MergeKeys<IBezFloatKey, FloatKey>( tmpCtrl, keys, 0.0f );
MSTR str = mtl->SubAnim( paramBlockID )->SubAnimName( subAnimID );
TSTR str = mtl->SubAnim( paramBlockID )->SubAnimName( subAnimID );
mtl->SubAnim( paramBlockID )->AssignController( tmpCtrl, subAnimID );

return true;
Expand Down Expand Up @@ -1560,7 +1560,7 @@ bool NifImporter::GetControllerTimeRange(const NiTimeControllerRef& controller,
TimeValue maxTime = TimeToFrame(interpCtrl->GetStopTime());
if (minTime != maxTime)
{
if (range.IsInfinite() || range.Empty())
if (range.Empty())
{
range.Set(minTime, maxTime);
}
Expand Down
2 changes: 1 addition & 1 deletion NifImport/ImportCollision.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ bool CollisionImport::ImportCompressedMeshShape(INode *rbody, bhkRigidBodyRef bo
INode *inode = ImportCollisionMesh(verts, tris, lm, parent);
CreatebhkCollisionModifier(inode, bv_type_packed, mtlIdx, lyrIdx, 0);
ImportBase(body, shape, parent, inode, ltm);
if (n > 1) inode->SetName(FormatText(TEXT("%s:%d"), TEXT("CMSD"), i++).data());
if (multipleShapes) inode->SetName(FormatText(TEXT("%s:%d"), TEXT("CMSD"), i++).data());
//AddShape(rbody, inode);
nodes.Append(1, &inode);
}
Expand Down
6 changes: 3 additions & 3 deletions NifImport/ImportMtlAndTex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ StdMat2 *NifImporter::ImportMaterialAndTextures(ImpNode *node, NiAVObjectRef avO
Interval range;
if (GetControllerTimeRange(controllers, range))
{
if (range.IsInfinite() || range.Empty() || range.Start() != range.End()) {
if (range.Empty() || range.Start() != range.End()) {
gi->SetAnimRange(range);
}
}
Expand Down Expand Up @@ -897,7 +897,7 @@ bool NifImporter::ImportNiftoolsShader(ImpNode *node, NiAVObjectRef avObject, St
Interval range;
if (GetControllerTimeRange(lightingShaderRef->GetControllers(), range))
{
if (range.IsInfinite() || range.Empty() || range.Start() != range.End()) {
if (range.Empty() || range.Start() != range.End()) {
gi->SetAnimRange(range);
}
}
Expand Down Expand Up @@ -950,7 +950,7 @@ bool NifImporter::ImportNiftoolsShader(ImpNode *node, NiAVObjectRef avObject, St
Interval range;
if (GetControllerTimeRange(effectShaderRef->GetControllers(), range))
{
if (range.IsInfinite() || range.Empty() || range.Start() != range.End()) {
if (range.Empty() || range.Start() != range.End()) {
gi->SetAnimRange(range);
}
// get start/stop times
Expand Down
6 changes: 5 additions & 1 deletion NifImport/ImportParticles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ bool NifImporter::ImportParticleSystem(Niflib::NiParticleSystemRef particleSyste
Niflib::NiNodeRef gravObj = gravModifier->GetGravityObject();
INode* gravBone = GetNode(gravObj->GetName());

if (!gravBone->GetInterface(GRAVITYOBJECT_CLASS_ID))
if (!gravBone->GetInterface(Interface_ID(GRAVITYOBJECT_CLASS_ID,0)))
{
INode* gravParentNode = gravBone->GetParentNode();

Expand Down Expand Up @@ -151,7 +151,11 @@ SimpleObject* NifImporter::ImportPCloud(Niflib::NiParticleSystemRef particleSyst

// Request update of emitter geo name
PartID pid;
#if VERSION_3DSMAX < (17000<<16) // Version 17 (2015)
obj->NotifyRefChanged(FOREVER, distnode, pid, REFMSG_NODE_NAMECHANGE);
#else
obj->NotifyRefChanged(FOREVER, distnode, pid, REFMSG_NODE_NAMECHANGE, FALSE);
#endif
}

// Set Width/Height/Depth of emitter
Expand Down
4 changes: 0 additions & 4 deletions NifProps/Shader/NifShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ static const int nifShaderStdIDToChannel[N_ID_CHANNELS] = {
C_REFLECTION,//9 - reflection
-1, // 10 - refraction
C_HEIGHT, // 11 - displacement
-1,
-1,
-1,
-1,
};

// Rollups
Expand Down

0 comments on commit 3698ade

Please sign in to comment.