Starting off I created a stdafx.h file and included allegro.h, I am getting alot of compile noise specifically C4312 *boggle*, so I disabled it while including the allegro libs.
To get around running fix and what not I added a define to set it as win32. Allegro people really shouln't add a key include that needs modified depending on lib, but rather require a define to spcify platform before including allegro.
My opening looks something like this.
Code: Select all
#pragma warning( disable : 4312 )
#define ALLEGRO_MSVC
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#include <allegro>
#pragma warning( default : 4312 )
First and formost thier are a number of code reduancies here as well as replications that could cut down on the amount of code used. I'll leave it in your hands for a rewrite but when you do please look at...
chunk size calculation via the lines...
Code: Select all
int chunks=node->hpifile.FileSize+0xFFFF>>16; // Nombre de morceaux composants le fichier
int chunk_size[chunks]; // Taille des différents morceaux
The second line really throws me for a loop, I really didn't know that any C++ compilers allowed for dynamic array allocation, I suggest modifing this to use malloc or new, which i'am assuming is what your compiler is doing anyhow.
Finally at the bottom of hpi.h you have a prototype of osmehting like...
Code: Select all
byte *load_file_zone(char *filename,int start,int size,int *size=NULL);
++Cire.