- map editor bugfixes (proper deletion of arrays and tooltip painting)
- updated vc++ 2008 project files (and new win32 dependency archive uploaded to sourceforge) so that all projects can be built in debug mode now
This commit is contained in:
parent
add0275120
commit
bd3cb7f9bb
|
@ -40,14 +40,14 @@
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories=""..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd";"..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc";..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;"..\..\source\win32_deps\wxWidgets-2.8.10\include";..\..\source\shared_lib\include\xml;"../../source/win32_deps/xerces-c-3.0.1/src""
|
AdditionalIncludeDirectories=""..\..\source\win32_deps\wxWidgets-2.8.10\lib\vc_lib\mswd";"..\..\source\win32_deps\wxWidgets-2.8.10\include\msvc";..\..\source\shared_lib\include\util;..\..\source\shared_lib\include\platform\win32;..\..\source\shared_lib\include\graphics\gl;..\..\source\win32_deps\include;..\..\source\shared_lib\include\graphics;"..\..\source\win32_deps\wxWidgets-2.8.10\include";..\..\source\shared_lib\include\xml;"../../source/win32_deps/xerces-c-3.0.1/src";..\..\source\shared_lib\include\platform\sdl;../../source/shared_lib/include/platform/common;"../../source/win32_deps/SDL-1.2.14/include";"../../source/win32_deps/curl-7.20.1/include""
|
||||||
PreprocessorDefinitions="MWIN;__WXMSW__;__WXDEBUG__"
|
PreprocessorDefinitions="MWIN;__WXMSW__;__WXDEBUG__;CURL_STATICLIB"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="1"
|
UsePrecompiledHeader="0"
|
||||||
PrecompiledHeaderThrough=""
|
PrecompiledHeaderThrough=""
|
||||||
PrecompiledHeaderFile="c:\temp\$(TargetName).pch"
|
PrecompiledHeaderFile=""
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="4"
|
||||||
|
@ -63,7 +63,7 @@
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCLinkerTool"
|
Name="VCLinkerTool"
|
||||||
AdditionalDependencies="wxbase28d.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib wxjpegd.lib wxmsw28d_adv.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxmsw28d_gl.lib wxmsw28d_html.lib wxmsw28d_media.lib wxmsw28d_qa.lib wxmsw28d_richtext.lib wxmsw28d_xrc.lib wxpngd.lib wxregexd.lib wxtiffd.lib wxzlibd.lib ..\libglest.lib kernel32.lib user32.lib gdi32.lib ole32.lib oleaut32.lib comctl32.lib comdlg32.lib uuid.lib advapi32.lib shell32.lib winmm.lib rpcrt4.lib"
|
AdditionalDependencies="wxbase28d.lib wxbase28d_net.lib wxbase28d_xml.lib wxexpatd.lib wxjpegd.lib wxmsw28d_adv.lib wxmsw28d_aui.lib wxmsw28d_core.lib wxmsw28d_gl.lib wxmsw28d_html.lib wxmsw28d_media.lib wxmsw28d_qa.lib wxmsw28d_richtext.lib wxmsw28d_xrc.lib wxpngd.lib wxregexd.lib wxtiffd.lib wxzlibd.lib winmm.lib rpcrt4.lib kernel32.lib user32.lib gdi32.lib ole32.lib oleaut32.lib comctl32.lib comdlg32.lib uuid.lib advapi32.lib shell32.lib libglest.lib sdl.lib sdlmain.lib dsound.lib dxguid.lib Dbghelp.lib libcurl.lib ws2_32.lib xerces-c_3.lib"
|
||||||
OutputFile="$(OutDir)\Glest_Configurator.exe"
|
OutputFile="$(OutDir)\Glest_Configurator.exe"
|
||||||
LinkIncremental="2"
|
LinkIncremental="2"
|
||||||
AdditionalLibraryDirectories=""../../build/$(ConfigurationName)/libglest";../../source/win32_deps/lib"
|
AdditionalLibraryDirectories=""../../build/$(ConfigurationName)/libglest";../../source/win32_deps/lib"
|
||||||
|
|
|
@ -54,7 +54,9 @@ MainWindow::MainWindow()
|
||||||
, enabledGroup(ctHeight)
|
, enabledGroup(ctHeight)
|
||||||
, fileModified(false)
|
, fileModified(false)
|
||||||
, menuBar(NULL)
|
, menuBar(NULL)
|
||||||
, panel(NULL) {
|
, panel(NULL)
|
||||||
|
, glCanvas(NULL)
|
||||||
|
, program(NULL) {
|
||||||
|
|
||||||
this->panel = new wxPanel(this, wxID_ANY);
|
this->panel = new wxPanel(this, wxID_ANY);
|
||||||
|
|
||||||
|
@ -332,11 +334,16 @@ void MainWindow::onClose(wxCloseEvent &event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow() {
|
MainWindow::~MainWindow() {
|
||||||
delete glCanvas;
|
|
||||||
delete program;
|
delete program;
|
||||||
|
program = NULL;
|
||||||
|
|
||||||
|
delete glCanvas;
|
||||||
|
glCanvas = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::setDirty(bool val) {
|
void MainWindow::setDirty(bool val) {
|
||||||
|
wxPaintEvent ev;
|
||||||
|
onPaint(ev);
|
||||||
if (fileModified && val) {
|
if (fileModified && val) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -380,16 +387,20 @@ void MainWindow::onMouseDown(wxMouseEvent &event, int x, int y) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onMouseMove(wxMouseEvent &event, int x, int y) {
|
void MainWindow::onMouseMove(wxMouseEvent &event, int x, int y) {
|
||||||
|
bool repaint = false;
|
||||||
int dif;
|
int dif;
|
||||||
if (event.LeftIsDown()) {
|
if (event.LeftIsDown()) {
|
||||||
change(x, y);
|
change(x, y);
|
||||||
|
repaint = true;
|
||||||
} else if (event.MiddleIsDown()) {
|
} else if (event.MiddleIsDown()) {
|
||||||
dif = (y - lastY);
|
dif = (y - lastY);
|
||||||
if (dif != 0) {
|
if (dif != 0) {
|
||||||
program->incCellSize(dif / abs(dif));
|
program->incCellSize(dif / abs(dif));
|
||||||
|
repaint = true;
|
||||||
}
|
}
|
||||||
} else if (event.RightIsDown()) {
|
} else if (event.RightIsDown()) {
|
||||||
program->setOfset(x - lastX, y - lastY);
|
program->setOfset(x - lastX, y - lastY);
|
||||||
|
repaint = true;
|
||||||
} else {
|
} else {
|
||||||
int currResource = program->getResource(x, y);
|
int currResource = program->getResource(x, y);
|
||||||
if (currResource > 0) {
|
if (currResource > 0) {
|
||||||
|
@ -406,8 +417,10 @@ void MainWindow::onMouseMove(wxMouseEvent &event, int x, int y) {
|
||||||
lastX = x;
|
lastX = x;
|
||||||
lastY = y;
|
lastY = y;
|
||||||
|
|
||||||
wxPaintEvent ev;
|
if (repaint) {
|
||||||
onPaint(ev);
|
wxPaintEvent ev;
|
||||||
|
onPaint(ev);
|
||||||
|
}
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,6 +436,7 @@ void MainWindow::onPaint(wxPaintEvent &event) {
|
||||||
|
|
||||||
program->renderMap(glCanvas->GetClientSize().x, glCanvas->GetClientSize().y);
|
program->renderMap(glCanvas->GetClientSize().x, glCanvas->GetClientSize().y);
|
||||||
glCanvas->SwapBuffers();
|
glCanvas->SwapBuffers();
|
||||||
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onMenuFileLoad(wxCommandEvent &event) {
|
void MainWindow::onMenuFileLoad(wxCommandEvent &event) {
|
||||||
|
@ -1021,42 +1035,42 @@ int App::OnExit() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
MsgDialog::MsgDialog(wxWindow *parent,
|
MsgDialog::MsgDialog(wxWindow *parent,
|
||||||
const wxString& message,
|
const wxString& message,
|
||||||
const wxString& caption,
|
const wxString& caption,
|
||||||
long style,
|
long style,
|
||||||
const wxPoint& pos) {
|
const wxPoint& pos) {
|
||||||
|
|
||||||
m_sizerText = NULL;
|
m_sizerText = NULL;
|
||||||
// TODO: should we use main frame as parent by default here?
|
// TODO: should we use main frame as parent by default here?
|
||||||
if ( !wxDialog::Create(parent, wxID_ANY, caption,
|
if ( !wxDialog::Create(parent, wxID_ANY, caption,
|
||||||
pos, wxDefaultSize,
|
pos, wxDefaultSize,
|
||||||
style) ) {
|
style) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_sizerText = new wxBoxSizer(wxVERTICAL);
|
m_sizerText = new wxBoxSizer(wxVERTICAL);
|
||||||
wxStaticText *label = new wxStaticText(this, wxID_ANY, message);
|
wxStaticText *label = new wxStaticText(this, wxID_ANY, message);
|
||||||
wxFont font(*wxNORMAL_FONT);
|
wxFont font(*wxNORMAL_FONT);
|
||||||
font.SetPointSize(font.GetPointSize());
|
font.SetPointSize(font.GetPointSize());
|
||||||
font.SetWeight(wxFONTWEIGHT_NORMAL);
|
font.SetWeight(wxFONTWEIGHT_NORMAL);
|
||||||
label->SetFont(font);
|
label->SetFont(font);
|
||||||
|
|
||||||
m_sizerText->Add(label, wxSizerFlags().Centre().Border());
|
m_sizerText->Add(label, wxSizerFlags().Centre().Border());
|
||||||
|
|
||||||
wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL);
|
wxSizer *sizerIconAndText = new wxBoxSizer(wxHORIZONTAL);
|
||||||
sizerIconAndText->Add(m_sizerText, wxSizerFlags(1).Expand());
|
sizerIconAndText->Add(m_sizerText, wxSizerFlags(1).Expand());
|
||||||
|
|
||||||
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
|
wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
|
||||||
sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border());
|
sizerTop->Add(sizerIconAndText, wxSizerFlags(1).Expand().Border());
|
||||||
|
|
||||||
wxSizer *sizerBtns = CreateButtonSizer(wxOK);
|
wxSizer *sizerBtns = CreateButtonSizer(wxOK);
|
||||||
if ( sizerBtns )
|
if ( sizerBtns )
|
||||||
{
|
{
|
||||||
sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border());
|
sizerTop->Add(sizerBtns, wxSizerFlags().Expand().Border());
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSizerAndFit(sizerTop);
|
SetSizerAndFit(sizerTop);
|
||||||
CentreOnScreen();
|
CentreOnScreen();
|
||||||
}
|
}
|
||||||
MsgDialog::~MsgDialog() {
|
MsgDialog::~MsgDialog() {
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,13 @@ Map::Map() {
|
||||||
|
|
||||||
Map::~Map() {
|
Map::~Map() {
|
||||||
delete [] startLocations;
|
delete [] startLocations;
|
||||||
|
startLocations = NULL;
|
||||||
|
|
||||||
for (int i = 0; i < h; i++) {
|
for (int i = 0; i < h; i++) {
|
||||||
delete cells[i];
|
delete [] cells[i];
|
||||||
}
|
}
|
||||||
delete cells;
|
delete [] cells;
|
||||||
|
cells = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,9 +287,9 @@ void Map::flipX() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < w; i++) {
|
for (int i = 0; i < w; i++) {
|
||||||
delete oldCells[i];
|
delete [] oldCells[i];
|
||||||
}
|
}
|
||||||
delete oldCells;
|
delete [] oldCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::flipY() {
|
void Map::flipY() {
|
||||||
|
@ -308,9 +311,9 @@ void Map::flipY() {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < w; i++) {
|
for (int i = 0; i < w; i++) {
|
||||||
delete oldCells[i];
|
delete [] oldCells[i];
|
||||||
}
|
}
|
||||||
delete oldCells;
|
delete [] oldCells;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Map::changeSurface(int x, int y, int surface, int radius) {
|
void Map::changeSurface(int x, int y, int surface, int radius) {
|
||||||
|
@ -411,9 +414,9 @@ void Map::reset(int w, int h, float alt, int surf) {
|
||||||
|
|
||||||
if (cells != NULL) {
|
if (cells != NULL) {
|
||||||
for (int i = 0; i < this->w; i++) {
|
for (int i = 0; i < this->w; i++) {
|
||||||
delete cells[i];
|
delete [] cells[i];
|
||||||
}
|
}
|
||||||
delete cells;
|
delete [] cells;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->w = w;
|
this->w = w;
|
||||||
|
@ -493,8 +496,8 @@ void Map::resize(int w, int h, float alt, int surf) {
|
||||||
//delete old cells
|
//delete old cells
|
||||||
if (oldCells != NULL) {
|
if (oldCells != NULL) {
|
||||||
for (int i = 0; i < oldW; i++)
|
for (int i = 0; i < oldW; i++)
|
||||||
delete oldCells[i];
|
delete [] oldCells[i];
|
||||||
delete oldCells;
|
delete [] oldCells;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,8 +506,10 @@ void Map::resetFactions(int maxPlayers) {
|
||||||
throw runtime_error("Max Players must be in the range 1-8");
|
throw runtime_error("Max Players must be in the range 1-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startLocations != NULL)
|
if (startLocations != NULL) {
|
||||||
delete startLocations;
|
delete [] startLocations;
|
||||||
|
startLocations = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
maxFactions = maxPlayers;
|
maxFactions = maxPlayers;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue