2013-07-02 08:06:03 +02:00
|
|
|
#pragma once
|
2013-07-02 08:40:43 +02:00
|
|
|
#ifndef _LOADERDFF_HPP_
|
|
|
|
#define _LOADERDFF_HPP_
|
2013-07-02 08:06:03 +02:00
|
|
|
|
|
|
|
#define GLEW_STATIC
|
|
|
|
#include <GL/glew.h>
|
|
|
|
|
2013-12-20 15:03:32 +01:00
|
|
|
#include <loaders/rwbinarystream.h>
|
2013-07-02 08:06:03 +02:00
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
2014-06-04 12:53:11 +02:00
|
|
|
#include <WorkContext.hpp>
|
2013-07-02 08:06:03 +02:00
|
|
|
|
2013-09-25 10:05:18 +02:00
|
|
|
class Model;
|
2013-08-18 21:31:37 +02:00
|
|
|
|
2013-12-20 17:02:46 +01:00
|
|
|
class GameData;
|
2013-07-02 08:06:03 +02:00
|
|
|
|
|
|
|
class LoaderDFF
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
template<class T> T readStructure(char *data, size_t &dataI);
|
|
|
|
RW::BSSectionHeader readHeader(char *data, size_t &dataI);
|
|
|
|
|
|
|
|
public:
|
2013-12-20 17:02:46 +01:00
|
|
|
Model* loadFromMemory(char *data, GameData* gameData);
|
2013-07-02 08:06:03 +02:00
|
|
|
};
|
2013-07-02 08:40:43 +02:00
|
|
|
|
2014-06-04 12:53:11 +02:00
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
class LoadModelJob : public WorkJob
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::function<void ( Model* )> ModelCallback;
|
|
|
|
|
|
|
|
private:
|
|
|
|
GameData* _gameData;
|
|
|
|
std::string _file;
|
|
|
|
ModelCallback _callback;
|
|
|
|
char* _data;
|
|
|
|
public:
|
|
|
|
|
2014-06-06 13:18:32 +02:00
|
|
|
LoadModelJob(WorkContext* context, GameData* gd, const std::string& file, ModelCallback cb);
|
2014-06-04 12:53:11 +02:00
|
|
|
|
|
|
|
void work();
|
|
|
|
|
|
|
|
void complete();
|
|
|
|
};
|
|
|
|
|
2013-07-24 02:44:08 +02:00
|
|
|
#endif
|