Skip to content

Commit d532714

Browse files
committed
Project settings, some changes, some cleanup
1 parent e2b9434 commit d532714

14 files changed

+315
-911
lines changed

Editor/GUIEditorApp.cpp

Lines changed: 96 additions & 224 deletions
Large diffs are not rendered by default.

Editor/GUIEditorApp.h

Lines changed: 175 additions & 261 deletions
Large diffs are not rendered by default.

GUIEditor.vcxproj

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
6161
<ClCompile>
6262
<Optimization>Disabled</Optimization>
63-
<AdditionalIncludeDirectories>$(SolutionDir)GUILibrary;$(ProjectDir)GUILibrary\Include;$(ProjectDir)GUILibrary\Source;$(ProjectDir)external\include;..\Cortex-Command-Community-Project-Source\Menus;..\Cortex-Command-Community-Project-Source\Entities;..\Cortex-Command-Community-Project-Source\System;..\Cortex-Command-Community-Project-Source\GUI;..\Cortex-Command-Community-Project-Source\Managers;$(ProjectDir)Editor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
63+
<AdditionalIncludeDirectories>$(ProjectDir)external\include;$(ProjectDir)Wrappers;$(SolutionDir)GUILibrary;$(ProjectDir)GUILibrary\Include;$(ProjectDir)GUILibrary\Source;$(ProjectDir)Editor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
6464
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;_HAS_ITERATOR_DEBUGGING=0;ALLEGRO_STATICLINK;ALLEGRO_NO_ASM;ALLEGRO_NO_STD_HEADERS;GUI_STANDALONE;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
6565
<MinimalRebuild>false</MinimalRebuild>
6666
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
@@ -71,27 +71,28 @@
7171
<ForcedIncludeFiles>LibraryIncludes.h;</ForcedIncludeFiles>
7272
<MultiProcessorCompilation>true</MultiProcessorCompilation>
7373
<PrecompiledHeaderFile>LibraryIncludes.h</PrecompiledHeaderFile>
74-
<DisableSpecificWarnings>4005;</DisableSpecificWarnings>
74+
<DisableSpecificWarnings>
75+
</DisableSpecificWarnings>
7576
<IntrinsicFunctions>false</IntrinsicFunctions>
7677
<OmitFramePointers>false</OmitFramePointers>
7778
<ConformanceMode>true</ConformanceMode>
7879
</ClCompile>
7980
<Link>
80-
<AdditionalDependencies>dinput.lib;dinput8.lib;ddraw.lib;dxguid.lib;dsound.lib;winmm.lib;allegro_static_debug.lib;RTEGUI.lib.debug.lib;dinput8.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;ole32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
81+
<AdditionalDependencies>dinput.lib;dinput8.lib;ddraw.lib;dxguid.lib;dsound.lib;winmm.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;ole32.lib;legacy_stdio_definitions.lib;allegro_static_debug.lib;RTEGUI.lib.debug.lib;%(AdditionalDependencies)</AdditionalDependencies>
8182
<AdditionalLibraryDirectories>$(SolutionDir)_Bin;$(ProjectDir)external\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
8283
<GenerateDebugInformation>true</GenerateDebugInformation>
8384
<SubSystem>Windows</SubSystem>
8485
<TargetMachine>MachineX86</TargetMachine>
8586
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
86-
<AdditionalOptions>/ignore:4099 /ignore:4217 /ignore:4049 /ignore:4221 %(AdditionalOptions)</AdditionalOptions>
87+
<AdditionalOptions>/ignore:4099 /ignore:4217 /ignore:4049 %(AdditionalOptions)</AdditionalOptions>
8788
</Link>
8889
<Manifest>
8990
<OutputManifestFile>$(IntDir)$(Configuration).manifest</OutputManifestFile>
9091
</Manifest>
9192
</ItemDefinitionGroup>
9293
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
9394
<ClCompile>
94-
<AdditionalIncludeDirectories>$(SolutionDir)GUILibrary;$(ProjectDir)GUILibrary\Include;$(ProjectDir)GUILibrary\Source;$(ProjectDir)external\include;..\Cortex-Command-Community-Project-Source\Menus;..\Cortex-Command-Community-Project-Source\Entities;..\Cortex-Command-Community-Project-Source\System;..\Cortex-Command-Community-Project-Source\GUI;..\Cortex-Command-Community-Project-Source\Managers;$(ProjectDir)Editor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
95+
<AdditionalIncludeDirectories>$(ProjectDir)external\include;$(ProjectDir)Wrappers;$(SolutionDir)GUILibrary;$(ProjectDir)GUILibrary\Include;$(ProjectDir)GUILibrary\Source;$(ProjectDir)Editor;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
9596
<PreprocessorDefinitions>_WINDOWS;WIN32;WIN32_LEAN_AND_MEAN;_HAS_ITERATOR_DEBUGGING=0;ALLEGRO_STATICLINK;ALLEGRO_NO_ASM;ALLEGRO_NO_STD_HEADERS;GUI_STANDALONE;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9697
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
9798
<PrecompiledHeader>Use</PrecompiledHeader>
@@ -100,7 +101,8 @@
100101
<ForcedIncludeFiles>LibraryIncludes.h;</ForcedIncludeFiles>
101102
<MultiProcessorCompilation>true</MultiProcessorCompilation>
102103
<PrecompiledHeaderFile>LibraryIncludes.h</PrecompiledHeaderFile>
103-
<DisableSpecificWarnings>4005;</DisableSpecificWarnings>
104+
<DisableSpecificWarnings>
105+
</DisableSpecificWarnings>
104106
<IntrinsicFunctions>true</IntrinsicFunctions>
105107
<OmitFramePointers>true</OmitFramePointers>
106108
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
@@ -114,7 +116,8 @@
114116
<OptimizeReferences>true</OptimizeReferences>
115117
<EnableCOMDATFolding>true</EnableCOMDATFolding>
116118
<TargetMachine>MachineX86</TargetMachine>
117-
<AdditionalOptions>/ignore:4099 /ignore:4217 /ignore:4049 /ignore:4221 %(AdditionalOptions)</AdditionalOptions>
119+
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
120+
<AdditionalOptions>/ignore:4099 /ignore:4217 /ignore:4049 %(AdditionalOptions)</AdditionalOptions>
118121
</Link>
119122
<Manifest>
120123
<OutputManifestFile>$(IntDir)$(Configuration).manifest</OutputManifestFile>

