SYSTEM: Add side textures as a System feature
This commit is contained in:
parent
147ba6ecbb
commit
8fc79af213
4 changed files with 41 additions and 2 deletions
|
@ -113,9 +113,12 @@ public:
|
|||
virtual int16 getOverlayHeight() { return _overlayHeight; }
|
||||
virtual int16 getOverlayWidth() { return _overlayWidth; }
|
||||
void closeOverlay(); // ResidualVM specific method
|
||||
#ifdef SDL_BACKEND
|
||||
|
||||
/* Render the passed Surfaces besides the game texture.
|
||||
* This is used for widescreen support in the Grim engine.
|
||||
* Note: we must copy the Surfaces, as they are free()d after this call.
|
||||
*/
|
||||
virtual void setSideTextures(Graphics::Surface *left, Graphics::Surface *right);
|
||||
#endif
|
||||
|
||||
virtual bool showMouse(bool visible);
|
||||
virtual void warpMouse(int x, int y);
|
||||
|
|
|
@ -438,3 +438,17 @@ Common::TimerManager *OSystem_SDL::getTimerManager() {
|
|||
return _timerManager;
|
||||
#endif
|
||||
}
|
||||
|
||||
// ResidualVM specific code
|
||||
bool OSystem_SDL::hasFeature(Feature f) {
|
||||
if (f == kFeatureSideTextures)
|
||||
return true;
|
||||
return ModularBackend::hasFeature(f);
|
||||
}
|
||||
|
||||
// ResidualVM specific code
|
||||
void OSystem_SDL::suggestSideTextures(Graphics::Surface *left,
|
||||
Graphics::Surface *right) {
|
||||
SurfaceSdlGraphicsManager *ssgm = dynamic_cast<SurfaceSdlGraphicsManager *>(_graphicsManager);
|
||||
ssgm->setSideTextures(left, right);
|
||||
}
|
||||
|
|
|
@ -77,6 +77,11 @@ public:
|
|||
virtual Audio::Mixer *getMixer();
|
||||
virtual Common::TimerManager *getTimerManager();
|
||||
|
||||
// ResidualVM specific code
|
||||
virtual bool hasFeature(Feature f);
|
||||
// ResidualVM specific code
|
||||
virtual void suggestSideTextures(Graphics::Surface *left,
|
||||
Graphics::Surface *right) override;
|
||||
protected:
|
||||
bool _inited;
|
||||
bool _initedSDL;
|
||||
|
|
|
@ -313,6 +313,8 @@ public:
|
|||
//ResidualVM specific
|
||||
kFeatureOpenGL,
|
||||
kFeatureVirtControls,
|
||||
// Can side textures be rendered on the side for widescreen support?
|
||||
kFeatureSideTextures,
|
||||
|
||||
/**
|
||||
* The presence of this feature indicates whether the displayLogFile()
|
||||
|
@ -666,6 +668,21 @@ public:
|
|||
|
||||
virtual Graphics::PixelBuffer setupScreen(uint screenW, uint screenH, bool fullscreen, bool accel3d) = 0;
|
||||
|
||||
/**
|
||||
* Suggest textures to render at the side of the game window.
|
||||
* This enables eg. Grim to render the game in a widescreen format.
|
||||
*
|
||||
* The system must take a copy of the Surfaces, as they will be free()d
|
||||
* automatically.
|
||||
*
|
||||
* !!! ResidualVM specific method: !!!
|
||||
*
|
||||
* @param left Texture to be used on the left
|
||||
* @param height Texture to be used on the right
|
||||
*/
|
||||
virtual void suggestSideTextures(Graphics::Surface *left,
|
||||
Graphics::Surface *right) {};
|
||||
|
||||
/**
|
||||
* Returns the currently set virtual screen height.
|
||||
* @see initSize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue