# HG changeset patch # User koda # Date 1352846389 -3600 # Node ID 25a4daa6473cef3a0a62617171176867c8df7284 # Parent 796f2653f21d229110facb675fbdf1c26590f97e cleanup headers, remove -I . from rtl lib to save a few warnings diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/CMakeLists.txt --- a/project_files/hwc/CMakeLists.txt Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/CMakeLists.txt Tue Nov 13 23:39:49 2012 +0100 @@ -31,9 +31,9 @@ find_package(SDL_ttf REQUIRED) #compile our rtl implementation +add_subdirectory(rtl) include_directories("${GLEW_INCLUDE_PATH}") include_directories("${CMAKE_CURRENT_SOURCE_DIR}/rtl") -add_subdirectory(rtl) configure_file(${CMAKE_SOURCE_DIR}/hedgewars/config.inc.in ${CMAKE_CURRENT_BINARY_DIR}/config.inc) diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/Math.h diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/CMakeLists.txt --- a/project_files/hwc/rtl/CMakeLists.txt Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/CMakeLists.txt Tue Nov 13 23:39:49 2012 +0100 @@ -1,13 +1,8 @@ - -set(fpcrtl_src fileio.c - misc.c - pmath.c - system.c - sysutils.c -) include_directories(${GLEW_INCLUDE_PATH}) +file(GLOB fpcrtl_src *.c) + add_library(fpcrtl ${fpcrtl_src}) #if(WEBGL) diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/Math.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/hwc/rtl/Math.h Tue Nov 13 23:39:49 2012 +0100 @@ -0,0 +1,4 @@ +#pragma once + +#include + diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/SysUtils.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/hwc/rtl/SysUtils.h Tue Nov 13 23:39:49 2012 +0100 @@ -0,0 +1,41 @@ +#ifndef _FPCRTL_SYSUTILS_H_ +#define _FPCRTL_SYSUTILS_H_ + +#include "Types.h" + +// EFFECTS: return the current date time in pascal notation +// http://www.merlyn.demon.co.uk/del-prgg.htm#TDT +TDateTime fpcrtl_now(); +#define now fpcrtl_now +#define Now fpcrtl_now + +// EFFECTS: return the current time +// http://www.merlyn.demon.co.uk/del-prgg.htm#TDT +TDateTime fpcrtl_time(); + + +// EFFECTS: return the current date +// http://www.merlyn.demon.co.uk/del-prgg.htm#TDT +TDateTime fpcrtl_date(); +#define date fpcrtl_date +#define Date fpcrtl_date + +// EFFECTS: Trim strips blank characters (spaces) at the beginning and end of S +// and returns the resulting string. Only #32 characters are stripped. +// If the string contains only spaces, an empty string is returned. +string255 fpcrtl_trim(string255 s); +#define trim fpcrtl_trim +#define Trim fpcrtl_trim + +Integer fpcrtl_strToInt(string255 s); +#define StrToInt fpcrtl_strToInt +#define strToInt fpcrtl_strToInt + +string255 fpcrtl_extractFileName(string255 f); +#define fpcrtl_ExtractFileName fpcrtl_extractFileName + +string255 fpcrtl_strPas(PChar); +#define fpcrtl_StrPas fpcrtl_strPas + + +#endif diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/Types.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/project_files/hwc/rtl/Types.h Tue Nov 13 23:39:49 2012 +0100 @@ -0,0 +1,39 @@ +#ifndef _TYPES_H_ +#define _TYPES_H_ + +#include "pas2c.h" + +/* + * Not very useful currently + */ + +typedef double TDate; +typedef double TTime; +typedef double TDateTime; +typedef string255 TMonthNameArray[13]; +typedef string255 TWeekNameArray[8]; + +typedef struct { + Byte CurrencyFormat; + Byte NegCurrFormat; + Char ThousandSeparator; + Char DecimalSeparator; + Byte CurrencyDecimals; + Char DateSeparator; + Char TimeSeparator; + Char ListSeparator; + string255 CurrencyString; + string255 ShortDateFormat; + string255 LongDateFormat; + string255 TimeAMString; + string255 TimePMString; + string255 ShortTimeFormat; + string255 LongTimeFormat; + TMonthNameArray ShortMonthNames; + TMonthNameArray LongMonthNames; + TWeekNameArray ShortDayNames; + TWeekNameArray LongDayNames; + Word TwoDigitYearCenturyWindow; +}TFormatSettings; + +#endif diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/fileio.h --- a/project_files/hwc/rtl/fileio.h Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/fileio.h Tue Nov 13 23:39:49 2012 +0100 @@ -2,7 +2,7 @@ #define FILEIO_H_ #include -#include "types.h" +#include "Types.h" #include "misc.h" extern int FileMode; diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/fpcrtl.h --- a/project_files/hwc/rtl/fpcrtl.h Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/fpcrtl.h Tue Nov 13 23:39:49 2012 +0100 @@ -3,13 +3,13 @@ #include #include -#include #include #include +#include +#include "SysUtils.h" #include "system.h" #include "misc.h" -#include "sysutils.h" #include "fileio.h" #include "pmath.h" diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/pmath.c --- a/project_files/hwc/rtl/pmath.c Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/pmath.c Tue Nov 13 23:39:49 2012 +0100 @@ -1,7 +1,6 @@ #include "pmath.h" +#include #include -#include -#include /* * power raises base to the power power. diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/pmath.h --- a/project_files/hwc/rtl/pmath.h Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/pmath.h Tue Nov 13 23:39:49 2012 +0100 @@ -2,6 +2,7 @@ #define PMATH_H_ #include +#include #define fpcrtl_min(a, b) ((a) < (b) ? (a) : (b)) #define fpcrtl_max(a, b) ((a) > (b) ? (a) : (b)) diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/system.c --- a/project_files/hwc/rtl/system.c Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/system.c Tue Nov 13 23:39:49 2012 +0100 @@ -3,13 +3,10 @@ #include #include #include -#include int paramCount; string255 params[MAX_PARAMS]; -double pi = M_PI; - string255 fpcrtl_copy(string255 s, Integer index, Integer count) { string255 result = STRINIT(""); diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/system.h --- a/project_files/hwc/rtl/system.h Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/system.h Tue Nov 13 23:39:49 2012 +0100 @@ -2,8 +2,7 @@ #define SYSTEM_H_ #include -#include -#include "types.h" +#include "Types.h" #include "misc.h" extern double pi; diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/sysutils.c --- a/project_files/hwc/rtl/sysutils.c Tue Nov 13 22:24:30 2012 +0100 +++ b/project_files/hwc/rtl/sysutils.c Tue Nov 13 23:39:49 2012 +0100 @@ -1,11 +1,13 @@ -#include "sysutils.h" -#include "system.h" -#include "misc.h" +#include "SysUtils.h" + #include #include #include #include +#include "system.h" +#include "misc.h" + TDateTime fpcrtl_date() { const int num_days_between_1900_1980 = 29220; diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/sysutils.h --- a/project_files/hwc/rtl/sysutils.h Tue Nov 13 22:24:30 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -#ifndef _FPCRTL_SYSUTILS_H_ -#define _FPCRTL_SYSUTILS_H_ - -#include "types.h" - -// EFFECTS: return the current date time in pascal notation -// http://www.merlyn.demon.co.uk/del-prgg.htm#TDT -TDateTime fpcrtl_now(); -#define now fpcrtl_now -#define Now fpcrtl_now - -// EFFECTS: return the current time -// http://www.merlyn.demon.co.uk/del-prgg.htm#TDT -TDateTime fpcrtl_time(); - - -// EFFECTS: return the current date -// http://www.merlyn.demon.co.uk/del-prgg.htm#TDT -TDateTime fpcrtl_date(); -#define date fpcrtl_date -#define Date fpcrtl_date - -// EFFECTS: Trim strips blank characters (spaces) at the beginning and end of S -// and returns the resulting string. Only #32 characters are stripped. -// If the string contains only spaces, an empty string is returned. -string255 fpcrtl_trim(string255 s); -#define trim fpcrtl_trim -#define Trim fpcrtl_trim - -Integer fpcrtl_strToInt(string255 s); -#define StrToInt fpcrtl_strToInt -#define strToInt fpcrtl_strToInt - -string255 fpcrtl_extractFileName(string255 f); -#define fpcrtl_ExtractFileName fpcrtl_extractFileName - -string255 fpcrtl_strPas(PChar); -#define fpcrtl_StrPas fpcrtl_strPas - - -#endif diff -r 796f2653f21d -r 25a4daa6473c project_files/hwc/rtl/types.h --- a/project_files/hwc/rtl/types.h Tue Nov 13 22:24:30 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -#ifndef _TYPES_H_ -#define _TYPES_H_ - -#include "pas2c.h" - -/* - * Not very useful currently - */ - -typedef double TDate; -typedef double TTime; -typedef double TDateTime; -typedef string255 TMonthNameArray[13]; -typedef string255 TWeekNameArray[8]; - -typedef struct { - Byte CurrencyFormat; - Byte NegCurrFormat; - Char ThousandSeparator; - Char DecimalSeparator; - Byte CurrencyDecimals; - Char DateSeparator; - Char TimeSeparator; - Char ListSeparator; - string255 CurrencyString; - string255 ShortDateFormat; - string255 LongDateFormat; - string255 TimeAMString; - string255 TimePMString; - string255 ShortTimeFormat; - string255 LongTimeFormat; - TMonthNameArray ShortMonthNames; - TMonthNameArray LongMonthNames; - TWeekNameArray ShortDayNames; - TWeekNameArray LongDayNames; - Word TwoDigitYearCenturyWindow; -}TFormatSettings; - -#endif