266 TTF_SetFontStyle(Handle, style); |
266 TTF_SetFontStyle(Handle, style); |
267 WriteLnToConsole(msgOK) |
267 WriteLnToConsole(msgOK) |
268 end; |
268 end; |
269 AddProgress; |
269 AddProgress; |
270 |
270 |
271 WriteToConsole('LandSurface tuning... '); |
|
272 tmpsurf:= LandSurface; |
|
273 TryDo(tmpsurf <> nil, msgFailed, true); |
|
274 if cFullScreen then |
|
275 begin |
|
276 LandSurface:= SDL_DisplayFormat(tmpsurf); |
|
277 SDL_FreeSurface(tmpsurf); |
|
278 end else LandSurface:= tmpsurf; |
|
279 TryDo(SDL_SetColorKey(LandSurface, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true); |
|
280 WriteLnToConsole(msgOK); |
|
281 |
|
282 GetExplosionBorderColor; |
271 GetExplosionBorderColor; |
283 |
272 |
284 AddProgress; |
273 AddProgress; |
285 WriteNames(fnt16); |
274 WriteNames(fnt16); |
286 MakeCrossHairs; |
275 MakeCrossHairs; |
289 AddProgress; |
278 AddProgress; |
290 for ii:= Low(TSprite) to High(TSprite) do |
279 for ii:= Low(TSprite) to High(TSprite) do |
291 with SpritesData[ii] do |
280 with SpritesData[ii] do |
292 begin |
281 begin |
293 if AltPath = ptNone then |
282 if AltPath = ptNone then |
294 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, hasAlpha, true, true) |
283 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, true, true, true) |
295 else begin |
284 else begin |
296 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, hasAlpha, false, true); |
285 tmpsurf:= LoadImage(Pathz[Path] + '/' + FileName, true, false, true); |
297 if tmpsurf = nil then |
286 if tmpsurf = nil then |
298 tmpsurf:= LoadImage(Pathz[AltPath] + '/' + FileName, hasAlpha, true, true) |
287 tmpsurf:= LoadImage(Pathz[AltPath] + '/' + FileName, true, true, true) |
299 end; |
288 end; |
300 if Width = 0 then Width:= tmpsurf^.w; |
289 if Width = 0 then Width:= tmpsurf^.w; |
301 if Height = 0 then Height:= tmpsurf^.h; |
290 if Height = 0 then Height:= tmpsurf^.h; |
302 Texture:= Surface2Tex(tmpsurf); |
291 Texture:= Surface2Tex(tmpsurf); |
303 SDL_FreeSurface(tmpsurf) |
292 if saveSurf then Surface:= tmpsurf else SDL_FreeSurface(tmpsurf) |
304 end; |
293 end; |
305 |
294 |
306 GetSkyColor; |
295 GetSkyColor; |
307 |
296 |
308 AddProgress; |
297 AddProgress; |
485 |
474 |
486 procedure StoreRelease; |
475 procedure StoreRelease; |
487 var ii: TSprite; |
476 var ii: TSprite; |
488 begin |
477 begin |
489 for ii:= Low(TSprite) to High(TSprite) do |
478 for ii:= Low(TSprite) to High(TSprite) do |
|
479 begin |
490 FreeTexture(SpritesData[ii].Texture); |
480 FreeTexture(SpritesData[ii].Texture); |
|
481 if SpritesData[ii].Surface <> nil then SDL_FreeSurface(SpritesData[ii].Surface) |
|
482 end; |
491 |
483 |
492 FreeTexture(HHTexture); |
484 FreeTexture(HHTexture); |
493 FreeTexture(LandTexture); |
485 FreeTexture(LandTexture); |
494 |
486 |
495 SDL_FreeSurface(LandSurface) |
487 SDL_FreeSurface(LandSurface) |