SHERLOCK: Syntactic fixes

This commit is contained in:
Paul Gilbert 2015-05-18 20:57:58 -04:00
parent 8d426ca464
commit a09937121c
7 changed files with 42 additions and 42 deletions

View File

@ -26,6 +26,13 @@
namespace Sherlock {
static const int FS_TRANS[8] = {
STOP_UP, STOP_UPRIGHT, STOP_RIGHT, STOP_DOWNRIGHT, STOP_DOWN,
STOP_DOWNLEFT, STOP_LEFT, STOP_UPLEFT
};
/*----------------------------------------------------------------*/
/**
* Load the data for the object
*/
@ -637,11 +644,6 @@ void Scene::transitionToScene() {
Common::Point &hSavedPos = people._hSavedPos;
int &hSavedFacing = people._hSavedFacing;
const int FS_TRANS[8] = {
STOP_UP, STOP_UPRIGHT, STOP_RIGHT, STOP_DOWNRIGHT, STOP_DOWN,
STOP_DOWNLEFT, STOP_LEFT, STOP_UPLEFT
};
if (hSavedPos.x < 1) {
// No exit information from last scene-check entrance info
if (_entrance._startPosition.x < 1) {

View File

@ -328,13 +328,10 @@ void Screen::flushImage(ImageFrame *frame, const Common::Point &pt,
*/
void Screen::print(const Common::Point &pt, byte color, const char *formatStr, ...) {
// Create the string to display
char buffer[100];
va_list args;
va_start(args, formatStr);
vsprintf(buffer, formatStr, args);
Common::String str = Common::String::vformat(formatStr, args);
va_end(args);
Common::String str(buffer);
// Figure out area to draw text in
Common::Point pos = pt;
@ -362,13 +359,10 @@ void Screen::print(const Common::Point &pt, byte color, const char *formatStr, .
*/
void Screen::gPrint(const Common::Point &pt, byte color, const char *formatStr, ...) {
// Create the string to display
char buffer[100];
va_list args;
va_start(args, formatStr);
vsprintf(buffer, formatStr, args);
Common::String str = Common::String::vformat(formatStr, args);
va_end(args);
Common::String str(buffer);
// Print the text
writeString(str, pt, color);

View File

@ -101,8 +101,8 @@ public:
void verticalTransition();
void print(const Common::Point &pt, byte color, const char *formatStr, ...);
void gPrint(const Common::Point &pt, byte color, const char *formatStr, ...);
void print(const Common::Point &pt, byte color, const char *formatStr, ...) GCC_PRINTF(4, 5);
void gPrint(const Common::Point &pt, byte color, const char *formatStr, ...) GCC_PRINTF(4, 5);
void restoreBackground(const Common::Rect &r);

View File

@ -25,7 +25,7 @@
namespace Sherlock {
const int SETUP_POINTS[12][4] = {
static const int SETUP_POINTS[12][4] = {
{ 4, 154, 101, 53 }, // Exit
{ 4, 165, 101, 53 }, // Music Toggle
{ 219, 165, 316, 268 }, // Voice Toggle
@ -40,13 +40,13 @@ const int SETUP_POINTS[12][4] = {
{ 219, 187, 316, 268 } // _key Pad Accel. Toggle
};
const char *const SETUP_STRS0[2] = { "off", "on" };
const char *const SETUP_STRS1[2] = { "Directly", "by Pixel" };
const char *const SETUP_STRS2[2] = { "Left", "Right" };
const char *const SETUP_STRS3[2] = { "Appear", "Slide" };
const char *const SETUP_STRS4[2] = { "Slow", "Fast" };
const char *const SETUP_STRS5[2] = { "Left", "Right" };
const char *const SETUP_NAMES[12] = {
static const char *const SETUP_STRS0[2] = { "off", "on" };
static const char *const SETUP_STRS1[2] = { "Directly", "by Pixel" };
static const char *const SETUP_STRS2[2] = { "Left", "Right" };
static const char *const SETUP_STRS3[2] = { "Appear", "Slide" };
static const char *const SETUP_STRS4[2] = { "Slow", "Fast" };
static const char *const SETUP_STRS5[2] = { "Left", "Right" };
static const char *const SETUP_NAMES[12] = {
"Exit", "M", "V", "S", "B", "New Font Style", "J", "Calibrate Joystick", "F", "W", "P", "K"
};

View File

@ -203,6 +203,8 @@ void SherlockEngine::handleInput() {
/**
* Read the state of a global flag
* @remarks If a negative value is specified, it will return the inverse value
* of the positive flag number
*/
bool SherlockEngine::readFlags(int flagNum) {
bool value = _flags[ABS(flagNum)];

View File

@ -30,6 +30,26 @@
namespace Sherlock {
static const int8 creativeADPCM_ScaleMap[64] = {
0, 1, 2, 3, 4, 5, 6, 7, 0, -1, -2, -3, -4, -5, -6, -7,
1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, -11, -13, -15,
2, 6, 10, 14, 18, 22, 26, 30, -2, -6, -10, -14, -18, -22, -26, -30,
4, 12, 20, 28, 36, 44, 52, 60, -4, -12, -20, -28, -36, -44, -52, -60
};
static const uint8 creativeADPCM_AdjustMap[64] = {
0, 0, 0, 0, 0, 16, 16, 16,
0, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 0, 0, 0,
240, 0, 0, 0, 0, 0, 0, 0
};
/*----------------------------------------------------------------*/
Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
_digitized = false;
_music = false;
@ -70,24 +90,6 @@ void Sound::loadSound(const Common::String &name, int priority) {
warning("loadSound");
}
static int8 creativeADPCM_ScaleMap[64] = {
0, 1, 2, 3, 4, 5, 6, 7, 0, -1, -2, -3, -4, -5, -6, -7,
1, 3, 5, 7, 9, 11, 13, 15, -1, -3, -5, -7, -9, -11, -13, -15,
2, 6, 10, 14, 18, 22, 26, 30, -2, -6, -10, -14, -18, -22, -26, -30,
4, 12, 20, 28, 36, 44, 52, 60, -4, -12, -20, -28, -36, -44, -52, -60
};
static uint8 creativeADPCM_AdjustMap[64] = {
0, 0, 0, 0, 0, 16, 16, 16,
0, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 16, 16, 16,
240, 0, 0, 0, 0, 0, 0, 0,
240, 0, 0, 0, 0, 0, 0, 0
};
byte Sound::decodeSample(byte sample, byte &reference, int16 &scale) {
int16 samp = sample + scale;
int16 ref = 0;

View File

@ -1665,7 +1665,7 @@ int Talk::waitForMore(int delay) {
if (events.kbHit()) {
Common::KeyState keyState = events.getKey();
if (keyState.keycode >= 32 && keyState.keycode < 128)
if (keyState.keycode >= ' ' && keyState.keycode < '~')
key2 = keyState.keycode;
}