2013-07-02 08:40:43 +02:00
|
|
|
#pragma once
|
|
|
|
#ifndef _GTAENGINE_HPP_
|
|
|
|
#define _GTAENGINE_HPP_
|
|
|
|
|
|
|
|
#include <renderwure/engine/GTAData.hpp>
|
|
|
|
#include <renderwure/loaders/LoaderIPL.hpp>
|
2013-07-02 09:53:23 +02:00
|
|
|
#include <renderwure/render/GTARenderer.hpp>
|
2013-07-02 08:40:43 +02:00
|
|
|
|
2013-07-02 08:06:03 +02:00
|
|
|
#include <glm/glm.hpp>
|
|
|
|
|
2013-07-02 08:40:43 +02:00
|
|
|
#include <vector>
|
2013-07-02 12:48:01 +02:00
|
|
|
#include <queue>
|
2013-07-02 08:40:43 +02:00
|
|
|
|
2013-07-02 08:06:03 +02:00
|
|
|
/**
|
|
|
|
* @class GTAEngine
|
|
|
|
* Provides a simple interface to the framework's internals
|
|
|
|
*/
|
|
|
|
class GTAEngine
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
GTAEngine(const std::string& gamepath);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Loads the game data
|
|
|
|
*/
|
|
|
|
bool load();
|
|
|
|
|
2013-07-02 12:48:01 +02:00
|
|
|
struct LogEntry
|
|
|
|
{
|
|
|
|
enum Type {
|
|
|
|
Info,
|
|
|
|
Error,
|
|
|
|
Warning
|
|
|
|
};
|
|
|
|
|
|
|
|
Type type;
|
|
|
|
float time;
|
|
|
|
std::string message;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::queue<LogEntry> log;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays an informative message
|
|
|
|
*/
|
|
|
|
void logInfo(const std::string& info);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays an alarming error
|
|
|
|
*/
|
|
|
|
void logError(const std::string& error);
|
|
|
|
|
2013-07-02 08:06:03 +02:00
|
|
|
/**
|
|
|
|
* Loads an IPL into the game.
|
|
|
|
* @param name The name of the IPL as it appears in the games' gta.dat
|
|
|
|
*/
|
|
|
|
bool loadItems(const std::string& name);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Roughly the middle of everything
|
|
|
|
*/
|
|
|
|
glm::vec3 itemCentroid;
|
|
|
|
|
2013-07-02 12:48:01 +02:00
|
|
|
/**
|
|
|
|
* Game Clock
|
|
|
|
*/
|
|
|
|
float gameTime;
|
|
|
|
|
2013-07-02 08:06:03 +02:00
|
|
|
/**
|
|
|
|
* Game data
|
|
|
|
*/
|
|
|
|
GTAData gameData;
|
|
|
|
|
2013-07-02 09:53:23 +02:00
|
|
|
/**
|
|
|
|
* Renderer
|
|
|
|
*/
|
|
|
|
GTARenderer renderer;
|
|
|
|
|
2013-07-02 08:06:03 +02:00
|
|
|
/**
|
|
|
|
* Until we have a real "object" class, just store a list of loaed instances.
|
|
|
|
*/
|
|
|
|
std::vector<LoaderIPLInstance> instances;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|