Skip to content

Commit 9c796f8

Browse files
Added Sound Editor IMGUI
1 parent fe64280 commit 9c796f8

File tree

112 files changed

+1199
-15675
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1199
-15675
lines changed

neo/CMakeLists.txt

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,8 @@ if(IMGUI)
870870
tools/imgui/util/SyntaxRichEditCtrl.cpp
871871
tools/imgui/util/TreeCtrl.h
872872
tools/imgui/util/TreeCtrl.cpp
873+
tools/imgui/util/PathTreeCtrl.h
874+
tools/imgui/util/PathTreeCtrl.cpp
873875
tools/imgui/util/RegistryOptions.h
874876
tools/imgui/util/RegistryOptions.cpp
875877

@@ -884,15 +886,15 @@ if(IMGUI)
884886

885887
tools/imgui/lighteditor/LightEditor.h
886888
tools/imgui/lighteditor/LightEditor.cpp
889+
tools/imgui/soundeditor/SoundEditor.h
890+
tools/imgui/soundeditor/SoundEditor.cpp
887891
#tools/imgui/pdaeditor/PDAEditor.h
888892
#tools/imgui/pdaeditor/PDAEditor.cpp
889893
tools/imgui/particleeditor/ParticleEditor.h
890894
tools/imgui/particleeditor/ParticleEditor.cpp
891895
tools/imgui/scripteditor/ScriptEditor.h
892896
tools/imgui/scripteditor/ScriptEditor.cpp
893897

894-
tools/imgui/decleditor/PathTreeCtrl.h
895-
tools/imgui/decleditor/PathTreeCtrl.cpp
896898
tools/imgui/decleditor/DeclBrowser.h
897899
tools/imgui/decleditor/DeclBrowser.cpp
898900
tools/imgui/decleditor/DeclEditor.h
@@ -1183,27 +1185,15 @@ if (TOOLS AND MFC_TOOLS AND MSVC)
11831185
file(GLOB src_compiler_roqvq "tools/compilers/roqvq/*.cpp") # FIXME: some of those were added before
11841186
add_globbed_headers(src_compiler_roqvq "tools/compilers/roqvq")
11851187
#tools
1186-
# Articulated Frame editor.
1187-
file(GLOB src_afeditor "tools/af/*.cpp")
1188-
add_globbed_headers(src_afeditor "tools/af")
1189-
# Declaration editor
1190-
file(GLOB src_decleditor "tools/decl/*.cpp")
1191-
add_globbed_headers(src_decleditor "tools/decl")
11921188
# GUI Editor.
11931189
file(GLOB src_gui_editor "tools/guied/*.cpp")
11941190
add_globbed_headers(src_gui_editor "tools/guied")
11951191
# Material editor
11961192
file(GLOB src_materialeditor "tools/materialeditor/*.cpp")
11971193
add_globbed_headers(src_materialeditor "tools/materialeditor")
1198-
# Particle Editor
1199-
file(GLOB src_particleeditor "tools/particle/*.cpp")
1200-
add_globbed_headers(src_particleeditor "tools/particle")
12011194
# Radiant (Map editor)
12021195
file(GLOB src_map_editor "tools/radiant/*.cpp")
12031196
add_globbed_headers(src_map_editor "tools/radiant")
1204-
# Script editor
1205-
file(GLOB src_script_editor "tools/script/*.cpp")
1206-
add_globbed_headers(src_script_editor "tools/script")
12071197
# Script Debugger
12081198
set(src_debuggerClient
12091199
tools/debugger/DebuggerClient.h
@@ -1221,24 +1211,16 @@ if (TOOLS AND MFC_TOOLS AND MSVC)
12211211
${src_debuggerServer}
12221212
${src_debuggerClient}
12231213
)
1224-
# sound editor?
1225-
file(GLOB src_sound_editor "tools/sound/*.cpp")
1226-
add_globbed_headers(src_sound_editor "tools/sound")
1227-
1214+
12281215

