hedgewars/uCaptions.pas
branchwebgl
changeset 8096 453917e94e55
parent 8026 4a4f21070479
parent 8027 e5ba3dd12531
child 9127 e350500c4edb
equal deleted inserted replaced
8053:2e836bebb518 8096:453917e94e55
    28 procedure ReloadCaptions(unload: boolean);
    28 procedure ReloadCaptions(unload: boolean);
    29 
    29 
    30 procedure initModule;
    30 procedure initModule;
    31 procedure freeModule;
    31 procedure freeModule;
    32 
    32 
       
    33 implementation
       
    34 uses uTextures, uRenderUtils, uVariables, uRender;
    33 
    35 
    34 type TCaptionStr = record
    36 type TCaptionStr = record
    35     Tex: PTexture;
    37     Tex: PTexture;
    36     EndTime: LongWord;
    38     EndTime: LongWord;
    37     Text: shortstring;
    39     Text: shortstring;
    38     Color: Longword
    40     Color: Longword
    39     end;
    41     end;
    40 var
    42 var
    41     Captions: array[TCapGroup] of TCaptionStr;
    43     Captions: array[TCapGroup] of TCaptionStr;
    42 
    44 
    43 implementation
       
    44 uses uTextures, uRenderUtils, uVariables, uRender;
       
    45 
       
    46 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
    45 procedure AddCaption(s: shortstring; Color: Longword; Group: TCapGroup);
    47 begin
    46 begin
       
    47     if cOnlyStats then exit;
    48     if Length(s) = 0 then
    48     if Length(s) = 0 then
    49         exit;
    49         exit;
    50     if Captions[Group].Text <> s then
    50     if Captions[Group].Text <> s then
    51         begin
    51         begin
    52         FreeTexture(Captions[Group].Tex);
    52         FreeTexture(Captions[Group].Tex);