IMG_pnm.c
changeset 119 336c49447e0d
parent 118 c5e736a47ad2
child 121 1bf9c0c87374
equal deleted inserted replaced
118:c5e736a47ad2 119:336c49447e0d
    55 		 * P2	PGM, ascii format
    55 		 * P2	PGM, ascii format
    56 		 * P3	PPM, ascii format
    56 		 * P3	PPM, ascii format
    57 		 * P4	PBM, binary format
    57 		 * P4	PBM, binary format
    58 		 * P5	PGM, binary format
    58 		 * P5	PGM, binary format
    59 		 * P6	PPM, binary format
    59 		 * P6	PPM, binary format
       
    60 		 * P7	PAM, a general wrapper for PNM data
    60 		 */
    61 		 */
    61 		if ( magic[0] == 'P' && magic[1] >= '1' && magic[1] <= '6' ) {
    62 		if ( magic[0] == 'P' && magic[1] >= '1' && magic[1] <= '6' ) {
    62 			is_PNM = 1;
    63 			is_PNM = 1;
    63 		}
    64 		}
    64 	}
    65 	}
   112 	Uint8 *row;
   113 	Uint8 *row;
   113 	Uint8 *buf = NULL;
   114 	Uint8 *buf = NULL;
   114 	char *error = NULL;
   115 	char *error = NULL;
   115 	Uint8 magic[2];
   116 	Uint8 magic[2];
   116 	int ascii;
   117 	int ascii;
   117 	enum { PBM, PGM, PPM } kind;
   118 	enum { PBM, PGM, PPM, PAM } kind;
   118 
   119 
   119 #define ERROR(s) do { error = (s); goto done; } while(0)
   120 #define ERROR(s) do { error = (s); goto done; } while(0)
   120 
   121 
   121 	if ( !src ) {
   122 	if ( !src ) {
   122 		/* The error message has been set in SDL_RWFromFile */
   123 		/* The error message has been set in SDL_RWFromFile */