예제 #1
0
void ScriptOverlay::Unserialize(int index, const char *serializedData, int dataSize) {
  StartUnserialize(serializedData, dataSize);
  overlayId = UnserializeInt();
  borderWidth = UnserializeInt();
  borderHeight = UnserializeInt();
  isBackgroundSpeech = UnserializeInt();
  ccRegisterUnserializedObject(index, this, this);
}
예제 #2
0
void ScriptDateTime::Unserialize(int index, const char *serializedData, int dataSize) {
  StartUnserialize(serializedData, dataSize);
  year = UnserializeInt();
  month = UnserializeInt();
  day = UnserializeInt();
  hour = UnserializeInt();
  minute = UnserializeInt();
  second = UnserializeInt();
  rawUnixTime = UnserializeInt();
  ccRegisterUnserializedObject(index, this, this);
}
예제 #3
0
void ScriptDrawingSurface::Unserialize(int index, const char *serializedData, int dataSize) {
  StartUnserialize(serializedData, dataSize);
  roomBackgroundNumber = UnserializeInt();
  dynamicSpriteNumber = UnserializeInt();
  dynamicSurfaceNumber = UnserializeInt();
  currentColour = UnserializeInt();
  currentColourScript = UnserializeInt();
  highResCoordinates = UnserializeInt();
  modified = UnserializeInt();
  hasAlphaChannel = UnserializeInt();
  isLinkedBitmapOnly = (UnserializeInt() != 0);
  ccRegisterUnserializedObject(index, this, this);
}
예제 #4
0
void ScriptUserObject::Unserialize(int index, const char *serializedData, int dataSize)
{
    Create(serializedData, dataSize);
    ccRegisterUnserializedObject(index, this, this);
}
예제 #5
0
파일: cc_character.cpp 프로젝트: bitope/ags
void CCCharacter::Unserialize(int index, const char *serializedData, int dataSize) {
    StartUnserialize(serializedData, dataSize);
    int num = UnserializeInt();
    ccRegisterUnserializedObject(index, &game.chars[num], this);
}
예제 #6
0
void IAGSEngine::RegisterUnserializedObject(int key, const void *object, IAGSScriptManagedObject *callback) {
  ccRegisterUnserializedObject(key, object, (ICCDynamicObject*)callback);
}
예제 #7
0
void CCHotspot::Unserialize(int index, const char *serializedData, int dataSize) {
    StartUnserialize(serializedData, dataSize);
    int num = UnserializeInt();
    ccRegisterUnserializedObject(index, &scrHotspot[num], this);
}
예제 #8
0
void CCGUIObject::Unserialize(int index, const char *serializedData, int dataSize) {
    StartUnserialize(serializedData, dataSize);
    int guinum = UnserializeInt();
    int objnum = UnserializeInt();
    ccRegisterUnserializedObject(index, guis[guinum].Controls[objnum], this);
}
예제 #9
0
void CCAudioChannel::Unserialize(int index, const char *serializedData, int dataSize) {
  StartUnserialize(serializedData, dataSize);
  int id = UnserializeInt();
  ccRegisterUnserializedObject(index, &scrAudioChannel[id], this);
}
예제 #10
0
void CCAudioClip::Unserialize(int index, const char *serializedData, int dataSize) {
    StartUnserialize(serializedData, dataSize);
    int id = UnserializeInt();
    ccRegisterUnserializedObject(index, &game.audioClips[id], this);
}
예제 #11
0
void CCDynamicArray::Unserialize(int index, const char *serializedData, int dataSize) {
  char *newArray = new char[dataSize];
  memcpy(newArray, serializedData, dataSize);
  ccRegisterUnserializedObject(index, &newArray[8], this);
}
예제 #12
0
void AGSDeSerializer::Unserialize(int index, const char *objectType, const char *serializedData, int dataSize) {
    if (strcmp(objectType, "GUIObject") == 0) {
        ccDynamicGUIObject.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "Character") == 0) {
        ccDynamicCharacter.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "Hotspot") == 0) {
        ccDynamicHotspot.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "Region") == 0) {
        ccDynamicRegion.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "Inventory") == 0) {
        ccDynamicInv.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "Dialog") == 0) {
        ccDynamicDialog.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "GUI") == 0) {
        ccDynamicGUI.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "Object") == 0) {
        ccDynamicObject.Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "String") == 0) {
        ScriptString *scf = new ScriptString();
        scf->Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "File") == 0) {
        // files cannot be restored properly -- so just recreate
        // the object; attempting any operations on it will fail
        sc_File *scf = new sc_File();
        ccRegisterUnserializedObject(index, scf, scf);
    }
    else if (strcmp(objectType, "Overlay") == 0) {
        ScriptOverlay *scf = new ScriptOverlay();
        scf->Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "DateTime") == 0) {
        ScriptDateTime *scf = new ScriptDateTime();
        scf->Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "ViewFrame") == 0) {
        ScriptViewFrame *scf = new ScriptViewFrame();
        scf->Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "DynamicSprite") == 0) {
        ScriptDynamicSprite *scf = new ScriptDynamicSprite();
        scf->Unserialize(index, serializedData, dataSize);
    }
    else if (strcmp(objectType, "DrawingSurface") == 0) {
        ScriptDrawingSurface *sds = new ScriptDrawingSurface();
        sds->Unserialize(index, serializedData, dataSize);

        if (sds->isLinkedBitmapOnly)
        {
            dialogOptionsRenderingSurface = sds;
        }
    }
    else if (strcmp(objectType, "DialogOptionsRendering") == 0)
    {
        ccDialogOptionsRendering.Unserialize(index, serializedData, dataSize);
    }
    else if (!unserialize_audio_script_object(index, objectType, serializedData, dataSize))
    {
        // check if the type is read by a plugin
        for (int ii = 0; ii < numPluginReaders; ii++) {
            if (strcmp(objectType, pluginReaders[ii].type) == 0) {
                pluginReaders[ii].reader->Unserialize(index, serializedData, dataSize);
                return;
            }
        }
        quitprintf("Unserialise: unknown object type: '%s'", objectType);
    }
}