Ignore:
Timestamp:
Apr 26, 2008, 10:41:43 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Step 2 of the code reorganisation: move each font to its corresponding decoder's subdirectory.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pwntcha/trunk/src/font.c

    r2315 r2318  
    1818#include "common.h"
    1919
    20 struct font *font_load_fixed(char *file, char *chars)
     20struct font *font_load_fixed(char const *decoder, char const *file,
     21                             char const *chars)
    2122{
    2223    char fontname[BUFSIZ];
     
    2526    int i;
    2627
    27     sprintf(fontname, "%s/%s", share, file);
     28    sprintf(fontname, "src/%s/%s", decoder, file);
    2829    img = image_load(fontname);
     30    if(!img)
     31    {
     32        sprintf(fontname, "%s/%s/%s", share, decoder, file);
     33        img = image_load(fontname);
     34    }
    2935    if(!img)
    3036    {
     
    5157}
    5258
    53 struct font *font_load_variable(char *file, char *chars)
     59struct font *font_load_variable(char const *decoder, char const *file,
     60                                char const *chars)
    5461{
    5562    char fontname[BUFSIZ];
     
    6067    int r, g, b;
    6168
    62     sprintf(fontname, "%s/%s", share, file);
     69    sprintf(fontname, "src/%s/%s", decoder, file);
    6370    img = image_load(fontname);
     71    if(!img)
     72    {
     73        sprintf(fontname, "%s/%s/%s", share, decoder, file);
     74        img = image_load(fontname);
     75    }
    6476    if(!img)
    6577    {
Note: See TracChangeset for help on using the changeset viewer.