Ignore:
Timestamp:
Jan 5, 2005, 1:18:49 AM (16 years ago)
Author:
Sam Hocevar
Message:
  • keep the font loaded across decodings.
File:
1 edited

Legend:

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

    r411 r421  
    1919#include "common.h"
    2020
     21static struct image *count_objects(struct image *img);
     22static struct image *rotate(struct image *img);
     23static struct image *cut_cells(struct image *img);
     24static struct image *find_glyphs(struct image *img);
     25
    2126/* Our macros */
    2227#define FACTOR 1
     
    2429//#define FONTNAME "share/font.png" // use with FACTOR = 2
    2530//#define FONTNAME "share/font_dilated.png" // use with FACTOR = 2
    26 
    27 static struct image *count_objects(struct image *img);
    28 static struct image *rotate(struct image *img);
    29 static struct image *cut_cells(struct image *img);
    30 static struct image *find_glyphs(struct image *img);
     31static struct image *font = NULL;
    3132
    3233/* Global stuff */
     
    238239    glyphs[22];
    239240    struct image *dst;
    240     struct image *font = image_load(FONTNAME);
    241241    int x, y, i = 0;
    242242    int r, g, b;
     
    246246    if(!font)
    247247    {
    248         fprintf(stderr, "cannot load font %s\n", FONTNAME);
    249         exit(-1);
     248        font = image_load(FONTNAME);
     249        if(!font)
     250        {
     251            fprintf(stderr, "cannot load font %s\n", FONTNAME);
     252            exit(-1);
     253        }
    250254    }
    251255
Note: See TracChangeset for help on using the changeset viewer.