Changeset 329
- Timestamp:
- Mar 25, 2021, 3:30:05 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r328 r329 22 22 TPaintLocTempStyle = (pltsNormal, pltsBlink); 23 23 TTileSize = (tsSmall, tsMedium, tsBig); 24 25 TSoundBlock = (sbStart, sbWonder, sbScience, sbContact, sbTurn); 26 TSoundBlocks = set of TSoundBlock; 24 27 25 28 { TMainScreen } … … 315 318 procedure OnScroll(var m: TMessage); message WM_VSCROLL; 316 319 procedure OnEOT(var Msg: TMessage); message WM_EOT; 317 procedure SoundPreload(Check: integer);320 procedure SoundPreload(Check: TSoundBlocks); 318 321 procedure UpdateKeyShortcuts; 319 322 procedure SetFullScreen(Active: Boolean); … … 435 438 'CITY_INVALIDTYPE'); 436 439 437 // sound blocks for preload438 sbStart = $01;439 sbWonder = $02;440 sbScience = $04;441 sbContact = $08;442 sbTurn = $10;443 sbAll = $FF;444 445 440 TileSizes: array [TTileSize] of TPoint = ((X: 33; Y: 16), (X: 48; Y: 24), 446 441 (X: 72; Y: 36)); … … 494 489 ScienceSum: Integer; 495 490 TaxSum: Integer; 496 SoundPreloadDone: Integer;491 SoundPreloadDone: TSoundBlocks; 497 492 MarkCityLoc: Integer; 498 493 HGrTerrain: TGraphicSet; … … 1362 1357 end; 1363 1358 1364 procedure TMainScreen.SoundPreload(Check: integer);1359 procedure TMainScreen.SoundPreload(Check: TSoundBlocks); 1365 1360 const 1366 1361 nStartBlock = 27; … … 1398 1393 mi: TModelInfo; 1399 1394 begin 1400 if Check and sbStart and not SoundPreloadDone <> 0 then 1401 begin 1395 if (sbStart in Check) and not (sbStart in SoundPreloadDone) then begin 1402 1396 for i := 0 to nStartBlock - 1 do 1403 1397 PreparePlay(StartBlock[i]); 1404 SoundPreloadDone := SoundPreloadDone or sbStart; 1405 end; 1406 if Check and sbWonder and not SoundPreloadDone <> 0 then 1407 begin 1398 SoundPreloadDone := SoundPreloadDone + [sbStart]; 1399 end; 1400 if (sbWonder in Check) and not (sbWonder in SoundPreloadDone) then begin 1408 1401 need := false; 1409 1402 for i := 0 to nWonder - 1 do 1410 1403 if MyRO.Wonder[i].CityID <> WonderNotBuiltYet then 1411 1404 need := true; 1412 if need then 1413 begin 1405 if need then begin 1414 1406 for i := 0 to nWonderBlock - 1 do 1415 1407 PreparePlay(WonderBlock[i]); 1416 SoundPreloadDone := SoundPreloadDone or sbWonder;1408 SoundPreloadDone := SoundPreloadDone + [sbWonder]; 1417 1409 end; 1418 1410 end; 1419 if (Check and sbScience and not SoundPreloadDone <> 0) and 1420 (MyRO.Tech[adScience] >= tsApplicable) then 1421 begin 1411 if ((sbScience in Check) and not (sbScience in SoundPreloadDone)) and 1412 (MyRO.Tech[adScience] >= tsApplicable) then begin 1422 1413 for i := 0 to nScienceBlock - 1 do 1423 1414 PreparePlay(ScienceBlock[i]); 1424 SoundPreloadDone := SoundPreloadDone or sbScience; 1425 end; 1426 if (Check and sbContact and not SoundPreloadDone <> 0) and 1427 (MyRO.nEnemyModel + MyRO.nEnemyCity > 0) then 1428 begin 1415 SoundPreloadDone := SoundPreloadDone + [sbScience]; 1416 end; 1417 if ((sbContact in Check) and not (sbContact in SoundPreloadDone)) and 1418 (MyRO.nEnemyModel + MyRO.nEnemyCity > 0) then begin 1429 1419 for i := 0 to nContactBlock - 1 do 1430 1420 PreparePlay(ContactBlock[i]); 1431 SoundPreloadDone := SoundPreloadDone or sbContact; 1432 end; 1433 if Check and sbTurn <> 0 then 1434 begin 1421 SoundPreloadDone := SoundPreloadDone + [sbContact]; 1422 end; 1423 if sbTurn in Check then begin 1435 1424 if MyRO.Happened and phShipComplete <> 0 then 1436 1425 PreparePlay('MSG_YOUWIN'); … … 1659 1648 SmallImp.PixelFormat := pf24bit; 1660 1649 InitSmallImp; 1661 SoundPreloadDone := 0;1650 SoundPreloadDone := []; 1662 1651 StartRunning := false; 1663 1652 StayOnTop_Ensured := false; … … 1681 1670 Icon: imRecycling), (Adv: adComputers; Icon: imResLab), 1682 1671 (Adv: adSpaceFlight; Icon: woMIR)); 1672 sbAll = [sbStart, sbWonder, sbScience, sbContact, sbTurn]; 1683 1673 var 1684 1674 p1, i, ad, uix, cix, MoveOptions, MoveResult, Loc1, … … 2618 2608 FillChar(ToldTech, SizeOf(ToldTech), Byte(tsNA)); 2619 2609 if G.Difficulty[p1] > 0 then 2620 SoundPreload( sbStart);2610 SoundPreload([sbStart]); 2621 2611 end; 2622 2612
Note:
See TracChangeset
for help on using the changeset viewer.