GRIM: #includes cleanup.
This commit is contained in:
parent
16c19523b9
commit
38e208c00c
18 changed files with 38 additions and 44 deletions
|
@ -29,8 +29,6 @@
|
|||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
#include "engines/grim/gfx_base.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/colormap.h"
|
||||
|
||||
namespace Grim {
|
||||
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/keyframe.h"
|
||||
#include "engines/grim/material.h"
|
||||
#include "engines/grim/lua.h"
|
||||
#include "engines/grim/lipsync.h"
|
||||
#include "engines/grim/resource.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/model.h"
|
||||
|
@ -40,6 +38,8 @@
|
|||
#include "engines/grim/objectstate.h"
|
||||
#include "engines/grim/gfx_base.h"
|
||||
|
||||
#include "engines/grim/lua/lua.h"
|
||||
|
||||
#include "engines/grim/imuse/imuse.h"
|
||||
|
||||
namespace Grim {
|
||||
|
|
|
@ -23,22 +23,26 @@
|
|||
#ifndef GRIM_GFX_BASE_H
|
||||
#define GRIM_GFX_BASE_H
|
||||
|
||||
#include "engines/grim/model.h"
|
||||
#include "engines/grim/scene.h"
|
||||
#include "graphics/vector3d.h"
|
||||
|
||||
namespace Grim {
|
||||
|
||||
struct Shadow;
|
||||
class SaveGame;
|
||||
class BitmapData;
|
||||
class Bitmap;
|
||||
class CMap;
|
||||
class Color;
|
||||
class MaterialData;
|
||||
class PrimitiveObject;
|
||||
class Font;
|
||||
class TextObject;
|
||||
|
||||
class Material;
|
||||
class ModelNode;
|
||||
class Mesh;
|
||||
class MeshFace;
|
||||
class Sprite;
|
||||
class Light;
|
||||
|
||||
enum colorFormat {
|
||||
BM_RGB565 = 1, // Grim Fandango
|
||||
|
@ -81,7 +85,7 @@ public:
|
|||
|
||||
virtual void enableLights() = 0;
|
||||
virtual void disableLights() = 0;
|
||||
virtual void setupLight(Scene::Light *light, int lightId) = 0;
|
||||
virtual void setupLight(Light *light, int lightId) = 0;
|
||||
|
||||
virtual void createMaterial(MaterialData *material, const char *data, const CMap *cmap) = 0;
|
||||
virtual void selectMaterial(const Material *material) = 0;
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
#include "engines/grim/lipsync.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
#include "engines/grim/primitives.h"
|
||||
#include "engines/grim/model.h"
|
||||
#include "engines/grim/scene.h"
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
|
||||
|
@ -536,7 +538,7 @@ void GfxOpenGL::disableLights() {
|
|||
glDisable(GL_LIGHTING);
|
||||
}
|
||||
|
||||
void GfxOpenGL::setupLight(Scene::Light *light, int lightId) {
|
||||
void GfxOpenGL::setupLight(Light *light, int lightId) {
|
||||
glEnable(GL_LIGHTING);
|
||||
float lightColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
float lightPos[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
void enableLights();
|
||||
void disableLights();
|
||||
void setupLight(Scene::Light *light, int lightId);
|
||||
void setupLight(Light *light, int lightId);
|
||||
|
||||
void createMaterial(MaterialData *material, const char *data, const CMap *cmap);
|
||||
void selectMaterial(const Material *material);
|
||||
|
|
|
@ -32,6 +32,8 @@
|
|||
#include "engines/grim/lipsync.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
#include "engines/grim/primitives.h"
|
||||
#include "engines/grim/model.h"
|
||||
#include "engines/grim/scene.h"
|
||||
|
||||
namespace Grim {
|
||||
|
||||
|
@ -571,7 +573,7 @@ void GfxTinyGL::disableLights() {
|
|||
tglDisable(TGL_LIGHTING);
|
||||
}
|
||||
|
||||
void GfxTinyGL::setupLight(Scene::Light *light, int lightId) {
|
||||
void GfxTinyGL::setupLight(Light *light, int lightId) {
|
||||
assert(lightId < T_MAX_LIGHTS);
|
||||
tglEnable(TGL_LIGHTING);
|
||||
float lightColor[] = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
|
||||
void enableLights();
|
||||
void disableLights();
|
||||
void setupLight(Scene::Light *light, int lightId);
|
||||
void setupLight(Light *light, int lightId);
|
||||
|
||||
void createMaterial(MaterialData *material, const char *data, const CMap *cmap);
|
||||
void selectMaterial(const Material *material);
|
||||
|
|
|
@ -59,14 +59,12 @@
|
|||
#include "engines/grim/resource.h"
|
||||
#include "engines/grim/localize.h"
|
||||
#include "engines/grim/gfx_base.h"
|
||||
#include "engines/grim/object.h"
|
||||
#include "engines/grim/costume.h"
|
||||
#include "engines/grim/material.h"
|
||||
#include "engines/grim/lipsync.h"
|
||||
#include "engines/grim/lab.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
#include "engines/grim/font.h"
|
||||
#include "engines/grim/primitives.h"
|
||||
#include "engines/grim/objectstate.h"
|
||||
#include "engines/grim/scene.h"
|
||||
|
||||
#include "engines/grim/lua/lualib.h"
|
||||
|
||||
|
|
|
@ -28,9 +28,6 @@
|
|||
#include "base/commandLine.h"
|
||||
|
||||
#include "engines/grim/resource.h"
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/colormap.h"
|
||||
|
||||
#if defined(UNIX) || defined(__SYMBIAN32__)
|
||||
#include <sys/stat.h>
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
#include "common/endian.h"
|
||||
#include "common/debug.h"
|
||||
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/colormap.h"
|
||||
|
||||
#include "engines/grim/lua/ltask.h"
|
||||
#include "engines/grim/lua/lauxlib.h"
|
||||
|
|
|
@ -5,10 +5,6 @@
|
|||
#include "common/debug.h"
|
||||
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/actor.h"
|
||||
#include "engines/grim/colormap.h"
|
||||
#include "engines/grim/lipsync.h"
|
||||
|
||||
#include "engines/grim/lua/ltask.h"
|
||||
#include "engines/grim/lua/lauxlib.h"
|
||||
|
|
|
@ -24,11 +24,9 @@
|
|||
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/model.h"
|
||||
#include "engines/grim/actor.h"
|
||||
#include "engines/grim/material.h"
|
||||
#include "engines/grim/textsplit.h"
|
||||
#include "engines/grim/gfx_base.h"
|
||||
#include "engines/grim/lipsync.h"
|
||||
#include "engines/grim/resource.h"
|
||||
|
||||
namespace Grim {
|
||||
|
@ -497,6 +495,7 @@ void Mesh::changeMaterials(Material *materials[]) {
|
|||
_faces[i].changeMaterial(materials[_materialid[i]]);
|
||||
}
|
||||
|
||||
extern int g_winX1, g_winY1, g_winX2, g_winY2;
|
||||
void Mesh::draw() const {
|
||||
int winX1, winY1, winX2, winY2;
|
||||
g_driver->getBoundingBoxPos(this, &winX1, &winY1, &winX2, &winY2);
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "engines/grim/objectstate.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/lua.h"
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/colormap.h"
|
||||
#include "engines/grim/resource.h"
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "engines/grim/gfx_base.h"
|
||||
#include "engines/grim/primitives.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/lua.h"
|
||||
#include "engines/grim/colormap.h"
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
#include "common/rect.h"
|
||||
|
||||
#include "engines/grim/object.h"
|
||||
|
||||
namespace Grim {
|
||||
|
||||
class SaveGame;
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/lipsync.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/actor.h"
|
||||
#include "engines/grim/lab.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
#include "engines/grim/font.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "engines/grim/colormap.h"
|
||||
#include "engines/grim/grim.h"
|
||||
#include "engines/grim/savegame.h"
|
||||
#include "engines/grim/lua.h"
|
||||
#include "engines/grim/resource.h"
|
||||
#include "engines/grim/bitmap.h"
|
||||
#include "engines/grim/gfx_base.h"
|
||||
|
@ -432,7 +431,7 @@ void Scene::Setup::loadBinary(Common::MemoryReadStream *ms) {
|
|||
|
||||
}
|
||||
|
||||
void Scene::Light::load(TextSplitter &ts) {
|
||||
void Light::load(TextSplitter &ts) {
|
||||
char buf[256];
|
||||
|
||||
// Light names can be null, but ts doesn't seem flexible enough to allow this
|
||||
|
@ -462,7 +461,7 @@ void Scene::Light::load(TextSplitter &ts) {
|
|||
_enabled = true;
|
||||
}
|
||||
|
||||
void Scene::Light::loadBinary(Common::MemoryReadStream *ms) {
|
||||
void Light::loadBinary(Common::MemoryReadStream *ms) {
|
||||
// skip lights for now
|
||||
ms->seek(100, SEEK_CUR);
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace Grim {
|
|||
|
||||
class SaveGame;
|
||||
class CMap;
|
||||
class Light;
|
||||
|
||||
class Scene {
|
||||
public:
|
||||
|
@ -112,17 +113,6 @@ public:
|
|||
float _roll, _fov, _nclip, _fclip;
|
||||
};
|
||||
|
||||
struct Light { // Scene lighting data
|
||||
void load(TextSplitter &ts);
|
||||
void loadBinary(Common::MemoryReadStream *ms);
|
||||
Common::String _name;
|
||||
Common::String _type;
|
||||
Graphics::Vector3d _pos, _dir;
|
||||
Color _color;
|
||||
float _intensity, _umbraangle, _penumbraangle;
|
||||
bool _enabled;
|
||||
};
|
||||
|
||||
CMap *getCMap() {
|
||||
if (!_cmaps || ! _numCmaps)
|
||||
return NULL;
|
||||
|
@ -154,6 +144,18 @@ private:
|
|||
friend class GrimEngine;
|
||||
};
|
||||
|
||||
class Light { // Scene lighting data
|
||||
public:
|
||||
void load(TextSplitter &ts);
|
||||
void loadBinary(Common::MemoryReadStream *ms);
|
||||
Common::String _name;
|
||||
Common::String _type;
|
||||
Graphics::Vector3d _pos, _dir;
|
||||
Color _color;
|
||||
float _intensity, _umbraangle, _penumbraangle;
|
||||
bool _enabled;
|
||||
};
|
||||
|
||||
} // end of namespace Grim
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue