1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00
openrw/rwengine/include/loaders/LoaderDFF.hpp

50 lines
819 B
C++
Raw Normal View History

2013-07-02 08:06:03 +02:00
#pragma once
#ifndef _LOADERDFF_HPP_
#define _LOADERDFF_HPP_
2013-07-02 08:06:03 +02:00
#define GLEW_STATIC
#include <GL/glew.h>
#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
};
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();
};
#endif