X-Git-Url: http://git.kpe.io/?p=ctsim.git;a=blobdiff_plain;f=include%2Finterpolator.h;fp=include%2Finterpolator.h;h=267c937d609dbd2bb1932e7e700c4cfc73160f93;hp=94b9b1227b0d4648f93765291ad5e732daf5fb93;hb=ab78de6e33fff94c37847621458db3ad430a8bb3;hpb=8e3ba3d86e5b1293140adab70ecc0b6a20e2f651 diff --git a/include/interpolator.h b/include/interpolator.h index 94b9b12..267c937 100644 --- a/include/interpolator.h +++ b/include/interpolator.h @@ -2,7 +2,7 @@ ** This is part of the CTSim program ** Copyright (c) 1983-2001 Kevin Rosenberg ** -** $Id: interpolator.h,v 1.6 2002/06/27 01:48:25 kevin Exp $ +** $Id: interpolator.h,v 1.7 2002/06/27 03:19:23 kevin Exp $ ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License (version 2) as @@ -103,10 +103,10 @@ public: T interpolate (double dXPos, double dYPos) { - int iFloorX = floor (dXPos); - int iFloorY = floor (dYPos); - double dXFrac = dXPos - iFloorX; - double dYFrac = dYPos - iFloorY; + // int iFloorX = static_cast(floor (dXPos)); + // int iFloorY = static_cast(floor (dYPos)); + // double dXFrac = dXPos - iFloorX; + // double dYFrac = dYPos - iFloorY; T result = 0; @@ -122,7 +122,7 @@ class LinearInterpolator { private: T* const m_pX; T* const m_pY; - const unsigned int m_n; + const int m_n; const bool m_bZeroOutsideRange; public: @@ -154,7 +154,7 @@ public: else result = m_pY[m_n - 1]; } else { - int iFloor = floor(dX); + int iFloor = static_cast(floor(dX)); result = m_pY[iFloor] + (m_pY[iFloor+1] - m_pY[iFloor]) * (dX - iFloor); } } else {