GUILibrary/GUILibrary.vcxproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;_HAS_ITERATOR_DEBUGGING=0;GUI_STANDALONE;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
9999
<ConformanceMode>true</ConformanceMode>
100100
<PrecompiledHeaderFile>$(ProjectDir)LibraryIncludes.h</PrecompiledHeaderFile>
101-
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)external\include;$(SolutionDir)Wrappers;$(ProjectDir)Include;$(ProjectDir)Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
101+
<AdditionalIncludeDirectories>$(SolutionDir)external\include;$(SolutionDir)Wrappers;$(SolutionDir);$(ProjectDir)Include;$(ProjectDir)Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
102102
<ForcedIncludeFiles>$(ProjectDir)LibraryIncludes.h;</ForcedIncludeFiles>
103103
<DisableSpecificWarnings>4996;4244;4018;4006;4305;</DisableSpecificWarnings>
104104
<CompileAs>CompileAsCpp</CompileAs>
@@ -138,7 +138,7 @@
138138
<PreprocessorDefinitions>WIN32;WIN32_LEAN_AND_MEAN;_HAS_ITERATOR_DEBUGGING=0;GUI_STANDALONE;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
139139
<ConformanceMode>true</ConformanceMode>
140140
<PrecompiledHeaderFile>$(ProjectDir)LibraryIncludes.h</PrecompiledHeaderFile>
141-
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)external\include;$(SolutionDir)Wrappers;$(ProjectDir)Include;$(ProjectDir)Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
141+
<AdditionalIncludeDirectories>$(SolutionDir)external\include;$(SolutionDir)Wrappers;$(SolutionDir);$(ProjectDir)Include;$(ProjectDir)Source;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
142142
<ForcedIncludeFiles>$(ProjectDir)LibraryIncludes.h;</ForcedIncludeFiles>
143143
<DisableSpecificWarnings>4996;4244;4018;4006;4305;</DisableSpecificWarnings>
144144
<CompileAs>CompileAsCpp</CompileAs>
@@ -179,6 +179,7 @@
179179
<ClInclude Include="..\Wrappers\ContentFile.h" />
180180
<ClInclude Include="..\Wrappers\Reader.h" />
181181
<ClInclude Include="..\Wrappers\RTEError.h" />
182+
<ClInclude Include="..\Wrappers\Serializable.h" />
182183
<ClInclude Include="..\Wrappers\Timer.h" />
183184
<ClInclude Include="..\Wrappers\TimerMan.h" />
184185
<ClInclude Include="..\Wrappers\Vector.h" />

