24 uses SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat; |
24 uses SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat; |
25 |
25 |
26 procedure initModule; |
26 procedure initModule; |
27 procedure freeModule; |
27 procedure freeModule; |
28 |
28 |
|
29 procedure LoadFonts(); |
29 procedure StoreLoad(reload: boolean); |
30 procedure StoreLoad(reload: boolean); |
30 procedure StoreRelease(reload: boolean); |
31 procedure StoreRelease(reload: boolean); |
31 procedure RenderHealth(var Hedgehog: THedgehog); |
32 procedure RenderHealth(var Hedgehog: THedgehog); |
32 function makeHealthBarTexture(w, h, Color: Longword): PTexture; |
33 function makeHealthBarTexture(w, h, Color: Longword): PTexture; |
33 procedure AddProgress; |
34 procedure AddProgress; |
346 GraveTex:= Surface2Tex(texsurf, false); |
348 GraveTex:= Surface2Tex(texsurf, false); |
347 SDL_FreeSurface(texsurf) |
349 SDL_FreeSurface(texsurf) |
348 end |
350 end |
349 end; |
351 end; |
350 |
352 |
351 procedure StoreLoad(reload: boolean); |
353 procedure LoadFonts(); |
352 var s: shortstring; |
354 var s: shortstring; |
353 ii: TSprite; |
|
354 fi: THWFont; |
355 fi: THWFont; |
355 ai: TAmmoType; |
356 begin |
356 tmpsurf: PSDL_Surface; |
357 AddFileLog('LoadFonts();'); |
357 i, imflags: LongInt; |
358 |
358 begin |
359 if (not cOnlyStats) then |
359 AddFileLog('StoreLoad()'); |
|
360 |
|
361 if (not reload) and (not cOnlyStats) then |
|
362 for fi:= Low(THWFont) to High(THWFont) do |
360 for fi:= Low(THWFont) to High(THWFont) do |
363 with Fontz[fi] do |
361 with Fontz[fi] do |
364 begin |
362 begin |
365 s:= cPathz[ptFonts] + '/' + Name; |
363 s:= cPathz[ptFonts] + '/' + Name; |
366 WriteToConsole(msgLoading + s + ' (' + inttostr(Height) + 'pt)... '); |
364 WriteToConsole(msgLoading + s + ' (' + inttostr(Height) + 'pt)... '); |
367 Handle:= TTF_OpenFontRW(rwopsOpenRead(s), true, Height); |
365 Handle:= TTF_OpenFontRW(rwopsOpenRead(s), true, Height); |
368 if SDLCheck(Handle <> nil, 'TTF_OpenFontRW', true) then exit; |
366 if SDLCheck(Handle <> nil, 'TTF_OpenFontRW', true) then exit; |
369 TTF_SetFontStyle(Handle, style); |
367 TTF_SetFontStyle(Handle, style); |
370 WriteLnToConsole(msgOK) |
368 WriteLnToConsole(msgOK) |
371 end; |
369 end; |
|
370 end; |
|
371 |
|
372 procedure StoreLoad(reload: boolean); |
|
373 var s: shortstring; |
|
374 ii: TSprite; |
|
375 fi: THWFont; |
|
376 ai: TAmmoType; |
|
377 tmpsurf: PSDL_Surface; |
|
378 i, imflags: LongInt; |
|
379 begin |
|
380 AddFileLog('StoreLoad()'); |
372 |
381 |
373 if not cOnlyStats then |
382 if not cOnlyStats then |
374 begin |
383 begin |
375 MakeCrossHairs; |
384 MakeCrossHairs; |
376 LoadGraves; |
385 LoadGraves; |
772 WriteToConsole(msgLoading + 'progress sprite: '); |
781 WriteToConsole(msgLoading + 'progress sprite: '); |
773 texsurf:= LoadDataImage(ptGraphics, 'Progress', ifCritical or ifTransparent); |
782 texsurf:= LoadDataImage(ptGraphics, 'Progress', ifCritical or ifTransparent); |
774 |
783 |
775 ProgrTex:= Surface2Tex(texsurf, false); |
784 ProgrTex:= Surface2Tex(texsurf, false); |
776 |
785 |
|
786 LoadingText:= RenderStringTex(trmsg[sidLoading], $FFF39EE8, fntBig); |
|
787 |
777 squaresize:= texsurf^.w shr 1; |
788 squaresize:= texsurf^.w shr 1; |
778 numsquares:= texsurf^.h div squaresize; |
789 numsquares:= texsurf^.h div squaresize; |
779 SDL_FreeSurface(texsurf); |
790 SDL_FreeSurface(texsurf); |
|
791 |
780 {$IFNDEF PAS2C} |
792 {$IFNDEF PAS2C} |
781 with mobileRecord do |
793 with mobileRecord do |
782 if GameLoading <> nil then |
794 if GameLoading <> nil then |
783 GameLoading(); |
795 GameLoading(); |
784 {$ENDIF} |
796 {$ENDIF} |
808 {$IFNDEF PAS2C} |
821 {$IFNDEF PAS2C} |
809 with mobileRecord do |
822 with mobileRecord do |
810 if GameLoaded <> nil then |
823 if GameLoaded <> nil then |
811 GameLoaded(); |
824 GameLoaded(); |
812 {$ENDIF} |
825 {$ENDIF} |
813 WriteLnToConsole('Freeing progress surface... '); |
826 WriteLnToConsole('Freeing progress textures... '); |
814 FreeAndNilTexture(ProgrTex); |
827 FreeAndNilTexture(ProgrTex); |
|
828 FreeAndNilTexture(LoadingText); |
815 Step:= 0 |
829 Step:= 0 |
816 end; |
830 end; |
817 |
831 |
818 function RenderHelpWindow(caption, subcaption, description, extra: ansistring; extracolor: LongInt; iconsurf: PSDL_Surface; iconrect: PSDL_Rect): PTexture; |
832 function RenderHelpWindow(caption, subcaption, description, extra: ansistring; extracolor: LongInt; iconsurf: PSDL_Surface; iconrect: PSDL_Rect): PTexture; |
819 var tmpsurf: PSDL_SURFACE; |
833 var tmpsurf: PSDL_SURFACE; |