📄 world.h
字号:
#ifndef __WORLD_H
#define __WORLD_H
/*
WORLD.H
The CWorld class
Author: Kevin Hawkins
Date: 3/29/2001
Description: The CWorld class represents the game world
of the engine. All objects, the terrain,
audio system, ambient world music and sound,
and the camera are held here.
*/
#include <dmusicc.h> // DirectMusic includes
#include <dmusici.h>
#include <d3d8types.h> // for D3DVECTOR
#include <cguid.h> // for GUID_NULL
#include "entity.h"
#include "md2.h"
#include "object.h"
#include "camera.h"
#include "terrain.h"
#include "audiosystem.h"
#include "tree.h"
class CWorld
{
protected:
void OnAnimate(float deltaTime);
void OnDraw(CCamera *camera);
void OnPrepare();
public:
HWND hwnd;
CTerrain *terrain; // the terrain
CCamera *camera; // the camera
CEntity *enemy; // enemy 1
CEntity *enemy2; // enemy 2
CAudioSystem *audioSystem; // the audio system
CAudio *worldSound; // the world ambient sound
CAudio *gameMusic; // the game's music
CWorld();
CWorld(CCamera *c);
~CWorld();
// initialize terrain, load objects and put in container
void LoadWorld();
void UnloadWorld();
// do physics calculations for all objects in the world
// including collisions
void Animate(float deltaTime);
// render all objects in the world
void Draw(CCamera *camera);
void Prepare() { OnPrepare(); }
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -