diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index c4e818fe319d289a38fe4f908cc609d89e085811..35e8d46a6078d31326c79dc63af187ad03e74d17 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
implementation
uses
+ {$INCLUDE ../nogl/noGLuses.inc}
e_input, g_main, e_log, e_texture, g_items, g_gfx, g_console,
- GL, GLExt, g_weapons, g_game, g_sound, e_sound, CONFIG,
+ g_weapons, g_game, g_sound, e_sound, CONFIG,
g_options, g_triggers, g_player,
Math, g_monsters, g_saveload, g_language, g_netmsg,
sfs, xstreams, hashtable, wadreader,
// ////////////////////////////////////////////////////////////////////////// //
var
NNF_PureName: String; // Èìÿ òåêñòóðû áåç öèôð â êîíöå
+ NNF_PureExt: String; // extension postfix
NNF_FirstNum: Integer; // ×èñëî ó íà÷àëüíîé òåêñòóðû
NNF_CurrentNum: Integer; // Ñëåäóþùåå ÷èñëî ó òåêñòóðû
function g_Texture_NumNameFindStart(name: String): Boolean;
var
- i: Integer;
+ i, j: Integer;
begin
Result := False;
NNF_PureName := '';
+ NNF_PureExt := '';
NNF_FirstNum := -1;
NNF_CurrentNum := -1;
end
else
begin
+ j := i + 1;
+ while (j <= Length(name)) and (name[j] <> '.') do inc(j);
NNF_PureName := Copy(name, 1, i);
- Delete(name, 1, i);
+ NNF_PureExt := Copy(name, j);
+ name := Copy(name, i + 1, j - i - 1);
Break;
end;
end;
Exit;
end;
- newName := NNF_PureName + IntToStr(NNF_CurrentNum);
+ newName := NNF_PureName + IntToStr(NNF_CurrentNum) + NNF_PureExt;
if NNF_CurrentNum < NNF_FirstNum then
Result := NNF_NAME_BEFORE
procedure g_Map_ProfilersBegin ();
begin
if (profMapCollision = nil) then profMapCollision := TProfiler.Create('COLSOLID', g_profile_history_size);
- profMapCollision.mainBegin(g_profile_collision);
+ if (profMapCollision <> nil) then profMapCollision.mainBegin(g_profile_collision);
// create sections
- if g_profile_collision then
+ if g_profile_collision and (profMapCollision <> nil) then
begin
profMapCollision.sectionBegin('*solids');
profMapCollision.sectionEnd();