mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-02 14:57:59 +03:00
Merge mangle into openmw
This commit is contained in:
commit
48c12e9d5c
161 changed files with 9115 additions and 4 deletions
37
libs/mangle/stream/servers/ogre_datastream.hpp
Normal file
37
libs/mangle/stream/servers/ogre_datastream.hpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef MANGLE_STREAM_OGRESERVER_H
|
||||
#define MANGLE_STREAM_OGRESERVER_H
|
||||
|
||||
#include <OgreDataStream.h>
|
||||
|
||||
namespace Mangle {
|
||||
namespace Stream {
|
||||
|
||||
/** A Stream wrapping an OGRE DataStream.
|
||||
|
||||
This has been built and tested against OGRE 1.6.2. You might have
|
||||
to make your own modifications if you're working with newer (or
|
||||
older) versions.
|
||||
*/
|
||||
class OgreStream : public Stream
|
||||
{
|
||||
Ogre::DataStreamPtr inp;
|
||||
|
||||
public:
|
||||
OgreStream(Ogre::DataStreamPtr _inp) : inp(_inp)
|
||||
{
|
||||
isSeekable = true;
|
||||
hasPosition = true;
|
||||
hasSize = true;
|
||||
}
|
||||
|
||||
size_t read(void *buf, size_t count) { return inp->read(buf,count); }
|
||||
void seek(size_t pos) { inp->seek(pos); }
|
||||
size_t tell() const { return inp->tell(); }
|
||||
size_t size() const { return inp->size(); }
|
||||
bool eof() const { return inp->eof(); }
|
||||
};
|
||||
|
||||
typedef boost::shared_ptr<OgreStream> OgreStreamPtr;
|
||||
|
||||
}} // namespaces
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue