debug模式需要添加c++
....EngineInclude;%(AdditionalIncludeDirectories)
// PackSingle.cpp : Defines the entry point for the console application. // #include <windows.h> #include <stdio.h> #include <stdlib.h> #include <io.h> #include <direct.h> #include <sstream> //首先是处理SPR文件的代码 //SPR头文件的定义,为了实现可移植的目标 #include "ZPackFile.h" typedef struct { BYTE Comment[4]; // 注释文字(SPR ) WORD Width; // 图片宽度 WORD Height; // 图片高度 WORD CenterX; // 重心的水平位移 WORD CenterY; // 重心的垂直位移 WORD Frames; // 总帧数 WORD Colors; // 颜色数 WORD Directions; // 方向数 WORD Interval; // 每帧间隔(以游戏帧为单位) WORD Reserved[6];// 保留字段(到以后使用) } SPRHEAD; typedef struct { DWORD Offset; // 每一帧的偏移 DWORD Length; // 每一帧的长度 } SPROFFS; //重新定义 #define FRAME_SIZE 800 * 1024 //800K以上的SPR文件使用分帧的压缩 int root_length = 0; #define MAX_FILE 2004800 //最多20万个文件 index_info index_list[MAX_FILE]; char *temp_buffer[MAX_FILE * sizeof(index_info)]; int file_count; //当前文件的数量 unsigned long offset; //当前偏移量 #define COMPRESS_BUF_SIZE 10240000 char compress_buffer[COMPRESS_BUF_SIZE]; //10M的压缩缓冲区,存放所有的帧,一次写 #include <ucl/ucl.h> bool bCheck = false; #include <conio.h> //增加一个文件到数据文件中,返回偏移量 bool addFile(FILE *output, const char *file_name) { char full_name[MAX_PATH]; getcwd(full_name, MAX_PATH); strcat(full_name, "\"); strcat(full_name, file_name); char *ptr = full_name; while(*ptr) { if(*ptr >= 'A' && *ptr <= 'Z') *ptr += 'a' - 'A'; ptr++; } unsigned long id = hash(full_name + root_length);//0x12345678 char *to = (char*)malloc(strlen(full_name) - root_length - 13); strncpy(to, full_name + root_length+10, strlen(full_name)- root_length -14); to[strlen(full_name) - root_length - 14] = '