ipack.cc File Reference

#include <unistd.h>
#include <fstream>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <vector>
#include "Flex.h"
#include "utils.h"
#include "exceptions.h"
#include "vgafile.h"
#include "pngio.h"
#include "ibuf8.h"

Include dependency graph for ipack.cc:

Go to the source code of this file.

Classes

class  Shape_spec

Typedefs

typedef vector< Shape_specShape_specs

Functions

static char * Skip_space (char *ptr)
static char * Find_space (char *ptr)
static char * Pass_file_spec (char *ptr)
static long Get_number (int linenum, char *errmsg, char *ptr, char *&endptr)
static char * Get_token (int linenum, char *ptr, char *&endptr)
static void Read_script (istream &in, char *&imagename, char *&palname, Shape_specs &specs)
static void Modify_palette (unsigned char *from, unsigned char *to, int palsize, int roff, int goff, int boff, int r256, int g256, int b256)
static void Greyify_palette (unsigned char *from, unsigned char *to, int palsize)
static void Convert_palette63 (unsigned char *from, unsigned char *to, int palsize)
static void Write_text_palette (char *palname, unsigned char *palette, int palsize)
static void Write_frame (char *basename, int frnum, Shape_frame *frame, unsigned char *palette)
static void Write_tiled_frames (char *filename, Shape *shape, int shnum, bool bycol, int dim0_cnt, unsigned char *palette)
void Write_palettes (char *palname, unsigned char *palette, int palsize)
static void Write_exult_from_tiles (ostream &out, char *filename, int nframes, bool bycol, int dim0_cnt, char *palname)
static void Write_exult (ostream &out, char *basename, int nframes, bool flat, char *palname)
static void Create (char *imagename, char *palname, Shape_specs &specs, const char *title)
static void Update (char *imagename, char *palname, Shape_specs &specs, const char *title)
static void Extract (char *imagename, char *palname, Shape_specs &specs)
static void Usage ()
int main (int argc, char **argv)

Variables

const unsigned char transp = 255


Typedef Documentation

typedef vector<Shape_spec> Shape_specs

Definition at line 81 of file ipack.cc.


Function Documentation

static void Convert_palette63 ( unsigned char *  from,
unsigned char *  to,
int  palsize 
) [static]

Definition at line 364 of file ipack.cc.

Referenced by Write_palettes().

static void Create ( char *  imagename,
char *  palname,
Shape_specs specs,
const char *  title 
) [static]

Definition at line 702 of file ipack.cc.

References U7exists(), U7open(), Write_exult(), and Write_exult_from_tiles().

Referenced by main().

Here is the call graph for this function:

static void Extract ( char *  imagename,
char *  palname,
Shape_specs specs 
) [static]

Definition at line 806 of file ipack.cc.

References Vga_file::extract_shape(), Shape::get_frame(), Shape::get_num_frames(), Vga_file::get_num_shapes(), len, U7object::retrieve(), and Write_frame().

Referenced by main().

Here is the call graph for this function:

static char* Find_space ( char *  ptr  )  [static]

Definition at line 102 of file ipack.cc.

Referenced by Get_token().

static long Get_number ( int  linenum,
char *  errmsg,
char *  ptr,
char *&  endptr 
) [static]

Definition at line 137 of file ipack.cc.

References Skip_space().

Referenced by Read_script().

Here is the call graph for this function:

static char* Get_token ( int  linenum,
char *  ptr,
char *&  endptr 
) [static]

Definition at line 161 of file ipack.cc.

References Find_space(), newstrdup(), Skip_space(), and token.

Referenced by Read_script().

Here is the call graph for this function:

static void Greyify_palette ( unsigned char *  from,
unsigned char *  to,
int  palsize 
) [static]

Definition at line 343 of file ipack.cc.

Referenced by Write_palettes().

int main ( int  argc,
char **  argv 
)

Definition at line 866 of file ipack.cc.

References Create(), Extract(), Read_script(), U7open(), Update(), Usage(), and exult_exception::what().

Here is the call graph for this function:

static void Modify_palette ( unsigned char *  from,
unsigned char *  to,
int  palsize,
int  roff,
int  goff,
int  boff,
int  r256,
int  g256,
int  b256 
) [static]

Definition at line 301 of file ipack.cc.

Referenced by Write_palettes().

static char* Pass_file_spec ( char *  ptr  )  [static]

Definition at line 116 of file ipack.cc.

Referenced by Read_script().

static void Read_script ( istream &  in,
char *&  imagename,
char *&  palname,
Shape_specs specs 
) [static]

Definition at line 203 of file ipack.cc.

References Get_number(), Get_token(), Pass_file_spec(), and Skip_space().

Referenced by main().

Here is the call graph for this function:

static char* Skip_space ( char *  ptr  )  [static]

Definition at line 88 of file ipack.cc.

Referenced by Get_number(), Get_token(), and Read_script().

static void Update ( char *  imagename,
char *  palname,
Shape_specs specs,
const char *  title 
) [static]

Definition at line 748 of file ipack.cc.

References Flex_writer::close(), len, Flex_writer::mark_section_done(), Flex::number_of_objects(), Flex::retrieve(), U7exists(), U7open(), and Write_exult().

Referenced by main().

Here is the call graph for this function:

static void Usage (  )  [static]

Definition at line 855 of file ipack.cc.

Referenced by main().

static void Write_exult ( ostream &  out,
char *  basename,
int  nframes,
bool  flat,
char *  palname 
) [static]

Definition at line 646 of file ipack.cc.

References Shape::set_frame(), Shape::write(), and Write_palettes().

Referenced by Create(), and Update().

Here is the call graph for this function:

static void Write_exult_from_tiles ( ostream &  out,
char *  filename,
int  nframes,
bool  bycol,
int  dim0_cnt,
char *  palname 
) [static]

Definition at line 588 of file ipack.cc.

References Write_palettes().

Referenced by Create().

Here is the call graph for this function:

static void Write_frame ( char *  basename,
int  frnum,
Shape_frame frame,
unsigned char *  palette 
) [static]

Definition at line 422 of file ipack.cc.

References Image_buffer8::fill8(), Ucscript::frame, and Image_buffer::get_bits().

Referenced by Extract().

Here is the call graph for this function:

void Write_palettes ( char *  palname,
unsigned char *  palette,
int  palsize 
)

Definition at line 511 of file ipack.cc.

References Flex_writer::close(), Convert_palette63(), Greyify_palette(), Flex_writer::mark_section_done(), Modify_palette(), U7open(), and Write_text_palette().

Referenced by Write_exult(), and Write_exult_from_tiles().

Here is the call graph for this function:

static void Write_text_palette ( char *  palname,
unsigned char *  palette,
int  palsize 
) [static]

Definition at line 383 of file ipack.cc.

Referenced by Write_palettes().

static void Write_tiled_frames ( char *  filename,
Shape shape,
int  shnum,
bool  bycol,
int  dim0_cnt,
unsigned char *  palette 
) [static]

Definition at line 455 of file ipack.cc.

References Image_buffer8::fill8(), Ucscript::frame, Image_buffer::get_bits(), Shape::get_frame(), and Shape::get_num_frames().

Here is the call graph for this function:


Variable Documentation

const unsigned char transp = 255

Definition at line 415 of file ipack.cc.


Generated on Mon Jul 9 14:45:47 2007 for ExultEngine by  doxygen 1.5.1