123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
-
-
- #ifndef _RENDER_H_
- #define _RENDER_H_
-
- #include <vector>
-
- #include "Room.h"
- #include "Texture.h"
- #include "ViewVolume.h"
-
- #include "WorldData.h"
-
-
- class Render {
- public:
-
- typedef enum {
- modeDisabled,
- modeLoadScreen,
- modeVertexLight,
- modeSolid,
- modeWireframe,
- modeTexture
- } RenderMode;
-
- typedef enum {
- fRoomAlpha = (1 << 0),
- fViewModel = (1 << 1),
- fEntityModels = (1 << 2),
- fFog = (1 << 3),
- fUsePortals = (1 << 4),
- fGL_Lights = (1 << 5),
- fOneRoom = (1 << 6),
- fRenderPonytail = (1 << 7),
-
- fUpdateRoomListPerFrame = (1 << 9),
- fAnimateAllModels = (1 << 10),
- fAllRooms = (1 << 11)
- } RenderFlags;
-
-
-
- Render();
-
-
-
- ~Render();
-
-
-
- void screenShot(char *filenameBase);
-
-
-
- int getMode();
-
-
-
- void loadTexture(unsigned char *image,
- unsigned int width, unsigned int height,
- unsigned int id);
-
-
-
- int initTextures(char *textureDir);
-
-
-
- void ClearWorld();
-
-
-
- void clearFlags(unsigned int flags);
-
-
-
- void setFlags(unsigned int flags);
-
- void setMode(int n);
-
-
-
- void display();
-
- void setSkyMesh(int index, bool rot);
-
- unsigned int getFlags();
-
-
-
- bool isVisible(float x, float y, float z);
-
-
-
- bool isVisible(float x, float y, float z, float radius);
-
- bool isVisible(BoundingBox &box);
-
-
-
- void drawModelMesh(model_mesh_t *r_mesh);
-
-
-
- ViewVolume mViewVolume;
- Texture mTexture;
-
- private:
-
- void drawLoadScreen();
-
-
-
- void newRoomRenderList(int index);
-
-
-
- void buildRoomRenderList(Room &room);
-
-
-
- void drawObjects();
-
-
-
- void drawSkyMesh(float scale);
-
-
-
- void drawModel(SkeletalModel *model);
-
-
-
- void updateViewVolume();
-
-
- void tmpRenderModelMesh(model_mesh_t *r_mesh, texture_tri_t *ttri);
-
- std::vector<Room *> mRoomRenderList;
-
- unsigned int mFlags;
- unsigned int mMode;
- int mLock;
- int mSkyMesh;
- bool mSkyMeshRotation;
- };
-
- Render &getRender();
-
- #endif
|