Main Page | Modules | Data Structures | File List | Data Fields | Globals

texture.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <png.h>
#include "libps2.h"

Include dependency graph for texture.c:

Include dependency graph

Go to the source code of this file.

Defines

#define MAX_GIF_NUM   32766

Functions

int get_exponent_number (int number)
void set_default_texenv (TEXTURE *tex)
int load_textures (int tex_number, TEXTURE **tex_tbl)
 Set texture to VRAM.

void free_texture (TEXTURE *tex)
 Free a texture data.

void free_tex_tbl (int number, TEXTURE **tex)
 Free a texture table.

void * create_image_data (png_bytep *rows_ptr, int c_type, TEXTURE *tex)
TEXTUREcreate_texture (int w, int h)
void swap4 (png_bytep a, png_bytep b)
void fix_png (png_bytep *rows_ptr, int height, int width)
TEXTUREread_png_file (char *file_name)
 read PNG file and create a texture file_name a PNG file

TEXTUREread_png_file0 (char *file_name, int fix_flag)
 read PNG file and create a texture file_name a PNG file


Variables

int g_textop64
int g_zbits


Define Documentation

#define MAX_GIF_NUM   32766
 

Definition at line 6 of file texture.c.


Function Documentation

void* create_image_data png_bytep *  rows_ptr,
int  c_type,
TEXTURE tex
[static]
 

Definition at line 137 of file texture.c.

TEXTURE* create_texture int  w,
int  h
[static]
 

Definition at line 245 of file texture.c.

void fix_png png_bytep *  rows_ptr,
int  height,
int  width
[static]
 

Definition at line 300 of file texture.c.

void free_tex_tbl int  number,
TEXTURE **  tex
 

Free a texture table.

This library uses a simple array table to manage several textures. This function erases a texture on that table.

Be careful! A erased texture is retained on main memory. So, we have to free that memory area explicitly with using free_texture.

Definition at line 127 of file texture.c.

void free_texture TEXTURE tex  ) 
 

Free a texture data.

Parameters:
pointer to a texture data TEXTURE
Unlock a memory area used for a texture image and free it.

Definition at line 117 of file texture.c.

int get_exponent_number int  number  )  [static]
 

Definition at line 10 of file texture.c.

int load_textures int  tex_number,
TEXTURE **  tex_tbl
 

Set texture to VRAM.

Parameters:
tex_number the number of texture to load
tex_tbl pointer for TEXTURE array
VRAM is a working memory area for graphics. In case of PS2, VRAM means GS local memory. This function treats GS local memory device and load a image data to use texture to that memory.

Definition at line 72 of file texture.c.

TEXTURE* read_png_file char *  file_name  ) 
 

read PNG file and create a texture file_name a PNG file

This function reads a specified PNG image file and creates a texture data. Usually, a texture is a image data to painting 3D object's face. So, this function uses a PNG formated file and read it, then create a texture data.

Definition at line 340 of file texture.c.

TEXTURE* read_png_file0 char *  file_name,
int  flag
 

read PNG file and create a texture file_name a PNG file

This function reads a specified PNG image file and creates a texture data. Usually, a texture is a image data to painting 3D object's face. So, this function uses a PNG formated file and read it, then create a texture data.

This function is equal to read_png_file function. But, turned up by kono-sensei.

Definition at line 345 of file texture.c.

void set_default_texenv TEXTURE tex  )  [static]
 

Definition at line 39 of file texture.c.

void swap4 png_bytep  a,
png_bytep  b
[static]
 

Definition at line 282 of file texture.c.


Generated on Fri Oct 15 02:08:58 2004 for ps2util by doxygen 1.3.3