1 (* Copyright (C) Doom 2D: Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 {$INCLUDE ../shared/a_modes.inc}
21 uses MAPDEF
, g_textures
, g_base
, g_basic
, g_weapons
, utils
;
39 A_WALKATTACKDOWN
= 14;
43 A_FISTWALKATTACK
= 18;
47 A_FISTATTACKDOWN
= 22;
50 A_LASTEXT
= A_FISTATTACKDOWN
;
63 FLAG_BASEPOINT
: TDFPoint
= (X
:16; Y
:43);
66 TWeaponPoints
= Array [WP_FIRST
+ 1..WP_LAST
, A_STAND
..A_LAST
, TDirection
.D_LEFT
..TDirection
.D_RIGHT
] of Array of TDFPoint
;
68 TModelMatrix
= Array [TDirection
.D_LEFT
..TDirection
.D_RIGHT
, A_STAND
..A_LAST
] of TAnimationState
;
70 TModelTextures
= Array [TDirection
.D_LEFT
..TDirection
.D_RIGHT
, A_STAND
..A_LAST
] of record
88 TModelSoundArray
= Array of TModelSound
;
90 TPlayerModel
= class{$IFDEF USE_MEMPOOL}(TPoolObject
){$ENDIF}
92 FDirection
: TDirection
;
94 FCurrentAnimation
: Byte;
95 FAnimState
: TAnimationState
;
102 destructor Destroy(); override;
103 procedure ChangeAnimation(Animation
: Byte; Force
: Boolean = False);
104 procedure SetColor(Red
, Green
, Blue
: Byte);
105 procedure SetWeapon(Weapon
: Byte);
106 procedure SetFlag(Flag
: Byte);
107 procedure SetFire (Fire
: Boolean);
108 function GetFire (): Boolean;
109 function PlaySound(SoundType
, Level
: Byte; X
, Y
: Integer): Boolean;
113 function GetBlood (): TModelBlood
;
116 function GetName (): String;
119 property Direction
: TDirection read FDirection write FDirection
;
120 property Animation
: Byte read FCurrentAnimation
;
121 property Weapon
: Byte read FCurrentWeapon
;
124 property Color
: TRGB read FColor write FColor
;
125 property AnimState
: TAnimationState read FAnimState
;
126 property CurrentAnimation
: Byte read FCurrentAnimation
;
127 property CurrentWeapon
: Byte read FCurrentWeapon
;
128 property Flag
: Byte read FFlag
;
129 property ID
: Integer read FID
;
132 procedure g_PlayerModel_LoadAll
;
133 procedure g_PlayerModel_FreeData();
134 function g_PlayerModel_Load(FileName
: String): Boolean;
135 function g_PlayerModel_GetNames(): SSArray
;
136 function g_PlayerModel_Get(ModelName
: String): TPlayerModel
;
137 function g_PlayerModel_GetIndex (ModelName
: String): Integer;
140 function g_PlayerModel_GetBlood(ModelName
: String): TModelBlood
;
143 procedure g_PlayerModel_LoadFake (ModelName
, FileName
: String);
145 (* --- private data --- *)
148 TPlayerModelInfo
= record
153 ModelSpeed
: Array [A_STAND
..A_PAIN
] of Byte;
156 WeaponPoints
: TWeaponPoints
;
157 PainSounds
: TModelSoundArray
;
158 DieSounds
: TModelSoundArray
;
163 // =======================
165 Anim
: TModelTextures
;
175 PlayerModelsArray
: Array of TPlayerModelInfo
;
183 g_sound
, g_console
, SysUtils
, g_player
, CONFIG
,
184 e_sound
, g_options
, g_map
, Math
, e_log
, wadreader
188 FLAG_DEFPOINT
: TDFPoint
= (X
:32; Y
:16);
190 WEAPONBASE
: Array [WP_FIRST
+ 1..WP_LAST
] of TDFPoint
=
191 ((X
:8; Y
:4), (X
:8; Y
:8), (X
:16; Y
:16), (X
:16; Y
:24),
192 (X
:16; Y
:16), (X
:24; Y
:24), (X
:16; Y
:16), (X
:24; Y
:24),
193 (X
:16; Y
:16), (X
:8; Y
:8));
195 AnimNames
: Array [A_STAND
..A_LASTEXT
] of String =
196 ('StandAnim','WalkAnim','Die1Anim','Die2Anim','AttackAnim',
197 'SeeUpAnim','SeeDownAnim','AttackUpAnim','AttackDownAnim','PainAnim',
199 'WalkAttackAnim', 'WalkSeeUpAnim', 'WalkSeeDownAnim',
200 'WalkAttackUpAnim', 'WalkAttackDownAnim', 'FistStandAnim', 'FistWalkAnim',
201 'FistAttackAnim', 'FistWalkAttackAnim', 'FistSeeUpAnim', 'FistSeeDownAnim',
202 'FistAttackUpAnim', 'FistAttackDownAnim');
203 WeapNames
: Array [WP_FIRST
+ 1..WP_LAST
] of String =
204 ('csaw', 'hgun', 'sg', 'ssg', 'mgun', 'rkt', 'plz', 'bfg', 'spl', 'flm');
206 function g_PlayerModel_GetIndex (ModelName
: String): Integer;
210 if PlayerModelsArray
<> nil then
213 while (i
< Length(PlayerModelsArray
)) and (PlayerModelsArray
[i
].Name
<> ModelName
) do
215 if i
< Length(PlayerModelsArray
) then
220 function GetPoint(var str
: String; var point
: TDFPoint
): Boolean;
230 if Length(str
) < 3 then
233 for a
:= 1 to Length(str
) do
234 if (str
[a
] = ',') or (a
= Length(str
)) then
236 s
:= Copy(str
, 1, a
);
237 if s
[Length(s
)] = ',' then
238 SetLength(s
, Length(s
)-1);
241 if (Sscanf(s
, '%d:%d', [@x
, @y
]) < 2) or
242 (x
< -64) or (x
> 128) or
243 (y
< -64) or (y
> 128) then
255 function GetWeapPoints(str
: String; weapon
: Byte; anim
: Byte; dir
: TDirection
;
256 frames
: Word; backanim
: Boolean; var wpoints
: TWeaponPoints
): Boolean;
265 backanim
:= backanim
and (frames
> 2);
267 for a
:= 1 to frames
do
269 if not GetPoint(str
, wpoints
[weapon
, anim
, dir
, a
-1]) then
272 with wpoints
[weapon
, anim
, dir
, a
-1] do
274 X
:= X
- WEAPONBASE
[weapon
].X
;
275 Y
:= Y
- WEAPONBASE
[weapon
].Y
;
276 if dir
= TDirection
.D_LEFT
then
281 h
:= High(wpoints
[weapon
, anim
, dir
]);
283 for b
:= h
downto frames
do
284 wpoints
[weapon
, anim
, dir
, b
] := wpoints
[weapon
, anim
, dir
, h
-b
+1];
289 procedure g_PlayerMode_ExtendPoints (id
: Integer; AIdx
: Integer);
291 CopyAnim
: array [A_LASTBASE
+1..A_LASTEXT
] of Integer = (
292 A_WALK
, A_WALK
, A_WALK
, A_WALK
, A_WALK
,
293 A_STAND
, A_WALK
, A_ATTACK
, A_WALK
, A_SEEUP
, A_SEEDOWN
,
294 A_ATTACKUP
, A_ATTACKDOWN
296 var W
, I
, OIdx
: Integer; D
: TDirection
;
298 OIdx
:= CopyAnim
[AIdx
];
299 with PlayerModelsArray
[id
] do
301 for W
:= WP_FIRST
+ 1 to WP_LAST
do
303 for D
:= TDirection
.D_LEFT
to TDirection
.D_RIGHT
do
305 SetLength(WeaponPoints
[W
, AIdx
, D
], Length(WeaponPoints
[W
, OIdx
, D
]));
306 for I
:= 0 to High(WeaponPoints
[W
, AIdx
, D
]) do
307 WeaponPoints
[W
, AIdx
, D
, I
] := WeaponPoints
[W
, OIdx
, D
, I
]
313 procedure g_PlayerModel_LoadFake (ModelName
, FileName
: String);
316 SetLength(PlayerModelsArray
, Length(PlayerModelsArray
) + 1);
317 id
:= High(PlayerModelsArray
);
318 PlayerModelsArray
[id
].Name
:= ModelName
;
319 PlayerModelsArray
[id
].HaveWeapon
:= False;
320 PlayerModelsArray
[id
].FileName
:= FileName
;
323 function g_PlayerModel_Load(FileName
: string): Boolean;
326 a
, b
, len
, aa
, bb
, f
: Integer;
333 ok
, chk
, chk2
: Boolean;
335 e_WriteLog(Format('Loading player model "%s"...', [FileName
]), TMsgType
.Notify
);
339 WAD
:= TWADFile
.Create
;
340 WAD
.ReadFile(FileName
);
342 if {WAD.GetLastError <> DFWAD_NOERROR} not WAD
.isOpen
then
348 if not WAD
.GetResource('TEXT/MODEL', pData
, len
) then
354 config
:= TConfig
.CreateMem(pData
, len
);
357 s
:= config
.ReadStr('Model', 'name', '');
365 SetLength(PlayerModelsArray
, Length(PlayerModelsArray
)+1);
366 ID
:= High(PlayerModelsArray
);
368 prefix
:= FileName
+':TEXTURES\';
370 PlayerModelsArray
[ID
].Name
:= s
;
371 PlayerModelsArray
[ID
].Author
:= config
.ReadStr('Model', 'author', '');
372 PlayerModelsArray
[ID
].Description
:= config
.ReadStr('Model', 'description', '');
373 PlayerModelsArray
[ID
].FileName
:= FileName
;
376 with PlayerModelsArray
[ID
] do
378 Blood
.R
:= MAX(0, MIN(255, config
.ReadInt('Blood', 'R', 150)));
379 Blood
.G
:= MAX(0, MIN(255, config
.ReadInt('Blood', 'G', 0)));
380 Blood
.B
:= MAX(0, MIN(255, config
.ReadInt('Blood', 'B', 0)));
381 case config
.ReadStr('Blood', 'Kind', 'NORMAL') of
382 'NORMAL': Blood
.Kind
:= BLOOD_NORMAL
;
383 'SPARKS': Blood
.Kind
:= BLOOD_CSPARKS
;
384 'COMBINE': Blood
.Kind
:= BLOOD_COMBINE
;
386 Blood
.Kind
:= BLOOD_NORMAL
391 for b
:= A_STAND
to A_LAST
do
393 with PlayerModelsArray
[ID
].Anim
[TDirection
.D_RIGHT
, b
] do
395 Resource
:= config
.ReadStr(AnimNames
[b
], 'resource', '');
396 Mask
:= config
.ReadStr(AnimNames
[b
], 'mask', '');
397 Frames
:= config
.ReadInt(AnimNames
[b
], 'frames', 1);
398 Back
:= config
.ReadBool(AnimNames
[b
], 'backanim', False);
399 if (Resource
= '') or (Mask
= '') then
401 if b
<= A_LASTBASE
then
409 g_PlayerMode_ExtendPoints(ID
, b
);
415 for aa
:= WP_FIRST
+ 1 to WP_LAST
do
416 for bb
:= A_STAND
to A_LAST
do
417 for cc
:= TDirection
.D_LEFT
to TDirection
.D_RIGHT
do
419 f
:= PlayerModelsArray
[ID
].Anim
[cc
, bb
].Frames
;
420 if PlayerModelsArray
[ID
].Anim
[cc
, bb
].Back
and (f
> 2) then
422 SetLength(PlayerModelsArray
[ID
].WeaponPoints
[aa
, bb
, cc
], f
);
425 with PlayerModelsArray
[ID
].Anim
[TDirection
.D_LEFT
, b
] do
427 Frames
:= PlayerModelsArray
[ID
].Anim
[TDirection
.D_RIGHT
, b
].Frames
;
428 Back
:= PlayerModelsArray
[ID
].Anim
[TDirection
.D_RIGHT
, b
].Back
;
431 PlayerModelsArray
[ID
].ModelSpeed
[b
] := Max(1, config
.ReadInt(AnimNames
[b
], 'waitcount', 1) div 3);
434 with PlayerModelsArray
[ID
], config
do
436 prefix
:= FileName
+':SOUNDS\';
440 s
:= config
.ReadStr('Sound', 'pain'+IntToStr(a
), '');
443 SetLength(PainSounds
, Length(PainSounds
)+1);
444 g_Sound_CreateWAD(PainSounds
[High(PainSounds
)].ID
, prefix
+s
);
445 PainSounds
[High(PainSounds
)].Level
:= config
.ReadInt('Sound', 'painlevel'+IntToStr(a
), 1);
452 s
:= config
.ReadStr('Sound', 'die'+IntToStr(a
), '');
455 SetLength(DieSounds
, Length(DieSounds
)+1);
456 g_Sound_CreateWAD(DieSounds
[High(DieSounds
)].ID
, prefix
+s
);
457 DieSounds
[High(DieSounds
)].Level
:= config
.ReadInt('Sound', 'dielevel'+IntToStr(a
), 1);
462 SlopSound
:= Min(Max(config
.ReadInt('Sound', 'slop', 0), 0), 2);
465 GibsCount
:= config
.ReadInt('Gibs', 'count', 0);
466 GibsResource
:= config
.ReadStr('Gibs', 'resource', 'GIBS');
467 GibsMask
:= config
.ReadStr('Gibs', 'mask', 'GIBSMASK');
468 GibsOnce
:= config
.ReadInt('Gibs', 'once', -1);
472 for aa
:= WP_FIRST
+ 1 to WP_LAST
do
473 for bb
:= A_STAND
to A_LAST
do
474 if not (bb
in [A_DIE1
, A_DIE2
, A_PAIN
]) then
476 chk
:= GetWeapPoints(
477 config
.ReadStr(AnimNames
[bb
], WeapNames
[aa
] + '_points', ''),
481 Anim
[TDirection
.D_RIGHT
, bb
].Frames
,
482 Anim
[TDirection
.D_RIGHT
, bb
].Back
,
485 if ok
and (not chk
) and (aa
= WEAPON_FLAMETHROWER
) then
487 // workaround for flamethrower
488 chk
:= GetWeapPoints(
489 config
.ReadStr(AnimNames
[bb
], WeapNames
[WEAPON_PLASMA
] + '_points', ''),
493 Anim
[TDirection
.D_RIGHT
, bb
].Frames
,
494 Anim
[TDirection
.D_RIGHT
, bb
].Back
,
498 for f
:= 0 to High(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
]) do
503 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 6);
504 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 8);
506 A_WALKATTACK
, A_WALK
:
508 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 9);
509 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 9);
513 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 5);
514 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 8);
516 A_WALKSEEUP
, A_SEEUP
:
518 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 5);
519 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 16);
521 A_WALKSEEDOWN
, A_SEEDOWN
:
523 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 6);
524 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 5);
526 A_WALKATTACKUP
, A_ATTACKUP
:
528 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 5);
529 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 16);
531 A_WALKATTACKDOWN
, A_ATTACKDOWN
:
533 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
, 6);
534 Dec(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
, 4);
540 ok
:= ok
and (chk
or (bb
> A_LASTBASE
));
542 chk2
:= GetWeapPoints(
543 config
.ReadStr(AnimNames
[bb
], WeapNames
[aa
] + '2_points', ''),
547 Anim
[TDirection
.D_LEFT
, bb
].Frames
,
548 Anim
[TDirection
.D_LEFT
, bb
].Back
,
553 for f
:= 0 to High(WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
]) do
555 WeaponPoints
[aa
, bb
, TDirection
.D_LEFT
, f
].X
:= -WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].X
;
556 WeaponPoints
[aa
, bb
, TDirection
.D_LEFT
, f
].Y
:= WeaponPoints
[aa
, bb
, TDirection
.D_RIGHT
, f
].Y
;
560 if not ok
then Break
;
562 {if ok then g_Console_Add(Info.Name+' weapon points ok')
563 else g_Console_Add(Info.Name+' weapon points fail');}
564 PlayerModelsArray
[ID
].HaveWeapon
:= ok
;
566 s
:= config
.ReadStr('Model', 'flag_point', '');
567 if not GetPoint(s
, FlagPoint
) then
568 FlagPoint
:= FLAG_DEFPOINT
;
570 FlagAngle
:= config
.ReadInt('Model', 'flag_angle', FLAG_DEFANGLE
);
579 function g_PlayerModel_Get (ModelName
: String): TPlayerModel
;
584 if PlayerModelsArray
= nil then Exit
;
586 for a
:= 0 to High(PlayerModelsArray
) do
588 if AnsiLowerCase(PlayerModelsArray
[a
].Name
) = AnsiLowerCase(ModelName
) then
590 Result
:= TPlayerModel
.Create
;
592 with PlayerModelsArray
[a
] do
595 Result
.ChangeAnimation(A_STAND
, True);
602 function g_PlayerModel_GetNames(): SSArray
;
608 if PlayerModelsArray
= nil then Exit
;
610 for i
:= 0 to High(PlayerModelsArray
) do
612 SetLength(Result
, Length(Result
)+1);
613 Result
[High(Result
)] := PlayerModelsArray
[i
].Name
;
618 function g_PlayerModel_GetBlood(ModelName
: string): TModelBlood
;
625 Result
.Kind
:= BLOOD_NORMAL
;
626 if PlayerModelsArray
= nil then Exit
;
628 for a
:= 0 to High(PlayerModelsArray
) do
629 if PlayerModelsArray
[a
].Name
= ModelName
then
631 Result
:= PlayerModelsArray
[a
].Blood
;
637 procedure g_PlayerModel_FreeData();
640 e_WriteLog('Releasing models...', TMsgType
.Notify
);
642 if PlayerModelsArray
= nil then Exit
;
644 for i
:= 0 to High(PlayerModelsArray
) do
646 with PlayerModelsArray
[i
] do
648 if PainSounds
<> nil then
649 for b
:= 0 to High(PainSounds
) do
650 e_DeleteSound(PainSounds
[b
].ID
);
651 if DieSounds
<> nil then
652 for b
:= 0 to High(DieSounds
) do
653 e_DeleteSound(DieSounds
[b
].ID
);
656 PlayerModelsArray
:= nil;
661 procedure TPlayerModel
.ChangeAnimation (Animation
: Byte; Force
: Boolean = False);
662 var once
: Boolean; speed
, count
: Integer;
665 if FCurrentAnimation
= Animation
then
667 FCurrentAnimation
:= Animation
;
668 once
:= FCurrentAnimation
in [A_STAND
, A_WALK
];
669 speed
:= PlayerModelsArray
[FID
].ModelSpeed
[FCurrentAnimation
];
670 count
:= PlayerModelsArray
[FID
].Anim
[FDirection
, FCurrentAnimation
].Frames
;
671 FAnimState
:= TAnimationState
.Create(once
, speed
, count
);
674 destructor TPlayerModel
.Destroy();
680 function TPlayerModel
.PlaySound(SoundType
, Level
: Byte; X
, Y
: Integer): Boolean;
682 TempArray
: array of DWORD
;
686 SetLength(TempArray
, 0);
688 if SoundType
= MODELSOUND_PAIN
then
690 if PlayerModelsArray
[FID
].PainSounds
= nil then Exit
;
692 for a
:= 0 to High(PlayerModelsArray
[FID
].PainSounds
) do
693 if PlayerModelsArray
[FID
].PainSounds
[a
].Level
= Level
then
695 SetLength(TempArray
, Length(TempArray
) + 1);
696 TempArray
[High(TempArray
)] := PlayerModelsArray
[FID
].PainSounds
[a
].ID
;
701 if (Level
in [2, 3, 5]) and (PlayerModelsArray
[FID
].SlopSound
> 0) then
703 g_Sound_PlayExAt('SOUND_MONSTER_SLOP', X
, Y
);
704 if PlayerModelsArray
[FID
].SlopSound
= 1 then
710 if PlayerModelsArray
[FID
].DieSounds
= nil then Exit
;
712 for a
:= 0 to High(PlayerModelsArray
[FID
].DieSounds
) do
713 if PlayerModelsArray
[FID
].DieSounds
[a
].Level
= Level
then
715 SetLength(TempArray
, Length(TempArray
) + 1);
716 TempArray
[High(TempArray
)] := PlayerModelsArray
[FID
].DieSounds
[a
].ID
;
718 if (TempArray
= nil) and (Level
= 5) then
720 g_Sound_PlayExAt('SOUND_MONSTER_SLOP', X
, Y
);
726 if TempArray
= nil then Exit
;
728 g_Sound_PlayAt(TempArray
[Random(Length(TempArray
))], X
, Y
);
733 procedure TPlayerModel
.SetColor(Red
, Green
, Blue
: Byte);
740 procedure TPlayerModel
.SetFire (Fire
: Boolean);
743 FFireCounter
:= PlayerModelsArray
[FID
].ModelSpeed
[A_ATTACK
] * PlayerModelsArray
[FID
].Anim
[TDirection
.D_RIGHT
, A_ATTACK
].Frames
+ 1
748 function TPlayerModel
.GetFire (): Boolean;
750 Result
:= FFireCounter
> 0
753 procedure TPlayerModel
.SetFlag (Flag
: Byte);
758 procedure TPlayerModel
.SetWeapon (Weapon
: Byte);
760 FCurrentWeapon
:= Weapon
764 function TPlayerModel
.GetBlood (): TModelBlood
;
766 Result
:= PlayerModelsArray
[FID
].Blood
770 function TPlayerModel
.GetName (): String;
772 Result
:= PlayerModelsArray
[FID
].Name
775 procedure TPlayerModel
.Update
;
777 if FAnimState
<> nil then
779 if FFireCounter
> 0 then
783 procedure g_PlayerModel_LoadAll
;
786 knownFiles
: array of AnsiString = nil;
791 // load models from all possible wad types, in all known directories
792 // this does a loosy job (linear search, ooph!), but meh
793 for wext
in wadExtensions
do
795 for f
:= High(ModelDirs
) downto Low(ModelDirs
) do
797 if (FindFirst(ModelDirs
[f
]+DirectorySeparator
+'*'+wext
, faAnyFile
, SR
) = 0) then
801 for s
in knownFiles
do
803 if (strEquCI1251(forceFilenameExt(SR
.Name
, ''), forceFilenameExt(ExtractFileName(s
), ''))) then
811 SetLength(knownFiles
, length(knownFiles
)+1);
812 knownFiles
[High(knownFiles
)] := ModelDirs
[f
]+DirectorySeparator
+SR
.Name
;
814 until (FindNext(SR
) <> 0);
819 if (length(knownFiles
) = 0) then
820 raise Exception
.Create('no player models found!');
821 if (length(knownFiles
) = 1) then
822 e_LogWriteln('1 player model found.', TMsgType
.Notify
)
824 e_LogWritefln('%d player models found.', [Integer(length(knownFiles
))], TMsgType
.Notify
);
825 for s
in knownFiles
do
826 if not g_PlayerModel_Load(s
) then
827 e_LogWritefln('Error loading model "%s"', [s
], TMsgType
.Warning
);