Game Development Reference
In-Depth Information
//and two byte integer if total exceeds 128
if (i<128){
byt = (BYTE)i;
ar.Write(&byt, sizeof(BYTE));
}else{
if (i>32767){
AfxMessageBox(“Scene limit exceeded please use less
than 32000 scenes”);
return;
}
byt2 = i & 0xFF;
sht = 0x80 | (i>>8);
ar.Write(&sht, sizeof(USHORT));
}
BYTE ver = VERSION, useloadscene = (BYTE)m_loading;
ar.Write(&ver, sizeof(BYTE));
ar.Write(&useloadscene, sizeof(BYTE));
ar.Write(&i, sizeof(int)*i);//Will be used to store scene Total
scn = sceneList.next;
i = 0;
while(scn){
ar.Flush();
scn->Publish(ar, pStatus);
ar.Flush();
pos=file.GetPosition();
file.Seek(10 + sizeof(int)*i, CFile::begin);
ar.Flush();
file.Write(&pos, sizeof(int));
file.Seek(pos, CFile::begin);
i++;
scn=scn->next;
}
file.Close();
if (m_html){
//Now write an html file
CString name;
str=GetPathName();
pos=str.Find('.');
if (pos==-1){
name=str;
Search Nedrilad ::




Custom Search