GUILibrary/GUILibrary.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@
125125
<ClInclude Include="..\Wrappers\Vector.h">
126126
<Filter>Wrappers</Filter>
127127
</ClInclude>
128+
<ClInclude Include="..\Wrappers\Serializable.h">
129+
<Filter>Wrappers</Filter>
130+
</ClInclude>
128131
</ItemGroup>
129132
<ItemGroup>
130133
<ClCompile Include="Source\GUIBanner.cpp">

Main.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,15 @@
1-
2-
//////////////////////////////////////////////////////////////////////////////////////////
3-
// File: main
4-
//////////////////////////////////////////////////////////////////////////////////////////
5-
// Description: Entry point file for the GUI Library editor
6-
// Project: GUI Library
7-
// Author(s): Jason Boettcher
8-
9-
10-
11-
#include "TimerMan.h"
121
#include "GUIEditorApp.h"
132
#include "GUIEditorLib.h"
143

15-
#include "allegro.h"
16-
#include "winalleg.h"
17-
4+
using namespace RTE;
185

196
extern "C" { FILE __iob_func[3] = { *stdin, *stdout, *stderr }; }
20-
21-
22-
GUIEditorApp g_GUIEditor;
23-
247
extern HINSTANCE g_hInstance = 0;
258
extern HWND g_hWnd = 0;
269

27-
using namespace GUI;
28-
GUIEditorApp g_GUIEditor;
29-
30-
using namespace RTE;
31-
10+
/// <summary>
11+
/// Entry point for the GUI Library editor.
12+
/// </summary>
3213
int main(int argc, char *argv[]) {
3314
if (!g_GUIEditor.Initialize()) { return -1; }
3415

Wrappers/ContentFile.cpp

Lines changed: 2 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
// Inclusions of header files
1313

1414
#include "ContentFile.h"
15-
16-
#include "allegro.h"
17-
#include "winalleg.h"
15+
#include "RTEError.h"
1816

1917

2018
using namespace std;
21-
//using namespace zip;
2219

2320
namespace RTE
2421
{
@@ -37,26 +34,7 @@ void ContentFile::Clear()
3734
{
3835
m_DataPath.erase();
3936
m_DataModuleID = 0;
40-
m_pLoadedData = 0;
41-
m_LoadedDataSize = 0;
42-
m_pDataFile = 0;
43-
}
44-
45-
/*
46-
//////////////////////////////////////////////////////////////////////////////////////////
47-
// Virtual method: Create
48-
//////////////////////////////////////////////////////////////////////////////////////////
49-
// Description: Makes the ContentFile object ready for use.
50-
51-
int ContentFile::Create()
52-
{
53-
// Read all the properties
54-
if (Serializable::Create() < 0)
55-
return -1;
56-
57-
return 0;
5837
}
59-
*/
6038

6139
//////////////////////////////////////////////////////////////////////////////////////////
6240
// Method: Create
@@ -82,9 +60,6 @@ int ContentFile::Create(const ContentFile &reference)
8260

8361
m_DataPath = reference.m_DataPath;
8462
m_DataModuleID = reference.m_DataModuleID;
85-
// m_pLoadedData = reference.m_pLoadedData;
86-
// m_LoadedDataSize = reference.m_LoadedDataSize;
87-
// m_pDataFile = reference.m_pDataFile; Don't copy this; only the creator should keep it
8863

8964
return 0;
9065
}
@@ -98,15 +73,6 @@ int ContentFile::Create(const ContentFile &reference)
9873

9974
void ContentFile::Destroy(bool notInherited)
10075
{
101-
/* No, we're leaving all data loaded until engine shutdown - NO WE"RE NOT, LOOK at FreeAllLoaded
102-
if (m_pDataFile)
103-
unload_datafile_object(m_pDataFile);
104-
*/
105-
// Don't delete this guy, just for conveneice, and is not and owner of the data
106-
// delete m_pLoadedData;
107-
108-
// if (!notInherited)
109-
// Serializable::Destroy();
11076
Clear();
11177
}
11278

@@ -134,10 +100,6 @@ void ContentFile::FreeAllLoaded()
134100
void ContentFile::SetDataPath(std::string newDataPath)
135101
{
136102
m_DataPath = newDataPath;
137-
138-
// Reset the loaded convenience pointer
139-
m_pLoadedData = 0;
140-
m_LoadedDataSize = 0;
141103
};
142104

143105

@@ -154,40 +116,6 @@ int ContentFile::GetDataModuleID()
154116
}
155117

