diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index 5d4f8d87cb5b0ab9a7a9c615b429496d1a6f572f..bd949579204bebf3560f558c2d840ef49abd9a44 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
if (BadTextNameHash = nil) then BadTextNameHash := hashNewStrInt();
if log and (not BadTextNameHash.get(RecName, a)) then
begin
- e_WriteLog(Format('Error loading texture %s', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Error loading texture %s', [RecName]), TMsgType.Warning);
//e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
end;
BadTextNameHash.put(RecName, -1);
if (BadTextNameHash = nil) then BadTextNameHash := hashNewStrInt();
if log and (not BadTextNameHash.get(RecName, f)) then
begin
- e_WriteLog(Format('Error loading animation texture %s', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Error loading animation texture %s', [RecName]), TMsgType.Warning);
//e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
end;
BadTextNameHash.put(RecName, -1);
if ResLength < 6 then
begin
- e_WriteLog(Format('Animated texture file "%s" too short', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture file "%s" too short', [RecName]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
// íåò, ýòî ñóïåðìåí!
if not WAD.ReadMemory(TextureWAD, ResLength) then
begin
- e_WriteLog(Format('Animated texture WAD file "%s" is invalid', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture WAD file "%s" is invalid', [RecName]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
// ×èòàåì INI-ðåñóðñ àíèì. òåêñòóðû è çàïîìèíàåì åãî óñòàíîâêè:
if not WAD.GetResource('TEXT/ANIM', TextData, ResLength) then
begin
- e_WriteLog(Format('Animated texture file "%s" has invalid INI', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture file "%s" has invalid INI', [RecName]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
TextureResource := cfg.ReadStr('', 'resource', '');
if TextureResource = '' then
begin
- e_WriteLog(Format('Animated texture WAD file "%s" has no "resource"', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture WAD file "%s" has no "resource"', [RecName]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
// ×èòàåì ðåñóðñ òåêñòóð (êàäðîâ) àíèì. òåêñòóðû â ïàìÿòü:
if not WAD.GetResource('TEXTURES/'+TextureResource, TextureData, ResLength) then
begin
- e_WriteLog(Format('Animated texture WAD file "%s" has no texture "%s"', [RecName, 'TEXTURES/'+TextureResource]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture WAD file "%s" has no texture "%s"', [RecName, 'TEXTURES/'+TextureResource]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
if (BadTextNameHash = nil) then BadTextNameHash := hashNewStrInt();
if log and (not BadTextNameHash.get(RecName, f)) then
begin
- e_WriteLog(Format('Error loading animation texture %s', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Error loading animation texture %s', [RecName]), TMsgType.Warning);
end;
BadTextNameHash.put(RecName, -1);
end;
GlobalMetadata.ClearMetaItemsForSaving();
if not LoadMultiImageFromMemory(TextureWAD, ResLength, ia) then
begin
- e_WriteLog(Format('Animated texture file "%s" cannot be loaded', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture file "%s" cannot be loaded', [RecName]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
if length(ia) = 0 then
begin
- e_WriteLog(Format('Animated texture file "%s" has no frames', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Animated texture file "%s" has no frames', [RecName]), TMsgType.Warning);
BadTextNameHash.put(RecName, -1);
exit;
end;
//writeln(' creating animated texture with ', length(ia), ' frames (delay:', _speed, '; backloop:', _backanimation, ') from "', RecName, '"...');
//for f := 0 to high(ia) do writeln(' frame #', f, ': ', ia[f].width, 'x', ia[f].height);
f := ord(_backanimation);
- e_WriteLog(Format('Animated texture file "%s": %d frames (delay:%d; back:%d; frdelay:%d; frloop:%d), %dx%d', [RecName, length(ia), _speed, f, frdelay, frloop, _width, _height]), MSG_NOTIFY);
+ e_WriteLog(Format('Animated texture file "%s": %d frames (delay:%d; back:%d; frdelay:%d; frloop:%d), %dx%d', [RecName, length(ia), _speed, f, frdelay, frloop, _width, _height]), TMsgType.Notify);
SetLength(Textures, Length(Textures)+1);
// cîçäàåì êàäðû àíèì. òåêñòóðû èç êàðòèíîê
if (BadTextNameHash = nil) then BadTextNameHash := hashNewStrInt();
if log and (not BadTextNameHash.get(RecName, f)) then
begin
- e_WriteLog(Format('Error loading animation texture "%s" images', [RecName]), MSG_WARNING);
+ e_WriteLog(Format('Error loading animation texture "%s" images', [RecName]), TMsgType.Warning);
end;
BadTextNameHash.put(RecName, -1);
end;
if (pan.proxyId <> -1) then
begin
{$IF DEFINED(D2F_DEBUG)}
- e_WriteLog(Format('DUPLICATE wall #%d(%d) enabled (%d); type:%08x', [Integer(idx), Integer(pan.proxyId), Integer(mapGrid.proxyEnabled[pan.proxyId]), pan.PanelType]), MSG_NOTIFY);
+ e_WriteLog(Format('DUPLICATE wall #%d(%d) enabled (%d); type:%08x', [Integer(idx), Integer(pan.proxyId), Integer(mapGrid.proxyEnabled[pan.proxyId]), pan.PanelType]), TMsgType.Notify);
{$ENDIF}
continue;
end;
if (gCurrentMap = nil) then
begin
FileName := g_ExtractWadName(Res);
- e_WriteLog('Loading map WAD: '+FileName, MSG_NOTIFY);
+ e_WriteLog('Loading map WAD: '+FileName, TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_WAD_FILE], 0, False);
WAD := TWADFile.Create();
end;
// Çàãðóçêà êàðòû:
- e_LogWritefln('Loading map: %s', [mapResName], MSG_NOTIFY);
+ e_LogWritefln('Loading map: %s', [mapResName], TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_MAP], 0, False);
stt := getTimeMicro();
monsters := gCurrentMap['monster'];
// Çàãðóçêà îïèñàíèÿ êàðòû:
- e_WriteLog(' Reading map info...', MSG_NOTIFY);
+ e_WriteLog(' Reading map info...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_MAP_HEADER], 0, False);
with gMapInfo do
// Äîáàâëåíèå òåêñòóð â Textures[]:
if (mapTextureList <> nil) and (mapTextureList.count > 0) then
begin
- e_WriteLog(' Loading textures:', MSG_NOTIFY);
+ e_WriteLog(' Loading textures:', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_TEXTURES], mapTextureList.count-1, False);
cnt := -1;
Inc(cnt);
s := rec.Resource;
{$IF DEFINED(D2F_DEBUG_TXLOAD)}
- e_WriteLog(Format(' Loading texture #%d: %s', [cnt, s]), MSG_NOTIFY);
+ e_WriteLog(Format(' Loading texture #%d: %s', [cnt, s]), TMsgType.Notify);
{$ENDIF}
//if g_Map_IsSpecialTexture(s) then e_WriteLog(' SPECIAL!', MSG_NOTIFY);
if rec.Anim then
// Çàãðóçêà òðèããåðîâ
gTriggerClientID := 0;
- e_WriteLog(' Loading triggers...', MSG_NOTIFY);
+ e_WriteLog(' Loading triggers...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_TRIGGERS], 0, False);
// Çàãðóçêà ïàíåëåé
- e_WriteLog(' Loading panels...', MSG_NOTIFY);
+ e_WriteLog(' Loading panels...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_PANELS], 0, False);
// check texture numbers for panels
begin
if (rec.tagInt < 0) then
begin
- e_WriteLog('error loading map: invalid texture index for panel', MSG_FATALERROR);
+ e_WriteLog('error loading map: invalid texture index for panel', TMsgType.Fatal);
result := false;
gCurrentMap.Free();
gCurrentMap := nil;
// Ñîçäàíèå òàáëèöû òðèããåðîâ (ñîîòâåòñòâèå ïàíåëåé òðèããåðàì)
if (triggers <> nil) and (triggers.count > 0) then
begin
- e_WriteLog(' Setting up trigger table...', MSG_NOTIFY);
+ e_WriteLog(' Setting up trigger table...', TMsgType.Notify);
//SetLength(TriggersTable, triggers.count);
g_Game_SetLoadingText(_lc[I_LOAD_TRIGGERS_TABLE], triggers.count-1, False);
// Ñîçäàåì ïàíåëè
if (panels <> nil) and (panels.count > 0) then
begin
- e_WriteLog(' Setting up trigger links...', MSG_NOTIFY);
+ e_WriteLog(' Setting up trigger links...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_LINK_TRIGGERS], panels.count-1, False);
pannum := -1;
end;
// create map grid, init other grids (for monsters, for example)
- e_WriteLog('Creating map grid', MSG_NOTIFY);
+ e_WriteLog('Creating map grid', TMsgType.Notify);
mapCreateGrid();
// Åñëè íå LoadState, òî ñîçäàåì òðèããåðû
end;
// Çàãðóçêà ïðåäìåòîâ
- e_WriteLog(' Loading items...', MSG_NOTIFY);
+ e_WriteLog(' Loading items...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_ITEMS], 0, False);
// Åñëè íå LoadState, òî ñîçäàåì ïðåäìåòû
if (items <> nil) and not gLoadGameMode then
begin
- e_WriteLog(' Spawning items...', MSG_NOTIFY);
+ e_WriteLog(' Spawning items...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_CREATE_ITEMS], 0, False);
for rec in items do CreateItem(rec);
end;
// Çàãðóçêà îáëàñòåé
- e_WriteLog(' Loading areas...', MSG_NOTIFY);
+ e_WriteLog(' Loading areas...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_AREAS], 0, False);
// Åñëè íå LoadState, òî ñîçäàåì îáëàñòè
if areas <> nil then
begin
- e_WriteLog(' Creating areas...', MSG_NOTIFY);
+ e_WriteLog(' Creating areas...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_CREATE_AREAS], 0, False);
for rec in areas do CreateArea(rec);
end;
// Çàãðóçêà ìîíñòðîâ
- e_WriteLog(' Loading monsters...', MSG_NOTIFY);
+ e_WriteLog(' Loading monsters...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_MONSTERS], 0, False);
gTotalMonsters := 0;
// Åñëè íå LoadState, òî ñîçäàåì ìîíñòðîâ
if (monsters <> nil) and not gLoadGameMode then
begin
- e_WriteLog(' Spawning monsters...', MSG_NOTIFY);
+ e_WriteLog(' Spawning monsters...', TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_CREATE_MONSTERS], 0, False);
for rec in monsters do CreateMonster(rec);
end;
// Çàãðóçêà íåáà
if (gMapInfo.SkyName <> '') then
begin
- e_WriteLog(' Loading sky: ' + gMapInfo.SkyName, MSG_NOTIFY);
+ e_WriteLog(' Loading sky: ' + gMapInfo.SkyName, TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_SKY], 0, False);
FileName := g_ExtractWadName(gMapInfo.SkyName);
ok := False;
if gMapInfo.MusicName <> '' then
begin
- e_WriteLog(' Loading music: ' + gMapInfo.MusicName, MSG_NOTIFY);
+ e_WriteLog(' Loading music: ' + gMapInfo.MusicName, TMsgType.Notify);
g_Game_SetLoadingText(_lc[I_LOAD_MUSIC], 0, False);
FileName := g_ExtractWadName(gMapInfo.MusicName);
end;
end;
- e_WriteLog('Done loading map.', MSG_NOTIFY);
+ e_WriteLog('Done loading map.', TMsgType.Notify);
Result := True;
end;
Obj.Y := -1000;
Obj.Vel.X := 0;
Obj.Vel.Y := 0;
- Direction := D_LEFT;
+ Direction := TDirection.D_LEFT;
State := FLAG_STATE_NONE;
if FlagPoints[Flag] <> nil then
begin
if State = FLAG_STATE_NONE then
continue;
- if Direction = D_LEFT then
+ if Direction = TDirection.D_LEFT then
begin
- Mirror := M_HORIZONTAL;
+ Mirror := TMirrorType.Horizontal;
dx := -1;
end
else
begin
- Mirror := M_NONE;
+ Mirror := TMirrorType.None;
dx := 1;
end;
// Ñîñòîÿíèå ôëàãà
utils.writeInt(st, Byte(flag^.State));
// Íàïðàâëåíèå ôëàãà
- if flag^.Direction = D_LEFT then b := 1 else b := 2; // D_RIGHT
+ if flag^.Direction = TDirection.D_LEFT then b := 1 else b := 2; // D_RIGHT
utils.writeInt(st, Byte(b));
// Îáúåêò ôëàãà
Obj_SaveState(st, @flag^.Obj);
flag^.State := utils.readByte(st);
// Íàïðàâëåíèå ôëàãà
b := utils.readByte(st);
- if (b = 1) then flag^.Direction := D_LEFT else flag^.Direction := D_RIGHT; // b = 2
+ if (b = 1) then flag^.Direction := TDirection.D_LEFT else flag^.Direction := TDirection.D_RIGHT; // b = 2
// Îáúåêò ôëàãà
Obj_LoadState(@flag^.Obj, st);
end;