From 4442056335b67e56879289b87cb78c5cae5fb04c Mon Sep 17 00:00:00 2001 From: Fatbag Date: Sun, 25 Mar 2012 20:51:30 -0500 Subject: [PATCH] Added libmpg123 to FileHandler. This and libjpeg-turbo are now being assembled by GCC and NASM, respectively. BMP support will be coming next. --- CMakeLists.txt | 8 ++++++-- Client/Client.cpp | 4 +++- Client/EngineInterface.hpp | 1 - Client/TODO | 2 +- Libraries/FileHandler/CMakeLists.txt | 1 + Libraries/FileHandler/bmp/{Makefile => read_bmp.c} | 0 Libraries/FileHandler/ini/{Makefile => read_ini.c} | 0 Libraries/FileHandler/tga/{Makefile => read_tga.c} | 0 Libraries/FileHandler/wav/{Makefile => read_wav.c} | 0 9 files changed, 11 insertions(+), 5 deletions(-) rename Libraries/FileHandler/bmp/{Makefile => read_bmp.c} (100%) rename Libraries/FileHandler/ini/{Makefile => read_ini.c} (100%) rename Libraries/FileHandler/tga/{Makefile => read_tga.c} (100%) rename Libraries/FileHandler/wav/{Makefile => read_wav.c} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index d62fca0..222ad42 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,8 +39,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) endif() # Size - set(CFLAGS_SIZE "${CFLAGS} -Os -g0 -fomit-frame-pointer -ffast-math -fmerge-all-constants -funsafe-loop-optimizations -fmerge-all-constants -fsched-pressure") - set(LDFLAGS_SIZE "${LDFLAGS} -s -fwhole-program") + set(CFLAGS_SIZE "${CFLAGS} -Os -g0 -fomit-frame-pointer -ffast-math -fmerge-all-constants -funsafe-loop-optimizations -fmerge-all-constants -fsched-pressure -flto") + set(LDFLAGS_SIZE "${LDFLAGS} -s -fwhole-program -flto") # Speed set(CFLAGS_SPEED "${CFLAGS} -O3 -g0 -fomit-frame-pointer -ffast-math -fmerge-all-constants -funsafe-loop-optimizations -fmerge-all-constants -fsched-pressure -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las -fsched-spec-load -fsched-spec-load-dangerous -fsched-stalled-insns=0 -fsched-stalled-insns-dep -fsched2-use-superblocks -fipa-pta -fipa-matrix-reorg -ftree-loop-linear -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -floop-parallelize-all -ftree-loop-distribution -ftree-loop-im -ftree-loop-ivcanon -fivopts -fvect-cost-model -fvariable-expansion-in-unroller -fbranch-target-load-optimize -maccumulate-outgoing-args -flto") @@ -62,6 +62,10 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_RC_FLAGS "${RCFLAGS}") endif() +enable_language(ASM) +set(CMAKE_ASM_COMPILER "gcc") +set(CMAKE_ASM_FLAGS "${CFLAGS}") + if(WIN32) set(DIST_NAME "windows" CACHE STRING "Output folder name for the _dist folder (no start or end slash)") elseif(APPLE) diff --git a/Client/Client.cpp b/Client/Client.cpp index 104cff4..58e1699 100644 --- a/Client/Client.cpp +++ b/Client/Client.cpp @@ -91,6 +91,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) LARGE_INTEGER CurrentTime; QueryPerformanceCounter(&CurrentTime); float TimeDelta = (float)(CurrentTime.QuadPart-PreviousTime.QuadPart)/System::ClockFreq.QuadPart; + if(TimeDelta < 0 || TimeDelta >= 5) //Invalid TimeDelta + continue; int result = CurrentScene->RunFor(TimeDelta); if(result == System::SHUTDOWN) @@ -104,7 +106,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int) QueryPerformanceCounter(&CurrentTime); float SleepDuration = (System::FramePeriod - (float)(CurrentTime.QuadPart-PreviousTime.QuadPart)/System::ClockFreq.QuadPart) * 1000; - if(SleepDuration > 1) Sleep((unsigned) SleepDuration); + if(SleepDuration > 1 && SleepDuration < 100) Sleep((unsigned) SleepDuration); } ShowWindow(Window::hWnd, SW_HIDE); diff --git a/Client/EngineInterface.hpp b/Client/EngineInterface.hpp index c177016..b1d155b 100644 --- a/Client/EngineInterface.hpp +++ b/Client/EngineInterface.hpp @@ -17,7 +17,6 @@ #define WINVER 0x0502 #define _WIN32_WINNT 0x0502 -#define NTDDI_VERSION 0x05010300 #define _CRT_SECURE_NO_WARNINGS #include diff --git a/Client/TODO b/Client/TODO index fc64ef7..462081a 100644 --- a/Client/TODO +++ b/Client/TODO @@ -12,7 +12,7 @@ Development Phase: Planning Technical Preview 1 Schedule: (Not very subject to change) 1. Implement cst and uis parsers [40%] - 2. Replicate functionality up until the login dialog + 2. Replicate functionality up until the login dialog [0%] 3. Implement the OpenGL-based windowing system 4. Replicate character selection and creation features and the city selection dialog 5. Implement the code needed to allow the game to read all necessary files from the TSOClient folder \ No newline at end of file diff --git a/Libraries/FileHandler/CMakeLists.txt b/Libraries/FileHandler/CMakeLists.txt index 27dbc36..0e53197 100644 --- a/Libraries/FileHandler/CMakeLists.txt +++ b/Libraries/FileHandler/CMakeLists.txt @@ -5,6 +5,7 @@ add_subdirectory(iff) add_subdirectory(libexpat) add_subdirectory(libfar) add_subdirectory(libjpeg-turbo) +add_subdirectory(libmpg123) add_subdirectory(libpng) add_subdirectory(utk) add_subdirectory(xa) diff --git a/Libraries/FileHandler/bmp/Makefile b/Libraries/FileHandler/bmp/read_bmp.c similarity index 100% rename from Libraries/FileHandler/bmp/Makefile rename to Libraries/FileHandler/bmp/read_bmp.c diff --git a/Libraries/FileHandler/ini/Makefile b/Libraries/FileHandler/ini/read_ini.c similarity index 100% rename from Libraries/FileHandler/ini/Makefile rename to Libraries/FileHandler/ini/read_ini.c diff --git a/Libraries/FileHandler/tga/Makefile b/Libraries/FileHandler/tga/read_tga.c similarity index 100% rename from Libraries/FileHandler/tga/Makefile rename to Libraries/FileHandler/tga/read_tga.c diff --git a/Libraries/FileHandler/wav/Makefile b/Libraries/FileHandler/wav/read_wav.c similarity index 100% rename from Libraries/FileHandler/wav/Makefile rename to Libraries/FileHandler/wav/read_wav.c