diff --git a/src/avp/win95/projload.cpp b/src/avp/win95/projload.cpp index 675bba7..2a3dd32 100644 --- a/src/avp/win95/projload.cpp +++ b/src/avp/win95/projload.cpp @@ -3128,34 +3128,34 @@ void LoadModuleData() GLOBALASSERT(env_rif); /* TODO: dir separator */ - HANDLE file = CreateFile ("avp_rifs/module.bbb", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + HANDLE file = AVPCreateFile ("avp_rifs/module.bbb", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); unsigned long byteswritten; - WriteFile(file,&Global_VDB_Ptr->VDB_World,sizeof(VECTORCH),&byteswritten,0); - WriteFile(file,&Global_VDB_Ptr->VDB_Mat,sizeof(MATRIXCH),&byteswritten,0); + AVPWriteFile(file,&Global_VDB_Ptr->VDB_World,sizeof(VECTORCH),&byteswritten,0); + AVPWriteFile(file,&Global_VDB_Ptr->VDB_Mat,sizeof(MATRIXCH),&byteswritten,0); - CloseHandle(file); + AVPCloseHandle(file); /* TODO: dir separator */ - file = CreateFile ("avp_rifs/module.aaa", GENERIC_READ, 0, 0, OPEN_EXISTING, + file = AVPCreateFile ("avp_rifs/module.aaa", GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); if(file==INVALID_HANDLE_VALUE) return; if(!env_rif->fc) { - CloseHandle(file); + AVPCloseHandle(file); NewOnScreenMessage("MODULE UPDATING REQUIRES -KEEPRIF OPTION."); return; } - int file_size=GetFileSize(file,0); + int file_size=AVPGetFileSize(file,0); GLOBALASSERT((file_size % 4)==0); int pos=0; unsigned long bytesread; { char name[60]; - ReadFile(file,name,60,&bytesread,0); + AVPReadFile(file,name,60,&bytesread,0); int i=0; char* name1=&name[0]; @@ -3180,8 +3180,8 @@ void LoadModuleData() if(_stricmp(name1,name2)) { - CloseHandle(file); - DeleteFile("avp_rifs\\module.aaa"); + AVPCloseHandle(file); + AVPDeleteFile("avp_rifs\\module.aaa"); return; } @@ -3192,7 +3192,7 @@ void LoadModuleData() while(posfc->get_object_by_index(obj_index); @@ -3201,7 +3201,7 @@ void LoadModuleData() MODULE* this_mod=&MainScene.sm_module[obj->program_object_index+2]; int numlinks; - ReadFile(file,&numlinks,4,&bytesread,0); + AVPReadFile(file,&numlinks,4,&bytesread,0); pos+=4; if(!numlinks) continue; @@ -3218,8 +3218,8 @@ void LoadModuleData() { int linked_index; int branch_no; - ReadFile(file,&linked_index,4,&bytesread,0); - ReadFile(file,&branch_no,4,&bytesread,0); + AVPReadFile(file,&linked_index,4,&bytesread,0); + AVPReadFile(file,&branch_no,4,&bytesread,0); pos+=8; Object_Chunk* linked_module=env_rif->fc->get_object_by_index(linked_index); @@ -3279,8 +3279,8 @@ void LoadModuleData() *((int *)this_mod->m_vmptr[vmod_no].vmod_name) = vmac_no; } - CloseHandle(file); - DeleteFile("avp_rifs\\module.aaa"); + AVPCloseHandle(file); + AVPDeleteFile("avp_rifs\\module.aaa"); } #endif @@ -3354,7 +3354,7 @@ static BOOL WarnedAboutDiskSpace=FALSE; static void MakeBackupFile(File_Chunk* fc) { unsigned long spc,bps,numclust,total; - if(GetDiskFreeSpace(0,&spc,&bps,&numclust,&total)) + if(AVPGetDiskFreeSpace(0,&spc,&bps,&numclust,&total)) { unsigned int freespace=spc*bps*numclust; if(freespace<40000000) @@ -3370,7 +3370,7 @@ static void MakeBackupFile(File_Chunk* fc) } WarnedAboutDiskSpace=FALSE; - CreateDirectory("avp_rifs\\Backup",0); + AVPCreateDirectory("avp_rifs\\Backup",0); int length=strlen(fc->filename); int pos=length; while(pos>=0 && fc->filename[pos]!='\\')pos--; @@ -3386,16 +3386,16 @@ static void MakeBackupFile(File_Chunk* fc) strncpy(&Name1[length],"B0.rif",7); strncpy(&Name2[length],"B1.rif",7); - DeleteFile(Name1); + AVPDeleteFile(Name1); for (int i=0;i<9;i++) { Name1[length+1]=i+'0'; Name2[length+1]=i+'1'; - MoveFile(Name2,Name1); + AVPMoveFile(Name2,Name1); } Name2[length+1]='9'; - CopyFile(fc->filename,Name2,FALSE); + AVPCopyFile(fc->filename,Name2,FALSE); delete [] Name1; delete [] Name2; @@ -3416,7 +3416,7 @@ void save_preplaced_decals() { - DWORD attributes = GetFileAttributes(env_rif->fc->filename); + DWORD attributes = AVPGetFileAttributes(env_rif->fc->filename); if (0xffffffff!=attributes) { if (attributes & FILE_ATTRIBUTE_READONLY) diff --git a/src/avp/win95/strachnk.cpp b/src/avp/win95/strachnk.cpp index 2ecde1d..b69656a 100644 --- a/src/avp/win95/strachnk.cpp +++ b/src/avp/win95/strachnk.cpp @@ -157,7 +157,7 @@ BOOL AVP_Strategy_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -252,7 +252,7 @@ BOOL AVP_External_Strategy_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/files.c b/src/files.c index 1e091d2..08c0b22 100644 --- a/src/files.c +++ b/src/files.c @@ -739,7 +739,7 @@ void InitGameDirectories(char *argv0) gamedir = I_GetUserDir(); #endif -#if define __linux__ +#if defined __linux__ gamedir = "/usr/local/games/AliensVsPredator/"; #endif diff --git a/src/win95/animchnk.cpp b/src/win95/animchnk.cpp index adaecaa..a321cff 100644 --- a/src/win95/animchnk.cpp +++ b/src/win95/animchnk.cpp @@ -109,7 +109,7 @@ BOOL Animation_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/chunk.cpp b/src/win95/chunk.cpp index cab7ff3..18a4356 100644 --- a/src/win95/chunk.cpp +++ b/src/win95/chunk.cpp @@ -28,29 +28,29 @@ void list_chunks_in_file(List * pList, HANDLE hand, char const * chunk_id) // assuming we start at the front of a parent chunk, // containing the child chunk specified - int init_file_pos = SetFilePointer (hand,0,0,FILE_CURRENT); + int init_file_pos = AVPSetFilePointer (hand,0,0,FILE_CURRENT); int file_pos; - int file_length = GetFileSize(hand, 0); + int file_length = AVPGetFileSize(hand, 0); - SetFilePointer (hand,8,0,FILE_CURRENT); + AVPSetFilePointer (hand,8,0,FILE_CURRENT); int chunk_length; int sub_chunk_ln; - ReadFile (hand, (long *) &chunk_length, 4, &bytes_read, 0); + AVPReadFile (hand, (long *) &chunk_length, 4, &bytes_read, 0); if ((init_file_pos + chunk_length) > file_length) return; - while ((file_pos = SetFilePointer (hand,0,0,FILE_CURRENT)) + while ((file_pos = AVPSetFilePointer (hand,0,0,FILE_CURRENT)) < (init_file_pos + chunk_length) && ok) { - ok = ReadFile (hand, (long *) buffer, 8, &bytes_read, 0); + ok = AVPReadFile (hand, (long *) buffer, 8, &bytes_read, 0); if (strncmp(buffer, chunk_id, 8) == 0) pList->add_entry(file_pos); - ok = ReadFile (hand, (long *) &sub_chunk_ln, 4, &bytes_read, 0); + ok = AVPReadFile (hand, (long *) &sub_chunk_ln, 4, &bytes_read, 0); - SetFilePointer (hand,sub_chunk_ln-12,0,FILE_CURRENT); + AVPSetFilePointer (hand,sub_chunk_ln-12,0,FILE_CURRENT); } } @@ -121,7 +121,7 @@ BOOL Chunk::output_chunk (HANDLE & hand) if (data_block) { - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; if (!ok) return FALSE; @@ -279,11 +279,11 @@ BOOL Chunk_With_Children::output_chunk (HANDLE &hand) Chunk * child_ptr = children; BOOL ok; - ok = WriteFile (hand, (long *) identifier, 8, &junk, 0); + ok = AVPWriteFile (hand, (long *) identifier, 8, &junk, 0); if (!ok) return FALSE; - ok = WriteFile (hand, (long *) &chunk_size, 4, &junk, 0); + ok = AVPWriteFile (hand, (long *) &chunk_size, 4, &junk, 0); if (!ok) return FALSE; diff --git a/src/win95/enumchnk.cpp b/src/win95/enumchnk.cpp index c030e4a..a6b9400 100644 --- a/src/win95/enumchnk.cpp +++ b/src/win95/enumchnk.cpp @@ -95,7 +95,7 @@ BOOL Enum_Header_Chunk::output_chunk (HANDLE & hand) data_block = make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/envchunk.cpp b/src/win95/envchunk.cpp index 04cc292..e0e8b8b 100644 --- a/src/win95/envchunk.cpp +++ b/src/win95/envchunk.cpp @@ -116,7 +116,7 @@ BOOL Environment_Data_Header_Chunk::output_chunk (HANDLE & hand) data_block = make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/gsprchnk.cpp b/src/win95/gsprchnk.cpp index f89987d..05b55d0 100644 --- a/src/win95/gsprchnk.cpp +++ b/src/win95/gsprchnk.cpp @@ -94,7 +94,7 @@ BOOL AllSprites_Header_Chunk::output_chunk (HANDLE & hand) data_block = make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/mishchnk.cpp b/src/win95/mishchnk.cpp index c5af0aa..92fd2b7 100644 --- a/src/win95/mishchnk.cpp +++ b/src/win95/mishchnk.cpp @@ -204,7 +204,7 @@ BOOL Lockable_Chunk_With_Children::update_chunk_in_file(HANDLE &rif_file) if (!hd_id) return FALSE; - SetFilePointer (rif_file,0,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,0,0,FILE_BEGIN); //twprintf("\nLooking for chunks in file\n"); @@ -220,11 +220,11 @@ BOOL Lockable_Chunk_With_Children::update_chunk_in_file(HANDLE &rif_file) if (shpfptrs.size()) { for (; !sfpl.done(); sfpl.next()) { - SetFilePointer (rif_file, sfpl()+8,0,FILE_BEGIN); + AVPSetFilePointer (rif_file, sfpl()+8,0,FILE_BEGIN); - ReadFile (rif_file, (long *) &(length), 4, &bytes_read, 0); + AVPReadFile (rif_file, (long *) &(length), 4, &bytes_read, 0); - SetFilePointer (rif_file, sfpl(),0,FILE_BEGIN); + AVPSetFilePointer (rif_file, sfpl(),0,FILE_BEGIN); if (file_equals(rif_file)) break; } } @@ -238,18 +238,18 @@ BOOL Lockable_Chunk_With_Children::update_chunk_in_file(HANDLE &rif_file) if (!sfpl.done()) { - int file_length = GetFileSize(rif_file,0); + int file_length = AVPGetFileSize(rif_file,0); if (file_length > (sfpl() + length)) { - SetFilePointer (rif_file, sfpl() + length,0,FILE_BEGIN); + AVPSetFilePointer (rif_file, sfpl() + length,0,FILE_BEGIN); char * tempbuffer; tempbuffer = new char [file_length - (sfpl() + length)]; - ReadFile (rif_file, (long *) tempbuffer, (file_length - (sfpl() + length)), &bytes_read, 0); + AVPReadFile (rif_file, (long *) tempbuffer, (file_length - (sfpl() + length)), &bytes_read, 0); - SetFilePointer (rif_file, sfpl() ,0,FILE_BEGIN); + AVPSetFilePointer (rif_file, sfpl() ,0,FILE_BEGIN); if (!deleted) { @@ -257,43 +257,43 @@ BOOL Lockable_Chunk_With_Children::update_chunk_in_file(HANDLE &rif_file) output_chunk(rif_file); } - WriteFile (rif_file, (long *) tempbuffer, (file_length - (sfpl() + length)), &bytes_read, 0); + AVPWriteFile (rif_file, (long *) tempbuffer, (file_length - (sfpl() + length)), &bytes_read, 0); delete [] tempbuffer; - SetEndOfFile (rif_file); + AVPSetEndOfFile (rif_file); } else{ - SetFilePointer (rif_file, sfpl() ,0,FILE_BEGIN); + AVPSetFilePointer (rif_file, sfpl() ,0,FILE_BEGIN); if (!deleted) { size_chunk(); output_chunk(rif_file); } - SetEndOfFile (rif_file); + AVPSetEndOfFile (rif_file); } } else { - SetFilePointer (rif_file,0 ,0,FILE_END); + AVPSetFilePointer (rif_file,0 ,0,FILE_END); if (!deleted) { size_chunk(); output_chunk(rif_file); } - SetEndOfFile (rif_file); + AVPSetEndOfFile (rif_file); } local_lock = FALSE; updated = FALSE; - int file_length = GetFileSize(rif_file,0); - SetFilePointer (rif_file,8,0,FILE_BEGIN); + int file_length = AVPGetFileSize(rif_file,0); + AVPSetFilePointer (rif_file,8,0,FILE_BEGIN); - WriteFile (rif_file, (long *) &file_length, 4, &bytes_read, 0); + AVPWriteFile (rif_file, (long *) &file_length, 4, &bytes_read, 0); // DO NOT PUT ANY CODE AFTER THIS @@ -498,7 +498,7 @@ BOOL File_Chunk::write_file (const char * fname) { if(!fname) return FALSE; //if a read_only file exists with this filename , then abort attempt to save - DWORD attributes = GetFileAttributesA(fname); + DWORD attributes = AVPGetFileAttributesA(fname); if (0xffffffff!=attributes) { if (attributes & FILE_ATTRIBUTE_READONLY) @@ -553,7 +553,7 @@ BOOL File_Chunk::write_file (const char * fname) if(!outPackage) return FALSE; //and now try to write the file - rif_file = CreateFileA (temp_name, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + rif_file = AVPCreateFileA (temp_name, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); if (rif_file == INVALID_HANDLE_VALUE) { @@ -565,9 +565,9 @@ BOOL File_Chunk::write_file (const char * fname) unsigned long junk; BOOL ok; - ok = WriteFile (rif_file, (long *) outPackage,outPackage->CompressedDataSize+sizeof(HuffmanPackage), &junk, 0); + ok = AVPWriteFile (rif_file, (long *) outPackage,outPackage->CompressedDataSize+sizeof(HuffmanPackage), &junk, 0); - CloseHandle (rif_file); + AVPCloseHandle (rif_file); free (outPackage); @@ -596,8 +596,8 @@ BOOL File_Chunk::write_file (const char * fname) #endif //Delete the old file with this name (if it exists) , and rename the temprary file - DeleteFileA(fname); - MoveFileA(temp_name,fname); + AVPDeleteFileA(fname); + AVPMoveFileA(temp_name,fname); delete [] temp_name; @@ -1257,7 +1257,7 @@ BOOL File_Chunk::update_chunks_from_file() HANDLE rif_file; unsigned long bytes_read; - rif_file = CreateFileA (filename, GENERIC_WRITE + GENERIC_READ, 0, 0, OPEN_EXISTING, + rif_file = AVPCreateFileA (filename, GENERIC_WRITE + GENERIC_READ, 0, 0, OPEN_EXISTING, FILE_FLAG_RANDOM_ACCESS, 0); if (rif_file == INVALID_HANDLE_VALUE) { @@ -1265,24 +1265,24 @@ BOOL File_Chunk::update_chunks_from_file() return FALSE; } - SetFilePointer (rif_file,0,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,0,0,FILE_BEGIN); List verinf; list_chunks_in_file(& verinf, rif_file, "RIFVERIN"); if (verinf.size()) { int f_version_num; - SetFilePointer (rif_file,verinf.first_entry() + 12,0,FILE_BEGIN); - ReadFile (rif_file, (long *) &f_version_num, 4, &bytes_read, 0); + AVPSetFilePointer (rif_file,verinf.first_entry() + 12,0,FILE_BEGIN); + AVPReadFile (rif_file, (long *) &f_version_num, 4, &bytes_read, 0); - SetFilePointer (rif_file,verinf.first_entry() + 12,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,verinf.first_entry() + 12,0,FILE_BEGIN); List lverinf; lookup_child ("RIFVERIN",lverinf); if (lverinf.size()) if (f_version_num == ((RIF_Version_Num_Chunk *)(lverinf.first_entry()))->file_version_no){ - CloseHandle (rif_file); + AVPCloseHandle (rif_file); return TRUE; } @@ -1301,7 +1301,7 @@ BOOL File_Chunk::update_chunks_from_file() if (tmpobptr->updated_outside) { // find the chunk, then input it to a buffer and create a new object // from the buffer - SetFilePointer (rif_file,0,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,0,0,FILE_BEGIN); List obfptrs; list_chunks_in_file(& obfptrs, rif_file, "RBOBJECT"); @@ -1312,16 +1312,16 @@ BOOL File_Chunk::update_chunks_from_file() if (obfptrs.size()) { for (; !ofpl.done(); ofpl.next()) { - SetFilePointer (rif_file, ofpl(),0,FILE_BEGIN); + AVPSetFilePointer (rif_file, ofpl(),0,FILE_BEGIN); // get header list List obhead; list_chunks_in_file(& obhead, rif_file, "OBJHEAD1"); assert (obhead.size() == 1); // get object identifier - SetFilePointer(rif_file,obhead.first_entry() + 96,0,FILE_BEGIN); + AVPSetFilePointer(rif_file,obhead.first_entry() + 96,0,FILE_BEGIN); int i = 0; - do ReadFile (rif_file, (long *) (name + i), 1, &bytes_read, 0); + do AVPReadFile (rif_file, (long *) (name + i), 1, &bytes_read, 0); while (name[i++] != 0); if (!strcmp(name, tmpobptr->object_data.o_name)) break; @@ -1332,11 +1332,11 @@ BOOL File_Chunk::update_chunks_from_file() char * buffer; - SetFilePointer (rif_file,ofpl()+8,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,ofpl()+8,0,FILE_BEGIN); int length; - ReadFile(rif_file, (long *) &length, 4, &bytes_read, 0); + AVPReadFile(rif_file, (long *) &length, 4, &bytes_read, 0); buffer = new char [length]; - ReadFile(rif_file, (long *) buffer, length-12, &bytes_read, 0); + AVPReadFile(rif_file, (long *) buffer, length-12, &bytes_read, 0); new Object_Chunk (this, buffer, length-12); delete [] buffer; if (tmpobptr->get_header()) @@ -1368,7 +1368,7 @@ BOOL File_Chunk::update_chunks_from_file() if (tmpshpptr->updated_outside) { // find the chunk, then input it to a buffer and create a new object // from the buffer - SetFilePointer (rif_file,0,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,0,0,FILE_BEGIN); List shfptrs; list_chunks_in_file(& shfptrs, rif_file, "REBSHAPE"); @@ -1377,16 +1377,16 @@ BOOL File_Chunk::update_chunks_from_file() if (shfptrs.size()) { for (sfpl.restart(); !sfpl.done(); sfpl.next()) { - SetFilePointer (rif_file, sfpl(),0,FILE_BEGIN); + AVPSetFilePointer (rif_file, sfpl(),0,FILE_BEGIN); // get header list List shphead; list_chunks_in_file(& shphead, rif_file, "SHPHEAD1"); assert (shphead.size() == 1); // get object identifier - SetFilePointer(rif_file,shphead.first_entry() + 32,0,FILE_BEGIN); + AVPSetFilePointer(rif_file,shphead.first_entry() + 32,0,FILE_BEGIN); int sh_number; - ReadFile (rif_file, (long *) &sh_number, 4, &bytes_read, 0); + AVPReadFile (rif_file, (long *) &sh_number, 4, &bytes_read, 0); if (sh_number == shhead->file_id_num) break; } @@ -1396,11 +1396,11 @@ BOOL File_Chunk::update_chunks_from_file() char * buffer; - SetFilePointer (rif_file,sfpl()+8,0,FILE_BEGIN); + AVPSetFilePointer (rif_file,sfpl()+8,0,FILE_BEGIN); int length; - ReadFile(rif_file, (long *) &length, 4, &bytes_read, 0); + AVPReadFile(rif_file, (long *) &length, 4, &bytes_read, 0); buffer = new char [length]; - ReadFile(rif_file, (long *) buffer, length-12, &bytes_read, 0); + AVPReadFile(rif_file, (long *) buffer, length-12, &bytes_read, 0); new Shape_Chunk (this, buffer, length-12); delete [] buffer; // Associate with the new objects @@ -1418,7 +1418,7 @@ BOOL File_Chunk::update_chunks_from_file() post_input_processing(); - CloseHandle(rif_file); + AVPCloseHandle(rif_file); return TRUE; diff --git a/src/win95/obchunk.cpp b/src/win95/obchunk.cpp index 2222370..287936d 100644 --- a/src/win95/obchunk.cpp +++ b/src/win95/obchunk.cpp @@ -156,9 +156,9 @@ BOOL Object_Chunk::file_equals(HANDLE &rif_file) if (obhead.size() != 1) return FALSE; // get object identifier - SetFilePointer(rif_file,obhead.first_entry() + 96,0,FILE_BEGIN); + AVPSetFilePointer(rif_file,obhead.first_entry() + 96,0,FILE_BEGIN); int i = 0; - do ReadFile (rif_file, (long *) (name + i), 1, &bytes_read, 0); + do AVPReadFile (rif_file, (long *) (name + i), 1, &bytes_read, 0); while (name[i++] != 0); if (!strcmp(name, object_data.o_name) ) return (TRUE); @@ -490,7 +490,7 @@ BOOL Object_Header_Chunk::output_chunk (HANDLE & hand) data_block = make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -617,7 +617,7 @@ BOOL Object_Notes_Chunk::output_chunk (HANDLE &hand) data_block = make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/oechunk.cpp b/src/win95/oechunk.cpp index f82c76a..92a4368 100644 --- a/src/win95/oechunk.cpp +++ b/src/win95/oechunk.cpp @@ -131,7 +131,7 @@ BOOL Map_Block_Chunk::output_chunk(HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -148,7 +148,7 @@ BOOL Strategy_Chunk::output_chunk(HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/shpchunk.cpp b/src/win95/shpchunk.cpp index ec587b0..8a46c59 100644 --- a/src/win95/shpchunk.cpp +++ b/src/win95/shpchunk.cpp @@ -341,8 +341,8 @@ BOOL Shape_Chunk::file_equals(HANDLE &rif_file) if (obhead.size() != 1) return FALSE; // get object identifier - SetFilePointer(rif_file,obhead.first_entry() + 32,0,FILE_BEGIN); - ReadFile (rif_file, (long *) &(id), 4, &bytes_read, 0); + AVPSetFilePointer(rif_file,obhead.first_entry() + 32,0,FILE_BEGIN); + AVPReadFile (rif_file, (long *) &(id), 4, &bytes_read, 0); if (hdptr->file_id_num == id) return TRUE; @@ -615,7 +615,7 @@ BOOL Shape_Vertex_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -695,7 +695,7 @@ BOOL Shape_Vertex_Normal_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -792,7 +792,7 @@ BOOL Shape_Polygon_Normal_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -929,7 +929,7 @@ BOOL Shape_Polygon_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -1125,7 +1125,7 @@ BOOL Shape_UV_Coord_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -1233,7 +1233,7 @@ BOOL Shape_Texture_Filenames_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -1374,7 +1374,7 @@ BOOL Shape_Header_Chunk::output_chunk(HANDLE & hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; diff --git a/src/win95/sprchunk.cpp b/src/win95/sprchunk.cpp index 83a8aac..b87e33f 100644 --- a/src/win95/sprchunk.cpp +++ b/src/win95/sprchunk.cpp @@ -89,7 +89,7 @@ BOOL Sprite_Action_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -257,7 +257,7 @@ int Sprite_Header_Chunk::write_file(const char* fname) { HANDLE rif_file; - rif_file = CreateFileA (fname, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, + rif_file = AVPCreateFileA (fname, GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_FLAG_RANDOM_ACCESS, 0); if (rif_file == INVALID_HANDLE_VALUE) { @@ -269,7 +269,7 @@ int Sprite_Header_Chunk::write_file(const char* fname) if (!(this->output_chunk(rif_file))) return CHUNK_FAILED_ON_WRITE; - CloseHandle (rif_file); + AVPCloseHandle (rif_file); return 0; } @@ -282,7 +282,7 @@ BOOL Sprite_Header_Chunk::output_chunk(HANDLE & hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -412,7 +412,7 @@ BOOL Sprite_Size_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block; @@ -472,7 +472,7 @@ BOOL Sprite_Version_Number_Chunk::output_chunk (HANDLE &hand) data_block = this->make_data_block_from_chunk(); - ok = WriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); + ok = AVPWriteFile (hand, (long *) data_block, (unsigned long) chunk_size, &junk, 0); delete [] data_block;