| 389 | } |
| 390 | |
| 391 | void cSerializerImpl::ReadObject(iTypedSerializable* pObj) |
| 392 | { |
| 393 | cDebug d("cSerializerImpl::ReadObjectDynCreate"); |
| 394 | //d.TraceDetail("Entering... archive offset = %d\n", mpArchive->CurrentPos()); |
| 395 | |
| 396 | // NOTE -- type index stuff is gone; see the comment in WriteObject() |
| 397 | int32 /*typeIdx,*/ size; |
| 398 | // first, get the type... |
| 399 | /* |
| 400 | mpArchive->ReadInt32(typeIdx); |
| 401 | if((typeIdx < 0) || (typeIdx >= mTypeArray.size())) |
| 402 | { |
| 403 | // unknown type index! |
| 404 | d.TraceError("Encountered bad index into TypeArray: %d\n", typeIdx); |
| 405 | ThrowAndAssert(eSerializerInputStremTypeArray()); |
| 406 | } |
| 407 | const cType* pType = mTypeArray[typeIdx]; |
| 408 | */ |
| 409 | |
| 410 | // read in the version |
| 411 | int32 dummy, version; |
| 412 | mpArchive->ReadInt32(dummy); // old type array index |
| 413 | mpArchive->ReadInt32(version); |
| 414 | |
| 415 | // read in the size and the index... |
| 416 | mpArchive->ReadInt32(size); |
| 417 | |
| 418 | // use the size to assert that the file format is correct |
| 419 | if (size != (int)0xffffffff) |
| 420 | { |
| 421 | // unknown type index! |
| 422 | d.TraceError("Encountered bad size: %d\n", size); |
| 423 | ThrowAndAssert(eSerializerInputStremTypeArray(_T(""), mFileName, eSerializer::TY_FILE)); |
| 424 | } |
| 425 | |
| 426 | // remember current position |
| 427 | //int64 sizePos = mpArchive->CurrentPos(); |
| 428 | |
| 429 | // read in the object! |
| 430 | pObj->Read(this, version); |
| 431 | |
| 432 | // seek past this object in case filepos is not correct! |
| 433 | //mpArchive->Seek(sizePos + size, cBidirArchive::BEGINNING); |
| 434 | } |
| 435 | |
| 436 | |
| 437 | /////////////////////////////////////////////////////////////////////////////// |