WINTERMUTE: "if(" -> "if ("
This commit is contained in:
parent
fa96c9ea18
commit
1ad859a468
23 changed files with 63 additions and 70 deletions
|
@ -650,7 +650,7 @@ bool AdEntity::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
|
||||||
if (_theora && DID_SUCCEED(_theora->initialize(filename))) {
|
if (_theora && DID_SUCCEED(_theora->initialize(filename))) {
|
||||||
if (!valAlpha->isNULL()) _theora->setAlphaImage(valAlpha->getString());
|
if (!valAlpha->isNULL()) _theora->setAlphaImage(valAlpha->getString());
|
||||||
_theora->play(VID_PLAY_POS, 0, 0, false, false, looping, startTime, _scale >= 0.0f ? _scale : -1.0f, _sFXVolume);
|
_theora->play(VID_PLAY_POS, 0, 0, false, false, looping, startTime, _scale >= 0.0f ? _scale : -1.0f, _sFXVolume);
|
||||||
//if(m_Scale>=0) m_Theora->m_PlayZoom = m_Scale;
|
//if (_scale>=0) _theora->_playZoom = _scale;
|
||||||
stack->pushBool(true);
|
stack->pushBool(true);
|
||||||
} else {
|
} else {
|
||||||
script->runtimeError("Entity.PlayTheora - error playing video '%s'", filename);
|
script->runtimeError("Entity.PlayTheora - error playing video '%s'", filename);
|
||||||
|
|
|
@ -335,7 +335,7 @@ bool AdGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
|
||||||
|
|
||||||
|
|
||||||
//bool ret = ChangeScene(stack->pop()->getString());
|
//bool ret = ChangeScene(stack->pop()->getString());
|
||||||
//if(DID_FAIL(ret)) stack->pushBool(false);
|
//if (DID_FAIL(ret)) stack->pushBool(false);
|
||||||
//else stack->pushBool(true);
|
//else stack->pushBool(true);
|
||||||
|
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
|
@ -821,7 +821,7 @@ ScValue *AdGame::scGetProperty(const char *name) {
|
||||||
// SelectedItem
|
// SelectedItem
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
else if (strcmp(name, "SelectedItem") == 0) {
|
else if (strcmp(name, "SelectedItem") == 0) {
|
||||||
//if(_selectedItem) _scValue->setString(_selectedItem->_name);
|
//if (_selectedItem) _scValue->setString(_selectedItem->_name);
|
||||||
if (_selectedItem) _scValue->setNative(_selectedItem, true);
|
if (_selectedItem) _scValue->setNative(_selectedItem, true);
|
||||||
else _scValue->setNULL();
|
else _scValue->setNULL();
|
||||||
|
|
||||||
|
|
|
@ -2491,7 +2491,7 @@ bool AdScene::persistState(bool saving) {
|
||||||
nodeState = state->getNodeState(node->_entity->getName(), saving);
|
nodeState = state->getNodeState(node->_entity->getName(), saving);
|
||||||
if (nodeState) {
|
if (nodeState) {
|
||||||
nodeState->transferEntity(node->_entity, _persistentStateSprites, saving);
|
nodeState->transferEntity(node->_entity, _persistentStateSprites, saving);
|
||||||
//if(Saving) NodeState->_active = node->_entity->_active;
|
//if (Saving) NodeState->_active = node->_entity->_active;
|
||||||
//else node->_entity->_active = NodeState->_active;
|
//else node->_entity->_active = NodeState->_active;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -2517,7 +2517,7 @@ bool AdScene::persistState(bool saving) {
|
||||||
nodeState = state->getNodeState(_objects[i]->getName(), saving);
|
nodeState = state->getNodeState(_objects[i]->getName(), saving);
|
||||||
if (nodeState) {
|
if (nodeState) {
|
||||||
nodeState->transferEntity((AdEntity *)_objects[i], _persistentStateSprites, saving);
|
nodeState->transferEntity((AdEntity *)_objects[i], _persistentStateSprites, saving);
|
||||||
//if(Saving) NodeState->_active = _objects[i]->_active;
|
//if (Saving) NodeState->_active = _objects[i]->_active;
|
||||||
//else _objects[i]->_active = NodeState->_active;
|
//else _objects[i]->_active = NodeState->_active;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2684,7 +2684,7 @@ bool AdScene::getSceneObjects(BaseArray<AdObject *, AdObject *> &objects, bool i
|
||||||
}
|
}
|
||||||
if (!found) objects.add(regionObj[newIndex]);
|
if (!found) objects.add(regionObj[newIndex]);
|
||||||
}
|
}
|
||||||
//if(RegionObj.getSize() > 0) Objects.Append(RegionObj);
|
//if (RegionObj.getSize() > 0) Objects.Append(RegionObj);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -320,7 +320,7 @@ bool AdTalkHolder::scSetProperty(const char *name, ScValue *value) {
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// Item
|
// Item
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
if(strcmp(name, "Item")==0){
|
if (strcmp(name, "Item")==0){
|
||||||
SetItem(value->getString());
|
SetItem(value->getString());
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3242,7 +3242,7 @@ bool BaseGame::loadGame(const char *filename) {
|
||||||
BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
|
BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
|
||||||
if (DID_FAIL(ret = pm->initLoad(filename))) goto load_finish;
|
if (DID_FAIL(ret = pm->initLoad(filename))) goto load_finish;
|
||||||
|
|
||||||
//if(DID_FAIL(ret = cleanup())) goto load_finish;
|
//if (DID_FAIL(ret = cleanup())) goto load_finish;
|
||||||
if (DID_FAIL(ret = SystemClassRegistry::getInstance()->loadTable(_gameRef, pm))) goto load_finish;
|
if (DID_FAIL(ret = SystemClassRegistry::getInstance()->loadTable(_gameRef, pm))) goto load_finish;
|
||||||
if (DID_FAIL(ret = SystemClassRegistry::getInstance()->loadInstances(_gameRef, pm))) goto load_finish;
|
if (DID_FAIL(ret = SystemClassRegistry::getInstance()->loadInstances(_gameRef, pm))) goto load_finish;
|
||||||
|
|
||||||
|
@ -3873,7 +3873,7 @@ bool BaseGame::setActiveObject(BaseObject *obj) {
|
||||||
if (obj == _activeObject) return STATUS_OK;
|
if (obj == _activeObject) return STATUS_OK;
|
||||||
|
|
||||||
if (_activeObject) _activeObject->applyEvent("MouseLeave");
|
if (_activeObject) _activeObject->applyEvent("MouseLeave");
|
||||||
//if(ValidObject(_activeObject)) _activeObject->applyEvent("MouseLeave");
|
//if (ValidObject(_activeObject)) _activeObject->applyEvent("MouseLeave");
|
||||||
_activeObject = obj;
|
_activeObject = obj;
|
||||||
if (_activeObject) {
|
if (_activeObject) {
|
||||||
_activeObject->applyEvent("MouseEntry");
|
_activeObject->applyEvent("MouseEntry");
|
||||||
|
|
|
@ -215,7 +215,7 @@ bool BaseKeyboardState::readKey(Common::Event *event) {
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
bool BaseKeyboardState::persist(BasePersistenceManager *persistMgr) {
|
bool BaseKeyboardState::persist(BasePersistenceManager *persistMgr) {
|
||||||
//if(!persistMgr->getIsSaving()) cleanup();
|
//if (!persistMgr->getIsSaving()) cleanup();
|
||||||
BaseScriptable::persist(persistMgr);
|
BaseScriptable::persist(persistMgr);
|
||||||
|
|
||||||
persistMgr->transfer(TMEMBER(_currentAlt));
|
persistMgr->transfer(TMEMBER(_currentAlt));
|
||||||
|
|
|
@ -49,7 +49,7 @@ BaseScriptable::BaseScriptable(BaseGame *inGame, bool noValue, bool persistable)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
BaseScriptable::~BaseScriptable() {
|
BaseScriptable::~BaseScriptable() {
|
||||||
//if(_refCount>0) _gameRef->LOG(0, "Warning: Destroying object, _refCount=%d", _refCount);
|
//if (_refCount>0) _gameRef->LOG(0, "Warning: Destroying object, _refCount=%d", _refCount);
|
||||||
delete _scValue;
|
delete _scValue;
|
||||||
delete _scProp;
|
delete _scProp;
|
||||||
_scValue = NULL;
|
_scValue = NULL;
|
||||||
|
|
|
@ -329,7 +329,7 @@ void BaseSprite::reset() {
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
bool BaseSprite::GetCurrentFrame(float zoomX, float zoomY) {
|
bool BaseSprite::GetCurrentFrame(float zoomX, float zoomY) {
|
||||||
//if(_owner && _owner->_freezable && _gameRef->_state == GAME_FROZEN) return true;
|
//if (_owner && _owner->_freezable && _gameRef->_state == GAME_FROZEN) return true;
|
||||||
|
|
||||||
if (_currentFrame == -1) return false;
|
if (_currentFrame == -1) return false;
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ bool BaseSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
|
||||||
if (custoTrans) _transparent = BYTETORGBA(r, g, b, 0xFF);
|
if (custoTrans) _transparent = BYTETORGBA(r, g, b, 0xFF);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(_surface == NULL)
|
if (_surface == NULL)
|
||||||
{
|
{
|
||||||
_gameRef->LOG(0, "Error parsing sub-frame. Image not set.");
|
_gameRef->LOG(0, "Error parsing sub-frame. Image not set.");
|
||||||
return STATUS_FAILED;
|
return STATUS_FAILED;
|
||||||
|
@ -217,7 +217,7 @@ bool BaseSubFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, fl
|
||||||
|
|
||||||
bool res;
|
bool res;
|
||||||
|
|
||||||
//if(Alpha==0xFFFFFFFF) Alpha = _alpha; // TODO: better (combine owner's and self alpha)
|
//if (Alpha==0xFFFFFFFF) Alpha = _alpha; // TODO: better (combine owner's and self alpha)
|
||||||
if (_alpha != 0xFFFFFFFF) alpha = _alpha;
|
if (_alpha != 0xFFFFFFFF) alpha = _alpha;
|
||||||
|
|
||||||
if (rotate != 0.0f) {
|
if (rotate != 0.0f) {
|
||||||
|
|
|
@ -147,7 +147,7 @@ bool BaseSurfaceStorage::restoreAll() {
|
||||||
bool BaseSurfaceStorage::persist(BasePersistenceManager *persistMgr)
|
bool BaseSurfaceStorage::persist(BasePersistenceManager *persistMgr)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(!persistMgr->getIsSaving()) cleanup(false);
|
if (!persistMgr->getIsSaving()) cleanup(false);
|
||||||
|
|
||||||
persistMgr->transfer(TMEMBER(_gameRef));
|
persistMgr->transfer(TMEMBER(_gameRef));
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ int BaseFont::getTextWidth(byte *text, int maxLength) {
|
||||||
bool BaseFont::loadFile(const char * Filename)
|
bool BaseFont::loadFile(const char * Filename)
|
||||||
{
|
{
|
||||||
BYTE* Buffer = _gameRef->_fileManager->readWholeFile(filename);
|
BYTE* Buffer = _gameRef->_fileManager->readWholeFile(filename);
|
||||||
if(Buffer==NULL){
|
if (Buffer==NULL){
|
||||||
_gameRef->LOG(0, "BaseFont::LoadFile failed for file '%s'", filename);
|
_gameRef->LOG(0, "BaseFont::LoadFile failed for file '%s'", filename);
|
||||||
return STATUS_FAILED;
|
return STATUS_FAILED;
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ bool BaseFont::loadFile(const char * Filename)
|
||||||
_filename = new char [strlen(filename)+1];
|
_filename = new char [strlen(filename)+1];
|
||||||
strcpy(_filename, filename);
|
strcpy(_filename, filename);
|
||||||
|
|
||||||
if(DID_FAIL(ret = loadBuffer(Buffer))) _gameRef->LOG(0, "Error parsing FONT file '%s'", filename);
|
if (DID_FAIL(ret = loadBuffer(Buffer))) _gameRef->LOG(0, "Error parsing FONT file '%s'", filename);
|
||||||
|
|
||||||
delete[] Buffer;
|
delete[] Buffer;
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ bool BaseFont::loadBuffer(byte * Buffer)
|
||||||
int cmd;
|
int cmd;
|
||||||
BaseParser parser(_gameRef);
|
BaseParser parser(_gameRef);
|
||||||
|
|
||||||
if(parser.GetCommand ((char**)&Buffer, commands, (char**)¶ms)!=TOKEN_FONT){
|
if (parser.GetCommand ((char**)&Buffer, commands, (char**)¶ms)!=TOKEN_FONT){
|
||||||
_gameRef->LOG(0, "'FONT' keyword expected.");
|
_gameRef->LOG(0, "'FONT' keyword expected.");
|
||||||
return STATUS_FAILED;
|
return STATUS_FAILED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -591,11 +591,11 @@ bool ScScript::executeInstruction() {
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
ScValue* val = var->getProp(MethodName);
|
ScValue* val = var->getProp(MethodName);
|
||||||
if(val){
|
if (val){
|
||||||
dw = GetFuncPos(val->getString());
|
dw = GetFuncPos(val->getString());
|
||||||
if(dw==0){
|
if (dw==0){
|
||||||
TExternalFunction* f = GetExternal(val->getString());
|
TExternalFunction* f = GetExternal(val->getString());
|
||||||
if(f){
|
if (f){
|
||||||
ExternalCall(_stack, _thisStack, f);
|
ExternalCall(_stack, _thisStack, f);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -776,7 +776,7 @@ bool ScScript::executeInstruction() {
|
||||||
|
|
||||||
case II_JMP_FALSE: {
|
case II_JMP_FALSE: {
|
||||||
dw = getDWORD();
|
dw = getDWORD();
|
||||||
//if(!_stack->pop()->getBool()) _iP = dw;
|
//if (!_stack->pop()->getBool()) _iP = dw;
|
||||||
ScValue *val = _stack->pop();
|
ScValue *val = _stack->pop();
|
||||||
if (!val) {
|
if (!val) {
|
||||||
runtimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
|
runtimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
|
||||||
|
@ -864,7 +864,7 @@ bool ScScript::executeInstruction() {
|
||||||
|
|
||||||
case II_NOT:
|
case II_NOT:
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
//if(op1->isNULL()) _operand->setNULL();
|
//if (op1->isNULL()) _operand->setNULL();
|
||||||
if (op1->isNULL()) _operand->setBool(true);
|
if (op1->isNULL()) _operand->setBool(true);
|
||||||
else _operand->setBool(!op1->getBool());
|
else _operand->setBool(!op1->getBool());
|
||||||
_stack->push(_operand);
|
_stack->push(_operand);
|
||||||
|
@ -900,14 +900,14 @@ bool ScScript::executeInstruction() {
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(false);
|
if ((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(false);
|
||||||
else if(op1->isNative() && op2->isNative()){
|
else if (op1->isNative() && op2->isNative()){
|
||||||
_operand->setBool(op1->getNative() == op2->getNative());
|
_operand->setBool(op1->getNative() == op2->getNative());
|
||||||
}
|
}
|
||||||
else if(op1->getType()==VAL_STRING || op2->getType()==VAL_STRING){
|
else if (op1->getType()==VAL_STRING || op2->getType()==VAL_STRING){
|
||||||
_operand->setBool(scumm_stricmp(op1->getString(), op2->getString())==0);
|
_operand->setBool(scumm_stricmp(op1->getString(), op2->getString())==0);
|
||||||
}
|
}
|
||||||
else if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
else if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
||||||
_operand->setBool(op1->getFloat() == op2->getFloat());
|
_operand->setBool(op1->getFloat() == op2->getFloat());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -924,14 +924,14 @@ bool ScScript::executeInstruction() {
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(true);
|
if ((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(true);
|
||||||
else if(op1->isNative() && op2->isNative()){
|
else if (op1->isNative() && op2->isNative()){
|
||||||
_operand->setBool(op1->getNative() != op2->getNative());
|
_operand->setBool(op1->getNative() != op2->getNative());
|
||||||
}
|
}
|
||||||
else if(op1->getType()==VAL_STRING || op2->getType()==VAL_STRING){
|
else if (op1->getType()==VAL_STRING || op2->getType()==VAL_STRING){
|
||||||
_operand->setBool(scumm_stricmp(op1->getString(), op2->getString())!=0);
|
_operand->setBool(scumm_stricmp(op1->getString(), op2->getString())!=0);
|
||||||
}
|
}
|
||||||
else if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
else if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
||||||
_operand->setBool(op1->getFloat() != op2->getFloat());
|
_operand->setBool(op1->getFloat() != op2->getFloat());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
|
@ -948,7 +948,7 @@ bool ScScript::executeInstruction() {
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
||||||
_operand->setBool(op1->getFloat() < op2->getFloat());
|
_operand->setBool(op1->getFloat() < op2->getFloat());
|
||||||
}
|
}
|
||||||
else _operand->setBool(op1->getInt() < op2->getInt());
|
else _operand->setBool(op1->getInt() < op2->getInt());
|
||||||
|
@ -963,7 +963,7 @@ bool ScScript::executeInstruction() {
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
||||||
_operand->setBool(op1->getFloat() > op2->getFloat());
|
_operand->setBool(op1->getFloat() > op2->getFloat());
|
||||||
}
|
}
|
||||||
else _operand->setBool(op1->getInt() > op2->getInt());
|
else _operand->setBool(op1->getInt() > op2->getInt());
|
||||||
|
@ -978,7 +978,7 @@ bool ScScript::executeInstruction() {
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
||||||
_operand->setBool(op1->getFloat() <= op2->getFloat());
|
_operand->setBool(op1->getFloat() <= op2->getFloat());
|
||||||
}
|
}
|
||||||
else _operand->setBool(op1->getInt() <= op2->getInt());
|
else _operand->setBool(op1->getInt() <= op2->getInt());
|
||||||
|
@ -993,7 +993,7 @@ bool ScScript::executeInstruction() {
|
||||||
op1 = _stack->pop();
|
op1 = _stack->pop();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
|
||||||
_operand->setBool(op1->getFloat() >= op2->getFloat());
|
_operand->setBool(op1->getFloat() >= op2->getFloat());
|
||||||
}
|
}
|
||||||
else _operand->setBool(op1->getInt() >= op2->getInt());
|
else _operand->setBool(op1->getInt() >= op2->getInt());
|
||||||
|
@ -1257,7 +1257,7 @@ bool ScScript::persist(BasePersistenceManager *persistMgr) {
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
ScScript *ScScript::invokeEventHandler(const char *eventName, bool unbreakable) {
|
ScScript *ScScript::invokeEventHandler(const char *eventName, bool unbreakable) {
|
||||||
//if(_state!=SCRIPT_PERSISTENT) return NULL;
|
//if (_state!=SCRIPT_PERSISTENT) return NULL;
|
||||||
|
|
||||||
uint32 pos = getEventPos(eventName);
|
uint32 pos = getEventPos(eventName);
|
||||||
if (!pos) return NULL;
|
if (!pos) return NULL;
|
||||||
|
|
|
@ -257,14 +257,14 @@ bool ScEngine::tick() {
|
||||||
bool obj_found=false;
|
bool obj_found=false;
|
||||||
for(int j=0; j<_gameRef->_regObjects.getSize(); j++)
|
for(int j=0; j<_gameRef->_regObjects.getSize(); j++)
|
||||||
{
|
{
|
||||||
if(_gameRef->_regObjects[j] == _scripts[i]->_waitObject)
|
if (_gameRef->_regObjects[j] == _scripts[i]->_waitObject)
|
||||||
{
|
{
|
||||||
if(_gameRef->_regObjects[j]->IsReady()) _scripts[i]->Run();
|
if (_gameRef->_regObjects[j]->IsReady()) _scripts[i]->Run();
|
||||||
obj_found = true;
|
obj_found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!obj_found) _scripts[i]->finish(); // _waitObject no longer exists
|
if (!obj_found) _scripts[i]->finish(); // _waitObject no longer exists
|
||||||
*/
|
*/
|
||||||
if (_gameRef->validObject(_scripts[i]->_waitObject)) {
|
if (_gameRef->validObject(_scripts[i]->_waitObject)) {
|
||||||
if (_scripts[i]->_waitObject->isReady()) _scripts[i]->run();
|
if (_scripts[i]->_waitObject->isReady()) _scripts[i]->run();
|
||||||
|
|
|
@ -228,7 +228,7 @@ bool SXDate::scSetProperty(const char *name, ScValue *value) {
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// Name
|
// Name
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
if(strcmp(name, "Name")==0){
|
if (strcmp(name, "Name")==0){
|
||||||
setName(value->getString());
|
setName(value->getString());
|
||||||
return STATUS_OK;
|
return STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -663,12 +663,12 @@ bool SXFile::scSetProperty(const char *name, ScValue *value) {
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// Length
|
// Length
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
if(strcmp(name, "Length")==0){
|
if (strcmp(name, "Length")==0){
|
||||||
int OrigLength = _length;
|
int OrigLength = _length;
|
||||||
_length = max(value->getInt(0), 0);
|
_length = max(value->getInt(0), 0);
|
||||||
|
|
||||||
char PropName[20];
|
char PropName[20];
|
||||||
if(_length < OrigLength){
|
if (_length < OrigLength){
|
||||||
for(int i=_length; i<OrigLength; i++){
|
for(int i=_length; i<OrigLength; i++){
|
||||||
sprintf(PropName, "%d", i);
|
sprintf(PropName, "%d", i);
|
||||||
_values->DeleteProp(PropName);
|
_values->DeleteProp(PropName);
|
||||||
|
|
|
@ -462,12 +462,12 @@ bool SXMemBuffer::scSetProperty(const char *name, ScValue *value) {
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
// Length
|
// Length
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
if(strcmp(name, "Length")==0){
|
if (strcmp(name, "Length")==0){
|
||||||
int OrigLength = _length;
|
int OrigLength = _length;
|
||||||
_length = max(value->getInt(0), 0);
|
_length = max(value->getInt(0), 0);
|
||||||
|
|
||||||
char PropName[20];
|
char PropName[20];
|
||||||
if(_length < OrigLength){
|
if (_length < OrigLength){
|
||||||
for(int i=_length; i<OrigLength; i++){
|
for(int i=_length; i<OrigLength; i++){
|
||||||
sprintf(PropName, "%d", i);
|
sprintf(PropName, "%d", i);
|
||||||
_values->DeleteProp(PropName);
|
_values->DeleteProp(PropName);
|
||||||
|
|
|
@ -240,7 +240,7 @@ bool ScValue::setProp(const char *name, ScValue *val, bool copyWhole, bool setAs
|
||||||
val->_isConstVar = SetAsConst;
|
val->_isConstVar = SetAsConst;
|
||||||
_valObject[Name] = val;
|
_valObject[Name] = val;
|
||||||
|
|
||||||
if(_type!=VAL_NATIVE) _type = VAL_OBJECT;
|
if (_type!=VAL_NATIVE) _type = VAL_OBJECT;
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,22 +148,22 @@ bool BaseSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
|
||||||
bool res;
|
bool res;
|
||||||
bool NewlyCreated = false;
|
bool NewlyCreated = false;
|
||||||
|
|
||||||
if(!_soundBuffer || ForceReload || _streamed){
|
if (!_soundBuffer || ForceReload || _streamed){
|
||||||
if(!_file) _file = _gameRef->_fileManager->openFile(filename);
|
if (!_file) _file = _gameRef->_fileManager->openFile(filename);
|
||||||
if(!_file){
|
if (!_file){
|
||||||
_gameRef->LOG(0, "Error opening sound file '%s'", filename);
|
_gameRef->LOG(0, "Error opening sound file '%s'", filename);
|
||||||
return STATUS_FAILED;
|
return STATUS_FAILED;
|
||||||
}
|
}
|
||||||
// switch to streamed for big files
|
// switch to streamed for big files
|
||||||
if(!_streamed && (_file->GetSize() > MAX_NONSTREAMED_FILE_SIZE && !_gameRef->_forceNonStreamedSounds)) SetStreaming(true);
|
if (!_streamed && (_file->GetSize() > MAX_NONSTREAMED_FILE_SIZE && !_gameRef->_forceNonStreamedSounds)) SetStreaming(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// create buffer
|
// create buffer
|
||||||
if(!_soundBuffer){
|
if (!_soundBuffer){
|
||||||
NewlyCreated = true;
|
NewlyCreated = true;
|
||||||
|
|
||||||
res = InitializeBuffer(_file);
|
res = InitializeBuffer(_file);
|
||||||
if(DID_FAIL(res)){
|
if (DID_FAIL(res)){
|
||||||
_gameRef->LOG(res, "Error creating sound buffer for file '%s'", filename);
|
_gameRef->LOG(res, "Error creating sound buffer for file '%s'", filename);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -172,13 +172,13 @@ bool BaseSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
|
||||||
|
|
||||||
|
|
||||||
// store filename
|
// store filename
|
||||||
if(!_filename){
|
if (!_filename){
|
||||||
_filename = new char[strlen(filename)+1];
|
_filename = new char[strlen(filename)+1];
|
||||||
strcpy(_filename, filename);
|
strcpy(_filename, filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
// close file (if not streaming)
|
// close file (if not streaming)
|
||||||
if(!_streamed && _file){
|
if (!_streamed && _file){
|
||||||
_gameRef->_fileManager->closeFile(_file);
|
_gameRef->_fileManager->closeFile(_file);
|
||||||
_file = NULL;
|
_file = NULL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,11 +48,4 @@
|
||||||
|
|
||||||
#define COMPRESSED_FILE_MAGIC 0x504D435A // ZCMP
|
#define COMPRESSED_FILE_MAGIC 0x504D435A // ZCMP
|
||||||
|
|
||||||
#ifdef GetClassName
|
|
||||||
#undef GetClassName
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// macros
|
|
||||||
#define RELEASE(obj) if(obj) { obj->Release(); obj = NULL; } else 0
|
|
||||||
|
|
||||||
#endif // _DCGF_H_
|
#endif // _DCGF_H_
|
||||||
|
|
|
@ -627,7 +627,7 @@ bool UIButton::display(int offsetX, int offsetY) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (back) back->display(offsetX + _posX, offsetY + _posY, _width, _height);
|
if (back) back->display(offsetX + _posX, offsetY + _posY, _width, _height);
|
||||||
//if(image) image->Draw(ImageX +((_press||_oneTimePress)&&back?1:0), ImageY +((_press||_oneTimePress)&&back?1:0), NULL);
|
//if (image) image->Draw(ImageX +((_press||_oneTimePress)&&back?1:0), ImageY +((_press||_oneTimePress)&&back?1:0), NULL);
|
||||||
if (image) image->draw(imageX + ((_press || _oneTimePress) && back ? 1 : 0), imageY + ((_press || _oneTimePress) && back ? 1 : 0), _pixelPerfect ? this : NULL);
|
if (image) image->draw(imageX + ((_press || _oneTimePress) && back ? 1 : 0), imageY + ((_press || _oneTimePress) && back ? 1 : 0), _pixelPerfect ? this : NULL);
|
||||||
|
|
||||||
if (font && _text) {
|
if (font && _text) {
|
||||||
|
|
|
@ -217,11 +217,11 @@ bool VideoPlayer::update() {
|
||||||
|
|
||||||
DWORD CurrentTime; // current playing time (in ms)
|
DWORD CurrentTime; // current playing time (in ms)
|
||||||
/*
|
/*
|
||||||
if(m_SoundAvailable && m_Sound){
|
if (m_SoundAvailable && m_Sound){
|
||||||
CurrentTime = m_Sound->GetPosition(); // in samples
|
CurrentTime = m_Sound->GetPosition(); // in samples
|
||||||
CurrentTime /= (m_Sound->m_Format.wf.nSamplesPerSec / 1000);
|
CurrentTime /= (m_Sound->m_Format.wf.nSamplesPerSec / 1000);
|
||||||
|
|
||||||
if(!m_Sound->IsPlaying()) CurrentTime = m_TotalVideoTime;
|
if (!m_Sound->IsPlaying()) CurrentTime = m_TotalVideoTime;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CurrentTime = timeGetTime() - m_StartTime;
|
CurrentTime = timeGetTime() - m_StartTime;
|
||||||
|
|
|
@ -547,7 +547,7 @@ bool VideoTheoraPlayer::update() {
|
||||||
|
|
||||||
|
|
||||||
// If playback has begun, top audio buffer off immediately.
|
// If playback has begun, top audio buffer off immediately.
|
||||||
//if(m_Sound) WriteAudio();
|
//if (m_Sound) WriteAudio();
|
||||||
|
|
||||||
// are we at or past time for this video frame?
|
// are we at or past time for this video frame?
|
||||||
if (m_PlaybackStarted && m_VideoFrameReady && (!m_FrameRendered || m_VideobufTime <= GetMovieTime())) {
|
if (m_PlaybackStarted && m_VideoFrameReady && (!m_FrameRendered || m_VideobufTime <= GetMovieTime())) {
|
||||||
|
|
|
@ -165,7 +165,7 @@ int WinterMuteEngine::init() {
|
||||||
bool windowedMode = !ConfMan.getBool("fullscreen");
|
bool windowedMode = !ConfMan.getBool("fullscreen");
|
||||||
|
|
||||||
// parse command line
|
// parse command line
|
||||||
char *SaveGame = NULL;
|
char *saveGame = NULL;
|
||||||
/* for (int i = 0; i < argc; i++) {
|
/* for (int i = 0; i < argc; i++) {
|
||||||
strcpy(param, argv[i]);
|
strcpy(param, argv[i]);
|
||||||
|
|
||||||
|
@ -268,9 +268,9 @@ int WinterMuteEngine::init() {
|
||||||
_game->loadGame(str.c_str());
|
_game->loadGame(str.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SaveGame) {
|
if (saveGame) {
|
||||||
_game->loadGame(SaveGame);
|
_game->loadGame(saveGame);
|
||||||
delete[] SaveGame;
|
delete[] saveGame;
|
||||||
}
|
}
|
||||||
|
|
||||||
// all set, ready to go
|
// all set, ready to go
|
||||||
|
@ -314,9 +314,9 @@ int WinterMuteEngine::messageLoop() {
|
||||||
if (_game) {
|
if (_game) {
|
||||||
// remember previous window position
|
// remember previous window position
|
||||||
/*
|
/*
|
||||||
if(_game->_renderer && _game->_renderer->_windowed)
|
if (_game->_renderer && _game->_renderer->_windowed)
|
||||||
{
|
{
|
||||||
if(!::IsIconic(_game->_renderer->_window))
|
if (!::IsIconic(_game->_renderer->_window))
|
||||||
{
|
{
|
||||||
int PosX = _game->_renderer->_windowRect.left;
|
int PosX = _game->_renderer->_windowRect.left;
|
||||||
int PosY = _game->_renderer->_windowRect.top;
|
int PosY = _game->_renderer->_windowRect.top;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue