diff --git a/CClmReader.cpp b/CClmReader.cpp index 9c72e97..4b7042f 100644 --- a/CClmReader.cpp +++ b/CClmReader.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CClmReader.h" #include "CMemoryStreamReader.h" @@ -41,7 +40,6 @@ HRESULT __stdcall CClmReader::QueryInterface(REFIID riid, void** ppv) } - // ArchiveReader // ************* @@ -142,8 +140,6 @@ HRESULT CClmReader::OpenStreamRead(BSTR fileName, StreamReader **stream) } - - // Class specific // ************** diff --git a/CClmReader.h b/CClmReader.h index 7fb2d92..0f4d89f 100644 --- a/CClmReader.h +++ b/CClmReader.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CClmWriter.cpp b/CClmWriter.cpp index 7e23a66..d92a49d 100644 --- a/CClmWriter.cpp +++ b/CClmWriter.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CClmWriter.h" @@ -39,7 +38,6 @@ HRESULT __stdcall CClmWriter::QueryInterface(REFIID riid, void** ppv) } - // ArchiveWriter // ************* diff --git a/CClmWriter.h b/CClmWriter.h index 659438d..a49c195 100644 --- a/CClmWriter.h +++ b/CClmWriter.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CFileStreamReader.cpp b/CFileStreamReader.cpp index c9f956d..dadfeb8 100644 --- a/CFileStreamReader.cpp +++ b/CFileStreamReader.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CFileStreamReader.h" @@ -41,7 +40,6 @@ HRESULT __stdcall CFileStreamReader::QueryInterface(REFIID riid, void** ppv) } - // StreamReader // ************ @@ -106,8 +104,6 @@ HRESULT CFileStreamReader::Seek(int offset) } - - // Class specific // ************** diff --git a/CFileStreamReader.h b/CFileStreamReader.h index 9048125..1dcff46 100644 --- a/CFileStreamReader.h +++ b/CFileStreamReader.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CFileStreamWriter.cpp b/CFileStreamWriter.cpp index 81ca6bc..1bf8fc1 100644 --- a/CFileStreamWriter.cpp +++ b/CFileStreamWriter.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CFileStreamWriter.h" @@ -39,8 +38,6 @@ HRESULT __stdcall CFileStreamWriter::QueryInterface(REFIID riid, void** ppv) } - - CFileStreamWriter::CFileStreamWriter(BSTR fileName) : m_cRef(1) { // Initialize class variables diff --git a/CFileStreamWriter.h b/CFileStreamWriter.h index 43ef54c..e9c4f38 100644 --- a/CFileStreamWriter.h +++ b/CFileStreamWriter.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CMapFile.cpp b/CMapFile.cpp index 7e39559..cee4902 100644 --- a/CMapFile.cpp +++ b/CMapFile.cpp @@ -1,5 +1,3 @@ - - #include "stdafx.h" #include "CMapFile.h" #include "GlobalFunctions.h" @@ -166,7 +164,6 @@ HRESULT CMapFile::Draw(int destDC, int sourcePixelX, int sourcePixelY, int pixel } - // MapFile functions // ***************** @@ -179,7 +176,6 @@ HRESULT CMapFile::get_AroundTheWorld(int *bAroundTheWorld) } - HRESULT CMapFile::get_TileData( /* [in] */ int tileX, /* [in] */ int tileY, @@ -1118,9 +1114,6 @@ HRESULT CMapFile::SaveMap(StreamWriter *stream, enum MapLoadSaveFormat saveFlags } - - - // ISupportErrorInfo // ***************** @@ -1133,11 +1126,9 @@ HRESULT CMapFile::InterfaceSupportsErrorInfo(REFIID riid) } - // Constructors/Destructor // *********************** - CMapFile::CMapFile(TileSetSource *tileSetSource, int width, int height) : m_cRef(1) { diff --git a/CMapFile.h b/CMapFile.h index ca9f2e5..d165304 100644 --- a/CMapFile.h +++ b/CMapFile.h @@ -1,7 +1,8 @@ +#pragma once #include "OP2Editor.h" #include "CTileGroup.h" -//#include "CTileSetManager.h" +#include "CTileSetManager.h" class CMapFile : public MapFile, public ISupportErrorInfo diff --git a/CMemoryStreamReader.cpp b/CMemoryStreamReader.cpp index d3b21ae..ca17d9b 100644 --- a/CMemoryStreamReader.cpp +++ b/CMemoryStreamReader.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CMemoryStreamReader.h" @@ -41,7 +40,6 @@ HRESULT __stdcall CMemoryStreamReader::QueryInterface(REFIID riid, void** ppv) } - // StreamReader // ************ diff --git a/CMemoryStreamReader.h b/CMemoryStreamReader.h index c849405..0731c75 100644 --- a/CMemoryStreamReader.h +++ b/CMemoryStreamReader.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CResourceManager.cpp b/CResourceManager.cpp index d9980ed..750b17f 100644 --- a/CResourceManager.cpp +++ b/CResourceManager.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CResourceManager.h" #include "CFileStreamReader.h" @@ -46,9 +45,6 @@ HRESULT __stdcall CResourceManager::QueryInterface(REFIID riid, void** ppv) } - - - CResourceManager::CResourceManager(BSTR gamePath) : m_cRef(1) { // Initilize linked list of archives in search path @@ -103,7 +99,6 @@ CResourceManager::~CResourceManager() } - HRESULT CResourceManager::get_RootPath(BSTR *path) { SysReAllocString(path, this->path); @@ -141,9 +136,6 @@ HRESULT CResourceManager::put_RootPath(BSTR newPath) } - - - HRESULT CResourceManager::OpenStreamRead( /* [in] */ BSTR fileName, /* [retval][out] */ StreamReader **stream) @@ -265,8 +257,6 @@ HRESULT CResourceManager::OpenStreamWrite( } - - HRESULT CResourceManager::LoadMapFile(BSTR fileName, enum MapLoadSaveFormat loadFlags, MapFile **mapFile) { StreamReader *inStream; @@ -341,8 +331,6 @@ HRESULT CResourceManager::CreateNewMap(int width, int height, MapFile** newMap) } - - HRESULT CResourceManager::LoadTileSetFile(BSTR fileName, TileSet **tileSet) { StreamReader *inStream; @@ -417,8 +405,6 @@ HRESULT CResourceManager::CreateTileSet(int numTiles, int bitDepth, int width, T } - - HRESULT CResourceManager::LoadVolFile(BSTR fileName, int bAttachToStream, ArchiveReader **volReader) { StreamReader *inStream; @@ -639,8 +625,6 @@ HRESULT CResourceManager::ClearSearchPath() } - - // ISupportErrorInfo // ***************** diff --git a/CResourceManager.h b/CResourceManager.h index 30dfe8f..0f77df6 100644 --- a/CResourceManager.h +++ b/CResourceManager.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" #include "CTileSetSource.h" diff --git a/CResourceManagerFactory.cpp b/CResourceManagerFactory.cpp index f06c686..f2c1d84 100644 --- a/CResourceManagerFactory.cpp +++ b/CResourceManagerFactory.cpp @@ -1,10 +1,8 @@ - #include "stdafx.h" #include "CResourceManagerFactory.h" #include "CResourceManager.h" - ULONG CResourceManagerFactory::AddRef() { return ++m_cRef; @@ -34,7 +32,6 @@ HRESULT CResourceManagerFactory::QueryInterface(REFIID riid, void** ppv) } - HRESULT CResourceManagerFactory::CreateInstance(IUnknown *pUnknownOuter, REFIID riid, void** ppv) { diff --git a/CResourceManagerFactory.h b/CResourceManagerFactory.h index 43e659a..8e47d21 100644 --- a/CResourceManagerFactory.h +++ b/CResourceManagerFactory.h @@ -1,3 +1,4 @@ +#pragma once extern int g_cLocks; diff --git a/CTileGroup.cpp b/CTileGroup.cpp index f1480b6..609680a 100644 --- a/CTileGroup.cpp +++ b/CTileGroup.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CTileGroup.h" #include "GlobalFunctions.h" @@ -138,7 +137,6 @@ HRESULT CTileGroup::Draw(int destDC, int sourcePixelX, int sourcePixelY, int pix } - // Class specific // ************** diff --git a/CTileGroup.h b/CTileGroup.h index 555fbd2..4904652 100644 --- a/CTileGroup.h +++ b/CTileGroup.h @@ -1,4 +1,4 @@ - +#pragma once #include "OP2Editor.h" #include "CTileSetManager.h" diff --git a/CTileSet.cpp b/CTileSet.cpp index 21e5400..e1576b3 100644 --- a/CTileSet.cpp +++ b/CTileSet.cpp @@ -101,7 +101,6 @@ HRESULT CTileSet::put_PaletteEntry(int index, int palEntry) } - HRESULT CTileSet::SetNumTiles(int newNumTiles) { HBITMAP newTileSet; @@ -217,11 +216,9 @@ HRESULT CTileSet::SaveTileSet(StreamWriter *stream, enum TileSetSaveFormat saveF } - // Private functions // ***************** - // Constructors // ************ diff --git a/CTileSet.h b/CTileSet.h index 91a3211..43fbaf4 100644 --- a/CTileSet.h +++ b/CTileSet.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CTileSetManager.cpp b/CTileSetManager.cpp index 9e18b3d..fdab4e9 100644 --- a/CTileSetManager.cpp +++ b/CTileSetManager.cpp @@ -1,9 +1,9 @@ - #include "stdafx.h" #include "OP2Editor.h" #include "CTileSetManager.h" #include "GlobalFunctions.h" + extern int g_cLocks; diff --git a/CTileSetManager.h b/CTileSetManager.h index d28cbb9..76dfe9c 100644 --- a/CTileSetManager.h +++ b/CTileSetManager.h @@ -1,3 +1,4 @@ +#pragma once class CTileSetManager : public TileSetManager, public ISupportErrorInfo diff --git a/CTileSetSource.cpp b/CTileSetSource.cpp index 8a70efa..23f7cb2 100644 --- a/CTileSetSource.cpp +++ b/CTileSetSource.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CTileSetSource.h" @@ -36,8 +35,6 @@ HRESULT __stdcall CTileSetSource::QueryInterface(REFIID riid, void** ppv) } - - CTileSetSource::CTileSetSource(IResourceManager *resourceManager) : m_cRef(1) { head = NULL; // Initialize linked list of loaded files to empty diff --git a/CTileSetSource.h b/CTileSetSource.h index a63fc27..fbdd216 100644 --- a/CTileSetSource.h +++ b/CTileSetSource.h @@ -1,7 +1,9 @@ +#pragma once #include "OP2Editor.h" #include "CTileSet.h" + class CTileSetSource : public TileSetSource { public: diff --git a/CVolReader.cpp b/CVolReader.cpp index c75cf67..bdd42ba 100644 --- a/CVolReader.cpp +++ b/CVolReader.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CVolReader.h" #include "CMemoryStreamReader.h" @@ -38,7 +37,6 @@ HRESULT __stdcall CVolReader::QueryInterface(REFIID riid, void** ppv) } - // ArchiveReader // ************* diff --git a/CVolReader.h b/CVolReader.h index dbc09a8..a1f2353 100644 --- a/CVolReader.h +++ b/CVolReader.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/CVolWriter.cpp b/CVolWriter.cpp index 12c8568..0bfbbba 100644 --- a/CVolWriter.cpp +++ b/CVolWriter.cpp @@ -1,4 +1,3 @@ - #include "stdafx.h" #include "CVolWriter.h" @@ -36,7 +35,6 @@ HRESULT __stdcall CVolWriter::QueryInterface(REFIID riid, void** ppv) } - // ArchiveWriter // ************* diff --git a/CVolWriter.h b/CVolWriter.h index 97aab65..6c8cf3c 100644 --- a/CVolWriter.h +++ b/CVolWriter.h @@ -1,3 +1,4 @@ +#pragma once #include "OP2Editor.h" diff --git a/GlobalFunctions.cpp b/GlobalFunctions.cpp index 6507bad..8bc5c83 100644 --- a/GlobalFunctions.cpp +++ b/GlobalFunctions.cpp @@ -1,9 +1,7 @@ - #include "stdafx.h" #include "GlobalFunctions.h" - void PostErrorMsg(WCHAR *errorMsg) { // Provide rich error information diff --git a/GlobalFunctions.h b/GlobalFunctions.h index 74a0c17..e15155d 100644 --- a/GlobalFunctions.h +++ b/GlobalFunctions.h @@ -1,5 +1,4 @@ - - +#pragma once void PostErrorMsg(WCHAR *errorMsg); diff --git a/OP2Editor.idl b/OP2Editor.idl index fd447fc..4d2b05f 100644 --- a/OP2Editor.idl +++ b/OP2Editor.idl @@ -8,8 +8,6 @@ import "oaidl.idl"; import "ocidl.idl"; - - // Interfaces // ********** @@ -42,7 +40,6 @@ interface SeekableStreamReader : StreamReader } - // StreamWriter [ object, uuid(B83597A2-3471-48db-B9BC-EB4749BA1AAA), oleautomation, nonextensible, @@ -88,8 +85,6 @@ interface ArchiveWriter : IUnknown } - - // TileSet [ object, uuid(C7F1E185-8079-4538-96CF-5950406AE1AA), oleautomation, nonextensible, @@ -485,8 +480,6 @@ interface IResourceManager : IUnknown } - - // ************ // Type Library // ************ diff --git a/OP2Editor.rc b/OP2Editor.rc index e2dc8a6..ce6c4ce 100644 --- a/OP2Editor.rc +++ b/OP2Editor.rc @@ -112,7 +112,6 @@ END ///////////////////////////////////////////////////////////////////////////// - #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // diff --git a/StdAfx.cpp b/StdAfx.cpp index 4ab1221..e8d3fcb 100644 --- a/StdAfx.cpp +++ b/StdAfx.cpp @@ -10,8 +10,3 @@ #endif //#include - - - - -