diff options
author | Einar Johan Trøan Sømåen | 2012-05-11 00:12:28 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-02 12:42:10 +0200 |
commit | 4cf1d67140fbcf290a8ad1100ede7717a43e0863 (patch) | |
tree | 0277c6a0b2649c5abbe1ab87dc40559e4245d9e9 /engines | |
parent | 2e12f9fe4d74e6f6d6ebe753fa24f863f901e312 (diff) | |
download | scummvm-rg350-4cf1d67140fbcf290a8ad1100ede7717a43e0863.tar.gz scummvm-rg350-4cf1d67140fbcf290a8ad1100ede7717a43e0863.tar.bz2 scummvm-rg350-4cf1d67140fbcf290a8ad1100ede7717a43e0863.zip |
WINTERMUTE: Remove a few SDL-includes.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wintermute/BFontTT.cpp | 20 | ||||
-rw-r--r-- | engines/wintermute/BFontTT.h | 7 | ||||
-rw-r--r-- | engines/wintermute/BObject.h | 1 | ||||
-rw-r--r-- | engines/wintermute/BRenderSDL.cpp | 15 | ||||
-rw-r--r-- | engines/wintermute/BRenderSDL.h | 1 | ||||
-rw-r--r-- | engines/wintermute/BSurfaceSDL.cpp | 17 | ||||
-rw-r--r-- | engines/wintermute/BSurfaceSDL.h | 11 | ||||
-rw-r--r-- | engines/wintermute/FontGlyphCache.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/FontGlyphCache.h | 9 |
9 files changed, 49 insertions, 35 deletions
diff --git a/engines/wintermute/BFontTT.cpp b/engines/wintermute/BFontTT.cpp index 5e4370d69f..8019429329 100644 --- a/engines/wintermute/BFontTT.cpp +++ b/engines/wintermute/BFontTT.cpp @@ -238,7 +238,8 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex TextLineList::iterator it;
-
+ warning("CBFontTT::RenderTextToTexture - Not ported yet");
+#if 0 //TODO
int textHeight = lines.size() * (_maxCharHeight + _ascender);
SDL_Surface *surface = SDL_CreateRGBSurface(0, width, textHeight, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
@@ -328,21 +329,24 @@ CBSurface *CBFontTT::RenderTextToTexture(const WideString &text, int width, TTex delete wmeSurface;
return NULL;
}
+#endif
+ return NULL;
}
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::BlitSurface(SDL_Surface *src, SDL_Surface *target, SDL_Rect *targetRect) {
+void CBFontTT::BlitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect) {
//SDL_BlitSurface(src, NULL, target, targetRect);
-
+ warning("CBFontTT::BlitSurface - not ported yet");
+#if 0
for (int y = 0; y < src->h; y++) {
if (targetRect->y + y < 0 || targetRect->y + y >= target->h) continue;
- Uint8 *srcBuf = (Uint8 *)src->pixels + y * src->pitch;
- Uint8 *tgtBuf = (Uint8 *)target->pixels + (y + targetRect->y) * target->pitch;
+ uint8 *srcBuf = (uint8 *)src->pixels + y * src->pitch;
+ uint8 *tgtBuf = (uint8 *)target->pixels + (y + targetRect->y) * target->pitch;
- Uint32 *srcBuf32 = (Uint32 *)srcBuf;
- Uint32 *tgtBuf32 = (Uint32 *)tgtBuf;
+ uint32 *srcBuf32 = (uint32 *)srcBuf;
+ uint32 *tgtBuf32 = (uint32 *)tgtBuf;
for (int x = 0; x < src->w; x++) {
if (targetRect->x + x < 0 || targetRect->x + x >= target->w) continue;
@@ -350,7 +354,7 @@ void CBFontTT::BlitSurface(SDL_Surface *src, SDL_Surface *target, SDL_Rect *targ tgtBuf32[x + targetRect->x] = srcBuf32[x];
}
}
-
+#endif
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/BFontTT.h b/engines/wintermute/BFontTT.h index 9dc3de1920..812fc61b2e 100644 --- a/engines/wintermute/BFontTT.h +++ b/engines/wintermute/BFontTT.h @@ -32,10 +32,11 @@ #include "BFontStorage.h"
#include "BFont.h"
#include "BSurface.h"
+#include "common/rect.h"
+#include "graphics/surface.h"
#define NUM_CACHED_TEXTS 30
-class SDL_Surface;
-class SDL_Rect;
+
namespace WinterMute {
class FontGlyphCache;
@@ -150,7 +151,7 @@ private: void CacheGlyph(wchar_t ch);
CBSurface *RenderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset);
- void BlitSurface(SDL_Surface *src, SDL_Surface *target, SDL_Rect *targetRect);
+ void BlitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect);
CBCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
diff --git a/engines/wintermute/BObject.h b/engines/wintermute/BObject.h index 43fe719ae2..835d5fe34a 100644 --- a/engines/wintermute/BObject.h +++ b/engines/wintermute/BObject.h @@ -30,7 +30,6 @@ #define WINTERMUTE_BOBJECT_H
-//#include "SDL.h"
#include "BScriptHolder.h"
#include "persistent.h"
diff --git a/engines/wintermute/BRenderSDL.cpp b/engines/wintermute/BRenderSDL.cpp index a8e18c74d2..613995124f 100644 --- a/engines/wintermute/BRenderSDL.cpp +++ b/engines/wintermute/BRenderSDL.cpp @@ -36,7 +36,6 @@ #include "engines/wintermute/BGame.h"
#include "engines/wintermute/BSprite.h"
#include "common/system.h"
-#include "SDL.h"
namespace WinterMute {
@@ -147,7 +146,8 @@ HRESULT CBRenderSDL::InitRenderer(int width, int height, bool windowed) { if (!_win) return E_FAIL;
#endif
- SDL_ShowCursor(SDL_DISABLE);
+ warning("TODO: Hide cursor");
+ //SDL_ShowCursor(SDL_DISABLE);
#ifdef __IPHONEOS__
// SDL defaults to OGL ES2, which doesn't work on old devices
@@ -366,11 +366,12 @@ const char *CBRenderSDL::GetName() { //////////////////////////////////////////////////////////////////////////
HRESULT CBRenderSDL::SetViewport(int left, int top, int right, int bottom) {
- SDL_Rect rect;
- rect.x = left + _borderLeft;
- rect.y = top + _borderTop;
- rect.w = (right - left) * _ratioX;
- rect.h = (bottom - top) * _ratioY;
+ Common::Rect rect;
+ // TODO: Hopefully this is the same logic that ScummVM uses.
+ rect.left = left + _borderLeft;
+ rect.top = top + _borderTop;
+ rect.right = (right - left) * _ratioX;
+ rect.bottom = (bottom - top) * _ratioY;
// TODO fix this once viewports work correctly in SDL/landscape
#ifndef __IPHONEOS__
diff --git a/engines/wintermute/BRenderSDL.h b/engines/wintermute/BRenderSDL.h index 73d3bbac29..2d55a3c003 100644 --- a/engines/wintermute/BRenderSDL.h +++ b/engines/wintermute/BRenderSDL.h @@ -30,7 +30,6 @@ #define WINTERMUTE_BRENDERER_SDL_H
#include "BRenderer.h"
-/*#include "SDL.h"*/
#include "common/rect.h"
#include "graphics/surface.h"
diff --git a/engines/wintermute/BSurfaceSDL.cpp b/engines/wintermute/BSurfaceSDL.cpp index b976585b0b..0f30101780 100644 --- a/engines/wintermute/BSurfaceSDL.cpp +++ b/engines/wintermute/BSurfaceSDL.cpp @@ -181,7 +181,10 @@ HRESULT CBSurfaceSDL::Create(char *Filename, bool default_ck, byte ck_red, byte }
//////////////////////////////////////////////////////////////////////////
-void CBSurfaceSDL::GenAlphaMask(SDL_Surface *surface) {
+void CBSurfaceSDL::GenAlphaMask(Graphics::Surface *surface) {
+ warning("CBSurfaceSDL::GenAlphaMask - Not ported yet");
+ return;
+#if 0
delete[] _alphaMask;
_alphaMask = NULL;
if (!surface) return;
@@ -220,13 +223,16 @@ void CBSurfaceSDL::GenAlphaMask(SDL_Surface *surface) { delete[] _alphaMask;
_alphaMask = NULL;
}
+#endif
}
//////////////////////////////////////////////////////////////////////////
-Uint32 CBSurfaceSDL::GetPixel(SDL_Surface *surface, int x, int y) {
+uint32 CBSurfaceSDL::GetPixel(Graphics::Surface *surface, int x, int y) {
+ warning("CBSurfaceSDL::GetPixel - Not ported yet");
+#if 0
int bpp = surface->format->BytesPerPixel;
/* Here p is the address to the pixel we want to retrieve */
- Uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
+ uint8 *p = (Uint8 *)surface->pixels + y * surface->pitch + x * bpp;
switch (bpp) {
case 1:
@@ -251,6 +257,7 @@ Uint32 CBSurfaceSDL::GetPixel(SDL_Surface *surface, int x, int y) { default:
return 0; /* shouldn't happen, but avoids warnings */
}
+#endif
}
//////////////////////////////////////////////////////////////////////////
@@ -271,7 +278,7 @@ HRESULT CBSurfaceSDL::Create(int Width, int Height) { }
//////////////////////////////////////////////////////////////////////////
-HRESULT CBSurfaceSDL::CreateFromSDLSurface(SDL_Surface *surface) {
+HRESULT CBSurfaceSDL::CreateFromSDLSurface(Graphics::Surface *surface) {
warning("CBSurfaceSDL::CreateFromSDLSurface not ported yet"); //TODO
#if 0
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
@@ -314,7 +321,7 @@ bool CBSurfaceSDL::IsTransparentAt(int X, int Y) { bool CBSurfaceSDL::IsTransparentAtLite(int X, int Y) {
//if (!_lockPixels) return false;
- Uint32 format;
+ uint32 format;
int access;
int width, height;
// This particular warning is rather messy, as this function is called a ton,
diff --git a/engines/wintermute/BSurfaceSDL.h b/engines/wintermute/BSurfaceSDL.h index 9053af3d7d..792dd01e6d 100644 --- a/engines/wintermute/BSurfaceSDL.h +++ b/engines/wintermute/BSurfaceSDL.h @@ -31,9 +31,8 @@ #include "graphics/surface.h"
#include "BSurface.h"
-#include "SDL.h" // TODO, remove
-class SDL_Texture;
-class SDL_Surface;
+#include "graphics/surface.h"
+
namespace WinterMute {
class CBSurfaceSDL : public CBSurface {
@@ -44,7 +43,7 @@ public: HRESULT Create(char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime = -1, bool KeepLoaded = false);
HRESULT Create(int Width, int Height);
- HRESULT CreateFromSDLSurface(SDL_Surface *surface);
+ HRESULT CreateFromSDLSurface(Graphics::Surface *surface); //TODO: Rename function
bool IsTransparentAt(int X, int Y);
bool IsTransparentAtLite(int X, int Y);
@@ -69,8 +68,8 @@ private: Graphics::Surface *_surface;
HRESULT DrawSprite(int X, int Y, RECT *Rect, float ZoomX, float ZoomY, uint32 Alpha, bool AlphaDisable, TSpriteBlendMode BlendMode, bool MirrorX, bool MirrorY, int offsetX = 0, int offsetY = 0);
- void GenAlphaMask(SDL_Surface *surface);
- uint32 GetPixel(SDL_Surface *surface, int x, int y);
+ void GenAlphaMask(Graphics::Surface *surface);
+ uint32 GetPixel(Graphics::Surface *surface, int x, int y);
void *_lockPixels;
int _lockPitch;
diff --git a/engines/wintermute/FontGlyphCache.cpp b/engines/wintermute/FontGlyphCache.cpp index d161c749cf..81ecd49c86 100644 --- a/engines/wintermute/FontGlyphCache.cpp +++ b/engines/wintermute/FontGlyphCache.cpp @@ -71,6 +71,8 @@ void FontGlyphCache::AddGlyph(wchar_t ch, int glyphIndex, FT_GlyphSlot glyphSlot //////////////////////////////////////////////////////////////////////////
void GlyphInfo::SetGlyphImage(size_t width, size_t height, size_t stride, byte *pixels) {
+ warning("GlyphInfo::SetGlyphImage - Not ported yet");
+#if 0
if (_image) SDL_FreeSurface(_image);
_image = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
@@ -91,6 +93,7 @@ void GlyphInfo::SetGlyphImage(size_t width, size_t height, size_t stride, byte * }
SDL_UnlockSurface(_image);
+#endif
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/FontGlyphCache.h b/engines/wintermute/FontGlyphCache.h index 6800ec996b..7fac01e40c 100644 --- a/engines/wintermute/FontGlyphCache.h +++ b/engines/wintermute/FontGlyphCache.h @@ -27,8 +27,8 @@ THE SOFTWARE. #define __WmeFontGlyphCache_H__
-#include "SDL.h"
#include "BFontStorage.h"
+#include "graphics/surface.h"
namespace WinterMute {
@@ -46,7 +46,8 @@ public: }
~GlyphInfo() {
- if (_image) SDL_FreeSurface(_image);
+ // TODO
+ //if (_image) SDL_FreeSurface(_image);
}
void SetGlyphInfo(float AdvanceX, float AdvanceY, int BearingX, int BearingY) {
@@ -79,7 +80,7 @@ public: int GetBearingY() {
return _bearingY;
}
- SDL_Surface *GetImage() {
+ Graphics::Surface *GetImage() {
return _image;
}
@@ -94,7 +95,7 @@ private: int _width;
int _height;
- SDL_Surface *_image;
+ Graphics::Surface *_image;
};
|