#include <cstdlib>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstring>
Go to the source code of this file.
Defines | |
#define | COLOR_MAX 1000 |
#define | COR3_MAX 200000 |
#define | DEG_TO_RAD ( PI / 180.0 ) |
#define | ERROR 1 |
#define | FACE_MAX 200000 |
#define | G1_SECTION_MODEL_QUADS 18 |
#define | G1_SECTION_MODEL_TEXTURE_NAMES 19 |
#define | G1_SECTION_MODEL_VERT_ANIMATION 20 |
#define | GMOD_MAX_SECTIONS 32 |
#define | GMOD_UNUSED_VERTEX 65535 |
#define | LEVEL_MAX 10 |
#define | LINE_MAX_LEN 256 |
#define | LINES_MAX 100000 |
#define | MATERIAL_MAX 100 |
#define | ORDER_MAX 10 |
#define | PI 3.141592653589793238462643 |
#define | RAD_TO_DEG ( 180.0 / PI ) |
#define | TEXTURE_MAX 100 |
Functions | |
int | ase_read (FILE *filein) |
int | ase_write (FILE *fileout) |
int | byu_read (FILE *filein) |
int | byu_write (FILE *fileout) |
char | ch_cap (char c) |
bool | ch_eqi (char c1, char c2) |
int | ch_index_last (char *string, char c) |
bool | ch_is_space (char c) |
int | ch_pad (int *char_index, int *null_index, char *s, int max_string) |
char | ch_read (FILE *filein) |
int | ch_to_digit (char c) |
int | ch_write (FILE *fileout, char c) |
int | command_line (char **argv) |
void | cor3_normal_set () |
void | cor3_range () |
void | data_check () |
void | data_init () |
bool | data_read () |
void | data_report () |
int | data_write () |
int | dxf_read (FILE *filein) |
int | dxf_write (FILE *fileout) |
int | edge_count () |
void | edge_null_delete () |
void | face_area_set () |
void | face_normal_ave () |
void | face_null_delete () |
int | face_print (int iface) |
void | face_reverse_order () |
int | face_subset () |
void | face_to_line () |
void | face_to_vertex_material () |
char * | file_ext (char *file_name) |
float | float_read (FILE *filein) |
float | float_reverse_bytes (float x) |
int | float_write (FILE *fileout, float float_val) |
bool | gmod_arch_check () |
int | gmod_read (FILE *filein) |
float | gmod_read_float (FILE *filein) |
unsigned short | gmod_read_w16 (FILE *filein) |
unsigned long | gmod_read_w32 (FILE *filein) |
int | gmod_write (FILE *fileout) |
void | gmod_write_float (float Val, FILE *fileout) |
void | gmod_write_w16 (unsigned short Val, FILE *fileout) |
void | gmod_write_w32 (unsigned long Val, FILE *fileout) |
void | hello () |
void | help () |
int | hrc_read (FILE *filein) |
int | hrc_write (FILE *fileout) |
int | i4_max (int i1, int i2) |
int | i4_min (int i1, int i2) |
int | i4_modp (int i, int j) |
int | i4_wrap (int ival, int ilo, int ihi) |
int | i4vec_max (int n, int *a) |
void | init_program_data () |
int | interact () |
int | iv_read (FILE *filein) |
int | iv_write (FILE *fileout) |
long int | long_int_read (FILE *filein) |
int | long_int_write (FILE *fileout, long int int_val) |
int | main (int argc, char *argv[]) |
void | news () |
void | node_to_vertex_material () |
int | obj_read (FILE *filein) |
int | obj_write (FILE *fileout) |
int | off_read (ifstream &file_in) |
int | off_write (FILE *fileout) |
int | pov_write (FILE *fileout) |
int | rcol_find (float a[][COR3_MAX], int m, int n, float r[]) |
float | rgb_to_hue (float r, float g, float b) |
bool | s_eqi (char *string1, char *string2) |
int | s_len_trim (char *s) |
int | s_to_i4 (char *s, int *last, bool *error) |
bool | s_to_i4vec (char *s, int n, int ivec[]) |
float | s_to_r4 (char *s, int *lchar, bool *error) |
bool | s_to_r4vec (char *s, int n, float rvec[]) |
short int | short_int_read (FILE *filein) |
int | short_int_write (FILE *fileout, short int int_val) |
int | smf_read (FILE *filein) |
int | smf_write (FILE *fileout) |
void | sort_heap_external (int n, int *indx, int *i, int *j, int isgn) |
int | stla_read (FILE *filein) |
int | stla_write (FILE *fileout) |
int | stlb_read (FILE *filein) |
int | stlb_write (FILE *fileout) |
void | tds_pre_process () |
int | tds_read (FILE *filein) |
unsigned long int | tds_read_ambient_section (FILE *filein) |
unsigned long int | tds_read_background_section (FILE *filein) |
unsigned long int | tds_read_boolean (unsigned char *boolean, FILE *filein) |
unsigned long int | tds_read_camera_section (FILE *filein) |
unsigned long int | tds_read_edit_section (FILE *filein, int *views_read) |
unsigned long int | tds_read_keyframe_objdes_section (FILE *filein) |
unsigned long int | tds_read_keyframe_section (FILE *filein, int *views_read) |
unsigned long int | tds_read_light_section (FILE *filein) |
int | tds_read_long_name (FILE *filein) |
unsigned long int | tds_read_matdef_section (FILE *filein) |
unsigned long int | tds_read_material_section (FILE *filein) |
int | tds_read_name (FILE *filein) |
unsigned long int | tds_read_obj_section (FILE *filein) |
unsigned long int | tds_read_object_section (FILE *filein) |
unsigned long int | tds_read_spot_section (FILE *filein) |
unsigned long int | tds_read_tex_verts_section (FILE *filein) |
unsigned long int | tds_read_texmap_section (FILE *filein) |
unsigned long int | tds_read_u_long_int (FILE *filein) |
unsigned short int | tds_read_u_short_int (FILE *filein) |
unsigned long int | tds_read_unknown_section (FILE *filein) |
unsigned long int | tds_read_view_section (FILE *filein, int *views_read) |
unsigned long int | tds_read_vp_section (FILE *filein, int *views_read) |
int | tds_write (FILE *fileout) |
int | tds_write_string (FILE *fileout, char *string) |
int | tds_write_u_short_int (FILE *fileout, unsigned short int int_val) |
int | tec_write (FILE *fileout) |
void | tmat_init (float a[4][4]) |
void | tmat_mxm (float a[4][4], float b[4][4], float c[4][4]) |
void | tmat_mxp (float a[4][4], float x[4], float y[4]) |
void | tmat_mxp2 (float a[4][4], float x[][3], float y[][3], int n) |
void | tmat_mxv (float a[4][4], float x[4], float y[4]) |
void | tmat_rot_axis (float a[4][4], float b[4][4], float angle, char axis) |
void | tmat_rot_vector (float a[4][4], float b[4][4], float angle, float v1, float v2, float v3) |
void | tmat_scale (float a[4][4], float b[4][4], float sx, float sy, float sz) |
void | tmat_shear (float a[4][4], float b[4][4], char *axis, float s) |
void | tmat_trans (float a[4][4], float b[4][4], float x, float y, float z) |
int | tria_read (FILE *filein) |
int | tria_write (FILE *fileout) |
int | trib_read (FILE *filein) |
int | trib_write (FILE *fileout) |
int | txt_write (FILE *fileout) |
int | ucd_write (FILE *fileout) |
void | vertex_normal_set () |
void | vertex_to_face_material () |
void | vertex_to_node_material () |
int | vla_read (FILE *filein) |
int | vla_write (FILE *fileout) |
int | wrl_write (FILE *filout) |
int | xgl_write (FILE *fileout) |
Variables | |
char | anim_name [LINE_MAX_LEN] |
float | background_rgb [3] |
int | bad_num |
bool | byte_swap |
int | bytes_num |
int | color_num |
int | comment_num |
float | cor3 [3][COR3_MAX] |
int | cor3_material [COR3_MAX] |
float | cor3_normal [3][COR3_MAX] |
int | cor3_num |
float | cor3_tex_uv [3][COR3_MAX] |
bool | debug |
int | dup_num |
int | face [ORDER_MAX][FACE_MAX] |
float | face_area [FACE_MAX] |
int | face_flags [FACE_MAX] |
int | face_material [FACE_MAX] |
float | face_normal [3][FACE_MAX] |
int | face_num |
int | face_object [FACE_MAX] |
int | face_order [FACE_MAX] |
int | face_smooth [FACE_MAX] |
float | face_tex_uv [2][FACE_MAX] |
char | filein_name [81] |
char | fileout_name [81] |
int | group_num |
int | i |
char | input [LINE_MAX_LEN] |
int | k |
char | level_name [LEVEL_MAX][LINE_MAX_LEN] |
int | line_dex [LINES_MAX] |
int | line_material [LINES_MAX] |
int | line_num |
int | line_prune |
int | list [COR3_MAX] |
char | mat_name [81] |
char | material_binding [80] |
char | material_name [MATERIAL_MAX][LINE_MAX_LEN] |
int | material_num |
float | material_rgba [4][MATERIAL_MAX] |
int | max_order2 |
char | normal_binding [80] |
float | normal_temp [3][ORDER_MAX *FACE_MAX] |
char | object_name [81] |
int | object_num |
float | origin [3] |
float | pivot [3] |
float | rgbcolor [3][COLOR_MAX] |
char | temp_name [81] |
int | text_num |
char | texture_binding [80] |
char | texture_name [TEXTURE_MAX][LINE_MAX_LEN] |
int | texture_num |
float | texture_temp [2][ORDER_MAX *FACE_MAX] |
float | transform_matrix [4][4] |
int | vertex_material [ORDER_MAX][FACE_MAX] |
float | vertex_normal [3][ORDER_MAX][FACE_MAX] |
float | vertex_rgb [3][ORDER_MAX][FACE_MAX] |
float | vertex_tex_uv [2][ORDER_MAX][FACE_MAX] |
#define DEG_TO_RAD ( PI / 180.0 ) |
#define G1_SECTION_MODEL_QUADS 18 |
#define G1_SECTION_MODEL_TEXTURE_NAMES 19 |
#define G1_SECTION_MODEL_VERT_ANIMATION 20 |
#define GMOD_MAX_SECTIONS 32 |
#define GMOD_UNUSED_VERTEX 65535 |
#define LINE_MAX_LEN 256 |
#define MATERIAL_MAX 100 |
#define RAD_TO_DEG ( 180.0 / PI ) |
#define TEXTURE_MAX 100 |
int ase_read | ( | FILE * | filein | ) |
int ase_write | ( | FILE * | fileout | ) |
int byu_read | ( | FILE * | filein | ) |
int byu_write | ( | FILE * | fileout | ) |
int ch_index_last | ( | char * | string, |
char | c | ||
) |
bool ch_is_space | ( | char | c | ) |
int ch_pad | ( | int * | char_index, |
int * | null_index, | ||
char * | s, | ||
int | max_string | ||
) |
int ch_to_digit | ( | char | c | ) |
int command_line | ( | char ** | argv | ) |
void cor3_normal_set | ( | void | ) |
void cor3_range | ( | void | ) |
void data_check | ( | void | ) |
void data_init | ( | void | ) |
bool data_read | ( | void | ) |
void data_report | ( | void | ) |
int data_write | ( | void | ) |
int dxf_read | ( | FILE * | filein | ) |
int dxf_write | ( | FILE * | fileout | ) |
int edge_count | ( | ) |
void edge_null_delete | ( | void | ) |
void face_area_set | ( | void | ) |
void face_normal_ave | ( | void | ) |
void face_null_delete | ( | void | ) |
int face_print | ( | int | iface | ) |
void face_reverse_order | ( | void | ) |
int face_subset | ( | void | ) |
void face_to_line | ( | void | ) |
void face_to_vertex_material | ( | void | ) |
char* file_ext | ( | char * | file_name | ) |
float float_read | ( | FILE * | filein | ) |
float float_reverse_bytes | ( | float | x | ) |
int float_write | ( | FILE * | fileout, |
float | float_val | ||
) |
bool gmod_arch_check | ( | void | ) |
int gmod_read | ( | FILE * | filein | ) |
float gmod_read_float | ( | FILE * | filein | ) |
unsigned short gmod_read_w16 | ( | FILE * | filein | ) |
unsigned long gmod_read_w32 | ( | FILE * | filein | ) |
int gmod_write | ( | FILE * | fileout | ) |
void gmod_write_float | ( | float | Val, |
FILE * | fileout | ||
) |
void gmod_write_w16 | ( | unsigned short | Val, |
FILE * | fileout | ||
) |
void gmod_write_w32 | ( | unsigned long | Val, |
FILE * | fileout | ||
) |
void hello | ( | void | ) |
void help | ( | void | ) |
int hrc_read | ( | FILE * | filein | ) |
int hrc_write | ( | FILE * | fileout | ) |
void init_program_data | ( | void | ) |
int interact | ( | void | ) |
int iv_read | ( | FILE * | filein | ) |
int iv_write | ( | FILE * | fileout | ) |
long int long_int_read | ( | FILE * | filein | ) |
int long_int_write | ( | FILE * | fileout, |
long int | int_val | ||
) |
void news | ( | void | ) |
void node_to_vertex_material | ( | void | ) |
int obj_read | ( | FILE * | filein | ) |
int obj_write | ( | FILE * | fileout | ) |
int pov_write | ( | FILE * | fileout | ) |
int rcol_find | ( | float | a[][COR3_MAX], |
int | m, | ||
int | n, | ||
float | r[] | ||
) |
float rgb_to_hue | ( | float | r, |
float | g, | ||
float | b | ||
) |
int s_len_trim | ( | char * | s | ) |
bool s_to_i4vec | ( | char * | s, |
int | n, | ||
int | ivec[] | ||
) |
bool s_to_r4vec | ( | char * | s, |
int | n, | ||
float | rvec[] | ||
) |
short int short_int_read | ( | FILE * | filein | ) |
int short_int_write | ( | FILE * | fileout, |
short int | int_val | ||
) |
int smf_read | ( | FILE * | filein | ) |
int smf_write | ( | FILE * | fileout | ) |
void sort_heap_external | ( | int | n, |
int * | indx, | ||
int * | i, | ||
int * | j, | ||
int | isgn | ||
) |
int stla_read | ( | FILE * | filein | ) |
int stla_write | ( | FILE * | fileout | ) |
int stlb_read | ( | FILE * | filein | ) |
int stlb_write | ( | FILE * | fileout | ) |
void tds_pre_process | ( | void | ) |
int tds_read | ( | FILE * | filein | ) |
unsigned long int tds_read_ambient_section | ( | FILE * | filein | ) |
unsigned long int tds_read_background_section | ( | FILE * | filein | ) |
unsigned long int tds_read_boolean | ( | unsigned char * | boolean, |
FILE * | filein | ||
) |
unsigned long int tds_read_camera_section | ( | FILE * | filein | ) |
unsigned long int tds_read_edit_section | ( | FILE * | filein, |
int * | views_read | ||
) |
unsigned long int tds_read_keyframe_objdes_section | ( | FILE * | filein | ) |
unsigned long int tds_read_keyframe_section | ( | FILE * | filein, |
int * | views_read | ||
) |
unsigned long int tds_read_light_section | ( | FILE * | filein | ) |
int tds_read_long_name | ( | FILE * | filein | ) |
unsigned long int tds_read_matdef_section | ( | FILE * | filein | ) |
unsigned long int tds_read_material_section | ( | FILE * | filein | ) |
int tds_read_name | ( | FILE * | filein | ) |
unsigned long int tds_read_obj_section | ( | FILE * | filein | ) |
unsigned long int tds_read_object_section | ( | FILE * | filein | ) |
unsigned long int tds_read_spot_section | ( | FILE * | filein | ) |
unsigned long int tds_read_tex_verts_section | ( | FILE * | filein | ) |
unsigned long int tds_read_texmap_section | ( | FILE * | filein | ) |
unsigned long int tds_read_u_long_int | ( | FILE * | filein | ) |
unsigned short int tds_read_u_short_int | ( | FILE * | filein | ) |
unsigned long int tds_read_unknown_section | ( | FILE * | filein | ) |
unsigned long int tds_read_view_section | ( | FILE * | filein, |
int * | views_read | ||
) |
unsigned long int tds_read_vp_section | ( | FILE * | filein, |
int * | views_read | ||
) |
int tds_write | ( | FILE * | fileout | ) |
int tds_write_string | ( | FILE * | fileout, |
char * | string | ||
) |
int tds_write_u_short_int | ( | FILE * | fileout, |
unsigned short int | int_val | ||
) |
int tec_write | ( | FILE * | fileout | ) |
void tmat_init | ( | float | a[4][4] | ) |
void tmat_mxm | ( | float | a[4][4], |
float | b[4][4], | ||
float | c[4][4] | ||
) |
void tmat_mxp | ( | float | a[4][4], |
float | x[4], | ||
float | y[4] | ||
) |
void tmat_mxp2 | ( | float | a[4][4], |
float | x[][3], | ||
float | y[][3], | ||
int | n | ||
) |
void tmat_mxv | ( | float | a[4][4], |
float | x[4], | ||
float | y[4] | ||
) |
void tmat_rot_axis | ( | float | a[4][4], |
float | b[4][4], | ||
float | angle, | ||
char | axis | ||
) |
void tmat_rot_vector | ( | float | a[4][4], |
float | b[4][4], | ||
float | angle, | ||
float | v1, | ||
float | v2, | ||
float | v3 | ||
) |
void tmat_scale | ( | float | a[4][4], |
float | b[4][4], | ||
float | sx, | ||
float | sy, | ||
float | sz | ||
) |
void tmat_shear | ( | float | a[4][4], |
float | b[4][4], | ||
char * | axis, | ||
float | s | ||
) |
void tmat_trans | ( | float | a[4][4], |
float | b[4][4], | ||
float | x, | ||
float | y, | ||
float | z | ||
) |
int tria_read | ( | FILE * | filein | ) |
int tria_write | ( | FILE * | fileout | ) |
int trib_read | ( | FILE * | filein | ) |
int trib_write | ( | FILE * | fileout | ) |
int txt_write | ( | FILE * | fileout | ) |
int ucd_write | ( | FILE * | fileout | ) |
void vertex_normal_set | ( | void | ) |
void vertex_to_face_material | ( | void | ) |
void vertex_to_node_material | ( | void | ) |
int vla_read | ( | FILE * | filein | ) |
int vla_write | ( | FILE * | fileout | ) |
int wrl_write | ( | FILE * | filout | ) |
int xgl_write | ( | FILE * | fileout | ) |
char anim_name[LINE_MAX_LEN] |
float background_rgb[3] |
int comment_num |
int cor3_material[COR3_MAX] |
float cor3_normal[3][COR3_MAX] |
float cor3_tex_uv[3][COR3_MAX] |
int face_flags[FACE_MAX] |
int face_material[FACE_MAX] |
float face_normal[3][FACE_MAX] |
int face_object[FACE_MAX] |
int face_order[FACE_MAX] |
int face_smooth[FACE_MAX] |
float face_tex_uv[2][FACE_MAX] |
char filein_name[81] |
char fileout_name[81] |
char input[LINE_MAX_LEN] |
char level_name[LEVEL_MAX][LINE_MAX_LEN] |
int line_material[LINES_MAX] |
int line_prune |
char material_binding[80] |
int material_num |
float material_rgba[4][MATERIAL_MAX] |
int max_order2 |
char normal_binding[80] |
float normal_temp[3][ORDER_MAX *FACE_MAX] |
char object_name[81] |
int object_num |
char texture_binding[80] |
char texture_name[TEXTURE_MAX][LINE_MAX_LEN] |
int texture_num |
float texture_temp[2][ORDER_MAX *FACE_MAX] |
float transform_matrix[4][4] |
int vertex_material[ORDER_MAX][FACE_MAX] |
float vertex_normal[3][ORDER_MAX][FACE_MAX] |
float vertex_rgb[3][ORDER_MAX][FACE_MAX] |
float vertex_tex_uv[2][ORDER_MAX][FACE_MAX] |