#include // cout #include // assert() #include // strstr() #include #include "../../../add_on/scriptbuilder/scriptbuilder.h" #include "../../../add_on/scripthelper/scripthelper.h" #include #include #include #include #if defined(_MSC_VER) && !defined(_WIN32_WCE) #include #include #endif #ifdef _WIN32_WCE #include // For GetModuleFileName #endif using namespace std; // Function prototypes int ConfigureEngine(asIScriptEngine *engine, const char *configFile); int CompileScript(asIScriptEngine *engine, const char *scriptFile); int SaveBytecode(asIScriptEngine *engine, const char *outputFile); static const char *GetCurrentDir(char *buf, size_t size); void MessageCallback(const asSMessageInfo *msg, void *param) { const char *type = "ERR "; if( msg->type == asMSGTYPE_WARNING ) type = "WARN"; else if( msg->type == asMSGTYPE_INFORMATION ) type = "INFO"; printf("%s (%d, %d) : %s : %s\n", msg->section, msg->row, msg->col, type, msg->message); } int main(int argc, char **argv) { #if defined(_MSC_VER) // Turn on memory leak detection (use _CrtSetBreakAlloc to break at specific allocation) _CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF); _CrtSetReportMode(_CRT_ASSERT,_CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_ASSERT,_CRTDBG_FILE_STDERR); //_CrtSetBreakAlloc(6150); #endif int r; if( argc < 4 ) { cout << "Usage: " << endl; cout << "asbuild