From 3e36407e7ae15d19bd859cca3b6be45ea9b631a7 Mon Sep 17 00:00:00 2001 From: Albert Cahalan Date: Wed, 19 Jan 2005 23:32:36 +0000 Subject: [PATCH] use bitfields to save space --- src/tuxpaint.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 53454d644..3722ee13c 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -498,22 +498,6 @@ static TTF_Font *BUGFIX_TTF_OpenFont206(const char * const file, int ptsize) ) #endif -typedef struct info_type { - double ratio; - unsigned tinter; - int colorable; - int tintable; - int mirrorable; - int flipable; -} info_type; - - -typedef struct state_type { - int mirrored; - int flipped; - unsigned min,size,max; -} state_type; - enum { SAVE_OVER_PROMPT, @@ -2064,6 +2048,24 @@ static void groupfonts(void) static int num_brushes, num_brushes_max; static SDL_Surface **img_brushes; +typedef struct info_type { + double ratio; + unsigned tinter : 3; + unsigned colorable : 1; + unsigned tintable : 1; + unsigned mirrorable : 1; + unsigned flipable : 1; +} info_type; + + +typedef struct state_type { + unsigned mirrored : 1; + unsigned flipped : 1; + unsigned min : 5; + unsigned size : 5; + unsigned max : 5; +} state_type; + #define MAX_STAMPS 512 static int num_stamps; static SDL_Surface * img_stamps[MAX_STAMPS];