mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Rework internal module registration to happen in constructors.
This commit is contained in:
@@ -35,15 +35,20 @@ namespace video
|
||||
class Video : public Module
|
||||
{
|
||||
public:
|
||||
virtual ~Video() {}
|
||||
|
||||
// Implements Module
|
||||
virtual ModuleType getModuleType() const { return M_VIDEO; }
|
||||
virtual ~Video() {}
|
||||
|
||||
/**
|
||||
* Create a VideoStream representing video frames
|
||||
**/
|
||||
virtual VideoStream *newVideoStream(love::filesystem::File *file) = 0;
|
||||
|
||||
protected:
|
||||
|
||||
Video(const char *name)
|
||||
: Module(M_VIDEO, name)
|
||||
{}
|
||||
|
||||
}; // Video
|
||||
|
||||
} // video
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace theora
|
||||
{
|
||||
|
||||
Video::Video()
|
||||
: love::video::Video("love.video.theora")
|
||||
{
|
||||
workerThread = new Worker();
|
||||
workerThread->start();
|
||||
@@ -51,11 +52,6 @@ VideoStream *Video::newVideoStream(love::filesystem::File *file)
|
||||
return stream;
|
||||
}
|
||||
|
||||
const char *Video::getName() const
|
||||
{
|
||||
return "love.video.theora";
|
||||
}
|
||||
|
||||
Worker::Worker()
|
||||
: stopping(false)
|
||||
{
|
||||
|
||||
@@ -46,9 +46,6 @@ public:
|
||||
Video();
|
||||
virtual ~Video();
|
||||
|
||||
// Implements Module
|
||||
virtual const char *getName() const;
|
||||
|
||||
VideoStream *newVideoStream(love::filesystem::File* file);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user