Changeset 87

Show
Ignore:
Timestamp:
06/16/10 00:31:21 (2 years ago)
Author:
Carsten
Message:

SceneGraph, LP64 bug fix:
Updated class cf::SceneGraph::BezierPatchNodeT to properly serialize its "unsigned long" members,
which are 4 bytes large with ILP32 and LLP64 data models and 8 bytes with the common LP64 data model.
Fixes #30.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Libs/SceneGraph/BezierPatchNode.cpp

    r36 r87  
    105105    BezierPatchNodeT* BP=new BezierPatchNodeT(LMM); 
    106106 
    107     InFile.read((char*)&BP->SizeX, sizeof(BP->SizeX)); 
    108     InFile.read((char*)&BP->SizeY, sizeof(BP->SizeY)); 
    109  
    110     InFile.read((char*)&BP->SubdivsHorz, sizeof(BP->SubdivsHorz)); 
    111     InFile.read((char*)&BP->SubdivsVert, sizeof(BP->SubdivsVert)); 
    112  // InFile.read((char*)&BP->MaxError,    sizeof(BP->MaxError   )); 
     107    BP->SizeX=aux::ReadUInt32(InFile); 
     108    BP->SizeY=aux::ReadUInt32(InFile); 
     109 
     110    BP->SubdivsHorz=aux::ReadInt32(InFile); 
     111    BP->SubdivsVert=aux::ReadInt32(InFile); 
     112 // BP->MaxError   =aux::ReadFloat(InFile); 
    113113    assert(BP->MaxError==400.0f); 
    114114 
    115     std::string MaterialName=Pool.ReadString(InFile); 
     115    const std::string MaterialName=Pool.ReadString(InFile); 
    116116    BP->Material=MaterialManager->GetMaterial(MaterialName); 
    117117 // BP->Material=MaterialManager->GetMaterial("wireframeTest"); 
     
    192192    aux::Write(OutFile, "BP"); 
    193193 
    194     OutFile.write((char*)&SizeX, sizeof(SizeX)); 
    195     OutFile.write((char*)&SizeY, sizeof(SizeY)); 
    196  
    197     OutFile.write((char*)&SubdivsHorz, sizeof(SubdivsHorz)); 
    198     OutFile.write((char*)&SubdivsVert, sizeof(SubdivsVert)); 
    199  // OutFile.write((char*)&MaxError,    sizeof(MaxError   )); 
     194    aux::Write(OutFile, aux::cnc32(SizeX)); 
     195    aux::Write(OutFile, aux::cnc32(SizeY)); 
     196 
     197    aux::Write(OutFile, SubdivsHorz); 
     198    aux::Write(OutFile, SubdivsVert); 
     199 // aux::Write(OutFile, MaxError); 
    200200    assert(MaxError==400.0f); 
    201201