hedgewars/uRenderUtils.pas
branchqmlfrontend
changeset 11408 b894922d58cc
parent 11342 ed5a6478e710
child 11512 bd9a2f1b0080
equal deleted inserted replaced
11076:fcbdee9cdd74 11408:b894922d58cc
    97     clr.g:= (Color shr 8) and $FF;
    97     clr.g:= (Color shr 8) and $FF;
    98     clr.b:= Color and $FF;
    98     clr.b:= Color and $FF;
    99     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(s), clr);
    99     tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(s), clr);
   100     finalRect.x:= X + cFontBorder + 2;
   100     finalRect.x:= X + cFontBorder + 2;
   101     finalRect.y:= Y + cFontBorder;
   101     finalRect.y:= Y + cFontBorder;
   102     SDLTry(tmpsurf <> nil, true);
   102     SDLTry(tmpsurf <> nil, 'TTF_RenderUTF8_Blended', true);
   103     SDL_UpperBlit(tmpsurf, @textRect, Surface, @finalRect);
   103     SDL_UpperBlit(tmpsurf, @textRect, Surface, @finalRect);
   104     SDL_FreeSurface(tmpsurf);
   104     SDL_FreeSurface(tmpsurf);
   105     finalRect.x:= X;
   105     finalRect.x:= X;
   106     finalRect.y:= Y;
   106     finalRect.y:= Y;
   107     finalRect.w:= w + cFontBorder * 2 + 4;
   107     finalRect.w:= w + cFontBorder * 2 + 4;
   520         begin
   520         begin
   521         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(substr), cNearBlackColorChannels);
   521         tmpsurf:= TTF_RenderUTF8_Blended(Fontz[Font].Handle, PChar(substr), cNearBlackColorChannels);
   522         rect.x:= edgeHeight + 1 + ((i - w) div 2);
   522         rect.x:= edgeHeight + 1 + ((i - w) div 2);
   523         // trying to more evenly position the text, vertically
   523         // trying to more evenly position the text, vertically
   524         rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;
   524         rect.y:= edgeHeight + ((j-(numLines*h)) div 2) + line * h;
   525         SDLTry(tmpsurf <> nil, true);
   525         SDLTry(tmpsurf <> nil, 'TTF_Init', true);
   526         SDL_UpperBlit(tmpsurf, nil, finalSurface, @rect);
   526         SDL_UpperBlit(tmpsurf, nil, finalSurface, @rect);
   527         SDL_FreeSurface(tmpsurf);
   527         SDL_FreeSurface(tmpsurf);
   528         inc(line);
   528         inc(line);
   529         end;
   529         end;
   530 
   530