156118

157-
//////////////////////////////////////////////////////////////////////////////////////////
158-
// Virtual method: GetDataSize
159-
//////////////////////////////////////////////////////////////////////////////////////////
160-
// Description: Gets the file size of the content file represented by this ContentFile
161-
// object, in bytes.
162-
163-
unsigned long ContentFile::GetDataSize()
164-
{
165-
/*
166-
if (!m_pLoadedData)
167-
GetContent();
168-
*/
169-
// Now that we have a data, return the size.
170-
return m_LoadedDataSize;
171-
}
172-
173-
/*
174-
//////////////////////////////////////////////////////////////////////////////////////////
175-
// Virtual method: GetDataType
176-
//////////////////////////////////////////////////////////////////////////////////////////
177-
// Description: Gets the Allegro DATAFILE type of the DATAFILE represented by this
178-
// ContentFile.
179-
180-
int ContentFile::GetDataType()
181-
{
182-
if (!m_pDataFile)
183-
GetContent();
184-
185-
// Now that we have a datafile, return the Allegro type.
186-
return m_pDataFile->type;
187-
}
188-
*/
189-
190-
191119
//////////////////////////////////////////////////////////////////////////////////////////
192120
// Method: GetAsBitmap
193121
//////////////////////////////////////////////////////////////////////////////////////////
@@ -267,54 +195,6 @@ BITMAP * ContentFile::LoadAndReleaseBitmap(int conversionMode)
267195
// Close the file stream
268196
pack_fclose(pFile);
269197
}
270-
// If we found a pound sign, make sure it's not on the very end. If not, then go ahead and load from packed stream.
271-
else if (separatorPos != m_DataPath.length() - 1)
272-
{
273-
// Get the Path only, without the object name, using the separator index as length limiter
274-
string datafilePath = m_DataPath.substr(0, separatorPos);
275-
// Adjusting to the true first character of the datafile object's name string.
276-
string objectName = m_DataPath.substr(separatorPos + 1);
277-
278-
// Try loading the datafile from the specified path + object names.
279-
m_pDataFile = load_datafile_object(datafilePath.c_str(), objectName.c_str());
280-
281-
// Make sure we loaded properly.
282-
283-
/* Don't do this because there is no easy way to copy SAMPLE:s. Just save the datafile and unload it upon destruction.
284-
// Create temporary poitner to laoded bitmap; it will be destroyed along with the datafile soon
285-
BITMAP *pTempBitmap = (BITMAP *)m_pDataFile->dat;
286-
287-
// Copy the loaded bitmap
288-
if (!(pReturnBitmap = create_bitmap_ex(bitmap_color_depth(pTempBitmap), pTempBitmap->w, pTempBitmap->h)))
289-
DDTAbort("Failed to create copy of the loaded datafile's data!");
290-
blit(pTempBitmap, pReturnBitmap, 0, 0, 0, 0, pTempBitmap->w, pTempBitmap->h);
291-
292-
// Now unload the datafile, also destroying the loaded bitmap;
293-
unload_datafile_object(m_pDataFile);
294-
pTempBitmap = 0;
295-
*/
296-
// Get the loaded data
297-
pReturnBitmap = (BITMAP *)m_pDataFile->dat;
298-
}
299-
300198
return pReturnBitmap;
301199
}
302-
303-
304-
305-
/* This is foolish
306-
//////////////////////////////////////////////////////////////////////////////////////////
307-
// Static method: ClearAllLoadedData
308-
//////////////////////////////////////////////////////////////////////////////////////////
309-
// Description: Clears out all the previously loaded data shared among all ContentFile
310-
// instances. NEVER USE THIS UNLESS ALL INSTANCES OF CONTENTFILE ARE GONE!
311-
312-
static void ContentFile::ClearAllLoadedData()
313-
{
314-
for (map<string, DATAFILE *>::iterator itr = m_sLoadedDataMap.begin(); itr != m_sLoadedDataMap.end(); ++itr) {
315-
unload_datafile_object(itr->second);
316-
m_sLoadedDataMap.erase(itr);
317-
}
318-
}
319-
*/
320-
} // namespace RTE
200+
}

0 commit comments

Comments
 (0)