12291216
# The numerous tools in a nice list.
12301217
list(APPEND src_editor_tools
12311218
${src_comafx}
12321219
${src_tools_common}
12331220
${src_compiler_renderbump}
1234-
${src_afeditor}
1235-
${src_decleditor}
12361221
${src_gui_editor}
12371222
${src_materialeditor}
1238-
${src_particleeditor}
12391223
${src_map_editor}
1240-
${src_script_editor}
1241-
${src_sound_editor}
12421224
${src_script_debugger}
12431225
"tools/edit_public.h"
12441226
)

neo/framework/Common.cpp

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ idCommonLocal::InitTool
10381038
void idCommonLocal::InitTool( const toolFlag_t tool, const idDict *dict ) {
10391039
#ifndef IMGUI_DISABLE
10401040
if ( tool & EDITOR_SOUND ) {
1041-
//SoundEditorInit( dict );
1041+
ImGuiTools::SoundEditorInit( dict );
10421042
} else if ( tool & EDITOR_LIGHT ) {
10431043
ImGuiTools::LightEditorInit( dict );
10441044
} else if ( tool & EDITOR_PARTICLE ) {
@@ -1053,18 +1053,6 @@ void idCommonLocal::InitTool( const toolFlag_t tool, const idDict *dict ) {
10531053
ImGuiTools::DeclBrowserInit( dict );
10541054
}
10551055
#endif
1056-
1057-
#ifdef ID_ALLOW_TOOLS
1058-
if ( tool & EDITOR_SOUND ) {
1059-
SoundEditorInit( dict );
1060-
} else if ( tool & EDITOR_LIGHT ) {
1061-
LightEditorInit( dict );
1062-
} else if ( tool & EDITOR_PARTICLE ) {
1063-
ParticleEditorInit( dict );
1064-
} else if ( tool & EDITOR_AF ) {
1065-
AFEditorInit( dict );
1066-
}
1067-
#endif
10681056
}
10691057

10701058
/*
@@ -1298,11 +1286,8 @@ static void Com_EditLights_f( const idCmdArgs &args ) {
12981286
#ifndef IMGUI_DISABLE
12991287
D3::ImGuiHooks::ShowInfoOverlay( "Shoot a light to open it in the Light Editor" );
13001288
cvarSystem->SetCVarInteger( "g_editEntityMode", 1 );
1301-
#elif defined(ID_ALLOW_TOOLS)
1302-
LightEditorInit( NULL );
1303-
cvarSystem->SetCVarInteger( "g_editEntityMode", 1 );
13041289
#else
1305-
common->Warning( "Editors not available because dhewm3 was built without ImGui or MFC Tools" );
1290+
common->Warning( "Editors not available because the engine was built without ImGui Tools" );
13061291
#endif
13071292
}
13081293

@@ -1315,10 +1300,8 @@ Com_EditPDAs_f
13151300
static void Com_EditPDAs_f( const idCmdArgs &args ) {
13161301
#ifndef IMGUI_DISABLE
13171302
ImGuiTools::PDAEditorInit( NULL );
1318-
#elif defined(ID_ALLOW_TOOLS)
1319-
PDAEditorInit( NULL );
13201303
#else
1321-
common->Warning( "Editors not available because dhewm3 was built without ImGui or MFC Tools" );
1304+
common->Warning( "Editors not available because the engine was built without ImGui Tools" );
13221305
#endif
13231306
}
13241307
*/
@@ -1329,13 +1312,11 @@ Com_EditAFs_f
13291312
==================
13301313
*/
13311314
static void Com_EditAFs_f( const idCmdArgs &args ) {
1332-
// TODO: cvarSystem->SetCVarInteger( "g_editEntityMode", 3 ); ?
13331315
#ifndef IMGUI_DISABLE
13341316
ImGuiTools::AfEditorInit();
1335-
#elif defined(ID_ALLOW_TOOLS)
1336-
AFEditorInit( NULL );
1317+
cvarSystem->SetCVarInteger( "g_editEntityMode", 3 );
13371318
#else
1338-
common->Warning( "Editors not available because dhewm3 was built without ImGui or MFC Tools" );
1319+
common->Warning( "Editors not available because the engine was built without ImGui Tools" );
13391320
#endif
13401321
}
13411322

@@ -1347,10 +1328,8 @@ Com_EditParticles_f
13471328
static void Com_EditParticles_f(const idCmdArgs& args) {
13481329
#ifndef IMGUI_DISABLE
13491330
ImGuiTools::ParticleEditorInit( NULL );
1350-
#elif defined(ID_ALLOW_TOOLS)
1351-
ParticleEditorInit(NULL);
13521331
#else
1353-
common->Warning( "Editors not available because dhewm3 was built without ImGui or MFC Tools" );
1332+
common->Warning( "Editors not available because the engine was built without ImGui Tools" );
13541333
#endif
13551334
}
13561335

@@ -1362,10 +1341,8 @@ Com_EditDecls_f
13621341
static void Com_EditDecls_f( const idCmdArgs &args ) {
13631342
#ifndef IMGUI_DISABLE
13641343
ImGuiTools::DeclBrowserInit( NULL );
1365-
#elif defined(ID_ALLOW_TOOLS)
1366-
DeclBrowserInit( NULL );
13671344
#else
1368-
common->Warning("Editors not available because dhewm3 was built without ImGui or MFC Tools");
1345+
common->Warning("Editors not available because the engine was built without ImGui Tools");
13691346
#endif
13701347
}
13711348

@@ -1377,10 +1354,8 @@ Com_EditScripts_f
13771354
static void Com_EditScripts_f( const idCmdArgs &args ) {
13781355
#ifndef IMGUI_DISABLE
13791356
ImGuiTools::ScriptEditorInit( NULL );
1380-
#elif defined(ID_ALLOW_TOOLS)
1381-
ScriptEditorInit( NULL );
13821357
#else
1383-
common->Warning("Editors not available because dhewm3 was built without ImGui or MFC Tools");
1358+
common->Warning("Editors not available because the engine was built without ImGui Tools");
13841359
#endif
13851360
}
13861361

@@ -1401,20 +1376,20 @@ static void Com_MaterialEditor_f( const idCmdArgs &args ) {
14011376
#endif
14021377
}
14031378

1404-
1405-
#ifdef ID_ALLOW_TOOLS
14061379
/*
14071380
==================
14081381
Com_EditSounds_f
14091382
==================
14101383
*/
14111384
static void Com_EditSounds_f( const idCmdArgs &args ) {
1412-
SoundEditorInit( NULL );
1385+
#ifndef IMGUI_DISABLE
1386+
ImGuiTools::SoundEditorInit( NULL );
14131387
cvarSystem->SetCVarInteger( "g_editEntityMode", 2 );
1388+
#else
1389+
common->Warning( "Editors not available because the engine was built without ImGui Tools" );
1390+
#endif
14141391
}
14151392

1416-
#endif // ID_ALLOW_TOOLS
1417-
14181393
/*
14191394
==================
14201395
Com_Error_f
@@ -2452,20 +2427,22 @@ void idCommonLocal::InitCommands( void ) {
24522427
cmdSystem->AddCommand( "MatbuildDir", MatBuildDir_f, CMD_FL_TOOL, "builds interaction materials for a given directory.", idCmdSystem::ArgCompletion_MapName );
24532428
#endif
24542429

2430+
#ifdef ID_ALLOW_TOOLS
24552431
// editors
24562432
cmdSystem->AddCommand( "editLights", Com_EditLights_f, CMD_FL_TOOL, "launches the in-game Light Editor" );
2433+
cmdSystem->AddCommand( "editSounds", Com_EditSounds_f, CMD_FL_TOOL, "launches the in-game Sound Editor" );
24572434
//cmdSystem->AddCommand( "editPDAs", Com_EditPDAs_f, CMD_FL_TOOL, "launches the in-game PDA Editor" );
24582435
cmdSystem->AddCommand( "editAFs", Com_EditAFs_f, CMD_FL_TOOL, "launches the in-game Articulated Figure Editor" );
24592436
cmdSystem->AddCommand( "editDecls", Com_EditDecls_f, CMD_FL_TOOL, "launches the in-game Declaration Editor" );
24602437
cmdSystem->AddCommand( "editParticles", Com_EditParticles_f, CMD_FL_TOOL, "launches the in-game Particle Editor" );
24612438
cmdSystem->AddCommand( "editScripts", Com_EditScripts_f, CMD_FL_TOOL, "launches the in-game Script Editor" );
24622439
//BSM Nerve: Add support for the material editor
24632440
cmdSystem->AddCommand( "materialEditor", Com_MaterialEditor_f, CMD_FL_TOOL, "launches the Material Editor" );
2464-
#ifdef ID_ALLOW_TOOLS
2441+
#ifdef _WIN32
24652442
cmdSystem->AddCommand( "editor", Com_Editor_f, CMD_FL_TOOL, "launches the level editor Radiant" );
2466-
cmdSystem->AddCommand( "editSounds", Com_EditSounds_f, CMD_FL_TOOL, "launches the in-game Sound Editor" );
24672443
cmdSystem->AddCommand( "editGUIs", Com_EditGUIs_f, CMD_FL_TOOL, "launches the GUI Editor" );
24682444
cmdSystem->AddCommand( "debugger", Com_ScriptDebugger_f, CMD_FL_TOOL, "launches the Script Debugger" );
2445+
#endif
24692446
#endif
24702447

24712448
cmdSystem->AddCommand( "printMemInfo", PrintMemInfo_f, CMD_FL_SYSTEM, "prints memory debugging data" );

neo/sys/sys_imgui.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22

3-
#ifndef NEO_SYS_SYS_IMGUI_H_
4-
#define NEO_SYS_SYS_IMGUI_H_
3+
#ifndef _SYS_IMGUI_H_
4+
#define _SYS_IMGUI_H_
55

66
#ifndef IMGUI_DISABLE
77
#include "../libs/imgui/imgui.h"
@@ -15,14 +15,16 @@ enum D3ImGuiWindow {
1515
D3_ImGuiWin_Settings = 1, // advanced dhewm3 settings menu
1616
D3_ImGuiWin_Demo = 2, // ImGui demo window
1717
D3_ImGuiWin_LightEditor = 4, // new ingame Light Editor
18-
D3_ImGuiWin_AfEditor = 8, // new AF Editor
19-
D3_ImGuiWin_PDAEditor = 16, // new PDA Editor
20-
D3_ImGuiWin_ParticleEditor = 32, // new Particle Editor
21-
D3_ImGuiWin_ScriptEditor = 64, // new Script Editor
22-
D3_ImGuiWin_DeclBrowser = 128, // new Decl Browser
23-
D3_ImGuiWin_MaterialEditor = 256, // next should be 512, then 1024, etc so a bitmask can be used
18+
D3_ImGuiWin_SoundEditor = 8, // new ingame Sound Editor
19+
D3_ImGuiWin_AfEditor = 16, // new AF Editor
20+
D3_ImGuiWin_PDAEditor = 32, // new PDA Editor
21+
D3_ImGuiWin_ParticleEditor = 64, // new Particle Editor
22+
D3_ImGuiWin_ScriptEditor = 128, // new Script Editor
23+
D3_ImGuiWin_DeclBrowser = 256, // new Decl Browser
24+
D3_ImGuiWin_MaterialEditor = 512, // next should be 1024, then 2048, etc so a bitmask can be used
2425

2526
D3_ImGuiWin_AnyEditor = D3_ImGuiWin_LightEditor
27+
| D3_ImGuiWin_SoundEditor
2628
| D3_ImGuiWin_AfEditor
2729
| D3_ImGuiWin_PDAEditor
2830
| D3_ImGuiWin_ParticleEditor
@@ -146,4 +148,4 @@ inline bool WriteUserStyle() { return false; }
146148
}} //namespace D3::ImGuiHooks
147149

148150

149-
#endif /* NEO_SYS_SYS_IMGUI_H_ */
151+
#endif /* _SYS_IMGUI_H_ */

0 commit comments

Comments
 (0)