gCAD3D 2.40
xa_tex.c File Reference

Texture-Utility-Functions Tex_. More...

#include <string.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_txt.h"
#include "../ut/ut_txTab.h"
#include "../ut/ut_os.h"
#include "../ut/func_types.h"
#include "../xa/xa_mem.h"
#include "../xa/xa.h"

Macros

#define TexBasINC   32
 
#define TexRefINC   32
 

Functions

 UtxTab_NEW (TexTbFn)
 StringList TextureFilenames. More...
 
int Tex_tbNr ()
 
char * Tex_get_fn (int itr)
 
int Tex_itb_itr (int itr)
 
int Tex_getBas1 (TexBas **tbAct, char *symNam)
 
int Tex_DelAll ()
 
int Tex_act_upd ()
 
int Tex_setSurfInd (long sur, long dli)
 
int Tex_TexRef_UpdU (TexRef *rtex)
 
int Tex_TexRef_InitU (int ii)
 
int Tex_TexRef_InitS (int ii)
 
int Tex_actSur_get ()
 
long Tex_actDli_get ()
 
int Tex_actBas_set (int ii)
 
int Tex_actBas_get ()
 
int Tex_getBitmap (char *bNam, char *symNam, int overWrite)
 
int Tex_Init__ ()
 
int TexRef_realloc ()
 
int TexBas_realloc ()
 
int Tex_addBas__ (char *fnam, char *dirNam, int keepFlag)
 
int Tex_addBas1 (char *symNam, int overWrite)
 
int Tex_getBas__ (TexBas **txb, int ind)
 
int Tex_getRef (TexRef **tex, int ind)
 
int Tex_addRef ()
 
int Tex_savRef (TexRef *texr)
 
int Tex_getRefInd ()
 
int Tex_setRefInd (int ind)
 
int Tex_RefTest ()
 
int Tex_dump__ (FILE *fpo)
 

Variables

AP_STAT AP_stat
 
static int TexBasNr = 0
 
static int TexBasSiz = 0
 
int TexRefNr = 0
 
static int TexRefSiz = 0
 
static int TexRefAct = 0
 
TexRefTexRefTab = NULL
 
static long actSur
 
static long actDli
 
int TexBasAct = -1
 
TexBasTexBasTab = NULL
 
static TexBasactTexBas
 

Detailed Description

Texture-Utility-Functions Tex_.

=====================================================
List_functions_start:
Tex_getBitmap provide Bitmap in <tmpDir>; return filename of BitmapFile.
Tex_Init__
Tex_setSurfInd save & display surf-DBi & sur-dli merken
Tex_addBas__ load Texture from filename + dirname
Tex_addBas1 load Texture from symNam
Tex_getBas__ get BasicTextureNr for Image <symNam>; else create new TexBas
Tex_getBas1 get textureNr for File; else create new BasicTexture
Tex_actBas_get get TexBasAct (index of active TexBas)
Tex_addRef search if TexRef-Record exists else create new
Tex_setRefInd save the active TexRef-index
Tex_savRef overwrite active TexRef-Record
Tex_getRef get TexRef-record from TexRef-index
Tex_TexRef_UpdU update the userparamters of the active texture
Tex_TexRef_InitU init the userparamters of the active texture
Tex_TexRef_InitS SurfData auf defaults setzen
Tex_get_fn get textureFilename from TexRefNr
Tex_itb_itr get TexBas-Nr from TexRef-Nr
Tex_tbNr get nr TexBas-records
Tex_DelAll delete all OpenGL-textures
List_functions_end:
=====================================================
Tex_loadBas UNUSED
see also:
GRU_tex_pos*

Macro Definition Documentation

#define TexBasINC   32
#define TexRefINC   32

Function Documentation

UtxTab_NEW ( TexTbFn  )

StringList TextureFilenames.

int Tex_tbNr ( )
char* Tex_get_fn ( int  itr)
int Tex_itb_itr ( int  itr)
int Tex_getBas1 ( TexBas **  tbAct,
char *  symNam 
)
* get BasicTextureNr for Image <symNam>; else create new BasicTexture
* get textureNr of File; else create new BasicTexture
* search ImageName in BasicTextureTable;
* sets TexBasAct = index of tbAct
* Input:
* symbolicFilename
* Output:
* tbAct Pointer into TexBasTab
* RetCode: -1=Error. 0=new; 1=exists.
*
int Tex_DelAll ( )

GL_Tex_DelAll delete all OpenGL-textures

int Tex_act_upd ( )

DoUpdate

int Tex_setSurfInd ( long  sur,
long  dli 
)

save & display surf-DBi & sur-dli merken

int Tex_TexRef_UpdU ( TexRef rtex)

update the userparamters of the active texture

int Tex_TexRef_InitU ( int  ii)

UserData auf defaults setzen

int Tex_TexRef_InitS ( int  ii)

SurfData auf defaults setzen

int Tex_actSur_get ( )
long Tex_actDli_get ( )

get DB-Ind of act. surf

int Tex_actBas_set ( int  ii)

Tex_actBas_set set TexBas-index TexBasAct

int Tex_actBas_get ( )

Tex_actBas_get get TexBasAct (index of active TexBas)

int Tex_getBitmap ( char *  bNam,
char *  symNam,
int  overWrite 
)
* provide Bitmap in <tmpDir>; return filename of BitmapFile.
* test if Bitmap already exists; if not: create it.
* copy BMP; convert JPG.
*
* Input:
* symNam symbolic-name
* overWrite 0=do nothing if destinationfile exists;
* 1 overWrite
* Output:
* bNam Bitmapfilename
* RetCod: 0=Ok; file created;
* 1=Ok; file did exist;
* -1=Error; cannot create BitmapFile.
* -2=Error; unsupported Filetyp.
*
int Tex_Init__ ( )
int TexRef_realloc ( )
int TexBas_realloc ( )
int Tex_addBas__ ( char *  fnam,
char *  dirNam,
int  keepFlag 
)
* save & load Texture
* Input:
* fnam
* dirNam
* keepFlag: 0=do not keep active texture;
* 1=keep.
* RetCod: iTex; -1=error
*
int Tex_addBas1 ( char *  symNam,
int  overWrite 
)
* load Texture:
* get BitmapFile -> <tempDir>
* TexBas generieren, Texture laden; Texture aktiv setzen.
* load bitmage-imagefile -> OpenGL-Textur.
* Input:
* overWrite 0 normal; do not load if basictexture exist.
* 1 overwrite
* RetCod: iTex; -1=error
*
int Tex_getBas__ ( TexBas **  txb,
int  ind 
)

get the Bas.Texture from BasicTextureIndex

int Tex_getRef ( TexRef **  tex,
int  ind 
)
* get TexRef-record from TexRef-index
* (returns a pointer)
*
int Tex_addRef ( )

create new TexRef-Record RetCod = Index of TexRef-Record; is also stored as TexRefAct

int Tex_savRef ( TexRef texr)

copy the Ref-Record texr -> Record TexRefAct

int Tex_getRefInd ( )

Tex_getRefInd returns TexRefAct

int Tex_setRefInd ( int  ind)
int Tex_RefTest ( )
int Tex_dump__ ( FILE *  fpo)

print to terminal: fpo=NULL

Variable Documentation

AP_STAT AP_stat
int TexBasNr = 0
static
int TexBasSiz = 0
static
int TexRefNr = 0
int TexRefSiz = 0
static
int TexRefAct = 0
static
TexRef* TexRefTab = NULL
long actSur
static
long actDli
static
int TexBasAct = -1
TexBas* TexBasTab = NULL
TexBas* actTexBas
static