hedgewars/uCaptions.pas
changeset 6394 f0a9042e7387
parent 6383 c34a8b98d78c
child 6415 af2047bb4f70
equal deleted inserted replaced
6393:701eb3f3556a 6394:f0a9042e7387
    23 interface
    23 interface
    24 uses uTypes;
    24 uses uTypes;
    25 
    25 
    26 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
    26 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
    27 procedure DrawCaptions;
    27 procedure DrawCaptions;
    28 procedure ReloadCaptions;
    28 procedure ReloadCaptions(unload: boolean);
    29 
    29 
    30 procedure initModule;
    30 procedure initModule;
    31 procedure freeModule;
    31 procedure freeModule;
    32 
    32 
    33 implementation
    33 implementation
    63         Captions[Group].EndTime:= RealTicks + 1400 + LongWord(Captions[Group].Tex^.w) * 3;
    63         Captions[Group].EndTime:= RealTicks + 1400 + LongWord(Captions[Group].Tex^.w) * 3;
    64     end;
    64     end;
    65 end;
    65 end;
    66 
    66 
    67 // For uStore texture recreation
    67 // For uStore texture recreation
    68 procedure ReloadCaptions;
    68 procedure ReloadCaptions(unload: boolean);
    69 var Group: TCapGroup;
    69 var Group: TCapGroup;
    70 begin
    70 begin
    71 for Group:= Low(TCapGroup) to High(TCapGroup) do
    71 for Group:= Low(TCapGroup) to High(TCapGroup) do
    72     begin
    72     if unload then FreeTexture(Captions[Group].Tex)
    73     FreeTexture(Captions[Group].Tex);
    73     else if Captions[Group].Text <> '' then
    74     if Captions[Group].Text <> '' then
       
    75         Captions[Group].Tex:= RenderStringTex(Captions[Group].Text, Captions[Group].Color, fntBig)
    74         Captions[Group].Tex:= RenderStringTex(Captions[Group].Text, Captions[Group].Color, fntBig)
    76     end
       
    77 end;
    75 end;
    78 
    76 
    79 procedure DrawCaptions;
    77 procedure DrawCaptions;
    80 var
    78 var
    81     grp: TCapGroup;
    79     grp: TCapGroup;