45 procedure AddHHPoint(_x, _y: integer); |
45 procedure AddHHPoint(_x, _y: integer); |
46 procedure GetHHPoint(out _x, _y: integer); |
46 procedure GetHHPoint(out _x, _y: integer); |
47 procedure RandomizeHHPoints; |
47 procedure RandomizeHHPoints; |
48 |
48 |
49 implementation |
49 implementation |
50 uses uConsole, uStore, uMisc, uConsts, uRandom, uTeams; |
50 uses uConsole, uStore, uMisc, uConsts, uRandom, uTeams, uIO; |
51 |
51 |
52 type TPixAr = record |
52 type TPixAr = record |
53 Count: Longword; |
53 Count: Longword; |
54 ar: array[word] of TPoint; |
54 ar: array[word] of TPoint; |
55 end; |
55 end; |
440 with PixelFormat^ do |
440 with PixelFormat^ do |
441 LandSurface:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, 0); |
441 LandSurface:= SDL_CreateRGBSurface(SDL_HWSURFACE, 2048, 1024, BitsPerPixel, RMask, GMask, BMask, 0); |
442 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'L.png'); |
442 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'L.png'); |
443 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf, LandSurface); |
443 BlitImageAndGenerateCollisionInfo(0, 0, tmpsurf, LandSurface); |
444 SDL_FreeSurface(tmpsurf); |
444 SDL_FreeSurface(tmpsurf); |
|
445 LoadFortPoints(p.FortName, false, TeamSize(p)); |
445 p:= p.Next; |
446 p:= p.Next; |
446 TryDo(p <> nil, 'Only one team on map!', true); |
447 TryDo(p <> nil, 'Only one team on map!', true); |
447 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'R.png'); |
448 tmpsurf:= LoadImage(Pathz[ptForts] + p.FortName + 'R.png'); |
448 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf, LandSurface); |
449 BlitImageAndGenerateCollisionInfo(1024, 0, tmpsurf, LandSurface); |
449 SDL_FreeSurface(tmpsurf); |
450 SDL_FreeSurface(tmpsurf); |
|
451 LoadFortPoints(p.FortName, true, TeamSize(p)); |
450 p:= p.Next; |
452 p:= p.Next; |
451 TryDo(p = nil, 'More than 2 teams on map in forts mode!', true); |
453 TryDo(p = nil, 'More than 2 teams on map in forts mode!', true); |
452 AddHHPoints |
|
453 end; |
454 end; |
454 |
455 |
455 procedure AddHHPoint(_x, _y: integer); |
456 procedure AddHHPoint(_x, _y: integer); |
456 begin |
457 begin |
457 with HHPoints do |
458 with HHPoints do |