wavelength 1.0.0
Loading...
Searching...
No Matches
rndmovie.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4#include <list>
5
6#include "os/binstream.h"
7#include "os/filepath.h"
8#include "os/mem.h"
9#include "os/prnstream.h"
10#include "rnd/rndanimatable.h"
11#include "rnd/rndtex.h"
12
19class RndMovie : public RndAnimatable {
20public:
28 explicit RndMovie(const char *pszName);
29
36 ~RndMovie() override;
37
44 void *operator new(size_t nSize) {
45 return PoolMemAlloc(static_cast<int>(nSize), "Movie", 0);
46 }
47
53 void operator delete(void *pBlock) {
54 PoolMemFree(pBlock);
55 }
56
64 void ListAnimObjects(std::list<RndObject *> &objects) override;
65
74 virtual void Open();
75
84 virtual void Close();
85
93 void DumpText(PrnStream &stream) override;
94
102 void Save(BinStream &stream) override;
103
112 void Replace(RndObject *pFrom, RndObject *pTo) override;
113
121 const char *ClassName() const override {
122 return sClassName;
123 }
124
133 void Copy(const RndObject *pSource, int nFlags) override;
134
145 void Load(BinStream &stream) override;
146
155 static RndObject *New(const char *pszName) {
156 return new RndMovie(pszName);
157 }
158
165 static const char *sClassName;
166
173 static int sRev;
174
176 const FilePath &GetFile() const {
177 return mFile;
178 }
179
181 RndTex *GetTex() const {
182 return mTex;
183 }
184
185protected:
188
189private:
190};
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Path of a file, kept relative to a shared root directory.
Definition filepath.h:14
Text output stream.
Definition prnstream.h:16
RndAnimatable()
Construct an animatable at frame 0 without children or filters.
Definition rndanimatable.h:600
void ListAnimObjects(std::list< RndObject * > &objects) override
Add the texture to a list, then the objects of the children.
const FilePath & GetFile() const
Definition rndmovie.h:176
void Load(BinStream &stream) override
Read what Save() wrote, or an earlier version of it, closing the movie first and opening it after.
RndTex * GetTex() const
Definition rndmovie.h:181
static int sRev
The format version Save() writes and Load() accepts.
Definition rndmovie.h:173
static RndObject * New(const char *pszName)
Create a movie.
Definition rndmovie.h:155
void Copy(const RndObject *pSource, int nFlags) override
Copy another movie and its base, closing the movie first and opening it after.
virtual void Open()
Take a reference on the texture.
~RndMovie() override
Close the movie.
void Save(BinStream &stream) override
Write the movie and its base.
void Replace(RndObject *pFrom, RndObject *pTo) override
Replace the texture with another.
void DumpText(PrnStream &stream) override
Write a description of the movie and its base.
static const char * sClassName
The class name a .rnd file writes, Movie.
Definition rndmovie.h:165
const char * ClassName() const override
Report the class name.
Definition rndmovie.h:121
virtual void Close()
Drop the reference on the texture.
RndTex * mTex
Definition rndmovie.h:187
RndMovie(const char *pszName)
Construct a movie without a file or a texture.
FilePath mFile
Definition rndmovie.h:186
RndObject(const char *pszName)
Construct an object and register it under a name.
Texture, a bitmap loaded from a file or rendered to.
Definition rndtex.h:17
void * PoolMemAlloc(int nSize, const char *pszTag, int nAlign)
Allocate a block from the pool heaps and bill it to a tag.
void PoolMemFree(void *pBlock)
Return a block PoolMemAlloc() handed out to the pool heap that owns it.