diff options
author | Torbjörn Andersson | 2004-04-23 07:02:11 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2004-04-23 07:02:11 +0000 |
commit | 8f8185f035d747c720371d88de90c54e43a543d0 (patch) | |
tree | 2599ef6fe6c74d0ea01bdb02e4a0619074da55d3 /sword2/driver | |
parent | fd38da7f134235c541860168f21c8706c2e62c19 (diff) | |
download | scummvm-rg350-8f8185f035d747c720371d88de90c54e43a543d0.tar.gz scummvm-rg350-8f8185f035d747c720371d88de90c54e43a543d0.tar.bz2 scummvm-rg350-8f8185f035d747c720371d88de90c54e43a543d0.zip |
Major revamping of the BS2 memory manager and, some small changes to the
resource manager. All new code! All new bugs!
svn-id: r13603
Diffstat (limited to 'sword2/driver')
-rw-r--r-- | sword2/driver/_mouse.cpp | 18 | ||||
-rw-r--r-- | sword2/driver/animation.cpp | 24 | ||||
-rw-r--r-- | sword2/driver/animation.h | 8 | ||||
-rw-r--r-- | sword2/driver/d_draw.h | 36 | ||||
-rw-r--r-- | sword2/driver/d_sound.cpp | 10 | ||||
-rw-r--r-- | sword2/driver/driver96.h | 4 | ||||
-rw-r--r-- | sword2/driver/menu.cpp | 4 | ||||
-rw-r--r-- | sword2/driver/palette.cpp | 6 | ||||
-rw-r--r-- | sword2/driver/render.cpp | 16 | ||||
-rw-r--r-- | sword2/driver/sprite.cpp | 44 |
10 files changed, 85 insertions, 85 deletions
diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp index f0dc663daf..d57b01a306 100644 --- a/sword2/driver/_mouse.cpp +++ b/sword2/driver/_mouse.cpp @@ -68,7 +68,7 @@ MouseEvent *Input::mouseEvent(void) { // 0xFF. That means that parts of the mouse cursor that weren't meant to be // transparent may be now. -void Graphics::decompressMouse(uint8 *decomp, uint8 *comp, int width, int height, int pitch, int xOff, int yOff) { +void Graphics::decompressMouse(byte *decomp, byte *comp, int width, int height, int pitch, int xOff, int yOff) { int32 size = width * height; int32 i = 0; int x = 0; @@ -155,7 +155,7 @@ void Graphics::drawMouse(void) { memset(_mouseData, 0xFF, mouse_width * mouse_height); if (_luggageAnim) - decompressMouse(_mouseData, (uint8 *) _luggageAnim + READ_LE_UINT32(_luggageOffset), _luggageAnim->mousew, + decompressMouse(_mouseData, (byte *) _luggageAnim + READ_LE_UINT32(_luggageOffset), _luggageAnim->mousew, _luggageAnim->mouseh, mouse_width, deltaX, deltaY); if (_mouseAnim) @@ -177,7 +177,7 @@ int32 Graphics::animateMouse(void) { if (++_mouseFrame == _mouseAnim->noAnimFrames) _mouseFrame = MOUSEFLASHFRAME; - _mouseSprite = (uint8 *) _mouseAnim + READ_LE_UINT32(_mouseOffsets + _mouseFrame); + _mouseSprite = (byte *) _mouseAnim + READ_LE_UINT32(_mouseOffsets + _mouseFrame); if (_mouseFrame != prevMouseFrame) drawMouse(); @@ -193,7 +193,7 @@ int32 Graphics::animateMouse(void) { * or not there is a lead-in animation */ -int32 Graphics::setMouseAnim(uint8 *ma, int32 size, int32 mouseFlash) { +int32 Graphics::setMouseAnim(byte *ma, int32 size, int32 mouseFlash) { if (_mouseAnim) { free(_mouseAnim); _mouseAnim = NULL; @@ -209,8 +209,8 @@ int32 Graphics::setMouseAnim(uint8 *ma, int32 size, int32 mouseFlash) { if (!_mouseAnim) return RDERR_OUTOFMEMORY; - memcpy((uint8 *) _mouseAnim, ma, size); - _mouseOffsets = (int32 *) ((uint8 *) _mouseAnim + sizeof(MouseAnim)); + memcpy((byte *) _mouseAnim, ma, size); + _mouseOffsets = (int32 *) ((byte *) _mouseAnim + sizeof(MouseAnim)); animateMouse(); drawMouse(); @@ -233,7 +233,7 @@ int32 Graphics::setMouseAnim(uint8 *ma, int32 size, int32 mouseFlash) { * @param size the size of the animation data */ -int32 Graphics::setLuggageAnim(uint8 *ma, int32 size) { +int32 Graphics::setLuggageAnim(byte *ma, int32 size) { if (_luggageAnim) { free(_luggageAnim); _luggageAnim = NULL; @@ -244,8 +244,8 @@ int32 Graphics::setLuggageAnim(uint8 *ma, int32 size) { if (!_luggageAnim) return RDERR_OUTOFMEMORY; - memcpy((uint8 *) _luggageAnim, ma, size); - _luggageOffset = (int32 *) ((uint8 *) _luggageAnim + sizeof(MouseAnim)); + memcpy((byte *) _luggageAnim, ma, size); + _luggageOffset = (int32 *) ((byte *) _luggageAnim + sizeof(MouseAnim)); animateMouse(); drawMouse(); diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp index 9785ed2110..53dad119f5 100644 --- a/sword2/driver/animation.cpp +++ b/sword2/driver/animation.cpp @@ -50,7 +50,7 @@ void AnimationState::setPalette(byte *pal) { #else -void AnimationState::drawTextObject(SpriteInfo *s, uint8 *src) { +void AnimationState::drawTextObject(SpriteInfo *s, byte *src) { OverlayColor *dst = overlay + RENDERWIDE * (s->y) + s->x; // FIXME: These aren't the "right" colours, but look good to me. @@ -166,7 +166,7 @@ void MoviePlayer::drawTextObject(AnimationState *anim, MovieTextObject *obj) { * @param musicOut lead-out music */ -int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *musicOut) { +int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], byte *musicOut) { // This happens if the user quits during the "eye" smacker if (_vm->_quit) return RD_OK; @@ -178,7 +178,7 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *mu uint32 flags = SoundMixer::FLAG_16BITS; bool startNextText = false; - uint8 oldPal[1024]; + byte oldPal[1024]; memcpy(oldPal, _vm->_graphics->_palCopy, 1024); AnimationState *anim = new AnimationState(_vm); @@ -342,11 +342,11 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *mu * are missing. */ -int32 MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], uint8 *musicOut) { +int32 MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], byte *musicOut) { int frameCounter = 0, textCounter = 0; if (text) { - uint8 oldPal[1024]; - uint8 tmpPal[1024]; + byte oldPal[1024]; + byte tmpPal[1024]; _vm->_graphics->clearScene(); @@ -357,23 +357,23 @@ int32 MoviePlayer::playDummy(const char *filename, MovieTextObject *text[], uint memset(_vm->_graphics->_buffer, 0, _vm->_graphics->_screenWide * MENUDEEP); - uint8 msg[] = "Cutscene - Narration Only: Press ESC to exit, or visit www.scummvm.org to download cutscene videos"; - Memory *data = _vm->_fontRenderer->makeTextSprite(msg, RENDERWIDE, 255, _vm->_speechFontId); - FrameHeader *frame = (FrameHeader *) data->ad; + byte msg[] = "Cutscene - Narration Only: Press ESC to exit, or visit www.scummvm.org to download cutscene videos"; + byte *data = _vm->_fontRenderer->makeTextSprite(msg, RENDERWIDE, 255, _vm->_speechFontId); + FrameHeader *frame = (FrameHeader *) data; SpriteInfo msgSprite; - uint8 *msgSurface; + byte *msgSurface; msgSprite.x = _vm->_graphics->_screenWide / 2 - frame->width / 2; msgSprite.y = RDMENU_MENUDEEP / 2 - frame->height / 2; msgSprite.w = frame->width; msgSprite.h = frame->height; msgSprite.type = RDSPR_NOCOMPRESSION; - msgSprite.data = data->ad + sizeof(FrameHeader); + msgSprite.data = data + sizeof(FrameHeader); _vm->_graphics->createSurface(&msgSprite, &msgSurface); _vm->_graphics->drawSurface(&msgSprite, msgSurface); _vm->_graphics->deleteSurface(msgSurface); - _vm->_memory->freeMemory(data); + _vm->_memory->memFree(data); // In case the cutscene has a long lead-in, start just before // the first line of text. diff --git a/sword2/driver/animation.h b/sword2/driver/animation.h index 818167537e..cf991733de 100644 --- a/sword2/driver/animation.h +++ b/sword2/driver/animation.h @@ -38,7 +38,7 @@ public: ~AnimationState(); #ifndef BACKEND_8BIT - void drawTextObject(SpriteInfo *s, uint8 *src); + void drawTextObject(SpriteInfo *s, byte *src); #endif void clearScreen(); @@ -63,7 +63,7 @@ private: SoundMixer *_snd; OSystem *_sys; - uint8 *_textSurface; + byte *_textSurface; static struct MovieInfo _movies[]; @@ -71,11 +71,11 @@ private: void closeTextObject(MovieTextObject *obj); void drawTextObject(AnimationState *anim, MovieTextObject *obj); - int32 playDummy(const char *filename, MovieTextObject *text[], uint8 *musicOut); + int32 playDummy(const char *filename, MovieTextObject *text[], byte *musicOut); public: MoviePlayer(Sword2Engine *vm); - int32 play(const char *filename, MovieTextObject *text[], uint8 *musicOut); + int32 play(const char *filename, MovieTextObject *text[], byte *musicOut); }; } // End of namespace Sword2 diff --git a/sword2/driver/d_draw.h b/sword2/driver/d_draw.h index 257be0d117..5c56246995 100644 --- a/sword2/driver/d_draw.h +++ b/sword2/driver/d_draw.h @@ -91,9 +91,9 @@ private: bool _needFullRedraw; - uint8 _paletteMatch[PALTABLESIZE]; + byte _paletteMatch[PALTABLESIZE]; - uint8 _fadePalette[256][4]; + byte _fadePalette[256][4]; uint8 _fadeStatus; int32 _fadeStartTime; @@ -102,7 +102,7 @@ private: byte _mouseData[MAX_MOUSE_W * MAX_MOUSE_H]; uint8 _mouseFrame; - uint8 *_mouseSprite; + byte *_mouseSprite; struct MouseAnim *_mouseAnim; struct MouseAnim *_luggageAnim; int32 *_mouseOffsets; @@ -146,11 +146,11 @@ private: uint16 _xScale[SCALE_MAXWIDTH]; uint16 _yScale[SCALE_MAXHEIGHT]; - uint8 *_lightMask; + byte *_lightMask; void clearIconArea(int menu, int pocket, Common::Rect *r); - void decompressMouse(uint8 *decomp, uint8 *comp, int width, int height, int pitch, int xOff = 0, int yOff = 0); + void decompressMouse(byte *decomp, byte *comp, int width, int height, int pitch, int xOff = 0, int yOff = 0); uint8 getMatch(uint8 r, uint8 g, uint8 b); void fadeServer(void); @@ -166,10 +166,10 @@ private: void blitBlockSurface(BlockSurface *s, Common::Rect *r, Common::Rect *clipRect); - void mirrorSprite(uint8 *dst, uint8 *src, int16 w, int16 h); - int32 decompressRLE256(uint8 *dest, uint8 *source, int32 decompSize); - void unwindRaw16(uint8 *dest, uint8 *source, uint8 blockSize, uint8 *colTable); - int32 decompressRLE16(uint8 *dest, uint8 *source, int32 decompSize, uint8 *colTable); + void mirrorSprite(byte *dst, byte *src, int16 w, int16 h); + int32 decompressRLE256(byte *dest, byte *source, int32 decompSize); + void unwindRaw16(byte *dest, byte *source, uint8 blockSize, byte *colTable); + int32 decompressRLE16(byte *dest, byte *source, int32 decompSize, byte *colTable); public: @@ -180,7 +180,7 @@ public: int16 _screenWide; int16 _screenDeep; - uint8 _palCopy[256][4]; + byte _palCopy[256][4]; byte *getScreen(void) { return _buffer; } @@ -192,15 +192,15 @@ public: void processMenu(void); int32 showMenu(uint8 menu); int32 hideMenu(uint8 menu); - int32 setMenuIcon(uint8 menu, uint8 pocket, uint8 *icon); + int32 setMenuIcon(uint8 menu, uint8 pocket, byte *icon); void closeMenuImmediately(void); void updateDisplay(bool redrawScene = true); void setWindowName(const char *windowName); void setNeedFullRedraw(void); - void setPalette(int16 startEntry, int16 noEntries, uint8 *palette, uint8 setNow); - void updatePaletteMatchTable(uint8 *data); + void setPalette(int16 startEntry, int16 noEntries, byte *palette, uint8 setNow); + void updatePaletteMatchTable(byte *data); uint8 quickMatch(uint8 r, uint8 g, uint8 b); int32 fadeUp(float time = 0.75); int32 fadeDown(float time = 0.75); @@ -208,8 +208,8 @@ public: void dimPalette(void); void waitForFade(void); - int32 setMouseAnim(uint8 *ma, int32 size, int32 mouseFlash); - int32 setLuggageAnim(uint8 *la, int32 size); + int32 setMouseAnim(byte *ma, int32 size, int32 mouseFlash); + int32 setLuggageAnim(byte *la, int32 size); int32 animateMouse(void); void drawMouse(void); @@ -232,9 +232,9 @@ public: #endif - int32 createSurface(SpriteInfo *s, uint8 **surface); - void drawSurface(SpriteInfo *s, uint8 *surface, Common::Rect *clipRect = NULL); - void deleteSurface(uint8 *surface); + int32 createSurface(SpriteInfo *s, byte **surface); + void drawSurface(SpriteInfo *s, byte *surface, Common::Rect *clipRect = NULL); + void deleteSurface(byte *surface); int32 drawSprite(SpriteInfo *s); int32 openLightMask(SpriteInfo *s); int32 closeLightMask(void); diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index ccadfe4ec8..e6b547fdae 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -251,7 +251,7 @@ bool MusicHandle::endOfData(void) const { * @return True if the data appears to be a WAV file, otherwise false. */ -bool Sound::getWavInfo(uint8 *data, WavInfo *wavInfo) { +bool Sound::getWavInfo(byte *data, WavInfo *wavInfo) { uint32 wavLength; uint32 offset; @@ -750,7 +750,7 @@ int32 Sound::amISpeaking(void) { uint32 Sound::preFetchCompSpeech(const char *filename, uint32 speechid, uint16 **buf) { uint32 i; - uint8 *data8; + byte *data8; uint32 speechPos, speechLength; File fp; uint32 bufferSize; @@ -772,7 +772,7 @@ uint32 Sound::preFetchCompSpeech(const char *filename, uint32 speechid, uint16 * } // Create a temporary buffer for compressed speech - data8 = (uint8 *) malloc(speechLength); + data8 = (byte *) malloc(speechLength); if (!data8) { fp.close(); return 0; @@ -1036,7 +1036,7 @@ bool Sound::isFxPlaying(int32 id) { * @warning Zero is not a valid id */ -int32 Sound::openFx(int32 id, uint8 *data) { +int32 Sound::openFx(int32 id, byte *data) { if (!_soundOn) return RD_OK; @@ -1128,7 +1128,7 @@ int32 Sound::closeFx(int32 id) { * @warning Zero is not a valid id */ -int32 Sound::playFx(int32 id, uint8 *data, uint8 vol, int8 pan, uint8 type) { +int32 Sound::playFx(int32 id, byte *data, uint8 vol, int8 pan, uint8 type) { if (!_soundOn) return RD_OK; diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h index e4e909453a..6356b9a287 100644 --- a/sword2/driver/driver96.h +++ b/sword2/driver/driver96.h @@ -214,8 +214,8 @@ struct SpriteInfo { uint16 scaledHeight; // uint16 type; // mask containing 'RDSPR_' bits specifying compression type, flip, transparency, etc uint16 blend; // holds the blending values. - uint8 *data; // pointer to the sprite data - uint8 *colourTable; // pointer to 16-byte colour table, only applicable to 16-col compression type + byte *data; // pointer to the sprite data + byte *colourTable; // pointer to 16-byte colour table, only applicable to 16-col compression type }; // This is the structure which is passed to the sequence player. It includes diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp index b1534e686b..79245fe0db 100644 --- a/sword2/driver/menu.cpp +++ b/sword2/driver/menu.cpp @@ -264,7 +264,7 @@ void Graphics::closeMenuImmediately(void) { * @return RD_OK, or an error code */ -int32 Graphics::setMenuIcon(uint8 menu, uint8 pocket, uint8 *icon) { +int32 Graphics::setMenuIcon(uint8 menu, uint8 pocket, byte *icon) { Common::Rect r; // Check for invalid menu parameter. @@ -287,7 +287,7 @@ int32 Graphics::setMenuIcon(uint8 menu, uint8 pocket, uint8 *icon) { // Only put the icon in the pocket if it is not NULL if (icon != NULL) { _iconCount++; - _icons[menu][pocket] = (uint8 *) malloc(RDMENU_ICONWIDE * RDMENU_ICONDEEP); + _icons[menu][pocket] = (byte *) malloc(RDMENU_ICONWIDE * RDMENU_ICONDEEP); if (_icons[menu][pocket] == NULL) return RDERR_OUTOFMEMORY; memcpy(_icons[menu][pocket], icon, RDMENU_ICONWIDE * RDMENU_ICONDEEP); diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp index c9433c3ef1..1c5096c11b 100644 --- a/sword2/driver/palette.cpp +++ b/sword2/driver/palette.cpp @@ -64,10 +64,10 @@ uint8 Graphics::getMatch(uint8 r, uint8 g, uint8 b) { * from the current palCopy */ -void Graphics::updatePaletteMatchTable(uint8 *data) { +void Graphics::updatePaletteMatchTable(byte *data) { if (!data) { int16 red, green, blue; - uint8 *p; + byte *p; // Create palette match table @@ -109,7 +109,7 @@ uint8 Graphics::quickMatch(uint8 r, uint8 g, uint8 b) { * @param colourTable the new colour entries */ -void Graphics::setPalette(int16 startEntry, int16 noEntries, uint8 *colourTable, uint8 fadeNow) { +void Graphics::setPalette(int16 startEntry, int16 noEntries, byte *colourTable, uint8 fadeNow) { if (noEntries) { memcpy(&_palCopy[startEntry][0], colourTable, noEntries * 4); if (fadeNow == RDPAL_INSTANT) { diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index ff06fb5fef..a6d83e615c 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -332,7 +332,7 @@ void Graphics::stretchImage(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16 */ void Graphics::plotPoint(uint16 x, uint16 y, uint8 colour) { - uint8 *buf = _buffer + 40 * RENDERWIDE; + byte *buf = _buffer + 40 * RENDERWIDE; int16 newx, newy; newx = x - _scrollX; @@ -353,7 +353,7 @@ void Graphics::plotPoint(uint16 x, uint16 y, uint8 colour) { // Uses Bressnham's incremental algorithm! void Graphics::drawLine(int16 x0, int16 y0, int16 x1, int16 y1, uint8 colour) { - uint8 *buf = _buffer + 40 * RENDERWIDE; + byte *buf = _buffer + 40 * RENDERWIDE; int dx, dy; int dxmod, dymod; int ince, incne; @@ -700,15 +700,15 @@ void Graphics::setScrollTarget(int16 sx, int16 sy) { */ int32 Graphics::initialiseBackgroundLayer(Parallax *p) { - uint8 *memchunk; + byte *memchunk; uint8 zeros; uint16 count; uint16 i, j, k; uint16 x; - uint8 *data; - uint8 *dst; + byte *data; + byte *dst; ParallaxLine line; - uint8 *pLine; + byte *pLine; debug(2, "initialiseBackgroundLayer"); @@ -732,7 +732,7 @@ int32 Graphics::initialiseBackgroundLayer(Parallax *p) { // Decode the parallax layer into a large chunk of memory - memchunk = (uint8 *) calloc(_xBlocks[_layer] * _yBlocks[_layer], BLOCKWIDTH * BLOCKHEIGHT); + memchunk = (byte *) calloc(_xBlocks[_layer] * _yBlocks[_layer], BLOCKWIDTH * BLOCKHEIGHT); if (!memchunk) return RDERR_OUTOFMEMORY; @@ -740,7 +740,7 @@ int32 Graphics::initialiseBackgroundLayer(Parallax *p) { if (p->offset[i] == 0) continue; - pLine = (uint8 *) p + FROM_LE_32(p->offset[i]); + pLine = (byte *) p + FROM_LE_32(p->offset[i]); line.packets = READ_LE_UINT16(pLine); line.offset = READ_LE_UINT16(pLine + 2); data = pLine + sizeof(ParallaxLine); diff --git a/sword2/driver/sprite.cpp b/sword2/driver/sprite.cpp index f13eb877fd..597d63f712 100644 --- a/sword2/driver/sprite.cpp +++ b/sword2/driver/sprite.cpp @@ -31,7 +31,7 @@ namespace Sword2 { * @param h height of the sprite */ -void Graphics::mirrorSprite(uint8 *dst, uint8 *src, int16 w, int16 h) { +void Graphics::mirrorSprite(byte *dst, byte *src, int16 w, int16 h) { for (int y = 0; y < h; y++) { for (int x = 0; x < w; x++) { *dst++ = *(src + w - x - 1); @@ -48,15 +48,15 @@ void Graphics::mirrorSprite(uint8 *dst, uint8 *src, int16 w, int16 h) { * @param decompSize the expected size of the decompressed sprite */ -int32 Graphics::decompressRLE256(uint8 *dest, uint8 *source, int32 decompSize) { +int32 Graphics::decompressRLE256(byte *dest, byte *source, int32 decompSize) { // PARAMETERS: // source points to the start of the sprite data for input // decompSize gives size of decompressed data in bytes // dest points to start of destination buffer for decompressed // data - uint8 headerByte; // block header byte - uint8 *endDest = dest + decompSize; // pointer to byte after end of decomp buffer + byte headerByte; // block header byte + byte *endDest = dest + decompSize; // pointer to byte after end of decomp buffer int32 rv; while(1) { @@ -128,7 +128,7 @@ int32 Graphics::decompressRLE256(uint8 *dest, uint8 *source, int32 decompSize) { * Unwinds a run of 16-colour data into 256-colour palette data. */ -void Graphics::unwindRaw16(uint8 *dest, uint8 *source, uint8 blockSize, uint8 *colTable) { +void Graphics::unwindRaw16(byte *dest, byte *source, uint8 blockSize, byte *colTable) { // for each pair of pixels while (blockSize > 1) { // 1st colour = number in table at position given by upper @@ -163,9 +163,9 @@ void Graphics::unwindRaw16(uint8 *dest, uint8 *source, uint8 blockSize, uint8 *c * @param colTable mapping from the 16 encoded colours to the current palette */ -int32 Graphics::decompressRLE16(uint8 *dest, uint8 *source, int32 decompSize, uint8 *colTable) { - uint8 headerByte; // block header byte - uint8 *endDest = dest + decompSize; // pointer to byte after end of decomp buffer +int32 Graphics::decompressRLE16(byte *dest, byte *source, int32 decompSize, byte *colTable) { + byte headerByte; // block header byte + byte *endDest = dest + decompSize; // pointer to byte after end of decomp buffer int32 rv; while(1) { @@ -243,8 +243,8 @@ int32 Graphics::decompressRLE16(uint8 *dest, uint8 *source, int32 decompSize, ui * @return RD_OK, or an error code */ -int32 Graphics::createSurface(SpriteInfo *s, uint8 **sprite) { - *sprite = (uint8 *) malloc(s->w * s->h); +int32 Graphics::createSurface(SpriteInfo *s, byte **sprite) { + *sprite = (byte *) malloc(s->w * s->h); if (!*sprite) return RDERR_OUTOFMEMORY; @@ -268,10 +268,10 @@ int32 Graphics::createSurface(SpriteInfo *s, uint8 **sprite) { * @param clipRect the clipping rectangle */ -void Graphics::drawSurface(SpriteInfo *s, uint8 *surface, Common::Rect *clipRect) { +void Graphics::drawSurface(SpriteInfo *s, byte *surface, Common::Rect *clipRect) { Common::Rect rd, rs; uint16 x, y; - uint8 *src, *dst; + byte *src, *dst; rs.left = 0; rs.right = s->w; @@ -327,7 +327,7 @@ void Graphics::drawSurface(SpriteInfo *s, uint8 *surface, Common::Rect *clipRect * Destroys a surface. */ -void Graphics::deleteSurface(uint8 *surface) { +void Graphics::deleteSurface(byte *surface) { free(surface); } @@ -353,9 +353,9 @@ void Graphics::deleteSurface(uint8 *surface) { // mallocing here. int32 Graphics::drawSprite(SpriteInfo *s) { - uint8 *src, *dst; - uint8 *sprite, *newSprite; - uint8 *backbuf = NULL; + byte *src, *dst; + byte *sprite, *newSprite; + byte *backbuf = NULL; uint16 scale; int16 i, j; uint16 srcPitch; @@ -370,7 +370,7 @@ int32 Graphics::drawSprite(SpriteInfo *s) { if (s->type & RDSPR_NOCOMPRESSION) sprite = s->data; else { - sprite = (uint8 *) malloc(s->w * s->h); + sprite = (byte *) malloc(s->w * s->h); freeSprite = true; if (!sprite) return RDERR_OUTOFMEMORY; @@ -388,7 +388,7 @@ int32 Graphics::drawSprite(SpriteInfo *s) { } if (s->type & RDSPR_FLIP) { - newSprite = (uint8 *) malloc(s->w * s->h); + newSprite = (byte *) malloc(s->w * s->h); if (newSprite == NULL) { if (freeSprite) free(sprite); @@ -486,7 +486,7 @@ int32 Graphics::drawSprite(SpriteInfo *s) { return RDERR_NOTIMPLEMENTED; } - newSprite = (uint8 *) malloc(s->scaledWidth * s->scaledHeight); + newSprite = (byte *) malloc(s->scaledWidth * s->scaledHeight); if (newSprite == NULL) { if (freeSprite) free(sprite); @@ -519,10 +519,10 @@ int32 Graphics::drawSprite(SpriteInfo *s) { // (actors, presumably) are always affected. if ((_renderCaps & RDBLTFX_SHADOWBLEND) && _lightMask && (scale != 256 || (s->type & RDSPR_SHADOW))) { - uint8 *lightMap; + byte *lightMap; if (!freeSprite) { - newSprite = (uint8 *) malloc(s->w * s->h); + newSprite = (byte *) malloc(s->w * s->h); memcpy(newSprite, sprite, s->w * s->h); sprite = newSprite; freeSprite = true; @@ -640,7 +640,7 @@ int32 Graphics::openLightMask(SpriteInfo *s) { if (_lightMask) return RDERR_NOTCLOSED; - _lightMask = (uint8 *) malloc(s->w * s->h); + _lightMask = (byte *) malloc(s->w * s->h); if (!_lightMask) return RDERR_OUTOFMEMORY; |