Browse Source

Use std math functions in Max plugin.

VS12 provides math functions which were conflicting with ones defined
in texutil.h.  This removes the reliance on texutil.h and uses the
standard library's math in its place.
Joseph Davies 11 years ago
parent
commit
58d79679d3
  1. 1
      Sources/Tools/MaxConvert/Pch.h
  2. 1
      Sources/Tools/MaxConvert/hsControlConverter.cpp
  3. 1
      Sources/Tools/MaxConvert/hsMaterialConverter.cpp
  4. 1
      Sources/Tools/MaxPlasmaMtls/Pch.h
  5. 17
      Sources/Tools/MaxPlasmaMtls/plBMSampler.cpp

1
Sources/Tools/MaxConvert/Pch.h

@ -92,7 +92,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <modstack.h> #include <modstack.h>
#include <notify.h> #include <notify.h>
#include <stdmat.h> #include <stdmat.h>
#include <texutil.h>
// MaxComponent // MaxComponent
#include "MaxComponent/plComponent.h" #include "MaxComponent/plComponent.h"

1
Sources/Tools/MaxConvert/hsControlConverter.cpp

@ -53,7 +53,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <stdmat.h> #include <stdmat.h>
#include <bmmlib.h> #include <bmmlib.h>
#include <istdplug.h> #include <istdplug.h>
#include <texutil.h>
#include <iparamb2.h> #include <iparamb2.h>
#include <modstack.h> #include <modstack.h>
#include <keyreduc.h> #include <keyreduc.h>

1
Sources/Tools/MaxConvert/hsMaterialConverter.cpp

@ -57,7 +57,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <istdplug.h> #include <istdplug.h>
#include <pbbitmap.h> #include <pbbitmap.h>
#include <stdmat.h> #include <stdmat.h>
#include <texutil.h>
#pragma hdrstop #pragma hdrstop
#include "hsMaterialConverter.h" #include "hsMaterialConverter.h"

1
Sources/Tools/MaxPlasmaMtls/Pch.h

@ -68,7 +68,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <notetrck.h> #include <notetrck.h>
#include <notify.h> #include <notify.h>
#include <stdmat.h> #include <stdmat.h>
#include <texutil.h>
#include <triobj.h> #include <triobj.h>
// MaxMain // MaxMain

17
Sources/Tools/MaxPlasmaMtls/plBMSampler.cpp

@ -45,7 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <bmmlib.h> #include <bmmlib.h>
#include <max.h> #include <max.h>
#include <texutil.h>
#include <iparamb2.h> #include <iparamb2.h>
#pragma hdrstop #pragma hdrstop
@ -105,9 +104,9 @@ AColor plBMSampler::Sample(ShadeContext& sc, float u,float v)
BMM_Color_64 c; BMM_Color_64 c;
int x,y; int x,y;
float fu,fv; float fu,fv, intpart;
fu = frac(u); fu = modf(u, &intpart);
fv = 1.0f-frac(v); fv = 1.0f - modf(v, &intpart);
if (fData.fEnableCrop) if (fData.fEnableCrop)
{ {
if (fData.fCropPlacement) if (fData.fCropPlacement)
@ -119,8 +118,8 @@ AColor plBMSampler::Sample(ShadeContext& sc, float u,float v)
} }
else else
{ {
x = mod(clipx + (int)(fu*fclipw+0.5f),bmw); x = clipx + static_cast<int>(fu * fclipw + 0.5f) % bmw;
y = mod(clipy + (int)(fv*fcliph+0.5f),bmh); y = clipy + static_cast<int>(fv * fcliph + 0.5f) % bmh;
} }
} }
else else
@ -156,9 +155,9 @@ AColor plBMSampler::SampleFilter(ShadeContext& sc, float u,float v, float du, fl
fBM->SetFilter(BMM_FILTER_PYRAMID); fBM->SetFilter(BMM_FILTER_PYRAMID);
BMM_Color_64 c; BMM_Color_64 c;
float fu,fv; float fu, fv, intpart;
fu = frac(u); fu = modf(u, &intpart);
fv = 1.0f-frac(v); fv = 1.0f - modf(v, &intpart);
if (fData.fEnableCrop) if (fData.fEnableCrop)
{ {
if (fData.fCropPlacement) if (fData.fCropPlacement)

Loading…
Cancel
Save