예제 #1
0
파일: function.cpp 프로젝트: 33d/scummvm
int16 Op_LoadOverlay() {
	char *pOverlayName;
	char overlayName[38] = "";
	int overlayLoadResult;

	pOverlayName = (char *)popPtr();

	if (strlen(pOverlayName) == 0)
		return 0;

	strcpy(overlayName, pOverlayName);
	strToUpper(overlayName);

	//gfxModuleData.field_84();
	//gfxModuleData.field_84();

	overlayLoadResult = loadOverlay(overlayName);

	updateAllScriptsImports();

	Common::strlcpy(nextOverlay, overlayName, sizeof(nextOverlay));

	return overlayLoadResult;
}
예제 #2
0
int16 Op_Protect() {
	popPtr();
	popVar();

	return 0;
}
예제 #3
0
int16 Op_LoadCt() {
	return initCt((const char *)popPtr());
}
예제 #4
0
int16 Op_Preload() {
	popPtr();
	popVar();

	return 0;
}
void
txStylesheetCompilerState::popSorter()
{
    mSorter = static_cast<txPushNewContext*>(popPtr());
}
void
txStylesheetCompilerState::popHandlerTable()
{
    mHandlerTable = static_cast<txHandlerTable*>(popPtr());
}
예제 #7
0
v8::Handle<v8::Value> QV8Worker::deserialize(const char *&data, QV8Engine *engine)
{
    quint32 header = popUint32(data);
    Type type = headertype(header);

    switch (type) {
    case WorkerUndefined:
        return v8::Undefined();
    case WorkerNull:
        return v8::Null();
    case WorkerTrue:
        return v8::True();
    case WorkerFalse:
        return v8::False();
    case WorkerString:
    {
        quint32 size = headersize(header);
        v8::Local<v8::String> string = v8::String::New((uint16_t*)data, size - 1);
        data += ALIGN(size * sizeof(uint16_t));
        return string;
    }
    case WorkerFunction:
        Q_ASSERT(!"Unreachable");
        break;
    case WorkerArray:
    {
        quint32 size = headersize(header);
        v8::Local<v8::Array> array = v8::Array::New(size);
        for (quint32 ii = 0; ii < size; ++ii) {
            array->Set(ii, deserialize(data, engine));
        }
        return array;
    }
    case WorkerObject:
    {
        quint32 size = headersize(header);
        v8::Local<v8::Object> o = v8::Object::New();
        for (quint32 ii = 0; ii < size; ++ii) {
            v8::Handle<v8::Value> name = deserialize(data, engine);
            v8::Handle<v8::Value> value = deserialize(data, engine);
            o->Set(name, value);
        }
        return o;
    }
    case WorkerInt32:
        return v8::Integer::New((qint32)popUint32(data));
    case WorkerUint32:
        return v8::Integer::NewFromUnsigned(popUint32(data));
    case WorkerNumber:
        return v8::Number::New(popDouble(data));
    case WorkerDate:
        return v8::Date::New(popDouble(data));
    case WorkerRegexp:
    {
        quint32 flags = headersize(header);
        quint32 length = popUint32(data);
        v8::Local<v8::String> source = v8::String::New((uint16_t*)data, length - 1);
        data += ALIGN(length * sizeof(uint16_t));
        return v8::RegExp::New(source, (v8::RegExp::Flags)flags);
    }
    case WorkerListModel:
    {
        void *ptr = popPtr(data);
        QDeclarativeListModelWorkerAgent *agent = (QDeclarativeListModelWorkerAgent *)ptr;
        v8::Handle<v8::Value> rv = engine->newQObject(agent);
        if (rv->IsObject()) {
            QDeclarativeListModelWorkerAgent::VariantRef ref(agent);
            QVariant var = qVariantFromValue(ref);
            rv->ToObject()->SetHiddenValue(v8::String::New("qml::ref"), engine->fromVariant(var));
        }
        agent->release();
        agent->setV8Engine(engine);
        return rv;
    }
    }
    Q_ASSERT(!"Unreachable");
    return v8::Undefined();
}