Merge branch 'master' into fix_gltf2_export_componentType_error

pull/1925/head
Kim Kulling 2018-05-09 11:22:09 +02:00 committed by GitHub
commit 400b61b3fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 8 deletions

View File

@ -127,7 +127,7 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
if ( extension.empty() || checkSig ) {
static const char *pTokens[] = { "SECTION", "HEADER", "ENDSEC", "BLOCKS" };
return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 4 );
return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, pTokens, 4, 32 );
}
return false;

View File

@ -80,7 +80,7 @@ bool DefaultIOSystem::Exists( const char* pFile) const
if (isUnicode) {
MultiByteToWideChar(CP_UTF8, MB_PRECOMPOSED, pFile, -1, fileName16, PATHLIMIT);
struct _stat64 filestat;
struct __stat64 filestat;
if (0 != _wstat64(fileName16, &filestat)) {
return false;
}

View File

@ -2251,7 +2251,7 @@ int CDisplay::RenderTextureView()
const float ny = (float)sRect.bottom;
const float x = (float)sDesc.Width;
const float y = (float)sDesc.Height;
float f = min((nx-30) / x,(ny-30) / y) * (m_fTextureZoom/1000.0f);
float f = std::min((nx-30) / x,(ny-30) / y) * (m_fTextureZoom/1000.0f);
float fHalfX = (nx - (f * x)) / 2.0f;
float fHalfY = (ny - (f * y)) / 2.0f;

View File

@ -275,7 +275,7 @@ bool CMaterialManager::TryLongerPath(char* szTemp,aiString* p_szString)
for (unsigned int i = 0; i < iSizeFound;++i)
info.cFileName[i] = (CHAR)tolower(info.cFileName[i]);
if (0 == memcmp(info.cFileName,szFile2, min(iSizeFound,iSize)))
if (0 == memcmp(info.cFileName,szFile2, std::min(iSizeFound,iSize)))
{
// we have it. Build the full path ...
char* sz = strrchr(szTempB,'*');

View File

@ -45,7 +45,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <windowsx.h>
#include <commdlg.h>
#ifdef __MINGW32__
#include <mmsystem.h>
#else
#include <timeapi.h>
#endif
namespace AssimpView {
@ -1050,9 +1055,9 @@ void DoExport(size_t formatId)
ai_assert(strlen(szFileName) <= MAX_PATH);
// invent a nice default file name
char* sz = max(strrchr(szFileName,'\\'),strrchr(szFileName,'/'));
char* sz = std::max(strrchr(szFileName,'\\'),strrchr(szFileName,'/'));
if (sz) {
strncpy(sz,max(strrchr(g_szFileName,'\\'),strrchr(g_szFileName,'/')),MAX_PATH);
strncpy(sz,std::max(strrchr(g_szFileName,'\\'),strrchr(g_szFileName,'/')),MAX_PATH);
}
}
else {

View File

@ -43,10 +43,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "assimp_view.h"
#include <timeapi.h>
#include <assimp/StringUtils.h>
#include <map>
#ifdef __MINGW32__
#include <mmsystem.h>
#else
#include <timeapi.h>
#endif
using namespace std;
namespace AssimpView {

View File

@ -46,6 +46,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define AI_SHADER_COMPILE_FLAGS D3DXSHADER_USE_LEGACY_D3DX9_31_DLL
// Because Dx headers include windef.h with min/max redefinition
#define NOMINMAX
// include resource definitions
#include "resource.h"
@ -177,7 +180,7 @@ type clamp(intype in)
{
// for unsigned types only ...
intype mask = (0x1u << (sizeof(type)*8))-1;
return (type)max((intype)0,min(in,mask));
return (type)std::max((intype)0,std::min(in,mask));
}