bsdtree
client
common
include
action.H
bbox.H
beam.H
bf_locl.h
bf_pi.h
blowfish.h
bogfile.H
bsdtree.H
cache.H
cellpvs.H
commandparser.H
communicate.H
crossindex.H
crypto.H
direction.H
doublearray.H
exception.H
geometry.H
gos.H
gosmessage.H
gosprotocol.H
hash_map
hash_map.h
inetaddress.H
int.H
intarray.H
keyframe.H
listener.H
manager.H
material.H
matfile.H
matrix.H
message.H
messagelist.H
msgactionlist.H
msggos.H
msgmsg.H
msgserver.H
msgsrvcli.H
msgsrvgos.H
msgvarlength.H
msgworld.H
mudtypes.h
namedb.H
object.H
objectarray.H
objectlist.H
objectqueue.H
option.H
pingpong.H
plane.H
position.H
pvvmud.H
socket.H
spline.H
stl_hash_fun.h
stl_hash_map.h
stl_hashtable.h
stream.H
texture.H
time.H
timekeeper.H
vector.H
vertex.H
viewpoint.H
wacreateobject.H
waobject.H
waremoveobject.H
warotate.H
waupdatedirection.H
waupdatehierarchy.H
waupdateposition.H
worldanimation.H
worldhierarchy.H
worldobject.H
worldworld.H
lib
Makefile.am
Makefile.in
doc
download
gos
lib
mudworld
server
util
worldsrv
.cvsignore
LICENSE
Makefile.am
Makefile.in
README
aclocal.m4
configure
configure.in
install-sh
missing
mkinstalldirs
pvvmud.html
112 lines
2.7 KiB
C++
112 lines
2.7 KiB
C++
/*
|
|
* PVVMUD a 3D MUD
|
|
* Copyright (C) 1998-1999 Programvareverkstedet (pvv@pvv.org)
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
*
|
|
*/
|
|
#ifndef _MATERIAL_H
|
|
#define _MATERIAL_H
|
|
|
|
#include "texture.H"
|
|
|
|
#define MAT_NOTEXTURE -1
|
|
|
|
typedef float RGBA_t[4];
|
|
typedef float Shininess_t[1];
|
|
|
|
|
|
class CMaterial : public CObject {
|
|
int m_id;
|
|
int m_textureId;
|
|
|
|
protected:
|
|
RGBA_t m_ambient;
|
|
RGBA_t m_diffuse;
|
|
RGBA_t m_specular;
|
|
RGBA_t m_emission;
|
|
Shininess_t m_shininess;
|
|
public:
|
|
CMaterial();
|
|
CMaterial(int materialId);
|
|
CMaterial(int materialId, char * name);
|
|
|
|
virtual ~CMaterial() {}
|
|
|
|
int getId(){return m_id;}
|
|
void setId(int materialId);
|
|
|
|
int load(char * fileName);
|
|
int save(char * fileName);
|
|
private:
|
|
int loadBMAT(char * fileName);
|
|
|
|
public:
|
|
void RGBA_SetColor(RGBA_t rgba, float red, float green, float blue, float alpha);
|
|
void RGBA_Print(RGBA_t rgba);
|
|
|
|
//void loadMAT(int id,char * name);
|
|
// void readMAT(int id,FILE * matFile);
|
|
void setTextureId(int textureId);
|
|
int getTextureId();
|
|
|
|
void setAmbient(float red, float green, float blue, float alpha);
|
|
void setDiffuse(float red, float green, float blue, float alpha);
|
|
void setSpecular(float red, float green, float blue, float alpha);
|
|
void setShininess(float shininess);
|
|
void setEmission(float red, float green, float blue, float alpha);
|
|
|
|
BYTE getAmbientByte(int num);
|
|
BYTE getDiffuseByte(int num);
|
|
BYTE getSpecularByte(int num);
|
|
BYTE getEmissionByte(int num);
|
|
BYTE getShininessByte();
|
|
|
|
float getAmbientFloat(int num);
|
|
float getDiffuseFloat(int num);
|
|
float getSpecularFloat(int num);
|
|
float getEmissionFloat(int num);
|
|
float getShininessFloat();
|
|
|
|
void setAmbient(int num,BYTE value);
|
|
void setDiffuse(int num,BYTE value);
|
|
void setSpecular(int num,BYTE value);
|
|
void setEmission(int num,BYTE value);
|
|
void setShininess(BYTE value);
|
|
|
|
virtual int exec(CTextureCache * texCache);
|
|
};
|
|
|
|
class CMaterialCache : public CCache {
|
|
public:
|
|
CMaterialCache();
|
|
virtual ~CMaterialCache() {}
|
|
|
|
CMaterial * add(CMaterial * material);
|
|
CMaterial * get(int id);
|
|
};
|
|
|
|
#endif /* _MATERIAL_H */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|