diff options
| author | oy <Tom_Adams@web.de> | 2010-11-17 13:08:29 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2010-11-17 13:08:29 +0100 |
| commit | ca80d2a347689b5482f5c89a17a34131f79ed7cc (patch) | |
| tree | 3c781fa91ec098ec6310e0c2e95bd64ab2c3ab98 /src/game/editor/ed_editor.h | |
| parent | 8351682edf630d2d1ec706f0cf6406d026c7a8a4 (diff) | |
| download | zcatch-ca80d2a347689b5482f5c89a17a34131f79ed7cc.tar.gz zcatch-ca80d2a347689b5482f5c89a17a34131f79ed7cc.zip | |
reload the map on save just when the map name is equal
Diffstat (limited to 'src/game/editor/ed_editor.h')
| -rw-r--r-- | src/game/editor/ed_editor.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/game/editor/ed_editor.h b/src/game/editor/ed_editor.h index fb4cd50e..6ff9e6c8 100644 --- a/src/game/editor/ed_editor.h +++ b/src/game/editor/ed_editor.h @@ -680,6 +680,21 @@ public: void AddFileDialogEntry(int Index, CUIRect *pView); void SortImages(); + static void ExtractName(const char *pFileName, char *pName, int BufferSize) + { + const char *pExtractedName = pFileName; + const char *pEnd = 0; + for(; *pFileName; ++pFileName) + { + if(*pFileName == '/' || *pFileName == '\\') + pExtractedName = pFileName+1; + else if(*pFileName == '.') + pEnd = pFileName; + } + + int Length = pEnd > pExtractedName ? min(BufferSize, (int)(pEnd-pExtractedName+1)) : BufferSize; + str_copy(pName, pExtractedName, Length); + } }; // make sure to inline this function |