diff --git a/.gitignore b/.gitignore index 2497801bf..ee91d7899 100644 --- a/.gitignore +++ b/.gitignore @@ -34,7 +34,7 @@ Tools *.a viewer mc2 -text_tool +text_tool/text_tool .ycm_extra_conf.py .ycm_extra_conf.pyc *.ico @@ -48,6 +48,7 @@ tmp/ dump/ test_code/ test_sound/ +cmake/sdl2 # Source repository should not track built resources *.fst diff --git a/CMakeLists.txt b/CMakeLists.txt index 981ce7518..0c5024731 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,11 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required (VERSION 3.14) # select GLVND versus legacy OpenGL libraries cmake_policy(SET CMP0072 NEW) # cmake --help-policy CMP0072 project(mc2) include(CMakeToolsHelpers OPTIONAL) +# Load the URLs for the SDL2 cmake modules and the MC2 data repo +include(MC2Repos REQUIRED) # Set a default build type for single-configuration # CMake generators if no build type is set. @@ -51,6 +53,37 @@ endif() add_definitions(-DUSE_ASSEMBLER_CODE=0) add_definitions(-DLINUX_BUILD) +find_package(Git REQUIRED) + +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2") + message(STATUS "Found cmake SDL package dir") +else() + # The SDL2 cmake package directory is missing, so clone it from a repo + message(STATUS "Cloning from ${SDL2_CMAKE_MODULE_REPO}") + execute_process(COMMAND ${GIT_EXECUTABLE} clone ${SDL2_CMAKE_MODULE_REPO} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2 + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_CLONE_RESULT ) + if(NOT GIT_CLONE_RESULT EQUAL "0") + message(FATAL_ERROR "git clone of repo failed with ${GIT_CLONE_RESULT}, please clone manually") + endif() +endif() + +# Check for MC2 data dir next to the MC2 dir. If not there, clone it from a repo +get_filename_component(MC2_DATA_PATH "../mc2srcdata" ABSOLUTE) +if(EXISTS "${MC2_DATA_PATH}") + message(STATUS "Found MC2 data dir") +else() + # The MechCommander 2 data directory is missing so clone from a repo + message(STATUS "Cloning from ${MC2_DATA_REPO}") + execute_process(COMMAND ${GIT_EXECUTABLE} clone ${MC2_DATA_REPO} ${MC2_DATA_PATH} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.. + RESULT_VARIABLE GIT_CLONE_RESULT ) + if(NOT GIT_CLONE_RESULT EQUAL "0") + message(FATAL_ERROR "git clone of MC2 data repo failed with ${GIT_CLONE_RESULT}, please clone manually") + endif() +endif() + + find_package(SDL2 REQUIRED) find_package(SDL2_mixer REQUIRED) #required by text_tool @@ -74,6 +107,16 @@ get_filename_component(COM_PATH2 "./GameOS/gameos" ABSOLUTE) set(COMMON_INCLUDE_DIRS ${COM_PATH1} ${COM_PATH2}) +include_directories(${COMMON_INCLUDE_DIRS} "./mclib" "./gui" "./code" "./netlib") + +# Build the MC2 resource shared object and after the build completes, copy to the build dir +add_subdirectory("./res" "./out/res") + +# Build the data and text tools for converting the MC2 data and after the build completes, copy to the data dir +add_subdirectory("./data_tools" "./out/data_tools") +add_subdirectory("./text_tool" "./out/text_tool") + + add_subdirectory("./mclib/" "./out/mclib") add_subdirectory("./mclib/mlr" "./out/mclib/mlr") add_subdirectory("./mclib/gosfx" "./out/mclib/gosfx") @@ -176,7 +219,6 @@ set(SOURCES ) -include_directories(${COMMON_INCLUDE_DIRS} "./mclib" "./gui" "./code" "./netlib") if(NOT WIN32) set(ADDITIONAL_LIBS dl) @@ -188,9 +230,13 @@ endif() add_executable(mc2 ${SOURCES} ${MAIN_SRC}) -target_link_libraries(mc2 mclib gosfx mlr stuff gui gameos gameos_main windows ZLIB::ZLIB SDL2::Main GLEW::GLEW SDL2::Mixer ${ADDITIONAL_LIBS} OpenGL::GL) +target_link_libraries(mc2 mc2res mclib gosfx mlr stuff gui gameos gameos_main windows ZLIB::ZLIB SDL2::Main GLEW::GLEW SDL2::Mixer ${ADDITIONAL_LIBS} OpenGL::GL) -add_subdirectory("./res" "./out/res") -add_subdirectory("./data_tools" "./out/data_tools") -add_subdirectory("./text_tool" "./out/text_tool") add_subdirectory("./Viewer" "./out/Viewer") + +add_custom_command( + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_CURRENT_SOURCE_DIR}/shaders + ${CMAKE_CURRENT_BINARY_DIR}/shaders ) + diff --git a/MC2Repos b/MC2Repos new file mode 100644 index 000000000..80c68fcf1 --- /dev/null +++ b/MC2Repos @@ -0,0 +1,2 @@ +set(SDL2_CMAKE_MODULE_REPO "https://gitlab.com/aminosbh/sdl2-cmake-modules.git") +set(MC2_DATA_REPO "https://github.com/igough/mc2srcdata.git") diff --git a/README.md b/README.md index 33cf1f41f..8a178fe14 100644 --- a/README.md +++ b/README.md @@ -150,5 +150,50 @@ Once everything in place, you can launch build scripts as described in correspon Building on Linux ================= -You, probably already know hot to do it. If not, please, see windows building section, the process is quite similar. +Dependencies +------------ +Apt based distros: +``` +sudo apt install libsdl2-dev, libsdl2-mixer-dev, libsdl2-ttf-dev, libsdl2-mixer-dev, zlib1g-dev, libglew-dev +``` + +Build steps +----------- +The build process has been reworked to reduce the number of steps and chance of failure. It handles building and moving data and resources into the correct locations at the right time and cloning repositories as required. The game is build in the ```mc2/build64``` directory. + +You only need to clone the mc2 directory and the build process will clone the data directory and SDL2 cmake modules for you the first time you run the build process. The mc2 and mc2srcdata projects will be cloned side by side and the build process relies on this. The top level directory structure will look like : + +``` +some-empty-directory +| ++---mc2 +\---mc2srcdata +``` + +From an empty directory issue the following commands. + +``` +git clone https://github.com/alariq/mc2.git +cd mc2 +``` +Edit MC2Repos to make sure the git repositories are set to which git repository you want to clone them from. Whoever user's mc2 project that you cloned, set the value for the ```MC2_DATA_REPO``` to be that same user. eg. If you cloned **alariq**'s mc2 from ```https://github.com/alariq/mc2```, then set MC2_DATA_REPO to ```https://github.com/alariq/mc2srcdata```. + +``` +mkdir build64 +cd build64 +cmake -DCMAKE_LIBRARY_ARCHITECTURE=x64 .. +make all + +cd ../../mc2srcdata/build_scripts +make all BUILD_PLATFORM=linux +./copy_assets.sh + +``` + +Running on Linux +---------------- +``` +cd ../../mc2/build64 +./mc2 +``` \ No newline at end of file diff --git a/cmake/sdl2/Copyright.txt b/cmake/Copyright.txt similarity index 100% rename from cmake/sdl2/Copyright.txt rename to cmake/Copyright.txt diff --git a/cmake/sdl2/README.md b/cmake/README.md similarity index 100% rename from cmake/sdl2/README.md rename to cmake/README.md diff --git a/code/infowindow.cpp b/code/infowindow.cpp index f6f6691c9..5ba31ef78 100644 --- a/code/infowindow.cpp +++ b/code/infowindow.cpp @@ -283,7 +283,7 @@ void InfoWindow::init( FitIniFile& file ) char SkillText[32]; for (int i = 0; i < 7; i++ ) { - sprintf( SkillText, "Skill%ld", i ); + sprintf( SkillText, "Skill%d", i ); skillInfos[i].init( file, SkillText ,ControlGui::hiResOffsetX, ControlGui::hiResOffsetY); } @@ -623,8 +623,8 @@ void InfoWindow::drawScrollingStuff() char disabledCount[60][2]; long ammo[60]; - char ranges[60]; - char names[60];// sebi: changed long to char + byte ranges[60]; + byte names[60];// igough: changed char to unsigned 8 bit since the value can be over 127, which causes a negative index memset( disabledCount, 0, sizeof( char ) * 60 * 2); // sebi: ORIG BUG FIX memory owerwrite fix fow win64 build: sizeof(long) < sizeof(char*)! @@ -643,7 +643,7 @@ void InfoWindow::drawScrollingStuff() for (long curWeapon = pUnit->numOther; curWeapon < (pUnit->numOther + pUnit->numWeapons); curWeapon++) { - char nName = pUnit->inventory[curWeapon].masterID; + byte nName = pUnit->inventory[curWeapon].masterID; bool bFound = 0; for ( int j = 0; j < i; j++ ) { @@ -760,7 +760,7 @@ void InfoWindow::drawScrollingStuff() //memset( names, 0, sizeof( char* ) * 60 ); MemSet(names, 0); - char count[4]; + byte count[4]; count[0] = pUnit->ecm; count[1] = pUnit->probe; count[2] = pUnit->jumpJets; @@ -995,7 +995,7 @@ void InfoWindow::drawSkillBar( int skill, float yVal, float height ) } char buffer[32]; - sprintf( buffer, "%ld", skill ); + sprintf( buffer, "%d", skill ); componentFont.render( buffer, SKILLRIGHT+2, yVal, SCROLLLEFT - SKILLRIGHT - 2, SKILLHEIGHT, 0xff005392, 0, 0 ); } diff --git a/code/mechcmd2.cpp b/code/mechcmd2.cpp index 21097a2ea..11ecc9b62 100644 --- a/code/mechcmd2.cpp +++ b/code/mechcmd2.cpp @@ -2655,7 +2655,11 @@ void __stdcall GetGameOSEnvironment(const char* CommandLine ) Environment.allowMultipleApps = false; Environment.dontClearRegistry = true; - Environment.checkCDForFiles = true; + // New code was added to handle JPG versions of the burning files. Unfortunately, these JPG files are NOT included in the textures directory. + // if checkCDForFiles is set to true, then an attempt to load the burning textures from JPGs will continually retry and + // ask to insert the CD. If set to false, when the .JPG is not found, the load will fail and fallback to loading the .TGA + // versions which are included in textures.fst + Environment.checkCDForFiles = false; if (useSound) { diff --git a/data_tools/CMakeLists.txt b/data_tools/CMakeLists.txt index ec4d76024..8e423d966 100644 --- a/data_tools/CMakeLists.txt +++ b/data_tools/CMakeLists.txt @@ -1,3 +1,6 @@ +cmake_minimum_required (VERSION 3.14) +project(data_tools) + set(MAKEFST_SOURCES "makefst.cpp") set(PAK_SOURCES "pak.cpp" "common.hpp") set(ASECONV_SOURCES "aseconv.cpp" "common.hpp") @@ -17,3 +20,28 @@ target_link_libraries(aseconv mclib gosfx mlr stuff gameos windows ZLIB::ZLIB SD add_executable(makersp ${MAKERSP_SOURCES}) target_link_libraries(makersp mclib stuff gameos windows ZLIB::ZLIB SDL2::Main ${ADDITIONAL_LIBS}) +add_custom_command( + TARGET makefst POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/makefst + ${MC2_DATA_PATH}/build_scripts/) + +add_custom_command( + TARGET pak POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/pak + ${MC2_DATA_PATH}/build_scripts/) + +add_custom_command( + TARGET aseconv POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/aseconv + ${MC2_DATA_PATH}/build_scripts/) + +add_custom_command( + TARGET makersp POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/makersp + ${MC2_DATA_PATH}/build_scripts/) + + diff --git a/data_tools/makefst.cpp b/data_tools/makefst.cpp index 7f2b20814..814947d39 100644 --- a/data_tools/makefst.cpp +++ b/data_tools/makefst.cpp @@ -29,7 +29,7 @@ int unpack(const char* fst_file, const char* out_path) long result = ff->open(fst_file); if (0 != result) { if(result == FASTFILE_VERSION) { - SPEW(("DBG", "Wrong fast file version\n")); + fprintf(stderr, "Wrong fast file version\n"); } PAUSE(("Error opening fast file\n")); delete ff; @@ -68,7 +68,7 @@ int unpack(const char* fst_file, const char* out_path) long fHandle = ff->openFast(hash, fname); if(fHandle==-1) { - SPEW(("DUMP", "Failed to find file: %s in fast file\n", fname)); + fprintf( stderr, "DUMP: Failed to find file: %s in fast file\n", fname); continue; } @@ -97,7 +97,7 @@ int unpack(const char* fst_file, const char* out_path) { DWORD err = GetLastError(); if (err == ERROR_ALREADY_EXISTS) { - SPEW(("DBG", "Failed to create directory %s, error code: %d - directory already exists\n", tmp, err)); + fprintf( stderr, "DBG: Failed to create directory %s, error code: %d - directory already exists\n", tmp, err); } else { PAUSE(("Failed to create directory %s, error code: %d\n", tmp, err)); } @@ -136,7 +136,7 @@ int pack(const char* in_path, const char* fst_file, const char* mount, const cha FastFile out_ff; if(NO_ERR != out_ff.create(fst_file, b_compress)) { - SPEW(("pack: ", "Failed to create fast file %s\n", fst_file)); + fprintf( stderr, "pack: Failed to create fast file %s\n", fst_file); return -1; } @@ -145,13 +145,11 @@ int pack(const char* in_path, const char* fst_file, const char* mount, const cha std::queue dirs2process; std::queue files2pack; - size_t num_files2pack = 0; const char* prefix = in_path; if(!rsp_file) { - char* findString = new char[1]; strcpy(findString, ""); dirs2process.push(findString); @@ -161,7 +159,7 @@ int pack(const char* in_path, const char* fst_file, const char* mount, const cha char* cur_dir = dirs2process.front(); dirs2process.pop(); - SPEW(("Processing dir: ", "%s\n", cur_dir)); + fprintf( stdout, "Processing dir: %s\n", cur_dir); char* cur_search_path = new char[strlen(prefix) + strlen(PATH_SEPARATOR) + strlen(cur_dir) + strlen(PATH_SEPARATOR) + strlen("*") + 1]; if(strlen(cur_dir) > 0) { @@ -187,8 +185,7 @@ int pack(const char* in_path, const char* fst_file, const char* mount, const cha } files2pack.push(filename); - SPEW(("\t", "%s\n", filename)); - num_files2pack++; + printf( "\t%s\n", filename); } else { if(strcmp(findResult.cFileName, ".") && strcmp(findResult.cFileName, "..")) { char* findString = new char[strlen(cur_dir) + strlen(findResult.cFileName) + strlen(PATH_SEPARATOR) + 1]; @@ -239,14 +236,12 @@ int pack(const char* in_path, const char* fst_file, const char* mount, const cha strcpy(fname, line); files2pack.push(fname); - - num_files2pack++; } fclose(fh); delete[] line; } - SPEW(("DBG: ", "Numfiles to pack: %d\n", num_files2pack)); + printf( "DBG: Numfiles to pack: %lu\n", files2pack.size() ); size_t filebuf_size = CHUNK_SIZE; uint8_t* filebuf = new uint8_t[filebuf_size]; @@ -295,7 +290,7 @@ int pack(const char* in_path, const char* fst_file, const char* mount, const cha if(mount) { if (strstr(filename, "pmwbubba.fit")) { - int asdfa = 0; + // int asdfa = 0; } S_snprintf(filename_buf, filenamebuf_size, "%s" PATH_SEPARATOR "%s", mount, filename); diff --git a/mclib/terrtxm2.h b/mclib/terrtxm2.h index 8ffcf48ec..ec316d315 100644 --- a/mclib/terrtxm2.h +++ b/mclib/terrtxm2.h @@ -30,7 +30,7 @@ #define NO_ERR 0 #endif -#define MAX_WATER_DETAIL_TEXTURES 256 +#define MAX_WATER_DETAIL_TEXTURES 16 #define TOTAL_COLORMAP_TYPES 5 //--------------------------------------------------------------------------- diff --git a/mclib/tgl.cpp b/mclib/tgl.cpp index 6825d8f34..56767aa43 100644 --- a/mclib/tgl.cpp +++ b/mclib/tgl.cpp @@ -2457,6 +2457,11 @@ long TG_Shape::MultiTransformShape (Stuff::Matrix4D *shapeToClip, Stuff::Point3D } } +#ifdef ALSO_RENDER_USING_TEX_SHADER + // This piece of code renders mechs and vehicles using the gos_tex_vertex_lighted.vert shader. This is in addition to the same objectes being + // rendered by addTriangle above. This results in a sparkling effect as the 2 renders fight each other as the mechs rotate. This behaviour is + // quite evident with 5 mechs. + // FIXME: this (listOfTypeTriangles[0]) is not correct if model has more than 1 texture! if (!isSpotlight && !isWindow && !theShape->listOfTextures[theShape->listOfTypeTriangles[0].localTextureHandle].textureAlpha && (alphaValue == 0xff)) { @@ -2492,6 +2497,7 @@ long TG_Shape::MultiTransformShape (Stuff::Matrix4D *shapeToClip, Stuff::Point3D mcTextureManager->addRenderShape(theShape->listOfTextures[theShape->listOfTypeTriangles[0].localTextureHandle].mcTextureNodeIndex, MC2_DRAWSOLID | addFlags); } } +#endif gosASSERT(oneOff || oneOn); diff --git a/mclib/txmmgr.cpp b/mclib/txmmgr.cpp index 03baa87be..79b381ab8 100644 --- a/mclib/txmmgr.cpp +++ b/mclib/txmmgr.cpp @@ -571,7 +571,7 @@ void MC_TextureManager::addRenderShape(DWORD nodeId, TG_RenderShape* render_shap masterTextureNodes[nodeId].hardwareVertexData2->currentShape = shapes; } - else if (masterTextureNodes[nodeId].vertexData3 && + else if (masterTextureNodes[nodeId].hardwareVertexData3 && masterTextureNodes[nodeId].vertexData3->flags == flags) { TG_RenderShape * shapes = masterTextureNodes[nodeId].hardwareVertexData3->currentShape; diff --git a/mclib/txmmgr.h b/mclib/txmmgr.h index cc46d251d..ccaeca455 100644 --- a/mclib/txmmgr.h +++ b/mclib/txmmgr.h @@ -517,7 +517,7 @@ class MC_TextureManager masterTextureNodes[nodeId].hardwareVertexData2->flags = flags; masterTextureNodes[nodeId].hardwareVertexData2->textureIndex = nodeId; } - else if (masterTextureNodes[nodeId].vertexData && + else if (masterTextureNodes[nodeId].hardwareVertexData && (masterTextureNodes[nodeId].hardwareVertexData->flags != flags) && masterTextureNodes[nodeId].hardwareVertexData2 && (masterTextureNodes[nodeId].hardwareVertexData2->flags != flags) && diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt index 7fdb3b4cd..fea807947 100644 --- a/res/CMakeLists.txt +++ b/res/CMakeLists.txt @@ -1,3 +1,6 @@ +cmake_minimum_required (VERSION 3.14) +project(mc2res) + set(RES_SOURCES libmain.cpp libmainc.cpp) if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") @@ -10,4 +13,10 @@ else("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") endif("${CMAKE_SIZEOF_VOID_P}" EQUAL "8") include_directories("." "../test_scripts/res_conv") -add_library(mc2res_${res_suffix} SHARED ${RES_SOURCES}) +add_library(${PROJECT_NAME} SHARED ${RES_SOURCES}) + +add_custom_command( + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/libmc2res.so + ${CMAKE_CURRENT_BINARY_DIR}/../..) diff --git a/shaders/gos_tex_vertex_lighted.vert b/shaders/gos_tex_vertex_lighted.vert index 8310417ab..71a05fc6a 100644 --- a/shaders/gos_tex_vertex_lighted.vert +++ b/shaders/gos_tex_vertex_lighted.vert @@ -42,7 +42,9 @@ void main(void) vec4 p = wvp_ * vec4(pos.xyz, 1); float rhw = 1 / p.w; - p.x = (p.x * rhw) * vp.z + vp.x + 100.0; + // The + 100 causes a duplicate model to be rendered to the right of the actual object + //p.x = (p.x * rhw) * vp.z + vp.x + 100.0; + p.x = (p.x * rhw) * vp.z + vp.x; p.y = (p.y * rhw) * vp.w + vp.y; p.z = p.z * rhw; p.w = abs(rhw); diff --git a/text_tool/CMakeLists.txt b/text_tool/CMakeLists.txt index 8fc95651f..ff576d909 100644 --- a/text_tool/CMakeLists.txt +++ b/text_tool/CMakeLists.txt @@ -1,8 +1,17 @@ +cmake_minimum_required (VERSION 3.14) +project(text_tool) + add_definitions(-DUSE_ASSEMBLER_CODE=0) add_definitions(-DLINUX_BUILD) set(TEXT_TOOL_SOURCES "main.cpp") -add_executable(text_tool ${TEXT_TOOL_SOURCES}) -target_link_libraries(text_tool gameos windows SDL2::Main SDL2::TTF GLEW::GLEW ${ADDITIONAL_LIBS} OpenGL::GL) +add_executable(${PROJECT_NAME} ${TEXT_TOOL_SOURCES}) +target_link_libraries(${PROJECT_NAME} gameos windows SDL2::Main SDL2::TTF GLEW::GLEW ${ADDITIONAL_LIBS} OpenGL::GL) + +add_custom_command( + TARGET ${PROJECT_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_BINARY_DIR}/text_tool + ${MC2_DATA_PATH}/build_scripts/) diff --git a/text_tool/main.cpp b/text_tool/main.cpp index 85ef57048..a34669310 100644 --- a/text_tool/main.cpp +++ b/text_tool/main.cpp @@ -1,3 +1,5 @@ +#define _ARMOR + #include "gameos.hpp" #include "gos_render.h" #include "gos_font.h" @@ -13,6 +15,8 @@ #include "utils/shader_builder.h" #include "utils/gl_utils.h" +#include + static const uint32_t NUM_GLYPHS = 255 - 32; static const uint32_t START_GLYPH = 32; @@ -69,10 +73,11 @@ int main(int argc, char** argv) const char* size = argv[2]; const char* outFile = argv[3]; + int fontSize = atoi(size); if(fontSize<=0 || fontSize>=100) { printf("Invalid font size: %d\n", fontSize); - return 1; + return 2; } //int size_width = 2; // 2 chars enough to store 0 to 99 @@ -91,25 +96,26 @@ int main(int argc, char** argv) graphics::RenderWindowHandle win = graphics::create_window("text_tool", 512, 512); if(!win) - return 1; + return 3; + graphics::RenderContextHandle ctx = graphics::init_render_context(win); if(!ctx) - return 1; + return 4; GLenum err = glewInit(); if (GLEW_OK != err) { SPEW(("GLEW", "Error: %s\n", glewGetErrorString(err))); - return 1; + return 5; } SPEW(("GRAPHICS", "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION))); - if (!GLEW_ARB_vertex_program || !GLEW_ARB_vertex_program) - { - SPEW(("GRAPHICS", "No shader program support\n")); - return 1; - } + // if ( !GLEW_ARB_vertex_program ) + // { + // SPEW(("GRAPHICS", "No shader program support\n")); + // return 6; + // } graphics::make_current_context(ctx); @@ -117,7 +123,7 @@ int main(int argc, char** argv) if(TTF_Init() == -1) { printf("TTF_Init: %s\n", TTF_GetError()); - exit(1); + exit(7); } int outlinePixelSize = 0; @@ -125,7 +131,7 @@ int main(int argc, char** argv) TTF_Font* font = TTF_OpenFont(fontFile, fontSize); if(!font) { printf("TTF_OpenFont: %s\n", TTF_GetError()); - exit(1); + exit(8); } TTF_SetFontStyle(font, TTF_STYLE_NORMAL);