Final sample -> editor rename

This commit is contained in:
Kawe Mazidjatari 2022-10-22 22:51:16 +02:00
parent 9289356794
commit 6ef89a19ba
4 changed files with 28 additions and 28 deletions

View File

@ -675,9 +675,9 @@ public:
virtual int type() { return TOOL_TILE_HIGHLIGHT; } virtual int type() { return TOOL_TILE_HIGHLIGHT; }
virtual void init(Sample* sample) virtual void init(Editor* editor)
{ {
= (Editor_TempObstacles*)sample; = (Editor_TempObstacles*)editor;
} }
virtual void reset() {} virtual void reset() {}
@ -763,9 +763,9 @@ public:
virtual int type() { return TOOL_TEMP_OBSTACLE; } virtual int type() { return TOOL_TEMP_OBSTACLE; }
virtual void init(Sample* sample) virtual void init(Editor* editor)
{ {
= (Editor_TempObstacles*)sample; = (Editor_TempObstacles*)editor;
} }
virtual void reset() {} virtual void reset() {}

View File

@ -675,9 +675,9 @@ public:
virtual int type() { return TOOL_TILE_HIGHLIGHT; } virtual int type() { return TOOL_TILE_HIGHLIGHT; }
virtual void init(Sample* sample) virtual void init(Editor* editor)
{ {
= (Editor_TempObstacles*)sample; = (Editor_TempObstacles*)editor;
} }
virtual void reset() {} virtual void reset() {}
@ -763,9 +763,9 @@ public:
virtual int type() { return TOOL_TEMP_OBSTACLE; } virtual int type() { return TOOL_TEMP_OBSTACLE; }
virtual void init(Sample* sample) virtual void init(Editor* editor)
{ {
= (Editor_TempObstacles*)sample; = (Editor_TempObstacles*)editor;
} }
virtual void reset() {} virtual void reset() {}

View File

@ -49,7 +49,7 @@ enum EditorToolType
MAX_TOOLS MAX_TOOLS
}; };
/// These are just sample areas to use consistent values across the samples. /// These are just poly areas to use consistent values across the editors.
/// The use should specify these base on his needs. /// The use should specify these base on his needs.
enum EditorPolyAreas enum EditorPolyAreas
{ {

View File

@ -117,7 +117,7 @@ void generate_points(float* pts, int count, float dx, float dy, float dz)
} }
} }
void auto_load(const char* path, BuildContext& ctx, Editor*& sample,InputGeom*& geom, string& meshName) void auto_load(const char* path, BuildContext& ctx, Editor*& editor,InputGeom*& geom, string& meshName)
{ {
string geom_path = std::string(path); string geom_path = std::string(path);
meshName = geom_path.substr(geom_path.rfind("\\") + 1); meshName = geom_path.substr(geom_path.rfind("\\") + 1);
@ -127,18 +127,18 @@ void auto_load(const char* path, BuildContext& ctx, Editor*& sample,InputGeom*&
delete geom; delete geom;
geom = 0; geom = 0;
// Destroy the sample if it already had geometry loaded, as we've just deleted it! // Destroy the editor if it already had geometry loaded, as we've just deleted it!
/*if (sample && sample->getInputGeom()) /*if (editor && editor->getInputGeom())
{ {
delete sample; delete editor;
sample = 0; editor = 0;
}*/ }*/
ctx.dumpLog("Geom load log %s:", meshName.c_str()); ctx.dumpLog("Geom load log %s:", meshName.c_str());
} }
if (sample && geom) if (editor && geom)
{ {
sample->handleMeshChanged(geom); editor->handleMeshChanged(geom);
sample->m_modelName = meshName.substr(0, meshName.size() - 4); editor->m_modelName = meshName.substr(0, meshName.size() - 4);
} }
} }
@ -397,7 +397,7 @@ int not_main(int argc, char** argv)
TestCase* test = nullptr; TestCase* test = nullptr;
BuildContext ctx; BuildContext ctx;
//Load tiled sample //Load tiled editor
editor = createTile(); editor = createTile();
editor->setContext(&ctx); editor->setContext(&ctx);
@ -453,7 +453,7 @@ int not_main(int argc, char** argv)
bool showLog = false; bool showLog = false;
bool showTools = true; bool showTools = true;
bool showLevels = false; bool showLevels = false;
bool showSample = false; bool showEditor = false;
bool showTestCases = false; bool showTestCases = false;
// Window scroll positions. // Window scroll positions.
@ -490,7 +490,7 @@ int not_main(int argc, char** argv)
else if (event.key.keysym.sym == SDLK_t) else if (event.key.keysym.sym == SDLK_t)
{ {
showLevels = false; showLevels = false;
showSample = false; showEditor = false;
showTestCases = true; showTestCases = true;
scanDirectory(testCasesFolder, ".txt", files); scanDirectory(testCasesFolder, ".txt", files);
} }
@ -665,7 +665,7 @@ int not_main(int argc, char** argv)
} }
} }
// Update sample simulation. // Update editor simulation.
const float SIM_RATE = 20; const float SIM_RATE = 20;
const float DELTA_TIME = 1.0f / SIM_RATE; const float DELTA_TIME = 1.0f / SIM_RATE;
timeAcc = rcClamp(timeAcc + dt, -1.0f, 1.0f); timeAcc = rcClamp(timeAcc + dt, -1.0f, 1.0f);
@ -856,7 +856,7 @@ int not_main(int argc, char** argv)
} }
else else
{ {
showSample = false; showEditor = false;
showTestCases = false; showTestCases = false;
showLevels = true; showLevels = true;
scanDirectory(meshesFolder, ".obj", files); scanDirectory(meshesFolder, ".obj", files);
@ -907,8 +907,8 @@ int not_main(int argc, char** argv)
imguiEndScrollArea(); imguiEndScrollArea();
} }
// Sample selection dialog. // Editor selection dialog.
if (showSample) if (showEditor)
{ {
static int levelScroll = 0; static int levelScroll = 0;
if (geom || editor) if (geom || editor)
@ -967,7 +967,7 @@ int not_main(int argc, char** argv)
delete geom; delete geom;
geom = 0; geom = 0;
// Destroy the sample if it already had geometry loaded, as we've just deleted it! // Destroy the editor if it already had geometry loaded, as we've just deleted it!
if (editor && editor->getInputGeom()) if (editor && editor->getInputGeom())
{ {
delete editor; delete editor;
@ -1031,7 +1031,7 @@ int not_main(int argc, char** argv)
if (editor) if (editor)
{ {
editor->setContext(&ctx); editor->setContext(&ctx);
showSample = false; showEditor = false;
} }
// Load geom. // Load geom.
@ -1058,7 +1058,7 @@ int not_main(int argc, char** argv)
editor->m_modelName = meshName.substr(0, meshName.size() - 4); editor->m_modelName = meshName.substr(0, meshName.size() - 4);
} }
// This will ensure that tile & poly bits are updated in tiled sample. // This will ensure that tile & poly bits are updated in tiled editor.
if (editor) if (editor)
editor->handleSettings(); editor->handleSettings();
@ -1102,7 +1102,7 @@ int not_main(int argc, char** argv)
} }
// Left column tools menu // Left column tools menu
if (!showTestCases && showTools && showMenu) // && geom && sample) if (!showTestCases && showTools && showMenu) // && geom && editor)
{ {
if (imguiBeginScrollArea("Tools", 10, 10, 250, height - 20, &toolsScroll)) if (imguiBeginScrollArea("Tools", 10, 10, 250, height - 20, &toolsScroll))
mouseOverMenu = true; mouseOverMenu = true;