Skip to content

Commit

Permalink
Fixed "cancel" CTD, disable unused GUI buttons.
Browse files Browse the repository at this point in the history
  • Loading branch information
jarmonik committed Jan 11, 2024
1 parent 6672a95 commit c72ff75
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
6 changes: 4 additions & 2 deletions OVP/D3D9Client/samples/TerrainToolKit/ExportImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ BOOL CALLBACK gDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
void ToolKit::StopImport()
{
for (auto x : pLr) {
if (x->hSource) oapiReleaseTexture(x->hSource);
x->hSource = NULL;
if (x) {
if (x->hSource) oapiReleaseTexture(x->hSource);
x->hSource = NULL;
}
}

if (hOverlay) pCore->AddGlobalOverlay(hMgr, _V(0, 0, 0, 0), gcCore::OlayType::RELEASE_ALL, NULL, hOverlay);
Expand Down
7 changes: 0 additions & 7 deletions OVP/D3D9Client/samples/TerrainToolKit/ToolKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@ BOOL ToolKit::DlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
return true;
}

case IDC_UPDATECLIP:
{
if (selection.area.size() != 0) oldsel = selection;
selection.area.clear();
break;
}

case IDC_DATAVIEW:
{
break;
Expand Down
15 changes: 7 additions & 8 deletions OVP/D3D9Client/samples/TerrainToolKit/ToolKit.rc
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ IDD_IMPORT DIALOG 0, 0, 180, 120
STYLE DS_CENTER | DS_SHELLFONT | WS_CHILDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS
FONT 8, "Ms Shell Dlg"
{
PUSHBUTTON "Open Elevation", IDC_OPENELEV, 95, 20, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Open Nightlights", IDC_OPENNIGHT, 95, 5, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Open Mesh", IDC_OPENMESH, 5, 45, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Open Elevation", IDC_OPENELEV, 95, 5, 75, 14, WS_DISABLED, WS_EX_LEFT
PUSHBUTTON "Open Nightlights", IDC_OPENNIGHT, 5, 36, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Open Mesh", IDC_OPENMESH, 96, 21, 75, 14, WS_DISABLED, WS_EX_LEFT
PUSHBUTTON "Open Surface", IDC_OPENIMAGE, 5, 5, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Bake", IDC_BAKE, 95, 100, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Reset Corners", IDC_CORNERS, 95, 60, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Reselect Region", IDC_UPDATECLIP, 95, 45, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Cancel Import", IDC_STOP, 95, 75, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Edit Elevation", IDC_EDITELEV, 5, 100, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Reset Corners", IDC_CORNERS, 95, 83, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Cancel Import", IDC_STOP, 5, 100, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Edit Elevation", IDC_EDITELEV, 95, 36, 75, 14, WS_DISABLED, WS_EX_LEFT
PUSHBUTTON "Open Water", IDC_OPENWATER, 5, 20, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Start Import", IDC_STARTIMPORT, 5, 75, 75, 14, 0, WS_EX_LEFT
PUSHBUTTON "Start Import", IDC_STARTIMPORT, 5, 83, 75, 14, 0, WS_EX_LEFT
}


Expand Down
5 changes: 2 additions & 3 deletions OVP/D3D9Client/samples/TerrainToolKit/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#define IDC_STATIC (-1)
#endif

#define IDS_INFO 1000 // never change these!
#define IDS_TYPE 1001 // " " "
#define IDD_DATA 102
#define IDD_IMPORT 103
#define IDD_EXPORT 104
Expand All @@ -15,16 +17,13 @@
#define IDC_BAKE 1012
#define IDC_OPENIMAGE 1014
#define IDC_STOP 1015
#define IDC_UPDATECLIP 1018
#define IDC_CORNERS 1020
#define IDC_PROGBAR 1021
#define IDC_LOAD 4000
#define IDC_OPENNIGHT 4001
#define IDS_INFO 4002
#define IDC_DISPSEL 4003
#define IDC_OPENELEV 4004
#define IDC_SAVE 4005
#define IDS_TYPE 4006
#define IDC_OPENMESH 4007
#define IDC_EDITELEV 4008
#define IDC_OPENWATER 4009
Expand Down

0 comments on commit c72ff75

Please sign in to comment.