aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-12-28 15:08:12 +0000
committerTorbjörn Andersson2003-12-28 15:08:12 +0000
commit6ae8218d537a2b627a0abad597d5084c796d1de8 (patch)
tree13941f5a83d4594739f665b364cb4d05154be6fc /sword2/driver
parent302c9f72fcf76cde76a3ee467b0fe5771a5faa3f (diff)
downloadscummvm-rg350-6ae8218d537a2b627a0abad597d5084c796d1de8.tar.gz
scummvm-rg350-6ae8218d537a2b627a0abad597d5084c796d1de8.tar.bz2
scummvm-rg350-6ae8218d537a2b627a0abad597d5084c796d1de8.zip
Hopefully the last big renaming. Now the datatypes have names like
"StandardHeader" instead of "_standardHeader". svn-id: r11997
Diffstat (limited to 'sword2/driver')
-rw-r--r--sword2/driver/_mouse.cpp12
-rw-r--r--sword2/driver/d_draw.cpp18
-rw-r--r--sword2/driver/d_draw.h30
-rw-r--r--sword2/driver/d_sound.cpp4
-rw-r--r--sword2/driver/d_sound.h4
-rw-r--r--sword2/driver/driver96.h34
-rw-r--r--sword2/driver/keyboard.cpp4
-rw-r--r--sword2/driver/render.cpp8
-rw-r--r--sword2/driver/render.h4
-rw-r--r--sword2/driver/sprite.cpp8
10 files changed, 63 insertions, 63 deletions
diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp
index a53feb448c..a5743609a5 100644
--- a/sword2/driver/_mouse.cpp
+++ b/sword2/driver/_mouse.cpp
@@ -48,8 +48,8 @@ bool Input::checkForMouseEvents(void) {
* @return a pointer to the mouse event, or NULL of there is none
*/
-_mouseEvent *Input::mouseEvent(void) {
- _mouseEvent *me;
+MouseEvent *Input::mouseEvent(void) {
+ MouseEvent *me;
if (_mouseBacklog) {
me = &_mouseLog[_mouseLogPos];
@@ -211,12 +211,12 @@ int32 Graphics::setMouseAnim(uint8 *ma, int32 size, int32 mouseFlash) {
else
_mouseFrame = MOUSEFLASHFRAME;
- _mouseAnim = (struct _mouseAnim *) malloc(size);
+ _mouseAnim = (MouseAnim *) malloc(size);
if (!_mouseAnim)
return RDERR_OUTOFMEMORY;
memcpy((uint8 *) _mouseAnim, ma, size);
- _mouseOffsets = (int32 *) ((uint8 *) _mouseAnim + sizeof(struct _mouseAnim));
+ _mouseOffsets = (int32 *) ((uint8 *) _mouseAnim + sizeof(MouseAnim));
animateMouse();
drawMouse();
@@ -246,12 +246,12 @@ int32 Graphics::setLuggageAnim(uint8 *ma, int32 size) {
}
if (ma) {
- _luggageAnim = (struct _mouseAnim *) malloc(size);
+ _luggageAnim = (MouseAnim *) malloc(size);
if (!_luggageAnim)
return RDERR_OUTOFMEMORY;
memcpy((uint8 *) _luggageAnim, ma, size);
- _luggageOffset = (int32 *) ((uint8 *) _luggageAnim + sizeof(struct _mouseAnim));
+ _luggageOffset = (int32 *) ((uint8 *) _luggageAnim + sizeof(MouseAnim));
animateMouse();
drawMouse();
diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp
index 928de7bf71..28e57a2709 100644
--- a/sword2/driver/d_draw.cpp
+++ b/sword2/driver/d_draw.cpp
@@ -92,19 +92,19 @@ void Graphics::clearScene(void) {
memset(_buffer + MENUDEEP * _screenWide, 0, _screenWide * RENDERDEEP);
}
-void MoviePlayer::openTextObject(_movieTextObject *obj) {
+void MoviePlayer::openTextObject(MovieTextObject *obj) {
if (obj->textSprite)
_vm->_graphics->createSurface(obj->textSprite, &_textSurface);
}
-void MoviePlayer::closeTextObject(_movieTextObject *obj) {
+void MoviePlayer::closeTextObject(MovieTextObject *obj) {
if (_textSurface) {
_vm->_graphics->deleteSurface(_textSurface);
_textSurface = NULL;
}
}
-void MoviePlayer::drawTextObject(_movieTextObject *obj) {
+void MoviePlayer::drawTextObject(MovieTextObject *obj) {
if (obj->textSprite && _textSurface)
_vm->_graphics->drawSurface(obj->textSprite, _textSurface);
}
@@ -116,7 +116,7 @@ void MoviePlayer::drawTextObject(_movieTextObject *obj) {
* @param musicOut lead-out music
*/
-int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOut) {
+int32 MoviePlayer::play(char *filename, MovieTextObject *text[], uint8 *musicOut) {
warning("semi-stub PlaySmacker %s", filename);
// WORKAROUND: For now, we just do the voice-over parts of the
@@ -136,9 +136,9 @@ int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOu
memset(_vm->_graphics->_buffer, 0, _vm->_graphics->_screenWide * MENUDEEP);
uint8 msg[] = "Cutscene - Press ESC to exit";
- mem *data = _vm->_fontRenderer->makeTextSprite(msg, 640, 255, _vm->_speechFontId);
- _frameHeader *frame = (_frameHeader *) data->ad;
- _spriteInfo msgSprite;
+ Memory *data = _vm->_fontRenderer->makeTextSprite(msg, 640, 255, _vm->_speechFontId);
+ FrameHeader *frame = (FrameHeader *) data->ad;
+ SpriteInfo msgSprite;
uint8 *msgSurface;
msgSprite.x = _vm->_graphics->_screenWide / 2 - frame->width / 2;
@@ -146,7 +146,7 @@ int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOu
msgSprite.w = frame->width;
msgSprite.h = frame->height;
msgSprite.type = RDSPR_NOCOMPRESSION;
- msgSprite.data = data->ad + sizeof(_frameHeader);
+ msgSprite.data = data->ad + sizeof(FrameHeader);
_vm->_graphics->createSurface(&msgSprite, &msgSurface);
_vm->_graphics->drawSurface(&msgSprite, msgSurface);
@@ -206,7 +206,7 @@ int32 MoviePlayer::play(char *filename, _movieTextObject *text[], uint8 *musicOu
_vm->_graphics->updateDisplay();
- _keyboardEvent ke;
+ KeyboardEvent ke;
if (_vm->_input->readKey(&ke) == RD_OK && ke.keycode == 27) {
_vm->_mixer->stopHandle(handle);
diff --git a/sword2/driver/d_draw.h b/sword2/driver/d_draw.h
index 387ffdb355..edcd220ac8 100644
--- a/sword2/driver/d_draw.h
+++ b/sword2/driver/d_draw.h
@@ -45,7 +45,7 @@ namespace Sword2 {
#pragma START_PACK_STRUCTS
#endif
-struct _mouseAnim {
+struct MouseAnim {
uint8 runTimeComp; // type of runtime compression used for the
// frame data
uint8 noAnimFrames; // number of frames in the anim
@@ -64,19 +64,19 @@ private:
Sword2Engine *_vm;
uint8 *_textSurface;
- void openTextObject(_movieTextObject *obj);
- void closeTextObject(_movieTextObject *obj);
- void drawTextObject(_movieTextObject *obj);
+ void openTextObject(MovieTextObject *obj);
+ void closeTextObject(MovieTextObject *obj);
+ void drawTextObject(MovieTextObject *obj);
public:
MoviePlayer(Sword2Engine *vm) : _vm(vm), _textSurface(NULL) {}
- int32 play(char *filename, _movieTextObject *text[], uint8 *musicOut);
+ int32 play(char *filename, MovieTextObject *text[], uint8 *musicOut);
};
-typedef struct {
+struct BlockSurface {
byte data[BLOCKWIDTH * BLOCKHEIGHT];
bool transparent;
-} BlockSurface;
+};
class Graphics {
friend class MoviePlayer;
@@ -109,8 +109,8 @@ private:
uint8 _mouseFrame;
uint8 *_mouseSprite;
- struct _mouseAnim *_mouseAnim;
- struct _mouseAnim *_luggageAnim;
+ struct MouseAnim *_mouseAnim;
+ struct MouseAnim *_luggageAnim;
int32 *_mouseOffsets;
int32 *_luggageOffset;
@@ -222,19 +222,19 @@ public:
void initialiseRenderCycle(void);
void startRenderCycle(void);
bool endRenderCycle(void);
- void renderParallax(_parallax *p, int16 layer);
+ void renderParallax(Parallax *p, int16 layer);
void setLocationMetrics(uint16 w, uint16 h);
- int32 initialiseBackgroundLayer(_parallax *p);
+ int32 initialiseBackgroundLayer(Parallax *p);
void closeBackgroundLayer(void);
void plotPoint(uint16 x, uint16 y, uint8 colour);
void drawLine(int16 x1, int16 y1, int16 x2, int16 y2, uint8 colour);
- int32 createSurface(_spriteInfo *s, uint8 **surface);
- void drawSurface(_spriteInfo *s, uint8 *surface, Common::Rect *clipRect = NULL);
+ int32 createSurface(SpriteInfo *s, uint8 **surface);
+ void drawSurface(SpriteInfo *s, uint8 *surface, Common::Rect *clipRect = NULL);
void deleteSurface(uint8 *surface);
- int32 drawSprite(_spriteInfo *s);
- int32 openLightMask(_spriteInfo *s);
+ 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 082161f7c9..5398aebb8a 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -529,9 +529,9 @@ void Sound::unpauseSpeech(void) {
int32 Sound::openFx(int32 id, uint8 *data) {
int32 i, fxi;
uint32 *data32 = NULL;
- _wavHeader *wav;
+ WavHeader *wav;
- wav = (_wavHeader *) data;
+ wav = (WavHeader *) data;
if (_soundOn) {
// Check for a valid id.
diff --git a/sword2/driver/d_sound.h b/sword2/driver/d_sound.h
index 068376164d..a9e97317a6 100644
--- a/sword2/driver/d_sound.h
+++ b/sword2/driver/d_sound.h
@@ -33,7 +33,7 @@ namespace Sword2 {
extern void sword2_sound_handler(void *refCon);
-typedef struct {
+struct FxHandle {
int32 _id;
bool _paused;
int8 _volume;
@@ -42,7 +42,7 @@ typedef struct {
uint16 *_buf;
int32 _bufSize;
PlayingSoundHandle _handle;
-} FxHandle;
+};
class MusicHandle : public AudioInputStream {
public:
diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h
index b30370e3eb..8c836ccecf 100644
--- a/sword2/driver/driver96.h
+++ b/sword2/driver/driver96.h
@@ -176,21 +176,21 @@ enum {
// Structure definitions
-typedef struct {
+struct MouseEvent {
uint16 buttons;
-} _mouseEvent;
+};
-typedef struct {
+struct KeyboardEvent {
uint16 ascii;
int keycode;
int modifiers;
-} _keyboardEvent;
+};
#if !defined(__GNUC__)
#pragma START_PACK_STRUCTS
#endif
-struct _parallax {
+struct Parallax {
uint16 w;
uint16 h;
uint32 offset[2]; // 2 is arbitrary
@@ -200,11 +200,11 @@ struct _parallax {
#pragma END_PACK_STRUCTS
#endif
-// The _spriteInfo structure is used to tell the driver96 code what attributes
+// The SpriteInfo structure is used to tell the driver96 code what attributes
// are linked to a sprite for drawing. These include position, scaling and
// compression.
-typedef struct {
+struct SpriteInfo {
int16 x; // coords for top-left of sprite
int16 y;
uint16 w; // dimensions of sprite (before scaling)
@@ -216,13 +216,13 @@ typedef struct {
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
-} _spriteInfo;
+};
// This is the format of a .WAV file. Somewhere after this header is the
// string 'DATA' followed by an int32 size which is the size of the data.
// Following the size of the data is the data itself.
- typedef struct {
+struct WavHeader {
uint32 riff;
uint32 fileLength;
uint32 wavID;
@@ -236,19 +236,19 @@ typedef struct {
uint16 unknown1;
uint16 unknown2;
uint16 bitsPerSample;
-} _wavHeader;
+};
// This is the structure which is passed to the sequence player. It includes
// the smack to play, and any text lines which are to be displayed over the top
// of the sequence.
-typedef struct {
+struct MovieTextObject {
uint16 startFrame;
uint16 endFrame;
- _spriteInfo *textSprite;
+ SpriteInfo *textSprite;
uint32 speechBufferSize;
uint16 *speech;
-} _movieTextObject;
+};
// Input handling class
@@ -264,7 +264,7 @@ private:
uint8 _mouseBacklog;
uint8 _mouseLogPos;
- _mouseEvent _mouseLog[MAX_MOUSE_EVENTS];
+ MouseEvent _mouseLog[MAX_MOUSE_EVENTS];
void logMouseEvent(uint16 buttons);
@@ -275,7 +275,7 @@ private:
uint8 _keyLogPos;
// The keyboard buffer
- _keyboardEvent _keyBuffer[MAX_KEY_BUFFER];
+ KeyboardEvent _keyBuffer[MAX_KEY_BUFFER];
void writeKey(uint16 ascii, int keycode, int modifiers);
@@ -289,11 +289,11 @@ public:
void parseEvents(void);
- _mouseEvent *mouseEvent(void);
+ MouseEvent *mouseEvent(void);
bool checkForMouseEvents(void);
bool keyWaiting(void);
- int32 readKey(_keyboardEvent *ev);
+ int32 readKey(KeyboardEvent *ev);
};
} // End of namespace Sword2
diff --git a/sword2/driver/keyboard.cpp b/sword2/driver/keyboard.cpp
index 5ddf303fc8..f1dc93ec4a 100644
--- a/sword2/driver/keyboard.cpp
+++ b/sword2/driver/keyboard.cpp
@@ -24,7 +24,7 @@ namespace Sword2 {
void Input::writeKey(uint16 ascii, int keycode, int modifiers) {
if (_keyBuffer && _keyBacklog < MAX_KEY_BUFFER) {
- _keyboardEvent *slot = &_keyBuffer[(_keyLogPos + _keyBacklog) % MAX_KEY_BUFFER];
+ KeyboardEvent *slot = &_keyBuffer[(_keyLogPos + _keyBacklog) % MAX_KEY_BUFFER];
slot->ascii = ascii;
slot->keycode = keycode;
@@ -46,7 +46,7 @@ bool Input::keyWaiting(void) {
* @return RD_OK, or an error code to indicate there is no key waiting.
*/
-int32 Input::readKey(_keyboardEvent *ev) {
+int32 Input::readKey(KeyboardEvent *ev) {
if (!_keyBacklog)
return RDERR_NOKEYWAITING;
diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp
index 3ef3151744..ff75e4fa25 100644
--- a/sword2/driver/render.cpp
+++ b/sword2/driver/render.cpp
@@ -526,7 +526,7 @@ void Graphics::setLocationMetrics(uint16 w, uint16 h) {
* parallax can be either foreground, background or the main screen.
*/
-void Graphics::renderParallax(_parallax *p, int16 l) {
+void Graphics::renderParallax(Parallax *p, int16 l) {
int16 x, y;
Common::Rect r;
@@ -675,7 +675,7 @@ void Graphics::setScrollTarget(int16 sx, int16 sy) {
* or a NULL pointer in order of background parallax to foreground parallax.
*/
-int32 Graphics::initialiseBackgroundLayer(_parallax *p) {
+int32 Graphics::initialiseBackgroundLayer(Parallax *p) {
uint8 *memchunk;
uint8 zeros;
uint16 count;
@@ -683,7 +683,7 @@ int32 Graphics::initialiseBackgroundLayer(_parallax *p) {
uint16 x;
uint8 *data;
uint8 *dst;
- _parallaxLine line;
+ ParallaxLine line;
uint8 *pLine;
debug(2, "initialiseBackgroundLayer");
@@ -719,7 +719,7 @@ int32 Graphics::initialiseBackgroundLayer(_parallax *p) {
pLine = (uint8 *) p + FROM_LE_32(p->offset[i]);
line.packets = READ_LE_UINT16(pLine);
line.offset = READ_LE_UINT16(pLine + 2);
- data = pLine + sizeof(_parallaxLine);
+ data = pLine + sizeof(ParallaxLine);
x = line.offset;
dst = memchunk + i * p->w + x;
diff --git a/sword2/driver/render.h b/sword2/driver/render.h
index b112789e9f..ecfad5cf7a 100644
--- a/sword2/driver/render.h
+++ b/sword2/driver/render.h
@@ -28,10 +28,10 @@ namespace Sword2 {
#define ALIGNRENDERDEEP 480
#define RENDERDEEP (ALIGNRENDERDEEP - (MENUDEEP * 2))
-typedef struct {
+struct ParallaxLine {
uint16 packets;
uint16 offset;
-} _parallaxLine;
+};
} // End of namespace Sword2
diff --git a/sword2/driver/sprite.cpp b/sword2/driver/sprite.cpp
index 737fcdbb08..2ec83b7808 100644
--- a/sword2/driver/sprite.cpp
+++ b/sword2/driver/sprite.cpp
@@ -242,7 +242,7 @@ int32 Graphics::decompressRLE16(uint8 *dest, uint8 *source, int32 decompSize, ui
* @return RD_OK, or an error code
*/
-int32 Graphics::createSurface(_spriteInfo *s, uint8 **sprite) {
+int32 Graphics::createSurface(SpriteInfo *s, uint8 **sprite) {
*sprite = (uint8 *) malloc(s->w * s->h);
if (!*sprite)
return RDERR_OUTOFMEMORY;
@@ -267,7 +267,7 @@ 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, uint8 *surface, Common::Rect *clipRect) {
Common::Rect rd, rs;
uint16 x, y;
uint8 *src, *dst;
@@ -352,7 +352,7 @@ void Graphics::deleteSurface(uint8 *surface) {
// FIXME: I'm sure this could be optimized. There's plenty of data copying and
// mallocing here.
-int32 Graphics::drawSprite(_spriteInfo *s) {
+int32 Graphics::drawSprite(SpriteInfo *s) {
uint8 *src, *dst;
uint8 *sprite, *newSprite;
uint8 *backbuf = NULL;
@@ -623,7 +623,7 @@ int32 Graphics::drawSprite(_spriteInfo *s) {
* Opens the light masking sprite for a room.
*/
-int32 Graphics::openLightMask(_spriteInfo *s) {
+int32 Graphics::openLightMask(SpriteInfo *s) {
// FIXME: The light mask is only needed on higher graphics detail
// settings, so to save memory we could simply ignore it on lower
// settings. But then we need to figure out how to ensure that it