From dc99b4350b21c7cbb76b57aa6f7072b41a5e2429 Mon Sep 17 00:00:00 2001 From: leo Date: Mon, 5 Feb 2001 23:27:41 +0000 Subject: Fixes for VC++ git-svn-id: http://svn.leocad.org/trunk@245 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/pieceinf.cpp | 4 ++-- common/pieceinf.h | 4 ++-- common/project.cpp | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common/pieceinf.cpp b/common/pieceinf.cpp index 2e02e1a..2a06a78 100644 --- a/common/pieceinf.cpp +++ b/common/pieceinf.cpp @@ -175,9 +175,9 @@ unsigned char ConvertColor(int c) ///////////////////////////////////////////////////////////////////////////// // PieceInfo construction/destruction -PieceInfo::PieceInfo (File& file) +PieceInfo::PieceInfo () { - LoadIndex (file); + // Do nothing, initialization is done by LoadIndex () } PieceInfo::~PieceInfo () diff --git a/common/pieceinf.h b/common/pieceinf.h index afd1ecf..d13fc7a 100644 --- a/common/pieceinf.h +++ b/common/pieceinf.h @@ -44,7 +44,7 @@ unsigned char ConvertColor(int c); class PieceInfo { public: - PieceInfo (File& file); + PieceInfo (); ~PieceInfo (); // Operations @@ -54,6 +54,7 @@ class PieceInfo void WriteWavefront(FILE* file, unsigned char color, unsigned long* start); // Implementation + void LoadIndex (File& file); GLuint AddRef(); void DeRef(); @@ -81,7 +82,6 @@ protected: int m_nRef; GLuint m_nBoxList; - void LoadIndex (File& file); void LoadInformation(); void FreeInformation(); /* diff --git a/common/project.cpp b/common/project.cpp index 3b535e3..2f177a3 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -510,9 +510,13 @@ bool Project::LoadPieceLibrary (char *libpath) // Load piece indexes delete [] m_pPieceIdx; - m_pPieceIdx = new PieceInfo[count] (idx); + m_pPieceIdx = new PieceInfo[count]; m_nPieceCount = count; + // workaround for VC++ error C2538: new : cannot specify initializer for arrays + for (PieceInfo *pElements = m_pPieceIdx; count--; pElements++) + pElements->LoadIndex (idx); + // Load moved files reference. if (m_pMovedReference != NULL) free(m_pMovedReference); -- cgit v1.2.3