Changeset 55
- Timestamp:
- Jan 12, 2017, 9:52:50 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 17 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI.ai.txt
r44 r55 5 5 #PATH_WIN32 StdAI-win32.dll 6 6 #PATH_WIN64 StdAI-win64.dll 7 #PATH_LINUX32 libstdai- linux32.so8 #PATH_LINUX64 libstdai- linux64.so7 #PATH_LINUX32 libstdai-i386.so 8 #PATH_LINUX64 libstdai-amd64.so 9 9 #CREDITS Standard AI by Steffen Gerlach. -
trunk/Integrated.lpi
r52 r55 15 15 <UseAppBundle Value="False"/> 16 16 <ResourceType Value="res"/> 17 <Icon Value="0"/> 17 18 </General> 18 19 <i18n> … … 46 47 <CodeGeneration> 47 48 <SmartLinkUnit Value="True"/> 48 <TargetCPU Value="i386"/>49 <TargetOS Value="win32"/>50 49 <Optimizations> 51 50 <OptimizationLevel Value="3"/> -
trunk/Integrated.lpr
r38 r55 52 52 {$ENDIF} 53 53 54 {$R *.res} 55 54 56 begin 55 57 {$IFDEF DEBUG} -
trunk/LocalPlayer/Help.pas
r53 r55 437 437 HelpLineInfo: THelpLineInfo; 438 438 begin 439 MainText.SaveToFile('MainText.txt');440 439 inherited; 441 440 CaptionColor := Colors.Canvas.Pixels[clkMisc, cliPaperCaption]; -
trunk/Sound.pas
r21 r55 4 4 5 5 uses 6 Messages, SysUtils, Classes, Graphics, Controls, Forms {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF}; 6 Messages, SysUtils, Classes, Graphics, Controls, Forms, fgl 7 {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF}; 7 8 8 9 function PrepareSound(FileName: string): integer; … … 92 93 end; 93 94 94 type95 TSoundList = array [0 .. 99999] of TSound;96 95 97 96 var 98 nSoundList: integer;99 97 SoundPlayer: TSoundPlayer; 100 SoundList: ^TSoundList;98 SoundList: TFPGObjectList<TSound>; 101 99 PlayingSound: TSound; 102 100 … … 114 112 function PrepareSound(FileName: string): integer; 115 113 begin 116 for result := 1 to Length(FileName) do 117 FileName[result] := upcase(FileName[result]); 118 result := 0; 119 while (result < nSoundList) and (SoundList[result].FFileName <> FileName) do 114 Result := 0; 115 while (result < SoundList.Count) and (SoundList[result].FFileName <> FileName) do 120 116 inc(result); 121 if result = nSoundList then 122 begin // first time this sound is played 123 if nSoundList = 0 then 124 ReallocMem(SoundList, 16 * 4) 125 else if (nSoundList >= 16) and (nSoundList and (nSoundList - 1) = 0) then 126 ReallocMem(SoundList, nSoundList * (2 * 4)); 127 inc(nSoundList); 128 SoundList[result] := TSound.Create(FileName); 117 if result = SoundList.Count then begin 118 // first time this sound is played 119 SoundList.Add(TSound.Create(FileName)); 120 Result := SoundList.Count - 1; 129 121 end; 130 122 end; … … 146 138 i: integer; 147 139 140 procedure UnitInit; 141 begin 142 SoundList := TFPGObjectList<TSound>.Create; 143 PlayingSound := nil; 144 SoundPlayer := nil; 145 end; 146 147 procedure UnitDone; 148 begin 149 if PlayingSound <> nil then begin 150 PlayingSound.Stop; 151 Sleep(222); 152 end; 153 FreeAndNil(SoundList); 154 end; 155 148 156 initialization 149 157 150 nSoundList := 0; 151 SoundList := nil; 152 PlayingSound := nil; 153 SoundPlayer := nil; 158 UnitInit; 154 159 155 160 finalization 156 161 157 if PlayingSound <> nil then 158 begin 159 PlayingSound.Stop; 160 Sleep(222); 161 end; 162 for i := 0 to nSoundList - 1 do 163 SoundList[i].Free; 164 ReallocMem(SoundList, 0); 162 UnitDone; 165 163 166 164 end.
Note:
See TracChangeset
for help on using the changeset viewer.