#include #include #include "text.h" #include "texmanager.h" texmanager::texmanager() { allocatedmemory=0; } int texmanager::load(char *name) /*-------------------------------------------------------------------------------*/ /* loads a texture manager from a description file */ /* file format is: */ /* numtextures [NUMTEXTURES] */ /* TEXTURE [POSITION] [FILENAME] OPAQUE for regular opaque textures */ /* TEXTURE [POSITION] [FILENAME] BILLBOARD [KEYCOLOR] for billboards */ /* TEXTURE [POSITION] [FILENAME] TRANSLUCENT LUMINOSITY for rgb-based */ /* TEXTURE [POSITION] [FILENAME] TRANSLUCENT FIXED [ALPHA] */ /* TEXTURE [POSITION] [FILENAME] TRANSLUCENT LINEAR [COLOR] */ /*-------------------------------------------------------------------------------*/ { text t(name); int i; // numtextures numtextures=t.countword("#TEXTURE"); translationtable=new unsigned int[numtextures]; type=new int[numtextures]; glGenTextures(numtextures,translationtable); texdata=new texture[numtextures]; // load each texture object for (i=0;i