From 5a074e6137dc8368132e4e192c018806c1723222 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 4 Oct 2003 00:52:27 +0000 Subject: added namespace Sword2 svn-id: r10581 --- sword2/driver/_console.cpp | 6 ++++-- sword2/driver/_console.h | 8 +++++--- sword2/driver/_mouse.cpp | 14 +++++++++----- sword2/driver/_mouse.h | 8 ++++++-- sword2/driver/d_draw.cpp | 14 +++++++++----- sword2/driver/d_draw.h | 10 +++------- sword2/driver/d_sound.cpp | 10 +++++++--- sword2/driver/d_sound.h | 4 ++++ sword2/driver/driver96.h | 8 ++------ sword2/driver/keyboard.cpp | 6 +++++- sword2/driver/keyboard.h | 4 ++++ sword2/driver/language.cpp | 6 +++++- sword2/driver/menu.cpp | 13 +++++++------ sword2/driver/misc.cpp | 8 ++++++-- sword2/driver/palette.cpp | 10 +++++++--- sword2/driver/palette.h | 4 +++- sword2/driver/rdwin.cpp | 24 ++++++++++++++---------- sword2/driver/rdwin.h | 4 ++++ sword2/driver/render.cpp | 18 +++++++++++------- sword2/driver/render.h | 6 +++++- sword2/driver/sprite.cpp | 4 ++++ 21 files changed, 124 insertions(+), 65 deletions(-) (limited to 'sword2/driver') diff --git a/sword2/driver/_console.cpp b/sword2/driver/_console.cpp index 741253055f..82672f7bc9 100644 --- a/sword2/driver/_console.cpp +++ b/sword2/driver/_console.cpp @@ -47,11 +47,12 @@ //#include "ddraw.h" #include "stdafx.h" -#include "driver96.h" +#include "bs2/driver/driver96.h" -#include "d_draw.h" +#include "bs2/driver/d_draw.h" +namespace Sword2 { uint8 consoleStatus = 0; // 1 - console display //static uint16 consoley = 0; @@ -152,3 +153,4 @@ int32 CloseConsole(void) } +} // End of namespace Sword2 diff --git a/sword2/driver/_console.h b/sword2/driver/_console.h index 83c5c10f53..ed88fb6403 100644 --- a/sword2/driver/_console.h +++ b/sword2/driver/_console.h @@ -30,12 +30,14 @@ //============================================================================= -#ifndef CONSOLE_H -#define CONSOLE_H - +#ifndef DRIVER_CONSOLE_H +#define DRIVER_CONSOLE_H +namespace Sword2 { extern void DisplayConsole(void); +} // End of namespace Sword2 + #endif diff --git a/sword2/driver/_mouse.cpp b/sword2/driver/_mouse.cpp index 3c1d94e17a..dbd0632e68 100644 --- a/sword2/driver/_mouse.cpp +++ b/sword2/driver/_mouse.cpp @@ -18,11 +18,13 @@ */ #include "stdafx.h" -#include "driver96.h" -#include "d_draw.h" -#include "render.h" -#include "menu.h" -#include "../sword2.h" +#include "bs2/driver/driver96.h" +#include "bs2/driver/d_draw.h" +#include "bs2/driver/render.h" +#include "bs2/driver/menu.h" +#include "bs2/sword2.h" + +namespace Sword2 { #define MAX_MOUSE_EVENTS 16 #define MOUSEFLASHFRAME 6 @@ -312,3 +314,5 @@ int32 SetLuggageAnim(uint8 *ma, int32 size) { return RD_OK; } + +} // End of namespace Sword2 diff --git a/sword2/driver/_mouse.h b/sword2/driver/_mouse.h index 09f53154a4..ba48eb251c 100644 --- a/sword2/driver/_mouse.h +++ b/sword2/driver/_mouse.h @@ -17,8 +17,10 @@ * $Header$ */ -#ifndef MOUSE_H -#define MOUSE_H +#ifndef DRIVER_MOUSE_H +#define DRIVER_MOUSE_H + +namespace Sword2 { extern int16 mousex; // Mouse x coordinate extern int16 mousey; // Mouse y coordinate @@ -26,4 +28,6 @@ extern int16 mousey; // Mouse y coordinate extern void LogMouseEvent(uint16 buttons); extern int32 DrawMouse(void); +} // End of namespace Sword2 + #endif diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp index 3fa0d9193c..74abb18fa0 100644 --- a/sword2/driver/d_draw.cpp +++ b/sword2/driver/d_draw.cpp @@ -19,15 +19,17 @@ #include #include "stdafx.h" -#include "driver96.h" +#include "bs2/driver/driver96.h" #include "bs2/header.h" // HACK: For cutscenes instruction message #include "bs2/maketext.h" // HACK: For cutscenes instruction message #include "bs2/sword2.h" #include "sound/mixer.h" -#include "rdwin.h" -#include "d_draw.h" -#include "palette.h" -#include "render.h" +#include "bs2/driver/rdwin.h" +#include "bs2/driver/d_draw.h" +#include "bs2/driver/palette.h" +#include "bs2/driver/render.h" + +namespace Sword2 { byte *lpBackBuffer; @@ -331,3 +333,5 @@ int32 PlaySmacker(char *filename, _movieTextObject *text[], uint8 *musicOut) { return RD_OK; } + +} // End of namespace Sword2 diff --git a/sword2/driver/d_draw.h b/sword2/driver/d_draw.h index 547be8a860..7c24266677 100644 --- a/sword2/driver/d_draw.h +++ b/sword2/driver/d_draw.h @@ -20,16 +20,12 @@ #ifndef D_DRAW_H #define D_DRAW_H -#ifdef __cplusplus -extern "C" { -#endif +#include "bs2/driver/driver96.h" -#include "driver96.h" +namespace Sword2 { extern byte *lpBackBuffer; -#ifdef __cplusplus -} -#endif +} // End of namespace Sword2 #endif diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp index cd389daad9..3a21975fa5 100644 --- a/sword2/driver/d_sound.cpp +++ b/sword2/driver/d_sound.cpp @@ -33,13 +33,15 @@ // opinions on this? #include "stdafx.h" -#include "driver96.h" -#include "d_sound.h" -#include "../sword2.h" +#include "bs2/driver/driver96.h" +#include "bs2/driver/d_sound.h" +#include "bs2/sword2.h" #include "sound/audiostream.h" #include "sound/mixer.h" #include "sound/rate.h" +namespace Sword2 { + // Fade-out takes half a second. This may need some tuning. #define FADE_SAMPLES 11025 @@ -1150,3 +1152,5 @@ void Sword2Sound::muteMusic(uint8 mute) { uint8 Sword2Sound::isMusicMute(void) { return _musicMuted; } + +} // End of namespace Sword2 diff --git a/sword2/driver/d_sound.h b/sword2/driver/d_sound.h index 4890a5a026..9a8f7a4b0c 100644 --- a/sword2/driver/d_sound.h +++ b/sword2/driver/d_sound.h @@ -25,6 +25,8 @@ #include "sound/rate.h" #include "common/file.h" +namespace Sword2 { + extern void sword2_sound_handler(void *refCon); typedef struct { @@ -136,4 +138,6 @@ public: int32 setFxIdVolume(int32 id, uint8 vol); }; +} // End of namespace Sword2 + #endif diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h index effc5f1f2a..051ffa1046 100644 --- a/sword2/driver/driver96.h +++ b/sword2/driver/driver96.h @@ -29,9 +29,7 @@ #include "common/system.h" #include "common/rect.h" -#ifdef __cplusplus -extern "C" { -#endif +namespace Sword2 { // // Defines @@ -425,8 +423,6 @@ extern int16 mousey; // Mouse screen y coordinate extern int32 renderCaps; // Flags which determine how to render the scene. extern uint8 palCopy[256][4]; // Current palette. -#ifdef __cplusplus -} -#endif +} // End of namespace Sword2 #endif diff --git a/sword2/driver/keyboard.cpp b/sword2/driver/keyboard.cpp index b9aef1425c..609d0a75c5 100644 --- a/sword2/driver/keyboard.cpp +++ b/sword2/driver/keyboard.cpp @@ -18,7 +18,9 @@ */ #include "stdafx.h" -#include "driver96.h" +#include "bs2/driver/driver96.h" + +namespace Sword2 { uint8 keyBacklog = 0; // The number of key presses waiting to be processed. uint8 keyPointer = 0; // Index of the next key to read from the buffer. @@ -69,3 +71,5 @@ int32 ReadKey(_keyboardEvent *ev) { return RD_OK; } + +} // End of namespace Sword2 diff --git a/sword2/driver/keyboard.h b/sword2/driver/keyboard.h index b243a485b7..9758b56d50 100644 --- a/sword2/driver/keyboard.h +++ b/sword2/driver/keyboard.h @@ -34,6 +34,10 @@ #ifndef KEYBOARD_H #define KEYBOARD_H +namespace Sword2 { + void WriteKey(uint16 ascii, int keycode, int modifier); // Adds a keypress to the buffer +} // End of namespace Sword2 + #endif diff --git a/sword2/driver/language.cpp b/sword2/driver/language.cpp index 6ac4ec66f9..0995368b4f 100644 --- a/sword2/driver/language.cpp +++ b/sword2/driver/language.cpp @@ -18,7 +18,9 @@ */ #include "stdafx.h" -#include "driver96.h" +#include "bs2/driver/driver96.h" + +namespace Sword2 { uint8 languageVersion = ENGLISH; @@ -83,3 +85,5 @@ int32 GetGameName(uint8 *name) { return rv; } + +} // End of namespace Sword2 diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp index 8495e7cfb7..a83cb2ae2d 100644 --- a/sword2/driver/menu.cpp +++ b/sword2/driver/menu.cpp @@ -18,12 +18,14 @@ */ #include "stdafx.h" -#include "driver96.h" -#include "menu.h" -#include "d_draw.h" -#include "render.h" +#include "bs2/driver/driver96.h" +#include "bs2/driver/menu.h" +#include "bs2/driver/d_draw.h" +#include "bs2/driver/render.h" #include "common/rect.h" +namespace Sword2 { + #define MENUDEEP 40 #define MAXMENUANIMS 8 @@ -326,5 +328,4 @@ uint8 GetMenuStatus(uint8 menu) { return menuStatus[menu]; } - - +} // End of namespace Sword2 diff --git a/sword2/driver/misc.cpp b/sword2/driver/misc.cpp index 634a3c1199..0fcc72a885 100644 --- a/sword2/driver/misc.cpp +++ b/sword2/driver/misc.cpp @@ -18,8 +18,10 @@ */ #include "stdafx.h" -#include "driver96.h" -#include "../sword2.h" +#include "bs2/driver/driver96.h" +#include "bs2/sword2.h" + +namespace Sword2 { uint32 SVM_timeGetTime(void) { return g_system->get_msecs(); @@ -38,3 +40,5 @@ int32 SVM_GetVolumeInformation(char *cdPath, char *sCDName, uint32 maxPath, uint strcpy(sCDName, CD1_LABEL); return 1; } + +} // End of namespace Sword2 diff --git a/sword2/driver/palette.cpp b/sword2/driver/palette.cpp index 38a83a211c..47000f84cb 100644 --- a/sword2/driver/palette.cpp +++ b/sword2/driver/palette.cpp @@ -22,9 +22,11 @@ #include "common/util.h" #include "base/engine.h" -#include "d_draw.h" -#include "driver96.h" -#include "../sword2.h" +#include "bs2/driver/d_draw.h" +#include "bs2/driver/driver96.h" +#include "bs2/sword2.h" + +namespace Sword2 { #define PALTABLESIZE 64 * 64 * 64 @@ -263,3 +265,5 @@ void FadeServer() { g_system->set_palette(newPalette, 0, 256); } + +} // End of namespace Sword2 diff --git a/sword2/driver/palette.h b/sword2/driver/palette.h index 7776ad27b6..cf66427597 100644 --- a/sword2/driver/palette.h +++ b/sword2/driver/palette.h @@ -34,11 +34,13 @@ #ifndef PALETTE_H #define PALETTE_H +namespace Sword2 { + extern uint8 paletteMatch[64*64*64]; extern int32 RestorePalette(void); extern void FadeServer(); +} // End of namespace Sword2 #endif - diff --git a/sword2/driver/rdwin.cpp b/sword2/driver/rdwin.cpp index 5a053d8ebe..1612f28ca5 100644 --- a/sword2/driver/rdwin.cpp +++ b/sword2/driver/rdwin.cpp @@ -21,18 +21,20 @@ #include "base/engine.h" #include "common/timer.h" -#include "driver96.h" - -#include "_mouse.h" -#include "keyboard.h" -#include "rdwin.h" -#include "d_draw.h" -#include "palette.h" -#include "render.h" -#include "menu.h" -#include "d_sound.h" +#include "bs2/driver/driver96.h" + +#include "bs2/driver/_mouse.h" +#include "bs2/driver/keyboard.h" +#include "bs2/driver/rdwin.h" +#include "bs2/driver/d_draw.h" +#include "bs2/driver/palette.h" +#include "bs2/driver/render.h" +#include "bs2/driver/menu.h" +#include "bs2/driver/d_sound.h" #include "bs2/sword2.h" +namespace Sword2 { + #define MENUDEEP 40 // Temporary, until menu.h is written! // --------------------------------------------------------------------------- @@ -126,3 +128,5 @@ void SetWindowName(const char *windowName) { // SetWindowText(hwnd, windowName); // strcpy(gameName, windowName); } + +} // End of namespace Sword2 diff --git a/sword2/driver/rdwin.h b/sword2/driver/rdwin.h index 404ef24e36..b0a483fe1a 100644 --- a/sword2/driver/rdwin.h +++ b/sword2/driver/rdwin.h @@ -20,6 +20,10 @@ #ifndef RDWIN_H #define RDWIN_H +namespace Sword2 { + extern void SetNeedRedraw(void); +} // End of namespace Sword2 + #endif diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index 17acf5735e..36b36b0c47 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -18,13 +18,15 @@ */ #include "stdafx.h" -#include "driver96.h" -#include "d_draw.h" -#include "rdwin.h" -#include "_mouse.h" -#include "render.h" -#include "menu.h" -#include "../sword2.h" +#include "bs2/driver/driver96.h" +#include "bs2/driver/d_draw.h" +#include "bs2/driver/rdwin.h" +#include "bs2/driver/_mouse.h" +#include "bs2/driver/render.h" +#include "bs2/driver/menu.h" +#include "bs2/sword2.h" + +namespace Sword2 { #define MILLISECSPERCYCLE 83 @@ -1010,3 +1012,5 @@ int32 CloseBackgroundLayer(void) { layer = 0; return RD_OK; } + +} // End of namespace Sword2 diff --git a/sword2/driver/render.h b/sword2/driver/render.h index 34dc8eae58..034eb1e936 100644 --- a/sword2/driver/render.h +++ b/sword2/driver/render.h @@ -33,7 +33,9 @@ #ifndef RENDER_H #define RENDER_H -#include "menu.h" +#include "bs2/driver/menu.h" + +namespace Sword2 { #define RENDERWIDE 640 #define ALIGNRENDERDEEP 480 @@ -58,4 +60,6 @@ void StretchImage(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16 dstHeight, void UploadRect(Common::Rect *r); +} // End of namespace Sword2 + #endif diff --git a/sword2/driver/sprite.cpp b/sword2/driver/sprite.cpp index cb2a6a38b1..de2c59fadb 100644 --- a/sword2/driver/sprite.cpp +++ b/sword2/driver/sprite.cpp @@ -25,6 +25,8 @@ #include "palette.h" #include "rdwin.h" +namespace Sword2 { + static uint8 *lightMask = 0; /** @@ -714,3 +716,5 @@ int32 CloseLightMask(void) { lightMask = 0; return RD_OK; } + +} // End of namespace Sword2 -- cgit v1.2.3